query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
0498f1178312017c0b22c2f1d726e054 | 4311e2e95bf0fd56654b65263693c01c | 画像の圧縮率を指定する。
値が小さいほど圧縮率が下がるが、下げすぎると上限サイズの64KBを超えてしまい
画像が取得できなくなる。
リセット後のデフォルト値の 53 以上の値を推奨する。 | class Image_FileUploader
public function setMinCompressSize($min_compress_size) {
$this->min_compress_size = $this->size2byte($min_compress_size);
return $this;
} | 0 |
33c2bc4c823b4b9338f1d7c953bcb30b | fbccbd504c8bedd63cfa9ad996407106 | Returns average position of nearby boids | X = thisBoid[0]
Y = thisBoid[1]
avgX = 0
avgY = 0
for boid in BOIDS:
if (thisBoid != boid):
avgX += boid[0]
avgY += boid[1]
avgX = avgX / (BOIDNUM-1)
avgY = avgY / (BOIDNUM-1)
X = avgX - X
Y = avgY - Y
return [X,Y] | 0 |
71407cd28280cfab5a40ed65d8ad4e9d | 7deb58aa086ff2dfa59c64d7ac834a81 | Exit the application when user double clicks on the back button. | function keyEventHandler(event) {
if (event.keyName === "back") {
try {
tizen.application.getCurrentApplication().exit();
} catch (ignore) {}
}
} | 0 |
497ff30fdce3845396d0fe35138072d6 | 929d9f71858f2fbb8fdeefc35b017401 | 从点云得到强度图 | {
PointCloud::Ptr cloud ( new PointCloud );
for (auto i = 0; i < depth.rows; i += 2)
{
for (auto j = 0; j < depth.cols; j += 2)
{
ushort d = depth.ptr<double >(i)[j];
if ( 0 == d )
{
continue;
}
PointRGB p;
... | 0 |
5aeb6776848a4510703f3ab952682a19 | 2cc88bc730b3f51969c34e9eef7881d2 | Make it look like you are working. | function attention() {
var img = window.__AUNTY_HELPER__.image;
img.style.animationName = 'attention';
img.style.animationDuration = '0.5s';
setTimeout(function() {
img.style.animationName = '';
}, 500);
} | 0 |
d58a86e69ec35dccb274e71cb2ac2ec5 | 48987f920fec6d0ea6e5d1c93dd0b476 | Display a 2D manifold of the digits | def show(t):
dimlist = [(1, 26)]
for d in dimlist:
plt.matshow(samplemat(d))
plt.title(t)
plt.xticks(range(26), ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'))
plt.yticks(range(0), ... | 0 |
855d4a339ccfe76a4845762246aa6acb | 6d4552b4e22612d988654d7bc9c07d12 | 异步校验 | @ResponseBody
public JSONObject asyncVerify(HttpServletRequest request, String userName, String cagent, String async) {
if (StringUtils.isBlank(async) && !"1".equals(async)) {
return BaseResponse.error(BaseResponse.ERROR_CODE, "error");
}
return registerService.verifyAccount(... | 1 |
7dfe8ed53331cc2da4c599f3195e58db | 14c10b8b10393dc352722ca91dc73b88 | Finishes the asynchronous execution of the UpdateMediaInsightsPipelineStatus operation. | namespace Amazon.MediaConnect
UpdateFlowMediaStreamResponse EndUpdateFlowMediaStream(IAsyncResult asyncResult); | 0 |
e7ac6cf9c0347188dfe5e0b5b6e0da6b | e635958f01436d0d64ac8e2250ee91f4 | Clears fail log for the specified import. | for (ISubmissionListener l : new ArrayList<ISubmissionListener>(submissionListenerList)) {
l.removalFailed(failedImport, e);
}
} | 0 |
418f153fa51c24b490bc120a81332ecf | 85e00893c788382d08912d82a8ef7c5f | VisualBrush をテクスチャに書き込む | namespace Rito.TexturePainter
[DisallowMultipleComponent]
public class TexturePaintBrush : MonoBehaviour
public void SetBrushColor(in Color color)
{
brushColor = color;
CopyBrushTexture();
} | 0 |
ee1aec1c9303f9a96a0a05cb3a63d046 | 824e6c70e0f701a8110d0bbe355649d4 | Hàm vẽ hiệu ứng nổ khi va chạm | public class BombIncrease implements PowerUps
public void drawOn(Graphics2D g2) {
Graphics2D g = (Graphics2D) g2;
g.setColor(Color.pink);
moreBomb = new Rectangle(RectX, RectY, side, side);
g.fill(moreBomb);
} | 0 |
b6b74091ad6c8eda568899d8828049f2 | a09788e2f4615321779a1607de6c66ef | 사용자는 권한이 없는 임시 개발글을 변경하거나 삭제할 수 없습니다. | class EditTestCase(TestCase):
def test_permission_denied(self):
c = Client()
c.force_login(self.test_user_2)
i = Issue.objects.get(pk=self.issue.pk)
response = c.post("/issue/edit/%d/" % self.issue.pk, {"name": "name", "value": "XX"})
self.assertEqual(response.status_code, 403)
... | 1 |
f93ac59a74ede1fda9f756b3589a4f46 | 4e3220aac56ad1076df58330bb576c5f | 对于某个时间序列用训练好的线段聚类模型测试 | m = len(test)
y = np.mat(np.zeros((m, 1)))
for i in range(m):
y = treeForeCast(tree, test[i], modelEval)
return y | 0 |
6875d4aa8c644970e6a45b7a29e3513d | 4a51a020f6fb458b109d35ad1c1a089c | 取得订票显示按钮 | class erp_fahuo_confirm_page():
def get_fahuo_button(self):
return self.f.get_element('fahuo') | 0 |
c380265d18aea6da5243e4619237929f | 81be2ec38aa911294c1da3eb48929214 | 判断是否大屏 | function isLargeSplash() {
var width = getScreenWidth();
var height = getScreenHeight();
return width > 1024 || height > 1024;
} | 1 |
10147e0ee4283093d48eda2189294b28 | 3ef858b7a1b91d1714ae772916ebbac1 | ===============================================================================
在列表尾部插入对象
要插入的对象 插入成功则返回true | public boolean insertAfter(Object obj,Object e); | 0 |
45eaf67ae9435081424e78b95294cd42 | bac5af74f08e87b3d2c3dd4e015c9ce8 | function that receives a string and determines which room type index the connection corresponds to in the room_type array | if line2 == "room1":
return room1
if line2 == "room2":
return room2
if line2 == "room3":
return room3
if line2 == "room4":
return room4
if line2 == "room5":
return room5
if line2 == "room6":
return room6
if line2 == "room7":
return room7
if line2 == "room8":
return room8
... | 0 |
026c4bad94f95effe28ae871ae956a3e | 6c1e7b3d5bf0be8b5bdff36e34a8e7ac | @brief Pone ad inattivo lo stato dell' utente ed elimina quest'ultimo da tutti i gruppi
a cui è iscritto
era creatore | if (getOnline(msg.hdr.sender) == -1) {
sendOp(fd, OP_FAIL);
chattyStats.nerrors++;
printf("SERVER - ERRORE: %s deve collegarsi\n", msg.hdr.sender);
return;
}
if (signUp(users, msg.data.hdr.receiver, 1) == -1) {
sendOpAtomic(msg.hdr.sender, OP_NICK_ALREADY);
chattyStats.nerrors++;
printf("SERVER - ERRO... | 0 |
ab4294fa01a4a49e6d2e6261a102ae8a | f4699c64305225a5253c97e8ab276943 | ajax로 제품 페이징 처리 (제품리스트) | @Controller
public class WooBoardController
@RequestMapping("/product/ajaxList.woo")
public ModelAndView ajaxList(Model model, HttpServletRequest req, Principal principal) {
logger.info("ajaxList");
logger.debug("ajaxList");
ModelAndView mv = new ModelAndView();
ParameterVO parameterVO = new ParameterVO();
A... | 1 |
94cd45f85986422ce6567a9a7a6232ba | fca6639ff628871b09554b4c2b3cae16 | 用例2:检验上面homework函数的功能,% | def homework_id():
return '7' | 0 |
a91fda2091d5f1da4b9889faea0b42a1 | 06a68a92017da04886cfd00a1daa0b8a | 获取五日天气预测数据 | interface AccuWeatherAPI
@GET("/forecasts/v1/daily/5day/{locationkey}?metric=true")
suspend fun getFiveDaysForecast(@Path(LOCATION_KEY) locationKey: String, @Query(API_KEY) apiKey: String, @Query(DETAILS) details: Boolean) : Response<AWForecasts> | 1 |
097bdd2b60deeb1c35cfa97347ed2a28 | 5721570f29e93ec6fd0aa456330fb3f1 | Set Document Action. | public class X_UY_TT_Hand extends PO implements I_UY_TT_Hand, I_Persistent
public String getDocAction ()
{
return (String)get_Value(COLUMNNAME_DocAction);
} | 0 |
f69b23148077b7d9a0599bed91900f42 | d900e372f0839bbf68e6dd83448206b9 | Import a /dev directory recursively. | IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
try {
for (IResource resource : root.members()) {
recImport(resource);
}
} catch (CoreException e0) {
throw new WrappedException(e0);
}
} | 0 |
49caf6f9eea9da08dfd71eeb77b8f2cb | 75bc350f268f0b0c0b6dd21028cafb4e | deliberately do nothing for now | class NothingTaskProcess : IRusticTaskProcess<IBase>
override fun run() {
} | 1 |
efa351166bff0e066ff3590570c41092 | 25906a3a8856e8f64629b524484d1bf7 | #' @return a string representing the default adapter. | str_GVF.db <- function() {
str(GVF.db$db)
} | 0 |
97bc4167de5a1941128e282542bc3ebc | 00e0ce2da0c6127e399ca1395ea9a8fb | Is sequence instance is buckled or not. | public function isBust(): bool; | 0 |
b093c9f992170964b0b2b60041a95d23 | 6c7644fb1e4ee54f45e352cd54681c24 | Save the winners to databse. | Connection conn = null;
try {
conn = DriverManager.getConnection(URL,USER,PASSWORD);
conn.setAutoCommit(false);
PreparedStatement pstmt = conn.prepareStatement("insert into ts_winningpeople(prize,area,row,seat) values(?,?,?,?)", ResultSet.TYPE_SCROLL_INSENSITIVE,Resul... | 1 |
abc41d3ffb50f47fbe20031278bf6091 | 56a4eae2a353036a68eff13f73d83dec | Gets the position of the bottom right field after being rotated to
the left. | @Override
public IFieldPosition rotateRightPosition() {
return LEFT;
} | 0 |
5b5d9935a7be155b8cfcfb4ecc89e575 | da84a0b5f682315f2a5c68c93422966a | 获取列表页的数据
page为50*i
输出结构
[
'tid'
'pid'
'user'
'link'
'title'
'replyCount'
'isTop'
'isGood'
] | def getDataFromPages (urls):
_arr = []
for i in range(0,len(urls)):
__mess = '暂无数据'
__url = urls[i]
_page = getHtmlDom(__url)
_ids = __url.split('?')[1].split('=')
_dataTable = _page.select('td.bk > table table')
if (len(_dataTable)>0):
__mess = '获取数据.... | 0 |
4666590dd1f6db49d3671dc838dd818d | 14e878f4b8f885425530cb566f0d63a9 | Determine if the maxFeePerGas and maxPriorityFeePerGas fields are not
supplied and that the gasPrice field is valid if it is provided. This will
return false if gasPrice is a non hex string.
the transaction to check
EIP1559 fields | const gasPrice = await this.getExecutionGasPrice(txRequest);
const gasAmount = this.util.calculateGasAmount(txRequest);
const reimbursement = txRequest.gasPrice.times(gasAmount);
const deposit = txRequest.requiredDeposit;
const paymentModifier = await txRequest.claimPaymentModifier();
const rewa... | 0 |
3225d4350c2efd37f39d5935d58479d5 | e3f442de28bdf402be401bb051a82cdf | Returns a transform for converting local coordinates to world coordinates.
Just a rotation then a translation - but constructing the matrix directly is faster. | namespace Macabre2D.Framework
RotatableTransform GetWorldTransform(Vector2 originOffset, float rotationAngle); | 1 |
cf23ec762eaf65e9e76c620d8c9311c7 | b5563b47e59fde89d8745921ce845a87 | 此函数通过使用poplib实现接收邮件 | def get_msg(user,passwd):
mail_host = "pop.qq.com"
mail_user = user
mail_pass = passwd
try:
p = poplib.POP3_SSL(mail_host, 995)
p.user(mail_user)
p.pass_(mail_pass)
p.stat()
resp, mails, octets = p.list()
index = len(mails)
resp, lines, octets = p.... | 1 |
5e8f3dc8214b87753c495632f79ddbd6 | b5edb5ddc9530960f7f67a3beda84942 | returns the comma seperated values for the heap | class Heap
public String toString() {
String res = String.format("(%2d,%2d):", n, H.length);
for (int i = 0; i < n; ++i)
res += String.format(" %3d", H[i]);
if (n != 0) res += ";"; else res += " ";
if (n < H.length) {
res += String.format("%3d", H[n]);
for (int i = n+1; i < H.length; +... | 0 |
d96ee1f4ce57fe4e4cfacc0848be3166 | 003113e3c4d8bfa9aaa797a2b9c185d4 | void glPolygonMode(GLenum face, GLenum mode) | namespace CSharpGL
public partial class WinGL
[DllImport(Win32.opengl32, EntryPoint = "glCullFace", SetLastError = true)]
private static extern void glCullFace(uint mode); | 0 |
fa1fbc15225e977f7e89613032542c25 | 14a6f0c024dbea57ad5b24af4332f644 | converts the rectangle returned by predictor to bounnding box that is a four element tuple:(x_coord,y_coord,width,height) | def rect_2_boundingbox(rect):
return (rect[0],rect[1],rect[0]+rect[2]-1,rect[1]+rect[3]-1) | 0 |
82dfe84a1db1881f7ade805607df5391 | 3530ad29c27f6817e5cc4430ba702ea1 | Замена картинки на бинарное поле (для удобства) | def to_bin(im):
im = im.convert('L')
w, h = im.size
if w != 280:
im = im.resize((280, 158))
return im | 0 |
883a1717ea90cc18f60f25cb11e315c7 | 8e0fbadfed04c24c94a03573d91d6321 | Imagen y texto generado en sprites de capas | var style= {fill:"rgb(255,255,255)", font: "20px Averia Sans Libre", align:"center"};
var miTexto = game.add.text(posx, posy, texto, style);
grupo.add(miTexto);
miTexto.anchor.x = 0.5;
this.update = function(){
miTexto.alpha -= 0.006;
miTexto.y -= 0.15;
if(miTexto.alpha <= 0... | 0 |
8280c7a076e9bd7580e834e8bf3c2f01 | b6027e735c9f1027a264eeda71078bd8 | 如果本地不存在,则联网下载,保存至本地
如果本地存在,则直接显示 | {
m_LocalVersionInfo = new ResVersionInfo_Local();
if (!Directory.Exists(Context.CacheAddr))
{
Directory.CreateDirectory(Context.CacheAddr);
}
string cachePath = Path.Combine(Context.CacheAddr, Context.VersionInfoPath);
if ... | 0 |
e47360d2f5f513b5214e9eb27ae4f3c0 | 9450f60ce9b3f66301cf4ab19aab8b6a | Add appropriate new criteria options to the form | class CriteriaType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('description', TextType::class)
->add('order', IntegerType::class)
->add('mark_max', NumberType::class)
->add('mark_min', NumberTy... | 1 |
a2bde7abd028701a3837dad1d8754ffd | f7af76edcd610a2e449b9fa5341cb7ef | The entry point resolver is used to determine the method to be called on a
component when an event is received for it. | class EntryPointController extends HydraController
public function getAction()
{
return new EntryPoint();
} | 0 |
b0c423c3f5a9eef785957f24671be863 | 38c234ff8e62ce128850b72990ee4578 | Event handler for the easy difficulty button | {
if (!easyToolStripMenuItem.Checked)
{
GameSettings.ChangeDifficulty(0);
this.easyToolStripMenuItem.CheckState = CheckState.Checked;
this.normalToolStripMenuItem.CheckState = CheckState.Unchecked;
this.expertToolStripMenuIt... | 1 |
3b69f4bd2d7d2ed51c0b56c7980ea106 | 8b3d46ad35b287272226c22480047fc8 | Formats an introduction line and a list of bullet points at an offset | $title = get('name', $block);
$link = lowerCase($title);
return "- [{$title}](#{$link}) - {$block->summary}\n\n";
} | 0 |
fef330d55952048e2abcbe9d23a3e455 | 54226d3745768737351495fc34da45ad | Computes the Signed Distance Function for input samples. | def surfd(input1, input2, sampling=1, connectivity=1):
input_1 = np.atleast_1d(input1.astype(np.bool))
input_2 = np.atleast_1d(input2.astype(np.bool))
conn = morphology.generate_binary_structure(input_1.ndim, connectivity)
S = input_1 ^ morphology.binary_erosion(input_1, conn)
Sprime = input_2 ^ mor... | 1 |
9633979c0167e873b3ec3b8e9e64305c | 529babd4bc57c6e7e2c7ceb8a55430be | Multi-band, multi-scale Mel-spectrogram loss. | config,
mp_group=None,
quantize_scales=None,
quantize_groups=1,
merge_count=1,
mlp_extra_grouping=False):
super().__init__(config,
mp_group,
quantize_scales,
... | 0 |
21832778f65c9dbb362d01cf35d6f24f | cd21e15622fcfc0146c483b5adb34bcf | Method to simplify deprecating a bulk of configuration related to a
component. In short, it generates and returns a list of deprecated
configuration from the complete list using a smaller list of
supported keys. The output is formatted as a list of hashes, similar
to the one from `GitLab::Deprecations.list` above.
The ... | class Deprecations
def identify_deprecated_config(existing_config, config_keys, allowed_keys, deprecation, removal, note = nil)
return [] unless existing_config
matching_config = existing_config.dig(*config_keys)
return [] unless matching_config
deprecated_config = matching_config.reject... | 1 |
9d77af3b2e03a19771175ad118ea87b2 | 9c57a2aa5da00c00b31bd3430b7d33d4 | 定时清除礼物 | function _clearGiftItem()
{
if (mGiftItemAsynIcon)
{
mGiftItemAsynIcon.cancel();
}
} | 0 |
90ecbc90f1715a4a83fce770f8c32d3c | 0551d7f6bb83f417df428a76f6cdc855 | Time if value == time.Time zero value, return def otherwise return value | if i == nil {
return def
}
return *i
} | 0 |
5af12470076e1900635536e6bf61d469 | 8abc2c1b7bf6bc2a80a9438d96c86f9c | Checks if the navigation stack is empty | internal class RootFragmentHistory(private val defaultEntry: Int)
private fun isEmpty(): Boolean = rootFragmentStack.isEmpty() | 1 |
1971a9df5cf950cbef6b720166ae8774 | 7b56fafcf2a71e10927816c0f29fd8c6 | 构建所有部署任务的salt stack规则文件 | def deploy():
copy_project()
copy_salt_roots_and_pillars()
salt_highstate()
set_app_owner()
restart_servers() | 0 |
4c53b657d600e1a959534f174fcddf7b | a4fa9bfdbf7b3dee7bc0bb1376009006 | retrieves the user's tickets upon page load | function constructUserTicketTable(){
$user_id = $_SESSION["user_id"];
$result = config("conn")->query("CALL GetTicketsByUserId('$user_id')");
$table = "";
while ($row = $result->fetch()){
$ticket_id = $row["TicketId"];
$table .=
"<tr id='ticket-$ticket_id'>
<td>".$ticket_id."</td>
<td>".$row["ComputerI... | 1 |
9b9783b3cd0529526b8d05535829e31c | 31de5c46164584c8a9723e79408e0d9f | #################################################-REGISTRAR-TURNO-########################################## | $sql="insert into turno(
nom_tur,
ini_tur,
fin_tur,
mer_tur,
est_tur)
values(
'$this->nom_tur',
'$this->ini_tur',
'$this->fin_tur',
'$this->mer_tur',
'$this->est_tur');";
return $thi... | 1 |
e3ed6d00c2f736629f41a1d045a95e9a | 1830e835e2aaba35f7972333d957ee3a | Gets the list of block names of the disabled blocks. | public class PeerAttributesTablePart extends TablePart implements IDisposable
public final String[] getBannedNames() {
return bannedNames != null ? bannedNames.toArray(new String[bannedNames.size()]) : new String[0];
} | 0 |
adb2bd212fa2ecfcb8201d716d152fe0 | 65bc080e8e162560cb1ea9d9e6654a71 | returns the macro averages in a tuple (precision, recall) | avgPrecision = []
recall = []
grouped = reference.groupby(["type","kb_id"])
for KBsituation in grouped:
refKBsituation = KBsituation[1].groupby(eqclass).size().to_frame('weight').reset_index()
sysKBsituation = system[(system["Place_KB_ID"] == str(KBsituation[1]["kb_id"].unique()[0])) & \... | 1 |
0245ed80f7e7000ab2d5b76aec5ecac1 | 8988d729e25b23ec2d240fc9d27f6ff5 | 每次闪光就修改下次闪光类型 | this.flashType = flashType;
String flashMode = null;
switch (flashType) {
case FLASH_MODE_ON:
flashMode = Camera.Parameters.FLASH_MODE_TORCH;
break;
case FLASH_MODE_OFF:
flashMode = Camera.Parameters.FLASH_MODE_OFF;
... | 0 |
07b5fe8a5ccd6dbeb0634ca8ba74c32a | 57070f77fbd846ed7e9fc0c009b0a3ff | Считывает следующую строку, представленную
в Unix- или DOS-формате. Устанавливает позицию
потока на начало следующей строки или на конец файла. | bool
getline
(
char *buffer,
CU8 length
) { return( m_stream.getline(buffer, length) ? true : false ); } | 1 |
5d7d49f0e6b9afd2e521bbb18675e4ca | 9f4e9774d3b62003991100bafb25ca9d | Save parameters from a model run for a set of specific training dates into the database. | from .modeljob import ModelJob
url = 'projects/{}/datetimeModels/'.format(self.project_id)
flist_id = featurelist_id or self.featurelist_id
payload = {'blueprint_id': self.blueprint_id, 'featurelist_id': flist_id}
if training_row_count:
payload['training_row_count'] =... | 0 |
eff03a3ea20f9dbf429e91a370bb3343 | 2ab444c692bb065e97363f0693c0b030 | Retrieve the <c>indexed_modified_on</c> property of the item | namespace Innovator.Client.Model
[ArasName("ES_IndexQueue")]
public class ES_IndexQueue : Item
[ArasName("indexed_modified_on")]
public IProperty_Date IndexedModifiedOn()
{
return this.Property("indexed_modified_on");
} | 1 |
3ab47436741a8af33c751e3cdcaf89c9 | 2a23001d93baba13d578a112ac2d0a34 | create a new window with a title, x and y positions on screen, width and height | class util_cliGui
public function addWindow($title, $rows, $cols, $xPos = self::POSITION_HOME, $yPos = self::POSITION_HOME) {
list($xPos, $yPos) = $this->getCoords($xPos, $yPos, $rows, $cols);
newt_open_window($xPos, $yPos, $cols, $rows, $title);
$this->resetRowCaret();
} | 1 |
65fa3151812e2b3bfb412af0a64ba602 | d6aee278d7c0c434f3eb6c6dea116d72 | configure SMS callbacks | {
int stat = ppposStatus(NULL, NULL, NULL);
int taken = pdFALSE;
if ((stat != ATDEV_STATEFIRSTINIT) && (mpy_uarts[gsm_uart_num].uart_mutex != NULL))
taken = xSemaphoreTake(mpy_uarts[gsm_uart_num].uart_mutex, PPPOSMUTEX_TIMEOUT*5);
new_SMS_cb = cb_func;
SMS_check_interval = interval;
sms_tim... | 1 |
6d6a239a934cbd081a0816dd16ca4457 | 9770f2e6d5929f3f92a62eee3f34b18f | constraining parameters to solutions that make physical sense with
flat priors | def flat(theta, parametrization):
if parametrization == 'mc10':
ecc = theta['ecc']
omega = theta['omega']
elif parametrization == 'exofast':
ecc = theta['sqe_cosw'] ** 2 + theta['sqe_sinw'] ** 2
omega = np.arctan2(theta['sqe_sinw'], theta['sqe_cosw'])
else:
raise Valu... | 1 |
5d328d2617ff293cecf2c130e6284dc8 | c98a0c56181f3d9356873257db7f47e2 | Function used to mimic the behaviour of VideoCapture.get. | class VideoCapture():
def read(self) -> (bool, np.ndarray):
return self._video_capture.read() | 0 |
950ebf8bcab3b2da86ab4543787e1185 | f97f35b2e0e68354aca1f7f52186e0c2 | Função para escrever o nome do GAME no menu inicial | void nomeJogo() {
printf("\n\n\t\t");
printf(RED "S" RESET);
printf(BLUE "U" RESET);
printf(YELLOW "P" RESET);
printf(GREEN "E" RESET);
printf(MAGENTA "R" RESET);
printf(CYAN " E" RESET);
printf(RED "X" RESET);
printf(BLUE "P" RESET);
printf(YELLOW "L" RESET);
printf(GREEN "O... | 1 |
49460e083081fe0633a0ef0f50ec74f9 | e659c188616a36974a404cb8763fdc49 | Tests that when a valid extension that contains a digit is appended to
the chunk size, the chunk is correctly read. | public void testLargerTrailerChunks() throws Exception {
int trailerLength = 1200;
final boolean[] done = new boolean[] { false };
Message rpc = Mockito.mock(Message.class);
NettyInboundRoadRunnerMessage msg =
new NettyInboundRoadRunnerMessage((byte) 1, rpc, trailerLength);
NettyInboundRoa... | 0 |
9d2c745cd784a362bcd2e0e3b33ff0d5 | 53d9522760ff170ac892b4e908fa72c9 | Translates the rendering context to the center of the player's face, parameters should be passed from {@link #render(PlayerEntityModel, AbstractClientPlayerEntity, float, float)} | public class ModRenderers
@OnlyIn(Dist.CLIENT)
public static class InvisibleEntityRenderer<T extends Entity> extends EntityRenderer<T>
protected void func_225629_a_(T p_225629_1_, String p_225629_2_, MatrixStack p_225629_3_, IRenderTypeBuffer p_225629_4_, int p_225629_5_)
{} | 0 |
8a084aa92109e0afccb19436983b6510 | 2cdaa3e8ad2299a4167637e0e98c3c8a | Helper function to create S3 object (see sqshelper.php) | {
$s3Client = new S3Client([
'version' => 'latest',
'region' => 'eu-west-3'
]);
return $s3Client->getObject([
'Bucket' => $bucketName,
'Key' => $name
]);
} | 0 |
e3a6822dddb1ad8a879f524f214f4ff5 | 1789101a377bf891c868c1302c62fdb4 | PropertyChanging event handler of the target control | {
if (PropertyChanging != null)
{
PropertyChanging(this, new PropertyChangingEventArgs(propertyDate));
}
} | 1 |
30cad74649f84fe7b1e8c27758af07ab | 42ba74cab21a2d7806b415d6986ff328 | Train the Maximum Entropy Classifier on the train sentences. | class ECMEstimate(EMEstimate):
def train(self, vectors):
vectors = numpy.array(vectors)
y = self._fit_transform_vectors(vectors)
if isinstance(self.init, (list, numpy.ndarray)):
try:
self._m = numpy.array(
[self.m[cl][f]
for cl... | 0 |
1144144e35a7a7f03ebfc19b80e6e083 | a012212548d4e3ce97a3999bc2cb600d | check for unknown lambdas | int containsLambda(CCinfoPtr cc){
return (cc->defs[0] & 0x00000001);
} | 0 |
387859d12f245c7d6d0a6abdf60b0eb9 | 6109ab6afd58e957d9f79ad59f15d1c7 | Finishes the asynchronous execution of the PutAccessPointPolicy operation. | namespace Amazon.S3Control
GetAccessPointPolicyResponse EndGetAccessPointPolicy(IAsyncResult asyncResult); | 0 |
7e61a7ef45497b7ba6c6a8dfe9a6b704 | fa3d6c6a1e15b357ca17feba2ed7081b | saves a huff file to the filesystem at the given path | ifstream* inputFileStream = openInputFile(inputFileName);
char ch;
vector<bool> buffer;
while (inputFileStream->get(ch)) {
vector<bool> code = (*huffmanTable)[ch];
for (vector<bool>::iterator it = code.begin(); it != code.end(); it++)
buffer.push_back(*it);
}
closeFil... | 1 |
d1d10f99b5dcbf2af31acf2795ed8ec7 | b588778295f802ed30081efbb54dcb54 | 将一组set对象转化为set的json串 | {
StringBuilder sb = new StringBuilder();
foreach (T item in objList)
{
sb.Append(ObjectToJson(item) + ";");
}
return sb.ToString();
} | 0 |
c1b1cbdacab341a9c05ba47bc01c3a30 | 6b4838d9ca7a35e810b6286245b90792 | 월마감배치 대상 저축계정 목록 | public class StatementOfAccoutnsBiz
public LMultiData RetrieveIssueClosingList(LData inputData) throws LException {
LLog.debug.write("RetrieveIssueClosingList 결산모니터 출고내역조-----------> Start ");
LCommonDao dao = new LCommonDao();
try{
return dao.executeQuery("fi/ar/statementOfAccountsSql/RetrieveIs... | 0 |
459395ffe2b53960f321f598dca089e6 | 7fef44d1c85fc3896dcd886596a8a05f | Function to start LETIMER counting | TIMSK0 |= _BV(TOIE0);
TCNT0 = 256-TIMERCOUNT;
TCCR0B = _BV(CS01);
} | 0 |
d4d399401e92c3d3000394bff186fde7 | 391f677f1ff0869f5c3bb2c7928847e3 | Расчет псевдокритической температуры газа | fun S_T(S_Tref: Double, Q_Tref: Double, Q_T: Double, E2shtreha: Double, T: Double, v: Double) =
S_Tref * (Q_Tref / Q_T) * (exp(-C2 * E2shtreha / T) / exp(-C2 * E2shtreha / T_REF)) * ((1 - exp(-C2 * v / T)) / (1 - exp(-C2 * v / T_REF))) | 0 |
dfb7f9414c7ed825b687bda403b4ed49 | 60abd84fa81a5b07e6e7d29bd7c2b9ef | Show/Hide the PRBrainCheck box | if(option.value == "XB"){
document.getElementById('XB').style.display='block';
}
else {
document.getElementById('XB').style.display='none';
}
} | 0 |
d2f4231f07866ba88d331b97d91ae98e | 607697e0a7489fea59615d2741629573 | query all messages for a specific campground for detail-tab.php page | $mysql_query = "SELECT * FROM campsite WHERE campID = :campID;";
$db = new DB();
$db->connectDB();
$prepared = $db->prepare($mysql_query);
$prepared->execute(array(':campID' => $id));
$data = $prepared->fetch();
$owner = new User();
$owner = $owner->getUse... | 0 |
a03a19ff2f0ea25d6db56fb0c2b3e7cf | ce4017b9d4304678ddd7fe38bacf00f9 | Gets all Device Levels for a store | public List<CustomerStoreLevelModel> getStoreLevelModelList(String storeUuid); | 0 |
0bffe55e806bd4526a23e4707b49c328 | d7beeb73682358da88ee0f361a3612d0 | try to read a non existing comment | class CommentTest(BaseTest):
def test_comment_on_non_existing_article(self):
self.create_article()
response = self.comment_on_non_existing_article()
self.assertEqual(response.status_code, 400) | 0 |
0e91eec0db0d385ab3e3fdfc8dc38d8f | 0eed8b3dd2b86429275555cac15245af | Gets the list of LayawaySummaryEntryIfcs. | public class LayawayCargo extends AbstractFinancialCargo implements LayawayCargoIfc, FindLayawayCargoIfc,
LayawayPaymentCargoIfc, RetailTransactionCargoIfc
public LayawaySummaryEntryIfc[] getLayawaySummaryEntryList()
{
return layawaySummaryEntryList;
} | 1 |
4775a804e71a85d4afa096e109e9964a | 7c80d5b37467a2a5eeff856e3d28a573 | Disparo aleatorio de un alien | class Invaders:
def shoot(self):
rand_alien = choice(self.alien_list)
self.attack = True
sos_pos = rand_alien.pos()
self.missile_list.append(Turtle())
self.missile_list[-1].penup()
self.missile_list[-1].hideturtle()
self.missile_list[-1].setpos(sos_pos)
se... | 1 |
ae71e6eac7461924cb31aef952f6298c | 78ce2e1d2f23a77147d77879de5802f9 | Adds new connection id to connection list by key | class ConnectionsStorage():
class __Storage:
def append(self, c, cid):
self.no_auth[cid] = c | 1 |
3ff897022c03eff20e1353e843d8c298 | eda795d9b7cf3f3968011d66d6dee816 | Gets the user group model object. | $model = UserGroup::model()->findByPk($id);
if ($model === null)
throw new CHttpException(404, Yii::t('Common', 'requested_page_does_not_exist'));
return $model;
} | 1 |
9cf9ac07570dd3fbda425fc5dff17139 | 05f0c1c2449d7844423fc3fdf443609d | 供应商沟通记录列表-导出 | {
$supplier_title = input('supplier_title', '');
$supplier_name = input('supplier_name', '');
$supplier_phone = input('supplier_phone', '');
$this->assign('supplier_title', $supplier_title);
$this->assign('supplier_name', $supplier_name);
$this->assign('supplier_phone... | 0 |
da83460439a6f4e78ede427c4e052e74 | 6e0bf08baabeb79258443715f7582e85 | Problem: Find the pair of pentagonal numbers, Pj and Pk, for which their
sum and difference are pentagonal and D = |Pk − Pj| is minimised; what is the value of D?
This may be one of the most difficult out of the first 50 problems. The main issue is that
the result is fairly large, and can take quite a long time even wi... | a = []
for i in range(2, 100):
flag = 0
for j in range(2, i // 2 + 1):
if (i % j == 0):
flag = 1
break
if flag == 0:
a.append(i)
min = 1000
result_pair = ((), ())
for i in range(1, len(a)):
pairs = split(a, i)
... | 0 |
d12307b59acca9d5e5b0ac653bbfbb3e | a7a575b65e8fdd1414e5ee36e12bb2d8 | Format: 00001, 00011 & so on .. | unless (/^[01]+$/.match(s))
return false
end
return /^[0]+$/.match(s) || /00$/.match(s)
end | 0 |
cc8b2ee2b1f70c4e398bc17a72460dc5 | b166cf796f37184868c657a8932f967f | Retrieve a Summary of Affiliate Statistics
Retrieves a summary of statistics for a list of affiliates. | public class AffiliateSummaryService extends BaseService<AffiliateSummary>
@SuppressWarnings("unchecked")
public List<AffiliateSummary> findSummaryList(Date dateBegin, Date dateEnd, String summaryType, String orderName, String orderType, int currentPage, int rowsPerPage) {
StringBuffer sb = new StringBuffer... | 1 |
473134283d61962ea922a0b8a9d85db7 | e1ef80a4d89d60854c8a8083d2d82181 | Test that delimiters included in the values of text transforms are
correctly quoted. | {
$pattern = Pattern::format('%%:%e%w:%c', [
'%%' => '%',
'%e' => '\\/',
'%w' => '\s*',
'%c' => '.',
], 's');
$delimited = $pattern->delimited();
$this->assertSame('#%\:\\/\s*\:.#s', $delimited);
} | 1 |
9cadb1779c98013e8f3cd0cf0c2b546e | 80c118424f334ef233d5306bbf2f29cf | Any translation in the set. Normally there will be exactly one,
but in any case, we don't have any basis to prefer any particular
item over any other, so just pick one. | class TestPO2CSV:
def singleelement(self, storage):
assert headerless_len(storage.units) == 1
return first_translatable(storage) | 1 |
5670564363ff0f304d2e7d90b2eee831 | 7c016090d4112d0284cdf105068a733a | Returns the maintenance general status and all its maintenace type statuses.
@TODO: Optimize this method. | class UtilMaintenanceApi
def get_maintenance_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: UtilMaintenanceApi.get_maintenance ..."
end
local_var_path = "/maintenance"
query_params = {}
header_params = {}
header_params[... | 1 |
d6a00023d6aa3b01b253e0867f6d5db3 | 36deb989dde7abf52effa901e13ff3d0 | Displays the firewall status. | print("There are {} FWs".format(len(self._fwDict)))
for value in self._fwDict.values():
print(" | ".join(value.sharedState)) | 1 |
1fdde6833293a04fefba5fdd4bdae344 | 9f20d93e6926538a1059373555318713 | The indexed dataframe. | def df():
return pd.read_csv('examples/data/ogm.csv', index_col=0) | 1 |
4006b94e688aaf880bac3c485e4f3ba6 | f3e55c2da5e948ffd071ecaaeea10c9c | Returns the current time in a format that's compatible with directory name character rules. | def timepath(sep='_'):
return timestamp('%Y%m%d{sep}%H%M%S'.format(sep=sep)) | 1 |
b6b86a44ab9182f66a1d081986803e75 | 66d1dc268ed9dcde810d4a91b5e82171 | 12. Из двух отсортированных массивов сделать третий отсортированный, не сортируя его. | three: list[int] = []
a: int = 0
b: int = 0
while a < len(one):
three.append(one[a])
a += 1
while b < len(two):
three.append(two[b])
b += 1
return three | 0 |
886125b5c44bc8fc156af87fc5005375 | 8f09e02a5e5da07bed47f59bbfb074eb | Checks whether dbhost is set correctly | class dbo_pgsql extends dbo
public function connectToHostDb()
{
$this->setDb('host');
$this->connect();
if ($this->dbconnect) {
return;
}
$this->setDb('postgres');
$this->connect();
if (!$this->dbconnect) {
echo "Error connecting to hos... | 0 |
b3b8dcd0adbff3f87d193cee9338ceb2 | 68b732be8c0e2052703da78762c4cbf7 | ==========================================
Mouse Parallax
========================================== | function parallaxLoop() {
if ( isScrolling ) {
transformElementY( parallaxContainer, -1 * getScrollPosition() / 2 );
isScrolling = false;
}
if ( wheelIsScrolling ) {
window.scrollBy( 0, -mouseDelta * 10 );
wheelCount++;
if ( wheelCount > 20 ) {
wheelCount = 0;
wheelIsScrolling = fa... | 1 |
36b518456f2acd50ed5f8cf529a9a665 | 98e3b936edaa686bccd4956460a741ad | Makes the rule apply to any traffic destination address. | namespace Microsoft.Azure.Management.Network.Fluent.NetworkSecurityRule.UpdateDefinition
Microsoft.Azure.Management.Network.Fluent.NetworkSecurityRule.UpdateDefinition.IWithDestinationPort<ParentT> ToAnyAddress(); | 1 |
025228703fde69dcf3e08e18790d8afd | 55a5c6ea420c464bd3ec4d5d2e6e999e | Gets all the quoted triples with a given subject and predicate from a specific graph of the dataset. | {
if (_store.HasGraph(graphName))
{
return _store[graphName].GetTriplesWithPredicateObject(pred, obj);
}
else
{
return Enumerable.Empty<Triple>();
}
} | 0 |
5507c5e6ffca1dc20344c36dda980a13 | 5cb37f410f57d045ecdfd8b990e9a346 | Test the property 'ProductSku' | {
if ($action == self::ACTION_ADD) {
if (!$this->_objectManager->create('Magento\Catalog\Model\Product')->isProductsHasSku($productIds)) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Please make sure to define SKU values for all processed products.')
);
}
}
} | 0 |
01d8b0d97c6935bb66d821df408abb27 | 568bb0570b7083e3573e7f355d4fbb27 | Get the 'LastFillDate' element value. | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LT_Asset__c", propOrder = {
"accessCodeC",
"accountExecutiveC",
"accountExecutiveR",
"accountC",
"accountR",
"activityHistories",
"additionalTeamMemberSC",
"addressC",
"adminLoginPasswordC",
"adminPasswordC",
"adminUserna... | 0 |
f196410585167d3f4ab6f3a305d700fe | eb301f59466383c305a73388de0b89d8 | returns all the spaces on the board that are occupied | positions = []
for i, _ in enumerate(self._board):
for j, _ in enumerate(self._board[i]):
if self._board[i][j] == " ":
positions.append((i, j))
return positions | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.