Given url where a Turi Create object is persisted, return the Turi
    Create object type: 'model', 'graph', 'sframe', or 'sarray'
10908
def get_turicreate_object_type(url):
    '''
    
    '''
    from .._connect import main as _glconnect
    ret = _glconnect.get_unity().get_turicreate_object_type(_make_internal_url(url))

    # to be consistent, we use sgraph instead of graph here
    if ret == 'graph':
        ret = 'sgraph'
    return ret
80884
def create_api_object_type(self):
        """"""

        return ApiObjectType(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
684255
def _serialize(self, uri, node):
        
        meta = self._decode_meta(node['meta'], is_published=bool(node['is_published']))
        return {
            'uri': uri.clone(ext=node['plugin'], version=node['version']),
            'content': node['content'],
            'meta': meta
        }
619748
def create(cls, type):
        
        if type == 0: return TagEnd()
        elif type == 1: return TagShowFrame()
        elif type == 2: return TagDefineShape()
        elif type == 4: return TagPlaceObject()
        elif type == 5: return TagRemoveObject()
        elif type == 6: return TagDefineBits()
        elif type == 7: return TagDefineButton()
        elif type == 8: return TagJPEGTables()
        elif type == 9: return TagSetBackgroundColor()
        elif type == 10: return TagDefineFont()
        elif type == 11: return TagDefineText()
        elif type == 12: return TagDoAction()
        elif type == 13: return TagDefineFontInfo()
        elif type == 14: return TagDefineSound()
        elif type == 15: return TagStartSound()
        elif type == 17: return TagDefineButtonSound()
        elif type == 18: return TagSoundStreamHead()
        elif type == 19: return TagSoundStreamBlock()
        elif type == 20: return TagDefineBitsLossless()
        elif type == 21: return TagDefineBitsJPEG2()
        elif type == 22: return TagDefineShape2()
        elif type == 24: return TagProtect()
        elif type == 26: return TagPlaceObject2()
        elif type == 28: return TagRemoveObject2()
        elif type == 32: return TagDefineShape3()
        elif type == 33: return TagDefineText2()
        elif type == 34: return TagDefineButton2()
        elif type == 35: return TagDefineBitsJPEG3()
        elif type == 36: return TagDefineBitsLossless2()
        elif type == 37: return TagDefineEditText()
        elif type == 39: return TagDefineSprite()
        elif type == 41: return TagProductInfo()
        elif type == 43: return TagFrameLabel()
        elif type == 45: return TagSoundStreamHead2()
        elif type == 46: return TagDefineMorphShape()
        elif type == 48: return TagDefineFont2()
        elif type == 56: return TagExportAssets()
        elif type == 58: return TagEnableDebugger()
        elif type == 59: return TagDoInitAction()
        elif type == 60: return TagDefineVideoStream()
        elif type == 61: return TagVideoFrame()
        elif type == 63: return TagDebugID()
        elif type == 64: return TagEnableDebugger2()
        elif type == 65: return TagScriptLimits()
        elif type == 69: return TagFileAttributes()
        elif type == 70: return TagPlaceObject3()
        elif type == 73: return TagDefineFontAlignZones()
        elif type == 74: return TagCSMTextSettings()
        elif type == 75: return TagDefineFont3()
        elif type == 76: return TagSymbolClass()
        elif type == 77: return TagMetadata()
        elif type == 78: return TagDefineScalingGrid()
        elif type == 82: return TagDoABC()
        elif type == 83: return TagDefineShape4()
        elif type == 84: return TagDefineMorphShape2()
        elif type == 86: return TagDefineSceneAndFrameLabelData()
        elif type == 87: return TagDefineBinaryData()
        elif type == 88: return TagDefineFontName()
        elif type == 89: return TagStartSound2()
        else: return None
415802
def build_url(uri, opts={})
      path     = opts[:path] || ''
      query    = opts[:params] || {}
      fragment = opts[:fragment] || {}
      url = Addressable::URI.parse uri
      url.path = path
      url.query_values = query unless query.empty?
      url.fragment = Addressable::URI.form_encode(fragment) unless fragment.empty?
      url.to_s
    end
1360720
def get_or_create_iobject(identifier_uid,
                          identifier_namespace_uri,
                          iobject_type_name,
                          iobject_type_namespace_uri,
                          iobject_type_revision_name,
                          iobject_family_name,
                          iobject_family_revision_name="",
                          identifier_namespace_name="",
                          timestamp=None,
                          create_timestamp=None,
                          overwrite=False,
                          dingos_class_map=dingos_class_map):
    

    # create or retrieve the iobject type and revision

    # create or retrieve identifier

    if not timestamp:
        raise StandardError("You must supply a timestamp.")

    id_namespace, created = dingos_class_map['IdentifierNameSpace'].objects.get_or_create(uri=identifier_namespace_uri)

    if created and identifier_namespace_name:
        id_namespace.name = identifier_namespace_name
        id_namespace.save()

    identifier, created = dingos_class_map['Identifier'].objects.get_or_create(uid=identifier_uid,
                                                                              namespace=id_namespace,
                                                                              defaults={'latest': None})

    iobject_type_namespace, created = dingos_class_map['DataTypeNameSpace'].objects.get_or_create(uri=iobject_type_namespace_uri)

    iobject_family, created = dingos_class_map['InfoObjectFamily'].objects.get_or_create(name=iobject_family_name)
    iobject_family_revision, created = dingos_class_map['Revision'].objects.get_or_create(
        name=iobject_family_revision_name)

    # create or retrieve the iobject type
    iobject_type, created = dingos_class_map['InfoObjectType'].objects.get_or_create(name=iobject_type_name,
                                                                                    iobject_family=iobject_family,
                                                                                    namespace=iobject_type_namespace)
    iobject_type_revision, created = dingos_class_map['Revision'].objects.get_or_create(name=iobject_type_revision_name)

    if not create_timestamp:
        create_timestamp = timezone.now()
    #if not timestamp:
    #    timestamp = create_timestamp
    #    iobject = overwrite
    #    created = False



    iobject, created = dingos_class_map["InfoObject"].objects.get_or_create(identifier=identifier,
                                                                           timestamp=timestamp,
                                                                           defaults={'iobject_family': iobject_family,
                                                                                     'iobject_family_revision': iobject_family_revision,
                                                                                     'iobject_type': iobject_type,
                                                                                     'iobject_type_revision': iobject_type_revision,
                                                                                     'create_timestamp': create_timestamp})
    if created:
        iobject.set_name()
        iobject.save()
        identifier.latest = iobject
        identifier.save()


    elif overwrite:
        iobject.timestamp = timestamp
        iobject.create_timestamp = create_timestamp
        iobject.iobject_family = iobject_family
        iobject.iobject_family_revision = iobject_family_revision
        iobject.iobject_type = iobject_type
        iobject.iobject_type_revision = iobject_type_revision
        iobject.set_name()
        iobject.save()

    logger.debug(
        "Created iobject id with %s , ts %s (created was %s) and overwrite as %s" % (iobject.identifier, timestamp, created, overwrite))
    return iobject, created
442413
def _create_from_url(self):
        
        import aikif.toolbox.network_tools as mod_net
        mod_net.download_file_no_logon(self.input_data, 'temp_file.htm')
        with open('temp_file.htm', 'r') as f:
            self.content['data'] = f.read()
        lg.record_process('_create_from_url', 'read ' + self._calc_size_stats() + ' from ' + self.input_data)
1014404
def save_content_type_object(repo, schema, uuid, data):
    
    storage_manager = StorageManager(repo)
    model_class = deserialize(schema,
                              module_name=schema['namespace'])
    model = model_class(data)
    commit = storage_manager.store(model, 'Updated via PUT request.')
    return commit, model
1344855
private OntModel getGraphSparqlQuery(URI graphUri) {

        StringBuilder queryStr = new StringBuilder("CONSTRUCT { ?s ?p ?o } \n")
                .append("WHERE {\n");

        // Add named graph if necessary
        if (graphUri != null) {
            queryStr.append("GRAPH <").append(graphUri.toASCIIString()).append("> ");
        }
        queryStr.append("{ ?s ?p ?o } } \n");

        log.debug("Querying graph store: {}", queryStr.toString());

        Query query = QueryFactory.create(queryStr.toString());
        QueryExecution qe = QueryExecutionFactory.sparqlService(this.getSparqlQueryEndpoint().toASCIIString(), query);
        MonitoredQueryExecution qexec = new MonitoredQueryExecution(qe);
        // Note that we are not using the store specification here to avoid retrieving remote models
//        OntModel resultModel = ModelFactory.createOntologyModel();
        OntModel resultModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF);
        try {
            qexec.execConstruct(resultModel);
            return resultModel;
        } finally {
            qexec.close();
        }
    }
324988
def from_object(cls, obj):
        # type: (Any) -> UrlPath
        
        if isinstance(obj, UrlPath):
            return obj
        if isinstance(obj, _compat.string_types):
            return UrlPath.parse(obj)
        if isinstance(obj, PathParam):
            return UrlPath(obj)
        if isinstance(obj, (tuple, list)):
            return UrlPath(*obj)
        raise ValueError("Unable to convert object to UrlPath `%r`" % obj)
799405
def create(self, **kwargs):
        

        response = self.ghost.execute_post('%s/' % self._type_name, json={
            self._type_name: [
                kwargs
            ]
        })

        return self._model_type(response.get(self._type_name)[0])
1244676
def url(self):
        """"""
        if self.parent is None:
            # TODO: differing API Versions?
            pieces = [self.client.base_url, 'api', 'atlas', 'v2']
        else:
            pieces = [self.parent.url]

        pieces.append(self.model_class.path)
        return '/'.join(pieces)
433566
function getUriRaw() {
  const startPos = pos;
  const type = NodeType.RawType;
  const token = tokens[startPos];
  const line = token.ln;
  const column = token.col;
  let content = [];
  let l;

  while (pos < tokens[startPos].uri_raw_end) {
    if (checkInterpolation(pos) || checkVariable(pos)) break;
    else if (l = checkUriRawCharacters(pos)) pos += l;
    else break;
  }

  content = joinValues(startPos, pos - 1);

  return newNode(type, content, line, column);
}
1184204
def _object_url(self, objtype, objid):
        
        return "{base_url}/api/{api_version}/{controller}/{obj_id}".format(
            base_url=self._base_url(),
            api_version=self.api_version,
            controller=self._controller_name(objtype),
            obj_id=objid
        )
201805
def type_and_model_to_query(self, request):
        
        try:
            content_type_id = request.GET["content_type_id"]
            object_id = request.GET["object_id"]
        except KeyError:
            return HttpResponseBadRequest()

        try:
            content_type = ContentType.objects.get(pk=content_type_id)
            model = content_type.model_class()
            result = model.objects.get(pk=object_id)
        except ObjectDoesNotExist:
            data = ""
        else:
            data = '%s: "%d: %s"' % (content_type.model, result.pk, result)

        return JsonResponse({"query": data})
1247231
def _guess_content_type(url):
    '''
    
    '''
    OCTET_STREAM = 'application/octet-stream'
    n = url.rfind('.')
    if n == -1:
        return OCTET_STREAM
    return mimetypes.types_map.get(url[n:].lower(), OCTET_STREAM)
219848
function getSourceType(url) {
        var origin = url;
        url = url.toLowerCase();

        if (url.match(/\.(jpeg|jpg|gif|png|apn|webp|svg)$/) !== null) {
            return 'image';
        }
        if (url.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)) {
            return 'video';
        }
        if (url.match(/vimeo\.com\/([0-9]*)/)) {
            return 'video';
        }
        if (url.match(/\.(mp4|ogg|webm)$/) !== null) {
            return 'video';
        }

        // Check if inline content
        if (url.indexOf("#") > -1) {
            var hash = origin.split('#').pop();
            if (hash.trim() !== '') {
                return 'inline';
            }
        }
        // Ajax
        if (url.includes("gajax=true")) {
            return 'ajax';
        }

        return 'external';
    }