query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
98ef0cdce7c8947e02f66f1ffd342678 | 65c44b3226da1f1e9ec8b3833a8a0c41 | Print out values of Gaussian parameters | void Model::PrintParameters() {
std::cout << "x0: " << x0 << '\n';
std::cout << "y0: " << y0 << '\n';
std::cout << "Lx: " << Lx << '\n';
std::cout << "Ly: " << Ly << '\n';
std::cout << "T: " << T << '\n';
std::cout << "Nx: " << Nx << '\n';
std::cout << "Ny: " << Ny << '\n';
std::cout <<... | 0 |
fb2f471e4ecba8baa0ae8e59656595b0 | 0927aac372f33e411e9b489ebf5f9576 | Retrieve all LibGuides assets. | $valid = $hook == 'edit.php' && isset($_GET["post_type"]) && $_GET["post_type"] == $this->getPostType();
if(!$valid) return;
Factory::assetManager()->addGuides();
Factory::assetManager()->addPostList();
} | 0 |
c040d7fc41d271abc5a64f11d7d4dbd1 | 50cca5cff46d987d28d19843dc9aa1aa | # Correction factor for LN truncated moments
# Can derive from Jawitz et al. 2004
# Arguments:
# mu: meanlog parameter (gamma in paper)
# sigma: sdlog paramter (beta in paper)
# xmin: left truncation point
# xmax: right truncation point
# Returns:
# constant corresponding to a correction factor | z = par[1]
xi = par[2]
cst <- exp(lgamma(N + 1) + lgamma(1 - xi) - lgamma(N + 1 - xi))
-(psigamma(N - xi + 1) * cst - psigamma(-xi + 1) * cst) * dat * (1/xi + 1)/(z *
(dat * (cst - 1)/z + 1)) + ((psigamma(N - xi + 1) * cst - psigamma(-xi ... | 0 |
da98fa3a8870b0546fe66a99a38123f3 | 74db8c95a244b2060c4ed8100196ee9b | 로그인이 필요한 페이지 | if request.method == 'GET':
error_message = '로그인페이지입니다.'
return render(request, 'login.html', {'error_message':error_message})
elif request.method == 'POST':
username = request.POST['username']
password = request.POST['password']
user = auth.authenticate(request, username... | 1 |
24281fb124fe7484fdb9915edaf01e8e | 7a1d7d971e944f3621e6874b1abc7d2c | Sets the number of worker threads dedicated to mirroring between repositories.
If unspecified, {@value #DEFAULT_NUM_MIRRORING_THREADS} threads are created at maximum. | public class MetricConflationService extends ServerComponentBean implements Runnable, UncaughtExceptionHandler
public void setWorkerThreads(int workerThreads) {
this.workerThreads = workerThreads;
} | 1 |
fbf24b61acb9579d0f4c9532da3e76d7 | d7ae77a8300d093ae1c3de1dab664754 | setter method for allowedValues | public void setAllowedValues(List allowedValues)
{
if (allowedValues == null)
{
throw new DictionaryException(ERR_NO_VALUES);
}
int valueCount = allowedValues.size();
if (valueCount == 0)
{
throw new DictionaryException(ERR_NO_VALUES);
... | 1 |
4e8fe24afeb75245c3323f73b7b60ec7 | 9506f56ad1c658272b18082e46ff408a | 1日前の日付を設定する | public class InquiryRecentSearchInServiceBean implements SessionSearchCondition
public void setToDay(String toDay) {
this.toDay = toDay;
} | 0 |
4a344652f65dcb8ebbfe41d55a484b01 | 57fcb5da0bc319d88ec80de2658d8351 | Pass on context manager exit to proxied object. | class ProjectContext(object):
def __exit__(self, *args):
pass | 0 |
00d8a612bf90f23c3f36fcf23b951ad0 | 04c6e6861139c29ec345e9bab59da2a6 | Visit a parse tree produced by {@see AlgoParser::declaration_variable()}. | class SolidityVisitor(ParseTreeVisitor):
# Visit a parse tree produced by SolidityParser#sourceUnit.
def visitVariableDeclaration(self, ctx:SolidityParser.VariableDeclarationContext):
return self.visitChildren(ctx) | 0 |
19bd5e0b25abc73a873d8e59db7641c1 | 7e91708b04dace3d1ebf2adf3fddda05 | <pre>
功能描述:取得指定标识的持久化对象实例,若没找到返回null
</pre> | public static <T> T load(Class<T> clazz, Serializable id){
final String key = clazz.getName();
Map<Serializable, T> map = (Map<Serializable, T>)globMap.get(key);
if(null == map){
return null;
}
return map.get(id);
} | 1 |
1057eedfe4fd502474f2fcdbfb1a29e1 | 670cded1a290fd22fa1fbb170411b6a1 | Method to create a JTable and fill it with the store item information. | products = ProductService.readAll();
DefaultTableModel model = new DefaultTableModel();
model.addColumn("ID");
model.addColumn("Name");
model.addColumn("Price");
model.addColumn("Quantity");
for (ProductService prod : products) {
model.addRow(new Objec... | 1 |
14277b24080f81d53a4263c4329f510d | 3ab5cc49d1af196d16785aed89a9b814 | Проверка нового состояния на уникальность | class TestStatus(UserProjectBaseClass):
def test_unique(self):
status = Status.objects.create(name='ready', project=self.project)
self.assertIsNotNone(status)
with self.assertRaises(IntegrityError):
status = Status.objects.create(name='waiting', project=self.project) | 1 |
9f5f8715eb6de0cf14239186c1ff0925 | 29b805cca0f733b92f011dbedf226d58 | Map database-neutral column name to database-specific column name. | public String mapColumnName(String fieldName) {
String column = super.mapColumnName(fieldName);
if (column != null) {
return column;
}
if ("amount".equals(fieldName)) {
return COL_amount;
}
if ("failureAmount".equals(fieldName)) {
return COL_failureAmount;
}
if ("instanceNo".equals(fieldName))... | 1 |
80680aee501c2e6f1639c623d99fa6c4 | 6e8b178099e8e10d80e8c8ee59addf8e | takes a list of user objects and displays them to gallery | employees.forEach((employee, index) => {
const modal = addUserModal(employee, index, employees.length - 1);
const cardDiv = document.createElement('div');
const imgDiv = document.createElement('div');
const infoDiv = document.createElement('div');
const img = document.createE... | 1 |
0b1aaf8714ac395bcef000901cea5eeb | 9509b0549fa07953292bc0a76c3e2a6f | Register a property as searchable.
<para>
Use this if you can't alter the source code of the object to index,
thus preventing you from using [Searchable]
</para> | namespace PIC.Data
public class SearchCriterion
public virtual void AddSearch(string propertyName, object value, SearchModeEnum searchMode, TypeCode type)
{
Searches.AddSearch(propertyName, value, searchMode, type);
} | 1 |
4593f52163bf578703ce47b674ca8ac6 | 75897fbb3db3e9e3a25233610c47dd58 | 保存下一次跳转后的视图ID | @FacesComponent(Url.COMPONENT_TYPE)
public class Url extends OutputFamily
public void setViewId(String viewId) {
state.put(PropertyKeys.viewId, viewId);
} | 1 |
e80c13f54c475f150da1fb6f4de2947d | cb94c683f3859dfb2db6269fbc2c312a | İlçe Dropdownlistini doldurur. | public void onItemSelected(AdapterView<?> parent, View view,
int position, long id) {
if(parent.getSelectedItem().toString().equals(iller[0]))
dataAdapterForIlceler = new ArrayAdapter<String>(MainActivity.this, android.R.layout.simpl... | 1 |
39961b6912153b92ca6d558bc2c3db1e | d47c6768bb15e03b7dc5d4aa93c503ea | Handle authentication for the ES server. | class OmeroAuthenticator(Authenticator):
async def authenticate(self, handler, data):
self.log.debug('data: %s', dict(
(k, v if k != 'password' else '********')
for (k, v) in data.items()))
server = data['server']
if server not in self.omero_servers:
self.log.... | 0 |
088b1909e1bdc80e386e69ab4d07c58d | de0da220f1dde46d34341fba94e8f564 | Returns the number of distinct SRC_IP in the X minutes surrounding the event | dfNew = dataFrame
additionalCol = []
for i in range(windowSize - 1, len(dfNew.index) + 1):
if (i%10000 == 0):
print(i)
window = dfNew[i - (windowSize-1):i+1]
slice_df = countDistinctMatchingForSrcAddr(window)
additionalCol.append(slice_df)
newCol = pd.concat(a... | 1 |
9fedb1818aead4c0a0768404f20d17ff | d753622a148dbb519c0ea076eb16b78d | XSS protection | {
if (in_safe_mode()) {
return;
}
if ((!has_solemnly_declared(I_UNDERSTAND_XSS)) && ($out !== null)) {
foreach (array_merge(array_values($_POST), array_values($_GET)) as $before) {
if (is_string($before)) {
$after = $before;
kid_gloves_html_escapin... | 1 |
5eb2ac635f5c8435eeeb4794613df537 | 8411a6d88a1e62cb0b5d6fe10729120c | Construct sequence encoders. | class ForecastingModel(ABC, metaclass=ModelMeta):
def initialize_encoders(self) -> SequentialEncoder:
(
input_chunk_length,
output_chunk_length,
takes_past_covariates,
takes_future_covariates,
lags_past_covariates,
lags_future_covariates,
... | 1 |
208ddd04b8041fc26bd91dcb0ebc9bb7 | 7bc641dfd74ddf152e032a46379ed497 | Initialisation of course correction values | {
register Shortword i;
Shortword shift;
Longword L_sum;
v_equ(smoothedspect, lambdaD, ENH_VEC_LENF);
v_scale(smoothedspect, ENH_INV_NOISE_BIAS, ENH_VEC_LENF);
for (i = 0; i < NUM_MINWIN; i++){
v_equ(circb[i], smoothedspect, ENH_VEC_LENF);
v_equ(circb_shift[i], lambdaD_shift, ENH_VEC_LENF);
}
v_equ(sm_shift... | 0 |
666a3bbfde48ee34cc56d0b237a7c194 | e99a49db3ea62e3becf8c264170b7f9e | When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. | {
SetInnerPosition();
var read = _innerStream.Read(buffer, offset, count);
Position += read;
return read;
} | 1 |
b56cde2ddaf645a4d5de8ed065af7c41 | 9de6754469fef141715b003bde559b37 | Get Include_Job_Profile_Compensation_Data value | class Job_Profile_Response_GroupType extends AbstractStructBase
public function setInclude_Job_Profile_Compensation_Data($include_Job_Profile_Compensation_Data = null)
{
if (!is_null($include_Job_Profile_Compensation_Data) && !is_bool($include_Job_Profile_Compensation_Data)) {
throw new \Invalid... | 0 |
b13eef778bc59b0a8bb41954da255aff | 74640789302a97b5fe8ee0bedcb3f565 | Add a teacher on course | class Courses(object):
def add_teacher(self): | 1 |
bf83b56c35c027774f0480d37ebd81ea | 882de436676475159083f6fea80c89b4 | Gets all upcoming auctions | $sql = 'SELECT id, name, date_start, description, image, price_start, category_id, date_end FROM lots WHERE date_end>NOW() ORDER BY date_start DESC';
$result = mysqli_query($link, $sql);
if ($result) {
return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
else {
throw new Exception("DAT... | 1 |
d2649679247f06fbfcee6c7738eb265e | 351582d0104d349674300b862510d9e1 | capture ENTER key, up arrow key, and down arrow key, then MakeFocus by next or previous BView | void CZ_ed2View::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case VK_DOWN:
break;
case VK_RIGHT:
break;
case VK_LEFT:
break;
case VK_UP:
break;
case 'M':
DOC()->OnBumove();
break;
case 'D':
DOC()->OnBUScale();... | 0 |
73180faa16c4880b9dad7d3161dfca92 | efd052acca4929b9898f86854113a7d8 | 告知监听者加载完成 | public class VRpicMusicActivity extends AppCompatActivity private class MyVREventListener extends VrPanoramaEventListener
@Override
public void onLoadSuccess() {
super.onLoadSuccess();
Toast.makeText(VRpicMusicActivity.this, "加载成功", Toast.LENGTH_SHORT).show();
} | 1 |
8fc0140c588478bae52c199c047db8c1 | 32bacbc23554bd706185415b667a9fed | Enable mouse hover event tracking | let lastTouchTime = 0
function enableHover() {
if (new Date() - lastTouchTime < 500) return
if (!client.hover) client.hover = true
if (client.touch) client.touch = false
}
function enableTouch() {
if (client.hover) client.hover = false
if (!client.touch) client.touch = true
}
function updateLastTo... | 1 |
e20a645ebcc44db11a21c0498a9b8d81 | 554356337b197fd97d17c7f9401b724c | Lock file checker. | def isLockedFile(filename):
lock_file = os.path.splitext(filename)[0] + LOCK_FILE_EXT
return os.path.isfile(lock_file) | 1 |
ad8b07be008fe3288d961b5471d5613d | 5202eaaac664fbc129635e0244d07c1a | Trains various parameters associated with this neuron and associated source synapses. | {
int num_neurons = sim_info->totalNeurons;
for (int i = 0; i < num_neurons; i++) {
BGSIZE synapse_counts = this->synapse_counts[i];
int synapse_advanced = 0;
for (BGSIZE z = 0; z < synapse_counts; z++) {
BGSIZE iSyn = maxSynapsesPerNeuron * i + z;
advanceSynapse(... | 0 |
521ffb4f4ea78306d4cec389acfd36e3 | 1d07ed7d23925260a2d5e5ef3f84d7af | 高斯塞德尔 | f=lambda x: A.dot(x)
h=lambda x: H.dot(x)
a=sig.dot(sig.T); a1=sig1.dot(sig1.T)
a1_inv=LA.inv(a1)
R=np.zeros((N+1,dimx,dimx)); R[0]=R0
for i in range(N):
R[i+1]=R[i]+(A.dot(R[i])+R[i].dot(A.T)-R[i].dot(H.T).dot(a1_inv).dot(H).dot(R[i])+a)*dt
F=np.zeros((N+1,dimx,dimy))
for i in r... | 0 |
d33da461e2fa39477c74379f1ccb57c7 | a656150807fbd7ef0d58a995b9c53f09 | Selects a venue according to the id, which the user inputs, and checks whether it is a valid id | class Controller:
def select_one(self):
self.view.print_select_one()
while True:
answer = self.model.select_one(self.view.select_one())
if answer is not None:
answer_list = []
answer_list.append(answer)
return self.view.show_data(an... | 1 |
cc1f38ffd3bad7f15e84c56c641bfd7f | 34c4d4ec7d8fdfdeb448bd45b50a8642 | Approximation of DTCM usage. | class LivePacketGatherPartitionedVertex(
PartitionedVertex, ProvidesProvenanceDataFromMachineImpl,
AbstractPartitionedDataSpecableVertex):
def get_dtcm_usage():
return LivePacketGatherPartitionedVertex._CONFIG_SIZE | 1 |
70993d1dac5161a77ad3de9b5fe98b8a | 1453a747476bc17b249b78295fa8ec18 | 获取当前摄像机在Config表中的值 | conf := goini.SetConfig("./conf.ini")
confarr := conf.ReadList()
for index := 0; index < len(confarr); index++ {
confmap := confarr[index]
if _, ok := confmap["config"]; ok {
if _, ok := confmap["config"]["camdev"]; ok {
camdev = confmap["config"]["camdev"]
}
}
}
} | 1 |
5632e45134da2df0771ad6ae33471a99 | edc1f9f38fb50913f8f380fc57018735 | Processes the Clash detection form.
PARAMETERS
INPUT :
none.
OUTPUT :
none.
RETURNS : none
SIDE EFFECTS : none
WARNINGS : none | void nclu_scrub()
{
NCL_cmdbuf cmdbuf;
UU_LOGICAL status, pt_status;
int i;
uu_denter( UU_MTRC,(us,"ncl_scrub()"));
ncl_init_cmdbuf(&cmdbuf);
ncl_add_token(&cmdbuf, NCL_scrub, NCL_nocomma);
status = ncl_add_label(UD_DASPCKLOC, &cmdbuf, 428, UD_ncl_motion);
if(status == NCL_OKINPUT)
status = ncl_add_str(&cmdb... | 0 |
8905b7800d058f3ef3d7d5e1ab8adb49 | c5da29a5f3e60754e5eb88e6baaf8901 | 暗杠分数变化 | class MainGameLogic extends BaseGameLogic
private ChangeCurrBet(): void {
let sum = this.betLogic.GetBetScore();
this.gameView.SetData(Enum.GameViewLogicEnum.ChangeCurrBet, sum);
} | 0 |
16b57759123b9707138e3ac5e2cf56d4 | b1dba0e1b3829b080c5cd004e554d307 | Sets the backdrop offset to the current screen. | if not self.Background then return end
return self.Background:GetScreenPosition( SGUI.GetScreenSize() )
end | 0 |
e27c05aae5678d3aadf2585669bcdb7a | af839ba2d0c2300e30d84d26ef9923be | Returns the last customer billing in the ordered set where CustomerID = ?. | public class CustomerBillingLocalServiceImpl extends CustomerBillingLocalServiceBaseImpl{
public com.csp.dbservices.model.CustomerBilling findByCustomerID_Last(long CustomerID,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.csp.dbservices.NoSuchCustomerBillingException,
... | 1 |
6c7917ccf7ab0b907a787a1d3b244958 | e12a6f593f0c0be732bb942ddfeddf1b | Force réaffichage après distribution | updated() {
let recupS = document.getElementById("btnSuiv")
let recupP = document.getElementById("btnPrec")
let recupBitS = localStorage.BitS
let recupBitP = localStorage.BitP
if (recupBitS == 1) {
recupS.className = "detail arrow right"
recupP.cla... | 0 |
f14f64c919434d2aefed15dd3d4d5e88 | 41cec043bc204d9435938a71cfaea85b | Kill local adb server | if self._logger:
self._logger.debug("[ADB SERVER] Kill all adb instances")
adb_proc_name = "adb.exe"
if platform.system() != "Windows":
adb_proc_name = "adb"
procs = psutil.process_iter()
for proc in procs:
try:
if proc.name == ... | 1 |
41203d3ee0e2092d68881709b43ca8a0 | c677ca4e7df37539bcbe91e236e2beee | Basic reverse | var rev = "";
for(var i = s.length-1; i >= 0 ; i--) {
rev += s.charAt(i);
}
return rev;
} | 1 |
19a64ee581dd9a5c662e2d1b14fedbc0 | 29eeb71c16132d8bc2815393859e36ba | Clear defualt text when the text box is clicked | namespace WeatherChannelAPI
public partial class MainWindow : Window
private void mainWindow_textBox_search_GotFocus(object sender, RoutedEventArgs e)
{
mainWindow_textBox_search.Text = "";
} | 1 |
cd3aea573aa85598b04a5dbd25b41b41 | 5ab8c1d8928b3867849bd42bb565050b | Fetches binary data over a stream. | namespace IceMilkTea.Core
Task FetchAsync(Stream outStream, IProgress<FetcherReport> progress, CancellationToken cancellationToken); | 1 |
84d27ba0aab1fb6d6c02ed0f95b65478 | 6c1d1e153c89ca199df9891b518eff83 | Method for upgrading fire rate from upgrade shop. fire rate value is DECREASED, increasing the overall speed of the bullets being fired, each time method is called. | {
fireRate = Math.Max(fireRate + magnitude * 10.0f, 1.0f);
} | 0 |
48a02a683aea373b69f5d7025346d864 | bb338586cbbb820e8c4d47d2869e35c8 | Finds the last race entry and the results with finishing position as method parameter. | RaceDto findLastRaceAndResultsWithPosition(int position); | 1 |
d06a14a6c503e5658dc3ac1c3b08ecf9 | a4483d15965a2c21d14fa402d0c75698 | 渲染单个角色 | for i = 1, 3 do
local roleInfo = self.roleList[i];
local actor = actors[i];
if roleInfo == nil then
actor.figure.Visibility = Visibility.Visible;
actor.unselected.Visibility = Visibility.Visible;
actor.avatar:Destroy();
actor.selected1:Destroy();
actor.selected2:Destroy();
else
actor.figure.V... | 0 |
05090271b9c357f7d9ceaeaf32024352 | 9ced896a4451c4e160e5b079e0e86234 | Add a dependency to this node. Also get the properties from
the dependency. | @SuppressWarnings("unchecked")
public class PathfinderClient
public JSONObject createDependency(String uniqueIdFrom,String uniqueIdTo,String scope) throws IOException {
JSONObject resp = null;
JsonObjectResponseParser jparser = new JsonObjectResponseParser();
JSONObject body = new JSONObject();
body.put("from",... | 1 |
797b8fd9885a5413c1336fbd95a1c405 | 24d69a7017dd8ce3f9b528bef1a79695 | Verifies that all required properties are set before calling
the build_url method | {
if (null === $this->apiUrl) {
throw new BuildException('Wiki apiUrl is required');
}
if (null === $this->id && null === $this->title) {
throw new BuildException('Wiki page id or title is required');
}
} | 1 |
4f445278fa302e7a8ac0d795505efc99 | 05d47be7b60a60bfaac23f5e3691c195 | 滚动缩放 | void MyView::wheelEvent(QWheelEvent *event)
{
if(event->delta() > 0)
scale(0.5, 0.5);
else scale(2, 2);
} | 1 |
1bbe488ec169fb729d30b81b32b0bbef | 0fde401b37dc1659adb89fa25714c1d4 | Returns the value of the '<em><b>Datetime Performed</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Datetime Performed</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | Date getCreatedDatetime(); | 0 |
3057199f98ba6aaec7cc86632f32af3e | 061e00c4b3b85d281e44aebb179f236d | a=-a | public class CodeWriter
private void writeAneg() {
w.println("@SP");
w.println("A=M-1");
w.println("M=-M");
} | 1 |
af362a488f347b3e684b517da887ff47 | ed773ff31b2b377c436575bcf07188a5 | Clears the default header token. | class Request
public function clearDefaultHeaders()
: Request
{
$this->_defaultHeaders = array();
return $this;
} | 1 |
5d130929a9bfdbef586489c335dce786 | fe6e540e595a8d5798b599c732d727ec | 自动添加售后 | {
$this->orderInfo = GlOrder::where([
['order_sn', '=', $this->orderSn],
['user_id', '=', $this->userId],
['is_del', '=', 0]
])
->find();
if (!$this->orderInfo) {
throw new CommonException(['msg' => '无效订单']);
}
if ($... | 1 |
bb677bcf83918fc0763bf9d42ff1340d | 3b7f0dd12e69cd75ba06e68a46b5e29e | Updates the changeable properties of a hedera network account. | @Document
void updateSettings(AccountOptions newSettings) throws AccountError; | 1 |
599bc63cee8cdd6697539ba0ba329b64 | c2d174fcf44b23a2032957a0bea80aca | this function is used to change the value of the tip per person and the total per person as the value is entered in the Bill textBox | namespace TipCalculator
public partial class Form1 : Form
private void txtTip_TextChanged(object sender, EventArgs e)
{
Calculate();
} | 0 |
2d2afe22f6b9a1f9b782c7fe11dd959d | 290e91045e54958f9b0372eb5c655ad1 | Validates the Referral address entered into the dialog and prompts
the user if the address is invalid. If the address is valid,
_referralUri is updated. | namespace MS.Internal.Documents
internal sealed partial class RMPublishingDialog : DialogBaseForm
private bool ValidateReferralAddress()
{
bool ok = true;
_referralUri = null;
if (checkBoxPermissionsContact.Checked)
{
string permissionsAddress ... | 1 |
8344a7a35be5237bbc7f5113922114a9 | d4c22d08e5c9cabcf9288a4ce4b4e0dd | 选择行返回id,可以为0 | int ListModel1V::getId(int row)
{
return this->data(this->index(row, 0), IdRole).toInt();
} | 1 |
8013ceee4503b962f23769375b320964 | d2d339d4a265e1a4aab6ac6548809812 | Sort Function Sorts Clients Alphabetically | {
char temp[20];
for (int j = 0; j < size - 1; j++)
{
for (int i = j + 1; i < size; i++)
{
if (strcmp(s[j].name, s[i].name) > 0)
{
strcpy(temp, s[j].name);
strcpy(s[j].name, s[i].name);
strcpy(s[i].name, temp);
}
}
}
} | 1 |
2613491e6f2857b853f94056619b2dd3 | 27699117de87069d7a568f2417c41f76 | # Categorical variable generation (e.g. infection status) | x <- as.character(x)
xx <- rep(NA, length(x))
xx[grepl("yes", x)] <- 1
xx[grepl("no", x)] <- 0
invisible(xx)
} | 1 |
9ddb08ad041d305bcd0962368b0d2d56 | 465fc3e37f6fd560903dd73d65596fe0 | Extracts a tar.xz archive to a temp dir | def extract_tarball(tarfile, path):
return subprocess.call(
['tar', 'zxvf',
tarfile.name,
'--strip-components', '1',
'-C', path]) | 1 |
294821e32d0be8803a53e711428df64f | ffd53ebf0ac4f72badc2f0e26e3ac5c4 | 退出登录是否成功 根据登录页面的logo标识判断 | class PageLogin(Base):
# 点击登录连接
def page_if_login_success(self):
return self.base_if_exist(page.login_logout_link) | 0 |
fc613593e2f4397f388ecef7035bcb90 | a3faba728f9b438724b5c3bbe8c3d2fe | 设置session,cookies,更新登录IP,登录时间 | cookies.update(session.cookies)
header['Cookie'] = '; '.join([str(key)+'='+str(value) for key, value in session.cookies.items()])
header['Referer'] = URL | 0 |
a293c9304e4433f675c43c465fefde93 | ee74df5769e287ea7b56d33bd4b22490 | Stops tracking statistics between layers without changing the current norm | class PreNormLayer(torch.nn.Module):
def stop_updates(self):
assert self.count > 0
if self.shift is not None:
self.shift = - self.avg
if self.scale is not None:
self.var = torch.where(torch.eq(self.var, 0.0), torch.ones_like(self.var), self.var)
self.scale = ... | 1 |
24e10588f7b6664deb361d39049790cf | 84b83fd23f85c5ecda73faabdb5c1aca | 根据工件编号获取cnc程序列表 | namespace IMES.Station.Interface.StationIntf
IList<string> Get111ListByPCB(string pcb, string family); | 0 |
de0ea848b175898c83c276b8c21e09dd | 5533a9d21ddf81729cc402a15b4eaa57 | Defragments the item section of the lookup table,
which gets fragmented after removing keys or updating values. | ListenableFuture<DefragmentResponse> defragmentMember(); | 1 |
5c7a3cc4c3c80fc1646e992d1e77838c | 3586e127d7bbd21b45595608077dc26a | Guided tour can be started from infoOverlay. Its content is Markdown – we can only
inject JavaScript through its renderer and therein we do not have access to our React
models. Therefore we have to dispatch an event – listen to it here and start guided
tour when it's fired. | function guideOn() {
document.getElementById("guideOverlay").style.display = "block";
} | 0 |
d0ad907fd876270f30d03c02f76d2cfb | 17e4864c5fde85e43258beb757e2d307 | Updates the balance displayed. | public class MainController
@FXML
private void handleBalanceUpdate()
{
mainApp.showBalanceUpdate(anchorPaneContent);
} | 0 |
21c731be0438b3ace2febb3fea57fab8 | d309a4e121a705ffb8ffa5a9f2b904c1 | DeviceInfoインスタンスの設定に従ってレイアウトを更新するメソッド | {
var meshmanager = GetComponent<MeshManager>();
if (logPosRot.layout == "layout_01")
{
objectSurfaceObserver.roomModel = meshmanager.Layout1;
}
else if (logPosRot.layout == "layout_02")
{
objectSurfaceObserver.roomModel = meshmanager.Layout2;... | 0 |
9aa6e4603555e5f0065e619cfa536ce8 | 44e61224e8e0157ffc99df0c965ea0e4 | Checks which pad frog landed on | function ball_lander(pad_pos){
let width = 0;
switch (pad_pos) {
case 0:
width = -300;
break;
case 1:
width = -210;
break;
case 2:
width = -140;
break;
case 3:
width = -60;
break;
case 4:
width = 20;
break;
case 5:... | 0 |
f792a8b7cd6c3c9fd4a31ffa172ea3d5 | 6c2ec0e67cfe112516f2e9cce8ae40d3 | Returns product ID for a given link. | class CommonSpider extends PaginatedSpider
protected function getIdentity($link)
{
return preg_match(
'/(?<=\/)\d{5,6}(?=\/)/',
$link,
$matches
) ? $matches[0] : $link;
} | 1 |
acb13bb099db820b72477f4ae8bad220 | b1f9e8e4e1d415a1574df971bb2371b3 | Converte uma linha em um dicionário. | ret = {}
lineArr = re.compile(r',(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)').split(rawLine)
for i in range(0,len(columnNames)):
try:
ret[columnNames[i]] = lineArr[i]
except:
pass
return ret | 1 |
2664d352b86390ede1397bca976398a4 | 51b4d42ee4c6707047554b3ad1463f22 | Returns the total number of cells in this matrix. | int returnValue = 0;
if (!matrix.isEmpty()) {
returnValue = matrix.get(0).size();
}
return returnValue;
} | 0 |
7d9b38e2f58cf762ad8f87ebaca94520 | ab1c30bedee3c410d4407d156c046489 | Returns a tuple with the winner solution | def solve(board):
solver = Solver(board)
solution = solver.AC3()
if (solution.solved()):
return (solution, 'AC3')
return (solver.BTS(), 'BTS') | 0 |
4494fceddcbb1cb2495cb2c6341c7f9b | 976ab46f4a2a8efded953664ca924812 | Change the map for different series
========== | function colorMap(mapTypeFunction,grey) {
if(mapTypeFunction.name==='resetMap' && $scope.resetAreas && !grey)
$scope.map.dataProvider.areas = _.cloneDeep($scope.resetAreas);
else
_.each($scope.map.dataProvider.areas, function(country) {
... | 1 |
2881c43b62393f62d694da7c34946ec5 | 83092c2de381c35ed958c75eee5cfd14 | Parses a LocalDate object from the provided string and date format | @Component
public class LocalDateFormatter implements Formatter<LocalDate>
@Override
public LocalDate parse(String text, Locale locale) throws ParseException {
return StringUtils.isNotBlank(text) ? LocalDate.parse(text, DateTimeFormatter.ofPattern(PATTERN)) : null;
} | 1 |
5a07e6b3315574c10a7997014f2a9913 | 18b05ddf7f5325bd2619e9bc8ab278f7 | 从队列的头部删除一个节点,如果他是最后一个节点,将rear设置为NULL | int deleteHead(LinkedQuene * quene){
if(quene->front == NULL){
return false;
}
int data = quene->front->data;
QuenePtr front = quene->front;
if(quene->front == quene->rear){
quene->front = quene->rear = NULL;
return data;
}
quene->front = quene->front->next;
free(... | 1 |
098e76bcf1eff2f3fbf612c45aec6ca9 | 6bc92735b69508d754a0848b39b8f490 | runs prediction on the image while returning the class name and index number | def predict(path,image_size,probability_model,class_names):
immy=prepare_image(path,image_size)
predictions = probability_model.predict(immy)
type_index=np.argmax(predictions)
return class_names[np.argmax(predictions)] | 0 |
792b8c32ca87860c92e2df973ff7bfc4 | ba91d77aaeeac43c5de50a8e331aba5f | Explicitly included in base class to force it to be abstract. | open abstract class AbstractClass
open abstract fun abstractMethod() | 1 |
e7e3ae30adf3cf821d45994e9a526c02 | 51518c8467d1c66fca7de571d5ce16d8 | Moves figure of current player for given figure-id. | public class PlayerManager : IPlayerManager
public void MoveFigureTo((int x, int y) coords)
{
MoveSelected(coords);
Deselect();
} | 0 |
592dfefcd4bc874d0536dc2d0515efc7 | 426af26e75a14e10ef8609a783070340 | Remove a module from the program.
Its dependents will also be removed. | {
unset($this->modules[$moduleID]);
$registeredModules = $this->registeredModules;
$this->registeredModules = array();
foreach($registeredModules as $entryID => $entryIDs)
{
foreach($entryIDs as $event => $events)
{
foreach($events as $moduleNumber => $module)
{
if(isset($this->... | 0 |
db6e52ee61b77387465084ff582c0cdf | 9f224a6a668ae95b56bb7c9396eb7821 | 排序置底 | Map<String,Object> columMap = new HashMap<>();
columMap.put("classification", classification);
Sort sort = sortDao.selectById(projectId);
if (sort == null){
return ServerResponse.createByError();
}
List<Sort> sortList = sortDao.selectList(new QueryWrapper<Sort... | 0 |
12f85d7f6bab33ec35ffd31753a23b66 | 9a6ac1509fdb4994af61d63055e697f5 | 更新tad_web_mems某一筆資料 | namespace JSCERT.BLL
public partial class m_WebData
public bool Update(JSCERT.Model.m_WebData model)
{
return dal.Update(model);
} | 0 |
6cd8361ba7d8b48a7cae0c00953939a6 | 1f64e48161f88e314b5d1b872b3f117a | 从txt文件中导入试题 | public List<String> importFromTxt(String txtFilePath); | 1 |
5de089393ff527eaee10f6401d39c770 | e47bba1276b027d95faead8d65a73755 | Merge two sorted spans of an Array of int's, placing the result into a destination Array, starting at an index. | if (start >= end) {
return;
}
int finalArgumentIndex = end - start;
for (int indexCounter = 0; indexCounter < finalArgumentIndex; ++indexCounter) {
dest[indexCounter] = src[start + indexCounter];
}
dest[finalArgumentIndex] = NULL;
} | 0 |
0b5293a1c6d573292b46ef71b7111bd8 | dbe281e993f566c69c6af494d42f17ab | Tính khoảng cách từ 1 điểm đến đích</br>
Đầu vào là số thứ tự của điểm đó (từ trái sang phải từ trên xuống dưới)</br>
Số thứ tự này được tính bằng cách : ô [i][j] có số thứ tự bằng (31*i +j)</br> | int IG=0,JG=0;
switch(num){
case 0: IG=3; JG=3; break;
case 1: IG=0; JG=0; break;
case 2: IG=0; JG=1; break;
case 3: IG=0; JG=2; break;
case 4: IG=0; JG=3; break;
case 5: IG=1; JG=0; break;
case 6... | 1 |
50e85925bed31c1712c2bf31202eca7a | 7280ce4c0872c90417079f4683b3ba90 | Create new MongoId object
. | if (empty($_id)){
return new MongoDB\BSON\ObjectID();
}else{
return new MongoDB\BSON\ObjectID($_id);
}
} | 1 |
4086732d998179698dd52f5b31ec0224 | 5604534f7c881c52119ec8f80407a2f6 | Sets flag to indicate whether or not we are finished reading from STDIN. | int ATisFinishedReading(BinaryReader binaryReader){
return binaryReader->isDone;
} | 0 |
334367357fce0e64eacaee372a8b6fe6 | 44e308fa48204a77c949459ce0a8a029 | 删除带压缩图片的文件 | public class PhotoViewActivity extends FragmentActivity
public void clearCompressPicture() {
if (null != mCompressSuccessMap && mCompressSuccessMap.size() > 0) {
for (String key : mCompressSuccessMap.keySet()) {
String url = mCompressSuccessMap.get(key);
File file = new File(url);
if (file.exists()) {
... | 1 |
722581c952177db20016a14ed71d8152 | 904e91833b393bf3e1ced2ffa9bdd212 | Elimina las stopswords de la linea pasada como argumento | def removeStopWords(query):
stop_words = open(sys.argv[1])
query = query.split(" ")
for stop_word in stop_words:
stop_word = stop_word.strip('\n')
query = [word for word in query if word!=stop_word]
query = " ".join(query)
return query | 1 |
65388a346293d44ec5bcf6258660dc72 | 080120f9674292eeb6eeb9c7378eed88 | Test the calculation of g_θ, regarding the shapes of the returned tensor. | mu = np.ones([1, 4], dtype=default_float())
sqrt = np.ones([4, 1, 1], dtype=default_float())
known_shape = gauss_kl(*map(tf.constant, [mu, sqrt]))
unknown_shape = gauss_kl(mu, sqrt)
np.testing.assert_allclose(known_shape, unknown_shape) | 1 |
12ca88c47372bae26e90a6e8a7a51105 | 9458d1bb1a5094b433919f75f271315d | Checa os tipos envolvidos com operadores lógicos. | class laSemantics(laVisitor):
# variável que vai armazenar todos os erros da etapa semântica
def visitOp_logico_1(self, ctx:laParser.Op_logico_1Context):
return self.operadores.get(ctx.getText(),"") | 0 |
6f8fc2ecea7c5a03d33c4eeb027b24c4 | c644f0b585abd03ecead55eb5f189f3a | Pass in file_path (normalized here using normpath) to get stored hash for
that path
KeyError -> None | class HashTool:
def get_file_hash(path):
return imagehash.phash(Image.open(path)) | 0 |
f2b86df87c4a8228bee0517f987ac6aa | 0508fbebc22de75ba7bd37c6f9796721 | Literal Definition -> | class Literal(Expression):
def __init__(self, value, type):
self.value = value
self.type = type | 1 |
b0a46106a030b10824c4caa9adf57b08 | 63f2d4dbc3ac1b56ceceb83f0d8c7fad | True if command execution failed | class CommandBlockShell(BlockShell):
def has_failed(self):
return self.testforblock(self.wrapped.block_id, self.wrapped.data_value, {"SuccessCount": 0})() | 1 |
2775e6af1e8b791dedbe69d947606e84 | d01b338e4e610eda11c4b38013c21ee0 | Remove all buttons from the menu | void CBCGPPopupMenu::RemoveAllItems ()
{
CBCGPPopupMenuBar* pMenuBar = GetMenuBar ();
ASSERT_VALID (pMenuBar);
pMenuBar->RemoveAllButtons ();
} | 1 |
736dd98ab9d963dfc30b10d9e5a8d987 | be08272260a56dc669c25fa946ba2d88 | Creates an instruction which computes the absolute value of its operand | LDA_abs::LDA_abs(int operand, CPU* cpu) : LDA(operand, cpu) {} | 0 |
4a084caf873150defbfdf8be7c69e1be | 0bff5ea2f07924d6eb59a06d0674a54f | Finalize current registration process. | class CmsCoreServiceProvider extends ServiceProvider
protected function finalizeRegistration()
{
$this->getBootChecker()->markCmsRegistered();
event(new CmsHasRegistered);
} | 1 |
c14a26bcb231f259cea80b841bf9cfe7 | 952741c9cff6b70cf53334b9c35688c5 | 하나의 문자를 입력받아 숫자인지 여부를 판단하는 프로그램을 삼항연산자를 이용하여 구현하시오.
(System.in.read()를 사용하세요) | public class Application2
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("정수를 하나 입력하시오 : ");
int num = sc.nextInt();
if(num % 2 == 0) {
System.out.println("짝수다.");
} else {
System.out.println("홀수다.");
}
sc.close();
} | 0 |
7629e9a778a15c26404813cfb4b3657d | 6747740f0be98615bc5792d702373d74 | Insert an interest to the database | class InterestManager extends BaseManager
public function addInterest($userId, $interestName)
{
$interest = $this->sendCypherQuery('
MERGE (i:INTEREST {name: {name}})
WITH i
MATCH (u:USER)
WHERE id(u) = {userId}
MERGE (u)-[r:LIKES]->(i)
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.