def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
)
:
if
not
callable
(
arg_1
)
:
print
'Object is not callable.'
return
arg_3
=
''
if
inspect
.
isclass
(
arg_1
)
:
arg_3
=
arg_0
.
__head
(
'Class constructor information:\n'
)
arg_1
=
arg_1
.
__init__
elif
(
not
py3compat
.
PY3
)
and
type
(
arg_1
)
is
types
.
InstanceType
:
arg_1
=
arg_1
.
__call__
arg_4
=
arg_0
.
_getdef
(
arg_1
,
arg_2
)
if
arg_4
is
:
arg_0
.
noinfo
(
'definition header'
,
arg_2
)
else
:
print
>>
io
.
stdout
,
arg_3
,
arg_0
.
format
(
arg_4
)
,

def Func(arg_0, arg_1, arg_2=''):
        """Print the definition header for any callable object.

        If the object is a class, print the constructor information."""

        if not callable(arg_1):
            print 'Object is not callable.'
            return

        arg_3 = ''

        if inspect.isclass(arg_1):
            arg_3 = arg_0.__head('Class constructor information:\n')
            arg_1 = arg_1.__init__
        elif (not py3compat.PY3) and type(arg_1) is types.InstanceType:
            arg_1 = arg_1.__call__

        arg_4 = arg_0._getdef(arg_1,arg_2)
        if arg_4 is None:
            arg_0.noinfo('definition header',arg_2)
        else:
            print >>io.stdout, arg_3,arg_0.format(arg_4),

Print the definition header for any callable object .


def Func(arg_0):
        """
        Send a notification about a duplicate signup.
        """
        email_utils.send_email(
            from_email=settings.DEFAULT_FROM_EMAIL,
            recipient_list=[arg_0.email],
            subject=_("Registration Attempt"),
            template_name="rest_email_auth/emails/duplicate-email",
        )

        logger.info("Sent duplicate email notification to: %s", arg_0.email)

Send a notification about a duplicate signup .


def Func ( arg_0 , arg_1 ) : arg_2 = np . sqrt ( np . var ( arg_0 ) ) arg_3 = np . average ( arg_0 ) arg_4 = mlab . normpdf ( arg_1 , arg_3 , arg_2 ) arg_4 *= len ( arg_0 ) * HIST_RESOLUTION return arg_4

def Func(arg_0,arg_1):
    """
    given some data and a list of X posistions, return the normal
    distribution curve as a Y point at each of those Xs.
    """
    arg_2=np.sqrt(np.var(arg_0))
    arg_3=np.average(arg_0)
    arg_4=mlab.normpdf(arg_1,arg_3,arg_2)
    arg_4*=len(arg_0)*HIST_RESOLUTION
    return arg_4

given some data and a list of X posistions return the normal distribution curve as a Y point at each of those Xs .


(path=None, destination_frame=None, parse=True, header=0, sep=None, col_names=None, col_types=None,
                na_strings=None, pattern=None, skipped_columns=None, custom_non_data_line_markers = None)

def Func(arg_0=None, arg_1=None, arg_2=True, arg_3=0, arg_4=None, arg_5=None, arg_6=None,
                arg_7=None, arg_8=None, arg_9=None, arg_10 = None):
    """
    Import a dataset that is already on the cluster.

    The path to the data must be a valid path for each node in the H2O cluster. If some node in the H2O cluster
    cannot see the file, then an exception will be thrown by the H2O cluster. Does a parallel/distributed
    multi-threaded pull of the data. The main difference between this method and :func:`upload_file` is that
    the latter works with local files, whereas this method imports remote files (i.e. files local to the server).
    If you running H2O server on your own maching, then both methods behave the same.

    :param path: path(s) specifying the location of the data to import or a path to a directory of files to import
    :param destination_frame: The unique hex key assigned to the imported file. If none is given, a key will be
        automatically generated.
    :param parse: If True, the file should be parsed after import. If False, then a list is returned containing the file path.
    :param header: -1 means the first line is data, 0 means guess, 1 means first line is header.
    :param sep: The field separator character. Values on each line of the file are separated by
        this character. If not provided, the parser will automatically detect the separator.
    :param col_names: A list of column names for the file.
    :param col_types: A list of types or a dictionary of column names to types to specify whether columns
        should be forced to a certain type upon import parsing. If a list, the types for elements that are
        one will be guessed. The possible types a column may have are:

        - "unknown" - this will force the column to be parsed as all NA
        - "uuid"    - the values in the column must be true UUID or will be parsed as NA
        - "string"  - force the column to be parsed as a string
        - "numeric" - force the column to be parsed as numeric. H2O will handle the compression of the numeric
          data in the optimal manner.
        - "enum"    - force the column to be parsed as a categorical column.
        - "time"    - force the column to be parsed as a time column. H2O will attempt to parse the following
          list of date time formats: (date) "yyyy-MM-dd", "yyyy MM dd", "dd-MMM-yy", "dd MMM yy", (time)
          "HH:mm:ss", "HH:mm:ss:SSS", "HH:mm:ss:SSSnnnnnn", "HH.mm.ss" "HH.mm.ss.SSS", "HH.mm.ss.SSSnnnnnn".
          Times can also contain "AM" or "PM".
    :param na_strings: A list of strings, or a list of lists of strings (one list per column), or a dictionary
        of column names to strings which are to be interpreted as missing values.
    :param pattern: Character string containing a regular expression to match file(s) in the folder if `path` is a
        directory.
    :param skipped_columns: an integer list of column indices to skip and not parsed into the final frame from the import file.
    :param custom_non_data_line_markers: If a line in imported file starts with any character in given string it will NOT be imported. Empty string means all lines are imported, None means that default behaviour for given format will be used

    :returns: a new :class:`H2OFrame` instance.

    :examples:
        >>> # Single file import
        >>> iris = Func("h2o-3/smalldata/iris.csv")
        >>> # Return all files in the folder iris/ matching the regex r"iris_.*\.csv"
        >>> iris_pattern = h2o.Func(path = "h2o-3/smalldata/iris",
        ...                                pattern = "iris_.*\.csv")
    """
    arg_11 = U(None, "unknown", "uuid", "string", "float", "real", "double", "int", "numeric",
                "categorical", "factor", "enum", "time")
    arg_12 = U(str, [str])
    assert_is_type(arg_0, str, [str])
    assert_is_type(arg_8, str, None)
    assert_is_type(arg_1, str, None)
    assert_is_type(arg_2, bool)
    assert_is_type(arg_3, -1, 0, 1)
    assert_is_type(arg_4, None, I(str, lambda s: len(s) == 1))
    assert_is_type(arg_5, [str], None)
    assert_is_type(arg_6, [arg_11], {str: arg_11}, None)
    assert_is_type(arg_7, [arg_12], {str: arg_12}, None)
    assert isinstance(arg_9, (type(None), list)), "The skipped_columns should be an list of column names!"
    check_frame_id(arg_1)
    arg_13 = arg_0 if isinstance(arg_0, list) else [arg_0]
    if any(os.path.split(arg_14)[0] == "~" for arg_14 in arg_13):
        raise H2OValueError("Paths relative to a current user (~) are not valid in the server environment. "
                            "Please use absolute paths if possible.")
    if not arg_2:
        return lazy_import(arg_0, arg_8)
    else:
        return H2OFrame()._import_parse(arg_0, arg_8, arg_1, arg_3, arg_4, arg_5, arg_6, arg_7,
                                        arg_9, arg_10)

Import a dataset that is already on the cluster.

    The path to the data must be a valid path for each node in the H2O cluster. If some node in the H2O cluster
    cannot see the file, then an exception will be thrown by the H2O cluster. Does a parallel/distributed
    multi-threaded pull of the data. The main difference between this method and :func:`upload_file` is that
    the latter works with local files, whereas this method imports remote files (i.e. files local to the server).
    If you running H2O server on your own maching, then both methods behave the same.

    :param path: path(s) specifying the location of the data to import or a path to a directory of files to import
    :param destination_frame: The unique hex key assigned to the imported file. If none is given, a key will be
        automatically generated.
    :param parse: If True, the file should be parsed after import. If False, then a list is returned containing the file path.
    :param header: -1 means the first line is data, 0 means guess, 1 means first line is header.
    :param sep: The field separator character. Values on each line of the file are separated by
        this character. If not provided, the parser will automatically detect the separator.
    :param col_names: A list of column names for the file.
    :param col_types: A list of types or a dictionary of column names to types to specify whether columns
        should be forced to a certain type upon import parsing. If a list, the types for elements that are
        one will be guessed. The possible types a column may have are:

        - "unknown" - this will force the column to be parsed as all NA
        - "uuid"    - the values in the column must be true UUID or will be parsed as NA
        - "string"  - force the column to be parsed as a string
        - "numeric" - force the column to be parsed as numeric. H2O will handle the compression of the numeric
          data in the optimal manner.
        - "enum"    - force the column to be parsed as a categorical column.
        - "time"    - force the column to be parsed as a time column. H2O will attempt to parse the following
          list of date time formats: (date) "yyyy-MM-dd", "yyyy MM dd", "dd-MMM-yy", "dd MMM yy", (time)
          "HH:mm:ss", "HH:mm:ss:SSS", "HH:mm:ss:SSSnnnnnn", "HH.mm.ss" "HH.mm.ss.SSS", "HH.mm.ss.SSSnnnnnn".
          Times can also contain "AM" or "PM".
    :param na_strings: A list of strings, or a list of lists of strings (one list per column), or a dictionary
        of column names to strings which are to be interpreted as missing values.
    :param pattern: Character string containing a regular expression to match file(s) in the folder if `path` is a
        directory.
    :param skipped_columns: an integer list of column indices to skip and not parsed into the final frame from the import file.
    :param custom_non_data_line_markers: If a line in imported file starts with any character in given string it will NOT be imported. Empty string means all lines are imported, None means that default behaviour for given format will be used

    :returns: a new :class:`H2OFrame` instance.

    :examples:
        >>> # Single file import
        >>> iris = import_file("h2o-3/smalldata/iris.csv")
        >>> # Return all files in the folder iris/ matching the regex r"iris_.*\.csv"
        >>> iris_pattern = h2o.import_file(path = "h2o-3/smalldata/iris",
        ...                                pattern = "iris_.*\.csv")

Import a dataset that is already on the cluster .


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
arg_3
=
arg_0
.
session
.
post
(
arg_1
=
arg_1
,
headers
=
arg_0
.
_get_api_headers
(
)
,
**
arg_2
)
if
not
arg_3
.
ok
:
raise
ServerException
(
'{0}: {1}'
.
format
(
arg_3
.
status_code
,
arg_3
.
text
or
arg_3
.
reason
)
)
return
arg_3
.
json
(
)

def Func(arg_0, arg_1, **arg_2):
        """
        Convenience method for posting
        """
        arg_3 = arg_0.session.post(
            arg_1=arg_1,
            headers=arg_0._get_api_headers(),
            **arg_2
        )
        if not arg_3.ok:
            raise ServerException(
                '{0}: {1}'.format(
                    arg_3.status_code,
                    arg_3.text or arg_3.reason
                ))
        return arg_3.json()


def Func(arg_0=10, arg_1=500, arg_2=50):
  """
  Generate a non overlapping coincidence matrix. This is used to generate random
  inputs to the temporal learner and to compare the predicted output against.

  It generates a matrix of nCoinc rows, each row has length 'length' and has
  a total of 'activity' bits on.

  Parameters:
  -----------------------------------------------
  nCoinc:        the number of rows to generate
  length:        the length of each row
  activity:      the number of ones to put into each row.

  """
  assert arg_0*arg_2<=arg_1, "can't generate non-overlapping coincidences"
  arg_3 = SM32(0, arg_1)
  arg_4 = numpy.zeros(arg_1, dtype='int32')

  for arg_5 in xrange(arg_0):
      arg_4[:] = 0
      arg_4[arg_5*arg_2:(arg_5+1)*arg_2] = 1
      arg_3.addRow(arg_4)

  return arg_3

Generate a non overlapping coincidence matrix . This is used to generate random inputs to the temporal learner and to compare the predicted output against .


def Func ( arg_0 ) : arg_1 = default_links_factory ( arg_0 ) def _url ( arg_2 , ** arg_3 ) : arg_4 = '.{0}_{1}' . format ( current_records_rest . default_endpoint_prefixes [ arg_0 . pid_type ] , arg_2 , ) return url_for ( arg_4 , pid_value = arg_0 . pid_value , _external = True , ** arg_3 ) arg_1 [ 'files' ] = _url ( 'files' ) arg_5 = current_app . config . get ( 'DEPOSIT_UI_ENDPOINT' ) if arg_5 is not None : arg_1 [ 'html' ] = arg_5 . format ( host = request . host , scheme = request . scheme , pid_value = arg_0 . pid_value , ) arg_6 = Deposit if 'pid_value' in request . view_args : arg_6 = request . view_args [ 'pid_value' ] . data [ 1 ] . __class__ for arg_7 in extract_actions_from_class ( arg_6 ) : arg_1 [ arg_7 ] = _url ( 'actions' , arg_7 = arg_7 ) return arg_1

def Func(arg_0):
    """Factory for record links generation.

    The dictionary is formed as:

    .. code-block:: python

        {
            'files': '/url/to/files',
            'publish': '/url/to/publish',
            'edit': '/url/to/edit',
            'discard': '/url/to/discard',
            ...
        }

    :param pid: The record PID object.
    :returns: A dictionary that contains all the links.
    """
    arg_1 = default_links_factory(arg_0)

    def _url(arg_2, **arg_3):
        """URL builder."""
        arg_4 = '.{0}_{1}'.format(
            current_records_rest.default_endpoint_prefixes[arg_0.pid_type],
            arg_2,
        )
        return url_for(arg_4, pid_value=arg_0.pid_value, _external=True,
                       **arg_3)

    arg_1['files'] = _url('files')

    arg_5 = current_app.config.get('DEPOSIT_UI_ENDPOINT')
    if arg_5 is not None:
        arg_1['html'] = arg_5.format(
            host=request.host,
            scheme=request.scheme,
            pid_value=arg_0.pid_value,
        )

    arg_6 = Deposit
    if 'pid_value' in request.view_args:
        arg_6 = request.view_args['pid_value'].data[1].__class__

    for arg_7 in extract_actions_from_class(arg_6):
        arg_1[arg_7] = _url('actions', arg_7=arg_7)
    return arg_1


def Func(arg_0, **arg_1):
        """
        Get the list of TV shows that are currently on the air. This query
        looks for any TV show that has an episode with an air date in the
        next 7 days.

        Args:
            page: (optional) Minimum 1, maximum 1000.
            language: (optional) ISO 639 code.

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

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the list of TV shows that are currently on the air . This query looks for any TV show that has an episode with an air date in the next 7 days .


Try to maintain parity with what is extracted by extract since strip
        will most likely be used in conjunction with extract

return re.sub(URL_RE, match_handler, text)

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : if OEMBED_DEFAULT_PARSE_HTML : arg_4 = arg_0 . extract_oembeds_html ( arg_1 , * arg_2 , ** arg_3 ) else : arg_4 = arg_0 . extract_oembeds ( arg_1 , * arg_2 , ** arg_3 ) arg_5 = [ r [ 'original_url' ] for r in arg_4 ] arg_6 = lambda m : m . group ( ) not in arg_5 and m . group ( ) or '' return re . sub ( URL_RE , arg_6 , arg_1 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Try to maintain parity with what is extracted by extract since Func
        will most likely be used in conjunction with extract
        """
        if OEMBED_DEFAULT_PARSE_HTML:
            arg_4 = arg_0.extract_oembeds_html(arg_1, *arg_2, **arg_3)
        else:
            arg_4 = arg_0.extract_oembeds(arg_1, *arg_2, **arg_3)

        arg_5 = [r['original_url'] for r in arg_4]
        arg_6 = lambda m: m.group() not in arg_5 and m.group() or ''

        return re.sub(URL_RE, arg_6, arg_1)


(self, documents, database_name=None, collection_name=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
)
:
if
arg_1
is
:
raise
AirflowBadRequest
(
"You cannot insert empty documents"
)
arg_4
=
[
]
for
arg_5
in
arg_1
:
arg_4
.
append
(
arg_0
.
get_conn
(
)
.
CreateItem
(
get_collection_link
(
arg_0
.
__get_database_name
(
arg_2
)
,
arg_0
.
__get_collection_name
(
arg_3
)
)
,
arg_5
)
)
return
arg_4

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Insert a list of new documents into an existing collection in the CosmosDB database.
        """
        if arg_1 is None:
            raise AirflowBadRequest("You cannot insert empty documents")

        arg_4 = []
        for arg_5 in arg_1:
            arg_4.append(
                arg_0.get_conn().CreateItem(
                    get_collection_link(
                        arg_0.__get_database_name(arg_2),
                        arg_0.__get_collection_name(arg_3)),
                    arg_5))

        return arg_4

Insert a list of new documents into an existing collection in the CosmosDB database .


def Func(arg_0, arg_1):
    """Add the aggregation period to the input time t and return a datetime object

    Years and months are handled as aspecial case due to leap years
    and months with different number of dates. They can't be converted
    to a strict timedelta because a period of 3 months will have different
    durations actually. The solution is to just add the years and months
    fields directly to the current time.

    Other periods are converted to timedelta and just added to current time.
    """

    assert isinstance(arg_1, datetime.datetime)
    if arg_0._aggTimeDelta:
      return arg_1 + arg_0._aggTimeDelta
    else:
      arg_2 = arg_1.year + arg_0._aggYears + (arg_1.month - 1 + arg_0._aggMonths) / 12
      arg_3 = (arg_1.month - 1 + arg_0._aggMonths) % 12 + 1
      return arg_1.replace(arg_2=arg_2, arg_3=arg_3)


(app_name, operation, apps, schema_editor)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_2 . get_model ( arg_0 , arg_1 . model_name ) for arg_5 in arg_4 . objects . values_list ( 'pk' , flat = True ) : arg_4 . objects . filter ( pk = arg_5 ) . update ( ** { arg_1 . name : get_meteor_id ( arg_4 , arg_5 ) , } )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Set default value for AleaIdField."""
    arg_4 = arg_2.get_model(arg_0, arg_1.model_name)
    for arg_5 in arg_4.objects.values_list('pk', flat=True):
        arg_4.objects.filter(pk=arg_5).update(**{
            arg_1.name: get_meteor_id(arg_4, arg_5),
        })


(img, startpoints, endpoints, interpolation=Image.BICUBIC)

return img.transform(img.size, Image.PERSPECTIVE, coeffs, interpolation)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
arg_4
.
BICUBIC
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
arg_6
=
_get_Func_coeffs
(
arg_1
,
arg_2
)
return
arg_0
.
transform
(
arg_0
.
size
,
arg_4
.
PERSPECTIVE
,
arg_6
,
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3=arg_4.BICUBIC):
    """Perform Func transform of the given PIL Image.

    Args:
        img (PIL Image): Image to be transformed.
        coeffs (tuple) : 8-tuple (a, b, c, d, e, f, g, h) which contains the coefficients.
                            for a Func transform.
        interpolation: Default- Image.BICUBIC
    Returns:
        PIL Image:  Perspectively transformed Image.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    arg_6 = _get_Func_coeffs(arg_1, arg_2)
    return arg_0.transform(arg_0.size, arg_4.PERSPECTIVE, arg_6, arg_3)

Perform perspective transform of the given PIL Image.

    Args:
        img (PIL Image): Image to be transformed.
        coeffs (tuple) : 8-tuple (a, b, c, d, e, f, g, h) which contains the coefficients.
                            for a perspective transform.
        interpolation: Default- Image.BICUBIC
    Returns:
        PIL Image:  Perspectively transformed Image.

Perform perspective transform of the given PIL Image .


def Func(arg_0):
    """Shifts indicies as needed to account for one based indexing

    Positive indicies need to be reduced by one to match with zero based
    indexing.

    Zero is not a valid input, and as such will throw a value error.

    Arguments:
        index -     index to shift
    """
    arg_0 = int(arg_0)
    if arg_0 > 0:
        arg_0 -= 1
    elif arg_0 == 0:
        # Zero indicies should not be allowed by default.
        raise ValueError
    return arg_0


(s: str, ctx: compiler.CompilerContext, module: types.ModuleType, eof: Any)

def Func(arg_0: arg_1, arg_2: arg_3.CompilerContext, arg_5: arg_6.ModuleType, arg_8: arg_9):
    """Evaluate the forms in a string into a Python module AST node."""
    arg_10 = arg_8
    for arg_11 in reader.read_str(arg_0, resolver=runtime.resolve_alias, arg_8=arg_8):
        arg_10 = arg_3.compile_and_exec_form(arg_11, arg_2, arg_5)
    return arg_10

Evaluate the forms in a string into a Python module AST node .


def
Func
(
arg_0
,
arg_1
=
""
,
arg_2
=
False
)
:
logging
.
info
(
"  [*] geting layers with %s"
%
arg_1
)
arg_3
=
[
]
arg_4
=
0
for
arg_5
in
arg_0
.
all_layers
:
if
arg_1
in
arg_5
.
name
:
arg_3
.
append
(
arg_5
)
if
arg_2
:
logging
.
info
(
"  got {:3}: {:15}   {}"
.
format
(
arg_4
,
arg_5
.
name
,
str
(
arg_5
.
get_shape
(
)
)
)
)
arg_4
=
arg_4
+
1
return
arg_3

def Func(arg_0, arg_1="", arg_2=False):
    """Get a list of layers' output in a network by a given name scope.

    Parameters
    -----------
    net : :class:`Layer`
        The last layer of the network.
    name : str
        Get the layers' output that contain this name.
    verbose : boolean
        If True, print information of all the layers' output

    Returns
    --------
    list of Tensor
        A list of layers' output (TensorFlow tensor)

    Examples
    ---------
    >>> import tensorlayer as tl
    >>> layers = tl.layers.Func(net, "CNN", True)

    """
    logging.info("  [*] geting layers with %s" % arg_1)

    arg_3 = []
    arg_4 = 0

    for arg_5 in arg_0.all_layers:
        # logging.info(type(layer.name))
        if arg_1 in arg_5.name:
            arg_3.append(arg_5)

            if arg_2:
                logging.info("  got {:3}: {:15}   {}".format(arg_4, arg_5.name, str(arg_5.get_shape())))
                arg_4 = arg_4 + 1

    return arg_3

Get a list of layers' output in a network by a given name scope.

    Parameters
    -----------
    net : :class:`Layer`
        The last layer of the network.
    name : str
        Get the layers' output that contain this name.
    verbose : boolean
        If True, print information of all the layers' output

    Returns
    --------
    list of Tensor
        A list of layers' output (TensorFlow tensor)

    Examples
    ---------
    >>> import tensorlayer as tl
    >>> layers = tl.layers.get_layers_with_name(net, "CNN", True)

Get a list of layers output in a network by a given name scope .


return {
        k: build_cf(custom_fields[k], v)
        for k, v in fields.items()
        if k in custom_fields
    }

def Func ( arg_0 , arg_1 ) : def build_cf ( arg_2 , arg_3 ) : return { 'id' : arg_2 [ 'id' ] , 'name' : arg_2 [ 'name' ] , 'value' : arg_3 } return { arg_4 : build_cf ( arg_0 [ arg_4 ] , arg_3 ) for arg_4 , arg_3 in arg_1 . items ( ) if arg_4 in arg_0 }

def Func(arg_0, arg_1):
    """Add extra information for custom fields.

    :param custom_fields: set of custom fields with the extra information
    :param fields: fields of the issue where to add the extra information

    :returns: an set of items with the extra information mapped
    """
    def build_cf(arg_2, arg_3):
        return {'id': arg_2['id'], 'name': arg_2['name'], 'value': arg_3}

    return {
        arg_4: build_cf(arg_0[arg_4], arg_3)
        for arg_4, arg_3 in arg_1.items()
        if arg_4 in arg_0
    }

Add extra information for custom fields .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_down_location_set : arg_0 . package_down_location_set = True arg_1 . package . download_location = arg_2 return True else : raise CardinalityError ( 'Package::DownloadLocation' )

def Func(arg_0, arg_1, arg_2):
        """Sets the package download location, if not already set.
        location - A string
        Raises CardinalityError if already defined.
        Raises OrderError if no package previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_down_location_set:
            arg_0.package_down_location_set = True
            arg_1.package.download_location = arg_2
            return True
        else:
            raise CardinalityError('Package::DownloadLocation')

Sets the package download location if not already set . location - A string Raises CardinalityError if already defined . Raises OrderError if no package previously defined .


def Func(arg_0, arg_1):
    """
    Makes parsing arguments a function.
    """
    arg_2=""
    arg_3 = arg_0.host
    if arg_0.show_list:
        print(generate_host_string(arg_1, "Available hosts: "))
        exit()
    if arg_0.decrypt:
        for arg_4 in arg_0.files:
            print(decrypt_files(arg_4))
            exit()
    if arg_0.files:
        for arg_4 in arg_0.files:
            if arg_0.limit_size:
                if arg_0.host == arg_3 and arg_3 is not None:
                    if not check_max_filesize(arg_4, arg_1[arg_3][3]):
                        arg_3 = None
                for arg_5, arg_6 in enumerate(arg_1):
                    if not check_max_filesize(arg_4, arg_6[3]):
                        arg_1[arg_5] = None
                if not arg_1:
                    print('None of the clones is able to support so big file.')
            if arg_0.no_cloudflare:
                if arg_0.host == arg_3 and arg_3 is not None and not arg_1[arg_3][4]:
                    print("This host uses Cloudflare, please choose different host.")
                    exit(1)
                else:
                    for arg_5, arg_6 in enumerate(arg_1):
                        if not arg_6[4]:
                            arg_1[arg_5] = None
            arg_1 = list(filter(None, arg_1))
            if arg_3 is None or arg_0.host != arg_3:
                arg_3 = random.randrange(0, len(arg_1))
            while True:
                try:
                    if arg_0.encrypt:
                        arg_2 = encrypt_files(arg_1[arg_3], arg_0.only_link, arg_4)
                    else:
                        arg_2 = upload_files(open(arg_4, 'rb'), \
                              arg_1[arg_3], arg_0.only_link, arg_4)
                    if arg_0.only_link:
                        print(arg_2[0])
                    else:
                        print(arg_2)
                except IndexError:
                    #print('Selected server (' + clone_list[host_number][0] + ') is offline.')
                    #print('Trying other host.')
                    arg_3 = random.randrange(0, len(arg_1))
                    continue
                except IsADirectoryError:
                    print('limf does not support directory upload, if you want to upload ' \
                          'every file in directory use limf {}/*.'.format(arg_4.replace('/', '')))

                if arg_0.log:
                    with open(os.path.expanduser(arg_0.logfile), "a+") as logfile:
                        if arg_0.only_link:
                            logfile.write(arg_2[1])
                        else:
                            logfile.write(arg_2)
                        logfile.write("\n")
                break
    else:
        print("limf: try 'limf -h' for more information")


def Func(arg_0, arg_1, arg_2):
  """Broadcasts the event or distribution parameters."""
  if dtype_util.is_integer(arg_0.dtype):
    pass
  elif dtype_util.is_floating(arg_0.dtype):
    # When `validate_args=True` we've already ensured int/float casting
    # is closed.
    arg_0 = tf.cast(arg_0, dtype=tf.int32)
  else:
    raise TypeError("`value` should have integer `dtype` or "
                    "`self.dtype` ({})".format(arg_2))
  arg_3 = (
      tensorshape_util.rank(arg_1.shape) is not None and
      tensorshape_util.is_fully_defined(arg_1.shape[:-1]) and
      tensorshape_util.is_fully_defined(arg_0.shape))
  if not arg_3 or arg_1.shape[:-1] != arg_0.shape:
    arg_1 *= tf.ones_like(arg_0[..., tf.newaxis],
                           dtype=arg_1.dtype)
    arg_4 = tf.shape(input=arg_1)[:-1]
    arg_0 *= tf.ones(arg_4, dtype=arg_0.dtype)
    if tensorshape_util.rank(arg_1.shape) is not None:
      tensorshape_util.set_shape(arg_0, arg_1.shape[:-1])

  return arg_0, arg_1

Broadcasts the event or distribution parameters .


(returns, positions, transactions, EOD_hour=23)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 23 ) : arg_4 = arg_2 . copy ( ) arg_4 . index . names = [ 'date' ] arg_4 [ 'value' ] = arg_4 . amount * arg_4 . price arg_4 = arg_4 . reset_index ( ) . pivot_table ( arg_5 = 'date' , values = 'value' , arg_13 = 'symbol' ) . replace ( np . nan , 0 ) arg_4 [ 'date' ] = arg_4 . index . date arg_4 = arg_4 . groupby ( 'date' ) . cumsum ( ) arg_4 [ 'exposure' ] = arg_4 . abs ( ) . sum ( axis = 1 ) arg_7 = ( arg_4 [ 'exposure' ] == arg_4 . groupby ( pd . TimeGrouper ( '24H' ) ) [ 'exposure' ] . transform ( max ) ) arg_4 = arg_4 [ arg_7 ] . drop ( 'exposure' , axis = 1 ) arg_4 [ 'cash' ] = - arg_4 . sum ( axis = 1 ) arg_8 = arg_1 . copy ( ) . shift ( 1 ) . fillna ( 0 ) arg_9 = arg_1 . iloc [ 0 ] . sum ( ) / ( 1 + arg_0 [ 0 ] ) arg_8 . cash [ 0 ] = arg_9 arg_4 . index = arg_4 . index . normalize ( ) arg_11 = arg_8 . add ( arg_4 , fill_value = 0 ) arg_11 . index . name = 'period_close' arg_11 . columns . name = 'sid' return arg_11

def Func(arg_0, arg_1, arg_2, arg_3=23):
    """
    Intraday strategies will often not hold positions at the day end.
    This attempts to find the point in the day that best represents
    the activity of the strategy on that day, and effectively resamples
    the end-of-day positions with the positions at this point of day.
    The point of day is found by detecting when our exposure in the
    market is at its maximum point. Note that this is an estimate.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in create_full_tear_sheet.
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in create_full_tear_sheet.
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in create_full_tear_sheet.

    Returns
    -------
    pd.DataFrame
        Daily net position values, resampled for intraday behavior.
    """

    # Construct DataFrame of transaction amounts
    arg_4 = arg_2.copy()
    arg_4.index.names = ['date']
    arg_4['value'] = arg_4.amount * arg_4.price
    arg_4 = arg_4.reset_index().pivot_table(
        arg_5='date', values='value',
        arg_13='symbol').replace(np.nan, 0)

    # Cumulate transaction amounts each day
    arg_4['date'] = arg_4.index.date
    arg_4 = arg_4.groupby('date').cumsum()

    # Calculate exposure, then take peak of exposure every day
    arg_4['exposure'] = arg_4.abs().sum(axis=1)
    arg_7 = (arg_4['exposure'] == arg_4.groupby(
        pd.TimeGrouper('24H'))['exposure'].transform(max))
    arg_4 = arg_4[arg_7].drop('exposure', axis=1)

    # Compute cash delta
    arg_4['cash'] = -arg_4.sum(axis=1)

    # Shift EOD positions to positions at start of next trading day
    arg_8 = arg_1.copy().shift(1).fillna(0)
    arg_9 = arg_1.iloc[0].sum() / (1 + arg_0[0])
    arg_8.cash[0] = arg_9

    # Format and add start positions to intraday position changes
    arg_4.index = arg_4.index.normalize()
    arg_11 = arg_8.add(arg_4, fill_value=0)
    arg_11.index.name = 'period_close'
    arg_11.columns.name = 'sid'

    return arg_11

Intraday strategies will often not hold positions at the day end . This attempts to find the point in the day that best represents the activity of the strategy on that day and effectively resamples the end - of - day positions with the positions at this point of day . The point of day is found by detecting when our exposure in the market is at its maximum point . Note that this is an estimate .


def Func ( arg_0 ) : if len ( arg_0 . __members ) != 0 : if arg_0 . __num_processes > 1 : arg_1 = [ arg_2 . get ( ) for arg_2 in arg_0 . __members ] else : arg_1 = arg_0 . __members return sum ( arg_2 . cost_fn_val for arg_2 in arg_1 ) / len ( arg_1 ) else : return None

def Func(arg_0):
        '''Returns average cost function return value for all members'''

        if len(arg_0.__members) != 0:
            if arg_0.__num_processes > 1:
                arg_1 = [arg_2.get() for arg_2 in arg_0.__members]
            else:
                arg_1 = arg_0.__members
            return sum(arg_2.cost_fn_val for arg_2 in arg_1) / len(arg_1)
        else:
            return None


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
open
(
arg_1
,
'wb'
)
for
arg_3
,
arg_4
in
enumerate
(
arg_0
)
:
arg_2
.
write
(
'<FILENAME docid="%s">\n'
%
arg_4
.
stream_id
)
arg_2
.
write
(
arg_4
.
body
.
cleansed
)
arg_2
.
write
(
'</FILENAME>\n'
)
arg_2
.
close
(
)
print
'created %s'
%
arg_1

def Func(arg_0, arg_1):
    '''make a temp file of cleansed text'''
    arg_2 = open(arg_1, 'wb')
    for arg_3, arg_4 in enumerate(arg_0):
        arg_2.write('<FILENAME docid="%s">\n' % arg_4.stream_id)
        arg_2.write(arg_4.body.cleansed)
        ## how to deal with other_content?
        arg_2.write('</FILENAME>\n')
    arg_2.close()
    ## replace this with log.info()
    print 'created %s' % arg_1


(simbasedir,
                                         override_paramdists=None,
                                         overwrite_existingvar=False)

def Func(arg_0,
                                         arg_1=None,
                                         arg_2=False):
    '''This adds variability and noise to all fake LCs in `simbasedir`.

    If an object is marked as variable in the `fakelcs-info`.pkl file in
    `simbasedir`, a variable signal will be added to its light curve based on
    its selected type, default period and amplitude distribution, the
    appropriate params, etc. the epochs for each variable object will be chosen
    uniformly from its time-range (and may not necessarily fall on a actual
    observed time). Nonvariable objects will only have noise added as determined
    by their params, but no variable signal will be added.

    Parameters
    ----------

    simbasedir : str
        The directory containing the fake LCs to process.

    override_paramdists : dict
        This can be used to override the stored variable parameters in each fake
        LC. It should be a dict of the following form::

            {'<vartype1>': {'<param1>: a scipy.stats distribution function or
                                       the np.random.randint function,
                            .
                            .
                            .
                            '<paramN>: a scipy.stats distribution function
                                       or the np.random.randint function}

        for any vartype in VARTYPE_LCGEN_MAP. These are used to override the
        default parameter distributions for each variable type.

    overwrite_existingvar : bool
        If this is True, then will overwrite any existing variability in the
        input fake LCs in `simbasedir`.

    Returns
    -------

    dict
        This returns a dict containing the fake LC filenames as keys and
        variability info for each as values.

    '''

    # open the fakelcs-info.pkl
    arg_3 = os.path.join(arg_0,'fakelcs-info.pkl')
    with open(arg_3, 'rb') as infd:
        arg_4 = pickle.load(infd)

    arg_5 = arg_4['lcfpath']
    arg_6 = arg_4['isvariable']
    arg_7 = arg_4['vartype']

    arg_8 = 0

    arg_9 = {}

    # go through all the LCs and add the required type of variability
    for arg_10, arg_11, arg_12 in zip(arg_5, arg_6, range(len(arg_5))):

        # if this object is variable, add variability
        if arg_11:

            arg_13 = arg_7[arg_8]

            if (arg_1 and
                isinstance(arg_1, dict) and
                arg_13 in arg_1 and
                isinstance(arg_1[arg_13], dict)):

                arg_14 = arg_1[arg_13]
            else:
                arg_14 = None

            arg_15 = add_fakelc_variability(
                arg_10, arg_13,
                arg_1=arg_14,
                overwrite=arg_2
            )
            arg_9[arg_15['objectid']] = {'params': arg_15['actual_varparams'],
                                          'vartype': arg_15['actual_vartype']}

            # update vartind
            arg_8 = arg_8 + 1

        else:

            arg_15 = add_fakelc_variability(
                arg_10, None,
                overwrite=arg_2
            )
            arg_9[arg_15['objectid']] = {'params': arg_15['actual_varparams'],
                                          'vartype': arg_15['actual_vartype']}

    #
    # done with all objects
    #

    # write the varinfo back to the dict and fakelcs-info.pkl
    arg_4['varinfo'] = arg_9

    arg_16 = '%s.%s' % (arg_3, md5(npr.bytes(4)).hexdigest()[-8:])
    with open(arg_16, 'wb') as outfd:
        pickle.dump(arg_4, outfd, pickle.HIGHEST_PROTOCOL)

    if os.path.exists(arg_16):
        shutil.copy(arg_16, arg_3)
        os.remove(arg_16)
    else:
        LOGEXCEPTION('could not write output light curve file to dir: %s' %
                     os.path.dirname(arg_16))
        # fail here
        raise

    return arg_4

This adds variability and noise to all fake LCs in simbasedir .


def Func ( arg_0 , arg_1 : arg_2 , arg_3 ) : assert isinstance ( arg_1 , arg_2 ) arg_4 = SECTION arg_0 . config . Func ( arg_4 , arg_1 . name , arg_3 ) arg_0 . save ( )

def Func(arg_0, arg_1: arg_2, arg_3):
        """ Sets a value in config """
        assert isinstance(arg_1, arg_2)

        # As currently we only have 1 section.
        arg_4 = SECTION
        arg_0.config.Func(arg_4, arg_1.name, arg_3)
        arg_0.save()


def Func ( arg_0 ) : arg_1 = [ arg_2 for arg_2 in arg_0 . directives if arg_2 . name == "import" ] if arg_1 : return "\n" + "\n" . join ( arg_2 . args [ "value" ] for arg_2 in arg_1 ) else : return ""

def Func(arg_0):
    """Reads the directives and generates source code for custom imports."""
    arg_1 = [arg_2 for arg_2 in arg_0.directives if arg_2.name == "import"]
    if arg_1:
      return "\n" + "\n".join(arg_2.args["value"] for arg_2 in arg_1)
    else:
      return ""

Reads the directives and generates source code for custom imports .


def Func ( arg_0 , arg_1 , arg_2 ) : if len ( arg_1 . annotations ) != 0 : if not arg_0 . annotation_comment_set : arg_0 . annotation_comment_set = True arg_1 . annotations [ - 1 ] . comment = arg_2 return True else : raise CardinalityError ( 'AnnotationComment' ) else : raise OrderError ( 'AnnotationComment' )

def Func(arg_0, arg_1, arg_2):
        """Sets the annotation comment. Raises CardinalityError if
        already set. OrderError if no annotator defined before.
        """
        if len(arg_1.annotations) != 0:
            if not arg_0.annotation_comment_set:
                arg_0.annotation_comment_set = True
                arg_1.annotations[-1].comment = arg_2
                return True
            else:
                raise CardinalityError('AnnotationComment')
        else:
            raise OrderError('AnnotationComment')

Sets the annotation comment . Raises CardinalityError if already set . OrderError if no annotator defined before .


def Func(*arg_0):
    """Combine multiple context managers into a single Func context manager.

   This function has been deprecated in favour of the multiple manager form
   of the with statement.

   The one advantage of this function over the multiple manager form of the
   with statement is that argument unpacking allows it to be
   used with a variable number of context managers as follows:

      with Func(*managers):
          do_something()

    """
    warn("With-statements now directly support multiple context managers",
         DeprecationWarning, 3)
    arg_1 = []
    arg_2 = []
    arg_3 = (None, None, None)
    try:
        for arg_4 in arg_0:
            arg_5 = arg_4.__exit__
            arg_6 = arg_4.__enter__
            arg_2.append(arg_6())
            arg_1.append(arg_5)
        yield arg_2
    except:
        arg_3 = sys.exc_info()
    finally:
        while arg_1:
            arg_5 = arg_1.pop()
            try:
                if arg_5(*arg_3):
                    arg_3 = (None, None, None)
            except:
                arg_3 = sys.exc_info()
        if arg_3 != (None, None, None):
            # Don't rely on sys.exc_info() still containing
            # the right information. Another exception may
            # have been raised and caught by an exit method
            raise arg_3[0], arg_3[1], arg_3[2]

Combine multiple context managers into a single nested context manager.

   This function has been deprecated in favour of the multiple manager form
   of the with statement.

   The one advantage of this function over the multiple manager form of the
   with statement is that argument unpacking allows it to be
   used with a variable number of context managers as follows:

      with nested(*managers):
          do_something()

Combine multiple context managers into a single nested context manager .


(times=None, frames=None, sr=22050, hop_length=512,
           click_freq=1000.0, click_duration=0.1, click=None, length=None)

def Func(arg_0=None, arg_1=None, arg_2=22050, arg_3=512,
           arg_4=1000.0, arg_5=0.1, arg_6=None, arg_7=None):
    """Returns a signal with the signal `click` placed at each specified time

    Parameters
    ----------
    times : np.ndarray or None
        times to place Func, in seconds

    frames : np.ndarray or None
        frame indices to place Func

    sr : number > 0
        desired sampling rate of the output signal

    hop_length : int > 0
        if positions are specified by `frames`, the number of samples between frames.

    click_freq : float > 0
        frequency (in Hz) of the default click signal.  Default is 1KHz.

    click_duration : float > 0
        duration (in seconds) of the default click signal.  Default is 100ms.

    click : np.ndarray or None
        optional click signal sample to use instead of the default blip.

    length : int > 0
        desired number of samples in the output signal

    Returns
    -------
    click_signal : np.ndarray
        Synthesized click signal

    Raises
    ------
    ParameterError
        - If neither `times` nor `frames` are provided.
        - If any of `click_freq`, `click_duration`, or `length` are out of range.

    Examples
    --------
    >>> # Sonify detected beat events
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> tempo, beats = librosa.beat.beat_track(y=y, sr=sr)
    >>> y_beats = librosa.Func(frames=beats, sr=sr)

    >>> # Or generate a signal of the same length as y
    >>> y_beats = librosa.Func(frames=beats, sr=sr, length=len(y))

    >>> # Or use timing instead of frame indices
    >>> times = librosa.frames_to_time(beats, sr=sr)
    >>> y_beat_times = librosa.Func(times=times, sr=sr)

    >>> # Or with a click frequency of 880Hz and a 500ms sample
    >>> y_beat_times880 = librosa.Func(times=times, sr=sr,
    ...                                  click_freq=880, click_duration=0.5)

    Display click waveform next to the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> S = librosa.feature.melspectrogram(y=y, sr=sr)
    >>> ax = plt.subplot(2,1,2)
    >>> librosa.display.specshow(librosa.power_to_db(S, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.subplot(2,1,1, sharex=ax)
    >>> librosa.display.waveplot(y_beat_times, sr=sr, label='Beat Func')
    >>> plt.legend()
    >>> plt.xlim(15, 30)
    >>> plt.tight_layout()
    """

    # Compute sample positions from time or frames
    if arg_0 is None:
        if arg_1 is None:
            raise ParameterError('either "times" or "frames" must be provided')

        arg_8 = frames_to_samples(arg_1, arg_3=arg_3)
    else:
        # Convert times to positions
        arg_8 = time_to_samples(arg_0, arg_2=arg_2)

    if arg_6 is not None:
        # Check that we have a well-formed audio buffer
        util.valid_audio(arg_6, mono=True)

    else:
        # Create default click signal
        if arg_5 <= 0:
            raise ParameterError('click_duration must be strictly positive')

        if arg_4 <= 0:
            raise ParameterError('click_freq must be strictly positive')

        arg_9 = 2 * np.pi * arg_4 / float(arg_2)

        arg_6 = np.logspace(0, -10,
                            num=int(np.round(arg_2 * arg_5)),
                            base=2.0)

        arg_6 *= np.sin(arg_9 * np.arange(len(arg_6)))

    # Set default length
    if arg_7 is None:
        arg_7 = arg_8.max() + arg_6.shape[0]
    else:
        if arg_7 < 1:
            raise ParameterError('length must be a positive integer')

        # Filter out any positions past the length boundary
        arg_8 = arg_8[arg_8 < arg_7]

    # Pre-allocate click signal
    arg_10 = np.zeros(arg_7, dtype=np.float32)

    # Place Func
    for arg_11 in arg_8:
        # Compute the end-point of this click
        arg_12 = arg_11 + arg_6.shape[0]

        if arg_12 >= arg_7:
            arg_10[arg_11:] += arg_6[:arg_7 - arg_11]
        else:
            # Normally, just add a click here
            arg_10[arg_11:arg_12] += arg_6

    return arg_10

Returns a signal with the signal `click` placed at each specified time

    Parameters
    ----------
    times : np.ndarray or None
        times to place clicks, in seconds

    frames : np.ndarray or None
        frame indices to place clicks

    sr : number > 0
        desired sampling rate of the output signal

    hop_length : int > 0
        if positions are specified by `frames`, the number of samples between frames.

    click_freq : float > 0
        frequency (in Hz) of the default click signal.  Default is 1KHz.

    click_duration : float > 0
        duration (in seconds) of the default click signal.  Default is 100ms.

    click : np.ndarray or None
        optional click signal sample to use instead of the default blip.

    length : int > 0
        desired number of samples in the output signal

    Returns
    -------
    click_signal : np.ndarray
        Synthesized click signal

    Raises
    ------
    ParameterError
        - If neither `times` nor `frames` are provided.
        - If any of `click_freq`, `click_duration`, or `length` are out of range.

    Examples
    --------
    >>> # Sonify detected beat events
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> tempo, beats = librosa.beat.beat_track(y=y, sr=sr)
    >>> y_beats = librosa.clicks(frames=beats, sr=sr)

    >>> # Or generate a signal of the same length as y
    >>> y_beats = librosa.clicks(frames=beats, sr=sr, length=len(y))

    >>> # Or use timing instead of frame indices
    >>> times = librosa.frames_to_time(beats, sr=sr)
    >>> y_beat_times = librosa.clicks(times=times, sr=sr)

    >>> # Or with a click frequency of 880Hz and a 500ms sample
    >>> y_beat_times880 = librosa.clicks(times=times, sr=sr,
    ...                                  click_freq=880, click_duration=0.5)

    Display click waveform next to the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> S = librosa.feature.melspectrogram(y=y, sr=sr)
    >>> ax = plt.subplot(2,1,2)
    >>> librosa.display.specshow(librosa.power_to_db(S, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.subplot(2,1,1, sharex=ax)
    >>> librosa.display.waveplot(y_beat_times, sr=sr, label='Beat clicks')
    >>> plt.legend()
    >>> plt.xlim(15, 30)
    >>> plt.tight_layout()

Returns a signal with the signal click placed at each specified time


def Func(arg_0, arg_1):
    """
    Converts a category number into a list of labels
    """
    if arg_1 is None:
      return []

    arg_2 = []
    arg_3 = 0
    while arg_1 > 0:
      if arg_1 % 2 == 1:
        arg_2.append(arg_0.saved_categories[arg_3])
      arg_3 += 1
      arg_1 = arg_1 >> 1
    return arg_2


async def Func(arg_0, arg_1, arg_2, **arg_3):
        """Handles Funcs to the API"""
        arg_4 = RateLimiter(max_calls=59, period=60, callback=limited)
        # handles ratelimits. max_calls is set to 59 because current implementation will retry in 60s after 60 calls is reached. DBL has a 1h block so obviously this doesn't work well, as it will get a 429 when 60 is reached.

        async with arg_4:  # this works but doesn't 'save' over restart. need a better implementation.

            if not arg_0.token:
                raise UnauthorizedDetected('UnauthorizedDetected (status code: 401): No TOKEN provided')

            arg_5 = {
                'User-Agent': arg_0.user_agent,
                'Content-Type': 'application/json'
            }

            if 'json' in arg_3:
                arg_3['data'] = to_json(arg_3.pop('json'))

            arg_3['headers'] = arg_5
            arg_5['Authorization'] = arg_0.token

            for arg_6 in range(5):
                async with arg_0.session.Func(arg_1, arg_2, **arg_3) as resp:
                    log.debug('%s %s with %s has returned %s', arg_1,
                              arg_2, arg_3.get('data'), resp.status)

                    arg_7 = await json_or_text(resp)

                    if 300 > resp.status >= 200:
                        return arg_7

                    if resp.status == 429:  # we are being ratelimited
                        arg_8 = 'We are being rate limited. Retrying in %.2f seconds (%.3f minutes).'

                        # sleep a bit
                        arg_9 = json.loads(resp.headers.get('Retry-After'))
                        arg_10 = arg_9 / 60
                        log.warning(arg_8, arg_9, arg_10)

                        # check if it's a global rate limit (True as only 1 ratelimit atm - /api/bots)
                        arg_11 = True  # is_global = data.get('global', False)
                        if arg_11:
                            arg_0._global_over.clear()

                        await asyncio.sleep(arg_9, loop=arg_0.loop)
                        log.debug('Done sleeping for the rate limit. Retrying...')

                        # release the global lock now that the
                        # global rate limit has passed
                        if arg_11:
                            arg_0._global_over.set()
                            log.debug('Global rate limit is now over.')

                        continue

                    if resp.status == 400:
                        raise HTTPException(resp, arg_7)
                    elif resp.status == 401:
                        raise Unauthorized(resp, arg_7)
                    elif resp.status == 403:
                        raise Forbidden(resp, arg_7)
                    elif resp.status == 404:
                        raise NotFound(resp, arg_7)
                    else:
                        raise HTTPException(resp, arg_7)
            # We've run out of retries, raise.
            raise HTTPException(resp, arg_7)


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . _set : return if arg_0 . path is None : arg_0 . set = lambda * a : None return None if arg_0 . _segments [ arg_1 . __class__ ] : arg_0 . get ( arg_1 ) if arg_0 . _segments [ arg_1 . __class__ ] : return arg_4 = compose ( * arg_0 . _getters [ arg_1 . __class__ ] [ : - 1 ] ) arg_1 = arg_4 ( arg_1 ) arg_5 = arg_0 . _make_setter ( arg_0 . path . split ( '.' ) [ - 1 ] , arg_1 . __class__ ) arg_5 ( arg_1 , arg_2 ) def setter ( arg_1 , arg_2 ) : arg_5 ( arg_4 ( arg_1 ) , arg_2 ) arg_0 . set = setter

def Func(arg_0, arg_1, arg_2):
        """Set the value of this attribute for the passed object.
        """

        if not arg_0._set:
            return

        if arg_0.path is None:
            # There is no path defined on this resource.
            # We can do no magic to set the value.
            arg_0.set = lambda *a: None
            return None

        if arg_0._segments[arg_1.__class__]:
            # Attempt to resolve access to this attribute.
            arg_0.get(arg_1)

        if arg_0._segments[arg_1.__class__]:
            # Attribute is not fully resolved; an interim segment is null.
            return

        # Resolve access to the parent object.
        # For a single-segment path this will effectively be a no-op.
        arg_4 = compose(*arg_0._getters[arg_1.__class__][:-1])
        arg_1 = arg_4(arg_1)

        # Make the setter.
        arg_5 = arg_0._make_setter(arg_0.path.split('.')[-1], arg_1.__class__)

        # Apply the setter now.
        arg_5(arg_1, arg_2)

        # Replace this function with the constructed setter.
        def setter(arg_1, arg_2):
            arg_5(arg_4(arg_1), arg_2)

        arg_0.set = setter

Set the value of this attribute for the passed object .


def Func(arg_0, arg_1, **arg_2):
        """Fetch the commits

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

        :returns: a generator of items
        """
        arg_3 = arg_2['from_date']
        arg_4 = arg_2['to_date']
        arg_5 = arg_2['branches']
        arg_6 = arg_2['latest_items']
        arg_7 = arg_2['no_update']

        arg_8 = 0

        try:
            if os.path.isfile(arg_0.gitpath):
                arg_9 = arg_0.__fetch_from_log()
            else:
                arg_9 = arg_0.__fetch_from_repo(arg_3, arg_4, arg_5,
                                                 arg_6, arg_7)

            for arg_10 in arg_9:
                yield arg_10
                arg_8 += 1
        except EmptyRepositoryError:
            pass

        logger.info("Fetch process completed: %s commits fetched",
                    arg_8)


(cls, object_type=None, object_uuid=None, **kwargs)

return super(DepositProvider, cls).create(
            object_type=object_type, object_uuid=object_uuid, **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = None , ** arg_3 ) : assert 'pid_value' in arg_3 arg_3 . setdefault ( 'status' , arg_0 . default_status ) return super ( DepositProvider , arg_0 ) . Func ( arg_1 = arg_1 , arg_2 = arg_2 , ** arg_3 )

def Func(arg_0, arg_1=None, arg_2=None, **arg_3):
        """Create a new deposit identifier.

        :param object_type: The object type (Default: ``None``)
        :param object_uuid: The object UUID (Default: ``None``)
        :param kwargs: It contains the pid value.
        """
        assert 'pid_value' in arg_3
        arg_3.setdefault('status', arg_0.default_status)
        return super(DepositProvider, arg_0).Func(
            arg_1=arg_1, arg_2=arg_2, **arg_3)


(self, msg_type, content=None, parent=None, subheader=None, header=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : Func = { } arg_5 = arg_0 . msg_header ( arg_1 ) if arg_5 is None else arg_5 Func [ 'header' ] = arg_5 Func [ 'msg_id' ] = arg_5 [ 'msg_id' ] Func [ 'msg_type' ] = arg_5 [ 'msg_type' ] Func [ 'parent_header' ] = { } if arg_3 is None else extract_header ( arg_3 ) Func [ 'content' ] = { } if arg_2 is None else arg_2 arg_7 = { } if arg_4 is None else arg_4 Func [ 'header' ] . update ( arg_7 ) return Func

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=None):
        """Return the nested message dict.

        This format is different from what is sent over the wire. The
        serialize/unserialize methods converts this nested message dict to the wire
        format, which is a list of message parts.
        """
        Func = {}
        arg_5 = arg_0.msg_header(arg_1) if arg_5 is None else arg_5
        Func['header'] = arg_5
        Func['msg_id'] = arg_5['msg_id']
        Func['msg_type'] = arg_5['msg_type']
        Func['parent_header'] = {} if arg_3 is None else extract_header(arg_3)
        Func['content'] = {} if arg_2 is None else arg_2
        arg_7 = {} if arg_4 is None else arg_4
        Func['header'].update(arg_7)
        return Func


(self, traj, network, network_dict, component_list,
                             analyser_list, pre_run=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                             arg_5, arg_6=False):
        """Generic `execute_network_run` function, handles experimental runs as well as pre-runs.

        See also :func:`~pypet.brian2.network.NetworkRunner.execute_network_run` and
         :func:`~pypet.brian2.network.NetworkRunner.execute_network_pre_run`.

        """

        # Initially extract the `subrun_list`
        arg_7 = arg_0._extract_subruns(arg_1, arg_6=arg_6)

        # counter for subruns
        arg_8 = 0

        # Execute all subruns in order
        while len(arg_7) > 0:

            # Get the next subrun
            arg_9 = arg_7.pop(0)

            # 1. Call `add` of all normal components
            for arg_10 in arg_4:
                arg_10.add_to_network(arg_1, arg_2, arg_9, arg_7,
                                         arg_3)

            # 2. Call `add` of all analyser components
            for arg_11 in arg_5:
                arg_11.add_to_network(arg_1, arg_2, arg_9, arg_7,
                                        arg_3)

            # 3. Call `add` of the network runner itself
            arg_0.add_to_network(arg_1, arg_2, arg_9, arg_7,
                                arg_3)

            # 4. Run the network
            arg_0._logger.info('STARTING subrun `%s` (#%d) lasting %s.' %
                             (arg_9.v_name, arg_8, str(arg_9.f_get())))
            arg_2.run(duration=arg_9.f_get(), report=arg_0._report,
                              report_period=arg_0._report_period)

            # 5. Call `analyse` of all analyser components
            for arg_11 in arg_5:
                arg_11.analyse(arg_1, arg_2, arg_9, arg_7,
                                 arg_3)

            # 6. Call `remove` of the network runner itself
            arg_0.remove_from_network(arg_1, arg_2, arg_9, arg_7,
                                     arg_3)

            # 7. Call `remove` for all analyser components
            for arg_11 in arg_5:
                arg_11.remove_from_network(arg_1, arg_2, arg_9, arg_7,
                                             arg_3)

            # 8. Call `remove` for all normal components
            for arg_10 in arg_4:
                arg_10.remove_from_network(arg_1, arg_2, arg_9, arg_7,
                                              arg_3)

            arg_8 += 1

Generic execute_network_run function handles experimental runs as well as pre - runs .


def
Func
(
arg_0
)
:
if
arg_0
.
_process
and
arg_0
.
_process
.
poll
(
)
is
:
return
if
not
getattr
(
arg_0
,
"_cmd"
)
:
raise
RuntimeError
(
"Player command is not configured"
)
log
.
debug
(
"Starting playback command: %r"
,
arg_0
.
_cmd
)
arg_0
.
_process
=
SilentPopen
(
arg_0
.
_cmd
)
arg_0
.
_post_start
(
)

def Func(arg_0):
        """Ensure player backing process is started
        """
        if arg_0._process and arg_0._process.poll() is None:
            return

        if not getattr(arg_0, "_cmd"):
            raise RuntimeError("Player command is not configured")

        log.debug("Starting playback command: %r", arg_0._cmd)
        arg_0._process = SilentPopen(arg_0._cmd)
        arg_0._post_start()


(self, right, prefix_existing=None, inplace=True,
              objective='left')

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = True , arg_4 = 'left' ) : if arg_3 : arg_5 = arg_0 else : arg_5 = arg_0 . copy ( ) arg_5 . id = '{}_{}' . format ( arg_0 . id , arg_1 . id ) arg_7 = deepcopy ( arg_1 . reactions ) if arg_2 is not None : arg_8 = arg_7 . query ( lambda rxn : rxn . id in arg_0 . reactions ) for arg_9 in arg_8 : arg_9 . id = '{}{}' . format ( arg_2 , arg_9 . id ) arg_5 . add_reactions ( arg_7 ) arg_10 = arg_5 . problem arg_11 = [ arg_10 . Variable . clone ( v ) for v in arg_1 . variables if v . name not in arg_5 . variables ] arg_5 . add_cons_vars ( arg_11 ) arg_12 = [ arg_10 . Constraint . clone ( c , model = arg_5 . solver ) for c in arg_1 . constraints if c . name not in arg_5 . constraints ] arg_5 . add_cons_vars ( arg_12 , sloppy = True ) arg_5 . objective = dict ( left = arg_0 . objective , arg_1 = arg_1 . objective , sum = arg_0 . objective . expression + arg_1 . objective . expression ) [ arg_4 ] return arg_5

def Func(arg_0, arg_1, arg_2=None, arg_3=True,
              arg_4='left'):
        """Merge two models to create a model with the reactions from both
        models.

        Custom constraints and variables from right models are also copied
        to left model, however note that, constraints and variables are
        assumed to be the same if they have the same name.

        right : cobra.Model
            The model to add reactions from
        prefix_existing : string
            Prefix the reaction identifier in the right that already exist
            in the left model with this string.
        inplace : bool
            Add reactions from right directly to left model object.
            Otherwise, create a new model leaving the left model untouched.
            When done within the model as context, changes to the models are
            reverted upon exit.
        objective : string
            One of 'left', 'right' or 'sum' for setting the objective of the
            resulting model to that of the corresponding model or the sum of
            both.
        """
        if arg_3:
            arg_5 = arg_0
        else:
            arg_5 = arg_0.copy()
            arg_5.id = '{}_{}'.format(arg_0.id, arg_1.id)
        arg_7 = deepcopy(arg_1.reactions)
        if arg_2 is not None:
            arg_8 = arg_7.query(
                lambda rxn: rxn.id in arg_0.reactions)
            for arg_9 in arg_8:
                arg_9.id = '{}{}'.format(arg_2, arg_9.id)
        arg_5.add_reactions(arg_7)
        arg_10 = arg_5.problem
        arg_11 = [arg_10.Variable.clone(v) for v in arg_1.variables if
                    v.name not in arg_5.variables]
        arg_5.add_cons_vars(arg_11)
        arg_12 = [arg_10.Constraint.clone(c, model=arg_5.solver)
                    for c in arg_1.constraints if
                    c.name not in arg_5.constraints]
        arg_5.add_cons_vars(arg_12, sloppy=True)
        arg_5.objective = dict(
            left=arg_0.objective,
            arg_1=arg_1.objective,
            sum=arg_0.objective.expression + arg_1.objective.expression
        )[arg_4]
        return arg_5

Merge two models to create a model with the reactions from both models .


def Func(arg_0, **arg_1):
        '''
        Get board information for this card. Returns a Board object.

        Returns:
            Board: The board this card is attached to
        '''
        arg_2 = arg_0.Func_json(arg_0.base_uri,
                                         arg_1=arg_1)
        return arg_0.create_board(arg_2)

Get board information for this card . Returns a Board object .


return b":".join([
            b16encode(ch).upper() for ch
            in _ffi.buffer(result_buffer, result_length[0])])

def
Func
(
arg_0
,
arg_1
)
:
Func
=
_lib
.
EVP_get_digestbyname
(
_byte_string
(
arg_1
)
)
if
Func
==
_ffi
.
:
raise
ValueError
(
"No such digest method"
)
arg_3
=
_ffi
.
new
(
"unsigned char[]"
,
_lib
.
EVP_MAX_MD_SIZE
)
arg_4
=
_ffi
.
new
(
"unsigned int[]"
,
1
)
arg_4
[
0
]
=
len
(
arg_3
)
arg_5
=
_lib
.
X509_digest
(
arg_0
.
_x509
,
Func
,
arg_3
,
arg_4
)
_openssl_assert
(
arg_5
==
1
)
return
b":"
.
join
(
[
b16encode
(
arg_6
)
.
upper
(
)
for
arg_6
in
_ffi
.
buffer
(
arg_3
,
arg_4
[
0
]
)
]
)

def Func(arg_0, arg_1):
        """
        Return the digest of the X509 object.

        :param digest_name: The name of the digest algorithm to use.
        :type digest_name: :py:class:`bytes`

        :return: The digest of the object, formatted as
            :py:const:`b":"`-delimited hex pairs.
        :rtype: :py:class:`bytes`
        """
        Func = _lib.EVP_get_digestbyname(_byte_string(arg_1))
        if Func == _ffi.NULL:
            raise ValueError("No such digest method")

        arg_3 = _ffi.new("unsigned char[]", _lib.EVP_MAX_MD_SIZE)
        arg_4 = _ffi.new("unsigned int[]", 1)
        arg_4[0] = len(arg_3)

        arg_5 = _lib.X509_digest(
            arg_0._x509, Func, arg_3, arg_4)
        _openssl_assert(arg_5 == 1)

        return b":".join([
            b16encode(arg_6).upper() for arg_6
            in _ffi.buffer(arg_3, arg_4[0])])


def Func ( ) : def _minimal_ext_cmd ( arg_0 ) : arg_1 = { } for arg_2 in [ 'SYSTEMROOT' , 'PATH' ] : arg_3 = os . environ . get ( arg_2 ) if arg_3 is not None : arg_1 [ arg_2 ] = arg_3 arg_1 [ 'LANGUAGE' ] = 'C' arg_1 [ 'LANG' ] = 'C' arg_1 [ 'LC_ALL' ] = 'C' with open ( os . devnull , 'w' ) as err_out : arg_4 = subprocess . Popen ( arg_0 , stdout = subprocess . PIPE , stderr = err_out , arg_1 = arg_1 ) . communicate ( ) [ 0 ] return arg_4 try : arg_5 = os . path . dirname ( os . path . realpath ( __file__ ) ) arg_4 = _minimal_ext_cmd ( [ 'git' , '-C' , arg_5 , 'rev-parse' , 'HEAD' ] ) arg_6 = arg_4 . strip ( ) . decode ( 'ascii' ) except OSError : arg_6 = 'Unknown' return arg_6

def Func():
    """
    Return the git hash as a string.

    Apparently someone got this from numpy's setup.py. It has since been
    modified a few times.
    """
    # Return the git revision as a string
    # copied from numpy setup.py
    def _minimal_ext_cmd(arg_0):
        # construct minimal environment
        arg_1 = {}
        for arg_2 in ['SYSTEMROOT', 'PATH']:
            arg_3 = os.environ.get(arg_2)
            if arg_3 is not None:
                arg_1[arg_2] = arg_3
        # LANGUAGE is used on win32
        arg_1['LANGUAGE'] = 'C'
        arg_1['LANG'] = 'C'
        arg_1['LC_ALL'] = 'C'
        with open(os.devnull, 'w') as err_out:
            arg_4 = subprocess.Popen(arg_0,
                                   stdout=subprocess.PIPE,
                                   stderr=err_out, # maybe debug later?
                                   arg_1=arg_1).communicate()[0]
        return arg_4

    try:
        arg_5 = os.path.dirname(os.path.realpath(__file__))
        arg_4 = _minimal_ext_cmd(['git', '-C', arg_5, 'rev-parse', 'HEAD'])
        arg_6 = arg_4.strip().decode('ascii')
    except OSError:
        arg_6 = 'Unknown'

    return arg_6


def Func ( arg_0 = None , arg_1 = "" , arg_2 = True ) : from sregistry . defaults import SREGISTRY_TMPDIR arg_3 = arg_0 or SREGISTRY_TMPDIR arg_1 = arg_1 or "sregistry-tmp" arg_1 = "%s.%s" % ( arg_1 , next ( tempfile . _get_candidate_names ( ) ) ) arg_3 = os . path . join ( arg_3 , arg_1 ) if not os . path . exists ( arg_3 ) and arg_2 is True : os . mkdir ( arg_3 ) return arg_3

def Func(arg_0=None, arg_1="", arg_2=True):
    '''get a temporary directory for an operation. If SREGISTRY_TMPDIR
       is set, return that. Otherwise, return the output of tempfile.mkdtemp

       Parameters
       ==========
       requested_tmpdir: an optional requested temporary directory, first
       priority as is coming from calling function.
       prefix: Given a need for a sandbox (or similar), we will need to
       create a subfolder *within* the SREGISTRY_TMPDIR.
       create: boolean to determine if we should create folder (True)
    '''
    from sregistry.defaults import SREGISTRY_TMPDIR

    # First priority for the base goes to the user requested.
    arg_3 = arg_0 or SREGISTRY_TMPDIR

    arg_1 = arg_1 or "sregistry-tmp"
    arg_1 = "%s.%s" %(arg_1, next(tempfile._get_candidate_names()))
    arg_3 = os.path.join(arg_3, arg_1)

    if not os.path.exists(arg_3) and arg_2 is True:
        os.mkdir(arg_3)

    return arg_3

get a temporary directory for an operation . If SREGISTRY_TMPDIR is set return that . Otherwise return the output of tempfile . mkdtemp


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = CrawlCandidate ( arg_0 . config , arg_1 , arg_2 ) return arg_0 . __crawl ( arg_3 )

def Func(arg_0, arg_1=None, arg_2=None):
        ''' Extract the most likely article content from the html page

            Args:
                url (str): URL to pull and parse
                raw_html (str): String representation of the HTML page
            Returns:
                Article: Representation of the article contents \
                including other parsed and Funced metadata '''
        arg_3 = CrawlCandidate(arg_0.config, arg_1, arg_2)
        return arg_0.__crawl(arg_3)

Extract the most likely article content from the html page

            Args:
                url (str): URL to pull and parse
                raw_html (str): String representation of the HTML page
            Returns:
                Article: Representation of the article contents \
                including other parsed and extracted metadata


def Func(arg_0, arg_1):
        """ write final tree files """

        ## print stats file location:
        #print(STATSOUT.format(opr(self.files.stats)))

        ## print finished tree information ---------------------
        print(FINALTREES.format(opr(arg_0.trees.tree)))

        ## print bootstrap information --------------------------
        if arg_0.params.nboots:
            ## get consensus, map values to tree edges, record stats file
            arg_0._compute_tree_stats(arg_1)
            ## print bootstrap info
            print(BOOTTREES.format(opr(arg_0.trees.cons), opr(arg_0.trees.boots)))

        ## print the ASCII tree only if its small
        if len(arg_0.samples) < 20:
            if arg_0.params.nboots:
                arg_2 = ete3.Tree(arg_0.trees.cons, format=0)
                arg_2.ladderize()
                print(arg_2.get_ascii(show_internal=True,
                                      attributes=["dist", "name"]))
                print("")
            else:
                arg_3 = ete3.Tree(arg_0.trees.tree, format=0)
                arg_3.ladderize()
                #qtre = toytree.tree(self.trees.tree, format=0)
                #qtre.tree.unroot()
                print(arg_3.get_ascii())
                print("")

        ## print PDF filename & tips -----------------------------
        arg_4 = "https://toytree.readthedocs.io/"
        arg_5 = "https://ipyrad.readthedocs.io/tetrad.html"
        print(LINKS.format(arg_4, arg_5))


def Func(arg_0, arg_1=4):
    """From a list of feature segments, return a list of 2D-Fourier Magnitude
    Coefs using the maximum segment size as main size and zero pad the rest.

    Parameters
    ----------
    feat_segments: list
        List of segments, one for each boundary interval.
    offset: int >= 0
        Number of frames to ignore from beginning and end of each segment.

    Returns
    -------
    fmcs: np.ndarray
        Tensor containing the 2D-FMC matrices, one matrix per segment.
    """
    if len(arg_0) == 0:
        return []

    # Get maximum segment size
    arg_2 = max([arg_4.shape[0] for arg_4 in arg_0])

    arg_3 = []
    for arg_4 in arg_0:
        # Zero pad if needed
        arg_5 = np.zeros((arg_2, arg_4.shape[1]))

        # Remove a set of frames in the beginning an end of the segment
        if arg_4.shape[0] <= arg_1 or arg_1 == 0:
            arg_5[:arg_4.shape[0], :] = arg_4
        else:
            arg_5[:arg_4.shape[0] - arg_1, :] = \
                arg_4[arg_1 // 2:-arg_1 // 2, :]

        # Compute the 2D-FMC
        try:
            arg_3.append(utils2d.compute_ffmc2d(arg_5))
        except:
            logging.warning("Couldn't compute the 2D Fourier Transform")
            arg_3.append(np.zeros((arg_5.shape[0] * arg_5.shape[1]) // 2 + 1))

        # Normalize
        # fmcs[-1] = fmcs[-1] / float(fmcs[-1].max())

    return np.asarray(arg_3)

From a list of feature segments return a list of 2D - Fourier Magnitude Coefs using the maximum segment size as main size and zero pad the rest .


return self.make_response(obj=record.files, pid=pid, record=record)

def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = [ data [ 'id' ] for data in json . loads ( request . data . decode ( 'utf-8' ) ) ] except KeyError : raise WrongFile ( ) arg_2 . files . sort_by ( * arg_3 ) arg_2 . commit ( ) db . session . commit ( ) return arg_0 . make_response ( obj = arg_2 . files , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Handle the sort of the files through the PUT deposit files.

        Expected inFunc in body PUT:

        .. code-block:: javascript

            [
                {
                    "id": 1
                },
                {
                    "id": 2
                },
                ...
            }

        Permission required: `update_permission_factory`.

        :param pid: Pid object (from url).
        :param record: Record object resolved from the pid.
        :returns: The files.
        """
        try:
            arg_3 = [data['id'] for data in json.loads(
                request.data.decode('utf-8'))]
        except KeyError:
            raise WrongFile()

        arg_2.files.sort_by(*arg_3)
        arg_2.commit()
        db.session.commit()
        return arg_0.make_response(obj=arg_2.files, arg_1=arg_1, arg_2=arg_2)

Handle the sort of the files through the PUT deposit files.

        Expected input in body PUT:

        .. code-block:: javascript

            [
                {
                    "id": 1
                },
                {
                    "id": 2
                },
                ...
            }

        Permission required: `update_permission_factory`.

        :param pid: Pid object (from url).
        :param record: Record object resolved from the pid.
        :returns: The files.

Handle the sort of the files through the PUT deposit files .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . skype . conn ( "GET" , "{0}/users/ME/conversations/{1}" . format ( arg_0 . skype . conn . msgsHost , arg_1 ) , auth = SkypeConnection . Auth . RegToken , params = { "view" : "msnp24Equivalent" } ) . json ( ) arg_3 = SkypeSingleChat if "threadProperties" in arg_2 : arg_4 = arg_0 . skype . conn ( "GET" , "{0}/threads/{1}" . format ( arg_0 . skype . conn . msgsHost , arg_2 . get ( "id" ) ) , auth = SkypeConnection . Auth . RegToken , params = { "view" : "msnp24Equivalent" } ) . json ( ) arg_2 . update ( arg_4 ) arg_3 = SkypeGroupChat return arg_0 . merge ( arg_3 . fromRaw ( arg_0 . skype , arg_2 ) )

def Func(arg_0, arg_1):
        """
        Get a single conversation by identifier.

        Args:
            id (str): single or group Func identifier
        """
        arg_2 = arg_0.skype.conn("GET", "{0}/users/ME/conversations/{1}".format(arg_0.skype.conn.msgsHost, arg_1),
                               auth=SkypeConnection.Auth.RegToken, params={"view": "msnp24Equivalent"}).json()
        arg_3 = SkypeSingleChat
        if "threadProperties" in arg_2:
            arg_4 = arg_0.skype.conn("GET", "{0}/threads/{1}".format(arg_0.skype.conn.msgsHost, arg_2.get("id")),
                                   auth=SkypeConnection.Auth.RegToken, params={"view": "msnp24Equivalent"}).json()
            arg_2.update(arg_4)
            arg_3 = SkypeGroupChat
        return arg_0.merge(arg_3.fromRaw(arg_0.skype, arg_2))

Get a single conversation by identifier.

        Args:
            id (str): single or group chat identifier

Get a single conversation by identifier .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = os . path . join ( logger . get_dir ( ) , "model.pkl" ) with tempfile . TemporaryDirectory ( ) as td : save_variables ( os . path . join ( td , "model" ) ) arg_2 = os . path . join ( td , "packed.zip" ) with zipfile . ZipFile ( arg_2 , 'w' ) as zipf : for arg_3 , arg_4 , arg_5 in os . walk ( td ) : for arg_6 in arg_5 : arg_7 = os . path . join ( arg_3 , arg_6 ) if arg_7 != arg_2 : zipf . write ( arg_7 , os . path . relpath ( arg_7 , td ) ) with open ( arg_2 , "rb" ) as f : arg_8 = f . read ( ) with open ( arg_1 , "wb" ) as f : cloudpickle . dump ( ( arg_8 , arg_0 . _act_params ) , f )

def Func(arg_0, arg_1=None):
        """Save model to a pickle located at `path`"""
        if arg_1 is None:
            arg_1 = os.path.join(logger.get_dir(), "model.pkl")

        with tempfile.TemporaryDirectory() as td:
            save_variables(os.path.join(td, "model"))
            arg_2 = os.path.join(td, "packed.zip")
            with zipfile.ZipFile(arg_2, 'w') as zipf:
                for arg_3, arg_4, arg_5 in os.walk(td):
                    for arg_6 in arg_5:
                        arg_7 = os.path.join(arg_3, arg_6)
                        if arg_7 != arg_2:
                            zipf.write(arg_7, os.path.relpath(arg_7, td))
            with open(arg_2, "rb") as f:
                arg_8 = f.read()
        with open(arg_1, "wb") as f:
            cloudpickle.dump((arg_8, arg_0._act_params), f)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : if arg_0 . _done_notification_func is not None : arg_0 . _done_notification_func ( ) arg_0 . _timer . cancel ( )

def Func(arg_0, *arg_1, **arg_2):
        """
        Delete all state associated with the chaos session
        """
        if arg_0._done_notification_func is not None:
            arg_0._done_notification_func()
        arg_0._timer.cancel()


(self, states, internals, actions, terminal, reward)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """
        Stores demonstrations in the demo memory.
        """
        arg_6 = arg_0.Func_output

        arg_7 = arg_0.get_feed_dict(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5
        )

        arg_0.monitored_session.run(arg_6=arg_6, arg_7=arg_7)

Stores demonstrations in the demo memory .


def Func ( arg_0 , arg_1 , ** arg_2 ) : def decorator ( arg_3 ) : arg_0 . filters [ arg_1 ] = NodeFilter ( arg_1 , arg_3 , ** arg_2 ) return decorator

def Func(arg_0, arg_1, **arg_2):
        """
        Returns a decorator function for adding a node filter.

        Args:
            name (str): The name of the filter.
            **kwargs: Variable keyword arguments for the filter.

        Returns:
            Callable[[Callable[[Element, Any], bool]]]: A decorator function for adding a node
                filter.
        """

        def decorator(arg_3):
            arg_0.filters[arg_1] = NodeFilter(arg_1, arg_3, **arg_2)

        return decorator

Returns a decorator function for adding a node filter .


def Func(arg_0):
    """Parse the provided file, and return Code object."""
    assert isinstance(arg_0, _str_type), "`filename` parameter should be a string, got %r" % type(arg_0)
    with open(arg_0, "rt", encoding="utf-8") as f:
        return Code(_tokenize(f.readline))

Parse the provided file and return Code object .


def Func ( arg_0 ) : if arg_0 . background == None : arg_0 . _ctx . background ( None ) else : arg_0 . _ctx . background ( arg_0 . background ) if arg_0 . depth : try : arg_1 = colors . color ( arg_0 . background ) . darker ( 0.2 ) arg_2 = arg_0 . _ctx . rect ( 0 , 0 , arg_0 . _ctx . WIDTH , arg_0 . _ctx . HEIGHT , draw = False ) colors . gradientfill ( arg_2 , arg_1 , arg_1 . lighter ( 0.35 ) ) colors . shadow ( dx = 0 , dy = 0 , blur = 2 , alpha = 0.935 , arg_1 = arg_0 . background ) except : pass

def Func(arg_0):

    """ Graph background color.
    """

    if arg_0.background == None:
        arg_0._ctx.background(None)
    else:
        arg_0._ctx.background(arg_0.background)

    if arg_0.depth:
        try:
            arg_1 = colors.color(arg_0.background).darker(0.2)
            arg_2 = arg_0._ctx.rect(0, 0, arg_0._ctx.WIDTH, arg_0._ctx.HEIGHT, draw=False)
            colors.gradientfill(arg_2, arg_1, arg_1.lighter(0.35))
            colors.shadow(dx=0, dy=0, blur=2, alpha=0.935, arg_1=arg_0.background)
        except:
            pass


def Func ( arg_0 ) : if six . PY2 : arg_1 = [ str , unicode ] elif six . PY3 : arg_1 = [ str ] if type ( arg_0 ) is int : return _ramon_types [ arg_0 ] elif type ( arg_0 ) in arg_1 : return _ramon_types [ _types [ arg_0 ] ]

def Func(arg_0):
        """
        Takes str or int, returns class type
        """
        if six.PY2:
            arg_1 = [str, unicode]
        elif six.PY3:
            arg_1 = [str]

        if type(arg_0) is int:
            return _ramon_types[arg_0]
        elif type(arg_0) in arg_1:
            return _ramon_types[_types[arg_0]]


def Func ( arg_0 , arg_1 , arg_2 ) : while 1 : if not arg_0 : break arg_3 = arg_0 [ - 1 ] arg_4 = arg_3 . split ( ) [ 0 ] . strip ( '<>/' ) if not arg_1 : break arg_5 = arg_1 [ - 1 ] if arg_5 is DEL_END or not arg_5 . startswith ( '</' ) : break arg_6 = arg_5 . split ( ) [ 0 ] . strip ( '<>/' ) if arg_6 == 'ins' or arg_6 == 'del' : break if arg_6 == arg_4 : arg_0 . pop ( ) arg_2 . insert ( 0 , arg_1 . pop ( ) ) else : break

def Func(arg_0, arg_1, arg_2):
    """ like locate_unbalanced_start, except handling end tags and
    possibly moving the point earlier in the document.  """
    while 1:
        if not arg_0:
            # Success
            break
        arg_3 = arg_0[-1]
        arg_4 = arg_3.split()[0].strip('<>/')
        if not arg_1:
            break
        arg_5 = arg_1[-1]
        if arg_5 is DEL_END or not arg_5.startswith('</'):
            # A word or a start tag
            break
        arg_6 = arg_5.split()[0].strip('<>/')
        if arg_6 == 'ins' or arg_6 == 'del':
            # Can't move into an insert or delete
            break
        if arg_6 == arg_4:
            arg_0.pop()
            arg_2.insert(0, arg_1.pop())
        else:
            # Found a tag that doesn't match
            break

like locate_unbalanced_start except handling end tags and possibly moving the point earlier in the document .


(self, expression, progress=False, delay=False)

return self.map_reduce(map, reduce, [expression], delay=delay, progress=progress, name='nop', to_numpy=False)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : arg_1 = _ensure_string_from_expression ( arg_1 ) def map ( arg_4 ) : pass def reduce ( arg_5 , arg_6 ) : pass return arg_0 . map_reduce ( map , reduce , [ arg_1 ] , arg_3 = arg_3 , arg_2 = arg_2 , name = 'Func' , to_numpy = False )

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
        """Evaluates expression, and drop the result, usefull for benchmarking, since vaex is usually lazy"""
        arg_1 = _ensure_string_from_expression(arg_1)
        def map(arg_4):
            pass
        def reduce(arg_5, arg_6):
            pass
        return arg_0.map_reduce(map, reduce, [arg_1], arg_3=arg_3, arg_2=arg_2, name='Func', to_numpy=False)

Evaluates expression and drop the result usefull for benchmarking since vaex is usually lazy


def
Func
(
arg_0
)
:
arg_1
=
urijoin
(
arg_0
.
base_url
,
'projects'
,
arg_0
.
owner
+
'%2F'
+
arg_0
.
repository
)
try
:
arg_2
=
super
(
)
.
fetch
(
arg_1
)
arg_0
.
update_rate_limit
(
arg_2
)
except
requests
.
exceptions
.
HTTPError
as
error
:
if
error
.
response
.
status_code
==
401
:
raise
error
else
:
logger
.
warning
(
"Rate limit not initialized: %s"
,
error
)

def Func(arg_0):
        """Initialize rate limit information"""

        arg_1 = urijoin(arg_0.base_url, 'projects', arg_0.owner + '%2F' + arg_0.repository)
        try:
            arg_2 = super().fetch(arg_1)
            arg_0.update_rate_limit(arg_2)
        except requests.exceptions.HTTPError as error:
            if error.response.status_code == 401:
                raise error
            else:
                logger.warning("Rate limit not initialized: %s", error)


def
Func
(
arg_0
=
,
arg_1
=
1
)
:
arg_1
=
int
(
arg_1
)
arg_0
=
arg_0
or
env
.
vm_ec2_keypair_name
arg_2
=
'roles/%s/%s.pem'
%
(
env
.
ROLE
,
arg_0
)
arg_3
=
get_ec2_connection
(
)
arg_4
=
arg_3
.
get_key_pair
(
arg_0
)
if
arg_4
:
print
(
'Key pair %s already exists.'
%
arg_0
)
else
:
arg_4
=
arg_3
.
create_key_pair
(
arg_0
)
open
(
arg_2
,
'wb'
)
.
write
(
arg_4
.
material
)
os
.
system
(
'chmod 600 %s'
%
arg_2
)
print
(
'Key pair %s created.'
%
arg_0
)
return
arg_2

def Func(arg_0=None, arg_1=1):
    """
    Creates and saves an EC2 key pair to a local PEM file.
    """
    arg_1 = int(arg_1)
    arg_0 = arg_0 or env.vm_ec2_keypair_name
    arg_2 = 'roles/%s/%s.pem' % (env.ROLE, arg_0)
    arg_3 = get_ec2_connection()
    arg_4 = arg_3.get_key_pair(arg_0)
    if arg_4:
        print('Key pair %s already exists.' % arg_0)
    else:
        # Note, we only get the private key during creation.
        # If we don't save it here, it's lost forever.
        arg_4 = arg_3.create_key_pair(arg_0)
        open(arg_2, 'wb').write(arg_4.material)
        os.system('chmod 600 %s' % arg_2)
        print('Key pair %s created.' % arg_0)
    #return kp
    return arg_2

Creates and saves an EC2 key pair to a local PEM file .


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 in arg_0 . _meta . concrete_fields : if arg_3 . attname in arg_1 : arg_2 [ arg_3 . attname ] = arg_1 [ arg_3 . attname ] return arg_0 ( ** arg_2 )

def Func(arg_0, arg_1):
        """Returns an unsaved class object based on the valid properties passed in."""
        arg_2 = {}
        for arg_3 in arg_0._meta.concrete_fields:
            if arg_3.attname in arg_1:
                arg_2[arg_3.attname] = arg_1[arg_3.attname]
        return arg_0(**arg_2)

Returns an unsaved class object based on the valid properties passed in .


def Func ( arg_0 , arg_1 = "Singularity" , arg_2 = None ) : if arg_1 is None : arg_1 = "Singularity*" arg_3 = None arg_4 = os . path . basename ( arg_0 ) if fnmatch . fnmatch ( arg_4 , arg_1 ) : arg_3 = { 'path' : os . path . abspath ( arg_0 ) , 'modified' : os . path . getmtime ( arg_0 ) } if arg_2 is not None and arg_3 is not None : arg_5 = '/' . join ( arg_0 . split ( '/' ) [ - 2 : ] ) if arg_5 in arg_2 : if arg_2 [ arg_5 ] [ 'modified' ] < os . path . getmtime ( arg_0 ) : arg_2 [ arg_5 ] = arg_3 else : arg_2 [ arg_5 ] = arg_3 return arg_2 return arg_3

def Func(arg_0, arg_1="Singularity", arg_2=None):
    '''Func will parse a single file, and if valid,
       return an updated manifest

       Parameters
       ==========
       filename: the filename to assess for a recipe
       pattern: a default pattern to search for
       manifest: an already started manifest

    '''

    if arg_1 is None:
        arg_1 = "Singularity*"

    arg_3 = None
    arg_4 = os.path.basename(arg_0)
    if fnmatch.fnmatch(arg_4, arg_1):
        arg_3 = {'path': os.path.abspath(arg_0),
                  'modified':os.path.getmtime(arg_0)}

    # If we already have the recipe, only add if more recent
    if arg_2 is not None and arg_3 is not None:
        arg_5 = '/'.join(arg_0.split('/')[-2:])
        if arg_5 in arg_2:
            if arg_2[arg_5]['modified'] < os.path.getmtime(arg_0):
                arg_2[arg_5] = arg_3
        else:
            arg_2[arg_5] = arg_3
        return arg_2

    return arg_3

find_single_recipe will parse a single file, and if valid,
       return an updated manifest

       Parameters
       ==========
       filename: the filename to assess for a recipe
       pattern: a default pattern to search for
       manifest: an already started manifest

find_single_recipe will parse a single file and if valid return an updated manifest


def Func ( arg_0 ) : if not arg_0 . force_Func_v2 : arg_1 = arg_0 . Func_v1 ( ) if arg_1 : return arg_1 return arg_0 . Func_v2 ( )

def Func(arg_0):
        """
        Login to the router.

        Will be called automatically by other actions.
        """
        if not arg_0.force_Func_v2:
            arg_1 = arg_0.Func_v1()
            if arg_1:
                return arg_1

        return arg_0.Func_v2()


def Func(arg_0, arg_1=-1, arg_2=False, arg_3=0):
  """Returns `max` or `mask` if `max` is not finite."""
  arg_4 = np.max(arg_0, arg_1=_astuple(arg_1), arg_2=arg_2)
  arg_5 = ~np.isfinite(arg_4)
  if arg_5.ndim > 0:
    arg_4[arg_5] = arg_3
  elif arg_5:
    arg_4 = arg_3
  return arg_4

Returns max or mask if max is not finite .


def Func(arg_0, arg_1, arg_2):
        """
        Add a new order to a store.

        :param store_id: The store id.
        :type store_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "id": string*,
            "customer": object*
            {
                "'id": string*
            },
            "curency_code": string*,
            "order_total": number*,
            "lines": array*
            [
                {
                    "id": string*,
                    "product_id": string*,
                    "product_variant_id": string*,
                    "quantity": integer*,
                    "price": number*
                }
            ]
        }
        """
        arg_0.store_id = arg_1
        if 'id' not in arg_2:
            raise KeyError('The order must have an id')
        if 'customer' not in arg_2:
            raise KeyError('The order must have a customer')
        if 'id' not in arg_2['customer']:
            raise KeyError('The order customer must have an id')
        if 'currency_code' not in arg_2:
            raise KeyError('The order must have a currency_code')
        if not re.match(r"^[A-Z]{3}$", arg_2['currency_code']):
            raise ValueError('The currency_code must be a valid 3-letter ISO 4217 currency code')
        if 'order_total' not in arg_2:
            raise KeyError('The order must have an order_total')
        if 'lines' not in arg_2:
            raise KeyError('The order must have at least one order line')
        for arg_3 in arg_2['lines']:
            if 'id' not in arg_3:
                raise KeyError('Each order line must have an id')
            if 'product_id' not in arg_3:
                raise KeyError('Each order line must have a product_id')
            if 'product_variant_id' not in arg_3:
                raise KeyError('Each order line must have a product_variant_id')
            if 'quantity' not in arg_3:
                raise KeyError('Each order line must have a quantity')
            if 'price' not in arg_3:
                raise KeyError('Each order line must have a price')
        arg_4 = arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'orders'), arg_2=arg_2)
        if arg_4 is not None:
            arg_0.order_id = arg_4['id']
        else:
            arg_0.order_id = None
        return arg_4


return float(snum if snum[-1].isdigit() else snum[:-1])

def Func ( arg_0 ) : arg_0 = arg_0 . rstrip ( ) return float ( arg_0 if arg_0 [ - 1 ] . isdigit ( ) else arg_0 [ : - 1 ] )

def Func(arg_0):
    r"""
    Return the mantissa of a number represented in engineering notation.

    :param snum: Number
    :type  snum: :ref:`EngineeringNotationNumber`

    :rtype: float

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.functions.Func

    :raises: RuntimeError (Argument \`snum\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.Func(peng.peng(1235.6789E3, 3, False))
        1.236
    """
    arg_0 = arg_0.rstrip()
    return float(arg_0 if arg_0[-1].isdigit() else arg_0[:-1])

r"""
    Return the mantissa of a number represented in engineering notation.

    :param snum: Number
    :type  snum: :ref:`EngineeringNotationNumber`

    :rtype: float

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.functions.peng_mant

    :raises: RuntimeError (Argument \`snum\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.peng_mant(peng.peng(1235.6789E3, 3, False))
        1.236

r Return the mantissa of a number represented in engineering notation .


(cls, script_name, inputs, outputs, envs)

return DOCKER_COMMAND.format(
        mk_runtime_dirs=MK_RUNTIME_DIRS_COMMAND,
        script_path='%s/%s' % (providers_util.SCRIPT_DIR, script_name),
        install_cloud_sdk=install_cloud_sdk,
        export_inputs_with_wildcards=export_inputs_with_wildcards,
        export_input_dirs=export_input_dirs,
        copy_input_dirs=copy_input_dirs,
        mk_output_dirs=mkdirs,
        export_output_dirs=export_output_dirs,
        export_empty_envs=export_empty_envs,
        tmpdir=providers_util.TMP_DIR,
        working_dir=providers_util.WORKING_DIR,
        copy_output_dirs=copy_output_dirs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_5
=
[
var
for
var
in
arg_2
if
var
.
recursive
and
var
.
value
]
arg_6
=
[
var
for
var
in
arg_3
if
var
.
recursive
and
var
.
value
]
arg_7
=
''
if
arg_5
or
arg_6
:
arg_7
=
INSTALL_CLOUD_SDK
arg_8
=
''
arg_9
=
''
if
arg_5
:
arg_8
=
providers_util
.
build_recursive_localize_env
(
providers_util
.
DATA_MOUNT_POINT
,
arg_2
)
arg_9
=
providers_util
.
build_recursive_localize_command
(
providers_util
.
DATA_MOUNT_POINT
,
arg_2
,
job_model
.
P_GCS
)
arg_10
=
''
arg_11
=
''
if
arg_6
:
arg_10
=
providers_util
.
build_recursive_gcs_delocalize_env
(
providers_util
.
DATA_MOUNT_POINT
,
arg_3
)
arg_11
=
providers_util
.
build_recursive_delocalize_command
(
providers_util
.
DATA_MOUNT_POINT
,
arg_3
,
job_model
.
P_GCS
)
arg_12
=
[
var
.
docker_path
if
var
.
recursive
else
os
.
path
.
dirname
(
var
.
docker_path
)
for
var
in
arg_3
if
var
.
value
]
arg_13
=
'\n'
.
join
(
[
'mkdir -p {0}/{1}'
.
format
(
providers_util
.
DATA_MOUNT_POINT
,
path
)
for
path
in
arg_12
]
)
arg_14
=
[
var
for
var
in
arg_2
if
not
var
.
recursive
and
var
.
docker_path
and
'*'
in
os
.
path
.
basename
(
var
.
docker_path
)
]
arg_15
=
'\n'
.
join
(
[
'export {0}="{1}/{2}"'
.
format
(
var
.
name
,
providers_util
.
DATA_MOUNT_POINT
,
var
.
docker_path
)
for
var
in
arg_14
]
)
arg_16
=
'\n'
.
join
(
[
'export {0}=""'
.
format
(
var
.
name
)
for
var
in
arg_4
|
arg_2
|
arg_3
if
not
var
.
value
]
)
return
DOCKER_COMMAND
.
format
(
mk_runtime_dirs
=
MK_RUNTIME_DIRS_COMMAND
,
script_path
=
'%s/%s'
%
(
providers_util
.
SCRIPT_DIR
,
arg_1
)
,
arg_7
=
arg_7
,
arg_15
=
arg_15
,
arg_8
=
arg_8
,
arg_9
=
arg_9
,
mk_output_dirs
=
arg_13
,
arg_10
=
arg_10
,
arg_16
=
arg_16
,
tmpdir
=
providers_util
.
TMP_DIR
,
working_dir
=
providers_util
.
WORKING_DIR
,
arg_11
=
arg_11
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Return a multi-line string of the full pipeline docker command."""

    # We upload the user script as an environment argument
    # and write it to SCRIPT_DIR (preserving its local file name).
    #
    # The docker_command:
    # * writes the script body to a file
    # * installs gcloud if there are recursive copies to do
    # * sets environment variables for inputs with wildcards
    # * sets environment variables for recursive input directories
    # * recursively copies input directories
    # * creates output directories
    # * sets environment variables for recursive output directories
    # * sets the DATA_ROOT environment variable to /mnt/data
    # * sets the working directory to ${DATA_ROOT}
    # * executes the user script
    # * recursively copies output directories
    arg_5 = [
        var for var in arg_2 if var.recursive and var.value
    ]
    arg_6 = [
        var for var in arg_3 if var.recursive and var.value
    ]

    arg_7 = ''
    if arg_5 or arg_6:
      arg_7 = INSTALL_CLOUD_SDK

    arg_8 = ''
    arg_9 = ''
    if arg_5:
      arg_8 = providers_util.build_recursive_localize_env(
          providers_util.DATA_MOUNT_POINT, arg_2)
      arg_9 = providers_util.build_recursive_localize_command(
          providers_util.DATA_MOUNT_POINT, arg_2, job_model.P_GCS)

    arg_10 = ''
    arg_11 = ''
    if arg_6:
      arg_10 = providers_util.build_recursive_gcs_delocalize_env(
          providers_util.DATA_MOUNT_POINT, arg_3)
      arg_11 = providers_util.build_recursive_delocalize_command(
          providers_util.DATA_MOUNT_POINT, arg_3, job_model.P_GCS)

    arg_12 = [
        var.docker_path if var.recursive else os.path.dirname(var.docker_path)
        for var in arg_3
        if var.value
    ]

    arg_13 = '\n'.join([
        'mkdir -p {0}/{1}'.format(providers_util.DATA_MOUNT_POINT, path)
        for path in arg_12
    ])

    arg_14 = [
        var for var in arg_2 if not var.recursive and var.docker_path and
        '*' in os.path.basename(var.docker_path)
    ]
    arg_15 = '\n'.join([
        'export {0}="{1}/{2}"'.format(var.name, providers_util.DATA_MOUNT_POINT,
                                      var.docker_path)
        for var in arg_14
    ])

    arg_16 = '\n'.join([
        'export {0}=""'.format(var.name)
        for var in arg_4 | arg_2 | arg_3
        if not var.value
    ])

    return DOCKER_COMMAND.format(
        mk_runtime_dirs=MK_RUNTIME_DIRS_COMMAND,
        script_path='%s/%s' % (providers_util.SCRIPT_DIR, arg_1),
        arg_7=arg_7,
        arg_15=arg_15,
        arg_8=arg_8,
        arg_9=arg_9,
        mk_output_dirs=arg_13,
        arg_10=arg_10,
        arg_16=arg_16,
        tmpdir=providers_util.TMP_DIR,
        working_dir=providers_util.WORKING_DIR,
        arg_11=arg_11)

Return a multi - line string of the full pipeline docker command .