query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
dbce99def7ee609b29e2bfb0c62e252e | 38e5f34fdaf025a67f172528fd66146c | java获取两个时间的相隔时间,包括年、月、日、时、分、秒 | public class DateUtil
public static String compareDate(Date date1, Date date2) {
if (date1 == null || date2 == null)
return null;
java.util.Calendar c = java.util.Calendar.getInstance();
c.setTime(date1);
long d1 = c.getTimeInMillis();
c.setTime(date2);
long d... | 0 |
99c6976514c235caf594e53bdaa18a51 | c570bc36bbae9a314adeff524ccb7ae4 | Returns java import package. | class PageSplitter(ComplexParamsMixin, JavaMLReadable, JavaMLWritable, JavaTransformer):
def getJavaPackage():
return "com.microsoft.ml.spark.featurize.text.PageSplitter" | 1 |
cd991f6da6e05f355ea112ddad8c3c3a | a624d83fb2dced3890b9a3f8aa470919 | Calculates the variance of the spectral line w.r.t. the intensity-averaged line core. | class Spectrum(numpy.ndarray):
def variance(self):
return numpy.var(abs(self)) | 0 |
eed791c0b7dfda48613dfc1a8c8f1bcd | c671ca01aeffed00a771a14e699e8419 | evaluates emotion of text | [emotions,patterns,matrix] = Matrix
emotion_result = {"data":[]}
post = data.get('data')[0].get('message')
if post:
emotion_result['data'] = [evalWithMatrix(post,emotions,patterns,matrix)]
else:
emotion_result['data'] = ['Empty Message']
return emotion_result | 1 |
d2ef86763fa3a16c3f61a41960255096 | a4dd24ccbd7425bd8450aa9be79e1503 | Renew the subscription of a contract | class InstitutionalSubscriptionDAO extends SubscriptionDAO
function renewSubscription(&$institutionalSubscription) {
return $this->_renewSubscription($institutionalSubscription);
} | 1 |
855fd8c8646c70e53be0d89f187b1e4d | c3b72fa126d98a59e9638aa65c4cea08 | Sets the enum name. | public final void setName(final String name) {
this.name = name;
} | 0 |
47173684443abf9e26db21e9792fd580 | 402444442510a4b8a7ae784cc34ec5c6 | Altera a descrição da campanha | $sql = 'UPDATE salas SET descricao=? WHERE id=?';
$bindParams = [
'si', $descricao, $updateSalaId,
];
$this->database->connect();
$result = $this->database->update($sql, $bindParams);
$this->database->close();
return $result;
} | 0 |
469a5f421ffcc0a251f21a73df5162db | 9e36e7af3247dd9d31adbfc47e794ae2 | initiates map, displaying current position | var latlngp = new google.maps.LatLng(currentLatitude, currentLongitude);
var mapOptions = {
center: latlngp,
zoomControl: true,
zoomControlOptions: {
},
zoom: 20,
mapTypeId: google.maps.MapTypeId.roadmap
};
_map = new google.maps.Map(mapCanvas, mapOptions);
... | 1 |
456266bc2bde3671d6f0b3dc3272611a | 44dac8fff23bda03532f03a5bebadbb8 | Begins an asynchronous operation to delete a container. | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<OperationStatusInner>, OperationStatusInner> beginDelete(
String resourceGroupName, String moveCollectionName, Context context); | 1 |
06585c8dc69740831a2ccaeefb3841b8 | c3c66e33b4fe33cd891a1d4e92f22059 | 三同 | bool CardUtil::isSanBuDai(QList<CardItem *> myCards) {
bool flag = false;
if (myCards.size() == 3) {
int grade0 = myCards.at(0)->CardNum;
int grade1 = myCards.at(1)->CardNum;
int grade2 = myCards.at(2)->CardNum;
if (grade0 == grade1 && grade2 == grade0) {
flag = true;... | 1 |
436c4695438cccf2cfb59e01545fdb22 | c670349492f76047b05736be2c7b6cc9 | Sets the part group | class Attachment extends FieldRenderer
public function group($attGroup)
{
$this->setSetting('group', $attGroup);
return $this;
} | 1 |
6a499e269d4fe57222caab317f60be1e | 8ebf43249dd4a9597bb40e81f8d90f9b | 返回前30个高频词 | def calcMostFreq(vocabList,fullText):
import operator
freqDict={}
for token in vocabList:
freqDict[token]=fullText.count(token)
sortedFreq=sorted(freqDict.items(),key=operator.itemgetter(1),reverse=True)
return sortedFreq[:30] | 1 |
a12463b613632abac32a33e10ac3fe2a | 93330404771e5cc3ee8ea6096977d9fb | Loops through all the method_params
(either passed here or the method_params attribute)
If the name matches an attribute of this object or the
termination conditions object, then the value of this attribute
is set. Otherwise it is assumed to a method_option for the
scipy.optimize.minimize function | class OptParams(object):
def __init__(self, **kwargs):
convergence_sets = {'GAU': [1e-6, 3e-4, 4.5e-4, 1.2e-3, 1.8e-3],
'NWCHEM_LOOSE': [1e-6, 3e-3, 4.5e-3, 3.6e-3, 5.4e-3],
'GAU_LOOSE': [1e-6, 1.7e-3, 2.5e-3, 6.7e-3, 1e-2],
'TU... | 0 |
85c8d52e0e8ba21c17d69edc5df1b90e | d45aff85ce18ce2df3d0ea02f94be3a3 | Replaces '/' with '|', which keeps vscode from redacting telemetry data that looks like paths but are not. | def keypath_literal(txt):
return txt.replace('/', '|') | 1 |
78ef39ada69e2ba85286434fac90d130 | 10e71bdcd5340e4983a34d3f48b91471 | Switches the layout used for the Author BaseModel between one for display or one for editing. | if (document.getElementById(id + '_edit_pane').style.display === 'block') {
document.getElementById(id + '_edit_pane').style.display = 'none';
document.getElementById(id + '_display').style.display = 'block';
} else {
var text = document.getElementById(id + '_txt').textContent;
d... | 1 |
75412c32d56293835855ab0884d22707 | c48121897088fe4b0cfa5ef379a914df | 关闭验证码弹窗 | function closeCode(){
$('.new-year-code').fadeOut(300)
$("#com_black").fadeOut(300)
} | 1 |
487541aafb1b453bd3b8a75ce44543d3 | 591f78a7b4c0d968465413601b4e6eb8 | Gets the external pointer to the checkpoint. The pointer can be used to resume a program from
the savepoint or checkpoint, and is typically passed as a command line argument, an HTTP
request parameter, or stored in a system like ZooKeeper. | @Nullable
default CheckpointedPosition getCheckpointedPosition() {
return null;
} | 0 |
9cbb5a83f27466b6fdd303dc6ebbb196 | fa50052f7d95b5f8cfb00e8af6cd88a7 | Sets whether the selected tab will deselect when clicked again. | public class TabPanel extends Container<TabItem>
public boolean isAutoSelect() {
return autoSelect;
} | 0 |
6df9ee5793ea485c0769bd35fba5e9f1 | 9edb4fd6ae30ac7f035142941f8120ef | @brief Get a list of all the edges in the graph | namespace geos namespace planargraph
std::vector<DirectedEdge*>&
DirectedEdgeStar::getEdges()
{
sortEdges();
return outEdges;
} | 1 |
f05f0b2126012b59252a5e8a081bc735 | 7107b3af01f7bef9ca5cf0b8e8a5bd0c | plot cluster centroids over input data | def pca_plot(dist): | 0 |
12f78d4799ea78894955e5d901fa0bc6 | 2346f96dcf38add2871242758a8b9c2c | Retarded Gf | def gf_retarded_convention(energies, broadening):
return np.array(energies).real - 1.j * abs(broadening) | 1 |
3726ca2165571db38d22084ee5c0692c | 729000ada1d47655d18f1e83a96b0f56 | 系统付费率:当天付费客户端ID数除以当天有过登录操作的客户端ID数 | def server_online_pertime():
start_time_str = request.args.get(EXT.START_TIME, EXT.STRING_NONE)
end_time_str = request.args.get(EXT.END_TIME, EXT.STRING_NONE)
searchCondition = request.args.get(EXT.SEARCH_COND, EXT.DATE_DAY)
time_format = get_format(searchCondition)
start_time_str,end_time_str, ... | 0 |
4f3a572e3b6b67b079bfd0076625c5ed | 098e0fefc041317bd891bb4ecab69ba9 | Write to a file, ensuring the file does not grow beyond a certain size. | if (maxFileSize <= 200):
raise Exception(f'Invalid max file size.\
Please select a value above 200 bytes.')
permissibleSize = maxFileSize - 100
allEntries = list(jsonData.values())[0]
keyName = list(jsonData.keys())[0]
currArray = []
currSize = 0
fileCount = 1... | 1 |
135aa9d031a5f6750ce1440aedeed1f6 | 453a172fb0d57cba8198c7f163ae9f4e | We need to iterate through all the sub roads and destroy them and any connections we have to them. | void GBLS::removeDataFromUnnecessaryRoads()
{
for (auto it = trainingData.begin(); it != trainingData.end(); ++it)
{
int roadID = it->first;
auto it2 = std::find(neighborRoads.begin(), neighborRoads.end(), roadID);
if ((it2 == neighborRoads.end()) && (roadID != road->getID()))
{
for (auto it3 = it->second.... | 1 |
c4fb7bc08e148f99407fbe6479049048 | 8868e4e1505a0a3d223bfa86dead37d4 | Sets Checkout Options. | class PaymentLink implements \JsonSerializable
public function setCheckoutOptions(?CheckoutOptions $checkoutOptions): void
{
$this->checkoutOptions = $checkoutOptions;
} | 1 |
b78d6d6d9e9a19717b461ede4b01668e | 8606e55c6e1a1c15b5a6edfa3ca32377 | Sætter fødselsdag på den aktive kunde | public class Manage_Customer
public void setCustomer_DateOfCreation(String d) {
this.Customer_DateOfCreation = d;
} | 0 |
586d598effae41bfff9afca3d14da8e0 | 10624e1d759b4946e14cb7bded6aeff7 | Lấy danh sach lop theo giảng viên | {
$result = $this->db->con->query("SELECT * FROM LopHocPhan WHERE MaGiaoVien = '{$maGiaoVien}'");
$resultArr = array();
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$resultArr[] = $row;
}
return $resultArr;
} | 1 |
c8cda9c56e39e0ce20a3f38de243fa83 | 1b66a71001158e08f71db94b4bc1eb20 | functions like put | firstDeleted = None
if self.funcname == "hash_func":
index = self.hash_func(key) % self.cap
elif self.funcname == "hash_funcOne":
index = self.hash_funcOne(key) % self.cap
else:
index = self.hash_funcTwo(key) % self.cap
if self.table[index] i... | 1 |
3a19789754273e50a3dd5b1d06342fbe | e226f3c13411b6ad2bb5c2b7a62cd59e | Чтение строки из COM | {
serial.ReadTimeout = timeout;
try
{
return serial.ReadLine();
}
catch
{
return null;
}
} | 1 |
9395cbbb68bedb59dcb861ff4b21b5a9 | 28bc1a66c98cf398cac24006b127407e | 不用stack
扫描两变
第一遍取得链表长度
第二遍链表正序遍历,同时数组逆序赋值 | public class LinkedList
public int[] reversePrint(ListNode head) {
ListNode temp = null;
int len = 0;
while(head != null){
len++;
ListNode next = head.next;
head.next = temp;
temp = head;
head = next;
}
int[] reverse = n... | 0 |
840d797c36b442e59f581b02749f2bff | 5a26752d360db9e797284cc7fb9e51d3 | Returns the logical point at the centre of the box shown as #### above. | {
return Point3d.Origin + 0.5 * (extents.MinPoint.GetAsVector() + extents.MaxPoint.GetAsVector());
} | 1 |
3ac39848ee99db627348f2899df6d0c2 | ee5fb4b49c1dcc973ed5462acd87ba78 | gets all prices as a series | class Game:
def get_prices(self) -> List[float]:
result = list(map(lambda state: state.price, self.good_states.values()))
return result | 1 |
5ac25c887fc8894c4413aafaf642348c | 1979981329e9c39fdb5bab0454f16494 | Migrates an AMT from v2 to v3 without re-encoding values. | async def async_migrate_entry(hass, config_entry):
version = config_entry.version
if version == 1:
_LOGGER.debug("Migrating from version %s", version)
updated_config = config_entry.data.copy()
if CONF_AMAZON_FWDS in updated_config.keys():
if not isinstance(updated_config[CONF... | 1 |
4274b906d773e3da1be5bbc738015593 | 5e654e202364bdef90592ef5f9e2f8c6 | 获取该平台所有的板块 | namespace Bucket.Admin.Web.Controllers
[ApiController]
[Authorize("permission")]
public class PlatformController : ControllerBase
[HttpGet("/Platform/QueryPlatforms")]
public BaseOutput<object> QueryPlatforms()
{
var list = _adminDbContext.Queryable<PlatformModel>().OrderBy(it =>... | 1 |
09cc16d0a8577466684978639cfaa3ae | cd9ea501f623c1222026939f0cc22ceb | Decrypts a backbone key, tool key, or group address key using the keyring
password. | class EncryptedKeyring(Encrypted, Keyring):
def _migrate(self, keyring_password=None): | 0 |
79963e5461699f6a468ba6b95a954afe | ddaa717e0987b7cf560957dce9cdf649 | sets the values of the pins to HIGH. I.e lights up the respective leds | {
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0|GPIO_PIN1|GPIO_PIN2|GPIO_PIN3|GPIO_PIN4|GPIO_PIN5|GPIO_PIN6|GPIO_PIN7);
GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0|GPIO_PIN1|GPIO_PIN2|GPIO_PIN3|GPIO_PIN4|GPIO_PIN5|GPIO_PIN6|GPIO_PIN7);
GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN0|GPIO_PIN1|GPIO_PIN2|G... | 0 |
93c8cb0ed8fea2e8ff56981d0fced13e | 785bb0046c3d01d67f0ef4a0aeea6798 | Check whether kwarg is specified in a settings object parsed from a config file. | class SettingsReader:
def hasSetting(self, key):
return key in self._settings_dict.keys() | 1 |
b7d6bdf8766af9fd810359061a0f27b0 | 60cce8576765b46ad7b0cc9eb88f3220 | 批量新增套餐信息 | void addCustomerPacks(@Param(value = "list") List<CustomerPack> list); | 1 |
188b51bf979183d2bca12634bff6f3ef | 65fb4e9bcc94fca4cdc1d4533ea12064 | when the button is pressed, it runs the encryption | def clickedDecryption():
m=26
tabs = 0
text = num1.get()
text2 = num2.get()
s1 = firstConvert(text)
s2 = secondConvert(text2)
c1 = calcPrime(s1)
c2 = calcPrime(s2)
a = highestPrime(c1)
a2 = highestPrime(c2)
prime = primeNumbers(a,m)
prime2 = primeNumbers(a2,m)
ciphert... | 0 |
e027fd9271280ae31380cae6e3da1fb5 | 68128bdd695395050a134488b4775a69 | Returns true if the large message sequence in the sub-queue is completed | return orderedMessageSequenceBuffer.isEmpty() ||
messageSequence.getInSequenceNumber() < orderedMessageSequenceBuffer.last().getInSequenceNumber() ||
orderedMessageSequenceBuffer.last().getInSequenceNumber() + 1 == messageSequence.getInSequenceNumber();
} | 0 |
d7fcfb2c5371018545b28f4ba18428d3 | 33724ecfa3e8991a37d50e1a24b31e45 | Write labels of rows and columns of the chess board. | public class ChessBoardView extends BorderPane
private void addIndices(GridPane grid) {
String[] columns = {"A","B","C","D","E","F","G","H"};
String[] rows = {"1", "2", "3", "4", "5", "6", "7", "8"};
int fontSize = 17;
if (guiGame.game.currentPlayer.getColour() == Colour.BLACK && guiGame... | 1 |
ff416ab4f46bc33f9f022a078643f5a6 | d39dc19d86388a7cb087960c5b0b558d | 根据主键和微信用户ID查找 | try{
Assert.hasText(wechatId, "微信ID不能为空");
Criteria criteria = new Criteria();
criteria.and(Restrictions.eq("w.wechatId", wechatId));
return mapper.findByParams(criteria);
}catch(Exception e){
logger.error(e.getMessage(), e);
throw ... | 0 |
45ce02fd2c362408135e6a7e71310115 | 8bfa41534102b2470f0e2f058871e71a | 储存所有pred & label记录,用于后续复杂计算,例如precision/recall/f1,confusion matrix | self.predss = []
self.labelss = []
self.losses = []
self.counts = [] | 1 |
a3c06bf991efcb817d594092587ea71b | 2d5bb9bfa1d4ebab2c1be10ceca1b3da | Creates a new game object from the collection of available objects | foreach (GameObject go in goList) {
if (go.activeInHierarchy == false) {
go.SetActive(true);
return go;
}
}
if (goList.Count >= maxAmount) {
GameObject.Destroy(goList[0]);
goList.RemoveAt(0);
}
GameO... | 1 |
013a69e464fff36c2a0dc6cc1bd7c105 | 9f6d897d51be6d7a9e4155200aafd6b9 | Accessing delegated attributes place them on the local instance. | attr = getattr(self.delegate, name)
setattr(self, name, attr)
self.__cache.add(name)
return attr | 1 |
dd43e7a77fed2d061bc95e161e3e2431 | dd4367c0a91a3cdf61a043c06463094c | Retrieve gift certificates by query Retrieves gift certificates from the account. If no parameters are specified, all gift certificates will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. | namespace CommerceBuilder.Payments
public partial class GiftCertificateTransactionDataSource
[System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]
public static GiftCertificateTransactionCollection LoadForCriteria(string sqlCriteria, int maximumRows, int startRowIndex,... | 1 |
3e65ab278c4e4a1624eab33d72113da9 | e1a1ad8f673492c16db997a73c8e8b43 | Get all the required fields | class PostFields
public function getAll()
{
return array_merge($this->optionalFields, $this->requiredFields);
} | 0 |
492df791b916c49d6d26c2b402811365 | ac3cde09ed07a3590c4f1d76d1bd8c0a | 설정한 값대로 데이터 생성 | class Numbers(UI):
def setNumbers(self, num):
self.num = num
self.numberList.clear()
self.numberValueList.clear()
if self.num == 0:
self.numberList.append(Number(self.x, self.y, self.sizeX, self.sizeY, 0))
return 0
numStr = str(self.num)
lengthChec... | 1 |
19ca7676c2ba197b41788d3fdbd89c90 | 333800e90637436a6fc55d0322e813ec | 拆分链表,按奇偶进行拆分 | struct ListNode* oddEvenList(struct ListNode* head)
{
head = head->next;
if(head == NULL || head->next == NULL)
return head;
struct ListNode* odd = head;
struct ListNode* even = odd->next;
struct ListNode* evenHead = head->next;
while(even != NULL && even->next != NULL)
{
... | 1 |
a781cc79b702a5bef744a190e5776578 | 455ad3833e24fdc89b516a8de7957ec9 | Вывод номера, даты и наименования документа | {
if (doc == null) return "";
if (doc.TypeDocumentGji == TypeDocumentGji.Disposal) return GetDisposalBase(doc);
var parents = Container.ResolveDomain<DocumentGjiChildren>().GetAll()
.Where(x => x.Children.Id == doc.Id)
.Select(x => new
... | 1 |
6da22b1dd0f4d4ca83ecd8f1404a845b | c6eb32e534a40793a821266f4980515e | Gets the date in the standard MM/DD/YYYY format to pass to the API | class Timer(tk.Frame):
def get_current_date(self):
today = dt.datetime.now()
return today.strftime("%m-%d-%y") | 0 |
9d25a8d99ba83b2a21a10094cfcfe83b | 93b426eedd93943a565312fc025f2e36 | 根据快递员的上班时间,收派能力,忙闲程度分单,此处直接指派第一个 | @Component
public class DispatchServiceImpl implements DispatchService
@Override
public MinimizedDriver dispatch(UnsettledOrder order) throws Exception {
if(order == null){
throw new Exception("order不存在,传入了错误的参数");
}
String city = order.getCity();
int type = order.getType... | 0 |
cd17519293a0433d9271b06c18ab1f06 | 9ff604c64e785303d84b10143372f8f7 | アクセストークン・IDトークンに紐づく、プラットフォームユーザ情報と
送られてきたアプリケーションユーザ情報を連携状態にする。 | public Map<String, ?> convertAccessToken(OAuth2AccessToken token,
OAuth2Authentication authentication) {
Map<String, Object> map = (Map<String, Object>) super.convertAccessToken(token, authentication);
Object details = authentication.getPrincipal();
... | 1 |
ae8473db9039ba589a6b28ad19c1a2b0 | 267bef0ce1e00ed447d69e6e7ebf53b6 | #Obtiene los nodos que contienen la información en las webs de CCC | file <- read_html(file, encoding = "utf-8")
author <- file %>%
html_nodes(xpath="//div[@class='td-post-author-name']//a") %>%
html_text() %>%
cleanup_text() %>%
unique() %>%
stri_replace_all_fixed("Por ", "")
tags <- file %>%
html_nodes(xpath = "//ul[@class='td-tags td-post-small-box clear... | 1 |
53c70a94643d78a67aefeaed50ae19c7 | cce460ae47a405884337575c9bfea4dd | Use SDL and other libraries installed by the user (not those bundled with the gem) | def check_dependencies
use_zlib
end | 0 |
722ec8d52b26d7f11d85f4323c8bb074 | 0b66d3a8a7fe851cd5704f68a333b95c | @brief usbd_audio_OUT_Incplt
Handles the iso out incomplete event. | {
Adc *pAdc = ADC;
if ( status == USBD_STATUS_PARTIAL_DONE )
{
uint8_t nullFrame = 1;
if ( !isAdcActive )
{
adcDelay = ADC_DELAY;
isAdcActive = 1;
}
else
{
if (adcDelay)
{
adcDelay --;
... | 0 |
2045fe9008854b2d5852ceca90563cc7 | dd1d6c90c67cd00573cf34c712d958f1 | Performs the model binding for a byte array | namespace Microsoft.AspNet.Mvc.ModelBinding
public class ByteArrayModelBinder : IModelBinder
public Task<ModelBindingResult> BindModelAsync(ModelBindingContext bindingContext)
{
if (bindingContext == null)
{
throw new ArgumentNullException(nameof(bindingContext));
... | 1 |
40c6cda5992c87ebf96ebb3407156ede | e2629c34b642428405a02d91cd8a7bf3 | 添加一首歌到播放列表播放 | insertSong({commit, state}, song) {
let playlist = state.playlist.slice()
let currentIndex = state.currentIndex
let fpIndex = playlist.findIndex((item) => {
return item.songId === song.songId
})
currentIndex++
playlist.splice(currentIndex, 0, song)
if (fpIndex > -1) {
... | 1 |
bcec37ce042aae98cc911f8604542d5c | 5328ad012c9b10cc8a3454e5301b7059 | https://stackoverflow.com/a/7776146 | def chunks(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return itertools.zip_longest(*args, fillvalue=fillvalue) | 1 |
7557e525751ff57a5f20d20c83c834d0 | 6461937c3aa02aae13d3dcd38c7e5e43 | @brief Mpu6050 Writelen | static bool writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t* data) {
bool status = 0;
HalI2CInit(MPU6050_DEFAULT_ADDRESS, CLOCK_HZ);
status = HalSensorWriteReg(regAddr, data, length);
return status;
} | 1 |
a2c0c18378e133ea859017f5d42664a2 | 6261606b58f11f4eccf38559024938b2 | Set Footer Height | class Widows implements Plugin
public function setFooterHeight($height) {
$this->footerHeight = $height;
$this->resetPageBreakTrigger();
return $this;
} | 1 |
e9077bf49d6b3b55958edd1047befbc1 | ef1c8a0d5668f46238dc06e00f18f298 | Predict samples and emit results to a file. | def predict(**kwargs):
model_name = kwargs['model_name']
inf_fname = kwargs['inference_set_file']
limit = kwargs['limit']
predictions = predict_with_model(model_name, inf_fname, limit=limit)
present(predictions) | 0 |
a7a1183346e83105b3b96e440d19e030 | a779598d6359e9419b241adcb59524db | Cette méthode retourne les catégories lié à un article | {
return $this->createQueryBuilder('t')
->join('t.category','category')
->andWhere('category.id = :id')
->setParameter('id', $id)
->getQuery()
->getResult()
;
} | 0 |
1937859a9d2de5fd9a8a67d07d11d19a | c2d97018d3a5931ea2c993ba52a27f98 | 清空查询附件数据 | function ListAttachmentsClear() {
$("#Quote").empty();
$("#Receipt").empty();
$("#Form").empty();
$("#Other").empty();
} | 1 |
3467cb1d4b6817b7d847527341ed71ca | 54d706713d7a576a3b88aca9dc08c0b9 | 根据日期创建日志目录,并返回日志文件名 | namespace XLQStartup.日志
internal class RecordLog
private string getFileName()
{
DateTime dt = DateTime.Now;
string date = "XLQ" + dt.ToString("yyyyMMdd");
return date + ".log";
} | 0 |
d94d98ab063bb853ffad94e236d42207 | 071d6ad7e32eadbaf6fe855faa552873 | Returns the reduction in carbon output caused by investing in carbon
reduction | def change_in_average_learning_curve_parameter_coal():
return (cost_development_learning_curve_coal() -
average_normalised_learning_curve_on_costs_coal()) / one_year() | 0 |
32fe694d214dae25274fd0d2ae4c3a89 | 847ad752d6f37d3237dc4d180ebe29bf | r"""
Shortcut to retrieve the number of throats in the domain | if labels == 'all':
Nt = sp.shape(self.get('throat.all'))[0]
else:
if type(labels) == str: labels = [labels]
Ts = self.throats(labels=labels,mode=mode)
Nt = sp.shape(Ts)[0]
return Nt | 1 |
6e049419df16ab7c0072f8c0c7114b51 | 43b37b34ddbc6abf7e49b00f2ec468b5 | 根据checkbox控制web段菜单是否显示 | function web_show(flag){
if(flag==1){
$("#zhandian_info").show();
}else{
$("#zhandian_info").hide();
$("#web_host").val("");
$("#web_name").val("");
updateConfigs();
}
} | 1 |
e41eded68711fd939173e1e63130fc1f | 421bbf3f393f9f7fd122f9529f262d23 | set up temporary file name for writing bones, to avoid another game's
trying to read from an uncompleted bones file. we want an uncontentious
name, so use one in the namespace reserved for this game's level files.
(we are not reading or writing level files while writing bones files, so
the same array may be used inste... | {
ti99_lvl2_imgref *image = (ti99_lvl2_imgref *) imgtool_image_extra_bytes(img);
char vol_name[11];
fname_to_str(vol_name, image->vol_name, 11);
snprintf(string, len, "%s", vol_name);
} | 0 |
76a589fefe7deecf23d8770f7151abad | e47177e004d2953dd645545ceeb3e298 | Used internally to turn a pickled object in the database into a Python object. | try:
obj = loads(pickled_string)
except Exception as e:
raise UnpickleError('Could not unpickle', pickled_string, e)
return obj | 1 |
9aa142f9564d0390889a0e3b5eb9bab3 | 8cfe3b4e8675bed316be191ae1d40e8b | Procurar utilizadores por aprovar | public ResponseEntity<List<User>> getAllUsers(){
List<User> user = userDAO.list("APPROVED");
return new ResponseEntity<List<User>>(user,HttpStatus.OK);
} | 1 |
f791f604a7b86785f9980210de3fe9bc | da1b2f7dfed051ddf5ea0bf74bf3e7e4 | Setup the port. Returns success. | {
#if !defined(__MINGW32__)
g_device_port = open( device_name, O_RDWR );
if( g_device_port < 0 )
{
return 0;
}
close( g_device_port );
#else
g_hdevices = CreateFile( device_name, GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 );
if( g_hdevices == INVALID_HANDLE_VALUE )
{
return 0;
}
CloseHandle( g_hdevices );
#... | 1 |
78cc76114394641631ecf8c121344e2d | 8a02b0f6e4a4b39c8eee7e59d59eb884 | Sends a keypress of the powerkey to the TV. | class FireTV:
def key_e(self):
self._key(KEY_E) | 0 |
0a1c1b3a3e336317d04b4090212da0be | 1fc563b0f28a1a4419ec8b35b5863151 | Function to break a tie given the two hands and the hand value (both hands have same value, hence the tie). | namespace ConsoleApplication1
class Test
public static int High_Card_Tie_Breaker(Hand hand1, Hand hand2)
{
int i;
for (i = 0; i < Global.hand_size; i++)
if (hand1.m_hand[i].m_pip > hand2.m_hand[i].m_pip)
return 1;
else if (hand1.m_h... | 1 |
84360a54c335d602424b83d8e3f90b8d | ef8fd7e3e1d53dc6f396affb6ba05fc9 | Returns approximate time taken (ms) by task execution. | public function getTimeExecution(): int; | 1 |
16bbcbc02fcbdb5278156797b77c8f43 | 5e85049318167f26f3304ab4770d7dad | Save paper abstracts in csv file | {
CString filename;
filename.Format("data\\data_%d.txt", ct);
FILE* p = fopen(filename, "w");
fprintf(p, "%s*\n",title);
fprintf(p, "%s*\n",en_title);
fprintf(p, "%s*\n",author);
fprintf(p, "%s*\n",en_author);
fprintf(p, "%s*\n",company);
fprintf(p, "%s*\n",en_company);
fprintf(p, "%s*\n",CNAbstract);
fprint... | 0 |
cad0af7458f023fbce56ec36466632bc | c5224e2da83b52710bdc72c43fd25782 | Tell the other side what encoding we are using.
Errors are ignored. | class Connect(object):
def sendEncoding(self, encoding):
self.encoding = encoding
self.solver.encoding = self.encoding
self.solver.reset()
return 1 | 1 |
8b5cdcaa113cdf6b3cefe48c16ea3473 | a5e12a3197b14544bf7b99f98a879bb3 | 批量修改当前目录下文件的文件名,排除指定的属性 | def bulk_replace_name(path, old_name, replace_name):
under_file = read_under_files(path)
for f_name in under_file:
print(f_name, " to ", replace_file_name(f_name, old_name, replace_name)) | 0 |
6e3e09f646d86e06382b44e53e869936 | 2758129bbda089939d665d8d8d1a343c | Returns an enumerator over the events in the event stream. | namespace Melanchall.DryWetMidi.Core
public sealed class EventsCollection : ICollection<MidiEvent>
public IEnumerator<MidiEvent> GetEnumerator()
{
return _events.GetEnumerator();
} | 1 |
b8398114a44d9361678b6c6f41f2ba7d | 04acd63147bbd8b8450837e63098befd | Updates lock timeout information on this item. | class ParameterItem(object):
def _onUpdateTimeout(self):
self._updateItem() | 0 |
37f695ea05b71d846babdf9120e4225c | bd55224834690ca75c6c6c011a95582a | return data for a list of subjects. | def get_data():
input_file = open(FILENAME)
subjects = []
for line in input_file:
line = line.strip()
parts = line.split(',')
parts[2] = int(parts[2])
subjects.append(parts)
input_file.close()
return subjects | 1 |
59f12d5e8b779a9ae6e3ca8ed28a5dd8 | 7b5cb2ea344e9181acd8771e2ccf7ba1 | Given 2 ints, a and b, return true if one if them is 10 or if their
sum is 10. | if a==10 or b==10 or a+b==10:
return True
else:
return False | 1 |
8b36dad8e8e98f18ebba98fbdca3cb35 | 8c745d055ab293ff700dcf43e70dd2c1 | Get next no empty outputstream line. | public function nextLine(); | 0 |
1bbb434973c738458480e4d6b0172f61 | 84b4ef06067471feea1d0dfe96ca8661 | Controlling function for the autoupdate button. Begins the progress
bar counting iff it does not already exist and is counting. | cancelProgressTimer();
UPDATE_PROGRESS_TIMER = new Timer();
progressTimerTask = new ProgressTimerTask();
UPDATE_PROGRESS_TIMER.schedule(progressTimerTask, 0, 200);
} | 1 |
84dea9a6458e523240942e01c6bd9c85 | ea055c1562dcf4add33f239311cd3da7 | Flag to indicate all LEDs connected in reverse | namespace ES.Ascom.Alpaca.Devices
void SetReversed(bool reversed); | 1 |
63d8ad7eac1f98199dd01c7fdc5e3c41 | de1e25c87448f9c5563537f05fd9e83f | Records a domain event | protected addDomainEvent( domainEvent: IDomainEvent ): void {
this._domainEvents.push( domainEvent );
DomainEvents.markAggregateForDispatch(this);
this.logDomainEventAdded( domainEvent );
} | 1 |
104b4274ca47a2375208f1bc665f8663 | 98fc4c602ff502f63a34fa0ef1398796 | 利用CBOE的计算方法,计算历史某一日的未来30日期权波动率指数VIX | if end:
if not start:
raise ValueError('specify "start" when specifying "end" date.')
return web.DataReader('^VIX', 'yahoo', start, end)['Adj Close'] | 0 |
7307471aaea805d89d098ec3fe6f3be5 | 23904ad4c2d71612e2d9bb4b673b7486 | Setter for <code>V_BOOK.LANGUAGE_ID</code>. | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.2" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class BookRecord extends org.jooq.impl.UpdatableRecordImpl<dev.christian.jooq.gen.tables.records.Boo... | 1 |
c450e337fefe51a75b1d0955e9a8cfa0 | 8b0bf68cb945c4bb64b1f3c266eca60e | Function used to compute storage columns given the storage model | class ComputationGraphTransformer(Transformer):
def allocate_storage(self): | 0 |
c7ffa3e83326b2edd36dc2d2d13ea045 | 7a3892d889113717e7e706ff100e201b | Return the count of variants with the given aid | Integer findCount(String aid); | 1 |
b96f5fe2cce8f3cbd06097f74f3a4c00 | ea109a2b969a5c5942e83d0171145e29 | Upon selection of a state, a sub-list of packages gets loaded. | void PackMan2ExtendedFrm::lstPackagesSelected(wxListEvent& event)
{
selectedPackage = event.GetIndex();
DevPakInfo info = entryInfo.at(selectedPackage);
edtUrl->SetValue(info.Url);
edtUrl->SetToolTip(info.Url);
mmoPackageDescription->SetValue(info.Description);
edtPackageVersion->SetValue(info.A... | 0 |
b65c7286f3b3b58feb0fa31357d2da6f | 4385d37394f00507872e59dfc09c845a | Unmount the FDI file-system. | ufs_funmount_cleanup()
{
struct ufsvfs *ufsvfsp;
extern struct ufsvfs *oldufsvfslist, *ufsvfslist;
mutex_enter(&ufsvfs_mutex);
while ((ufsvfsp = oldufsvfslist) != NULL) {
oldufsvfslist = ufsvfsp->vfs_next;
mutex_destroy(&ufsvfsp->vfs_lock);
kmem_free(ufsvfsp, sizeof (struct ufsvfs));
}
oldufsvfslist = ufsv... | 0 |
ca9cdd883e34d19b53c893a541787306 | 8dddf965908a585c58100b38a159f8f1 | This method is called when an exception has been thrown from a mock. | class ThrowableMessageHandlerMock extends MessageHandlerMock implements ThrowableMessageHandlerInterface
public function handle(ReceivedMessage $message): void
{
parent::handle($message);
if ($this->shouldThrowException) {
throw $this->shouldThrowException;
}
} | 0 |
d59762f7c390af8cb62eb7ad74805a25 | e37c665dc9087482d2fb34966616c9be | Method which is called when the key gesture is executed, saves the note. | public abstract class Note
abstract void take(String str); | 0 |
5412261f08a9a1e8954c0172d922c207 | 849fc18d1abcbf8001018662a635058c | method for closing the app and returning to main menu | public class MazeDisplay extends JFrame implements KeyListener, ComponentListener{
public void returnFunc() {
setVisible(false);
try {
MainMenu frame = new MainMenu();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
} | 1 |
c0ba59e5f741897a8d726c2af033c148 | 9871b7a6cb8f122a64c1dd59a6502b0f | 获取生肖名称 | final String[] Animals = new String[] { "鼠", "牛", "虎", "兔", "龙", "蛇",
"马", "羊", "猴", "鸡", "狗", "猪" };
return Animals[(year - 4) % 12];
} | 1 |
f71db193fe1f366fc13bc8f4f257a44e | f50d75275ac18bfd2d14a74b2fe73569 | \brief Performs a synchronous write on the specified MCAL DIO port. | void ioDigitalWrite(vuchar *port, uchar pinMask, uchar level)
{
_hal_ioDigitalWrite(port, pinMask, level);
} | 1 |
94edb639ccbfb9a3ebb9953110ce1c3f | 4e37cc727c2bc7d42ce0f469a2604ee6 | #' Function to get marginal probability of each move for each participant | {
trans_prob <- unlist(tab[nrow(tab), grepl('^q[A-Z][A-Z]$', names(tab)), drop=T])
max.transition.rate <- names(trans_prob)[which.max(trans_prob)]
maj.val <- substr(max.transition.rate, nchar(max.transition.rate), nchar(max.transition.rate))
maj.val.original <- as.character(VARIABLE.recoding$original[m... | 0 |
5afc4414c546322b48001477607b5ea5 | 968db0deeab13fe0a4e02ff25e38c472 | For fixed component count, do nothing. | class SlowResponseThermalFixed(SlowResponseThermal):
def get_param_count(self):
return 0 | 1 |
4967386f43b8e6006a3d63b575218cda | ea4e0f4c834f085ea737244c166bda21 | Builds the toppings dropdowns from the list of toppings | return toppings.map((i) => {
if (selectedToppings.includes(i.name)) {
i.selected = true;
}
return i;
});
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.