(self, context, net_id, subnet,
                                 port_id, reuse_after, ip_address=None,
                                 **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3,
                                 arg_4, arg_5, arg_6=None,
                                 **arg_7):
        """This attempts to allocate v6 addresses as per RFC2462 and RFC3041.

        To accomodate this, we effectively treat all v6 assignment as a
        first time allocation utilizing the MAC address of the VIF. Because
        we recycle MACs, we will eventually attempt to recreate a previously
        generated v6 address. Instead of failing, we've opted to handle
        reallocating that address in this method.

        This should provide a performance boost over attempting to check
        each and every subnet in the existing reallocate logic, as we'd
        have to iterate over each and every subnet returned
        """

        LOG.info("Attempting to allocate a v6 address - [{0}]".format(
            utils.pretty_kwargs(network_id=arg_2, arg_3=arg_3,
                                arg_4=arg_4, arg_6=arg_6)))

        if arg_6:
            LOG.info("IP %s explicitly requested, deferring to standard "
                     "allocation" % arg_6)
            return arg_0._allocate_from_subnet(arg_1, arg_2=arg_2,
                                              arg_3=arg_3, arg_4=arg_4,
                                              arg_5=arg_5,
                                              arg_6=arg_6, **arg_7)
        else:
            arg_8 = arg_7.get("mac_address")
            if arg_8:
                arg_8 = arg_7["mac_address"].get("address")

            if arg_3 and arg_3["ip_policy"]:
                arg_9 = arg_3["ip_policy"].get_cidrs_ip_set()
            else:
                arg_9 = netaddr.IPSet([])

            for arg_10, arg_6 in enumerate(
                    generate_v6(arg_8, arg_4, arg_3["cidr"])):

                LOG.info("Attempt {0} of {1}".format(
                    arg_10 + 1, CONF.QUARK.v6_allocation_attempts))

                if arg_10 > CONF.QUARK.v6_allocation_attempts - 1:
                    LOG.info("Exceeded v6 allocation attempts, bailing")
                    raise ip_address_failure(arg_2)

                arg_6 = netaddr.IPAddress(arg_6).ipv6()
                LOG.info("Generated a new v6 address {0}".format(
                    str(arg_6)))

                if (arg_9 is not None and
                        arg_6 in arg_9):
                    LOG.info("Address {0} excluded by policy".format(
                        str(arg_6)))
                    continue

                try:
                    with arg_1.session.begin():
                        arg_11 = db_api.ip_address_create(
                            arg_1, arg_11=arg_6,
                            subnet_id=arg_3["id"],
                            version=arg_3["ip_version"], network_id=arg_2,
                            address_type=arg_7.get('address_type',
                                                    ip_types.FIXED))
                        return arg_11
                except db_exception.DBDuplicateEntry:
                    # This shouldn't ever happen, since we hold a unique MAC
                    # address from the previous IPAM step.
                    LOG.info("{0} exists but was already "
                             "allocated".format(str(arg_6)))
                    LOG.debug("Duplicate entry found when inserting subnet_id"
                              " %s ip_address %s", arg_3["id"], arg_6)

This attempts to allocate v6 addresses as per RFC2462 and RFC3041 .


def Func(arg_0, arg_1, arg_2):
        """
        Unicorn hook that transfers control to Manticore so it can execute the syscall
        """
        logger.debug(f"Stopping emulation at {hex(uc.reg_read(self._to_unicorn_id('RIP')))} to perform syscall")
        arg_0.sync_unicorn_to_manticore()
        from ..native.cpu.abstractcpu import Syscall
        arg_0._to_raise = Syscall()
        arg_1.emu_stop()


(cls, shape, pixel_scale, inner_radius_arcsec, outer_radius_arcsec, centre=(0., 0.),
                         invert=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=(0., 0.),
                         arg_6=False):
        """Setup a mask where unmasked pixels are within an annulus of input inner and outer arc second radii and \
         centre.

        Parameters
        ----------
        shape : (int, int)
            The (y,x) shape of the mask in units of pixels.
        pixel_scale: float
            The arc-second to pixel conversion factor of each pixel.
        inner_radius_arcsec : float
            The radius (in arc seconds) of the inner circle outside of which pixels are unmasked.
        outer_radius_arcsec : float
            The radius (in arc seconds) of the outer circle within which pixels are unmasked.
        centre: (float, float)
            The centre of the annulus used to mask pixels.
        """
        arg_7 = mask_util.mask_Func_from_shape_pixel_scale_and_radii(arg_1, arg_2, arg_3,
                                                                                arg_4, arg_5)
        if arg_6: arg_7 = np.invert(arg_7)
        return arg_0(array=arg_7.astype('bool'), arg_2=arg_2)

Setup a mask where unmasked pixels are within an annulus of input inner and outer arc second radii and \ centre .


def Func(arg_0, arg_1):
    """Returns a projectors.
    """
    arg_2 = 1
    # list is from qubit 0 to 1
    for arg_3 in arg_0:
        arg_4, arg_5 = arg_3
        arg_2 = np.kron(arg_1[arg_4][arg_5], arg_2)
    return arg_2


def Func ( arg_0 , ** arg_1 ) : arg_2 = [ rel . get_accessor_name ( ) for rel in get_all_child_relations ( arg_0 ) ] arg_3 = [ arg_8 . name for arg_8 in get_all_child_m2m_relations ( arg_0 ) ] arg_4 = arg_1 . pop ( 'update_fields' , None ) if arg_4 is None : arg_5 = None arg_6 = arg_2 arg_7 = arg_3 else : arg_5 = [ ] arg_6 = [ ] arg_7 = [ ] for arg_8 in arg_4 : if arg_8 in arg_2 : arg_6 . append ( arg_8 ) elif arg_8 in arg_3 : arg_7 . append ( arg_8 ) else : arg_5 . append ( arg_8 ) super ( ClusterableModel , arg_0 ) . Func ( arg_4 = arg_5 , ** arg_1 ) for arg_9 in arg_6 : getattr ( arg_0 , arg_9 ) . commit ( ) for arg_8 in arg_7 : getattr ( arg_0 , arg_8 ) . commit ( )

def Func(arg_0, **arg_1):
        """
        Save the model and commit all child relations.
        """
        arg_2 = [rel.get_accessor_name() for rel in get_all_child_relations(arg_0)]
        arg_3 = [arg_8.name for arg_8 in get_all_child_m2m_relations(arg_0)]

        arg_4 = arg_1.pop('update_fields', None)
        if arg_4 is None:
            arg_5 = None
            arg_6 = arg_2
            arg_7 = arg_3
        else:
            arg_5 = []
            arg_6 = []
            arg_7 = []
            for arg_8 in arg_4:
                if arg_8 in arg_2:
                    arg_6.append(arg_8)
                elif arg_8 in arg_3:
                    arg_7.append(arg_8)
                else:
                    arg_5.append(arg_8)

        super(ClusterableModel, arg_0).Func(arg_4=arg_5, **arg_1)

        for arg_9 in arg_6:
            getattr(arg_0, arg_9).commit()

        for arg_8 in arg_7:
            getattr(arg_0, arg_8).commit()

Save the model and commit all child relations .


def Func ( arg_0 ) : arg_1 = "" for arg_2 in arg_0 . childNodes : if arg_2 . nodeType == arg_2 . TEXT_NODE : arg_1 += arg_2 . nodeValue else : raise NotTextNodeError return arg_1

def Func(arg_0):
    """
    Scans through all children of node and gathers the
    text. If node has non-text child-nodes then
    NotTextNodeError is raised.
    """
    arg_1 = ""
    for arg_2 in arg_0.childNodes:
        if arg_2.nodeType == arg_2.TEXT_NODE:
            arg_1 += arg_2.nodeValue
        else:
            raise NotTextNodeError
    return arg_1

Scans through all children of node and gathers the text . If node has non - text child - nodes then NotTextNodeError is raised .


def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 , "description.py" ) arg_2 = _loadDescriptionFile ( arg_1 ) return arg_2

def Func(arg_0):
  """ Loads the experiment description python script from the given experiment
  directory.

  :param experimentDir: (string) experiment directory path

  :returns:        module of the loaded experiment description scripts
  """
  arg_1 = os.path.join(arg_0, "description.py")
  arg_2 = _loadDescriptionFile(arg_1)
  return arg_2

Loads the experiment description python script from the given experiment directory .


def
Func
(
arg_0
)
:
arg_1
=
'ml-1m.zip'
arg_2
=
base
.
maybe_download
(
arg_1
,
arg_0
,
SOURCE_URL
+
arg_1
)
arg_3
=
zipfile
.
ZipFile
(
arg_2
,
'r'
)
arg_4
=
os
.
path
.
join
(
arg_0
,
"ml-1m"
)
if
not
os
.
path
.
exists
(
arg_4
)
:
print
(
"Extracting %s to %s"
%
(
arg_2
,
arg_0
)
)
arg_3
.
extractall
(
arg_0
)
arg_3
.
close
(
)
arg_5
=
os
.
path
.
join
(
arg_4
,
"ratings.dat"
)
arg_6
=
[
i
.
strip
(
)
.
split
(
"::"
)
for
i
in
open
(
arg_5
,
"r"
)
.
readlines
(
)
]
arg_7
=
np
.
array
(
arg_6
)
.
astype
(
int
)
return
arg_7

def Func(arg_0):
    """
    Parse or download movielens 1m  data if train_dir is empty.

    :param data_dir: The directory storing the movielens data
    :return: a 2D numpy array with user index and item index in each row
    """
    arg_1 = 'ml-1m.zip'
    arg_2 = base.maybe_download(arg_1, arg_0, SOURCE_URL + arg_1)
    arg_3 = zipfile.ZipFile(arg_2, 'r')
    arg_4 = os.path.join(arg_0, "ml-1m")
    if not os.path.exists(arg_4):
        print("Extracting %s to %s" % (arg_2, arg_0))
        arg_3.extractall(arg_0)
        arg_3.close()
    arg_5 = os.path.join(arg_4,"ratings.dat")

    arg_6 = [i.strip().split("::") for i in open(arg_5,"r").readlines()]
    arg_7 = np.array(arg_6).astype(int)
    return arg_7

Parse or download movielens 1m data if train_dir is empty .


(self, ptp=0.2, fourier=False, vmin=None, vmax=None)

def Func ( arg_0 , arg_1 = 0.2 , arg_2 = False , arg_3 = None , arg_4 = None ) : if arg_3 is not None and arg_4 is not None : arg_1 = arg_4 - arg_3 elif arg_4 is not None and arg_3 is None : arg_3 = arg_4 - arg_1 elif arg_3 is not None and arg_4 is None : arg_4 = arg_3 + arg_1 else : arg_4 = 1.0 arg_3 = arg_4 - arg_1 arg_0 . set_values ( arg_0 . category + '-scale' , 1.0 ) arg_0 . set_values ( arg_0 . category + '-off' , 0.0 ) for arg_5 , arg_6 in iteritems ( arg_0 . poly_params ) : arg_7 = ( arg_0 . zorder + 1.0 ) * 2 arg_0 . set_values ( arg_5 , arg_1 * ( np . random . rand ( ) - 0.5 ) / arg_7 ) for arg_8 , arg_9 in enumerate ( arg_0 . barnes_params ) : arg_10 = len ( arg_9 ) if arg_2 : arg_11 = ( ( np . random . rand ( arg_10 ) - 0.5 ) + 1.j * ( np . random . rand ( arg_10 ) - 0.5 ) ) / ( np . arange ( arg_10 ) + 1 ) arg_12 = np . real ( np . fft . ifftn ( arg_11 ) ) / ( arg_8 + 1 ) else : arg_11 = arg_1 * np . sqrt ( arg_10 ) * ( np . random . rand ( arg_10 ) - 0.5 ) arg_12 = np . cumsum ( arg_11 ) / ( arg_8 + 1 ) arg_12 = arg_1 * arg_12 / arg_12 . ptp ( ) / len ( arg_0 . barnes_params ) arg_12 -= arg_12 . mean ( ) arg_0 . set_values ( arg_9 , arg_12 ) arg_0 . _norm_stat = [ arg_1 , arg_3 ] if arg_0 . shape : arg_0 . initialize ( ) if arg_0 . _parent : arg_14 = arg_0 . category + '-scale' arg_0 . trigger_update ( arg_14 , arg_0 . get_values ( arg_14 ) )

def Func(arg_0, arg_1=0.2, arg_2=False, arg_3=None, arg_4=None):
        """
        Create random parameters for this ILM that mimic experiments
        as closely as possible without real assumptions.
        """
        if arg_3 is not None and arg_4 is not None:
            arg_1 = arg_4 - arg_3
        elif arg_4 is not None and arg_3 is None:
            arg_3 = arg_4 - arg_1
        elif arg_3 is not None and arg_4 is None:
            arg_4 = arg_3 + arg_1
        else:
            arg_4 = 1.0
            arg_3 = arg_4 - arg_1

        arg_0.set_values(arg_0.category+'-scale', 1.0)
        arg_0.set_values(arg_0.category+'-off', 0.0)

        for arg_5, arg_6 in iteritems(arg_0.poly_params):
            arg_7 = (arg_0.zorder + 1.0)*2
            arg_0.set_values(arg_5, arg_1*(np.random.rand() - 0.5) / arg_7)

        for arg_8, arg_9 in enumerate(arg_0.barnes_params):
            arg_10 = len(arg_9)
            if arg_2:
                arg_11 = ((np.random.rand(arg_10)-0.5) + 1.j*(np.random.rand(arg_10)-0.5))/(np.arange(arg_10)+1)
                arg_12 = np.real(np.fft.ifftn(arg_11)) / (arg_8+1)
            else:
                arg_11 = arg_1*np.sqrt(arg_10)*(np.random.rand(arg_10)-0.5)
                arg_12 = np.cumsum(arg_11) / (arg_8+1)

            arg_12 = arg_1 * arg_12 / arg_12.ptp() / len(arg_0.barnes_params)
            arg_12 -= arg_12.mean()
            arg_0.set_values(arg_9, arg_12)

        arg_0._norm_stat = [arg_1, arg_3]

        if arg_0.shape:
            arg_0.initialize()

        if arg_0._parent:
            arg_14 = arg_0.category+'-scale'
            arg_0.trigger_update(arg_14, arg_0.get_values(arg_14))

Create random parameters for this ILM that mimic experiments as closely as possible without real assumptions .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = defaultdict ( list ) , defaultdict ( list ) for arg_4 , arg_5 in arg_0 . items ( ) : if arg_4 == 'bolts' : for arg_6 , arg_7 in arg_5 . items ( ) : for arg_8 in arg_7 [ 'inputs' ] : arg_9 = arg_8 [ 'component_name' ] arg_2 [ arg_6 ] . append ( arg_9 ) arg_3 [ arg_9 ] . append ( arg_6 ) arg_10 = [ ] arg_11 = arg_1 [ 'physical_plan' ] [ 'spouts' ] arg_12 = arg_1 [ 'physical_plan' ] [ 'bolts' ] for arg_4 , arg_5 in arg_0 . items ( ) : if arg_4 == "stages" : continue for arg_6 , arg_7 in arg_5 . items ( ) : arg_13 = [ arg_4 [ : - 1 ] , arg_6 ] if arg_4 == 'spouts' : arg_13 . append ( len ( arg_11 [ arg_6 ] ) ) else : arg_13 . append ( len ( arg_12 [ arg_6 ] ) ) arg_13 . append ( ',' . join ( arg_2 . get ( arg_6 , [ '-' ] ) ) ) arg_13 . append ( ',' . join ( arg_3 . get ( arg_6 , [ '-' ] ) ) ) arg_10 . append ( arg_13 ) arg_14 = [ 'type' , 'name' , 'parallelism' , 'input' , 'output' ] return arg_10 , arg_14

def Func(arg_0, arg_1):
  """ normalize raw logical plan info to table """
  arg_2, arg_3 = defaultdict(list), defaultdict(list)
  for arg_4, arg_5 in arg_0.items():
    if arg_4 == 'bolts':
      for arg_6, arg_7 in arg_5.items():
        for arg_8 in arg_7['inputs']:
          arg_9 = arg_8['component_name']
          arg_2[arg_6].append(arg_9)
          arg_3[arg_9].append(arg_6)
  arg_10 = []
  arg_11 = arg_1['physical_plan']['spouts']
  arg_12 = arg_1['physical_plan']['bolts']
  for arg_4, arg_5 in arg_0.items():
    # stages is an int so keep going
    if arg_4 == "stages":
      continue
    for arg_6, arg_7 in arg_5.items():
      arg_13 = [arg_4[:-1], arg_6]
      if arg_4 == 'spouts':
        arg_13.append(len(arg_11[arg_6]))
      else:
        arg_13.append(len(arg_12[arg_6]))
      arg_13.append(','.join(arg_2.get(arg_6, ['-'])))
      arg_13.append(','.join(arg_3.get(arg_6, ['-'])))
      arg_10.append(arg_13)
  arg_14 = ['type', 'name', 'parallelism', 'input', 'output']
  return arg_10, arg_14


def Func(arg_0, arg_1):
  '''
  Template statemgr.yaml
  '''
  arg_2 = "%s/standalone/templates/statemgr.template.yaml" \
                                  % arg_0["config_path"]
  arg_3 = "%s/standalone/statemgr.yaml" % arg_0["config_path"]

  template_file(arg_2, arg_3,
                {"<zookeeper_host:zookeeper_port>": ",".join(
                    ['"%s"' % arg_4 if ":" in arg_4 else '"%s:2181"' % arg_4 for arg_4 in arg_1])})


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _chunksize arg_4 , arg_5 = arg_2 with h5py . File ( arg_0 . database . output , 'r+' ) as arg_6 : arg_6 [ 'quartets' ] [ arg_1 : arg_1 + arg_3 ] = arg_4 if arg_0 . params . save_invariants : if arg_0 . checkpoint . boots : arg_7 = "invariants/boot{}" . format ( arg_0 . checkpoint . boots ) arg_6 [ arg_7 ] [ arg_1 : arg_1 + arg_3 ] = arg_5 else : arg_6 [ "invariants/boot0" ] [ arg_1 : arg_1 + arg_3 ] = arg_5

def Func(arg_0, arg_1, arg_2):
        """
        Enters results arrays into the HDF5 database.
        """

        ## two result arrs
        arg_3 = arg_0._chunksize
        arg_4, arg_5 = arg_2

        ## enter into db
        with h5py.File(arg_0.database.output, 'r+') as arg_6:
            arg_6['quartets'][arg_1:arg_1+arg_3] = arg_4

            ## entered as 0-indexed !
            if arg_0.params.save_invariants:
                if arg_0.checkpoint.boots:
                    arg_7 = "invariants/boot{}".format(arg_0.checkpoint.boots)
                    arg_6[arg_7][arg_1:arg_1+arg_3] = arg_5
                else:
                    arg_6["invariants/boot0"][arg_1:arg_1+arg_3] = arg_5

Enters results arrays into the HDF5 database .


def Func ( arg_0 , arg_1 ) : while True : arg_0 . _should_try_again = False arg_0 . _to_raise = None arg_0 . _step ( arg_1 ) if not arg_0 . _should_try_again : break

def Func(arg_0, arg_1):
        """
        Wrapper that runs the _step function in a loop while handling exceptions
        """

        # The emulation might restart if Unicorn needs to bring in a memory map
        # or bring a value from Manticore state.
        while True:

            # Try emulation
            arg_0._should_try_again = False
            arg_0._to_raise = None

            arg_0._step(arg_1)

            if not arg_0._should_try_again:
                break


return pack({
            'text': text,
            'type': 'message',
            'channel': channel_id,
            'id': self.message_id,
        })

def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 . slack . channel_from_name ( arg_2 ) [ 'id' ] except ValueError : arg_3 = arg_2 return pack ( { 'text' : arg_1 , 'type' : 'message' , 'channel' : arg_3 , 'id' : arg_0 . message_id , } )

def Func(arg_0, arg_1, arg_2):
        """
        High-level function for creating messages. Return packed bytes.

        Args:
            text: {str}
            channel: {str} Either name or ID
        """
        try:
            arg_3 = arg_0.slack.channel_from_name(arg_2)['id']
        except ValueError:
            arg_3 = arg_2
        return pack({
            'text': arg_1,
            'type': 'message',
            'channel': arg_3,
            'id': arg_0.message_id,
        })

High - level function for creating messages . Return packed bytes .


return currency + "/" + consumption_unit

def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
currency
arg_2
=
arg_0
.
consumption_unit
if
not
arg_1
or
not
arg_2
:
_LOGGER
.
error
(
"Could not find Func."
)
return
" "
return
arg_1
+
"/"
+
arg_2

def Func(arg_0):
        """Return the price unit."""
        arg_1 = arg_0.currency
        arg_2 = arg_0.consumption_unit
        if not arg_1 or not arg_2:
            _LOGGER.error("Could not find Func.")
            return " "
        return arg_1 + "/" + arg_2


def Func ( ) : arg_0 = tempfile . gettempdir ( ) arg_1 = 'envstore{0:0>3d}' arg_2 = unipath ( arg_0 , arg_1 . format ( random . getrandbits ( 9 ) ) ) if not os . path . exists ( arg_2 ) : return arg_2 else : return Func ( )

def Func():
    '''Returns an unused random filepath.'''

    arg_0 = tempfile.gettempdir()
    arg_1 = 'envstore{0:0>3d}'
    arg_2 = unipath(arg_0, arg_1.format(random.getrandbits(9)))
    if not os.path.exists(arg_2):
        return arg_2
    else:
        return Func()


(instance, module_name, method_name, module_alias=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : import imp from . decorators import task_or_dryrun arg_4 = sys . modules [ arg_1 ] arg_3 = re . sub ( '[^a-zA-Z0-9]+' , '' , arg_3 or '' ) arg_5 = getattr ( arg_0 , arg_2 ) if not arg_2 . startswith ( '_' ) : arg_6 = getattr ( arg_0 , arg_2 ) if not hasattr ( arg_6 , 'is_task_or_dryrun' ) : arg_6 = task_or_dryrun ( arg_6 ) if arg_1 == arg_3 or ( arg_1 . startswith ( 'satchels.' ) and arg_1 . endswith ( arg_3 ) ) : setattr ( arg_4 , arg_2 , arg_6 ) else : arg_7 = arg_4 arg_4 = create_module ( arg_3 ) setattr ( arg_4 , arg_2 , arg_6 ) post_import_modules . add ( arg_3 ) arg_8 = '%s.%s' % ( arg_3 or arg_1 , arg_2 ) arg_6 . wrapped . __func__ . fabric_name = arg_8 return arg_6

def Func(arg_0, arg_1, arg_2, arg_3=None):
    '''
    Utility to take the methods of the instance of a class, instance,
    and add them as functions to a module, module_name, so that Fabric
    can find and call them. Call this at the bottom of a module after
    the class definition.
    '''
    import imp
    from .decorators import task_or_dryrun

    # get the module as an object
    arg_4 = sys.modules[arg_1]

    arg_3 = re.sub('[^a-zA-Z0-9]+', '', arg_3 or '')

    # Iterate over the methods of the class and dynamically create a function
    # for each method that calls the method and add it to the current module
    # NOTE: inspect.ismethod actually executes the methods?!
    #for method in inspect.getmembers(instance, predicate=inspect.ismethod):

    arg_5 = getattr(arg_0, arg_2)

    if not arg_2.startswith('_'):

        # get the bound method
        arg_6 = getattr(arg_0, arg_2)

#         if module_name == 'buildbot' or module_alias == 'buildbot':
#             print('-'*80)
#             print('module_name:', module_name)
#             print('method_name:', method_name)
#             print('module_alias:', module_alias)
#             print('module_obj:', module_obj)
#             print('func.module:', func.__module__)

        # Convert executable to a Fabric task, if not done so already.
        if not hasattr(arg_6, 'is_task_or_dryrun'):
            arg_6 = task_or_dryrun(arg_6)

        if arg_1 == arg_3 \
        or (arg_1.startswith('satchels.') and arg_1.endswith(arg_3)):

            # add the function to the current module
            setattr(arg_4, arg_2, arg_6)

        else:

            # Dynamically create a module for the virtual satchel.
            arg_7 = arg_4
            arg_4 = create_module(arg_3)
            setattr(arg_4, arg_2, arg_6)
            post_import_modules.add(arg_3)

        arg_8 = '%s.%s' % (arg_3 or arg_1, arg_2)
        arg_6.wrapped.__func__.fabric_name = arg_8

        return arg_6

Utility to take the methods of the instance of a class instance and add them as functions to a module module_name so that Fabric can find and call them . Call this at the bottom of a module after the class definition .


def Func(arg_0, arg_1, arg_2):
        """Check that a symbol is not already used. """
        arg_3 = arg_0._messages_definitions.get(arg_2)
        if arg_3:
            arg_0._raise_duplicate_msg_id(arg_2, arg_1, arg_3.msgid)
        else:
            arg_4 = None
        arg_5 = arg_0._alternative_names.get(arg_2)
        if arg_5:
            if arg_5.symbol == arg_2:
                arg_4 = arg_5.msgid
            else:
                for arg_6, arg_7 in arg_5.old_names:
                    if arg_7 == arg_2:
                        arg_4 = arg_6
                        break
            if arg_1 != arg_4:
                arg_0._raise_duplicate_msg_id(arg_2, arg_1, arg_4)

Check that a symbol is not already used .


def Func ( arg_0 , arg_1 ) : arg_2 = defaultdict ( list ) for ( arg_3 , arg_4 ) in arg_1 or [ ] : arg_2 [ arg_3 ] = arg_4 for ( arg_3 , arg_5 , arg_6 ) in arg_0 or [ ] : arg_5 = arg_5 . replace ( os . sep , '/' ) arg_7 = len ( arg_5 ) + 1 arg_4 = _get_files ( pjoin ( arg_5 , arg_6 ) ) for arg_8 in arg_4 : arg_9 = os . path . dirname ( arg_8 ) arg_10 = '/' . join ( [ arg_3 , arg_9 [ arg_7 : ] ] ) if arg_10 . endswith ( '/' ) : arg_10 = arg_10 [ : - 1 ] arg_2 [ arg_10 ] . append ( arg_8 ) arg_11 = [ ] for ( arg_3 , arg_4 ) in arg_2 . items ( ) : arg_11 . append ( ( arg_3 , arg_4 ) ) return arg_11

def Func(arg_0, arg_1):
    """Expand data file specs into valid data files metadata.

    Parameters
    ----------
    data_specs: list of tuples
        See [createcmdclass] for description.
    existing: list of tuples
        The existing distribution data_files metadata.

    Returns
    -------
    A valid list of data_files items.
    """
    # Extract the existing data files into a staging object.
    arg_2 = defaultdict(list)
    for (arg_3, arg_4) in arg_1 or []:
        arg_2[arg_3] = arg_4

    # Extract the files and assign them to the proper data
    # files path.
    for (arg_3, arg_5, arg_6) in arg_0 or []:
        arg_5 = arg_5.replace(os.sep, '/')
        arg_7 = len(arg_5) + 1

        arg_4 = _get_files(pjoin(arg_5, arg_6))
        for arg_8 in arg_4:
            # Normalize the path.
            arg_9 = os.path.dirname(arg_8)
            arg_10 = '/'.join([arg_3, arg_9[arg_7:]])
            if arg_10.endswith('/'):
                arg_10 = arg_10[:-1]
            arg_2[arg_10].append(arg_8)

    # Construct the data files spec.
    arg_11 = []
    for (arg_3, arg_4) in arg_2.items():
        arg_11.append((arg_3, arg_4))
    return arg_11

Expand data file specs into valid data files metadata .


(case_obj, match_type, mme_base_url, mme_token, nodes=None, mme_accepts=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
,
arg_5
=
)
:
arg_6
=
[
]
arg_7
=
[
]
arg_8
=
arg_6
=
arg_0
[
'mme_submission'
]
[
'patients'
]
if
arg_1
==
'internal'
:
arg_8
=
''
.
join
(
[
arg_2
,
'/match'
]
)
for
arg_9
in
arg_6
:
arg_10
=
matchmaker_request
(
arg_8
=
arg_8
,
token
=
arg_3
,
method
=
'POST'
,
content_type
=
arg_5
,
accept
=
arg_5
,
data
=
{
'patient'
:
arg_9
}
)
arg_11
=
{
'server'
:
'Local MatchMaker node'
,
'patient_id'
:
arg_9
[
'id'
]
,
'results'
:
arg_10
.
get
(
'results'
)
,
'status_code'
:
arg_10
.
get
(
'status_code'
)
,
'message'
:
arg_10
.
get
(
'message'
)
}
arg_7
.
append
(
arg_11
)
else
:
arg_6
=
[
arg_9
[
'id'
]
for
arg_9
in
arg_6
]
arg_12
=
[
arg_13
[
'id'
]
for
arg_13
in
arg_4
]
if
arg_1
in
arg_12
:
arg_12
=
[
arg_1
]
for
arg_9
in
arg_6
:
for
arg_13
in
arg_12
:
arg_8
=
''
.
join
(
[
arg_2
,
'/match/external/'
,
arg_9
,
'?node='
,
arg_13
]
)
arg_10
=
matchmaker_request
(
arg_8
=
arg_8
,
token
=
arg_3
,
method
=
'POST'
)
arg_11
=
{
'server'
:
arg_13
,
'patient_id'
:
arg_9
,
'results'
:
arg_10
.
get
(
'results'
)
,
'status_code'
:
arg_10
.
get
(
'status_code'
)
,
'message'
:
arg_10
.
get
(
'message'
)
}
arg_7
.
append
(
arg_11
)
return
arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
    """Initiate a MatchMaker match against either other Scout patients or external nodes

    Args:
        case_obj(dict): a scout case object already submitted to MME
        match_type(str): 'internal' or 'external'
        mme_base_url(str): base url of the MME server
        mme_token(str): auth token of the MME server
        mme_accepts(str): request content accepted by MME server (only for internal matches)

    Returns:
        matches(list): a list of eventual matches
    """
    arg_6 = []
    arg_7 = []
    arg_8 = None
    # list of patient dictionaries is required for internal matching
    arg_6 = arg_0['mme_submission']['patients']
    if arg_1=='internal':
        arg_8 = ''.join([arg_2,'/match'])
        for arg_9 in arg_6:
            arg_10 = matchmaker_request(arg_8=arg_8, token=arg_3, method='POST',
                content_type=arg_5, accept=arg_5, data={'patient':arg_9})
            arg_11 = {
                'server' : 'Local MatchMaker node',
                'patient_id' : arg_9['id'],
                'results' : arg_10.get('results'),
                'status_code' : arg_10.get('status_code'),
                'message' : arg_10.get('message') # None if request was successful
            }
            arg_7.append(arg_11)
    else: # external matching
        # external matching requires only patient ID
        arg_6 = [ arg_9['id'] for arg_9 in arg_6]
        arg_12 = [ arg_13['id'] for arg_13 in arg_4 ]
        if arg_1 in arg_12: # match is against a specific external node
            arg_12 = [arg_1]

        # Match every affected patient
        for arg_9 in arg_6:
            # Against every node
            for arg_13 in arg_12:
                arg_8 = ''.join([arg_2,'/match/external/', arg_9, '?node=', arg_13])
                arg_10 = matchmaker_request(arg_8=arg_8, token=arg_3, method='POST')
                arg_11 = {
                    'server' : arg_13,
                    'patient_id' : arg_9,
                    'results' : arg_10.get('results'),
                    'status_code' : arg_10.get('status_code'),
                    'message' : arg_10.get('message') # None if request was successful
                }
                arg_7.append(arg_11)
    return arg_7


async def Func ( arg_0 ) : async with arg_0 . _lock : for arg_1 in arg_0 . hashtables : await arg_1 . Func ( ) if arg_0 . keys is not None : await arg_0 . keys . Func ( ) arg_0 . _initialized = False

async def Func(arg_0):
        """
        Cleanup client resources and disconnect from AsyncMinHashLSH storage.
        """
        async with arg_0._lock:
            for arg_1 in arg_0.hashtables:
                await arg_1.Func()

            if arg_0.keys is not None:
                await arg_0.keys.Func()

            arg_0._initialized = False

Cleanup client resources and disconnect from AsyncMinHashLSH storage .


def Func(arg_0):
        """
        Call the method repeatedly such that it will return a PKey object.
        """
        arg_1 = xrange(3)
        for arg_2 in xrange(arg_0.iterations):
            arg_3 = PKey()
            arg_3.generate_key(TYPE_DSA, 256)
            for arg_2 in arg_1:
                arg_4 = X509()
                arg_4.set_pubkey(arg_3)
                for arg_2 in arg_1:
                    arg_4.get_pubkey()

Call the method repeatedly such that it will return a PKey object .


(reader, delimiter, with_header, skipspace)

return pd.read_csv(
        reader,
        header=header,
        sep=sep,
        skipinitialspace=skipspace,
        encoding='utf-8-sig'
    )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Returns csv data as a pandas Dataframe object"""
    arg_4 = arg_1
    arg_5 = 0
    if not arg_2:
        arg_5 = None

    return pd.read_csv(
        arg_0,
        arg_5=arg_5,
        arg_4=arg_4,
        skipinitialspace=arg_3,
        encoding='utf-8-sig'
    )


def Func(arg_0):
        """
        Connect to the REST API, authenticating with a JWT for the current user.
        """
        if JwtBuilder is None:
            raise NotConnectedToOpenEdX("This package must be installed in an OpenEdX environment.")

        arg_1 = int(time())
        arg_2 = JwtBuilder.create_jwt_for_user(arg_0.user)
        arg_0.client = EdxRestApiClient(
            arg_0.API_BASE_URL, append_slash=arg_0.APPEND_SLASH, arg_2=arg_2,
        )
        arg_0.expires_at = arg_1 + arg_0.expires_in

Connect to the REST API authenticating with a JWT for the current user .


return ((ext in self.config.allow) or
                (ext in self.extensions and ext not in self.config.deny))

def Func ( arg_0 , arg_1 ) : return ( ( arg_1 in arg_0 . config . allow ) or ( arg_1 in arg_0 . extensions and arg_1 not in arg_0 . config . deny ) )

def Func(arg_0, arg_1):
        """
        This determines whether a specific extension is allowed. It is called
        by `file_allowed`, so if you override that but still want to check
        extensions, call back into this.

        :param ext: The extension to check, without the dot.
        """
        return ((arg_1 in arg_0.config.allow) or
                (arg_1 in arg_0.extensions and arg_1 not in arg_0.config.deny))

This determines whether a specific extension is allowed . It is called by file_allowed so if you override that but still want to check extensions call back into this .


def Func ( arg_0 , arg_1 ) : arg_2 = None try : if isinstance ( arg_1 . json , collections . Callable ) : arg_2 = arg_1 . json ( ) else : arg_2 = arg_1 . json except ValueError : arg_2 = arg_1 . content if not arg_0 . _raise_errors : return arg_2 else : if arg_1 . status_code == 401 : raise AuthenticationError ( arg_2 [ 'message' ] ) elif arg_1 . status_code == 500 : raise ServerError ( arg_2 [ 'message' ] ) elif isinstance ( arg_2 , dict ) and not arg_2 [ 'success' ] : raise APIError ( arg_2 [ 'message' ] ) else : return arg_2

def Func(arg_0, arg_1):
        """Parses the API response and raises appropriate
        errors if raise_errors was set to True

        :param response: response from requests http call
        :returns: dictionary of response
        :rtype: dict
        """
        arg_2 = None
        try:
            if isinstance(arg_1.json, collections.Callable):
                arg_2 = arg_1.json()
            else:
                # json isn't callable in old versions of requests
                arg_2 = arg_1.json
        except ValueError:
            # response does not have JSON content
            arg_2 = arg_1.content

        if not arg_0._raise_errors:
            return arg_2
        else:
            if arg_1.status_code == 401:
                raise AuthenticationError(arg_2['message'])
            elif arg_1.status_code == 500:
                raise ServerError(arg_2['message'])
            elif isinstance(arg_2, dict) and not arg_2['success']:
                raise APIError(arg_2['message'])
            else:
                return arg_2


def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or 37 if arg_0 . get ( 'common' ) : add_gene_links ( arg_0 , arg_1 ) arg_2 = [ ] for arg_3 in arg_0 [ 'transcripts' ] : parse_transcript ( arg_0 , arg_3 , arg_1 ) if not arg_3 . get ( 'refseq_id' ) : continue arg_2 . append ( arg_3 ) arg_0 [ 'primary_transcripts' ] = ( arg_2 if arg_2 else [ ] )

def Func(arg_0, arg_1=None):
    """Parse variant genes."""
    arg_1 = arg_1 or 37

    if arg_0.get('common'):
        add_gene_links(arg_0, arg_1)
        arg_2 = []
        for arg_3 in arg_0['transcripts']:
            parse_transcript(arg_0, arg_3, arg_1)

            # select refseq transcripts as "primary"
            if not arg_3.get('refseq_id'):
                continue

            arg_2.append(arg_3)

        arg_0['primary_transcripts'] = (arg_2 if arg_2 else [])


def Func(arg_0):
		"Cache the parameters necessary to transform x & y coordinates"
		arg_1, arg_2, arg_3 = arg_0.x_range()
		arg_4, arg_5, arg_6 = arg_0.y_range()
		arg_7 = (float(arg_0.graph_width) - arg_0.font_size * 2) / \
			(arg_2 - arg_1)
		arg_8 = (float(arg_0.graph_height) - arg_0.font_size * 2) / \
			(arg_5 - arg_4)
		arg_0.__transform_parameters = dict(locals())
		del arg_0.__transform_parameters['self']


def Func ( arg_0 , arg_1 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , ( arg_0 . SF == arg_0 . OF ) , arg_1 . read ( ) , arg_0 . PC )

def Func(arg_0, arg_1):
        """
        Jumps short if greater or equal.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, (arg_0.SF == arg_0.OF), arg_1.read(), arg_0.PC)


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
__csvFileObj
is
:
arg_0
.
__openAndInitCSVFile
(
arg_1
)
arg_2
=
arg_0
.
__csvFileObj
print
>>
arg_2
,
"%s, "
%
(
arg_0
.
__searchJobID
)
,
print
>>
arg_2
,
"%s, "
%
(
arg_1
.
getModelID
(
)
)
,
print
>>
arg_2
,
"%s, "
%
(
arg_1
.
statusAsString
(
)
)
,
if
arg_1
.
isFinished
(
)
:
print
>>
arg_2
,
"%s, "
%
(
arg_1
.
getCompletionReason
(
)
)
,
else
:
print
>>
arg_2
,
"NA, "
,
if
not
arg_1
.
isWaitingToStart
(
)
:
print
>>
arg_2
,
"%s, "
%
(
arg_1
.
getStartTime
(
)
)
,
else
:
print
>>
arg_2
,
"NA, "
,
if
arg_1
.
isFinished
(
)
:
arg_3
=
"%Y-%m-%d %H:%M:%S"
arg_4
=
arg_1
.
getStartTime
(
)
arg_5
=
arg_1
.
getEndTime
(
)
print
>>
arg_2
,
"%s, "
%
arg_5
,
arg_6
=
datetime
.
strptime
(
arg_4
,
arg_3
)
arg_7
=
datetime
.
strptime
(
arg_5
,
arg_3
)
print
>>
arg_2
,
"%s, "
%
(
str
(
(
arg_7
arg_6
)
.
seconds
)
)
,
else
:
print
>>
arg_2
,
"NA, "
,
print
>>
arg_2
,
"NA, "
,
print
>>
arg_2
,
"%s, "
%
str
(
arg_1
.
getModelDescription
(
)
)
,
print
>>
arg_2
,
"%s, "
%
str
(
arg_1
.
getNumRecords
(
)
)
,
arg_8
=
arg_1
.
getParamLabels
(
)
for
arg_9
in
arg_0
.
__sortedVariableNames
:
if
arg_9
in
arg_8
:
print
>>
arg_2
,
"%s, "
%
(
arg_8
[
arg_9
]
)
,
else
:
print
>>
arg_2
,
"None, "
,
arg_10
=
arg_1
.
getReportMetrics
(
)
for
arg_9
in
arg_0
.
__sortedMetricsKeys
:
arg_11
=
arg_10
.
get
(
arg_9
,
"NA"
)
arg_11
=
str
(
arg_11
)
arg_11
=
arg_11
.
replace
(
"\n"
,
" "
)
print
>>
arg_2
,
"%s, "
%
(
arg_11
)
,
print
>>
arg_2

def Func(arg_0, arg_1):
    """Emit model info to csv file

    Parameters:
    ----------------------------------------------------------------------
    modelInfo:      _NupicModelInfo instance
    retval:         nothing
    """
    # Open/init csv file, if needed
    if arg_0.__csvFileObj is None:
      # sets up self.__sortedVariableNames and self.__csvFileObj
      arg_0.__openAndInitCSVFile(arg_1)

    arg_2 = arg_0.__csvFileObj

    # Emit model info row to report.csv
    print >> arg_2, "%s, " % (arg_0.__searchJobID),
    print >> arg_2, "%s, " % (arg_1.getModelID()),
    print >> arg_2, "%s, " % (arg_1.statusAsString()),
    if arg_1.isFinished():
      print >> arg_2, "%s, " % (arg_1.getCompletionReason()),
    else:
      print >> arg_2, "NA, ",
    if not arg_1.isWaitingToStart():
      print >> arg_2, "%s, " % (arg_1.getStartTime()),
    else:
      print >> arg_2, "NA, ",
    if arg_1.isFinished():
      arg_3 = "%Y-%m-%d %H:%M:%S"
      arg_4 = arg_1.getStartTime()
      arg_5 = arg_1.getEndTime()
      print >> arg_2, "%s, " % arg_5,
      arg_6 = datetime.strptime(arg_4, arg_3)
      arg_7 = datetime.strptime(arg_5, arg_3)
      print >> arg_2, "%s, " % (str((arg_7 - arg_6).seconds)),
    else:
      print >> arg_2, "NA, ",
      print >> arg_2, "NA, ",
    print >> arg_2, "%s, " % str(arg_1.getModelDescription()),
    print >> arg_2, "%s, " % str(arg_1.getNumRecords()),
    arg_8 = arg_1.getParamLabels()
    for arg_9 in arg_0.__sortedVariableNames:
      # Some values are complex structures,.. which need to be represented as
      # strings
      if arg_9 in arg_8:
        print >> arg_2, "%s, " % (arg_8[arg_9]),
      else:
        print >> arg_2, "None, ",
    arg_10 = arg_1.getReportMetrics()
    for arg_9 in arg_0.__sortedMetricsKeys:
      arg_11 = arg_10.get(arg_9, "NA")
      arg_11 = str(arg_11)
      arg_11 = arg_11.replace("\n", " ")
      print >> arg_2, "%s, " % (arg_11),

    print >> arg_2


def Func(arg_0, arg_1=None, arg_2=None):
        """
        A generator that produces a sequence of paths to Func in the
        project that matches the specified filters.

        :param filters:
            the regular expressions to use when finding Func in the
            project. If not specified, all Func are returned.
        :type filters: list(str)
        :param containing:
            if a directory passes through the specified filters, it is checked
            for the presence of a file that matches one of the regular
            expressions in this parameter.
        :type containing: list(str)
        """

        arg_1 = compile_masks(arg_1 or [r'.*'])
        arg_3 = compile_masks(arg_2)

        for arg_4, arg_5 in iteritems(arg_0._found):
            arg_6 = text_type(Path(arg_4).relative_to(arg_0.base_path))
            if matches_masks(arg_6, arg_1):
                if not arg_3 or arg_0._contains(arg_5, arg_3):
                    yield arg_4

A generator that produces a sequence of paths to directories in the
        project that matches the specified filters.

        :param filters:
            the regular expressions to use when finding directories in the
            project. If not specified, all directories are returned.
        :type filters: list(str)
        :param containing:
            if a directory passes through the specified filters, it is checked
            for the presence of a file that matches one of the regular
            expressions in this parameter.
        :type containing: list(str)

A generator that produces a sequence of paths to directories in the project that matches the specified filters .


def
Func
(
)
:
if
os
.
sep
==
':'
:
arg_0
=
'Cmd-Q'
elif
os
.
sep
==
'\\'
:
arg_0
=
'Ctrl-Z plus Return'
else
:
arg_0
=
'Ctrl-D (i.e. EOF)'
class
Quitter
(
object
)
:
def
__init__
(
arg_1
,
arg_2
)
:
arg_1
.
name
=
arg_2
def
__repr__
(
arg_1
)
:
return
'Use %s() or %s to exit'
%
(
arg_1
.
name
,
arg_0
)
def
__call__
(
arg_1
,
arg_3
=
)
:
try
:
sys
.
stdin
.
close
(
)
except
:
pass
raise
SystemExit
(
arg_3
)
arg_4
.
quit
=
Quitter
(
'quit'
)
arg_4
.
exit
=
Quitter
(
'exit'
)

def Func():
    """Define new built-ins 'quit' and 'exit'.
    These are simply strings that display a hint on how to exit.

    """
    if os.sep == ':':
        arg_0 = 'Cmd-Q'
    elif os.sep == '\\':
        arg_0 = 'Ctrl-Z plus Return'
    else:
        arg_0 = 'Ctrl-D (i.e. EOF)'

    class Quitter(object):
        def __init__(arg_1, arg_2):
            arg_1.name = arg_2
        def __repr__(arg_1):
            return 'Use %s() or %s to exit' % (arg_1.name, arg_0)
        def __call__(arg_1, arg_3=None):
            # Shells like IDLE catch the SystemExit, but listen when their
            # stdin wrapper is closed.
            try:
                sys.stdin.close()
            except:
                pass
            raise SystemExit(arg_3)
    arg_4.quit = Quitter('quit')
    arg_4.exit = Quitter('exit')

Define new built - ins quit and exit . These are simply strings that display a hint on how to exit .


def
Func
(
arg_0
)
:
arg_1
=
[
p
for
p
in
arg_0
.
running_procs
if
p
.
Func
(
)
is
not
]
arg_0
.
running_procs
=
collections
.
deque
(
[
p
for
p
in
arg_0
.
running_procs
if
p
not
in
arg_1
]
)
for
arg_3
in
arg_1
:
arg_4
,
arg_5
=
arg_3
.
communicate
(
)
arg_6
=
[
p
.
pid
for
p
in
arg_1
]
arg_0
.
finished_pids
.
extend
(
arg_6
)
arg_7
=
logging
.
getLogger
(
__name__
)
arg_8
=
'Running: {}, Finished: {}'
.
format
(
len
(
arg_0
.
running_procs
)
,
len
(
arg_0
.
finished_pids
)
)
arg_7
.
info
(
arg_8
)
return
arg_6

def Func(arg_0):
        """check if the jobs are running and return a list of pids for
        finished jobs

        """
        arg_1 = [p for p in arg_0.running_procs if p.Func() is not None]
        arg_0.running_procs = collections.deque([p for p in arg_0.running_procs if p not in arg_1])

        for arg_3 in arg_1:
            arg_4, arg_5 = arg_3.communicate()
            ## proc.communicate() returns (stdout, stderr) when
            ## self.pipe = True. Otherwise they are (None, None)

        arg_6 = [p.pid for p in arg_1]
        arg_0.finished_pids.extend(arg_6)

        arg_7 = logging.getLogger(__name__)
        arg_8 = 'Running: {}, Finished: {}'.format(len(arg_0.running_procs), len(arg_0.finished_pids))
        arg_7.info(arg_8)

        return arg_6


def Func ( arg_0 ) : arg_1 = set ( ) for arg_2 in arg_0 . get_user_roles ( ) : arg_1 . update ( { ( arg_3 . permission . name , arg_3 . view_menu . name ) for arg_3 in arg_2 . permissions } ) return arg_1

def Func(arg_0):
        """
        Returns a set of tuples with the perm name and view menu name
        """
        arg_1 = set()
        for arg_2 in arg_0.get_user_roles():
            arg_1.update({(arg_3.permission.name, arg_3.view_menu.name)
                                for arg_3 in arg_2.permissions})
        return arg_1


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . walk ( ) : if arg_2 . name == arg_1 : return arg_2

def Func(arg_0, arg_1):
        """
        Gets the specified node by name.

        :return: Node or None if name does not exist in tree
        """
        for arg_2 in arg_0.walk():
            if arg_2.name == arg_1:
                return arg_2


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : for arg_5 in arg_0 . neighbors [ arg_1 ] : if arg_5 not in arg_3 : for arg_6 in arg_0 . curr_domains [ arg_5 ] [ : ] : if not arg_0 . constraints ( arg_1 , arg_2 , arg_5 , arg_6 ) : arg_0 . prune ( arg_5 , arg_6 , arg_4 ) if not arg_0 . curr_domains [ arg_5 ] : return False return True

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    "Prune neighbor values inconsistent with var=value."
    for arg_5 in arg_0.neighbors[arg_1]:
        if arg_5 not in arg_3:
            for arg_6 in arg_0.curr_domains[arg_5][:]:
                if not arg_0.constraints(arg_1, arg_2, arg_5, arg_6):
                    arg_0.prune(arg_5, arg_6, arg_4)
            if not arg_0.curr_domains[arg_5]:
                return False
    return True

Prune neighbor values inconsistent with var = value .


return all(e in IDENTIFIER_PART for e in i)

def Func ( arg_0 ) : if not arg_0 : return False arg_1 = iter ( arg_0 ) if arg_1 . next ( ) not in IDENTIFIER_START : return False return all ( arg_2 in IDENTIFIER_PART for arg_2 in arg_1 )

def Func(arg_0):
    """Does not chceck whether t is not resticted or internal"""
    if not arg_0:
        return False
    arg_1 = iter(arg_0)
    if arg_1.next() not in IDENTIFIER_START:
        return False
    return all(arg_2 in IDENTIFIER_PART for arg_2 in arg_1)


def Func ( arg_0 ) : if arg_0 . use_file : if arg_0 . filename : file_be_gone ( arg_0 . filename ) arg_0 . lines = { } arg_0 . arcs = { }

def Func(arg_0):
        """Erase the data, both in this object, and from its file storage."""
        if arg_0.use_file:
            if arg_0.filename:
                file_be_gone(arg_0.filename)
        arg_0.lines = {}
        arg_0.arcs = {}

Erase the data both in this object and from its file storage .


Return the primary drive channel of this qubit.

def
Func
(
arg_0
)
->
DriveChannel
:
if
arg_0
.
_Funcs
:
return
arg_0
.
_Funcs
[
0
]
else
:
raise
PulseError
(
"No Func channels in q[%d]"
%
arg_0
.
_index
)

def Func(arg_0) -> DriveChannel:
        """Return the primary Func channel of this qubit."""
        if arg_0._Funcs:
            return arg_0._Funcs[0]
        else:
            raise PulseError("No Func channels in q[%d]" % arg_0._index)

Return the primary drive channel of this qubit .


return UploadConfiguration(destination, base_url, allow_extns, deny_extns)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_1
.
config
arg_4
=
'UPLOADED_%s_'
%
arg_0
.
name
.
upper
(
)
arg_5
=
False
if
arg_2
is
:
arg_2
=
dict
(
dest
=
,
url
=
)
arg_6
=
tuple
(
arg_3
.
get
(
arg_4
+
'ALLOW'
,
(
)
)
)
arg_7
=
tuple
(
arg_3
.
get
(
arg_4
+
'DENY'
,
(
)
)
)
arg_8
=
arg_3
.
get
(
arg_4
+
'DEST'
)
arg_9
=
arg_3
.
get
(
arg_4
+
'URL'
)
if
arg_8
is
:
if
arg_0
.
default_dest
:
arg_8
=
arg_0
.
default_dest
(
arg_1
)
if
arg_8
is
:
if
arg_2
[
'dest'
]
is
not
:
arg_5
=
True
arg_8
=
os
.
path
.
join
(
arg_2
[
'dest'
]
,
arg_0
.
name
)
else
:
raise
RuntimeError
(
"no destination for set %s"
%
arg_0
.
name
)
if
arg_9
is
and
arg_5
and
arg_2
[
'url'
]
:
arg_9
=
addslash
(
arg_2
[
'url'
]
)
+
arg_0
.
name
+
'/'
return
UploadConfiguration
(
arg_8
,
arg_9
,
arg_6
,
arg_7
)

def Func(arg_0, arg_1, arg_2=None):
    """
    This is a helper function for `configure_uploads` that extracts the
    configuration for a single set.

    :param uset: The upload set.
    :param app: The app to load the configuration from.
    :param defaults: A dict with keys `url` and `dest` from the
                     `UPLOADS_DEFAULT_DEST` and `DEFAULT_UPLOADS_URL`
                     settings.
    """
    arg_3 = arg_1.config
    arg_4 = 'UPLOADED_%s_' % arg_0.name.upper()
    arg_5 = False
    if arg_2 is None:
        arg_2 = dict(dest=None, url=None)

    arg_6 = tuple(arg_3.get(arg_4 + 'ALLOW', ()))
    arg_7 = tuple(arg_3.get(arg_4 + 'DENY', ()))
    arg_8 = arg_3.get(arg_4 + 'DEST')
    arg_9 = arg_3.get(arg_4 + 'URL')

    if arg_8 is None:
        # the upload set's destination wasn't given
        if arg_0.default_dest:
            # use the "default_dest" callable
            arg_8 = arg_0.default_dest(arg_1)
        if arg_8 is None: # still
            # use the default dest from the config
            if arg_2['dest'] is not None:
                arg_5 = True
                arg_8 = os.path.join(arg_2['dest'], arg_0.name)
            else:
                raise RuntimeError("no destination for set %s" % arg_0.name)

    if arg_9 is None and arg_5 and arg_2['url']:
        arg_9 = addslash(arg_2['url']) + arg_0.name + '/'

    return UploadConfiguration(arg_8, arg_9, arg_6, arg_7)

This is a helper function for configure_uploads that extracts the configuration for a single set .


def Func(arg_0, arg_1):
    """
    Result may be a python dictionary, array or a primitive type
    that can be converted to JSON for writing back the result.
    """
    arg_2 = arg_0.make_success_response(arg_1)
    arg_3 = time.time()
    arg_4 = arg_3 - arg_0.basehandler_starttime
    arg_2[arg_5.RESPONSE_KEY_EXECUTION_TIME] = arg_4
    arg_0.write_json_response(arg_2)

Result may be a python dictionary array or a primitive type that can be converted to JSON for writing back the result .


(self, channel, text, thread=None, reply_broadcast=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
)
:
if
isinstance
(
arg_1
,
SlackRoomIMBase
)
:
arg_1
=
arg_1
.
id
arg_0
.
log
.
debug
(
"Trying to send to %s: %s"
,
arg_1
,
arg_2
)
arg_0
.
sc
.
rtm_Func
(
arg_1
,
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """
        Sends a message to the specified channel

        * channel - The channel to send to.  This can be a SlackChannel object, a channel id, or a channel name
        (without the #)
        * text - String to send
        * thread - reply to the thread. See https://api.slack.com/docs/message-threading#threads_party
        * reply_broadcast - Set to true to indicate your reply is germane to all members of a channel
        """
        # This doesn't want the # in the channel name
        if isinstance(arg_1, SlackRoomIMBase):
            arg_1 = arg_1.id
        arg_0.log.debug("Trying to send to %s: %s", arg_1, arg_2)
        arg_0.sc.rtm_Func(arg_1, arg_2, arg_3=arg_3, arg_4=arg_4)


(returns, sector_alloc, ax=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
**
arg_3
)
:
if
arg_2
is
:
arg_2
=
plt
.
gca
(
)
arg_1
.
plot
(
title
=
'Sector allocation over time'
,
alpha
=
0.5
,
arg_2
=
arg_2
,
**
arg_3
)
arg_4
=
arg_2
.
get_position
(
)
arg_2
.
set_position
(
[
arg_4
.
x0
,
arg_4
.
y0
+
arg_4
.
height
*
0.1
,
arg_4
.
width
,
arg_4
.
height
*
0.9
]
)
arg_2
.
legend
(
loc
=
'upper center'
,
frameon
=
True
,
framealpha
=
0.5
,
bbox_to_anchor
=
(
0.5
,
0.14
)
,
ncol
=
5
)
arg_2
.
set_xlim
(
(
arg_1
.
index
[
0
]
,
arg_1
.
index
[
1
]
)
)
arg_2
.
set_ylabel
(
'Exposure by sector'
)
arg_2
.
set_xlabel
(
''
)
return
arg_2

def Func(arg_0, arg_1, arg_2=None, **arg_3):
    """
    Plots the sector exposures of the portfolio over time.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    sector_alloc : pd.DataFrame
        Portfolio allocation of positions. See pos.get_sector_alloc.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

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

    arg_1.plot(title='Sector allocation over time',
                      alpha=0.5, arg_2=arg_2, **arg_3)

    arg_4 = arg_2.get_position()
    arg_2.set_position([arg_4.x0, arg_4.y0 + arg_4.height * 0.1,
                     arg_4.width, arg_4.height * 0.9])

    # Put a legend below current axis
    arg_2.legend(loc='upper center', frameon=True, framealpha=0.5,
              bbox_to_anchor=(0.5, -0.14), ncol=5)

    arg_2.set_xlim((arg_1.index[0], arg_1.index[-1]))
    arg_2.set_ylabel('Exposure by sector')
    arg_2.set_xlabel('')

    return arg_2

Plots the sector exposures of the portfolio over time .


(cls, the_callable, iterations=1, label=None, schedule='* * * * * *', userdata = None, run_immediately=False, delay_until=None)

def Func(arg_0, arg_1, arg_2=1, arg_3=None, arg_4='* * * * * *', arg_5 = None, arg_6=False, arg_7=None):
        """Class method to run a callable with a specified number of iterations"""
        arg_8 = task_with_callable(arg_1, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5)
        arg_8.iterations = arg_2
        if arg_7 is not None:
            if isinstance(arg_7, datetime):
                if arg_7 > timezone.now():
                    arg_8.start_running = arg_7
                else:
                    raise ValueError("Task cannot start running in the past")
            else:
                raise ValueError("delay_until must be a datetime.datetime instance")
        if arg_6:
            arg_8.next_run = timezone.now()
        else:
            arg_8.calc_next_run()
        arg_8.save()


def Func ( arg_0 ) : def decorator ( arg_1 ) : @ wraps ( arg_1 ) def inner ( arg_2 , * arg_3 , ** arg_4 ) : for arg_5 in arg_0 : if arg_5 not in arg_2 . session [ "user_tokens" ] : return redirect ( 'denied' ) return arg_1 ( arg_2 , * arg_3 , ** arg_4 ) return inner return decorator

def Func(arg_0):
    """
    Ensure the user has the necessary tokens for the specified services
    """
    def decorator(arg_1):
        @wraps(arg_1)
        def inner(arg_2, *arg_3, **arg_4):
            for arg_5 in arg_0:
                if arg_5 not in arg_2.session["user_tokens"]:
                    return redirect('denied')
            return arg_1(arg_2, *arg_3, **arg_4)
        return inner
    return decorator


def Func(arg_0, arg_1):
        """Refreshes the access_token.

        This method first checks by reading the Storage object if available.
        If a refresh is still needed, it holds the Storage lock until the
        refresh is completed.

        Args:
            http: an object to be used to make HTTP requests.

        Raises:
            HttpAccessTokenRefreshError: When the refresh fails.
        """
        if not arg_0.store:
            arg_0._doFunc_request(arg_1)
        else:
            arg_0.store.acquire_lock()
            try:
                arg_2 = arg_0.store.locked_get()

                if (arg_2 and not arg_2.invalid and
                        arg_2.access_token != arg_0.access_token and
                        not arg_2.access_token_expired):
                    logger.info('Updated access_token read from Storage')
                    arg_0._updateFromCredential(arg_2)
                else:
                    arg_0._doFunc_request(arg_1)
            finally:
                arg_0.store.release_lock()


def Func(arg_0, arg_1=()):
    """PyFunc the given file.

    When run from emacs we will be in the directory of a file, and passed its
    filename.  If this file is part of a package and is trying to import other
    modules from within its own package or another package rooted in a directory
    below it, pyFunc will classify it as a failed import.

    To get around this, we traverse down the directory tree to find the root of
    the package this module is in.  We then invoke pyFunc from this directory.

    Finally, we must correct the filenames in the output generated by pyFunc so
    Emacs doesn't become confused (it will expect just the original filename,
    while pyFunc may extend it with extra directories if we've traversed down
    the tree)
    """
    # traverse downwards until we are out of a python package
    arg_2 = osp.abspath(arg_0)
    arg_3 = osp.dirname(arg_2)
    arg_4 = osp.basename(arg_2)

    while arg_3 != "/" and osp.exists(osp.join(arg_3, "__init__.py")):
        arg_4 = osp.join(osp.basename(arg_3), arg_4)
        arg_3 = osp.dirname(arg_3)

    # Start pyFunc
    # Ensure we use the python and pyFunc associated with the running epyFunc
    arg_5 = "import sys; from pyFunc.Func import Run; Run(sys.argv[1:])"
    arg_6 = (
        [sys.executable, "-c", arg_5]
        + [
            "--msg-template",
            "{path}:{line}: {category} ({msg_id}, {symbol}, {obj}) {msg}",
            "-r",
            "n",
            arg_4,
        ]
        + list(arg_1)
    )
    arg_7 = Popen(
        arg_6, stdout=PIPE, cwd=arg_3, env=_get_env(), universal_newlines=True
    )

    for arg_8 in arg_7.stdout:
        # remove pyFuncrc warning
        if arg_8.startswith("No config file found"):
            continue

        # modify the file name thats output to reverse the path traversal we made
        arg_9 = arg_8.split(":")
        if arg_9 and arg_9[0] == arg_4:
            arg_8 = ":".join([arg_0] + arg_9[1:])
        print(arg_8, end=" ")

    arg_7.wait()
    return arg_7.returncode

Pylint the given file.

    When run from emacs we will be in the directory of a file, and passed its
    filename.  If this file is part of a package and is trying to import other
    modules from within its own package or another package rooted in a directory
    below it, pylint will classify it as a failed import.

    To get around this, we traverse down the directory tree to find the root of
    the package this module is in.  We then invoke pylint from this directory.

    Finally, we must correct the filenames in the output generated by pylint so
    Emacs doesn't become confused (it will expect just the original filename,
    while pylint may extend it with extra directories if we've traversed down
    the tree)


def Func ( arg_0 ) : arg_0 = os . path . abspath ( arg_0 ) arg_1 = os . path . basename ( arg_0 ) return os . path . splitext ( arg_1 ) [ 0 ]

def Func(arg_0):
    """given a filename, return the ABFs ID string."""
    arg_0=os.path.abspath(arg_0)
    arg_1=os.path.basename(arg_0)
    return os.path.splitext(arg_1)[0]

given a filename return the ABFs ID string .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . REGEX_DATE . search ( arg_1 ) arg_3 = datetime . datetime . utcnow ( ) . date ( ) if arg_2 : arg_3 = datetime . date ( int ( arg_2 . group ( 1 ) ) , int ( arg_2 . group ( 2 ) ) , int ( arg_2 . group ( 3 ) ) ) arg_1 = arg_0 . REGEX_DATE . sub ( '' , arg_1 ) return ( arg_3 , arg_1 )

def Func(arg_0, arg_1):
    '''Search for date information in the string'''
    arg_2 = arg_0.REGEX_DATE.search(arg_1)
    arg_3 = datetime.datetime.utcnow().date()
    if arg_2:
      arg_3 = datetime.date(int(arg_2.group(1)), int(arg_2.group(2)), int(arg_2.group(3)))
      arg_1 = arg_0.REGEX_DATE.sub('', arg_1)
    return (arg_3, arg_1)


def Func(arg_0, arg_1=None):
        """
        Writes entire crontab to the host.
        """
        arg_2 = arg_0.local_renderer

        arg_0.Func_logrotate()

        arg_3 = []
#         if self.verbose:
#             print('hostname: "%s"' % (hostname,), file=sys.stderr)
        for arg_4, arg_5 in arg_0.iter_sites(arg_1=arg_1):
            arg_2.env.cron_stdout_log = arg_2.format(arg_2.env.stdout_log_template)
            arg_2.env.cron_stderr_log = arg_2.format(arg_2.env.stderr_log_template)
            arg_2.sudo('touch {cron_stdout_log}')
            arg_2.sudo('touch {cron_stderr_log}')
            arg_2.sudo('sudo chown {user}:{user} {cron_stdout_log}')
            arg_2.sudo('sudo chown {user}:{user} {cron_stderr_log}')

            if arg_0.verbose:
                print('site:', arg_1, file=sys.stderr)
                print('env.crontabs_selected:', arg_0.env.crontabs_selected, file=sys.stderr)

            for arg_9 in arg_0.env.crontabs_selected:
                arg_10 = arg_0.env.crontabs_available.get(arg_9, [])
                if arg_0.verbose:
                    print('lines:', arg_10, file=sys.stderr)
                for arg_11 in arg_10:
                    arg_3.append(arg_2.format(arg_11))

        if not arg_3:
            return

        arg_3 = arg_0.env.crontab_headers + arg_3
        arg_3.append('\n')
        arg_2.env.crontabs_rendered = '\n'.join(arg_3)
        arg_13 = arg_0.write_to_file(content=arg_2.env.crontabs_rendered)
        print('fn:', arg_13)
        arg_2.env.put_remote_path = arg_2.put(local_path=arg_13)
        if isinstance(arg_2.env.put_remote_path, (tuple, list)):
            arg_2.env.put_remote_path = arg_2.env.put_remote_path[0]
        arg_2.sudo('crontab -u {cron_user} {put_remote_path}')


(sr, fmin=None, n_bins=84, bins_per_octave=12, tuning=0.0,
               window='hann', filter_scale=1, pad_fft=True, norm=1,
               dtype=np.complex64, **kwargs)

def Func(arg_0, arg_1=None, arg_2=84, arg_3=12, arg_4=0.0,
               arg_5='hann', arg_6=1, arg_7=True, arg_8=1,
               arg_9=arg_10.complex64, **arg_12):
    r'''Construct a constant-Q basis.

    This uses the filter bank described by [1]_.

    .. [1] McVicar, Matthew.
            "A machine learning approach to automatic chord extraction."
            Dissertation, University of Bristol. 2013.

    Parameters
    ----------
    sr : number > 0 [scalar]
        Audio sampling rate

    fmin : float > 0 [scalar]
        Minimum frequency bin. Defaults to `C1 ~= 32.70`

    n_bins : int > 0 [scalar]
        Number of frequencies.  Defaults to 7 octaves (84 bins).

    bins_per_octave : int > 0 [scalar]
        Number of bins per octave

    tuning : float in `[-0.5, +0.5)` [scalar]
        Tuning deviation from A440 in fractions of a bin

    window : string, tuple, number, or function
        Windowing function to apply to filters.

    filter_scale : float > 0 [scalar]
        Scale of filter windows.
        Small values (<1) use shorter windows for higher temporal resolution.

    pad_fft : boolean
        Center-pad all filters up to the nearest integral power of 2.

        By default, padding is done with zeros, but this can be overridden
        by setting the `mode=` field in *kwargs*.

    norm : {inf, -inf, 0, float > 0}
        Type of norm to use for basis function normalization.
        See librosa.util.normalize

    dtype : np.dtype
        The data type of the output basis.
        By default, uses 64-bit (single precision) complex floating point.

    kwargs : additional keyword arguments
        Arguments to `np.pad()` when `pad==True`.

    Returns
    -------
    filters : np.ndarray, `len(filters) == n_bins`
        `filters[i]` is `i`\ th time-domain CQT basis filter

    lengths : np.ndarray, `len(lengths) == n_bins`
        The (fractional) length of each filter

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

    See Also
    --------
    Func_lengths
    librosa.core.cqt
    librosa.util.normalize

    Examples
    --------
    Use a shorter window for each filter

    >>> basis, lengths = librosa.filters.Func(22050, filter_scale=0.5)

    Plot one octave of filters in time and frequency

    >>> import matplotlib.pyplot as plt
    >>> basis, lengths = librosa.filters.Func(22050)
    >>> plt.figure(figsize=(10, 6))
    >>> plt.subplot(2, 1, 1)
    >>> notes = librosa.midi_to_note(np.arange(24, 24 + len(basis)))
    >>> for i, (f, n) in enumerate(zip(basis, notes[:12])):
    ...     f_scale = librosa.util.normalize(f) / 2
    ...     plt.plot(i + f_scale.real)
    ...     plt.plot(i + f_scale.imag, linestyle=':')
    >>> plt.axis('tight')
    >>> plt.yticks(np.arange(len(notes[:12])), notes[:12])
    >>> plt.ylabel('CQ filters')
    >>> plt.title('CQ filters (one octave, time domain)')
    >>> plt.xlabel('Time (samples at 22050 Hz)')
    >>> plt.legend(['Real', 'Imaginary'], frameon=True, framealpha=0.8)
    >>> plt.subplot(2, 1, 2)
    >>> F = np.abs(np.fft.fftn(basis, axes=[-1]))
    >>> # Keep only the positive frequencies
    >>> F = F[:, :(1 + F.shape[1] // 2)]
    >>> librosa.display.specshow(F, x_axis='linear')
    >>> plt.yticks(np.arange(len(notes))[::12], notes[::12])
    >>> plt.ylabel('CQ filters')
    >>> plt.title('CQ filter magnitudes (frequency domain)')
    >>> plt.tight_layout()
    '''

    if arg_1 is None:
        arg_1 = note_to_hz('C1')

    # Pass-through parameters to get the filter lengths
    arg_13 = Func_lengths(arg_0, arg_1,
                                 arg_2=arg_2,
                                 arg_3=arg_3,
                                 arg_4=arg_4,
                                 arg_5=arg_5,
                                 arg_6=arg_6)

    # Apply tuning correction
    arg_14 = 2.0**(float(arg_4) / arg_3)
    arg_1 = arg_14 * arg_1

    # Q should be capitalized here, so we suppress the name warning
    # pylint: disable=invalid-name
    arg_15 = float(arg_6) / (2.0**(1. / arg_3) - 1)

    # Convert lengths back to frequencies
    arg_16 = arg_15 * arg_0 / arg_13

    # Build the filters
    arg_17 = []
    for arg_18, arg_19 in zip(arg_13, arg_16):
        # Build the filter: note, length will be ceil(ilen)
        arg_20 = arg_10.exp(arg_10.arange(-arg_18//2, arg_18//2, arg_9=float) * 1j * 2 * arg_10.pi * arg_19 / arg_0)

        # Apply the windowing function
        arg_20 = arg_20 * __float_window(arg_5)(len(arg_20))

        # Normalize
        arg_20 = util.normalize(arg_20, arg_8=arg_8)

        arg_17.append(arg_20)

    # Pad and stack
    arg_21 = max(arg_13)
    if arg_7:
        arg_21 = int(2.0**(arg_10.ceil(arg_10.log2(arg_21))))
    else:
        arg_21 = int(arg_10.ceil(arg_21))

    arg_17 = arg_10.asarray([util.pad_center(filt, arg_21, **arg_12)
                          for filt in arg_17], arg_9=arg_9)

    return arg_17, arg_10.asarray(arg_13)

r'''Construct a constant-Q basis.

    This uses the filter bank described by [1]_.

    .. [1] McVicar, Matthew.
            "A machine learning approach to automatic chord extraction."
            Dissertation, University of Bristol. 2013.

    Parameters
    ----------
    sr : number > 0 [scalar]
        Audio sampling rate

    fmin : float > 0 [scalar]
        Minimum frequency bin. Defaults to `C1 ~= 32.70`

    n_bins : int > 0 [scalar]
        Number of frequencies.  Defaults to 7 octaves (84 bins).

    bins_per_octave : int > 0 [scalar]
        Number of bins per octave

    tuning : float in `[-0.5, +0.5)` [scalar]
        Tuning deviation from A440 in fractions of a bin

    window : string, tuple, number, or function
        Windowing function to apply to filters.

    filter_scale : float > 0 [scalar]
        Scale of filter windows.
        Small values (<1) use shorter windows for higher temporal resolution.

    pad_fft : boolean
        Center-pad all filters up to the nearest integral power of 2.

        By default, padding is done with zeros, but this can be overridden
        by setting the `mode=` field in *kwargs*.

    norm : {inf, -inf, 0, float > 0}
        Type of norm to use for basis function normalization.
        See librosa.util.normalize

    dtype : np.dtype
        The data type of the output basis.
        By default, uses 64-bit (single precision) complex floating point.

    kwargs : additional keyword arguments
        Arguments to `np.pad()` when `pad==True`.

    Returns
    -------
    filters : np.ndarray, `len(filters) == n_bins`
        `filters[i]` is `i`\ th time-domain CQT basis filter

    lengths : np.ndarray, `len(lengths) == n_bins`
        The (fractional) length of each filter

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

    See Also
    --------
    constant_q_lengths
    librosa.core.cqt
    librosa.util.normalize

    Examples
    --------
    Use a shorter window for each filter

    >>> basis, lengths = librosa.filters.constant_q(22050, filter_scale=0.5)

    Plot one octave of filters in time and frequency

    >>> import matplotlib.pyplot as plt
    >>> basis, lengths = librosa.filters.constant_q(22050)
    >>> plt.figure(figsize=(10, 6))
    >>> plt.subplot(2, 1, 1)
    >>> notes = librosa.midi_to_note(np.arange(24, 24 + len(basis)))
    >>> for i, (f, n) in enumerate(zip(basis, notes[:12])):
    ...     f_scale = librosa.util.normalize(f) / 2
    ...     plt.plot(i + f_scale.real)
    ...     plt.plot(i + f_scale.imag, linestyle=':')
    >>> plt.axis('tight')
    >>> plt.yticks(np.arange(len(notes[:12])), notes[:12])
    >>> plt.ylabel('CQ filters')
    >>> plt.title('CQ filters (one octave, time domain)')
    >>> plt.xlabel('Time (samples at 22050 Hz)')
    >>> plt.legend(['Real', 'Imaginary'], frameon=True, framealpha=0.8)
    >>> plt.subplot(2, 1, 2)
    >>> F = np.abs(np.fft.fftn(basis, axes=[-1]))
    >>> # Keep only the positive frequencies
    >>> F = F[:, :(1 + F.shape[1] // 2)]
    >>> librosa.display.specshow(F, x_axis='linear')
    >>> plt.yticks(np.arange(len(notes))[::12], notes[::12])
    >>> plt.ylabel('CQ filters')
    >>> plt.title('CQ filter magnitudes (frequency domain)')
    >>> plt.tight_layout()


def Func ( ) : arg_0 = po . connect ( ) arg_1 = arg_0 . droplets . list ( ) arg_2 = arg_1 [ 0 ] [ 'id' ] return arg_0 . droplets . get ( arg_2 )

def Func():
    """
    return first droplet
    """
    arg_0 = po.connect() # this depends on the DIGITALOCEAN_API_KEY envvar
    arg_1 = arg_0.droplets.list()
    arg_2 = arg_1[0]['id'] # I'm cheating because I only have one droplet
    return arg_0.droplets.get(arg_2)


(cls, cur, table: str, where_keys: list)

def Func(arg_0, arg_1, arg_2: arg_3, arg_4: arg_5):
        """
        Creates a Func query with where keys
        Supports multiple where clause with and or or both

        Args:
            table: a string indicating the name of the table
            where_keys: list of dictionary
            example of where keys: [{'name':('>', 'cip'),'url':('=', 'cip.com'},{'type':{'<=', 'manufacturer'}}]
            where_clause will look like ((name>%s and url=%s) or (type <= %s))
            items within each dictionary get 'AND'-ed and dictionaries themselves get 'OR'-ed

        Returns:
            an integer indicating count of rows Funcd

        """
        arg_6, arg_7 = arg_0._get_where_clause_with_values(arg_4)
        arg_8 = arg_0._Func_query.format(arg_2, arg_6)
        yield from arg_1.execute(arg_8, arg_7)
        return arg_1.rowcount

Creates a delete query with where keys
        Supports multiple where clause with and or or both

        Args:
            table: a string indicating the name of the table
            where_keys: list of dictionary
            example of where keys: [{'name':('>', 'cip'),'url':('=', 'cip.com'},{'type':{'<=', 'manufacturer'}}]
            where_clause will look like ((name>%s and url=%s) or (type <= %s))
            items within each dictionary get 'AND'-ed and dictionaries themselves get 'OR'-ed

        Returns:
            an integer indicating count of rows deleted


def Func ( arg_0 , arg_1 ) : print ( json . dumps ( arg_0 . messages , indent = 4 ) , file = arg_0 . out )

def Func(arg_0, arg_1):
        """Launch layouts display"""
        print(json.dumps(arg_0.messages, indent=4), file=arg_0.out)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_from ( ) arg_3 = arg_2 . bare ( ) . as_unicode ( ) arg_4 = arg_0 . rooms . get ( arg_3 ) if not arg_4 : return False arg_4 . process_available_presence ( MucPresence ( arg_1 ) ) return True

def Func(arg_0,arg_1):
        """Process an available presence from a MUC room.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `Presence`

        :return: `True` if the stanza was properly recognized as generated by
            one of the managed rooms, `False` otherwise.
        :returntype: `bool`"""
        arg_2=arg_1.get_from()
        arg_3=arg_2.bare().as_unicode()
        arg_4=arg_0.rooms.get(arg_3)
        if not arg_4:
            return False
        arg_4.process_available_presence(MucPresence(arg_1))
        return True

Process an available presence from a MUC room .


def Func ( arg_0 , arg_1 = arg_2 , arg_3 = arg_4 ) : if not arg_3 : arg_3 = arg_4 arg_5 = { "offset" : arg_3 } arg_6 = super ( ) . Func ( arg_1 , ** arg_5 ) return arg_6

def Func(arg_0, arg_1=arg_2, arg_3=arg_4):
        """Fetch items from the ReMo url.

        The method retrieves, from a ReMo URL, the set of items
        of the given `category`.

        :param category: the category of items to Func
        :param offset: obtain items after offset
        :returns: a generator of items
        """
        if not arg_3:
            arg_3 = arg_4

        arg_5 = {"offset": arg_3}
        arg_6 = super().Func(arg_1, **arg_5)

        return arg_6

Fetch items from the ReMo url.

        The method retrieves, from a ReMo URL, the set of items
        of the given `category`.

        :param category: the category of items to fetch
        :param offset: obtain items after offset
        :returns: a generator of items


def Func():
    """
        Loads the config and handles the workers.
    """
    arg_0 = Config()
    arg_1 = arg_0.get('pipes', 'directory')
    arg_2 = arg_0.get('pipes', 'config_file')
    arg_3 = os.path.join(arg_0.config_dir, arg_2)
    if not os.path.exists(arg_3):
        print_error("Please configure the named pipes first")
        return

    arg_4 = create_pipe_workers(arg_3, arg_1)
    if arg_4:
        for arg_5 in arg_4:
            arg_5.start()

        try:
            for arg_5 in arg_4:
                arg_5.join()
        except KeyboardInterrupt:
            print_notification("Shutting down")
            for arg_5 in arg_4:
                arg_5.terminate()
                arg_5.join()

Loads the config and handles the workers .


def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) < 4 : return None if arg_0 . firmware [ 'major' ] < 16 : return ( ( arg_1 [ 3 ] << 24 ) | ( arg_1 [ 2 ] << 16 ) | ( arg_1 [ 1 ] << 8 ) | arg_1 [ 0 ] ) / 12e6 else : return arg_0 . _calculate_float ( arg_1 )

def Func(arg_0, arg_1):
        ''' calculate the sampling period in seconds '''
        if len(arg_1) < 4:
            return None

        if arg_0.firmware['major'] < 16:
            return ((arg_1[3] << 24) | (arg_1[2] << 16) | (arg_1[1] << 8) | arg_1[0]) / 12e6
        else:
            return arg_0._calculate_float(arg_1)


def Func(arg_0, arg_1):
        '''' Read a list of files. Their configuration values are merged, with
             preference to values from files earlier in the list.
        '''
        for arg_2 in arg_1:
            try:
                arg_0.configs[arg_2] = ordered_json.load(arg_2)
            except IOError:
                arg_0.configs[arg_2] = OrderedDict()
            except Exception as e:
                arg_0.configs[arg_2] = OrderedDict()
                logging.warning(
                    "Failed to Func settings file %s, it will be ignored. The error was: %s",
                    arg_2, e
                )

Read a list of files . Their configuration values are merged with preference to values from files earlier in the list .


def Func ( arg_0 ) : for arg_1 in arg_0 . m_observers : try : arg_1 . update ( arg_0 . m_req ) except : ekm_log ( traceback . format_exc ( sys . exc_info ( ) ) )

def Func(arg_0):
        """ Fire update method in all attached observers in order of attachment. """
        for arg_1 in arg_0.m_observers:
            try:
                arg_1.update(arg_0.m_req)
            except:
                ekm_log(traceback.format_exc(sys.exc_info()))

Fire update method in all attached observers in order of attachment .


def Func ( arg_0 , arg_1 , arg_2 = 0 ) : try : arg_3 = arg_0 . api . new_queue ( ) for arg_4 in arg_1 : arg_3 . add ( arg_4 [ 'event' ] , arg_4 [ 'value' ] , source = arg_4 [ 'source' ] ) arg_3 . submit ( ) except : if arg_2 > arg_0 . retries : raise arg_0 . Func ( arg_1 , arg_2 + 1 )

def Func(arg_0, arg_1, arg_2=0):
        """Attempt to upload the batch and retry before raising an error """
        try:
            arg_3 = arg_0.api.new_queue()
            for arg_4 in arg_1:
                arg_3.add(arg_4['event'], arg_4['value'], source=arg_4['source'])
            arg_3.submit()
        except:
            if arg_2 > arg_0.retries:
                raise
            arg_0.Func(arg_1, arg_2+1)


def Func ( arg_0 , arg_1 ) : arg_0 . n = arg_1 return super ( MPILauncher , arg_0 ) . Func ( )

def Func(arg_0, arg_1):
        """Start n instances of the program using mpiexec."""
        arg_0.n = arg_1
        return super(MPILauncher, arg_0).Func()

Start n instances of the program using mpiexec .


def Func ( arg_0 , arg_1 , arg_2 ) : Plugin . Func ( arg_0 , arg_1 , arg_2 ) arg_0 . config = arg_2 if arg_0 . enabled : arg_0 . stats = { 'errors' : 0 , 'failures' : 0 , 'passes' : 0 , 'skipped' : 0 } arg_0 . errorlist = [ ] arg_0 . error_report_file = codecs . open ( arg_1 . xunit_file , 'w' , arg_0 . encoding , 'replace' )

def Func(arg_0, arg_1, arg_2):
        """Configures the xunit plugin."""
        Plugin.Func(arg_0, arg_1, arg_2)
        arg_0.config = arg_2
        if arg_0.enabled:
            arg_0.stats = {'errors': 0,
                          'failures': 0,
                          'passes': 0,
                          'skipped': 0
                          }
            arg_0.errorlist = []
            arg_0.error_report_file = codecs.open(arg_1.xunit_file, 'w',
                                                 arg_0.encoding, 'replace')


def Func ( arg_0 , arg_1 , arg_2 = True ) : if isinstance ( arg_1 , dict ) or isinstance ( arg_1 , SortableDict ) : arg_1 = list ( arg_1 . items ( ) ) for ( arg_3 , arg_4 ) in arg_1 : arg_0 . append ( arg_3 , arg_4 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=True):
        '''
        Append the items to the metadata.
        '''
        if isinstance(arg_1, dict) or isinstance(arg_1, SortableDict):
            arg_1 = list(arg_1.items())

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


def Func ( arg_0 ) : arg_1 = csv . DictReader ( arg_0 , delimiter = ';' , quoting = csv . QUOTE_NONE ) arg_2 = [ ] for arg_3 in arg_1 : if not arg_3 [ 'HGNC_IDnumber' ] . strip ( ) . isdigit ( ) : continue arg_4 = arg_3 . get ( 'Disease_associated_transcript' ) if arg_4 : arg_5 = [ tx . split ( ':' , 1 ) [ - 1 ] . strip ( ) for tx in arg_4 . split ( ',' ) ] else : arg_5 = [ ] arg_6 = arg_3 . get ( 'Genetic_disease_model' ) arg_7 = [ model . strip ( ) for model in arg_6 . split ( ',' ) ] if arg_6 else [ ] arg_8 = dict ( symbol = arg_3 [ 'HGNC_symbol' ] . strip ( ) if arg_3 . get ( 'HGNC_symbol' ) else None , hgnc_id = int ( arg_3 [ 'HGNC_IDnumber' ] . strip ( ) ) , disease_associated_transcripts = arg_5 , reduced_penetrance = True if arg_3 . get ( 'Reduced_penetrance' ) else None , mosaicism = True if arg_3 . get ( 'Mosaicism' ) else None , inheritance_models = arg_7 , database_entry_version = arg_3 . get ( 'Database_entry_version' ) , ) arg_2 . append ( arg_8 ) return arg_2

def Func(arg_0):
    """Parse user submitted panel."""
    arg_1 = csv.DictReader(arg_0, delimiter=';', quoting=csv.QUOTE_NONE)
    arg_2 = []
    for arg_3 in arg_1:
        if not arg_3['HGNC_IDnumber'].strip().isdigit():
            continue
        arg_4 = arg_3.get('Disease_associated_transcript')
        if arg_4:
            arg_5 = [tx.split(':', 1)[-1].strip() for tx in arg_4.split(',')]
        else:
            arg_5 = []

        arg_6 = arg_3.get('Genetic_disease_model')
        arg_7 = [model.strip() for model in arg_6.split(',')] if arg_6 else []
        arg_8 = dict(
            symbol=arg_3['HGNC_symbol'].strip() if arg_3.get('HGNC_symbol') else None,
            hgnc_id=int(arg_3['HGNC_IDnumber'].strip()),
            disease_associated_transcripts=arg_5,
            reduced_penetrance=True if arg_3.get('Reduced_penetrance') else None,
            mosaicism=True if arg_3.get('Mosaicism') else None,
            inheritance_models=arg_7,
            database_entry_version=arg_3.get('Database_entry_version'),
        )
        arg_2.append(arg_8)

    return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _year_info_pq ( arg_1 , 'Stadium' ) ( 'a' ) return sportsref . utils . rel_url_to_id ( arg_2 . attr [ 'href' ] )

def Func(arg_0, arg_1):
        """Returns the ID for the Func in which the team played in a given
        year.

        :year: The year in question.
        :returns: A string representing the Func ID.
        """
        arg_2 = arg_0._year_info_pq(arg_1, 'Stadium')('a')
        return sportsref.utils.rel_url_to_id(arg_2.attr['href'])

Returns the ID for the stadium in which the team played in a given
        year.

        :year: The year in question.
        :returns: A string representing the stadium ID.

Returns the ID for the stadium in which the team played in a given year .


def Func ( arg_0 ) : arg_0 . resource_source_path = os . path . join ( RESOURCE_PATH , 'resource.qrc' ) arg_0 . resource_target_path = RESOURCE_TARGET_PATH

def Func(arg_0):
        '''Finalize options to be used.'''
        arg_0.resource_source_path = os.path.join(RESOURCE_PATH, 'resource.qrc')
        arg_0.resource_target_path = RESOURCE_TARGET_PATH


def Func(arg_0, arg_1):
        """Initialize `Register` from an XML node.

        :Parameters:
            - `xmlnode`: the jabber:x:register XML element.
        :Types:
            - `xmlnode`: `libxml2.xmlNode`"""

        arg_0.__logger.debug("Converting jabber:iq:register element from XML")
        if arg_1.type!="element":
            raise ValueError("XML node is not a jabber:iq:register element (not an element)")
        arg_2=get_node_ns_uri(arg_1)
        if arg_2 and arg_2!=REGISTER_NS or arg_1.name!="query":
            raise ValueError("XML node is not a jabber:iq:register element")

        for arg_3 in xml_element_iter(arg_1.children):
            arg_2 = get_node_ns_uri(arg_3)
            if arg_2 == DATAFORM_NS and arg_3.name == "x" and not arg_0.form:
                arg_0.form = Form(arg_3)
            elif arg_2 != REGISTER_NS:
                continue
            arg_5 = arg_3.name
            if arg_5 == "instructions" and not arg_0.instructions:
                arg_0.instructions = from_utf8(arg_3.getContent())
            elif arg_5 == "registered":
                arg_0.registered = True
            elif arg_5 == "remove":
                arg_0.remove = True
            elif arg_5 in legacy_fields and not getattr(arg_0, arg_5):
                arg_9 = from_utf8(arg_3.getContent())
                if arg_9 is None:
                    arg_9 = u""
                arg_0.__logger.debug(u"Setting legacy field %r to %r" % (arg_5, arg_9))
                setattr(arg_0, arg_5, arg_9)


def Func(arg_0, arg_1):
        """
        Updates the counters per state of the tasks that were running. Can re-add
        to tasks to run in case required.

        :param ti_status: the internal status of the backfill job tasks
        :type ti_status: BackfillJob._DagRunTaskStatus
        """
        for arg_2, arg_3 in list(arg_1.running.items()):
            arg_3.refresh_from_db()
            if arg_3.state == State.SUCCESS:
                arg_1.succeeded.add(arg_2)
                arg_0.log.debug("Task instance %s succeeded. Don't rerun.", arg_3)
                arg_1.running.pop(arg_2)
                continue
            elif arg_3.state == State.SKIPPED:
                arg_1.skipped.add(arg_2)
                arg_0.log.debug("Task instance %s skipped. Don't rerun.", arg_3)
                arg_1.running.pop(arg_2)
                continue
            elif arg_3.state == State.FAILED:
                arg_0.log.error("Task instance %s failed", arg_3)
                arg_1.failed.add(arg_2)
                arg_1.running.pop(arg_2)
                continue
            # special case: if the task needs to run again put it back
            elif arg_3.state == State.UP_FOR_RETRY:
                arg_0.log.warning("Task instance %s is up for retry", arg_3)
                arg_1.running.pop(arg_2)
                arg_1.to_run[arg_2] = arg_3
            # special case: if the task needs to be rescheduled put it back
            elif arg_3.state == State.UP_FOR_RESCHEDULE:
                arg_0.log.warning("Task instance %s is up for reschedule", arg_3)
                arg_1.running.pop(arg_2)
                arg_1.to_run[arg_2] = arg_3
            # special case: The state of the task can be set to NONE by the task itself
            # when it reaches concurrency limits. It could also happen when the state
            # is changed externally, e.g. by clearing tasks from the ui. We need to cover
            # for that as otherwise those tasks would fall outside of the scope of
            # the backfill suddenly.
            elif arg_3.state == State.NONE:
                arg_0.log.warning(
                    "FIXME: task instance %s state was set to none externally or "
                    "reaching concurrency limits. Re-adding task to queue.",
                    arg_3
                )
                arg_3.set_state(State.SCHEDULED)
                arg_1.running.pop(arg_2)
                arg_1.to_run[arg_2] = arg_3

Updates the counters per state of the tasks that were running . Can re - add to tasks to run in case required .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
return
if
isinstance
(
arg_1
,
arg_0
.
base_class
)
:
if
not
arg_1
.
_is_loaded
:
raise
exceptions
.
DatabaseError
(
'Record must be loaded.'
)
return
arg_1
.
_primary_key
return
arg_0
.
base_class
.
Func
(
arg_1
)

def Func(arg_0, arg_1):
        """
        Return primary key; if value is StoredObject, verify
        that it is loaded.

        """
        if arg_1 is None:
            return None
        if isinstance(arg_1, arg_0.base_class):
            if not arg_1._is_loaded:
                raise exceptions.DatabaseError('Record must be loaded.')
            return arg_1._primary_key

        return arg_0.base_class.Func(arg_1)

Return primary key ; if value is StoredObject verify that it is loaded .


(attr: str, msg: str, tp: BaseException = SpotifyException)

def Func ( arg_0 : arg_1 , arg_2 : arg_1 , arg_3 : arg_4 = arg_5 ) -> arg_7 : def decorator ( arg_6 : arg_7 ) -> arg_7 : @ functools . wraps ( arg_6 ) def decorated ( arg_8 , * arg_9 , ** arg_10 ) : if not hasattr ( arg_8 , arg_0 ) : raise arg_3 ( arg_2 ) return arg_6 ( arg_8 , * arg_9 , ** arg_10 ) if inspect . iscoroutinefunction ( arg_6 ) : @ functools . wraps ( arg_6 ) async def decorated ( * arg_9 , ** arg_10 ) : return await decorated ( * arg_9 , ** arg_10 ) return decorated return decorator

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_4 = arg_5) -> arg_7:
    """decorator to assert an object has an attribute when run."""
    def decorator(arg_6: arg_7) -> arg_7:
        @functools.wraps(arg_6)
        def decorated(arg_8, *arg_9, **arg_10):
            if not hasattr(arg_8, arg_0):
                raise arg_3(arg_2)
            return arg_6(arg_8, *arg_9, **arg_10)

        if inspect.iscoroutinefunction(arg_6):
            @functools.wraps(arg_6)
            async def decorated(*arg_9, **arg_10):
                return await decorated(*arg_9, **arg_10)

        return decorated
    return decorator

decorator to assert an object has an attribute when run .


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , static_bundle . BUNDLE_ITERABLE_TYPES ) : arg_1 = [ arg_1 ] if arg_0 . prepare_handlers_chain is None : arg_0 . prepare_handlers_chain = [ ] for arg_3 in arg_1 : arg_0 . prepare_handlers_chain . append ( arg_3 )

def Func(arg_0, arg_1):
        """
        Add prepare handler to bundle

        :type: prepare_handler: static_bundle.handlers.AbstractPrepareHandler
        """
        if not isinstance(arg_1, static_bundle.BUNDLE_ITERABLE_TYPES):
            arg_1 = [arg_1]
        if arg_0.prepare_handlers_chain is None:
            arg_0.prepare_handlers_chain = []
        for arg_3 in arg_1:
            arg_0.prepare_handlers_chain.append(arg_3)


def Func ( arg_0 , arg_1 ) : try : arg_1 . mro ( ) except InconsistentMroError : arg_0 . add_message ( "inconsistent-mro" , args = arg_1 . name , arg_1 = arg_1 ) except DuplicateBasesError : arg_0 . add_message ( "duplicate-bases" , args = arg_1 . name , arg_1 = arg_1 ) except NotImplementedError : pass

def Func(arg_0, arg_1):
        """Detect that a class has a consistent mro or duplicate bases."""
        try:
            arg_1.mro()
        except InconsistentMroError:
            arg_0.add_message("inconsistent-mro", args=arg_1.name, arg_1=arg_1)
        except DuplicateBasesError:
            arg_0.add_message("duplicate-bases", args=arg_1.name, arg_1=arg_1)
        except NotImplementedError:
            # Old style class, there's no mro so don't do anything.
            pass

Detect that a class has a consistent mro or duplicate bases .


def Func ( arg_0 , * arg_1 ) : arg_2 = arg_1 [ 0 ] if len ( arg_1 ) > 1 : arg_2 = arg_2 . replace ( '%' , '%%' ) . replace ( '?' , '%r' ) print ( arg_2 % ( arg_1 [ 1 ] ) ) return arg_0 . Func ( * arg_1 )

def Func(arg_0, *arg_1):
    """Utility function to print sqlite queries before executing.

    Use instead of cur.Func().  First argument is cursor.

    cur.Func(stmt)
    becomes
    util.Func(cur, stmt)
    """
    arg_2 = arg_1[0]
    if len(arg_1) > 1:
        arg_2 = arg_2.replace('%', '%%').replace('?', '%r')
        print(arg_2 % (arg_1[1]))
    return arg_0.Func(*arg_1)

Utility function to print sqlite queries before executing.

    Use instead of cur.execute().  First argument is cursor.

    cur.execute(stmt)
    becomes
    util.execute(cur, stmt)

Utility function to print sqlite queries before executing .


def Func ( arg_0 , arg_1 ) : arg_0 . hook = DiscordWebhookHook ( arg_0 . http_conn_id , arg_0 . webhook_endpoint , arg_0 . message , arg_0 . username , arg_0 . avatar_url , arg_0 . tts , arg_0 . proxy ) arg_0 . hook . Func ( )

def Func(arg_0, arg_1):
        """
        Call the DiscordWebhookHook to post message
        """
        arg_0.hook = DiscordWebhookHook(
            arg_0.http_conn_id,
            arg_0.webhook_endpoint,
            arg_0.message,
            arg_0.username,
            arg_0.avatar_url,
            arg_0.tts,
            arg_0.proxy
        )
        arg_0.hook.Func()


def Func ( arg_0 , arg_1 , ** arg_2 ) : check_type ( arg_1 , basestring , may_be_none = False ) arg_3 = arg_2 . pop ( 'erc' , EXPECTED_RESPONSE_CODE [ 'DELETE' ] ) arg_0 . request ( 'DELETE' , arg_1 , arg_3 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """Sends a DELETE request.

        Args:
            url(basestring): The URL of the API endpoint.
            **kwargs:
                erc(int): The expected (success) response code for the request.
                others: Passed on to the requests package.

        Raises:
            ApiError: If anything other than the expected response code is
                returned by the Webex Teams API endpoint.

        """
        check_type(arg_1, basestring, may_be_none=False)

        # Expected response code
        arg_3 = arg_2.pop('erc', EXPECTED_RESPONSE_CODE['DELETE'])

        arg_0.request('DELETE', arg_1, arg_3, **arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . headers . get ( 'Retry-After' ) if not arg_2 : arg_3 = 0 elif re . match ( r'^\s*[0-9]+\s*$' , arg_2 ) : arg_3 = int ( arg_2 ) else : arg_4 = email . utils . parsedate ( arg_2 ) if arg_4 is None : arg_3 = 0 else : arg_3 = time . mktime ( arg_4 ) - time . time ( ) return max ( 0 , arg_3 )

def Func(arg_0, arg_1):
        """Parse Retry-After header from response if it is set."""
        arg_2 = arg_1.headers.get('Retry-After')

        if not arg_2:
            arg_3 = 0
        elif re.match(r'^\s*[0-9]+\s*$', arg_2):
            arg_3 = int(arg_2)
        else:
            arg_4 = email.utils.parsedate(arg_2)
            if arg_4 is None:
                arg_3 = 0
            else:
                arg_3 = time.mktime(arg_4) - time.time()
        return max(0, arg_3)

Parse Retry - After header from response if it is set .


def Func ( arg_0 ) : arg_1 = type ( arg_0 ) ( ) arg_1 . _p2v = arg_0 . _p2v . Func ( ) arg_1 . _v2p = arg_0 . _v2p . Func ( ) return arg_1

def Func(arg_0):
        """Returns a Func of a Layout instance."""
        arg_1 = type(arg_0)()

        arg_1._p2v = arg_0._p2v.Func()
        arg_1._v2p = arg_0._v2p.Func()

        return arg_1


def Func ( arg_0 ) -> None : arg_1 = set ( ) for arg_2 in reversed ( arg_0 . arguments ) : arg_3 = arg_2 . name . strip ( WS ) if arg_3 in arg_1 : del arg_2 [ : len ( arg_2 . string ) ] else : arg_1 . add ( arg_3 )

def Func(arg_0) -> None:
        """Eliminate duplicate arguments by removing the first occurrences.

        Remove the first occurrences of duplicate arguments, regardless of
        their value. Result of the rendered wikitext should remain the same.
        Warning: Some meaningful data may be removed from wikitext.

        Also see `rm_dup_args_safe` function.
        """
        arg_1 = set()  # type: set
        for arg_2 in reversed(arg_0.arguments):
            arg_3 = arg_2.name.strip(WS)
            if arg_3 in arg_1:
                del arg_2[:len(arg_2.string)]
            else:
                arg_1.add(arg_3)

Eliminate duplicate arguments by removing the first occurrences .


def Func ( arg_0 ) : if _RE_PATTERN_INCLUDE . match ( arg_0 ) : return arg_0 arg_0 = _RE_PATTERN_CLEANSE_LINE_ESCAPES . sub ( '' , arg_0 ) arg_1 = '' while True : arg_2 = Match ( r'^([^\'"]*)([\'"])(.*)$' , arg_0 ) if not arg_2 : arg_1 += arg_0 break arg_3 , arg_4 , arg_5 = arg_2 . groups ( ) if arg_4 == '"' : arg_6 = arg_5 . find ( '"' ) if arg_6 >= 0 : arg_1 += arg_3 + '""' arg_0 = arg_5 [ arg_6 + 1 : ] else : arg_1 += arg_0 break else : if Search ( r'\b(?:0[bBxX]?|[1-9])[0-9a-fA-F]*$' , arg_3 ) : arg_7 = Match ( r'^((?:\'?[0-9a-zA-Z_])*)(.*)$' , "'" + arg_5 ) arg_1 += arg_3 + arg_7 . group ( 1 ) . replace ( "'" , '' ) arg_0 = arg_7 . group ( 2 ) else : arg_6 = arg_5 . find ( '\'' ) if arg_6 >= 0 : arg_1 += arg_3 + "''" arg_0 = arg_5 [ arg_6 + 1 : ] else : arg_1 += arg_0 break return arg_1

def Func(arg_0):
    """Collapses strings and chars on a line to simple "" or '' blocks.

    We nix strings first so we're not fooled by text like '"http://"'

    Args:
      elided: The line being processed.

    Returns:
      The line with collapsed strings.
    """
    if _RE_PATTERN_INCLUDE.match(arg_0):
      return arg_0

    # Remove escaped characters first to make quote/single quote collapsing
    # basic.  Things that look like escaped characters shouldn't occur
    # outside of strings and chars.
    arg_0 = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', arg_0)

    # Replace quoted strings and digit separators.  Both single quotes
    # and double quotes are processed in the same loop, otherwise
    # nested quotes wouldn't work.
    arg_1 = ''
    while True:
      # Find the first quote character
      arg_2 = Match(r'^([^\'"]*)([\'"])(.*)$', arg_0)
      if not arg_2:
        arg_1 += arg_0
        break
      arg_3, arg_4, arg_5 = arg_2.groups()

      if arg_4 == '"':
        # Collapse double quoted strings
        arg_6 = arg_5.find('"')
        if arg_6 >= 0:
          arg_1 += arg_3 + '""'
          arg_0 = arg_5[arg_6 + 1:]
        else:
          # Unmatched double quote, don't bother processing the rest
          # of the line since this is probably a multiline string.
          arg_1 += arg_0
          break
      else:
        # Found single quote, check nearby text to eliminate digit separators.
        #
        # There is no special handling for floating point here, because
        # the integer/fractional/exponent parts would all be parsed
        # correctly as long as there are digits on both sides of the
        # separator.  So we are fine as long as we don't see something
        # like "0.'3" (gcc 4.9.0 will not allow this literal).
        if Search(r'\b(?:0[bBxX]?|[1-9])[0-9a-fA-F]*$', arg_3):
          arg_7 = Match(r'^((?:\'?[0-9a-zA-Z_])*)(.*)$', "'" + arg_5)
          arg_1 += arg_3 + arg_7.group(1).replace("'", '')
          arg_0 = arg_7.group(2)
        else:
          arg_6 = arg_5.find('\'')
          if arg_6 >= 0:
            arg_1 += arg_3 + "''"
            arg_0 = arg_5[arg_6 + 1:]
          else:
            # Unmatched single quote
            arg_1 += arg_0
            break

    return arg_1

Collapses strings and chars on a line to simple or blocks .


def Func(arg_0):
        """Create a Credentials object by reading information from a file.

        It returns an object of type GoogleCredentials.

        Args:
            credential_filename: the path to the file from where the
                                 credentials are to be read

        Raises:
            ApplicationDefaultCredentialsError: raised when the credentials
                                                fail to be retrieved.
        """
        if arg_0 and os.path.isfile(arg_0):
            try:
                return _get_application_default_credential_from_file(
                    arg_0)
            except (ApplicationDefaultCredentialsError, ValueError) as error:
                arg_1 = (' (provided as parameter to the '
                              'Func() method)')
                _raise_exception_for_reading_json(arg_0,
                                                  arg_1,
                                                  error)
        else:
            raise ApplicationDefaultCredentialsError(
                'The parameter passed to the Func() '
                'method should point to a file.')

Create a Credentials object by reading information from a file .


def Func ( arg_0 ) : arg_0 . samples = [ ] with iter ( open ( arg_0 . files . data , 'r' ) ) as infile : infile . next ( ) . strip ( ) . split ( ) while 1 : try : arg_0 . samples . append ( infile . next ( ) . split ( ) [ 0 ] ) except StopIteration : break

def Func(arg_0):
        """ parse sample names from the sequence file"""
        arg_0.samples = []
        with iter(open(arg_0.files.data, 'r')) as infile:
            infile.next().strip().split()
            while 1:
                try:
                    arg_0.samples.append(infile.next().split()[0])
                except StopIteration:
                    break