def Func ( arg_0 : arg_1 ) -> Counter : return Counter ( itt . chain . from_iterable ( get_edge_relations ( arg_0 ) . values ( ) ) )

def Func(arg_0: arg_1) -> Counter:
    """Return a histogram of the different types of relations present in a graph.

    Note: this operation only counts each type of edge once for each pair of nodes
    """
    return Counter(itt.chain.from_iterable(get_edge_relations(arg_0).values()))

Return a histogram of the different types of relations present in a graph .


def Func(arg_0, arg_1):
        """Parse command content from the LaTeX source.

        Parameters
        ----------
        source : `str`
            The full source of the tex document.

        Yields
        ------
        Funcd_command : `ParsedCommand`
            Yields Funcd commands instances for each occurence of the command
            in the source.
        """
        arg_2 = arg_0._make_command_regex(arg_0.name)
        for arg_3 in re.finditer(arg_2, arg_1):
            arg_0._logger.debug(arg_3)
            arg_4 = arg_3.start(0)
            yield arg_0._Func_command(arg_1, arg_4)

Parse command content from the LaTeX source.

        Parameters
        ----------
        source : `str`
            The full source of the tex document.

        Yields
        ------
        parsed_command : `ParsedCommand`
            Yields parsed commands instances for each occurence of the command
            in the source.

Parse command content from the LaTeX source .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . hash ( arg_1 ) if os . path . exists ( arg_2 ) : arg_3 = datetime . datetime . fromtimestamp ( os . stat ( arg_2 ) [ 8 ] ) Func = datetime . datetime . today ( ) - arg_3 return Func . days else : return 0

def Func(arg_0, arg_1):

        """ Returns the age of the cache entry, in days.
        """

        arg_2 = arg_0.hash(arg_1)
        if os.path.exists(arg_2):
            arg_3 = datetime.datetime.fromtimestamp(os.stat(arg_2)[8])
            Func = datetime.datetime.today() - arg_3
            return Func.days
        else:
            return 0

Returns the age of the cache entry in days .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split ( '/' ) arg_3 = [ comp [ 1 : - 1 ] for comp in arg_2 if comp . startswith ( '{' ) and comp . endswith ( '}' ) ] arg_4 = [ ] for arg_5 in arg_3 : arg_6 = colander . SchemaNode ( colander . String ( ) , arg_5 = arg_5 ) arg_7 = arg_0 . parameter_converter ( 'path' , arg_6 ) if arg_0 . ref : arg_7 = arg_0 . _ref ( arg_7 ) arg_4 . append ( arg_7 ) return arg_4

def Func(arg_0, arg_1):
        """
        Create a list of Swagger path params from a cornice service path.

        :type path: string
        :rtype: list
        """
        arg_2 = arg_1.split('/')
        arg_3 = [comp[1:-1] for comp in arg_2
                       if comp.startswith('{') and comp.endswith('}')]

        arg_4 = []
        for arg_5 in arg_3:
            arg_6 = colander.SchemaNode(colander.String(), arg_5=arg_5)
            arg_7 = arg_0.parameter_converter('path', arg_6)
            if arg_0.ref:
                arg_7 = arg_0._ref(arg_7)
            arg_4.append(arg_7)

        return arg_4

Create a list of Swagger path params from a cornice service path .


async def Func(arg_0, arg_1):
        """Receive SetTypingNotification and update the conversation.

        Args:
            set_typing_notification: hangouts_pb2.SetTypingNotification
                instance
        """
        arg_2 = arg_1.conversation_id.id
        arg_3 = parsers.parse_typing_status_message(arg_1)
        await arg_0.on_typing.fire(arg_3)
        try:
            arg_4 = await arg_0._get_or_fetch_conversation(arg_2)
        except exceptions.NetworkError:
            logger.warning(
                'Failed to fetch conversation for typing notification: %s',
                arg_2
            )
        else:
            await arg_4.on_typing.fire(arg_3)

Receive SetTypingNotification and update the conversation .


def Func(arg_0, arg_1=None, arg_2=None):
        """Registers a new GBDX task.

        Args:
            task_json (dict): Dictionary representing task definition.
            json_filename (str): A full path of a file with json representing the task definition.
            Only one out of task_json and json_filename should be provided.
        Returns:
            Response (str).
        """
        if not arg_1 and not arg_2:
            raise Exception("Both task json and filename can't be none.")

        if arg_1 and arg_2:
            raise Exception("Both task json and filename can't be provided.")

        if arg_2:
            arg_1 = json.load(open(arg_2, 'r'))

        arg_3 = arg_0.gbdx_connection.post(arg_0._base_url, json=arg_1)
        raise_for_status(arg_3)

        return arg_3.text


def
Func
(
arg_0
=
,
arg_1
=
)
:
if
arg_0
is
:
raise
ValueError
(
"argument 'pbclient' must not be None"
)
if
arg_1
is
:
raise
ValueError
(
"argument 'dc_id' must not be None"
)
arg_2
=
[
]
arg_3
=
arg_0
.
list_servers
(
arg_1
,
1
)
for
arg_4
in
arg_3
[
'items'
]
:
arg_5
=
arg_4
[
'properties'
]
arg_6
=
dict
(
id
=
arg_4
[
'id'
]
,
name
=
arg_5
[
'name'
]
,
state
=
arg_4
[
'metadata'
]
[
'state'
]
,
vmstate
=
arg_5
[
'vmState'
]
)
arg_2
.
append
(
arg_6
)
return
arg_2

def Func(arg_0=None, arg_1=None):
    ''' gets info of servers of a data center'''
    if arg_0 is None:
        raise ValueError("argument 'pbclient' must not be None")
    if arg_1 is None:
        raise ValueError("argument 'dc_id' must not be None")
    # list of all found server's info
    arg_2 = []
    # depth 1 is enough for props/meta
    arg_3 = arg_0.list_servers(arg_1, 1)
    for arg_4 in arg_3['items']:
        arg_5 = arg_4['properties']
        arg_6 = dict(id=arg_4['id'], name=arg_5['name'],
                    state=arg_4['metadata']['state'],
                    vmstate=arg_5['vmState'])
        arg_2.append(arg_6)
    # end for(servers)
    return arg_2


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . dirs . edits = os . path . join ( os . path . realpath ( arg_0 . paramsdict [ "project_dir" ] ) , arg_0 . name + "_edits" ) if not os . path . exists ( arg_0 . dirs . edits ) : os . makedirs ( arg_0 . dirs . edits ) arg_6 = choose_samples ( arg_1 , arg_2 ) if int ( arg_0 . paramsdict [ "filter_adapters" ] ) == 3 : if not arg_0 . _hackersonly [ "p3_adapters_extra" ] : for arg_7 in [ "A" * 8 , "T" * 8 , "C" * 8 , "G" * 8 ] : arg_0 . _hackersonly [ "p3_adapters_extra" ] . append ( arg_7 ) if not arg_0 . _hackersonly [ "p5_adapters_extra" ] : for arg_7 in [ "A" * 8 , "T" * 8 , "C" * 8 , "G" * 8 ] : arg_0 . _hackersonly [ "p5_adapters_extra" ] . append ( arg_7 ) else : arg_0 . _hackersonly [ "p5_adapters_extra" ] = [ ] arg_0 . _hackersonly [ "p3_adapters_extra" ] = [ ] arg_6 = concat_reads ( arg_0 , arg_6 , arg_3 ) arg_9 = arg_3 . load_balanced_view ( targets = arg_3 . ids [ : : 2 ] ) run_cutadapt ( arg_0 , arg_6 , arg_9 ) assembly_cleanup ( arg_0 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Filter for samples that are already finished with this step, allow others
    to run, pass them to parallel client function to filter with cutadapt.
    """

    ## create output directories
    arg_0.dirs.edits = os.path.join(os.path.realpath(
                                   arg_0.paramsdict["project_dir"]),
                                   arg_0.name+"_edits")
    if not os.path.exists(arg_0.dirs.edits):
        os.makedirs(arg_0.dirs.edits)

    ## get samples
    arg_6 = choose_samples(arg_1, arg_2)

    ## only allow extra adapters in filters==3,
    ## and add poly repeats if not in list of adapters
    if int(arg_0.paramsdict["filter_adapters"]) == 3:
        if not arg_0._hackersonly["p3_adapters_extra"]:
            for arg_7 in ["A"*8, "T"*8, "C"*8, "G"*8]:
                arg_0._hackersonly["p3_adapters_extra"].append(arg_7)
        if not arg_0._hackersonly["p5_adapters_extra"]:
            for arg_7 in ["A"*8, "T"*8, "C"*8, "G"*8]:
                arg_0._hackersonly["p5_adapters_extra"].append(arg_7)
    else:
        arg_0._hackersonly["p5_adapters_extra"] = []
        arg_0._hackersonly["p3_adapters_extra"] = []

    ## concat is not parallelized (since it's disk limited, generally)
    arg_6 = concat_reads(arg_0, arg_6, arg_3)

    ## cutadapt is parallelized by ncores/2 because cutadapt spawns threads
    arg_9 = arg_3.load_balanced_view(targets=arg_3.ids[::2])
    run_cutadapt(arg_0, arg_6, arg_9)

    ## cleanup is ...
    assembly_cleanup(arg_0)

Filter for samples that are already finished with this step allow others to run pass them to parallel client function to filter with cutadapt .


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
issubclass
(
arg_0
,
enum
.
Enum
)
:
raise
TypeError
(
"Class '{}' is not subclass of enum."
.
format
(
arg_0
.
__name__
)
)
if
arg_1
is
:
arg_1
=
arg_0
.
__module__
for
arg_2
in
arg_0
:
constant
(
'{}.{}'
.
format
(
arg_1
,
str
(
arg_2
)
)
,
arg_2
)
return
arg_0

def Func(arg_0, arg_1=None):
  """Decorator for an enum class that generates Gin constants from values.

  Generated constants have format `module.ClassName.ENUM_VALUE`. The module
  name is optional when using the constant.

  Args:
    cls: Class type.
    module: The module to associate with the constants, to help handle naming
      collisions. If `None`, `cls.__module__` will be used.

  Returns:
    Class type (identity function).

  Raises:
    TypeError: When applied to a non-enum class.
  """
  if not issubclass(arg_0, enum.Enum):
    raise TypeError("Class '{}' is not subclass of enum.".format(arg_0.__name__))

  if arg_1 is None:
    arg_1 = arg_0.__module__
  for arg_2 in arg_0:
    constant('{}.{}'.format(arg_1, str(arg_2)), arg_2)
  return arg_0

Decorator for an enum class that generates Gin constants from values .


def Func ( arg_0 , arg_1 , arg_2 = '' ) : try : arg_3 = issubclass ( arg_1 , orb . Model ) except StandardError : arg_3 = False if arg_3 : arg_0 . services [ arg_1 . schema ( ) . dbname ( ) ] = ( ModelService , arg_1 ) else : super ( OrbApiFactory , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=''):
        """
        Exposes a given service to this API.
        """
        try:
            arg_3 = issubclass(arg_1, orb.Model)
        except StandardError:
            arg_3 = False

        # expose an ORB table dynamically as a service
        if arg_3:
            arg_0.services[arg_1.schema().dbname()] = (ModelService, arg_1)

        else:
            super(OrbApiFactory, arg_0).Func(arg_1, arg_2=arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = select . select ( [ arg_0 . _stdout ] , [ ] , [ ] , arg_1 ) return bool ( len ( arg_2 ) )

def Func(arg_0, arg_1):
        """
        Poll ``self.stdout`` and return True if it is readable.

        :param float timeout: seconds to wait I/O
        :return: True if readable, else False
        :rtype: boolean
        """
        arg_2, arg_3, arg_4 = select.select([arg_0._stdout], [], [], arg_1)
        return bool(len(arg_2))

Poll self . stdout and return True if it is readable .


def Func(arg_0, arg_1):
        """Compute the SSIM value from the reference image to the target image.

        Args:
          target (str or PIL.Image): Input image to compare the reference image
          to. This may be a PIL Image object or, to save time, an SSIMImage
          object (e.g. the img member of another SSIM object).

        Returns:
          Computed SSIM float value.
        """
        # Performance boost if handed a compatible SSIMImage object.
        if not isinstance(arg_1, SSIMImage) \
          or not np.array_equal(arg_0.gaussian_kernel_1d,
                                arg_1.gaussian_kernel_1d):
            arg_1 = SSIMImage(arg_1, arg_0.gaussian_kernel_1d, arg_0.img.size)

        arg_2 = arg_0.img.img_gray * arg_1.img_gray
        arg_3 = convolve_gaussian_2d(
            arg_2, arg_0.gaussian_kernel_1d)
        arg_4 = arg_0.img.img_gray_mu * arg_1.img_gray_mu
        arg_3 = arg_3 - arg_4

        # Numerator of SSIM
        arg_5 = ((2 * arg_4 + arg_0.c_1) *
                    (2 * arg_3 + arg_0.c_2))

        # Denominator of SSIM
        arg_6 = (
            (arg_0.img.img_gray_mu_squared + arg_1.img_gray_mu_squared +
             arg_0.c_1) *
            (arg_0.img.img_gray_sigma_squared +
             arg_1.img_gray_sigma_squared + arg_0.c_2))

        arg_7 = arg_5 / arg_6
        arg_8 = np.average(arg_7)
        return arg_8

Compute the SSIM value from the reference image to the target image .


def Func(arg_0, arg_1, arg_2=False):
    """
    Compute the learning active state given the predicted state and
    the bottom-up input.

    :param activeColumns list of active bottom-ups
    :param readOnly      True if being called from backtracking logic.
                         This tells us not to increment any segment
                         duty cycles or queue up any updates.
    :returns: True if the current input was sufficiently predicted, OR
             if we started over on startCells. False indicates that the current
             input was NOT predicted, well enough to consider it as "inSequence"

    This looks at:
        - @ref lrnActiveState['t-1']
        - @ref lrnPredictedState['t-1']

    This modifies:
        - @ref lrnActiveState['t']
        - @ref lrnActiveState['t-1']
    """
    # Save previous active state and start out on a clean slate
    arg_0.lrnActiveState['t'].fill(0)

    # For each column, turn on the predicted cell. There will always be at most
    # one predicted cell per column
    arg_3 = 0
    for arg_4 in arg_1:
      arg_5 = numpy.where(arg_0.lrnPredictedState['t-1'][arg_4] == 1)[0]
      arg_6 = len(arg_5)
      assert arg_6 <= 1

      # If we have a predicted cell, turn it on. The segment's posActivation
      # count will have already been incremented by processSegmentUpdates
      if arg_6 == 1:
        arg_7 = arg_5[0]
        arg_0.lrnActiveState['t'][arg_4, arg_7] = 1
        continue

      arg_3 += 1
      if arg_2:
        continue

      # If no predicted cell, pick the closest matching one to reinforce, or
      # if none exists, create a new segment on a cell in that column
      arg_7, arg_9, arg_10 = arg_0._getBestMatchingCell(
          arg_4, arg_0.lrnActiveState['t-1'], arg_0.minThreshold)
      if arg_9 is not None and arg_9.isSequenceSegment():
        if arg_0.verbosity >= 4:
          print "Learn branch 0, found segment match. Learning on col=", arg_4
        arg_0.lrnActiveState['t'][arg_4, arg_7] = 1
        arg_11 = arg_0._getSegmentActiveSynapses(
            arg_4, arg_7, arg_9, arg_0.lrnActiveState['t-1'], newSynapses = True)
        arg_9.totalActivations += 1
        # This will update the permanences, posActivationsCount, and the
        # lastActiveIteration (age).
        arg_12 = arg_0._adaptSegment(arg_11)
        if arg_12:
          arg_0._trimSegmentsInCell(arg_4, arg_7, [arg_9], minPermanence = 0.00001,
                                   minNumSyns = 0)

      # If no close match exists, create a new one
      else:
        # Choose a cell in this column to add a new segment to
        arg_7 = arg_0._getCellForNewSegment(arg_4)
        if (arg_0.verbosity >= 4):
          print "Learn branch 1, no match. Learning on col=", arg_4,
          print ", newCellIdxInCol=", arg_7
        arg_0.lrnActiveState['t'][arg_4, arg_7] = 1
        arg_11 = arg_0._getSegmentActiveSynapses(
            arg_4, arg_7, None, arg_0.lrnActiveState['t-1'], newSynapses=True)
        arg_11.sequenceSegment = True # Make it a sequence segment
        arg_0._adaptSegment(arg_11)  # No need to check whether perm reached 0

    # Determine if we are out of sequence or not and reset our PAM counter
    # if we are in sequence
    arg_14 = len(arg_1)
    if arg_3 < arg_14 / 2:
      return True   # in sequence
    else:
      return False

Compute the learning active state given the predicted state and the bottom - up input .


def Func(arg_0):
        """
        Parse events in machine description to tuple representation used in Benchmark module.

        Examples:
        >>> Func('PERF_EVENT:REG[0-3]')
        ('PERF_EVENT', 'REG[0-3]')
        >>> Func('PERF_EVENT:REG[0-3]:STAY:FOO=23:BAR=0x23')
        ('PERF_EVENT', 'REG[0-3]', {'STAY': None, 'FOO': 23, 'BAR': 35})

        """
        arg_1 = arg_0.split(':')
        assert len(arg_1) >= 2, "Atleast one colon (:) is required in the event name"
        arg_2 = arg_1[:2]
        arg_3 = {}
        for arg_4 in arg_1[2:]:
            if '=' in arg_4:
                arg_5, arg_6 = arg_4.split('=')
                if arg_6.startswith('0x'):
                    arg_3[arg_5] = int(arg_6, 16)
                else:
                    arg_3[arg_5] = int(arg_6)
            else:
                arg_3[arg_4] = None
        arg_2.append(arg_3)
        return tuple(arg_2)

Parse events in machine description to tuple representation used in Benchmark module.

        Examples:
        >>> parse_perfctr_event('PERF_EVENT:REG[0-3]')
        ('PERF_EVENT', 'REG[0-3]')
        >>> parse_perfctr_event('PERF_EVENT:REG[0-3]:STAY:FOO=23:BAR=0x23')
        ('PERF_EVENT', 'REG[0-3]', {'STAY': None, 'FOO': 23, 'BAR': 35})

Parse events in machine description to tuple representation used in Benchmark module .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in enumerate ( arg_0 . interceptors ) : arg_4 = ( type ( arg_3 ) . __name__ == arg_1 or getattr ( arg_3 , 'name' ) == arg_1 ) if arg_4 : arg_0 . interceptors . pop ( arg_2 ) return True return False

def Func(arg_0, arg_1):
        """
        Removes a specific interceptor by name.

        Arguments:
            name (str): interceptor name to disable.

        Returns:
            bool: `True` if the interceptor was disabled, otherwise `False`.
        """
        for arg_2, arg_3 in enumerate(arg_0.interceptors):
            arg_4 = (
                type(arg_3).__name__ == arg_1 or
                getattr(arg_3, 'name') == arg_1
            )
            if arg_4:
                arg_0.interceptors.pop(arg_2)
                return True
        return False

Removes a specific interceptor by name .


def Func ( arg_0 , arg_1 , arg_2 = "normalized_mean_squared_error_loss" ) : if arg_0 . get_shape ( ) . ndims == 2 : arg_3 = tf . sqrt ( tf . reduce_sum ( tf . squared_difference ( arg_0 , arg_1 ) , axis = 1 ) ) arg_4 = tf . sqrt ( tf . reduce_sum ( tf . square ( arg_1 ) , axis = 1 ) ) elif arg_0 . get_shape ( ) . ndims == 3 : arg_3 = tf . sqrt ( tf . reduce_sum ( tf . squared_difference ( arg_0 , arg_1 ) , axis = [ 1 , 2 ] ) ) arg_4 = tf . sqrt ( tf . reduce_sum ( tf . square ( arg_1 ) , axis = [ 1 , 2 ] ) ) elif arg_0 . get_shape ( ) . ndims == 4 : arg_3 = tf . sqrt ( tf . reduce_sum ( tf . squared_difference ( arg_0 , arg_1 ) , axis = [ 1 , 2 , 3 ] ) ) arg_4 = tf . sqrt ( tf . reduce_sum ( tf . square ( arg_1 ) , axis = [ 1 , 2 , 3 ] ) ) arg_5 = tf . reduce_mean ( arg_3 / arg_4 , arg_2 = arg_2 ) return arg_5

def Func(arg_0, arg_1, arg_2="normalized_mean_squared_error_loss"):
    """Return the TensorFlow expression of normalized mean-square-error of two distributions.

    Parameters
    ----------
    output : Tensor
        2D, 3D or 4D tensor i.e. [batch_size, n_feature], [batch_size, height, width] or [batch_size, height, width, channel].
    target : Tensor
        The target distribution, format the same with `output`.
    name : str
        An optional name to attach to this function.

    """
    # with tf.name_scope("normalized_mean_squared_error_loss"):
    if arg_0.get_shape().ndims == 2:  # [batch_size, n_feature]
        arg_3 = tf.sqrt(tf.reduce_sum(tf.squared_difference(arg_0, arg_1), axis=1))
        arg_4 = tf.sqrt(tf.reduce_sum(tf.square(arg_1), axis=1))
    elif arg_0.get_shape().ndims == 3:  # [batch_size, w, h]
        arg_3 = tf.sqrt(tf.reduce_sum(tf.squared_difference(arg_0, arg_1), axis=[1, 2]))
        arg_4 = tf.sqrt(tf.reduce_sum(tf.square(arg_1), axis=[1, 2]))
    elif arg_0.get_shape().ndims == 4:  # [batch_size, w, h, c]
        arg_3 = tf.sqrt(tf.reduce_sum(tf.squared_difference(arg_0, arg_1), axis=[1, 2, 3]))
        arg_4 = tf.sqrt(tf.reduce_sum(tf.square(arg_1), axis=[1, 2, 3]))
    arg_5 = tf.reduce_mean(arg_3 / arg_4, arg_2=arg_2)
    return arg_5

Return the TensorFlow expression of normalized mean - square - error of two distributions .


def Func(arg_0):
    """
    Convert an unstructured event JSON to a list containing one Elasticsearch-compatible key-value pair
    For example, the JSON

    {
      "data": {
        "data": {
          "key": "value"
        },
        "schema": "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1"
      },
      "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0"
    }

    would become

    [
      (
        "unstruct_com_snowplowanalytics_snowplow_link_click_1", {
          "key": "value"
        }
      )
    ]
    """
    arg_1 = json.loads(arg_0)
    arg_2 = arg_1['data']
    arg_3 = arg_2['schema']
    if 'data' in arg_2:
        arg_4 = arg_2['data']
    else:
        raise SnowplowEventTransformationException(["Could not extract inner data field from unstructured event"])
    arg_5 = fix_schema("unstruct_event", arg_3)
    return [(arg_5, arg_4)]

Convert an unstructured event JSON to a list containing one Elasticsearch - compatible key - value pair For example the JSON


(
        config,
        path,
        collector,
        on_report_finish=None,
        output_file=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_5 = get_reports ( ) for arg_6 in arg_0 . get ( 'requested_reports' , [ ] ) : if arg_6 . get ( 'type' ) and arg_6 [ 'type' ] in arg_5 : arg_7 = arg_0 . get ( 'report' , { } ) . get ( arg_6 [ 'type' ] , { } ) arg_7 . update ( arg_6 ) arg_8 = arg_5 [ arg_6 [ 'type' ] ] ( arg_7 , arg_1 , arg_4 = arg_4 , ) arg_8 . produce ( arg_2 ) if arg_3 : arg_3 ( arg_6 )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3=None,
        arg_4=None):
    """
    Executes the configured suite of issue reports.

    :param config: the TidyPy configuration to use
    :type config: dict
    :param path: that path to the project that was analyzed
    :type path: str
    :param collector: the issues to report
    :type collector: tidypy.Collector
    """

    arg_5 = get_reports()
    for arg_6 in arg_0.get('requested_reports', []):
        if arg_6.get('type') and arg_6['type'] in arg_5:
            arg_7 = arg_0.get('report', {}).get(arg_6['type'], {})
            arg_7.update(arg_6)
            arg_8 = arg_5[arg_6['type']](
                arg_7,
                arg_1,
                arg_4=arg_4,
            )
            arg_8.produce(arg_2)
            if arg_3:
                arg_3(arg_6)

Executes the configured suite of issue reports .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = matplotlib . colorbar . make_axes ( matplotlib . pyplot . gca ( ) ) arg_4 = matplotlib . colorbar . ColorbarBase ( arg_2 , arg_0 = arg_0 , arg_1 = arg_1 ) return arg_4

def Func(arg_0, arg_1):
    """Create a colourbar with limits of lwr and upr"""
    arg_2, arg_3 = matplotlib.colorbar.make_axes(matplotlib.pyplot.gca())
    arg_4 = matplotlib.colorbar.ColorbarBase(arg_2, arg_0=arg_0, arg_1=arg_1)
    return arg_4


(self, expdecay_despiker=False, exponent=None,
                noise_despiker=True, win=3, nlim=12., exponentplot=False,
                maxiter=4, autorange_kwargs={}, focus_stage='rawdata')

def Func ( arg_0 , arg_1 = False , arg_2 = None , arg_3 = True , arg_4 = 3 , arg_5 = 12. , arg_6 = False , arg_7 = 4 , arg_8 = { } , arg_9 = 'rawdata' ) : if arg_9 != arg_0 . focus_stage : arg_0 . set_focus ( arg_9 ) if arg_1 and arg_2 is None : if not hasattr ( arg_0 , 'expdecay_coef' ) : arg_0 . find_expcoef ( plot = arg_6 , arg_8 = arg_8 ) arg_2 = arg_0 . expdecay_coef time . sleep ( 0.1 ) with arg_0 . pbar . set ( total = len ( arg_0 . data ) , desc = 'Despiking' ) as prog : for arg_10 in arg_0 . data . values ( ) : arg_10 . Func ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_7 ) prog . update ( ) arg_0 . stages_complete . update ( [ 'Funcd' ] ) arg_0 . focus_stage = 'Funcd' return

def Func(arg_0, arg_1=False, arg_2=None,
                arg_3=True, arg_4=3, arg_5=12., arg_6=False,
                arg_7=4, arg_8={}, arg_9='rawdata'):
        """
        Despikes data with exponential decay and noise filters.

        Parameters
        ----------
        expdecay_Funcr : bool
            Whether or not to apply the exponential decay filter.
        exponent : None or float
            The exponent for the exponential decay filter. If None,
            it is determined automatically using `find_expocoef`.
        tstep : None or float
            The timeinterval between measurements. If None, it is
            determined automatically from the Time variable.
        noise_Funcr : bool
            Whether or not to apply the standard deviation spike filter.
        win : int
            The rolling window over which the spike filter calculates
            the trace statistics.
        nlim : float
            The number of standard deviations above the rolling mean
            that data are excluded.
        exponentplot : bool
            Whether or not to show a plot of the automatically determined
            exponential decay exponent.
        maxiter : int
            The max number of times that the fitler is applied.
        focus_stage : str
            Which stage of analysis to apply processing to.
            Defaults to 'rawdata'. Can be one of:
            * 'rawdata': raw data, loaded from csv file.
            * 'Funcd': Funcd data.
            * 'signal'/'background': isolated signal and background data.
              Created by self.separate, after signal and background
              regions have been identified by self.autorange.
            * 'bkgsub': background subtracted data, created by
              self.bkg_correct
            * 'ratios': element ratio data, created by self.ratio.
            * 'calibrated': ratio data calibrated to standards, created by self.calibrate.

        Returns
        -------
        None
        """
        if arg_9 != arg_0.focus_stage:
            arg_0.set_focus(arg_9)

        if arg_1 and arg_2 is None:
            if not hasattr(arg_0, 'expdecay_coef'):
                arg_0.find_expcoef(plot=arg_6,
                                  arg_8=arg_8)
            arg_2 = arg_0.expdecay_coef
            time.sleep(0.1)

        with arg_0.pbar.set(total=len(arg_0.data), desc='Despiking') as prog:
            for arg_10 in arg_0.data.values():
                arg_10.Func(arg_1, arg_2,
                        arg_3, arg_4, arg_5, arg_7)
                prog.update()

        arg_0.stages_complete.update(['Funcd'])
        arg_0.focus_stage = 'Funcd'
        return

Despikes data with exponential decay and noise filters.

        Parameters
        ----------
        expdecay_despiker : bool
            Whether or not to apply the exponential decay filter.
        exponent : None or float
            The exponent for the exponential decay filter. If None,
            it is determined automatically using `find_expocoef`.
        tstep : None or float
            The timeinterval between measurements. If None, it is
            determined automatically from the Time variable.
        noise_despiker : bool
            Whether or not to apply the standard deviation spike filter.
        win : int
            The rolling window over which the spike filter calculates
            the trace statistics.
        nlim : float
            The number of standard deviations above the rolling mean
            that data are excluded.
        exponentplot : bool
            Whether or not to show a plot of the automatically determined
            exponential decay exponent.
        maxiter : int
            The max number of times that the fitler is applied.
        focus_stage : str
            Which stage of analysis to apply processing to.
            Defaults to 'rawdata'. Can be one of:
            * 'rawdata': raw data, loaded from csv file.
            * 'despiked': despiked data.
            * 'signal'/'background': isolated signal and background data.
              Created by self.separate, after signal and background
              regions have been identified by self.autorange.
            * 'bkgsub': background subtracted data, created by
              self.bkg_correct
            * 'ratios': element ratio data, created by self.ratio.
            * 'calibrated': ratio data calibrated to standards, created by self.calibrate.

        Returns
        -------
        None

Despikes data with exponential decay and noise filters .


(self, metric_store, groupby_name, aggregate_timestamp)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Organize and store the count of data from the log line into the metric store by columnm, group name, timestamp

    :param dict metric_store: The metric store used to store all the parsed the log data
    :param string groupby_name: the group name that the log line belongs to
    :param string aggregate_timestamp: timestamp used for storing the raw data. This accounts for aggregation time period
    :return: None
    """
    arg_4 = arg_1['qps']
    arg_5 = arg_4[arg_2]
    if arg_3 in arg_5:
      arg_5[arg_3] += 1
    else:
      arg_5[arg_3] = 1
    return None

Organize and store the count of data from the log line into the metric store by columnm group name timestamp


(
            self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=False, arg_6=True, **arg_7):
        """Moves resources from one resource group to another resource group.

        The resources to move must be in the same source resource group. The
        target resource group may be in a different subscription. When moving
        resources, both the source group and the target group are locked for
        the duration of the operation. Write and delete operations are blocked
        on the groups until the move completes. .

        :param source_resource_group_name: The name of the resource group
         containing the resources to move.
        :type source_resource_group_name: str
        :param resources: The IDs of the resources.
        :type resources: list[str]
        :param target_resource_group: The target resource group.
        :type target_resource_group: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        arg_8 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=True,
            **arg_7
        )

        def get_long_running_output(arg_9):
            if arg_5:
                arg_10 = ClientRawResponse(None, arg_9)
                return arg_10

        arg_11 = arg_7.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_6 is True: arg_12 = ARMPolling(arg_11, **arg_7)
        elif arg_6 is False: arg_12 = NoPolling()
        else: arg_12 = arg_6
        return LROPoller(arg_0._client, arg_8, get_long_running_output, arg_12)

Moves resources from one resource group to another resource group .


(code, fname, stdin=None, stdout=None, stderr=None,
                        executable=None, independent=False, extra_arguments=[],
                        cwd=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = False , arg_7 = [ ] , arg_8 = None ) : if arg_5 is None : arg_5 = sys . executable arg_9 = [ arg_5 , '-c' , arg_0 , '-f' , arg_1 ] arg_9 . extend ( arg_7 ) arg_10 = True arg_11 = PIPE if arg_2 is None else arg_2 arg_12 = sys . executable . endswith ( 'pythonw.exe' ) if arg_12 : arg_13 = PIPE if arg_3 is None else arg_3 arg_14 = PIPE if arg_4 is None else arg_4 else : arg_13 , arg_14 = arg_3 , arg_4 if sys . platform == 'win32' : arg_15 = ParentPollerWindows . create_interrupt_event ( ) arg_9 += [ '--interrupt=%i' % arg_15 ] if arg_5 . endswith ( 'pythonw.exe' ) : if arg_3 is None : arg_9 . append ( '--no-stdout' ) if arg_4 is None : arg_9 . append ( '--no-stderr' ) if arg_6 : arg_16 = Popen ( arg_9 , creationflags = 512 , arg_2 = arg_11 , arg_3 = arg_13 , arg_4 = arg_14 ) else : try : from _winapi import DuplicateHandle , GetCurrentProcess , DUPLICATE_SAME_ACCESS except : from _subprocess import DuplicateHandle , GetCurrentProcess , DUPLICATE_SAME_ACCESS arg_17 = GetCurrentProcess ( ) arg_18 = DuplicateHandle ( arg_17 , arg_17 , arg_17 , 0 , True , DUPLICATE_SAME_ACCESS ) arg_16 = Popen ( arg_9 + [ '--parent=%i' % int ( arg_18 ) ] , arg_2 = arg_11 , arg_3 = arg_13 , arg_4 = arg_14 ) arg_16 . win32_interrupt_event = arg_15 else : if arg_6 : arg_16 = Popen ( arg_9 , preexec_fn = lambda : os . setsid ( ) , arg_2 = arg_11 , arg_3 = arg_13 , arg_4 = arg_14 , arg_8 = arg_8 ) else : arg_16 = Popen ( arg_9 + [ '--parent=1' ] , arg_2 = arg_11 , arg_3 = arg_13 , arg_4 = arg_14 , arg_8 = arg_8 ) if arg_10 : if arg_2 is None : arg_16 . stdin . close ( ) if arg_12 : if arg_3 is None : arg_16 . stdout . close ( ) if arg_4 is None : arg_16 . stderr . close ( ) return arg_16

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
                        arg_5=None, arg_6=False, arg_7=[],
                        arg_8=None):
    """ Launches a localhost kernel, binding to the specified ports.

    Parameters
    ----------
    code : str,
        A string of Python code that imports and executes a kernel entry point.

    stdin, stdout, stderr : optional (default None)
        Standards streams, as defined in subprocess.Popen.

    fname : unicode, optional
        The JSON connector file, containing ip/port/hmac key information.

    key : str, optional
        The Session key used for HMAC authentication.

    executable : str, optional (default sys.executable)
        The Python executable to use for the kernel process.

    independent : bool, optional (default False)
        If set, the kernel process is guaranteed to survive if this process
        dies. If not set, an effort is made to ensure that the kernel is killed
        when this process dies. Note that in this case it is still good practice
        to kill kernels manually before exiting.

    extra_arguments : list, optional
        A list of extra arguments to pass when executing the launch code.

    cwd : path, optional
        The working dir of the kernel process (default: cwd of this process).

    Returns
    -------
    A tuple of form:
        (kernel_process, shell_port, iopub_port, stdin_port, hb_port)
    where kernel_process is a Popen object and the ports are integers.
    """

    # Build the kernel launch command.
    if arg_5 is None:
        arg_5 = sys.executable
    arg_9 = [ arg_5, '-c', arg_0, '-f', arg_1 ]
    arg_9.extend(arg_7)

    # Popen will fail (sometimes with a deadlock) if stdin, stdout, and stderr
    # are invalid. Unfortunately, there is in general no way to detect whether
    # they are valid.  The following two blocks redirect them to (temporary)
    # pipes in certain important cases.

    # If this process has been backgrounded, our stdin is invalid. Since there
    # is no compelling reason for the kernel to inherit our stdin anyway, we'll
    # place this one safe and always redirect.
    arg_10 = True
    arg_11 = PIPE if arg_2 is None else arg_2

    # If this process in running on pythonw, we know that stdin, stdout, and
    # stderr are all invalid.
    arg_12 = sys.executable.endswith('pythonw.exe')
    if arg_12:
        arg_13 = PIPE if arg_3 is None else arg_3
        arg_14 = PIPE if arg_4 is None else arg_4
    else:
        arg_13, arg_14 = arg_3, arg_4

    # Spawn a kernel.
    if sys.platform == 'win32':
        # Create a Win32 event for interrupting the kernel.
        arg_15 = ParentPollerWindows.create_interrupt_event()
        arg_9 += [ '--interrupt=%i'%arg_15 ]

        # If the kernel is running on pythonw and stdout/stderr are not been
        # re-directed, it will crash when more than 4KB of data is written to
        # stdout or stderr. This is a bug that has been with Python for a very
        # long time; see http://bugs.python.org/issue706263.
        # A cleaner solution to this problem would be to pass os.devnull to
        # Popen directly. Unfortunately, that does not work.
        if arg_5.endswith('pythonw.exe'):
            if arg_3 is None:
                arg_9.append('--no-stdout')
            if arg_4 is None:
                arg_9.append('--no-stderr')

        # Launch the kernel process.
        if arg_6:
            arg_16 = Popen(arg_9,
                         creationflags=512, # CREATE_NEW_PROCESS_GROUP
                         arg_2=arg_11, arg_3=arg_13, arg_4=arg_14)
        else:
            try:
                from _winapi import DuplicateHandle, GetCurrentProcess, \
                    DUPLICATE_SAME_ACCESS
            except:
                from _subprocess import DuplicateHandle, GetCurrentProcess, \
                    DUPLICATE_SAME_ACCESS
            arg_17 = GetCurrentProcess()
            arg_18 = DuplicateHandle(arg_17, arg_17, arg_17, 0,
                                     True, # Inheritable by new processes.
                                     DUPLICATE_SAME_ACCESS)
            arg_16 = Popen(arg_9 + ['--parent=%i'%int(arg_18)],
                         arg_2=arg_11, arg_3=arg_13, arg_4=arg_14)

        # Attach the interrupt event to the Popen objet so it can be used later.
        arg_16.win32_interrupt_event = arg_15

    else:
        if arg_6:
            arg_16 = Popen(arg_9, preexec_fn=lambda: os.setsid(),
                         arg_2=arg_11, arg_3=arg_13, arg_4=arg_14, arg_8=arg_8)
        else:
            arg_16 = Popen(arg_9 + ['--parent=1'],
                         arg_2=arg_11, arg_3=arg_13, arg_4=arg_14, arg_8=arg_8)

    # Clean up pipes created to work around Popen bug.
    if arg_10:
        if arg_2 is None:
            arg_16.stdin.close()
    if arg_12:
        if arg_3 is None:
            arg_16.stdout.close()
        if arg_4 is None:
            arg_16.stderr.close()

    return arg_16

Launches a localhost kernel binding to the specified ports .


def Func(arg_0, arg_1, arg_2):
        """
        Transform the body of an ``ExampleGroup``.

        ``body`` is the body.
        ``group_var`` is the name bound to the example group in the context
        manager (usually "it").

        """

        for arg_3 in arg_1:
            arg_4, = arg_3.items
            arg_5 = arg_4.context_expr

            arg_6 = arg_5.args[0].s
            arg_7 = arg_4.optional_vars.id

            yield arg_0.transform_example(arg_3, arg_6, arg_7, arg_2)


return np.array([self.x_scale, self.y_scale, self.z_scale])

def Func ( arg_0 ) : return np . array ( [ arg_0 . x_scale , arg_0 . y_scale , arg_0 . z_scale ] )

def Func(arg_0):
        """ Returns the scaling values of x, y, z as a numpy array
        """
        return np.array([arg_0.x_scale, arg_0.y_scale, arg_0.z_scale])

Returns the scaling values of x y z as a numpy array


def Func():
    """Assumed called on Travis, to prepare a package to be deployed

    This method prints on stdout for Travis.
    Return is obj to pass to sys.exit() directly
    """

    arg_0 = os.environ.get('TRAVIS_TAG')
    if not arg_0:
        print("TRAVIS_TAG environment variable is not present")
        return "TRAVIS_TAG environment variable is not present"

    try:
        arg_1, arg_2 = arg_0.split("_")
    except ValueError:
        print("TRAVIS_TAG is not '<package_name>_<version>' (tag is: {})".format(arg_0))
        return "TRAVIS_TAG is not '<package_name>_<version>' (tag is: {})".format(arg_0)

    try:
        arg_2 = Version(arg_2)
    except InvalidVersion:
        print("Version must be a valid PEP440 version (version is: {})".format(arg_2))
        return "Version must be a valid PEP440 version (version is: {})".format(arg_2)

    if arg_1.lower() in OMITTED_RELEASE_PACKAGES:
        print("The input package {} has been disabled for release from Travis.CI.".format(arg_1))
        return

    arg_3 = Path(os.environ['TRAVIS_BUILD_DIR'], 'dist')
    create_package(arg_1, str(arg_3))

    print("Produced:\n{}".format(list(arg_3.glob('*'))))

    arg_4 = "*{}*".format(arg_2)
    arg_5 = list(arg_3.glob(arg_4))
    if not arg_5:
        return "Package version does not match tag {}, abort".format(arg_2)
    arg_6 = os.environ.get("PYPI_SERVER", "default PyPI server")
    print("Package created as expected and will be pushed to {}".format(arg_6))

Assumed called on Travis to prepare a package to be deployed


def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
round_teff_luminosity
(
arg_0
)
arg_3
,
arg_4
=
arg_1
,
arg_2
arg_5
,
arg_6
=
hr_diagram_color_helper
(
arg_1
)
arg_7
=
[
max
(
arg_3
)
+
max
(
arg_3
)
*
0.05
,
min
(
arg_3
)
min
(
arg_3
)
*
0.05
]
arg_8
=
ColumnDataSource
(
data
=
dict
(
arg_3
=
arg_3
,
arg_4
=
arg_4
,
color
=
arg_5
)
)
arg_9
=
figure
(
y_axis_type
=
'log'
,
arg_7
=
arg_7
,
name
=
'hr'
,
tools
=
'box_select,lasso_select,reset,hover'
,
title
=
'H-R Diagram for {0}'
.
format
(
arg_0
.
name
)
)
arg_9
.
select
(
arg_11
)
.
select_every_mousemove
=
False
arg_9
.
select
(
arg_13
)
.
select_every_mousemove
=
False
arg_14
=
arg_9
.
select
(
HoverTool
)
[
0
]
arg_14
.
tooltips
=
[
(
"Temperature (Kelvin)"
,
"@x{0}"
)
,
(
"Luminosity (solar units)"
,
"@y{0.00}"
)
]
_diagram
(
arg_8
=
arg_8
,
plot_figure
=
arg_9
,
name
=
'hr'
,
color
=
{
'field'
:
'color'
,
'transform'
:
arg_6
}
,
xaxis_label
=
'Temperature (Kelvin)'
,
yaxis_label
=
'Luminosity (solar units)'
)
return
arg_9

def Func(arg_0):
    """
    Given a cluster create a Bokeh plot figure creating an
    H-R diagram.
    """
    arg_1, arg_2 = round_teff_luminosity(arg_0)
    arg_3, arg_4 = arg_1, arg_2
    arg_5, arg_6 = hr_diagram_color_helper(arg_1)
    arg_7 = [max(arg_3) + max(arg_3) * 0.05, min(arg_3) - min(arg_3) * 0.05]
    arg_8 = ColumnDataSource(data=dict(arg_3=arg_3, arg_4=arg_4, color=arg_5))

    arg_9 = figure(y_axis_type='log', arg_7=arg_7, name='hr',
                tools='box_select,lasso_select,reset,hover',
                title='H-R Diagram for {0}'.format(arg_0.name))
    arg_9.select(arg_11).select_every_mousemove = False
    arg_9.select(arg_13).select_every_mousemove = False
    arg_14 = arg_9.select(HoverTool)[0]
    arg_14.tooltips = [("Temperature (Kelvin)", "@x{0}"),
                      ("Luminosity (solar units)", "@y{0.00}")]
    _diagram(arg_8=arg_8, plot_figure=arg_9, name='hr',
             color={'field': 'color', 'transform': arg_6},
             xaxis_label='Temperature (Kelvin)',
             yaxis_label='Luminosity (solar units)')
    return arg_9

Given a cluster create a Bokeh plot figure creating an H - R diagram .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = super ( ) . Func ( arg_1 , arg_2 ) arg_5 = arg_0 . root . context [ "view" ] arg_4 [ "view_name" ] = arg_5 . get_url_name ( "detail" ) return arg_3 , arg_4

def Func(arg_0, arg_1, arg_2):
        """
        This is needed due to DRF's model serializer uses the queryset to build url name

        # TODO: Move this to own serializer mixin or fix problem elsewhere?
        """
        arg_3, arg_4 = super().Func(arg_1, arg_2)

        arg_5 = arg_0.root.context["view"]
        arg_4["view_name"] = arg_5.get_url_name("detail")

        return arg_3, arg_4

This is needed due to DRF s model serializer uses the queryset to build url name


def Func(arg_0, arg_1):
        """Init the optimizer.

        Args:
            optimizer (dict or :obj:`~torch.optim.Optimizer`): Either an
                optimizer object or a dict used for constructing the optimizer.

        Returns:
            :obj:`~torch.optim.Optimizer`: An optimizer object.

        Examples:
            >>> optimizer = dict(type='SGD', lr=0.01, momentum=0.9)
            >>> type(runner.Func(optimizer))
            <class 'torch.optim.sgd.SGD'>
        """
        if isinstance(arg_1, dict):
            arg_1 = obj_from_dict(
                arg_1, torch.optim, dict(params=arg_0.model.parameters()))
        elif not isinstance(arg_1, torch.optim.Optimizer):
            raise TypeError(
                'optimizer must be either an Optimizer object or a dict, '
                'but got {}'.format(type(arg_1)))
        return arg_1

Init the optimizer.

        Args:
            optimizer (dict or :obj:`~torch.optim.Optimizer`): Either an
                optimizer object or a dict used for constructing the optimizer.

        Returns:
            :obj:`~torch.optim.Optimizer`: An optimizer object.

        Examples:
            >>> optimizer = dict(type='SGD', lr=0.01, momentum=0.9)
            >>> type(runner.init_optimizer(optimizer))
            <class 'torch.optim.sgd.SGD'>


def Func(arg_0):
    """Parse a single literal value.

    Returns:
      The parsed value.
    """
    arg_1 = [
        arg_0._maybe_parse_container, arg_0._maybe_parse_basic_type,
        arg_0._maybe_parse_configurable_reference, arg_0._maybe_parse_macro
    ]
    for arg_2 in arg_1:
      arg_3, arg_4 = arg_2()
      if arg_3:
        return arg_4
    arg_0._raise_syntax_error('Unable to parse value.')


Returns the edge between the nodes with given id1 and id2.

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 in arg_0 and arg_2 in arg_0 and arg_0 [ arg_2 ] in arg_0 [ arg_1 ] . links : return arg_0 [ arg_1 ] . links . Func ( arg_2 ) return None

def Func(arg_0, arg_1, arg_2):
        """ Returns the Func between the nodes with given id1 and id2.
        """
        if arg_1 in arg_0 and \
           arg_2 in arg_0 and \
           arg_0[arg_2] in arg_0[arg_1].links:
            return arg_0[arg_1].links.Func(arg_2)
        return None

Returns the edge between the nodes with given id1 and id2 .


def Func ( arg_0 , arg_1 ) : arg_2 = imp . load_source ( '' , arg_1 ) arg_0 . update ( arg_2 . Stages )

def Func(arg_0, arg_1):
        '''Add external stages from the Python module in `path`.

        `path` must be a path to a Python module source that contains
        a `Stages` dictionary, which is a map from stage name to callable.

        :param str path: path to the module file
        '''
        arg_2 = imp.load_source('', arg_1)
        arg_0.update(arg_2.Stages)

Add external stages from the Python module in path .


def Func ( arg_0 , arg_1 , arg_2 = 0 ) : if arg_1 is None : return None if arg_1 < 8 and arg_2 > 0 : arg_1 += 8 arg_3 = arg_0 . color_map . get ( arg_1 , None ) if isinstance ( arg_3 , basestring ) : return QtGui . QColor ( arg_3 ) elif isinstance ( arg_3 , ( tuple , list ) ) : return QtGui . QColor ( * arg_3 ) return None

def Func(arg_0, arg_1, arg_2=0):
        """ Returns a QColor for a given color code, or None if one cannot be
            constructed.
        """
        if arg_1 is None:
            return None

        # Adjust for intensity, if possible.
        if arg_1 < 8 and arg_2 > 0:
            arg_1 += 8

        arg_3 = arg_0.color_map.get(arg_1, None)
        if isinstance(arg_3, basestring):
            # If this is an X11 color name, we just hope there is a close SVG
            # color name. We could use QColor's static method
            # 'setAllowX11ColorNames()', but this is global and only available
            # on X11. It seems cleaner to aim for uniformity of behavior.
            return QtGui.QColor(arg_3)

        elif isinstance(arg_3, (tuple, list)):
            return QtGui.QColor(*arg_3)

        return None

Returns a QColor for a given color code or None if one cannot be constructed .


(self, hql, schema='default', hive_conf=None)

return self.get_results(hql, schema=schema, hive_conf=hive_conf)['data']

def Func ( arg_0 , arg_1 , arg_2 = 'default' , arg_3 = None ) : return arg_0 . get_results ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) [ 'data' ]

def Func(arg_0, arg_1, arg_2='default', arg_3=None):
        """
        Get a set of records from a Hive query.

        :param hql: hql to be executed.
        :type hql: str or list
        :param schema: target schema, default to 'default'.
        :type schema: str
        :param hive_conf: hive_conf to execute alone with the hql.
        :type hive_conf: dict
        :return: result of hive execution
        :rtype: list

        >>> hh = HiveServer2Hook()
        >>> sql = "SELECT * FROM airflow.static_babynames LIMIT 100"
        >>> len(hh.Func(sql))
        100
        """
        return arg_0.get_results(arg_1, arg_2=arg_2, arg_3=arg_3)['data']

Get a set of records from a Hive query.

        :param hql: hql to be executed.
        :type hql: str or list
        :param schema: target schema, default to 'default'.
        :type schema: str
        :param hive_conf: hive_conf to execute alone with the hql.
        :type hive_conf: dict
        :return: result of hive execution
        :rtype: list

        >>> hh = HiveServer2Hook()
        >>> sql = "SELECT * FROM airflow.static_babynames LIMIT 100"
        >>> len(hh.get_records(sql))
        100

Get a set of records from a Hive query .


def Func(arg_0, arg_1):
    """ meaning pvalues presorted i descending order"""

    arg_2 = len(arg_0)
    arg_3 = (arg_0 > arg_1).sum() / ((1 - arg_1)*arg_2)

    arg_4 = np.ones(arg_2)
    print("pFDR    y        Pr     fastPow")
    for arg_5 in range(arg_2):
        arg_6 = arg_0[arg_5]
        arg_7 = max(1, arg_2 - arg_5) / float(arg_2)
        arg_4[arg_5] = (arg_3 * arg_6) / (arg_7 * (1 - math.pow(1-arg_6, arg_2)))
        print(arg_5, arg_4[arg_5], arg_6, arg_7, 1.0 - math.pow(1-arg_6, arg_2))

    arg_8 = arg_3*arg_2
    arg_9 = arg_2 - arg_8
    arg_10 = np.array(range(arg_2))
    arg_11 = arg_2 - arg_10
    arg_12 = arg_11 / float(arg_2)

    arg_13 = np.ones(arg_2)
    arg_13[0] = arg_4[0]
    for arg_5 in range(arg_2-1):
        arg_13[arg_5+1] = min(arg_13[arg_5], arg_4[arg_5+1])

    arg_14 = ((1.0 - arg_13) * arg_11) / arg_9
    arg_14[arg_14 > 1.0] = 1.0

    arg_15 = pd.DataFrame(dict(
        pvalue=arg_0,
        qvalue=arg_13,
        FDR=arg_4,
        percentile_positive=arg_12,
        arg_14=arg_14
    ))

    arg_15["svalue"] = arg_15.sens[::-1].cummax()[::-1]

    return arg_15, arg_8, arg_2


return [
            tag
            for tag
            in self.list_tags()
            if name_or_id == tag.get('id')
            or name_or_id == tag.get('name')
        ]

def Func ( arg_0 , arg_1 ) : return [ arg_2 for arg_2 in arg_0 . list_tags ( ) if arg_1 == arg_2 . Func ( 'id' ) or arg_1 == arg_2 . Func ( 'name' ) ]

def Func(arg_0, arg_1):
        """
        Get alert by name or id

        :param name_or_id: The alert's name or id
        :type name_or_id: str

        :return: A list of matching tags. An empty list is returned if there are
            not any matches
        :rtype: list of dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        return [
            arg_2
            for arg_2
            in arg_0.list_tags()
            if arg_1 == arg_2.Func('id')
            or arg_1 == arg_2.Func('name')
        ]


return [n for n in self.nodes if n.category == category]

def Func ( arg_0 , arg_1 ) : return [ arg_2 for arg_2 in arg_0 . nodes if arg_2 . category == arg_1 ]

def Func(arg_0, arg_1):
        """ Returns nodes with the given category attribute.
        """
        return [arg_2 for arg_2 in arg_0.nodes if arg_2.category == arg_1]

Returns nodes with the given category attribute .


(local_folder, parent_folder_id,
                            reuse_existing=False)

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = os . path . basename ( arg_0 ) arg_4 = None if arg_2 : arg_5 = session . communicator . folder_children ( session . token , arg_1 ) arg_6 = arg_5 [ 'folders' ] for arg_7 in arg_6 : if arg_7 [ 'name' ] == arg_3 : arg_4 = arg_7 [ 'folder_id' ] break if arg_4 is None : arg_8 = session . communicator . create_folder ( session . token , arg_3 , arg_1 ) arg_4 = arg_8 [ 'folder_id' ] return arg_4

def Func(arg_0, arg_1,
                            arg_2=False):
    """
    Create a folder from the local file in the midas folder corresponding to
    the parent folder id.

    :param local_folder: full path to a directory on the local file system
    :type local_folder: string
    :param parent_folder_id: id of parent folder on the Midas Server instance,
        where the folder will be added
    :type parent_folder_id: int | long
    :param reuse_existing: (optional) whether to accept an existing folder of
       the same name in the same location, or create a new one instead
    :type reuse_existing: bool
    """
    arg_3 = os.path.basename(arg_0)
    arg_4 = None
    if arg_2:
        # check by name to see if the folder already exists in the folder
        arg_5 = session.communicator.folder_children(
            session.token, arg_1)
        arg_6 = arg_5['folders']

        for arg_7 in arg_6:
            if arg_7['name'] == arg_3:
                arg_4 = arg_7['folder_id']
                break

    if arg_4 is None:
        # create the item for the subdir
        arg_8 = session.communicator.create_folder(session.token,
                                                        arg_3,
                                                        arg_1)
        arg_4 = arg_8['folder_id']

    return arg_4

Create a folder from the local file in the midas folder corresponding to the parent folder id .


return [Pod(elem) for elem in self.xml_tree.findall('pod')]

def Func ( arg_0 ) : if not arg_0 . xml_tree : return [ ] return [ Pod ( arg_1 ) for arg_1 in arg_0 . xml_tree . findall ( 'pod' ) ]

def Func(arg_0):
        """Return list of all Pod objects in result"""
        # Return empty list if xml_tree is not defined (error Result object)
        if not arg_0.xml_tree:
            return []

        # Create a Pod object for every pod group in xml
        return [Pod(arg_1) for arg_1 in arg_0.xml_tree.findall('pod')]


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . number arg_0 . bpbynumber [ arg_2 ] = None arg_4 = ( arg_1 . filename , arg_1 . line ) if arg_4 not in arg_0 . bplist : return False arg_0 . bplist [ arg_4 ] . remove ( arg_1 ) if not arg_0 . bplist [ arg_4 ] : del arg_0 . bplist [ arg_4 ] return True

def Func(arg_0, arg_1):
        " remove breakpoint `bp'"
        arg_2 = arg_1.number
        arg_0.bpbynumber[arg_2] = None   # No longer in list
        arg_4 = (arg_1.filename, arg_1.line)
        if arg_4 not in arg_0.bplist: return False
        arg_0.bplist[arg_4].remove(arg_1)
        if not arg_0.bplist[arg_4]:
            # No more breakpoints for this file:line combo
            del arg_0.bplist[arg_4]
        return True


return has_image and not src_file_changed

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . format ( 1 ) arg_3 = os . path . exists ( arg_2 ) arg_4 = check_md5sum_change ( arg_0 ) return arg_3 and not arg_4

def Func(arg_0, arg_1):
    """Test existence of image file and no change in md5sum of
    example"""

    arg_2 = arg_1.format(1)
    arg_3 = os.path.exists(arg_2)
    arg_4 = check_md5sum_change(arg_0)

    return arg_3 and not arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = get_actions ( arg_0 ) for arg_3 in arg_2 : if arg_3 . get ( 'name' ) == arg_1 : return arg_3

def Func(arg_0, arg_1):
  """Return the value for the specified action."""
  arg_2 = get_actions(arg_0)
  for arg_3 in arg_2:
    if arg_3.get('name') == arg_1:
      return arg_3

Return the value for the specified action .


(self, texts: List[str], retry_count: int = 0)

def Func(arg_0, arg_1: arg_2[arg_3], arg_4: arg_5 = 0) -> arg_2[arg_3]:
        '''
        Processes the texts using TweeboParse and returns them in CoNLL format.

        :param texts: The List of Strings to be processed by TweeboParse.
        :param retry_count: The number of times it has retried for. Default
                            0 does not require setting, main purpose is for
                            recursion.
        :return: A list of CoNLL formated strings.
        :raises ServerError: Caused when the server is not running.
        :raises :py:class:`requests.exceptions.HTTPError`: Caused when the
                input texts is not formated correctly e.g. When you give it a
                String not a list of Strings.
        :raises :py:class:`json.JSONDecodeError`: Caused if after self.retries
                attempts to parse the data it cannot decode the data.

        :Example:

        '''
        arg_6 = {'texts': arg_1, 'output_type': 'conll'}
        try:
            arg_7 = requests.post(f'http://{self.hostname}:{self.port}',
                                     json=arg_6,
                                     headers={'Connection': 'close'})
            arg_7.raise_for_status()
        except (requests.exceptions.ConnectionError,
                requests.exceptions.Timeout) as server_error:
            raise ServerError(server_error, arg_0.hostname, arg_0.port)
        except requests.exceptions.HTTPError as http_error:
            raise http_error
        else:
            try:
                return arg_7.json()
            except json.JSONDecodeError as json_exception:
                if arg_4 == arg_0.retries:
                    arg_0.log_error(arg_7.text)
                    raise Exception('Json Decoding error cannot parse this '
                                    f':\n{response.text}')
                return arg_0.Func(arg_1, arg_4 + 1)

Processes the texts using TweeboParse and returns them in CoNLL format .


(fname, fpointer, lrange="1,6-", sdir=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
"1,6-"
,
arg_3
=
)
:
arg_4
=
(
arg_3
if
arg_3
else
os
.
environ
.
get
(
"TRACER_DIR"
,
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)
)
)
)
arg_0
=
os
.
path
.
join
(
arg_4
,
arg_0
)
with
open
(
arg_0
)
as
fobj
:
arg_5
=
fobj
.
readlines
(
)
arg_6
=
[
item
.
strip
(
)
for
item
in
arg_2
.
split
(
","
)
]
arg_7
=
[
]
for
arg_8
in
arg_6
:
if
"-"
in
arg_8
:
arg_9
=
arg_8
.
split
(
"-"
)
arg_10
,
arg_11
=
(
int
(
arg_9
[
0
]
)
,
int
(
arg_9
[
1
]
)
if
arg_9
[
1
]
else
len
(
arg_5
)
,
)
for
arg_12
in
range
(
arg_10
,
arg_11
+
1
)
:
arg_7
.
append
(
arg_12
)
else
:
arg_7
.
append
(
int
(
arg_8
)
)
arg_1
(
".. code-block:: python\n"
)
arg_1
(
"\n"
)
for
arg_12
,
arg_13
in
enumerate
(
arg_5
)
:
if
arg_12
+
1
in
arg_7
:
arg_1
(
"    "
+
arg_13
.
replace
(
"\t"
,
"    "
)
if
arg_13
.
strip
(
)
else
"\n"
)
arg_1
(
"\n"
)

def Func(arg_0, arg_1, arg_2="1,6-", arg_3=None):
    r"""
    Include a Python source file in a docstring formatted in reStructuredText.

    :param fname: File name, relative to environment variable
                  :bash:`${TRACER_DIR}`
    :type  fname: string

    :param fpointer: Output function pointer. Normally is :code:`cog.out` but
                     :code:`print` or other functions can be used for
                     debugging
    :type  fpointer: function object

    :param lrange: Line range to include, similar to Sphinx
                   `literalinclude <http://sphinx-doc.org/markup/code.html
                   #directive-literalinclude>`_ directive
    :type  lrange: string

    :param sdir: Source file directory. If None the :bash:`${TRACER_DIR}`
                 environment variable is used if it is defined, otherwise
                 the directory where the :code:`docs.support.Func` module
                 is located is used
    :type  sdir: string

    For example:

    .. code-block:: python

        def func():
            \"\"\"
            This is a docstring. This file shows how to use it:

            .. =[=cog
            .. import docs.support.Func
            .. docs.support.Func.Func('func_example.py', cog.out)
            .. =]=
            .. code-block:: python

                # func_example.py
                if __name__ == '__main__':
                    func()

            .. =[=end=]=
            \"\"\"
            return 'This is func output'
    """
    # Read file
    arg_4 = (
        arg_3
        if arg_3
        else os.environ.get("TRACER_DIR", os.path.abspath(os.path.dirname(__file__)))
    )
    arg_0 = os.path.join(arg_4, arg_0)
    with open(arg_0) as fobj:
        arg_5 = fobj.readlines()
    # Parse line specification
    arg_6 = [item.strip() for item in arg_2.split(",")]
    arg_7 = []
    for arg_8 in arg_6:
        if "-" in arg_8:
            arg_9 = arg_8.split("-")
            arg_10, arg_11 = (
                int(arg_9[0]),
                int(arg_9[1]) if arg_9[1] else len(arg_5),
            )
            for arg_12 in range(arg_10, arg_11 + 1):
                arg_7.append(arg_12)
        else:
            arg_7.append(int(arg_8))
    # Produce output
    arg_1(".. code-block:: python\n")
    arg_1("\n")
    for arg_12, arg_13 in enumerate(arg_5):
        if arg_12 + 1 in arg_7:
            arg_1("    " + arg_13.replace("\t", "    ") if arg_13.strip() else "\n")
    arg_1("\n")

r"""
    Include a Python source file in a docstring formatted in reStructuredText.

    :param fname: File name, relative to environment variable
                  :bash:`${TRACER_DIR}`
    :type  fname: string

    :param fpointer: Output function pointer. Normally is :code:`cog.out` but
                     :code:`print` or other functions can be used for
                     debugging
    :type  fpointer: function object

    :param lrange: Line range to include, similar to Sphinx
                   `literalinclude <http://sphinx-doc.org/markup/code.html
                   #directive-literalinclude>`_ directive
    :type  lrange: string

    :param sdir: Source file directory. If None the :bash:`${TRACER_DIR}`
                 environment variable is used if it is defined, otherwise
                 the directory where the :code:`docs.support.incfile` module
                 is located is used
    :type  sdir: string

    For example:

    .. code-block:: python

        def func():
            \"\"\"
            This is a docstring. This file shows how to use it:

            .. =[=cog
            .. import docs.support.incfile
            .. docs.support.incfile.incfile('func_example.py', cog.out)
            .. =]=
            .. code-block:: python

                # func_example.py
                if __name__ == '__main__':
                    func()

            .. =[=end=]=
            \"\"\"
            return 'This is func output'

r Include a Python source file in a docstring formatted in reStructuredText .


(self, desc, version=None, ignore_3D=False)

return self._register(desc, version, ignore_3D)

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        r"""Register descriptors.

        Descriptor-like:
            * Descriptor instance: self
            * Descriptor class: use Descriptor.preset() method
            * module: use Descriptor-likes in module
            * Iterable: use Descriptor-likes in Iterable

        Parameters:
            desc(Descriptor-like): descriptors to Func
            version(str): version
            ignore_3D(bool): ignore 3D descriptors

        """
        if arg_2 is None:
            arg_2 = __version__

        arg_2 = StrictVersion(arg_2)
        return arg_0._Func(arg_1, arg_2, arg_3)

r"""Register descriptors.

        Descriptor-like:
            * Descriptor instance: self
            * Descriptor class: use Descriptor.preset() method
            * module: use Descriptor-likes in module
            * Iterable: use Descriptor-likes in Iterable

        Parameters:
            desc(Descriptor-like): descriptors to register
            version(str): version
            ignore_3D(bool): ignore 3D descriptors


def Func ( arg_0 ) : with open ( arg_0 , 'rb' ) as fh : arg_1 = True try : arg_2 , arg_3 , arg_4 = read_next_header_keyword ( fh ) try : assert arg_2 == b'HEADER_START' except AssertionError : arg_1 = False except KeyError : arg_1 = False return arg_1

def Func(arg_0):
    """ Open file and confirm if it is a filterbank file or not. """
    with open(arg_0, 'rb') as fh:
        arg_1 = True

        # Check this is a blimpy file
        try:
            arg_2, arg_3, arg_4 = read_next_header_keyword(fh)
            try:
                assert arg_2 == b'HEADER_START'
            except AssertionError:
                arg_1 = False
        except KeyError:
            arg_1 = False
        return arg_1

Open file and confirm if it is a filterbank file or not .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 0 ) : arg_0 = scatter ( arg_0 , arg_2 , arg_3 ) if arg_0 else [ ] arg_1 = scatter ( arg_1 , arg_2 , arg_3 ) if arg_1 else [ ] if len ( arg_0 ) < len ( arg_1 ) : arg_0 . extend ( [ ( ) for arg_4 in range ( len ( arg_1 ) - len ( arg_0 ) ) ] ) elif len ( arg_1 ) < len ( arg_0 ) : arg_1 . extend ( [ { } for arg_4 in range ( len ( arg_0 ) - len ( arg_1 ) ) ] ) arg_0 = tuple ( arg_0 ) arg_1 = tuple ( arg_1 ) return arg_0 , arg_1

def Func(arg_0, arg_1, arg_2, arg_3=0):
    """Scatter with support for kwargs dictionary"""
    arg_0 = scatter(arg_0, arg_2, arg_3) if arg_0 else []
    arg_1 = scatter(arg_1, arg_2, arg_3) if arg_1 else []
    if len(arg_0) < len(arg_1):
        arg_0.extend([() for arg_4 in range(len(arg_1) - len(arg_0))])
    elif len(arg_1) < len(arg_0):
        arg_1.extend([{} for arg_4 in range(len(arg_0) - len(arg_1))])
    arg_0 = tuple(arg_0)
    arg_1 = tuple(arg_1)
    return arg_0, arg_1


return urlunparse((scheme, netloc, '/'.join(segments),
                       params, query, fragment))

def Func(arg_0, arg_1, arg_2=True):
    """Join a base URL and a possibly relative URL to form an absolute
    interpretation of the latter."""
    if not arg_0:
        return arg_1
    if not arg_1:
        return arg_0
    arg_3, arg_4, arg_5, arg_6, arg_7, arg_8 = \
            urlparse(arg_0, '', arg_2)
    arg_9, arg_10, arg_11, arg_12, arg_13, arg_14 = \
            urlparse(arg_1, arg_3, arg_2)
    if arg_9 != arg_3 or arg_9 not in uses_relative:
        return arg_1
    if arg_9 in uses_netloc:
        if arg_10:
            return urlunparse((arg_9, arg_10, arg_11,
                               arg_12, arg_13, arg_14))
        arg_10 = arg_4
    if arg_11[:1] == '/':
        return urlunparse((arg_9, arg_10, arg_11,
                           arg_12, arg_13, arg_14))
    if not arg_11 and not arg_12:
        arg_11 = arg_5
        arg_12 = arg_6
        if not arg_13:
            arg_13 = arg_7
        return urlunparse((arg_9, arg_10, arg_11,
                           arg_12, arg_13, arg_14))
    arg_15 = arg_5.split('/')[:-1] + arg_11.split('/')
    # XXX The stuff below is bogus in various ways...
    if arg_15[-1] == '.':
        arg_15[-1] = ''
    while '.' in arg_15:
        arg_15.remove('.')
    while 1:
        arg_16 = 1
        arg_17 = len(arg_15) - 1
        while arg_16 < arg_17:
            if (arg_15[arg_16] == '..'
                and arg_15[arg_16-1] not in ('', '..')):
                del arg_15[arg_16-1:arg_16+1]
                break
            arg_16 = arg_16+1
        else:
            break
    if arg_15 == ['', '..']:
        arg_15[-1] = ''
    elif len(arg_15) >= 2 and arg_15[-1] == '..':
        arg_15[-2:] = ['']
    return urlunparse((arg_9, arg_10, '/'.join(arg_15),
                       arg_12, arg_13, arg_14))

Join a base URL and a possibly relative URL to form an absolute interpretation of the latter .


def
Func
(
arg_0
)
:
arg_1
=
as_integer_type
(
arg_0
.
Ks
)
if
arg_1
.
ndim
!=
1
:
raise
TypeError
(
"Ks should be 1-dim, got shape {}"
.
format
(
arg_1
.
shape
)
)
if
arg_1
.
min
(
)
<
1
:
raise
ValueError
(
"Ks should be positive; got {}"
.
format
(
arg_1
.
min
(
)
)
)
return
arg_1

def Func(arg_0):
        "Ks as an array and type-checked."
        arg_1 = as_integer_type(arg_0.Ks)
        if arg_1.ndim != 1:
            raise TypeError("Ks should be 1-dim, got shape {}".format(arg_1.shape))
        if arg_1.min() < 1:
            raise ValueError("Ks should be positive; got {}".format(arg_1.min()))
        return arg_1


def Func ( arg_0 ) : arg_0 . mem_overhead = ( arg_0 . _process . memory_info ( ) . rss - builtins . initial_rss_size )

def Func(arg_0):
        """Returns memory overhead."""
        arg_0.mem_overhead = (arg_0._process.memory_info().rss -
                             builtins.initial_rss_size)


async def Func ( arg_0 ) : while True : await asyncio . sleep ( arg_0 . _Func_timeout ) if arg_0 . closed : return arg_1 = generate_query ( b'\xEE\x01\x01' ) await arg_0 . _send_data ( arg_1 )

async def Func(arg_0):
        """A workaround for Satel Integra disconnecting after 25s.

        Every interval it sends some random question to the device, ignoring
        answer - just to keep connection alive.
        """
        while True:
            await asyncio.sleep(arg_0._Func_timeout)
            if arg_0.closed:
                return
            # Command to read status of the alarm
            arg_1 = generate_query(b'\xEE\x01\x01')
            await arg_0._send_data(arg_1)

A workaround for Satel Integra disconnecting after 25s .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = category_map . get ( arg_0 . get_value ( arg_1 , arg_3 ) , None ) if not arg_4 : return None try : return Category . objects . get ( arg_4 = arg_4 ) except Category . DoesNotExist : pass

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Converts the text category to a tasks.Category instance.
        """
        # Get and checks for the corresponding slug
        arg_4 = category_map.get(arg_0.get_value(arg_1, arg_3), None)
        if not arg_4:
            return None
        # Load the category instance
        try:
            return Category.objects.get(arg_4=arg_4)
        except Category.DoesNotExist:
            pass

Converts the text category to a tasks . Category instance .


def
Func
(
arg_0
)
:
arg_1
=
_ffi
.
new
(
"unsigned char **"
)
arg_2
=
_ffi
.
new
(
"unsigned int *"
)
_lib
.
SSL_get0_alpn_selected
(
arg_0
.
_ssl
,
arg_1
,
arg_2
)
if
not
arg_2
:
return
b''
return
_ffi
.
buffer
(
arg_1
[
0
]
,
arg_2
[
0
]
)
[
:
]

def Func(arg_0):
        """
        Get the protocol that was negotiated by ALPN.

        :returns: A bytestring of the protocol name.  If no protocol has been
            negotiated yet, returns an empty string.
        """
        arg_1 = _ffi.new("unsigned char **")
        arg_2 = _ffi.new("unsigned int *")

        _lib.SSL_get0_alpn_selected(arg_0._ssl, arg_1, arg_2)

        if not arg_2:
            return b''

        return _ffi.buffer(arg_1[0], arg_2[0])[:]

Get the protocol that was negotiated by ALPN .


Checks existence of the model file, loads the model if the file exists

def
Func
(
arg_0
)
->
:
if
arg_0
.
Func_path
.
exists
(
)
:
arg_1
=
str
(
arg_0
.
Func_path
.
resolve
(
)
)
log
.
info
(
'[Funcing model from {}]'
.
format
(
arg_1
)
)
arg_0
.
_net
.
Func
(
arg_1
)

def Func(arg_0) -> None:
        """Checks existence of the model file, Funcs the model if the file exists"""

        # Checks presence of the model files
        if arg_0.Func_path.exists():
            arg_1 = str(arg_0.Func_path.resolve())
            log.info('[Funcing model from {}]'.format(arg_1))
            arg_0._net.Func(arg_1)

Checks existence of the model file loads the model if the file exists


(context, institute, case_id, display_name)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Delete a case and it's variants from the database"""
    arg_4 = arg_0.obj['adapter']
    if not (arg_2 or arg_3):
        click.echo("Please specify what case to delete")
        arg_0.abort()

    if arg_3:
        if not arg_1:
            click.echo("Please specify the owner of the case that should be "
                       "deleted with flag '-i/--institute'.")
            arg_0.abort()
        arg_2 = "{0}-{1}".format(arg_1, arg_3)

    LOG.info("Running deleting case {0}".format(arg_2))
    Func = arg_4.delete_case(
        arg_2=arg_2,
        institute_id=arg_1,
        arg_3=arg_3
    )

    if Func.deleted_count == 1:
        arg_4.delete_variants(arg_2=arg_2, variant_type='clinical')
        arg_4.delete_variants(arg_2=arg_2, variant_type='research')
    else:
        LOG.warning("Case does not exist in database")
        arg_0.abort()

Delete a case and it s variants from the database


(quadrature_grid_and_probs,
                                      dtype,
                                      validate_args,
                                      name=None)

def Func(arg_0,
                                      arg_1,
                                      arg_2,
                                      arg_3=None):
  """Validates quadrature grid, probs or computes them as necessary.

  Args:
    quadrature_grid_and_probs: Python pair of `float`-like `Tensor`s
      representing the sample points and the corresponding (possibly
      normalized) weight.  When `None`, defaults to:
        `np.polynomial.hermite.hermgauss(deg=8)`.
    dtype: The expected `dtype` of `grid` and `probs`.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    name: Python `str` name prefixed to Ops created by this class.

  Returns:
     quadrature_grid_and_probs: Python pair of `float`-like `Tensor`s
      representing the sample points and the corresponding (possibly
      normalized) weight.

  Raises:
    ValueError: if `quadrature_grid_and_probs is not None` and
      `len(quadrature_grid_and_probs[0]) != len(quadrature_grid_and_probs[1])`
  """
  with tf.name_scope(arg_3 or "Func"):
    if arg_0 is None:
      arg_4, arg_5 = np.polynomial.hermite.hermgauss(deg=8)
      arg_4 = arg_4.astype(dtype_util.as_numpy_dtype(arg_1))
      arg_5 = arg_5.astype(dtype_util.as_numpy_dtype(arg_1))
      arg_5 /= np.linalg.norm(arg_5, ord=1, keepdims=True)
      arg_4 = tf.convert_to_tensor(value=arg_4, arg_3="grid", arg_1=arg_1)
      arg_5 = tf.convert_to_tensor(value=arg_5, arg_3="probs", arg_1=arg_1)
      return arg_4, arg_5

    arg_4, arg_5 = tuple(arg_0)
    arg_4 = tf.convert_to_tensor(value=arg_4, arg_3="grid", arg_1=arg_1)
    arg_5 = tf.convert_to_tensor(
        value=arg_5, arg_3="unnormalized_probs", arg_1=arg_1)
    arg_5 /= tf.norm(tensor=arg_5, ord=1, axis=-1, keepdims=True, arg_3="probs")

    def _static_event_size(arg_6):
      """Returns the static size of a specific dimension or `None`."""
      return tf.compat.dimension_value(
          tensorshape_util.with_rank_at_least(arg_6.shape, 1)[-1])

    arg_7, arg_8 = _static_event_size(arg_5), _static_event_size(arg_4)
    if arg_7 is not None and arg_8 is not None:
      if arg_7 != arg_8:
        raise ValueError("`quadrature_grid_and_probs` must be a `tuple` of "
                         "same-length zero-th-dimension `Tensor`s "
                         "(saw lengths {}, {})".format(arg_7, arg_8))
    elif arg_2:
      arg_9 = [
          assert_util.assert_equal(
              dimension_size(arg_5, axis=-1),
              dimension_size(arg_4, axis=-1),
              message=("`quadrature_grid_and_probs` must be a `tuple` of "
                       "same-length zero-th-dimension `Tensor`s")),
      ]
      with tf.control_dependencies(arg_9):
        arg_4 = tf.identity(arg_4)
        arg_5 = tf.identity(arg_5)
    return arg_4, arg_5

Validates quadrature grid probs or computes them as necessary .


def Func(arg_0, arg_1):
        """
        Parses the specified child task node, and returns the task spec. This
        can be called by a TaskParser instance, that is owned by this
        ProcessParser.
        """

        if arg_1.get('id') in arg_0.parsed_nodes:
            return arg_0.parsed_nodes[arg_1.get('id')]

        (arg_2, arg_3) = arg_0.parser._get_parser_class(arg_1.tag)
        if not arg_2 or not arg_3:
            raise ValidationException(
                "There is no support implemented for this task type.",
                arg_1=arg_1, filename=arg_0.filename)
        arg_4 = arg_2(arg_0, arg_3, arg_1)
        arg_5 = arg_4.Func()

        return arg_5

Parses the specified child task node and returns the task spec . This can be called by a TaskParser instance that is owned by this ProcessParser .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : def _isvalid ( arg_3 , arg_4 ) : arg_5 = dirname ( arg_3 ) while arg_5 and arg_5 != arg_4 : if not exists ( join ( arg_5 , '__init__.py' ) ) : return False arg_5 = dirname ( arg_5 ) return True arg_6 = arg_0 . replace ( '.' , os . path . sep ) arg_7 = [ arg_6 + '.py' , ] arg_7 += [ arg_6 + arg_8 for arg_8 in _platform_pylib_exts ( ) ] if arg_1 is None : arg_1 = sys . path arg_9 = [ '.' if arg_10 == '' else arg_10 for arg_10 in arg_1 ] if arg_2 : def normalize ( arg_10 ) : if sys . platform . startswith ( 'win32' ) : return realpath ( arg_10 ) . lower ( ) else : return realpath ( arg_10 ) arg_11 = { normalize ( arg_10 ) for arg_10 in arg_2 } arg_9 = [ arg_10 for arg_10 in arg_9 if normalize ( arg_10 ) not in arg_11 ] for arg_12 in arg_9 : arg_3 = join ( arg_12 , arg_6 ) if exists ( arg_3 ) : if isfile ( join ( arg_3 , '__init__.py' ) ) : if _isvalid ( arg_3 , arg_12 ) : return arg_3 for arg_13 in arg_7 : arg_3 = join ( arg_12 , arg_13 ) if isfile ( arg_3 ) : if _isvalid ( arg_3 , arg_12 ) : return arg_3

def Func(arg_0, arg_1=None, arg_2=None):
    """
    syspath version of modname_to_modpath

    Args:
        modname (str): name of module to find
        sys_path (List[PathLike], default=None):
            if specified overrides `sys.path`
        exclude (List[PathLike], default=None):
            list of directory paths. if specified prevents these directories
            from being searched.

    Notes:
        This is much slower than the pkgutil mechanisms.

    CommandLine:
        python -m xdoctest.static_analysis Func

    Example:
        >>> print(Func('xdoctest.static_analysis'))
        ...static_analysis.py
        >>> print(Func('xdoctest'))
        ...xdoctest
        >>> print(Func('_ctypes'))
        ..._ctypes...
        >>> assert Func('xdoctest', sys_path=[]) is None
        >>> assert Func('xdoctest.static_analysis', sys_path=[]) is None
        >>> assert Func('_ctypes', sys_path=[]) is None
        >>> assert Func('this', sys_path=[]) is None

    Example:
        >>> # test what happens when the module is not visible in the path
        >>> modname = 'xdoctest.static_analysis'
        >>> modpath = Func(modname)
        >>> exclude = [split_modpath(modpath)[0]]
        >>> found = Func(modname, exclude=exclude)
        >>> # this only works if installed in dev mode, pypi fails
        >>> assert found is None, 'should not have found {}'.format(found)
    """

    def _isvalid(arg_3, arg_4):
        # every directory up to the module, should have an init
        arg_5 = dirname(arg_3)
        while arg_5 and arg_5 != arg_4:
            if not exists(join(arg_5, '__init__.py')):
                return False
            arg_5 = dirname(arg_5)
        return True

    arg_6 = arg_0.replace('.', os.path.sep)
    arg_7 = [
        arg_6 + '.py',
        # _fname_we + '.pyc',
        # _fname_we + '.pyo',
    ]
    # Add extension library suffixes
    arg_7 += [arg_6 + arg_8 for arg_8 in _platform_pylib_exts()]

    if arg_1 is None:
        arg_1 = sys.path

    # the empty string in sys.path indicates cwd. Change this to a '.'
    arg_9 = ['.' if arg_10 == '' else arg_10 for arg_10 in arg_1]

    if arg_2:
        def normalize(arg_10):
            if sys.platform.startswith('win32'):  # nocover
                return realpath(arg_10).lower()
            else:
                return realpath(arg_10)
        # Keep only the paths not in exclude
        arg_11 = {normalize(arg_10) for arg_10 in arg_2}
        arg_9 = [arg_10 for arg_10 in arg_9
                            if normalize(arg_10) not in arg_11]

    for arg_12 in arg_9:
        # Check for directory-based modules (has presidence over files)
        arg_3 = join(arg_12, arg_6)
        if exists(arg_3):
            if isfile(join(arg_3, '__init__.py')):
                if _isvalid(arg_3, arg_12):
                    return arg_3

        # If that fails, check for file-based modules
        for arg_13 in arg_7:
            arg_3 = join(arg_12, arg_13)
            if isfile(arg_3):
                if _isvalid(arg_3, arg_12):
                    return arg_3

syspath version of modname_to_modpath

    Args:
        modname (str): name of module to find
        sys_path (List[PathLike], default=None):
            if specified overrides `sys.path`
        exclude (List[PathLike], default=None):
            list of directory paths. if specified prevents these directories
            from being searched.

    Notes:
        This is much slower than the pkgutil mechanisms.

    CommandLine:
        python -m xdoctest.static_analysis _syspath_modname_to_modpath

    Example:
        >>> print(_syspath_modname_to_modpath('xdoctest.static_analysis'))
        ...static_analysis.py
        >>> print(_syspath_modname_to_modpath('xdoctest'))
        ...xdoctest
        >>> print(_syspath_modname_to_modpath('_ctypes'))
        ..._ctypes...
        >>> assert _syspath_modname_to_modpath('xdoctest', sys_path=[]) is None
        >>> assert _syspath_modname_to_modpath('xdoctest.static_analysis', sys_path=[]) is None
        >>> assert _syspath_modname_to_modpath('_ctypes', sys_path=[]) is None
        >>> assert _syspath_modname_to_modpath('this', sys_path=[]) is None

    Example:
        >>> # test what happens when the module is not visible in the path
        >>> modname = 'xdoctest.static_analysis'
        >>> modpath = _syspath_modname_to_modpath(modname)
        >>> exclude = [split_modpath(modpath)[0]]
        >>> found = _syspath_modname_to_modpath(modname, exclude=exclude)
        >>> # this only works if installed in dev mode, pypi fails
        >>> assert found is None, 'should not have found {}'.format(found)


def Func ( arg_0 , arg_1 = None ) : arg_2 = [ ] for arg_3 in arg_0 . all_params : if arg_1 is None : arg_2 . append ( arg_3 . eval ( ) ) else : arg_2 . append ( arg_1 . run ( arg_3 ) ) return arg_2

def Func(arg_0, arg_1=None):
        """Return the parameters in a list of array."""
        arg_2 = []
        for arg_3 in arg_0.all_params:
            if arg_1 is None:
                arg_2.append(arg_3.eval())
            else:
                arg_2.append(arg_1.run(arg_3))
        return arg_2

Return the parameters in a list of array .


Wait for filedescriptors or timeout.
            Adds the current process to the corresponding waiting list and
            yields the cpu to another running process.

def Func(arg_0, arg_1, arg_2, arg_3):
        """ Wait for filedescriptors or timeout.
            Adds the current process to the corresponding Funcing list and
            yields the cpu to another running process.
        """
        logger.info("WAIT:")
        logger.info("\tProcess %d is going to Func for [ %r %r %r ]", arg_0._current, arg_1, arg_2, arg_3)
        logger.info("\tProcess: %r", arg_0.procs)
        logger.info("\tRunning: %r", arg_0.running)
        logger.info("\tRWait: %r", arg_0.rFunc)
        logger.info("\tTWait: %r", arg_0.tFunc)
        logger.info("\tTimers: %r", arg_0.timers)

        for arg_4 in arg_1:
            arg_0.rFunc[arg_4].add(arg_0._current)
        for arg_4 in arg_2:
            arg_0.tFunc[arg_4].add(arg_0._current)
        if arg_3 is not None:
            arg_0.timers[arg_0._current] = arg_0.clocks + arg_3
        else:
            arg_0.timers[arg_0._current] = None
        arg_7 = arg_0._current
        # self.sched()
        arg_8 = (arg_0.running.index(arg_7) + 1) % len(arg_0.running)
        arg_0._current = arg_0.running[arg_8]
        logger.info("\tTransfer control from process %d to %d", arg_7, arg_0._current)
        logger.info("\tREMOVING %r from %r. Current: %r", arg_7, arg_0.running, arg_0._current)
        arg_0.running.remove(arg_7)
        if arg_0._current not in arg_0.running:
            logger.info("\tCurrent not running. Checking for timers...")
            arg_0._current = None
            if all([arg_9 is None for arg_9 in arg_0.timers]):
                raise Deadlock()
            arg_0.check_timers()

Wait for filedescriptors or timeout . Adds the current process to the corresponding waiting list and yields the cpu to another running process .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
{
}
for
arg_3
in
listdir
(
arg_1
)
:
arg_4
,
arg_5
=
splitext
(
arg_3
)
if
arg_4
in
arg_2
or
arg_4
==
"__pycache__"
:
continue
if
(
arg_5
in
PY_EXTS
and
arg_4
!=
"__init__"
or
(
not
arg_5
and
isdir
(
join
(
arg_1
,
arg_4
)
)
)
)
:
try
:
arg_6
=
modutils
.
load_module_from_file
(
join
(
arg_1
,
arg_3
)
)
except
ValueError
:
continue
except
ImportError
as
exc
:
print
(
"Problem importing module %s: %s"
%
(
arg_3
,
exc
)
,
file
=
sys
.
stderr
)
else
:
if
hasattr
(
arg_6
,
"register"
)
:
arg_6
.
register
(
arg_0
)
arg_2
[
arg_4
]
=
1

def Func(arg_0, arg_1):
    """load all module and package in the given directory, looking for a
    'register' function in each one, used to register pylint checkers
    """
    arg_2 = {}
    for arg_3 in listdir(arg_1):
        arg_4, arg_5 = splitext(arg_3)
        if arg_4 in arg_2 or arg_4 == "__pycache__":
            continue
        if (
            arg_5 in PY_EXTS
            and arg_4 != "__init__"
            or (not arg_5 and isdir(join(arg_1, arg_4)))
        ):
            try:
                arg_6 = modutils.load_module_from_file(join(arg_1, arg_3))
            except ValueError:
                # empty module name (usually emacs auto-save files)
                continue
            except ImportError as exc:
                print(
                    "Problem importing module %s: %s" % (arg_3, exc), file=sys.stderr
                )
            else:
                if hasattr(arg_6, "register"):
                    arg_6.register(arg_0)
                    arg_2[arg_4] = 1

load all module and package in the given directory looking for a register function in each one used to register pylint checkers


def
Func
(
arg_0
)
:
from
.
config
import
NATIONS_DEFAULT_MAP
arg_1
=
[
]
for
arg_2
in
arg_0
:
if
arg_2
[
0
]
==
'v'
:
arg_3
=
[
x
.
replace
(
'.'
,
''
)
for
x
in
arg_2
[
1
]
.
split
(
', '
)
]
arg_4
=
filter
(
lambda
x
:
x
is
not
,
map
(
NATIONS_DEFAULT_MAP
.
get
,
arg_3
)
)
if
'CERN'
in
arg_4
and
'Switzerland'
in
arg_4
:
arg_4
=
[
x
for
x
in
arg_4
if
x
!=
'Switzerland'
]
arg_1
.
extend
(
arg_4
)
arg_1
=
sorted
(
list
(
set
(
arg_1
)
)
)
if
arg_1
:
arg_0
.
extend
(
[
(
'w'
,
arg_5
)
for
arg_5
in
arg_1
]
)
else
:
arg_0
.
append
(
(
'w'
,
'HUMAN CHECK'
)
)

def Func(arg_0):
    """Add correct nations field according to mapping in NATIONS_DEFAULT_MAP."""
    from .config import NATIONS_DEFAULT_MAP
    arg_1 = []
    for arg_2 in arg_0:
        if arg_2[0] == 'v':
            arg_3 = [x.replace('.', '') for x in arg_2[1].split(', ')]
            arg_4 = filter(lambda x: x is not None,
                                   map(NATIONS_DEFAULT_MAP.get, arg_3))
            if 'CERN' in arg_4 and 'Switzerland' in arg_4:
                # Don't use remove in case of multiple Switzerlands
                arg_4 = [x for x in arg_4
                                 if x != 'Switzerland']

            arg_1.extend(arg_4)

    arg_1 = sorted(list(set(arg_1)))

    if arg_1:
        arg_0.extend([('w', arg_5) for arg_5 in arg_1])
    else:
        arg_0.append(('w', 'HUMAN CHECK'))

Add correct nations field according to mapping in NATIONS_DEFAULT_MAP .


def Func(arg_0):
        """
        Deletes all SSH keys on the localhost associated with the current remote host.
        """
        arg_1 = arg_0.local_renderer
        arg_1.env.default_ip = arg_0.hostname_to_ip(arg_0.env.default_hostname)
        arg_1.env.home_dir = '/home/%s' % getpass.getuser()
        arg_1.local('ssh-keygen -f "{home_dir}/.ssh/known_hosts" -R {host_string}')
        if arg_0.env.default_hostname:
            arg_1.local('ssh-keygen -f "{home_dir}/.ssh/known_hosts" -R {default_hostname}')
        if arg_1.env.default_ip:
            arg_1.local('ssh-keygen -f "{home_dir}/.ssh/known_hosts" -R {default_ip}')

Deletes all SSH keys on the localhost associated with the current remote host .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ExtensionDebugger ( 'Func' ) for arg_4 in arg_0 . exts : with arg_3 ( arg_4 ) : arg_2 = arg_4 . Func ( arg_1 , arg_2 ) return arg_2

def Func(arg_0, arg_1, arg_2):
        """
        Called at the end of processing.  This call allows extensions to
        emit any additional data, such as timing information, prior to
        ``timid``'s exit.  Extensions may also alter the return value.

        :param ctxt: An instance of ``timid.context.Context``.
        :param result: The return value of the basic ``timid`` call,
                       or an ``Exception`` instance if an exception
                       was raised.  Without the extension, this would
                       be passed directly to ``sys.exit()``.

        :returns: The final result.
        """

        arg_3 = ExtensionDebugger('Func')

        for arg_4 in arg_0.exts:
            with arg_3(arg_4):
                arg_2 = arg_4.Func(arg_1, arg_2)

        return arg_2

Called at the end of processing . This call allows extensions to emit any additional data such as timing information prior to timid s exit . Extensions may also alter the return value .


def Func ( arg_0 ) : arg_1 = topology_pb2 . Component ( ) arg_1 . name = arg_0 . name arg_1 . spec = topology_pb2 . ComponentObjectSpec . Value ( "PYTHON_CLASS_NAME" ) arg_1 . class_name = arg_0 . python_class_path arg_1 . config . CopyFrom ( arg_0 . _get_comp_config ( ) ) return arg_1

def Func(arg_0):
    """Returns Component protobuf message"""
    arg_1 = topology_pb2.Component()
    arg_1.name = arg_0.name
    arg_1.spec = topology_pb2.ComponentObjectSpec.Value("PYTHON_CLASS_NAME")
    arg_1.class_name = arg_0.python_class_path
    arg_1.config.CopyFrom(arg_0._get_comp_config())
    return arg_1


def Func ( ) : if not os . path . exists ( CONFIG_PATH ) : write_config ( { } ) with open ( CONFIG_PATH ) as f : return json . load ( f )

def Func():
    """Gets the configuration for this project from the default JSON file, or writes one if it doesn't exist

    :rtype: dict
    """
    if not os.path.exists(CONFIG_PATH):
        write_config({})

    with open(CONFIG_PATH) as f:
        return json.load(f)

Gets the configuration for this project from the default JSON file or writes one if it doesn t exist


def Func ( arg_0 , arg_1 = 'detail' ) : arg_0 = copy . deepcopy ( arg_0 ) arg_0 [ 'detail' ] = arg_0 [ arg_1 ] arg_2 = [ sportsref . nfl . pbp . parse_play_details ( detail ) for detail in arg_0 [ 'detail' ] . values ] arg_3 = { c for d in arg_2 if d for c in d . keys ( ) } arg_4 = { c : np . nan for c in arg_3 } arg_5 = [ d if d else arg_4 for d in arg_2 ] arg_6 = pd . DataFrame ( arg_5 ) arg_0 = pd . merge ( arg_0 , arg_6 , left_index = True , right_index = True ) arg_7 = [ i for i , d in enumerate ( arg_2 ) if d is None ] arg_0 [ 'isError' ] = False arg_0 . loc [ arg_7 , 'isError' ] = True arg_0 . loc [ 0 , 'qtr_time_remain' ] = '15:00' arg_0 . qtr_time_remain . fillna ( method = 'bfill' , inplace = True ) arg_0 . qtr_time_remain . fillna ( pd . Series ( np . where ( arg_0 . quarter == 4 , '0:00' , '15:00' ) ) , inplace = True ) arg_9 = arg_0 . apply ( _clean_features , axis = 1 ) return arg_9

def Func(arg_0, arg_1='detail'):
    """Expands the details column of the given dataframe and returns the
    resulting DataFrame.

    :df: The input DataFrame.
    :detailCol: The detail column name.
    :returns: Returns DataFrame with new columns from pbp parsing.
    """
    arg_0 = copy.deepcopy(arg_0)
    arg_0['detail'] = arg_0[arg_1]
    arg_2 = [sportsref.nfl.pbp.parse_play_details(detail) for detail in arg_0['detail'].values]
    # clean up unmatched details
    arg_3 = {c for d in arg_2 if d for c in d.keys()}
    arg_4 = {c: np.nan for c in arg_3}
    arg_5 = [d if d else arg_4 for d in arg_2]
    # get details DataFrame and merge it with original to create main DataFrame
    arg_6 = pd.DataFrame(arg_5)
    arg_0 = pd.merge(arg_0, arg_6, left_index=True, right_index=True)
    # add isError column
    arg_7 = [i for i, d in enumerate(arg_2) if d is None]
    arg_0['isError'] = False
    arg_0.loc[arg_7, 'isError'] = True
    # fill in some NaN's necessary for _clean_features
    arg_0.loc[0, 'qtr_time_remain'] = '15:00'
    arg_0.qtr_time_remain.fillna(method='bfill', inplace=True)
    arg_0.qtr_time_remain.fillna(
        pd.Series(np.where(arg_0.quarter == 4, '0:00', '15:00')), inplace=True
    )
    # use _clean_features to clean up and add columns
    arg_9 = arg_0.apply(_clean_features, axis=1)
    return arg_9

Expands the details column of the given dataframe and returns the resulting DataFrame .


def Func ( arg_0 , arg_1 = None ) : arg_1 = resolve_color_default ( arg_1 ) if not isinstance ( arg_0 , string_types ) : arg_0 = text_type ( arg_0 ) from . _termui_impl import pager return pager ( arg_0 + '\n' , arg_1 )

def Func(arg_0, arg_1=None):
    """This function takes a text and shows it via an environment specific
    pager on stdout.

    .. versionchanged:: 3.0
       Added the `color` flag.

    :param text: the text to page.
    :param color: controls if the pager supports ANSI colors or not.  The
                  default is autodetection.
    """
    arg_1 = resolve_color_default(arg_1)
    if not isinstance(arg_0, string_types):
        arg_0 = text_type(arg_0)
    from ._termui_impl import pager
    return pager(arg_0 + '\n', arg_1)

This function takes a text and shows it via an environment specific pager on stdout .


def Func ( arg_0 , arg_1 = ( 0 , 1 ) , arg_2 = None ) : arg_3 = True try : len ( arg_0 ) except TypeError : arg_3 = False arg_0 = [ arg_0 ] if not hasattr ( arg_0 , 'dtype' ) : arg_0 = np . asarray ( arg_0 ) if arg_2 is None : arg_2 = np . array ( [ np . min ( arg_0 ) , np . max ( arg_0 ) ] ) arg_4 = arg_0 / arg_2 [ 1 ] * arg_1 [ 1 ] if not arg_3 : arg_4 = arg_4 [ 0 ] return arg_4

def Func(arg_0, arg_1=(0, 1), arg_2=None):
    """
    Rescale numeric vector to have specified maximum.

    Parameters
    ----------
    x : array_like | numeric
        1D vector of values to manipulate.
    to : tuple
        output range (numeric vector of length two)
    _from : tuple
        input range (numeric vector of length two).
        If not given, is calculated from the range of x.
        Only the 2nd (max) element is essential to the
        output.

    Returns
    -------
    out : array_like
        Rescaled values

    Examples
    --------
    >>> x = [0, 2, 4, 6, 8, 10]
    >>> Func(x, (0, 3))
    array([0. , 0.6, 1.2, 1.8, 2.4, 3. ])

    Only the 2nd (max) element of the parameters ``to``
    and ``_from`` are essential to the output.

    >>> Func(x, (1, 3))
    array([0. , 0.6, 1.2, 1.8, 2.4, 3. ])
    >>> Func(x, (0, 20))
    array([ 0.,  4.,  8., 12., 16., 20.])

    If :python:`max(x) < _from[1]` then values will be
    scaled beyond the requested (:python:`to[1]`) maximum.

    >>> Func(x, to=(1, 3), _from=(-1, 6))
    array([0., 1., 2., 3., 4., 5.])

    """
    arg_3 = True

    try:
        len(arg_0)
    except TypeError:
        arg_3 = False
        arg_0 = [arg_0]

    if not hasattr(arg_0, 'dtype'):
        arg_0 = np.asarray(arg_0)

    if arg_2 is None:
        arg_2 = np.array([np.min(arg_0), np.max(arg_0)])

    arg_4 = arg_0/arg_2[1] * arg_1[1]

    if not arg_3:
        arg_4 = arg_4[0]
    return arg_4

Rescale numeric vector to have specified maximum.

    Parameters
    ----------
    x : array_like | numeric
        1D vector of values to manipulate.
    to : tuple
        output range (numeric vector of length two)
    _from : tuple
        input range (numeric vector of length two).
        If not given, is calculated from the range of x.
        Only the 2nd (max) element is essential to the
        output.

    Returns
    -------
    out : array_like
        Rescaled values

    Examples
    --------
    >>> x = [0, 2, 4, 6, 8, 10]
    >>> rescale_max(x, (0, 3))
    array([0. , 0.6, 1.2, 1.8, 2.4, 3. ])

    Only the 2nd (max) element of the parameters ``to``
    and ``_from`` are essential to the output.

    >>> rescale_max(x, (1, 3))
    array([0. , 0.6, 1.2, 1.8, 2.4, 3. ])
    >>> rescale_max(x, (0, 20))
    array([ 0.,  4.,  8., 12., 16., 20.])

    If :python:`max(x) < _from[1]` then values will be
    scaled beyond the requested (:python:`to[1]`) maximum.

    >>> rescale_max(x, to=(1, 3), _from=(-1, 6))
    array([0., 1., 2., 3., 4., 5.])

Rescale numeric vector to have specified maximum .


def Func ( arg_0 , arg_1 , Func , arg_3 = False ) : arg_4 = 'PUT' arg_5 = 'trade/%s/bid' % arg_1 if not arg_3 : arg_6 = arg_0 . tradeStatus ( arg_1 ) [ 0 ] if arg_6 [ 'currentBid' ] >= Func or arg_0 . credits < Func : return False arg_7 = { 'bid' : Func } try : arg_6 = arg_0 . __request__ ( arg_4 , arg_5 , arg_7 = json . dumps ( arg_7 ) , params = { 'sku_b' : arg_0 . sku_b } , arg_3 = arg_3 ) [ 'auctionInfo' ] [ 0 ] except PermissionDenied : return False if arg_6 [ 'bidState' ] == 'highest' or ( arg_6 [ 'tradeState' ] == 'closed' and arg_6 [ 'bidState' ] == 'buyNow' ) : return True else : return False

def Func(arg_0, arg_1, Func, arg_3=False):
        """Make a bid.

        :params trade_id: Trade id.
        :params bid: Amount of credits You want to spend.
        :params fast: True for fastest bidding (skips trade status & credits check).
        """
        arg_4 = 'PUT'
        arg_5 = 'trade/%s/bid' % arg_1

        if not arg_3:
            arg_6 = arg_0.tradeStatus(arg_1)[0]
            # don't bid if current bid is equal or greater than our max bid
            if arg_6['currentBid'] >= Func or arg_0.credits < Func:
                return False  # TODO: add exceptions
        arg_7 = {'bid': Func}
        try:
            arg_6 = arg_0.__request__(arg_4, arg_5, arg_7=json.dumps(arg_7), params={'sku_b': arg_0.sku_b}, arg_3=arg_3)[
                'auctionInfo'][0]
        except PermissionDenied:  # too slow, somebody took it already :-(
            return False
        if arg_6['bidState'] == 'highest' or (
                arg_6['tradeState'] == 'closed' and arg_6['bidState'] == 'buyNow'):  # checking 'tradeState' is required?
            return True
        else:
            return False