query_id
string
corpus_id
string
query
string
code
string
label
int64
7707b1d2533fc9ee0089668c469ac2ab
dac67abe513c716e31fab398dc68ff28
Write an internal 64-bit SOC register through S-Channel messaging buffer.
int ctrl_WriteRegisterWrapper(void *interfacePtr, uInt8 channel, uInt8 regAddr, uInt8 regData) { uint8_t controlWord; SILABS_UNREFERENCED_PARAMETER(interfacePtr); if (channel == PROSLIC_BCAST) { controlWord = PROSLIC_CW_BCAST; } else { controlWord = CNUM_TO_...
0
7d93abcc7a78ba569b3db1e33d042403
21477cdbbb9231aa0f14aaad7139eda0
Verify mouseUp updates state and calls handler properly.
namespace AbsoluteZero partial class Window : Form public void MouseUpHandler(Object sender, MouseEventArgs e) { Game?.MouseUpHandler(e); AnalysisBox?.WindowMouseUpHandler(e); }
1
a854c27e403e2b53c6e64250217e54e9
ca3f79a9064c586e97c0b7770c16711a
Find first non-alloca instruction. Every basic block has a non-alloc instruction, as every well formed basic block has a terminator.
bool changed = false; std::unordered_map<Value *, Instruction *> lastUser; llvm::SetVector<Instruction *> deallocs; auto &instrs = M.getInstrs(); for (auto &I : instrs) { if (isa<DeallocActivationInst>(&I)) { deallocs.insert(&I); changed = true; continue; } if (auto alloc = dyn_c...
0
6a3fc1785799f726de9a52b7ca7da276
bc67589c3d8a9c410a33280f906809ba
Take input from the gameplay/combat form, provide the appropriate results, and run end of turn regen/cleanup.
class Player(object): def take_turn(self): self.duration_effects() self.end_turn()
0
ddbe22cc9d054852ccb30ad339d60cc2
c21ad93dd8b3a4fc77ac1c77e52bcb96
Clean the gripper error
namespace RobotControl public class RobotControl public void ClearError() { Send(string.Format("cmd={0};a1=0;a2=0;a3=0;a4=0;a5=0;", Commands.CMD_MpCancelError)); }
1
1547cbbd7cf7c2c614a768095e18b6d0
51394aacb3862685437415ea8fd3dd15
Test activation of runes.
func TestRuneFilter(t *testing.T) { var filter RuneFilter filter = matchRune('#') checkState(t, !filter('B'), "should not match random rune") checkState(t, filter('#'), "should match configured rune") filter = matchRuneRange('A', 'Z') checkState(t, filter('A'), "should match rune 'A' in range") checkState(t, fil...
1
c0aa7a259ddd735ca169d4161a4a68e1
c9b8d192fbcb677622a4f794482dd122
Aktiverer kø. Kaller database klasse metode og returnerer kø-view
class QueueController public function returnActiveQueue($idJuk) { return Queue::where('idJukebox', '=', $idJuk)->where('isActivated', '=', '1')->first(); }
0
15f5fa0a6ff48bea2aa268dca1ed1684
c0930fd07c95240ae279c7847fc2bbec
统计指定栏目下的文章
public List<Article> findByColumnid(String columnid);
0
41a2ee416eeb89926408d38ee40fd6ba
6e625fe47cc5f09a3a7b7fd2f907c388
业务流水ID[SWT任务池中对应业务流水ID]
public class Businessflowlnk extends BusinessflowlnkWhere implements Serializable public String getBusinessFlowID() { return businessFlowID; }
1
f6b495f5e23202acef72099318bb7013
73543abfe96be42c705f2267f296bdab
Соединяет с сервером, используя прерываемый ввод-вывод
public class InterruptibleSocketFrame extends JFrame public void connectInterruptobly() throws IOException { messages.append("Interruptible\n"); try (SocketChannel sc = SocketChannel.open(new InetSocketAddress("localhost", TestServer.PORT))) { in = new Scanner(sc); while (!Thread...
1
fa9d914cdf8eb915b80e9f45b8371e15
793fa9e1c07ad67fa17b08628820b62d
Le pregunta al usuario una contraseña y no le permite continuar hasta que no la ingresa correctamente.
password = "2046WKW" ingreso_password = input("Ingrese la contraseña:") while not password == ingreso_password: ingreso_password = input("Su contraseña es incorrecta, ingrese otra:") else: return print("Su contraseña es correcta.")
1
229763d2c1276da13cea271818a8621b
164096b8fd639aa843bdd54bc7d8fa26
Returns the value of the '<em><b>Metamodel Alias</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Metamodel Alias</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
EAttribute getOawBaseExpression_Metamodel();
0
88b15274ba7dba3e6c07a87be5b0e5af
e14fb46cb91eed4cd54d20ce8b0694fb
Возвращает элементы расписания для переданного дня недели.
def get_timetable(day: str) -> dict: lessons = timetable[day] return lessons
1
19559772548750c21dfcbf1159a25aff
3dd39cd5402d3ec7c5587c666c2266a4
Returns The date the Person last changed..
public Date getChangeDate();
1
61d51eabf71ecf971cce142c0b14102e
5f6dc3677cb0ceb1b1fc64ec6e3e7c56
移除并返回集合中的一个随机元素。 <br>
@UtilityClass public class CollectionUtil public <T> T random(Collection<T> coll) { int num = (int) (Math.random() * coll.size()); for (T t : coll) if (--num < 0) return t; throw new AssertionError(); }
0
c7d84a5fab126f89cf2e8863f481f534
e549abab0c3260ee5a3628bba8f5d15a
本月第一天时间
thisMonthFirst (params) { return this.timeFun({date: thisMonthFirstDay, ...params}) }
1
2eb7a363150dbd2d4c0a7a81cdd0ebb6
39d23e327785d767007cc64297794870
Checks and installs all TrueType fonts within a specified folder.
{ string _fontFile = FileHelper.GetFileName(fontSourcePath); string _targetFontPath = string.Format(@"{0}\fonts\{1}", Environment.GetEnvironmentVariable("WINDIR"), _fontFile); try { string _fontName = FileHelper.GetFileNameOnly(_targetFontPath); ...
0
dcc7ea972208adc50f55c063b4800053
1c85c383d6ad466f0455b50d32712d0b
возвращает промис с мировой статистикой за сегодня
dateString: string, callback: (results: number[]) => void ): void { this.getHttp( this.apiUrl, [ { key: 'statDate', value: new Date(dateString).toDateString() } ], callback ); }
0
173df6af708ceaf4d7727866f47c51ce
6bf7c1a22110709a283f382c48b0202c
@brief Saves the open list to the map.
{ Node* p; Node* q; if (open_list == NULL) { open_list = new_node; return; } p = open_list; while (p != NULL) { q = p; p = p->next; if (p == NULL) { q->next = new_node; return; } else if (GET_F(new_node) < GET_F(p)) { q->next = new_node; new_node->next = p; return; } } }
0
9bcba061a7fd7f365c81875374773750
e2089f8dec7e563010257f667c9ee483
Decode configuration data
var c Conf if err := envdecode.StrictDecode(&c); err != nil { log.Fatalf("Failed to decode: %s", err) } return &c }
1
0291f15779c740b7eb6c0aa2e5c802dc
56f93919be85cd36040c33bee3e83ae4
Method to get the Response object of the last call to the service, null if no call was done or no response was obtained
TResponse getResponse() throws InterruptedException;
0
09733393ab5216ffc5f70afec07d73f6
2fd3c2f0dce4cf5644b2feed0e2fe72a
[START containeranalysis_create_occurrence]
namespace Pulumi.GoogleNative.ContainerAnalysis.V1 public static class GetOccurrence public static Output<GetOccurrenceResult> Invoke(GetOccurrenceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke<GetOccurrenceResult>("google-native:containeranalysis/v1:getOccu...
0
163c20e63ae08063b19920f0a4f04372
05195f8b97fec0223afc2d2bc3af0dcb
Enter a parse tree produced by {@link TSqlParser#break_statement}. @param ctx the parse tree
void enterStatementBreak(JParser.StatementBreakContext ctx);
1
b5fd6937dfa7d0fc74590cbf16c3147d
31fb73936df9abb849888c32a68f38b9
* Get Number of Enemies Slain
public class EnemiesController : MonoBehaviour public int getDeadEnemies () { return numberOfDeadEnemies; }
1
75b203bb4adf24e65ae7b1b3405d1599
110e45d6490fb51efc708e6cea20d00e
拼接FROM表达式
protected function generateFrom() { $from = ''; foreach($this->from as $className) { $from .= $this->addClass($className).', '; } if($from == '') { return ''; } return ' FROM '.substr($from, 0, -2); }
1
60a927a2ba0dd093e4cee7308f1df349
c6a0880bb7f05f0fe57ee65feca0870a
Defines the error message for the last defined rule. If a rule is not respected, the message will be registered as an error for the specific property.
public function setRuleError(?string $message): void { $this->rule_error = true; $this->rule_error_message = $message; }
1
c30b432bea2120fc1694b2bf8dd765cb
8adb4bbc39d6aa81b429ea62cf11cd43
Returns a version of this spec that conforms to the API representation.
namespace Google.Cloud.ApigeeRegistry.V1 public sealed partial class RegistryClientImpl : RegistryClient public override ApiSpec RollbackApiSpec(RollbackApiSpecRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RollbackApiSpecRequest(ref request, ref callSettings); ...
0
36aa6aae43e52bf726472acd161d4ad2
747e6934a2ed6c873c24a4fbcffaaa48
Add a range of options
for option in options: if option not in self['values']: self['values'] = (*self['values'], option)
0
34723186676f29c3687887218a8c83d6
dbb3f92bb0660821d75fc28089f4c794
获取合约当前最优买卖价
class MyClient(CPhxFtdcTraderSpi): def _get_price(self,ID_list): best_price = {} for ins_id in ID_list: md_i = self.md_list[self.ins2index[ins_id]] if len(md_i) > 2: best_price[ins_id] = {'ask': md_i[-1].AskPrice1, 'ask_vol'...
1
4e0ac83e07ac1b52ab567e6fa607cb48
ea72e0f320bcbef73bdca5931761f68f
「いいね」しているユーザー情報をデータベースに追加するSQLを作成する
class LikeUser(RawSqlModel): def addLike(cls, user_id: int) -> SqlTypeReturn: return dict( raw_sql=''' INSERT into like_user (user_id) values (:user_id); ''', params={"user_id": user_id} )
1
6b175d0995250db133d7f6801b7f56e7
f4cb5ee204f6f7adc728d0b1cb62371e
向数据库中添加公式
$name = htmlspecialchars($datas['name']); $description = htmlspecialchars($datas['description']); $price = htmlspecialchars($datas['price']); if (isset($datas['enabled'])) { $enabled = 1; } else { $enabled = 0; } $discount = htmlspecialchar...
1
7819cf483b82c663ce79e1edea1b1517
83a6826d86d2c68309f13e3a3c77a993
Updates the internal packages into DB.
{ string deviceId = getDeviceId(); fetchpackages(); if (File.Exists("packages_name.txt")) { FileStream fs = new FileStream("packages_name.txt", FileMode.Open); StreamReader sr = new StreamReader(fs); var line = sr.Re...
1
6176a3da048ad95b4a9ed5e3929d4a04
806dfe4640c82ec50661a658c21ed2a6
.nub at3 - from Namco NUB archives [Ridge Racer 7 (PS3), Katamari Forever (PS3)]
rom.patch(0x03, 0x1E0E, ASM("ld [$DB56], a"), "", fill_nop=True) rom.patch(0x15, 0x06B6, ASM("ld a, [$DB56]\ncp $80"), ASM("xor a"), fill_nop=True) rom.patch(0x03, 0x182D, ASM("ld a, [$DB56]\ncp $80"), ASM("ld a, [$DAE2]\nand $10")) rom.patch(0x07, 0x3947, ASM("ld a, [$DB56]\ncp $80"), ASM("ld a, ...
0
adb69f4131fb88a896165dfab52903fc
636a845521ab9bc392778ee546ab543d
======================================================================================= マウスを有効化したり、バッファを決定したりする関数 =======================================================================================
HRESULT MakeVertexMouse(LPDIRECT3DDEVICE9 pDevice) { if(FAILED(pDevice->CreateVertexBuffer(sizeof(VERTEX_2D) * NUM_VERTEX * 1, D3DUSAGE_WRITEONLY, FVF_VERTEX_2D, D3DPOOL_MANAGED, &g_pVtxBuffMouse, NULL))) { return E_FAIL; } { VERTEX_2D *pVtx; g_pVtxBuffMouse->Lock(0, 0,...
1
63c48dffbe914fb068f18310df52efc2
15749245e2ef080ee40e990cff17dec7
アンケートに回答
{ $answers = array(); { $dsn = 'mysql:dbname=assign_web_master;host=localhost'; $user = 'kawakami'; $password = 'kawakami'; try { $dbh = new PDO($dsn, $user, $password); $sql = 'select * from questionnaire'; foreach ($dbh->query($sql) as $row) array_push($answers, $row); } catch (PDOExeptio...
0
3e5531d8ddb3dd8ed29f471635f3abcb
99ffba836f33fc41fd1fd05a5d529439
Creates a new playlist in an existing source.
resource = build_resource(properties) kwargs = remove_empty_kwargs(**kwargs) results = service.playlists().insert(body=resource, **kwargs).execute() return results['id']
1
fa4370a9b0690f86997e5e6ae56c2dd5
972f171329c7f5046136f61155016e33
Update versioned webapp configuration in the gateway for tenant users.
namespace Dynatrace.API.Api System.Threading.Tasks.Task PutGlobalAutoUpdateConfigForTenantAsync (ActiveGateGlobalAutoUpdateConfig body);
0
63eb4ba6c331d806aa5b5728c044fd34
adcc612766770e6d760217c97b9c8af7
获取git配置路径
ClassLoader classLoader = getClass().getClassLoader(); InputStream inputStream = classLoader.getResourceAsStream("git.properties"); return readFromInputStream(inputStream); }
0
cc63f824ebf2591b9c1c9b9c8681c571
e12ead2f0527604ec71ea966377fc482
Стратегия игры против двух врагов
{ return new CooperationStrategyMatchup( new NaiveCooperationStrategy(), new EvilCooperationStrategy(), new CooperationChoicesPayoff()); }
0
2d5dc64ee80423df3a43ae805a97eba5
f96e024fd18b026dc23d75cfb4853888
Make sure empty descriptions are rejected
class ProductTest extends TestCase public function testNoDescription() { $response = $this->actingAs($this->user) ->postJson(route('product.store'), [ 'name' => $this->faker->name, 'price' => $this->faker->numberBetween(1, 50) ]); $response->as...
1
8034a96e0151d7edd82ca5e34bae47e0
7a046027251da68a5d7177af5739669b
@brief GPIOTE event handler, executed in interrupt-context.
{ NRF_GPIOTE->CONFIG[GPIOTE_Line] = (GPIOTE_InitStruct->GPIOTE_Pin << GPIOTE_CONFIG_PSEL_Pos) | (GPIOTE_InitStruct->GPIOTE_Mode << GPIOTE_CONFIG_MODE_Pos) | (GPIOTE_InitStruct->GPIOTE_Polarity << GPIOTE_CONFIG_POLARITY_Pos) | ...
0
b7de63c1c4faf455add7ebf2879e6516
47f4f58bdb8fda68bb1ef0a261ddddf9
Raised when the data aren't of sufficient quality to complete an operation.
class InvalidDataError(Exception): def __init__(self, message, value): self.message = message self.value = value
1
dbb9f550e7a915fab6d1c978bfff59c3
5b8311a3143b90e1c1914fdaece26dbe
在根节点下添加一个节点
public class LinkNode public void addNode(String data) { Node newNode = new Node(data); if (this.root == null) { this.root = newNode; } else { this.root.add(newNode); } }
1
2b8cb83cfbcfab2f2797d46df9da6dc0
f4c01351a66cf1d0cb4b5f270019970d
Sprawdza czy podana liczba jest w zakresie. Zwraca True jeśli jest. (liczba) -> bool
try: if 0 < int(input_value) < 10: return True else: return False except: return False
1
cf049206acbc559abcc9a80f6316e854
c7cce7918c792004d84a951469e1affd
4G套餐变更查询
$.get('ENIQManage/Query2G', "", function(data){ var fieldArr=[]; var text=(JSON.parse(data).text).split(','); for(var i in JSON.parse(data).rows[0]){ if(fieldArr.length === '0'){ fieldArr[fieldArr.length]={field:i,title:text[fieldArr.length],hidden : true}; }else{ fieldArr[fieldArr.length]={field:i,t...
0
5df89babc3900d3e1d667ddd5fb286c3
6e23bc388c6f8fc292e02b0cc792a292
Register actual value reading status setter
public class MSLBStatus public static void set(boolean readFlag) { mslbStatusThreadLocal.set(readFlag); }
1
964c21f548917db4f3b3697e4c0029c3
e78e8ec256d776250df16f489fe65694
Changes state to suspension state
public class OCC extends javax.swing.JFrame private void jButtonSuspendActionPerformed(java.awt.event.ActionEvent evt) { OCC.simulationState = "SUSPEND"; jButtonResume.setEnabled(true); jButtonSuspend.setEnabled(false); this.cclient.sendMessage("SU"); }
1
dcd15b71c348ef6e1de29795752b174e
45b0a7757843b6a9f417c3097e7f77a0
Calcula a area de um trapézio
class exercicio6 extends Command private function calcula_area($x1i, $y1i, $x1f, $y1f, $x2i, $y2i, $x2f, $y2f) { $base = $x1f - $x2i; $altura = $y1i - $y2f; if ($base < 0) { $base = $base * -1; } if ($altura < 0) { $altura = $altura * -1; } return ($base * $altura); }
0
2046441a8b6a36e8dc309c60b7f663ba
1bc6dd0026544f836c6c92d19d440c02
This is used to generate the description uniformly from CRS wherever it might come in.
{ return CrsId.StartsWith("AUTO:") || CrsId.StartsWith("AUTO2:") ? string.Format(CultureInfo.InvariantCulture, "{0},1,{1},{2}", CrsId, Center.Longitude, Center.Latitude) : CrsId; }
1
9f1cbcb169c5128aeefa7a447c1f6d49
eaf387389dcfd11b7b67aad21f617a20
4. Imprime na tela o saldo médio das contas da agência
public function saldoSuficienteMedio();
0
e09d38dd7687b899e6b4a3bea0e71e67
3ce4173c47a06fed9f9ac8c03b6bf79d
function to write out weighted global brain connectivity voxel-wise image
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) int write_grd_bin(char *name, double x_min, double y_min, double x_inc, double y_inc, unsigned int i_start, unsigned int j_start, unsigned int i_end, unsigned int j_end, unsigned int nX, float *work) { unsigned int i, j; double x_max, y_max...
0
34b444c4bae8abd5873afe8a436531ff
ca0dedaa4793987fd6bedf10aa17c47d
Get locator size.
int getLocatorCount();
0
99f2dd84bb070d523f152832286446dc
4440653c35073380a50f7f8e7c8dadd8
Returns valid arguments for the `iterate()` and `generate()` methods.
class CodeGenerator function optionalArguments() { return [ 'waitForCondition' => ['timeout' => null], 'waitForFrameToLoad' => ['timeout' => null], 'waitForPageToLoad' => ['timeout' => null], 'waitForPopUp' => ['timeout' => null, 'windowID' => null], ...
0
13393f1101d7edac1c9d3271d13d94c4
70cdb163c43c5ad835441a9317886bdc
Obtiene el total de permisos ingresados a la base de datos.
{ $sql = "SELECT * FROM permiso"; return ejecutarConsulta($sql); }
0
fdea5c2871ad4f305dcee10df71ed154
93a9a40ff14c5c8c0c4c630115de71cc
Put a domain on a queue
def put_que(url): q.put(url)
1
e78f2581efea1c8ce6db2a5e1dfc1728
de2ad456558eb6e1aa162069982f903e
Test ``tril()`` with default arguments.
def tril_indices(rows: int, cols: int): indices = torch.tril_indices(rows, cols) assert indices.dtype == torch.int64 self.checkScript(tril_indices, (3, 3))
0
bf070aec446514a90d80ad200728dae4
9c3fcadd6be893d89833a6dc5708ba07
获取小说评论条数
function getCom($num){ $rs = DB::table('comment')->where('art_id',$num)->count(); return $rs; }
1
c6f8bc3df0584a919716c7004f1607a1
928c92a5e70c46ee5147e1f072c252f1
제본 여백의 크기를 반환한다.
public class Title public int getMargin() { return margin; }
1
bb7f3b6abd235eb844adfb7a6ea38956
56b0704e4850ea8ce45024a4f3ad0e40
double转String,保留小数点后两位
public class MyUtils public static String doubleToStr2(double value) { BigDecimal b = new BigDecimal(value); return b.setScale(2, BigDecimal.ROUND_HALF_UP) + ""; }
1
cf93629c0b0d1eff9eb39af9cb608db0
b4444155b8409badd529229bcf4f9e5b
The CWD command is issued to change the client's current working directory to the path specified with the command. FTP Voyager and other GUI-based FTP clients will automatically issue these commands as the user browses the remote file system from within the program.
int FTPCwd(char* dir) { char replyBuffer[BUFF_SIZE], cmdBuffer[BUFF_SIZE]; sprintf(cmdBuffer, "CWD %s\r\n", dir); if(-1 == FTPWriteCmd(cmdBuffer)) { return -1; } return FTPReadReply(replyBuffer); }
1
48f33a3d102bd1d8e81f357b7403c569
9f1617890fde60ebf5759fdd131cdfbe
这个池需要一个可以分配新资源的函数,并规定池的大小
if size <= 0 { return nil, errors.New("size value too small") } return &Pool{ factory: fn, resources:make(chan io.Closer, size), }, nil }
1
e54b791eeea379b8d149bf0faf37f169
3588fc79fc97201b45afce2e572f481f
BOOL Interface_SetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG uValue ); This function is called to set ULONG parameter value; The instance handle; char* ParamName, The parameter name; ULONG uVal...
ivPointer pParameter, ivUInt32 nParamID, ivUInt32 nParamValue ) { return ivTTS_ERR_OK; }
0
8a46354f93f4940342d768fbac9946ce
aa56db71ebd05534ff5ebea70a8f9341
Check if a return statement returns the address of a stack variable.
spt = self.project.analyses.StackPointerTracker( None, {self.project.arch.sp_offset}, block=block, track_memory=False ) offset_after = spt.offset_after(block.addr, self.project.arch.sp_offset) return offset_after is not None and offset_after > 0
0
ea5897115f2a013f30325c0503b8ac7a
ac73ad21b66dd70bbaf4db28fadf69fa
A test for SendCommand. Multiple commands are send to the protcol layer before getting the answer from Nuvo Essentia. It's expected that the commands are queued and processed in the correct order.
public void SendMultipleCommand2Test() { NuvoTelegramMock nuvoTelegram = new NuvoTelegramMock(); NuvoEssentiaProtocol target = new NuvoEssentiaProtocol(1, nuvoTelegram); target.onCommandReceived += new ConcreteProtocolEventHandler(serialPort_CommandReceived); ...
1
22b269c9a4fab10e711fe4e2d156a877
11871f6e45de9958512ccbb62142470a
JobHttpTargetHttpMethodEnumToProto converts a JobHttpTargetHttpMethodEnum enum to its proto representation.
func CloudschedulerJobPubsubTargetToProto(o *cloudscheduler.JobPubsubTarget) *cloudschedulerpb.CloudschedulerJobPubsubTarget { if o == nil { return nil } p := &cloudschedulerpb.CloudschedulerJobPubsubTarget{ TopicName: dcl.ValueOrEmptyString(o.TopicName), Data: dcl.ValueOrEmptyString(o.Data), } p.Attrib...
0
8cf9148b896addd181e4a2e2028ae082
46738a680a5d2b56a6d6927d6e0f6821
Método que devuelve el numero de anuncios denunciados
class ReportDao extends AbstractDao public function countReportAds() { $query = $this->mysqli->query("SELECT count(*) as count FROM $this->table " . "WHERE `ad_reported` is not null AND state=" . STATES["NEUTRO"] . " ORDER BY id DESC LIMIT 1"); $row = $query->fetch_object...
1
4e37fd1f3b64e1d659b6e3dba87048fc
86bfeebac37d66b9bd733b85229aaffd
Write into the log file loss value when the epoch ends function : on_epoch_end input : model : the model used output : log file updated
class LogRunMetrics(Callback): # callback at the end of every epoch def on_epoch_end(self, epoch, log): run.log('val_loss', log['val_loss'])
1
b563f452976d574d376e7c491227c52b
4c7c3cfb87a6de261592594cf7338fa5
Purpose: Show detailed calibration file mapping information.
msg = "\n " \ " Data-Cube Wavelength Calibration\n" \ " by Bruno C. Quint (bquint@ctio.noao.edu)\n" self.info(msg) return
0
ebd6b71f8e4bff8f3b2618fdb07e139f
702f0ff14d518f2b1a87daace04152e7
Plugin configuration object for PyLint Provides configuration panel for plugin dialog.
class ToolConfigDialog(eclib.ECBaseDlg): def __init__(self, parent): super(ToolConfigDialog, self).__init__(parent, title=_("PyStudio Config"), style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) self.SetPanel(ToolConfigPanel(self)) self.SetInitialSize(...
0
74a126d16937e9955de407a2343dc2c5
550f22b9a5f8501bf8579e66075d333c
根据频道iD查询所有正式属于该频道的文章
List<Document> getDocByChannelId(String channelId);
1
8a9a3472b8e65f2c292da538c7d746c9
28de02dffae57dbcc0620e65ec8ab63d
Instantiates a CertData object from a certificate.
class Certificate(Protocol): def from_buffer(cls, buffer: bytes) -> Certificate:
0
47a63758e2877bee2077254f45f67cb6
649a4ad51a511080fbc204d3e4415d73
Metoda przeliczająca szerokość okna, na liczbę kolumt pola tekstowego.
double divider = Project.projectWidth / ((Double)454.0); if(Project.projectHeight / divider > ((Double)282.0)){ divider = Project.projectHeight / ((Double)282.0); } return (int) (Project.projectWidth / divider); }
1
a3f67442a52181771165af3220c3e6b8
1560be6108c900f8a81efaf1e638fee7
设置货物类型。
public class FlightPriceDto implements Serializable public void setGoodsTypeCode(String goodsTypeCode) { this.goodsTypeCode = goodsTypeCode; }
1
344d8dd647b73d600a1a6ccac890d5c8
5847e40ca6e69118f1c171cfeb285b4f
Remove a stanza from being a known root stanza. A root stanza is one that appears as a direct child of the stream's root element. Stanzas that are not registered will not be converted into stanza objects, but may still be processed using handlers and matchers.
boolean removeSyncStanzaListener(StanzaListener stanzaListener);
0
ebf4f1e5b2a2901da2fb986732f86f39
6b13aa3091f9869c4e2f2315bab52a17
打开查询结果页面
{ if (query.Params.StartOpenTime == DateTime.MinValue) { query.Params.StartOpenTime = DateTime.Now.Date; } if (query.Params.EndOpenTime == DateTime.MinValue) { query.Params.EndOpenTime = DateTime.Now.AddDays(1).AddMillis...
1
8a0154eb3b5570aa7d6d329d9fe6e4eb
8479aa97686754a44b7f58e5b3c8d824
print the number 10
public class Sum10 public static void main(String[] args) { System.out.println(1+2+3+4+5+6+7+8+9+10); }
0
d92e4ca0797e16a73f0a19379f8322ed
1494911913f76a6c8569083c47bf6071
Free memory from a channel
int DestroyChannel(struct channel_d *channel) { if((void *) channel == NULL ) { return (int) 0; }; done: return (int) 0; }
0
6a29e7fb65501e1ca4febf7cc657482f
0655b8273792698a502ec8c18bd0df5f
Returns true if all the RMI server classes have been loaded.
public final class DaemonConfig implements Serializable public final boolean getRemoteClassLoading() { return remoteClassLoading; }
0
b0c695b0de8efdab35dde874959f576a
0c50df21b60ecf4881422dc3632a646f
判断是否是POST或GET请求
class MY_Input extends CI_Input public function is_get_post() { return ($this->is_get() || $this->is_post()); }
1
653d70d62ad18a71b1c0eb384a49775e
5c4992bf4129a746e9e250e6443e68a7
yaml.dump which respects order for dictionaries in the yaml object.
def ordered_dump(data, stream=None, **kwargs): class OrderedDumper(yaml.SafeDumper): pass def _dict_representer(dumper, data): return dumper.represent_mapping( yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, data.items()) OrderedDumper.add_representer(OrderedDict, _di...
1
c7ba36e78442dbef2adfc7b73e70e7a1
a68789610225c01e0608a1ab40852d9b
Print matrix showing amino acid co-occurence until wildcards
i=0 temp=[] for k in self.sequences: temp.append(k['start']) maxStart=max(temp) for seq in self.sequences: startPos=seq['start'] endpos=seq['start']+self.motifWidth print (str(i).rjust(3,'0')," ", seq['seq'][:startPos].rjust(maxStar...
0
dd6c729dfc0631ee5787217368bdd026
b2869962c1f3f87efe806d1279d899aa
Get all messages for specific agent
namespace RAMS.Data.Repositories public class NotificationRepository : RepositoryBase<Notification>, INotificationRepository public IEnumerable<Notification> GetManyByAgent(Agent agent) { return this.GetContext.Notifications.Include("Agent").Include("Client").Include("Admin").Where(n => n.AgentI...
1
356106e6416b80ebf898d93a0577dab3
1b0fe2c7409e4317da003c1241500f7e
最大含有2个相同
int former = -1000, tmp, count; for (int i = 0; i < nums.size(); i++) { if (nums[i] == former) continue; tmp = nums[i]; count = 0; for (int j = 0; j < nums.size(); j++) { if (nums[j] == tmp) { count++; if (2*coun...
0
67c57ada4b51697d7070464217c058c6
982e91b0ffb47b12a5cd7cd672ba515c
A loss function based on Jaccard Similarity index.
def keras_jaccard_distance_loss(y_true, y_pred, smooth=0.01): axes = (1,2,3) intersection = K.sum(y_true * y_pred, axis=axes) union = K.sum(y_true, axis=axes) + K.sum(y_pred, axis=axes) - intersection return 1-K.mean( (intersection + smooth) / (union + smooth), axis=0)
1
e937bc302bf8c69232d96dadaed00140
aefb3ce2ba3c57f2258ac8dcafdc3199
Increments the amount of sheets
void SwirlRects::update(){ inc++; }
0
48fca862f533b164ee966ad60d3d2b12
eb09f07d1e6aee4aaf6384de08c688f0
Informa quanto de dinheiro o cliente gastou.
public class BuscarMovimentacaoUseCase public BigDecimal totalGasto() { List<MovimentacaoEntityDomain> movimentacoes = movimentacaoGateway.buscarMovimentacao(); return movimentacoes.stream() .filter(movimentacao -> movimentacao.getValor().signum() < 0) .collect(Collectors.reducing(BigDecimal.ZERO, Movimenta...
1
ee08849ced2ae091258cdbe51b7e884b
c26f3bb5bf41b55147f8b3febd5c1199
修改出版社名字
name = request.session.get("nick_name") user = Users.objects.get(nick_name=name) id = request.POST.get('anthology_id') name = request.POST.get('name') if Anthology.objects.filter(Q(name=name) & Q(author=user)): return HttpResponse('0') else: anthology = Anthology.objects.get(id=i...
0
4226cf7ef3ba4056a7f4e5b5a7df115f
4bfb9577b377ae0558b83fb2c4c5ea54
just wait for a fixed amount of time
start = time.time() delta = ms/1000.0 while (time.time() - start) <= delta: pass
1
6d36b3f48b0925f804fd64ca70584143
aa04f8c42d0272749c037aed8b574e7c
Returns true if player is not stationary
namespace cs31 bool Game::playerStood() const { return( mPlayerStood ); }
0
36aa500488adf984a4a788c3bf924d12
182fdadedd1de377ee3c913ca3bbe036
Validate dsl2ssl Z axis transform
set_coords('basis_z', 'SSL') result = ssl2dsl('basis_z','basis_z_dsl2ssl', probe='a', eclipse_correction_level=1, use_spinphase_correction=True, isdsltossl=True, ignore_input_coord = True) self.assertEqual(result, 1)
1
c6d30707de128ab2d16ca696a8b72190
00337306952943ee030e20117e63cc9e
Constructs the general timeline model.
class ProjectsTimelineController extends ProjectsController public function __construct(Request $parent, $context = null) { parent::__construct($parent, $context); }
0
c4eab44d6d003d9b9b75167bb2315381
a42e5bff01724122c1ccb9b0adb71bcf
实体前缀拼接entityType和entityId生成实体的key
namespace Warship.Attribute.Validations public abstract class BaseAttributeValication<TEntity> : IAttributeValidation<TEntity> where TEntity : class protected string GetEntityAttributeKey() { Type entity = typeof(TEntity); return GetAttributeKey() + "_" + entity.FullName; }
0
dbe98080881e0adcb3b9f590dfb7de5d
eb61802274d0c464de51ef6e055332b8
Store policy distribution and paths in history.
class FeedForwardPolicy(Policy): def store_transition(self, obs0, context0, action, reward, obs1, context1, done, is_final_step, env_num=0, evaluate=False): self.mb_rewards[env_num].append(reward) self.mb_obs[env_num].append(obs0.reshape(1, -1)) self.mb_contexts[env_num]...
1
057dbbf70e33459667def5941d2db048
656ba0a27b8ae888e8a2c19fcefbd0d3
将自己发送的文件转发到最近聊天
class MsgPrivateChatAllTest(TestCase): def test_msg_weifenglian_1V1_0074(self): scp = SingleChatPage() file_type = ".txt" Preconditions.send_file_by_type(file_type) time.sleep(5) scp.wait_for_page_load() scp.click_back() single_name = "大佬1" Preconditions.e...
1
2c57ffe491520faea637f3469c620a25
94c6aa6bee4fab330a5f33d03637346f
Use url as a key to check if the user already exist in db. If exist, return true
class UrlFilterAndAdd(object): def check_url(self, url): sha1 = self.url_sha1(url) isExist = self.redis.sismember(self.key, sha1) return isExist
0
3209735fd1e0f015c278c7a92d690721
40337a539c5bd7b515eb11e04d166e6a
将合并单元格信息转为json
if (! isset($this->mergecells[$sn])) return ''; if (count($this->mergecells[$sn])==0) return ''; $ret=''; $i=0; $tmp=''; foreach($this->mergecells[$sn] as $val){ $tmp.=pack("v",$val['rows']); $tmp.=pack("v",$val['rowe']); $tmp.=pack("v",$val['cols']); $tmp.=pack("v",$val['cole']); if (++$i >=...
0
8e24d95aaefbf3dc9797e844987c113a
2ce192a90e9f249b265db142e7ba630d
Validates $category parameter and returns BiberLtd\Core\Bundles\GalleryBundle\Entity\GalleryCategory if found in database.
class UniteGalleryCategories extends UniteElementsBaseUG{ public function validateCatExist($catID){ $this->getCat($catID); }
0
6a572e7717c4c27dd400d43af46139c1
5cd2df2eefd9dd3903c373d65ac2daca
Return parcels macthing search criterions.
search_args = self.extract_search_criterions(self.request) if not self.has_enough_criterions(self.request): return [] cadastre = services.cadastre.new_session() query_result = cadastre.query_parcels(**search_args) cadastre.close() if self.request.get('browse_o...
1
5a639a933c64145bf1f1b6ea1e12c390
00279ab1a16af209aa8147d0d4d83ba0
Check if a date folder has been created
def valid_date_time_folder(path_to_folder): return re.search(REGEX, path_to_folder) is not None
0
3b30954aece7a638f945ab023f51ea6f
da50416cceb2e3d256f8d42bee57a7c3
Loads sidebar assets.
class Totaliser extends ComponentBase protected function loadAssets() { }
0