def Func ( arg_0 , arg_1 ) : if arg_0 . is_connecting or arg_0 . is_closed or arg_0 . is_reconnecting : return if arg_0 . options [ "allow_reconnect" ] and arg_0 . is_connected : arg_0 . _status = Client . RECONNECTING arg_0 . _ps . reset ( ) if arg_0 . _reconnection_task is not None and not arg_0 . _reconnection_task . cancelled ( ) : arg_0 . _reconnection_task . cancel ( ) arg_0 . _reconnection_task = arg_0 . _loop . create_task ( arg_0 . _attempt_reconnect ( ) ) else : arg_0 . _process_disconnect ( ) arg_0 . _err = arg_1 yield from arg_0 . _close ( Client . CLOSED , True )

def Func(arg_0, arg_1):
        """
        Process errors which occured while reading or parsing
        the protocol. If allow_reconnect is enabled it will
        try to switch the server to which it is currently connected
        otherwise it will disconnect.
        """
        if arg_0.is_connecting or arg_0.is_closed or arg_0.is_reconnecting:
            return

        if arg_0.options["allow_reconnect"] and arg_0.is_connected:
            arg_0._status = Client.RECONNECTING
            arg_0._ps.reset()

            if arg_0._reconnection_task is not None and not arg_0._reconnection_task.cancelled():
                # Cancel the previous task in case it may still be running.
                arg_0._reconnection_task.cancel()

            arg_0._reconnection_task = arg_0._loop.create_task(arg_0._attempt_reconnect())
        else:
            arg_0._process_disconnect()
            arg_0._err = arg_1
            yield from arg_0._close(Client.CLOSED, True)

Process errors which occured while reading or parsing the protocol . If allow_reconnect is enabled it will try to switch the server to which it is currently connected otherwise it will disconnect .


def
Func
(
arg_0
)
:
def
starts_with
(
arg_1
)
:
validate
(
text
,
arg_1
)
if
not
arg_1
.
Func
(
arg_0
)
:
raise
ValueError
(
"'{0}' does not start with '{1}'"
.
format
(
arg_1
,
arg_0
)
)
return
True
return
starts_with

def Func(arg_0):
    """Checks if the string value starts with another string."""
    def starts_with(arg_1):
        validate(text, arg_1)
        if not arg_1.Func(arg_0):
            raise ValueError("'{0}' does not start with '{1}'".format(arg_1, arg_0))
        return True

    return starts_with

Checks if the string value starts with another string .


def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_0 . _set_as_user ( arg_2 ) arg_3 = { 'Accept' : 'application/json' , 'Connection' : 'keep-alive' } arg_1 = arg_1 + arg_0 . _params ( arg_2 ) arg_4 = DAO . deleteURL ( arg_1 , arg_3 ) if not ( arg_4 . status == 200 or arg_4 . status == 204 ) : raise DataFailureException ( arg_1 , arg_4 . status , arg_4 . data ) return arg_4

def Func(arg_0, arg_1):
        """
        Canvas DELETE method.
        """
        arg_2 = {}
        arg_0._set_as_user(arg_2)
        arg_3 = {'Accept': 'application/json',
                   'Connection': 'keep-alive'}
        arg_1 = arg_1 + arg_0._params(arg_2)
        arg_4 = DAO.deleteURL(arg_1, arg_3)

        if not (arg_4.status == 200 or arg_4.status == 204):
            raise DataFailureException(arg_1, arg_4.status, arg_4.data)

        return arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = get_resource ( 'node' ) arg_3 = arg_2 . list ( workflow_job_template = arg_1 , all_pages = True ) [ 'results' ] return arg_0 . _workflow_node_structure ( arg_3 )

def Func(arg_0, arg_1):
        """
        Returns a dictionary that represents the node network of the
        workflow job template
        """
        arg_2 = get_resource('node')
        arg_3 = arg_2.list(workflow_job_template=arg_1,
                                     all_pages=True)['results']
        return arg_0._workflow_node_structure(arg_3)


(store, user_obj, case_obj, add_gender, add_features, add_disorders, genes_only,
    mme_base_url, mme_accepts, mme_token)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6,
    arg_7, arg_8, arg_9):
    """Add a patient to MatchMaker server

    Args:
        store(adapter.MongoAdapter)
        user_obj(dict) a scout user object (to be added as matchmaker contact)
        case_obj(dict) a scout case object
        add_gender(bool) if True case gender will be included in matchmaker
        add_features(bool) if True HPO features will be included in matchmaker
        add_disorders(bool) if True OMIM diagnoses will be included in matchmaker
        genes_only(bool) if True only genes and not variants will be shared
        mme_base_url(str) base url of the MME server
        mme_accepts(str) request content accepted by MME server
        mme_token(str) auth token of the MME server

    Returns:
        submitted_info(dict) info submitted to MatchMaker and its responses
    """

    if not arg_7 or not arg_8 or not arg_9:
        return 'Please check that Matchmaker connection parameters are valid'
    arg_10 = ''.join([arg_7, '/patient/add'])
    arg_11 = []   # this is the list of HPO terms
    arg_12 = []  # this is the list of OMIM diagnoses
    arg_13 = []

     # create contact dictionary
    arg_14 = {
        'name' : arg_1['name'],
        'href' : ''.join( ['mailto:',arg_1['email']] ),
        'institution' : 'Scout software user, Science For Life Laboratory, Stockholm, Sweden'
    }
    if arg_4: # create features dictionaries
        arg_11 = hpo_terms(arg_2)

    if arg_5: # create OMIM disorders dictionaries
        arg_12 = omim_terms(arg_2)

    # send a POST request and collect response for each affected individual in case
    arg_15 = []

    arg_16 = {
        'contact' : arg_14,
        'sex' : arg_3,
        'features' : arg_11,
        'disorders' : arg_12,
        'genes_only' : arg_6,
        'patient_id' : []
    }
    for arg_17 in arg_2.get('individuals'):
        if not arg_17['phenotype'] in  [2, 'affected']: # include only affected individuals
            continue

        arg_18 = {
            'contact' : arg_14,
            'id' : '.'.join([arg_2['_id'], arg_17.get('individual_id')]), # This is a required field form MME
            'label' : '.'.join([arg_2['display_name'], arg_17.get('display_name')]),
            'features' : arg_11,
            'disorders' : arg_12
        }
        if arg_3:
            if arg_17['sex'] == '1':
                arg_18['sex'] = 'MALE'
            else:
                arg_18['sex'] = 'FEMALE'

        if arg_2.get('suspects'):
            arg_13 = genomic_features(arg_0, arg_2, arg_17.get('display_name'), arg_6)
            arg_18['genomicFeatures'] = arg_13

        # send add request to server and capture response
        arg_19 = matchmaker_request(arg_10=arg_10, token=arg_9, method='POST', content_type=arg_8,
            accept='application/json', data={'patient':arg_18})

        arg_15.append({
                'patient': arg_18,
                'message': arg_19.get('message'),
                'status_code' : arg_19.get('status_code')
            })
    arg_16['server_responses'] = arg_15
    return arg_16


def Func ( arg_0 = None ) : arg_1 = ver_check ( ) arg_2 = arg_0 or docopt ( __doc__ , arg_1 = arg_1 ) _set_global_verbosity_level ( arg_2 . get ( '--verbose' ) ) Func_lgr . debug ( arg_2 ) Func_run ( arg_2 )

def Func(arg_0=None):
    """Main entry point for script."""
    arg_1 = ver_check()
    arg_2 = arg_0 or docopt(__doc__, arg_1=arg_1)
    _set_global_verbosity_level(arg_2.get('--verbose'))
    Func_lgr.debug(arg_2)
    Func_run(arg_2)


def Func(arg_0, arg_1=arg_2.AlgorithmTypes.regression):
    """
    Extracts features and generates predictors based on a given predictor set
    predictor_set - a PredictorSet object that has been initialized with data
    type - one of util_functions.AlgorithmType
    """
    if(arg_1 not in [arg_2.AlgorithmTypes.regression, arg_2.AlgorithmTypes.classification]):
        arg_1 = arg_2.AlgorithmTypes.regression

    arg_5 = predictor_extractor.PredictorExtractor()
    arg_5.initialize_dictionaries(arg_0)

    arg_6 = arg_5.gen_feats(arg_0)

    arg_7,arg_8 = get_algorithms(arg_1)
    arg_9=get_cv_error(arg_8,arg_6,arg_0._target)

    try:
        arg_10 = numpy.asarray(arg_0._target, dtype=numpy.int)
        arg_7.fit(arg_6, arg_10)
    except ValueError:
        log.exception("Not enough classes (0,1,etc) in sample.")
        arg_10 = arg_0._target
        arg_10[0]=1
        arg_10[1]=0
        arg_7.fit(arg_6, arg_10)

    return arg_5, arg_7, arg_9

Extracts features and generates predictors based on a given predictor set predictor_set - a PredictorSet object that has been initialized with data type - one of util_functions . AlgorithmType


return set([mount for mount in mounts if isinstance(mount, mount_param_type)])

def Func ( arg_0 , arg_1 ) : return set ( [ arg_2 for arg_2 in arg_0 if isinstance ( arg_2 , arg_1 ) ] )

def Func(arg_0, arg_1):
  """Helper function to return an appropriate set of mount parameters."""
  return set([arg_2 for arg_2 in arg_0 if isinstance(arg_2, arg_1)])

Helper function to return an appropriate set of mount parameters .


get_installdir returns the installation directory of the application

def Func ( ) : return os . path . abspath ( os . path . dirname ( os . path . dirname ( __file__ ) ) )

def Func():
    '''Func returns the installation directory of the application
    '''
    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


(self, institute, case=None, variant_id=None, level=None,
               comments=False, panel=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
               arg_5=False, arg_6=None):
        """Fetch Func from the database.

          Args:
            institute (dict): A institute
            case (dict): A case
            variant_id (str, optional): global variant id
            level (str, optional): restrict comments to 'specific' or 'global'
            comments (bool, optional): restrict Func to include only comments
            panel (str): A panel name

          Returns:
              pymongo.Cursor: Query result
        """

        arg_7 = {}

        if arg_3:
            if arg_5:
                # If it's comment-related event collect global and variant-specific comment Func
                LOG.debug("Fetching all comments for institute {0} case {1} variant {2}".format(
                          arg_1['_id'], arg_2['_id'], arg_3))
                arg_7 = {
                    '$or': [
                        {
                            'category' : 'variant',
                            'variant_id' : arg_3,
                            'verb' : 'comment',
                            'level' : 'global'
                        },
                        {
                            'category' : 'variant',
                            'variant_id' : arg_3,
                            'institute' : arg_1['_id'],
                            'case' : arg_2['_id'],
                            'verb' : 'comment',
                            'level' : 'specific'
                        }
                    ]
                }
            else: # Collect other variant-specific Func which are not comments
                arg_7['institute'] = arg_1['_id']
                arg_7['category'] = 'variant'
                arg_7['variant_id'] = arg_3
                arg_7['case'] = arg_2['_id']
        else:
            arg_7['institute'] = arg_1['_id']
            if arg_6:
                arg_7['panel'] = arg_6
            # If no variant_id or panel we know that it is a case level comment
            else:
                arg_7['category'] = 'case'

                if arg_2:
                    arg_7['case'] = arg_2['_id']

                if arg_5:
                    arg_7['verb'] = 'comment'

        return arg_0.event_collection.find(arg_7).sort('created_at', pymongo.DESCENDING)

Fetch events from the database.

          Args:
            institute (dict): A institute
            case (dict): A case
            variant_id (str, optional): global variant id
            level (str, optional): restrict comments to 'specific' or 'global'
            comments (bool, optional): restrict events to include only comments
            panel (str): A panel name

          Returns:
              pymongo.Cursor: Query result


def Func(arg_0, arg_1, arg_2, arg_3):
        """Remember the recipients."""
        arg_4.msg_from = arg_1
        arg_4.msg_to = arg_2
        arg_4.msg = arg_3


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
local_renderer
arg_2
=
arg_0
.
last_manifest
arg_3
=
arg_2
.
fingerprint
arg_4
=
arg_0
.
get_target_geckodriver_version_number
(
)
arg_0
.
vprint
(
'last_fingerprint:'
,
arg_3
)
arg_0
.
vprint
(
'current_fingerprint:'
,
arg_4
)
if
arg_3
!=
arg_4
:
print
(
'A new release is available. %s'
%
arg_0
.
get_most_recent_version
(
)
)
return
True
print
(
'No updates found.'
)
return
False

def Func(arg_0):
        """
        Determines if a new release has been made.
        """
        arg_1 = arg_0.local_renderer
        arg_2 = arg_0.last_manifest
        arg_3 = arg_2.fingerprint
        arg_4 = arg_0.get_target_geckodriver_version_number()
        arg_0.vprint('last_fingerprint:', arg_3)
        arg_0.vprint('current_fingerprint:', arg_4)
        if arg_3 != arg_4:
            print('A new release is available. %s' % arg_0.get_most_recent_version())
            return True
        print('No updates found.')
        return False

Determines if a new release has been made .


def Func(arg_0,arg_1=False):
        """make sure a Func is ready."""
        if plt._pylab_helpers.Gcf.get_num_fig_managers()>0 and arg_1 is False:
            arg_0.log.debug("Func already seen, not creating one.")
            return

        if arg_0.subplot:
            arg_0.log.debug("subplot mode enabled, not creating new Func")
        else:
            arg_0.log.debug("creating new Func")
            plt.Func(figsize=(arg_0.Func_width,arg_0.Func_height))


def Func(arg_0, arg_1):
        """
        Handle an AJAX toggle_boolean request
        """
        try:
            arg_2 = int(arg_1.POST.get('item_id', None))
            arg_3 = str(arg_1.POST.get('attr', None))
        except:
            return HttpResponseBadRequest("Malformed request")

        if not arg_1.user.is_staff:
            logging.warning("Denied AJAX request by non-staff %s to toggle boolean %s for object #%s", arg_1.user,
                            arg_3, arg_2)
            return HttpResponseForbidden("You do not have permission to access this object")

        arg_0._collect_editable_booleans()

        if not arg_0._ajax_editable_booleans.has_key(arg_3):
            return HttpResponseBadRequest("not a valid attribute %s" % arg_3)

        try:
            arg_4 = arg_0.model._default_manager.get(pk=arg_2)
        except arg_0.model.DoesNotExist:
            return HttpResponseNotFound("Object does not exist")

        arg_5 = False

        if hasattr(arg_4, "user_can") and arg_4.user_can(arg_1.user, change_page=True):
            # Was added in c7f04dfb5d, but I've no idea what user_can is about.
            arg_5 = True
        else:
            arg_5 = arg_0.has_change_permission(arg_1, arg_4=arg_4)

        if not arg_5:
            logging.warning("Denied AJAX request by %s to toggle boolean %s for object %s", arg_1.user, arg_3, arg_2)
            return HttpResponseForbidden("You do not have permission to access this object")

        logging.info("Processing request by %s to toggle %s on %s", arg_1.user, arg_3, arg_4)

        try:
            arg_6 = arg_0._ajax_editable_booleans[arg_3](arg_0, arg_4)

            setattr(arg_4, arg_3, not getattr(arg_4, arg_3))
            arg_4.save()

            arg_0._refresh_changelist_caches() # ???: Perhaps better a post_save signal?

            # Construct html snippets to send back to client for status update
            arg_7 = arg_0._ajax_editable_booleans[arg_3](arg_0, arg_4)

        except Exception:#, e:
            logging.exception("Unhandled exception while toggling %s on %s", arg_3, arg_4)
            return HttpResponseServerError("Unable to toggle %s on %s" % (arg_3, arg_4))

        # Weed out unchanged cells to keep the updates small. This assumes
        # that the order a possible get_descendents() returns does not change
        # before and after toggling this attribute. Unlikely, but still...
        arg_8 = []
        for arg_9, arg_10 in zip(arg_6, arg_7):
            if arg_9 != arg_10:
                arg_8.append(arg_10)

        # TODO: Shorter: [ y for x,y in zip(a,b) if x!=y ]
        return HttpResponse(json.dumps(arg_8), mimetype="application/json")


def
Func
(
arg_0
)
:
arg_0
.
logger
.
info
(
"Attempting connection to %s:%s"
,
arg_0
.
server
[
0
]
,
arg_0
.
server
[
1
]
)
try
:
arg_0
.
_open_socket
(
)
arg_1
=
arg_0
.
sock
.
getpeername
(
)
arg_0
.
logger
.
info
(
"Connected to %s"
,
str
(
arg_1
)
)
arg_0
.
sock
.
setblocking
(
1
)
arg_0
.
sock
.
settimeout
(
5
)
arg_0
.
sock
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_KEEPALIVE
,
1
)
arg_2
=
arg_0
.
sock
.
recv
(
512
)
if
is_py3
:
arg_2
=
arg_2
.
decode
(
'latin-1'
)
if
arg_2
[
0
]
==
"#"
:
arg_0
.
logger
.
debug
(
"Banner: %s"
,
arg_2
.
rstrip
(
)
)
else
:
raise
ConnectionError
(
"invalid banner from server"
)
except
ConnectionError
as
e
:
arg_0
.
logger
.
error
(
str
(
e
)
)
arg_0
.
close
(
)
raise
except
(
socket
.
error
,
socket
.
timeout
)
as
e
:
arg_0
.
close
(
)
arg_0
.
logger
.
error
(
"Socket error: %s"
%
str
(
e
)
)
if
str
(
e
)
==
"timed out"
:
raise
ConnectionError
(
"no banner from server"
)
else
:
raise
ConnectionError
(
e
)
arg_0
.
Funced
=
True

def Func(arg_0):
        """
        Attemps connection to the server
        """

        arg_0.logger.info("Attempting connection to %s:%s", arg_0.server[0], arg_0.server[1])

        try:
            arg_0._open_socket()

            arg_1 = arg_0.sock.getpeername()

            arg_0.logger.info("Connected to %s", str(arg_1))

            # 5 second timeout to receive server banner
            arg_0.sock.setblocking(1)
            arg_0.sock.settimeout(5)

            arg_0.sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)

            arg_2 = arg_0.sock.recv(512)
            if is_py3:
                arg_2 = arg_2.decode('latin-1')

            if arg_2[0] == "#":
                arg_0.logger.debug("Banner: %s", arg_2.rstrip())
            else:
                raise ConnectionError("invalid banner from server")

        except ConnectionError as e:
            arg_0.logger.error(str(e))
            arg_0.close()
            raise
        except (socket.error, socket.timeout) as e:
            arg_0.close()

            arg_0.logger.error("Socket error: %s" % str(e))
            if str(e) == "timed out":
                raise ConnectionError("no banner from server")
            else:
                raise ConnectionError(e)

        arg_0.Funced = True


(self, username=None, reponame=None, key=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : if arg_3 is None : arg_3 = arg_0 . key ( arg_1 , arg_2 ) if arg_3 not in arg_0 . repos : raise UnknownRepository ( ) return arg_0 . repos [ arg_3 ]

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        Lookup all available repos
        """
        if arg_3 is None:
            arg_3 = arg_0.key(arg_1, arg_2)
        if arg_3 not in arg_0.repos:
            raise UnknownRepository()

        return arg_0.repos[arg_3]


def Func(arg_0, arg_1, arg_2="cubic"):
        """
        Resize the segmentation map array to the provided size given the provided interpolation.

        Parameters
        ----------
        sizes : float or iterable of int or iterable of float
            New size of the array in ``(height, width)``.
            See :func:`imgaug.imgaug.imFunc_single_image` for details.

        interpolation : None or str or int, optional
            The interpolation to use during Func.
            See :func:`imgaug.imgaug.imFunc_single_image` for details.
            Note: The segmentation map is internally stored as multiple float-based heatmaps,
            making smooth interpolations potentially more reasonable than nearest neighbour
            interpolation.

        Returns
        -------
        segmap : imgaug.SegmentationMapOnImage
            Resized segmentation map object.

        """
        arg_3 = ia.imFunc_single_image(arg_0.arr, arg_1, arg_2=arg_2)

        # cubic interpolation can lead to values outside of [0.0, 1.0],
        # see https://github.com/opencv/opencv/issues/7195
        # TODO area interpolation too?
        arg_3 = np.clip(arg_3, 0.0, 1.0)
        arg_4 = SegmentationMapOnImage(arg_3, shape=arg_0.shape)
        arg_4.input_was = arg_0.input_was
        return arg_4

Resize the segmentation map array to the provided size given the provided interpolation.

        Parameters
        ----------
        sizes : float or iterable of int or iterable of float
            New size of the array in ``(height, width)``.
            See :func:`imgaug.imgaug.imresize_single_image` for details.

        interpolation : None or str or int, optional
            The interpolation to use during resize.
            See :func:`imgaug.imgaug.imresize_single_image` for details.
            Note: The segmentation map is internally stored as multiple float-based heatmaps,
            making smooth interpolations potentially more reasonable than nearest neighbour
            interpolation.

        Returns
        -------
        segmap : imgaug.SegmentationMapOnImage
            Resized segmentation map object.

Resize the segmentation map array to the provided size given the provided interpolation .


def Func ( arg_0 , arg_1 , ** arg_2 ) : if arg_2 [ 'created' ] and not arg_1 . content_filter : arg_1 . content_filter = get_default_catalog_content_filter ( ) arg_1 . save ( )

def Func(arg_0, arg_1, **arg_2):     # pylint: disable=unused-argument
    """
    Set default value for `EnterpriseCustomerCatalog.content_filter` if not already set.
    """
    if arg_2['created'] and not arg_1.content_filter:
        arg_1.content_filter = get_default_catalog_content_filter()
        arg_1.save()

Set default value for EnterpriseCustomerCatalog . content_filter if not already set .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = list ( range ( arg_0 . ndim ) ) arg_3 [ arg_1 ] = arg_2 arg_3 [ arg_2 ] = arg_1 return arg_0 . transpose ( arg_3 )

def Func(arg_0, arg_1, arg_2):
        """
        Return the array with two axes interchanged.

        Parameters
        ----------
        axis1 : int
            The first axis to swap

        axis2 : int
            The second axis to swap
        """
        arg_3 = list(range(arg_0.ndim))
        arg_3[arg_1] = arg_2
        arg_3[arg_2] = arg_1

        return arg_0.transpose(arg_3)

Return the array with two axes interchanged .


def Func(arg_0, arg_1):
        """Load word from memory"""
        arg_0._allocate(arg_1, 32)
        arg_2 = arg_0._load(arg_1, 32)
        return arg_2


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = utils . BytearrayStream ( ) if arg_0 . _unique_identifier : arg_0 . _unique_identifier . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . _lease_time : arg_0 . _lease_time . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . _last_change_date : arg_0 . _last_change_date . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . length = arg_6 . length ( ) super ( ObtainLeaseResponsePayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 . Func ( arg_6 . buffer )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the ObtainLease response payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is not defined.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._unique_identifier:
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._lease_time:
            arg_0._lease_time.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._last_change_date:
            arg_0._last_change_date.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.length = arg_6.length()
        super(ObtainLeaseResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the ObtainLease response payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is not defined.

Write the data encoding the ObtainLease response payload to a stream .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
pop
(
'formatter'
,
)
if
arg_2
:
try
:
arg_2
=
arg_0
.
config
[
'formatters'
]
[
arg_2
]
except
StandardError
as
e
:
raise
ValueError
(
'Unable to set formatter '
'%r: %s'
%
(
arg_2
,
e
)
)
arg_3
=
arg_1
.
pop
(
'level'
,
)
arg_4
=
arg_1
.
pop
(
'filters'
,
)
if
'()'
in
arg_1
:
arg_5
=
arg_1
.
pop
(
'()'
)
if
not
hasattr
(
arg_5
,
'__call__'
)
and
hasattr
(
types
,
'ClassType'
)
and
type
(
arg_5
)
!=
types
.
ClassType
:
arg_5
=
arg_0
.
resolve
(
arg_5
)
arg_6
=
arg_5
else
:
arg_7
=
arg_0
.
resolve
(
arg_1
.
pop
(
'class'
)
)
if
issubclass
(
arg_7
,
logging
.
handlers
.
MemoryHandler
)
and
'target'
in
arg_1
:
try
:
arg_1
[
'target'
]
=
arg_0
.
config
[
'handlers'
]
[
arg_1
[
'target'
]
]
except
StandardError
as
e
:
raise
ValueError
(
'Unable to set target handler '
'%r: %s'
%
(
arg_1
[
'target'
]
,
e
)
)
elif
issubclass
(
arg_7
,
logging
.
handlers
.
SMTPHandler
)
and
'mailhost'
in
arg_1
:
arg_1
[
'mailhost'
]
=
arg_0
.
as_tuple
(
arg_1
[
'mailhost'
]
)
elif
issubclass
(
arg_7
,
logging
.
handlers
.
SysLogHandler
)
and
'address'
in
arg_1
:
arg_1
[
'address'
]
=
arg_0
.
as_tuple
(
arg_1
[
'address'
]
)
arg_6
=
arg_7
arg_8
=
dict
(
(
k
,
arg_1
[
k
]
)
for
k
in
arg_1
if
valid_ident
(
k
)
)
try
:
arg_9
=
arg_6
(
**
arg_8
)
except
TypeError
as
te
:
if
"'stream'"
not
in
str
(
te
)
:
raise
arg_8
[
'strm'
]
=
arg_8
.
pop
(
'stream'
)
arg_9
=
arg_6
(
**
arg_8
)
if
arg_2
:
arg_9
.
setFormatter
(
arg_2
)
if
arg_3
is
not
:
arg_9
.
setLevel
(
_checkLevel
(
arg_3
)
)
if
arg_4
:
arg_0
.
add_filters
(
arg_9
,
arg_4
)
return
arg_9

def Func(arg_0, arg_1):
        """Configure a handler from a dictionary."""
        arg_2 = arg_1.pop('formatter', None)
        if arg_2:
            try:
                arg_2 = arg_0.config['formatters'][arg_2]
            except StandardError as e:
                raise ValueError('Unable to set formatter '
                                 '%r: %s' % (arg_2, e))
        arg_3 = arg_1.pop('level', None)
        arg_4 = arg_1.pop('filters', None)
        if '()' in arg_1:
            arg_5 = arg_1.pop('()')
            if not hasattr(arg_5, '__call__') and hasattr(types, 'ClassType') and type(arg_5) != types.ClassType:
                arg_5 = arg_0.resolve(arg_5)
            arg_6 = arg_5
        else:
            arg_7 = arg_0.resolve(arg_1.pop('class'))
            # Special case for handler which refers to another handler
            if issubclass(arg_7, logging.handlers.MemoryHandler) and\
                'target' in arg_1:
                try:
                    arg_1['target'] = arg_0.config['handlers'][arg_1['target']]
                except StandardError as e:
                    raise ValueError('Unable to set target handler '
                                     '%r: %s' % (arg_1['target'], e))
            elif issubclass(arg_7, logging.handlers.SMTPHandler) and\
                'mailhost' in arg_1:
                arg_1['mailhost'] = arg_0.as_tuple(arg_1['mailhost'])
            elif issubclass(arg_7, logging.handlers.SysLogHandler) and\
                'address' in arg_1:
                arg_1['address'] = arg_0.as_tuple(arg_1['address'])
            arg_6 = arg_7
        arg_8 = dict((k, arg_1[k]) for k in arg_1 if valid_ident(k))
        try:
            arg_9 = arg_6(**arg_8)
        except TypeError as te:
            if "'stream'" not in str(te):
                raise
            # The argument name changed from strm to stream
            # Retry with old name.
            # This is so that code can be used with older Python versions
            #(e.g. by Django)
            arg_8['strm'] = arg_8.pop('stream')
            arg_9 = arg_6(**arg_8)
        if arg_2:
            arg_9.setFormatter(arg_2)
        if arg_3 is not None:
            arg_9.setLevel(_checkLevel(arg_3))
        if arg_4:
            arg_0.add_filters(arg_9, arg_4)
        return arg_9


def
Func
(
arg_0
,
arg_1
)
:
if
'b'
not
in
arg_1
.
mode
:
raise
ValueError
(
"File has to be opened in binary mode."
)
arg_2
=
arg_0
.
_upload_url
if
arg_1
.
peek
(
1
)
:
arg_3
=
arg_0
.
_put
(
arg_2
,
data
=
arg_1
)
else
:
arg_3
=
arg_0
.
_put
(
arg_2
,
data
=
b''
)
if
arg_3
.
status_code
!=
200
:
arg_4
=
(
'Could not Func {} (status '
'code: {}).'
.
format
(
arg_0
.
path
,
arg_3
.
status_code
)
)
raise
RuntimeError
(
arg_4
)

def Func(arg_0, arg_1):
        """Update the remote file from a local file.

        Pass in a filepointer `fp` that has been opened for writing in
        binary mode.
        """
        if 'b' not in arg_1.mode:
            raise ValueError("File has to be opened in binary mode.")

        arg_2 = arg_0._upload_url
        # peek at the file to check if it is an ampty file which needs special
        # handling in requests. If we pass a file like object to data that
        # turns out to be of length zero then no file is created on the OSF
        if arg_1.peek(1):
            arg_3 = arg_0._put(arg_2, data=arg_1)
        else:
            arg_3 = arg_0._put(arg_2, data=b'')

        if arg_3.status_code != 200:
            arg_4 = ('Could not Func {} (status '
                   'code: {}).'.format(arg_0.path, arg_3.status_code))
            raise RuntimeError(arg_4)

Update the remote file from a local file .


def Func(arg_0, arg_1):
        """Parses one line of data file"""
        if arg_1[0] not in "#=":
            arg_2 = arg_1.split()
            arg_3 = arg_1[30:-1]
            arg_4 = map_name(arg_2[1])
            if not arg_0.case_sensitive:
                arg_4 = arg_4.lower()

            if arg_2[0] == "M":
                arg_0._set(arg_4, u"male", arg_3)
            elif arg_2[0] == "1M" or arg_2[0] == "?M":
                arg_0._set(arg_4, u"mostly_male", arg_3)
            elif arg_2[0] == "F":
                arg_0._set(arg_4, u"female", arg_3)
            elif arg_2[0] == "1F" or arg_2[0] == "?F":
                arg_0._set(arg_4, u"mostly_female", arg_3)
            elif arg_2[0] == "?":
                arg_0._set(arg_4, arg_0.unknown_value, arg_3)
            else:
                raise "Not sure what to do with a sex of %s" % arg_2[0]


def Func(arg_0, arg_1=None):
        """
        Determines the overall state of the DagRun based on the state
        of its TaskInstances.

        :return: State
        """

        arg_2 = arg_0.get_dag()

        arg_3 = arg_0.get_task_instances(arg_1=arg_1)
        arg_0.log.debug("Updating state for %s considering %s task(s)", arg_0, len(arg_3))

        for arg_4 in list(arg_3):
            # skip in db?
            if arg_4.state == State.REMOVED:
                arg_3.remove(arg_4)
            else:
                arg_4.task = arg_2.get_task(arg_4.task_id)

        # pre-calculate
        # db is faster
        arg_6 = timezone.utcnow()
        arg_7 = arg_0.get_task_instances(
            state=State.unfinished(),
            arg_1=arg_1
        )
        arg_8 = all(not t.task.depends_on_past for t in arg_7)
        arg_9 = all(t.task.task_concurrency is None
                                    for t in arg_7)
        # small speed up
        if arg_7 and arg_8 and arg_9:
            # todo: this can actually get pretty slow: one task costs between 0.01-015s
            arg_10 = True
            for arg_11 in arg_7:
                # We need to flag upstream and check for changes because upstream
                # failures/re-schedules can result in deadlock false positives
                arg_12 = arg_11.state
                arg_13 = arg_11.are_dependencies_met(
                    dep_context=DepContext(
                        flag_upstream_failed=True,
                        ignore_in_retry_period=True,
                        ignore_in_reschedule_period=True),
                    arg_1=arg_1)
                if arg_13 or arg_12 != arg_11.current_state(arg_1=arg_1):
                    arg_10 = False
                    break

        arg_14 = (timezone.utcnow() - arg_6).total_seconds() * 1000
        Stats.timing("dagrun.dependency-check.{}".format(arg_0.dag_id), arg_14)

        arg_15 = [t.task_id for t in arg_2.roots]
        arg_16 = [t for t in arg_3 if t.task_id in arg_15]

        # if all roots finished and at least one failed, the run failed
        if (not arg_7 and
                any(arg_17.state in (State.FAILED, State.UPSTREAM_FAILED) for arg_17 in arg_16)):
            arg_0.log.info('Marking run %s failed', arg_0)
            arg_0.set_state(State.FAILED)
            arg_2.handle_callback(arg_0, success=False, reason='task_failure',
                                arg_1=arg_1)

        # if all roots succeeded and no unfinished tasks, the run succeeded
        elif not arg_7 and all(arg_17.state in (State.SUCCESS, State.SKIPPED)
                                          for arg_17 in arg_16):
            arg_0.log.info('Marking run %s successful', arg_0)
            arg_0.set_state(State.SUCCESS)
            arg_2.handle_callback(arg_0, success=True, reason='success', arg_1=arg_1)

        # if *all tasks* are deadlocked, the run failed
        elif (arg_7 and arg_8 and
              arg_9 and arg_10):
            arg_0.log.info('Deadlock; marking run %s failed', arg_0)
            arg_0.set_state(State.FAILED)
            arg_2.handle_callback(arg_0, success=False, reason='all_tasks_deadlocked',
                                arg_1=arg_1)

        # finally, if the roots aren't done, the dag is still running
        else:
            arg_0.set_state(State.RUNNING)

        arg_0._emit_duration_stats_for_finished_state()

        # todo: determine we want to use with_for_update to make sure to lock the run
        arg_1.merge(arg_0)
        arg_1.commit()

        return arg_0.state

Determines the overall state of the DagRun based on the state of its TaskInstances .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 while arg_3 >= 0 : arg_4 = arg_0 [ arg_3 ] if arg_4 in ')]}' : arg_2 . append ( arg_4 ) elif arg_4 == '>' : if ( arg_3 > 0 and ( arg_0 [ arg_3 - 1 ] == '-' or Match ( r'\s>=\s' , arg_0 [ arg_3 - 1 : ] ) or Search ( r'\boperator\s*$' , arg_0 [ 0 : arg_3 ] ) ) ) : arg_3 -= 1 else : arg_2 . append ( '>' ) elif arg_4 == '<' : if arg_3 > 0 and arg_0 [ arg_3 - 1 ] == '<' : arg_3 -= 1 else : if arg_2 and arg_2 [ - 1 ] == '>' : arg_2 . pop ( ) if not arg_2 : return ( arg_3 , None ) elif arg_4 in '([{' : while arg_2 and arg_2 [ - 1 ] == '>' : arg_2 . pop ( ) if not arg_2 : return ( - 1 , None ) if ( ( arg_4 == '(' and arg_2 [ - 1 ] == ')' ) or ( arg_4 == '[' and arg_2 [ - 1 ] == ']' ) or ( arg_4 == '{' and arg_2 [ - 1 ] == '}' ) ) : arg_2 . pop ( ) if not arg_2 : return ( arg_3 , None ) else : return ( - 1 , None ) elif arg_4 == ';' : while arg_2 and arg_2 [ - 1 ] == '>' : arg_2 . pop ( ) if not arg_2 : return ( - 1 , None ) arg_3 -= 1 return ( - 1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
  """Find position at the matching start of current expression.

  This is almost the reverse of FindEndOfExpressionInLine, but note
  that the input position and returned position differs by 1.

  Args:
    line: a CleansedLines line.
    endpos: start searching at this position.
    stack: nesting stack at endpos.

  Returns:
    On finding matching start: (index at matching start, None)
    On finding an unclosed expression: (-1, None)
    Otherwise: (-1, new stack at beginning of this line)
  """
  arg_3 = arg_1
  while arg_3 >= 0:
    arg_4 = arg_0[arg_3]
    if arg_4 in ')]}':
      # Found end of expression, push to expression stack
      arg_2.append(arg_4)
    elif arg_4 == '>':
      # Found potential end of template argument list.
      #
      # Ignore it if it's a "->" or ">=" or "operator>"
      if (arg_3 > 0 and
          (arg_0[arg_3 - 1] == '-' or
           Match(r'\s>=\s', arg_0[arg_3 - 1:]) or
           Search(r'\boperator\s*$', arg_0[0:arg_3]))):
        arg_3 -= 1
      else:
        arg_2.append('>')
    elif arg_4 == '<':
      # Found potential start of template argument list
      if arg_3 > 0 and arg_0[arg_3 - 1] == '<':
        # Left shift operator
        arg_3 -= 1
      else:
        # If there is a matching '>', we can pop the expression stack.
        # Otherwise, ignore this '<' since it must be an operator.
        if arg_2 and arg_2[-1] == '>':
          arg_2.pop()
          if not arg_2:
            return (arg_3, None)
    elif arg_4 in '([{':
      # Found start of expression.
      #
      # If there are any unmatched '>' on the stack, they must be
      # operators.  Remove those.
      while arg_2 and arg_2[-1] == '>':
        arg_2.pop()
      if not arg_2:
        return (-1, None)
      if ((arg_4 == '(' and arg_2[-1] == ')') or
          (arg_4 == '[' and arg_2[-1] == ']') or
          (arg_4 == '{' and arg_2[-1] == '}')):
        arg_2.pop()
        if not arg_2:
          return (arg_3, None)
      else:
        # Mismatched parentheses
        return (-1, None)
    elif arg_4 == ';':
      # Found something that look like end of statements.  If we are currently
      # expecting a '<', the matching '>' must have been an operator, since
      # template argument list should not contain statements.
      while arg_2 and arg_2[-1] == '>':
        arg_2.pop()
      if not arg_2:
        return (-1, None)

    arg_3 -= 1

  return (-1, arg_2)

Find position at the matching start of current expression .


def Func ( ) : if arg_0 . env_name is not None : return arg_0 . env_name == 'GCE_PRODUCTION' if NO_GCE_CHECK != 'True' and _detect_gce_environment ( ) : arg_0 . env_name = 'GCE_PRODUCTION' return True return False

def Func():
    """Detect if the code is running in the Compute Engine environment.

    Returns:
        True if running in the GCE environment, False otherwise.
    """
    if arg_0.env_name is not None:
        return arg_0.env_name == 'GCE_PRODUCTION'

    if NO_GCE_CHECK != 'True' and _detect_gce_environment():
        arg_0.env_name = 'GCE_PRODUCTION'
        return True
    return False

Detect if the code is running in the Compute Engine environment .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_0 . coverInclusive : if arg_1 . endswith ( ".py" ) : if arg_2 and arg_0 . coverPackages : for arg_3 in arg_0 . coverPackages : if arg_2 . startswith ( arg_3 ) : return True else : return True return None

def Func(arg_0, arg_1, arg_2=None):
        """If inclusive coverage enabled, return true for all source files
        in wanted packages.
        """
        if arg_0.coverInclusive:
            if arg_1.endswith(".py"):
                if arg_2 and arg_0.coverPackages:
                    for arg_3 in arg_0.coverPackages:
                        if arg_2.startswith(arg_3):
                            return True
                else:
                    return True
        return None

If inclusive coverage enabled return true for all source files in wanted packages .


return Operator(
            np.transpose(self.data), self.input_dims(), self.output_dims())

def Func ( arg_0 ) : return Operator ( np . Func ( arg_0 . data ) , arg_0 . input_dims ( ) , arg_0 . output_dims ( ) )

def Func(arg_0):
        """Return the Func of the operator."""
        return Operator(
            np.Func(arg_0.data), arg_0.input_dims(), arg_0.output_dims())


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_2 : arg_2 = { } arg_2 . update ( { 'login' : arg_0 . login , 'key' : arg_0 . key } ) arg_3 = requests . get ( arg_0 . api_url + arg_1 , arg_2 ) . json ( ) return arg_0 . _process_response ( arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        """Used by every other method, it makes a GET request with the given params.

        Args:
            url (str): relative path of a specific service (account_info, ...).
            params (:obj:`dict`, optional): contains parameters to be sent in the GET request.

        Returns:
            dict: results of the response of the GET request.

        """
        if not arg_2:
            arg_2 = {}

        arg_2.update({'login': arg_0.login, 'key': arg_0.key})

        arg_3 = requests.get(arg_0.api_url + arg_1, arg_2).json()

        return arg_0._process_response(arg_3)

Used by every other method it makes a GET request with the given params .


def Func(arg_0, arg_1=None):
        """Swaps two cities in the route.

        :type state: TSPState
        """
        arg_1 = arg_0.state if arg_1 is None else arg_1
        arg_2 = arg_1
        arg_3 = random.randint(arg_0.locked_range, len(arg_2) - 1)
        arg_4 = random.randint(arg_0.locked_range, len(arg_2) - 1)
        arg_2[arg_3], arg_2[arg_4] = arg_2[arg_4], arg_2[arg_3]


def Func ( arg_0 ) : arg_0 . _finder = FileFinder . path_hook ( ( arg_0 , [ arg_0 . suffix ] ) ) sys . path_hooks . append ( arg_0 . _finder )

def Func(arg_0):
        """
        Register the path hook.

        """

        arg_0._finder = FileFinder.path_hook((arg_0, [arg_0.suffix]))
        sys.path_hooks.append(arg_0._finder)


def Func(arg_0, arg_1):
        """
        Disables analog reporting for a single analog pin.

        :param pin: Analog pin number. For example for A0, the number is 0.

        :return: No return value
        """
        arg_2 = [arg_0._command_handler.REPORT_ANALOG + arg_1, arg_0.REPORTING_DISABLE]
        arg_0._command_handler.send_command(arg_2)

Disables analog reporting for a single analog pin .


return inspect.ArgSpec(args, varargs, varkw, func.func_defaults)

def Func(arg_0):
    """
    An `inspect.getargspec` with a relaxed sanity check to support Cython.

    Motivation:

        A Cython-compiled function is *not* an instance of Python's
        types.FunctionType.  That is the sanity check the standard Py2
        library uses in `inspect.getargspec()`.  So, an exception is raised
        when calling `argh.dispatch_command(cythonCompiledFunc)`.  However,
        the CyFunctions do have perfectly usable `.func_code` and
        `.func_defaults` which is all `inspect.getargspec` needs.

        This function just copies `inspect.getargspec()` from the standard
        library but relaxes the test to a more duck-typing one of having
        both `.func_code` and `.func_defaults` attributes.
    """
    if inspect.ismethod(arg_0):
        arg_0 = arg_0.im_func

    # Py2 Stdlib uses isfunction(func) which is too strict for Cython-compiled
    # functions though such have perfectly usable func_code, func_defaults.
    if not (hasattr(arg_0, "func_code") and hasattr(arg_0, "func_defaults")):
        raise TypeError('{!r} missing func_code or func_defaults'.format(arg_0))

    arg_1, arg_2, arg_3 = inspect.getargs(arg_0.func_code)
    return inspect.ArgSpec(arg_1, arg_2, arg_3, arg_0.func_defaults)

An inspect . getargspec with a relaxed sanity check to support Cython .


def Func ( arg_0 ) : arg_1 = { } arg_1 [ 'commit' ] = arg_0 [ 'commit' ] arg_1 [ 'tree' ] = arg_0 [ 'tree' ] arg_2 = arg_0 [ 'parents' ] arg_1 [ 'parents' ] = [ parse_parent_line ( parentline ) for parentline in arg_2 . splitlines ( ) ] arg_1 [ 'author' ] = parse_author_line ( arg_0 [ 'author' ] ) arg_1 [ 'committer' ] = Functer_line ( arg_0 [ 'committer' ] ) arg_3 = [ parse_message_line ( msgline ) for msgline in arg_0 [ 'message' ] . split ( "\n" ) ] arg_1 [ 'message' ] = "\n" . join ( msgline for msgline in arg_3 if msgline is not None ) arg_1 [ 'changes' ] = [ parse_numstat_line ( numstat ) for numstat in arg_0 [ 'numstats' ] . splitlines ( ) ] return arg_1

def Func(arg_0):
    '''Accept a parsed single commit. Some of the named groups
    require further processing, so parse those groups.
    Return a dictionary representing the completely parsed
    commit.
    '''
    arg_1 = {}
    arg_1['commit'] = arg_0['commit']
    arg_1['tree'] = arg_0['tree']
    arg_2 = arg_0['parents']
    arg_1['parents'] = [
        parse_parent_line(parentline)
        for parentline in
        arg_2.splitlines()
    ]
    arg_1['author'] = parse_author_line(arg_0['author'])
    arg_1['committer'] = Functer_line(arg_0['committer'])
    arg_3 = [
        parse_message_line(msgline)
        for msgline in
        arg_0['message'].split("\n")
    ]
    arg_1['message'] = "\n".join(
        msgline
        for msgline in
        arg_3
        if msgline is not None
    )
    arg_1['changes'] = [
        parse_numstat_line(numstat)
        for numstat in
        arg_0['numstats'].splitlines()
    ]
    return arg_1

Accept a parsed single commit . Some of the named groups require further processing so parse those groups . Return a dictionary representing the completely parsed commit .


def Func ( arg_0 , arg_1 ) : if is_type ( arg_1 , list , tuple , set ) : if arg_0 . ncols == 1 and ( arg_0 . type ( 0 ) == 'str' or arg_0 . type ( 0 ) == 'enum' ) : return arg_0 . match ( arg_1 ) else : return functools . reduce ( H2OFrame . __or__ , ( arg_0 == arg_2 for arg_2 in arg_1 ) ) else : return arg_0 == arg_1

def Func(arg_0, arg_1):
        """
        Test whether elements of an H2OFrame are contained in the ``item``.

        :param items: An item or a list of items to compare the H2OFrame against.

        :returns: An H2OFrame of 0s and 1s showing whether each element in the original H2OFrame is contained in item.
        """
        if is_type(arg_1, list, tuple, set):
            if arg_0.ncols == 1 and (arg_0.type(0) == 'str' or arg_0.type(0) == 'enum'):
                return arg_0.match(arg_1)
            else:
                return functools.reduce(H2OFrame.__or__, (arg_0 == arg_2 for arg_2 in arg_1))
        else:
            return arg_0 == arg_1

Test whether elements of an H2OFrame are contained in the item .


return pygments.highlight(output,
            pygments.lexers.PythonLexer(),
            pygments.formatters.Terminal256Formatter(style='monokai'))

def Func ( arg_0 ) : if not pygments : return arg_0 return pygments . highlight ( arg_0 , pygments . lexers . PythonLexer ( ) , pygments . formatters . Terminal256Formatter ( style = 'monokai' ) )

def Func(arg_0):
    """
    Return `output` colorized with Pygments, if available.

    """
    if not pygments:
        return arg_0
    # Available styles
    # ['monokai', 'manni', 'rrt', 'perldoc', 'borland', 'colorful', 'default',
    # 'murphy', 'vs', 'trac', 'tango', 'fruity', 'autumn', 'bw', 'emacs',
    # 'vim', 'pastie', 'friendly', 'native']
    return pygments.highlight(arg_0,
            pygments.lexers.PythonLexer(),
            pygments.formatters.Terminal256Formatter(style='monokai'))

Return output colorized with Pygments if available .


def Func ( ) : arg_0 = _get_attrib ( ) . get ( 'version' ) if not arg_0 : arg_1 = re . search ( r"LanguageTool-?.*?(\S+)$" , get_directory ( ) ) if arg_1 : arg_0 = arg_1 . group ( 1 ) return arg_0

def Func():
    """Get LanguageTool version."""
    arg_0 = _get_attrib().get('version')
    if not arg_0:
        arg_1 = re.search(r"LanguageTool-?.*?(\S+)$", get_directory())
        if arg_1:
            arg_0 = arg_1.group(1)
    return arg_0


def
Func
(
arg_0
)
:
if
len
(
arg_0
.
getSearchQuery
(
)
)
==
0
:
return
[
]
arg_1
=
[
]
arg_2
=
arg_0
.
getSearchQuery
(
)
[
0
]
if
arg_2
==
'!'
or
arg_2
==
'?'
:
if
len
(
arg_0
.
getSearchQuery
(
)
)
==
1
:
arg_1
.
append
(
arg_2
+
"images"
)
arg_1
.
append
(
arg_2
+
"wikipedia"
)
arg_1
.
append
(
arg_2
+
"osm"
)
else
:
arg_3
=
arg_0
.
getSearchQuery
(
)
[
1
:
]
for
arg_4
in
categories
:
if
arg_4
.
startswith
(
arg_3
)
:
arg_1
.
append
(
arg_2
+
'{categorie}'
.
format
(
arg_4
=
arg_4
)
)
for
arg_5
in
engines
:
if
arg_5
.
startswith
(
arg_3
.
replace
(
'_'
,
' '
)
)
:
arg_1
.
append
(
arg_2
+
'{engine}'
.
format
(
arg_5
=
arg_5
.
replace
(
' '
,
'_'
)
)
)
for
arg_6
in
engine_shortcuts
:
if
arg_6
.
startswith
(
arg_3
)
:
arg_1
.
append
(
arg_2
+
'{engine_shortcut}'
.
format
(
arg_6
=
arg_6
)
)
elif
arg_2
==
':'
:
if
len
(
arg_0
.
getSearchQuery
(
)
)
==
1
:
arg_1
.
append
(
":en"
)
arg_1
.
append
(
":en_us"
)
arg_1
.
append
(
":english"
)
arg_1
.
append
(
":united_kingdom"
)
else
:
arg_3
=
arg_0
.
getSearchQuery
(
)
[
1
:
]
for
arg_7
in
language_codes
:
arg_8
,
arg_9
,
arg_10
,
arg_11
=
map
(
unicode
.
lower
,
arg_7
)
if
arg_8
.
startswith
(
arg_3
)
:
if
len
(
arg_3
)
<=
2
:
arg_1
.
append
(
u':{lang_id}'
.
format
(
arg_8
=
arg_8
.
split
(
'-'
)
[
0
]
)
)
else
:
arg_1
.
append
(
u':{lang_id}'
.
format
(
arg_8
=
arg_8
)
)
if
arg_9
.
startswith
(
arg_3
)
or
arg_11
.
startswith
(
arg_3
)
:
arg_1
.
append
(
u':{lang_name}'
.
format
(
arg_9
=
arg_9
)
)
if
arg_10
.
startswith
(
arg_3
.
replace
(
'_'
,
' '
)
)
:
arg_1
.
append
(
u':{country}'
.
format
(
arg_10
=
arg_10
.
replace
(
' '
,
'_'
)
)
)
arg_12
=
set
(
arg_1
)
for
arg_13
in
arg_0
.
query_parts
:
if
arg_13
in
arg_12
:
arg_12
.
remove
(
arg_13
)
return
list
(
arg_12
)

def Func(arg_0):
    '''check if the searchQuery contain a bang, and create fitting autocompleter results'''
    # check if there is a query which can be parsed
    if len(arg_0.getSearchQuery()) == 0:
        return []

    arg_1 = []

    # check if current query stats with !bang
    arg_2 = arg_0.getSearchQuery()[0]
    if arg_2 == '!' or arg_2 == '?':
        if len(arg_0.getSearchQuery()) == 1:
            # show some example queries
            # TODO, check if engine is not avaliable
            arg_1.append(arg_2 + "images")
            arg_1.append(arg_2 + "wikipedia")
            arg_1.append(arg_2 + "osm")
        else:
            arg_3 = arg_0.getSearchQuery()[1:]

            # check if query starts with categorie name
            for arg_4 in categories:
                if arg_4.startswith(arg_3):
                    arg_1.append(arg_2 + '{categorie}'.format(arg_4=arg_4))

            # check if query starts with engine name
            for arg_5 in engines:
                if arg_5.startswith(arg_3.replace('_', ' ')):
                    arg_1.append(arg_2 + '{engine}'.format(arg_5=arg_5.replace(' ', '_')))

            # check if query starts with engine shortcut
            for arg_6 in engine_shortcuts:
                if arg_6.startswith(arg_3):
                    arg_1.append(arg_2 + '{engine_shortcut}'.format(arg_6=arg_6))

    # check if current query stats with :bang
    elif arg_2 == ':':
        if len(arg_0.getSearchQuery()) == 1:
            # show some example queries
            arg_1.append(":en")
            arg_1.append(":en_us")
            arg_1.append(":english")
            arg_1.append(":united_kingdom")
        else:
            arg_3 = arg_0.getSearchQuery()[1:]

            for arg_7 in language_codes:
                arg_8, arg_9, arg_10, arg_11 = map(unicode.lower, arg_7)

                # check if query starts with language-id
                if arg_8.startswith(arg_3):
                    if len(arg_3) <= 2:
                        arg_1.append(u':{lang_id}'.format(arg_8=arg_8.split('-')[0]))
                    else:
                        arg_1.append(u':{lang_id}'.format(arg_8=arg_8))

                # check if query starts with language name
                if arg_9.startswith(arg_3) or arg_11.startswith(arg_3):
                    arg_1.append(u':{lang_name}'.format(arg_9=arg_9))

                # check if query starts with country
                if arg_10.startswith(arg_3.replace('_', ' ')):
                    arg_1.append(u':{country}'.format(arg_10=arg_10.replace(' ', '_')))

    # remove duplicates
    arg_12 = set(arg_1)

    # remove results which are already contained in the query
    for arg_13 in arg_0.query_parts:
        if arg_13 in arg_12:
            arg_12.remove(arg_13)

    # convert result_set back to list
    return list(arg_12)

check if the searchQuery contain a bang and create fitting autocompleter results


return qs.filter(**{
            '%s__gte' % date_field: since
        })

def Func ( arg_0 ) : arg_1 = super ( BaseCalendarMonthView , arg_0 ) . Func ( ) arg_2 = arg_0 . get_year ( ) arg_3 = arg_0 . get_month ( ) arg_4 = arg_0 . get_date_field ( ) arg_5 = arg_0 . get_end_date_field ( ) arg_6 = _date_from_string ( arg_2 , arg_0 . get_year_format ( ) , arg_3 , arg_0 . get_month_format ( ) ) arg_7 = arg_6 arg_8 = arg_0 . get_next_month ( arg_6 ) if arg_7 . weekday ( ) != arg_0 . get_first_of_week ( ) : arg_9 = math . fabs ( arg_7 . weekday ( ) - arg_0 . get_first_of_week ( ) ) arg_7 = arg_7 - datetime . timedelta ( days = arg_9 ) if arg_8 . weekday ( ) != ( ( arg_0 . get_first_of_week ( ) + 6 ) % 7 ) : arg_9 = math . fabs ( ( ( arg_0 . get_first_of_week ( ) + 6 ) % 7 ) - arg_8 . weekday ( ) ) arg_8 = arg_8 + datetime . timedelta ( days = arg_9 ) if arg_5 : arg_10 = Q ( ** { '%s__gte' % arg_4 : arg_7 , arg_5 : None } ) arg_11 = Q ( ** { '%s__gte' % arg_4 : arg_7 , '%s__lt' % arg_5 : arg_8 } ) arg_12 = Q ( ** { '%s__lt' % arg_4 : arg_7 , '%s__gte' % arg_5 : arg_7 , '%s__lt' % arg_5 : arg_8 } ) arg_13 = Q ( ** { '%s__gte' % arg_4 : arg_7 , '%s__lt' % arg_4 : arg_8 , '%s__gte' % arg_5 : arg_8 } ) arg_14 = Q ( ** { '%s__lt' % arg_4 : arg_7 , '%s__gte' % arg_5 : arg_8 } ) return arg_1 . filter ( arg_10 | arg_11 | arg_12 | arg_13 | arg_14 ) return arg_1 . filter ( ** { '%s__gte' % arg_4 : arg_7 } )

def Func(arg_0):
        """
        Returns a queryset of models for the month requested
        """
        arg_1 = super(BaseCalendarMonthView, arg_0).Func()

        arg_2 = arg_0.get_year()
        arg_3 = arg_0.get_month()

        arg_4 = arg_0.get_date_field()
        arg_5 = arg_0.get_end_date_field()

        arg_6 = _date_from_string(arg_2, arg_0.get_year_format(),
                                 arg_3, arg_0.get_month_format())

        arg_7 = arg_6
        arg_8 = arg_0.get_next_month(arg_6)

        # Adjust our start and end dates to allow for next and previous
        # month edges
        if arg_7.weekday() != arg_0.get_first_of_week():
            arg_9 = math.fabs(arg_7.weekday() - arg_0.get_first_of_week())
            arg_7 = arg_7 - datetime.timedelta(days=arg_9)

        if arg_8.weekday() != ((arg_0.get_first_of_week() + 6) % 7):
            arg_9 = math.fabs(((arg_0.get_first_of_week() + 6) % 7) - arg_8.weekday())
            arg_8 = arg_8 + datetime.timedelta(days=arg_9)

        if arg_5:
            # 5 possible conditions for showing an event:

            # 1) Single day event, starts after 'since'
            # 2) Multi-day event, starts after 'since' and ends before 'until'
            # 3) Starts before 'since' and ends after 'since' and before 'until'
            # 4) Starts after 'since' but before 'until' and ends after 'until'
            # 5) Starts before 'since' and ends after 'until'
            arg_10 = Q(**{
                '%s__gte' % arg_4: arg_7,
                arg_5: None
            })
            arg_11 = Q(**{
                '%s__gte' % arg_4: arg_7,
                '%s__lt' % arg_5: arg_8
            })
            arg_12 = Q(**{
                '%s__lt' % arg_4: arg_7,
                '%s__gte' % arg_5: arg_7,
                '%s__lt' % arg_5: arg_8
            })
            arg_13 = Q(**{
                '%s__gte' % arg_4: arg_7,
                '%s__lt' % arg_4: arg_8,
                '%s__gte' % arg_5: arg_8
            })
            arg_14 = Q(**{
                '%s__lt' % arg_4: arg_7,
                '%s__gte' % arg_5: arg_8
            })
            return arg_1.filter(arg_10 | arg_11 | arg_12 | arg_13 | arg_14)
        return arg_1.filter(**{
            '%s__gte' % arg_4: arg_7
        })


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the encoding of the Boolean object to the output stream.

        Args:
            ostream (Stream): A buffer to contain the encoded bytes of a
                Boolean object. Usually a BytearrayStream object. Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        super(Boolean, arg_0).Func(arg_1, arg_2=arg_2)
        arg_0.Func_value(arg_1, arg_2=arg_2)

Write the encoding of the Boolean object to the output stream .


def Func(arg_0, arg_1=None):
        """Make the request appear to be coming from a browser

        This is to interact with older parts of Go that doesn't have a
        proper API call to be made. What will be done:

        1. If no response passed in a call to `go/api/pipelines.xml` is
           made to get a valid session
        2. `JSESSIONID` will be populated from this request
        3. A request to `go/pipelines` will be so the
           `authenticity_token` (CSRF) can be extracted. It will then
           silently be injected into `post_args` on any POST calls that
           doesn't start with `go/api` from this point.

        Args:
          response: a :class:`Response` object from a previously successful
            API call. So we won't have to query `go/api/pipelines.xml`
            unnecessarily.

        Raises:
          HTTPError: when the HTTP request fails.
          AuthenticationFailed: when failing to get the `session_id`
            or the `authenticity_token`.
        """
        if not arg_1:
            arg_1 = arg_0.get('go/api/pipelines.xml')

        arg_0._set_session_cookie(arg_1)

        if not arg_0._session_id:
            raise AuthenticationFailed('No session id extracted from request.')

        arg_1 = arg_0.get('go/pipelines')
        arg_2 = re.search(
            r'name="authenticity_token".+?value="([^"]+)',
            arg_1.read().decode('utf-8')
        )
        if arg_2:
            arg_0._authenticity_token = arg_2.group(1)
        else:
            raise AuthenticationFailed('Authenticity token not found on page')


def Func ( arg_0 ) : @ wraps ( arg_0 ) def decorator ( * arg_1 , ** arg_2 ) : arg_3 = 0 if inspect . ismethod ( arg_0 ) else 1 if len ( arg_1 ) > arg_3 : if isinstance ( arg_1 [ arg_3 ] , ( dict , composite ) ) : for arg_4 in arg_1 [ arg_3 ] : arg_2 [ arg_4 ] = arg_1 [ arg_3 ] [ arg_4 ] arg_1 = arg_1 [ : arg_3 ] return arg_0 ( * arg_1 , ** arg_2 ) return decorator

def Func(arg_0):
    """
    Accumulate all dictionary and named arguments as
    keyword argument dictionary. This is generally useful for
    functions that try to automatically resolve inputs.

    Examples:
        >>> @Func
        >>> def test(*args, **kwargs):
        >>>     return kwargs
        >>>
        >>> print test({'one': 1}, two=2)
        {'one': 1, 'two': 2}
    """
    @wraps(arg_0)
    def decorator(*arg_1, **arg_2):
        arg_3 = 0 if inspect.ismethod(arg_0) else 1
        if len(arg_1) > arg_3:
            if isinstance(arg_1[arg_3], (dict, composite)):
                for arg_4 in arg_1[arg_3]:
                    arg_2[arg_4] = arg_1[arg_3][arg_4]
                arg_1 = arg_1[:arg_3]
        return arg_0(*arg_1, **arg_2)
    return decorator

Accumulate all dictionary and named arguments as
    keyword argument dictionary. This is generally useful for
    functions that try to automatically resolve inputs.

    Examples:
        >>> @keywords
        >>> def test(*args, **kwargs):
        >>>     return kwargs
        >>>
        >>> print test({'one': 1}, two=2)
        {'one': 1, 'two': 2}

Accumulate all dictionary and named arguments as keyword argument dictionary . This is generally useful for functions that try to automatically resolve inputs .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : if not arg_1 : arg_3 = arg_0 . get ( ** arg_2 ) arg_1 = arg_3 [ 'id' ] arg_4 = '%s%s/Func/' % ( arg_0 . endpoint , arg_1 ) arg_5 = { } arg_6 = { } try : arg_7 = client . post ( arg_4 , arg_5 = arg_5 ) . json ( ) if 'id' in arg_7 : arg_6 . update ( arg_7 ) arg_6 [ 'changed' ] = True except exc . MethodNotAllowed : arg_6 [ 'changed' ] = False return arg_6

def Func(arg_0, arg_1=None, **arg_2):
        """Relaunch a stopped job.

        Fails with a non-zero exit status if the job cannot be Funced.
        You must provide either a pk or parameters in the job's identity.

        =====API DOCS=====
        Relaunch a stopped job resource.

        :param pk: Primary key of the job resource to Func.
        :type pk: int
        :param `**kwargs`: Keyword arguments used to look up job resource object to Func if ``pk`` is not
                           provided.
        :returns: A dictionary combining the JSON output of the Funced job resource object, as well
                  as an extra field "changed", a flag indicating if the job resource object is status-changed
                  as expected.
        :rtype: dict

        =====API DOCS=====
        """
        # Search for the record if pk not given
        if not arg_1:
            arg_3 = arg_0.get(**arg_2)
            arg_1 = arg_3['id']

        arg_4 = '%s%s/Func/' % (arg_0.endpoint, arg_1)
        arg_5 = {}
        # Attempt to Func the job.
        arg_6 = {}
        try:
            arg_7 = client.post(arg_4, arg_5=arg_5).json()
            if 'id' in arg_7:
                arg_6.update(arg_7)
            arg_6['changed'] = True
        except exc.MethodNotAllowed:
            arg_6['changed'] = False

        # Return the answer.
        return arg_6

Relaunch a stopped job.

        Fails with a non-zero exit status if the job cannot be relaunched.
        You must provide either a pk or parameters in the job's identity.

        =====API DOCS=====
        Relaunch a stopped job resource.

        :param pk: Primary key of the job resource to relaunch.
        :type pk: int
        :param `**kwargs`: Keyword arguments used to look up job resource object to relaunch if ``pk`` is not
                           provided.
        :returns: A dictionary combining the JSON output of the relaunched job resource object, as well
                  as an extra field "changed", a flag indicating if the job resource object is status-changed
                  as expected.
        :rtype: dict

        =====API DOCS=====


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
try
:
arg_4
=
Event
(
arg_3
,
arg_0
.
_messageCodecs
)
arg_0
.
logger
.
debug
(
"Received event '%s' from %s:%s"
%
(
arg_4
.
eventId
,
arg_4
.
typeId
,
arg_4
.
deviceId
)
)
if
arg_0
.
deviceEventCallback
:
arg_0
.
deviceEventCallback
(
arg_4
)
except
InvalidEventException
as
e
:
arg_0
.
logger
.
critical
(
str
(
e
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Internal callback for device event messages, parses source device from topic string and
        passes the information on to the registerd device event callback
        """
        try:
            arg_4 = Event(arg_3, arg_0._messageCodecs)
            arg_0.logger.debug("Received event '%s' from %s:%s" % (arg_4.eventId, arg_4.typeId, arg_4.deviceId))
            if arg_0.deviceEventCallback:
                arg_0.deviceEventCallback(arg_4)
        except InvalidEventException as e:
            arg_0.logger.critical(str(e))

Internal callback for device event messages parses source device from topic string and passes the information on to the registerd device event callback


def Func ( arg_0 , arg_1 ) : if arg_1 [ 1 ] == 'same' : if arg_0 . paramsdict [ "datatype" ] == '2brad' : def getbarcode ( arg_2 , arg_3 , arg_1 ) : return arg_3 [ 1 ] [ : - ( len ( arg_2 [ 0 ] [ 0 ] ) + 1 ) ] [ - arg_1 [ 0 ] : ] else : def getbarcode ( arg_4 , arg_3 , arg_1 ) : return arg_3 [ 1 ] [ : arg_1 [ 0 ] ] else : def getbarcode ( arg_2 , arg_3 , arg_1 ) : return findbcode ( arg_2 , arg_1 , arg_3 ) return getbarcode

def Func(arg_0, arg_1):
    """ returns the fastest func given data & longbar"""
    ## build func for finding barcode
    if arg_1[1] == 'same':
        if arg_0.paramsdict["datatype"] == '2brad':
            def getbarcode(arg_2, arg_3, arg_1):
                """ find barcode for 2bRAD data """
                return arg_3[1][:-(len(arg_2[0][0]) + 1)][-arg_1[0]:]

        else:
            def getbarcode(arg_4, arg_3, arg_1):
                """ finds barcode for invariable length barcode data """
                return arg_3[1][:arg_1[0]]
    else:
        def getbarcode(arg_2, arg_3, arg_1):
            """ finds barcode for variable barcode lengths"""
            return findbcode(arg_2, arg_1, arg_3)
    return getbarcode


def Func(arg_0):
        """
        Get the CRL's issuer.

        .. versionadded:: 16.1.0

        :rtype: X509Name
        """
        arg_1 = _lib.X509_NAME_dup(_lib.X509_CRL_Func(arg_0._crl))
        _openssl_assert(arg_1 != _ffi.NULL)
        arg_1 = _ffi.gc(arg_1, _lib.X509_NAME_free)
        arg_2 = X509Name.__new__(X509Name)
        arg_2._name = arg_1
        return arg_2


return hangouts_pb2.ParticipantId(
        chat_id=user_id.chat_id,
        gaia_id=user_id.gaia_id
    )

def Func(arg_0):
    """Convert UserID to hangouts_pb2.ParticipantId."""
    return hangouts_pb2.ParticipantId(
        chat_id=arg_0.chat_id,
        gaia_id=arg_0.gaia_id
    )

Convert UserID to hangouts_pb2 . ParticipantId .


return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            _ServiceBusManagementXmlSerializer.xml_to_region)

def Func(arg_0):
        '''
        Get list of available service bus regions.
        '''
        arg_1 = arg_0._perform_get(
            arg_0._get_path('services/serviceBus/Regions/', None),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            arg_1,
            _ServiceBusManagementXmlSerializer.xml_to_region)

Get list of available service bus regions .


def Func(arg_0, arg_1):
        """
        Converts the provided unsigned long value to a hex string.

        :param value: the value to convert
        :type value: unsigned long
        :returns: value as a hex string
        """
        arg_2 = bytearray(16)
        arg_0._write_hex_long(arg_2, 0, arg_1)
        return arg_2.decode("utf8")

Converts the provided unsigned long value to a hex string .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_1
in
arg_0
.
_patterns
:
raise
IndexError
(
"Invalid number"
)
return
arg_0
.
_patterns
[
arg_1
]

def Func(arg_0, arg_1):
    """
    Return a pattern for a number.

    @param number (int) Number of pattern

    @return (set) Indices of on bits
    """
    if not arg_1 in arg_0._patterns:
      raise IndexError("Invalid number")

    return arg_0._patterns[arg_1]


(unitOrCls: Unit, name: str=None,
          serializer: GenericSerializer=VhdlSerializer,
          targetPlatform=DummyPlatform(), saveTo: str=None)

def Func(arg_0: arg_1, arg_2: arg_3=None,
          arg_4: arg_5=arg_6,
          arg_7=arg_8(), arg_9: arg_3=None):
    """
    Convert unit to RTL using specified serializer

    :param unitOrCls: unit instance or class, which should be converted
    :param name: name override of top unit (if is None name is derived
        form class name)
    :param serializer: serializer which should be used for to RTL conversion
    :param targetPlatform: metainformatins about target platform, distributed
        on every unit under _targetPlatform attribute
        before Unit._impl() is called
    :param saveTo: directory where files should be stored
        If None RTL is returned as string.
    :raturn: if saveTo returns RTL string else returns list of file names
        which were created
    """
    if not isinstance(arg_0, arg_1):
        arg_10 = arg_0()
    else:
        arg_10 = arg_0

    arg_10._loadDeclarations()
    if arg_2 is not None:
        assert isinstance(arg_2, arg_3)
        arg_10._name = arg_2

    arg_12 = arg_4.getBaseNameScope()
    arg_13 = {}

    # unitCls : unitobj
    arg_14 = {}

    # (unitCls, paramsValues) : unitObj
    # where paramsValues are dict name:value
    arg_15 = {}

    arg_16 = True

    arg_17 = arg_9 is not None
    if arg_17:
        os.makedirs(arg_9, exist_ok=True)
        arg_18 = UniqList()
    else:
        arg_19 = []

    for arg_20 in arg_10._Func(arg_7):
        arg_16 = arg_4.serializationDecision(
            arg_20,
            arg_14,
            arg_15)
        if arg_16:
            if isinstance(arg_20, Entity):
                arg_21 = arg_12.fork(1)
                arg_21.setLevel(2)
                arg_22 = arg_4.getBaseContext()
                arg_22.scope = arg_21
                arg_13[arg_20] = arg_22
                arg_22.currentUnit = arg_20.origin

                arg_25 = arg_4.Entity(arg_20, arg_22)
                if arg_17:
                    arg_26 = arg_20.name + arg_4.fileExtension
                    arg_27 = 'w'

            elif isinstance(arg_20, Architecture):
                try:
                    arg_22 = arg_13[arg_20.entity]
                except KeyError:
                    raise SerializerException(
                        "Entity should be serialized"
                        " before architecture of %s"
                        % (arg_20.getEntityName()))

                arg_25 = arg_4.Architecture(arg_20, arg_22)
                if arg_17:
                    arg_26 = arg_20.getEntityName() + arg_4.fileExtension
                    arg_27 = 'a'
            else:
                if hasattr(arg_20, "_hdlSources"):
                    for arg_28 in arg_20._hdlSources:
                        if isinstance(arg_28, arg_3):
                            shutil.copy2(arg_28, arg_9)
                            arg_18.append(arg_28)
                            continue
                else:
                    arg_25 = arg_4.asHdl(arg_20)

            if arg_25:
                if arg_17:
                    arg_29 = os.path.join(arg_9, arg_26)
                    arg_18.append(arg_29)
                    with open(arg_29, arg_27) as f:
                        if arg_27 == 'a':
                            f.write("\n")

                        f.write(
                            arg_4.formatter(arg_25)
                        )
                else:
                    arg_19.append(arg_25)

        elif not arg_17:
            try:
                arg_2 = '"%s"' % arg_20.name
            except AttributeError:
                arg_2 = ""
            arg_19.append(arg_4.comment(
                "Object of class %s, %s was not serialized as specified" % (
                    arg_20.__class__.__name__, arg_2)))

    if arg_17:
        return arg_18
    else:
        return arg_4.formatter(
            "\n".join(arg_19)
        )


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
split
(
"\n"
)
:
arg_1
=
arg_1
.
replace
(
"\t"
,
""
)
if
not
arg_1
.
lstrip
(
)
.
startswith
(
"*"
)
and
not
re
.
search
(
r"^([0-9]{1,3}\. )"
,
arg_1
.
lstrip
(
)
)
:
return
False
return
True

def Func(arg_0):

    """ Determines if an item in a paragraph is a list.

    If all of the lines in the markup start with a "*" or "1."
    this indicates a list as parsed by parse_paragraphs().
    It can be drawn with draw_list().

    """

    for arg_1 in arg_0.split("\n"):
        arg_1 = arg_1.replace("\t", "")
        if  not arg_1.lstrip().startswith("*") \
        and not re.search(r"^([0-9]{1,3}\. )", arg_1.lstrip()):
            return False

    return True

Determines if an item in a paragraph is a list .


def Func(arg_0):
  """Force every module in modList to be placed into main"""
  if not arg_0:
    return

  arg_1 = sys.modules['__main__']
  for arg_2 in arg_0:
    if isinstance(arg_2, str):
      try:
        arg_3 = __import__(arg_2)
      except Exception:
        sys.stderr.write(
            'warning: could not import %s\n.  '
            'Your function may unexpectedly error due to this import failing;'
            'A version mismatch is likely.  Specific error was:\n' % arg_2)
        print_exec(sys.stderr)
      else:
        setattr(arg_1, arg_3.__name__, arg_3)


def
Func
(
arg_0
=
)
:
if
arg_0
is
:
arg_0
=
GIT_PATH
arg_1
=
check_output
(
[
arg_0
,
"log"
,
"--pretty=format:'%ad %h %s'"
,
"--date=short"
,
"-n1"
]
)
return
arg_1
.
strip
(
)
[
1
:
1
]

def Func(arg_0=None):
    """
    Get one-line description of HEAD commit for repository in current dir.
    """
    if arg_0 is None: arg_0 = GIT_PATH
    arg_1 = check_output([arg_0, "log", "--pretty=format:'%ad %h %s'",
                           "--date=short", "-n1"])
    return arg_1.strip()[1:-1]

Get one - line description of HEAD commit for repository in current dir .


(y=None, sr=22050, S=None, lag=1, max_size=1,
                         ref=None, detrend=False, center=True, feature=None,
                         aggregate=None, channels=None, **kwargs)

def Func(arg_0=None, arg_1=22050, arg_2=None, arg_3=1, arg_4=1,
                         arg_5=None, arg_6=False, arg_7=True, arg_8=None,
                         arg_9=None, arg_10=None, **arg_11):
    """Compute a spectral flux onset strength envelope across multiple channels.

    Onset strength for channel `i` at time `t` is determined by:

    `mean_{f in channels[i]} max(0, S[f, t+1] - S[f, t])`

    Parameters
    ----------
    y        : np.ndarray [shape=(n,)]
        audio time-series

    sr       : number > 0 [scalar]
        sampling rate of `y`

    S        : np.ndarray [shape=(d, m)]
        pre-computed (log-power) spectrogram

    lag      : int > 0
        time lag for computing differences

    max_size : int > 0
        size (in frequency bins) of the local max filter.
        set to `1` to disable filtering.

    ref : None or np.ndarray [shape=(d, m)]
        An optional pre-computed reference spectrum, of the same shape as `S`.
        If not provided, it will be computed from `S`.
        If provided, it will override any local max filtering governed by `max_size`.

    detrend : bool [scalar]
        Filter the onset strength to remove the DC component

    center : bool [scalar]
        Shift the onset function by `n_fft / (2 * hop_length)` frames

    feature : function
        Function for computing time-series features, eg, scaled spectrograms.
        By default, uses `librosa.feature.melspectrogram` with `fmax=11025.0`

    aggregate : function or False
        Aggregation function to use when combining onsets
        at different frequency bins.

        If `False`, then no aggregation is performed.

        Default: `np.mean`

    channels : list or None
        Array of channel boundaries or slice objects.
        If `None`, then a single channel is generated to span all bands.

    kwargs : additional keyword arguments
        Additional parameters to `feature()`, if `S` is not provided.

    Returns
    -------
    onset_envelope   : np.ndarray [shape=(n_channels, m)]
        array containing the onset strength envelope for each specified channel

    Raises
    ------
    ParameterError
        if neither `(y, sr)` nor `S` are provided

    See Also
    --------
    onset_strength

    Notes
    -----
    This function caches at level 30.

    Examples
    --------
    First, load some audio and plot the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      duration=10.0)
    >>> D = np.abs(librosa.stft(y))
    >>> plt.figure()
    >>> plt.subplot(2, 1, 1)
    >>> librosa.display.specshow(librosa.amplitude_to_db(D, ref=np.max),
    ...                          y_axis='log')
    >>> plt.title('Power spectrogram')

    Construct a standard onset function over four sub-bands

    >>> onset_subbands = librosa.onset.Func(y=y, sr=sr,
    ...                                                     channels=[0, 32, 64, 96, 128])
    >>> plt.subplot(2, 1, 2)
    >>> librosa.display.specshow(onset_subbands, x_axis='time')
    >>> plt.ylabel('Sub-bands')
    >>> plt.title('Sub-band onset strength')

    """

    if arg_8 is None:
        arg_8 = melspectrogram
        arg_11.setdefault('fmax', 11025.0)

    if arg_9 is None:
        arg_9 = np.mean

    if arg_3 < 1 or not isinstance(arg_3, int):
        raise ParameterError('lag must be a positive integer')

    if arg_4 < 1 or not isinstance(arg_4, int):
        raise ParameterError('max_size must be a positive integer')

    # First, compute mel spectrogram
    if arg_2 is None:
        arg_2 = np.abs(arg_8(arg_0=arg_0, arg_1=arg_1, **arg_11))

        # Convert to dBs
        arg_2 = core.power_to_db(arg_2)

    # Retrieve the n_fft and hop_length,
    # or default values for onsets if not provided
    arg_12 = arg_11.get('n_fft', 2048)
    arg_13 = arg_11.get('hop_length', 512)

    # Ensure that S is at least 2-d
    arg_2 = np.atleast_2d(arg_2)

    # Compute the reference spectrogram.
    # Efficiency hack: skip filtering step and pass by reference
    # if max_size will produce a no-op.
    if arg_5 is None:
        if arg_4 == 1:
            arg_5 = arg_2
        else:
            arg_5 = scipy.ndimage.maximum_filter1d(arg_2, arg_4, axis=0)
    elif arg_5.shape != arg_2.shape:
        raise ParameterError('Reference spectrum shape {} must match input spectrum {}'.format(arg_5.shape, arg_2.shape))

    # Compute difference to the reference, spaced by lag
    arg_14 = arg_2[:, arg_3:] - arg_5[:, :-arg_3]

    # Discard negatives (decreasing amplitude)
    arg_14 = np.maximum(0.0, arg_14)

    # Aggregate within channels
    arg_15 = True
    if arg_10 is None:
        arg_10 = [slice(None)]
    else:
        arg_15 = False

    if arg_9:
        arg_14 = util.sync(arg_14, arg_10,
                              arg_9=arg_9,
                              arg_15=arg_15, axis=0)

    # compensate for lag
    arg_16 = arg_3
    if arg_7:
        # Counter-act framing effects. Shift the onsets by n_fft / hop_length
        arg_16 += arg_12 // (2 * arg_13)

    arg_14 = np.pad(arg_14, ([0, 0], [int(arg_16), 0]),
                       mode='constant')

    # remove the DC component
    if arg_6:
        arg_14 = scipy.signal.lfilter([1.0, -1.0], [1.0, -0.99],
                                         arg_14, axis=-1)

    # Trim to match the input duration
    if arg_7:
        arg_14 = arg_14[:, :arg_2.shape[1]]

    return arg_14

Compute a spectral flux onset strength envelope across multiple channels.

    Onset strength for channel `i` at time `t` is determined by:

    `mean_{f in channels[i]} max(0, S[f, t+1] - S[f, t])`

    Parameters
    ----------
    y        : np.ndarray [shape=(n,)]
        audio time-series

    sr       : number > 0 [scalar]
        sampling rate of `y`

    S        : np.ndarray [shape=(d, m)]
        pre-computed (log-power) spectrogram

    lag      : int > 0
        time lag for computing differences

    max_size : int > 0
        size (in frequency bins) of the local max filter.
        set to `1` to disable filtering.

    ref : None or np.ndarray [shape=(d, m)]
        An optional pre-computed reference spectrum, of the same shape as `S`.
        If not provided, it will be computed from `S`.
        If provided, it will override any local max filtering governed by `max_size`.

    detrend : bool [scalar]
        Filter the onset strength to remove the DC component

    center : bool [scalar]
        Shift the onset function by `n_fft / (2 * hop_length)` frames

    feature : function
        Function for computing time-series features, eg, scaled spectrograms.
        By default, uses `librosa.feature.melspectrogram` with `fmax=11025.0`

    aggregate : function or False
        Aggregation function to use when combining onsets
        at different frequency bins.

        If `False`, then no aggregation is performed.

        Default: `np.mean`

    channels : list or None
        Array of channel boundaries or slice objects.
        If `None`, then a single channel is generated to span all bands.

    kwargs : additional keyword arguments
        Additional parameters to `feature()`, if `S` is not provided.

    Returns
    -------
    onset_envelope   : np.ndarray [shape=(n_channels, m)]
        array containing the onset strength envelope for each specified channel

    Raises
    ------
    ParameterError
        if neither `(y, sr)` nor `S` are provided

    See Also
    --------
    onset_strength

    Notes
    -----
    This function caches at level 30.

    Examples
    --------
    First, load some audio and plot the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      duration=10.0)
    >>> D = np.abs(librosa.stft(y))
    >>> plt.figure()
    >>> plt.subplot(2, 1, 1)
    >>> librosa.display.specshow(librosa.amplitude_to_db(D, ref=np.max),
    ...                          y_axis='log')
    >>> plt.title('Power spectrogram')

    Construct a standard onset function over four sub-bands

    >>> onset_subbands = librosa.onset.onset_strength_multi(y=y, sr=sr,
    ...                                                     channels=[0, 32, 64, 96, 128])
    >>> plt.subplot(2, 1, 2)
    >>> librosa.display.specshow(onset_subbands, x_axis='time')
    >>> plt.ylabel('Sub-bands')
    >>> plt.title('Sub-band onset strength')

Compute a spectral flux onset strength envelope across multiple channels .


def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of courses for the passed regid.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.index
        """
        arg_0._as_user = arg_1
        arg_4 = arg_0._get_resource("/api/v1/courses", arg_2=arg_2)
        arg_0._as_user = None

        arg_5 = []
        for arg_6 in arg_4:
            if "sis_course_id" in arg_6:
                arg_5.append(CanvasCourse(arg_4=arg_6))
            else:
                arg_5.append(arg_0.get_course(arg_6["id"], arg_2))

        return arg_5

Return a list of courses for the passed regid .


def Func ( arg_0 ) : global arg_4 , arg_5 , ENABLE_USER_SITE arg_1 = os . environ . get ( "PYTHONUSERBASE" , None ) def joinuser ( * arg_2 ) : return os . path . expanduser ( os . path . join ( * arg_2 ) ) if os . name == "nt" : arg_3 = os . environ . get ( "APPDATA" ) or "~" if arg_1 : arg_4 = arg_1 else : arg_4 = joinuser ( arg_3 , "Python" ) arg_5 = os . path . join ( arg_4 , "Python" + sys . version [ 0 ] + sys . version [ 2 ] , "site-packages" ) else : if arg_1 : arg_4 = arg_1 else : arg_4 = joinuser ( "~" , ".local" ) arg_5 = os . path . join ( arg_4 , "lib" , "python" + sys . version [ : 3 ] , "site-packages" ) if ENABLE_USER_SITE and os . path . isdir ( arg_5 ) : addsitedir ( arg_5 , arg_0 ) if ENABLE_USER_SITE : for arg_6 in ( "lib" , "local/lib" ) : arg_7 = os . path . join ( arg_4 , arg_6 , "python" + sys . version [ : 3 ] , "dist-packages" ) if os . path . isdir ( arg_7 ) : addsitedir ( arg_7 , arg_0 ) return arg_0

def Func(arg_0):
    """Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.

    USER_BASE is the root directory for all Python versions

    USER_SITE is the user specific site-packages directory

    USER_SITE/.. can be used for data.
    """
    global arg_4, arg_5, ENABLE_USER_SITE
    arg_1 = os.environ.get("PYTHONUSERBASE", None)

    def joinuser(*arg_2):
        return os.path.expanduser(os.path.join(*arg_2))

    #if sys.platform in ('os2emx', 'riscos'):
    #    # Don't know what to put here
    #    USER_BASE = ''
    #    USER_SITE = ''
    if os.name == "nt":
        arg_3 = os.environ.get("APPDATA") or "~"
        if arg_1:
            arg_4 = arg_1
        else:
            arg_4 = joinuser(arg_3, "Python")
        arg_5 = os.path.join(arg_4,
                                 "Python" + sys.version[0] + sys.version[2],
                                 "site-packages")
    else:
        if arg_1:
            arg_4 = arg_1
        else:
            arg_4 = joinuser("~", ".local")
        arg_5 = os.path.join(arg_4, "lib",
                                 "python" + sys.version[:3],
                                 "site-packages")

    if ENABLE_USER_SITE and os.path.isdir(arg_5):
        addsitedir(arg_5, arg_0)
    if ENABLE_USER_SITE:
        for arg_6 in ("lib", "local/lib"):
            arg_7 = os.path.join(arg_4, arg_6,
                                     "python" + sys.version[:3],
                                     "dist-packages")
            if os.path.isdir(arg_7):
                addsitedir(arg_7, arg_0)
    return arg_0

Add a per user site - package to sys . path


def Func ( arg_0 ) : while True : while len ( arg_0 . _buffer ) < arg_0 . max_size and arg_0 . conn . poll ( ) : arg_1 = arg_0 . _read_chunks ( ) if arg_1 is not None : arg_0 . _buffer . append ( arg_1 ) if len ( arg_0 . _buffer ) > 0 : return arg_0 . _buffer . popleft ( )

def Func(arg_0):
        """Gets data from pipe"""
        while True:
            while len(arg_0._buffer) < arg_0.max_size and arg_0.conn.poll():
                arg_1 = arg_0._read_chunks()
                if arg_1 is not None:
                    arg_0._buffer.append(arg_1)
            if len(arg_0._buffer) > 0:
                return arg_0._buffer.popleft()


(units, n_hidden, n_layers=1, trainable_initial_states=None, seq_lengths=None, initial_h=None,
                          initial_c=None, name='cudnn_lstm', reuse=False)

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = 'cudnn_lstm' , arg_8 = False ) : with tf . variable_scope ( arg_7 , arg_8 = arg_8 ) : if arg_3 : arg_9 = tf . get_variable ( 'init_h' , [ arg_2 , 1 , arg_1 ] ) arg_9 = tf . tile ( arg_9 , ( 1 , tf . shape ( arg_0 ) [ 0 ] , 1 ) ) arg_10 = tf . get_variable ( 'init_c' , [ arg_2 , 1 , arg_1 ] ) arg_10 = tf . tile ( arg_10 , ( 1 , tf . shape ( arg_0 ) [ 0 ] , 1 ) ) else : arg_9 = arg_10 = tf . zeros ( [ arg_2 , tf . shape ( arg_0 ) [ 0 ] , arg_1 ] ) arg_5 = arg_5 or arg_9 arg_6 = arg_6 or arg_10 with tf . variable_scope ( 'cudnn_lstm' , arg_8 = arg_8 ) : def single_cell ( ) : return tf . contrib . cudnn_rnn . CudnnCompatibleLSTMCell ( arg_1 ) arg_11 = tf . nn . rnn_cell . MultiRNNCell ( [ single_cell ( ) for _ in range ( arg_2 ) ] ) arg_0 = tf . transpose ( arg_0 , ( 1 , 0 , 2 ) ) arg_12 = tuple ( [ tf . nn . rnn_cell . LSTMStateTuple ( ic , ih ) for ih , ic in zip ( tf . unstack ( arg_5 , axis = 0 ) , tf . unstack ( arg_6 , axis = 0 ) ) ] ) arg_13 , arg_14 = tf . nn . dynamic_rnn ( arg_11 = arg_11 , inputs = arg_0 , time_major = True , initial_state = arg_12 ) arg_13 = tf . transpose ( arg_13 , ( 1 , 0 , 2 ) ) arg_15 = arg_14 [ - 1 ] . h arg_16 = arg_14 [ - 1 ] . c if arg_4 is not None : arg_17 = tf . stack ( [ tf . range ( tf . shape ( arg_13 ) [ 0 ] ) , arg_4 - 1 ] , axis = 1 ) arg_15 = tf . gather_nd ( arg_13 , arg_17 ) return arg_13 , ( arg_15 , arg_16 )

def Func(arg_0, arg_1, arg_2=1, arg_3=None, arg_4=None, arg_5=None,
                          arg_6=None, arg_7='cudnn_lstm', arg_8=False):
    """ CuDNN Compatible LSTM implementation.
        It should be used to load models saved with CudnnLSTMCell to run on CPU.

        Args:
            units: tf.Tensor with dimensions [B x T x F], where
                B - batch size
                T - number of tokens
                F - features
            n_hidden: dimensionality of hidden state
            n_layers: number of layers
            trainable_initial_states: whether to create a special trainable variable
                to initialize the hidden states of the network or use just zeros
            seq_lengths: tensor of sequence lengths with dimension [B]
            initial_h: optional initial hidden state, masks trainable_initial_states
                if provided
            initial_c: optional initial cell state, masks trainable_initial_states
                if provided
            name: name of the variable scope to use
            reuse:whether to reuse already initialized variable

        Returns:
            h - all hidden states along T dimension,
                tf.Tensor with dimensionality [B x T x F]
            h_last - last hidden state, tf.Tensor with dimensionality [B x H]
                where H - number of hidden units
            c_last - last cell state, tf.Tensor with dimensionality [B x H]
                where H - number of hidden units
        """

    with tf.variable_scope(arg_7, arg_8=arg_8):
        if arg_3:
            arg_9 = tf.get_variable('init_h', [arg_2, 1, arg_1])
            arg_9 = tf.tile(arg_9, (1, tf.shape(arg_0)[0], 1))
            arg_10 = tf.get_variable('init_c', [arg_2, 1, arg_1])
            arg_10 = tf.tile(arg_10, (1, tf.shape(arg_0)[0], 1))
        else:
            arg_9 = arg_10 = tf.zeros([arg_2, tf.shape(arg_0)[0], arg_1])

        arg_5 = arg_5 or arg_9
        arg_6 = arg_6 or arg_10

        with tf.variable_scope('cudnn_lstm', arg_8=arg_8):
            def single_cell(): return tf.contrib.cudnn_rnn.CudnnCompatibleLSTMCell(arg_1)

            arg_11 = tf.nn.rnn_cell.MultiRNNCell([single_cell() for _ in range(arg_2)])

            arg_0 = tf.transpose(arg_0, (1, 0, 2))

            arg_12 = tuple([tf.nn.rnn_cell.LSTMStateTuple(ic, ih) for ih, ic in
                          zip(tf.unstack(arg_5, axis=0), tf.unstack(arg_6, axis=0))])

            arg_13, arg_14 = tf.nn.dynamic_rnn(arg_11=arg_11, inputs=arg_0, time_major=True, initial_state=arg_12)

            arg_13 = tf.transpose(arg_13, (1, 0, 2))
            arg_15 = arg_14[-1].h
            arg_16 = arg_14[-1].c

            # Extract last states if they are provided
            if arg_4 is not None:
                arg_17 = tf.stack([tf.range(tf.shape(arg_13)[0]), arg_4-1], axis=1)
                arg_15 = tf.gather_nd(arg_13, arg_17)

            return arg_13, (arg_15, arg_16)

CuDNN Compatible LSTM implementation . It should be used to load models saved with CudnnLSTMCell to run on CPU .


def
Func
(
arg_0
,
*
arg_1
)
:
arg_2
=
arg_0
.
render_context
[
BLOCK_CONTEXT_KEY
]
for
arg_3
in
arg_1
:
arg_4
=
arg_2
.
get_block
(
arg_3
)
if
arg_4
is
not
:
return
arg_4
raise
template
.
TemplateSyntaxError
(
'No widget found for: %r'
%
(
arg_1
,
)
)

def Func(arg_0, *arg_1):
    '''
    Find the first matching block in the current block_context
    '''
    arg_2 = arg_0.render_context[BLOCK_CONTEXT_KEY]
    for arg_3 in arg_1:
        arg_4 = arg_2.get_block(arg_3)
        if arg_4 is not None:
            return arg_4

    raise template.TemplateSyntaxError('No widget found for: %r' % (arg_1,))


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=1):
        r'''Method to calculate a derivative of a mixture property with respect
        to temperature at constant pressure and composition,
        of a given order. Methods found valid by `select_valid_methods` are
        attempted until a method succeeds. If no methods are valid and succeed,
        None is returned.

        Calls `calculate_derivative_T` internally to perform the actual
        calculation.

        .. math::
            \text{derivative} = \frac{d (\text{property})}{d T}|_{P, z}

        Parameters
        ----------
        T : float
            Temperature at which to calculate the derivative, [K]
        P : float
            Pressure at which to calculate the derivative, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        order : int
            Order of the derivative, >= 1

        Returns
        -------
        d_prop_d_T_at_P : float
            Calculated derivative property, [`units/K^order`]
        '''
        arg_6 = arg_0.select_valid_methods(arg_1, arg_2, arg_3, arg_4)
        for arg_7 in arg_6:
            try:
                return arg_0.calculate_derivative_T(arg_1, arg_2, arg_3, arg_4, arg_7, arg_5)
            except:
                pass
        return None

r Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition of a given order . Methods found valid by select_valid_methods are attempted until a method succeeds . If no methods are valid and succeed None is returned .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_0
[
'status'
]
==
'SUCCESS'
:
arg_2
=
arg_0
[
'artifacts'
]
[
'objects'
]
[
'location'
]
arg_3
=
arg_0
[
'artifacts'
]
[
'objects'
]
[
'paths'
]
[
0
]
bot
.
custom
(
"MD5HASH"
,
arg_0
[
'file_hash'
]
,
'CYAN'
)
bot
.
custom
(
"SIZE"
,
arg_0
[
'size'
]
,
'CYAN'
)
bot
.
custom
(
arg_0
[
'status'
]
,
arg_2
+
arg_3
,
'CYAN'
)
else
:
bot
.
custom
(
arg_0
[
'status'
]
,
'see logs for details'
,
'CYAN'
)
bot
.
custom
(
"LOGS"
,
arg_0
[
'logUrl'
]
,
'CYAN'
)
if
"public_url"
in
arg_0
:
bot
.
custom
(
'URL'
,
arg_0
[
'public_url'
]
,
'CYAN'
)
if
arg_1
!=
:
with
open
(
arg_1
,
'w'
)
as
filey
:
if
arg_0
[
'status'
]
==
'SUCCESS'
:
filey
.
writelines
(
'MD5HASH %s\n'
%
arg_0
[
'file_hash'
]
)
filey
.
writelines
(
'SIZE %s\n'
%
arg_0
[
'size'
]
)
filey
.
writelines
(
'%s %s%s\n'
%
(
arg_0
[
'status'
]
,
arg_2
,
arg_3
)
)
filey
.
writelines
(
'LOGS %s\n'
%
arg_0
[
'logUrl'
]
)
if
"public_url"
in
arg_0
:
filey
.
writelines
(
'URL %s\n'
%
arg_0
[
'public_url'
]
)

def Func(arg_0, arg_1=None):
    '''print the output to the console for the user. If the user wants the content
       also printed to an output file, do that.

       Parameters
       ==========
       response: the response from the builder, with metadata added
       output_file: if defined, write output also to file

    '''
    # If successful built, show container uri
    if arg_0['status'] == 'SUCCESS':
        arg_2 = arg_0['artifacts']['objects']['location']
        arg_3 = arg_0['artifacts']['objects']['paths'][0]
        bot.custom("MD5HASH", arg_0['file_hash'], 'CYAN')
        bot.custom("SIZE", arg_0['size'], 'CYAN')
        bot.custom(arg_0['status'], arg_2 + arg_3 , 'CYAN')
    else:
        bot.custom(arg_0['status'], 'see logs for details', 'CYAN')

    # Show the logs no matter what
    bot.custom("LOGS", arg_0['logUrl'], 'CYAN')

    # Did the user make the container public?
    if "public_url" in arg_0:
        bot.custom('URL', arg_0['public_url'], 'CYAN')

    # Does the user also need writing to an output file?
    if arg_1 != None:
        with open(arg_1, 'w') as filey:
            if arg_0['status'] == 'SUCCESS':
                filey.writelines('MD5HASH %s\n' % arg_0['file_hash'])
                filey.writelines('SIZE %s\n' % arg_0['size'])
            filey.writelines('%s %s%s\n' % (arg_0['status'], arg_2, arg_3))
            filey.writelines('LOGS %s\n' % arg_0['logUrl'])
            if "public_url" in arg_0:
                filey.writelines('URL %s\n' % arg_0['public_url'])

print the output to the console for the user . If the user wants the content also printed to an output file do that .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . collection . find ( ) . sort ( 'name' , pymongo . ASCENDING ) : arg_1 . append ( Service ( arg_2 ) ) return arg_1

def Func(arg_0):
        """
        Lists all services in mongodb storage.
        """
        arg_1 = []
        for arg_2 in arg_0.collection.find().sort('name', pymongo.ASCENDING):
            arg_1.append(Service(arg_2))
        return arg_1


def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1) -> arg_1:
    """
    Calculate the Funcsselt number.

    :param L: [m] heat transfer surface characteristic length.
    :param h: [W/K/m2] convective heat transfer coefficient.
    :param k: [W/K/m] fluid thermal conductivity.

    :returns: float
    """

    return arg_2 * arg_0 / arg_3

Calculate the Nusselt number.

    :param L: [m] heat transfer surface characteristic length.
    :param h: [W/K/m2] convective heat transfer coefficient.
    :param k: [W/K/m] fluid thermal conductivity.

    :returns: float


def Func ( arg_0 ) : arg_1 = record_get_field_instances ( arg_0 . record , '020' ) for arg_2 in arg_1 : for arg_3 , ( arg_4 , arg_5 ) in enumerate ( arg_2 [ 0 ] ) : if arg_4 == 'a' : arg_2 [ 0 ] [ arg_3 ] = ( 'a' , arg_5 . replace ( "-" , "" ) . strip ( ) )

def Func(arg_0):
        """Remove dashes from ISBN."""
        arg_1 = record_get_field_instances(arg_0.record, '020')
        for arg_2 in arg_1:
            for arg_3, (arg_4, arg_5) in enumerate(arg_2[0]):
                if arg_4 == 'a':
                    arg_2[0][arg_3] = ('a', arg_5.replace("-", "").strip())


return Response(OrderedDict([
        ('count', data['count']),
        ('next', next_page),
        ('previous', previous_page),
        ('results', data['results'])
    ]))

def Func ( arg_0 , arg_1 ) : arg_2 = urlparse ( arg_1 . build_absolute_uri ( ) ) . _replace ( query = None ) . geturl ( ) arg_3 = None arg_4 = None if arg_0 [ 'next' ] : arg_3 = "{base_url}?{query_parameters}" . format ( base_url = arg_2 , query_parameters = urlparse ( arg_0 [ 'next' ] ) . query , ) arg_3 = arg_3 . rstrip ( '?' ) if arg_0 [ 'previous' ] : arg_4 = "{base_url}?{query_parameters}" . format ( base_url = arg_2 , query_parameters = urlparse ( arg_0 [ 'previous' ] or "" ) . query , ) arg_4 = arg_4 . rstrip ( '?' ) return Response ( OrderedDict ( [ ( 'count' , arg_0 [ 'count' ] ) , ( 'next' , arg_3 ) , ( 'previous' , arg_4 ) , ( 'results' , arg_0 [ 'results' ] ) ] ) )

def Func(arg_0, arg_1):
    """
    Update pagination links in course catalog data and return DRF Response.

    Arguments:
        data (dict): Dictionary containing catalog courses.
        request (HttpRequest): Current request object.

    Returns:
        (Response): DRF response object containing pagination links.
    """
    arg_2 = urlparse(arg_1.build_absolute_uri())._replace(query=None).geturl()

    arg_3 = None
    arg_4 = None

    if arg_0['next']:
        arg_3 = "{base_url}?{query_parameters}".format(
            base_url=arg_2,
            query_parameters=urlparse(arg_0['next']).query,
        )
        arg_3 = arg_3.rstrip('?')
    if arg_0['previous']:
        arg_4 = "{base_url}?{query_parameters}".format(
            base_url=arg_2,
            query_parameters=urlparse(arg_0['previous'] or "").query,
        )
        arg_4 = arg_4.rstrip('?')

    return Response(OrderedDict([
        ('count', arg_0['count']),
        ('next', arg_3),
        ('previous', arg_4),
        ('results', arg_0['results'])
    ]))

Update pagination links in course catalog data and return DRF Response .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 0 ) : arg_4 = arg_0 . regexs . get ( arg_1 , CommandChainDispatcher ( ) ) arg_4 . add ( arg_2 , arg_3 ) arg_0 . regexs [ arg_1 ] = arg_4

def Func(arg_0, arg_1, arg_2, arg_3= 0 ):
        """ Adds a target regexp for dispatching """

        arg_4 = arg_0.regexs.get(arg_1, CommandChainDispatcher())
        arg_4.add(arg_2,arg_3)
        arg_0.regexs[arg_1] = arg_4