query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
0170a1c89a276ccd9198884d80fdc28d | 0d89fc2764b74d0ea230318ca928b5ce | 当重试到达指定次数时,被注解的方法将被回调,可以在该方法中进行日志处理。需要注意的是发生的异常和入参类型一致时才会回调 | func defaultNotify(err error, d time.Duration) {
log.Info("方法发生重试", zap.Duration("after", d), zap.Error(err))
} | 0 |
c2145b1af5648c715902b68fdab584d4 | 0383e90ae22bb8d5ae048495ebf41ef9 | Sets the b r a n c h_ c o d e of this p r e m i u m_ p a i d_ c e r t i f i c a t e. | namespace NPOI.HWPF.Model.Types
public abstract class SEPAbstractType : BaseObject
public void SetBkc(byte field_1_bkc)
{
this.field_1_bkc = field_1_bkc;
} | 0 |
2afb952e47e60f40a2c7667f66c871bf | 0fb0caff285dc0b8173abf73e1acdc52 | Browse to doco page for phrases. | def browse_docs(query):
normalized_query = query.lower()
available_queries = docs_dict.keys()
if normalized_query in available_queries:
webbrowser.open(docs_dict[normalized_query])
if normalized_query in docs_message_dict.keys():
stdout("[*] doxx: Opening the " + docs_message_dic... | 1 |
176ac9ace790c1251ee94776b83dd6d4 | 6bfe982b0b5a8e5125eed56a850a8d07 | 根据ReturnUrl来页面跳转 | @CrossOrigin
@Controller
public class GoodsController
@ResponseBody
@RequestMapping("/returnUrl.do")
public void returnUrl(HttpServletRequest request,HttpServletResponse resp) throws Exception {
Map<String, String> params = new HashMap<String, String>();
Map<String, String[]> requestParams = request.getParameterM... | 1 |
5d678af2eb0f9da4d11747f18fb20ad8 | 8ec91713c1b41bf2150da77d3016e0ca | 解析注解,获得缓存操作封装类 | public class RuleService
private RuleDecorator getDecorator(PsiAnnotation annotation) {
String qualifiedName = annotation.getQualifiedName();
if (StringUtils.isEmpty(qualifiedName)) {
return null;
}
RuleDecorator ruleDecorator = null;
switch (qualifiedName) {
... | 0 |
8366bfc37f7f29aab1b4dd431aae86e9 | d59f503c03312790fb3630a1602abc79 | mostra todos os eventos do dia selecionado | List<Event> eventListOfDay) {
System.out.println(cal.getTime());
for (int i = 0; i < eventListOfDay.size(); i++)
System.out.println(eventListOfDay.get(i));
} | 1 |
9daffad8da52ba53544ddf585cc1d586 | 065f6099963eab472f6b575b552991b6 | Retorna o valor da derivada da funcao para o valor especificado da
variavel | public abstract class Differentiable
public abstract Differentiable differentiate(Variable var); | 0 |
2038e311de606bda9db7f9f7293f305a | 4ef8b319cf6b4f190c1fb5fbffa4ddc8 | Return list of unlocked deals for user home button by category
GET - api/category/{category_id}/deals_unlocked/list | class Freee():
def get_deals(self, **payload):
request_method = "get"
url = urllib.parse.urljoin(self.account_endpoint, "deals")
return self.send_request(request_method, url, payload) | 0 |
d18cc7297d6b24bc163e0c3774e8a563 | 56848380fb6fd60c1950dcb37b52f521 | Retrieves a rounded rectangle that describes this rounded rectangle geometry. | public class VRoundRect extends ClosedShape implements RectangularShape
public long[] getBounds(){
long[] res = {vx-vw,vy+vh,vx+vw,vy-vh};
return res;
} | 0 |
2371246f9dc3d676e98beb7e3554fa8d | 66ae756dabd868ebf68f484bb3a54e1a | Validate that all the clues can fit into the grid | const number_keys = Object.keys(this.pu.pu_q.number);
if (number_keys.length !== 1) return;
const number_data = this.pu.pu_q.number[number_keys[0]];
if (number_data.length !== 3) return;
const number_range = number_data[0];
if (number_range.includes(",") || number_range.i... | 1 |
0cdf370696584a54e5b0f7a61ce06317 | 1c9cfe8a5f918138e3058de5a91e2249 | 检查open表里有没有某节点 | class AStar:
def pointInOpenList(self, point):
for node in self.openList:
if node.point == point:
return node
return None | 1 |
b03ca716f8d8756613b124b1911b5705 | 5e9ea7c92bd51d93770397a5321e2b0c | returns milliseconds since midnight | function gmtime(){ return time() - date("Z"); } | 0 |
5a50fbf5e54d4a45af7d9a8f22b1e24a | 0d2d4f39062e79f55b155c049a6b3a24 | Invert selected faces | unsigned int j,k;
int m;
Face *Face_ij;
std::vector<int> NumerosSommets;
std::vector<int> ReverseSommets;
bool test_print = false;
unsigned int nb_fac = this->Objetlist[i].Facelist.size();
#pragma omp parallel for private(Face_ij,NumerosSommets,ReverseSommets,k)
for (j=0; j<nb_fac; j++) ... | 1 |
928823cb844a7401e88d5924c51d746b | 8f581c23deb40befa1d122e5aee0e00d | IGM temperature from RECFAST; includes Compton heating and adiabatic expansion only. | def iglTocin(igl): return igl * 277.42 | 0 |
c12b1f06bf608f42adc8e0b51ed3e276 | 4475a4bd9a7d0dfbac6836244dc11a73 | https://gist.github.com/jkleint/eb6dc49c861a1c21b612b568dd188668 | function slugify(s: string) {
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;'
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------'
const p = new RegExp(a.split('').join('|'), 'g')
return s.toString().toLowerCase()
.re... | 1 |
702fc4a3f5b0c69032dac8abf59201f2 | fff3d272c5b467ee81b8ecd374236a17 | Spelstart | def main():
klocka = Tidtagare()
spel = Spel()
klocka.storlek = spel.storlek
klocka.minantal = spel.minantal
spel.roej()
if spel.spraengd ==0:
klocka.stoppa()
spel.igen() | 1 |
bb3b817044e4c2b46fec937b0f5d8179 | be5c3115f37646eb4dfea66d4990842d | add dropdown behaviour after content initialized | function initDropdowns() {
$('*[data-role="dropdown-toggle"]').click(function () {
toggleDropdown( $(this).attr('data-dropdown') );
});
} | 1 |
a7c51f596516308d6d1efce99f33951e | 4d5ef244d15a78e4ae4f4398e0b62b44 | Reset a Atribuição de Canais MOD aos Canais FM | {
ViChar channel[BUFFER_SIZE];
ViInt32 i;
for(i=0; i<2; i++)
{
if(i == 0)
{
strncpy(channel, CHAN1, BUFFER_SIZE*sizeof(ViChar));
}
else
{
strncpy(channel, CHAN2, BUFFER_SIZE*sizeof(ViChar));
}
CU_ASSERT ( VI_SUCCESS == tkafg3k_ConfigureOutputEnabled (vi, channel, VI_FALSE) );
CU_ASSERT ( VI_SU... | 0 |
8a0789472831f4cac97d649ee2ff0da3 | c392906a8f5ea93da1e2ff31d2b19612 | create red border for input validation | {
sf::RectangleShape rectangle(sf::Vector2f(spacing_x, spacing_y));
rectangle.setFillColor(sf::Color(5, 5, 5));
rectangle.setOutlineThickness(1);
rectangle.setOutlineColor(sf::Color(13, 13, 13));
for (int i = 0; i < input_canvas.size_x; i++)
{
for (int j = 0; j < input_canvas.size_y; j++)
{
rectangle.setPo... | 0 |
fd04550857be789eb7a0c5312dfc7f58 | cff2402df665de256cbf58349bb0c40e | Display the character menu if clicked. | void MainWindow::on_CharButton_clicked()
{
charmenu->exec(QCursor::pos());
charmenu->show();
} | 1 |
3b4f0d92c9df05ee0444f8a808777d26 | 9529b9d0a1126f0cdd351fc1b82f74b8 | @brief KIangに値を設定する | void SetCurrentKI(uint8_t canPort, CommandMode CMDmode, uint8_t DriverNum, uint32_t i_current)
{
uint16_t identifier = IDENTIFIER_CURR_KI_Q;
uint32_t data = i_current;
uint8_t mbox;
uint16_t timeout = 0;
struct can_frame TxMessage;
TxMessage.can_id = DRIVER_SERVER_BASE_ID + CMDmode + DriverNum;
TxMessage.can_dl... | 1 |
038684a9fe4c8e886d4b8964212d2c9c | 9e64cc471ecca5b5a0220c0632438147 | 功能描述:可用性监控列表页面
参数描述:无 | public String monitor(HttpServletRequest request){
List taskList = monitorTaskService.findAllTask();
int orderNum = 0;
if(taskList!=null&&taskList.size()>0){
orderNum= taskList.size();
}
for (int i = 0; i < orderNum; i++) {
HashMap<String,Object> mapTask = (HashMap<String,Object>)task... | 1 |
0cb3eb99932f417d8eb0c12edd748a71 | 033c73a9a1ec9e114f8a5848c506108d | Обернуть строку двойными кавычками с начала и конца
исходная строка | public final class StringUtil
public static String doubleQuote(String s) {
return DOUBLE_QUOTE + s + DOUBLE_QUOTE;
} | 1 |
805b3dff957a77f9457f19dc1a43f403 | 319b0707cdb2712a6cc0bcbbb197f948 | GetMockDataSinglePRResponseMessage represents mock data to be used fo a single PR returned from a function | return Mock(
bridge=Mock(
async_all=AsyncMock(return_value=BridgeAllResponse.parse_obj(data_bridge))
),
sensor=Mock(
async_all=AsyncMock(return_value=SensorAllResponse.parse_obj(data_sensor)),
async_listeners=AsyncMock(
return_value=Listene... | 0 |
5dd41e6e3fd203a604c70a5f48fb754f | 6f0a448becbd7d893e36ed5efce5764e | Calculate the county sales tax | def County(sales):
countyTax = sales * .02
print('The total county sales tax collected for the month is: $', format(countyTax, ',.2f'), '\n', sep='') | 1 |
603ea9fbc03f66a40f8446a1f87b8008 | 47d0bb7d1d9fdf5a9381f431658f42bd | Test case for providers_partial_update | class TestBcfApi(unittest.TestCase):
def test_bcf2_1_projects_partial_update(self):
pass | 0 |
9658815f5a8e50253484bb9e31d9d035 | 4282180b25ff037d9384b85bbb52f77c | Determines if there is glare within the detected RDT's result window (often due to
protective covering of the immunoassay) | try:
no_results = driver.find_element_by_css_selector(
'.zoom-out-message').is_displayed()
except (NoSuchElementException, TimeoutException):
try:
no_results = driver.find_element_by_class_name(
'zsg-icon-x-thick').is_displayed()
except (NoSuchElem... | 0 |
9ca9dbefc69d35ba9f6c486303a72867 | 8a3a6b72156186a2af51201545c051ee | Sets the "border-left-style" property of @fo_fo to @new_border_left_style. | void
fo_page_number_set_border_left_style (FoFo *fo_fo,
FoProperty *new_border_left_style)
{
FoPageNumber *fo_page_number = (FoPageNumber *) fo_fo;
g_return_if_fail (fo_page_number != NULL);
g_return_if_fail (FO_IS_PAGE_NUMBER (fo_page_number));
g_return_if_fail ((new_border_left_style == NULL) ||
... | 1 |
241e01a1dd32d1251135cbaaa4017abf | 54217dad970b47df9cd366554162deaa | Reads traces from a gzip file, one line at a time. | fn_open = gzip.open if filename.endswith('.gz') else open
with fn_open(filename) as fh:
for line in fh:
if line.startswith('#'):
continue
else:
yield parse(line) | 1 |
5775ebf2b3f55d8cbba5a791240effcb | 4adfabdd6c7473ddbaf94508e6283d0b | Sets the color of the small outer frame of the gauge | {
m_Colors.SetTheme(theme);
m_Colors.m_brPointerFill.SetColors(
m_Colors.m_brFill.GetGradientColor(),
m_Colors.m_brFill.GetColor(),
CBCGPBrush::BCGP_GRADIENT_VERTICAL,
m_Colors.m_brFill.GetOpacity());
switch (theme)
{
case CBCGPCircularGaugeColors::BCGP_CIRCULAR_GAUGE_SILVER:
case CBCGPCircularGaugeColors... | 0 |
0c6beda5703027d9f658add17116aafd | 0869174a6946761f622d8ffab4186389 | Get the load balancer statistics | namespace net.openstack.Providers.Rackspace
Task<LoadBalancerStatistics> GetStatisticsAsync(LoadBalancerId loadBalancerId, CancellationToken cancellationToken); | 1 |
839e682034c03b51c9b7b2bb462c1ec9 | 7446f833a90516248805f86738b6073a | Generates a new, ready to fill Board object.
Returns:
A randomly generated Board object with a unique solution. | new_tile_a = game.new_tile()
new_tile_b = game.new_tile()
while new_tile_a.keys() == new_tile_b.keys():
new_tile_a = game.new_tile()
return self.grid | 0 |
8398b39edfef684fd67c2017bd4df76b | 477a9c3740ada606467f625a525fa3e1 | Checks if a node exists in the node_to_index_map and if it is, the integer for that node is returned. | class Solver:
def get_graph_node(self, name):
return self.list_of_locations.index(name) | 0 |
9e859aeb2dd63ed308440ee814d78a18 | 132c2a8b2e5f66c79d632a1adbdb5d22 | 获取重命名Table的SQL命令 | public String getRenameTableStatement(String oldTableName, String newTableName) throws PersistenceException; | 1 |
3dd2bb34750641ef694c0a7de1897def | 0761fd1ef4c493b915bef34c965ef473 | !
\brief set a pixel
\retval none | #ifdef RH_DEBUG
BLK_GRAPH_ASSERT(pInfo);
BLK_GRAPH_ASSERT(pInfo->pBuffer);
#endif
BLK_TYPE(Pixel)* p = (BLK_TYPE(Pixel)*)(pInfo->pBuffer);
size_t width = pInfo->width;
size_t height = pInfo->height;
__exitReturn( x>=width || y>=height || x<0 || y<0, 1 );
#if ( RH_CFG_GRAPHIC_COLOR_TYP... | 0 |
3a5771fe19d2aa0c35045a78d731854b | bef848be21b46f14c4053ae51fc31c9f | Get list of assemblies, extract selected assembly, stage service and return its id | {
var name = args.Name.Split (',') [0];
var assemblies = AppDomain.CurrentDomain.GetAssemblies ();
var foundAssembly = assemblies.FirstOrDefault (p => p.FullName.Split (',') [0] == name);
return foundAssembly;
} | 0 |
9b1079c904344c9b3bacfc1d74343ab7 | 32c23c8cdd0fc78eba55ce809247a7a3 | 2의 n승을 구해주는 재귀함수 | int recursive(int n){
if(n==1) return 1;
else return n*recursive(n-1);
} | 0 |
bf270c0a68f65ea8978b37d92bb0a6d4 | f405c004062e06cd77f41a5b6e07fbdc | Time in seconds when to reach the intensity. | class Esterification(Reactor):
def tau(self):
return self._tau | 0 |
3b0b9dc16a7afdc178bf869b1794838c | 8e5c21ca18d343ad597db15ddceeb0d9 | Função que separa o token do resto do input. | export class TokenService
extractToken(tokenString: string): string {
return tokenString.split(' ')[1];
} | 1 |
45b33481bd037e93947794b39b6eaac2 | a16a9734b9cf29624996a3eb5e33a2e5 | 跟相对路径,为当前Node创建子节点,子类决定节点的数据格式 | {
$key = $node->getValue();
$this->_subNodes[$key] = $node;
return $this;
} | 0 |
e7855497d741422c99323a7840c2195d | 124192162524b3bcbe83f88fa7d60f3d | Decodes LZ78 encoded tokens. | while True:
sym: int = litlencode.decode_next_symbol(self._input)
if sym == 256:
break
if sym < 256:
self._output.write(bytes((sym,)))
self._dictionary.append(sym)
else:
run: int = self._decode_run_length(sym)
assert 3 <= run <= 258, "Invalid run length"
if distcode is None:
... | 1 |
de4a6fe29600fbd94a4129ed993779c6 | 410479483e4dc5bd8cbacf2677e723e4 | Label the power spectrum axis. | class _SpectrumOne(Spectrum, _ResultOne):
def _label_two(self, XY, J, K):
return f'$\\hat{{\\mathrm{{C}}}}_{{{XY}}}$' | 0 |
cc8669d9a24c7caba81dc93a1fc573ff | 75456d3978de4ccdd9147b4159dacbdc | ОТРИМАТИ СПИСОК ОБЛАСТЕЙ ПО ФІЛЬТРУ
ПОЛУЧИТЬ СПИСОК ОБЛАСТЕЙ ПО ФИЛЬТРУ
GET A LIST OF AREAS BY FILTER | class Area extends Controller
public function index(Request $request,rGovernorate $rGovernorate)
{
$oResults=$this->rArea->getByFilter($request);
$governorateList=$rGovernorate->getAllList();
return view('admin.area.index', compact('oResults','request','governorateList'));
} | 1 |
c363bd63d24ff449f34d7401e5119dce | 9ff87fc2e21490306e3e332c0fda0107 | Test that you receive correct information when you ask for
connected users. | login = self.client.login(username='mike2', password='example')
self.assertTrue(login)
response = self.client.get(reverse('conversations'))
self.assertEqual(response.status_code, 200)
self.assertTrue(len(response.context['conversations']) == 5) | 0 |
6e563848ae565083f251f13de4afc0d1 | e279cd1253fd02b34333c0b2231ac99d | 在路径后面加上斜杠 | path = path.replace("\\", "/");
String lastChar = path.substring(path.length() - 1);
if (!"/".equals(lastChar)){
path += "/";
}
return path;
} | 1 |
a93d3b653ebd05183af696e9431ef021 | 7cefa60ce994091fc7388bdc6f64a576 | Find a system resource (which should be loaded from the parent classloader). | public abstract class Resources
extends ListResourceBundle
public static URL findResource(String sName, ClassLoader loader)
{
return findResource(sName, loader, null);
} | 1 |
b5093b8a468df648a8ee58dac1305fe9 | 7f61448ad6da3ef0f9cb03f40c5be655 | Just a stub. Do nothing | cases like (1) | 0 |
6502b4619b2943685415fc1ad70498dd | b9abd790c0196af20807196a0422c789 | Gets the size of the world x-side. | public class World
public int getWidth() { return _width; } | 1 |
73c0d6bd7208e29811ab8bdc4aae5e14 | 5aea97ccc1ce2c2525ddceba97d04424 | Покупка командой новой фабрики (у игры). | public class Jugador extends Observable implements Sincronizado
public void comprarFabrica(final Fabrica fabrica) {
this.disminuirDinero(fabrica.getCostoCompra());
this.setFabrica(fabrica);
} | 1 |
631de7d84603107933fc976ee186a1c1 | 20d76349cfe7bfe8f567508e2238c9a8 | Validacao para persistencia da justificativa para ativacao/inativacao do registro | if name:
adesao = self.pool.get('adesao').browse(cr, user, adesao)
retorno = ""
if not adesao.ativo and adesao.situacao != '4':
retorno += "Adesão " + str(adesao.name) + " está inativa, favor verificar antes de cancelar o " \
... | 0 |
05ee591a837e2f52d3ee06be8a05cd5f | e522206e37b9c532da234aab2684ce63 | !
HTTP file insertion is supported. | {
long resource;
if ( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"l", &resource) == FAILURE) {
return;
}
if ( CL_INSERT_DOCUMENT(resource) != 1 )
RETURN_FALSE;
RETURN_TRUE;
} | 0 |
da93ed5d903369563172714e8cab2e20 | 8c4ff8a5f0383389ac67fe27251c81f1 | Retorna o userId pelo header "authorization" | function getId(req) {
let token = (req.headers['authorization'].split(' '))[1];
let decodeToken = jwt.decode(token, {
complete: true
});
return decodeToken.payload['userid'];
} | 1 |
4205fdd552442cad0655bfb334bcd191 | 098c254edd1ee3d5300a44780a5d0d21 | Para inicializar las estructuras de las sentencias | {
this.Tipo = new UDTSQL_tinyint();
this.Actividad = new UDTSQL_tinyint();
this.TipoFlujo = new UDTSQL_tinyint();
} | 1 |
cf47d02d6a4cd08c0963925b5cdc4cfb | d447fafc6b8dc12dd8b4c23f166c21ad | Returns the vector with all components rounded down. | public class Vec3D implements Comparable<ReadonlyVec3D>, ReadonlyVec3D
public final Vec3D floor() {
x = MathUtils.floor(x);
y = MathUtils.floor(y);
z = MathUtils.floor(z);
return this;
} | 1 |
526cd3ae5da24fb080914ae730291b33 | e6285300be44d7b2db37c26e0161c5a7 | Test SoS defined variables | class TestSic(unittest.TestCase):
def setUp(self):
self.cube = Cube([1.0], var_name='sic', units='J')
self.fix = Sic(None) | 0 |
bfda981f19c23cec9e0e0252bad47836 | 41eb803fbc83c050958c4f6e3bdec2c0 | Tests return when provided shell is not available | class TestStatefulShell(unittest.TestCase):
def test_raise_on_returncode(self):
with self.assertRaises(RuntimeError):
self.shell.run_cmd("invalid_cmd > /dev/null 2>&1", raise_on_returncode=True) | 0 |
3a330948db39fed93a51d1880afc841a | 0a925c9710f37c3e6bf129e5340c497b | Quan premis Enter i la pantalla de victòria estigui visible, es carregarà la següent escena | screen = pygame.display.set_mode((WIDTH, HEIGHT),FULLSCREEN)
screen.blit(load_image("images/win.png"),(0,0))
clock = pygame.time.Clock()
font = pygame.font.Font(None, 50)
while True:
time = clock.tick(60)
for event in pygame.event.get():
... | 1 |
2022eb536ea68ae19617eb64ebc03560 | 78175c59aba5c07b330acfe45ea79ab1 | 给定初始坐标 (x1, y1) 和终点坐标 (x2, y2), 问能否到达终点。
坐标移动规则: (x, y) -> (x, x+y) 或者 (x, y) -> (x+y, y) | if (Math.abs(endX - startX) + Math.abs(endY - startY) == 1) {
return true;
}
return false;
} | 0 |
6f09878182d566da9af4847838881532 | 45a4c4e9af21f2b06afd50ce8f558f37 | Creates Files for 'Basic Web Project' | namespace Faker.AssistTools.Layers
public class DomainLayerManager : BaseLayerManager, ILayerManager
protected void Create_Base_Files() {
this.Create_DomainServiceBase();
this.create_ConstBase();
this.Create_Base_AppLtmPermissions();
} | 0 |
71b120373ac2247e870d0bf5d2c5a937 | d778f356ad451eb085bce01316d9a523 | Get the checking SMS message status request. | class GsmSms
public function getRequestStatus(){
return $this->request_status;
} | 1 |
94a9e7b9b46231a8e0ff4520f6a94b2a | b438f78ec367a97f487b485ec56a0c78 | 颜色分割,针对不同颜色进行分割,返回二值图像(目标颜色为白色,其他部分为黑色) | float s = 0;
Mat srcimg = src.clone();
for (int i = 0; i < srcimg.rows; i++) {
uchar *p = srcimg.ptr<uchar>(i);
for (int j = 0; j < srcimg.cols; j++) {
s = (float) srcimg.at<uchar>(i, j);
if (s < (float) t)
p[j] = swapColor ? 255 : 0;
... | 0 |
09c68091befddba1e193ab245beaf1d7 | d1c4e72ba418ccf257db8d1a86b0bb74 | Handles the bank charge buttons. | {
TransactionManagerClient transactionManager = new TransactionManagerClient();
double newBalance;
try
{
switch (cboTransactionType.Text)
{
case "Bill Payment":
newBalance = (double)transa... | 0 |
e3fa8d0cba892a7716138e041389e090 | 55fd6d3f690ed39f955c7723523e28d5 | Fill window has information on the Treeview object that will fill up our
Toplevel window. It is made to fill up the whole window, allows a user
to scroll, and can load in json files and csv files. | self.rowconfigure(0, weight=1)
self.columnconfigure(0, weight=1)
self._tree = ttk.Treeview(self, columns=('path', 'type'), show='tree', displaycolumns=(), height=20, selectmode='browse',
xscrollcommand=lambda f, l: self._autoscroll(self._hsb, f, l),
... | 1 |
59f7d8b1cccf8b7cccc5a582301db15e | 8aba3258e80887c1e404f68bb41f3efd | Fills population with random paths. | void gen_populations() {
for (int i = 0; i < num_pops; i++) {
vector<path> new_pop;
path new_path;
for (int j = 0; j < pop_size; j++) {
new_path = gen_path();
new_pop.push_back(new_path);
}
sort(new_pop.begin(), new_pop.end());
populations.push_back(new_pop);
}
} | 1 |
e3793251c140bf89999c5cf5f5b68045 | 7087a0f8b7c29813516050cc5492013a | 加载QQ好友的等级
<blockquote>
</blockquote> | namespace NiLiuShui.IRQQ.CSharp
public static class IRQQApi
[DllImport("../IRapi.dll")]
public static extern int Api_GetObjLevel(string RobotQQ, string ObjQQ); | 1 |
b54b30dd5ba52fd0f09377b490668912 | 58cddf2a2cc217616554b7c81ff01a20 | 通过API接口获取季频盈利能力信息,可以通过参数设置获取对应年份、季度数据,提供2007年至今数据 | print ("start!")
url = "http://114.80.94.175:8084/Stocks.asmx?WSDL"
client = Client(url)
response = client.service.Query_uimsSEASONSET(Coordinates='021525374658617185',
Encryptionchar='F5AC95F60BBEDAA9372AE29B84F5E67A',
... | 0 |
78dbaeb29d47ba90b12b233590591a62 | 9c835efbd7f8d503778bed2183af183f | Initiates the asynchronous execution of the RemoveFacetFromObject operation. | namespace Amazon.MediaConnect
IAsyncResult BeginRemoveBridgeOutput(RemoveBridgeOutputRequest request, AsyncCallback callback, object state); | 0 |
62360abce2136a282bf1ab5f44be6eb2 | 2beb079c5e9515a28d6c3eab12f9cf53 | Checks if after insertion the analytics and database info are in a
consistent state. | class Adapter
def consistent_data?
execute_command(SQL::duplicated_events).first['count'].to_i.zero?
end | 1 |
ed56f119b86acc6bb53871454c18ae7c | 5bb72408d1ae00d2d857465b730c1d2d | 解释逻辑与运算表达式. | public class SjBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements SjVisitor<T>
@Override public T visitOpLogicExpr(SjParser.OpLogicExprContext ctx) { return visitChildren(ctx); } | 0 |
40212ab7c668b50a039d084f693a362f | 9ae527b2fcc7fc70e7071ab7a4e279aa | Read in the texture element for a standard effect COLLADA texture | float4 *AuxColor)
{
TexSeqElem tex_seq_elem, prev_tex_seq_elem;
int res = 0;
char temp[512];
char *s = NULL, *t = NULL, texname[80], sDATFileName[128], sOptionalArgs[128];
float seconds, intensity = 1.0f;
bool IsDATFile = false, bEllipsis = false;
*eventType = EVT_NONE;
std::string s_temp;
*alpha_mode = 0;
... | 0 |
5dd28f2ef91c6f5545466aa943065f4a | d0dc3ee1566343131edb35d874d053ec | the function has an infinite loop that measures the time between two loop cycles
and toggles the current phase of the traffic light between red and green and sends an update signal
to the message queue using move semantics. The cycle duration is a random value between 4 and 6 seconds.
Also, the while-loop uses std::thi... | void TrafficLight::cycleThroughPhases()
{
std::random_device rd;
std::mt19937 eng(rd());
std::uniform_int_distribution<> distr(4,6);
std::unique_lock<std::mutex> lck(_mutex);
std::cout << "Traffic Light #" << _id << " Cycle Through Phases: thread id = "<<std::this_thread::get_id() <<std::endl;
l... | 1 |
ad6c1ffd6c5e6c6e7054f058c7f01dd6 | 9a0eec168bf239cf8cf8609406b88cab | 若链表为空,返回-1 | def detectCycle(head):
if not head or not head.next:
return -1
node = has_cycle(head)
if not node:
return -1
node_nums = cycle_node_nums(node)
return first_detect_cycle(head, node_nums) | 1 |
bb6e7fa45fbe5d2a0c10bc256f9ac187 | 7801d91c0487be2490a4edb429ee1c72 | 如果值为[未定义],则不需要加where条件 | {
if (AutoSqlvalue.Length > 0)
AutoSqlvalue += " and " + str;
else
AutoSqlvalue += str;
} | 0 |
58d593a2cb064a5a136d252033251050 | 2b70af3f70f6c3206a422d9009cda63d | Test case for get_mapping_identity | async def test_get_mapping_set_by_id(client):
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
}
response = await client.request(
method='GET',
path='/api/v1/mappingSets/{set_id}'.format(set_id=EB7659C5-6AD3-4C1F-8F3F-A5DB1A5E1440),
he... | 0 |
cd15a81608219a408fa6ff72a229a892 | 9ce890728786bcbfc851a5693f725562 | 创建一个公共的静态方法,调用未定义的静态方法,传入方法名,方法参数
1,比如在app/home/controller/entry.php文件的index方法调用Model里q方法(Model::q())
2,但是Model中没有静态方法,所以就触发__callstatic方法 | {
echo "callStatic: $name" ,PHP_EOL;
$method_name = '_' . $name;
if (!is_callable(array('self', $method_name))) {
throw new BadMethodCallException($name . 'method not found.');
}
return call_user_func_array(array('self', $method_name), $args);
} | 1 |
603d8e925ec2d08ad2ad8db11255bf3c | d9373647ac77989b0c2c61dc72c0635e | Generate the temporary batch file to execute on
the remote host. This batch file will attempt to
run a simple command remotely to validate permission level. | try:
hosts = sys.argv[2]
logfile = 'excbat.log'
if len(sys.argv) >=4:
logfile = len[3]
fphosts = open(hosts)
lines = fphosts.readlines()
fphosts.close()
for line in lines:
host,command = line.strip().split(',')
host = host.strip()
fp = open("excbat_%s.log"%host,'a')
if host... | 0 |
be95a28966c659941175b4a46abd59ae | 997ec6f1a574da94397b0958119d3fd2 | 登录时验证使用,可使用name,mail,phone中任一方法登录 | public Map<String, Object> login(User user, HttpServletRequest request) {
Map<String, Object> data = new HashMap<String, Object>();
String password = encryptProvider.encryptPassword(user.getPassword());
User targetUser = userRepository.findByName(user.getName());
if (targetUser == nu... | 1 |
e089d2066b12b9518dc8e5764de6fce4 | def50dd2ad432aa80d830fac66a42769 | Set to true to trace the soap request/response | class SoapClientBuilder extends AbstractSoapBuilder
public function withTrace($trace = true)
{
$this->soapOptions['trace'] = $trace;
return $this;
} | 1 |
ec52eb66fde5d69d2ef2495f55437571 | 16d8e084255d064b8f9c61d2490514f2 | 题库里面图片进行验签 | exam_id = self.get_exam_id(data)
paper_id = self.__get_paper_id(exam_id, subject)
if not paper_id:
return []
data = {
"paperId": paper_id,
"examId": exam_id
}
r = self.__session.get("http://www.zhixue.com/zhixuebao/checksheet/", params=... | 0 |
4814096fe4820e35436ab4abe37734e3 | cc961ef5a6e9c1dd5c343555f36d1179 | \brief Apply the derivative of the inverse of the change of variables at every orders.
The Fourier series are supposed to be in ofs format.
The change of variables is of the form:
zv_tfc_dot = CQ * (zv_nc_dot - PCdot * zv_tfc - Vdot) | Ndim=2
K=self.S0.K
M=self.S0.M
Mw=self.S0.Mw
Der=np.zeros((Ndim,M,Ndim,K))
DerOut=np.zeros((Ndim,K,Ndim,K))
for ss in range(M):
zeta_c=self.S0.Zeta[ss,:]
for vv in range(M):
map_here=self.S0.Map_cv[vv,:]
ZetaLocal=self.S0.Zeta[map_here,:]
cf=0.5/np.pi
DerLocal=libder.der_Fjouk_ind_ze... | 0 |
32ec9d14f35985e95657c502658bc96d | 3809bcd655840c70bed46609e1fdd841 | Save current screen by auto pressing PrtScn key. | try {
if (System.getProperty("os.name").equals("Mac OS X")) {
_screen.type("q", Key.CMD);
}
if (System.getProperty("os.name").contains("Windows")) {
_screen.type(Key.F4, KeyModifier.WIN | KeyModifier.ALT);
}
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
} | 0 |
73a085c49968d1917993ee92f76ca4d0 | 45951503ac6248f559384aaf0eeebf99 | Handles how the round information gets treated when there is a certain action. | {
switch (action)
{
case RoundAction.Attack:
player.Hit(part);
break;
case RoundAction.Defend:
player.Block(part);
break;
default:
break;
... | 1 |
4b5c1813ec1b68b461ac2eb41215eadf | 092c56a2b7893e434e0f6317abe14ce9 | 是否和车辆绑定 | class DriverController extends UsersController
function bindTruck(){
$trucker=M('users')->where('phone='.I('trucker').' or id='.I('trucker'))->find();
backJson(D('DriverTrucker','Logic')->band(session('user_id'),$trucker['id']));
} | 1 |
829a4b9eddaca4438be32b1f2318cc20 | 232dbf78f6291698dc14acd3e8c4d87e | Returns whether the Player's Hand is greater than 21 | class Game:
def player_is_over(self):
return self.player_hand.get_rank() > 21 | 1 |
163c8627b23ca097749f1ff35cd48d7e | 52e2f71448624fbe5465cad3f559467c | 将本地资源和热更资源比较,选较新的作为基础资源 | public class GameDownloader : MonoBehaviour
private void CompareResources()
{
bool hasChange = false;
List<string> newAllAB = new List<string>(newABManifest.GetAllAssetBundles());
List<string> oldAllAB = new List<string>(localABManifest.GetAllAssetBundles());
for (int i = 0; i < oldA... | 1 |
a13a6fc0f86a70090276f320f24afa9d | b6334dec7c21bff7c99248a0cb231758 | 명령어의 최대 요구 매개변수 개수를 가져옵니다. | public class CommandTable
protected int parameterCount(List<Token> tokens) {
if(Token.isCustomizedParamOrder(tokens)){
return (tokens.size() - 1) / 2;
}
return tokens.size() - 1;
} | 1 |
155c89f6460ffc97a03857b8e4799adc | 7f87d2a36940e7b2527592cc9f59bf3a | 获取基准数据并计算基准收益率 | g.stocks = get_index_stocks('000931.XSHG')
if len(g.stocks) > 0:
g.df = get_fundamentals(
query(valuation.code,
valuation.pb_ratio).filter(valuation.code.in_(
g.stocks)).order_by(valuation.pb_ratio.asc()))
g.code = g.df['code'][0] | 0 |
2eb1262fb03ccc46616e08b46bd940b1 | 014f0956baaa9155358e9aef421b11eb | 近一周文章发布情况 | class StatisController extends BaseAdminController
public function weekly()
{
$start=date('Y-m-d H:i:s',strtotime('-7 days'));
$end=date('Y-m-d H:i:s');
$doc_cou = Document::where('is_recycle',2)->whereBetween('created_at',[$start,$end])->count();
$med_cou = Media::where('is_recycle'... | 1 |
0a9360f7dec49beceb4c7a7baac0cff8 | 65fe343a725e43dab999e9cb5f78a105 | An interface for direct interp-level usage of W_AbstractStream,
e.g. from interp_marshal.py.
NOTE: this assumes that the stream lock is already acquired.
Like os.read(), this can return less than n bytes. | try:
n = int(argv[1])
except:
n = -1
rv = self._obj.fread(self._handle, n)
if rv:
self._print(rv)
return rv | 1 |
902d8d213d6e305dd8d2a24f0e388cba | 826279b6ab81d1f00bb5be5879f7b0b0 | 计算前后页,第一页,最后一页 | if (totalcount % size == 0) {
totalPage = totalcount / size;
} else {
totalPage = totalcount / size + 1;
}
if(page<1){
page=1;
}
if (page>totalPage){
page=totalPage;
}
this.page=page;
pages.add(page);... | 1 |
12fa6fd2cefc4de196210f0919968472 | e0284da0ca92404495d13b8e8b0574b2 | Move the character to the corresponding room through the stair | public class RoomManager : MonoBehaviour
IEnumerator MoveRoom(GameObject room, Vector3 initPosition, Vector3 finalPosition, bool hideAllWorlds) {
if(initPosition == Vector3.zero) {
initPosition = room.transform.position;
} else {
room.transform.position = initPosition;
}
for(float lerp = 0.0f; lerp < 1.0;... | 0 |
03e461c960fa933fd37e5c66ae81dbb6 | d4404f617b630ac7edc4be76db74c894 | Creates a node group in the specified Kubernetes cluster. | raise NotImplementedError
status, data = APICall(browser, token, "POST", "/api/v2/node_groups.json", body=json.dumps({"node_group": obj}))
return json.loads(data) | 1 |
daae7f626db709c46c53920c3a971bd2 | 0900bf6acd2135dff472049b40413117 | 将image放入RequestBody的map中 | public class YeWuInFragment extends Fragment implements CarCodeView, CheckUpView
, MatterView, CheckUpSpinnerAdapter.GetItemTextViewPosition
private static RequestBody getRequestBody(List<String> fileNames) {
MultipartBody.Builder builder = new MultipartBody.Builder();
for (int i = 0; i < fileNa... | 0 |
f72b3fa943f85c26e0d2f3a41916df91 | 458b84c35f7d112ee560bb7e8ca88908 | 修改麻将人数, 并根据人数,修改位置 | class Room(KBEngine.Entity):
def updateReadyNum(self,state):
self.readyNum+=state
if self.readyNum==3:
self.distributePoker() | 0 |
73ccc1e2df0bcc36016130353891ae8f | a5709f17f3a9ce37479d13480bfc81c1 | 如果当前Component有getInitialProps,就执行并且传递给对应的组件
(如果要重写就必须这样写) | function privateRoute(AuthComponent)
static async getInitialProps(ctx) {
const pageProps =
AuthComponent.getInitialProps &&
(await AuthComponent.getInitialProps(ctx))
return { ...pageProps }
} | 1 |
20d205eae83daf7d6d6d4dc95206ca59 | 6a73fbb87d6d1c8ee73ff446559f691f | 加载表情图片 | {
var htmltxt='';
doAjax(
"/ws/emoji.php",
{
"t":1
},
"json",
function (json)
{
if(json.res==1){
var emojilist=json.emoji;
if (emojilist.length > 0)
{
$.each(emojilist, function (index, item)
{
htmltxt+='<i>' + emojilist... | 0 |
48abb099520f94d31b378bf8e87b4734 | 98f720a703e5df039a815d85e9107a55 | 重写此方法是用于一种情况:当用户先不注销登陆而直接再次登陆时,会先把之前登陆的用户注销掉再登陆 | public class LoginAction extends AbstractAction implements ServletRequestAware{
public String relogin() throws Exception {
Object o = request.getSession().getAttribute(Constants.USER);
if(o!=null){
request.getSession().removeAttribute(Constants.USER);
LoginLog l=(LoginLog)request.getSession().... | 1 |
5663489551e942573fafece1ed0f55e1 | 61b21aa16cc94748b28c09424d140acc | printEnvJSON prints all environment variables in JSON format | func PrintEnv(w io.Writer) error {
keys := make([]string, 0)
for key, _ := range base {
keys = append(keys, key)
}
sort.Strings(keys)
for _, key := range keys {
val := base[key]
if _, err := w.Write([]byte(fmt.Sprintf("%s: \"%s\"\n", key, val))); err != nil {
return err
}
}
return nil
} | 0 |
3778910bf2652c117f137e8722724d77 | 6fa39ada3c0e5a36d21d45b1ca1cf7b5 | NewCronService service constructor | class TestCron extends Command
public function __construct()
{
parent::__construct();
} | 0 |
689150de77be24a8d01e2304f9d49084 | c3f78280a87984a4a60e8954b6f98bc4 | anota nas seleções dos jogadores qual quadrado foi selecionado e passa o turno para o proximo jogador | def choose(text):
jogador = int(input(f'Escolha um jogador para {text}: '))
jogador = jogador - 1
while (jogador == turno or jogador < 0 or jogador > numero_jogadores):
if (jogador == turno):
print('Você não pode escolher a si mesmo!')
else:
print(f'Você deve escolher um jogador entre 1 e {num... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.