query_id
string
corpus_id
string
query
string
code
string
label
int64
047b4b074dea7e2d76e4874c8719ffda
9de65357340c3b4602c4745492837696
00EE - RET (Return from a subroutine)
void Chip8::oc00EE(unsigned short opcode) { pc = stack[--sp]; pc += 2; }
1
72d72d534e46c0d0b73294e4647a0ced
bbf75a3cead9ec8b0c2355fde72332ca
check if bashmark init was done
def initialized(): return DETAILS.get('initialized', False)
1
238d164ee6a1b3f707f41f8f98e5f17b
4cfa7fd78b24bb7dcd428092aba26cb9
展示修改消费信息的界面
namespace MemberManagementSystem.Main public partial class MainSurface : Form private void consume_history_btn_Click(object sender, EventArgs e) { ConsumeHistory consumeHistory = new ConsumeHistory(); consumeHistory.ShowDialog(); }
0
457e87ff072defb62c09f43ecc901559
f561c1f196fb5bd5556ed5c3863e557c
特定のバリデーション項目を持つかを判定
final class ValidationData implements BaseValidationData public function has(string $name): bool { return array_key_exists($name, $this->items); }
1
132b3b5578c5f82cab2222e4bbe2a310
fb2c1e5f7d527de6dc7dccdc58a9849f
Get Cedula2.
class User extends Authenticatable public function getCedulaFAttribute() { $value = $this->cedula; if (null == $value) return ''; return number_format($value, 0, ',', '.'); }
0
53e8af857b3ba6d905a1ca83b65ebbd8
a2d9ddc7f97c7cb4d2df22f461eea868
build a UDP header
void put_udp(void) { checkflag = 0; checkhi = d_checkhi; checklo = d_checklo; put_word(locport); put_word(remport); put_word(udplen); check_lword(&myip); check_lword(&remip); check_byte(0); check_byte(PUDP); ...
1
630880dabacb1ed308376521220f4140
5b6212587336d9fd5e019fc76660f62b
C2B Confirmation This method is used to confirm a C2B Transaction that has passed various methods set by the developer during validation
class Transactions extends Controller public function Confirmation(Request $request) { try { $content=$request->getContent(); $content_data = json_decode($content, true); $result_code = $content_data['Body']['stkCallback']['ResultCode']; if($result_code == '...
1
b661a9b698e3c0b60611680d1404a208
c9609709a0f38eae1f271eb5fe0a7870
如果viewType为TYPE_SPECIAL,使用自己缓存的View去构建ViewHolder 否则返回null,会使用系统RecyclerPool缓存或者从新通过onCreateViewHolder构建View及ViewHolder
public class PozaRecyclerViewAdapter extends RecyclerView.Adapter<PozaRecyclerViewAdapter.PojaRecyclerViewHolder> @Override public PojaRecyclerViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { PozaRecyclerViewFetcher fetcher = mViewTypeFetcher.get(viewType); if (fetcher == null) return new Poja...
0
016123dec18754c1e5d92eefc62bfc71
dfc70adf3a0f7cb8a1ab47e678fafdd8
Moves the _head n positions forwards. Negative n moves the _head backwards.
{ var diff = (_ptr + mod) - _length; if (diff > 0) _length += diff; _ptr += mod; }
0
d6b9a84992d558f9283db9026b51235f
602cd8b1b7c48ae77ea46c336729513c
获取单只股票历年数据
class oneday_result: def __init__(self,date): import tushare as ts self.sh = ts.get_hist_data('sh',start=date_to_str(date),end=(date_to_str(date)),ktype='D')
0
9d3afc0eef6caece9fb7c952d7655e49
d96cc4ed1903f6669c6037a32164d095
Gets the discovery report for the specified discovery session.
IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions? options, Dictionary<string, SourceDetail> sourceToSourceDetailMap, IWarningLogger warningLogger);
0
32647a2838b49c38ae518433c39cb3dd
96d7e9472c8ee3ae82026e430eb2c0ab
Destroy the sonic stream.
SdrUsrp::~SdrUsrp() { buffs_.clear(); rx_stream_->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); }
1
324a517a5f575cf47939716878d58c67
5a99bcbc82c21dad2a939c7fa2786448
Validates that this password is exactly equal to another password provided by argument.
{ if (Password == outPassword) { return true; } return false; }
1
dfaa79fafd55bb596b8a6c27f859bb47
02d854920c7a158425607d96964bff36
Wakeup from serialization Reflection needs explicit instantiation to work correctly. Re-instantiate reflection object on wakeup.
class ClassMetadata extends \Doctrine\ORM\Mapping\ClassMetadata public function wakeupReflection($reflService) { parent::wakeupReflection($reflService); $this->reflClass = new ClassReflection($this->name); }
1
bb244870914470c6206eea376b79a2f0
6bae3c8a41f65dcbae48f06e84b26830
Appelée lorsque le joueur a décidé de tirer des billets supplémentaires en cours de partie, afin de lui communiquer les billets tirés et de savoir lesquels il garde
namespace BatailleWF public partial class BatailleWindow : Form private void PliGagnee(object sender, PliGainedEventArgs e) { this.Invoke((MethodInvoker)delegate () { this.rtbDisplay.AppendText("\n"); this.rtbDisplay.AppendText("Gagnant du pli : " + e....
0
5d9a95e5d4adb8478da7472d864ed916
ae3ed25807922716aabcd77644ef5a11
filtra viajes por etiquetas.
def aplicar_filtro(filtros,lista_tickets): for clave,valor in filtros.items(): if clave in ('--autor', '-a'): lista_tickets = filtrar_autor(lista_tickets,valor) if clave in ('--estado', '-d'): lista_tickets = filtrar_estado(lista_tickets,valor) if clave in ('--fecha',...
0
3763cd1d48c235eadcb1751b9435441a
8415b38314c6cd3d24b6e79cc17a6c7f
A. The total number of reviews (0.5pts)
def total_reviews(data1): return data1.count()
1
a54f722626ffc63eb17d330650d134ef
ad23e1e7326d8256e53708afce5bf0cb
留言表單自動填入使用者資料
{ userInfo = input; if(userInfo) { var form = document.getElementById('userform'); form.elements[0].value = userInfo[0]; form.elements[1].value = userInfo[1]; form.elements[2].value = userInfo[2]; form.elements[3].value = userInfo[3]; form.elements[9].value = userInfo[5]; form.elements[10].value = user...
1
9d14f57d9de78178446b5156c09030e3
6799f3a9c224c25354334126655e7f6d
remove all possible conflicts and set the cell value to 0
class Table int solve_cell() { ofstream outfile; outfile.open("exout2.txt",ios::app); int cnt=0; for(int row=0;row<9;row++) { for(int col=0;col<9;col++) { if(c[row][col].PossVal.size()==1) { c[r...
0
689c84a8305fcb167d6831dbd3d0293d
ad8b40d89de160edfbe4b3c11218eddb
GET handler for rendering child objects.
void _View_RenderChild(void* data, void* extra) { FEMTO_View* view = (FEMTO_View*) data; FEMTO_RenderView(view); }
0
8883a44afa8c9a0662c4ece8ee4a9fde
9d24801171feb4995e51b774e1ed8704
通过zyrjm,判断当前账号登录状态
@Component public class ZzddxxlbService extends TraceShowModuleDefineDaoService<StringIDEntity, TraceShowModuleDao> public Map<String, Object> isKhlogin() { List<GrantedAuthority> authorities = CommonUtil.getUser().getAuthorities(); for (GrantedAuthority authority : authorities) { if ("xsjdg...
0
a18cf0340e13445e863d0ff0080f8119
acfe27fae5093bf8fadd206c858edc0c
\brief Vypis statistik z kniznice SIMLIB
static TStamp prev_mytime = 0; static t_InpInfo SInfo; TStamp mytime; long int rate = 0; char st[256]; int stat_written = -1; int stat_updated = -1; int stat_errors = -1; int stat_warnings = -1; int stat_infos = -1; int nbk = -1; int stat_nsocket = -1; LLint stat_bytes = -1; L...
1
522f00e2ff47f1907f822f5ffdafe7e3
e9d838382e3786867ccb82de7b430e72
פונקציה שמחזירה רשימה של כל התגיות האפשריות
choicelist = [] for p in self.papers: choicelist += p.answers + p.keyslist choicelist = list(set(choicelist)) return choicelist
1
18dd964e15a643fe5f1031057d188ebd
2ce0894b6f5db6ed6f529f5c77a4c448
The number of write operations.
@javax.annotation.Generated(value = "class com.ni.aa.client.codegen.lang.JavaNetappClientCodegen", date = "2017-10-04T15:05:55.769-05:00") public class DriveCounterGroup public DriveCounterGroup writeOps(Long writeOps) { this.writeOps = writeOps; return this; }
1
aca2908a5b33f11adafb3c359ef7eb8a
14915e23f4cf917476dfcfa98a5b7c64
Called once when the view is initialised, has dimensions, and will display an image on the next draw. This is triggered at the same time as [OnImageEventListener.onReady] but allows a subclass to receive this event without using a listener.
namespace Vuplex.WebView void Init(Texture2D viewportTexture, float width, float height);
1
cb62c0e125d2461f1720bc2bd7f7ccf2
3b2ae6fec2d8b473b1d8a384ede333fd
NewCache - конструктор для Cache
class Cache_Lite_Function extends Cache_Lite function Cache_Lite_Function($options = array(NULL)) { self::__construct($options); }
0
1aa1490138a914efbe75a3cf74c617c6
159bc5dcb3b903037d8506e9154f8d10
Reset Wait Drop Counter
class WCBDataPackets(data_packet_generator.DataPacket): def setDropperReset(self): self.clearPacket() self.setByteCount(0x06) self.setFrameID(0xFE) self.calcCRC32Out() self.pack() self.send(self.WCBCom)
1
ab94b9a443afe1415860ae0b0a0999ff
f83cb4df78267a349051c0b12a33e89e
EVITA LA SECUENCIA DE TECLAS CNTR+V PARA PEGAR TEXTO EN EL CAMPO CONTRASEÑA
int k = (int) evt.getKeyChar(); if (k >= 97 && k <= 122 || k >= 65 && k <= 90) { evt.setKeyChar((char) KeyEvent.VK_CLEAR); JOptionPane.showMessageDialog(null, "No puede ingresar letras!!!", "Ventana Error Datos", JOptionPane.ERROR_MESSAGE); } if (k == KeyEv...
0
aee414c081f12424805266eb4f8ce5ff
88861ff06373f2caaddfd54433719f30
Read an OpenQASM (2.0, 3.0 is experimental) string and convert it to ProjectQ commands. This version of the function uses Qiskit in order to parse the *.qasm file.
try: from qiskit import QuantumCircuit except ImportError as e: raise ImportError( '\n\nUnable to import qiskit package.\n' 'Please ensure that it is installed with the following command:\n' '\tpip install qiskit\n', ) from e return QuantumCircuit....
1
d917c24ed55b87284839512e2b6efaea
697f8edd0668d831fba279966afa4d6d
Usage: show_online_onsite_devs Lists all onsite devices connected
class RAConsole(object): def devs(self): self._print_devs()
0
0af9dc1e7ea55d779ad82d5d22c3620c
fb729bebb94cdb87493cf77a21a28ae0
Return a float representing the number of errors in the minibatch over the total number of examples of the minibatch
class CountMinSketch(object): def error_rate(self): return self.__error_rate
0
d751fd4d81769cb1deddfb348c06039e
0146c1bb52e5a107972b0af85260b3d1
Get the process' output to stderr, if that was collected by the {@link ProcessOutputStrategy} used. supported by the {@link ProcessOutputStrategy}.
default String getOutput() { return String.join("\n", getOutputStream()); }
0
1f68ac9dc4eb68f7f5101d8075bd1fc9
881480e0b54c8e2e39fff5e99e7616cc
Record the visit in the activity service.
public class MapView extends FragmentActivity implements GoogleMap.OnMyLocationButtonClickListener, GoogleMap.OnMyLocationClickListener, OnMapReadyCallback, ServiceConnection, LocationResultReceiver.Receiver @Override public void onVisitFetch(int resultCode, Bundle resultData) { mVisit = resultData.getParce...
0
785f3128e91c7cff7e9d589dd90fe81c
e7f83be96b04f23ee7d64160caaaaacb
Controller behaviour when receiving a changer connected event.
{ if (getStartConnector() != null) { ((TagConnector) getStartConnector()).getSocketFigure().addFigureChangeListener(this); } }
0
1f41db4265b929b762ac00a460f8d5f8
901b5c864942d1a8be2ff53e994101e0
Returns true if an alert was created (or an existing one was extended), false otherwise.
const updatedAlerts = Object.assign([], state); if (updatedAlerts.findIndex(a => a.name === alert.name) === -1) { updatedAlerts.push(alert); } return updatedAlerts; }
0
02ae442236b67e16d9d310606334af0f
3f1285bd1f8ff73a4c0dbc3b7006f194
retrieve all the eqs order by oldest (time asc)
String hql = "from TimeFrame order by orders"; return queryByHQL(hql); }
0
836a1659a8e0f8bdfd1bdad153deffb5
7056515ac4d740d65960a4a388669ef9
draws all table cells
function drawTables() { Object.keys(tableLocations).forEach(function(key) { var location = tableLocations[key]; var tableNumber = (((typeof careerFairData.termVars.layout.locationTableMapping[location.locationId]) == "undefined") ? "" : careerFairData.termVars.layout.locationTableMapping[location.lo...
1
85a2a7abfb5c8d962f55211af9fb2110
edf42eb6fe9c8f1df3aa74f2e5e779dc
Check that all columns that cannot be NULL are set.
{ foreach (DAE.Schema.TableVarColumn LColumn in TableVar.Columns) if (!LColumn.IsNilable && this[LColumn.Name].IsNil) { this[LColumn.Name].FocusControl(); throw new ClientException(ClientException.Codes.ColumnRequired, LColumn.Name); } if (OnValidate != null) OnValidate(this, EventArgs...
1
ee5856ff4ca000c7535d94d2410a1f4e
5997a0374ac2a22e049a23b016f317f7
查找保存产品的目录信息 by mws 适用于已知amz账号信息和seller sku情况下的多次调用
class ListingAliexpressApiHelper public static function getListingByNumV2($selleruserid, $number = 100){ $a = AliexpressInterface_Helper_Qimen::checkToken($selleruserid); if ($a) { $api = new AliexpressInterface_Api_Qimen (); }else{ return ['msg' => "$selleruserid Unauthorized!"]; } $param = ['id...
0
47dea9a747893125b84fbb3d48dea15c
5fa55523f40c0f6bbe0d915c48d931e0
Executes the FadeToPage1 command.
{ return CommandFactory.Parse(new string[] { "GotoTestPage", "Forward", null, null, null }); }
0
c3216f633e40d10935ae82dfdab72877
4d20eb88c421b8d3adb5ff2d7390bd90
Gets the thread-local variable for request headers.
public class ServiceThreadLocal public static Map<String,String> getRequestHeaders() { return threadRequestHeaders.get(); }
1
0863bb21486b1ef5c263e413a049ee90
29094608b70d29f84ddb1392800d36a8
Профиль пользователя. Возможность изменить логин, пароль. В перспективе сохранить свои любимые ссылки.
class My_IndexController extends Zend_Controller_Action public function profileAction() { $Form = new My_Form_User_Profile(); $Form->populate( $this->_helper->my()->toArray() ); if ( $this->_request->isPost() ) { if ( $Form->isValid( $this->getAllParams() ) ) { $U...
1
f4f881faa490ca73e01c8a5bee48fe28
eb6b4d4a9f3ab7a30f5ce0f576194639
Creates a form to edit a Requests entity.
shlEditRequest.setText("Edit Request"); shlEditRequest.setSize(410, 520); shlEditRequest.setLayout(new FillLayout(SWT.HORIZONTAL)); shlEditRequest.setBackground(SWTResourceManager.getColor(new RGB(238, 242, 250))); Composite composite = new Composite(shlEditRequest, SWT.BORDER); composite.setLayout(new Form...
1
ece0ac6585aaeff5e48c07024c7291f7
f898140b629c1741973637553b4de554
Returns a constant reference to the ith element of mArray
TPtr8& CMmPtrHolder::Ptr(TInt aIndex) { return iPtrArray[aIndex]; }
0
0d399a489b304984a4eff6800a4ec7c2
a3e797acf3cedadee51da053205ffa78
Displays image on a post, or a placeholder if the image has been deleted
function honeycomb_post_thumbnail( $size = 'full' ) { if ( has_post_thumbnail() ) { the_post_thumbnail( $size ); } }
0
821ec6b37ad2723708d63943ee02927b
d2a6813fc44629c3362845b49b6aaf64
Create, Update or Delete RelationshipType attribute mappings
namespace MDM.DataModelManager.Business public class RelationshipTypeEntityTypeMappingBL : BusinessLogicBase, IDataModelManager public OperationResult Process(RelationshipTypeEntityTypeMappingCollection relationshipTypeEntityTypeMapping, CallerContext callerContext) { MDMTraceHelper.InitializeTr...
1
7ade1e66954febd85acf17fa2793a7ef
3339e08879fc737bef86e12a574988ce
Create a new float token.
namespace script Value Engine::newFloat(float fval) { Value v{ new ValueImpl{ Type::Float, this } }; v.impl()->set_float(fval); return v; }
1
8983c2ade9678aefcefc06a2e48da5dd
f105257f40a70b1435ede45dc2fcd9c9
交换两个显示对象的层级
namespace Tunynet.Common.Repositories public class SchoolRepository : Repository<School>, ISchoolRepository public void ChangeDisplayOrder(long id, long referenceId) { var school = Get(id); var referenceSchool = Get(referenceId); long displayOrder = referenceSchool.Displa...
1
d67433ae1fb544e3d2053dfb2022a8ad
ec166a57c4dd77d5df883c06b4caecd5
returns True if car i is able to change the lane, False if isn't
class IPrbPermissions(object): def canChangeVehicle(self): return True
0
cbff368a0b4abdee4139a27e8e7ca88b
226c4bb337a6dd7bd328584d04f41f52
{@icu} Unregisters the factory or instance associated with this key (obtained from registerInstance or registerFactory). @param registryKey a key obtained from registerFactory @return true if the object was successfully unregistered @stable ICU 2.6
{ HRESULT hr = S_OK; if(ppImplReg) { if(*ppImplReg) hr = S_FALSE; else { IUnknown *pUnk = 0; CoCreateInstance(CLSID_DOMImplementationRegistry, 0, CLSCTX_ALL, IID_IUnknown, reinterpret_cast<void **>(&pUnk)); CComQIPtr<IDOMImplementationRegistry> pImplReg = pUnk; if(pImplReg) *ppImplReg = pImplRe...
0
5ede5f2a305c522f09be43b6c484af00
c99b7a5fb8d75c3c3de0d21330ff5f84
펀딩 취소시 내역 등록
@Repository public class PointStoreLogic implements PointStore{ @Override public int insertFundCancelPoint(int doFundNo) { return sqlSession.insert("pointMapper.insertFundCancelPoint", doFundNo); }
1
24ba073c996c4039e876cd997528d86c
7284a2a6a8e8b6ca01ba961bae9af4e0
提供B2B卖家查看改签列表服务
List<B2BSign> b2BSignArrayList = Lists.newArrayList(); int pageNo = 1; int pageSize = 500; b2BSign.setPage(new MSPage<>(pageNo,pageSize)); MSResponse<MSPage<B2BSign>> msResponse = b2BCustomerPddMappingFeign.getServiceSignList(b2BSign); if (MSResponse.isSuccess(msResponse)...
1
b825c86a8d5345d78255688ce1d5b054
98358baa8669b02dcab0aa1926019773
Opens the tracking interface
class TrackingWizard: def start_tracking(self): if 'darwin' in sys.platform: self.frame.Hide() else: self.frame.Close() self.starttracking_callback()
0
e30e8ad0ac8a3b9cde2a656ad1ace65b
e83333177f6d2998dd273bf13b838045
Get the address for the sending socket
public class RtpStreamSender extends Thread implements RtpControlledSender public SocketAddress getRemoteSoAddress() { return remote_soaddr; }
1
46258f504d75c06b280f317633f36c66
9746f76268c6846e302fcda842605f9c
check if script has prefix OP_RETURN
namespace kth::domain::chain bool script_basis::is_pay_script_hash_pattern(operation::list const& ops) { return ops.size() == 3 && ops[0].code() == opcode::hash160 && ops[1].code() == opcode::push_size_20 && ops[2].code() == opcode::equal; }
0
f31cf122a56a3d2ff2b9715840545620
867a4163f2312909e56fbaf716ad2631
testing if the projects attribute will be an empty list if the projects argument is skipped
class HasProjectTest(unittest.TestCase): def testForStudentWithNoProjects(self): self.profile.student_data.number_of_projects = 0 has_project = profile_logic.hasProject(self.profile) self.assertFalse(has_project)
0
b805cca7fa59681156c4adf4b415f0ce
a2410d96efbbbfc906631e893614fa6b
打开查询客户群成员信息窗体
Btn_showCustInfo = (By.XPATH,"//button[contains(@ontap,'showGrpCustDialog')]") self.isElementDisplay(Btn_showCustInfo,'click') loc_selMode = (By.ID,'cond_GROUP_MODE_span') self.isElementDisplay(loc_selMode,'click') Loc_selByNumber = (By.XPATH,'//*[@id="cond_GROUP_MODE_float"]/d...
1
3f4ac51474587562db086139fa3c257e
77366dde9d9a2dc4e1dcf94eea45b469
CrInput only supports 0 or -1 values for the input's tabindex to allow having the input in tab order or not. Values greater than 0 will not work as the shadow root encapsulates tabindices.
public class Anchor extends ComplexWidget implements HasClickHandlers, HasDoubleClickHandlers, HasHref, HasToggle, HasTargetHistoryToken, HasHTML, HasIcon, HasIconPosition, Focusable, HasTarget, HasPull, HasEnabled @Override public int getTabIndex() { return FocusableMixin.getTabIndex(this); }
0
ef42025649eff811333ab55133bb7a15
832bf90850724fb09a688f7629bf3b4b
获得CMC Mac域流量与利用率历史性能数据
@DynamicDB List<Point> queryCmcRelayPerfPoints(Long entityId, String startTime, String endTime);
1
be041003c7e6d33f61683c2e0ea9e604
50aa4b37e832d44181794760ccbb2b44
Call method to increase ordered stock qty. :model:'stock.Inventory'
class OrderModel extends Model public function stockuporderevent() { }
0
d3a41debe9398df11722e9641020bf55
777d92be53c5801fec351b3a800209f7
This should be called when the Fly-Pie extension is disabled or the preferences dialog is closed. It deletes the Gio.Settings object.
public void unregisterSettings ();
1
cbd1badf590ed13e7472641a4fc1751d
7e2c9febc3c3b500feec9214f478606f
Finds the Facility in OpenMRS by facility ID.
{ IMapFacility facilityBase = null; if (!string.IsNullOrEmpty(id)) { foreach (var item in m_mapFacilities) { if (item.Value.ID == id) { facilityBase = item.Value; ...
1
5fb554e8d94e08e5fcc445d774ea9ab9
2ea15fb137cc0a88e94f62feeb317936
Handle ULTRA tags
void gxsHTML::Handle_UL_Tag() { }
0
5fe5128afa0857d6a85886ba30b97eea
23a5ca0d5bda8c8337f1c1fa711d42ee
Set Period. @param C_Period_ID Period of the Calendar
{ Integer ii = (Integer)get_Value(COLUMNNAME_C_Period_ID); if (ii == null) return 0; return ii.intValue(); }
0
bae4b4abf3d14ad2618f6f1a958869f5
1060904531f1661321e2777b4ab20e5c
Set the ending vertex ID.
public class LReturn public void setEnd(Integer end) { endAngle = end; }
0
eacc02c8fa144cd3e461abd02ba84c49
09a8500b51da32c0e5be58d7b1a20863
Get member if token is provided, otherwise return None.
class TestDefaultApi(unittest.TestCase): def test_tokens_token_member_get(self): pass
0
8eb9287feaab1e370246d6ede02a64bc
a098792f1de12336b4571b4d815d65a7
Generate Halton sequences
void ShellSequence::generateSequence() { int h = 1; int i = 0; while (h < m_maxN) { m_gaps.push(h); h = std::pow(2, i); i++; } }
0
94ab94e6657c634ff54e45c048b3cc1a
09189e826cd36e58930db7fd1214cccc
Returns the average of the three similarity functions
Set<String> keys = similarities.keySet(); float average = 0; for (String similarity : keys) { average += similarities.get(similarity); } return average / similarities.size(); }
1
2ee63688ffbe1bed4b4c7199aa0eaedb
18c29169330388b3460d593ec0ce14b9
Extracts archive using password to given target location
if not zipfile.is_zipfile(path): return False if zip_is_password_protected(path): return False try: with zipfile.ZipFile(path, 'r') as archive: archive.extractall(to) fs.rchmod(to, 0o755) return True except Exception as e: return False
0
23eabf4a1a58582e262dd65d443622cc
7a1be99ddeb1b9f6ec95504c286c9423
Tests that preferences are returned for null inputs (all preferences)
action.prepare(); List < UserPreference > preferences = action.getPreferences(); preferences.get(0).setValue(null); preferences.get(1).setValue(null); action.validate(); assertEquals("Fields error should be added.", 2, action.getFieldErrors().size()); }
0
3e9bbf93bce1d0e4b453aa040ea2b9f3
b5a6c251464141f992f9cc03dd37711d
Expects a specified event indefinitely.
let mut l: Loop<bool, Both> = Loop::new(false).unwrap(); l.insert(AnyDynEvent::new(IdleEvent)).unwrap(); l.insert(AnyDynEvent::new(TimeoutEvent)).unwrap(); l.run().unwrap(); l.with_context(|ctx| { assert!(*ctx); Ok(()) }) .u...
0
3c96c9598ae52e5fe0ee011f62f73ece
5445bb946e7fad40c829edc3f963ee89
clean HTML markup, but preserve newlines
class Sphinx: def clean_html(raw_html): return re.sub('<.*?>', '', raw_html.replace('<br>', '\n') .replace('<br />', '\n'), re.U)
1
cee5c687366279c48546228e17326b55
dacf8b91e713c5898dbe4e4df2cf56f9
设置 来源类型 默认值
@Table(name = "grant_relations") public class GrantRelationEntity extends BaseEntity public void setSourceType(String sourceType) { this.sourceType = sourceType; }
0
0e003b6f00e664e1934bd76f1bd22f0c
7a7ec048f5768a0a00761ea1ca020fd7
该店铺下的商品总价格
let zong = 0; state.shop.map(item=>{ if(item.checked==true){ zong+=item.num*item.shopinfo.basicInfo.minPrice } }) return parseFloat(zong).toFixed(2); }
1
6a5e1876d60f367ef96fdc5789bc089d
225eeec80a437d19ac2295f39cea7e8d
Gets the daily closing time.
public function getClosingTime(\DateTime $context);
1
6335a62f26de642beb7ca75bfe837418
6629eda433a7f897d48584b24954d248
NO-OP for now
class CodegenAuthConfigProvider(private val validateAuthToken: (UUID) -> CodegenPrincipal?) : AuthConfigProvider override fun refresh() { }
1
cb7b53721c5218dfde0ea7ba5011c343
f13838469d03c806574f2fc9da0863ec
if user is set and is the admin, send to admin page. Else, send to User page
class ApplicationController def after_sign_in_path_for(resource) unless current_user.has_role? :admin user_path(current_user) else root_path end end
1
83ee2fffd2b57b7dc0d989f835f1d971
de4f14b17df9744a4fb28d014c78139a
JournalController constructor.
class BackOfficeJourneeController extends AbstractController public function __construct(JourneeRepository $journeeRepository, UtilController $utilController, EntityManagerInterface $em) { $this->em = $em; $this->journeeRepository = $jo...
0
0fd4d391cf0bd21779c3f03e0a9c8849
b7d18414cf441fdece0ff07831ccd444
Deletes the logs from the store.
class CapturedLogManager(ABC): def delete_logs( self, log_key: Optional[Sequence[str]] = None, prefix: Optional[Sequence[str]] = None ) -> None:
1
f00904b66d0a36cfe09a8d3205a437af
425d0125656cf24e6ce3d444b2eabb70
设置奖励获取按钮回调
function PveBarrierPanel:getRewardCallback(msg) if msg.code == 0 then rewardPanel[self.rewerdTag].button.haveGotten(); rewardCount = rewardCount - 1 if rewardCount > 0 then circleTip.Visibility = Visibility.Visible else circleTip.Visibility = Visibility.Hidden end rewardList[self.curPageId][self.re...
1
8ca9f5ee93b6b69aa16993c50f22378c
0fd71495bc29088c5c2dedcfe98026bf
Schreibt die Daten aus $Data in das Kodi_RPC_Data-Objekt.
{ $Data = json_decode($JSONString); if ($Data->DataID <> '{73249F91-710A-4D24-B1F1-A72F216C2BDC}') return false; $KodiData = new Kodi_RPC_Data(); $KodiData->CreateFromGenericObject($Data); if ($KodiData->Typ <> Kodi_RPC_Data::$EventTyp) return false; ...
1
3691ef1d49293ed13f577b01db3dbc59
a24709b51cc59247bc0c5c6ad6c375e0
修改最后下单时间
{ $o_id = $_POST['o_id']; $order = Order::findOne($o_id); $order->e_time = date('y-m-d h:i:s', time()); if ($order === null) { throw new NotFoundHttpException; } if ($order->save()) { echo 'success'; } }
1
f8236eca41e560f3bcf9f17594014ff4
113536458fb3f7e7071a052b573ace29
### Normalised mean GFP intensity
sc <- 60000 * (im[,,"grey"] - im[,,"black"]) / (im[,,"white"] - im[,,"black"]) if (fix.inf) { sc[is.infinite(sc)] <- NA } sc }
0
c1d73011e42b47b4b731591d8e81d76f
1059ab11e58ed36ba7ba7e8e91edfc3a
根据微连参数集合更新绘图数据
try { if (paramValue != null && !paramValue.equals("")) { String[][] values = DataSetUtil.splitValues(paramValue); for (int i = 0; i < values.length; i++) { if (allTotalInfo.get(id).totalType == ParamTotalInfo.TotalType_Quality_Main) { LinkedHashMap<Integer, Long> assistParamValues = new LinkedH...
1
a9a636539002ba079ab153c1ad4566a2
73ab9773a0534ce4b9dba1ffe254d2b9
{Additional Content: Get all the scores of the player on all quizzes
class DBHelper(context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, 1) fun getAllScores(): ArrayList<ScoreTable> { val db = this.readableDatabase val rv = ArrayList<ScoreTable>() val csr = db.query(SCORE_TABLE,null ,null,null,null,null,null) while (csr.moveToNext()) { ...
1
2cb8b9588dfea146c8ded3e38c463d1a
f8d06c6236e47ead076e847f8074ca3e
饶 X 轴旋转矩阵
namespace LN public class API [DllImport(DLLName, CharSet = DLLCharSet, CallingConvention = DefaultCallingConvention)] public extern static Result LNMatrix_RotateX(ref Matrix mat, float radian);
1
81a867f6f684b77faf128fdad9644376
bb945447fca2f33d51e1b4bdcc781090
Fixture for mocking an incoming update of type message/text.
def test_process_text_message(mqtt_client, profanity_filter, twilio_client): def mock_message(text): return dict(From='+16175552323', Body=text)
1
92268a20ac7268ba79b132b97a3759f5
24d8e58795ba7762deaf9866980a83b6
通过分页获取来源变更统计数据
function changePage(page, pageSize) { dispatch({ type: 'checkSelfAccountMod/getStatistics', payload: {pageNum: page, pageSize: pageSize} }); }
1
843d4cf362f9dc24d42444ffdb2d8ee8
4fa76ecbf320f66e8a82a058f24a6199
Ensure we can't create an account without password
class TestUsers(BaseTest): def test_user_registration_without_password(self): user = {'username': self.fake.user_name()} response = self.create_users(user) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
1
556baa2810764662464a5e6a723bf58d
203ba254ad387a3f131d21e074456ffb
一对多(商品一级分类对商品二级分类),cascade影响增删改,fetch影响读。
class Goods extends Model public function cate() { return $this->belongsTo('Cate','goods_pid'); }
0
e6f938743b60a426e0a47f69ed781a30
9c9c3563a29c4b27416f1181376764a7
Splits matrix X into two sets, where second set only contains one subject Input
dnumpy = numpy.array(dframe) size = dnumpy.shape[1] x_dnumpy = dnumpy[:, :size - 1] y_dnumpy = dnumpy[:, size - 1] return x_dnumpy, y_dnumpy
1
2c797de82c8ff147149474232b9237f1
7f992422078011e88433eec5ea0f854e
function to calculate stop loss based on supertrends
def dp_stoploss(kernel=2, n=10, zs=0.005): if kernel == 1: t = n + 2 hist = attribute_history('000001.XSHG', t, '1d', 'close', df=False) temp1 = sum(hist['close'][1:-1]) / float(n) temp2 = sum(hist['close'][0:-2]) / float(n) close1 = hist['close'][-1] close2 = hist['c...
0
0c40c53bf9fecff30decff56b257bbda
27f7257f7cbc2a4bf5ad3e367ae9881a
爬虫的启动方法,按照爬虫的逻辑依次调用方法
class HuYaSpider(): def start(self): htmls = self.__crawl_web_html() list_anchors = self.__extract_data(htmls) anchors = self.__reorder(list_anchors) self.__anchors_rank(anchors)
1
0b4b921e5c1c53a726e70e36a4d4f323
d9a625a73f75281ccab929839e1c949e
read floats from textbox
namespace irr namespace scene inline f32 CIrrMeshFileLoader::readFloat(const c8 ** p) { f32 ftmp; *p = core::fast_atof_move(*p, ftmp); return ftmp; }
0
de41b49bf69d83cba617cd445dc35abf
3fcacfb1094c71a17ef726865eefc780
read a string from fileName, return '' if fileName does not exist
def readFile(fileName): f = open(fileName,'r') message = f.read() f.close() return message
0
c5e1fa3f09c79185b8a4c4d305408c2a
a2e0b1f67495299173629152a9bb85f2
Gets an empty globals object.
abstract class TplExtension implements \Twig_ExtensionInterface, \Twig_Extension_InitRuntimeInterface, \Twig_Extension_GlobalsInterface public function getGlobals() { return []; }
1
0f833ea11496d1dd458761808db32cff
c43c43fba5d4c42c8157398c0be283e9
Maximum magnitude: Same as mpd_max(), but compares the operands with their sign ignored.
_mpd_cmp(const mpd_t *a, const mpd_t *b) { mpd_ssize_t adjexp_a, adjexp_b; if (a == b) { return 0; } if (mpd_isinfinite(a)) { if (mpd_isinfinite(b)) { return mpd_isnegative(b) - mpd_isnegative(a); } return mpd_arith_sign(a); } if (mpd_isinfinite(b)) { ...
0
58e8dd6b4c6e873fb649d8e284a30a24
1cd87db6f0b09331791c61a802733a7b
Creates a new SSL key (for signing certificates).
namespace AESGCMInBouncyCastle string NewKey();
0
96c42ed3b00d585b458b274646be4f7e
2fecb79a8ac67565ed2d0e2da1846a23
This method sets the signal strength parameter in the message.
@CrossOrigin(origins = "*") @RestController @RequestMapping (value="/adapterRest") public class ThingworxController @RequestMapping (value="/setDeviceSignalStrength") public boolean setDeviceSignalStrength(@RequestParam(value="adapterName", defaultValue="-") String adapterName, @RequestParam(value="controllerID", ...
1
ca6aea629d3639b7349f2af5c9890ce7
ae9a5f3c600028cfdf1ec3e7b51959fa
创建服务商证件历史信息
ArrayList<common.business.SvcPcCertificateDto> certificateList = new ArrayList<>(); for(SvcPcCertificateDto svcPcCertificate : svcPcCertificateDto){ if("MN".equalsIgnoreCase(svcPcCertificate.getCertType().trim()) && svcPcCertificate.getId() != null && svcPcCertificate.getId().getCertNum() !=...
0