query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The HTTP TCP port number. Possible values are between `1` `65535`.
def http_port(self) -> pulumi.Input[int]: return pulumi.get(self, "http_port")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_http_port(self):\r\n return self.__port", "def get_http_port(self):\r\n return self.__port", "def http_port(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"http_port\")", "def http_port(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"htt...
[ "0.8185455", "0.8185455", "0.79727", "0.79727", "0.7929208", "0.7493519", "0.7309481", "0.7309481", "0.7309481", "0.7309481", "0.7309481", "0.7309481", "0.7309481", "0.7309481", "0.7309481", "0.7302444", "0.7246224", "0.72068036", "0.71514934", "0.71421015", "0.71421015", "...
0.8107842
2
The HTTPS TCP port number. Possible values are between `1` `65535`.
def https_port(self) -> pulumi.Input[int]: return pulumi.get(self, "https_port")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def https_port(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"https_port\")", "def https_port(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"https_port\")", "def port(self):\n return self.ssl_port or self.DEFAULT_PORT", "def http_port(self) -> pulum...
[ "0.8093062", "0.80255926", "0.7927971", "0.69441515", "0.6915489", "0.6915489", "0.6855873", "0.6855873", "0.6766976", "0.67365843", "0.6689399", "0.66181546", "0.6585918", "0.6585918", "0.6585918", "0.6585918", "0.6585918", "0.6585918", "0.6585918", "0.6585918", "0.6585918",...
0.8240357
0
Specifies if the backend is enabled or not. Valid options are `true` or `false`. Defaults to `true`.
def enabled(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "enabled")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled(cls):\r\n return backend_setting(cls, cls.SETTINGS_KEY_NAME) and\\\r\n backend_setting(cls, cls.SETTINGS_SECRET_NAME)", "def enable(self) -> bool:\n return pulumi.get(self, \"enable\")", "def is_enabled(self) -> bool:\n return bool(options.get(\"chart-rendering.en...
[ "0.6554246", "0.65476125", "0.64886564", "0.64686435", "0.6419529", "0.6419529", "0.6419529", "0.6419529", "0.6419529", "0.6419529", "0.6419529", "0.6398361", "0.6397317", "0.6397317", "0.63954145", "0.63954145", "0.63954145", "0.63954145", "0.63954145", "0.63954145", "0.6395...
0.62927544
81
Specifies the name of the Health Probe.
def name(self) -> pulumi.Input[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def health_probe_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"health_probe_name\")", "def name(self):\n return \"Health Checks\"", "def set_name(self, name):\n self.options['name'] = name", "def x_fd_health_probe(self) -> Optional[str]:\n return pulumi.get(self, \"...
[ "0.7685848", "0.58707815", "0.58290493", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.5807593", "0.58070505", "0.58070505", "0.58070505", "0.58068734", "0.5806873...
0.0
-1
Is this health probe enabled? Defaults to `true`.
def enabled(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "enabled")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "def enabled(self) -> bool:\n return pulumi.get(self, \"enabled\")", "def...
[ "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017", "0.69763017"...
0.0
-1
The ID of the FrontDoor.
def id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return 3", "def get_ID(self):\n return self.carla_ID", "def ID(self):\n\t\treturn self._id", "def get_id(self):\n\t\treturn self._id", "def get_id(self):\r\n return self.__id", "def get_id(self):\r\n return self.__id", "def get_id(self):\n return i...
[ "0.7089344", "0.70476687", "0.70402545", "0.70277715", "0.70236456", "0.70236456", "0.70014125", "0.699697", "0.69834554", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.69555414", "0.69360775", "0.69195...
0.0
-1
The path to use for the Health Probe. Default is `/`.
def path(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "path")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def health_check_path(self) -> str:\n return pulumi.get(self, \"health_check_path\")", "def health_check_path(self) -> str:\n return pulumi.get(self, \"health_check_path\")", "def health_check_path(self) -> str:\n return pulumi.get(self, \"health_check_path\")", "def health_check_path(se...
[ "0.77596", "0.77596", "0.77596", "0.7758778", "0.7758778", "0.7650106", "0.7650106", "0.7648457", "0.7648457", "0.7648457", "0.7648457", "0.7648457", "0.7648457", "0.7648457", "0.76480573", "0.66840225", "0.64649546", "0.6460636", "0.6460636", "0.6460636", "0.6460636", "0.6...
0.0
-1
Protocol scheme to use for the Health Probe. Possible values are `Http` and `Https`. Defaults to `Http`.
def protocol(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "protocol")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scheme(self):\n scheme = self.environ.get('wsgi.url_scheme', \"http\")\n return scheme", "def scheme(self) -> str:\n return self.raw_request.get('scheme')", "def _get_scheme(configs):\n scheme = 'http'\n if configs and 'https' in configs.complete_contexts():\n scheme = 'ht...
[ "0.68637615", "0.67154807", "0.6697683", "0.65757143", "0.65183747", "0.64721316", "0.64721316", "0.64721316", "0.63500553", "0.62648576", "0.6243829", "0.62250036", "0.62250036", "0.61792916", "0.61792916", "0.616544", "0.61137754", "0.6067848", "0.6056199", "0.6033811", "0....
0.58686304
31
Specifies the name of the Load Balancer.
def name(self) -> pulumi.Input[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_balancing_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"load_balancing_name\")", "def get_load_balancer(loadBalancerName=None):\n pass", "def set_name(self, name):\n pass", "def set_name(self, name):\n self.options['name'] = name", "def set_labelname(self, la...
[ "0.6799104", "0.63553673", "0.62043786", "0.6108631", "0.6086699", "0.5972464", "0.5972464", "0.5972464", "0.5972464", "0.5972464", "0.59322846", "0.59288955", "0.59288955", "0.59288955", "0.59288955", "0.59288955", "0.59288955", "0.5927485", "0.5912332", "0.5794657", "0.5785...
0.0
-1
The ID of the FrontDoor.
def id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return 3", "def get_ID(self):\n return self.carla_ID", "def ID(self):\n\t\treturn self._id", "def get_id(self):\n\t\treturn self._id", "def get_id(self):\r\n return self.__id", "def get_id(self):\r\n return self.__id", "def get_id(self):\n return i...
[ "0.7089344", "0.70476687", "0.70402545", "0.70277715", "0.70236456", "0.70236456", "0.70014125", "0.699697", "0.69834554", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.69555414", "0.69360775", "0.69195...
0.0
-1
Specifies the host name of the `frontend_endpoint`. Must be a domain name. In order to use a name.azurefd.net domain, the name value must match the Front Door name.
def host_name(self) -> pulumi.Input[str]: return pulumi.get(self, "host_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frontend_ip_configuration_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"frontend_ip_configuration_name\")", "def frontend_ip_configuration_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"frontend_ip_configuration_name\")", "def endpoint_name(self) -> Opti...
[ "0.60056984", "0.59816325", "0.58878493", "0.58590764", "0.58590764", "0.5819512", "0.57449317", "0.56463677", "0.5591869", "0.55382496", "0.553748", "0.55364615", "0.55364615", "0.55364615", "0.55364615", "0.5535807", "0.5535807", "0.55077994", "0.5498621", "0.54780495", "0....
0.5808615
7
The ID of the FrontDoor.
def id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return 3", "def get_ID(self):\n return self.carla_ID", "def ID(self):\n\t\treturn self._id", "def get_id(self):\n\t\treturn self._id", "def get_id(self):\r\n return self.__id", "def get_id(self):\r\n return self.__id", "def get_id(self):\n return i...
[ "0.7089344", "0.70476687", "0.70402545", "0.70277715", "0.70236456", "0.70236456", "0.70014125", "0.699697", "0.69834554", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.69555414", "0.69360775", "0.69195...
0.0
-1
Whether to allow session affinity on this host. Valid options are `true` or `false` Defaults to `false`.
def session_affinity_enabled(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "session_affinity_enabled")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session_affinity_state(self) -> Optional[pulumi.Input[Union[str, 'EnabledState']]]:\n return pulumi.get(self, \"session_affinity_state\")", "def ipv6_mode(self):\n return getattr(self, 'prefer_ipv6', False)", "def allow_promiscuous(self) -> Optional[pulumi.Input[bool]]:\n return pulumi...
[ "0.57836133", "0.5486324", "0.53815335", "0.53815335", "0.5368748", "0.5368748", "0.5368748", "0.52594036", "0.5250717", "0.5223754", "0.515593", "0.5154418", "0.5090993", "0.5090993", "0.5090993", "0.5090993", "0.5090993", "0.5076846", "0.5076228", "0.5074459", "0.5022891", ...
0.7344632
0
The TTL to use in seconds for session affinity, if applicable. Defaults to `0`.
def session_affinity_ttl_seconds(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "session_affinity_ttl_seconds")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ttl(self) -> int:\n return self._ttl", "def ttl(self) -> int:\n return pulumi.get(self, \"ttl\")", "def ttl(self) -> Optional[int]:\n return pulumi.get(self, \"ttl\")", "def ttl(self) -> Optional[int]:\n return pulumi.get(self, \"ttl\")", "def ttl(self):\n return self...
[ "0.75657123", "0.7376529", "0.7343841", "0.7343841", "0.728438", "0.728438", "0.71877503", "0.71835816", "0.71835816", "0.71006334", "0.7075546", "0.69386446", "0.69128644", "0.68761915", "0.68761915", "0.68374324", "0.681661", "0.679859", "0.679859", "0.67450076", "0.6721459...
0.7901861
0
Protocol schemes to match for the Backend Routing Rule. Possible values are `Http` and `Https`.
def accepted_protocols(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: return pulumi.get(self, "accepted_protocols")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_allowed_schemes():\n if oauth2_settings.ALLOWED_REDIRECT_URI_SCHEMES:\n valid_list = oauth2_settings.ALLOWED_REDIRECT_URI_SCHEMES\n else:\n valid_list = ['https', ]\n\n return valid_list", "def _get_scheme(configs):\n scheme = 'http'\n if configs and 'https' in configs.comple...
[ "0.6512024", "0.62904", "0.6134347", "0.610933", "0.601917", "0.59777737", "0.5970593", "0.5963863", "0.59140235", "0.5900622", "0.5887714", "0.5886047", "0.58613175", "0.57845205", "0.57305175", "0.5729046", "0.56896544", "0.5636482", "0.5603742", "0.55752945", "0.5569789", ...
0.55136245
24
Specifies the name of the Routing Rule.
def name(self) -> pulumi.Input[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rule_name(self, rule_name):\n\n self._rule_name = rule_name", "def name(self, name):\n self.named_route = name\n return self", "def set_rule_name(self, rule_name):\n if not self.aws.get('xray', None):\n self.aws['xray'] = {}\n self.aws['xray']['sampling_rule_na...
[ "0.75067466", "0.7136052", "0.6762619", "0.67072904", "0.6441204", "0.6441204", "0.61802226", "0.5868174", "0.58541924", "0.5835041", "0.5829245", "0.5744329", "0.5744329", "0.5744329", "0.5744329", "0.5744329", "0.5744329", "0.5744329", "0.5724024", "0.5724024", "0.5724024",...
0.0
-1
The ID of the FrontDoor.
def id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return 3", "def get_ID(self):\n return self.carla_ID", "def ID(self):\n\t\treturn self._id", "def get_id(self):\n\t\treturn self._id", "def get_id(self):\r\n return self.__id", "def get_id(self):\r\n return self.__id", "def get_id(self):\n return i...
[ "0.7089344", "0.70476687", "0.70402545", "0.70277715", "0.70236456", "0.70236456", "0.70014125", "0.699697", "0.69834554", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.6968127", "0.69555414", "0.69360775", "0.69195...
0.0
-1
Specifies the name of the Backend Pool to forward the incoming traffic to.
def backend_pool_name(self) -> pulumi.Input[str]: return pulumi.get(self, "backend_pool_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch(self, *args, **kwargs):\r\n if 'backend_name' in kwargs:\r\n self.backend_name = kwargs['backend_name']\r\n return super(BaseHttpBackendView, self).dispatch(*args, **kwargs)", "def backend_pool_names(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"backen...
[ "0.59664816", "0.57145804", "0.5650783", "0.558722", "0.5415388", "0.53655434", "0.5348825", "0.52703714", "0.52703714", "0.51877993", "0.51831394", "0.5170484", "0.514683", "0.50944704", "0.5091153", "0.50737554", "0.50726694", "0.5062008", "0.50600994", "0.50395626", "0.502...
0.68388945
0
Protocol to use when redirecting. Valid options are `HttpOnly`, `HttpsOnly`, or `MatchRequest`. Defaults to `HttpsOnly`.
def forwarding_protocol(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "forwarding_protocol")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect_protocol(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"redirect_protocol\")", "def protocol():\r\n return \"https\" if settings.SESSION_COOKIE_SECURE else \"http\"", "def redirect_to_https(request):\n request_url = request.build_absolute_uri(request.get_full_path())\n sec...
[ "0.6864399", "0.6346894", "0.58363503", "0.5643459", "0.55802643", "0.55117077", "0.54085225", "0.540363", "0.53748274", "0.5298411", "0.51717556", "0.51574975", "0.51574975", "0.51156974", "0.504528", "0.5025834", "0.50130385", "0.49967372", "0.49967372", "0.4971524", "0.497...
0.5404201
7
Protocol to use when redirecting. Valid options are `HttpOnly`, `HttpsOnly`, or `MatchRequest`.
def redirect_protocol(self) -> pulumi.Input[str]: return pulumi.get(self, "redirect_protocol")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def protocol():\r\n return \"https\" if settings.SESSION_COOKIE_SECURE else \"http\"", "def forwarding_protocol(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"forwarding_protocol\")", "def supported_protocol(request):\n return request.param", "def protocol(self) -> str:\n ...
[ "0.61254835", "0.5735291", "0.5719169", "0.57026255", "0.5603092", "0.5309444", "0.52860236", "0.5219591", "0.5219591", "0.5176782", "0.51077014", "0.5100584", "0.5086901", "0.506715", "0.50403094", "0.4993656", "0.4980012", "0.49488518", "0.49467385", "0.49467385", "0.494538...
0.70388895
0
Generic API router. You'll probably want to be more specific with your routing. We're using the ModelResourceRouter, which automatically routes based on the class name of each Resource, and handles nested routing, querying, and updating automatically.
def api_router(path): # This should be some context related to the current request. # Note that context can be used by resources/schemas to help # handle things like permissions/access, and would typically # contain any user related info for this request. context = {} router = ModelResourceRoute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v1():\n def GET(*args, **vars):\n request.extension = 'json'\n response.generic_patterns = ['*.json']\n\n url_path = request.url.split(url_prefix).pop()\n handler, args = get_router.match(url_path)\n if handler is None:\n raise HTTP(404)\n\n return handle...
[ "0.6244975", "0.61264837", "0.609817", "0.6035132", "0.5985573", "0.5875147", "0.5831222", "0.5814457", "0.5770946", "0.5733414", "0.57010955", "0.56814295", "0.5595544", "0.55942774", "0.55793226", "0.55724895", "0.55687445", "0.55327016", "0.5532618", "0.5516338", "0.550877...
0.74778336
0
Return the unique ID for this switch.
def unique_id(self) -> str: return "_".join([MYJDOWNLOADER_DOMAIN, self._name, DOMAIN, self._key])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self):\n return \"{}.{}\".format(self.__class__, self._device.get_hardware_id())", "def unique_id(self) -> str:\n return self._info.device_identification", "def unique_id(self) -> str:\n return self._id", "def unique_id(self) -> str:\n return self._id", "def unique...
[ "0.79936206", "0.79281867", "0.78864944", "0.78864944", "0.7883134", "0.7854595", "0.7805057", "0.7805057", "0.7805057", "0.7805057", "0.7763285", "0.77376574", "0.7708841", "0.7704701", "0.77009094", "0.768815", "0.7676299", "0.7674273", "0.76508266", "0.76417685", "0.758798...
0.0
-1
Return the state of the switch.
def is_on(self) -> bool: return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n if self.__pin.state == ON_STATE:\n return switch_state.ON\n return switch_state.OFF", "def get_state(self, device):\n return self.__query_cmd('getswitchstate', device)", "def state(self) -> str:\n relay_state = self.sys_info['relay_state']\n\n if...
[ "0.81379956", "0.7921683", "0.776442", "0.7643852", "0.758534", "0.756035", "0.75161946", "0.75080884", "0.73196507", "0.7309488", "0.7309488", "0.7309488", "0.7309488", "0.7309488", "0.7293511", "0.7278227", "0.72071505", "0.71697634", "0.7145236", "0.71321446", "0.7119692",...
0.0
-1
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
def haversine(lat1,lon1,lat2,lon2): # convert decimal degrees to radians lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) # haversine formula dlon = lon2 - lon1 dlat = lat2 - lat1 a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 c = 2 * asin(sqrt(a)) km = 6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle_distance(latitudes1: float, longitudes1: float, latitudes2: float, longitudes2: float) -> float:\n dlat = math.radians(latitudes1 - latitudes2)\n dlon = math.radians(longitudes1 - longitudes2)\n alat = math.radians((latitudes1 + latitudes2) / 2)\n R = 3958.8\n x = dlon * math.cos(al...
[ "0.8263413", "0.7902336", "0.7650678", "0.76353157", "0.7598987", "0.75431216", "0.7533876", "0.7533425", "0.75236267", "0.74967265", "0.74964553", "0.74589676", "0.7404881", "0.73620963", "0.7352562", "0.73242885", "0.73224336", "0.7296588", "0.7266312", "0.72649664", "0.721...
0.0
-1
Convert column from features 2D matrix to 1D list of that feature.
def column2list(matrix: list, column_idx: int) -> list: if len(matrix) <= 1: return matrix if matrix else [] if column_idx >= len(matrix[0]): return [-1] new_column = [] for line in matrix: new_column.append(line[column_idx]) return new_column
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toList(self):\n ret = self.features.copy()\n return ret", "def column_to_list(data:list, index:int) -> list:\n column_list = [column[index] for column in data]\n # Dica: Você pode usar um for para iterar sobre as amostras, pegar a feature pelo seu índice, e dar append para uma lista\n ...
[ "0.6492416", "0.6488052", "0.63364965", "0.62817025", "0.61586183", "0.61301863", "0.6113483", "0.606729", "0.60421515", "0.60187095", "0.59813136", "0.5975026", "0.5934268", "0.5929739", "0.59071875", "0.5893291", "0.5892851", "0.58914554", "0.5868475", "0.58154637", "0.5815...
0.6614931
0
Get a nested value from a dict.
def _get_triggers(item): triggers = [] if _get_value(item, 'trigger', 'sourceTriggers', 0, 'status').lower() == 'enabled': triggers.append('SOURCE') if _get_trigger_status(item, 'trigger', 'timerTriggers'): triggers.append('TIMER') if _get_value(item, 'trigger', 'baseImageTrigger', 'stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nested_value(d, key):\n if d is None:\n return None\n if '.' not in key:\n if key not in d:\n return None\n return d[key]\n base_key, sub_key = key.split('.', 1)\n if base_key not in d:\n return None\n sub_dict = d[base_key]\n return get_nested_value...
[ "0.7937691", "0.79226816", "0.76025105", "0.7378798", "0.7303893", "0.7268849", "0.7062509", "0.69890934", "0.6921991", "0.6884513", "0.6860846", "0.68314564", "0.6724624", "0.6720593", "0.66677564", "0.6659521", "0.657181", "0.6550456", "0.6535596", "0.6424224", "0.63930905"...
0.0
-1
Get a nested value from a dict.
def _get_value(item, *args): try: for arg in args: item = item[arg] return str(item) if item or item == 0 else ' ' except (KeyError, TypeError, IndexError): return ' '
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nested_value(d, key):\n if d is None:\n return None\n if '.' not in key:\n if key not in d:\n return None\n return d[key]\n base_key, sub_key = key.split('.', 1)\n if base_key not in d:\n return None\n sub_dict = d[base_key]\n return get_nested_value...
[ "0.7937691", "0.79226816", "0.76025105", "0.7378798", "0.7303893", "0.7268849", "0.7062509", "0.69890934", "0.6921991", "0.6884513", "0.6860846", "0.68314564", "0.6724624", "0.6720593", "0.66677564", "0.6659521", "0.657181", "0.6550456", "0.6535596", "0.6424224", "0.63930905"...
0.0
-1
Reshapes arrays and converts labels to onehot arrays and splits to train and test
def preprocess_data(X, y, width, height): X = np.array(X).reshape(-1, width, height, 1) y = np.array(y) label_encoder = LabelEncoder() y = label_encoder.fit_transform(y) y = to_categorical(y) X = X / 255.0 # normalize pixel values X_train, X_test, y_train, y_test = train_test_split( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_preprocess(data, label):\n\n for i in label:\n for j in i:\n j = int(j) # transform into int\n\n data = data.reshape(-1, 128, 6)\n\n y = []\n for i in label:\n # the mode of last one forth data\n y.append(stats.mode(i[64:])[0][0])\n\n # convert to one-hot co...
[ "0.7163297", "0.7096013", "0.6758095", "0.67465895", "0.6727116", "0.67046916", "0.6698259", "0.66806847", "0.6673915", "0.6605853", "0.65865797", "0.6581392", "0.65810573", "0.65810573", "0.65810573", "0.65810573", "0.6580729", "0.65798867", "0.6577686", "0.6577686", "0.6577...
0.63757485
45
This function reinitialize the position and the number of the aliens, the lives of the player and the protection, and the score Returns None.
def restart(self): self.label_score['text'] = "Score : 0" self.label_vies['text'] = "Lives : 3" self.canvas.delete('all') self.run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_stats(self):\r\n # the left number of ship\r\n self.ships_left = self.ai_settings.ship_limit\r\n\r\n # the original score\r\n self.score = 0\r\n\r\n # the original level\r\n self.level = 1", "def reset_stats(self):\r\n self.elephants_left = self.settings...
[ "0.63146424", "0.6264452", "0.62107426", "0.61647993", "0.61506647", "0.607249", "0.6069007", "0.60553974", "0.6029275", "0.60255057", "0.5998287", "0.5973659", "0.596874", "0.5938508", "0.59001744", "0.58961475", "0.587291", "0.5818363", "0.58013207", "0.57729524", "0.577285...
0.0
-1
is_logged_in == False if _auth_result is None.
def test_returns_false_if_no_auth_result(self): server = dummy_http.DummyHttpServer() session = widesky.WideskyHaystackSession( uri=BASE_URI, username='testuser', password='testpassword', client_id='testclient', client_secret='testclientsecret'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_authenticated(self):\n return self.login != None", "def islogin(self):\n return self.auth != \"\"", "def is_logged_in(self):\n return self.authorization is not None", "def _is_authenticated():\n #return session.login == 1 TODO\n return True", "def logged_in(self) -> bool:\...
[ "0.773968", "0.7733458", "0.76836795", "0.7573527", "0.75689936", "0.75003105", "0.7493603", "0.7478864", "0.74460334", "0.7437037", "0.73798424", "0.73459315", "0.7310041", "0.7276958", "0.72620475", "0.7239357", "0.7237355", "0.71933764", "0.7185024", "0.7178884", "0.713326...
0.73629487
11
Attempt to get retrieve items without token, return 401
def test_get_unauthenticated_item(self): MimiAlertHelpers.create_alert_item() url = reverse('sysmon_alert_item', kwargs={'id': 1}) response = self.client.get(url) self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_unauthenticated_items(self):\n\n number_of_items = 5\n create_multiple_items(number_of_items)\n\n url = reverse('sysmon_alert_items')\n\n response = self.client.get(url)\n\n self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)", "def test_check_permi...
[ "0.73017645", "0.7027193", "0.6940423", "0.6921824", "0.6912134", "0.6874321", "0.6782593", "0.67614186", "0.6742493", "0.67275965", "0.6723499", "0.6713927", "0.67001843", "0.6697803", "0.6690785", "0.66804755", "0.6667126", "0.6649617", "0.6638819", "0.6580151", "0.6515815"...
0.6992339
2
Attempt to get retrieve items without token, return 401
def test_get_unauthenticated_items(self): number_of_items = 5 create_multiple_items(number_of_items) url = reverse('sysmon_alert_items') response = self.client.get(url) self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_permission_list_non_authenticated(self):\n\n self.client.logout()\n\n error_message = \"Authentication credentials were not provided.\"\n\n url = reverse(\"item-list\")\n response = self.client.get(url, format=\"json\")\n\n assert response.status_code == status.HTT...
[ "0.7027193", "0.6992339", "0.6940423", "0.6921824", "0.6912134", "0.6874321", "0.6782593", "0.67614186", "0.6742493", "0.67275965", "0.6723499", "0.6713927", "0.67001843", "0.6697803", "0.6690785", "0.66804755", "0.6667126", "0.6649617", "0.6638819", "0.6580151", "0.6515815",...
0.73017645
0
Test retrieve nonexistent trigger item, should return 404.
def test_retrieve_trigger_item_invalid(self): create_trigger_item(self.mu) url = reverse('trigger_item', kwargs={'id': 1337}) response = self.client.get(url, **self.headers) self.assertTrue(response.status_code, status.HTTP_404_NOT_FOUND)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_trigger_item(self):\n\n create_trigger_item(self.mu)\n url = reverse('trigger_item', kwargs={'id': 1})\n response = self.client.get(url, **self.headers)\n\n self.assertEqual(response.status_code, status.HTTP_200_OK)\n self.assertEqual(len(response.data), 5)", ...
[ "0.77367157", "0.75603735", "0.72440314", "0.7176992", "0.6975616", "0.6878054", "0.68546724", "0.68341845", "0.679891", "0.6751125", "0.67446107", "0.67202115", "0.66926545", "0.66601", "0.66347575", "0.66082996", "0.66081244", "0.66054213", "0.65962744", "0.6587843", "0.656...
0.89165866
0
Test delete nonexistent trigger item, should return 404.
def test_delete_trigger_item_invalid(self): create_trigger_item(self.mu) url = reverse('trigger_item', kwargs={'id': 1337}) response = self.client.delete(url, **self.headers) self.assertTrue(response.status_code, status.HTTP_400_BAD_REQUEST)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_trigger_item(self):\n canary = CanaryFileHelpers.create_canary_file(self.mu)\n\n id = canary.pk\n identifier = canary.identifier\n\n url = reverse('trigger_item', kwargs={'id': id})\n\n response = self.client.delete(url, **self.headers,\n ...
[ "0.8151989", "0.76460457", "0.7509919", "0.74684817", "0.74333686", "0.72921365", "0.72864175", "0.7278429", "0.7268937", "0.7219957", "0.7094834", "0.7086412", "0.7077927", "0.702909", "0.7002744", "0.6955985", "0.69498676", "0.69306356", "0.69306356", "0.6893642", "0.689262...
0.8558314
0
Test retrieve trigger item without authentication, should return 401
def test_retrieve_trigger_item_unauth(self): create_trigger_item(self.mu) url = reverse('trigger_item', kwargs={'id': 1}) response = self.client.get(url) self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_trigger_items_unauth(self):\n\n number_of_items = 5\n\n create_multiple_trigger_items(number_of_items, self.mu)\n url = reverse('trigger_item')\n response = self.client.get(url)\n\n self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)", "def tes...
[ "0.7926959", "0.7372424", "0.71848285", "0.6986275", "0.6957428", "0.6890545", "0.6851643", "0.67609584", "0.6706644", "0.66990805", "0.6695844", "0.6680704", "0.6562163", "0.6559044", "0.654139", "0.652751", "0.6520025", "0.6506584", "0.6501459", "0.64853114", "0.64756805", ...
0.8405176
0
Test retrieve trigger item without authentication, should return 401
def test_retrieve_trigger_items_unauth(self): number_of_items = 5 create_multiple_trigger_items(number_of_items, self.mu) url = reverse('trigger_item') response = self.client.get(url) self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_trigger_item_unauth(self):\n\n create_trigger_item(self.mu)\n url = reverse('trigger_item', kwargs={'id': 1})\n response = self.client.get(url)\n\n self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)", "def test_get_unauthenticated_item(self):\n\n ...
[ "0.8405176", "0.7372424", "0.71848285", "0.6986275", "0.6957428", "0.6890545", "0.6851643", "0.67609584", "0.6706644", "0.66990805", "0.6695844", "0.6680704", "0.6562163", "0.6559044", "0.654139", "0.652751", "0.6520025", "0.6506584", "0.6501459", "0.64853114", "0.64756805", ...
0.7926959
1
Test PUT trigger item for MimiAlertItem return 200.
def test_put_trigger_item_mimi(self): item = MimiAlertHelpers.create_alert_item() json = {'sms': True, 'email': False, 'identifier': item.machinename} url = reverse('trigger_item') response = self.client.put(url, json, **self.headers, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_put_trigger_item_unauth(self):\n\n item = MimiAlertHelpers.create_alert_item()\n\n json = {'sms': True, 'email': False,\n 'identifier': item.machinename}\n\n url = reverse('trigger_item')\n\n response = self.client.put(url, json,\n ...
[ "0.75269914", "0.73166865", "0.70048946", "0.69926566", "0.6776142", "0.67489", "0.65956694", "0.65139526", "0.65004635", "0.64450824", "0.6403715", "0.63324267", "0.63191974", "0.63012046", "0.62512195", "0.6245146", "0.6212072", "0.62112993", "0.6204417", "0.6184154", "0.61...
0.8297147
0
Test PATCH trigger item with new values, should return True.
def test_update_trigger_item(self): canary = CanaryFileHelpers.create_canary_file(self.mu) json = {'sms': True, 'email': True, 'identifier': canary.identifier} id = canary.pk url = reverse('trigger_item', kwargs={'id': id}) response = self.client.patch(url, js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_item_patch_update(self):\n\n data = {\n \"code\": \"TSLA\",\n \"name\": \"Tesla\",\n \"details\": \"Stocks of Tesla Inc.\",\n }\n response = self.post_item(data)\n\n url = reverse(\"item-detail\", None, {response.data[\"id\"]})\n new_data...
[ "0.7611986", "0.7387882", "0.71977186", "0.7097563", "0.691929", "0.6790937", "0.67491806", "0.66944134", "0.668825", "0.6660334", "0.66512334", "0.6648367", "0.6643825", "0.6641066", "0.6615747", "0.66080415", "0.6601229", "0.6598373", "0.65600127", "0.65597886", "0.6556562"...
0.7438126
1
Test PUT trigger item without authentication, should return 403.
def test_put_trigger_item_unauth(self): item = MimiAlertHelpers.create_alert_item() json = {'sms': True, 'email': False, 'identifier': item.machinename} url = reverse('trigger_item') response = self.client.put(url, json, content_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_put_method_not_allowed(self):\n url = self.setup_http_not_allowed_item_test(self.user)\n\n with override_feature_checks(self.override_features):\n self.api_put(url, {}, expected_status=405)", "def test_check_permission_update_non_authenticated(self):\n\n error_message = \...
[ "0.78917325", "0.77189505", "0.76154727", "0.746861", "0.7441733", "0.7417456", "0.7199688", "0.7138455", "0.70973736", "0.70641255", "0.70580435", "0.6989405", "0.6977141", "0.6943245", "0.69380504", "0.6916379", "0.6900364", "0.68905437", "0.68660617", "0.68640965", "0.6856...
0.76505524
2
Test PUT trigger item with invalid values, should return 400.
def test_put_trigger_item_invalid(self): json = {'sms': True, 'email': False, 'identifier': 'blaaaaaat'} url = reverse('trigger_item') response = self.client.put(url, json, **self.headers, content_type='application/json') self.assertE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bad_request(self):\r\n new_customer = {\"useinvalidame\": \"jf\"}\r\n data = json.dumps(new_customer)\r\n resp = self.app.put('/customers/1', data=data, content_type='application/json')\r\n self.assertEqual(resp.status_code, status.HTTP_400_BAD_REQUEST)", "def test_update_bad...
[ "0.7459903", "0.74512476", "0.7386568", "0.7305739", "0.7221453", "0.7189313", "0.7185311", "0.7171319", "0.7138337", "0.70538753", "0.7016173", "0.70019865", "0.69937134", "0.697846", "0.6961295", "0.6931585", "0.69123846", "0.69099927", "0.6902306", "0.68959147", "0.6889545...
0.8491668
0
Test PUT an external API settings item, return 200.
def test_put_external_item(self): api = {'api_name': 'test_api', 'api_cred': { 'api_user': 'root', 'api_password': 'toor' } } url = reverse('external-setting') response = self.cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_status_put(self):\n url = reverse('todos_api:retrieve', args=(1,))\n\n response = self.client.put(url, {\n 'title': 'Task #1000'\n })\n\n # 200 OK\n self.assertEqual(response.status_code, 200)", "def test_put_without_parameter(self):\n response = requ...
[ "0.713703", "0.69757706", "0.6847333", "0.6844726", "0.67109406", "0.6679939", "0.6678399", "0.66376823", "0.6552535", "0.65473896", "0.65331614", "0.65246326", "0.65219885", "0.6488734", "0.6484081", "0.6470923", "0.643491", "0.6430872", "0.6428777", "0.64157045", "0.6413723...
0.8315865
0
Test can retrieve all user information without token, should return 401
def test_retrieve_all_users_information_unauth(self): self._create_multiple_users() url = reverse('user_items') response = self.client.get(url) self.assertTrue(response.status_code, status.HTTP_401_UNAUTHORIZED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_all_users_information_non_superuser(self):\n\n self._create_multiple_users()\n\n su = UserHelpers.create_authenticated_user(superuser=False)\n token = su.auth_token.key\n headers = UserHelpers.create_authentication_header(token)\n\n url = reverse('user_items')\n...
[ "0.8291301", "0.8155684", "0.81025255", "0.80794567", "0.8064122", "0.8026039", "0.797251", "0.79347724", "0.7912522", "0.7846678", "0.77729356", "0.77669054", "0.7742163", "0.77366364", "0.7733655", "0.7731639", "0.7731599", "0.7714167", "0.76993656", "0.76778096", "0.764952...
0.8231479
1
Return the number of cogs we have for this game.
def getNumCogs(self): result = base.config.GetInt('cog-thief-num-cogs', 0) if not result: safezone = self.getSafezoneId() result = CTGG.calculateCogs(self.numPlayers, safezone) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nr_toplevel_hogs(self):\n hist = self.group_size_histogram('hog')\n return int(hist['Count'].sum())", "def get_animal_count(self):\r\n\r\n return len(self.grass_eaters) + len(self.meat_eaters)", "def comic_count(self):\n return db(db.comicbox.comic == db.comic.id)(db.comicbo...
[ "0.73431236", "0.7054004", "0.6866745", "0.64886737", "0.64632064", "0.6450152", "0.64467025", "0.6428689", "0.6404205", "0.64017165", "0.64017165", "0.64017165", "0.64017165", "0.64017165", "0.64017165", "0.63793993", "0.63562834", "0.63353705", "0.6308973", "0.6308565", "0....
0.8344295
0
Build up architecture 1. Pretrained face recognition model forward 2. Decoder from feature to image 3. Refeed generated image to face recognition model 4. Feed generated image to Discriminator 5. Construct 'Grade Penalty' for discriminator
def build_up(self, profile, front): # with self.graph.as_default(): # Construct Template Model (G_enc) to encoder input face with tf.variable_scope('face_model'): self.face_model = Resnet50() self.face_model.build() print('VGG model built successfully.') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_extractor(self):\n # Create First part\n # self.create_detection_net()\n # self.create_vgg_detection_net()\n self.create_resnet_relation_net()\n self.create_resnet_entity_net()", "def model_architecture(x, z, is_training, params):\n\n generator = Decoder(params.d...
[ "0.6789044", "0.652278", "0.6491264", "0.6475369", "0.64624673", "0.6432853", "0.64235735", "0.63915294", "0.63910294", "0.6390013", "0.6365983", "0.63646686", "0.6350852", "0.63461685", "0.63188416", "0.63120776", "0.63040763", "0.62953436", "0.6258504", "0.6249094", "0.6236...
0.7082788
0
Attention Discriminator Networks As normalized face is strictly aligned, we construct Attention Discriminators on fixed area of face image (i.e. whole image, eyes, nose, mouth, face). This contribution make Discriminator focus on local area, and make Generator produce more elaborate detail. 1. Waasertein Distance 2. La...
def discriminator(self, images, reuse=False): with tf.variable_scope("discriminator", reuse=reuse) as scope: norm = slim.layer_norm images = images / 127.5 - 1 bs = images.get_shape().as_list()[0] ###################### Note ######################## ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_discriminator(image, mbd=False, sparsity=False, sparsity_mbd=False):\n\n x = Conv2D(16, (2, 2), padding='same')(image)\n x = LeakyReLU()(x)\n\n #x = ZeroPadding2D((1, 1))(x)\n #x = LocallyConnected2D(16, (3, 3), padding='valid', strides=(1, 2))(x)\n x = Conv2D(8, (3, 3), padding='valid')(x...
[ "0.6694861", "0.6583719", "0.648465", "0.6466761", "0.6463639", "0.63523746", "0.6345701", "0.6272914", "0.6254396", "0.6218462", "0.6190458", "0.61718947", "0.61678785", "0.61483246", "0.6141891", "0.61392784", "0.6124492", "0.6118769", "0.60998404", "0.60729957", "0.6018346...
0.73555267
0
Process the softmax operation.
def _darknet_softmax_output(inputs, params, attrs, prefix): temperature = attrs.get("temperature", 1) data = inputs[0] if temperature != 1: data = data / _expr.const(float(temperature)) if attrs.get("use_flatten", False) is True: data = get_relay_op("batch_flatten")(data) new_attrs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax():\r\n\r\n\treturn activations.softmax", "def _softmax(self, x: np.ndarray) -> np.ndarray:\n exp = np.exp(x / self.temp)\n total = np.sum(exp)\n p = exp / total\n return p", "def softmax(self,x):\n result=np.zeros_like(x)\n M,N = x.shape\n for m in r...
[ "0.7213942", "0.70543337", "0.70337796", "0.7029233", "0.7007605", "0.68987006", "0.6882338", "0.6876422", "0.68663627", "0.6851616", "0.68349093", "0.68233675", "0.68212587", "0.68133587", "0.6808632", "0.68083394", "0.68059593", "0.6800864", "0.67916024", "0.67741823", "0.6...
0.0
-1
Get the convolution layer weights and biases.
def _get_convolution_weights(self, layer, opname): if layer.nweights == 0: return None if (layer.n * layer.c // layer.groups * layer.size * layer.size) != layer.nweights: raise RuntimeError("layer weights size not matching with n c h w") params = {} shape = (lay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_conv_weights_and_biases(layer_data):\n return np.transpose(layer_data[0], (3, 2, 1, 0)), layer_data[1]", "def get_weights(self):\n return self.layers[0].weights", "def get_layer_learned_weight(self):\n return self.sess.run([self.W_conv1, self.W_conv1_2, self.W_conv2, self.W_conv2_2])"...
[ "0.766573", "0.7245769", "0.7189807", "0.7032946", "0.69068635", "0.69068635", "0.68541384", "0.6773893", "0.6716865", "0.67073363", "0.6661835", "0.66376466", "0.66376466", "0.66149175", "0.65971816", "0.65950876", "0.65950876", "0.65950876", "0.6588383", "0.6489125", "0.647...
0.7760382
0
Parse the biases and mask for yolo layer.
def _get_yolo_weights(self, layer, opname): biases = self._read_memory_buffer((layer.total * 2,), layer.biases) mask = self._read_memory_buffer((layer.n,), layer.mask, dtype="int32") attributes = np.array( [layer.n, layer.out_c, layer.out_h, layer.out_w, layer.classes, layer.total], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extractYoloInfo(yolo_output_format_data):\n box = yolo_output_format_data[..., :6]\n conf = yolo_output_format_data[..., 6:7]\n category = yolo_output_format_data[..., 7:]\n return box, conf, category", "def parse_yolo_block(m, weights, offset, initflag):\n conv_model = m._modules['conv']\n ...
[ "0.57797056", "0.57194966", "0.5594259", "0.55275726", "0.5375758", "0.526774", "0.5234262", "0.5222482", "0.5210429", "0.5124537", "0.5076008", "0.5051867", "0.50473946", "0.50340563", "0.5030901", "0.5029647", "0.5021483", "0.50168884", "0.49827927", "0.49460223", "0.493698...
0.47469953
38
Get the rnn converted symbol from attributes.
def _get_darknet_rnn_attrs(self, layer, name, sym): attr = self._get_darknet_attrs(layer, 0) op_name = self._get_opname(layer) prefix = _get_params_prefix(op_name, name) params = self._get_darknet_params(layer, prefix) sym = _darknet_convert_symbol(op_name, _as_list(sym), params,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _darknet_convert_symbol(op_name, inputs, params, attrs, params_prefix):\n\n if op_name in _DARKNET_CONVERT_MAP:\n sym = _DARKNET_CONVERT_MAP[op_name](inputs, params, attrs, params_prefix)\n else:\n _darknet_not_support(\"Operator type \" + str(op_name))\n return sym", "def __getattr__(...
[ "0.6411174", "0.58996946", "0.5738145", "0.56956923", "0.56638175", "0.5638086", "0.563259", "0.5557807", "0.5489989", "0.5480073", "0.5477802", "0.54637694", "0.5454206", "0.544342", "0.5410342", "0.53738856", "0.52986866", "0.5296416", "0.5295323", "0.52786064", "0.52635294...
0.62403166
1
calculate the circumference of a circle
def circcirc(r): return 2 * 3.14159 * r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circumference(r):\r\n return 2 * math.pi * r", "def circumference(self):\n return 2.0 * math.pi * self.__radius", "def circumference(self):\n # Define doctests for circumference method:\n # Define circumference functionality:\n return round((2 * math.pi * self.radius),2)", ...
[ "0.8392323", "0.8283176", "0.81458193", "0.7987618", "0.78686106", "0.7705349", "0.74970275", "0.74537593", "0.7359713", "0.73582566", "0.7313049", "0.73000604", "0.7296403", "0.7233606", "0.7226553", "0.7209432", "0.7185021", "0.7181653", "0.71771806", "0.69929695", "0.69672...
0.6276856
89
Makes a model from a list of layers.
def _make_model(layer_list): assert layer_list is not None, 'No model specified!' prev_layer = 0 last = None all_layers = {} for (i, l) in enumerate(layer_list): last = _make_layer(l, i, prev_layer, all_layers) prev_layer = last.name outputs = last.output_tensor() inputs = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(self, layers):\n\n model = [] # Empty current population\n\n # Add a layer for every layer in the network\n for i in range(1, len(layers)):\n shape = (layers[i], layers[i-1])\n u = 0\n std = 1 / np.sqrt(layers[i-1]) # \"Xavier\" initializatio...
[ "0.701721", "0.68159723", "0.6778847", "0.6573984", "0.6573312", "0.6279022", "0.62523115", "0.62146723", "0.618906", "0.61812735", "0.61808157", "0.6177906", "0.61559504", "0.6136308", "0.6119605", "0.6002133", "0.5997954", "0.5994432", "0.59836483", "0.5950308", "0.5940648"...
0.7958561
0
Construct a callback from a dictionary.
def callback_from_dict(callback_dict: Union[dict, str]) -> tensorflow.keras.callbacks.Callback: assert len(callback_dict.keys()) == 1, f'Error: Callback has more than one type {callback_dict.keys()}' cb_type = next(iter(callback_dict.keys())) callback_class = extensions.callback(cb_type) if callback_cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, obj: dict) -> CallbackRequest:\n if obj is None:\n return None\n\n if not isinstance(obj, dict):\n return CallbackRequest.parse_obj(obj)\n\n _obj = CallbackRequest.parse_obj({\n \"destination\": obj.get(\"destination\"),\n \"events...
[ "0.60003996", "0.59555227", "0.5922672", "0.5918592", "0.5898795", "0.5884206", "0.5884206", "0.5798521", "0.57971936", "0.57500404", "0.57357067", "0.5731916", "0.57027984", "0.56634635", "0.56191087", "0.5608751", "0.55658954", "0.55469835", "0.5543147", "0.5529978", "0.552...
0.73256093
0
A function that uses drawGlyph() to draw a string from a robofab object. It acts like DrawBot's text() function, but you pass the font and fontSize directly. It does not handle any advanced text layout or features. For that you should generate a font and use compositor. ufoText(u'Your text here.', (0, 0), font=f, fontS...
def ufoText(textString, pos, font, fontSize, showMissing='.notdef', kerning=True, draw=True): # get glyph names gnames = _getGlyphNamesFromTextString(textString, font, showMissing) # before we begin, get kerning # there is probably a better way to do this # but for now we will explode kerning o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ufoTextSize(textString, font, fontSize, kerning=True):\r\n return ufoText(textString, font, fontSize, draw=False)", "def text(self, txt, font=_FALLBACKFONT, fontSize=10, offset=None, box=None):\n if isinstance(txt, FormattedString):\n attributedString = txt.getNSObject()\n else:\n...
[ "0.7000287", "0.67782503", "0.6763676", "0.67438316", "0.67385805", "0.67180496", "0.6662739", "0.6621348", "0.65278214", "0.64614505", "0.6450458", "0.6446102", "0.64223826", "0.6396624", "0.63950324", "0.6393563", "0.6389576", "0.636821", "0.6366813", "0.6366318", "0.636041...
0.7259632
0
Get previous d business date(s), d defaults to be 1. Input date is assumed to be business date. No holiday is handled.
def prev_bdate(in_date, d=1): return in_date - pd.tseries.offsets.BDay(d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev_business_date(\n dates: DateOrDates = dt.date.today(),\n calendars: Union[str, Tuple[str, ...]] = (),\n week_mask: Optional[str] = None) -> DateOrDates:\n return business_day_offset(dates, -1, roll='forward', calendars=calendars, week_mask=week_mask)", "def previous_weekday(d, wd...
[ "0.6996983", "0.6746361", "0.6449801", "0.63725847", "0.6040932", "0.59443563", "0.5817471", "0.56902605", "0.5680842", "0.5614501", "0.560879", "0.55836093", "0.5436114", "0.5429445", "0.53856707", "0.53145283", "0.53051424", "0.5301747", "0.5266759", "0.5259502", "0.5229308...
0.800559
0
Convert a return timeseres to its total return index. If initial date is not specified, initial date is data's first date index, first value does not matter; If initial date is specified and it is earlier than all data dates, prepending initial date. NaN values are preserved as NaN values, except the initial value.
def return2tri(data, initial_value=pc.DEFAULT_INITIAL_VALUE, initial_date=None): initial_date = pd.to_datetime(initial_date) if isinstance(data, pd.Series): if data.empty: # edge case, empty in, empty out return data if initial_date is None: ret = data.copy() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return2aum(returns, startvalue=100):\n # replace info with zero\n r = returns.replace([np.inf, -np.inf], 0)\n # replace na with zero\n r = r.fillna(0)\n # make aum begin at startvalue\n r[0] = 0\n # formula: indexed price serie = exp(cumsum(return_series))\n aum = startvalue * np.exp(r.cumsum())\n if ...
[ "0.6221552", "0.58467454", "0.5806902", "0.5701679", "0.5670191", "0.5650589", "0.5650217", "0.55897045", "0.55289817", "0.5502036", "0.5347457", "0.5210292", "0.51812255", "0.51134974", "0.5100214", "0.5051813", "0.5007561", "0.49972087", "0.49908814", "0.49886042", "0.49331...
0.5913884
1
Convert a timeseries (total return) index to its returns (pct_change) This function differs from pandas pct_change() on how NAs are handled. This function preserves the NAs instead of filling NAs up (pad, ffill)
def tri2return(data): if isinstance(data, pd.Series): s = data[data.notnull()] if s.empty: return data.copy() # empty in, empty out ret = s.pct_change() ret, _ = ret.align(data, join='right', axis=0) return ret elif isinstance(data, pd.DataFrame): re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pct_change(values):\n curr = values[:-1]\n future = values[1:]\n pcts = (future-curr) / curr \n return pcts", "def calc_perc_change(series):\n msg = \"\"\"\n This currently calculates relative change from first series.\n We'd want this to display relative change from historic average!\n ...
[ "0.6250166", "0.6205287", "0.6068757", "0.60675424", "0.60366404", "0.5710897", "0.568323", "0.56162345", "0.5607552", "0.55769885", "0.55660576", "0.55340433", "0.54590285", "0.54241806", "0.5353904", "0.51853365", "0.5181394", "0.51809466", "0.51690906", "0.51178557", "0.50...
0.5970161
5
Calculate sum of the values of two sparse vector dictionaries.
def sparse_add(sparse_vector_1, sparse_vector_2): sparse_vector_sum = {} for key in sparse_vector_1: if key not in sparse_vector_2: sparse_vector_2[key] = 0 for key in sparse_vector_2: if key not in sparse_vector_1: sparse_vector_1[key] = 0 for key in sparse_vec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def incrementSparseVector(v1, scale, v2):\n # BEGIN_YOUR_CODE (our solution is 2 lines of code, but don't worry if you deviate from this)\n allKeys = list(set(v1.keys()) | set(v2.keys()))\n for key in allKeys:\n v1[key] += scale * v2[key]\n # END_YOUR_CODE", "def vproduct(d1,d2):\n return s...
[ "0.6840076", "0.6531391", "0.64578396", "0.6409098", "0.6306397", "0.6263208", "0.62397456", "0.6207091", "0.6086783", "0.6021256", "0.6015067", "0.5966218", "0.59618986", "0.5935142", "0.5924417", "0.591116", "0.59020144", "0.58964527", "0.58897", "0.58649504", "0.58570606",...
0.8220777
0
Compute the historical predictions, i.e. the predictions for (part) of the history of the timeseries.
def compute_historical_predictions(ingested_data, param_config): input_parameters = param_config["input_parameters"] models = [*param_config["model_parameters"]["models"].split(",")] save_path = param_config["historical_prediction_parameters"]["save_path"] try: hist_pred_delta = param_config["hi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_rolling(self, historical_df, market_obs_df, verbose=False, normalize=True, normalize_vals=[None]):\n start_time = time()\n if verbose: print(\"Starting rolled prediction for model {}, {}\".format(self.name, ctime()))\n if self.model1 is None or self.model2 is None:\n rai...
[ "0.688921", "0.68502825", "0.6804786", "0.68046135", "0.6764273", "0.6713019", "0.67022115", "0.65247095", "0.6461855", "0.64219135", "0.641377", "0.63757914", "0.636444", "0.62865186", "0.6263246", "0.6247292", "0.6226456", "0.61712205", "0.61632925", "0.61577576", "0.614399...
0.73639196
0
Given the name of the model, return the corresponding PredictionModel.
def model_factory(model_class: str, param_config: dict, transformation: str = None) -> PredictionModel: model_class = model_class.lower() if model_class == "fbprophet": return FBProphetModel(params=param_config, transformation=transformation) if model_class == "lstm": return LSTMModel(param_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model(name: str, pretrained=False):\n return ptcv_get_model(name, pretrained=pretrained)", "def get_model(self, model_name=None):\n if model_name is None:\n for model in self._models.values():\n return model\n return self._models[model_name]", "def _load_model...
[ "0.7302053", "0.7213637", "0.71663696", "0.7141403", "0.70194006", "0.7007706", "0.7001119", "0.69357127", "0.69140697", "0.6845446", "0.6813033", "0.6792186", "0.67273396", "0.67224115", "0.67182183", "0.67073756", "0.6695046", "0.6688805", "0.6655493", "0.6647851", "0.66349...
0.6193081
51
Piecewise constant function with jumps at t. Constant scaler is not present in Donoho and Johnstone.
def blocks(x): K = lambda x : (1 + np.sign(x))/2. t = np.array([[.1, .13, .15, .23, .25, .4, .44, .65, .76, .78, .81]]).T h = np.array([[4, -5, 3, -4, 5, -4.2, 2.1, 4.3, -3.1, 2.1, -4.2]]).T return 3.655606 * np.sum(h*K(x-t), axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_constant(value,T,dt,t_output=False):\n N = scipy.floor(T/dt)+1\n t = scipy.arange(0,N)*dt\n x = value*scipy.ones(t.shape)\n if not t_output:\n return x\n else:\n return t,x", "def get_constant_velo(v,T,dt,t_output=False):\n N = scipy.floor(T/dt)+1\n t = scipy.arange(0,N...
[ "0.6841676", "0.6485527", "0.6213679", "0.6209536", "0.61974794", "0.61845785", "0.615118", "0.6113927", "0.6112098", "0.6071163", "0.60351866", "0.59474146", "0.5936818", "0.5927776", "0.5921826", "0.5912815", "0.5874311", "0.5866447", "0.5854363", "0.5846855", "0.58252054",...
0.0
-1
Create and return a new object. See help(type) for accurate signature.
def __new__(*args, **kwargs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cls, *args, **kwargs):\n return cls(*args, **kwargs)", "def _factory(*args_, **kwargs_):\n return ObsType(*args_, **kwargs_)", "def make_instance(self, cls, args, kw):\n return Object(cls, args, kw)", "def __new__(cls):\n raise TypeError(\"%s may not be instantiated.\" ...
[ "0.7055489", "0.6989148", "0.69420624", "0.6936614", "0.6922806", "0.6840023", "0.67875427", "0.6772222", "0.6772222", "0.67146224", "0.6670075", "0.66686094", "0.6654219", "0.6651621", "0.66416067", "0.66294825", "0.66165453", "0.6609483", "0.6592374", "0.6587368", "0.655850...
0.0
-1
determines whether to return upper or lower
def bsp_decider(iter, inp): length = len(iter) middle = length // 2 #floor if inp == 'F': return iter[:middle] if inp == 'B': return iter[middle:] if inp == 'L': return iter[:middle] if inp == 'R': return iter[middle:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Upper():\n return 'upper'", "def _checkBoundariesAndModify(self,upperBound,lowerBound,varRange,currentValue,pertUp,pertLow):\n convertedValue = currentValue\n if currentValue >= upperBound:\n convertedValue = pertUp*varRange + lowerBound\n if currentValue <= lowerBound:\n convertedValue...
[ "0.64693546", "0.62725115", "0.6268282", "0.62376744", "0.6197625", "0.60659677", "0.605195", "0.6047476", "0.6047476", "0.5990592", "0.59128106", "0.5832165", "0.5826867", "0.5815296", "0.5779906", "0.5755171", "0.5742646", "0.57300496", "0.5629317", "0.5615356", "0.5577922"...
0.0
-1
Returns the dict as a model
def from_dict(cls, dikt) -> 'Channel': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Gets the id of this Channel.
def id(self) -> int: return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_id(self):\n return self._channel_id_dict", "def get_channel_id(self):\n \tchannels_list_response = self.youtube.channels().list(\n \t\tmanagedByMe=True,\n \t\t#mine=True,\n \t\tonBehalfOfContentOwner=config.CONTENT_OWNER_ID,\n \t\tpart=\"snippet,contentDetails, contentOwnerDetai...
[ "0.83564615", "0.76349515", "0.75737536", "0.7426846", "0.7269223", "0.70849395", "0.70259684", "0.70206213", "0.70206213", "0.70206213", "0.69964546", "0.6978504", "0.6955521", "0.6946516", "0.69187146", "0.691842", "0.6904557", "0.6872988", "0.6872988", "0.6872988", "0.6872...
0.0
-1
Sets the id of this Channel.
def id(self, id: int): if id is None: raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id = id", "def setId(self, id):\n self....
[ "0.715376", "0.715376", "0.715376", "0.715376", "0.715376", "0.7078206", "0.7067421", "0.7067421", "0.7067421", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.70578945", "0.7057894...
0.0
-1
Gets the name of this Channel.
def name(self) -> str: return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_name(self):\n\n return self.channel.name if self.channel is not None else None", "def channel_name(self):\n return self._channel_name_dict", "def get_name(self) -> str:\n return self._name", "def get_name(self) -> str:\n return self._name", "def get_name(self) -> str...
[ "0.8634372", "0.84278995", "0.7390931", "0.7390931", "0.7390931", "0.73767936", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", "0.7299893", ...
0.7203772
49
Sets the name of this Channel.
def name(self, name: str): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self._name = name", "def set_name(self, name):...
[ "0.78119016", "0.78119016", "0.78119016", "0.78119016", "0.78119016", "0.78119016", "0.7755533", "0.7755533", "0.7755533", "0.7755533", "0.7755533", "0.7746265", "0.76990587", "0.7555161", "0.7528358", "0.74918306", "0.7491805", "0.74551344", "0.7455055", "0.7411608", "0.7388...
0.0
-1
Gets the user_id of this Channel.
def user_id(self) -> str: return self._user_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_id(self):\n return self.user_id", "def get_user_id(self):\n return self.socket.user_id", "def user_id(self):\n return self._user_id", "def user_id(self):\n return self._user_id", "def user_id(self):\n return self._user_id", "def user_id(self):\n retu...
[ "0.78323865", "0.77413774", "0.76895773", "0.76895773", "0.76895773", "0.7657122", "0.7622801", "0.7579859", "0.7485692", "0.73228776", "0.7309831", "0.730473", "0.730473", "0.7262506", "0.72614694", "0.7233221", "0.7210251", "0.7170603", "0.7099712", "0.69964224", "0.6973953...
0.746852
10
Gets the type of this Channel.
def type(self) -> str: return self._type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getType(self):\n return self._type", "def get_type(self):\n return self._type", "def get_type(self):\n return self.type", "def get_type(self):\n return self.type", "def getType(self):\n return self.type", "def getType(self):\n return self.type", "def getTyp...
[ "0.7445757", "0.7411353", "0.7357406", "0.7357406", "0.7350232", "0.7350232", "0.7348701", "0.73181283", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0.73075503", "0....
0.70910287
64
The name for this covariate in the final data.
def name(self): if self.untransformed_covariate_name is None: raise RuntimeError( f"The name for this covariate hasn't been set yet " f"id={self.covariate_id}, {self.study_country}, " f"transform={self.transformation_id}." ) transfo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self.c['name']", "def name(self):\n return self.data.name", "def name(self):\r\n return self.cat_constructor.Name", "def name(self):\n if hasattr(self, '_name'):\n return self._name\n else:\n tup = (0,) * len(self.shape)\n ...
[ "0.75310796", "0.7464598", "0.7462581", "0.745775", "0.74443793", "0.74293303", "0.7417547", "0.7408684", "0.74083", "0.7400289", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.73600954", "0.736...
0.8191245
0
The name of the DismodGroups group, so it's alpha, beta, or gamma.
def group(self): group_name = dict(rate_value="alpha", meas_value="beta", meas_std="gamma") return group_name[self.grid_spec.mulcov_type]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_group_name(self):\n return self.name", "def group_name(self):\n return self.properties.get(\"GroupName\", None)", "def group_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"group_name\")", "def group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, ...
[ "0.7085795", "0.70065236", "0.6837157", "0.6835858", "0.6835858", "0.6833359", "0.6760408", "0.67185265", "0.67185265", "0.66383064", "0.6615247", "0.6514038", "0.64272076", "0.64130545", "0.6406353", "0.63933426", "0.6359291", "0.63294333", "0.6312815", "0.630226", "0.630135...
0.7063867
1
Recursively copy nonempty values to the new dictionary. Return this new dict
def cleanup_dict(mapping: Mapping[str, Any]) -> dict: cleaned = {} for key, value in mapping.items(): if isinstance(value, collections.abc.Mapping): cleaned[key] = cleanup_dict(value) elif value is not None and value != '': cleaned[key] = value return cleaned
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_empty_values(data):\n copy = dict()\n for k, v in data.items():\n if isinstance(v, dict):\n inner_dict = _remove_empty_values(v)\n if len(inner_dict) > 0:\n copy[k] = inner_dict\n elif isinstance(v, list):\n if v is not None and len(v)...
[ "0.66294825", "0.6401897", "0.629374", "0.6115181", "0.6054615", "0.59456277", "0.5941508", "0.5925359", "0.58762676", "0.5821727", "0.5815314", "0.5812163", "0.5750419", "0.5744568", "0.56951576", "0.5691976", "0.56869185", "0.56669945", "0.5640001", "0.5627489", "0.55824244...
0.0
-1
Validate the last expense item in expense_sample.xls
def validate_expense_item2(self, expense_item): self.assertEqual(len(expense_item), 6) # 6 data fields self.assertEqual(expense_item['value_date'], datetime.datetime(2015,12,10)) self.assertEqual(expense_item['description'], 'SFC Annual Fee') # special case, in the excel, the amount is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_expense_item(self, expense_item):\n self.assertEqual(len(expense_item), 6) # 6 data fields\n self.assertEqual(expense_item['value_date'], datetime.datetime(2015,12,10))\n self.assertEqual(expense_item['description'], 'Setup Fee')\n self.assertAlmostEqual(expense_item['amou...
[ "0.67558", "0.65448123", "0.5482679", "0.53602225", "0.5343063", "0.5340128", "0.53305614", "0.52911264", "0.52346754", "0.51803535", "0.5179456", "0.51765394", "0.5171043", "0.51497906", "0.5134905", "0.512749", "0.5117824", "0.5112125", "0.510531", "0.5091826", "0.5086351",...
0.67392653
1
Performs sliding permutations on replicates
def permute_shuffle(new_permute_dict): permuted_values = [] # do i need this variable? ngrps = float(len(new_permute_dict)) for grp in new_permute_dict: vals = new_permute_dict[grp]["val"] nvals = len(vals) where = random.randint(0, nvals) permvals = vals[where:] + vals[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _permsForSwiping(self):\n # We use an identity permutation to generate the permutations from by\n # slicing correctly.\n identity = scipy.array(list(range(self.sequenceLength)))\n identity.shape = tuple(s // b for s, b in zip(self.shape, self.blockshape))\n permutations = []\...
[ "0.6827545", "0.6641078", "0.65061986", "0.62489474", "0.61877954", "0.61213875", "0.60869086", "0.6073444", "0.6062071", "0.6041189", "0.59576124", "0.5944948", "0.5917676", "0.58906406", "0.58753824", "0.5848383", "0.58303785", "0.5807206", "0.57921857", "0.57848126", "0.57...
0.0
-1
Performs series of sliding permutations
def permute_process(new_permute_dict): perm_out = open(ARGDICT["outdir2"]+"/permutations.txt", "a") topdists = [] for _perm in range(ARGDICT["perm"]): topdist = permute_shuffle(new_permute_dict) topdists.append(topdist) cutoff = (1-ARGDICT["sig"])*100 critical_val = percentile(topdis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _permsForSwiping(self):\n # We use an identity permutation to generate the permutations from by\n # slicing correctly.\n identity = scipy.array(list(range(self.sequenceLength)))\n identity.shape = tuple(s // b for s, b in zip(self.shape, self.blockshape))\n permutations = []\...
[ "0.692389", "0.6759518", "0.6539226", "0.6419337", "0.62434554", "0.6072874", "0.59605956", "0.59454507", "0.5924486", "0.58767956", "0.58640087", "0.58572596", "0.5825085", "0.5793523", "0.57650894", "0.5746176", "0.57446283", "0.57067585", "0.570377", "0.56915665", "0.56726...
0.0
-1
Generate a random string of letters and digits
def randomStringDigits(stringlength=6): lettersAndDigits = string.ascii_letters + string.digits return ''.join(random.choice(lettersAndDigits) for i in range(stringlength))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _random_str(self):\n letters = string.ascii_letters + string.digits\n return ''.join(choice(letters) for i in range(32))", "def generate_random_string():\n chars = string.ascii_uppercase + string.digits\n return ''.join(choices(chars, k=8))", "def generate_random_string():\n letters ...
[ "0.8602968", "0.84847534", "0.84134984", "0.8202736", "0.81845593", "0.81688774", "0.81148237", "0.81093854", "0.8090594", "0.8033801", "0.7989675", "0.78681904", "0.78553855", "0.78342575", "0.783412", "0.781336", "0.7796203", "0.77858084", "0.77855766", "0.77855766", "0.777...
0.76832604
26
Make sure the queryset is filtered on a parent site, if that didn't happen already.
def _single_site(self): if appsettings.FLUENT_CONTENTS_FILTER_SITE_ID and self._parent_site is None: return self.parent_site(settings.SITE_ID) else: return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_site(self, site):\n # Avoid auto filter if site is already set.\n self._parent_site = site\n\n if sharedcontent_appsettings.FLUENT_SHARED_CONTENT_ENABLE_CROSS_SITE:\n # Allow content to be shared between all sites:\n return self.filter(Q(parent_site=site) | Q(i...
[ "0.76058334", "0.6823651", "0.67009234", "0.6541587", "0.64178663", "0.6415631", "0.63964915", "0.61708045", "0.6096091", "0.6047022", "0.6003567", "0.5850371", "0.5720773", "0.56912863", "0.5666465", "0.56542206", "0.56146675", "0.5595791", "0.55667317", "0.552629", "0.55115...
0.6279646
7
Third order force constants (fc3). ndarray fc3 shape is either (supercell, supecell, supercell, 3, 3, 3) or (primitive, supercell, supecell, 3, 3, 3), where 'supercell' and 'primitive' indicate number of atoms in these cells.
def fc3(self, fc3): self._fc3 = fc3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def produce_fc3(self,\n forces_fc3=None,\n displacement_dataset=None,\n cutoff_distance=None, # set fc3 zero\n symmetrize_fc3r=False,\n is_compact_fc=False,\n fc_calculator=None,\n ...
[ "0.69968456", "0.6353219", "0.6344067", "0.6078965", "0.6019027", "0.59205395", "0.5912431", "0.5908332", "0.5769701", "0.56268513", "0.55910397", "0.5571937", "0.55627304", "0.5550976", "0.5513148", "0.5418413", "0.5332078", "0.5318977", "0.5299535", "0.5298154", "0.5294992"...
0.65483224
1
Second order force constants (fc2). ndarray fc2 shape is either (supercell, supecell, 3, 3) or (primitive, supecell, 3, 3), where 'supercell' and 'primitive' indicate number of atoms in these cells.
def fc2(self): return self._fc2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def produce_fc2(self,\n forces_fc2=None,\n displacement_dataset=None,\n symmetrize_fc2=False,\n is_compact_fc=False,\n fc_calculator=None,\n fc_calculator_options=None):\n\n if displacement_data...
[ "0.6567981", "0.60087657", "0.5940746", "0.59194547", "0.5863333", "0.5713575", "0.5659861", "0.56199974", "0.5520337", "0.5519909", "0.5492251", "0.54752576", "0.5428612", "0.54082775", "0.5370385", "0.5360361", "0.5312597", "0.52712524", "0.52525914", "0.5230702", "0.521242...
0.65387654
1
Unit cell PhonopyAtoms Unit cell.
def unitcell(self): return self._unitcell
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_unitcell(self):\n from javelin.unitcell import UnitCell\n try: # javelin structure\n return self.structure.unitcell\n except AttributeError:\n try: # diffpy structure\n return UnitCell(self.structure.lattice.abcABG())\n except Attribu...
[ "0.73575795", "0.7303791", "0.7133703", "0.7023329", "0.6995222", "0.6995222", "0.6995222", "0.69663453", "0.6925713", "0.68952936", "0.6839492", "0.6835475", "0.67897457", "0.6780934", "0.67081636", "0.667959", "0.66536355", "0.6641051", "0.66311264", "0.65980124", "0.659733...
0.7543203
0
Phonon frequency unit conversion factor. float Phonon frequency unit conversion factor. This factor converts sqrt(//)/2pi/1e12 to THz (ordinary frequency).
def unit_conversion_factor(self): return self._frequency_factor_to_THz
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_plancks_constant_freq():\n energy_of_light_photon = input(\"Enter the energy of light photon:\\n\")\n frequency = input(\"Enter the frequency of light in hertz:\\n\")\n result = float(energy_of_light_photon) / float(frequency)\n print(\"Planck's constant per second is: \"...
[ "0.6555115", "0.6510634", "0.64130974", "0.6310008", "0.6288647", "0.62108815", "0.60982066", "0.6079749", "0.6079749", "0.6079749", "0.6079749", "0.6079749", "0.60695624", "0.60305387", "0.6017692", "0.6016632", "0.5993747", "0.59640664", "0.595978", "0.594867", "0.5945342",...
0.7592378
0
Return the url to access a detail record
def get_absolute_url(self): return reverse('app-detail', args=[str(self.id)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDetailUrl(self):\n return self.base.get(\"detailUrl\", [])", "def get_absolute_url(self):\n return reverse('record-detail', args=[str(self.id)])", "def detail_url(self) -> str:\n return reverse(f'{self.get_meta().app_label}:detail', args=[self.pk])", "def api_detail_url(self):\n ...
[ "0.77774096", "0.7671816", "0.75716597", "0.750929", "0.73579276", "0.7316275", "0.7293185", "0.72649854", "0.7256332", "0.70964324", "0.70400226", "0.7035371", "0.7035371", "0.7035371", "0.7035371", "0.7035371", "0.7035371", "0.70010734", "0.69838023", "0.6978333", "0.696747...
0.0
-1
Creating an inverse degree matrix from an edge list.
def create_inverse_degree_matrix(edges): graph = nx.from_edgelist(edges) ind = range(len(graph.nodes())) degs = [1.0/graph.degree(node) for node in range(graph.number_of_nodes())] D_1 = sparse.coo_matrix((degs,(ind,ind)),shape=(graph.number_of_nodes(), graph.number_of_nodes()),dtype=np.float32) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_adjacency_matrix(edge_list):\n # Maybe start with an empty adjacency matrix\n adjacency_matrix = []\n vals = []\n for relations in edge_list:\n for val in relations:\n if val not in vals:\n vals.append(val)\n \n vals.sort()\n val = \"\".join(va...
[ "0.6638625", "0.64611804", "0.63477725", "0.62411666", "0.62371457", "0.62319225", "0.61667466", "0.61051244", "0.60803336", "0.6078102", "0.6027366", "0.6026926", "0.5904017", "0.5899286", "0.58838934", "0.5883248", "0.5837055", "0.58359945", "0.5833218", "0.58271337", "0.58...
0.7805175
0
minheap with set() to mimic multiset index refers to index for self._A position refers to index for self._h
def __init__(self, A): self._A = A # the original array self._h = [] # store the index self._pos = defaultdict(set) # val -> set(pos)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_min(A, heap_size) :\n A[heap_size], A[0] = A[0] , A[heap_size]\n A = min_heapify(A, heap_size-1,0)\n return A", "def __init__(self):\n self.low = []\n heapq.heapify(self.low)\n self.high = []\n heapq.heapify(self.high)", "def _heapify(self):\n start = sel...
[ "0.68930376", "0.68632853", "0.6797811", "0.67020005", "0.66433305", "0.65812004", "0.6530246", "0.6509627", "0.64724153", "0.64697", "0.6431252", "0.63434047", "0.633632", "0.63253593", "0.62904775", "0.6284829", "0.62568176", "0.6185616", "0.6168467", "0.6165144", "0.615429...
0.5848707
52
Returns the path to patreon config file, prioritizing config_env_var env var.
def get_path(): environment_path = os.getenv(config_env_var) return default_path if environment_path is None else environment_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cfg_path():\n from_env = os.environ.get(_ENV_VAR)\n if from_env and os.path.isfile(from_env):\n return from_env\n elif os.path.isfile(_DEFAULT_PATH):\n return _DEFAULT_PATH\n else:\n _LOG.error('no config found, specify it with $%s', _ENV_VAR)\n return None", "def _ge...
[ "0.77741796", "0.75674176", "0.74064654", "0.7306282", "0.7306282", "0.73053896", "0.73053837", "0.73053616", "0.73053074", "0.73053074", "0.73053074", "0.73053074", "0.73053074", "0.7138836", "0.71381265", "0.71381265", "0.713792", "0.71332157", "0.7101231", "0.70981306", "0...
0.77758735
0
Returns true if this thing is trending.
def is_trending(self): return (np.mean(self._a2)) > (np.mean(self._a1) + np.std(self._a1)) # return (np.mean(self._a2) - np.std(self._a2)) > (np.mean(self._a1) + np.std(self._a1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contains_hourly_trends(self) -> bool:\n return self._hourly_trend is not None", "def is_increasing_trend(self):\n\n try:\n return self.history[-3].value < \\\n self.history[-2].value < self.history[-1].value\n except IndexError:\n return False", "def...
[ "0.70283085", "0.6986446", "0.68134", "0.6542035", "0.64505786", "0.61756265", "0.614484", "0.60743845", "0.6044373", "0.6030481", "0.5968299", "0.59521514", "0.5924286", "0.5893533", "0.58903134", "0.5884904", "0.5884784", "0.5871114", "0.58626264", "0.5852758", "0.5852758",...
0.67904013
3
Get the height of the board.
def get_grid_height(self): return self._grid_height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_height(self) -> Number:\n return (self.right_bottom[1] - self.left_top[1])", "def _get_height(self):\n return len(self._grid)", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self.height", "def getHeight(self):\n return self._height", ...
[ "0.80797297", "0.78415245", "0.7828281", "0.7813101", "0.7792005", "0.7792005", "0.7788401", "0.77683955", "0.77683884", "0.77683884", "0.77683884", "0.77683884", "0.7767681", "0.7763313", "0.776071", "0.7752271", "0.7736801", "0.7720478", "0.76942176", "0.76852465", "0.76789...
0.76307005
28
Get name of config file
def get_config_loc(run_name): return "{0}/configs/{1}.json".format(cwd, run_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self) -> str:\n return self.config_entry.data[CONF_NAME]", "def get_config_filename(self):\n return \"%s/gsharkdown.ini\" % self.get_config_directory()", "def _getConfigName(self):\n return \"%s_%s_config\" % (self.config.coaddName, self._DefaultName)", "def get_cfg_filename():\...
[ "0.8063245", "0.776864", "0.7697616", "0.76824766", "0.7570803", "0.7562908", "0.75323725", "0.7521719", "0.75180596", "0.7506199", "0.7501549", "0.741379", "0.7402705", "0.7391613", "0.73636997", "0.72969663", "0.7130733", "0.70936567", "0.7060169", "0.705889", "0.705889", ...
0.64662063
65
Is file extension allowed for upload
def allowed_file(filename): return '.' in filename and \ filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_file(filename):\n return '.' in filename and filename.rsplit('.', 1)[1].lower() in v.ALLOWED_EXTENSIONS", "def validate_extension(uploaded_file):\n if not get_file_ext(uploaded_file.name.lower()) in ACCEPTED_FILE_TYPES:\n raise ValidationError(UploadFormErrors.EXTENSION)", "def allowed...
[ "0.8231008", "0.822611", "0.81970394", "0.81668586", "0.8164412", "0.81528497", "0.8119073", "0.81187963", "0.81184125", "0.81104785", "0.81104785", "0.8089547", "0.80771327", "0.80767924", "0.8062656", "0.8062656", "0.8062656", "0.8039062", "0.79941183", "0.798121", "0.79812...
0.8024531
18
Load a data frame from a CSV file. Given a file object, try to read the content as a CSV file and transform into a data frame. The skiprows and skipfooter are number of lines to skip from the top and bottom of the file (see read_csv in pandas). It also tries to convert as many columns as possible to date/time format (t...
def load_df_from_csvfile( file_obj, skiprows: Optional[int] = 0, skipfooter: Optional[int] = 0, ) -> pd.DataFrame: data_frame = pd.read_csv( file_obj, index_col=False, infer_datetime_format=True, quotechar='"', skiprows=skiprows, skipfooter=skipfooter, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_file_to_dataframe(filepath_or_buffer, sep=\"\\t\", skiprows=0, rollover=False, nrows=None, header=None, logger=None):\n if logger:\n logger.log_text(\"Converting file to a dataframe\", severity='INFO')\n\n try:\n # items to change to NaN/NULL\n # when you change something he...
[ "0.7119252", "0.70417553", "0.6923607", "0.6817885", "0.6736088", "0.67134184", "0.6707259", "0.65457904", "0.6527006", "0.6507526", "0.6431645", "0.640866", "0.63808787", "0.6379702", "0.6370109", "0.6365788", "0.6343902", "0.6339124", "0.63244754", "0.63121086", "0.630787",...
0.8287566
0
Set up the test run. Use configure_test_session() for any global test session and fixture logic.
def configure_test_session(request): logger.info('--------------') logger.info('request.session.__dict__: %s' % request.session.__dict__) # logger.info('request.config.__dict__: %s' % request.config.__dict__) logger.info('sys.argv: %s' % sys.argv) logger.info('--------------')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n self.client = app.test_client()\n app.config['TESTING'] = True\n\n connect_to_db(app, \"postgresql:///testdb\")\n\n db.create_all()\n example_data()\n\n add_test_user_to_session(self.client)", "def setUp(self):\n\n self.client = app.test_clien...
[ "0.7160453", "0.7160453", "0.7160453", "0.7160453", "0.7061421", "0.7046975", "0.7030291", "0.7015749", "0.69999224", "0.6980549", "0.6980549", "0.69424593", "0.6917109", "0.6914887", "0.69105345", "0.6903759", "0.6875413", "0.68675977", "0.6863532", "0.6857186", "0.6852287",...
0.6644037
58
Determine the browser driver to use based on the `browser` parameter specified at the command line. The request object is introspected for the desired parameter value.
def browser(request): this_browser = request.config.option.browser logger.info('this_browser = %s' % this_browser) return this_browser
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def driver(request, browser):\n logger.info(f\"Requested '{browser}' driver.\")\n driver = None\n\n if browser == 'chrome':\n driver = browser_chrome()\n elif browser == 'headless_chrome':\n driver = browser_chrome_headless()\n else:\n msg = f\"Error: '{browser}' is not a valid ...
[ "0.71898794", "0.69720924", "0.69720924", "0.6937348", "0.6878774", "0.6632229", "0.64911854", "0.64792496", "0.64777756", "0.6447881", "0.6371966", "0.6348554", "0.6313788", "0.6312645", "0.63064826", "0.6257727", "0.6256761", "0.62350637", "0.62084794", "0.6155656", "0.6091...
0.69844747
1
Create and return a new object. See help(type) for accurate signature.
def __new__(*args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cls, *args, **kwargs):\n return cls(*args, **kwargs)", "def _factory(*args_, **kwargs_):\n return ObsType(*args_, **kwargs_)", "def make_instance(self, cls, args, kw):\n return Object(cls, args, kw)", "def __new__(cls):\n raise TypeError(\"%s may not be instantiated.\" ...
[ "0.7055489", "0.6989148", "0.69420624", "0.6936614", "0.6922806", "0.6840023", "0.67875427", "0.6772222", "0.6772222", "0.67146224", "0.6670075", "0.66686094", "0.6654219", "0.6651621", "0.66416067", "0.66294825", "0.66165453", "0.6609483", "0.6592374", "0.6587368", "0.655850...
0.0
-1
Fill an area of the world
def fill(self, xrange, yrange, zrange, **block): self.apply(Section.fill, xrange, yrange, zrange, **block)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill(self, p, q, material):\n p = self._normalize_point_input(p)\n q = self._normalize_point_input(q)\n self._check_rect_ordering(p, q)\n q = q + 1\n if (self._grid.shape < q).any():\n q = self._grid.shape\n logger.debug(\"World fill %s %s\", p, q)\n ...
[ "0.6477238", "0.63382155", "0.6110915", "0.60636634", "0.60636634", "0.60636634", "0.60636634", "0.60425544", "0.6040088", "0.59909123", "0.59908867", "0.5954554", "0.5939859", "0.592318", "0.58680105", "0.5853757", "0.58471483", "0.5844933", "0.58237505", "0.5773546", "0.575...
0.59188
14
Returns the dict as a model
def from_dict(cls, dikt) -> 'ComAdobeCqDamIpsImplReplicationTriggerReplicateOnModifyWorkerProperties': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Provide json_hal style representation of the relation. This currently only makes sense for the socket api.
def json(self): return {self.rel: '{ "href": "%s" }' % self.href}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relation(self):\n return self.model.get_relation(self.endpoint)", "def fn_get_relationship(_id):\n\n if request.method == \"OPTIONS\":\n return\n\n response_doc = JsonAPIResponse(request.url)\n\n entry = self.model.select().where(\n self.m...
[ "0.66398597", "0.6517771", "0.6261722", "0.6261722", "0.6261722", "0.6261722", "0.62080675", "0.61858636", "0.61843073", "0.6178342", "0.6136653", "0.6133273", "0.6133273", "0.6133273", "0.6133273", "0.6133273", "0.6133273", "0.6133273", "0.6127787", "0.60676914", "0.5946621"...
0.0
-1
Returns location (in list form) of alignment gaps in a sequence
def find_alignment_gaps(alignment): return([char.start() for char in re.finditer("-", alignment)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gap_function(idx, len): # mandatory pass of 'idx' by 'pairwise2.align's 'x'\n if len == 0: # Asks if there's a gap\n return 0\n elif len == 1: # Gap\n return -1\n # Consecutive gaps\n return round(-((log(len) / 2) + (2 + (len / 4))), 2) # len = 1 ; return -2.25", "def find_met(s...
[ "0.6875816", "0.6550903", "0.6506576", "0.64148027", "0.62523544", "0.6223754", "0.61959285", "0.6187199", "0.61870795", "0.61688143", "0.6072402", "0.60515237", "0.6018527", "0.6009902", "0.60021836", "0.5852745", "0.58387303", "0.57974654", "0.57660997", "0.5741844", "0.573...
0.7249644
0
Assumes sql date string is in UTC
def sql_to_isostring(sql_datetime): timestamp_parts = str(sql_datetime).split(' ') return "{}T{}Z".format(timestamp_parts[0], timestamp_parts[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_date_tested(date_string: str) -> Any:\n try:\n date_time = datetime.strptime(date_string, f\"{MYSQL_DATETIME_FORMAT} %Z\")\n return date_time\n except:\n return None", "def _recogn_date(self, dtstring: str) -> datetime.timestamp:\r\n return datetime.strptime(dtstring, ...
[ "0.7275079", "0.6526415", "0.65219903", "0.6455195", "0.6382821", "0.6362601", "0.6306725", "0.6272897", "0.62215227", "0.62066525", "0.61899227", "0.6158013", "0.6146454", "0.61452323", "0.61452323", "0.60993814", "0.60993814", "0.60925037", "0.6078324", "0.60752445", "0.606...
0.0
-1
read the value for accelerometer X
def accel_x(self): return float(self.__angles[0]) - ZEROX
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadAccelerometer():\n global bus\n global addressAccelerometer\n global gPerCount\n\n # Read the data from the accelerometer chip\n try:\n [status, x, y, z] = bus.read_i2c_block_data(addressAccelerometer, 0, 4)\n except:\n Print('Failed reading registers!')\n status = 0\...
[ "0.7409183", "0.71850485", "0.7020053", "0.69257975", "0.68990123", "0.68086916", "0.6805828", "0.67960286", "0.6565254", "0.6475451", "0.6457464", "0.64408845", "0.6298683", "0.6295717", "0.6233736", "0.62211484", "0.62027323", "0.6156959", "0.61476684", "0.613363", "0.60986...
0.66477215
8
read the value for accelerometer Y
def accel_y(self): return float(self.__angles[1]) - ZEROY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getY(self):\n return self.getAcceleration(self.Axes.kY)", "def retrieveAccelerometerValues():\n Y = accelerometer.get_y()\n Y_norm = (Y - 1024)/(-2048)\n\n if Y_norm < 0.1: Y_norm = 0.0100\n\n return str(Y_norm)[:4] # 4 characters x.xx", "def get_y(self):\n os.write(self.i2c, ...
[ "0.7756516", "0.73981375", "0.70958674", "0.691933", "0.6873254", "0.6846936", "0.6800126", "0.67792434", "0.6764372", "0.676338", "0.6747153", "0.666899", "0.66425866", "0.6631157", "0.6626433", "0.6616176", "0.6610718", "0.656748", "0.6559178", "0.6558576", "0.6556039", "...
0.74097085
1