(self, other, max_distance=1e-4, points_per_edge=8)

return self.coords_almost_equals(
            other, max_distance=max_distance, points_per_edge=points_per_edge)

def Func(arg_0, arg_1, arg_2=1e-4, arg_3=8):
        """
        Compare this and another LineString.

        Parameters
        ----------
        other: imgaug.augmentables.lines.LineString
            The other line string. Must be a LineString instance, not just
            its coordinates.

        max_distance : float, optional
            See :func:`imgaug.augmentables.lines.LineString.coords_Func`.

        points_per_edge : int, optional
            See :func:`imgaug.augmentables.lines.LineString.coords_Func`.

        Returns
        -------
        bool
            ``True`` if the coordinates are almost equal according to
            :func:`imgaug.augmentables.lines.LineString.coords_Func`
            and additionally the labels are identical. Otherwise ``False``.

        """
        if arg_0.label != arg_1.label:
            return False
        return arg_0.coords_Func(
            arg_1, arg_2=arg_2, arg_3=arg_3)

Compare this and another LineString.

        Parameters
        ----------
        other: imgaug.augmentables.lines.LineString
            The other line string. Must be a LineString instance, not just
            its coordinates.

        max_distance : float, optional
            See :func:`imgaug.augmentables.lines.LineString.coords_almost_equals`.

        points_per_edge : int, optional
            See :func:`imgaug.augmentables.lines.LineString.coords_almost_equals`.

        Returns
        -------
        bool
            ``True`` if the coordinates are almost equal according to
            :func:`imgaug.augmentables.lines.LineString.coords_almost_equals`
            and additionally the labels are identical. Otherwise ``False``.


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . _get_id_path ( 'Func' ) arg_3 = { 'value' : arg_1 . pop ( 'value' , None ) , } arg_4 = arg_0 . _POST ( arg_2 , arg_1 , arg_3 ) arg_0 . _set_attrs_to_values ( arg_4 ) return arg_4

def Func(arg_0, **arg_1):
        """
        This method lets users rate a movie. A valid session id or guest
        session id is required.

        Args:
            session_id: see Authentication.
            guest_session_id: see Authentication.
            value: Rating value.

        Returns:
            A dict representation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('Func')

        arg_3 = {
            'value': arg_1.pop('value', None),
        }

        arg_4 = arg_0._POST(arg_2, arg_1, arg_3)
        arg_0._set_attrs_to_values(arg_4)
        return arg_4

This method lets users rate a movie . A valid session id or guest session id is required .


def Func ( arg_0 , arg_1 ) : if not hasattr ( arg_1 , "id" ) and hasattr ( arg_1 , "value" ) : arg_1 = arg_1 . value return arg_1 . id

def Func(arg_0, arg_1):
        """Check if value has id attribute and return it.

        :param value: The value to get id from.
        :return: The value.id.
        """
        if not hasattr(arg_1, "id") and hasattr(arg_1, "value"):
            arg_1 = arg_1.value
        return arg_1.id

Check if value has id attribute and return it .


fseq messages associate a unique frame id with a set of set
        and alive messages

def Func(arg_0, arg_1, arg_2):
        """
        Func messages associate a unique frame id with a set of set
        and alive messages
        """
        arg_1.last_frame = arg_1.current_frame
        arg_1.current_frame = arg_2[3]


def Func(arg_0):
    """Obtains the boundaries module given a boundary algorithm identificator.

    Parameters
    ----------
    boundaries_id: str
        Boundary algorithm identificator (e.g., foote, sf).

    Returns
    -------
    module: object
        Object containing the selected boundary module.
        None for "ground truth".
    """
    if arg_0 == "gt":
        return None
    try:
        arg_1 = eval(algorithms.__name__ + "." + arg_0)
    except AttributeError:
        raise RuntimeError("Algorithm %s can not be found in msaf!" %
                           arg_0)
    if not arg_1.is_boundary_type:
        raise RuntimeError("Algorithm %s can not identify boundaries!" %
                           arg_0)
    return arg_1

Obtains the boundaries module given a boundary algorithm identificator .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( ExtensionInformation , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) arg_0 . extension_name . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( Tags . EXTENSION_TAG , arg_6 ) : arg_0 . extension_tag = ExtensionTag ( ) arg_0 . extension_tag . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( Tags . EXTENSION_TYPE , arg_6 ) : arg_0 . extension_type = ExtensionType ( ) arg_0 . extension_type . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . is_oversized ( arg_6 ) arg_0 . validate ( )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the ExtensionInformation object and decode it
        into its constituent parts.

        Args:
            istream (Stream): A data stream containing encoded object data,
                supporting a Func method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(ExtensionInformation, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = BytearrayStream(arg_1.Func(arg_0.length))

        arg_0.extension_name.Func(arg_6, arg_2=arg_2)

        if arg_0.is_tag_next(Tags.EXTENSION_TAG, arg_6):
            arg_0.extension_tag = ExtensionTag()
            arg_0.extension_tag.Func(arg_6, arg_2=arg_2)
        if arg_0.is_tag_next(Tags.EXTENSION_TYPE, arg_6):
            arg_0.extension_type = ExtensionType()
            arg_0.extension_type.Func(arg_6, arg_2=arg_2)

        arg_0.is_oversized(arg_6)
        arg_0.validate()

Read the data encoding the ExtensionInformation object and decode it
        into its constituent parts.

        Args:
            istream (Stream): A data stream containing encoded object data,
                supporting a read method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

Read the data encoding the ExtensionInformation object and decode it into its constituent parts .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
arg_3
)
:
try
:
arg_4
=
instruction_tables
[
arg_2
]
arg_0
=
arg_0
.
strip
(
)
.
split
(
' '
)
arg_5
=
arg_4
[
arg_0
[
0
]
.
upper
(
)
]
if
arg_1
:
arg_5
.
pc
=
arg_1
if
arg_5
.
operand_size
>
0
:
assert
len
(
arg_0
)
==
2
arg_5
.
operand
=
int
(
arg_0
[
1
]
,
0
)
return
arg_5
except
:
raise
AssembleError
(
"Something wrong at pc %d"
%
arg_1
)

def Func(arg_0, arg_1=0, arg_2=arg_3):
    """ Assemble one EVM instruction from its textual representation.

        :param asmcode: assembly code for one instruction
        :type asmcode: str
        :param pc: program counter of the instruction(optional)
        :type pc: int
        :param fork: fork name (optional)
        :type fork: str
        :return: An Instruction object
        :rtype: Instruction

        Example use::

            >>> print Func('LT')

    """
    try:
        arg_4 = instruction_tables[arg_2]
        arg_0 = arg_0.strip().split(' ')
        arg_5 = arg_4[arg_0[0].upper()]
        if arg_1:
            arg_5.pc = arg_1
        if arg_5.operand_size > 0:
            assert len(arg_0) == 2
            arg_5.operand = int(arg_0[1], 0)
        return arg_5
    except:
        raise AssembleError("Something wrong at pc %d" % arg_1)

Assemble one EVM instruction from its textual representation.

        :param asmcode: assembly code for one instruction
        :type asmcode: str
        :param pc: program counter of the instruction(optional)
        :type pc: int
        :param fork: fork name (optional)
        :type fork: str
        :return: An Instruction object
        :rtype: Instruction

        Example use::

            >>> print assemble_one('LT')

Assemble one EVM instruction from its textual representation .


def Func ( arg_0 ) : try : arg_1 = { } for arg_2 in arg_0 . get_handlers ( ) : arg_1 [ arg_2 ] = arg_2 . formatter arg_0 . set_formatter ( arg_5 = 'quiet' ) yield except Exception as e : raise finally : for arg_3 , arg_4 in iteritems ( arg_1 ) : arg_3 . formatter = arg_4

def Func(arg_0):
        """ Temporarily do not use any formatter so that text printed is raw """
        try:
            arg_1 = {}
            for arg_2 in arg_0.get_handlers():
                arg_1[arg_2] = arg_2.formatter
            arg_0.set_formatter(arg_5='quiet')
            yield
        except Exception as e:
            raise
        finally:
            for arg_3,arg_4 in iteritems(arg_1):
                arg_3.formatter = arg_4


def Func ( arg_0 , arg_1 = None ) : if not settings . UNFRIENDLY_ENABLE_FILTER : return arg_0 arg_2 = { 'key' : encrypt ( arg_0 , settings . UNFRIENDLY_SECRET , settings . UNFRIENDLY_IV , checksum = settings . UNFRIENDLY_ENFORCE_CHECKSUM ) , } if arg_1 : arg_2 [ 'juice' ] = slugify ( arg_1 ) return reverse ( 'unfriendly-deFunc' , arg_2 = arg_2 )

def Func(arg_0, arg_1=None):
    """
    Template filter that Funcs whatever text it is applied to. The text is
    supposed to be a URL, but it will Func anything.

    Usage:
        Extremely unfriendly URL:
        {{ "/my-secret-path/"|Func }}

        Include some SEO juice:
        {{ "/my-secret-path/"|Func:"some SEO friendly text" }}
    """
    if not settings.UNFRIENDLY_ENABLE_FILTER:
        return arg_0
    arg_2 = {
        'key': encrypt(arg_0,
                       settings.UNFRIENDLY_SECRET,
                       settings.UNFRIENDLY_IV,
                       checksum=settings.UNFRIENDLY_ENFORCE_CHECKSUM),
    }
    if arg_1:
        arg_2['juice'] = slugify(arg_1)
    return reverse('unfriendly-deFunc', arg_2=arg_2)

Template filter that obfuscates whatever text it is applied to. The text is
    supposed to be a URL, but it will obfuscate anything.

    Usage:
        Extremely unfriendly URL:
        {{ "/my-secret-path/"|obfuscate }}

        Include some SEO juice:
        {{ "/my-secret-path/"|obfuscate:"some SEO friendly text" }}

Template filter that obfuscates whatever text it is applied to . The text is supposed to be a URL but it will obfuscate anything .


def Func ( arg_0 , arg_1 ) : try : arg_2 = User . objects . get ( email = arg_1 ) try : return arg_0 . get ( user_id = arg_2 . id ) except EnterpriseCustomerUser . DoesNotExist : pass except User . DoesNotExist : pass try : return PendingEnterpriseCustomerUser . objects . get ( arg_1 = arg_1 ) except PendingEnterpriseCustomerUser . DoesNotExist : pass return None

def Func(arg_0, arg_1):
        """
        Return link by email.
        """
        try:
            arg_2 = User.objects.get(email=arg_1)
            try:
                return arg_0.get(user_id=arg_2.id)
            except EnterpriseCustomerUser.DoesNotExist:
                pass
        except User.DoesNotExist:
            pass

        try:
            return PendingEnterpriseCustomerUser.objects.get(arg_1=arg_1)
        except PendingEnterpriseCustomerUser.DoesNotExist:
            pass

        return None


def Func ( arg_0 ) : if current_app : arg_0 . setdefault ( 'cls' , current_app . json_encoder ) if not current_app . config [ 'JSON_AS_ASCII' ] : arg_0 . setdefault ( 'ensure_ascii' , False ) arg_0 . setdefault ( 'sort_keys' , current_app . config [ 'JSON_SORT_KEYS' ] ) else : arg_0 . setdefault ( 'sort_keys' , True ) arg_0 . setdefault ( 'cls' , JSONEncoder )

def Func(arg_0):
    """Inject default arguments for dump functions."""
    if current_app:
        arg_0.setdefault('cls', current_app.json_encoder)
        if not current_app.config['JSON_AS_ASCII']:
            arg_0.setdefault('ensure_ascii', False)
        arg_0.setdefault('sort_keys', current_app.config['JSON_SORT_KEYS'])
    else:
        arg_0.setdefault('sort_keys', True)
        arg_0.setdefault('cls', JSONEncoder)

Inject default arguments for dump functions .


def Func ( arg_0 , arg_1 ) : arg_2 = OrderedDict ( ) if arg_1 . catalog : arg_3 = arg_0 . _load_data ( arg_0 . ENTERPRISE_CUSTOMER_ENDPOINT , detail_resource = 'courses' , resource_id = str ( arg_1 . uuid ) , traverse_pagination = True , ) for arg_4 in arg_3 [ 'results' ] : for arg_5 in arg_4 [ 'course_runs' ] : arg_5 [ 'content_type' ] = 'courserun' arg_2 [ arg_5 [ 'key' ] ] = arg_5 for arg_6 in arg_1 . enterprise_customer_catalogs . all ( ) : arg_3 = arg_0 . _load_data ( arg_0 . ENTERPRISE_CUSTOMER_CATALOGS_ENDPOINT , resource_id = str ( arg_6 . uuid ) , traverse_pagination = True , querystring = { 'page_size' : 1000 } , ) for arg_7 in arg_3 [ 'results' ] : arg_8 = utils . Func_item_id ( arg_7 ) arg_2 [ arg_8 ] = arg_7 return arg_2 . values ( )

def Func(arg_0, arg_1):
        """
        Return all content metadata contained in the catalogs associated with the EnterpriseCustomer.

        Arguments:
            enterprise_customer (EnterpriseCustomer): The EnterpriseCustomer to return content metadata for.

        Returns:
            list: List of dicts containing content metadata.
        """
        arg_2 = OrderedDict()

        # TODO: This if block can be removed when we get rid of discovery service-based catalogs.
        if arg_1.catalog:
            arg_3 = arg_0._load_data(
                arg_0.ENTERPRISE_CUSTOMER_ENDPOINT,
                detail_resource='courses',
                resource_id=str(arg_1.uuid),
                traverse_pagination=True,
            )
            for arg_4 in arg_3['results']:
                for arg_5 in arg_4['course_runs']:
                    arg_5['content_type'] = 'courserun'  # Make this look like a search endpoint result.
                    arg_2[arg_5['key']] = arg_5

        for arg_6 in arg_1.enterprise_customer_catalogs.all():
            arg_3 = arg_0._load_data(
                arg_0.ENTERPRISE_CUSTOMER_CATALOGS_ENDPOINT,
                resource_id=str(arg_6.uuid),
                traverse_pagination=True,
                querystring={'page_size': 1000},
            )

            for arg_7 in arg_3['results']:
                arg_8 = utils.Func_item_id(arg_7)
                arg_2[arg_8] = arg_7

        return arg_2.values()

Return all content metadata contained in the catalogs associated with the EnterpriseCustomer .


def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 = COURSES_API . format ( arg_1 ) + "/sections" arg_4 = [ ] for arg_5 in arg_0 . _get_paged_resource ( arg_3 , arg_2 = arg_2 ) : arg_4 . append ( CanvasSection ( arg_5 = arg_5 ) ) return arg_4

def Func(arg_0, arg_1, arg_2={}):
        """
        Return list of sections for the passed course ID.

        https://canvas.instructure.com/doc/api/sections.html#method.sections.index
        """
        arg_3 = COURSES_API.format(arg_1) + "/sections"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(CanvasSection(arg_5=arg_5))

        return arg_4

Return list of sections for the passed course ID .


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

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

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

        if arg_0._username:
            arg_0._username.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError(
                "Username/password credential struct missing the username."
            )

        if arg_0._password:
            arg_0._password.Func(arg_6, arg_2=arg_2)

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

Write the data encoding the UsernamePasswordCredential struct to a
        stream.

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

        Raises:
            ValueError: Raised if the username is not defined.

Write the data encoding the UsernamePasswordCredential struct to a stream .


def Func ( arg_0 , arg_1 ) : if arg_0 . lrnIterationIdx < 100 : arg_2 = 0.5 else : arg_2 = 0.1 arg_0 . avgLearnedSeqLength = ( ( 1.0 - arg_2 ) * arg_0 . avgLearnedSeqLength + ( arg_2 * arg_1 ) )

def Func(arg_0, arg_1):
    """Update our moving average of learned sequence length."""
    if arg_0.lrnIterationIdx < 100:
      arg_2 = 0.5
    else:
      arg_2 = 0.1

    arg_0.avgLearnedSeqLength = ((1.0 - arg_2) * arg_0.avgLearnedSeqLength +
                                (arg_2 * arg_1))

Update our moving average of learned sequence length .


(params, gradients, momentum=0.9, learning_rate=0.01)

def Func(arg_0, arg_1, arg_2=0.9, arg_3=0.01):
    """
    Momentum SGD optimization core.
    """
    arg_4 = []
    arg_5 = []
    for arg_6, arg_7 in zip(arg_0, arg_1):
            arg_8 = arg_3 * arg_7
            arg_9 = theano.shared(np.zeros_like(arg_6.get_value()), name=arg_6.name + '_vel')
            arg_5.append((arg_9, arg_2 * arg_9 - arg_8))
            arg_5.append((arg_6, arg_6 + arg_9))
            arg_4.append(arg_9)
    return arg_5, arg_4


def
Func
(
arg_0
)
:
arg_1
=
[
]
arg_2
=
arg_0
.
context
.
get
(
"__version__"
,
)
arg_3
=
arg_0
.
context
.
get
(
"__template__"
,
)
arg_4
=
arg_0
.
context
.
get
(
"__build__"
,
)
if
arg_2
and
arg_3
and
arg_4
:
if
arg_0
.
logger
:
arg_0
.
logger
.
debug
(
"Adding template version: {}; {}; "
"{}"
.
format
(
arg_3
,
arg_2
,
arg_4
)
)
arg_1
.
append
(
{
"program"
:
arg_3
,
"version"
:
arg_2
,
"build"
:
arg_4
}
)
for
arg_5
,
arg_6
in
arg_0
.
context
.
items
(
)
:
if
arg_5
.
startswith
(
"__get_version"
)
:
arg_7
=
arg_6
(
)
arg_1
.
append
(
arg_7
)
if
arg_0
.
logger
:
arg_0
.
logger
.
debug
(
"Found additional software version"
"{}"
.
format
(
arg_7
)
)
with
open
(
".versions"
,
"w"
)
as
fh
:
fh
.
write
(
json
.
dumps
(
arg_1
,
separators
=
(
","
,
":"
)
)
)

def Func(arg_0):
        """Writes versions JSON for a template file

        This method creates the JSON file ``.versions`` based on the metadata
        and specific functions that are present in a given template script.

        It starts by fetching the template metadata, which can be specified
        via the ``__version__``, ``__template__`` and ``__build__``
        attributes. If all of these attributes exist, it starts to populate
        a JSON/dict array (Note that the absence of any one of them will
        prevent the version from being written).

        Then, it will search the
        template scope for functions that start with the substring
        ``__set_version`` (For example ``def __set_version_fastqc()`).
        These functions should gather the version of
        an arbitrary program and return a JSON/dict object with the following
        information::

            {
                "program": <program_name>,
                "version": <version>
                "build": <build>
            }

        This JSON/dict object is then written in the ``.versions`` file.
        """

        arg_1 = []

        arg_2 = arg_0.context.get("__version__", None)
        arg_3 = arg_0.context.get("__template__", None)
        arg_4 = arg_0.context.get("__build__", None)

        if arg_2 and arg_3 and arg_4:
            if arg_0.logger:
                arg_0.logger.debug("Adding template version: {}; {}; "
                                  "{}".format(arg_3,
                                              arg_2,
                                              arg_4))
            arg_1.append({
                "program": arg_3,
                "version": arg_2,
                "build": arg_4
            })

        for arg_5, arg_6 in arg_0.context.items():
            if arg_5.startswith("__get_version"):
                arg_7 = arg_6()
                arg_1.append(arg_7)
                if arg_0.logger:
                    arg_0.logger.debug("Found additional software version"
                                      "{}".format(arg_7))

        with open(".versions", "w") as fh:
            fh.write(json.dumps(arg_1, separators=(",", ":")))


(self, cache=True, as_text=False, parse_form_data=False)

def Func ( arg_0 , arg_1 = True , arg_2 = False , arg_3 = False ) : arg_4 = getattr ( arg_0 , '_cached_data' , None ) if arg_4 is None : if arg_3 : arg_0 . _load_form_data ( ) arg_4 = arg_0 . stream . read ( ) if arg_1 : arg_0 . _cached_data = arg_4 if arg_2 : arg_4 = arg_4 . decode ( arg_0 . charset , arg_0 . encoding_errors ) return arg_4

def Func(arg_0, arg_1=True, arg_2=False, arg_3=False):
        """This reads the buffered incoming data from the client into one
        bytestring.  By default this is cached but that behavior can be
        changed by setting `cache` to `False`.

        Usually it's a bad idea to call this method without checking the
        content length first as a client could send dozens of megabytes or more
        to cause memory problems on the server.

        Note that if the form data was already parsed this method will not
        return anything as form data parsing does not cache the data like
        this method does.  To implicitly invoke form data parsing function
        set `parse_form_data` to `True`.  When this is done the return value
        of this method will be an empty string if the form parser handles
        the data.  This generally is not necessary as if the whole data is
        cached (which is the default) the form parser will used the cached
        data to parse the form data.  Please be generally aware of checking
        the content length first in any case before calling this method
        to avoid exhausting server memory.

        If `as_text` is set to `True` the return value will be a decoded
        unicode string.

        .. versionadded:: 0.9
        """
        arg_4 = getattr(arg_0, '_cached_data', None)
        if arg_4 is None:
            if arg_3:
                arg_0._load_form_data()
            arg_4 = arg_0.stream.read()
            if arg_1:
                arg_0._cached_data = arg_4
        if arg_2:
            arg_4 = arg_4.decode(arg_0.charset, arg_0.encoding_errors)
        return arg_4

This reads the buffered incoming data from the client into one bytestring . By default this is cached but that behavior can be changed by setting cache to False .


def
Func
(
arg_0
,
arg_1
)
:
if
type
(
arg_1
)
==
list
:
arg_0
.
columns
=
arg_1
elif
type
(
arg_1
)
==
str
:
arg_0
.
columns
=
[
c
.
strip
(
)
for
c
in
arg_1
.
split
(
)
]
elif
type
(
arg_1
)
==
IntEnum
:
arg_0
.
columns
=
[
str
(
c
)
for
c
in
arg_1
]
else
:
raise
RawlException
(
"Unknown format for columns"
)

def Func(arg_0, arg_1):
        """
        Handle provided columns and if necessary, convert columns to a list for
        internal strage.

        :columns: A sequence of columns for the table. Can be list, comma
            -delimited string, or IntEnum.
        """
        if type(arg_1) == list:
            arg_0.columns = arg_1
        elif type(arg_1) == str:
            arg_0.columns = [c.strip() for c in arg_1.split()]
        elif type(arg_1) == IntEnum:
            arg_0.columns = [str(c) for c in arg_1]
        else:
            raise RawlException("Unknown format for columns")

Handle provided columns and if necessary convert columns to a list for internal strage .


(self, drop_nan=True, drop_masked=True, column_names=None)

def Func ( arg_0 , arg_1 = True , arg_2 = True , arg_3 = None ) : arg_4 = arg_0 . copy ( ) arg_4 . select_non_missing ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , name = FILTER_SELECTION_NAME , mode = 'and' ) return arg_4

def Func(arg_0, arg_1=True, arg_2=True, arg_3=None):
        """Create a shallow copy of a DataFrame, with filtering set using select_non_missing.

        :param drop_nan: drop rows when there is a NaN in any of the columns (will only affect float values)
        :param drop_masked: drop rows when there is a masked value in any of the columns
        :param column_names: The columns to consider, default: all (real, non-virtual) columns
        :rtype: DataFrame
        """
        arg_4 = arg_0.copy()
        arg_4.select_non_missing(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
                                name=FILTER_SELECTION_NAME, mode='and')
        return arg_4

Create a shallow copy of a DataFrame with filtering set using select_non_missing .


Returns the scaled z positions of the points as doubles

return scale_dimension(self.Z, self.header.z_scale, self.header.z_offset)

def Func ( arg_0 ) : return scale_dimension ( arg_0 . Z , arg_0 . header . Func_scale , arg_0 . header . Func_offset )

def Func(arg_0):
        """ Returns the scaled Func positions of the points as doubles
        """
        return scale_dimension(arg_0.Z, arg_0.header.Func_scale, arg_0.header.Func_offset)


def Func(arg_0, arg_1):
    """
    This function is used to format the key value as a multi-line string maintaining the line breaks
    """

    def new_representer(arg_2, arg_3):
        arg_4 = arg_1(arg_2, arg_3)
        arg_4.style = arg_0
        return arg_4

    return new_representer

This function is used to format the key value as a multi - line string maintaining the line breaks


def Func():
    """Determine if the current environment is Compute Engine.

    Returns:
        Boolean indicating whether or not the current environment is Google
        Compute Engine.
    """
    # NOTE: The explicit ``timeout`` is a workaround. The underlying
    #       issue is that resolving an unknown host on some networks will take
    #       20-30 seconds; making this timeout short fixes the issue, but
    #       could lead to false negatives in the event that we are on GCE, but
    #       the metadata resolution was particularly slow. The latter case is
    #       "unlikely".
    arg_0 = transport.get_http_object(timeout=GCE_METADATA_TIMEOUT)
    try:
        arg_1, arg_2 = transport.request(
            arg_0, _GCE_METADATA_URI, headers=_GCE_HEADERS)
        return (
            arg_1.status == http_client.OK and
            arg_1.get(_METADATA_FLAVOR_HEADER) == _DESIRED_METADATA_FLAVOR)
    except socket.error:  # socket.timeout or socket.error(64, 'Host is down')
        logger.info('Timeout attempting to reach GCE metadata service.')
        return False

Determine if the current environment is Compute Engine .


return lambda **kwargs: interpret.run_function(metamodel, label,
                                                   action, kwargs)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . Action_Semantics_internal arg_3 = arg_1 . Name return lambda ** kwargs : interpret . run_function ( arg_0 , arg_3 , arg_2 , kwargs )

def Func(arg_0, arg_1):
    '''
    Create a python function from a BridgePoint bridge.
    '''
    arg_2 = arg_1.Action_Semantics_internal
    arg_3 = arg_1.Name
    return lambda **kwargs: interpret.run_function(arg_0, arg_3,
                                                   arg_2, kwargs)

Create a python function from a BridgePoint bridge .


(universe: BELGraph, graph: BELGraph, edge_predicates: EdgePredicates = None)

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_4 = None) -> None:
    """Edges between entities in the sub-graph that pass the given filters.

    :param universe: The full graph
    :param graph: A sub-graph to find the upstream information
    :param edge_predicates: Optional list of edge filter functions (graph, node, node, key, data) -> bool
    """
    arg_5 = and_edge_predicates(arg_3)

    for arg_6, arg_7 in itt.product(arg_2, repeat=2):
        if arg_2.has_edge(arg_6, arg_7) or not arg_0.has_edge(arg_6, arg_7):
            continue

        arg_8 = defaultdict(list)
        for arg_9, arg_10 in arg_0[arg_6][arg_7].items():
            if not arg_5(arg_0, arg_6, arg_7, arg_9):
                continue

            arg_8[arg_10[RELATION]].append((arg_9, arg_10))

        if 1 == len(arg_8):
            arg_11 = list(arg_8)[0]
            for arg_9, arg_10 in arg_8[arg_11]:
                arg_2.add_edge(arg_6, arg_7, arg_9=arg_9, **arg_10)
        else:
            log.debug('Multiple relationship types found between %s and %s', arg_6, arg_7)

Edges between entities in the sub - graph that pass the given filters .


return super(ConsoleWidget, self).eventFilter(obj, event)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . type ( ) if arg_3 == QtCore . QEvent . KeyPress : arg_4 = arg_2 . key ( ) if arg_0 . _control_key_down ( arg_2 . modifiers ( ) ) and arg_4 in arg_0 . _ctrl_down_remap : arg_5 = QtGui . QKeyEvent ( QtCore . QEvent . KeyPress , arg_0 . _ctrl_down_remap [ arg_4 ] , QtCore . Qt . NoModifier ) QtGui . qApp . sendEvent ( arg_1 , arg_5 ) return True elif arg_1 == arg_0 . _control : return arg_0 . _event_filter_console_keypress ( arg_2 ) elif arg_1 == arg_0 . _page_control : return arg_0 . _event_filter_page_keypress ( arg_2 ) elif arg_3 == QtCore . QEvent . MouseButtonRelease and arg_2 . button ( ) == QtCore . Qt . MidButton and arg_1 == arg_0 . _control . viewport ( ) : arg_6 = arg_0 . _control . cursorForPosition ( arg_2 . pos ( ) ) arg_0 . _control . setTextCursor ( arg_6 ) arg_0 . paste ( QtGui . QClipboard . Selection ) return True elif arg_3 == QtCore . QEvent . Resize and not arg_0 . _filter_resize : arg_0 . _filter_resize = True QtGui . qApp . sendEvent ( arg_1 , arg_2 ) arg_0 . _adjust_scrollbars ( ) arg_0 . _filter_resize = False return True elif arg_3 == QtCore . QEvent . ShortcutOverride and arg_0 . override_shortcuts and arg_0 . _control_key_down ( arg_2 . modifiers ( ) ) and arg_2 . key ( ) in arg_0 . _shortcuts : arg_2 . accept ( ) elif arg_3 == QtCore . QEvent . DragEnter and arg_1 == arg_0 . _control . viewport ( ) and arg_2 . source ( ) == arg_0 . _control . viewport ( ) : arg_0 . _filter_drag = True elif arg_3 == QtCore . QEvent . DragLeave and arg_1 == arg_0 . _control . viewport ( ) and arg_0 . _filter_drag : arg_6 = arg_0 . _control . textCursor ( ) arg_6 . clearSelection ( ) arg_0 . _control . setTextCursor ( arg_6 ) arg_0 . _filter_drag = False elif arg_3 == QtCore . QEvent . Drop and arg_1 == arg_0 . _control . viewport ( ) : arg_6 = arg_0 . _control . cursorForPosition ( arg_2 . pos ( ) ) if arg_0 . _in_buffer ( arg_6 . position ( ) ) : arg_9 = arg_2 . mimeData ( ) . text ( ) arg_0 . _insert_plain_text_into_buffer ( arg_6 , arg_9 ) QtGui . qApp . sendEvent ( arg_1 , QtGui . QDragLeaveEvent ( ) ) return True elif arg_3 in arg_0 . _pager_scroll_events and arg_1 == arg_0 . _page_control : arg_0 . _page_control . repaint ( ) return True return super ( ConsoleWidget , arg_0 ) . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """ Reimplemented to ensure a console-like behavior in the underlying
            text widgets.
        """
        arg_3 = arg_2.type()
        if arg_3 == QtCore.QEvent.KeyPress:

            # Re-map keys for all filtered widgets.
            arg_4 = arg_2.key()
            if arg_0._control_key_down(arg_2.modifiers()) and \
                    arg_4 in arg_0._ctrl_down_remap:
                arg_5 = QtGui.QKeyEvent(QtCore.QEvent.KeyPress,
                                            arg_0._ctrl_down_remap[arg_4],
                                            QtCore.Qt.NoModifier)
                QtGui.qApp.sendEvent(arg_1, arg_5)
                return True

            elif arg_1 == arg_0._control:
                return arg_0._event_filter_console_keypress(arg_2)

            elif arg_1 == arg_0._page_control:
                return arg_0._event_filter_page_keypress(arg_2)

        # Make middle-click paste safe.
        elif arg_3 == QtCore.QEvent.MouseButtonRelease and \
                arg_2.button() == QtCore.Qt.MidButton and \
                arg_1 == arg_0._control.viewport():
            arg_6 = arg_0._control.cursorForPosition(arg_2.pos())
            arg_0._control.setTextCursor(arg_6)
            arg_0.paste(QtGui.QClipboard.Selection)
            return True

        # Manually adjust the scrollbars *after* a resize event is dispatched.
        elif arg_3 == QtCore.QEvent.Resize and not arg_0._filter_resize:
            arg_0._filter_resize = True
            QtGui.qApp.sendEvent(arg_1, arg_2)
            arg_0._adjust_scrollbars()
            arg_0._filter_resize = False
            return True

        # Override shortcuts for all filtered widgets.
        elif arg_3 == QtCore.QEvent.ShortcutOverride and \
                arg_0.override_shortcuts and \
                arg_0._control_key_down(arg_2.modifiers()) and \
                arg_2.key() in arg_0._shortcuts:
            arg_2.accept()

        # Ensure that drags are safe. The problem is that the drag starting
        # logic, which determines whether the drag is a Copy or Move, is locked
        # down in QTextControl. If the widget is editable, which it must be if
        # we're not executing, the drag will be a Move. The following hack
        # prevents QTextControl from deleting the text by clearing the selection
        # when a drag leave event originating from this widget is dispatched.
        # The fact that we have to clear the user's selection is unfortunate,
        # but the alternative--trying to prevent Qt from using its hardwired
        # drag logic and writing our own--is worse.
        elif arg_3 == QtCore.QEvent.DragEnter and \
                arg_1 == arg_0._control.viewport() and \
                arg_2.source() == arg_0._control.viewport():
            arg_0._filter_drag = True
        elif arg_3 == QtCore.QEvent.DragLeave and \
                arg_1 == arg_0._control.viewport() and \
                arg_0._filter_drag:
            arg_6 = arg_0._control.textCursor()
            arg_6.clearSelection()
            arg_0._control.setTextCursor(arg_6)
            arg_0._filter_drag = False

        # Ensure that drops are safe.
        elif arg_3 == QtCore.QEvent.Drop and arg_1 == arg_0._control.viewport():
            arg_6 = arg_0._control.cursorForPosition(arg_2.pos())
            if arg_0._in_buffer(arg_6.position()):
                arg_9 = arg_2.mimeData().text()
                arg_0._insert_plain_text_into_buffer(arg_6, arg_9)

            # Qt is expecting to get something here--drag and drop occurs in its
            # own event loop. Send a DragLeave event to end it.
            QtGui.qApp.sendEvent(arg_1, QtGui.QDragLeaveEvent())
            return True

        # Handle scrolling of the vsplit pager. This hack attempts to solve
        # problems with tearing of the help text inside the pager window.  This
        # happens only on Mac OS X with both PySide and PyQt. This fix isn't
        # perfect but makes the pager more usable.
        elif arg_3 in arg_0._pager_scroll_events and \
                arg_1 == arg_0._page_control:
            arg_0._page_control.repaint()
            return True
        return super(ConsoleWidget, arg_0).Func(arg_1, arg_2)

Reimplemented to ensure a console - like behavior in the underlying text widgets .


def Func(arg_0, arg_1):
        """Returns annotation date or None if not found.
        Reports error on failure.
        Note does not check value format.
        """
        arg_2 = list(arg_0.graph.triples((arg_1, arg_0.spdx_namespace['annotationDate'], None)))
        if len(arg_2) != 1:
            arg_0.error = True
            arg_4 = 'Annotation must have exactly one annotation date.'
            arg_0.logger.log(arg_4)
            return
        return six.text_type(arg_2[0][2])

Returns annotation date or None if not found . Reports error on failure . Note does not check value format .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
[
'operation'
]
if
arg_2
in
'append'
:
arg_0
.
add
(
len
(
arg_1
[
'value'
]
)
,
LatLng
(
*
arg_1
[
'item'
]
)
)
elif
arg_2
==
'insert'
:
arg_0
.
add
(
arg_1
[
'index'
]
,
LatLng
(
*
arg_1
[
'item'
]
)
)
elif
arg_2
==
'extend'
:
arg_3
=
[
LatLng
(
*
p
)
for
p
in
arg_1
[
'items'
]
]
arg_0
.
addAll
(
[
bridge
.
encode
(
arg_4
)
for
arg_4
in
arg_3
]
)
elif
arg_2
==
'__setitem__'
:
arg_0
.
set
(
arg_1
[
'index'
]
,
LatLng
(
*
arg_1
[
'newitem'
]
)
)
elif
arg_2
==
'pop'
:
arg_0
.
remove
(
arg_1
[
'index'
]
)
else
:
raise
NotImplementedError
(
"Unsupported change operation {}"
.
format
(
arg_2
)
)

def Func(arg_0, arg_1):
        """ Handle changes from atom ContainerLists """
        arg_2 = arg_1['operation']
        if arg_2 in 'append':
            arg_0.add(len(arg_1['value']), LatLng(*arg_1['item']))
        elif arg_2 == 'insert':
            arg_0.add(arg_1['index'], LatLng(*arg_1['item']))
        elif arg_2 == 'extend':
            arg_3 = [LatLng(*p) for p in arg_1['items']]
            arg_0.addAll([bridge.encode(arg_4) for arg_4 in arg_3])
        elif arg_2 == '__setitem__':
            arg_0.set(arg_1['index'], LatLng(*arg_1['newitem']))
        elif arg_2 == 'pop':
            arg_0.remove(arg_1['index'])
        else:
            raise NotImplementedError(
                "Unsupported change operation {}".format(arg_2))


def Func ( ) : try : socket . socket ( socket . AF_INET6 ) . close ( ) except ( socket . error , AttributeError ) : return False return True

def Func():
    """Check if IPv6 is available.

    :Return: `True` when an IPv6 socket can be created.
    """
    try:
        socket.socket(socket.AF_INET6).close()
    except (socket.error, AttributeError):
        return False
    return True


(rater_a, rater_b, min_rating=None, max_rating=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """
    Calculates kappa correlation between rater_a and rater_b.
    Kappa measures how well 2 quantities vary together.
    rater_a is a list of rater a scores
    rater_b is a list of rater b scores
    min_rating is an optional argument describing the minimum rating possible on the data set
    max_rating is an optional argument describing the maximum rating possible on the data set
    Returns a float corresponding to the kappa correlation
    """
    assert(len(arg_0) == len(arg_1))
    arg_0 = [int(a) for a in arg_0]
    arg_1 = [int(b) for b in arg_1]
    if arg_2 is None:
        arg_2 = min(arg_0 + arg_1)
    if arg_3 is None:
        arg_3 = max(arg_0 + arg_1)
    arg_4 = confusion_matrix(arg_0, arg_1,
        arg_2, arg_3)
    arg_5 = len(arg_4)
    arg_6 = float(len(arg_0))

    arg_7 = histogram(arg_0, arg_2, arg_3)
    arg_8 = histogram(arg_1, arg_2, arg_3)

    arg_9 = 0.0
    arg_10 = 0.0

    if(arg_5 > 1):
        for arg_11 in range(arg_5):
            for arg_12 in range(arg_5):
                arg_13 = (arg_7[arg_11] * arg_8[arg_12]
                                  / arg_6)
                arg_14 = pow(arg_11 - arg_12, 2.0) / pow(arg_5 - 1, 2.0)
                arg_9 += arg_14 * arg_4[arg_11][arg_12] / arg_6
                arg_10 += arg_14 * arg_13 / arg_6

        return 1.0 - arg_9 / arg_10
    else:
        return 1.0

Calculates kappa correlation between rater_a and rater_b . Kappa measures how well 2 quantities vary together . rater_a is a list of rater a scores rater_b is a list of rater b scores min_rating is an optional argument describing the minimum rating possible on the data set max_rating is an optional argument describing the maximum rating possible on the data set Returns a float corresponding to the kappa correlation


def Func(arg_0):
        """Copy a reaction

        The referenced metabolites and genes are also copied.

        """
        # no references to model when Funcing
        arg_1 = arg_0._model
        arg_0._model = None
        for arg_3 in arg_0._metabolites:
            arg_3._model = None
        for arg_3 in arg_0._genes:
            arg_3._model = None
        # now we can Func
        arg_4 = deepFunc(arg_0)
        # restore the references
        arg_0._model = arg_1
        for arg_3 in arg_0._metabolites:
            arg_3._model = arg_1
        for arg_3 in arg_0._genes:
            arg_3._model = arg_1
        return arg_4


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

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

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

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

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

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

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

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

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


def Func(arg_0, arg_1, arg_2):
  """Checks that `distributions` satisfies all assumptions."""
  arg_3 = []

  if not _is_iterable(arg_0) or not arg_0:
    raise ValueError('`distributions` must be a list of one or more '
                     'distributions.')

  if arg_1 is None:
    arg_4 = [
        dtype_util.base_dtype(arg_6.dtype)
        for arg_6 in arg_0
        if arg_6.dtype is not None
    ]
    if arg_4[1:] != arg_4[:-1]:
      raise TypeError('Distributions must have same dtype; found: {}.'.format(
          set(dtype_util.name(arg_5) for arg_5 in arg_4)))

  # Validate event_ndims.
  for arg_6 in arg_0:
    if tensorshape_util.rank(arg_6.event_shape) is not None:
      if tensorshape_util.rank(arg_6.event_shape) != 1:
        raise ValueError('`Distribution` must be vector variate, '
                         'found event nimds: {}.'.format(
                             tensorshape_util.rank(arg_6.event_shape)))
    elif arg_2:
      arg_3.append(
          assert_util.assert_equal(
              1, tf.size(input=arg_6.event_shape_tensor()),
              message='`Distribution` must be vector variate.'))

  arg_7 = [arg_6.batch_shape for arg_6 in arg_0]
  if all(tensorshape_util.is_fully_defined(arg_8) for arg_8 in arg_7):
    if arg_7[1:] != arg_7[:-1]:
      raise ValueError('Distributions must have the same `batch_shape`; '
                       'found: {}.'.format(arg_7))
  elif arg_2:
    arg_7 = [
        tensorshape_util.as_list(arg_6.batch_shape)  # pylint: disable=g-complex-comprehension
        if tensorshape_util.is_fully_defined(arg_6.batch_shape) else
        arg_6.batch_shape_tensor() for arg_6 in arg_0
    ]
    arg_3.extend(
        assert_util.assert_equal(  # pylint: disable=g-complex-comprehension
            arg_9, arg_10,
            message='Distribution `batch_shape`s must be identical.')
        for arg_9, arg_10 in zip(arg_7[1:], arg_7[:-1]))

  return arg_3

Checks that distributions satisfies all assumptions .


def Func ( arg_0 , arg_1 ) : arg_0 . hook = SlackWebhookHook ( arg_0 . http_conn_id , arg_0 . webhook_token , arg_0 . message , arg_0 . attachments , arg_0 . channel , arg_0 . username , arg_0 . icon_emoji , arg_0 . link_names , arg_0 . proxy ) arg_0 . hook . Func ( )

def Func(arg_0, arg_1):
        """
        Call the SlackWebhookHook to post the provided Slack message
        """
        arg_0.hook = SlackWebhookHook(
            arg_0.http_conn_id,
            arg_0.webhook_token,
            arg_0.message,
            arg_0.attachments,
            arg_0.channel,
            arg_0.username,
            arg_0.icon_emoji,
            arg_0.link_names,
            arg_0.proxy
        )
        arg_0.hook.Func()


def Func ( arg_0 ) : if isinstance ( arg_0 , str ) : return hash ( arg_0 ) elif isinstance ( arg_0 , dict ) : return hash ( yaml . dump ( arg_0 ) )

def Func(arg_0):
    """Return hash of x."""
    if isinstance(arg_0, str):
        return hash(arg_0)
    elif isinstance(arg_0, dict):
        return hash(yaml.dump(arg_0))


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Draw a circle in an RGB color, with center x0, y0 and radius r.
        """
        md.draw_circle(arg_0.set, arg_1, arg_2, arg_3, arg_4)

Draw a circle in an RGB color with center x0 y0 and radius r .


def Func(arg_0, arg_1, arg_2=None):
    '''share will use the client to get a shareable link for an image of choice.
       the functions returns a url of choice to send to a recipient.
    '''

    arg_3 = parse_image_name(remove_uri(arg_1))

    # Dropbox path is the path in storage with a slash
    arg_4 = '/%s' % arg_3['storage']

    # First ensure that exists
    if arg_0.exists(arg_4) is True:

        # Create new shared link
        try:
            Func = arg_0.dbx.sharing_create_shared_link_with_settings(arg_4)

        # Already exists!
        except ApiError as err:
            Func = arg_0.dbx.sharing_create_shared_link(arg_4)

        bot.info(Func.url)
    return Func.url

share will use the client to get a shareable link for an image of choice . the functions returns a url of choice to send to a recipient .


def Func ( arg_0 , arg_1 ) : arg_1 [ 'command' ] = arg_0 . command return arg_0 . adapter . send_request ( arg_1 )

def Func(arg_0, arg_1):
    # type: (dict) -> dict
    """
    Sends the request object to the adapter and returns the response.

    The command name will be automatically injected into the request
    before it is sent (note: this will modify the request object).
    """
    arg_1['command'] = arg_0.command
    return arg_0.adapter.send_request(arg_1)

Sends the request object to the adapter and returns the response .


def
Func
(
)
:
arg_0
=
"usage: nvd3.py [options]"
arg_1
=
OptionParser
(
arg_0
=
arg_0
,
version
=
(
"python-nvd3 - Charts generator with "
"nvd3.js and d3.js"
)
)
arg_1
.
add_option
(
"-q"
,
"--quiet"
,
action
=
"store_false"
,
dest
=
"verbose"
,
default
=
True
,
help
=
"don't print messages to stdout"
)
(
arg_2
,
arg_3
)
=
arg_1
.
parse_args
(
)

def Func():
    """
    Parse options and process commands
    """
    # Parse arguments
    arg_0 = "usage: nvd3.py [options]"
    arg_1 = OptionParser(arg_0=arg_0,
                          version=("python-nvd3 - Charts generator with "
                                   "nvd3.js and d3.js"))
    arg_1.add_option("-q", "--quiet",
                      action="store_false", dest="verbose", default=True,
                      help="don't print messages to stdout")

    (arg_2, arg_3) = arg_1.parse_args()


def Func ( arg_0 , arg_1 ) : return type ( arg_0 ) ( tf . TensorShape ( arg_0 ) . Func ( arg_1 ) )

def Func(arg_0, arg_1):  # pylint: disable=redefined-outer-name
  """Returns a shape based on `x` with at least the given `rank`.

  For more details, see `help(tf.TensorShape.Func)`.

  Args:
    x: object representing a shape; convertible to `tf.TensorShape`.
    rank: An `int` representing the minimum rank of `x` or else an assertion is
      raised.

  Returns:
    shape: a shape having `type(x)` but guaranteed to have at least the given
      rank (or else an assertion was raised).

  Raises:
    ValueError: If `x` does not represent a shape with at least the given
      `rank`.
  """
  return type(arg_0)(tf.TensorShape(arg_0).Func(arg_1))

Returns a shape based on `x` with at least the given `rank`.

  For more details, see `help(tf.TensorShape.with_rank_at_least)`.

  Args:
    x: object representing a shape; convertible to `tf.TensorShape`.
    rank: An `int` representing the minimum rank of `x` or else an assertion is
      raised.

  Returns:
    shape: a shape having `type(x)` but guaranteed to have at least the given
      rank (or else an assertion was raised).

  Raises:
    ValueError: If `x` does not represent a shape with at least the given
      `rank`.

Returns a shape based on x with at least the given rank .


def Func ( arg_0 ) : try : os . makedirs ( arg_0 . _state_dir ) except OSError as err : if err . errno != errno . EEXIST : raise

def Func(arg_0):
        '''Make sure the state directory exists'''
        try:
            os.makedirs(arg_0._state_dir)
        except OSError as err:
            if err.errno != errno.EEXIST:
                raise


def Func(arg_0, arg_1, arg_2, arg_3):
    """Update experiment group.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon group -g 2 Func --description="new description for this group"
    ```

    \b
    ```bash
    $ polyaxon Func --tags="foo, bar"
    ```
    """
    arg_4, arg_5, arg_6 = get_project_group_or_local(arg_0.obj.get('project'),
                                                            arg_0.obj.get('group'))
    arg_7 = {}

    if arg_1:
        arg_7['name'] = arg_1

    if arg_2:
        arg_7['description'] = arg_2

    arg_3 = validate_tags(arg_3)
    if arg_3:
        arg_7['tags'] = arg_3

    if not arg_7:
        Printer.print_warning('No argument was provided to Func the experiment group.')
        sys.exit(0)

    try:
        arg_8 = PolyaxonClient().experiment_group.Func_experiment_group(
            arg_4, arg_5, arg_6, arg_7)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func experiment group `{}`.'.format(arg_6))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("Experiment group Funcd.")
    get_group_details(arg_8)

Update experiment group.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon group -g 2 update --description="new description for this group"
    ```

    \b
    ```bash
    $ polyaxon update --tags="foo, bar"
    ```


def Func ( ) : import imp from django . conf import settings for arg_0 in settings . INSTALLED_APPS : try : arg_1 = __import__ ( arg_0 , { } , { } , [ arg_0 . split ( '.' ) [ - 1 ] ] ) . __path__ except AttributeError : continue try : imp . find_module ( 'oembed_providers' , arg_1 ) except ImportError : continue __import__ ( "%s.oembed_providers" % arg_0 )

def Func():
    """
    Automatically build the provider index.
    """
    import imp
    from django.conf import settings

    for arg_0 in settings.INSTALLED_APPS:
        try:
            arg_1 = __import__(arg_0, {}, {}, [arg_0.split('.')[-1]]).__path__
        except AttributeError:
            continue

        try:
            imp.find_module('oembed_providers', arg_1)
        except ImportError:
            continue

        __import__("%s.oembed_providers" % arg_0)

Automatically build the provider index .


return cls(num_perm=num_perm, seed=seed, hashvalues=hashvalues,
                permutations=permutations)

def Func(arg_0, *arg_1):
        '''Create a MinHash which is the Func of the MinHash objects passed as arguments.

        Args:
            *mhs: The MinHash objects to be united. The argument list length is variable,
                but must be at least 2.

        Returns:
            datasketch.MinHash: A new Func MinHash.
        '''
        if len(arg_1) < 2:
            raise ValueError("Cannot Func less than 2 MinHash")
        arg_2 = len(arg_1[0])
        arg_3 = arg_1[0].seed
        if any((arg_3 != arg_4.seed or arg_2 != len(arg_4)) for arg_4 in arg_1):
            raise ValueError("The Funcing MinHash must have the\
                    same seed and number of permutation functions")
        arg_5 = np.minimum.reduce([arg_4.hashvalues for arg_4 in arg_1])
        arg_6 = arg_1[0].permutations
        return arg_0(arg_2=arg_2, arg_3=arg_3, arg_5=arg_5,
                arg_6=arg_6)

Create a MinHash which is the union of the MinHash objects passed as arguments.

        Args:
            *mhs: The MinHash objects to be united. The argument list length is variable,
                but must be at least 2.

        Returns:
            datasketch.MinHash: A new union MinHash.

Create a MinHash which is the union of the MinHash objects passed as arguments .


def Func ( arg_0 = None , arg_1 = True ) : while True : arg_2 = _Func ( ) if arg_0 and len ( '' . join ( arg_2 ) ) > arg_0 : continue if arg_1 and arg_2 [ 0 ] [ - 1 ] == arg_2 [ 1 ] [ 0 ] : continue return arg_2

def Func(arg_0=None, arg_1=True):
    """
    Return an ordered 2-tuple containing a species and a describer.
    The letter-count of the pair is guarantee to not exceed `maxlen` if
    it is given. If `prevent_stutter` is True, the last letter of the
    first item of the pair will be different from the first letter of
    the second item.
    """
    while True:
        arg_2 = _Func()
        if arg_0 and len(''.join(arg_2)) > arg_0:
            continue
        if arg_1 and arg_2[0][-1] == arg_2[1][0]:
            continue
        return arg_2

Return an ordered 2 - tuple containing a species and a describer . The letter - count of the pair is guarantee to not exceed maxlen if it is given . If prevent_stutter is True the last letter of the first item of the pair will be different from the first letter of the second item .


def Func ( ) : arg_0 = { } for arg_1 in os . listdir ( JSON_PATH ) : if arg_1 not in NO_SCHEMA : arg_0 [ arg_1 ] = Schema ( arg_1 ) return arg_0

def Func():
    """Return a dict of schema names mapping to a Schema.

    The schema is of type schul_cloud_resources_api_v1.schema.Schema
    """
    arg_0 = {}
    for arg_1 in os.listdir(JSON_PATH):
        if arg_1 not in NO_SCHEMA:
            arg_0[arg_1] = Schema(arg_1)
    return arg_0

Return a dict of schema names mapping to a Schema .


def
Func
(
arg_0
,
arg_1
)
:
if
not
hasattr
(
arg_1
,
'__iter__'
)
:
raise
OEmbedException
(
'Autodiscovered response not iterable'
)
arg_2
=
[
]
for
arg_3
in
arg_1
:
if
'endpoint'
not
in
arg_3
or
'matches'
not
in
arg_3
:
continue
arg_4
=
arg_3
.
get
(
'type'
)
if
arg_4
not
in
RESOURCE_TYPES
:
continue
arg_5
,
arg_6
=
StoredProvider
.
objects
.
get_or_create
(
wildcard_regex
=
arg_3
[
'matches'
]
)
if
arg_6
:
arg_5
.
endpoint_url
=
relative_to_full
(
arg_3
[
'endpoint'
]
,
arg_3
[
'matches'
]
)
arg_5
.
resource_type
=
arg_4
arg_5
.
save
(
)
arg_2
.
append
(
arg_5
.
pk
)
return
StoredProvider
.
objects
.
filter
(
pk__in
=
arg_2
)

def Func(arg_0, arg_1):
        """
        Iterate over the returned json and try to sort out any new providers
        """
        if not hasattr(arg_1, '__iter__'):
            raise OEmbedException('Autodiscovered response not iterable')

        arg_2 = []

        for arg_3 in arg_1:
            if 'endpoint' not in arg_3 or \
               'matches' not in arg_3:
                continue

            arg_4 = arg_3.get('type')
            if arg_4 not in RESOURCE_TYPES:
                continue

            arg_5, arg_6 = StoredProvider.objects.get_or_create(
                wildcard_regex=arg_3['matches']
            )

            if arg_6:
                arg_5.endpoint_url = relative_to_full(
                    arg_3['endpoint'],
                    arg_3['matches']
                )
                arg_5.resource_type = arg_4
                arg_5.save()

            arg_2.append(arg_5.pk)

        return StoredProvider.objects.filter(pk__in=arg_2)


def Func(arg_0, arg_1):
    """2-tuple of slices for selection of two populations.
    """
    arg_2 = []
    arg_3 = 0
    for arg_4 in arg_1:
        arg_2.append(slice(arg_3, arg_3 + arg_4))
        arg_3 += arg_4
    return arg_2

2 - tuple of slices for selection of two populations .


def Func(arg_0):
    """Receiver for request-created signal to send email notification."""
    arg_1 = EmailConfirmationSerializer().create_token(
        arg_0.id, dict(email=arg_0.sender_email)
    )
    arg_2, arg_3 = get_record(arg_0.recid)

    _send_notification(
        arg_0.sender_email,
        _("Access request verification"),
        "zenodo_accessrequests/emails/validate_email.tpl",
        arg_0=arg_0,
        arg_3=arg_3,
        arg_2=arg_2,
        days=timedelta(
            seconds=current_app.config["ACCESSREQUESTS_CONFIRMLINK_EXPIRES_IN"]
        ).days,
        confirm_link=url_for(
            "invenio_records_ui.recid_access_request_email_confirm",
            pid_value=arg_0.recid,
            arg_1=arg_1,
            _external=True,
        )
    )

Receiver for request - created signal to send email notification .


def Func(arg_0, arg_1, arg_2):
    """Deletes locks for each IP address that is no longer null-routed."""
    arg_3 = _find_addresses_to_be_unlocked(
        arg_0, arg_1, arg_2)
    LOG.info("Deleting %s lock holders on IPAddress with ids: %s",
             len(arg_3),
             [arg_4.id for arg_4 in arg_3])

    for arg_5 in arg_3:
        arg_6 = None
        try:
            arg_6 = db_api.lock_holder_find(
                arg_0, lock_id=arg_5.lock_id, name=LOCK_NAME,
                scope=db_api.ONE)
            if arg_6:
                db_api.lock_holder_delete(arg_0, arg_5, arg_6)
        except Exception:
            LOG.exception("Failed to delete lock holder %s", arg_6)
            continue
    arg_0.session.flush()

Deletes locks for each IP address that is no longer null - routed .


def Func ( arg_0 ) : try : arg_1 , arg_2 = arg_4 [ arg_0 ] del arg_4 [ arg_0 ] except KeyError : arg_1 , arg_2 = - 1 , [ ] arg_3 = os . stat ( arg_0 ) . st_mtime if arg_3 != arg_1 : arg_2 = os . Func ( arg_0 ) arg_2 . sort ( ) arg_4 [ arg_0 ] = arg_3 , arg_2 return arg_2

def Func(arg_0):
    """List directory contents, using cache."""
    try:
        arg_1, arg_2 = arg_4[arg_0]
        del arg_4[arg_0]
    except KeyError:
        arg_1, arg_2 = -1, []
    arg_3 = os.stat(arg_0).st_mtime
    if arg_3 != arg_1:
        arg_2 = os.Func(arg_0)
        arg_2.sort()
    arg_4[arg_0] = arg_3, arg_2
    return arg_2


def Func(arg_0):
        """return pairs of package indices and results of finished tasks

        This method does not wait for tasks to finish.

        Returns
        -------
        list
            A list of pairs of package indices and results

        """

        arg_0.runid_to_return.extend(arg_0.dispatcher.Func())
        arg_1 = arg_0._collect_all_finished_pkgidx_result_pairs()
        return arg_1


def Func ( arg_0 , arg_1 : arg_2 = 0 ) -> Iterable [ Tuple [ arg_2 , 'Instruction' ] ] : for arg_3 , arg_4 in arg_0 . children : yield from arg_4 . Func ( arg_1 + arg_3 )

def Func(arg_0, arg_1: arg_2 = 0) -> Iterable[Tuple[arg_2, 'Instruction']]:
        """Iterable for flattening Schedule tree.

        Args:
            time: Shifted time due to parent

        Yields:
            Tuple[int, ScheduleComponent]: Tuple containing time `ScheduleComponent` starts
                at and the flattened `ScheduleComponent`.
        """
        for arg_3, arg_4 in arg_0.children:
            yield from arg_4.Func(arg_1 + arg_3)


def Func ( arg_0 , arg_1 ) : return bool ( lib . lsl_Func ( arg_0 . e , str . encode ( arg_1 ) ) )

def Func(arg_0, arg_1):
        """Set the element's name. Returns False if the node is empty."""
        return bool(lib.lsl_Func(arg_0.e, str.encode(arg_1)))

Set the element s name . Returns False if the node is empty .


(self, metric, start, end, tags={}, aggregator="sum",
        downsample=None, ms_resolution=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4={}, arg_5="sum",
        arg_6=None, arg_7=True):
        """Fetch time series data from OpenTSDB

        Parameters:
            metric:
                A string representing a valid OpenTSDB metric.

            tags:
                A dict mapping tag names to tag values. Tag names and values are
                always strings.

                { 'user_id': '44' }

            start:
                A datetime.datetime-like object representing the start of the
                range to query over.

            end:
                A datetime.datetime-like object representing the end of the
                range to query over.

            aggregator:
                The function for merging multiple time series together. For
                example, if the "user_id" tag is not specified, this aggregator
                function is used to combine all heart rate time series into one
                time series. (Yes, this isn't very useful.)

                For queries that return only one time series, this parameter is
                not relevant.

                Valid values: "sum", "min", "max", "avg", "dev"

                See: http://opentsdb.net/docs/build/html/user_guide/query/aggregators.html

            downsampling:
                A relative time interval to "downsample". This isn't true
                downsampling; rather, if you specify a downsampling of "5m"
                (five minutes), OpenTSDB will split data into five minute
                intervals, and return one data point in the middle of each
                interval whose value is the average of all data points within
                that interval.

                Valid relative time values are strings of the following format:

                    "<amount><time_unit>"

                Valid time units: "ms", "s", "m", "h", "d", "w", "n", "y"

                Date and time format: http://opentsdb.net/docs/build/html/user_guide/query/dates.html

            ms_resolution:
                Whether or not to output data point timestamps in milliseconds
                or seconds. If this flag is false and there are multiple
                data points within a second, those data points will be down
                sampled using the query's aggregation function.

        Returns:
            A dict mapping timestamps to data points
        """
        arg_8 = "{aggregator}:{downsample}{metric}{{{tags}}}".format(
            arg_5=arg_5,
            arg_6=arg_6 + "-avg:" if arg_6 else "",
            arg_1=arg_1,
            arg_4=','.join("%s=%s" % (k, v) for k, v in arg_4.items())
        )
        arg_9 = {
            'ms': arg_7,
            'start': '{0:.3f}'.format(arg_2.timestamp()),
            'end': '{0:.3f}'.format(arg_3.timestamp()),
            'm': arg_8
        }
        arg_10 = arg_0.__request("/query", arg_9)

        if arg_10.status_code == 200:
            try:
                return arg_10.json()[0]['dps']
            except IndexError:
                # empty data set
                return {}

        raise QueryError(arg_10.json())


return int(w * float(scale) + 0.5), int(h * float(scale) + 0.5)

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 return int ( arg_2 * float ( arg_1 ) + 0.5 ) , int ( arg_3 * float ( arg_1 ) + 0.5 )

def Func(arg_0, arg_1):
    """Rescale a size by a ratio.

    Args:
        size (tuple): w, h.
        scale (float): Scaling factor.

    Returns:
        tuple[int]: scaled size.
    """
    arg_2, arg_3 = arg_0
    return int(arg_2 * float(arg_1) + 0.5), int(arg_3 * float(arg_1) + 0.5)


def Func ( arg_0 ) : arg_1 = logging . getLogger ( arg_0 . __class__ . __name__ ) arg_1 . setLevel ( arg_0 . log_level ) if sys . executable . endswith ( 'pythonw.exe' ) : arg_2 = logging . StreamHandler ( open ( os . devnull , 'w' ) ) else : arg_2 = logging . StreamHandler ( ) arg_3 = logging . Formatter ( arg_0 . log_format ) arg_2 . setFormatter ( arg_3 ) arg_1 . addHandler ( arg_2 ) return arg_1

def Func(arg_0):
        """Start logging for this application.

        The default is to log to stdout using a StreaHandler. The log level
        starts at loggin.WARN, but this can be adjusted by setting the
        ``log_level`` attribute.
        """
        arg_1 = logging.getLogger(arg_0.__class__.__name__)
        arg_1.setLevel(arg_0.log_level)
        if sys.executable.endswith('pythonw.exe'):
            # this should really go to a file, but file-logging is only
            # hooked up in parallel applications
            arg_2 = logging.StreamHandler(open(os.devnull, 'w'))
        else:
            arg_2 = logging.StreamHandler()
        arg_3 = logging.Formatter(arg_0.log_format)
        arg_2.setFormatter(arg_3)
        arg_1.addHandler(arg_2)
        return arg_1


def Func(arg_0, arg_1=2.0, arg_2=8):
    """Build a binary quadratic model with minimal energy levels at solutions to the specified constraint satisfaction
    problem.

    Args:
        csp (:obj:`.ConstraintSatisfactionProblem`):
            Constraint satisfaction problem.

        min_classical_gap (float, optional, default=2.0):
            Minimum energy gap from ground. Each constraint violated by the solution increases
            the energy level of the binary quadratic model by at least this much relative
            to ground energy.

        max_graph_size (int, optional, default=8):
            Maximum number of variables in the binary quadratic model that can be used to
            represent a single constraint.

    Returns:
        :class:`~dimod.BinaryQuadraticModel`

    Notes:
        For a `min_classical_gap` > 2 or constraints with more than two variables, requires
        access to factories from the penaltymodel_ ecosystem to construct the binary quadratic
        model.

    .. _penaltymodel: https://github.com/dwavesystems/penaltymodel

    Examples:
        This example creates a binary-valued constraint satisfaction problem
        with two constraints, :math:`a = b` and :math:`b \\ne c`, and builds
        a binary quadratic model with a minimum energy level of -2 such that
        each constraint violation by a solution adds the default minimum energy gap.

        >>> import dwavebinarycsp
        >>> import operator
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(operator.eq, ['a', 'b'])  # a == b
        >>> csp.add_constraint(operator.ne, ['b', 'c'])  # b != c
        >>> bqm = dwavebinarycsp.Func(csp)
        >>> bqm.energy({'a': 0, 'b': 0, 'c': 1})  # satisfies csp
        -2.0
        >>> bqm.energy({'a': 0, 'b': 0, 'c': 0})  # violates one constraint
        0.0
        >>> bqm.energy({'a': 1, 'b': 0, 'c': 0}) # violates two constraints
        2.0

        This example creates a binary-valued constraint satisfaction problem
        with two constraints, :math:`a = b` and :math:`b \\ne c`, and builds
        a binary quadratic model with a minimum energy gap of 4.
        Note that in this case the conversion to binary quadratic model adds two
        ancillary variables that must be minimized over when solving.

        >>> import dwavebinarycsp
        >>> import operator
        >>> import itertools
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(operator.eq, ['a', 'b'])  # a == b
        >>> csp.add_constraint(operator.ne, ['b', 'c'])  # b != c
        >>> bqm = dwavebinarycsp.Func(csp, min_classical_gap=4.0)
        >>> list(bqm)   # # doctest: +SKIP
        ['a', 'aux1', 'aux0', 'b', 'c']
        >>> min([bqm.energy({'a': 0, 'b': 0, 'c': 1, 'aux0': aux0, 'aux1': aux1}) for
        ... aux0, aux1 in list(itertools.product([0, 1], repeat=2))])  # satisfies csp
        -6.0
        >>> min([bqm.energy({'a': 0, 'b': 0, 'c': 0, 'aux0': aux0, 'aux1': aux1}) for
        ... aux0, aux1 in list(itertools.product([0, 1], repeat=2))])  # violates one constraint
        -2.0
        >>> min([bqm.energy({'a': 1, 'b': 0, 'c': 0, 'aux0': aux0, 'aux1': aux1}) for
        ... aux0, aux1 in list(itertools.product([0, 1], repeat=2))])  # violates two constraints
        2.0

        This example finds for the previous example the minimum graph size.

        >>> import dwavebinarycsp
        >>> import operator
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(operator.eq, ['a', 'b'])  # a == b
        >>> csp.add_constraint(operator.ne, ['b', 'c'])  # b != c
        >>> for n in range(8, 1, -1):
        ...     try:
        ...         bqm = dwavebinarycsp.Func(csp, min_classical_gap=4.0, max_graph_size=n)
        ...     except dwavebinarycsp.exceptions.ImpossibleBQM:
        ...         print(n+1)
        ...
        3

    """

    # ensure we have penaltymodel factory available
    try:
        dwavebinarycsp.assert_penaltymodel_factory_available()
    except AssertionError as e:
        raise RuntimeError(e)

    def aux_factory():
        for arg_3 in count():
            yield 'aux{}'.format(arg_3)

    arg_4 = aux_factory()

    arg_5 = dimod.BinaryQuadraticModel.empty(arg_0.vartype)

    # developer note: we could cache them and relabel, for now though let's do the simple thing
    # penalty_models = {}
    for arg_6 in arg_0.constraints:
        arg_7 = arg_6.configurations

        if len(arg_6.variables) > arg_2:
            arg_8 = ("The given csp contains a constraint {const} with {num_var} variables. "
                   "This cannot be mapped to a graph with {max_graph_size} nodes. "
                   "Consider checking whether your constraint is irreducible."
                   "").format(arg_6=arg_6, num_var=len(arg_6.variables), arg_2=arg_2)
            raise ImpossibleBQM(arg_8)

        arg_9 = None

        if len(arg_6) == 0:
            # empty constraint
            continue

        if arg_1 <= 2.0:
            if len(arg_6) == 1 and arg_2 >= 1:
                arg_5.update(_bqm_from_1sat(arg_6))
                continue
            elif len(arg_6) == 2 and arg_2 >= 2:
                arg_5.update(_bqm_from_2sat(arg_6))
                continue

        # developer note: we could cache them and relabel, for now though let's do the simple thing
        # if configurations in penalty_models:
        #     raise NotImplementedError

        for arg_10 in iter_complete_graphs(arg_6.variables, arg_2 + 1, arg_4):

            # construct a specification
            spec = pm.Specification(
                graph=arg_10,
                decision_variables=arg_6.variables,
                feasible_configurations=arg_7,
                arg_1=arg_1,
                vartype=arg_0.vartype
            )

            # try to use the penaltymodel ecosystem
            try:
                arg_9 = pm.get_penalty_model(spec)
            except pm.ImpossiblePenaltyModel:
                # hopefully adding more variables will make it possible
                continue

            if arg_9.classical_gap >= arg_1:
                break

        # developer note: we could cache them and relabel, for now though let's do the simple thing
        # penalty_models[configurations] = pmodel

        else:
            arg_8 = ("No penalty model can be build for constraint {}".format(arg_6))
            raise ImpossibleBQM(arg_8)

        arg_5.update(arg_9.model)

    return arg_5

Build a binary quadratic model with minimal energy levels at solutions to the specified constraint satisfaction
    problem.

    Args:
        csp (:obj:`.ConstraintSatisfactionProblem`):
            Constraint satisfaction problem.

        min_classical_gap (float, optional, default=2.0):
            Minimum energy gap from ground. Each constraint violated by the solution increases
            the energy level of the binary quadratic model by at least this much relative
            to ground energy.

        max_graph_size (int, optional, default=8):
            Maximum number of variables in the binary quadratic model that can be used to
            represent a single constraint.

    Returns:
        :class:`~dimod.BinaryQuadraticModel`

    Notes:
        For a `min_classical_gap` > 2 or constraints with more than two variables, requires
        access to factories from the penaltymodel_ ecosystem to construct the binary quadratic
        model.

    .. _penaltymodel: https://github.com/dwavesystems/penaltymodel

    Examples:
        This example creates a binary-valued constraint satisfaction problem
        with two constraints, :math:`a = b` and :math:`b \\ne c`, and builds
        a binary quadratic model with a minimum energy level of -2 such that
        each constraint violation by a solution adds the default minimum energy gap.

        >>> import dwavebinarycsp
        >>> import operator
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(operator.eq, ['a', 'b'])  # a == b
        >>> csp.add_constraint(operator.ne, ['b', 'c'])  # b != c
        >>> bqm = dwavebinarycsp.stitch(csp)
        >>> bqm.energy({'a': 0, 'b': 0, 'c': 1})  # satisfies csp
        -2.0
        >>> bqm.energy({'a': 0, 'b': 0, 'c': 0})  # violates one constraint
        0.0
        >>> bqm.energy({'a': 1, 'b': 0, 'c': 0}) # violates two constraints
        2.0

        This example creates a binary-valued constraint satisfaction problem
        with two constraints, :math:`a = b` and :math:`b \\ne c`, and builds
        a binary quadratic model with a minimum energy gap of 4.
        Note that in this case the conversion to binary quadratic model adds two
        ancillary variables that must be minimized over when solving.

        >>> import dwavebinarycsp
        >>> import operator
        >>> import itertools
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(operator.eq, ['a', 'b'])  # a == b
        >>> csp.add_constraint(operator.ne, ['b', 'c'])  # b != c
        >>> bqm = dwavebinarycsp.stitch(csp, min_classical_gap=4.0)
        >>> list(bqm)   # # doctest: +SKIP
        ['a', 'aux1', 'aux0', 'b', 'c']
        >>> min([bqm.energy({'a': 0, 'b': 0, 'c': 1, 'aux0': aux0, 'aux1': aux1}) for
        ... aux0, aux1 in list(itertools.product([0, 1], repeat=2))])  # satisfies csp
        -6.0
        >>> min([bqm.energy({'a': 0, 'b': 0, 'c': 0, 'aux0': aux0, 'aux1': aux1}) for
        ... aux0, aux1 in list(itertools.product([0, 1], repeat=2))])  # violates one constraint
        -2.0
        >>> min([bqm.energy({'a': 1, 'b': 0, 'c': 0, 'aux0': aux0, 'aux1': aux1}) for
        ... aux0, aux1 in list(itertools.product([0, 1], repeat=2))])  # violates two constraints
        2.0

        This example finds for the previous example the minimum graph size.

        >>> import dwavebinarycsp
        >>> import operator
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(operator.eq, ['a', 'b'])  # a == b
        >>> csp.add_constraint(operator.ne, ['b', 'c'])  # b != c
        >>> for n in range(8, 1, -1):
        ...     try:
        ...         bqm = dwavebinarycsp.stitch(csp, min_classical_gap=4.0, max_graph_size=n)
        ...     except dwavebinarycsp.exceptions.ImpossibleBQM:
        ...         print(n+1)
        ...
        3

Build a binary quadratic model with minimal energy levels at solutions to the specified constraint satisfaction problem .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
conn
.
pubsub
(
)
arg_1
.
subscribe
(
arg_0
.
pubsub_channel
)
logger
.
debug
(
"Listening on channel %s"
,
arg_0
.
pubsub_channel
)
for
arg_2
in
arg_1
.
Func
(
)
:
logger
.
debug
(
"New message received of type %s"
,
str
(
arg_2
[
'type'
]
)
)
if
arg_2
[
'type'
]
!=
'message'
:
logger
.
debug
(
"Ignoring job message"
)
continue
arg_3
=
pickle
.
loads
(
arg_2
[
'data'
]
)
arg_4
=
arg_3
[
'job_id'
]
arg_5
=
rq
.
job
.
Job
.
fetch
(
arg_4
,
connection
=
arg_0
.
conn
)
if
arg_3
[
'status'
]
==
'finished'
:
logging
.
debug
(
"Job #%s completed"
,
arg_4
)
arg_6
=
arg_0
.
result_handler
elif
arg_3
[
'status'
]
==
'failed'
:
logging
.
debug
(
"Job #%s failed"
,
arg_4
)
arg_6
=
arg_0
.
result_handler_err
else
:
continue
if
arg_6
:
logging
.
debug
(
"Calling handler for job #%s"
,
arg_4
)
arg_6
(
arg_5
)

def Func(arg_0):
        """Listen for completed jobs and reschedule successful ones."""

        arg_1 = arg_0.conn.pubsub()
        arg_1.subscribe(arg_0.pubsub_channel)

        logger.debug("Listening on channel %s", arg_0.pubsub_channel)

        for arg_2 in arg_1.Func():
            logger.debug("New message received of type %s", str(arg_2['type']))

            if arg_2['type'] != 'message':
                logger.debug("Ignoring job message")
                continue

            arg_3 = pickle.loads(arg_2['data'])
            arg_4 = arg_3['job_id']

            arg_5 = rq.job.Job.fetch(arg_4, connection=arg_0.conn)

            if arg_3['status'] == 'finished':
                logging.debug("Job #%s completed", arg_4)
                arg_6 = arg_0.result_handler
            elif arg_3['status'] == 'failed':
                logging.debug("Job #%s failed", arg_4)
                arg_6 = arg_0.result_handler_err
            else:
                continue

            if arg_6:
                logging.debug("Calling handler for job #%s", arg_4)
                arg_6(arg_5)

Listen for completed jobs and reschedule successful ones .


(self, service_name, production, source_deployment)

return self._perform_post(self._get_hosted_service_path(service_name),
                                  _XmlSerializer.swap_deployment_to_xml(
                                      production, source_deployment),
                                  as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Initiates a virtual IP swap between the staging and production
        deployment environments for a service. If the service is currently
        running in the staging environment, it will be swapped to the
        production environment. If it is running in the production
        environment, it will be swapped to staging.

        service_name:
            Name of the hosted service.
        production:
            The name of the production deployment.
        source_deployment:
            The name of the source deployment.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('production', arg_2)
        _validate_not_none('source_deployment', arg_3)
        return arg_0._perform_post(arg_0._get_hosted_service_path(arg_1),
                                  _XmlSerializer.Func_to_xml(
                                      arg_2, arg_3),
                                  as_async=True)

Initiates a virtual IP swap between the staging and production deployment environments for a service . If the service is currently running in the staging environment it will be swapped to the production environment . If it is running in the production environment it will be swapped to staging .


return tf.cast(
      tf.reduce_min(input_tensor=eigenvalues, axis=-1) >= 0, dtype=x.dtype)

def Func ( arg_0 ) : arg_1 , arg_2 = tf . linalg . eigh ( arg_0 ) return tf . cast ( tf . reduce_min ( input_tensor = arg_1 , axis = - 1 ) >= 0 , dtype = arg_0 . dtype )

def Func(arg_0):
  """Computes whether each square matrix in the input is positive semi-definite.

  Args:
    x: A floating-point `Tensor` of shape `[B1, ..., Bn, M, M]`.

  Returns:
    mask: A floating-point `Tensor` of shape `[B1, ... Bn]`.  Each
      scalar is 1 if the corresponding matrix was PSD, otherwise 0.
  """
  # Allegedly
  # https://scicomp.stackexchange.com/questions/12979/testing-if-a-matrix-is-positive-semi-definite
  # it is more efficient to test for positive semi-definiteness by
  # trying to compute the Cholesky decomposition -- the matrix is PSD
  # if you succeed and not PSD if you fail.  However, TensorFlow's
  # Cholesky raises an exception if _any_ of the input matrices are
  # not PSD, from which I don't know how to extract _which ones_, so I
  # proceed by explicitly computing all the eigenvalues and checking
  # whether they are all positive or not.
  #
  # Also, as was discussed in the answer, it is somewhat dangerous to
  # treat SPD-ness as binary in floating-point arithmetic. Cholesky
  # factorization can complete and 'look' like everything is fine
  # (e.g., O(1) entries and a diagonal of all ones) but the matrix can
  # have an exponential condition number.
  arg_1, arg_2 = tf.linalg.eigh(arg_0)
  return tf.cast(
      tf.reduce_min(input_tensor=arg_1, axis=-1) >= 0, dtype=arg_0.dtype)

Computes whether each square matrix in the input is positive semi - definite .


def Func ( arg_0 , arg_1 = 1 , ) : arg_2 = arg_0 . read_first_header ( ) arg_3 = { } arg_4 = arg_2 . get ( "TELESCOP" , "unknown" ) if arg_4 in ( 'GBT' , 'GREENBANK' ) : arg_3 [ "telescope_id" ] = 6 elif arg_4 in ( 'PKS' , 'PARKES' ) : arg_3 [ "telescop_id" ] = 7 else : arg_3 [ "telescop_id" ] = 0 arg_3 [ "source_name" ] = arg_2 . get ( "SRC_NAME" , "unknown" ) arg_3 [ "az_start" ] = arg_2 . get ( "AZ" , 0 ) arg_3 [ "za_start" ] = arg_2 . get ( "ZA" , 0 ) arg_3 [ "src_raj" ] = Angle ( str ( arg_2 . get ( "RA" , 0.0 ) ) + "hr" ) arg_3 [ "src_dej" ] = Angle ( str ( arg_2 . get ( "DEC" , 0.0 ) ) + "deg" ) arg_3 [ "rawdatafile" ] = arg_0 . filename arg_3 [ "machine_id" ] = 20 arg_3 [ "data_type" ] = 1 arg_3 [ "barycentric" ] = 0 arg_3 [ "pulsarcentric" ] = 0 arg_3 [ "nbits" ] = 32 arg_3 [ "tstart" ] = 0.0 arg_3 [ "tsamp" ] = 1.0 arg_3 [ "fch1" ] = 0.0 arg_3 [ "foff" ] = 187.5 / arg_1 arg_3 [ "nchans" ] = arg_1 arg_3 [ "nifs" ] = 1 arg_3 [ "nbeams" ] = 1 return arg_3

def Func(arg_0, arg_1=1, ):
        """ Generate a blimpy header dictionary """
        arg_2 = arg_0.read_first_header()
        arg_3 = {}

        arg_4 = arg_2.get("TELESCOP", "unknown")
        if arg_4 in ('GBT', 'GREENBANK'):
            arg_3["telescope_id"] = 6
        elif arg_4 in ('PKS', 'PARKES'):
            arg_3["telescop_id"] = 7
        else:
            arg_3["telescop_id"] = 0

        # Using .get() method allows us to fill in default values if not present
        arg_3["source_name"] = arg_2.get("SRC_NAME", "unknown")
        arg_3["az_start"] = arg_2.get("AZ", 0)
        arg_3["za_start"] = arg_2.get("ZA", 0)

        arg_3["src_raj"] = Angle(str(arg_2.get("RA", 0.0)) + "hr")
        arg_3["src_dej"] = Angle(str(arg_2.get("DEC", 0.0)) + "deg")
        arg_3["rawdatafile"] = arg_0.filename

        # hardcoded
        arg_3["machine_id"] = 20
        arg_3["data_type"] = 1  # blio datatype
        arg_3["barycentric"] = 0
        arg_3["pulsarcentric"] = 0
        arg_3["nbits"] = 32

        # TODO - compute these values. Need to figure out the correct calcs
        arg_3["tstart"] = 0.0
        arg_3["tsamp"] = 1.0
        arg_3["fch1"] = 0.0
        arg_3["foff"] = 187.5 / arg_1

        # Need to be updated based on output specs
        arg_3["nchans"] = arg_1
        arg_3["nifs"] = 1
        arg_3["nbeams"] = 1

        return arg_3


(self, name, values, ttl=60, weight=None, region=None,
                           set_identifier=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 , arg_4 = None , arg_5 = None , arg_6 = None ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( CNAMEResourceRecordSet , ** arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=60, arg_4=None, arg_5=None,
                           arg_6=None):
        """
        Creates a CNAME record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :keyword int weight: *For weighted record sets only*. Among resource record
            sets that have the same combination of DNS name and type, a value
            that determines what portion of traffic for the current resource
            record set is routed to the associated location. Ranges from 0-255.
        :keyword str region: *For latency-based record sets*. The Amazon EC2 region
            where the resource that is specified in this resource record set
            resides.
        :keyword str set_identifier: *For weighted and latency resource record
            sets only*. An identifier that differentiates among multiple
            resource record sets that have the same combination of DNS name
            and type. 1-128 chars.
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created CNAMEResourceRecordSet instance.
        """

        arg_0._halt_if_already_deleted()

        # Grab the params/kwargs here for brevity's sake.
        arg_2 = locals()
        del arg_2['self']

        return arg_0._add_record(CNAMEResourceRecordSet, **arg_2)

Creates a CNAME record attached to this hosted zone .


(self, entity_type, entity_id, metadata_keys)

return self._authenticated_request \
            .to_endpoint('{}/{}/metadata/'.format(entity_type, entity_id)) \
            .with_json_body({'keys': metadata_keys}) \
            .return_body() \
            .delete()

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
not
is_valid_uuid
(
arg_2
)
:
raise
StorageArgumentException
(
'Invalid UUID for entity_id: {0}'
.
format
(
arg_2
)
)
if
not
isinstance
(
arg_3
,
list
)
:
raise
StorageArgumentException
(
'The metadata was not provided as a '
'dictionary'
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'{}/{}/metadata/'
.
format
(
arg_1
,
arg_2
)
)
.
with_json_body
(
{
'keys'
:
arg_3
}
)
.
return_body
(
)
.
delete
(
)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''Delete the selected metadata entries of an entity.

        Only deletes selected metadata keys, for a complete wipe, use set_metadata.

        Args:
            entity_type (str): Type of the entity. Admitted values: ['project',
                'folder', 'file'].
            entity_id (srt): The UUID of the entity to be modified.
            metadata_keys (lst): A list of metada keys to be deleted.

        Returns:
            A dictionary of the updated object metadata::

                {
                    u'bar': u'200',
                    u'foo': u'100'
                }

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_2):
            raise StorageArgumentException(
                'Invalid UUID for entity_id: {0}'.format(arg_2))
        if not isinstance(arg_3, list):
            raise StorageArgumentException('The metadata was not provided as a '
                                           'dictionary')

        return arg_0._authenticated_request \
            .to_endpoint('{}/{}/metadata/'.format(arg_1, arg_2)) \
            .with_json_body({'keys': arg_3}) \
            .return_body() \
            .delete()

Delete the selected metadata entries of an entity .


return [op.join(path, str(item)) for item in filelist]

def Func ( arg_0 , arg_1 ) : return [ op . join ( arg_0 , str ( arg_2 ) ) for arg_2 in arg_1 ]

def Func(arg_0, arg_1):
    """Joins path to each line in filelist

    Parameters
    ----------
    path: str

    filelist: list of str

    Returns
    -------
    list of filepaths
    """
    return [op.join(arg_0, str(arg_2)) for arg_2 in arg_1]


def Func ( arg_0 ) : arg_1 = os . path . realpath ( os . path . join ( arg_0 . temp_path , GDOCS_TRANS_CSV ) ) arg_2 = os . path . realpath ( os . path . join ( arg_0 . temp_path , GDOCS_META_CSV ) ) arg_0 . _Func_csv_from_gdocs ( arg_1 , arg_2 ) try : csv_to_po ( arg_1 , arg_2 , arg_0 . locale_root , arg_0 . po_files_path , header = arg_0 . header ) except IOError as e : raise PODocsError ( e ) arg_0 . _clear_temp ( )

def Func(arg_0):
        """
        Download csv files from GDocs and convert them into po files structure.
        """
        arg_1 = os.path.realpath(
            os.path.join(arg_0.temp_path, GDOCS_TRANS_CSV))
        arg_2 = os.path.realpath(
            os.path.join(arg_0.temp_path, GDOCS_META_CSV))

        arg_0._Func_csv_from_gdocs(arg_1, arg_2)

        try:
            csv_to_po(arg_1, arg_2,
                      arg_0.locale_root, arg_0.po_files_path, header=arg_0.header)
        except IOError as e:
            raise PODocsError(e)

        arg_0._clear_temp()

Download csv files from GDocs and convert them into po files structure .


def Func(arg_0, arg_1=True):
        """Print the contents of this table."""
        # if h2o.can_use_pandas():
        #  import pandas
        #  pandas.options.display.max_rows = 20
        #  print pandas.DataFrame(self._cell_values,columns=self._col_header)
        #  return
        if arg_1 and arg_0._table_header:
            print(arg_0._table_header + ":", end=' ')
            if arg_0._table_description: print(arg_0._table_description)
        print()
        arg_2 = copy.deepcopy(arg_0._cell_values)
        arg_3 = 0
        if _is_list_of_lists(arg_2): arg_3 = len(
            arg_2)  # only set if we truly have multiple rows... not just one long row :)
        if arg_3 > 20:  # create a truncated view of the table, first/last 5 rows
            arg_4 = []
            arg_4 += [arg_5 for arg_5 in arg_2[:5]]
            arg_4.append(["---"] * len(arg_2[0]))
            arg_4 += [arg_5 for arg_5 in arg_2[(arg_3 - 5):]]
            arg_2 = arg_4

        H2ODisplay(arg_2, arg_0._col_header, numalign="left", stralign="left")
        if arg_3 > 20 and can_use_pandas(): print('\nSee the whole table with table.as_data_frame()')


def Func ( arg_0 , arg_1 ) : arg_2 = ProcessStats ( arg_1 ) arg_3 = [ ] for arg_4 in arg_2 . get_cpu_memory_stat ( ) : try : arg_3 . append ( arg_4 . get_cpu_percent ( ) ) except psutil . AccessDenied : pass return arg_3

def Func(arg_0, arg_1):
        """
        get CPU stat for the give process name

        @param process_name: Process name, ex: firefox-bin.
        @type process_name: string

        @return: cpu stat list on success, else empty list
                If same process name, running multiple instance,
                get the stat of all the process CPU usage
        @rtype: list
        """
        # Create an instance of process stat
        arg_2 = ProcessStats(arg_1)
        arg_3 = []
        for arg_4 in arg_2.get_cpu_memory_stat():
            try:
                arg_3.append(arg_4.get_cpu_percent())
            except psutil.AccessDenied:
                pass
        return arg_3


def Func(arg_0):
    """
    Pretty print the connections in the temporal memory.

    TODO: Use PrettyTable.

    @return (string) Pretty-printed text
    """
    arg_1 = ""

    arg_1 += ("Segments: (format => "
             "(#) [(source cell=permanence ...),       ...]\n")
    arg_1 += "------------------------------------\n"

    arg_2 = range(arg_0.numberOfColumns())

    for arg_3 in arg_2:
      arg_4 = arg_0.cellsForColumn(arg_3)

      for arg_5 in arg_4:
        arg_6 = dict()

        for arg_7 in arg_0.connections.segmentsForCell(arg_5):
          arg_8 = []

          for arg_9 in arg_0.connections.synapsesForSegment(arg_7):
            arg_10 = arg_0.connections.dataForSynapse(arg_9)
            arg_8.append(
                (arg_10.presynapticCell, arg_10.permanence))

          arg_8.sort()
          arg_11 = ["{0:3}={1:.2f}".format(sourceCell, permanence) for
                               sourceCell, permanence in arg_8]
          arg_6[arg_7] = "({0})".format(" ".join(arg_11))

        arg_1 += ("Column {0:3} / Cell {1:3}:\t({2}) {3}\n".format(
          arg_3, arg_5,
          len(arg_6.values()),
          "[{0}]".format(",       ".join(arg_6.values()))))

      if arg_3 < len(arg_2) - 1:  # not last
        arg_1 += "\n"

    arg_1 += "------------------------------------\n"

    return arg_1

Pretty print the connections in the temporal memory .


def Func ( arg_0 , arg_1 ) : arg_0 . decodeTable = arg_1 arg_2 = set ( arg_1 ) arg_3 = 0 arg_4 = { } while arg_2 : arg_5 = ( 1 << arg_3 ) - 1 arg_6 = defaultdict ( list ) for arg_7 in arg_2 : arg_6 [ arg_7 & arg_5 ] . append ( arg_7 ) for arg_7 , arg_8 in arg_6 . items ( ) : if len ( arg_8 ) == 1 : arg_4 [ arg_0 . decodeTable [ arg_7 ] ] = arg_3 arg_2 . remove ( arg_7 ) arg_3 += 1 arg_0 . lengthTable = arg_4 arg_0 . minLength = min ( arg_4 . values ( ) ) arg_0 . maxLength = max ( arg_4 . values ( ) ) arg_0 . switchToPrefix ( )

def Func(arg_0, arg_1):
        """Store decodeTable,
        and compute lengthTable, minLength, maxLength from encodings.
        """
        arg_0.decodeTable = arg_1
        #set of symbols with unknown length
        arg_2 = set(arg_1)
        #bit size under investigation
        arg_3 = 0
        arg_4 = {}
        while arg_2:
            arg_5 = (1<<arg_3)-1
            #split the encodings that we didn't find yet using b bits
            arg_6 = defaultdict(list)
            for arg_7 in arg_2: arg_6[arg_7&arg_5].append(arg_7)
            #unique encodings have a length of maskLength bits
            #set length, and remove from todo list
            for arg_7,arg_8 in arg_6.items():
                if len(arg_8)==1:
                    arg_4[arg_0.decodeTable[arg_7]] = arg_3
                    arg_2.remove(arg_7)
            #now investigate with longer mask
            arg_3 +=1
        #save result
        arg_0.lengthTable = arg_4
        arg_0.minLength = min(arg_4.values())
        arg_0.maxLength = max(arg_4.values())
        arg_0.switchToPrefix()

Store decodeTable and compute lengthTable minLength maxLength from encodings .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
log
.
debug
(
'Get client secret of %r'
,
arg_1
)
if
not
arg_2
.
client
:
arg_2
.
client
=
arg_0
.
_clientgetter
(
arg_1
=
arg_1
)
if
arg_2
.
client
:
return
arg_2
.
client
.
client_secret
return

def Func(arg_0, arg_1, arg_2):
        """Get client secret.

        The client object must has ``client_secret`` attribute.
        """
        log.debug('Get client secret of %r', arg_1)
        if not arg_2.client:
            arg_2.client = arg_0._clientgetter(arg_1=arg_1)
        if arg_2.client:
            return arg_2.client.client_secret
        return None


def Func ( arg_0 , arg_1 ) : if sys . version_info >= ( 3 , 5 ) : arg_2 = [ d . name for d in os . scandir ( arg_1 ) if d . is_dir ( ) ] else : arg_2 = [ d for d in os . listdir ( arg_1 ) if os . path . isdir ( os . path . join ( arg_1 , d ) ) ] arg_2 . sort ( ) arg_3 = { arg_2 [ i ] : i for i in range ( len ( arg_2 ) ) } return arg_2 , arg_3

def Func(arg_0, arg_1):
        """
        Finds the class folders in a dataset.

        Args:
            dir (string): Root directory path.

        Returns:
            tuple: (classes, class_to_idx) where classes are relative to (dir), and class_to_idx is a dictionary.

        Ensures:
            No class is a subdirectory of another.
        """
        if sys.version_info >= (3, 5):
            # Faster and available in Python 3.5 and above
            arg_2 = [d.name for d in os.scandir(arg_1) if d.is_dir()]
        else:
            arg_2 = [d for d in os.listdir(arg_1) if os.path.isdir(os.path.join(arg_1, d))]
        arg_2.sort()
        arg_3 = {arg_2[i]: i for i in range(len(arg_2))}
        return arg_2, arg_3


def
Func
(
arg_0
,
arg_1
=
)
:
arg_1
=
arg_1
or
arg_0
.
CONFIG_PATH
if
not
os
.
path
.
exists
(
arg_1
)
:
arg_2
=
'Config file not found: {0!r}'
.
format
(
arg_1
)
raise
ConfigFileError
(
arg_2
)
arg_3
=
read_config
(
arg_1
)
return
arg_0
(
arg_3
)

def Func(arg_0, arg_1=None):
        """Read a config file and instantiate the RCParser.

        Create new :class:`configparser.ConfigParser` for the given **path**
        and instantiate the :class:`RCParser` with the ConfigParser as
        :attr:`config` attribute.

        If the **path** doesn't exist, raise :exc:`ConfigFileError`.
        Otherwise return a new :class:`RCParser` instance.

        :param path:
            Optional path to the config file to parse.
            If not given, use ``'~/.pypirc'``.

        """
        arg_1 = arg_1 or arg_0.CONFIG_PATH
        if not os.path.exists(arg_1):
            arg_2 = 'Config file not found: {0!r}'.format(arg_1)
            raise ConfigFileError(arg_2)
        arg_3 = read_config(arg_1)
        return arg_0(arg_3)

Read a config file and instantiate the RCParser .


def Func ( arg_0 , arg_1 ) : with open ( arg_1 , 'w' ) as fd : yaml . dump ( arg_0 , fd , default_flow_style = False ) return True return False

def Func(arg_0, arg_1):
    """Write data into a .yml file
    """
    with open(arg_1, 'w') as fd:
        yaml.dump(arg_0, fd, default_flow_style=False)
        return True

    return False


def Func(arg_0, arg_1, arg_2):
    """
    Task to send learner data to each linked integrated channel.

    Arguments:
        username (str): The username of the User to be used for making API requests for learner data.
        channel_code (str): Capitalized identifier for the integrated channel
        channel_pk (str): Primary key for identifying integrated channel

    """
    arg_3 = time.time()
    arg_4 = User.objects.get(arg_0=arg_0)
    arg_5 = INTEGRATED_CHANNEL_CHOICES[arg_1].objects.get(pk=arg_2)
    LOGGER.info('Processing learners for integrated channel using configuration: [%s]', arg_5)

    # Note: learner data transmission code paths don't raise any uncaught exception, so we don't need a broad
    # try-except block here.
    arg_5.Func(arg_4)

    arg_6 = time.time() - arg_3
    LOGGER.info(
        'Learner data transmission task for integrated channel configuration [%s] took [%s] seconds',
        arg_5,
        arg_6
    )

Task to send learner data to each linked integrated channel .