How to use the deprecated.sphinx.deprecated function in Deprecated

To help you get started, we’ve selected a few Deprecated examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tantale / deprecated / tests / test_sphinx.py View on Github external
            @deprecated.sphinx.deprecated
            def foo3(self):
                pass
github kubeflow / pipelines / sdk / python / kfp / notebook / _magic.py View on Github external
@deprecated(version='0.1.32', reason='The %%docker magic is deprecated. Use `kfp.containers.build_image_from_working_dir` instead.')
def docker(line, cell):
  """cell magic for %%docker"""

  if len(line.split()) < 2:
    raise ValueError("usage: %%docker [gcr.io/project/image:tag] [gs://staging-bucket] [600] [kubeflow]\n\
                      arg1(required): target image tag\n\
                      arg2(required): staging gcs bucket\n\
                      arg3(optional): timeout in seconds, default(600)\n\
                      arg4(optional): namespace, default(kubeflow)")
  if not cell.strip():
    raise ValueError("Please fill in a dockerfile content in the cell.")

  fields = line.split()

  with tempfile.NamedTemporaryFile(mode='wt', delete=False) as f:
    f.write(cell)
github rhgrant10 / tsplib95 / tsplib95 / loaders.py View on Github external
@deprecated(
    version='7.0.0',
    reason='Will be removed in newer versions. Use `tsplib95.load` instead.'
)
def load_solution(filepath):
    """Load a solution at the given filepath.

    :param str filepath: path to a TSPLIB solution file
    :return: solution instance
    :rtype: :class:`~Solution`
    """
    return load(filepath)
github HyperionGray / python-chrome-devtools-protocol / cdp / page.py View on Github external
@deprecated(version="1.3")
def set_device_metrics_override(
        width: int,
        height: int,
        device_scale_factor: float,
        mobile: bool,
        scale: typing.Optional[float] = None,
        screen_width: typing.Optional[int] = None,
        screen_height: typing.Optional[int] = None,
        position_x: typing.Optional[int] = None,
        position_y: typing.Optional[int] = None,
        dont_set_visible_size: typing.Optional[bool] = None,
        screen_orientation: typing.Optional[emulation.ScreenOrientation] = None,
        viewport: typing.Optional[Viewport] = None
    ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
    '''
    Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
github Sage-Bionetworks / synapsePythonClient / synapseclient / credentials / credential_provider.py View on Github external
if password is not None:
                retrieved_session_token = syn._getSessionToken(email=username, password=password)
                return SynapseCredentials(username, syn._getAPIKey(retrieved_session_token))
            elif api_key is not None:
                return SynapseCredentials(username, api_key)
        return None


class UserArgsCredentialsProvider(SynapseCredentialsProvider):
    """
    Retrieves auth info from user_login_args
    """
    def _get_auth_info(self, syn, user_login_args):
        return user_login_args.username, user_login_args.password, user_login_args.api_key

@deprecated.sphinx.deprecated(version='1.9.0', action='ignore',
                              reason="This will be removed in 2.0. Please use username and password or apiKey instead.")
class UserArgsSessionTokenCredentialsProvider(SynapseCredentialsProvider):
    """
    This is a special case where we are not given context as to what the username is. We are only given a session token
    and must retrieve the username and api key from Synapse
    """

    def _get_auth_info(self, syn, user_login_args):
        if user_login_args.session_token:
            return syn.getUserProfile(sessionToken=user_login_args.session_token)['userName'], None,\
                   syn._getAPIKey(user_login_args.session_token)
        return None, None, None


class ConfigFileCredentialsProvider(SynapseCredentialsProvider):
    """
github OCR-D / core / ocrd / ocrd / workspace.py View on Github external
    @deprecated(version='1.0.0', reason="Use workspace.download_file")
    def download_url(self, url, **kwargs):
        """
        Download a URL to the workspace.

        Args:
            url (string): URL to download to directory
            **kwargs : See :py:mod:`ocrd_models.ocrd_file.OcrdFile`

        Returns:
            The local filename of the downloaded file
        """
        f = OcrdFile(None, url=url, **kwargs)
        f = self.download_file(f)
        return f.local_filename
github rhgrant10 / tsplib95 / tsplib95 / loaders.py View on Github external
@deprecated(
    version='7.0.0',
    reason='Will be removed in newer versions. Use `tsplib95.parse` instead.'
)
def load_problem_fromstring(text, special=None):
    """Load a problem from raw text.

    :param str text: text of a TSPLIB problem
    :param callable special: special/custom distance function
    :return: problem instance
    :rtype: :class:`~Problem`
    """
    return parse(text, special=special)
github HyperionGray / python-chrome-devtools-protocol / cdp / page.py View on Github external
@deprecated(version="1.3")
def clear_geolocation_override() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
    '''
    Clears the overriden Geolocation Position and Error.

    .. deprecated:: 1.3
    '''
    cmd_dict: T_JSON_DICT = {
        'method': 'Page.clearGeolocationOverride',
    }
    json = yield cmd_dict
github HyperionGray / python-chrome-devtools-protocol / cdp / page.py View on Github external
@deprecated(version="1.3")
def set_device_orientation_override(
        alpha: float,
        beta: float,
        gamma: float
    ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
    '''
    Overrides the Device Orientation.

    .. deprecated:: 1.3

    **EXPERIMENTAL**

    :param alpha: Mock alpha
    :param beta: Mock beta
    :param gamma: Mock gamma
    '''
github geopython / stetl / stetl / main.py View on Github external
@deprecated(version='1.0.7', reason='now using @Config which also documents with Spinx.')
def print_config_attrs(clazz):
    skip = ['Filter', 'Input', 'Output', 'Component']
    for base in clazz.__bases__:

        if base.__name__ not in skip:
            print_config_attrs(base)

    """Print documentation for Attr object"""

    module_name, _, class_name = clazz.__name__.rpartition('.')
    # print ('From class: %s' % class_name)

    attr_count = 0
    for member in clazz.__dict__.keys():
        if member.startswith('cfg_'):
            config_obj = clazz.__dict__[member]