text:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.sync.internal_api.pub;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.HashSet;
import java.util.Set;

/**
 * This enum describes the type of passphrase required, if any, to decrypt synced data.
 *
 * It implements the Android {@link Parcelable} interface so it is easy to pass around in intents.
 *
 * It maps the native enum syncer::PassphraseType, but has the additional values INVALID and NONE.
 */
public enum SyncDecryptionPassphraseType implements Parcelable {
    INVALID(-2),                   // Used as default value and is not a valid decryption type.
    NONE(-1),                      // No encryption (deprecated).
    IMPLICIT_PASSPHRASE(0),        // GAIA-based passphrase (deprecated).
    KEYSTORE_PASSPHRASE(1),        // Keystore passphrase.
    FROZEN_IMPLICIT_PASSPHRASE(2), // Frozen GAIA passphrase.
    CUSTOM_PASSPHRASE(3);          // User-provided passphrase.

    public static Parcelable.Creator CREATOR =
            new Parcelable.Creator<SyncDecryptionPassphraseType>() {
                @Override
                public SyncDecryptionPassphraseType createFromParcel(Parcel parcel) {
                    return fromInternalValue(parcel.readInt());
                }

                @Override
                public SyncDecryptionPassphraseType[] newArray(int size) {
                    return new SyncDecryptionPassphraseType[size];
                }
            };

    public static SyncDecryptionPassphraseType fromInternalValue(int value) {
        for (SyncDecryptionPassphraseType type : values()) {
            if (type.internalValue() == value) {
                return type;
            }
        }
        // Falling back to INVALID. Should not happen if |value| was retrieved from native.
        return INVALID;
    }

    private final int mNativeValue;

    private SyncDecryptionPassphraseType(int nativeValue) {
        mNativeValue = nativeValue;
    }

    public Set<SyncDecryptionPassphraseType> getVisibleTypes() {
        Set<SyncDecryptionPassphraseType> visibleTypes = new HashSet<>();
        switch (this) {
            case NONE:  // Intentional fall through.
            case IMPLICIT_PASSPHRASE:  // Intentional fall through.
            case KEYSTORE_PASSPHRASE:
                visibleTypes.add(this);
                visibleTypes.add(CUSTOM_PASSPHRASE);
                break;
            case FROZEN_IMPLICIT_PASSPHRASE:
                visibleTypes.add(KEYSTORE_PASSPHRASE);
                visibleTypes.add(FROZEN_IMPLICIT_PASSPHRASE);
                break;
            case CUSTOM_PASSPHRASE:
                visibleTypes.add(KEYSTORE_PASSPHRASE);
                visibleTypes.add(CUSTOM_PASSPHRASE);
                break;
            case INVALID:  // Intentional fall through.
            default:
                visibleTypes.add(this);
                break;
        }
        return visibleTypes;
    }

    /**
     * Get the types that are allowed to be enabled from the current type.
     *
     * @param encryptEverythingAllowed Whether encrypting all data is allowed.
     */
    public Set<SyncDecryptionPassphraseType> getAllowedTypes(boolean encryptEverythingAllowed) {
        Set<SyncDecryptionPassphraseType> allowedTypes = new HashSet<>();
        switch (this) {
            case NONE:  // Intentional fall through.
            case IMPLICIT_PASSPHRASE:  // Intentional fall through.
            case KEYSTORE_PASSPHRASE:
                allowedTypes.add(this);
                if (encryptEverythingAllowed) {
                    allowedTypes.add(CUSTOM_PASSPHRASE);
                }
                break;
            case FROZEN_IMPLICIT_PASSPHRASE:  // Intentional fall through.
            case CUSTOM_PASSPHRASE:  // Intentional fall through.
            case INVALID:  // Intentional fall through.
            default:
                break;
        }
        return allowedTypes;
    }

    /**
     * TODO(maxbogue): Remove when no longer used in Clank; see http://crbug.com/424187.
     */
    @Deprecated
    public Set<SyncDecryptionPassphraseType> getAllowedTypes() {
        return getAllowedTypes(true);
    }

    public int internalValue() {
        // Since the values in this enums are constant and very small, this cast is safe.
        return mNativeValue;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mNativeValue);
    }
}


text:
'use strict';

import React from 'react-native';
let { View, StyleSheet, Text} = React;

export class Separator extends React.Component{
  render(){
     return(<View style={[formStyles.separatorContainer, this.props.containerStyle]}>
       {
         (this.props.label)?
         <Text style={formStyles.separator}>{this.props.label.toUpperCase()}</Text>
       : null
     }
       </View>
    )
  }
}

  let formStyles = StyleSheet.create({
    form:{

    },
    alignRight:{
       marginTop: 7, position:'absolute', right: 10
    },
    separatorContainer:{
      // borderTopColor: '#C8C7CC',
      // borderTopWidth: 1,
      paddingTop: 35,
      borderBottomColor: '#C8C7CC',
      borderBottomWidth: 1,

    },
    separator:{

      paddingLeft: 10,
      paddingRight: 10,
      color: '#6D6D72',
      paddingBottom: 7

    },
    fieldContainer:{
      borderBottomWidth: 1,
      borderBottomColor: '#C8C7CC',
      backgroundColor: 'white',
      justifyContent: 'center',
      height: 45
    },
  });

redpajama_set_name: RedPajamaGithub


text:
package api.basepackage;

import leap.core.security.annotation.AllowAnonymous;
import leap.web.annotation.Path;
import leap.web.annotation.http.GET;
import leap.web.api.mvc.ApiResponse;
import leap.web.api.mvc.ModelController;

@Path("/base_package")
public class BasePackageController extends ModelController<BasePackageModel> {
    @Path("/{id}")
    @GET
    @AllowAnonymous
    public ApiResponse<BasePackageModel> getById(String id){
        return get(id);
    }

}


text:
class FixGenreJoinTables < ActiveRecord::Migration[5.0]
  def change
    rename_table :games_genre, :games_genres
  end
end


text:
import 'mocha';

import { expect, givenFollowingEvents } from '@integration/testing-tools';
import { AssertionError, ImplementationPendingError, LogicError } from '@serenity-js/core';
import { SceneFinished, SceneStarts, TaskFinished, TaskStarts, TestRunFinished } from '@serenity-js/core/lib/events';
import { FileSystemLocation, Path } from '@serenity-js/core/lib/io';
import {
    ActivityDetails,
    Category,
    CorrelationId,
    ExecutionCompromised,
    ExecutionFailedWithAssertionError,
    ExecutionFailedWithError,
    ExecutionIgnored,
    ExecutionSkipped,
    ExecutionSuccessful,
    ImplementationPending,
    Name,
    Outcome,
    ScenarioDetails,
} from '@serenity-js/core/lib/model';
import { Photographer, TakePhotosOfFailures } from '@serenity-js/web';
import { given } from 'mocha-testdata';

import { create } from './create';

describe('Photographer', () => {

    const
        defaultCardScenario = new ScenarioDetails(
            new Name('Paying with a default card'),
            new Category('Online Checkout'),
            new FileSystemLocation(
                new Path(`payments/checkout.feature`),
            ),
        ),
        pickACard = new ActivityDetails(new Name('Pick the default credit card')),
        sceneId = new CorrelationId('a-scene-id'),
        activityId = new CorrelationId('activity-id');

    it('complains when sent DomainEvents before getting assigned to a Stage', () => {
        const photographer = new Photographer(new TakePhotosOfFailures());
        expect(() => photographer.notifyOf(new SceneStarts(sceneId, defaultCardScenario)))
            .to.throw(LogicError, `Photographer needs to be assigned to the Stage before it can be notified of any DomainEvents`);
    });

    describe(`when there's no actor in the spotlight`, () => {

        given(
            new ExecutionSkipped(),
            new ExecutionSuccessful(),
        ).
        it('doesn\'t take a picture if everything goes well', (outcome: Outcome) => {
            const { stage, recorder } = create();

            const photographer = new Photographer(new TakePhotosOfFailures(), stage);
            stage.assign(photographer);

            givenFollowingEvents(
                new SceneStarts(sceneId, defaultCardScenario),
                new TaskStarts(sceneId, activityId, pickACard),
                new TaskFinished(sceneId, activityId, pickACard, outcome),
                new SceneFinished(sceneId, defaultCardScenario, outcome),
                new TestRunFinished(),
            ).areSentTo(photographer);

            return stage.waitForNextCue().then(() => {
                expect(recorder.events).to.have.lengthOf(0);
            });
        });

        given(
            { description: 'compromised',               outcome: new ExecutionCompromised(new Error('Database is down'))                                                },
            { description: 'error',                     outcome: new ExecutionFailedWithError(new TypeError('Wrong type'))                                                          },
            { description: 'assertion error',           outcome: new ExecutionFailedWithAssertionError(new AssertionError(`expected false to equal true`, false, true)) },
            { description: 'implementation pending',    outcome: new ImplementationPending(new ImplementationPendingError('method missing'))                            },
            { description: 'ignored',                   outcome: new ExecutionIgnored(new Error('Failed, retrying'))                                                    },
        ).
        it('does nothing, even when a problem occurs', ({ outcome }) => {
            const { stage, recorder } = create();

            const photographer = new Photographer(new TakePhotosOfFailures(), stage);
            stage.assign(photographer);

            givenFollowingEvents(
                new SceneStarts(sceneId, defaultCardScenario),
                new SceneFinished(sceneId, defaultCardScenario, outcome),
                new TestRunFinished(),
            ).areSentTo(photographer);

            return stage.waitForNextCue().then(() => {
                expect(recorder.events).to.have.lengthOf(0);
            });
        });
    });
});


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self testSave];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)testSave
{
    NSError *error;
    [SSKeychain setPassword:@"123" forService:@"com.bob.example" account:@"bob" error:&error];
    if (!error) {
        NSLog(@"success");
    }else{
        NSLog(@"%@",error);
    }

}

@end