query_id
string
corpus_id
string
query
string
code
string
label
int64
fcb0436f5267d069f79715b775c67e57
cd93a5d876d8b9011bfbabf279d26ad3
Update list of scheduled actions
public int updateAction(String scheduleDate, String nextAction);
1
e8fd5e161717e8ed044073f063158a49
ea0c6b73669f9e3f9268c61827029051
입력값을 기반으로 국가 정보 검색 (영어 이름, 국가 코드, 국가 번호)
namespace web_ese.Models_Db public class EtsDbModels : DatabaseConnection public EtsLabelModels EtsLabelSetBase(EtsLabelModels model) { string lan = ""; string getCol = ""; switch (lan) { case "CN": getCol = "NATIONNAME_zh_CN"; break; case "EN": getCol = "NATIONNAME"; brea...
1
939c61f00d8ce4774ac08614c7058192
26bb47404731f5b38d0cf2a35152cbcc
SNMP task; used in conjunction with SNMP sockets API.
s8t snmp_handler(const u8t* const input, const u16t input_len, u8t* output, u16t* output_len, const u16t max_output_len) { message_t message; memset(&message, 0, sizeof(message_t)); s8t ret = ber_decode_request(input, input_len, &message); if (ret == -1) { free_message(&message); return...
1
453e1bd8d29d9489f5851094b8b19b08
8f70d0da6935196d97d0e87d963d4dca
Returns a numpy array with the pixels and another numpy array with the labels.
with open(imagefile, "rb") as f: magic, size = struct.unpack(">II", f.read(8)) nrows, ncols = struct.unpack(">II", f.read(8)) imgs = np.fromfile(f, dtype=np.dtype(np.uint8)).newbyteorder(">") imgs = imgs.reshape((size, nrows * ncols)) imgs = (imgs / 255).astype("float32") wit...
1
68c024a1829728a5d0269ad37da16836
bd1ef0298861aec62723c7d2b4b84ce2
为JMenuItem设定UI和对应的图标
public class MenuBuilder public static JMenuItem createMenuItem(JMenuItem item, String iconKey, String textKey, String mnemonicKey, String shortcutKey, String methodKey, ActionListener al, MenuListener ml) { if (iconKey != null) { Icon icon = UIManager.getIcon(iconKey); if (icon != null) { item.setIcon(...
1
fb79df11ed868104d4c0916112e7779d
9c16a1f33fed8f2f2fd8f0c664f56544
踢除盲注不够玩家
export default class M_PDKView extends cc.Component implements IPDKView public OnButtonTiren() { var state = this.skinPlayerControl.GetPlayerState(); var count = 0; for (var i = 0; i < state.length; i++) { if (state[i] == 1) count++; } if (count > 0) {...
0
21ed6929709427084cb99d84358c26cd
98fed9fe9aecf11c2ffcaf808c6d3f5e
获取指定用户所有车辆信息
namespace Asiasofti.SmartVehicle.Manager public class VehicleManager public Hashtable GetVehicleInfoByUser(string oid) { StringBuilder strSql = new StringBuilder(); strSql.Append(@"select top 1 * from yr_vehicles where USERID=@UserID order by CreateTime asc"); SqlParam pa...
0
9d876844f92b523ac9190d961eea18eb
0d2bf88a52e7496a4a0b398e585a87b2
页面判断是否显示按钮
function isShowBtn(){ editBtnShow = false; delBtnShow = false; perBtnShow = false; var btnList = getButtondefsByModule(); if(btnList == null || btnList.length == 0){ return; } for(var i=0;i<btnList.length;i++){ if(editBtnId == btnList[i].buttonid){ editBtnShow = true; }else if(delBtnId == btnList[i].but...
1
6fc95c1200a93f843a34373ab2c4875b
e5863ad68df392f43747347785731011
Adds new lines to the source code. The number of new lines to add can be specified.
if (line >= codeText.size()) { codeText.add(line, ""); } else { codeText.add(line + 1, ""); } newCodeReceived(); }
0
672fe13e6df78654151816e4c1901b58
1211314c51920a6248cce5aa3ef1fdc4
If user is not allowed to view PersonalOverview, redirect him to the repository root, otherwise behave like always.
class SalesModelView(sqla.ModelView): def _handle_view(self, name, **kwargs): if not self.is_accessible(): if current_user.is_authenticated: abort(403) else: return redirect(url_for('security.login', next=request.url))
0
f5414248badef538a9b2a644a88683d9
ac737b82b43d5d38ee2e84f36fcf6cc1
Given two usernames, find the chat with the correct participants ID.
$userIDone = mysqli_real_escape_string($this->db, $userIDone); $userIDTwo = mysqli_real_escape_string($this->db, $userIDTwo); if ($this->iN_CheckUserExist($userIDone) == 1 && $this->iN_CheckUserExist($userIDTwo) == 1) { $getID = mysqli_query($this->db, "SELECT chat_id FROM i_chat_users WHERE user_one = '$userI...
1
7c10281c33680a12a482aed0a70223ee
095d500f0841314f3cb637c43f84053f
Allows modules to add more mmenu themes.
function bedes_theme(&$existing, $type, $theme, $path) { $hooks = zen_theme($existing, $type, $theme, $path); return $hooks; }
0
dd77dbfb9d0375febcab86426a544b9d
aae4f46c041e11655bed3bda0a2c9295
GET /sasproducts GET /sasproducts.json
@search = Product.search(params[:search]) @products = @search.page(params[:page]) respond_to do |format| format.html format.xls end end
0
a0b3b49c91a55aed31514d6f67b98320
90f8d3594051565d65cf95d40938ef2e
Enforce encoded flag.
namespace Botan DER_Encoder& DER_Encoder::encode_if(bool cond, DER_Encoder& codec) { if(cond) return raw_bytes(codec.get_contents()); return (*this); }
0
ec56e608507b52b63e2403e972512bbd
d8a652f6b32a66489bda6b495c430213
Return the tree node for the specified check.
JavaScriptObject node = getNodeById(getOrCreateJsObj(), id); if (node == null) { return null; } else { return new TreeNode(node); } }
1
2230f7a2317e4c6aa7db29af882d27a6
6a0d21beefa2d6b2de686fbebdc7df66
Method untuk menyiapkan informasi status pemain baru
void CreateEmptyPlayer(PLAYER *P, Kata X) { PName(*P) = X; PHP(*P) = 100; MaxHP(*P) =100; PSTR(*P) = 100; PDEF(*P) = 100; PEXP(*P) = 0; PLevel(*P) = 1; Posisi(*P) = MakePOINT(-1,-1); CreateNewSkillTree(&PSkill(*P)); }
1
7038711bc37e5bc740f93de8476e06d3
a32689aa057947d9146438878db9cbc2
https://adventofcode.com/2018/day/2#part2
def part2(stdin: io.TextIOWrapper, stderr: io.TextIOWrapper) -> int: rules, messages = parse(stdin) rules[8] = [[42], [42, 8]] rules[11] = [[42, 31], [42, 11, 31]] stderr.write(f"{compile_rule(rules, 0)}\n") pattern = re.compile(compile_rule(rules, 0)) return len(list(filter( lambda mess...
1
bc85d0aa0b3ac5157f44e519c815c2d9
01e7c567e3126afb4033c0bd6d359a71
Implements a circular list data structure to serve as table You can visualize a four sided table with a player on each side This will allow for smooth gameplay rotations for betting and playing tricks where winner leads next trick
if players is None: self.players = [] else: self.players = list(players) self.current_player = None if self.players: self.next_player() self.order = order
0
9f13ea6a20780809e5f6a0cb4332e675
d5dab238d1c60a144e4331441a5d8bb3
Gets the absolute path of the calling context's file
class JNIExample private static String getCurrentAbsolutePath() { File directory = new File(""); return directory.getAbsolutePath(); }
1
d14c28d4b27e7a2c6fe9c7b5ce812e1e
b15a5a608ae56eb1ef6130a9c7abaa7f
Remove super set from the routine grid
{ TSet kRemoveTri; Triangle* pkTri; TSetIterator pkTIter = m_kTriangle.begin(); for (; pkTIter != m_kTriangle.end(); pkTIter++) { pkTri = *pkTIter; for (int j = 0; j < 3; j++) { int iV = pkTri->m_aiV[j]; if ( iV == m_aiSuperV[0] || iV == ...
1
dc74e23edd4a27adc409766dbb241f6b
0e85f6db96880be75fa3dace0ebee736
NavMeshAgentの速度を設定する
{ if(agent.isOnNavMesh) { if(!isPlayer) { if(agent.remainingDistance > agent.stoppingDistance) { animator.SetFloat("Speed", agent.velocity.magnitude); } ...
1
ad54fc1d4639d24fc7f357bc540e5fd4
b8b9de0c6d913450e9c7a2fd8a7a4f13
Crea un enlace sobre la categoría que se pasa como parámetro.
{ $category = Category::findOne($category_id); if($category != null) { $this->link('category', $category); return true; } }
1
816b1c6f1eaf58a13ef297243b4f3c73
e5443c33b26e5623cf4f0e3d9fd1f6c3
Divides the data into chunks for each view point pTrain, pValid and pTest: Determine, in percentage, how much of the raw data should be divided into train, validation and test
shuffle_inds = np.random.shuffle(np.arange(len(x))) shuff_x = x[shuffle_inds].reshape(x.shape) shuff_y = y[shuffle_inds].reshape(y.shape) xl = len(shuff_x) data_splits = [int(p[0] * xl), int(p[1] * xl), xl - int(p[0] * xl) - int(p[1] * xl)] x_training, x_val, x_test = torch.split(shuff_x, data_s...
1
ebe3da4680a85de968eba79c9da6591b
5873fc2fe8bd92f8226c34428930e7ca
command issued by player - to check word selected against dictionary
class Calculations(): # Class that runs the mechanics of the game. A slightly modified version of Piko_Fumi_algorithm.py def word_check(self): self.flag2 = True self.real = False while self.flag2: for iterate_2 in range (0,27): if self.split_word[0] == self.lett...
1
dbaa238597ea063ab6b3e74e6a96a188
12fb70f00a62cc85bc2c16c987a13286
resets the current Macro;
{ WISPFUN_DEBUG("c145_f6"); Clear(); ChangePointer(NULL); QFOR(obj, g_OptionsMacroManager.m_Items, CMacro *) Add(obj->GetCopy()); }
1
251ca0378f27eba9804ecf26dd65a461
3003a558ad66e85a8322dedd39b1200f
Returns the largest version spec we can think of to start narrowing down from.
class StabilityFlags protected function getExplicitStability($version) { $found = null; $pattern = $this->getPattern(); foreach (static::splitConstraints($version) as $constraint) { if ( ! preg_match($pattern, $constraint, $match)) { continue; } ...
0
f9a4587ca5a341af26ed575da9465b5f
0732473c6face50f203c0170f062dc56
Get the product inventory from file
{ InventoryFile jsonFile = null; ObjectMapper mapper = new ObjectMapper(); try { jsonFile = mapper.readValue(new File("../conf/inventory.json"), InventoryFile.class); } catch (JsonParseException e) { e.printStackTrace(); } catch (JsonMappingExcept...
1
42fd612913557b692c9742aa3508b2e2
a685660b6080137f80d9766465151544
Registra el usuario y clave, devuelve: 0 si se registro exitosamente 1 si el usuario ya existe 2 si hubo otro problema
String registraUtente(String nickaname, String password) throws RemoteException;
0
75b7955db47e61641b8ed2dda0ff0a45
88d9f05e6e6f37c202ffdbb9cd34919e
Whether the default language code should be removed from the matched url
class PageModel extends \Kate\Main\PageModel public function isDefaultLanguage() { $shortcut = $this->language['shortcut']; $location = $this->language['location']; $defaultLanguage = $this->getDefaultLanguage(); if ($shortcut == $defaultLanguage['shortcut'] && ($location == $defaultLanguage['location'] || ...
0
eb96d68d5c765898bd29fbf856c93239
270843ae88eeb45311e0d4340014270d
通过jdbc 连接来判断数据库是否可以正常访问
public class DBUtil public static boolean checkConnection(String driver, String url, String user, String password ){ boolean connected = false; Connection conn = null; String[] params = new String[4]; params[0] = driver; params[1] = url; params[2] = user; params[3] = password; DataSourceManager ds...
1
4ab60c2414908638a190ce6962e60890
c5a81998d6ea56af7c7225416f995a2c
Gera arquivo de saída com a árvore geradora
FileWriter arq = new FileWriter(nomeArquivo); PrintWriter gravarArq = new PrintWriter(arq); gravarArq.printf("digraph G {\n"); gravarArq.printf("node [shape=record, height=.1];\n"); gravarArq.printf("\tn" + raiz.hashCode() + " [label=\"<filho> RAIZ\"];\n"); trieNo pai = ...
1
be46177fb1e990e53d1f96a722fc4b06
c026539f156a8a2748e2d4ee90a0477b
3.22 添加蛇头 爬行经过的每个地方都会先变为蛇头,所以所经之处皆应加到列表蛇数据的头部
class Snake(object): #定义一个蛇类,用于定义蛇的各种参数 def move(self, new): self.body.insert(0, new) pop = self.body.pop() self.grid.draw(pop, self.grid.bg) self.grid.draw(new, self.color)
1
8ceffd866c81407cee53fa93ef1c3a48
4faf53064d7dff9a3fd6840f320e358a
Format the courses Course array into a JSON String
header("Content-type: application/json"); $springCourses = array(); $departments = array(); $courseID = 0; $xml = '../xml/courses.xml'; $dom = simplexml_load_file($xml); if ($dom === FALSE) die("Could not read $xml"); ...
1
f2d9f6e262ed3d8aa5b30327fd2cedbf
80990dfb0702ad23b17aab6713033ee5
Load Transactions File Action.
{ $currPage = (int) $this->getPayload()->getData()->get('currPage', 1); $model = $this->getPayload()->getData()->get('model'); $totalRecs = $model->fetchCount(); $paging = $this->calcPaging($currPage, $totalRecs); if (null !== $title) { $this->getPayload()->getDat...
0
500f2a09ca21f405208170716c36b39d
41f5032f09f9f5cb02392c29b5af504e
Ouverture d'une boite de dialogue lorsque l'on perd
musique->setMedia(QUrl("file:///" + QApplication::applicationDirPath() + "/ressources/death_sound.wav")); musique->play(); QMessageBox msg; msg.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint); msg.setWindowTitle("Defeat..."); msg.setText("You loose... Feel free to try again, next t...
1
5f9ccea1f9c594fc1a89608f8c3f74a0
16500c8698652e5969e53986f738f17c
Tax scheme. E.g. “VAT” or “GST”
public class Entity public void setTaxScheme(String taxScheme) { this.taxScheme = taxScheme; }
1
12b3ddc9975149c161bccf286b0581b7
66b26aa2d422cbeaca89a222aa8d97e9
removes a member from a Google Group
try { $result = $this->service->removeMemberFromGroup($user, $group_id); } catch (Zend_Gdata_Gapps_ServiceException $e) { $this->catchZendGdataGappsServiceException($e); } return $result; }
1
472a116fa0477a5bc4c2d8417d45fa17
aaba5b9a1b6c0801384007757d41652e
UnBinds a VBO.
public class Loader private void unbindVBO(int bufferType) { glBindBuffer(bufferType, 0); }
1
c61031f5ddb8e8422bb70d00c81cb3f9
dbc330e1a89ff14653f91777ecacd06b
Method to query database for username of pitch owner
try{ return db.getUserName(userID); } catch (SQLException ex){ ex.printStackTrace(); return null; } }
1
6b621960cf737a4d0de0b46a0f3e8e41
d2527e36b4b9d883efe38464956e2edf
This method makes a list of links associated with a device
public class HateosDevice<DEVICE extends com.toennies.ci1429.app.model.IDevice> implements IDeviceDescription, Identifiable<Integer> protected void addDeviceSpecificLinks(Collection<Link> links) { }
1
e03acfd73febb4f11185631e9296282d
13c3759ae0e1b41d1a2d25a2c24819c1
获取三张公共牌的信息
class Domain_PSZGame private function getTongHuaShun() { $val1 = rand(0,12); $val2 = $val1 == 12? 0: $val1 + 1; $val3 = $val2 == 12? 0: $val2 + 1; $arr = array($val1,$val2,$val3); shuffle($arr); $val1 = $arr[0]; $val2 = $arr[1]; $val3 = $arr[2]; $c...
1
701d2d26fdfad71d0a4655c1910dbc15
2d0faee8337508c2b4a603d17fe8ad3a
Outputs the animation as a SVG animation to the specified output file.
void createAnimOutput() throws IOException;
0
9b4fe77b458d5dfdef163169c40bc4ab
77dce449c83fb8c5583f7b492022da42
detail page should exists.
class DetailPageTestCase(TestCase): def test_detail_page_returns_200(self): response = self.client.get(reverse('store:detail', args=(self.flower.id, ))) self.assertEqual(response.status_code, 200)
1
f88199e82188667f8f97171341b8c3c5
80436b4f736644e4d3a5a4cfd55e8551
@brief Describe a table.
public function describeTable(?string $tableName = ''): ?array;
1
ffd9880f2e6a9c6bd0eab825d692ad19
a86217541b5605b93ae8397d911ea2c5
GeoSys - Funktion: Assemble local matrices and vectors to the global system 02/2005 WW
{ register int i, j; SZ *s; int myrank, nproc, ndim; int gdim, lproc, lloc; int start, end; s = sz_stack[sz_ptr]; myrank = s->rank; nproc = s->size; ndim = s->ndim; for(i=0;i<ndim;i++){ gdim = s->arrdim[i]; lproc = s->lsize[i]; lloc = s->lrank[i]; if( s->isstaggered[i] == AL_TRUE ){ ...
0
ea14efb60646e28014e80cd45d5881cb
9b539ab7f54f06ad80e3fa847c216251
If the file exists, then load it.
class Config def initialize(filename) super MultiJson.load(IO.read(filename)) if File.exists?(filename) end
1
d3b24b1fa584dfdf2a3965000e7d660e
c243cd49bfeac79070c7a1e9509d552b
Changes the currentAnimation of the object and sets the currentFrame to zero.
class Animation(object): # Construct a new Animation from the specified file path. If width and height are specified, the images in the # animation will all be scaled to width x height. def reset(self): self.currentFrame = 0 self.currentFrameTime = 0
0
62b348599d7555b9ca321e29a8469bcf
723b7dc1daf8957a3c9ad17ba9b9d9b3
<p>説明 : T_DEPテーブルにインサート</p>
public void depBlock(DepartmentInfo dpInfo);
0
74236214f53d6f7661414c662d416aed
5665099813d2b8f41e0282216fc8a745
Find existing stub and increase call counter.
def next_stub(operation_name) @stub_mutex.synchronize do stubs = @stubs[operation_name.to_sym] || [] case stubs.length when 0 raise NoStubFoundError, "No stub for #{operation_name} is not registered." when 1 then stubs.first else stubs.shift end end ...
0
c48bfe84382138a69aae3db4fd7f852f
c830b38cde0da02dc879d5e4f0ecd203
valid iff get_type() is TYPE_OBJECT
string MapObjectFactory::getObjectType(const ValueMap& info) const { return info.at("type").asString(); }
0
70cc821c4e829e2d7990e70a027340ec
692351e6210d3427d5c434534093d478
Method to resend data packets when they were dropped. This method is called in rel_timer().
void NoMac_send_timer (MobileNode *node) { switch(GetTxStatus(node)) { case MAC_SEND: NoMacRetransmitData(node); break; case MAC_ACK: Dot11FrameFree(node->nodeMac->pktRsp); node->nodeMac->pktRsp = NULL; ...
1
ab8f7a0a2617cd340f6c9dd7c9cb66a8
fefbad32229fc3eeae41d153b93c7b31
Reconhece e traduz um operador de não-igualdade
namespace LBC class Parser private void NotEquals() { tokenizer.Match('#'); Expression(); cpu.PopCompare(); cpu.SetNEqual(); }
1
5f7209b149e65ed3bd76de0f7249861e
9df0b3f51cbc450dce7174bb5f668266
Create daily sunpath curves.
def _example_daily_sm(): __, __, __, __, doy, _, ndaypy = _get_doy() SM_daily = 0.2 * np.sin(doy * ((np.pi * 2) / (ndaypy))) + 1.5 idx = slice(150, 200) SM_daily[idx] -= 0.4 * np.sin(np.arange(50) * ((np.pi * 2) / (50 * 2))) np.random.seed(123) SM_daily += (np.random.randn(ndaypy) * 0.01) re...
0
296707a678844c00be5024604a6b0789
c98ef9883dedb9a4449ba59c8407d388
https://www.hackerrank.com/challenges/tree-top-view/problem
int main() { Node * root = newNode(1); root->left = newNode(2); root->right = newNode(3); root->left->right = newNode(4); root->left->right->right = newNode(5); root->left->right->right->right = newNode(6); printTopView(root); Node * root1 = newNode(1); root1->left = newNode(2); ...
1
996a9e389f508fce8f7003d5b96dc4e1
fc96634853eeba29689f5774f2e25eec
Test that the @singleton decorator configures a class to exhibit the behaviour of a singleton class.
class RegistryTest def test_singleton_trick ActionMessenger::MessengerRegistry.shared_instance = nil assert_not_nil ActionMessenger::MessengerRegistry.config_file end
0
fb7f8dafa37aa0f6e543e7538a1138e2
d6584bcba57b69b485f4f266d1f7c448
Returns the request entity.
public HttpEntity<String> getHttpEntity();
1
57c9c2171f1a8e4dfa89aa14de64a9c0
955958d651ed9fa08e3fafa436852059
Show message after Booked
global total if 'booking' in tokens or 'reservations' in tokens: rep=("Goto www.ABChotels.com/booking.html\nTo check availability kindly type the date in dd 'month name' yyyy format.") l2.configure(text=rep) total=1
0
ecf47202f3e561dab9b5329ac212f6ab
f3031a81472c189063fe70cfb6ca196b
Checks the OtherName for family name prefixes and moves to the front of the family name.
def check_name_for_o1_o2(k_locus): if not (k_locus.name == 'O1/O2v1' or k_locus.name == 'O1/O2v2'): return other_gene_names = [x.qseqid for x in k_locus.other_hits_outside_locus] both_present = ('Extra_genes_wbbY/wbbZ_01_wbbY' in other_gene_names and 'Extra_genes_wbbY/wbbZ_02_wbb...
0
18d87d1ceed582bf616e851b167665a5
3f487f8dc7b9c6473b9968b264e7bee9
Gets the set of connection strings for a topic.
namespace C4rm4x.WebApi.Messaging.ServiceBus.Infrastructure public class TopicClientFactory public TopicClient Get(string path) { return TopicClient .CreateFromConnectionString(ConnectionString, path); }
0
20f8453bd39cbe97f0c5f3cb42285396
a2f921a5c710103534da60794584cbee
https://leetcode.com/problems/maximum-swap/solution/
ret = 0 mem = Trie() for dec in nums: n_xor = mem.insert(format(dec, '032b'), dec) ret = max(ret, (n_xor ^ dec)) return ret
0
4123d84d4ddf38c0a303b1a135f1e1b3
353290a70b3f055be6050574a09e08f0
Filter the query on the alternative_name column Example usage: <code> $query->filterByAlternativeName('fooValue'); // WHERE alternative_name = 'fooValue' $query->filterByAlternativeName('%fooValue%'); // WHERE alternative_name LIKE '%fooValue%' </code> Accepts wildcards (* and % trigger a LIKE)
abstract class BaseCountriesQuery extends ModelCriteria public function filterByName($name = null, $comparison = null) { if (null === $comparison) { if (is_array($name)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $name)) { $name = s...
0
91c167293d03521ad8905d4dff134605
c813119acf4b8dbf7221b85603c5eb21
=================== main function for bnb invoked by main This is a non-recursive branch-and-bound based on dfs - First, read the data file and construct the graph - Create a state for an arbitrary vertex and push into stack - If a valid tour is constructed check its cost and compare against best solution - Update the ...
struct stackNode* top = NULL; int depthLimit; int* currentPath; int currentPathLength, currentNode; int i, j; int flag = 0; struct algoSummary* summary; summary = (struct algoSummary*)malloc(sizeof(struct algoSummary)); summary -> visitedNodeCount = 0; while(1){ printf("E...
0
5036f8723d423c4def3b8bec3ac1ff6f
b66d55d9353d4ce8f0a2486f8b27bc7d
Test that the getColor method returns the appropriate color for each object.
color_params_list = [('red', ':255x0x0:'), ('garlic', 'rubbish'), ('blue', ':0x0x255:')] for an_input, expected_result in color_params_list: with self.subTest(msg="Checking to get_state_colour() for {} ".format(an_input)): result = color_setter.get_color_for(an_input) ...
1
8ba3887bc0dee085d60704fb67d09dfb
06a5674aa0567d859734153f19e47a6e
测试最大池化层前向传播
shape = (1, 512, 7, 7) x = relay.var("x", shape=shape) y = relay.nn.global_max_pool2d(x) func = relay.Function([x], y) mod = tvm.IRModule() mod["main"] = func verify_codegen(mod, dpu_target=dpu_target)
1
b4410eeec048c8fd1d3c399eb5dc8408
563e233278ec9ffbc305664454ba23cf
check the default connector is present, or build it.
{ if (this.uxConnectors.Items.Count > 0 && this.uxConnectors.SelectedItem == null) { this.uxConnectors.SelectedItem = this.uxConnectors.Items[0]; } }
0
9c352f0a0e70a1bcbd4f9403663db27f
02dff60dda97b69d2320fba6ea5b3d6f
检查字符串是否为空,若为空则返回默认值
namespace Orz.Common.Extensions public static class StringExtension public static string IfNullOrWhiteSpace(this string str, string defaultValue) { return string.IsNullOrWhiteSpace(str) ? defaultValue : str; }
1
1041da9053f54de7499dc64aeddbbdeb
6d2ddcf5f8fa658aa735135b936e163a
添加章节并绑定课程id
class CurrController extends CommonController public function chapterAdd(Request $request){ $teacherInfo = $this->teacherInfo(); if($teacherInfo['status']!=200){ return ['status'=>402,'msg'=>'请登录0']; } $teacher_id = $teacherInfo['data']['t_id']; $curr_id = $request->p...
1
d77ea30fe66f785d73dd5bfdaf00e85c
2b63436a1c739fafdd4edbfab1012018
Export a set of messages to a csv file.
namespace EVEMon.Common public sealed class EveMailMessageCollection : ReadonlyCollection<EveMailMessage> internal String Export() { return String.Join(",", Items.Where(x => x.SenderName != m_ccpCharacter.Name).OrderByDescending( x => x.MessageID).Select(message => message.Messag...
0
27eff8b693517c145ef168839ab846a2
fdd042e0129d70d618fe695f8b224f2e
Realiza la transtpuesta de una matriz dada. <b> pre: </b> la matriz de entrada no debe estar vacia.<br>
public class MatrixUtils public static double[][] T(double[][] mat) { double[][] matrix = new double[mat[0].length][mat.length]; for (int i = 0; i < mat.length; i++) { for (int j = 0; j < mat[0].length; j++) { matrix[j][i] = mat[i][j]; } } return matrix; }
1
1179deee32b215343cd994d777764e36
ba86482968ce255e013f0f5f381b9b6f
Installs required Python packages using pip.
print "installing python packages" with cd(env.project_root): with prefix(venv()): run("pip install -r requirements.txt")
1
57bb50b1fe2f29ba86967af472ac8414
b99fcb485bbd2e35bdd12332523b074c
Turn on or off the vacuum depending on read value
namespace MvAssistant.v0_3.Mac.Hal.CompPlc [Guid("843DEB1E-BF70-49A0-9D9D-CACCF3102548")] public class MacHalPlcBoxTransfer : MacHalPlcBase, IMacHalPlcBoxTransfer public bool ReadHandVacuum() { var plc = this.plcContext; return plc.Read<bool>(EnumMacHalPlcVariable.BT_TO_PC_Vacuum...
0
a6b6ba5d44a4ed0340d8c09d9a4d9066
a9f3462cc9edbf20f579fbcbc260b26e
Will return a standard colour scheme which can be used for e.g. specific truths or specific ice models etc.
class PreFlightMode(Frame) : def getColorPlane( self ) : return self.colour_plane
0
03f9d5fdaf9688d78ae47c807e42aa29
c3ed43f07a239195bb61da346ea56df2
Permite conocer la cantidad de pixeles blancos que contiene la segmentación de la hoja y de cuadrado de referencia
{ int num = 0; for (int i = 0; i < I.size().height; ++i) { for(int j = 0; j < I.size().width; ++j) { if( I.at<unsigned char>(i,j) == 255) num++; } } return num; }
1
3ed5223e4bec840bb36b434f5ca4aaae
2a019839d2a25d6560c357fb528bd867
Randomizes a wavetable
{ frequency = 440; phase = 0; waveTableSize = 1024; amplitude = 0.125; increment = frequency * waveTableSize / sampleRate; for (auto i = 0;i < waveTableSize;++i) { waveTable.insert(i, std::sin(2.0 * juce::MathConstants<double>::pi * i / waveTableSize)); } }
0
55b95e97ec48269264812f3ae4df1010
2589c555fbc0fc1ffb60c9865c1ccdf6
Like SerializationNeededForRead(), but called on writes. The logic is the same, but there is no snapshot and we can't be RO-safe.
Object convertForWriteIfNeeded(final CouchbasePersistentProperty source, final ConvertingPropertyAccessor<Object> accessor, boolean processValueConverter);
1
a63fcd29ddc331a20f77d5733a508472
d2e2ace2a7ab858f7aa5b562439333ad
Prevents from adding arguments to an checker when the invocation has already been done.
class BetterHelpGroup(click.Group): def invoke(self, ctx: click.Context): if any(arg in ctx.help_option_names for arg in ctx.args): self.callback = None return super().invoke(ctx)
0
33863637c5077de0ae1ceef2590b906e
f109ed2a876b83be9e4a4e53b02059bf
check that the length of song space matches the length of mock_data
clean_path = song_file_path+"_clean" shutil.copy2( song_file_path, clean_path ) clean = MP3( clean_path ) clean.delete() clean.save() clean_size = os.path.getsize( clean_path ) os.remove( clean_path ) return clean_size - expected_clean_size
0
dfb9b8e6f7dffcd3a40886f9539be4b7
51e10b79e1057e9e240b8b7ca4464730
取消版本检测的ProgressDialog
public abstract class LiveBaseActivity extends Activity implements OnClickListener public void cancelProgressDialog() { if ( !this.isFinishing() ) { if (progressDialog != null && progressDialog.isShowing() ) { progressDialog.cancel(); progressDialog = null; } } }
1
099fbd04b95cadb4155b2bfa5240728c
e466053b4c5bacf4d781758ba4d148e4
Загружает расширения.
{ try { foreach (var fileName in Constants.ExtensionsLibraries) { var extDll = Path.Combine(Constants.ExtensionsDirectory, fileName); if (File.Exists(extDll)) { Assembly.Lo...
1
b27c0a7cec38e80832a032b30ea79487
0d98a0f25e354fcf8b0259bd28c7e0a4
对数变换方法2
{ int m = a.GetLength(1) + 2; double[,] b = new double[a.GetLength(0), a.GetLength(1)]; for (int i = 0; i < a.GetLength(0); i++) { for (int j = 0; j < a.GetLength(1); j++) { b[i, j] = (Math.Log(m - a[i, j]) / Ma...
1
31af859c2b5c40f07447665bfbbab8ac
88bc67144d5e8a59a51e692b149ab485
ReadPacket creates a packet based on input and communication protocol set by splunkd.
pkt = packet.Packet(this_host, this_port, sender_name) try: command_words = user_input.strip().split(" ") command = command_words[0].lower() if command == "message": pkt.create_msg("public", " ".join(command_words[2:]), command_words[1]) elif command == "broadcast":...
0
f83d557a2bc9020a37e027533d58bc03
00a55dc6513a21e214d8676de4f67115
将入库表中的信息展示在TableView中
class Ui_MainWindow(object): def displayTable(self,train,info,data): self.model.clear() for row in range(train): for column in range(info): item = QStandardItem(data[row][column]) self.model.setItem(row,column,item) self.tableView.setModel(self.model)
1
cc954fe55d0174ae42aa2d6506d66972
3a9cfa89292d1c351538c0937a188d1d
Method to assign a user to be a child of another user. The purpose is to achive a hierachy structure of users
namespace eGradeBook.Controllers [RoutePrefix("api/parents")] [Authorize(Roles = "admins,teachers")] public class ParentsController : ApiController [Route("{parentId}/children")] [HttpPost] public IHttpActionResult AddStudentAsChild(int parentId, [FromUri]int studentId) { ...
1
01e614f0b6ea1664dfc0bf5a2cb08d70
a04cdd67d4ac8d1fd4019c98679ddccc
Return the number of nodes in the tree
public class WAVLTree public int size() { return size; }
1
ac6fa3204c667d92df911fc9890a1e82
5c36eebb0c6c57e2de490327be86df5a
Returns the measured values from the depth probes.
class PumpMonitor: def get_measurement(self): return self._convert_to_depth(self._avg_sample())
1
e304a29cdf1aee2ec9024ab29c311acc
b5b0f21bcaed9677cf6aaf6e9c3a5a34
Returns the current `SDL_Renderer`, can be used to wrap it up in a `Canvas`
SDL_Renderer *SDLGraphicsProgram::getSDLRenderer() { return gRenderer; }
1
48f3f7a23075a9e6baacc67bb46cd7d0
f15e8ce23354bcc003d9b24142e0acda
Returns true if traffic light is green
class TrafficLight(Sign): def isRed(self): return self.redLight
0
a3acecf805c1817bc8fcff8c6248464e
ec11ce9619668c9383a3112ba10ac950
Запуск внутренней перелинковки статей
{ if (PKWK_READONLY) return; if (ini_get('safe_mode') == '0') set_time_limit(0); $time = is_page($page, TRUE) ? get_filetime($page) : 0; $rel_old = array(); $rel_file = CACHE_DIR . encode($page) . '.rel'; $rel_file_exist = file_exists($rel_file); if ($rel_file_exist === TRUE) { $lines = file($rel...
1
e03b597545fc6fa1dd60ac14acd10144
20f88a4025f6328b627dd61641411d5d
Create and then delete a keyring entry for pre-shared key.
class TestCsrRestPreSharedKeyCreate(base.BaseTestCase): def test_create_delete_pre_shared_key(self): with httmock.HTTMock(csr_request.token, csr_request.post, csr_request.normal_get): psk_id = '5' psk_info = {u'keyring-name': u'%s...
1
07b1778478d330ec196172b62b75e214
362bbec854b67185cfa4740974f02b65
Set metadata. Set document meta data. The meta data types are identified by a list of keys, common to PDF, like: title, author, subject, created, modified. The values are passed like embedded in the docbook document and might need to be reformatted.
app, doctree ): metadata = {} env = app.env if hasattr(doctree, 'findall'): findall = doctree.findall else: findall = doctree.traverse assert False for node in findall(nodes.meta): if not node.hasattr('name'): continue name = nod...
1
e419dbc7651c93927c530f994a94501c
27217e31ffbc153f0250229c0f103f43
插入GIF图片
{ if(string.IsNullOrEmpty(gifPath)) { Debug.LogWarning("Gif path is null or empty!"); return; } if(playerImage.GetComponent<ProGifPlayerComponent>() != null) { playerImage.GetComponent<ProGifPlayerComponent>().Clear(); } ProGifPlayer newGifPlayer = new ProGifPlayer(); if(m_GifPlayerDict.Contai...
1
b1ccb7f851673e419e6b5233b7863898
7811934090e6d3438b230b646ba4918e
通过预警级别查询嫌疑人信息
public List<Suspect> findSuspectsByWarningLevel(@Param(value = "warningLevel") int warningLevel);
1
c0d5e452dda8425b006035b119dd888d
b3a95abc628ac391bc75da405805843f
Returns the issue type of the requested issue
public class ComputeIcd11Map2 class WhoMap public String getIssueType() { return issueType; }
1
d641085dc5a18fbeec425ca1146abf1f
025952abb78168b3e9f745de82e7b608
Devuelve el codigo del CRC al cual esta asignada la tarjeta
public class Moto public int ObtenerCc(){ return cc; }
0
2f6beb67d7f2aa4be6963e2ad6d1806e
0847c5895abf4a742cb4e73b441a0a39
Compute bootstrapped means.
def draw_bs_reps_mean(data, size): out = np.empty(size) for i in range(size): out[i] = np.mean(draw_bs_sample(data)) return out
1
61ca7b051681fcb068d46dfbb99316ec
9b2278098b499cae902838d6cffb6300
Get current percentage complete of current phase
byte getPercentageComplete();
1
e0c963dc471d139e5e1c590ede8b5f99
fdbf45f21b8ce1a232043cd841bffde1
根据vod_id修改video_selected表数据
private function _editVideoSelectedVod( $vod_id, $data ){ $video_selected_where['vod_id'] = $vod_id; $video_data = self::_filterVideoDataTraitFun( $data, 'doubanScoreCopy', true ); $save_video_selected = Db::name('video_selected')->where($video_selected_where)->update($video_data); if ($...
1
276e958bd829dedbc51eb015d908e5e0
bf90d832a133c19144f54b2e979e60da
根据【类别代码】查询资讯信息 (单条)
@Controller public class NewsCategoryController extends BaseController @RequestMapping public ModelAndView queryCategoryByCode(HttpServletRequest request, Map<String, Object> out, String code){ NewsCategory newsCategory = newsCategoryService.queryNewsCategoryByCode(code); List<NewsCategory> list=new ArrayList<News...
1
83c4d52701b7dd441bc2a936438a2678
2e32a70e1ad54a47ed691d92b937744a
Make a CID System Info object.
class FreeText(Annotation): def make_cid_system_info_object(): return IndirectPdfDict( Registry=PdfString('(Adobe)'), Ordering=PdfString('(UCS)'), Supplement=0 )
1
cf04ca48924ed0997f1af8da92c0b0d7
cac73cc0054661874fb68bbfd670afac
This callback is called continuous if no joy-node-publisher-connection is available any more. If connection is lost, it is called after 'manager_break_once_cb()'. It can be used to set the system, robot, or whatever to a defined state.
namespace abb namespace joint_trajectory_action void JointTrajectoryActionAbstract::robotStatusCB(const industrial_msgs::RobotStatusConstPtr &msg) { last_robot_status_ = msg; }
0