query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
90ff4f55000ef94d515ba77c4d040b4f | 29f0423aa5490740cabf6f87a272757a | Testa o método que verifica se um aluno está cadastrado no sistema, mas com um aluno inexistente. | public class AlunoControllerTest
@Test(expected = IllegalArgumentException.class)
public void testAvaliarTutorAlunoNaoCadastrado() {
this.alunoController.avaliarTutor("1111111", 3);
} | 1 |
c87d4f540bb58c8ef8a3fd0c7fc453f2 | 227cfdd988095f2427f50aadd2e78d95 | check if a uri element is a parameter, parameters are determined by being
enclosed by '{}' | class Router
private function isParameter($url_segment){
return preg_match('/{(.*?)}/', $url_segment);
} | 1 |
53eb54ccbbca2c8427d1652afad4554c | 3892636934907dfe78bbb05262c43624 | 将配置文件中读取的属性转化成tableView展示的格式 | return new Table() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Override
protected String formatPropertyValue(Object rowId, Object colId, Property property) {
if(property.getValue() == null) {
return "";
} else if (property.getType() == Date.class) {
... | 1 |
37c237c19c93cffabeb151f5f88d6857 | 861d6eec00756c68b79e01c11ffceb78 | turn off led when closing | class Led:
def __init__(self):
if pycom.heartbeat() == True:
pycom.heartbeat(False)
self.off()
machine.Pin('P9', mode=machine.Pin.OUT).value(1) | 0 |
d21b190559dd428051d4b8b236399b4f | 8b249fc19429b69ab55fd812cb6db4bd | Get selected values as array from a multi-select select | $selected = new CArrayList();
$items = CRequest::getArray("selected");
foreach ($items as $i) {
$selected->add($i, $i);
}
return $selected;
} | 1 |
2f9bf1aba7e4616b600bfa8b415a513d | d509f3476d418e8aff12b619a750ef11 | Adds your client name to the current client name string which is used as User-Agent when communicating with ecommerce. | class PartnerAPIOperationQuickOrder extends PartnerAPIOperation
public function setUserAgent($userAgent) {
$this->_input->quickOrder->orderParameters->setUserAgent($userAgent);
return $this;
} | 0 |
ecd8ac1a03e719aa06bea2ab42b0abda | 9e152e9387ab42fe3ff894b4edf3acf0 | Averages a group of weather objects. Asummes it is passed weather objects of the same day
Given an array of weather objects.
returns a single weather object. | public class DailyWeatherReport{
public double avgTempForDay() {
return temps.stream().mapToDouble(num -> num).sum()/temps.size();
} | 0 |
6099f94702f9992da96a17763421996a | 6bd65a3bc60a9ad2137866dde4a2c68c | Gets the ID of a Sample Group from its name. | $this->_loadFieldGroups();
if ( isset( $this->_groups[ $name ] ) ) {
return $this->_groups[ $name ]->id;
}
return null;
} | 1 |
857cea9ebd9f1f91f9caca9b4c9f4977 | a7729253cff2c752d58e2ad2c39219bc | 在这里处理服务器发过来的消息 | function onmessage(e){
console.log("From Server:" + e.data);
var data = eval("(" + e.data + ")");
switch(data['businesstype']){
case 'heartbeat':
ws.send('{"businesstype":"heartbeat"}');
break;
case 'offline':
console.log(e.data);
break;
case 'matespeak':
if(data['useri... | 1 |
756dba8cc4fce1774b437ca51c18d90f | 89bb74cab4643621b901b40722fdcaa6 | 同步漫游消息(包括超大群漫游消息和其他漫游消息)的回调, 每个会话对应一个回调, 会传入消息数组 | namespace Wechat.Demo.Wechat
public class IpadDll
[DllImport("wxpad.dll", EntryPoint = "WXSetSyncMsgCallBack")]
public static extern int WXSetSyncMsgCallBack(int objects, DllcallBack sync_msg_cb); | 1 |
95a3e5b31adb3c2a270d5c0d1764be95 | 3bece53d510da39cda67c9da9199692e | 将字符串表达的数据转换为真实的数据<p>
枚举类型将会返回枚举元素 | if(sValue!=null && sValue.compareTo("null")==0){
return null;
}
if(sType==null || sType.length()==0){
return sValue;
}
sType = sType.toLowerCase();
if(sType.compareTo("string")==0){
return sValue;
}
if(sType.compareTo("b... | 0 |
0d87d6b86b229f713bf30d80a01ff894 | 2957f64cf6e24b38c59df096b8d3cda2 | 根据主键只更新有值得数据 | <T> boolean updateByPrimaryKeySelective(T t); | 1 |
bb66d9cb17d2bdb9c3606df129167e5e | 26cf79ecb423e0819ac54c0c43322f59 | Get the value for an attribute for the current element. The attribute name should be local name, the name
without the prevfix. | {
XAttribute xattribute = e.Attribute(localName);
if (xattribute != null)
{
return xattribute.Value;
}
return null;
} | 1 |
7310954f28b0845cee3edc83ed070179 | 35e928654e834f17dccfe8670fc4e368 | Выводит сообщение об остановке рендера. | try {
const text = this.lang.get(SHARED.MSG.ROUND_PAUSED_MESSAGE)
mp.game.graphics.drawText(text, [0.5, 0.5], this.textParams)
} catch (err) {
this.stopPause()
if (!this.errHandler.handle(err)) throw err
}
} | 0 |
ca5b0e5d6e4e991be46dcbbf18069465 | 9912ff06da3707cda7a56debfc59c5b9 | 序列化一个从baseobject继承下来的简单数据对象 | if (baseModel == null)
return null;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(
byteArrayOutputStream);
objectOutputStream.writeObject(baseModel);
String ser... | 1 |
e1a1c06c6174010de9e723573cec772e | afc286d84f9cded8206bb5771d5f9842 | Update icon with toilets status. | function updateIcons() {
farms.forEach(function(item, index, array) {
if (item.build.getEndTurn() === curr_turn) {
item.icon.setIcon('farm');
tile = getQuerySelector(item);
tile.textContent = item.icon.getIcon();
}
});
houses.forEach(function(item, index, ... | 0 |
8dbf4c64d188799d76fc01defcb80099 | 1b4ce59e6f7840f8c62b6b72e5005253 | Test that search and replace works in templates. | def _simple_view(req):
return render_response('variables.html', hello='byebye')
def _add_bits(app):
app.add_template_searchpath('test_output/templates')
app.add_url('/', 'foo/blah', _simple_view)
app = make_app(_add_bits, 'test_output')
c = Client(app)... | 0 |
c0c1e8fec988b79a421850fe4a03c096 | 9cf17b6bd55933f81fdd5ca936ea2ed1 | Specifies that the property should be stored in the database in binary. | class SolrFieldDefinition extends DataDefinition implements SolrFieldDefinitionInterface
public function isBinary() {
$this->getSchema();
return isset($this->schema['B']);
} | 0 |
d10783fc58f3223fa81c4f26a28f466e | 494c12e779fcbe9d069a805851bf7f60 | This is used to set the membersList table with the members retrieved
from the database. | public class MainActivity extends FragmentActivity implements
MembersFragment.caller
private void loadMembersList() {
leaguePlayers = new HashMap<>();
Resources res = getResources();
String[] teamNames = res.getStringArray(R.array.league_teams);
for (int i = 0, j = 65; i < teamNames.length; i++) {
ArrayLis... | 0 |
4a01e7917d6e937363843d2bba0c12bf | 9d42493087188c8d9404465e18bb9944 | Remove errors from login/signup form | class LoginValidator
removeError() {
this.parent.find(`input[name='${this.object}']`).one("input", function () {
$(this).siblings(".start").remove()
})
} | 1 |
68e7effcee4e17107ca69b003d85f369 | f66d1db150c981fe5f793a56520b0e4a | Get mask of infinite values if dtype is Float | def _infinite_like(tensor):
return tensor.new_tensor(inf).expand_as(tensor) | 0 |
96dfb5430f3df9e85c5b5141f931ad5c | e03017c637c63374336a6d21dd1e8ca5 | 在处理范畴内查找符合选择器的首个元素 | function first(node: Node, selector?: string) {
return walk(node, selector, "nextSibling", "firstChild");
} | 1 |
2c617164204f34e5615250823d73b150 | 13bd58faa545cfe47c1396a31d381ec1 | Gets the signed integer value that resides from the current position
to the next specified number of bits
and advances the cursor | namespace LibMetadata.IO
public class BitReader : IDisposable
public void AdvancePosition(int bits)
{
GoToPosition(GetPosition() + bits);
} | 0 |
691517b162698f87740aa5374bde4d9b | ca7c81c382f4578ba83793eae8eb6fa0 | 通用删除接口,为了安全性,只支持基于id的通用删除 | @Delete("DELETE FROM ${tableName} WHERE id = #{id}")
<T> Integer baseDeleteById(T map); | 1 |
8369b1cf0386006679e254d74d586fc2 | 50f52301f5cfe9322d7e2760a7b9376f | Should be the absolute path the root of the application.
Like everything else, no trailing slash. | abstract class Application
abstract public function getRootDir(): string; | 1 |
31e126adaf23c6a8280e94ae8acae897 | 14a2626f76d562c078f966e5187f6924 | Validation method for <see cref="ManagedEnvironmentsStoragesList" /> method. Call this like the actual call, but you will
get validation events back. | namespace Microsoft.Azure.PowerShell.Cmdlets.App
public partial class App
internal async global::System.Threading.Tasks.Task ManagedEnvironmentsStoragesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func<global::System.Net.Http.HttpResponseMessage, global::System.Threading.Tasks.Task<M... | 0 |
fd8291765ce60ce37b03c52fae89387c | ed16c69bb0166d2e71f51cf517e12354 | 删除工位及该工位上的设备 | public void delete(Long partStationId); | 1 |
09346738b08b02f2c4d0c86805f24f38 | e89dac75b3cd71ec5b2d234b9c322835 | Request the TimeSeries Alpha Vantage API for a specific function and symbol. | url = 'https://www.alphavantage.co/query'
data = requests.get(url, params=dict(symbol=symbol,
function=self.timequery,
datatype='json',
apikey=os.environ['ALPHA_KEY'])
... | 1 |
598312ba8d500a550370778325b3bbf9 | 4ae2abef0c27bf0979fe7b0162edc194 | Get the string name from an event id.
Pygame uses integer ids to represent the event types. If you want to
report these types to the user they should be converted to strings. This
will return a the simple name for an event type. The string is in the
CamelCase style. | {
int eventTypeID;
try
{ eventTypeID = (int)obj; }
catch
{ eventTypeID = -1; }
if (eventTypeID == -1)
return string.Empty;
UptimeEventType eventType = GetEventType(eventTypeID);
return eventType == null
? string.Empty
: eventType.Name;
} | 1 |
da88d700d762bbb5ea3b026c8775f174 | 47a4a1f196c2fb4e90ca9fcfbf7a9f99 | 保存当前用户id到_Installation表中 | class Helper
public static function saveInstallLock()
{
$path = storage_path() . '/data/install.lock';
return RC_File::put($path, 'ECJIA INSTALLED');
} | 0 |
549f5e1d54df639925f9938bffb701af | 88bd6779e66aac6ca0024898244dba13 | Loads the schedule from the live exported CSV representation of the schedule spreadsheet. | scheduleList = CSV.parse(File.read(filename), headers: true)
scheduleObjList = Array.new
c = 0
scheduleList.each do
schedule = Schedule.new(scheduleList[c][0],scheduleList[c][1],scheduleList[c][2],scheduleList[c][3],scheduleList[c][4],scheduleList[c][5])
c += 1
scheduleObjList.push(schedule)
end
return sche... | 1 |
097dc766286511fc4135c353d8d66ff9 | e752eec6c65ab4b7f27e582071d415e4 | Read properties from "edu/avans/aei/ivh5/main.properties". This property is not
actually used in this example class. | try {
properties.load(this.getClass().getResourceAsStream("/project2.properties"));
} catch (IOException ioexception) {
System.out.println("IO Error reading in preference file.");
ioexception.printStackTrace();
} catch (Exception exception) {
Syste... | 0 |
64894a81a27722fe4119b0e511aa793e | a61392d0047e30f61e694120fb3fa99a | 获取笛卡尔坐标 | var cartesian33 = new Cesium.Cartesian3(point.x, point.y, point.z);
var cartographic = Cesium.Cartographic.fromCartesian(cartesian33);
var lat = Cesium.Math.toDegrees(cartographic.latitude);
var lng = Cesium.Math.toDegrees(cartographic.longitude);
var alt = cartographic.height;
return {lat: lat,... | 0 |
a3663df3be8694ab5a915a4955b1738e | 217a411323c11b04c90fb69a744e5ef7 | adds a new access key to the credential. | def add_credential(credential):
try:
if credential['type'] != UserAccessCredentialTypes.password.value:
return make_response_error('Invalid credential type', in_httpcode=400), 400
else:
cred_type = UserAccessCredentialTypes(credential['type'])
with session_scope() as ... | 0 |
91e10903b28d7eb6b2e780a35aeee135 | cd334a4378aef439f8861e126d4be15d | Update the complications on the element | class PermobilWatchFaceService : CanvasWatchFaceService() inner class Engine : CanvasWatchFaceService.Engine()
override fun onComplicationDataUpdate(
complicationId: Int, complicationData: ComplicationData) {
Log.d(TAG, "onComplicationDataUpdate() id: $complicationId")
mActiv... | 1 |
50af2703a3957acd594dbe5b3f0d48f7 | da626f1cc18487a58b32d5d396066928 | Adds new Supplier Address to SupplierAddress collection. | {
try
{
return MailingAddressDb.Instance.Add(model);
}
catch (Exception ex)
{
WriteLog.WriteError(ex);
throw ex;
}
} | 0 |
c3fd3aa4292fbe0e8a9a6842c5c7238a | 4aa566d024b52e8ceef836adb1bf2a5b | Блок выбора страницы и выбора количества товаров на странице | $template = 'default';
$cmsController = cmsController::getInstance();
$catalog = $cmsController->getModule('catalog');
if (!is_string($template)) {
$template = 'default';
}
list(
$itemsTemplate,
$emptyItemsTemplate,
$emptySearchTemplates,
... | 1 |
87bcdb78153ddf952a60517b622d0726 | db05a1e3a02af06fd8270b6bbb8c26c7 | 이진 영상에 대해 레이블링 수행 | im = cv.imread(pth)
gray = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV | cv.THRESH_OTSU)
kernel = cv.getStructuringElement(cv.MORPH_OPEN, (1, 1))
bin = cv.morphologyEx(binary, cv.MORPH_OPEN, kernel)
return bin | 0 |
41d33e2587f4922d2b36080baa4155c7 | 3920d7863eb32c97203c1fa6284d6409 | Setup test hardware files and build servo object. | from ScopeFoundryHW.pololu_servo.pololu_hw import PololuHW
self.add_hardware(PololuHW(self))
from ScopeFoundryHW.pololu_servo.single_servo_hw import PololuMaestroServoHW
self.add_hardware(PololuMaestroServoHW(self)) | 1 |
a69cdbd790b9b28b1bbf17ef2f70391d | 471e90234dc433c9c6b132bc42875d32 | Event fired when a row has been added. | {
if (!options.maxRows || (rows < options.maxRows)) add_row();
return nothing(e);
} | 0 |
2877c224d72dc10a7f69bf875b8f0a90 | 07eab5c6275e5e00276b80857aeb1de8 | Display selected location glyph images | class HugeTableGrid(wx.grid.Grid):
def OnSelectFromPopupMenu(self, evt):
if self.chMap:
imKey = self.popupItemById[evt.GetId()]
imagetools.ShowImage(imKey, self.chMap, parent=self) | 1 |
86a210328f0d32317cc7e5518e3d33b1 | 7c7690adf3837dde9964782b43e6dc08 | Changes whether or not the renderable can receive shadows. | public class RaycastRenderer extends Renderer implements TFChangeListener
public void setShadingMode(boolean shadingMode) {
this.shadingMode = shadingMode;
} | 0 |
25f4cf4ecad260c74b6a77bfc8bcdc4a | 095d54c83212f96b9581a81c2490052a | Ensure Average Genome Size model is created correctly. | def create_sample(i):
metadata = {'foobar': f'baz{i}'}
return Sample(name=f'Sample{i}',
metadata=metadata,
microbe_census=create_microbe_census()).save()
sample_group = add_sample_group(name='SampleGroup01')
samples = [c... | 1 |
cc29f91d246bdca868b7531e6de922e4 | 47d32efbf4ecd3f07a6e7b6917f70458 | ResNet encoder composed by layers with increasing features. | def encoder(input_height, input_width):
img_input = Input(shape=(input_height, input_width, 3))
x = Conv2D(64, (3, 3), activation='relu', padding='same')(img_input)
x = Conv2D(64, (3, 3), activation='relu', padding='same')(x)
x = MaxPooling2D((4, 4), strides=(1, 1))(x)
f1 = x
x = Conv2D(128, (... | 0 |
87d8af1929f6896ab8cf88e3e41e7616 | 685dc6a6deef12ef9a5d5f895849c989 | Does a non-negative matrix factorization on input matrix | A = np.random.random((X.shape[0], n))
A /= np.maximum(np.linalg.norm(A, axis=0), 1e-24)
S = A.T @ X
for i in range(nbIt):
S = S*(A.T@X)/(A.T@A@S)
A = A*(X@S.T)/(A@S@S.T)
return A, S | 0 |
7e20878c1644b02702b0d1fe2c365594 | ecb42c043d048eee22683cd851ce03c8 | Checking if ASN number is within RFC limits | a = s.split('.')
if len(a) != 4:
return False
for x in a:
if not x.isdigit():
return False
i = int(x)
if i < 0 or i > 255:
return False
return True | 0 |
a250501ce705649048bc8fe11db60552 | 83d5e4c855ad1aedadb88fbffb5e1353 | Returns true if the target has the badge | namespace PPOBot.Scripting
public class LuaScript : BaseScript
private bool HasBadge(string badgeName)
{
return Bot.Game.Badges.Contains(badgeName);
} | 1 |
2dee080cf9d0bcf757393212f6cf9923 | a85cd7f9b671423768ca56e24c5e0edd | Checks to see if the buffer blocks of the current floating piece of Tetromino
is touching the left border or touching the right border or neither.
Input Parameters:
None
0 if not touching left border or right border
1 if touching the left border
2 if touching the right border | INT tile1_left, tile1_right, tile2_left, tile2_right ;
{
if( tile2_left <= tile1_left && tile1_right <= tile2_right ){
return( OVERLAP1 ) ;
} else if( tile1_left<=tile2_left&&tile2_left<tile1_right+xspaceS ){
return( OVERLAP2 ) ;
} else if( tile1_left-xspaceS<tile2_right&&tile2_right<=tile1_right){
retur... | 0 |
479e532f554e0501a3fe75031e2d4078 | a49354331656fb8886eecd7efdbfbc50 | 获取磁盘可用空间(单位:byte) | File root = new File(sdPath);
if (root.exists() && root.canRead()) {
try {
StatFs sf = new StatFs(root.getPath());
long blockSize = sf.getBlockSize();
long availCount = sf.getAvailableBlocks();
return availCount * blockSize;
} catch (Exception e) {
return 0;
... | 1 |
9eaa3ea0bfee7bebe81302b25b6e17ad | 02cb5d3a0f776005744caebdd5a02690 | 添加或设置一个图层的时间轴 | {
if (!Contains(layer) && (index >= 0) && (index <= layers.Count))
{
if (index < layers.Count)
{
layers.Insert(index, layer);
}
else
{
layers.Add(layer);
... | 0 |
22fa3d668ef2e9e981f603f81f19aebf | d2873a7694dfa8576dcaad09c7108632 | Delete a group level JVM resource. | Response<Void> deleteWithResponse(String resourceGroupName, String hostGroupName, Context context); | 0 |
f34889a771edfbc91de942a0ee709ab2 | 0e6a2bea1238d6f39a48160bfaef930c | Set references to existing items. | namespace Todo.Api.Models
public class TodoItemReference : EntityBase, ISortable, IUpdatable<TodoItemReference>
public void UpdateFrom(TodoItemReference fromReference)
{
Position = fromReference.Position;
} | 0 |
3cc07af9d365d4a49f9d7053e7604b7e | 0368bbcf051eac5f2ca03a847ae1979b | ###### B.power ###### | estimate.power <- function(vc, alpha=0.05){
scenarios <- expand.grid(PerChange=c(30, 50, 100, 200, 300),
Years=c(5,10),
Sampling.SD=vc$SD.sampling,
Process.SD=vc$SD.process,
sites.per.year=seq(20,100,10),
... | 0 |
e60ae139864435b95531eaa34b5da7cb | 169014919e7737024d92a2c60ea78b37 | [readIntNums 使用制定的URL从文件中读取int序列] | with open(filename) as f:
lines = f.readlines()
nums = [int(line.split('\n')[0]) for line in lines]
return nums | 0 |
9f5866e35e824651dbd21eaa7b8006ff | 944da1244e1278a29e16eb331806a362 | To update the Hunger and Hydration bars. | public class GameController implements Initializable{
private void tickBars(){
dashboard.setFuelValue(domain.getPlayer().getFuel()/domain.getPlayer().getMaxFuel(), String.format(" %.2f %% ", domain.getPlayer().getFuel()/domain.getPlayer().getMaxFuel()*100));
dashboard.setBackpackValue(domain.getPlayer()... | 0 |
0dbf44545781ed44d30f8a9ce37d68d9 | 4eddd2484021f21a75d46ff556991849 | 激活系统列表中的所有ReactiveSystems。 | {
foreach (State state in states)
{
AddActiveStates(state);
}
} | 0 |
c984e1f400572f9daee80bc8148d6242 | aec92108f7f58adcfe1388a963512132 | создание ссылочного типа класса с помощью фейкера
проверка заполнения полей | class User(AvroModel):
name: str
age: int
teamates: typing.List[typing.Type["User"]] = None
assert isinstance(User.fake(), User) | 1 |
5aaf2652eaf6138cd994b59e156018d0 | 7058bd0142e5548b08944a42c85ed5ed | Retrieves the LevelShift field
Comment: Level shift value used to shift the ADC value back into range | {
UINT32 u4RegVal0;
u4RegVal0 = u4VDecAVSVLDGetBitS(u4BSID, u4VDecID, 0);
u4VDecAVSVLDGetBitS(u4BSID, u4VDecID, u4ShiftBits);
return (u4RegVal0 >> (32-u4ShiftBits));
} | 1 |
d16aa5212e4a8273409c4afbef41b679 | 9f4991abec34a05c1dd16e48a73ccb4f | 获取所有json 数据 返回 list | def get_data():
datas = ReadJson("login_multi.json").read_json()
arrs = []
for data in datas.values():
arrs.append((data.get("url"),
data.get("mobile"),
data.get("code"),
data.get("expect_result"),
data.get("status_code"... | 1 |
d6765fcf453df5369a602b7c5898b273 | b799d9cc66ef324e37e4115ba664ed7d | 打开支付宝,进入蚂蚁森林 | {
launchApp("支付宝");
sleep(3000);
if(!find_homepage())
{
toast("寻找支付宝首页失败,脚本退出");
console.error("寻找支付宝首页失败,脚本退出");
exit();
}
else
{
let item = text("首页").findOnce();
if(!item.selected())
{
let res = click_by_name("首页", SUFFIX, TEXT, ... | 0 |
d7f986c22256e6e4b2be738fb3be4e9b | d1e6fcdb65c2292a64673a44e9b8f2f3 | Querying data from the cluster using a distributed JOIN. | def protocol():
cols_in_a = [
defCol('a', 'INTEGER', [1]),
defCol('b', 'INTEGER', [1]),
]
cols_in_b = [
defCol('a', 'INTEGER', [2]),
defCol('b', 'INTEGER', [2]),
]
in1 = sal.create("in1", cols_in_a, {1})
in2 = sal.create("in2", cols_in_b, {2})
join1 = sal.join... | 1 |
a41c0f95774cca671cf77e15f4282cdf | 2b14e54497904d8a1cbe9bf2df69a9ce | 取得战斗 BGM | def pbGetWildBattleBGM(species)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
ret = nil
if !ret && $game_map
music = pbGetMetadata($game_map.map_id,MetadataMapWildBattleBGM)
if music && music!=""
ret = pbStringToAudioFile(music)
end
end
if !ret
music... | 1 |
9589c1d044895f0b2ab0db6a623ccf86 | f6e5c3080ae6abe430618eac062cc3f6 | this is called AFTER initialize() to configure the device for use | class DeviceTask(object):
def configure(self):
pass | 1 |
48240d861a3cab9ce21f048bb0784825 | 57ce088e8a7203d24f88b95117ff49c6 | Outputs the contents of the block if the first argument is greater than the second. | inpV0 := inputs[0].Get_i32()
inpV1 := inputs[1].Get_i32()
if inpV1 > inpV0 {
inpV0 = inpV1
}
outputs[0].Set_i32(inpV0)
} | 0 |
116fbd46297fd889ac1e86c4eb3188b9 | 228bb41ce1fe0246163765b3beaeb4da | Resizes an Nd list of vectors or a single vector to 'length'.
The vector is **not** changed in place. | if len(vec_list) > len_max:
error_list = vec_list[:len_max]
else:
while len(vec_list) < len_max:
vec_list.append(append_token)
return vec_list | 0 |
7899bba661098aa8605253acc25394fd | e618ed8cba8339887e69457822cfc761 | Тест doPost. | {
$this->mockResponse();
$this->httpClient()->postJson('http://localhost/demo', ['key' => 'value']);
$request = $this->lastRequest();
$this->assertEquals(\GuzzleHttp\json_encode(['key' => 'value'], JSON_UNESCAPED_UNICODE), $request->getBody());
} | 1 |
3bf3f4bdf79ab80ac18bc46cafff52f3 | 889e9164adbe7746973fd35a88891fe0 | Converted the voltage at the input of the AFE to the voltage at the HV input by examining the
meter settings | void voltageScaling::apply_HPS_ONLY() {
Modes::VS_MODE = HPS_VS;
pmbus = i2cOpen(I2CPORT);
writeVout(FPGA_1_1, FPGA_MONITOR, 1.1);
writeVout(FPGA_1_5, FPGA_MONITOR, 1.5);
writeVout(FPGA_2_5, FPGA_MONITOR, 2.5);;
writeVout(HPS_1_1, HPS_MONITOR, 0.96);
writeVout(HPS_1_5, HPS_MONITOR, 1.36);
writeVout(HPS_2_5... | 0 |
1498e526ef53fd63c2d75338f4829f19 | 81917965b4d1d488c8d1f6ebe9104669 | Modifies restrictions on virtual memory address range. | namespace Binarysharp.MemoryManagement.Native
public static class NativeMethods
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool VirtualProtectEx(SafeMemoryHandle hProcess, IntPtr lpAddress, int dwSize, MemoryProtectionFlags flNewProtect, out MemoryProtectionFlags lpflOldProtect); | 1 |
e84f088314c0857a315166609809e7ca | ac65b87a94ad02c06660ecb3aee461f7 | arc是[..., [an, bn, cn...], ...] inputStr每个字符开头能匹配到的所有音节串长度 | def analyze_structure(str):
str = "".join(str.split(" "))
shape = []
count = 1
for c in str:
if c == '[':
shape.append(0)
elif c == ',':
count += 1
elif c == ']':
shape[len(shape) - 1] = count
break
stack = []
i = 0
for... | 0 |
404e6ec0510957678bd4b04495587da3 | d692bd2ad095e163e3d762a4d6849f2c | Get a mutated prolif rate, bounding appropriately. | class NormalMutator(AbstractMutator):
def _child_p_for_death(self, parent_genome: Genome) -> float:
variation = norm.rvs(self.child_params.loc, self.child_params.scale)
parameter = fabs(parent_genome.p_for_death + variation)
return min(parameter, NormalMutator.MAX_PROBABILITY) | 1 |
6119b2fd77c568ebb7278a35978bf56a | cc0cf9059625d889f8f92080663a8d37 | returns the number of samples written | {
int32_t ret = 0;
ret = adxl355_write_reg(ctx, ADXL355_FIFO_SAMPLES, &sample, 1);
return ret;
} | 0 |
b0685481d3986545d954b1dfdecdeb55 | f529520239226a5ee9d2ef498f2e1cae | Запускаем активность для добавления вопросов | try {
AddQuestion window = new AddQuestion();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
} | 1 |
cb77b536fc6c9af33bb186fbf97654e7 | 207b256204568275b74fb0179e16898d | Fades in the overlay for the appointment creation. | {
if (!this.IsVisible)
{
this.Opacity = 0;
this.IsVisible = true;
await this.Fade(1, animationDuration, 0).StartAsync();
}
} | 1 |
d6839b8d022ea7d5b7918a141731e366 | c5816399ed9254c018ed46c3d08d5d54 | Sparse conv 2d with mask. | ksize = [1, stride, stride, 1]
input_shape = net.get_shape().as_list()
output_shape = (input_shape[0], input_shape[1] * ksize[1], input_shape[2] * ksize[2], input_shape[3])
one_like_mask = tf.ones_like(mask)
batch_range = tf.reshape(tf.range(output_shape[0], dtype=tf.int64), shape=[input_shape[0], 1... | 1 |
a1d2e91712d7bb6511ab191f1a29b6c3 | f118ff006bed3e2c0fb9451c84538e02 | 静态下载函数,使用requests模块进行下载 | print("downloading", url)
try:
r = requests.get(url)
if r.status_code == 200:
return r.content
return None
except RequestException:
return None | 1 |
4677bba4874b41dd2a5a5773bd0b2561 | a542c909f8b23df65d9136a1790234fa | Gets the slow speed of this unit. | public int getSpeed(); | 0 |
25f7a6e10de7b482775c4a14b76abebd | e076f0b0b8e6cb9de6b27d1081bfe5a3 | It specifies simple search method based on smallest domain variable order
and lexigraphical ordering of values. | long begin = System.currentTimeMillis();
boolean result = false;
search = new DepthFirstSearch();
SelectChoicePoint select = new SimpleSelect(vars.toArray(new Var[1]), new SmallestDomain(),
new IndomainMedian());
result = search.labeling(store, select);
long end = System.currentTimeMillis();
System.ou... | 1 |
6f5cab6b37a809fc6e67f80e99410bea | 036513b2ae2316aa0772ffa6ab97fa01 | 属性过滤,若list中的字典对象包含value为空的值,则将其从list中删除 | if len(pass_tag_list) != 0:
for i in self.dict_list:
for j in pass_tag_list:
i.pop(j)
return self.dict_list | 0 |
5a5fef5a7cdca8c7a67de8fdcc619ae9 | cb7f6b333a633d3509e5c6c6b50bd8cb | Shows a loading animation while checking auth credentials | const { fetchUserInfo } = useAuthActions();
useEffect(() => {
fetchUserInfo();
}, [fetchUserInfo]);
return <CenteredActivityIndicator />;
} | 1 |
ff8626e7d31bc17e7a62b4ecf9809d23 | a09054e10374d5e0bda6f258717a7247 | Walk directory tree and add song files to the library. | void add_songs_from_library_to_song_list_box() {
traverse_in_order(g_parameters.song_library, NULL, (traversal_func_t)add_song_to_list_box);
int count = 0;
GList *children = gtk_container_get_children(GTK_CONTAINER(g_widgets.song_list));
GList *iter;
GtkWidget *row;
for (iter = children; iter != NULL; iter ... | 0 |
b4b7b06fe8c0bce7509ead127009e7b7 | 2b523c20e0fb98162b92805b109b6d0c | Method to pick randomly the next prediction | class DuelingDQN:
def predict(self, state):
if self.e > np.random.rand():
a = random.choice([0, 1, 2, 3])
else:
Q = self.model.predict(state)
a = np.argmax(Q)
return a | 1 |
ad1b764fc17d0d91ea0dccaec5041959 | 5c57be739224854b557cad9e11e33fd4 | This fonction delete a network from the data base, and from the disk.
Inputs:
-request : HTTP request from the front-end
-pk : the ID of the network to delete | class Act: # Hurr hurr
# ---------------------------
# Initialisation and Shutdown
# ---------------------------
def exec_delete_event(self, request):
return self.provider.delete_event(request['paperID'],
request['serverID']) | 0 |
63a5b1a3472ec6c776c690fea7cc9f36 | b430a95160c4a4372cea71f196971ece | 通过用户ID,获取该用户所有已完成订单 | var rets []*Order
err := db.Where("user_id = ?", userId).Find(&rets).Error
if err != nil {
return nil, err
}
return rets, nil
} | 0 |
4d5aec7c9a504e54a6785b1dacd94773 | 9f2cea3295d299ce7912dba4530c1da9 | update the Storage Pool object with the available data came as part of
indication. | class HBSDCommon():
def connect_storage(self):
self.check_pool_id()
self.output_log(MSG.SET_CONFIG_VALUE, object='DP Pool ID',
value=self.storage_info['pool_id'])
self.storage_info['controller_ports'] = []
self.storage_info['compute_ports'] = [] | 0 |
88a47d5a87c53f1401458934fb8bb9a5 | aff4134ee20a5f5baaca6002c0c43c96 | 跳转到文件模板新增页面 | @Controller
@RequestMapping("/assetspackage/template")
public class TemplatesPackageController extends BaseController
@GetMapping("/add")
public String add() {
return prefix + "/add";
} | 1 |
07e5b07c507ce25dd79adcf2e173b89e | c44bcc027be169f6981f766e569ee58f | busca todos estados atingiveis pela transicao vazia | public HashSet<String> avanca(HashSet<String> estadosAtuais, String simboloLido) throws Exception {
String resultado = "";
for (String estado : estadosAtuais) {
for (RegraProducao regra : mRegrasProducao) {
if(estado.equals(regra.getOrigem()) && simboloLido.equals(regra.g... | 0 |
84852542a04418187ae427f1e84c8b32 | 0f7c6c1f0cb417beb521977f6b3460b6 | 更新後のcalendar_statusに合わせてメッセージを変更 | function update_calendar_day(entries){
const $ = jQuery;
if (entries.length !== 0) {
$(".event-field")
.empty()
.append(create_label(entries));
} else {
$(".event-field")
.empty();
}
} | 0 |
abe695e065545a0260cf6560245cb8bf | 7d036fe57d9125e37d6be64954db8830 | 跳到顶部 | function goToTop() {
$('html,body').animate({
"scrollTop": 0
}, 1000)
} | 1 |
7b6575edf8f081b21b585c42355c5564 | 333807a77cbee8caa7a8a38033873247 | Get the credits (cast and crew) that have been added to a TV show. | namespace WatTmdb.V3
public partial class Tmdb
public TmdbPersonCredits GetPersonCredits(int PersonID, string language)
{
return ProcessRequest<TmdbPersonCredits>(BuildGetPersonCreditsRequest(PersonID, language));
} | 0 |
bbdbd8920009e88bd88d5be5e40f9c86 | 0b81941f70ecd70cf0523eb0d8633cba | 將中文數字轉成 `u32` 整數。使用 **「上數」**。 | int characterCode,
byte radix)
{
if (Methods.u_digit == null)
Methods.u_digit = GetMethod<MethodsContainer.u_digitDelegate>(IcuCommonLibHandle, "u_digit");
return Methods.u_digit(characterCode, radix);
} | 0 |
32758bfaef058969760a27682f53f792 | f82cf76242f80b26e4807f015f4fbe64 | Tests that the rack interface works properly. | class RackAPIEndpointTestCase(APITestCase):
def test_get_filter_name(self):
rack = Rack.objects.all()[0]
url = reverse('rack-list')
url += ('?name=%s' % rack.name)
response = self.client.get(url, format='json')
data = json.loads(response.content)
self.assertEqual(len(data... | 1 |
47bc1afc8a901e1abbbebc9c64738895 | 8654b47083324a92252106b6e82f4bcc | 计时关闭页面 | if (($(".quit_content").css("display") == "block") && ($(".quit_content").css("display") == "block")) {
$(".quit_layer").remove();
$(".quit_content").remove();
$(".count_down_page").addClass("hidden");
}
} | 0 |
e15cd4b9a4de710e677a8767b2c2c7ab | b4488de73c52549b6680c88176c4e0fe | Returns the domain name that is stored in the vm
instance. | class ClayVM(object):
def __domain(self):
return subprocess.Popen('dnsdomainname',
shell=True,
stdout=subprocess.PIPE).communicate()[0].strip() | 1 |
035a4eedefbdc30e59e5dd62e6582944 | cbf2efe35145dde1fa82d5002a57e4d7 | To convert a list of bytes to an array of bytes. | public class MREJPEQSimpleDistributionStreamFunction implements MREJPEQSimpleDistributionSetupTypeFunction
private ArrayList<Byte> getByteArraylist(byte[] byteArray)
{
ArrayList<Byte> ByteList = new ArrayList<>();
for (int i=0;i< byteArray.length; i++)
{
ByteList.add(byteArray[i... | 0 |
9d59a752c068d1ad0ab90b513841a1cc | d836e86e7102f2efe7cda9178cc6eebf | Calculate image hash of the element. Called only when other identifiers failed | class UniqueElement(object):
def img_hash(self):
if self._img_hash:
return self._img_hash
im = self.screenshot
self._img_hash = imagehash.phash(im)
return self._img_hash | 1 |
b23787cd2bd05b44fea757fb5287be8b | 65cad31fdbc58d8ee2993c223b135ce6 | Updates a specific record within the databased based on user inputs. | def update_record(story_id):
table = fileio.read_from_file(DB_NAME)
to_be_updated = [record for record in table if int(story_id) == int(record[0])]
to_be_updated = [fileio.change_eol(data, mode=1) for data in to_be_updated[0]]
return render_template('form.html', to_be_updated=to_be_updated) | 0 |
6d856af4cd15a20a958792a8753f4ad9 | de77699822337599bb545735f12b00c6 | Sets the value of the cfeDatosAvanzados property.
allowed object is
{@link CFEDatosAvanzados } | {
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FECHA$2, 0);
if (target == null)
{
target = (org.apache.xm... | 0 |
a7533e1d670d77203262b9efa541c917 | 3ddcf2f0cd61c1e1343d7f3fd92ee1a4 | Insert this object in the given array using its ID as key | void GameEngine::StoreBeforeObjectInArray(int iIndex, DisplayableObject* pObject) {
m_pObjectArray.insertBefore(iIndex, pObject);
} | 0 |
34a33de26b02b8de09dea33dcfb1a398 | b588eb3bd3f1dafae93cb4382a1af51a | clean up description, falling back to an empty string | class IPAHelpFormatter(optparse.IndentedHelpFormatter):
def format_description(self, description):
if description:
return description.strip()
else:
return "" | 1 |
d02ec6704d7d693223e9f3b172109464 | 51a249ddd4625b324e8bc830b8338d34 | Retrieves all of the cost anomalies detected on your account during the time period
that's specified by the <code>DateInterval</code> object. Anomalies are available
for up to 90 days. | export class GetAnomaliesCommand extends $Command<
GetAnomaliesCommandInput,
GetAnomaliesCommandOutput,
CostExplorerClientResolvedConfig
>
constructor(readonly input: GetAnomaliesCommandInput) {
super();
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.