/*
Our primary pull method
323659
function(conf, choices) {

    // Start by ensuring our SSH keys are good to go
    return commands.ensureKeys()

    // Then pull a screenshot
    .then(function() {
      return pullScreenshot(conf.uuid, conf.env);
    })

    // Ensure our git perms are excellent
    .then(function() {
      return commands.ensureGitPerms();
    })

    // Then grab our Pantheon aliases
    .then(function() {
      return terminus.getSiteAliases();
    })

    // Then pull our code
    .then(function() {
      return pullCode(conf.site, conf.env);
    })

    // Then ensure our symlink
    .then(function() {
      return commands.ensureSymlink();
    })

    // Then pull our DB if selected
    .then(function() {
      if (choices.database && choices.database !== 'none') {
        return pullDB(conf.site, choices.database, choices.newbackup);
      }
    })

    // THen pull our files if selected
    .then(function() {
      if (choices.files && choices.files !== 'none') {
        var newBackup = choices.newbackup;
        return pullFiles(conf.site, conf.uuid, choices.files, newBackup);
      }
    })

    // Then rebuild caches and registries as appropriate
    .then(function() {
      return rebuild();
    });

  }
931083
def pull_object(id)
      local_object = @factory.with_remote_id(id)
      if local_object
        # FIXME What if there's no local object and we still want to set some
        # contexts?
        @service.set_contexts(local_object.contexts)
      else
        local_object = @factory.new
      end
      local_object.before_pull(self) if local_object.respond_to?(:before_pull)
      object_hash = @service.show(object_name, id)
      @service.clear_contexts
      local_object._remote_id = object_hash.delete('id')
      fields = configuration.synchronizable_for_pull
      fields.each do |key|
        value = object_hash[key.to_s]
        local_object.send("#{key}=", value)
      end
      local_object.after_pull(self) if local_object.respond_to?(:after_pull)
      local_object.save
    end
715075
void pull(File project) {
		try {
			try (Git git = this.gitFactory.open(project)) {
				PullCommand command = this.gitFactory.pull(git);
				command.setRebase(true).call();
			}
		}
		catch (Exception e) {
			throw new IllegalStateException(e);
		}
	}
1196640
@Override
	public CPRule fetchByPrimaryKey(Serializable primaryKey) {
		Serializable serializable = entityCache.getResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
				CPRuleImpl.class, primaryKey);

		if (serializable == nullModel) {
			return null;
		}

		CPRule cpRule = (CPRule)serializable;

		if (cpRule == null) {
			Session session = null;

			try {
				session = openSession();

				cpRule = (CPRule)session.get(CPRuleImpl.class, primaryKey);

				if (cpRule != null) {
					cacheResult(cpRule);
				}
				else {
					entityCache.putResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
						CPRuleImpl.class, primaryKey, nullModel);
				}
			}
			catch (Exception e) {
				entityCache.removeResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
					CPRuleImpl.class, primaryKey);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return cpRule;
	}
1080681
function getMain(src, options, dest) {
    var meta = grunt.file.readJSON(path.join(src, 'package.json'))
    if (!meta.main) {
      fail.fatal(
        'No main property specified by ' + path.normalize(src.replace(options.srcPrefix, ''))
      )
    }
    var files = typeof meta.main === 'string' ? [meta.main] : meta.main
    return files.map(function(source) {
      return {
        src: path.join(src, source),
        dest: dest
      }
    })
  }
1110655
public static function pull(string $key)
  {
    if (Self::has($key)) {
      $value = Self::get($key);
      Self::forget($key);

      return $value;
    }

    return null;
  }
910992
def pull(self):
        
        if _get_bit(self._mcp.gppu, self._pin):
            return digitalio.Pull.UP
        return None
1154345
public PullResult pullFromRepository(Git git, String remote, String remoteBranch, String username, String password) {
        try {
            return git.pull()
                .setRemote(remote)
                .setRemoteBranchName(remoteBranch)
                .setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
                .call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }
1108168
public function main()
    {
        $pull = $this->getFactoryInstance('update');
        try {
            $pull->setBranch($this->getBranch());
        } catch (Exception $ex) {
            $this->log("Caught: " . $ex->getMessage(), Project::MSG_DEBUG);
        }
        $pull->setClean($this->getClean());
        $pull->setQuiet($this->getQuiet());

        $cwd = getcwd();

        if ($this->repository === '') {
            $prog = $this->getProject();
            $dir = $prog->getProperty('application.startdir');
        } else {
            $dir = $this->repository;
        }

        $this->checkRepositoryIsDirAndExists($dir);
        chdir($dir);
        try {
            $this->log("Executing: " . $pull->asString(), Project::MSG_INFO);
            $output = $pull->execute();
            if ($output !== '') {
                $this->log($output);
            }
        } catch (Exception $ex) {
            $msg = $ex->getMessage();
            $p = strpos($msg, 'hg returned:');
            if ($p !== false) {
                $msg = substr($msg, $p + 13);
            }
            chdir($cwd);
            throw new BuildException($msg);
        }
        chdir($cwd);
    }
122427
public function callback()
	{

		Log::info('callback.url.pull', array(
			'message'  => 'Request callback url',
			'rawInput' => Input::all(),
		));

		$input = $this->getVerifiedInput('callback', Input::get('type'), Input::all(), true);
		if ($input) {
			// your business processing
		}

	}
1162683
function(obj) {
    var self = this
    if (obj.runMainInFiber) { // default is false
      console.warn('"runMainInFiber" is DEPRECATED. Please wrap all applications in "__" instead.')
      __(function() {
        self._invokeMain(obj)
      })
    } else {
      self._invokeMain(obj)
    }
  }
1179823
function(){
		var main = this.main = this.findMain();
		// If the main isn't an .html file we can't rewrite anything.
		if(!main) {
			return;
		}

		return readFile(main, "utf8")
		.then(function(src){
			this.originalSource = src;

			var $ = cheerio.load(src);
			var stealScript;
			$("script").each(function(idx, el){
				var $el = $(el);
				var src = $el.attr("src");
				if(/steal\.production\.js/.test(src)) {
					stealScript = $el;
					return false;
				}
			});

			if(stealScript) {
				stealScript.attr("env", "nw-production");
				return writeFile(main, $.html(), "utf8")
			}
		}.bind(this))
		.catch(function(){
			// We don't want the copy to fail just because of this
		})

	}
509656
function pullImageIfMissing(docker, image, options) {
  debug('ensure image', image);
  var pullStream = new PullStatusStream();

  // first attempt to find the image locally...
  docker.getImage(image).inspect().then(
    function inspection(gotImg) {
      // push a value directly to the result without the transform.
      pullStream.push(image + ' exists in the cache.\r\n');
      // end the stream.
      pullStream.end();
    },

    function missingImage() {
      debug('image is missing pull', image);
      // image is missing so pull it
      return docker.pull(image, options || {}).then(function(rawPullStream) {
        rawPullStream.pipe(pullStream);
      });
    }
  ).then(
    null,
    function handleErrors(err) {
      pullStream.emit('error', err);
    }
  );

  return pullStream;
}
1245846
def pull(self):
        """"""
        # n.b. pull is now somewhat misleadingly named because it doesn't do anything
        # the connection isn't touched until you try and iterate the generator we return
        lock_acquired = self._pull_lock.acquire(blocking=False)
        if not lock_acquired:
            raise PullOrderException()
        return self._results_generator()
1038274
def atomic_pulls
      pulls = {}
      delayed_atomic_pulls.each_pair do |_, docs|
        path = nil
        ids = docs.map do |doc|
          path ||= doc.flag_as_destroyed
          doc._id
        end
        pulls[path] = { "_id" => { "$in" => ids }} and path = nil
      end
      pulls
    end
413202
protected function utilGitPull()
    {
        foreach (File::directories(plugins_path()) as $authorDir) {
            foreach (File::directories($authorDir) as $pluginDir) {
                if (!File::isDirectory($pluginDir.'/.git')) continue;
                $exec = 'cd ' . $pluginDir . ' && ';
                $exec .= 'git pull 2>&1';
                echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;
                echo shell_exec($exec);
            }
        }

        foreach (File::directories(themes_path()) as $themeDir) {
            if (!File::isDirectory($themeDir.'/.git')) continue;
            $exec = 'cd ' . $themeDir . ' && ';
            $exec .= 'git pull 2>&1';
            echo 'Updating theme: '. basename($themeDir) . PHP_EOL;
            echo shell_exec($exec);
        }
    }
1056306
def pull(self):
        
        git.Repo(self.path).remote().pull(self.branch)