query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
8d5777ff31c5fd2d8d7617602b954660 | a8972330f56a12908b5599ed94f6356b | function to set the fill color to white | {
SDL_SetRenderDrawColor( gRenderer, C.red , C.blue, C.green, 0xFF );
SDL_RenderFillRect( gRenderer, fillRect );
} | 0 |
a6ec0f6f42b10994263a08a23e9cc257 | 6f783f2dc5951159004626126311fe9c | Validate a Gregorian date | class EGN
public boolean correctDate(int y, int m, int d)
{
if (m < 1 || m > 12)
return false;
if (d < 1 || d > 31)
return false;
if ((m == 2 || m == 4 || m == 6 || m == 9 || m == 11) && d == 31)
return false;
if (m == 2 && d == 30)
return false;
if (m == 2 && d == 29 && !leapYear(y))
return f... | 1 |
69c5cec8febf1f99945b6ff40585d357 | 760ee546b54ba6024d422fa3ea0052ce | 展示所有的相册图片 | class Album extends CI_Controller
public function showAllAlbum(){
$post = $this->Album_Model->getAlbum();
$userInfo = array('userInfo'=>$_SESSION);
$this->load->view("common/header",$userInfo);
$this->load->view("photo/album", array('post'=>$post));
} | 1 |
ea4a012a9fff4dca2400560d7aa8845f | ec4faaf3440521464bf24a4a2b0042c3 | 2.操作 修改表portal_user_account,将字段money_amount的值与续费金额累加在一起; | old = (
session.query(AccountModel)
.filter(AccountModel.mobile == account.mobile)
.first()
)
old.surplus = old.surplus + account.surplus
session.commit() | 0 |
63f48b7ef332a8338387ab95c82459a2 | e822de93b737a45837235a52b35f7d60 | 编辑视频信息功能 包括价格 | class VideoService extends Common{
public function videoEdit($data)
{
if ($data['pid'] == 0) {
$this->setError('请选择父类');
return false;
}
if(!isset($data['status'])) $data['status'] = 0;
if(!isset($data['recommend'])) $data['recommend'] = 0;
if (isset($... | 0 |
05a5942c460b6e5e61a44bf055ec4773 | 85620b96eb67506c6725469b0c72be9b | Modification des valeurs des paramètres matériaux.
Entrée : | {
switch (dNom)
{
case 2:
diameterOut = 4.2;
height = 1.6;
keyParam = 4.0;
break;
case 2.5:
diameterOut = 5.3;
height = 2.0;
... | 0 |
2bb32bd3efc9da9931552d96d4e2cc55 | 0afe444011bbf42cc0c191e908b62a33 | Gets absolute time reference point for relative timestamping.
If is zero, then relative timestamping is disabled. | public class SystemTimeOffsetMessage extends TypeSvMessage
public AbsoluteDate getReferenceEpoch() {
return referenceEpoch;
} | 1 |
8ebc027f92c44995814aadc29d84752e | cfad416613e648336dc75e8b5d3d5583 | Getter for <code>NBC_FLUP_PET.COMMENTARY</code>. | public class Fil080knParamModel extends Fil080ParamModel
public String getFil080knUpCmt() {
return fil080knUpCmt__;
} | 0 |
6253b2ad538b74c9149b7c490b660076 | a0a5a689c63ecf44e7357516e93067a7 | function to count number of set bits | int countSetBits(int n)
{
int c=0;
while(n>0)
{
c++;
n=n-(n&(~n+1));
}
return c;
} | 1 |
470f03d2a949a7edfb4b361abbbb9bad | 8dc02fe47f4ef14f39ce792c8cc558cc | Create operator form of dg/dx for distributed responses | class RWGDominantSystem(System):
def assemble_operator(self, parameters, space_group='default'):
operator = super(RWGDominantSystem, self).assemble_operator(parameters, space_group)
return operator.weak_form() | 0 |
1ab3b259422c911489fa031571eb9279 | 646522890c19f7719644410b80009cac | Get indicationColor. | class EnvironmentIndicator extends ConfigEntityBase implements ConfigEntityInterface
public function getBgColor() {
return $this->get('bg_color');
} | 0 |
9258c59853cb6cd50db5bcfce464700b | f25e9f3cf0e46b76720ef583c8d99f65 | Создание Заказчика | {
if (!isset($name) || !isset($email) || !isset($phone) || !isset($address) || !isset($payment) || !isset($date) || !isset($order_sum))
return false;
if (isset($juridical) && is_array($juridical))
$juridical = implode('|', $juridical);
$obj = array();
$obj['name'] = $name;
$obj['lastname... | 1 |
ff1b83922a2cd7c6cd9c443ada2359c6 | 65df1a0fab21ed14a29903bf0f569d33 | 让大于今天的日子不可选 | function onDrawDate(e) {
var date = e.date;
var d = new Date();
if (date.getTime() < d.getTime()) {
e.allowSelect = false;
}
} | 0 |
94a8c872e1574dc7c66c89a772a3e687 | 7a4af29f81b62f03e59c68649d630cc6 | 为校准日期按钮设置点击监听器 | public class AddNewCalibrationRecordActivity extends AppCompatActivity
private void setOnclickListenerForCalibrationDate() {
create_new_instrument_calibrationDate_tv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TimePickerView pvT... | 1 |
f89f62061a4487b681985e25555a2dbd | 0c1a9d53633617fa5b1968543812b645 | Process bulk action for profiles | class ES_Contacts_Table extends WP_List_Table
public function process_bulk_action() {
if ( 'delete' === $this->current_action() ) {
$nonce = esc_attr( ig_es_get_request_data( '_wpnonce' ) );
if ( ! wp_verify_nonce( $nonce, 'ig_es_delete_subscriber' ) ) {
die( 'You do not have a permission to delete contact(... | 1 |
5de4090a7e2702404cdc36de2e873cf1 | d983bd95729d3cb7b947a9032ce80be5 | Are we running inside an Azure Machine Learning (AML) environment? | def in_aml():
return 'AZUREML_EXPERIMENT_ID' in os.environ | 1 |
fda726a4051bc5fcdda54718a1ef6f4f | 71d11d28d233473c9f9a447f96e93aff | Metodo che restituisce il codice fiscale dell'utente che ha effettuato la prenotazione. | public class Concorso implements Serializable
public void setCodiceFiscale(String codiceFiscale)
{
this.codiceFiscale = codiceFiscale;
} | 0 |
29964e39b70e365ed2f8ad20f9e5d0e9 | 8366c622b55d767f19f66cd89dc74803 | Discover which day of the week a certain day falls on | if m == 1 or m == 2:
m += 12
y -= 1
century = (y//100)
century_year = (y % 100)
return (d + ((26 * (m + 1)) //10) + century_year + (century_year//4) + (century//4) + 5*century - 2) % 7 | 1 |
7e0964d4a2dd8a1bebed85b6b1499d27 | a9a15c013b89a8c54f0611dbfff74351 | Вывод суммы депозитов пользователя по ID | List<DepositeVo> selectUserDeposites(Criteria criteria); | 0 |
e4e942b612cbe6e8f22ff7f8be71425c | e180ea8822a307d36029a89a27feaea3 | 种子兑换果实 | class TreeAction extends BaseAction
public function pickFruit() {
if (!$this->loginedUserInfo) {
$this->checkLogined();
}
$service = service('Activity/Tree');
$uid = $this->loginedUserInfo['uid'];
$bonus = $service->getbonuses($uid);
if (empty($bonus)) showJso... | 0 |
4fcca78db8621066135ed93c4fd0b0f4 | 8f4b3d395d5a0e455ad872b41b25e768 | Retourne l'id de la dernière insertion par auto-incrément dans la base de données | class db
public function getLastId() {
return $this->connexion->lastInsertId();
} | 1 |
01c3d77be46b1d540cb922726b9cbe34 | b085ee9467dd1fd8e0f38d47823ca09d | Display a listing of the FileBackupLocation. | class BackupsController extends Controller
public function index()
{
$backups = File::allFiles(storage_path('app/public/'.config('app.name')));
return view('admin.backups.index',compact('backups'));
} | 1 |
a3ddd662a7306321d1976b90bb49ead8 | 782d4dbbb5ca60af361626906adc28bb | REINFORCE with baseline agent | class Agent(object):
def update_parameters(self, ob_no, ac_na, q_n, adv_n):
if self.nn_baseline:
target_n = (q_n - q_n.mean()) / q_n.std()
self.sess.run(self.baseline_update_op, { self.sy_ob_no: ob_no, self.sy_target_n: target_n })
self.sess.run(self.update_op, { self.sy_ob_no: o... | 1 |
90f284e32eddfa2a7f5ee66e8b71ffa8 | 320e8fd2fe58620e337a18260efe0ded | ===============================================================
Constructor
================================================================ | CObRecordDialog::CObRecordDialog (const int ID) : CFormView(ID) {
m_pRecordHandler = NULL;
m_pDlgHandler = NULL;
m_pEditorIDField = NULL;
m_pBipedPartsField = NULL;
m_pScriptField = NULL;
m_pEnchantField = NULL;
m_pSoundField = NULL;
m_pModelField = NULL;
m_pIconField =... | 1 |
9147975da22a1b37ce8c05a823f39d83 | 204b816000d8acea85b41504800f423a | 设置使用Opus编解码器。 | public abstract class AudioProcThread extends Thread
public void SetUsePcm()
{
m_UseWhatCodec = 0;
} | 0 |
aa3b95a0fa2225f02932836ce5ed4ba9 | 5c0e09c0cea97a9b8ecc881a5dee9cda | draws the porthole window | var doorLeft = 170;
var doorRight = doorLeft + 40;
ctx.beginPath();
ctx.moveTo(doorLeft, 355);
ctx.lineTo(doorLeft, 280);
ctx.lineTo(doorRight, 278);
ctx.lineTo(doorRight, 348);
ctx.lineTo(doorLeft, 355);
ctx.lineWidth = borderWidth1;
ctx.stroke();
ctx.fillStyle = "blue";
... | 0 |
040efacf8b4850ea64a36c57d38eefc0 | 1a1daa46f1e98c841856e46bc6ceae9b | Get programAcceptanceAt | list_of_files = glob.glob(self.final_path)
latest_file = max(list_of_files, key=os.path.getctime)
df = pd.read_csv(latest_file)
df.query("in_%s == 1"%program, inplace=True)
return df | 0 |
81aa1cf91e954ff137ad1ee71771aa83 | 90ebf4d2d025c886596e74a68f830b6e | Called after Dtella has finished syncing. | public class MainActivity extends ActionBarActivity
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
dtToggle.syncState();
} | 0 |
ca0c08bf12a942db51f13a000079e95b | 625833460d71198fc2e31e8d33b5a148 | Load the root directory block from disk. | SeekableByteChannel rootData = blockStorage.readUserData(28, 14);
ByteBuffer buffer = StarDBUtils.readToBuffer(rootData, 1);
boolean unknownBool = (buffer.get() == 1);
try {
rootData.position(rootData.position() + 1);
} catch (IOException e) {
throw new StarDBException("Error: " + e.getMessage(), e);
... | 1 |
951fc849885690cac4274e66e2feb393 | e2165fc516a081a9c9e3a36adce9e8fe | Modifica a velocidade e rotaciona o jogador na direção do movimento. | public class PlayerController : MonoBehaviour
void MoveHandler(Vector2 inputDirection) {
if (inputDirection != Vector2.zero) {
float targetRotation = Mathf.Atan2(inputDirection.x, inputDirection.y) * Mathf.Rad2Deg;
transform.eulerAngles = Vector3.up * Mathf.SmoothDampAngle(transform.eulerAngles.y, targetRotatio... | 1 |
9409e73dd996205a3cef7e242e3c06d8 | de06decdb4e792f47ca2c8ee07a20046 | Obtiene el Listado de FormulasAplicadass paginado | class FormulaController extends Controller
public function index(Request $request)
{
$formulas = ManufactureFormula::from(ManufactureFormula::getTableName().' as '.ManufactureFormula::$alias)->eloquentFilter($request);
$formulas = ManufactureFormula::joins($formulas, $request->get('join'));
... | 1 |
b6d8e8f68a4b2e56108d2467961c72aa | f8e9a2b1a1a8d6a75e3138f837c6fb9b | continue recording from paused recorder | if (recording) {
recording = false
currentRecordTask?.stopRecord()
currentRecordTask?.cancel(true)
currentRecordTask = null
}
} | 0 |
0b70f5a3c51b5e5ad073bffd857f9e1a | 4ebb31d2b6995fc7ca0d637527064c30 | Connects to the rover at the specified IP on port 19232.
Assumes that the rover is currently running and listening with a socket on port 19232. | class NewportControl:
def __init__(self, address, port):
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((address, port))
time.sleep(0.5) | 1 |
671dab5de82c4e8e3abc590b0cd406f5 | c9fdbd4e7c3df14210adae6d11a309bc | Enable all scene switch buttons | public class MS_GameManager : MonoBehaviour
public void enableButton()
{
buttons[0].interactable = true;
buttons[1].interactable = true;
buttons[2].interactable = true;
} | 1 |
d01e418afd07dec9c3778ac05a52937f | 7a69e00f34724ec2bad8ffbfc4cf8192 | Receives an Ethernet frame on a DPAA1 network interface | struct stm32_eth_netif_state *state =
(struct stm32_eth_netif_state *) netif->state;
ETH_HandleTypeDef *heth = &state->heth;
struct pbuf *p = NULL, *q = NULL;
uint16_t len = 0;
uint8_t *buffer;
__IO ETH_DMADescTypeDef *dmarxdesc;
uint32_t bufferoffset = 0;
uint32_t payloadoffset = 0;
uint32_t by... | 0 |
f0ca82a40384878b3fdaf70b9f4e9300 | cdc4ef06301b74dbd10c966580062b08 | Should be overridden by subclasses to return a list of base (i.e. always required,
don't need to be specified) gem dependencies. Should return an array of hashes
of the form {:name => 'rails-rubygem', :requirements => ['>= 1.2.5-1']} | class Specification
def dependent_gems
out = []
Gem.source_index.each do |name,gem|
gem.dependencies.each do |dep|
if self.satisfies_requirement?(dep) then
sats = []
find_all_satisfiers(dep) do |sat|
sats << sat
end
out << [gem,... | 0 |
cbee8585bd168cf01b695f3ff396e513 | f26c2646c8e5f8d8c666486511c38bfc | Get the cell NorthEast of this (L{Geohash}). | class BoundRegion:
def get_NW(self):
return BoundRegion( ( ( self.N, self.NW_corner, self.W, self.center ) ) ) | 0 |
43ada2e805b7f093bfea49cc1b36c3fd | 0b136a015b9acfcb44bd76ccaa2a892b | 约瑟夫问题,将出圈的人的序号依次存放在数组中 | void Josephus(int M, int N)
{
int i, num;
DList L;
Position P;
L = InitDList(N);
PrintDList(L);
P = Header(L);
P = Advance(P);
while (1) {
i = M;
while (i--) {
P = Advance(P);
if (P == Header(L))
P = Advance(P);
}
num = Retrieve(P);
P = Advance(P);
if (P == Header(L))
P = Advance(P);
... | 0 |
8119ff7173eeafd23266b75baac96dc6 | 164d1dd1cdbd10cfa932345c2dc227f9 | Get the maximum connection layer supported by this libtgvoip version.
Pass this as <code>max_layer</code> in the phone.phoneConnection TL object when requesting and accepting calls. | public class TorchPopulator extends DMMazeRoomBlockPopulator
@Override
public int getMaximumLayer() {
return MAX_LAYER;
} | 0 |
45e20ed42c6eff8fefb5b79a075977ca | ee98bd68d931e6a97f4474dd45d5d9b4 | Gets filtered data from ultrasonic sensor | public class USLocalizer
private int getFilteredData() {
int distance;
us.ping();
try { Thread.sleep(50); } catch (InterruptedException e) {}
distance = us.getDistance();
if (distance > 50)
distance = 50;
return distance;
} | 1 |
c962ec830f395ddfda7a0c91d05f9e37 | 53daaf1707ed7d84f1dccc9a552906f9 | Obtain a lower dimension mask for an sparse weight matrix. | mask1 = (torch.abs(x) != 1).type(torch.FloatTensor).view(-1, 9)
mask2 = torch.where(mask1 > 0, mask1, torch.tensor(1e-10))
return mask2 | 0 |
a906134a3cef10b7a866bd6504b9cc67 | ce2e81868593d6b7caa00980f2d94507 | Метод запуска потока для очищения директории | namespace FilesDirs
void desarhiving(); | 0 |
319e96f7a3cad28685186db5803b3996 | 6d7742d1a9ae15df4517b1ce597584af | Returns a result structure for the optimization state. | class ESSOptimizer:
def _create_result(self) -> pypesto.Result:
common_result_fields = {
'exitflag': self.exit_flag,
'time': time.time() - self.starttime,
'n_fval': self.evaluator.n_eval,
'optimizer': str(self),
}
i_result = 0
result = pype... | 1 |
9f61c5be67856060e3631fced3ba7f1b | 7e4c726aab16fb5f2ed082164e19e1fc | aliyun postObject 方式上传单个文件 | OSSCredentialProvider credentialProvider = new OSSStsTokenCredentialProvider(stsToken.getAccessKeyId(), stsToken.getAccessKeySecret(), stsToken.getSecurityToken());
ClientConfiguration conf = new ClientConfiguration();
conf.setConnectionTimeout(15 * 1000);
conf.setSocketTimeout(15 * 100... | 1 |
3812eab269c5e78ce425bdf4d987ca0f | b1a63f861542809089c19cf8f0eab943 | Test a shell command contains a specific output | class TestlibCase(unittest.TestCase):
def assertShellOutputContains(self, text, args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, msg="", invert=False, expected=None):
rc, report, out = self._testlib_shell_cmd(args, stdin=stdin, stdout=stdout, stderr=stderr)
result = 'Got exit code %d.... | 1 |
df4604b9abf9c3051a2c841b492ccd0e | 5a7b2d19543b2864eeba97706e74414d | @brief Clears the selected data port bits.
This parameter can be any combination of PORT_Pin_x where x can be (0..31). | void MCP23S17_portResetBits(uint8_t API_ref, uint32_t PORT_Pin_x)
{
MCP23S17_API *pAPI = getPtrFromRef(API_ref);
if(pAPI)
{
pAPI->portBits.newValue &= ~PORT_Pin_x;
}
} | 1 |
098a336b818b09e9b364fb8c4a1008f6 | a78cb9a4b9e8127c31712701fe89c7c3 | sort measurement list received from database based on timestamp with ascending order | public class MeasurementCollection extends RestApiConnector
public void lowPriorityfilter()
{
Collections.sort(measList, new LowFilter());
} | 0 |
0fd24e44fd5e9d702a3aa6354c97bce5 | 3f2529e35c512230dec99cead6978ad0 | Function for calculating inclination from coordinates | if z==0:
if y>0:phi=90.0
elif y<0:phi=270.0
else:phi=0.0
if z>0:
if y>=0:phi=round(deg(atan(y/(z/1.0))),1)
else:phi=round(360+deg(atan(y/(z/1.0))),1)
if z<0:
phi=round(180+deg(atan(y/(z/1.0))),1)
return phi | 1 |
583763b6484e0884bf08e9f9f6420a98 | a63a22bc46663334e606dcb0af498ed8 | Move the cursor to the start of the line, extending the selection if in extend mode. | class Editor
navigateLineStart() {
this.selection.moveCursorLineStart();
this.clearSelection();
} | 0 |
56caf58989239d894be60c913186998c | cb56614abe526034d97d934bec62fd55 | Actual function to compute the error between the current joint
configuration and the desired. The SSE is easy to provide a
closed form gradient for. | IKSolver::real_type IKSolver::functionEvaluator(const real_vector& theta)
{
mSkeleton->setThetaParameters(theta,false);
real_vector delta = computeWeightedDifference();
return AncelApp::vectorOpInnerProd(mDelta,delta);
} | 1 |
c1d51c65afa3dda764abf2855a5acc92 | 039c8dc07e4866ae403984bc7126f570 | 此时组件已经挂载,我们可以进行dom操作,对我们的状态进行更新操作了 | class LifeCycle extends Component
UNSAFE_componentWillMount() {
console.debug('1、状态准备完毕,即将把状态挂载到真实的DOM中');
} | 0 |
949aa389f0a8fd5521d3ced09d78dc0b | 0660e1f7a62dae3c8876f162fac930dc | Returns the previous point in the track | namespace GazRouter.Flobus.Visuals
public class PipelinePointsManager : IPipelinePointManager
public IPipelinePoint PreviousPoint(IPipelinePoint point)
{
return _listPoints.Find(point)?.Previous.Value;
} | 1 |
ba00fca157751f0f9a521807ea494f42 | c862d21118f3b01f5a8d0fe97fe3a91a | fungsi untuk menghitung total alumni sesuai dengan cabangnya | {
if ($id_cabang != 1) {
$where = array(
'cabang_id' => $id_cabang
);
return $this->db->where($where)->get($this->_table)->num_rows();
} else {
return $this->db->get($this->_table)->num_rows();
}
} | 1 |
f03ded8a78c4ecd9fdf4392524521e16 | d167059f1cfbf545fc31bad99ea85a23 | Transforme un vecteur du plan par le système de coordonnées puis calcule ses coordonnées à l'écran | namespace PixelCube.LeapMotion
class CoordinatesTrans
public Point3D TransPoint(Vector vec)
{
var pos = new Point3D();
pos.X = (vec.x + 300) / (600 / maxCoord) - maxCoord / 3;
pos.Y = (vec.y - 30) / (600 / maxCoord) - maxCoord / 3;
pos.Z = (vec.z + 300) / (600... | 1 |
42e12e1a78939af6ec3507f3066cc4b7 | bdc7cbfd987a3d9d5a7d991cd464ed39 | Retorna array com todos os filtros combinados com a seleção da URI | for(var i=0; i<filterarray.length; i++) {
var itemfilter = filterarray[i];
for(var index in itemfilter) {
if (itemfilter[index] !== "") {
if (itemfilter[index] instanceof Array) {
for(var r=0; r<itemfilter[index].length; r++) {
var value = itemfilter[index][r];
urlf... | 0 |
e696f147c83ce46aeff5a73953570987 | 30a5cd2e869f61de4491d49b00058880 | Gets the names of all the joints and actuators in the collection. | def joint_list(motion):
return motion.getBodyNames("Body") | 0 |
bfbec50a29d5280cfc7ede6c81ba6e8e | 620366d015d154abc686b1f42e8378f7 | 创建工单的controller | function controllerFn(workOrderAPI,$state,$rootScope,$stateParams,$filter){
function orderList(){
vm.list = undefined;
workOrderAPI.workOrderList(vm.queryParams,function (res) {
vm.list = res.lists.content;
vm.queryParams.pageNumber = res.lists.number + 1;
vm.queryParams.pageSize = res.lists.s... | 0 |
1b7d48baa1892c90406e60ba5f1529da | 22acf4dd273818eac2e31652232af253 | Určí cílový bod při zadání výchozího bodu, úhlu a vzdálenosti | namespace VTMap.Core.Primitives
public class GeoPoint
public GeoPoint DestinationPoint(float distance, float bearing)
{
double theta = bearing.ToRadians();
double delta = distance / EarthCircumference;
double phi1 = Latitude.ToRadians();
double lambda1 = Long... | 1 |
02548225559d1d5d09b5ffd714a66456 | 7a1fb30d1b0a814fa82b2b90b49c1e3c | Function to move the cursor right | class TextEntry:
# Startup
def doCursorRight( self ):
self.root.icursor( self.root.index( "insert" ) + 1 ) | 1 |
95f18bc0e62a7c51b18744a3f86ad29a | 3d88afef722ce2ad762e5b5b36238d31 | 添加一组用户到指定机构 | @ResponseBody
public JsonResult addUsers(@PathVariable String id , @RequestParam("userIds[]")String[] userIds){
try{
this.organUserService.addBatch(userIds, id);
return jsonResult(200, null);
}catch(Exception e){
return jsonResult(-1, e.getMessage());
}
} | 1 |
3d9f502f63d4f4c3b601c9ddeb7c55cb | 608ac485dd907413501c8695e4818e79 | Load the dataset and divide the dataset according to the principle of cross-validation
and perform related preprocessing work | def preprocess():
print('Preprocess Begin!')
Xtrain_dev = np.load('dataset/Xtrain_dev.npy')
Ytrain_dev = np.load('dataset/Ytrain_dev.npy')
kf = KFold(n_splits=5,shuffle=True,random_state=int(time.time()))
for train_idx,dev_idx in kf.split(Ytrain_dev):
tmp1 = train_idx
tmp2 = dev_idx
... | 1 |
7d98261e333ebcbac6131609c93d987f | 6f6f76beb15299ec19365fefa6c2e1f4 | Constructs action object setting start node, end node and cost. | self.pos = pos
self.parent = parent
if parent is not None:
self.path_cost = self.parent.path_cost + 1
else:
self.path_cost = 0 | 0 |
22ced5bdc488fc5e15372880e4a9d5d5 | 855bfe3b0c1a50f25d64016b36d2434f | <p>diskSizeLimit を取得します。 | BigInteger getDiskSize(); | 0 |
e2ee0a2f18219fc91581374a2c0cf13e | 492e3976dd0bce5a0ff1cbbe07f05ed5 | Get total custom fields | {
$ret = array('custom_field_one', 'custom_field_two', 'custom_field_three', 'custom_field_four', 'custom_field_five', 'custom_field_six', 'custom_field_seven', 'custom_field_eight');
return $ret;
} | 0 |
02a525f3542f741b913ba3c1013aae89 | b7e18f9b196c53be4131bbbdb20aa930 | 通道扰乱操作 | def disturb(indexList):
num = len(indexList)
pos1 = random.choice(range(num))
pos2 = random.choice(range(num))
disturbIndexList = [i for i in indexList]
disturbIndexList[pos1],disturbIndexList[pos2] = disturbIndexList[pos2],disturbIndexList[pos1]
return disturbIndexList | 1 |
6505ab8dadff4eb300105f19fe9e522d | 9a87a9ce5e3ec922a3515d95561794f9 | Type of this database provider (such as jdbc:mysql, mongoDB etc.). | String getDBTYPE(); | 1 |
4cd4d35f92ef04eb7911489ddd440902 | a6143f50e15ebb7c55cca22234100228 | Gets the value of the hosts property.
A comma-separated list of values allowed in the Host request header to select current virtual server. Each
Virtual Server that is configured to the same Connection Group must have a unique hosts value for that group. | public String[] getHosts() throws IaasMonitoringException; | 1 |
c247d371d3df893966b965dc101e349a | ebc7110522c920d9db50a4e1bc32a8a6 | Voltar o estado da tarefa para não concluída (pendente) | {
$tarefa = Tarefa::where('id', $id)->where('user_id', Auth::user()->id)->first();
if ($tarefa)
{
$tarefa->concluido = 1;
$tarefa->dhconcluido = now();
$tarefa->save();
return redirect()->route('dashboard');
}... | 0 |
e1ede87f8eadbce5936b4f2940249414 | 734b6f5d1a30d624304c93399166537f | 当为KN币的时候,价格定死 | {
if (date('i')%5 == 0){
foreach (config('market') as $k => $v) {
$this->setTradeJson($v['name']);
}
}
echo '计算行情0k ' . "\n";
} | 0 |
09198b0999256dd095d6483ee30bee5a | 8c94533788ff99c11142f7275bf4827b | __len__() returns the number of vertices in the graph | class Graph:
def __len__(self):
return len(self._vertices) | 1 |
1a0c6c8bffc764e9eb163fb54f3045f0 | 40f1e236c2af51cef1e91212b362e237 | Get a list of the SavingsYears for the scenario | class Fortnox
public function financialYears()
{
return new FinancialYears($this->client);
} | 0 |
dca9c13091a78d77e70cfbffb8193847 | cdbb8fd8b6c30a9cb05e75ce19d0a0e8 | Registers a direct use of the Query Builder | namespace Queries.Components.Configuration
new IBuildQueriesPipeline Uses(Func<IMiddleware<QueryContext>> factory); | 0 |
415b4c03baceec62c244e3c89f81484c | 021c329c10522b0a8fd4a41e6fec385b | 根据店铺ID查询信息,并进行排序 | public List<Store_Comment> findStoreInfo(@Param(value = "storeTypeId")int storeTypeId,@Param(value = "sorttype")int sorttype,@Param(value = "sortorder")int sortorder); | 0 |
2ec79a8267a1887fc66ac5e8b1e33134 | f7d25a17f019654c2ff8a4b92df11bea | Test letter directory creation | class SelectelAdapterTest extends BaseCase
public function testCreateDir()
{
$path = '/' . $this->createFakeData()->word;
$config = $this->getMockBuilder(Config::class)->getMock();
$service = $this->getMockBuilder(ServiceInterface::class)->getMock();
$adapter = new SelectelAdapter($s... | 1 |
780ea502bdc871c34ec7693a207015bf | cb288ed1b675301e9f08c5394260ec23 | Ends the automatic cinematic camera. | namespace OpenH2.Core.Scripting
[ScriptImplementation(712)]
void cinematic_screen_effect_stop(); | 1 |
17a7c329b01b9ba68bdfa886074abe2f | 1440a7d9569234c8b763f9efdc8604b9 | 通过MAINID取查询模型中的子表记录总数 | @Service
public class HZ_Gas_Card_Allocation_RecordService extends HZ_BaseService<HZ_Gas_Card_Allocation_Record, Integer> implements IHZ_Gas_Card_Allocation_RecordService
public int countListByMainNo(Map<String, Object> map){
return hz_gas_card_allocation_recordDao.countListByMainNo(map);
} | 1 |
253fb0911fec228a86382d5af4e0b512 | 406f1c44aea5c7ad20b582c2a71924fd | 检查输入的氨基酸比例是否在0到1之间 | public partial class BioDieselInputForm : System.Web.UI.Page
protected void CheckCollection(object sender, ServerValidateEventArgs e)
{
try
{
double process = Convert.ToDouble(Collected_kwo.Text);
e.IsValid = (process >= 0);
}
catch
{ e.IsValid = false... | 0 |
3b0a92c1a695b6d926452c136bb30dc5 | 8ee573f92c613e2b6183d21dcbffc47d | 社員マスタテーブル情報更新 | namespace Sugitec.Logics
public class srvMnt110 : srvBase
public void Update(dtoMnt110 dto)
{
try
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("Update M_ENGINEER SET ");
sb.AppendFormat(" NAME = '{0}' ", d... | 1 |
67e44244d40ac9c3d560f36366f25291 | 8a67eddbdcdca517721281612e47cff3 | 根据标签和问题的id,列出本问题外的相关问题。这里的标签仅是第一个标签 | @Select("select * from tb_problem,tb_pl where id = problemid and labelid = #{labelid} order by reply desc")
IPage<Problem> hotlist(Page<Problem> page, @Param("labelid") String labelid); | 0 |
d65d5ec416e8dcefaa8b00166fdf2cdd | fcc94e658f30937d0a0dee67b00956c8 | Gets the appointment resource by contact. | namespace Axis.Plugins.Scheduling.ApiControllers
public class AppointmentController : BaseApiController
[HttpGet]
async public Task<Response<AppointmentResourceViewModel>> GetAppointmentResource(long appointmentId)
{
return await appointmentRepository.GetAppointmentResource(appointmentId... | 0 |
952964dcfca133061c31edcc07c2385f | bdf478f826cb71aa63ef73eb0adac34f | Test case for data_context_topology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_burst_size_get | class TestTapiTopologyController(BaseTestCase):
def test_data_context_topology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(self):
response = self.client.open(
'/data/context/topo... | 0 |
27da7a7699d2c9b03941aa57433825a4 | d6e95f2733c606c8f788ad93db75a40a | Check that the inner product is Hermitian. | def isherm(oper):
return jnp.all(oper == dag(oper)) | 1 |
c7be4e77e5d08f7cdbd99431b00cf040 | 9757120146e95eb3b8ab9710f6a599a7 | 注册成功后是否通过Session获取ClientContext | if (PeUri.isSessionNotRequired(RequestContext.get())) {
return true;
}
String sessionId = request.getParameter("sessionId");
Cookie cookie = CookieUtil.getCookie(request, CookieKey.UC_LOGIN_SESSION_ID);
if (StringUtils.isBlank(sessionId) && (cookie == null || StringUt... | 0 |
8044d80e5e34f0cbcc258e5341e05569 | 613f6139f5ded481aeeb7cc00a31a43e | Setter for the total number of accounts | public class NotificationBean implements Serializable{
public void setTotalReports(int totalReports) {
this.totalReports = totalReports;
} | 0 |
82ed6a58d20565ae55a852e4aab32668 | 01f32381b158efb567d16f0da1d1cdfb | Display selected item in main menu based on Menu_Index | class MainWindow(QMainWindow):
def menu_selection_display(self, i):
self.stacked_widget_side_menu.setCurrentIndex(i) | 1 |
f77e5f1030b4c3719023506c890a6347 | 736f292d9c4416fa096b9cf3fdcf9c58 | %COSTFUNCTION Compute cost and gradient for logistic regression
% J = COSTFUNCTION(theta, X, y) computes the cost of using theta as the
% parameter for logistic regression and the gradient of the cost
% w.r.t. to the parameters. | def costFunctionReg(theta, X, y, RegParam):
(m, n) = X.shape
theta = theta.reshape((n, 1))
h = sigmoid(np.dot(X, theta))
J = 1/m * (-np.dot(np.transpose(np.vstack(y)), np.log(h))
- np.dot(np.transpose(np.vstack(1-y)), np.log(1-h))) \
+ (RegParam/(2*m)) * np.sum(np.power(theta[1:n]... | 1 |
1227cf1cd79f3ab10f456b695c59606c | 7bf6f3ee37822159b69e281c69fbe9db | Gets list of upcoming travel plans | $today = date('Y-m-d', strtotime('today'));
return $this->find('all',
array(
'conditions'=>array(
'email'=>$userEmail,
'activated'=>true,
'state !='=>SharedTravel::$STATE_CANCELLED,
... | 1 |
9b73fcf8150a6c0821b759575ca49024 | a022b492b62d27492f4e21f22404ab75 | Set the exp reward gained for slaying | void setDropExp(int dropExp); | 1 |
a5e0e5fec3b781d8ee56488b28bd5114 | 1a2e76efda8c071ee6cf2cf251b6a42d | Da appen starter herfra, chekkes der her hvis brugeren er logget ind. Hvis bruger ikke er logget ind starter login aktivitet. | protected void onStart() {
super.onStart();
FirebaseUser currentUser = Auth.getCurrentUser();
if(currentUser != null){
startActivity(new Intent(getApplicationContext(),MainActivity.class));
finish();
}
} | 0 |
830f88b44a8de72cbfaa5ddb75bb3341 | 8ec58f3aff9450c081a7a63fbae03299 | 此Token為何種(開頭) | class Token:
def type(self):
return self.__class__.__name__ | 1 |
fb369373043814baed81e9d2f12ee0cf | fcd76e34b555077ffca56ec989e7470b | GET: WatchlistFilms | {
var watchListDbContext = _context.FilmeGenero.Include(f => f.Filme).Include(f => f.Genero);
return View(await watchListDbContext.ToListAsync());
} | 1 |
f33900c8e0709b5275d308573889cc24 | 9b42ca0e56eee13db2bf48ac217c52d3 | Returns true if the key is up this frame. | public final class Green
public boolean isKeyUpThisFrame(int keyCode)
{
List<InputKey> result = _keysUpInFrame.stream()
.filter(item -> item.getKeyCode() == keyCode)
.collect(Collectors.toList());
return result.size() > 0;
} | 1 |
1c905696cbf66c52c2d4c59368a28544 | 0573e92cf88e92a40880c12c959a99ed | 设置区域渐变色 | @ViewPager.DecorView
public class IndicatorTabStrip extends BaseTabStrip
@SuppressWarnings("unused")
public void setGradient(@ColorRes int gradient) {
setGradient(ContextCompat.getColorStateList(getContext(), gradient));
} | 1 |
7205099dc677fa05e560a74c5dc5ed44 | b55d816e3a377784e68c8b3f044a4ca1 | report bad CSV data, return fixed row or None to skip this row | def should_be_reported(trade):
return False, '' | 0 |
c644a522b7ae78e220ab3edefc985119 | ceee56d3ba3e1f79a66b651c3b887941 | Permet d'isoler dans un tableau le nombre d'hommes et de femmes | male = 0
female = 0
for line in data_list:
if line[6] == 'Male':
male += 1
if line[6] == 'Female':
female += 1
return [male, female] | 1 |
a8968853368b41a9c1c35621305d0614 | 74733b62b4e56eaea599cd2eec31a3f3 | Redefine the scipy.ndimage.measurements.label function to work with a wider
range of data types. The default function is inconsistent about the data
types it accepts on different platforms. | dt = arr.dtype.descr + [(name, '<i4')]
if data is None:
data = np.arange(arr.shape[0])
e = np.empty(arr.shape[0], dtype=dt)
dt_new = np.dtype(dt)
for i in dt_new.names[:-1]:
e[i] = arr[i]
e[dt_new.names[-1]] = data
return e | 0 |
443d3244a6b22417a402bff05037dfb3 | 1720e3eaf06482001edf3123d6aa9248 | Utility method to set the display flag for displaying internal
operations of the heap bubble and trickle operations
<p> | public void setIsBundleOperations(boolean bundleOperations); | 0 |
0b3bb289c4237b0c438a2b8ae977e2fb | 6fdbe0e4fa6321dbbc376033970dd247 | Load, decode paths into images and cast them into float32 | colors = ['red', 'green', 'blue', 'yellow']
flags = cv2.IMREAD_GRAYSCALE
img = []
for color in colors:
temp = cv2.imread(os.path.join(path, id+'_'+color+'.png'), flags)
temp = temp.astype(np.float32)/255
img.append(temp)
return np.stack(img, axis=-1) | 1 |
cad047b843bed2a0c4e61a7af75861c2 | e65ec1bdc48e853a59c63a913670358d | Assign a user write access to a specific node. | def share_user(owner, domain, doc_id, user):
rolecount = random.randint(0,2)
if rolecount == 0:
role = 'reader'
else:
role = 'writer'
client, doc = _get_client_and_doc(owner, domain, doc_id)
scope = gdata.acl.data.AclScope(value=user, type='user')
role = gdata.acl.data.AclRole(va... | 1 |
a8683b7a788cc0f1bd0807ba50dae95c | 790953ed8e79fb07cc1b9a40dc7d72ab | Determines whether the specified instances are the same instance. | {
return other != null &&
Status == other.Status &&
Message == other.Message &&
StackTrace == other.StackTrace;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.