query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
21c74027541c785b88edc44359a9dd88 | 1b9fde0376e63c311bd1a5163e23c43c | Uniformマップを返す | const RenderObject::TextureMap& RenderObject::GetUniformTexture() const { return m_imp->GetUniformTexture(); } | 1 |
b446f5d76c9f4dcbec3945e578493e43 | 5a03a86eed9b40c78eb95ade515cfda5 | Abre la ventana frmFilterDateRange configurando
los controles segun el reporte seleccionado. | {
Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio();
try
{
if (KDtp_Fecha_Inicio.Checked)
Obj_Rpt_Ventas.P_Fecha_Inicio = new DateTime(KDtp_Fecha_Inicio.Value.Year
, KDtp_Fecha_Inicio.Value.Mont... | 0 |
1ad59af1caf1b1b22cde010dc03a36c6 | e5c40901e175be37a764d4bd983eafaf | D0预读定位帧 | {
data[HDR_SEQQ_HI]=0xF;
data[HDR_SEQQ_LO]=0xF;
data[HDR_TYPE]=0x03;
data[HDR_SIZE_HI]=0x00;
data[HDR_SIZE_LO]=0x16;
data[HDR_PATHID]=0x01;
data[HDR_SENDER_HI]=args.sender[0];
data[HDR_SENDER_LO]=args.sender[1];
data[HDR_RECIVER_HI]=args.reciver[0];
data[HDR_RECIVER_LO]=args.reciver[1];
... | 0 |
704e6ef0205d169e601ba3297e1115fc | 20ac03bb5fa56569b8e3670ac2555e11 | Prints out an error message and kills the process.
SYNOPSIS
error_num - process return value
fmt_reason - a format string for use by my_vsnprintf.
... - variable arguments for above fmt_reason string
DESCRIPTION
This call prints out the formatted error message to stderr and then
terminates the process. | {
va_list ap;
va_start(ap, fmt);
log_doit(1, LOG_ERR, fmt, ap);
va_end(ap);
exit(2);
} | 1 |
26f4b2cf9850388f911b3e71e22985e3 | d03cf0240b390ca4f759a03068c4f741 | 根据key取得value,key可以是:a.b.c.d类型 | if (allResource.containsKey(key)) {
return allResource.get(key);
}
String[] keys = key.split("\\.");
int i = 0;
if (keys.length <= 1) {
return null;
}
if (!allResource.containsKey(keys[i])) {
return null;
}
Map t... | 1 |
6b31a9eff218d839620ab575eecfb97a | aee6c7ac2df2dadfba932c496d6d0db6 | Get a bounding rectangle around all the widgets that have been added to this frame | {
RECT rc = convert_to<RECT>(getClientBounds());
::MapWindowPoints(m_handle, NULL, (POINT*)&rc, 2);
return convert_to<Rect>(rc);
} | 0 |
4d225b638f6d54ac477436fa4430aab4 | 58e6ea7b310e161704a24e4a2b4d6578 | 启动服务器,监听客户端请求 | class HTTPServer(object):
#初始化
def start(self):
self.serversocket.listen(128)
while True:
clintsocket, addree = self.serversocket.accept()
hanlderprogess = multiprocessing.Process(target=self.jiexi, args=(clintsocket,))
hanlderprogess.start()
clintsoc... | 1 |
ca34875c758484bf6ef59cdc626f3253 | 29fffea98416c0ff14ee3cd99c9c708c | Convert to a tuple of (kind, val) | class Categories:
def toTuple(self):
return (self.categoryname,) | 0 |
4f6234b006541fa0186f13cb5de43a26 | f040115b9725cd60e57f8040549093f6 | Get shadow style. | class L8M_Google_Maps_Icon extends L8M_Google_Maps_Abstract
public function getShadow()
{
return $this->_shadow;
} | 1 |
3f30104ee3812b9e020d778e9e1dbf3c | 609da77e52995efa77ca10796612195c | Convert kilometers to inches | double inchLength;
inchLength = ((f*12) + i);
return inchLength;
} | 0 |
da4012c065ed5b7809e6edba472ee433 | 7e59739be98469a3358eb70ab4c67766 | 从日子到年份 | int dayToYear(int year, int month, int day)
{
int i, leap;
leap = year % 4 == 0 && year % 100 != 0 && year % 400 == 0;
if (month > 12 || month < 0){
printf("month error\n");
return -1;
}
if (leap == 0 && month == 2 && day == 29){
printf("% is not a leap\n",year);
return -1;
}
if (day > daytab[leap][month... | 0 |
6711d24a5a0ce9dd87900058fa7cd9cf | ddd1baf3d78613b860ddae60b3328b97 | Gets the value of the partnerID property.
possible object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ContactQuery", propOrder = {
"id",
"created",
"createdBy",
"updated",
"updatedBy",
"conflictId",
"modId",
"accountCurrencyCode",
"accountId",
"accountIntegrationId",
"accountModId",
"accountPriceListId",
"accountP... | 0 |
a530f9c5bad361cb6bd006952d37d65e | cb2fc80b55f0deeb9fdf1147e082397a | 将Calendar对象转为String | public String calendarToString(Calendar calendar) {
SimpleDateFormat sdf = new SimpleDateFormat("M月d日");
String day = sdf.format(calendar.getTime());
return day;
} | 1 |
dc70619de26feaeb340ed833b9d60f4b | f837164ae7c47e9361701b5bde6ee869 | Plots posteriors against true values | def show_histograms(n_samples=1000):
true_ps, obs_xs = get_ground_truth()
prior = Prior()
model = Model()
stats = Stats()
ps = prior.gen(n_samples)
data = stats.calc(model.sim(ps))
cond_data = stats.calc(model.sim(np.tile(true_ps, [n_samples, 1])))
fig = util.plot.plot_hist_marginals(ps,... | 1 |
983cf79f7ff7662aaaf6fe6757162952 | d7aeb9cec95bc7105f29986eb8a56dd9 | Returns all editable Product Types for the current user.. | public Collection<String> getProductTypes(); | 0 |
4a27dabc0f3e22e9a71d61cdc715046e | a7ac516062ce414fdc8db0a02fe8a413 | Helper to retrieve an `Button` by icon name, for convenience | {
GUIBase_Button control = GetControl<GUIBase_Button>(layout, buttonName);
if (control == null)
{
Debug.LogWarning("Can't find button '" + buttonName + "'");
}
return control;
} | 0 |
efca4ecfff77700f80728c6864c08160 | f2452739ed936a7b22f177811fd336ba | Converts cartesian coordinates to orbital elements,
returns one array of COEs | def rv2coe(k, r, v, tol=1e-8):
h = np.cross(r, v)
n = np.cross([0, 0, 1], h) / norm(h)
e = ((v.dot(v) - k / (norm(r))) * r - r.dot(v) * v) / k
ecc = norm(e)
p = h.dot(h) / k
inc = np.arccos(h[2] / norm(h))
circular = ecc < tol
equatorial = abs(inc) < tol
if equatorial and not circula... | 1 |
06ff01e46fcff6299ea4409b53789957 | 193ebcd03ad1043d7b648ddc37f18a5c | 替换空格 | class XzParserTop(object):
def replace_space(self,line):
regex = re.compile(u' +')
line = re.sub(regex, u' ', line)
return line | 1 |
5b12f5f7034ebf60af337429788a3031 | e476adb121a7574974b00e30a537cdec | 读取时序cvr特征 | reader=pd.read_csv(self.config.path_cor,iterator=False,delimiter=',',encoding='utf-8',header=None)
cor_features=set([])
for i in range(len(reader[0])):
if abs(reader[1][i])>=0.01:
cor_features.add(reader[0][i])
print 'cor_features:',len(cor_features)
return cor_features | 0 |
5a5b82dd17f836150c3405a56d4a9240 | 0bec87fb69353a80b221ae8bd8bdb11f | Test if a new/deleted segment is dynamically added/removed. | public class AttributeIndexTests extends ThreadPooledTestSuite
@Test
public void testSegmentNotExists() {
@Cleanup
val context = new TestContext(DEFAULT_CONFIG);
populateSegments(context);
val deletedSegment = context.containerMetadata.mapStreamSegmentId(SEGMENT_NAME + "deleted", SEG... | 1 |
abe571a7f5fd5fdffcb19365b12650da | cdedf7e95cfa0af79c7c8c066b3db63d | close the current node.(it will bind to `default` node, `default` node if not exists, it will be ignored) | interface TradingRecord : Serializable
fun closeCurrent(): TradingRecord | 0 |
d6b1ccd2deac513da45e5f3b06d95d83 | 610b119a111e99dc28655cb7760681f5 | removes a string from inside a string | def remove(substr, theStr):
new_string = theStr.replace(substr, "", 1)
return new_string | 1 |
800f145b82a0c46694a9106578f4f183 | 3dbd73750d677c58a519eb6eee846778 | Turns camelCase/PascalCase into Capital Case
caseConversionExample -> Case Conversion Example | class CaseConverter
private function convertToPascalCase($input)
{
$input = ucfirst($input);
$input = preg_replace_callback('/_([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $input);
$input = preg_replace_callback('/ ([a-z])/', create_function('$c', 'return strtoupper($c[1]);... | 0 |
6bd814c00e254328f3d1c9013d2eba30 | 5fc2cdfac1b8ff7252d7102a2f60841b | Adds a time interval to this TTime, returning a reference to this TTime. | namespace Millistream.Streaming
bool AddTime2(uint tag, int hour, int minute, int second, int millisecond); | 0 |
8d63b6e2e0599a4a3539979c35d2d19c | 253910d9e415534821ccd7683dc609c1 | Check that nested aliases are optimized away through "smaller" aliases. | namespace Burst.Compiler.IL.Tests
internal class Aliasing
[TestCompiler(typeof(NoAliasField.Provider))]
public unsafe static void CheckNoAliasFieldWithItself(ref NoAliasField s)
{
Unity.Burst.Aliasing.ExpectAlias(s.ptr1, s.ptr1);
Unity.Burst.Aliasing.ExpectAlias(s.ptr2, s.ptr... | 0 |
c3e4c00a92a9dae4fff8da80508e13e4 | d513c4f6724c288383df3702e8eb188e | Method that updates the Spite of the animation with the next Sprite of the spriteSet | {
int actualImageFrame=temp.getActualImageFrame();
int texturePosition=temp.getTexturePosition();
new TextureChanger(temp,texturePosition);
if(typeOfMonster==0)
{
if(texturePosition==1)
{
switch ((actualImageFrame))
... | 1 |
13c2cc8b5f0e5c4fc248396a5b0e1c68 | 8ea5a9f8853961cbe5562bf695655673 | Get tmdb configuration needed to create the complete url images | {
TmdbServiceConfigurationInfo config = _tmdbClient.GetConfigAsync().Result;
if (outputResults)
{
GlobalMessageHandler.OutputMessage("Got TMDb config.");
}
return config;
} | 1 |
9b1146e2b3d14885d93a9c79a86cdc41 | 3238ee8477b2594c7f59cc4a472ca4d2 | Add buttons to the property page. | class InkButtonSpec extends ControlSpec
_addPropertySpecs() {
this._propertySpecs.set(
propertyLabel.text,
new LocalizedStringPropertySpec({
label: propertyLabel.text,
displayedLabel: 'Text',
required: true,
nullable: true,
defaultValue: '',
... | 0 |
4e69276a8eacf92ede2e105665a20408 | e1cc50d8e0baff92d8ddf80051be9d6d | 確定並關閉視窗和清空字串 | namespace WindowsFormsApplication9
public partial class Form1 : Form
private void button3_Click(object sender, EventArgs e)
{
str = "";
this.Close();
} | 1 |
a89531ab851849b6ab0de657597467b1 | 120a92c3b3b8659db99d4165a94a0bd5 | 获取微信销售金额 | def parse_sales_flow_wechatpay(file_name):
sheet_name = 'SheetJS'
header = 0
col_names = 'C,D,F,O,P,Q'
df = pd.read_excel(file_name, sheet_name, header=header, usecols=col_names,
converters={'支付流水号':str.strip,'在线支付金额':float})
print(df.columns)
wechatpay_df = df[df['在线支付类型'].str.contai... | 1 |
4a89a211252df8a7115668d47ac7fcb7 | c656ae9eab62136f7f79847860b3fdb1 | Method for clicking on Save Product Changes button | public class StructuredProductPage extends AbstractPage
public StructuredProductPage clickSaveButton() {
clickElementByKeyboard(By.id("gwt-debug-StructuredProductEditView-submitButton"));
return this;
} | 1 |
990694472cfb831f9554b088bc77b41a | b4c988c480c61ee8a5c2e3b41cbf0fdb | 计算字节数组的哈希值并将其转换为使用Base64编码的字符串 | namespace Common.Security
public class DesEncrypt
public string MD5Base64(byte[] data)
{
var md5 = MD5.Create();
var bs = md5.ComputeHash(data);
var str = Convert.ToBase64String(bs);
return str;
} | 1 |
f4be7915ccd4b53c2c68164569ece4e1 | 7d208f77731ba8eccefc6756dbac6a56 | Initilizer for creator for StandardInput to run calculations to converge energy w.r.t. number of added MOs used in CP2K | self.conv = float(self.conv)
self.iterations = int(self.iterations)
self.min_file = str(self.min_file)
self.n_atoms = int(self.n_atoms)
self.points = str(self.points)
self.conv_fname = str(self.conv_fname)
self.basis = str(self.basis)
if self.beta: self.b... | 0 |
e84bc3c9957a1099b4dcc5c1a03b775d | bb6ce6b229f83c074a2d25d939fc7de4 | \brief Détermine si un des candidats a gagné avec la majorité des voix | bool finished_voting(){
if(((*c_ref.front()).voters.size() > (total_voters/2)) ||
((*c_ref.front()).voters.size() == (*c_ref.back()).voters.size()))
return true;
return false;
} | 0 |
6c4cf8c86dbfc536d3c04385b8694d89 | 86fced363a32fd3e6de7f5cc0566f828 | Test case for update_cluster_email | com.azure.resourcemanager.AzureResourceManager azure) {
azure
.kubernetesClusters()
.manager()
.serviceClient()
.getManagedClusters()
.createOrUpdate(
"rg1",
"clustername1",
new ManagedClusterInne... | 0 |
79360de60d9ad1da2154a468c9109926 | 7198b86480f4b575ff1081734ceaf1de | Returns total number of resources that will be parsed for URL extraction. | public class CrawlRegistry
public synchronized long getTotalURLCount()
{
return this.totalURLCount;
} | 1 |
c450baa3a4ae585f63a5685f877b6891 | 770a14541facbc6d07287105ea45122b | getTerm is a method that returns the term length of a recurring expense | public String getTerm(); | 0 |
02f604e9b433f4c3ba445bc5d3da8ccf | d7661e22c1f1568030b13877daaf3e2a | Queries for sites identified across all modules based on the
parameters sent by the client.
?site, ?lat, ?lng, ?facility, ?polluted, and ?label. | with open("{}/config.cfg".format(BASE_PATH)) as f:
config = json.load(f)
return query_results('sites', key=config['key'],
state=state, start=start,
limit=limit) | 0 |
bebfb2868c242064ed67ec85365cf6c3 | 76adc909918ce49c37c8c1cf10dc9fe9 | Invoke runCommand() in derivative class and handle exceptions. | class SimpleCommand(_CommandBase):
def run(self, args: List[str]):
raise NotImplementedError() | 0 |
31bf12722a76a81c231c4c011027a372 | 11f20865a2f4f19a81036002e3947c10 | source : https://space.stackexchange.com/questions/18289/how-to-get-semi-major-axis-from-tle | def semiampl(P:u.year, e, i:u.deg, m1:u.Msun, m2:u.Mjup)->u.m/u.s:
t1 = 2*np.pi*c.G / P
t2 = m2 * np.sin(i) / np.power(m1, 2./3.)
t3 = 1. / np.sqrt(1 - (e*e))
K = np.power(t1,1./3.) * t2 * t3
return K | 0 |
b41faa9032102d2ca0e9c10219fe1990 | b34f37e0bc9b694fd441f29973588b0b | 判断此装备是否已镶嵌同类型的宝石 | {
if(eqi.RtEquip == null) return false;
for(int i=0;i<eqi.RtEquip.slot.Length;i++)
{
if(eqi.RtEquip.slc[i]==0)
return false;
else if(eqi.RtEquip.slot[i].mGem ==null)
return false;
else if(eqi.RtEquip.slot[i].color!=eqi.RtEquip.slot[i].mGem.configData.color)
return false;
}
return true;
... | 1 |
fdcf21b73ec4f5b231553a584cb9406a | 59b9a9c3aabc54918f671678981c3d45 | fix == other -> true or false
Return +true+ if +fix+ equals +other+ numerically.
1 == 2 #=> false
1 == 1.0 #=> true | if Type === other
return Typelib.compare(self, other)
else
if (ruby_value = Typelib.to_ruby(self)).eql?(self)
return false
end
other == self.to_ruby
end
end | 0 |
03c78df86d2de3279a512f8dfc3c26e7 | 5356e253ba50f774251ea20c31b85f4a | 通过传入开始时间和结束时间 算出时间差 | public class Utils
public static String getDateByString(String startTime, String endTime) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = "";
try {
Date startDate = sdf.parse(startTime);
Date endDate = sdf.parse(endTime);
lo... | 1 |
cc42f53dd82386ed1fb2eff524fa24b8 | 058c438209b562804d16a7b830964fe0 | find a list of locations which could be dead | l = []
for i in range(len(a)) :
for j in range(len(a[0])) :
if a[i][j] > 0.0 and \
( a[i+1][j] < 0.0 or \
a[i-1][j] < 0.0 or \
a[i][j+1] < 0.0 or \
a[i][j-1... | 1 |
c244a5f48170b28b4dfef8bef82f39e8 | 3884bbc9671d3da828fa4011f374f115 | 取得專案目標 | try {
const res = yield call(getProjectObjective, payload.id);
if (res.code !== 200) return message.error(res.msg);
yield put({ type: 'saveProjectObjective', payload: res.result });
} catch (e) {
return message.error(e || e.message);
}
} | 1 |
61264c402d970030cebbf76d18beecf9 | 0ac21e5ba9e1bab5f4fb083e9cd39f0f | 车位数据入库 | {
$ret = [
'uid' => '',
'plateNo' => '',
'parkingCode' => '',
'gateNo' => '',
'entryNum' => '',
'operatorCode' => '',
'totalBerthNum' => 0,
'openBerthNum' => 0,
'freeBerthNum' => 0,
'arriv... | 1 |
45f35339b203705a889ae28e1a2ea5c9 | fc0bc5b0802eff5e1c9275dfcbe4bf2e | calculate the time of flight of the projectile | {
double result = Math.Pow(initialVelocity,2) / (2 * 9.8);
return result;
} | 0 |
3d53d9fc97bcf4b4429d78b6d117d70c | 46ec769dcf0d10d32162a75853f0a132 | Add certain string to the current url and go to the new url | class UrlConstructor extends CComponent
public function add($name, $value)
{
return $this->createUrl($name , $value);
} | 0 |
65f840b5fac62a02a32bd692c0101726 | ac97ab97cdfc04a2000cff235251c0d5 | 虽然过时,但目前依然能用,过渡期起提示作用 | namespace ConsoleApplication1.nom.LastLen2._3
[MyTest("简单特性类",Id = 100)]
class LastLen23
[Obsolete("这个方法过时了,使用NewMethod代替")]
static void OldMethod()
{
Console.WriteLine("OldMethod");
} | 1 |
aec1f6182b7e0deb3e1cf53079c08c6f | 30e1ac970b0a3863ba8ca0c62e199e88 | Hacks the parameters to remove properties injected by swagger-client for model references.
Using them causes circular references, which breaks the process later on. | Object.assign(data, {
toJSON() {
const skipKeys = ["constructor", "handler", "property", "middlewares", "cursors", "origin"];
const safeEntries = Object.entries(data).filter(([key]) => skipKeys.indexOf(key) < 0);
return Object.fromEntries(safeEntries);
},
});
return data;
} | 1 |
b2ffbf918b4ce6514a3245a2d93aa97c | b520f2733b222985e6c3ccc3de914b5d | register a callback function to be called whenever a emergency stop is triggered | {
this->emergencyStopActive = false;
if (this->_emergencyStopReleasedCallback)
{
this->_emergencyStopReleasedCallback();
}
} | 0 |
1b91a40f21a8afa6f8dc3ea4d5795403 | 0389f39c6f3786b7d79ea1368c2f4459 | force bar to be unlocked regardless of its normal "lock" status | function ImpUI_CastBar:Unlock()
dragFrame:Show();
end | 1 |
cd6629c636661803a26020e0c450981c | 7478985b135333609edfe67047633707 | 把元素添加到页面 | var block = '<div class="block"><div class="head">head</div><div class="body">body</div><div class="foot">foot</div></div>';
var region = '<div class="region width_16">'+block+'</div>'
var wrap = '<div class="wrap">'+region+'</div>'
switch(type){
case "block":
html = block;
break;
case "region":
html =... | 1 |
ab40cd456f6f296b9657ddddf5ca41dc | 0255948f75efc9862b643badf2eaa549 | Predicted confidence scores on the test set.
The shape of the output depends on the task:
- (n_samples,) for binary classification.
- (n_samples, n_classes) for multiclass classification.
- (n_samples, n_targets) for [multilabel][] classification. | class ModelUsage(Model):
def predictions(self):
return self._predictions | 0 |
642a9f32b10827a36f710ce50d25fe48 | 759bb289514c9ed077963bb38492d7db | Сделать большей скорость перемещения точек | {
_chartWork.Zoom *= 2;
_mem = CopyPoints(_points);
Zoom(_mem, false);
} | 0 |
ae50d90207e6d5e2d045f6d933237294 | 70b1b1f1fdd17cab77f6b9573542837b | Listener appelant la méthode permettant l'insertion de slots quand la
touche "Entrée" est préssée | TimeDate b = new TimeDate();
TimeDate e = new TimeDate();
Slot s = new Slot(b, e);
slotList.add(s);
} | 0 |
59ed91820f24ca0d46e6dc0d027aa141 | 2070e02a52541bbab70334f4d154dc70 | 设置右侧界面阴影资源文件的resid | public class MenuConfig
public void setShadowId(int shadowId) {
this.shadowId = shadowId;
} | 1 |
3d64ec6993f076f47a2ccd3d83048708 | 6e4237a62f65e9fffb8e9d63473ba006 | prints help for a user | def _userView( uid ):
reply = _capi.userView( _resolve_id( uid ))
_generic_reply_handler( reply, _print_user ) | 0 |
42f059d723bd45bcee91bebe6c5cae08 | 90a434e21721596c6fce5e8749dad9b5 | Adds a quantum register to the circuit. | treg = qc.qregs[treg_pos]
areg = qc.qregs[areg_pos]
ctreg = ClassicalRegister(treg.size, 'ct')
careg = ClassicalRegister(areg.size, 'ca')
qc.add_register(careg)
qc.add_register(ctreg)
qc.measure(treg, ctreg)
qc.measure(areg, careg) | 0 |
7eab540423b67052c0cd92867267cf6a | 3d62ad74387fbc27e1bf67707f4b1dd6 | Gets number of rows spanned by a table cell. | CTDecimalNumber gridSpan = null;
if ((gridSpan = tcPr.getGridSpan()) != null) {
BigInteger num = gridSpan.getVal();
return num.intValue();
} else {
return 1;
}
} | 1 |
d85c4f8381ae52597f0a6d1385db2174 | 37e692901a7e2706486150fdb8e71340 | Saves an object to an XML file in Document format, located in a specified isolated storage area, and supplying
extra data types to enable serialization of custom types within the object. | namespace PeppaSquad.DataSaving public class ObjectSaver
public void SaveObject<T>(string fileName, T obj) {
SaveObject<T>(fileName, string.Empty, obj);
} | 0 |
0bb92cc80f19994059ff987f9631bf89 | 47c10202280e6cfe08768fb594d6f25f | Returns the parsed domain name from forms like "blabla.com" and "*.blabla.com". | parseDomain(str) {
if (!str) return '';
if (str.indexOf('://') != -1) str = str.substr(str.indexOf('://') + 3);
let topLevel = ['com', 'net', 'org', 'gov', 'edu', 'mil', 'biz', 'name', 'info', 'mobi', 'pro', 'travel', 'museum', 'int', 'areo', 'post', 'rec'];
let domains = str.split('.');
if (domains... | 1 |
483ffe9f9cc93ba4d96cc0d47776b862 | 0cf830eb891951e144f5f3a68920859e | r"""Create Atari 2600 environment and wrapped it with preprocessing guided by
Machado et al. (2018), "Revisiting the Arcade Learning Environment:
Evaluation Protocols and Open Problems for General Agents".
.. note::
To be very memory efficient, we do not scale image by dividing by 255. | env = gym.make(env_id + 'NoFrameskip-v4')
env = env.env
if monitor:
env = Monitor(env, monitor_dir)
env = GymWrapper(env)
env = ResizeObservation(env, 84)
env = GrayScaleObservation(env, keep_dim=False)
env = AtariPreprocessing(env)
env = ScaleImageObservation(env)
env = Clip... | 1 |
3a40e03c37c52f60920a02fbed495819 | 1520b127b1c0b8170b3e8de9db1b4f6f | Sends a rendering update packet to an area. Use to update orientation visually on all clients. | namespace Squirrel.Client
public class Client
public void sendPositionUpdate(Orientation newOrientation)
{
addPacketToQueue(m_udpPacketQueue, new PositionPacket(ClientId, newOrientation));
} | 1 |
d270b8af9a7d395547b4be202d51672d | e25fa75141bcaf925a1c88b4d737cf5f | Is the customer invoice delayed? | public class Rcv0003s0102Entity implements BaseEntity
public boolean getDelayedBillFlg() {
return delayedBillFlg;
} | 1 |
b7f1f2afcb02710712e9eb752ff22962 | d9e12e3feca1fc851e665970093b70cc | Helper, generate a mocked Managed Object Reference (MOR) from the given attributes. | ref = {}
if not COMPACT:
ref['type'] = entityAttributes['type']
ref['ref'] = entityAttributes['GlobalId']
return ref | 1 |
7d39e3cf2d0ac67b96658cff3221e1ba | 665918018c2fe28baa736dbb3e0c6730 | Get 视频时长,单位:秒。 | public class ChatArchivingMsgTypeVideo extends AbstractModel{
public Long getPlayLength() {
return this.PlayLength;
} | 1 |
5eefadc7c110440758a615e749ce7811 | ce86b6d01767bd7e49e71cda94ef2c00 | 获取tab的html。 | var inum = data.length;
var htmlstr = "";
var listview = listviews[tabindex];
for (var i = 0; i < inum; i++) {
listdata[data[i].index] = data[i];
var item = data[i];
var datestr = item.date.substring(0, 7);
if (datestr != listview.dateCmp) ... | 1 |
53603aef7d9890071d239fd22ce906dd | 50019cf85b974ff2bab7ffa51d4d28c4 | Подсветка результата var_export | ob_start();
var_dump($var);
$output = ob_get_clean();
if (!extension_loaded('xdebug')) {
$output = preg_replace("/\]\=\>\n(\s+)/m", '] => ', $output);
$output = '<pre>' . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
}
echo $output;
} | 0 |
01838dc0a45065cc4a6b7e66232ded3f | 4713962e6340702b0d19b73f2cc82c39 | 更新發射機率 | {
infantry.shoot.ShootSpeed = 4940;
infantry.shoot.ShootSpeed = 5500;
if(Remote.mouse.press_r == 1 && Remote.last_mouse.press_r != 1)
{
if(infantry.ShootWay == SingleShoot)
infantry.ShootWay = DoubleShoot;
else if(infantry.ShootWay == DoubleShoot)
infantry.ShootWay = ContinuousShoot;
else if(infantry... | 1 |
b2c20589565fef47a199a1ea23c8dee1 | bf379c7ff406a9d89cd71f9ac64cba1f | 从指定服务器,传送merkel获取签名 | let server_protocal_version = sess.config.protocal_version.clone();
let scalar_hex_str = "21680e1108ffc527f82b1f04ada3c75e66b0de0a4d30e9b0cad5d6679ea64aa824409cf36d43f3c0044ad116aac29eff3f8c4e3a52f160f6488573ba98f1c7c89399b64b1e60fe94e1fd875fc574b051498ee6b78504edb6a6b1b6e8cacf867cd7b5d7937da8d60032d589... | 0 |
6f60bbc6d290ec781b13687c8644cd86 | 5808fcb3aa4ca545f0ec0d5df073021c | Add a new value to the tail of the Doubly Linked List. | class DoublyLinkedList(LinkedList):
def add(self, value):
new_node = Node(value)
if not self.head:
self.head = new_node
self.tail = self.head
self.head.previous = None
else:
new_node.previous = self.tail
self.tail.next = new_node
... | 1 |
a644f491d86b36c6fd41806618dcee8f | b3a7ecde99d246b65ccf8e4d93d8ee43 | transform ray into object space | matrix_inv = matrix.inverted();
ray_origin_obj = matrix_inv * ray_origin;
ray_target_obj = matrix_inv * ray_target;
ray_direction_obj = ray_target_obj - ray_origin_obj;
try:
hit, normal, face_index = obj.ray_cast(ray_origin_obj, ray_target_obj);
except ValueEr... | 1 |
bb648345b75721f0e4227dc8c69ec660 | 7ec305eb8dc99925bf4ab4179598c81d | Checks vasp output in OUTCAR for errors. adapted from atat code | def check_output(s):
if "Normal termination of Gaussian" in s:
completed = True
elif "== MOPAC DONE ==" in s:
completed = True
elif "Kowalski" in s:
completed = True
elif "Variable memory released" in s:
completed = True
elif "Thank you very much for using Q-Chem" in ... | 0 |
aae4d8527638d7896608017cec13af1b | 5778ce5b34ba10670e568d9670b62e54 | Método acionado para apagar os dados da entidade. | $this->sql = "DELETE FROM $this->table WHERE $this->fieldId = '$this->valueId'";
if(self::execSQL($this->sql)){
$this->status = "Apagado com Sucesso!!!";
}
} | 1 |
2017f8daf7a34a57e55d7598e36c80a7 | 02fb30f51d35cd173354937129916b59 | Return a clear message instead of the obscure D-Bus policy error | {
DBusHandlerResult result;
DBusMessageIter array, dict, iter, variant;
const char *property = "Version";
result = DBUS_HANDLER_RESULT_NEED_MEMORY;
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &array);
property = "Version";
dbus_message_iter_open_... | 0 |
e6c5d33ae5968fc11d03a41f8272390a | 3789b02d9e13879703783f8807269333 | 添加分销分佣订单 | $fx_commossion = Model('fx_commission');
$commission['order_id'] = $order_id;
$commission['order_sn'] = $order_sn;
$commission['type'] = $type;
$commission['type_name'] = $type_name;
$commission['money'] = $money;
$commission['create_time'] = time();
$comm... | 1 |
142a641e70d68f3d28f8c55109681d9e | 5bf918efd753f279531893287a68dedf | search for all users have participated into a project | $sql = "
SELECT
p.userid as id,
u.username as unm,
u.firstname as fnm,
u.lastname as lnm,
p.isread as r,
p.iswrite as w
FROM ".$db->prefix."bps_userrole p
INNER JOIN ".$db->prefix."user u ON p.userid=u.userid
WHERE p.projectid=".bkint($projectid)."
";
return $db->query_read($s... | 1 |
f4a97ab701b673a68bd0b4c4ae6a05a6 | 8d8eb4bda036f74a632268f933c5a638 | Releases the kernel module and closes its CTF data. | void cleanup_module(void)
{
free_cs_handler(gdata);
kfree(gdata);
sysfs_remove_group(kernel_kobj, <_attr_group);
unregister_chrdev(Major, DEVICE_NAME);
} | 1 |
faf026938f1d1c849117dcc5e4044714 | c312796205467c6abab4cafef4017958 | 初始化鼠标放到置顶消息上显示全部内容 | function showTopContent(){
$(".topMainLeft1All").hover(function(){
$(this).find(".topMainLeft1Title").addClass("topMainLeft1Title3");
$(this).find(".topMainLeft1Content").show();
},function(){
$(this).find(".topMainLeft1Title").removeClass("topMainLeft1Title3");
$(this).find(".topMainLeft1Content").hide();
}... | 1 |
c48975526274924e281ef809a150f02b | dfa811a509efc47f88b47247c0b32c91 | 数据权限列表页面跳转 | @Controller
@RequestMapping("/dataPermissionGroup")
public class DataPermissionGroupController extends BaseController
@RequestMapping("")
public String index() {
return PREFIX + "dataPermissionGroup.html";
} | 1 |
581b3adb831e8477fbffa1656ef4b918 | 51b80448aceae0e924bbb338c2113c9c | force set a player's max killstreak count - this does NOT update the database! | public class SoupPlayer
public void addKillToStreak() {
plugin.playerConfig.set(this.getPlayer().getUniqueId().toString() + ".Streak", getStreak() + 1);
if (isHighestStreak())
setHighestStreak();
Config.save(ConfigManagement.getConfig("players.yml"));
} | 0 |
550b9e2afd7155569522eff87ebf8ab6 | a2c731df47a785de8757c3b9cc5ce36e | 用來設定是否真的進行量測.
如果是搭配LCDModel進行模擬量測, 則建議開啟加快量測速度. | namespace Remf.Core
public class MeasurementCore : IDisposable
public bool StartMesuarements()
{
return TurnMesuarements(true);
} | 1 |
13bfda14b4f87f601c37ecbbf032d8c3 | 5d12a9c80bb30c0cd919cdea6c350d8c | Méthode qui va effectuer un test d'équivalence entre deux dominos. | {
return (this.numberSides == otherDice.numberSides && this.visibleSide == otherDice.visibleSide);
} | 0 |
b1ee2bddd7f5b1440af042e3f180ded3 | 5a0a35e1900a3556488b6a240b140677 | 查询政策解读上一次抓取的第一条数据的 标题 、发布时间、 唯一标识、src 、完整的url | metadata=response.meta['pre_data']
def deal_publish_time(publicTimestamp):
time_tuple=time.localtime(int(publicTimestamp))
time2=time.strftime('%Y-%m-%d %H:%M:%S',time_tuple)
return time2
def deal_comment_next_params(item_id,response):
time_str = s... | 0 |
5822f2f3188f84b213e1b0cdef74cb4a | d4b208705acd47bc204853998b43a543 | Initialize the main thread's event source. | {
USE_TRACING("CNTEvent::InitEventLog");
if (wszEventSourceName == NULL)
return E_INVALIDARG;
m_hEventSource = RegisterEventSourceW(NULL, wszEventSourceName);
if (m_hEventSource == INVALID_HANDLE_VALUE)
return Err2HR(GetLastError());
return NOERROR;
} | 1 |
78e1dcb698f92b7ef710a0a79fc82cd6 | a55483ddcf5b0c1de5658e1a23dea5d4 | This is the data validation primitive. It checks that the instrument
matches the primitivesClass and that there are the correct number
of extensions. | protected boolean isValid() {
return getEnabledPrimitives().size() > 0 && getDatasetModel().isPresent();
} | 0 |
4dcc1a183e990f500f2e0bb3978eba11 | a95814815c89e11065217228c8c62fb3 | Send IRC "CAP REQ" command. | namespace IrcSharp.Ctcp
public sealed class CtcpUserExtension
public void GetClientCapabilities( string command = "" )
{
Validate.IsNotNull( command, "command" );
command = command.HasText() ? ": " + command : string.Empty;
this.SendMessage( "CLIENTINFO" + command );
... | 0 |
d05704bd52ede05d98869f17383823e6 | 037937c0b61a54d341b1e1cff21215db | Длительность обучения в семестрах | class StudyWill
public function getLearnTime(){
return $this->queryResultArray['learn_time'];
} | 0 |
f7ff499b12d45055a503f51a68894c16 | e06bed3538b7813b2c54e75f782630ae | ****************************************************************************
检查一个解是否为可行解.输入:一组可能解+订单截止日期表。输出:布尔值 | def is_available_to_order(menus, orders):
possible = True
for order in orders:
possible = order_binary(menus, order)
if not possible:
break
return possible | 0 |
4c18e467de793045df3ae413b370598b | 6755e5fdcb0b660e44e3250e01d3cd3c | @brief 아틀라스관리자 하나를 생성해주는 팩토리 | als := new(AtmLogSt)
als.logName = logName
als.logLevelStr[ERR_LEVEL>>12-1] = "ERR"
als.logLevelStr[INFO_LEVEL>>12-1] = "INFO"
als.logLevelStr[WARN_LEVEL>>12-1] = "WARN"
als.logLevelStr[DEBUG_LEVEL>>12-1] = "DEBUG"
als.funcNameFlg = FULL_FUNC
als.isShortFi... | 0 |
df11d1b81b4932fce681047b110b1b79 | 7cf662c4156e04daf175f354cac4a7ba | Lists all of the available CDN REST API operations. | class HttpRouterServiceServicer(object):
def ListOperations(self, request, context):
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') | 0 |
9c38aace43c5bc7fccf5b2a67dd1a456 | 28e0db77767adbc9f2392efba5c1a506 | 在每根骨骼上加两个组,并用控制器的位移连接到此骨骼上. | constraints = []
exp_tf_ms = []
for ctl in controls:
par = cmds.listRelatives(ctl, parent=True)
buf = create_offset_transform(ctl, BUF)
exp = create_offset_transform(ctl, EXP)
off = create_offset_transform(ctl, OFF)
cmds.parent(ctl, off)
cmds.parent(off, exp)
... | 1 |
fb57b7c404e5c93be41611a85e12747b | 5a5897204e8cf33da70cd9de9dc15e6b | Reads the current person that is waiting for a ticket
and returns their name. | Card person = null;
String personGuess = null;
boolean realPerson = false;
while (!realPerson) {
System.out.println("Person:");
personGuess = reader.next();
for (Card p : this.personCards) {
Person pp = (Person) p;
if (... | 0 |
09704bc376a0288ef5138ff62eb938d4 | a808d570893fb3f4d4fcf620de8e47b6 | Remove all of the Stockpile stacks. | {
foreach (Side loc in Enum.GetValues(typeof(Side)))
{
stacks[loc].Clear();
}
} | 1 |
149127698021ab20871f129c27e5dc9a | 97a5a97d8fbe3b514d9b108aca011b5b | Метод проверки возможности отправки уведомлений пользователям через кеш | global $DB;
$result = $DB->get_records_sql(
"SELECT * FROM {block_quickmail_event_recips}
WHERE event_notification_id = ?
AND user_id = ?
AND notified_at > ?",
[$this->get('id'), $userid, $this->next_available_send_time()]
);
... | 0 |
c3dc032f31592f7c2a416154e0bdcbe3 | bd783d12c96379f9f3e63f12cecc7660 | Returns the libSEDML version as an integer: version 1.2.3 becomes 10203. | {
NCDElement* apexElem = getApexElement();
UTF8String versionStr;
apexElem->getAttribute(STR_ATTR_VERSION, versionStr);
return atoi(TypeConv::AsASCII(versionStr));
} | 0 |
f2d67495239d7b9793554cdc73e3b3f9 | 5f7b2332a4dac90dba912f378ff94e57 | Determines which enemies can fire and how. Then dispatches bullets to the state. | void StateFireBolt()
{
uint8_t randShooter;
uint8_t row;
uint8_t col;
if (!EnemyFire)
{
EnemyFire = true;
randShooter = (rand() % EnemiesRemaining) + 1;
for (row = 0; row < ENEMY_ROWS; row++)
{
for (col = 0; col < ENEMY_COLS; col++)
{
... | 1 |
ca22dd8e286c62de65f4196c247549ea | 7d010e5ea6b36816564d9af4c10c5cb3 | Starts all core threads, causing them to idly wait for work. | void HostLink::startAll()
{
BootReq req;
const uint32_t numCores =
(meshXLen*meshYLen) << TinselLogCoresPerBoard;
uint32_t started = 0;
uint32_t msg[1 << TinselLogWordsPerMsg];
for (int x = 0; x < meshXLen; x++) {
for (int y = 0; y < meshYLen; y++) {
for (int i = 0; i < (1 << TinselLogCoresPerBo... | 1 |
0b12b48e4f91b2cbae0e385df8732f7d | 553af53d1f3da5777f3be4ed20382b45 | 检查以个类是否需要注册为WCF服务 | namespace MXJ.Core.Infrastructure.IOC
bool IsRegistered(Type typeToCheck); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.