content
stringlengths
22
815k
id
int64
0
4.91M
def parse_args(): """Parse the arguments.""" parser = argparse.ArgumentParser( "dashboard", description="Data Visualization for the simulation outcome" ) parser.add_argument( "--datadir", type=str, required=True, help="The path to the simulation data folder.", ...
4,400
def running(outputlabel): """ Print a new message to stdout with the tag "Running". Parameters: outputlabel - Required: Message to be printed (str) """ print("[ "+'\033[0;37m'+"RUNNING "+'\033[0;39m'+"] " + outputlabel, end="\r", flush=True) logging.info(outputlabel)
4,401
def test_build_dynamic__with_location_mobility_data(monkeypatch): """ Ensure dynamic mixing matrix can use location-based mobility data set by the user + Google. """ def get_fake_mobility_data(*args, **kwargs): vals = {"work": [1, 1.5, 1.3, 1.1]} days = [0, 1, 2, 3] return vals,...
4,402
def margin_to_brightness(margin, max_lead=30, pct_pts_base=0): """"Tweak max_lead and pct_pts_base to get the desired brightness range""" return int((abs(margin) / max_lead) * 100) + pct_pts_base
4,403
def RotateFullImage2D(src, dst, angle, scale=1.0, interp=InterpolationType.linear): """\ Rotate an image resizing the output to fit all the pixels. Rotates an image clockwise by a given angle (in degrees). The values of unknown pixels in the output image are set to 0. The output I...
4,404
def steer(robots, epsilon): """Steer towards vrand but only as much as allowed by the dynamics Input arguments: robots = robot classes epsilon = maximum allowed distance traveled """ #find minTimes for nearest nodes of all robots minTimes = [] for r in range(0, len(robots)): ...
4,405
def render_practice_text_field_validation1(request): """テキストフィールドのバリデーションの練習""" template = loader.get_template( 'webapp1/practice/vuetify-text-field-validation1.html') # ----------------------------------- # 1 # 1. host1/webapp1/templates/webapp1/prac...
4,406
def cpsf_critical(request): """ cpsf_critical page, deals with file upload and allows the user to spawn off the update task """ if 'project' not in request.session: return HttpResponseRedirect(reverse('index')) transcription_location = os.path.join(settings.ESTORIA_BASE_LOCATION, ...
4,407
def print_relevant_docs(template: str, info: Info) -> None: """Print relevant docs.""" data = DATA[template] print() print("**************************") print() print() print(f"{data['title']} code has been generated") print() if info.files_added: print("Added the following ...
4,408
def hlc3(high, low, close, offset=None, **kwargs): """Indicator: HLC3""" # Validate Arguments high = verify_series(high) low = verify_series(low) close = verify_series(close) offset = get_offset(offset) # Calculate Result hlc3 = (high + low + close) / 3.0 # Offset i...
4,409
def p_attritem(p): """attritem : sname | binfunc""" p[0] = p[1]
4,410
async def findID(context: Context, dueDateID: str = ""): """Find Due date !ass find subject_name """ if not dueDateID: return await notEnoughArgs(context) try: dueDates = DueDateData().findById(context, dueDateID) if len(dueDates) == 0: return await context.send(...
4,411
def expect_ref(ref_port): """Expect the port to be a reference.""" r = ref_port data_type = r.get_data_type() if (not isinstance(r, RefPort)) or len(data_type) == 0 or data_type[0] != 'Ref': raise InvalidPortException('Expected ' + r.get_name() + ' to be a reference')
4,412
def front_page() -> HTML: """ Renders the front page """ return render_template("frontPage.html")
4,413
async def async_setup_entry(hass, entry): """Set up the Samsung TV platform.""" # Initialize bridge data = entry.data.copy() bridge = _async_get_device_bridge(data) if bridge.port is None and bridge.default_port is not None: # For backward compat, set default port for websocket tv d...
4,414
def do_OP_2SWAP(stack): """ >>> s = [1, 2, 3, 4] >>> do_OP_2SWAP(s) >>> print(s) [3, 4, 1, 2] """ stack.append(stack.pop(-4)) stack.append(stack.pop(-4))
4,415
def bring_contact_bonus_list(pb_client, obj_pb_ids, arm_pb_id, table_pb_id): """ For some bring goals, may be useful to also satisfy an object touching table and not touching arm condition. """ correct_contacts = [] for o in obj_pb_ids: o2ee_contact = len(pb_client.getContactPoints(o, arm_pb_id)...
4,416
def test_daily_hour_pairs_are_incorrect(): """ test if in one day a hour pairs are incorrect (end hour is less than start hour) """ calculate_payment = CalculatePayment(line="ANA=MO16:00-12:00", idx=0) hours_worked = calculate_payment.get_hours_worked() assert calculate_payment.get_daily_hour_pairs_wor...
4,417
def topic(**kwargs): """ :param to: Topic ID :return: """ return api_request('topic', kwargs)
4,418
def test_create_below_86_km_layers_boundary_altitudes() -> None: """ Produces correct results. We test the computation of the atmospheric variables (pressure, temperature and mass density) at the level altitudes, i.e. at the model layer boundaries. We assert correctness by comparing their values wi...
4,419
def load_data(filename: str) -> pd.DataFrame: """ Load city daily temperature dataset and preprocess data. Parameters ---------- filename: str Path to house prices dataset Returns ------- Design matrix and response vector (Temp) """ daily_temp_df = pd.read_csv(filename, ...
4,420
def group_intents(input_file, intent_file, slot_file): """ Groups the dataset based on the intents and returns it. Args: input_file : The path to the input file intent_file : The path to the intent file slot_file : The path to the slot file Returns: A dict mapping intents to a list of tuples. ...
4,421
def _get_path(string): # gets file path from variable name """ Gets path that a variable holds, convert it to start from root (.), esolves any symbolic link and returns the converted path. """ varname = string.replace("(long)", "") try: path = c.VAR_STACK[varname] except KeyError: ...
4,422
def create_service_endpoint(service_endpoint_type, authorization_scheme, name, github_access_token=None, github_url=None, azure_rm_tenant_id=None, azure_rm_service_principal_id=None, azure_rm_service_prinicipal_key=None, azure_rm_subscr...
4,423
def voronoi_diagram_interpolation(interpolationcellid, id0, id1, voronoiDataset0, voronoiDataset1, centerlines, step, clippingPoints): """Given two Voronoi datasets interpolate the data sets along the centerline. Args: interpolationcel...
4,424
def plot_kde_matrix(df, w, limits=None, colorbar=True, refval=None): """ Plot a KDE matrix. Parameters ---------- df: Pandas Dataframe The rows are the observations, the columns the variables. w: np.narray The corresponding weights. colorbar: bool Whether to plot th...
4,425
def coverage(app_context, server_url, coverage_rule, json): """Translation coverage as per coverage rule. e.g. transtats coverage rhinstaller """ api_obj = ConsumeAPIs(server_url or app_context.server_url) if json \ else TextOutputAPIs(server_url or app_context.server_url) response = api_ob...
4,426
def test_html_blocks_extrax_05(): """ Test case 05: Single line paragraph with double pragmas to start and end document. """ # Arrange source_markdown = """<!-- pyml --> <!-- pyml --> this is a paragraph <!-- pyml --> <!-- pyml -->""" expected_tokens = [ "[para(3,1):]", "[text(...
4,427
def rebuild(filename, tag=None, format="gz"): """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar* filename is the timezone tarball from ftp.iana.org/tz. """ import tempfile, shutil tmpdir = tempfile.mkdtemp() zonedir = os.path.join(tmpdir, "zoneinfo") moduledir = os.pa...
4,428
def get_root(user_id: Optional[int]) -> str: """ Return the absolute path to the current authenticated user's data storage root directory :param user_id: current user ID (None if user auth is disabled) :return: user's data storage path """ root = app.config['DATA_FILE_ROOT'] if user_id...
4,429
def download_model(model_id, file_format="json", save=True, path="."): """ Download models from BiGG. You can chose to save the file or to return the JSON data. Parameters ---------- model_id : str A valid id for a model in BiGG. file_format : str If you want to save the file, y...
4,430
def open_expand(file_path, *args, **kwargs): """ Allows to use '~' in file_path. """ return open(os.path.expanduser(file_path), *args, **kwargs)
4,431
def get_app(): """load API modules and return the WSGI application""" global get_app, _app, login_manager _app = Flask(__name__, instance_relative_config=True, instance_path=os.environ.get('UKNOW_CONFIG')) _app.config.from_object(DefaultConfig()) _app.secret_key = ...
4,432
def _submit_to_all_logs(log_list, certs_chain): """Submits the chain to all logs in log_list and validates SCTs.""" log_id_to_verifier = _map_log_id_to_verifier(log_list) chain_der = [c.to_der() for c in certs_chain] raw_scts_for_cert = [] for log_url in log_list.keys(): res = _submit_to_si...
4,433
def update(oid, landingZoneProgressItemDetails): """ This function updates an existing landingZoneProgressItem in the landingZoneProgressItem list :param id: id of the landingZoneProgressItem to update in the landingZoneProgressItem list :param landingZoneProgressItem: landingZoneProgressItem to...
4,434
def create_connection(db_file: str): """Create database file.""" conn = None try: conn = sqlite3.connect(db_file) print(sqlite3.version) except Error as e: print(e) return conn
4,435
def _simplex_gradient(op, grad_wrt_weight): """Register gradient for SimplexInterpolationOp.""" grad_wrt_input = simplex_gradient( input=op.inputs[0], weight=op.outputs[0], grad_wrt_weight=grad_wrt_weight, lattice_sizes=op.get_attr('lattice_sizes')) return [grad_wrt_input]
4,436
def assert_equal(actual: Type[numpy.float64], desired: numpy.dtype): """ usage.scipy: 1 """ ...
4,437
def generate_experiment(): """ Generate elastic scattering experiments which are reasonable but random """ exp_dict = {} exp_keys = ['qmin', 'qmax', 'qbin', 'rmin', 'rmax', 'rstep'] exp_ranges = [(0, 1.5), (19., 25.), (.8, .12), (0., 2.5), (30., 50.), (.005, .015)] for n, k...
4,438
def connectDB(): """function to start the database connection using MongoClient from pymongo and the connection link from .env file path. Using certifi to provide certificate in order to enable the connection Returns: Cursor: database white-shark """ try: client = MongoClient(f"{MONGO_U...
4,439
def load_dicom(filename): """Loads in a given dicom file using a pydicom library :param filename: a path to the .dcm.gz or .dcm file :type filename: Union[str, os.path] :return: pydicom.dataset.FileDataset or pydicom.dicomdir.DicomDir :raises TypeError: raised if the file extension does not end wit...
4,440
def test__django_keys_int__float(): """ A float value cannot be interpreted as an int. """ keys = DjangoKeys(DJANGOKEYS_ACCESSING_TYPES_ENV_PATH) with pytest.raises(ValueTypeMismatch): keys.int("INT_VALUE_FLOAT")
4,441
def load_pytorch_policy(fpath, itr, deterministic=False): """ Load a pytorch policy saved with Spinning Up Logger.""" fname = osp.join(fpath, 'pyt_save', 'model'+itr+'.pt') print('\n\nLoading from %s.\n\n'%fname) model = torch.load(fname) # make function for producing an action given a single sta...
4,442
def pkl_dependencies(module, delta, existing): """peer-keepalive dependency checking. 1. 'destination' is required with all pkl configs. 2. If delta has optional pkl keywords present, then all optional pkl keywords in existing must be added to delta, otherwise the device cli will remove those ...
4,443
def assert_pickle(test, obj, value_to_compare=lambda x: x.__dict__, T=None): """ Asserts that an object can be dumped and loaded and still maintain its value. Args: test: Instance of `unittest.TestCase` (for assertions). obj: Obj to dump and then load. value_to_compare: (optiona...
4,444
def make_server(dashboard): """ Creates the server by mounting various API endpoints and static file content for the dashboard Parameters ---------- dashboard : plsexplain.Dashboard The dashboard instance to server Returns ------- FastAPI The application instance that h...
4,445
def add_arguments(parser: KGTKArgumentParser): """ Parse arguments """ parser.add_argument('-i', '--indent', action='count', default=0, help='indentation')
4,446
def vis_mask(checkpoint_path, filename, target_dir, resolution=480): """Use a trained PL checkpoint to compute attention mask on given image.""" patch_size = 8 # mlp_dino = DINOSeg(data_path='dummy', write_path='dummy', n_blocks=3) mlp_dino = DINOSeg.load_from_checkpoint(checkpoint_path).to('cuda:0' i...
4,447
def f(): """This is a function docstring.""" pass
4,448
def bash_complete_line(line, return_line=True, **kwargs): """Provides the completion from the end of the line. Parameters ---------- line : str Line to complete return_line : bool, optional If true (default), will return the entire line, with the completion added. If false, ...
4,449
def use_board(name): """ Use Board. """ _init_pins() return r_eval("pins::use_board(\"" + name + "\")")
4,450
def add_parameter(name, initial_value=1.0, **kwargs): """Adds a new global parameter to the model. :param name: the name for the new global parameter :type name: str :param initial_value: optional the initial value of the parameter (defaults to 1) :type initial_value: float ...
4,451
def get_sample_libraries(samples, study_tables): """ Return libraries for samples. :param samples: Sample object or a list of Sample objects within a study :param study_tables: Rendered study tables :return: GenericMaterial queryset """ from samplesheets.models import GenericMaterial i...
4,452
def parse_next_frame(data): """ Parse the next packet from this MQTT data stream. """ if not data: return None, b'' if len(data) < 2: # Not enough data yet return None, data packet_type, flag1, flag2, flag3, flag4 = bitstruct.unpack('u4b1b1b1b1', data[0:1]) length =...
4,453
def download_page(driver, url, path): """Download a page if it does not exist.""" driver.get(url) spinner = 'modalTelaCarregando' try: WebDriverWait(driver, WAIT).until( ec.invisibility_of_element((By.ID, spinner))) except (TimeoutError, socket.timeout, HTTPError): log(f...
4,454
def pick_glance_api_server(): """Return which Glance API server to use for the request This method provides a very primitive form of load-balancing suitable for testing and sandbox environments. In production, it would be better to use one IP and route that to a real load-balancer. Returns (ho...
4,455
def remove_punctuation(transcriptions): """ :param: transcriptions is the dictionary containing text file that has been converted into an array. :return: cleaned string of words This function removes punctuations from the story """ parsed_string = dumps(transcriptions) punctuations = '''[],!...
4,456
def test_reverse_short(): """Test reversing a short string.""" expected = reverse("Alex") actual = "xelA" assert actual == expected
4,457
def snakify(str_: str) -> str: """Convert a string to snake case Args: str_: The string to convert """ return str_.replace(" ", "_").lower()
4,458
def search_images( project, image_name_prefix=None, annotation_status=None, return_metadata=False ): """Search images by name_prefix (case-insensitive) and annotation status :param project: project name or folder path (e.g., "project1/folder1") :type project: str :param image_name_prefi...
4,459
def bibtexNoteszotero(bibtex_names): """ params: bibtex_names, {} response, {} return: notes_dict, {} """ # notes_dict = {} notes_dict["itemType"] = "note" notes_dict["relations"] = {} notes_dict["tags"] = [] notes_dict["note"] = bibtex_names["notes"].strip() # r...
4,460
def iliev_test_5(N=10000, Ns=10, L=15. | units.kpc, dt=None): """ prepare iliev test and return SPH and simplex interfaces """ gas, sources = iliev_test_5_ic(N, Ns, L) conv = nbody_system.nbody_to_si(1.0e9 | units.MSun, 1.0 | units.kpc) sph = ...
4,461
def test_dynamics_tracer(): """Sanity check for dynamics tracer.""" tracer = wn.causal_graphs.trace_dynamics(simple_dynamics) for time in range(10): state = SimpleState() config = SimpleConfig() dependencies = tracer(state, time, config) if time % 3 == 0: assert ...
4,462
def initialize_list(list_name, number_of_fields, value): """ Set given number of fields with given value to a list Arguments: - list_name: name of list to initialize - number_of_fields: number of fields to add - value: value to insert in fields """ # in case if not empty list list_name.clear() for i in ran...
4,463
def run(model, model_params, T, method, method_params, num_iter, tmp_path="/tmp/consistency_check.txt", seed=None, verbose=False, simplified_interface=True): """ Wrapper around the full consistency check pipeline. Parameters ---------- model : str Name ...
4,464
def clean_street(address: str) -> str: """ Function to clean street strings. """ address = address.lower() address = _standardize_street(address) address = _abb_replace(address) address = _ordinal_rep(address) if address in SPECIAL_CASES.keys(): # Special cases address = SPECIAL_...
4,465
def unroll_policy_for_eval( sess, env, inputs_feed, prev_state_feed, policy_outputs, number_of_steps, output_folder, ): """unrolls the policy for testing. Args: sess: tf.Session env: The environment. inputs_feed: dictionary of placeholder for the input modaliti...
4,466
def init_worker(): """ Process pool initialization. """ # prevent SIGINT propagation to the subprocesses signal(SIGINT, SIG_IGN)
4,467
def get_result_filename(params, commit=''): """ 获取时间 :return: """ save_result_dir = params['test_save_dir'] batch_size = params['batch_size'] epochs = params['epochs'] max_length_inp = ['max_dec_len'] embedding_dim = ['embed_size'] now_time = time.strftime('%Y_%m_%d_%H_%M_%S') ...
4,468
def is_iterable(o: any) -> bool: """ Checks if `o` is iterable Parameters ---------- o : any The value to be checked. Examples -------- >>> is_iterable(list(range(5))) True >>> is_iterable(5) False >>> is_iterable('hello world') True ...
4,469
def fit(init_file, semipar=False): """ """ check_presence_init(init_file) dict_ = read(init_file) # Perform some consistency checks given the user's request check_presence_estimation_dataset(dict_) check_initialization_dict(dict_) # Semiparametric Model if semipar is True: qua...
4,470
def date2gpswd(date): """Convert date to GPS week and day of week, return int tuple (week, day). Example: >>> from datetime import date >>> date2gpswd(date(2017, 5, 17)) (1949, 3) >>> date2gpswd(date(1917, 5, 17)) Traceback (most recent call last): ... ValueError: Invalid date: 191...
4,471
def draw(): """This function clears the screen and draws a single pixel, whenever the buffer needs updating. Note that colors are specified as palette indexes (0-15).""" pyxel.cls(0) # clear screen (color) render() pyxel.mouse(True)
4,472
def export_catalog(dataframe, **kwargs): """ exports data as csv dataframe : pandas.DataFrame kwargs : pandas.DataFrame.to_csv kwargs """ dataframe.to_csv(**kwargs)
4,473
def installExceptionHandler(): """ Install the exception handling function. """ sys.excepthook = lambda etype, value, tb: handleMyException((etype, value, tb))
4,474
def __make_sliders(no, f): """Create dynamic sliders for a specific field""" style = {'width':'20%', 'display': 'none'} return html.Div(id={'index': f'Slider_{no}', 'type':'slider'}, children=[__make_slider(no, i) for i in range(1,f+1)], style=style)
4,475
def run(**options): # pragma: no cover """Runs a Job.""" CLIUtils.run(**options)
4,476
def kurtosis(iterable, sample=False): """ Returns the degree of peakedness of the given list of values: > 0.0 => sharper peak around mean(list) = more infrequent, extreme values, < 0.0 => wider peak around mean(list), = 0.0 => normal distribution, = -3 => flat """ a = iterab...
4,477
def gen_data(shape, dtype, epsilon): """Generate data for testing the op.""" var = random_gaussian(shape, miu=1, sigma=0.3).astype(dtype) m = random_gaussian(shape, miu=1, sigma=0.3).astype(dtype) v = random_gaussian(shape, miu=1, sigma=0.3).astype(dtype) grad = random_gaussian(shape, miu=1, sigma=0...
4,478
def add_common_options(parser): """Add common options to the parser. Args: parser : parser to add the arguments to. Return: parser : After adding the arguments. """ # Common Arguments parser.add_argument('--data_path', '-dp', dest='data_path', required=False, type=str, nargs=None...
4,479
def factor_tmom_T1_RTN_60(df: pd.DataFrame): """ factor example """ factor = df['return'].rolling(60).sum() return factor
4,480
def get_dataset_info(dataset_name='mnist'): """Method to return dataset information for a specific dataset_name. Args: dataset_name: a string representing the dataset to be loaded using tfds Returns: A dictionary of relevant information for the loaded dataset. """ ds_info = tfds.builder(dataset_nam...
4,481
def full_model(mode, hparams): """Make a clause search model including input pipeline. Args: mode: Either 'train' or 'eval'. hparams: Hyperparameters. See default_hparams for details. Returns: logits, labels Raises: ValueError: If the model returns badly shaped tensors. """ if hparams.us...
4,482
def aggregatePredictions(df_pred, threshold=0.8): """ Aggregates probabilistic predictions, choosing the state with the largest probability, if it exceeds the threshold. :param pd.DataFrame df_pred: columns: state rows: instance values: float :param float threshold: :return pd.Series: ...
4,483
def test_create_topic_fail(): """ Test create topic fail for some reason """ publisher = mock.Mock() publisher.create_topic.side_effect = exceptions.GoogleAPIError with pytest.raises(exceptions.GoogleAPIError): create_topic(publisher, "project", "topic")
4,484
def GetLocalInstanceConfig(local_instance_id): """Get the path of instance config. Args: local_instance_id: Integer of instance id. Return: String, path of cf runtime config. """ cfg_path = os.path.join(GetLocalInstanceRuntimeDir(local_instance_id), cons...
4,485
def is_input_element(obj: Any) -> bool: """ Returns True, if the given object is an :class:`.InputElement`, or a subclass of InputElement. """ return isinstance(obj, InputElement)
4,486
def setup(): """ Install uWSGI system wide and upload vassals """ install() configure()
4,487
def line_intersects_grid((x0,y0), (x1,y1), grid, grid_cell_size=1): """ Performs a line/grid intersection, finding the "super cover" of a line and seeing if any of the grid cells are occupied. The line runs between (x0,y0) and (x1,y1), and (0,0) is the top-left corner of the top-left grid ce...
4,488
def SimuGumbel(n, m, theta): """ # Gumbel copula Requires: n = number of variables to generate m = sample size theta = Gumbel copula parameter """ v = [np.random.uniform(0,1,m) for i in range(0,n)] X = levy_stable.rvs(alpha=1/theta, beta=1,scale=(np.cos(np.pi/(2*theta)))...
4,489
def Norm(x, y): """求一个二维向量模长""" return math.pow(math.pow(x, 2) + math.pow(y, 2), 0.5)
4,490
def make_roi(ms_experiment: ms_experiment_type, tolerance: float, max_missing: int, min_length: int, min_intensity: float, multiple_match: str, targeted_mz: Optional[np.ndarray] = None, start: Optional[int] = None, end: Optional[int] = None, mz_reduce: Union[str, Call...
4,491
def get_all_zcs_containers(session, start=None, limit=None, return_type=None, **kwargs): """ Retrieves details for all Zadara Container Services (ZCS) containers configured on the VPSA. :type session: zadarapy.session.Session :param session: A valid zadarapy.session.Sessi...
4,492
def trainAndPredictModel(model_type="basic", features_cutoff=3, regularizer=1, pretrained=False, viterbi_cutoff=20): """main interface method for easily training a model, running inference for predictions, evaluate it and generate competition file for it.""" data = readData(train_file) features = constr...
4,493
def jordan_wigner(n): """ Generates the Jordan-Wigner representation of the fermionic creation, annihilation, and Majorana operators for an n-mode system. The convention for the Majorana operators is as follows: c_j=aj^{dag}+aj c_{n+j}=i(aj^{dag}-aj) """ s = ket(2, 0) @ dag(k...
4,494
def make_update(label: str, update_time: str, repeat: str, data: str, news: str) -> list[dict]: """Schedules an update with name 'label' to happen in 'interval' seconds. Updates saved covid data, news and repeats the update depending on the content of the respective parameters. Adds to global 'scheduled_upd...
4,495
def performTest(name, test): #{{{ """ Given a series of writes in `test', generate a format string and pass it to the vulnerable program. If the writes were successful without destroying any other memory locations, return True. Terminates after 2 seconds to handle infinite loops in libformatstr. ...
4,496
def readsignal_VEC(name , fa): """ Reads the time signal stored in the file var.txt and written in a single column format. Returns the signal into the single vector signal. fa is an instrumental amplification factor """ path = '../data/' channel = np.loadtxt(path + name + '.txt') ...
4,497
def extract_slide_texture_features(index, output_segment, slide_path, halo_roi_path, method_data): """Extract slide texture features Args: index (string): main index string output_segment (string): path to write result parquet slide_path (string): path to the whole slide image h...
4,498
def connect(host="localhost", port=27450): """Connect to server.""" client = socket(AF_INET, SOCK_DGRAM) client.connect((host, port)) return client
4,499