query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2c14882c759584839c69fd940818a126 | fd6ac489b5de89f3b826df1a3b0847f5 | IsFolderPathExists returns true if path exists and path is folder | func IsFolder(path string) bool{
_, err := os.Stat(path)
if err == nil {
return true
}
if os.IsNotExist(err) {
return false
}
return false
} | 0 |
95c03bcb1a920488cbee10181b36d9e6 | 08ad3bda6b0d28e9780297e6cc5e14b0 | Disabled services for console requests | class AuthServiceProvider extends ServiceProvider
public function boot()
{
if ($this->app->runningInConsole()) return;
$this->registerPolicies();
ResetPassword::createUrlUsing(function ($user, string $token) {
return 'https://example.com/reset-password?token=' . $token;
}... | 1 |
70b20fc9770ed5e9967d1c39b67ec128 | ec4d2e435874e98732168a4a27c7cf3b | Return the last file matching the pattern. | def ffind(*paths):
search = os.path.join(*paths)
logger.debug('Find files: %s', search)
file_list = glob.glob(search)
if file_list:
return file_list.pop()
else:
logger.error('No file matches %s', search) | 1 |
425a18eebfc35a17ba71044e10160fe8 | aed719d670ae4a84d42d50e8dd1e879a | 处理user_real_refuse表的数据到user_real_audit | return axios({
url: api.refuseAuditUrl,
method: 'post',
data: parameter
})
} | 0 |
8c0607f348527333f0ea85ffe3387762 | 35ce7b528e99d22aa91a41d1994a477e | 새로운 peer가 접속시 video 구역을 만들어준다. | var src = URL.createObjectURL(s);
if (s.getVideoTracks().length && s.getVideoTracks()[0].enabled) {
if (!vpad.is(':visible')){ appendPeerVideo(cid); }
rvideo++;
$(vid[rvideo-1]).attr('id', s.id);
$(vid[rvideo-1]).show();
arrangeVideo();
... | 1 |
7ced35a0317a547d5d6091a00e6f3714 | 3d04a2cebc56052bd7ec3681818ed88c | Test that players will not be added if name does not confine to restrictions | public void testPlayersAreNotAdded() {
final PlayerLobby CuT = new PlayerLobby();
CuT.addNewPlayer(new Player("One"));
assertFalse(CuT.addNewPlayer(new Player(" ")));
assertFalse(CuT.addNewPlayer(new Player(" a")));
assertFalse(CuT.addNewPlayer(new Player("One")));
} | 1 |
5f96522e713b32cf51eb8400fbd5a701 | d7f1e9654f9d4848b315dfc15c60efa8 | Initialisation des formulaires de dowloads | $this -> q_button_form = new D2D_quality_summary_form( $this -> indicator_set, $this, 'qual_agree' );
$this -> team_form = new D2D_team_form( $this -> indicator_set, $this, 'header' );
$this -> profile_form = new D2D_profile_form( $this -> indicator_set, $this, 'profile' );
$this -> data_form = new D2D_data... | 0 |
4c52192696db2997c445dbfe7fb083d4 | ef80280b72300d2c8e65b9e14bf58c0f | Set the number of ghost cells in x-direction.
Symmetric ghost cells are assumed. | public class GridType
extends AnalysisOption
implements Serializable,
Cloneable,
LineTypeConstantsIfc
public void setNumberXcells(int arg)
{
this.numberXcells = arg;
} | 0 |
29bc2e0ff7fd88fed7af042041489930 | b54d6c17803edbcbe260b1a6a7a59ee0 | Call registered handlers for MIDI message. | impl<M> SubtractiveSynth<M> where M: MidiDevice
fn handle_event(&mut self, event: MidiEvent) {
match event.payload {
MidiMessage::NoteOn(note, _) => {
self.voices.note_on(note).handle_event(event);
},
MidiMessage::NoteOff(note, _) => {
self.voi... | 1 |
f4ccb09420acc1a05d796925bb6d7c12 | 912dce98a7233164cb4462997ecf97e8 | Create an instance of {@link EnhancedAirBookRS.TravelItineraryReadRS.TravelItinerary.ItineraryInfo.ReservationItems.Item.Hotel.BasicPropertyInfo.CancelPenalty } | @XmlRegistry
public class ObjectFactory
public EnhancedAirBookRS.TravelItineraryReadRS.TravelItinerary.ItineraryInfo.ReservationItems.Item.Vehicle.VehVendorAvail.VehResCore.RentalRate.CustLoyalty createEnhancedAirBookRSTravelItineraryReadRSTravelItineraryItineraryInfoReservationItemsItemVehicleVehVendorAvailVehResCoreR... | 0 |
aa016e667cbd4b8610cef08c28349b8a | f99c9f5483068fe81a2d08449b16ce36 | Return message that will be logged if contraoller action fails due to an exception. | namespace DevelopmentSimplyPut.ExtensibleLoggerLibrary.Definitions
string GetLogMessage(Exception exception); | 1 |
e981fc716f626ee948aad82837075b67 | 2142e9ac4d05f326d5bb6cf0a25ddf3e | Returns the value stored in the storage of a contract script hash for a given key. | class NeoExplorerRPC(Explorer):
def getstorage(self, script_hash, hexkey):
return self.call('getstorage', [script_hash, hexkey]) | 1 |
773dcf4e2188111ea8774b8b0daa86b2 | 19e5bfe93507d1a9bccbe788ffb29247 | Calls a sequence of functions to add five engineered-feature columns to a dataframe.
Input dataframe must include the original columns from the 'weather.csv' dataset, or
at least a cleaned version with the same column titles, and with all numeric data. | def feature_engineering():
numeric_keys = ['MSSubClass', 'LotFrontage', 'LotArea', 'OverallQual',
'OverallCond', 'YearBuilt', 'YearRemodAdd', 'MasVnrArea',
'BsmtFinSF1', 'BsmtFinSF2', 'BsmtUnfSF', 'TotalBsmtSF',
'1stFlrSF', '2ndFlrSF', 'LowQualFinSF', 'GrL... | 0 |
5cb0ee49ba575cf337ada8d8de172caf | 8f77b89acaa77127df9bb66cf5143b68 | 抗菌用药数据保存 | {
String usedrugidtime = context.Request["usedrugidtime"];
String usedrugidname = context.Request["usedrugidname"];
String dosage = context.Request["dosage"];
String remark = context.Request["remark"];
String patientid = context.Request["patientid"];
... | 1 |
be4ec61ffd270a9fc0aa106461290658 | 01e6cac7ce04acca71ba603156716943 | Get a <see cref="FATabStripItem"/> at provided point.
If no item was found, returns null value. | namespace Aronium.Wpf.Toolkit.Controls
[TemplatePart(Name = "PART_DropDown", Type = typeof(ToggleButton))]
[TemplatePart(Name = "PART_ScrollLeft", Type = typeof(RepeatButton))]
[TemplatePart(Name = "PART_ScrollRight", Type = typeof(RepeatButton))]
[TemplatePart(Name = "PART_ScrollViewer", Type = typeof(... | 0 |
dcd4fd4a701ecc53a2ff159e9f802235 | 1c98e45048a68756f9e4d9434419f80c | Request that the user enter the angle and distance for a polar point... | namespace detectionSpace
void Detection::walk_polar(double dist, double theta)
{
speech::walk_polar walk_srv;
walk_srv.request.dist = dist;
walk_srv.request.theta = theta;
walk_general_cli.call(walk_srv);
} | 0 |
3e15ab0407356a45fffc4d04e3397874 | 5e94204663cc4698f5447734887effd8 | 根据用户ID为用户新增金币 | class UserModel extends DataModel
public function addGold($value){
return $this->redis()->evalsha($this->_evalsha, [$this->user_id, self::KEY_GOLD, $value], 2);
} | 1 |
333c090d47d49fa2feb27ddd1de15fc8 | a6910e0dcc019439428a6bd3e93da916 | check in a book from a customer, and add that book to inventory | public static void checkOutBook() {
} | 0 |
cf4488dcda74ab2154cf3d305b7a1e50 | b8904c218064d52dfa0536f523f756c9 | Can this output type be used? | public boolean canCreateOutput(Schema schema); | 1 |
b5f75b6a623ed0ace735ade6bafd1b89 | ba6d67a086bd71e517a6f7d17794d2b3 | 根据提交的表单, 设置对象的属性 | object.setStartX(Integer.valueOf(startX.getText()));
object.setStartY(Integer.valueOf(startY.getText()));
if (object instanceof Line) {
object.setEndX(Integer.valueOf(endX.getText()));
object.setEndY(Integer.valueOf(endY.getText()));
} else {
int rad = Integer.valueOf(radius.getText());
object.setRa... | 1 |
d9969c5ae5268a9a79598d2afd226501 | b1ab5be75a92cc9e1b593a181b043886 | This calls my trial division function on every # up to n | trial_factor = 2
root = sqrt(n)
while trial_factor <= root:
if n % trial_factor == 0:
return False
return True | 0 |
3127021c31d0a556e813a8c96c2f6aa2 | 2250a6ee7ee76458d9913c09f85c50c6 | Externel INT1 Interrupt Service Routine | void EINT1_IRQHandler(void){
LPC_SC->EXTINT = EINT1;
} | 1 |
08a8307e44cece872757f3c410fae80c | 3c60b91946ee310f7b0910de0e3be3cb | Met à jour le vecteur de direction du Robot | {
double Xn = 0;
double Yn = 0;
double Xp = 0;
double Yp = 0;
double Vx = 0;
double Vy = 0;
Vx = this->Vx;
Vy = this->Vy;
Xp = this->Px;
Yp = this->Py;
Xn = Xp + Vx;
Yn = Yp + Vy;
if(Xn > MAX_X){
Xp = 0;
Xn = MIN_X + math.euclideanDistance(Xn, 0, MAX_X, 0);
}
else if(Xn < MIN_X){
Xp = 36... | 1 |
f719312d848abe9f87b199834bf0d7ee | b6d39618071db031f8049fe4982d74be | Map sequence of sequence (document) of tokens to number token | story = []
for value in sequence:
story.append(word2idx[value] if value in word2idx else UNK_token)
story = torch.Tensor(story)
return story | 1 |
fed393ea15a4880d67776d793246fe2b | 3607010939608d28a232de7a45a3219b | Every base object must check itself to verify the string data represents a valid value
for the data type. | class IsSomeType(object):
def __init__(self, strToverify):
self.__strToverify = strToverify | 0 |
d03e639b6c5dd6bbd95d8f2954689258 | 275dd5345fb6ccf69e63d4819e562ae7 | Set the currently edited dataset’s title and the `datasetChanged` flag. | abstract class DataSet extends Component
final protected function setTitle($title) {
$this->setProperty('title', $title);
} | 0 |
49ed85f91dcf3824b4be83b1c6cd843c | b5c6a3b9df7e82b0b389cfc50bf3949d | @brief Parses ticker data headers from EOData | std::string hline = "", app = "";
hline = getLine();
while(hline.size() > 0) {
app = hline;
while(app[app.size()-1] == ',') {
app = getLine();
hline += app;
}
addHeader(hline);
hline = getLine();
}
} | 1 |
f9ad3c44d487441a94c8deae7c764971 | 75c96c42a97b4617d415b4a8854c71e7 | Clean up and shut down the worker after a preemption event. | impl Drop for ExecutionStatePrefetcher
fn drop(&mut self) {
self.stop();
for worker in &self.workers {
unsafe {
worker.stop();
}
}
if let Some(key) = &*self.task_sender.lock().current_task() {
self.cancel_task(key);
}
fo... | 1 |
60b41ace02c12fb1d54ecc886353aebd | 7007aad046f32c07a920a036431ea2a1 | make MBCS from Unicode string | HRESULT ConvertToMBCS(WCHAR* pwsz, CHAR* psz, ULONG cbStrLen)
{
INT iResult = WideCharToMultiByte(CP_ACP, 0, pwsz, -1, psz, cbStrLen, NULL, NULL);
return iResult ? S_OK : E_FAIL;
} | 1 |
ac369b85ce1a328d65449cb085445813 | dc056ea58c493f769d1a2b8425f7f4f0 | Generates a Google Auth URL for the specified user | class GoogleAuthenticationService
public function generateAuthUrl ( User $user ) : array {
$client = $this->createUnauthorizedClient();
$stateToken = new GoogleAuthStateToken();
$stateToken->setToken( $this->guidGenerator->generateGUID() );
$stateToken->setUser( $user );
$this->documentManager->persist( $stat... | 1 |
5262e75d2271fd7c4e5e1f9eba5ce120 | bbfd9aa717576b237809e95631de097b | Removes all cameras from the scene. | {
for ( int i = 0; i < cameraList.Count; i++ )
{
targetRenderSystem.NotifyCameraRemoved( cameraList[ i ] );
}
cameraList.Clear();
} | 1 |
a93efea345054b62f72280b3904a9968 | 170728b843f6ade99add3ea9012c1d74 | 播放语音 兼容低版本语音播放 | export default class VoiceManager extends FileManager{
__playVoice({ filePath, success, fail, refreshDuration}) {
if (this.isLatestVersion) {
this.innerAudioContext.src = filePath;
this.innerAudioContext.startTime = 0;
this.innerAudioContext.play();
this.innerAudi... | 1 |
91004c7f1bb9d8c35d2d48a36ada07f4 | a923310ef17ec04e59feef6e68f26057 | Called to read integers. Subclasses may override to use a different
integer representation. By default, this calls {@link
Decoder#readInt()}. | public BigInteger read(ValueReader reader) throws IOException {
return reader.readVarInt();
} | 0 |
80197955ec20148e7d194eb7e73bfbdd | afffc4de9ed22ee41489dc4f0ae35137 | Sets y-velocity to a constant, and randomly generates an x-velocity for game start. | {
super.update(canvas);
double randAngle = Math.toRadians(canvas.nextIntInRange(0, 360));
myVelocity.x = (int)(3 * Math.cos(randAngle));
myVelocity.y = (int)(3 * Math.sin(randAngle));
} | 0 |
370e9f26f744e82731f2af3eafa5ed68 | aeed30d8f523b44d7a5b0767d99b303b | Depth to Space operator in python for NCHW layout. | return depthwise_conv2d_nhwc_dsp_compute(
cfg, data, kernel, strides, padding, dilation, out_dtype
) | 0 |
4f5117905e14651f96dd716495634339 | 36337ce1a1c3355aabee4f082861067e | gets your pending sent and received contacts | {
GetFriends(result =>
{
GetPendingReceived(result2 =>
{
GetPendingSent(result3 =>
{
onComplete(result && result2 && result3);
});
});
});
} | 1 |
4841ab0abdd100b4c4b30fb46f6389c9 | 7bf6dddc46f187e2ce45471b75c45208 | Creates spawn appearance handler. | namespace fan
void SpawnManager::OnSpawn( const sf::Uint32 _spawnID, const FrameIndex _frameIndex, sf::Packet _data )
{
spawns.push_back( { _spawnID, _frameIndex, _data } );
} | 0 |
dcb092f92ae58ebaa53c0ec32c743da4 | 177fc71cf71ddc01ee933a56db58bb91 | 梯度下降法求多项式函数的系数矩阵(向量) | vector<double> solution_coef_c(vector<vector<double>> matrix){
int n = matrix[0].size();
vector<double> coef_c(n);
double y;
int n1 = n - 1;
vector<double> alpha(n);
vector<double> beta(n);
y = matrix[1][0];
if (n == 1){
coef_c.resize(1);
coef_c[0] = matrix[1][0]/matrix[0... | 0 |
d5157b94aa895017f2c24caf0053af6d | e76f3e816b2b278a453ca3e20a785843 | 获取地图中选中要素的数量 | public class MapGreatJCheckBox
public int size() {
return map.size();
} | 0 |
827321091d95e63df844379635d4e732 | de94776e339895e048c71caef2acd8bb | Encodes data from a given file into frames of given size. | def encode(frames):
vectors = []
remains = [frames[0]]
for i, f in enumerate(frames):
if i + 1 < len(frames):
current_frame = f
next_frame = frames[i + 1]
mv = find_motion_vectors(current_frame, next_frame)
vectors.append(mv)
c_tiles = spli... | 0 |
ab6296ec7d1218ab9eee6c3841d7ef2b | 606c692815e7ac8579b16e158c757504 | Free output data of current operand | class OperandActor(BaseOperandActor):
def free_data(self, state=OperandState.FREED, check=True):
if check:
can_be_freed, deterministic = self.check_can_be_freed(state)
if not deterministic:
self.ref().free_data(state, _delay=1, _tell=True)
return
... | 1 |
b086b69f10de5e1d6e5978c9c429efb0 | a830e46d0e0880f3b1c9324b6002bc57 | 检查警号 | console.log(v.value);
if (v.value === '1') {
this.check = 3;
} else if (v.value === '2') {
this.check = 11;
} else if (v.value === '3') {
this.check = 5;
} else if (v.value === '4') {
this.check = 6;
} else if (v.value === '5') {
this.check = 7;
} else if (v.val... | 0 |
ea7a294bb54f7c29d3093c907f578167 | 74a25bef3c717fe31da50d4b801b6337 | 택시의 현위치로 부터 가장 가까운 거리에 있는 손님 찾기 | queue = deque([(tx, ty, 0)])
visited = [[False] * N for _ in range(N)]
visited[tx][ty] = True
heap = []
while queue:
x, y, count = queue.popleft()
if customer[x][y] != -1:
heapq.heappush(heap, (count, x, y, customer[x][y]))
continue
for i in range(4):
... | 1 |
1062f7d3b9c4ab40c5a4b92032bf536a | f7fbf20120e16486fe530c721cfaf4ad | Return a finite state machine which will accept any string NOT
accepted by self, and will not accept any string accepted by self.
This is achieved very easily by flipping the "is final" property
of each state. | class fsm:
def reduce(self):
return reversed(reversed(self)) | 0 |
5890c17be73f24745e07203405912e15 | 6c931bf56b707d4964b0c72dc20e60bc | 渲染联系人,可以传递正则表达式过滤名称 | var newData = mutableListOf<ContactPerson>()
if (contactPersonList != null && contactPersonList!!.size > 0){
if ("" == filterStr) {
newData = contactPersonList!!
} else {
for (person in contactPersonList!!) {
val name = person.n... | 0 |
bfeffbc246d84bf045b4d5bbfc50f42b | 550b50533ae2f80e5d1b944687cff507 | 执行单个Jupyter Notebook文件检测的主入口 | this_dir = os.path.dirname(os.path.abspath(__file__))
if (sys.version_info >= (3, 0)):
run_ipynb(os.path.join(this_dir,
'../ch16/ch16.ipynb')) | 1 |
e1b2bc8daf97a59c7a028f9704227e25 | 4c5625229bea75f075bbb5f85b18f33a | do nothing, as all (quantized) conv node is already registered to self._connected_convs | void NoZigZagConnectorProcessor::registerVertex(const curaIrfan::PointIrfan&)
{
} | 1 |
3a0775ebbfc98b5dcc548743e72c07b0 | 87359c299395a51c570658397664a3b2 | Gets the addToCalendarAction
Optional field to control the assignment behavior for adding assignments to students' and teachers' calendars when the assignment is published. The possible values are: none, studentsAndPublisher, studentsAndTeamOwners, unknownFutureValue, and studentsOnly. Note that you must use the Prefe... | class Put_Committee_Classification_RequestType extends AbstractStructBase
public function setAdd_Only($add_Only = null)
{
if (!is_null($add_Only) && !is_bool($add_Only)) {
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($add_Only, true)... | 0 |
8e246db60bd998a8fc4737e983ca52ca | abd22cc2e9c00e4baf8c8e7479ded1f0 | Read the specified number of characters from the buffer, starting
at the cursor. | class TermBox
protected function readUpTo($n)
{
$s = fread($this->tty_fd, $n);
$this->input_buffer->append($s);
return strlen($s);
} | 0 |
3bfef925658b0379ea2c0a428355fe1e | eb3e5f7269721319e96ac2ea2b99e20c | キューに、ある点の周りの行ったことのない道を追加し、シートに距離を記入 | {
if(days < 0) return;
if(pos.X < 0) return;
if(pos.Y < 0) return;
Vector2 fpos = transform.game_pos2_map_pos(transform.ToVector2(pos), m_lib.loop_image);
if(m_is_1st){
add_sea_routes();
m_old_days = days;
m_old_pos = pos;
if(days > 0){
add_popup(new SeaRoutePopupPoint(fpos, ... | 0 |
9658070e72952dd21f0ccf692b907172 | c76928dc85164f58f14a6f80ffae0bbb | 自分のアカウントID・名前・アイコンURLを取得 | function GetProfile($bot,$event)
{
unset($UserID);
$UserID=$event->getUserId();
unset($response);
$response = $bot->getProfile($UserID);
if ($response->isSucceeded())
{
$profile = $response->getJSONDecodedBody();
$displayName = $profile['displayName'];
error_log("表示名:".$displayName);
$userId = $profile['... | 1 |
5b72638dae9775a925b26af01920889e | 56c1d93511c52360326f3e1a4c6141bf | Returns a DataLoader object that has been applied a transform
that crops the image and nomalizes it
Input:
path: path to the image set
mean: list with normalization means
std: list with normalization standard deviations
batch_size: size of the batch | def dataloader(data_path="resized_celebA/",img_size=64,batch_size=64,num_workers=2):
dataset = dset.ImageFolder(root=data_path,
transform=transforms.Compose([
transforms.Resize(img_size),
transforms.Cent... | 1 |
28916a884b1e07075810d0c8a5dac76a | 4c203ef74d36223325845033031ecba2 | 是否为非负整数 | {
if (string.IsNullOrEmpty(input))
return false;
else
return Is(input, positiveInteger);
} | 0 |
9f603d64684ffed7d00529fca1f41ff4 | a9c744a6fb7711b8436bb455a7c6477b | Correctly centers the window within its owner. | {
HWND hwndOwner;
RECT rc, rcOwner,rcDlg;
if ((hwndOwner = GetParent(hwndDlg)) == NULL) {
hwndOwner = GetDesktopWindow();
}
GetWindowRect(hwndOwner, &rcOwner);
GetWindowRect(hwndDlg, &rcDlg);
CopyRect(&rc, &rcOwner);
OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top);
OffsetRect(&rc... | 1 |
9ee7ae210165550d5120209a0f366f4d | 48e79e6e1c0e82d03db5e45ab1cd3f9d | Uses coordinates to add missing zipcodes. | class FillAddress:
def _fill_missing_zipcode(self, row):
city_name = row[self.city_column_name]
zipcode = str(row[self.zipcode_column_name])
row[self.zipcode_column_name] = None
if not isna(zipcode) and re.search('[^0-9]+', str(zipcode)):
zipcode = re.sub('[^0-9]', '', str(... | 0 |
d35fe9c7251dccc071f6928d07a29d47 | 5a3ce6a2419da8e46d780fd7a5f1098d | 后台执行任务(多用于长时间处理的任务)
成功返回job_handle | {
GearmanWorkerManager::_log("herele");
$func_name = $job->functionName();
GearmanWorkerManager::_log("herele" . $func_name);
if (!array_key_exists($func_name, self::$_route_tables)) {
self::_log('function not exists ' . $func_name . ' in list: ' . var_export(array_keys(s... | 0 |
abded868466d1087bbc34703a535d1dc | 4019b0ac9f7d6e22865580c70e8b4cde | Gets query for [[Pai]]. | class Indicador extends \yii\db\ActiveRecord
public function getPind()
{
return $this->hasOne(PatronIndicador::className(), ['pind_id' => 'pind_id']);
} | 0 |
3781f2738904a53fb801c11598d93950 | 6d5f38617b4c1dfc6c078c498e1c1e90 | ICNet specific initial block. | def initial_Conv_block(input, weight_decay=5e-4):
channel_axis = 1 if K.image_data_format() == 'channels_first' else -1
x = Conv2D(16, (3, 3), padding='same', use_bias=False, kernel_initializer='he_normal',
kernel_regularizer=l2(weight_decay))(input)
x = BatchNormalization(axis=channel_axis)(... | 1 |
a8d2e9a1737c18032d17da9f989a662b | ba2d66bf9bf40c290266ec8895bc7b2b | 执行insert、update操作 列如:$this->autoExcute('user',array('name'=>'lisi','age'=>'18'),'insert',)
自动生成:insert into user (name,age) value('lisi','18') | function mExec($table, $data, $act='insert', $where='0')
{
if ($act == 'insert') {
$sql = 'INSERT INTO ' . $table . '(';
$sql .= implode(',', array_keys($data)) . ") VALUES ('";
$sql .= implode("','", array_values($data)) . "')";
} else if ($act == 'update') {
$sql = 'UPDATE ' . ... | 1 |
25d18886e00379ad6938a2de78b2a857 | cdc5e30527a368e52c06bf5a01d051ea | Helper function to set site value to a sample from a normal distribution with variance according to
xavier/kaiming/radford neural network weight initialization methods. | def xavier_weight_init():
def _xavier_initializer(shape, **kwargs):
epsilon = np.sqrt(6) / np.sqrt(sum(shape))
out = tf.random_uniform(shape, minval=-epsilon, maxval=epsilon,
seed=1337)
return out | 0 |
09c12fb002af16d64010711dc852c889 | 4d5e454d6625c11c7952a0e26d8e1b72 | Reduce the color palette of an image to 256 to conserve disk space. | arr = np.array(img, dtype=float)
arr = (arr - arr.min()) * (255 / arr[:, :50].min())
arr[arr > 255] = 255
arr[arr < 0] = 0
return Image.fromarray(arr.astype('uint8'), 'L') | 0 |
57baf072feca7a5b1f0cc379285c1db3 | c9dafd31805c6ee3a59936acb6f5382c | 获取用户所有输出 | {
$sql = "select `out`.* from `out` join out_member on (out.out_id = out_member.out_id) where out_member.user_id = :user_id order by create_time desc limit :limit offset :offset; ";
return Out::model()->findAllBySql($sql, array(':user_id'=>$user_id, ':limit'=>$limit, ':offset'=>$offset));
} | 1 |
6d8f6d989db8432f5d95ea0cb479cc31 | ef17fcaee153814dff62ffa70b3919a6 | 功能:
停止指定的私服程序
返回:
true : 表示成功;
false : 表示失败; | namespace SRSApis.SRSManager.Apis
public static class GlobalSrsApis
public static bool StopSrs(SrsManager sm, out ResponseStruct rs)
{
return sm.Stop(out rs);
} | 1 |
e518544e5b34d4f3e5edaa4733e46858 | f7d78def11c6f345180e2e4891531f4b | Se utiliza para redirigir al usuario a la vista de inicio de sesión al acceder al localhost. | namespace ProgramacionWebU4Seguridad.Controllers
public class HomeController : Controller
[AllowAnonymous]
public IActionResult IniciarSesion()
{
return View();
} | 1 |
359c6cd7f2b11e7163cb698308335358 | 63d7044185ace71a946d7e0899763773 | Get Specification class name. | public function getSpecificationClassName(): string; | 1 |
59309e83d1dd65b0568ed8f2030c3b3e | d911c856d2ae521d3ee0e9925f26a67d | Finds all Questions by publicationtId | time_start = time.time()
return_data = QuestionServices.getAllQuestions(postId)
time_end = time.time()
monitor(time_start, time_end, path, "get")
return return_data["data"], return_data["status"], {'message': return_data["message"]} | 1 |
d98ba20e342bf9fe11d664d60eee3d5b | 5a34315b52f93dbbd58ec74d8c1f11e9 | Icon used when a column is sorted in descending order. | @Source("images/sortDescending.png")
@ImageOptions(flipRtl = true)
ImageResource dataGridSortDescending(); | 1 |
c482d35d52492472824ec7f6bf37eeba | abb1d238df3c1479ebefc6fab4207d95 | **Delete a monitored media server from this organization**
https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-monitored-media-server
- organizationId (string): (required)
- monitoredMediaServerId (string): (required) | {
ApiResponse<string> response = await DeleteIosAsyncWithHttpInfo(orgid, projectid, credentialid);
return response.Data;
} | 0 |
e43ecc729a4c480d282e0ed31be40327 | 16284d171bd5a375ba8c59c3e6cfa034 | Change visibility of menu item delete by checking number of checked
elements | class EditableList(QtWidgets.QWidget):
def _toggle_delete_button(self):
self._delete_btn.setEnabled(len(self._list.selectedItems()) > 0) | 0 |
315c82519ee69805ca31e26c15b42bac | cd06b12fff7497a9193b8d1fc7585765 | 根据用户的id 和手机号查看用户是否存在 | User queryUserInfo(@Param("phone") String phone,@Param("userId") String userId); | 1 |
2d18c9025db2b3600a2c3a70dc0ba8be | 41f12145de86481b7ed09cd502a652e3 | 先月の日数を返すメソッド | $currDate = $this->dateTime->format('Y-m-01');
$prevDate = new DateTime(date("Y-m-d", strtotime($currDate." -1 months")));
return (int) cal_days_in_month(CAL_GREGORIAN, $prevDate->format('n'), $prevDate->format('Y'));
} | 1 |
e7615c3760b760a472161c3315aa3d44 | a1bae78d32842ae5008d299f43ebab84 | Refreshes the brewerfavorites | data = self._fb.get(self.PREFIX + ('beers',))
if data:
return data
return {} | 0 |
681e0a835183e21b8129a5a2f0b9ba1f | e19ce80047f20f8f0030aaae0c5d5282 | Previous page {@link URI} getter.
(i.e the actual page is the first one). | public final class PageInfo<X>
public Long getPrevPage() {
if (this.hasPrev())
return page - 1;
return page;
} | 0 |
81e20878a0476900af69a51d1c0cb60d | 87a35ec63830989ddd8839f0a37f9ee0 | メッセージランキング | function ranking(){
$query_rank = "select user,point from point_word order by point desc limit 5";
$fetcher = mysql_query($query_rank);
$tweetstr = "現時点の上位5位\n";
for($k=1;$k<=5;$k++){
echo $tweetstr;
$row=mysql_fetch_assoc($fetcher);
$tweet... | 1 |
9ba723e19ec4ed5bdb577dbaf43373ed | 3be83debfe31848c5a241200866ff443 | 删除数据表TMP_DZ_1101_ZC_121011中的一条记录 | public int delete_aihaoiptmp12(int _id) throws Exception; | 0 |
bf1ad9f716cb06810948a2e93e575043 | 46bfe39a097469c7ff3bebd38e78040a | Returns validators for HUMAN_TIME field. | {
return [
'display' => 'H:i',
'return' => 'U',
];
} | 0 |
68e0e107a94f86b4989f430f4b91fcbe | 018a6d903143e69122d14975eda629dd | Skipping, since predicates are not supported with portable and JSON values | public class SwitchPredicateExtractor extends PerfQueryBaseVisitor<HashSet<Integer>>
@Override public HashSet<Integer> visitFalsePred (PerfQueryParser.FalsePredContext ctx) {
return new HashSet<Integer>();
} | 0 |
45dd03a9312ccc1f1454207429be5ac7 | ae6651449bd587036c552c77a17ec7a9 | 显示下一用户 | function forwards() {
if (pointer >= selectedIds.length - 1) {
showMessageBoxCenter("danger", "center", "当前记录是最后一条");
return;
} else {
var user = getUserByIdInUsers(selectedIds[++pointer]);
vdm.user = user;
}
} | 1 |
d96b8869b1c5cdb7df4e7778970e593d | 38804b396e06e7a6c09a64949139e067 | test division (f/g) for both value and derivative | double f(double x) { return x*x; }
double d1(double x) { return 2.0*x; }
double d2(double x) { return 2.0; }
double e1, e2;
int res = compare_derivatives(f, d1, d2, 1.0, 0.0001, &e1, &e2);
printf("e1= %.15f e2= %.15f\n",e1,e2);
} | 0 |
37edcfe724dbc7fbfb525f96d5162ead | 6bce93ce7aa08c6e93d40b3868b68dc4 | bencodes the given object, returning a byte array
containing the bencoded data.
Allowed object types are:
- list (list)
- dictionary (dict)
- integer (int)
- string (str)
- byte array (bytes)
Note that all strings will be converted to byte arrays during the
encoding process.
@rtype: bytes | def bencode(thing):
if isinstance(thing, int):
return _bytes("i%se" % thing)
elif isinstance(thing, str):
return _bytes(str(len(_bytes(thing))) + ":" + thing)
elif isinstance(thing, bytes):
return _bytes(str(len(thing)) + ":") + thing
elif isinstance(thing, bytearray):
... | 1 |
f3adcab78276a690528c1380e28aec5b | 50d44190c96a81e500fa6e0739203feb | 配送開始日を取得するメソッド | public class ShipmentInfoFormDTO extends PaymentInfoFormDTO
public String getDeliveryStartDateStr()
{
return (deliveryStartDate == null) ? "" : SIMPLE_DATE_FORMAT_THREAD_LOCAL.get().format(deliveryStartDate);
} | 1 |
ce41c92f95ef0b9b448cb24583fc8c39 | 6d4de908be52491f9a960d042641f59d | Delete an account by its <see cref="IAccount.Name" />. | namespace Utopia.Shared.Interfaces
void Delete(string name); | 1 |
1746bdd18552fea71b45916abebaa582 | 34e006ab6b891a63b94515df69bb9ee0 | 销毁信号量 | struct sembuf s = {0, -1, 0 };
return (semop(semid, &s, 1));
} | 0 |
2e656faf6f2b40c4c42d400fdf98774e | 5b6ded721be643a662f40c4d4079d76b | 初始化星级属性数据 | self.nStarLevel = nStarLevel
self.tbCsvBase = g_DataMgr:getCardBaseCsv(self.nCsvID, self.nStarLevel)
self:initProfessParams()
self:reCalculateBaseProps()
end | 1 |
f99aca1411ab59e95d856521d9bf8f3c | e0564743d5de96471e7806bc73944fe9 | 两段二分 | func guessNumber2(n int) int {
low, high := 1, n
for low <= high {
mid1 := low + (high-low)/2
val1 := guess(mid1)
mid2 := high - (high-low)/2
val2 := guess(mid2)
if val1 == 0 {
return mid1
} else if val2 == 0 {
return mid2
} else if val1 < 0 {
high = mid1 - 1
} else if val2 > 0 {
low = mid... | 1 |
a29c1d5543c7c9a367dccb05f2fd14fe | 16a12a8b9317a195a2fa283f953022c8 | Marks model object as editted. Returns edit session on success or
raises exception. obj should be either model object or its global
identifier. When force is True the current lock is ignored. | data = [self.session_id, obj.module, obj.fields]
result = self._request('set_entry', data)
obj.id = result['id']
return obj | 0 |
f2f2bb81ad0792d703df1e4984d56de1 | 71d727921f6d68f0f09cd1413b1fd00d | Эти переменные типизированы неявно. Они отнесены к типу double, поскольку их
выражения сами относятся к типу double. | namespace variables_lesson5
class Program
static void Main(string[] args)
{
double myDouble = 13.37;
int myInt;
myInt = (int)myDouble;
Console.WriteLine(myInt);
int num = 12390532;
long bigNum = num;
float myFloat = 13.37f;
... | 0 |
a63c9dcb51ed69f229757635f77d6bba | 83816e6ab5b534eedd23202c45c8c4a6 | Retorna o valor de imposto de renda à ser pago; | public abstract double getValorImposto(); | 1 |
9e6d994e1845a1b4843e539967e89b0e | 9f7da9dc8eed54d8284d049c314d362f | Don't open if already open or being opened | local function Remove(self, atOnce)
if type(self) ~= "table" then return; end
if ( self.status ~= "OPENING" and self.status ~= "RUNNING" ) and ( not atOnce ) then return; end
if ( atOnce ) then
self.status = "STANDBY";
self:Hide();
else
self.status = "CLOSING";
self.timer =... | 0 |
e3c3fbc0b329b496af5202d304f829f4 | fcdaaeee7b0c8ba3241210ee793a4872 | Gets the maximum message number of messages that can be sent in a burst. | impl Control
pub fn debug_max_burst_size(self) -> u8 {
self.0.get_bits(16..=23).try_into().unwrap()
} | 1 |
ca876d04e81437a430bdc209dbf1193f | b00f0450fa456f2ab037d19f9560bf83 | Set display foreground color to green | IoObject *IoCurses_setForegroundYellow(IoCurses *self, IoObject *locals, IoMessage *m)
{
DATA(self)->fgColor = COLOR_YELLOW;
IoCurses_colorSet(self);
return self;
} | 0 |
51631c6abe85d5efa952a777e5bec486 | f69a8a9e32b2daec61198b62bfd9a684 | Função para limpar a tela da TreeView antes de mostrar os dados | class Builder:
def clear_treeview(self, name):
tree = self.builder.get_object(name)
tree.delete(*tree.get_children()) | 1 |
581625ee49559af8166b1d6f94f3f132 | e8a4de3a1857338753178096d392226a | Asynchronously download metadata identified by a key. The key is unique
within the snapshot. Usually the key will be of the format PARTITIO_ID-key.
When the data is not found in the snapshot, throws <see cref="NoDataException"/>. | {
if (serverId == null)
throw new ArgumentNullException("serverId");
if (key == null)
throw new ArgumentNullException("key");
if (string.IsNullOrEmpty(serverId))
throw new ArgumentException("serverId cannot be empty");
... | 0 |
5aa459f1b16243c34e1601e335a40f8b | 1149f10c55672cdc02917ad4e994faa3 | Get accessor for persistent attribute: state900 | public class DetailEOImpl extends OAEntityImpl
public String getExtAttribute9() {
return (String)getAttributeInternal(EXTATTRIBUTE9);
} | 0 |
656337d8898d13572ed4c3adbd1b1e79 | 34c11da6a388957130e812bba28f6bf5 | plus 开通激活短信通知 | public class SMSManager
public String sendReminderActiveSMS(int sendFlag,String mobile, String customerid, String validity) throws EduException{
VelocityContext context = new VelocityContext();
context.put("validity", validity);
context.put("customerid",customerid);
StringWriter writer = new StringWriter();
S... | 1 |
0cc20a0296473b9132795e193454f65a | 023e5a81560291dbe81bc50bdf66c353 | ! This function set the Transmitter Pulse Length in the IR communication module.
transmitter pulse length modes:
(value set the number of clock cycles the pulse last)
(pulse length is equal to baud rate) | void HunterFan::setPulseLength(int nPulseLength)
{
this->protocol.pulseLength = nPulseLength;
} | 1 |
84e94e13c910f9f8362ff78729b34ac5 | 31cd186789e2dc7a8460a58770fc8091 | Returns the kernel name according to utsname.h | const char*
sal_os_name(void)
{
return "Linux Kernel";
} | 0 |
218a0a8fb7abe8426d03bbfd5aa784b2 | f2ab9a34b4e309bb2f67f7db5c9b4d41 | Reponse is created as per RFC 3261 subclause 8.2.6 and (headers+tags) are copied
as per subclause 8.2.6.2. | void
make_response(value, repid, machp)
u_int value;
u_int repid;
papMachine_t *machp;
{
mblk_t *rp;
struct ppp_hdr *hp;
char *req;
rp = machp -> result =
ppp_alloc_frame(pppAuthPAP, value, repid);
if (rp == NULL) {
return;
}
hp = (struct ppp_hdr *) rp -> b_rptr;
req = (char *) rp -> b_wptr;
*req++ = ... | 0 |
fd8a17908c94be1274416b3523559284 | c026307bb8e501dbfb810c3e28ec3294 | Chunkの作成 | public class GameStart : MonoBehaviour
void Start () {
makeChunk ();
} | 1 |
564e66a9507185eb08cb0ea4c5eb0861 | 588540d6ad053886fb40166aa2245ead | Gets the package converter. | abstract class StandardImporter implements Importer
public function getConverter(): Converter
{
return $this->pipeline->getOperation(self::CONVERTER_KEY);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.