query_id
string
corpus_id
string
query
string
code
string
label
int64
56eabb16ce4dffc36be27a81ed60899f
4116355838c869c78424d9541130e424
设置采购员信息
export default class AwaitSalePurchaseOrderList extends PureComponent handleChangePurchaser(value) { const { dispatch } = this.props; dispatch({ type: 'awaitSalePurchaseOrderList/updatePage', payload: { purchaserId: value, }, }); }
1
7c0e4023480bba136dd58e998618f2b4
48754a5af3947ef456fc2908d765529e
Показывает командную строку.
namespace SortRESX public static class Program private static void ShowHelp() { var sExeName = Process.GetCurrentProcess().ProcessName; Console.Error.WriteLine("Command line format"); Console.Error.WriteLine("{0} <input resx file> <output resx file>", sExeName); }
1
7b9843b6a046f238011851bce3ef4683
8b622d28dac9db5ba85b2e66773954f6
Unload the SCAN configuration.
ap_flush_scantable(struct ieee80211_scan_state *ss) { struct ap_state *as = ss->ss_priv; struct ap_scan_entry *se, *next; int i; IEEE80211_AP_LOCK_BH(as); for (i=0; i<IEEE80211_CHAN_MAX; i++) { TAILQ_FOREACH_SAFE(se, &as->as_ht_list[i].asl_head, ase_list, next) { TAILQ_REMOVE...
1
9c232f9fba67d70e46d45f31831e489e
5b9ba79a28219475e6202e681cbb5b1f
Records a writeup submission
def add_submission(config, event, team, submission, path): config = read_config(config) with session_scope(config['sqlalchemy']) as session: submission_module.add_submission(session, event, team, submission, path)
1
6db3e1cedc9211446bd65dfb75a22141
590de3e73d371c3d0a0d331674357fe8
Number of datasets.
class DataIteratorBase(object): def num_datasets(self): return len(self._datasets)
1
d74281b3ac727b917ab0ef422f725214
8364722c00f8aecadebf602abdf02cea
获取学员家长信息
class Auth_parentModel extends Model{ public function getParentStudentData($id,$school_id=0){ if($school_id!=0){ $condition['auth_student.school_id']=$school_id; } $condition['auth_parent.id']=$id; $result=$this->model->where($condition) ->join('auth_student_p...
1
66e69ee184255eaf1f9fcb511a22a960
c4004df7cad40d591bd179a12c9b6094
功能描述:判断文件名是否是补丁文件 参数:文件名 返回值:bool
$file = fopen($filename, "rb"); $bin = fread($file, 2); fclose($file); if(trim($bin)=='')return false; $strInfo = @unpack("c2chars", $bin); $typeCode = intval($strInfo['chars1'].$strInfo['chars2']); if($typeCode == 55122 || $typeCode == 8297 || $typeCode == 8075 && substr($filename,-3)!='.rp' |...
1
e46a0d9371a2e41d8e8178e21a7a56f9
75486797da9aeb8e590af83d5aae7eac
Calculate a telescopes approximate limiting magnitude.
if isinstance(mag, (int, float)): pass else: mag = np.array(mag) return 10.**(-0.4*(mag-zpt))
0
2a0934f6a59aa02ef1b15814379bf2cb
464795134804675213fed33ac1c2677e
Add multiple floors to building
{ for (int i = 0; i < m_MaxActiveFloors; i++) { AddFloor(); } }
1
a8b83eecf81e5a9e14d2b4efbd9fe6c8
d65e74fa34c12510dbb6177e3cb25d72
Получить перечисление значений на основе элементов двумерного массива
[Serializable] public partial class Matrix : ICloneable<Matrix>, ICloneable<double[,]>, IFormattable, IEquatable<Matrix>, IEquatable<double[,]> [DST] private static double[,] GetElements(IEnumerable<IEnumerable<double>> ColsItems) { var cols = ColsItems.Select(col => ...
0
4ddd6e3067f849cf93dfed6b2d673341
737bd341b651e7edff8f207ea6916fbc
Swap two cities.
{ int r1 = rand() % CITY_SIZE; int r2 = rand() % CITY_SIZE; while (r2 == r1) { r2 = rand() % CITY_SIZE; } int temp = cityList[r1]; cityList[r1] = cityList[r2]; cityList[r2] = temp; }
1
6c756019a4232e236e789a40718f8541
5f63903e3edbb5377a6ebf80bb7d0b5f
Registers a new OAuth consumer application with the provider.
namespace Dora.OAuthServer Task AddAsync(string clientId, string userName, IEnumerable<string> scopes);
1
3a326fe5b14b77f3b1dcfe39806a53c5
0a29b5c7f095981e045de0e523cd4c4f
Return true if the file is a socket.
st = self.statinfo if not st: self.restat(False) st = self.statinfo if not st: return False return S_ISSOCK(st.st_mode)
1
e128135326e007380ce4c24a60e6ad40
75366420e32dc6a1100f7ab16ac06f0f
Returns number of answers for every time period
class Collection(object): def get_answers_num(self): answer_urls = self.soup.find_all("a", class_="answer-date-link") return len(answer_urls)
0
4885b6891f54e8958675f38e7f7a6725
e4e542e05e457b37ae8edf81d978fd9f
Returns the thousands separator as configured in the current user's settings.
char do_thousands_sep() const { return ','; }
0
a2d8499c9865f9e460acde8955d60a08
c681409a2364c18cd89b272ad04990c5
# Render a ticket creation date.
{ if ($this->date !== null) { $this->options['title'] = $this->date; echo \CHtml::tag($this->tag, $this->options, '&nbsp;'); } }
1
7877a7cf52592892cd8b4c8b4ce4173f
7f2235edcb924a078361a087b1ea024a
Returns the speed of a ship type
namespace Continuum.Weapons int GetSpeed(int level);
0
4b217cb0508e3f5c35676ca511145414
96577f950d07b39f2478bd8c6ad48f7a
Get endAt
class Maintain public function getEndAt() { return $this->endAt; }
1
d4950e9825d72d221c170da626bd8d5c
5bc57450b0f26df89eaa5e815c895b17
Metoda obslugujaca zmiane w polu tekstowym z maksymalna liczba egzemplarzy zasobu.
{ int temp; bool cos = int.TryParse(IloscKopii.Text, out temp); if ((IloscKopii.Text != "") && (cos == true) && (temp < 10)) temp++; IloscKopii.Text = temp.ToString(); }
1
559c48b0d35949e32d5fe0bfed7ae58f
7b1e1b07e10bbdff34f85d7f17bbe606
Tests the analyze_cron method.
class AppTest extends TestCase public function testHookCron() { $object = $this->getMockBuilder(App::class) ->setMethods(NULL) ->disableOriginalConstructor() ->getMock(); $output = $object->hookCron(); $this->assertTrue($output === NULL, 'Cron function exists and does not return anything.'...
0
a8df58e8e50851e307d0f8c2cda03bb2
c9963a37cd70369daefc3840221bc9d3
格式化Variation的First_pic_url及RelationshipDetails、删除公共variation specific数据
class Cart public static function formatRelationData($data, $skuNo, $return, $baseParams) { if (empty($skuNo)) { return $return; } $jdsrkey = \ProductUtils\CartSetting::JDSR_PREFIX . $skuNo; $jdsrBasekey = $baseParams['jdsrBasekey']; $jdsr = array(); if ($...
1
d77a5a7046f20f4ebc1900cbddbdb44b
05faf1747eddeec5f77fe34d94523c82
Returns the width of tiles in pixels
class Circuit: def get_tile_width(self): return self.tile_width
1
8de7d01a942435e95d06ecca46a162d4
9fe45c2215fd5589f54c8884c604d3f9
Creating a new subscriber populates the correct data, and sets the subscriber's account inactive.
public class EntitlementPolicyAdminService public void addSubscriber(PublisherDataHolder holder) throws EntitlementException { PolicyPublisher publisher = EntitlementAdminEngine.getInstance().getPolicyPublisher(); publisher.persistSubscriber(holder, false); }
0
c239cb77c7cc4eda1621e957889a5df3
46544d3155ba8f62bf01e6adf979cbef
水位线性插值
List<Date> times = this.getDataInfo().getTimes(); int tnum = times.size(); if (t.before(times.get(0)) || t.after(times.get(tnum - 1))) { return null; } List<Double> ivalues = new ArrayList<>(); double v_t1, v_t2; List<Double> v_t1s, v_t2s; for ...
1
f0ae46ec7ceb99ddfc528b59e6257e8a
5fd8426f321bdca7e70f0ea061379eeb
Gets all listeners registered for getting suspend/resume notifications.
Collection<TrainingListener> getListeners();
1
4e2a158b9820e73717fbc7d1f6f698e2
a8eb86597f63e9cd087afb5a4197d64d
检查空字符串,或者" "字符串
if (str == null || str.length() == 0 || Pattern.matches("\\s*", str)) { return true; } return false; }
1
cdccd0e54ed5f40e706b24bb0077009c
ca85f3e031c19ee8d2724e0c349a129c
判断上次登陆的时间信息
@Component @Transactional public class WwzService public Object getlogin(String custid,String fromUserid){ HashMap<String, Object>whereMap=new HashMap<String, Object>(); whereMap.put("custid", custid); whereMap.put("fromUserid", fromUserid); DBObject db=baseDao.getMessage(PubConstants.USER_USERLOGINDETAIL,...
1
a9317dd9bda277f2da57b946e4b70ba2
cce0c3df76031aaa8904fdafee823214
Sorts the elements of this sequence in ascending order according to a key.
namespace System.Linq [H5.Convention(Member = H5.ConventionMember.Field | H5.ConventionMember.Method, Notation = H5.Notation.CamelCase)] [H5.External] [H5.Name("System.Linq.Enumerable")] public static class Enumerable [H5.Template("System.Linq.Enumerable.from({source}, {TSource}).thenBy({keySelector})")...
1
9b60a8ee35298e8fe788ffcea0fabc58
92d81854f1d5f2e787d1131f1ae68bc2
we need to clear Sites' cache, because after post_migration signal, there's some junk in the cache that prevents from adding comments (the site in CACHE is not a real Site)
if ( 'as_website' !== get_post_type( $post_id ) ) { return; } $url = get_post_meta( $post_id, 'website_url', true ); if ( empty( $url ) ) { return; } delete_transient( 'cached_site_' . $url ); }
1
24dadfc06d0905c9d4be683a7a098184
519767e69fed3f072cbb2147ac13a81a
检查一系列IP地址的有效性,分隔符为','
class Utils public static function generate_rand_str($len = 32, $seed = '') function is_valid_iplist($iplist) { $iplist = trim($iplist); if (strlen($iplist) > 0) { if (!preg_match('/^(([0-9]{1,3}\.){3}[0-9]{1,3})(,(\s)*([0-9]{1,3}\.){3}[0-9]{1,3})*$/i', $iplist, $matc...
1
57245425f7ad558cfe49682f6a946b80
64f1e399cfd62679b2a7abd2c6f7bd21
bool: Flag indicating whether to back up the geodatabase schema.
class PgSQLSyncParameters(SyncParameters): def redo_base_backup(self): return self._redo_base_backup[0]
0
ea7d20d66a5b1afe09bbf32463ec8b20
5b7572fefcb8b1c724ae5201d977fcf4
produces the list of athletes that had less than the given number of shooting rounds set on the competiton.
namespace OrionsBelt.DataAccessLayer IList<Tournament> SelectByNPlayersToPlayoff ( int nPlayersToPlayoff );
0
6a08769c481bfc338b47d6c98b4f3cd8
d0677b86e29ff3567d283a9ac84845d8
Getter do atributo $parametrosRelatorio
namespace BNE.BLL public partial class AuditorPublicador // Tabela: BNE_Auditor_Publicador private List<SqlParameter> GetParameters() { List<SqlParameter> parms = new List<SqlParameter>(); parms.Add(new SqlParameter("@Idf_Auditor_Publicador", SqlDbType.Int, 4)); parms.Add(new SqlParameter("@Idf_Usuario_Fili...
0
7b8de31526291d7cb30dfb6434d904ac
d6b7484f002e1c5450731a839675aafe
Handles the Click event of the allToolStripMenuItem control.
namespace TestNET5 public partial class Form1 : Form private void timer1_Tick(object sender, EventArgs e) { saveAllToolStripMenuItem.PerformClick(); }
0
12389477e16609dd55472a49132ccc9c
3a296aa1be030e0fd72d9e41cc8a5b78
Change virtual terminal, returning success.
void tc_enter_termcap() { }
0
6b9db803f09c99c215bb7c105f2e9dc5
9c0000310f16925343f6651e0dd4d3cf
Tests if channel 0 is disabled, once again. Verification is done by using API.
{ for(i=0; i<24; i++) { ADCSingleEndedChannelEnable(ADC_BASE, i); ulReadVal = (xHWREG(ADC_BASE + ADC0_SC1A) & ADC0_SC1A_ADCH_M); TestAssert(i == ulReadVal, "xadc API error!"); } for(i=0; i<4; i++) { ADCDiffChannelEnable(ADC_BASE, i); ulReadVal = (xHWREG(ADC_BASE + ADC0_SC1A) & ADC0_SC1A_ADCH_...
0
73be4cf34ee9a74a7f9f36d668449b39
f43a3c21c3315d3e6e9e849ec86c58bf
This method is called when <code>MsLinkEventID.LINK_FAILED</code> is fired. Fired when <p> <blockquote> <pre> MsLink msLink; ... msLink.join("media/trunk/IVR/$", "media/trunk/Conference/enp-1"); </pre> </blockquote> </p> is called and joining of two Endpoint fails
final class TerkUserSessionServant extends _UserSessionDisp implements ConnectionEventSource public void fireFailedRelayLoginEvent() { }
0
6452ba01742fdcf816e4b385099e5f11
b80d6b6efec3c9dfa062b8ea8b8c692c
Reads entropies (or perplexities) from the pandas data frame.
with open(file, 'r') as p: rows = p.read().splitlines() if probs: return [float(r) for r in rows] else: return [(1.0 if float(r) > 0.5 else -1.0) for r in rows]
0
cc0f0880f65e06e287d4fcadc81a9943
2f850e162877bb34e2fe57f42b6756ac
constants for index access into the probability vectors
{ static const char *vec_regs[5][32] = { { "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10", "b11", "b12", "b13", "b14", "b15", "b16", "b17", "b18", "b19", "b20", "b21", "b22", "b23", "b24", "b25", "b26", "b27", "b28", "b29", "b30", "b31" }, ...
0
2db3939346c5e6fe3a05c811b84e38aa
3341af6e8daa8563952c7f9c5aa8e228
SHOW PWD
uint32_t ccCmdsPwd(uint32_t cmd_idx, char **remaining_line) { char cwd_buf[CC_PATH_LEN]; char *wd; if(ccTestNoMoreArgs(remaining_line) == EXIT_FAILURE) { return(EXIT_FAILURE); } wd = getcwd(cwd_buf, sizeof(cwd_buf)); if(wd == NULL) { ccTestPrintError("getting curren...
1
5372bc9d5218e8452af8be82bccdc55d
d80b919ed131154db99cc702d8971dd3
Gets whether or not the group regex collection is cached
public function isCached();
1
ba7ab488faec7d9b7d742966a88ae7d0
7e96ec72d32fb1cecb4db60c46b76d53
既存のソケットハンドルを使うコンストラクタ
StreamSocket::StreamSocket(const StreamSocket &source): Socket(source) { }
0
e95589c80fd09b7585fe1754d1cc2538
62598a060ec999e01b464e612d61e31d
Clear the given reset reasons.
void SysCtlResetCauseClear(unsigned long ulCauses) { HWREG(SYSCTL_RESC) &= ~(ulCauses); }
1
a5ecad355b464c66a34bf88dec9e2d8e
2900bbd5683c6baa3e1b78cb15487ec7
Sets the value of the dscMandatory property. allowed object is {@link Boolean }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "server-debugType", propOrder = { "diagnosticContextDebugMode", "debugMaskCriteria", "server", "listenThreadDebug", "magicThreadDumpEnabled", "magicThreadDumpHost", "magicThreadDumpFile", "magicThreadDumpBackToSocket", "bugReportS...
0
642ea78894a92ffb64917b660295dc98
ed6f6b0f471d9ea2c993c069bd021737
remove or add a player to the current players array
function playerSelect(x){ if (x == 0) { if (currentPlayer == 1){ currentPlayer = playerArray.length; selectedPlayer = "player" + currentPlayer; } else { currentPlayer--; selectedPlayer = "player" + currentPlayer; } } else if (x == 1){ if...
0
6bf1016e5e776d83b0b0b5c1403e2ce5
393108d8a2d53091dc11b1425e030953
Возвращает исходный код геттера для связи OneToOne
class CrudModelCommand extends GeneratorCommand protected function getAssociationCode($association) { $parts = explode(':', $association); list($foreignKey, $type, $model) = $parts; if(count($parts) > 3) { $name = $parts[3]; } else { $name = $model; } return <<<EOD publ...
1
950320decbbd9b926cbe12f79149ce84
546efbe38176091d6c5fa6833be57188
Calculate the bit in the GPIO register that a specific GPIO number corresponds to.
static uint8_t bitForPin(uint8_t pin) { return pin%8; }
1
1b21541122129970f68d009751c1eaa6
589fa20229df55368ccc2ef81ef84d3f
取得したセッションIDからサインインする
{ if(empty($id) || empty($password)) throw new \InvalidArgumentException('入力が不足しています。'); $user = $this->getSavedHash('id', $id); if(empty($user) || !password_verify($password, $user['hash'])) throw new \ErrorException('ユーザ ID またはパスワードが正しくありません。'); $session = $this...
0
5ff09f83c3f07701a1fba30a657c8b9c
e280f2f543f448e309a81659124fd29d
获取国家缩写,小写
public class MdProvince extends BaseEntity{ public String getShortSpell() { return shortSpell; }
0
fa7dba680668e94617681b5c4e5d4bb0
ee724316b13211f587032ce92d9c603d
head라는 태그를 찾아 충돌 했을 때 게임오브젝트 삭제
public class PinHead : MonoBehaviour private void OnTriggerEnter2D(Collider2D collision) { if(collision.tag == "PinHead") { GameObject.Find("GameManager").GetComponent<GameManager>().GameOver(); } }
0
9aafd71f3aa6e096b72bc680df0fe5f1
aabed3bd9c2eaa1d4a539cf567f582ee
如果该线程还没有Session,则创建一个新的Session
public class SqlSessionFactoryProxy implements SqlSessionFactory public void prepareSessionInThread() { SqlSession sqlSession = localSqlSession.get(); if(sqlSession != null) return; sqlSession = new SqlSessionProxy(realFactory.openSession()); localSqlSession.set(sqlSession); }
1
e64eb31d0848aed44eb811bf6c5dfce5
2ce07b047ae3fbc04c0a3e4ee3e0e455
calculate ratio of low pulse time to total time
def calc_LF_ratio(ts, eps = 10e-6): Q90, Q50 = calc_FDC_q(ts, [90, 50]) return (Q90+eps) / (Q50+eps)
0
cd55fbc96179fa1806eea8a3f086e8f6
3f5f693748d04b122bef4397757ad10f
Returns a hash of the element, ready to be added to the block formatted message. Abstract method that needs to be implemented in each subclassed element.
class AbstractObject(object): def to_hash(self, **kwargs): raise NotImplemented('method is not implemented yet!')
1
bd7c33d4f19354ab031950a69371cd8b
df6da18dfbd8b279da6627500307e31d
Final re-formatting/re-structuring of input data to conform with REST API's requirements.
func_to_apply = { 'trips': post_process_trip, 'lifts': post_process_lift, 'rides': post_process_ride, 'feedbacks': post_process_feedback, } if resource in func_to_apply: apply_function(data, func_to_apply[resource], request) objectids_to_strings(data) recursiv...
1
cb8359459bae0f09180206bf3e9f0b0f
adb4b59ec55624f9458260c1c4dc46c6
Low level IL for this function
bool GetLowLevelILForPPCInstruction(Architecture *arch, LowLevelILFunction &il, const uint8_t* data, uint64_t addr, decomp_result *res, bool le) { int i; bool rc = true; if (LiftBranches(arch, il, data, addr, le)) return true; struct cs_insn *insn = &(res->insn); struct cs_detail *detail = &(res->detail); str...
1
ec0f804073aa1ec0426b31803da84f8d
3d81da86148097f37411055033b7d990
Список пакетов основного репозитория
class ListPackages extends AbstractAction public function execute(Request $request, array $params) { $em = $this->getAppService('storage'); $packageRepo = $em->getRepository(Entity\Package::class); $installRepo = $em->getRepository(Entity\StatInstall::class); if (isset($params['sort'...
1
ddce63cb5e9eda2456d2b134fe66b581
54f03812306c541a89719403c57a2f69
Describe the user data being stored and exported.
class provider implements \core_privacy\local\metadata\provider, \core_privacy\local\request\core_userlist_provider, \core_privacy\local\request\plugin\provider public static function export_user_data(approved_contextlist $contextlist) { global $DB; $context = \context_user::inst...
1
95d5f3b77d5796758f0dcfa300686d0c
2b25d7ff550f4f1fbfdd22a178b5d221
build a monitor to compute BER/FER on each thread
ProbeBW::ProbeBW(){ std::cout<<"ProbeBW()"<<std::endl; iperfServerThread = std::thread(&ProbeBW::runIperfServer, this); }
0
21a4a5e8ad911d89a0a5d81d0a5b224b
f0d1c82c0179e95eac524da3d7adf1b9
查询订单商品是否有表格
namespace Easy.Common.Helpers public static class OrderNoHelper public static bool HasTableIndex(string orderNo) { return GetTableIndexFromOrderNo(orderNo) >= 0; }
0
e01d891c3e1b63efee961605cfaa675e
6f27f339c9bcba8f52cc55fdb1406804
玩家治疗
public class ServerHandle public static void Cure(int _fromClient, Packet _packet) { float _hp = _packet.ReadFloat(); Server.clients[_fromClient].player.Cure(_hp); }
1
caea373b2265fe57a3063a92c2ef25c8
9fa2d39dba98f2f5edf8b40007d9ced9
管理员获取所有活动预约(根据room/status分)
@SuppressWarnings("ALL") @Controller @CrossOrigin @RequestMapping("/api") public class ApiVenueController extends BaseController @CrossOrigin @RequestMapping(value = "/venue/roomApplyAll", method = {RequestMethod.GET, RequestMethod.POST}) @ResponseBody public Object getRoomApplyListAll(String roomid, ...
0
bf9eb18b90fca104155b100ca252b677
c42dc7b446230c9a7951b1939e9a2991
Return the classic GAN losses for the generator and the discriminator. (Generator) log(1 - sigmoid(D(G(z)))) (Discriminator) - log(sigmoid(D(x))) - log(1 - sigmoid(D(G(z))))
class DCGAN(object): def _model_loss(self, input_real, input_z, output_dim, alpha): g_model = self._cnn_generator(input_z, output_dim, alpha=alpha) d_mod_real, d_logits_real = self._cnn_discriminator(input_real, alpha=alpha) d_mod_fake,...
1
e4f73b4331f9931542d625c463556e15
f2ccb29a71a313f26cdfb3f5ef382329
Switch to showing monthly plans.
showYearlyPlans() { this.showingMonthlyPlans = false; this.showingYearlyPlans = true; }
0
b1548926c176bdb5ddd680e230ed8647
15cd7e6d7004e28580ed194b9975caf0
Turn on the power to Heater and LED
self._on = True characteristics = [{'aid': self._aid, 'iid': self._chars['on'], 'value': True}] await self._accessory.put_characteristics(characteristics)
1
8564a38cde1cab77f8fa7177083b5c06
bde0e11b9fba465ee0a08b0bbb2204ec
Função que popula a tabela IpsCurso com os cursos da ESE
PreparedStatement pstm; String sql1 = "select * from curso INNER join trilha ON curso.Trilha_idTrilha = trilha.idTrilha inner join funcionario on trilha.Funcionario_idFuncionario = funcionario.idFuncionario inner join cargo on cargo.idCargo = funcionario.Cargo_idCargo;"; try { pstm =...
0
b27675552ae2a199185734654bfa8697
d3513a61193fe1c8cc2ea6eb592d9a9c
Gets the value of the specified column as a DateTime -or- null if the column is null.
public DateTime GetColumnValue( IReadOnlyList<string> resultRow, IReadOnlyDictionary<string, int> columnMap, string columnName, DateTime defaultValue) { return GetColumnValue(resultRow, columnMap, columnName, defaultValue, out _); }
0
15d8e9ffa2c63b60527d5ad075a33753
0ac44a3854757a61273cd89b417d6a01
Extracts the transition effect procedure pin bindings given the transition term
net = nn2nc_map['nn'] map_t = nn2nc_map['map'] mapped_pe = [] d_trans = [] for idx in xrange(len(net)-1): d_trans.append({'src':[], 'dest':[]}) d_trans[idx]['src'] = [] d_trans[idx]['dest'] = [] layer_id = idx+1 out_ng_id = -1 for i in xrange(len(ma...
1
a0bbbf9d9713acd1953150372a29fb80
e1732cc2f28830c4eafc69919b1cb690
#Z-normalization
to_z = function(x) { x = x[!is.na(x)] (x - mean(x))/sd(x) }
1
049e8841f3168e02ffbe2c5b33956582
ca237c5446bc1e499f550aa54927f59a
(String[]) --> List[String[]] Returns the revision ids and when the edits were made in xml format excluding edits made by anonymous users of the url list of url strings. The revisions returned is limited by the revisionlimit integer which must be greater than or equal to zero
{ initialize(); getRevisionTextQuery = getRevisionTextQuery + eventPageName; JSONObject responseObject = new JSONObject(); String returnString = ""; try { wikipediaApiConnector = new URL( getRevisionTextQuery ); HttpURLConnection urlConnection = ( HttpURLConnection ) wikipediaApiConnector.openConnect...
0
35b23697e7e66d278682cfdf8defdb3a
ba08a7ae2ee87afa34cf653c869ae3dd
Provides reasonable default values for an HtmlErrorReporter that would be used in unit tests
impl Default for LoggingConfig fn default() -> Self { Self::for_testing() }
0
700847e4e7d247b798aad64936ecae15
968d12a6cce240e7990ca981f3667085
Gets all possible combinations between two uneven lists of reactants
def __get_blocks(tups): first_block, second_block, smiles = [], [], [] for x in tups: comp = self.compounds[x.c_id] smiles.append('(%s) %s' % (x.stoich, comp['SMILES'])) if comp["Inchikey"]: split_inchikey = comp["Inchik...
0
b5d7ab73c2d65f31b028f0f63c5d0cf5
db0b95123173ee8180aa81f286f116a7
获取制定场景中的未接取任务,如果场景名为空,则返回所有未接取任务 检测的是接取任务NPC所在的场景
public class Module_Task : Module<Module_Task> public List<Task> GetTask(NpcTypeID npctypeid) { return m_taskList.FindAll((p)=>p.taskTargetID==npctypeid); }
0
6595fb25268c60c0001b66784fbacd65
6e640494620d5f42640cb19be882623b
Needs to handle all types of log lines. Currently can handle those of: auth.log fail2ban. Returns None if parsing is unsuccessful.
class PgLogForward (CCDaemon): def parse_json (self, data): raise NotImplementedError
0
86bdff834fe8ae8ac7bb78a4cec2c84a
5a8a7e4c91ff587fad92c3d02b0f7b1e
Populate model from core entity
$ret_val = $this->getModel()->performQueryByOrigin($this); if ($ret_val->getId() > 0) { $this->populate($ret_val); } return $this; }
1
9e51ab12986efad8ecec59cc840f9d2f
b49e0d03622cd167aad9ccafb6ecc189
判断5张牌的牌型
func IsOkByCards(card []int) int { if len(card) == 1 { return card[0]/10*100 + TYPE_CARD_ONE } if len(card) == 2 { if (card[0] == 1000 || card[0] == 2000) && (card[1] == 1000 || card[1] == 2000) { return TYPE_CARD_WANG } if card[0]/10 == card[1]/10 { return card[0]/10*100 + TYPE_CARD_TWO } } if ...
1
0486dd25c90466ce200d452514ccf80d
ac4154c44e6121019cad376cf40d144f
The location where the instance launched.
class StartConfiguration(Model): def start_loc(self) -> str: return self._start_loc
1
7a9f4a63c02cedf3e1312fecf4ebd863
554e8b7a1de7a86a58fada415e9bd1bf
Integrate the equations using the Euler-Maruyama scheme
def euler(M, T, S, sigma, r, num_series, rho): dt = T/M S_values = np.zeros((num_series, M)) S_values[:,0] = S for m in range(1, M): shared_Zm = random.gauss(0, 1) for n in range(0, num_series): Zm = random.gauss(0, 1) S_values[n, m] = S_values[n, m-1] + r*S_value...
1
ba0505ef8f0b026c14fcfad721c0e3fc
9c08eb896e35ef8df8adf2b966cdb911
Returns true if the inputted string is comprised of all lowercase characters
function isLowerCase(str) { return isString(str) && str === str.toLowerCase(); }
1
d9d5a94c70f0e315ed7f0382ab353730
a6f9ef8361159184a7ad31dc84c5e72d
Gets text of the Save paragraph
function getText() { return $('#save-me').val(); }
0
3ad90064f4badc11b23b371436a0c3ee
593d185a8c7c3851e5377602ae5234ed
Opens a zip file for reading.
class Reader extends ReaderAbstract protected function openReader($filePath) { $entityFactory = $this->entityFactory; $this->zip = $entityFactory->createZipArchive(); if ($this->zip->open($filePath) === true) { $entityFactory = $this->entityFactory; $this->sheetIterat...
1
2cf57b7c198a3dc7f39393419e4beb41
2383433bbb02f86285c4697677ecdd2d
辺の長さを取得する
class UnionFind: #ノード番号は0-indexである def getLength(self, x): x = self.findRoot(x) return self.length[x]
0
c89a205703ad3594ad9965de1e97857a
030f584fce55b8633bf1c48b976b538c
If there is a next parameter we redirect to this page, else we redirect to home
class NextUrlMixin(object): def get_success_url(self): if 'next' in self.request.GET: return self.request.GET.get('next') return reverse_lazy('index')
1
e279a1c60e3f9d5b4e2c9e41e6689693
31cc87b25a659a1ea529c438fda14d14
单元或者关卡数校对
bool MainWindow::check() { if(ui->pages->currentIndex()==C_YUHUN) { int person_count,prop_count,challengetimes,floor; person_count=ui->yuhun_editPersonCount->text().toInt(); prop_count=ui->yuhun_editPropCount->text().toInt(); challengetimes=ui->yuhun_editChallengetimes->text().to...
0
71e6f65825ac6e6ce68ed764c9eab7ff
187565a4272a7908446eafd5250118dc
Finishes a multi-statement transaction by applying the changes.
namespace ITsoft.Extensions.MySql public sealed class QueryBuffer : IDisposable public void EndTransaction() { _queryBuilder.AppendLine("COMMIT;"); }
1
8f43bfc9edce04a32ce12e2644c17fd5
cd6ddff89906f1c2298c67daa48246c2
method to stop falling through platforms
[RequireComponent(typeof(CameraWork))] public class CharacterControllerRaycast : RaycastController void ResetFallingThroughPlatform() { collisions.fallingThroughPlatform = false; }
1
6bdc5d02ca2486ff0086a58f4c82642d
c36fddb3a723714fa0d1cd779b35530e
Draw current tetrimino and next piece, and update any dirty rects.
{ if (m_game->hasChanged()) { m_canvas->beginWithClear(0, 0, 0, 0); if (m_game->showPreview()) { for (int i = 0; i < Game::TETROMINO_SIZE; ++i) { for (int j = 0; j < Game::TETROMINO_SIZE; ++j) { if (m_game->nextBlock().cells[i][j] != Game::EMPTY_CELL) ...
1
de759d660efb3ed4ee29619b663debfa
93bf34665c4da64e35150cbb671cb84a
Updates the UI by displaying the currently used avatar sprite.
[RequireComponent(typeof(Animator))] public class AvatarController : MonoBehaviour public void UpdateAvatar(uint UserID) { if (!transform.gameObject.activeInHierarchy) return; if (kinectManager == null) { kinectManager = KinectManager.Instance; } MoveAvatar(UserID); }
0
b7a8b84eeb55cc5ccb243304ed968e97
d42207619ec45b34b5a12ae6a0d99d4e
If the LCD Display exists, write a simple message on the first line.
{ static unsigned char lcd_init_string[] = { LCD_CTRL, LCD_INIT_CMD, LCD_CTRL, LCD_ENTRY_CMD, LCD_CTRL, LCD_ON_CMD, LCD_CTRL, LCD_CLS_CMD, LCD_CTRL, LCD_HOME_CMD, }; output_lcd_data(lcd_init_string, sizeof(lcd_init_string)); lcd_device_exists = (read_lcd_data() == ' '); if (lcd...
1
712d8d9fbe75e43d45ae0fa85a74cfd8
28fe9f3ac35f7a1f38c0427c184f0e8c
Delete a jobTimeActivity Deletes the jobTimeActivity identified by the specified id.
public class JobTimeApi public ApiResponse<Void> deleteJobTimeFileWithHttpInfo(Integer jobTimeId, Integer fileId) throws ApiException { com.squareup.okhttp.Call call = deleteJobTimeFileValidateBeforeCall(jobTimeId, fileId, null, null); return apiClient.execute(call); }
0
2dbcd5eb4ca6b7f88fbff84b233d4337
c196cfd0b5f7b170737b151b66fbd230
returns an array of hashtable for given query; optionally fill values
{ $link = new mysqli( "localhost", "webdev13", "c1536withBen", "webdev13" ) or die("Could not connect: " . $link->connect_error()); $result = $link->query($query); if($result === FALSE) { logger("Failed Query: $query: ".$link...
1
8386c9ba0870fa695cbb45f865eb0bdf
9578589a6763fd54828238d36e938bd5
把标签字段写入mongo
client = pymongo.MongoClient() db = client.four_tag collect = db.key_p for element in result: collect.insert_one({'name': element, 'tag': result[element]}) client.close()
1
6182ce2a99604a9b87b3aa141822c008
608ce32bf0cea22a8b90ef1ec6f43447
Choose a random mob from the rooms spawn table
public class DqmWorldGenDungeonOver extends WorldGenerator private String pickMobSpawner(Random p_76543_1_) { return DungeonHooks.getRandomDungeonMob(p_76543_1_); }
1
70161ec0a983a21cfae379e16683f2be
3025450aab4c2b228691f41fab175241
每次支付的时候尝试支付最大面额的金钱,这样子,就能得到最优解
{ var money = GetInit(); int i = 0; while (true) { if (num < 0.05M) { return money; } var max = money.Keys.ElementAt(i); if (num >= max) { ...
1
20f67592b5112d5fab74260857fb762f
f308065c79a076e308a2264585b365dc
Zeichnet einen Sitzplatz in den Saalplan
{ char Anzeige[Hoehe][Breite]; char Zeichen[8][8]; bool Rahmen = true; int Pos = 0; AnzeigeLeeren(Anzeige, Rahmen); Pos = 0; ZeichenHolen(Zeichen, 'I'); ZeichenSetzen(Anzeige, Zeichen, Pos); Pos = 1; ZeichenHolen(Zeichen, 'N'); ZeichenSetzen(Anzeige, Zeichen, Pos); Pos = 2; ZeichenHolen(Zeichen, 'F'); Zei...
0
793aadb5da1d848cdbf0391ab338d503
3a324ae0b6035973d47f179281aa96e3
Tests if the relative path switch works.
path = os.path.join(self.glancesynchome, 'tests') result = get_path(path, self.relativepath) self.assertEqual(self.validresult, result)
1
f740f64b9383de98968d62e071861877
3a54dbec9ea8f25d02546ab9f54219d3
convert the information from the array in icalendar format
{ $output = ''; $events = $this->getEvents(); if( count($events) ) { foreach( $events as $event ) { $output .= "BEGIN:VEVENT\r\n"; $output .= "SUMMARY:" . $this->_encodeSpecialCharacters( $event['event']['event_title'] ) . "\r\n"; $output .= "DTSTAMP:" . $this->_buildIcalDate( $event['event']...
1
917150478b1f50df0b8c8c78721bee4c
f9f140cc623e1869cb7627ad9d1c8aef
Sets turtle's step distance.
abstract class Move fun setStepDistance(pixels: Float){ step_dist = pixels }
1
89b437547efc59dad49584824c975131
09bc72cb01c359d867569622d5a74590
permet de recuperer l'id du membre
class Membre extends Entity public function getIdMembre() { return $this->id_membre; }
1
d514b5e3e01ab8a17b35ad7d959af9fc
9bba5a57b608c70ecefc9fdecf55a792
修改机构资质附件
function editAttach(businessId) { $('#attachmentUpload').xljAttachment({ appId: "HR", businessId: businessId, categoryId: ATTACH_TYPE_KQQJ, mode: 'edit', singleUpload: false, }); }
1
c1b62de82732d2857fe3113515a504b8
08026721c094a9ad637178e2ceb2b0f8
Returns a single direct message, specified by an id parameter. Like the /1.1/direct_messages.format request, this method will include the user objects of the sender and recipient.
$api_call = sprintf("http://identi.ca/api/direct_messages.%s", $format); if ($since != NULL) { $api_call .= sprintf("?since=%s", urlencode($since)); } if ($since_id > 0) { $api_call .= sprintf("%ssince_id=%d", (strpos($api_call, "?since") === false) ? "?" : "&", $since_id); } if ($page > 1) { $api_...
0