Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for isoformat (0.2 sec)

  1. fastapi/encoders.py

        else:
            return float(dec_value)
    
    
    ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
        bytes: lambda o: o.decode(),
        Color: str,
        datetime.date: isoformat,
        datetime.datetime: isoformat,
        datetime.time: isoformat,
        datetime.timedelta: lambda td: td.total_seconds(),
        Decimal: decimal_encoder,
        Enum: lambda o: o.value,
        frozenset: list,
        deque: list,
        GeneratorType: list,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

        instance = MyModel(dt_field=safe_datetime.now())
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={safe_datetime: lambda o: o.isoformat()}
        )
        assert encoded_instance["dt_field"] == instance.dt_field.isoformat()
    
    
    def test_custom_enum_encoders():
        def custom_enum_encoder(v: Enum):
            return v.value.lower()
    
        class MyEnum(Enum):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  3. istioctl/pkg/tag/tag_test.go

    	}
    
    	for _, tc := range tcs {
    		t.Run(tc.name, func(t *testing.T) {
    			var out bytes.Buffer
    			client := fake.NewSimpleClientset(tc.webhooks.DeepCopyObject(), tc.namespaces.DeepCopyObject())
    			outputFormat = util.JSONFormat
    			err := listTags(context.Background(), client, &out)
    			if tc.error == "" && err != nil {
    				t.Fatalf("expected no error, got %v", err)
    			}
    			if tc.error != "" {
    				if err == nil {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Nov 17 22:41:06 GMT 2023
    - 8.7K bytes
    - Viewed (0)
  4. cmd/iam-store.go

    	maxServiceAccountExpiry time.Duration = 365 * 24 * time.Hour
    )
    
    var errInvalidSvcAcctExpiration = errors.New("invalid service account expiration")
    
    type iamFormat struct {
    	Version int `json:"version"`
    }
    
    func newIAMFormatVersion1() iamFormat {
    	return iamFormat{Version: iamFormatVersion1}
    }
    
    func getIAMFormatFilePath() string {
    	return iamConfigPrefix + SlashSeparator + iamFormatFile
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Apr 27 10:04:10 GMT 2024
    - 75.2K bytes
    - Viewed (2)
  5. istioctl/pkg/analyze/analyze.go

    }
    
    // TODO: Refactor output writer so that it is smart enough to know when to output what.
    func isJSONorYAMLOutputFormat() bool {
    	return msgOutputFormat == formatting.JSONFormat || msgOutputFormat == formatting.YAMLFormat
    }
    
    type Client struct {
    	client kube.Client
    	remote bool
    }
    
    func getClients(ctx cli.Context) ([]*Client, error) {
    	client, err := ctx.CLIClient()
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 17K bytes
    - Viewed (0)
  6. istioctl/pkg/tag/tag.go

    		if r := cmp.Compare(a.Revision, b.Revision); r != 0 {
    			return r
    		}
    		return cmp.Compare(a.Tag, b.Tag)
    	})
    
    	switch outputFormat {
    	case util.JSONFormat:
    		return PrintJSON(writer, tags)
    	case util.TableFormat:
    	default:
    		return fmt.Errorf("unknown format: %s", outputFormat)
    	}
    	w := new(tabwriter.Writer).Init(writer, 0, 8, 1, ' ', 0)
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 16.3K bytes
    - Viewed (0)
Back to top