query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b01afa2578c8406d993641f363342587 | 457763030c080e87adc5e531adae1ed4 | All included members need context binding | public void NonMethodsWithArgs()
{
var source =
@"namespace N
{
class C<T>
{
object F;
object P { get; set; }
void M()
{
N(a);
C<string>(b);
N.C<int>(c);
N.D(d);
T(e);
(typeof(C<in... | 1 |
9327c10d47f90b73120ebda2927de7b6 | 5405aa68a5eb265c347436593959dc0f | получить профилировочную статистику, отсортировать по наименованию секции | class TimerStats(Object):
def getSections(self):
rv = monteMap()
for k, v in self.sections.items():
rv[StrObject(k)] = DoubleObject(v)
return rv | 0 |
8e6a6bf6a344810ecdfa04d76fff3e8d | b9d7ffd57e8b92425085cd5a75889301 | Disable return Key from Submitting the form | public partial class ussr_dbfimp : Bars.BarsPage
protected void gv_PreRender(object sender, EventArgs e)
{
gv.Attributes.Add("onkeypress", "if (event.keyCode == 13) return false;");
} | 1 |
bcf2977548ba329412c7ec9d8a79df47 | b1d12ff584c78d499875e45aeaf7648c | Returns the result of translating this matrix by a given vector, in
local coordinates. This matrix is not modified by this method. | public class Position
public Position getTranslation(int tx, int ty) {
return new Position(x + tx, y + ty);
} | 0 |
8f4d02a0edb629d3cf5576b321f862c8 | 30092d82caeba72b73d639942e79d2c8 | # Convert SteamID32Bits to 64Bits | function convertToSteamId32(steamid64) {
return steamid64.substr(3) - 61197960265728;
} | 0 |
3add0f059eceb1228793a8e013aad5fc | 6a61bba2fbe84c9c43111f2b0bb95b1b | 从文件中获取音符 | mid = mido.MidiFile(file)
timeleft = []
trackIndex = []
for track in mid.tracks:
timeleft.append(track[0].time)
trackIndex.append(0)
noteMatrix = []
time = 0
note = np.zeros(shape=(128, 2))
noteMatrix.append(note)
while True:
if time % (mid.ticks_per_beat / 4)... | 1 |
13a9613c63d082c7efc36160a70f6bb5 | 10bb7b82d5f6e95252b9ab30f9483be3 | Remove all identity roles from selection | if (event) {
event.preventDefault();
}
const { selectedIdentityRoles, identityRoleRoots } = this.state;
identityRoleRoots.forEach(newIdentityRole => {
if (_.findIndex(selectedIdentityRoles, (selectIdentityRole) => {
return selectIdentityRole === newIdentityRole.id;
}) === -1 &&... | 0 |
9ad68f458957908964a7aba342c495d4 | 9d63ee583b560b7f052b7b3b98272ce2 | Gets the average coordination number of cations. | double coops = super.getCoopVertices().size();
double noOfVertices = super.getNumberOfVertices();
return coops/noOfVertices;
} | 0 |
d0e08743d0e9e50f33246ee804fa80da | e84b017ce81649e92d2935cc96697da7 | Show the Login screen on load | public class LoginActivity extends Activity implements PlusOnGetDataListener
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
showLoginLayout();
} | 1 |
757d219fa787eae8dbd94f20332305c2 | 22eba869ffe3d27f379fca51040dab3d | Удаляем данные из БД | session = connect_db()
session.query(Prepared_data).delete()
session.commit()
return 'Данные удалены из базы обучения' | 1 |
44270682741f30666422dd2e376553ac | 67fe2e7446948f71f7adde828d6f2ce1 | 清空最高分
</summary> | namespace School_App_2020
static class TUI
public static void HSR()
{
Settings.Default.HighScore = 0;
Settings.Default.Save();
} | 1 |
003ae5f6f5ce9a4f19aef231c91bc5ac | c23f2ff950f57eb8198ae9495d5d59c5 | Get the admin api endpoint name. | public function getApiName(); | 0 |
54a533705b61a753d2a8f43c5e49038e | 634187255be816bd684f4a326aed9c9f | 判断构建日志里是否有用例执行结果记录(旧的日志里没有记录) | isFailed = False
with open(self.logPath) as f:
for line in f:
if line.lower().find("error") >= 0:
isFailed = True
break
return isFailed | 0 |
b5bfb8c397ba52b1733bd5847d90b9f9 | 07461565c45bbdc26baf9c562ac51b20 | 创造vclash-configs文件夹和configs.json文件 | func Create() {
CreateNewConfigFile()
CreateNewStateFile()
} | 0 |
f6aa4f0b09d8219be94406af701161af | 637b048f4b381645fdabf5623433a215 | Update the favourites stored in localStorage | class Gallery extends React.Component
saveFavesToLocalStorage(favorites){
let JsonReadyFavorite =JSON.stringify(favorites);
localStorage.setItem('data', JsonReadyFavorite);
} | 1 |
2553ce3f6ea619cd06d627958dd10823 | 2fc4aa1102de8bcd2d6296981fa2d65f | Write the start of constructor section that follows the start of an element. | public class XBISEventWriter extends XBISWriter
public void writeElementStart(String prefix, String uri, String name,
boolean hasa) throws IOException, XBISException {
setHasContent(true);
m_isStart = true;
int lead = NODE_ELEMENT_FLAG;
if (hasa) {
lead |= ELEMENT_HASATTRIBUTES_FLAG;
}
OutputName... | 0 |
94bccf347d43c2d5d0de77487e6b7655 | b7f727e1a6f128d077ae666a141e02cf | NewCode64 returns a random Code64 | id, err := uuid.NewV4()
if err != nil {
return "", nil
}
return id.String()[:6], nil
} | 0 |
717a75a3a060a14c1e079e1dcd9c6a2d | 3d6a5e96a91a493da120ddc3ce6be232 | retrouve la note personnelle dont on fournit l'identifiant | {
$note = $noteRepository->find($id);
if (!$note) {
return $this->json([
'error' => 'La note ' . $id . 'n\'existe pas'
],404);
}
return $this->json($note, 200, [], [
'groups' => 'note'
]);
} | 1 |
4a7e7448fe029fa25396893a705d5eb9 | 53d0cf37810c311022beb208dc2d6992 | Flash the LED | void LedFlashingProcess(void) {
#if 0
if (timerLedFlashing > 1) {
IO_LED_Toggle();
timerLedFlashing -= 1;
}
#endif
} | 1 |
f187d3859f4d9ac022a4d951ba207a1d | e005d307d932558853e985374119b2a6 | Returns the meta object for the attribute '{@link org.cpntools.accesscpn.model.graphics.Coordinate#getX
<em>X</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> | EAttribute getGraphicalIndividualEement_PositionX(); | 1 |
9278b5be0e7d1a3520d1909b00b8a02d | 39bb9b31b8dd49088b0b4e198e4d981a | Event handler for the insert modification button click. | function btnInsertOnClick() {
initModal();
$("input").val("");
$("#btnSave").css('display', 'inline');
setInputEditable(SUBJECT_TYPE_MODAL_ID, false);
} | 1 |
63ac9c01edf11a58f3c89f6979a94071 | d31a523124f284aa469a504e32c488dd | get the current local position -> note we need to change the sign of the down coordinate to be altitude | public class DynamicCoord
public float getLocalY() {
return box.getHeight() * this.y;
} | 0 |
631826138217f023b7fa6c518bcff52f | 87ed568e2410927cc4418490aae112c7 | Set the guarantee id | {
if (!$item instanceof \Devlabs91\TravelgatePushApi\StructType\Guarantee) {
throw new \InvalidArgumentException(sprintf('The Guarantee property can only contain items of \Devlabs91\TravelgatePushApi\StructType\Guarantee, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE... | 0 |
20321fd5a5596021f2da45d1fa1de6b2 | 795e5f66262ab5381bbbca576fbec39a | r'''
Returns True if the dicom instance seems to have image data, otherwise returns
False. | class FitsImage:
def has_detections(self):
return self.sourcecatalog is not None | 0 |
e6760ddd09fc8f31f158f2b0f5fcabdd | 3572549d89fcc7a46c2dabd5cd61b113 | 计算并返回operator对象所有子策略中最长的策略形成期。在准备回测或优化历史数据时,以此确保有足够的历史数据供策略形成
Returns | class BackTest:
def getStartEndTime(self):
target_pos = None
start_date = None
for date in self.backtest_dates:
try:
target_pos = self.strategy(self.data, date)
except:
pass
if (not self.checkWeights(target_pos)) and ... | 0 |
d17432916047e1169df86f8e35e58d4d | 0764255f7e1d0cb45d5c96155367762b | Update all event handlers for every point | {
var pointSet = new HashSet<ProgramPointBase>(programPoints);
foreach (var point in pointSet)
{
onPointCreated(point);
}
} | 0 |
d11af63fb4a69f6732e94c8fb6ca875c | 9773daa23f47ead83a7f3bdab0dfe19f | 确认密码错误提示信息是否存在 | class DoubanCookies():
def password_error(self):
try:
return WebDriverWait(self.browser, 5).until(
EC.text_to_be_present_in_element((By.CLASS_NAME, "fatal-msg"), '用户名或密码错误'))
except TimeoutException:
return False | 1 |
f3d139248361fdb223a41e3bbd9a2e30 | fb3265c0cb4a515dcbead2dd1408241a | 根据本地文件路径读取byte[] 数组 | Path filePath = Paths.get(path);
byte[] arrByte = Files.readAllBytes(filePath);
return arrByte;
} | 1 |
3e8a5848633a8201d91f8cf0cb7841e8 | 9cad131d4415108c2d165ed3bc750d57 | проверка признака несовместности системы ограничений | void Irreflexive(){
flag_irr = true;
for(int i = 0; i < n; ++i){
if(matrix[i][i] == 1){
flag_irr = false;
break;
}
}
} | 0 |
eba0c3bca480f29327d6db267e54a6be | d2fee36764d7d219b34dcc9dc52326ff | Gets the player's chosen difficulty | Spinner spinner = (Spinner) findViewById(R.id.diff_spinner);
String difficulty = spinner.getSelectedItem().toString();
if (difficulty.equals(Utility.ALL)){
return null;
}
return Difficulty.valueOf(difficulty.toUpperCase());
} | 1 |
f94d8d5754203ed0a17731d189ef3a4a | eda956f8eaa08c412a447c47de4ab5b7 | 返回ContainerListener类名集合 , 这将自动添加到新创建的Wrapper中. | Set<String> getListenerContainerIds(); | 0 |
8aad031d71239c6f8d2de104cd3504db | d5649c271004cafeae428f20393c3d9f | convert ASCII callsign to AX.25 address with SSID | doax25(argc,argv,p)
int argc;
char *argv[];
void *p;
{
return subcmd(Axcmds,argc,argv,p);
} | 0 |
bf2382cbac9ea23ab43eeaf819a40141 | 3dd1c4915b390cdf59ec7dfa508913e7 | !
Returns the aspect ratio of the viewport region. The aspect ratio is
calculated as pixelwidth divided on pixelheight. | float RenderWindow::getWindowAspectRatio()
{
return (float)mScreenWidth / mScreenHeight;
} | 1 |
ca569bef669c1d5880a3497a1ab51d0a | 83b8e88c1df91d39e17061abaefedaed | TestCase_Buddy_normal - debug how to use buddy system. | unsigned int index;
kernel_printf("Buddy-system :\n");
kernel_printf("\tstart page-frame number : %x\n", buddy.buddy_start_pfn);
kernel_printf("\tend page-frame number : %x\n", buddy.buddy_end_pfn);
for (index = 0; index <= MAX_BUDDY_ORDER; ++index) {
kernel_printf("\t(%x)# : %x frees\n", in... | 1 |
2ed7fddf85c06a2585868a44c06119c4 | 041d97ea74f0e072381352452f846791 | make closure. c is code. e is ctx.environment | var_names = closure[1]
body = closure[2]
env = closure[3]
new_env = extend_env(var_names, var_values, env)
_eval(body, new_env)
end | 0 |
5d0f9ff83d99ec0d70c94c2d75f99cd6 | c5c833c94fc5877bd944b596e3c544ac | K-Means聚类算法的构造函数 | class kMeans_l1:
def __init__(self, k = None):
if not k:
k = 2
self.k = k
else:
self.k = k
return | 1 |
27c5b6ee3a424b31f9250077ce641aa7 | 644390c4d316fa992b182e543f7a25e2 | Retrieves Element with the longest sequence. | namespace Aardvark.Base
public static partial class SequenceExtensions
public static TSeq MaxElement<TSeq>(this IEnumerable<TSeq> sequence, Func<TSeq, float> element_valueSelector, float maxValue = float.NegativeInfinity)
{
if (sequence == null) throw new ArgumentNullException("sequence");
... | 0 |
5cf6c014bc242af7912f1f585007a29e | 3841d796b6d63d571902e907a132b945 | Limit the number of boxes, and pad if necessary. | class BaseBoxes(metaclass=ABCMeta):
def clip_(self, img_shape: Tuple[int, int]) -> None:
pass | 0 |
f33f6228c6c3aaa55d5363eee9342b26 | b47030535c3870078e556d247bd046ac | Non-standard multidimensional scaling with custom dissimilarity matrix | max_iter=300, verbose=0, eps=1e-3, n_jobs=1,
random_state=None, dissimilarity="euclidean"):
self.n_components = n_components
self.dissimilarity = dissimilarity
self.metric = metric
self.n_init = n_init
self.max_iter = max_iter
self.eps = eps
self.verbose = verbose
self.n_jobs = n_jobs
self.r... | 1 |
15a317222247c2fcad9906237985ca83 | f567a771f957c0f375efa644993a8efa | 返回保存后自动更新字段 | {
if( static::$autoTimeFieldSet ){
if( count($this->getDirtyAttributes()) !== 0 ){
$this->updated_at = date("Y-m-d H:i:s",time());
}
}
return parent::beforeSave($insert);
} | 1 |
5d870f92dab5d56627395074a73abbe9 | 9ab6c8f4776d65c1a91c44534610c4f4 | create a browser compatible CORS upload request | var xhr = new XMLHttpRequest(),
upload = xhr.upload,
start_time = new Date().getTime(),
boundary = '------multipartformboundary' + (new Date).getTime(),
builder;
builder = getBuilder(file.name, e.target.result, boundary);
upload.onloadstart=function(e){obj.queueEvent("upload_start_handler", file);};
... | 0 |
fdb4c75fc1b13ce293adbf475545917c | 451d00d0a3c12fbe7c1d19d9f283e42e | *************************************************************************************************
*************************************************************************************************
finds the main frame | namespace SmartCalendarTIC
public partial class Elearn : Page
private IHTMLElement FindFrame(IHTMLElement parent)
{
IHTMLElement rez = null;
foreach (IHTMLElement ch_el in parent.children)
{
if ((ch_el.tagName).ToUpper() == "IFRAME")
{
... | 1 |
fa29b46d565d9753a9646f823bcc1ad2 | 93a76a00c5ed94f2c0065489361d3352 | 判断是否有跨服boss | if (!FunDefine.isFunOpen(FUN_TYPE.FUN_SERVERPVEBOSS)) return false;
if (!DataManager.getInstance().dupManager.crossPVEBoss.isOpen) return false;
return DataManager.getInstance().dupManager.crossPVEBoss.fightcount > 0;
} | 1 |
fa17e97ba81e21ffac157b0b7a3deed1 | 9ad6edf0753d0936c775a59e5a9d538f | replace the restore success with a failure | auto rollback_ce_dir = create_data_misc_ce_rollback_path("TEST", 0, 41);
auto rollback_de_dir = create_data_misc_de_rollback_path("TEST", 0, 41);
ASSERT_TRUE(mkdirs(rollback_ce_dir, 0700));
ASSERT_TRUE(mkdirs(rollback_de_dir, 0700));
EXPECT_BINDER_FAIL(service->restoreAppDataSnapshot(std::make_optional<std::s... | 1 |
3dcfe16612174916263e5051ae185ff9 | 135ffa2192989f5a4b121e610332f5df | update the number of beers left | Port & Port::operator-=(int b)
{
bottles -= b;
return *this;
} | 1 |
ce71a2edfd99de8bc22e915a7c329ed9 | 24a9e2bf80617b609f3cc82a3a9c72db | Get all modules of common processors. | public class RequestProcessorManagerImpl implements RequestProcessorManager
private Map<GlobalRequestProcessor, Set<ModuleIdentifier>> getCommonRequestProcessors() {
return m_commonRequestProcessors;
} | 1 |
7c37ac0e22a8c8e3ee0662bcb919beeb | a7d8275377fa0948c98b88841ff330b0 | Standardization (centering and scaling) of dataset that removes mean and scales to unit variance | def standarize_dataset(df):
scaler = StandardScaler()
df = scaler.fit_transform(df)
return df, scaler | 1 |
0a6902b1185906e414ec24925e7d7ff4 | 30d86ad5fa3626715032e0f6670eca6d | 分段取出,取出Map的一个Value(列表)中的一段 | public class ToMap
public String getValue(Map<String, String> map, String key, Integer index){
String value = map.get(key);
String[] values = value.split(",");
return values[index];
} | 1 |
ad9d0d1405b4ae8bd3d9b82f5e4d9873 | f596dbfd188ed95b2518a889d6981da6 | initilize process table to all zeros | void initializeProcessArray(ProcessInfo *pProcessArray)
{
memset(pProcessArray, -1, sizeof(ProcessInfo) * PROCESS_ARRAY_MAX_LENGTH);
} | 0 |
24467571533ee13aa486525623ee7718 | 2479c0b9464f99db7fc67a0655637b0c | Attempt to fill in oauth_data name fields for availabile data | class OAuth_Salesforce extends OAuthProvider{
public function identity_response($params){
$params['organization_id'] = 'organization_id';
$params['first_name'] = 'first_name';
$params['last_name'] = 'last_name';
$params['display_name'] = 'display_name';
... | 1 |
06a57df1c3d0aed68ab74f4f6a95d446 | 39320046fe2211a5b9be779070028b04 | Multiplies two ComplexNumbers together. | {
return new ComplexNumber(left.Real * right, left.Imaginary * right);
} | 0 |
f41a08858cf3070a82dabc1942d1354b | 7a647619962992a758e7ef590b57aa6d | Method to format Class into xml-Tag. | {
XmlElement element = XmlHelper.CreateElement(doc, name);
XmlHelper.AppendTextElement(element, XmlHelper.ClassNameTag, ClassName);
return element;
} | 1 |
1d22a129bb29eda36acb60472330e13b | 1cbb951af5cd4ccf472156d861bd2b5a | Load up the Account activity | public class AccountActivity extends Activity implements ViewTransfer
public static void show(Context context) {
context.startActivity(new Intent(context, AccountActivity.class));
} | 1 |
f3626f5db66d30374d1a517d586547b2 | d18061bd54bcc2724f2ca0b6f6637aab | First we get the position of the paddle, then to calculate the new
position of Ball, we add the initial difference to the new paddle position. | public class Ball : MonoBehaviour
public void ballStartingPosition()
{
transform.position = paddle.transform.position + paddleToBallVector;
} | 1 |
9b20866658824993c3be5404aa355024 | 59abc63bc1bf2f423dd1c7d28cb5b05f | 通过淘宝搜图API搜索图片并返回最高匹配度商品 | $obapi = self::openkey();
$api_data = $obapi->exec(
array(
"api_type" =>"taobao",
"api_name" =>"item_search",
"api_params"=>array (
'q' => $keyword,
'start_price' => $start_price,
... | 0 |
c414098b20f667e59140e2f70b3c05c7 | 7bbd662ced98fb13a786b1ab2159578d | 返回某课程所有小节的id | cids_list = []
for i in courses:
cids_list.append(i.cid)
return cids_list | 0 |
2449308871037ea98979a4b3e437d338 | 814e7a5ba4880afb92a362485083c05c | r"""
transform ts to image with recurrence plot. | def ti(data, step=100, method='heursure', mode='soft', wavelets_name='sym5', level=5):
num = math.ceil(len(data)/step)
final_data = [0]*len(data)
for i in range(num):
temp_data = right_shift(data, i*step)
temp_data = tsd(temp_data, method=method, mode=mode, wavelets_name=wavelets_name, level... | 0 |
d3eb0faec129b7f1942f47246b57c517 | 3c6b4d3751ea14e4142bea2da82efa30 | Set the evaluation mode. | class TaskSpec(object):
def eval_mode(self):
return self._eval_mode | 0 |
ccce6118f2a83408d560fdba5285a963 | 88c855f56a97df6c5439e0c86a854eda | https://stackoverflow.com/q/12412782/1066234 | def progress(iterable, prefix='', suffix='', decimals=1, length=50, fill='█', printEnd='\r'):
total = len(iterable)
def print_progress(iteration):
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total)))
filled = int(length * iteration // total)
bar = fill * fil... | 1 |
cbeff860344548cdf112284001968df4 | 288cc17e7da9f70aaa83748e868b07f1 | make the assumption that the owner is the first parent resource which implements Principal | public class FinderServer extends FinderPOA
implements Block, LogEnabled, Contextualizable, Composable, Configurable, Initializable, Disposable, FinderService
private StandardPrincipal getPrincipal() throws Exception
{
if( manager == null ) manager = PrincipalManagerHelper.narrow(
orb.resolve_initial_... | 0 |
5384bb9f9a7c00284d5b6bc66af35f8e | ac2cc07e31fcaad5dae5243a5b3a99b1 | Clear the contents of the kernel trace. | static void clearLog(void) {
memset((void *) kmalloc_ptr_log, 0, sizeof(log_row_t) * LOG_ENTRIES);
} | 1 |
3757c4ab065a666c03764ac59cb129d3 | 214eeedb9169c9fa095f5777702ced21 | https://github.com/ruby/ruby/blob/trunk/README.EXT#L682 | def ruby_check(options={})
require 'open3'
Dir["**/*.#{options[:extension]}"].each do |file|
next if file.match("vendor/rails")
next if file.match("vendor/plugins/.*/generators/.*/templates")
puts file if options[:verbose]
Open3.popen3("ruby -c #{file}") do |stdin, stdout, stderr|
... | 0 |
428d3ef3103fc99f23faf4c07a918fe6 | 7009075ec6822f276a2423e9fdc7256c | New creates new howi application instance | func newInstance() *Instance {
pInstance := &Instance{}
pInstance.g = gin.Default()
pInstance.cors()
pInstance.registerInterfaces()
return pInstance
} | 1 |
d83832565c2efe621ae2c1bec36b90b2 | ac1f4fbd219ee1b299442390b7645196 | @brief Pass control to next thread that is in state \b READY. | namespace olivia
void Fiber::YieldToReady() {
Fiber::ptr cur = GetThis();
OLIVIA_ASSERT(cur->m_state == EXEC);
cur->m_state = READY;
cur->swapOut();
} | 1 |
95b6aea3da38213c6d890687d0c456a8 | 9500b8a5c15beb499374f63a2eac063b | =>向事件池中追加方法,同时做”去重“处理 | function EventHandler:add(func)
if not self:has(func) then
self._list[#self._list + 1] = func
end
end | 1 |
9dff137f6b80d2fa3917cf725eb5f0fe | 0cfc87eb26563a55071c994993cb6c63 | 获取被邀请人姓名 | String displayName = null;
try {
String from = getDialogPath().getInvite().getFrom();
displayName = PhoneUtils.extractDisplayNameFromUri(from);
} catch(Exception e) {
displayName = null;
}
return displayName;
} | 1 |
b73dd5e57e7be8ca55d768f1456fd38a | 2191a37eb8d4e2b6023d3118007168d8 | преобразование массива байт в строку, где каждый символ представлен двумя 16-ричными цифрами
{0xFF, 0xD1, 0xFF, 0xD2} --> "FFD1FFD2" | {
StringBuilder sBuilder = new StringBuilder();
foreach (byte item in sourceArray)
sBuilder.Append(item.ToString("x2"));
return sBuilder.ToString();
} | 1 |
e39492ffb10f6760488dc2ec25524bb2 | 3a33af8543b36a889f608a5f63115f25 | https://www.hackerrank.com/challenges/s10-poisson-distribution-1/problem | def poisson_probability(actual, mean):
return math.exp(-mean) * mean**actual / math.factorial(actual) | 1 |
23effcee35becccabcef58d31eaa41c0 | 6e23babe4abea6560b9a864e753a679e | Validates that the file has been recently saved. | public class RiskModel implements ModelListener
public boolean isSavedFileValid() {
return isSavedFileValid;
} | 0 |
5dc70f806a6a384b0e8985559cbc0cfb | 1445fd068dfc330ee6feb7abdb7b1328 | Create q from dcm (Matrix3) | class Quaternion(QuaternionBase):
def _dcm_to_q(self, dcm):
assert(isinstance(dcm, Matrix3))
arr = self._matrix3_to_dcm_array(dcm)
return super(Quaternion, self)._dcm_to_q(arr) | 1 |
e2d7956efadf563bf5df5400fffd6f71 | 77f8d5c917aa1c0f647a426ce26110b1 | Handle the finishing of the spectrum processing process.
This handler must be called when the process is done processing the spectra. Depending on the outcome of the
process, set a message in the Waiter window. The message to be set is decided on by the passed parameters. | self.watch_data.changed_file = changed_file
if changed_file is None:
self.watch_data.error_msg = "Keyboard interrupt"
elif changed_file == "":
self.watch_data.error_msg = "Got QUIT signal"
else:
self.watch_data.error_msg = ""
for plugin in self... | 0 |
6d05dfef5539490a2c9bea7b28bd408c | f14ffe219716ba1952afc5e2fe321d3d | Unregisters all the registered commands on this command manager | {
foreach (Command command in this.getCommands().Keys)
{
this.removeCommand(command.getCommand());
}
} | 1 |
582b70489fac2f3c3c8f2aec779929a1 | a83d8ba738aa726af0a6616a3a878caa | Construire aléatoirement un graphe par sa matrice d'adjacence. | W = np.zeros((nodes, nodes))
while W.sum() < edges:
pair = sorted(set(np.random.randint(0, 302, 2)))
if len(pair) > 1 and W[pair[0], pair[1]] == 0:
W[pair[0], pair[1]] = 1
return W + W.T | 1 |
32e66033db94e7770bef67de732d5b28 | 875edf6ecf448ba9e1f43858720aae8f | add a user to the current users friend list and add current user to the other users friend list | {
foreach (Contact c in cd)
{
if (c.username == words[0])
{
user = c;
}
else if (c.username == words[1])
{
friend = c;
}
}
user.... | 1 |
12fb6e01d2751e4a07ce44c0d101c148 | 54c1e28b35b04825e5d43f870c1d5338 | Define the receiver height; this is required before calling
correction() or any of the zenith_delay routines.
in meters. | namespace larcfm
void CRSS::setHeight(const double height) {
H = height;
} | 1 |
3770868b8ffad73af76d9d69ad7743fe | 8f2ca6960731b906a153b08bf3ae275f | タイムライン用タイマーの作成 | public class AddActivity extends AppCompatActivity implements View.OnClickListener
private void createTimer() {
countDown = new CountDown(TIME_LIMIT, 10);
countDown.setOnFinishListener(new CountDown.OnFinishListener() {
@Override
public void onFinish() {
Intent i... | 1 |
bba298cdcfa7747cf23e854cf7db9599 | 4c32ffc0dc7e3334675624a89050d244 | @brief This function writes the Default configuration data to the EEPROM.
This will change the Default configuration (To be used carefully). | void EEPROM_WriteDefault(void)
{
Check_PCB();
EEPROM_write_byte(Mode_Select,Work_Type);
EEPROM_write_byte(C_F_Select, 0);
EEPROM_write_byte(Type_Select,0);
EEPROM_write_word(TC_Zero, 0);
EEPROM_write_word(TC_Span, 1400);
EEPROM_write_word(RTD_Zero, 0);
EEPROM_write_word(RTD_Span, 850);
EEPROM_wr... | 1 |
73e61b3e1a19c0c424e6943869cbc986 | 2ec1cb19509bd02969cbdecf43b817c6 | Gets press icon path. | class IdentificationCodesSettingsForm extends Form
function getPress() {
return $this->_press;
} | 0 |
8be095149e5a3e8f96559efe7101e5b5 | 997036cf025ffaf607459d5638d18895 | Returns the meta object for class '{@link RootElement.Booking <em>Booking</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EOperation getIBookingManager__ConfirmBooking__Booking(); | 0 |
52c414e824cfabed8fe82266a9fcf537 | 676484fcd8e183a770446f45e4b61f6d | 设置鸡蛋个数 | setSelfEgg(num) {
this.txtSelfEgg.string = num.toString();
} | 1 |
d97eb58f74cc904c2ce4b93111aaf498 | ca8c367304c930a7480adf5f07016c36 | Преобразовать конфигурацию проверки в транспортные данные для VM | var netObj = {};
netObj.Name = $(editNameConfig.input).val();
netObj.Bandwidth = $('[name="Bandwidth"]').val();
netObj.NetworkId = $('[name="NetworkId"]').val();
netObj.NetworkType = $('[name="NetworkType"]').val();
netObj.ServerLinks = [];
$(itemSelector).each(function () {
var serverObj = {};
se... | 0 |
b2fabc05deb897de56fd0ac97724fd83 | 8b70619cc53d482b85f217ee34c2a4d7 | Count the white pixels in each third | temp = []
pixel_counts = []
for digits in thirds:
for third in digits:
count = 0
pixel_data = list(third.getdata())
for pixel in pixel_data:
if pixel == white: count += 1
temp += [count]
pixel_counts += [temp]
temp = []
... | 1 |
989513527fa2f4140107b8dc24cde96f | eb5e27245a82031d2cb9b725c91d598c | 获取某个组合构件中使用的公用预留区 | @Query("from ComponentReserveZone where type=? and isCommon='1' order by showOrder")
public List<ComponentReserveZone> getCommonReserveZoneByType(String type); | 1 |
634ec9eb1a67ef154dd901832caf7a7b | 8beecc28ea9ca1071ba15adca79a9c2e | Filtre flou | {
string nomfichier = this.CheminOrigine;
try
{
Projet_Vincent_Poupet.MyImage imageflou = new Projet_Vincent_Poupet.MyImage(nomfichier);
imageflou.FiltreFlouPlus();
imageflou.EnregistrerImage(this.CheminEnregistrement);
... | 1 |
1567432e3f12d8a2adb8665a699489b5 | b71c62b67bc2be7aae975f3e533b05c8 | 获取元素的行高 px 数 | let { lineHeight, fontSize } = getComputedStyle(el)
let value = parseFloat(lineHeight)
if (isNaN(value)) {
value = parseFloat(fontSize) * NORMAL_LINE_HEIGHT
}
return value
} | 1 |
b9d1d8c067a981552786a02b15b095dc | 96a754acc32be7fd80b6d70114fc80ee | Function that stores the key from user input into the empty dictionary defined above | rest_input = raw_input("Enter a restaurant name: ").title()
rating_input = validate_rating()
dict_name[rest_input] = rating_input
return dict_name | 1 |
874233087b6a041a0cc7f945a5e25a0e | db266be4a579d9234fc1b042ff145759 | 从左边第一个不为0的字符向右按顺序拼接数字字符 | int length = data.length;
for(int i = data.length-1 ; i > 0 ; i --){
if(data[i] == 0){
length --;
} else {
break;
}
}
String str = "";
for(int i = 0 ; i < length ; i ++){
if(data[i] > 9 && data[i] < 16){
str = intToChar(data[i]) + str;
} else {
str = data[i] + str;
}
}
re... | 0 |
fc9031f1d13bf11d67f5d9a158c9a5c2 | 1218a97182145f8651281d9dbf214f06 | \brief converts the homogenous point to a pointing vector by setting the homogeneous coordinate to zero | {
cv::Vec3f homoCord;
homoCord[0] = p[0];
homoCord[1] = p[1];
homoCord[2] = 1;
return homoCord;
} | 0 |
d777cc5b1c7573c24972b134ddc857d0 | a24f7224080fa59ceb6df2666266c221 | Wraps item in array. | function ArrayType(type, mode)
function arrayWrap(val) {
return _.isArray(val) ? val : (isDefined(val) ? [val] : []);
} | 1 |
088f039eb38654c04c0ca31dc68133e9 | ce045799707482ea63d6e4dd3d985552 | Creates a new adapter for an object of class '{@link org.wso2.carbonstudio.eclipse.esb.mediator.LogProperty <em>Log Property</em>}'.
<!-- begin-user-doc -->
This default implementation returns null so that we can easily ignore cases;
it's useful to ignore a case when inheritance will catch all the cases anyway.
<!-- en... | public class _1ItemProviderAdapterFactory extends _1AdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable
public Adapter createLogicalPortTypeAdapter() {
if (logicalPortTypeItemProvider == null) {
logicalPortTypeItemProvider = new LogicalPortTypeItemProvider(this);
}
return logicalP... | 0 |
cab5f426d4fcfaf0dad6915f886ff20b | 22c69b32ea3359d623cf4ccbdfee98fb | Set text and background colors for buttons. The "_f" colors are used for initial buttons, and controller title.
The "_r" colors are used for revere playback on "play/pause" and "normal" buttons. | {
if (Settings.rightHandTracked)
{
btn_Right.Background = Brushes.DarkGreen;
}
else
{
btn_Left.Background = Brushes.DarkGreen;
}
if (Settings.fontScale == 1.0)
{
btn_no... | 0 |
82ec85ca5acc52e7da2632aeebb7599d | 50643799fa98772f217d7ba6d246e2d6 | 将Native对象转换为String数组 | public class FileTransfer extends ByteArrayTransfer
public void javaToNative(Object object, TransferData transferData) {
transferData.result = 0;
if (!checkFile(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
String[] files = (String[])object;
StringBuffer sb = new StringBuffer... | 0 |
dd610249f4768eeb218fa69a1929f088 | 1bc188526aaf72bde557dec0c82bafcf | 参数设置完成,发送信号并关闭设置参数对话框 | void parameter::on_comfirm_Button_clicked()
{
set_parameter();
} | 0 |
aa551d7eaa17bb0de572030a1de0a3d1 | eaf70ea0367ba87f79aa74e3a59bd4c4 | 通过客户id查询其应付信息,并加入订单信息 | @Query(value=" from OrderInfoEntity o "
+ " left join fetch o.commodity c "
+ " left join fetch o.orderer cu "
+ " where cu.id = :customerId order by o.beginTime ")
public List<OrderInfoEntity> findByCustomerId(@Param("customerId") String customerId); | 1 |
9ed43404a371fb109c3c4c21f5651f1c | ce282c434c3dcb12df51b50bc41b3271 | This function performs basic checks on the train dataframe. | assert isinstance(x, pd.DataFrame)
assert (2796, 34) == x.shape
assert 68100 == x.isnull().sum().sum()
assert 32 == sum([dtype in NUMERIC_TYPES for dtype in x.dtypes])
assert 2 == sum([dtype.name == "category" for dtype in x.dtypes])
assert isinstance(y, pd.Series)
assert (2796,) == y.shape
... | 1 |
152a454dc994af4348ee5c731627a50d | 7f61448ad6da3ef0f9cb03f40c5be655 | Only put code between these lines | cases like (1) | 0 |
d6d67b9355774b54fcd4038a0326bb5a | d1298cf4674d21cc4f0ed82297893c4e | 获取优秀成果列表(按照标记取值) | @Controller
public class FinanceController extends DSTController{
@RequestMapping(value = "/finance/getAchievementList.htm")
public void getAchievementList(HttpServletRequest request,
HttpServletResponse response,String reservedProvId,String reservedCityId,String reservedRelateToTeamName) throws Exception {
SysR... | 1 |
04e81fa7d44484b9de4660c94de9ed50 | 66ebba846c60ab817fcbe97de1ffcec7 | Updates a discount requirement | public UUID updateRequirement(TravelRequirement travelRequirement)
throws InvalidTravelReqirementException, DatabaseAccessException; | 0 |
51590f13f286914cfe7ee3e8bc02bfba | 592a297a09d19f91bd19e1b2a6c61787 | 取得受測學生可以測驗的單元 | try {
let resp = await this.dsaService.send("GetQuizDataByStudentID", {
Request: {
StudentID: StudentID
}
});
[].concat(resp.Quiz || []).forEach(data => {
this._QuizDataList.forEach(data1 => {
if (data1.QuizUid === data.uid) {
data1.QuizName ... | 1 |
d4edee842a620cc27acf25ce49331002 | ed3bd6e7cce8c20a2f3455d73bdc9ec9 | Set the fields used to display the author | $data = $this->state->get('bulk_author_update_config');
if (!is_null($data)) {
$default_user = $this->userStorage->load($data['author']);
if ($default_user->user_picture && !$default_user->user_picture->isEmpty()) {
$displayImg = file_create_url($default_user->user_picture->entity->getFileUr... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.