query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9f8c359a2666359b255eea9f11c2100f | a8324a0ea8da0bb79340fd25d98aa9ec | Returns the meta object for class '{@link com.ponta027.fta.model.fta.Diagram <em>Diagram</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getDiagram(); | 1 |
39a4deacb1e7c290f9f75f35d5e5d2c9 | 26f8dd01a0186c43421bb38c4408e098 | Generation mode. Returns word ladder that starts with given word and
consist of specified number of steps | namespace Puzzle.Services.Api.Controllers
[ApiController]
[Route("[controller]")]
public class WordLadderController
[ProducesResponseType(typeof(int), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest)]
[HttpPost]
public async Task<WordLadd... | 1 |
b0c1eb9af664ea5cd277d4ce47b25b9c | b5aebe5453196a55cb28926f404e44c4 | Lasketaan tyhjien ruutujen määrä | public class PlayerWindow implements Serializable
public int emptyCount() {
return (int) Arrays.stream(diceGrid)
.flatMap(Arrays::stream)
.filter(cell -> cell.isEmpty())
.count();
} | 1 |
c9cc10ae13d233361665056246a7a6ed | b47c98f00440539d56336ea865309566 | Use setsockopt(SO_REUSEADDR) set reusing port addres after close connection, not wait for lost packets on route.
param pointer to socket
return true if set was accepted. | void ProtocolType::setSocketReusable()
{
int enable = 1;
if (0 > setsockopt(sock_fd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(int)))
{
}
} | 0 |
44e054c1e077aee0798543adb01ab854 | a0b3ccca778b9a5c570357f921af74ab | Provide valid and invalid permissions combos for testing. | class ExperimentPermissions(TestCase):
def setUp(self):
build_experiments_for_permission_testing(self) | 0 |
1ed26267febbb24f778228893db4904a | 0712df79f81acbe995673cd767286073 | 用于学生修改密码并返回一个bool值 | namespace OA.BLL
public class StudentService
public bool ModifyStudentPwd(Student stu,string newPwd)
{
stu.Stu_Pwd = newPwd;
Student s= stuDal.UpdateEntity(stu);
if (s==null)
{
return false;
}
return true;
} | 1 |
91e4b83ac5d2a56697000edf05e177f5 | 1f294e2e8a9b9bbab2cf9e42d3ae38ba | универсальная функция, которая в определенном массиве удаляет определенный класс | {
if (($key = array_search($class, $this->classes)) !== false) {
unset($this->classes[$key]);
}
return $this;
} | 1 |
8ae584d587b151f2807032635d73aea4 | 5d5af5dba775d57aefa899d33a9309f6 | Импорт пользователей из файла в команду | def import_users(filename):
dqusers.importUserDataFromFile(filename) | 1 |
749638f694d8b1db925ac921e31e198b | 9c4de4a39104601cde8ba1b339f6c5dd | 修改底部导航栏TextView的状态 | {
for(int i=0;i<footer_list.size();i++)
{
RelativeLayout rl=(RelativeLayout)footer_list.get(i);
TextView tv=(TextView)rl.findViewById(R.id.tab_line_textview);
View v=(View)rl.findViewById(R.id.tab_line_view);
if(i==value)
{
tv.setTextColor(this.getResources().getColor(R.color.color_deeoyellow))... | 1 |
58c492c695487a932b7a92a3e5e9f8be | ae3677a50ce2a28719c57bdc7443b663 | Gets the appropriate database association from the Subclient.
Returns:
list - list of database associated with the subclient | class Connection(object):
def get_attached_database_names(self):
self.__check_active()
return self._get_isc_info_svc_svr_db_info()[1] | 0 |
432ff9fffd46b1280a932ddebb93205f | b115c9c54de6f6672392a0d8752db01e | What this should do:
Iterate over our movements, calculate the danger of the movement and
select the one that is going to give us the most for our buck! | if 'select_weaker' in self.commands:
select_weaker = True
elif 'select_strongest' in self.commands:
select_strongest = True
if type(near_enemies) == dict:
near_enemies = near_enemies.values()
if select_weaker == True:
danger_list = reversed... | 0 |
dfd1f23719a8da7197d9878d76ba6638 | 3b95283f81934190fe67c17849c75602 | Apply a list of transformations in a random order. | class DiceNet():
def apply_trans(self, trans_list):
for trans in trans_list:
if trans == "tcw":
self.turn_cw()
elif trans == "tccw":
self.turn_ccw()
elif trans == "flr":
self.flip_lr()
elif trans == "fud":
... | 0 |
0da30668d2f2e072de7738ee77a2d6e4 | 8c122745d340a3121cc82eaf43a265df | 取得当前没有cd的技能,从左到右 | for (Unit[] units : currents) {
for (Unit u : units) {
if (u == null) {
continue;
}
u.refreshSkillCd();
}
}
Collection<CdInfo> result = new ArrayList<CdInfo>(owners.size());
for (Unit unit : owners.values()) {
CdInfo info = unit.getCdInfo();
result.add(info);
}
return result;
} | 0 |
16899b06da1d5e406c0ffa93bb51c76a | 856bb474b6a453d7fe7e7d1f2935a3c6 | 设置IBottomListDialog的选项样式 | mChooseBtn.removeAllViews();
mListDialog.setVisibility(View.GONE);
mChooseDialog.setVisibility(View.VISIBLE);
int max = textArray.length - 1;
if (max == 0) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,
AndroidUtil.dp2px(getC... | 1 |
afb974c571e75cad0bc5cce467a9157a | 6201da11d44d8d9afdc35e7aeea5a558 | Modify the passed time with the current timezone offset | {
$externalOffset = $this->parseTimezone($tz);
return $d->add("minute", $externalOffset - $this->internalOffset);
} | 1 |
99b4c617a0b94704abac2749d66967a1 | a8c1ce51df3b6fc37bd4f24b8b86ca54 | Parses a file in the STL ASCII format | self.vertices = []
self.normals = []
self.texcoords = []
self.faces = []
material = None
for line in open(filename, "r"):
if line.startswith('#'): continue
values = line.split()
if not values: continue
if values[0] == 'v':
... | 0 |
42e4277c1c3f3d5fa512c8e6da62d7d2 | 9479d84598ab42e0a02b73507554632b | Creates a new, empty deck of length 0.
Function exists to ensure that memory was allocated correctly.
Called from the primary public-facing @p createDeck() @p and from @p deckSplit(). | void deckInitEmpty(Deck *self)
{
cardListInitEmpty(&self->list);
} | 1 |
ffc9da6150bac9bc61aaaf17bef055d6 | 4f9cd6e70e817f87d9946c762f75ef89 | Validation test for the Northridge SDSU scenario | class TestValidationMethods(unittest.TestCase):
def test_2_scenario(self):
output = validate_openstack_verify()
self.assertEqual(output,0) | 0 |
719d41f28411aa92c5f259bd2a0711ae | 7374a42876a3a9d4b8063ddec12485a4 | get a scanner instance for the storage | public EntityScanner<E> getScanner(); | 1 |
2a380ca7f3d3b80936a437c4269bc162 | adb1df007ecf05c836a46b80783d4ba5 | function to update feedback_setting | class Email_link_open extends MX_Controller
function update_fb_sms_feedback($id)
{
$this->Email_link_open_model->update_fb_sms_feedback($id);
} | 0 |
cc790fc1412e58c773b0c27a175729ed | f9b3371bc1ee5158daa8244ea917a233 | Creates a new DeltaFlowFilter instance
Kwargs | port_status_mask1=None, port_status_mask2=None,
flow_removed_mask1=None, flow_removed_mask2=None):
super().__init__(xid)
self.packet_in_mask1 = packet_in_mask1
self.packet_in_mask2 = packet_in_mask2
self.port_status_mask1 = port_status_mask1
self... | 1 |
2db6549947d103c8cc361240f22bbe28 | dcf18bec249329e59e66a50e39a3887b | Find root without path compression. | public class QuickUnionUnionFind_Rank_PathCompression extends QuickUnionUnionFind_Rank
@Override
public int find(int v) {
rangeCheck(v);
if (parents[v] != v){
parents[v] = find(parents[v]);
}
return parents[v];
} | 0 |
aee4caa301cd62e51a61bb3e81573e3a | 5a9c0d4819c9bec47f86437764b9d89c | 生成加入房间的令牌 | FightRoom room = GetEmptyRoom();
roomCache.TryAdd(room.id, room);
BaseToken[] tokens = tokenDic.Values.ToArray();
foreach (var item in tokens) {
tokenToRoomID.TryAdd(item, room.id);
}
room.Init(tokens);
} | 0 |
0c860b0c18b188f8e00c2878615df6e0 | 45ed45e3e62baa1ecc4561ed508f0076 | 拡張編集オブジェクトを非同期でファイルへ書き出す。 | namespace WodiLib.IO
internal class HasSectionIniFileWriter<TIniTarget>
where TIniTarget : IIniTarget
public async Task WriteAsync()
{
await Task.Run(WriteSync);
} | 1 |
d76a537ba1ed944b242e0c5d40b8363e | b31404ece8afe78e46b78696c9a9261a | This function compares each field of the rule with those of the packet being checked | int search_regular_match(connection_t rule , packet_t * new_packet,int i)
{
if (new_packet->src_ip != rule.src_ip)
{
return -1;
};
if (new_packet->dst_ip != rule.dst_ip)
{
return -1;
};
if (new_packet->src_port != rule.src_port)
{
return -1;
};
if (new_packet->dst_port != rule.dst_port)
{
return ... | 1 |
809cd671a66e2d3ef41ddc3c76446ac1 | 2f523ea449649ff699d23ed9c314af5f | Update the diffusive mass fluxes. | self.rho[:,:] = np.sum(self.g[:,:,:], axis=0)
self.u[0,:,:] = np.tensordot(self.c[:,0],
self.g[:,:,:],
axes=(0,0))/self.rho[:,:]
self.u[1,:,:] = np.tensordot(self.c[:,1],
self.g[:,:,:],... | 0 |
ef3dc9a91f53b21cca75ca686d84b115 | c58d3072fc39945d2181233f677e0c80 | convert time to standard-time (12 hour) format string | if (!time) return undefined;
let split = time.split(' ');
if (split.length === 1) {
return `${split[0]} 12:00:00`;
}
return time;
} | 0 |
3f24110f381f8cb739de2fd8c9b0752f | b00e84eec15db1b1fefd0a1d23230f62 | Checks to see if the supplied Object is set, e.g. not null.
It is expected this method would be used as a static import to increase readability as in:
if (objectIsSet(object)) | boolean contains(Object o) | 0 |
ca5cd83cd48380b19cffb7292c26fc24 | a7c383e77cd83ffe1db68b0375e66a2f | Adds a new metric to the Cachet API. | class Configuration
def add_metric(metric)
add_promiscuous_method(metric)
self.metrics = (metrics << metric).uniq
end | 0 |
aed69a3bb5173bcfec786129531be7d9 | 56dc9b9d8e4de51c92bd5df0c0a70a76 | Adds an entry to this cursor iff the id is unique | q2cursor_addid(struct q2cursor_state *state, int idtype, id_t id)
{
KASSERT(state->numids < state->maxids);
KASSERT(state->numkeys < state->maxkeyvals);
if (!state->skipfirst || state->numkeys > 0) {
state->keys[state->numkeys].qk_idtype = idtype;
state->keys[state->numkeys].qk_id = id;
state->keys[state->numk... | 0 |
e19cf1865e4251d6f2b5f65ce180b1e9 | d2f35bd92b8862ebc14d870c889936e6 | Send a packet with ARCnet header | static void npiUartSend(uint8 *pBuf)
{
uint8 cksumLen = pBuf[RPC_POS_LEN] + RPC_FRAME_HDR_SZ;
pBuf[cksumLen] = npiUartCalcFCS(pBuf, cksumLen);
pBuf--;
pBuf[0] = RPC_UART_SOF;
osal_msg_enqueue(&npiTxQueue, pBuf);
osal_set_event(NPI_TaskId, NPI_UART_TX_READY_EVT);
} | 0 |
9ed48499ef5bbe7e6837ed0cdcab23f3 | a1821f0418ade31ecd8f3e09b8b5c268 | Commit the current partition table to disk. | class NullPartitioner(Partitioner):
def commit(self):
pass | 0 |
cd68c073205b27a673ebaa21fa8c6412 | 61a45675406cd16f1299231712f8a215 | Checks if any apps are installed that supports reading of PDF files. | {
if( !isset( $texts_docs_metas['gp_texts_docs_url'] ) ){
return false;
}
$texts_docs_url = explode('/', $texts_docs_metas['gp_texts_docs_url'][0]);
end($texts_docs_url);
$last_key = key($texts_docs_url);
if (strpos($texts_docs_url[$last_key],'pdf') !== false){
return true;
}else{
return false;
... | 0 |
7ec6f8256eeef976ccc31eae08401b9e | 86845c84343d979087e444a599a1c69b | Not exactly following number definition (several dots are seen as OK, etc.)
but probably enough in most cases. | namespace Microsoft.CodeAnalysis.UnitTests
public class RealParserTests
[Fact]
public static void TestTroublesomeDoubles()
{
CheckOneDouble("0.6822871999174", 0x3FE5D54BF743FD1Bul);
CheckOneDouble("2.2250738585072011e-308", 0x000FFFFFFFFFFFFFul);
CheckOneDouble("2... | 0 |
0268d904b0d10bfd1cb80d30f1bd2f08 | f78575d951babcd71d3a1909d591d462 | Sets the maximum objects to be held in memory | class apObject:
def setMaxSize(self, maxsize):
if self.debug:
print("++ Setting maxsize for %s to: %s ++" % (str(self), maxsize))
self.maxsize = maxsize | 1 |
62d4f0f1bc1ac00a8c536f9e34b6dd4f | 5890ba21677edc8b37c3916e8db6a251 | Re-initialise running CPU(s) MTRRs to match the ranges in the descriptor
list.
XXX Must be called with interrupts enabled. | for (int l1 = 0; l1 < kTableSizeL1; l1++) {
FdDesc *tab = (FdDesc*)atomic_load(&fdctx.tab[l1], memory_order_relaxed);
if (tab == 0)
break;
for (int l2 = 0; l2 < kTableSizeL2; l2++) {
FdDesc *d = &tab[l2];
MemoryResetRange(thr, pc, (uptr)d, 8);
}
}
} | 0 |
4481723b75f1046bbd5bf9d7d9a21b50 | 522fba6dfae673a18b9c9f15634d1e7c | https://developers.google.com/gmail/api/v1/reference/users/threads/trash | $this->_logIn();
curl_setopt($this->_ch, CURLOPT_URL, 'https://www.google.com/voice/inbox/deleteMessages/');
curl_setopt($this->_ch, CURLOPT_POST, TRUE);
curl_setopt($this->_ch, CURLOPT_POSTFIELDS, array(
'_rnr_se' => $this->_rnr_se,
'messages' => $message_id,
'trash' => 1
));
curl_exec($this->_ch)... | 0 |
043c090b9c3f4b5783115fb4133f5939 | 7d2e1bd92bea9ce53545fe3e92688701 | удаляем все группы до начала теста вместе со всеми их связями
чтобы не проверять потом наличие связей
удаляем все, чтобы гарантировать, что среди групп нет групп с тем же именем,
по которому будем выбирать потом контакты | public class ContactToGroupTests extends TestBase
@BeforeMethod
public void ensurePreconditions() {
Groups before = app.db().groups();
int ind = before.size();
if (ind > 0) {
app.goTo().groupPage();
while(ind > 0) {
app.group().selectAnyGroupByInd(ind);
ind -- ;
}
... | 1 |
48ad6f9cdc36015a159a8f90dd73c397 | aa7927e57b96604ffdaaeabdd4f49318 | Returns the watermark limit, when the LV usage reaches this limit an
extension is in order (thin provisioning on block devices). | if limited?
@total_usage * 100 / @limit
else
0
end
end | 0 |
14a4a9a0955a68065e4de87551471b50 | f27715e8dbdc7cf9256a6c8329cd73ed | Adds a target to a player's ignore list. | public class CrazyEnvoy
public void removeIgnorePlayer(UUID uuid) {
ignoreMessages.remove(uuid);
} | 0 |
bc340bf3d30ca1614cfb3913043d6dee | 1e6132bb04df52aa7dc18d15278883dd | Prepare the image object pixels array. You must do this
if you want to access individual pixel information. | {
_pixels = new Color32[_width * _height];
_binary_frame_320 = new Color32[_width * _height];
SetImageBinaries();
SetFrameArray(_pixels);
} | 1 |
7ea67a53492ec4e25cbc94f4f3d1e7fc | 4463edf9fa33f1a2cfd7683e0c71af12 | 为每篇日记创建单独的文件 | for i in range(len(blog_article)):
file_name = dirname + '/' + blog_time[i]+'-'+blog_tilte[i]+'---'+blog_subtitle[i]+ '.md'
with open(file_name,'w',encoding = 'utf-8') as file:
file.write(str(blog_article[i])) | 1 |
224cf7d308ad622ebb7ff64eddfd71c0 | a4150b9b4e4674da68624be9a61e4f6c | ▼中段にメッセージボックスを表示するアニメーターを管理するコルーチンを呼び出す関数 | public class Manager_MessageCanvas : MonoBehaviour
void PopupAnimation (bool flg){
if (flg == true) {
DontTouchObj.SetActive (true);
PopupObj.SetActive (true);
PopupRectTrns.DOScale (
Vector3.one, 0.5f)
.SetEase (Ease.OutBack);
}
else {
PopupRectTrns.DOScale (
Vector3.zero, 0.5... | 0 |
d3bd51167b2340a072ac6362c9bf0e82 | bb5c79e1b47f51254711fc39b1b186d1 | Exibe a tela principal da área de gerenciamento de usuários com todos os usuários cadastrados. | class UserController extends Controller
public function index()
{
return view('adm.usuarios.index');
} | 0 |
bee27ac0c7d1c1d446bced89f2c291f4 | 55d88a222fa71378c4c2fc672ee9949f | -----------------------------------------------------------------------------------------------
Матрица поворота против часовой стрелки (угол в радианах) | {
double C = Math.Cos(Angle);
double S = Math.Sin(Angle);
Matrix U = new Matrix(3, 3);
U[0, 0] = +C; U[0, 1] = 0.0; U[0, 2] = -S;
U[1, 0] = 0.0; U[1, 1] = 1.0; U[1, 2] = 0.0;
U[2, 0] = +S; U[2, 1] = 0.0; U[2, 2] = +C;
return U;
... | 1 |
1e1c58c4ce38d8363b1ce539dbb23853 | 09c78f6bc9ac60fafb07078e26f7476f | Handles the Clicked event of the BtnConfig control. | {
var rockConfig = RockConfig.Load();
var selectedTenderButton = spTenderButtons.Children.OfType<ToggleButton>().Where( a => a.IsChecked == true ).FirstOrDefault();
if ( selectedTenderButton != null )
{
rockConfig.TenderTypeValueGuid = selectedTend... | 0 |
51f28da9de034fe38c42dd424b808efe | f62475615dd146d651919cc6a2d23993 | Zatrzymaj syna pod warunkiem, że istnieje. | {
if (status == Status.IDLE)
{
try
{
wait(timeout);
}
catch (InterruptedException e)
{
throw new UncheckedInterruptedException(e);
}
}
if (status == Status.ACTIVE)
{
... | 0 |
743ff0ceea031045f4f7579724832af9 | 0980b107ac5b86be8c4079e505be14c7 | Returns true if any of the elements makes it through the filter. | abstract class BaseEnumerable implements IEnumerable
public function any(\Closure $predicate): bool
{
return $this->addToLazyEval(__FUNCTION__, $predicate)->evalLazy();
} | 1 |
799d4e3035821cfcea36b48806d410a8 | a95de7f548ca1677651f367be6a60d30 | Returns the origin position and a fallback position based on the user's position preference.
The fallback position is the inverse of the origin (e.g. 'below' -> 'above'). | export class PopoverDirective implements AfterViewInit, OnDestroy
private getPositionClass(fallback?: boolean): string[] {
if (fallback) {
if (/^left/.test(this._fallbackPosition)) {
this._fallbackPosition = this._fallbackPosition.replace('left', 'right') as PopoverPosition;
} else if (/^right/.... | 1 |
e7b8eca79988cb5d1b77c6115c084965 | 0d9dfe942bc58daebb9a35338f5c4d2e | Dao method that sets an OnlineUser's email. | public class Users
public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
} | 0 |
ca2d2fe23b46b549707d5aa58f26e65f | 98378a7674598cbf6fd33eb4e9f241cb | Returns the path of this node.
@rtype: string | class MpaasNode
def path
@path ||= (parent.nil? ? name : Pathname.new(parent.path) + name).to_s
end | 1 |
2c3e43854a790a219a31499c505a2d1e | 98bad497a8507bc07330bfa16dac15c6 | @brief returns the options for an yearly repeating event | {
DWORD dwRec = CA_GET_RECURRENCE(dwInfo);
switch(dwRec)
{
case CA_CALENDAR_RECURRENCE_NONE: return L"None";
case CA_CALENDAR_RECURRENCE_DAILY: return L"Daily";
case CA_CALENDAR_RECURRENCE_WEEKLY: return L"Weekly";
case CA_CALENDAR_RECURRENCE_MONTHLY: return L"Monthly";
case CA_CALENDAR_REC... | 1 |
b65238e02ee0160ea567cc064d6572c1 | d8c90ea8e05b6fa3d690227a23d58eee | Lance ou arrête le métronome | global val
if val == 0:
bout_start_stop.config(text="arrêter")
start()
else:
bout_start_stop.config(text="démarrer")
racine.after_cancel(id_after)
val = 1 - val | 1 |
8311fada8eed7114038086fcdd15603a | 73a3231f7ffd38eef610d41d1641d74b | construct the dns string used to make a connection | char *dns_str_convert(void *in) {
unsigned int length = 0;
char *ptr = (char *)in;
char *ret, *tmp;
while (*ptr != 0) {
length += *ptr + 1;
ptr += *ptr + 1;
}
tmp = ret = calloc(length+1, sizeof(char));
ptr = (char *)in;
while (*ptr != 0) {
memcpy(tmp, ptr+1, *ptr... | 1 |
69f103f1bba14e72c02a40871bdc4244 | 2572a68ddd8640aac48293395381d08f | This methods reads all projects with differential data from the Project table. | namespace ProjectDB.DAL
public class ProjectSqlDAL
public IList<Project> GetAllProjects()
{
List<Project> result = new List<Project>();
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand c... | 1 |
12ce7c08605159cc0107c1e5c604cdfc | 55d87ce25e57c2351329d42e903bfb96 | formats range in the requested format | def format_range(value):
if len(value) == 4:
result = '%s %s-%s/%s' % (value[3], value[0], value[1], value[2])
else:
result = 'bytes %s-%s/%s' % (value[0], value[1], value[2])
return result | 1 |
47cdc7581fb9a57d058460b0682b4467 | 4e694368fcb5d933b2e592fefc41e65b | Displays a form to edit an existing ParametreReglegestionquestionnaire entity. | class ReportParameterController extends Controller
public function updateAction($id)
{
$em = $this->getDoctrine()->getEntityManager();
$entity = $em->getRepository('LowbiSystemBundle:ReportParameter')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Repor... | 1 |
9be1419f1bba424618c3c1a7e8ac455c | f7cbf92e077360c664034246681e526a | https://www.codewars.com/kata/580a4734d6df748060000045 | function solve(s){
let sorted=s.split(``).sort().map(v=>v.charCodeAt());
return sorted.map((v,i,arr)=>v+1===arr[i+1]).filter(v=>v===false).length<2
} | 1 |
2dc76582f6a0d4a2b5a3cd3f881a40eb | 1893156ccc40d26c3c4debbdb2219b09 | Gets the title of the tab at a given index. | public CharSequence getPageTitle(int position) {
CharSequence pageTitle = null;
switch (position)
{
case 0:
pageTitle = mContext.getString(R.string.tab_timeline);
break;
case 1:
pageTitle = mContext.getString(R.string.tab_shops);
break;
case 2:
pag... | 1 |
e9673aa8e748ad39bb330b8bcda30e15 | 6f216db2d6412cf794f953018eee6f6e | Test Sendgrid Client handling empty inputs | class TestArgParser(unittest.TestCase):
def test_no_mail_input(self):
for args in ('', 'sendcrap/', '-e txt', '-r'):
self._p(args)
self.assertTrue(len(self.mlist) == 0) | 1 |
42be974c7f6f07025fe55436bd999d4d | 34601a12e15603b2561dc95d199cd443 | 空の入力を渡した場合、ログイン中のユーザーのユーザー情報は更新されない. | {
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
$client = $this->createClient();
$parameters = [
'oauth_id' => 2,
'openid' => '2382158635',
'ip' => '127.0.0.1',
'entrance' => '2',
'x_forwarded_for' => '184.146.232... | 0 |
f92d3ee6b5cdf78d2e132482cc774579 | 59676aa3d81e06a4f9300e331bee5b93 | this function will display the values that the user entered to the screen. | a = document.querySelector("#aValue").value;
b = document.querySelector("#bValue").value;
c = document.querySelector("#cValue").value;
var aV = document.querySelector("#a").innerHTML = a;
var bV = document.querySelector("#b").innerHTML = b;
var cV = document.querySelector("#c").innerHTML = c;
} | 1 |
3390b77e1362a2b6cc2b9a0a4cc8367e | ba944e3ba5ebe9fea059406ec36fa828 | Make Reed-Muller RM(r,m) parity check matrix. | def mr(cm):
number_of_ones = int(cm /2)
reference = np.zeros(cm)
reference[0: number_of_ones] = 1
np.random.shuffle(reference)
return reference | 0 |
1d6e044cf69fe211fb5e74b6f85d6a0b | 121f6cb17a11ff4a1a0ada845052ecc3 | 获取skip参数 | if (!query.$skip) return 0;
let skip = parseInt(query.$skip);
if (isNaN(skip)) skip = 0;
return skip;
} | 1 |
617bf90f7faf9d6230ea99a9a35aa6a4 | 7f18b3e7893d99c7b3e19e2fd516753c | Validate whether the type object is a valid NUnit test suite. | class SevenTestRunner(TextTestRunner):
def run(self, test):
def _issuite(tc):
try:
iter(tc)
except TypeError:
return False
return True | 0 |
5b75cc068623119800ce96c575721d9e | 9f186fc78496464e62a5dd44a5d5a314 | Gets all Web Hosting Plans in a current subscription and Resource Group.
(see http://msdn.microsoft.com/en-us/library/windowsazure/dn194277.aspx
for more information) | Future<WebHostingPlanListResponse> listAsync(String resourceGroupName); | 1 |
11fe3c156c94bdd51982749d60bc4ff5 | 884f968066fc2f07f85a951c3e5018a5 | Получить текст песни из БД | class MusicFinder:
def find_original_text(self) -> str:
url = f'https://en.lyrsense.com/{self._singer}/{self._song}'
response = requests.get(url)
if response.status_code != 200:
return "Приношу свои извинения, я не смог найти данную песню"
soup = BeautifulSoup(response.text,... | 0 |
6b70563c6a3611267cc38eec0b169352 | c491f823121254809b47634689428f59 | Setter for context_name property. | public class KerberosTokenValidator implements Validator
public void setContextName(String contextName) {
this.contextName = contextName;
} | 1 |
a4c80e73a31f8d61ef1c5a5880132cbe | a6815a283352bed918cf6e4013f98a73 | 自动获取 OSS 的图片原始地址,如果 OSS,自动会识别原图地址 | function getOssOrginPicUrl(photourl) {
if (isOssPic(photourl)) {
if (photourl.indexOf('@') != -1) {
return photourl.split('@')[0];
} else {
if (photourl.indexOf('?') != -1) {
return photourl.split('?')[0];
} else {
return photourl;
... | 1 |
d301bb2adde73cd88e44c59e89567103 | a2cd9701f7fa5b9187afc48f02fcd1a8 | function to find nearest prime greater than the users number | {
int i = 2;
long new_prime = n + 1;
while (i < sqrt(new_prime))
{
if (new_prime % i == 0)
{
new_prime++;
i = 2;
}
else
i++;
}
return new_prime;
} | 1 |
6336b446657f18a4d7ad59e1a801727b | 3e16624e7104a939476016b97572322d | Obtiene un valor que indica si la casilla está dentro del tablero. | public class Tablero
private boolean correcto(int numCasilla){
boolean result = false;
if ( this.correcto() && numCasilla >= 0 && numCasilla < casillas.size() )
result = true;
return result;
} | 1 |
d1ae821a5671055b2a4de1e1f3561525 | 041341d2118e7a8a50956ab3301c6a95 | Is this a y scale, axis, etc. | public class Calibration implements Cloneable
public boolean scaled() {
return pixelWidth!=1.0 || pixelHeight!=1.0 || pixelDepth!=1.0 || !unit.equals("pixel");
} | 0 |
75a99ea3b7bd484dc5fbf06822311b41 | b4b1cca215594cd886827a42d0a33636 | Gives a name of this request which is used in [[Await]] component.
The same effect of [request.name()](./request.html#name) | @SuppressWarnings("WeakerAccess")
public class CredHubRequest<T>
@JsonInclude
public String getName() {
return name == null ? null : name.getName();
} | 1 |
e7e0f937f4168aa85335d3bd58bb0675 | 51fd0bdf075605705668c336f77868e1 | @brief Return information on requesting peer if applicable.
A server-type ChannelProvider will use this method to discover if a remote client
has provided credentials which may be used in access control decisions.
The returned PeerInfo is only required to have valid values for: peer, transport, and transportVersion.
Pe... | class Provider implements \Phurl\Providers\ProviderInterface
public function requestAuth() {} | 0 |
91572409e3f69797b83e675f84b9df03 | 4187f4e428b523cba389d3094ac91a86 | sort array in increasing order | void sort_array(int *a, int n)
{
int i, j, element_i;
i = 1;
start_for2:
if(i >= n) goto end_for2;
element_i = a[i];
j = i;
start_while:
if(j <= 0) goto end_while;
if(a[j-1] <= element_i) goto end_while;
a[j] = a[j - 1];
j--;
goto start_while;
end_while:
a[j] = element_i;
i++;
... | 1 |
4650b1fd88c79fd9a736ce7748416abc | a7e61a942aba785c69ba66353215ea46 | This method returns a list of all costitems by category | CostItem[] getCostItems(Date dateStart, Date dateEnd) throws CostManagerException; | 0 |
22a5e878b3f73d836b20ce0ed9c5591c | 66d7fce6b040477fcbc5bdda4e501913 | 为manifest注册chapter文件列表 | class SpiderPluginFilter:
def chapter_parse_save(self):
books = BookChapter.query.filter_by(bookinfo_id=self.res.get('book')).all()
if len(books) != len(self.res.get('chapters')):
for temp in self.res.get('chapters'):
with db.auto_commit():
books = BookCha... | 0 |
0c7230a354ed9ff6dc08e5e73da33bc6 | 6b8def869b6f7ad6bcfe3443351f7b82 | 根据 Camp_index获取数据 | class Role extends EntityModel
public getZhuZaiDataByIndex(index: number): ZhuZaiData {
return this.zhuZaiData[index];
} | 0 |
54ac702780993cc824a7707a0c9f01ae | 3c2fd7f0faf4080c59990e3598756520 | 获取九星序号,从0开始 | namespace com.nlf.calendar
public class Lunar
public NineStar getDayNineStar()
{
string solarYmd = solar.toYmd();
string yuShui = jieQi["雨水"].toYmd();
string guYu = jieQi["谷雨"].toYmd();
string xiaZhi = jieQi["夏至"].toYmd();
string chuShu = jieQi["处暑... | 1 |
5b30335947c1d49ce55301cc7b31e5f7 | 5d1fe0a5be20a7931c03abbf956fa028 | Decrement the number of attempts.
This is intended for application logic when a login attempt can be forgiven. | this.loginAttemptsSinceLastUnsuccessful = getLoginAttemptsSinceLastUnsuccessful() + 1;
if (this.getLoginAttemptsSinceLastUnsuccessful() >= 3) {
this.setLockedOut();
this.resetLoginAttemptsSinceLastUnsuccessful();
}
} | 0 |
41ba395aa9c71e2b10165dbabd47f3f4 | 903eb07dbab2415f5f7e8fe5439d8125 | Hilfsfunktion, um eine neues Zeitintervall zu erzeugen, dessen Beginn und Ende im darstellbaren Zeitraum eins
Datenbankservers liegt. | {
int planId = -1;
try
{
String SQLBefehl;
Connection con = DbConnection.connect();
SQLBefehl = PlanDb.getSqlStringInsert();
String generatedColumns[] = { "planId" };
PreparedStatement st = con.prepareStatement(SQLB... | 0 |
da5cfbbf40ab93df44605ee7f68d0a19 | a5203f6707d8e4f1b88ad8be61f16b87 | Safely create a new username and encrypted password for a new user account. | class FileBasedAuthenticator implements \PHPESAPI\PHPESAPI\Authenticator
public function createUser($accountName, $password1, $password2)
{
$this->loadUsersIfNecessary();
if (!$this->isValidString($accountName)) {
throw new \PHPESAPI\PHPESAPI\Errors\AuthenticationAccountsException(
... | 1 |
b1b6552393c74049c25b3d58ca8ee780 | c6a1868b809d8292eb4721a89bd3052f | Get the encoded data for requests authorization | public function getAuthData(): string; | 1 |
36ab1c1eb12d0ae67592b78568b1da6a | ee507e3ee2dbadac8187f6f11af87e31 | Adds taxonomy filters to the posts admin page | function ceo_filter_restrict_manage_posts() {
global $typenow;
if ('comic' == $typenow) {
$post_types = get_post_types( array( '_builtin' => false ) );
if ( in_array( $typenow, $post_types ) ) {
$filters = get_object_taxonomies( $typenow );
$filters = array_diff($filters, array('post_tag'));
foreac... | 1 |
e34e12e3e2d65dd368083b868e363833 | 41dc8f069010fa183345ac83c9c99c78 | Returns the value of the '<em><b>Yn Generated</b></em>' attribute.
The default value is <code>"false"</code>.
<!-- begin-user-doc -->
<!-- end-user-doc -->
<!-- begin-model-doc -->
If set, the page is generated from the outside of the GUIDesigner.
<!-- end-model-doc --> | public void setIsGenerated(boolean isGenerated); | 0 |
3593bb75ac7d74434bf483b27f0fa05e | b59c8e574b18cbea67c0a3821094362b | Create an OutboundEmail entry in the database - not yet populated with an S3URI. | class OutboundEmail extends SugarBean
public function saveSystem($saveConfig = false)
{
$a = $this->getSystemMailData();
if(empty($a)) {
$a['id'] = '';
}
$this->id = $a['id'];
$this->type = static::TYPE_SYSTEM;
$this->user_id = '1';
$this->setDefaultTeam();
$this->save();
... | 1 |
dd44de7fad83bc1380d0ed2d1cc47883 | c6f5a42c569d5755b5177368d8cd4951 | +++++++++++++++ FUNCTION DESCRIPTION ++++++++++++++++++
<p>
<p>NAME : addOrEdit
<p>
<p>DESCRIPTION : 添加或修改测点档案记录
<p>
<p>COMPLETION
<p>INPUT :
<p>OUTPUT :
<p>RETURN : String
<p> | @Controller
public class MDCController extends MyControllerSupport
@RequestMapping(value = "/39113003", method = RequestMethod.POST)
public MyModelAndViewSupport m39113002post(MDC_PPXXDBO param){
if(logger.isDebugEnabled()){
logger.debug("param:{}", param);
}
String strMsg = "";
int iResult = 1;
param.set... | 1 |
8cedcd8ce8686ad9fd666e154393b8ae | 3df9bbacbed81677b166afb950fd1b75 | returns the number of favorites this picture got | class Picture(db.Model):
def star_count(self):
return self.startuser.filter_by(staredpic_id=self.id).count() | 1 |
4b710303933065a07eac97d5e0f6f474 | 280f562e640f42de832ef4c9ad4563b7 | 自定义子组件, 用来显示房屋列表 | class House extends React.Component
rowRenderer({ key, index, style }) {
const item = this.state.list[index]
if (!item) {
return (
<div key={key} style={style} className="tips">
<p />
</div>
)
}
return <HouseItem key={key} e={item} style={style} />
} | 1 |
244e1a2cab0f7bad211608f06023ea8a | a9804c3c904192fbd8ac652f276bd32a | Prepare compression function and partial arguments. | static DECLCALLBACK(int) rtZipLZFCompInit(PRTZIPCOMP pZip, RTZIPLEVEL enmLevel)
{
NOREF(enmLevel);
pZip->pfnCompress = rtZipLZFCompress;
pZip->pfnFinish = rtZipLZFCompFinish;
pZip->pfnDestroy = rtZipLZFCompDestroy;
pZip->u.LZF.pbOutput = &pZip->abBuffer[1];
pZip->u.LZF.pbInput = &pZip->u.LZF... | 1 |
52ac36e06d9dbc15d210b884dbdf47ea | c24a4aca370ae9d26a17702bd2454624 | Method called by the server in order to check if there are enough players to start a game | public abstract class AbstractPokerTableServer extends UnicastRemoteObject
public boolean canSitIn() {
return (waitingClients.size() + clients.size()) < pokerTable.getMaxPlayers();
} | 0 |
834965fa755a1137b6cc557e21044d38 | 833b08f57b44a907c6d545d034d96e54 | 查询历史评级 | class Ratings_model extends My_Model
public function getRatingHistory($data = false, $types = 'coeffs') {
$limit = 30;
$this->db->select('rh.*, u.nickname, u.avatar, ra.name AS role, ro.name AS rank');
$this->db->join('users u', 'rh.to = u.id');
$this->db->join('roles ro', 'u.role = ro.id', 'LEFT OUTER');
$th... | 1 |
ed076287532e86365e841e92bfc50d8c | 8e028394d2cfd4268f0b3b0b05c9d93d | Hello World! | func main() {
fmt.Println("Hello, World!")
} | 1 |
f4bfb43be10b6ecd3b990012dcc42b2a | f6067e3f731ba2b6e76029cda6e11716 | Returns the graphical interface of the score. | public class ScorePanel
public JTextArea getScoreDisplay() {
return myScoreDisplay;
} | 1 |
9c4d611ea27b917273efc2eb9bb74715 | fd760db0f12a7bb8f70b01038e0f3e88 | Handler to fetch user specific prescription information and send it to client. | class PrescriptionController extends Controller
public function show($id)
{
$pres = DB::table('prescriptions')->join('medications',function($join) {
$join->on('prescriptions.medication_id','=','medications.id');
})->where('prescriptions.username',$id)->get();
return view('pres... | 1 |
13ee9715ec128d2e4ca7c0eb4ba57b94 | 537a12d293e275f3025d0528c7785bdc | 根据消除目标球的位置来显示特效 | public class PlayerDir : MonoBehaviour
void ShowEffect(Vector3 pos)
{
Instantiate(effectPhy, pos, Quaternion.identity);
} | 1 |
90ed1812bd5b0e9933eccb56b5c00959 | 31942237243ba5072ff1ddb5988ccfa4 | Находит минимальный цикл в графе | fun GraphProperties.girth(): Int {
val marked = BooleanArray(graph.V)
val edgeTo = IntArray(graph.V)
val distTo = IntArray(graph.V)
val init = {
for (i in marked.indices) marked[i] = false
for (i in edgeTo.indices) edgeTo[i] = 0
for (i in distTo.indices) distTo[i] = 0
}
v... | 1 |
6a7030dbe3973ef7336b9d39c0522fbd | 75089639686a19462fee0911a9a458bc | carrega a lista de emoticons do sistema | cursor.execute("""select * from bttv_emote_list""")
rows = cursor.fetchall()
for row in rows:
emoteList.append(row.emote)
return emoteList | 1 |
05937f63761d3f69e9f1393dfc5d2334 | 4f2d0b1c44406def0679d72f1f87b445 | Vytváří formulář, který slouží pro zrušení celé rezervace | if request.method == 'POST':
r_form = ReservationForm(request.POST)
if r_form.is_valid():
r_form.save()
messages.success(request, f'Rezerwacja została złożona')
return redirect('wycieczki')
else:
r_form = ReservationForm()
context = {
'form... | 0 |
23c7204e3d60725696adc4811d77dd2f | 007abde78f32c021230728f48d8f1bc8 | This method will update the current step name. | class StepWindow extends React.Component
setStepName(name) {
this.setState({
stepName: name,
});
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.