query_id
string
corpus_id
string
query
string
code
string
label
int64
8e2449e76097ee32d65a8aff40a5d36f
d72ca5b5f1443aae228cf9f5583cc9cd
Starts a sign-in activity using {@link #REQUEST_CODE_SIGN_IN}.
class SplashActivity : AppCompatActivity(), SplashContract.PresenterCallback, AppDialogFragment.Callback private fun requestSignIn() { logI("Request sign in.") presenter?.requestSignIn() }
0
4da337ab358617dd40ac1bc3a5a764a5
bc19d5693076467d666b0b96891ba1a0
Main function to call the function to read a csv file
def main(): filename = CSV_FILE analyze(filename)
1
4a68913c485dd23ff1a1c3655fa97c62
2b3611df38affea6dcf2ca568319500e
获取表单分页详细信息
namespace Hunter.Form public class Service : ServiceBase, IService public PageResult<InstancePageData> Page(string id, PageParam<Dictionary<string, object>> pageParam) { var select = $"SELECT * FROM \"{Database.Form.TABLE_NAME}\" "; var condition = this.BuildConditionPostgreSql(pageP...
1
87bea4b8366fd56797312bfaec8cccfe
5ea366fa779ecf332890a0cbe837e9f6
Find the zip code of the first result
function getZip(resp) { var zipCode = resp.location.zip; if (zipCode == null) { error("Zipcode was not found."); return; } zipCode = encodeURIComponent(zipCode); document.getElementById("zip").innerHTML = "Zipcode found: " + zipCode; var url = "https://api.wunderground.com/api/" ...
0
bf8c621dd665ca43c75f3dde0f026e5b
b3fe0f200df12fc63e950f15fe54148e
Verify the form and type of an IssuedCurrency at runtime.
public final void verifyAmount(final String amount) throws IngenicoDeviceException { LOGGER.debug("-> verifyAmount() " + amount); if (amount == null) { LOGGER.error("verifyAmount() AMOUNT IS NULL!!!!!!"); } ingenicoDeviceEvent = TerminalEvent.AMOUNT; resetlastIOListener(new VerifyAmountDIOListener()); t...
0
00e9ec944338dcb306c9fa289ae31087
11d5cb549c2ae98429e12f1d56344303
Gets total number of send requests for time series data sent to Predix.
class CosmosMetrics(object): def total_requests(self, **kwargs): return self._metrics.list_metrics('TotalRequests', 'Count', **kwargs)
0
361ca810b9fa3abe0654be5e87831e64
4b8e84491d1ec601892a6ed0df42d3db
인터럽트 발생 여부 설정
public class MidiPlayer public void setInterrupt(boolean interrupt) { this.interrupt = interrupt; }
1
ad60d44341302446e591e6ecbaade399
059254bbeb33268e94cb50873f143864
添加一条电子围栏信息
class TrackController extends BaseController public function addStudentFence() { if (IS_POST === false) { $this->error('the request method is not post'); } $token = I('post.token'); $flag = $this->checkToken($token); if (!$flag) { $this->error('接口访问不合法...
1
b2cad32efdf12f67137628dd9780e7c1
d8162e66abf11a894d0d6539da73a021
Calculate the inverse relative distance between earth and sun from day of the year. Based on FAO equation 23 in Allen et al (1998).
def solar_declination_fao(doy): return 0.409 * numpy.sin(((2.0 * numpy.pi / 365.0) * doy - 1.39))
0
6875bba6d52d3902bb8eec2075b49ce5
22f7eb791155e70ccc5c5af3bac9365d
Compute change between first week (baseline) and all following weeks.
prev_weight_col = '{}___1'.format(weight_col) prev_stat_col = '{}___1'.format(stat_col) df = df.copy()[[stat_col, weight_col, age_col, prev_stat_col, prev_weight_col]] df['diff'] = df[stat_col] - df[prev_stat_col] df['weight_avg'] = 2 / (1 / df[weight_col] + 1 / df[prev_weight_col]) age_delta = ...
1
32f6ffa05d010f303ab618449adfd2a8
b25773fc62dfb3b82b25d1b7c7c0f193
更新ErpPrintTaskContent,erp_repeat_print_task表为已打印
public void updatePrinttimesSyncUpOrder(String id) throws Exception;
0
ea33441379ebebf9816edabb10dfee50
ca7a9204f1508773696f10ef21c2fee1
Creates a new instance of the <see cref="MySqlConnection"/> class using the provider connection string.
namespace SimpleStack.Orm.MySQL public class MySqlDialectProvider : DialectProviderBase<MySqlDialectProvider> public override DbConnection CreateIDbConnection(string connectionString) { var c = new MySqlConnection(connectionString); return c; }
1
379b7664819e4047377b4fc3a1c3b323
c67157ef6b270ea952ad79d0f9c7e4a5
Функция вычеркивания строки и столбца
{ int ki = 0; for (int i = 0; i < n; i++){ if(i != indRow){ for (int j = 0, kj = 0; j < n; j++){ if (j != indCol){ temp_matr[ki][kj] = matr[i][j]; kj++; } } ...
1
45e86aa9c11e85a39f864f8ba426eff6
32ec21c1ba8ac4ba95fc407c7bc31056
Дешифрует текст шифром Цезаря
{ var byInput = input.MapToList() .Select(c => DataSource.EncTable.First(z => z.Letter == c).Position) .ToList(); var byKey = DataSource.TASK4KEY .SpawnString(input.Length) .Select(c => DataSource.EncTable.First(z => z.Lette...
0
4d6e041ba7c3b99c6a604d95916338f3
d631e961108bdfae7c9039eca4cc4b04
商家订单状态统计
class OrderController extends BaseController public function statis(){ $sid=$this->sid; if(IS_POST){ $where = 'o.status in(1,2,3,5) and o.shopId='.$sid; $get=$_POST; foreach($get as $k=>$v){ if($k=='start'&&$v!=''){ $where.=" and o....
1
1497a452a59657e5ec8aa22c905f9464
5d0f3a342abf3da59215227a6a2bad1d
Get the command hash of the last queued command, if any.
impl QemuHsm pub(crate) fn last_command(&self) -> Option<HsmCommand> { let hart_id = riscv::register::mhartid::read(); let last_command_lock = self.last_command.lock(); let ans = last_command_lock.get(&hart_id).map(|c| *c); drop(last_command_lock); ans }
0
24ab30e3522ff7c864feb9ca827ca6f1
e2a77c1ad73430997af12a28915c0d18
Created by Tiffany Jiang on 2017-06-07 Moves a course in an existing course plan to a different term/year
{ using (var db = new SchoolEntities()) { using (var trans = new TransactionScope()) { var oldyearendDate = academicYear.EndDate.LoadValue; var newyearendDate = academicYear.EndDate.Value; academicYear....
0
513ae215b44f05eb92109ae2ab31a645
8dffd8d129b900fbf6891fe4c7f00ba0
Compute the 1D hough entropy
def _ehs(x: np.ndarray, y: np.ndarray): H = (np.histogram2d(x.flatten(), y.flatten()))[0] return -np.sum(np.nan_to_num(H * np.log2(H)))
0
5d61c36b6bfa6a1b64aa4c395c7c9b3d
281205a08e725e6773d3391e32c1bdff
找出可以排班的员工
@Service public class WorkerBfsCal public boolean findRoleWorker(JbsOrderBO jbsOrderBO, ScriptWorkerRoleBO scriptWorkerRole){ for (ScriptWorkerBO scriptWorkerBO : scriptWorkerRole.getScriptWorkerList()) { if (!hasTime(jbsOrderBO, scriptWorkerBO)) { continue; } ...
1
e2a173fe912e65c5cf92d78dd1188e0f
fa3d70a302316812c7db2860ec781aa1
根据历史记录ID修改该记录归还电脑的时间
@Service public class SecondmentService extends BaseService<Secondment, String> public int updateReturnTimeByPropertyId(Secondment secondment) { secondment.setReturned(Integer.valueOf(1)); return secondmentMapper.updateReturnTimeByPropertyId(secondment); }
0
c1d2737a7052a486025c31d53c112f99
10f94f84b208704f74890e735ef948e0
i.e. not an Activator
{ if (other.tag == "Activator") { canpressed = true; } }
0
ad710d3189bada7edcae0a3ed0989931
552459cd3209e6e2bb032959f54d65f0
Does this object need a mapping?
namespace QuantConnect.Python public class PythonData : DynamicData public override bool RequiresMapping() { if (_requiresMapping == null) { return base.RequiresMapping(); } using (Py.GIL()) { return _requiresMapping...
1
380a6068ed818755cf3755d27b458f94
bae6374cb7c16f03c21bd23d434795e3
Save photos sort
class GalleryController extends BackendController public function actionPhotos($id) { $model = new GalleryPhotosForm($id); if ($model->load(Yii::$app->request->post())) { foreach ( $item_order = explode(',', $model->item_order) as $key => $value ) { $imageGallery = ImageGallery::findOne($value); $imageGa...
1
428d3ea78d6c37676de496f99f669bf5
cd03e7771ffd3d5719560d105e53e81b
returns the graph database connection object
function getConnection() { return mongoConnection; }
0
3390adccb4975bdc9fd6161ecc2fb9d1
758f39f8044a7738514bd97f67337988
Sets the language based on URL path
{ $pathInfo = $this->_request->getPathInfo(); $parts = []; foreach ($this->languages as $k => $v) { $value = is_string($k) ? $k : $v; if (substr($value, -2) === '-*') { $lng = substr($value, 0, -2); $parts[] = "$lng\-[a-z]{2,3}"; ...
1
701456b4e00db4a2e7602b0e5e302546
8f5cc41db64a4ec8b2fcbac477f42788
Note: this is a test which checks to see if an error is raised.
def test_empty_object_name_raise_exception(): with raises(AssertionError): pu("s3://a/")
1
85c5b4833c6eb22a48ee890fec289a70
d84f8be0f0654d032c6a76f7e6754b4d
Передача автомобиля на другой аккаунт
{ $translator = $this->container->get('translator'); $dm = $this->get('doctrine_mongodb')->getManager(); $car = $dm->getRepository('AGCarBundle:Car') ->find($id) ; if (empty($car)) { return new JsonResponse([ 'success' => false, ...
0
7a8d8677a11123c9337003fdd4c68ab5
b63ad688caf27435e39ac3057c3c72e2
Test invalid timestamp in one of the transactions.
class TestOrder(BaseTestCase): def test_get_order_details_invalid_timestamp(self): CommonTestCases.attendant_token_assert_count_equal( self, order_url + '/15589026584901223987989287879287987', expected_response_get_order_details_invalid_timestamp)
1
83c3b837b3d223fe281b97c155f46d18
5e5463f6c6e70337f634eeeb5363b529
Returns the value of the '<em><b>Ent id</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Ent id</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
String getEntType();
0
71c69c801ce0dfbd9db73a4d8122549b
28734860ffb97703fcf3b976985352fb
获取响应数据并转换为 json 数据
class Responses: def jsonify(self): try: return json.loads(self.__response.content) except JSONDecodeError as e: logging.error("发生异常:原因:{}".format(e.msg))
1
06c8959f025a36849b9ed00ab92e4ea7
084f990931eea2a08b993fe9de0aad73
Медиаконтент клиента в постах музыкальных групп
{ $file = request()->file('video'); $mimeType = explode('/', $file->getMimeType())[1]; if ('mpeg' != $mimeType && 'mp4' != $mimeType && 'ogg' != $mimeType && 'quicktime' != $mimeType && 'webm' != $mimeType && 'x-...
0
a58c8556c68fad21992fb17b5c2e1cf8
972169c69a43f6824a0037819c6d3ada
Obtiene el estado de una comprobación. Si no existe la comprobación, asume falso
namespace WCFServicePQR public class wsRecaudo : IWSPQR public bool obtenerEstadoFacturacion(long nuIdCuponPago) { DataTable dtEstadoFacturacion = new DataTable(); int nuIdPais = 57; int nuIdDepartamento = 76; int nuIdMunicipio = 834; string lugartrabajo = nuIdPais.ToStri...
1
506eb1f4b9e4ea6d86fc4f719d4b201e
486a34e07ecb2cab84349680a99eff48
Build custom ec2.ini for ec2 inventory script to use.
class EC2InstanceManager(object): def _gen_ec2_user_data(cls): user_data = "#cloud-config\n" \ "apt_update: false\n\n" \ "apt_upgrade: false\n\n" \ "runcmd:\n" \ " - chmod 777 /tmp\n" \ " - echo \"s3://%s:%s@%s/n...
0
b94e0ffa4e326824cef490ccad410472
d792cbc42c425ae9c06126e92d2c6ca6
Format the achievement in to a single line
public String toString() { return "Your private achievement is: " + this.color.toString(); }
1
4da8f69a0ad9cdfbdd88c00a3ad352dd
71219dcd6d2e567752f8270497117e60
@brief スペキュラカラー0設定
for(Int32 i=0; i<index_size; i++) { index[i] = i; } if(color_number < 128) return; BYTE *tmp = (BYTE *)malloc(color_number); for(Int32 i=0; i<color_number; i++) { tmp[i] = i; } if(color_number == 128) { memcpy(index + 0, tmp + 0, 16); memcpy(index + 16, tmp + 32, 16); memcpy(index + 32, tmp + 80, 16...
0
26787e2d27a7204df9f620a527b8278f
ebbf9a7677a69d9476f418e7176ef8ff
Invokes helper method to clear all cached OpenMRS locations
@Service public class OpenmrsLocationService extends OpenmrsService public void clearLocationsCache() { fetchLocationsHelper.clearAllOpenMRSlocationsCached(); }
1
ef98b760ddf6fe627321d37dc3203c5d
3422b81c5cb55abacfd1e05826b0d91a
Override this method and call [KProperty.alias] to set alias for model property. But you should not read property's value in this method, because this method is called by init block, when you read a property, it may not be initialized.
class LanguageModel extends ActiveRecord public function init() { parent::init(); $this->logConfig['nameField'] = 'alias'; }
0
f8d89826b1a06064534219202fbe18c4
f2cb82008bef00f075a8f9a2d350a885
@brief Test the storage capabilities of a single node <description> Will whether the node can hold a value. The value can be changed. The Left and Right Child nodes can be access, changed and removed. </description>
assertEquals(first, node.getFirstPair()); assertEquals(second, node.getSecondPair()); node.setLeftChild(child); assertEquals(child, node.getLeftChild()); node.setRightChild(child); assertEquals(child, node.getRightChild()); node.setMiddleChild(child); asse...
1
aaf5b324fb207b82749ef9b485babc9f
fb5558f0dc9f7189bd947c615ba31499
Flushes all elements in the list
void CLinks::Flush(BOOL bDeleteAll) { if(bDeleteAll) { m_NextPos = GetHeadPosition(); while(m_NextPos != NULL) { CLink* pLink = (CLink*)CObList::GetNext(m_NextPos); if(pLink != NULL) delete pLink; } } RemoveAll(); m_NextPos = NULL; m_PrevPos = NULL; }
1
77259cde130ba69ae50047fdada5dd4c
1075e3aa4c18f641c91d5b8f121602c1
Calls view model method to populate data grid.
{ OrderInfoRepository order = new OrderInfoRepository(); List<OrderInfo> orderDetails = order.GetOrdersDetails(100); this.sfDataGrid1.DataSource = orderDetails; GridViewDefinition orderDetailsView = new GridViewDefinition(); orderDetailsVie...
0
3a1cc0d8906d32d30b8ecece08ae9bcd
2bc1e3182cee9001368e36608b66ebeb
Indicates if the implemenetation has a native underlying theme
namespace EarLab.Utilities internal sealed class NativeMethods [DllImport("uxtheme.dll")] public static extern int IsThemeActive();
1
dde37b18377ecca48da73d45a8d1c3e4
81b818b0f37c7c9f3044965ca8ad255f
マップチップを左右反転
{ if (ren.flipX) { ren.flipX = false; } else { ren.flipX = true; } }
1
f4614562e774afcfa05e17e586eac73f
a930fbc2a02628df639a5ee24179ebe3
r"""Instance-Batch Normalization layer from `"Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net" <https://arxiv.org/pdf/1807.09441.pdf>`
self.params = BatchNormalizationLayerParams(in_dim, init_bias=init_bias) self._param_id = self.params._param_id self._res_mean = None self._res_std = None
0
b4ce64554372de6d4d2c017654ea50b8
e531db50ca1b3e9f6130eea751057e48
Deletes all contents of a directory without deleting the directory itself.
public class FileHandle public void emptyDirectory (boolean preserveTree) { if (type == FileType.Classpath) throw new GdxRuntimeException("Cannot delete a classpath file: " + file); if (type == FileType.Internal) throw new GdxRuntimeException("Cannot delete an internal file: " + file); emptyDirectory(file(), pres...
1
e5920b220f79f5ff65b4a50b03f60512
e241b8098a33c4213a764471f263184b
clamps position values (useful immediately after values have been changed)
{ o.x = Mathf.Clamp01(o.x); o.y = Mathf.Clamp01(o.y); return o; }
1
4e88929c1cf6fd293a06d1998f13ff05
66b917302d8a5e4eba9a208fcb957446
特殊文件的尾部识别
{ char *src = s_filename; char *begin = NULL; char *end = NULL; char *suffix = s_suffix; char key[] = "."; int suffix_len = 0; if (s_filename == NULL || s_suffix == NULL) { LOG(GET_SUFFIX_MODULE, GET_SUFFIX_PROC, "s_filename == NULL || s_suffix == NULL"); return -1; }...
1
cafb761b73e3430643cffc60a83a849d
fb84dd043030668c6c81dc25ed88570b
判断试卷是否以及被修改
function reeditPaper() { var status = $('testPaperInfo.paperStatusName').innerHTML; if ("已批准" == status) { if (!confirm(getMessage('js.tt.warn.JYW05'))) { return; } } else{ if (!confirm(getMessage('js.tt.warn.JYW04'))) { return; } } showLoader(); va...
0
35355288396d30fd92dc52cd456ad302
1b6ce89342632b19b9b44decd0307330
创建并关闭一个数据发布者的测试
{ auto info = ::testing::UnitTest::GetInstance()->current_test_info(); std::ostringstream ss; std::string test_case_name(info->test_case_name()); std::string test_name(info->name()); ss << test_case_name << "_" << test_name << "_" << GET_PID() << ".db"; std::string db_file_name = ss.str(); {...
1
d7df0fe04734b0ba5b069df622bb6b0e
15407debff0b8b73d3383307d016001f
To prevent rehashing in case of crashes, we explicity save the list of hashed files here.
class FileCacher: def __init__(self):self.out = []
0
67993fc62986b99edd3bba8882f1ee0d
94152a6af06292d569697d1d26331202
this function determines if the vector is a null vector. this is rather tricky. we cannot be sure that the computed magnitude is exactly zero (it never is). it is only numerically zero. best option, if available, is to use some system defined exception condition for division by "zero". if it were available, then we cou...
bool matVector2D::is_zero_vector() const { return IS_ZERO(get_norm()); }
1
fc0cfdc42e0bed2659bc6c5c4e87dfbe
a3ffa08944b82389fbb9aafeec621623
Notifies observers waiting for loop to fully stop.
self.notify_all() if not self._loop_thread: return assert self.loop is not None shutdown_loop(self.loop) self._loop_thread.join() self._loop_thread = None
1
6e592b7eb683dc634cb253bc2e564638
a289cc661c3774bc3b9c5359f0d51f3a
When code generation is done and we're ready to start execution, the code pages may need permissions changed.
void MachineInfo::FlushPerExecutionCaches(void) { if (!IS_DUMP_TARGET(m_Target)) { ZeroMemory(m_PageDirectories, sizeof(m_PageDirectories)); } m_Translating = FALSE; }
0
7f9df5c60f403dc4d0f84f9e29928fe6
c186dbe531732eb72f13c03154d8462c
Stop accepting new connections, while the individual services quiesce and shut themselves down.
public class HardScheduler extends AbstractDefaultScheduler implements InterfaceWorkerAwareScheduler public void stopAccepting() { synchronized (this.stateMutex) { if (this.isShutdown()) { return; } final int acceptStatus = this.acceptSchedulesStatus; ...
1
62a0c764c8bc3e75a55c4853f6291fab
771d821e0406f5d1602e55c5c37ced96
BuildFastbitExecRequest builds a Fastbit request in JSON
sq := []string{} if desc.Id != "" { sq = append(sq, fmt.Sprintf("+Id:%s", desc.Id)) } if b64encode(desc.Uri) != "" { sq = append(sq, fmt.Sprintf("+Uri:%s", b64encode(desc.Uri))) } if desc.Name != "" { sq = append(sq, fmt.Sprintf("+Name:%s", b64encode(desc.Name))) } if desc.LinkSrc != "" { sq = append(sq...
0
e18081fa1c47772090dbabcdb5166e36
51fb5b8942bd484dce3e247c31226cb4
Test that there is a data point for every month for the dates returned in the data frame.
self.assertEqual(list(self.data["time_series"]), [[(10, 11, 12), (21, 22, 23)], [(15, 16, 17)], [], [(31, 32, 33), (41, 42, 43), (51, 52, 53), (61, 62, 63)]])
0
8f87f0982e7d04901e4bdf20e2feacac
317557392f9aa2fbd19ebdbefec3644e
获取指定药品在库存明细表可用的最新的系统批号
namespace FCake.Bll public class KitchenService public string GetNextBatchNo(string currentBatchNo) { var result = (from x in context.OrderBatchs.OrderBy(a => a.RequiredTime) where x.IsDeleted != 1 && x.MakeStatus != OrderBatchMakeStatus.Comple...
0
f8aeacd4040e4dc173bb6792267a808c
311741f00925d7a51f23d5d0489a1e6a
stop at conv3
class AlexNetConv4(nn.Module): def __init__(self): super(AlexNetConv4, self).__init__() self.features = nn.Sequential( *list(alexnet.features.children())[:-3] )
1
2e21678d34e434b669002f805b2513bb
75591dbac57dca1d512281b969ae4478
Receives input key and returns json schema
def get_schema(input_key): return json_schema_map.get(input_key)
1
d6d040b7bb5b0fe342b3973c6f5929e0
00c7d675f395ae8d1a3368f0bff205ad
Retrieve relations from a set of tokens using this clusters extraction pattern
Maybe<NERTag> entityType, Maybe<String> relation, Maybe<String> slotValue, Maybe<NERTag> slotValueType, ...
0
9ebb63b076110d6bffe487953c812007
22a80278cd6f274025c8e1ec18de7c6f
查询商铺的单个菜品信息
$disheslist = Db::table('t_admin_food_dishes') ->alias('a') ->field('a.f_id id, a.f_icon icon, a.f_name dishesname, format(a.f_price,2) price, a.f_tastesid tastesid, b.f_cname classifyname, c.f_cname cuisinename,a.f_desc as food_desc,a.f_salenum as salenum') ->join('t_food_cl...
0
32f52f04376b0f66373d80df28cf94b6
4d6cb84a892c412d1637bc6c31a7e0ce
Возвращает путь уровнем выше, если в конце был указан ".."
for (int i=_path.size()-1; i>=0; i--) { if (_path.substr(i,1) == "/") { return _path.substr(0,i); } } return _path; }
0
86f837dcf8ec069861de49ade777b87f
028f19697b535340884c33f7444049c9
Overloaded << operator for an Account to print out the account details
os << accountType_ << "\n"; os << accountNumber_ << "\n"; os << sortCode_ << "\n"; os << creationDate_ << "\n"; os << balance_ << "\n"; os << overdraftLimit_ << "\n"; if ( ! transactions_.size() == 0) os << transactions_; return os; }
1
7d6d1eb8d9267b6e15c9cef6dcb1c0bc
685bdc4d4120d7ab9105a144a4325fd0
Returns the right-click context menu for an object.
bool __stdcall EMETreeHandler_Default::GetContextMenu_Object( GBCExplorerTree & rwTree, HTREEITEM hItem, CMenu * & rpxMenu, int & rnSubmenu ) const { bool bReturn = GBCExplorerTreeHandler_Default::GetContextMenu( rwTree, hItem, rpxMenu, rnSubmenu ); GDMId_t nObjectId = rwTree.NodeObjectId( hItem ); ...
1
72cede0cfff1cda389dd2608e9737fb0
623afa8c1b7d42eb3585050ab1bca495
Ping command with actual ping time
cmd = "ping %s -n %d -l %d -w %d" % (target_ip, num, length, timeout_ms) p = subprocess.Popen(cmd, stdout=subprocess.PIPE) err = p.wait() res = p.stdout.readlines() res = [x.split(' ') for x in res if x.startswith('Reply from')] res = [[t for t in x if t.startswith('time')][0] for x in res] ...
1
5fc732faca44c67337461ec9c2a68485
8206edc8da6312ebdfcad322f5921175
Преобразование из одномерного массива пикселей в матрицу, в соответвии с размерами картинки
def convert_array_to_pixel(arr, path1,path2): width = 20 height = 20 pixels = [] for i in range(1, len(arr)): line = [] for j in range(1, len(arr[i])): if arr[i][j] == 'g': line.append(GRAY) elif arr[i][j] == 'b': line.append(BLUE) ...
0
a62a20f99735f766c722fd171e0366f9
398803fc1d872ab446eb6f46c5b49e80
функция вывода класса стилей для новых отзывов и комментариев
function dg_add_styleselect_classes( $init_array ) { $_style_formats = array( array( 'title' => 'Sans Serif Font', 'selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', 'classes' => 'font-sans-serif' ), array( 'title' => 'Serif Font', 'selector' => 'p,h1,h2,h3,h4,h5,h6...
0
bf77f79795315689427bc60e7b542df3
82b0f6cfd5e50d13b0e0e32a0ffd04c4
到活动开始时间的倒计时
function countactDown() { let newTime = new Date().getTime(); let packendTime = that.data.packendTime; if (newTime && packendTime) { if (packendTime - newTime > 0) { let time = (packendTime - newTime) / 1000; let hou = that.t...
1
c04d91ab1a7a9b22b9e20d1641c2d1e4
9d9aa44b4b76e2e7d02ebe480bbcb496
リザルト用のキャンバス非表示
public class StageManager : MonoBehaviour private void DisapperStgCanvas() { stgCanvas.SetActive(false); }
1
1722ef4c82e946bd539594e38a8bafe5
6652e2bab4328af154c7c630b3e31af5
Initializes this Name from an associative array
public function fromArray($array) ;
1
71bff4fe374ef274da63e93ce2a6ef16
5c615721bdbaf71b5bdedf54bca73528
Gets the regional settings that are currently implemented on the website.
public class RegionalSettings extends Configuration<RegionalSettingsEditorForm> public Locale getLocale() { return locale; }
0
5172e8a3823b54af87497b2ba683afc0
0a3d1e4e56e6f9ae4c0b50017429f495
Set a new RNS for the service times.
class RiakBucket(object): def set_r(self, r): self._r = r return self
0
09c633687617a1c352cc2291ff115188
d7cbdfb9fe40901bae560c355b069104
Refresh packaged volumes for all ship fits.
def update_types_repackaged(types): for t in types: rpkg_volume = get_repackaged_volume(t['groupID']) if rpkg_volume > -1: t['repackaged_volume'] = rpkg_volume
1
dc08fdfc0e68452a531c8d9e8442fdd4
e81a4820dcc1018b51a9369c51cd23f6
Validate parameters provided to configure Lambda Urls
function validateConfig(connector, configParams) { let fullResourceUsageDataset = (configParams && configParams.resourceUsageDatasetID); if (!fullResourceUsageDataset) { return connector .newUserError() .setText('The resource usage dataset ID is not specified') .throwException(); ...
0
c1c5c2da055ebe548994a4b4c03469b9
3ec982cfccaa32f2f3af226267bb2c9e
A simple encoder to be used in denoising feature matching.
class Encoder(object): def __init__(self): pass
0
55ea8ddd475c04630385b6ef7b0170de
ac9a5ff0abcd5b40eda08c78379b2117
Check that the secondary directional coordinate weight can be set
class msmoments_test1(unittest.TestCase,msmoments_unittest_base): def test103(self): moments=[2] postfix='.weighted_dispersion_coord' refval=[95.011787414550781,95.257194519042969] res=msmoments(infile=self.rawfile,moments=moments,outfile=self.outfile) self.assertTrue(os.path.exi...
0
f077af0331bf413a54fde1ba92a08a71
bbe277170abc10c1cd5ed7538f82b756
Removes the wheat object.
public class Winzer public void removeWeinberg(Weinberg weinberg) { weinberge.remove(weinberg); }
0
c9c69454c5df1f045b4fbde544a783bc
d27a625949617ff73bdb23ae848b3ea7
Set status of all scenarios to pending - later we will only update the status of scenarios we actually run
db.create_all() pending_status = find_or_create_status(u'Pending', u'Pending') cancelled_status = find_or_create_status(u'Cancelled', u'Cancelled') accepted_status = find_or_create_status(u'Accepted', u'Accepted') rejected_status = find_or_create_status(u'Rejected', u'Rejected') completed_status...
0
732947da668a98a351518ab6b1bc2f41
45bc28404517255e379fdc6eaa76246e
Instanciate strawberries around the tree.
{ for (int i = 0; i < NumCarrots; i++) { Vector3 pos = new Vector3(Random.Range(-MapRadius, MapRadius), -7.0f, Random.Range(-MapRadius, MapRadius)); Instantiate(Carrot, pos, Carrot.transform.rotation); } }
0
62bbdc8de618d0c5b5c4fbacb6432b79
fcc1a2b1675ceec2eecc49ee0b98930e
获取实现类的执行方式
class ConfAction extends AbstractConfAction protected function getMethodType() { return self::EXECUTE_TYPE; }
1
d3d9752a450604d1ea555ce4bead5c69
89adc208ec48296d1982a0b99502210f
获取所有用户发布的文章列表
public List<String> getAllArticle(String userID);
1
9d4f64b5ae30598a961060dca5210f60
39b4e0d0501126d423c5b9797842d46a
Associates a biosequence reference to the probe.
assert refPos >= 0 and refPos < len(refSeq) self.refPos = refPos self.refSeq = refSeq assert readPos >= 0 and readPos < len(readSeq) self.readPos = readPos self.isReversed = isReversed self.readSeq = readSeq self.pPair = pPair
1
430037d0e0433e80450db9199adb72c9
c1f582b45b2b41527d9eb8c4b9ecd537
Constructs a <see cref="Controller"/> with the given <see cref="Configuration"/>.
namespace OpenMessage.Apache.Kafka.Configuration IKafkaConsumerBuilder<TKey, TValue> FromConfiguration(Action<KafkaOptions> configuration);
0
8222b978cee04ff9b0b589f53781adf0
9ef32a71ba813c12ca39663266c519e3
RegisterExperiments request handlers.
def init_app(app): app.register_blueprint(views.experiments)
1
ed7df6f14bf6ff25976bd5ecf94dc80a
11c4535167df2c81f241803b48d25413
Tests if two WorldInventories are equal
if not isinstance(other, AbstractInventory): return NotImplemented return self.contents == other.contents and self.decay_data == other.decay_data
1
cc49671b2708c356dc7168517b7532f0
4d2cf6a79c39e65360f551f30db697b5
AI任务状态变化事件处理
{ if (false) { using (var ctx = new AMSContext()) { List<t_AGVWork> agvWorks = ctx.t_AGVWork.ToList(); if (agvWorks != null && agvWorks.Count > 0) { foreach (t_AGVWork tAG...
0
30567c93d192fdb80a9fc6cff0c0c9af
965627183a4e80262ef8e6f0935e87d7
The certificate file to upload that must be encoded in Base64
try : return self._certfile except Exception as e: raise e
0
f5a0968b5f597f538df512df72d95ece
d3146695b6f11954891faea7ecb7ca6f
Populates the LFP tables.
const promises = []; promises.push(this.populateAuxiliaryChainTable()); promises.push(this.populateGatewayTable()); promises.push(this.populateContractEntityTable()); await Promise.all(promises); }
1
0ba9b921772bca712721479c11e137a6
c00d72cfac63d878240718e89d627a62
Creates a dropdown showing the different charts that can be created The values of the options are a JSON string that give the proper fields to call the action AddToDashboard in the charts controller.
class ChartsController extends Controller public function create() { }
0
2f13a6279b84a10d5c0dc3761e0b2c3f
bed0e723fd9947b4573eef918465be84
调用存储过程stat_iuni_bpdata_daily
{ $stat_start = strtotime(date('Y-m-d')); $stat_end = time(); $this->_dailyDataStat($stat_start, $stat_end); }
0
5c20a70ac01a9ea515027e7f007c9990
f0b5432e6886818299cb721e678b0b50
Method to delete group(s) using CMC REST API.
$method = GROUPS . "/$idgroup"; $verbmethod = "DELETE"; $params = array(); $params = array_filter($params, function($item) { return !is_null($item); }); $response = json_decode($this->zyncroApi->callApi( $method, $params, $verbmethod), true); return $response; }
1
d98cc2e5878b0abc7cde0753ce90332c
62794d709eb55794261c78d759f22a14
Set the created property: The time of creation of the API key.
namespace Amazon.APIGateway.Model public partial class ApiKey internal bool IsSetCreatedDate() { return this._createdDate.HasValue; }
0
4bcfb72e9c90f9441e8a5cc17e0c96b5
0ff44a9e380509a5e19c4a93060627c7
设置商品缩略图高度 商品缩略图高度
public class Setting implements Serializable public void setLargeProductImageHeight(Integer largeProductImageHeight) { this.largeProductImageHeight = largeProductImageHeight; }
0
bf380b9ea74add575ca4c5d587191bfb
8986e549da0274c661e9d706ddcb6437
convert vacuum wavelength to air wavelength, taken from Kurucz' synthe
def vacuum_to_air(wavelength): s_square = np.power(1.e4 / wavelength, 2) n = 1 + 0.0000834254 + 0.02406147 / (130 - s_square) + 0.00015998 / (38.9 - s_square) return wavelength/n
1
21b247817e34641b42b94b59c2aa120b
d4a4e2383cb4ed1db9f669fbd48e0a27
Sort function to sort a list of pairs in descending order
int compare(const void *ind1, const void *ind2) { return ( ((pair<int,int>*)ind2)->second - ((pair<int,int>*)ind1)->second ); }
1
99977c9698e6e37ea3ca74cc1b882976
494d07d78e2449566d9b55acabf711b9
Test removing a result folder
cmds = """pwd ls exit """ def _cbCheckResult(res): res = res.split('\n') log.msg('RES %s' % str(res)) self.failUnless(res[1].find(self.testDir) != -1, repr(res)) self.failUnlessEqual(res[3:-2], ['testDirectory', 'testRemoveFile', ...
0
0246e1dca53d8d1b0edc583a55a030b9
f11d2e7e6074d07b786288aff21c7204
得到时间字符串(时:分:秒)
public class Tools public static String getStringTime(Date date) { SimpleDateFormat formatter = new SimpleDateFormat("HHmmss"); return formatter.format(date); }
0
28e39dba11c2b9946b39027ed01e312e
17fbdacaf4865abfdc43834972d1c470
Parse XML This method creates a SimpleXMLElement based upon the XML input. If the SimpleXML extension is not available, the raw input will be returned unchanged.
set_error_handler(function($errno, $errstr) { throw new Exception($errstr, $errno); }); try { $oXML = new SimpleXMLElement($sXML); } catch (Exception $e) { restore_error_handler(); return NULL; } return $oXML; }
0
a46619cf747487505bf99588af1d254b
b23280322edc67aecac4ce517e934b3d
Get maximum number of results to show
class Container extends \Bliss\Component public function getMaxResults() { return $this->maxResults; }
1
09fab25fc5e8ff658ed332f845ed2fa6
cc9b01525277634321a70dc00710461b
Function that passes out information to observing crewmates when the current crewmate enters
{ if (!relaunch_crew->GetCrewEnabled()) { relaunch_crew->SetCrewEnabled(true); SetCursor(relaunch_crew->GetOwner(), relaunch_crew); SetPlrView(relaunch_crew->GetOwner(), relaunch_crew); } EjectCrew(relaunch_crew); PlayerMessage(relaunch_crew->GetOwner(), ""); OnRelaunchCrew(relaunch_crew); RemoveObject(); ...
0
8b3fff3bd7a44b902120317a8576d55c
87c4be9757554be862f8f73cc76b8d70
图片响应数据
class WeixinApiController extends Controller public function responseImage() { $message = array( 'type' => 'text', 'data' => '平台已经收到你的图片', ); return $message; }
0