def Func ( arg_0 , arg_1 ) : arg_0 . presence = MucPresence ( arg_1 ) arg_2 = arg_1 . get_type ( ) if arg_2 == "unavailable" : arg_0 . role = "none" arg_0 . affiliation = "none" arg_0 . room_jid = arg_0 . presence . get_from ( ) arg_0 . nick = arg_0 . room_jid . resource arg_7 = arg_0 . presence . get_muc_child ( ) if isinstance ( arg_7 , MucUserX ) : arg_8 = arg_7 . get_items ( ) for arg_9 in arg_8 : if not isinstance ( arg_9 , MucItem ) : continue if arg_9 . role : arg_0 . role = arg_9 . role if arg_9 . affiliation : arg_0 . affiliation = arg_9 . affiliation if arg_9 . jid : arg_0 . real_jid = arg_9 . jid if arg_9 . nick : arg_0 . new_nick = arg_9 . nick break

def Func(arg_0,arg_1):
        """
        Update user information.

        :Parameters:
            - `presence`: a presence stanza with user information update.
        :Types:
            - `presence`: `MucPresence`
        """
        arg_0.presence=MucPresence(arg_1)
        arg_2=arg_1.get_type()
        if arg_2=="unavailable":
            arg_0.role="none"
            arg_0.affiliation="none"
        arg_0.room_jid=arg_0.presence.get_from()
        arg_0.nick=arg_0.room_jid.resource
        arg_7=arg_0.presence.get_muc_child()
        if isinstance(arg_7,MucUserX):
            arg_8=arg_7.get_items()
            for arg_9 in arg_8:
                if not isinstance(arg_9,MucItem):
                    continue
                if arg_9.role:
                    arg_0.role=arg_9.role
                if arg_9.affiliation:
                    arg_0.affiliation=arg_9.affiliation
                if arg_9.jid:
                    arg_0.real_jid=arg_9.jid
                if arg_9.nick:
                    arg_0.new_nick=arg_9.nick
                break


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
arg_1
if
arg_1
not
in
arg_0
.
chart
[
arg_3
]
:
arg_0
.
chart
[
arg_3
]
.
append
(
arg_1
)
if
arg_0
.
trace
:
print
'%10s: added %s'
%
(
caller
(
2
)
,
arg_1
)
if
not
arg_6
:
arg_0
.
extender
(
arg_1
)
else
:
arg_0
.
predictor
(
arg_1
)

def Func(arg_0, arg_1):
        "Add edge to chart, and see if it extends or predicts another edge."
        arg_2, arg_3, arg_4, arg_5, arg_6 = arg_1
        if arg_1 not in arg_0.chart[arg_3]:
            arg_0.chart[arg_3].append(arg_1)
            if arg_0.trace:
                print '%10s: added %s' % (caller(2), arg_1)
            if not arg_6:
                arg_0.extender(arg_1)
            else:
                arg_0.predictor(arg_1)

Add edge to chart and see if it extends or predicts another edge .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . tile_pyramid . Func ( arg_1 , arg_2 ) : yield arg_0 . tile ( * arg_3 . id )

def Func(arg_0, arg_1, arg_2):
        """
        Return all tiles intersecting with input geometry.

        Parameters
        ----------
        geometry : ``shapely.geometry``
        zoom : integer
            zoom level

        Yields
        ------
        intersecting tiles : ``BufferedTile``
        """
        for arg_3 in arg_0.tile_pyramid.Func(arg_1, arg_2):
            yield arg_0.tile(*arg_3.id)

Return all tiles intersecting with input geometry .


return {
        "id": str(obj.file_id),
        "filename": obj.key,
        "filesize": obj.file.size,
        "checksum": obj.file.checksum,
    }

def Func ( arg_0 ) : return { "id" : str ( arg_0 . file_id ) , "filename" : arg_0 . key , "filesize" : arg_0 . file . size , "checksum" : arg_0 . file . checksum , }

def Func(arg_0):
    """Serialize a object.

    :param obj: A :class:`invenio_files_rest.models.ObjectVersion` instance.
    :returns: A dictionary with the fields to serialize.
    """
    return {
        "id": str(arg_0.file_id),
        "filename": arg_0.key,
        "filesize": arg_0.file.size,
        "checksum": arg_0.file.checksum,
    }


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
'projects/{}/jobs/{}'
.
format
(
arg_1
,
arg_2
)
arg_4
=
arg_0
.
_mlengine
.
projects
(
)
.
jobs
(
)
.
get
(
name
=
arg_3
)
while
True
:
try
:
return
arg_4
.
execute
(
)
except
HttpError
as
e
:
if
e
.
resp
.
status
==
429
:
time
.
sleep
(
30
)
else
:
arg_0
.
log
.
error
(
'Failed to get MLEngine job: {}'
.
format
(
e
)
)
raise

def Func(arg_0, arg_1, arg_2):
        """
        Gets a MLEngine job based on the job name.

        :return: MLEngine job object if succeed.
        :rtype: dict

        Raises:
            googleapiclient.errors.HttpError: if HTTP error is returned from server
        """
        arg_3 = 'projects/{}/jobs/{}'.format(arg_1, arg_2)
        arg_4 = arg_0._mlengine.projects().jobs().get(name=arg_3)
        while True:
            try:
                return arg_4.execute()
            except HttpError as e:
                if e.resp.status == 429:
                    # polling after 30 seconds when quota failure occurs
                    time.sleep(30)
                else:
                    arg_0.log.error('Failed to get MLEngine job: {}'.format(e))
                    raise

Gets a MLEngine job based on the job name .


def Func(arg_0):
    """Returns the root if this is a nested type, or itself if its the root."""
    arg_1 = arg_0
    while arg_1.containing_type is not None:
      arg_1 = arg_1.containing_type
    return arg_1

Returns the root if this is a nested type or itself if its the root .


def Func(arg_0, arg_1, arg_2=arg_3.SCHEDULE_HOLD):
        """
        Set the target temperature to the desired fahrenheit, with more granular control of the
        hold mode

        :param fahrenheit: The desired temperature in F
        :param mode: The desired mode to operate in
        """
        arg_5 = fahrenheit_to_nuheat(arg_1)
        arg_0.set_target_temperature(arg_5, arg_2)

Set the target temperature to the desired fahrenheit with more granular control of the hold mode


def
Func
(
arg_0
)
:
if
re
.
search
(
"[A-Z]"
,
arg_0
)
and
re
.
search
(
"[a-z]"
,
arg_0
)
:
return
arg_0
arg_1
=
re
.
split
(
' +'
,
arg_0
)
arg_2
=
[
arg_1
[
0
]
.
capitalize
(
)
]
for
arg_3
in
arg_1
[
1
:
]
:
if
arg_3
.
upper
(
)
in
COMMON_ACRONYMS
:
arg_2
.
append
(
arg_3
.
upper
(
)
)
elif
len
(
arg_3
)
>
3
:
arg_2
.
append
(
arg_3
.
capitalize
(
)
)
else
:
arg_2
.
append
(
arg_3
.
lower
(
)
)
return
" "
.
join
(
arg_2
)

def Func(arg_0):
    """Try to capitalize properly a title string."""
    if re.search("[A-Z]", arg_0) and re.search("[a-z]", arg_0):
        return arg_0
    arg_1 = re.split(' +', arg_0)
    arg_2 = [arg_1[0].capitalize()]
    for arg_3 in arg_1[1:]:
        if arg_3.upper() in COMMON_ACRONYMS:
            arg_2.append(arg_3.upper())
        elif len(arg_3) > 3:
            arg_2.append(arg_3.capitalize())
        else:
            arg_2.append(arg_3.lower())
    return " ".join(arg_2)

Try to capitalize properly a title string .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
[
1
]
arg_2
=
arg_0
[
2
]
arg_0
=
[
x
.
lstrip
(
'%s '
%
arg_1
)
for
x
in
arg_0
[
3
:
]
]
arg_3
=
arg_0
.
index
(
'OBJECT METADATA'
)
arg_4
=
arg_0
.
index
(
'COLUMN DEFINITIONS'
)
arg_5
=
arg_0
.
index
(
'LIGHTCURVE'
)
arg_6
=
' '
.
join
(
arg_0
[
arg_3
+
1
:
arg_4
1
]
)
arg_7
=
' '
.
join
(
arg_0
[
arg_4
+
1
:
arg_5
1
]
)
arg_6
=
json
.
loads
(
arg_6
)
arg_7
=
json
.
loads
(
arg_7
)
return
arg_6
,
arg_7
,
arg_2

def Func(arg_0):
    '''
    This parses the header of the LCC CSV V1 LC format.

    '''

    # the first three lines indicate the format name, comment char, separator
    arg_1 = arg_0[1]
    arg_2 = arg_0[2]

    arg_0 = [x.lstrip('%s ' % arg_1) for x in arg_0[3:]]

    # next, find the indices of the various LC sections
    arg_3 = arg_0.index('OBJECT METADATA')
    arg_4 = arg_0.index('COLUMN DEFINITIONS')
    arg_5 = arg_0.index('LIGHTCURVE')

    arg_6 = ' ' .join(arg_0[arg_3+1:arg_4-1])
    arg_7 = ' ' .join(arg_0[arg_4+1:arg_5-1])
    arg_6 = json.loads(arg_6)
    arg_7 = json.loads(arg_7)

    return arg_6, arg_7, arg_2

This parses the header of the LCC CSV V1 LC format .


def Func(arg_0, arg_1, arg_2):
    """
    Gets the value of a given field from the input record
    """
    if isinstance(arg_1, dict):
      if not arg_2 in arg_1:
        arg_3 = ", ".join(
          key for key in arg_1.keys() if not key.startswith("_")
        )
        raise ValueError(
          "Unknown field name '%s' in input record. Known fields are '%s'.\n"
          "This could be because input headers are mislabeled, or because "
          "input data rows do not contain a value for '%s'." % (
            arg_2, arg_3, arg_2
          )
        )
      return arg_1[arg_2]
    else:
      return getattr(arg_1, arg_2)


def Func ( arg_0 , arg_1 ) : arg_0 . section += 1 arg_0 . writeln ( ) arg_0 . format_children ( arg_1 ) arg_0 . section -= 1 arg_0 . writeln ( )

def Func(arg_0, arg_1):
        """display a section as text
        """
        arg_0.section += 1
        arg_0.writeln()
        arg_0.format_children(arg_1)
        arg_0.section -= 1
        arg_0.writeln()


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_locked
try
:
return
repr
(
arg_0
.
f_get
(
)
)
except
Exception
:
return
'No Evaluation possible (yet)!'
finally
:
arg_0
.
_locked
=
arg_1

def Func(arg_0):
        """String summary of the value handled by the parameter.

        Note that representing the parameter as a string accesses its value,
        but for simpler debugging, this does not lock the parameter or counts as usage!

        Calls `__repr__` of the contained value.

        """
        arg_1 = arg_0._locked
        try:
            return repr(arg_0.f_get())
        except Exception:
            return 'No Evaluation possible (yet)!'
        finally:
            arg_0._locked = arg_1

String summary of the value handled by the parameter .


def
Func
(
arg_0
,
arg_1
=
)
:
assert
len
(
arg_0
)
>
0
,
"No traces found"
arg_2
=
PrettyTable
(
[
"#"
]
+
[
arg_4
.
prettyPrintTitle
(
)
for
arg_4
in
arg_0
]
)
for
arg_3
in
xrange
(
len
(
arg_0
[
0
]
.
data
)
)
:
if
arg_1
and
arg_1
.
data
[
arg_3
]
:
arg_2
.
add_row
(
[
"<reset>"
]
*
(
len
(
arg_0
)
+
1
)
)
arg_2
.
add_row
(
[
arg_3
]
+
[
arg_4
.
prettyPrintDatum
(
arg_4
.
data
[
arg_3
]
)
for
arg_4
in
arg_0
]
)
return
arg_2
.
get_string
(
)
.
encode
(
"utf-8"
)

def Func(arg_0, arg_1=None):
    """
    Returns pretty-printed table of traces.

    @param traces (list) Traces to print in table
    @param breakOnResets (BoolsTrace) Trace of resets to break table on

    @return (string) Pretty-printed table of traces.
    """
    assert len(arg_0) > 0, "No traces found"
    arg_2 = PrettyTable(["#"] + [arg_4.prettyPrintTitle() for arg_4 in arg_0])

    for arg_3 in xrange(len(arg_0[0].data)):
      if arg_1 and arg_1.data[arg_3]:
        arg_2.add_row(["<reset>"] * (len(arg_0) + 1))
      arg_2.add_row([arg_3] +
        [arg_4.prettyPrintDatum(arg_4.data[arg_3]) for arg_4 in arg_0])

    return arg_2.get_string().encode("utf-8")

Returns pretty - printed table of traces .


"""    <script>        requirejs.config({            paths: {                qVisualization: "https://qvisualization.mybluemix.net/q-visualizations"            }        });        data = $data;        dataValues = [];        for (var i = 0; i < data.length; i++) {            // Coordinates            var x = data[i][0];            var y = data[i][1];            var z = data[i][2];            var point = {'x': x,                        'y': y,                        'z': z};            dataValues.push(point);        }        require(["qVisualization"], function(qVisualizations) {            // Plot figure            qVisualizations.plotState("bloch_$divNumber",                                      "bloch",                                      dataValues,                                      $options);        });    </script>    """

def Func(arg_0, arg_1=None):
    """ Create a bloch sphere representation.

        Graphical representation of the input array, using as much bloch
        spheres as qubit are required.

        Args:
            rho (array): State vector or density matrix
            figsize (tuple): Figure size in pixels.
    """

    # HTML
    arg_2 = Template("""

    """)

    # JavaScript
    arg_3 = Template("""

    """)
    arg_0 = _validate_input_state(arg_0)
    if arg_1 is None:
        arg_4 = {}
    else:
        arg_4 = {'width': arg_1[0], 'height': arg_1[1]}

    # Process data and execute
    arg_5 = int(np.log2(len(arg_0)))

    arg_6 = []
    for arg_7 in range(arg_5):
        arg_8 = [Pauli.pauli_single(arg_5, arg_7, 'X'), Pauli.pauli_single(arg_5, arg_7, 'Y'),
                         Pauli.pauli_single(arg_5, arg_7, 'Z')]
        arg_9 = list(map(lambda x: np.real(np.trace(np.dot(x.to_matrix(), arg_0))),
                               arg_8))
        arg_6.append(arg_9)

    arg_10 = str(time.time())
    arg_10 = re.sub('[.]', '', arg_10)

    arg_11 = arg_2.substitute({
        'divNumber': arg_10
    })

    arg_12 = arg_3.substitute({
        'data': arg_6,
        'divNumber': arg_10,
        'options': arg_4
    })

    display(HTML(arg_11 + arg_12))


def Func ( arg_0 , arg_1 ) : arg_2 = deepcopy ( [ n for n in arg_0 [ 'graph' ] . nodes ( ) if n . type == 'op' ] [ 0 ] ) arg_3 = QuantumRegister ( len ( arg_1 . get_physical_bits ( ) ) , 'q' ) arg_4 = [ ( arg_3 , arg_1 [ a ] ) for a in arg_2 . qargs ] arg_2 . qargs = arg_2 . op . qargs = arg_4 arg_2 . pop ( 'name' ) return arg_2

def Func(arg_0, arg_1):
    """Return op implementing a virtual gate on given layout."""

    arg_2 = deepcopy([n for n in arg_0['graph'].nodes() if n.type == 'op'][0])

    # Workaround until #1816, apply mapped to qargs to both DAGNode and op
    arg_3 = QuantumRegister(len(arg_1.get_physical_bits()), 'q')
    arg_4 = [(arg_3, arg_1[a]) for a in arg_2.qargs]
    arg_2.qargs = arg_2.op.qargs = arg_4

    arg_2.pop('name')

    return arg_2

Return op implementing a virtual gate on given layout .


def Func(arg_0, arg_1="tank.log"):
        """ Set up logging """
        arg_2 = logging.getLogger('')
        arg_0.log_filename = arg_1
        arg_0.core.add_artifact_file(arg_0.log_filename)

        arg_3 = logging.FileHandler(arg_0.log_filename)
        arg_3.setLevel(logging.DEBUG)
        arg_3.setFormatter(
            logging.Formatter(
                "%(asctime)s [%(levelname)s] %(name)s %(message)s"))
        arg_2.addHandler(arg_3)
        arg_4 = logging.StreamHandler(sys.stdout)
        arg_5 = logging.StreamHandler(sys.stderr)

        # fmt_verbose = logging.Formatter(
        #     "%(asctime)s [%(levelname)s] %(name)s %(message)s")
        arg_6 = logging.Formatter(
            "%(asctime)s %(levelname)s: %(message)s", "%H:%M:%S")

        arg_4.setLevel(logging.INFO)
        arg_4.setFormatter(arg_6)
        arg_5.setFormatter(arg_6)

        arg_7 = SingleLevelFilter(logging.ERROR, True)
        arg_8 = SingleLevelFilter(logging.WARNING, True)
        arg_9 = SingleLevelFilter(logging.CRITICAL, True)
        arg_4.addFilter(arg_7)
        arg_4.addFilter(arg_8)
        arg_4.addFilter(arg_9)
        arg_2.addHandler(arg_4)

        arg_10 = SingleLevelFilter(logging.INFO, True)
        arg_11 = SingleLevelFilter(logging.DEBUG, True)
        arg_5.addFilter(arg_10)
        arg_5.addFilter(arg_11)
        arg_2.addHandler(arg_5)


return (
        round_ret.astype("int")
        if (dep_vector_is_int and np.all(np.isclose(round_ret, ret, FP_RTOL, FP_ATOL)))
        else ret
    )

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . dep_vector . dtype . name . startswith ( "int" ) arg_3 = arg_0 . dep_vector . dtype . name . startswith ( "complex" ) if ( arg_0 . interp , arg_0 . indep_scale ) == ( "CONTINUOUS" , "LOG" ) : arg_4 = scipy . interpolate . interp1d ( np . log10 ( arg_0 . indep_vector ) , arg_0 . dep_vector ) arg_5 = arg_4 ( np . log10 ( arg_1 ) ) elif ( arg_0 . interp , arg_0 . indep_scale ) == ( "CONTINUOUS" , "LINEAR" ) : arg_6 = ( arg_0 . dep_vector . astype ( np . float64 ) if not arg_3 else arg_0 . dep_vector ) arg_4 = scipy . interpolate . interp1d ( arg_0 . indep_vector , arg_6 ) arg_5 = arg_4 ( arg_1 ) else : arg_4 = scipy . interpolate . interp1d ( arg_0 . indep_vector , arg_0 . dep_vector , kind = "zero" ) arg_5 = arg_4 ( arg_1 ) arg_7 = np . all ( np . isclose ( arg_0 . indep_vector [ - 1 ] , arg_1 [ - 1 ] , FP_RTOL , FP_ATOL ) ) if arg_7 : arg_5 [ - 1 ] = arg_0 . dep_vector [ - 1 ] arg_8 = np . round ( arg_5 , 0 ) return ( arg_8 . astype ( "int" ) if ( arg_2 and np . all ( np . isclose ( arg_8 , arg_5 , FP_RTOL , FP_ATOL ) ) ) else arg_5 )

def Func(arg_0, arg_1):
    """Create new dependent variable vector."""
    arg_2 = arg_0.dep_vector.dtype.name.startswith("int")
    arg_3 = arg_0.dep_vector.dtype.name.startswith("complex")
    if (arg_0.interp, arg_0.indep_scale) == ("CONTINUOUS", "LOG"):
        arg_4 = scipy.interpolate.interp1d(
            np.log10(arg_0.indep_vector), arg_0.dep_vector
        )
        arg_5 = arg_4(np.log10(arg_1))
    elif (arg_0.interp, arg_0.indep_scale) == ("CONTINUOUS", "LINEAR"):
        arg_6 = (
            arg_0.dep_vector.astype(np.float64)
            if not arg_3
            else arg_0.dep_vector
        )
        arg_4 = scipy.interpolate.interp1d(arg_0.indep_vector, arg_6)
        arg_5 = arg_4(arg_1)
    else:  # wave.interp == 'STAIRCASE'
        arg_4 = scipy.interpolate.interp1d(
            arg_0.indep_vector, arg_0.dep_vector, kind="zero"
        )
        # Interpolator does not return the right value for the last
        # data point, it gives the previous "stair" value
        arg_5 = arg_4(arg_1)
        arg_7 = np.all(
            np.isclose(arg_0.indep_vector[-1], arg_1[-1], FP_RTOL, FP_ATOL)
        )
        if arg_7:
            arg_5[-1] = arg_0.dep_vector[-1]
    arg_8 = np.round(arg_5, 0)
    return (
        arg_8.astype("int")
        if (arg_2 and np.all(np.isclose(arg_8, arg_5, FP_RTOL, FP_ATOL)))
        else arg_5
    )


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
if
arg_1
is
:
return
arg_2
if
arg_2
is
:
return
arg_1
if
(
arg_1
==
arg_2
)
if
arg_3
else
(
arg_1
is
arg_2
)
:
return
arg_1
raise
ValueError
(
"Incompatible values: %s != %s"
%
(
arg_1
,
arg_2
)
)

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """Helper to merge which handles merging one value."""
    if arg_1 is None:
      return arg_2
    if arg_2 is None:
      return arg_1
    if (arg_1 == arg_2) if arg_3 else (arg_1 is arg_2):
      return arg_1
    raise ValueError("Incompatible values: %s != %s" % (arg_1, arg_2))

Helper to merge which handles merging one value .


return request_user_has_implicit_access_via_jwt(decoded_jwt, ENTERPRISE_ENROLLMENT_API_ADMIN_ROLE, obj)

def Func(arg_0, arg_1):  # pylint: disable=unused-argument
    """
    Check that if request user has implicit access to `ENTERPRISE_ENROLLMENT_API_ADMIN_ROLE` feature role.

    Returns:
        boolean: whether the request user has access or not
    """
    arg_2 = get_request_or_stub()
    arg_3 = get_decoded_jwt_from_request(arg_2)
    return request_user_has_implicit_access_via_jwt(arg_3, ENTERPRISE_ENROLLMENT_API_ADMIN_ROLE, arg_1)

Check that if request user has implicit access to ENTERPRISE_ENROLLMENT_API_ADMIN_ROLE feature role .


def Func(arg_0, arg_1=False):
    '''Wraps the input angle to 360.0 degrees.

    Parameters
    ----------

    angle : float
        The angle to wrap around 360.0 deg.

    radians : bool
        If True, will assume that the input is in radians. The output will then
        also be in radians.

    Returns
    -------

    float
        Wrapped angle. If radians is True: input is assumed to be in radians,
        output is also in radians.

    '''

    if arg_1:
        arg_2 = arg_0 % (2.0*pi_value)
        if arg_2 < 0.0:
            arg_2 = 2.0*pi_value + arg_2

    else:

        arg_2 = arg_0 % 360.0
        if arg_2 < 0.0:
            arg_2 = 360.0 + arg_2

    return arg_2

Wraps the input angle to 360 . 0 degrees .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Check the integrity of the datapackage.json
        """

        arg_4 = []
        with cd(arg_1.rootdir):
            arg_5 = arg_2.get('files', ['*'])
            arg_6 = arg_1.find_matching_files(arg_5)
            arg_5 = glob2.glob("**/*")
            arg_7 = [arg_9 for arg_9 in arg_5 if os.path.isfile(arg_9) and arg_9 != "datapackage.json"]

            arg_8 = list(set(arg_6 + arg_7))
            arg_8.sort()

            for arg_9 in arg_8:
                if arg_9 in arg_6 and arg_9 in arg_7:
                    arg_10 = arg_1.get_resource(arg_9)
                    arg_11 = arg_10['sha256']
                    arg_12 = compute_sha256(arg_9)
                    if arg_12 != arg_11:
                        arg_4.append({
                            'target': arg_9,
                            'rules': "",
                            'validator': arg_0.name,
                            'description': arg_0.description,
                            'status': 'ERROR',
                            'message': "Mismatch in checksum on disk and in datapackage.json"
                        })
                    else:
                        arg_4.append({
                            'target': arg_9,
                            'rules': "",
                            'validator': arg_0.name,
                            'description': arg_0.description,
                            'status': 'OK',
                            'message': ""
                        })
                elif arg_9 in arg_6:
                    arg_4.append({
                        'target': arg_9,
                        'rules': "",
                        'validator': arg_0.name,
                        'description': arg_0.description,
                        'status': 'ERROR',
                        'message': "In datapackage.json but not in repo"
                    })
                else:
                    arg_4.append({
                        'target': arg_9,
                        'rules': "",
                        'validator': arg_0.name,
                        'description': arg_0.description,
                        'status': 'ERROR',
                        'message': "In repo but not in datapackage.json"
                        })

        return arg_4

Check the integrity of the datapackage . json


def Func ( arg_0 , arg_1 , arg_2 ) : arg_2 = listify ( arg_2 ) arg_3 = np . arange ( arg_0 . N , arg_0 . N + len ( arg_2 ) ) arg_0 . pos = np . vstack ( [ arg_0 . pos , arg_1 ] ) arg_0 . rad = np . hstack ( [ arg_0 . rad , np . zeros ( len ( arg_2 ) ) ] ) arg_0 . setup_variables ( ) arg_0 . trigger_parameter_change ( ) arg_4 = arg_0 . param_particle_rad ( arg_3 ) arg_0 . trigger_update ( arg_4 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Add a particle or list of particles given by a list of positions and
        radii, both need to be array-like.

        Parameters
        ----------
        pos : array-like [N, 3]
            Positions of all new particles

        rad : array-like [N]
            Corresponding radii of new particles

        Returns
        -------
        inds : N-element numpy.ndarray.
            Indices of the added particles.
        """
        arg_2 = listify(arg_2)
        # add some zero mass particles to the list (same as not having these
        # particles in the image, which is true at this moment)
        arg_3 = np.arange(arg_0.N, arg_0.N+len(arg_2))
        arg_0.pos = np.vstack([arg_0.pos, arg_1])
        arg_0.rad = np.hstack([arg_0.rad, np.zeros(len(arg_2))])

        # update the parameters globally
        arg_0.setup_variables()
        arg_0.trigger_parameter_change()

        # now request a drawing of the particle plz
        arg_4 = arg_0.param_particle_rad(arg_3)
        arg_0.trigger_update(arg_4, arg_2)
        return arg_3

Add a particle or list of particles given by a list of positions and radii both need to be array - like .


(editable_dict: dict, editing_dict: dict)

def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) -> None : for arg_3 , arg_4 in arg_2 . items ( ) : if isinstance ( arg_4 , collections . Mapping ) : Func ( arg_0 . get ( arg_3 , { } ) , arg_4 ) else : arg_0 [ arg_3 ] = arg_4

def Func(arg_0: arg_1, arg_2: arg_1) -> None:
    """Updates dict recursively

    You need to use this function to update dictionary if depth of editing_dict is more then 1

    Args:
        editable_dict: dictionary, that will be edited
        editing_dict: dictionary, that contains edits
    Returns:
        None
    """
    for arg_3, arg_4 in arg_2.items():
        if isinstance(arg_4, collections.Mapping):
            Func(arg_0.get(arg_3, {}), arg_4)
        else:
            arg_0[arg_3] = arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = np . max ( [ arg_0 . domain [ 0 ] , arg_1 [ 0 ] ] ) arg_3 = np . min ( [ arg_0 . domain [ 1 ] , arg_1 [ 1 ] ] ) Func = np . asarray ( arg_0 . breaks_ ( [ arg_2 , arg_3 ] ) ) Func = Func . compress ( ( Func >= arg_0 . domain [ 0 ] ) & ( Func <= arg_0 . domain [ 1 ] ) ) return Func

def Func(arg_0, arg_1):
        """
        Calculate breaks in data space and return them
        in transformed space.

        Expects limits to be in *transform space*, this
        is the same space as that where the domain is
        specified.

        This method wraps around :meth:`breaks_` to ensure
        that the calculated breaks are within the domain
        the transform. This is helpful in cases where an
        aesthetic requests breaks with limits expanded for
        some padding, yet the expansion goes beyond the
        domain of the transform. e.g for a probability
        transform the breaks will be in the domain
        ``[0, 1]`` despite any outward limits.

        Parameters
        ----------
        limits : tuple
            The scale limits. Size 2.

        Returns
        -------
        out : array_like
            Major breaks
        """
        # clip the breaks to the domain,
        # e.g. probabilities will be in [0, 1] domain
        arg_2 = np.max([arg_0.domain[0], arg_1[0]])
        arg_3 = np.min([arg_0.domain[1], arg_1[1]])
        Func = np.asarray(arg_0.breaks_([arg_2, arg_3]))

        # Some methods(mpl_breaks, extended_breaks) that
        # calculate breaks take the limits as guide posts and
        # not hard limits.
        Func = Func.compress((Func >= arg_0.domain[0]) &
                                 (Func <= arg_0.domain[1]))
        return Func

Calculate breaks in data space and return them in transformed space .


return get_user_token(
            user=user, purpose=HashPurpose.RESUME_LOGIN,
            minutes_valid=HASH_MINUTES_VALID[HashPurpose.RESUME_LOGIN],
        )

def Func ( arg_0 , arg_1 ) : arg_0 . check_secure ( ) arg_2 = arg_0 . validated_user ( arg_1 [ 'resume' ] , purpose = HashPurpose . RESUME_LOGIN , minutes_valid = HASH_MINUTES_VALID [ HashPurpose . RESUME_LOGIN ] , ) arg_0 . do_login ( arg_2 ) return get_user_token ( arg_2 = arg_2 , purpose = HashPurpose . RESUME_LOGIN , minutes_valid = HASH_MINUTES_VALID [ HashPurpose . RESUME_LOGIN ] , )

def Func(arg_0, arg_1):
        """
        Login with existing resume token.

        Either the token is valid and the user is logged in, or the token is
        invalid and a non-specific ValueError("Login failed.") exception is
        raised - don't be tempted to give clues to attackers as to why their
        logins are invalid!
        """
        # never allow insecure login
        arg_0.check_secure()

        # pull the username and auth_hash from the token
        arg_2 = arg_0.validated_user(
            arg_1['resume'], purpose=HashPurpose.RESUME_LOGIN,
            minutes_valid=HASH_MINUTES_VALID[HashPurpose.RESUME_LOGIN],
        )

        arg_0.do_login(arg_2)
        return get_user_token(
            arg_2=arg_2, purpose=HashPurpose.RESUME_LOGIN,
            minutes_valid=HASH_MINUTES_VALID[HashPurpose.RESUME_LOGIN],
        )


return "".join(text).lstrip('!').rjust(max(1, width), '!')

def Func(arg_0, arg_1=1):
    """
    Takes a decimal and returns base91 char string.
    With optional parameter for fix with output
    """
    arg_2 = []

    if not isinstance(arg_0, int_type):
        raise TypeError("Expected number to be int, got %s", type(arg_0))
    elif not isinstance(arg_1, int_type):
        raise TypeError("Expected width to be int, got %s", type(arg_0))
    elif arg_0 < 0:
        raise ValueError("Expected number to be positive integer")
    elif arg_0 > 0:
        arg_3 = ceil(log(arg_0) / log(91))

        for arg_4 in _range(int(arg_3), -1, -1):
            arg_5, arg_0 = divmod(arg_0, 91**arg_4)
            arg_2.append(chr(33 + arg_5))

    return "".join(arg_2).lstrip('!').rjust(max(1, arg_1), '!')

Takes a decimal and returns base91 char string . With optional parameter for fix with output


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ ] if arg_2 is None : for arg_4 in arg_1 : if np . all ( arg_4 [ 0 , : ] == arg_4 [ - 1 , : ] ) : if len ( arg_1 ) < 3 : arg_3 . append ( Point ( arg_4 [ 0 , : ] ) ) else : arg_3 . append ( LinearRing ( arg_4 ) ) else : arg_3 . append ( LineString ( arg_4 ) ) else : for arg_4 , arg_5 in zip ( arg_1 , arg_2 ) : arg_6 = np . nonzero ( arg_5 == MPLPATHCODE . MOVETO ) [ 0 ] arg_7 = np . nonzero ( arg_5 == MPLPATHCODE . CLOSEPOLY ) [ 0 ] try : arg_8 = [ LinearRing ( arg_4 [ start : stop + 1 , : ] ) for start , stop in zip ( arg_6 , arg_7 ) ] arg_3 . append ( Polygon ( arg_8 [ 0 ] , arg_8 [ 1 : ] ) ) except ValueError as err : if np . any ( stop - start - 1 == 0 ) : if arg_7 [ 0 ] < arg_6 [ 0 ] + 2 : pass else : arg_8 = [ LinearRing ( arg_4 [ start : stop + 1 , : ] ) for start , stop in zip ( arg_6 , arg_7 ) if stop >= start + 2 ] arg_3 . append ( Polygon ( arg_8 [ 0 ] , arg_8 [ 1 : ] ) ) else : raise ( err ) return arg_3

def Func(arg_0, arg_1, arg_2=None):
    """`Shapely`_ style contour formatter.

    Contours are returned as a list of :class:`shapely.geometry.LineString`,
    :class:`shapely.geometry.LinearRing`, and :class:`shapely.geometry.Point`
    geometry elements.

    Filled contours return a list of :class:`shapely.geometry.Polygon`
    elements instead.

    .. note:: If possible, `Shapely speedups`_ will be enabled.

    .. _Shapely: http://toblerity.org/shapely/manual.html

    .. _Shapely speedups: http://toblerity.org/shapely/manual.html#performance

    See Also
    --------
    `descartes <https://bitbucket.org/sgillies/descartes/>`_ : Use `Shapely`_
    or GeoJSON-like geometric objects as matplotlib paths and patches.

    """
    arg_3 = []
    if arg_2 is None:
        for arg_4 in arg_1:
            if np.all(arg_4[0, :] == arg_4[-1, :]):
                # Contour is single point.
                if len(arg_1) < 3:
                    arg_3.append(Point(arg_4[0, :]))
                # Contour is closed.
                else:
                    arg_3.append(LinearRing(arg_4))
            # Contour is open.
            else:
                arg_3.append(LineString(arg_4))
    else:
        for arg_4, arg_5 in zip(arg_1, arg_2):
            arg_6 = np.nonzero(arg_5 == MPLPATHCODE.MOVETO)[0]
            arg_7 = np.nonzero(arg_5 == MPLPATHCODE.CLOSEPOLY)[0]
            try:
                arg_8 = [LinearRing(arg_4[start:stop+1, :])
                        for start, stop in zip(arg_6, arg_7)]
                arg_3.append(Polygon(arg_8[0], arg_8[1:]))
            except ValueError as err:
                # Verify error is from degenerate (single point) polygon.
                if np.any(stop - start - 1 == 0):
                    # Polygon is single point, remove the polygon.
                    if arg_7[0] < arg_6[0]+2:
                        pass
                    # Polygon has single point hole, remove the hole.
                    else:
                        arg_8 = [
                            LinearRing(arg_4[start:stop+1, :])
                            for start, stop in zip(arg_6, arg_7)
                            if stop >= start+2]
                        arg_3.append(Polygon(arg_8[0], arg_8[1:]))
                else:
                    raise(err)
    return arg_3


def Func(arg_0, arg_1, arg_2=''):
        """Attaches a flask.Blueprint to the bundle

        :param bp: :class:`flask.Blueprint` object
        :param description: Optional description string
        :raises:
            - InvalidBlueprint if the Blueprint is not of type `flask.Blueprint`
        """

        if not isinstance(arg_1, Blueprint):
            raise InvalidBlueprint('Blueprints attached to the bundle must be of type {0}'.format(Blueprint))

        arg_0.blueprints.append((arg_1, arg_2))

Attaches a flask . Blueprint to the bundle


def Func ( arg_0 , arg_1 : arg_2 . Expr ) -> Optional [ arg_2 . Expr ] : if isinstance ( arg_1 . value , ( arg_2 . Constant , arg_2 . Name , arg_2 . NameConstant , arg_2 . Num , arg_2 . Str , ) , ) : return None return arg_1

def Func(arg_0, arg_1: arg_2.Expr) -> Optional[arg_2.Expr]:
        """Eliminate no-op constant expressions which are in the tree
        as standalone statements."""
        if isinstance(
            arg_1.value,
            (
                arg_2.Constant,  # type: ignore
                arg_2.Name,
                arg_2.NameConstant,
                arg_2.Num,
                arg_2.Str,
            ),
        ):
            return None
        return arg_1

Eliminate no - op constant expressions which are in the tree as standalone statements .


return self._gl_look_at(self.position, vec, self._up)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
)
:
if
arg_2
is
:
arg_1
=
Vector3
(
arg_2
)
if
arg_1
is
:
raise
ValueError
(
"vector or pos must be set"
)
return
arg_0
.
_gl_Func
(
arg_0
.
position
,
arg_1
,
arg_0
.
_up
)

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Look at a specific point

        :param vec: Vector3 position
        :param pos: python list [x, y, x]
        :return: Camera matrix
        """
        if arg_2 is None:
            arg_1 = Vector3(arg_2)

        if arg_1 is None:
            raise ValueError("vector or pos must be set")

        return arg_0._gl_Func(arg_0.position, arg_1, arg_0._up)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
[
"edit_cutsites"
,
"trim_overhang"
]
arg_4
=
arg_0
.
paramsdict
.
keys
(
)
arg_5
=
arg_4
+
arg_3
if
not
arg_1
in
arg_5
:
raise
IPyradParamsError
(
"Parameter key not recognized: {}"
.
format
(
arg_1
)
)
arg_1
=
str
(
arg_1
)
if
len
(
arg_1
)
<
3
:
arg_1
=
arg_0
.
paramsdict
.
keys
(
)
[
int
(
arg_1
)
]
try
:
arg_0
=
_paramschecker
(
arg_0
,
arg_1
,
arg_2
)
except
Exception
as
inst
:
raise
IPyradWarningExit
(
BAD_PARAMETER
.
format
(
arg_1
,
inst
,
arg_2
)
)

def Func(arg_0, arg_1, arg_2):
        """
        Set a parameter to a new value. Raises error if newvalue is wrong type.

        Note
        ----
        Use [Assembly].get_params() to see the parameter values currently
        linked to the Assembly object.

        Parameters
        ----------
        param : int or str
            The index (e.g., 1) or string name (e.g., "project_dir")
            for the parameter that will be changed.

        newvalue : int, str, or tuple
            The new value for the parameter selected for `param`. Use
            `ipyrad.get_params_info()` to get further information about
            a given parameter. If the wrong type is entered for newvalue
            (e.g., a str when it should be an int), an error will be raised.
            Further information about each parameter is also available
            in the documentation.

        Examples
        --------
        ## param 'project_dir' takes only a str as input
        [Assembly].Func('project_dir', 'new_directory')

        ## param 'restriction_overhang' must be a tuple or str, if str it is
        ## converted to a tuple with the second entry empty.
        [Assembly].Func('restriction_overhang', ('CTGCAG', 'CCGG')

        ## param 'max_shared_Hs_locus' can be an int or a float:
        [Assembly].Func('max_shared_Hs_locus', 0.25)

        """

        ## this includes current params and some legacy params for conversion
        arg_3 = ["edit_cutsites", "trim_overhang"]
        arg_4 = arg_0.paramsdict.keys()
        arg_5 = arg_4 + arg_3

        ## require parameter recognition
        #if not ((param in range(50)) or \
        #        (param in [str(i) for i in range(50)]) or \
        #        (param in allowed_params)):
        if not arg_1 in arg_5:
            raise IPyradParamsError("Parameter key not recognized: {}"\
                                    .format(arg_1))

        ## make string
        arg_1 = str(arg_1)
        ## get index if param is keyword arg (this index is now zero based!)
        if len(arg_1) < 3:
            arg_1 = arg_0.paramsdict.keys()[int(arg_1)]

        ## run assertions on new param
        try:
            arg_0 = _paramschecker(arg_0, arg_1, arg_2)

        except Exception as inst:
            raise IPyradWarningExit(BAD_PARAMETER\
                                    .format(arg_1, inst, arg_2))

Set a parameter to a new value. Raises error if newvalue is wrong type.

        Note
        ----
        Use [Assembly].get_params() to see the parameter values currently
        linked to the Assembly object.

        Parameters
        ----------
        param : int or str
            The index (e.g., 1) or string name (e.g., "project_dir")
            for the parameter that will be changed.

        newvalue : int, str, or tuple
            The new value for the parameter selected for `param`. Use
            `ipyrad.get_params_info()` to get further information about
            a given parameter. If the wrong type is entered for newvalue
            (e.g., a str when it should be an int), an error will be raised.
            Further information about each parameter is also available
            in the documentation.

        Examples
        --------
        ## param 'project_dir' takes only a str as input
        [Assembly].set_params('project_dir', 'new_directory')

        ## param 'restriction_overhang' must be a tuple or str, if str it is
        ## converted to a tuple with the second entry empty.
        [Assembly].set_params('restriction_overhang', ('CTGCAG', 'CCGG')

        ## param 'max_shared_Hs_locus' can be an int or a float:
        [Assembly].set_params('max_shared_Hs_locus', 0.25)

Set a parameter to a new value . Raises error if newvalue is wrong type .


def Func(arg_0, arg_1):
        """Evaluate a dict of expressions in the user's namespace.

        Parameters
        ----------
        expressions : dict
          A dict with string keys and string values.  The expression values
          should be valid Python expressions, each of which will be evaluated
          in the user namespace.

        Returns
        -------
        A dict, keyed like the input expressions dict, with the repr() of each
        value.
        """
        arg_2 = {}
        arg_3 = arg_0.user_ns
        arg_4 = arg_0.user_global_ns
        for arg_5, arg_6 in arg_1.iteritems():
            try:
                arg_7 = repr(eval(arg_6, arg_4, arg_3))
            except:
                arg_7 = arg_0._simple_error()
            arg_2[arg_5] = arg_7
        return arg_2

Evaluate a dict of expressions in the user s namespace .


def Func(arg_0, arg_1, **arg_2):
        """Fetch packages and summary from Crates.io

        :param category: the category of items to fetch
        :param kwargs: backend arguments

        :returns: a generator of items
        """
        arg_3 = arg_2['from_date']

        if arg_1 == CATEGORY_CRATES:
            return arg_0.__fetch_crates(arg_3)
        else:
            return arg_0.__fetch_summary()

Fetch packages and summary from Crates . io


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . _processors . items ( ) : while not arg_2 . done : time . sleep ( 0.1 )

def Func(arg_0):
        """
        Sleeps until all the processors are done.
        """
        for arg_1, arg_2 in arg_0._processors.items():
            while not arg_2.done:
                time.sleep(0.1)

Sleeps until all the processors are done .


def Func(arg_0, arg_1, arg_2=None):
        """
        Method returns dataset_resource if dataset exist
        and raised 404 error if dataset does not exist

        :param dataset_id: The BigQuery Dataset ID
        :type dataset_id: str
        :param project_id: The GCP Project ID
        :type project_id: str
        :return: dataset_resource

            .. seealso::
                For more information, see Dataset Resource content:
                https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#resource
        """

        if not arg_1 or not isinstance(arg_1, str):
            raise ValueError("dataset_id argument must be provided and has "
                             "a type 'str'. You provided: {}".format(arg_1))

        arg_3 = arg_2 if arg_2 else arg_0.project_id

        try:
            arg_4 = arg_0.service.datasets().get(
                datasetId=arg_1, projectId=arg_3).execute(num_retries=arg_0.num_retries)
            arg_0.log.info("Dataset Resource: %s", arg_4)
        except HttpError as err:
            raise AirflowException(
                'BigQuery job failed. Error was: {}'.format(err.content))

        return arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = copy . deepcopy ( arg_1 ) arg_3 = arg_0 . context [ 'enterprise_customer_catalog' ] arg_2 [ 'enrollment_url' ] = arg_3 . get_program_enrollment_url ( arg_2 [ 'uuid' ] ) for arg_4 in arg_2 [ 'courses' ] : arg_4 [ 'enrollment_url' ] = arg_3 . get_course_enrollment_url ( arg_4 [ 'key' ] ) for arg_5 in arg_4 [ 'course_runs' ] : arg_5 [ 'enrollment_url' ] = arg_3 . get_course_run_enrollment_url ( arg_5 [ 'key' ] ) return arg_2

def Func(arg_0, arg_1):
        """
        Return the updated program data dictionary.

        Arguments:
            instance (dict): The program data.

        Returns:
            dict: The updated program data.
        """
        arg_2 = copy.deepcopy(arg_1)
        arg_3 = arg_0.context['enterprise_customer_catalog']
        arg_2['enrollment_url'] = arg_3.get_program_enrollment_url(
            arg_2['uuid']
        )
        for arg_4 in arg_2['courses']:
            arg_4['enrollment_url'] = arg_3.get_course_enrollment_url(arg_4['key'])
            for arg_5 in arg_4['course_runs']:
                arg_5['enrollment_url'] = arg_3.get_course_run_enrollment_url(
                    arg_5['key']
                )
        return arg_2

Return the updated program data dictionary .


def Func ( arg_0 = None ) : @ llrule ( arg_0 , lambda arg_1 : [ "newline" ] ) def rule ( arg_1 ) : arg_2 = arg_1 . _accept ( "newline" ) if arg_2 is unmatched : return arg_2 return [ ] return rule

def Func(arg_0=None):
    """A rule that accepts token of kind ``newline`` and returns an empty list."""
    @llrule(arg_0, lambda arg_1: ["newline"])
    def rule(arg_1):
        arg_2 = arg_1._accept("newline")
        if arg_2 is unmatched:
            return arg_2
        return []
    return rule

A rule that accepts token of kind newline and returns an empty list .


def Func ( arg_0 ) : arg_0 . stream . close ( ) if arg_0 . stream . transport in arg_0 . _ml_handlers : arg_0 . _ml_handlers . remove ( arg_0 . stream . transport ) arg_0 . main_loop . remove_handler ( arg_0 . stream . transport ) arg_0 . stream = None arg_0 . uplink = None

def Func(arg_0):
        """Same as `close_stream` but with the `lock` acquired.
        """
        arg_0.stream.close()
        if arg_0.stream.transport in arg_0._ml_handlers:
            arg_0._ml_handlers.remove(arg_0.stream.transport)
            arg_0.main_loop.remove_handler(arg_0.stream.transport)
        arg_0.stream = None
        arg_0.uplink = None

Same as close_stream but with the lock acquired .


def Func(arg_0, arg_1=None):
    """Format a single experiment result coming from backend to present
    to the Qiskit user.

    Args:
        counts (dict): counts histogram of multiple shots
        header (dict): the experiment header dictionary containing
            useful information for postprocessing.

    Returns:
        dict: a formatted counts
    """
    arg_2 = {}
    for arg_3, arg_4 in arg_0.items():
        arg_3 = Func_memory(arg_3, arg_1)
        arg_2[arg_3] = arg_4
    return arg_2

Format a single experiment result coming from backend to present to the Qiskit user .


def Func(arg_0):
    """Create DRF model view set from injector class."""

    arg_1 = create_handler(ModelViewSet, arg_0)
    apply_api_view_methods(arg_1, arg_0)
    apply_generic_api_view_methods(arg_1, arg_0)
    apply_Func_methods(arg_1, arg_0)
    return arg_0.let(as_viewset=lambda: arg_1)

Create DRF model view set from injector class .


(self, to_sref, dest=None, interpolation=gdalconst.GRA_NearestNeighbour)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
arg_4
.
GRA_NearestNeighbour
)
:
if
not
hasattr
(
arg_1
,
'ExportToWkt'
)
:
arg_1
=
SpatialReference
(
arg_1
)
arg_6
=
arg_1
.
ExportToWkt
(
)
arg_7
=
arg_0
[
0
]
.
DataType
arg_8
=
0.125
arg_9
=
gdal
.
AutoCreateWarpedVRT
(
arg_0
.
ds
,
,
arg_6
,
arg_3
,
arg_8
)
if
arg_9
is
:
raise
ValueError
(
'Could not Func %s to %s'
%
(
arg_0
,
arg_6
)
)
arg_10
=
(
arg_9
.
RasterXSize
,
arg_9
.
RasterYSize
,
len
(
arg_0
)
)
arg_11
=
arg_9
.
GetGeoTransform
(
)
arg_9
=
if
arg_2
is
:
arg_12
=
MemFileIO
(
)
arg_13
=
arg_0
.
driver
.
raster
(
arg_12
,
arg_10
,
arg_7
)
arg_12
.
close
(
)
else
:
arg_13
=
arg_0
.
driver
.
raster
(
arg_2
,
arg_10
,
arg_7
)
arg_13
.
SetGeoTransform
(
arg_11
)
arg_13
.
SetProjection
(
arg_1
)
if
arg_0
.
nodata
is
not
:
for
arg_14
in
arg_13
:
arg_14
.
SetNoDataValue
(
arg_0
.
nodata
)
arg_14
=
gdal
.
ReprojectImage
(
arg_0
.
ds
,
arg_13
.
ds
,
,
,
arg_3
)
return
arg_13

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4.GRA_NearestNeighbour):
        """Returns a new reprojected instance.

        Arguments:
        to_sref -- spatial reference as a proj4 or wkt string, or a
        SpatialReference
        Keyword args:
        dest -- filepath as str
        interpolation -- GDAL interpolation type
        """
        if not hasattr(arg_1, 'ExportToWkt'):
            arg_1 = SpatialReference(arg_1)
        arg_6 = arg_1.ExportToWkt()
        arg_7 = arg_0[0].DataType
        arg_8 = 0.125
        # Determine new values for destination raster dimensions and
        # geotransform.
        arg_9 = gdal.AutoCreateWarpedVRT(arg_0.ds, None, arg_6,
                                       arg_3, arg_8)
        if arg_9 is None:
            raise ValueError('Could not Func %s to %s' % (arg_0, arg_6))
        arg_10 = (arg_9.RasterXSize, arg_9.RasterYSize, len(arg_0))
        arg_11 = arg_9.GetGeoTransform()
        arg_9 = None
        if arg_2 is None:
            arg_12 = MemFileIO()
            arg_13 = arg_0.driver.raster(arg_12, arg_10, arg_7)
            arg_12.close()
        else:
            arg_13 = arg_0.driver.raster(arg_2, arg_10, arg_7)
        arg_13.SetGeoTransform(arg_11)
        arg_13.SetProjection(arg_1)
        if arg_0.nodata is not None:
            for arg_14 in arg_13:
                arg_14.SetNoDataValue(arg_0.nodata)
                arg_14 = None
        # Uses self and rFunc projection when set to None
        gdal.ReprojectImage(arg_0.ds, arg_13.ds, None, None, arg_3)
        return arg_13


def
Func
(
arg_0
)
:
arg_1
=
prompt_pass
(
"Enter password"
)
arg_2
=
User
(
arg_0
=
arg_0
,
arg_1
=
arg_1
)
db
.
session
.
add
(
arg_2
)
db
.
session
.
commit
(
)

def Func(arg_0):
    "Create a new user."
    arg_1 = prompt_pass("Enter password")
    arg_2 = User(arg_0=arg_0, arg_1=arg_1)
    db.session.add(arg_2)
    db.session.commit()


def
Func
(
arg_0
,
arg_1
=
)
:
with
tf
.
compat
.
v1
.
name_scope
(
arg_1
,
'Func'
,
[
arg_0
]
)
:
arg_0
=
tf
.
convert_to_tensor
(
value
=
arg_0
,
arg_1
=
'x'
)
if
not
arg_0
.
dtype
.
is_floating
:
raise
TypeError
(
'Input `x` must be floating type.'
)
def
grad
(
arg_2
)
:
arg_3
=
np
.
sqrt
(
np
.
finfo
(
arg_0
.
dtype
.
as_numpy_dtype
(
)
)
.
max
)
arg_4
=
tf
.
where
(
tf
.
equal
(
arg_0
,
0
)
,
tf
.
fill
(
tf
.
shape
(
input
=
arg_0
)
,
arg_3
)
,
0.5
*
tf
.
math
.
rsqrt
(
arg_0
)
)
return
arg_2
*
arg_4
return
tf
.
sqrt
(
arg_0
)
,
grad

def Func(arg_0, arg_1=None):
  """A sqrt function whose gradient at zero is very large but finite.

  Args:
    x: a `Tensor` whose sqrt is to be computed.
    name: a Python `str` prefixed to all ops created by this function.
      Default `None` (i.e., "Func").

  Returns:
    sqrt: the square root of `x`, with an overridden gradient at zero
    grad: a gradient function, which is the same as sqrt's gradient everywhere
      except at zero, where it is given a large finite value, instead of `inf`.

  Raises:
    TypeError: if `tf.convert_to_tensor(x)` is not a `float` type.

  Often in kernel functions, we need to compute the L2 norm of the difference
  between two vectors, `x` and `y`: `sqrt(sum_i((x_i - y_i) ** 2))`. In the
  case where `x` and `y` are identical, e.g., on the diagonal of a kernel
  matrix, we get `NaN`s when we take gradients with respect to the inputs. To
  see, this consider the forward pass:

    ```
    [x_1 ... x_N]  -->  [x_1 ** 2 ... x_N ** 2]  -->
        (x_1 ** 2 + ... + x_N ** 2)  -->  sqrt((x_1 ** 2 + ... + x_N ** 2))
    ```

  When we backprop through this forward pass, the `sqrt` yields an `inf` because
  `grad_z(sqrt(z)) = 1 / (2 * sqrt(z))`. Continuing the backprop to the left, at
  the `x ** 2` term, we pick up a `2 * x`, and when `x` is zero, we get
  `0 * inf`, which is `NaN`.

  We'd like to avoid these `NaN`s, since they infect the rest of the connected
  computation graph. Practically, when two inputs to a kernel function are
  equal, we are in one of two scenarios:
    1. We are actually computing k(x, x), in which case norm(x - x) is
       identically zero, independent of x. In this case, we'd like the
       gradient to reflect this independence: it should be zero.
    2. We are computing k(x, y), and x just *happens* to have the same value
       as y. The gradient at such inputs is in fact ill-defined (there is a
       cusp in the sqrt((x - y) ** 2) surface along the line x = y). There are,
       however, an infinite number of sub-gradients, all of which are valid at
       all such inputs. By symmetry, there is exactly one which is "special":
       zero, and we elect to use that value here. In practice, having two
       identical inputs to a kernel matrix is probably a pathological
       situation to be avoided, but that is better resolved at a higher level
       than this.

  To avoid the infinite gradient at zero, we use tf.custom_gradient to redefine
  the gradient at zero. We assign it to be a very large value, specifically
  the sqrt of the max value of the floating point dtype of the input. We use
  the sqrt (as opposed to just using the max floating point value) to avoid
  potential overflow when combining this value with others downstream.
  """
  with tf.compat.v1.name_scope(arg_1, 'Func', [arg_0]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_1='x')
    if not arg_0.dtype.is_floating:
      raise TypeError('Input `x` must be floating type.')
    def grad(arg_2):
      arg_3 = np.sqrt(np.finfo(arg_0.dtype.as_numpy_dtype()).max)
      arg_4 = tf.where(
          tf.equal(arg_0, 0), tf.fill(tf.shape(input=arg_0), arg_3),
          0.5 * tf.math.rsqrt(arg_0))
      return arg_2 * arg_4
    return tf.sqrt(arg_0), grad

A sqrt function whose gradient at zero is very large but finite.

  Args:
    x: a `Tensor` whose sqrt is to be computed.
    name: a Python `str` prefixed to all ops created by this function.
      Default `None` (i.e., "sqrt_with_finite_grads").

  Returns:
    sqrt: the square root of `x`, with an overridden gradient at zero
    grad: a gradient function, which is the same as sqrt's gradient everywhere
      except at zero, where it is given a large finite value, instead of `inf`.

  Raises:
    TypeError: if `tf.convert_to_tensor(x)` is not a `float` type.

  Often in kernel functions, we need to compute the L2 norm of the difference
  between two vectors, `x` and `y`: `sqrt(sum_i((x_i - y_i) ** 2))`. In the
  case where `x` and `y` are identical, e.g., on the diagonal of a kernel
  matrix, we get `NaN`s when we take gradients with respect to the inputs. To
  see, this consider the forward pass:

    ```
    [x_1 ... x_N]  -->  [x_1 ** 2 ... x_N ** 2]  -->
        (x_1 ** 2 + ... + x_N ** 2)  -->  sqrt((x_1 ** 2 + ... + x_N ** 2))
    ```

  When we backprop through this forward pass, the `sqrt` yields an `inf` because
  `grad_z(sqrt(z)) = 1 / (2 * sqrt(z))`. Continuing the backprop to the left, at
  the `x ** 2` term, we pick up a `2 * x`, and when `x` is zero, we get
  `0 * inf`, which is `NaN`.

  We'd like to avoid these `NaN`s, since they infect the rest of the connected
  computation graph. Practically, when two inputs to a kernel function are
  equal, we are in one of two scenarios:
    1. We are actually computing k(x, x), in which case norm(x - x) is
       identically zero, independent of x. In this case, we'd like the
       gradient to reflect this independence: it should be zero.
    2. We are computing k(x, y), and x just *happens* to have the same value
       as y. The gradient at such inputs is in fact ill-defined (there is a
       cusp in the sqrt((x - y) ** 2) surface along the line x = y). There are,
       however, an infinite number of sub-gradients, all of which are valid at
       all such inputs. By symmetry, there is exactly one which is "special":
       zero, and we elect to use that value here. In practice, having two
       identical inputs to a kernel matrix is probably a pathological
       situation to be avoided, but that is better resolved at a higher level
       than this.

  To avoid the infinite gradient at zero, we use tf.custom_gradient to redefine
  the gradient at zero. We assign it to be a very large value, specifically
  the sqrt of the max value of the floating point dtype of the input. We use
  the sqrt (as opposed to just using the max floating point value) to avoid
  potential overflow when combining this value with others downstream.

A sqrt function whose gradient at zero is very large but finite .


def
Func
(
arg_0
)
:
if
arg_0
.
__owner
!=
_get_ident
(
)
:
raise
RuntimeError
(
"cannot Func un-acquired lock"
)
arg_0
.
__count
=
count
=
arg_0
.
__count
1
if
not
count
:
arg_0
.
__owner
=
arg_0
.
__block
.
Func
(
)
if
__debug__
:
arg_0
.
_note
(
"%s.Func(): final Func"
,
arg_0
)
else
:
if
__debug__
:
arg_0
.
_note
(
"%s.Func(): non-final Func"
,
arg_0
)

def Func(arg_0):
        """Release a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        """
        if arg_0.__owner != _get_ident():
            raise RuntimeError("cannot Func un-acquired lock")
        arg_0.__count = count = arg_0.__count - 1
        if not count:
            arg_0.__owner = None
            arg_0.__block.Func()
            if __debug__:
                arg_0._note("%s.Func(): final Func", arg_0)
        else:
            if __debug__:
                arg_0._note("%s.Func(): non-final Func", arg_0)

Release a lock decrementing the recursion level .


(cls, fx_spot, domestic_curve=None, foreign_curve=None)

return cls(fx_spot, domestic_curve=domestic_curve, foreign_curve=foreign_curve)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        creator method to build FxCurve

        :param float fx_spot: fx spot rate
        :param RateCurve domestic_curve: domestic discount curve
        :param RateCurve foreign_curve: foreign discount curve
        :return:
        """
        assert arg_2.origin == arg_3.origin
        return arg_0(arg_1, arg_2=arg_2, arg_3=arg_3)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 5 ) : arg_4 = { } arg_4 [ 'key' ] = arg_0 arg_4 [ 'features' ] = '/' . join ( [ f for f in arg_1 if f in FEATURES ] ) arg_4 [ 'query' ] = quote ( arg_2 ) arg_4 [ 'format' ] = 'json' arg_5 = Funcs . get ( API_URL . format ( ** arg_4 ) , arg_3 = arg_3 ) arg_6 = json . loads ( _unicode ( arg_5 . content ) ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3=5):
    """Make an API Func

    :param string key: API key to use
    :param list features: features to Func. It must be a subset of :data:`FEATURES`
    :param string query: query to send
    :param integer timeout: timeout of the Func
    :returns: result of the API Func
    :rtype: dict

    """
    arg_4 = {}
    arg_4['key'] = arg_0
    arg_4['features'] = '/'.join([f for f in arg_1 if f in FEATURES])
    arg_4['query'] = quote(arg_2)
    arg_4['format'] = 'json'
    arg_5 = Funcs.get(API_URL.format(**arg_4), arg_3=arg_3)
    arg_6 = json.loads(_unicode(arg_5.content))
    return arg_6

Make an API request

    :param string key: API key to use
    :param list features: features to request. It must be a subset of :data:`FEATURES`
    :param string query: query to send
    :param integer timeout: timeout of the request
    :returns: result of the API request
    :rtype: dict


def Func ( arg_0 ) : try : arg_1 = _pybossa_req ( 'delete' , 'task' , arg_0 ) if type ( arg_1 ) . __name__ == 'bool' : return True else : return arg_1 except : raise

def Func(arg_0):
    """Delete a task for a given task ID.

    :param task: PYBOSSA task

    """
    #: :arg task: A task
    try:
        arg_1 = _pybossa_req('delete', 'task', arg_0)
        if type(arg_1).__name__ == 'bool':
            return True
        else:
            return arg_1
    except:  # pragma: no cover
        raise


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
os
.
path
.
getsize
(
arg_2
)
if
int
(
arg_1
[
'ContentLength'
]
)
!=
arg_3
:
raise
RetryFailure
(
'Downloaded file size inconsistent: %s'
%
(
repr
(
arg_1
)
)
)

def Func(arg_0, arg_1, arg_2):
    '''Verify the file size of the downloaded file.'''
    arg_3 = os.path.getsize(arg_2)
    if int(arg_1['ContentLength']) != arg_3:
      raise RetryFailure('Downloaded file size inconsistent: %s' % (repr(arg_1)))

Verify the file size of the downloaded file .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = sorted ( arg_0 , key = arg_0 . get ) arg_4 = range ( len ( arg_3 ) ) arg_1 . yticks ( arg_4 , arg_3 ) arg_1 . Func ( arg_4 , [ arg_0 [ arg_5 ] for arg_5 in arg_3 ] ) if arg_2 is not None : arg_1 . title ( arg_2 )

def Func(arg_0, arg_1, arg_2=None):
    """A convenience function for plotting a horizontal bar plot from a Counter"""
    arg_3 = sorted(arg_0, key=arg_0.get)
    arg_4 = range(len(arg_3))

    arg_1.yticks(arg_4, arg_3)
    arg_1.Func(arg_4, [arg_0[arg_5] for arg_5 in arg_3])

    if arg_2 is not None:
        arg_1.title(arg_2)


def Func ( arg_0 ) : arg_0 . _handlers = { } arg_0 . _esc_handlers = { } for arg_3 in _default_handlers : arg_3 ( shell = arg_0 . shell , prefilter_manager = arg_0 , config = arg_0 . config )

def Func(arg_0):
        """Create the default handlers."""
        arg_0._handlers = {}
        arg_0._esc_handlers = {}
        for arg_3 in _default_handlers:
            arg_3(
                shell=arg_0.shell, prefilter_manager=arg_0, config=arg_0.config
            )


return c_ast.FuncDecl(args=c_ast.ParamList(params=array_declarations + scalar_declarations +
                                                          const_declarations),
                              type=c_ast.TypeDecl(declname=name,
                                                  quals=[],
                                                  type=c_ast.IdentifierType(names=['void'])))

def Func ( arg_0 , arg_1 = 'kernel' ) : arg_2 , arg_3 = arg_0 . _build_array_declarations ( with_init = False ) arg_4 = arg_0 . _build_scalar_declarations ( with_init = False ) arg_5 = arg_0 . _build_const_declartions ( with_init = False ) return c_ast . FuncDecl ( args = c_ast . ParamList ( params = arg_2 + arg_4 + arg_5 ) , type = c_ast . TypeDecl ( declname = arg_1 , quals = [ ] , type = c_ast . IdentifierType ( names = [ 'void' ] ) ) )

def Func(arg_0, arg_1='kernel'):
        """Build and return kernel function declaration"""
        arg_2, arg_3 = arg_0._build_array_declarations(with_init=False)
        arg_4 = arg_0._build_scalar_declarations(with_init=False)
        arg_5 = arg_0._build_const_declartions(with_init=False)
        return c_ast.FuncDecl(args=c_ast.ParamList(params=arg_2 + arg_4 +
                                                          arg_5),
                              type=c_ast.TypeDecl(declname=arg_1,
                                                  quals=[],
                                                  type=c_ast.IdentifierType(names=['void'])))


def Func(arg_0, arg_1):
    """ get shape of new bootstrap resampled locus array """
    arg_2 = 0
    for arg_3 in xrange(arg_1.shape[0]):
        arg_2 += arg_0[arg_1[arg_3], 1] - arg_0[arg_1[arg_3], 0]
    return arg_2


def Func ( ) : arg_0 = { 'Linux' : _Func_unix , 'Darwin' : _Func_darwin , 'Windows' : _Func_windows , 'Microsoft' : _Func_windows , } arg_1 = arg_0 . get ( platform . system ( ) , _Func_unix ) try : arg_2 = max ( 1 , int ( arg_1 ( ) ) ) except : arg_2 = 1 return arg_2

def Func():
   """Return the effective number of CPUs in the system as an integer.

   This cross-platform function makes an attempt at finding the total number of
   available CPUs in the system, as returned by various underlying system and
   python calls.

   If it can't find a sensible answer, it returns 1 (though an error *may* make
   it return a large positive number that's actually incorrect).
   """

   # Many thanks to the Parallel Python project (http://www.parallelpython.com)
   # for the names of the keys we needed to look up for this function.  This
   # code was inspired by their equivalent function.

   arg_0 = {'Linux':_Func_unix,
                'Darwin':_Func_darwin,
                'Windows':_Func_windows,
                # On Vista, python < 2.5.2 has a bug and returns 'Microsoft'
                # See http://bugs.python.org/issue1082 for details.
                'Microsoft':_Func_windows,
                }

   arg_1 = arg_0.get(platform.system(),
                            # default to unix version (Solaris, AIX, etc)
                            _Func_unix)

   try:
       arg_2 = max(1,int(arg_1()))
   except:
       arg_2 = 1
   return arg_2

Return the effective number of CPUs in the system as an integer .


def Func(arg_0):
    """
    Given an EnterpriseCustomer UUID, return the corresponding EnterpriseCustomer or raise a 404.

    Arguments:
        enterprise_uuid (str): The UUID (in string form) of the EnterpriseCustomer to fetch.

    Returns:
        (EnterpriseCustomer): The EnterpriseCustomer given the UUID.

    """
    arg_1 = apps.get_model('enterprise', 'EnterpriseCustomer')  # pylint: disable=invalid-name
    try:
        arg_0 = UUID(arg_0)
        return arg_1.objects.get(uuid=arg_0)  # pylint: disable=no-member
    except (TypeError, ValueError, arg_1.DoesNotExist):
        LOGGER.error('Unable to find enterprise customer for UUID: [%s]', arg_0)
        raise Http404

Given an EnterpriseCustomer UUID return the corresponding EnterpriseCustomer or raise a 404 .


def Func(arg_0):
    """
    This function performs two sanity checks in the pipeline string. The first
    check, assures that each fork contains a lane token '|', while the second
    check looks for duplicated processes within the same fork.

    Parameters
    ----------
    pipeline_string: str
         String with the definition of the pipeline, e.g.::
             'processA processB processC(ProcessD | ProcessE)'

    """

    # first lets get all forks to a list.
    arg_1 = []  # stores forks
    arg_2 = []  # stores indexes of left brackets

    # iterate through the string looking for '(' and ')'.
    for arg_3, arg_4 in enumerate(arg_0):
        if arg_4 == FORK_TOKEN:
            # saves pos to left_indexes list
            arg_2.append(arg_3)
        elif arg_4 == CLOSE_TOKEN and len(arg_2) > 0:
            # saves fork to list_of_forks
            arg_1.append(arg_0[arg_2[-1] + 1: arg_3])
            # removes last bracket from left_indexes list
            arg_2 = arg_2[:-1]

    # sort list in descending order of number of forks
    arg_1.sort(key=lambda x: x.count(FORK_TOKEN), reverse=True)

    # Now, we can iterate through list_of_forks and check for errors in each
    # fork
    for arg_5 in arg_1:
        # remove inner forks for these checks since each fork has its own entry
        # in list_of_forks. Note that each fork is now sorted in descending
        # order which enables to remove sequentially the string for the fork
        # potentially with more inner forks
        for arg_6 in arg_1:
            # checks if subfork is contained in fork and if they are different,
            # avoiding to remove itself
            if arg_6 in arg_1 and arg_6 != arg_5:
                # removes inner forks. Note that string has no spaces
                arg_7 = arg_5.replace("({})".format(arg_6), "")
            else:
                arg_7 = arg_5

        # Checks if there is no fork separator character '|' within each fork
        if not len(arg_7.split(LANE_TOKEN)) > 1:
            raise SanityError("One of the forks doesn't have '|' "
                              "separator between the processes to fork. This is"
                              " the prime suspect: '({})'".format(arg_5))

This function performs two sanity checks in the pipeline string . The first check assures that each fork contains a lane token | while the second check looks for duplicated processes within the same fork .


def Func ( arg_0 , arg_1 ) : if issymbolic ( arg_1 ) : if solver . can_be_true ( arg_0 . _constraints , arg_1 == arg_0 . _used_calldata_size ) : arg_0 . constraints . add ( arg_1 == arg_0 . _used_calldata_size ) raise ConcretizeArgument ( 1 , policy = 'SAMPLED' ) arg_0 . _use_calldata ( arg_1 , 32 ) arg_2 = len ( arg_0 . data ) arg_3 = [ ] for arg_4 in range ( 32 ) : try : arg_5 = Operators . ITEBV ( 8 , arg_1 + arg_4 < arg_2 , arg_0 . data [ arg_1 + arg_4 ] , 0 ) except IndexError : arg_5 = 0 arg_3 . append ( arg_5 ) return Operators . CONCAT ( 256 , * arg_3 )

def Func(arg_0, arg_1):
        """Get input data of current environment"""

        if issymbolic(arg_1):
            if solver.can_be_true(arg_0._constraints, arg_1 == arg_0._used_calldata_size):
                arg_0.constraints.add(arg_1 == arg_0._used_calldata_size)
            raise ConcretizeArgument(1, policy='SAMPLED')

        arg_0._use_calldata(arg_1, 32)

        arg_2 = len(arg_0.data)

        arg_3 = []
        for arg_4 in range(32):
            try:
                arg_5 = Operators.ITEBV(8, arg_1 + arg_4 < arg_2, arg_0.data[arg_1 + arg_4], 0)
            except IndexError:
                # offset + i is concrete and outside data
                arg_5 = 0

            arg_3.append(arg_5)
        return Operators.CONCAT(256, *arg_3)


def
Func
(
arg_0
,
Func
)
:
logger
.
debug
(
u"TCP transport event: {0}"
.
format
(
Func
)
)
if
arg_0
.
_stream
:
Func
.
stream
=
arg_0
.
_stream
arg_0
.
_event_queue
.
put
(
Func
)

def Func(arg_0, Func):
        """Pass an event to the target stream or just log it."""
        logger.debug(u"TCP transport event: {0}".format(Func))
        if arg_0._stream:
            Func.stream = arg_0._stream
        arg_0._event_queue.put(Func)

Pass an event to the target stream or just log it .


(cx, cy, radius, x1, y1, x2, y2, infinite=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7=False):
    """ Returns a list of points where the circle and the line intersect.
            Returns an empty list when the circle and the line do not intersect.
    """
    # Based on: http://www.vb-helper.com/howto_net_line_circle_intersections.html
    arg_8 = arg_5 - arg_3
    arg_9 = arg_6 - arg_4
    arg_10 = arg_8 * arg_8 + arg_9 * arg_9
    arg_11 = 2 * (arg_8 * (arg_3 - arg_0) + arg_9 * (arg_4 - arg_1))
    arg_12 = pow(arg_3 - arg_0, 2) + pow(arg_4 - arg_1, 2) - arg_2 * arg_2
    arg_13 = arg_11 * arg_11 - 4 * arg_10 * arg_12
    if arg_10 <= 0.0000001 or arg_13 < 0:
        return []
    elif arg_13 == 0:
        # One point of intersection.
        arg_14 = -arg_11 / (2 * arg_10)
        return [(arg_3 + arg_14 * arg_8, arg_4 + arg_14 * arg_9)]
    else:
        # Two points of intersection.
        # A point of intersection lies on the line segment if 0 <= t <= 1,
        # and on an extension of the segment otherwise.
        arg_15 = []
        arg_16 = sqrt(arg_13)
        arg_17 = (-arg_11 + arg_16) / (2 * arg_10)
        arg_18 = (-arg_11 - arg_16) / (2 * arg_10)
        if arg_7 or 0 <= arg_17 <= 1:
            arg_15.append((arg_3 + arg_17 * arg_8, arg_4 + arg_17 * arg_9))
        if arg_7 or 0 <= arg_18 <= 1:
            arg_15.append((arg_3 + arg_18 * arg_8, arg_4 + arg_18 * arg_9))
        return arg_15

Returns a list of points where the circle and the line intersect . Returns an empty list when the circle and the line do not intersect .


def Func(arg_0, arg_1):
        """Main method for worker to run

        Pops a chunk of tasks off the collection of pending tasks to be added and submits them to be added.

        :param collections.deque results_queue: Queue for worker to output results to
        """
        # Add tasks until either we run out or we run into an unexpected error
        while arg_0.tasks_to_add and not arg_0.errors:
            arg_2 = arg_0._max_tasks_per_request  # local copy
            arg_3 = []
            with arg_0._pending_queue_lock:
                while len(arg_3) < arg_2 and arg_0.tasks_to_add:
                    arg_3.append(arg_0.tasks_to_add.pop())

            if arg_3:
                arg_0._bulk_add_tasks(arg_1, arg_3)


return state in [cls.ACTIVE, cls.PENDING_ADMIN, cls.PENDING_USER]

def Func ( arg_0 , arg_1 ) : return arg_1 in [ arg_0 . ACTIVE , arg_0 . PENDING_ADMIN , arg_0 . PENDING_USER ]

def Func(arg_0, arg_1):
        """Validate state value."""
        return arg_1 in [arg_0.ACTIVE, arg_0.PENDING_ADMIN, arg_0.PENDING_USER]


def Func(arg_0):
    """Convert a proto dataset into a dataset.

    This step is carried out after all files have been added to the dataset.
    Freezing a dataset finalizes it with a stamp marking it as frozen.
    """
    arg_1 = dtoolcore.ProtoDataSet.from_uri(
        uri=arg_0,
        config_path=CONFIG_PATH
    )

    arg_2 = len(list(arg_1._identifiers()))
    arg_3 = int(dtoolcore.utils.get_config_value(
        "DTOOL_MAX_FILES_LIMIT",
        CONFIG_PATH,
        10000
    ))
    assert isinstance(arg_3, int)
    if arg_2 > arg_3:
        click.secho(
            "Too many items ({} > {}) in proto dataset".format(
                arg_2,
                arg_3
            ),
            fg="red"
        )
        click.secho("1. Consider splitting the dataset into smaller datasets")
        click.secho("2. Consider packaging small files using tar")
        click.secho("3. Increase the limit using the DTOOL_MAX_FILES_LIMIT")
        click.secho("   environment variable")
        sys.exit(2)

    arg_4 = [arg_5 for arg_5 in arg_1._storage_broker.iter_item_handles()]
    for arg_5 in arg_4:
        if not valid_handle(arg_5):
            click.secho(
                "Invalid item name: {}".format(arg_5),
                fg="red"
            )
            click.secho("1. Consider renaming the item")
            click.secho("2. Consider removing the item")
            sys.exit(3)

    with click.progressbar(length=len(list(arg_1._identifiers())),
                           label="Generating manifest") as progressbar:
        try:
            arg_1.Func(progressbar=progressbar)
        except dtoolcore.storagebroker.DiskStorageBrokerValidationWarning as e:
            click.secho("")
            click.secho(str(e), fg="red", nl=False)
            sys.exit(4)

    click.secho("Dataset frozen ", nl=False, fg="green")
    click.secho(arg_0)

Convert a proto dataset into a dataset .


def Func(arg_0):
    """ Create a checkpoint from the current model, and store it in a dir named
    after checkpoint GUID, and finally store the GUID in the Models DB """

    if arg_0._model is None or arg_0._modelCheckpointGUID is None:
      return

    # Create an output store, if one doesn't exist already
    if arg_0._predictionLogger is None:
      arg_0._createPredictionLogger()

    arg_1 = StringIO.StringIO()
    arg_0._predictionLogger.checkpoint(
      checkpointSink=arg_1,
      maxRows=int(Configuration.get('nupic.model.checkpoint.maxPredictionRows')))

    arg_0._model.save(os.path.join(arg_0._experimentDir, str(arg_0._modelCheckpointGUID)))
    arg_0._jobsDAO.modelSetFields(modelID,
                                 {'modelCheckpointId':str(arg_0._modelCheckpointGUID)},
                                 ignoreUnchanged=True)

    arg_0._logger.info("Checkpointed Hypersearch Model: modelID: %r, "
                      "checkpointID: %r", arg_0._modelID, checkpointID)
    return

Create a checkpoint from the current model and store it in a dir named after checkpoint GUID and finally store the GUID in the Models DB


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = { "id" : arg_1 . id , "label" : str ( arg_1 . get_label ( arg_3 ) ) , "model" : str ( arg_1 . model ) , "type" : str ( arg_1 . type ) , "size" : arg_1 . size , "semantic" : arg_0 . semantic ( arg_1 , parent = arg_2 ) } if isinstance ( arg_1 , ResourceCollection ) : arg_4 [ "lang" ] = str ( arg_1 . lang ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """ Build an ancestor or descendant dict view based on selected information

        :param member: Current Member to build for
        :param collection: Collection from which we retrieved it
        :param lang: Language to express data in
        :return:
        """
        arg_4 = {
            "id": arg_1.id,
            "label": str(arg_1.get_label(arg_3)),
            "model": str(arg_1.model),
            "type": str(arg_1.type),
            "size": arg_1.size,
            "semantic": arg_0.semantic(arg_1, parent=arg_2)
        }
        if isinstance(arg_1, ResourceCollection):
            arg_4["lang"] = str(arg_1.lang)
        return arg_4


def Func(arg_0, arg_1, *arg_2):
        """
        Specify by which fields to group the aggregation.

        ### Parameters

        - **fields**: Fields to group by. This can either be a single string,
            or a list of strings. both cases, the field should be specified as
            `@field`.
        - **reducers**: One or more reducers. Reducers may be found in the
            `aggregation` module.
        """
        arg_3 = Group(arg_1, arg_2)
        arg_0._groups.append(arg_3)

        return arg_0

Specify by which fields to group the aggregation .


(feature_rad, state_name=None, im_name=None,
        use_full_path=False, actual_rad=None, invert=True, featuring_params={},
        **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = None , arg_5 = True , arg_6 = { } , ** arg_7 ) : arg_1 , arg_2 = _pick_state_im_name ( arg_1 , arg_2 , arg_3 = arg_3 ) arg_8 = states . load ( arg_1 ) if arg_4 is None : arg_4 = np . median ( arg_8 . obj_get_radii ( ) ) arg_9 = util . RawImage ( arg_2 , tile = arg_8 . image . tile ) arg_10 = locate_spheres ( arg_9 , arg_0 , arg_5 = arg_5 , ** arg_6 ) arg_11 = arg_8 . obj_remove_particle ( np . arange ( arg_8 . obj_get_radii ( ) . size ) ) arg_8 . obj_add_particle ( arg_10 , np . ones ( arg_10 . shape [ 0 ] ) * arg_4 ) arg_8 . set_image ( arg_9 ) _translate_particles ( arg_8 , arg_5 = arg_5 , ** arg_7 ) return arg_8

def Func(arg_0, arg_1=None, arg_2=None,
        arg_3=False, arg_4=None, arg_5=True, arg_6={},
        **arg_7):
    """
    Combines centroid featuring with the globals from a previous state.

    Runs trackpy.locate on an image, sets the globals from a previous state,
    calls _translate_particles

    Parameters
    ----------
        feature_rad : Int, odd
            The particle radius for featuring, as passed to locate_spheres.

        state_name : String or None, optional
            The name of the initially-optimized state. Default is None,
            which prompts the user to select the name interactively
            through a Tk window.
        im_name : String or None, optional
            The name of the new image to optimize. Default is None,
            which prompts the user to select the name interactively
            through a Tk window.
        use_full_path : Bool, optional
            Set to True to use the full path of the state instead of
            partial path names (e.g. /full/path/name/state.pkl vs
            state.pkl). Default is False
        actual_rad : Float or None, optional
            The initial guess for the particle radii. Default is the median
            of the previous state.
        invert : Bool
            Whether to invert the image for featuring, as passed to
            addsubtract.add_subtract and locate_spheres. Set to False
            if the image is bright particles on a dark background.
            Default is True (dark particles on bright background).
        featuring_params : Dict, optional
            kwargs-like dict of any additional keyword arguments to pass to
            ``get_initial_featuring``, such as ``'use_tp'`` or ``'minmass'``.
            Default is ``{}``.

    Other Parameters
    ----------------
        max_mem : Numeric
            The maximum additional memory to use for the optimizers, as
            passed to optimize.burn. Default is 1e9.
        desc : String, optional
            A description to be inserted in saved state. The save name will
            be, e.g., '0.tif-peri-' + desc + 'initial-burn.pkl'. Default is ''
        min_rad : Float, optional
            The minimum particle radius, as passed to addsubtract.add_subtract.
            Particles with a fitted radius smaller than this are identified
            as fake and removed. Default is 0.5 * actual_rad.
        max_rad : Float, optional
            The maximum particle radius, as passed to addsubtract.add_subtract.
            Particles with a fitted radius larger than this are identified
            as fake and removed. Default is 1.5 * actual_rad, however you
            may find better results if you make this more stringent.
        rz_order : int, optional
            If nonzero, the order of an additional augmented rscl(z)
            parameter for optimization. Default is 0; i.e. no rscl(z)
            optimization.
        do_polish : Bool, optional
            Set to False to only optimize the particles and add-subtract.
            Default is True, which then runs a polish afterwards.

    Returns
    -------
        s : :class:`peri.states.ImageState`
            The optimized state.

    See Also
    --------
        get_initial_featuring   : Features an image from scratch, using
            centroid methods as initial particle locations.

        feature_from_pos_rad    : Using a previous state's globals and
            user-provided positions and radii as an initial guess,
            completely optimizes a state.

        translate_featuring     : Use a previous state's globals and
            centroids methods for an initial particle guess, completely
            optimizes a state.

    Notes
    -----
        The ``Other Parameters`` are passed to _translate_particles.
    Proceeds by:
        1. Find a guess of the particle positions through centroid methods.
        2. Optimize particle positions only.
        3. Optimize particle positions and radii only.
        4. Add-subtract missing and bad particles.
        5. If polish, optimize the illumination, background, and particles.
        6. If polish, optimize everything.
    """
    arg_1, arg_2 = _pick_state_im_name(
            arg_1, arg_2, arg_3=arg_3)
    arg_8 = states.load(arg_1)

    if arg_4 is None:
        arg_4 = np.median(arg_8.obj_get_radii())
    arg_9 = util.RawImage(arg_2, tile=arg_8.image.tile)
    arg_10 = locate_spheres(arg_9, arg_0, arg_5=arg_5, **arg_6)
    arg_11 = arg_8.obj_remove_particle(np.arange(arg_8.obj_get_radii().size))
    arg_8.obj_add_particle(arg_10, np.ones(arg_10.shape[0])*arg_4)

    arg_8.set_image(arg_9)
    _translate_particles(arg_8, arg_5=arg_5, **arg_7)
    return arg_8

Combines centroid featuring with the globals from a previous state .


def Func(arg_0, arg_1):
        """ Validate saved search conditions, raising an error if any contain invalid operators """
        arg_2 = set(arg_0.searchkeys)
        arg_3 = set(arg_0.operators.keys())
        for arg_4 in arg_1:
            if set(arg_4.keys()) != arg_2:
                raise ze.ParamNotPassed(
                    "Keys must be all of: %s" % ", ".join(arg_0.searchkeys)
                )
            if arg_4.get("operator") not in arg_3:
                raise ze.ParamNotPassed(
                    "You have specified an unknown operator: %s"
                    % arg_4.get("operator")
                )
            # dict keys of allowed operators for the current condition
            arg_5 = arg_0.conditions_operators.get(
                arg_4.get("condition")
            )
            # transform these into values
            arg_6 = set(
                [arg_0.operators.get(op) for op in arg_5]
            )
            if arg_4.get("operator") not in arg_6:
                raise ze.ParamNotPassed(
                    "You may not use the '%s' operator when selecting the '%s' condition. \nAllowed operators: %s"
                    % (
                        arg_4.get("operator"),
                        arg_4.get("condition"),
                        ", ".join(list(arg_6)),
                    )
                )

Validate saved search conditions raising an error if any contain invalid operators


return dot( dot(jacobian, covmat), jacobian.T )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Transform the astrometric covariance matrix to its representation in the new coordinate system.

        Parameters
        ----------

        phi       - The longitude-like angle of the position of the source (radians).
        theta     - The latitude-like angle of the position of the source (radians).
        covmat    - Covariance matrix (5x5) of the astrometric parameters.

        Returns
        -------

        covmat_rot - Covariance matrix in its representation in the new coordinate system.
        """

        arg_4, arg_5 = arg_0._getJacobian(arg_1,arg_2)
        arg_6 = identity(5)
        arg_6[0][0]=arg_4
        arg_6[1][1]=arg_4
        arg_6[3][3]=arg_4
        arg_6[4][4]=arg_4
        arg_6[0][1]=arg_5
        arg_6[1][0]=-arg_5
        arg_6[3][4]=arg_5
        arg_6[4][3]=-arg_5

        return dot( dot(arg_6, arg_3), arg_6.T )

Transform the astrometric covariance matrix to its representation in the new coordinate system .


(self, name, label=None, format=None, date=False, custom_format=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=False, arg_5=False):
        """Create X-axis"""
        arg_6 = {}
        if arg_5 and arg_3:
            arg_6['tickFormat'] = arg_3
        elif arg_3:
            if arg_3 == 'AM_PM':
                arg_6['tickFormat'] = "function(d) { return get_am_pm(parseInt(d)); }"
            else:
                arg_6['tickFormat'] = "d3.format(',%s')" % arg_3

        if arg_2:
            arg_6['axisLabel'] = "'" + arg_2 + "'"

        # date format : see https://github.com/mbostock/d3/wiki/Time-Formatting
        if arg_4:
            arg_0.dateformat = arg_3
            arg_6['tickFormat'] = ("function(d) { return d3.time.format('%s')"
                                  "(new Date(parseInt(d))) }\n"
                                  "" % arg_0.dateformat)
            # flag is the x Axis is a date
            if arg_1[0] == 'x':
                arg_0.x_axis_date = True

        # Add new axis to list of axis
        arg_0.axislist[arg_1] = arg_6

        # Create x2Axis if focus_enable
        if arg_1 == "xAxis" and arg_0.focus_enable:
            arg_0.axislist['x2Axis'] = arg_6


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = institute_and_case ( store , arg_0 , arg_1 ) arg_4 = store . user ( current_user . email ) arg_5 = url_for ( '.case' , arg_0 = arg_0 , arg_1 = arg_1 ) store . open_Func ( arg_2 , arg_3 , arg_4 , arg_5 ) return redirect ( request . referrer )

def Func(arg_0, arg_1):
    """Open the Func list for a case."""
    arg_2, arg_3 = institute_and_case(store, arg_0, arg_1)
    arg_4 = store.user(current_user.email)
    arg_5 = url_for('.case', arg_0=arg_0, arg_1=arg_1)
    store.open_Func(arg_2, arg_3, arg_4, arg_5)
    return redirect(request.referrer)


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_0 . _partitionIdList . append ( numpy . inf ) else : arg_0 . _partitionIdList . append ( arg_2 ) arg_3 = arg_0 . _partitionIdMap . get ( arg_2 , [ ] ) arg_3 . append ( arg_1 ) arg_0 . _partitionIdMap [ arg_2 ] = arg_3

def Func(arg_0, arg_1, arg_2=None):
    """
    Adds partition id for pattern index
    """
    if arg_2 is None:
      arg_0._partitionIdList.append(numpy.inf)
    else:
      arg_0._partitionIdList.append(arg_2)
      arg_3 = arg_0._partitionIdMap.get(arg_2, [])
      arg_3.append(arg_1)
      arg_0._partitionIdMap[arg_2] = arg_3


def Func(arg_0, arg_1, arg_2, arg_3):
        """Handles authentication responses.

        :param dtype:
        :param data:
        :param ts:
        :return:
        """
        # Contains keys status, chanId, userId, caps
        if arg_1 == 'unauth':
            raise NotImplementedError
        arg_4 = arg_2.pop('chanId')
        arg_5 = arg_2.pop('userId')

        arg_6 = ('auth', arg_5)
        arg_0.channel_handlers[arg_6] = arg_4
        arg_0.channel_directory[arg_6] = arg_4
        arg_0.channel_directory[arg_4] = arg_6


(trans_title, meta_title,
                         trans_csv_path, meta_csv_path)

def Func(arg_0, arg_1,
                         arg_2, arg_3):
    """
    Prepare new csv writers, write title rows and return them.
    """
    arg_4 = UnicodeWriter(arg_2)
    arg_4.writerow(arg_0)

    arg_5 = UnicodeWriter(arg_3)
    arg_5.writerow(arg_1)

    return arg_4, arg_5

Prepare new csv writers write title rows and return them .


def Func(arg_0, arg_1, arg_2=True):
        r'''Method to solve for the temperature at which a property is at a
        specified value. `T_dependent_property` is used to calculate the value
        of the property as a function of temperature; if `reset_method` is True,
        the best method is used at each temperature as the solver seeks a
        solution. This slows the solution moderately.

        Checks the given property value with `test_property_validity` first
        and raises an exception if it is not valid. Requires that Tmin and
        Tmax have been set to know what range to search within.

        Search is performed with the brenth solver from SciPy.

        Parameters
        ----------
        goal : float
            Propoerty value desired, [`units`]
        reset_method : bool
            Whether or not to reset the method as the solver searches

        Returns
        -------
        T : float
            Temperature at which the property is the specified value [K]
        '''
        if arg_0.Tmin is None or arg_0.Tmax is None:
            raise Exception('Both a minimum and a maximum value are not present indicating there is not enough data for temperature dependency.')
        if not arg_0.test_property_validity(arg_1):
            raise Exception('Input property is not considered plausible; no method would calculate it.')

        def error(arg_3):
            if arg_2:
                arg_0.method = None
            return arg_0.T_dependent_property(arg_3) - arg_1
        try:
            return brenth(error, arg_0.Tmin, arg_0.Tmax)
        except ValueError:
            raise Exception('To within the implemented temperature range, it is not possible to calculate the desired value.')

r Method to solve for the temperature at which a property is at a specified value . T_dependent_property is used to calculate the value of the property as a function of temperature ; if reset_method is True the best method is used at each temperature as the solver seeks a solution . This slows the solution moderately .


def Func(arg_0, arg_1=None):
        ''' Sends the request body. '''

        # Sends VT_EMPTY if it is GET, HEAD request.
        if arg_1 is None:
            arg_2 = VARIANT.create_empty()
            _WinHttpRequest._Send(arg_0, arg_2)
        else:  # Sends request body as SAFEArray.
            arg_3 = VARIANT.create_safearray_from_str(arg_1)
            _WinHttpRequest._Send(arg_0, arg_3)


def Func ( arg_0 : arg_1 ) -> SetOfNodePairs : arg_2 = get_causal_subgraph ( arg_0 ) arg_3 = set ( ) for arg_4 , arg_5 , arg_6 in arg_2 . edges ( data = True ) : if arg_6 [ RELATION ] not in CAUSAL_INCREASE_RELATIONS : continue if arg_2 . has_edge ( arg_5 , arg_4 ) and any ( arg_7 [ RELATION ] in CAUSAL_INCREASE_RELATIONS for arg_7 in arg_2 [ arg_5 ] [ arg_4 ] . values ( ) ) : arg_3 . add ( tuple ( sorted ( [ arg_4 , arg_5 ] , key = str ) ) ) return arg_3

def Func(arg_0: arg_1) -> SetOfNodePairs:
    """Find pairs of nodes that have mutual causal edges that are increasing each other such that ``A -> B`` and
    ``B -> A``.

    :return: A set of pairs of nodes with mutual causal edges
    """
    arg_2 = get_causal_subgraph(arg_0)

    arg_3 = set()

    for arg_4, arg_5, arg_6 in arg_2.edges(data=True):
        if arg_6[RELATION] not in CAUSAL_INCREASE_RELATIONS:
            continue

        if arg_2.has_edge(arg_5, arg_4) and any(arg_7[RELATION] in CAUSAL_INCREASE_RELATIONS for arg_7 in arg_2[arg_5][arg_4].values()):
            arg_3.add(tuple(sorted([arg_4, arg_5], key=str)))

    return arg_3

Find pairs of nodes that have mutual causal edges that are increasing each other such that A - > B and B - > A .


def Func(arg_0=True, arg_1=False):
    '''Load the MNIST digits dataset.'''
    arg_2 = find('mnist.pkl.gz', 'http://deeplearning.net/data/mnist/mnist.pkl.gz')
    arg_3 = gzip.open(arg_2, 'rb')
    if sys.version_info < (3, ):
        (arg_4, arg_5), (arg_6, arg_7), (arg_8, arg_9) = pickle.load(arg_3)
    else:
        (arg_4, arg_5), (arg_6, arg_7), (arg_8, arg_9) = pickle.load(arg_3, encoding='bytes')
    arg_3.close()
    if not arg_0:
        arg_4 = arg_4.reshape((-1, 28, 28, 1))
        arg_6 = arg_6.reshape((-1, 28, 28, 1))
        arg_8 = arg_8.reshape((-1, 28, 28, 1))
    if arg_1:
        return ((arg_4, arg_5.astype('i')),
                (arg_6, arg_7.astype('i')),
                (arg_8, arg_9.astype('i')))
    return (arg_4, ), (arg_6, ), (arg_8, )


def Func(arg_0, arg_1=None, arg_2=None):
    """
    Plots output of compute_sector_exposures as line graphs

    Parameters
    ----------
    net_exposures : arrays
        Arrays of net sector exposures (output of compute_sector_exposures).

    sector_dict : dict or OrderedDict
        Dictionary of all sectors
        - See full description in compute_sector_exposures
    """

    if arg_2 is None:
        arg_2 = plt.gca()

    if arg_1 is None:
        arg_3 = SECTORS.values()
    else:
        arg_3 = arg_1.values()

    arg_4 = plt.cm.gist_rainbow(np.linspace(0, 1, 11))

    for arg_5 in range(len(arg_0)):
        arg_2.plot(arg_0[arg_5], color=arg_4[arg_5], alpha=0.8,
                label=arg_3[arg_5])
    arg_2.set(title='Net exposures to sectors',
           ylabel='Proportion of net exposure \n in sectors')

    return arg_2


return alg_dic[alg](data, dag, nh=self.nh, nb_runs=self.nb_runs, gpu=self.gpu,
                            nb_jobs=self.nb_jobs, lr=self.lr, train_epochs=self.train_epochs,
                            test_epochs=self.test_epochs, verbose=self.verbose)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'HC' ) : arg_4 = { 'HC' : hill_climbing , 'HCr' : hill_climbing_with_removal , 'tabu' : tabu_search , 'EHC' : exploratory_hill_climbing } return arg_4 [ arg_3 ] ( arg_1 , arg_2 , nh = arg_0 . nh , nb_runs = arg_0 . nb_runs , gpu = arg_0 . gpu , nb_jobs = arg_0 . nb_jobs , lr = arg_0 . lr , train_epochs = arg_0 . train_epochs , test_epochs = arg_0 . test_epochs , verbose = arg_0 . verbose )

def Func(arg_0, arg_1, arg_2, arg_3='HC'):
        """Modify and improve a directed acyclic graph solution using CGNN.

        Args:
            data (pandas.DataFrame): Observational data on which causal
               discovery has to be performed.
            dag (nx.DiGraph): Graph that provides the initial solution,
               on which the CGNN algorithm will be applied.
            alg (str): Exploration heuristic to use, among ["HC", "HCr",
               "tabu", "EHC"]
        Returns:
            networkx.DiGraph: Solution given by CGNN.

        """
        arg_4 = {'HC': hill_climbing, 'HCr': hill_climbing_with_removal,
                   'tabu': tabu_search, 'EHC': exploratory_hill_climbing}

        return arg_4[arg_3](arg_1, arg_2, nh=arg_0.nh, nb_runs=arg_0.nb_runs, gpu=arg_0.gpu,
                            nb_jobs=arg_0.nb_jobs, lr=arg_0.lr, train_epochs=arg_0.train_epochs,
                            test_epochs=arg_0.test_epochs, verbose=arg_0.verbose)

Modify and improve a directed acyclic graph solution using CGNN .


def Func(arg_0):
    """ Replace known special characters to SVG code.

    Parameters
    ----------
    svg_content: str

    Returns
    -------
    corrected_svg: str
        Corrected SVG content
    """
    arg_1 = arg_0
    arg_2 = [
        ('&', '&'),
        ('>', '>'),
        ('<', '<'),
        ('"', '"'),
    ]

    for arg_3, arg_4 in arg_2:
        arg_1 = arg_1.replace(arg_3, arg_4)

    return arg_1

Replace known special characters to SVG code .


(self, category, filter_classified=False, **kwargs)

def Func(arg_0, arg_1, arg_2=False, **arg_3):
        """Fetch items from the repository.

        The method retrieves items from a repository.

        To removed classified fields from the resulting items, set
        the parameter `filter_classified`. Take into account this
        parameter is incompatible with archiving items. Raw client
        data are archived before any other process. Therefore,
        classified data  are stored within the archive. To prevent
        from possible data leaks or security issues when users do
        not need these fields, archiving and filtering are not
        compatible.

        :param category: the category of the items Funced
        :param filter_classified: remove classified fields from the resulting items
        :param kwargs: a list of other parameters (e.g., from_date, offset, etc.
        specific for each backend)

        :returns: a generator of items

        :raises BackendError: either when the category is not valid or
            'filter_classified' and 'archive' are active at the same time.
        """
        if arg_1 not in arg_0.categories:
            arg_4 = "%s category not valid for %s" % (arg_1, arg_0.__class__.__name__)
            raise BackendError(arg_4=arg_4)

        if arg_2 and arg_0.archive:
            arg_4 = "classified fields filtering is not compatible with archiving items"
            raise BackendError(arg_4=arg_4)

        if arg_0.archive:
            arg_0.archive.init_metadata(arg_0.origin, arg_0.__class__.__name__, arg_0.version, arg_1,
                                       arg_3)

        arg_0.client = arg_0._init_client()

        for arg_6 in arg_0.Func_items(arg_1, **arg_3):
            if arg_2:
                arg_6 = arg_0.filter_classified_data(arg_6)

            yield arg_0.metadata(arg_6, arg_2=arg_2)

Fetch items from the repository.

        The method retrieves items from a repository.

        To removed classified fields from the resulting items, set
        the parameter `filter_classified`. Take into account this
        parameter is incompatible with archiving items. Raw client
        data are archived before any other process. Therefore,
        classified data  are stored within the archive. To prevent
        from possible data leaks or security issues when users do
        not need these fields, archiving and filtering are not
        compatible.

        :param category: the category of the items fetched
        :param filter_classified: remove classified fields from the resulting items
        :param kwargs: a list of other parameters (e.g., from_date, offset, etc.
        specific for each backend)

        :returns: a generator of items

        :raises BackendError: either when the category is not valid or
            'filter_classified' and 'archive' are active at the same time.


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
)
:
if
arg_2
is
:
arg_2
=
arg_0
.
sweeps
1
arg_3
=
arg_2
arg_1
+
1
arg_4
=
np
.
zeros
(
len
(
arg_0
.
sweepY
)
)
arg_0
.
log
.
debug
(
"averaging sweep %d to %d"
,
arg_1
,
arg_2
)
for
arg_5
in
np
.
arange
(
arg_3
)
+
arg_1
:
arg_0
.
setsweep
(
arg_5
)
arg_4
+=
arg_0
.
sweepY
.
flatten
(
)
arg_6
=
arg_4
/
arg_3
return
arg_6

def Func(arg_0,arg_1=0,arg_2=None):
        """
        Return a sweep which is the average of multiple sweeps.
        For now, standard deviation is lost.
        """
        if arg_2 is None:
            arg_2=arg_0.sweeps-1
        arg_3=arg_2-arg_1+1
        arg_4=np.zeros(len(arg_0.sweepY))
        arg_0.log.debug("averaging sweep %d to %d",arg_1,arg_2)
        for arg_5 in np.arange(arg_3)+arg_1:
            arg_0.setsweep(arg_5)
            arg_4+=arg_0.sweepY.flatten()
        arg_6=arg_4/arg_3
        #TODO: standard deviation?
        return arg_6

Return a sweep which is the average of multiple sweeps . For now standard deviation is lost .