What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-28 19:20:07
pytorch check if using gpu
In [1]: import torch In [2]: torch.cuda.current_device() Out[2]: 0 In [3]: torch.cuda.device(0) Out[3]: <torch.cuda.device at 0x7efce0b03be0> In [4]: torch.cuda.device_count() Out[4]: 1 In [5]: torch.cuda.get_device_name(0) Out[5]: 'GeForce GTX ... Add solution -
Other 2022-02-28 19:05:02
handle s3 exceptions boto3
import boto3 from botocore.exceptions import ClientError try: iam = boto3.client('iam') user = iam.create_user(UserName='fred') print("Created user: %s" % user) except ClientError as e: if e.response['Error']['Code'] == 'EntityA... Add solution -
Other 2022-02-28 18:55:05
django forms views.py
from django.http import HttpResponseRedirect from django.shortcuts import render from .forms import NameForm def get_name(request): # if this is a POST request we need to process the form data if request.method == 'POST': # create a form... Add solution -
Other 2022-02-27 11:15:02
system testing
SYSTEM TESTING is a level of software testing where a complete and integrated software is tested. The purpose of this test is to evaluate the system's compliance with the specified requirements. ISTQB Definition. system testing: The process of testing an ... Add solution
Best helpers
Ranking is empty