create the flash transporter create the flash transporter
962022
function _swf(uri, _, uid) {
        if (init) {
            return;
        }
        init = true;
        var o = '<object id="' + ID + '" type="application/x-shockwave-flash" data="' + uri + '" width="0" height="0">' + '<param name="movie" value="' + uri + '" />' + '<param name="FlashVars" value="yid=' + _ + '&uid=' + uid + '&host=KISSY.IO" />' + '<param name="allowScriptAccess" value="always" />' + '</object>', c = doc.createElement('div');
        Dom.prepend(c, doc.body || doc.documentElement);
        c.innerHTML = o;
    }
561653
protected function createSmtpDriver()
    {
        $config = $this->app->make('config')->get('mail');

        // The Swift SMTP transport instance will allow us to use any SMTP backend
        // for delivering mail such as Sendgrid, Amazon SES, or a custom server
        // a developer has available. We will just pass this configured host.
        $transport = new SmtpTransport($config['host'], $config['port']);

        if (isset($config['encryption'])) {
            $transport->setEncryption($config['encryption']);
        }

        // Once we have the transport we will check for the presence of a username
        // and password. If we have it we will set the credentials on the Swift
        // transporter instance so that we'll properly authenticate delivery.
        if (isset($config['username'])) {
            $transport->setUsername($config['username']);

            $transport->setPassword($config['password']);
        }

        // Next we will set any stream context options specified for the transport
        // and then return it. The option is not required any may not be inside
        // the configuration array at all so we'll verify that before adding.
        if (isset($config['stream'])) {
            $transport->setStreamOptions($config['stream']);
        }

        return $transport;
    }
569064
public static function create()
    {
        $builder = NotifireBuilder::create();

        if (\class_exists('Swift_Mailer')) {
            $transport = new \Swift_SmtpTransport('localhost', 25);
            $mailer = new \Swift_Mailer($transport);

            $handler = new SwiftMailerHandler($mailer, 'default');
            if (\class_exists('Twig_Environment')) {
                $env = new \Twig_Environment(new \Twig_Loader_Filesystem());
                $handler->setTwig($env);
            }

            $builder->addHandler($handler);
            $builder->addNotification('email', Email::class);
        }

        $builder->initialize();
    }
293931
def _make_loader(self):
        
        return Loader(file_encoding=self.file_encoding, extension=self.file_extension,
                      to_unicode=self.unicode, search_dirs=self.search_dirs)
1125938
public void createControlAdapter()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createControlAdapter");

    // The type of control adapter created depends on the type of destination
    // that we're working with
    if(!destinationHandler.isLink())
    {
      XmitPoint rqm =
        (XmitPoint) destinationHandler.getRemoteQueuePointControl(getLocalizingMEUuid(), true);
      controlAdapter = new XmitPointControl(rqm,
                                            this,                                        
                                            destinationHandler); 
    }
    else
    { 
      // Use the StreamSet's Control Adapter for the "link remote queue points"
      controlAdapter = 
        new LinkRemoteQueuePoint(destinationHandler, this);
    }                                          
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createControlAdapter", controlAdapter);
  }
93553
protected function createTraitDirectory()
    {
        if( ! $this->files->isDirectory($this->getTraitDirectory())) {
            $this->files->makeDirectory($this->getTraitDirectory());
        }

        $this->createDirectory('trait');
    }
973080
def _create_geonode_uploader_action(self):
        """"""
        icon = resources_path('img', 'icons', 'geonode.png')
        label = tr('Geonode Uploader')
        self.action_geonode = QAction(
            QIcon(icon), label, self.iface.mainWindow())
        self.action_geonode.setStatusTip(label)
        self.action_geonode.setWhatsThis(label)
        self.action_geonode.triggered.connect(self.show_geonode_uploader)
        self.add_action(self.action_geonode, add_to_toolbar=False)
111251
public static function create(): self
    {
        return new self(
            new ClosureContainer(
                [
                    'rollerworks_search.condition_exporter.json' => function () {
                        return new Exporter\JsonExporter();
                    },
                    'rollerworks_search.condition_exporter.string_query' => function () {
                        return new Exporter\StringQueryExporter();
                    },
                    'rollerworks_search.condition_exporter.norm_string_query' => function () {
                        return new Exporter\NormStringQueryExporter();
                    },
                ]
            ),
            [
                'json' => 'rollerworks_search.condition_exporter.json',
                'string_query' => 'rollerworks_search.condition_exporter.string_query',
                'norm_string_query' => 'rollerworks_search.condition_exporter.norm_string_query',
            ]
        );
    }
1092922
def create(self, name_or_class, mask, filepath=None, **kwargs):
        """"""
        if isinstance(name_or_class, type):
            name = name_or_class.type
            protocol = name_or_class
        else:
            name = name_or_class
            protocol = self.protocols[name]
        assert name in DCC_TYPES
        if filepath:
            kwargs.setdefault('limit_rate',
                              self.config['send_limit_rate'])
            kwargs['filepath'] = filepath
            if protocol.type == DCCSend.type:
                kwargs.setdefault('offset', 0)
                kwargs.update(
                    filename_safe=slugify(os.path.basename(filepath)),
                    filesize=os.path.getsize(filepath),
                )
            elif protocol.type == DCCGet.type:
                try:
                    offset = os.path.getsize(filepath)
                except OSError:
                    offset = 0
                kwargs.setdefault('offset', offset)
                kwargs.setdefault('resume', False)
        kwargs.setdefault('port', None)
        f = protocol(
            mask=mask, ip=int(self.bot.ip),
            bot=self.bot, loop=self.loop, **kwargs)

        if kwargs['port']:
            if self.bot.config.get('dcc_sock_factory'):
                sock_factory = maybedotted(self.bot.config.dcc_sock_factory)
                args = dict(sock=sock_factory(self.bot, f.host, f.port))
            else:
                args = dict(host=f.host, port=f.port)
            task = self.bot.create_task(
                self.loop.create_connection(f.factory, **args))
            task.add_done_callback(partial(self.created, f))
        else:
            task = self.bot.create_task(
                self.loop.create_server(
                    f.factory, '0.0.0.0', 0, backlog=1))
            task.add_done_callback(partial(self.created, f))
        return f
814181
def _make_stream_transport(self):
    """"""
    msg_queue = queue.Queue()
    with self._stream_transport_map_lock:
      # Start one past the last id we used, and grab the first available one.
      # This mimics the ADB behavior of 'increment an unsigned and let it
      # overflow', but with a check to ensure we don't reuse an id in use,
      # even though that's unlikely with 2^32 - 1 of them available.  We try
      # at most 64 id's, if we've wrapped around and there isn't one available
      # in the first 64, there's a problem, better to fail fast than hang for
      # a potentially very long time (STREAM_ID_LIMIT can be very large).
      self._last_id_used = (self._last_id_used % STREAM_ID_LIMIT) + 1
      for local_id in itertools.islice(
          itertools.chain(
              range(self._last_id_used, STREAM_ID_LIMIT),
              range(1, self._last_id_used)), 64):
        if local_id not in list(self._stream_transport_map.keys()):
          self._last_id_used = local_id
          break
      else:
        raise usb_exceptions.AdbStreamUnavailableError('Ran out of local ids!')
      # Ignore this warning - the for loop will always have at least one
      # iteration, so local_id will always be set.
      # pylint: disable=undefined-loop-variable
      stream_transport = AdbStreamTransport(self, local_id, msg_queue)
      self._stream_transport_map[local_id] = stream_transport
    return stream_transport
549928
public function createHomeController()
    {
        $homeController = $this->directory.'/Controllers/HomeController.php';
        $contents = $this->getStub('HomeController');

        $this->laravel['files']->put(
            $homeController,
            str_replace('DummyNamespace', config('lia.route.namespace'), $contents)
        );
        $this->line('<info>HomeController file was created:</info> '.str_replace(base_path(), '', $homeController));
    }
583605
function(handler, name, enc, cbfscreatefile) {
        jsDAV_FS_Directory.createFileStream.call(this, handler, name, enc,
            afterCreateFile.bind(this, name, cbfscreatefile));
    }
766157
protected function createLogDriver()
    {
        $logger = $this->app->make(LoggerInterface::class);

        if ($logger instanceof LogManager) {
            $logger = $logger->channel($this->app['config']['mail.log_channel']);
        }

        return new LogTransport($logger);
    }
431822
function DeviceLoader() {
  var self = this;

  // call super class
  EventEmitter2.call(this, {
    wildcard: true,
    delimiter: ':',
    maxListeners: 1000 // default would be 10!
  });

  if (this.log) {
    this.log = _.wrap(this.log, function(func, msg) {
      func(self.constructor.name + ': ' + msg);
    });
  } else if (DeviceLoader.prototype.log) {
    DeviceLoader.prototype.log = _.wrap(DeviceLoader.prototype.log, function(func, msg) {
      func(self.constructor.name + ': ' + msg);
    });
    this.log = DeviceLoader.prototype.log;
  } else {
    var debug = require('debug')(this.constructor.name);
    this.log = function(msg) {
      debug(msg);
    };
  }

  this.lookupIntervalId = null;
  this.oldDevices = [];

  this.isRunning = false;
}
225756
function createLoader(handlers) {
  var handlerMap = new Map(Object.keys(handlers).map(function (key) {
    return [key, handlers[key]];
  }));
  handlers = undefined;

  return function (state, data) {
    var keys = Object.keys(data);
    return Promise.all(keys.map(function (key) {
      var handler = handlerMap.get(key);

      return handler(state, data[key]);
    })).then(function (results) {
      var data = Object.create(null);
      results.forEach(function (result, index) {
        data[keys[index]] = result;
      });
      return data;
    });
  };
}
78349
function createTransp() {
    $cnt = count( $this->transp );
    if( 0 >= $cnt )
      return;
    $attributes = $this->_createParams( $this->transp['params'] );
    return $this->_createElement( 'TRANSP', $attributes, $this->transp['value'] );
  }
1358390
public function createAction()
    {
        $this->view->disable();
        $msg = "";
        if(!is_dir("upload/banner/")){
            if (!mkdir($this->path, 0777, true)) {
                die('Failed to create folders...');
            }
        }
        if($this->request->hasFiles() !== false) {

            $uploader = new \Uploader\Uploader([
                'directory' =>  "upload/banner/",
                'mimes'     =>  [
                    'image/gif',
                    'image/jpeg',
                    'image/png',
                ],
                'extensions'     =>  [
                    'gif',
                    'jpeg',
                    'jpg',
                    'png',
                ],

                'sanitize' => true,  // escape file & translate to latin
                'hash'     => 'md5'
            ]);

            if($uploader->isValid() === true) {

                $uploader->move();

                $file   = $uploader->getInfo();
                $alert  = "sukses";
                $msg    .= $file[0]['filename']." ";
                $_file  = $file[0]['filename'];
            }
            else {
                $alert  = "error";
                $msg    .= $uploader->getErrors()[0];
                $_file  = " ";
            }
        }
        $banner = new Banner();
        $banner->order          = $this->request->getPost("order");
        $banner->publish        = $this->request->getPost("publish");
        $banner->description    = $this->request->getPost("description");
        $banner->description1   = $this->request->getPost("description1");
        $banner->link           = $this->request->getPost("link");
        $banner->file           = $_file;
        $banner->create_user    = $this->auth->getIdentity()['id'];

        if (!$banner->save()) {
            $alert  = "error";
            foreach ($banner->getMessages() as $message) {
                $msg .= $message." ";
            }
        }else{
            $alert  = "sukses";
            $msg    .= "Banner was created successfully";
        }

        $response = new \Phalcon\Http\Response();
        $response->setContentType('application/json', 'UTF-8');
        $response->setJsonContent(array('_id' => $_file,'alert' => $alert, 'msg' => $msg ));
        return $response->send();
    }