query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5bfe9067784052e9e9750a6319447e7a | 80186aee1d81d2dbcdc0edfef7955912 | Tests printing configuration | config = ConfigYAML()
config.symlinks['~/git/dotfiles/testfile'] = '~/.testfile'
config.symlinks['~/git/dotfiles/testconfig'] = '~/.testconfig'
config.save()
configpath = os.path.join(self.homedir, '.symconfig')
config = self.loadConfig(configpath)
i = 0
p... | 1 |
3816250b9a1b8b7fc41d2004f2647f10 | eefb59d59615246898a59cbb462a6bc5 | 由k-频繁项集候选集生成实际的频繁项集 | itemCount = dict()
for item in ck:
for data in self.dataSet:
if item.issubset(data):
if item not in itemCount:
itemCount[item] = 1
else:
itemCount[item] += 1
lk = set()
f... | 1 |
c1ab5386cf300827c3f063367dca0547 | 55f04879aba0b66bcc38c3983264886e | Печатает информацию об альбомах | class PicasaAlbum(Album):
def printAlbumList(self):
for a in self.getAlbumList():
print '%s %s [%s] %4s: %s' % (a.gphoto_id.text, a.timestamp.isoformat(),
a.access.text[:4], a.numphotos.text, a.title.text) | 1 |
978b7df259cc9982d0473d59e6239163 | ac848dc40968a4b88adace600e3856a1 | (asynchronously)
Gets an array of Match Keys for the given event key that have timeseries data. Returns an empty array if no matches have timeseries data. *WARNING:* This is *not* official data, and is subject to a significant possibility of error, or missing data. Do not rely on this data for any purpose. In fact, pre... | namespace TBAAPI.V3Client.Api
public partial class EventApi : IEventApi
public Object GetEventPredictions (string eventKey, string ifModifiedSince = default(string))
{
ApiResponse<Object> localVarResponse = GetEventPredictionsWithHttpInfo(eventKey, ifModifiedSince);
return localVar... | 0 |
a2bee39a7142a2a670db9a87765925b7 | c601bd0152537914ac5a151a257af0be | Gets the Request object. It will create one from the globals if one is not set. | {
if (self::$request === null) {
self::$request = Request::buildFromGlobals();
}
return self::$request;
} | 1 |
90d11d20ec28f090a6be19acfbafafa0 | d4666d2bb55d91b3596e6f9750506909 | Indicates whether window magnification is enabled on specified display. | namespace Vanara.PInvoke
public static partial class Magnification
[DllImport(Lib_Magnification, SetLastError = false, ExactSpelling = true)]
[PInvokeData("magnification.h", MSDNShortId = "NF:magnification.MagGetWindowTransform")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool MagGetWindowTran... | 0 |
06326fc67ac1b46f5ce7e1a3ef3dfb30 | 4a6cc12dedce07c8725538053cae06d7 | Derivative of exponential spline. | class LogLink(Link):
def inverse_derivative(self, lin_pred):
return np.exp(lin_pred) | 0 |
fbbfcbb1b39e0932619380f7fea7e4be | e940b3c6c540d34a577cea2eae284606 | 구의 부피를 구해 주는 함수 | double Volume(ball &b) {
return double(4.0 / 3 * M_PI * b.r * b.r);
} | 1 |
be165e4687e19c89272412864b1f41a0 | 44891d1915d4fdf5b1f8a5e274372012 | Allows to add a new section to About page | {
$section = new Section(\count($this->_sections) + 1, $settings);
$this->_sections[] = $section;
return $section;
} | 1 |
2aef7b3b7c4a17ce9efa0ef3ff600914 | 1ab520292a23322ecfbf0bda480471ad | Create a color palette with 256 different gray values. | namespace TransImage
public class TransPicture
private static ColorPalette GetGrayScalePalette()
{
Bitmap bitmap = new Bitmap(1, 1, PixelFormat.Format8bppIndexed);
ColorPalette palette = bitmap.Palette;
bitmap.Dispose();
for (int i = 0; i < 256; i++)
... | 1 |
736e90cd6c172e925b174c17427c2336 | 1ea16c344a7e9b567d70ec080bc69164 | The constructor simply sets up the different data members, and if
the caller doesn't provide a compare function of their own, specifies
the default comparison function. | class AbstractSort
AbstractSort(unique_ptr<T[]> uPtArr, int size)
{
this->size = size;
this->uPtArr = move(uPtArr);
numComp = 0;
} | 0 |
d8df1f0474c654cfd48a5df3c8319dcf | 3f006ce99b7541b96e6bee9fc0350e8d | Checks if there is a loaded lever at the specified location. | Condition.argNotNull("loc", loc);
Condition.check(loc.getWorld() != null, "World must be present");
int h = loc.getWorld().getMaxHeight();
if(loc.getY() >= h) return false;
loc = loc.clone();
for(int i = loc.getBlockY(); i < h; i++){
if(!loc.add(0, 1, 0).getBl... | 0 |
944495cb865e295822c56b7404eb53f3 | 54a37e648cac0835a58f7581e19100f2 | 启动时测试一下我本地的IPV6环境, 请将这个域名修改你项目的CDN地址 | function ipv6test()
if rtos.bsp() ~= "EC618" then
while 1 do
log.info("ipv6", "only Air780E/Air600E/Air780UG/Air700E supported")
sys.wait(1000)
end
end
mobile.ipv6(true)
log.info("ipv6", "等待联网")
sys.waitUntil("IP_READY")
log.info("ipv6", "联网完成")
sys.wa... | 1 |
f1d217a948fec0d9f3086eb0b1d4234f | 0a466c0bb36bdc99d54411924ecc9ff0 | 用递归判断牌型是否构成胡牌(已经不包括雀头) | class GameFujin
public function judge_hun_type ($chair)
{
$fanhun_arr = array();
foreach ($this->m_hun_card as $fanhun_key=>$fanhun_card)
{
$one_fanhun_num = $this->list_find($chair, $fanhun_card);
$one_fanhun_type = $this->get_card_type($fanhun_card);
... | 0 |
1879953a101b07cef08599e4caae13c8 | 2aad33389e97938c3385b66d5d60c756 | Gets the value of the reviewPeriodID property. | String getPerfReviewId(); | 0 |
8c9e06d432c22ffeccf6d43441845164 | 3a5505d72268758e801f90474030da42 | POST: api/PersonalAccount/MeterReadings | namespace AMSLLC.Listener.Service.Implementation.WecoMobile
[OperationContract]
[FaultContract(typeof(ServiceFaultDetails))]
void AddMeterTestResults(MeterTestResultsRequest request); | 0 |
8c03370d25bf4c3db682c693f731f199 | 1cb0b2ba6f9e290e86039567018e4f71 | 统计登录 | function loginCountLog($name)
{
$count = \think\Cache::get($name);
if (!$count) {
\think\Cache::set($name, '1');
} else {
if ($count > 4) {
\think\Cache::set($name, '1');
return ['code' => '0', 'msg' => '登录错误超过6次,账号已冻结'];
}
\think\Cache::set($name, $co... | 1 |
a1b35801d2e4666027405cc3a6be814b | 598fff4bfb320c75fbbe8b18b586678b | Retrieve the number of ports the sensor uses. | public int getNumberOfPorts(); | 1 |
c0189000f7887cfb2d08e004c2c2dd35 | 3877cba3269f73c548aec334f3783479 | Returns the last group in the ordered set where uuid = ?. | public UserOTPRegistration fetchByUuid_Last(String uuid,
com.liferay.portal.kernel.util.OrderByComparator<UserOTPRegistration> orderByComparator); | 1 |
936a80c7f371aa6a8bae4b304bdf2d23 | 53df89cc1aa234c57338a5c3836b0d1f | Función que a partir de una lista de etiquetas enteras de color, devuelve
una lista con las cadenas asociadas a cada número. | def get_colors_strings(list_int_colors):
res = []
for i in list_int_colors:
res.append(color_map(i + 1))
return res | 1 |
bbd4df08d9a7d7a1bfaffa4de483ba61 | 3e5f37ba9464579a735ba7e077f115f5 | Sterge toate produsele din cos | const thisCart = this;
for(let product of thisCart.products){
console.log(product);
product.dom.wrapper.remove();
}
thisCart.products = [];
thisCart.update();
} | 1 |
1aa12de0fa622d1a43fadcb2c80b77e6 | 0cea6667b18d1c494ab3e2c427912629 | Função para verificar se a segunda String esta contida no final da primeira. | flag = True
if end > length(string):
end = length(string)
for var in range(length(a)):
if a[var] == string[end-(length(a)-1-var)]:
flag = True and flag
else:
flag = False
return flag | 0 |
dcb006272e32512e32f9cf7f2038352e | 8166b1222de83188e81456fde8e4d515 | 跳转至导入通讯录界面 | class MainPage(BasePage):
def goto_import_contact(self):
WebDriverWait(self.driver, 5).until(expected_conditions.presence_of_element_located
((By.CSS_SELECTOR, ".index_service_cnt_itemWrap:nth-child(2)")))
self.find(By.CSS_SELECTOR, ".index_service_cnt_itemWra... | 1 |
b4e51b51b28583bdac6b3265c6caf9e6 | 0617804feea0f5b4751d572757bef5f7 | ZWrBfr()
This function writes a buffer to a file, one line at a time. It is
passed an output file index and pointers to the beginning and end of the
buffer to be output. | {
char* buffer = (char*) bbuffer;
int i;
for (i = 0; i < nb_to_write; i++)
file_write_char (F, buffer[i]);
} | 0 |
f46321c85891e47a695c7162ac57acc5 | 0a80cbd3f6bc9ced4e5ccb185d6a7d79 | Supprime un ou plusieurs documents | class DocumentController extends Controller
public function destroy($id)
{
$ids = explode(",", $id);
$docs = Document::whereIn('id', $ids)->get();
if (count($ids) > 0) {
foreach ($docs as $doc) {
$doc->delete();
}
}
return new DocumentC... | 1 |
47ff9e2a6a036e52051109d4c23ea4ff | f9d5224f7efe4f08efc5aab7e9c5b3a2 | 1) configure the system to use RCC2 for advanced features
such as 400 MHz PLL and non-integer System Clock Divisor | void SystemClock_Config2(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
__PWR_CLK_ENABLE();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStr... | 0 |
5e43f332c210333849732bad59979a8a | ad6816cb35f919e3b8cec2f589aaab34 | Simulates combat between cowboys and aliens | def boy_cow_hit(lg_settings, stats, screen, bsb, boy, dogs, pigs, cows,
gshits, bshits, ghearts, bhearts):
if stats.boy_left > 0:
stats.boy_left -= lg_settings.cow_points
bsb.prep_energy()
gshits.empty()
bshits.empty()
ghearts.empty()
bhearts.empty()
... | 0 |
c27d42ef0bf9fa943389f0ff0b5db741 | 15e0afd120274fd308df78918241c824 | Display a listing of the CustomField. | class CustomFieldController extends Controller
public function index(Request $request, School $school)
{
$query = CustomField::query();
if (!empty($request->role)) {
$query->where('roles', 'all')->orWhereRaw("FIND_IN_SET(?, roles)", [$request->role]);
}
if(!empty($request... | 1 |
37e1e1f370608a0e35c2c60448e97aff | 71c79f465efc818ae093873540bb392e | Auto load the cFeed libs. | {
$oAuthClasses = array(
'OAuthException',
'OAuthConsumer',
'OAuthToken',
'OAuthSignatureMethod',
'OAuthSignatureMethod_HMAC_SHA1',
'OAuthSignatureMethod_PLAINTEXT',
'OAuthSignatureMethod_RSA_SHA1',
'OAuthRequest... | 0 |
db72ff429e86c1672a55a82a2be98b85 | 8c4780fc471e0688719aa3b2093582bb | The length of the box in the x axis | public class Building
public int getXLen() {
return xlen;
} | 1 |
86d7bd7b0e945282f7fb7c4bda598cb6 | 27ae77c2bbe649753e153c16ac98c954 | 插入已读公告记录 | class MIM_Notice{
static function Read($nid){
try {
$db = GetDB();
} catch (Exception $e) {
return false;
}
return $db->Update(MIMConfig::_table_mim_notice, array('SID'=>$nid), array('STATUS'=>'1'));
} | 0 |
3c2c75bcc30c55d1086e644b4898056d | 6a4ec668cfac8c1a23431f3b67e9911e | Test case for v1alpha3_unpause | class TestDefaultApi(unittest.TestCase):
def test_v1alpha3_unfreeze(self):
pass | 0 |
975be1866a4569cd961c75899cd19c50 | 71aaa78673bef20b4ddaaef332acbedc | Convert a TMS to Google Tile coordinates. | class Tile(BaseTile):
def google(self):
tms_x, tms_y = self.tms
return tms_x, (2 ** self.zoom - 1) - tms_y | 1 |
cb127102befa91dffaf93f48317f4506 | a01e148c82880804b724aa89f3c42b0a | Массив с атрибутами игры, которые можно читать | public class ReadGameInfo : MonoBehaviour
private string[] PropertyToItem()
{
List<string> item = new List<string>();
item.Add(String.Format("{0} = {1}", "CoinToStart", CoinToStart));
item.Add(String.Format("{0} = {1}", "GameMode", GameMode));
item.Add(String.Format("{0} = {1}", "Ins... | 1 |
6d0471fdde5727d681d7855c95e07397 | f9a991293efdf04f079602d3aeb63af9 | Test to_dict in submission | class TestBaseModel(unittest.TestCase):
def test_to_dict_base_model(self):
test_dict = self.b.to_dict()
self.assertEqual(self.b.__class__.__name__, 'BaseModel')
self.assertIsInstance(test_dict['created_at'], str)
self.assertIsInstance(test_dict['updated_at'], str) | 1 |
55a118e8e74bb374de1fbfbf784ab03a | 335a241be3a8484b4f0f709a231d31ff | Gets the location of a given object. | abstract public class AbstractDataParser
protected DataLocation lookupDataLocation(Object object)
{
return dataLocationMap().get(object);
} | 1 |
e45647de62f254adb3fe1e1c5dea1f14 | e0101834b272b64d85eb0047bb82f867 | 根据导航bar更新UI面板 | public class MainActivity extends SlidingActivity implements View.OnClickListener{
private void updateView(int i) {
for (int j = 0; j < 5; j++) {
if (i == j) {
nav_Imgs.get(j).setImageResource(resId[j]);
} else {
nav_Imgs.get(j).setImageResource(resIdU[j])... | 1 |
8b9c9f3cc4ca8518a952cae42aedc938 | ba44f272faf81d96e3144c61b0007629 | Gets a Listen Parameter, used to query the status of Listen
and/or VoiceWakeup feature.
"ListenFeature" or "VoiceWakeupFeature"
<br> Status is not returned | var dbMainLO = Ti.Database.open('main');
var rowLO = dbMainLO.execute("SELECT listen FROM handoff_status WHERE handoff_id = 1");
var listenStatus = 0;
if(rowLO.isValidRow()){
listenStatus = rowLO.field(0);
}
rowLO.close();
Titanium.App.Properties.setInt('ListenStatus',listenStatus);
return listenStatus;
} | 1 |
22941283ad0422d3d4bdbb8559937c27 | 8dbeb91d1e0ee703f488390cfcf9e2be | 获取最大字体大小【单位: px】 | public int getMaxFontSize(T doc); | 1 |
cbcad10686256bfe53caaee11c781d6f | 10b17fa450fc740060fcc01b06372144 | Returns the remaining capacity in this journal until the rollover happens. | int remaining(); | 1 |
98ac012b8a6a680c36ef9f72f8ba78b3 | 06b144e1b27ea796b0791277e11fcdeb | Returns cache clear command instance. | class CacheClearCommand extends Command
public function __construct(PathServiceInterface $pathService)
{
parent::__construct();
$this->pathService = $pathService;
} | 0 |
61b61fbb2fa9975396432f56a217f28b | 805f689f0b2e7c0c02911d514567463e | Features are returned in the order of the given IDs. | class VCDStoreBackendInterface(object):
def get_features_by(self, descriptor_id=None, video_id=None, frame_num=None,
timestamp=None, spacial_x=None, spacial_y=None):
return () | 0 |
918297e7596899468103522ab7b8781c | 3ce7bd4af8ff56d50331d7439d9b8752 | Gets the search status.
This solver information is provided by the COS 12.8 CP solver in addition/replacement to solve_status.
Value is None if the solver is earlier than this version.
Returns:
Search status, element of the global list :const:`ALL_SEARCH_STATUSES`.
None if not defined. | try:
return self.problemGetData(solufileprobname, 'SoluFileStatus')
except KeyError:
print(self.getIdentification() + " has no solu file status for ", solufileprobname)
return None | 0 |
b7d66670d147ac83c8f901ebc066b9ce | cbac7b3bf4e9524c5cc2c72f09909779 | 带ThreadFactory的线程池,可以设置线程id,线程名,线程优先级等参数 | int minThreadNum, long freeTimeout, long busyTimeout) {
return new ThreadPoolImp(threadPoolName, maxThreadNum, minThreadNum,
freeTimeout, busyTimeout);
} | 0 |
e17d6b1bd840ba4aa49610cfb2567ff2 | 7f9b8a9acff42ddf9b1fc38374f92c9a | previamente a guardar un fichero en la base de datos se laza automáticamente este evento que obtiene la entidad
Documento y seguidamente carga el fichero que llega adjunto desde el cliente | if (event != null) {
UploadItem item = event.getUploadItem();
File file = item.getFile();
String nombreArchivo = item.getFileName();
String urlLectura = getRUTA_ADJUNTOS() + "ADJ_" + System.currentTimeMillis() + "_" + nombreArchivo;
String urlEscritura... | 1 |
0cab7a3dfb3be2066f6b7e381885e713 | dc3fc88dce70417381f6af56abe19978 | Returns a parser that runs the given parser and coerces its result with the given coercion. | public static partial class Parser
public static IParser<Positioned<T>> Positioned<T>(this IParser<T> parser) => new PositionedParser<T>(parser); | 0 |
2592e2f223ede3c77ec4b8a718ebae3e | 9b15925b64951e1fef1780485e4bc693 | Checks whether the column is required or not. | namespace CRMEntityMapping.Infrastructure.Mapping.CRM.Configuration
public class PropertyConfiguration<TBizEntity> : ConfigurationBase
public PropertyConfiguration<TBizEntity> IsRequired(bool required = false)
{
IsRequiredColumn = required;
return this;
} | 0 |
667653fbb5ba4cc904d47f8d4ee4ac54 | a8903a79f499743c640b8d70ca558a98 | 获取堆的长度 | export class Heap<T>
size(): number {
const h: T[] = this.items.get(this)
return h.length
} | 1 |
e063e77b759d0328d99283bd95664b20 | 686a557ce3f5c524bc0372efc52b915b | 返回self的当前年龄,用日表示 | class DOB:
def get_age(self):
return datetime.datetime.now().year - self.year | 0 |
8ccd0a29d7c91b625e04bbb5ff324394 | d37d296859301f7d8c166235d2b08743 | Solution for EITHER p2_singleton or the claiming spend case for p2_singleton_or_delayed_puzhash | all_nonstd_txs = []
all_ds_txs = []
for tx in spend:
nonstd_txs, ds_txs, rejected_txs = self.run_scenario2(conn, [tx], num_txs_to_create, locking_script, num_ds_to_create, [], shuffle_txs, False, money_to_spend, timeout)
all_nonstd_txs += nonstd_txs
all_ds_txs... | 0 |
d5d3a5a5c5df8906a6e384880f31fccd | 5d8ad218fa68af654bd615ec44af934f | increment (increase by one) the byte at the data pointer. | self.tape[self.data_ptr] += 1
if self.tape[self.data_ptr] == 256:
self.tape[self.data_ptr] = 0 | 1 |
25311add8c53b446dd75095125230d05 | cf28a3a2a24adbbb04f4588406a6810d | Writes details about overlap w/ known primers in proper format | def write_report(gdlist, nocds, gc3primevalid, hybridprobe,
blastfilter, single_product, outdir, verbose):
if verbose:
t0 = time.time()
print "Creating summary output ..."
families = defaultdict(set)
for gd in gdlist:
families[gd.family].add(gd.name)
cds_overlap ... | 1 |
b0b611f7c9f21ca5a4ee614ba7406c93 | edf814297733fab616a4158be5e31618 | Ask Unsplash for the access and refresh token
using the provided authorization code. | api_response = requests.post(
url=self.TOKEN_URL,
data={
'client_id': self.client_id,
'client_secret': self.client_secret,
'code': code,
'redirect_uri': self.redirect_uri,
},
headers={'Content-type': ... | 1 |
acfbeaa79e5f43e3dd0c1e94202a2769 | ce63d5c494b67bab2d4c7363aaa27f6e | Returns `True` if `pred(x)` is true for at least one element in the iterable.
Taken from the :mod:`itertools` recipes. | def anyFalse(pred, seq):
return False in itertools.imap(pred,seq) | 0 |
46dbe0c558537960a554df38862c7e64 | a32c86af7eba0c2d3fadf24015e3f602 | Evaluate mse on validation data | iter_loss = []
with torch.no_grad():
for features, labels in valid_iter:
l = self.loss(self.net(features), labels.view(-1, 1)).sum()
iter_loss.append(l.item())
return np.mean(iter_loss) | 1 |
c6c0d9b9b465a6810a9cb1a54cb09dc8 | 81d27eec9f61b66f28e9e84e4e1e58cb | 根据platPartnerId删除user_action_event表数据 | @Service
@Import({
Gas_marketpcDataSourceConfig.class
})
public class Gas_marketpcTestBase extends AutoTestBase{
public List<UserActionEventDO> findUserActionEventByPlatPartnerId(String platPartnerId) {
UserActionEventDOExample exam = new UserActionEventDOExample();
exam.createCriteria().andPlatPartnerIdEqu... | 0 |
c5de353b5ea337336a0ce1d115a7ef56 | 0581f9ab5fd73194196a02451342bdeb | POST: api/Meetings | namespace RoutePlannerApi.Controllers
[Route("api/[controller]")]
[RightsAuthorize(Right.Admin)]
[ApiController]
public class MeetingsController : Controller
[HttpPost("")]
public async Task<ActionResult> CreateMeeting([FromBody] Meeting meeting)
{
var meetingId = await _meet... | 1 |
bc53f2c16eb7326ed8fb2a5a7ee9cdfa | bb801688aabcca827e5db8bd993d146d | Add a NamedObject to the ObjectManager. These are searched when getting
an object by LSID. | public abstract void setNamedObject( String name, long recid )
throws IOException; | 1 |
08c1cc82ba01650f8d1fd05ad206cac3 | cc64190ac08fee39716a742c1bd64cc7 | 查询机构下的社团 | async function queryCommunityList(params) {
return request(`/api/v1/community/org/group/list/${params.OrganizationId}?${stringify(params)}`)
} | 1 |
421b5e04536bdb4e87bdf238c8fda89f | 7ff486a72d2a2cdb15441272787e6741 | parses regular expression into elements | {
$return = [
'regexp' => null,
'params' => [],
];
$arRegexp = explode('/', trim($this->regexp, " \t\n\r\0\x0B/"));
foreach ($arRegexp as $key => $value) {
if (preg_match('/^([a-z_0-9\-]*)<([a-z_]{1}[a-z_0-9]*):?\s*([^><:]*)\s*>([a-z_0-9\-]*)$/i', ... | 1 |
4f38844d61c22656f7dcfac7c380c052 | 049aea6092d3dc1d2489cbd313d61abc | Code to access data from DB and display wait box.
CHECKED | {
IPatientHome PManager = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");
System.Data.DataTable theDt = PManager.GetPatientWaitList(patientID);
grdWaitingList.DataSource = theDt;
Session["dtWai... | 1 |
ba4ca94d37aac2f16d296a0a532aef3c | 2c158913920784bbd4fde90f0a1f4e1b | sends a message to all connected clients, including the current client | public abstract class AppPlug<A extends AppPlug<A, B>, B extends ClientHandler<A>>
protected void sendAll(String msg) {
chGroup.write(new TextWebSocketFrame(msg));
} | 1 |
f6db27cf980dfaf1042782c3c574d972 | de521b8090c5de9963e718367fb18442 | Converts image grid to RGB raster image. | public class ImageRenderer
private BufferedImage convertBitmapToImage(Color[][] bitmap) {
image = new BufferedImage(imageWidth, imageHeight,
BufferedImage.TYPE_INT_RGB);
for (int x = 0; x < imageWidth - 1; x++) {
for (int y = 0; y < imageHeight - 1; y++) {
int rgb = bitmap[x][y].getRGB();
image... | 1 |
3664191aa0ac163b2a9fa7b348b4e355 | 95a7580ee7830952040268313ac8627b | Converts a managed <see cref="Color"/> object to a COLORREF used by native drawing routines. | namespace JCE.Utils.Extensions
public static class ColorExtensions
public static int ToOleColor(this Color color)
{
return ColorTranslator.ToOle(color);
} | 1 |
6585fc09334553153f8115110670ad69 | 791128e7307016002f4bc2690fdabdfd | Scans directory asynchronously. | namespace ClamAV.Managed
void ScanDirectory(string directoryPath, FileScannedCallback fileScannedCallback); | 0 |
ed1d0d8e95f49aef73aa969141b0be9b | cae6a44a9222dcbc8fc5669f9e954990 | Creates a thread to time the ballot, closing it after a given time,
or after all registered students have voted | def go(t1):
while True:
print("Time of voting is 1 minutes:")
my_time = datetime.datetime.now() - t1
str_time = str(my_time).split(':')
str_sec = str_time[2].split('.')
print(str_time[0],":",str_time[1],":",str_sec[0])
time.sleep(0.9)
os.system('cls')
... | 0 |
71ec1a057957db36d84dd06360bc5323 | c4abf846eeb0146d0e2131238269bbfb | la fonction permet de récupérer les informations des stands | class StandsController extends Controller
public function index()
{
$stands=Stands::all();
return view("stands.index",compact('stands'));
} | 1 |
d8ba59afec8e6e799345472d3faf9c51 | acacb017b510674a25c2413e70bd5b21 | Registers attached merge tags | {
$fields = ['Subject', 'Content', 'Callout'];
$syntax = self::config()->mail_merge_syntax;
$regex = $syntax;
$regex = preg_quote($regex);
$regex = str_replace("MERGETAG", "([\w\.]+)", $regex);
$allMatches = [];
foreach ($fields as $field) {
$conte... | 0 |
8c2eadd95c89e23bd20f0223cdc0aa3a | 536f370f741f3e6ce893ae879d9eee14 | Clear answer array. | public function clearAnswer(QaContext $qaContext); | 1 |
efa7ea07077661ce1a214e2d82c65e6d | 3e7d9f60fd40cdb9d5bd255b43091a68 | 获取博客基础导航信息 | BlogHomeInfoDTO getBlogInfo(); | 1 |
e0c5501b448d7d5256dd2f56673524ad | eeb89594706cf97024366538f08d6cbd | Determine if the "end date" was reached. | public boolean hasEnded() {
return getEndDate() != null && !getEndDate().after(new Date());
} | 1 |
d9129e2a8fbc1ae81956f7275133c7b0 | 0b5a00e15c70390af7f2a283d3978105 | Returns absolute path of any file name relative to the [App]'s save directory. | let home;
switch (process.platform) {
case "win32":
case "win64":
home = process.env.LOCALAPPDATA || process.env.APPDATA;
if (!home) {
throw new Error(
"Couldn't find the base application data folder",
... | 1 |
b37d8ce58e5fc6b0cd425139226d33a9 | 026f919976e34b425955cf649935bdc9 | Helper to compute the communication based on the batch. | fz = density_stats.fz
pz = density_stats.pz
r, d = fz.shape
D = density_stats.D
df_distance = density_stats.df_distances[batch_index]
dL_distance = np.sum(df_distance * (fz - pz).reshape(r, d, 1), axis=0)
return D.dot(dL_distance)/float(r) | 1 |
d2ace711be730f221562df8636577301 | af26674276040e076698d8fe893fcb45 | Gets average of estimated standard deviation of gyroscope bias coordinates. | public class TurntableGyroscopeCalibrator implements
GyroscopeNonLinearCalibrator, UnknownBiasGyroscopeCalibrator,
GyroscopeCalibrationSource, GyroscopeBiasUncertaintySource,
UnorderedStandardDeviationBodyKinematicsGyroscopeCalibrator,
AccelerometerDependentGyroscopeCalibrator
public Dou... | 0 |
e918a810cfbb9a6c9b12218389d55ca9 | 55ab40922fd0b2e99625e7317a82de75 | returns the number of rows in a truth table based on number of columns | def ncols(nparameters, row_per_column):
ncols=nparameters/row_per_column
return ncols | 0 |
d50fbf5e882bc393ea71ee64bbb22e40 | 3edfe1be11643cabb6041ad0725e0cee | Create a new quote model. | class Quote extends Data
public function __construct(
\Magento\Framework\App\Helper\Context $helperContext,
\Magento\Framework\Model\Context $context,
\Magento\Framework\App\Request\Http $request,
\Magento\Framework\Encryption\Encryptor $encryptor,
\Magento\Framework\UrlInterface... | 1 |
ed5657d0ef1f91aaae3952a7e88ac1bf | 516a0fc0ba1b0f897b653ea314b98541 | Vyrezetuje hru, používá se po skončení hry. | namespace GoE.GameLogic
void finishGame(); | 1 |
73a3159b74b47f8e23e3b6398cfe1216 | 44adb6ecb77633990d7c7ec00144b144 | 检查传入的Element是否符合驼式命名法、如果不符合,则输出警告信息 | void JXml::CheckElementNames(const TiXmlElement* lis,bool checkrepeated,std::string names)const{
vector<string> vnames;
vector<string> vnamesr;
const unsigned nv=fun::VectorSplitStr(" ",fun::StrTrimRepeated(names),vnames);
for(unsigned c=0;c<nv;c++){
if(vnames[c][0]=='*'){
vnames[c]=vnames[c].substr(1... | 0 |
ec7107aeace053c72e22b58106b339b5 | 6de70a725f2ead7a0f3764e16de286d3 | Add a header object for the global variables. | class Manscrew_Mailer
public function addGlobalVar($Name, $Content) {
$this->MergeGlobal[] = array('name' => $Name, 'content' => $Content);
} | 0 |
f1134325d69b785dbf18580ab6b93e0e | 7294f6be7d82a7a55bc5b49e4179c010 | Getter for upload reports right. | public class Application
public String getReporting() {
return reporting;
} | 0 |
7ad1294d8c6879dd445f881a65cdc2df | 5870021572494f70a2766bbab5a6aaa0 | 获取纠纷率是否大于行业均值 | export default class StringUtil
static judgmentRate(data) {
return Object.keys(data).some(keys => {
if (this.filterType(keys)) {
if (keys === 'posFeeRate') {
return this.judgmentRate(data[keys]);
}
return Number(data[keys].min) > Number(data[keys].max);
}
return f... | 0 |
f12848592a7ebe9441c416543e57a1bc | 5413c61ef78eab5520b1e57c24e5a420 | .......................................................................
Send a search box command to connected clients | function doSearch(msg) {
console.log('doSearch: '+msg);
var request=JSON.parse(msg);
audioboxDB.doSearch(request);
} | 0 |
7a29f0cb6f40e3e30f259c52d6de84f9 | 7f1c13a4813f57266443129e4f587498 | {CONDITION_VARIABLE}.signal | javacall_result javacall_os_cond_signal(struct _javacall_cond *c) {
int err;
assert(c != NULL);
if ((err = pthread_cond_signal(&c->condvar)) != 0) {
REPORT_ERROR(pthread_cond_signal);
return JAVACALL_FAIL;
}
return JAVACALL_OK;
} | 1 |
6c1c7ee9d007f11d3dc60e9ef79d8ed9 | b3d4c152446e9a8002e80c83a6832d44 | Symlink all files and directories within source_dir into dest_dir. | paths: Iterable[str], source_directory: str, output_directory: str
) -> None:
for path in paths:
relative_path = os.path.relpath(path, source_directory)
link_path = os.path.join(output_directory, relative_path)
add_symbolic_link(link_path, path) | 1 |
8711fdc5a0ba6915fdc785c8e69c037b | 6dc60da855a2e2a997a84dcf366834c0 | 判断商品是否是上架状态 | class Product(models.Model):
def sale_open(self):
return self.shelf_status == self.UP_SHELF | 1 |
87615dac12cb5fc4c49c617beb94a67e | 884e5a400c232c95f027ceed1b134d54 | To set an handler that will be notified when the backup stars, pauses or terminate | class Heartbeat(object):
def add_listener(self, on_heartbeat_restored=None, on_heartbeat_stopped=None):
self._listeners.append((on_heartbeat_restored, on_heartbeat_stopped)) | 0 |
a1d495178cb6618e0c35a051d97b4923 | e20b8e9b121a75df1f165e843f037e29 | Opens a document from selected items | public class LibraryPanel extends FrameworkPanel implements ActionListener
public void valueChanged(ListSelectionEvent e)
{
openDocument();
} | 1 |
74b9d1cde6aa7e2957e67c3d9e45ea30 | fb6329bf4e9334b1b68be449d45f6799 | Scroll view so current frame would be centered | scrollReference = if(totalHeight <= height()) 0 else height() - totalHeight
recalculateDrawingParameters()
return this
} | 0 |
6d3672fb87b164b7af233f41017a48f2 | 1d7f56b3e95565333472352d086f7598 | Set MOSI, SCK, CS, DC & RES as output | DDR_SPI |= _BV(DD_MOSI) | _BV(DD_SS) | _BV(DD_SCK);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1);
} | 0 |
d8359656647c164cc1b6af289aaeb2d5 | 6613061a69e1ed770d1ece1a4abf645f | Initialize adjacent counntries in North America | Territory* europe_array[7], Territory* africa_array[6], Territory* asia_array[12], Territory* australia_array[4])
{
for(int i=0; i<4; i++) {
world.push_back(australia_array[i]);
}
for(int i=0; i<12; i++) {
world.push_back(asia_array[i]);
}
for(int i=0; i<7; i++) {
... | 0 |
6d1d50399bab83ff3db3f4953977805e | 0e760d5112ebd471d76e787e7f7b9ba4 | Displays two images side-by-side | f, (ax1, ax2) = plt.subplots(1, 2, figsize=figsize)
f.tight_layout()
ax1.imshow(img1,cmap=cm1)
ax1.set_title(title1, fontsize=25)
ax2.imshow(img2,cmap=cm2)
ax2.set_title(title2, fontsize=25)
plt.show() | 1 |
0287d33622c48f61023f08897f0f659a | 1ebf95076aa928ee2d2085c4be8b77e9 | Generate the yaml format config file according to the given yaml dict. | class Configurer(object):
def print2yaml(config_dict, file_name):
config_dict = Configurer._sort_config_dict(config_dict)
Configurer._print_helper(config_dict, open(file_name, 'w')) | 1 |
8a74726dbc4e0fba14b31e59faac0272 | b8cc33a8a239f04dc4e17d0df597b1d1 | Задает поля по кмолчанию для панели. | class App(Page):
def set_option_panel_field(self):
self.set_text('option-label1', 'Intensity')
self.set_text('option-label2', 'Dispersion')
self.set_text('option-input1', '+1')
self.set_text('option-input2', '2') | 1 |
191e0b336237b98f6e67d602c87f7d90 | e6cb2197a01ab10fbab386e2ee6ed17d | USR_ASK_ABOUT_ORIGIN | void onAboutClicked(GtkWidget *widget, gpointer window) {
GtkWidget *dialog = gtk_about_dialog_new();
gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(dialog), "World Viewer");
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), "0.2");
gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog), "(c) Team 2");
gtk_about... | 1 |
2ac29302d414cfab26b3e5b62a44d7e0 | 5a766b55a92645eb84e204c232e4b9aa | Update the text contol which diplays the zoom level | namespace Gorgon.Editor.SpriteEditor
internal partial class FormRibbon
: KryptonForm, IDataContext<ISpriteContent>
private void ContentRenderer_ZoomScale(object sender, ZoomScaleEventArgs e)
{
_zoomLevel = _contentRenderer.ZoomLevel;
UpdateZoomMenu();
} | 0 |
81e1c949aefba1bada4cb8641875dda8 | a3d8bce30a9b8f070ff14e4134ff418b | 写文章-get请求 | public void toPull(final HTTPRequestContext context, final HttpServletRequest request, final HttpServletResponse response)
throws Exception {
request.setCharacterEncoding("utf-8");
response.setHeader("Content-Type" , "text/html");
String url = " http://data.zz.baidu.com/urls?site=istarvip.cn&token= "; ... | 0 |
f751bda3df0aaa3c60228532e1317e50 | 04bab6d7c3cf10518c9b62625a126cd0 | Returns true if browser console logging has been enabled, | namespace Gecko
[return: MarshalAs(UnmanagedType.U1)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
bool GetLogConsoleErrorsAttribute(); | 1 |
f61dbb0f5cbb01e3f036853b7d60bab4 | 3aa88c154d356463b0db377e8566c802 | 用于处理cartographer返回的位姿估计的函数
Cartographer会为每一帧激光雷达数据估计一个位姿并通过此函数返回
该位姿可以作为建图过程中机器人的位姿
但最终优化之后可能不准确(因为优化过程中地图变化了) | bool MySlamGMapping::getLidarPose(GMapping::OrientedPoint& gmap_pose, const ros::Time& t)
{
tf::Stamped<tf::Pose> ident (tf::Transform(tf::createQuaternionFromRPY(0,0,0),tf::Vector3(0,0,0)), t, laser_frame_);
tf::Stamped<tf::Pose> odom_pose;
try
{
tf_.transformPose(odom_frame_, ident, odom_pose)... | 0 |
497c35757a665742a53c8429ec5c2b5d | 2271cfa2864e08f0be5c0b2e04fa8812 | do nothing, result is already there | namespace map namespace map { namespace detail
void Task::postCompute(Coord coord, const BlockList &in_blk, const BlockList &out_blk) {
return;
} | 1 |
ff8e35420a47eb5ef3ac320c31bc9abe | 613b39949a4649dd2536bb26c1e4dd2f | The type of query to perform -- normal code completion for a popup list, or documentation
completion for a single item, or tooltip computation, etc. | public class SourceAccess
public int getType()
{
return query;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.