query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
71c69c801ce0dfbd9db73a4d8122549b | f6a4d6e8a30e0d542c72045d78468d2d | 获取响应数据并转换为 json 数据 | public class HttpResponse extends BaseData
public JSONObject getResponseJsonRes() {
return getJsonObjectRes(responseString);
} | 1 |
06c8959f025a36849b9ed00ab92e4ea7 | a8b1394d43818096df2f94da5cd00c7a | Медиаконтент клиента в постах музыкальных групп | class Client:
def create_mediafiles(self, album_id:str):
if self.UNIQ_DATA:
pcount_old = len(open(settings.PHOTO_DIR + str(self.group_id), 'rb').read())//20
photo_file = open(settings.PHOTO_DIR + str(self.group_id), 'w+')
self.photo_ids = Client.album_parser(album_id)
if int(self.SHUFFLE_PHOTO):
print('SH... | 0 |
a58c8556c68fad21992fb17b5c2e1cf8 | 45f05199a45913837e79f6df1a2f0d92 | Obtiene el estado de una comprobación. Si no existe la comprobación, asume falso | @Service("validacionCertificadoService")
public class ValidacionCertificadoService implements IValidacionCertificadoService
public StatusCertificadoEnum obtenerEstatus(
final String infoBase64,
final TipoCertificadoEnum tipoCertificado) {
return obtenerEstatus( certificadoService.cargar( inf... | 0 |
506eb1f4b9e4ea6d86fc4f719d4b201e | f6ef6e38652303e522e955f9aed7051e | Build custom ec2.ini for ec2 inventory script to use. | class ExampleInventory(object):
def _build_selectel_inventory(self):
projects_list = self._find_projects_list()
for project in projects_list['projects']:
if project['name'] == self._os_project_name:
self._current_project = project
floatingip_list = self._find_floating... | 0 |
b94e0ffa4e326824cef490ccad410472 | 65b4203e02106dea2fa4433e6b10529d | Format the achievement in to a single line | public String toTxt() {
return locked + "|" + points + "|" + achievementLevel + "|" + description + "|" + information;
} | 1 |
7b936ee0ab7215a686b99db37002aa8a | 5e7987533f102c6d1da165b7a23affd0 | Sets if the popUp window shall be displayed when clicking on a point | public void setPopup(boolean popup); | 1 |
26787e2d27a7204df9f620a527b8278f | 8642189144680f8ce7d3639a75e7fdc5 | Invokes helper method to clear all cached OpenMRS locations | public class IBOLookup
public static synchronized void clearAllCache()
{
homes.clear();
beanClasses.clear();
interfaceClasses.clear();
} | 0 |
ef98b760ddf6fe627321d37dc3203c5d | dbe3324864f8cbad2d53b59f662ed957 | Override this method and call [KProperty.alias] to set alias for model property.
But you should not read property's value in this method,
because this method is called by init block, when you read a property, it may not be initialized. | if (properties.isAlias === true) {
return
}
if (typeof this[properties.name] === 'undefined') {
return
}
if (properties.type === 'object') {
if (this[properties.name] !== null && this[properties.name].clear) {
this[properties.name].clear()
writeValue.call(this[_privateKey]._this, undef... | 0 |
f8d89826b1a06064534219202fbe18c4 | 77a24ac5e59918dbccfd14971723505c | @brief Test the storage capabilities of a single node
<description>
Will whether the node can hold a value.
The value can be changed.
The Left and Right Child nodes can be access, changed and removed.
</description> | BST tree;
assert(tree.getRoot() == nullptr);
tree.insert(5);
assert(tree.getRoot() != nullptr);
assert(tree.getRoot()->mValue == 5);
assert(tree.getRoot()->mLeft == nullptr);
assert(tree.getRoot()->mRight == nullptr);
tree.remove(5);
assert(tree.getRoot() == nullptr);
tree.insert(5);
tree.insert(5... | 1 |
aaf5b324fb207b82749ef9b485babc9f | a8ed81ef3f3913a0f02bc86328a600df | Flushes all elements in the list | ListElement* element = head;
while (element != NULL) {
ListElement* next = element->next;
delete element;
element = next;
}
} | 1 |
77259cde130ba69ae50047fdada5dd4c | d5ca1e48d46db076503ad10ef965034f | Calls view model method to populate data grid. | namespace WebApplication3.Controllers
public class WebGridController : Controller
public ActionResult Index()
{
using(NorthwindEntities db = new NorthwindEntities())
{
var query = from cust in db.Customers
select new
... | 0 |
3a1cc0d8906d32d30b8ecece08ae9bcd | e678a75b32d8e655fc813e233cede922 | Indicates if the implemenetation has a native underlying theme | namespace Sentinel.Support.Wpf
public static class ThemeInfo
internal abstract class SafeNativeMethods
[DllImport("UxTheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern bool IsThemeActive(); | 1 |
dde37b18377ecca48da73d45a8d1c3e4 | 91aab48c7364bbf069322e95e5eaa82f | マップチップを左右反転 | public class MapTile : MonoBehaviour
public virtual void FlipX()
{
SpriteRenderer spr = GetComponent<SpriteRenderer>();
spr.flipX = !spr.flipX;
} | 1 |
f4614562e774afcfa05e17e586eac73f | 858d017a492548b9387e61e7b396e435 | r"""Instance-Batch Normalization layer from
`"Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net"
<https://arxiv.org/pdf/1807.09441.pdf>` | class InstanceNorm(nn.Module):
def __init__(self) -> None:
super().__init__() | 0 |
b4ce64554372de6d4d2c017654ea50b8 | 9512280bd50e053ab5c1cac8e6bfa7cf | Deletes all contents of a directory without deleting the directory itself. | namespace Phun.Data
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")]
public class FileContentRepository : AContentRepository, IContentRepository
private void Empty(string path)
{
... | 0 |
e5920b220f79f5ff65b4a50b03f60512 | ff5a1ff73d43492315e74ff7e358fa20 | clamps position values (useful immediately after values have been changed) | class Driver:
def clamp_values(self):
if self.velocity < self.min_velocity:
self.velocity = self.min_velocity
if self.velocity > self.max_velocity:
self.velocity = self.max_velocity | 0 |
4e88929c1cf6fd293a06d1998f13ff05 | f3526e6ccf2f2b7ebaef04df56f6d92f | 特殊文件的尾部识别 | {
int len;
const char *start;
len = ft_strlen(file_name);
start = (const char *) &file_name[(len - 4)];
if (ft_strncmp(start, ".ber", 4) == 0)
return (1);
return (0);
} | 1 |
cafb761b73e3430643cffc60a83a849d | ce5b17ff4ee4aee25986b944467d349a | 判断试卷是否以及被修改 | $m_paper = new \app\common\model\Xmsubpaper();
$m_paper_whe['cid'] = $this->subject_cid;
$m_paper_whe['uid'] = $this->uid;
$xm_paper = $m_paper->getOne($m_paper_whe);
$this->done_xm_paper = $xm_paper;
if (!empty($xm_paper)) {
return show_arr(config('code.error... | 0 |
35355288396d30fd92dc52cd456ad302 | d7514293ecafc0871b00c3341dda2b3a | 创建并关闭一个数据发布者的测试 | public void CreateTest()
{
IDataPublisher<string, string> publisher = DataPublisherFactory.Instance.Create<string, string>("CreateTest", new NetworkResource(9898));
Assert.IsNotNull(publisher);
Assert.IsTrue(publisher.Policy == PublisherPolicy.Default);
As... | 0 |
efd4b2ba606c9d715a2afa1a7fe03668 | baedbc87b46405787b339af33faa4a27 | Get a dict mapping rgbs to lists of top-left coordinates. | class Sources(object):
def _get_rgb_to_coords(image, width, height):
rgb_to_coords = {}
for x_cell in range(width // MAX_CELL_SIZE):
for y_cell in range(height // MAX_CELL_SIZE):
(x_min, y_min, x_max, y_max) = Sources._get_x_y_range(
x_cell * MAX_CELL_SIZE... | 1 |
67993fc62986b99edd3bba8882f1ee0d | c141bdbe3348f02772a6261b0593a039 | this function determines if the vector is a null vector.
this is rather tricky. we cannot be sure that the
computed magnitude is exactly zero (it never is). it is
only numerically zero.
best option, if available, is to use some system defined
exception condition for division by "zero". if it were
available, then we cou... | class Vector(object):
def is_zero(self):
return self.magnitude() < 1e-10 | 1 |
fc0cfdc42e0bed2659bc6c5c4e87dfbe | f20dfa1950731417c802991cdca40e2d | Notifies observers waiting for loop to fully stop. | {
var os = default(IObserver<T>[]);
lock (_gate)
{
CheckDisposed();
if (!_isStopped)
{
os = new IObserver<T>[_observers.Count];
_observers.CopyTo(os);
_observers = Immu... | 1 |
6e592b7eb683dc634cb253bc2e564638 | 36cf6217bf020f8499a95725cd13a5b4 | When code generation is done and we're ready to start execution, the
code pages may need permissions changed. | {
NavigationParameters np = new NavigationParameters();
await _NavigationService.NavigateAsync($"{nameof(GenerateCodePage)}", np) ;
} | 0 |
7f9df5c60f403dc4d0f84f9e29928fe6 | d1ba7c8026dc432aeddbf3606cc5a383 | Stop accepting new connections, while the individual services quiesce
and shut themselves down. | class AbstractService(object):
def stop_service(self):
self.service_connection_active = False
self.service_connection_close_event.set()
self.service_connection_close_end_event.wait()
self.service_connection_close_end_event.clear()
self.service_client_pool.stop_pool_tasks()
... | 1 |
62a0c764c8bc3e75a55c4853f6291fab | 84c0a42fd8472460e3d85ca0a931b3ca | BuildFastbitExecRequest builds a Fastbit request in JSON | logger.info('start make pb_request.')
pb_request = GetHistoryDataObjectRecordSetsRequest()
obj_names = default.get('obj_names')
data_versions = default.get('data_versions')
start_times = default.get('start_times')
end_times = default.get('end_times')
time_relations = default.get('time_realti... | 0 |
e18081fa1c47772090dbabcdb5166e36 | da622c88b18d1cf0ce711aff1a230f21 | Test that there is a data point for every month for the dates
returned in the data frame. | dh = DateHelper()
expected = []
for n in range(0, 10):
expected.append(
{
"usage_start": dh.n_days_ago(dh.today, 10 - n).date(),
"total_cost": 5,
"infrastructure_cost": 3,
"supplementary_c... | 0 |
8f87f0982e7d04901e4bdf20e2feacac | 29af98879469996dbe409101cc39c7da | 获取指定药品在库存明细表可用的最新的系统批号 | {
DataTable tbl = GetQueryTable("select itnbrf,itnbr from bomasd where bomasd.invaldate > getdate() and itnbrf='" + itnbrf + "'");
if (tbl.Rows.Count > 0)
{
for (int i = 0; i < tbl.Rows.Count; i++)
{
return Getitnbr(tbl.Rows... | 0 |
f8aeacd4040e4dc173bb6792267a808c | 854eb4a977144e95b3a3d996d2431fd1 | stop at conv3 | class AlexNetConv4(nn.Module):
def __init__(self):
super(AlexNetConv4, self).__init__()
self.features = nn.Sequential(
*list(original_model.features.children())[:-3]
) | 1 |
2e21678d34e434b669002f805b2513bb | 75e92655ee7e08cc4439fd26ad76a6b2 | Receives input key and returns json schema | static get jsonSchema() {
return {
type: 'object',
required: ['firstName', 'lastName'],
properties: {
id: { type: 'integer' },
firstName: { type: 'string', minLength: 1, maxLength: 255 },
lasttName: { type: 'string', minLength: 1, maxLength: 255 },
age: { type: 'num... | 0 |
cefd741982e62bd63e3e8b3af737c3c1 | 83253b71b6a306f94d5310096f0df773 | 增加新的备案图像,计算并输出其图像编码字符串
注意:为了保证图像名的唯一性,将首先检查图像文件名在数据库中是否有同名的,没有同名的才添加到数据库 | public class EmalAndMessageDao
public Long addSysImage(Connection conn, String name) throws SQLException,
DataException {
Map<String, String> map = null;
List<Map<String, Object>> namelist = null;
List<String> lists = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" select ts.i... | 1 |
9ebb63b076110d6bffe487953c812007 | 8ee05dc450a3d2dacf589169b5553ad5 | 查询商铺的单个菜品信息 | public String findPlatShopDishes(String platShopId); | 0 |
32f52f04376b0f66373d80df28cf94b6 | 380bdb6af7676060656ce2ad1cab9338 | Возвращает путь уровнем выше, если в конце был указан ".." | {
var directory = File.GetAttributes(path).HasFlag(FileAttributes.Directory)
? path
: Path.GetDirectoryName(path);
upLevel = upLevel < 0 ? 0 : upLevel;
for (var i = 0; i < upLevel; i++)
{
directory = Path.GetDirector... | 0 |
86f837dcf8ec069861de49ade777b87f | 46b9bd543cad5835c3b9c1cc669d7e6c | Overloaded << operator for an Account to print out the account details | out << "Number = " << c.getNumber() << "\n"
<< "Name = " << c.getName() << "\n"
<< "Balance = " << c.getBalance() << "\n"
<< "Limit = " << c.getLimit() << "\n";
return out;
} | 1 |
7d6d1eb8d9267b6e15c9cef6dcb1c0bc | 0e8c705899b8d411bfe32048cd5e36a5 | Returns the right-click context menu for an object. | class ObjectTreeWidget(AbcTreeWidget):
def handle_context_menu(self, pos):
items = self.selectedItems()
menu = QtGui.QMenu(self)
if not items:
self.add_action = QtGui.QAction("Add", self)
self.connect(self.add_action, QtCore.SIGNAL("triggered (bool)"),
... | 1 |
72cede0cfff1cda389dd2608e9737fb0 | 0d728f082462917712632d26ed0b9406 | Ping command with actual ping time | bool xptClient_processPacket_ping(xptClient_t* xptClient)
{
xptPacketbuffer_t* cpb = xptClient->recvBuffer;
xptPacketbuffer_beginReadPacket(cpb);
bool readError = false;
uint64 timestamp = xptPacketbuffer_readU64(cpb, &readError);
if( readError )
return false;
LARGE_INTEGER hpc;
LARGE_INTEGER hpcFreq;
QueryPe... | 1 |
5fc732faca44c67337461ec9c2a68485 | 2a6b399ec5378a9394fe3c1ef538d0c6 | Преобразование из одномерного массива пикселей в матрицу, в соответвии с размерами картинки | {
Bitmap lOutPicture = new Bitmap(pMatrix.Length, pMatrix[0].Length);
for (int i = 0; i < pMatrix.Length; i++)
{
for (int j = 0; j < pMatrix[i].Length; j++)
{
byte lComValue = pMatrix[i][j] == (byte)0 ? (byte)0 : (byte)255;
... | 0 |
8cae19f691226ee94443776ead470f66 | 4317de43517c5f2faa65c3ecf6872a9a | 封装相同部分代码 | def generate_common(file):
s = """/**\n* 本代码由自动生成工具生成\n* 作者:姚逢靖\n* 版权所有,免费使用,但是,使用前\n* 如果是男生,请默念,我愿意包养靖哥哥一天\n* 如果是女生,请默念,“亲爱的靖哥哥”\n**/\n\n"""
file.write(s) | 1 |
bf77f79795315689427bc60e7b542df3 | 20954d8c363939a9f67ca031dbae484d | 到活动开始时间的倒计时 | class SplashFragment: BaseImmersionFragment(),Observer<Long>
private fun startCountDown(){
Observable.interval(1,TimeUnit.SECONDS)
.map {
mTotalTime - it
}.take(mTotalTime + 1)
.compose(IoMainScheduler())
.subscribe(this)
} | 1 |
c04d91ab1a7a9b22b9e20d1641c2d1e4 | 31388d1d22304050a3b9cd04cab61638 | リザルト用のキャンバス非表示 | namespace Ctrl
public class DisplayUIManeger : MonoBehaviour
void Start()
{
ResultPanel.SetActive(false);
} | 1 |
1722ef4c82e946bd539594e38a8bafe5 | 67df2bed6ffd5ad86a2bcfcb0c3e841d | Initializes this Name from an associative array | {
parent::initFromArray($o);
if (isset($o['type'])) {
$this->type = $o["type"];
}
if (isset($o['preferred'])) {
$this->preferred = $o["preferred"];
}
if (isset($o['date'])) {
$this->date = new \Gedcomx\Conclusion\DateInfo($o... | 1 |
29813124dd107f22c284919de8a153f3 | 4da268bf7ea1b1839362309668e76f88 | Увеличение текущего значения вдвое | namespace WpfAppTemplate
public class Logic : ILogic
public long CalculateDouble(long n) => n * 2; | 1 |
5172e8a3823b54af87497b2ba683afc0 | 7112a2084423673592d39c6825c58eb2 | Set a new RNS for the service times. | class Create extends RRDToolCommand
public function setRras(array $rras) {
foreach ($rras as $rra) {
$this->addArgument($rra->getAsString());
}
} | 0 |
09c633687617a1c352cc2291ff115188 | 0ae8ce79166f97d428008e749709d591 | Refresh packaged volumes for all ship fits. | {
if (vessel != null)
{
if (vesselChange.Stage > int.MinValue)
{
vessel.ActionGroups?.ToggleGroup(KSPActionGroup.Stage);
}
foreach (var partToRemove in vesselChange.PartsToRemove)
{
... | 0 |
dc08fdfc0e68452a531c8d9e8442fdd4 | 80fe2ede8af6673cd0f5ea0163acad1f | Validate parameters provided to configure Lambda Urls | namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker
public partial class ServiceLinker
internal async global::System.Threading.Tasks.Task LinkerListConfigurations_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener)
{
... | 0 |
b94f8101d1e6039c7e5ad9a511e83c98 | ef932233076d08480e93a31edb7f9a23 | 시야를 가리는 별을 먹었을때 호출되는 함수 | function collectStar(player, star)
{
star.kill();
score += 10;
scoreText.text = 'Score: ' + score;
} | 1 |
55ea8ddd475c04630385b6ef7b0170de | 7f4f9e411544604fedc937eb35c85333 | Check that the secondary directional coordinate weight can be set | FRENSIE_UNIT_TEST( PhaseSpacePoint, setPrimaryDirectionalCoordinateWeight )
{
MonteCarlo::PhaseSpacePoint point( spatial_coord_conversion_policy,
directional_coord_conversion_policy );
point.setPrimaryDirectionalCoordinateWeight( 0.5 );
FRENSIE_CHECK_EQUAL( point.getPrimaryDir... | 0 |
f077af0331bf413a54fde1ba92a08a71 | 3934ac8a0caa6c3569529ebfeb692936 | Removes the wheat object. | {
if (Tile)
{
Tile.Unit = null;
Tile = null;
}
} | 0 |
3aa08f3e3ce8d0188341ced2adea7dbf | c39857ceaaed8bb2e6d0bb33d9686fac | 根据用户id查找所有上架积分 | namespace Vcyber.BLMS.Domain
public class UserIntegralApp : IUserIntegralApp
public IEnumerable<UserIntegral> GetAll(string userId)
{
return _DbSession.UserIntegralStorager.SelectAll(userId);
} | 1 |
732947da668a98a351518ab6b1bc2f41 | d60d3a0de4440473e70eaf8eba3f2236 | Instanciate strawberries around the tree. | max_border = (size - 1) * size - 1 - size * (size + 1) // 2
count_edges = randint(size // 2, max_border)
count_roots = randint(1, size // 2)
positions = list(range(max_border))
for i in range(count_edges):
position = choice(positions)
positions.remove(position)
row, column = ... | 0 |
62bbdc8de618d0c5b5c4fbacb6432b79 | 9a33709996f33911de3cede48b4c8b91 | 获取实现类的执行方式 | public partial class Manage_Content_Schedule_TaskList : System.Web.UI.Page
public string GetExecuteType()
{
return scheBll.GetExecuteType(Convert.ToInt32(Eval("ExecuteType")));
} | 1 |
d3d9752a450604d1ea555ce4bead5c69 | 1363366264af6ef02b9c7233c85b554c | 获取所有用户发布的文章列表 | class User extends BaseController
public function post(){
(new UserValidate())->goCheck('post');
$list = (new UserModel())->getPostList();
return self::showResCode("获取用户文章列表成功",["list"=>$list]);
} | 1 |
9d4f64b5ae30598a961060dca5210f60 | 0b70bdf836cc223adb42c6d9ebc4942b | Associates a biosequence reference to the probe. | class HostAssayPrep(Base):
def reference(self, reference):
self.logger.debug("In 'reference' setter.")
self._reference = reference | 1 |
c6e36fad761e98409262a0e9e7ec123b | 085592b6a3a5f01abb9d5308384a1ee2 | 批量更新工作经历 | $session = \Yii::$app->session;
$res_1 = Work_experience::find()->where(['uer_id'=>$session['user_id']])->orderBy('date_begin')->all();
$source_count = Work_experience::find()->where(['uer_id'=>$session['user_id']])->orderBy('date_begin')->count();
if(\Yii::$app->request->isAjax){
return $source_count;... | 1 |
8222b978cee04ff9b0b589f53781adf0 | b2fccb145906bcc964b11e46de6a9085 | RegisterExperiments request handlers. | func add(mgr manager.Manager, r reconcile.Reconciler) error {
c, err := controller.New("experiment-controller", mgr, controller.Options{Reconciler: r})
if err != nil {
return err
}
err = c.Watch(&source.Kind{Type: &iter8v1alpha1.Experiment{}}, &handler.EnqueueRequestForObject{},
predicate.GenerationChangedPredi... | 1 |
ed7df6f14bf6ff25976bd5ecf94dc80a | a45ae9fe308d0bf10fa0377417448a9e | Tests if two WorldInventories are equal | {
if (input == null)
return false;
return
(
this.PhysicalItems == input.PhysicalItems ||
this.PhysicalItems != null &&
input.PhysicalItems != null &&
this.PhysicalItems.Sequen... | 1 |
eb3e106b544af314c6d1c63122cd9033 | 2354983d1e7b9281d873e4e9cdd67c1d | Check Player Pref Initalised + Update Player Pref | namespace Sound
public class Audio : MonoBehaviour
void IsPlayerPrefs(string key)
{
if (string.IsNullOrEmpty(PlayerPrefs.GetString(key)))
{
PlayerPrefs.SetString(key, "true");
}
} | 1 |
30567c93d192fdb80a9fc6cff0c0c9af | 34472baae77f5ec64143b753bad5afae | The certificate file to upload that must be encoded in Base64 | public function getCertificateFile() : ?string; | 0 |
f5a0968b5f597f538df512df72d95ece | b25ef4d425272c2652a4419e317b3d64 | Populates the LFP tables. | long id, Scalar scalar, Set already, PreparedStatement[] stmt, int[] count)
throws SQLException {
int result = 0;
for (Iterator i = scalar.iterateLeaf(); i.hasNext(); ) {
Leaf leaf = (Leaf) i.next();
if (leaf instanceof LFN) {
LFN lfn = (LF... | 1 |
dda866d0819156b0ee995e836fa7439f | 6e34daa78e4e40940750232811a06e4f | Liefert alle Spiele je Gruppe | class Season extends Eloquent
public function getGroupMatches()
{
$key = 'matches';
if (Cache::has($key))
{
$matches = Cache::get($key);
}
else
{
$groups = $this->group->active()->get();
$matches = [];
foreach ($groups as $group)
{
$matches[$group->id] = Match::where('round_id', '=', $th... | 1 |
2f13a6279b84a10d5c0dc3761e0b2c3f | 62e6d633fe426dde7bfc39bd8857a0a2 | 调用存储过程stat_iuni_bpdata_daily | public Integer callProcStatGnAppBaseDataDaily(Map<String, Object> params); | 0 |
5c20a70ac01a9ea515027e7f007c9990 | 49186601f4f9dffa860b4ba07613431a | Method to delete group(s) using CMC REST API. | class GroupsManagementClient(dict):
def delete_many(self, code_list):
data = self.graphqlClient.request(
query=QUERY["deleteGroups"],
params={
"codeList": code_list,
},
token=self.tokenProvider.getAccessToken(),
)
return data["delet... | 0 |
d98cc2e5878b0abc7cde0753ce90332c | 6be9fc2e5e77baa832dff8d49a4c2ea2 | Set the created property: The time of creation of the API key. | class KeyAttributesResponse(dict):
def created(self) -> float:
return pulumi.get(self, "created") | 0 |
4bcfb72e9c90f9441e8a5cc17e0c96b5 | 66df9c5b10b2989458e2ff6275745a9e | 设置商品缩略图高度
商品缩略图高度 | public class Setting implements Serializable
@NotNull
@Min(1)
public Integer getLargeProductImageHeight() {
return largeProductImageHeight;
} | 0 |
bf380b9ea74add575ca4c5d587191bfb | 49926beb4f9db3560df40bb7d5fc1bf1 | convert vacuum wavelength to air wavelength, taken from Kurucz' synthe | def vactoair(vacwl):
wave2 = vacwl * vacwl
n = 1.0 + 2.735182e-4 + 131.4182 / wave2 + 2.76249e8 / (wave2 * wave2)
if not isinstance(vacwl, np.ndarray):
if vacwl < 2000:
n = 1.0
else:
ignore = np.where(vacwl < 2000)
n[ignore] = 1.0
return vacwl / n | 1 |
21b247817e34641b42b94b59c2aa120b | d29eb48a97be62075f12e1034be6460d | Sort function to sort a list of pairs in descending order | bool distCompareDesc(const pair<string, double> elem1, const pair<string, double> elem2) {
return (elem1.second > elem2.second);
} | 1 |
99977c9698e6e37ea3ca74cc1b882976 | d04c17c291cadaf9b409d9983388271f | Test removing a result folder | ch = connection_helper(CRCTestCase.test_conf_file)
opts = Namespace()
opts.testprefix = CRCTestCase.test_prefix
qr = list_test_artifacts(opts, ch.tables)
self.assertFalse(bool(qr), """Run 'removefacts --conf <config> --removetestlist' or
execute 'tests/utils/removetestfacts.py' ... | 0 |
c6fce44d29d54fb5dd1c49c25bd221c9 | bee42e86e0276da43489cf9526198447 | 获取动作的默认视图路径 | class Action extends Model
private function viewPath($controller, $action) {
if (
in_array($action, self::ACTIONS_WITHOUT_VIEW_AND_JS) ||
in_array($controller, Constant::EXCLUDED_CONTROLLERS) ||
!in_array('GET', $this->actionMethods($controller, $action))
) {
... | 1 |
0d2888941ef35b68c882d676e1701869 | 8ef1a5c3f51bd0ebb23a1827c91fe44c | Compute intersection between a plane and a line and return distance | double plane_intersection(double *Ro, double *Rd, double *P, double *N) {
vector_normalize(N);
double t = (N[0]*P[0] + N[1]*P[1] + N[2]*P[2] - N[0]*Ro[0] - N[1]*Ro[1] - N[2]*Ro[2])/(N[0]*Rd[0] + N[1]*Rd[1] + N[2]*Rd[2]);
if (t > 0) return t;
return -1;
} | 1 |
a46619cf747487505bf99588af1d254b | 91f9eb0baaf05942007becbce97990c8 | Get maximum number of results to show | function getMaxResults(props) {
const {maxResults, paginateResults} = props;
return paginateResults == null ? maxResults : paginateResults;
} | 1 |
09fab25fc5e8ff658ed332f845ed2fa6 | 07b4e39a24813588a07c0d97829f2163 | Function that passes out information to observing crewmates when the current crewmate enters | namespace AI_Midterm_RTS.Commanders
void NearbyEnter(); | 0 |
7b765451ce57903633c5590e0eaf6f8c | 1314c35907c0b483763c51535775bc02 | Расшифровка Юзер агента ------------------------------------------------------------------------------------------- | eng = 'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./'
ua = 'йцукенгшщзхї\фівапролджєячсмитьбю.'
trans = str.maketrans(eng, ua)
if len(inputstring) > 0 and inputstring[0] == '~':
return f'{inputstring.lower().translate(trans).title()}'[1:]
else:
return inputstring | 1 |
27e4166f3624d5bdb253da2895fdbd56 | 1904b6e51509f9aa20e17ca2de58b325 | Compte le nombre de dislikes d'une conversation | function getDislikes($id)
{
global $conn;
$sql = "SELECT COUNT(*) FROM rating_info
WHERE post_id = $id AND rating_action='dislike'";
$rs = mysqli_query($conn, $sql);
$result = mysqli_fetch_array($rs);
return $result[0];
} | 1 |
ab1ea9cb4b340958106b027bfb31c547 | cd1c0ca85ece102e8245129f4bb804a2 | Checks the ability vital, making sure there's enough to activate the ability. | namespace FailSwitch
internal class Program
private static void AbilityCheck(Player sender, ExecuteOrderEventArgs args)
{
var spell = NoTargetSpells.FirstOrDefault(x => x.Name == args.Ability.Name);
if (spell != null)
{
_testExpr = GetExprFunc(sender, args... | 0 |
172100472f106dc7ac4125c84fb78594 | 1e57b6d7c9201b45cc39900ff448518a | insert line break to the current position | class TextBox
def line_break
@content << $/
end | 1 |
52c271fd450c56d23a1ca71f2aa5a22b | e4e64e7702081f124cd06661c319a313 | {EV_XP_THEME_DRAWER_IMP}.draw_text | {
GTCX
EIF_REFERENCE loc1 = (EIF_REFERENCE) 0;
EIF_POINTER tp1;
EIF_POINTER tp2;
EIF_POINTER tp3;
EIF_INTEGER_32 ti4_1;
EIF_INTEGER_32 Result = ((EIF_INTEGER_32) 0);
RTLD;
RTLI(4);
RTLR(0,loc1);
RTLR(1,arg1);
RTLR(2,Current);
RTLR(3,arg2);
RTLIU(4);
RTGC;
loc1 = F468_13506(Current, arg1);
tp1 = *(EIF_P... | 1 |
9e27a8a978f55772a7f8bc3e81af7103 | b210932ce15dfb031a90652a203845c5 | Печатает расширенную матрицу на консоль с вектором правой части | {
char ch;
if (n < 7)
{
for (unsigned int i = 0; i < n; i++)
{
for (unsigned int j = 0; j <= n; j++)
{
ch = (char)(j + 97);
if (j != n)
{
std::cout << (*p_mat)(i,j) << "*" << ch << "\t";
}
else
{
std::cout << "= " << (*p_vec)(i,0) << ";\n";
}
}
}
}
else std::cou... | 1 |
edaee6409dbab2888ea7725cc5fdb4a1 | 1cf59c7fbbbdc30126095fde300499d8 | Returns the meta object for data type '{@link org.eclipse.emf.common.notify.Notification <em>Notification</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getDEFAULTType_NOTIF(); | 0 |
5ffaa1c1e3173f6bdd25d2a4be0b0fd4 | d7a77e4349c9ccee98a23801275e89d2 | separate thread blocks waiting for stdin, signals on arrival | void vt_timer_handler(int sig){
sigprocmask(SIG_BLOCK, &signals_set, NULL);
READY.push_back(uthread_get_tid());
switch_threads();
} | 0 |
0ef7a1444e5d8e3406ab1714c6f2afdf | d8dad1466e08eb8d130d3d1a381730c7 | This definition is overridden if FPU is present | namespace NAsmJit
public class Assembler
: IIntrinsicSupport<GPReg, X87Reg, MMReg, XMMReg>
, IX86IntrinsicSupport<GPReg>
, IX87IntrinsicSupport<X87Reg>
, IMmIntrinsicSupport<MMReg>
, IXmmIntrinsicSupport<XMMReg>
private void EmitFpu(int opCode)
{
EmitOpCo... | 0 |
079e47993ea6896d9fc38541eccff8fc | 72c322fd4be0cf676e266670f7922c36 | Returns the root mean squared error | class RootMeanSquareError(LossFunc):
def f(t, y):
return np.power(SOS.f(t, y) / t.shape[-1], 0.5) | 1 |
53a93c2e29586efb876e6946a1fa8e10 | 4c554650407ce24c8c167b9b03b6af7e | POST /course_reviews
POST /course_reviews.json | @review = Review.new(post_params)
@review.review_id = generate_guid
if @review.save
render :json => @review.to_json(:except => :_id), status: :created
else
render json: @review.errors, status: :unprocessable_entity
end
end | 1 |
12f0c948d7c7ebe544e9d87c8bc681ae | fdfbb507f1e4bd114ad566d3f1b5b606 | Initialise the Database with host, username, password | class Use_database():
def __init__(self, host, user, passwd, dbname, port):
self.host = host
self.user = user
self.passwd = passwd
self.dbname = dbname
self.port = port | 1 |
2079f8f9d66165101b0be726e6577f5c | b6b6f13d6a1600abca579af83f828bee | Transform images with semantic classes encoded as colour into one-hot encoded images | class Dataloader(object):
######################## Initialize Class Instantiation ########################
def _one_hot_encode(self, image, mask):
one_hot_map = []
for color in self.palette:
class_map = (color == mask)
class_map = np.all(class_map, axis=2) * 255
c... | 1 |
ef4ac67782cc975a394c99ef7403c276 | e054af9e7d177b4e7da730624efbff47 | excel with first row header, use header as key | def excel_mappings(title_row):
return {entry.value.strip(): entry.column for entry in title_row} | 1 |
23e8b39e8d2246430ac5affeec6cd350 | 4ee0afcf3be92ba8cb8653bb7d917e9a | Stops and removes old RoboCI containers | def cleanup_containers(include_initial=False):
docker_fabric().cleanup_containers(include_initial=include_initial) | 1 |
a7c8dd50873ff6f9b8d731c8264dc91f | 5a5bda16fc14c7387528cd0c9e9d1d34 | 通过用户角色Id列表,删除对应的状态. | int delRelByRoleIds(List<Integer> list); | 1 |
1834e7d6004109784b5639fa8afd8d99 | 80cdc72401fe42ac3846740a6f8b9168 | Resets rate limit counter | self.remaining = GATEWAY_RATE_LIMIT_LIMIT
self.queue = deque()
self.wake_upper = None
self.resets_at = 0.0 | 1 |
1461a4ac4cb56de9ed75c8cdc66ec030 | fe91694fad5e80e50d274375144cf73b | Counts the number of materials that are
applyed to a specific item | function calcItemsCount(specId){
var count = 0;
view.scene.traverse(function(node){
if (node.specId == specId) {
count++;
}
});
return count;
} | 0 |
3457dcaa24f1ed464617b5c37134a351 | 67871273cf2b3833d6ad1c08ae6ca79c | Ensure a Transaction was started before a read is attempted | class ReadOperationTestCase(unittest.TestCase):
def test_read_instruction_with_no_transaction(self):
instruction = Instruction("R(T3,x4)")
self.assertRaises(ValueError, self.trans_manager.execute, instruction) | 1 |
dcdd11532fa044b8dedd42793f48711f | 1fcfc854b8268cb4dd14310e7b348cf9 | Initializes the scene with a control panel, grid, population panel. | public class UserControlPanel extends HBox
private void newGrid(Scene scene) {
myGrid = new VisualizeGrid(xmlReader);
BorderPane root = (BorderPane) scene.getRoot();
root.setCenter(myGrid);
mySimulationLoop.setVisualizeGrid(myGrid);
} | 0 |
d661492e3f3a550d93172081b0038ed8 | 0a6f31d1131dd712cdfee1fdce1b14b5 | 获取要下载的歌曲的id | class WangYiYun():
def getSongsId(self, playId):
data = {
"id": playId,
"n": 1000
}
res = self._requests(self.urls["GETSONG"], data)
songsId = [i["id"] for i in res.json()["playlist"]["trackIds"]]
return songsId | 1 |
ca898615453d7adb63bc7d7e28cc8223 | 9cfaa3a88de9d8560a4f7a0b615643f6 | Test NDCG computation | assert predictions.shape == target.shape
assert predictions.ndim == target.ndim == 2
nrow, ncolumn = target.shape[0], target.shape[1]
assert ncolumn >= k, 'NDCG@K cannot be computed, invalid value of K.'
NDCG = 0
for i in range(nrow):
DCG_ref = 0
num_rel_docs = numpy.count_nonzer... | 1 |
abef9a6ec3750e96ef8e7ca468da013f | 0569f56f8c45fc046cc310e6742f04cd | Verify that correct nonce was used with time limit.
The user is given an amount of time to use the token, so therefore, since the
UID and $action remain the same, the independent variable is the time. | class NTP1ApiTest extends \PHPUnit_Framework_TestCase
public function testBurnToken()
{
} | 0 |
c014ef4bb4aab41d7802b9f980e3e876 | e2ead44cd4815c694b5de4eef17da900 | returns compressed size divided by its original size (length) | class ImgCompression(object):
def compression_ratio(self, X, k):
n = X.shape[0]
d = X.shape[1]
orig = (n * n) + min(n, d) + (d * d)
compressed = k * (1 + n + d)
return compressed/orig | 1 |
c355ae7ccf3d0e1f3bffee7778451e4c | 7ca7e48af00cb85b70004126462d7255 | Reenables appropriate toolbar items upon leaving debug mode. | {
ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_RUN, 0);
ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_PAUSE, 0);
ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_STOP, 0);
ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_STEPINTO, 0);
ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTO... | 0 |
dcd933847a0151a0e0728eef85ec3a4a | 7f61448ad6da3ef0f9cb03f40c5be655 | e.g. 02-Apr-1994, 00:01 | cases like (1) | 0 |
d2821c9df2990556863fcc70cdbba0f6 | e540124a3e6a9c6c32cb62b7aad43d30 | 080A - Validate successful removal of an existing character | [Priority(1)]
public void ValidateSequenceRemoveAt()
{
Sequence seq = new Sequence(Alphabets.DNA, "GGCCTT");
seq.IsReadOnly = false;
seq.RemoveAt(0);
Assert.AreEqual("GCCTT", seq.ToString());
Console.WriteLine("Sequence P1: Validation o... | 1 |
fe4fa4382694489bf8e377201993cb20 | fd45b25e61760f3e2e6c0e0f800dbf99 | Creates faq item. | Action\Context $context,
Filter $filter,
CollectionFactory $faqCollectionFactory,
FaqRepositoryInterface $faqRepository
) {
$this->faqRepository = $faqRepository;
$this->faqCollectionFactory = $faqCollectionFactory;
$this->filter = $filter;
parent::__c... | 0 |
d6d7302a6e1652e231c0157fa77429f6 | 941100b7d958d9d6cf6c10dd29a43fde | Copies a range of vectors from a flattend array to a vector array. | class Vector:
def copyFrom(self, A, lo, hi):
self._size = 0
self._elem = []
if len(A) < hi: raise IndexError
while lo < hi:
self._elem.append(A[lo])
self._size += 1
lo += 1 | 1 |
e062020cd14a454d39c7c63f22eced72 | dac91042a7cd4be6da02718e3ef389f6 | renders account creation into listdiv | $list = $(domSelector).empty();
var accounts = db.queryAll('account', {sort: [['order', 'ASC']]});
for(var i = 0; i < accounts.length; i++) {
var acc = accounts[i];
var checked = acc.disabled ? '' : ' checked="checked"';
$list.append(
'<li class="swipeout" data-uniqueid="' + acc.uniqueid + '">' +
' <labe... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.