query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7a6f51971532141ffafdf4b196440d41 | a980589dee1ed1ea10ce2cf0cce54fb6 | \brief Mainly check whether current context is while context. | bool OpenGLHelpers::isContextActive()
{
return wglGetCurrentContext() != 0;
} | 1 |
65a95126a0c9b9d4eab77668b73f621e | 52de3caab5ab9f74bb30d5f98db5850f | 检查材质是否使用了无效的贴图属性,needTextureGUID表示是否只检测引用了贴图的属性 | List<Material> allowedMaterialsFilter,
List<string> texPropertyNames,
MB2_EditorMethodsInterface textureEditorMethods,
List<MB_TexSet> distinctMaterialTextures,
List<GameObject> usedObjsToMesh)
{
bool outOfBoundsUVs = false;
fo... | 0 |
86e0183b0642bde265541dabec3515df | 6b6035a67d0084ec2b596030d72e044e | Deletes fighter from database | export default class APIController extends EventDispatcher
deleteFighter(id)
{
Fetcher.remove(id, this.dataStore.coachModel.token);
} | 1 |
90fe553498c332ed869ecc0452f878ed | ddea794821d91d4f57714ed09d132f9a | Convert bit field definitions from table format to metadata
keywords. | lines = code.splitlines()
Field = collections.namedtuple("field", ["msb", "lsb", "name", "desc", "enums", 'access_type', 'reset_default'])
fields = []
msb = -1
for f in lines:
if f.strip() == "":
continue
m = re.search(r"^\s*(\d+)(?::(\d+))... | 1 |
24668ff3189a1437cb2eacff6f0e6aa6 | 370715a1bc40da4e8e71af7b6030d32d | Set the trigger length in seconds. | public class YWatchdog extends YFunction
public int setTriggerDuration( long newval) throws YAPI_Exception
{ return set_triggerDuration(newval); } | 1 |
2a73dab34b16d80149873182412d191c | a2e97aca7b2afc777596a9f57fa34e90 | function that will display date picker dialog box | public class MainActivity extends AppCompatActivity
public void showDatePicker(View view) {
DialogFragment newFragment = new DatePickerFragment();
newFragment.show(getSupportFragmentManager(),getString(R.string.datepicker));
} | 1 |
4adbceef69cf75c87cb30a6ddad97617 | a543e781a90b0b25146d5956aadd0261 | Opens the OpenML web page corresponding to this object in your default browser. | class JupyterDeployment(ABC):
def open_in_browser(self):
pass | 0 |
2080657cd0a3c554b225f048edb3e6bc | 9e24e76185896726ff799cd55e392330 | Delete a number of texture objects. | namespace OpenTK.Graphics
public partial class GL
[DllImportAttribute("libGLESv2.dll", EntryPoint = "glDeleteTextures")]
public static extern unsafe void DeleteTextures(Int32 n, Int32* textures); | 1 |
251aaeef559f072faba8a3863900f644 | cdc6ce531e01c015d1ee5dba2cd8613d | Puts a <code>null</code> value into the map. | public final class EscapeSequence public static class Builder
public Builder addNullMapping(char from) {
this.entries.add(new Entry(from, null));
return this;
} | 1 |
f86d429ec4450c0ab8a0c4975fdab60d | bfac1b0298a635221cac80b74437c594 | @brief Configure the MSYS CPU port. | {
__IO stc_port_pcr_field_t *PCRx;
uint8_t u8PinPos = 0u;
DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port));
DDL_ASSERT(IS_GPIO_PIN(u8Pin));
DDL_ASSERT(IS_GPIO_FUNC(u8Func));
GPIO_Unlock();
for (u8PinPos = 0u; u8PinPos < 8u; u8PinPos ++)
{
if (u8Pin & (1ul<<u8PinPos))
{
... | 0 |
b9b88e94a0b60451fca4406462b63e0c | 029da204ffbb0e0a249a5b30710a7040 | 获取内圆颜色 | public class CircleAssetView extends View
public void setReachInsideColor(int mReachInsideColor) {
this.mReachInsideColor = mReachInsideColor;
mReachInsidePaint.setColor(mReachInsideColor);
invalidate();
} | 0 |
5350cc652323c54ff2f01c17a585357b | c8757425de4794259f34691b24811671 | Check that code runs without error | TEST_F(C_CodegenTests, callCodegen)
{
EXPECT_RUN_OK("call1",
"function double(a:int):int {\n"
" a * 2\n"
"}\n"
"function doNothing() {\n"
" return;\n"
"}\n"
"function divide(a:int, b:int):(q:int, r:int) {\n"
" (a/b, a%b)\n"
"}\n"
"fu... | 1 |
3a2bfc511950e24a1e080adebb6f4274 | 675811d6529430f92c7e2260161b76f3 | 匹配任意字段名和字段内容查询简历 | $resu = array('code' => 1,'msg' => '数据查询成功!','data' => array());
$data['jobinten']=array("like","%".$_POST['keyword']."%");
$list = M('resume')
->where($data)
->field('picture,name,gender,age,education,worktime,region,jobinten,year')
->select();
if($li... | 0 |
9cab2f7c7e8d9d6ed96a8622afd85ac4 | ec2ff99a4fe1001cfe11e19f3e7c698e | 把bio编码转化为bioes编码
返回新的tags | class Loader:
def iobes_iob(self, tags):
new_tags = []
for i, tag in enumerate(tags):
if tag.split('-')[0] == 'B':
new_tags.append(tag)
elif tag.split('-')[0] == 'I':
new_tags.append(tag)
elif tag.split('-')[0] == 'S':
n... | 0 |
7878811b17def099b8813d26317a56b8 | 7f61448ad6da3ef0f9cb03f40c5be655 | Only used debugging/testing | cases like (1) | 0 |
136e021c5a8b0fecf250f5227fc930cb | 22c4f5939d901253af4581aa1b3f5b4e | Báo cáo tình trạng kết nối của Contact L1 | $require_model = array(
'courses' => array()
);
$data = array_merge($this->data, $this->_get_require_data($require_model));
$get = $this->input->get();
$input = array();
if ($this->role_id == 1) {
$input['where'] = array('id' => $this->user_id);
... | 1 |
08080ba8ade2b776273cc15a0b7b6242 | c59d8c6e46ac059044458b8a1a7c378f | Gets the element from the begin of list, and removes
it from list.
Complexity of method is O(1). | if (isEmpty()) {
throw new EmptyCollectionException();
}
final T result = valueAt(0);
removeAt(0);
return result;
} | 1 |
f331b0f42e4c582f94825bd2ec3c40a6 | bb3520d190019f51dd2d3648e80b10fc | Apply the Nelson Siegel formula to a time. | {
if (m_tn.dateCount == 0)
{
m_tn.lastclosing = Orgind.min;
}
double HL = (Orgind.max - Orgind.min);
double HP = abs(Orgind.max - m_tn.lastclosing);
double PL = abs(m_tn.lastclosing - Orgind.min);
double TR = MAX(HL, MAX(HP, PL));
if (m_tn.dateCount < 21)
{
m_tn.N += TR / 20;
}
else
{
m_tn.N = (19 * m... | 0 |
435081e0c7e44e9097caa090e6e2d1f5 | 0fd8d8434e85df674daebf9dce790baf | 检索库的文档字符串、完整的帮助文件名和路径以及帮助文件中的库帮助主题的上下文标识符。 | namespace System.Runtime.InteropServices
void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); | 1 |
6837dd86e1628ac7c5174a4a8bdeb399 | ac715a7cf6682d7b32699f76c869c512 | Wait for the nodemanager to be ready | if not self.thread.is_alive():
self.thread.start()
i = 0
while i< self.timeout and not self.thread.nodeman.is_started:
time.sleep(1)
i += 1
print(self.thread.nodeman.state) | 1 |
03f45d90bf2b91ad32fa50df72f93552 | 90ecf21fb7377de8f69ce0e289812766 | Değişiklikleri kaydeder. Etkilenen kayıt sayısını döndürür. | namespace TodoApplication.DataAccess.UnitOfWork
public class UnitOfWork : IUnitOfWork
public int SaveChanges()
{
try
{
int result = DbContext.SaveChanges();
return result;
}
catch (DbUpdateException ex)
{
... | 1 |
4cff5d077418dfc7c32ec37a4a474d8a | 91134d53268c65d69f0f90a6b12dc562 | Its purpose is to check if a website covered by a login form has changes (a published report, a new line in a
table, a different string, etc...). The constructor just set the correct configuration based on the config file | self._url_table = url_table
self._backup_enabled = backup
self._html_converter = HTMLConverter(url_table)
self._css_converter = CSSConverter(url_table) | 0 |
f955234a150aa9a20a2edebf3e4e65be | efcb7153c4bbfe0fbfe2ad0fe4dc191f | NAME
H5A_term_interface
PURPOSE
Terminate various H5A objects
USAGE
void H5A_term_interface()
RETURNS
DESCRIPTION
Release any other resources allocated.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Can't report errors...
EXAMPLES
REVISION LOG | {
herr_t status = H5close();
return (status < 0);
} | 0 |
4701cc5103d6948c5ef832c53ba545e7 | f796ec4eb393e6c3938270f22617b7ce | @brief Example of a server implementation for UDP | int main(int argc, char* argv[]) {
std::vector<int> ports = { 1053 };
evpp::udp::Server server;
Handler h;
g_recvbuf_clk = std::bind(&Handler::OnRecv,&h,_1,_2,_3,_4);
server.SetThreadDispatchPolicy(evpp::ThreadDispatchPolicy::kIPAddressHashing);
server.SetMessageHandler([](evpp::EventLoop* loop, evpp::udp::... | 1 |
27e7d5f210683f861133ffc30a141704 | 09f0e10e506acec2fa13236ea84f506e | получить кол-во серверов в бд | function server_list_count() {
$sql = sprintf("select count(%s) as num from %s", DB_SERVERS_ID, SYNC_SERVERS_TABLE);
$count = get_row_from_db_by_sql($sql);
if ( sync_array($count) )
return $count['num'];
else
return 0;
} | 1 |
fc4243eb9f33d45b1964f3929cb571bf | 519cc62ef91ab973358e87d77a40e02e | convert list of dict into dict of list
assume all dicts have same keys and value types | ldic = {}
for key in dlst[0]:
ldic[key] = [dic[key] for dic in dlst]
return ldic | 1 |
c4974bd4c92d5d64ed7a71d11f091935 | e9e7facf767c723e30c463ecb074aafc | 得到所有的没有分配的座位 | seats = []
for index in range(self.__count - 1):
seats.append((self.curSeatId + index + 1) % self.__count)
return seats | 0 |
21424c285c6ada0ccecf3d4058a0121a | f0e1775422e654eb4b32158799cc0b3a | DeleteEmailAddresses deletes multiple email addresses | {
if (mail_ids.Length > 0)
{
string idString = string.Empty;
foreach (string id in mail_ids)
{
idString += string.Format("&email_ids[]{0}", id);
}
Contact("f=del_email" + idString);
... | 1 |
4931c67c83a776410fb1d9e7349d36d5 | a284c32da5431df3808e95e6926941aa | 获取表的数据库名称 | class Client
public function getDbName($tableName, array $partition = [])
{
if (!isset($this->shards[$tableName]) || !isset($this->shards[$tableName]['db_name'])) {
throw new \Exception("表 $tableName 配置不正确");
}
$dbName = $this->shards[$tableName]['db_name'];
$maxDbNum = 1... | 1 |
d6bf476d2417f08c8bde13bec173599c | 48f8abcb23d27c0e63393cdcee24aee1 | Build matrix for trig interpolation | {
interp_matrix.clear();
double x, y;
interp_matrix.resize(301);
for(int i=0;i<301;i++)
{
interp_matrix[i].resize(301);
x = -3.0 + 0.02*i;
for(int j=0;j<301;j++)
{
y = -3.0 + 0.02*j;
interp_matrix[i][j] = 0.0;
for(double z = -4.0; z... | 0 |
034b7a6852e4555897780b7db357ff7e | 4b8e479b3f57bd8740d62b39a5f14459 | Set tender application status as CanceledStatus | self.application_approvals.each do |application_approval|
application_approval.approval_status_type = 'canceled'
application_approval.approval_date = nil
application_approval.updated_user = login_user
application_approval.save!
end
self.approval_status_type = 'canceled'
self.appr... | 1 |
f203c322967a051a5c29c93b7e0e74a3 | cee4493be9621d60a3fafbec2052f8b4 | Gets the total amount of coins this level has. | public int getTotalCoinsCost(); | 1 |
2f642259be901c40c1144a24bf7a8b95 | 70b2d41e25ee487e3e21076cbf823f30 | # calcula capa de salida | Aopt <-function(x, w, b0, b1, fimfunc){
sum(diag(svd.inverse(fimfunc(x = x, w = w, b0 = b0, b1 = b1))))
} | 0 |
59ddc56ab334e9bee6bd9208f6a6dac6 | 6d2c57c508156a1b2472a99d0558ffd3 | Marks a conversation as read in the internal database. | url = self.__create_url(conversation_id, self._csrfToken_ajax)
data = {"patch": {"$set": {"read": True}}}
self._client.post(url, json=data) | 1 |
cf51f167f26b81608c6d28ca0f60d651 | b8a3f8aad0fddd23bd05f02d6d0486c6 | DFS实现拓扑排序 | void ddfs(int x){
dfn[x]=idCount++;
if(hc[x]==0) return;
top[hc[x]]=top[x],ddfs(hc[x]);
for(int i:g[x]) if(i!=hc[x]&&i!=par[x])
top[i]=i,ddfs(i);
} | 0 |
efae398548ee4bf3f3aeeb430441ca91 | 6fb65f0a91e790b8997602d42e7ce09e | Enter a parse tree produced by {@link IDLParser#attr_declarator}. | public class RIIF2BaseListener implements RIIF2Listener
@Override public void enterAttr_ident(RIIF2Parser.Attr_identContext ctx) { } | 0 |
fb2b5afdf72beaeef07ddcc6828b5d1d | a680bf231940560ae859722617c006c2 | 获取页面文章数据,如果没有,则返回基本组件提供的示例数据 | export class ArticleService
async getArticles(page: number, tag: number, limit: number = 10): Promise<Article[]> {
return []
} | 0 |
3e277977c3bf981927d43650c1c3001a | 39c6a6d9ff98ef3a30e06143713a511f | function to delete filial | class FilialeController extends Controller
public function destroy($id)
{
} | 1 |
06b5b9854934aac9b7bd352d12ba3c06 | 70cd40b6784217ccaf638a32e35afcd8 | Initialise the device driver here | {
int result = 0;
printk( KERN_NOTICE "Simple-driver: Initialization started\n" );
result = register_device();
return result;
} | 1 |
4f4a3bae8186e188f4b153eabb9f3224 | cdba55836bded516ea50a32a7406717b | 更新进度,包括更新网络加载速度 | tempProgress += progress;
if (tempTime == 0) {
tempTime = System.currentTimeMillis();
} else {
long currentTime = System.currentTimeMillis();
if ((currentTime - tempTime) > 1000) {
int speed = tempProgress / 1024;
updateDownload... | 1 |
55a96385db57d21176166c3ab5fe808a | e3270c58c7228e4f44fa2de34653c33c | Check whether a time is valid or not.
Check whether the time defined by the arguments hours,
mins, secs and usecs, is valid or not. | namespace Asol.Tools.WorkScheduler.Data
public static bool IsTimeValid(int hour, int minute, int second, decimal fragments, out string message)
{
return XTimeSpan.IsTimeValid(hour, minute, second, fragments, out message);
} | 1 |
f283cc0f95f07f26fa39ec86ad253128 | e02fd0a776eaa4a92d472466c15d3d7b | Resolve the required configurations that haven't been loaded yet. | public class BaseConfigIntrospector extends AbstractConfigIntrospector
public void configureDependencies()
throws ConfigException
{
RuntimeException exn = null;
while (_depCompletions.size() > 0) {
Completion completion = _depCompletions.remove(0);
try {
completion.complete();
}... | 1 |
7681dda59977415a81faf6d185f2e9d8 | 535f19a33bf5f5ac9592e17a528fbb18 | El filosofo piensa. | class Philosopher implements Runnable
private void pondering() throws InterruptedException {
if (mPonderFactor == 0) return;
TimeUnit.MILLISECONDS.sleep(mRandom.nextInt(mPonderFactor * 250));
} | 1 |
4f3b0b44e0a26b273172a5962fe72ad8 | 9361902e6cc189cff2057cebbc3294bc | Считывание байта из eeprom | int eeprom_read_byte(long addr)
{
char data_to_write[2];
BYTE device_addr = EEPROM_DEVICE_ADDRESS;
BYTE read_byte;
int res = 0;
#ifdef EEPROM_128K
BYTE block_addr = 0;
block_addr = addr & 0x00010000;
block_addr = block_addr << 3;
device_addr = device_addr & block_addr;
#endif
if (addr ... | 1 |
c98586006bc5d5b56b33444bf526b84a | eba5891868554c7ed7d24312a734adb5 | Returns diameter of Cyclinder object. | double Circle::getDiameter()
{
return 2 * radius_;
} | 0 |
10e74e483087b0c4440c215088bad78d | 3419814dc4f4f401ebc229d44dc0e785 | 添加脱敏词汇服务
<para>需要在入口程序集目录下创建 sensitive-words.txt</para> | namespace NW.Web.Helper
public static class WordFilterHelper<T>
public static void LoadSensitiveWords()
{
BLL.BLLSession bllSession = BLLSessionFactory.GetBLLSession();
List<Sensitive> words = new List<Sensitive>();
words = bllSession.ISensitiveBLL.GetList(" `Lock` =0 ").... | 0 |
99c48d6b6145bc6ae85edf6a730e3320 | 3c841b387ca8b9be42cd69d0faf51a28 | Seeds the Identity database with roles and administrator. | namespace SFMForFraudTransactions.Models
public static class AppIdentityInitializer
public static void SeedUsers(UserManager<ApplicationUser> userManager)
{
if (userManager.FindByNameAsync("assistant@zemoga.com").Result == null)
{
ApplicationUser user = new Applicatio... | 1 |
f789231be9fdd1eb25565386f8aa3302 | 6491ec22456fffc9481276f6710250d4 | 上传图片,将图片保存到uploaded文件夹下 | def uploadImg(request):
if request.method == 'POST':
new_img = IMG(
img=request.FILES.get('img'),
name=request.FILES.get('img').name
)
new_img.save()
return render(request,'app/uploading.html') | 0 |
111dc1f0d4fb4076c3834afed7bc5372 | 66ad30663d8e815780f0f3fe44fc6c9d | Finds the image files for the training and calcs their features and saves them to the vectors for the SVM. | def train(c=500, g=5.383):
logging.info('train start ...')
svm_params = dict( kernel_type = cv2.SVM_LINEAR, svm_type = cv2.SVM_C_SVC, C = c, gamma=g )
s = 0
for root, dirs, files in os.walk('./images'):
i = 0
for d in dirs:
for rroot, ddirs, ffiles in os.walk('./images/%s'%d)... | 1 |
ba91d88213bf1c4e8052e9455bce0789 | 739658b0c6a94ad50b39c5d71971f038 | Turns dict of dictionaries into flat dict mapping path tuples to leaf values | def flatten_dict(xs, keep_empty_nodes=False, is_leaf=None, sep=None):
assert isinstance(
xs, (flax.core.FrozenDict, dict)
), f'expected (frozen)dict; got {type(xs)}'
def _key(path):
if sep is None:
return path
return sep.join(path)
def _flatten(xs, prefix):
if not isinstance(xs, (flax.co... | 1 |
5b5caf264fb8013dc0e8085be03f2bcb | d36cac6c2648f879994b399c5aeb50ed | 复制DLL到exe生成目录 | {
_releaseDir = FileSystem.CombineDirs(true, _resDir, ZeroEditorUtil.PlatformDirName, HotResConst.DLL_DIR_NAME);
if (false == Directory.Exists(_releaseDir))
{
Directory.CreateDirectory(_releaseDir);
}
_releaseDir = new DirectoryInfo(_re... | 0 |
f8c30f0f2acd483114281af28685562f | 1f32c04b4dd8f0d7c2eab5b686a317e1 | compute employee only for timesheet lines, makes no sense for other lines | class HrTimesheetSheet(models.Model):
def _default_manager1_get(self):
employee = self.env['hr.employee'].search(
[('user_id', '=', self.env.uid)], limit=1)
return employee.parent_id | 0 |
79def4256912602dde6d2d97394d3610 | 1abf2f414f9f5be40446828d16a45de8 | Disable reporting of mouse events. | class Notcurses:
def mouse_disable(self) -> None:
raise NotImplementedError('Stub') | 1 |
8ac5d28056be9f0ab3508566e6eb146e | f7f1644b8b2d475ee65e719beb3012be | Sets the perm_address_landmark of this resume dtls. | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "demographicInformation", propOrder = {
"additionalMouzaOrMoholla",
"additionalVillageOrRoad",
"afisStatus",
"bloodGroup",
"cardIssueReferenceNo",
"cityCorporationOrMunicipality",
"cityCorporationOrMunicipalityId",
"cityCorporationOrM... | 0 |
c8188ab005d0cea6b688e4510d39d319 | 89bb4ef3b5439d7ac2e0044dca41ec78 | Returns the count in the last sample interval | def SampleCount():
return lib.Monitors_Get_SampleCount() | 1 |
ff7fed6f9579fb248a35c5bc1c02f7f6 | 4f614890c758bc5f7f515c4378897a3f | ajax显示子网列表 | if(loadLock==true){
return;
}
loadLock = true;
page=page+1;
$.get(basePath+"webIndexAjax/netword_"+id+".html", {"page":page,"rows":commonPageSize},
function(data){
var pageIndex = data.pageIndex;
if(pageIndex==page){
var projects = data.rows;
var addHtml = '';
for(var i=0;i<projects.length;i++){
... | 1 |
ec69e35a01f303f4be78f650d4ffc1c6 | 1e2b7ae21e873d72abf0ed63697ad71e | Get if CDN should be enabled on a new container or not | public boolean enableContainer(final String name)
{
final CDNApi cdnApi = cloudFilesApi.cdnApiInRegion(REGION);
final URI cdnURI = cdnApi.enable(name);
return (cdnURI != null);
} | 0 |
1a9fb7b18dd2b4bb8d17822cc9db81f3 | af644055cdafa817adf6be2684645df1 | 选择CSV路径 | namespace CL_View
public partial class configform : Form
private void btnCSVPathBrowse_Click(object sender, EventArgs e)
{
if(fldBrowse.ShowDialog() != DialogResult.Cancel)
{
txtCSVPath.Text = fldBrowse.SelectedPath;
}
} | 1 |
1000aa406f36921694f4a3350e9a959c | e71617edfea8dc613b774f74d91d6197 | Get the 根菜单GUID. | public class Menuconfig
public static String getRootID() {
String result_Fid = "";
String sql = "select * from B_Menu where B_Menu.fParentId is null";
HashMap<String, String> sqlMap = new HashMap<String, String>();
sqlMap.put(DatabaseProduct.ORACLE.name(), sql);
Table table = SQL.select(sqlMap, null, dataMode... | 1 |
91620324c19733ef27c798f4c27dfa96 | 0bf6007dd813519912ddc430e75be26c | Constructor - registers everything with the Wordpress API | class Register
function __construct($cpt)
{
$this->cpt = $cpt;
add_action('init', array($this, 'registerAllCpts'));
} | 1 |
b5b707662fc34734592b2f47b6f7351b | 0bfc0cf7f21b0498bd37f395c627acbb | Util to convert from PhysX shape and rotation to unreal shape enum, dimension vector and rotation | {
return FTransform(FRotator::MakeFromEuler(FVector(InFloatValues[3].Value, InFloatValues[4].Value, InFloatValues[5].Value)),
FVector(InFloatValues[0].Value, InFloatValues[1].Value, InFloatValues[2].Value), FVector(InFloatValues[6].Value, InFloatValues[7].Value, InFloatValues[8].Value));
} | 0 |
13deb4bc75b0a2d70da4ccf459d90f93 | c15420a2b7d6da0c36f194b6c1956068 | 向高频RFID模块发送命令 | void send_rf_command( unsigned char rc_command )
{
nrf24_fifo_write_data_test(rc_command);
delay_ms(1);
nrf24_tx_send();
#ifdef BOARD_TX_MODE_ENABLED
Display_LSB(rc_command);
#endif
delay_ms(1000);
} | 1 |
6310b72250690c55146b6efd7e5a34b2 | 084f38198eab36e34fb32c9760b4a153 | Test the AuthorizationModules combination behavior | $this->assertFalse($this->auth->login('user_nomodule', 'user_pass'));
$user = $this->auth->get_user();
$this->assertTrue(
$user instanceof User_NoAuth_Model,
'User returned without login isn\'t User_NoAuth_Model');
} | 0 |
040ee6ead9f83c2ed04f1064e1e4c157 | 78db1600fa6b88fab1582d632471f12a | Perform an asynchronous RPC call to the server. This will queue a work
item for a thread to issue the RPC call and then specifies the behavior
for completion. See :ref:`Asynchronous Methods
<client-rpc-async-methods>` for more information.
.. versionadded:: 1.14.0 | class ExecutionTargetRPCClient(object):
def request(self, target, method, params, receive_timeout=None):
request_id = self.new_id()
self._send(target, Request(method, params, request_id))
return self._wait_response(target, request_id, receive_timeout) | 0 |
97b7b56ab9b91c8d7f661948cffd0837 | 8754fae1e969caab86abafffa6302cbf | Do face detection and Bluetooth communication. | val receiver = DeviceReceiver()
val filter = IntentFilter().apply {
addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)
}
registerReceiver(receiver, filter)
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
if (checkBluetoot... | 0 |
f159ef9eb39c6492679b703f43c26e77 | 2c5b47a33003157890bbbf743c68bd23 | 8-bit signed char maximum method. | {
etl::bitset_ext<8, int8_t>::buffer_type buffer;
etl::bitset_ext<8, int8_t> data((unsigned long long)etl::integral_limits<uint8_t>::max, buffer);
uint8_t value = data.value<uint8_t>();
CHECK_EQUAL(std::numeric_limits<uint8_t>::max(), value);
} | 0 |
020a71fae598a61ae3a4be98c161db5c | b73fa0e63458f388aa2331ac9c4c759e | Groups the given files by the given extensions. Any files with other extensions are added to the `rest` array
on the return value. | public function createGroup(iterable $files): GroupInterface; | 0 |
1ba91c39b8c65519d98db08a3e1bb417 | 8e8fc6febd67e93511565b8339d3f205 | Determine whether the current logged in user has permission to edit a specific user. | class Goal
def edit_authorized(current_user)
return self.user_id == current_user.id
end | 1 |
ed80e651443f9ad4b0477251bc4e86da | 6059822eb2d2833ce404a0351e13d918 | removes all messages and hides notification window | namespace ACMC_Library_System.UI
public partial class NotificationBar
private void ClearNotification()
{
NotificationGrid.Visibility = Visibility.Collapsed;
NotificationMsg.Text = string.Empty;
NotificationIcon.OpacityMask = null;
} | 1 |
ee4bdfd4d0e45acaeb7a3e7f14d2f32b | e2cfb9986c1d3cabe66878849d6e837c | Googleカレンダーに登録する情報を作る処理 | $dfPre = false;
foreach($data as $ent){
if($ent['type_b'] == 'date'){
$dfPre = true;
break;
}
}
if($dfPre == false){
return "";
}
$ary=array();
$ary[] = "\r\n";
$ary[]="//jQuery UIカレンダーの組み込みと日本語化(Layouts/default.js)";
$ary[]="datepicker_ja();";
foreach($data as $ent){
$field = $e... | 0 |
8a58b5a5460a33a659d482ba5e5dd0e0 | 8b84b73d0232aa77bdd5160f36feb70a | 获取视频播放信息请求体 | @POST("video/info")
Observable<VideoPlayInfoResponse> videoInfo(@Body RequestBody body); | 1 |
0a3304b29cb843c32c35ead3968a824e | 48806b9848eb4d3f767b5fe3265c10a4 | Public static method to obtain the message list from a request object. | if (messageLimit <= 0) {
throw new IllegalArgumentException("The argument 'messageLimit' must be greater than 0");
}
return validator.getAllMessages(object, messageLimit);
} | 1 |
d0b4ac38472712a6ff40d6337e8bbc77 | b1153009d77d3f8feadc7adc05ee23e1 | 将字符串转换为双精度浮点数,默认值为0d | public class StringUtil
public static double parseDouble(String str) {
return parseDouble(str, 0.0d);
} | 1 |
c1df46c5775a976dfba9a94f317cfc34 | 74b4b50f8380341d3574ca3f700c5b15 | Process transfer function and broadband excitation from supplied file
This function does not check shape or length | cols = []
arrs = []
with open(file_name, 'r',encoding='utf-8') as data:
for i,line in enumerate(data):
if i==0:
cols = line.split()
arrs = [[] for _ in cols]
continue
parts = line.split()
for j,part in enumerate(part... | 1 |
e189a8b375563e3b99bba0b4d9f62cb1 | 9ca0dae7537bd55ea7a0b30fe171afc2 | Opens test web page | class ResultScreen(Screen):
def webopen(self):
webbrowser.open_new('http://127.0.0.1:8050') | 1 |
efca6d8a028532a4a1de53232ec1af74 | bdf661ef5b4202b3ca0d4599d94cea76 | Returneaza toate conturile bancare ale angajatorului. | class UserService
public function getAllByContractor($contractorId)
{
return $this->userRepository->getAllByContractor($contractorId);
} | 0 |
307af42e2782f2acb2cf9e24244e7082 | 658956f9b749cb0f44a4e007f6084a00 | Perform textline formatting without creating output and query the resulting metrics. | namespace Microsoft.Mex.DotNetDbg
public unsafe partial class DebugUtilities
public int OutputDMLLine(string textFormatString, string commandFormatString, params object[] parameters)
{
return OutputDMLPreformattedLine(FormatDML(textFormatString, commandFormatString, parameters));
} | 0 |
6135019f5e22828999c6a96ab50e68d4 | 09b57f1c82f1d76958ccd43eacfabd00 | 校验 RecyclerView Orientation 是否为 VERTICAL | if (android.os.Build.VERSION.SDK_INT < 14) {
return ViewCompat.canScrollVertically(recyclerView, 1) || recyclerView.getScrollY() < recyclerView.getHeight();
} else {
return ViewCompat.canScrollVertically(recyclerView, 1);
}
} | 0 |
9a7210f0a3c340fb033c8e66178ea8d4 | b5a87684d2e705b58a61cf4782a00955 | 清理数据库(比较完后,如果数据库中还有记录未比较。那么做删除。) | if (!Login.switch_clear.isChecked())
return;
AlertDialog.Builder ab = new AlertDialog.Builder(activity);
ab.setTitle("警告");
ab.setMessage("是否备份并清空数据库?");
ab.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
public void... | 1 |
f6eba5ecfa877ae1b842c36f1baca884 | 78e5b1f2f8a20a0e58d39647d68ea126 | It shows us launch window. | public class MainActivity extends FragmentActivity implements OnClickMethods{
public void showLaunch(){
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, new LaunchFragment())
.commit();
} | 1 |
2a01767b8decf48e0f9419bae9a1cb58 | e2c64d9ddf360287988729c0f865ccd0 | Disable the Color Click.
Note: An exception is thrown if it fails to disable the sensor. | class Color
def disable!
@enabled = false
end | 0 |
26e2c0ac42eda4ff99696bb8e06eeb01 | ad253b0c00ef3db95cb74fa1b109ae88 | Reset PLL | PLLFBD = 62;
CLKDIVbits.PLLPOST = 0;
CLKDIVbits.PLLPRE = 0;
__builtin_write_OSCCONH(0x03);
__builtin_write_OSCCONL(OSCCON | 0x01);
while ( 0b011 != OSCCONbits.COSC ) {
asm("nop");
}
while ( 1 != OSCCONbits.LOCK ) {
asm("nop");
}
ANSELA = 0;
ANSELB = 0;
... | 1 |
1febe7b059856209aa8a9fdf24e46786 | 41af637a7df5ca6c682ba015d687847c | Since we have fewer bits in the exponent type than in f32, an
offset is necessary to make sure the stored exponent values are
representable by the exponent quant int type. | const fn q24_to_q57(v: i32) -> i64 {
(v as i64) << 33
} | 0 |
47c726c637c2b2b9c4648eb7acdb7056 | 65d3106d620b97b87913717249d54635 | Sets all members from a character array. | namespace CornStarch
void CChannelStatus::setMembers(const vector<CMemberData*>& members)
{
m_members->setMembers(members);
} | 0 |
cc0ca8fce98d1ede276e44b1fff357fd | a2c7ac27c6e472a4fd1774f98d2df3e8 | remove leading and trailing spaces | namespace sdds
void trim(std::string& str)
{
size_t i {str.find_first_not_of(' ')};
str = str.substr(i, str.find_last_not_of(' ') - i + 1);
} | 1 |
ca6a429c05193da8edfedabee72ff122 | 2bb64cd3eff3113a797e0ef2b62dd35e | 判断目录是否存在于另一个目录下. | Bean dictItemBean = getDictItem(itemCode, dictId);
if (dictItemBean == null) {
return false;
}
String itemCodePath = Constant.CODE_PATH_SEPERATOR + dictItemBean.getStr(COL_CODE_PATH);
String parentCodeWithSeperator = Constant.CODE_PATH_SEPERATOR + parentCode
... | 1 |
5f9e9c5929190a3e5a4b2793bb67002e | a7df2f254573ddf8788503db834922cd | Detects whether the current installation is a WordPress Multi-User / BuddyPress
installation. | function zuhaus_mikado_is_wpml_installed() {
return defined( 'ICL_SITEPRESS_VERSION' );
} | 0 |
0e695f627eac4ac96cd1efcdc7ba1ba1 | a56ba808d5e56b711c6dca5efde96e5d | 与えられたパラメータに応じてX軸方向にキューブを回転 | matori = glGetFloatv(GL_MODELVIEW_MATRIX)
c = cos(radians(angle))
s = sin(radians(angle))
matrix=IdentityMat44()
matrix[0,0]=x*x*(1-c)+c
matrix[0,1]=x*y*(1-c)-z*s
matrix[0,2]=x*z*(1-c)-y*s
matrix[1,0]=y*x*(1-c)+z*s
matrix[1,1]=y*y*(1-c)+c
m... | 1 |
cb510c9eea5f764141c0ed3fc92472be | cd3a42fd1e3ad35c2154e3ea11764ea4 | The volume of a ball. | if n == 0:
return 2
return 2 * np.pi * _volume_Nball(n-1) | 0 |
86e54f458691e03ebdffcb35e40b936f | 7ecd10cd158105a10b69fd5fbc500447 | Initialize the game world class. | class World:
def __init__(self, scale=SCALE, fps=FPS):
self.clock = pygame.time.Clock()
self.counter = 0
self.data = {}
self.fps = fps
self.interfaces = []
self.objects = []
self.processes = []
self.scale = scale
self.... | 1 |
d1c160f61430f59b048cfcd120db84c3 | 8355fc01b52bb02014089ef4ca588b19 | Asynchronously gets a substream of the specified message. | {
Guard.AgainstNullOrEmpty(messageId, nameof(messageId));
Guard.AgainstNullOrEmpty(name, nameof(name));
Guard.AgainstLongAttachmentName(name);
Guard.AgainstNull(connection, nameof(connection));
SqlCommand command = null;
SqlDataReader reade... | 1 |
2649225d6a0d40f419e040bfde94675f | 2836f22bc9176f9baa2a9bc91dec1a41 | Calls a different method depending on which request is registered, Facebook or Google | if($this->_api == 'osm') {
$this->osmAPI($plugins);
}
else {
$this->gmapsApi($plugins);
}
} | 0 |
a21c699ad070fcd9b2140155122d3aee | 3759b5a354ddc6a9062e7c392ef178c6 | 一般循环 | class DemoAction extends Action
public function loop1() {
$data = $this->build_data();
$this->assign('data',$data);
$this->assign('content','demo_loop1');
$this->display('Layout:demo_layout');
} | 0 |
d3c5ddc9ed310ac7fbd0b13558e3e1b7 | b527f40e22af8eeccf2616625187795d | 对当前节点进行右旋转 | public class RBTree
private void rightRotate(Node node){
} | 1 |
65457ae3cd828e30e8e61a99b34492a8 | 25d622be27b0f3d74ac2fa9c1fee4311 | switch device of local video track. | class VideoActivity : AppCompatActivity()
private fun addRemoteParticipantVideo(videoTrack: VideoTrack) {
moveLocalVideoToThumbnailView()
primaryVideoView.mirror = false
videoTrack.addSink(primaryVideoView)
} | 0 |
18251b50cd8a00727f4fe4e30708c369 | 0bcea9a72352886b48bc2e1349b25696 | returns the source from the specificed index position | public class SourceListModel extends AbstractListModel<AbstractSource>
@Override
public AbstractSource getElementAt(int index) {
return sourceManager.getSource(index);
} | 1 |
68398ce2deb6727648f1c36ddce94d38 | 32c3af1c55c200cc46c52d52ebb21d77 | Update the ip to point to the next instruction.
<p>
Compiler Stack: ... -> ...
<p> | class Executor(StatefulComponent):
def updateInstruction(self, decoded):
self._ins_nxt = decoded | 0 |
c3c91c6e67fb3f3328811bf83c9803f4 | 3a96488aef16333262a08e18ddea6cd1 | Clustering + removing small clusters + keeping only line-looking clusters | arr = arr.copy()
q = []
def search(i, j):
cluster = []
q.append((i, j))
visited[(i, j)] = True
while q:
if arr[(i + 1, j)] > threshold and not visited[(i + 1, j)]:
q.append((i + 1, j))
visited[(i + 1, j)] = True
if arr[(... | 1 |
3b666109589c709d6db6f4eee17030ee | 9a546b5290b168af8fde4d7058dfd39a | Given an input list and a fieldname of which field to use, return a string that contains all those field items, separated by a comma and a space. | namespace Gentle.Framework
public class SqlBuilder : BrokerLock
protected virtual string AsCommaList( ICollection fields, bool quoteFields )
{
StringBuilder result = new StringBuilder();
foreach( string s in fields )
{
if( result.Length > 0 )
{
result.Append( ", " );
}
if( quoteFields )... | 1 |
34f6030fbf64112bbf27ff10bbb8cbab | 2791b0acd5403bdd2dc3561104c4ec62 | Split the ratings dataset by users into training and testing sets. | rated = X[~X['rate_num'].isnull()]
non_rated = X[X['rate_num'].isnull()]
rated.drop('rate_num', axis=1, inplace=True)
non_rated.drop('rate_num', axis=1, inplace=True)
return rated, non_rated | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.