query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7dc52a7520c911aeaf1ddb75e839997d | df16ec714e665b2aa65b84b00ba996cb | Update the segments for the copied text from the segments of the source text
First we need to get the segments for the source and destination paragraphs that
will be copied. | namespace VideoScriptEditor.ViewModels.Timeline
void CopyTrackSegment(SegmentViewModelBase trackSegmentToCopy, int destinationTrackNumber, int destinationStartFrameNumber); | 0 |
7e67a778ef23b9e53835e7a5808bfa47 | ee81302e3e69a60b50727a4218732d02 | 获得第二个数 | abstract public class Answer3Integer extends BaseArgsAnswer
protected Integer getArgs2() {
return (Integer) mArgs[1];
} | 1 |
87c97f218c653add2438439ea8827aab | 6d8c427641ae73235371d6335eadc6a4 | Retrieve all activities of the current user | public class ActivityService extends ConnectionsService
public EntityList<Activity> getMyActivities(Map<String, String> parameters) throws ClientServicesException {
String requestUrl = ActivityUrls.MY_ACTIVITIES.format(this);
return getActivityEntityList(requestUrl, parameters);
} | 1 |
382a51632233008eef64c3d35b2642e4 | 1874e5920876e79f1d7d44459e01c38f | the destructor is used to free up any previously
allocated memory | ANN :: ~ANN()
{
cout << "Destructing the ANN" << endl;
} | 0 |
d6ec5122107b6b8be45000fdf23895f7 | ddc3db2a4ddf5e6bb2002c3c4844920f | test editing a specific party. | class TestParty(BaseTest):
def test_get_party(self):
response1 = self.client.post(
'/api/v1/parties', data=json.dumps(create_party), content_type='application/json')
response = self.client.get(
'/api/v1/parties/1', data=json.dumps(get_party), content_type='application/json')
... | 0 |
07fb550cae3448ad9fd46b3b5e6e2400 | ebf588bdcc9ef4ecd22765b607d5713e | 发送数据并显示状态 | namespace SerialPortTest
public partial class Form1 : Form
private void button_SendData_Click(object sender, EventArgs e)
{
if (textBox_SendData.Text == string.Empty)
{
label_messageTip.Text = "发送异常:发送数据不能为空!";
label_messageTip.ForeColor = Color.Red ;
... | 1 |
7204091d8daf53f5f1727696cb03b0d2 | ddcc038d5a0998001bffa7679f011a83 | Update stage scrolling and background | gstate_Scroll1.XPI = RH2DWord(0x83a00, 6, g.CurrentStage, 0);
gstate_Scroll1.YPI = RH2DWord(0x83a00, 6, g.CurrentStage, 1);
gstate_Scroll2.XPI = RH2DWord(0x83a00, 6, g.CurrentStage, 2);
gstate_Scroll2.YPI = RH2DWord(0x83a00, 6, g.CurrentStage, 3);
gstate_Scroll3.XPI = RH2DWord(0x83a00, 6, g.CurrentS... | 1 |
b4c704b4072b73c3417065d75fbeaea0 | bbd04222894aa27aa3e1251ce74f9a3f | Parse a sequence of dot-separated decimal strings | {
char *value;
PetscErrorCode ierr;
PetscInt n = 0;
PetscTruth flag;
PetscToken token;
PetscFunctionBegin;
PetscValidCharPointer(name,2);
PetscValidIntPointer(dvalue,3);
ierr = PetscOptionsFindPair_Private(pre,name,&value,&flag);CHKERRQ(ierr);
if (!flag) {if (flg) *flg = PET... | 0 |
c47233fe9ad6f330ddd89e23d9b5da72 | a8e0dc39f9c9daa5f9a5555d5e763efa | uniform partitioned convolution execution step | const float16_t *bias_data, float16_t *col_major_input, float16_t *output_data, int task_id,
const ConvParameter *conv_param) {
#ifdef ENABLE_ARM64
const int tile_n = 16;
#else
const int tile_n = 12;
#endif
NNACL_CHECK_ZERO_RETURN(conv_param->thread_num_);
NNACL_CHECK_ZERO_RETURN(til... | 1 |
c725abab012ff44ee111c726e80e4014 | 525a707f7efe0d020109e194802f032a | f is a function that returns a boolean.
Filter elements of a list by whether f(e) returns true, where e is an
element of the list. | returnarr = []
for element in arg_list:
if f(element):
returnarr.append(element)
return returnarr | 1 |
b7f6b793a52d604c4ff37239034c2dae | 2cd1be06099fbd06476d86f9246749e5 | split into train and test set
train contains Jan 1, 2018 through July 31, 2018
test contains August 1, 2018 through September 28, 2018 | self._data_frame["Created At"] = self._data_frame["Created At"].str.strip()
training_data = self._data_frame.loc[self._data_frame["Created At"].str.startswith('2018')]
testing_data = self._data_frame.loc[self._data_frame["Created At"].str.startswith('2019')]
return training_data, testing... | 0 |
41d3dd97b30396e3629c4679fb0f7a04 | 11dfa9dfc65bb056dc40882372d58f6d | lua脚本测试 | public class testlua : MonoBehaviour
void Update () {
} | 0 |
50f1391218fe3dc8aaa62fc4873e9e50 | 230a498a05a126ed252a1155ae349eda | Note that empty strings will never be appended | void CNativeW::AppendStringF( std::wstring_view format, ... )
{
if( format.empty() ){
throw std::invalid_argument( "format can't be empty" );
}
va_list v;
va_start( v, format );
const int additional = ::_vscwprintf( format.data(), v );
const auto currentLength = GetStringLength();
const auto newCapacity = curr... | 1 |
44d922e1880755e2a6c7487ea7c70ce8 | 982845221911a1038089084977efcbe7 | 应用层通知EntityManager,某个属性发生了变化
如果是某个Embeddable对象发生了变化,需要通知引用此对象的Field发生了变化,
无论是直接引用,还是通过List,数组,Map引用。
如果某个属性发生了变化,但是没有通知EntityManager,
那么此属性的变化将不会保存到数据库中。
SimpleEntityManager没有采用Enhence机制来跟踪属性的变化,
主要是考虑到Enhence的实现比较复杂,短时间内确实无法实现。
以后的版本中,是否加入Enhence,还看情况而定。
此方法一般情况下立即返回,
但是如果指定的数据含有urgent为true,
那么此方法会立即将数据插入数据库中,然后才返回。 | System.out.println("EmployeeForm.onPropertyChange");
for (String path : paths) {
System.out.println("path = " + path);
}
} | 0 |
ee910132329f7f142f4e3960694b778b | ceff76570b26c225d674325b78ae65d7 | <p><em>Sets <see cref="AzureIotcentralAppListSettings.Verbose"/></em></p>
<p>Increase logging verbosity. Use --debug for full debug logs.</p> | public static AzureAppconfigRevisionListSettings SetVerbose(this AzureAppconfigRevisionListSettings toolSettings, string verbose)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Verbose = verbose;
return toolSettings;
} | 0 |
82ad0cf25a3596d8db7870612ecd5518 | d9bd390bb0b82b50c572998489d54b1f | Serialize the history to given path. | public abstract class DirectoryWatcher extends TimerTask
public void serializeHistoryMap() {
try {
FileOutputStream file = new FileOutputStream(historyPath);
ObjectOutputStream out = new ObjectOutputStream(file);
out.writeObject(dir);
out.close();
}
catch (Exception e) {
MonitoringView.getInstance(... | 1 |
c80b5aa6a52fc76e865d3824f162a02b | 6c4d0b130877fabe39e0740f319792ef | Criteria is a string representing the criteria parsed by the class
Results is a list (by default) which can hold/be changed to any desired return value
Complete is a boolean flag which parsers can use to disable themselves if they have reached a conclusive result | parsed_criteria = []
if not isinstance(criteria, list):
criteria = [criteria]
for template in criteria:
if not isinstance(template, dict):
raise ValueError(
"Each criterion MUST be an object, not %s." % repr(template)
)
... | 0 |
69e340f7ad045bb7ac31715e6bfeb00d | abe42631cbeac8cacf10b0b55246bc68 | stock削除処理が失敗することを検証 | public void testDeleteFailure() {
Assert.notNull(sampleService);
Sample sample = new Sample();
sample.setId(TEST_NOT_EXIST_ID);
String productNo = null;
sample.setProductNo(productNo);
Integer isGroup = null;
sample.setIsGroup(isGroup);
sample.setUpd... | 1 |
88ba59f1dab926a10a7dba1c3d85153b | 8782945045cbb48415b6687394ebda5e | Убирает оставшиеся строки при совпадении значений лицевой + период
если они уже есть в словаре | def _remove_duplicates_in_payers(payers_properties_dict: \
Dict[Tuple[str, datetime.date], Dict]) -> Optional[Dict[Tuple, Dict]]:
lines_for_delete: List[Tuple] = list()
if payers_properties_dict and type(payers_properties_dict) is dict:
for account_period_tuple in payers_properties_dict:
... | 1 |
1f1965f2c234eea51bcf73abaf318c53 | e9b6b4a05ce6614c070d252502d7e69e | Convert a python signature name into camel case
for java methods | def _c2s(name):
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower() | 0 |
607e018263e2c5aff36028c4bdb87b6e | b057650d448cb9ed1db76420cfec1fa8 | Returns a signed url pointing to an Encoding. (asynchronously) | class FlipApi
def cancel_encoding(id, factory_id, opts = {})
data, _status_code, _headers = cancel_encoding_with_http_info(id, factory_id, opts)
return data
end | 0 |
8978dc2b123519fb67a9df502bb2a979 | f66f41e443c9404a05564204883d236a | Create a root node for the graph, setting it's ID to 0 and making it the currently selected node | public class MedicalDiagnosisGraph
public void create_node(){
String n = generate_name(nodes.size());
nodes.addElement(new MedicalDiagnosisGraphNode(this, n));
convert_graph();
} | 0 |
fd5a0eb4fb1de47386b00efeb754ea14 | f483aa27564e291b3171d18be99addf5 | callback function that will be called when any moving object reaches its destination. Call param will be the moving object itself. | {
if (TraveledDistance() >= this.DistanceToTarget)
{
makeInvisible(true);
inMotion = false;
setPosition(xOrigin, yOrigin);
}
} | 0 |
0d9af9ce5b96e1dc157cd142624c1866 | 457c8a25eccf5a8c46fe6f568e23fc7c | Create a packet that uses a SCION path | public class Server implements Runnable
public static SOSPFPacket createLSPPacket(RouterDescription receivingRouter, Link link) {
SOSPFPacket packetToReturn = new SOSPFPacket();
packetToReturn.srcIP= rd.simulatedIPAddress;
packetToReturn.dstIP = receivingRouter.simulatedIPAddress;
for (L... | 0 |
55a6ad1d9107542e07137ce7e36c91e1 | 0a17650f7533ce8f5dc16fca183b2c55 | Move array element up | void CommandTable::upAction()
{
int current = this->currentRow();
if(current == 0) return;
this->swapItem(current, current - 1);
emit swapTable(current, current - 1);
} | 1 |
8c1e60fd3d62a62b8b3ee38d3b7fe163 | 641a188b905d472a21bf7c059c112446 | Fetch up to `cursor.arraysize` number of rows. | switch kind {
case bson.Array:
case bson.Null:
return nil
default:
panic(bson.NewBsonError("Unexpected data type %v for Query.Rows", kind))
}
bson.Next(buf, 4)
rows := make([][]sqltypes.Value, 0, 8)
kind = bson.NextByte(buf)
for i := 0; kind != bson.EOO; i++ {
bson.ExpectIndex(buf, i)
rows = append(row... | 0 |
34eed8597f90f8fff9bc8e4c52ba0b5d | 7279601ae1501c4d3cdd5fdd572c1f52 | Performs a search on all the tags of the audio tracks in this account, and returns a collection of audio tracks that
contain the specified tags. Note that tags are case-sensitive. | namespace Contract
ICollection<ISearchable> Search(IEnumerable<String> tags); | 1 |
ab8b1cc4647114889bd32d395fae993a | ea357d4272d1c9b3a854e896c712ed62 | Set images setting to the environement file. | class SettingController extends Controller
protected function setToEnv(SettingRequest $request)
{
$setting = setting();
$this->setProvidersToEnv(json_decode($setting->social_auths));
$this->setLanguageToEnv($setting->language);
$this->setAdImagesSettingToEnv($request->image_settings)... | 1 |
ead9664c562f56d43a1f54c91f48f1ff | 7d251e68c977d0e8c34f361c2729b23a | Returns the value of the '<em><b>Group types</b></em>' containment reference.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Group types</em>' containment reference isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | EList<GROUPType> getGROUP(); | 1 |
b72d2e4edaa3bdeb25a254839da1e27b | 2b4264df12e8be2dcf6cb0c8c62bada6 | Retourne le code d'autorisation utilisable (non expiré) correspondant au triplet passé en parametre ou genere une nonFoundServiceException si
rien n'est trouvé | class AccessProvider implements SecurityAccessProviderInterface, LoggerInterface
public function generate(Request $request, $clientId, $redirectUri, $username, $password = '') {
$ip = $request->getClientIp();
$user = $this->getUser($username);
$client = $this->getClient($clientId);
if(!$... | 0 |
b61bd482380020cb1f2f9975552646ca | 26950d9f5698e997b9a4a947bcdca18a | 대상의 계층 Path를 추출하는 재귀 함수 | class _net:
def getPath(self, nameLayerStart, nameLayerEnd):
dictPath = {}
listNameLayerNext = self.dictGraph[nameLayerStart]
for nameLayerNext in listNameLayerNext:
dictPath[nameLayerNext] = {}
if nameLayerNext == nameLayerEnd:
continue
elif 'output' in nameLayerNext:
del ... | 1 |
c6f06356270513f68bfbe349f3dfd1f1 | 925eabde1eed6fa2af2c18266ad42bb1 | Specifies if file has been closed. | public class RFPBinaryFile implements RFPBinaryFileI
@Override
public boolean isClosed()
{
if(rfpFile != null)
{
return !rfpFile.getChannel().isOpen();
}
return true;
} | 1 |
de0bb8f21a7e37b3cb22ea0b13de2fdf | d95d355ba9aaa564a54610600f1d5918 | Gestiona el formuario de creacción de colecciones de datos para que nunca puedan especificarse
tipos de reducciones de diferentes naturalezas. | function formatModelCreate(req, res, next) {
try {
req.controllerData = req.controllerData || {};
req.controllerData.data = req.controllerData.data || {};
const Datasource = periodic.datas.get('standard_datasource');
let user = req.user;
let organization = (user && user.association && user.associa... | 0 |
5f52d8a9c5b8afb55b9631849d9829ab | c8510374648a8cce055e4d808eee8aaf | TestObject 测试对象的存储 | @RunWith(SpringRunner.class)
@SpringBootTest
public class Demo3ApplicationTests
@Test
public void testObject() {
User user = new User(1, "onism", "1234", "Man", "老王");
ValueOperations<String, User> valueOperations = redisTemplate1.opsForValue();
valueOperations.set("onism", user);
Sy... | 1 |
ae266eb8a76070484b95dceeeb548e18 | 2aac9e1878fcab30e1e7805d4c951e98 | 查询人员状态清单 | List<Personstatus> getPersonstatus(); | 1 |
eb303c4d8de1eff66ea5868e479f6c5a | d9d0368a0c08a2e1fc34d97e8db70de1 | Float64 creates a new Float64Measure and prepares it for use. | m1.Type = 1
m1.Value = 10110
m1.Unit = -3
m3 = measures{42355, 1, -4}
m2 = new(measures)
m2.Type = 1
m2.Value = 12310
m2.Unit = -2
m4 = &measures{98355, 1, -5}
return
} | 0 |
69989cc77a0e51844d82bae718050c82 | 30fd0e209bc3a7a3277d8d10504d5ade | Verifica presenza e correttezza del file di configurazioni | function checkConfiguration() {
var ok = true;
ok = check(KEY_PATH);
if (!ok) {
console.log("(!) ERROR: Falta archivo " + KEY_PATH);
return false;
}
ok = check(CERT_PATH);
if (!ok) {
console.log("(!) ERROR: Falta archivo " + CERT_PATH);
return false;
}
ok ... | 1 |
ee53f8361ef4a40cd642912bca8140f7 | 0a440287a58fcb33cc8d45fd21795f36 | Checks if the Dockerfile for the project was created. | def check_linux_emacs_version(linux_version, emacs_version):
return os.path.isfile(os.path.join(BASE_PATH,
"src",
linux_version,
"Dockerfile-" + emacs_version)) | 1 |
2f7057f787f32403ff7aac9fbad138d7 | f3890ec81348cd9ee56003e4b04e26b6 | Estimate of double gaussian model parameters. | class SingleLatentFactorEstimator(estimator.Estimator):
def estimate_parameters(self):
N, K = self.y.shape
mean = np.mean(self.y, axis=0)
sigma = np.array([0.1, 0.2, 0.4])
v = np.ones(N)/N
a = np.ones(K)
return (mean, sigma, v, a) | 0 |
171e0603a6cfc8543ea507d53c8f1a5c | d24c89f672c0b9a87730d86920f27cf3 | path="/api/files/{fileId}/link_tokens",
operationId="getFileLinkTokens",
tags={"FileRelationships", "LinkTokens"},
summary="Get all link tokens of file.",
description="Retrieve all link tokens by file id.",
security={
{ "bearer_auth": {} }
},
response=200,
description="Successful get operation",
),
response=401,
descri... | {
$file = $this->filesRepository->findById($fileId);
$this->authorize('viewAnyOf', [FileLinkToken::class, $file]);
return new FileLinkTokensRelationshipResource(
$this->tokensRepository->findByFileId($fileId),
$file,
);
} | 1 |
ea1a7db5b5f1798ba6a801a4177454a2 | 60c5a97af194eaf8cec5670f2b7e409c | 観戦者を取得 | class Battle extends BaseBattle
public function getHero() {
if($this->combatantAID == CD()->id) {
return $this->combatantA;
} else {
return $this->combatantB;
}
} | 0 |
2984d54d904664ddbbb7c35dd4970dbc | 5534bd7083d8e7962dfc80aa05282931 | Can serialize movie. | $schema = parent::get_item_schema();
$meta = utils\get_registered_movie_meta();
$protected = wp_filter_object_list( $meta, array( 'protected' => true ) );
foreach ( $protected as $key => $value ) {
if ( isset( $schema['properties'][ $key ] ) ) {
unset( $schema['properties'][ $key ] );
}
}
$schema[... | 0 |
f79178ba479fa951cccdcffef5571a03 | c9a06a5aa861ad7dee5fc9833f67e361 | Returns value of 'refresh_time' property | public class Sensor
public int getRefreshTime() {
return refreshTime.get();
} | 1 |
a506a0d122866de41c4334f25b3a0194 | 9c024462b4d19e29685b5481dbe68922 | Read uncompensated temp | BMP280_RETURN_FUNCTION_TYPE bmp280_read_uncomp_temperature(
bmp285_instance_state *state,
s32 *v_uncomp_temperature_s32)
{
BMP280_RETURN_FUNCTION_TYPE com_rslt = ERROR;
u8 a_data_u8r[BMP280_TEMPERATURE_DATA_SIZE] = {BMP280_INIT_VALUE,
BMP280_INIT_VALUE, BMP280_INIT_VALUE};
u8 data = 0;
u32 xfer_bytes;... | 1 |
2c085e9dc244f77bb29d449804118bf8 | ff4e31419e7dc6c3c8fa5b1215d86900 | 测试更新日期,根据订单号修改日期。 | void editNumberByOrderDate(OrderSetting orderSetting); | 0 |
52e1933798b55cb6975ee760207a79a0 | 16fdf6d10c4a8c9a6c044ed592964e77 | clean the rawdata returned from the API to correct duplicate entries, and remove reports that are not sharks | def get_dive_info():
dive_reader = CsvImporter(os.path.join(settings.PROJ_ROOT, 'apps/xgds_subsea_app/importer/DiveStats.yaml'),
os.path.join(IMPORT_ROOT, 'processed/dive_reports/dives-stats.tsv'),
replace=True, skip_bad=True)
dives = dive_reader.load_... | 0 |
8cef2078615b1adec868c77960660e90 | 356b08cee528b6857a6bb1e2c5830ab1 | [START translate_text_with_model] | const automl = require('@google-cloud/automl');
const fs = require('fs');
const client = new automl.PredictionServiceClient();
const modelFullId = client.modelPath(projectId, computeRegion, modelId);
const content = fs.readFileSync(filePath, 'utf8');
async function predict() {
const payload = {
te... | 1 |
1249b458a064de72b30c21c539661240 | 01d1472221670bd5962da715f7120ae2 | 获取医院类型列表 | @ResponseBody
public AjaxResult findAllTypeByHospital(Long hosptalId){
AjaxResult ajaxResult = new AjaxResult();
ajaxResult.setData(departmentRepository.findAllByHospitalDistinctHospitalAneTypeNamw(hosptalId));
return ajaxResult;
} | 1 |
e3a61d77713d08ad3c7222fd1ba7c69c | bbe1fd4b4ba902ca9182ce8ad68666e7 | #Runs OLS with standard analytical solution | ols_est<-function(X,y,inds,...) {
X<-X[inds,]
y<-y[inds]
return(solve(t(X)%*%X)%*%t(X)%*%y)
} | 1 |
212df6edb7823aab59a88962db339609 | 35a50ce0d2b47f0029977d86bb6b274f | Evaluates a specified action, based on whether a value is present or not. | namespace libcdx.Utils
bool Evaluate(T arg0); | 0 |
a2095f6e1f76c3c91ff6c297ebca7632 | b05d64893d13f478b4e1c871c1031ec2 | Updates information table data from database. | public class MainActivity extends AppCompatActivity
private void updateInfo(){
Resources res = getResources();
Cursor test = db.rawQuery("Select * from refuel",null);
Cursor anyData = db.rawQuery("Select * from car",null);
if (anyData != null && anyData.getCount() > 0){
while (!t... | 1 |
3e59ac6d3cc8835f0db02f430d58c351 | 818bf136bf2311f060c6409a75c04d78 | Code inspiré de l'algorithme de ce site web :
https://www.rapidtables.com/convert/color/rgb-to-cmyk.html
Conversion de la couleur en RGB vers CMYK | function rgbToCmyk(r: number, g: number, b: number): number[] {
r /= 255, g /= 255, b /= 255;
const k = 1 - Math.max(r, g, b);
const c = (1 - r - k) / (1 - k);
const m = (1 - g - k) / (1 - k);
const y = (1 - b - k) / (1 - k);
return [c, m, y, k].map(x => x * 100);
} | 1 |
e3b801ea048e5c9ba81156308a56d415 | ac4ff6b102272c31dce930de90f93ca7 | click the typestatistics shuobuqingchu link, contrast the new link and the expected link. | class Test_15to20(unittest.TestCase):
def test_link_ts_shoujiao(self):
self.util.click_xpath(self.source.ts_shoujiao_xpath)
self.new_url = self.util.current_url
self.assertEqual(self.new_url, self.config.shoujiao_url) | 0 |
097ea50cd86de6cc273be686799c8d2a | 6298a765c8ff8661aeaa0fc84d293884 | Register that a file has been sent | namespace Experian.Qas.Updates.Metadata.WebApi.V2
void RegisterFile(string hash, string path); | 1 |
e6737e220708e317cc4f239bef2e5949 | f799f6d20c74d2a851ad90711af46de1 | 每次开始就监听图片加载,每次加载完毕都重新刷新滚动条以适配图片加载后的新高度 | this.refresh = debounce(this.$refs.scroll.refresh,100)
this.itemImgListener = () =>{
this.refresh()
}
this.$bus.$on('imgLoad', this.itemImgListener)
} | 1 |
ff8935e9b157d1b268f775a34fcda14b | b20ce8a76c767d0f0ecaee30cd838d8e | 账号为空,密码正确 | class TestProfile:
def test_login_by_password(self):
assert "错误" in self.profile.login_by_password("13817980369", "123456") | 0 |
cf7feae0861782dd934623192280e121 | 4f2fae75bcdd0220956590264800ee76 | Updates the processor with the current location in the input file. | class RequireProcessor(EmptyBackend):
def update_position(self, line, col):
self.line = line
self.col = col | 1 |
a0db6cec3217393811f61955eeebfe23 | 6f045da109383f80d41b2ea89098f336 | php shortcode [et_social_media] to use in wordpress pages (ex: news or contact page) DO NOT add title | function nectar_blog_social_sharing() {
} | 0 |
c1ade5b592021211626fcf8dae2526bb | 50bb3ee274d52641602f089d71175f45 | 1/ pos_r pos_r being the position of the first relevant URL | class Robust04(Dataset):
def load_relevance(self, file_rel="data/qrels.robust2004.txt"):
self.paires = {}
with open(file_rel,"r") as f:
for line in f :
l = line.strip().split(' ')
self.paires.setdefault(l[0],{})
self.paires[l[0]].setdefault('relevant',[])
self.paires[l[0]].setdefault('irrelevant'... | 0 |
c1f39957aabbc072a3bc3eb6f0197b72 | 6331b26b316d91318ab4b4de6a5a25f7 | 转换货品到json格式对象 | JsonObject result = new JsonObject();
result.put("id",this.id);
result.put("goodsName",this.goodsName);
result.put("sessionId",this.sessionId);
result.put("goodsId",this.goodsId);
result.put("goodsSn",this.goodsSn);
result.put("goodsSpecifitionNameValue",this.good... | 1 |
5b24eb4ce9b2655ac0bf7bc92932d4c0 | 4030039f25be6ed9f82b592ad884223f | Метод возвращает дату совершения последнего действия пользователя | class Auth_User
public function getLastLoginDate() {
if(!$this->lastLogin){
$this->lastLogin = Model_UsersLogins::getLastLogin($this->getUserId());
}
return $this->lastLogin ? new DateTime($this->lastLogin->{Model_UsersLogins::COLUMN_TIME}) : false;
} | 1 |
d9d3b727eaa21f50d9e080afcabecb01 | fbb9637b3134d27d16aaa9f1db4f44f7 | Player receives a Jail Free card. | boolean passedStart = false;
if (playerC.getInJail(ref)){
}
else if (playerC.getOldPosition(ref)>playerC.getPosition(ref)){
playerC.updatePlayerBalance(ref,4000);
passedStart = true;
}
return passedStart;
} | 0 |
c3963d41fd02262621070ade702ed157 | b9c21847ad19ec19da0252908bde04b4 | <p>Returns all Pings in the database that
match the specified search criteria.</p>
match the specified search criteria | public function Search($criteria); | 1 |
dea2111de35a14d5dfe58906ca2358f8 | 1008c489216f2726e9837b3c7875e00b | Iterate over diff tree. | class IDD(praxis.component, family="praxis.idd"):
def __iter__(self):
return self | 0 |
a0c14f2893f0768d3c112ee3ed39ba74 | 3402305eb083355c00222cbcd6018075 | Elige de que lado va poner los supply y barracas | def dirmanzana():
dirXmanz = random.randrange(0,ancho_pantalla - bloquemanzana)
dirymanz = random.randrange(0,alto_pantalla - bloquemanzana)
return dirXmanz, dirymanz | 0 |
305cd69014977f684c110f8bde94785a | 40c27480f23c03c0b0f3d99a5e107d7c | Verifies Sign In Panel Section is displayed | assert self.upload_identity_inp().is_displayed, "is not displayed"
assert self.upload_proof_of_residence_inp().is_displayed, "is not displayed"
assert self.upload_credit_card_inp().is_displayed, "is not displayed" | 0 |
0e2946c03b8f33897422a6d477406ec1 | 2f0bdf49c46072d1deeb50cbed6875ad | 根据商品pid和uid删除从购物车中删除商品 | public class CartItemDao
public void deleteCartItem(String pid, String uid) {
String sql = "delete from cart_item WHERE user_id =? and pid =?";
try {
runner.update(sql, uid,pid);
} catch (SQLException e) {
e.printStackTrace();
}
} | 1 |
68cb067935d24bd87138df172a5f5b04 | cbf893c2a16ae03e7c1c3a52fa1c5238 | remove conventional generators (e.g. OCGT) and storage units (e.g. batteries and H2)
from base electricity-only network, since they're added here differently using links | def replace_gen_by_sgen(net, gens=None, sgen_indices=None, cols_to_keep=None,
add_cols_to_keep=None):
if gens is None:
gens = net.gen.index
else:
gens = ensure_iterability(gens)
if sgen_indices is None:
sgen_indices = [None] * len(gens)
elif len(sgen_indic... | 0 |
cde68373fc5af3fa33667132548ee1fb | 01f3ff63f106f515a7953696a7c92b8e | Sets a flag in the Message Context to identify that the message has gone to Response Inflow | void setFlowRspId(Long rspId); | 0 |
c59eb52b91274634b612befe0b49379e | 0ee31663f112b32f40458c15b7e828c6 | Creates a relationship type from the given packed data | public RelationType make(); | 0 |
c46dcdf3c6c94f1eba2e8ccec5593096 | 5d897727509bcd8034348a6277c92ab7 | Returns headers's HTML element template. | class Html extends Input
public function __makeTemplate()
{
$xhtml = <<<HTML
<div var="element" class=""></div>
HTML;
return \Dom\Loader::load($xhtml);
} | 0 |
abdb42b4db60a43b51891a1aea5649c5 | c94472dff1a215e3e220298f46b1f50a | Sets the value for SegId. | public class AppSearchWrapper implements AppSearch, ModelWrapper<AppSearch>
public void setSegmentId(long segmentId) {
_appSearch.setSegmentId(segmentId);
} | 1 |
84aeca93c421af1c5ac35279ab32f12f | 19d799dc11cf8521e07e765ce908b716 | Adds your custom http content serializer <see cref="IHttpContentSerializer"/> to the pipeline.
<para>Common content serializers available to download as NuGet packages (RestApi.Client.ContentSerializer.*) which can be added to the pipeline.</para>
Content serializer takes care of the request/response content serializat... | namespace FluentRest
public static class FluentExtensions
public static IHttpClientBuilder SetSerializer(this IHttpClientBuilder builder, IContentSerializer contentSerializer) {
builder.Services.Configure<FluentClientFactoryOptions>(builder.Name, options => options.Serializer = contentSerializer);
... | 1 |
b427777ce489cab8df50b75f05f35d5e | d6089a91ef2651476d7dc38557b486f4 | taxed prices | class Object_Model
function get_taxed_price($value, $tax)
{
global $config;
$taxed = $value + $value * $tax / 100;
return $taxed;
} | 1 |
da49c8ea914f188c6c12de9da7034fb6 | 43aa758a8fe0479845ffd85eec66e72b | Checks if the attribute value should be included in the {@link Object#toString()} method even
when {@code null}. | public class ReflectiveToStringHelper public static class Include
public Include privates(final boolean privates) {
this.privates = privates;
return this;
} | 0 |
c597ad72b3e10eb5873a3e622880b863 | 10b3ad6d44ea66fcd68af6cfd25e5c7b | the players which are either attackable or able to attack | class Player():
def possible_attacks(self):
teammembers = {}
for creature in self.team:
teammembers[creature] = []
squares = creature.attack_squares()
for square in squares:
target = square.get_creature()
if target != None and target.p... | 0 |
d4ea5178c562aeaa5d8202981c745de0 | ea615ba150ff8d6dafcb67995b508168 | Calculates the byte chunks to download. | public class DownloadManager implements Runnable
private int getLengthInChunks(FileInfo fileInfo){
double chunkLength = chunkLengthRaw;
double preciseChunks = fileInfo.getLength() / chunkLength;
return (int) Math.ceil(preciseChunks);
} | 1 |
7055d93f89b56adf0a99ed66c4139da8 | 4623c05f7a05d6cf0ec5d12038fc6366 | Fetch data from flickr api and set state | Axios
.get('/main', {
params: {
catName
}
})
.then(results => {
let liked = {};
results.data.url.forEach((url, index) => {
liked[index] = false;
})
this.setState({
cat: results.data,
likes: liked,
cur... | 0 |
7e57b11b8a9c402a1c5ead81f16ebfb7 | 3fe653a7922e10ded3421b931478b96f | 释放FTDI对象 | FT_STATUS FTD2Api::Close()
{
if (!m_pClose)
{
AfxMessageBox("FT_Close is not valid!");
return FT_INVALID_HANDLE;
}
return (*m_pClose)(m_ftHandle);
} | 1 |
3bb097b8f3942a9823ef3416f07a41cc | c5c2bc19bf335d111f247a01cb4a5cf8 | Returns the value of the '<em><b>Indicator</b></em>' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc -->
<!-- begin-model-doc -->
"TH" in 12TH which is a floor number, "NO." in NO.1, "#" in APT #12, etc.
<!-- end-model-doc -->
extendedMetaData="kind='attribute' name='Indicator'" | public class MarcTagWrapper implements MarcTag, ModelWrapper<MarcTag>
@Override
public boolean getIndicator1() {
return _marcTag.getIndicator1();
} | 0 |
c222bf6794ea76c0db6c67a315af5dd4 | ba0880b95a96480800a0a4fc18219f55 | Get ProfileDAO object. | public abstract class BridgeLocalServiceBaseImpl extends BaseLocalServiceImpl
implements BridgeLocalService, IdentifiableBean
public ProfilePersistence getProfilePersistence() {
return profilePersistence;
} | 0 |
20fbe490f73c150d88c1664e1f5700aa | afadc732a5a968c35eb4670a613de3e6 | set a custom output stream for the application | namespace Wesley.Client.Droid.Services
public class PrintUtils
public static void SetOutputStream(System.IO.Stream outputStream)
{
_outputStream = outputStream;
} | 1 |
d391d0b92d795ca5773bb243cf38b6a7 | d622b9b0c9ad4164fe5781e8e94256a7 | Decorator to register a converter | def Register(cls: Type[base.ExportConverter]):
_EXPORT_CONVERTER_REGISTRY.add(cls) | 0 |
976df72c20de79a96e1b55b6c4aca90d | d8d9d95a9002e4fab0c0aad007b33105 | Oozie system OS environment | global DEFAULT_EVENT
global DEFAULT_REPO_SLUG
env = {}
APP_VERSION = ""
APP_VERSION_FILE = os.path.join(".","resources","app","meta","manifests","app_version.txt")
if os.path.isfile(APP_VERSION_FILE):
with open(APP_VERSION_FILE,"r") as f:
APP_VERSION = f.readlines()[0].strip()
env["CI_SYSTEM"] =... | 0 |
65dcb1437aa5f76a54356aa0b4df10a4 | f884bbe9255899e5ccad50d1aa7da105 | A router to control all database operations on models in the
bill2myprint application. | def db():
pass | 0 |
a2ace63e99c8c3336fca3d2b739b4711 | cc46cab1d906a434ef9572cdb28e84af | The URIs that should be excluded from CSRF verification. | public function getExclude(): array; | 1 |
535dad48c46e43925c31ed2c4875010a | a5bbada7a64ac84d85b521c088461fab | Returns the number of billing informations. | abstract class BaseSettingsCompanies extends BaseObject implements Persistent
public function countBillingCompaniesmxtaxinfos(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collBillingCompaniesmxtaxinfosPartial && !$this->isNew();
if (null === $this->collBil... | 1 |
f963534890c2f84fc7256e4d59e97a02 | f0993f94bebf1ae3f76d29c79169c4fc | Examines responses from urllib2 and determines if there is a refresh header
that points to a different location. If there is, then build a new URL
swapping out the original requests's host for the redirected host and
re-execute the query. If at any point, the parsing fails, then return the
original response. | if response.status_code not in [301, 302, 307]:
return None
new_url = urljoin(response.url, response.headers['location'])
if 'reddits/search' in new_url:
subreddit = new_url.rsplit('=', 1)[1]
raise InvalidSubreddit('`{0}` is not a valid subreddit'
.fo... | 1 |
736cedac1105b7af122d63756ea472f1 | 79db7faa220f02e2b75236f2e8916fd8 | Creates a detector version. The detector version starts in a <code>DRAFT</code> status. | namespace Amazon.FraudDetector
Task<CreateModelVersionResponse> CreateModelVersionAsync(CreateModelVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)); | 1 |
e0c310349366f2eb63b8f5a139979820 | e5861556128bc971a6aab69da5eec3b8 | 将Map组装成待签名数据。
待签名的数据必须按照一定的顺序排列 这个是支付宝提供的服务的规范,否则调用支付宝的服务会通不过签名验证 | public class FbPubKey
public static String strToSign(Map<String, String> reqDataMap){
List<String> sortParams = YwtUtils.sortParams(reqDataMap);
String sign = YwtUtils.sign(reqDataMap);
return sign;
} | 1 |
5c347212206bffa8766be8bd87e253be | 50646cc7c5371c9f003ebdb12cc804da | Set initial speeds to max values | public class UFOcontrol : MonoBehaviour
void Start()
{
SpeedXmax = SpeedZmax = Speed;
OriginalPosY = transform.position.y;
} | 1 |
c41bdcdbf3097effc6ea66b6e273cb40 | dff22f922414dcc1636fe536a5c8aa5c | Find the front using laplacian on the mask
The laplacian will give us the edges of the mask, it will be positive
at the higher region (white) and negative at the lower region (black).
We only want the the white region, which is inside the mask, so we
filter the negative values. | def calculate_fill_front(mask):
fill_front = []
for x in range(mask.shape[1]):
for y in range(mask.shape[0]):
if mask[y, x] == 255 and np.isin(0, mask[y-1:y+2, x-1:x+2]):
fill_front.append((y, x))
return fill_front | 0 |
c8346e572abffd557bda0b3a4fa4073d | d24fc05783acb921eb2d6509d4e19668 | 尝试合并一些Y; 满足这样的条件:相邻,并且xLine一样 | N=len(lines)
i=0
while i < N-1:
line_1=lines[i]
line_2=lines[i+1]
if line_1.width == 0:
lines.remove(line_1)
break
if line_2.width == 0:
lines.remove(line_2)
break
if line_1.height == line_2.height:
line_1.en... | 1 |
4cc69bf7ebea794654836768c448e30f | 4084d361a5276643937c1bab6788b801 | Returns (full config file name, contents) | func LoadUpConfigFile(args []string, def_fname string) (string,
map[string]string, map[string]string) {
var an_arg, found_fname string
found_fname = ""
for _, an_arg = range args {
if _, err := os.Stat(an_arg); err == nil {
found_fname = an_arg
break
}
}
if found_fname == "" {
found_fname = def_fname
... | 1 |
df67e37e1f89750c51bd07280969c980 | a2e026df534a014746c7d30ae387977a | Adds an item to the sorting list. If it exists already, it will be superceded (deprioritized), unless the existing
item is marked as "Required" or "RequiredOrder." In the first case, only the order (asc or desc) will be changed to
the current value. In the 2nd case, no changes will be made. | namespace Custom.Collections
[Serializable]
[DebuggerDisplay("{DebuggerDisplay}")]
public class FastSortedList<T> : ICollection<T>, IDisposable
public void Add (T item)
{
IsReady = false;
_unsorted.Enqueue (item);
} | 0 |
c034c9b2766f47ea104b273c05034d51 | cc916e0eba623f56b42b0a12b93cd8f1 | Returns the list of received data items
<returns>The list of received data items</returns> | namespace JenkinsNotification.Core.Communicators
public class ReceivedEventArgs : EventArgs
public byte[] GetData()
{
return (byte[])_data.Clone();
} | 0 |
e32b1c81400e0b01852c2e24c08b5dbc | b0709248893163307bba30619cc341c6 | Clears internal list of parameter mappings. | protected static function resetMappings()
{
self::$mappings = [];
} | 1 |
c9d86ff3c64f7201adf98462a28787a0 | 92d6af40689cc5c067bbf03264e37d99 | 异步填充一组数据表 | DataSet dataSet,
int pageNo,
int pageSize,
params string[] tableNames)
{
await this.DoLoadDataSetAsync(command, dataSet, pageNo, pageSize, tableNames);
} | 1 |
29b03ad8ea8869b0faad56f59deb105d | ec02db1f1d88c77502ae8d4c1df40d05 | get byte from value safely. | {
if (Value.Affinity == CellAffinity.BYTE)
return Value;
if (Value.IsNull)
return CellValues.NullBYTE;
if (Value.BINARY == null && Value.AFFINITY == CellAffinity.BINARY)
return CellValues.NullBYTE;
if (Value.BSTRING ... | 1 |
77220cef2cfc033b1a562ddc2d27d286 | 41f03d733c4e1649e4e2ed8208535e0a | Returns an iterator over objects in BFS order (which means that orphaned objects won't be
scanned). | impl<'a> ScannedStore<'a>
fn iter_bfs(&self) -> ScannedStoreIterator<'_, 'a> {
ScannedStoreIterator(self, self.root_objects.clone())
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.