Fabricated easy.

 @example Prepared easy.
   easy_factory.get

 @return [ Ethon::Easy ] The easy.
161912
def get
      begin
        easy.http_request(
          request.base_url.to_s,
          request.options.fetch(:method, :get),
          sanitize(request.options)
        )
      rescue Ethon::Errors::InvalidOption => e
        help = provide_help(e.message.match(/:\s(\w+)/)[1])
        raise $!, "#{$!}#{help}", $!.backtrace
      end
      set_callback
      easy
    end
1222584
def _get_provides(self, private=False):
        

        # TODO I probably need to add inner classes here

        me = self.pretty_this()
        yield me

        for field in self.fields:
            if private or field.is_public():
                yield "%s.%s" % (me, field.pretty_identifier())

        for method in self.methods:
            if private or method.is_public():
                yield "%s.%s" % (me, method.pretty_identifier())
13663
def method_instance
    lazy_var :@method_instance do
      # Just drop a warning if we can't get the method object
      logger.catch.warn(
        "Failed to get method",
        instance: instance,
        method_name: method_name,
      ) do
        instance.method method_name
      end
    end
  end
52384
def get_or_create(self, **kwargs):
        
        assert kwargs, \
                'get_or_create() must be passed at least one keyword argument'
        defaults = kwargs.pop('defaults', {})
        lookup = kwargs.copy()
        #TODO: check fields
        try:
            return self.get(**lookup), False
        except self.model.DoesNotExist:
            params = dict([(k, v) for k, v in kwargs.items() if '__' not in k])
            params.update(defaults)
            obj = self.model(**params)
            meta = obj.get_meta()
            meta.connection = get_es_connection(self.es_url, self.es_kwargs)
            meta.index=self.index
            meta.type=self.type
            obj.save(force=True)
            return obj, True
9147
def getFactory(self):
        
        privateKey = Key.fromString(data=self.hostKey)
        public = privateKey.public()
        factory = SSHFactory()
        factory.publicKeys = {'ssh-rsa': public}
        factory.privateKeys = {'ssh-rsa': privateKey}
        factory.portal = Portal(
            IRealm(self.store), [ICredentialsChecker(self.store)])
        return factory
789819
async def get(self, request, resource=None, **kwargs):
        
        if resource is not None and resource != '':
            return self.to_simple(request, resource, **kwargs)

        return self.to_simple(request, self.collection, many=True, **kwargs)
855155
def get(self):
        
        try:
            session = self._sessions.get_nowait()
        except queue.Empty:
            session = self._new_session()
            session.create()
        else:
            if not session.exists():
                session = self._new_session()
                session.create()
        return session
987438
def get_factory_context(cls):
    # type: (type) -> FactoryContext
    
    context = getattr(cls, constants.IPOPO_FACTORY_CONTEXT, None)

    if context is None:
        # Class not yet manipulated
        context = FactoryContext()
    elif is_from_parent(cls, constants.IPOPO_FACTORY_CONTEXT):
        # Create a copy the context
        context = context.copy(True)
        # * Manipulation has not been applied yet
        context.completed = False
    else:
        # Nothing special to do
        return context

    # Context has been created or copied, inject the new bean
    setattr(cls, constants.IPOPO_FACTORY_CONTEXT, context)
    return context
1007564
def factory(cls, **kwargs):
    
    for name, obj in inspect.getmembers(sys.modules[__name__]):
        if inspect.isclass(obj) and issubclass(obj, UserAuthnMethod):
            try:
                if obj.__name__ == cls:
                    return obj(**kwargs)
            except AttributeError:
                pass
1174439
def make!(*args)
      decode_args_to_make(*args) do |blueprint, attributes|
        raise BlueprintCantSaveError.new(blueprint) unless blueprint.respond_to?(:make!)
        blueprint.make!(attributes)
      end
    end
1121370
def simple_generate_batch(klass, create, size, **kwargs):
    """"""
    return make_factory(klass, **kwargs).simple_generate_batch(create, size)
1135008
def create(self, **kwargs):
        
        obj = self.model(**kwargs)
        obj.save(force_insert=True, using=self._using)
        return obj
536925
def make_instance(self, data):
        """"""
        if not self.opts.model:
            return data

        if self.instance is not None:
            for key, value in data.items():
                setattr(self.instance, key, value)
            return self.instance

        return self.opts.model(**data)
95561
def to_simple_model(self, instance, **options): # noqa
        
        options = self.init_options(**options)
        fields, include, exclude, related = options['fields'], options['include'], options['exclude'], options['related'] # noqa

        result = dict(
            model=smart_unicode(instance._meta),
            pk=smart_unicode(
                instance._get_pk_val(), strings_only=True),
            fields=dict(),
        )

        default_fields = set([field.name for field in instance._meta.fields if field.serialize])
        serialized_fields = fields or (default_fields | include) - exclude

        for fname in serialized_fields:

            # Respect `to_simple__<fname>`
            to_simple = getattr(
                self.scheme, 'to_simple__{0}'.format(fname), None)

            if to_simple:
                result['fields'][fname] = to_simple(instance, serializer=self)
                continue

            related_options = related.get(fname, dict())
            if related_options:
                related_options = self.init_options(**related_options)

            if fname in default_fields and not related_options:
                field = instance._meta.get_field(fname)
                value = field.value_from_object(instance)

            else:
                value = getattr(instance, fname, None)
                if isinstance(value, Manager):
                    value = value.all()

            result['fields'][fname] = self.to_simple(
                value, **related_options)

        if self.format != 'django':
            fields = result['fields']
            fields['id'] = result['pk']
            result = fields

        return result
420929
def construct(self):
        ''''''
        if self.__construct is None:
            self.__construct = self._construct()
        return self.__construct
645699
def get_pe(self):
        
        return PE(self.rest_client.make_request(self.pe), self.rest_client)
84331
def get_or_create(self, request, *args, **kwargs):
        """"""
        kwargs['get_or_create'] = True
        return self.create(request, *args, **kwargs)