query_id
string
corpus_id
string
query
string
code
string
label
int64
b81e23c34923fa3466ebc49cb3aad3ae
03bba0c1cb585c69bc2645ed69b34900
LastModified为null时,忽略序列化该对象
public class JacksonUtils public static String toString(Object obj) throws JsonProcessingException { ObjectMapper mapper = getObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); return mapper.writeValueAsString(obj); }
1
1f34f1e56a5bd5a1916997fb956f232c
55d0dbc4e82f5c6f2e894b52e745129f
This function takes in the Teaching Point Number of the lesson and return the corresponding Resource IDs.
[AuthOperation] [WebInvoke( Method = "GET", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/getmyresourceids" )] TableItem[] GetM...
0
0b91eb6f5455311fa5a06b130229dd32
e9ff653fc84e1204f9b9d86d0870a2b3
Internal method to provide ipv6 regex.
def _wrap_ipv6(ip): if netutils.is_valid_ipv6(ip): return "[%s]" % ip return ip
0
f1d4fb41c0c7e22cfcf620e151f517fd
9dab2293b4739a30566bb3799abec13e
Cette fonction me permet la création d'ID pour chaque utilisateur contenue dans le fichier csv PRE:- POST:le fichier utilisateur.csv à été modifier en ajoutant un ID à chaque utilisateurs
int set_newid(){ int res=0; char uid[15]; FILE *file; char *fname = "/home/user/project_t/us.txt"; file = fopen(fname,"r"); bzero(uid,sizeof(uid)); if(file == NULL) { perror("ERROR on openning file with users"); exit(1); } int i = 0; while(fsca...
0
b4a5d16142ef60f2915022307510b2b8
c2cc711d089e78d8ae40c400282482c2
@brief Read from Extended Address Register, which indicates the current segment.
{ #ifndef MV_HWS_REDUCED_BUILD if (!aapl_check_process(aapl, sbus_addr, __func__, __LINE__, TRUE, 3, AVAGO_PROCESS_B, AVAGO_PROCESS_F, AVAGO_PROCESS_A)) return -1; #endif if( aapl_check_ip_type(aapl, sbus_addr, __func__,__LINE__,FALSE,2,AVAGO_SERDES, AVAGO_M4) ) { if( aapl_get_process_id(aapl, sbus_...
1
73b784fa0fa061959149eb027c9b7aba
62910ea03b4dfc12a78d45c614db9839
Scalar-Vector Multiplication
{ Vector2F vecOut; vecOut.Zero(); for(int i = 0; i < ROWS; i++) { for(int j = 0; j < COLS; j++) { vecOut[i] += data[i][j]*vecIn[j]; } } return vecOut; }
0
9dc63dd3368739a1ad8584f34ee47346
fda64d5bfd46901c02e9c74294dfbd3b
批量恢复User
void batchSaveUser();
0
5f2e9a392aa0f533ced49d5e16634877
c476b81ad0475b7965be909a28b196df
Draws a line that connects the winning squares
for (auto board_spot : game_board.getWinningSequence()) { ofSetColor(255, 255, 0); ofDrawRectangle(game_grid[board_spot.row][board_spot.column]); } }
0
1fc2e7aad43c868b73a8a5b3f4a96706
3781d03ac0bea612b3fa591896466d08
Advances to the next document in the set and returns the doc it is currently on, or <see cref="NO_MORE_DOCS" /> if there are no more docs in the set.<br/> <b>NOTE:</b> after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.
public InputDoc nextDoc();
1
51d9c465fd641a00fd9d8a3aedfb54d3
bd5ec4d8add2b4f3d050edb1b3ed4563
translate OpenCv coordinate to Web coordinates It seems the origin of open cv is top left, while the origin of the browser is in the middle. This function translate the coordinates relevant to the given element.
class BilBil(object): def get_location(self, element): location = element.location size = element.size height = size['height'] width = size['width'] left = location['x'] top = location['y'] right = left + width bottom = top + height script = f"retu...
0
2626ebf35c5efba01464e4b798c6a72f
951d5db82aeef7c25a24a4c114c2bbe6
Retrieves all the visual descendants of a dependency object with the specified type.
public static IEnumerable<T> GetDescendantsOfType<T>(this DependencyObject element) where T : DependencyObject { return element.GetVisualDescendants().OfType<T>(); }
1
76e125b428b1f6c90d1744e771e26616
42e65a24b9165f4d0e2aa9d689ff2851
Greedy_BLAST: greedy, no preemption
disk = 3*seqFileID.size memory = 3*seqFileID.size super(RunSelfBlast, self).__init__(memory=memory, disk=disk, preemptable=True) self.blastOptions = blastOptions self.seqFileID = seqFileID
0
d29383d1da83daad23801c986cc0475b
bf0f690493238e6321855eef5773efcd
@brief Determines whether the arm has returned to its "Home" state. Checks the current joint angles, then compares them to the known "Home" joint angles.
bool ArmIn::IsFinished() { return false; }
0
958228abd721db37e82373441e30c37b
6a19383e90506bbc3fecf32388c23f7a
# Extract the properties from a value requirement string
class Requirements public static function get_requirement( $requirement_reference, $default = null ) { return array_traverse( self::get_requirements(), array_build_traversable_path( $requirement_reference ), $default ); }
0
551aa31b0016e62c31de51b06dcaad13
e3fb4bf2e687f6110a2dd933b84ca379
Permet de savoir si un patron d'expression régulière est valide.
class Regular public static function isLegal($pattern) { return false !== @preg_match($pattern, null); }
1
822e2a3c289c4e64606249d2bdf75f2d
c995f2c5c42a3b1070e352defaa3003b
Returns a new object of class '<em>ECL Unicode</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getEclTask();
0
7c9856469729bb84068a32a19dfe3fa8
d1e5e2ad1fb629fe31364f1c5be48f03
**Write a Python function that checks whether a passed in string is palindrome or not.**
def checkPallindrome(s): if s == s[::-1]: return True else: return False
1
f99e6879fab1fc22cd0e8e09cb8ad953
7a35cde934235159c3a2879d7fd772cf
Страница рецепта.
class WebRecipeController extends Controller public function show($id) { $recipe = $this->recipe->get($id); $statistics = $this->recipe->getStatistics(); $services = $this->service->index(); $events = $this->event->index(); $blogs = $this->blog->index(); $products = $...
1
bbfab273be5be6c6ddca4d57823f6d0c
963718d9b7360631c080ad1b42b78301
Generic routine to insert a record in a table and return the auto-assigned unique id. This uses a field list, a list of corresponding values in the same order (value[1] is for field[1]), and the name of the field that will contain the returning id. This field name must be in the field list.
$default = $this->defaultValue; $idfield = $this->getIDField($table, true); $suffix = $this->getInsertSuffix($table); $table = $this->safeTable($table); if (count($insertvalues)>0 && is_array($insertvalues[0]) && count($insertvalues[0])>0) { foreach($insertcolumns as $k=>$v) { $insertcolumns[$k] = $thi...
1
046ccfa25f32ad967da176b6d79b474b
e10c29ee016a0193dbfe729a27f5934f
如果该用户不存在头像,则直接用一个默认头像来替代
function getAvatar($user_id) { global $wechat; $avatar_file = ROOT_PATH . 'uploads/avatar/avatar_'.$user_id.'.jpg'; if(is_readable($avatar_file) == false) { $sql='SELECT headimgurl FROM ' . $GLOBALS['aos']->table('users')." WHERE user_id = $user_id "; $headimgurl = $GLOBALS['db']->getOne($s...
0
a800edc6e1f1e7d732d7d915de13493b
bc99612aa15fdfd7021bd22942481f96
Returns the user's ORCID.
def orcid(orcid: str, limit: int = -1, fields: t.List[str] = None, dbg: bool = False): return search(query=f"orcid:{orcid}", fields=fields)
0
04cbd23d1ad1ec10b8b1c4dda2a94256
f2dd83ae736cae21bf572da8d8186b7c
Check the block can be put in the specified location.
int h,v; toHV(loc.x,loc.y, out h, out v ); return h<0 || size.x<=h || v<loc.z*2 || size.y-(size.z-loc.z)*2<=v; }
1
8e176e9923154069196aee02743b20b8
0f26b1ce5992bd2010e0647f45fac8c1
Last refresh time of the DPMContainer.
Date getRefreshTime();
1
11987570d80d18f26c225f74aca03f56
25ebdf649dc453feafd3a3bf4a3b443a
Método de busca do arquivo de configurações da API
namespace MRSystem.classes class Arquivo public bool ArquivoConfig(string strCaminho) { bool bResultado = false; DataSet ds = new DataSet(); DataTable tb = new DataTable(); try { ds.ReadXml(strCaminho); tb = ds.Table...
1
138f781a7126e55ac9716c7187536d9e
1e176e5294026e5b062590ba4c34737b
Get the mime type of an image
if ( $type == IMAGETYPE_JPEG ) { return 'jpg'; } else if ( $type == IMAGETYPE_GIF ) { return 'gif'; } else if ( $type == IMAGETYPE_PNG ) { return 'png'; } else { return 'none'; } }
0
61a38d44e31545230ab2d9d90baabf4e
7f927147c9d6635c7518cc3828e58213
Advance the virtual time by the appropriate amount: - Operations that modify the program counter need 2Tcy, according to the PIC16C84 manual. - All other operations only need one instruction cycle.
{ var cycles = 0; var originalProgramCounter = ProgramCounter; if (!IsHalted) { fetch[0] = Memory.Read(ProgramCounter++); var operation = GetOperation(fetch[0]); if (operation.Opcode.Length > 1) { ...
0
8827b8b75875d8fa5650030a8eb60405
574ad43bce8a5f37891155a7224e01e9
API for building the movie-movie similarity model using the dot product
print(x) print(y) tiled_X = tf.tile(tf.expand_dims(x, [1]), multiples = [1, tf.shape(y)[0], 1]) tiled_Y = tf.tile(tf.expand_dims(y, [0]), multiples = [tf.shape(x)[0], 1, 1]) cosine_Similarity = tf.reduce_sum(tiled_Y * tiled_X, axis = 2) / (tf.sqrt(tf.reduce_sum(tf.pow(tiled_Y, 2), axis = 2)) *...
1
513af200c360f785347853a519433274
bf140aa85fc71b79669b9244c7af1845
Average number of participants
function average_number_of_participants() { global $DB, $SITE; $sql = 'SELECT COUNT(*) FROM ( SELECT DISTINCT ue.userid, e.courseid FROM {user_enrolments} ue, {enrol} e, {course} c WHERE ue.enrolid = e.id AND e.courseid <> :siteid AND c.id = e.courseid ...
1
3f095f49e2a12c481fe06e293ff838b5
7a608d1416952b516550d97ba2ff848e
获取临时素材的url
class wxUpload extends wxBase public function uploadTempMaterial($path, $type) { $url = 'https://api.weixin.qq.com/cgi-bin/media/upload?access_token=' . $this->getAccessToken() . '&type=' . $type; $data = array('media' => '@' . $path); $result = $this->curl_post($url, $data); $data = json_decode($result, true);...
0
8f48e533f61b529beb25500484f01aa1
de7bdf74f01747f78a957e95ac8a2aea
Gets the average value of the jitter reported in RTCP packets, in RTP timestamp units.
class RTPstat implements ModelInterface public function getLocalMinjitter(): ?float { return $this->localMinjitter; }
0
af98337850b1cc73bd0786b8eda74b32
581f8d78aa6edf4c3a9e7522b4d16fdc
Set averaging time in ms.
{ if (this->average_time == NULL) { this->average_time = new UdmDfiValue<float>(UDM_DFI_AVERAGETIME, value); } else { this->average_time->setValue(value); } }
1
9677e2bbe945785b4b32f2d15724f1f8
7c9e55d651f0da38c5068e1f723129a9
Crea un plantilla para las operaciones con Redis utilizando una factoría de conexiones.
{ $config = $container->get('config-cache'); $connectionParameters = $config['connection-parameters']; $clientOptions = $config['client-options'] ?? []; return new PredisCachePool(new Client($connectionParameters, $clientOptions)); }
0
6226012fe738c258dd745461ee5b45af
fead9b9757dc07e55bdb0235be2fe501
Set the (32/64) bitness we are going to use.
class Generator(object): def MacroAssemblerSetISA(self): if self.test_isa == "t32": return "masm.UseT32();" else: return "masm.UseA32();"
1
5fac85382c08fd288f523e9aeb679372
c0e5c129ec698f964fc6370cf7afa022
Hàm lấy danh sách loại tin Active
class CategoryRepository public function getActiveCategoryList() { $q = \DB::select("SELECT * FROM ta_categories WHERE status = 1"); return $q; }
1
6344e5af586a4c3fc197d7434a4c2bb9
50d2318de01afb1c6fbe4ef7cc6e57bb
A Talkbox Talk 'may' have been completed by multiple users - return list separated by comma return string
result = self.has_voted_users_today() result = [x.real_name for x in result] return "、".join(result)
1
e55c72ffea05f0f95799097c1baad1f4
fd7247b23f3d7c6d24e5888964bb648c
从本地取主题颜色,修复loading页闪烁问题
const colorScheme = theme; this.setState({ colorScheme, }); AsyncStorage.setItem('colorScheme', colorScheme); this.context.getData(); }
0
65216c74f6f81b012c9144e46097f0e9
0625ce4f58e86df45f448d3bcf8a7d49
Returns square id by a lat/lon location
public int getSiteId(double lat,double lon);
0
cd115c8927a8181a35f853fabf41811f
cbb39eb8f2436f1012d00f54bff99196
{@code PUT /yegan-codes} : Updates an existing yeganCode. or with status {@code 400 (Bad Request)} if the yeganCode is not valid, or with status {@code 500 (Internal Server Error)} if the yeganCode couldn't be updated.
public GoResponse update(final String category, final String code, final String value);
1
e948ada769fb0dc008d0a1fe9a6cef7f
1414df5190008eb52d2feb0729b96c8c
Generates a random number to determine whether Animal is rested or not
int chance = getRandom(100, 0); if(chance < 30){ return 0; }else{ return 1; } }
1
1b01b3d586b3c756e6d32b3e9e741c1f
fb4d625995cc987df8ffa86d61ff6bb6
NewAlibabaScbpProductListRequest 初始化AlibabaScbpProductListAPIRequest对象
func NewAlibabaAlihealthDrugcodeScanRequest() *AlibabaAlihealthDrugcodeScanAPIRequest { return &AlibabaAlihealthDrugcodeScanAPIRequest{ Params: model.NewParams(), } }
0
e1a729909d5bafbff667496069d4a677
1705c3c5a425304ebfd3effab6807d25
Осветляет цвет фона цветного символа в буфере.Если фоновый цвет уже светлый или нет светлой версии, он остается неизменным
{ Color color2 = ColorBrightnessClamp(buffColor, lightColor); return ColorClamp(Colorize(buffColor, lightColor), color2); }
1
c2471ea980cc7f5077e1bd772480c86b
0a23569666f8edffa2b2b92a2232d6b9
这个方法通过传入的RequestCode和ActionCode来找到对应的Controller里面对应的方法然后调用,data是要处理的数据,后面两个参数是持有一下Client和Server的引用,以便于比如广播消息给其他客户端之类的事件的响应
namespace XianXiaJianServer.Server class MainServer public void HandleRequest(RequestCode requestCode, ActionCode actionCode, string data, ClientPeer client) { controllerManager.HandleRequest(requestCode, actionCode, data, client); }
1
b93519a07a47e0b88c0ac49da0073c54
1b3bbfaba55ab36c1a62b43f6a161755
Returns Params for the development dataset.
fixed_params = { "total_time_steps": 6 + 6, "num_encoder_steps": 6, "num_epochs": 100, "early_stopping_patience": 10, "multiprocessing_workers": 5, } return fixed_params
0
46fb613ddfbaac000da822e5e451cbbc
bc5d8a84e2ade7f461deb779785f1c18
выбор цвета текста
def all_text_color(): my_color = colorchooser.askcolor()[1] if my_color: my_text.configure(fg=my_color)
1
93885a310ce1e3a5b2bc035dad31efb7
0bd314a59379590e4fffae3c30ac4adb
Returns the total jumps that the fish has completed
public class NavigationalAide public int fishLength() { return length; }
0
dcd2a934c95abd8cb87b0f4166a8370b
3aee257756890aa4faf751be02a8873d
Erstellt die Ableitung der Funktion
assert(tree->this.func == '*'); node->left = calloc(1, sizeof(struct Tree)); node->right = calloc(1, sizeof(struct Tree)); set_func(node, '+'); set_func(node->left, '*'); set_func(node->right, '*'); node->left->left = derivative(tree->left); node->left->right = copy_tree(tree->right); ...
1
64d4d74bc5b92756976dcae6ec95bf54
4fc4c6af6e74a148054a9817d82022c6
convert the sdpa form into the form that can be used by scs (splitting conic solver)
register int i; register int j; for( i = 1; i <= d.m; ++i){ sp.coefpi[i-1] = -1.0*mp._z[i-1]; } sp.spof.setLinearCoefs(sp.pi, sp.coefpi); for( j = 1; j <= d.n; ++j){ sp.constraintsBigM[j-1].setLinearCoef(sp.g[j-1],-1.0 * spM.BigM[j-1]); ...
0
c51016373fed7a8196b1d192eebb78db
a1e43992cab51c17cadf4bc39be14a75
Insert or replace item.
class CouchbaseBucket public function upsert($ids, $val = NULL, $options = array()) { return $this->_endure($ids, $options, $this->me->upsert($ids, $val, $options)); }
1
f1f8fc6d44a66f280b14cf3a92d2be84
a529a157ce1510e6f3bbb2d2e0c0becf
Instantiate the promotion service on the basis of promotion type
switch (type) { case "FQueue": return new FQueueService(); default: return new FQueueService(); } }
0
a07d1d80277f9d5997a6589b4338b747
aa420551d1e8d4a577afe57012dfa5d4
弹幕屏蔽
def barrage(): if request.method == 'GET': id = request.args.get('id') key = 'movie' + str(id) if rds.llen(key): msgs = rds.lrange(key, 0, 2999) res = { 'code': 0, 'data': [json.loads(v) for v in msgs] } else: ...
0
75585a6c381c64f1005fa5d333c5090e
bc72a62455ff3bd14d8e089d7ac6db22
This method allows the rotor's position to be manually set to a specific value. If using the machine "per procedure", this should only be used when setting up the machine's initial configuration, prior to encrypting or decrypting, and should not be used again until the process is complete
class RotaryEncoder(object): def setPosition(self, val): position_file = "%s/position" % self.base_dir self._logger.warning( "setPosition(): TODO: not implemented, write position to {}".format( position_file))
1
37ff748fa2ccd8a56ee864acf06dcab9
43f2d5c0ec7b6f3d9b04bb6bff258d2e
Create a new deployment within the provider's API.
namespace Cake.AWS.CodeDeploy [CakeAliasCategory("AWS")] [CakeNamespaceImport("Amazon")] [CakeNamespaceImport("Amazon.CodeDeploy")] public static class CodeDeployAliases [CakeMethodAlias] [CakeAliasCategory("EC2")] public static async Task<bool> CreateDeployment(this ICakeContext context...
1
1632b831742073b4f905d1826091dc26
18f57abeaa7ab4e953245b16b198c2f5
do the next characters start with the given string?
def is_character_start_of_string(i, char, str): return i == 0 and char == str[0]
0
fc213c6349db4d1114d40f3fe3299880
d79e1d3ea0ff6f606b44b7239dfa46c0
查询到达ID
public class ArrivalDao extends iBatis3DaoImpl implements IArrivalDao @Override public TruckArrivalEntity queryTruckArrivedInfo(String arrivedId) { return (TruckArrivalEntity) this.getSqlSession().selectOne(NAMESPACE+"queryTruckArrvieInfo",arrivedId); }
1
7bf8ece64f3baea2344d0b1dc7aa6dc1
b081def90aa8372cc2a21242b6e16e26
Move bounding box (and Entity) to (x, y)
class BoundingBox : def move(self, dx, dy): self._x=self._x+dx self._y=self._y+dy
0
bca90f6737b30fbd8e3b5b65cab3e26e
66f023369388bdff215b9f734ee07074
Change the location of the turbines
WindDirDeg = 270. - WindDirDeg if WindDirDeg < 0.: WindDirDeg += 360. WindDirRad = np.pi*WindDirDeg/180.0 turbineXw = turbineX*np.cos(-WindDirRad)-turbineY*np.sin(-WindDirRad) turbineYw = turbineX*np.sin(-WindDirRad)+turbineY*np.cos(-WindDirRad) return turbineXw, turbineYw
1
eea20406c40bb74e1e042553ec07ba84
07ab3df7ebf0b89dde10eb367af6146f
室内地图的翻页
void UiVIP::pageViewEvent(Ref *pSender, PageView::EventType type ) { switch (type) { case PageView::EventType::TURNING: { PageView* pageView = dynamic_cast<PageView*>(pSender); size_t i=pageView->getCurPageIndex()+1; string strPage=" "+to_string(i-1)+" "...
1
c6b99c2234582401e0cf916bbf2061d7
1e6c799c14079bd121799e3863ee4937
Print a character n times
void print_n_times(char c, int n) { for(int i = 0; i < n; i++) { printf("%c", c); } }
1
b710f39546947e1c7d786972aeae8b1a
7d648d40e57974dfde38bb8e0e7b283c
Read all bookings for an event
val ref = fDatabase.reference.child("bookings").orderByChild("date") ref.addListenerForSingleValueEvent(object: ValueEventListener { val bookingList = mutableListOf<Bookings>() val bookingMap = mutableMapOf<Bookings,String>() override fun onDataChange(snapshot: DataSn...
0
2ba733b818e41bc46ecdc1578497c2f8
94e92f40b0bec8a8ca98a41ee059e404
we ignore our own selections
void LVDocView::selectRange(const ldomXRange & range) { ldomXRangeList & sel = getDocument()->getSelections(); if (sel.length() == 1) { if (range == *sel[0]) return; } sel.clear(); sel.add(new ldomXRange(range)); updateSelections(); }
1
d8833e0b17d37825862d49474f35ac1c
e44dcba16d8747c0bc4509350c8c663e
Calls a method of the same name in the BetInfo object held via composition. This simply adds the String showing the type of hand held in the Bet's cards.
{ if (Bettor.MyBet.Amount == 0) { return Bettor.Name + " nie zawarł zakładu."; } else { return Bettor.Name + " postawił " + Bettor.MyBet.Amount + " na psa numer " + Bettor.MyBet.Dog + "."; } }
0
b64adc688f83cca0bb1ef629c7d9715b
c6b461b17a1d6b60876433065df39019
Same behaviour as call of method <code>notifyInsertionFailure(null, String)</code>.
@Entity public final class TransientSite extends Site public boolean persistInsert() throws EntityExistsException { throw new UnsupportedOperationException(); }
0
eae0a4744021babb0473a2bc6a5a3b2c
c495782dd9b0e910058d89105a54b3c9
ゲームの開始など、フェードインが完了した時に処理したい処理を実行します。
public class HUDController : MonoBehaviour public void OnFadeInComplete() { if (postFadeEvent != null) { postFadeEvent(); } }
1
cfb025a27534116ffbb29cebae4d1ac7
a5ea1557292b6eb8840934fc7f71add0
Creates a volume of specified size and export it as iscsi target.
class ICinderVolumeManager(Interface): def create(size, metadata=None, display_name=None):
0
3c75f5495cce0cb0cf5f329010afe7db
2dcf17d4933b9dd44abc7053610604a3
停止邮件队列管理器
namespace TableTap.BackGroundWorker.Classes public class EmailQueuing public static void stopEmail() { RecurringJob.RemoveIfExists("01"); }
1
ab2134e4a98f91057098a6f251dfa71a
481e298537aed615f14eda70884612ee
Returns the meta object for the attribute '{@link SAR.AttributeCondition#getOperator <em>Operator</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EAttribute getAttributeCondition_Operator();
1
f6706e636a4db3b50157a0b311060ba8
3d236f97ff2659147d011bf7ba8ac107
Returns true if PageElement is currently checked. Overwriting this function affects the behavior of the function `isChecked` in PageElement and its `currently`, `wait` and `eventually` APIs.
public abstract class ElementInteraction public abstract boolean isChecked(WebElement element);
1
d54e33f30dc9507c9e90516962e0c876
9c5bd7e9d8dea27d46756aec969e2239
Use this context manager to temporarily define your own replies and go back to defaulting outside the context Usage:
class SleepbotClient(discord.Client): def set_response_manager(self, rm: ResponseManager) -> None: self.response_manager = rm
0
5043310eaf1833943e90303e6bbfd452
dcbb4aeb432b0ddc8895efc4a2f7abbf
facebook回调
class CommonController extends Controller{ public function callback($type = null, $code = null) { header("Content-type: text/html; charset=utf-8"); (empty($type) || empty($code)) && $this->error('参数错误'); import('Org.ThinkSDK.ThinkOauth'); $sns = ThinkOauth::getInstance($type); $e...
0
e6c8d7b9bc694be595a8781a6f4ac750
b3acb28f0334f6766efdf4c15ad3ae11
测试将一个数组变为一个堆
internal class Test @Test fun heapSortTest01() { val array = arrayOf(1, 5, 8, 3, 4, 2, 7, 9, 10, 6) val result = arrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) heapSortTest(result, array) }
0
8b4e1370901c61738181a290ebd87a26
aa827547b05691eec8114109d7e8dfe6
set the room id's of the lecture representation.
{ this.lectureStart = lectureStart; this.lectureDuration = lectureDuration; this.lectureDay = lectureDay; }
0
25bb96e8e48342972a47efae4d9277a1
060f72849042e7163b71eddb499ec44f
键盘读取一行输入,去掉其中重复字符, 打印出不同的那些字符
func main() { var inFile *os.File if len(os.Args) > 1 { var err error inFile, err = os.Open(os.Args[1]) if err != nil { fmt.Fprintf(os.Stderr, "open %v: %v \n", os.Args[1], err) os.Exit(1) } } else { inFile = os.Stdin } var lines = make(map[string]struct{}) var line string for { if _, err := fm...
0
0dbc5ad32b24cf6f33ef569a08374a90
10186faba5292a4679ab3d3bf99d83cb
Create Ninja variables to hold the names of the compilers and linker.
self.link_flags.append('-nodefaultlibs') self.link_flags.append('-L' + self.cxx_library_root) libdir = '{}/obj/STATIC_LIBRARIES/libc_ndk_intermediates'.format( os.getenv('ANDROID_PRODUCT_OUT')) self.link_flags.append('-L' + libdir) self.link_flags.append('-lc++_ndk') ...
0
cc35c153d09a02dae9460e5916b4bb87
cfed94f11001f9841d7d314afa57bb63
Controls the population of sequins (fka pixels) by populating or culling
namespace drifter namespace generative void Habitat::Populate() { int halfVariance = _popVariance / 2; int currPop = ci::randInt( _popSize - halfVariance, _popSize + halfVariance ); for ( size_t i = 0; i < currPop; ++i ) { bool addingSuccess = false; int tries = 0; ...
0
5b3fa470af016fd8e935060b18070972
ac48b4d849611d89e37483ed65ceeada
Get information about a person (address, hobbies etc) given a phone number.
{ $person = Person::with('phoneNumbers')->where('id', $id)->first(); return response()->json(['person' => $person], 200); }
0
255b0ed73be6a5b0fd75a3a5229ed50a
469276dc9dda46e10e91007edd7330c2
Sets the area_type of this IOspfArea.
if area_name is None: raise ValueError("Invalid value for `area_name`, must not be `None`") self._area_name = area_name
0
76b2f8c75c12c208719128f9b99a1409
3514c3354e1bd0019840f6c281d95fe5
根据完整SQL查询,返回结果为包含bean对象的List 注意:1. bean对象必须有无参构造函数 2. bean的成员变量名可以和数据库字段名不同,通过第三个参数namedMap完成对照 3. bean的成员变量必须是String 4. 对于某些数据库字段,转成字符串是否有精度的问题还有待验证
public List<T> findListBean(String sql,Object[] values,Object... args);
1
2a9c46300a00114ed016b3ed8c013387
bad07dc186efd355f2d8a86217bead21
returns 0 if not valid, 1 if valid csv
def validate_orphans_csv(the_file): if os.path.isfile(the_file): pass else: return False orphans = open(the_file,"r").readlines() line_counter = 0 for line in orphans: line_counter += 1 line = line.split(',') try: line[1] = int(line[1]) exc...
0
9aeaa228dd8e466db371aa629227d810
e7bb3e6a926fed1aa74e8ab4f241aff5
Ensure Pulp Smash can load the config file.
configs = config.find_configs( path=self.CONFIG_DIR ) try: configdicts = config.load_configs(configs) except Exception as e: self.fail(e)
1
5d1cf4d9c44d99f90203589f53f5dacd
b5c54e853f279ae02c85398a584bd498
Handles the dismissed event of the referenced alert.
namespace Ginger.Plugin.Platform.Web void DismissAlert();
0
5851dc1cc6a7959bb1be5e1f29d47c66
fcda9be4721f8e18195938b05fe977b2
Each metatron should register a URI regexp match for future bookmarklet functionality.
namespace QuickJS public class QuickJSContext : IDisposable public void AddIntrinsicRegExp() { JS_AddIntrinsicRegExp(this.NativeInstance); }
0
b5f93f8695acf4a73d30d7000a571dd0
2f2cc1323123b15ef99b65afb23fc68a
SOCKETIO CONNECTOR
socket = io.connect(); var serverFn = function (data, to_connid) { socket.emit("exchangeSDP", { message: data, to_connid: to_connid, }); }; socket.on("reset", function () { location.reload(); }); socket.on("exchangeSDP", async function (data) { await WrtcH...
1
d80f3e3d6d48c2b285fa72e4b59c826c
12d589813bee0b4e5d161d481dc053c0
Registers wizards.
let wizard = {element, mana, name, hp}; Object.assign(wizard, canBeIdentifiedByName, canCastSpells); return wizard; }
0
72eb6af61eb928428c7237c8543db261
923a851ff0813d970143a175a0f97e91
清除超出屏幕的NPC
if (npcList != null) { cloneNpcList = new ArrayList<>(npcList); Iterator<GameNpc> it = cloneNpcList.iterator(); while (it.hasNext()) { GameNpc tempNpc = it.next(); if (tempNpc.getY() > ScreenHeight + tempNpc.getHeight() || !tempNpc.isActive()) ...
1
ff75fa795caf32ec3acbca544d45645f
801d22b99cd811741792a85447bc0b53
Returns the meta object for class '{@link org.xtext.example.mydsl.serverGeneratorLanguage.DomainModel <em>Domain Model</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getEntity_DomainModel();
0
3e770267e3c04677d57b128731b03c8a
6ed1f05bd5a37b59aec8ac6e589cc768
Generate proposals from static anchors and normalizing coefficients coefficients: N x 4 tensor: N x (ty, tx, th, tw) anchors: N x 4 tensor with boxes N x (y, x, h, w) anchors contains x,y of box _center_ while returned tensor x,y coordinates are top-left corner. returns: N x 4 tensor with bounding box proposals
ycenter_a = (anchors[:, 0] + anchors[:, 2]) / 2 xcenter_a = (anchors[:, 1] + anchors[:, 3]) / 2 ha = anchors[:, 2] - anchors[:, 0] wa = anchors[:, 3] - anchors[:, 1] ty, tx, th, tw = rel_codes.unbind(dim=1) w = torch.exp(tw) * wa h = torch.exp(th) * ha ycenter = ty * ha + ycenter_a x...
1
dc46f7dee6dcf75a904da70edefc3480
26dae9d168a29b26076af9056d8fb6f0
Deletes the type of the global code category order.
namespace SuppliesDotCom.Controllers public class GlobalCodeCategoryMasterController : BaseController public JsonResult EditGlobalCategoryCodeOrderType(int GlobalCodeCategoryId) { var bal = new GlobalCodeCategoryMasterBal(); var m = bal.GetGlobalCategoriesByGlobalCodeCategoryId(Globa...
0
ec8d2b6837c31171ba001cb2f1cf7e16
1ae9e2fd21b3c99e14f1446613ac62c2
may contain prefix like: xxx-lib > ....
func GetLibDetail(name string, version string) (entity.LibDetail, bool) { var prev entity.LibDetail fversion := parseLibVersion(version) if _, exist := libDetails[name]; !exist { return prev, false } it := libDetails[name].Iterator() hasPrev := false for it.Next() { kversion := it.Key().(string) val, _ := ...
0
f5c1f33a16afe5468d77a4cff96a73c8
ea5edc96da38e7af51ba27be64b92d33
支付后将购物车中已支付的商品修改为已支付
@Update("update t_shopping SET status=1,updated_at=#{updated_at} where id = #{id}") int successPay(@Param("id")int id, @Param("updated_at") String updated_at);
1
7f983a140dd073ad3fa846d602e84287
e2fd4b12cd619c70d8e2ffac9fd4779e
Seleciona um mecanismo de atribuição
int tipo1, tipo2; if(tk.categoria == ID){ analex(); tipo1 = PesquisarTipo(tk); if(tk.categoria == SN && tk.cod == ATRIB){ analex(); tipo2 = expr(); printf("\n***CODIGO DO ATRIB: %d\n",tipo2); if((tipo1 == INTEIRO || tipo1== CARACTER || tipo1...
1
e6aa25fa016d282dff1a29acd6a9d8d2
a29baa34db84a7cc752fe4dbe542b7ac
Get model status
{ $model = app(get_class()); $modelStatus = ModelStatus::where('model', get_class())->where('model_id', $this->{$model->getKeyName()})->first(); if ($modelStatus != null) { return $modelStatus->status; } return null; }
1
e7b5a7699af2b246d55976b4015ba5c3
c942fcc9402ef84d68e69e28c391155f
Setter of the n_max property This function sets the value of n_max
class EightPuzzle(): def max_nodes(self, n): self.max_nodes = n
0
b1aad2ee67a66a6d971680dc45ff3647
4447dd1278f47c1b86f7a603345ba20f
Get most similar trackers
var sortedTrackers = trackers.OrderBy(tracker => { var vec = tracker.position - center; return Vector2.Dot(leftVec, vec); }).ToArray(); Transform right = sortedTrackers[0]; Transform left = sortedTrackers[1]; return new TransformSetting(right, left); }
0
62f66f631ec8a43fab5571f452ee6838
2dfc3b0864bc27cc733178cd9b61bdca
Write a blank line to stdout.
namespace Spectre.Console public static partial class AnsiConsole public static void WriteLine() { Console.WriteLine(); }
1
a1d94a7b2efa7929e0ec8a4055f6721c
616cdf63ef0952cd0f83ba565eec7282
returns if a pickup is active or not
public class Picking : MonoBehaviour public bool IsCarrying() { return _picked; }
1
3d4f353c30860193cbc1e7cbb483b75c
62521c27458c4235f473c156ec363803
@brief 引数の行列のノルムを返す関数。
{ int i; int j; float value; value = 0.0; for ( j = 0; j < n; j++ ) { for ( i = 0; i < m; i++ ) { value = value + pow ( real ( a[i+j*m] ), 2 ) + pow ( imag ( a[i+j*m] ), 2 ); } } value = sqrt ( value ); return value; }
1
373817b9f83d66e78d00de630afcd45a
84f1aa7e86996d30df2906f6803a0c4f
Puts on labels for tiepoints in an age table on a stratigraphic plot.
for ix, x in enumerate(xlst): label = labellst[ix] if label==0: continue plt.annotate(str(int(label)), xy=(x, ylst[ix]), xytext=(10, -3), textcoords="offset points", ha='center', va='bottom', ...
1
bbcec3ebb34a7c737a9f2f8464bb652a
322eb2ed0d7c1658e1b1c6e55bd74a3a
აბრუნებს მოთამაშის პროფილის სურათის მისამართს
namespace PropTabTabIK.DataAccess.Repositories.Concrete public class Repository<T> : IRepository<T> where T : CoreEntity public string GetPicture(T entity) { return _context.Set<T>().Where(x => x.ID == entity.ID).Select(x => x.ProfilPicture).FirstOrDefault(); }
1
29ae8654f3b2373792ac35356a2b2c2e
133f84e5bb77991c325c4a7ebf31e684
Verification of SBI parameters default values
xtk = "15" tae = "0" dtwpt = "150" aldtwpt = "155" self.defineSEQParam(xtk, tae, dtwpt, aldtwpt)
0
7f2090fed32bc1e4847620b0b26d29e6
364e91892d1924bab9e778468274d0a6
Sets the created_at of this NativeAppFromAppResponseCreateUpdate. The date that the app was created.
class GetAppResult: def created_at(self) -> str: return pulumi.get(self, "created_at")
0