query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
8eb5495996a7258f1bab8d5650ae56b1 | ad5162ad968ba8f21b633deccbfed005 | Returns the file with the given id or None. | class XmlStore(object):
def get(self, id):
filenum = self.idmap[id]
tree = self._get_tree(filenum)
return tree.get(id) | 0 |
4e78e991467a3bbefff75623aa2c8d54 | 3fb6789d3e6980ffae036a883965e019 | Update a package entity with information from Composer. | class InstallerInstaller extends LibraryInstaller
public function update(PackageInterface $initial, PackageInterface $target)
{
$extra = $target->getExtra();
if (empty($extra['class'])) {
throw new \UnexpectedValueException('Error while installing '.$target->getPrettyName().', composer-i... | 1 |
ad826de06ac34702de76d9586b8b9c22 | b384e388afddbedb08df96dec6e119b9 | show dialog to select configuration file | namespace ElectionAuthority
public partial class Form1 : Form
private void configButton_Click(object sender, EventArgs e)
{
openFileDialog.ShowDialog();
} | 1 |
1b252b8f0ec0f3c5d0ced89fc3a15ec9 | 8deff80fe223b447104f5819bbec1516 | Fill in the IP Header | bzero(dstaddr,sizeof(struct sockaddr_in));
ip_header->ip_v=IPVERSION;
ip_header->ip_hl=sizeof(struct ip)>>2;
ip_header->ip_tos=0;
ip_header->ip_len=htons(iplen);
ip_header->ip_id=0;
ip_header->ip_off=0;
ip_header->ip_ttl=MAXTTL;
ip_header->ip_sum=0;
if(type == UDPTYPE)
ip_header->ip_p=IPPROTO_UDP;
ip_hea... | 1 |
8a1786c342ad318c5fa8d99b8267fe68 | acd6eb85d6b5ac3861a42dfe2bb2bf92 | 计算IC值
即,在rebalance day计算因子值,计算当前因子值和下一期股票收益的相关性 | common_index = factor.index.intersection(forward_return.index)
ic_data = pd.DataFrame(index=common_index, columns=['IC','pValue'])
for dt in ic_data.index:
tmp_factor = factor.ix[dt]
tmp_ret = forward_return.ix[dt]
cor = pd.DataFrame(tmp_factor)
ret = pd.DataFrame(tmp_ret)
... | 1 |
d795668f040125c008956dcb225c1372 | 86a560ddb52acad8613ee58125a0c1ae | Get all marks from one grade_scale | public class AppMain
@SuppressWarnings("unchecked")
private static List<Integer> getAllMarks(String courseName) {
EntityManager em = factory.createEntityManager();
try {
em.getTransaction().begin();
Query q = em.createQuery("select sc.mark "
+ "from TblStu... | 0 |
8511959230da4bb616024392a17b86a4 | 263ef104eea65da0d805f21e356126a3 | 定位默认的定投日期 | class BaseController extends BaseAdminController
public function getFixedDate($jys, $day, $month = false, $year = false) {
if(!$year) $year = date('Y');
if(!$month) $month = date('m');
$date = date('Ym', strtotime($year.'-'.$month));
$sql = "select EXCHANGE_TYPE,INIT_DATE from dcuser.tfu... | 1 |
71e6e4d2dba3d0c540d241f20130d7d7 | 19ee429b73376573548b14df9873f4f9 | Définition d'une fonction qui augmente le nombre d'élèves jusqu'à un nombre max | bool in(){
if(this->pass >= this->passMax){
cout << "fail : limite de passageiros atingido" << endl;
return false;
}
this->pass += 1;
return true;
} | 1 |
6ba975e4368a5ab7a37055e999721bf5 | 285ea3f71a933600ec3dc21c8af47562 | Writes the secret key into the provided output stream. | namespace org.bouncycastle.pqc.crypto.ntru
public class NTRUSigningPrivateKeyParameters : AsymmetricKeyParameter
public virtual void writeTo(OutputStream os)
{
os.write(getEncoded());
} | 1 |
545ad7af9a4a2e69e41012d429a07cba | 679779b3294da4863d7ffbb4fa2e17bd | 用人脸检索接口导出历史纪录列表 | def test_07():
res = dongTaiBuKong().api_v1_face_record_search_list(
reqId=get_uuid(),
pageSize=10,
pageIndex=1,
isStranger=1,
)
printRes(res) | 1 |
fbcb29f63bf057b4bae94863ff6b981a | df02d697899949aae8d89f7c26ec0f0c | 显示系统信息下拉列表 | namespace Leya.ViewModels.Main
public class MainWindowVM : BaseModel, IMainWindowVM
private void ShowSystemOptions()
{
IsSystemOptionVisible = true;
appOptions.OptionsSystem.GetSystemOptions();
} | 1 |
1663faf8bfebfdb5de2e05b28c8e88f3 | 069c49964b18cbb441e63caa85c86f40 | Free an ipcon handler created by ipcon_create_handler(). | {
int rc = -1;
icore_msg_t *msg;
aef_icore_free_t *inp;
struct aef_icore_ap_priv *priv;
CHECK_PARAM(hdl, -1);
priv = hdl->priv;
msg = icore_msg_new(ICORE_CMD_AEF_FREE, sizeof(aef_icore_free_t));
CHECK_RET_TAG_WITH_RET(msg, -1);
inp = icore_get_msg(msg, aef_icore_free_t);
inp->ae... | 1 |
06d953dee4f048967c1fe30c37e59da5 | c3a8986dad06f55aab219a39c434b2d2 | Whether the rail type controls minecarts horizontally only | public abstract class RailLogic
public boolean isSloped() {
return false;
} | 1 |
929031ddfcd681fc096452ba77d0e1c9 | 67433ab7b4718bfc34536371947e0a7a | Asserts the expectedFiles set does not contain the specified files. | public class MockDirectoryBuilderTest extends TestCase
private void assertNotExpected(String... fileNames) {
for (String name : fileNames) {
for (MockReadonlyFile file : builder.getExpected()) {
assertFalse(name, file.getPath().equals(name));
}
}
} | 1 |
e60dd7677c1fd6728fe721e7fb145ce6 | 3181f9d9c0577a6b2fb2d93c1419f8f1 | Search for the given restaurant and go to the restaurant page | public String show(@ModelAttribute RestaurantSearchForm form, Model model) {
return "harasan/restaurantSearch";
} | 0 |
d965c8acdeea44bba97b175c3e8e5565 | dda1162c714f18c8e3112e9e35b65485 | 0:表示按原图默认方向,不进行自动旋转
1:表示根据图片的旋转参数,对图片进行自动旋转,如果存在缩略参数,是先进行缩略,再进行旋转。 | public class ImageTools
public static String rotate(File file,int rotate,String targetPath) throws IOException {
try {
String filename = file.getName();
String endTag = filename.substring(filename.lastIndexOf(".")+1);
String path = "";
if(rotate<0){
path = targetPath+"/"+filename+"_"+"-"+rotate+"."+en... | 0 |
239b09e3fd63bcf571833ac0eb42bb09 | d31269047915f7933956ff04cb47eed1 | 将数据放入对应的缓存块中,并且数据永不过期 | public class ZboxCacheUtil
public static boolean put(String key, Object value)
throws TimeoutException, InterruptedException, MemcachedException {
return set(DEFAULT_NAMESPACE, key, value, 0);
} | 1 |
b44d2b24e59b6e85f703a6b963a5e0d9 | d7490305205fb2d4dc94dc57b4a6fad3 | Avgj�r om stabelen er tom. | public class AvgArrayTest{
@Test
public void testAvgEmptyCollection(){
assertEquals(emptyMap(), AggregateUtil.avg(toList(), ConvertUtil.toArray("id", "age"), 2));
} | 1 |
6bcdb2de572c82be8ac489e82dcb1738 | bb3136cf69e229a41f03874b564c69a2 | Get the deck slot the labware is in, if on deck. | int getSlot(); | 1 |
24231e6fe67970fae029a95c889b1a22 | 9ced0528dcf7acf7fac3b03112898118 | Obtiene las fotos de un usuario especificado por su user-id de Instagram | {
VimeoOpenApi.Client.ApiResponse<List<Picture>> localVarResponse = await GetPicturesAsyncWithHttpInfo(userId, page, perPage);
return localVarResponse.Data;
} | 0 |
27bd8acae26fafa537ed69e9864f5af1 | 70b439b0db153d04778a1bd4f8ee6817 | Return a random email address ending in dbca.wa.gov.au | class APITestSetup(APITestCase):
def random_email(self):
s = ''.join(random.choice(string.ascii_letters) for i in range(80))
return '{}@dbca.wa.gov.au'.format(s) | 1 |
5bb9e1200f9d0c30c2a9b21fa5ac97bf | d4f40167304811fea91eaa371ea67517 | 判断添加学生基本信息确认记录,有记录则只修改 | {
$res=db("student")->where("sno",$student["sno"])->select();
if($res)
{
foreach ($res as $row) {
if($row['name']==$student["name"])
{
return true;
}
}
}
return db("student")->insert($student);
} | 0 |
3bbd59771fbb232c381f9c761d1316ef | bbef455536c196c2be61755829d3864a | função que imprime os tiros do jogador | void imprime_jogador(ESTADO e) {
IMAGEM(e.jog.x, e.jog.y, ESCALA, "demigod_m.png");
IMAGEM(e.jog.x, e.jog.y, ESCALA, "leg_armor00.png");
IMAGEM(e.jog.x, e.jog.y, ESCALA, "dragonarm_brown.png");
IMAGEM(e.jog.x, e.jog.y, ESCALA, "heavy_sword.png");
imprime_acoes(e);
} | 0 |
3e8130d574b0930c0d6b10596785dc0c | b7409268d8437dbd0e727be3e66c4d1e | Generate a session-specific ECDH P-256 key for Diffie-Hellman with the
platform (Used for PIN but we only ever do it for hmac-secret) | class KeyPair(object):
def session_key(self, public_B):
raw_secret = gmp.powmod(
public_B.to_mpz(),
self._secret_key,
self._dh_p
)
h_256 = SHA256.new()
h_256.update(raw_secret.digits(10))
raw_key = h_256.digest()
return Buffer(raw_key) | 0 |
b9025002d3ae07cbe560f6fc9298a66f | 7cf6b98248bb7e7e0ce43e1f76a82b60 | Sets the active exercise for the exercise modal | namespace PhysControl.Views
public partial class NewTraining : ContentPage
private async void AddExercise_OnClicked(object sender, EventArgs e)
{
await Navigation.PushModalAsync(new Exercise(), false);
} | 0 |
a6535ffebd882074e3a608ea7a61a291 | 03651749b05905fd353e88d20cc09b65 | Callback to let the repeater know it should populate itself with its items. | class Opf_Repeater extends Opf_Item
public function setValue($value)
{
} | 0 |
006e88dbc7b165aa7665093e75064b63 | 2c60a0613a8e47be30acae81ccf8160a | Template of the Authenticator. Fill in values for your twitter API access. | class Gitslackauthorizer(BotPlugin):
def get_configuration_template(self):
return {
'GITHUB_ADMINS': ["@manvendra.singh"],
'GITHUB_ACCESS_TOKEN': "0x****************0x",
} | 0 |
a18d1f6aa14ad10314dfcad118686e82 | a9af39c8efbe9f2586c9891f5174d824 | Adds quesitons to a particular quiz | public class QuizDBConnection extends DBConnection public class Quiz
public void addQuestion(String question_id) throws SQLException{
question_ids.add(question_id);
String questions = arrayToString(this.question_ids);
setAttribute(this.quiz_id, QUESTIONS, questions);
} | 1 |
00823f023a9d97c77efd073f609dc33f | 8567d60e32df7f8d1917c45d9e1a5893 | 获取有无学生变更授权人 | public class SlpdSellerCommodity extends BaseEntity
public String getAuditStu() {
return auditStu;
} | 0 |
04224fb2dc9eaffe80d56923f4e51ad2 | dcf45e8a86ddc8a8268c7977161ec16a | Called by a node when it joins the DHT | if not self.entry_address:
self.successor = ["", self.port, self.ring_position]
self.predecessor = ["", self.port, self.ring_position]
username_key = int(hashlib.sha1(self.username.encode("utf-8")).hexdigest(), 16) % SIZE
print("join() : Speichere eigenen username... | 1 |
6b7dbe73af8c36ad46ce07881bde167f | 2a3be2df71c3f88c9d62a5119a939899 | start battle using wild program and player party | public class BattlePrep : MonoBehaviour
public void StartBattle()
{
if (battlingParty.Count == 0) return;
bm.InstantiatePlayerParty(battlingParty);
bm.SetState("NORMAL");
gameObject.SetActive(false);
} | 1 |
0c1f3b71028ede6ab66c25865eed547a | 8b7bc6564d683da29096e67323d37486 | Replace protocol (gs://, s3://) with proper google cloud / s3 URL | class GoogleSession
def googlesheets_url(file_id)
if file_id.starts_with?("https://docs.google.com")
return file_id
else
return "https://docs.google.com/spreadsheets/d/" + file_id
end
end | 0 |
4fd18b71b5a5ac11d28ed09776b5135a | 4e05eb4a75dc26fc5a3b94332d922199 | 自行选择一种调度算法, 完成进程优先级排序; FIFO、时间片轮转调度、高优先级、短作业优先、高响应比优先算法等 | {
switch(userScheduleChoice)
{
case 1:
{
SJF();
resetSchedulers();
break;
}
case 2:
{
FIFO();
resetSchedulers();
break;
}
case 3:
{
STCF();
resetSchedulers();
... | 1 |
73dd40a27b67b3a6c6c58f962984656a | bc9a04601fa9d44d1f89edf2024c6844 | Grabs an unused file descriptor. | class TunnelDeviceTestsMixin(object):
def _invalidFileDescriptor(self):
fd = self.system.open(b"/dev/net/tun", os.O_RDWR)
self.system.close(fd)
return fd | 0 |
4cb67d24af1677c4bd93b8213b524602 | f411d7c103fe6a2ed606e63c6e99c704 | Test that result of a given amount of damage dealt is correct | a = entity.Combatant(50, 20, 20, 10)
d = entity.Combatant(40, 20, 20, 10, armor=10)
w = WeaponMock(50, 20)
assert 25 < a.calculate_damage(w, d) < 26 | 1 |
76bb2fdb6a88f959f6e2d9ba69a16486 | 71453688c4704af3a6a5878861085316 | Deletes a Folder from LucidChart | namespace SimScale.Sdk.Api
public partial class FoldersApi : IFoldersApi
public void DeleteFolder (Guid? spaceId = default(Guid?), Guid? folderId = default(Guid?))
{
DeleteFolderWithHttpInfo(spaceId, folderId);
} | 0 |
f9fe10a4b1cf33a34c30493c8769e528 | bbf7ba066b9ac83b038fe49fbd24103d | Convert text into ASCII string. Useful resource:
http://www.peterbe.com/plog/unicode-to-ascii | def make_ascii(s):
return "".join(i for i in s if ord(i) < 128) | 1 |
05eba770325474e73a765938b25f6cc2 | 3df2f2bb5a67f9af0f650104b8e36047 | Add a state to this machine specifying the execute functions | class Machine implements Iterator
public function addStates(array $states)
{
foreach($states as $state){
$this->addState($state);
}
return $this;
} | 0 |
501946b7d9871b1bd58eed5ff1f553ae | 1880874d3705387a9e781a364ae5e171 | re-run the current level | Globals.Instance.stop();
currentLevel++;
var gameDiv = document.getElementById("gameDiv");
gameDiv.removeChild(document.getElementById("canvas"));
document.getElementById("rcorners2").style.display = "none";
new Game().main();
} | 0 |
99f94b8951e4b834ca547a9cb2bfc20c | 5e100567f88f6bbd485eb5d9ddadf02c | Create and render a TaskListView with a Task List placeholder for a given element | function TaskList() {
} | 0 |
95e30f90c76b3b9e797ca4bfa4093cb8 | 6fc6d490c893654cbfd29b685f481e3d | Decoder is made of self-attn, src-attn, and feed forward. | class _DecoderLayer(nn.Module):
def __init__(self, parent: Decoder):
super().__init__()
self.attn_1 = mha.MultiHeadAttention(
parent.num_heads,
parent.dim_model,
parent.dim_keys,
parent.dim_values,
parent.attention_dropout
... | 1 |
77c0912ef33eaac2f8b762c24f29d781 | 2931128c41800c1d1b5e027f8b0f8a9b | Estimate the smallest singular value | def sv_unreg(self):
return numpy.sqrt(numpy.linalg.eigvalsh(self.aa)) | 0 |
4687908b6baaae7607fd5c059428a06d | ee43ea162e4e5fb2590f5ec01ce27dd9 | Write delta phi widths to YAML. | class Correlations(analysis_objects.JetHReactionPlane):
def write_delta_phi_widths_to_YAML(self) -> None:
self._write_extracted_values_to_YAML(values = {
f"{self.identifier}_widths_delta_phi": self.widths_delta_phi,
}) | 1 |
9010cb5a5adc722c9dce37f3061be110 | a50da8729fa93b1d0fa57eb0dd985cb1 | If hide completed is checked, filter posts | export class AcademyListComponent implements OnInit, OnDestroy
toggleCompleted(change: MatSlideToggleChange): void
{
this.filters.hideCompleted$.next(change.checked);
} | 1 |
589b34c21ea87aa869908deeaf92c5c6 | 02e18996e3717cb868d654af7f20ef4c | 删除所有资源类型为resourceType的数据 | public void deleteByType(int toType); | 1 |
edea2ec69da5adb1a6fb85c2bd91c746 | cd92837e007d035ec72e18c070e1c138 | Gets the patient and generic images. | imageDir, segDir, patient, disease = dirDiseaseTuple
image_np_orig = sitk.GetArrayFromImage(sitk.ReadImage(imageDir))
seg_np_orig = sitk.GetArrayFromImage(sitk.ReadImage(segDir))
return image_np_orig, seg_np_orig, patient, disease | 1 |
8661a5ca7c61d12ca83f499f7123695b | 60cd8efd92d7568847567a07822d1ca8 | this method helps to create a table that is usable by graph engines like Google Charts | chart_table=""
for row in rows[:-1]:
rowstr="['{0}', {1}],\n".format(str(row[0]),str(row[1]))
chart_table+=rowstr
row=rows[-1]
rowstr="['{0}', {1}]\n".format(str(row[0]),str(row[1]))
chart_table+=rowstr
return chart_table | 1 |
b39168c1ffa0f0ce0fb168487e97b2f5 | ea880dbe9964cfc31d7436319a67638c | higher-order contribution for a given RC pair, when scoring a partial conf | {
int p = pr.first,q = pr.second;
int_list_t & pcontrib = contrib_map[p];
BOOST_FOREACH(int qa, msc->m_conn[odir][q])
{
if(msc->is_not_paired(qa))
{
pcontrib.push_back(qa);
}
else if(msc->index(q) == msc->index(msc->pair_idx(qa)))
{
BOOST_FOREACH(int qaqa,... | 1 |
bd0a29253659ec760ae886562725fd4f | f96792b9d3e4ad73a255b5bdc4df3aee | 清空指定设备的中断服务程序列表 | namespace Upper
public class WindowsAPI
[DllImport("setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern Boolean SetupDiDestroyDeviceInfoList(IntPtr deviceInfoSet); | 0 |
8766bb1ed93a5a2646810dd379f2680e | 48b68b7a73c4ee6291e0c7ee778f1fcb | Getter for <code>performance_schema.table_io_waits_summary_by_table.OBJECT_SCHEMA</code>. | @javax.annotation.Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.5.4"
},
comments = "This class is generated by jOOQ"
)
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class EventsWaitsCurrentRecord extends org.jooq.impl.TableRecordImpl<com.davidm.mykindlenews.generated.jooq.p... | 0 |
5b8b26b16f4f218100cfe1b4a771b2b8 | 1058bce43eaa76a4910fed565db09e7d | Reprojects a depth point to a 3D vertex given the image x, y coordinates and depth z. | fx, fy, cx, cy = tf.split(kv, [1, 1, 1, 1], axis=-1)
ndim = len(X.get_shape().as_list())
fx = tf.reshape(fx, [-1]+[1]*(ndim-2))
fy = tf.reshape(fy, [-1]+[1]*(ndim-2))
cx = tf.reshape(cx, [-1]+[1]*(ndim-2))
cy = tf.reshape(cy, [-1]+[1]*(ndim-2))
z = X[...,2]
too_close = tf.abs(z) < min_de... | 0 |
98135784d00d4a9348e4b5e1af42a0c7 | c6a7bebb6b783e1a4df7d11db63f1526 | CHECKED, matches with sklearn | if metric is None:
metric = sklearn.metrics.accuracy_score
C = len(np.unique(y))
K = min(K, len(X))
scores = np.zeros((K, C))
for k, tup in enumerate(sklearn.model_selection.KFold(K, shuffle=shuffle).split(X)):
i_trn, i_tst = tup
classifier.fit(X[i_trn], y[i_trn])
y_tst = y[i_tst]
y_pred = classifier.... | 1 |
b52e135af483212dd1be37314ac2cc98 | eada89c1eb8d4c2f00ca73c0ab60d6a3 | Destroy per ethernet device VLAN VM workaround context | void free_vlan_config(esp_netif_config_t *vlan_eth_cfg)
{
if ((NULL != vlan_eth_cfg) && (NULL != vlan_eth_cfg->base)) {
free((void *)(vlan_eth_cfg->base->if_key));
free((void *)(vlan_eth_cfg->base));
}
} | 1 |
e83e9852ac7b8aeb5c20156388ae702f | c6205ca6b52c5060b9ebb2a3197aee62 | 获取机构与产品的对应关系 | namespace LWLCX.Erds.Server.EntityManager
internal class GroupMemberCallbacker : IDisposable
private void GetOrganizationRelationship(ISubItem entity, IList<ISubItem> relationship)
{
} | 0 |
ec8b439d4ebea11a2d69c9f25067a6a2 | 21d39018c693fc1e3a516f844a557665 | 检查收款账户是否设置 | function payAccountRequired() {
return !!collectionType[$("#collectionType").val()];
} | 1 |
efa61224ab8ea55779ef5faedf5e5550 | d8b2d4edf9a7e1cfb5765322ad8b79a3 | SHP 파일 등에 포함되는 .prj 파일을 읽고 표준 proj4 string 포맷의 값으로 변환 & 저장한다.
GDAL package를 필요로 한다. | prj_file = open(self.prj_path, 'w')
prj_file.write(('GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",'
'SPHEROID["WGS_1984",6378137,298.257223563]],'
'PRIMEM["Greenwich",0],'
'UNIT["Degree",0.017453292519943295]]'
)... | 0 |
f3cc450e40bd14b249759f9da398c5de | 3427d8b419f60bebc5e5f9fea98fb281 | 确认状态列表有足够的长度可以使用目标索引,不够就新建在后面 | class ManualColumnMove extends BasePlugin
createPositionData(len) {
let positionArr = this.columnPositions;
if (positionArr.length < len) {
rangeEach(positionArr.length, len - 1, (i) => {
positionArr[i] = i;
});
}
} | 1 |
7cf75ff5bd3d346352b83f9a8e400217 | 1b82c0cfd7fa0fdfa87b1c837f0ddc6d | Update the cached revocation list | clear()
{
console.log("this.revoked[0].exp:",this.revoked[0].exp);
console.log("this.revoked[0]:",this.revoked[0]);
const new_timestamp = Math.floor(Date.now() / 1000);
this.revoked = this.revoked.filter(e =>
(new_timestamp < e.exp) );
} | 1 |
eba72e058939e7f6639a1bbbda6ac9c6 | 47a5bbd64a4299b08d05d9ac1f599d52 | method to create and swap to next file if current file is full | {
if(x ==1)
{
if(FullFlag == 0)
{
BackupIndex++;
if(BackupIndex > MaxLength)
{
BackupIndex = 1;
StartFile = BackupIndex + 1;
FullFlag = 1;
}
}
else
{
BackupIndex ++;
if(BackupIndex > MaxLength)
{
BackupIndex = 1;
}
StartFile = BackupIndex + 1;
if(StartFile > MaxL... | 1 |
264cb8b4e25976b2f86174765899a959 | ab813eb9b046a310905dfd528f7e9217 | Function that aggregate feature over the projection on the epipolar line. | def proj(R_est, t_est, R_gt, t_gt, K, pts):
proj_est = misc.project_pts(pts, K, R_est, t_est)
proj_gt = misc.project_pts(pts, K, R_gt, t_gt)
e = np.linalg.norm(proj_est - proj_gt, axis=1).mean()
return e | 0 |
ba818eb8dc8ecbd29e2c5d0bd5a09467 | 19e80e6b61d7081c610533e45ecfd36e | Define a function to calculate an inverted x co-ordinate. | def flipy(y):
return -y+screen_y | 0 |
a1e3dbbeb57e7f6d5192d4e84bcfc58f | f78a08d171ca2ed8e3e19887a8220cb1 | Unique columns for upserting a BlockDocument | {
return [
'updated_at',
'user',
'fileName',
'type',
'policy_no',
'name',
'previousValue',
'newValue',
'description',
];
} | 0 |
b4a3b37b057cb04562c86bb798a26428 | 7b3384dc7c311d1a9c5975b5e8539f26 | This method raises the Apply event | namespace FluidTrade.Guardian.Windows
public partial class WindowBasicUserProperties : Window
private void CanApply(object sender, CanExecuteRoutedEventArgs eventArgs)
{
eventArgs.CanExecute = this.canApply;
} | 0 |
9c420a948ec0ff9b3d170f1da9913122 | d14049ede9735309288c73adf3088a30 | CLRの予測が不能な場合のテスト | def test_not_fitted_error():
with pytest.raises(NotFittedError):
SingleROClassifier().predict(create_linear_X(), create_y()) | 1 |
0b9b55d6ddf6331ec3316e5ef9ae0662 | 0ed87fd8d26ad99d9d68ffee78a09ca7 | Set the buffering flags for original image data and its variants depending on the buffering
level selected. | public abstract class AnnotationImage extends Annotation
protected Map _prepareGraphics2D(Graphics2D g2d)
{
Map origSettings = super._prepareGraphics2D(g2d);
Object origInterpolation =
g2d.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
origSettings.put(_KEY_INTERPOLATION, origInterpolation);
Viewport.... | 0 |
a82a5e18411db33b6eaa8316516ce98c | 2820758bad9fbf4057d08e739d5dc034 | Returns the <code>id</code> value of this <code>Guess</code> object. | @Entity
@Component
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({"id", "href", "created", "guess", "inPlace", "outOfPlace", "game"})
public class Guess implements BaseGuess
@JsonProperty
@ApiModelProperty(value = "UUID of Guess instance", readOnly = true)
@Override
... | 1 |
9ec6cb7c852a4a50d2d2b5dae2541c7b | 82f92ca3c2ad7b95bef61be3a2334b0b | Constructor should validate arguments. | {
if (args is null)
throw new ArgumentNullException(nameof(args),
"Args object cannot be null. It needs to be assigned to an instantiated child object of Args.");
} | 1 |
fd9acbfd4193839f51707146a09aa805 | f472778662c9d6a66d2ad70d5de0cd07 | Adds a query to the sharded batch, returning it as an <see cref="IFutureValue{T}"/>. | {
if (container is null)
{
throw new ArgumentNullException(nameof(container));
}
if (queryText is null)
{
throw new ArgumentNullException(nameof(queryText));
}
if (actionAsync is null)
... | 0 |
10a2636f4489556f1b51e9383b889752 | 83f94ec74e6197f4cc734e0d6685caf0 | -------------------------------------------------------------------------
最も新しい로그파일명を得る
--------------------------------------------------------------------------- | {
FileInfo[] log_list = GetLogFiles();
if(log_list == null) return null;
if(log_list.Length <= 0) return null;
return log_list[log_list.Length - 1];
} | 1 |
a9a79fd66d0e39d129b4b8c45715ad6d | eae92d3db37de71c5ad8cdb2b3d69456 | 判斷莊家要不要牌 | public class Table
private void ask_dealer_about_hits() {
do {
hit = false;
hit = dealer.hit_me(this);
if (hit) {
dealerCard = new ArrayList<Card>();
dealerCard = dealer.getOneRoundCard();
dealerCard.add(allcard.getOneCard(true));
dealer.setOneRoundCard(dealerCard);
}
} while (hit);
... | 1 |
b9316a872e1b19d793e4b03046eddc55 | 3b1f2f3cc57b1d9a83f7d882de60d4b3 | 打印安全协议到word模板 | {
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->setDefaultFontName('仿宋');
$phpWord->setDefaultFontSize(12);
$section = $phpWord->createSection();
$styleTOC = ['tabLeader' => \PhpOffice\PhpWord\Style\TOC::TABLEADER_DOT];
$styleFont = ['spaceAfter' => 60, 'nam... | 0 |
0dec867aefe73eab6c3a11d2dea37986 | 41dc6efff75ed98606d748a7a7f1dcb8 | 取消团长身份 | class ManagerController extends BaseController
public function cancel() {
$memberId = I("mid",null);
if(empty($memberId)) {
$this->failed("mid不存在");
}
$transDb = new Model();
$transDb->startTrans();
$sql = "update manager set status=0 where gameid=" . $memberId;
$result... | 1 |
002ff22cd8c0258a67394f70da1e4e62 | 3cfb78afaf1b4029413e8347b526384a | <p>
Moves the specified instances out of the standby state.
</p>
<p>
After you put the instances back in service, the desired capacity is incremented.
</p>
<p>
For more information, see <a
href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html">Temporarily removing
instances from your Au... | def enter_standby(InstanceIds=None, AutoScalingGroupName=None, ShouldDecrementDesiredCapacity=None):
pass | 0 |
81b041d4219819446cb63002055765cf | 1335e937522c7b34cf588bbf6008b270 | テーブルのデータと入力値をマージ | {
this.AlertMessage = "";
tableInput.columnInput.Clear();
tableInput.tableName = "";
try
{
var targetTable = tables.FirstOrDefault(x => x.CDataTableName == e.Value.ToString());
if (targetTable == null)
{
... | 0 |
6332e263e61ef077a83cb3d3abb17e8e | 21cc67886c06eb8f9659b313dc87f631 | Shift right logic register r8
Bit 0 is copied to C flag and a 0 is put into bit 7 | func rl8(reg reg8) runnable {
return func(c *CPU) uint8 {
c.flags.N = false
c.flags.H = false
set, get := reg(c)
v := get()
res := (v << 1) & 0xFF
if c.flags.C {
res |= 1
}
c.flags.C = v&(1<<7) > 0
c.flags.Z = res == 0
set(res)
return 8
}
} | 0 |
6d349c606b464e61eb7b6d30f6fb0afa | 20e3b1fae9a8d63749587613d997c088 | 拆成01背包来做,按二进制去拆
第i个物品最多选s个, 可以表示为 i个物品选1个、2个、4个、8个、16个直到小于s的2的幂次
基于这种思想去把多件物品转换为,多种一件物品
由此转换成0 1背包问题。 | public class Solution
public int subsetSum(int[] nums,int s){
int[] dp = new int[s+1];
dp[0] = 1;
for(int num :nums){
for(int i =s;i>=num;i--){
dp[i] +=dp[i-num];
}
}
return dp[s];
} | 0 |
0a15964a02746d04b76392e13437e380 | 024e53ef4c83e55bab45d90495bad966 | Disconnect from the POP mail server | namespace MailKit.Net.Pop3 class Pop3Engine
public void Disconnect ()
{
State = Pop3EngineState.Connection;
if (stream != null) {
stream.Dispose ();
stream = null;
}
} | 1 |
b546d36b51f0b027196322c22c3991d0 | 634d859c37f4a43fae51b2bafd077457 | Returns the time series query. | TimeSeriesId timeSeriesId,
TimeSpan timeSpan,
DateTimeOffset? endTime = null,
QuerySeriesRequestOptions options = null,
CancellationToken cancellationToken = default)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(... | 1 |
296313719d7031b8ebca5add20c99fd2 | 69c3efc9b1eaf57352e8af42aeaa9810 | Failure test for {@link LookupServiceBean#searchCompaniesByName(String)}. | public class CompanySearchBuilderUnitTest extends TestCase
public void testHasCompanyName_Accuracy3() throws Exception {
builder.hasCompanyName("companyName");
Company[] ret = dao.search(builder.buildFilter());
UnitTestHelper.assertEquals(this.companies, ret);
} | 0 |
66c807b8862bf007647d75db4c39bc0d | f70d0a104f54bd086870fde569801aad | Gets this player's walk speed | {
for (TActorIterator<ATempPlayer> ActorItr(GetWorld()); ActorItr; ++ActorItr)
{
return ActorItr->GetCurrentSpeed();
}
return 25;
} | 0 |
ed326f17786eb234211ba95d502ccc95 | 4e98269bd39811da5d17b00f1efd6609 | 根据openId获取车辆列表 | String hql="from Movecar where userByCar.weixinUser.openid = ? order by time desc";
List<Movecar> list = hqlDAO.findByHQL(hql, openid);
JsonConfig config=new JsonConfig();
net.sf.json.JSONObject object = new net.sf.json.JSONObject();
JsonFilter.ignoredSet(config);
String json=JSONArray.fromObject(list, conf... | 1 |
a203d8b38e904d05152bb7e799d95cef | 79af3e7d31228a5a87424d2a7a1a6260 | Obtiene el valor bajo la llave proporcionada, convirtiendola al tipo especificado.
Si no la encuentra devuelve el valor por omisión. | {
T result = defaultValue;
object data = this[key];
if (data != null)
result = (T)DataConverter.ChangeType<object>(data, typeof(T));
return result;
} | 1 |
6d0b3be658c36a87124ba2af230c1e1f | 4ee6524921b12906eb1b0273bdb84f4c | Gets the number of milliseconds it took to execute Jellyfish. | StopwatchState state = getState();
if (state.running) {
return (System.currentTimeMillis() - state.startTime);
}
return 0L;
} | 0 |
0a5ec5ac08577be480575e4731f875d3 | d5268e2dc2bd4ec0bc1dde5973e50ec4 | 审核义工列表 | function getList() {
service.getList(getUrlParam('exclude'),function (res) {
for (let i = 0, len = res.length; i < len; i++) {
res[i].worker_number = '<span class="pitch" data-id=' + res[i]._id + ' alt="" ></span><span class="serialWidth">' + res[i].worker_number + '</span>'||'无';
res[i].title... | 0 |
4f001c5d3505dd969b73d83a26a58911 | 098e8774ba4255fdb46520cab67a280e | 获取停车公司列表信息 | class SectionResource extends Component
handleCompanyListQuerys () {
HttpClient.query(window.MODULE_PARKING_INFO + `/admin/reviewPassCompany`, "GET", {}, this.fetchCompanyList.bind(this));
} | 1 |
9d7f032dba1f51e5ae07c5efdaf9e581 | 61e25bccee2561981ace3b713f23c0c4 | Return number of beta electrons. | class density_fitting(object):
def get_number__of_electrons(self):
self.nelect = _get_number_of_electrons(self._auxmol,self.den)
return self.nelect | 0 |
32b86561f672dd8dc2c6c5f727b0893c | 9fa3dc627e8c0c8ffb3c54a9d1c01103 | @brief Constructor to be used if this fort.14 file is for a full domain | FluidDomainNode::FluidDomainNode() {} | 0 |
f5b371a1fc61ced83de3347d65308a79 | 58c9293d68268132b3bea9fb418f6653 | Funció que crea una nova columna resultant de dues altres columnes del mateix dataframe | class GdfDissolve:
def join_columns(self, new_column_name, org_column, add_column):
self.new_gdf[new_column_name] = self.new_gdf[org_column] + \
self.new_gdf[add_column] | 1 |
f6163c14d926f0edf3f8f7ffadeb9fbf | b3b736e1ed6b653e8b048328181809d0 | This method returns the {@code State} of the {@code Card} object. | CardState Card::GetCardState()const {
return m_card_state;
} | 1 |
36bdffbd859fb5f377abe48b4ccb307e | 24556a25140083328967aaba3d53d477 | <p>
库存管理块:获取当前工序的物料位置信息
</p> | @RequestScoped
@Path("material/lot")
public class TblMaterialLotResource
@GET
@Path("mobile/{materialId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public TblMaterialLotVoList getProductionTblMaterialLotList(
@PathParam("materialId") String materialId
... | 0 |
0b64e669847a29ac863f3466ce203fe0 | 9ba02ade7d9417ccbefd3880e22b6872 | 9.日记的回复点赞 | export class RewordDetailComponent implements OnInit
public clickPraise(event: MouseEvent, reply: ReplyEntity): void {
event.stopPropagation();
this.checkIsToDownload();
if (!this.showLoading) {
this.showLoading = true;
this.userService.doLogin().then(() => {
this.userId = this.storageSe... | 1 |
6689e4b3246f63c18c9c1dd5c1bf13f1 | 373e4280e74da284733cd1a11f644f3c | 根据用户id获取分享用户信息 | class ModelEvent extends Base
public function getShareUserByOpenID($openID)
{
$sql="select * from share_user where OpenID='{$openID}'";
return $this->db->getToArray($sql);
} | 0 |
5777bf5edeaf1580f98b36e81bc0c742 | 08187833090a1937376b83f2598d1158 | Produce the parameterlist as name="value" pairs. | {
StringBuilder sb = new StringBuilder();
String[] keys = getParameterNames();
for (String name: keys)
{
sb.append(name);
sb.append('=');
String[] values = getStrings(name);
sb.append(DefaultParameters.toString(values));
sb.... | 1 |
e5fd4f818d89b76a659a386a33e407a6 | 0e369887df32a1062b4266093e5a951c | 質問と回答を作成 | class AnswerController extends \mtosu\QNA\QNAController
public function createAction($id = 0)
{
$this->formValues = [
'author' => key($this->authedUser),
'questionId' => $id,
'score' => 0,
];
parent::createAction($id);
} | 1 |
e4973eb7ab91102c5e2e1a5850be0a98 | b4a2b6b6b8ccde30cf97d4b940be8b41 | If allow_overwrite=False duplicate package throws exception | p1 = make_package(filename="foobar")
p2 = make_package(filename="foo")
self.assertNotEqual(hash(p1), hash(p2))
self.assertNotEqual(p1, p2) | 0 |
fcce0eb0fcb7184c8899ae1e6eb35eed | 348e54084c29150ebdd8f976d703aefc | Creates the schedule with MinMin algorithm. | namespace Timetabling.BLL
Schedule GenerateSchedule(); | 0 |
561531afe4ab8cee71ea16df8402deb3 | ab47bd8a65e582eb37cb48e4ce6a8b62 | Gets the range object associated with the data body of the table | {
if (_body != null)
{
return _body;
}
_body=new Range(_rowIndex);
return _body;
} | 1 |
ced09aa695e5fb21c89a8a52469c392a | e9ad5458fb538d683f7c0f677e77f3db | 入住房号查询 | public TbHouse findHouseByHouseNum(String houseNum); | 1 |
d299823fc8969a24539047362fc8682e | 6a2613d9f8a559d0d3e8b0fd62d6ea3c | Reads relation-to-id mapping from file. | rid_to_name = {}
name_to_rid = {}
with io.open(file_name, 'r', encoding='ISO-8859-1') as f:
for line in f:
line = line.split('|')
rid_to_name[line[0]] = line[1]
name_to_rid[line[1]] = line[0]
return rid_to_name, name_to_rid | 1 |
d578f1fb764926f9b45ce299cb372380 | 63925ca6e1f681c406eefcde9a286002 | Update trading pair options | tickData = []
putOpt = put.Put('SPX', 2690, 0.15, 34, underlyingPrice=2786.24, bidPrice=3.00, askPrice=3.00,
optionSymbol="01")
tickData.append(putOpt)
callOpt = call.Call('SPX', 2855, -0.15, 34, underlyingPrice=2786.24, bidPrice=2.00, askPrice=2.00,
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.