query_id
string
corpus_id
string
query
string
code
string
label
int64
b3eecf326329232906fc4a3de027c353
039215eded01ed5e1f4a71718e90e5b3
检查当前工作目录中的文件版本是否与SVN库中的一致
@Slf4j public class SVNKitUtil public static Boolean checkOut(String svnUrl, String svnUsername, String svnPassword, String targetPath) { DAVRepositoryFactory.setup(); SVNRepositoryFactoryImpl.setup(); FSRepositoryFactory.setup(); SVNURL repositoryURL = null; try { re...
0
9b8754594a29e1888e525545b0978dbd
96034a8d7dd93076e770fa9b99d4bfc0
查询某日的账单数量
class NewQueryWidget(QWidget): def bill_by_day(self, date): assert type(date) == datetime return self.parent().parent().new_bill_by_day(date)
1
29778c1340166514ea04b8912c41fbe8
55eea4a6012bb6037ce43dd6aa298f6d
ARSession이 활성화 되고 AR Face가 동작 가능할 때만 동작시킴
public class ARFaceBlendShapeVisualizer : MonoBehaviour private void OnARSessionStateChanged(ARSessionStateChangedEventArgs args) { if (args.state > ARSessionState.Ready && _arFace.trackingState == TrackingState.Tracking) { foreach(var characterRenderer in _characterRenderers) ...
1
a5047cd8d66e19693ddd0092a0bf1d7e
e3dae679b7045d599c31f3316c02d5c8
kullanıcının tamamlamış olduğu siparişleri getirir.
namespace BespeakMeal.Data public class OrderData public IList<Order> GetOrderInProductCar(int userId) { return Session.CreateQuery("from Order where UserId = :userId and status = 0") .SetInt32("userId", userId) .List<Order>(); }
0
d340add6f1ae32eb1c626346a49d7e75
ba5e6c85edd171a05dbd809ce7e54b44
La ejecución de la prueba valida que se reciban las instancias nulas y se obtenga una excepción.
public class PruebasOptional @Test(expected = Exception.class) public void pruebaOptional2() throws Exception { optional2(Optional.empty()); }
1
ead1c296ae019e6bffc78d715cb86747
cad7f2aed5b716e9082d19f1ceaa7d59
显示规则详细
class WechatRuleController extends BaseController public function show($id) { }
1
b6ee9eaf0b6a786340a054dd63fc223e
2031cc70171283e2df0e457b2b110382
通过lambda函数按第0列排序
def open_sort(l): l.sort(key=lambda state: state.f)
0
55f5794c58b673f7d1cd5a3a5e198689
a7cbdac4b4b157bf1c1070926495be2e
Test examples/pyomo/piecewise/step.py
class TestFunctionalPauliRotations(QiskitTestCase): def test_piecewise_linear_function(self, num_state_qubits, breakpoints, slopes, offsets): def pw_linear(x): for i, point in enumerate(reversed(breakpoints)): if x >= point: return offsets[-(i + 1)] + slopes[-(i +...
0
a89fe8ad6d85800e279b4bb18e48d7e6
bf1d4c1eff03ebfafd69e4726776c202
Define how to parse a primitive type into your custom scalar.
class Parser(object) : ################################################################## # def parse_primitive(self) : return self.parse_one_of( self.parse_string_value, self.parse_integer_value, self.parse_float_value )
1
96687d7923df980a125aec4c25a8ae65
527080a9e91d32dd741c8ca1f49f9813
Methode permettant d'appliquer des dégats au joueur.
class Player def gets_damage(number) @life_points = @life_points - number if @life_points <=0 puts "#{@name} a succombé à ses blessures !" end end
1
e88128055144422178d8c7de9a44f3e2
62b424ca0c6079746a475eec118244d1
返回精简版的微博记录,只包含所需的字段
class Weibo(object): def get_one_weibo(self, info): try: weibo_info = info['mblog'] weibo_id = weibo_info['id'] retweeted_status = weibo_info.get('retweeted_status') is_long = True if weibo_info.get('pic_num') > 9 else weibo_info.get('isLongText') if r...
0
8ebafbfcb06b0e80600e8091884b4c75
4b8a304f679b3ee474c939a62571a2e8
クイックセーブを行う
public class SaveData : MonoBehaviour public void ListSave() { QuickSaveWriter writer = QuickSaveWriter.Create("Data" + currAmount); writer.Write("DataName", data.DataName); writer.Write("Length", data.Length); for (int i = 0; i < data.Length; i++) { writer.Write(...
1
bb50310f6d573e18415241ff80d90b4d
36c7dd97ed5b3b8888f60a2c08dc6bd5
Verify an undefined substitution falls back to dollar-curly env var.
self.dbgfunc() vname = "EXPAND_UNSET" with util.tmpenv(vname, None): bare_str = "before $%s after" % vname exp = "before after" actual = util.expand(bare_str) self.expected(exp, actual) braced_str = "before/${%s}/after" % vname ...
1
27d634daaf46207d522a7f15d9129c2b
860fbce40440b08a5dd11983eba670b0
Sets the payment method as VISA credit card
public void testVisaCard() throws Exception { action.setVisa("4111111111111111"); validator.setFieldName("visa"); validator.validate(action); assertFalse(context.hasFieldErrors()); }
1
1eb01b88767fde8d84d35c65e6cb342d
6dff1ce137fff5f76a70b541dea1dafb
判断用户是否具有添加文章权限。
let permissions = this.getPermissions(); if (permissions.indexOf('create_blog') === -1) { return false; } else { return true; } }
0
80afc72c174d7b1c8ad6cfc68af445f9
81d7992f7d2e8526840866670ec9e62a
LeetCode Sol
int n = nums.size(); vector<int>max_LR(n),max_RL(n); int max_LR_sum = INT_MIN,LR_sum=0; for(int i=0;i<n;i++) { LR_sum += nums[i]; max_LR_sum = max(max_LR_sum,LR_sum); max_LR[i] = max_LR_sum; if(LR_sum<0) LR_sum = 0; } ...
1
507380e3b6154defc38a800f488f7fbc
d2ff21db0eb5b3411f0b035d71922efe
Returns instance of AffinityMikadoOptions class
{ if (!isset(self::$__instance)) { self::$__instance = new self(); } if (null !== $options) { self::$__instance->set_options($options); } return self::$__instance; }
1
9cc8ea05cf9cc501cded0ebb696b47e4
c6b92217da38c47565fe96876f1b637d
IsStruct validates if an instance is struct or pointer to struct
name := v.Type().Name() if v.Type().Kind() == reflect.Struct && name != "Time" { return true } return false }
0
96d8eb6e593ddf0390d67bdc33948e94
a8606d99b4cb45a214edab4067e8fd99
获取离线作业某个人的反馈内容
ReadByQueAnswerView view = new ReadByQueAnswerView(); WorkReceiveStu receiveStu = receiveStuMapper.selectByPrimaryKey(workReceiveStuId); view.setAnswer(receiveStu.getTextQueAnswer()); view.setComment(receiveStu.getTextQueComment()); view.setReadFlag(receiveStu.getTextQueReadOverFlag()); view.setWorkReceiveS...
1
7f23eed90b739718e108a2de7fc8380e
f591c874c882a231e20b15f3f52c0389
This method <b>getStartTime</b> returns the start time of a specific meeting.
public class Appointment public LocalDateTime getStartTime() { return startTime; }
1
d188d8f996c5c29cab8f9a23c28b9a29
e632a02d9120e68e04263a9d2c8562c1
Trains a policy and dumps it to file.
def train(): training_data = load_data('domain.yml') trainer = Trainer(config.load("policy_config.yml")) trainer.train(training_data)
0
a0842d6fe23f18c40ac937ce40412fed
cfcbfdf75c2b56cc6b631d056e6f3843
Function to call variants with GATK Haplotype Caller (HC) GATK HaplotypeCaller is used to collect vcf information from a mapping file -L name of the circuit design in the reference fasta -R reference fasta file, can contain circuit & host -I input bam file that has read groups added, duplicates marked -stand_call_conf ...
spawn_job(jobname = 'WGS_GATK_variant_calling', SAMPLE = sample, LOG_PATH = p.OMICSPIPE["LOG_PATH"], RESULTS_EMAIL = p.OMICSPIPE["EMAIL"], SCHEDULER = p.OMICSPIPE["SCHEDULER"], walltime = "240:00:00", queue = p.OMICSPIPE["QUEUE"], nodes = 1, ppn = 32, memory = "58gb", script = "/WGS_GATK_variant_calling.sh", args_l...
0
4b7d6b1dbb0f5c8ef4862fd5082403cb
5dcfb5bccc376e6e4f8512c1a0886023
Sets the metadata schema ID of this metadata property.
class MetadataValuesChangeCommandBase public function setSchemaId(string $schemaId) { $this->initialized['schemaId'] = true; $this->schemaId = $schemaId; }
1
8403e660e0258cf476de5b82a91f6a3a
88b70c356a7d8b93940fb985b63f5335
returns index of the given EP in table ..
{ U8 i,j; for(j=0;j<MAX_INTERFACE_FOR_DEVICE;j++) { for(i=0;i<MAX_EP_PER_INTERFACE;i++) { if(usb_tree.device[selected_device].interface[j].ep[i].ep_addr==ep_addr) { return usb_tree.device[selected_device].interface[j].ep[i].pipe_number; } } } return 0; }
1
5a7236d1db4764c4a89ba78ba7d4c1ea
076f2a3b378b1af0d95de3d300d4a24c
配置lvs函数
local function doLSP(script,params) script="%>"..string.gsub(script,"%c"," ").."<%" script=string.gsub(script,"%%>"," echo('") script=string.gsub(script,"<%%","') ") local paramsStr=" local params=cjson.decode('"..cjson.encode(params).."') " local echoStr=" local __echos={} f...
0
6aaf93b0d3a9578cbee114c6d883514f
eab6a36cf641e943cf98a23f1801c97d
Insert 'ready for command' information into the MOSI frame. None. None.
( uint8_t vPortAddr, uint8_t vDevAddr, uint16_t vRegAddr ) { drv_mdiom_SetStartFrame(0, 0); drv_mdiom_SetOperationCode(0, 0); drv_mdiom_SetPortAddress(vPortAddr); drv_mdiom_SetDeviceAddress(vDevAddr); drv_mdiom_SetTurnAround(1, 0); drv_mdiom_SetAddr(vRegAddr); }
0
fe55b2ead483a32152e71acb41133bb0
65076cf7a3f4f941d826bd309da1d9cf
Ham chuyen mot chuoi he 2 sang mot chuoi he 16
{ int size = 0; memset(OutBuff,0,OutSize); for(int n=0;n < OutSize,size < InSize;n++) { if((n%2) == 0) { OutBuff[n] = (((InBuff[size]/16)>=10)?('A'+((InBuff[size]/16)-10)):('0'+(InBuff[size]/16))); size = size+0; } else { OutBuff[n] = (((InBuff[size]%16)>=10)?('A'+((InBuff[size]%16)-10)):('0'+(In...
0
49378383b2952c9a4d3e80c86eb4299f
a8e1c8c6187de2667dce2facd19450d7
initialization without parameters is empty
class AssignmentForAll AssignmentForAll() { }
1
808c3c1d647fee4322e76d107a0dbeac
a26b13d23b454294ae72158cdfccf15b
getTotalTime Returns the duration of the currently loaded audio file.
Int64 GeneralPlayer::GetAudioTotalDuration() { return GetAudioDuration(); }
1
8d35a47d0974092825377f77d85771a7
c906e6ef7da9c27a786aaffff6bd16f1
获得当前年月格式时间 yyyy-mm-dd
public class Utils public static class Time public static String getNowYearMonthDay() { DateTime dateTime = new DateTime(); DateTimeFormatter formatter = ISODateTimeFormat.yearMonthDay(); return dateTime.toString(formatter); }
1
2f509f75232ab2c9f68902cc69095c70
c5a5029962c6ecadb80bb1b0fa7886d4
随机选择优先级别
public class HospitalERCompl{ private int randomPriority(){ double rnd = random.nextDouble(); if (rnd < probPri1) {return 1;} if (rnd < (probPri1 + probPri2) ) {return 2;} return 3; }
1
ded866bc568dd03f04189c7545206726
afde660cfdf69c348ae4f0d19e0bcbe2
Get the dict representation of the tracker's current status.
class Basic(object): def get_status(self) -> dict: return self._status.get_status()
1
56d0c8c18f88d8062fd377c1c83850da
1ae2cea5db4577e42ead09cfa11d3c57
Inserts the object into +self+ at the corresponding position. (see #insert)
if index == DEFAULT_MISSING_INDEX self << item elsif self[index] insert(index, item) else self[index] = item end end
1
085649cad82127a52bc8cafb5e91c2a2
7913f214a6eea39ce7e45e152c1bd328
Metoda dodaje element do kolejki z lewej strony. Pobiera jako argument element, który ma zostać dodany. Niczego nie zwraca.
public void addFirst(E element) { if (this.isEmpty()) { this.tail = new Node<>(element, null); this.tail.setNext(this.tail); } else { Node<E> newElement = new Node<>(element, this.tail.getNext()); this.tail.setNext(newElement); } this.i...
1
c57f15b5f215312a844c520722722842
cdbf0f65944b906c9bb6153236acd4c2
string if": `variable` is defined and truthy, else
function yesNoIfy(value) { return value ? 'Yes' : 'No' }
0
960a53c286609e46993116362408c424
bb579e67cae3bbf1fc05491381abd547
true when pt has run off the end
bool C_XPoint::IsOver() const { return m_ulPoint >= m_ulSize; }
1
cc8f5fcc50fad631261f77c657013b56
8b71cf54a9b1bf1b4fb9a8bba2dadae9
timestamp a message and pass it to the parent
{ if (parent == null) { Debug.LogError($"Module hub failed to send msg {msgName} to parent when parent is null"); return; } parent.EmitMsg(msgName, msg); }
0
f671fe39573e1b1aadde1447a1d6a5a1
e872bfb477538971db54916f76edf55c
获取系统字体
string getSystemTTFs();
1
b740f49b49270500f38c14431ddf0dd5
ede6ab288f2ae197e5e79e8824e4ef5c
Displays Diagnostic Readout on left side once potential symptom is clicked
public class EditSymptomsFragment extends Fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) @Override public void onClick(View v) { toggleSymptomsHint(); }
0
f3b017a6293eb86937b6add7424fb758
613f3dec9a82a3b499f5600043120c7f
Класс монстров ближнего боя. Если игрок дальше их видимости, они ходят вокруг точки спавна. Если они видят игрока, они идут к нему
super().__init__() self.screen_rect = screen_rect self.x = x self.y = y self.dx = 0 self.circles = [] self.guns = [] self.no_background = no_background
0
3b810ceb8c5bd725a2a1235515178cf3
480774a3c0b7a3e414783e3b59e209bd
检测是否指定了界面语言
public class FilterAreaActivity extends AbstractActivity implements View.OnClickListener private String checkLanguage() { SharedPreferences preferences = getSharedPreferences("language", Activity.MODE_PRIVATE); String currentLanguage = preferences.getString("currentLanguage", ""); if ("".equals(...
1
11c6fa769fabdf61b2615e2c39e1afcc
3c9f2cfa6f84aeb0b91ab26256ed3d85
Returns the thickness of the laminate
class IL800(object): def thickness(self): thickness = self.comm('CHKTHICKNESS') return float(thickness)
1
eca651c5c5b5156f504c4a9549d9e3db
950c9f39b1a818f2d38039581e52c107
Stop OpenCL backend
public abstract class JOCLAbstractTest protected final void shutdownCL() { if (commandQueue != null) { clReleaseCommandQueue(commandQueue); } }
1
5469bb63b95b759ba9e2c0a2237dbb8b
9ed083c5a1618f74650196ed84c2f156
Setup the Permissions plugin.
final class PERM private function setup_actions() { add_action( 'plugins_loaded', array( $this, 'i18n' ), 2 ); register_activation_hook( __FILE__, array( $this, 'activation' ) ); add_shortcode( 'perm-form', array( $this, 'render_perm_form' ) ); }
1
da6cbc2c56dd761e5d31f20e0548518c
ca6d4f310c8be895b73a95c0d2b841ac
设置底部栏点击的监听回调
public class TopBar extends RelativeLayout public void setOnTopbarClickListener(topbarClickListener mListener) { this.mListener = mListener; }
0
3f9c3988dc90917e80975120267589fe
f356b3a235799179a9bf828c9a10d659
Extracts the movement onsets and offsets for the current trial
bdata = load_n_remove_missing_trials_2afc_behav(animal, behavSession, ephysSession, tetrode, cluster) eventData = load_event_data(animal, ephysSession) spikeData = load_spike_data(animal, ephysSession, tetrode, cluster) spikeTimestamps = spikeData.timestamps eventOnsetTimes = np.array(eventData.time...
0
38f771ee55fee0d4f84a09bc45c0c8ee
8fa99fc521beeb7a42a6ea042eba575f
! @brief The WSMAN destructor. Frees the memory and resources used by wsman.
{ if (m_wsSvcHostHandle == nullptr) return; CALL_STACK_TRACE; try { Abort(); WsFreeServiceHost(m_wsSvcHostHandle); } catch (IAppException &ex) { Logger::Write(ex, Logger::Priority::PRIO_CRITICAL); } ...
1
21194b0f9c5d1ba2e7ae2a4f695141ea
88cfb309b954f38501159bfbe181e9b3
Generates a new random <see cref="RsaJwk"/>.
namespace Natrium PublicKeyCryptoKeyPair CreateRandomKeyPair();
0
6a91b94467f1ede32e07834633b58b28
d54fce17ffa46144c207c16dc1e83a7a
Retorna la imagen de la escala valor
BufferedImage img = null; System.out.println("resizeImage Antes Mide: "+im.getWidth()+"\t"+im.getHeight()); double widthScale = anchoMaximo / ((double) im.getWidth()); double heightScale = altoMaximo / ((double) im.getHeight()); double scale = (widthScale > heightScale) ? widthSc...
1
85bcc7ea0ec60a31a1571e38c1c328cd
54762cd6fecacc01d55ada560a0abe1e
Show alert is logged.
{ $mock = $this->createPartialMock(SyslogMock::class, ['openlog', 'closelog', 'syslog']); $mock ->expects($this->once()) ->method('syslog') ->with(LOG_ALERT, 'red alert!') ->willReturn(true); SyslogMock::set($mock); $log = new Syslog; ...
1
d7017b65f173c53bf3062ea341c1e387
3a82ddee87f0037bfc0c497dc5e67b42
r""" Get the full path of the log file. Returns: str, the full path of log file.
class Report(Job): def log_path(self): if not hasattr(self, "_log_path"): self._log_path = self.month.log_path() return self._log_path
1
bdab9a22aa7f59de61bcb88190c350d6
57e932bf30df19bc78d7b3664895b480
Draw recognized pointing lines
height, width, _ = image.shape self.vis.draw_line(image, (0, self.y_offset), (width, self.y_offset), (255, 0, 0), thickness) self.vis.draw_line(image, (int(width/2), 0), (int(width/2), height), (0, 0, 255), thickness) if self.left_point: self.vis.draw_point(image, (int(self.l...
1
e1cebd59a3142abc9e3b166a6afd8084
344efdac97e74612a02fcb91ad602377
Return enum symbol given string value. Raises: ValueError: If `string` doesn't correspond to an enum value.
class checked_int_flag_enum(checked_enum_mixin, enum.IntFlag): def parse_string(clazz, s, ignore_case = True): check.check_string(s) check.check_bool(ignore_case) parts = clazz._split_parts(s) result = 0 for part in parts: next_value = clazz.parse_one_string(part, ignore_case) if next_va...
0
19d6d564c8dcbd56f3a2b12b1b97eb45
a3819cf2a5b2a31b4e6b65c3e1b17e8a
Gets a reference to a remote observer.
namespace Mercury.Messaging.Runtime public class RuntimeEnvironment : IDisposable public RemoteRef GetRef(Type agentType, IPEndPoint endPoint, TimeSpan timeout) { return ((IRemoteRouting)this.RoutingEngine).GetRemoteChannel(string.Empty, endPoint, agentType, timeout) as RemoteRef; ...
1
71f0354681a7deebda624e8e771ce2ce
35a5a6ff635cc9c696ed28e2ab7867df
Computes action with maximum probability.
def move_max(state: State, nnet: NNet) -> tuple: policy = nnet.prediction(state)[0] return max(policy, key=policy.get)
1
7c5906cb7667544f18c7e7572ab5ebe1
78bec17fd9bd69eaa922795e51ba9051
Get number of audio streams.
impl File pub fn audio_count(&self) -> u32 { self.header().audiocount }
1
9137256cadda8844a507d8d5544b5fff
8cc85d6095ff5980b83003c61129a9cd
Write a null-terminated string to the current processing context
namespace CPM_VAR_BUFFER_NS void VarBuffer::writeNullTermString(const char* str) { size_t stringLength = std::strlen(str); while (mSerializer->getOffset() + stringLength + 1 > mBufferSize) { resize(); } mSerializer->writeNullTermString(str); }
1
d318d8a8b7e210c2ad24b3fb5e1601f3
ce7a21990ab2d2eb7c1304ddccf7753f
Gets the current namespace handler.
public class ProjectHelper2 extends ProjectHelper public static class RootHandler extends DefaultHandler public AntHandler getCurrentAntHandler() { return currentHandler; }
0
d41638f7b0f09d4eacff0a32d2476446
6d84cb7a04c46d140d03d618c828189e
単語の文字列による順序の比較を行う。
public class Word implements Comparable<Word> @Override public int compareTo(Word o) { return word.compareTo(o.word); }
1
5554d2329689bf3d11f794e5a9ab1916
4f7ea5bf9db5c5ed7ebb0fb1e975a188
Starts the completion timer.
public class ProgressCalculator extends javax.swing.JFrame public void startCompletedHoursTimer() { Timer timer = new Timer(); timer.schedule(new TimerTask(){ @Override public void run() { hours.setCompletedHoursError(""); } }, 2*1000); }
1
dbb0da63a7c72949261da89a5bb69850
ecd50e127092f75d5f603778c42d9259
Method to sign out of GForge.
namespace HP.ScalableTest.Plugin.GeniusBytesPullPrinting public class GeniusBytesPullPrintManager : PullPrintManager protected void SignOut() { try { DateTime startTime = DateTime.Now; _geniusBytesApp.SignOut(); OnTimeStatusUpdate("Sign...
0
6fe52ac087d3c01a2dcfbe4963372c43
30b9ed8d35cf6b65a7077e832b3048a1
changes encoding on a shapefile (the only provider supporting setEncoding)
shapefile = ogr.Open(shapefile_path) if shapefile is not None: layer = shapefile.GetLayer(0).GetSpatialRef() if layer is not None: return layer.ExportToProj4() return False
0
28fbeb754815beaff69803d52d2a3816
e15710716a847c3830ed64318b78c5c9
테이블 스페이스 삭제
if (tableSpace != null && tableSpace.length() > 0) { this.tableSpace = "on " + tableSpace.trim(); } else { this.tableSpace = ""; } }
0
225045eee073febcda4e1d8a057eab12
04fa8dfd8f47a2442ae2419459acc770
InitializeConditions for UnitDelay: '<S30>/UnitDelay'
void I_backCalc_fixdt_Init(DW_I_backCalc_fixdt *localDW, int32_T rtp_yInit) { localDW->UnitDelay_DSTATE_m = rtp_yInit; }
1
4d2c8e08ce17d9bace06b93d5347407d
e30ce7a4ce3af2820f96fa0f01aea5a5
通过yaml str解析出route定义
class Laryr public function getRoutesFromYaml() { $routesFromYaml = Yaml::parse(file_get_contents($this->path)); return $routesFromYaml; }
1
2d65f8c49f63270b63365184c6d2ce42
c51a77811597e73cebf77bc46492ea11
Will not bubble up any errors in opening devices or traversing the directory. Instead returns
func TestHostDevicesOSReadDirFailure(t *testing.T) { testError := fmt.Errorf("test error: %w", os.ErrPermission) osReadDir = func(dirname string) ([]os.DirEntry, error) { return nil, testError } usernsRunningInUserNS = func() bool { return false } defer cleanupTest() _, err := HostDevices() if !errors.Is(er...
0
fa8a027a6bb56e64db205da1c90088f6
10783f092c2c0bbf78e19633aab24ff4
Converts the given number of milliseconds to the corresponding timespan object.
namespace Flumen public static class TimeSpanExtensions public static TimeSpan Millisecond(this int value) => TimeSpan.FromMilliseconds(value);
1
eedc6938464fd095cbd0e3db8d08f1a2
52aa933a2efb488787f4a07e6b217f49
Print the room allocation at Dojo to file.
class TestDojo(unittest.TestCase): def test_if_you_can_print_allocations_to_file(self): self.dojo.create_room("Voi", "OFFICE") self.dojo.add_person("Martin", "Katami", "STAFF", "N") self.assertEqual(self.dojo.print_allocations( "data.txt"), "operation sucessful")
1
03d3d6f68046a411ea9ea0cfe7aaf1f0
f115afa5582498647afdeae46bf24b45
Gets a list of all badges in the application
var temp = new List<Badge> (from b in dbManager.Table<Badge> () select b); return temp; }
1
069818dbc38df1384e317df31d55ac4c
1e6d8d3e1af2a6c9acfbc8571caf311c
Add an unweighted node to this graph.
class UWGraph(): def add_node(self, x): if x == None: return self.inner.setdefault(x, [])
1
6af0fd8dbec2f9dfbc1d1761ee3b97a2
37f91654f3924c8a6286cc39f9877fba
Returns a <code>java.util.Map</code> containing <code>ServiceErrorID</code> and corresponding <code>java.util.Collection</code> of <code>ErrorHandlingAction</code>s that may be taken when an exception occurs
Object getExceptionHandlers();
1
5c0f4e717825d3f6655dca7ca74107e1
f0331ecabbed2e02e1fcf1edda63ce7f
Gets the The number of boosters to deliver to user.
class TradingCard extends Game implements InputFilterAwareInterface public function getBoosterDrawQuantity() { return $this->boosterDrawQuantity; }
1
51c6adf3163e2222034e2d264e2c9bf4
d25e50ad5d63e7c28d05cbaf8cdd8b5e
Deleting the property resets it to the default value
namespace JetBlack.MessageBus.Common.ComponentModel public class CustomPropertyDescriptor : PropertyDescriptor public override void ResetValue(object component) { SetValue(component, GetAttribute<DefaultValueAttribute>(AttributeArray).Value); }
1
ea82a47396681f367ecad2d865d574a7
733bae9b8ca6cf7569bae7d2ee60f99a
Returns :data:`True` if the host returned a single ping, and :data:`False` otherwise.
curtime = time.time() self._setup("PING", 'ping', self.host, self.port) if not self.result: self.server_ping_time = time.time() - curtime if self.result: self.server_id = '' self.server_caps = '' self.server_ping_time = 0.0 self...
1
b52f5472edb41bd40412ae838c2600d2
5b67d3da5d17e1978a604621fbcf5c10
Extract the student records from the given text file.
List<Students> getStudentsList(String filePath) throws IOException;
1
065ec849ce6e3cf6ae4eabf678661bce
d5f2cc0394bf16b77e25145a615f3d0e
converts a string to a decimal representation of the time
static struct SS convertdotnametotime_t(char * p) { struct SS s; s.t = 0; pc = &s.c[0]; s.tm.tm_year = convert_n( (p+0),2); if (s.tm.tm_year < 0) return s; if (s.tm.tm_year == 20) return s; s.tm.tm_year += (2000 - 1900) ; s.tm.tm_mon = convert_n( (p+2),2); s.tm.tm_mon -= 1; if (s.tm.tm_mon < 0) return...
1
c8d924233bf612fa25c2bab8e8126a5c
e913360064a329a80741ffd0f5524bd6
监控代码是否到达了某类的某一行
protected static bool isClassLine(string codeLine) { int startIndex = findFirstSubstr(codeLine, " class ", 0, true); if (startIndex < 0) { return false; } return true; }
0
50739d1c7c80f122157ac5cf2885c23d
ced3c5b5eab9275d2c7f678f54b67dc4
生成文本消息格式
{ $tpl = <<<EOT <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[%s]]></Content> </xml> EOT; return sprintf($tpl, $from_name, $to_name, time(), $content); }
1
5305c931d83dd3c29a3ee7aa2ca856e5
7408737597f7b8f2d81c439c8dfbaa5f
Ejecutar un procedimiento almacenado que retorna un listado
namespace BoletasAlpha.Dal IList<T2> ExecuteReader<T2>(string procedureName, IList<SqlParameter> listParameters = null);
1
e6d156834a3014c9ab54d6790031e149
3459d9601eaead48b2bcb41cc4f245b3
Test the property 'Lastappointment'
namespace Jacrys.AthenaSharp.Test [TestFixture] public class PatientTests [Test] public void LastappointmentTest() { }
1
8673127a76f7d4944d167fbce4f5013d
04b61b3636f8c8c0de7d4b9f78915037
Called once before draw(). This function is intended to initialize background color. (ex. backgroundColor = defaultColor; in UIButton) Override and implement this function if the component has default colors.
public class VComponentAdapter implements VComponent public void paintBackground2D(Graphics2D g2){ }
0
9389f5f472c8d193bb663fce56946799
01723eb2f113b94a96a321828937450a
Отображение списка моих мастер-классов
class MyClassController extends ClassBaseController public function myClassAction(Request $request){ $conditions['myClass'] = "joined"; list($list, $paginator) = $this->groupService->paginate($request, $conditions); return $this->render("my-class:my-class", compact('paginator', 'list')); }
1
e6b0ae2b33452d78d4251a8ed88b6802
aa43fe932869bf77124957937b4e0195
리플레이가 시작될 때 호출
public class Replay void Start () { }
1
e55b7787877a8222459d54456889accd
3c7aa2e6e95ea4a7f8ca03725c5f712c
convert an entire UTF-8 string into a Unicode string buffer
{ int bytes = 0; while ( *unicodeString ) { bytes += appendUnicodeToUtf8String(*unicodeString, utf8); unicodeString++; } return bytes; }
0
43d4e67c669709f45ef79f5d91db0ac9
c0c6f0e2dc1d316781e6fbc8144147e4
This unit test is to validate the functionality of Get Device channel Tests.
str_input = 'Group0/Node0/Dev0' exp_group = 'Group0' exp_node = 'Node0' exp_device = 'Dev0' self.run_init_test(str_input, exp_group, exp_node, exp_device)
0
58beb8ad1e4ec2a456e64623c49bb447
87408b2cd9a3d7d3d4af5a3cc9489ce7
国土数値情報データのN03(行政区域関連)のファイル(geojson)から、 指定した都道府県、都市のデータを抜き出してファイル(geojson)に出力
path, fieldname, filename, exportCleaned=False, fieldNames=["LANDYADDRESSPOINT", " NAME ", "PHOTOURL"]): d = gpd.read_file(path, crs='epsg:4326') d.Description = d.Description.str.replace(r"<[^>]*>", "") d['LON'] = d.geometry.x d['LAT'] = d.geometry.y d['geometry'] = [shapely.wkb.loa...
0
feaff730b603cef1ab38f7f3ccf0189f
99eece8850787b514cea9f458ee1f00f
Creates new slides binded to slider entity also creates image files with different size
const thumbnailNames = imageNames.slice(1, nbThumbnail + 1); let url = ''; let divToAdd = null; thumbnailNames.forEach((imageName, i) => { url = path + imageName; divToAdd = utils.createDivImage(url, 'img'); thumbnailsContainer.insertAdjacentElement('beforeend', divToAdd); ...
0
63d58415938e9a742fd7ca3db8f0bee0
58536656e9f1a60c30f647ea008681b0
Transforms a Factory Schema into a basic information factory object
def isablfy(obj): if isinstance(obj, dict): if obj.get("model_name") == "Experiment": factory = Experiment elif obj.get("model_name") == "Analysis" or "wait_time" in obj: factory = Analysis elif obj.get("model_name") == "Assembly": factory = Assembly ...
1
3494eff488558d41d3a02c8e4a1d1fc6
c05fbe2b8b8e0b266b4857e04652e2c2
Averigua si se ha modificado la libreta tras ser cargada.
public class TrustedCertificates public boolean isChanged() { return this.changed; }
1
ff453c3ceb6a77e62e8cf8c0fb1d8d7e
8a3a24ae9a9d648fb5db93306529e0cb
Whether the layout of this item (to layout the children) is valid.
namespace ConsoleForms void ValidateLayout();
1
02a4fd34607e1a77cbd94e2adf61f16d
cb82041057b895a1d9093073d5b4f724
This should be called before saving changes to a Group instance, so that the GroupHistory entries contain all previous states, while the Group entry contain the current state. XXX TODO: Call this directly from Group.save()
public function preSaveAll(bool $group_inserts_together=false): void;
1
e0d3898e3e56674240f0f5a4e3ba7374
5874671dd08d7a8bf0e727a709c9693b
Dos departamentos son iguales cuando coinciden sus identificadores
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MstDepartment other = (MstDepartment) obj; if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(ot...
1
b288f8e270b8dca0fbb0e8cb29c058d1
65bc6d69d3317293e9d7e1136534c56a
Checks whether the colliding object should be hurt by the DWGO.
namespace EGS public abstract class AColliderDWGO : ADynamicWGO protected virtual void Hurt(Collision collision, IHealth health, int magnitude) { health.Hurt(magnitude); }
0
894772754bf73e054634fa92b19a72e5
915fce514b84921291866cb2ca01a3f1
获得Rbill数据集合,可以通过辅助工具Assist进行条件查询,如果没有条件则传入null
public <T extends RpBill> List<T> getRpBillList(@Param(value="begDate")Date begDate,@Param(value="endDate")Date endDate,@Param(value="direct")Integer direct);
0
b7be873cbbda62a871a9e39f097a2687
f3fa603b28ee59f8c4770a1c44aa63cb
## Function that converts data frames into tbl_df
nested_list_to_tibble <- function(.list, col_names = "col_") { data_raw <- tibble::enframe(unlist(.list)) n_cols_max <- data_raw %>% dplyr::pull(name) %>% stringr::str_split("\\.") %>% purrr::map_dbl(length) %>% max() nms_sep <- paste0(col_names, 1:n_cols_max) data_sep <- data_raw %>% ...
0
b522c2b50749ce535029b14c93ad4c45
f43b6529cf12ababbc31a343e37ce40f
Extract interesting bits of the state out of a figure
class BasicQlearnAgent(Agent): def featureExtractor (self, gsTuple): tup = gsTuple features = {} features['x'], features['y'] = tup[0], tup[1] features['1/x'], features['1/y'] = 1.0 / (abs(tup[0]) + 1.0), (1.0/ (abs(tup[1]) + 1.0)) actionFlags = tup[2] for elem in self.actions: if actionFlags & elem.valu...
1
ca23f674c79803dadf722d779b0067f4
9b39fc7cb96606213898d46d15062f0b
Check for new messages in all chats for current user, if so, then show buble with a count of new messages
var functionString = '{"i":"proofForNewMessages"}'; callChatctlWithSuccess(functionString,function(response){ if(response.length > 0){ for(var i=0;i<response.length;i++){ var cid = response[i]['cid']; $(".status").each(function () { var cid...
0
fc640fe0bca23bedda7e73aa007f6d2f
e4daa8b59d58f065c94a0bb3640e17a7
Determines the center position of the node's shape. The position depends on if the node has in and out-annotations.
label_centers = [] node_connectors = [] if len(inout): sep_connectors = [[]] sep_i = 0 for value in inout: if value[0] != SEPARATOR: sep_connectors[sep_i].append(value) else: sep_i += 1 sep_connectors.append([]) ...
1
e7081286ea175fe5591c35a446f9e0e7
3df99720626e9b2b3e8bf4abad15067a
This function gets the user's date variable, validates it, and returns it back to the calling function.
int get_date(int use) { string number = ""; unsigned found1 = 0; if (use == 1) { do { getline (cin, number); found1 = number.find_first_not_of ("1234567890", 0); if (found1 != 4294967295 || atoi(number.c_str()) < 1 || atoi(number.c_str()) > 12) { cout << "That is not a valid entry. Pleas...
1
3c9686544fad300fd521144a522525ef
ac57c9a32b460485f7cb5d0d507f1500
Sort in reverse chronological order.
function sortMostRecentFirst(a, b) { return b.since - a.since; }
1