query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4c5f4e98c5afcc56e457208cb14c7fc0 | e584e3563c29c6d2dad22b44199b23d3 | タイプ一致による補正 | boolean bEquals = true;
KuracKuraChokuDataInDtRecord target = (KuracKuraChokuDataInDtRecord) reco;
if (this.isAddMode()) {
if (!PbsUtil.isEqual(getShohinCd(), target.getShohinCd())) {
bEquals = false;
}
if (!PbsUtil.isEqual(getShohinSet(), target.getShohinSet())) {
bEquals = false;
}
if (!P... | 0 |
da2cf1e645d81f62d2a5e6d23342f882 | ecdc29d0192df5dc41f3978c9e7aeb25 | Создает хэш для короткой ссылки | class Api extends \RS\Orm\AbstractObject
public static function makeHash($key)
{
return sprintf('%u', crc32($key));
} | 1 |
84c67d25a2b3b812250bcf33059f4759 | b3c699f2bbe9b89564219635ef46b0de | \brief Guarda los datos de los fotoss en el archivo data.csv (modo texto). | function writetxt($data){
$myfile = fopen(__DIR__.'/src/resources/active_image.txt', "w");
flock($myfile, LOCK_EX);
for ($i=0; $i < count($data); $i++) {
$txt = $data[$i]." ";
fwrite($myfile, $txt);
}
flock($myfile, LOCK_UN);
fclose($myfile);
} | 0 |
5886dc81178a7e25636e2d8a5016d911 | 7338e5d7816f0d1213572f80b1056431 | See if the field is actively set: TaxPkgInstId (TAX_ASSIGNMENTS.tax_pkg_inst_id) | public class TaxAbandonedObjectKeyData extends BaseObjectData
public void unsetTaxPkgInstId () {
this._TaxPkgInstIdSet = false;
} | 0 |
2ab256d7e8ad7b47d6362c73bc16086a | d3100070cac4e6b5bf361f6d9edac06a | Sets the Connection Icon depending on the current connection state. | {
if (settingsViewModel.scanner != null)
ConnectionStatusImage.Source = settingsViewModel.scanner.IsConnected ? new BitmapImage(new Uri(@"/Resources/GreenBubble.png", UriKind.Relative)) : new BitmapImage(new Uri(@"/Resources/RedBubble.jpg", UriKind.Relative));
} | 1 |
d7a76b3349abd6689931af34c168e317 | 8b7d876e638711feeeb661909dd878d7 | Hack to make dynamic invocation properly work in both dev environment and in production | if (process.env.NODE_ENV === "test") {
return;
} | 0 |
38eea3391c983083850db4b31eba3770 | 7d41e66ad39e3959bc191681dd2ff9b9 | Retourne une miniature GD en conservant son aspect ratio. | {
$retour = $this->get($nomImage, $largeur, $hauteur, 'crop', FALSE, '');
return $retour;
} | 0 |
addbe6951a26eb240bc23c8312cd6106 | 78b50a0e2e2dab087052e552fadd0036 | Output current time in format set in theme options | $country = $this->configFactory->get('current_time_location.site_location_settings')->get('country');
$city = $this->configFactory->get('current_time_location.site_location_settings')->get('city');
$region = $this->configFactory->get('current_time_location.site_location_settings')->get('timezone');
$cur... | 0 |
fa6f9d30a921f4726f6506ec8b42bf62 | d4340c86201d7cc7d012662619610642 | Convert image format from NV21 to JPEG | if (in->frame_format != UVC_FRAME_FORMAT_UYVY)
return UVC_ERROR_INVALID_PARAM;
if (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)
return UVC_ERROR_NO_MEM;
out->width = in->width;
out->height = in->height;
out->frame_format = UVC_FRAME_FORMAT_BGR;
out->step = in->width *3;
out->sequenc... | 0 |
2f9ff759e79de27a2ee1be81c7e73afa | 21250e023647c9b89ae87d0b27848d4c | Fonction déterminant si un chemin existe entre deux états | explores = [depart]
a_explorer = [depart]
while len(a_explorer) >= 1:
sommet = a_explorer.pop(0)
if sommet == arrivee:
return True
voisins = L[sommet]
for voisin in voisins:
if not voisin in explores:
explores.append(voisin)
... | 1 |
25d998d496ab37e39cfac4a66278abb3 | 40508c137d9544146d335794c3daa70d | Ensure that the rate limiter executes immediately a number of requests that is below the configured rate limit. | {
$timer = new FrozenTimeTimer();
$storage = new FakeApcuStorage(5);
$limitHits = 10;
$counter = new Counter(
$storage,
$limitHits,
1,
86400,
'rate-limiter-',
$timer
);
$totalHits = 0;
do ... | 1 |
d8480674536685240229f551a6a29a3e | 03da10801c0ae5e12141d143e354ca26 | 领接表深度优先遍历 | public void deepFirstLoop() {
ListGraph graph = new ListGraph(4, true);
graph.addEdge(2, 3);
graph.addEdge(3, 1);
graph.addEdge(1, 0);
List<Integer> list = graph.deepFirstLoop(2);
System.out.println(list);
assertTrue(list.get(0) == 3);
assertTrue(list.... | 1 |
844921d39f0756f2ef2c14a147cfac3b | 9b2861728ec6f2294edd4e249f7fdea8 | 发送报关委托 | public Result<CustomsOrderDeclareRespDto> customsDeclare(CustomsDeclareReqParamsDto params) {
log.info("call 单笔报关入参 ProxyCustomsManagerImpl.batchCustomsDeclare:{}", params);
Result<CustomsOrderDeclareRespDto> result = customsDeclareFacade.declare(params,
MDC.get(SystemMarker.TRACE_LO... | 1 |
d1dcd5c95fb482674510eb7b837be415 | 49b7d9a2ea3f70ab9c55b864724d463b | Posts the game data. | function postGame() {
return {
type: POST_GAME
};
} | 0 |
40a56e426d66904bcc8ef5e696382923 | b0a7aac79dece333aa981e31a590013e | delay in micro seconds | void delay_micro(unsigned microsec){
SysTick->LOAD=((microsec*3)-1);
SysTick->VAL=0;
while((SysTick->CTRL & 0x00010000) == 0);
} | 1 |
5d7bd276ecefb2bafa2894ebef3409eb | 12d4b8c638621ced499bd63e8f4e9aaf | Get the name of the bean (if it has a name). Otherwise return null. | if (getName() == null) {
return null;
}
return getName();
} | 1 |
6e4b78f009898b2c25234afe25306195 | cf4adbf302dafcc247884a97029f4e23 | Returns a dictionary with values of Cohen's kappa between all pairs of
users | C = dict()
N = dict()
for user, items in prefs.items():
for i in items.keys():
N.setdefault(i, 0)
N[i] += 1
C.setdefault(i, {})
for j in items.keys():
if i == j:
continue
C[i].setdefault(j, 0)
... | 0 |
9f5ea2f1b8a5609362c9fae53b22030d | d46a7367abbce76edf54d9400f3c6a23 | Initializes the mother ship | void ship_execute_initialization()
{
ship_setup();
} | 1 |
c8d5e4240e00fab5c95e3bd8e387aba2 | 117f4c58262b93a3791dfd84aa909832 | Load BERT language model and use for embedding of tokens or sentence.
The Model is trained by BotXO: https://github.com/botxo/nordic_bert | def load(model: str = 'xlnet', pool_mode: str = 'last', **kwargs):
model = model.lower()
pool_mode = pool_mode.lower()
from malaya.path import PATH_XLNET, S3_PATH_XLNET
from malaya.function import check_file
if pool_mode not in ['last', 'first', 'mean', 'attn']:
raise Exception(
... | 0 |
478989ca9fa0f92d23acac523860c775 | e506eeada9be7fe835b8ab18254eaca0 | Override exception passback for presence. | class PassThruFilter
def present?(object)
object.respond_to?(:empty?) ? !object.empty? : !!object
end | 0 |
c483ba339c1862bcfddddff689c8e2d7 | 4dcab42bcb98af8dd7e08fa7af2e9e31 | 根据主键id查询报警发送记录 | public JbdSendRecord getJbdSendRecord(final String id); | 1 |
26648ec51f5239c929ba7673152d5370 | 616f3a8462780eb0109f04a4042ed416 | Test for valid royal flush | def isRoyalFlush(handValues, handSuits):
return isStraightFlush(handValues,handSuits) and highCard(handValues) == 14 | 1 |
4e4d44a66fe121bf535afa6d5d6252a9 | df3a782cf6303f5d7e4673f8bccf7545 | 绘制左头像 | static void drawLeftArm(void){
RIT128x96x4ImageDraw(g_pucLeftArm, 36, 27, 10, 1);
} | 0 |
7597088dbdf4ce29e390131aff4d42a4 | 6a5a7857332bf5603796624d6aba4934 | called to calculate the discount for the logged in customer according to that customer's regular status | const isEmployee = this.isEmployee();
if (isEmployee) return { type: 'Customer is employee', value: PROMO.EMPLOYEE };
const isAffiliated = this.isAffiliated();
if (isAffiliated) return { type: 'Customer is Affiliated', value: PROMO.AFFILIATE };
const isLoyalty = this.isLoyalCustomer();
if (isLoy... | 1 |
14c2aa9805db8c94efddfdff8b79edcc | 30593d46ee63087963c7f1371dea706c | Release the node.
If no num_links reference it, node will be truncated. | class Link(IDableObject):
def deactivate(self):
self.src_node.remove_next(self.dst_node)
self.dst_node.remove_previous(self.src_node) | 0 |
6d8f15fbfb220ac14b02b94529a1dea5 | 0f0ba4cda093757d77a07c2504f1794e | Передаём вновь созданной форме её владельца. | class CreatePost(CreateView):
def get_form(self, form_class=None):
form = super(CreatePost, self).get_form(form_class)
form.instance.owner = self.request.user
return form | 1 |
87da0ea1a32cad547029293cbec24527 | d60f814075fd885588ae77777fe307cd | Parses and checks JSON and returns Dict with questions | q_list = []
question = []
for x in raw_list:
if x[0] == "[START QUESTION]":
question = []
elif x[0] == "[END QUESTION]":
q_list.append(question)
elif x[0] == "CATEGORY NAME:":
q_list.append([["category", x[2]]])
print("Category is ... ... | 0 |
b24da251f062894de977e04a9fedd8af | bf3c1fc44474038794da3a3c2b70ab74 | @brief Adds new successor of the node. | void Aggregator::newNode(Call *call) {
unsigned newIndex;
if (graph[currentNode]->getSuccessors().empty() || !(newIndex = exists(call))) {
GraphNode *newNode = new GraphNode(call);
graph.push_back(newNode);
newIndex = graph.size() - 1;
graph[currentNode]->addSuccessor(newIndex);
grap... | 1 |
c5466646b278c2eeb90b74dc6400e818 | b81be9d926754fa28db452638988c569 | Test that a describing Annotation is added. | class AnnotationServiceImplTest
@Test
final void testAddAnnotation() {
} | 1 |
a612f0767070c4ff71c9415fbff98037 | 093348d35d74dcfc001ea09e90818788 | Something must be shown at login! | class AuthController extends \BaseController
public function index()
{
return Response::json(['result' => false, 'data' => [Lang::get('responses.bad_request')]], 404);
} | 0 |
13cd3233cc4c44946b292716036ead99 | 6ddf4392096a454abec707208fa3c4dc | Called after [`allocate_all`] was invoked.
[`allocate_all`]: crate::AllocateAll::allocate_all | fn before_deallocate(&self, ptr: NonNull<u8>, layout: Layout) {} | 0 |
aa3922e1f0ea66ec4b468379de2a45b3 | c6017d6b0616c74989919bfd05353c96 | Clears the extensions. | class ExtensionRegister
public static function clearExtensions()
{
static::$extensions = array();
} | 1 |
09045dcd44723662fa8dc2494835c8be | f001355f8005fa6409615719e17df194 | Tests that FlashErrors are passed through. | class IntegrationTestCase(TestCase):
def test_replace_flash_scope(self):
request = lambda: self.client.get(reverse(views.replace_flash))
self.assertRaises(TypeError, request) | 0 |
a002065d1b3537a2c1a4e734618fb338 | 04b41278945923ad8d24a509f2dcf367 | обработчик нажатия кнопки разъединения | class MainWindow(QMainWindow, Ui_MainWindow):
def on_pushButton_interrupt_clicked(self):
self.pushButton_Send.setEnabled(False)
self.pushButton_Connect.setEnabled(True)
self.pushButton_interrupt.setEnabled(False)
close_connect()
pass | 1 |
6ac378959e7a557fb04e81bc22396290 | 38df8be8191ce90e594f1476a15e981f | Clone process config. | class RemoteMySQLSource(MySQLSource):
def clone_config(self, dst):
cfg_path = self._get_root_my_cnf()
self._save_cfg(dst, cfg_path) | 1 |
dcf5731354fc3c27cbc3f704c7e2e28c | d24c5b90c24f7e78b6a3ad5ad211c90e | 获取单位和库存数据 | $param = array('type' => 1, 'key' => $this->keyword, 'page' => $page);
self::unitQuery($param);
$tableReg = array(
'tdContent' => array('.proList tr','html','',function($content){
\phpQuery::newDocumentHTML($content);
$tdArr = pq('td');
$textContent = array();
foreach($tdArr as $td) {
... | 1 |
0750857e3e668c8bb375ede8d72e4f60 | f796479c4e438f6d6a206746f85e2800 | Devuelve la barra de herramientas. | QToolBar *MainWindow::toolBar() const
{
return ui->toolBar;
} | 1 |
669d717f87cba1dd9578e884c08544d0 | aa120b44b102db2283018ecf3af3124f | Get expected output from README.md. | from os import path
rootdir = path.realpath(path.dirname(__file__))
with open(path.join(rootdir, "README.rst")) as readme:
return readme.read() | 0 |
6bb1782569d80e777b4b2fff563a16a1 | f3fc71080f94389df0b9790bac955f93 | Returns whether it intersects and that the intersection point isn't an endpoint | bool Polygon2D::intersects(const QVector2D& a, const QVector2D& b, QVector2D& intPt) const {
Polyline2D polyline;
polyline.push_back(a);
polyline.push_back(b);
std::vector<QVector2D> points;
boost::geometry::intersection(*this, polyline, points);
if (points.size() > 0) {
intPt = points[0];
return true;
} els... | 0 |
467e8ce27c8f08366e5c21cb471ddced | f55731c6014557481f87206d91e7011f | List source files.
Returns:
A list of all sources files, with the main file listed first. | class Builder:
def sources(self):
return self.__sources | 0 |
94862325df535b5068307ba9d552c0ad | 150643a1cf8e7209c2fb01107888c302 | Exit a parse tree produced by {@link KotlinParser#comparisonOperation}. | public class KotlinBaseListener implements KotlinListener
@Override public void exitEqualityOperation(KotlinParser.EqualityOperationContext ctx) { } | 0 |
7e870918e799fd001b567af1a7132771 | 41d855a23e4d2cdfe35bac9716dd24a4 | Function Definition to Clear Timer2 Overflow Flag. | void __ISR(_TIMER_2_VECTOR, ipl2) Timer2Handler(void)
{
mT2ClearIntFlag();
} | 1 |
ce59d19b290a4409e9815ca6e097718a | 21b46d71eab23ac5734c7580d6ce94f8 | Adds to the dataframe the population about the initial country where the
disease begins. | tmp = total_df.reset_index()
tmp = tmp.merge(dist_vect, on="FIPS")
tmp = tmp.merge(data_to_dist, on="date")
if replace:
tmp = tmp.assign(cumulative_reported_cases=tmp["pop_fraction"] * tmp["cumulative_reported_cases_y"])
tmp = tmp.assign(cumulative_deaths=tmp["pop_fraction"] * tmp["cumul... | 0 |
da9b7813168991e9697aa303b5a1e08a | 8425d48e2a98f5200a059a04511a591f | Provides arguments for {@link #testCountCategories(Film)} method. | return [
'empty category' => [
'categoryindex' => 'emptycat',
'includesubcategories' => false,
'usetagnames' => [],
'expectedcount' => 0
],
'single category' => [
'categoryindex' => 'cat1',
... | 1 |
7a60204a998278029a3bd224d1fe611c | fe41c0cec5840f739e1637e94788c0cb | 获取移仓单据,默认获取未上传的100个 | class LazadaOrderMain extends LazadaModel{
public function getNotLoadOrderList($platformOrderID) {
$startTime = date("Y-m-d",strtotime('-'.self::MAX_TO_OMS_DAYS.' days'));
$obj = $this->getDbConnection()->createCommand()
->select('*')
->from($this->tableName())
... | 1 |
b3212cf5ed13f1ee2200ca8bd3d874fa | 2d03240db2a1dc221af3a11a58e7274e | Calculates forward difference. | namespace SoundLibrary.Mathematics.Discrete
public class Differential : Function
public static Type BackwardDifference(Function f, int i)
{
return f[i] - f[i-1];
} | 0 |
deabeda39509f84220960687340ad016 | f3f454e9ebaf80c45fb9b2afb26b0569 | Function to get the list of rooms following a post | if($request->role === 'user') {
$user_id = Auth::user()->id;
return Room::where('user_id', $user_id)
->orderBy('updated_at', 'desc')
->get();
}else {
return Room::where('status_id', 1)
->orderBy('updated_at', 'desc')
... | 0 |
7f68b341736da12775c695a0f061c325 | 4352fe4aabde798d6aa95c9303f8a20c | Return the current X500 principal.
X500 principal that has been authenticated by the vault. | public X500Principal getHolder(); | 1 |
a1136c6fa1a8312076ac8631ec3bb706 | 90e1dff904fb5ab23cb816bef2d7c121 | Scrub sparkle/sfn customizations from the stack resource data | public class TemplateUtils
public static void scrubTemplate(final TemplateDTO templateDto) {
scrubSnippet(templateDto.getSnippet());
} | 0 |
42a7737f308a4fe7aa106ebdd4a9c795 | 08b77a1ac6410d5a51cf6af22a91cf30 | This function is the main control loop used for the position reference of the Quadcopter
all of the calculation below used a standard PID controller model, with a sample interval
of 30 ms | curr_z_pos, desired_roll, desired_pitch, desired_yaw,
desired_x_pos, desired_y_pos, desired_z_pos):
error = [0, 0, 0, 0, 0, 0]
error[0] = desired_roll - curr_roll
error[1] = desired_pitch - curr_pitch
if(desired_yaw >= curr_yaw):
yaw_... | 1 |
9bfa2f3e26ed0ed38fce4e02949da4bf | c7677219ec04cfdf3f6ea4a23cdd548d | Measure execution time of multiple code blocks with ``with``. | t = AccumulatedTimer(TIME_MESSAGE, logger=print)
laps = list()
for _ in range(3):
t.start()
sum(n ** 2 for n in range(1000))
laps.append(t.pause())
total = t.end()
assert sum(laps) == total
stdout, stderr = capsys.readouterr()
assert re.match(TIME_MESSAGE + r" 0\.\d{4... | 0 |
0aeeae96ccbbc234e6e5b4dbb79ef8d4 | 0e8ce1dab264eb881d3ee84ebbb141e6 | Handle ValueErrors in int-returning functions. | @wraps(func)
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
try:
onehot = 2 ** result
return onehot
except ArithmeticError as e:
errStr = "expected 'result' to be of type int\n" + \
"but was of type {} instead.".format(typ... | 0 |
4ba27abcbbc9fe2b25fc9c5b55ceeef4 | 9fc4f103a6fc1872bbbaa8474b3014ef | zoom on a point | const geoPoint = {longitude:117, latitude:31 } as IGeoPoint;
this.chart.zoomIn(geoPoint, 1*1000);
} | 1 |
9e0dba2680c20c38d7a66a82cdd83eff | 9550b655e9378631e8a7cf33340b4fb8 | 判断当前在哪个页面 | function curPage() {
var boxCtn = $('.main_body'),
hrefLi = $('.s_oplist .oplis'),
nowHref = window.location.href;
if (nowHref.split('#').length == 1) {
$(boxCtn).load('../html/home.html');
} else if (nowHref.split('#').length == 2) {
$(boxCtn).load('../html/' + nowHref.split... | 1 |
f58b78750207fb20347403f25cfdc4f5 | 481864eebc583352adaed2fd60289817 | \brief 从数据接收链表中清除相同端口号的对象 | SourceRouterLinkType *XBeeProcessRoutRcord(SourceRouterLinkType *p_head , uint8 *rbuf)
{
uint16 target_adr=0;
SourceRouterLinkType *p=NULL,*pS=NULL,*pRe=NULL;
target_adr = 0;
target_adr |= (uint16)*(rbuf+13);
target_adr |= (((uint16)*(rbuf+12)) << 8);
pS = CreatRouterLink(rbuf+4,target_adr,(rbuf+16),*(rbuf+15));
... | 0 |
33ca5b99c5a65674c5e6becfbb8c27f3 | ff7f3c4cc8c57491b3cde913b6814b35 | Attempts to insert the team data in the database; returns True if successful, else False | class dbconnection
public function InsertTeamData($username, $teamName) {
$query = "INSERT INTO studentteam (stuid, team) VALUES ('$username', '$teamName')";
if (mysqli_query($this->dbc, $query)) {
return true;
} else {
return false;
}
... | 1 |
0d63f3f1a4d1fa707818b878c8e04964 | 9d3c084381da4c12d179a8e22bdb53e0 | Returns true if value can be used in a foreach() loop. | if (!isNullOrUndefined(value)) {
if (typeof value === 'string') {
return false;
}
if (typeof value['entries'] === 'function') {
return true;
}
if ((typeof value[Symbol.iterator] === 'function') || (typeof value['next'] === 'function')) {
re... | 1 |
43c4d65755fd836cb4355196bcd371b4 | 8fc78928e2f3160fce783fc1b0863da3 | Calculates reading speed of the attempt in words per minute. | $reader_words_per_min = 300;
$num_words = str_word_count( strip_tags( strtolower($content) ), 0);
$reading_time = null;
if ($num_words > 0) {
$reading_time = $num_words / $reader_words_per_min;
}
return $reading_time;
} | 0 |
15d9cea08966a0c399e03c869eff3044 | dd88686fcc7ed1aad717a65c18d501b7 | 判断文法是不是LL1文法 | bool LR::isLR0() {
map<int, CLOSURE>::iterator it_cls;
set<Item>::iterator it_item;
for(it_cls = closures.begin(); it_cls != closures.end(); it_cls++) {
set<Item> &cls = it_cls -> second;
int shift_count = 0;
int reduce_count = 0;
int i;
for(it_item = cls.begin(); i... | 0 |
c64974dc3879c7ce56348ab175664522 | 94997eb3f4538df74ecb1e69a0e46b22 | Tests browser request guess function. | class CompressionAlgoTests(unittest.TestCase):
def test_chrome_ranged_requests(self):
accept_encoding = 'identity;q=1, *;q=0'
self.app.config['COMPRESS_ALGORITHM'] = ['gzip', 'br', 'deflate']
c = Compress(self.app)
self.assertEqual(c._choose_compress_algorithm(accept_encoding), None) | 1 |
4bf339dd72e7926cbe17fbcaf93b6762 | 6ee772b0ad813da184035dd7a3dfaa82 | 測試 Repository 主要功能 | {
$repo = $this->dataRepositoryProvider(User::class);
$user = $this->userProdiver();
$this->assertTrue($repo->save($user));
$user = $repo->find(1);
$this->assertInstanceOf(User::class, $user);
$user->name = 'New Nmae';
$this->assertTrue($repo->update($user));
... | 1 |
d33c278e3180a3ec2f2c10ce819ea933 | aea7e4dc226337c33365d00238983f2a | 保存当前图片对象,自动根据后缀名,保存图片。 | class IMAGE
private function saveImage($image, $save_file_name = '')
{
$info = getimagesize($this->imagePath);
$type = image_type_to_extension($info[2], false);
$funs = "image{$type}";
$file_name = md5($this->imagePath);
if ($save_file_name) {
$file_name = $save_f... | 1 |
64873beb17a3b0e06ff65216cd34079c | 5a8b8ef9fe42850b72ad44e263ca4e59 | 增加worship_num | class ServerArenaPanel extends BaseTabView
private onWorship(): void {
let worshipMsg: Message = new Message(MESSAGE_ID.ARENE_CROSS_WORSHIP_MESSAGE);
GameCommon.getInstance().sendMsgToServer(worshipMsg);
} | 0 |
6615d70658c24ad253136b1e13627588 | 5601595333c548b85ea0354903387f01 | Получает путь к шаблону лэйаута
Относительно PATH_TEMPLATES_COMPILED/$engine/$language/, без расширения
(например, 'layouts/system'). | {
$class = new \ReflectionClass($this);
$classFile = Str::Replace('\\', '/', $class->getFileName());
$templatePath = Str::Replace('/Modules/', '/Templates/', $classFile);
return Path::AddExtension($templatePath, 'phtml', true);
} | 0 |
ad81f22c26086cc99444d3e3aab57ae2 | dae2669c172dd1a33ba99c1d15dbdd14 | Definerer rad- og kolonne-pins, og oppretter dict. for key-mapping. | class TwentyFortyEight:
def __init__(self, grid_height, grid_width):
self._height = grid_height
self._width = grid_width
self._initdict = { UP: [(0, col) for col in range(self._width)],
DOWN: [((self._height - 1), col) for col in range(self._width)],
... | 1 |
5f903cc8f0fdc82e9d8270d025073b58 | c5e9f3e7b74a0a689e49dd5cccdd8143 | Giving the char an AI. | var frequency = genRandNum(0, 100)
var randomChar = charSet[genRandNum(0, charSet.length - 1)];
if (frequency <= 15) {
$("#char_" + charId + "_" + targetId).text(randomChar);
if (frequency === 0) {
$("#char_" + charId + "_" + targetId).css("opacity", "1");
$("#char_" + charId + "... | 0 |
227b1e9738a57d85a0344c701462fcff | 69f0797d19906ba74cf7ea516f5b1dff | Distribute ordinary items in trucks | public void testGetTrucks() {
Item newItem = MockItem.getRandomNormalItem();
newItem.setToReorder();
manifest.addItem(newItem);
ColdItem coldItem = MockItem.getRandomColdItem();
coldItem.setToReorder();
manifest.addItem(coldItem);
Truck newTruck = new OrdinaryTruck();
newTruck.addItem(newItem);
Truck... | 1 |
ad620ee6dfe32eeba01dd58b879b8caa | ca7c32dd07a7624c1b5384e946d51a06 | Opera la traduzione su un intero alfabeto.
Se una stringa non è specificata all'interno della traduzione, viene lasciata inalterata. | public class Sms extends Request
public Sms translit(String translit) throws UnsupportedEncodingException {
querySend.add("translit", translit);
return this;
} | 0 |
9aab4ab94780a6d6ebde23dd5f28193d | 5434ee085f0cf68560d729bde63fa992 | ファイル出力用ストリームを作成。
<para>親ディレクトリが必要なら勝手に作る。</para> | {
Stream s = null;
try
{
if (filename == null)
{
filename = m_PostExecLogFileName;
}
if (filename != null && filename.Length > 0)
{
FileInfo fi = new FileIn... | 1 |
2fd3aa80637d7bcc3bcc57ccf3480928 | 8eef9a2d65a19c9152fca7f046459425 | A function which reads image(s) from the path provided
Input:
img_path: Path containing images
Output:
A batch containing all the images read using opencv | def _read_image(img_path):
img = cv2.imread(img_path)
return img | 0 |
7dc5683d8d3dcba462f3d5e42c553185 | 04fc592514b9dc514748d406b2ce10d6 | 根据科室名称查找当前科室里医生有哪几种职称 | String sql = "select * from base_dictionary where name like '%"+majorAbb+"%' and parent = (select id from base_dictionary where code = 'professional')";
return super.findBySql(sql);
} | 0 |
8ed0b9f7e577dd6ee3ce6b28a87fbeb1 | 84039c8c15f8356810dc2e4467178f69 | Query bitcoind for its height. | class ObeliskOfLightClient(ClientBase):
def fetch_last_height(self, cb):
self.send_command('blockchain.fetch_last_height', cb=cb) | 0 |
7f06fe69e892d0675aba78a324b23216 | c2bf57bcec6f27981375f3ab9b666e4d | Return the available cards in the tableau. | List<LandCard> getLandsOnTable(); | 1 |
bb165f820054c43345e08c5a7fbcc035 | 375faa5f52b57ce775d45280c5bb7229 | Checks for and warns about discouraged names. | @Incubating
interface LintOptions : Initializable<LintOptions>
fun warning(vararg ids: String) | 0 |
78abb2b231af0112796a2fb1d90aaf69 | bb6c7d58706a4f7ac3ba7021acf3adcd | Find the first particle that we can replace | {
while (firstRetiredParticle != firstActiveParticle)
{
int age = drawCounter - (int)particles[firstRetiredParticle * 4].Time;
if (age < 3)
break;
firstRetiredParticle++;
if (firstRetiredParticle >= setti... | 1 |
7f26f2598d5c98b552f346977755fd8c | 8a20f2d430ea6c176e4a54c70e9cc9c7 | 保存当前分单弹窗 | toSingleSettle() {
this.$refs.dialogSingleSettlRef.showDialog(this.currOrderInfo.order.orderPk)
} | 0 |
6fe396028dfb3a9b9af09a8a917385c7 | fa57c4a6d0a176f7b9edc5fe7920721c | Decorator for marking methods of the PFS API which are
not allowed to occur during a transaction. | def wrapper(self, *args, **kwargs):
state = self._pending_transaction()
if state is not None and not state.rollback(self.path):
raise PendingTransactionError(state.name)
return meth(self, *args, **kwargs)
return wrapper | 1 |
a7ff2ba9df2bca5b368198199cce993b | 8d7eb3a6f9d237f966dd2d9af9bd7167 | Sort students by their username | Arrays.sort(players, new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
return (s1.substring(s1.indexOf(" ")).compareTo(s2.substring(s2.indexOf(" "))));
}
});
} | 0 |
b3af7da9ace20564b2bff9baf652928f | 896468922a512b8911f8ca2c87bacff5 | Gets the dimensions and type of an image stored on the filesystem
The `'type'` key will have one of the following values: | class api_upload extends api
public static function getimageinfo($imgname, $string = false) {
$info = $string === true ? getimagesizefromstring($imgname) : getimagesize($imgname);
if ($info) {
return array(
'width' => $info[0],
'height' => $info[1],
... | 1 |
41dc563fb791b7178ffa9a8da409bfe5 | 29595f67f6eb21c59d189b2ca1043b4d | Ouverture/Fermeture de tous les sacs de l'inventaire | namespace Motherload.Interfaces.Unity
void ToggleInventory(); | 1 |
1c938ba454283150c91937897ff79dda | b848fc880bec7da5a0a8baf948a0a2cb | testing normal functionality: no player wins | array = [[1,2,1,1,2,2,2],
[1,2,1,1,1,1,2],
[0,2,2,1,2,2,2],
[0,1,0,1,2,0,2],
[0,0,0,2,0,0,0],
[0,0,0,0,0,0,0]]
board = Board()
board.board = array
test_pos = [[1,2],[1,5],[1,8],[4,5],[3,6],[3,3],[-4,3],[2,11]]
sym_p1 = 1
sym_p2 = 2... | 1 |
96967689fe1995a860fc401c6fa3e93a | 2701fc8b67e5bf8d3b20ae6f4bb72a68 | Convert nested rules to separate, remove them from original styles. | {
$keys = array_keys($this->_rules);
$i = 0;
while ($i < count($keys)) {
if (!$this->_rules[$keys[$i]] instanceof Structures_CSS_Rule_Set) {
$i++;
continue;
}
$j = $i + 1;
while ($j < count($keys)) {
... | 0 |
0e55bf818f3c7edd8c88ce5f3eb2f2bf | 80ae966d6d2132053fee9358ce35285c | Enable or disable windows defender. | class ManagedDeviceItemRequestBuilder(BaseRequestBuilder):
def windows_defender_scan(self) -> WindowsDefenderScanRequestBuilder:
from .windows_defender_scan.windows_defender_scan_request_builder import WindowsDefenderScanRequestBuilder
return WindowsDefenderScanRequestBuilder(self.request_adapter, self.... | 0 |
f5ee59747d9bd3fcd9b583cad7fd08b9 | 7f61448ad6da3ef0f9cb03f40c5be655 | Override this function to implement the functionality. | cases like (1) | 0 |
a4625d3dc97a4f27ae7ed92123b904b0 | fd8a7ebafef406ce2a29c853fabe4cb0 | Generate output dict for the detected date value with extra metadata | y = self.date_published.strftime("%Y").lower()
m = self.date_published.strftime("%b").lower()
d = self.date_published.strftime("%d").lower()
s = str(self.slug)
return ('embedded_media_detail', None, {'year': y, 'month': m, 'day': d, 'slug': s}) | 1 |
0da544b579f1b2b65376716c6d3a53ea | e566ee85116dfcaea2b4fc6b46b8d517 | Dedimensionalise time | if config["simulation"]["dimensional"]:
start_time = config["simulation"]["start"] / NON_DIM_TIME_TO_DIM
end_time = config["simulation"]["end"] / NON_DIM_TIME_TO_DIM
msr_timestep = config["simulation"]["msr_timestep"] / NON_DIM_TIME_TO_DIM
else:
start_time = config["simulation"][... | 1 |
11830c8dd62a9ed1c08ff61c111428ac | 37a6f43a4708b782e5adc6378de53652 | Создаст MD5 путь для файла при помощи рандомной строки и микротайма. | namespace WebApi1.Utility
public class FilesHelper
public static string GetMd5Path(string md5, string name = "", string path = "", string root = null)
{
name = !name.IsEmpty() ? name : md5;
return $"{root}{path}/{md5.Substring(0, 1)}/{md5.Substring(1, 1)}/{md5.Substring(2, 2)}/{md5}{... | 0 |
67d555fa4de43fafe412628fd2f4b65d | 9a95ea72ca66bf8ce713c3cf3d7c9baf | Create and train a classifier, and return the parameters.
train_data: a list of (label, feature) pairs.
dev_data : a list of (label, feature) pairs.
num_iterations: the maximal number of training iterations.
learning_rate: the learning rate to use. | def _train_ME_Classifier(extractedBases, lbls, params = {}):
trainset = [[eb, lbl] for eb, lbl in zip(extractedBases, lbls)]
optimizer = params.get('optimizer', 'GIS')
trace = params.get('trace', 3)
encoding = params.get('encoding',None)
labels = params.get('labels', None)
sparse = params.get('s... | 0 |
a55690f962ccd2aac8acf55239dcb2e5 | 5fe189b755f073b04cb83938f64ed838 | initService initializes the DataONE indexer service. | service := Service{
HTTPClient: &http.Client{
Transport: &http.Transport{
MaxIdleConnsPerHost: 2,
},
Timeout: time.Minute * 10,
},
Router: http.NewServeMux(),
Cache: sync.Map{},
Mutex: sync.RWMutex{},
Stakepools: StakepoolSet{
"Bravo": {
APIVersionsSupported: []interface{}{},
Netw... | 0 |
dc1a91c77dbdf1c8bd0d989ab6892365 | 33576c62f36a7ba7560fd8682a10e6b6 | Override to get subdirectory names of directory. If directory is null then root is assumed.
This method may be called by multiple threads | namespace MonoCross.Utilities.Storage
public abstract class BaseFile : IFile
public abstract string[] GetDirectoryNames(string directoryName); | 1 |
ae5ec5a2397ab2ece2c72a29ba7df028 | 9ecbfc24ac2348e748d55b189bea926c | 我的想法就是把每次利润记录下来,并找出最大的两个 | class Solution
public int maxProfit(int[] prices) {
int last = prices[0];
int sum = -last;
for(int i=1; i<prices.length; i++){
if(prices[i]<last){
sum+=last;
}else{
sum+=prices[i];
}
last = prices[i];
sum... | 0 |
c84520f522b0a0a98e9cb6534403f5c3 | a3dfa9aede237b925f33546a2fab4d64 | Loads the background and sets the starttime of this scene; | public class BackgroundController : MonoBehaviour
void Start ()
{
} | 0 |
d3d5e02f2d9418e4bcec5147dc288ca5 | bd404d60f1abc89925876fccd357f699 | GET: Referenciacaos | namespace bellyful_proj_v._0._2.Controllers
public class ReferrersController : Controller
public async Task<IActionResult> Index()
{
var applicationDbContext = _context.Referrer.Include(r => r.ReferringAsNavigation);
return View(await applicationDbContext.ToListAsync());
} | 1 |
570302fc64539d413d2c0a1759055ceb | e1dde39ff047277f9a4bb98b53a55e3b | get business details by business id | def get_business(bearer_token, business_id):
business_path = BUSINESS_PATH + business_id
r = request(API_HOST, business_path, bearer_token)
print(r)
return r | 1 |
dd3fdc1b352816e61faa50b6b940f1f7 | e8c10390bf3233404b4733cf2b1218f5 | Return a string with lending data separet by "," for backup to file | {
string s =
string.Join(",",
new string[] { Code, DetailLn1, DetailLn2, DetailLn3,
DetailLn4, DetailLn5, WeeklyRate, DailyRate });
return s;
} | 1 |
eed5f52ffd62db57e8574133b3a32c4c | 1adcc825f2ef529fe9cd966b48bcd7ca | Keeps the errors during the process. | namespace FdoToolbox.Core.ETL.Specialized
public class FdoBulkCopy : FdoSpecializedEtlProcess
public override IEnumerable<Exception> GetAllErrors()
{
foreach (string key in subProcessErrors.Keys)
{
foreach (Exception ex in subProcessErrors[key])
{
... | 1 |
336f1ee2061c7af01ac2440198f46f1f | c5945c96f819b7e6a66156ca43daf5b3 | Create spaces between snake case (underscores). | def to_spaces(to_replace):
return to_replace.replace('_', ' ') | 1 |
5073cb40f7cb74fd38340c02566b7940 | a378bd7a4f6a1f999169a22f466a7be0 | frees up all enemies and enemy pointers from the enemy group, then frees the group structire itself | void createEnemyGroup()
{
EnemyGroup enemyList = (EnemyGroup) malloc(sizeof(*enemyList));
getEnemyGroup(enemyList);
enemyList->enemyArray=malloc(sizeof(Enemy));
enemyList->numberOfEnemies = 0;
} | 0 |
8ca626c8f782e12fe3eb92754989cec8 | 6e5b69f07648a885e776e60846bb1959 | Gets the available of this FundsResponse.
The response if the amount was available true/false # noqa: E501 | class MarketAPI:
def get_available_balance(self):
pass | 0 |
62a9fae624dc1b2f38a30bdbec88c523 | 1c0bbadfa8d4615cacbc14849da2d492 | 通过速卖通接口,获取订单的纠纷详情 | $para = $this->sign(array(
'order_id'=>$order_id
)
);
$param_str = $this->createLinkstringUrlencode($para);
$resp = ihttp_get($this->host. $this->get_order_complain_category . '?' . $param_str);
return $this->handle_response($resp);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.