query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1995f16af4d684e58f8c6009f87fbb48 | 2367a3fcb9ca4724861e3d5d27b6c9df | create HMM for testing posterior_decoding | APriorSpec = dict(gamma=10, alpha=0.5)
OPriorSpec = dict(lam=0.5)
hmodel = bnpy.HModel.CreateEntireModel(
'VB', 'HDPTopicModel', 'Mult', APriorSpec, OPriorSpec,
Data=Data)
hmodel.init_global_params(Data, K=K, initname='randexamples')
return hmodel | 0 |
99db9eae53eeb97a3c2b27d941e7d1b8 | 5f066daeb15bce4cb99400859b87648e | @brief json map 형식 문자열 생성. e.g.) { "sub1" : "sub-value1", "sub2" : "sub-value2" } | public class JSONObject
public static String toJSON(Map<String, ?> map) {
if (map == null) {
return NULL;
}
Set<String> keySet = map.keySet();
if (keySet.isEmpty()) {
return NULL;
}
StringBuilder json = new StringBuilder();
json.append("{");
Iterator<String> itr = keySet.iterator();
while (itr.h... | 1 |
4a1b2a25b6b34b21d7778e8707a20a85 | 487bc30abd4e2f33cc5ad4ab853654dd | Constraints are allowed at non-getters per processor option, but all other
checks (no static methods allowed etc.) still apply. | class JNLPSecurityManager extends SecurityManager
public void checkPermission(Permission perm) {
String name = perm.getName();
if ("setPolicy".equals(name) ||
"setSecurityManager".equals(name))
throw new SecurityException(R("RCantReplaceSM"));
try {
if (JNLPRu... | 0 |
54e878aa91cce3870e9350524b95dc63 | 94b27ede0bc75caa85cf35405df9af2b | 从收敛队列里面,遍历符合规则的电话通知消息,进行电话通知 | {
$queueList = $this->_parseQueues($queues);
$operatorList = $this->_parseOperators($operators);
$operatorId = 0;
foreach ($queueList as $key => $queues) {
if (! @$operatorList[$key]) {
continue;
}
foreach ($queues as $k => $queue) {
if ($this->_checkSession($queue['from_user'], $queue['messag... | 0 |
59979047fea272ccdcc3c9a5be5485d7 | 148c8ed8488c2718d6f2cb59f3daddd0 | 获取入库差异单明细 | @Service
public class InventoryOrderServiceImpl implements InventoryOrderService
@Override
public InventoryForOrderDetailVO getInventoryDiffOrderDetail(UserVO userVO, Long id) {
Long enterpriseId = userVO.getEnterpriseId();
InventoryForOrderDetailVO inventory = inventoryMapper.getInventoryById(ente... | 1 |
bed7d9fbf6d881aad7e2134b192ccc3f | e6d51253df6594a01a98613a86a5fcce | Confirmation page for after people create a new account | namespace Assignment_3.Controllers
public class HomeController : Controller
public IActionResult Confirmed()
{
return View();
} | 1 |
2e38078879b4157de56de29c9645a471 | 9f5cdae4e883d690d50af13afd515c1f | 전화번호 리스트를 리턴하는 메소드 | public abstract class CustomerBean implements javax.ejb.EntityBean
public ArrayList getPhoneList()
{
ArrayList vv = new ArrayList();
Collection phoneNumbers = this.getPhoneNumbers();
Iterator iterator = phoneNumbers.iterator();
while(iterator.hasNext())
{
PhoneLoc... | 1 |
cf45757bb9c9e65ec4d9fe350cfafc59 | 4d28e10b4c76aca450a94d01c2c1337b | Calculates Symmetric MAPE given y_true and y_pred | y = [x for x in y_true if x > 0]
y_pred = [y_pred[i] for i in range(len(y_true)) if y_true[i] > 0]
num = len(y_pred)
sums = 0
for i in range(num):
tmp = abs(y[i] - y_pred[i]) / y[i]
sums += tmp
mape = sums * (100 / num)
return mape | 0 |
be39e6254d34abff31bdc85ef94a4eac | 0141c951b28710ab33fcfd5681370e5e | Returns whether the value of the '{@link mpia.schema.TypePort#isZonePourTourner <em>Zone Pour Tourner</em>}' attribute is set.
<!-- begin-user-doc -->
<!-- end-user-doc --> | boolean isSetZonePourTourner(); | 1 |
32c13b3028da12174043ec5a73449b9e | 62393c3b57de4c5912989886e1059a6c | https://learn.microsoft.com/zh-cn/azure/cognitive-services/translator/reference/v3-0-reference#errors | func StatusMessage(statusCode int) string {
switch statusCode {
case http.StatusBadRequest:
return "Your browser has sent a malformed request."
case http.StatusUnauthorized:
return "You must be authenticated to use this service."
case http.StatusForbidden:
return "You do not have access to this service."
cas... | 0 |
a676b8c78f5cbc5b7f29d63055552abe | 3dda558a52ee181c70aee7b0677760e0 | Returns the CSN component information of this <code>SdaManifest</code>. If no CSN component
information is set it returns null.
<code>SdaManifest</code>. | public String getCSNComponent(); | 1 |
8f6b940755decdbf5c3360e49e11fa6b | 60791a8c62edc67505f34f680a58d40d | rotates the tetrimono clockwise | {
int8_t ori = manager -> orientation[0];
removeTetris(manager);
manager->orientation[0] = (control -> clockwise) ? ((ori + 1) & 3) : ((ori +3) & 3);
if(checkCollision(manager))
{
manager->orientation[0] = ori;
insertTetris(manager);
}
else
{
insertTetris(manager);
setPoolColor(manager,c... | 1 |
193489eef2058eeeb7489bee04a616b2 | 6fb94062f71554d5c5914514fcedb25f | Creates a new group milestone. | def newMilestone(*args, **kwdargs):
return newFixFor(*args, **kwdargs) | 0 |
03d5923859dbd62aab7b850958555502 | 1af0534613ebcf209a1b23389d5f38be | Appends a key-value pair to the URL.
Note: the key-value pair is assumed already URL-escaped and in the form of {key}={value}. | def generate_url(url, key, value):
return w3lib.url.add_or_replace_parameter(url, key, value) | 1 |
e1ff258229c619dfd1ebbd56f3542fc7 | aec8b959727f3850364f88bfddf1fa66 | Counts and shows items | class UbuntuOneLauncherUnity(object):
def show_count(self):
self.entry.set_property('count_visible', True) | 0 |
ffd7fb1a258481e156911fcfea7c8999 | 1404af52d1407d1e1b0dc991231aeb5f | Predstavljanje žanra filma, konstruktorskom funkcijom | ComedyMovie::ComedyMovie() :Movie(), GENRE("COMEDY")
{} | 1 |
cd9ee0e5fc7ebee5f3f03eb64dd07941 | 438c0a8ffd363c63fe68c147c6d36e7c | Return planet with provided Id
<p>
If no planet is found, throws PlanetNotFoundException.
</p> | class RepositoryImpl @Inject constructor(private val dataSource: RemoteDataSource) : Repository
override fun getPlanet(planetId: Int): Single<PlanetEntity> {
return dataSource.getPlanet(planetId)
} | 0 |
125dedd6710c36957b54ead32b91d32e | 16e480cd2e55e5df4e8880d7cdabe62f | It's not possible for a stack variable to be referenced in more than one statement, so we can
reuse the stack offsets after each statement. | namespace Mosa.Compiler.Framework.Stages
public sealed class StackLayoutStage : BaseMethodCompilerStage
private void LayoutStackVariables()
{
MethodCompiler.StackLayout.StackSize = LayoutVariables(MethodCompiler.StackLayout.Stack, CallingConvention, CallingConvention.OffsetOfFirstLocal, 1);
} | 0 |
5a24a33b9a72f56f04e7ac3c7dc2d519 | 6d4be7242128a7a03ef96a0c94d81d2e | Searches through a list of reddit Submissions for the one that corresponds to the desired
game and thread type. The desired game is the one where the two given teams are playing. | class CompetitionSubmissions(object):
def find_by_id(self, submission_id):
return self._attacks.get(
submission_id,
self._defenses.get(
submission_id,
self._targeted_attacks.get(submission_id, None))) | 0 |
230113e451a78b46dc773bc3fd792402 | ec6b9820fb595d33d494c3028857e55b | No input arguments.
This function writes libfg algorithm output like SoC etc to the
to the Fule Gauge interface driver. | (
IN GT_U32 devSlvId,
IN GT_U8 *dataPtr,
IN GT_U8 dataLen
)
{
return GT_OK;
} | 0 |
d955571fa272fb28d48d8a62d156ecc2 | d1d054d375697ec5e752507467808a48 | 判断是否登录, 如果登录, 则继续; 如果未登录, 转到登录页面 | public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView
private void jump() {
if (loginInfoUtil.getLoginResponse() == null) {
Intent intent = new Intent(mActivity, LoginActivity.class);
startActivity(intent);
finish();
}
int ... | 1 |
da16cbdde4767b6f440828d134288f03 | 7d76064bf6167e08e1b4cfb65545cfa0 | Moves the terminal cursor down one line | this.cursorColumn = 0;
++this.cursorRow;
if (this.cursorRow >= 25) {
this.cursorRow = 24;
for (int r = 0; r < 24; ++r) {
for (int c = 0; c < 80; ++c) {
this.OutputBuffer[c, r] = this.OutputBuffer[c, r + 1];
}
}
for (int c = 0; c < 80; ++c) {
this.OutputBuffer[c, 24] = new C... | 1 |
cc7919f0e950f650853284fc06ff8ba0 | 7e338c63b3af616abb09cea8254b2774 | Retrieves the User's current Hair Identifier. | class RefHair
public function getHairId()
{
return $this->hairId;
} | 1 |
97565cd663e9412318336741c1b0f316 | 13bfadeaea4d9d29cbee289dba1ec77c | 初始化右侧空间的容器 | class PUITopBar : PUIRelativeLayout
private fun makeSureLeftContainerLl(): LinearLayout {
if (mLeftContainerLl == null) {
mLeftContainerLl = LinearLayout(context)
mLeftContainerLl!!.gravity = Gravity.CENTER_VERTICAL
mLeftContainerLl!!.orientation = LinearLayout.HORIZONTAL
... | 0 |
a535f6aa5305c7060aa40577fc3afdbe | e4653eb5d799990316f76efb7cbc02df | 验证用户风险 | class RestfulXjbTools(object):
def risk_evaluating(self, user_name, login_password):
try:
self.login(user_name=user_name, password=login_password)
entity = self.entity.get_risk_question_by_type()
question_no = entity.questionNo
self.entity.risk_evaluating(question... | 1 |
c1d12696408c5e9f5c0661000e60cd5c | b0aea240ca8ae683883ec292d9a1c155 | Get estimated time of compilation of current package. | class IBuildStepStatus(Interface):
def getETA(): | 1 |
1f656aca5ecf1dc983f3615eb597dbf1 | d6eb452456ddbd2496e80a91330c5342 | 点击关闭,窗体关闭 | public class Test : MonoBehaviour
private void OnBtnCloseClick() {
WindowAnimation wa = GetComponent<WindowAnimation>();
if (null!=wa) {
wa.OnWindowClose((close) => {
Destroy(gameObject);
});
}
else {
Destroy(gameObject);
}
} | 1 |
235dd317635f467ca5167318e74fba73 | 1cdb9e84568185802a0cceb8a8c9a73c | 判断当前实体是否是Parent的实例 | {
Entity parent = this;
while (parent != null)
{
if (parent._parent == other) { return true; }
parent = parent._parent;
}
return false;
} | 0 |
b713d14c82af349bdf487fc020ac8c48 | 87a625aeb99b1367684e0cc54118d4fe | Iterates the given block for each slice of <n> elements. If no
block is given, returns an enumerator.
outputs below
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
[10] | length = len(iterable)
for n_idx in range(0, length, n):
yield iterable[n_idx:min(n_idx + n, length)] | 1 |
c5a5d51e24c22557d3f7e2686d05c81b | 58d53a17a67bd6d38ebb3ad12854e592 | Gets the resource collection API of CustomEntityStoreAssignments. It manages CustomEntityStoreAssignment. | namespace AutotaskCorporation.Autotask.Data.BusinessObjects.Entities
public partial class Resource
public partial class QueueAssignment
public partial class QueueAssignmentManager
protected override IQueryable<DAL.ResourceQueue> BaseQueryDefinition(DataContextInfo dataContext)
{
return from o in dataCont... | 0 |
31c9ffbb4b3490f4019179bd1987d312 | 185d9ab717648e5814b17c5dd1e7d4b6 | 设置异常信息给DbLog | namespace Dulabs.Butterfly.Service.WebApi.Platform.Common
public class MessageResult : IHttpActionResult
public void SetExceptionInfo(string value)
{
this.ExceptionInfo = value;
} | 0 |
7530741c508a06389243308c90034daf | 07e9f937dfb564582690e716bad77ecb | Create an instance of {@link TParallelGateway } | public ExpressRouteGatewayInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, ExpressRouteGatewayInner putExpressRouteGatewayParameters) {
return beginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters).block();
} | 0 |
e2ecfe3114b6bee45465cdc813ff2261 | 682e9050e7c71f66656816cc55d792bd | Gets the list of resources from cache. | class ThemeResourceProvider implements ResourceProviderInterface
public function getResources()
{
if (!$this->resources) {
if ($this->cache instanceof Cache && $this->cache->contains(self::CACHE_KEY)) {
$this->resources = $this->cache->fetch(self::CACHE_KEY);
} else {... | 1 |
56452e5368c5c22400c603310b444464 | 4a106e1c8d225736ff35c50e64a241e8 | Set the value of vendedor | class Venta extends \i52gagrj\LaTejedora\TPVFrontendBundle\Entity\Venta implements \Doctrine\ORM\Proxy\Proxy
public function setUsuario(\i52gagrj\LaTejedora\TPVFrontendBundle\Entity\Usuario $usuario = NULL)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuario', array($usuario));
... | 0 |
0bcd95de27e9b9c1f8440db1057c7419 | 796ad686e50e1b95c2509349e2cea64f | Update size chart image of item. | Update withSize(String sizeName); | 0 |
332a407229188bd546ef6e664e09022d | 7293e573fa0d3889249279876fe37a6d | remove and decrement the number of rows | function removeC() {
numCols -= 1;
let tableRows = table.getElementsByTagName('tr');
for (let i = 0; i < tableRows.length; i++){
tableRows[i].deleteCell(-1);
}
} | 0 |
a53e8763ca277eae5bbe1eaf4a86f6b2 | ca7954b54f21baaa2930ae365c8fcaa7 | Create a Win32 process started suspended. pi will hold the handles to the process and main thread | BOOL succeed = CreateProcess(
lpApplicationName,
szCommandLine,
NULL,
NULL,
FALSE,
CREATE_SUSPENDED,
NULL,
NULL,
si,
pi
);
if(!succeed){
printf("CreateChildprocess error :%x", GetLastError());
return 0;
}
system("pause");
succeed = Res... | 1 |
651443a837bc2ac635682fcbc9247683 | c5eef7b507d268b0deaee5d26b60fb96 | Simple input_fn for our 3D U-Net estimator, handling train and test data
preparation. | def input_fn(data_dir, batch_size=1, num_epochs=1):
dataset = tf.data.Dataset.from_tensor_slices(filenames(is_training,is_testing, data_dir))
dataset = dataset.flat_map(tf.data.TFRecordDataset)
dataset = dataset.map(lambda value: record_parser(value), num_parallel_calls=5)
dataset = dataset.prefetch(batch_size)... | 1 |
cc881edaeed997134c6027b7d2b8d4cb | 430c29310a5a629bd3bb09a457f58b5a | Tests whether additional event types can be registered. | public class EventManagerTest extends TestCase
public void testAddUserEventListener_otherEvents() throws Exception
{
doTestAddUserEventListener_otherEvents(ADD_SHARED);
} | 1 |
684d9f1df7203f745cbb4fa4e997a8a9 | 4a302e4ab20ba3a010c0d22d45c1acd6 | Get the coach settings for a given user or create a new Settings | class FitnessCoachController extends Controller
public function show($id)
{
$common_array = array(
'content_heading' => 'All Settings'
);
$details = DtbUser::find($id);
$userNotes = UsersNote::where('user_id', $id)->get();
return view('coach.show', compact('detail... | 0 |
ec4ca939c6b9ca7c1de81aa5c788cb28 | 01dc4a6064b12d1e3753ffd8d4437523 | Append _QC_issue instance to existing _QC_Station_Report instance. | class QcreportHelper
public static function saveSessionQcreportToDb($new_value) {
$qcinspector = & FactoryHelper::getModel('qcinspector');
$result = $qcinspector->saveQcreportSession($new_value);
return $result;
} | 0 |
8e2f5a28d714a1098cad63fa8abe641d | 5d93c0ea8502c4b4d8b82d9ffdea1b25 | Returns whether the the tile that represents objects with this template
is flipped diagonally, if this template is for a tile object. Returns
false otherwise. | namespace TiledCS
public class TiledMap
public bool IsTileFlippedDiagonal(TiledLayer layer, int dataIndex)
{
return (layer.dataRotationFlags[dataIndex] & (FLIPPED_DIAGONALLY_FLAG >> SHIFT_FLIP_FLAG_TO_BYTE)) > 0;
} | 1 |
31641cdeeb2970cacc2ae20287af2dfc | 1b4c8d1a159e0b1d24f2803ac120f31b | 根据文章标题和文章分类查询博客 | List<BlogQuery> searchByTitleOrTypeOrRecommend(SearchBlog searchBlog); | 1 |
6a97c18bc0ae45cbc7a1e8f09bf8d0e8 | b9c608ed0632619dceb0dbf4c9c9aa76 | Tests compatibility with Integer contents. | self.assertEqual(Column.integer("Twenty Three"), "23")
self.assertEqual(Column.integer("Two hundred and twelve"), "212")
self.assertEqual(Column.integer("4,000,234"), "4000234")
self.assertEqual(Column.integer("23"), "23")
self.assertEqual(Column.integer("30 days"), None) | 1 |
8e4f7969704498fa562a3a1f2c5fd698 | 429a329ea71ada121649c5943818f97f | Compute normalized sizes for the words in the cloud basing on the frequency | def normalize_vocab(voc):
points = [None]*(len(voc))
for w, idx in voc.iteritems():
points[idx] = word_embs[w]/np.linalg.norm(word_embs[w])
points = np.array(points)
return points | 0 |
a4f0d2cbe23d4b6db8afa07fbf1b2b58 | b6d4bb777b078b891738278f55bd0ec3 | Test modifiying bookmarks that already exist locally | remote_data_folder = self.remote_test_folder + '/DocumentElements/Bookmarks'
local_file = 'Common/test_multi_pages.docx'
bookmark_name = 'aspose'
remote_file_name = 'TestUpdateDocumentBookmark.docx'
bookmark_text = 'This will be the text for Aspose'
self.upload_file(remot... | 1 |
e4a59c5c3488f42b7863bf8b1b0fc374 | 39b092a421ae84980b4fbc3e14c11f61 | Проверка общей информации для всех ролей в блоке "Общая информация". | class TestAccount(unittest.TestCase):
def test_full_info(self):
self.assertIn("300", self.account.full_info())
self.assertIn("Вознесенский", self.account.full_info())
self.assertIn("79006001020", self.account.full_info()) | 0 |
5fa702a1ab02395db441cfacdc2143bd | 159875817f078773f40d4ee1bfe339bc | Performs L2 loss between 2 tensors. | def l2_norm(x: Tensor, y: Tensor) -> Tensor:
return judo.norm(x - y, axis=1) | 1 |
2744935d0642bf5c601dcfbf27df7fda | 37ad704fba04f711d36e9493ea101924 | Checks to see if the current player is underage. | class digital_consent
public static function is_minor($age, $country) {
global $CFG;
$ageconsentmap = $CFG->agedigitalconsentmap;
$agedigitalconsentmap = self::parse_age_digital_consent_map($ageconsentmap);
return array_key_exists($country, $agedigitalconsentmap) ?
$age < $ag... | 1 |
d3ef054f9e1fa1aa0f95b06eaf18ffdd | 0d88a7dcf31048fcf4f0e0861e494d61 | pingxx支付 | class PaymentManager
public function payping($post){
require_once(Yii::$app->basePath.'/sdk/pingpp-php-master/init.php');
$output = new \stdClass();
$output->errorMsg = null;
$output->pingCharge = null;
if (isset($post)) {
try {
... | 1 |
a67ff9f608bbf88a58f192393c31ea38 | 848c35091e4b534428b6a21f180f646e | Tests for nil "color" element | class SimpleTest(TestCase):
def test_getColorByName_NullColorName_GetsBlackHex(self):
hex = views.getColorByName(None)
self.assertEqual("#000000", hex) | 1 |
9bef17149ae7e026c12fcbc96c11be93 | 13a98f8b9aa009b067465b8c3174812c | Создает из объекта viewmodel
если указана текущая viewmodel, то обновляет её новыми данными | class InstanceManager
#syncViewModel(instanceView, instanceModel, beforeElement) {
let addedHtmlElement = null;
if (instanceView == null) {
addedHtmlElement = this.#addChildInstance(instanceModel, beforeElement);
Utils.createFieldsForAddedElement(addedHtmlElement, this.formContai... | 0 |
f75cd9cf026f951767ea15f5482b56c0 | 4af368afd07496eaf0f384dc02f131a6 | method delete order from map. | {
$data = [];
$data['rid'] = $input['route_id'];
$data['oid'] = $input['oid'];
$opId = DB::table($this->opTable)
->select('id', 'order')
->where([['rid', '=', $data['rid']], ['id', '=', $data['oid']]])
->first();
if (!is_object($opId) || $o... | 1 |
17ab827c45f801cfabcd59d67e2192ba | ac3f30b9af6983340956fd3d933d0a31 | Elimina un tester de la relación con el proyecto. | {
if (tester.Beta != this)
{
throw new ArgumentException("Tester not associated with this beta");
}
this.Repository.DeleteTester(tester);
} | 1 |
76aa9069d9e58b9f2a11cc920402dd4b | b0dc58d421faf57a843204d0fcb1fa8b | Ejemplifica el uso de polimorfismo sobre las clases heredadas | {
#region BasicoSobreClases
BasicoSobreClase claseEjemplo = new BasicoSobreClase(2);
BasicoSobreClase referenciaAUnaClase;
referenciaAUnaClase = new BasicoSobreClase(1);
int x = claseEjemplo.MiPropiedadCompleta;
claseEjemplo.MiPropiedadComp... | 0 |
f8a0f0b4e51fe2d83d294e3184e6afa1 | 63e23e39efdb0ffcfcb6864f944c8c8f | 23. 인수로 주어진 배열 arr에서 짝수이고 3보다 큰 수만을 구하여 이를 배열로 반환하는 함수를 작성하라 | var result = [];
arr.forEach(function(e, i) {
if (e % 2 === 0) {
result.push(e);
}
});
return result;
} | 0 |
3cba96c4a03c5ae628d59739d1016837 | beeb54e6b53c5b02ba04d3d2cc3e1f9f | common users will see only their services in <select> options | {
$user = User::find($request -> user_id);
if ($user -> isAdmin()) {
$items = SELF::getServicesForAdminUser();
} else {
$items = SELF::getServicesForNormalUser($user -> id);
}
return ServiceResource::collection($items -> paginate(10000));
} | 1 |
db9950fc1733f81b64b870c2109cf7f7 | 104d304928a1a3bacdca3b748f73fa46 | Scan for named bluetooth devices | int main() {
auto detected = Bluepy::scan(8, 255);
for (auto &v: detected) {
std::cout << v.address_string << "\t" << v.name << "\n";
}
} | 1 |
caa46176a6103acb81d8f2072dea02af | d51ee5951563f625332b2de59bad0147 | 时间处理,datetime特征获得对应年月日周 | def IdentifyingDatesWithinWeek(ele):
startd=datetime.datetime.strptime(ele[0:ele.index('_')],'%Y%m%d')
endd=datetime.datetime.strptime(ele[ele.index('_')+1:len(ele)],'%Y%m%d')
date_delta=endd-startd
years=[]
doys=[]
for i in range(date_delta.days+1):
dt=startd+datetime.timedelta(days=i)
... | 0 |
38d6969b5dcaba7245b03c520674b063 | d7b9e5f786cf606fb4f81f4d66806655 | Calculates the angle between 2 lines by first determining the angle of the individual
lines and then subtracting them from each other | def angle_betw_lines(line1, line2):
dx1 = (line1[1, 0] - line1[0, 0])
dx2 = (line2[1, 0] - line2[0, 0])
dy1 = (line1[1, 1] - line1[0, 1])
dy2 = (line2[1, 1] - line2[0, 1])
theta1 = math.pi/2
theta2 = math.pi/2
if dx1 != 0:
theta1 = math.atan(dy1 / dx1)
if dx2 != 0:
theta2... | 1 |
2a781612a07904803e17d1c7ff1ec3af | 00d2058255f6554f00f5b4dfb5c98716 | Find prime using Fermat's little theorem. | {
ulong a;
ulong gcd;
ulong i;
ulong Jacobian;
for (i = 0; i < chance; i++)
{
a = generateRandomNumber(number);
gcd = getGreatestCommonDivisor(Convert.ToUInt64(number), Convert.ToUInt64(a));
i... | 0 |
07e9bc64ee85f41adc30a3ed2e9b76b8 | 3ef6f5f655e0c00b901714f9aec97c04 | Spracovanie snimkov | {
mexif = new Mexif;
pocetFoto = 0;
progress = new QProgressDialog();
progress->setWindowTitle("Načítání");
progress->setLabelText("Příprava...");
progress->setRange(0, 1000);
progress->setModal(true);
progress->setAttribute(Qt::WA_DeleteOnClose, true);
progress->setValue(1);
int... | 1 |
582716d9ee11e331609f2100cb07a926 | 3616d7eabf49c9779d014562fd72a347 | Called whenever a received message is a join request. | void MP1Node::handleRecvJoinReq(Member *m, MessageHdr *msg, int msgSize) {
auto a = Address();
memset(&a, 0, sizeof(Address));
memcpy(a.addr, msg->addr, ADDR_LEN);
sendMsg(&a, JOINREP);
return updateMemberList(m, msg->addr, m->heartbeat, par->getcurrtime());
} | 1 |
1bcbed25600ef9f860c0c5ce35d4df6b | ee4c4296dc1a37113f83ef5baeace810 | 利用mmdection框架最后生成的csv文件来制作testA伪标签 用于yolov5模型
其中2k图直接使用真实标签 非2k图才使用伪标签 2k图的序号28-80需要跳过 | def mmdect_pesudo_csv2xml():
idx = 7000
csv_path = '/root/python_project/underwater_detection/mmdetection/data/underwater/2020_9_2_15_22_make_pseudo_for_cascade_htc_train_A_ep11.csv'
img_source = '/root/python_project/underwater_detection/mmdetection/data/underwater/test-A-image'
dest_image_path = '/roo... | 1 |
99a75441946e928f07d837a6006ee3db | a51cfcbf423f5f73b894372c141f5efa | 注册单个监听,每次都被最新注册的替换。通过emitNextTick触发。 | export class Emitter extends Class{
singleAsync(event:string, listener:Function, ctx?:any):Emitter {
var self = this;
self._store.addSingle(_OWNER_ON_ASYNC, event, listener, ctx);
return self;
} | 1 |
8e94ac6b81fe81cf45713a55de8d4ad1 | 261bffcd41b5634ad3cdee8d15cba9a1 | 讀取UID到點號的對應 | void BPoint::ConvertToID()
{
ID = "";
string poto;
for (int i = Level; i > 0; i--)
{
poto += char(i + '0');
}
string Temp_Created = ID_Created;
while (poto.length() > 0)
{
int current = *(Temp_Created.rbegin()) - '1';
ID = poto.at(current) + ID;
poto.erase(poto.begin() + current);
Temp_Created.pop_bac... | 0 |
8e2c325b041c0ebbcb34a097bdc77898 | a09682ca469955c2d68bdd8d2dd045f3 | Search dir for all .shp files. Return a list of just the
base file name for each file. | dir = os.path.join(DATAPATH, dir)
return [name for name in os.listdir(dir)
if os.path.isfile(os.path.join(dir, name))] | 0 |
5c0ee69b2e102c6f68b1f66c8fc0877b | 675dfb3aab96890792b4547a1e2bc35b | use this if you run this app outside cluster | func GetClientOutOfCluster() kubernetes.Interface {
config, err := buildOutOfClusterConfig()
if err != nil {
logrus.Fatalf("Can not get kubernetes config: %v", err)
}
clientset, err := kubernetes.NewForConfig(config)
return clientset
} | 1 |
71e576df502472cb6e5ccbc3e32a6880 | 97b28fcf714efdd8d19ddf4e96886fde | <p>
Creates a function package.
</p>
<p>
A function package is a .zip file in CSAR (Cloud Service Archive) format that contains a network function (an
ETSI standard telecommunication application) and function package descriptor that uses the TOSCA standard to
describe how the network functions should run on your networ... | java.util.concurrent.Future<UpdateSolFunctionPackageResult> updateSolFunctionPackageAsync(UpdateSolFunctionPackageRequest updateSolFunctionPackageRequest); | 0 |
52b43978601f83c8d9b429bb5294e525 | 0b5875931f57d5599730d8bd8d7de517 | 获得杠头gameobj | public class CC_CANOE : MonoBehaviour
public static GameObject HeadGameObject() { return CC_HEAD; } | 1 |
4363bb7b680c5eb51f6de88b26844144 | 6910cb632451df8a93642681a655ecde | 查找设置ActionBar Tab显示在底栏的方法,找不到method则返回false。 | public abstract class BaseActivity extends FragmentActivity implements
DialogControl, OnClickListener, ActionBarControl
protected boolean hasActionBar() {
return false;
} | 0 |
6120a034e06f518fa65b784b8c915909 | 4c441df74af27610b3b48377a659fdab | get full dependency file path (dir + file name) | public final class ExternalDependency
public String getDependencyFileName() {
return getCacheName() + "." + getPackaging();
} | 0 |
9cf82ba02e6b58f470d553ad65d23bbb | f80c2f03d06209f9825307f8711c854a | Returns true if a record exists in a linking table for the pair of
records. | public abstract class LinkStore
protected boolean isLinked(UUID key1, UUID key2) throws SQLException
{
LinkTableDef td = getLinkTableDef();
if (td.hasWeight()==true)
{
List<Link> links = (List<Link>) Cache.get("link:" + td.getName() + "." + key1.toString());
if (links!=null)
{
for (Link l : links)
... | 1 |
4e2ca9a310248e38fc958faaa71f59e4 | bcd9b02ba018f52014d9a4896aad9fec | @brief Metodó para detener la ejecución del lector de C! | @SuppressWarnings("unused")
public class RFIDMain implements tcpServer.TCPServerListener, interpretadorOrdenesConsola.OrdenesDeConsola{
void detenerLectura(int codigoOperacionAdetener, int codigoOperacion); | 1 |
de79bc1ee237ca33f4f7faf17fdd52d2 | ba381823fd1dbf7279fbec23b7b5f439 | 往8个方向搜索 | public class Map : MonoBehaviour
void SearchCross(int x, int z, int movePower, float liftingForce)
{
if (0 <= x && x < maxX && 0 <= z && z < maxZ)
{
SearchPos(x, z - 1, movePower, MoveList[x][z].Level, liftingForce);
SearchPos(x, z + 1, movePower, MoveList[x][z].Level, liftin... | 0 |
1c3bec968b99454019aa8ba12aef5ca5 | 1031c341550ea44717ca7d92d8d31d06 | 檢查 ELF 魔數 | {
if (data->e_ident[EI_MAG0] != ELFMAG0 ||
data->e_ident[EI_MAG1] != ELFMAG1 ||
data->e_ident[EI_MAG2] != ELFMAG2 ||
data->e_ident[EI_MAG3] != ELFMAG3)
return (-1);
return (0);
} | 1 |
bc8fddd09561ef7d96b26f1cd6c41511 | eb011ba6756a3107f07382489964ff72 | 統計情報を(csv)ファイルに書き込むよ | const char met[]="SaveCsv";
ofstream pf;
pf.open(file.c_str());
if(pf){
bool sm10=false,sm13=false,sm20=false,sm30=false,sm35=false;
for(unsigned c=0;c<Count();c++){
JPtxasInfoKer* ker=Kernels[c];
if(ker->GetRegs(10))sm10=true;
if(ker->GetRegs(13))sm13=true;
if(ker->GetRegs(20))s... | 1 |
405fcac478dac9faf27ed859b52bab58 | 84336e48cd6e1036f4be95e80d5a22ce | Hides the message that the monitor is about to take an ad break. | {
if (_messageHolder != null)
{
_messageHolder.Visibility = Visibility.Collapsed;
}
} | 1 |
5206264f2fa909beb440731ceddb0b5a | 32a94a5e25ec3a449090254218b95987 | show purchase資料表 on DataGridView | {
dataGridView1.ColumnCount = 21;
dataGridView1.Columns[0].Name = "proid";
dataGridView1.Columns[1].Name = "proname";
dataGridView1.Columns[2].Name = "receive";
dataGridView1.Columns[3].Name = "qtyp";
dataGridView1.Columns[4].Name = "up";
... | 1 |
95af158611e3c67f1073b1bb81e36a0e | f4bd0112c2214e178f23eb93becbe38a | 异步发送Http请求(返回Byte[]类型正文)。 | namespace AigioSoft.Common.Helpers
public static partial class Http
public static async Task<m.HttpResponseByteArray> SendAsByteArrayAsync(Action<m.HttpRequest> requestAction)
{
var request = new m.HttpRequest();
requestAction(request);
return await SendAsByteArrayAsync(r... | 1 |
f3b5e76d6eb6b8ea812aee6bf85a2d22 | b97df1ec25b8576e0667b9a364d47dd4 | Get the drawerID value. | public class GetFlowRequestModel
public int drawerID() {
return this.drawerID;
} | 1 |
1c76d18e7f585162c2b0efd283eb4ea0 | e1a371dcdfb1947638eb0bfcab71147b | Inline keyboard with hyperlink to the city web-page | def check_inline_keyboard():
keyboard = [
[InlineKeyboardButton(TITLES[CALLBACK_BUTTON17_CHECK], callback_data=CALLBACK_BUTTON17_CHECK)]
]
return InlineKeyboardMarkup(keyboard) | 0 |
e0a0a74289c98590e8349b59f43407b1 | 8fc0055f88874253d4d807cb1e40ed0e | Add job to executor pool. | void addJob(T job); | 1 |
ce414e904fa6b86340e295ca380a3bc8 | b17e0255eebae0e8b3d18faa9f6adc82 | 显示所有地雷方块 | namespace minesweeping
class Minebound
public void showmine()
{
for(int i = 0; i < PublicValue.line; i++)
{
for(int j = 0; j < PublicValue.lie; j++)
{
if (buttons[i, j].Ismine == true)
{
b... | 1 |
5638d83964879e77f566eff2fb9b919c | ae2e987148d91880f3a0cfe2f4109eb4 | STP timeout function | {
uint8_t i;
uint32_t k;
for (k = t; k > 0; k--) {
;
i = 6;
while (--i);
}
} | 0 |
6163967b832df4e02ee43070b69ad163 | 4fc933aac8ebd2793e41ea4f6fd80b67 | gère uniquement la descente gauche / droite
OK | this.blok.setVelocity(0);
if (this.lesFleches.left.isDown || this.lesCles.A.isDown){
(this.vitesseDescente >= 800) ? this.blok.setVelocityX(this.vitesseDescente * -1.25) : this.blok.setVelocityX(-1000);
this.tableauSons[1].play();
}
else if (this.lesFleches.right.... | 1 |
9d85b9e876936caedfa4d7057d67a4af | 45a9b06a9ad08abdf15564d8ade11b0a | Updates the document at `d_id` with a new document
This method replaces the document at d_id with a new document,
completely deleting the old document to replace it with the new
version. This is not very efficient.
See the documentation for :py:meth:`~.Table.insert` for a discussion
on what actually counts as a docume... | class ConfigSet:
def update(self, d):
self.table.update(d) | 0 |
a24db356de2af37d029eea2cee19988b | ea673bda85e46ea01a70959e8d71274c | creates a quiz submissions and adds submitted answer to it | selectedAnswers.value?.add(
SubmittedAnswer(
assignmentQuestion.question,
assignmentQuestion.choices,
assignmentQuestion.correctAnswer,
assignmentQuestion.explanation,
assignmentQuestion.order,
selectedIn... | 1 |
0bcaee39a0b74dd9af4719a9b9d2929e | 5a0a27a4bcf91f2f2e4f92aa1e6db163 | block an opponent's horizontal row of pieces. (A row of length x) | public class SinglePlayerAdvanced
private static void horizLeftRight(Board b, ArrayList<Tuple> movesToMake, ArrayList<Tuple> movesToBlock) {
int xIndex;
int yIndex;
Game game = b.getGame();
int player1Color = game.getPlayer1Color();
int player2Color = game.getPlayer2Color();
... | 1 |
339ea5211aa94f0c5192d57145a54fcd | 179107f745fdb2533c79724c33ecf900 | 查询节点的详细数据 | @RestController
@RequestMapping("/node")
public class V2NodeController extends BaseController
@GetMapping("/subject/{node_id}")
public Result<V2Node> getDetail(Result<V2Node> result,
@PathVariable("node_id") Integer nodeId,
@RequestParam(name =... | 1 |
063a4bd2541442cd4676e96f0a4dd7f4 | 6d7f9e6b89356fdbb5e182a9a0c60eba | Check if set of proposed keywords is a good match to create content
for a given audience. | if age_limit is None:
return False
if content_limit is None:
return False
return age_limit < content_limit | 0 |
7707feee3acc6e6cf183c6e5500fecdb | e10799c15b79db17d324c97cbe9c3196 | 获取系统所剩空间最大盘符 | function get_spec_disk($type = 'system')
{
$disk = array();
switch ($type) {
case 'system':
$disk = get_disk_space(strrev(array_pop(explode(':', strrev(getenv('SystemRoot'))))));
break;
case 'all':
foreach (range('b', 'z') as $letter) {
$disk =... | 0 |
f39e384a9473f3c57ab756b547187e96 | 6a561dba480b9a8122a386e95b688703 | 清理所有 Internet临时文件 Cookies 历史记录 表单数据 密码 | public class DeleteIECache
public static void DeleteTemporaryInternetFiles(IntPtr hander)
{
ShellExecute(hander, "open", "rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 8", null, (int)DeleteIECache.ShowWindowCommands.SW_SHOW);
} | 1 |
782c8063a48db8150a686bb4e810cb0d | b75c396e6b1f6ea82efa90b986765203 | Gets the lyrics from the song's genius page. Lyrics is labeled by sections! | class Genius(LyricsProvider):
def get_lyrics(self, name: str, artists: List[str], **_) -> Optional[str]:
try:
headers = {
"Authorization": "Bearer "
"alXXDbPZtK1m2RrZ8I4k2Hn8Ahsd0Gh_o076HYvcdlBvmc0ULL1H8Z8xRlew5qaG",
}
headers.update(self.heade... | 1 |
3493ce5846ca16aa9f0f202a72ad748a | 43864256842db88b9435ed90cde50e4e | Gets the next character and shifts the position by one. | {
var c = _currentUnreadIndex < _textLength ? _text[_currentUnreadIndex] : NullCharacter;
_currentUnreadIndex++;
return c;
} | 1 |
b0d8e4d46a81a2c8f8d14f2b7e2e5df7 | b1c8901ada1b846b6b68eefb79ab025e | recursively gets the total number of subordinates to this employee | List<Integer> allSubordinates = new ArrayList<Integer>();
resolvingAreacode(areaCode, allSubordinates);
return allSubordinates;
} | 0 |
6baeb24f95178bf9e79aeef6f5dcbfc3 | bdfb72a3a1cb47593a2927164066702a | @brief Converts a dpp state into a string. | dpp_state_str(enum dpp_state dpp_state)
{
switch (dpp_state) {
case DPP_STATE_INACTIVE:
return "inactive";
case DPP_STATE_TERMINATED:
return "terminated";
case DPP_STATE_CHIRPING:
return "presence_announce";
case DPP_STATE_PROVISIONING:
... | 1 |
3a1e530f4996f5b99a9193a6246009da | 7dfc327dd50f69cb18ef6814244a3b0d | calculating exp. and gives an answer | double exp(double x)
{
double ex;
double tx;
int n = 0;
ex = tx = 1;
while (tx != 0.)
{
n += 1;
tx = tx * x / n;
ex = ex + tx;
}
return ex;
} | 1 |
200c240754482637429d3a2593980f3e | 38d389841a223a495ba7384cd0b7b0e9 | 可以声明带泛型参数的**数组,但是不能初始化该数组 | public class testArray
private static void demo11() {
int t1[];
int [] t2;
int t3[]={1,2,3};
int t4[]=t3;
int t5[]=new int [1];
t5[0]=1;
int t6[]=null;
} | 0 |
905962de7622ea1326b83b055ce5d02d | 78b21b255179497b1027ffc17d2e94f7 | 开票页面发票撤销功能,将已开票发票改成待开票 | public void backFundPlanInvoice(Map<String, String> model) throws Exception {
String[] idsArray = model.get("ids").split(",");
User user = (User) SecurityUtil.getPrincipal();
String date=DateUtil.getSystemDateTime();
List<FundInvoiceInfo> taxlist=new ArrayList<FundInvoiceInfo>();
for (String id : idsA... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.