query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
033be159fb91be4c2e472331f2032992 | 4507c3e045bf33446f16e694e1c285c5 | Checks if the migrations table is already exists | class DatabaseMigrationRepository extends IlluminateDatabaseMigrationRepository
public function repositoryExists()
{
$schemaManager = $this->getConnection()->getArangoClient()->schema();
return $schemaManager->hasCollection($this->table);
} | 1 |
e80982646afaad2a85d5ce9aa22eb818 | cc9e6a84923cbce6dd123794c41429c7 | [Converts list of image from a directory to numpy array] | images = []
for eachImage in glob.glob(path):
images.append(image.imread(eachImage))
images = np.array(images)
return images | 1 |
9ec9553789b0530a2ae0f367a291176a | e8497a9ff46dad2bccb7223ed6eaa9bb | Elimina un registro de la tabla PR_COMBUSTIBLE | class CombController extends Controller{
public function destroy($id){
try{
Combustibile::destroy($id);
Combustibile::clearCache();
$comb = Combustibile::all();
Toastr::success('Combustibile eliminato.', $title = 'Fatto!');
} catch(\Exception $e){
$msg = htmlentities ($e->getMessage(), ENT_Q... | 1 |
75174934ec9d3bac8b22c7ae1005654a | 8a2d1b94f80da66b332062eed0605662 | 如果打开则关闭 | namespace EasyBugManagerTool
public class SettingsUi
public void OpenOrClose(bool _isOpen)
{
switch (_isOpen)
{
case true:
AppManager.Uis.OpenOrCloseForeground(true);
this.UiControl.Visibility = Visibility.Visible;
... | 0 |
fc7a7736b9102a2a3b70b485ba5c2ede | 768d0533afe716828588b5ed2687cdd5 | Replaces all the lessons from the list with a new list of lessons | public class ClassPlan implements Serializable
public void setLessons(Set<Lesson> lessons) {
this.lessons = lessons;
} | 1 |
8e106f20aa195af5c043fcc30cfb68b7 | 3a3ce15478b350ffe9f9d267515ab51b | 返回要删除结点的父结点 | public class RedBlackTree<K extends Comparable<K>, V>
private Node<K, V> getParent(Node<K, V> node) {
return node == null ? null : node.parent;
} | 1 |
25951812c724a699adcc2ff965d3b192 | 3cf8e1a3eb16e179a09fab69ee8c4415 | 读取配置文件,初始化mongodb连接配置参数 | def init_mongo():
mongo = dict()
mongo[const.mongoHostKey] = const.mongoHostDef
mongo[const.mongoPortKey] = const.mongoPortDef
mongo[const.mongoDBKey] = const.mongoDBDef
mongo_path = os.path.join(get_conf_path(), const.baseMongoFileDef)
com_util.write_to_json(mongo, mongo_path) | 0 |
cab738f3647371787ee6f3fa1cc88509 | 8183897676ced15eb7f7906429c6322f | This method is called when the leader of a partition group change. | void onPartitionLeadershipChanges(Set<TopicIdPartition> leaderPartitions,
Set<TopicIdPartition> followerPartitions); | 1 |
4b0cc359dd0e720acc6bb916903df5e3 | b25fbb1946fad76fb62c7528c08fe5bb | 创建一个VM副本 | @Service
public class VmBiz
public String cloneVm(VmDTO destVmDTO, String srcVmUuid) {
MyCloudResult<String> result = this.vmManageService.cloneVm(destVmDTO, srcVmUuid);
if (!result.isSuccess()) {
log.warn("调用vmManageService.cloneVm()出错," + result.getMsgCode() + ":" + result.getMsgInfo());
... | 1 |
5430cde8890ea95bb5de28c3772fe528 | 9b30cbdb6031bb0e6f28f7f0f28d0283 | Searches gebruiker based on the First or the Last name | @Query(value = "SELECT * FROM user WHERE first_name LIKE %?1% OR last_name LIKE %?1%", nativeQuery = true)
List<User> findByFirstNameContainingOrLastNameContaining(String query); | 1 |
8954cd896e0a682ca6c946f879f2369c | 02f7b4cd3ead2669d1797b1f7d79611c | POST: api/tblMovilObrasLiquidaDet | namespace WebApiProyecto.Controllers.Movil.SOT_TECNICA
[EnableCors("*", "*", "*")]
public class tblMovilObrasLiquidaFotoController : ApiController
[ResponseType(typeof(tbl_Movil_Obras_Liquida_Foto))]
public IHttpActionResult Posttbl_Movil_Obras_Liquida_Foto(List<tbl_Movil_Obras_Liquida_Foto> tbl_Movil_O... | 1 |
b0138c7dc0556d84b36ced60e56f921b | bffb7fe270afc492a0d9ea1c2ee46f5b | Manages a collection of items indexed by UUID | class MapUuidStringUuid(_types._UuidStringKeysMixin, _types._UuidValuesMixin, PersistentMap):
def __init__(self, slot=None, compress=None):
PersistentMap.__init__(self, slot=slot, compress=compress) | 1 |
8ca824d2a8ad24de0be275b072a2fec3 | bcc8cc4a55d39dc397f4dc985d428877 | read one frame from memory and throws the data to standard output | int read_frame() {
struct v4l2_buffer buf;
unsigned int i;
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
if(xioctl(fd, VIDIOC_DQBUF, &buf) == -1) {
switch(errno) {
case EAGAIN:
return 0;
case EIO:
default:
errno_exit("mmap");
}
}
assert(buf.index <... | 0 |
0369287e3e3d325afabd2b9682958326 | 617fd74bec056c4a7a17946fd2514a3f | Devuelve el valor de un campo. Si existe un metodo get para dicho campo
se obtiene el valor mediante este. De lo contrario se obtiene
directamente. | class Usuario
public function __get($campo) {
return $this->$campo;
} | 0 |
244c5086f108d1ae3c398582529b3c2d | 82c6c779a729f1d3d235acfa2b77033f | set max retry count when get network content fail | public class COCO
public void setMaxRetryCount(@IntRange(from = 0, to = Integer.MAX_VALUE) int retryCount) {
if (mCOCOService != null) mCOCOService.setMaxRetryCount(retryCount);
} | 1 |
03ccceff9650a95988bc5f10bfd5c5b2 | 3fb85ede59bc449334966818e23c5bfc | determine number of adders in a particular adder tree level | if (lvl < 1)return 0;
lvl--;
if (!b.isNull()) {
if (!lvl) return 1;
else {
int c1;
c1 = knotsPerLvl(b.Left(), lvl);
c1 += knotsPerLvl(b.Right(), lvl);
return c1;
}
} else return 0;
} | 1 |
d6fd36ab10e7469e8f38531bb3eef4e9 | 8e7e4eb8989c87466b311459fe20384f | Removes the listener from the collection of listeners who will
be notified when an event of the given type occurs. The event type
is one of the event constants defined in class <code>SWT</code>.
<li>ERROR_NULL_ARGUMENT - if the listener is null</li>
</ul>
<li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread ... | public class ACIItemGeneralComposite extends Composite
public void removeWidgetModifyListener( WidgetModifyListener listener )
{
checkWidget();
if ( listener == null )
{
SWT.error( SWT.ERROR_NULL_ARGUMENT );
}
listenerList.remove( listener );
} | 1 |
2d630713b8c253829e1aa3dd223cc8c1 | 51fb961bf0dd7103bfad0d8e3bac6777 | 接起新来电 | PhoneVoiceUtils.getInstance().toggleSpeaker(true);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("来电:" + linphoneCall.getRemoteAddress().getUserName() + " port:" + linphoneCall.getRemoteAddress().getPort());
builder.setMessage("您的好友来电,是否接受通话")
... | 1 |
4205d77a962283b093675a75dbaaa76b | 76fc0168646063954f6f546d34959f88 | Returns the current threshold value (in seconds) for the indicated component | namespace NetMX.Monitor
object GetThreshold(ObjectName objectName); | 1 |
8f0a444c17f4df6bb49d0385a2abb9fd | 576393d642757014bc2d9a1957cbe2ae | 车百汇各城市活动信息更新 | class Activity extends UA_Controller
function act_cityData(){
$param = $this->getParam(array('actid'));
$param['adminid']=$this->session->userdata('a_user_id');
$city['id']=$this->input->post('act_startcityid');
$city['cityname']=$this->input->post('cityname');
$data=$this->activity_model->get_act_city($param... | 1 |
0e2a1c62223805b49f268b2eae9b2664 | f06e2c8ec88dbde53b3106275ea45a28 | word dropout层,针对输入以单词为base进行drop,普通的dropout是针对每一维来进行的 | class Decoder(nn.Module):
def word_dropout(self, inputs):
data = inputs.data.clone() if isinstance(inputs, Variable) else inputs.clone()
mask = torch.from_numpy(
np.random.binomial(1, p=self.cf.word_dropout_prob,
size=tuple(data.size())).astype('uint8')
... | 1 |
554428f132a8d5e2e526c19bb8361dce | f8e6d79cdff9931362b714e6c7c0c23d | Test if string array can be converted to []string | s := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
for i := 0; i < b.N; i++ {
ss := SliceIntToString1(s)
_ = ss
}
} | 0 |
a30931d18a95bd15380a8b83c44a4451 | 52e2615e6b4fc347d3d9c1a91fdcee53 | 计算消耗的流量 | class User extends Model
public function usedTraffic()
{
$total = $this->attributes['u'] + $this->attributes['d'];
return Tools::flowAutoShow($total);
} | 1 |
f0b69e745d9013af8ab7426e0c906b81 | 017c07c89fd8a34114c15b10c0a4d4a1 | Returns the entropy of `dist` in bits (base-2).
motivated from http://www.lancaster.ac.uk/staff/rowem/files/mrowe-mstrohmaier-WWW2014-WebScience.pdf
In the context of our work, a higher entropy denotes greater graph density. | s = 0
for k in Distribution.label.domain:
pk = dist.get_normalized(k)
if pk != 0:
s += pk * np.log2(pk)
return -s | 1 |
3a02c0e2ce5e601d31de97bea21e9fd3 | 5ca3f081b57f56b00bbcbc322f6bdb5e | this [] allows write access to items in the MyVec:
It returns a reference to the i-th element. | Item Vec::getItem(unsigned index) const {
if (index >= mySize) {
throw range_error("Vec::getItem() is trying to get an index that is too great.");
}
return myArray[index];
} | 0 |
f97e73e6e7c8d25ef6eccb7620518b6d | 2d5d3b7c060e3aabba392bc994da1cb4 | . 折れ線グラフ描画 | class LineChartView : View
private fun drawLine(canvas: Canvas) {
brokenPathList.clear()
for (i in scorePoints.indices) {
val pointList = scorePoints[i]
val path = Path()
path.reset()
path.moveTo(pointList[0].x.toFloat(), pointList[0].y.toFloat())
... | 1 |
c0c4ed0ee7458b68a8d20051471d3b1c | c29319a515a6f89d2d0f7e48f8983ede | add product review | {
if (!$this->user_auth->is_logged()) {
echo '3';
} else {
$data = array(
'product_review_id' => $this->generator(15),
'reviewer_id' => $this->input->post('customer_id'),
'product_id' => $this->input->post('product_id'),
... | 1 |
18662398f2c927db4382576b53e7cc94 | 38a054d7b51bfb0579accb59fbcec3b0 | hàm giải mã ảnh về ban đầu | global img_l
img_pre = img.convert('L')
pix_pre = img_pre.load()
for i in range(width):
for j in range(height):
if i in [0,width-1] or j in [0,height-1]:
pix[i,j] = pix_pre[i,j]
else :
a_pix = [0]*9
for k in range(3):
... | 0 |
e92570fc4ef9b9dfe28c5cb249e5e411 | b2fbb6d5e395c47ee35c34997ce2f076 | 定义上载文件处理视图 | fileObj = request.FILES.get('upfile', None)
response = HttpResponse()
my_response = my_upload_file(fileObj, 'file')
response.write(my_response)
return response | 1 |
a8a5b83c706d6a32240e42e3d8113fd2 | 14ed988896e950c92ad66bf4cbf90d94 | 全校总课表打印 | String sql = "";
Vector BJJVec=new Vector();
Vector BJVec = new Vector();
DecimalFormat f = new DecimalFormat("#");
f.setRoundingMode(RoundingMode.HALF_UP);
String[] titleArray = new String[]{"班号","姓名","学籍号","不及格科目数量","不及格科目名称"};
String admin = MyTools.getProp(request, "Base.admin");
String jxzgxz = ... | 0 |
7ad0e3663c66958ca6eccd5644d6aae2 | 01cb9355232a673996d9db9d31eec1dc | Method to add callback to current query builder instance which is calling 'processQueryBuilder' method. By
default this method is called from following core methods:
Note that every callback will get 'QueryBuilder' as in first parameter. | public function setCallback(callable $cb); | 1 |
90fe60f368a30a97935410c8bfbf80ae | be709e900bfe374ab95e088f0ed146bc | 在子节点集合中,自动过滤注释节点、空白节点 | {
List<xmlNode> tmp = new List<xmlNode>();
bool finish = false;
foreach (xmlNode N in list)
{
if (finish) break;
if (!N.isDeclarNode) finish = true;
tmp.Add(N);
}
return tmp;
} | 0 |
2a85ac7df5f4e228411cd73b408bbb0e | 7786ccaa462be24f9f7bb1e4ebe9b100 | Converts the text input into a float shows an error message if not suceeded | {
try
{
Convert.ToDouble(valueToTransfer.Text);
}
catch (Exception)
{
return 0.0;
}
return Convert.ToDouble(valueToTransfer.Text);
} | 0 |
02d5532791d4320ca19d0ddbd1a406b7 | 82bd37217cecd7f9233a7deb775cdf6a | TOP命令接收前n行,此处仅读取邮件属性,读部分数据可加快速度。TOP非所有服务器支持,若不支持请使用RETR。 | class POP_Ops(POP3):
def pop_stls(self,context=None):
self.context = context
basic_class.mylogger_record.info('command:<stls '+str(self.context)+'>')
self.resp = self.pop3.stls(self.context)
[basic_class.mylogger_record.debug(self.resp.decode())] | 0 |
ac71a884cd5f9d03cda4b111b67e6a12 | 1a236a8b5ec0c26f2604b2bf14432fc2 | Get the Future objects associated with a particular plan invocation. | Iterator<ExecutedCommand> getExecutedCommands( String planUri, int planVersion ); | 0 |
331a904763dfed2545c8fd470dfad22d | 6f06f7510d3cf628a0c79fe5eef118ae | flicker | function Flicker() {
FlickerStop(h);
h = window.setInterval(FlickerOne,1000);
} | 1 |
f1ce7279b20d2824e1c8d19e742b40a1 | c11a627121142e6f2e625d17f096aa79 | Получить учебное заведение пользователя (студента или преподавателя) | class User extends Model
public function school() {
return $this->belongsTo(School::class);
} | 1 |
a6cbc590462af1986ba744fe474d4445 | e96001f04765067e47e20203d492af54 | Rebuilds mood cache and inserts it into the database. | protected Void doInBackground(final Void... params)
{
MoodEntity mood = new MoodEntity(0,4 ,"");
mDao.insert(mood);
mood = new MoodEntity(1,3,"I had a nice day");
mDao.insert(mood);
mood = new MoodEntity(2,2,"I had a not so nice day");
mDao.insert(mood);
m... | 1 |
c7073608feaa77a8d978624613f125a0 | 451c9af0eb4cfdd94f75d4e0a44e92e0 | 检查运行时间并入库 | class TimedDeleteOutput:
def run(self):
if os.path.exists("../common/t.txt"):
with open("../common/t.txt", "r", encoding='utf-8') as f:
current = float(f.read())
if float(self.t) - current > (3 * 86400):
self.removeMkdir("images")
... | 0 |
ee01d036b0969b296b47ec1000419ff2 | 4c9adda0d5109b4a090efd3de7c6c1e4 | Generates the rc part of the final proof for handling the rc of a called function. | var_name = call_ret_val_name(node)
id = self.pipeline_state.next_collapsed_id()
version = VAR_INIT_VERSION
call_con_scopestr = con_scope_to_str(node.func.con_scope + [call_container_name(node)])
in_ret_val = create_grfn_var(var_name, id, version, call_con_scopestr)
in_ful... | 0 |
a0aa08f2ee4c61b2a586790824909ebe | ac604df0c26e42873b7a53a112371c5a | ----------------------------------------------------------------------------------
「デバイス取得」ボタンクリック時処理
---------------------------------------------------------------------------------- | namespace Display_Result_in_Overlay
public partial class Form1 : Form
private void cmdDevice_Click(object sender, EventArgs e)
{
OpenNewVideoCaptureDevice();
} | 1 |
e9cd422d6d683a55540677202c14247f | 44770b4d49fcb345a142afdabb2d5b20 | 将好友添加请求写入数据库 | public class ChatDBDao
public static boolean addOneFriend2DB(DummyFriend friend) {
try {
Uri notifycationUri = AnjukeApp
.getInstance()
.getContentResolver()
.insert(CustomerProvider.CUSTOMER_URI, friend.toContentValues());
if (... | 1 |
bae9f2a2fc9a600cebf4768ca014da56 | 196d8d9431d75559b7320e21e320adcf | Função que recebe uma string e um vetor de delimitadores, e retorna o endereço
da primeira posição de um token na string. | {
for(unsigned int i = 0; i < str.length(); i++)
{
if(str[i] == delim)
{
return i;
}
}
return -1;
} | 0 |
c084f9873d154b4615055dc0d6f29832 | 69215043c0a72d2f13a2649088d941cc | stack의 모든 data 출력 | if(ptr <=0)
System.out.println("스택이 비어 있습니다.");
else {
for (int i = 0; i<ptr; i++)
System.out.print(stk[i]+"");
System.out.println();
}
} | 1 |
fc2811b9a00cfbd8bd3a0fc2825339a8 | e9d009f08687314d0867415d7d820123 | Sverifica se a string fornecida tem apenas números | int onlyNumbers(char str[])
{
int i = 0;
int returnAux = 1;
while(str[i] != '\0')
{
if(str[i] < '0' || str[i] > '9')
returnAux = 0;
i++;
}
return returnAux;
} | 1 |
29161a86138db213d9d256bb68d16bbc | 9105a8398c7845f93df2bf152d914084 | 实现x,与y在Data的分布中,马氏距离的计算 | BigDecimal dist=new BigDecimal(0);
for (Integer i : XToYIndexMap.keySet()) {
dist = dist.add(BigDecimal.valueOf(Math.pow(X.value(i) - Y.value(XToYIndexMap.get(i)), 2)));
}
return dist.doubleValue();
} | 0 |
15a18cf0b37029aeb47e2bef8bf51774 | eef185879bcad2e3b1b613f95dfdb253 | Send a compressed message to the client. | namespace Graylog.Target
internal sealed class UdpTransport : ITransport
public void Send(string serverIpAddress, int serverPort, string message)
{
var compressedMessage = CompressMessage(message);
if (compressedMessage.Length > MaxMessageSizeInUdp)
{
_transportClient.Send(CreateChunks(compressedMessage... | 1 |
c9e80f3cc39b34823e7509e4306c5b9e | 0dadc5b9f44f96be680a157aba5c3688 | 设置底部菜单是否可点击 | public class OptionsLayout extends LinearLayout
public void setCanClick(boolean isCanClick) {
this.isCanClick = isCanClick;
} | 1 |
6de53ce86a3a596496592eeabd974c5d | b36b763b4e345ac34f18b7bd76eab31a | Fetches summary data of Earthquake from S3. Returns dict of the
data | data = {}
response = with_urllib3(url)
client = sseclient.SSEClient(response)
for msg in client.events():
if msg.data != None:
data = json.loads(msg.data)["data"]["diff"]["0"]
else:
data = None
break
client.close()
return data | 0 |
d4b0bd7e130945d267d35dfb195a2bd4 | e0b0ad71addb9884851ded6909004ced | This method checks that the "document begin" tag is present and in the correct location | {
var isCorrectAssertion = (remoteDocument.Root.Name == "sun");
return isCorrectAssertion;
} | 0 |
ba8fc4b7e1b9810a464b728f485aeea2 | 07044f6f671fc73f6b5d0fda41ade811 | Planck function in wavelength for radiant exitance. | def planck_law(wavelength, temp, emissivity=1., kelvin=False):
T_k = temp + (not kelvin) * constants.T_0
c1 = 2. * constants.h * constants.c ** 2
c2 = constants.h * constants.c / constants.k_B
try:
B_lambda = emissivity * c1 * wavelength ** (-5.) / \
(np.exp(c2 / wavelength / T_k) - ... | 1 |
f7ff8a62c7d9e3c02baa8a79f47c28e9 | f5d64f833fcf135e6d24f7666f5e0185 | Performs a quick test on the integrator function on fourier basis | x, y = symbols('x, y')
PI = pi.n()
assert quad(lambdify(y, u.subs(x, 0)**2), (0, PI)) < 1E-13
assert quad(lambdify(y, u.subs(x, PI)**2), (0, PI)) < 1E-13
assert quad(lambdify(x, u.subs(y, 0)**2), (0, PI)) < 1E-13
assert quad(lambdify(x, u.subs(y, PI)**2), (0, PI)) < 1E-13
ddu = u.diff(x, 2) ... | 1 |
abaa29330334860d1b5ead9f53cd52ed | b117000d6ea47970dd0ffd401aa04c0b | WeightedMean returns the weighted mean of the vector for a given vector of weights. | total := float64(0)
for _, x := range xs {
total += x
}
return total / float64(len(xs))
} | 0 |
2156983fc0250112eb0c33c890e6b75f | 0effa1bd25b0e26404441bd482ea0ba6 | Generates notes, chords or pauses according to transcribed notation and plays it | note_list = ["SOL", "LA", "SI", "RE", "MI", "FA", "DO"]
partition = inversion_partition(partition)
for index, element in enumerate(partition):
if element in note_list:
play_note(element, partition[index+1])
if element == "p":
sleep(0.125)
if element == "Z":
... | 1 |
59fe7ff0bb1024e54b3970da9f3542e7 | efa5452822ccedaf1cd5d9fe2577c717 | Delete a characterStat from the database | class StatController extends Controller
public function destroy(Stat $stat)
{
CharacterStat::whereStatId($stat->id)->delete();
$stat->delete();
flash("Stat has been deleted")->success();
return response()->json(['ok']);
} | 1 |
c75a7e0397998a56086d951cca690cef | ffea8afb989b40ca93a70e10b2431c72 | 更新到期竞拍商品,生成订单 | class UpdateProduct extends Action
protected function updateBargainByOrder(SiteProductOrder $order)
{
if (!empty($order->bargainid)){
$launch = SiteBargainLaunch::findOne(['bargainid' => $order->bargainid, 'uid' => $order->uid]);
if (!empty($launch)){
$launch->status ... | 0 |
33d3473a3feaacc4ef04ff8f49a8ae73 | 60e4a45ea042c56f98811719dbad156b | View to list TodoLists | {
IQueryable<TodoList> items = from i in context.Todos orderby i.Id select i;
var todoList = await items.ToListAsync();
return View(todoList);
} | 1 |
1b61131faf47a0a15ac3b1f38fe804ee | e351ffb04ade2abc7f7477427f3afc46 | Start appearing the object. | public appear(): Promise<any> {
return new Promise((resolve, reject) => {
this.node.y = 150;
Tween.get(this.node).to({ y: 0 }, 400, Ease.backOut).call(resolve);
});
} | 1 |
ee89adc6ede356ca51586b5ce3712686 | 82a73e355352420cd24cce07aa86c786 | set the wisdom of a character | {
int exp;
mapping o;
string my_id;
if (! me || ! victim)
return;
if (! victim->query("can_speak"))
return;
if (victim->is_not_bad()) item->add("combat/WPK_NOTBAD", 1);
if (victim->is_not_good()) item->add("combat/WPK_NOTGOOD", 1);
if (victim->... | 0 |
ac47cbe649f59a8cf0b9a63df4b510c8 | d5128b3c23c045d173db57e0e3a989cc | Check to see if LogSettings property is set | namespace Amazon.SecurityHub.Model
public partial class AwsCodeBuildProjectDetails
internal bool IsSetLogsConfig()
{
return this._logsConfig != null;
} | 0 |
e5f549592c12717e8d40605cfffeb11b | df88ebd5711e684f4144e1beb7c99631 | Updates the value of the read-only attribute. | namespace Cimbalino.Phone.Toolkit.Controls
public class PropertyGridItem<T> : IPropertyGridItem, INotifyPropertyChanged
public void Update()
{
ReadValue();
} | 0 |
0a9c72ec8babc0c9495f9d5183ceb2af | 52128e8641164c4cd7530966dbb9e22b | Testing failed branch of inserting a new user into the database with empty Strings in member variable | public class AddUserTest
@Test
public void emptyNameOrPW() {
assertFalse(addUser(mockDB, testEmptyPassword));
assertFalse(addUser(mockDB, testEmptyUsername));
assertFalse(userExists(mockDB, "testEP"));
assertFalse(userExists(mockDB, ""));
} | 1 |
849fd66be9294c4cf37764a89d4b2771 | 8d80c5f77cf6e53dc8be69c6a344bff1 | 把要使用到的key规则注册起来,方便查阅 | class __PgBase:
def keyfunc(self, key):
def register(func):
self.keyfuncs[keyutil.get_key(key)] = func
return func
return register | 1 |
febea95bdd7e290b524c9c6e5308332e | 995005cb9d4a6ffe2928c8784621b695 | 返回URL字典 | html_str = urllib.request.urlopen(url_str).read().decode('gbk')
soup = BeautifulSoup(html_str, from_encoding='gbk')
url_dict = {}
for tr in soup.find_all('tr'):
if tr.h3 != None:
url_dict[tr.h3.a.string] = tr.h3.a['href']
return url_dict | 1 |
bcf1b1dcb21088f136c73b94b13a0e01 | 13aff7cf267380c1afdd2455b5995fce | The storage profile of the user settings. | class ContainerServiceAgentPoolProfileResponse(dict):
def storage_profile(self) -> Optional[str]:
return pulumi.get(self, "storage_profile") | 1 |
d7b6400666f7a1d6b97e05ab42e29c85 | 9354a86f1162f499eb21e6274cd62722 | TorchDynamo needs to know whether DDP is currently active, and access the DDP module in order to cooperatively optimize it. | if self.hpo_pytorch:
return
self.hpo_pytorch_ = True if self.torch_available else False | 0 |
a89f2d321410100f976e58454c12aba4 | 62eab1d3fb9696ed943ef0a168a968ba | Get human readable address strings joined with the specified separator. | {
const void *quote=QUOTE_V, *org_sep = sep;
if (str)
*p = str;
else
str = *p;
if (!*p)
return NULL;
while (GetChar(str, 0) && (strchrV(sep, GetChar(str, 0)) || GetChar(str, 0) == ' '))
str = MakeAddr(str, 1);
if (GetChar(str, 0) == 0)
return NULL;
void *in = str, *out = str;
for ( ; GetChar(in, 0); i... | 0 |
23dc6ea65c32ac550cea24acac842ca6 | fa8820433585809be56ea023989387bd | Sends a grade email to the student from the grader. | def sendMailAboutGradingRecordResult(request, *args, **kwargs):
from soc.logic import mail_dispatcher
from soc.logic.models.site import logic as site_logic
from soc.modules.gsoc.logic.models.grading_record import logic as \
grading_record_logic
from soc.modules.gsoc.logic.models.org_admin import logic as ... | 1 |
99bf99946fecbcb3655575472bbc034b | 82d6cf9455a9dabe01d55ab06272e7b5 | This option assigns all pixels in this image to this class (no region capture required) | void Dialog_create_classifier::on_pushButton_use_full_image_for_training_this_class_clicked()
{
} | 1 |
771e709b49b0052bdb212d42ab6be506 | 437880598bde4caf794a0c3acfa5038f | determines if there is a merchant account | {
boolean result = false;
result = isCodePresent("M");
return result;
} | 0 |
9e34de56f16281a4d237b12dda5539b9 | 16d8a974583e662b0b18656a81eb8191 | call this method to face the interactable object | namespace ZzukBot.Objects
public class LocalPlayer : WoWUnit
public void Face(WoWObject parObject)
{
Face(parObject.Position);
} | 1 |
9de974d9cc16eec346f1e805be7cedbb | a68b8202baa605aa8104677c2f5e97b2 | Reshapes the dictionary returned by a LDAP query to a minifold entry. | def process_entry(dn, attrs, all_users):
all_users[dn] = attrs | 0 |
9f02e653acfbac8f724be783ea9687f0 | 54362db5f3518c0bdbd5bfba15e1b3e8 | Xử lý thêm mã giảm giá | namespace BookShop.BLL
public class KhuyenMaiBLL
public void add(KHUYENMAI km)
{
db.KHUYENMAIs.Add(km);
db.SaveChanges();
} | 1 |
a1b79e45fd05d45c3a27d98abe7ea81c | 3ad368799feb61e3af6697a6032d1aa4 | 根据商品id和企业id查询安全库存 | Map<String, Object> selectByGoodsID(Integer goodsID, Integer repositoryID) throws StorageManageServiceException; | 1 |
d1f1fd63f5c1fce90d976fcea5d92771 | 6c52f76509940c21cbf89446793e170e | Get rectangle enclosing list of Connected Components | {
float minX = nodeList[0].CenterPointF.X;
float maxX = nodeList[0].CenterPointF.X;
float minY = nodeList[0].CenterPointF.Y;
float maxY = nodeList[0].CenterPointF.Y;
foreach (EcellObject node in nodeList)
{
if (node.CenterPo... | 1 |
44c3996b58bc0a7793981bcd3bb92cb4 | a6e5fd3dc589bb872fc5d1e4b81fa2ed | 显示司机已经到达 | {
$driverPhone=$request->input('driverPhone');
$userPhone=$request->input('userPhone');
if (is_null($userPhone)|| is_null($driverPhone) || $userPhone=='' || $driverPhone=='') {
$array=[
'flag'=>'0'
];
return json_encode($array);
}
... | 0 |
79a893ae59d5682c6ebf37c1af20e176 | 30a7b84d59e3657d65284386b3d8984d | 将gameObject所有的Image,rawImage组件置灰 | {
Image[] im = target.GetComponentsInChildren<Image>();
foreach (Image i in im)
{
i.material = GameArgs.World.GetComponent<World>().MaterialDefault;
}
} | 0 |
7b10423cff70e9f3d56613f84808cf03 | 53d3e372d74d061b166a87c36514dea8 | Tests a NB spam classifier. | train, test = self.split_blogs_corpus(BagOfWords)
classifier = NaiveBayes(method='b')
classifier.train(train)
self.assertGreater(accuracy(classifier, test), 0.55) | 1 |
41b9dbef732ecbac4f013a2e02669fe8 | 2511e9a4b2b89490e127e0bf1205c4a6 | Value of the plot power flag | class Lakeshore475(SCPIInstrument):
def p_value(self):
return self.field_control_params[0] | 0 |
a83d2afec0694dc4bd08e13e95e51466 | 1c8fe87777bc57c21e408f8c76e8b1ed | Empty method for checking collision with these background rocks | public class Crystal extends Enemy
@Override
public void checkCollision(LevelProp prop){
} | 1 |
82a59c999eb0f07a276c2a6eb86bb1ee | 18c4947b1164b1f9a1ee3d8007b8d025 | Comprueba si es un espacio | public class Clasificador{
private static boolean esEspacio(char c){
return (c==' ')||(c=='\n')||(c=='\r')||(c=='\t');
} | 1 |
733da153a2a70b5957e6ed995a22880e | 2a19274a20112e9b0427398ff2ecb562 | @brief Returns the duty cycle of a buzzer | unsigned int PWM::duty_cycle() const
{
return m_duty_cycle;
} | 1 |
6b08f28690b47f8d358a784c2911d5bd | 277bec5c3e16775794d3bb34ded51492 | preprocessing by downsampeling and converting to gray scale | def preproc_before_pred(img):
img=cv2.imread(img, cv2.IMREAD_GRAYSCALE)
img=cv2.resize(img,(200,200))
return img | 1 |
1d40b727a0d459d606f2d5167c3bcc44 | 6d6997150b2f2c5c3a28392aabf2eb7b | 删除短信模板
该接口用于用户删除已创建的模板信息。
Please refer to HUAWEI cloud API Explorer for details. | export class SmsClient
public deleteTemplate(deleteTemplateRequest?: DeleteTemplateRequest): Promise<DeleteTemplateResponse> {
const options = ParamCreater().deleteTemplate(deleteTemplateRequest);
options['responseHeaders'] = [''];
return this.hcClient.sendRequest(options);
} | 1 |
58a33bd2733593d3e74a4fe6257fae9f | a516827a48e9bc7e5616d51e23b2dd0e | CSVをロードするためのボタンが押されたときのイベント。ロードしたCSVのデータをtableに格納 | input = self.entrytext.get()
file_name = str(input) + ".csv"
self.label.configure(text=file_name)
read_csv(file_name) | 0 |
05b83c7e30ff04abf577415a45063504 | 0ff054da403ded38e98f4c01284178bf | Append (a) 3D conformer(s), roughly embedded but not optimized. | class RDKitMol(object):
def EmbedMultipleConfs(self, n: int = 1):
AllChem.EmbedMultipleConfs(self._rd_mol, numConfs=n) | 1 |
4e1b949a8e0c297d7cb265e7078e4114 | 689be229df214bf68aa3f0ecef26f985 | Interrupt priority setup. Called by WICED/platform/MCU/BCM439x/platform_init.c | {
#if (PDL_MCU_CORE == PDL_FM0P_CORE)
#if (PDL_MCU_TYPE == PDL_FM0P_TYPE3)
NVIC_ClearPendingIRQ(CEC_IRQn);
NVIC_EnableIRQ(CEC_IRQn);
NVIC_SetPriority(CEC_IRQn, PDL_IRQ_LEVEL_CEC);
#else
#if (PDL_INTERRUPT_ENABLE_RC0 == PDL_ON)
NVIC_ClearPendingIRQ(DSTC_ICC0_HDMICEC0_PPG_IRQn);
NVIC_Ena... | 1 |
fe9a60b79fce76ebeb2db3f035322df5 | 9792d2f20139ff4c28ddb64d6bcd48c6 | Test set timezone statement. | {
if (!class_exists(TestCaseDatetimeDeserialization::class)) {
$this->markTestSkipped(sprintf('%s definition is not loaded', TestCaseDatetimeDeserialization::class));
}
ini_set('date.timezone', 'UTC');
} | 1 |
0c675f8113f80813d8e7bdcd3412966b | fc467fa86dc99a41263f4d70fa831ac5 | Returns information about GPS location state. | export class Telemetry
gps_info_async(callback?: Telemetry.gps_info_callback_t): void {
this.gps_info_async(callback)
} | 0 |
78645119353895deccef16f93722f361 | afaf13fb2f3d679a8ea2d4d13adab731 | Returns the global merge vars that will be submitted to mandrill. | public class MandrillMessage
public List<RecipientMergeVars> getMergeVars() {
return mergeVars;
} | 1 |
ef84c4d45414810d3daa056fd4ccbdd4 | fd8635443e903a678723933dd21bf2e5 | プラグインに有効化・無効化イベント通知を行う. | @jframe.core.plugin.annotation.Plugin
public class DefPlugin implements Plugin
public void notifyEvent(PluginEvent event) {
_context.notifyPluginEvent(event);
} | 0 |
0bd219084e3487a47bed6a4583929206 | 0ca715ce6680a802fd215253556c067b | 返回ITEM_NONE | void MENU_ItemPrintDisp_nullType(menu_itemIfce_t *_item)
{
assert(0);
} | 0 |
778c425a4338c9937ed01590e1dbae6c | c7e40da8892e966fd1e8b0a0ec9a36c9 | Getter for infotype | class Post extends Main{
function delete_infotype(){
$this->API->deleteInfotype($this->request['params'][0]);
} | 0 |
b36be7014564d6dff96516176f567639 | f2deafb01b4316540fc097476a7f01f5 | 打卡统计 | class Index extends Common
public function daka()
{
$data['dk_nameid'] = session('admin.id');
$data['dk_date'] = date("Y-m-d");
$resone = $pos = Db::name('person_dk')->where('dk_nameid', session('admin.id'))->where('dk_date', date("Y-m-d"))->find();
if ($resone) {
echo "<... | 0 |
bcedbea44dccfdbd181d93ec11a5d95c | e957309d7ec862d4df2de2cfaeb911e3 | Scenario: Retrieve Blob properties.
Given:
- User has provided valid credentials.
When:
- azure-storage-container-blob-property-get called.
Then:
- Ensure number of items is correct.
- Ensure outputs prefix is correct.
- Ensure a sample value from the API matches what is generated in the context. | class Client:
def get_blob_properties_request(self, container_name: str, blob_name: str) -> Response:
response = self.ms_client.http_request(method='HEAD', url_suffix=f'{container_name}/{blob_name}',
resp_type="response")
return response | 1 |
7caa1ad87b8f8282912f17543d4b74eb | cb9457ad69599941f0d2758c3ed0f412 | Serialize key in PEM format, optionally encrypted. | class OpenSSL
public function pkeyExport(&$out, $passphrase = null, array $configargs = null)
{
return openssl_pkey_export($this->pkey, $out, $passphrase, $configargs);
} | 1 |
360aa5706d400075be4fb103ea3a6755 | dfc723ed4d2303db3dd6e99f4b7f09be | 맨시티 미드필더 영입 | void LFC_MF() {
std::vector<LFC_Player> playerMF;
std::ifstream infile("lfc_mf.txt");
int nummf;
std::string positionmf;
std::string namemf;
while (infile >> positionmf >> nummf >> namemf) {
playerMF.emplace_back();
playerMF[playerMF.size() -1].setNum(nummf);
playerMF[pla... | 0 |
cb8883d22b22ba648365bf46a596daa0 | fcb3483c233bb225a344db455106818e | Send user information using POST | function sendUser() {
var author = document.getElementById('enter_user').value;
var url = 'https://main-workspace-juggerr.c9users.io:8081/user/register';
var body = JSON.stringify({"username": author});
postRequestP(url, body).then(
result => function(){
myId = JSON.parse(result);
},
error => {console... | 1 |
f1256c059b292663c9575ef8c8fbc98b | 030bdee3e8a3165588e3bbbda0fc4ef5 | prints list based on special sorting | self.listName = listName
self.objectList = objectList
print("\n===================0===================\n")
print("\tVER "+ self.listName.upper() +"\n")
print(self.SortListMenuOptions())
self.Answer(["0","1","2","3","4","5"])
if self.answer == "0":
ret... | 1 |
7eebc24f3cc513528eabaf83580fe3b0 | a21fa86492c251974736d0992f2431b2 | Enable sectors 0-15 for erase and programming | volatile int* E= (volatile int*) 0xbf886100;
*E = * E & 0xff00;
TRISD = TRISD & 0xfe0;
return;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.