query_id
string
corpus_id
string
query
string
code
string
label
int64
04f8bc45203af18b8d4aa830b840fa69
abdf202a8701e89e6abe20af32a3ac66
Test the ability to edit CODE, and save with success
{ $customerId = rand(0, 100); $customerCodeVal = uniqid('customer-code'); $code = $this->factory->create(); $code->setCustomerId($customerId); $code->setCustomerCode($customerCodeVal); $this->resourceModel->expects($this->once()) ->method('save') ...
0
1071aeac60df7d83df17dbd5b29f1ccd
5b0c86276133028a709ca7f7a6289dee
多线程dfs
print 'start:%s' % ctime() s=time() douban_img_url='https://www.douban.com/j/search_photo?q={q}&limit={limit}&start={start}' search_name='周杰伦' threads_count=20 page_count=20 threads=threads_crawl(threads_count,page_count,douban_img_url,search_name) for thread in threads: thread.s...
0
3817807b926978ab6b746ae3f8c5a599
12309bc9d22b243ef7b96482e4d25c7d
Sum iyxmsz array over maturity states and rearrange indices to ixsyz.
class PolicyTest(): def long2short_state(self, izzy_state, turntable_state): return [izzy_state[0], izzy_state[2], izzy_state[4], turntable_state[0]]
0
51527c5437fba53dce0662000549f94f
5652cf1a7d7b16a04f3e65f9d974dea6
封装函数f,使f的this指向指定的对象
function foo(){ console.log(this.fruit); }
0
8fb082d0fef3fb1d6dd27cbcabd33230
73817341795739b275e3e5134edf56cb
Check the passed model is abstract.
class AbstractBackendTestCase(BaseTestCase): def test_abstract_nature(self): self.assertRaises( TypeError, AbstractBackend)
0
9a698187eff1c666c49361d1f9b438e2
9a19739818b839fb1d5b50f812787fe2
функция для инициализации структуры MapKeeper
(*M).Mem = (ElType **) malloc ((NB + 1) * sizeof(ElType *)); if ((*M).Mem != Nil) { NBrs(*M) = NB; int i; boolean AllocSuccess = true; for (i = 0;(i<= NBrs(*M)) && AllocSuccess;i++) { (*M).Mem[i] = (ElType *) malloc ((NK + 1) * sizeof(ElType)); if ((*M).Mem[i] == Nil) { printf("M...
1
897744c9da2ef252a18eee661887f005
6e5e14879f9052a30d218b877336ee64
Make sure the name doesn't end with a slash
public class VirtualJarInputStream extends JarInputStream private String fixDirectoryName(String name) { if (!name.endsWith("/")) { return name + "/"; } return name; }
0
d5f8ea8082994acd16723323da48ccf1
71402753760ce88c2e00e4e4c9a80885
Get the bean ID of an externally defined mapping strategy.
if (isPureJava()) { return null; } else { return getModuleName() + "." + getStrategy().getSyntheticModuleExtension(); } }
0
6a0f3487e1b0d4b48f386bcc91394f8f
60097d1e7ec74c286e9b617f7c783821
Convert Episervers internal timestamp to wordpress tempstamp format, adjusted to to the Wordpress installations perfered timezone.
{ $date = preg_replace( array( '/GMT\s*([+-][0-9]+)/', '/[^a-z0-9\x20\x09:+-]/i', '/\s*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*/i', ), array( '\\1', '', ...
0
1ef13135045e747f7a13e281dfed0fd3
1c1c534a067b4be199f7968415169313
prevent event from bubbling up and triggering the tapExpandable function
public class PopularMoviesDetailFragment extends Fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) @Override public boolean onTouch(View v, MotionEvent event) { v.getParent().reque...
1
3a7c645e60e4532f091e1f0693c66bb1
1de652dc219d18c3f81c76fba81ad8ca
添加 数据管理(主表)TBL_DATAMAIN
namespace NF.BLL public partial class Bll_TB_MATRL_MAIN public bool Add(Mod_TB_MATRL_MAIN model) { return dal.Add(model); }
0
f70fc7f088716b69df3452ae8b60a28f
66cf0a25c88c0f14744ae710cbea20d7
创建服务更新消息
public class MsgUtil public static void createUpdateNotification(Context context, String title, String createTime, String url) { NotificationManager nm = (NotificationManager) BaseApplication .getInstance().getSystemService(Context.NOTIFICATION_SERVICE); Notification.Builder builder = new Notification.Builde...
1
d39e2ef35076524b4db063bca2bc4ae0
f7fe20efcb1027d210bb4fedbf03cf6a
读入env.json文件
public final class ConfigManager private void initEnv() throws FileNotFoundException, IOException { String configContent = this.readFile(this.configPath); try { this.jsonConfig = JSON.parseObject(configContent); } catch (Exception e) { this.jsonConfig = null; } ...
1
cbd29a2d4bec0b76f697baf6d51e0317
5bf3662d42ff87a0cfe41c8a92f12958
XYZ to L*a*b* transformation function.
def xyz2lab(x: torch.Tensor, illuminant: str='D50', observer: str='2') ->torch.Tensor: epsilon = 0.008856 kappa = 903.3 illuminants: Dict[str, Dict] = {'A': {'2': (1.098466069456375, 1, 0.3558228003436005), '10': (1.111420406956693, 1, 0.3519978321919493)}, 'D50': {'2': (0.9642119944211994, 1, 0.82518828451...
1
bdd88c951b255483b0ea0798efa73abd
d58c7064fd9606c4bf2c28cbfdc7c38f
Установить текущее число патронов для основного ствола или подствола
[RequireComponent(typeof(Animator))] [RequireComponent(typeof(Rigidbody2D))]//添加2d刚体用来检测碰撞 //[RequireComponent(typeof(AudioSource))] public class PlaneBase : ObjectBase public void SetMainShooterBullet(int BulletCount, float shootRate, float shootSpace, float ShootDuration) { OwnBulletCount = BulletCount...
1
a668f0cd064f8cc1413c79245826a403
bc2f281f41399b682e887fb268812326
Gets the text associated to the font. @return string
class GDText public function getString() { return $this->_string; }
1
661e6f22c69f642c64baa6025fe6f966
879fe41075c276f391e35ea9279c0e95
Replaces any single apostrophes with two of the same
token = token.lower() token = re.sub(r"(\w+)'(\w+)", r'\1\2', token) return token
0
5c88be82248c488ee95de3b811cb56d3
e2fc475ec347a174e0b3f32d977d73f0
Number of set bits
unsigned int x = 1; int result = 0; while(x){ if(n & x) result++; x <<= 1; } return result; }
1
13fc5dc0eddee098bedc6efa7ab0b9ad
b61c42f9baba9523b1610aedbd5c68d9
check if all party pokemon fainted
namespace Project_Mochachino public class Combat bool checkPartyAlive() { return true; }
0
23e4169f226a765de0d5603bef01c512
cd876c08f0ad0497ac37437fd06e9632
Show the add slave view
class SlaveGUILayout(Screen): def show_slave_back_popup(self): SlaveBackPopUp().open()
0
96d8717cb460baf724eda832207e0146
c6c7d58fb9e01b0ed3cedfa7353c9095
called to change the location of the lens
class MagnifierPanel extends JPanel public void setMagnifierLocation(int locationX, int locationY) { this.locationX = locationX; this.locationY = locationY; repaint(); }
1
0565c49835d3b833299bba0f00153e38
7f50214020b3134e75ffae185bc5a8fc
上传排名
public class GooglePlay : EventDispatcher public void UploadRank(int score,string id) { Social.ReportScore(score, id, null); }
1
d7c33cda7a7289b56ece20f499339ce6
4fa95723f402ce25d2280fb34e610655
Handles the CellValueChanged event of the InspectionDetailsGridView control.
{ try { if (TVDetailsGridView.DataSource != null) { DataSet ds = new DataSet("Root"); DataTable dt = new DataTable("Table"); dt = ((DataView)TVDetailsGridView.DataSource).Table; ...
0
647d7caf3db5f829880a4281f27ccff8
9771723acecdb06310fb6d34be10af3f
Jos projektiilin elinaika on kulunut loppuun, se tuhotaan
@projectbundle = Projectbundle.find_by_active(true) if (@projectbundle.signup_end < Date.today) @projectbundle.verified = true @projectbundle.save @enrollments = @projectbundle.enrollments if not @enrollments.nil? or not @enrollments.empty? EnrollmentMail.result_email_for_all(@en...
0
a7d0adb7f001f975a3e3a8f518c18ac4
204957ab6e99665660d8dbfc1d87165a
Process raw profile data and create the point cloud message
class EnsensoSensor(CameraSensor): def _depth_im_from_pointcloud(self, msg): if self._format is None: self._set_format(msg) if msg.height != self._camera_intr.height: rescale_factor = float(msg.height) / self._camera_intr.height self._camera_intr = self._camera_intr.r...
0
376d568f707092243700f0febdeca808
c684435259f6b1c5d71f14b9bfc75dbc
Boolean. Indicates whather this table should be rendered wrapped in a ``<form>`` tag or not.
public class FormTable extends JTable public void setFormTraversable(boolean formTraversable) { this.formTraversable = formTraversable; }
1
76c9f74c1d557ccfb3e9a3a22816d86e
e96ee42ea4e33ccfce5a99f7b849ad7c
查询指定组织下所有分店,需要回溯组织树(人员可能属于区领导或公司领导)
@Service @SuppressWarnings({"unchecked","rawtypes"}) public class OrganizationBO public List<SysOrganization> queryDepartmentByCompany(SysOrganization org){ DetachedCriteria dc = DetachedCriteria.forClass(SysOrganization.class); dc.add(Restrictions.eq("parentOrg.id", org.getId())); dc.add(Restrictions.eq("orgLev...
0
8ab3e5955ed1ee2cea8cacda8ec001d4
0d6f21153fed3912d3142f22d6993bfe
An n-dimensional zig-zag curve - it snakes through the n-cube, with each point differing from the previous point by exactly one. Not useful, but it's a good counterpoint to other space-filling curves.
x, y = 0, 0 while True: yield x, y if x > 0 and y < x and y > -x: y += 1 elif y > 0 and x > -y and x <= y: x -= 1 elif x < 0 and y > x and y <= -x: y -= 1 elif y <= 0 and x <= -y: x += 1 else: print('Shou...
0
0c1302cfc882db68a218629480de44df
9bbf06d404f9b123f4cb61b79c2f7881
Test a url without a file
public override void Test() { var s1 = Check("http://filepost.com/files/4f278173/rs_tv_show_tracker_unit_test_file.txt/"); Assert.IsTrue(s1); var s2 = Check("http://filepost.com/files/xx278173/rs_tv_show_tracker_unit_test_file.txt/"); Assert.IsFalse(s2); ...
0
3062e95422925cee404e57a3f16ca3aa
417e5a8275a9e099e4abcbb42e2301c5
根据商品UUID、仓库编码,库区编码、储位编码、主单位,货主查询库存信息
public List<WarehouseDto> queryWarehouseBySupplieridProductid(String warehouseType, String status, String productid, String supplierid, String warehousename);
0
e357f3ea22e647de9e16116263d3d633
5b31181e1f7e12aa475b9dbd22c30811
Set 媒体导入事件。仅当 EventType 为 Material.Imported 时有效。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。
public class EventContent extends AbstractModel{ public MaterialAddedEvent getMaterialAddedEvent() { return this.MaterialAddedEvent; }
0
9ad6cbfce696c2558c02ec925e42a2f6
c4e7f4f00d9f96113439358b089ecde7
Helper method for summing over elements with shared indices.
i, j = sparse_indices features = tf.gather(features, j) features = tf.segment_sum(features, i) return features
1
fafbae4a140db7104aaad1af490afffb
1fb7413bf6992536a80c1c9a997178da
Compare the SFMS fits among the data and simulation
def compare_J(): from threedhst import catIO import threedhst.eazyPy as eazy import matplotlib.pyplot as plt import numpy as np PATH = './OUTPUT/' cat = catIO.Readfile('../Catalogs/aegis_3dhst.v4.0.test2.nzpcat.bright', force_lowercase=False) root='aegis' f1, f2 = 10, 8 root='cosmos...
0
d996388ba7a428a209463484eabe3ff2
bd9892eb6708261dac46a2e8ac449abd
from forkit: "Read Micromag data, starting with the header lines The first test determines if the data is in the old format, which has a single header line with 14 parameters. In the new format, the first line begins with the word MicroMag"
micromag_file = open(micromag_filename, "r") first_line = micromag_file.readline().strip() if not "MicroMag 2900/3900 Data File" == first_line: raise NotImplementedError( "You should rewrite this file to take into account new format") params = {} is_data_begin = False while n...
1
0c633764b41d9fe0faa5f546cfd085bd
80be8feb8d6afba6389a42c35e895c8b
#测试输入的SNP标记组合能够区分data1数据集中多少样本 #---data1为SNP数据集 #---snps为SNP标记组合 #---k为前面表头的列数
cm_error_knn<-function(k=1){ train1$predict<-cl_error_knn(k) train2 <- train1[, c(1, ncol(train1))] con_mat <- data.frame() cf_mat <- c(0:9) cf_mat = as.data.frame(cf_mat) colnames(cf_mat) <- 'df_sub' for (i in 0:9){ df_sub <- train2[which(...
0
1f5e1f663d5fcbb3d91eb19a81f68852
4666d6b334f02cdb19a1ce70910b6455
Initializes all store parameters to their default value
ldtMap[T.M_StoreMode] = SM_LIST; ldtMap[T.M_StoreLimit] = DEFAULT_LARGE_CAPACITY; ldtMap[T.M_Transform] = nil; ldtMap[T.M_UnTransform] = nil; ldtMap[T.M_StoreState] = SS_COMPACT; ldtMap[T.M_BinaryStoreSize] = nil; ldtMap[T.M_Modulo] ...
1
ddd30f71efb538cae64dd9571f194bcf
2dca1c8aaf7a4a24f597ab554fec3474
Returns the value of the '<em><b>Generate Ring Tone</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Generate Ring Tone</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
int getTone();
0
8837a391d06141853a916346d53824c0
33e79418098add72015a62a5806fa371
Fonction qui récupère le texte des tweets, retournant une liste des textes des tweets par cluster
results = [] for tweet in res_text: results.append(tweet) return results
0
3a52bb32661df2435ab8c573a98f39ff
f003dfeee35f3efdd4cc8c874f611fd1
To get all custom views of the module that are modified after the date-time specified in the If-Modified-Since Header.
namespace ZCRMSDK.CRM.Library.CRUD public class ZCRMModule : ZCRMEntity public APIResponse GetCustomView(long cvId) { return ModuleAPIHandler.GetInstance(this).GetCustomView(cvId); }
0
b457bd995ba4de220861991e932b8ec7
5deae3829e48210101bc75a83cf830f7
神兵锁定
local controller = UISuit.controller; local item = controller.GetItem(index); local actived = item:GO('Status.Actived'); local lock = item:GO('Status.Lock'); local flag = item:GO('flag'); local text = item:GO('text'); text:SetTextColor(241, 241, 241, 255); actived:Show(); lock:Hide(); flag:Hide(); ...
0
6d857db59f2d356c3d1f83cc0cc460f6
22c94828dae08713e606421cbcc87221
Remove pinning from a thread
thread_ids = _util.require_list(thread_ids) data_unpin = dict() data_delete = dict() for i, thread_id in enumerate(thread_ids): data_unpin["ids[{}]".format(thread_id)] = "false" data_delete["ids[{}]".format(i)] = thread_id j_unpin = self.session._payload_p...
1
d953060ae76c3fa7ec665ffc9b1cae02
4105a37567797c40ac23ac1f902bd672
ムービーが終わっているか取得する(ポイントの座標が最後まで行っているか取得)------ //MovieTimeだと同一フレーム上で計算するとき不都合があるので作成
export class MovieClip extends Image implements IAnimatable public get isComplete():boolean { return !this._loop && this._currentTime >= this._totalTime; }
1
a69dc9f1b8e18fef33ccd7f739a0f9f2
78273206b3f21219912fc2a19cb883ba
#\\ find all points in data dta inside of a block of distance bdist from a focal point foc #\\ col 1 = (p)lon and col2 = (p)lat
if(anis==FALSE) R1=getempcor2(fmat,delta0=(d-1)) else R1=getempcor3(fmat,delta0=(d-1)) ii=1:d i1=j1=ipos=NULL kt=0 for(jt in ii){ for(it in ii){ kt=kt+1 i1=c(i1,it) j1=c(j1,jt) ipos=c(ipos,kt) } } n=d^2 n2=n^2 dvec=rep(0,length=n2) kt=0 for(it in 1:n){ for(jt in 1:n){ kt=kt+1 x1=i1[ipos[it]] x2=i1[ipos[jt]] y1=j1[ipos...
0
ced1d5f8a71cc3b20eb5edd43467ca9c
aa579efa76464411e482e1088f6091f1
Prepend the application name to the title
class Utils(object): def get_title(title): return title + " - " + current_app.config['WEB_TITLE_PREFIX']
1
819e367ac86ce71292a4e817b75a8dbc
bef11964dd661e9e12dd118d039aedb6
Push the given string as part of the current argument
void CParser::PushString(char c) { yylval.s += c; }
0
57efe62630d7ee6ab4d8f0cf5742fcc4
c3748c6c5d4133d39467851b71071e63
Get all children items with given recursion
namespace PE.Services.System public class MainMenuService : BaseService, IMainMenuService private void GetChildren(VM_MenuItem parent, string user, bool isAdmin = false) { parent.Children = GetChildrenItems(parent, user, isAdmin); if (parent.Children.Count > 0) { foreach (VM_MenuItem new...
1
03f071bbfa4dfde9c4eeaf4853623db3
2bb9294cde86340032a5968c330571ff
Gets auto_answer
class AutoreplyController extends Controller public function index(Request $request) { $reply = AutoReply::firstOrCreate(['team_id' => $request->user()->team_id]); return $this->responseJson($reply); }
1
c6e6737576a2e99e7e645a3b6164936d
6d4435c2f9ea5c6c8673dd0ba5a04b6a
显示关注成功弹窗
function followConfShow(d){ if (followConf.is_need_follow == 1 && followConf.status == 0) { $('.need-follow').show().css({'background-image': 'url('+d.data[0].public_pop+')'}); $('.final-btn').on('click',function(e){ e.stopPropagation(); window.location.href = followConf.follow_url; }) $('.close').on('cl...
0
1054f82062584d9ee9ff2f0bb686ab04
f8f1f1909f66b09596078df030343273
Sets a new boost multiplier
class Display_Widget(Groupbox): def set_field_boost(self, value: float): if self.signalsBlocked(): return self.gui.config.set_float("field_boost", value) self.gui.redraw()
1
3c7090fa5262745535c987c86f7d0d2f
00fe20658cde81bfac5a5fd98f92b9b4
Выполняет запрос к базе данных с указанными в экземпляре класса <see cref="System.Data.SqlServerCe.SqlCeCommand"/> параметрами и возвращает количество задействованных в инструкции строк.
namespace Prey.Services int ExecuteSqlCommand(string sql, params object[] parameters);
0
ca4d1ccd7a0ae9b1a6a7c771d19fcec1
d19e1d4281c9e6f2602e0b4aeab5a756
Implements the Chiou & Youngs (2014) GMPE for application to the weighted mean case
n = Lor_y.shape[0] Gin_pol = np.zeros((1,2**(M-1))) s_all = sum(Lor_y,0) s_pos = sum(Lor_y[Lor_y > 0],0) s_neg = sum(abs(Lor_y[Lor_y <= 0]),0) del_pol = 2*((n-1)/(n**2))*(s_pos+s_neg) mu_pol = (1/2)*del_pol for i,s in enumerate(itertools.combinations(range...
0
0510af540ccf2b5d0ae9668eb7c2412d
728dc872f21755954fef641471050154
get first author family name and remove all special chars from it
def get_family_name(name): return name.split(',')[0]
0
0c809177a863ba650481453697146df6
4456c4a5802427bfa2061249bcf8778c
Test upgrading a 0.9.2 edge without a type.
class IdentifierFieldSchemaTypeUpdateTest extends UpdatePathTestBase public function testSystemUpdate8901() { $key_value_store = \Drupal::keyValue('entity.storage_schema.sql'); $id_schema = $key_value_store->get('node.field_schema_data.nid', []); $revision_id_schema = $key_value_store->get('node.field_schem...
0
7628ee52afd8ff9e6666ed8a1b7ef292
57984b03744d9b4ae4d65ee89e412352
Identical to superclass .items, except that keys that are included only due to application of default values can be excluded from the list.
class _ConfigBase(): def items(self, with_types=None, with_excluded=False): with_types = with_types or (ConfigItem, RepeatableDict) for key, item in self.__dict__.items(): if not key.startswith('_') and isinstance(item, with_types) and (item or with_excluded) and not key in self._mc_attribut...
1
6a90f63452c18f391f0eb92eeaa4c7da
8806aefc0ef1de681af2b5d650bd0c64
判断该代理商是否为我的商城下级代理
class SysUserModel extends Model{ public function is_proxy_sale($proxy_id,$user_id){ $map['status'] = array('neq',2); $map['proxy_id'] = array('eq',$proxy_id); $proxy = M('Proxy')->where($map)->find(); if($proxy){ $map = array(); $map['status'] = array('eq',1); $map['proxy_id'] = array('eq',$proxy['top...
1
f60e20ae00d257dbf14c30eb83dacfb7
0d7fc193e23380ca905dbc548a7804aa
Create post action (only text)
final class PostController implements ControllerInterface public function addAction($tid) { $text = filter_input(INPUT_POST, 'text', FILTER_SANITIZE_STRING) ; if (isset($_SESSION['user'])) { $uid = $_SESSION['user']['id_user'] ; if (isset($_SESSION['topic'])) { ...
1
804adc9369be4ba7a7d11ecb0aa799df
f6416bce1708e83a6030dcfb1d753ba3
解法1 - 假设32位机器
func singleNumber137(nums []int) int { var ans int32 for i := 0; i < 32; i++ { var total int32 for _, num := range nums { total += int32(num) >> i & 1 } if total%3 > 0 { ans |= 1 << i } } return int(ans) }
1
94e1cf47b4bf570fa6edfc51bad39017
f1fceeb677a41ec8a321e67d59fdf085
验证对象是否是字节数组
def is_bytes(obj): return isinstance(obj, (bytes, bytearray))
1
a4acaf34e884a8447588ff0a421eeaa7
25cd7e5a8dc1025a0d97f87a602d9f3a
Fall over into the fire
{ if (rand() & 1) gi.sound(self, CHAN_AUTO, gi.soundindex("world/steam1.wav"), 1, ATTN_NORM, 0); else gi.sound(self, CHAN_AUTO, gi.soundindex("world/steam2.wav"), 1, ATTN_NORM, 0); PBM_BecomeSmoke(self); }
0
000dfaffb1209edcfb361ebfca9450f8
71ae611e176b43b4fc3c50c54a076458
функция нажатия кнопки СЕ или С
namespace CalculatorWPF public partial class MainWindow : Window private void Button_ClickDEC(object sender, RoutedEventArgs e) { if (!textBlock.Text.Contains("2") && !textBlock.Text.Contains("3") && !textBlock.Text.Contains("4") && !textBlock.Text.Contains("5") && !textBlock.Text.Contains("6") ...
0
cc07a2c27255c1034f4de29dc375a1cc
b5814861b53e0d87ddedf8fdeb5c085d
Fetches a scipy distribution class by name
class Distribution(object): def fit(cls, y: Union[np.ndarray, xr.DataArray], dist_names: Optional[Iterable[str]]=None, use_dask=False, verbose=False) -> 'Distribution': assert y.ndim == 1 if dist_names is None: dist_names = cls.get_dist_names() if use_dask: ...
1
b072d57d0a1066a94435b9b29a7ff73a
76aca8008bbff0ee46d435126e7fe344
Returns all joined classes NOT including the start class
params = self.get_params() results = [] if params is not None: joined_groups = params.get('joined_groups') if joined_groups is not None: results = list(eval(joined_groups)) return list(set(self.__class__.__joined_groups__).union(set(results)))
0
dd56528263bd5446ee7251168217e35b
b926bc51855c5288a7c95999cf6b6891
Do not perform any preprocessing here.
public class SketchMinerModelCreator extends AbstractFreemarkerTextCreator<Flow> @Override protected void preprocessing(Flow modelObject) { }
1
772f5e35acdfd85e2dcd08074b1b4312
b773100d234985a2fe8131c59ddb2a03
Maps an image to a grayscale image according to the maps and saves the result.
im_width=256): conv_resized = sess.run(first_func, feed_dict={in_place: layer_outputs, size_place: [im_width, im_width]}) w = model.get_layer("W").get_weights()[0] maps = sess.run(second_func, feed_dict={in_place: conv_resized, convert_place: w}) return maps
0
f1e82fc81eb6d69872b26123be9bc312
a29b74f41c257c65788fbf511a72b517
摄氏温度到华氏温度的转换
{ data = (data)*9.0/5.0 + 32.0; printf("In F=%f \n",data); return data; }
1
d88f8560d19f288ecfd6465fd6f4baac
d9ecc3c53839a208aa2e273a7e0ed069
Fonction de récupération du nb de victoires de l'utilisateur
function getWins($playerID) { try { $query_result = dbSelect("SELECT wins FROM player WHERE player_id = '$playerID';"); if (empty($query_result)) { return FAILED; } $result_decoded = decodeSelectFirstResult($query_result)['wins']; re...
1
3dbf666c99dc657030c94d9018bf4e95
752e17a23828a28ce55648973e1de213
Split passage of text into an array of words
function _splitWords(text) { return text.split(/\s+/); }
1
95407582afe06a868efbbe734bcce594
a6d07830567b572267cd4b1a104a870c
Metoda obliczająca średnią kwotę wszystkich zamówień dla wybranego klienta
HashMap<String, Order> orderMap = dataStore.getCustOrderMap().get(customerID); double amount = 0; if (orderMap == null) { System.out.println(customerID + " has no orders"); return 0; } for (Order order : orderMap.values()) { amount += order.get...
0
cacc38cfe3a7db9dfd3ff8da36be67b3
0df9a3c30fea0876b1a01cab3f182291
Generate intital candidate sets of size one.
candidate_1 = [] for transaction in data_set: for item in transaction: if not [item] in candidate_1: candidate_1.append([item]) candidate_1.sort() return list(map(frozenset, candidate_1))
1
2102d7779d184e374e229ee8a9ffd5f3
098c11c0d6901be8672d02c0adc553c0
Method called to associate a GeneralInfo object to this object through the GeneralInfo foreign key attribute.
public final void setGedObject(final GedObject gedObject) { this.gedObject = gedObject; }
0
ea74d0b0e1ba8dc611540ce72dbf539a
99000d6c4999e60589aa675ce266cca9
restrict functionality on demo environments
{ $menu = parent::acpMenu(); if ( \IPS\DEMO_MODE ) { unset( $menu['support'] ); } return $menu; }
1
ca84746bc00d4f0a55aad2cb25431d67
18280fc348714c0db04a8ddeaa57e909
窗口大小改变时,设定width和height值,用于重新绘制网格
var h = $(window).height() - 40; if(h<300) h = 300; var w = $(document.body).width(); grid.setSize(w, h); }
1
1fb8e0086802d76b2071a3e182c14fc2
865d48732e2b5bae5d3b99d23643a68d
seeing classes of a particular student
class Principal(idNo: Int, firstName: String, lastName: String, age: Int, sex: String, salary: Int = 100000, onDuty: Boolean = true, idCardColor: String = "Yellow") : Staff(idNo, firstName, lastName, age, sex, idCardColor, salary, onDuty) fun getClass(student: Student): Classes {...
1
a73c9281b3a8c4528c2dfed949f46243
4118e6ed64efc7840205a1cd5956ef6e
Test length of source train
def test_rfo_min_train_length(train_size, min_train_size, horizon, expected): train = np.arange(train_size) cv = ms.rolling_forecast_origin(train, min_train_size=min_train_size, horizon=horizon) train_cv, _ = next(cv) assert expected == len(train_cv)
1
4bb4a3ee9c9ec607a19f237bb03d8108
ff7da6e775bffb77d654e894ea546c4b
Admin Action command to create a github organizational project from the selected KippoProject(s) Where an existing Github Organization project does not exist (not assigned)
if (!$this->getProjectNames()) { $this->getLogger()->always('<success>No project given</success>'); return; } return $this->doExecute($input, $output); }
0
446cc2e8a5061f751ed66c2411a515b7
4f9aec1265d4a7507f7fd09a857c7334
clientUser对象转json数据
int pack_cli_info(struct cli_info *cInfo, char *buf) { struct json_object *my_object; char *buf1; cInfo->type = USER_TYPE; my_object = json_object_new_object(); json_object_object_add(my_object,"type",json_object_new_int(cInfo->type)); json_object_object_add(my_object,"name",json_object_ne...
1
02a3ea1c90cc942bc339423d3c60b479
5a0cf42b4f5b905182eeec3932b864cc
Test that an integer field can be validated against
class BaseFieldCase(unittest.TestCase): def test_field_simple(self): f = Field(str) with self.assertRaises(TypeError): f.validated(1) with self.assertRaises(TypeError): f.validated(1.0) with self.assertRaises(TypeError): f.validated(None) self....
0
17aa4e1e977caf6e2b90efa10e514981
1b90089cab8be69dff55e1c91c7b95ce
Return a list of the component data objects in the dictionary
class IComponent(Interface): def property_items(recursive=True):
0
c3c1a4c6479c23f696c11e3870f62df7
28f5255318174bd63ce60957a2cd5581
Functions for the second multiple-choice "popout mode" button;
function makeAnswer(question, answer, count) { const container = scene.getObjectByName('quiz'); if (question === "quizQ") { deletePopup(container.getObjectByName('quizQ')); } else if (question === "inputQ") { deletePopup(container.getObjectByName('inputQ')); deletePopup(c...
0
e64f3ba651570d80cb8589b1a267aaab
6112fc5ab10dbf9bd0167e022056ce02
Returns true if the input file is alread finish.
self.cursor.execute('SELECT * FROM finished WHERE file = ?', (f,)) row = self.cursor.fetchone() return True if row else False
1
16682f612388f85de718f396b5a2a49f
8b83772c0cdaba5566ba28e68dfb91aa
생성된 MNIST 이미지를 10x10 Grid로 보여주는 plot 함수를 정의합니다.
def testPlt09(X_train, y_train): fig, ax = plt.subplots(nrows=2, ncols=5, sharex=True, sharey=True, ) ax = ax.flatten() for i in range(10): img = X_train[y_train == i][0].reshape(28, 28) ax[i].imshow(img, cmap='Greys', interpolation='nearest') ax[0].set_xticks([]) ax[0].set_yticks...
0
f03f6a9df18c605e6e1b39126bafa495
2d9e2bcd6f894d3fef72cf587b8adba8
根据需要加载items至combobox
{ string sSql = "SELECT sGridDisplayField,sGridColumnText, sEnGridColumnText " + "FROM sysLookupSetting " + "WHERE sType='ComboBox' AND sLookupNo='" + comboboxno + "'"; DataTable dtTmp = DbHelperSQL.Query(sSql).Tables[0]; if (dt...
1
fc8f648fd67b0bba2aa67e108e9ed8d5
b953ad51bdd681e991ff0087ed930b9f
查询门店证照信息,门店uuid为空
GspBusinessLicenseQuery query = new GspBusinessLicenseQuery(); query.setEnterpriseId(enterpriceId); GspBusinessLicense gspBusinessLicense = gspBusinessLicenseService.getGspBusinessLicenseBy(query); if(gspBusinessLicense==null){ query.setIsUse(Constant.IS_USE_NO); ...
0
061d6446ef49f0e57c48e801f4759a3c
226ce9d6787a40d23a9c4691d02ab15e
function to count set bits(number of ones in binary representation) in a number
int countSetBits(unsigned int n) { unsigned int count = 0; while(n) { count += n & 1; n >>= 1; } return count; }
1
8508d97e3ed1aadfdf64e9bc5163bcbe
072185507c6cafd0437df282193f5399
Given a list of tokens corresponding to an infix expression,
precedence = {} precedence['NOT'] = 3 precedence['AND'] = 2 precedence['OR'] = 1 precedence['('] = 0 precedence[')'] = 0 output = [] operator_stack = [] for token in infix_tokens: if (token == '('): operator_stack.append(token) elif (token == ')'): ...
1
7ac14953a2f3765a7768125ce5d28424
5c620985aa854e667597ddc6f7bfc9bb
Saves the provided server settings.
namespace StockSharp.Hydra.Core [DisplayNameLoc(LocalizedStrings.Str2211Key)] [CategoryOrderLoc(LocalizedStrings.GeneralKey, 0)] [CategoryOrder(_serverCategory, 1)] [CategoryOrder("CSV", 2)] public class HydraSettingsRegistry : IPersistable public void Save(SettingsStorage storage) { storage.SetValue("AutoSta...
1
2c749bd825911b977a3843395c300360
4907cad695dbc3d19426fcff1cbdddfb
根据仓库名称和仓库编码查询仓库
@RestController @RequestMapping("warehouseController") public class WarehousingController @RequestMapping("/queryByWarehouseCode.do") public Warehouse queryByWarehouseCode(String warehouseCode){ return warehouseService.queryByProperty("cWhCode",warehouseCode); }
0
8c36379142c5bd4cfb0465a3a69bd57f
73b7f0d33ef18bc4ded355ecd51c72fb
Metodo que transfiere una llamada a otra en la capa sip.
public void retieve(CallSip callSip);
0
5288a32e1d8ba5cc8994e0cc3fcde96e
d566ce0891c568f48a9dd322c372ab82
相性倍率の計算 相性倍率を計算してそれを返します
@JvmStatic fun typeCompatibility(attack: String, defense: String): Double { var magnification = 1.0 if (attack == "ノーマル") { if (defense == "いわ" || defense == "はがね") { magnification = 0.5 return magnification } if (defense == "ゴースト")...
1
52a68ddde201eb232fe4b569ea177a19
fb21c4d5ba5543e874e129e954646012
Parse CCCI message for parameter 1
$payload = $this->removeNewLinesFromLine($lines[1]); $swift_regex_x = '[0-9a-zA-Z\-\?\(\)\.,+\{\}\:\s]'; $regex = '/\/CNTP\/('.$swift_regex_x.'*)\/('.$swift_regex_x.'*)\/('.$swift_regex_x.'*)\/('.$swift_regex_x.'*)\//'; if (preg_match($regex, $payload, $match)) { return $matc...
1
d68e9866a880cd638d95566d91d4eeb4
39423f3ddb251b4955d796535bfe5e0b
Ajout d'un dégradé avec de nombreuses couleurs
$dataSetTmp = new pData(); $dataSetTmp->AddPoint($donnees, "Serie1"); $dataSetTmp->AddPoint($libelle, "SerieName"); $dataSetTmp->AddSerie("Serie1"); $dataSetTmp->SetAbsciseLabelSerie("SerieName"); $this->dataSet = $dataSetTmp; $chartTmp = new pChart($this->imgOutWidth, $this->imgOutHeight); ...
1
d972f55620696e3094c165b801c3952d
47ef3aa34cae187d004f07e5ccc0b088
保存されているスコアをすべて削除して初期化する
public class highScoreScript : MonoBehaviour public void clearScores() { PlayerPrefs.DeleteAll (); showScores (); Application.LoadLevel(2); }
1
a966bce1a7ec3606404e7c6cc52f78be
326d29f7da3022b03e6c9e249317ee5d
超过三级不做处理
class Foreman public function process($level) { if ($this->level >= $level) { echo '领班处理' . PHP_EOL; } else { (new $this->superior)->process($level); } }
0
84051e796dd76dd4fdee462af77e3587
25652a4a242a38b63fb991c5e3c996b2
把Func0转换成Callable。 这两个单方法接口从签名来看应该是一致的。
public static <T> Func0<T> asFunc0( @Nonnull final AtomicReference<? extends T> source) { return new Func0<T>() { @Override public T invoke() { return source.get(); } }; }
0
f6b008317eaf6c1207b3891bdee72730
423674aee6fdf26d5c0dc2c25d678925
模糊查询获取行数
{ $query = $obj->toSql(); foreach ($fields as $key=>$value){ if($key=='searchKey'){ if(!is_array($value)){ return 0; } foreach ($value as $k=>$v){ $c_value = "'%".$v."%'"; $query =...
1
ddeafebec04ea6feca1c52b12eb094db
5460a6eb882db57952b883798e3c6ed6
判断当前列表的状态
const listRect = this.refs.list.getBoundingClientRect(); const documentHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; const isListDown = documentHeight > listRect.bottom; this.setState({ isListDown: isListDown }) ...
1
d58cfafbc4c0b85aca41c703f2f267dc
c30664a66c0fd60ddc90f3b5652368be
Create a window that allows a user to log in to a server or to load a local dataset
self.client_transport = client_transport self.database_client = database_client self.message_window = QMessageBox() super().__init__()
0
216f9e4e5b6d48583729ee7f896c5f58
5a8a6640796eb4fc7ca67660e5eac1c6
Expect the value to be greater than the given value.
public static function greaterThan($value, $limit, $message = null, $propertyPath = null) { if ($value <= $limit) { $message = \sprintf( static::generateMessage($message) ?: 'Provided "%s" is not greater than "%s".', static::stringify($value), stat...
1
3f4c5f651eefa9bd6bc987b9c0243f5e
34b65bacc6a72098a4786e651ff9058b
when play button is pressed, bring the game menu to level select screen
namespace tdt4240.Menu class MainMenu : MenuScreen void PlayGameMenuEntrySelected(object sender, PlayerEvent e) { ScreenManager.AddScreen(new PlayerSelect(), e.PlayerIndex); }
0
5975c3840a8f58a6ee04a22a18cb3e50
e2b041ae4b8da57cc6a0ea635df601f7
Affiche les informations utiles sur l'interface utilisateur (bandeau en bas de l'écran)
public class PhaseJeu extends BasicGameState private void information( GameContainer gc, Graphics g, String ... messages) { if(messages.length>0) { int largeur=600; int hauteur=messages.length*40+policeEchappe.getHeight(messages[0]); int x=gc.getWidth()/2-largeur/2; ...
0