query_id
string
corpus_id
string
query
string
code
string
label
int64
58500a99cc6a8d1a2d7727e36a78a273
cbf9a0ba8df9c67e540262dbe183707d
Get 独享集群到期时间。
public class HostItem extends AbstractModel{ public String getExpiredTime() { return this.ExpiredTime; }
1
24cd803e9c7c9e650cd3a30dd28764dd
c5088ef6f66921584a78485c60d1bb6e
Automatically produces units
switch (units) { case "fluid": units = "fluid ounces"; break; case "inch": units = "inches"; break; case "foot": units = "feet"; break; } if (!units.endsWith("s") && !units.equals("inches") && !units.equals("feet") && !units.equ...
1
7e249bed28da552816542e121bbf561b
a51ab54d76b4b55e9153591cf4193dce
Function that attempts to connect the PS2 console in devices
int serial_tryconnect(char *device_name) { #if !defined(__MINGW32__) g_device_port = open(device_name, O_RDWR); if (g_device_port < 0) { return 0; } close(g_device_port); #else g_hdevices = CreateFile(device_name, GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); if (g_hdevices == INVALID_HANDLE_VALUE) { ...
0
e2840095bb4e233737675e51b0f45fcd
f70ce50f50d22e27878c8324c1be730d
Initializes the group user permission persistence.
this.ctx = ctx; this.grp = grp; this.log = ctx.logger(getClass()); if (grp.affinityNode()) { ctx.database().checkpointReadLock(); try { initDataStructures(); } finally { ctx.database().checkpointReadUnlock();...
0
8f3265def61b528ce0ac2fa6d33f34bb
7a7efa873fd751f2754cef419d8fcd11
Parameter "skip" means an object which will be ignored when tracing the ray. Sometimes, a ray begins at an object in the scene, then this object should not be considered when finding intersection. "skip" being null means that it begins at the eye position
rgb[0] = 0; rgb[1] = 0; rgb[2] = 0; RayIntersection closest = null; for (GraphicalObject object : scene.getObjects()) { RayIntersection intersection = object.findClosestRayIntersection(ray); if (intersection == null) { continue; } if (closest == null || intersection.getDistance() < closest.get...
0
b617169e429930cd43c59508b7e1b27b
f117bd2a791e38f0fb869874f53d4c94
Loads a ``".npy"`` file.
def load_np_array(file_path): with open(file_path, 'rb') as f: return np.load(f)
1
654e5aa6ff77643fa649eacf908fdc4c
8561bddf7bb92d68f99faf9c7481e43d
Returns an object that allows assigning values to slices and aggregating them by indices
def slices_by_ixs(*, zero_factory: ZF = None, zero_test: ZT = None) -> by_ixs.Aggregator[V]: return by_ixs.Aggregator( dual=ixs_by_slices(zero_factory=zero_factory, zero_test=zero_test), zero_factory=zero_factory, )
1
ea820b4b5700b41ae351853c5fa991ee
ae637ee9221bee6013e5dbb58c875d07
Sets the robot's turning speed.
class DriveTrain: def setTurnSpeedDivisor(self, speedDivisor): self._turnSpeedDivisor = speedDivisor
1
92133df8bbf6274dc713bf69866ff2a6
26d50fb3931cc845f747801e3cca18c9
Getter of a Theory Classroom Object by its name
public class ClassroomSet private TheoryClassroom getTheoryClassroom (String name) { return theoryClassroomSet.get(name); }
1
77e16ab066b18128a1efcf2359538682
0691a533e3ffa3f6f3e5451a066e7279
Нахождение точки в нарисованной области (основная СК) @relative
{ int x = Convert.ToInt32(b.PixelWidth * (TrueW - ConerSqrHalfBoder) / TrueW); int y = Convert.ToInt32(b.PixelHeight * (TrueH - ConerSqrHalfBoder) / TrueH); return new Point(x, y); }
1
70ec2891068cc59983d45969d2f0bf1f
644249598603fb0bd2d548f1d52fc5cb
List holdings Use this endpoint to read all holdings associated with a specific user.
class AggregationAccountApi def get_aggregation_account_holding_all_using_get(opts = {}) data, _status_code, _headers = get_aggregation_account_holding_all_using_get_with_http_info(opts) data end
1
593f990def2ec8f7a717667b07454162
8722172e6667d88fd38d6e77d7853d33
Tests a draw. Simulates playing 14 pieces without winning by using reflection. Plays the last two pieces. Should end in a draw.
public class GameTest extends TestCase public void testDrawRep() throws ChessParseError { Game game = new Game(null, 0, 0, 0); assertEquals(false, game.haveDrawOffer()); game.processString("Nc3"); game.processString("Nc6"); game.processString("Nb1"); game.processString("N...
0
d4b33a00155fd909daeddd0ef224cf28
b792c12109429b6fa3b1005147e0f224
Gets the fully qualified name of the class containing the module's actual implementation. By definition, this is the same value returned by {@code createModule().getDelegateObject().getClass().getName()}, and hence is also the class containing any callback methods specified by {@link ModuleItem#getCallback()}. <p> The ...
public RubyModule getImplementationClass() { return implementationClass; }
0
8f8710115296581c96250f3d4a84d39d
9256c396fa21a041c80a6c8000f2eb16
Send an asynchronous break signal to the target process. This is only valid if the target is actually running...
impl RuntimeErrorInfo pub fn notify_target(&self, process_handle: HANDLE) -> Result<()> { process::write_memory(process_handle, self.pbDebuggerPresent as PVOID, &1u8) }
0
8fb530aa1a84cd4ba11f766d03a2de19
e6497208ce27adbbd987b914b0b36e0c
返回当前纪元中指定年份的月数。
public class TimeUtils public static class Lunar public static int leapMonth(int year) { return (int) (lunarInfo[year - MIN_YEAR] & 0xf); }
0
a500bdc22a91e831f87da1448719b365
cbfa76803b1c43aabc2ed9487118e1fa
Цена без скидки.
final class PriceCalculatorResult public function getBasePrice(): float { return $this->basePrice; }
1
18d84ac9205ae4766471660abb31e0ff
d84a357d609e12318508d9da8167c4b6
function that checks if a user exists or enrolled for a course
string waste; ifstream in; in.open("Database/Class/" + newTurn.myClass + ".txt"); while (in >> newTurn.username) { in >> newTurn.status; in.ignore(); getline(in, newTurn.name); in >> newTurn.studentId >> newTurn.gender >> newTurn.dob.day >> newTurn.dob.month >> newTurn.dob.year >> newTurn.numberOfCourse; ...
1
b0371d64a8a25d482ffff0f0ff12774e
016126817f24ad8804494a835f0ad0aa
If the player was DJ-ing, remove them.
class RadioController extends Controller public function kickOffDj(Request $request) { $user = $request->get('auth'); $currentDjId = $this->myRadioService->kickCurrentDj(); Logger::staff($user->userId, $request->ip(), LogType::KICKED_DJ_OFF, [], $currentDjId); return response()->json(); ...
1
41711b402c143107435e6ed48ba9b7b3
79dbcd1c63852a427cad03a85567f17d
현재 점에서 pt점 까지 선 긋기
{ EntityPack* pack = view.entityPack(); if ( pack == nullptr ) { assert(0); return; } if ( pack->scene() == nullptr ) return; if (isPt_) { isPt_ = false; Vector2F delta(pt_, pt); UpdateLock l; RefColSelection& selected = GObjectPool::instance().selected(); for (i...
0
4fc42b572df149a241ceead6804b08bc
2db4d1f4078d4af865ee06e630ea6ed8
Manage the mash heater. Initial version, just check temperature.
{ if ( desired_temperature > this->max_temp ) { desired_temperature = this->max_temp; } float last_target_temperature = target_temperature; target_temperature = desired_temperature; if (desired_temperature <= 0.0F) { heater.set((this->o = 0)); } else if (last_target_temperature <...
1
15ae401688f4dfa57ab75059e1d7e712
bf9a7370af9b1910bfdca89be398dad2
If current user's roles don't allow it to use the control, disable it
namespace Streamline.SmartClient.UI public partial class UserControls_MedicationOrderDetails : BaseActivityPage public string enableDisabled(Permissions per) { if (((Streamline.BaseLayer.StreamlinePrinciple)Context.User).HasPermission(per)) return ""; else ...
1
7078bf51e6b52f24ca6efb42cca31c76
e23d166a9268ed50ab01b24413f7c997
Verifica se consegue transformar uma lista de entidade em dto Inderetamente testa o ObterDTO
public void shouldMapToAmazonCardDtoList(){ List<AmazonCard> amazonCardList = new ArrayList<>(); AmazonCard amazonCard = new AmazonCard(); amazonCard.setId(1L); amazonCard.setBytes(null); amazonCard.setTranslation("test"); amazonCardList.add(amazonCard); List<...
1
b394bfbd73acf4b60481abbf05ce77f5
0a49cbccf69e2cbd75dd4924b3df424d
从一个数据集合中从后向前找到第一个匹配的元素。
public class UtilsFunctionPackage public Object findFirstMatch(Collection<?> source, Collection<?> candidates) { return CollectionUtils.findFirstMatch(source, candidates); }
0
c47836087c33105f9952f03d23204e5b
ebcf7f220a39e69191786812519e3de1
Добавить результат поиска организации на карту.
val lat = resultData.getDouble(GeocoderIntentService.RESULT_LAT, 0.0) val lng = resultData.getDouble(GeocoderIntentService.RESULT_LNG, 0.0) latLng = LatLng(lat, lng) if (lat != 0.0 || lng != 0.0) { val address = resultData.getString(GeocoderIntentService.RESULT_ADDRESS, "") ...
1
5adc63754a9531ef9513b2713530f751
cfa0f567ddbc2fdaeb2b82f4b4199c7e
Special case for fixing some broken return types in the metadata
class Ethna_SOAP_Util public static function fixRetval(&$retval) { $retval['errorcode'] = VAR_TYPE_INT; $retval['errormessage'] = VAR_TYPE_STRING; }
1
fd90da3de100a14dc56dbd17572e6a68
ac1510fae624c15d55595de3e30f71bb
Returns the path to the Subversion binary.
software_release_root_path = os.path.join( self._cls.slap._software_root, hashlib.md5(self._cls.getSoftwareURL().encode()).hexdigest(), ) return os.path.join(software_release_root_path, 'bin', 'caucase')
0
8981bb2e95bfb1f03065f559d2d3028a
421b17ec2870ca34cf72999fb36fef9a
Displays the final note at the top of the page to the user This note indicated whether or not the checkout was successful and may contain additional instructions depending on the particular store.
abstract class StoreCheckoutFinalPage extends StoreCheckoutPage abstract protected function displayFinalNote(StoreOrder $order);
1
f7a8d3c1fb33c848f4a0544c1f92a5e4
9cda1b00dcf7022dcd70e21e8168c49e
Register our custom block category.
class Electro_Elementor_Brands_Carousel_Block extends Widget_Base public function get_categories() { return [ 'electro-elements' ]; }
1
9e925b451ba608caf6f36755257d2bac
d8a534296d8a63382cbf4cd52d963642
動画の画質を変更した時に呼ばれる
public class GameManager : MonoBehaviour public void OnValueChanged(int val) { switch (val) { case 0: QualitySettings.vSyncCount = 1; break; case 1: QualitySettings.vSyncCount = 0; break; } }
0
6739a1104f23ec6e205b09fcb85206bb
b0fff8899c4dc203e1e376126b1e0d83
Listen when the upload has failed.
public void onError(int id, Exception e) { Log.e(TAG, "Error during upload: " + id, e); updateList(); }
1
0353752df01e0fdfdc686013bb72eae8
39e960b99185c4a7f81b7178bafbadac
Initialize hci passwords from a passwords configuration file
{ CFG__SFT *profile_fd; char profile_stanza[PROFILE_STANZA_SIZE]; char temp_string[300]; if(*p_profile == NULL) { *p_profile = htxd_create_profile(); } sprintf(temp_string, "%s/%s", global_htx_home_dir, HTX_PROFILE); profile_fd = htxd_open_profile(temp_string); if( (profile_fd != (CFG__SFT *)NULL) && (cfgc...
0
0aa3a1bab7ce0ebe9d21a305aa1de441
737067fab182665822f7ef29cef8f69b
增加一条工作票安全措施明细记录
public class WorkticketSafetyAction extends AbstractAction public void getSafetyDetail() throws JSONException { PageObject result = remote.findSafetyDetailList( Constants.ENTERPRISE_CODE, workticketNo, safetyCode); write(JSONUtil.serialize(result)); }
0
effe1bef618865d13ad92c19caf99e30
5e82aaf975b862361ba9dfafe386fbb6
Store the access token and refresh token provided from a successful call to the OAuth server.
{ Config.OAuth2AccessToken = response.AccessToken; this.ExpiresInDuration = TimeSpan.FromSeconds(response.ExpiresInSeconds.GetValueOrDefault()); if (extractRefreshToken) { Config.OAuth2RefreshToken = response.RefreshToken; ...
1
c7ecd50dfcf45d6c4768188afd1087ec
d551d3ec1f6ccc3c7d3eab302c446a0e
Delete all Clan invites sent to a specific User.
public function removeAll($userId);
1
cb2ac47e10332a8e89e30d40b20e3609
e11c3d84f5b297bfaaca796fefd711f2
Obtain metadata for named object, with retries and timeout
public function getMetadata(string $objectName) { return $this->obs->getObjectMetadata([ 'Bucket' => $this->bucket, 'Key' => $objectName, ]); }
0
65ec6caf035158f129286bca95fbe0fa
a0247d8d9da02392e9967b528a103cca
Stores functions to be used for given key values of a MongoDb collection entry
return (function(req,res) { var paramHash = {}; paramHash.apiKey = req.param("key"); paramHash.cmd = req.param("cmd"); paramHash.onComplete = function(resultData) { if ( resultData !== undefined ) { res.send(resultData.toString()); } else { res.send(""); } }; dbfnc(paramHash); }); }
0
d1ac4fae4887ac3f143c1f5fa73ed1d3
d05c4a4c109e7697d326156558debf54
create Notes table for our database
public class DatabaseHandler extends SQLiteOpenHelper public int createNote(String title, String type) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(NOTE_TITLE, title); values.put(NOTE_TYPE, type); Time now = new Time(); now.setToNow(); values.pu...
0
260babe501ae00ec3f4d31469643d7bf
c5c5b4c59d14ef115f2005e554bf3ad2
Récupération du nombre de caractères écrits pour le nom d'équipement
name = self.name if name is None: return 0 return len(name)
1
ed2cdf63219ebd0e0973563f35fc38b8
188cb9d804fcd539c6fddc7630b6b0c1
Test generation of Grid graph
number = 30 G = nx.Graph() pos = {} for i in range(1, number+1): col = ((i-1) % 10) + 1 if ((i-1) // 10) % 2 == 0 else 10 - (i-1) % 10 row = i // 10 if i % 10 != 0 else i // 10 - 1 pos[i] = [col, row] nodes = [] edges = [] for i in range(1, number+1): nodes.ap...
1
5a3074c213825972df5233fc8957ecd6
e14c4080a4cf4d4c3e88edde5320b534
Return visibility attribute of obj
class Analysis(object): def visibility(self): return self._visibility
1
8415c1530f806a72fbc1b080a39e1005
2772a3016455b59d0d74435a0ce3d2c1
Pytest hook that get called after the Session object has been created and before performing collection and entering the run test loop.
class Shell(ShellInterface): def beforeSession(self) -> None: pass
0
a561309715855fe19e3c6f39790c3e82
20e42041b8084500727037914cf29896
Set submission file for this paper.
import("file.PaperFileManager"); $paperFileManager = new PaperFileManager($this->paperId); $paperDao =& DAORegistry::getDAO('PaperDAO'); if ($paperFileManager->uploadError($fileName)) return false; if ($paperFileManager->uploadedFileExists($fileName)) { $submissionFileId = $paperFileManager->uploadSubmissi...
1
d63328897a3102e76fe17040b79e0cc0
4add2b93feafa84bfcff75792961b46b
根据菜单KEY从 redis获取当前登录用户拥有特定数据对象的权限值
Set<Object> permsSet = redisUtil.sGet(permissionKey(id)); if (permsSet.isEmpty()) { List<String> permsList = roleService.getPermissionByAdminId(id); System.out.println(permsList); List<MenuEntity> menuList = menuDao.getHadCodeByKeys(permsList); System.out....
1
46f7a6ec0fed8e768bb8d4d490ae5e3f
2c6a1d638596f079040c697b7326795f
Set the flag to tell whether or not to display images in binary mode
abstract public class ApsDvsChip extends AETemporalConstastRetina abstract public void setShowImageHistogram(boolean yes);
0
bc58dab0cd2648d5428282e71854a56b
a9d7b28aff317173cf7e3b626696cf4c
Initialize members of the order queue.
static void InitQueue(void) { uint8_t i; mQueue.head = 0; mQueue.tail = 0; for(i=0; i<mMaxQueueEntries_c; i++) { mQueue.opLine[i].opQueue = (operation_t)mEmptyQueue_c; mQueue.opLine[i].lineQueue = mEmptyQueue_c; } }
1
11153e9a4aca0af08a7fc2813d53ee83
81ce0c89bea618943d5fb0ef49952706
function to read the temperature from the DS1631
unsigned int ReadTemperature(void) { unsigned char a=0; unsigned char b=0; unsigned int t=0; float tt=0; Init_DS18B20(); WriteOneChar(0xCC); WriteOneChar(0x44); Delay_DS18B20(20); Init_DS18B20(); WriteOneChar(0xCC); WriteOneChar(0xBE); a=ReadOneChar(); b=ReadOneChar(); ...
0
3202e01f04fdc7b983cc973269d9c9d1
e1d29ac7626f69b0f53fe746849171b6
判断是否該顯示點擊列表按鈕(將顯所有的tab的寬度與實際面板的寬度做比較)author wxy
var checkedboxwidth = $('#' + elementids.checkedselector).css('width') return !!(checkedboxwidth == '20px') }
0
a0c59a397938953faaaded992a3421a9
c3bd90f43f24a70ca7f4c4c5073a0b53
Converts the source string into a secure string.
namespace Microsoft.SqlServer.Management.HadrModel public static class StringExtensionMethods public static SecureString StringToSecureString(this string unsecureString) { return CharArrayToSecureString(unsecureString.ToCharArray()); }
1
87effb5bb60e5ed5955c01407dc22054
1a8423be7b87b5c59bcb92fa81930c94
Call paxos algorithm for acceptor to handle accept message
class Node: def handle_accept(self, msg): self.create_instance(msg.proposal.instance).handle_accept(msg)
1
8571004a00288b51e12fc3cb84f8b493
84a1d9abf14290be0935aef57240f9c7
Sets lists of slot positions for both input and output tubes on the input rack.
namespace Tomcat.ConfigurationDataStore public static class RackConfigurations public static CommonResult SetOutputRackSlotPositions(Lane lane, List<RobotArmLocation> slotLocations) { try { if (_outputRackDataStoreIDs.ContainsKey(lane)) { ...
0
a1df3c82925488bc037452b7186cfdab
1365a23601a89a9921de9ebf49b93905
Set if vert.x should use pooled buffers for performance reasons. Doing so will give the best throughput but may need a bit higher memory footprint. Keyword arguments:
JedisPoolingClientConfigurationBuilder usePooling();
0
b9929055507b2233193f8862fb9ae63d
220817a57b6738e9d9404626d7d0c940
mainHandler tracks how many times each user has visited this page.
def visitor_cookie_handler(request, response): visits = int(request.COOKIES.get('visits', '1'))
1
591c6b1e7a3d8f136bc841c2867072f4
952b5b0e54d666bd560d46b90af3a4e9
Реализация декоратора репит
print("Начинаем") def wrapper(self, *args, **kwargs): wrapper.count += 1 rez = func(self, *args, **kwargs) print(f"# Итерация {wrapper.count} записана...") return rez wrapper.count = 0 return wrapper
1
cc781ee18c276d86237865f7182ecd24
367b88bfcfd08e2e51f6a2a91f89dc49
Spec that describes the output of `get_initial_state` in the SavedModel. This may differ from the original policy if `use_nest_path_signatures` was enabled. Returns: A nest of specs.
class Algorithm(AlgorithmInterface): def rollout_state_spec(self): return self._rollout_state_spec
0
e65a7af2fb152f3846623ffc4067d287
f5da6be86db208eac48dc224c5394016
对原始密码加salt之后进行加密
public String encode(CharSequence rawPassword) { String rawSalt = UserHelper.decodeSalt(salt); return UserHelper.encoderPassword(rawPassword.toString(), rawSalt); }
1
06e90010b9b35a3b5d7d829479b08dd2
661000238dc31f6c7ab3656e60fc8b3b
функция для вывода результата в консоль
function DisplayResult(){ alert("Ваш результат" + result + " из " + (number+1)); }
0
fffe8784b1e59276add760b3fb740ca9
6a010922fbbad60d40895c0599fb2bb1
清除app页面选择的商品数据
clearHomeStorage() { wx.removeStorageSync('selectGoods') wx.removeStorageSync('money') wx.removeStorageSync('unPaidOrder') wx.removeStorageSync('remark') }
1
be58ff7186e4e0ab0ea6878184633cdd
33b0bd32124a08bbe5479b412dfd97ac
マウスのX/Y座標からDepthを算出
class Kinect(): def depthOf(self,x,y): world_coord = [x,y,1] camera_coord = np.matmul(self.convert_to_cam, world_coord) print "depthOf" print camera_coord cam_Z = self.currentDepthFrame[int(camera_coord[1])][int(camera_coord[0])] return self.worldHeight - 0.1236 * 1000 * ...
1
72e04481a9fc1d695e048b3d8780eefc
6a38268287c95da257a8aadef9bf2cc6
This turns AMD-module-style files into ES6 modules.
try { const { node } = path; exports_1.replaceExports(node, path); } catch (err) { console.log(err); } }
0
31a7835440447b4d3d85051c7fe014d4
7bc5c87a2663a3b9029b924d4710dc56
轉換為yyyy/MM/dd
{ string strReturn; string[] strArrParameter; char[] splitter = { '/' }; strArrParameter = strDDMMYYYY.Split(splitter); strReturn = strArrParameter[0].ToString() + "-" + ShortDDMonth(strArrParameter[1].ToString()) + "-" + strArrParameter[2].To...
0
21650272c224843f975a8a600e78ff29
2c4039d2efd3553efdc16fa237dd5a2a
Generate a food block of a given size to be placed randomly in the world.
def gen_food(arr, x_size, y_size): (x, y) = random.choice(arr) food_height = FOOD_SIZE food_width = FOOD_SIZE while (x > x_size - food_width) or (y > y_size - food_height): arr.remove((x, y)) x, y = random.choice(arr) return rectangle(ANTHILL_SIZE, (x, y))
1
0941ff273908701045ed791a1f313174
8153cccd6431c9e62593479f4afecad6
Returns a single image, stacking characters as necessary depending on the form of the input
{ int width = 0; int height = 0; var lineMeasurements = new List<int>(); foreach (char character in input) { if (character != '\n') { var characterInfo = this.FirstOrDefault(storedCharacterInfo => storedCharacterInfo.Character == character); if (char...
1
cd9da82ec19070a0027a0ab0a99ebe10
47afe690a8d7d5d4d04d0853bfb39968
Checks if Pod already completed
return func() (bool, error) { pod, err := c.CoreV1().Pods(namespace).Get(context.Background(), podName, metav1.GetOptions{}) if err != nil { return false, err } switch pod.Status.Phase { case v1.PodRunning, v1.PodSucceeded: return true, nil case v1.PodFailed: return false, nil } return false, ...
1
7169594f6997f5ab210bd14ba62b507e
d49f154cd608423d7a8ff7e07959146a
Filter the query based on a rank in the list
@Service public class RankingService public CollectionModel<EntityModel<Ranking>> filterByPlayers(List<String> player, int page, int size) { Pageable paging = PageRequest.of(page, size); Page<Ranking> pageDate; pageDate = repository.findByPlayerInIgnoreCase(player, paging); if (pageDate.isEmpty()) { throw n...
0
defd2ba7965f1d5ee66972b176c51170
489b0fc6d536749fec760f0a7ba94ae8
Max-product belief propagation until convergence.
class LoopyBPInference(object): def decode(self): beliefs = self.unary_messages.copy() for f, (var_i, var_j, pert_radius) in enumerate(self.edge_factors): beliefs[var_j] += self.lat_messages[0, f] beliefs[var_i] += self.lat_messages[1, f] assignments = np.zeros((self.n_po...
0
6375b38d7f5f6cb6b6880a938b75e449
ad3e7a2bd9e32e42f37d412c3739e74c
Reload the data for this subscription from the API.
public function refreshFromApi(): PlanContract;
1
de322d948996372f85a44ce47ef58cf5
cfa5a20f64c3f0fc933918633adc555a
文件夹创建监听事件
try { if (e.ChangeType == WatcherChangeTypes.Created) { Console.WriteLine(e.FullPath); if (File.GetAttributes(e.FullPath) == FileAttributes.Directory) { Console.WriteLine("发送到redis:" + _path); RedisHelper...
1
8634ec780e9ba15b62c9d198cdf50a93
461c98a0d1a70375cefaa2eb6690d894
Checks if the parameter value is greater than lowerBound.
if not isinstance(self._lower_bound, DistributionBoundary): raise TypeError('_lower_bound attribute must be of type ' 'DistributionBoundary') if self._lower_bound.inclusive: return np.greater_equal(y, self._lower_bound.value) else: ...
1
1e34af92827500f53be9b8eb08e96090
05d5b8651ccc7ae5d23f49c4c45ba1f6
Remove enemy at a specific position
function Enemy(type, enemyImgElement, initSpeedVector) function enemyRemoveFunction( enemy) { gameArea.removeChild(enemy.imgElement); enemy.imgElement = null; var i = enemiesArray.indexOf(enemy); enemiesArray.splice(i, 1); }
0
779bd30554ac93d44c0e0ebce33f9f91
65180a1c2e8fc31ac0e78e2a1cc67667
Sum reduces a tensor, summing the specified axes.
def sum(x, axis=None, keepdims=False): axis = normalize_axis(axis, ndim(x)) return tf.reduce_sum(x, reduction_indices=axis, keep_dims=keepdims)
1
385e5f658a2aedc81dca78367e6b0736
81b8d9537856de6ace182defbc0ba8a2
Converts a PDF file into an array of image bytes.
public class ConvertDocumentApi public com.squareup.okhttp.Call convertDocumentPdfToPngArrayAsync(File inputFile, final ApiCallback<PdfToPngResult> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestLi...
1
4633cfbd7bbb31712e7ae334c284dacc
6046c80b270f23db8f1d187e80b40370
פונקציה בוליאנית לבדוק האם אנחנו בטווח הנכון של הלוח ולא חורגים ממנו
bool in_area(int hor, int col, int x, int y) { if((x >= 0 && x <= hor) && (y >= 0 && y <= col)) { return true; } return false; }
1
d6011c520a96f83a9a2b72773f398511
3dec7c791a6bf7123f0e2e1c9ee92b36
The process should not be killed when it is not the original saved
class SignalHandlerTest(TestCase): def test_signal_handler_parent_proc(self): self.loop._running = True self.loop._signal_handler(signal.SIGHUP, None) self.assertFalse(self.loop._running) self.loop._signal_handler(signal.SIGHUP, None)
0
2c7a094333e7f98666e939e06efb93d1
06749bde4835da2c5d9b8a1fe67da85f
+1 size for bias
class MultiLayerPerceptron(ClassifierMixin): def __init__(self, n_input, n_hidden, n_output): self.n_input = n_input + 1 self.n_hidden = n_hidden self.n_output = n_output self.ai = np.ones(self.n_input)
1
e5ce0e79af4d6238f9d4671f2d3e4fc3
b007888b0103b8f141511fc259a87b16
Create an instance of {@link Ejecutar.ITRCONSUDATOSACTRNI.TRCONSUDATOSACEVTY.ACACP }
@XmlRegistry public class ObjectFactory public Ejecutar.ITRPEALTACOMPLEMPRTR.TRPEALTACOMPLEMPREVT createEjecutarITRPEALTACOMPLEMPRTRTRPEALTACOMPLEMPREVT() { return new Ejecutar.ITRPEALTACOMPLEMPRTR.TRPEALTACOMPLEMPREVT(); }
0
f6e0d3fd6647b01ea6963ed56eef6a2a
2dcc41b75d206234854c1f5f297fac43
Establece el nuevo tipoUsuario que se pasa por par�metro
try { setUserType(new Integer(userType).intValue()); } catch (Exception e) { setUserTypeError(INTNULL, e, ERROR_SYSTEM); } return userTypeError; }
0
65af781c2679351abd2e874530c56b3e
4491340231700ea7640f1e8a25d8a0e0
Delete an option from a multiselect widget.
function _deleteOption(select, objId) { Array.from(select.options).forEach(option => { if (option.value === objId) { option.remove(); } }); select.dispatchEvent( new Event("change", { bubbles: true, cancelable: true }) ); }
1
2023057eaeefad1e28230fa9090df5ae
520b54b8948cfa15907cfe1c228a3745
парсим считанное выражение в польскуй обратную запись
namespace ООКП_7_final class Notation : Counting protected List<string> ConvertToPol() { polnotation = new List<string>(); Stack<string> operations = new Stack<string>(); for (int i = 0; i < separated.Count; i++) { if (GetPriorityAlg(separate...
1
8876c892557e0fbd1688c1b6f8bcc606
4d7a600f966dd575dcb7e52c9e3f174d
画像のアップロードが有効だった場合、ランダムなファイル名を返す。そうでなければ''を返す
rand_name = "#{rand(10000000)}" if FileTest.exist?(rand_name) rand_name = get_temp_filename end return rand_name end
0
d57790b985f49e8797ed10be24fb41f5
f7b8ca5f3605e66273028a45c1fbf6bf
根据bookid去bookdetail表中查询bookdetail的所有信息
def detail(request,bid): book=BookInfo.objects.get(id=bid) heros=book.heroinfo_set.all() return render(request,'booktest/detail.html',{'book':book,'heros':heros})
0
5f48985187eef7bfaf072ab8bcaf5475
b36f0d16a94c88f479a789a515e43a70
Redirect to login page
class Eco_System extends CI_Controller protected function goto_login_page(){ header('Location: ' . DOC_ROOT . 'signin'); }
1
fd14b7d1bb23c7933aa8925951631141
36e75a875dca3ad8607fec2ffa421bf9
Delete company branch from the grid.
{ $this->findModel($id)->delete(); $this->deletePhotos($id, 'Branch'); if (!Yii::$app->request->isAjax) { return $this->redirect(['index']); } }
1
014145c15a96234fa21bac55d170cf91
b71bc19a43acc5b80ec4ddac6fa7e44c
グリッドの幅と高さを指定してダンジョン生成
this.setMaxWH(7, 10); this.curSelectGrid = null; this.clearAllGrids(); this.graphics.clear(); for (let v of this.metaMap) { if (v.length > this.maxX) { this.maxX = v.length; } } this.maxY = this.metaMap.length; this....
1
d12440d4c7cf0ac1ad18e4d0a9567351
c3f017331580361dd515e288c4188738
Esta clase representa la operacion DATE_PART
this.son11 = new Date(); console.log(this.son11); this.diasemana =this.son11.getDay(); this.diacomparar = this.datePipe.transform(this.son11, 'yyyy-MM-dd'); this.son11 = this.datePipe.transform(this.son11, 'h:mm a'); }
0
050beb157617905359b5f81a1a0c4858
d47714eb1f998cd5db672f2a1b7d5754
Sets the previewType This sets the type of preview that shows up on the task. The possible values are: automatic, noPreview, checklist, description, reference. When set to automatic the displayed preview is chosen by the app viewing the task.
try : self._previewlength = previewlength except Exception as e: raise e
0
e1a2e8119a8e21995341971bdef7d616
37f921553cb3f4b6c0476983513b28cd
保存论坛详情
if (ForumList.ForumModel.Title == "") { alert("请输入帖子标题"); return false; } if (ForumList.ForumModel.Content == "") { alert("请输入帖子内容"); return false; } var forum = { Id: ForumList.ForumModel.Id, TypeId: ForumList.ForumModel.TypeId, Bid: ForumList...
1
d8c9a5d9f2f104c1b6de43b727df7bfb
9f64128ac2f3a3a066181c320df3ef1f
is_polis_installed
function ajan_is_install() { return ! ajan_get_db_version_raw(); }
0
5919a912d08f55476bbcd31c33505b3a
4a9248a4d435ccc0901aa8820dedac0c
Return the number of spikes in the training set data (only consider ROI)
times = spike_train.times spike_idc = set() for idx in range(1,len(spike_train)-1): if (times[idx] - times[idx-1]) < 60 * pq.ms: spike_idc.add(idx) for idx in range(len(spike_train)-2,-1,-1): if (times[idx+1] - times[idx]) < 60 * pq.ms: spike_idc.add(idx) retu...
0
bfc5fc3b0a6017c2997db53c958b42a7
d6515099ebdeb294e3cccd821a66a9bb
Count occurrences of a letter in a sentence, then print out number of occurrences.
{ int lowerCaseCounter = 0; int upperCaseCounter = 0; for (int i = 0; i < inString.Length; i++) { if (inString[i].ToString() == letter.ToString().ToUpper()) { upperCaseCounter++; } ...
1
d4790f0504c1fecf9860bcd7ebe090df
40d1127399bcd9c1da2fab9f5bb8d0e0
Interrupt a waiting reader and put the slot into an error state.
impl Drop for Writer fn drop(&mut self) { self.inner.closed.store(true, Ordering::SeqCst); self.inner.reader.wake(); }
0
b22ca54e2c57957ca9f4498549a52161
cc1bb9fe7e3fb6261034b3aace575858
PowerDNS requires all space-delimited sets of TXT records to be quoted ensure last segment has terminating quotes
{ var txtRecordData = new List<byte>(); int incr; for (var i = 0; i < txtRecordString.Length && txtRecordData.Count < DnssdTxtRecord.MaxTxtRecordDataLength; i += incr) { if (txtRecordString[i] != '\\' || i + 1 == txtRecordString.Length) ...
0
5accdaedc2bc99c2841295ef07e0f9d8
4088c9e045f28986f4e063cb390d765a
Receives a list of raw tokens and returns tokens of letters only.
sent = filter(lambda t: not is_punct(t[0]), sent) sent = map(lambda t: (t[0].lower(), t[1]), sent) return list(sent)
0
ad68d8bd5f8d8e18ec6ee78742c3a350
3c25df94b9f3d14d079d89e627bb5c8b
NewSolanaChainResource returns a new SolanaChainResource for chain.
if provider == nil { return nil, errors.Errorf("Fabric network client provider is not set.") } i := new(installChaincodeClient) i.FabricNetworkClientProvider = provider i.chaincodeID = chaincodeID i.chaincodeVersion = chaincodeVersion i.chaincodePath = chaincodePath return i, nil }
0
743d0eec61d71e4462dcf1d8484d1d37
3e82308075ab37424f481ceb40f2bd21
Тип базы данных => PHP тип
class CAdvancedArBehavior extends CActiveRecordBehavior public static function getDbType($value) { if (is_numeric($value) && floor($value) == $value) { return 'INT(11)'; } if (is_numeric($value)) { return 'DOUBLE'; } if (strlen($value) <= 255) { ...
0
f4f961a64b8c574955ac90a7306e8678
09f0e9e191520486a28425f0ec625df2
Comapre two streams containing OpenXml docs
XmlComparerSettings? settings = null) { var xDocument1Root = xDocument1.Root; var xDocument2Root = xDocument2.Root; if (xDocument1Root is null && xDocument2Root is null) { return; } else if (xDocument1Root is nul...
0
d43985960daed11e050e7d617bd9a09d
1083ba754bef05f8884514b13b355eb6
@brief Get Egress Pipe Delay Correction.
U8 drvr_get_ed() { hal_register_write(RG_PHY_ED_LEVEL, 0); delay_us(140); return hal_register_read(RG_PHY_ED_LEVEL); }
1
455b970afc4a73d9735f18710a1384ad
4c82b04727b67eb4668484c3e63b01be
Called on server after a scene load with ServerChangeScene() is completed.
public class SimpleTownNetwork : NetworkManager public override void OnServerSceneChanged(string sceneName) { }
1
b22886cd2a03e881cb6f6b66b305050e
1a6fc5964dda5a61f180417850912ef6
Returns log data for later printing
def get_log_file(): with open('logfile.txt', 'r') as f: return f.readlines()
1
17e21551a16f2a75eea29eac1c6c9dd1
7abfe23cee91be4f47d3ffde1fd6168e
======================================= | Calculate the year to date figures | =======================================
def yearOverYearCalculation(dataFrame,dropM13): print('yearoveryear') yearOverYear = [] dataFrame = dataFrame.sort_values(by=["period","year"]) for i in range(0,len(dataFrame)): yearOverYear.append("") dataFrame.insert(3,"yearOverYear",yearOverYear,True) grouped = dataFrame.groupby("seri...
0
38cb9373c9e9c81f8b8a211505adc9e5
5115e9d555f819b8b312505d95c2f8a8
Returns the amount of matches won by the computer.
public class MCTSTreeNode public int getCompWins() { return compWins; }
1