query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Extracts intermediate and last hidden states
def extract_hidden_states(self, output): # Intermediate hidden states output_fw_intermediate = output[:,:-1,0:self._hidden_size] output_bw_intermediate = output[:,1:,self._hidden_size:] # Last hidden states output_fw = output[:,-1,0:self._hidden_size] output_bw ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_hidden_states(self, output):\n \n # Extracting the forward and backward hidden states from the last BiLSTM layer\n # output (batch_size, sequence length, 2 * hidden dim)\n output_fw = output[:,:,0:self._hidden_size]\n output_bw = output[:,:,self._hidden_size:]\n ...
[ "0.7124553", "0.66910857", "0.668173", "0.6495266", "0.63891685", "0.63413036", "0.63327545", "0.6322163", "0.62529796", "0.6247621", "0.61202276", "0.6086323", "0.6083734", "0.60036206", "0.5999816", "0.5995558", "0.59741884", "0.5928138", "0.5910407", "0.5886927", "0.587857...
0.75195116
0
Carries out internal processing for each hidden state output direction.
def implement_processing(self, output_intermediate, processing_matrix, forward = True): # Attention implementation output_intermediate = torch.matmul(output_intermediate, processing_matrix) output_intermediate = torch.transpose(output_intermediate,2,1) # Linear laye...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _TransformHidden(self, _):\n raise NotImplementedError()", "def _assign_output_states(self):\n for mech in self.terminalMechanisms.mechanisms:\n self.outputStates[mech.name] = mech.outputStates", "def extract_hidden_states(self, output):\n # Intermediate hidden states\n o...
[ "0.5916735", "0.56957465", "0.5666486", "0.5534946", "0.546069", "0.54430485", "0.543081", "0.5429324", "0.5394006", "0.5337721", "0.53335506", "0.52718914", "0.52442145", "0.52384883", "0.5234001", "0.521342", "0.52043676", "0.52028215", "0.52019", "0.51905334", "0.5185234",...
0.0
-1
Get the link to the mp3 that has the pronunciation of the word
def pron(word): return send_from_directory('prons', word + ".mp3", mimetype="audio/mpeg")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_url(word):\n\tfor i, _ in enumerate(word['pronunciations']):\n\t\turl = word['pronunciations'][i]['url']\n\n\t\ttry:\n\t\t\togg_file = url.rsplit('/', 1)[1]\n\t\t\tmp3_file = ogg_file.split('.')[0] + '.mp3'\n\n\t\t\tword['pronunciations'][i]['filename'] = mp3_file\n\t\t\tword['pronunciations'][i].pop('...
[ "0.6719211", "0.6286832", "0.58968437", "0.58269715", "0.57700187", "0.5694772", "0.561889", "0.5577821", "0.55301756", "0.5515074", "0.5479446", "0.54604495", "0.54530525", "0.5450867", "0.5440568", "0.5434193", "0.5410042", "0.5328304", "0.5322993", "0.53166324", "0.5315228...
0.68460476
0
Return a random word and four different pronunciation.
def word(): word = Word(random_word()) # word = Word("arroyo") word.speak() word.messup() l.debug("Displaying %s", word.word) prons = sorted([word.word, word.word + "-a", word.word + "-b", word.word + "-c"], key=lambda x: random.random()) return jsonify({"word": word.word, "pron": prons,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_horror_title():\n d666 = random.randint(1, 666)\n if d666 <= 111:\n #the adj noun\n return \"The \" + horror_adj[random.randint(0, len(horror_adj) - 1)] + \" \" + horror_noun[random.randint(0, len(horror_noun) - 1)]\n elif d666 > 111 and d666 <= 222: \n #noun of noun\n ...
[ "0.69656295", "0.69620365", "0.6938039", "0.6865141", "0.6855903", "0.6780548", "0.66918164", "0.6684589", "0.6667548", "0.664169", "0.65605426", "0.65605426", "0.65605426", "0.64935744", "0.6492746", "0.6466923", "0.6423011", "0.6421722", "0.64096063", "0.6375458", "0.636185...
0.60104597
50
Match sizes by comparing each set field. Process size may change inbetween two measurements.
def _match_sizes(self, pi1, pi2, ignore=[]): if pi1.available and pi2.available: for arg in ('vsz', 'rss', 'data_segment', 'shared_segment', 'stack_segment', 'code_segment'): if arg in ignore: continue size1 = getattr(pi1, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assign_sizes(self):", "def test_mid_sizes(self):\n for size in settings.MISAGO_AVATARS_SIZES:\n self.assertEqual(clean_size(size - 1), size)", "def test_valid_sizes(self):\n for size in settings.MISAGO_AVATARS_SIZES:\n self.assertEqual(clean_size(size), size)", "def c...
[ "0.6204795", "0.6184761", "0.61249745", "0.610729", "0.59723085", "0.5955496", "0.5939015", "0.5932825", "0.58930546", "0.58097595", "0.58097595", "0.58097595", "0.58097595", "0.58097595", "0.58097595", "0.58097595", "0.5759278", "0.5759278", "0.57523656", "0.57167405", "0.56...
0.6783647
0
Capture ValidationError and Logs.
def test_validate_and_logger(self): data = V20CredProblemReport( description={ "en": "Insufficient credit", "code": "invalid_code", }, ).serialize() self._caplog.set_level(logging.WARNING) V20CredProblemReportSchema().validate_field...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_handler(self, failure):\n log.error(failure)", "def processErrors(self):\n e = self.formatErrors()\n if not self.config.nologtostdout:\n if e:\n print e\n else:\n print \"No errors\"\n if self.config.logtomail:\n ...
[ "0.6105171", "0.5935109", "0.5904136", "0.5833974", "0.581675", "0.57186264", "0.5662167", "0.5657665", "0.5589514", "0.5571021", "0.5549629", "0.55409443", "0.5504729", "0.55027974", "0.55014676", "0.54995173", "0.5453479", "0.5451817", "0.5447798", "0.54443485", "0.54336685...
0.52045256
44
Returns the list of container registries each of which is an ordered dictionary.
def output_format(result): if 'value' in result and isinstance(result['value'], list): result = result['value'] obj_list = result if isinstance(result, list) else [result] return [_format_group(item) for item in obj_list]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_registries():\n url = \"/\".join([REGISTRY_BASE, \"_catalog\"])\n response = req(url)\n if response is not None:\n return response[\"repositories\"]\n return []", "def containers(self):\r\n return [JSONContainer(c) for c\r\n in self.container.get(\"Containers\", [...
[ "0.69137096", "0.6764479", "0.6561832", "0.6402633", "0.6357411", "0.62526804", "0.61654025", "0.612648", "0.60717183", "0.60332584", "0.60280293", "0.60130984", "0.59799194", "0.5978797", "0.59747064", "0.5971127", "0.5962707", "0.59357166", "0.5931848", "0.588443", "0.58628...
0.0
-1
Returns an ordered dictionary of the container registry.
def _format_group(item): table_info = {_property_map[key]: str(item[key]) for key in item if key in _property_map} try: table_info['SKU'] = item['sku']['name'] except (KeyError, TypeError): pass try: table_info['USERNAME'] = item['username'] except (KeyError, TypeError): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_registry_keys( ):\n return _theRegistry.get_codes().keys()", "def registry(self):\n if self._registry is None:\n print('Creating container registry...')\n registry_ops = self.registry_client.registries\n try:\n registry = registry_ops.get(\n ...
[ "0.67599016", "0.6461334", "0.6459659", "0.64198136", "0.64024276", "0.63673127", "0.6053186", "0.6050705", "0.5892358", "0.5852548", "0.58208233", "0.5747135", "0.5703876", "0.5644097", "0.5632085", "0.5615898", "0.56062925", "0.5587612", "0.558675", "0.55411214", "0.5534757...
0.0
-1
Compile input schemas from each of the data interface classes.
def get_source_schema(cls) -> dict: source_schema = get_base_schema( root=True, id_="source.schema.json", title="Source data schema", description="Schema for the source data, files and directories", version="0.1.0", ) for interface_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _CreateSchemas(self) -> None:\n self.schema_objs = dict() # Holds OpenAPI representations of types.\n\n # Add the OpenAPI schemas of protobuf primitive types.\n primitive_type_schemas = {\n primitive_type[\"name\"]: primitive_type[\"schema\"]\n for primitive_type in primitive_types.valu...
[ "0.61216074", "0.60818344", "0.6044326", "0.58399236", "0.5777027", "0.57683086", "0.5712437", "0.56210655", "0.5593061", "0.55118495", "0.54837036", "0.54643106", "0.5436546", "0.5413458", "0.54083556", "0.5375735", "0.53655887", "0.53034586", "0.5283603", "0.5244687", "0.52...
0.53621715
17
Compile conversion option schemas from each of the data interface classes.
def get_conversion_options_schema(self) -> dict: conversion_options_schema = get_base_schema( root=True, id_="conversion_options.schema.json", title="Conversion options schema", description="Schema for the conversion options", version="0.1.0", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schema_generators():\n return {\n \"trips\": trips_schema,\n \"status_changes\": status_changes_schema,\n \"events\": events_schema,\n \"vehicles\": vehicles_schema,\n \"stops\": stops_schema\n }", "def buildConverters(tableSpec, tableNamespace):\n converters = []\...
[ "0.56526315", "0.5620702", "0.5523117", "0.55160886", "0.536558", "0.51273906", "0.5100788", "0.50955427", "0.50951093", "0.50712836", "0.49624124", "0.49403378", "0.49315578", "0.49236938", "0.48799866", "0.4868732", "0.4861183", "0.48473457", "0.48407805", "0.48375595", "0....
0.6372114
0
Validate source_data against Converter source_schema.
def validate_source(cls, source_data: Dict[str, dict], verbose: bool = True): cls._validate_source_data(source_data=source_data, verbose=verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(cls, data, errors):", "def validate(self, *, destination: FieldModel, source: list) -> bool:\n if not isinstance(source, list):\n raise ValueError(f\"Action source script does not conform to required structure. ({source})\")\n for chunk in self.core.chunks(lst=source, n=len(...
[ "0.622033", "0.61825204", "0.60589474", "0.60442704", "0.60242766", "0.6022463", "0.58533144", "0.5791768", "0.57778436", "0.57204026", "0.56741023", "0.5669912", "0.56534284", "0.56511724", "0.5648261", "0.5627419", "0.5624629", "0.55918056", "0.5581766", "0.5579891", "0.556...
0.73413634
0
Validate source_data against source_schema and initialize all data interfaces.
def __init__(self, source_data: Dict[str, dict], verbose: bool = True): self.verbose = verbose self._validate_source_data(source_data=source_data, verbose=self.verbose) self.data_interface_objects = { name: data_interface(**source_data[name]) for name, data_interface in s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_source(cls, source_data: Dict[str, dict], verbose: bool = True):\n cls._validate_source_data(source_data=source_data, verbose=verbose)", "def __post_init__(self):\n # Only do this if source_data already exists (not during its own initialization)\n if \"SOURCE_DATA\" in globals()...
[ "0.696322", "0.62050235", "0.5793729", "0.5759235", "0.5751692", "0.5744186", "0.57387424", "0.5735445", "0.5684236", "0.56799126", "0.5645745", "0.56375694", "0.5569745", "0.5554738", "0.55513054", "0.55060434", "0.5498737", "0.54937583", "0.5421979", "0.5412901", "0.5385543...
0.7059488
0
Compile metadata schemas from each of the data interface objects.
def get_metadata_schema(self) -> dict: metadata_schema = load_dict_from_file(Path(__file__).parent / "schemas" / "base_metadata_schema.json") for data_interface in self.data_interface_objects.values(): interface_schema = unroot_schema(data_interface.get_metadata_schema()) metadat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_schema_from_datafiles(datasets):\n\n schema = {}\n for dataset in datasets:\n schema.update(dataset.native_schema)\n\n return schema", "def _CreateSchemas(self) -> None:\n self.schema_objs = dict() # Holds OpenAPI representations of types.\n\n # Add the OpenAP...
[ "0.61461616", "0.60478354", "0.59317285", "0.58521867", "0.57625383", "0.56529933", "0.56043863", "0.553093", "0.55201304", "0.5496202", "0.5449299", "0.53587925", "0.5321705", "0.530396", "0.5268813", "0.5268668", "0.52536666", "0.5236021", "0.5233846", "0.522641", "0.522080...
0.6485286
0
Autofill as much of the metadata as possible. Must comply with metadata schema.
def get_metadata(self) -> DeepDict: metadata = get_default_nwbfile_metadata() for interface in self.data_interface_objects.values(): interface_metadata = interface.get_metadata() metadata = dict_deep_update(metadata, interface_metadata) return metadata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_initial_valid_metadata(self):\n pass", "def initial_metadata(self):\n raise NotImplementedError()", "def initMetadata(self):\n\n if not 'flags' in self.metadata:\n\n self.metadata['flags'] = {}\n\n if not 'uidvalidity' in self.metadata:\n\n\n self....
[ "0.7373019", "0.72648966", "0.7245894", "0.683571", "0.6799102", "0.67943895", "0.6717908", "0.6601634", "0.6546511", "0.65143317", "0.64658564", "0.64658564", "0.6392921", "0.63785046", "0.6371377", "0.6346855", "0.63260806", "0.631097", "0.6283491", "0.6226167", "0.6203599"...
0.0
-1
Validate metadata against Converter metadata_schema.
def validate_metadata(self, metadata: Dict[str, dict]): encoder = NWBMetaDataEncoder() # The encoder produces a serialiazed object so we de serialized it for comparison serialized_metadata = encoder.encode(metadata) decoded_metadata = json.loads(serialized_metadata) validate(inst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate(self):\n if not self._contents.has_key('type'):\n raise ValidationFailed(\"Metadata file %s contains no type field\" % (self._filename))\n \n if not self._contents.has_key('version'):\n raise ValidationFailed(\"Metadata file %s contains no version field\" %\...
[ "0.67834675", "0.6774967", "0.6396517", "0.6372613", "0.6314087", "0.62640077", "0.61724794", "0.61656445", "0.61574095", "0.61177945", "0.60506034", "0.6029551", "0.6025059", "0.6017817", "0.601185", "0.5954007", "0.59126073", "0.59023726", "0.5883788", "0.5880836", "0.58434...
0.7296295
0
Validate conversion_options against Converter conversion_options_schema.
def validate_conversion_options(self, conversion_options: Dict[str, dict]): validate(instance=conversion_options or {}, schema=self.get_conversion_options_schema()) if self.verbose: print("conversion_options is valid!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_conversion_schema():\n legal_filing = {'conversion': BEN_CONVERSION}\n is_valid, errors = validate(legal_filing, 'conversion')\n\n if errors:\n for err in errors:\n print(err.message)\n print(errors)\n\n assert is_valid", "def __validate_options__(cls, options):\n ...
[ "0.6484723", "0.6115653", "0.6110735", "0.6048836", "0.6048836", "0.5758768", "0.5712079", "0.57083374", "0.55992967", "0.5536905", "0.55322844", "0.5477315", "0.54282635", "0.5426897", "0.5373139", "0.5366407", "0.53514874", "0.53224105", "0.53178", "0.52855515", "0.52787715...
0.84981906
0
Run the NWB conversion over all the instantiated data interfaces.
def run_conversion( self, nwbfile_path: Optional[str] = None, nwbfile: Optional[NWBFile] = None, metadata: Optional[dict] = None, overwrite: bool = False, conversion_options: Optional[dict] = None, ) -> None: if metadata is None: metadata = self.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(dataset_path, output_path):\n print(\"converting all snirf files in the input dataset to nwb...\")\n print(f\"dataset directory: {dataset_path}\")\n print(f\"output directory: {output_path}\")\n print()\n\n for subject_id in list_subject_ids(dataset_path):\n convert_subject_snirf_to_...
[ "0.6259673", "0.57180226", "0.5696865", "0.55192584", "0.55044365", "0.5475389", "0.5445691", "0.5258226", "0.5224709", "0.519267", "0.5145294", "0.5142543", "0.5130369", "0.51275074", "0.5124553", "0.511106", "0.5101885", "0.50836927", "0.5040718", "0.50096214", "0.500791", ...
0.5302192
7
Override this method to implement custom alignment
def temporally_align_data_interfaces(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def align(self):\n ...", "def format_alignment(self, alignment):\n raise NotImplementedError(\"This method should be implemented\")\n ###################################################\n # You MUST implement this method in the subclass. #\n ####################################...
[ "0.8660336", "0.7733873", "0.70901155", "0.70901155", "0.70901155", "0.7020445", "0.66770446", "0.65857303", "0.6532593", "0.6530735", "0.6482122", "0.6458247", "0.63402903", "0.6284978", "0.6186565", "0.61809427", "0.61300397", "0.6102727", "0.6090545", "0.6069467", "0.60386...
0.5587484
70
Compile conversion option schemas from each of the data interface classes.
def get_conversion_options_schema(self) -> dict: conversion_options_schema = get_base_schema( root=True, id_="conversion_options.schema.json", title="Conversion options schema", description="Schema for the conversion options", version="0.1.0", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schema_generators():\n return {\n \"trips\": trips_schema,\n \"status_changes\": status_changes_schema,\n \"events\": events_schema,\n \"vehicles\": vehicles_schema,\n \"stops\": stops_schema\n }", "def buildConverters(tableSpec, tableNamespace):\n converters = []\...
[ "0.56542283", "0.56212246", "0.5526179", "0.55158335", "0.53670424", "0.5130123", "0.5103227", "0.50974584", "0.50963557", "0.5072053", "0.49627963", "0.49403316", "0.49340504", "0.49235007", "0.48808965", "0.48718503", "0.48601958", "0.48495325", "0.48423228", "0.48361728", ...
0.636941
1
Transform parsed log line into a short format.
def transform(stop): line = None results = {} while True: if line is not None: processor = processors.get(type(line), None) if processor: processor[0](line, results, *processor[1:]) if stop.is_set(): line = generate(results) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_line(line):\n for proc, pattern in INCLUDE_LINES:\n if pattern in line:\n # Log lines look like this:\n # pylint: disable=line-too-long\n # Mar 12 09:58:43 jumphost-win-02 metadata-server[5259]: I0312 09:58:43.756257 5259 server.go:87] Updated token: [redacted]\n timestamp ...
[ "0.6709503", "0.6165054", "0.58948964", "0.5781676", "0.5649118", "0.56183153", "0.5591828", "0.55390006", "0.54398614", "0.5426594", "0.54089904", "0.54073066", "0.5348272", "0.5308872", "0.52630347", "0.5261002", "0.52508545", "0.524962", "0.5240933", "0.5226485", "0.521126...
0.0
-1
@ get all episodes in selected asset type, and if project type is not series then return None.
def bsw_getAllAssetEpisodes(astType): # get basic inputs. basePath = ProjectNamingInputs().basePath projectName = ProjectNamingInputs().projectName assetType = ProjectNamingInputs().assetType projectType = ProjectNamingInputs().projectType if projectType == 'series': episodeDir = '{baseP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_episodes(self):\n return [series_episode for series_episode in SeriesEpisode.objects.filter(series=self)]", "def episodes(self):\n if self._episode_cache_ver == self._db._version:\n return self._episode_cache\n\n # Get only rows from the preferred provider (provider id is...
[ "0.6472294", "0.6238427", "0.6109521", "0.6061909", "0.58215487", "0.5817781", "0.56866485", "0.5580703", "0.5557396", "0.5460225", "0.5414427", "0.5404259", "0.5401844", "0.53146833", "0.53129226", "0.51491994", "0.51185447", "0.5114288", "0.5105471", "0.50925493", "0.507416...
0.7465757
0
@ get all asset names of asset types from directory.
def bsw_getAllAssetNames(astType, episode=None): # get basic inputs. basePath = ProjectNamingInputs().basePath projectName = ProjectNamingInputs().projectName assetType = ProjectNamingInputs().assetType projectType = ProjectNamingInputs().projectType if projectType == 'series': assetDire...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listAssetTypes(self):\n return self.get_json('/assetType')", "def get_custom_asset_types() -> list[str]:\n with GlobalDBHandler().conn.read_ctx() as cursor:\n cursor.execute('SELECT DISTINCT type FROM custom_assets ORDER BY type;')\n return [entry[0] for entry in cursor]",...
[ "0.74853826", "0.69678617", "0.6263411", "0.6205344", "0.61148363", "0.609677", "0.60557204", "0.6006449", "0.5994604", "0.5930386", "0.59195334", "0.58995765", "0.58823216", "0.5859081", "0.5832998", "0.58204025", "0.5820043", "0.581612", "0.5813952", "0.5796276", "0.5788555...
0.71672857
1
@ get template of passed asset all department directory paths.
def bsw_getAssetDeptDirs(astType, astName, episode=None): basePath = ProjectNamingInputs().basePath projName = ProjectNamingInputs().projectName assetType = ProjectNamingInputs().assetType projectType = ProjectNamingInputs().projectType allDeptDirs = dict() if projectType == 'series': ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_path(self):\n return self.get_config(\"templates\")", "def template():\n return ENVIVIRTUALIZABLEURI('DEFile')", "def get_template_path(self):\n raise NotImplementedError()", "def template_path(self) -> str:\n return self._values.get(\"template_path\")", "def get_templa...
[ "0.61192125", "0.6096916", "0.60494095", "0.6015967", "0.58758515", "0.58758515", "0.5812925", "0.5809724", "0.5803672", "0.5794745", "0.57694685", "0.5765914", "0.5734071", "0.5684027", "0.5677342", "0.5666776", "0.566474", "0.56168336", "0.55416065", "0.5522847", "0.5462942...
0.54172635
28
@ create asset directories of all department.
def bsw_createAssetDirectories(astType, astName, episode=None): # get all asset department directory template. projectType = ProjectNamingInputs().projectType if projectType == 'series': assetDeptDir = bsw_getAssetDeptDirs(astType, astName, episode=episode) else: assetDeptDir = bsw_getAs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_directories(self):\n print \"[--init] creating directory structure in %s\" % (self.target_path)\n ensure_path(self.conf_path)\n for subdir in config.PROCESSING_AREAS:\n subdir_path = self.data_path + os.sep + subdir\n ensure_path(subdir_path)", "def createAs...
[ "0.7096028", "0.67460805", "0.6727249", "0.66118586", "0.6416269", "0.6301152", "0.6208901", "0.6203855", "0.6202322", "0.6182706", "0.616796", "0.6159768", "0.61580974", "0.61043555", "0.6102615", "0.60950065", "0.60941195", "0.60727894", "0.60680026", "0.6064777", "0.605273...
0.71996766
0
@ get main file and version files, and create directory if not exist.
def bsw_getAssetFileAndVersions(astType, astDept, astName, episode=None): projectShortName = ProjectNamingInputs().projectShortName projectType = ProjectNamingInputs().projectType if projectType == 'series': assetDeptDir = bsw_getAssetDeptDirs(astType, astName, episode=episode) else: ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n for lof in self.data_files:\n if lof[0]:\n base = getattr(self, 'install_' + lof[0])\n else:\n base = getattr(self, 'install_base')\n dir = convert_path(lof[1])\n if not os.path.isabs(dir):\n dir = os.p...
[ "0.66184783", "0.6417428", "0.6203714", "0.61612284", "0.61361146", "0.61206895", "0.610623", "0.6035497", "0.60022396", "0.59809184", "0.59590316", "0.59575915", "0.5947744", "0.5938032", "0.59312606", "0.5918751", "0.5901932", "0.5887037", "0.58825606", "0.5875821", "0.5842...
0.0
-1
@ return all department wise asset return name if file is exist.
def bsw_getValidDeptAssetNames(astType, astDept, episode=None): # get all asset names. projectShortName = ProjectNamingInputs().projectShortName projectType = ProjectNamingInputs().projectType if projectType == 'series': assetNames = bsw_getAllAssetNames(astType, episode=episode) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_available_data_asset_names(self) -> List[str]:\n raise NotImplementedError", "def assetName(self):\n\t\treturn self._assetName", "def bsw_getAssetDeptDirs(astType, astName, episode=None):\n basePath = ProjectNamingInputs().basePath\n projName = ProjectNamingInputs().projectName\n assetT...
[ "0.5815256", "0.5636447", "0.55993414", "0.55701506", "0.55508494", "0.54256535", "0.5399064", "0.53980976", "0.5394662", "0.53775007", "0.53440297", "0.533159", "0.5322432", "0.5286498", "0.526668", "0.5252649", "0.52432853", "0.5233909", "0.5209876", "0.5205642", "0.5201809...
0.6095677
0
@ get version directory the query all maya version files and return new file name.
def bsw_versionUpPath(versionDir): projectShortName = ProjectNamingInputs().projectShortName if not os.path.exists(versionDir): return False # get all files from version directory. if os.listdir(versionDir): filteredVersionFiles = list() # check and add every files from version d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self, directory, version_file_name='.version'):\n if self.path_exists(directory) and (version_file_name in os.listdir(directory)):\n f = open(directory + '/' + version_file_name)\n version = f.read()\n f.close()\n return version\n return Non...
[ "0.6709382", "0.659938", "0.6082783", "0.60531646", "0.6040702", "0.5889642", "0.5856451", "0.5850048", "0.5791198", "0.5770861", "0.57638973", "0.5731305", "0.5693969", "0.5684699", "0.56496245", "0.56411403", "0.56335783", "0.5626503", "0.56060994", "0.56059694", "0.5597353...
0.62781
2
@ get asset details from root group entries which created in asset generation time.
def bsw_getAssetDetails(rootGrpName=None): if not rootGrpName: if pm.objExists('Texture_Group'): rootGrpName = 'Texture_Group' elif pm.objExists('rig_grp'): rootGrpName = 'rig_grp' elif pm.objExists('geo'): rootGrpName = 'geo' else: roo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAssetInfo(self):\n return self._AssetInfo", "def getInfo(self):\n doc = minidom.parse(urllib.urlopen(serverString + \"/rest/asset/\" + self.id))\n self._getInfoFromNode(doc.getElementsByTagName(\"asset\")[0])", "def get_assets(id_group):\n data = sql.list_assets(id_group)\n na...
[ "0.5737252", "0.57269895", "0.56889707", "0.5585239", "0.55731195", "0.55246085", "0.55192024", "0.546723", "0.5462399", "0.53377986", "0.533493", "0.5249755", "0.523537", "0.51746964", "0.516901", "0.5139736", "0.5098993", "0.5071982", "0.50337255", "0.501638", "0.49910238",...
0.6417712
0
@ get main file name of current scene.
def bsw_getCurrentAssetMainFileName(): projectShortName = ProjectNamingInputs().projectShortName # get asset UID from the kns_getAssetDetails function (second last return is assetUID). assetUID = bsw_getAssetDetails()[-2] if os.environ['BSW_PROJECT_TYPE'] == 'series': return projectShortName + '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_scene_name():\n\n scene_name = cmds.file(query=True, sceneName=True, shortName=True)\n scene_name = osp.splitext(scene_name)[0]\n\n return scene_name", "def get_scene_name(self):\n return self._document.GetDocumentName()", "def name(self):\n return self._scene_name", "def g...
[ "0.8191708", "0.7378323", "0.71594596", "0.7123498", "0.7103535", "0.7034933", "0.7017298", "0.69605684", "0.69590616", "0.6924432", "0.6839492", "0.6836935", "0.68076164", "0.6782342", "0.67598224", "0.6741122", "0.67305326", "0.6696987", "0.66557336", "0.6637808", "0.660324...
0.7283132
2
@ get only final file of required department.
def bsw_getOnlyFinalFileOfDept(astType, astDept, astName, episode=None): projectShortName = ProjectNamingInputs().projectShortName astTypShortCode = {'Character': 'ch', 'Prop': 'pr', 'Set': 'bg', 'Vehicle': 'vh', 'SetElement': 'se'} astDeptShortCode = {'Model': 'mod', 'Rig': 'rig', 'Texture': 'tex', 'Light'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(plan, shape=False):\n if (DistrictFile.get_file_status(plan, shape) == 'done'):\n file_name = DistrictFile.get_file_name(plan, shape) + '.zip'\n return file_name", "def get_dsc(self):\n for path in self.get_all_files():\n if path.endswith('.dsc'):\n ...
[ "0.6320338", "0.5684126", "0.5551462", "0.5470761", "0.53162855", "0.52884984", "0.5274076", "0.5233386", "0.5233386", "0.5226018", "0.51835144", "0.51724654", "0.512775", "0.5127529", "0.5094329", "0.5093315", "0.5081137", "0.5072476", "0.50506085", "0.50324", "0.5015832", ...
0.64966166
0
@ get asset dir from file name.
def bsw_getAssetPathFromFileName(fileName): projectType = ProjectNamingInputs().projectType assetType = {'ch': 'Character', 'pr': 'Prop', 'bg': 'Set', 'vh': 'Vehicle', 'se': 'SetElement'} assetDept = {'mod': 'Model', 'tex': 'Texture', 'rig': 'Rig', 'lit': 'Light'} astType = fileName.split('_')[1] as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_asset_path(name):\n return os.path.join(constants.ROOT_DIR, 'assets', name)", "def _get_asset_dir(self, database):\n if not database:\n return 'assets'\n\n path = os.path.dirname(database)\n return os.path.join(path, 'assets')", "def _path(name: str):\n return os.p...
[ "0.7651856", "0.75091547", "0.71344215", "0.67845696", "0.65159225", "0.6449491", "0.6356405", "0.6293956", "0.61229074", "0.61127037", "0.60930806", "0.6086665", "0.60493875", "0.6040847", "0.60154086", "0.6008243", "0.6008031", "0.6003942", "0.5991939", "0.59918576", "0.597...
0.6320406
7
Render `data` into JSON, returning a bytestring.
def render(self, data, accepted_media_type=None, renderer_context=None): if data is None: return bytes() renderer_context = renderer_context or {} indent = self.get_indent(accepted_media_type, renderer_context) if indent is None: separators = SHORT_SEPARATORS if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self, data):\n logging.info(\"render (start)\")\n\n seria = json.dumps(data, ensure_ascii=False, indent=4)\n logging.info(\"rendered %s characters (end)\" % len(seria))\n return seria", "def render(self, data, accepted_media_type=None, renderer_context=None):\n if data is No...
[ "0.8322761", "0.7805844", "0.765805", "0.7562658", "0.7479649", "0.7266738", "0.7247055", "0.72162443", "0.71565706", "0.7107005", "0.7067796", "0.70554405", "0.7004682", "0.6947288", "0.69117856", "0.68802786", "0.6837645", "0.68103766", "0.6727808", "0.6723814", "0.67190343...
0.76940095
2
Softmax cost function for word2vec models
def softmaxCostAndGradient(predicted, target, outputVectors, dataset): # Implement the cost and gradients for one predicted word vector # and one target word vector as a building block for word2vec # models, assuming the softmax prediction function and cross # entropy loss. # Inputs: # - predi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(X, Y, word_to_vec_map, learning_rate = 0.01, num_iterations = 400):\n \n # Get a valid word contained in the word_to_vec_map \n any_word = list(word_to_vec_map.keys())[0]\n \n # Initialize cost. It is needed during grading\n cost = 0\n \n # Define number of training examples\n...
[ "0.72518784", "0.7108989", "0.6836795", "0.6821532", "0.6693698", "0.6658965", "0.66583645", "0.65682226", "0.65567243", "0.648131", "0.6436247", "0.64335537", "0.64082384", "0.640416", "0.6380756", "0.6324167", "0.6319246", "0.6310624", "0.63057303", "0.63019854", "0.6281135...
0.70910984
2
Negative sampling cost function for word2vec models
def negSamplingCostAndGradient(predicted, target, outputVectors, dataset, K=10): # Implement the cost and gradients for one predicted word vector # and one target word vector as a building block for word2vec # models, using the negative sampling technique. K is the sample # size. You might want to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neg_sampling_loss_and_gradient(\n center_word_vec,\n outside_word_idx,\n outside_vectors,\n dataset,\n K=10\n):\n\n # Negative sampling of words is done for you. Do not modify this if you\n # wish to match the autograder and receive points!\n neg_sample_word_indices ...
[ "0.6708602", "0.64941853", "0.64483947", "0.6427767", "0.6373894", "0.6373894", "0.6373894", "0.6267261", "0.6267261", "0.6156621", "0.61330694", "0.6097435", "0.6084569", "0.602716", "0.60267574", "0.6020172", "0.60125136", "0.600268", "0.59315264", "0.59011626", "0.5843728"...
0.67069376
1
Skipgram model in word2vec
def skipgram(currentWord, C, contextWords, tokens, inputVectors, outputVectors, dataset, word2vecCostAndGradient = softmaxCostAndGradient): # Implement the skip-gram model in this function. # Inputs: # - currrentWord: a string of the current center word # - C: integer, context size # - context...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skipgram(currentWord, C, contextWords, tokens, inputVectors, outputVectors,\n dataset, word2vecCostAndGradient=softmaxCostAndGradient):\n \n cost = 0.0\n gradIn = np.zeros(inputVectors.shape)\n gradOut = np.zeros(outputVectors.shape)\n\n ### YOUR CODE HERE\n predicted = inputVecto...
[ "0.73811865", "0.73697907", "0.7339572", "0.71801305", "0.70820427", "0.6863275", "0.685266", "0.68452936", "0.68211156", "0.67541444", "0.67541444", "0.67541444", "0.66995925", "0.66995925", "0.65849197", "0.6533643", "0.642774", "0.63859594", "0.6374046", "0.62920815", "0.6...
0.7008295
5
CBOW model in word2vec
def cbow(currentWord, C, contextWords, tokens, inputVectors, outputVectors, dataset, word2vecCostAndGradient = softmaxCostAndGradient): # Implement the continuous bag-of-words model in this function. # Input/Output specifications: same as the skip-gram model # We will not provide starter code for this ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cbow(currentWord, C, contextWords, tokens, inputVectors, outputVectors,\n dataset, word2vecCostAndGradient=softmaxCostAndGradient):\n\n cost = 0.0\n gradIn = np.zeros(inputVectors.shape)\n gradOut = np.zeros(outputVectors.shape)\n\n ### YOUR CODE HERE\n target = tokens[currentWord]\n\n ...
[ "0.6977331", "0.6879846", "0.6852588", "0.6753627", "0.6711709", "0.66832954", "0.66618025", "0.6635551", "0.6472121", "0.6373049", "0.6366068", "0.63088983", "0.63043493", "0.6302005", "0.62772036", "0.6273346", "0.62633795", "0.6254702", "0.618194", "0.6137404", "0.6132508"...
0.75711095
0
Used by Ajax calls Return the upload progress and total length values
def upload_progress(request, account_slug=None): #pylint: disable=unused-argument if 'X-Progress-ID' in request.GET: progress_id = request.GET['X-Progress-ID'] elif 'X-Progress-ID' in request.META: progress_id = request.META['X-Progress-ID'] if progress_id: cache_key = "%s_%s" % ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def progress(request):\n file_id = request.GET['X-Progress-ID']\n session = DBSession()\n u = session.query(Upload).filter_by(id=file_id).one()\n data = {'state': u.state}\n if u.state == 'uploading':\n if not os.path.exists(u.tmp_path):\n # The temporary file has not been created ...
[ "0.74291635", "0.7131904", "0.6652564", "0.65933836", "0.6477215", "0.64750636", "0.6418828", "0.6418828", "0.6418828", "0.6418828", "0.639952", "0.63758796", "0.6358746", "0.6321468", "0.6275455", "0.6262116", "0.6256155", "0.6229986", "0.61642486", "0.61383957", "0.61281985...
0.0
-1
Create Parameter Keyword Arguments for the `Minuit` constructor.
def make_minuit_par_kwargs(parameters): kwargs = {} for par in parameters.parameters: kwargs[par.name] = par.value min_ = None if np.isnan(par.min) else par.min max_ = None if np.isnan(par.max) else par.max kwargs['limit_{}'.format(par.name)] = (min_, max_) if parameter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(**params):", "def define_parameters(self):", "def __init__(self, *args: Union[List[AtomKey], HKT], **kwargs: str) -> None:\n ...", "def define_parameters(self):\n self.add_argument('--prefix', dest='prefix', type=str, optional=False,\n help='prefix for file...
[ "0.6288195", "0.6145601", "0.608256", "0.6077384", "0.60681677", "0.6064592", "0.60551435", "0.60317856", "0.60270023", "0.60270023", "0.60270023", "0.60270023", "0.60270023", "0.60270023", "0.60270023", "0.60239285", "0.5958885", "0.5912476", "0.5897381", "0.5871605", "0.587...
0.67365843
0
Get full covar matrix as Numpy array. This was added as `minuit.np_covariance` in `iminuit` in v1.3, but we still want to support v1.2
def _get_covar(minuit): n = len(minuit.parameters) m = np.zeros((n, n)) for i1, k1 in enumerate(minuit.parameters): for i2, k2 in enumerate(minuit.parameters): if set([k1, k2]).issubset(minuit.list_of_vary_param()): m[i1, i2] = minuit.covariance[(k1, k2)] return m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def covar(self) -> np.ndarray:\n if self._covar is None:\n self._covar = batched_inv_spd(batched_cholesky(self._inv_covar))\n return self._covar", "def covariance(data_matrix):\n return np.asmatrix(np.cov(data_matrix, rowvar=0))", "def get_cov_matrix_states(self):\n cov = num...
[ "0.715", "0.6918695", "0.68584454", "0.68436575", "0.6735441", "0.66587955", "0.665023", "0.6618526", "0.65532213", "0.65131664", "0.648743", "0.6473425", "0.6427018", "0.64248204", "0.640013", "0.6393602", "0.63809496", "0.63302636", "0.631944", "0.63151485", "0.62982684", ...
0.75416523
0
Returns true if there is more than one active project associated with this client.
def has_multiple_projects(self): return self.projects.filter(active=True).count() > 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_projects(self):\n return self.projects.filter(active=True)", "def is_active(self) -> bool:\n return any(x is not None for x in self._constraints)", "def is_competition(self):\n return self.db_is_competition", "def is_project(self, project):\n return self._projects_looku...
[ "0.65099156", "0.6169773", "0.61593264", "0.6121147", "0.61132723", "0.61132723", "0.5950498", "0.5926298", "0.58955985", "0.5866945", "0.5798091", "0.5769043", "0.57587534", "0.5707796", "0.5696425", "0.56953526", "0.5688109", "0.5679527", "0.5667053", "0.5654484", "0.562980...
0.8511699
0
Returns the active projects for the client.
def active_projects(self): return self.projects.filter(active=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_projects(self):\n return conf.projects", "def get_client_projects(self, client=None):\n if type(client) is Client:\n return [p for p in self.project_list if client.client_id == p.client_id]", "def get_projects(self):\n return self.http_call(\"get\", url=f\"{self.base_url...
[ "0.79490113", "0.7929667", "0.77085984", "0.7485822", "0.7469964", "0.74452794", "0.74072176", "0.73590404", "0.7318829", "0.724942", "0.7204794", "0.71989226", "0.719029", "0.7152463", "0.7124276", "0.7114484", "0.7078646", "0.7010834", "0.7005374", "0.6980954", "0.6970034",...
0.8063469
0
Process a document into its final form. Translate `document` (a Docutils document tree) into the Writer's native format, and write it out to its `destination` (a `docutils.io.Output` subclass object). Normally not overridden or extended in subclasses.
def write(self, document, destination): self.document = document self.language = languages.get_language( document.settings.language_code, document.reporter) self.destination = destination self.translate() output = self.destination.write(self.output) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emit_document(self, document):\n raise NotImplementedError()", "def _transform(self, document):\n pass", "def process_document(self, document, **kwargs):\n \n start = time.time()\n\n if self._log_file is not None:\n map_annotations_logger.addHandler(file_handle...
[ "0.60927504", "0.5725874", "0.54091835", "0.52739656", "0.5214437", "0.51614934", "0.5158953", "0.5158953", "0.5136689", "0.50936973", "0.5086801", "0.50783026", "0.50710064", "0.49749365", "0.49396706", "0.4884253", "0.4865418", "0.48605415", "0.48564097", "0.48286474", "0.4...
0.72632694
0
Do final translation of `self.document` into `self.output`. Called from `write`. Override in subclasses. Usually done with a `docutils.nodes.NodeVisitor` subclass, in combination with a call to `docutils.nodes.Node.walk()` or `docutils.nodes.Node.walkabout()`. The ``NodeVisitor`` subclass must support all standard elem...
def translate(self): raise NotImplementedError('subclass must override this method')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _transform(self, document):\n pass", "def convert(self):\n self._convert()\n self._write_docx()", "def emit_document(self, document):\n raise NotImplementedError()", "def __call__(self):\n self.tree = etree.parse(self.src)\n\n agent = transformer_factory(self.tre...
[ "0.6509124", "0.60530466", "0.59633064", "0.5783462", "0.5775899", "0.57631224", "0.5687414", "0.5612088", "0.55821306", "0.554167", "0.5445731", "0.5440628", "0.53633213", "0.5300753", "0.5219228", "0.51925856", "0.5184472", "0.51653117", "0.51413035", "0.513734", "0.5135935...
0.0
-1
Assemble the `self.parts` dictionary. Extend in subclasses.
def assemble_parts(self): self.parts['whole'] = self.output self.parts['encoding'] = self.document.settings.output_encoding self.parts['version'] = docutils.__version__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_part(self):\n parts = []\n for part in re.split(r'\\*\\*\\* ([A-Z- ]+) \\*\\*\\*', self.hand_file): # return [ 'part1', 'splitter1', 'part2',..\n parts.append(part)\n\n for i in range(0, len(parts)):\n if i == 0:\n self.part_dict['HEADER'] = part...
[ "0.62134004", "0.62024397", "0.5878337", "0.5783612", "0.57041496", "0.56869996", "0.5598993", "0.54675126", "0.54501754", "0.54231954", "0.5421467", "0.5304137", "0.52999735", "0.52968395", "0.5241657", "0.52192795", "0.52082586", "0.5189509", "0.51861733", "0.5183208", "0.5...
0.61536735
2
Return the Writer class from the `writer_name` module.
def get_writer_class(writer_name): writer_name = writer_name.lower() if writer_name in _writer_aliases: writer_name = _writer_aliases[writer_name] try: module = __import__(writer_name, globals(), locals(), level=1) except ImportError: module = __import__(writer_name, globals(), l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_writer_class(cls) -> 'Type[SpectrumWriter]':\n raise NotImplementedError(SpectrumReader.get_writer_class.__qualname__)", "def _get_writer(self, writer_name):\r\n if writer_name not in self._writers:\r\n path = os.path.join(self.log_dir, writer_name)\r\n writer = summary_ops_v2.create_...
[ "0.69305336", "0.6689665", "0.6409046", "0.62630635", "0.6220382", "0.58785063", "0.5845479", "0.5839867", "0.58295506", "0.56432635", "0.5637954", "0.5606227", "0.5554922", "0.5537747", "0.5523522", "0.5474596", "0.5463936", "0.54269594", "0.5412886", "0.54028976", "0.538162...
0.9022644
0
Test to validate that custom payloads work with simple queries creates a simple query and ensures that custom payloads are passed to C. A custom query provider is used with C so we can validate that same custom payloads are sent back with the results 2.6 PYTHON280 valid custom payloads should be sent and received
def test_custom_query_basic(self): # Create a simple query statement a query = "SELECT * FROM system.local" statement = SimpleStatement(query) # Validate that various types of custom payloads are sent and received okay self.validate_various_custom_payloads(statement=statement)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_load_kql_query_defs(self):\n la_provider = self.la_provider\n la_provider.connect(connection_str=\"test\")\n self.assertEqual(getattr(la_provider, \"test\"), \"CustomAttrib\")\n\n # Did we read and process the query definitions OK\n q_sources = la_provider.query_store.da...
[ "0.6527704", "0.64625055", "0.6448495", "0.64351636", "0.63665766", "0.60493946", "0.60140413", "0.5982427", "0.59034127", "0.58764935", "0.5842737", "0.578988", "0.5781109", "0.5768024", "0.5743283", "0.5735624", "0.5709683", "0.5625501", "0.5560789", "0.5519123", "0.5516742...
0.80934554
0
Test to validate that custom payloads work with batch queries creates a batch query and ensures that custom payloads are passed to C. A custom query provider is used with C so we can validate that same custom payloads are sent back with the results 2.6 PYTHON280 valid custom payloads should be sent and received
def test_custom_query_batching(self): # Construct Batch Statement batch = BatchStatement(BatchType.LOGGED) for i in range(10): batch.add(SimpleStatement("INSERT INTO test3rf.test (k, v) VALUES (%s, %s)"), (i, i)) # Validate that various types of custom payloads are sent and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_custom_query_basic(self):\n\n # Create a simple query statement a\n query = \"SELECT * FROM system.local\"\n statement = SimpleStatement(query)\n # Validate that various types of custom payloads are sent and received okay\n self.validate_various_custom_payloads(statement...
[ "0.6579624", "0.6282645", "0.5862671", "0.58041817", "0.5789634", "0.571839", "0.5674159", "0.5659514", "0.5572245", "0.55634826", "0.552229", "0.54960763", "0.54557633", "0.5425926", "0.5420833", "0.54062617", "0.5386587", "0.5372885", "0.5361616", "0.531875", "0.53118783", ...
0.7527416
0
Test to validate that custom payloads work with prepared queries creates a batch query and ensures that custom payloads are passed to C. A custom query provider is used with C so we can validate that same custom payloads are sent back with the results 2.6 PYTHON280 valid custom payloads should be sent and received
def test_custom_query_prepared(self): # Construct prepared statement prepared = self.session.prepare( """ INSERT INTO test3rf.test (k, v) VALUES (?, ?) """) bound = prepared.bind((1, None)) # Validate that various custom payloads are validated corr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_custom_query_batching(self):\n\n # Construct Batch Statement\n batch = BatchStatement(BatchType.LOGGED)\n for i in range(10):\n batch.add(SimpleStatement(\"INSERT INTO test3rf.test (k, v) VALUES (%s, %s)\"), (i, i))\n\n # Validate that various types of custom payload...
[ "0.7442897", "0.6976703", "0.6230606", "0.58975285", "0.56896055", "0.5653015", "0.5635988", "0.553793", "0.5536429", "0.5535898", "0.54537135", "0.54533887", "0.54533887", "0.543706", "0.54330355", "0.54176164", "0.5416644", "0.53958035", "0.53950524", "0.5392065", "0.539002...
0.6913831
2
This is a utility method that given a statement will attempt to submit the statement with various custom payloads. It will validate that the custom payloads are sent and received correctly. statement The statement to validate the custom queries in conjunction with
def validate_various_custom_payloads(self, statement): # Simple key value custom_payload = {'test': b'test_return'} self.execute_async_validate_custom_payload(statement=statement, custom_payload=custom_payload) # no key value custom_payload = {'': b''} self.execute_asyn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_custom_query_basic(self):\n\n # Create a simple query statement a\n query = \"SELECT * FROM system.local\"\n statement = SimpleStatement(query)\n # Validate that various types of custom payloads are sent and received okay\n self.validate_various_custom_payloads(statement...
[ "0.7104347", "0.67997825", "0.66198033", "0.64275306", "0.5787356", "0.56871104", "0.5549678", "0.5532289", "0.5479497", "0.544387", "0.5442303", "0.5413099", "0.5411312", "0.5392633", "0.5387991", "0.53798467", "0.5379808", "0.53635925", "0.5340686", "0.532281", "0.52682734"...
0.6363154
4
This is just a simple method that submits a statement with a payload, and validates that the custom payload we submitted matches the one that we got back statement The statement to execute custom_payload The custom payload to submit with
def execute_async_validate_custom_payload(self, statement, custom_payload): # Submit the statement with our custom payload. Validate the one # we receive from the server matches response_future = self.session.execute_async(statement, custom_payload=custom_payload) response_future.result...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_various_custom_payloads(self, statement):\n\n # Simple key value\n custom_payload = {'test': b'test_return'}\n self.execute_async_validate_custom_payload(statement=statement, custom_payload=custom_payload)\n\n # no key value\n custom_payload = {'': b''}\n self...
[ "0.63223815", "0.6253099", "0.59362966", "0.5643522", "0.5596571", "0.5494747", "0.5285481", "0.5124251", "0.5088654", "0.50280416", "0.50209314", "0.50113577", "0.50002974", "0.49883088", "0.49857587", "0.49452132", "0.4872657", "0.48709938", "0.48590347", "0.4841354", "0.48...
0.7807556
0
+ read file in python
def read_file(file): f = open(file, 'r') print(f.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(path):", "def read_file(path_to_file):\n 8", "def read_from_file(self, filename: str) -> None:", "def read(self, filename):\n pass", "def read(self, filename):\n pass", "def read_file(file):\n with open(file, \"r\") as fid:\n return fid.read()", "def read(file):\n ...
[ "0.82432014", "0.7910622", "0.7896791", "0.77604586", "0.77604586", "0.7409387", "0.7344486", "0.7290307", "0.7289459", "0.7198701", "0.7196135", "0.7195775", "0.7146001", "0.71020913", "0.7101919", "0.7084718", "0.7066086", "0.7065207", "0.7042623", "0.70318484", "0.7018245"...
0.69794834
27
+ working to with keyword to processing file objects => file will close when occurs exception familiar to use tryfinally
def read_file_with_keyword(file): with open(file) as f: data = f.read() print(data) with open(file) as f2: data = f2.readlines() print(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __exit__(self, exception_type, exception_value, traceback):\n self.fileobject.close()", "def __exit__(self, exc_type, exc_value, traceback):\n self.file_out.close()", "def finalize(self):\n if self._file:\n toLog(\"Closing file `{0}`\".format(self._fname), True)\n self._file.clos...
[ "0.6539302", "0.63316876", "0.6122932", "0.6120481", "0.60801846", "0.6031979", "0.60103905", "0.6002176", "0.59708273", "0.59708273", "0.5958924", "0.59514046", "0.594744", "0.5937519", "0.59352446", "0.5896435", "0.5860249", "0.58322245", "0.5758804", "0.5733952", "0.564616...
0.0
-1
Matches each point in the region to minimum SSD template from entire list of templates
def processRegionSSD( self, r ): ixs = TemplateMatcher.matIxs( self.n ** 2 ) ## 5 x 5 windows for region r ws = map( lambda x : TemplateMatcher.slice( r, self.n, x ), ixs ) ts = map( lambda w : map( lambda t : TemplateMatcher.SSD( t, w ), self.templates ) , ws) tMatch = map( la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def templateMatchMulti(img, template):\n\tgray = grayscale(img)\n\ttemp = grayscale(template)\n\tw, h = temp.shape[::-1]\n\tres = cv2.matchTemplate(gray, temp, cv2.TM_CCOEFF_NORMED)\n\tthreshold = 0.8\n\tloc = np.where(res >= threshold)\n\tpts = []\n\tfor pt in zip(*loc[::-1]):\n\t\trect = [pt, (pt[0] + w, pt[1] +...
[ "0.61586505", "0.58594805", "0.57886225", "0.5669279", "0.56338966", "0.56214774", "0.56101286", "0.5605014", "0.551976", "0.5498334", "0.5397037", "0.5397037", "0.53930295", "0.5299927", "0.5288984", "0.52475137", "0.5227831", "0.51846814", "0.5125249", "0.51196617", "0.5094...
0.6197051
0
Slices matrix centered around point pt to have size nxn If area includes the edge of imaged area, 0 padded rows/cols are added lc uc lr | | | ur
def slice( mat, n, pt ): lc, uc = TemplateMatcher.hinge( pt.x, n ) ## column limits lr, ur = TemplateMatcher.hinge( pt.y, n ) nr, nc = np.shape( mat ) nr = nr - 1 nc = nc - 1 alc, auc = lc, uc alr, aur = lr, ur rpb, rpa, cpl, cpr = [0,0,0,0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applyKernelToPoints(image,pts,kernel,border_type='BLACK'):\n \n \n pts=np.asarray(pts)\n image=np.asarray(image)\n image.shape\n if len(image.shape)>2:\n grayscale=False\n shaperesult=(len(pts),image.shape[2])\n elif len(image.shape)==1:\n image=image.reshape(1,image.s...
[ "0.5488434", "0.5432423", "0.53871787", "0.5326633", "0.5318443", "0.52965856", "0.52940756", "0.52368885", "0.5177451", "0.5161178", "0.5160577", "0.5142208", "0.51415056", "0.5134802", "0.5108706", "0.5104009", "0.5100073", "0.5083504", "0.50543976", "0.50510263", "0.503998...
0.6774917
0
Given region of size n x n, returns all col, row indices for iteration x > col y > row
def matIxs( n ): rows, cols = np.indices( (n,n) ) row = rows.flatten() col = cols.flatten() return map( lambda x: Vector( x[0], x[1] ), zip( col, row ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def determine_region(x, y, width, height):\n xs = [0, width / 3, 2 * width / 3, width]\n ys = [0, height / 3, 2 * height / 3, height]\n for i in range(3):\n for j in range(3):\n if (x >= xs[j] and x < xs[j + 1]) and (y >= ys[i] and y < ys[i + 1]):\n return i * 3 + j", "def index_iterator((x_min...
[ "0.71921754", "0.6836391", "0.67723036", "0.6759747", "0.6655711", "0.6587607", "0.6453828", "0.6407375", "0.6339972", "0.6325821", "0.6279633", "0.6273713", "0.6240977", "0.61783856", "0.6146757", "0.61393416", "0.6125007", "0.611549", "0.6105668", "0.6094229", "0.6092891", ...
0.0
-1
Determines whether no events are stored in the DemoInfo.
def is_empty(self): return not (self.killstreaks or self.bookmarks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.channels is None or self.timestamp is None", "def is_empty(self) -> bool:\n return not bool(self.samplers)", "def is_empty(self):\n return not self.Timeline", "def isEmpty(self):\n\n return len(self.callbacks) == 0", "def is_empty(self, trace) -...
[ "0.6238876", "0.61898893", "0.6095691", "0.6049332", "0.603219", "0.6004664", "0.59738624", "0.59670824", "0.59637004", "0.58920264", "0.58544755", "0.583065", "0.58181715", "0.58172005", "0.58101654", "0.5804732", "0.5777685", "0.5772077", "0.5771824", "0.5770287", "0.576925...
0.6010662
5
Parses the given data which should be retrieved from a standard format JSON file and turns it into a DemoInfo instance.
def from_json(cls, json_data, demo_name): cur_bm = [] cur_ks = [] for k in json_data["events"]: if k["name"] == "Killstreak": cur_ks.append(DemoEvent(int(k["value"]), int(k["tick"]), None)) elif k["name"] == "Bookmark": cur_bm.append(DemoEvent(k["value"], int(k["tick"]), None)) return cls(demo_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_json_reader_data_contents(process_data):\n json_data = process_data(file_name_or_type='scooter_data.json')\n for val in json_data:\n assert(isinstance(val['id'], int))\n assert(isinstance(val['name'], str))\n assert(isinstance(val['vin_number'], str))\n assert(isinstance(...
[ "0.6023979", "0.58691", "0.57561564", "0.5740799", "0.5706439", "0.56778896", "0.56699413", "0.5652918", "0.5647447", "0.56199074", "0.56082773", "0.55712605", "0.5567739", "0.5567385", "0.5561605", "0.55434746", "0.5526353", "0.5500797", "0.550043", "0.5485761", "0.5455614",...
0.6014086
1
Converts the demo info to a JSONcompliant dict that can be written to a file and be reconstructed to an equal DemoInfo object by using `DemoInfo.from_json`. The event dicts will be ordered ascendingly by tick, just like they are produced by Team Fortress 2.
def to_json(self): events = [{"name": "Killstreak", "value": v, "tick": t} for v, t, _ in self.killstreaks] events += [{"name": "Bookmark", "value": v, "tick": t} for v, t, _ in self.bookmarks] return {"events": sorted(events, key = lambda e: int(e["tick"]))}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(cls, json_data, demo_name):\n\t\tcur_bm = []\n\t\tcur_ks = []\n\n\t\tfor k in json_data[\"events\"]:\n\t\t\tif k[\"name\"] == \"Killstreak\":\n\t\t\t\tcur_ks.append(DemoEvent(int(k[\"value\"]), int(k[\"tick\"]), None))\n\t\t\telif k[\"name\"] == \"Bookmark\":\n\t\t\t\tcur_bm.append(DemoEvent(k[\"valu...
[ "0.6228054", "0.6160889", "0.5326841", "0.5186036", "0.50814676", "0.5010847", "0.49962336", "0.49832866", "0.48962018", "0.48715475", "0.48692217", "0.47869495", "0.47717983", "0.47635192", "0.47498238", "0.47180924", "0.4708449", "0.46955967", "0.46888372", "0.468771", "0.4...
0.48573804
11
Takes a handle_events.RawLogchunk and converts it into DemoInfo.
def from_raw_logchunk(cls, in_chk): loglines = in_chk.content.split("\n") if not loglines: raise ValueError("Logchunks may not be empty.") regres = RE_LINE.search(loglines[0]) if not regres: raise ValueError("Regex match failed, Logchunk malformed.") demo = regres[GROUP.DEMO] + ".dem" killstreaks = [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_sample(self, line, publish=True):\n sample = None\n match = self._sample_regex.match(line)\n if match:\n sample = {}\n sample['t'] = [float(match.group(1))]\n sample['c'] = [float(match.group(2))]\n sample['p'] = [float(match.group(3))]\...
[ "0.5132385", "0.5127417", "0.51171947", "0.5102437", "0.5070641", "0.49931782", "0.48906305", "0.488175", "0.4847076", "0.48453277", "0.48372746", "0.48219904", "0.4818269", "0.47931176", "0.47858205", "0.4750492", "0.47170094", "0.46886584", "0.4665421", "0.46565127", "0.464...
0.60423684
0
Returns a string that can be written to an `_events.txt` file and will be interpretable as a valid logchunk by the events reader afterwards. All info is sorted by tick.
def to_logchunk(self): demo_name = os.path.splitext(self.demo_name)[0] to_write = [("Killstreak", value, tick, date) for value, tick, date in self.killstreaks] to_write.extend(("Bookmark", value, tick, date) for value, tick, date in self.bookmarks) to_write.sort(key = lambda t: t[2]) return "\n".join( f'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_line():\n random.seed(datetime.utcnow().microsecond)\n dt = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')\n event = random.choice(['event1', 'event2', 'event3'])\n return '{};{}\\n'.format(dt, event).encode('utf-8')", "def _readin_evtx(file):\n\tcontent = []\n\tunparsed_entries = 0\n\twi...
[ "0.57899225", "0.5709491", "0.56271654", "0.5571231", "0.55297595", "0.55278057", "0.5437416", "0.54274184", "0.5308161", "0.52946806", "0.52873594", "0.5220328", "0.52083784", "0.5135776", "0.51283467", "0.5092768", "0.5068793", "0.5058062", "0.5047352", "0.5044775", "0.5036...
0.56155944
3
Controller for all spinBoxes
def spinBoxChanged(self): sdr = self.sender() if sdr == self.ui.spinBoxSpectraToCut: self.parameters['cut_m'] = self.ui.spinBoxSpectraToCut.value() elif sdr == self.ui.spinBoxEveryNSpectra: self.parameters['every_n'] = self.ui.spinBoxEveryNSpectra.value() elif sd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spinbox_control(self, action):\n # Gets the current tab, so that it can check which of the spinboxes currently shown is\n # in focus, or choose one to be in focus \n c_tab = self.tabWidget.currentIndex()\n tab_content = {0:[self.VCV_frequency_spb,\n self.VCV...
[ "0.6635967", "0.6404173", "0.62968975", "0.5838627", "0.5778049", "0.57579046", "0.54349446", "0.5320462", "0.5312006", "0.52779394", "0.5275268", "0.5254141", "0.52477854", "0.51787406", "0.5172973", "0.51545256", "0.51098", "0.51006585", "0.509712", "0.50906676", "0.5058366...
0.5469789
6
Action comboBox box changed
def comboBoxChanged(self): new_action = self.ui.comboBoxAction.currentText().lower() self.parameters['action'] = new_action self.changed.emit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_comboBox_celuebianhao_currentIndexChanged(self, p0):\n # TODO: not implemented yet\n raise NotImplementedError", "def on_comboBox_qihuozhanghao_currentIndexChanged(self, p0):\n # TODO: not implemented yet\n raise NotImplementedError", "def on_comboBox_jiaoyimoxing_currentInde...
[ "0.71040225", "0.6949202", "0.6788177", "0.6759619", "0.66363245", "0.65092915", "0.6395416", "0.63920945", "0.636702", "0.63205105", "0.6268223", "0.620821", "0.6175454", "0.6147484", "0.6136072", "0.613324", "0.61324733", "0.6116489", "0.6108808", "0.61041707", "0.6085081",...
0.8299217
0
Return the plot with the appropriate cuts
def fcn(self, data_in): assert isinstance(data_in, _np.ndarray), 'Required input is an ndarray' assert data_in.ndim == 1, 'Required input is a 1D ndarray' data_out = 0*data_in cutter = CutEveryNSpectra(self.parameters['offset'], cut_m=self.parameters['cut_m'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotDistributionWithLimitsRefine(lXs, llYs, lKClassif,out=\"out.png\", title=\"title\", xax=\"xax\", yax=\"yax\",legend=\"\"):\n\n fig = plt.Figure(figsize=(40,20))\n fig.suptitle(title, fontsize=32)\n nbPlots = len(llYs)\n sqrt = int(math.ceil(math.sqrt(nbPlots)))\n ymax = 0...
[ "0.64149034", "0.6369867", "0.6122671", "0.597284", "0.5914648", "0.5899135", "0.5868837", "0.5853187", "0.5831248", "0.5792071", "0.574637", "0.5733046", "0.5723124", "0.572188", "0.56790245", "0.5676098", "0.5673394", "0.56570923", "0.56539637", "0.56525546", "0.56430966", ...
0.0
-1
Create and save a User with the given email and password.
def _create_user(self, email, password, **extra_fields): if not email: raise ValueError('The given email must be set') email = self.normalize_email(email) user = self.model(email=email, **extra_fields) user.set_password(password) user.save(using=self._db) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, email, password, **extra_fields):\n if not email:\n raise ValueError('The given email must be set')\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self._db)\n return user", "def...
[ "0.8545239", "0.85126233", "0.8508934", "0.85035056", "0.8503207", "0.8490302", "0.8490302", "0.84895617", "0.84895617", "0.84895617", "0.84866524", "0.84778446", "0.8476501", "0.8457027", "0.8457027", "0.8457027", "0.8455693", "0.84490657", "0.84451187", "0.84442055", "0.844...
0.84760785
20
Create and save a regular User with the given email and password.
def create_user(self, email, password=None, **extra_fields): extra_fields.setdefault('is_staff', False) extra_fields.setdefault('is_superuser', False) return self._create_user(email, password, **extra_fields)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, email, password, **extra_fields):\n\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self._db)\n return user", "def _create_user(self, email, password, **extra_fields):\...
[ "0.86050725", "0.8598407", "0.85864305", "0.85746485", "0.8557106", "0.8518878", "0.8518878", "0.8518878", "0.85146487", "0.8512698", "0.8509415", "0.8509415", "0.8507696", "0.84993356", "0.8494756", "0.8494756", "0.8494756", "0.8494756", "0.8494756", "0.8494756", "0.8494756"...
0.0
-1
Create and save a SuperUser with the given email and password.
def create_superuser(self, email, password, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) if extra_fields.get('is_staff') is not True: raise ValueError('Superuser must have is_staff=True.') if extra_fields.get('is_su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createsuperuser():\n\n email = prompt('User E-Mail')\n email_confirm = prompt('Confirm E-Mail')\n\n if not email == email_confirm:\n sys.exit('\\nCould not create user: E-Mail did not match')\n\n if not EMAIL_REGEX.match(email):\n sys.exit('\\nCould not create user: Invalid E-Mail add...
[ "0.8237176", "0.79841226", "0.7982151", "0.79641086", "0.7962122", "0.7950078", "0.7942463", "0.7942463", "0.7942463", "0.79412585", "0.7934801", "0.79277754", "0.79170924", "0.7912112", "0.7909707", "0.79029053", "0.79006577", "0.78965855", "0.78560257", "0.7851105", "0.7847...
0.7790897
30
Business method to extract and format data for 'measures' table.
def format_data(results): measures = [] counter = 0 for result in results: counter += 1 try: # Skip "DeviceInt*" probes if result.get("description").startswith("DeviceInt"): continue if ('measures' in result and len(result.get("measures"))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMeasures():", "def getMeasures(unique_name=None):", "def get_measure_columns() -> list:\n return [\n 'Number of Services',\n 'Number of Medicare Beneficiaries',\n 'Number of Distinct Medicare Beneficiary/Per Day Services',\n 'Average Medicare Allowed Am...
[ "0.7039788", "0.63949984", "0.6337883", "0.62608486", "0.6246158", "0.6077906", "0.6074325", "0.5836542", "0.58073634", "0.58073634", "0.57769066", "0.5750017", "0.5672349", "0.5633635", "0.56307864", "0.56283534", "0.5621347", "0.55219436", "0.5494019", "0.54719216", "0.5462...
0.6265401
3
Returns a deferred that will be called when the process ends.
def done(self): return self._done.get()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_deferred(self):\n self.deferred_executor.process()", "def _finish(self):\n if self.consumer:\n self.consumer.unregisterProducer()\n self.consumer = None\n\n if not self.deferred.called:\n self.deferred.callback(None)", "def killProcess(self):\n ...
[ "0.65953773", "0.61936015", "0.61674356", "0.6080718", "0.6071847", "0.5960446", "0.591284", "0.5910402", "0.5872081", "0.587073", "0.58628255", "0.5856888", "0.5834934", "0.5808488", "0.57885987", "0.57885987", "0.57885987", "0.57885987", "0.5782206", "0.5757296", "0.5727452...
0.0
-1
Returns a deferred that will be called once the process starts.
def started(self): return self._started.get()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def defer(self, *args, **kwargs):\n return DeferredRoutineCall(self, *args, **kwargs)", "def handle_deferred(self):\n self.deferred_executor.process()", "def defer(closure, **kw):\r\n\r\n Deferred(closure, **kw).start()", "def _check_started(f):\n def inner(self, *args, **kwargs):\n ...
[ "0.63942105", "0.6386552", "0.6205992", "0.60701406", "0.5952012", "0.5812182", "0.5796162", "0.5794925", "0.57789487", "0.57636154", "0.57523715", "0.57388395", "0.57263136", "0.57140887", "0.5707238", "0.5673704", "0.5665782", "0.5620238", "0.56168365", "0.5616257", "0.5605...
0.0
-1
Kills the underlying process.
def kill(self): if self.transport.pid is not None: self.transport.signalProcess('KILL')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kill(self):\n\n self.proc.kill()", "def kill(self):\n self._stop_proc(signal.SIGKILL)", "def kill(self):\n self._process.kill()", "def kill(self):\n if self.process is not None:\n LOGGER.info('Killing command...')\n self.process.kill()\n self.p...
[ "0.8189746", "0.7882126", "0.78450996", "0.7644135", "0.7573756", "0.75117594", "0.7417189", "0.7345615", "0.7207803", "0.7190397", "0.71868044", "0.7156865", "0.7124084", "0.7106891", "0.7104847", "0.70043904", "0.6994104", "0.6971545", "0.6948991", "0.69425774", "0.69246817...
0.7108763
13
Writes the command to the processes' stdin.
def send(self, command): self.transport.write(command.to_json()) self.transport.write("\n")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, command):\n self.stdin_stream.write(command)\n self.stdin_stream.flush()", "def write(self, command):\n # Write command in bytes plus newline then flush.\n self.proc.stdin.write(bytes(command + \"\\n\", 'ascii'))\n self.proc.stdin.flush()\n\n self.genout(...
[ "0.7742846", "0.758709", "0.7408216", "0.74081767", "0.70342624", "0.67083347", "0.6690452", "0.66279495", "0.6563766", "0.628263", "0.6267979", "0.622254", "0.6147673", "0.5964244", "0.59547204", "0.59234786", "0.58922905", "0.5880339", "0.58774865", "0.58630073", "0.5836130...
0.0
-1
Add additional resources should only be called before
def add_resource(self, resource_name, resource): self.resources[resource_name] = resource
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_resources(event):\n anuket_resources.need()", "def register_resources(self):\n raise NotImplementedError", "def resources(self):", "def register_resources(self, resources):\n from tw.api import merge_resources\n merge_resources(self.request_local.resources, resources)", "def...
[ "0.73939854", "0.666462", "0.6575659", "0.6547136", "0.6332321", "0.61183745", "0.60682935", "0.606145", "0.6051648", "0.6035564", "0.59642357", "0.5945735", "0.5945208", "0.5941", "0.59302425", "0.58973676", "0.5892642", "0.5879641", "0.5870391", "0.5869459", "0.5859476", ...
0.588855
17
Set the value of a key.
def handle_set(self, api, command): key = self._sandboxed_key(api.sandbox_id, command.get('key')) seconds = command.get('seconds') if not (seconds is None or isinstance(seconds, (int, long))): returnValue(self.reply_error( command, "seconds must be a number or null"))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(self, key, value):", "def set(self, key, value):", "def set(self, key, value):\n self._data[key] = value", "def set(self, key, value):\n self._data[key] = value", "def set_value(self, key, value):\n self.data[key] = value\n self.save_data()", "def set(self, key, value)...
[ "0.8418385", "0.8418385", "0.8359021", "0.8359021", "0.8262279", "0.82621676", "0.82212186", "0.80870235", "0.80243295", "0.78710115", "0.783575", "0.77795756", "0.7776591", "0.7752569", "0.7752569", "0.7752569", "0.7751663", "0.771907", "0.7687312", "0.76835847", "0.76741266...
0.0
-1
Retrieve the value of a key.
def handle_get(self, api, command): key = self._sandboxed_key(api.sandbox_id, command.get('key')) raw_value = yield self.redis.get(key) value = json.loads(raw_value) if raw_value is not None else None returnValue(self.reply(command, success=True, value=valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(self, key):\n return self[key]", "def get_value(self, key):\n return self.data.get(key)", "def get( self, key ):\n if key not in self._values:\n raise ValueError( 'Invalid argument key \"{}\".'.format( key ) )\n return self._values[ key ]", "def get_value(...
[ "0.8579645", "0.83154035", "0.82923156", "0.8278068", "0.8175047", "0.81501853", "0.81434643", "0.80820304", "0.79780483", "0.7949287", "0.78817004", "0.7817538", "0.78010017", "0.77884114", "0.7778239", "0.7753097", "0.7736823", "0.7727199", "0.7710911", "0.77064186", "0.767...
0.0
-1
Atomically increment the value of an integer key. The current value of the key must be an integer. If the key does not exist, it is set to zero.
def handle_incr(self, api, command): key = self._sandboxed_key(api.sandbox_id, command.get('key')) if not (yield self.check_keys(api, key)): returnValue(self._too_many_keys(command)) amount = command.get('amount', 1) try: value = yield self.redis.incr(key, amount=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __incKeyCount(self,\n key):\n if (self.__keyCount.has_key(key) == 0): self.__keyCount[key] = 0\n self.__keyCount[key] = self.__keyCount[key] + 1\n return self.__keyCount[key]", "def incr(self, key, value=1):\n try:\n self[key] += value\n exce...
[ "0.74396485", "0.74246794", "0.72967505", "0.72967505", "0.7202752", "0.7201442", "0.71488696", "0.7147027", "0.70858496", "0.70796204", "0.69483596", "0.68995315", "0.68314445", "0.6815712", "0.6760519", "0.67374295", "0.6722753", "0.66972864", "0.6679329", "0.66549736", "0....
0.6366343
39
Sends a reply to the individual who sent a received message.
def handle_reply_to(self, api, command): content = command['content'] continue_session = command.get('continue_session', True) orig_msg = api.get_inbound_message(command['in_reply_to']) d = self.app_worker.reply_to(orig_msg, content, continue_session=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reply(self, body):\n return self.author.send_message(body=body, reply_to=self.id)", "def respond(self, msg, msgID, protocol, remoteID):\r\n protocol.sendMessage(self, msg, msgID, remoteID)", "def reply(self, msg_id, response):\n return self.hub.reply(self.get_private_key(), msg_id, res...
[ "0.74281424", "0.6995021", "0.68227196", "0.6796245", "0.6712307", "0.6704049", "0.6690775", "0.6673909", "0.6650697", "0.66407347", "0.66115856", "0.65886915", "0.6503527", "0.64697134", "0.6464312", "0.64447606", "0.6442091", "0.64249456", "0.6409682", "0.6409541", "0.63462...
0.0
-1
Sends a reply to the group from which a received message was sent.
def handle_reply_to_group(self, api, command): content = command['content'] continue_session = command.get('continue_session', True) orig_msg = api.get_inbound_message(command['in_reply_to']) d = self.app_worker.reply_to_group(orig_msg, content, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reply_group(self, *args, **kw):\n out_msg = self.reply(*args, **kw)\n if self['group'] is not None:\n out_msg['to_addr'] = None\n return out_msg", "def handle_reply_to_group(self, api, command):\n try:\n content, orig_msg, continue_session, helper_metadata = ...
[ "0.7835496", "0.72320074", "0.6691186", "0.66384053", "0.6482554", "0.64154977", "0.63986325", "0.6321635", "0.6295746", "0.62455034", "0.61350477", "0.61332893", "0.6121003", "0.6085777", "0.60732275", "0.6049861", "0.6028806", "0.6015356", "0.5966122", "0.5943455", "0.59416...
0.7205086
2
Sends a message to a specified address.
def handle_send_to(self, api, command): content = command['content'] to_addr = command['to_addr'] endpoint = command.get('endpoint', 'default') d = self.app_worker.send_to(to_addr, content, endpoint=endpoint) d.addCallback(lambda r: self.reply(command, success=True)) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, address, message):\n self.__set_i2c_address(address)\n self.__write(message)", "def sendto(self, data: bytes, address: Tuple) -> int:\n ...", "async def send_to_user(self, user: User, msg: Msg, address: str = None):\n if address is None:\n address = user.cu...
[ "0.72941005", "0.7244614", "0.71493095", "0.71197104", "0.7039757", "0.6937346", "0.6910837", "0.68682057", "0.6848539", "0.683916", "0.66872245", "0.6665314", "0.6661667", "0.66567826", "0.6631621", "0.6600665", "0.6598476", "0.6563298", "0.6536104", "0.6483595", "0.6462274"...
0.0
-1
Logs a message via vumi.log (i.e. Twisted logging). Subclass should override this if they wish to log messages elsewhere. The `api` parameter is provided for use by such subclasses. The `log` method should always return a deferred.
def log(self, api, msg, level): return succeed(log.msg(msg, logLevel=level))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, message: str):", "def log(self, message):", "def handle_log(self, api, command, level=None):\n level = command.get('level', level)\n if level is None:\n level = logging.INFO\n msg = command.get('msg')\n if msg is None:\n returnValue(self.reply(com...
[ "0.62588555", "0.61909205", "0.60318035", "0.5876172", "0.5767462", "0.5719353", "0.56615025", "0.56615025", "0.56079364", "0.5598509", "0.55829424", "0.5562299", "0.5525649", "0.55162686", "0.5513187", "0.5507155", "0.54979646", "0.5494922", "0.54893714", "0.5478701", "0.546...
0.6609489
0
Log a message at the specified severity level. The other log commands are identical except that ``level`` need not be specified. Using the loglevel specific commands is preferred.
def handle_log(self, api, command, level=None): level = command.get('level', level) if level is None: level = logging.INFO msg = command.get('msg') if msg is None: returnValue(self.reply(command, success=False, reason="Value expe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, message, level=None):\n\n if level is None or level.lower() == \"all\":\n level = \"notset\"\n level = getattr(logging, level.upper())\n\n self.logger.log(level, message)", "def __log(level, message):\n if level == 1:\n logging.info(\" \" + str(datetime.dat...
[ "0.69736856", "0.69717073", "0.6819493", "0.6795034", "0.6610909", "0.65883386", "0.6571893", "0.64859456", "0.64780974", "0.6469924", "0.64075714", "0.63845026", "0.6365989", "0.6314267", "0.6300642", "0.62879443", "0.62683153", "0.6249968", "0.62346053", "0.62274724", "0.62...
0.5699857
64
Logs a message at the ``DEBUG`` log level.
def handle_debug(self, api, command): return self.handle_log(api, command, level=logging.DEBUG)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debug(self, message: str):\n self.log(Level.DEBUG, message)", "def log_debug(self, msg):\n self.log(msg, level=LOG_DEBUG)", "def msg_debug(message):\n if _log_lvl == logging.DEBUG:\n to_stdout(\" (*) {message}\".format(message=message), colorf=cyan)\n if _logger:\n ...
[ "0.8366112", "0.8357671", "0.8334863", "0.8205168", "0.8183164", "0.80656815", "0.80617577", "0.80188334", "0.7997606", "0.79878056", "0.7979886", "0.79605484", "0.7957748", "0.7924502", "0.7890965", "0.7888706", "0.7876559", "0.7776957", "0.7755921", "0.77538514", "0.7752709...
0.0
-1
Logs a message at the ``INFO`` log level.
def handle_info(self, api, command): return self.handle_log(api, command, level=logging.INFO)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(self, message: str):\n self.log(Level.INFO, message)", "def info(message: str, *args: Any) -> None:\n Logger.log(logging.INFO, message, *args)", "def log_info(self, msg):\n self.log(msg, level=LOG_INFO)", "def info(self, message: str) -> None:\n\n self.__add_log(self.INFO...
[ "0.8580891", "0.8531367", "0.84378135", "0.82716554", "0.82706", "0.82153296", "0.82041216", "0.8185319", "0.80368036", "0.80111647", "0.7998667", "0.7988161", "0.7983948", "0.7977032", "0.7946762", "0.7942989", "0.78871095", "0.78853965", "0.7883028", "0.7865361", "0.7832679...
0.6524697
62
Logs a message at the ``WARNING`` log level.
def handle_warning(self, api, command): return self.handle_log(api, command, level=logging.WARNING)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warn(self, message: str):\n self.log(Level.WARNING, message)", "def warning(warning_message: str):\n logger.warning(warning_message)", "def warning(message: str, *args: Any) -> None:\n Logger.log(logging.WARN, message, *args)", "def logwarning(self, msg):\n self.logger.warning(msg...
[ "0.851772", "0.8506773", "0.85006905", "0.8482524", "0.84166867", "0.8413865", "0.8361264", "0.8316793", "0.82993543", "0.8275807", "0.82646966", "0.82539433", "0.82478034", "0.8244659", "0.823924", "0.8237153", "0.82192165", "0.8213992", "0.82070726", "0.8206089", "0.8191427...
0.0
-1
Logs a message at the ``ERROR`` log level.
def handle_error(self, api, command): return self.handle_log(api, command, level=logging.ERROR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_error(self, msg):\n self.log(msg, level=LOG_ERROR)", "def error(self, message: str):\n self.log(Level.ERROR, message)", "def error(error_message: str):\n logger.error(error_message)", "def err(message):\n\n timestamp = format_time(get_time())\n message = '{} - [ERROR] - {}'.for...
[ "0.8237669", "0.80030644", "0.79834133", "0.78904074", "0.78339803", "0.783222", "0.782851", "0.77787817", "0.7774609", "0.7774305", "0.7768485", "0.7751224", "0.77304727", "0.77241015", "0.77092797", "0.7541504", "0.75259614", "0.75143814", "0.74450713", "0.74356484", "0.741...
0.0
-1
Logs a message at the ``CRITICAL`` log level.
def handle_critical(self, api, command): return self.handle_log(api, command, level=logging.CRITICAL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def critical(message: str, *args: Any) -> None: # pragma: no cover\n Logger.log(logging.CRITICAL, message, *args)", "def critical(self, message: str):\n self.log(Level.CRITICAL, message)", "def critical(msg):\n log_msg(CRITICAL, msg)", "def critical(self, msg, *args, **kwargs):\n sel...
[ "0.85096586", "0.82847667", "0.80889934", "0.7964336", "0.79508466", "0.7939955", "0.7748192", "0.77236235", "0.75199497", "0.7465908", "0.7351842", "0.73428136", "0.7339046", "0.7335877", "0.72927964", "0.71788436", "0.6846049", "0.6720184", "0.66962856", "0.6648653", "0.663...
0.6943484
16
Use ClientContextFactory directly and set the method if necessary. This will perform no host verification at all.
def _get_noverify_context(self): from twisted.internet.ssl import ClientContextFactory context_factory = ClientContextFactory() if self.ssl_method is not None: context_factory.method = self.ssl_method return context_factory.getContext()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, url, **kwargs):\n self.hostname = self.getHostnameFromURL(url)\n\n # ``verify`` here refers to server-side verification of certificates\n # presented by a client:\n self.verify = False if self.isClient else True\n super(SSLVerifyingContextFactory, self).__init_...
[ "0.58759177", "0.57396954", "0.5704184", "0.5654362", "0.5596379", "0.5576222", "0.5547429", "0.5513605", "0.551157", "0.54686517", "0.5450384", "0.54451317", "0.54451317", "0.54451317", "0.54451317", "0.54451317", "0.5389514", "0.53803885", "0.53754294", "0.5344577", "0.5342...
0.57632256
1
Make an HTTP GET request.
def handle_get(self, api, command): return self._make_request_from_command('GET', command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_GET(self):\n self.http_method = 'GET'\n self.response()", "def get(self, *path, **data):\n\t\treturn self.request('GET', *path, **data)", "def get(self, *args, **kw):\n kw['method'] = 'GET'\n return self.open(*args, **kw)", "def get(self, *args, **kwargs):\n self.req...
[ "0.7992183", "0.7964515", "0.79520166", "0.7856277", "0.784097", "0.78315854", "0.78135085", "0.77794534", "0.76968414", "0.7664457", "0.7663519", "0.7629618", "0.75919056", "0.7587477", "0.75773835", "0.75588286", "0.7525723", "0.7521065", "0.7477174", "0.7457246", "0.745590...
0.0
-1
Make an HTTP PUT request.
def handle_put(self, api, command): return self._make_request_from_command('PUT', command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def put(self, *args, **kw):\n kw['method'] = 'PUT'\n return self.open(*args, **kw)", "def _put(self, *args, **kwargs):\n return self._request('put', *args, **kwargs)", "def put(self, u...
[ "0.8385138", "0.8301353", "0.82257414", "0.8194025", "0.81546164", "0.8014394", "0.7950364", "0.7868214", "0.7865386", "0.7856735", "0.77816135", "0.7774543", "0.7757993", "0.7712685", "0.7612626", "0.7602484", "0.75962627", "0.75962627", "0.75962627", "0.7547503", "0.7535183...
0.7208611
38
Make an HTTP DELETE request.
def handle_delete(self, api, command): return self._make_request_from_command('DELETE', command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def httpDelete(self, url='', data='', params={}, headers={}):\n\n return self.httpRequest('DELETE', url, data, params, headers)", "def do_DELETE(self,):\n self.http_method = 'DELETE'\n self.response()", "def delete(self):\r\n return http.Request('DELETE', '{0}'.format(\r\n ...
[ "0.86554825", "0.8388014", "0.830307", "0.81576777", "0.8146794", "0.81088203", "0.8056914", "0.8012024", "0.8011185", "0.79084957", "0.7869481", "0.7860623", "0.78572756", "0.77129704", "0.7690312", "0.7690312", "0.76605344", "0.7657503", "0.7538217", "0.7509946", "0.7497349...
0.707418
54
Make an HTTP HEAD request.
def handle_head(self, api, command): return self._make_request_from_command('HEAD', command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_HEAD(self):\n self.do_GET(True)", "def do_HEAD(self):\n self.log.debug('do_HEAD called')\n self.HeadGet('HEAD')", "async def head(url, session=None, **kwargs):\n\n method = 'HEAD'\n resp = await _request(method, url, session=session, **kwargs)\n return resp", "def head(self, url,...
[ "0.8344407", "0.818973", "0.813251", "0.8088553", "0.80747944", "0.7905858", "0.78950536", "0.7855229", "0.7854368", "0.7849326", "0.7813137", "0.77831864", "0.77831864", "0.77831864", "0.77831864", "0.7763726", "0.77396655", "0.77286154", "0.76971126", "0.7648268", "0.758873...
0.7776205
15
Make an HTTP POST request.
def handle_post(self, api, command): return self._make_request_from_command('POST', command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def httpPost(self, url='', data='', params={}, headers={}):\n\n return self.httpRequest('POST', url, data, params, headers)", "def post(self, *args, **kwargs):\n return self._requests_call(util.requests_post, *args, **kwargs)", "def do_POST(self,):\n self.http_method = 'POST'\n self.res...
[ "0.7948866", "0.78074974", "0.775014", "0.77245474", "0.7586205", "0.7512639", "0.7453403", "0.73794913", "0.7378032", "0.73769873", "0.73720765", "0.7345682", "0.72977006", "0.726105", "0.7250581", "0.72415143", "0.72306734", "0.7205217", "0.7157622", "0.7133639", "0.7116172...
0.0
-1
Make an HTTP PATCH request.
def handle_patch(self, api, command): return self._make_request_from_command('PATCH', command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def httpPatch(self, url='', data='', params={}, headers={}):\n\n return self.httpRequest('PATCH', url, data, params, headers)", "def patch(url, data=None, **kwargs):\n\n return request('patch', url, data=data, **kwargs)", "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kw...
[ "0.8377986", "0.77408034", "0.7737159", "0.7708333", "0.7624386", "0.7548285", "0.75311804", "0.75118834", "0.74857336", "0.73733705", "0.7367035", "0.7365305", "0.73553634", "0.73553634", "0.73553634", "0.7353132", "0.7337053", "0.7293803", "0.72613055", "0.7235854", "0.7191...
0.72490084
19
Return a sandbox id for a message or event. Subclasses may override this to retrieve an appropriate id.
def sandbox_id_for_message(self, msg_or_event): return msg_or_event['sandbox_id']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self) -> str:\n return self._event.get('id')", "def getId(self):\n return _libsbml.Event_getId(self)", "def getMessageID(self):\n return self._payload[1]", "def message_id(self) -> int:\n enforce(self.is_set(\"message_id\"), \"message_id is not set.\")\n return cast(...
[ "0.6507702", "0.627226", "0.6100435", "0.6046295", "0.60373926", "0.5947721", "0.59358907", "0.5924999", "0.5924389", "0.5914692", "0.58880615", "0.58774614", "0.5876454", "0.5876454", "0.5876454", "0.5876454", "0.5876454", "0.5876454", "0.5876454", "0.5876454", "0.5876454", ...
0.88027954
0
Return a sandbox protocol for a message or event. Subclasses may override this to retrieve an appropriate protocol.
def sandbox_protocol_for_message(self, msg_or_event, config): api = self.create_sandbox_api(self.resources, config) protocol = self.create_sandbox_protocol(api) return protocol
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def protocol(self):\n self._recv_protocol()\n return self._protocol", "def protocol(self) -> MessageProtocol:\n return self._sender.protocol", "def getProtocol(self, _):\r\n return self._protocol", "def protocol(self) -> NetworkProtocol:\n if hasattr(self, \"_protocol\"):\n...
[ "0.6581834", "0.65799445", "0.65358585", "0.645299", "0.62877756", "0.6196647", "0.6158876", "0.6152343", "0.6143666", "0.60666347", "0.60666347", "0.60666347", "0.60666347", "0.60666347", "0.606265", "0.606265", "0.5934752", "0.59274423", "0.58809066", "0.5875745", "0.586304...
0.80012
0
Sort table by given column number.
def sort(self, p_int, order=None): try: self.layoutAboutToBeChanged.emit() source_array = self.get_source_array() if len(source_array): source_array = sorted(source_array, key=lambda x: (self.get_item(x, p_int) is None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortTable(self, table, cols):\n #productive\n profprint()\n for col in reversed(cols):\n table = sorted(table, key=operator.itemgetter(col))\n return table", "def sortTable(self, table, cols):\r\n # productive\r\n profprint()\r\n for col in reversed(cols):\r\n table = sorted(ta...
[ "0.6988205", "0.6941003", "0.688725", "0.6766009", "0.6726265", "0.6554286", "0.64665633", "0.63434094", "0.62454164", "0.62412584", "0.62091345", "0.6206283", "0.61986214", "0.6197047", "0.61965746", "0.619618", "0.61853695", "0.6185017", "0.61779505", "0.61375666", "0.61233...
0.0
-1
Objective function, necessary for optimizing with optuna.
def objective(trial, bounds: Optional[Iterable]=None, func: Optional[Callable]=None, param_names: Optional[List[str]]=None): if param_names is None: param_names = PARAM_NAMES if (bounds is None): bounds = ((-10, 10) for _ in param_names) if not is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objective(self):\n pass", "def objective(self, x):\n pass", "def objective(self, x):\n pass", "def objective_function(x):\n return x * 1 # change this to our actual function", "def get_Objective(self):\r\n \r\n ans = 0\r\n for i in range(len(self.X.shape)):...
[ "0.7534007", "0.75032496", "0.75032496", "0.733393", "0.70547366", "0.6989981", "0.67604387", "0.6705372", "0.65997154", "0.65972316", "0.6582349", "0.6576692", "0.6509474", "0.64613736", "0.63616884", "0.6350423", "0.6277985", "0.62494683", "0.6182294", "0.6176217", "0.61698...
0.0
-1
Returns formatted output for a dictionary with string keys and float values.
def format_dict(d: Dict[str, float], format: str=".4f") -> Dict[str, float]: return dict((k, float(f'{v:{format}}')) for k,v in d.items())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_dict(dictionary):\n for key in sorted(dictionary.keys()):\n value = dictionary[key]\n if type(value) == float:\n value = round(value, 8)\n print key, value", "def print_dict(dictionary):\r\n for key in sorted(dictionary.keys()):\r\n value = dictionary[key]\r...
[ "0.70268685", "0.70015323", "0.6506103", "0.65015024", "0.63505834", "0.63133466", "0.61922085", "0.6134083", "0.6098064", "0.6060226", "0.6022871", "0.6014576", "0.5958936", "0.5937073", "0.5937073", "0.5933473", "0.5883104", "0.5847088", "0.5822004", "0.5818801", "0.581338"...
0.7233693
0
Create contour plots for a study, given a list or tuple of two parameter names.
def study_contour_plot(study: optuna.Study, params: Optional[List[str]]=None, width: int=560, height: int=500): if params is None: params = ["dv", "vc"] fig = optuna.visualization.plot_contour(study, params=params) fig.update_la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_plots(fig_title, \n t_csd_x, t_csd_y, t_csd_z, true_csd, \n ele_x, ele_y, ele_z, pots,\n k_csd_x, k_csd_y, k_csd_z, est_csd):\n fig = plt.figure(figsize=(10,16))\n #True CSD\n z_steps = 5\n height_ratios = [1 for i in range(z_steps)]\n height_ratios...
[ "0.62037873", "0.58769345", "0.5820305", "0.57832277", "0.57221377", "0.56909025", "0.5687232", "0.562841", "0.5538102", "0.5485024", "0.54831433", "0.54714435", "0.5457713", "0.5433277", "0.54000473", "0.53964806", "0.5381867", "0.53771883", "0.53722656", "0.5367312", "0.536...
0.7024441
0
Keyword arguments specify which objects should be read from ROOT files. types sets the list of possible objects types. keys specifies a list of allowed objects' names. Only simple keys are currently allowed (no regular expressions). If both types and keys are provided, then objects that satisfy any of types or keys are...
def __init__(self, types=None, keys=None, selector=None): try: import ROOT except ImportError: raise ImportError("ROOT not installed") if selector is not None: if keys or types: raise lena.core.LenaTypeError( "if selector i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_select(self, selected):\n\t\tfor filename in selected:\n\t\t\tself.load(filename)\n\n\t\tif \"worddict\" in selected and \"classdict\" in selected:\n\t\t\tself.reverse_dicts()", "def selector(**kwargs):\n return kwargs", "def select(self, mode, types=None, types_excluded=None, layers=None, layers_e...
[ "0.5373972", "0.5329947", "0.51422113", "0.5035492", "0.47958642", "0.4764183", "0.4713935", "0.4688114", "0.46815497", "0.46460122", "0.46450743", "0.46351984", "0.4616212", "0.46100155", "0.46050787", "0.45995423", "0.457178", "0.4546644", "0.4534454", "0.45308408", "0.4524...
0.71854883
0
Read ROOT files from flow and yield objects they contain. For file to be read, data part of the value must be a string (file's path) and context.input.read_root_file must not be `False`. Other values pass unchanged. After all entries from the file are yielded, it is closed. context.input.root_file_path is updated with ...
def run(self, flow): from ROOT import TFile from lena.context import get_recursively, update_recursively from lena.flow import get_data_context from copy import deepcopy for val in flow: data, context = get_data_context(val) # skip not ROOT files ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def files_and_folders(self):\n yield from self._root.files_and_folders(0)", "def files_from_roots(roots, accept):\n for root in roots:\n if root is not None:\n yield from files_from_root(root, accept)", "def open_test_root_fs() -> FS:\n cwd = os.path.dirname(__file__)\n return...
[ "0.55671173", "0.5524454", "0.5513734", "0.5512159", "0.54909235", "0.5358831", "0.5296867", "0.5270758", "0.5249741", "0.51901007", "0.5162517", "0.514831", "0.5129456", "0.5121177", "0.5115669", "0.5112054", "0.51021385", "0.50759375", "0.5071909", "0.5056866", "0.5011314",...
0.7067436
0