query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
105d70ec3555798f91322fdbdc005718 | 51cca53cd6dccb628178bc4ab655b2cd | Metoda odpowiedzialna za utworzenie odpowiedniego sharedpreferences oraz wstawienie poczatkowych wartości domyślnych | public class SessionManager
private void initSharedPreference(){
sharedPreferences = Configuration.getContext().getSharedPreferences("SessionManager", Context.MODE_PRIVATE) ;
} | 0 |
8386e09130552770be43483156ac77b1 | f262f74c5d3b6201a2450d28b9e9763d | 获取他人的标签 | {
list($pid, $atoken) = $this->getATP($uid);
if ($pid == 1)
{
$sina = new SaeTClientV2($this->sina_wb_akey, $this->sina_wb_skey, $atoken);
$tags_list = $sina->get_tags($touid, 1, 200);
}
return $tags_list;
} | 1 |
a8ee654f2cb5cfdbb5dc88580146977d | fbefabf9d6c65654338343a7a2e5f351 | Simply adds dummy data to the high scores to show sorting functionality | class DummyHighScores(HighScores):
def __init__(self):
return | 0 |
b4dc288209cfd7fb2e0db9dbd389e151 | 4a561dc8f98f003c49067965d57f3bda | 根据科技ID和等级获取科技升级数据 | for i=1,#DataGuild.data_get_forge_up_data do
local gbd = DataGuild.data_get_forge_up_data[i]
if gbd.lev==lev then
return gbd
end
end
return nil
end | 0 |
4403eea8f8fb1e4ad4aeb2da25513e5e | ae2f0a6885f3048c677875db75d21ac5 | 旋转矩形与轮廓面积比限制函数 | def areaFilter(min_area: int, max_area: int):
def area_check_IN(cnt):
area = cv.contourArea(cnt)
return True if min_area < area < max_area else False | 0 |
292df47e48c77ebb51265049e3a212e6 | 7f8e500eb1d25893608466a5e4e4df33 | FUNCIÓN PRINCIPAL ----> | {
clear();
printf("\tBienvenido al programa de la mochila. :D\n");
LinkedList* objetos = crearLista();
LinkedList* solucion = crearLista();
int noObj, wMochila;
printf("Ingrese el Numero de Objetos:\n->");
scanf("%d",&noObj);
printf("Ingrese el Peso MAXIMO de la mochila:\n->");
scanf("%d",&wMochila);
ListaSe... | 1 |
f18da13060fc97e50539c7c6635f9375 | 36f87f9f4d22532a610e3b1b27f7576c | Get algorithm state | namespace ds
namespace Net
ds::ErrorType NatSession::GetAlgStatus
(
ds::Net::GetAlgStatusType* pAlgStatus
)
{
PSGetAlgStatusType arg;
LOG_MSG_FUNCTION_ENTRY ("NatSession::GetAlgStatus()", 0, 0, 0);
if (0 == mIfaceHandle)
{
LOG_MSG_ERROR ("Route lookup not performed", 0, 0, 0);
return QDS_EINVAL;
... | 1 |
007985cbdcbc3bfa083178f8a65542c5 | 55c680f0a67a1a7770be01de2bd23e99 | Publishes a cmd_vel message for the kobuki. | class ObjectFinding:
def send_velocity(self, linear=0, angular=0):
self.cmd_vel_pub.publish(Twist(Vector3(x=linear), Vector3(z=angular))) | 1 |
3b16b583e67bf80ef8e1ce70fdaf5c43 | dbdbf50a7c3cc938d06c99ab74677f29 | returns the closest enemy base to a given point | List<ActionFigure> enemyList = new ArrayList<ActionFigure>();
ActionFigure closestEnemy = null;
double closestDistance = 100;
for (int i = 0; i < mGameThread.worldMap.length; i++) {
for (int j = 0; j < mGameThread.worldMap.length; j++) {
if (mGameThread.worldMap[i][j] instanceof ActionFigure) {
if (... | 0 |
fceac10180d1e08a549abdc5740eb3d7 | 919860559f09c79916b12789c47737b0 | Save all the information necessary to the Report G | BetReport report = new BetReport();
report.setTotalInvestmentPerCustomerID(getCustomersInvestment());
report.setTotalInvestmentPerBetType(getInverstmentPerBetType());
report.setTotalBetsSoldPerBetType(getTotalBetsSoldPerBetType());
report.setTotalBetsSoldPerHour(getTotalNumberOfBetSoldPerHour());
return rep... | 0 |
2b9bd7cea86881da3252134cdd555ec3 | 48072e138fa9c2de2d9cd7577ed8b9df | Returns the meta object for enum '{@link Cinema_ProfArq.LocalityEnum <em>Locality Enum</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_EveComponent_locLongitude_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_EveComponent_locLongitude_feature", "_UI_... | 0 |
34eeee20e924c2fa613586921906f124 | f66349c621768c9ab29947aac163e10d | Before each test case is called, empty out the environment | class RequestTest extends TestCase
public function setUp(): void
{
$this->originalEnvironment = [
'post' => $_POST,
'get' => $_GET,
'cookie' => $_COOKIE,
'server' => $_SERVER,
'env' => $_ENV,
'files' => $_FILES,
];
... | 1 |
acaef9bc8c6fd151be8a23cdff933ac7 | 56ce1d70475c084984ef47e19948861d | 当viewPager子界面切换后,选中某个RadioButton | public void onPageSelected(int ix) {
int rids[] = getTabIds();
if (rgTabs.getCheckedRadioButtonId() != rids[ix]) {
rgTabs.check(rids[ix]);
}
switch (vpPagers.getCurrentItem()){
case 0:
rootView.findViewById(R.id.iv_head_left).setVisibility(View.VISIBLE);
rootView.findViewById(R.id.iv_head_right).... | 1 |
818e12adecf63d9676ae669d07d83805 | 62c210b6b833701d86e7e898e5437479 | Get the normal of the triangle defined by the given vertices. Please note
that result is not normalized. | public class Lab_PA4 extends JFrame
implements GLEventListener, KeyListener, MouseListener, MouseMotionListener
public static Point3D computeTriangleNormal(Point3D v0, Point3D v1, Point3D v2)
{
Point3D e0 = v1.minus(v2);
Point3D e1 = v0.minus(v2);
Point3D norm = e0.crossProduct(e1);
if(norm.magnitude()>0.0000... | 0 |
5c0fd2af089401b7fc9d6b9dbf935876 | 45fcd59748a73d31a7ccde97902e1c7e | Esse método carrega as demais informações nos outros controles, ao se mudar o texto da comboBox numMesa. | {
bs1.DataSource = nos;
bs2.DataSource = nos;
bs3.DataSource = nos;
bs4.DataSource = arestas;
comboBox1.DisplayMember = "nome";
comboBox1.DataSource = bs1;
comboBox2.DisplayMember = "nome";
comboBox2.DataSource = bs2... | 0 |
7103230912803aec62691451895b9920 | a2dc32662c95a249ec322c1bdfdd71c0 | Tests user signup with a username that already exists | def test_cant_signup_with_existing_username(): | 1 |
f2e952d8911ebcc59c05119a351b5b4d | ad9465917d482468021adeaa9159311a | 写入数据(通过生成器) | func writeData(rw *bufio.ReadWriter) {
go func () {
for {
time.Sleep(5 * time.Second)
mutex.Lock()
bytes, err := json.Marshal(Blockchain)
if err != nil {
log.Println(err)
}
mutex.Unlock()
mutex.Lock()
rw.WriteString(fmt.Sprintf("%s\n", string(bytes)))
rw.Flush()
mutex.Unlock()
}
... | 1 |
66ad9a00aaa0ca846ce28d4a21624f0b | f81ea76b1b2584016dc716235f822711 | 접수문서의 결재하지 않은 다음 결재자 | namespace LiteOn.GDS.Utility
public class SPMAppLine
static public string GetNextApprover(string ApproveLineXML)
{
return FlowXMLParse(FlowParseType.NextApprover, ApproveLineXML);
} | 1 |
53f62fc018b6191556210857cade567c | eeeef221af4db8e6099b307be8ffd264 | Процедура сохранения адреса клиента | {
return _dal.SaveAddress(userId, provId, cityId, contId, det, userName, mobile, zipCode);
} | 1 |
26b7d954def2b8eb8a364f38aa4f0614 | 1553878360add9281d33aaf6df742ffe | Возвращает заголовки 404 | class BMC_SiteMap
static function GetErrorPage()
{
header("HTTP/1.1 404 Not Found");
$siteMap = array();
$siteMap['Name'] = "Ошибка, страница не найдена";
$siteMap['Description'] = "Ошибка, страница не найдена";
$siteMap['Alias'] = "error";
$siteMap['PageId'] = -404;
$siteMap['Visible'] = true;
... | 1 |
9363f332e4ddb89875897127056c9b56 | 56bb08509fe4e0159b0fdd2820058e51 | 枪械特殊信息(保存) | {
StringBuilder strSql=new StringBuilder();
strSql.Append("update gun_info set ");
strSql.Append("GUNARK_ID=@GUNARK_ID,");
strSql.Append("UNIT_ID=@UNIT_ID,");
strSql.Append("GUN_NUMBER=@GUN_NUMBER,");
strSql.Append("GUN_TYPE=@GUN_TYPE,");
strSql.Append("GUN_STATUS=@GUN_STATUS,");
strSql.Append... | 1 |
94768e1aa928117d50d95c12cc69ad0f | 59290379ae0c08105d4cff67dac38f4a | Set the state of the connection examiner tool. Resets the selected node when toggled. | {
if (IsActive)
{
if (IsSelected)
{
CurrentState = (currentMode == ClusteringToolMode.Simple ? SimilarityCriterionState.SimpleFocused : SimilarityCriterionState.AdvancedFocused);
}
else
{
... | 0 |
b33796e50ac14cb894c2a8d71a1347e7 | 0dc13105357c24bf8cd17ac8f6cb22e8 | Creates the print transaction view model. | namespace ADit.Interfaces
IPrintTransactionListView CreatePrintTransactionViewModel(IList<IPrintTransaction> PrintTransaction, string message,
int selectedPrintTransactionId, int selectedUserId,IList<IMessage>messagesList,IList<IReplies>replies); | 1 |
37649970193958227a6d1845f4bb8446 | 5d3e38e9e5a007cad39d65182696a733 | Return the last access time of a file, reported by os.stat(). | public function fileatime($path); | 1 |
b38203e9aa6a2f5fb1550a40707f73a0 | 276201653bb7ad6ff0f007b0bbcd38fc | listを持つdictをnumpy.arrayに変換 | lst = []
for k, v in d.items():
lst.append(v)
mat = np.array(lst)
return mat | 1 |
e8da66ec6ab89a1e69323301c4490f8f | e7f902f6f4b684524ac6b733fde3e856 | Decrypts the supplied ciphertext using the supplied substitution key. | def decrypt(ciphertext, key):
return encrypt(ciphertext, 26 - key) | 1 |
6d8074f04dc8023bf82a1b6448d2caf7 | 6931bf44be5f42c6f7a6473c0531619b | Adds a paragraph with no content. | Paragraph createParagraph(); | 0 |
97822adf69f40b5fe906a61eb673da68 | a9ce008c142f557aee19ab06be8b5f90 | Sets the agent kyc approval pending. | public class DashboardDTO
public void setMerchantKycPending(String merchantKycPending) {
this.merchantKycPending = merchantKycPending;
} | 0 |
ff6374123f76a72e0dc92f211dd64e97 | 6208d990d8580371c86fc82b91822f91 | Count book number written by author | class AuthorController extends Controller
public function index()
{
$query_num = DB::table('book_author')
->select('author_id', DB::raw('count(book_id) as book_num'))
->groupBy('author_id')
->get()->toArray();
foreach ($query_num as $query) {
Author::w... | 1 |
ceb61bb74da1975363eaed0815f83ce0 | 4820a707f3dcd223601407f55dc2caa7 | 编辑信贷经理信息 | class CreditLogic extends Logic{
public static function doEdit($data){
try{
$totalAmount = $data['total_amount'];
$creditId = $data['id'];
$isAttachment = false;
if(isset($data['credit_file']) && is_object($data['credit_file'])){
$result ... | 0 |
fb9a845ffc8faf36eed58bc7e1817f3b | 49fa694da2c562563515f85d85f59242 | Takes various CORBITS outputs and sums the probabilities. | multiplied_probabilities = input_1 * input_2
fused_probabilities = multiplied_probabilities / np.sum(multiplied_probabilities)
return fused_probabilities | 0 |
b4c32539aaa8a24bdf92d8655419ffbe | ac50a682e80c10401abf59c702b9d679 | Passing the same value to an attribute does not result in duplication
only where appropriate | class Pro_View_Helper_BodyTagTest
extends PHPUnit_Framework_TestCase
public function testPassingSameAttributeValueTwiceSeparatedDoesNotResultInDuplication()
{
$this->_helper->bodyTag('class', 'top')
->bodyTag('class', 'bottom')
->bodyTag('class', 'top');
$this->assertSam... | 1 |
c0612f9273c34a6310406fb421c1b370 | 8da350898072b9272b85a7c1c955abf8 | Devuelve el jugador que ganó la última vuelta. | namespace API
PlayerAPI getWinner(); | 1 |
bd64791eb1281ca66687d6223e0ddcb6 | c4bee2f89d444132e73e795b0114e6ed | Lista os modelos por marca | class MarcaController extends Controller
public function index(Request $request)
{
if (!$request->ajax()) return redirect('/');
return Marca::all();
} | 0 |
d4713aad27367edfb3ecbb69575c37e0 | 448b9210757a3c1a73b0656b2c44622d | Removes an item from the data source; calls [remove] in its default implementation. | namespace System.Windows.Controls
[TemplatePart(Name = DragContainerName, Type = typeof(Canvas))]
[TemplatePart(Name = DragDecoratorName, Type = typeof(DragDecorator))]
[TemplatePart(Name = InsertionIndicatorName, Type = typeof(Path))]
[TemplatePart(Name = InsertionIndicatorContainerName, Type = type... | 1 |
2f7315947ec3087cada3789432540f40 | c2ad450e1809f6ba1839731e1b608217 | Function that calculates the levelized cost of energy. | class OptSys:
def update_LCOEnergy(self, m):
for N in m.Node:
for F1 in m.Fuel1:
conv = self.unitConv[m.F_unit[F1]]['conv']
for Y in m.Year:
for D in m.Day:
for H in m.Hour:
for sH in m.SubHour:
... | 1 |
450c859fffd4990b6b60fb18a6f5e7a9 | a3fbcad87a0f6d18f9163ecda77b648f | Gets a predefined point by its identifier. Expects the return of a point. | public class PointServiceImpl implements PointService
public BizObject getById(String id) throws SQLException {
return QueryFactory.getInstance(PointService.TABLE_NAME).getByID(id);
} | 1 |
7cf0e550ae41100eeb7bb0fd1f2fcfdb | 5edfcffa72511d39cabbe4f073c2187e | The name of the database containing the schema. | final class SchemaDatabase extends ObjectSerializable
function getName(): string {
return $this->name;
} | 1 |
0a7f27232a50b13c93d5270b43c3cd9e | 4fa524a2a437cad1e660466a011d949b | This function outputs the current directory that we are in. It then passes
back a pointer to that directory. | int pwd()
{
printf("Current directory: %s\n", getcwd(NULL, 0));
return 0;
} | 0 |
e5ca82b5db9a5a875cc55e653c76ff2f | 81efde7293d002ffeb9a67a6e1892abf | 经期记录(添加与删除) | $data = Request::instance() -> param();
if($data['status'] == 1){
$res = db('customer_periodsetting') -> field('before,day,cycle,law') -> where('openid',$data['openid']) -> find();
if($res){
$before = $res['before'];
if(strtotime($data['date']) < $... | 1 |
ed4964d0228c7aee7bff87d1e2dbc7a8 | ab00ebd8910e636ec2fa1249d4c9ce0e | Return an RGB numpy array of the current window | def fig2rgb_array(fig):
fig.canvas.draw()
buf = fig.canvas.tostring_rgb()
ncols, nrows = fig.canvas.get_width_height()
return np.fromstring(buf, dtype=np.uint8).reshape(nrows, ncols, 3) | 1 |
9c229a959a05b81c27cfc111819e3ba3 | e75cd0f413ccfea2f62984aeb14dfd2b | Retrieves a stored Object.
[IOException] is thrown while deserializing. | Object result = null;
ObjectInputStream in = null;
try {
in = new Deserialiser(new BufferedInputStream(new FileInputStream(filepath)));
result = in.readObject();
in.close();
in = null;
} catch (IOException | ClassNotFoundException ex) {
... | 1 |
2da52b26b355afce8343b434860cc7f0 | 9f2be6f06f04abee66057cf9a8a8d4ae | 下一张图 | function next(){
var _len=$(".zxdetail .showBIgImg").length-1;
if($(".showBIgImg").index(that)==_len) return;
that=$(".showBIgImg").eq($(".showBIgImg").index(that)+1);
judge(that);
} | 1 |
93d4a91616dcaa95ce4ca10556477e93 | 7cf86fc6d11dd9f504fd869aa8717669 | Gibt das zugehörige ReviewSearch zurück | class AdvancedSearchReviewerFilterForm extends Form
function getSubmission() {
return $this->_submission;
} | 0 |
be8b1057a48d2be7a0086844b1ed34e5 | c2fb170c0f3c4a23d6d5bc641166f363 | Check set and get of fill value works for bare Column | init = InitFromCsv(test_csv)
cmp = Component('star')
cmp.set('v')
cmp.set('Teff')
init(cmp, 'b.fits')
assert -10 == cmp['v']
assert None == cmp['Teff'] | 0 |
7036bca2546e9cd2d7ec7ec2b83b916d | fbdce732158ca347e7c6c3cb5721fa40 | Provider for events to test.
Passes an event name and an event object for each test case.
Here we use all the events defined in the rules_test_event test module.
Array of array of values to be passed to our test. | {
return [
['url', 'http://example.com/', 'http://example.com/'],
['events', 'status_lead', ['status_lead']],
[
'events',
[
'add_contact',
'update_contact',
'delete_contact'
... | 1 |
4d7b581e29782f78f3062126a8074698 | bef919ba4c0e2331ba2e2bf2af59cbb7 | Sign a message hash and return a 65-byte recoverable signature. This is a 64-byte
compact signature with a recovery ID byte appended; and from which the public key can
be immediately recovered. | class IcxSigner:
def sign_recoverable(self, msg_hash):
private_key_object = self._private_key_object
recoverable_signature = private_key_object.ecdsa_sign_recoverable(msg_hash, raw=True)
return private_key_object.ecdsa_recoverable_serialize(recoverable_signature) | 1 |
d9b987671d2a23312c99422fa0a402ce | 766b9c98c79b1ca6a83b194551848586 | Clears the list of selected nodes | void FGraphSelectionManager::ClearSelectionSet()
{
if (SelectedNodes.Num())
{
SelectedNodes.Empty();
OnSelectionChanged.ExecuteIfBound(SelectedNodes);
}
} | 1 |
a3eefd158aa409107cde1973ccf3a6df | f4661a4c8f36ef1d2c9a2ea17b4ad45d | Adds a visit to a user. | public class VisitsPersistence
public void addVisitRecipe(User user, Recipe recipe) {
try {
int id_user = user.getId();
int id_recipe = recipe.getId();
String insertVisitQuery = "INSERT INTO `visits`(`id_user`,`id_recipe`,`liked`) VALUES (?,?,?)";
java.sql.PreparedStatement preparedStatement = dbConnecti... | 1 |
2864d73615eeb80fda8e43a25e538ea4 | ab1b32edc6314d87a341419b9ca5684a | Remove extra white space from within the address: extra spaces, etc. | while(IP.startsWith(" ")){
IP= IP.substring(1,IP.length()).trim();
}
while(IP.endsWith(" ")){
IP= IP.substring(0,IP.length()-1).trim();
}
return IP;
} | 0 |
ec8cb44eea2d9d8733241c0d7929019f | a326e4aecaac560a46e942fc7b67582b | Handle the response from the BloomSky API for this sensor. | class Kettle
public function handleResponse($response)
{
$response = $this->sanitizeResponse($response);
$this->state->setDateTime(new \DateTime('now'));
if ($this->isDiscoveryResponse($response)) {
$this->state
->setStatus(Config::INIT_STAT_DISCOVERED);
... | 1 |
78e4268008dd010622c008f744fa678c | f5105c0887400b46b1afcc03f7e7ff8e | POST TRAITEMENT : supprimer les routes avec des zéros | namespace Manchot
class Traitement
public static double[][] supressionBruit(double[][] measuredData )
{
double[][] resData = measuredData;
for (int i = 0; i < measuredData.Length; i++)
{
for ( int j = 0; j < measuredData[i].Length; j++ ){
... | 0 |
3dcd821cdfc58a1db0b428e44813d910 | 8cafc118c46591362d503fbce7d7a117 | Compute the length to the start of the segment. | if i == len(self.segOffsets) - 1:
return self.end - (self.start + self.segOffsets[-1])
elif i < len(self.segOffsets) - 1:
return self.segOffsets[i+1] - self.segOffsets[i] | 0 |
0524d3079924c822b4a0a39ad2d7b8b6 | 086caa86a2cb39c52b667e5b0fcf8678 | Returns the meta object for the attribute '{@link org.openhealthtools.mdht.mdmi.Bag#isIsOrdered <em>Is Ordered</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DropSequenceType_ordered_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DropSequenceType_ordered_feature", "_UI_Dr... | 0 |
0632f9e186094a7322d02733097498f0 | f86bf34332910528552c41b983af42de | Returns the meta object for the containment reference '{@link com.specmate.objectif.dSL.OR_Node#getSubNode <em>Sub Node</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getNodeExpressionOr(); | 0 |
31cbdab0f2d2757fa9ed39100375a099 | a42c77aa1e6b3be3f8e23da0f870950a | A context manager for timing out steps in a test case | def raise_on_timeout(secs: Union[float, int]) -> ContextManager[None]:
secs = float(secs)
with set_signal(signal.SIGALRM, err_callback):
with set_alarm(secs):
yield | 1 |
9f47b2e3e684338bb22438dd59b98391 | a56ac377300d867b2f15a323d8ffb7ba | Generate a transform sequence that best describes
an image using greedy search
Input: feature vector of a texture
Returns: the transform sequence corresponding to that texture in the range(1, max_len) | transforms = [lis.pop(0)]
for item in lis:
transforms.append(transforms[-1]+item)
return transforms | 0 |
3d5c86abdcdee61711800cfcd55eaabf | f58ce5b838fef50bce77c38e2ddc896a | Prepare the welcome notice on plugin activation.
We can't hook into admin_notices at this point, so instead we set a short
transient, and check that transient during the next page load. | class CVWP_Plugin{
static function activate_about_page(){
set_transient( 'cvwp_about_page_activated' , time(), 30 );
} | 1 |
a45b3b3f74d659ecbfac1433d23c1134 | 991bf95f12a1d932ea594758c524ddd5 | Get all real estates as an observable sequence. | namespace RealEstatesAPI.Controllers
[Authorize]
[Route("api/[controller]")]
[ApiController]
public class RealEstatesController : ControllerBase
[AllowAnonymous]
[HttpGet]
public ActionResult<IEnumerable<RealEstateForListDto>> GetRealEstates([FromQuery] SkipAndTakeRP skipAndTakeRP)
... | 0 |
e67d4e92726382cc3b7dec802206627a | dcc3b70f882ff63b6f3e9464a76fec16 | 等额本金计算获取还款方式为等额本金的每月偿还本金
<p>
公式:每月应还本金=贷款本金÷还款月数 | String str=null;
double monthRate = rate/12;
double monthCapital = Math.floor(money/months);
double trueMonthCapital = 0d;
int om = (int) (money%months);
double residualMoney = money;
double monthInterest = 0d;
double totalMoney = 0d;
System.out.println((str="等额本金还款"));
StringBuffer sb... | 1 |
1452066475fb7ca6979f0e675425ebde | a788fdb690de76d2260e9364b7b2ce61 | Parse up a build string, returning a dict | if not os.path.exists(build_file_path):
return None
try:
exec(open(build_file_path, 'rU').read())
except SyntaxError as e:
raise BuildParseError(build_file_path, e.lineno, e.msg)
build_file = {}
for var_name, var in locals().items():
if var_name in {'build_file_path', 'build_file'}:
cont... | 1 |
f048488d38d8849f726c055ff2f288a5 | a94f37860ff686d7567f35800a266cd0 | Simple initialization method that gets the stock's ticker | this.isLoading = true;
this.stockList = [];
try {
this.stockList = await this.stockService.fetchTickerSymbols();
} catch (error) {
this.notificationUtil.sendErrorMessage(error.message);
} finally {
this.isLoading = false;
}
} | 1 |
5eacddc3e273923a6a8a5e75cc6227f2 | 5a7a03b223ab9460ac51fc0978406997 | Display Name: Continue Sequence Condition
Default Value: 0
Value Format: decimal
Available enum values: No information, 0, Sequence to follow-immediately, 1, Squence to follow-soon, 2, Sequence to follow-delayed, 3 | {
# line 627 "../sncExample.stt"
if (seqg_var->statusFlag == 10)
{
*seqg_pnst = 0;
*seqg_ptrn = 0;
return TRUE;
}
# line 632 "../sncExample.stt"
if (seq_delay(seqg_env, 1))
{
*seqg_pnst = 6;
*seqg_ptrn = 1;
return TRUE;
}
return FALSE;
} | 0 |
6d0986a8738220c77a2c28a11aa8c7a9 | 29333ed99f62bdbfa6e91bbb09ef63a7 | инициализация значений статуса документв | namespace Kesco.Lib.Entities.Documents.EF.Applications
[Serializable]
public class Vacation : Document
private void Initialization()
{
Type = DocTypeEnum.ЗаявлениеНаОтпуск;
PersonFromField = GetDocField("1479");
EmployeeFromField = GetDocField("1277");
Com... | 0 |
0f0b432c1b9c6f316e84daa7ffbb5ce4 | 424ec334df2b1c31cb97d1a8e7740886 | Used to reorder an object up in the display list // | void ObjectDisplayList::SortForViewpoint(void)
{
DrawableObject *p;
DrawableObject *q;
if ( not head) return;
for (p = head->next; p not_eq NULL; p = p->next)
{
q = p;
while ((q->prev) and (q->prev->distance < p->distance))
{
q = q->prev;
}
if (q ... | 1 |
569d208176ea6d7dedf688fe62ec1149 | 00cc9437ecdaf7320562ae54a513538f | Returns true if and only if the client should render the landscape.
When the landscape is not rendered, all of the following will, as
a result, not be rendered: | public boolean isRendered(); | 1 |
c77c8856afdde9c60bea86d817ce515a | b5a0407b670fb2cfb79374362b036c02 | The total size, in bytes, of all leased messages. | class Leaser(object):
def message_count(self) -> int:
return len(self._leased_messages) | 0 |
ea7946c13ec4b427395c7394cda9232a | 3d71b700e0dfd34e3344e29f9657320d | r"""
Returns the initial camera transform of the fitting process. | class Result(object):
def initial_camera_transform(self):
return self._initial_camera_transform | 1 |
ab736b5a25e7978cfb8d314363c0e6e4 | 77ed596832ac9f7351d0f1ca1e1d4e31 | ##########compute PDF value of gaussian############## | D <- length(mu);
1/((2 * pi)^D * sqrt(det(sig))) * exp(- t(x-mu) %*% solve(sig) %*% (x-mu) / 2)[1];
} | 1 |
37fa3ade79608f2004b715373cb56d92 | 2be0b34579c2ee9b6c072efcea384d71 | Test de vérification des CHECK automatiques en cas de délai dépassé (et possibilité de checker) | {
$em = $this->getContainer()->get('doctrine.orm.default_entity_manager');
$subDomainUser = $em->find('BBDurianBundle:User', 3);
$subDomainUser->setSub(true);
$domainAutoRemit = $em->find('BBDurianBundle:DomainAutoRemit', ['domain' => '3', 'autoRemitId' => '2']);
$em->remove(... | 0 |
5d56fa8e811c01739d9dd7ba7bf2a537 | f410cf9a932e95cdcdb5d39f3022af12 | добавление элемента в ListView, значение указываем в LE_nameElement в правой части формы | {
ListViewItem Item = new ListViewItem(array[0]);
for (int i = 1; i < array.Length; i++)
Item.SubItems.Add(array[i]);
LvWifi.Items.Add(Item);
} | 0 |
ef4c20350ae18c227c386e024e548d90 | d35bdb3ca89595f2c2a66f588e8c6ec1 | Функция должна эмулировать событие click для элемента target | var clickEvent = elem.ownerDocument.createEvent('MouseEvent');
clickEvent.initMouseEvent(
'click',
true,
true,
elem.ownerDocument.defaultView,
1,
0,
0, ... | 1 |
964a773c3081ae03ba3902ab6aa5642d | 164b5997029a2b9b6ade4a4ebbc818f3 | Funcion para validar si un producto esta presente en el carrito | {
$respuesta=false;
$producto=Producto::findOrFail($id_producto);
if(!$producto == null)
{
$respuesta=true;
}
return $respuesta;
} | 0 |
c4407cde7c29a81fc176e2a389d42425 | 9786fce5ca4d8f414c9dbba5110547af | Set textview 'tv_question' to a question. | public class TriviaGUI extends JFrame
protected void setQuestion(String question) {
questionTextArea.setText(question);
} | 0 |
b924261d7c8845771b4d71184a96a772 | 7a179a7e36be2a61907663732bdca04b | Strict mode is only available on gingerbread or later | if (hasGingerbread()) {
StrictMode.ThreadPolicy.Builder threadPolicyBuilder = new StrictMode.ThreadPolicy.Builder().detectAll()
.penaltyLog();
StrictMode.VmPolicy.Builder vmPolicyBuilder = new StrictMode.VmPolicy.Builder().detectAll().penaltyLog();
StrictM... | 1 |
fdf295d11d75ae684ec2e2b48c5608ab | 5a797bd52ff5b7a7fe29f7ebb68ca5be | System.Collections.Generic.List`1/Enumerator<!0> System.Collections.Generic.List`1<UnityEngine.EventSystems.RaycastResult>::GetEnumerator() | Il2CppObject* U3CCreateOfTypeIteratorU3Ec__IteratorC_1_System_Collections_Generic_IEnumerableU3CTResultU3E_GetEnumerator_m2665668891_gshared (U3CCreateOfTypeIteratorU3Ec__IteratorC_1_t4154598408 * __this, const MethodInfo* method)
{
U3CCreateOfTypeIteratorU3Ec__IteratorC_1_t4154598408 * V_0 = NULL;
{
int32_t* L_0 =... | 0 |
27b32250d143e8b7a242b4e15d85e349 | cd1df3866a5a557c9b778d873ea03d1c | Save PDF file from response | class ADSPaper:
def save_pdf(self, filename):
request = urllib2.urlopen(self.pdf_url())
with open(filename, "wb") as f:
f.write(request.read())
return | 1 |
166039978cfbd1453acf41888602cd4a | db9725899f7fcdd30326bb56257a7c70 | Post semaphore when interrupt is thrown by the accelerometer | {
IMU *imu = (IMU*) (arg);
assert(imu != NULL);
xSemaphoreGiveFromISR(imu->getSemaphore(), NULL);
} | 1 |
d2716846170f356a71405bbfab4dde2f | cb645fb8a7e9f1e3c39ca820d47e4d78 | 根据传过来的urls集合,并行抓取url对应的内容,抓取方法由WebTaskReader子类实现 | class TabAndI(object):
def crawl_url_list(self, urls):
process = CrawlerProcess(get_project_settings())
process.crawl('tabs', start_urls=list(self.only_new_urls(urls)))
process.start() | 0 |
b92ff0bbb29aa68519a9be83d2a53c3f | a6575398dd7170273cc713a0db43c248 | TestCrawlerTaskRequest will test a crawler task request in general so its getters and setters. | taskHolderLoader = JsonLoader()
taskHolderLoader.loadFromFile(self.__jsonConfig)
crawlers = FsCrawler.createFromPath(BaseTestCase.dataTestsDirectory()).glob()
temporaryDir = tempfile.mkdtemp()
dispacher = Dispatcher.create("local")
outputStream = io.StringIO()
dis... | 0 |
ec7b82f5f21400aa0219e8f8723df92f | 4306817ea444c7707bd7c2a027990e2d | Saves Entries through the HashMap object in file in JSON format. | ObjectOutputStream outputStream = null;
try {
outputStream = new ObjectOutputStream(new FileOutputStream(logPath));
outputStream.writeObject(entries);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (output... | 0 |
6731c50f726a11b33c8bd1cfbd65fc2c | 8c354351201c0cdb163750ceae7c8b91 | Setting options, e.g. validation groups. | class UserType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'validation_groups' => ['edition'],
]);
} | 1 |
6e38f897bdc199cf68dceddb629590c9 | d452fb84a5b960869ee99529070eb81e | Reads the odd lines from the given file. | susp_data = csv.reader(open(input_file, encoding="latin-1"), delimiter=',')
sorted_susp_lines = [susp_line for susp_line in susp_data]
return sorted_susp_lines[1:] | 0 |
32f7ca483aca3ee3b4796cd44bd37c94 | 5daa53548225d1ed2acc256c81bcce5a | 删除文件和数据库记录 | class DeleteFile extends Action
public function deleteFile($related, $file)
{
$fileid = $file['fileid'];
$transaction = Yii::$app->db->beginTransaction();
try {
$result = NetdiskRelated::removeRow($related);
if (!$result) {
throw new Exception('Remove... | 1 |
6d84bafd905eaac09a414b9cc9ef5499 | 7f63a6393a4f2b1dc362b4c0c8ba76d4 | Counts the masked pixels. | def count_mask(input_mask):
mask_vol = nb.load(input_mask)
mask_data = mask_vol.get_data()
return mask_data.sum() | 1 |
db1f3be032aa1a3f0e59f0cce48488c2 | f6783f30abe5fcacb895eb851d985739 | loads a named label pointer
(needed for mobile process initialisation) | uint32_t pool_hash = pool_name.fnv1a();
uint32_t ins = FindLabelIndex(pool_hash, labelPools.getKeys(), labelPools.count());
while (ins < labelPools.count() && pool_hash == labelPools.getKey(ins)) {
if (pool_name.same_str(labelPools.getValue(ins).pool_name)) {
return &labelPools.getValue(ins);
}
ins++;
}
r... | 1 |
5836fa979bc5960c23617bee0c20a9e1 | 17c282ebfbb98e773f2e6064318d281a | Return the point of intersection of two lines as given.
Lines are pairs of (absolute) points.
If there is no intersection, return None. | p1, p2 = l1
p3, p4 = l2
(X1, Y1), (X2, Y2) = l1
(X3, Y3), (X4, Y4) = l2
s1 = slope(p1, p2)
s2 = slope(p3, p4)
if s1 == s2:
b1, b2 = (None, None) if s1 is None else (Y1 - s1*X1, Y3 - s2*X3)
if b1 == b2:
return (float('inf'),float('inf'))
else:
r... | 1 |
e0e868659b2efec6840bc6bc5f1f0119 | d2dc5eda3ea696de40fcf061831d7b3a | 管理者のみの項目に対する更新 | class Master extends AbstractFormTable
public function updateByKubun($posts) {
if (empty ( $posts ['kubun'] )) {
return false;
}
$kubun = $posts ['kubun'];
unset ( $posts ['kubun'] );
$maxId = $this->getMaxId ( $kubun );
foreach ( $posts as $fieldset ) {
if (isset ( $fieldset ['id'] ) && ($fieldset ['... | 0 |
99879458a76b16cc43925afd69ad33a5 | 903eaa490c51a037f951828ac14c93d7 | On envoie une requête sur l'API OMDb à partir du titre entré par l'utilisateur, puis on crée un objet film qu'on ajoute à la collection | class APIController extends Controller
public function store(Request $request)
{
if($request->input('Title') != '')
{
$title = $request->input('Title');
$att = ['Title','Year','Rated','Released','Runtime','Genre','Director',
'Writer','Actors','Plot','Langu... | 1 |
5e5833d8d7755b7945731194795bbf14 | 79e8d267ae012e3b91bd0fc1a97ee6f6 | Returns a boolean indicating whether a datastream for a piddable object
exists in the Fedora repo | force=False):
http_args = {}
if logMessage:
http_args['logMessage'] = logMessage
if startDT:
http_args['startDT'] = startDT
if endDT:
http_args['endDT'] = endDT
if force:
http_args['force'] = force
url = 'objects... | 0 |
4be8417fa308209464b9bd21ce6b8295 | 4245afbfe9e31d0a873c25626868c079 | calculate the Pearson correlation and return ( 1 - Pearson correlation ) | def pearson_r(x, y):
corr_mat = np.corrcoef(x,y)
return corr_mat[0,1] | 0 |
38690b00f3e48503376a589dccc79c2c | 8686cc988f05d4abeabb0fba25f00652 | 根据字符串创建svg | public class SvgIcon implements Icon
public static SvgIcon create(String svg) throws IOException {
SvgIcon res = new SvgIcon();
res.setElement(SvgIo.read(svg));
return res;
} | 1 |
5d12f810123920a60fe5b4ea68276d97 | 0e94d845bff66d741707fea76c10fc45 | 己方子弹不会伤害己方坦克 | @Data
public class Bullet
public void collideWith(Tank tank) {
if (this.group == tank.getGroup()) {
return;
}
Rectangle rect1 = this.rect;
Rectangle rect2 = tank.rect;
if (rect2.intersects(rect1)) {
tank.die();
this.die();
int eX = ... | 1 |
2ab12713732b5c6d7374eed914a6d346 | ba6872a6ab9bc4e171b9738d64785952 | does : frees all data associated with one triangulation | void multi_free(multiStruc *multi){
multi_free_coarsest_matrix(multi);
for(int i=0;i<=multi->maxlevel;i++){
free(multi->quads[i]);
free(multi->up[i]);
free(multi->hanging[i]);
free(multi->hanging_info[i]);
free(multi->map_glob[i]);
free(multi->u[i]);
free(... | 1 |
1142fcff24509d84b0b4b28534b6c311 | b2b9ca6277aea9efbd5f206d41f8133a | 设置要加入的根布局对象。根据根布局获取键盘弹起、隐藏、键盘高度 | if (activity instanceof Activity){
View rootView = activity.getWindow().getDecorView();
_addKeyboardListener(rootView,listener);
}
} | 1 |
e0838b0b4e2dfd2d9ddd3398fe062e32 | 33c34ee2a48c4a828e62de7663abaae3 | プレイヤーの強制移動するためのドラッグアンドドロップイベントを設定する | function setDragDrop( canvas ) {
canvas.ondragover = function () {
return false;
};
canvas.ondrop = function ( evt ) {
let file;
if ( evt.dataTransfer.files.length === 0 ) {
return false;
}
file = evt.dataTransfer.files[... | 0 |
dbc2fa7bbe93f9159ff847816575d8af | 2a683d2ca86bca71e645d1a0c40eae7a | Updates the specified BAM activity milestone with the specified value. | namespace EncompassRest.Loans.MilestoneFreeRoles
Task UpdateMilestoneFreeRoleAsync(LoanMilestoneFreeRole milestoneFreeRole, CancellationToken cancellationToken = default); | 0 |
e2ca098842cec059a7ebdcc2caa72a00 | caf127ed92ad9a09dd58ee104c02d132 | 외부 저장소 앱 전용 디렉토리에 파일로 저장하는 함수 | class FileExActivity : AppCompatActivity()
fun saveToInnerStorage(text: String, filename: String) {
val fileOutputStream = openFileOutput(filename, Context.MODE_PRIVATE)
fileOutputStream.write(text.toByteArray())
fileOutputStream.close()
} | 0 |
d0a348ce9693dd304f138c0c8e5a124d | f12c25ffcd6052dde748749361c14e8c | Destruye los alimentos instanciados despues de cinco segundos | {
while (true)
{
yield return new WaitForSeconds(1f);
PierdeComida(2*diametro);
}
} | 0 |
48591638b3d9c6e153f1f302c336cbda | fd00d5ee3ab05c48191c2dd741d05619 | function to move bewteen the two platforms | function movePlatform6($main, $movePlatform6) {
var x1 = $main.offset().left;
var y1 = $main.offset().top;
var h1 = $main.outerHeight(true);
var w1 = $main.outerWidth(true);
var b1 = y1 + h1;
var r1 = x1 + w1;
var x2 = $movePlatform6.offset().left;
var y2 = $movePlatform6... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.