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
Gets the db connection.
def get_connection(self): current_platform = platform.system().lower() if current_platform != "windows": raise Exception("MS Access can only be used in Windows.") import pypyodbc as dbapi # pylint: disable=E0401 self.get_input() file_name = self.opts["file"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connection(self):\n\n\t\treturn dbapi.connect(credentials.SERVER,\\\n\t\t\t\t\t\t\t credentials.PORT,\\\n\t\t\t\t\t\t\t credentials.USER,\\\n\t\t\t\t\t\t\t credentials.PASSWORD)", "def get_connection(cls):\n return cls.database.connection", "def get_db():\n if not hasattr(g, 'db_connectio...
[ "0.8684576", "0.86277896", "0.8552817", "0.8545873", "0.8271116", "0.8254641", "0.81228167", "0.80504644", "0.80504644", "0.8048555", "0.8040573", "0.8039187", "0.802962", "0.8026118", "0.8026118", "0.8006939", "0.80013317", "0.7990245", "0.7976455", "0.7968377", "0.79032737"...
0.0
-1
This function connects to the device provided when called (dev) in the instantiated testbed (testbed_obj) and executes the provided show command (if none was provided, 'show version' is executed by default. If the Save option = True (s in the command line) was provided then the output will be saved to a JSON file in th...
def device_info(dev, testbed_obj, showcmd='show version', save_to_json=False, logstdout=True): device = testbed_obj.devices[dev] device.connect(log_stdout=logstdout) response = device.parse(showcmd) print(f"Response from {dev} is of type {type(response)} and length {len(response)}") print(f"RAW res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def executeShow(self,\n rsrcType,\n showAdditionalParams=[],\n rsrcAdditionalParams=[]):\n\n args = [\"show\",\n \"--wavefrontHost\", util.wavefrontHostName,\n \"--apiToken\", util.wavefrontApiToken] \\\n + sho...
[ "0.6001754", "0.56841195", "0.566696", "0.54662395", "0.54120153", "0.5365674", "0.5250371", "0.523401", "0.52098423", "0.5194957", "0.51602536", "0.51479226", "0.5107748", "0.5103756", "0.50766176", "0.5072563", "0.50322425", "0.5027172", "0.50200206", "0.5005128", "0.500112...
0.72180516
0
initialize your data structure here.
def __init__(self): self.max_heap = MaxHeap() self.min_heap = MinHeap()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_empty(self):\n self._data = []", "def __init__(self):\n self.data = []\n self.record = {}", "def __init__(self):\n self.structure = {}", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self...
[ "0.7761043", "0.76102185", "0.7555967", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.752797", "0.7446006", "0.7446006", "0.7446006", "0.7446006", "0.7446006", "0.743338", "0.743338", "0.7408609", "0.7385719", "0.737986", "0.737986", "0.73...
0.0
-1
The set of arguments for constructing a BucketLifecycleConfigurationV2 resource.
def __init__(__self__, *, bucket: pulumi.Input[str], rules: pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleArgs']]], expected_bucket_owner: Optional[pulumi.Input[str]] = None): pulumi.set(__self__, "bucket", bucket) pulumi.set(__s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n bucket: Optional[pulumi.Input[str]] = None,\n expected_bucket_owner: Optional[pulumi.Input[str]] = None,\n rules: Optional[pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleArgs']]]] = None):\n if bucket is not N...
[ "0.5992038", "0.5966955", "0.5840128", "0.564464", "0.5369499", "0.5274274", "0.5194183", "0.5058795", "0.5053266", "0.5050231", "0.5019062", "0.5004931", "0.49637008", "0.49507582", "0.49400494", "0.48740724", "0.48440862", "0.4800399", "0.47935998", "0.47795483", "0.4777908...
0.57040656
3
Name of the source S3 bucket you want Amazon S3 to monitor.
def bucket(self) -> pulumi.Input[str]: return pulumi.get(self, "bucket")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s3_bucket_name(self):\n return self._get_param(\"ResourcesS3Bucket\")", "def bucket_name(self) -> str:\n ...", "def bucket_name(self) -> str:\n return pulumi.get(self, \"bucket_name\")", "def s3_bucket(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"s3_bucket\")", "d...
[ "0.7696654", "0.7252698", "0.7064286", "0.70079666", "0.6968253", "0.6968253", "0.6959447", "0.6959447", "0.6959447", "0.6959447", "0.6959447", "0.67862225", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.676...
0.6067084
47
List of configuration blocks describing the rules managing the replication. See below.
def rules(self) -> pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleArgs']]]: return pulumi.get(self, "rules")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rules(self) -> Sequence['outputs.GetCompliancePacksPackConfigRuleResult']:\n return pulumi.get(self, \"config_rules\")", "def rules(self) -> List['outputs.PreventionInspectTemplateInspectConfigRuleSetRule']:\n return pulumi.get(self, \"rules\")", "def rules(cls):\n rules_Citysca...
[ "0.60906136", "0.6038157", "0.59134495", "0.5897179", "0.5889369", "0.5826266", "0.5803657", "0.5783454", "0.574287", "0.5704244", "0.5654648", "0.5601011", "0.55975515", "0.5552346", "0.55122215", "0.5479335", "0.54434586", "0.5440965", "0.54113096", "0.5402494", "0.5401443"...
0.5440727
18
Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
def expected_bucket_owner(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "expected_bucket_owner")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expected_bucket_owner(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"expected_bucket_owner\")", "def owner_account_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"owner_account_id\")", "def owner_account_id(self) -> Optional[pulumi.Input[str]]:\n return ...
[ "0.7146499", "0.6446139", "0.6384591", "0.6065642", "0.5860553", "0.5854814", "0.58411705", "0.581899", "0.57273", "0.57180434", "0.5700793", "0.5700793", "0.5690769", "0.5674292", "0.5650694", "0.56504285", "0.5646915", "0.5642213", "0.5625961", "0.5623262", "0.56102705", ...
0.70394754
1
Input properties used for looking up and filtering BucketLifecycleConfigurationV2 resources.
def __init__(__self__, *, bucket: Optional[pulumi.Input[str]] = None, expected_bucket_owner: Optional[pulumi.Input[str]] = None, rules: Optional[pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleArgs']]]] = None): if bucket is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rules(self) -> pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleArgs']]]:\n return pulumi.get(self, \"rules\")", "def get_bucket_lifecycle_configuration(Bucket=None):\n pass", "def rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleA...
[ "0.6019637", "0.5962815", "0.57765776", "0.5525546", "0.5406651", "0.53766525", "0.52367", "0.4996396", "0.48929548", "0.48800376", "0.48694855", "0.48114437", "0.48030028", "0.47656834", "0.46710703", "0.46434137", "0.4614874", "0.4606839", "0.46032488", "0.45911995", "0.458...
0.55417687
3
Name of the source S3 bucket you want Amazon S3 to monitor.
def bucket(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "bucket")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s3_bucket_name(self):\n return self._get_param(\"ResourcesS3Bucket\")", "def bucket_name(self) -> str:\n ...", "def bucket_name(self) -> str:\n return pulumi.get(self, \"bucket_name\")", "def s3_bucket(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"s3_bucket\")", "d...
[ "0.7696654", "0.7252698", "0.7064286", "0.70079666", "0.6968253", "0.6968253", "0.6959447", "0.6959447", "0.6959447", "0.6959447", "0.6959447", "0.67862225", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.676...
0.5758498
98
Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
def expected_bucket_owner(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "expected_bucket_owner")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expected_bucket_owner(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"expected_bucket_owner\")", "def owner_account_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"owner_account_id\")", "def owner_account_id(self) -> Optional[pulumi.Input[str]]:\n return ...
[ "0.7147683", "0.6445131", "0.63837475", "0.6061159", "0.5858455", "0.5852843", "0.583966", "0.5817529", "0.5723972", "0.5716804", "0.5698139", "0.5698139", "0.5686788", "0.5675481", "0.5651604", "0.565157", "0.564837", "0.5641776", "0.562609", "0.5620628", "0.5610478", "0.5...
0.7040738
2
List of configuration blocks describing the rules managing the replication. See below.
def rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['BucketLifecycleConfigurationV2RuleArgs']]]]: return pulumi.get(self, "rules")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rules(self) -> Sequence['outputs.GetCompliancePacksPackConfigRuleResult']:\n return pulumi.get(self, \"config_rules\")", "def rules(self) -> List['outputs.PreventionInspectTemplateInspectConfigRuleSetRule']:\n return pulumi.get(self, \"rules\")", "def rules(cls):\n rules_Citysca...
[ "0.60906136", "0.6038157", "0.59134495", "0.5897179", "0.5889369", "0.5826266", "0.5803657", "0.5783454", "0.574287", "0.5704244", "0.5654648", "0.5601011", "0.55975515", "0.5552346", "0.55122215", "0.5479335", "0.54434586", "0.5440965", "0.5440727", "0.54113096", "0.5402494"...
0.52318865
40
Get an existing BucketLifecycleConfigurationV2 resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, bucket: Optional[pulumi.Input[str]] = None, expected_bucket_owner: Optional[pulumi.Input[str]] = None, rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n minimal_action: Optional[pulumi.Input[str]] = None,\n most_disruptive_allowed_action: Optional[pulumi.Input[str]] = None,\n name: Optional[pulumi.Input[str]...
[ "0.58018064", "0.5353829", "0.5117951", "0.51060236", "0.50312877", "0.49301392", "0.48632613", "0.4778881", "0.47655228", "0.47473097", "0.4707761", "0.4704642", "0.46908763", "0.46863323", "0.4678712", "0.46439952", "0.46264488", "0.46231508", "0.46105427", "0.455522", "0.4...
0.7716009
0
Name of the source S3 bucket you want Amazon S3 to monitor.
def bucket(self) -> pulumi.Output[str]: return pulumi.get(self, "bucket")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s3_bucket_name(self):\n return self._get_param(\"ResourcesS3Bucket\")", "def bucket_name(self) -> str:\n ...", "def bucket_name(self) -> str:\n return pulumi.get(self, \"bucket_name\")", "def s3_bucket(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"s3_bucket\")", "d...
[ "0.7696654", "0.7252698", "0.7064286", "0.70079666", "0.6968253", "0.6968253", "0.6959447", "0.6959447", "0.6959447", "0.6959447", "0.6959447", "0.67862225", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.67652977", "0.676...
0.5934818
73
Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
def expected_bucket_owner(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "expected_bucket_owner")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expected_bucket_owner(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"expected_bucket_owner\")", "def expected_bucket_owner(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"expected_bucket_owner\")", "def owner_account_id(self) -> pulumi.Output[str]:\n ...
[ "0.7040738", "0.7040738", "0.6445131", "0.63837475", "0.6061159", "0.5858455", "0.5852843", "0.583966", "0.5817529", "0.5723972", "0.5716804", "0.5698139", "0.5698139", "0.5686788", "0.5675481", "0.5651604", "0.565157", "0.564837", "0.5641776", "0.562609", "0.5620628", "0.5...
0.7147683
0
List of configuration blocks describing the rules managing the replication. See below.
def rules(self) -> pulumi.Output[Sequence['outputs.BucketLifecycleConfigurationV2Rule']]: return pulumi.get(self, "rules")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rules(self) -> Sequence['outputs.GetCompliancePacksPackConfigRuleResult']:\n return pulumi.get(self, \"config_rules\")", "def rules(self) -> List['outputs.PreventionInspectTemplateInspectConfigRuleSetRule']:\n return pulumi.get(self, \"rules\")", "def rules(cls):\n rules_Citysca...
[ "0.60906136", "0.6038157", "0.59134495", "0.5897179", "0.5889369", "0.5826266", "0.5803657", "0.574287", "0.5704244", "0.5654648", "0.5601011", "0.55975515", "0.5552346", "0.55122215", "0.5479335", "0.54434586", "0.5440965", "0.5440727", "0.54113096", "0.5402494", "0.5401443"...
0.5783454
7
Test the object construction.
def test_construction(self, search, expected, provider_string): cws = Cws(False, provider_string, search, 25) assert cws.searchtext == expected
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructor(self):\n pass", "def test_constructors(self, name, obj):\n assert getattr(forge, name) == obj", "def test_constructors(self, name, obj):\n assert getattr(forge, name) == obj", "def test_constructor(self):\n # Args\n name = 'Mathew'\n age = 13\n ...
[ "0.84078884", "0.7803084", "0.7803084", "0.77192414", "0.7586731", "0.7398419", "0.7353136", "0.71540725", "0.71333116", "0.71261495", "0.71220094", "0.70800287", "0.70170707", "0.70005536", "0.6983822", "0.6973698", "0.6966851", "0.69559306", "0.69241315", "0.69136184", "0.6...
0.0
-1
Get original model if the input model is a model wrapper.
def get_ori_model(model: nn.Module) -> nn.Module: if is_model_wrapper(model): return model.module else: return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_non_wrapped_model(model: nn.Module) -> nn.Module:\n from torch.nn import DataParallel\n from torch.nn.parallel import DistributedDataParallel\n\n if not isinstance(model, nn.Module):\n raise RuntimeError(\"Input model must be a subclass of nn.Module.\")\n\n if isinstance(model, (DataPara...
[ "0.6501197", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.6491106", "0.64641833", "0.64641833", "0.6462358", "0.64084584", "0.63638914", "0.6319201", "0.6311763", "0.6279905", "0.6277195", "0.6266046",...
0.7013369
0
Local file path relative to root
def _filepath(self, filename): return os.path.join(self.root, self.version, filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _localfile(name):\n return os.path.abspath(resource_filename(__name__, name))", "def _LocalDataPath(local_file):\n return data.ResourcePath(local_file)", "def _get_path(): # THIS IS JUST FOR GETTING THE FILE\n return os.path.dirname(os.path.abspath(__file__)) + '/'", "def localdir():\n root = __...
[ "0.76177573", "0.73733217", "0.72739893", "0.7249159", "0.7245917", "0.72200906", "0.7189738", "0.7156527", "0.7129785", "0.7078425", "0.7075425", "0.70750046", "0.70476395", "0.7032672", "0.7020124", "0.69282275", "0.69266427", "0.69164157", "0.6915657", "0.69052947", "0.689...
0.67992586
39
Download dataset from Public HTTP URL.
def _download_http(source_uri, dest_path, version): try: logger.info("Downloading the dataset.") download_file(source_uri=source_uri, dest_path=dest_path) except DownloadError as e: logger.info( f"The request download from {source_uri} -> {dest_path} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_dataset(url=DATASET_URL):\n # disable insecure https warning\n urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n c = urllib3.PoolManager()\n with c.request(\"GET\", url, preload_content=False) as res, open(\n LOCAL_FILE_NAME, \"wb\"\n ) as out_file:\n ...
[ "0.80386454", "0.7523211", "0.7261655", "0.7186977", "0.70576763", "0.7033056", "0.6983279", "0.6979918", "0.6965372", "0.69583726", "0.69454134", "0.6910798", "0.6874054", "0.6850715", "0.68237364", "0.6804672", "0.67878693", "0.6755197", "0.6751866", "0.67461944", "0.674292...
0.6942501
11
Unzip the downloaded file.
def _extract_file(dest_path, root_dir): logger.info("Unzipping the dataset file.") with zipfile.ZipFile(dest_path, "r") as zip_dir: zip_dir.extractall(root_dir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unzip() -> None:\n logger = logging.getLogger(__name__)\n logger.info('Download the dataset')\n\n # define the destination\n destination = project_dir / 'data' / 'raw'\n\n # extract zip\n zip_file = ZipFile(destination / \"original.zip\")\n zip_file.extractall(destination)", "def unzip(z...
[ "0.7120566", "0.68945885", "0.68283784", "0.67834395", "0.6745126", "0.66927487", "0.6636815", "0.6607741", "0.6572298", "0.65560687", "0.65266436", "0.6512526", "0.6462456", "0.64529145", "0.64505756", "0.64146626", "0.641037", "0.640688", "0.63944346", "0.6388501", "0.63870...
0.6222795
32
Download dataset from Public HTTP URL. If the file already exists and the checksum matches, it will skip the download step. If not, it would delete the previous file and download it again. If the file doesn't exist, it would download the file.
def download(data_root, version): if version not in GroceriesReal.GROCERIES_REAL_DATASET_TABLES.keys(): raise ValueError( f"A valid dataset version is required. Available versions are:" f"{GroceriesReal.GROCERIES_REAL_DATASET_TABLES.keys()}" ) dest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _download_http(source_uri, dest_path, version):\n\n try:\n logger.info(\"Downloading the dataset.\")\n download_file(source_uri=source_uri, dest_path=dest_path)\n except DownloadError as e:\n logger.info(\n f\"The request download from {source_uri} ...
[ "0.73288465", "0.7237144", "0.70823073", "0.6893158", "0.686726", "0.6793318", "0.6786019", "0.6761416", "0.66435325", "0.6617243", "0.66126984", "0.6610634", "0.6591112", "0.65789825", "0.6554", "0.6554", "0.6553654", "0.65531015", "0.65490633", "0.65347546", "0.65282995", ...
0.6844599
5
Load annotation from annotations.json file
def _load_annotations(self): annotation_file = self._filepath(self.ANNOTATION_FILE) with open(annotation_file) as f: json_data = json.load(f) return json_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_annotation(json_path):\n # Open the file containing the annotation\n with open(json_path) as annotation_file:\n\n # Parse the AI2D annotation from the JSON file into a dictionary\n annotation = json.load(annotation_file)\n\n # Return the annotation\n retu...
[ "0.7888858", "0.7325585", "0.7084303", "0.6923192", "0.687097", "0.68155825", "0.66877896", "0.6673177", "0.65827876", "0.6560132", "0.6559868", "0.6558796", "0.65527225", "0.64227253", "0.63591856", "0.6338805", "0.6284784", "0.6264161", "0.62268883", "0.62000585", "0.618474...
0.8038193
0
Load the data indices txt file.
def _load_split_indices(self): split_file = self.SPLITS.get(self.split) indices_file = self._filepath(split_file) with open(indices_file) as txt_file: idx_data = [int(i) for i in txt_file.readline().split()] return idx_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_index_data(data_path):\n index_keywords = []\n with open(data_path) as data:\n for line in data:\n index_keywords.append(line.rstrip())\n return index_keywords", "def load_info():\n data = np.loadtxt(\"u_sol_meta.txt\", dtype=int)\n return data", "def load_labels_index...
[ "0.67228645", "0.64503235", "0.6270136", "0.62359387", "0.62125915", "0.6206149", "0.61973083", "0.6185728", "0.61774135", "0.61695915", "0.61617666", "0.61599284", "0.61492556", "0.61449534", "0.61161757", "0.6100025", "0.60692877", "0.602712", "0.6014525", "0.60091174", "0....
0.68765545
0
Convert the bbox record to BBox2D objects.
def _convert_to_bbox2d(single_bbox): label = single_bbox["label_id"] bbox = single_bbox["bbox"] canonical_bbox = BBox2D( x=bbox[0], y=bbox[1], w=bbox[2], h=bbox[3], label=label ) return canonical_bbox
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox2fields():\n bbox2label = {\n 'gt_bboxes': 'gt_labels',\n 'gt_bboxes_ignore': 'gt_labels_ignore'\n }\n bbox2mask = {\n 'gt_bboxes': 'gt_masks',\n 'gt_bboxes_ignore': 'gt_masks_ignore'\n }\n bbox2seg = {\n 'gt_bboxes': 'gt_semantic_seg',\n }\n return b...
[ "0.6832664", "0.6783777", "0.6691991", "0.63218105", "0.6319875", "0.6284736", "0.6246083", "0.6223461", "0.61668444", "0.6120401", "0.6079261", "0.6019865", "0.6007134", "0.59077746", "0.5902924", "0.5898657", "0.58965296", "0.5879593", "0.5847342", "0.58367205", "0.58200914...
0.75232357
0
Download dataset from GCS
def download(self): cloud_path = f"gs://{const.GCS_BUCKET}/{self.GCS_PATH}" # download label file label_zip = download_file_from_gcs( cloud_path, self.root, self.LABEL_ZIP ) with zipfile.ZipFile(label_zip, "r") as zip_dir: zip_dir.extractall(self.root) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_dataset(self):\n raise NotImplementedError", "def download_dataset(url=DATASET_URL):\n # disable insecure https warning\n urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n c = urllib3.PoolManager()\n with c.request(\"GET\", url, preload_content=False) as res,...
[ "0.7185856", "0.68503934", "0.6714282", "0.67088765", "0.66851914", "0.6538648", "0.6525635", "0.6497461", "0.64432293", "0.6433408", "0.6422011", "0.639159", "0.63663715", "0.6344865", "0.6338407", "0.62408376", "0.6234367", "0.62312293", "0.6227992", "0.6183774", "0.6181906...
0.75893414
0
Finds number of documents in the Tweet collection matching a given search_term (and location, if provided).
def count_tweets(search_term, location=None): if location: return len(Tweet.objects(Q(keyword_search_term=search_term) & Q(location_address=location))) else: return len(Tweet.objects(keyword_search_term=search_term))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _count(self):\n if self._count_valid:\n return self._total_results\n\n url = self._build_url(\"/_search\")\n request = self._build_request(0, -1)\n resp = self._cb.post_object(url, body=request)\n result = resp.json()\n\n self._total_results = result[\"num_f...
[ "0.67774284", "0.67774284", "0.64773935", "0.6338761", "0.63320786", "0.6253776", "0.61553955", "0.6143456", "0.6119857", "0.605183", "0.60442805", "0.6041794", "0.6023299", "0.60119075", "0.59792614", "0.59583217", "0.5956584", "0.59333336", "0.59300566", "0.5897961", "0.585...
0.81229687
0
Calculates a keyword's historical sentiment (restricted within a location, if provided).
def get_historical_sentiment(search_term, location=None): if location: positive = len(Tweet.objects(Q(keyword_search_term=search_term) & Q(location_address=location) & Q(sentiment_type="positive"))) negative = len(Tweet.objects(Q(keyword_search_term=search_term) & Q(location_address=location) &...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_historical_sentiment_avg(search_term, location=None):\r\n\r\n total = 0\r\n\r\n if location:\r\n tweets = Tweet.objects(Q(keyword_search_term=search_term) & Q(location_address=location))\r\n count = len(tweets)\r\n else:\r\n tweets = Tweet.objects(Q(keyword_search_term=search_...
[ "0.67188215", "0.67036396", "0.6334149", "0.6167096", "0.59021384", "0.5850361", "0.5808837", "0.57456166", "0.55691725", "0.55315197", "0.55021304", "0.5500344", "0.5474109", "0.54653317", "0.5465105", "0.5422208", "0.5408632", "0.5408632", "0.54046506", "0.5381399", "0.5356...
0.704126
0
Calculates the average sentiment score for a given keyword (restricted within a location, if provided).
def get_historical_sentiment_avg(search_term, location=None): total = 0 if location: tweets = Tweet.objects(Q(keyword_search_term=search_term) & Q(location_address=location)) count = len(tweets) else: tweets = Tweet.objects(Q(keyword_search_term=search_term)) count...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sentiment_overtime(keyword, location=None):\r\n\r\n # Get date 10 days ago\r\n ten_days_ago = datetime.now() - timedelta(days=10)\r\n\r\n # Get raw PyMongo collection\r\n collection = Tweet._get_collection()\r\n\r\n if location:\r\n match = {\r\n \"$match\":\r\n ...
[ "0.70859677", "0.63445497", "0.615348", "0.6074", "0.607026", "0.6054127", "0.60071707", "0.59709895", "0.58449465", "0.58252454", "0.5823854", "0.58144957", "0.57648957", "0.57458204", "0.5664769", "0.5651309", "0.56352067", "0.56242144", "0.56193566", "0.5584524", "0.558051...
0.74165547
0
Calculates the average sentiment score in a given query set of Tweets.
def get_query_sentiment_avg(tweets): total = 0 count = len(tweets) for tweet in tweets: total += tweet.sentiment_score # Calculate average avg = total / count avg = float("{0:.2f}".format((float(avg)))) return avg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_query_statistics(tweets, sentiment_aggregate_list):\r\n\r\n total = len(tweets)\r\n positive_percentage = float(\"{0:.2f}\".format((float(sentiment_aggregate_list[0][1]/total*100))))\r\n neutral_percentage = float(\"{0:.2f}\".format((float(sentiment_aggregate_list[1][1]/total*100))))\r\n negati...
[ "0.67024827", "0.66712636", "0.66350305", "0.66138715", "0.65283984", "0.6518941", "0.6491312", "0.6487166", "0.64857775", "0.6405299", "0.62509996", "0.6194273", "0.6162189", "0.6128368", "0.61244524", "0.6088544", "0.6022574", "0.6017512", "0.60000277", "0.59923315", "0.597...
0.854272
0
Generates basic statistics for a given query set of Tweets.
def get_query_statistics(tweets, sentiment_aggregate_list): total = len(tweets) positive_percentage = float("{0:.2f}".format((float(sentiment_aggregate_list[0][1]/total*100)))) neutral_percentage = float("{0:.2f}".format((float(sentiment_aggregate_list[1][1]/total*100)))) negative_percentage = flo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def statistics(all_new_tweets, all_retweets, all_quote_tweets):\n length_all_quote_tweets = len(all_quote_tweets)\n length_all_retweets = len(all_retweets)\n length_all_tweets = len(all_new_tweets)\n\n # print(db_twitter.collections.stats())\n total_tweets = length_all_quote_tweets + length_all_retw...
[ "0.69248664", "0.620815", "0.59848654", "0.59815437", "0.5954515", "0.5952684", "0.5883914", "0.5861081", "0.57721597", "0.57669294", "0.5752889", "0.5752543", "0.564709", "0.564132", "0.5640209", "0.5572535", "0.55670476", "0.55010945", "0.5492158", "0.5483679", "0.54743016"...
0.7054746
0
Aggregates sentiment types for a given tweet collection.
def aggregate_sentiment(tweets): positive = 0 negative = 0 neutral = 0 for tweet in tweets: if tweet.sentiment_type == "positive": positive += 1 elif tweet.sentiment_type == "negative": negative += 1 else: neutral += 1 resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect(self, collect_types: List[str]) -> None:\n valid_types = [x for x in collect_types if x in self._valid_types.keys()]\n for ctype in valid_types:\n self._collect_tweets(ctype)", "def do_sentiment_analysis(self):\n\n tweets_sentiment = []\n\n for tweet in self.twe...
[ "0.59929293", "0.59618926", "0.58570933", "0.5779308", "0.57485133", "0.573751", "0.56903654", "0.56657684", "0.55670786", "0.5521338", "0.54893357", "0.542505", "0.53890103", "0.53886825", "0.53880984", "0.533604", "0.52402407", "0.52377105", "0.5190812", "0.51520646", "0.51...
0.72262305
0
Gets the predominant sentiment type from a list of sentiments. (Eg [[positive, 3],[neutral, 10],[negative,15]])
def predominant_sentiment(sentiment_aggregate_list): positive = int(sentiment_aggregate_list[0][1]) neutral = int(sentiment_aggregate_list[1][1]) negative = int(sentiment_aggregate_list[2][1]) if positive > neutral and positive > negative: return "positive" elif neutral > positive ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classify_sentiment(sent_index):\n\n\tif sent_index < -0.5:\n\t\treturn 'negative'\n\tif sent_index <= 0.5 and sent_index >= -0.5:\n\t\treturn 'neutral'\n\tif sent_index >= 0.5:\n\t\treturn 'positive'", "def classify(tweets, positives, negatives):\n sentiment_list = makelist(tweets, positives, negatives)\n...
[ "0.6732237", "0.63710135", "0.6355821", "0.6258131", "0.61799365", "0.611913", "0.6108495", "0.60978174", "0.6085284", "0.5958469", "0.59254676", "0.5863128", "0.5860238", "0.5843611", "0.5822473", "0.58167547", "0.5785102", "0.5766148", "0.5755716", "0.5731452", "0.5707599",...
0.7360832
0
Gets sentiment statistics for average sentiment for a given keyword (and location, if specified) over the past 10 days.
def get_sentiment_overtime(keyword, location=None): # Get date 10 days ago ten_days_ago = datetime.now() - timedelta(days=10) # Get raw PyMongo collection collection = Tweet._get_collection() if location: match = { "$match": { "k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_historical_sentiment_avg(search_term, location=None):\r\n\r\n total = 0\r\n\r\n if location:\r\n tweets = Tweet.objects(Q(keyword_search_term=search_term) & Q(location_address=location))\r\n count = len(tweets)\r\n else:\r\n tweets = Tweet.objects(Q(keyword_search_term=search_...
[ "0.7494988", "0.6593404", "0.64326733", "0.62750417", "0.5912352", "0.54747236", "0.5449991", "0.5329276", "0.5303148", "0.52833545", "0.52704436", "0.50593525", "0.5013312", "0.49506775", "0.49489254", "0.4912962", "0.4879828", "0.48639044", "0.4842615", "0.48359329", "0.481...
0.8139415
0
Gets the top 10 most positive / negative sentiment triggers from the past 7 days.
def get_sentiment_trends(order): # Get date seven days ago seven_days_ago = datetime.now() - timedelta(days=7) # Get raw PyMongo collection collection = Tweet._get_collection() # Perform aggregate query result = collection.aggregate([ { "$match": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_extreme_tweets(self, sentiment, count=1, num_score=False):\n def return_polarity(tweet):\n return tweet['polarity']\n\n print(\"The top {} most {} tweets:\".format(count, sentiment))\n\n if sentiment == 'positive':\n sorted_tweet = sorted(self.positive_tweets, k...
[ "0.5406669", "0.54055756", "0.5391852", "0.536155", "0.5360676", "0.5214797", "0.5178173", "0.51120335", "0.50702655", "0.5060932", "0.5052575", "0.501701", "0.5007129", "0.50032103", "0.49881318", "0.49561754", "0.49547327", "0.49525204", "0.4947948", "0.49175078", "0.490440...
0.54947144
0
Load the feed url into self.entries using the feedparser module.
def __init__(self, url=URL): self.entries = feedparser.parse(url).entries
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_feed(self):\n parsed_feed = feedparser.parse(self.rss_url)\n # Check for malformed feed\n if parsed_feed['bozo']:\n raise Exception('malformed rss feed!')\n self.parsed_feed = parsed_feed", "def feed(self):\n feed_dict = feedparser.parse(self.URL)\n ...
[ "0.7183806", "0.68700135", "0.66769147", "0.6660742", "0.6519246", "0.6506825", "0.6443622", "0.6431346", "0.64295334", "0.6419183", "0.6348568", "0.6227926", "0.61853313", "0.6180963", "0.610789", "0.6107114", "0.607002", "0.6055648", "0.60153824", "0.5997344", "0.5982748", ...
0.8170361
0
Return a list of episode IDs (itunes_episode attribute) of the episodes the pass in domain was mentioned in.
def get_episode_numbers_for_mentioned_domain(self, domain: str) -> list: return [ep.itunes_episode for ep in self.entries if domain.lower() in ep.summary.lower()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def episodes(self):\n episodes = []\n for series in self.series:\n episodes.extend(series.episodes)\n return episodes", "def episodes(self):\n episodes = []\n for season in self.seasons:\n episodes.extend(season.episodes)\n return episodes", "def ...
[ "0.68623555", "0.6790614", "0.64584225", "0.62703633", "0.6171073", "0.616064", "0.5982251", "0.58765996", "0.5858648", "0.5848835", "0.57939684", "0.5776999", "0.57678777", "0.57606727", "0.57389754", "0.56692666", "0.5666441", "0.56479317", "0.5601704", "0.55696493", "0.552...
0.8150568
0
Get the most mentioned domain domains. We match a domain using
def get_most_mentioned_domain_names(self, n: int = 15) -> list: rex = re.compile(r'https?://[^/]+') c = Counter() for entry in self.entries: domains = set(re.findall(rex, entry.summary)) for domain in domains: if domain not in IGNORE_DOMAINS: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_most_common_domains(emails, common_domains=None):\n if common_domains is None:\n common_domains = get_common_domains()\n\n most_common_prep = []\n for email in emails:\n domain = email.split(\"@\")[1]\n if domain in common_domains:\n continue\n else:\n ...
[ "0.6735951", "0.6687723", "0.65930104", "0.58609587", "0.5764132", "0.5747643", "0.5680006", "0.55159426", "0.5416647", "0.53974265", "0.5369249", "0.5319094", "0.53149176", "0.5308091", "0.5302462", "0.52969885", "0.5256669", "0.5224873", "0.52034307", "0.519969", "0.5192919...
0.6606182
2
Return the number of episodes that had one of more special guests featured (use SPECIAL_GUEST).
def number_episodes_with_special_guest(self) -> int: return len([ep for ep in self.entries if SPECIAL_GUEST in ep.summary])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_episodes(self) -> int:\n return len(self.episodes)", "def n_episodes(self):\n raise NotImplementedError", "def get_tv_episodes(self) -> int:\n return len(glob.glob(os.path.join(\n os.path.dirname(self.file),\n f\"*{os.path.splitext(self.file)[-1]}\"\n ...
[ "0.649917", "0.62428266", "0.5887413", "0.5634373", "0.552352", "0.54988056", "0.54770404", "0.53177136", "0.5314232", "0.52770793", "0.52533907", "0.5198246", "0.5186868", "0.5182951", "0.51779616", "0.5158745", "0.5125548", "0.51043326", "0.5093988", "0.50591505", "0.505139...
0.8896974
0
Return the average duration in seconds of a Python Bytes episode, as
def get_average_duration_episode_in_seconds(self) -> NamedTuple: times = [ep.itunes_duration for ep in self.entries] format_times = [] for time in times: if not time.startswith('00'): time = '0' + time format_times.append(time) dts = [datetime.st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wav_duration(wav_bytes: bytes) -> float:\n with io.BytesIO(wav_bytes) as wav_buffer:\n wav_file: wave.Wave_read = wave.open(wav_buffer, \"rb\")\n with wav_file:\n frames = wav_file.getnframes()\n rate = wav_file.getframerate()\n return frames / float(rate)"...
[ "0.67595243", "0.65047795", "0.64271915", "0.64189667", "0.6367844", "0.6341444", "0.6284898", "0.6283205", "0.6277745", "0.62206906", "0.62178415", "0.6192925", "0.6191467", "0.6185916", "0.61730164", "0.6169899", "0.61567783", "0.6137445", "0.6130938", "0.6128692", "0.61263...
0.71605974
0
Build an index from word to set of document indexes This does the exact same thing as create_index() except that it uses your htable. As a number of htable buckets, use 4011. Returns a listofbuckets hashtable representation.
def myhtable_create_index(files): res_buckets = htable(4011) for id, file in enumerate(files): if file[-4:] == '.txt': word_list = words(get_text(file)) for word in word_list: value = htable_get(res_buckets, word) if value == None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createIndex(pages): \n index = defaultdict(list)\n for url, content, links in pages:\n counts = getNumberTerms(content)\n for term, count in counts.items():\n index[term].append((url, count))\n return index", "def perform_indexing(self, words_list):\n\n indexer_tab...
[ "0.66589546", "0.6544771", "0.64670044", "0.64168614", "0.63033056", "0.6180472", "0.6178157", "0.6154601", "0.61489826", "0.6104722", "0.60848147", "0.6009543", "0.60010827", "0.5981455", "0.5976573", "0.5911548", "0.59066755", "0.590064", "0.5855223", "0.58235234", "0.58033...
0.7427538
0
This does the exact same thing as index_search() except that it uses your htable. I.e., use htable_get(index, w) not index[w].
def myhtable_index_search(files, index, terms): res_file = [] count = 0 if len(terms) == 0: print('empty terms') return for term in terms: term = term.lower() count += 1 if count == 1: s = htable_get(index, term) if s == None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup(index,keyword):\n\tif keyword in index:\n\t\treturn index[keyword]\n\treturn None", "def __getitem__(self,idx):\n try:\n return self._cache[idx]\n except:\n pass\n\n try:\n # return full data entry as list\n out = self._data[idx]\n ...
[ "0.6155713", "0.59609514", "0.59491926", "0.59410375", "0.5900303", "0.5845122", "0.5789598", "0.577333", "0.57275766", "0.5688099", "0.5681756", "0.56468856", "0.5621905", "0.5621905", "0.5621905", "0.5621905", "0.5621905", "0.5621905", "0.5621905", "0.5621905", "0.5621905",...
0.6331249
0
Produces contexts Runs CNN(s) followed by RNN(s)
def encode(self, input_): return self.encoder(input_)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context(model: Sequential) -> Sequential:\n model.add(ZeroPadding2D(padding=(33, 33)))\n model.add(Conv2D(42, (3, 3), activation='relu', name='ct_conv1_1'))\n model.add(Conv2D(42, (3, 3), activation='relu', name='ct_conv1_2'))\n model.add(AtrousConvolution2D(84, 3, 3, atrous_rate=(2, 2), activation='relu',...
[ "0.6682688", "0.6489866", "0.633372", "0.6083568", "0.60525763", "0.6049823", "0.60404956", "0.5969165", "0.59309137", "0.5893104", "0.5889334", "0.58862287", "0.5844192", "0.5840538", "0.5822752", "0.58128786", "0.5812776", "0.58107114", "0.58042026", "0.57976633", "0.576613...
0.0
-1
Tests if builsing an dirichlet ensemble is running without problems
def test_dirichletensemble(): np.random.seed(seed=2) X, y = make_blobs(n_samples=200, centers=2, n_features=2, cluster_std=4, random_state=2) n_train = 100 trainX, testX = X[:n_train, :], X[n_train:, :] trainy, testy = y[:n_train], y[n_train:] n_members = 5 stack = Dir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_machine_learning():", "def test_valid_ensemble(ensemble: bool) -> None:\n mapie = MapieRegressor(ensemble=ensemble)\n mapie.fit(X_toy, y_toy)", "def test_training(self):\n\t\tpass", "def run_experiment() -> List[bool]:\n return [random.random() < 0.5 for _ in range(1000)]", "def main():\n...
[ "0.65376455", "0.65050536", "0.6211623", "0.6093889", "0.60780334", "0.6073346", "0.6068026", "0.60495067", "0.60197634", "0.60121745", "0.59868246", "0.5984857", "0.5951661", "0.594414", "0.5943446", "0.5942952", "0.5937696", "0.59257823", "0.5918587", "0.59163463", "0.59018...
0.670472
0
Map s_new to t_new based on known mapping of s (source) to t (target), with s original/intrinsic coordinates and t intrinsic/original coordinates
def mapping(s, t, s_new, k,c): n, s_dim = s.shape t_dim = t.shape[1] n_new = s_new.shape[0] # 1. determine nearest neighbors dist = np.sum((s[np.newaxis] - s_new[:,np.newaxis])**2,-1) nn_ids = np.argsort(dist)[:,:k] # change to [:,:k] nns = np.row_stack([s[nn_ids[:,ki]] for ki in range(k)]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_model(self, original, t1, t2, resolution_scaling_factor=1):\n img = Image()\n img.time_stamp = t2\n\n if t1 == t2:\n img.initialize_with_image(original)\n return img\n\n calc_shift_fnc = self.calculate_shift\n orig_get_fnc = original.get\n i...
[ "0.55668783", "0.5532111", "0.5460896", "0.5447538", "0.53842735", "0.5356351", "0.53368974", "0.53297365", "0.53066075", "0.5294714", "0.52837485", "0.5263581", "0.52585614", "0.52573544", "0.52403593", "0.5213048", "0.51814204", "0.5172513", "0.51586723", "0.51488996", "0.5...
0.66779846
0
Activity of neurons for sequence of locations
def compute_activity(location, avg_activity, spatial_bins, noise_sigma=0): interpolator = interp1d(spatial_bins, avg_activity,axis=0,bounds_error=False, fill_value='extrapolate') mean_activity = interpolator(location) if noise_sigma > 0: activity = np.random.normal(loc=mean_activity, scale=noise_sig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _neuron_location(self, m, n):\n for i in range(m):\n for j in range(n):\n yield np.array([i, j])", "def apply_neurons(self):\n for neuron in range(self.n_outputs):\n self.uf_activate(neuron)", "def run(self):\n count = self.neuron_count\n for...
[ "0.59099996", "0.5725361", "0.5699758", "0.5679557", "0.55904645", "0.55668813", "0.55668813", "0.5518901", "0.54514945", "0.54417515", "0.5437984", "0.54246867", "0.5385736", "0.5354543", "0.52761805", "0.5255122", "0.5224641", "0.52234226", "0.5208442", "0.5205464", "0.5204...
0.0
-1
To be written soon...
def get_shape_from_box(box): from molsysmt.pbc.get_lengths_and_angles_from_box import get_lengths_and_angles_from_box from molsysmt.pbc.get_shape_from_lengths_and_angles import get_shape_from_lengths_and_angles if box is None: return None else: lengths, angles = get_lengths_and_angles...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self) -> None:", "def regular(self):", "def exo2():", "def support(self):", "def use(self):", "def degibber(self):", "def __call__():", "def __call__():", "def __call__():", "def __call__():", "def __call__():", "def __call__(self):\n\t\treturn", "def cx():", "def _regr_basic...
[ "0.6484565", "0.64034045", "0.6370542", "0.6307648", "0.62786925", "0.6233077", "0.6224396", "0.6224396", "0.6224396", "0.6224396", "0.6224396", "0.609799", "0.60457885", "0.6035354", "0.595735", "0.5951163", "0.5938122", "0.5930624", "0.5927453", "0.591242", "0.5904648", "...
0.0
-1
Construct a new BlockScanner object.
def __init__(self, current_char, source): self.current_char = current_char self.source = source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, tokenGenerator):\r\n\r\n\t\tself._iterator = iter(tokenGenerator)\r\n\t\tself._stack = []\r\n\t\tself._tokenMarker = None\r\n\r\n\t\tstartToken = next(self._iterator)\r\n\t\tstartBlock = StartOfDocumentBlock(startToken)\r\n\r\n\t\tif (not isinstance(startToken, StartOfDocu...
[ "0.597456", "0.5563696", "0.53400904", "0.5296141", "0.52921337", "0.5256663", "0.52089673", "0.5207816", "0.5177261", "0.51647526", "0.51439065", "0.51185596", "0.5116297", "0.50943065", "0.507248", "0.50681114", "0.5063206", "0.5055973", "0.5041467", "0.5037778", "0.5036207...
0.0
-1
Read source and creates a new brace token
def create_token(self): token = Token(PAREN.get(self.current_char), "brace") self.current_char = self.source.read(1) return token
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_till_closing_brace(stream):\n rv = \"\"\n in_braces = 1\n while True:\n if EscapeCharToken.starts_here(stream, '{}'):\n rv += stream.next() + stream.next()\n else:\n c = stream.next()\n if c == '{': in_braces += 1\n elif c == '}': in_bra...
[ "0.59238863", "0.58185357", "0.5810777", "0.5810427", "0.5761932", "0.5747912", "0.542546", "0.5393044", "0.5324538", "0.530029", "0.5290811", "0.5258126", "0.5244535", "0.52285373", "0.5211549", "0.517982", "0.51321423", "0.51276994", "0.51232326", "0.51212436", "0.5091131",...
0.71761155
0
Receives a char and returning if its a left or right brace
def should_lex(cls, char): return char == '{' or char == '}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bracketed (phrase,bracketing='()'):\r\n\r\n level = 0\r\n left_point = None\r\n right_point = None\r\n \r\n\r\n for count,char in enumerate(phrase):\r\n\r\n if char == bracketing[0]:\r\n if level ==...
[ "0.6396085", "0.6267263", "0.6178741", "0.61347187", "0.6007452", "0.6006558", "0.59606045", "0.5951733", "0.59003645", "0.58945894", "0.58871955", "0.58813554", "0.58139944", "0.58129483", "0.58129483", "0.5799351", "0.57966834", "0.5772036", "0.57385767", "0.57300985", "0.5...
0.72300553
0
Play the next song in the queue.
def _next(verbose=0, quiet=False): Spotify.request('me/player/next', method='POST') if not quiet: from cli.commands.status import status status.callback(verbose=verbose) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_media_next_track(self) -> None:\n cur_track_index = self._get_current_track_index()\n\n await self._table.active_playlist.play(\n self._table.active_playlist.tracks[cur_track_index + 1]\n )", "async def next(self):\n await self._pytheos.api.player.play_next(...
[ "0.7804286", "0.756156", "0.7519215", "0.7317698", "0.7314149", "0.72888863", "0.713351", "0.70998675", "0.7088512", "0.690234", "0.68884444", "0.6880905", "0.68629616", "0.6795466", "0.67567676", "0.6732975", "0.6704325", "0.6688262", "0.6659063", "0.66365665", "0.6595123", ...
0.57869184
94
Crop graph image Crops the desired image by it's type.
def crop_image(self): image_data = Image.open(self.img_path) return image_data.crop(self.data_type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crop_image(self, img):\n img.crop_image(self._center, 1.1 * self._radius)", "def crop(image, dimX, dimY):\n # TODO\n return image", "def crop(self, *args, **kwargs):\n return _image.image_crop(self, *args, **kwargs)", "def __call__(self, img):\n image_width, image_height = img....
[ "0.66398174", "0.6505323", "0.6446542", "0.63750404", "0.63750404", "0.63555723", "0.6341775", "0.633309", "0.62684494", "0.626365", "0.623445", "0.6195632", "0.61726093", "0.61628", "0.6140623", "0.6068601", "0.60564905", "0.6035729", "0.60079396", "0.6002261", "0.5993988", ...
0.6803471
0
Transform Image into array Transform cropped image into an numpy multidimensional array.
def np_image_matrix(self): return np.array(self.crop_image())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_to_array(self, img):\n x = np.asarray(img, dtype=self.dtype)\n if len(x.shape) == 3:\n if self.channels_first:\n x = x.transpose(2, 0, 1)\n elif len(x.shape) == 2:\n if self.channels_first:\n x = x.reshape((1, x.shape[0], x.shape[1]...
[ "0.722699", "0.6876687", "0.68659633", "0.68560636", "0.6853701", "0.65742826", "0.64895433", "0.64520043", "0.64459306", "0.63613623", "0.6347112", "0.6313576", "0.6297982", "0.6266448", "0.6222398", "0.6181755", "0.6175415", "0.6161334", "0.6153839", "0.6122482", "0.6093073...
0.6892566
1
Find Blue pixels Finds all blue pixels inside the graph area, which represents the desired points of the graph. The method generates a numpy 2d array with these pixels relative positions.
def blue_matrix(self): return np.vstack(np.where(self.np_image_matrix() == 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_blue(x, y, slot = 0):\r\n return __g[slot].pixels_rgb[__g[slot].width * 3 * y + x * 3 + 2]", "def get_blue(self, x, y):\n self.__check_dimensions(x, y)\n return self.pixels[(x, y)].get_blue()", "def blue_channel(img):\n\n blue = np.zeros(img.shape,dtype=float)\n\n blue[:,:,0] = n...
[ "0.6495526", "0.64614147", "0.62514365", "0.60262513", "0.5827481", "0.57433754", "0.5736232", "0.5696482", "0.56894076", "0.5617795", "0.5553846", "0.55003446", "0.54996854", "0.54855716", "0.5472395", "0.54648805", "0.5462373", "0.5456809", "0.5430799", "0.5417668", "0.5415...
0.6844396
0
find the gray pixels and it's indexex
def get_days_index(self): return np.where(self.np_image_matrix()[3] == 3)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def idx2pixel(idx, image_size):\n\tassert idx < image_size**2, \"index {} too large for image size {}\".format(idx, image_size)\n\ttmp = np.zeros(image_size**2)\n\ttmp[idx] = 1\n\ttmp = tmp.reshape(image_size, image_size)\n\ti, j = np.where(tmp==1)\n\treturn i[0], j[0]", "def extract_pixels(img_):\n non_zero_...
[ "0.64722455", "0.6425248", "0.63054746", "0.6227117", "0.60191417", "0.5980462", "0.5958961", "0.59191453", "0.5893133", "0.5882262", "0.5881619", "0.5873324", "0.58663285", "0.578935", "0.57684404", "0.57487696", "0.57443494", "0.57427096", "0.5668703", "0.5660894", "0.56523...
0.0
-1
clean repeated j pixels Find the first item of each row and gets the pixels with the lowest j value, which represents the biggest real value of the y axis of the graph, crossed with x axis.
def clean_double_values(self): trans_blue = self.blue_matrix().transpose() b_array = [] for i in trans_blue: min_col = [i[0], i[1]] for j in trans_blue[0:]: if j[1] == min_col[1]: if j[0] < min_col[0]: min_col[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_smaller_neighbour(plots, i, j):\n n = len(plots)\n neighbours = []\n if i > 0:\n neighbours.append((i-1, j))\n if i < n-1:\n neighbours.append((i+1, j))\n if j > 0:\n neighbours.append((i, j-1))\n if j < n-1:\n neighbours.append((i, j+1))\n\n min_elevation =...
[ "0.56734896", "0.56369495", "0.56135774", "0.5611539", "0.5562747", "0.5554404", "0.55534256", "0.55487216", "0.55104053", "0.5484114", "0.5463305", "0.5457158", "0.54555976", "0.5414113", "0.5403876", "0.5402138", "0.5381725", "0.53808093", "0.53107697", "0.53102785", "0.530...
0.57108814
0
Calculates singel pixel value Calculates the numeric value of each pixel, with two digits precision\
def calculate_data_value(self, single_val): y_pixel_range = float(self.data_type[3] - self.data_type[1] - 2) data = round((max(self.data_range) - (single_val * (max(self.data_range) - min(self.data_range))/y_pixel_range ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intensity(self) -> int:", "def intensity(self, value: int, /) -> None:", "def pixelvalue(self, *args, **kwargs):\n return _image.image_pixelvalue(self, *args, **kwargs)", "def pixelConverter(pixels):\n intensity = int((sum(pixels[:3]) / 3) * (pixels[-1] / 100))\n return intensity", "def pi...
[ "0.6738845", "0.612546", "0.6096547", "0.60833734", "0.6080692", "0.59247875", "0.5914754", "0.59092516", "0.58747435", "0.5851009", "0.5825441", "0.5822911", "0.57960194", "0.5733289", "0.5684153", "0.56747544", "0.5673314", "0.56508255", "0.56457996", "0.55885434", "0.55827...
0.0
-1
Convert pixels j values Converts all j pixel day values to numeric real values, based on the the type of data and the range submitted.
def converted_values(self): for i in range(11): lista = [] for j in self.clean_double_values(): if self.get_days_index()[i+1] > j[1] >= \ self.get_days_index()[i]: lista.append(self.calculate_data_value(j[0].item())) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pixelConverter(pixels):\n intensity = int((sum(pixels[:3]) / 3) * (pixels[-1] / 100))\n return intensity", "def intensity_conversion(mol_data):\n\n if not isinstance(mol_data, Phys):\n raise ValueError('mol_data must be a `sbpy.data.Phys` instance.')\n\n temp = mol_data['Temperature'][0]\n...
[ "0.5547551", "0.54512304", "0.5430343", "0.5352986", "0.53416616", "0.53416616", "0.5297769", "0.51349705", "0.51135844", "0.5109829", "0.51088685", "0.5072228", "0.5058128", "0.5048625", "0.5024074", "0.5022969", "0.49947834", "0.49770075", "0.4975461", "0.49725404", "0.4971...
0.5446279
2
Saves csv file into image folder saves generated data by class into a csv file with the name, plus the type of data. This method keeps track if the file was generate, and replace it with a new one
def save_values(self): f_name = self.img_path.split('.')[0] + '_{}_'.\ format(self.data_type_name) + '.csv' dir_name = os.path.join(self.base_dir, f_name) if not os.path.exists(dir_name): for data_list in self.converted_values(): with open(f_name, 'a') as ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_csv(self):\n if not self.__is_csv():\n # creates the csv file if it did not exist.\n self.__create_csv()\n try:\n with open(self.__csv_file_name, 'a', newline='', encoding='utf-8') as csv_file:\n writer = csv.DictWriter(csv_file, fieldnames=sel...
[ "0.6624201", "0.6549683", "0.6435749", "0.64239025", "0.6376977", "0.62230694", "0.61884254", "0.6154384", "0.6124744", "0.6118921", "0.6071223", "0.60594875", "0.59954077", "0.5983704", "0.5972146", "0.5940008", "0.59392995", "0.59351414", "0.5909594", "0.5909318", "0.590845...
0.7220325
0
Function that takes experimental data and gives us the dependent/independent variables for analysis.
def transform_data(data_orig): if isinstance(data_orig, str): data_orig = pd.read_csv(data_orig) data = data_orig num_rows,num_variables = data.shape all_columns = data.columns.tolist() clean_data(data,all_columns,ignore_na=False,fill_mode="prob") expand_features(data) variables = ['Pclass','Sex',"Fare","Age...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def independent_variables(self):\n return self._independent_variables", "def variables(self):\n return self.dataset.data_vars", "def get_variables(self) -> np.array:\n pass", "def get_variables(self):\n\n self._enforce_coupling()\n\n dv = []\n for scenario in self.sc...
[ "0.6336049", "0.59512174", "0.5921359", "0.5668966", "0.5604752", "0.5602149", "0.55979866", "0.55381906", "0.5522577", "0.5509207", "0.5503682", "0.54940444", "0.54842937", "0.54736096", "0.54574496", "0.5447266", "0.54466516", "0.5444418", "0.5435213", "0.5378646", "0.53435...
0.0
-1
build new features from existing ones
def expand_features(data): ## combine num of siblings and parents to feature of family size data["Fam_size"] = data["SibSp"] + data["Parch"] ## add friend category defined as either sharing a ticket with someone not family ## or share a room with someone not registered as family friends = np.zeros((data['Passenge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_features(self):\n train = self.train\n \n train['is_context'] = train['context_type'].isin(CONTEXT_TYPE_TEST)\n train['is_context_flow'] = train['listen_type'] * train['is_context']\n \n train['is_listened_context'] = train['is_listened'] * train['is_context...
[ "0.7290179", "0.67351234", "0.66625017", "0.66145927", "0.65810287", "0.65604347", "0.64703894", "0.6346428", "0.632699", "0.6295979", "0.629188", "0.62671566", "0.6261998", "0.6211165", "0.62055224", "0.61913365", "0.6185411", "0.6180887", "0.61358607", "0.61222315", "0.6106...
0.0
-1
clean data from nans and format 'Ticket'/'Cabin' values to integer
def clean_data(data,variables,ignore_na=True,fill_mode="mode"): num_rows,num_cols = data.shape if ignore_na: data = data.dropna(axis=0,how="any",subset=variables) num_rows,num_cols = data.shape else: for variable in variables: if data[variable].isna().sum()>0: if fill_mode=="mode": data[variable] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correct_nans(y):\n y = str(y)\n if y == \"nan\":\n return \"\"\n else:\n y = float(y)\n return int(y)", "def clean_abbreviations(x):\n # a few entries in Revenue were nan\n if pd.isnull(x):\n return np.nan\n elif 'K' in x:\n return int(float(x[:-1]) * 1e3)...
[ "0.5968471", "0.5897729", "0.55173296", "0.53447956", "0.5314134", "0.5283075", "0.5131418", "0.51056665", "0.50972974", "0.50837404", "0.5063842", "0.5061318", "0.50185454", "0.501761", "0.50118005", "0.49980184", "0.49884346", "0.49771225", "0.49757206", "0.4972356", "0.497...
0.0
-1
Initialize a model object.
def __init__(self, classific_method="LogisticRegression"): self.classific_method = classific_method
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_model(self):\n pass", "def init_model(self):\n pass", "def initialize_model(self):\n model = self.model_class()\n return model", "def initialize(self, model):\n pass", "def __init__(self, model):\n self._model = model", "def __init__(self, model: o...
[ "0.8386426", "0.82832724", "0.81248385", "0.8097535", "0.80893433", "0.78528905", "0.77985805", "0.7795144", "0.7786414", "0.7762771", "0.7762771", "0.7762771", "0.7762771", "0.7587415", "0.7512679", "0.7500231", "0.7500231", "0.7455408", "0.736257", "0.736257", "0.730667", ...
0.0
-1
Fit a Model to data.
def classify(self, x, y): if self.classific_method=="LogisticRegression": clf = LogisticRegression().fit(x,y) score = clf.score(x,y) params = {"coef" : clf.coef_, "intercept" : clf.intercept_} elif self.classific_method=="RidgeClassifier": clf = RidgeClassifier().fit(x,y) score = clf.score(x,y) p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit_from_model_data(self, model_data: np.ndarray) -> f.FitDataset:\r\n return f.FitDataset(dataset=self.dataset, model_data=model_data)", "def fit_training_data(self):\n self.model.fit(self.X_train)", "def fit_model(self):\n logger.info('Fitting model')\n if self.traj_dict is No...
[ "0.8031498", "0.7638004", "0.7561233", "0.7355034", "0.71993583", "0.71700954", "0.71613765", "0.7147078", "0.710955", "0.7095396", "0.7068235", "0.7055775", "0.704873", "0.7047253", "0.7034218", "0.70294046", "0.70294046", "0.70294046", "0.70294046", "0.70294046", "0.7029404...
0.0
-1
Loads average activity across trials (nonbeta series)
def loadRuleEncoding(subj,rule='Logic'): x = tgp.loadTaskTiming(subj,'ALL') stimIndex = np.asarray(x['stimIndex']) ind = np.where(stimIndex==rule)[0] datadir = projectdir + 'data/postProcessing/hcpPostProcCiric/' h5f = h5py.File(datadir + subj + '_glmOutput_data.h5','r') data = h5f['ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_experiment_load():\n loads = tempfeeder_exp()\n return total_load_in_experiment_periods(loads, loads.user_ids)", "def calc_average_load (self):\n #~ self.generation = self.forecast.generation_by_type['generation diesel']\\\n #~ [se...
[ "0.63504434", "0.59144664", "0.5864663", "0.58144855", "0.5810399", "0.5723678", "0.5679944", "0.56216276", "0.5613916", "0.5502032", "0.5484399", "0.54355526", "0.5433525", "0.54297596", "0.54288644", "0.5420481", "0.5404081", "0.53961533", "0.53927654", "0.53615886", "0.535...
0.0
-1
Loads average activity across trials (nonbeta series)
def loadMotorResponses(subj,hand='Right'): hands = {'Left':[0,1],'Right':[2,3]} x = tgp.loadTaskTiming(subj,'ALL') stimIndex = np.asarray(x['stimIndex']) ind = np.where(stimIndex=='motorResponse')[0] datadir = projectdir + 'data/postProcessing/hcpPostProcCiric/' h5f = h5py.File(datadi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_experiment_load():\n loads = tempfeeder_exp()\n return total_load_in_experiment_periods(loads, loads.user_ids)", "def calc_average_load (self):\n #~ self.generation = self.forecast.generation_by_type['generation diesel']\\\n #~ [se...
[ "0.63504434", "0.59144664", "0.5864663", "0.58144855", "0.5810399", "0.5723678", "0.5679944", "0.56216276", "0.5613916", "0.5502032", "0.5484399", "0.54355526", "0.5433525", "0.54297596", "0.54288644", "0.5420481", "0.5404081", "0.53961533", "0.53927654", "0.53615886", "0.535...
0.0
-1
Run an acrosssubject classification Decode responses on each hand separately from CPRO data Limit to ROIs within SMN network
def conditionDecodings(data, rois, ncvs=100, effects=False, motorOutput=False,confusion=False, decoder='similarity', nproc=5): ncond = data.shape[1] # two motor outputs nSubjs = data.shape[2] nsamples = nSubjs * ncond stats = np.zeros((len(rois),nsamples)) rmatches = np.zeros((len(rois),)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self, requests):\n responses = []\n for request in requests:\n infer_outputs = pb_utils.get_input_tensor_by_name(\n request, self.input_names[0])\n im_infos = pb_utils.get_input_tensor_by_name(request,\n ...
[ "0.56707114", "0.56553566", "0.5601765", "0.55017805", "0.5460834", "0.5439918", "0.54097337", "0.537334", "0.53697425", "0.5360478", "0.53484106", "0.5340918", "0.52992934", "0.5270834", "0.5248631", "0.52458835", "0.5234071", "0.5232353", "0.52291584", "0.52209944", "0.5219...
0.6313217
0
Runs cross validation for an acrosssubject SVM analysis
def randomSplitLOOBaselineCV(ncvs, svm_mat, labels, subjarray, motorOutput=False, permutation=False, decoder='similarity', nproc=5, featsel=False): ntasks = len(np.unique(labels)) nsamples = svm_mat.shape[0] nsubjs = nsamples/ntasks subjects = np.unique(subjarray) indices = np.arange(nsamples...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crossValidate(self, args):\n\n ##################################\n # Read the training data\n ##################################\n if not os.path.isdir(args.annotationPath):\n print('annotation path does not exist: {}' \\\n .format(args.annotationP...
[ "0.7582791", "0.73694915", "0.7243919", "0.71949804", "0.7167863", "0.71519244", "0.70678645", "0.7039688", "0.69975895", "0.6991288", "0.6983354", "0.6981687", "0.6946862", "0.6944603", "0.6925344", "0.68498045", "0.68492496", "0.67716795", "0.675217", "0.6742814", "0.673506...
0.0
-1
Run an acrosssubject classification Decode responses on each hand separately from CPRO data
def actflowDecodings(data, actflow_data, effects=False, featsel=True, ncvs=1, permutation=False, confusion=False, nproc=5): nSubjs = data.shape[2] stats = np.zeros((1,)) ncond = data.shape[1] nsamples = nSubjs * ncond nfeatures = data.shape[0] # Label array for supervised learning la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conditionDecodings(data, rois, ncvs=100, effects=False, motorOutput=False,confusion=False, decoder='similarity', nproc=5):\n \n ncond = data.shape[1] # two motor outputs\n nSubjs = data.shape[2]\n\n nsamples = nSubjs * ncond\n stats = np.zeros((len(rois),nsamples))\n rmatches = np.zeros((len(...
[ "0.59594476", "0.59384817", "0.5736482", "0.5718673", "0.56810707", "0.5647129", "0.56446636", "0.5607695", "0.5556696", "0.55397236", "0.55289805", "0.5528581", "0.55254686", "0.55149966", "0.548933", "0.54383725", "0.54022396", "0.53819793", "0.5377064", "0.5372356", "0.536...
0.5322647
23
Runs cross validation for an acrosssubject SVM analysis
def actflowRandomSplitLOOBaselineCV(ncvs, svm_mat, actflow_svm_mat, labels, subjarray, featsel=True, permutation=False,nproc=5): ntasks = len(np.unique(labels)) nsamples = svm_mat.shape[0] nsubjs = nsamples/ntasks subjects = np.unique(subjarray) indices = np.arange(nsamples) #numsubjs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crossValidate(self, args):\n\n ##################################\n # Read the training data\n ##################################\n if not os.path.isdir(args.annotationPath):\n print('annotation path does not exist: {}' \\\n .format(args.annotationP...
[ "0.7582791", "0.73694915", "0.7243919", "0.71949804", "0.7167863", "0.71519244", "0.70678645", "0.7039688", "0.69975895", "0.6991288", "0.6983354", "0.6981687", "0.6946862", "0.6944603", "0.6925344", "0.68498045", "0.68492496", "0.67716795", "0.675217", "0.6742814", "0.673506...
0.0
-1
Load direct input 2 output FC mappings control analysis
def loadSubjActFlowFC_NoHidden(subj,inputtype,fcdir): if inputtype in ['VERTICAL','RED','HIGH','CONSTANT']: h5f = h5py.File(fcdir + inputtype + 'ToOutputLayer_FC_subj' + subj + '.h5','r') fcmapping = h5f['sourceToTargetMapping'][:].copy() eigenvectors_input = h5f['eigenvectors'][:].copy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_process(fasta_fp, mapping_fp, denoised_seqs_fp,\r\n otu_picker_otu_map_fp, out_dir):\r\n\r\n combine_mappings(open(fasta_fp), open(mapping_fp),\r\n open(denoised_seqs_fp),\r\n open(otu_picker_otu_map_fp), out_dir)", "def _standard_mapping(self):...
[ "0.5957527", "0.5901851", "0.5898157", "0.5824446", "0.57429874", "0.5724559", "0.56925887", "0.5678476", "0.56662995", "0.5650207", "0.564394", "0.56413573", "0.56300575", "0.5606228", "0.5584282", "0.5576899", "0.55665374", "0.5565627", "0.55558133", "0.55504113", "0.550616...
0.51014936
75
Load direct input 2 output FC mappings control analysis
def loadGroupActFlowFC_NoHidden(inputtype,fcdir): if inputtype in ['VERTICAL','RED','HIGH','CONSTANT']: h5f = h5py.File(fcdir + inputtype + 'ToOutputLayer_FC_Group.h5','r') fcmapping = h5f['sourceToTargetMapping'][:].copy() eigenvectors_input = h5f['eigenvectors'][:].copy() h5f.clos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_process(fasta_fp, mapping_fp, denoised_seqs_fp,\r\n otu_picker_otu_map_fp, out_dir):\r\n\r\n combine_mappings(open(fasta_fp), open(mapping_fp),\r\n open(denoised_seqs_fp),\r\n open(otu_picker_otu_map_fp), out_dir)", "def _standard_mapping(self):...
[ "0.5958182", "0.5901442", "0.58976465", "0.5824817", "0.57437664", "0.5723222", "0.56925786", "0.5678178", "0.5666717", "0.5651474", "0.5641801", "0.56411237", "0.5631734", "0.5607848", "0.5584844", "0.5577562", "0.556734", "0.5566151", "0.55564994", "0.55500746", "0.5506336"...
0.50639737
91
array can either be 360 array or ~59k array. If 360, will automatically map back to ~59k
def mapBackToSurface(array,filename): #### Map back to surface if array.shape[0]==360: out_array = np.zeros((glasser2.shape[0],3)) roicount = 0 for roi in range(360): for col in range(array.shape[1]): vertex_ind = np.where(glasser2==roi+1)[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changeArray(array):\r\n\r\n return [[float(array[j][i]) for j in range(len(array))] for i in range(len(array[0]))]", "def solution(array):\n array1 = np.array(array)\n array2 = array1.astype(float)\n return array2", "def mapping(array, map):\r\n n = map.shape[0] \r\n if array.dtype == np....
[ "0.5801872", "0.5736414", "0.5607404", "0.54848576", "0.5462905", "0.53815883", "0.53789145", "0.5347712", "0.534731", "0.5346173", "0.5330794", "0.53048295", "0.53041655", "0.5290421", "0.52872", "0.5281134", "0.5254639", "0.5245278", "0.5217675", "0.5208273", "0.5203374", ...
0.5695677
2
Run an acrosssubject classification Decode responses on each hand separately from CPRO data
def compositionalActflowDecodings(data, nov_actflow_data, prac_actflow_data, effects=False, featsel=True, ncvs=1, nproc=5): nSubjs = data.shape[2] stats = np.zeros((1,)) ncond = data.shape[1] nsamples = nSubjs * ncond nfeatures = data.shape[0] # Label array for supervised learning la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conditionDecodings(data, rois, ncvs=100, effects=False, motorOutput=False,confusion=False, decoder='similarity', nproc=5):\n \n ncond = data.shape[1] # two motor outputs\n nSubjs = data.shape[2]\n\n nsamples = nSubjs * ncond\n stats = np.zeros((len(rois),nsamples))\n rmatches = np.zeros((len(...
[ "0.59594476", "0.59384817", "0.5736482", "0.5718673", "0.56810707", "0.5647129", "0.56446636", "0.5607695", "0.5556696", "0.55397236", "0.55289805", "0.5528581", "0.55254686", "0.55149966", "0.548933", "0.54383725", "0.54022396", "0.53819793", "0.5377064", "0.5372356", "0.536...
0.53299624
22
Runs cross validation for an acrosssubject SVM analysis
def compositionalActflowRandomSplitLOOBaselineCV(ncvs, svm_mat, nov_svm_mat, prc_svm_mat, labels, subjarray, featsel=True, nproc=5): ntasks = len(np.unique(labels)) nsamples = svm_mat.shape[0] nsubjs = nsamples/ntasks subjects = np.unique(subjarray) indices = np.arange(nsamples) numsu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crossValidate(self, args):\n\n ##################################\n # Read the training data\n ##################################\n if not os.path.isdir(args.annotationPath):\n print('annotation path does not exist: {}' \\\n .format(args.annotationP...
[ "0.7582216", "0.73700595", "0.72442365", "0.71962374", "0.71674687", "0.7151614", "0.7067812", "0.7040971", "0.69988185", "0.69910026", "0.69847065", "0.6981253", "0.6946461", "0.69450456", "0.6925203", "0.6850364", "0.6849873", "0.67713803", "0.6751911", "0.67439026", "0.673...
0.61284596
86
Try connecting to the server
def test_connect(): print("Testing connecting to the server") try: with socket.socket() as s: s.connect(("localhost", 8000)) print("Connection attempt succeeded.") return None except socket.error: return "Server didn't answer on localhost port 8000. Is it running?"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_connection(self):\n for _ in range(3):\n try:\n r = get(f\"http://{self.ip}/student/{self.user}\")\n if r.ok:\n break \n except OSError as e:\n print(f\"Connection error:\\n{e}\")\n sleep(2)\n ...
[ "0.74671197", "0.7376107", "0.7224917", "0.71801555", "0.71454126", "0.7106595", "0.6992818", "0.69693106", "0.69635016", "0.6934962", "0.69222325", "0.69027525", "0.68996257", "0.68846506", "0.68738174", "0.68378454", "0.6834296", "0.6821374", "0.6818732", "0.67999405", "0.6...
0.7139742
5
The server should accept a POST and return the 'nessage' field
def test_POST(): print("Testing POST request.") msg = random.choice(["Hellow!", "Hi!! you", "Greetings!!!"]) uri = "http://localhost:8000/" try: r = requests.post(uri, data={'message': msg}) except requests.RequestException as e: return (f"Couldn't communicate with the server. ({e}), If it's running, take a l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n return write_msg(request.json)", "def render_POST(self, request):\n\t\tprint request.args[\"message\"][0]\n\t\tself.jabberClient.sendMessage(request.args[\"message\"][0])\n\t\treturn ''", "def post(self):\n try:\n msgId = int(request.form['text'])\n except Valu...
[ "0.700399", "0.69622856", "0.6937624", "0.690975", "0.6692679", "0.6602576", "0.64796257", "0.6373835", "0.63503146", "0.63502765", "0.6258975", "0.62196815", "0.6202336", "0.61453116", "0.61423415", "0.6071141", "0.60104567", "0.60015494", "0.5992528", "0.5970044", "0.596773...
0.57780945
48
Fit the linear regression coefficients. This function will solve a linear regression with Gaussian priors on the coefficients.
def _fit_coefficients( self, cadence_mask=None, prior_mu=None, prior_sigma=None, propagate_errors=False ): # If prior_mu is specified, prior_sigma must be specified if not ((prior_mu is None) & (prior_sigma is None)) | ( (prior_mu is not None) & (prior_sigma is not None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_fit(x, y):\n x = np.array(x)\n y = np.array(y)\n \n invalid_idx = np.isnan(x) | np.isinf(x) | np.isnan(y) | np.isinf(y)\n x = x[~invalid_idx]\n y = y[~invalid_idx]\n\n covs = sm.add_constant(x, prepend=True)\n model = sm.OLS(y, covs)\n result = model.fit()\n return result.p...
[ "0.6792636", "0.6785291", "0.6730444", "0.6671837", "0.66564393", "0.66392154", "0.66048634", "0.6589059", "0.6574239", "0.6574239", "0.6574239", "0.656269", "0.65618896", "0.6551248", "0.6550165", "0.65029776", "0.64471906", "0.6393028", "0.638561", "0.63669246", "0.63662094...
0.0
-1
Find the best fit correction for the light curve.
def correct( self, design_matrix_collection, cadence_mask=None, sigma=5, niters=5, propagate_errors=False, ): if not isinstance(design_matrix_collection, DesignMatrixCollection): if isinstance(design_matrix_collection, SparseDesignMatrix): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_lip_best(self) -> float:\n pass", "def test_intra_power_law_fit2(self):\n\t\tprint(type(self.fc_layers[0:2]), self.fc_layers[0:2])\n\t\tdetails= self.watcher.analyze(layers=self.fc_layers[0:2], intra=True, sparsify=False, pl_package=POWERLAW_PACKAGE, xmax=XMAX_FORCE)\n\t\tactual_alpha = details.a...
[ "0.6179351", "0.5929913", "0.58914375", "0.587837", "0.58164775", "0.57964665", "0.5769313", "0.575269", "0.57327217", "0.5724726", "0.5707219", "0.56688213", "0.5661554", "0.56298316", "0.5593415", "0.558705", "0.5580057", "0.55682325", "0.55587983", "0.5546923", "0.5546372"...
0.0
-1
Returns a dictionary containing all diagnostic light curves. The dictionary will provide a light curve for each matrix in the design matrix collection.
def _create_diagnostic_lightcurves(self): if self.coefficients is None: raise ValueError("you need to call `correct()` first") lcs = {} for idx, submatrix in enumerate(self.dmc.matrices): # What is the index of the first column for the submatrix? firstcol_idx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_materials_dict(self):\n c = 299792458.0\n w_mat = 2 * np.pi * c / self.l_mat - self.w0\n l2_mat = (self.l_mat * 1e6) ** 2\n\n n_air = 1 + 0.05792105 * l2_mat / (238.0185 * l2_mat - 1) + 0.00167917 * l2_mat / (57.362 * l2_mat - 1)\n air_ip = interp1d(w_mat, n_air, bou...
[ "0.60194796", "0.59146357", "0.5619035", "0.55798995", "0.55360436", "0.54979974", "0.54268354", "0.5380969", "0.53533584", "0.53345037", "0.5332291", "0.52693045", "0.52423155", "0.5225769", "0.52155113", "0.5174672", "0.51708114", "0.51582485", "0.51488817", "0.51368886", "...
0.75933963
0
Produce diagnostic plots to assess the effectiveness of the correction.
def _diagnostic_plot(self): if not hasattr(self, "corrected_lc"): raise ValueError( "Please call the `correct()` method before trying to diagnose." ) with plt.style.context(MPLSTYLE): _, axs = plt.subplots(2, figsize=(10, 6), sharex=True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Diagnostic_plot2(self):\n\n probs = pd.read_csv(self.probfile)\n\n fig, ax = generalPlot(xaxis=r'$\\nu / \\mu$Hz', yaxis=r'$P_{\\rm det}$')\n plt.scatter(probs['f0'], probs['Pdet_Kepler'], label='Kepler - 4yrs')\n plt.scatter(probs['f0'], probs['Pdet_TESS365'], label='TESS - 1 yr')\...
[ "0.6873683", "0.6821231", "0.6672336", "0.66437536", "0.66437536", "0.66437536", "0.6629172", "0.6596364", "0.6589779", "0.6557499", "0.6521361", "0.6518009", "0.65085554", "0.64940095", "0.64903545", "0.64805514", "0.6445851", "0.6403377", "0.6347727", "0.63423556", "0.63348...
0.7091261
0
Returns diagnostic plots to assess the most recent call to `correct()`. If `correct()` has not yet been called, a ``ValueError`` will be raised. Returns `~matplotlib.axes.Axes` The matplotlib axes object.
def diagnose(self): return self._diagnostic_plot()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _diagnostic_plot(self):\n if not hasattr(self, \"corrected_lc\"):\n raise ValueError(\n \"Please call the `correct()` method before trying to diagnose.\"\n )\n\n with plt.style.context(MPLSTYLE):\n _, axs = plt.subplots(2, figsize=(10, 6), sharex=Tr...
[ "0.62973243", "0.5582412", "0.54954946", "0.5457916", "0.5377934", "0.53028226", "0.52979976", "0.5198705", "0.5156626", "0.51140463", "0.5106329", "0.50978374", "0.5094472", "0.5083405", "0.49963522", "0.49693686", "0.4965705", "0.49536103", "0.4950388", "0.4943999", "0.4924...
0.5505739
2
Returns a diagnostic plot visualizing how the bestfit coefficients compare against the priors. The method will show the results obtained during the most recent call to `correct()`. If `correct()` has not yet been called, a ``ValueError`` will be raised. Returns `~matplotlib.axes.Axes` The matplotlib axes object.
def diagnose_priors(self): if not hasattr(self, "corrected_lc"): raise ValueError( "Please call the `correct()` method before trying to diagnose." ) names = [dm.name for dm in self.dmc] with plt.style.context(MPLSTYLE): _, axs = plt.subplots( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def robustnessPlot(ax):\n # Setup the range of avidity and ligand concentration we'll look at\n gnus = np.logspace(1, 3, 3, base=2, dtype=np.int)\n Los = np.logspace(start=-11, stop=-7, num=35, dtype=np.float)\n\n pp = pd.DataFrame(np.array(np.meshgrid(gnus, Los)).T.reshape(-1, 2),\n ...
[ "0.64745706", "0.608616", "0.60614175", "0.6035531", "0.58973026", "0.5857323", "0.5814659", "0.5783457", "0.57566994", "0.5703762", "0.5695166", "0.56862897", "0.565359", "0.5642672", "0.563932", "0.5626169", "0.5618816", "0.5592678", "0.5582807", "0.5553929", "0.555223", ...
0.5709493
9
Returns where the arm end effector should be at time t
def target_position(self, time): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endTime(self) -> float:\n try: return self.times[-1]\n except IndexError: return 0.0", "def end_time(self) -> float:\r\n ...", "def endTime(self):\n return self.params['tend']", "def get_last(t_, w_):\n return t_ - tf.constant(1)", "def end(self):\n return self._t0...
[ "0.6262754", "0.60054207", "0.59560645", "0.5919242", "0.59007686", "0.58521706", "0.5844045", "0.580404", "0.5791151", "0.5790337", "0.5788008", "0.57607013", "0.57595277", "0.57300097", "0.57146317", "0.5713964", "0.56925106", "0.56845766", "0.56776744", "0.56025434", "0.55...
0.0
-1
Returns the arm's desired x,y,z velocity in workspace coordinates at time t
def target_velocity(self, time): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_velocity(self, time):\n\n x_v = self.w*self.r*cos(self.w*time)\n y_v = -self.w*self.r*sin(self.w*time)\n z_v = 0\n # raise NotImplementedError\n return np.array([x_v,y_v,z_v])", "def f(r,t):\r\n x = r[0]\r\n y = r[2]\r\n z = r[4]\r\n vx = ...
[ "0.6969122", "0.67800456", "0.65503675", "0.6356482", "0.6308465", "0.630399", "0.62948024", "0.6286732", "0.6198997", "0.6128271", "0.6115166", "0.61008614", "0.6078042", "0.60758245", "0.60072464", "0.60019296", "0.5946289", "0.5930369", "0.5901788", "0.5872708", "0.5855203...
0.55071664
62
Returns the arm's desired x,y,z acceleration in workspace coordinates at time t
def target_acceleration(self, time): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_acceleration(self, time):\n x_a = -self.w**2*self.r*sin(self.w*time)\n y_a = -self.w**2*self.r*cos(self.w*time)\n z_a = 0\n # raise NotImplementedError\n return np.array([x_a,y_a,z_a])", "def f(r,t):\r\n x = r[0]\r\n y = r[2]\r\n z = r[4]\r\n ...
[ "0.70698804", "0.6440076", "0.64124155", "0.63377005", "0.62645674", "0.61269134", "0.6121389", "0.60776174", "0.6065293", "0.60262007", "0.5981195", "0.5970287", "0.5951348", "0.5951348", "0.5893698", "0.5862199", "0.57664055", "0.57601243", "0.5720025", "0.57073057", "0.569...
0.0
-1
takes a discrete point in time, and puts the position, velocity, and acceleration into a ROS JointTrajectoryPoint() to be put into a RobotTrajectory.
def trajectory_point(self, t, jointspace): point = JointTrajectoryPoint() delta_t = .01 if jointspace: x_t, x_t_1, x_t_2 = None, None, None ik_attempts = 0 theta_t_2 = self.get_ik(self.target_position(t-2*delta_t)) theta_t_1 = self.get_ik(self.targ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trajectory_point(self, t, jointspace):\n point = JointTrajectoryPoint()\n delta_t = .01\n if jointspace:\n x_t, x_t_1, x_t_2 = None, None, None\n ik_attempts = 0\n theta_t = theta_t_1 = theta_t_2 = None\n while theta_t_2 is None:\n ...
[ "0.7366635", "0.6119101", "0.6077254", "0.59451604", "0.5930126", "0.5914397", "0.5907721", "0.58628654", "0.58250636", "0.58205104", "0.57535905", "0.5750186", "0.5665363", "0.566258", "0.56621027", "0.5604078", "0.560013", "0.5575069", "0.5521112", "0.55184346", "0.5504239"...
0.7287572
1
Remember to call the constructor of MotionPath (__init__)
def __init__(self, total_time, kin, limb, start_pos, ar_tag_pos): #raise NotImplementedError MotionPath.__init__(self, limb, kin, total_time) start_pos = np.array([abs(start_pos[0]), abs(start_pos[1]), abs(start_pos[2])]) #The ar tracking function was not working properly so we added t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, total_time, kin, limb, ar_tag_pos):\n # raise NotImplementedError\n self.r = .1 \n MotionPath.__init__(self, limb, kin, total_time)\n self.ar_tag_pos = np.array([ar_tag_pos[0],ar_tag_pos[1],ar_tag_pos[2]])\n self.ar_tag_pos[2] = 0.282\n self.start_pos =...
[ "0.7836744", "0.7791446", "0.77425086", "0.68546695", "0.6578746", "0.63941026", "0.63739896", "0.6288861", "0.62869287", "0.62845355", "0.62569", "0.62209356", "0.6177456", "0.6177456", "0.6177456", "0.6177456", "0.6142657", "0.6134843", "0.6126099", "0.6106433", "0.60999274...
0.76483566
3
Returns where the arm end effector should be at time t
def target_position(self, time): # get joint positions and use fk to get end effector position? # ar_tag from topic cur_pos = self.target_velocity(time)*time + self.start_pos self.points_generated.append(cur_pos) #print(self.start_pos) # print(cur_pos) return cu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endTime(self) -> float:\n try: return self.times[-1]\n except IndexError: return 0.0", "def end_time(self) -> float:\r\n ...", "def endTime(self):\n return self.params['tend']", "def get_last(t_, w_):\n return t_ - tf.constant(1)", "def end(self):\n return self._t0...
[ "0.6262754", "0.60054207", "0.59560645", "0.5919242", "0.59007686", "0.58521706", "0.5844045", "0.580404", "0.5791151", "0.5790337", "0.5788008", "0.57607013", "0.57595277", "0.57300097", "0.57146317", "0.5713964", "0.56925106", "0.56845766", "0.56776744", "0.56025434", "0.55...
0.5366723
44
Returns the arm's desired x,y,z velocity in workspace coordinates at time t. You should NOT simply take a finite difference of self.target_position()
def target_velocity(self, time): avg_vel = (self.ar_tag_pos - self.start_pos)/self.total_time return avg_vel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_velocity(self, time):\n\n x_v = self.w*self.r*cos(self.w*time)\n y_v = -self.w*self.r*sin(self.w*time)\n z_v = 0\n # raise NotImplementedError\n return np.array([x_v,y_v,z_v])", "def target_position(self, time):\n\n x_pos = self.r*sin(self.w*time)+self.ar_tag_...
[ "0.7266593", "0.649724", "0.64403063", "0.6348583", "0.63289547", "0.63289547", "0.6319826", "0.62879527", "0.62594193", "0.6220879", "0.62026346", "0.61803794", "0.61693144", "0.6166686", "0.6114781", "0.6070687", "0.6070687", "0.6061902", "0.60361063", "0.59944755", "0.5956...
0.592703
23
Returns the arm's desired x,y,z acceleration in workspace coordinates at time t. You should NOT simply take a finite difference of self.target_velocity()
def target_acceleration(self, time): return np.array([0, 0, 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_acceleration(self, time):\n x_a = -self.w**2*self.r*sin(self.w*time)\n y_a = -self.w**2*self.r*cos(self.w*time)\n z_a = 0\n # raise NotImplementedError\n return np.array([x_a,y_a,z_a])", "def target_velocity(self, time):\n\n x_v = self.w*self.r*cos(self.w*time...
[ "0.70134026", "0.6654176", "0.65230024", "0.64852095", "0.64031357", "0.64031357", "0.63639945", "0.6288034", "0.62409705", "0.61979336", "0.6173782", "0.61587775", "0.6142052", "0.6091978", "0.6033012", "0.60062426", "0.599504", "0.5980418", "0.58893937", "0.58403546", "0.58...
0.6153133
12
Remember to call the constructor of MotionPath
def __init__(self, total_time, kin, limb, ar_tag_pos): # raise NotImplementedError self.r = .1 MotionPath.__init__(self, limb, kin, total_time) self.ar_tag_pos = np.array([ar_tag_pos[0],ar_tag_pos[1],ar_tag_pos[2]]) self.ar_tag_pos[2] = 0.282 self.start_pos = [ar_tag_po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, limb, kin, total_time, goal_pos, num_way, start_pos=None):\n MotionPath.__init__(self, limb, kin, total_time)\n self.start_pos = start_pos\n self.goal_pos = goal_pos\n self.num_way = num_way\n self.base_frame = 'base'\n self.tool_frame = 'left_hand_camer...
[ "0.7820282", "0.7787644", "0.77386826", "0.6963891", "0.6757834", "0.65536493", "0.65116596", "0.64888525", "0.6445253", "0.63971484", "0.6376502", "0.636337", "0.63444155", "0.6312085", "0.6276762", "0.6248574", "0.62414914", "0.6194726", "0.6188483", "0.6171967", "0.6170589...
0.78976136
0
Returns where the arm end effector should be at time t
def target_position(self, time): x_pos = self.r*sin(self.w*time)+self.ar_tag_pos[0] y_pos = self.r*cos(self.w*time)+self.ar_tag_pos[1] z_pos = self.ar_tag_pos[2] # print(x_pos,y_pos) # raise NotImplementedError return np.array([x_pos,y_pos,z_pos])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endTime(self) -> float:\n try: return self.times[-1]\n except IndexError: return 0.0", "def end_time(self) -> float:\r\n ...", "def endTime(self):\n return self.params['tend']", "def get_last(t_, w_):\n return t_ - tf.constant(1)", "def end(self):\n return self._t0...
[ "0.6262754", "0.60054207", "0.59560645", "0.5919242", "0.59007686", "0.58521706", "0.5844045", "0.580404", "0.5791151", "0.5790337", "0.5788008", "0.57607013", "0.57595277", "0.57300097", "0.57146317", "0.5713964", "0.56925106", "0.56845766", "0.56776744", "0.56025434", "0.55...
0.0
-1
Returns the arm's desired velocity in workspace coordinates at time t. You should NOT simply take a finite difference of self.target_position()
def target_velocity(self, time): x_v = self.w*self.r*cos(self.w*time) y_v = -self.w*self.r*sin(self.w*time) z_v = 0 # raise NotImplementedError return np.array([x_v,y_v,z_v])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_velocity(self, time):\n return self.target(time, self.velocities, self.dt, self.num_way)", "def target_velocity(self, time):\n return self.target(time, self.velocities, self.dt, self.num_way)", "def target_velocity(self, time):\n path, path_time = self.get_current_path(time)\n ...
[ "0.7068331", "0.7068331", "0.70444334", "0.7034289", "0.6955907", "0.68580544", "0.6856776", "0.6856776", "0.67172503", "0.6685114", "0.66773754", "0.6674364", "0.66353154", "0.66283923", "0.6606402", "0.65924555", "0.65924555", "0.6582541", "0.6543292", "0.6520295", "0.65179...
0.72390187
0
Returns the arm's desired x,y,z acceleration in workspace coordinates at time t. You should NOT simply take a finite difference of self.target_velocity()
def target_acceleration(self, time): x_a = -self.w**2*self.r*sin(self.w*time) y_a = -self.w**2*self.r*cos(self.w*time) z_a = 0 # raise NotImplementedError return np.array([x_a,y_a,z_a])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_velocity(self, time):\n\n x_v = self.w*self.r*cos(self.w*time)\n y_v = -self.w*self.r*sin(self.w*time)\n z_v = 0\n # raise NotImplementedError\n return np.array([x_v,y_v,z_v])", "def acceleration(v,u,t):\n return ((v-u)/t)", "def acceleration(self):\n ux,...
[ "0.6654176", "0.65230024", "0.64852095", "0.64031357", "0.64031357", "0.63639945", "0.6288034", "0.62409705", "0.61979336", "0.6173782", "0.61587775", "0.6153133", "0.6142052", "0.6091978", "0.6033012", "0.60062426", "0.599504", "0.5980418", "0.58893937", "0.58403546", "0.580...
0.70134026
0
Returns where the arm end effector should be at time t
def target_position(self, time): """ start_pos = self.points[self.cur_start] seg_time = time - self.last_checkpoint_time #The arguement of target-velocity dosent matter cur_pos = self.target_velocity(time)*seg_time + start_pos # or time > (self.total_time / 4)*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endTime(self) -> float:\n try: return self.times[-1]\n except IndexError: return 0.0", "def end_time(self) -> float:\r\n ...", "def endTime(self):\n return self.params['tend']", "def get_last(t_, w_):\n return t_ - tf.constant(1)", "def end(self):\n return self._t0...
[ "0.6262754", "0.60054207", "0.59560645", "0.5919242", "0.59007686", "0.58521706", "0.5844045", "0.580404", "0.5791151", "0.5790337", "0.5788008", "0.57607013", "0.57595277", "0.57300097", "0.57146317", "0.5713964", "0.56925106", "0.56845766", "0.56776744", "0.56025434", "0.55...
0.0
-1
Returns the arm's desired velocity in workspace coordinates at time t
def target_velocity(self, time): """ start_point = self.points[self.cur_start] cur_target = self.points[(self.cur_start + 1) % 4] total_time = self.total_time / 4 avg_vel = (cur_target - start_point)/ total_time return avg_vel """ total_time = self.total_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_velocity(self, time):\n\n x_v = self.w*self.r*cos(self.w*time)\n y_v = -self.w*self.r*sin(self.w*time)\n z_v = 0\n # raise NotImplementedError\n return np.array([x_v,y_v,z_v])", "def vel(self, time):\n if (time < self.ti):\n t = 0\n elif (tim...
[ "0.7120653", "0.697146", "0.6872062", "0.6827393", "0.6781933", "0.6706172", "0.66989666", "0.66028404", "0.6586185", "0.6578873", "0.65184575", "0.65106213", "0.65106213", "0.64967805", "0.6452281", "0.64379877", "0.6426943", "0.6426943", "0.6386043", "0.63796675", "0.637894...
0.6284519
25
Returns the arm's desired acceleration in workspace coordinates at time t
def target_acceleration(self, time): #return np.array([0, 0, 0]) if time <= self.total_time/4: return self.path1.target_acceleration(time) elif time <= self.total_time/2: return self.path2.target_acceleration(time) elif time <= self.total_time/4*3: ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_acceleration(self, time):\n x_a = -self.w**2*self.r*sin(self.w*time)\n y_a = -self.w**2*self.r*cos(self.w*time)\n z_a = 0\n # raise NotImplementedError\n return np.array([x_a,y_a,z_a])", "def acceleration(v,u,t):\n return ((v-u)/t)", "def get_acceleration(self,v...
[ "0.7151567", "0.69269055", "0.6620792", "0.6604044", "0.6604044", "0.64903134", "0.6474762", "0.6448839", "0.642742", "0.6288047", "0.6253032", "0.62328714", "0.62094814", "0.61376417", "0.6014507", "0.6013373", "0.59907395", "0.5975713", "0.5963832", "0.5947619", "0.5936622"...
0.65715986
5
Add tables to update.
def table(self, list_or_name): if not isinstance(list_or_name, basestring): for c in list_or_name: self.table(c) else: self._table_names.append(list_or_name) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __new_tables_statement(self):\n new_tables = self.__new_tables()\n for table in new_tables:\n with open('./update/create_tables.sql', 'a') as f:\n create_statement = self.source.query_create_table_statement(table.name)\n f.write(create_statement)\n ...
[ "0.71956253", "0.7121374", "0.7104306", "0.71029955", "0.6936429", "0.689795", "0.68570906", "0.6833193", "0.68265414", "0.68265414", "0.6670361", "0.66690147", "0.65515643", "0.65446407", "0.65392756", "0.6525563", "0.64799553", "0.6468853", "0.6457003", "0.645229", "0.64522...
0.0
-1
Add expressions to order by.
def order_by(self, list_or_name): if not isinstance(list_or_name, basestring): for c in list_or_name: self.order_by(c) else: self._orderby_conds.append(list_or_name) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _orderby_expression(self):\n return ''", "def order_by(self, *fields):\n self._evaluated = False\n if self._order is None:\n self._order = []\n\n for field in fields:\n direction = \"asc\"\n if field.startswith('-'):\n direction = \"desc\"\n field = field[1:]\n\n ...
[ "0.7325629", "0.68086284", "0.6290014", "0.6235323", "0.6235261", "0.62039375", "0.6151792", "0.61361706", "0.6074596", "0.6058576", "0.60491574", "0.6035678", "0.60100913", "0.59463125", "0.59335196", "0.5930086", "0.5926631", "0.57996154", "0.5741835", "0.5740553", "0.56681...
0.5119484
57
Add limit clause expression.
def limit(self, row_count): self._limit = row_count return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit_clause(self, select):\n return \"\"", "def apply_limit(self, query, limit):\n if limit is not None:\n limit = int(limit)\n if limit < 0:\n raise ValueError(\"limit can not be a negative integer.\")\n query = query.limit(limit)\n retur...
[ "0.7404516", "0.72155404", "0.69859445", "0.67413896", "0.6662522", "0.6627026", "0.65691817", "0.6537712", "0.6416191", "0.6371152", "0.62403226", "0.62190896", "0.6199445", "0.61692774", "0.61400425", "0.60801107", "0.6063965", "0.6063965", "0.6063965", "0.60438126", "0.599...
0.57001954
33