text:
@implementation DBSHARINGRouteObjects

static DBRoute *DBSHARINGAddFileMember;
static DBRoute *DBSHARINGAddFolderMember;
static DBRoute *DBSHARINGChangeFileMemberAccess;
static DBRoute *DBSHARINGCheckJobStatus;
static DBRoute *DBSHARINGCheckRemoveMemberJobStatus;
static DBRoute *DBSHARINGCheckShareJobStatus;
static DBRoute *DBSHARINGCreateSharedLink;
static DBRoute *DBSHARINGCreateSharedLinkWithSettings;
static DBRoute *DBSHARINGGetFileMetadata;
static DBRoute *DBSHARINGGetFileMetadataBatch;
static DBRoute *DBSHARINGGetFolderMetadata;
static DBRoute *DBSHARINGGetSharedLinkFile;
static DBRoute *DBSHARINGGetSharedLinkMetadata;
static DBRoute *DBSHARINGGetSharedLinks;
static DBRoute *DBSHARINGListFileMembers;
static DBRoute *DBSHARINGListFileMembersBatch;
static DBRoute *DBSHARINGListFileMembersContinue;
static DBRoute *DBSHARINGListFolderMembers;
static DBRoute *DBSHARINGListFolderMembersContinue;
static DBRoute *DBSHARINGListFolders;
static DBRoute *DBSHARINGListFoldersContinue;
static DBRoute *DBSHARINGListMountableFolders;
static DBRoute *DBSHARINGListMountableFoldersContinue;
static DBRoute *DBSHARINGListReceivedFiles;
static DBRoute *DBSHARINGListReceivedFilesContinue;
static DBRoute *DBSHARINGListSharedLinks;
static DBRoute *DBSHARINGModifySharedLinkSettings;
static DBRoute *DBSHARINGMountFolder;
static DBRoute *DBSHARINGRelinquishFileMembership;
static DBRoute *DBSHARINGRelinquishFolderMembership;
static DBRoute *DBSHARINGRemoveFileMember;
static DBRoute *DBSHARINGRemoveFileMember2;
static DBRoute *DBSHARINGRemoveFolderMember;
static DBRoute *DBSHARINGRevokeSharedLink;
static DBRoute *DBSHARINGShareFolder;
static DBRoute *DBSHARINGTransferFolder;
static DBRoute *DBSHARINGUnmountFolder;
static DBRoute *DBSHARINGUnshareFile;
static DBRoute *DBSHARINGUnshareFolder;
static DBRoute *DBSHARINGUpdateFileMember;
static DBRoute *DBSHARINGUpdateFolderMember;
static DBRoute *DBSHARINGUpdateFolderPolicy;

+ (DBRoute *)DBSHARINGAddFileMember {
  if (!DBSHARINGAddFileMember) {
    DBSHARINGAddFileMember = [[DBRoute alloc] init:@"add_file_member"
        namespace_:@"sharing"
        deprecated:@NO
        resultType:[NSArray<DBSHARINGFileMemberActionResult *> class]
        errorType:[DBSHARINGAddFileMemberError class]
        attrs:@{
          @"auth" : @"user",
          @"host" : @"api",
          @"style" : @"rpc"
        }
        dataStructSerialBlock:nil
        dataStructDeserialBlock:^id(id dataStruct) {
          return [DBArraySerializer deserialize:dataStruct
                                      withBlock:^id(id elem0) {
                                        return [DBSHARINGFileMemberActionResultSerializer deserialize:elem0];
                                      }];
        }];
  }
  return DBSHARINGAddFileMember;
}

+ (DBRoute *)DBSHARINGAddFolderMember {
  if (!DBSHARINGAddFolderMember) {
    DBSHARINGAddFolderMember = [[DBRoute alloc] init:@"add_folder_member"
                                          namespace_:@"sharing"
                                          deprecated:@NO
                                          resultType:nil
                                           errorType:[DBSHARINGAddFolderMemberError class]
                                               attrs:@{
                                                 @"auth" : @"user",
                                                 @"host" : @"api",
                                                 @"style" : @"rpc"
                                               }
                               dataStructSerialBlock:nil
                             dataStructDeserialBlock:nil];
  }
  return DBSHARINGAddFolderMember;
}

+ (DBRoute *)DBSHARINGChangeFileMemberAccess {
  if (!DBSHARINGChangeFileMemberAccess) {
    DBSHARINGChangeFileMemberAccess = [[DBRoute alloc] init:@"change_file_member_access"
                                                 namespace_:@"sharing"
                                                 deprecated:@YES
                                                 resultType:[DBSHARINGFileMemberActionResult class]
                                                  errorType:[DBSHARINGFileMemberActionError class]
                                                      attrs:@{
                                                        @"auth" : @"user",
                                                        @"host" : @"api",
                                                        @"style" : @"rpc"
                                                      }
                                      dataStructSerialBlock:nil
                                    dataStructDeserialBlock:nil];
  }
  return DBSHARINGChangeFileMemberAccess;
}

+ (DBRoute *)DBSHARINGCheckJobStatus {
  if (!DBSHARINGCheckJobStatus) {
    DBSHARINGCheckJobStatus = [[DBRoute alloc] init:@"check_job_status"
                                         namespace_:@"sharing"
                                         deprecated:@NO
                                         resultType:[DBSHARINGJobStatus class]
                                          errorType:[DBASYNCPollError class]
                                              attrs:@{
                                                @"auth" : @"user",
                                                @"host" : @"api",
                                                @"style" : @"rpc"
                                              }
                              dataStructSerialBlock:nil
                            dataStructDeserialBlock:nil];
  }
  return DBSHARINGCheckJobStatus;
}

+ (DBRoute *)DBSHARINGCheckRemoveMemberJobStatus {
  if (!DBSHARINGCheckRemoveMemberJobStatus) {
    DBSHARINGCheckRemoveMemberJobStatus = [[DBRoute alloc] init:@"check_remove_member_job_status"
                                                     namespace_:@"sharing"
                                                     deprecated:@NO
                                                     resultType:[DBSHARINGRemoveMemberJobStatus class]
                                                      errorType:[DBASYNCPollError class]
                                                          attrs:@{
                                                            @"auth" : @"user",
                                                            @"host" : @"api",
                                                            @"style" : @"rpc"
                                                          }
                                          dataStructSerialBlock:nil
                                        dataStructDeserialBlock:nil];
  }
  return DBSHARINGCheckRemoveMemberJobStatus;
}

+ (DBRoute *)DBSHARINGCheckShareJobStatus {
  if (!DBSHARINGCheckShareJobStatus) {
    DBSHARINGCheckShareJobStatus = [[DBRoute alloc] init:@"check_share_job_status"
                                              namespace_:@"sharing"
                                              deprecated:@NO
                                              resultType:[DBSHARINGShareFolderJobStatus class]
                                               errorType:[DBASYNCPollError class]
                                                   attrs:@{
                                                     @"auth" : @"user",
                                                     @"host" : @"api",
                                                     @"style" : @"rpc"
                                                   }
                                   dataStructSerialBlock:nil
                                 dataStructDeserialBlock:nil];
  }
  return DBSHARINGCheckShareJobStatus;
}

+ (DBRoute *)DBSHARINGCreateSharedLink {
  if (!DBSHARINGCreateSharedLink) {
    DBSHARINGCreateSharedLink = [[DBRoute alloc] init:@"create_shared_link"
                                           namespace_:@"sharing"
                                           deprecated:@YES
                                           resultType:[DBSHARINGPathLinkMetadata class]
                                            errorType:[DBSHARINGCreateSharedLinkError class]
                                                attrs:@{
                                                  @"auth" : @"user",
                                                  @"host" : @"api",
                                                  @"style" : @"rpc"
                                                }
                                dataStructSerialBlock:nil
                              dataStructDeserialBlock:nil];
  }
  return DBSHARINGCreateSharedLink;
}

+ (DBRoute *)DBSHARINGCreateSharedLinkWithSettings {
  if (!DBSHARINGCreateSharedLinkWithSettings) {
    DBSHARINGCreateSharedLinkWithSettings = [[DBRoute alloc] init:@"create_shared_link_with_settings"
                                                       namespace_:@"sharing"
                                                       deprecated:@NO
                                                       resultType:[DBSHARINGSharedLinkMetadata class]
                                                        errorType:[DBSHARINGCreateSharedLinkWithSettingsError class]
                                                            attrs:@{
                                                              @"auth" : @"user",
                                                              @"host" : @"api",
                                                              @"style" : @"rpc"
                                                            }
                                            dataStructSerialBlock:nil
                                          dataStructDeserialBlock:nil];
  }
  return DBSHARINGCreateSharedLinkWithSettings;
}

+ (DBRoute *)DBSHARINGGetFileMetadata {
  if (!DBSHARINGGetFileMetadata) {
    DBSHARINGGetFileMetadata = [[DBRoute alloc] init:@"get_file_metadata"
                                          namespace_:@"sharing"
                                          deprecated:@NO
                                          resultType:[DBSHARINGSharedFileMetadata class]
                                           errorType:[DBSHARINGGetFileMetadataError class]
                                               attrs:@{
                                                 @"auth" : @"user",
                                                 @"host" : @"api",
                                                 @"style" : @"rpc"
                                               }
                               dataStructSerialBlock:nil
                             dataStructDeserialBlock:nil];
  }
  return DBSHARINGGetFileMetadata;
}

+ (DBRoute *)DBSHARINGGetFileMetadataBatch {
  if (!DBSHARINGGetFileMetadataBatch) {
    DBSHARINGGetFileMetadataBatch = [[DBRoute alloc] init:@"get_file_metadata/batch"
        namespace_:@"sharing"
        deprecated:@NO
        resultType:[NSArray<DBSHARINGGetFileMetadataBatchResult *> class]
        errorType:[DBSHARINGSharingUserError class]
        attrs:@{
          @"auth" : @"user",
          @"host" : @"api",
          @"style" : @"rpc"
        }
        dataStructSerialBlock:nil
        dataStructDeserialBlock:^id(id dataStruct) {
          return [DBArraySerializer deserialize:dataStruct
                                      withBlock:^id(id elem0) {
                                        return [DBSHARINGGetFileMetadataBatchResultSerializer deserialize:elem0];
                                      }];
        }];
  }
  return DBSHARINGGetFileMetadataBatch;
}

+ (DBRoute *)DBSHARINGGetFolderMetadata {
  if (!DBSHARINGGetFolderMetadata) {
    DBSHARINGGetFolderMetadata = [[DBRoute alloc] init:@"get_folder_metadata"
                                            namespace_:@"sharing"
                                            deprecated:@NO
                                            resultType:[DBSHARINGSharedFolderMetadata class]
                                             errorType:[DBSHARINGSharedFolderAccessError class]
                                                 attrs:@{
                                                   @"auth" : @"user",
                                                   @"host" : @"api",
                                                   @"style" : @"rpc"
                                                 }
                                 dataStructSerialBlock:nil
                               dataStructDeserialBlock:nil];
  }
  return DBSHARINGGetFolderMetadata;
}

+ (DBRoute *)DBSHARINGGetSharedLinkFile {
  if (!DBSHARINGGetSharedLinkFile) {
    DBSHARINGGetSharedLinkFile = [[DBRoute alloc] init:@"get_shared_link_file"
                                            namespace_:@"sharing"
                                            deprecated:@NO
                                            resultType:[DBSHARINGSharedLinkMetadata class]
                                             errorType:[DBSHARINGGetSharedLinkFileError class]
                                                 attrs:@{
                                                   @"auth" : @"user",
                                                   @"host" : @"content",
                                                   @"style" : @"download"
                                                 }
                                 dataStructSerialBlock:nil
                               dataStructDeserialBlock:nil];
  }
  return DBSHARINGGetSharedLinkFile;
}

+ (DBRoute *)DBSHARINGGetSharedLinkMetadata {
  if (!DBSHARINGGetSharedLinkMetadata) {
    DBSHARINGGetSharedLinkMetadata = [[DBRoute alloc] init:@"get_shared_link_metadata"
                                                namespace_:@"sharing"
                                                deprecated:@NO
                                                resultType:[DBSHARINGSharedLinkMetadata class]
                                                 errorType:[DBSHARINGSharedLinkError class]
                                                     attrs:@{
                                                       @"auth" : @"user",
                                                       @"host" : @"api",
                                                       @"style" : @"rpc"
                                                     }
                                     dataStructSerialBlock:nil
                                   dataStructDeserialBlock:nil];
  }
  return DBSHARINGGetSharedLinkMetadata;
}

+ (DBRoute *)DBSHARINGGetSharedLinks {
  if (!DBSHARINGGetSharedLinks) {
    DBSHARINGGetSharedLinks = [[DBRoute alloc] init:@"get_shared_links"
                                         namespace_:@"sharing"
                                         deprecated:@YES
                                         resultType:[DBSHARINGGetSharedLinksResult class]
                                          errorType:[DBSHARINGGetSharedLinksError class]
                                              attrs:@{
                                                @"auth" : @"user",
                                                @"host" : @"api",
                                                @"style" : @"rpc"
                                              }
                              dataStructSerialBlock:nil
                            dataStructDeserialBlock:nil];
  }
  return DBSHARINGGetSharedLinks;
}

+ (DBRoute *)DBSHARINGListFileMembers {
  if (!DBSHARINGListFileMembers) {
    DBSHARINGListFileMembers = [[DBRoute alloc] init:@"list_file_members"
                                          namespace_:@"sharing"
                                          deprecated:@NO
                                          resultType:[DBSHARINGSharedFileMembers class]
                                           errorType:[DBSHARINGListFileMembersError class]
                                               attrs:@{
                                                 @"auth" : @"user",
                                                 @"host" : @"api",
                                                 @"style" : @"rpc"
                                               }
                               dataStructSerialBlock:nil
                             dataStructDeserialBlock:nil];
  }
  return DBSHARINGListFileMembers;
}

+ (DBRoute *)DBSHARINGListFileMembersBatch {
  if (!DBSHARINGListFileMembersBatch) {
    DBSHARINGListFileMembersBatch = [[DBRoute alloc] init:@"list_file_members/batch"
        namespace_:@"sharing"
        deprecated:@NO
        resultType:[NSArray<DBSHARINGListFileMembersBatchResult *> class]
        errorType:[DBSHARINGSharingUserError class]
        attrs:@{
          @"auth" : @"user",
          @"host" : @"api",
          @"style" : @"rpc"
        }
        dataStructSerialBlock:nil
        dataStructDeserialBlock:^id(id dataStruct) {
          return [DBArraySerializer deserialize:dataStruct
                                      withBlock:^id(id elem0) {
                                        return [DBSHARINGListFileMembersBatchResultSerializer deserialize:elem0];
                                      }];
        }];
  }
  return DBSHARINGListFileMembersBatch;
}

+ (DBRoute *)DBSHARINGListFileMembersContinue {
  if (!DBSHARINGListFileMembersContinue) {
    DBSHARINGListFileMembersContinue = [[DBRoute alloc] init:@"list_file_members/continue"
                                                  namespace_:@"sharing"
                                                  deprecated:@NO
                                                  resultType:[DBSHARINGSharedFileMembers class]
                                                   errorType:[DBSHARINGListFileMembersContinueError class]
                                                       attrs:@{
                                                         @"auth" : @"user",
                                                         @"host" : @"api",
                                                         @"style" : @"rpc"
                                                       }
                                       dataStructSerialBlock:nil
                                     dataStructDeserialBlock:nil];
  }
  return DBSHARINGListFileMembersContinue;
}

+ (DBRoute *)DBSHARINGListFolderMembers {
  if (!DBSHARINGListFolderMembers) {
    DBSHARINGListFolderMembers = [[DBRoute alloc] init:@"list_folder_members"
                                            namespace_:@"sharing"
                                            deprecated:@NO
                                            resultType:[DBSHARINGSharedFolderMembers class]
                                             errorType:[DBSHARINGSharedFolderAccessError class]
                                                 attrs:@{
                                                   @"auth" : @"user",
                                                   @"host" : @"api",
                                                   @"style" : @"rpc"
                                                 }
                                 dataStructSerialBlock:nil
                               dataStructDeserialBlock:nil];
  }
  return DBSHARINGListFolderMembers;
}

+ (DBRoute *)DBSHARINGListFolderMembersContinue {
  if (!DBSHARINGListFolderMembersContinue) {
    DBSHARINGListFolderMembersContinue = [[DBRoute alloc] init:@"list_folder_members/continue"
                                                    namespace_:@"sharing"
                                                    deprecated:@NO
                                                    resultType:[DBSHARINGSharedFolderMembers class]
                                                     errorType:[DBSHARINGListFolderMembersContinueError class]
                                                         attrs:@{
                                                           @"auth" : @"user",
                                                           @"host" : @"api",
                                                           @"style" : @"rpc"
                                                         }
                                         dataStructSerialBlock:nil
                                       dataStructDeserialBlock:nil];
  }
  return DBSHARINGListFolderMembersContinue;
}

+ (DBRoute *)DBSHARINGListFolders {
  if (!DBSHARINGListFolders) {
    DBSHARINGListFolders = [[DBRoute alloc] init:@"list_folders"
                                      namespace_:@"sharing"
                                      deprecated:@NO
                                      resultType:[DBSHARINGListFoldersResult class]
                                       errorType:nil
                                           attrs:@{
                                             @"auth" : @"user",
                                             @"host" : @"api",
                                             @"style" : @"rpc"
                                           }
                           dataStructSerialBlock:nil
                         dataStructDeserialBlock:nil];
  }
  return DBSHARINGListFolders;
}

+ (DBRoute *)DBSHARINGListFoldersContinue {
  if (!DBSHARINGListFoldersContinue) {
    DBSHARINGListFoldersContinue = [[DBRoute alloc] init:@"list_folders/continue"
                                              namespace_:@"sharing"
                                              deprecated:@NO
                                              resultType:[DBSHARINGListFoldersResult class]
                                               errorType:[DBSHARINGListFoldersContinueError class]
                                                   attrs:@{
                                                     @"auth" : @"user",
                                                     @"host" : @"api",
                                                     @"style" : @"rpc"
                                                   }
                                   dataStructSerialBlock:nil
                                 dataStructDeserialBlock:nil];
  }
  return DBSHARINGListFoldersContinue;
}

+ (DBRoute *)DBSHARINGListMountableFolders {
  if (!DBSHARINGListMountableFolders) {
    DBSHARINGListMountableFolders = [[DBRoute alloc] init:@"list_mountable_folders"
                                               namespace_:@"sharing"
                                               deprecated:@NO
                                               resultType:[DBSHARINGListFoldersResult class]
                                                errorType:nil
                                                    attrs:@{
                                                      @"auth" : @"user",
                                                      @"host" : @"api",
                                                      @"style" : @"rpc"
                                                    }
                                    dataStructSerialBlock:nil
                                  dataStructDeserialBlock:nil];
  }
  return DBSHARINGListMountableFolders;
}

+ (DBRoute *)DBSHARINGListMountableFoldersContinue {
  if (!DBSHARINGListMountableFoldersContinue) {
    DBSHARINGListMountableFoldersContinue = [[DBRoute alloc] init:@"list_mountable_folders/continue"
                                                       namespace_:@"sharing"
                                                       deprecated:@NO
                                                       resultType:[DBSHARINGListFoldersResult class]
                                                        errorType:[DBSHARINGListFoldersContinueError class]
                                                            attrs:@{
                                                              @"auth" : @"user",
                                                              @"host" : @"api",
                                                              @"style" : @"rpc"
                                                            }
                                            dataStructSerialBlock:nil
                                          dataStructDeserialBlock:nil];
  }
  return DBSHARINGListMountableFoldersContinue;
}

+ (DBRoute *)DBSHARINGListReceivedFiles {
  if (!DBSHARINGListReceivedFiles) {
    DBSHARINGListReceivedFiles = [[DBRoute alloc] init:@"list_received_files"
                                            namespace_:@"sharing"
                                            deprecated:@NO
                                            resultType:[DBSHARINGListFilesResult class]
                                             errorType:[DBSHARINGSharingUserError class]
                                                 attrs:@{
                                                   @"auth" : @"user",
                                                   @"host" : @"api",
                                                   @"style" : @"rpc"
                                                 }
                                 dataStructSerialBlock:nil
                               dataStructDeserialBlock:nil];
  }
  return DBSHARINGListReceivedFiles;
}

+ (DBRoute *)DBSHARINGListReceivedFilesContinue {
  if (!DBSHARINGListReceivedFilesContinue) {
    DBSHARINGListReceivedFilesContinue = [[DBRoute alloc] init:@"list_received_files/continue"
                                                    namespace_:@"sharing"
                                                    deprecated:@NO
                                                    resultType:[DBSHARINGListFilesResult class]
                                                     errorType:[DBSHARINGListFilesContinueError class]
                                                         attrs:@{
                                                           @"auth" : @"user",
                                                           @"host" : @"api",
                                                           @"style" : @"rpc"
                                                         }
                                         dataStructSerialBlock:nil
                                       dataStructDeserialBlock:nil];
  }
  return DBSHARINGListReceivedFilesContinue;
}

+ (DBRoute *)DBSHARINGListSharedLinks {
  if (!DBSHARINGListSharedLinks) {
    DBSHARINGListSharedLinks = [[DBRoute alloc] init:@"list_shared_links"
                                          namespace_:@"sharing"
                                          deprecated:@NO
                                          resultType:[DBSHARINGListSharedLinksResult class]
                                           errorType:[DBSHARINGListSharedLinksError class]
                                               attrs:@{
                                                 @"auth" : @"user",
                                                 @"host" : @"api",
                                                 @"style" : @"rpc"
                                               }
                               dataStructSerialBlock:nil
                             dataStructDeserialBlock:nil];
  }
  return DBSHARINGListSharedLinks;
}

+ (DBRoute *)DBSHARINGModifySharedLinkSettings {
  if (!DBSHARINGModifySharedLinkSettings) {
    DBSHARINGModifySharedLinkSettings = [[DBRoute alloc] init:@"modify_shared_link_settings"
                                                   namespace_:@"sharing"
                                                   deprecated:@NO
                                                   resultType:[DBSHARINGSharedLinkMetadata class]
                                                    errorType:[DBSHARINGModifySharedLinkSettingsError class]
                                                        attrs:@{
                                                          @"auth" : @"user",
                                                          @"host" : @"api",
                                                          @"style" : @"rpc"
                                                        }
                                        dataStructSerialBlock:nil
                                      dataStructDeserialBlock:nil];
  }
  return DBSHARINGModifySharedLinkSettings;
}

+ (DBRoute *)DBSHARINGMountFolder {
  if (!DBSHARINGMountFolder) {
    DBSHARINGMountFolder = [[DBRoute alloc] init:@"mount_folder"
                                      namespace_:@"sharing"
                                      deprecated:@NO
                                      resultType:[DBSHARINGSharedFolderMetadata class]
                                       errorType:[DBSHARINGMountFolderError class]
                                           attrs:@{
                                             @"auth" : @"user",
                                             @"host" : @"api",
                                             @"style" : @"rpc"
                                           }
                           dataStructSerialBlock:nil
                         dataStructDeserialBlock:nil];
  }
  return DBSHARINGMountFolder;
}

+ (DBRoute *)DBSHARINGRelinquishFileMembership {
  if (!DBSHARINGRelinquishFileMembership) {
    DBSHARINGRelinquishFileMembership = [[DBRoute alloc] init:@"relinquish_file_membership"
                                                   namespace_:@"sharing"
                                                   deprecated:@NO
                                                   resultType:nil
                                                    errorType:[DBSHARINGRelinquishFileMembershipError class]
                                                        attrs:@{
                                                          @"auth" : @"user",
                                                          @"host" : @"api",
                                                          @"style" : @"rpc"
                                                        }
                                        dataStructSerialBlock:nil
                                      dataStructDeserialBlock:nil];
  }
  return DBSHARINGRelinquishFileMembership;
}

+ (DBRoute *)DBSHARINGRelinquishFolderMembership {
  if (!DBSHARINGRelinquishFolderMembership) {
    DBSHARINGRelinquishFolderMembership = [[DBRoute alloc] init:@"relinquish_folder_membership"
                                                     namespace_:@"sharing"
                                                     deprecated:@NO
                                                     resultType:[DBASYNCLaunchEmptyResult class]
                                                      errorType:[DBSHARINGRelinquishFolderMembershipError class]
                                                          attrs:@{
                                                            @"auth" : @"user",
                                                            @"host" : @"api",
                                                            @"style" : @"rpc"
                                                          }
                                          dataStructSerialBlock:nil
                                        dataStructDeserialBlock:nil];
  }
  return DBSHARINGRelinquishFolderMembership;
}

+ (DBRoute *)DBSHARINGRemoveFileMember {
  if (!DBSHARINGRemoveFileMember) {
    DBSHARINGRemoveFileMember = [[DBRoute alloc] init:@"remove_file_member"
                                           namespace_:@"sharing"
                                           deprecated:@YES
                                           resultType:[DBSHARINGFileMemberActionIndividualResult class]
                                            errorType:[DBSHARINGRemoveFileMemberError class]
                                                attrs:@{
                                                  @"auth" : @"user",
                                                  @"host" : @"api",
                                                  @"style" : @"rpc"
                                                }
                                dataStructSerialBlock:nil
                              dataStructDeserialBlock:nil];
  }
  return DBSHARINGRemoveFileMember;
}

+ (DBRoute *)DBSHARINGRemoveFileMember2 {
  if (!DBSHARINGRemoveFileMember2) {
    DBSHARINGRemoveFileMember2 = [[DBRoute alloc] init:@"remove_file_member_2"
                                            namespace_:@"sharing"
                                            deprecated:@NO
                                            resultType:[DBSHARINGFileMemberRemoveActionResult class]
                                             errorType:[DBSHARINGRemoveFileMemberError class]
                                                 attrs:@{
                                                   @"auth" : @"user",
                                                   @"host" : @"api",
                                                   @"style" : @"rpc"
                                                 }
                                 dataStructSerialBlock:nil
                               dataStructDeserialBlock:nil];
  }
  return DBSHARINGRemoveFileMember2;
}

+ (DBRoute *)DBSHARINGRemoveFolderMember {
  if (!DBSHARINGRemoveFolderMember) {
    DBSHARINGRemoveFolderMember = [[DBRoute alloc] init:@"remove_folder_member"
                                             namespace_:@"sharing"
                                             deprecated:@NO
                                             resultType:[DBASYNCLaunchResultBase class]
                                              errorType:[DBSHARINGRemoveFolderMemberError class]
                                                  attrs:@{
                                                    @"auth" : @"user",
                                                    @"host" : @"api",
                                                    @"style" : @"rpc"
                                                  }
                                  dataStructSerialBlock:nil
                                dataStructDeserialBlock:nil];
  }
  return DBSHARINGRemoveFolderMember;
}

+ (DBRoute *)DBSHARINGRevokeSharedLink {
  if (!DBSHARINGRevokeSharedLink) {
    DBSHARINGRevokeSharedLink = [[DBRoute alloc] init:@"revoke_shared_link"
                                           namespace_:@"sharing"
                                           deprecated:@NO
                                           resultType:nil
                                            errorType:[DBSHARINGRevokeSharedLinkError class]
                                                attrs:@{
                                                  @"auth" : @"user",
                                                  @"host" : @"api",
                                                  @"style" : @"rpc"
                                                }
                                dataStructSerialBlock:nil
                              dataStructDeserialBlock:nil];
  }
  return DBSHARINGRevokeSharedLink;
}

+ (DBRoute *)DBSHARINGShareFolder {
  if (!DBSHARINGShareFolder) {
    DBSHARINGShareFolder = [[DBRoute alloc] init:@"share_folder"
                                      namespace_:@"sharing"
                                      deprecated:@NO
                                      resultType:[DBSHARINGShareFolderLaunch class]
                                       errorType:[DBSHARINGShareFolderError class]
                                           attrs:@{
                                             @"auth" : @"user",
                                             @"host" : @"api",
                                             @"style" : @"rpc"
                                           }
                           dataStructSerialBlock:nil
                         dataStructDeserialBlock:nil];
  }
  return DBSHARINGShareFolder;
}

+ (DBRoute *)DBSHARINGTransferFolder {
  if (!DBSHARINGTransferFolder) {
    DBSHARINGTransferFolder = [[DBRoute alloc] init:@"transfer_folder"
                                         namespace_:@"sharing"
                                         deprecated:@NO
                                         resultType:nil
                                          errorType:[DBSHARINGTransferFolderError class]
                                              attrs:@{
                                                @"auth" : @"user",
                                                @"host" : @"api",
                                                @"style" : @"rpc"
                                              }
                              dataStructSerialBlock:nil
                            dataStructDeserialBlock:nil];
  }
  return DBSHARINGTransferFolder;
}

+ (DBRoute *)DBSHARINGUnmountFolder {
  if (!DBSHARINGUnmountFolder) {
    DBSHARINGUnmountFolder = [[DBRoute alloc] init:@"unmount_folder"
                                        namespace_:@"sharing"
                                        deprecated:@NO
                                        resultType:nil
                                         errorType:[DBSHARINGUnmountFolderError class]
                                             attrs:@{
                                               @"auth" : @"user",
                                               @"host" : @"api",
                                               @"style" : @"rpc"
                                             }
                             dataStructSerialBlock:nil
                           dataStructDeserialBlock:nil];
  }
  return DBSHARINGUnmountFolder;
}

+ (DBRoute *)DBSHARINGUnshareFile {
  if (!DBSHARINGUnshareFile) {
    DBSHARINGUnshareFile = [[DBRoute alloc] init:@"unshare_file"
                                      namespace_:@"sharing"
                                      deprecated:@NO
                                      resultType:nil
                                       errorType:[DBSHARINGUnshareFileError class]
                                           attrs:@{
                                             @"auth" : @"user",
                                             @"host" : @"api",
                                             @"style" : @"rpc"
                                           }
                           dataStructSerialBlock:nil
                         dataStructDeserialBlock:nil];
  }
  return DBSHARINGUnshareFile;
}

+ (DBRoute *)DBSHARINGUnshareFolder {
  if (!DBSHARINGUnshareFolder) {
    DBSHARINGUnshareFolder = [[DBRoute alloc] init:@"unshare_folder"
                                        namespace_:@"sharing"
                                        deprecated:@NO
                                        resultType:[DBASYNCLaunchEmptyResult class]
                                         errorType:[DBSHARINGUnshareFolderError class]
                                             attrs:@{
                                               @"auth" : @"user",
                                               @"host" : @"api",
                                               @"style" : @"rpc"
                                             }
                             dataStructSerialBlock:nil
                           dataStructDeserialBlock:nil];
  }
  return DBSHARINGUnshareFolder;
}

+ (DBRoute *)DBSHARINGUpdateFileMember {
  if (!DBSHARINGUpdateFileMember) {
    DBSHARINGUpdateFileMember = [[DBRoute alloc] init:@"update_file_member"
                                           namespace_:@"sharing"
                                           deprecated:@NO
                                           resultType:[DBSHARINGMemberAccessLevelResult class]
                                            errorType:[DBSHARINGFileMemberActionError class]
                                                attrs:@{
                                                  @"auth" : @"user",
                                                  @"host" : @"api",
                                                  @"style" : @"rpc"
                                                }
                                dataStructSerialBlock:nil
                              dataStructDeserialBlock:nil];
  }
  return DBSHARINGUpdateFileMember;
}

+ (DBRoute *)DBSHARINGUpdateFolderMember {
  if (!DBSHARINGUpdateFolderMember) {
    DBSHARINGUpdateFolderMember = [[DBRoute alloc] init:@"update_folder_member"
                                             namespace_:@"sharing"
                                             deprecated:@NO
                                             resultType:[DBSHARINGMemberAccessLevelResult class]
                                              errorType:[DBSHARINGUpdateFolderMemberError class]
                                                  attrs:@{
                                                    @"auth" : @"user",
                                                    @"host" : @"api",
                                                    @"style" : @"rpc"
                                                  }
                                  dataStructSerialBlock:nil
                                dataStructDeserialBlock:nil];
  }
  return DBSHARINGUpdateFolderMember;
}

+ (DBRoute *)DBSHARINGUpdateFolderPolicy {
  if (!DBSHARINGUpdateFolderPolicy) {
    DBSHARINGUpdateFolderPolicy = [[DBRoute alloc] init:@"update_folder_policy"
                                             namespace_:@"sharing"
                                             deprecated:@NO
                                             resultType:[DBSHARINGSharedFolderMetadata class]
                                              errorType:[DBSHARINGUpdateFolderPolicyError class]
                                                  attrs:@{
                                                    @"auth" : @"user",
                                                    @"host" : @"api",
                                                    @"style" : @"rpc"
                                                  }
                                  dataStructSerialBlock:nil
                                dataStructDeserialBlock:nil];
  }
  return DBSHARINGUpdateFolderPolicy;
}

@end


text:
package weibo4j;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.w3c.dom.Element;

import weibo4j.http.Response;
import weibo4j.org.json.JSONArray;
import weibo4j.org.json.JSONException;
import weibo4j.org.json.JSONObject;

public class Follower extends WeiboResponse implements java.io.Serializable{
	private long id;
	private String user1Id;
	private String user1Name;
	private String user2Id;
	private String user2Name;

    private static final long serialVersionUID = 1608000492860584608L;

	public Follower() {
	}

    /*package*/Follower(Response res, Weibo weibo) throws WeiboException {
        super(res);
        Element elem = res.asDocument().getDocumentElement();
        init(res, elem, weibo);
    }

    /*modify by sycheng add json define */
    /*package*/Follower(Response res) throws WeiboException {
        super(res);
        JSONObject json =res.asJSONObject();
        try {
			id = json.getLong("id");
			user1Id = json.getString(user1Id);
			user1Name=json.getString(user1Name);
			user2Id = json.getString(user2Id);
			user2Name=json.getString(user2Name);
		} catch (JSONException je) {
			throw new WeiboException(je.getMessage() + ":" + json.toString(), je);
		}
    }

    /* modify by sina add some field*/
    public Follower(JSONObject json)throws WeiboException, JSONException{
    	id = json.getLong("id");
		user1Id = json.getString(user1Id);
		user1Name=json.getString(user1Name);
		user2Id = json.getString(user2Id);
		user2Name=json.getString(user2Name);
    }

    /*package*/Follower(Response res, Element elem, Weibo weibo) throws
            WeiboException {
        super(res);
        init(res, elem, weibo);
    }

    public Follower(String str) throws WeiboException, JSONException {
        // StatusStream uses this constructor
        super();
        JSONObject json = new JSONObject(str);
        id = json.getLong("id");
		user1Id = json.getString(user1Id);
		user1Name=json.getString(user1Name);
		user2Id = json.getString(user2Id);
		user2Name=json.getString(user2Name);
    }

    private void init(Response res, Element elem, Weibo weibo) throws
    WeiboException {
	ensureRootNodeNameIs("friend", elem);
	id = getChildLong("id", elem);
	user1Id = getChildText("user1Id", elem);
	user1Name = getChildText("user1Name", elem);
	user2Id = getChildText("user2Id", elem);
	user2Name = getChildText("user2Name", elem);
}

	static List<Follower> constructFollowers(Response res) throws WeiboException {
	   	 try {
	            JSONArray list = res.asJSONArray();
	            int size = list.length();
	            List<Follower> followers = new ArrayList<Follower>(size);
	            for (int i = 0; i < size; i++) {
	            	followers.add(new Follower(list.getJSONObject(i)));
	            }
	            return followers;
	        } catch (JSONException jsone) {
	            throw new WeiboException(jsone);
	        } catch (WeiboException te) {
	            throw te;
	        }
	   }
    /**
     * Returns the id of the status
     *
     * @return the id
     */
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getUser1Id() {
		return user1Id;
	}
	public void setUser1Id(String user1Id) {
		this.user1Id = user1Id;
	}
	public String getUser1Name() {
		return user1Name;
	}
	public void setUser1Name(String user1Name) {
		this.user1Name = user1Name;
	}
	public String getUser2Id() {
		return user2Id;
	}
	public void setUser2Id(String user2Id) {
		this.user2Id = user2Id;
	}
	public String getUser2Name() {
		return user2Name;
	}
	public void setUser2Name(String user2Name) {
		this.user2Name = user2Name;
	}

    @Override
    public int hashCode() {
        return (int) id;
    }
    @Override
    public boolean equals(Object obj) {
        if (null == obj) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        return obj instanceof Follower && ((Follower) obj).id == this.id;
    }

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("id", this.id).append(
				"user2Id", this.user2Id).append("user2Name", this.user2Name)
				.append("user1Id", this.user1Id).append("user1Name",
						this.user1Name).toString();
	}

}

redpajama_set_name: RedPajamaGithub


text:
namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace VMVX {

class VMVXDialect : public Dialect {
 public:
  explicit VMVXDialect(MLIRContext *context);
  static StringRef getDialectNamespace() { return "vmvx"; }
};

}  // namespace VMVX
}  // namespace IREE
}  // namespace iree_compiler
}  // namespace mlir

#endif  // IREE_COMPILER_DIALECT_VMVX_IR_VMVXDIALECT_H_


text:
<?php
//
// Definition of eZOETemplateUtils class
//
// Created on: <14-May-2008 18:42:08 ar>
//
// ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
// SOFTWARE NAME: eZ Online Editor
// SOFTWARE RELEASE: 5.2.0
// COPYRIGHT NOTICE: Copyright (C) 1999-2013 eZ Systems AS
// SOFTWARE LICENSE: eZ Business Use License Agreement eZ BUL Version 2.1
// NOTICE: >
//   This source file is part of the eZ Publish CMS and is
//   licensed under the terms and conditions of the eZ Business Use
//   License v2.1 (eZ BUL).
//
//   A copy of the eZ BUL was included with the software. If the
//   license is missing, request a copy of the license via email
//   at license@ez.no or via postal mail at
//  	Attn: Licensing Dept. eZ Systems AS, Klostergata 30, N-3732 Skien, Norway
//
//   IMPORTANT: THE SOFTWARE IS LICENSED, NOT SOLD. ADDITIONALLY, THE
//   SOFTWARE IS LICENSED "AS IS," WITHOUT ANY WARRANTIES WHATSOEVER.
//   READ THE eZ BUL BEFORE USING, INSTALLING OR MODIFYING THE SOFTWARE.

// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//

/*
 Some misc template operators to get access to some of the features in eZ Publish API

*/

class eZOETemplateUtils
{
    function eZOETemplateUtils()
    {
    }

    function operatorList()
    {
        return array( 'ezoe_ini_section' );
    }

    function namedParameterPerOperator()
    {
        return true;
    }

    function namedParameterList()
    {
        return array( 'ezoe_ini_section' => array( 'section' => array(
                                                       'type' => 'string',
                                                       'required' => true,
                                                       'default' => '' ),
                                                   'file' => array(
                                                       'type' => 'string',
                                                       'required' => false,
                                                       'default' => 'site.ini' )
                                           ));
    }

    function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters )
    {
        $ret = '';

        switch ( $operatorName )
        {
            case 'ezoe_ini_section':
                {
                    $ini = eZINI::instance( $namedParameters['file'] );
                    $ret = $ini->hasSection( $namedParameters['section'] );
                } break;
        }
        $operatorValue = $ret;
    }

}

?>


text:
module Views
  module Layouts
    class Eshelf < ActionView::Mustache
    end
  end
end


text:
package personal.vap78.logging.diagtool.impl.console;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import personal.vap78.logging.diagtool.Session;
import personal.vap78.logging.diagtool.impl.console.cmd.AbstractLogCommand;

public class ConsoleSession extends Session {

  private static Map<String, ConsoleSession> sessions = new HashMap<>();

  public static ConsoleSession getById(String id) {
    return sessions.get(id);
  }

  public static void deleteSession(String id) {
    sessions.remove(id);
  }

  public ConsoleSession(String id, Properties properties) {
    super(id, properties);
  }

  public static ConsoleSession createSession(String id, Properties props) {
    ConsoleSession session = new ConsoleSession(id, props);
    sessions.put(id, session);
    return session;
  }

  public String getHost() {
    return properties.getProperty(AbstractLogCommand.HOST_PARAM);
  }

  public String getAccount() {
    return properties.getProperty(AbstractLogCommand.ACCOUNT_PARAM);
  }

  public String getApplication() {
    return properties.getProperty(AbstractLogCommand.APPLICATION_PARAM);
  }

  public String getUser() {
    return properties.getProperty(AbstractLogCommand.USER_PARAM);
  }

  public String getPassword() {
    return properties.getProperty(AbstractLogCommand.PASSWORD_PARAM);
  }

  public String getSDKPath() {
    return properties.getProperty(AbstractLogCommand.SDK_PATH_PARAM, "");
  }

  public String getProxy() {
    return properties.getProperty(AbstractLogCommand.PROXY_PARAM, "");
  }

  public String getProxyUser() {
    return properties.getProperty(AbstractLogCommand.PROXY_USER_PARAM, "");
  }

  public String getProxyPassword() {
    return properties.getProperty(AbstractLogCommand.PROXY_PASSWORD_PARAM, "");
  }

  public String getLongName() {
    return getHost() + "_" + getAccount() + "_" + getApplication();
  }

  @Override
  public boolean isTrialAccount() {
    return getHost().contains("hanatrial");
  }

}


text:
"""
    Environmental Exposures API

    Environmental Exposures API

    OpenAPI spec version: 1.0.0
    Contact: stealey@renci.org
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from __future__ import absolute_import

import os
import sys
import unittest

import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.date_range import DateRange

class TestDateRange(unittest.TestCase):
    """ DateRange unit test stubs """

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testDateRange(self):
        """
        Test DateRange
        """
        model = swagger_client.models.date_range.DateRange()

if __name__ == '__main__':
    unittest.main()


text:
package com.intellij.compiler.impl;

import com.intellij.compiler.impl.generic.GenericCompilerCache;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.compiler.*;
import com.intellij.openapi.compiler.Compiler;
import com.intellij.openapi.compiler.generic.GenericCompiler;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.annotations.NonNls;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Eugene Zhuravlev
 */
public class CompilerCacheManager implements Disposable {
  private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.CompilerCacheManager");
  private final Map<Compiler, Object> myCompilerToCacheMap = new HashMap<>();
  private final Map<GenericCompiler<?,?,?>, GenericCompilerCache<?,?,?>> myGenericCachesMap = new HashMap<>();
  private final List<Disposable> myCacheDisposables = new ArrayList<>();
  private final File myCachesRoot;
  private final Project myProject;

  public CompilerCacheManager(Project project) {
    myProject = project;
    myCachesRoot = CompilerPaths.getCacheStoreDirectory(project);
  }

  public static CompilerCacheManager getInstance(Project project) {
    return project.getComponent(CompilerCacheManager.class);
  }

  @Override
  public void dispose() {
    flushCaches();
  }

  private File getCompilerRootDir(final Compiler compiler) {
    final File dir = new File(myCachesRoot, getCompilerIdString(compiler));
    dir.mkdirs();
    return dir;
  }

  synchronized <Key, SourceState, OutputState> GenericCompilerCache<Key, SourceState, OutputState>
                                 getGenericCompilerCache(final GenericCompiler<Key, SourceState, OutputState> compiler) throws IOException {
    GenericCompilerCache<?,?,?> cache = myGenericCachesMap.get(compiler);
    if (cache == null) {
      final GenericCompilerCache<?,?,?> genericCache = new GenericCompilerCache<>(compiler, GenericCompilerRunner
        .getGenericCompilerCacheDir(myProject, compiler));
      myGenericCachesMap.put(compiler, genericCache);
      myCacheDisposables.add(() -> {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Closing cache for feneric compiler " + compiler.getId());
        }
        genericCache.close();
      });
      cache = genericCache;
    }
    //noinspection unchecked
    return (GenericCompilerCache<Key, SourceState, OutputState>)cache;
  }

  synchronized FileProcessingCompilerStateCache getFileProcessingCompilerCache(final FileProcessingCompiler compiler) throws IOException {
    Object cache = myCompilerToCacheMap.get(compiler);
    if (cache == null) {
      final File compilerRootDir = getCompilerRootDir(compiler);
      final FileProcessingCompilerStateCache stateCache = new FileProcessingCompilerStateCache(compilerRootDir, compiler);
      myCompilerToCacheMap.put(compiler, stateCache);
      myCacheDisposables.add(() -> {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Closing cache for compiler " + compiler.getDescription() + "; cache root dir: " + compilerRootDir);
        }
        stateCache.close();
      });
      cache = stateCache;
    }
    else {
      LOG.assertTrue(cache instanceof FileProcessingCompilerStateCache);
    }
    return (FileProcessingCompilerStateCache)cache;
  }

  public static String getCompilerIdString(Compiler compiler) {
    @NonNls String description = compiler.getDescription();
    return description.replaceAll("\\s+", "_").replaceAll("[\\.\\?]", "_").toLowerCase();
  }

  synchronized void flushCaches() {
    for (Disposable disposable : myCacheDisposables) {
      try {
        Disposer.dispose(disposable);
      }
      catch (Throwable e) {
        LOG.info(e);
      }
    }
    myCacheDisposables.clear();
    myGenericCachesMap.clear();
    myCompilerToCacheMap.clear();
  }

  public void clearCaches(final CompileContext context) {
    flushCaches();
    final File[] children = myCachesRoot.listFiles();
    if (children != null) {
      for (final File child : children) {
        final boolean deleteOk = FileUtil.delete(child);
        if (!deleteOk) {
          context.addMessage(CompilerMessageCategory.ERROR, CompilerBundle.message("compiler.error.failed.to.delete", child.getPath()), null, -1, -1);
        }
      }
    }
  }
}


text:
/*
Package wrangler contains functions for creating a management context with wrangler controllers.
*/
package wrangler

import (
	"context"
	"fmt"
	"net"
	"net/http"
	"sync"

	prommonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
	fleetv1alpha1api "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
	"github.com/rancher/lasso/pkg/controller"
	"github.com/rancher/lasso/pkg/dynamic"
	"github.com/rancher/norman/types"
	catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1"
	clusterv3api "github.com/rancher/rancher/pkg/apis/cluster.cattle.io/v3"
	managementv3api "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
	projectv3api "github.com/rancher/rancher/pkg/apis/project.cattle.io/v3"
	provisioningv1api "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1"
	rkev1api "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1"
	"github.com/rancher/rancher/pkg/catalogv2/content"
	"github.com/rancher/rancher/pkg/catalogv2/helmop"
	"github.com/rancher/rancher/pkg/catalogv2/system"
	"github.com/rancher/rancher/pkg/controllers"
	"github.com/rancher/rancher/pkg/generated/controllers/catalog.cattle.io"
	catalogcontrollers "github.com/rancher/rancher/pkg/generated/controllers/catalog.cattle.io/v1"
	capi "github.com/rancher/rancher/pkg/generated/controllers/cluster.x-k8s.io"
	capicontrollers "github.com/rancher/rancher/pkg/generated/controllers/cluster.x-k8s.io/v1beta1"
	"github.com/rancher/rancher/pkg/generated/controllers/fleet.cattle.io"
	fleetv1alpha1 "github.com/rancher/rancher/pkg/generated/controllers/fleet.cattle.io/v1alpha1"
	"github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io"
	managementv3 "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3"
	"github.com/rancher/rancher/pkg/generated/controllers/project.cattle.io"
	projectv3 "github.com/rancher/rancher/pkg/generated/controllers/project.cattle.io/v3"
	"github.com/rancher/rancher/pkg/generated/controllers/provisioning.cattle.io"
	provisioningv1 "github.com/rancher/rancher/pkg/generated/controllers/provisioning.cattle.io/v1"
	"github.com/rancher/rancher/pkg/generated/controllers/rke.cattle.io"
	rkecontrollers "github.com/rancher/rancher/pkg/generated/controllers/rke.cattle.io/v1"
	"github.com/rancher/rancher/pkg/peermanager"
	"github.com/rancher/rancher/pkg/tunnelserver"
	"github.com/rancher/remotedialer"
	"github.com/rancher/steve/pkg/accesscontrol"
	"github.com/rancher/steve/pkg/client"
	"github.com/rancher/steve/pkg/server"
	"github.com/rancher/wrangler/pkg/apply"
	admissionreg "github.com/rancher/wrangler/pkg/generated/controllers/admissionregistration.k8s.io"
	admissionregcontrollers "github.com/rancher/wrangler/pkg/generated/controllers/admissionregistration.k8s.io/v1"
	"github.com/rancher/wrangler/pkg/generated/controllers/apps"
	appsv1 "github.com/rancher/wrangler/pkg/generated/controllers/apps/v1"
	"github.com/rancher/wrangler/pkg/generated/controllers/batch"
	batchv1 "github.com/rancher/wrangler/pkg/generated/controllers/batch/v1"
	"github.com/rancher/wrangler/pkg/generated/controllers/rbac"
	"github.com/rancher/wrangler/pkg/generic"
	"github.com/rancher/wrangler/pkg/leader"
	"github.com/rancher/wrangler/pkg/schemes"
	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	"k8s.io/apimachinery/pkg/api/meta"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
	"k8s.io/cli-runtime/pkg/genericclioptions"
	"k8s.io/client-go/discovery"
	"k8s.io/client-go/discovery/cached/memory"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/kubernetes/scheme"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/restmapper"
	"k8s.io/client-go/tools/clientcmd"
	apiregistrationv12 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
	capiv1beta1api "sigs.k8s.io/cluster-api/api/v1beta1"
)

var (
	localSchemeBuilder = runtime.SchemeBuilder{
		provisioningv1api.AddToScheme,
		capiv1beta1api.AddToScheme,
		fleetv1alpha1api.AddToScheme,
		managementv3api.AddToScheme,
		projectv3api.AddToScheme,
		clusterv3api.AddToScheme,
		rkev1api.AddToScheme,
		scheme.AddToScheme,
		apiextensionsv1.AddToScheme,
		apiregistrationv12.AddToScheme,
		prommonitoringv1.AddToScheme,
		catalogv1.AddToScheme,
	}
	AddToScheme = localSchemeBuilder.AddToScheme
	Scheme      = runtime.NewScheme()
)

func init() {
	metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
	utilruntime.Must(AddToScheme(Scheme))
	utilruntime.Must(schemes.AddToScheme(Scheme))
}

type Context struct {
	*server.Controllers

	Apply               apply.Apply
	Dynamic             *dynamic.Controller
	CAPI                capicontrollers.Interface
	RKE                 rkecontrollers.Interface
	Mgmt                managementv3.Interface
	Apps                appsv1.Interface
	Admission           admissionregcontrollers.Interface
	Batch               batchv1.Interface
	Fleet               fleetv1alpha1.Interface
	Project             projectv3.Interface
	Catalog             catalogcontrollers.Interface
	ControllerFactory   controller.SharedControllerFactory
	MultiClusterManager MultiClusterManager
	TunnelServer        *remotedialer.Server
	TunnelAuthorizer    *tunnelserver.Authorizers
	PeerManager         peermanager.PeerManager
	Provisioning        provisioningv1.Interface

	ASL                     accesscontrol.AccessSetLookup
	ClientConfig            clientcmd.ClientConfig
	CachedDiscovery         discovery.CachedDiscoveryInterface
	RESTMapper              meta.RESTMapper
	SharedControllerFactory controller.SharedControllerFactory
	leadership              *leader.Manager
	controllerLock          sync.Mutex

	RESTClientGetter      genericclioptions.RESTClientGetter
	CatalogContentManager *content.Manager
	HelmOperations        *helmop.Operations
	SystemChartsManager   *system.Manager

	started bool
}

type MultiClusterManager interface {
	NormanSchemas() *types.Schemas
	ClusterDialer(clusterID string) func(ctx context.Context, network, address string) (net.Conn, error)
	Start(ctx context.Context) error
	Wait(ctx context.Context)
	Middleware(next http.Handler) http.Handler
	K8sClient(clusterName string) (kubernetes.Interface, error)
}

func (w *Context) OnLeader(f func(ctx context.Context) error) {
	w.leadership.OnLeader(f)
}

func (w *Context) StartWithTransaction(ctx context.Context, f func(context.Context) error) (err error) {
	transaction := controller.NewHandlerTransaction(ctx)
	if err := f(transaction); err != nil {
		transaction.Rollback()
		return err
	}

	if err := w.ControllerFactory.SharedCacheFactory().Start(ctx); err != nil {
		transaction.Rollback()
		return err
	}

	w.ControllerFactory.SharedCacheFactory().WaitForCacheSync(ctx)
	transaction.Commit()
	return w.Start(ctx)
}

func (w *Context) Start(ctx context.Context) error {
	w.controllerLock.Lock()
	defer w.controllerLock.Unlock()

	if !w.started {
		if err := w.Dynamic.Register(ctx, w.SharedControllerFactory); err != nil {
			return err
		}
		w.SystemChartsManager.Start(ctx)
		w.started = true
	}

	if err := w.ControllerFactory.Start(ctx, 50); err != nil {
		return err
	}
	w.leadership.Start(ctx)
	return nil
}

func enableProtobuf(cfg *rest.Config) *rest.Config {
	cpy := rest.CopyConfig(cfg)
	cpy.AcceptContentTypes = "application/vnd.kubernetes.protobuf, application/json"
	cpy.ContentType = "application/json"
	return cpy
}

func NewContext(ctx context.Context, clientConfig clientcmd.ClientConfig, restConfig *rest.Config) (*Context, error) {
	sharedOpts := controllers.GetOptsFromEnv(controllers.Management)
	controllerFactory, err := controller.NewSharedControllerFactoryFromConfigWithOptions(enableProtobuf(restConfig), Scheme, sharedOpts)
	if err != nil {
		return nil, err
	}

	opts := &generic.FactoryOptions{
		SharedControllerFactory: controllerFactory,
	}

	steveControllers, err := server.NewController(restConfig, opts)
	if err != nil {
		return nil, err
	}

	cache := memory.NewMemCacheClient(steveControllers.K8s.Discovery())
	restMapper := restmapper.NewDeferredDiscoveryRESTMapper(cache)

	apply, err := apply.NewForConfig(restConfig)
	if err != nil {
		return nil, err
	}

	mgmt, err := management.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	ctlg, err := catalog.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	apps, err := apps.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	rbac, err := rbac.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	adminReg, err := admissionreg.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	project, err := project.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	capi, err := capi.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	rke, err := rke.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	fleet, err := fleet.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	provisioning, err := provisioning.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	helm, err := catalog.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	batch, err := batch.NewFactoryFromConfigWithOptions(restConfig, opts)
	if err != nil {
		return nil, err
	}

	asl := accesscontrol.NewAccessStore(ctx, true, steveControllers.RBAC)

	cg, err := client.NewFactory(restConfig, false)
	if err != nil {
		return nil, err
	}

	content := content.NewManager(
		steveControllers.K8s.Discovery(),
		steveControllers.Core.ConfigMap().Cache(),
		steveControllers.Core.Secret().Cache(),
		helm.Catalog().V1().ClusterRepo().Cache())

	helmop := helmop.NewOperations(cg,
		helm.Catalog().V1(),
		rbac.Rbac().V1(),
		content,
		steveControllers.Core.Pod())

	restClientGetter := &SimpleRESTClientGetter{
		ClientConfig:    clientConfig,
		RESTConfig:      restConfig,
		CachedDiscovery: cache,
		RESTMapper:      restMapper,
	}

	systemCharts, err := system.NewManager(ctx, restClientGetter, content, helmop, steveControllers.Core.Pod(),
		mgmt.Management().V3().Setting(), ctlg.Catalog().V1().ClusterRepo())
	if err != nil {
		return nil, err
	}

	tunnelAuth := &tunnelserver.Authorizers{}
	tunnelServer := remotedialer.New(tunnelAuth.Authorize, tunnelserver.ErrorWriter)
	peerManager, err := tunnelserver.NewPeerManager(ctx, steveControllers.Core.Endpoints(), tunnelServer)
	if err != nil {
		return nil, err
	}

	leadership := leader.NewManager("", "cattle-controllers", steveControllers.K8s)
	leadership.OnLeader(func(ctx context.Context) error {
		if peerManager != nil {
			peerManager.Leader()
		}
		return nil
	})

	return &Context{
		Controllers:             steveControllers,
		Apply:                   apply,
		SharedControllerFactory: controllerFactory,
		Dynamic:                 dynamic.New(steveControllers.K8s.Discovery()),
		CAPI:                    capi.Cluster().V1beta1(),
		RKE:                     rke.Rke().V1(),
		Mgmt:                    mgmt.Management().V3(),
		Apps:                    apps.Apps().V1(),
		Admission:               adminReg.Admissionregistration().V1(),
		Project:                 project.Project().V3(),
		Fleet:                   fleet.Fleet().V1alpha1(),
		Provisioning:            provisioning.Provisioning().V1(),
		Catalog:                 helm.Catalog().V1(),
		Batch:                   batch.Batch().V1(),
		ControllerFactory:       controllerFactory,
		ASL:                     asl,
		ClientConfig:            clientConfig,
		MultiClusterManager:     noopMCM{},
		CachedDiscovery:         cache,
		RESTMapper:              restMapper,
		leadership:              leadership,
		PeerManager:             peerManager,
		RESTClientGetter:        restClientGetter,
		CatalogContentManager:   content,
		HelmOperations:          helmop,
		SystemChartsManager:     systemCharts,
		TunnelAuthorizer:        tunnelAuth,
		TunnelServer:            tunnelServer,
	}, nil
}

type noopMCM struct {
}

func (n noopMCM) NormanSchemas() *types.Schemas {
	return nil
}

func (n noopMCM) ClusterDialer(clusterID string) func(ctx context.Context, network string, address string) (net.Conn, error) {
	return func(ctx context.Context, network string, address string) (net.Conn, error) {
		return nil, fmt.Errorf("no cluster manager")
	}
}

func (n noopMCM) Wait(ctx context.Context) {
}

func (n noopMCM) Start(ctx context.Context) error {
	return nil
}

func (n noopMCM) Middleware(next http.Handler) http.Handler {
	return next
}

func (n noopMCM) K8sClient(clusterName string) (kubernetes.Interface, error) {
	return nil, nil
}

type SimpleRESTClientGetter struct {
	ClientConfig    clientcmd.ClientConfig
	RESTConfig      *rest.Config
	CachedDiscovery discovery.CachedDiscoveryInterface
	RESTMapper      meta.RESTMapper
}

func (s *SimpleRESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig {
	return s.ClientConfig
}

func (s *SimpleRESTClientGetter) ToRESTConfig() (*rest.Config, error) {
	return s.RESTConfig, nil
}

func (s *SimpleRESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) {
	return s.CachedDiscovery, nil
}

func (s *SimpleRESTClientGetter) ToRESTMapper() (meta.RESTMapper, error) {
	return s.RESTMapper, nil
}


text:
require_relative '../test_helper'

require_relative '../../lib/six_hump_camel_back/vector'

describe 'SixHumpCamelBack::Vector' do
  describe 'when rand() returns 0.5' do
    let(:vector) { SixHumpCamelBack::Vector.new(1, 0) }
    let(:another_vector) { SixHumpCamelBack::Vector.new(0, 1) }

    describe 'members' do
      describe 'after initialize' do
        it 'lie midway between the constraints' do
          value(vector[0]).must_equal(1)
          value(vector[1]).must_equal(0)
        end
      end
    end

    describe '#cost' do
      let(:add_two) { ->(i, j) { i + j } }
      let(:cost) { vector.cost(add_two) }

      it 'is the value of the cost strategy solved with member values' do
        value(cost).must_equal(1.0)
      end
    end

    describe '#==' do
      it 'does not equal another vector with different members' do
        value(vector == SixHumpCamelBack::Vector.new(2, 0)).must_equal(false)
        value(vector != SixHumpCamelBack::Vector.new(2, 0)).must_equal(true)
      end

      it 'equals a vector with same members' do
        value(vector == SixHumpCamelBack::Vector.new(1, 0)).must_equal(true)
        value(vector != SixHumpCamelBack::Vector.new(1, 0)).must_equal(false)
      end

      it 'does not equal an array' do
        value(vector == [1, 0]).must_equal(false)
        value(vector != [1, 0]).must_equal(true)
      end
    end

    describe '#hash' do
      it 'equals another vector with same members' do
        value(vector.hash).must_equal(SixHumpCamelBack::Vector.new(1, 0).hash)
      end
    end

    describe '#-' do
      it 'is the difference of individual elements' do
        value(vector - another_vector).must_equal(SixHumpCamelBack::Vector.new(1, -1))
      end
    end

    describe '#+' do
      it 'is the sum of individual elements' do
        value(vector + another_vector).must_equal(SixHumpCamelBack::Vector.new(1, 1))
      end
    end

    describe '#scale_by' do
      it 'is the product of the members by the scalar number' do
        value(vector.scale_by(2)).must_equal(SixHumpCamelBack::Vector.new(2, 0))
      end
    end

    describe '#crossover_with' do
      let(:cycle) { [0.2, 0.8].cycle }
      let(:randomization) { -> { cycle.next } }

      it 'is composed of elements from itself and other vector selected by randomization' do
        value(vector.crossover_with(another_vector, randomization: randomization, factor: 0.5)).must_equal(SixHumpCamelBack::Vector.new(0, 0))
      end

      it 'is the original vector when crossover-factor is 0' do
        value(vector.crossover_with(another_vector, randomization: randomization, factor: 0)).must_equal(vector)
      end

      it 'is the partner vector when crossover-factor is 1' do
        value(vector.crossover_with(another_vector, randomization: randomization, factor: 1)).must_equal(another_vector)
      end
    end
  end
end


text:
import sys
import os.path
import numpy as np
import matplotlib.pyplot as plt

import sensor_types
from project import Project

sys.path.append("build")
try: import pymodel0
except: print("Error importing pymodel0"); sys.exit(-1)

def compute_residuals(project, solution_number):
    terrain = np.hstack((project.model.solutions[solution_number].terrain, np.zeros((len(project.model.solutions[0].terrain), 1))))

    # in model0 all points are visible in all cams
    image_pixels = pymodel0.model0_projection_array(project.model.internal, project.model.solutions[solution_number].cameras[0], terrain)
    # subtract to features
    pix = sensor_types.sensor_to_pixel(image_pixels, project.model.pixel_size, project.model.rows, project.model.cols)
    residuals = pix - project.features.edges[0].obs_a
    return residuals

def main():
    project_dir = sys.argv[1]
    model_filename = os.path.join(project_dir, "project.json")
    project = Project(model_filename)

    residuals = compute_residuals(project, 0)
    plt.plot(residuals[:,0], residuals[:,1], '.', color="k")

    residuals = compute_residuals(project, -1)
    plt.plot(residuals[:,0], residuals[:,1], '+', color="k")

    plt.show()

if __name__ == "__main__":
    main()


text:
@class SCCardAttribute;

@interface SCCard : NSObject

@property (strong, nonatomic) NSString *content;
@property (strong, nonatomic) SCCardAttribute *attribute;

- (NSInteger)match:(SCCard *)otherCard;

@end


text:
/**
 * @author Vladimir Kondratyev
 */
package com.intellij.openapi.wm.ex;

import javax.annotation.Nonnull;

@Deprecated
public abstract class ToolWindowManagerAdapter implements ToolWindowManagerListener{
  @Override
  public void toolWindowRegistered(@Nonnull final String id){}

  @Override
  public void stateChanged(){}
}


text:
<% module_namespacing do -%>
class <%= class_name %>Presenter < <%= @base_presenter %>
end
<% end -%>


text:
const { app, dialog } = require('electron')
const { writeFile } = require('fs')
const exportedStyles = require('./exported-styles');

const exportFile = (content, callback = () => {}) => {
  if (!content) throw new ReferenceError('The content is required.')

  let fileName = dialog.showSaveDialog({
    defaultPath: app.getPath('documents'),
    filters: [
      { name: 'Markdown', extensions: ['html'] },
      { name: 'All Files', extensions: ['*'] }
    ],
    showsTagField: false
  })

  if (!fileName) return

  if (
    !(fileName.lastIndexOf('.html') !== -1 &&
      fileName.length - 3 === fileName.lastIndexOf('.html'))
  ) {
    fileName = fileName + '.html'
  }

  const finalContent = `
    <html>
      <style>${exportedStyles}</style>
      <body>
        ${content}
      </body>
    </html>
  `

  writeFile(fileName, finalContent, { encoding: 'utf8' }, error => {
    if (error) return dialog.showErrorBox(error.message, error.stack)
    callback(fileName)
  })
}

module.exports = exportFile


text:
export
    SceneStructureOverlay,
    SubSceneExtractParamsOverlay,
    StructureFollowCamera

function AutoViz.render!(rendermodel::RenderModel, structure::SceneStructure, scene::Scene;
    line_width = 0.25, # m
    circle_radius = 0.5, # m
    color_line::Colorant = AutoViz.COLOR_ASPHALT,
    factor_colors::Tuple{Colorant,Colorant,Colorant} =
        (RGBA(0x52/0xFF,0xE3/0xFF,0xF6/0xFF),
         RGBA(0xA7/0xFF,0xEC/0xFF,0x21/0xFF),
         RGBA(0xFF/0xFF,0x00/0xFF,0x7F/0xFF))
    )

    # render all links first
    for fa in structure.factor_assignments
        if length(fa.vehicle_indeces) == 2
            # draw a line between the vehicle centers

            pos1 = get_center(scene.vehicles[fa.vehicle_indeces[1]])
            pos2 = get_center(scene.vehicles[fa.vehicle_indeces[2]])

            add_instruction!(rendermodel, render_line_segment, (pos1.x, pos1.y, pos2.x, pos2.y, color_line, line_width))
        end
    end

    for fa in structure.factor_assignments
        if length(fa.vehicle_indeces) == 1
            # draw a line from the vehicle center to the bottom right

            veh = scene.vehicles[fa.vehicle_indeces[1]]
            pos = get_center(veh)
            color = factor_colors[fa.form]

            add_instruction!(rendermodel, render_circle, (pos.x, pos.y, circle_radius, color))
        elseif length(fa.vehicle_indeces) == 2
            # draw a line between the vehicle centers

            pos1 = get_center(scene.vehicles[fa.vehicle_indeces[1]])
            pos2 = get_center(scene.vehicles[fa.vehicle_indeces[2]])
            center = lerp(pos1, pos2, 0.5)
            color = factor_colors[fa.form]

            add_instruction!(rendermodel, render_circle, (center.x, center.y, circle_radius, color))
        else
            error("not implemented")
        end
    end

    rendermodel
end

type SceneStructureOverlay <: SceneOverlay
    structure::Union{Void,SceneStructure}
end
function AutoViz.render!(rendermodel::RenderModel, overlay::SceneStructureOverlay, scene::Scene, roadway::Roadway)
    if isa(overlay.structure, SceneStructure)
        structure = overlay.structure
    else
        structure = gen_scene_structure(scene, roadway, create_shared_factors())
    end

    render!(rendermodel, structure, scene)
end

type SubSceneExtractParamsOverlay <: SceneOverlay
    scene_extract::SubSceneExtractParams
    color::Colorant
    line_width::Float64

    function SubSceneExtractParamsOverlay(
        scene_extract::SubSceneExtractParams;
        color::Colorant=colorant"red",
        line_width::Float64=1.0,
        )

        new(scene_extract, color, line_width)
    end
end
function AutoViz.render!(rendermodel::RenderModel, poly::ConvexPolygon, color::Colorant, line_width::Real)

    pts = Array(Float64, 2, length(poly))
    for (i,p) in enumerate(poly)
        pts[1,i] = p.x
        pts[2,i] = p.y
    end

    add_instruction!(rendermodel, render_closed_line, (pts, color, line_width))

    rendermodel
end
AutoViz.render!(rendermodel::RenderModel, overlay::SubSceneExtractParamsOverlay, scene::Scene, roadway::Roadway) = render!(rendermodel, overlay.scene_extract.box, overlay.color, overlay.line_width)

type StructureFollowCamera <: Camera
    structure::SceneStructure
    zoom::Float64 # [pix/meter]
    StructureFollowCamera(structure::SceneStructure, zoom::Float64=3.0) = new(structure, zoom)
end
function AutoViz.camera_set!(rendermodel::RenderModel, cam::StructureFollowCamera, scene::Scene, roadway::Roadway, canvas_width::Int, canvas_height::Int)

    if length(cam.structure.active_vehicles) > 0

        # get camera center
        C = VecE2(0.0,0.0)
        for vehicle_index in cam.structure.active_vehicles
            veh = scene[vehicle_index]
            C += convert(VecE2, veh.state.posG)
        end
        C = C / length(cam.structure.active_vehicles)

        camera_set_pos!(rendermodel, C)
        camera_setzoom!(rendermodel, cam.zoom)
    else
        add_instruction!( rendermodel, render_text, ("StructureFollowCamera did not find any vehicles", 10, 15, 15, colorant"white"), incameraframe=false)
        camera_fit_to_content!(rendermodel, canvas_width, canvas_height, 0.1)
    end

    rendermodel
end


text:
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml;
using System.Xml.Serialization;

namespace MusicXMLUtils.Structure
{
    [GeneratedCode("xsd", "4.0.30319.18020")]
    [Serializable]
    [DebuggerStepThrough]
    [DesignerCategory("code")]
    [XmlType("fret")]
    public class Fret
    {
        #region -- Public Properties --
        [XmlAttribute("font-family", DataType = "token")]
        public string FontFamily { get; set; }

        [XmlAttribute("font-style")]
        public FontStyle FontStyle { get; set; }

        [XmlIgnore]
        public bool FontStyleSpecified { get; set; }

        [XmlAttribute("font-size")]
        public string FontSize { get; set; }

        [XmlAttribute("font-weight")]
        public FontWeight FontWeight { get; set; }

        [XmlIgnore]
        public bool FontWeightSpecified { get; set; }

        [XmlAttribute("color", DataType = "token")]
        public string Color { get; set; }

        [XmlText(DataType = "nonNegativeInteger")]
        public string Value { get; set; }
        #endregion
    }
}


text:
<?php

namespace Victoire\Bundle\WidgetMapBundle\Warmer;

use Doctrine\ORM\EntityManager;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Victoire\Bundle\BusinessPageBundle\Entity\BusinessTemplate;
use Victoire\Bundle\CoreBundle\Entity\Link;
use Victoire\Bundle\CoreBundle\Entity\View;
use Victoire\Bundle\CriteriaBundle\Entity\Criteria;
use Victoire\Bundle\PageBundle\Entity\Page;
use Victoire\Bundle\ViewReferenceBundle\Connector\ViewReferenceRepository;
use Victoire\Bundle\ViewReferenceBundle\ViewReference\ViewReference;
use Victoire\Bundle\WidgetBundle\Entity\Traits\LinkTrait;
use Victoire\Bundle\WidgetBundle\Entity\Widget;
use Victoire\Bundle\WidgetBundle\Helper\WidgetHelper;
use Victoire\Bundle\WidgetBundle\Repository\WidgetRepository;
use Victoire\Bundle\WidgetMapBundle\Entity\WidgetMap;

/**
 * WidgetDataWarmer.
 *
 * This class prepare all widgets with their associated entities for the current View
 * to reduce queries during page rendering.
 * Only OneToMany and ManyToOne associations are handled because no OneToOne or ManyToMany
 * associations have been used in Widgets.
 *
 * Ref: victoire_widget_map.widget_data_warmer
 */
class WidgetDataWarmer
{
    /* @var $em EntityManager */
    protected $em;
    protected $viewReferenceRepository;
    protected $widgetHelper;
    protected $accessor;

    /**
     * Constructor.
     *
     * @param ViewReferenceRepository $viewReferenceRepository
     * @param WidgetHelper            $widgetHelper
     */
    public function __construct(
        ViewReferenceRepository $viewReferenceRepository,
        WidgetHelper $widgetHelper
    ) {
        $this->viewReferenceRepository = $viewReferenceRepository;
        $this->widgetHelper = $widgetHelper;
        $this->accessor = PropertyAccess::createPropertyAccessor();
    }

    /**
     * Find all Widgets for current View, inject them in WidgetMap and warm associated entities.
     *
     * @param EntityManager $em
     * @param View          $view
     */
    public function warm(EntityManager $em, View $view)
    {
        $this->em = $em;

        /* @var WidgetRepository $widgetRepo */
        $widgetRepo = $this->em->getRepository('Victoire\Bundle\WidgetBundle\Entity\Widget');
        $viewWidgets = $widgetRepo->findAllWidgetsForView($view);

        $this->injectWidgets($view, $viewWidgets);

        $this->extractAssociatedEntities($viewWidgets);
    }

    /**
     * Inject Widgets in View's builtWidgetMap.
     *
     * @param View $view
     * @param $viewWidgets
     */
    private function injectWidgets(View $view, $viewWidgets)
    {
        $builtWidgetMap = $view->getBuiltWidgetMap();

        foreach ($builtWidgetMap as $slot => $widgetMaps) {
            foreach ($widgetMaps as $i => $widgetMap) {
                foreach ($viewWidgets as $widget) {
                    if ($widget->getWidgetMap() == $widgetMap) {
                        $builtWidgetMap[$slot][$i]->addWidget($widget);

                        //Override Collection default behaviour to avoid useless query
                        $builtWidgetMap[$slot][$i]->getWidgets()->setDirty(false);
                        $builtWidgetMap[$slot][$i]->getWidgets()->setInitialized(true);
                        continue;
                    }
                }
            }
        }

        $view->setBuiltWidgetMap($builtWidgetMap);
    }

    /**
     * Pass through all widgets and associated entities to extract all missing associations,
     * store it by repository to group queries by entity type.
     *
     * @param Widget[] $entities Widgets and associated entities
     */
    private function extractAssociatedEntities(array $entities)
    {
        $linkIds = $associatedEntities = [];

        foreach ($entities as $entity) {
            $reflect = new \ReflectionClass($entity);

            //If Widget is already in cache, extract only its Criterias (used outside Widget rendering)
            $widgetCached = ($entity instanceof Widget && $this->widgetHelper->isCacheEnabled($entity));

            //If Widget has LinkTrait, store the entity link id
            if (!$widgetCached && $this->hasLinkTrait($reflect) && $entity->getLink()) {
                $linkIds[] = $entity->getLink()->getId();
            }

            //Pass through all entity associations
            $metaData = $this->em->getClassMetadata(get_class($entity));
            foreach ($metaData->getAssociationMappings() as $association) {
                $targetClass = $association['targetEntity'];

                //Skip already set WidgetMap association
                if ($targetClass == WidgetMap::class) {
                    continue;
                }

                //If Widget has OneToOne or ManyToOne association, store target entity id to construct
                //a single query for this entity type
                if ($metaData->isSingleValuedAssociation($association['fieldName'])
                    && !$widgetCached
                ) {
                    //If target Entity is not null, treat it
                    if ($targetEntity = $this->accessor->getValue($entity, $association['fieldName'])) {
                        $associatedEntities[$targetClass]['id']['unsorted']['entitiesToWarm'][] = new AssociatedEntityToWarm(
                            AssociatedEntityToWarm::TYPE_MANY_TO_ONE,
                            $entity,
                            $association['fieldName'],
                            $targetEntity->getId()
                        );
                    }
                }

                //If Widget has OneToMany association, store owner entity id and mappedBy value
                //to construct a single query for this entity type
                elseif ($metaData->isCollectionValuedAssociation($association['fieldName'])) {

                    //Even if Widget is cached, we need its Criterias used before cache call
                    if (!$widgetCached || $targetClass === Criteria::class) {

                        //If Collection is not null, treat it
                        if ($this->accessor->getValue($entity, $association['fieldName'])) {

                            //Don't use Collection getter directly and override Collection
                            //default behaviour to avoid useless query
                            $getter = 'get'.ucwords($association['fieldName']);
                            $entity->$getter()->setDirty(false);
                            $entity->$getter()->setInitialized(true);
                            $orderByToken = 'unsorted';

                            if (isset($association['orderBy'])) {
                                $orderByToken = implode($association['orderBy']);
                                $associatedEntities[$targetClass][$association['mappedBy']][$orderByToken]['orderBy'] = $association['orderBy'];
                            }

                            $associatedEntities[$targetClass][$association['mappedBy']][$orderByToken]['entitiesToWarm'][] = new AssociatedEntityToWarm(
                                AssociatedEntityToWarm::TYPE_ONE_TO_MANY,
                                $entity,
                                $association['fieldName'],
                                $entity->getId()
                            );
                        }
                    }
                }
            }
        }

        $newEntities = $this->setAssociatedEntities($associatedEntities);
        $this->setPagesForLinks($linkIds);

        //Recursive call if previous has return new entities to warm
        if ($newEntities) {
            $this->extractAssociatedEntities($newEntities);
        }
    }

    /**
     * Set all missing associated entities.
     *
     * @param array $repositories
     *
     * @throws \Throwable
     * @throws \TypeError
     *
     * @return array
     */
    private function setAssociatedEntities(array $repositories)
    {
        $newEntities = [];

        foreach ($repositories as $repositoryName => $findMethods) {
            foreach ($findMethods as $findMethod => $groupedBySortAssociatedEntitiesToWarm) {
                foreach ($groupedBySortAssociatedEntitiesToWarm as $orderByToken => $groupedAssociatedEntitiesToWarm) {
                    $associatedEntitiesToWarm = $groupedAssociatedEntitiesToWarm['entitiesToWarm'];

                    //Extract ids to search
                    $idsToSearch = array_map(function ($associatedEntityToWarm) {
                        return $associatedEntityToWarm->getEntityId();
                    }, $associatedEntitiesToWarm);

                    $orderBy = [];
                    if ($orderByToken !== 'unsorted') {
                        foreach ($groupedAssociatedEntitiesToWarm['orderBy'] as $orderAttribut => $order) {
                            $orderBy[$orderAttribut] = $order;
                        }
                    }

                    //Find by id for ManyToOne associations based on target entity id
                    //Find by mappedBy value for OneToMany associations based on owner entity id
                    $foundEntities = $this->em->getRepository($repositoryName)->findBy([
                        $findMethod => array_values($idsToSearch),
                    ], $orderBy);

                    /* @var AssociatedEntityToWarm[] $associatedEntitiesToWarm */
                    foreach ($associatedEntitiesToWarm as $associatedEntityToWarm) {
                        foreach ($foundEntities as $foundEntity) {
                            if ($associatedEntityToWarm->getType() === AssociatedEntityToWarm::TYPE_MANY_TO_ONE
                                && $foundEntity->getId() === $associatedEntityToWarm->getEntityId()
                            ) {
                                $inheritorEntity = $associatedEntityToWarm->getInheritorEntity();
                                $inheritorPropertyName = $associatedEntityToWarm->getInheritorPropertyName();
                                $this->accessor->setValue($inheritorEntity, $inheritorPropertyName, $foundEntity);
                                continue;
                            } elseif ($associatedEntityToWarm->getType() === AssociatedEntityToWarm::TYPE_ONE_TO_MANY
                                && $this->accessor->getValue($foundEntity, $findMethod) === $associatedEntityToWarm->getInheritorEntity()
                            ) {
                                $inheritorEntity = $associatedEntityToWarm->getInheritorEntity();
                                $inheritorPropertyName = $associatedEntityToWarm->getInheritorPropertyName();

                                //Don't use Collection getter directly and override Collection
                                //default behaviour to avoid useless query
                                $getter = 'get'.ucwords($inheritorPropertyName);
                                $inheritorEntity->$getter()->add($foundEntity);
                                $inheritorEntity->$getter()->setDirty(false);
                                $inheritorEntity->$getter()->setInitialized(true);

                                //Store new entities to warm if necessary
                                $newEntities[] = $foundEntity;
                                continue;
                            }
                        }
                    }
                }
            }
        }

        return $newEntities;
    }

    /**
     * Set viewReferencePage for each link.
     *
     * @param array $linkIds
     */
    private function setPagesForLinks(array $linkIds)
    {
        $viewReferences = [];

        /* @var Link[] $links */
        $links = $this->em->getRepository('VictoireCoreBundle:Link')->findById($linkIds);

        foreach ($links as $link) {
            if ($link->getParameters()['linkType'] == 'viewReference') {
                $viewReference = $this->viewReferenceRepository->getOneReferenceByParameters([
                    'id'     => $link->getParameters()['viewReference'],
                    'locale' => $link->getParameters()['locale'],
                ]);

                if ($viewReference instanceof ViewReference) {
                    $viewReferences[$link->getId()] = $viewReference;
                }
            }
        }

        /* @var Page[] $pages */
        $pages = $this->em->getRepository('VictoireCoreBundle:View')->findByViewReferences($viewReferences);

        foreach ($links as $link) {
            foreach ($pages as $page) {
                if (!($page instanceof BusinessTemplate) && $page->getReference() && $link->getViewReference() == $page->getReference()->getId()) {
                    $link->setViewReferencePage($page);
                }
            }
        }
    }

    /**
     * Check if reflection class has LinkTrait.
     *
     * @param \ReflectionClass $reflect
     *
     * @return bool
     */
    private function hasLinkTrait(\ReflectionClass $reflect)
    {
        $traits = $reflect->getTraits();
        foreach ($traits as $trait) {
            if ($trait->getName() == LinkTrait::class) {
                return true;
            }
        }

        if ($parentClass = $reflect->getParentClass()) {
            if ($this->hasLinkTrait($parentClass)) {
                return true;
            }
        }

        return false;
    }
}


text:
<!doctype html>

  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
  <title>google-url-shortener Demo</title>

  <link rel="import" href="../google-url-shortener.html">

A `google-url-shortener` allows you to build this:

  <template is="dom-bind">
    <google-url-shortener id="shortener"
      long-url="{{longUrl}}"
      short-url="{{shortUrl}}"
      error="{{urlError}}"
      auto>
    </google-url-shortener>
    <form on-submit="shorten">

        <input type="url" id="longUrl"
          placeholder="Input URL here:"
          value="http://www.google.com/"
          size="50">
        <input type="submit" value="submit">

        Short URL:
        {{shortUrl}}

Error: {{urlError}}

    </form>
  </template>


text:
require 'net/http'

class RepositoryStreamWorker
  include Sidekiq::Worker

  def perform(time:)
    stream = Models::Stream.new(time: time)
    stream.parse
    stream.each do |repo_name|
      login = repo_name.split("/")[0]
      user = User.where(login: login.downcase).first
      if user.nil?
        Rails.logger.info("Creating user #{login}")
        UserUpdateWorker.perform_in(job_delay, login, true)
      else
        repo = repo_name.split("/")[1]
        Rails.logger.info("Updating repo #{repo}")
        RepositoryUpdateWorker.perform_in(job_delay, user.id, repo)
      end
    end
  end

  def job_delay
    rand(0..60*60).seconds
  end
end


text:
namespace Api {

  const prefix = "http://localhost:3000/";

  // Makes a JSON HTTP requests, returns a jqXHR promise
  function request({ method, path, data }: {
    method: string;
    path: string;
    data?: any
  }) {
    var request = {
      url: prefix + path,
      type: method,
      data: data ? JSON.stringify(data) : "",
      contentType: "application/json; charset=UTF-8",
      dataType: "json" // type of the data expected from the server
    };
    return $.ajax(request);
  }

  function get(path: string) {
    return request({ method: "GET", path: path });
  }

  ///////

  export interface Time {
    time: number; // Unix Timestamp
  }

  // Current Unix timestamp on server
  export function getNow(): JQueryPromise<Time> {
    return get("now");
  }
}