query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6a0f722d099aeb1cb0517afedc517c06 | b2c9f504e229ceb779864247a890520b | Get the output of ffprobe. | def ffprobe(filename):
assert _HAS_FFMPEG, "Cannot find installation of real FFmpeg (which comes with ffprobe)."
try:
command = [_FFMPEG_PATH + "/ffprobe", "-v", "error", "-show_streams", "-print_format", "xml", filename]
xml = check_output(command)
d = xmltodictparser(xml)["ffprobe"]
... | 1 |
b0f6dff31c72595e5b7d14f3820b3e98 | 04ef3e53566666d6ed242854458e7a43 | remove all records which are having null values for a specific column | class ActiveSelectBuilder{
public function where_null($column_name) {
$this->_builder->where_null($column_name);
return $this;
} | 0 |
59a75c0147ae87e89c699bb59010469e | 3078e0f0116b82801b3c9994ef8b2298 | Filters the scanned types to include only those in the provided namespace
or one of its sub-namespaces. | final class OneDeclarationPerFileSniff implements Sniff
public function register()
{
return [\T_NAMESPACE];
} | 0 |
799cb63f5926433675333a3c70c17cae | 45a58390dc52e91ab98be9391dff39d7 | Initializes the hyperparameters to default values | class ICM:
def initialize_hyperparameter(self,h, beta, eta):
self.h = h
self.beta = beta
self.eta = eta | 0 |
f74eac5cd1682a784b4fb740d71d2325 | bd97c548bc77b4695a6e6c44ce02dc4a | 短期借贷拒绝 | @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Throwable.class)
public LoanOrd refuse(LoanOrd loanOrd, InstSession session, String memo,
String ipaddr) throws Exception {
OrdStat stat = this.loanOrdService.refuseOrd(loanOrd);
OperType operType;
if (stat == OrdStat.AUDIT_REFUSE) {
ope... | 1 |
ea4494b474a35599b8fb5b124fa94bf0 | 636deaaa4d226c62fc0c5575bf09a7f1 | this will randomly set active the drawings to display in the UI | public class UIManager : MonoBehaviour
void Start () {
isDragging = false;
toShow[0] = 2;
toShow[1] = 4;
toShow[2] = 6;
} | 0 |
a5f319191714aab71b0604f560fb5cfb | 94aff7d1fa183f8f6d198116059f937c | Fixes-up the old DYLD file offsets in the given link edit data command so they are correct
for the newly packed DYLIB | uint32 SegNum;
uint32 DesiredSegment;
uint32 RecNum;
CMemoryBuffer TempBuf;
CMemoryBuffer RelocationTable;
SCOFF_Relocation rel;
uint32 Las... | 0 |
a13cf3c4db189503b4e119cc48a7fc66 | 61a83a16ac401ef8c5a0aaab1551ea5b | 设置分析线索编号 | @Table(name = "T_HADaa_nnGRE")
@Entity
public class THadaaNngre implements Serializable
public void setGhtNum(String ghtNum) {
this.ghtNum = ghtNum;
} | 1 |
b2e141f1465baf155b8225500d00a6e7 | f81c6fff1663814eac00e3479dbd703e | adds item to queue based on priority (speed) | PriorityQueue__enqueue_priority_item(Queue *priority_queue, PriorityItem *item)
{
if (priority_queue->list->head == NULL)
Queue__enqueue(priority_queue, item);
else
{
Node *current = priority_queue->list->head;
Node *new_node = ALLOC(1, Node);
if (((PriorityItem *) current->d... | 1 |
33b2d982d5ad7da9e7e6bf3f1b2ae40d | abea382e87ad64fd3e5093461e71bc29 | Returns the meta object for the attribute '{@link org.acac.demo.acdsl.myACDSL.AppServerInfo#getVersion <em>Version</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getEMeta_Version(); | 1 |
8e0f50c15ab14765b096e4ab4f9929ec | c853f8ddbe9470a403bd1cc04ab0bba6 | 复制文件,目标目录不存在则创建目录 | class pyos():
def copy(self, source, target):
if not os.path.exists(self.get_path_name(target)):
os.makedirs(self.get_path_name(target))
print('目标目录不存在,将创建:%s' % self.get_path_name(target))
shutil.copyfile(source, target) | 1 |
e9142b220e53b203bd7377ea694c7d6a | b2a7274762a30f12cea3482c95b62a87 | Возвращает пакет байтов для чтения архива по тепловому вводу 1 | namespace EnergyTechAudit.PowerAccounting.DeviceReader.Tv7.API
internal sealed class Functions
public byte[] ReadFinalArchivePipe3()
{
return _modbusPackageHelper.GetCommand(_deviceAddress, _commands.ReadFinalArchivePipe3);
} | 0 |
7113d2aa07fec6c12cf51f20f8f3f71d | b1711df53d84f552876186de0e5bdbb9 | Function calculates the diversity loss between different experts.
The loss is adapted from https://arxiv.org/abs/2002.05709 | var_1 = torch.sum(f_sig)
var_2 = torch.sum(g_sig)
var_frac = torch.sum(torch.exp(g_sig) / (torch.exp(f_sig) + 1e-9))
means = (f_mu - g_mu)
div = 0.5 * (var_2 - var_1 + var_frac + torch.sum((means ** 2) / (var_2 + 1e-9)))
return -div | 1 |
678dc568dbb8e0eb7e7850c6d7ab5dcc | be901e3faa58d7dd5005fed4e47895fe | With multiple frames in flight at once, we can't actually free a slot until we know it's no longer being used,
so we wait until that many frames have gone by | {
const uint32_t deferCount = m_dependentResources.IsValid ? m_maxFramesInFlight : 0;
DoCollectGarbage(deferCount);
} | 1 |
728fcf4b7baf022fdcfd2db1cd86ca94 | 5678084fa0c13706b69b3b3abb8d2417 | 4.public int getNumberWaiting()
【作用/描述】
获取当前就绪/正在等待的线程数,在没有发生异常的情况下,该值等于当前循环中调用await的线程数。
【出/入参记录】
【使用注意点】 | public class CountingBarrier
public synchronized int getNumberOfWaitingThreads() {
return waitingThreads;
} | 1 |
49e6b038cb3645e2a6d94ffb9c378bce | 9ec2f090cd34f3d584345da18248e642 | Unsets the "enddate" element | public function removeEndDate()
{
$this->dateEnd = null;
return $this;
} | 1 |
cbd1d474a79ec085d18736f27c2f95b6 | 45a7e33bdad780d523d1cea0bf169637 | Decorator function which verifies that expected services are running etc. | def ensure_local_services_are_running() -> int:
if settings.DB_DSN.hostname in ("localhost", "127.0.0.1", None):
for service in ("mysqld", "mariadb"):
if os.path.exists(f"/var/run/{service}/{service}.pid"):
break
else:
pgrep_exit_code = subprocess.call(
... | 0 |
a2768cf9e6603031471340e0db0f2e44 | 79483d3088c03f3124a9a455a91af402 | Adds an item to a group. | namespace Bytescout.PDF
internal class OptionalContentGroup : OptionalContentGroupItem
#else
/// <summary>
/// Represents a group for optional content group.
/// </summary>
[ClassInterface(ClassInterfaceType.AutoDual)]
public class OptionalContentGroup : OptionalContentGroupItem
#endif
public void Add(Op... | 1 |
daedeac2d9447d2400dd5b3393abb4c8 | ae444716843533722f7f70eb8c3135dd | Returns a list of Posts. Returned items are paginated with a default page size
of 5 items upto a max of 10 items. | {
$allPosts = $this->blogPosts ?: new ArrayList();
$posts = new PaginatedList($allPosts);
if ($this->PostsPerPage > 0) {
$pageSize = $this->PostsPerPage;
} elseif ($count = $allPosts->count()) {
$pageSize = $count;
} else {
$pageSize = 9999... | 0 |
c1eb5b4aa27d246bff20294f2d06dde8 | 0cfe5fcc8db3c56dc5a3b7d8da6fe1d5 | Free the audio slice buffers | void audioExit(void)
{
ndspChnReset(0);
linearFree(s_audioBuffer);
} | 1 |
d9ccefb581e0f6be7c54d4dddf99fbef | 74523900c63838996749b9fee148ff36 | 设置右侧Progress的值 | if (progress > progressMax) {
this.progress = progressMax;
} else {
this.progress = progress;
postInvalidate();
}
} | 1 |
dcc537f3b29b547c89bfb670dfbe5503 | 4ed884fe112cc36a0a5ce5894c537d60 | returns a monster id to load for floor generation | namespace FarmTypeManager
public partial class ModEntry : Mod
private static partial class Utility
public static class MonsterTracker
public static int? AddMonster()
{
if (nextID == int.MinValue)
{
return null;
... | 1 |
eabba30ec78a5380f332e61470a76e4f | 3894c8fdcabb1a458b32bed53ff56f82 | Is called when the Player releases the left D-Pad Button | public class PlayerController : MonoBehaviour
public void GetMyLeftButtonUp()
{
isLButtonDown = false;
} | 1 |
3e318a8f178280f68127ae02ab540c9d | 50f3d9efcec6f4847ef25e92fbf21dbb | untuk menangkap result dari aksi yang dilakukuan ex : memilih kontak telfon | public void resultHandler(int R_layout, Bundle result_values)
{
if(result_values.containsKey("Button") && result_values.getString("Button").equals("Ok"))
{
try
{
Account account = Account.getAccountFromId(result_values.getLong("_id_Account"));
if(cursor.requery())
{
... | 1 |
4b9d8fd27f2dd6a2586b710b4ecf4c85 | 1ed0166b35f1bbb6723c2c4b80ddbf93 | GuzzleAdapter constructor. | class GuzzleAdapter extends AdapterAbstract
public function __construct()
{
$this->setHttpClient(new Client([
'base_url' => 'https://api.github.com/',
'defaults' => [
'headers' => ['Accept' => 'application/vnd.github.v3+json']
]
]));
} | 1 |
230ba50681823faf5ccd83ee6accbfc4 | 1fb3696330cf9635fd6b551cbc3ae32b | Closes the ffmpeg process and returns stdout, stderr | class ProcHelper(object):
def wait(self):
if self.process is not None:
stdout, stderr = self.process.communicate()
exit_code = self.process.wait()
self.cleanup()
return (exit_code, decode_bytes(stdout), decode_bytes(stderr))
else:
return (-1, '... | 1 |
ada782d67757fcfaab33589bcd604c31 | a0729995977f7f3e8ec1b0cdd873ede5 | Retrieve a TH1F* containing the correctted data distribution | def get_corrected_data(data_raw, correction):
debugmsg(1)
data_corr = data_raw.Clone()
data_corr.Print()
x_corr_var = data_corr.addColumn(correction)
debugmsg(2)
data_corr = data_corr.reduce(ROOT.RooArgSet(x_corr_var))
data_corr.Print()
x_corr_var = data_corr.get()[correction.GetName()]
... | 0 |
3873a45661f49656bbac18bbb8d493af | c4be211191f54030bc078bbf44446a4e | Called when a match instance has been created | class MatchController extends WidgetController
public function create()
{
} | 0 |
c22712fc402964054934f8d30044c05e | 25970138ca1143cb5b7c9a5888bab7a4 | Gets the in-order list of component changes for the given view.
that store the component changes needs to be created if absent.
will be in the same order in which the component changes were added through
calls to <code>addComponentChange()</code>. | public List<IChangeIf.IChangeObjectIf> getObjectChanges(); | 1 |
e6f6b8acf328e984d23d46439b9135d6 | 2d839ce0232c2eaffd1c078790b477f8 | Returns latest 100 saved messages. | class MessageCtrl extends Controller
public function index()
{
return App\Message::where('user_id', '=', Auth::id())->orderBy('id', 'desc')->take(10)->get();
} | 0 |
19874b50fe89501ecf21fc7213f60f26 | 22cb4be916608f114aca81f039a05e83 | Returns a DataStream object with metadata of a stream and data for a given day. | $metadata = [], $options = []) {
return $this->_serverStreamRequest('/tinkoff.public.invest.api.contract.v1.MarketDataStreamService/MarketDataServerSideStream',
$argument,
['\Tinkoff\Invest\V1\MarketDataResponse', 'decode'],
$metadata, $options);
} | 0 |
11bad7d17d558080ba92bf30ab8ecb3c | ae59ca7505b0a79915099c5f53f10875 | Calculate the size of the cells based on the grid size | class Grid():
def cell_size(self):
return int(self.initial_size * self.scale) | 1 |
461f96b8873b6e1d30814ba155ef1d96 | 8b2d34e981311248b5cc554d63bcb17f | 設定 設置錄製的音頻採樣率 | public class CriAtomExPlayer : IDisposable
public void SetSamplingRate(int samplingRate)
{
criAtomExPlayer_SetSamplingRate(this.handle, samplingRate);
} | 1 |
18970ad6bb9e005ccca9b2c0082882e3 | cca0447d715c94d21917ff8a0d834b2f | 确定指定方法上是否标注有指定类型的注解 | public final class AnnotationUtil
public static boolean chkMethod(Method method, Class<? extends Annotation> annotation) {
return method.isAnnotationPresent(annotation);
} | 1 |
1918a93f2b8205ec6750d575f47d01d3 | 9c7f746eceb8f6dd635ee4589cf15a0a | Should create new order using item in cart. | class OrderItemsController
def create
@cart = current_cart
@order_item = @cart.order_items.find_by_product_id(params[:order_item][:product_id])
if @order_item.nil?
@order_item = @cart.order_items.new(order_item_params)
else
@order_item.quantity += params[:order_item][:quantity].to_i
end
... | 0 |
673379f47a23dc181b35dd554e08576b | 56424bca74233db843a6d521b8a51b7a | Gets query conditions from appender. | Condition getConditions(); | 1 |
ec060b10a72f2ddc6c36dad514e75673 | fe3484c4d887436ecf91b042173fd868 | Download articles that are missing from the file storage. | aS3Files = self.getS3Files()
aLogFiles = self.getLogFiles()
aMissing = list(set(aS3Files) - set(aLogFiles))
aMissing.sort()
for sFile in aMissing:
self.downloadS3File(sFile) | 1 |
5990f0bc00a0e7bc0768e1fcbfb04927 | 322857324e59d7cc74d215be89ea779e | Skaičiuoja pažymių vidurkį | namespace L2
public partial class Form1 : Form
static double ŪgioVidurkis(List<Krepsininkas> kont)
{
double suma = 0;
for (int i = 0; i < kont.Count; i++)
{
suma += kont[i].Ūgis;
}
return suma / kont.Count;
} | 0 |
f61158ba6b825b6fddac8ba5b39b6e27 | 9f918bd29384a00b18c293b7c435679f | B -> GiB
将字节转化为GiB(1KiB = 1024B)。
Convert Byte to GiB (1KiB = 1024B). | def to_gb(_value):
return '{:.1f}'.format(_value / GB) | 0 |
30137c8455f8c79ec2dc6c6319d93ae3 | 2cdac4294744b6680b3d7bbd084604d2 | ExStart
ExFor:ListFormat.ListLevel
ExSummary:Shows how to modify list formatting of the current list level. | config := ReadConfiguration(t)
client, ctx := PrepareTest(t, config)
listFolder := "DocumentElements/ParagraphListFormat"
requestDocument := OpenFile(t, listFolder + "/ParagraphUpdateListFormat.doc")
requestListFormatDto := models.ListFormatUpdate{
ListId: ToInt32Pointer(int32(2)),
}
... | 1 |
b51d3b22a22a360fb28352cf8fc829bd | b40aa34d885fe9ee5e9180a52e8981e1 | True if has "reportTablePeriods" element | void unsetReportTablePeriods(); | 0 |
cf0f3c59683033f7215e122408d89e45 | 9a5b49432b723fd5106686b9a3a34101 | [确认订单页面形成订单列表] | class OrderController extends Controller
public function index(Request $request)
{
$arr=$this->getTypecode(0);
$goodon=Goods::where('static','=','0')->orderBy('sales','DESC')->paginate(2);
if(!empty(session('shop_cart'))){
$res=session('shop_cart');
}
$id=sess... | 1 |
5cbbbd6c5b0a5b9ae79fab25e24d493d | f38dcbaf4faf4c5f3f3e65f419275b1c | Unpacks the waranty date code. | {
if (data.Length != 1364) throw new Exception("Invalid string length, must be 1364 characters");
SourceCode = Utils.ToDecimal(data, 20, 3);
DateOfCreation = Utils.ToDate(data, 23, 8);
CompanyPortfolioName = Utils.ToString(data, 31, 30);
CreditCardBeha... | 0 |
492f8acfcace16d595d7d765a2e96ee2 | 818454d5865dd789abc280a872bf22a9 | Test case for list_namespaced_replication_controller | class TestCoreV1Api(unittest.TestCase):
def test_read_namespaced_replication_controller_status(self):
pass | 0 |
eb93c88af1406d4b9a886220003479e4 | 17e656b0b79e2535bb3705ffd1f03f83 | 根据出生日期,计算出在某一个日期的年龄 | public class DateUtil
public static int getAgeByBirth(LocalDate birthDay) {
LocalDate now = LocalDate.now();
if (now.isBefore(birthDay)) {
throw new IllegalArgumentException(
"The birthDay is before Now.It's unbelievable!");
}
int age = now.getYear() - birthDa... | 0 |
817ad3fc42cae2b7965a3b000e81d6c1 | 8d83d7f767ab8fa19adf9ac6615c2dca | Setter to set the status of if a blink was detected or not | namespace IrisbondAPI
class IrisbondDuo
[DllImport("IrisbondAPI.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void setBlinkCallback(BLINK_CALLBACK theCallback); | 0 |
60ff5066554aa06e794a6b459e522ece | f86f9499091e6a2c739d1c7ef4924197 | Generate Password based on Group Policy Password Complexity | string GeneratePassword(); | 0 |
a4599c38b995d98084c133f8fbe3ed13 | 64ec27b6944015ab920528aeb556baaa | Adds classes to menu to support navigation arrows | export default class GUIWindow
addNav(e, elem) {
var arrow = document.createElement('div');
arrow.className = 'nav nav-' + e.direction + ' nav-' + e.type;
let glyph = e.direction === 'left' ? '‹' : '›';
arrow.appendChild(document.createTextNode(glyph));
elem.appendChild(arrow);
arrow.onclick = t... | 1 |
ce6efeb57ce329a77b7ea87369d188b9 | ba41791a09ffece9ec6dca239f4be889 | Fetches the invocation status for a request. | if status:
response = self._perform_request(
'/requests/' + request_id + '/status')
else:
response = self._perform_request(
'/requests/%s' % request_id)
return response | 1 |
8d52b22362fd5e7112bb5abe2b534da5 | 6f9e07da5f6a21d3c82bf5af8d8f0442 | Validates new twitter config entries. | {
$mandatory = [
'TWITTER_API_KEY',
'TWITTER_API_SECRET',
'TWITTER_ACCESS_TOKEN',
'TWITTER_ACCESS_TOKEN_SECRET',
];
foreach ($mandatory as $value) {
$setting = $conf->get('plugins.' . $value);
if (empty($setting)) {
return false;
}
}
... | 1 |
a177e6a13384841954d9311fca166f76 | 5af580530a02c6238bea51c288a74dea | used to get unique audio Id. | namespace Unity3dAzure.BingSpeech public sealed class BingSpeechService : UnityWebSocket
public static string GetId () {
return Guid.NewGuid ().ToString ("N");
} | 1 |
ddec7207761c1ca7bd248884085bf089 | 6eeb19faa4c5e861a67258cc776f2bf3 | Reads in the messages from the other snorklers and determines which
point on the board to swim to. | RobotController rc = RobotPlayer.rc;
System.out.println("first check: " + (rallyPoint.x<1));
if(rallyPoint.x<0){
rallyPoint = new MapLocation((float) (rc.readBroadcast(100)/1000.0), (float)(rc.readBroadcast(101)/1000.0));
System.out.println("setting rally point");
}
if(expectedEnemyCenter.x<0){
expec... | 1 |
1877481cc7048ee9ffd4645af8524387 | 552be227f1cdb891883c190a58fb3671 | 转换模板中的事件链接 | function replace_link(obj){
if(typeof($(obj).attr('onclick'))=='undefined'){
var title =htmlspecialchars(typeof($(obj).attr('title'))!='undefined' ? $(obj).attr('title') : $(obj).text());
if((typeof($(obj).attr('target'))!='undefined' && $(obj).attr('target')=='_blank') || typeof($(obj).attr('uid'))!='undefined'){... | 1 |
ea23ede5b01afa6430b3d139e8708850 | ec9dd8aa1d94058bf0057d2ac33d4714 | 获取已审核的咨询师列表 | export class DoctorService
getAuditedDoctors(page: number, size: number) {
return this._apiService.get(`${PATH.doctorAuditedList}?page=${page}&size=${size}`);
} | 1 |
a7b0f6901cb5fe36a486d35308d6ed40 | 65563f235f78040c5ed348ff587ff7d9 | The intensity-weighted mean position | {
int16_t avg = 0;
int8_t pos = 0;
uint8_t cum = 0;
for(int i = 0; i < 7; i++)
{
sensor->weight[i] = i;
avg += sensor->weight[i]*sensor->calVal[i];
cum += sensor->calVal[i];
}
pos = (int)(avg/cum);
return pos;
} | 1 |
59b043f364b7b92e42e1612a4ebf70ba | d109e96f7522bbb7732cd99cda0a3bf9 | GET: KitchenBankAccounts/Create | namespace Bank.Controllers
[Authorize(Policy = "Banker")]
public class BankerController : Controller
public IActionResult Create(string id)
{
ViewData["UserId"] = id;
return View();
} | 0 |
7fc70ebd162233eba6f0e185f830e797 | 8cbc8f1189cb4ff1a1de3a5340c9d50b | 文字列バッファ出力用ストリームの初期化 | class StringBuffer implements Printable
public function __construct() {
try {
$this->buf = fopen(self::MEMORY_STREAM, "wb+");
}
catch(ErrorException $e){
throw new RuntimeException("opening " . self::MEMORY_STREAM . ": $e");
}
} | 1 |
990b0827c67456d83ae5495d6ee7a3de | 20eec602da09c3b331944d5f2977fd0d | Make a disk `Shape`. | def makeDisk(center, radius, win):
disk = Circle(center, radius)
disk.setOutline("red")
disk.setFill("red")
disk.draw(win)
return disk | 1 |
ce3f126b4fff17e1a4221182cd2a7ae5 | e3aade73eb762ca219a8ea8f5c23ed8a | Sets smaller difficulty parameter used to create a new game with only 3 squares. | class Game(object):
def set_limit_to_3(self):
self.limit = 3 | 1 |
b77d32cbeb437a8d7759e1665bcfdf9a | 66be63a1118fae062958617adafa033a | 按指定编码按行读取文件 | namespace Video.Lib
public class httpClient
public static string fileReader(string path, Encoding enCoding)
{
StringBuilder sb = new StringBuilder();
if (enCoding == null)
{
enCoding = Encoding.Default;
}
StreamReader sr = new Strea... | 1 |
29cf24a30b50564f3cd0c22d1395ae44 | 848787346f69bbb143074ea3487bdb00 | # Extrcats param from format: name=base64_encoded_value | $paramList = explode("=", $params, 2);
if (count($paramList) != 2) {
return false;
}
return decode_param($paramList[1]);
} | 1 |
22e13681fc474eec86bc1e62513af919 | 24203641df75e3523f87fd3ee1c65e7f | # Function to split those genes that occur in two different regions at
# the region borders
# ARGS:
# geneData: dataframe with gene data
# regionData: dataframe with region data
# RETURNS:
# geneData dataframe with splitted geneDatas | .find.cgh.reg.data <- function(data.both, a, nosamp, datacgh.org){
cgh.data <- data.both[,c(1:(a*nosamp))]
splitter <- list()
splitter[[1]] <- c(1)
index.temp <- 1
j <- 1
for (i in 1:(dim(cgh.data)[1]-1)){
if (all(cgh.data[i,] == cgh.data[i+1,])){
index.temp <- c(index.temp,i+1)
splitter[[j]] <- ... | 0 |
18208c193cecda051b94dc9f730faf3b | 62b854adfd90b22faf8042a0af202e6e | Checks the version of the Python interpreter running the script
Returns:
The major revision of the current Python interpreter | def python_revision():
pass | 0 |
028c039898bda23789cf7ab540a5db52 | 13072e7390af15fce48218b47d73882f | Fired after saving a field. | def after_render_field(record, column); end | 0 |
bed0a0ceb08af52d0dba751979b63abe | 54b3f2539b5609176e2f462a6ca758a1 | 获得空的Item的个数 | public class MyCraGetGift extends JavaPlugin implements Listener
private int getEmptySlotCount(Inventory inv) {
int count = 0;
for ( ItemStack i : inv.getContents() ) {
if ( i == null || i.getType() == Material.AIR ) {
count++;
}
}
return count;
... | 1 |
964aa1e8ab7badc2936e1c3fbfd809dd | 3d6fb45e52420402ec2d0a7cda5ed607 | Before nodeCreate check field value for file, if present create file and replace with fid
Field should be in format 'file;__file_source__;__file_name_ | def create_file_node(sender, instance, **kwargs):
if instance.root_folder:
return
root_folder = OsfStorageFolder(name='', target=instance, is_root=True)
root_folder.save() | 0 |
71cff3d9a0ee0311e7d01274ca22561c | c31233843828ab24f9e25fd2b5a005c1 | Method to add serviced packet to results. Additionally it writes data to output file,
it also specifies the flow number of serviced packet | public class LearningSwitch
implements IFloodlightModule, ILearningSwitchService, IOFMessageListener, IControllerCompletionListener
private void writePacketOutForPacketIn(IOFSwitch sw, OFPacketIn packetInMessage, OFPort egressPort) {
OFMessageUtils.writePacketOutForPacketIn(sw, packetInMessage, egressPort);
counter... | 0 |
943ca5206cdccd27300a3d776b46ac58 | b21e6f671dd3c41e09c62aee949dd742 | defining function to determine number of books to be ordered | namespace Flight_Ticket_Booking
class TravelAgency
private int numToOrder()
{
int qty_to_order;
if (incoming_new_price < 200)
qty_to_order = 100 * 300 / (total_tickets_purchased + 300);
else if (incoming_new_price < 400)
{
qty_t... | 1 |
d7c8f3a060ab16f08d2c93456a72f322 | c3a84d22409027f78ae7be1a4b63e42a | Set the users and groups who are allowed to view a report. | public class ReportDefinition implements Serializable, IReportDefinition
public void setRoles( final String roles )
{
this._roles = roles;
} | 1 |
85d4f6ee2b099b266575169a2af6728d | 642599569c11e22153b2bcac7446a489 | 根据指定的属性值过滤异步获取实体。 | {
DynamicDataStore store = DynamicDataStoreFactory.Instance.GetStore(typeof(TEntity));
if (store != null)
{
return store.Find<TEntity>(propertyName, propertyValue);
}
return Enumerable.Empty<TEntity>();
} | 0 |
4c6edede7221c329dd442709845c8cd4 | c2c45fcec53f18d8ee4c5956f1963546 | Performs a complete inverse round over a block using the provided roundkey | {
if (matrix == null)
{
throw new NullReferenceException("Decrypting null matrix");
}
matrix.addRoundKey(key[ROUNDS - 1]);
matrix.invShiftRows();
for (int ii = ROUNDS - 2; ii > 0; ii--)
{
matrix.i... | 1 |
d5287ed21dc70848c9ad0df57d2c248e | e4311acdac6c6c8b2210b5e4313a91e8 | Deletes all auto generated user budget | public void run(String... args) throws Exception {
userProfileRepository.deleteAllInBatch();
userRepository.deleteAllInBatch();
User user = new User("ARS", "SET", "ars@email.com", "tes1234");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateInString = "1992-3-23";
Date date = sdf.parse... | 0 |
a87ad7ced8e18f3545f284ceeab6e8e6 | 91563bf49aee766b7272aeca40650971 | Return empty array instead of array with 1 empty string as entry | function strsEmpty () {
return []
} | 1 |
8eed70ee02437bfcd42b185021326b6e | 267a1a4e41db50f67f5b05367356449c | Returns the total number of times the specified integer value was recorded. | class RootAnalysis(Analysis):
def get_action_counter(self, value):
try:
return self.action_counters[value]
except KeyError:
return 0 | 1 |
b1e44bb1afbb357c5796441e186fae9d | c2a134e4d9cc6ae4c0076f1fc5144b36 | 关联查询所有主讲的课程 | class Study extends EloquentModel implements HasPeriods
protected function allCoursesForSingle() {
return $this->hasMany(Course::class,'course_study_id','studies_id');
} | 1 |
585a0323fd45c944ed5996464bc9ba42 | f8a3b6d782945aa0ba6bc774f41985d1 | ファイルを読み込み、所定行数分の文字列リストを生成する | List<String> list = new ArrayList<String>();
LineNumberReader lineNumberReader = null;
try {
lineNumberReader = new LineNumberReader(new FileReader(filename));
String s = "";
while (s != null) {
s = lineNumberReader.readLine();
... | 1 |
146558002fc07210bbcb53283cfaac90 | dd6f899c73ed901dc862d0f7a9b8688b | 添加面料测试报告操作 | {
if (IS_POST) {
if (trim(I('post.SUB_NAME')) != '') {
$SAMPLE_MODEL = M('SampleDetail');
$save_id = $SAMPLE_MODEL->save(['id' => I('post.SUB_NAME'), 'test_report' => I('post.attachments', '', false)]);
if ($save_id !== false) {
... | 1 |
21f8c53a2416cb9855c899d9e54144e5 | c33dd7c6a6d335178e0ce0541d613290 | Adds a new AND where EXISTS clause | public function _or(): DBQueryWhere; | 0 |
c1bae94406dc9b470700016ab130ad58 | f452112794e14d5bb4470cfe8133fd32 | 方法描述 改变图片后调用此方法重新加载pagicView | public class PatrolLogInfoActivity extends BaseActivity implements ILoadingLogView, View.OnClickListener
private void refreshGridviewAdapter() {
simpleAdapter = new SimpleAdapter(this, imageItem,
R.layout.layout_griditem_addpic, new String[]{"itemImage"}, new int[]{R.id.imageView1});
sim... | 1 |
9abcf30b575f0278ad0da1372204edb1 | 4c959d8f7a0a633ba8b386ae647263f4 | 跳转登陆页面 | public String toLogin(HttpServletRequest request, HttpServletResponse response, Model model) {
model.addAttribute("", "");
return "mobile/modules/html5/index";
} | 0 |
9885aff31ccfdca0876eb9498587dd2f | c06e7a2a2053a656bbf2026f9d4f2f5b | <p>
担当者名を設定します
</p> | @Table(name = "ti_mortent33_his")
public class TiMortent33His
public void setAssNm(String assNm) {
this.assNm = assNm == null ? null : assNm.trim();
} | 1 |
8d5f851b6fe8c685a35ef4d156acc58c | 9b6cbb0738102b5d68f8a1945762cbbf | 直接用所有点的坐标构成的矩阵右乘变换矩阵结果得到所有的变换之后的坐标 | def transform_points(Points,R,t):
return [transform_point(p,R,t) for p in Points] | 0 |
15e65a1116d4f88d5d34bd56576d2110 | 346aec9cee3d0fff02504bd0276f31ac | Returns currency data object from current slide. | export class SlideGS
getObject() {
return this._slide;
} | 0 |
97d31f45aa424c30bb7e4a11467bfaa8 | 1118e4507fcd4a9d4a2f2657d51f3aaa | Returns list of all metadata records, limited by kind if param provided | protected async listMetadata(type: string) : Promise<FileProperties[]> {
return await this.conn.metadata.list({ type });
} | 1 |
5a3e4f411aba0c9f85a01e8474288fdc | c23aa4e2981969234a73c3bb883d6f26 | Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
radio request which take long time to respond.
For more details, refer https://source.android.com/devices/tech/connect/ril.html | v8::Handle<v8::Value> SendRilRequestComplete(const v8::Arguments& args) {
DBG("SendRilRequestComplete E");
v8::HandleScope handle_scope;
v8::Handle<v8::Value> retValue;
int cmd;
RIL_Errno rilErrno;
RIL_Token token;
Buffer* buffer;
if (args.Length() < REQUEST_COMPLETE_REQUIRED_CMDS) {
... | 1 |
47d6ba91903fc837c72a83284749d73a | 47bae0f740396a0c5cfd47a5a51cace7 | Возвращает текущий день в unixtime | $nextDayTime = \Application::getInstance()->getTime()->getBeginningOfDayTimestamp() + Time::TIME_DAY;
return max($nextDayTime - \Application::getInstance()->getTime()->getTime(), 0);
} | 0 |
7d3b7e44350a33cfc9ac7a64e872d2fe | 54bcf2187869bf10dbf105fc2967252c | Return a html formatted list of items | def ul(items) -> HTML:
items = ''.join(f'<li>{i}</li>' for i in items)
return f'<ul>{items}</ul>' | 1 |
731c73a3829945bd9069ca5924599118 | 414017fa4a3f41fe934aaab61a65f21b | Shortcut to get the Host IP, open the connection, get the axis handle,
and initialize the axis just with one function. This steps are used in almost
every situation such as polling or streaming mode. | class GCSCommands(object):
def HIA(self, axes, functions, devices, devaxes):
debug('GCSCommands.HIA(axes=%r, functions=%r, devices=%r, devaxes=%r)', axes, functions, devices, devaxes)
checksize((True, True, True, True), axes, functions, devices, devaxes)
cmdstr = self.__getcmdstr('HIA', axes, fu... | 0 |
24b7e032e418a44de6a45393eff5771a | 000a6240d4347fb3e31c25f2d8aa434c | Adds additional metrics to site aggregated data. | class AdMob_SiteStats extends Temboo_Choreography
public function __construct(Temboo_Session $session)
{
parent::__construct($session, '/Library/AdMob/SiteStats/');
} | 0 |
a4fcb56952703aba7e08c0bb239cae28 | 66f6cd2e8038d0ae12824e322b2d2f32 | List of states of a control field that may be used to evaluate a condition. | class SafetyRuleGatingRule(dict):
def gating_controls(self) -> Sequence[str]:
return pulumi.get(self, "gating_controls") | 0 |
2a894acc024317b7ad6bb93fc0c64435 | 77137e295ea7acf05490c3c34ba41588 | ===========================================================================
DESCRIPTION
If the given software configuration is different from the active config,
then sets it as the new active config.
DEPENDENCIES
None
PARAMETERS
config_id [in]
RETURN VALUE
None
SIDE EFFECTS
May trigger a device reset to active a new co... | class G2Client:
def update_active_g2_configuration(self):
default_config_id = bytearray()
self.g2_configuration_manager.getDefaultConfigID(default_config_id)
self.g2_engine.reinit(default_config_id) | 0 |
96032390ec4aef45e9fd324503b11546 | b66c0abf3bd89ef589d8a1db43b1f0eb | Funcion que returna el precio de cada producto que se elija | class Movil{
public function getPrecioProd(){
return $this->monto;
} | 1 |
ed7246d262dd7c1ca7e641dbac4deed2 | fac36d21db460d54e3c657ae03fd53c5 | Set the continuation point for this frame. | void startContinuation (); | 0 |
48daf41fe884d0f4368b3db5c49288fd | 651561e897aa62d80d0f17db54754c2a | Sets state to handle collision when bumpers detect collision from front | void setFrontCollisionSecurity(int type); | 1 |
99bb54611b134672912153640da61159 | 6e8551536c67a0581516d290b59b6a85 | Returns the list of known board states. | {
return [
self::SINGLE_POSSIBLE_ANSWER,
self::SINGLE_ELIMINATION,
self::PAIR_ELIMINATION,
self::COMBINED_PAIR_ELIMINATION,
self::UNIQUE_RECTANGLE,
self::X_WING,
self::SWORDFISH,
];
} | 0 |
61da8d0fd90e5fc431540a3c3240f019 | 300ccf31ad33eb4c096ebfa41cb26655 | displays projects that a user can contribute to | return this.db.query("select from project where @rid in (select projectsContributed from User where @rid = "+userID+") or"+
" @rid in (select projectsMentored from User where @rid = "+userID+")").
then((rs:any[])=>{
return {code:200,response:{status:0,message:"Success",projectList:rs}}
}).catch((error:Error... | 1 |
137d12e7a237f68d2c5d57084335aa4d | 1066282dc961919b2e005824782016ab | Проверка Изменения значения настройки | {
switch (itemId)
{
case ScenarioEditorItemId.SliderYear:
if (((int) val < GameDate.MinYear) || ((int) val > GameDate.MaxYear))
{
return false;
}
break;
... | 1 |
8f2945ec294fab7d936795ede5c98c78 | 9c801b8ca5a11602a2ddbb1e59b7e706 | 渲染操作提示信息为图片
并将其放置于帮助信息下方 | function insertUpload(msg) {
var _msg = msg.toString();
var _picture_name = _msg.substring(_msg.lastIndexOf("/")+1);
var _picture_path = Substring(_msg);
var _str = "<input type='checkbox' name='_pictures' value='"+_picture_path+"' checked='checked' onclick='return false'/><label>"+_picture_name+"</... | 0 |
6b7b155e5d9e820715ae5fe1d8850a4a | 2d125dbb5b45023525264e6945a04f64 | 获取日天干(八字流派1,晚子时日柱算当天) | class EightChar:
def getDayGan(self):
return self.__lunar.getDayGanExact2() if 2 == self.__sect else self.__lunar.getDayGanExact() | 1 |
600bbd37b6dcd06315ce702f8cde762f | 60ac36c3e49e0528b0655a6fb019b9df | Add plugin to inform about view state changes. | function addStateListener(callback) {
engine.on(CHANGE_EVENT, callback)
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.