Converts a standard gRPC target to one that is supported by grpcio

    :param target: the server address.
    :returns: the converted address.
351005
def to_grpc_address(target: str) -> str:
    
    u = urlparse(target)
    if u.scheme == "dns":
        raise ValueError("dns:// not supported")

    if u.scheme == "unix":
        return "unix:"+u.path

    return u.netloc
44183
def target_to_ipv6_long(target):
    

    splitted = target.split('-')
    if len(splitted) != 2:
        return None
    try:
        start_packed = inet_pton(socket.AF_INET6, splitted[0])
        end_packed = inet_pton(socket.AF_INET6, splitted[1])
    except socket.error:
        return None
    if end_packed < start_packed:
        return None
    return ipv6_range_to_list(start_packed, end_packed)
945665
def insecure_channel(target, options=None, *, loop=None, executor=None,
                    standalone_pool_for_streaming=False):
    
    return Channel(_grpc.insecure_channel(target, options), loop, executor, standalone_pool_for_streaming)
1038133
def target_to_ipv6_short(target):
    

    splitted = target.split('-')
    if len(splitted) != 2:
        return None
    try:
        start_packed = inet_pton(socket.AF_INET6, splitted[0])
        end_value = int(splitted[1], 16)
    except (socket.error, ValueError):
        return None
    start_value = int(binascii.hexlify(start_packed[14:]), 16)
    if end_value < 0 or end_value > 0xffff or end_value < start_value:
        return None
    end_packed = start_packed[:14] + struct.pack('!H', end_value)
    return ipv6_range_to_list(start_packed, end_packed)
63682
def symlink(self, source, target):
        ''

        return self.operations('symlink', target.decode(self.encoding),
                                          source.decode(self.encoding))
1088896
def targetHi(self):
        
        hi_byte = None
        if self.target.addr is not None and self._messageFlags.isBroadcast:
            hi_byte = self.target.bytes[2]
        return hi_byte
836885
def do_action(self, target, dry_run=False):
        
        if dry_run is False:
            try:
                filename = os.path.basename(target)
                size = os.path.getsize(target)
                print("{0}\t{1}".format(filename, size))
            except OSError:
                self.logger.error("Error getting size for file: {0}".format(target))

        return target
1350016
def dial(self, target):
        '''
        
        '''

        if not target:
            return None, "target network must be specified with -t or --target"

        url = get_url(self.config, target)

        try:
            if url.startswith('ws'):
                self.w3 = Web3(WebsocketProvider(url))
            elif url.startswith('http'):
                self.w3 = Web3(HTTPProvider(url))
            elif url.endswith('ipc'):
                if url == 'ipc':
                    url = None
                self.w3 = Web3(Web3.IPCProvider(url))
            else:
                return None, "Invalid Provider URL: {}".format(url)

        except Exception as e:
            return None, e

        return self.w3, None
440236
def compute_targets_to_build(self, targets: Iterable[str]) -> Iterable[BuildTarget]:
        
        normalized_targets = set()
        for target in targets:
            normalized_targets.update(self._normalize_target(target))

        targets_to_parse = deque(normalized_targets)
        targets_seen = set(normalized_targets)
        targets_not_found = []
        build_targets = set()

        while targets_to_parse:
            next_target_string = targets_to_parse.popleft()
            next_target = self._parse_target(next_target_string)
            build_file = self.parser.parse_file(next_target.build_file_directory)
            if next_target.name not in build_file.targets:
                targets_not_found.append(next_target_string)
                continue
            target_to_build = build_file.targets[next_target.name]
            build_targets.add(target_to_build)

            new_targets = [
                dependency
                for dependency in target_to_build.dependencies
                if dependency not in targets_seen
            ]
            targets_to_parse.extend(new_targets)
            targets_seen.update(new_targets)

        if targets_not_found and self.fail_on_unbuilt_target:
            raise BuilderException(
                "Target(s) could not be built: {}".format(", ".join(targets_not_found)),
                targets=targets_not_found,
            )
        return build_targets
620972
def ret(self, retn_target=None):
        

        if retn_target is None:
            return self.pop()

        # We may want to return to several levels up there, not only a
        # single stack frame
        return_target_index = self._find_return_target(retn_target)

        if return_target_index is not None:

            o = self
            while return_target_index >= 0:
                o = o.pop()
                return_target_index -= 1
            return o

        l.warning("Returning to an unexpected address %#x", retn_target)
        return self
116423
def move_to(self, destination):
        
        target = self.__get_destination__(destination)
        logger.info("Move %s to %s" % (self, target))
        shutil.move(self.path, unicode(target))
        return target
1126518
def target_to_ipv4_long(target):
    

    splitted = target.split('-')
    if len(splitted) != 2:
        return None
    try:
        start_packed = inet_pton(socket.AF_INET, splitted[0])
        end_packed = inet_pton(socket.AF_INET, splitted[1])
    except socket.error:
        return None
    if end_packed < start_packed:
        return None
    return ipv4_range_to_list(start_packed, end_packed)
1000334
def to(self, target: typing.Union[types.Message, types.Chat, types.base.Integer, types.base.String]):
        
        if isinstance(target, types.Message):
            chat_id = target.chat.id
        elif isinstance(target, types.Chat):
            chat_id = target.id
        elif isinstance(target, (int, str)):
            chat_id = target
        else:
            raise TypeError(f"Bad type of target. ({type(target)})")

        setattr(self, 'chat_id', chat_id)
        return self
646675
def to(target, options = {})
      conversion = conversions[source || detect(object, false), detect(target)]
      conversion.call(object, options)
    end
1053828
def target_socket(self, config):
		
		target = WUDPNetworkNativeTransport.target_socket(self, config)
		if WNetworkIPV4.is_multicast(target.address()) is False:
			raise ValueError('IP multicast address not RFC compliant')
		return target
767464
def _bind_target(self, target, ctx=None):
        

        result = target

        try:
            # get annotations from target if exists.
            local_annotations = get_local_property(
                target, Annotation.__ANNOTATIONS_KEY__, [], ctx=ctx
            )
        except TypeError:
            raise TypeError('target {0} must be hashable.'.format(target))

        # if local_annotations do not exist, put them in target
        if not local_annotations:
            put_properties(
                target,
                properties={Annotation.__ANNOTATIONS_KEY__: local_annotations},
                ctx=ctx
            )

        # insert self at first position
        local_annotations.insert(0, self)

        # add target to self targets
        if target not in self.targets:
            self.targets.append(target)

        return result
1252096
def target_socket(self, config):
		
		target = WNetworkNativeTransport.target_socket(self, config)
		if isinstance(target.address(), WIPV4Address) is False:
			raise ValueError('Invalid address for broadcast transport')
		return target