This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nest_asyncio | |
import aiohttp | |
import asyncio | |
from jsonpath_ng import jsonpath, parse | |
from types import SimpleNamespace | |
from typing import List | |
import textwrap | |
nest_asyncio.apply() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
from typing import Callable | |
def findSomeItemsByPredicate( | |
someApi: SomeApi, | |
predicate: Callable[[Something],Something] ) -> Union[None, list[Something]: | |
def getOnePage( pageIndex: int ): | |
# fetch the requested page of Something items, if any |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import compress | |
from jira import JIRA | |
import json | |
import keyring | |
import argparse | |
import os | |
from dateutil import parser | |
from datetime import datetime | |
import pytz | |
from tzlocal import get_localzone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
import sys | |
import re | |
import json | |
from googleapiclient.discovery import build | |
from google.oauth2.credentials import Credentials | |
from google.auth.transport.requests import Request | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from dateutil import parser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element | |
import com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype | |
import com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper | |
import com.nomagic.magicdraw.core.Application | |
import com.nomagic.magicdraw.openapi.uml.SessionManager | |
def elided = { str -> | |
if (str.length() > 20) { | |
return str[0..9] + '...' + str[-10..-1] | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g.V().has( 'ArtifactType', 'sLabel', 'ArtifactType' ) | |
.match( | |
__.as( 'at' ).has( 'name' ).filter{ it.get().value('name') ==~ /(?i).*?requirement.*/ }, | |
__.as( 'at' ).out( 'ownedBy' ).as( 'or' ), | |
__.as( 'or' ).in( 'ownedBy' ).hasLabel( 'Container' ).as( 'c' ), | |
__.as( 'or' ).has( 'externalId' ).filter{ | |
it.get().value( 'externalId' ).contains( 'http' ) }.filter{ | |
{ u -> try { headRequest = new URL( u ).openConnection(); headRequest.setConnectTimeout( 1000 ); headRequest.setRequestMethod( "HEAD" ); return headRequest.getResponseCode() in [ 200, 401 ] } catch (e) { return false } }( it.get().value( 'externalId' ) ) }, | |
__.as( 'or' ).out( 'hasType' ).as( 'rt' ) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g.V().match( | |
__.as( 'dngRepoType' ).has( 'RepositoryType', 'name', 'DOORS-NG Repository Type' ), | |
__.as( 'dngRepoType' ).in( 'hasType' ).hasLabel( 'Repository' ).as( 'dngRepo' ), | |
__.as( 'dngRepo' ).in( 'ownedBy' ).hasLabel( 'ArtifactType' ) | |
.filter{ it.get().value('name') ==~ /(?i).*?requirement.*/ }.as( 'dngReqType' ), | |
__.as( 'dngReqType' ).in( 'hasType' ).hasLabel( 'Artifact' ).as( 'dng' ), | |
__.as( 'dng' ).both( 'Relation' ).hasLabel( 'Artifact' ).has( 'type' ).as( 'sysML' ), | |
__.as( 'sysML' ).out( 'hasType' ).hasLabel( 'ArtifactType' ) | |
.filter{ it.get().value('name') ==~ /(?i).*?requirement.*/ }.as( 'sysMLtype' ), | |
__.as( 'sysMLtype' ).out( 'ownedBy' ).as( 'sysMLrepo' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g.E().has( 'Relation', 'container', 'Drone-006' ).bothV().dedup() | |
.where( and( | |
out( 'hasType' ), | |
out( 'ownedBy' ).or( | |
has( 'name', 'DronesFlow' ), | |
has( 'name', 'Drone_MDO_With_Mid_Fid_Aero' ), | |
has( 'name', 'Esteco_Drone03-StructureAndParametrics_a' ) ) ) ) | |
.group().by( out( 'hasType' ).values( 'name' ) ).by( count() ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
userName = { u,t -> userGet = new URL( "http://syndeia.company.com:9000/users/${u}" ).openConnection(); userGet.setRequestProperty( "Accept", "application/json" ); userGet.setRequestProperty( "X-Auth-Token", t ); userGet.getResponseCode(); j = new groovy.json.JsonSlurper().parseText( userGet.getInputStream().getText() ); j.resources.name } | |
signInToken = { -> signInPost = new URL( "http://syndeia.company.com:9000/signIn" ).openConnection(); message = '{ "username": "[email protected]", "password": "pass-phrase", "rememberMe": false }'; signInPost.setDoOutput( true ); signInPost.setRequestProperty( "Content-Type", "application/json" ); signInPost.getOutputStream().write( message.getBytes( "UTF-8" ) ); signInPost.getResponseCode(); j = new groovy.json.JsonSlurper().parseText( signInPost.getInputStream().getText() ); j.resources.token } | |
g.E().has( 'Relation', 'container', 'DZSB19' ) | |
.group() | |
.by( values( 'modifiedDate' ) | |
.map{ ( LocalDateTime.parse( it.get(), java.time.format.DateTimeFormatter.IS |
NewerOlder