Return Gist URL-Link, Clone-Link and Script-Link to embed
423973
def links(self,**args):
		'''
		
		'''
		if 'name' in args:
			self.gist_name = args['name']
			self.gist_id = self.getMyID(self.gist_name)
		elif 'id' in args:
			self.gist_id = args['id']
		else:
			raise Exception('Gist Name/ID must be provided')
		if self.gist_id:
			r = requests.get(
				'%s/gists/%s'%(BASE_URL,self.gist_id),
				headers=self.gist.header,
				)
			if (r.status_code == 200):

				content = {
				'Github-User': r.json()['user']['login'],
				'GistID': r.json()['id'],
				'Gist-Link': '%s/%s/%s' %(GIST_URL,self.gist.username,r.json()['id']),
				'Clone-Link': '%s/%s.git' %(GIST_URL,r.json()['id']),
				'Embed-Script': '<script src="%s/%s/%s.js"</script>' %(GIST_URL,self.gist.username,r.json()['id'])
				}
				return content

		raise Exception('No such gist found')
466495
function getUrls (opts) {

    var list    = [];

    var bsLocal = require("url").parse(opts.urls.local);

    list.push([bsLocal.protocol + "//", bsLocal.hostname, ":", opts.port].join(""));

    if (opts.urls.external) {
        var external = require("url").parse(opts.urls.external);
        list.push([bsLocal.protocol + "//", external.hostname, ":", opts.port].join(""));
    }

    return Immutable.List(list);
}
620189
function getScript(url) {
		
		var script = scripts[url.name || url];
		if (script) { return script; }
		
		if (typeof url == 'object') {
			for (var key in url) {
				if (url[key]) {
					script = { name: key, url: url[key] };
				}
			}
		} else {


			var els = url.split("/"),
				 name = els[els.length -1],
				 i = name.indexOf("?");
				 
			script = {
				name: i != -1 ? name.substring(0, i) : name, 
				url: url 
			}; 
		}
		
		scripts[script.name] = script;
		return script;
	}
680378
def paste(self):
        """"""
        data = json.dumps({
            'description': 'Backlash Internal Server Error',
            'public': False,
            'files': {
                'traceback.txt': {
                    'content': self.plaintext
                }
            }
        }).encode('utf-8')

        rv = urlopen('https://api.github.com/gists', data=data)
        resp = json.loads(rv.read().decode('utf-8'))
        rv.close()
        return {
            'url': resp['html_url'],
            'id': resp['id']
        }
1205635
def clone(giturl, gitpath):
    
    gitArgs = ['git', 'clone', giturl, gitpath]
    slog.info(' '.join(gitArgs))
    return subprocess.call(gitArgs)
641009
def content(self, request, id):
        
        gist = self.send(request, id).json()

        def convert(data):
            return base64.b64decode(data).decode('utf-8')

        content = {}
        for name, data in gist['files'].items():
            content[name] = convert(data['content'])

        return content
780994
function parseUrl (ast) {
        let [firstAgument] = ast.arguments;
        let rawUrl = firstAgument.raw;
        let url = rawUrl.replace(/^\//, '').replace(/\/$/, '').replace(/\\/g,'');
        assert(url);
        return url;
    }
902040
def clone(cls, srcpath, destpath, encoding='utf-8'):
        """"""
        cmd = [GIT, 'clone', '--quiet', '--bare', srcpath, destpath]
        subprocess.check_call(cmd)
        return cls(destpath, encoding)
771391
def star(self, **args):
		'''
		
		'''
		if 'name' in args:
			self.gist_name = args['name']
			self.gist_id = self.getMyID(self.gist_name)
		elif 'id' in args:
			self.gist_id = args['id']
		else:
			raise Exception('Either provide authenticated user\'s Unambigious Gistname or any unique Gistid to be starred')

		r = requests.put(
			'%s'%BASE_URL+'/gists/%s/star' % self.gist_id,
			headers=self.gist.header
			)
		if (r.status_code == 204):
			response = {
				'id': self.gist_id
			}
			return response

		raise Exception('Gist can\'t be starred')
1195381
def clone(self, id, name=None):
        
        url = 'git@gist.github.com:/{}'.format(id)

        if name is None:
            os.system('git clone {}'.format(url))
        else:
            os.system('git clone {} {}'.format(url, name))
1360657
function resolveLinks (str, from) {
  str = str.replace(/\{@link ([^} ]+) ?\}/gi,
    function(match, symbolName) {
      return "<code>" + new Link().toClass(symbolName) + "</code>";
    }
  );
  return str;
}
998875
function( str , dest ){
        var _spilt  = "cb==cb",
            _imgs   = str.replace( /\s+/gi , " " ).replace( /url\(([^\)]*)\)/gi , _spilt + "$1" + _spilt ).split( _spilt ),
            _md5,
            _img,
            _dest;
        for( var i = _imgs.length; i--; ){
            if( i % 2 ){
                _img    = tool.getResourcePath( _imgs[ i ] , dest );
                if( !grunt.file.exists( _img ) ){
                    continue;
                };
                if( !config.resources[ _img ] ){
                    _md5    = tool.getFileMD5( _img );
                    config.resources[ _img ] = _md5;
                } else {
                    _md5 = config.resources[ _img ];
                };
                _imgs[ i ] = "url('../" + _md5 + "')";
            };
        };
        return _imgs.join( "" );
    }
146134
def get_gists(self):
        
        # fetch all gists
        if self.is_authenticated:
            url = self._api_url("gists")
        else:
            url = self._api_url("users", self.user, "gists")
        self.output("Fetching " + url)
        raw_resp = self.requests.get(url)

        # abort if user not found
        if raw_resp.status_code != 200:
            self.oops("User `{}` not found".format(self.user))
            return

        # abort if there are no gists
        resp = raw_resp.json()
        if not resp:
            self.oops("No gists found for user `{}`".format(self.user))
            return

        # parse response
        for gist in raw_resp.json():
            yield self._parse_gist(gist)
345967
def build_urls(self: NodeVisitor, node: inheritance_diagram) -> Mapping[str, str]:
    
    current_filename = self.builder.current_docname + self.builder.out_suffix
    urls = {}
    for child in node:
        # Another document
        if child.get("refuri") is not None:
            uri = child.get("refuri")
            package_path = child["reftitle"]
            if uri.startswith("http"):
                _, _, package_path = uri.partition("#")
            else:
                uri = (
                    pathlib.Path("..")
                    / pathlib.Path(current_filename).parent
                    / pathlib.Path(uri)
                )
                uri = str(uri).replace(os.path.sep, "/")
            urls[package_path] = uri
        # Same document
        elif child.get("refid") is not None:
            urls[child["reftitle"]] = (
                "../" + current_filename + "#" + child.get("refid")
            )
    return urls
552183
function getUrl (value) {
  const reg = /url\((\s*)(['"]?)(.+?)\2(\s*)\)/g
  const match = reg.exec(value)
  const url = match[URL_POSITION]
  return url
}
82414
def content(self, **args):
		'''
		
		'''
		self.gist_name = ''
		if 'name' in args:
			self.gist_name = args['name']
			self.gist_id = self.getMyID(self.gist_name)
		elif 'id' in args:
			self.gist_id = args['id']
		else:
			raise Exception('Either provide authenticated user\'s Unambigious Gistname or any unique Gistid')


		if self.gist_id:
			r = requests.get(
				'%s'%BASE_URL+'/gists/%s' %self.gist_id,
				headers=self.gist.header
				)
			if (r.status_code == 200):
				r_text = json.loads(r.text)
				if self.gist_name!='':
					content =  r.json()['files'][self.gist_name]['content']
				else:
					for key,value in r.json()['files'].iteritems():
						content = r.json()['files'][value['filename']]['content']
				return content

		raise Exception('No such gist found')
278404
function getUrl(repo, clone) {
	let url;

	if (repo.type === 'github') {
		url = github(repo, clone);
	} else if (repo.type === 'gitlab') {
		url = gitlab(repo, clone);
	} else if (repo.type === 'bitbucket') {
		url = bitbucket(repo, clone);
	} else if (repo.type === 'oschina') {
		url = oschina(repo, clone);
	} else {
		url = github(repo, clone);
	}

	return url;
}