Best JavaScript code snippet using fast-check-monorepo
LineService-remote
Source:LineService-remote
1#!/usr/bin/env python2#3# Autogenerated by Thrift Compiler (0.9.3)4#5# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING6#7# options string: py8#9import sys10import pprint11from urlparse import urlparse12from thrift.transport import TTransport13from thrift.transport import TSocket14from thrift.transport import TSSLSocket15from thrift.transport import THttpClient16from thrift.protocol import TBinaryProtocol17from line import LineService18from line.ttypes import *19if len(sys.argv) <= 1 or sys.argv[1] == '--help':20 print('')21 print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]')22 print('')23 print('Functions:')24 print(' RSAKey getRSAKey()')25 print(' void notifyEmailConfirmationResult( parameterMap)')26 print(' string registerVirtualAccount(string locale, string encryptedVirtualUserId, string encryptedPassword)')27 print(' void requestVirtualAccountPasswordChange(string virtualMid, string encryptedVirtualUserId, string encryptedOldPassword, string encryptedNewPassword)')28 print(' void requestVirtualAccountPasswordSet(string virtualMid, string encryptedVirtualUserId, string encryptedNewPassword)')29 print(' void unregisterVirtualAccount(string virtualMid)')30 print(' UserAgeType checkUserAge(CarrierCode carrier, string sessionId, string verifier, i32 standardAge)')31 print(' AgeCheckDocomoResult checkUserAgeWithDocomo(string openIdRedirectUrl, i32 standardAge, string verifier)')32 print(' string retrieveOpenIdAuthUrlWithDocomo()')33 print(' AgeCheckRequestResult retrieveRequestToken(CarrierCode carrier)')34 print(' void addBuddyMember(string requestId, string userMid)')35 print(' void addBuddyMembers(string requestId, userMids)')36 print(' void blockBuddyMember(string requestId, string mid)')37 print(' commitSendMessagesToAll( requestIdList)')38 print(' commitSendMessagesToMids( requestIdList, mids)')39 print(' bool containsBuddyMember(string requestId, string userMid)')40 print(' string downloadMessageContent(string requestId, string messageId)')41 print(' string downloadMessageContentPreview(string requestId, string messageId)')42 print(' string downloadProfileImage(string requestId)')43 print(' string downloadProfileImagePreview(string requestId)')44 print(' i64 getActiveMemberCountByBuddyMid(string buddyMid)')45 print(' getActiveMemberMidsByBuddyMid(string buddyMid)')46 print(' getAllBuddyMembers()')47 print(' getBlockedBuddyMembers()')48 print(' i64 getBlockerCountByBuddyMid(string buddyMid)')49 print(' BuddyDetail getBuddyDetailByMid(string buddyMid)')50 print(' BuddyProfile getBuddyProfile()')51 print(' Ticket getContactTicket()')52 print(' i64 getMemberCountByBuddyMid(string buddyMid)')53 print(' SendBuddyMessageResult getSendBuddyMessageResult(string sendBuddyMessageRequestId)')54 print(' SetBuddyOnAirResult getSetBuddyOnAirResult(string setBuddyOnAirRequestId)')55 print(' UpdateBuddyProfileResult getUpdateBuddyProfileResult(string updateBuddyProfileRequestId)')56 print(' bool isBuddyOnAirByMid(string buddyMid)')57 print(' string linkAndSendBuddyContentMessageToAllAsync(string requestId, Message msg, string sourceContentId)')58 print(' SendBuddyMessageResult linkAndSendBuddyContentMessageToMids(string requestId, Message msg, string sourceContentId, mids)')59 print(' void notifyBuddyBlocked(string buddyMid, string blockerMid)')60 print(' void notifyBuddyUnblocked(string buddyMid, string blockerMid)')61 print(' string registerBuddy(string buddyId, string searchId, string displayName, string statusMeessage, string picture, settings)')62 print(' string registerBuddyAdmin(string buddyId, string searchId, string displayName, string statusMessage, string picture)')63 print(' string reissueContactTicket(i64 expirationTime, i32 maxUseCount)')64 print(' void removeBuddyMember(string requestId, string userMid)')65 print(' void removeBuddyMembers(string requestId, userMids)')66 print(' SendBuddyMessageResult sendBuddyContentMessageToAll(string requestId, Message msg, string content)')67 print(' string sendBuddyContentMessageToAllAsync(string requestId, Message msg, string content)')68 print(' SendBuddyMessageResult sendBuddyContentMessageToMids(string requestId, Message msg, string content, mids)')69 print(' string sendBuddyContentMessageToMidsAsync(string requestId, Message msg, string content, mids)')70 print(' SendBuddyMessageResult sendBuddyMessageToAll(string requestId, Message msg)')71 print(' string sendBuddyMessageToAllAsync(string requestId, Message msg)')72 print(' SendBuddyMessageResult sendBuddyMessageToMids(string requestId, Message msg, mids)')73 print(' string sendBuddyMessageToMidsAsync(string requestId, Message msg, mids)')74 print(' void sendIndividualEventToAllAsync(string requestId, string buddyMid, NotificationStatus notificationStatus)')75 print(' SetBuddyOnAirResult setBuddyOnAir(string requestId, bool onAir)')76 print(' string setBuddyOnAirAsync(string requestId, bool onAir)')77 print(' SendBuddyMessageResult storeMessage(string requestId, BuddyMessageRequest messageRequest)')78 print(' void unblockBuddyMember(string requestId, string mid)')79 print(' void unregisterBuddy(string requestId)')80 print(' void unregisterBuddyAdmin(string requestId)')81 print(' void updateBuddyAdminProfileAttribute(string requestId, attributes)')82 print(' void updateBuddyAdminProfileImage(string requestId, string picture)')83 print(' UpdateBuddyProfileResult updateBuddyProfileAttributes(string requestId, attributes)')84 print(' string updateBuddyProfileAttributesAsync(string requestId, attributes)')85 print(' UpdateBuddyProfileResult updateBuddyProfileImage(string requestId, string image)')86 print(' string updateBuddyProfileImageAsync(string requestId, string image)')87 print(' void updateBuddySearchId(string requestId, string searchId)')88 print(' void updateBuddySettings( settings)')89 print(' string uploadBuddyContent(ContentType contentType, string content)')90 print(' findBuddyContactsByQuery(string language, string country, string query, i32 fromIndex, i32 count, BuddySearchRequestSource requestSource)')91 print(' getBuddyContacts(string language, string country, string classification, i32 fromIndex, i32 count)')92 print(' BuddyDetail getBuddyDetail(string buddyMid)')93 print(' BuddyOnAir getBuddyOnAir(string buddyMid)')94 print(' getCountriesHavingBuddy()')95 print(' getNewlyReleasedBuddyIds(string country)')96 print(' BuddyBanner getPopularBuddyBanner(string language, string country, ApplicationType applicationType, string resourceSpecification)')97 print(' getPopularBuddyLists(string language, string country)')98 print(' getPromotedBuddyContacts(string language, string country)')99 print(' i64 activeBuddySubscriberCount()')100 print(' void addOperationForChannel(OpType opType, string param1, string param2, string param3)')101 print(' i64 displayBuddySubscriberCount()')102 print(' Contact findContactByUseridWithoutAbuseBlockForChannel(string userid)')103 print(' getAllContactIdsForChannel()')104 print(' getCompactContacts(i64 lastModifiedTimestamp)')105 print(' getContactsForChannel( ids)')106 print(' string getDisplayName(string mid)')107 print(' getFavoriteMidsForChannel()')108 print(' getFriendMids()')109 print(' getGroupMemberMids(string groupId)')110 print(' getGroupsForChannel( groupIds)')111 print(' IdentityCredential getIdentityCredential()')112 print(' getJoinedGroupIdsForChannel()')113 print(' MetaProfile getMetaProfile()')114 print(' string getMid()')115 print(' SimpleChannelClient getPrimaryClientForChannel()')116 print(' Profile getProfileForChannel()')117 print(' getSimpleChannelContacts( ids)')118 print(' string getUserCountryForBilling(string country, string remoteIp)')119 print(' i64 getUserCreateTime()')120 print(' getUserIdentities()')121 print(' string getUserLanguage()')122 print(' getUserMidsWhoAddedMe()')123 print(' bool isGroupMember(string groupId)')124 print(' bool isInContact(string mid)')125 print(' string registerChannelCP(string cpId, string registerPassword)')126 print(' void removeNotificationStatus(NotificationStatus notificationStatus)')127 print(' Message sendMessageForChannel(Message message)')128 print(' void sendPinCodeOperation(string verifier)')129 print(' void updateProfileAttributeForChannel(ProfileAttribute profileAttribute, string value)')130 print(' ChannelToken approveChannelAndIssueChannelToken(string channelId)')131 print(' string approveChannelAndIssueRequestToken(string channelId, string otpId)')132 print(' NotificationFetchResult fetchNotificationItems(i64 localRev)')133 print(' ApprovedChannelInfos getApprovedChannels(i64 lastSynced, string locale)')134 print(' ChannelInfo getChannelInfo(string channelId, string locale)')135 print(' ChannelNotificationSetting getChannelNotificationSetting(string channelId, string locale)')136 print(' getChannelNotificationSettings(string locale)')137 print(' ChannelInfos getChannels(i64 lastSynced, string locale)')138 print(' ChannelDomains getDomains(i64 lastSynced)')139 print(' FriendChannelMatricesResponse getFriendChannelMatrices( channelIds)')140 print(' i32 getNotificationBadgeCount(i64 localRev)')141 print(' ChannelToken issueChannelToken(string channelId)')142 print(' string issueRequestToken(string channelId, string otpId)')143 print(' RequestTokenResponse issueRequestTokenWithAuthScheme(string channelId, string otpId, authScheme, string returnUrl)')144 print(' string reserveCoinUse(CoinUseReservation request, string locale)')145 print(' void revokeChannel(string channelId)')146 print(' ChannelSyncDatas syncChannelData(i64 lastSynced, string locale)')147 print(' void updateChannelNotificationSetting( setting)')148 print(' MessageOperations fetchMessageOperations(i64 localRevision, i64 lastOpTimestamp, i32 count)')149 print(' LastReadMessageIds getLastReadMessageIds(string chatId)')150 print(' multiGetLastReadMessageIds( chatIds)')151 print(' void buyCoinProduct(PaymentReservation paymentReservation)')152 print(' void buyFreeProduct(string receiverMid, string productId, i32 messageTemplate, string language, string country, i64 packageId)')153 print(' void buyMustbuyProduct(string receiverMid, string productId, i32 messageTemplate, string language, string country, i64 packageId, string serialNumber)')154 print(' void checkCanReceivePresent(string recipientMid, i64 packageId, string language, string country)')155 print(' ProductList getActivePurchases(i64 start, i32 size, string language, string country)')156 print(' ProductSimpleList getActivePurchaseVersions(i64 start, i32 size, string language, string country)')157 print(' getCoinProducts(PaymentType appStoreCode, string country, string language)')158 print(' getCoinProductsByPgCode(PaymentType appStoreCode, PaymentPgType pgCode, string country, string language)')159 print(' CoinHistoryResult getCoinPurchaseHistory(CoinHistoryCondition request)')160 print(' CoinHistoryResult getCoinUseAndRefundHistory(CoinHistoryCondition request)')161 print(' ProductList getDownloads(i64 start, i32 size, string language, string country)')162 print(' ProductList getEventPackages(i64 start, i32 size, string language, string country)')163 print(' ProductList getNewlyReleasedPackages(i64 start, i32 size, string language, string country)')164 print(' ProductList getPopularPackages(i64 start, i32 size, string language, string country)')165 print(' ProductList getPresentsReceived(i64 start, i32 size, string language, string country)')166 print(' ProductList getPresentsSent(i64 start, i32 size, string language, string country)')167 print(' Product getProduct(i64 packageID, string language, string country)')168 print(' ProductList getProductList( productIdList, string language, string country)')169 print(' ProductList getProductListWithCarrier( productIdList, string language, string country, string carrierCode)')170 print(' Product getProductWithCarrier(i64 packageID, string language, string country, string carrierCode)')171 print(' ProductList getPurchaseHistory(i64 start, i32 size, string language, string country)')172 print(' Coin getTotalBalance(PaymentType appStoreCode)')173 print(' i64 notifyDownloaded(i64 packageId, string language)')174 print(' PaymentReservationResult reserveCoinPurchase(CoinPurchaseReservation request)')175 print(' PaymentReservationResult reservePayment(PaymentReservation paymentReservation)')176 print(' SnsFriends getSnsFriends(SnsIdType snsIdType, string snsAccessToken, i32 startIdx, i32 limit)')177 print(' SnsProfile getSnsMyProfile(SnsIdType snsIdType, string snsAccessToken)')178 print(' void postSnsInvitationMessage(SnsIdType snsIdType, string snsAccessToken, string toSnsUserId)')179 print(' void acceptGroupInvitation(i32 reqSeq, string groupId)')180 print(' void acceptGroupInvitationByTicket(i32 reqSeq, string groupId, string ticketId)')181 print(' void acceptProximityMatches(string sessionId, ids)')182 print(' acquireCallRoute(string to)')183 print(' string acquireCallTicket(string to)')184 print(' string acquireEncryptedAccessToken(FeatureType featureType)')185 print(' string addSnsId(SnsIdType snsIdType, string snsAccessToken)')186 print(' void blockContact(i32 reqSeq, string id)')187 print(' void blockRecommendation(i32 reqSeq, string id)')188 print(' void cancelGroupInvitation(i32 reqSeq, string groupId, contactIds)')189 print(' VerificationSessionData changeVerificationMethod(string sessionId, VerificationMethod method)')190 print(' void clearIdentityCredential()')191 print(' void clearMessageBox(string channelId, string messageBoxId)')192 print(' void closeProximityMatch(string sessionId)')193 print(' commitSendMessage(i32 seq, string messageId, receiverMids)')194 print(' commitSendMessages(i32 seq, messageIds, receiverMids)')195 print(' commitUpdateProfile(i32 seq, attrs, receiverMids)')196 print(' void confirmEmail(string verifier, string pinCode)')197 print(' Group createGroup(i32 seq, string name, contactIds)')198 print(' string createQrcodeBase64Image(string url, string characterSet, i32 imageSize, i32 x, i32 y, i32 width, i32 height)')199 print(' Room createRoom(i32 reqSeq, contactIds)')200 print(' string createSession()')201 print(' fetchAnnouncements(i32 lastFetchedIndex)')202 print(' fetchMessages(i64 localTs, i32 count)')203 print(' fetchOperations(i64 localRev, i32 count)')204 print(' fetchOps(i64 localRev, i32 count, i64 globalRev, i64 individualRev)')205 print(' findAndAddContactsByEmail(i32 reqSeq, emails)')206 print(' findAndAddContactsByMid(i32 reqSeq, string mid)')207 print(' findAndAddContactsByPhone(i32 reqSeq, phones)')208 print(' findAndAddContactsByUserid(i32 reqSeq, string userid)')209 print(' Contact findContactByUserid(string userid)')210 print(' Contact findContactByUserTicket(string ticketId)')211 print(' Group findGroupByTicket(string ticketId)')212 print(' findContactsByEmail( emails)')213 print(' findContactsByPhone( phones)')214 print(' SnsIdUserStatus findSnsIdUserStatus(SnsIdType snsIdType, string snsAccessToken, string udidHash)')215 print(' void finishUpdateVerification(string sessionId)')216 print(' Ticket generateUserTicket(i64 expirationTime, i32 maxUseCount)')217 print(' getAcceptedProximityMatches(string sessionId)')218 print(' getActiveBuddySubscriberIds()')219 print(' getAllContactIds()')220 print(' AuthQrcode getAuthQrcode(bool keepLoggedIn, string systemName)')221 print(' getBlockedContactIds()')222 print(' getBlockedContactIdsByRange(i32 start, i32 count)')223 print(' getBlockedRecommendationIds()')224 print(' getBuddyBlockerIds()')225 print(' Geolocation getBuddyLocation(string mid, i32 index)')226 print(' getCompactContactsModifiedSince(i64 timestamp)')227 print(' Group getCompactGroup(string groupId)')228 print(' Room getCompactRoom(string roomId)')229 print(' Contact getContact(string id)')230 print(' getContacts( ids)')231 print(' string getCountryWithRequestIp()')232 print(' string getRecentFriendRequests()')233 print(' getFavoriteMids()')234 print(' Group getGroup(string groupId)')235 print(' getGroupIdsInvited()')236 print(' getGroupIdsJoined()')237 print(' getGroups( groupIds)')238 print(' getHiddenContactMids()')239 print(' string getIdentityIdentifier()')240 print(' i32 getLastAnnouncementIndex()')241 print(' i64 getLastOpRevision()')242 print(' TMessageBox getMessageBox(string channelId, string messageBoxId, i32 lastMessagesCount)')243 print(' TMessageBoxWrapUp getMessageBoxCompactWrapUp(string mid)')244 print(' TMessageBoxWrapUpResponse getMessageBoxCompactWrapUpList(i32 start, i32 messageBoxCount)')245 print(' getMessageBoxList(string channelId, i32 lastMessagesCount)')246 print(' getMessageBoxListByStatus(string channelId, i32 lastMessagesCount, i32 status)')247 print(' TMessageBoxWrapUp getMessageBoxWrapUp(string mid)')248 print(' TMessageBoxWrapUpResponse getMessageBoxWrapUpList(i32 start, i32 messageBoxCount)')249 print(' getMessagesBySequenceNumber(string channelId, string messageBoxId, i64 startSeq, i64 endSeq)')250 print(' getNextMessages(string messageBoxId, i64 startSeq, i32 messagesCount)')251 print(' getNotificationPolicy(CarrierCode carrier)')252 print(' getPreviousMessages(string messageBoxId, i64 endSeq, i32 messagesCount)')253 print(' Profile getProfile()')254 print(' ProximityMatchCandidateResult getProximityMatchCandidateList(string sessionId)')255 print(' getProximityMatchCandidates(string sessionId)')256 print(' getRecentMessages(string messageBoxId, i32 messagesCount)')257 print(' getRecommendationIds()')258 print(' Room getRoom(string roomId)')259 print(' RSAKey getRSAKeyInfo(IdentityProvider provider)')260 print(' i64 getServerTime()')261 print(' getSessions()')262 print(' Settings getSettings()')263 print(' Settings getSettingsAttributes(i32 attrBitset)')264 print(' SystemConfiguration getSystemConfiguration()')265 print(' Ticket getUserTicket()')266 print(' WapInvitation getWapInvitation(string invitationHash)')267 print(' void invalidateUserTicket()')268 print(' void inviteFriendsBySms( phoneNumberList)')269 print(' void inviteIntoGroup(i32 reqSeq, string groupId, contactIds)')270 print(' void inviteIntoRoom(i32 reqSeq, string roomId, contactIds)')271 print(' void inviteViaEmail(i32 reqSeq, string email, string name)')272 print(' bool isIdentityIdentifierAvailable(IdentityProvider provider, string identifier)')273 print(' bool isUseridAvailable(string userid)')274 print(' void kickoutFromGroup(i32 reqSeq, string groupId, contactIds)')275 print(' void leaveGroup(i32 reqSeq, string groupId)')276 print(' void leaveRoom(i32 reqSeq, string roomId)')277 print(' string loginWithIdentityCredential(IdentityProvider identityProvider, string identifier, string password, bool keepLoggedIn, string accessLocation, string systemName, string certificate)')278 print(' LoginResult loginWithIdentityCredentialForCertificate(IdentityProvider identityProvider, string identifier, string password, bool keepLoggedIn, string accessLocation, string systemName, string certificate)')279 print(' string loginWithVerifier(string verifier)')280 print(' LoginResult loginWithVerifierForCerificate(string verifier)')281 print(' LoginResult loginWithVerifierForCertificate(string verifier)')282 print(' LoginResult loginZ(loginRequest LoginRequest)')283 print(' void logout()')284 print(' void logoutSession(string tokenKey)')285 print(' void noop()')286 print(' void notifiedRedirect( paramMap)')287 print(' notifyBuddyOnAir(i32 seq, receiverMids)')288 print(' void notifyIndividualEvent(NotificationStatus notificationStatus, receiverMids)')289 print(' void notifyInstalled(string udidHash, string applicationTypeWithExtensions)')290 print(' void notifyRegistrationComplete(string udidHash, string applicationTypeWithExtensions)')291 print(' void notifySleep(i64 lastRev, i32 badge)')292 print(' void notifyUpdated(i64 lastRev, DeviceInfo deviceInfo)')293 print(' string openProximityMatch(Location location)')294 print(' string registerBuddyUser(string buddyId, string registrarPassword)')295 print(' void registerBuddyUserid(i32 seq, string userid)')296 print(' string registerDevice(string sessionId)')297 print(' string registerDeviceWithIdentityCredential(string sessionId, IdentityProvider provider, string identifier, string verifier)')298 print(' string registerDeviceWithoutPhoneNumber(string region, string udidHash, DeviceInfo deviceInfo)')299 print(' string registerDeviceWithoutPhoneNumberWithIdentityCredential(string region, string udidHash, DeviceInfo deviceInfo, IdentityProvider provider, string identifier, string verifier, string mid)')300 print(' bool registerUserid(i32 reqSeq, string userid)')301 print(' string registerWapDevice(string invitationHash, string guidHash, string email, DeviceInfo deviceInfo)')302 print(' string registerWithExistingSnsIdAndIdentityCredential(IdentityCredential identityCredential, string region, string udidHash, DeviceInfo deviceInfo)')303 print(' RegisterWithSnsIdResult registerWithSnsId(SnsIdType snsIdType, string snsAccessToken, string region, string udidHash, DeviceInfo deviceInfo, string mid)')304 print(' string registerWithSnsIdAndIdentityCredential(SnsIdType snsIdType, string snsAccessToken, IdentityCredential identityCredential, string region, string udidHash, DeviceInfo deviceInfo)')305 print(' string reissueDeviceCredential()')306 print(' string reissueUserTicket(i64 expirationTime, i32 maxUseCount)')307 print(' string reissueGroupTicket(string groupId)')308 print(' void rejectGroupInvitation(i32 reqSeq, string groupId)')309 print(' void releaseSession()')310 print(' void removeAllMessages(i32 seq, string lastMessageId)')311 print(' void removeBuddyLocation(string mid, i32 index)')312 print(' bool removeMessage(string messageId)')313 print(' bool removeMessageFromMyHome(string messageId)')314 print(' string removeSnsId(SnsIdType snsIdType)')315 print(' void report(i64 syncOpRevision, SyncCategory category, string report)')316 print(' reportContacts(i64 syncOpRevision, SyncCategory category, contactReports, SyncActionType actionType)')317 print(' void reportGroups(i64 syncOpRevision, groups)')318 print(' void reportProfile(i64 syncOpRevision, Profile profile)')319 print(' void reportRooms(i64 syncOpRevision, rooms)')320 print(' void reportSettings(i64 syncOpRevision, Settings settings)')321 print(' void reportSpammer(string spammerMid, spammerReasons, spamMessageIds)')322 print(' void requestAccountPasswordReset(IdentityProvider provider, string identifier, string locale)')323 print(' EmailConfirmationSession requestEmailConfirmation(EmailConfirmation emailConfirmation)')324 print(' void requestIdentityUnbind(IdentityProvider provider, string identifier)')325 print(' EmailConfirmationSession resendEmailConfirmation(string verifier)')326 print(' void resendPinCode(string sessionId)')327 print(' void resendPinCodeBySMS(string sessionId)')328 print(' void sendChatChecked(i32 seq, string consumer, string lastMessageId)')329 print(' void sendChatRemoved(i32 seq, string consumer, string lastMessageId)')330 print(' sendContentPreviewUpdated(i32 esq, string messageId, receiverMids)')331 print(' void sendContentReceipt(i32 seq, string consumer, string messageId)')332 print(' void sendDummyPush()')333 print(' Message sendEvent(i32 seq, Message message)')334 print(' Message sendMessage(i32 seq, Message message)')335 print(' void sendMessageIgnored(i32 seq, string consumer, messageIds)')336 print(' void sendMessageReceipt(i32 seq, string consumer, messageIds)')337 print(' Message sendMessageToMyHome(i32 seq, Message message)')338 print(' void setBuddyLocation(string mid, i32 index, Geolocation location)')339 print(' void setIdentityCredential(IdentityProvider provider, string identifier, string verifier)')340 print(' void setNotificationsEnabled(i32 reqSeq, MIDType type, string target, bool enablement)')341 print(' VerificationSessionData startUpdateVerification(string region, CarrierCode carrier, string phone, string udidHash, DeviceInfo deviceInfo, string networkCode, string locale)')342 print(' VerificationSessionData startVerification(string region, CarrierCode carrier, string phone, string udidHash, DeviceInfo deviceInfo, string networkCode, string mid, string locale)')343 print(' void storeUpdateProfileAttribute(i32 seq, ProfileAttribute profileAttribute, string value)')344 print(' syncContactBySnsIds(i32 reqSeq, modifications)')345 print(' syncContacts(i32 reqSeq, localContacts)')346 print(' Message trySendMessage(i32 seq, Message message)')347 print(' void unblockContact(i32 reqSeq, string id)')348 print(' void unblockRecommendation(i32 reqSeq, string id)')349 print(' string unregisterUserAndDevice()')350 print(' void updateApnsDeviceToken(string apnsDeviceToken)')351 print(' void updateBuddySetting(string key, string value)')352 print(' void updateC2DMRegistrationId(string registrationId)')353 print(' void updateContactSetting(i32 reqSeq, string mid, ContactSetting flag, string value)')354 print(' void updateCustomModeSettings(CustomMode customMode, paramMap)')355 print(' void updateDeviceInfo(string deviceUid, DeviceInfo deviceInfo)')356 print(' void updateGroup(i32 reqSeq, Group group)')357 print(' void updateNotificationToken(NotificationType type, string token)')358 print(' void updateNotificationTokenWithBytes(NotificationType type, string token)')359 print(' void updateProfile(i32 reqSeq, Profile profile)')360 print(' void updateProfileAttribute(i32 reqSeq, ProfileAttribute attr, string value)')361 print(' void updateRegion(string region)')362 print(' void updateSettings(i32 reqSeq, Settings settings)')363 print(' i32 updateSettings2(i32 reqSeq, Settings settings)')364 print(' void updateSettingsAttribute(i32 reqSeq, SettingsAttribute attr, string value)')365 print(' i32 updateSettingsAttributes(i32 reqSeq, i32 attrBitset, Settings settings)')366 print(' void verifyIdentityCredential(IdentityProvider identityProvider, string identifier, string password)')367 print(' UserAuthStatus verifyIdentityCredentialWithResult(IdentityCredential identityCredential)')368 print(' VerificationResult verifyPhone(string sessionId, string pinCode, string udidHash)')369 print(' string verifyQrcode(string verifier, string pinCode)')370 print(' void notify(GlobalEvent event)')371 print(' bool inviteIntoGroupCall(string groupId, contactIds)')372 print('')373 sys.exit(0)374pp = pprint.PrettyPrinter(indent = 2)375host = 'localhost'376port = 9090377uri = ''378framed = False379ssl = False380http = False381argi = 1382if sys.argv[argi] == '-h':383 parts = sys.argv[argi+1].split(':')384 host = parts[0]385 if len(parts) > 1:386 port = int(parts[1])387 argi += 2388if sys.argv[argi] == '-u':389 url = urlparse(sys.argv[argi+1])390 parts = url[1].split(':')391 host = parts[0]392 if len(parts) > 1:393 port = int(parts[1])394 else:395 port = 80396 uri = url[2]397 if url[4]:398 uri += '?%s' % url[4]399 http = True400 argi += 2401if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':402 framed = True403 argi += 1404if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':405 ssl = True406 argi += 1407cmd = sys.argv[argi]408args = sys.argv[argi+1:]409if http:410 transport = THttpClient.THttpClient(host, port, uri)411else:412 socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else TSocket.TSocket(host, port)413 if framed:414 transport = TTransport.TFramedTransport(socket)415 else:416 transport = TTransport.TBufferedTransport(socket)417protocol = TBinaryProtocol.TBinaryProtocol(transport)418client = LineService.Client(protocol)419transport.open()420if cmd == 'getRSAKey':421 if len(args) != 0:422 print('getRSAKey requires 0 args')423 sys.exit(1)424 pp.pprint(client.getRSAKey())425elif cmd == 'notifyEmailConfirmationResult':426 if len(args) != 1:427 print('notifyEmailConfirmationResult requires 1 args')428 sys.exit(1)429 pp.pprint(client.notifyEmailConfirmationResult(eval(args[0]),))430elif cmd == 'registerVirtualAccount':431 if len(args) != 3:432 print('registerVirtualAccount requires 3 args')433 sys.exit(1)434 pp.pprint(client.registerVirtualAccount(args[0],args[1],args[2],))435elif cmd == 'requestVirtualAccountPasswordChange':436 if len(args) != 4:437 print('requestVirtualAccountPasswordChange requires 4 args')438 sys.exit(1)439 pp.pprint(client.requestVirtualAccountPasswordChange(args[0],args[1],args[2],args[3],))440elif cmd == 'requestVirtualAccountPasswordSet':441 if len(args) != 3:442 print('requestVirtualAccountPasswordSet requires 3 args')443 sys.exit(1)444 pp.pprint(client.requestVirtualAccountPasswordSet(args[0],args[1],args[2],))445elif cmd == 'unregisterVirtualAccount':446 if len(args) != 1:447 print('unregisterVirtualAccount requires 1 args')448 sys.exit(1)449 pp.pprint(client.unregisterVirtualAccount(args[0],))450elif cmd == 'checkUserAge':451 if len(args) != 4:452 print('checkUserAge requires 4 args')453 sys.exit(1)454 pp.pprint(client.checkUserAge(eval(args[0]),args[1],args[2],eval(args[3]),))455elif cmd == 'checkUserAgeWithDocomo':456 if len(args) != 3:457 print('checkUserAgeWithDocomo requires 3 args')458 sys.exit(1)459 pp.pprint(client.checkUserAgeWithDocomo(args[0],eval(args[1]),args[2],))460elif cmd == 'retrieveOpenIdAuthUrlWithDocomo':461 if len(args) != 0:462 print('retrieveOpenIdAuthUrlWithDocomo requires 0 args')463 sys.exit(1)464 pp.pprint(client.retrieveOpenIdAuthUrlWithDocomo())465elif cmd == 'retrieveRequestToken':466 if len(args) != 1:467 print('retrieveRequestToken requires 1 args')468 sys.exit(1)469 pp.pprint(client.retrieveRequestToken(eval(args[0]),))470elif cmd == 'addBuddyMember':471 if len(args) != 2:472 print('addBuddyMember requires 2 args')473 sys.exit(1)474 pp.pprint(client.addBuddyMember(args[0],args[1],))475elif cmd == 'addBuddyMembers':476 if len(args) != 2:477 print('addBuddyMembers requires 2 args')478 sys.exit(1)479 pp.pprint(client.addBuddyMembers(args[0],eval(args[1]),))480elif cmd == 'blockBuddyMember':481 if len(args) != 2:482 print('blockBuddyMember requires 2 args')483 sys.exit(1)484 pp.pprint(client.blockBuddyMember(args[0],args[1],))485elif cmd == 'commitSendMessagesToAll':486 if len(args) != 1:487 print('commitSendMessagesToAll requires 1 args')488 sys.exit(1)489 pp.pprint(client.commitSendMessagesToAll(eval(args[0]),))490elif cmd == 'commitSendMessagesToMids':491 if len(args) != 2:492 print('commitSendMessagesToMids requires 2 args')493 sys.exit(1)494 pp.pprint(client.commitSendMessagesToMids(eval(args[0]),eval(args[1]),))495elif cmd == 'containsBuddyMember':496 if len(args) != 2:497 print('containsBuddyMember requires 2 args')498 sys.exit(1)499 pp.pprint(client.containsBuddyMember(args[0],args[1],))500elif cmd == 'downloadMessageContent':501 if len(args) != 2:502 print('downloadMessageContent requires 2 args')503 sys.exit(1)504 pp.pprint(client.downloadMessageContent(args[0],args[1],))505elif cmd == 'downloadMessageContentPreview':506 if len(args) != 2:507 print('downloadMessageContentPreview requires 2 args')508 sys.exit(1)509 pp.pprint(client.downloadMessageContentPreview(args[0],args[1],))510elif cmd == 'downloadProfileImage':511 if len(args) != 1:512 print('downloadProfileImage requires 1 args')513 sys.exit(1)514 pp.pprint(client.downloadProfileImage(args[0],))515elif cmd == 'downloadProfileImagePreview':516 if len(args) != 1:517 print('downloadProfileImagePreview requires 1 args')518 sys.exit(1)519 pp.pprint(client.downloadProfileImagePreview(args[0],))520elif cmd == 'getActiveMemberCountByBuddyMid':521 if len(args) != 1:522 print('getActiveMemberCountByBuddyMid requires 1 args')523 sys.exit(1)524 pp.pprint(client.getActiveMemberCountByBuddyMid(args[0],))525elif cmd == 'getActiveMemberMidsByBuddyMid':526 if len(args) != 1:527 print('getActiveMemberMidsByBuddyMid requires 1 args')528 sys.exit(1)529 pp.pprint(client.getActiveMemberMidsByBuddyMid(args[0],))530elif cmd == 'getAllBuddyMembers':531 if len(args) != 0:532 print('getAllBuddyMembers requires 0 args')533 sys.exit(1)534 pp.pprint(client.getAllBuddyMembers())535elif cmd == 'getBlockedBuddyMembers':536 if len(args) != 0:537 print('getBlockedBuddyMembers requires 0 args')538 sys.exit(1)539 pp.pprint(client.getBlockedBuddyMembers())540elif cmd == 'getBlockerCountByBuddyMid':541 if len(args) != 1:542 print('getBlockerCountByBuddyMid requires 1 args')543 sys.exit(1)544 pp.pprint(client.getBlockerCountByBuddyMid(args[0],))545elif cmd == 'getBuddyDetailByMid':546 if len(args) != 1:547 print('getBuddyDetailByMid requires 1 args')548 sys.exit(1)549 pp.pprint(client.getBuddyDetailByMid(args[0],))550elif cmd == 'getBuddyProfile':551 if len(args) != 0:552 print('getBuddyProfile requires 0 args')553 sys.exit(1)554 pp.pprint(client.getBuddyProfile())555elif cmd == 'getContactTicket':556 if len(args) != 0:557 print('getContactTicket requires 0 args')558 sys.exit(1)559 pp.pprint(client.getContactTicket())560elif cmd == 'getMemberCountByBuddyMid':561 if len(args) != 1:562 print('getMemberCountByBuddyMid requires 1 args')563 sys.exit(1)564 pp.pprint(client.getMemberCountByBuddyMid(args[0],))565elif cmd == 'getSendBuddyMessageResult':566 if len(args) != 1:567 print('getSendBuddyMessageResult requires 1 args')568 sys.exit(1)569 pp.pprint(client.getSendBuddyMessageResult(args[0],))570elif cmd == 'getSetBuddyOnAirResult':571 if len(args) != 1:572 print('getSetBuddyOnAirResult requires 1 args')573 sys.exit(1)574 pp.pprint(client.getSetBuddyOnAirResult(args[0],))575elif cmd == 'getUpdateBuddyProfileResult':576 if len(args) != 1:577 print('getUpdateBuddyProfileResult requires 1 args')578 sys.exit(1)579 pp.pprint(client.getUpdateBuddyProfileResult(args[0],))580elif cmd == 'isBuddyOnAirByMid':581 if len(args) != 1:582 print('isBuddyOnAirByMid requires 1 args')583 sys.exit(1)584 pp.pprint(client.isBuddyOnAirByMid(args[0],))585elif cmd == 'linkAndSendBuddyContentMessageToAllAsync':586 if len(args) != 3:587 print('linkAndSendBuddyContentMessageToAllAsync requires 3 args')588 sys.exit(1)589 pp.pprint(client.linkAndSendBuddyContentMessageToAllAsync(args[0],eval(args[1]),args[2],))590elif cmd == 'linkAndSendBuddyContentMessageToMids':591 if len(args) != 4:592 print('linkAndSendBuddyContentMessageToMids requires 4 args')593 sys.exit(1)594 pp.pprint(client.linkAndSendBuddyContentMessageToMids(args[0],eval(args[1]),args[2],eval(args[3]),))595elif cmd == 'notifyBuddyBlocked':596 if len(args) != 2:597 print('notifyBuddyBlocked requires 2 args')598 sys.exit(1)599 pp.pprint(client.notifyBuddyBlocked(args[0],args[1],))600elif cmd == 'notifyBuddyUnblocked':601 if len(args) != 2:602 print('notifyBuddyUnblocked requires 2 args')603 sys.exit(1)604 pp.pprint(client.notifyBuddyUnblocked(args[0],args[1],))605elif cmd == 'registerBuddy':606 if len(args) != 6:607 print('registerBuddy requires 6 args')608 sys.exit(1)609 pp.pprint(client.registerBuddy(args[0],args[1],args[2],args[3],args[4],eval(args[5]),))610elif cmd == 'registerBuddyAdmin':611 if len(args) != 5:612 print('registerBuddyAdmin requires 5 args')613 sys.exit(1)614 pp.pprint(client.registerBuddyAdmin(args[0],args[1],args[2],args[3],args[4],))615elif cmd == 'reissueContactTicket':616 if len(args) != 2:617 print('reissueContactTicket requires 2 args')618 sys.exit(1)619 pp.pprint(client.reissueContactTicket(eval(args[0]),eval(args[1]),))620elif cmd == 'removeBuddyMember':621 if len(args) != 2:622 print('removeBuddyMember requires 2 args')623 sys.exit(1)624 pp.pprint(client.removeBuddyMember(args[0],args[1],))625elif cmd == 'removeBuddyMembers':626 if len(args) != 2:627 print('removeBuddyMembers requires 2 args')628 sys.exit(1)629 pp.pprint(client.removeBuddyMembers(args[0],eval(args[1]),))630elif cmd == 'sendBuddyContentMessageToAll':631 if len(args) != 3:632 print('sendBuddyContentMessageToAll requires 3 args')633 sys.exit(1)634 pp.pprint(client.sendBuddyContentMessageToAll(args[0],eval(args[1]),args[2],))635elif cmd == 'sendBuddyContentMessageToAllAsync':636 if len(args) != 3:637 print('sendBuddyContentMessageToAllAsync requires 3 args')638 sys.exit(1)639 pp.pprint(client.sendBuddyContentMessageToAllAsync(args[0],eval(args[1]),args[2],))640elif cmd == 'sendBuddyContentMessageToMids':641 if len(args) != 4:642 print('sendBuddyContentMessageToMids requires 4 args')643 sys.exit(1)644 pp.pprint(client.sendBuddyContentMessageToMids(args[0],eval(args[1]),args[2],eval(args[3]),))645elif cmd == 'sendBuddyContentMessageToMidsAsync':646 if len(args) != 4:647 print('sendBuddyContentMessageToMidsAsync requires 4 args')648 sys.exit(1)649 pp.pprint(client.sendBuddyContentMessageToMidsAsync(args[0],eval(args[1]),args[2],eval(args[3]),))650elif cmd == 'sendBuddyMessageToAll':651 if len(args) != 2:652 print('sendBuddyMessageToAll requires 2 args')653 sys.exit(1)654 pp.pprint(client.sendBuddyMessageToAll(args[0],eval(args[1]),))655elif cmd == 'sendBuddyMessageToAllAsync':656 if len(args) != 2:657 print('sendBuddyMessageToAllAsync requires 2 args')658 sys.exit(1)659 pp.pprint(client.sendBuddyMessageToAllAsync(args[0],eval(args[1]),))660elif cmd == 'sendBuddyMessageToMids':661 if len(args) != 3:662 print('sendBuddyMessageToMids requires 3 args')663 sys.exit(1)664 pp.pprint(client.sendBuddyMessageToMids(args[0],eval(args[1]),eval(args[2]),))665elif cmd == 'sendBuddyMessageToMidsAsync':666 if len(args) != 3:667 print('sendBuddyMessageToMidsAsync requires 3 args')668 sys.exit(1)669 pp.pprint(client.sendBuddyMessageToMidsAsync(args[0],eval(args[1]),eval(args[2]),))670elif cmd == 'sendIndividualEventToAllAsync':671 if len(args) != 3:672 print('sendIndividualEventToAllAsync requires 3 args')673 sys.exit(1)674 pp.pprint(client.sendIndividualEventToAllAsync(args[0],args[1],eval(args[2]),))675elif cmd == 'setBuddyOnAir':676 if len(args) != 2:677 print('setBuddyOnAir requires 2 args')678 sys.exit(1)679 pp.pprint(client.setBuddyOnAir(args[0],eval(args[1]),))680elif cmd == 'setBuddyOnAirAsync':681 if len(args) != 2:682 print('setBuddyOnAirAsync requires 2 args')683 sys.exit(1)684 pp.pprint(client.setBuddyOnAirAsync(args[0],eval(args[1]),))685elif cmd == 'storeMessage':686 if len(args) != 2:687 print('storeMessage requires 2 args')688 sys.exit(1)689 pp.pprint(client.storeMessage(args[0],eval(args[1]),))690elif cmd == 'unblockBuddyMember':691 if len(args) != 2:692 print('unblockBuddyMember requires 2 args')693 sys.exit(1)694 pp.pprint(client.unblockBuddyMember(args[0],args[1],))695elif cmd == 'unregisterBuddy':696 if len(args) != 1:697 print('unregisterBuddy requires 1 args')698 sys.exit(1)699 pp.pprint(client.unregisterBuddy(args[0],))700elif cmd == 'unregisterBuddyAdmin':701 if len(args) != 1:702 print('unregisterBuddyAdmin requires 1 args')703 sys.exit(1)704 pp.pprint(client.unregisterBuddyAdmin(args[0],))705elif cmd == 'updateBuddyAdminProfileAttribute':706 if len(args) != 2:707 print('updateBuddyAdminProfileAttribute requires 2 args')708 sys.exit(1)709 pp.pprint(client.updateBuddyAdminProfileAttribute(args[0],eval(args[1]),))710elif cmd == 'updateBuddyAdminProfileImage':711 if len(args) != 2:712 print('updateBuddyAdminProfileImage requires 2 args')713 sys.exit(1)714 pp.pprint(client.updateBuddyAdminProfileImage(args[0],args[1],))715elif cmd == 'updateBuddyProfileAttributes':716 if len(args) != 2:717 print('updateBuddyProfileAttributes requires 2 args')718 sys.exit(1)719 pp.pprint(client.updateBuddyProfileAttributes(args[0],eval(args[1]),))720elif cmd == 'updateBuddyProfileAttributesAsync':721 if len(args) != 2:722 print('updateBuddyProfileAttributesAsync requires 2 args')723 sys.exit(1)724 pp.pprint(client.updateBuddyProfileAttributesAsync(args[0],eval(args[1]),))725elif cmd == 'updateBuddyProfileImage':726 if len(args) != 2:727 print('updateBuddyProfileImage requires 2 args')728 sys.exit(1)729 pp.pprint(client.updateBuddyProfileImage(args[0],args[1],))730elif cmd == 'updateBuddyProfileImageAsync':731 if len(args) != 2:732 print('updateBuddyProfileImageAsync requires 2 args')733 sys.exit(1)734 pp.pprint(client.updateBuddyProfileImageAsync(args[0],args[1],))735elif cmd == 'updateBuddySearchId':736 if len(args) != 2:737 print('updateBuddySearchId requires 2 args')738 sys.exit(1)739 pp.pprint(client.updateBuddySearchId(args[0],args[1],))740elif cmd == 'updateBuddySettings':741 if len(args) != 1:742 print('updateBuddySettings requires 1 args')743 sys.exit(1)744 pp.pprint(client.updateBuddySettings(eval(args[0]),))745elif cmd == 'uploadBuddyContent':746 if len(args) != 2:747 print('uploadBuddyContent requires 2 args')748 sys.exit(1)749 pp.pprint(client.uploadBuddyContent(eval(args[0]),args[1],))750elif cmd == 'findBuddyContactsByQuery':751 if len(args) != 6:752 print('findBuddyContactsByQuery requires 6 args')753 sys.exit(1)754 pp.pprint(client.findBuddyContactsByQuery(args[0],args[1],args[2],eval(args[3]),eval(args[4]),eval(args[5]),))755elif cmd == 'getBuddyContacts':756 if len(args) != 5:757 print('getBuddyContacts requires 5 args')758 sys.exit(1)759 pp.pprint(client.getBuddyContacts(args[0],args[1],args[2],eval(args[3]),eval(args[4]),))760elif cmd == 'getBuddyDetail':761 if len(args) != 1:762 print('getBuddyDetail requires 1 args')763 sys.exit(1)764 pp.pprint(client.getBuddyDetail(args[0],))765elif cmd == 'getBuddyOnAir':766 if len(args) != 1:767 print('getBuddyOnAir requires 1 args')768 sys.exit(1)769 pp.pprint(client.getBuddyOnAir(args[0],))770elif cmd == 'getCountriesHavingBuddy':771 if len(args) != 0:772 print('getCountriesHavingBuddy requires 0 args')773 sys.exit(1)774 pp.pprint(client.getCountriesHavingBuddy())775elif cmd == 'getNewlyReleasedBuddyIds':776 if len(args) != 1:777 print('getNewlyReleasedBuddyIds requires 1 args')778 sys.exit(1)779 pp.pprint(client.getNewlyReleasedBuddyIds(args[0],))780elif cmd == 'getPopularBuddyBanner':781 if len(args) != 4:782 print('getPopularBuddyBanner requires 4 args')783 sys.exit(1)784 pp.pprint(client.getPopularBuddyBanner(args[0],args[1],eval(args[2]),args[3],))785elif cmd == 'getPopularBuddyLists':786 if len(args) != 2:787 print('getPopularBuddyLists requires 2 args')788 sys.exit(1)789 pp.pprint(client.getPopularBuddyLists(args[0],args[1],))790elif cmd == 'getPromotedBuddyContacts':791 if len(args) != 2:792 print('getPromotedBuddyContacts requires 2 args')793 sys.exit(1)794 pp.pprint(client.getPromotedBuddyContacts(args[0],args[1],))795elif cmd == 'activeBuddySubscriberCount':796 if len(args) != 0:797 print('activeBuddySubscriberCount requires 0 args')798 sys.exit(1)799 pp.pprint(client.activeBuddySubscriberCount())800elif cmd == 'addOperationForChannel':801 if len(args) != 4:802 print('addOperationForChannel requires 4 args')803 sys.exit(1)804 pp.pprint(client.addOperationForChannel(eval(args[0]),args[1],args[2],args[3],))805elif cmd == 'displayBuddySubscriberCount':806 if len(args) != 0:807 print('displayBuddySubscriberCount requires 0 args')808 sys.exit(1)809 pp.pprint(client.displayBuddySubscriberCount())810elif cmd == 'findContactByUseridWithoutAbuseBlockForChannel':811 if len(args) != 1:812 print('findContactByUseridWithoutAbuseBlockForChannel requires 1 args')813 sys.exit(1)814 pp.pprint(client.findContactByUseridWithoutAbuseBlockForChannel(args[0],))815elif cmd == 'getAllContactIdsForChannel':816 if len(args) != 0:817 print('getAllContactIdsForChannel requires 0 args')818 sys.exit(1)819 pp.pprint(client.getAllContactIdsForChannel())820elif cmd == 'getCompactContacts':821 if len(args) != 1:822 print('getCompactContacts requires 1 args')823 sys.exit(1)824 pp.pprint(client.getCompactContacts(eval(args[0]),))825elif cmd == 'getContactsForChannel':826 if len(args) != 1:827 print('getContactsForChannel requires 1 args')828 sys.exit(1)829 pp.pprint(client.getContactsForChannel(eval(args[0]),))830elif cmd == 'getDisplayName':831 if len(args) != 1:832 print('getDisplayName requires 1 args')833 sys.exit(1)834 pp.pprint(client.getDisplayName(args[0],))835elif cmd == 'getFavoriteMidsForChannel':836 if len(args) != 0:837 print('getFavoriteMidsForChannel requires 0 args')838 sys.exit(1)839 pp.pprint(client.getFavoriteMidsForChannel())840elif cmd == 'getFriendMids':841 if len(args) != 0:842 print('getFriendMids requires 0 args')843 sys.exit(1)844 pp.pprint(client.getFriendMids())845elif cmd == 'getGroupMemberMids':846 if len(args) != 1:847 print('getGroupMemberMids requires 1 args')848 sys.exit(1)849 pp.pprint(client.getGroupMemberMids(args[0],))850elif cmd == 'getGroupsForChannel':851 if len(args) != 1:852 print('getGroupsForChannel requires 1 args')853 sys.exit(1)854 pp.pprint(client.getGroupsForChannel(eval(args[0]),))855elif cmd == 'getIdentityCredential':856 if len(args) != 0:857 print('getIdentityCredential requires 0 args')858 sys.exit(1)859 pp.pprint(client.getIdentityCredential())860elif cmd == 'getJoinedGroupIdsForChannel':861 if len(args) != 0:862 print('getJoinedGroupIdsForChannel requires 0 args')863 sys.exit(1)864 pp.pprint(client.getJoinedGroupIdsForChannel())865elif cmd == 'getMetaProfile':866 if len(args) != 0:867 print('getMetaProfile requires 0 args')868 sys.exit(1)869 pp.pprint(client.getMetaProfile())870elif cmd == 'getMid':871 if len(args) != 0:872 print('getMid requires 0 args')873 sys.exit(1)874 pp.pprint(client.getMid())875elif cmd == 'getPrimaryClientForChannel':876 if len(args) != 0:877 print('getPrimaryClientForChannel requires 0 args')878 sys.exit(1)879 pp.pprint(client.getPrimaryClientForChannel())880elif cmd == 'getProfileForChannel':881 if len(args) != 0:882 print('getProfileForChannel requires 0 args')883 sys.exit(1)884 pp.pprint(client.getProfileForChannel())885elif cmd == 'getSimpleChannelContacts':886 if len(args) != 1:887 print('getSimpleChannelContacts requires 1 args')888 sys.exit(1)889 pp.pprint(client.getSimpleChannelContacts(eval(args[0]),))890elif cmd == 'getUserCountryForBilling':891 if len(args) != 2:892 print('getUserCountryForBilling requires 2 args')893 sys.exit(1)894 pp.pprint(client.getUserCountryForBilling(args[0],args[1],))895elif cmd == 'getUserCreateTime':896 if len(args) != 0:897 print('getUserCreateTime requires 0 args')898 sys.exit(1)899 pp.pprint(client.getUserCreateTime())900elif cmd == 'getUserIdentities':901 if len(args) != 0:902 print('getUserIdentities requires 0 args')903 sys.exit(1)904 pp.pprint(client.getUserIdentities())905elif cmd == 'getUserLanguage':906 if len(args) != 0:907 print('getUserLanguage requires 0 args')908 sys.exit(1)909 pp.pprint(client.getUserLanguage())910elif cmd == 'getUserMidsWhoAddedMe':911 if len(args) != 0:912 print('getUserMidsWhoAddedMe requires 0 args')913 sys.exit(1)914 pp.pprint(client.getUserMidsWhoAddedMe())915elif cmd == 'isGroupMember':916 if len(args) != 1:917 print('isGroupMember requires 1 args')918 sys.exit(1)919 pp.pprint(client.isGroupMember(args[0],))920elif cmd == 'isInContact':921 if len(args) != 1:922 print('isInContact requires 1 args')923 sys.exit(1)924 pp.pprint(client.isInContact(args[0],))925elif cmd == 'registerChannelCP':926 if len(args) != 2:927 print('registerChannelCP requires 2 args')928 sys.exit(1)929 pp.pprint(client.registerChannelCP(args[0],args[1],))930elif cmd == 'removeNotificationStatus':931 if len(args) != 1:932 print('removeNotificationStatus requires 1 args')933 sys.exit(1)934 pp.pprint(client.removeNotificationStatus(eval(args[0]),))935elif cmd == 'sendMessageForChannel':936 if len(args) != 1:937 print('sendMessageForChannel requires 1 args')938 sys.exit(1)939 pp.pprint(client.sendMessageForChannel(eval(args[0]),))940elif cmd == 'sendPinCodeOperation':941 if len(args) != 1:942 print('sendPinCodeOperation requires 1 args')943 sys.exit(1)944 pp.pprint(client.sendPinCodeOperation(args[0],))945elif cmd == 'updateProfileAttributeForChannel':946 if len(args) != 2:947 print('updateProfileAttributeForChannel requires 2 args')948 sys.exit(1)949 pp.pprint(client.updateProfileAttributeForChannel(eval(args[0]),args[1],))950elif cmd == 'approveChannelAndIssueChannelToken':951 if len(args) != 1:952 print('approveChannelAndIssueChannelToken requires 1 args')953 sys.exit(1)954 pp.pprint(client.approveChannelAndIssueChannelToken(args[0],))955elif cmd == 'approveChannelAndIssueRequestToken':956 if len(args) != 2:957 print('approveChannelAndIssueRequestToken requires 2 args')958 sys.exit(1)959 pp.pprint(client.approveChannelAndIssueRequestToken(args[0],args[1],))960elif cmd == 'fetchNotificationItems':961 if len(args) != 1:962 print('fetchNotificationItems requires 1 args')963 sys.exit(1)964 pp.pprint(client.fetchNotificationItems(eval(args[0]),))965elif cmd == 'getApprovedChannels':966 if len(args) != 2:967 print('getApprovedChannels requires 2 args')968 sys.exit(1)969 pp.pprint(client.getApprovedChannels(eval(args[0]),args[1],))970elif cmd == 'getChannelInfo':971 if len(args) != 2:972 print('getChannelInfo requires 2 args')973 sys.exit(1)974 pp.pprint(client.getChannelInfo(args[0],args[1],))975elif cmd == 'getChannelNotificationSetting':976 if len(args) != 2:977 print('getChannelNotificationSetting requires 2 args')978 sys.exit(1)979 pp.pprint(client.getChannelNotificationSetting(args[0],args[1],))980elif cmd == 'getChannelNotificationSettings':981 if len(args) != 1:982 print('getChannelNotificationSettings requires 1 args')983 sys.exit(1)984 pp.pprint(client.getChannelNotificationSettings(args[0],))985elif cmd == 'getChannels':986 if len(args) != 2:987 print('getChannels requires 2 args')988 sys.exit(1)989 pp.pprint(client.getChannels(eval(args[0]),args[1],))990elif cmd == 'getDomains':991 if len(args) != 1:992 print('getDomains requires 1 args')993 sys.exit(1)994 pp.pprint(client.getDomains(eval(args[0]),))995elif cmd == 'getFriendChannelMatrices':996 if len(args) != 1:997 print('getFriendChannelMatrices requires 1 args')998 sys.exit(1)999 pp.pprint(client.getFriendChannelMatrices(eval(args[0]),))1000elif cmd == 'getNotificationBadgeCount':1001 if len(args) != 1:1002 print('getNotificationBadgeCount requires 1 args')1003 sys.exit(1)1004 pp.pprint(client.getNotificationBadgeCount(eval(args[0]),))1005elif cmd == 'issueChannelToken':1006 if len(args) != 1:1007 print('issueChannelToken requires 1 args')1008 sys.exit(1)1009 pp.pprint(client.issueChannelToken(args[0],))1010elif cmd == 'issueRequestToken':1011 if len(args) != 2:1012 print('issueRequestToken requires 2 args')1013 sys.exit(1)1014 pp.pprint(client.issueRequestToken(args[0],args[1],))1015elif cmd == 'issueRequestTokenWithAuthScheme':1016 if len(args) != 4:1017 print('issueRequestTokenWithAuthScheme requires 4 args')1018 sys.exit(1)1019 pp.pprint(client.issueRequestTokenWithAuthScheme(args[0],args[1],eval(args[2]),args[3],))1020elif cmd == 'reserveCoinUse':1021 if len(args) != 2:1022 print('reserveCoinUse requires 2 args')1023 sys.exit(1)1024 pp.pprint(client.reserveCoinUse(eval(args[0]),args[1],))1025elif cmd == 'revokeChannel':1026 if len(args) != 1:1027 print('revokeChannel requires 1 args')1028 sys.exit(1)1029 pp.pprint(client.revokeChannel(args[0],))1030elif cmd == 'syncChannelData':1031 if len(args) != 2:1032 print('syncChannelData requires 2 args')1033 sys.exit(1)1034 pp.pprint(client.syncChannelData(eval(args[0]),args[1],))1035elif cmd == 'updateChannelNotificationSetting':1036 if len(args) != 1:1037 print('updateChannelNotificationSetting requires 1 args')1038 sys.exit(1)1039 pp.pprint(client.updateChannelNotificationSetting(eval(args[0]),))1040elif cmd == 'fetchMessageOperations':1041 if len(args) != 3:1042 print('fetchMessageOperations requires 3 args')1043 sys.exit(1)1044 pp.pprint(client.fetchMessageOperations(eval(args[0]),eval(args[1]),eval(args[2]),))1045elif cmd == 'getLastReadMessageIds':1046 if len(args) != 1:1047 print('getLastReadMessageIds requires 1 args')1048 sys.exit(1)1049 pp.pprint(client.getLastReadMessageIds(args[0],))1050elif cmd == 'multiGetLastReadMessageIds':1051 if len(args) != 1:1052 print('multiGetLastReadMessageIds requires 1 args')1053 sys.exit(1)1054 pp.pprint(client.multiGetLastReadMessageIds(eval(args[0]),))1055elif cmd == 'buyCoinProduct':1056 if len(args) != 1:1057 print('buyCoinProduct requires 1 args')1058 sys.exit(1)1059 pp.pprint(client.buyCoinProduct(eval(args[0]),))1060elif cmd == 'buyFreeProduct':1061 if len(args) != 6:1062 print('buyFreeProduct requires 6 args')1063 sys.exit(1)1064 pp.pprint(client.buyFreeProduct(args[0],args[1],eval(args[2]),args[3],args[4],eval(args[5]),))1065elif cmd == 'buyMustbuyProduct':1066 if len(args) != 7:1067 print('buyMustbuyProduct requires 7 args')1068 sys.exit(1)1069 pp.pprint(client.buyMustbuyProduct(args[0],args[1],eval(args[2]),args[3],args[4],eval(args[5]),args[6],))1070elif cmd == 'checkCanReceivePresent':1071 if len(args) != 4:1072 print('checkCanReceivePresent requires 4 args')1073 sys.exit(1)1074 pp.pprint(client.checkCanReceivePresent(args[0],eval(args[1]),args[2],args[3],))1075elif cmd == 'getActivePurchases':1076 if len(args) != 4:1077 print('getActivePurchases requires 4 args')1078 sys.exit(1)1079 pp.pprint(client.getActivePurchases(eval(args[0]),eval(args[1]),args[2],args[3],))1080elif cmd == 'getActivePurchaseVersions':1081 if len(args) != 4:1082 print('getActivePurchaseVersions requires 4 args')1083 sys.exit(1)1084 pp.pprint(client.getActivePurchaseVersions(eval(args[0]),eval(args[1]),args[2],args[3],))1085elif cmd == 'getCoinProducts':1086 if len(args) != 3:1087 print('getCoinProducts requires 3 args')1088 sys.exit(1)1089 pp.pprint(client.getCoinProducts(eval(args[0]),args[1],args[2],))1090elif cmd == 'getCoinProductsByPgCode':1091 if len(args) != 4:1092 print('getCoinProductsByPgCode requires 4 args')1093 sys.exit(1)1094 pp.pprint(client.getCoinProductsByPgCode(eval(args[0]),eval(args[1]),args[2],args[3],))1095elif cmd == 'getCoinPurchaseHistory':1096 if len(args) != 1:1097 print('getCoinPurchaseHistory requires 1 args')1098 sys.exit(1)1099 pp.pprint(client.getCoinPurchaseHistory(eval(args[0]),))1100elif cmd == 'getCoinUseAndRefundHistory':1101 if len(args) != 1:1102 print('getCoinUseAndRefundHistory requires 1 args')1103 sys.exit(1)1104 pp.pprint(client.getCoinUseAndRefundHistory(eval(args[0]),))1105elif cmd == 'getDownloads':1106 if len(args) != 4:1107 print('getDownloads requires 4 args')1108 sys.exit(1)1109 pp.pprint(client.getDownloads(eval(args[0]),eval(args[1]),args[2],args[3],))1110elif cmd == 'getEventPackages':1111 if len(args) != 4:1112 print('getEventPackages requires 4 args')1113 sys.exit(1)1114 pp.pprint(client.getEventPackages(eval(args[0]),eval(args[1]),args[2],args[3],))1115elif cmd == 'getNewlyReleasedPackages':1116 if len(args) != 4:1117 print('getNewlyReleasedPackages requires 4 args')1118 sys.exit(1)1119 pp.pprint(client.getNewlyReleasedPackages(eval(args[0]),eval(args[1]),args[2],args[3],))1120elif cmd == 'getPopularPackages':1121 if len(args) != 4:1122 print('getPopularPackages requires 4 args')1123 sys.exit(1)1124 pp.pprint(client.getPopularPackages(eval(args[0]),eval(args[1]),args[2],args[3],))1125elif cmd == 'getPresentsReceived':1126 if len(args) != 4:1127 print('getPresentsReceived requires 4 args')1128 sys.exit(1)1129 pp.pprint(client.getPresentsReceived(eval(args[0]),eval(args[1]),args[2],args[3],))1130elif cmd == 'getPresentsSent':1131 if len(args) != 4:1132 print('getPresentsSent requires 4 args')1133 sys.exit(1)1134 pp.pprint(client.getPresentsSent(eval(args[0]),eval(args[1]),args[2],args[3],))1135elif cmd == 'getProduct':1136 if len(args) != 3:1137 print('getProduct requires 3 args')1138 sys.exit(1)1139 pp.pprint(client.getProduct(eval(args[0]),args[1],args[2],))1140elif cmd == 'getProductList':1141 if len(args) != 3:1142 print('getProductList requires 3 args')1143 sys.exit(1)1144 pp.pprint(client.getProductList(eval(args[0]),args[1],args[2],))1145elif cmd == 'getProductListWithCarrier':1146 if len(args) != 4:1147 print('getProductListWithCarrier requires 4 args')1148 sys.exit(1)1149 pp.pprint(client.getProductListWithCarrier(eval(args[0]),args[1],args[2],args[3],))1150elif cmd == 'getProductWithCarrier':1151 if len(args) != 4:1152 print('getProductWithCarrier requires 4 args')1153 sys.exit(1)1154 pp.pprint(client.getProductWithCarrier(eval(args[0]),args[1],args[2],args[3],))1155elif cmd == 'getPurchaseHistory':1156 if len(args) != 4:1157 print('getPurchaseHistory requires 4 args')1158 sys.exit(1)1159 pp.pprint(client.getPurchaseHistory(eval(args[0]),eval(args[1]),args[2],args[3],))1160elif cmd == 'getTotalBalance':1161 if len(args) != 1:1162 print('getTotalBalance requires 1 args')1163 sys.exit(1)1164 pp.pprint(client.getTotalBalance(eval(args[0]),))1165elif cmd == 'notifyDownloaded':1166 if len(args) != 2:1167 print('notifyDownloaded requires 2 args')1168 sys.exit(1)1169 pp.pprint(client.notifyDownloaded(eval(args[0]),args[1],))1170elif cmd == 'reserveCoinPurchase':1171 if len(args) != 1:1172 print('reserveCoinPurchase requires 1 args')1173 sys.exit(1)1174 pp.pprint(client.reserveCoinPurchase(eval(args[0]),))1175elif cmd == 'reservePayment':1176 if len(args) != 1:1177 print('reservePayment requires 1 args')1178 sys.exit(1)1179 pp.pprint(client.reservePayment(eval(args[0]),))1180elif cmd == 'getSnsFriends':1181 if len(args) != 4:1182 print('getSnsFriends requires 4 args')1183 sys.exit(1)1184 pp.pprint(client.getSnsFriends(eval(args[0]),args[1],eval(args[2]),eval(args[3]),))1185elif cmd == 'getSnsMyProfile':1186 if len(args) != 2:1187 print('getSnsMyProfile requires 2 args')1188 sys.exit(1)1189 pp.pprint(client.getSnsMyProfile(eval(args[0]),args[1],))1190elif cmd == 'postSnsInvitationMessage':1191 if len(args) != 3:1192 print('postSnsInvitationMessage requires 3 args')1193 sys.exit(1)1194 pp.pprint(client.postSnsInvitationMessage(eval(args[0]),args[1],args[2],))1195elif cmd == 'acceptGroupInvitation':1196 if len(args) != 2:1197 print('acceptGroupInvitation requires 2 args')1198 sys.exit(1)1199 pp.pprint(client.acceptGroupInvitation(eval(args[0]),args[1],))1200elif cmd == 'acceptGroupInvitationByTicket':1201 if len(args) != 3:1202 print('acceptGroupInvitationByTicket requires 3 args')1203 sys.exit(1)1204 pp.pprint(client.acceptGroupInvitationByTicket(eval(args[0]),args[1],args[2],))1205elif cmd == 'acceptProximityMatches':1206 if len(args) != 2:1207 print('acceptProximityMatches requires 2 args')1208 sys.exit(1)1209 pp.pprint(client.acceptProximityMatches(args[0],eval(args[1]),))1210elif cmd == 'acquireCallRoute':1211 if len(args) != 1:1212 print('acquireCallRoute requires 1 args')1213 sys.exit(1)1214 pp.pprint(client.acquireCallRoute(args[0],))1215elif cmd == 'acquireCallTicket':1216 if len(args) != 1:1217 print('acquireCallTicket requires 1 args')1218 sys.exit(1)1219 pp.pprint(client.acquireCallTicket(args[0],))1220elif cmd == 'acquireEncryptedAccessToken':1221 if len(args) != 1:1222 print('acquireEncryptedAccessToken requires 1 args')1223 sys.exit(1)1224 pp.pprint(client.acquireEncryptedAccessToken(eval(args[0]),))1225elif cmd == 'addSnsId':1226 if len(args) != 2:1227 print('addSnsId requires 2 args')1228 sys.exit(1)1229 pp.pprint(client.addSnsId(eval(args[0]),args[1],))1230elif cmd == 'blockContact':1231 if len(args) != 2:1232 print('blockContact requires 2 args')1233 sys.exit(1)1234 pp.pprint(client.blockContact(eval(args[0]),args[1],))1235elif cmd == 'blockRecommendation':1236 if len(args) != 2:1237 print('blockRecommendation requires 2 args')1238 sys.exit(1)1239 pp.pprint(client.blockRecommendation(eval(args[0]),args[1],))1240elif cmd == 'cancelGroupInvitation':1241 if len(args) != 3:1242 print('cancelGroupInvitation requires 3 args')1243 sys.exit(1)1244 pp.pprint(client.cancelGroupInvitation(eval(args[0]),args[1],eval(args[2]),))1245elif cmd == 'changeVerificationMethod':1246 if len(args) != 2:1247 print('changeVerificationMethod requires 2 args')1248 sys.exit(1)1249 pp.pprint(client.changeVerificationMethod(args[0],eval(args[1]),))1250elif cmd == 'clearIdentityCredential':1251 if len(args) != 0:1252 print('clearIdentityCredential requires 0 args')1253 sys.exit(1)1254 pp.pprint(client.clearIdentityCredential())1255elif cmd == 'clearMessageBox':1256 if len(args) != 2:1257 print('clearMessageBox requires 2 args')1258 sys.exit(1)1259 pp.pprint(client.clearMessageBox(args[0],args[1],))1260elif cmd == 'closeProximityMatch':1261 if len(args) != 1:1262 print('closeProximityMatch requires 1 args')1263 sys.exit(1)1264 pp.pprint(client.closeProximityMatch(args[0],))1265elif cmd == 'commitSendMessage':1266 if len(args) != 3:1267 print('commitSendMessage requires 3 args')1268 sys.exit(1)1269 pp.pprint(client.commitSendMessage(eval(args[0]),args[1],eval(args[2]),))1270elif cmd == 'commitSendMessages':1271 if len(args) != 3:1272 print('commitSendMessages requires 3 args')1273 sys.exit(1)1274 pp.pprint(client.commitSendMessages(eval(args[0]),eval(args[1]),eval(args[2]),))1275elif cmd == 'commitUpdateProfile':1276 if len(args) != 3:1277 print('commitUpdateProfile requires 3 args')1278 sys.exit(1)1279 pp.pprint(client.commitUpdateProfile(eval(args[0]),eval(args[1]),eval(args[2]),))1280elif cmd == 'confirmEmail':1281 if len(args) != 2:1282 print('confirmEmail requires 2 args')1283 sys.exit(1)1284 pp.pprint(client.confirmEmail(args[0],args[1],))1285elif cmd == 'createGroup':1286 if len(args) != 3:1287 print('createGroup requires 3 args')1288 sys.exit(1)1289 pp.pprint(client.createGroup(eval(args[0]),args[1],eval(args[2]),))1290elif cmd == 'createQrcodeBase64Image':1291 if len(args) != 7:1292 print('createQrcodeBase64Image requires 7 args')1293 sys.exit(1)1294 pp.pprint(client.createQrcodeBase64Image(args[0],args[1],eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),eval(args[6]),))1295elif cmd == 'createRoom':1296 if len(args) != 2:1297 print('createRoom requires 2 args')1298 sys.exit(1)1299 pp.pprint(client.createRoom(eval(args[0]),eval(args[1]),))1300elif cmd == 'createSession':1301 if len(args) != 0:1302 print('createSession requires 0 args')1303 sys.exit(1)1304 pp.pprint(client.createSession())1305elif cmd == 'fetchAnnouncements':1306 if len(args) != 1:1307 print('fetchAnnouncements requires 1 args')1308 sys.exit(1)1309 pp.pprint(client.fetchAnnouncements(eval(args[0]),))1310elif cmd == 'fetchMessages':1311 if len(args) != 2:1312 print('fetchMessages requires 2 args')1313 sys.exit(1)1314 pp.pprint(client.fetchMessages(eval(args[0]),eval(args[1]),))1315elif cmd == 'fetchOperations':1316 if len(args) != 2:1317 print('fetchOperations requires 2 args')1318 sys.exit(1)1319 pp.pprint(client.fetchOperations(eval(args[0]),eval(args[1]),))1320elif cmd == 'fetchOps':1321 if len(args) != 4:1322 print('fetchOps requires 4 args')1323 sys.exit(1)1324 pp.pprint(client.fetchOps(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))1325elif cmd == 'findAndAddContactsByEmail':1326 if len(args) != 2:1327 print('findAndAddContactsByEmail requires 2 args')1328 sys.exit(1)1329 pp.pprint(client.findAndAddContactsByEmail(eval(args[0]),eval(args[1]),))1330elif cmd == 'findAndAddContactsByMid':1331 if len(args) != 2:1332 print('findAndAddContactsByMid requires 2 args')1333 sys.exit(1)1334 pp.pprint(client.findAndAddContactsByMid(eval(args[0]),args[1],))1335elif cmd == 'findAndAddContactsByPhone':1336 if len(args) != 2:1337 print('findAndAddContactsByPhone requires 2 args')1338 sys.exit(1)1339 pp.pprint(client.findAndAddContactsByPhone(eval(args[0]),eval(args[1]),))1340elif cmd == 'findAndAddContactsByUserid':1341 if len(args) != 2:1342 print('findAndAddContactsByUserid requires 2 args')1343 sys.exit(1)1344 pp.pprint(client.findAndAddContactsByUserid(eval(args[0]),args[1],))1345elif cmd == 'findContactByUserid':1346 if len(args) != 1:1347 print('findContactByUserid requires 1 args')1348 sys.exit(1)1349 pp.pprint(client.findContactByUserid(args[0],))1350elif cmd == 'findContactByUserTicket':1351 if len(args) != 1:1352 print('findContactByUserTicket requires 1 args')1353 sys.exit(1)1354 pp.pprint(client.findContactByUserTicket(args[0],))1355elif cmd == 'findGroupByTicket':1356 if len(args) != 1:1357 print('findGroupByTicket requires 1 args')1358 sys.exit(1)1359 pp.pprint(client.findGroupByTicket(args[0],))1360elif cmd == 'findContactsByEmail':1361 if len(args) != 1:1362 print('findContactsByEmail requires 1 args')1363 sys.exit(1)1364 pp.pprint(client.findContactsByEmail(eval(args[0]),))1365elif cmd == 'findContactsByPhone':1366 if len(args) != 1:1367 print('findContactsByPhone requires 1 args')1368 sys.exit(1)1369 pp.pprint(client.findContactsByPhone(eval(args[0]),))1370elif cmd == 'findSnsIdUserStatus':1371 if len(args) != 3:1372 print('findSnsIdUserStatus requires 3 args')1373 sys.exit(1)1374 pp.pprint(client.findSnsIdUserStatus(eval(args[0]),args[1],args[2],))1375elif cmd == 'finishUpdateVerification':1376 if len(args) != 1:1377 print('finishUpdateVerification requires 1 args')1378 sys.exit(1)1379 pp.pprint(client.finishUpdateVerification(args[0],))1380elif cmd == 'generateUserTicket':1381 if len(args) != 2:1382 print('generateUserTicket requires 2 args')1383 sys.exit(1)1384 pp.pprint(client.generateUserTicket(eval(args[0]),eval(args[1]),))1385elif cmd == 'getAcceptedProximityMatches':1386 if len(args) != 1:1387 print('getAcceptedProximityMatches requires 1 args')1388 sys.exit(1)1389 pp.pprint(client.getAcceptedProximityMatches(args[0],))1390elif cmd == 'getActiveBuddySubscriberIds':1391 if len(args) != 0:1392 print('getActiveBuddySubscriberIds requires 0 args')1393 sys.exit(1)1394 pp.pprint(client.getActiveBuddySubscriberIds())1395elif cmd == 'getAllContactIds':1396 if len(args) != 0:1397 print('getAllContactIds requires 0 args')1398 sys.exit(1)1399 pp.pprint(client.getAllContactIds())1400elif cmd == 'getAuthQrcode':1401 if len(args) != 2:1402 print('getAuthQrcode requires 2 args')1403 sys.exit(1)1404 pp.pprint(client.getAuthQrcode(eval(args[0]),args[1],))1405elif cmd == 'getBlockedContactIds':1406 if len(args) != 0:1407 print('getBlockedContactIds requires 0 args')1408 sys.exit(1)1409 pp.pprint(client.getBlockedContactIds())1410elif cmd == 'getBlockedContactIdsByRange':1411 if len(args) != 2:1412 print('getBlockedContactIdsByRange requires 2 args')1413 sys.exit(1)1414 pp.pprint(client.getBlockedContactIdsByRange(eval(args[0]),eval(args[1]),))1415elif cmd == 'getBlockedRecommendationIds':1416 if len(args) != 0:1417 print('getBlockedRecommendationIds requires 0 args')1418 sys.exit(1)1419 pp.pprint(client.getBlockedRecommendationIds())1420elif cmd == 'getBuddyBlockerIds':1421 if len(args) != 0:1422 print('getBuddyBlockerIds requires 0 args')1423 sys.exit(1)1424 pp.pprint(client.getBuddyBlockerIds())1425elif cmd == 'getBuddyLocation':1426 if len(args) != 2:1427 print('getBuddyLocation requires 2 args')1428 sys.exit(1)1429 pp.pprint(client.getBuddyLocation(args[0],eval(args[1]),))1430elif cmd == 'getCompactContactsModifiedSince':1431 if len(args) != 1:1432 print('getCompactContactsModifiedSince requires 1 args')1433 sys.exit(1)1434 pp.pprint(client.getCompactContactsModifiedSince(eval(args[0]),))1435elif cmd == 'getCompactGroup':1436 if len(args) != 1:1437 print('getCompactGroup requires 1 args')1438 sys.exit(1)1439 pp.pprint(client.getCompactGroup(args[0],))1440elif cmd == 'getCompactRoom':1441 if len(args) != 1:1442 print('getCompactRoom requires 1 args')1443 sys.exit(1)1444 pp.pprint(client.getCompactRoom(args[0],))1445elif cmd == 'getContact':1446 if len(args) != 1:1447 print('getContact requires 1 args')1448 sys.exit(1)1449 pp.pprint(client.getContact(args[0],))1450elif cmd == 'getContacts':1451 if len(args) != 1:1452 print('getContacts requires 1 args')1453 sys.exit(1)1454 pp.pprint(client.getContacts(eval(args[0]),))1455elif cmd == 'getCountryWithRequestIp':1456 if len(args) != 0:1457 print('getCountryWithRequestIp requires 0 args')1458 sys.exit(1)1459 pp.pprint(client.getCountryWithRequestIp())1460elif cmd == 'getRecentFriendRequests':1461 if len(args) != 0:1462 print('getRecentFriendRequests requires 0 args')1463 sys.exit(1)1464 pp.pprint(client.getRecentFriendRequests())1465elif cmd == 'getFavoriteMids':1466 if len(args) != 0:1467 print('getFavoriteMids requires 0 args')1468 sys.exit(1)1469 pp.pprint(client.getFavoriteMids())1470elif cmd == 'getGroup':1471 if len(args) != 1:1472 print('getGroup requires 1 args')1473 sys.exit(1)1474 pp.pprint(client.getGroup(args[0],))1475elif cmd == 'getGroupIdsInvited':1476 if len(args) != 0:1477 print('getGroupIdsInvited requires 0 args')1478 sys.exit(1)1479 pp.pprint(client.getGroupIdsInvited())1480elif cmd == 'getGroupIdsJoined':1481 if len(args) != 0:1482 print('getGroupIdsJoined requires 0 args')1483 sys.exit(1)1484 pp.pprint(client.getGroupIdsJoined())1485elif cmd == 'getGroups':1486 if len(args) != 1:1487 print('getGroups requires 1 args')1488 sys.exit(1)1489 pp.pprint(client.getGroups(eval(args[0]),))1490elif cmd == 'getHiddenContactMids':1491 if len(args) != 0:1492 print('getHiddenContactMids requires 0 args')1493 sys.exit(1)1494 pp.pprint(client.getHiddenContactMids())1495elif cmd == 'getIdentityIdentifier':1496 if len(args) != 0:1497 print('getIdentityIdentifier requires 0 args')1498 sys.exit(1)1499 pp.pprint(client.getIdentityIdentifier())1500elif cmd == 'getLastAnnouncementIndex':1501 if len(args) != 0:1502 print('getLastAnnouncementIndex requires 0 args')1503 sys.exit(1)1504 pp.pprint(client.getLastAnnouncementIndex())1505elif cmd == 'getLastOpRevision':1506 if len(args) != 0:1507 print('getLastOpRevision requires 0 args')1508 sys.exit(1)1509 pp.pprint(client.getLastOpRevision())1510elif cmd == 'getMessageBox':1511 if len(args) != 3:1512 print('getMessageBox requires 3 args')1513 sys.exit(1)1514 pp.pprint(client.getMessageBox(args[0],args[1],eval(args[2]),))1515elif cmd == 'getMessageBoxCompactWrapUp':1516 if len(args) != 1:1517 print('getMessageBoxCompactWrapUp requires 1 args')1518 sys.exit(1)1519 pp.pprint(client.getMessageBoxCompactWrapUp(args[0],))1520elif cmd == 'getMessageBoxCompactWrapUpList':1521 if len(args) != 2:1522 print('getMessageBoxCompactWrapUpList requires 2 args')1523 sys.exit(1)1524 pp.pprint(client.getMessageBoxCompactWrapUpList(eval(args[0]),eval(args[1]),))1525elif cmd == 'getMessageBoxList':1526 if len(args) != 2:1527 print('getMessageBoxList requires 2 args')1528 sys.exit(1)1529 pp.pprint(client.getMessageBoxList(args[0],eval(args[1]),))1530elif cmd == 'getMessageBoxListByStatus':1531 if len(args) != 3:1532 print('getMessageBoxListByStatus requires 3 args')1533 sys.exit(1)1534 pp.pprint(client.getMessageBoxListByStatus(args[0],eval(args[1]),eval(args[2]),))1535elif cmd == 'getMessageBoxWrapUp':1536 if len(args) != 1:1537 print('getMessageBoxWrapUp requires 1 args')1538 sys.exit(1)1539 pp.pprint(client.getMessageBoxWrapUp(args[0],))1540elif cmd == 'getMessageBoxWrapUpList':1541 if len(args) != 2:1542 print('getMessageBoxWrapUpList requires 2 args')1543 sys.exit(1)1544 pp.pprint(client.getMessageBoxWrapUpList(eval(args[0]),eval(args[1]),))1545elif cmd == 'getMessagesBySequenceNumber':1546 if len(args) != 4:1547 print('getMessagesBySequenceNumber requires 4 args')1548 sys.exit(1)1549 pp.pprint(client.getMessagesBySequenceNumber(args[0],args[1],eval(args[2]),eval(args[3]),))1550elif cmd == 'getNextMessages':1551 if len(args) != 3:1552 print('getNextMessages requires 3 args')1553 sys.exit(1)1554 pp.pprint(client.getNextMessages(args[0],eval(args[1]),eval(args[2]),))1555elif cmd == 'getNotificationPolicy':1556 if len(args) != 1:1557 print('getNotificationPolicy requires 1 args')1558 sys.exit(1)1559 pp.pprint(client.getNotificationPolicy(eval(args[0]),))1560elif cmd == 'getPreviousMessages':1561 if len(args) != 3:1562 print('getPreviousMessages requires 3 args')1563 sys.exit(1)1564 pp.pprint(client.getPreviousMessages(args[0],eval(args[1]),eval(args[2]),))1565elif cmd == 'getProfile':1566 if len(args) != 0:1567 print('getProfile requires 0 args')1568 sys.exit(1)1569 pp.pprint(client.getProfile())1570elif cmd == 'getProximityMatchCandidateList':1571 if len(args) != 1:1572 print('getProximityMatchCandidateList requires 1 args')1573 sys.exit(1)1574 pp.pprint(client.getProximityMatchCandidateList(args[0],))1575elif cmd == 'getProximityMatchCandidates':1576 if len(args) != 1:1577 print('getProximityMatchCandidates requires 1 args')1578 sys.exit(1)1579 pp.pprint(client.getProximityMatchCandidates(args[0],))1580elif cmd == 'getRecentMessages':1581 if len(args) != 2:1582 print('getRecentMessages requires 2 args')1583 sys.exit(1)1584 pp.pprint(client.getRecentMessages(args[0],eval(args[1]),))1585elif cmd == 'getRecommendationIds':1586 if len(args) != 0:1587 print('getRecommendationIds requires 0 args')1588 sys.exit(1)1589 pp.pprint(client.getRecommendationIds())1590elif cmd == 'getRoom':1591 if len(args) != 1:1592 print('getRoom requires 1 args')1593 sys.exit(1)1594 pp.pprint(client.getRoom(args[0],))1595elif cmd == 'getRSAKeyInfo':1596 if len(args) != 1:1597 print('getRSAKeyInfo requires 1 args')1598 sys.exit(1)1599 pp.pprint(client.getRSAKeyInfo(eval(args[0]),))1600elif cmd == 'getServerTime':1601 if len(args) != 0:1602 print('getServerTime requires 0 args')1603 sys.exit(1)1604 pp.pprint(client.getServerTime())1605elif cmd == 'getSessions':1606 if len(args) != 0:1607 print('getSessions requires 0 args')1608 sys.exit(1)1609 pp.pprint(client.getSessions())1610elif cmd == 'getSettings':1611 if len(args) != 0:1612 print('getSettings requires 0 args')1613 sys.exit(1)1614 pp.pprint(client.getSettings())1615elif cmd == 'getSettingsAttributes':1616 if len(args) != 1:1617 print('getSettingsAttributes requires 1 args')1618 sys.exit(1)1619 pp.pprint(client.getSettingsAttributes(eval(args[0]),))1620elif cmd == 'getSystemConfiguration':1621 if len(args) != 0:1622 print('getSystemConfiguration requires 0 args')1623 sys.exit(1)1624 pp.pprint(client.getSystemConfiguration())1625elif cmd == 'getUserTicket':1626 if len(args) != 0:1627 print('getUserTicket requires 0 args')1628 sys.exit(1)1629 pp.pprint(client.getUserTicket())1630elif cmd == 'getWapInvitation':1631 if len(args) != 1:1632 print('getWapInvitation requires 1 args')1633 sys.exit(1)1634 pp.pprint(client.getWapInvitation(args[0],))1635elif cmd == 'invalidateUserTicket':1636 if len(args) != 0:1637 print('invalidateUserTicket requires 0 args')1638 sys.exit(1)1639 pp.pprint(client.invalidateUserTicket())1640elif cmd == 'inviteFriendsBySms':1641 if len(args) != 1:1642 print('inviteFriendsBySms requires 1 args')1643 sys.exit(1)1644 pp.pprint(client.inviteFriendsBySms(eval(args[0]),))1645elif cmd == 'inviteIntoGroup':1646 if len(args) != 3:1647 print('inviteIntoGroup requires 3 args')1648 sys.exit(1)1649 pp.pprint(client.inviteIntoGroup(eval(args[0]),args[1],eval(args[2]),))1650elif cmd == 'inviteIntoRoom':1651 if len(args) != 3:1652 print('inviteIntoRoom requires 3 args')1653 sys.exit(1)1654 pp.pprint(client.inviteIntoRoom(eval(args[0]),args[1],eval(args[2]),))1655elif cmd == 'inviteViaEmail':1656 if len(args) != 3:1657 print('inviteViaEmail requires 3 args')1658 sys.exit(1)1659 pp.pprint(client.inviteViaEmail(eval(args[0]),args[1],args[2],))1660elif cmd == 'isIdentityIdentifierAvailable':1661 if len(args) != 2:1662 print('isIdentityIdentifierAvailable requires 2 args')1663 sys.exit(1)1664 pp.pprint(client.isIdentityIdentifierAvailable(eval(args[0]),args[1],))1665elif cmd == 'isUseridAvailable':1666 if len(args) != 1:1667 print('isUseridAvailable requires 1 args')1668 sys.exit(1)1669 pp.pprint(client.isUseridAvailable(args[0],))1670elif cmd == 'kickoutFromGroup':1671 if len(args) != 3:1672 print('kickoutFromGroup requires 3 args')1673 sys.exit(1)1674 pp.pprint(client.kickoutFromGroup(eval(args[0]),args[1],eval(args[2]),))1675elif cmd == 'leaveGroup':1676 if len(args) != 2:1677 print('leaveGroup requires 2 args')1678 sys.exit(1)1679 pp.pprint(client.leaveGroup(eval(args[0]),args[1],))1680elif cmd == 'leaveRoom':1681 if len(args) != 2:1682 print('leaveRoom requires 2 args')1683 sys.exit(1)1684 pp.pprint(client.leaveRoom(eval(args[0]),args[1],))1685elif cmd == 'loginWithIdentityCredential':1686 if len(args) != 7:1687 print('loginWithIdentityCredential requires 7 args')1688 sys.exit(1)1689 pp.pprint(client.loginWithIdentityCredential(eval(args[0]),args[1],args[2],eval(args[3]),args[4],args[5],args[6],))1690elif cmd == 'loginWithIdentityCredentialForCertificate':1691 if len(args) != 7:1692 print('loginWithIdentityCredentialForCertificate requires 7 args')1693 sys.exit(1)1694 pp.pprint(client.loginWithIdentityCredentialForCertificate(eval(args[0]),args[1],args[2],eval(args[3]),args[4],args[5],args[6],))1695elif cmd == 'loginWithVerifier':1696 if len(args) != 1:1697 print('loginWithVerifier requires 1 args')1698 sys.exit(1)1699 pp.pprint(client.loginWithVerifier(args[0],))1700elif cmd == 'loginWithVerifierForCerificate':1701 if len(args) != 1:1702 print('loginWithVerifierForCerificate requires 1 args')1703 sys.exit(1)1704 pp.pprint(client.loginWithVerifierForCerificate(args[0],))1705elif cmd == 'loginWithVerifierForCertificate':1706 if len(args) != 1:1707 print('loginWithVerifierForCertificate requires 1 args')1708 sys.exit(1)1709 pp.pprint(client.loginWithVerifierForCertificate(args[0],))1710elif cmd == 'loginZ':1711 if len(args) != 1:1712 print('loginZ requires 1 args')1713 sys.exit(1)1714 pp.pprint(client.loginZ(eval(args[0]),))1715elif cmd == 'logout':1716 if len(args) != 0:1717 print('logout requires 0 args')1718 sys.exit(1)1719 pp.pprint(client.logout())1720elif cmd == 'logoutSession':1721 if len(args) != 1:1722 print('logoutSession requires 1 args')1723 sys.exit(1)1724 pp.pprint(client.logoutSession(args[0],))1725elif cmd == 'noop':1726 if len(args) != 0:1727 print('noop requires 0 args')1728 sys.exit(1)1729 pp.pprint(client.noop())1730elif cmd == 'notifiedRedirect':1731 if len(args) != 1:1732 print('notifiedRedirect requires 1 args')1733 sys.exit(1)1734 pp.pprint(client.notifiedRedirect(eval(args[0]),))1735elif cmd == 'notifyBuddyOnAir':1736 if len(args) != 2:1737 print('notifyBuddyOnAir requires 2 args')1738 sys.exit(1)1739 pp.pprint(client.notifyBuddyOnAir(eval(args[0]),eval(args[1]),))1740elif cmd == 'notifyIndividualEvent':1741 if len(args) != 2:1742 print('notifyIndividualEvent requires 2 args')1743 sys.exit(1)1744 pp.pprint(client.notifyIndividualEvent(eval(args[0]),eval(args[1]),))1745elif cmd == 'notifyInstalled':1746 if len(args) != 2:1747 print('notifyInstalled requires 2 args')1748 sys.exit(1)1749 pp.pprint(client.notifyInstalled(args[0],args[1],))1750elif cmd == 'notifyRegistrationComplete':1751 if len(args) != 2:1752 print('notifyRegistrationComplete requires 2 args')1753 sys.exit(1)1754 pp.pprint(client.notifyRegistrationComplete(args[0],args[1],))1755elif cmd == 'notifySleep':1756 if len(args) != 2:1757 print('notifySleep requires 2 args')1758 sys.exit(1)1759 pp.pprint(client.notifySleep(eval(args[0]),eval(args[1]),))1760elif cmd == 'notifyUpdated':1761 if len(args) != 2:1762 print('notifyUpdated requires 2 args')1763 sys.exit(1)1764 pp.pprint(client.notifyUpdated(eval(args[0]),eval(args[1]),))1765elif cmd == 'openProximityMatch':1766 if len(args) != 1:1767 print('openProximityMatch requires 1 args')1768 sys.exit(1)1769 pp.pprint(client.openProximityMatch(eval(args[0]),))1770elif cmd == 'registerBuddyUser':1771 if len(args) != 2:1772 print('registerBuddyUser requires 2 args')1773 sys.exit(1)1774 pp.pprint(client.registerBuddyUser(args[0],args[1],))1775elif cmd == 'registerBuddyUserid':1776 if len(args) != 2:1777 print('registerBuddyUserid requires 2 args')1778 sys.exit(1)1779 pp.pprint(client.registerBuddyUserid(eval(args[0]),args[1],))1780elif cmd == 'registerDevice':1781 if len(args) != 1:1782 print('registerDevice requires 1 args')1783 sys.exit(1)1784 pp.pprint(client.registerDevice(args[0],))1785elif cmd == 'registerDeviceWithIdentityCredential':1786 if len(args) != 4:1787 print('registerDeviceWithIdentityCredential requires 4 args')1788 sys.exit(1)1789 pp.pprint(client.registerDeviceWithIdentityCredential(args[0],eval(args[1]),args[2],args[3],))1790elif cmd == 'registerDeviceWithoutPhoneNumber':1791 if len(args) != 3:1792 print('registerDeviceWithoutPhoneNumber requires 3 args')1793 sys.exit(1)1794 pp.pprint(client.registerDeviceWithoutPhoneNumber(args[0],args[1],eval(args[2]),))1795elif cmd == 'registerDeviceWithoutPhoneNumberWithIdentityCredential':1796 if len(args) != 7:1797 print('registerDeviceWithoutPhoneNumberWithIdentityCredential requires 7 args')1798 sys.exit(1)1799 pp.pprint(client.registerDeviceWithoutPhoneNumberWithIdentityCredential(args[0],args[1],eval(args[2]),eval(args[3]),args[4],args[5],args[6],))1800elif cmd == 'registerUserid':1801 if len(args) != 2:1802 print('registerUserid requires 2 args')1803 sys.exit(1)1804 pp.pprint(client.registerUserid(eval(args[0]),args[1],))1805elif cmd == 'registerWapDevice':1806 if len(args) != 4:1807 print('registerWapDevice requires 4 args')1808 sys.exit(1)1809 pp.pprint(client.registerWapDevice(args[0],args[1],args[2],eval(args[3]),))1810elif cmd == 'registerWithExistingSnsIdAndIdentityCredential':1811 if len(args) != 4:1812 print('registerWithExistingSnsIdAndIdentityCredential requires 4 args')1813 sys.exit(1)1814 pp.pprint(client.registerWithExistingSnsIdAndIdentityCredential(eval(args[0]),args[1],args[2],eval(args[3]),))1815elif cmd == 'registerWithSnsId':1816 if len(args) != 6:1817 print('registerWithSnsId requires 6 args')1818 sys.exit(1)1819 pp.pprint(client.registerWithSnsId(eval(args[0]),args[1],args[2],args[3],eval(args[4]),args[5],))1820elif cmd == 'registerWithSnsIdAndIdentityCredential':1821 if len(args) != 6:1822 print('registerWithSnsIdAndIdentityCredential requires 6 args')1823 sys.exit(1)1824 pp.pprint(client.registerWithSnsIdAndIdentityCredential(eval(args[0]),args[1],eval(args[2]),args[3],args[4],eval(args[5]),))1825elif cmd == 'reissueDeviceCredential':1826 if len(args) != 0:1827 print('reissueDeviceCredential requires 0 args')1828 sys.exit(1)1829 pp.pprint(client.reissueDeviceCredential())1830elif cmd == 'reissueUserTicket':1831 if len(args) != 2:1832 print('reissueUserTicket requires 2 args')1833 sys.exit(1)1834 pp.pprint(client.reissueUserTicket(eval(args[0]),eval(args[1]),))1835elif cmd == 'reissueGroupTicket':1836 if len(args) != 1:1837 print('reissueGroupTicket requires 1 args')1838 sys.exit(1)1839 pp.pprint(client.reissueGroupTicket(args[0],))1840elif cmd == 'rejectGroupInvitation':1841 if len(args) != 2:1842 print('rejectGroupInvitation requires 2 args')1843 sys.exit(1)1844 pp.pprint(client.rejectGroupInvitation(eval(args[0]),args[1],))1845elif cmd == 'releaseSession':1846 if len(args) != 0:1847 print('releaseSession requires 0 args')1848 sys.exit(1)1849 pp.pprint(client.releaseSession())1850elif cmd == 'removeAllMessages':1851 if len(args) != 2:1852 print('removeAllMessages requires 2 args')1853 sys.exit(1)1854 pp.pprint(client.removeAllMessages(eval(args[0]),args[1],))1855elif cmd == 'removeBuddyLocation':1856 if len(args) != 2:1857 print('removeBuddyLocation requires 2 args')1858 sys.exit(1)1859 pp.pprint(client.removeBuddyLocation(args[0],eval(args[1]),))1860elif cmd == 'removeMessage':1861 if len(args) != 1:1862 print('removeMessage requires 1 args')1863 sys.exit(1)1864 pp.pprint(client.removeMessage(args[0],))1865elif cmd == 'removeMessageFromMyHome':1866 if len(args) != 1:1867 print('removeMessageFromMyHome requires 1 args')1868 sys.exit(1)1869 pp.pprint(client.removeMessageFromMyHome(args[0],))1870elif cmd == 'removeSnsId':1871 if len(args) != 1:1872 print('removeSnsId requires 1 args')1873 sys.exit(1)1874 pp.pprint(client.removeSnsId(eval(args[0]),))1875elif cmd == 'report':1876 if len(args) != 3:1877 print('report requires 3 args')1878 sys.exit(1)1879 pp.pprint(client.report(eval(args[0]),eval(args[1]),args[2],))1880elif cmd == 'reportContacts':1881 if len(args) != 4:1882 print('reportContacts requires 4 args')1883 sys.exit(1)1884 pp.pprint(client.reportContacts(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))1885elif cmd == 'reportGroups':1886 if len(args) != 2:1887 print('reportGroups requires 2 args')1888 sys.exit(1)1889 pp.pprint(client.reportGroups(eval(args[0]),eval(args[1]),))1890elif cmd == 'reportProfile':1891 if len(args) != 2:1892 print('reportProfile requires 2 args')1893 sys.exit(1)1894 pp.pprint(client.reportProfile(eval(args[0]),eval(args[1]),))1895elif cmd == 'reportRooms':1896 if len(args) != 2:1897 print('reportRooms requires 2 args')1898 sys.exit(1)1899 pp.pprint(client.reportRooms(eval(args[0]),eval(args[1]),))1900elif cmd == 'reportSettings':1901 if len(args) != 2:1902 print('reportSettings requires 2 args')1903 sys.exit(1)1904 pp.pprint(client.reportSettings(eval(args[0]),eval(args[1]),))1905elif cmd == 'reportSpammer':1906 if len(args) != 3:1907 print('reportSpammer requires 3 args')1908 sys.exit(1)1909 pp.pprint(client.reportSpammer(args[0],eval(args[1]),eval(args[2]),))1910elif cmd == 'requestAccountPasswordReset':1911 if len(args) != 3:1912 print('requestAccountPasswordReset requires 3 args')1913 sys.exit(1)1914 pp.pprint(client.requestAccountPasswordReset(eval(args[0]),args[1],args[2],))1915elif cmd == 'requestEmailConfirmation':1916 if len(args) != 1:1917 print('requestEmailConfirmation requires 1 args')1918 sys.exit(1)1919 pp.pprint(client.requestEmailConfirmation(eval(args[0]),))1920elif cmd == 'requestIdentityUnbind':1921 if len(args) != 2:1922 print('requestIdentityUnbind requires 2 args')1923 sys.exit(1)1924 pp.pprint(client.requestIdentityUnbind(eval(args[0]),args[1],))1925elif cmd == 'resendEmailConfirmation':1926 if len(args) != 1:1927 print('resendEmailConfirmation requires 1 args')1928 sys.exit(1)1929 pp.pprint(client.resendEmailConfirmation(args[0],))1930elif cmd == 'resendPinCode':1931 if len(args) != 1:1932 print('resendPinCode requires 1 args')1933 sys.exit(1)1934 pp.pprint(client.resendPinCode(args[0],))1935elif cmd == 'resendPinCodeBySMS':1936 if len(args) != 1:1937 print('resendPinCodeBySMS requires 1 args')1938 sys.exit(1)1939 pp.pprint(client.resendPinCodeBySMS(args[0],))1940elif cmd == 'sendChatChecked':1941 if len(args) != 3:1942 print('sendChatChecked requires 3 args')1943 sys.exit(1)1944 pp.pprint(client.sendChatChecked(eval(args[0]),args[1],args[2],))1945elif cmd == 'sendChatRemoved':1946 if len(args) != 3:1947 print('sendChatRemoved requires 3 args')1948 sys.exit(1)1949 pp.pprint(client.sendChatRemoved(eval(args[0]),args[1],args[2],))1950elif cmd == 'sendContentPreviewUpdated':1951 if len(args) != 3:1952 print('sendContentPreviewUpdated requires 3 args')1953 sys.exit(1)1954 pp.pprint(client.sendContentPreviewUpdated(eval(args[0]),args[1],eval(args[2]),))1955elif cmd == 'sendContentReceipt':1956 if len(args) != 3:1957 print('sendContentReceipt requires 3 args')1958 sys.exit(1)1959 pp.pprint(client.sendContentReceipt(eval(args[0]),args[1],args[2],))1960elif cmd == 'sendDummyPush':1961 if len(args) != 0:1962 print('sendDummyPush requires 0 args')1963 sys.exit(1)1964 pp.pprint(client.sendDummyPush())1965elif cmd == 'sendEvent':1966 if len(args) != 2:1967 print('sendEvent requires 2 args')1968 sys.exit(1)1969 pp.pprint(client.sendEvent(eval(args[0]),eval(args[1]),))1970elif cmd == 'sendMessage':1971 if len(args) != 2:1972 print('sendMessage requires 2 args')1973 sys.exit(1)1974 pp.pprint(client.sendMessage(eval(args[0]),eval(args[1]),))1975elif cmd == 'sendMessageIgnored':1976 if len(args) != 3:1977 print('sendMessageIgnored requires 3 args')1978 sys.exit(1)1979 pp.pprint(client.sendMessageIgnored(eval(args[0]),args[1],eval(args[2]),))1980elif cmd == 'sendMessageReceipt':1981 if len(args) != 3:1982 print('sendMessageReceipt requires 3 args')1983 sys.exit(1)1984 pp.pprint(client.sendMessageReceipt(eval(args[0]),args[1],eval(args[2]),))1985elif cmd == 'sendMessageToMyHome':1986 if len(args) != 2:1987 print('sendMessageToMyHome requires 2 args')1988 sys.exit(1)1989 pp.pprint(client.sendMessageToMyHome(eval(args[0]),eval(args[1]),))1990elif cmd == 'setBuddyLocation':1991 if len(args) != 3:1992 print('setBuddyLocation requires 3 args')1993 sys.exit(1)1994 pp.pprint(client.setBuddyLocation(args[0],eval(args[1]),eval(args[2]),))1995elif cmd == 'setIdentityCredential':1996 if len(args) != 3:1997 print('setIdentityCredential requires 3 args')1998 sys.exit(1)1999 pp.pprint(client.setIdentityCredential(eval(args[0]),args[1],args[2],))2000elif cmd == 'setNotificationsEnabled':2001 if len(args) != 4:2002 print('setNotificationsEnabled requires 4 args')2003 sys.exit(1)2004 pp.pprint(client.setNotificationsEnabled(eval(args[0]),eval(args[1]),args[2],eval(args[3]),))2005elif cmd == 'startUpdateVerification':2006 if len(args) != 7:2007 print('startUpdateVerification requires 7 args')2008 sys.exit(1)2009 pp.pprint(client.startUpdateVerification(args[0],eval(args[1]),args[2],args[3],eval(args[4]),args[5],args[6],))2010elif cmd == 'startVerification':2011 if len(args) != 8:2012 print('startVerification requires 8 args')2013 sys.exit(1)2014 pp.pprint(client.startVerification(args[0],eval(args[1]),args[2],args[3],eval(args[4]),args[5],args[6],args[7],))2015elif cmd == 'storeUpdateProfileAttribute':2016 if len(args) != 3:2017 print('storeUpdateProfileAttribute requires 3 args')2018 sys.exit(1)2019 pp.pprint(client.storeUpdateProfileAttribute(eval(args[0]),eval(args[1]),args[2],))2020elif cmd == 'syncContactBySnsIds':2021 if len(args) != 2:2022 print('syncContactBySnsIds requires 2 args')2023 sys.exit(1)2024 pp.pprint(client.syncContactBySnsIds(eval(args[0]),eval(args[1]),))2025elif cmd == 'syncContacts':2026 if len(args) != 2:2027 print('syncContacts requires 2 args')2028 sys.exit(1)2029 pp.pprint(client.syncContacts(eval(args[0]),eval(args[1]),))2030elif cmd == 'trySendMessage':2031 if len(args) != 2:2032 print('trySendMessage requires 2 args')2033 sys.exit(1)2034 pp.pprint(client.trySendMessage(eval(args[0]),eval(args[1]),))2035elif cmd == 'unblockContact':2036 if len(args) != 2:2037 print('unblockContact requires 2 args')2038 sys.exit(1)2039 pp.pprint(client.unblockContact(eval(args[0]),args[1],))2040elif cmd == 'unblockRecommendation':2041 if len(args) != 2:2042 print('unblockRecommendation requires 2 args')2043 sys.exit(1)2044 pp.pprint(client.unblockRecommendation(eval(args[0]),args[1],))2045elif cmd == 'unregisterUserAndDevice':2046 if len(args) != 0:2047 print('unregisterUserAndDevice requires 0 args')2048 sys.exit(1)2049 pp.pprint(client.unregisterUserAndDevice())2050elif cmd == 'updateApnsDeviceToken':2051 if len(args) != 1:2052 print('updateApnsDeviceToken requires 1 args')2053 sys.exit(1)2054 pp.pprint(client.updateApnsDeviceToken(args[0],))2055elif cmd == 'updateBuddySetting':2056 if len(args) != 2:2057 print('updateBuddySetting requires 2 args')2058 sys.exit(1)2059 pp.pprint(client.updateBuddySetting(args[0],args[1],))2060elif cmd == 'updateC2DMRegistrationId':2061 if len(args) != 1:2062 print('updateC2DMRegistrationId requires 1 args')2063 sys.exit(1)2064 pp.pprint(client.updateC2DMRegistrationId(args[0],))2065elif cmd == 'updateContactSetting':2066 if len(args) != 4:2067 print('updateContactSetting requires 4 args')2068 sys.exit(1)2069 pp.pprint(client.updateContactSetting(eval(args[0]),args[1],eval(args[2]),args[3],))2070elif cmd == 'updateCustomModeSettings':2071 if len(args) != 2:2072 print('updateCustomModeSettings requires 2 args')2073 sys.exit(1)2074 pp.pprint(client.updateCustomModeSettings(eval(args[0]),eval(args[1]),))2075elif cmd == 'updateDeviceInfo':2076 if len(args) != 2:2077 print('updateDeviceInfo requires 2 args')2078 sys.exit(1)2079 pp.pprint(client.updateDeviceInfo(args[0],eval(args[1]),))2080elif cmd == 'updateGroup':2081 if len(args) != 2:2082 print('updateGroup requires 2 args')2083 sys.exit(1)2084 pp.pprint(client.updateGroup(eval(args[0]),eval(args[1]),))2085elif cmd == 'updateNotificationToken':2086 if len(args) != 2:2087 print('updateNotificationToken requires 2 args')2088 sys.exit(1)2089 pp.pprint(client.updateNotificationToken(eval(args[0]),args[1],))2090elif cmd == 'updateNotificationTokenWithBytes':2091 if len(args) != 2:2092 print('updateNotificationTokenWithBytes requires 2 args')2093 sys.exit(1)2094 pp.pprint(client.updateNotificationTokenWithBytes(eval(args[0]),args[1],))2095elif cmd == 'updateProfile':2096 if len(args) != 2:2097 print('updateProfile requires 2 args')2098 sys.exit(1)2099 pp.pprint(client.updateProfile(eval(args[0]),eval(args[1]),))2100elif cmd == 'updateProfileAttribute':2101 if len(args) != 3:2102 print('updateProfileAttribute requires 3 args')2103 sys.exit(1)2104 pp.pprint(client.updateProfileAttribute(eval(args[0]),eval(args[1]),args[2],))2105elif cmd == 'updateRegion':2106 if len(args) != 1:2107 print('updateRegion requires 1 args')2108 sys.exit(1)2109 pp.pprint(client.updateRegion(args[0],))2110elif cmd == 'updateSettings':2111 if len(args) != 2:2112 print('updateSettings requires 2 args')2113 sys.exit(1)2114 pp.pprint(client.updateSettings(eval(args[0]),eval(args[1]),))2115elif cmd == 'updateSettings2':2116 if len(args) != 2:2117 print('updateSettings2 requires 2 args')2118 sys.exit(1)2119 pp.pprint(client.updateSettings2(eval(args[0]),eval(args[1]),))2120elif cmd == 'updateSettingsAttribute':2121 if len(args) != 3:2122 print('updateSettingsAttribute requires 3 args')2123 sys.exit(1)2124 pp.pprint(client.updateSettingsAttribute(eval(args[0]),eval(args[1]),args[2],))2125elif cmd == 'updateSettingsAttributes':2126 if len(args) != 3:2127 print('updateSettingsAttributes requires 3 args')2128 sys.exit(1)2129 pp.pprint(client.updateSettingsAttributes(eval(args[0]),eval(args[1]),eval(args[2]),))2130elif cmd == 'verifyIdentityCredential':2131 if len(args) != 3:2132 print('verifyIdentityCredential requires 3 args')2133 sys.exit(1)2134 pp.pprint(client.verifyIdentityCredential(eval(args[0]),args[1],args[2],))2135elif cmd == 'verifyIdentityCredentialWithResult':2136 if len(args) != 1:2137 print('verifyIdentityCredentialWithResult requires 1 args')2138 sys.exit(1)2139 pp.pprint(client.verifyIdentityCredentialWithResult(eval(args[0]),))2140elif cmd == 'verifyPhone':2141 if len(args) != 3:2142 print('verifyPhone requires 3 args')2143 sys.exit(1)2144 pp.pprint(client.verifyPhone(args[0],args[1],args[2],))2145elif cmd == 'verifyQrcode':2146 if len(args) != 2:2147 print('verifyQrcode requires 2 args')2148 sys.exit(1)2149 pp.pprint(client.verifyQrcode(args[0],args[1],))2150elif cmd == 'notify':2151 if len(args) != 1:2152 print('notify requires 1 args')2153 sys.exit(1)2154 pp.pprint(client.notify(eval(args[0]),))2155elif cmd == 'inviteIntoGroupCall':2156 if len(args) != 2:2157 print('inviteIntoGroupCall requires 2 args')2158 sys.exit(1)2159 pp.pprint(client.inviteIntoGroupCall(args[0],eval(args[1]),))2160else:2161 print('Unrecognized method %s' % cmd)2162 sys.exit(1)...
transformer_lm.py
Source:transformer_lm.py
1# Copyright (c) Facebook, Inc. and its affiliates.2#3# This source code is licensed under the MIT license found in the4# LICENSE file in the root directory of this source tree.5from dataclasses import dataclass, field6from typing import Optional7from fairseq import options, utils8from fairseq.dataclass import ChoiceEnum, FairseqDataclass9from fairseq.models import (10 FairseqLanguageModel,11 register_model,12 register_model_architecture,13)14from fairseq.models.transformer import (15 DEFAULT_MIN_PARAMS_TO_WRAP, Embedding, TransformerDecoder16)17from fairseq.modules import AdaptiveInput, CharacterTokenEmbedder18from omegaconf import II19DEFAULT_MAX_TARGET_POSITIONS = 102420@dataclass21class TransformerLanguageModelConfig(FairseqDataclass):22 activation_fn: ChoiceEnum(utils.get_available_activation_fns()) = field(23 default="relu", metadata={"help": "activation function to use"}24 )25 dropout: float = field(default=0.1, metadata={"help": "dropout probability"})26 attention_dropout: float = field(27 default=0.0, metadata={"help": "dropout probability for attention weights"}28 )29 activation_dropout: float = field(30 default=0.0, metadata={"help": "dropout probability after activation in FFN."}31 )32 relu_dropout: float = field(33 default=0.0, metadata={"help": "dropout probability after activation in FFN."}34 )35 decoder_embed_dim: int = field(36 default=512, metadata={"help": "decoder embedding dimension"}37 )38 decoder_output_dim: int = field(39 default=512, metadata={"help": "decoder output dimension"}40 )41 decoder_input_dim: int = field(42 default=512, metadata={"help": "decoder input dimension"}43 )44 decoder_ffn_embed_dim: int = field(45 default=2048, metadata={"help": "decoder embedding dimension for FFN"}46 )47 decoder_layers: int = field(default=6, metadata={"help": "num decoder layers"})48 decoder_attention_heads: int = field(49 default=8, metadata={"help": "num decoder attention heads"}50 )51 decoder_normalize_before: bool = field(52 default=False, metadata={"help": "apply layernorm before each decoder block"}53 )54 no_decoder_final_norm: bool = field(55 default=False,56 metadata={"help": "don't add an extra layernorm after the last decoder block"},57 )58 adaptive_softmax_cutoff: Optional[str] = field(59 default=None,60 metadata={61 "help": "comma separated list of adaptive softmax cutoff points. "62 "Must be used with adaptive_loss criterion"63 },64 )65 adaptive_softmax_dropout: float = field(66 default=0,67 metadata={"help": "sets adaptive softmax dropout for the tail projections"},68 )69 adaptive_softmax_factor: float = field(70 default=4, metadata={"help": "adaptive input factor"}71 )72 no_token_positional_embeddings: bool = field(73 default=False,74 metadata={75 "help": "if set, disables positional embeddings (outside self attention)"76 },77 )78 share_decoder_input_output_embed: bool = field(79 default=False, metadata={"help": "share decoder input and output embeddings"}80 )81 character_embeddings: bool = field(82 default=False,83 metadata={84 "help": "if set, uses character embedding convolutions to produce token embeddings"85 },86 )87 character_filters: str = field(88 default="[(1, 64), (2, 128), (3, 192), (4, 256), (5, 256), (6, 256), (7, 256)]",89 metadata={"help": "size of character embeddings"},90 )91 character_embedding_dim: int = field(92 default=4, metadata={"help": "size of character embeddings"}93 )94 char_embedder_highway_layers: int = field(95 default=2,96 metadata={"help": "number of highway layers for character token embeddder"},97 )98 adaptive_input: bool = field(99 default=False, metadata={"help": "if set, uses adaptive input"}100 )101 adaptive_input_factor: float = field(102 default=4, metadata={"help": "adaptive input factor"}103 )104 adaptive_input_cutoff: Optional[str] = field(105 default=None,106 metadata={"help": "comma separated list of adaptive input cutoff points."},107 )108 tie_adaptive_weights: bool = field(109 default=False,110 metadata={111 "help": "if set, ties the weights of adaptive softmax and adaptive input"112 },113 )114 tie_adaptive_proj: bool = field(115 default=False,116 metadata={117 "help": "if set, ties the projection weights of adaptive softmax and adaptive input"118 },119 )120 decoder_learned_pos: bool = field(121 default=False,122 metadata={"help": "use learned positional embeddings in the decoder"},123 )124 layernorm_embedding: bool = field(125 default=False, metadata={"help": "add layernorm to embedding"}126 )127 no_scale_embedding: bool = field(128 default=False, metadata={"help": "if True, dont scale embeddings"}129 )130 checkpoint_activations: bool = field(131 default=False, metadata={"help": "checkpoint activations at each layer"}132 )133 offload_activations: bool = field(134 default=False,135 metadata={"help": "move checkpointed activations to CPU after they are used."},136 )137 # config for "Reducing Transformer Depth on Demand with Structured Dropout" (Fan et al., 2019)138 decoder_layerdrop: float = field(139 default=0.0, metadata={"help": "LayerDrop probability for decoder"}140 )141 decoder_layers_to_keep: Optional[str] = field(142 default=None,143 metadata={144 "help": "which layers to *keep* when pruning as a comma-separated list"145 },146 )147 # config for Training with Quantization Noise for Extreme Model Compression ({Fan*, Stock*} et al., 2020)148 quant_noise_pq: float = field(149 default=0.0,150 metadata={"help": "iterative PQ quantization noise at training time"},151 )152 quant_noise_pq_block_size: int = field(153 default=8,154 metadata={"help": "block size of quantization noise at training time"},155 )156 quant_noise_scalar: float = field(157 default=0.0,158 metadata={159 "help": "scalar quantization noise and scalar quantization at training time"160 },161 )162 # config for Fully Sharded Data Parallel (FSDP) training163 min_params_to_wrap: int = field(164 default=DEFAULT_MIN_PARAMS_TO_WRAP,165 metadata={166 "help": (167 "minimum number of params for a layer to be wrapped with FSDP() when "168 "training with --ddp-backend=fully_sharded. Smaller values will "169 "improve memory efficiency, but may make torch.distributed "170 "communication less efficient due to smaller input sizes. This option "171 "is set to 0 (i.e., always wrap) when --checkpoint-activations or "172 "--offload-activations are passed."173 )174 }175 )176 # options from other parts of the config177 add_bos_token: bool = II("task.add_bos_token")178 tokens_per_sample: int = II("task.tokens_per_sample")179 max_target_positions: Optional[int] = II("task.max_target_positions")180 tpu: bool = II("common.tpu")181@register_model("transformer_lm", dataclass=TransformerLanguageModelConfig)182class TransformerLanguageModel(FairseqLanguageModel):183 @classmethod184 def hub_models(cls):185 def moses_fastbpe(path):186 return {"path": path, "tokenizer": "moses", "bpe": "fastbpe"}187 def spm(path):188 return {"path": path, "tokenizer": "space", "bpe": "sentencepiece"}189 return {190 "transformer_lm.gbw.adaptive_huge": "https://dl.fbaipublicfiles.com/fairseq/models/lm/adaptive_lm_gbw_huge.tar.bz2",191 "transformer_lm.wiki103.adaptive": "https://dl.fbaipublicfiles.com/fairseq/models/lm/adaptive_lm_wiki103.v2.tar.bz2",192 "transformer_lm.wmt19.en": moses_fastbpe(193 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt19.en.tar.bz2"194 ),195 "transformer_lm.wmt19.de": moses_fastbpe(196 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt19.de.tar.bz2"197 ),198 "transformer_lm.wmt19.ru": moses_fastbpe(199 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt19.ru.tar.bz2"200 ),201 "transformer_lm.wmt20.en": spm(202 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt20.en.tar.gz"203 ),204 "transformer_lm.wmt20.ta": spm(205 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt20.ta.tar.gz"206 ),207 "transformer_lm.wmt20.iu.news": spm(208 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt20.iu.news.tar.gz"209 ),210 "transformer_lm.wmt20.iu.nh": spm(211 "https://dl.fbaipublicfiles.com/fairseq/models/lm/wmt20.iu.nh.tar.gz"212 ),213 }214 def __init__(self, decoder):215 super().__init__(decoder)216 @classmethod217 def build_model(cls, args, task):218 """Build a new model instance."""219 if args.decoder_layers_to_keep:220 args.decoder_layers = len(args.decoder_layers_to_keep.split(","))221 if getattr(args, "max_target_positions", None) is None:222 args.max_target_positions = getattr(223 args, "tokens_per_sample", DEFAULT_MAX_TARGET_POSITIONS224 )225 if args.character_embeddings:226 embed_tokens = CharacterTokenEmbedder(227 task.source_dictionary,228 eval(args.character_filters),229 args.character_embedding_dim,230 args.decoder_embed_dim,231 args.char_embedder_highway_layers,232 )233 elif args.adaptive_input:234 embed_tokens = AdaptiveInput(235 len(task.source_dictionary),236 task.source_dictionary.pad(),237 args.decoder_input_dim,238 args.adaptive_input_factor,239 args.decoder_embed_dim,240 options.eval_str_list(args.adaptive_input_cutoff, type=int),241 args.quant_noise_pq,242 args.quant_noise_pq_block_size,243 )244 else:245 embed_tokens = cls.build_embedding(246 args, task.source_dictionary, args.decoder_input_dim247 )248 if args.tie_adaptive_weights:249 assert args.adaptive_input250 assert args.adaptive_input_factor == args.adaptive_softmax_factor251 assert (252 args.adaptive_softmax_cutoff == args.adaptive_input_cutoff253 ), "{} != {}".format(254 args.adaptive_softmax_cutoff, args.adaptive_input_cutoff255 )256 assert args.decoder_input_dim == args.decoder_output_dim257 decoder = TransformerDecoder(258 args, task.target_dictionary, embed_tokens, no_encoder_attn=True259 )260 return cls(decoder)261 @classmethod262 def build_embedding(cls, args, dictionary, embed_dim, path=None):263 embed_tokens = Embedding(len(dictionary), embed_dim, dictionary.pad())264 return embed_tokens265def base_lm_architecture(args):266 # backward compatibility for older model checkpoints267 if hasattr(args, "no_tie_adaptive_proj"):268 # previous models defined --no-tie-adaptive-proj, so use the existence of269 # that option to determine if this is an "old" model checkpoint270 args.no_decoder_final_norm = True # old models always set this to True271 if args.no_tie_adaptive_proj is False:272 args.tie_adaptive_proj = True273 if hasattr(args, "decoder_final_norm"):274 args.no_decoder_final_norm = not args.decoder_final_norm275 args.dropout = getattr(args, "dropout", 0.1)276 args.attention_dropout = getattr(args, "attention_dropout", 0.0)277 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 512)278 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 2048)279 args.decoder_layers = getattr(args, "decoder_layers", 6)280 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 8)281 args.adaptive_softmax_cutoff = getattr(args, "adaptive_softmax_cutoff", None)282 args.adaptive_softmax_dropout = getattr(args, "adaptive_softmax_dropout", 0)283 args.adaptive_softmax_factor = getattr(args, "adaptive_softmax_factor", 4)284 args.decoder_learned_pos = getattr(args, "decoder_learned_pos", False)285 args.activation_fn = getattr(args, "activation_fn", "relu")286 args.decoder_layerdrop = getattr(args, "decoder_layerdrop", 0)287 args.decoder_layers_to_keep = getattr(args, "decoder_layers_to_keep", None)288 args.quant_noise_pq = getattr(args, "quant_noise_pq", 0)289 args.quant_noise_pq_block_size = getattr(args, "quant_noise_pq_block_size", 8)290 args.quant_noise_scalar = getattr(args, "quant_noise_scalar", 0)291 args.add_bos_token = getattr(args, "add_bos_token", False)292 args.no_token_positional_embeddings = getattr(293 args, "no_token_positional_embeddings", False294 )295 args.share_decoder_input_output_embed = getattr(296 args, "share_decoder_input_output_embed", False297 )298 args.character_embeddings = getattr(args, "character_embeddings", False)299 args.decoder_output_dim = getattr(300 args, "decoder_output_dim", args.decoder_embed_dim301 )302 args.decoder_input_dim = getattr(args, "decoder_input_dim", args.decoder_embed_dim)303 # Model training is not stable without this304 args.decoder_normalize_before = True305 args.no_decoder_final_norm = getattr(args, "no_decoder_final_norm", False)306 args.adaptive_input = getattr(args, "adaptive_input", False)307 args.adaptive_input_factor = getattr(args, "adaptive_input_factor", 4)308 args.adaptive_input_cutoff = getattr(args, "adaptive_input_cutoff", None)309 args.tie_adaptive_weights = getattr(args, "tie_adaptive_weights", False)310 args.tie_adaptive_proj = getattr(args, "tie_adaptive_proj", False)311 args.no_scale_embedding = getattr(args, "no_scale_embedding", False)312 args.layernorm_embedding = getattr(args, "layernorm_embedding", False)313 args.checkpoint_activations = getattr(args, "checkpoint_activations", False)314 args.offload_activations = getattr(args, "offload_activations", False)315 if args.offload_activations:316 args.checkpoint_activations = True317@register_model_architecture("transformer_lm", "transformer_lm_big")318def transformer_lm_big(args):319 args.decoder_layers = getattr(args, "decoder_layers", 12)320 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1024)321 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 4096)322 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 16)323 base_lm_architecture(args)324@register_model_architecture("transformer_lm", "transformer_lm_wiki103")325@register_model_architecture("transformer_lm", "transformer_lm_baevski_wiki103")326def transformer_lm_baevski_wiki103(args):327 args.decoder_layers = getattr(args, "decoder_layers", 16)328 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 8)329 args.dropout = getattr(args, "dropout", 0.3)330 args.adaptive_input = getattr(args, "adaptive_input", True)331 args.tie_adaptive_weights = getattr(args, "tie_adaptive_weights", True)332 args.adaptive_input_cutoff = getattr(args, "adaptive_input_cutoff", "20000,60000")333 args.adaptive_softmax_cutoff = getattr(334 args, "adaptive_softmax_cutoff", "20000,60000"335 )336 args.adaptive_softmax_dropout = getattr(args, "adaptive_softmax_dropout", 0.2)337 args.attention_dropout = getattr(args, "attention_dropout", 0.1)338 args.activation_dropout = getattr(args, "activation_dropout", 0.1)339 args.no_decoder_final_norm = getattr(args, "no_decoder_final_norm", True)340 args.tie_adaptive_proj = getattr(args, "tie_adaptive_proj", True)341 transformer_lm_big(args)342@register_model_architecture("transformer_lm", "transformer_lm_gbw")343@register_model_architecture("transformer_lm", "transformer_lm_baevski_gbw")344def transformer_lm_baevski_gbw(args):345 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 512)346 args.dropout = getattr(args, "dropout", 0.1)347 args.attention_dropout = getattr(args, "attention_dropout", 0.1)348 args.no_decoder_final_norm = getattr(args, "no_decoder_final_norm", True)349 transformer_lm_big(args)350@register_model_architecture("transformer_lm", "transformer_lm_gpt")351def transformer_lm_gpt(args):352 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 768)353 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 3072)354 args.decoder_layers = getattr(args, "decoder_layers", 12)355 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 12)356 args.dropout = getattr(args, "dropout", 0.1)357 args.attention_dropout = getattr(args, "attention_dropout", 0.1)358 args.activation_fn = getattr(args, "activation_fn", "gelu")359 base_lm_architecture(args)360@register_model_architecture("transformer_lm", "transformer_lm_gpt2_small")361def transformer_lm_gpt2_small(args):362 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1024)363 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 4096)364 args.decoder_layers = getattr(args, "decoder_layers", 24)365 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 16)366 args.dropout = getattr(args, "dropout", 0.1)367 args.attention_dropout = getattr(args, "attention_dropout", 0.1)368 args.activation_fn = getattr(args, "activation_fn", "gelu")369 base_lm_architecture(args)370@register_model_architecture("transformer_lm", "transformer_lm_gpt2_tiny")371def transformer_lm_gpt2_tiny(args):372 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 64)373 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 64)374 args.decoder_layers = getattr(args, "decoder_layers", 2)375 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 1)376 args.dropout = getattr(args, "dropout", 0.1)377 args.attention_dropout = getattr(args, "attention_dropout", 0.1)378 args.activation_fn = getattr(args, "activation_fn", "gelu")379 base_lm_architecture(args)380@register_model_architecture("transformer_lm", "transformer_lm_gpt2_medium")381def transformer_lm_gpt2_medium(args):382 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1280)383 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 5120)384 args.decoder_layers = getattr(args, "decoder_layers", 36)385 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 20)386 args.dropout = getattr(args, "dropout", 0.1)387 args.attention_dropout = getattr(args, "attention_dropout", 0.1)388 args.activation_fn = getattr(args, "activation_fn", "gelu")389 base_lm_architecture(args)390@register_model_architecture("transformer_lm", "transformer_lm_gpt2_big")391def transformer_lm_gpt2_big(args):392 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1600)393 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 6400)394 args.decoder_layers = getattr(args, "decoder_layers", 48)395 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 25)396 args.dropout = getattr(args, "dropout", 0.1)397 args.attention_dropout = getattr(args, "attention_dropout", 0.1)398 args.activation_fn = getattr(args, "activation_fn", "gelu")399 base_lm_architecture(args)400def base_gpt3_architecture(args):401 args.decoder_input_dim = args.decoder_embed_dim402 args.decoder_output_dim = args.decoder_embed_dim403 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", args.decoder_embed_dim * 4)404 # GPT-3 used learned positional embeddings, rather than sinusoidal405 args.decoder_learned_pos = getattr(args, "decoder_learned_pos", True)406 args.dropout = getattr(args, "dropout", 0.0)407 args.attention_dropout = getattr(args, "attention_dropout", 0.0)408 args.activation_fn = getattr(args, "activation_fn", "gelu")409 args.share_decoder_input_output_embed = True410 base_lm_architecture(args)411@register_model_architecture("transformer_lm", "transformer_lm_gpt3_small")412def transformer_lm_gpt3_small(args):413 # 125M params414 args.decoder_layers = getattr(args, "decoder_layers", 12)415 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 768)416 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 12)417 base_gpt3_architecture(args)418@register_model_architecture("transformer_lm", "transformer_lm_gpt3_medium")419def transformer_lm_gpt3_medium(args):420 # 350M params421 args.decoder_layers = getattr(args, "decoder_layers", 24)422 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1024)423 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 16)424 base_gpt3_architecture(args)425@register_model_architecture("transformer_lm", "transformer_lm_gpt3_large")426def transformer_lm_gpt3_large(args):427 # 760M params428 args.decoder_layers = getattr(args, "decoder_layers", 24)429 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1536)430 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 16)431 base_gpt3_architecture(args)432@register_model_architecture("transformer_lm", "transformer_lm_gpt3_xl")433def transformer_lm_gpt3_xl(args):434 # 1.3B params435 args.decoder_layers = getattr(args, "decoder_layers", 24)436 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 2048)437 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 32)438 base_gpt3_architecture(args)439@register_model_architecture("transformer_lm", "transformer_lm_gpt3_2_7")440def transformer_lm_gpt3_2_7(args):441 # 2.7B params442 args.decoder_layers = getattr(args, "decoder_layers", 32)443 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 2560)444 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 32)445 base_gpt3_architecture(args)446@register_model_architecture("transformer_lm", "transformer_lm_gpt3_6_7")447def transformer_lm_gpt3_6_7(args):448 # 6.7B params449 args.decoder_layers = getattr(args, "decoder_layers", 32)450 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 4096)451 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 32)452 base_gpt3_architecture(args)453@register_model_architecture("transformer_lm", "transformer_lm_gpt3_13")454def transformer_lm_gpt3_13(args):455 # 13B params456 args.decoder_layers = getattr(args, "decoder_layers", 40)457 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 5120)458 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 40)459 base_gpt3_architecture(args)460@register_model_architecture("transformer_lm", "transformer_lm_gpt3_175")461def transformer_lm_gpt3_175(args):462 # 175B params463 args.decoder_layers = getattr(args, "decoder_layers", 96)464 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 12288)465 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 96)...
pMC_mult.py
Source:pMC_mult.py
1# This file was created automatically by SWIG 1.3.29.2# Don't modify this file, modify the SWIG interface instead.3# This file is compatible with both classic and new-style classes.4import _pMC_mult5import new6new_instancemethod = new.instancemethod7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):8 if (name == "thisown"): return self.this.own(value)9 if (name == "this"):10 if type(value).__name__ == 'PySwigObject':11 self.__dict__[name] = value12 return13 method = class_type.__swig_setmethods__.get(name,None)14 if method: return method(self,value)15 if (not static) or hasattr(self,name):16 self.__dict__[name] = value17 else:18 raise AttributeError("You cannot add attributes to %s" % self)19def _swig_setattr(self,class_type,name,value):20 return _swig_setattr_nondynamic(self,class_type,name,value,0)21def _swig_getattr(self,class_type,name):22 if (name == "thisown"): return self.this.own()23 method = class_type.__swig_getmethods__.get(name,None)24 if method: return method(self)25 raise AttributeError,name26def _swig_repr(self):27 try: strthis = "proxy of " + self.this.__repr__()28 except: strthis = ""29 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)30import types31try:32 _object = types.ObjectType33 _newclass = 134except AttributeError:35 class _object : pass36 _newclass = 037del types38class PySwigIterator(_object):39 __swig_setmethods__ = {}40 __setattr__ = lambda self, name, value: _swig_setattr(self, PySwigIterator, name, value)41 __swig_getmethods__ = {}42 __getattr__ = lambda self, name: _swig_getattr(self, PySwigIterator, name)43 def __init__(self): raise AttributeError, "No constructor defined"44 __repr__ = _swig_repr45 __swig_destroy__ = _pMC_mult.delete_PySwigIterator46 __del__ = lambda self : None;47 def value(*args): return _pMC_mult.PySwigIterator_value(*args)48 def incr(*args): return _pMC_mult.PySwigIterator_incr(*args)49 def decr(*args): return _pMC_mult.PySwigIterator_decr(*args)50 def distance(*args): return _pMC_mult.PySwigIterator_distance(*args)51 def equal(*args): return _pMC_mult.PySwigIterator_equal(*args)52 def copy(*args): return _pMC_mult.PySwigIterator_copy(*args)53 def next(*args): return _pMC_mult.PySwigIterator_next(*args)54 def previous(*args): return _pMC_mult.PySwigIterator_previous(*args)55 def advance(*args): return _pMC_mult.PySwigIterator_advance(*args)56 def __eq__(*args): return _pMC_mult.PySwigIterator___eq__(*args)57 def __ne__(*args): return _pMC_mult.PySwigIterator___ne__(*args)58 def __iadd__(*args): return _pMC_mult.PySwigIterator___iadd__(*args)59 def __isub__(*args): return _pMC_mult.PySwigIterator___isub__(*args)60 def __add__(*args): return _pMC_mult.PySwigIterator___add__(*args)61 def __sub__(*args): return _pMC_mult.PySwigIterator___sub__(*args)62 def __iter__(self): return self63PySwigIterator_swigregister = _pMC_mult.PySwigIterator_swigregister64PySwigIterator_swigregister(PySwigIterator)65class IntVector(_object):66 __swig_setmethods__ = {}67 __setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value)68 __swig_getmethods__ = {}69 __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name)70 __repr__ = _swig_repr71 def iterator(*args): return _pMC_mult.IntVector_iterator(*args)72 def __iter__(self): return self.iterator()73 def __nonzero__(*args): return _pMC_mult.IntVector___nonzero__(*args)74 def __len__(*args): return _pMC_mult.IntVector___len__(*args)75 def pop(*args): return _pMC_mult.IntVector_pop(*args)76 def __getslice__(*args): return _pMC_mult.IntVector___getslice__(*args)77 def __setslice__(*args): return _pMC_mult.IntVector___setslice__(*args)78 def __delslice__(*args): return _pMC_mult.IntVector___delslice__(*args)79 def __delitem__(*args): return _pMC_mult.IntVector___delitem__(*args)80 def __getitem__(*args): return _pMC_mult.IntVector___getitem__(*args)81 def __setitem__(*args): return _pMC_mult.IntVector___setitem__(*args)82 def append(*args): return _pMC_mult.IntVector_append(*args)83 def empty(*args): return _pMC_mult.IntVector_empty(*args)84 def size(*args): return _pMC_mult.IntVector_size(*args)85 def clear(*args): return _pMC_mult.IntVector_clear(*args)86 def swap(*args): return _pMC_mult.IntVector_swap(*args)87 def get_allocator(*args): return _pMC_mult.IntVector_get_allocator(*args)88 def begin(*args): return _pMC_mult.IntVector_begin(*args)89 def end(*args): return _pMC_mult.IntVector_end(*args)90 def rbegin(*args): return _pMC_mult.IntVector_rbegin(*args)91 def rend(*args): return _pMC_mult.IntVector_rend(*args)92 def pop_back(*args): return _pMC_mult.IntVector_pop_back(*args)93 def erase(*args): return _pMC_mult.IntVector_erase(*args)94 def __init__(self, *args): 95 this = _pMC_mult.new_IntVector(*args)96 try: self.this.append(this)97 except: self.this = this98 def push_back(*args): return _pMC_mult.IntVector_push_back(*args)99 def front(*args): return _pMC_mult.IntVector_front(*args)100 def back(*args): return _pMC_mult.IntVector_back(*args)101 def assign(*args): return _pMC_mult.IntVector_assign(*args)102 def resize(*args): return _pMC_mult.IntVector_resize(*args)103 def insert(*args): return _pMC_mult.IntVector_insert(*args)104 def reserve(*args): return _pMC_mult.IntVector_reserve(*args)105 def capacity(*args): return _pMC_mult.IntVector_capacity(*args)106 __swig_destroy__ = _pMC_mult.delete_IntVector107 __del__ = lambda self : None;108IntVector_swigregister = _pMC_mult.IntVector_swigregister109IntVector_swigregister(IntVector)110class DoubleVector(_object):111 __swig_setmethods__ = {}112 __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value)113 __swig_getmethods__ = {}114 __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name)115 __repr__ = _swig_repr116 def iterator(*args): return _pMC_mult.DoubleVector_iterator(*args)117 def __iter__(self): return self.iterator()118 def __nonzero__(*args): return _pMC_mult.DoubleVector___nonzero__(*args)119 def __len__(*args): return _pMC_mult.DoubleVector___len__(*args)120 def pop(*args): return _pMC_mult.DoubleVector_pop(*args)121 def __getslice__(*args): return _pMC_mult.DoubleVector___getslice__(*args)122 def __setslice__(*args): return _pMC_mult.DoubleVector___setslice__(*args)123 def __delslice__(*args): return _pMC_mult.DoubleVector___delslice__(*args)124 def __delitem__(*args): return _pMC_mult.DoubleVector___delitem__(*args)125 def __getitem__(*args): return _pMC_mult.DoubleVector___getitem__(*args)126 def __setitem__(*args): return _pMC_mult.DoubleVector___setitem__(*args)127 def append(*args): return _pMC_mult.DoubleVector_append(*args)128 def empty(*args): return _pMC_mult.DoubleVector_empty(*args)129 def size(*args): return _pMC_mult.DoubleVector_size(*args)130 def clear(*args): return _pMC_mult.DoubleVector_clear(*args)131 def swap(*args): return _pMC_mult.DoubleVector_swap(*args)132 def get_allocator(*args): return _pMC_mult.DoubleVector_get_allocator(*args)133 def begin(*args): return _pMC_mult.DoubleVector_begin(*args)134 def end(*args): return _pMC_mult.DoubleVector_end(*args)135 def rbegin(*args): return _pMC_mult.DoubleVector_rbegin(*args)136 def rend(*args): return _pMC_mult.DoubleVector_rend(*args)137 def pop_back(*args): return _pMC_mult.DoubleVector_pop_back(*args)138 def erase(*args): return _pMC_mult.DoubleVector_erase(*args)139 def __init__(self, *args): 140 this = _pMC_mult.new_DoubleVector(*args)141 try: self.this.append(this)142 except: self.this = this143 def push_back(*args): return _pMC_mult.DoubleVector_push_back(*args)144 def front(*args): return _pMC_mult.DoubleVector_front(*args)145 def back(*args): return _pMC_mult.DoubleVector_back(*args)146 def assign(*args): return _pMC_mult.DoubleVector_assign(*args)147 def resize(*args): return _pMC_mult.DoubleVector_resize(*args)148 def insert(*args): return _pMC_mult.DoubleVector_insert(*args)149 def reserve(*args): return _pMC_mult.DoubleVector_reserve(*args)150 def capacity(*args): return _pMC_mult.DoubleVector_capacity(*args)151 __swig_destroy__ = _pMC_mult.delete_DoubleVector152 __del__ = lambda self : None;153DoubleVector_swigregister = _pMC_mult.DoubleVector_swigregister154DoubleVector_swigregister(DoubleVector)155class FloatVector(_object):156 __swig_setmethods__ = {}157 __setattr__ = lambda self, name, value: _swig_setattr(self, FloatVector, name, value)158 __swig_getmethods__ = {}159 __getattr__ = lambda self, name: _swig_getattr(self, FloatVector, name)160 __repr__ = _swig_repr161 def iterator(*args): return _pMC_mult.FloatVector_iterator(*args)162 def __iter__(self): return self.iterator()163 def __nonzero__(*args): return _pMC_mult.FloatVector___nonzero__(*args)164 def __len__(*args): return _pMC_mult.FloatVector___len__(*args)165 def pop(*args): return _pMC_mult.FloatVector_pop(*args)166 def __getslice__(*args): return _pMC_mult.FloatVector___getslice__(*args)167 def __setslice__(*args): return _pMC_mult.FloatVector___setslice__(*args)168 def __delslice__(*args): return _pMC_mult.FloatVector___delslice__(*args)169 def __delitem__(*args): return _pMC_mult.FloatVector___delitem__(*args)170 def __getitem__(*args): return _pMC_mult.FloatVector___getitem__(*args)171 def __setitem__(*args): return _pMC_mult.FloatVector___setitem__(*args)172 def append(*args): return _pMC_mult.FloatVector_append(*args)173 def empty(*args): return _pMC_mult.FloatVector_empty(*args)174 def size(*args): return _pMC_mult.FloatVector_size(*args)175 def clear(*args): return _pMC_mult.FloatVector_clear(*args)176 def swap(*args): return _pMC_mult.FloatVector_swap(*args)177 def get_allocator(*args): return _pMC_mult.FloatVector_get_allocator(*args)178 def begin(*args): return _pMC_mult.FloatVector_begin(*args)179 def end(*args): return _pMC_mult.FloatVector_end(*args)180 def rbegin(*args): return _pMC_mult.FloatVector_rbegin(*args)181 def rend(*args): return _pMC_mult.FloatVector_rend(*args)182 def pop_back(*args): return _pMC_mult.FloatVector_pop_back(*args)183 def erase(*args): return _pMC_mult.FloatVector_erase(*args)184 def __init__(self, *args): 185 this = _pMC_mult.new_FloatVector(*args)186 try: self.this.append(this)187 except: self.this = this188 def push_back(*args): return _pMC_mult.FloatVector_push_back(*args)189 def front(*args): return _pMC_mult.FloatVector_front(*args)190 def back(*args): return _pMC_mult.FloatVector_back(*args)191 def assign(*args): return _pMC_mult.FloatVector_assign(*args)192 def resize(*args): return _pMC_mult.FloatVector_resize(*args)193 def insert(*args): return _pMC_mult.FloatVector_insert(*args)194 def reserve(*args): return _pMC_mult.FloatVector_reserve(*args)195 def capacity(*args): return _pMC_mult.FloatVector_capacity(*args)196 __swig_destroy__ = _pMC_mult.delete_FloatVector197 __del__ = lambda self : None;198FloatVector_swigregister = _pMC_mult.FloatVector_swigregister199FloatVector_swigregister(FloatVector)200class MC(_object):201 __swig_setmethods__ = {}202 __setattr__ = lambda self, name, value: _swig_setattr(self, MC, name, value)203 __swig_getmethods__ = {}204 __getattr__ = lambda self, name: _swig_getattr(self, MC, name)205 __repr__ = _swig_repr206 def __init__(self, *args): 207 this = _pMC_mult.new_MC(*args)208 try: self.this.append(this)209 except: self.this = this210 def calc_pKas(*args): return _pMC_mult.MC_calc_pKas(*args)211 def set_MCsteps(*args): return _pMC_mult.MC_set_MCsteps(*args)212 __swig_destroy__ = _pMC_mult.delete_MC213 __del__ = lambda self : None;214MC_swigregister = _pMC_mult.MC_swigregister...
dbobj.py
Source:dbobj.py
1#-------------------------------------------------------------------------2# This file contains real Python object wrappers for DB and DBEnv3# C "objects" that can be usefully subclassed. The previous SWIG4# based interface allowed this thanks to SWIG's shadow classes.5# -- Gregory P. Smith6#-------------------------------------------------------------------------7#8# (C) Copyright 2001 Autonomous Zone Industries9#10# License: This is free software. You may use this software for any11# purpose including modification/redistribution, so long as12# this header remains intact and that you do not claim any13# rights of ownership or authorship of this software. This14# software has been tested, but no warranty is expressed or15# implied.16#17#18# TODO it would be *really nice* to have an automatic shadow class populator19# so that new methods don't need to be added here manually after being20# added to _bsddb.c.21#22import sys23absolute_import = (sys.version_info[0] >= 3)24if absolute_import :25 # Because this syntaxis is not valid before Python 2.526 exec("from . import db")27else :28 import db29if sys.version_info < (2, 6) :30 from UserDict import DictMixin as MutableMapping31else :32 import collections33 MutableMapping = collections.MutableMapping34class DBEnv:35 def __init__(self, *args, **kwargs):36 self._cobj = db.DBEnv(*args, **kwargs)37 def close(self, *args, **kwargs):38 return self._cobj.close(*args, **kwargs)39 def open(self, *args, **kwargs):40 return self._cobj.open(*args, **kwargs)41 def remove(self, *args, **kwargs):42 return self._cobj.remove(*args, **kwargs)43 def set_shm_key(self, *args, **kwargs):44 return self._cobj.set_shm_key(*args, **kwargs)45 def set_cachesize(self, *args, **kwargs):46 return self._cobj.set_cachesize(*args, **kwargs)47 def set_data_dir(self, *args, **kwargs):48 return self._cobj.set_data_dir(*args, **kwargs)49 def set_flags(self, *args, **kwargs):50 return self._cobj.set_flags(*args, **kwargs)51 def set_lg_bsize(self, *args, **kwargs):52 return self._cobj.set_lg_bsize(*args, **kwargs)53 def set_lg_dir(self, *args, **kwargs):54 return self._cobj.set_lg_dir(*args, **kwargs)55 def set_lg_max(self, *args, **kwargs):56 return self._cobj.set_lg_max(*args, **kwargs)57 def set_lk_detect(self, *args, **kwargs):58 return self._cobj.set_lk_detect(*args, **kwargs)59 if db.version() < (4,5):60 def set_lk_max(self, *args, **kwargs):61 return self._cobj.set_lk_max(*args, **kwargs)62 def set_lk_max_locks(self, *args, **kwargs):63 return self._cobj.set_lk_max_locks(*args, **kwargs)64 def set_lk_max_lockers(self, *args, **kwargs):65 return self._cobj.set_lk_max_lockers(*args, **kwargs)66 def set_lk_max_objects(self, *args, **kwargs):67 return self._cobj.set_lk_max_objects(*args, **kwargs)68 def set_mp_mmapsize(self, *args, **kwargs):69 return self._cobj.set_mp_mmapsize(*args, **kwargs)70 def set_timeout(self, *args, **kwargs):71 return self._cobj.set_timeout(*args, **kwargs)72 def set_tmp_dir(self, *args, **kwargs):73 return self._cobj.set_tmp_dir(*args, **kwargs)74 def txn_begin(self, *args, **kwargs):75 return self._cobj.txn_begin(*args, **kwargs)76 def txn_checkpoint(self, *args, **kwargs):77 return self._cobj.txn_checkpoint(*args, **kwargs)78 def txn_stat(self, *args, **kwargs):79 return self._cobj.txn_stat(*args, **kwargs)80 def set_tx_max(self, *args, **kwargs):81 return self._cobj.set_tx_max(*args, **kwargs)82 def set_tx_timestamp(self, *args, **kwargs):83 return self._cobj.set_tx_timestamp(*args, **kwargs)84 def lock_detect(self, *args, **kwargs):85 return self._cobj.lock_detect(*args, **kwargs)86 def lock_get(self, *args, **kwargs):87 return self._cobj.lock_get(*args, **kwargs)88 def lock_id(self, *args, **kwargs):89 return self._cobj.lock_id(*args, **kwargs)90 def lock_put(self, *args, **kwargs):91 return self._cobj.lock_put(*args, **kwargs)92 def lock_stat(self, *args, **kwargs):93 return self._cobj.lock_stat(*args, **kwargs)94 def log_archive(self, *args, **kwargs):95 return self._cobj.log_archive(*args, **kwargs)96 def set_get_returns_none(self, *args, **kwargs):97 return self._cobj.set_get_returns_none(*args, **kwargs)98 def log_stat(self, *args, **kwargs):99 return self._cobj.log_stat(*args, **kwargs)100 def dbremove(self, *args, **kwargs):101 return self._cobj.dbremove(*args, **kwargs)102 def dbrename(self, *args, **kwargs):103 return self._cobj.dbrename(*args, **kwargs)104 def set_encrypt(self, *args, **kwargs):105 return self._cobj.set_encrypt(*args, **kwargs)106 if db.version() >= (4,4):107 def fileid_reset(self, *args, **kwargs):108 return self._cobj.fileid_reset(*args, **kwargs)109 def lsn_reset(self, *args, **kwargs):110 return self._cobj.lsn_reset(*args, **kwargs)111class DB(MutableMapping):112 def __init__(self, dbenv, *args, **kwargs):113 # give it the proper DBEnv C object that its expecting114 self._cobj = db.DB(*((dbenv._cobj,) + args), **kwargs)115 # TODO are there other dict methods that need to be overridden?116 def __len__(self):117 return len(self._cobj)118 def __getitem__(self, arg):119 return self._cobj[arg]120 def __setitem__(self, key, value):121 self._cobj[key] = value122 def __delitem__(self, arg):123 del self._cobj[arg]124 if sys.version_info >= (2, 6) :125 def __iter__(self) :126 return self._cobj.__iter__()127 def append(self, *args, **kwargs):128 return self._cobj.append(*args, **kwargs)129 def associate(self, *args, **kwargs):130 return self._cobj.associate(*args, **kwargs)131 def close(self, *args, **kwargs):132 return self._cobj.close(*args, **kwargs)133 def consume(self, *args, **kwargs):134 return self._cobj.consume(*args, **kwargs)135 def consume_wait(self, *args, **kwargs):136 return self._cobj.consume_wait(*args, **kwargs)137 def cursor(self, *args, **kwargs):138 return self._cobj.cursor(*args, **kwargs)139 def delete(self, *args, **kwargs):140 return self._cobj.delete(*args, **kwargs)141 def fd(self, *args, **kwargs):142 return self._cobj.fd(*args, **kwargs)143 def get(self, *args, **kwargs):144 return self._cobj.get(*args, **kwargs)145 def pget(self, *args, **kwargs):146 return self._cobj.pget(*args, **kwargs)147 def get_both(self, *args, **kwargs):148 return self._cobj.get_both(*args, **kwargs)149 def get_byteswapped(self, *args, **kwargs):150 return self._cobj.get_byteswapped(*args, **kwargs)151 def get_size(self, *args, **kwargs):152 return self._cobj.get_size(*args, **kwargs)153 def get_type(self, *args, **kwargs):154 return self._cobj.get_type(*args, **kwargs)155 def join(self, *args, **kwargs):156 return self._cobj.join(*args, **kwargs)157 def key_range(self, *args, **kwargs):158 return self._cobj.key_range(*args, **kwargs)159 def has_key(self, *args, **kwargs):160 return self._cobj.has_key(*args, **kwargs)161 def items(self, *args, **kwargs):162 return self._cobj.items(*args, **kwargs)163 def keys(self, *args, **kwargs):164 return self._cobj.keys(*args, **kwargs)165 def open(self, *args, **kwargs):166 return self._cobj.open(*args, **kwargs)167 def put(self, *args, **kwargs):168 return self._cobj.put(*args, **kwargs)169 def remove(self, *args, **kwargs):170 return self._cobj.remove(*args, **kwargs)171 def rename(self, *args, **kwargs):172 return self._cobj.rename(*args, **kwargs)173 def set_bt_minkey(self, *args, **kwargs):174 return self._cobj.set_bt_minkey(*args, **kwargs)175 def set_bt_compare(self, *args, **kwargs):176 return self._cobj.set_bt_compare(*args, **kwargs)177 def set_cachesize(self, *args, **kwargs):178 return self._cobj.set_cachesize(*args, **kwargs)179 def set_dup_compare(self, *args, **kwargs) :180 return self._cobj.set_dup_compare(*args, **kwargs)181 def set_flags(self, *args, **kwargs):182 return self._cobj.set_flags(*args, **kwargs)183 def set_h_ffactor(self, *args, **kwargs):184 return self._cobj.set_h_ffactor(*args, **kwargs)185 def set_h_nelem(self, *args, **kwargs):186 return self._cobj.set_h_nelem(*args, **kwargs)187 def set_lorder(self, *args, **kwargs):188 return self._cobj.set_lorder(*args, **kwargs)189 def set_pagesize(self, *args, **kwargs):190 return self._cobj.set_pagesize(*args, **kwargs)191 def set_re_delim(self, *args, **kwargs):192 return self._cobj.set_re_delim(*args, **kwargs)193 def set_re_len(self, *args, **kwargs):194 return self._cobj.set_re_len(*args, **kwargs)195 def set_re_pad(self, *args, **kwargs):196 return self._cobj.set_re_pad(*args, **kwargs)197 def set_re_source(self, *args, **kwargs):198 return self._cobj.set_re_source(*args, **kwargs)199 def set_q_extentsize(self, *args, **kwargs):200 return self._cobj.set_q_extentsize(*args, **kwargs)201 def stat(self, *args, **kwargs):202 return self._cobj.stat(*args, **kwargs)203 def sync(self, *args, **kwargs):204 return self._cobj.sync(*args, **kwargs)205 def type(self, *args, **kwargs):206 return self._cobj.type(*args, **kwargs)207 def upgrade(self, *args, **kwargs):208 return self._cobj.upgrade(*args, **kwargs)209 def values(self, *args, **kwargs):210 return self._cobj.values(*args, **kwargs)211 def verify(self, *args, **kwargs):212 return self._cobj.verify(*args, **kwargs)213 def set_get_returns_none(self, *args, **kwargs):214 return self._cobj.set_get_returns_none(*args, **kwargs)215 def set_encrypt(self, *args, **kwargs):216 return self._cobj.set_encrypt(*args, **kwargs)217class DBSequence:218 def __init__(self, *args, **kwargs):219 self._cobj = db.DBSequence(*args, **kwargs)220 def close(self, *args, **kwargs):221 return self._cobj.close(*args, **kwargs)222 def get(self, *args, **kwargs):223 return self._cobj.get(*args, **kwargs)224 def get_dbp(self, *args, **kwargs):225 return self._cobj.get_dbp(*args, **kwargs)226 def get_key(self, *args, **kwargs):227 return self._cobj.get_key(*args, **kwargs)228 def init_value(self, *args, **kwargs):229 return self._cobj.init_value(*args, **kwargs)230 def open(self, *args, **kwargs):231 return self._cobj.open(*args, **kwargs)232 def remove(self, *args, **kwargs):233 return self._cobj.remove(*args, **kwargs)234 def stat(self, *args, **kwargs):235 return self._cobj.stat(*args, **kwargs)236 def set_cachesize(self, *args, **kwargs):237 return self._cobj.set_cachesize(*args, **kwargs)238 def set_flags(self, *args, **kwargs):239 return self._cobj.set_flags(*args, **kwargs)240 def set_range(self, *args, **kwargs):241 return self._cobj.set_range(*args, **kwargs)242 def get_cachesize(self, *args, **kwargs):243 return self._cobj.get_cachesize(*args, **kwargs)244 def get_flags(self, *args, **kwargs):245 return self._cobj.get_flags(*args, **kwargs)246 def get_range(self, *args, **kwargs):...
dict_subclass.py
Source:dict_subclass.py
1# This file is part of Marcel.2# 3# Marcel is free software: you can redistribute it and/or modify it4# under the terms of the GNU General Public License as published by the5# Free Software Foundation, either version 3 of the License, or at your6# option) any later version.7# 8# Marcel is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# for more details.12# 13# You should have received a copy of the GNU General Public License14# along with Marcel. If not, see <https://www.gnu.org/licenses/>.15class DictSubclass(dict):16 # def __class__(self, *args, **kwargs):17 # print(f'__class__, args={args}, kwargs={kwargs}')18 # return super().__class__(*args, **kwargs)19 def __contains__(self, *args, **kwargs):20 print(f'__contains__, args={args}, kwargs={kwargs}')21 return super().__contains__(*args, **kwargs)22 def __delattr__(self, *args, **kwargs):23 print(f'__delattr__, args={args}, kwargs={kwargs}')24 return super().__delattr__(*args, **kwargs)25 def __delitem__(self, *args, **kwargs):26 print(f'__delitem__, args={args}, kwargs={kwargs}')27 return super().__delitem__(*args, **kwargs)28 def __dir__(self, *args, **kwargs):29 print(f'__dir__, args={args}, kwargs={kwargs}')30 return super().__dir__(*args, **kwargs)31 def __doc__(self, *args, **kwargs):32 print(f'__doc__, args={args}, kwargs={kwargs}')33 return super().__doc__(*args, **kwargs)34 def __eq__(self, *args, **kwargs):35 print(f'__eq__, args={args}, kwargs={kwargs}')36 return super().__eq__(*args, **kwargs)37 def __format__(self, *args, **kwargs):38 print(f'__format__, args={args}, kwargs={kwargs}')39 return super().__format__(*args, **kwargs)40 def __ge__(self, *args, **kwargs):41 print(f'__ge__, args={args}, kwargs={kwargs}')42 return super().__ge__(*args, **kwargs)43 def __getattribute__(self, *args, **kwargs):44 print(f'__getattribute__, args={args}, kwargs={kwargs}')45 return super().__getattribute__(*args, **kwargs)46 def __getitem__(self, *args, **kwargs):47 print(f'__getitem__, args={args}, kwargs={kwargs}')48 return super().__getitem__(*args, **kwargs)49 def __gt__(self, *args, **kwargs):50 print(f'__gt__, args={args}, kwargs={kwargs}')51 return super().__gt__(*args, **kwargs)52 def __hash__(self, *args, **kwargs):53 print(f'__hash__, args={args}, kwargs={kwargs}')54 return super().__hash__(*args, **kwargs)55 def __init__(self, *args, **kwargs):56 print(f'__init__, args={args}, kwargs={kwargs}')57 return super().__init__(*args, **kwargs)58 def __init_subclass__(self, *args, **kwargs):59 print(f'__init_subclass__, args={args}, kwargs={kwargs}')60 return super().__init_subclass__(*args, **kwargs)61 def __iter__(self, *args, **kwargs):62 print(f'__iter__, args={args}, kwargs={kwargs}')63 return super().__iter__(*args, **kwargs)64 def __le__(self, *args, **kwargs):65 print(f'__le__, args={args}, kwargs={kwargs}')66 return super().__le__(*args, **kwargs)67 def __len__(self, *args, **kwargs):68 print(f'__len__, args={args}, kwargs={kwargs}')69 return super().__len__(*args, **kwargs)70 def __lt__(self, *args, **kwargs):71 print(f'__lt__, args={args}, kwargs={kwargs}')72 return super().__lt__(*args, **kwargs)73 def __ne__(self, *args, **kwargs):74 print(f'__ne__, args={args}, kwargs={kwargs}')75 return super().__ne__(*args, **kwargs)76 # def __new__(self, *args, **kwargs):77 # print(f'__new__, args={args}, kwargs={kwargs}')78 # return super().__new__(*args, **kwargs)79 def __reduce__(self, *args, **kwargs):80 print(f'__reduce__, args={args}, kwargs={kwargs}')81 return super().__reduce__(*args, **kwargs)82 def __reduce_ex__(self, *args, **kwargs):83 print(f'__reduce_ex__, args={args}, kwargs={kwargs}')84 return super().__reduce_ex__(*args, **kwargs)85 def __repr__(self, *args, **kwargs):86 print(f'__repr__, args={args}, kwargs={kwargs}')87 return super().__repr__(*args, **kwargs)88 def __reversed__(self, *args, **kwargs):89 print(f'__reversed__, args={args}, kwargs={kwargs}')90 return super().__reversed__(*args, **kwargs)91 def __setattr__(self, *args, **kwargs):92 print(f'__setattr__, args={args}, kwargs={kwargs}')93 return super().__setattr__(*args, **kwargs)94 def __setitem__(self, *args, **kwargs):95 print(f'__setitem__, args={args}, kwargs={kwargs}')96 return super().__setitem__(*args, **kwargs)97 def __sizeof__(self, *args, **kwargs):98 print(f'__sizeof__, args={args}, kwargs={kwargs}')99 return super().__sizeof__(*args, **kwargs)100 def __str__(self, *args, **kwargs):101 print(f'__str__, args={args}, kwargs={kwargs}')102 return super().__str__(*args, **kwargs)103 def __subclasshook__(self, *args, **kwargs):104 print(f'__subclasshook__, args={args}, kwargs={kwargs}')105 return super().__subclasshook__(*args, **kwargs)106 def clear(self, *args, **kwargs):107 print(f'clear, args={args}, kwargs={kwargs}')108 return super().clear(*args, **kwargs)109 def copy(self, *args, **kwargs):110 print(f'copy, args={args}, kwargs={kwargs}')111 return super().copy(*args, **kwargs)112 def fromkeys(self, *args, **kwargs):113 print(f'fromkeys, args={args}, kwargs={kwargs}')114 return super().fromkeys(*args, **kwargs)115 def get(self, *args, **kwargs):116 print(f'get, args={args}, kwargs={kwargs}')117 return super().get(*args, **kwargs)118 def items(self, *args, **kwargs):119 print(f'items, args={args}, kwargs={kwargs}')120 return super().items(*args, **kwargs)121 def keys(self, *args, **kwargs):122 print(f'keys, args={args}, kwargs={kwargs}')123 return super().keys(*args, **kwargs)124 def pop(self, *args, **kwargs):125 print(f'pop, args={args}, kwargs={kwargs}')126 return super().pop(*args, **kwargs)127 def popitem(self, *args, **kwargs):128 print(f'popitem, args={args}, kwargs={kwargs}')129 return super().popitem(*args, **kwargs)130 def setdefault(self, *args, **kwargs):131 print(f'setdefault, args={args}, kwargs={kwargs}')132 return super().setdefault(*args, **kwargs)133 def update(self, *args, **kwargs):134 print(f'update, args={args}, kwargs={kwargs}')135 return super().update(*args, **kwargs)136 def values(self, *args, **kwargs):137 print(f'values, args={args}, kwargs={kwargs}')138 return super().values(*args, **kwargs)139print('DEFINE FUNCTION')140source = 'lambda x: x + y'141namespace = DictSubclass()142namespace['y'] = 100143f = eval(source, namespace)144print('RUN FUNCTION')145print(f(5))146namespace['y'] = 200147print(f(5))148print('GLOBALS')149m = f.__globals__.copy()150del m['__builtins__']151print(m)152print('UPDATE')153namespace.update({'a': 1, 'b': 2})154print('KEYS')155namespace.keys()156print('VALUES')...
test_catkin_make_isolated.py
Source:test_catkin_make_isolated.py
...53 ]54 args, cmake_args, make_args = extract_cmake_and_make_arguments(args)55 assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel']56 assert args == ['--devel-space', 'devel_isolated']57 def test_handle_cmake_args(self):58 args = ['-DCMAKE_INSTALL_PREFIX=install', '--install']59 args, cmake_args, make_args = extract_cmake_and_make_arguments(args)60 assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install'], cmake_args61 opts = parse_args(args)62 cmake_args, opts = handle_cmake_args(cmake_args, opts)63 assert cmake_args == [], cmake_args64 assert opts.install == True65 assert opts.install_space == 'install'66 args = [67 '-DCMAKE_INSTALL_PREFIX=install', '--install', '--install-space',68 'install_isolated'69 ]70 args, cmake_args, make_args = extract_cmake_and_make_arguments(args)71 assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install'], cmake_args72 opts = parse_args(args)73 cmake_args, opts = handle_cmake_args(cmake_args, opts)74 assert cmake_args == [], cmake_args75 assert opts.install == True76 assert opts.install_space == 'install_isolated'77 args = ['-DCATKIN_DEVEL_PREFIX=devel']78 args, cmake_args, make_args = extract_cmake_and_make_arguments(args)79 assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel'], cmake_args80 opts = parse_args(args)81 cmake_args, opts = handle_cmake_args(cmake_args, opts)82 assert cmake_args == [], cmake_args83 assert opts.devel == 'devel'84 args = [85 '-DCATKIN_DEVEL_PREFIX=devel', '--devel-space',86 'devel_isolated'87 ]88 args, cmake_args, make_args = extract_cmake_and_make_arguments(args)89 assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel'], cmake_args90 opts = parse_args(args)91 cmake_args, opts = handle_cmake_args(cmake_args, opts)92 assert cmake_args == [], cmake_args93 assert opts.devel == 'devel_isolated'94 def test_empty_workspace(self):95 argv = sys.argv96 environ = os.environ97 error_msg = None98 try:99 ws_dir = tempfile.mkdtemp()100 src_dir = os.path.join(ws_dir, 'src')101 os.mkdir(src_dir)102 sys.argv = ['catkin_make_isolated', '-C', ws_dir]103 environ['CMAKE_PREFIX_PATH'] = os.path.join(ws_dir, 'install')104 main()105 except Exception as e:...
gru_transformer.py
Source:gru_transformer.py
1# Copyright (c) Facebook, Inc. and its affiliates.2#3# This source code is licensed under the MIT license found in the4# LICENSE file in the root directory of this source tree.5# Copyright (c) Facebook, Inc. and its affiliates.6#7# This source code is licensed under the MIT license found in the8# LICENSE file in the root directory of this source tree.9import torch.nn as nn10import torch.nn.functional as F11from fairseq.models import register_model, register_model_architecture12from fairseq.models.transformer import TransformerEncoder, TransformerModel13@register_model("gru_transformer")14class GRUTransformerModel(TransformerModel):15 @classmethod16 def build_encoder(cls, args, src_dict, embed_tokens):17 return GRUTransformerEncoder(args, src_dict, embed_tokens)18class GRUTransformerEncoder(TransformerEncoder):19 def __init__(self, args, dictionary, embed_tokens):20 super().__init__(args, dictionary, embed_tokens)21 self.emb_ctx = nn.GRU(22 input_size=embed_tokens.embedding_dim,23 hidden_size=embed_tokens.embedding_dim // 2,24 num_layers=1,25 bidirectional=True,26 )27 def forward_embedding(self, src_tokens):28 # embed tokens and positions29 x = embed = self.embed_scale * self.embed_tokens(src_tokens)30 if self.embed_positions is not None:31 x = embed + self.embed_positions(src_tokens)32 # contextualize embeddings33 x = x.transpose(0, 1)34 x = self.dropout_module(x)35 x, _ = self.emb_ctx.forward(x)36 x = x.transpose(0, 1)37 if self.layernorm_embedding is not None:38 x = self.layernorm_embedding(x)39 x = self.dropout_module(x)40 return x, embed41@register_model_architecture("gru_transformer", "gru_transformer")42def gru_transformer_base_architecture(args):43 args.encoder_embed_path = getattr(args, "encoder_embed_path", None)44 args.encoder_embed_dim = getattr(args, "encoder_embed_dim", 512)45 args.encoder_ffn_embed_dim = getattr(args, "encoder_ffn_embed_dim", 2048)46 args.encoder_layers = getattr(args, "encoder_layers", 6)47 args.encoder_attention_heads = getattr(args, "encoder_attention_heads", 8)48 args.encoder_normalize_before = getattr(args, "encoder_normalize_before", False)49 args.encoder_learned_pos = getattr(args, "encoder_learned_pos", False)50 args.decoder_embed_path = getattr(args, "decoder_embed_path", None)51 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", args.encoder_embed_dim)52 args.decoder_ffn_embed_dim = getattr(53 args, "decoder_ffn_embed_dim", args.encoder_ffn_embed_dim54 )55 args.decoder_layers = getattr(args, "decoder_layers", 6)56 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 8)57 args.decoder_normalize_before = getattr(args, "decoder_normalize_before", False)58 args.decoder_learned_pos = getattr(args, "decoder_learned_pos", False)59 args.attention_dropout = getattr(args, "attention_dropout", 0.0)60 args.activation_dropout = getattr(args, "activation_dropout", 0.0)61 args.activation_fn = getattr(args, "activation_fn", "relu")62 args.dropout = getattr(args, "dropout", 0.1)63 args.adaptive_softmax_cutoff = getattr(args, "adaptive_softmax_cutoff", None)64 args.adaptive_softmax_dropout = getattr(args, "adaptive_softmax_dropout", 0)65 args.share_decoder_input_output_embed = getattr(66 args, "share_decoder_input_output_embed", False67 )68 args.share_all_embeddings = getattr(args, "share_all_embeddings", False)69 args.no_token_positional_embeddings = getattr(70 args, "no_token_positional_embeddings", False71 )72 args.adaptive_input = getattr(args, "adaptive_input", False)73 args.no_cross_attention = getattr(args, "no_cross_attention", False)74 args.cross_self_attention = getattr(args, "cross_self_attention", False)75 args.layer_wise_attention = getattr(args, "layer_wise_attention", False)76 args.decoder_output_dim = getattr(77 args, "decoder_output_dim", args.decoder_embed_dim78 )79 args.decoder_input_dim = getattr(args, "decoder_input_dim", args.decoder_embed_dim)80 args.no_scale_embedding = getattr(args, "no_scale_embedding", False)81 args.layernorm_embedding = getattr(args, "layernorm_embedding", False)82@register_model_architecture("gru_transformer", "gru_transformer_big")83def gru_transformer_big(args):84 args.encoder_embed_dim = getattr(args, "encoder_embed_dim", 1024)85 args.encoder_ffn_embed_dim = getattr(args, "encoder_ffn_embed_dim", 4096)86 args.encoder_attention_heads = getattr(args, "encoder_attention_heads", 16)87 args.encoder_normalize_before = getattr(args, "encoder_normalize_before", False)88 args.decoder_embed_dim = getattr(args, "decoder_embed_dim", 1024)89 args.decoder_ffn_embed_dim = getattr(args, "decoder_ffn_embed_dim", 4096)90 args.decoder_attention_heads = getattr(args, "decoder_attention_heads", 16)91 args.dropout = getattr(args, "dropout", 0.3)...
_testcapi.py
Source:_testcapi.py
1CHAR_MAX = 1272CHAR_MIN = -1283DBL_MAX = 1.7976931348623157e+3084DBL_MIN = 2.2250738585072014e-3085FLT_MAX = 3.4028234663852886e+386FLT_MIN = 1.1754943508222875e-387INT_MAX = 21474836478INT_MIN = -21474836489LLONG_MAX = 922337203685477580710LLONG_MIN = -922337203685477580811LONG_MAX = 214748364712LONG_MIN = -214748364813PY_SSIZE_T_MAX = 214748364714PY_SSIZE_T_MIN = -214748364815SHRT_MAX = 3276716SHRT_MIN = -3276817SIZEOF_PYGC_HEAD = 1618UCHAR_MAX = 25519UINT_MAX = 429496729520ULLONG_MAX = 1844674407370955161521ULONG_MAX = 429496729522USHRT_MAX = 6553523__loader__ = "<_frozen_importlib.ExtensionFileLoader object at 0x00C98DD0>"24def _pending_threadfunc(*args,**kw):25 pass26class _test_structmembersType(object):27 pass28def _test_thread_state(*args,**kw):29 pass30def argparsing(*args,**kw):31 pass32def code_newempty(*args,**kw):33 pass34def codec_incrementaldecoder(*args,**kw):35 pass36def codec_incrementalencoder(*args,**kw):37 pass38def crash_no_current_thread(*args,**kw):39 pass40class error(Exception):41 pass42def exception_print(*args,**kw):43 pass44def getargs_B(*args,**kw):45 pass46def getargs_H(*args,**kw):47 pass48def getargs_I(*args,**kw):49 pass50def getargs_K(*args,**kw):51 pass52def getargs_L(*args,**kw):53 pass54def getargs_Z(*args,**kw):55 pass56def getargs_Z_hash(*args,**kw):57 pass58def getargs_b(*args,**kw):59 pass60def getargs_c(*args,**kw):61 pass62def getargs_h(*args,**kw):63 pass64def getargs_i(*args,**kw):65 pass66def getargs_k(*args,**kw):67 pass68def getargs_keyword_only(*args,**kw):69 pass70def getargs_keywords(*args,**kw):71 pass72def getargs_l(*args,**kw):73 pass74def getargs_n(*args,**kw):75 pass76def getargs_p(*args,**kw):77 pass78def getargs_s(*args,**kw):79 pass80def getargs_s_hash(*args,**kw):81 pass82def getargs_s_star(*args,**kw):83 pass84def getargs_tuple(*args,**kw):85 pass86def getargs_u(*args,**kw):87 pass88def getargs_u_hash(*args,**kw):89 pass90def getargs_w_star(*args,**kw):91 pass92def getargs_y(*args,**kw):93 pass94def getargs_y_hash(*args,**kw):95 pass96def getargs_y_star(*args,**kw):97 pass98def getargs_z(*args,**kw):99 pass100def getargs_z_hash(*args,**kw):101 pass102def getargs_z_star(*args,**kw):103 pass104class instancemethod(object):105 pass106def make_exception_with_doc(*args,**kw):107 pass108def make_memoryview_from_NULL_pointer(*args,**kw):109 pass110def parse_tuple_and_keywords(*args,**kw):111 pass112def pytime_object_to_time_t(*args,**kw):113 pass114def pytime_object_to_timespec(*args,**kw):115 pass116def pytime_object_to_timeval(*args,**kw):117 pass118def raise_exception(*args,**kw):119 pass120def raise_memoryerror(*args,**kw):121 pass122def run_in_subinterp(*args,**kw):123 pass124def set_exc_info(*args,**kw):125 pass126def test_L_code(*args,**kw):127 pass128def test_Z_code(*args,**kw):129 pass130def test_capsule(*args,**kw):131 pass132def test_config(*args,**kw):133 pass134def test_datetime_capi(*args,**kw):135 pass136def test_dict_iteration(*args,**kw):137 pass138def test_empty_argparse(*args,**kw):139 pass140def test_k_code(*args,**kw):141 pass142def test_lazy_hash_inheritance(*args,**kw):143 pass144def test_list_api(*args,**kw):145 pass146def test_long_and_overflow(*args,**kw):147 pass148def test_long_api(*args,**kw):149 pass150def test_long_as_double(*args,**kw):151 pass152def test_long_as_size_t(*args,**kw):153 pass154def test_long_long_and_overflow(*args,**kw):155 pass156def test_long_numbits(*args,**kw):157 pass158def test_longlong_api(*args,**kw):159 pass160def test_null_strings(*args,**kw):161 pass162def test_s_code(*args,**kw):163 pass164def test_string_from_format(*args,**kw):165 pass166def test_string_to_double(*args,**kw):167 pass168def test_u_code(*args,**kw):169 pass170def test_unicode_compare_with_ascii(*args,**kw):171 pass172def test_widechar(*args,**kw):173 pass174def test_with_docstring(*args,**kw):175 """This is a pretty normal docstring."""176 pass177def traceback_print(*args,**kw):178 pass179def unicode_aswidechar(*args,**kw):180 pass181def unicode_aswidecharstring(*args,**kw):182 pass183def unicode_encodedecimal(*args,**kw):184 pass185def unicode_transformdecimaltoascii(*args,**kw):...
Using AI Code Generation
1const fc = require('fast-check');2fc.assert(3 fc.property(fc.integer(), fc.integer(), (a, b) => {4 return a + b >= a;5 })6);
Using AI Code Generation
1const fc = require('fast-check');2const { args } = require('fast-check-monorepo');3const isEven = (n) => n % 2 === 0;4const isOdd = (n) => !isEven(n);5const isEvenArb = fc.integer().filter(isEven);6const isOddArb = fc.integer().filter(isOdd);7const isEvenOrOdd = (n) => isEven(n) || isOdd(n);8const isEvenOrOddArb = fc.integer().filter(isEvenOrOdd);9const isEvenAndOdd = (n) => isEven(n) && isOdd(n);10const isEvenAndOddArb = fc.integer().filter(isEvenAndOdd);11const isEvenOrOddAndEven = (n) => (isEvenOrOdd(n) && isEven(n));12const isEvenOrOddAndEvenArb = fc.integer().filter(isEvenOrOddAndEven);13const isEvenOrOddAndOdd = (n) => (isEvenOrOdd(n) && isOdd(n));14const isEvenOrOddAndOddArb = fc.integer().filter(isEvenOrOddAndOdd);15const isEvenAndOddAndEven = (n) => (isEvenAndOdd(n) && isEven(n));16const isEvenAndOddAndEvenArb = fc.integer().filter(isEvenAndOddAndEven);17const isEvenAndOddAndOdd = (n) => (isEvenAndOdd(n) && isOdd(n));18const isEvenAndOddAndOddArb = fc.integer().filter(isEvenAndOddAndOdd);19const isEvenOrOddOrEvenAndOdd = (n) => (isEvenOrOdd(n) || isEvenAndOdd(n));20const isEvenOrOddOrEvenAndOddArb = fc.integer().filter(isEvenOrOddOrEvenAndOdd);21const isEvenOrOddOrEvenAndOddAndEven = (n) => (isEvenOrOddOrEvenAndOdd(n) && isEven(n));22const isEvenOrOddOrEvenAndOddAndEvenArb = fc.integer().filter(isEvenOrOddOrEvenAndOddAndEven);23const isEvenOrOddOrEvenAndOddAndOdd = (n) => (isEvenOrOddOrEvenAndOdd(n) && isOdd(n));24const isEvenOrOddOrEvenAndOddAndOddArb = fc.integer().filter(isEvenOrOddOrEven
Using AI Code Generation
1const test3 = () => {2 fc.assert(3 fc.property(fc.integer(), fc.integer(), (a, b) => {4 return a + b >= a;5 })6 );7};8module.exports = test3;9const test4 = () => {10 fc.assert(11 fc.property(fc.integer(), fc.integer(), (a, b) => {12 return a + b >= a;13 })14 );15};16module.exports = test4;17const test5 = () => {18 fc.assert(19 fc.property(fc.integer(), fc.integer(), (a, b) => {20 return a + b >= a;21 })22 );23};24module.exports = test5;25const test6 = () => {26 fc.assert(27 fc.property(fc.integer(), fc.integer(), (a, b) => {28 return a + b >= a;29 })30 );31};32module.exports = test6;33const test7 = () => {34 fc.assert(35 fc.property(fc.integer(), fc.integer(), (a, b) => {36 return a + b >= a;37 })38 );39};40module.exports = test7;41const test8 = () => {42 fc.assert(43 fc.property(fc.integer(), fc.integer(), (a, b) => {44 return a + b >= a;45 })46 );47};48module.exports = test8;
Using AI Code Generation
1const fc = require("fast-check");2const { args } = require("fast-check-monorepo");3const { Test1 } = require("./test1");4const { Test2 } = require("./test2");5const test3 = (x, y) => {6 return Test1(x, y) + Test2(x, y);7};8const test3Arbitrary = args(fc.integer(), fc.integer(), test3);9fc.assert(10 fc.property(test3Arbitrary, (result) => {11 return result >= 0;12 })13);14const fc = require("fast-check");15const { args } = require("fast-check-monorepo");16const Test1 = (x, y) => {17 return x + y;18};19module.exports = { Test1 };20const fc = require("fast-check");21const { args } = require("fast-check-monorepo");22const Test2 = (x, y) => {23 return x * y;24};25module.exports = { Test2 };
Using AI Code Generation
1const fc = require('fast-check')2const {args} = require('fast-check-monorepo')3const args = args()4const {a, b, c} = args5console.log(a, b, c)6const fc = require('fast-check')7const {args} = require('fast-check-monorepo')8const args = args()9const {a, b, c} = args10console.log(a, b, c)11const fc = require('fast-check')12const {args} = require('fast-check-monorepo')13const args = args()14const {a, b, c} = args15console.log(a, b, c)16const fc = require('fast-check')17const {args} = require('fast-check-monorepo')18const args = args()19const {a, b, c} = args20console.log(a, b, c)21const fc = require('fast-check')22const {args} = require('fast-check-monorepo')23const args = args()24const {a, b, c} = args25console.log(a, b, c)26const fc = require('fast-check')27const {args} = require('fast-check-monorepo')28const args = args()29const {a, b, c} = args30console.log(a, b, c)31const fc = require('fast-check')32const {args} = require('fast-check-monorepo')33const args = args()34const {a, b, c} = args35console.log(a, b, c)36const fc = require('fast-check')37const {args} = require('fast-check-monorepo')38const args = args()39const {a, b, c} = args40console.log(a, b,
Using AI Code Generation
1const fc = require('fast-check');2const args = fc.arguments();3const test3 = () => {4 return args;5}6module.exports = test3;
Using AI Code Generation
1const args = require('fast-check-monorepo').args;2const test = args(3 {a: {type: 'string', default: 'default value'}},4 ({a}) => {5 console.log(a);6 }7);8test();
Using AI Code Generation
1const fc = require('fast-check');2const fc = require('fast-check');3fc.assert(4 fc.property(fc.integer(), fc.integer(), (a, b) => {5 return a + b >= a;6 })7);8const fc = require('fast-check');9fc.assert(10 fc.property(fc.integer(), fc.integer(), (a, b) => {11 return a + b >= a;12 })13);14const fc = require('fast-check');15fc.assert(16 fc.property(fc.integer(), fc.integer(), (a, b) => {17 return a + b >= a;18 })19);20const fc = require('fast-check');21fc.assert(22 fc.property(fc.integer(), fc.integer(), (a, b) => {23 return a + b >= a;24 })25);
Using AI Code Generation
1const { args } = require('fast-check');2const myFunction = args((a, b) => a + b);3const myFunction2 = args((...args) => args.reduce((a, b) => a + b, 0));4const myFunction3 = args((a, b = 0) => a + b);5const myFunction4 = args((a, b = 0, ...args) => [a, b, args]);6const myFunction5 = args((a, b =
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!