Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/d/j/django-rest-framework-mongoengine-HEAD/rest_framework_mongoengine/SampleApp/views.py   django-rest-framework-mongoengine(Download)
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
 
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
 
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
 
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
 

src/z/a/zamboni-HEAD/mkt/developers/api_payments.py   zamboni(Download)
            serializer = self.get_serializer(obj)
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(form.errors, status=status.HTTP_400_BAD_REQUEST)
 
    def partial_update(self, request, *args, **kwargs):
            return Response(status=status.HTTP_204_NO_CONTENT)
 
        return Response(form.errors, status=status.HTTP_400_BAD_REQUEST)
 
    def destroy(self, request, *args, **kwargs):

src/a/t/atmosphere-HEAD/api/project.py   atmosphere(Download)
        if not project:
            return Response("Project with ID=%s does not exist" % project_id,
                            status=status.HTTP_400_BAD_REQUEST)
        project = project[0]
        application = user.application_set.filter(uuid=application_uuid)
        if not application:
            return Response("application with ID=%s not found in the database"
                            % (application_uuid,),
                            status=status.HTTP_400_BAD_REQUEST)
        if not project:
            return Response("Project with ID=%s does not exist" % project_id,
                            status=status.HTTP_400_BAD_REQUEST)
        project = project[0]
        application = project.applications.filter(provider_alias=application_uuid)
        if not application:
            error_str = "application with ID=%s does not exist in Project %s"\
                        % (application_uuid, project.id),
            return Response(error_str, status=status.HTTP_400_BAD_REQUEST)
        if not project:
            return Response("Project with ID=%s does not exist" % project_id,
                            status=status.HTTP_400_BAD_REQUEST)
        project = project[0]
        instance = user.instance_set.filter(provider_alias=instance_id)

src/a/t/atmosphere-HEAD/api/instance.py   atmosphere(Download)
        else:
            return Response(serializer.errors,
                            status=status.HTTP_400_BAD_REQUEST)
 
 
        except Exception as e:
            return failure_response(
                status.HTTP_400_BAD_REQUEST,
                'Bad query string caused filter validation errors : %s'
                % (e,))
        if not action_params.get('action', None):
            return failure_response(
                status.HTTP_400_BAD_REQUEST,
                'POST request to /action require a BODY with \'action\'.')
        result_obj = None
        if not esh_instance:
            return failure_response(
                status.HTTP_400_BAD_REQUEST,
                'Instance %s no longer exists' % (instance_id,))
        action = action_params['action']
                        #Return reason for failed detachment
                        return failure_response(
                            status.HTTP_400_BAD_REQUEST,
                            error_msg)
                #Task complete, convert the volume and return the object

src/m/o/movide-HEAD/api/views.py   movide(Download)
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
class RatingView(APIView):
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
class ClassgroupDetailView(QueryView):
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        else:
            return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 
class NotificationView(QueryView):
            return Response(serializer.data)
        else:
            return Response(status=status.HTTP_400_BAD_REQUEST)
 
    def delete(self, request, pk, format=None):
            error_msg = "User not authorized to delete this message."
            log.error(error_msg)
            return Response(error_msg, status=status.HTTP_400_BAD_REQUEST)
 
        message.classgroup = None

src/z/a/zamboni-HEAD/mkt/comm/views.py   zamboni(Download)
        if not form.is_valid():
            return Response(
                form.errors, status=status.HTTP_400_BAD_REQUEST)
 
        app = form.cleaned_data['app']
        form = forms.CreateCommNoteForm(request.DATA)
        if not form.is_valid():
            return Response(form.errors, status=status.HTTP_400_BAD_REQUEST)
 
        # Create notes.
                    [{'non_field_errors':
                      'Maximum of %s files can be attached.'}],
                    status=status.HTTP_400_BAD_REQUEST)
 
            attachment_formset = forms.CommAttachmentFormSet(
                data=data, files=request.FILES or None)
            if not attachment_formset.is_valid():
                return Response(attachment_formset.errors,
                                status=status.HTTP_400_BAD_REQUEST)
        else:
            return Response([{'non_field_errors': 'No files were attached.'}],
                            status=status.HTTP_400_BAD_REQUEST)
 
        # Create attachment.

src/a/t/atmosphere-HEAD/api/tag.py   atmosphere(Download)
            return Response(['A tag with this name already exists: %s'
                             % same_name_tags],
                            status=status.HTTP_400_BAD_REQUEST)
        data['user'] = user.username
        data['name'] = data['name'].lower()
        serializer = TagSerializer(data=data)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
                + 'Contact support if you need to change '
                + 'a tag that is not yours.'],
                status=status.HTTP_400_BAD_REQUEST)
        #Allowed to update tags..
        data = request.DATA.copy()
            serializer.save()
            return Response(serializer.data)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
 

src/z/a/zamboni-HEAD/mkt/webapps/views.py   zamboni(Download)
                pass
 
        return Response(form.errors, status=status.HTTP_400_BAD_REQUEST)
 
    @action(methods=['POST'],
        if not data_form.is_valid():
            return Response(data_form.errors,
                            status=status.HTTP_400_BAD_REQUEST)
 
        form = AppFormMedia(data_form.cleaned_data, request=request)
        if not form.is_valid():
            return Response(data_form.errors,
                            status=status.HTTP_400_BAD_REQUEST)

src/d/e/deis-HEAD/controller/api/views.py   deis(Download)
        except ValueError:
            return Response('Invalid scaling format',
                            status=status.HTTP_400_BAD_REQUEST)
        app = self.get_object()
        try:
            app.structure = new_structure
            app.scale()
        except EnvironmentError as e:
            return Response(str(e), status=status.HTTP_400_BAD_REQUEST)
            output_and_rc = app.run(command)
        except EnvironmentError as e:
            return Response(str(e), status=status.HTTP_400_BAD_REQUEST)
        return Response(output_and_rc, status=status.HTTP_200_OK,
                        content_type='text/plain')

src/t/r/treeherder-service-HEAD/vendor/rest_framework/exceptions.py   treeherder-service(Download)
class ParseError(APIException):
    status_code = status.HTTP_400_BAD_REQUEST
    default_detail = 'Malformed request.'
 
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next