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
Not supported by Cloud Run Adapts a ConfigMap into a volume. The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths.
def __init__(__self__, *, default_mode: Optional[pulumi.Input[int]] = None, items: Optional[pulumi.Input[Sequence[pulumi.Input['KeyToPathArgs']]]] = None, name: Optional[pulumi.Input[str]] = None, optional: Optional[pulumi.Input[bool]] = None): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_configmap_dict():\n template = textwrap.dedent(\n \"\"\"\n kind: ConfigMap\n apiVersion: v1\n metadata:\n name: fio-config\n data:\n workload.fio: |\n # here comes workload configuration\n \"\"\"\n )\n cm_dict = yaml.safe_load(...
[ "0.5744717", "0.5617608", "0.5549652", "0.54460806", "0.5438244", "0.53842455", "0.5358757", "0.53583336", "0.5249196", "0.52384365", "0.5098135", "0.50381", "0.5018599", "0.49951723", "0.49566793", "0.49389467", "0.48652902", "0.48287538", "0.4816171", "0.481004", "0.4808808...
0.0
-1
Name of the config.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._config_name", "def name(self):\n return self.config[\"name\"]", "def name(self):\n return self._config.get(CONF_NAME)", "def get_config_name(self): # pragma: no cover\n pass", "def name(self) -> str:\n name = self._config[\"name\"]\n ...
[ "0.9289307", "0.900103", "0.888", "0.8742741", "0.86302376", "0.8557848", "0.83610666", "0.82853526", "0.81036574", "0.81036574", "0.8088234", "0.80755204", "0.7850279", "0.7764134", "0.7735627", "0.7684191", "0.7607658", "0.75998235", "0.7466778", "0.7379221", "0.73428404", ...
0.0
-1
(Optional) List of environment variables to set in the container.
def env(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EnvVarArgs']]]]: return pulumi.get(self, "env")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_vars(self):\n if self._m.spec and self._m.spec.container:\n return k8s_object.ListAsDictionaryWrapper(\n self._m.spec.container.env, self._messages.EnvVar)", "def env_variables(self) -> list[\"EnvVariable\"]:\n _args: list[Arg] = []\n _ctx = self._select(\"envVariables\", _...
[ "0.7302399", "0.7151558", "0.70579696", "0.70315427", "0.6932195", "0.6889495", "0.68694764", "0.68694764", "0.68694764", "0.68694764", "0.6863467", "0.68545204", "0.6790581", "0.6783857", "0.6770842", "0.67686325", "0.6753671", "0.6731841", "0.67308897", "0.6708214", "0.6680...
0.0
-1
(Optional) List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Val...
def env_from(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EnvFromSourceArgs']]]]: return pulumi.get(self, "env_from")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _preload_specific_vars(env_keys: Set[str]) -> Store:\n specified = {}\n\n for env_name, env_value in environ.items():\n if env_name not in env_keys:\n # Skip vars that have not been requested.\n continue\n\n specified[env_name] = env_value\n\n return specified", "...
[ "0.6108377", "0.6104904", "0.60834855", "0.5912744", "0.56587666", "0.5644212", "0.5485045", "0.54761356", "0.54761356", "0.54761356", "0.54761356", "0.54761356", "0.54761356", "0.5468026", "0.5418465", "0.53926504", "0.53569186", "0.5345714", "0.5327594", "0.5305151", "0.530...
0.5508455
6
Not supported by Cloud Run EnvFromSource represents the source of a set of ConfigMaps
def __init__(__self__, *, config_map_ref: Optional[pulumi.Input['ConfigMapEnvSourceArgs']] = None, prefix: Optional[pulumi.Input[str]] = None, secret_ref: Optional[pulumi.Input['SecretEnvSourceArgs']] = None): if config_map_ref is not None: pulumi.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_from(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EnvFromSourceArgs']]]]:\n return pulumi.get(self, \"env_from\")", "def config_map_ref(self) -> Optional[pulumi.Input['ConfigMapEnvSourceArgs']]:\n return pulumi.get(self, \"config_map_ref\")", "def env_config_no_cluster():\n # ...
[ "0.6126733", "0.5973674", "0.59183353", "0.585044", "0.58343333", "0.5737358", "0.57323873", "0.5708686", "0.5535899", "0.5425758", "0.5420068", "0.5374865", "0.5370628", "0.5357769", "0.52698195", "0.5266888", "0.52651215", "0.52415097", "0.52259463", "0.5212608", "0.5211623...
0.53835005
11
EnvVar represents an environment variable present in a Container.
def __init__(__self__, *, name: Optional[pulumi.Input[str]] = None, value: Optional[pulumi.Input[str]] = None, value_from: Optional[pulumi.Input['EnvVarSourceArgs']] = None): if name is not None: pulumi.set(__self__, "name", name) if value i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env(var):\n return os.environ[var]", "def with_env_variable(\n self,\n name: str,\n value: str,\n expand: Optional[bool] = None,\n ) -> \"Container\":\n _args = [\n Arg(\"name\", name),\n Arg(\"value\", value),\n Arg(\"expand\", expand...
[ "0.6759011", "0.64400876", "0.6365067", "0.6353957", "0.6332777", "0.63078386", "0.6261371", "0.61820585", "0.60630727", "0.6052506", "0.6047019", "0.6040598", "0.6039395", "0.6014736", "0.5986097", "0.59742486", "0.5959875", "0.59374666", "0.5901712", "0.58948684", "0.585241...
0.0
-1
Name of the environment variable. Must be a C_IDENTIFIER.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._env_name", "def environment_variable_string(self, name):\n return \"$(\" + name + \")\"", "def windows_get_env_value(var_name: str) -> str:\n if var_name in os.environ.keys():\n return os.environ[var_name]", "def name(self):\n return get_env_name(...
[ "0.70802695", "0.7018171", "0.6868062", "0.6834877", "0.67369395", "0.66342175", "0.66094714", "0.6516576", "0.64875805", "0.64858514", "0.64271265", "0.6414439", "0.63760257", "0.6328405", "0.6301504", "0.6299338", "0.62456506", "0.6227602", "0.62041265", "0.6174423", "0.615...
0.0
-1
(Optional) Source for the environment variable's value. Only supports secret_key_ref. Source for the environment variable's value. Cannot be used if value is not empty.
def value_from(self) -> Optional[pulumi.Input['EnvVarSourceArgs']]: return pulumi.get(self, "value_from")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def secret_ref(self) -> Optional[pulumi.Input['SecretEnvSourceArgs']]:\n return pulumi.get(self, \"secret_ref\")", "def env(key, default=None, required=False):\n try:\n value = os.environ[key]\n return ast.literal_eval(value)\n except (SyntaxError, ValueError):\n return value\n ...
[ "0.71934897", "0.63627815", "0.6333269", "0.62673974", "0.62057745", "0.61730945", "0.6144166", "0.6106853", "0.6016373", "0.5989732", "0.5941679", "0.5933719", "0.593046", "0.5930429", "0.59206", "0.59052", "0.5904231", "0.5878072", "0.5872714", "0.5862441", "0.582083", "0...
0.6126485
7
Instance represents the status of an instance of a Job.
def __init__(__self__, *, index: pulumi.Input[int], completion_time: Optional[pulumi.Input[str]] = None, failed: Optional[pulumi.Input[int]] = None, last_attempt_result: Optional[pulumi.Input['InstanceAttemptResultArgs']] = None, last_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.job_proto.status", "def __init__(self, job_id=None, version=None, status=None, exit_status=None, exit_message=None, create_time=None, start_time=None, end_time=None, last_updated=None):\n self.swagger_types = {\n 'job_id': str,\n 'version': str,...
[ "0.6462175", "0.61865467", "0.60609454", "0.6053399", "0.6006992", "0.593759", "0.5928221", "0.5908596", "0.58781046", "0.58457166", "0.5824061", "0.57867974", "0.5785409", "0.5780187", "0.5755853", "0.5748484", "0.5725299", "0.56765926", "0.5662594", "0.5618687", "0.561749",...
0.0
-1
JobSpec describes how the job execution will look like.
def __init__(__self__, *, active_deadline_seconds: Optional[pulumi.Input[str]] = None, backoff_limit: Optional[pulumi.Input[int]] = None, completions: Optional[pulumi.Input[int]] = None, parallelism: Optional[pulumi.Input[int]] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetJobResourceSpec():\n\n return concepts.ResourceSpec(\n 'transcoder.projects.locations.jobs',\n resource_name='job',\n jobsId=JobAttributeConfig(),\n projectsId=concepts.DEFAULT_PROJECT_ATTRIBUTE_CONFIG,\n locationsId=LocationAttributeConfig(),\n disable_auto_completers=False)"...
[ "0.6773472", "0.67653096", "0.66373944", "0.6469954", "0.6371339", "0.6026661", "0.5847633", "0.5825256", "0.5799035", "0.568238", "0.568238", "0.56763136", "0.5635657", "0.5591291", "0.55634", "0.5554076", "0.5549275", "0.5539543", "0.5536857", "0.55347055", "0.54636157", ...
0.0
-1
JobStatus represents the current state of a Job.
def __init__(__self__, *, active: Optional[pulumi.Input[int]] = None, completion_time: Optional[pulumi.Input[str]] = None, conditions: Optional[pulumi.Input[Sequence[pulumi.Input['JobConditionArgs']]]] = None, failed: Optional[pulumi.Input[int]] = None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.job_proto.status", "def job_status(self) -> JobStatus:\n statuses = set()\n with self._jobs.lock:\n\n # No jobs present\n if not self._jobs:\n return JobStatus.DONE\n\n statuses = set()\n for job in se...
[ "0.7864789", "0.7610603", "0.75128347", "0.74057335", "0.73458374", "0.73195654", "0.72146606", "0.70527756", "0.70513207", "0.7020673", "0.6944766", "0.6921074", "0.69032824", "0.6850882", "0.67401177", "0.66968894", "0.6669855", "0.6602117", "0.6587272", "0.65768135", "0.65...
0.0
-1
Optional. ImageDigest holds the resolved digest for the image specified within .Spec.Template.Spec.Container.Image. The digest is resolved during the creation of the Job. This field holds the digest value regardless of whether a tag or digest was originally specified in the Container object.
def image_digest(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "image_digest")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_digest(image: Image) -> Optional[str]:\n digests = image.attrs.get('RepoDigests')\n if digests:\n tag, digest = split_image(digests[0])\n return digest\n return None", "def image_digest(self):\n return self.status.imageDigest", "def get_image_digest(image):\n namespac...
[ "0.6867021", "0.65372026", "0.64070755", "0.6134416", "0.59073645", "0.57376146", "0.56289667", "0.56052023", "0.55419403", "0.5459043", "0.53803617", "0.53643703", "0.53504753", "0.531144", "0.5309617", "0.5270141", "0.526638", "0.5261127", "0.52579725", "0.5254731", "0.5250...
0.71737665
0
The Cloud Secret Manager secret version. Can be 'latest' for the latest value or an integer for a specific version. The key to project.
def key(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "key")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_version(self) -> Optional[str]:\n return pulumi.get(self, \"key_version\")", "def google_secret(secret_id, version_id):\n\n project_id = os.getenv('PROJECT_ID')\n name = f\"projects/{project_id}/secrets/{secret_id}/versions/{version_id}\"\n\n # Access the secret version\n client = secr...
[ "0.7122168", "0.6991335", "0.68964076", "0.68803936", "0.6506205", "0.6445297", "0.6393099", "0.63741", "0.63544875", "0.63544875", "0.63544875", "0.63544875", "0.63544875", "0.63496536", "0.63380927", "0.62975067", "0.62853646", "0.62816596", "0.6273459", "0.6271435", "0.626...
0.0
-1
(Optional) Not supported by Cloud Run The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
def cluster_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "cluster_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_name(self):\n return self.name", "def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")", "def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")", "def cluster_name(self):\n return self._data['cluster_name']", "def resource_t...
[ "0.73518974", "0.71606237", "0.71606237", "0.70352846", "0.6963688", "0.6864017", "0.6864017", "0.6813997", "0.67043173", "0.6400719", "0.633979", "0.631315", "0.6309727", "0.62140137", "0.62140137", "0.62140137", "0.62140137", "0.62140137", "0.61818075", "0.6089117", "0.6067...
0.6966826
8
OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.
def __init__(__self__, *, api_version: Optional[pulumi.Input[str]] = None, block_owner_deletion: Optional[pulumi.Input[bool]] = None, controller: Optional[pulumi.Input[bool]] = None, kind: Optional[pulumi.Input[str]] = None, name: Opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_owner_object(self):\n return None", "def get_owner_object(self):\n return None", "def get_owner_object(self):\n return None", "def owner(self):\n return self.__owner", "def owner(self):\n return self._owner", "def owner(self):\n return self._owner", "de...
[ "0.7421275", "0.7421275", "0.7421275", "0.7263003", "0.7230314", "0.7230314", "0.7230314", "0.7230314", "0.7230314", "0.71073496", "0.7103023", "0.70496035", "0.704022", "0.69802237", "0.69325036", "0.6929792", "0.6929792", "0.6929792", "0.6929792", "0.692424", "0.692424", ...
0.0
-1
Not supported by Cloud Run SecretEnvSource selects a Secret to populate the environment variables with. The contents of the target Secret's Data field will represent the keyvalue pairs as environment variables.
def __init__(__self__, *, local_object_reference: Optional[pulumi.Input['LocalObjectReferenceArgs']] = None, name: Optional[pulumi.Input[str]] = None, optional: Optional[pulumi.Input[bool]] = None): if local_object_reference is not None: pulumi.set(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_secrets():\n for name, value in Secrets.__dict__.items():\n if name[0] != '_':\n os.environ[name] = value", "def google_kms_encrypted_env_secret(secret_key: str) -> str:\n\n key_id = os.getenv('KEY_ID')\n ciphertext = os.getenv(secret_key)\n\n client = kms.KeyManagementSer...
[ "0.60752493", "0.601176", "0.59430647", "0.59132504", "0.58095104", "0.56137127", "0.5593729", "0.5570865", "0.54740936", "0.53899324", "0.53886354", "0.53873754", "0.5317123", "0.5278417", "0.5257236", "0.523228", "0.52037525", "0.5201968", "0.5192194", "0.5165596", "0.51655...
0.0
-1
A Cloud Secret Manager secret version. Must be 'latest' for the latest version or an integer for a specific version. The key of the secret to select from. Must be a valid secret key.
def key(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "key")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_secret_helper(project_id, secret_id, version_id):\n\n # Import the Secret Manager client library.\n from google.cloud import secretmanager\n\n # Create the Secret Manager client.\n client = secretmanager.SecretManagerServiceClient()\n\n # Build the resource name of the se...
[ "0.71157587", "0.6968846", "0.6624672", "0.6571224", "0.633893", "0.62523496", "0.62523496", "0.62177235", "0.61889213", "0.61774534", "0.61278814", "0.6090768", "0.6090768", "0.60588276", "0.60588276", "0.60466135", "0.60466135", "0.59829944", "0.5980519", "0.5966618", "0.59...
0.0
-1
(Optional) The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
def run_as_user(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "run_as_user")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_as_user(self) -> Optional[pulumi.Input['RunAsUserStrategyOptionsPatchArgs']]:\n return pulumi.get(self, \"run_as_user\")", "def run_as_user(self) -> pulumi.Input['RunAsUserStrategyOptionsArgs']:\n return pulumi.get(self, \"run_as_user\")", "def __init__(__self__, *,\n run_...
[ "0.5694958", "0.5582308", "0.55699027", "0.55025446", "0.55025446", "0.55025446", "0.5383794", "0.53576416", "0.532736", "0.5301375", "0.5252773", "0.51381266", "0.51381266", "0.51381266", "0.5128512", "0.5105636", "0.50889754", "0.50889754", "0.5068004", "0.5068004", "0.5068...
0.5748138
0
Converts CamelCase to camel/case
def camelcase_to_slash(name): s1 = re.sub('(.)([A-Z][a-z]+)', r'\1/\2', name) return re.sub('([a-z0-9])([A-Z])', r'\1/\2', s1).lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_camel_case(name):\n s1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', name)\n return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', s1).lower()", "def _to_camel_case(text: str) -> str:\n return \"\".join(word.title() for word in text.split(\"_\"))", "def camel_filter(val):\n titlecase = val.title()\...
[ "0.7911187", "0.78807104", "0.78780276", "0.7830923", "0.7808882", "0.7789713", "0.77685255", "0.76968247", "0.7567583", "0.7567583", "0.7561699", "0.7445506", "0.7436963", "0.742293", "0.7415548", "0.740523", "0.73967075", "0.73182094", "0.7305003", "0.7273591", "0.7261134",...
0.0
-1
Construct the CNN model. Please add your model implementation here, and don't forget compile the model E.g., model.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy']) NOTE, You must include 'accuracy' in as one of your metrics, which will be used for marking later.
def construct_model(): # model = Sequential() # model.add(Dense(units=64, activation='relu', input_dim=100)) # model.add(Dense(units=10, activation='softmax')) # model.compile(loss='categorical_crossentropy', # optimizer='sgd', # metrics=['accuracy']) # return model model = Sequential()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_model(self):\n self.model = models.Sequential()\n self.model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)))\n self.model.add(layers.MaxPooling2D((2, 2)))\n self.model.add(layers.Conv2D(64, (3, 3), activation='relu'))\n self.model.add(layers.M...
[ "0.79456466", "0.79212743", "0.7686114", "0.76486915", "0.76392126", "0.7635981", "0.75947803", "0.7569121", "0.75226474", "0.75211334", "0.7417097", "0.73896503", "0.7346301", "0.73286694", "0.73157644", "0.7301205", "0.72698367", "0.7245011", "0.7114825", "0.7064717", "0.70...
0.76434857
4
Combine the terminal with another object to form production alternatives (use |). Examples Create two productions the first of which consist of the terminal 'A' and second of the terminals 'B' and 'C'. >>> productions = Terminal('A') | Terminal('B') + Terminal('C')
def __or__(self, other): if isinstance(other, (Terminal, NonTerminal, Epsilon)): return ProductionAlternatives(Production(self), Production(other)) elif isinstance(other, Production): return ProductionAlternatives(Production(self), other) else: raise TypeError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __or__(self, vs):\n return self + vs", "def Chain(A, B):\n return _prodOperator(B, A)", "def add_prod(self, lhs, rhs):\n prods = rhs.split('|')\n for prod in prods:\n self.prod[lhs].append(tuple(prod.split()))", "def add_prod(self, lhs, rhs):\n prods = rhs.split(...
[ "0.55170304", "0.544974", "0.54385304", "0.54385304", "0.53720623", "0.53319055", "0.531151", "0.52737933", "0.52634203", "0.5247733", "0.51643527", "0.5116959", "0.5114968", "0.50224495", "0.5021469", "0.5017608", "0.500951", "0.50039524", "0.5002328", "0.49903506", "0.49730...
0.6681073
0
Rotate vector(s) v about the rotation described by quaternion(s) q. Expects a tensor of shape (, 4) for q and a tensor of shape (, 3) for v, where denotes any number of dimensions. Returns a tensor of shape (, 3).
def qrot(q, v): assert q.shape[-1] == 4 assert v.shape[-1] == 3 assert q.shape[:-1] == v.shape[:-1] original_shape = v.shape q = q.view(-1, 4) v = v.view(-1, 3) qvec = q[:, 1:] uv = torch.cross(qvec, v, dim=1) uuv = torch.cross(qvec, uv, dim=1) return (v + 2 * (q[:, :1] * uv + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qrot(q, v):\n assert q.shape[-1] == 4\n assert v.shape[-1] == 3\n assert q.shape[:-1] == v.shape[:-1]\n\n qvec = q[..., 1:]\n uv = torch.cross(qvec.double(), v.double(), dim=len(q.shape) - 1)\n uuv = torch.cross(qvec.double(), uv.double(), dim=len(q.shape) - 1)\n return v + 2 * (q[..., :1]...
[ "0.8551022", "0.78475237", "0.7787734", "0.77644026", "0.77644026", "0.7758607", "0.77115434", "0.7691528", "0.7535044", "0.72164655", "0.7015739", "0.69000125", "0.6890444", "0.68645215", "0.68507963", "0.68471056", "0.6750162", "0.67375624", "0.6702305", "0.6638015", "0.662...
0.8495022
1
The identity block is the block that has no conv layer at shortcut. Arguments
def identity_block(input_tensor, kernel_size, filters, stage, block,use_bias=True,dilation_rate=(1, 1), train_bn=None): filters1, filters2, filters3 = filters if K.image_data_format() == 'channels_last': bn_axis = 3 else: bn_axis = 1 conv_name_base = 'res' + str(stage) + block + '_branch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.6847176", "0.68221945", "0.6821999", "0.680346", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.65984523", "0.65485...
0.6799615
9
A block that has a conv layer at shortcut. Arguments
def conv_block(input_tensor, kernel_size, filters, stage, block,use_bias=True, strides=(2, 2),dilation_rate=(1, 1), train_bn=None): filters1, filters2, filters3 = filters if K.image_data_format() == 'channels_last': bn_axis = 3 else: bn_axis = 1 conv_name_base = 'res' + str(stage) + bloc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_block(self, output_channel, filter_, activate):\n return self.add_layer(conv_block, output_channel, filter_, activate)", "def _convolution_block(self, X, filters, f, s, stage, block):\n\n\t\tconv_layer_name = 'res' + str(stage) + block + '_branch'\n\t\tbn_layer_name = 'bn' + str(stage) + block + ...
[ "0.7221446", "0.6798087", "0.6750911", "0.67348516", "0.6702807", "0.6671218", "0.667007", "0.6638267", "0.6601988", "0.6601988", "0.65986586", "0.6559304", "0.65571326", "0.6553661", "0.6532663", "0.65105", "0.6508215", "0.6479328", "0.6422139", "0.641241", "0.6390166", "0...
0.6258997
38
Mutate the matrix by perturbing one weight by a standard normal
def mutate_matrix(matrix): L = len(matrix) r_i = random.randrange(L) r_j = random.randrange(4) r = random.gauss(0,1) return [[matrix[i][j]+r*(i==r_i)*(j==r_j) for j in range(4)] for i in range(L)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mutate_weights(self, weights):\n return weights + normal(loc=0, scale=self.standard_deviation, size=weights.shape[0])", "def mutate(weights,gen):\n mutated_weights = []\n for weight in weights:\n new_weight = np.random.normal(loc=weight, scale=0.5/(gen+1))\n if new_weight >= -1 an...
[ "0.7454254", "0.64523524", "0.64157224", "0.63913834", "0.63850635", "0.6366946", "0.6336361", "0.63063294", "0.62522304", "0.6220063", "0.62049687", "0.614735", "0.6080485", "0.606653", "0.6050566", "0.604115", "0.60385996", "0.6024655", "0.60095763", "0.6003709", "0.5958575...
0.0
-1
Shows detailed information about the guild
async def _server(self, ctx: commands.Context) -> None: guild = ctx.guild embed = CleanEmbed( author_image=guild.icon_url, author_text=guild.name, thumbnail_url=guild.icon_url, fields=[ {'name': 'Owner', 'value': f'{guild.owner.name}#{gui...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def server_info(self, ctx):\n guild = ctx.guild\n id = guild.id\n boost_count = guild.premium_subscription_count\n region = str(guild.region)\n channels = len(guild.channels)\n vc = len(guild.voice_channels)\n text_channels = len(guild.text_channels)\n ...
[ "0.7573736", "0.75052017", "0.74754894", "0.7311987", "0.7265787", "0.7236074", "0.7154301", "0.7087745", "0.69484943", "0.6918941", "0.6815126", "0.6812217", "0.6763733", "0.67358017", "0.673238", "0.66851336", "0.6648527", "0.66124135", "0.6604795", "0.657943", "0.6524669",...
0.6849063
10
Get the state of this virus particle's resistance to a drug. This method is called by getResistPop() in Patient to determine how many virus particles have resistance to a drug.
def isResistantTo(self, drug): # Assuming the virus is resistant to an unknown drug return self.resistances.get(drug, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getResistPop(self, drugResist):\n\n # Variable to hold the number of resistant viruses\n virus_pop = 0\n\n # Checks each virus in viruses of a patient\n for virus in self.viruses:\n drugsResisted = 0\n for drug in drugResist:\n if virus.isResista...
[ "0.6919469", "0.6856316", "0.67024064", "0.65478116", "0.58350253", "0.5780054", "0.5780054", "0.5584333", "0.5423803", "0.5413626", "0.53796405", "0.5349921", "0.5327192", "0.5321123", "0.5294998", "0.5290551", "0.52852607", "0.5264033", "0.524149", "0.52350664", "0.52097785...
0.5442036
8
Administer a drug to this patient. After a prescription is added, the drug acts on the virus population for all subsequent time steps. If the newDrug is already prescribed to this patient, the method has no effect.
def addPrescription(self, newDrug): self.administeredDrugs.append(newDrug)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addPrescription(self, newDrug):\n\n if newDrug not in self.Prescriptions:\n self.Prescriptions.append(newDrug)", "def addPrescription(self, newDrug):\n if self.prescriptions.count(newDrug) == 0:\n self.prescriptions.append(newDrug)", "def illicit_drug(self, illicit_drug)...
[ "0.70781976", "0.66606057", "0.5629379", "0.53475857", "0.49276462", "0.47996816", "0.45724362", "0.4522651", "0.44906902", "0.44906253", "0.44545615", "0.44016516", "0.43617645", "0.43501145", "0.43469536", "0.4337187", "0.4316035", "0.43119177", "0.43059728", "0.43037888", ...
0.8208984
0
Assert that an Invitation can be stored in the service.
def test_create_invitation(session): invitation = factory_invitation_model(session=session, status='PENDING') session.add(invitation) session.commit() assert invitation.id is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invited(self) -> None:\n\n self._perform_background_initial_update()\n\n u1 = self.register_user(\"u1\", \"pass\")\n u1token = self.login(\"u1\", \"pass\")\n r1 = self.helper.create_room_as(u1, tok=u1token)\n\n u2 = self.register_user(\"u2\", \"pass\")\n\n r1stats...
[ "0.6598242", "0.6533879", "0.63761723", "0.628309", "0.61816716", "0.60996914", "0.60878426", "0.6076657", "0.60712063", "0.6062772", "0.60414684", "0.60027367", "0.5993242", "0.5974805", "0.59531873", "0.5927374", "0.5924788", "0.5893914", "0.5880523", "0.5855782", "0.580468...
0.68093157
0
Assert that an Invitation can retrieved by the user id.
def test_find_invitations_by_user(session): # pylint:disable=unused-argument invitation = factory_invitation_model(session=session, status='PENDING') session.add(invitation) session.commit() retrieved_invitation = InvitationModel.find_invitations_by_user(invitation.sender_id) assert len(retrieved_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_invitation_by_id(session): # pylint:disable=unused-argument\n invitation = factory_invitation_model(session=session, status='PENDING')\n session.add(invitation)\n session.commit()\n\n retrieved_invitation = InvitationModel.find_invitation_by_id(invitation.id)\n assert retrieved_invita...
[ "0.6765188", "0.65797085", "0.6473937", "0.6466358", "0.64187866", "0.62600297", "0.6247256", "0.6247256", "0.62020624", "0.6161826", "0.6155115", "0.6147737", "0.6113573", "0.60275775", "0.6025673", "0.60181934", "0.6015921", "0.59284234", "0.5925579", "0.5917897", "0.591280...
0.7005724
0
Assert that an Invitation can be updated.
def test_update_invitation_as_retried(session): # pylint:disable=unused-argument invitation = factory_invitation_model(session=session, status='FAILED') session.add(invitation) session.commit() invitation.update_invitation_as_retried() assert invitation assert invitation.invitation_status_code ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validates_email_not_already_invited_on_update(self):\n # Make an invitation that we will modify\n invitation = self.project.invitations.create(email = 'jane.doe@example.com')\n # Make a second invitation with a different email address\n self.project.invitations.create(email = '...
[ "0.6871184", "0.6724529", "0.6522729", "0.63894767", "0.61892426", "0.60847694", "0.6081069", "0.6066777", "0.60447204", "0.6042557", "0.60149854", "0.60050905", "0.59994316", "0.59979796", "0.59979796", "0.59979796", "0.599347", "0.59689885", "0.5965268", "0.5937042", "0.593...
0.641412
3
Assert that Invitations for a specified org can be retrieved.
def test_find_invitations_by_org(session): # pylint:disable=unused-argument invitation = factory_invitation_model(session=session, status='PENDING') session.add(invitation) session.commit() found_invitations = InvitationModel.find_invitations_by_org(invitation.membership[0].org_id) assert found_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_pending_invitations_by_org(session): # pylint:disable=unused-argument\n invitation = factory_invitation_model(session=session, status='PENDING')\n session.add(invitation)\n session.commit()\n\n retrieved_invitation = InvitationModel.find_pending_invitations_by_org(invitation.membership[0...
[ "0.7499905", "0.7057651", "0.6044612", "0.5954999", "0.5946406", "0.5893454", "0.58842784", "0.58737093", "0.58502394", "0.58146435", "0.5813813", "0.580076", "0.5800233", "0.57933205", "0.5791429", "0.5761049", "0.5753965", "0.5733868", "0.5678464", "0.5670789", "0.56496835"...
0.79871935
0
Assert that an Invitation can retrieved by the user id.
def test_find_pending_invitations_by_user(session): # pylint:disable=unused-argument invitation = factory_invitation_model(session=session, status='PENDING') session.add(invitation) session.commit() retrieved_invitation = InvitationModel.find_pending_invitations_by_user(invitation.sender_id) asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_invitations_by_user(session): # pylint:disable=unused-argument\n invitation = factory_invitation_model(session=session, status='PENDING')\n session.add(invitation)\n session.commit()\n\n retrieved_invitation = InvitationModel.find_invitations_by_user(invitation.sender_id)\n assert len...
[ "0.70082533", "0.6768077", "0.6583369", "0.64745814", "0.64220476", "0.6260719", "0.6245635", "0.6245635", "0.620534", "0.6164501", "0.61578953", "0.6150711", "0.6113398", "0.60269326", "0.6026292", "0.601953", "0.6014456", "0.5927966", "0.592738", "0.5914951", "0.59128845", ...
0.646825
4
Assert that an Invitation can retrieved by the org id.
def test_find_pending_invitations_by_org(session): # pylint:disable=unused-argument invitation = factory_invitation_model(session=session, status='PENDING') session.add(invitation) session.commit() retrieved_invitation = InvitationModel.find_pending_invitations_by_org(invitation.membership[0].org_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_invitations_by_org(session): # pylint:disable=unused-argument\n invitation = factory_invitation_model(session=session, status='PENDING')\n session.add(invitation)\n session.commit()\n\n found_invitations = InvitationModel.find_invitations_by_org(invitation.membership[0].org_id)\n asse...
[ "0.7058797", "0.6586798", "0.63994974", "0.6220015", "0.61890185", "0.61088693", "0.60194165", "0.5968376", "0.59523827", "0.5920788", "0.59006757", "0.58994067", "0.58802795", "0.5838587", "0.5804246", "0.5768285", "0.5747542", "0.572735", "0.5672087", "0.56679237", "0.56579...
0.6571146
2
Assert that an Invitation can retrieved by the user id.
def test_invitations_by_status(session): # pylint:disable=unused-argument invitation = factory_invitation_model(session=session, status='PENDING') session.add(invitation) session.commit() retrieved_invitation = InvitationModel.find_invitations_by_status(invitation.sender_id, 'FAILED') assert len(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_invitations_by_user(session): # pylint:disable=unused-argument\n invitation = factory_invitation_model(session=session, status='PENDING')\n session.add(invitation)\n session.commit()\n\n retrieved_invitation = InvitationModel.find_invitations_by_user(invitation.sender_id)\n assert len...
[ "0.7005724", "0.6765188", "0.65797085", "0.6473937", "0.6466358", "0.64187866", "0.62600297", "0.6247256", "0.6247256", "0.62020624", "0.6161826", "0.6155115", "0.6147737", "0.6113573", "0.60275775", "0.6025673", "0.60181934", "0.6015921", "0.59284234", "0.5925579", "0.591789...
0.56685525
47
Hashes a users password. >>> hash_password('123456') 'f8cdb04495ded4761525'
def hash_password(password): return hashlib.sha224(password).hexdigest()[:20]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_passwd(password, hash_method=\"sha256\"):\n\n return generate_password_hash(password, hash_method)", "def hash_password(password):\n return hashlib.md5(password).hexdigest()", "def hash_password(password):\n salt = hashlib.md5(password.encode())\n return salt.hexdigest()", "def hash_...
[ "0.8334604", "0.8276079", "0.81635815", "0.8052726", "0.8037033", "0.7965848", "0.79459155", "0.79436976", "0.79416233", "0.7922091", "0.7913242", "0.78741276", "0.78449845", "0.78449845", "0.78449845", "0.7844944", "0.7838986", "0.7825187", "0.7810522", "0.78016955", "0.7769...
0.792101
10
Converts a list of trip entities into a modified dictionary. >>> e1 = Event(event_name = 'Hackbright', starts_at = datetime(2016, 9, 14, 0, 0, 0)) >>> m1 = Meeting(meeting_subject = 'Go Karting', starts_at = datetime(2016, 9, 14, 5, 0, 0)) >>> trip_entities = [e1, m1] >>> create_trip_entities_dict(trip_entities)
def create_trip_entities_dict(trip_entities): trip_entities = [entity.__dict__ for entity in trip_entities] for entity in trip_entities: if "_sa_instance_state" in entity: del entity["_sa_instance_state"] if "starts_at" in entity: entity["start_time"] = entity["starts_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_entities(self, data):\r\n\t\t# create an empty dictionary to hold entities\r\n\t\tent_dic = {}\r\n\r\n\t\tfor row in data.itertuples():\r\n\t\t\t# feed nlp the first line's set of keywords\r\n\t\t\tdoc = self.nlp(row.keywords)\t\r\n\t\t\t# begin iterating through the nlp's entities\r\n\t\t\tfor ent in...
[ "0.59330904", "0.5796995", "0.5477478", "0.51371986", "0.50450075", "0.50368917", "0.49683827", "0.49615437", "0.49365598", "0.4935318", "0.49269828", "0.48732376", "0.48430148", "0.4833741", "0.48173618", "0.48017114", "0.47893798", "0.47883683", "0.475298", "0.4722285", "0....
0.83001906
0
config vem do pytestflask
def test_config_is_loaded(config): assert config["DEBUG"] is False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_config():\n\n # assert create_app().testing\n assert create_app(\"testing\", settings={\n \"TESTING\": True,\n \"SQLALCHEMY_TRACK_MODIFICATIONS\": False\n }).testing", "def test_config(app):\n assert app.testing", "def test_config():\n assert not sample.create_app().testin...
[ "0.7066745", "0.7031013", "0.68879503", "0.6688816", "0.66499424", "0.65846634", "0.6523696", "0.64806455", "0.64796376", "0.6459144", "0.6379308", "0.6346656", "0.63368934", "0.63285035", "0.6237353", "0.6199135", "0.6186742", "0.6165036", "0.6155194", "0.6142941", "0.608641...
0.0
-1
Chooses a random mutation type based on mutation probabilities.
def get_random_mutation_type(self): return self.random_state.choice( self.mutation_types, p=self.mutation_probabilities)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutate(self):\n #mutation_size = max(1,int(round(random.gauss(15,4))))/100\n\n\n\n mutation_size = max(1,int(round(random.gauss(15,4))))/100\n \"\"\"\n Changed the mutation by using random.randint rather than the gaussian one \n after observing that the gaussian random never ...
[ "0.6571593", "0.6339093", "0.6234432", "0.62333727", "0.6213886", "0.62068486", "0.61974835", "0.6156622", "0.61490154", "0.61143494", "0.6077504", "0.60190576", "0.6011488", "0.599087", "0.5955219", "0.59421235", "0.59073347", "0.5903635", "0.58468455", "0.58281", "0.5826249...
0.82146
0
Get area in km^2 after reprojection.
def km2_area(polygons): reprojected_polygons = [reproject(p) for p in polygons] return ops.cascaded_union(reprojected_polygons).area * 1e-6
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area(\n self):\n pi = numpy.pi\n area0 = 4.0 * pi / 8.0\n areadiv = 4.0 ** self.depth\n area = area0 / areadiv * (180.0 / pi) ** 2\n return area", "def area(self):\n area = 0\n last = self._coordinates[-1]\n for c in self._coordinates:\n ...
[ "0.6812882", "0.67852825", "0.6729171", "0.6721389", "0.6671579", "0.6569876", "0.6498827", "0.6494643", "0.64915043", "0.6472188", "0.6450688", "0.645012", "0.64472353", "0.64361376", "0.6434617", "0.6430422", "0.6392026", "0.63885665", "0.6385873", "0.6363714", "0.63558227"...
0.71593785
0
Plot image with subplot. Requires image and subplot location (ie. (1,2,1)). You can also set title.
def plot_array(array, subplot_ijk, title="", font_size=18, cmap=None): sp = plt.subplot(*subplot_ijk) sp.set_title(title, fontsize=font_size) plt.axis('off') plt.imshow(array, cmap=cmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_image(img, label=\"\"): \n if img.shape[0] == 3:\n img = img.transpose(1,2,0)\n fig,ax = plt.subplots(1)\n sns.set_style('white')\n ax.imshow(np.asarray(img))\n if label!=\"\":\n plt.title(number_label[label])\n return fig,ax", "def subplot_image_and_mapper(\r\n se...
[ "0.7116965", "0.6945312", "0.6673151", "0.6663349", "0.66338056", "0.65664774", "0.64825416", "0.6429361", "0.6358112", "0.63123095", "0.63123095", "0.63123095", "0.627812", "0.6262092", "0.6225436", "0.62118477", "0.62042576", "0.6193083", "0.61527634", "0.61469394", "0.6135...
0.62779784
13
Verify that the response code for the create chassis request is correct.
def test_create_chassis_response_code(self): self.assertEqual(self.create_chassis_resp.status_code, 201)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assert_success(self,code):\n if code == constants.response.SSH_AGENT_FAILURE:\n raise SshAgentOperationFailed()\n elif code != constants.response.SSH_AGENT_SUCCESS:\n raise ValueError('The SSH agent responded using an unknown result code ({})'.format(code))", "def test_uc...
[ "0.6570777", "0.6245206", "0.6229654", "0.61239636", "0.603671", "0.6023078", "0.6004484", "0.5999776", "0.5994532", "0.5975004", "0.5970505", "0.59513444", "0.5934519", "0.5894403", "0.5890529", "0.5873654", "0.5844321", "0.5844321", "0.5841847", "0.5836892", "0.5807992", ...
0.8938018
0
The initializer for the linear deparator class (neural network with diagonal weight matrices)
def __init__(self, d, init, depth, **kwargs): self.d = d self.init = init self.depth = depth super(Separator, self).__init__(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, layerNeurons, numberOfLayers, initialWeights = None, lowerBound = None, upperBound = None):\r\n \r\n # Ensure that there is at-least one input and one output layer in the network\r\n assert len(layerNeurons) > 1, \"At least one input layer and one output layer is...
[ "0.70310944", "0.6938409", "0.6912774", "0.68544775", "0.6759965", "0.67232704", "0.6702559", "0.6669329", "0.66547585", "0.66215545", "0.6611091", "0.6600073", "0.65947676", "0.65913355", "0.6572858", "0.6548509", "0.6537771", "0.65328485", "0.6520625", "0.65043694", "0.6499...
0.0
-1
Checks if current user is valid, if signed out, it returns False, if user object is None it returns False
def validUser(self): if self.state == SessionStates.LOGGED_OUT: return False # if self.user == None: # return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid(self):\n return self.user.is_authenticated", "def logged_in(self):\n return self.auth.get_user_by_session() is not None", "def check(self):\n\n us = ServiceLocator.resolve(ServiceLocator.USERS)\n\n user_session = self.get()\n user = self.get_user()\n\n return ...
[ "0.7327295", "0.7115255", "0.70264876", "0.7008974", "0.69679374", "0.6918204", "0.6809665", "0.6788192", "0.6776219", "0.6730842", "0.6693477", "0.66762197", "0.66742283", "0.65988153", "0.6539529", "0.6508916", "0.64799225", "0.64781046", "0.6462319", "0.64581794", "0.64479...
0.8459481
0
Hash a password for storing.
def hash_password(password): salt = hashlib.sha256(os.urandom(60)).hexdigest().encode('ascii') pwdhash = hashlib.pbkdf2_hmac('sha512', password.encode('utf-8'), salt, 100000) pwdhash = binascii.hexlify(pwdhash) return (salt + pwdhash).decode('ascii')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_password(self):\n self.__password = self.str_to_hash(self.__password)", "def hash_password(self, password):\n self.password = pwd_context.encrypt(password)", "def hash_password(self, password):\n self.password_hash = generate_password_hash(password)", "def hash_passwd(password, ...
[ "0.847967", "0.8346137", "0.82644516", "0.80417943", "0.7999399", "0.7979167", "0.7971465", "0.7947968", "0.7919728", "0.78821445", "0.78162515", "0.77545875", "0.77411246", "0.766462", "0.76507545", "0.76267356", "0.75862885", "0.75638247", "0.755944", "0.7549114", "0.754458...
0.7510138
24
Gets the network topology as a dict.
def rpcp_get_network_topology(client): # Initialize topology dictionary and get container names. net_topology = {} containers = map(str, get_containers_names(client)) for container in containers: net_topology[container] = [] # For each container get the list of peer ips. for ip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_json_topology(self):\n result = dict()\n result['result'] = self._topology\n return json.dumps(result)", "def topology(self):\n return self._topology", "def getTopoConf(self):\n\n topoDict = {}\n topoDict['hosts'] = set()\n topoDict['switches'] = set()\n...
[ "0.7275952", "0.69781256", "0.6929286", "0.66357285", "0.6523112", "0.6522756", "0.6461006", "0.64406073", "0.6427195", "0.6323752", "0.6315597", "0.6241414", "0.62313753", "0.6187923", "0.61743337", "0.61743337", "0.61632967", "0.60908616", "0.60351557", "0.60266066", "0.600...
0.5908165
31
Get the front element.
def peek(self) -> int: if len(self.stackOut) ==0: while len(self.stackIn) !=0: y = self.stackIn.pop() self.stackOut.append(y) return self.stackOut[-1] else: return self.stackOut[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass", "def getFront(self):\n if not self.isEmpty():\n return self._data[0]\n else:\n return -1", "def front(self):\n return self.queue[0] if not self.empty() else None", "def peek_front(...
[ "0.82009244", "0.79261875", "0.7852642", "0.7791182", "0.77886623", "0.75723046", "0.752337", "0.7510604", "0.7478953", "0.7379256", "0.7379256", "0.734284", "0.7323573", "0.7320296", "0.7291721", "0.72772557", "0.7269801", "0.72657627", "0.7253295", "0.72355044", "0.72213495...
0.0
-1
Returns whether the queue is empty.
def empty(self) -> bool: if len(self.stackOut) == 0 and len(self.stackIn) == 0: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return self.queue == []", "def ...
[ "0.9270249", "0.92506766", "0.923635", "0.923635", "0.9155843", "0.9098441", "0.9095006", "0.90922606", "0.90731245", "0.9053733", "0.89205354", "0.89137155", "0.8877591", "0.88436323", "0.88436323", "0.8835949", "0.88038146", "0.8758203", "0.87577534", "0.87310195", "0.86462...
0.0
-1
Testing if each side has only 4 stickers of each color.
def test_stickers(self): rotation, _ = list(self.cube.scramble_cube(15)) unique, counts = np.unique(rotation, return_counts=True) dictionary = dict(zip(unique, counts)) self.assertEqual(all(value == 4 for value in dictionary.values()), True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solved(self):\n\n for p in self.pieces:\n if [p.x, p.y, p.z].count(0) < 2: # Filter out centers.\n # Compare each sticker color with its respective center.\n for i, s in enumerate(p.stickers):\n cen = self.getpiece(s.x, s.y, s.z).getsticker(s.x...
[ "0.65600514", "0.64024806", "0.6111622", "0.6092814", "0.60618186", "0.6050172", "0.6020332", "0.6009627", "0.59965485", "0.5994018", "0.59735286", "0.5966397", "0.5946132", "0.59352934", "0.5933959", "0.59049577", "0.58730775", "0.5872805", "0.5777192", "0.57741284", "0.5759...
0.6140139
2
Create a dataframe containing some fake data
def create_fake_dataframe(spark: SQLContext, count=1000): rows = [ ( str(uuid.uuid4()), random.choice(["a", "b", "c", "d"]), random.randint(10000000, 99999999), ) for i in range(count) ] return spark.createDataFrame(rows, create_schema())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_dataframe() -> pd.DataFrame:\n df = pd.DataFrame(\n np.random.randint(0, 1000, size=(1000, 6)), columns=list(\"ABCDEF\")\n )\n\n return df", "def create_dataframe():\r\n\r\n df = pd.read_csv('data/data.csv', header=0)\r\n return df", "def expected_df():\n retu...
[ "0.79559106", "0.7656441", "0.7243437", "0.716989", "0.71392787", "0.7137078", "0.70885706", "0.70704633", "0.70191056", "0.7008791", "0.700453", "0.6969396", "0.69682574", "0.69653404", "0.6940493", "0.69370687", "0.68665665", "0.6853467", "0.6845845", "0.681318", "0.680513"...
0.73146576
2
Applies OWLRL reasoning from the Python owlrl library to the graph
def expand(self, graph): owlrl.DeductiveClosure(owlrl.OWLRL_Semantics).expand(graph)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reasoning_rule_2(self):\n\n query = \"\"\"\n SELECT DISTINCT ?incident ?incident_type_label\n WHERE {\n ?incident rdf:type baw:Incident .\n ?incident baw:isOfIncidentType ?incident_type .\n ?incident_type rdfs:label ?...
[ "0.5654984", "0.5642644", "0.5233853", "0.5190085", "0.51086634", "0.50949734", "0.5061123", "0.50500965", "0.50432307", "0.50018555", "0.49926707", "0.495828", "0.4942225", "0.49339157", "0.48538932", "0.48476878", "0.47962856", "0.4773984", "0.47489735", "0.47416294", "0.47...
0.45487526
45
Applies OWLRL reasoning from the Python owlrl library to the graph
def expand(self, graph): def check_error(res): exit_code, message = res exit_code == int(exit_code) if exit_code == 0: return elif exit_code == 1: # critical raise Exception( f"Non-zero exit code {exit_code} wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reasoning_rule_2(self):\n\n query = \"\"\"\n SELECT DISTINCT ?incident ?incident_type_label\n WHERE {\n ?incident rdf:type baw:Incident .\n ?incident baw:isOfIncidentType ?incident_type .\n ?incident_type rdfs:label ?...
[ "0.5655563", "0.56436276", "0.52339625", "0.5189624", "0.5107786", "0.5096615", "0.50607306", "0.5050002", "0.5043964", "0.5003191", "0.49921823", "0.49579373", "0.49426347", "0.4933147", "0.48545262", "0.4847491", "0.4795626", "0.47747505", "0.47505456", "0.47422296", "0.473...
0.0
-1
Creates a new HaystackInferenceSession that infers entities into the given namespace
def __init__(self, namespace): super(HaystackInferenceSession, self).__init__( approximate=True, load_brick=True ) self._generated_triples = [] self._BLDG = rdflib.Namespace(namespace) self._filters = [ lambda x: not x.startswith("his"), lambda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_inference_session(self):\n sess_options = onnxruntime.SessionOptions()\n sess_options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_DISABLE_ALL\n self.infer_session = onnxruntime.InferenceSession(\n self.augmented_model_path,\n sess_options=...
[ "0.57719624", "0.5458142", "0.5415007", "0.5292964", "0.46993527", "0.46957853", "0.46467748", "0.46252346", "0.45870125", "0.45230237", "0.45090255", "0.45024183", "0.4490142", "0.44655213", "0.44575697", "0.44102156", "0.44082698", "0.4399267", "0.43581992", "0.4357093", "0...
0.618797
0
Tokenize and preprocesses input word lists, involving the following steps 0. WordPiece tokenization. 1. Convert string tokens to token ids. 2. Convert input labels to label ids, if labels and label_map are provided. 3. If a word is tokenized into multiple pieces of tokens by the WordPiece tokenizer, label the extra tok...
def preprocess_for_bert( self, text, max_len=MAX_SEQ_LEN, labels=None, label_map=None, trailing_piece_tag="X" ): def _is_iterable_but_not_string(obj): return isinstance(obj, Iterable) and not isinstance(obj, str) if max_len > MAX_SEQ_LEN: logging.warning( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize_pretraining(self, inputs):\n\n ref_ids = prepare_ref([inputs], self.tokenizer_ltp, self.tokenizer_cn)\n\n tokens = self.tokenizer_cn.tokenize(inputs)\n\n if len(tokens) > self.max_seq_length - 2:\n tokens = tokens[:(self.max_seq_length - 2)]\n ref_ids = ref_i...
[ "0.6883363", "0.6696494", "0.6695678", "0.6506391", "0.65052533", "0.6501796", "0.65004593", "0.64904433", "0.64697456", "0.6456079", "0.64348155", "0.64327294", "0.6419248", "0.6408841", "0.6399539", "0.6332851", "0.6332851", "0.63271964", "0.628218", "0.61245924", "0.612179...
0.71329325
0
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83695436", "0.8280479", "0.82485795", "0.8139178", "0.8114118", "0.80985415", "0.80940944", "0.80797124", "0.80677074", "0.80673695", "0.80569947", "0.80545217", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", ...
0.8062465
14
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
def dframe(self, dimensions=None): if dimensions: dimensions = [self.get_dimension(d, strict=True) for d in dimensions] else: dimensions = dimensions.kdims dim = [dim.name for dim in dims if dim in dimensions.kdims] return self.interface.dframe(self, dimensions)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataframe(self, *args, **kwargs):\n\n from pandas import DataFrame\n\n # Just normal data, so use the iterator in this object.\n headers = next(islice(self, 0, 1))\n data = islice(self, 1, None)\n\n return DataFrame(list(data), columns=headers)", "def get_dataframe(self, pa...
[ "0.61001545", "0.60947555", "0.6092169", "0.60852474", "0.60683244", "0.6057508", "0.602932", "0.60190564", "0.5878718", "0.581386", "0.57946086", "0.57871914", "0.57718825", "0.57689756", "0.5766065", "0.5750916", "0.5747028", "0.5723522", "0.57109016", "0.5708923", "0.56938...
0.5777129
12
Restricts the queryset so users can only see their current question
def get_queryset(self): now = timezone.localtime(timezone.now()) # get exams that are currently in progress exams = Exam.objects.filter(begin_timestamp__lte=now, end_timestamp__gt=now) # get ExamProgress objects for this user for each exam progress_objects = ExamProgress.object...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n return super().get_queryset().filter(user=self.request.user)", "def get_queryset(self, request):\n qs = super().get_queryset(request)\n return qs.filter(user=request.user)", "def get_queryset(self: 'AnswerViewSet'):\n queryset = super().get_queryset()\n ...
[ "0.70713353", "0.7008343", "0.6999726", "0.697823", "0.69214356", "0.6900586", "0.68676925", "0.68405104", "0.6826592", "0.6765974", "0.6763542", "0.67396015", "0.6698831", "0.66393846", "0.66212827", "0.6611483", "0.6607469", "0.65282714", "0.65282714", "0.65088904", "0.6496...
0.61864954
55
Assigns an exercise from active exam to user if they haven't been assigned one yet; returns that exercise Only students can access this (access from teachers returns 403)
def my_exam(self, request, **kwargs): now = timezone.localtime(timezone.now()) # get current exam exam = get_object_or_404(Exam, pk=kwargs.pop("pk")) if exam.begin_timestamp > now: return Response( status=status.HTTP_404_NOT_FOUND, data={"mes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_authorize(cls, user, obj):\n if not obj.assignment_group.is_examiner(user):\n raise PermissionDenied()", "def test_get_user_assignable_assessments(self):\n api_instance = relias_api_client.AssessmentsApi(relias_api_client.ApiClient())\n result = api_instance.get_user_ass...
[ "0.57704204", "0.5718873", "0.5717288", "0.56339175", "0.5597515", "0.5559141", "0.55335253", "0.55162555", "0.5498489", "0.54706067", "0.5452193", "0.5439074", "0.5438833", "0.5436084", "0.542471", "0.5421913", "0.54159087", "0.5411965", "0.5402812", "0.5350158", "0.5349037"...
0.5706972
3
Restricts the queryset so users can only see their current exercise
def get_queryset(self): now = timezone.localtime(timezone.now()) # get exams that are currently in progress exams = Exam.objects.filter(begin_timestamp__lte=now, end_timestamp__gt=now) # get ExamProgress objects for this user for each exam progress_objects = ExamProgress.object...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, request):\n qs = super(ExamAdmin, self).get_queryset(request)\n if request.user.is_superuser:\n return qs.filter(content_type__lt=3)\n return qs.filter(topic_id__in=request.user.profile.topics.all(), content_type__lt=3)", "def read_authorize(cls, user, obj):...
[ "0.65524936", "0.6401311", "0.6396814", "0.63729113", "0.6321733", "0.6306441", "0.62962556", "0.62887096", "0.6282846", "0.6266675", "0.62088287", "0.6148949", "0.61326647", "0.6127173", "0.61150676", "0.6098137", "0.6093078", "0.60561955", "0.6012393", "0.59932035", "0.5990...
0.6211743
10
1ranges Gaussian + one Yukawa
def fitfunc_1G1Y(a_x, a_p1, a_p2, a_p3, a_p4, a_p5): # if (a_x != 0.0): if (True): return (a_p1 * exp(-pow(a_x/a_p2, 2)) + a_p3 * (1.0 - exp(-a_p4 * a_x**2)) * exp(-a_p5 * a_x) / a_x) else: return a_p1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussianOne(self, x=np.array([]), mu=0., sig=1.):\n\n lnConst = -0.5 * np.log(2.0 * np.pi)\n lnVar = -np.log(sig)\n lnBrack = -0.5 * ((x - mu) / sig)**2\n\n ### safety valve\n ###bBad = np.abs(lnBrack) > 7.\n ###lnBrack[bBad] = -np.inf\n\n return lnConst + lnVar...
[ "0.6543564", "0.6533004", "0.65009606", "0.64741063", "0.64735866", "0.64680195", "0.63761353", "0.63755226", "0.63641816", "0.63604337", "0.6338307", "0.63291985", "0.631506", "0.62789863", "0.62495375", "0.62054586", "0.6194136", "0.6177896", "0.6175907", "0.6159172", "0.61...
0.5926634
60
2ranges Gaussian + one Yukawa
def fitfunc_2G1Y(a_x, a_p1, a_p2, a_p3, a_p4, a_p5, a_p6, a_p7): # if (a_x != 0.0): if (True): return (a_p1 * exp(-pow(a_x/a_p2, 2)) + a_p3 * exp(-pow(a_x/a_p4, 2)) + a_p5 * (1.0 - exp(-a_p6 * a_x**2)) * exp(-a_p7 * a_x) / a_x) else: return (a_p1 * exp(-pow(a_x/a_p2, 2))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss2(x,a1,c1,w1,a2,c2,w2):\n return gaussian(x,a1,c1,w1)+gaussian(x,a2,c2,w2)", "def doubleGaussian(x, m1, s1, a1, m2, s2, a2):\n # primary peak\n g1 = np.exp(-0.5*((x-m1)/s1)**2)\n # secondary peak\n g2 = np.exp(-0.5*((x-m2)/s2)**2)\n # total model\n mod1 = 1 - a1 * g1\n mod2 = 1 -...
[ "0.69036436", "0.6521418", "0.6508367", "0.64123213", "0.63902074", "0.6347984", "0.6335562", "0.6270491", "0.62202364", "0.6212555", "0.62045145", "0.6202212", "0.6202135", "0.6168955", "0.616852", "0.6159925", "0.61389804", "0.61102456", "0.6086743", "0.60846287", "0.606317...
0.0
-1
2ranges Gaussian + one Yukawa square
def fitfunc_2G1Ysq(a_x, a_p1, a_p2, a_p3, a_p4, a_p5, a_p6, a_p7): # if (a_x != 0.0): if (True): return (a_p1 * exp(-pow(a_x/a_p2, 2)) + a_p3 * exp(-pow(a_x/a_p4, 2)) + a_p5 * (1.0 - exp(-a_p6 * a_x**2))**2 * exp(-2.0 * a_p7 * a_x) / a_x**2) else: return (a_p1 * exp(-pow(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss2(x,a1,c1,w1,a2,c2,w2):\n return gaussian(x,a1,c1,w1)+gaussian(x,a2,c2,w2)", "def uni_gaussian(X, mu, sigma2):\n p = (1 / sqrt(2 * pi * sigma2))\n p = p * exp(-power(X - mu, 2) / (2 * sigma2))\n\n def prod(x, y):\n return x * y\n p = array([[reduce(prod, el)] for el in p])\n\n r...
[ "0.68471813", "0.6463747", "0.63247275", "0.6313288", "0.6313288", "0.6313288", "0.6287984", "0.6252233", "0.62373304", "0.6233909", "0.6233909", "0.62324554", "0.62164015", "0.6213933", "0.6183132", "0.61724454", "0.61691517", "0.6145393", "0.61321616", "0.6124371", "0.61214...
0.0
-1
2ranges Gaussian + one Yukawa + one Yukawa square
def fitfunc_2G1Y1Ysq(a_x, a_p1, a_p2, a_p3, a_p4, a_p5, a_p6, a_p7, a_p8, a_p9, a_p10): # if (a_x != 0.0): if (True): return (a_p1 * exp(-pow(a_x/a_p2, 2)) + a_p3 * exp(-pow(a_x/a_p4, 2)) + a_p5 * (1.0 - exp(-a_p6 * a_x**2)) * exp(- a_p7 * a_x) / a_x + a_p8 *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss2(x,a1,c1,w1,a2,c2,w2):\n return gaussian(x,a1,c1,w1)+gaussian(x,a2,c2,w2)", "def uni_gaussian(X, mu, sigma2):\n p = (1 / sqrt(2 * pi * sigma2))\n p = p * exp(-power(X - mu, 2) / (2 * sigma2))\n\n def prod(x, y):\n return x * y\n p = array([[reduce(prod, el)] for el in p])\n\n r...
[ "0.683054", "0.6156113", "0.61057544", "0.6097299", "0.6089542", "0.6089542", "0.6089542", "0.60753906", "0.60615045", "0.60557014", "0.60443085", "0.60270274", "0.60207975", "0.5996791", "0.5976392", "0.5968411", "0.5961397", "0.595475", "0.59492165", "0.5943827", "0.5907911...
0.0
-1
Save learnable model's parameters of each agent.
def save_model(self): for index, agent in enumerate(self.agents): torch.save(agent.actor_local.state_dict(), 'agent{}_checkpoint_actor.pth'.format(index + 1)) torch.save(agent.critic_local.state_dict(), 'agent{}_checkpoint_critic.pth'.format(index + 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save_trained_params(self):\n self.trained_model_params = self.sess_train.run([self.ent_emb, self.rel_emb])", "def save_and_step(self):\n self.last_grads = [param.grad for param in self.agent.model.parameters()]\n self.optimizer.pytorch_step()", "def save_trainable_variables (self , se...
[ "0.75264573", "0.69864136", "0.6825882", "0.6600375", "0.6543963", "0.65004605", "0.6480151", "0.63637465", "0.634861", "0.6336625", "0.63065845", "0.6301562", "0.62970734", "0.625989", "0.6254696", "0.62538546", "0.6244833", "0.6241226", "0.6192339", "0.61900115", "0.6181057...
0.7500514
1
Load learnable model's parameters of each agent.
def load_model(self): if torch.cuda.is_available(): map_location=lambda storage, loc: storage.cuda() else: map_location='cpu' for index, agent in enumerate(self.agents): agent.actor_local.load_state_dict(torch.load('agent{}_checkpoint_actor.pth'.format(index ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_params(self, path: str):\n DistributedWorker.load_params(self, path)\n\n params = torch.load(path)\n self.dqn.load_state_dict(params[\"dqn_state_dict\"])\n print(\"[INFO] loaded the model and optimizer from\", path)", "def init_trainers(self, args):\n self.actors_cur =...
[ "0.6528969", "0.64266413", "0.6420081", "0.6385691", "0.6348845", "0.6311207", "0.6303016", "0.62518764", "0.6248974", "0.62411684", "0.62096554", "0.6199747", "0.61351556", "0.6115504", "0.61066806", "0.6096269", "0.60911316", "0.60587204", "0.6025436", "0.60167336", "0.6008...
0.6902219
0
Start the GUI and the asynchronous threads. We are in the main (original) thread of the application, which will later be used by the GUI as well. We spawn a new thread for the worker (I/O).
def __init__(self, master, user, song, cdLen, goHold): # GUI will be visible window after init self.master = master # get window size self.w = self.master.winfo_screenwidth() self.h = self.master.winfo_screenheight() # GUI will be visible after tkinter.Tk() # hi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startMainLoop(self):\n self.thread.start()\n self.theMainLoop.emit(QtCore.SIGNAL(\"step()\"))\n self.app.exec_()", "def create_and_run_worker(self):\n\n # Run processing on QThread worker - prevents GUI lock up\n # Create processing object, map control data\n process...
[ "0.6739887", "0.65283984", "0.6500797", "0.64503914", "0.64231384", "0.6405339", "0.63747615", "0.637361", "0.63591135", "0.63198584", "0.63198584", "0.6318967", "0.62888855", "0.62473863", "0.6235212", "0.6228425", "0.6191777", "0.6163265", "0.6147396", "0.6085522", "0.60722...
0.0
-1
randomly sample an action uniformly from the action space
def get_action(self, state): return self.env.action_space.sample()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_random_action(env):\n return env.action_space.sample()", "def action_space_sample(self):\n return np.random.choice(self.possible_actions)", "def random_action(self, observation):\n return self.env.action_space.sample()", "def randomAction():\n return np.random.randint(0, POSSIB...
[ "0.8401684", "0.8337434", "0.8238592", "0.81891686", "0.81752527", "0.77952963", "0.7733447", "0.76610124", "0.7614549", "0.7585453", "0.75688475", "0.75468457", "0.7543422", "0.7504272", "0.74674034", "0.7451388", "0.74320966", "0.74134237", "0.7404632", "0.73975825", "0.739...
0.7074232
37
Returns whether the given mismatch item is for a GitHub URL.
def _is_git_url_mismatch( mismatch_item: Tuple[str, ValidatedMismatchType] ) -> bool: _, (required, _) = mismatch_item return required.startswith('git')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_redmine_issue_url(inUrl):\n path, issue_num = os.path.split(inUrl)\n path, issue = os.path.split(path)\n path, redmine = os.path.split(path)\n # check the URL is redmine issues\n if validators.url(inUrl) and issue_num.isdigit() and issue=='issues' and redmine=='redmine' :\n pr...
[ "0.63885933", "0.6138137", "0.6082988", "0.60739523", "0.5967309", "0.5939359", "0.593493", "0.58723974", "0.5869958", "0.58176976", "0.5775038", "0.57686484", "0.57686317", "0.5747836", "0.5726105", "0.5704212", "0.56945777", "0.5676894", "0.56633955", "0.5645437", "0.560099...
0.8174016
0
Return the diagonal part of each matrix in a batch
def batch_diag_part(in_tensor, batch_size): tensor_list = tf.split(split_dim=0, num_split=batch_size, value=in_tensor) tensor_list = [tf.expand_dims(tf.diag_part(tf.squeeze(t, [0])), 0) for t in tensor_list] return tf.concat(0, tensor_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getdiag(self):\n out = []\n for x in xrange(0, self.lendiag()):\n out.append(self.retrieve(x))\n return out", "def diagonal(self):\n M = self.rep\n m, n = self.shape\n return [M[i, i] for i in range(min(m, n))]", "def _block_diagonal(factor_matrices):\n ...
[ "0.712944", "0.70870024", "0.70824987", "0.69518024", "0.68496966", "0.6773829", "0.66317725", "0.6620829", "0.6533222", "0.6505117", "0.6353034", "0.6351915", "0.6349437", "0.63441616", "0.63414663", "0.633113", "0.6246064", "0.62307507", "0.6208503", "0.6166812", "0.6122159...
0.6634581
6
Get rnn given input data. Note that if use bidirectional RNN, the outputs contains only h rather than (h, c)
def get_rnn(X, rnn_size, seq_len, batch_size, num_layers=1, input_keep_prob=1.0, output_keep_prob=1.0, is_training=False, cell_name="BasicLSTM", bidirectional=False): with tf.device("/cpu:0"): # Convert input tensor to python list (along the sequence length dimention) word_embeddings = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rnn(input_size, rnn_size, rnn_len):\n num_rnn_layers = rnn_len\n assert num_rnn_layers >= 1\n hidden_size = rnn_size\n\n gru = nn.GRU(input_size=input_size, hidden_size=hidden_size, num_layers=num_rnn_layers, bias=True, batch_first=True, dropout=0, bidirectional=False)\n return gru", "def _rnn...
[ "0.6563839", "0.64294267", "0.635171", "0.60921955", "0.6069791", "0.60392123", "0.59482735", "0.5892745", "0.58788294", "0.5873971", "0.58506", "0.5846425", "0.5798542", "0.5788454", "0.577733", "0.5761426", "0.57383144", "0.5687918", "0.568393", "0.5680258", "0.5659818", ...
0.5307832
42
Get rnn given input data. Note that if use bidirectional RNN, the outputs contains only h rather than (h, c)
def get_dynamic_rnn(X, rnn_size, seq_len, num_layers=1, input_keep_prob=1.0, output_keep_prob=1.0, is_training=False, cell_name="GRU", bidirectional=False, swap_memory=False): batch_size = tf.shape(X)[0] if bidirectional: rnn_size /= 2 def get_cell(): if cell_name == "GR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rnn(input_size, rnn_size, rnn_len):\n num_rnn_layers = rnn_len\n assert num_rnn_layers >= 1\n hidden_size = rnn_size\n\n gru = nn.GRU(input_size=input_size, hidden_size=hidden_size, num_layers=num_rnn_layers, bias=True, batch_first=True, dropout=0, bidirectional=False)\n return gru", "def _rnn...
[ "0.6565104", "0.6430089", "0.6353251", "0.60938233", "0.60706764", "0.603923", "0.59495604", "0.58935905", "0.58809227", "0.5874694", "0.58512634", "0.5846865", "0.579937", "0.57900316", "0.5779321", "0.57628334", "0.57394516", "0.56898236", "0.5683491", "0.5680625", "0.56623...
0.5409995
35
Get a CNN model for text data
def get_cnn_for_text(input_data, conv_window, filter_num, pooling_window, activation_fn=tf.nn.relu, padding_vec=None, use_batch_norm=False, bias_initializer=tf.zeros_initializer, keep_prob=1, is_training=False): # Do padding input_shape = tf.shape(input_data) if pad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model(model_name):\n model = CNN().get_model(model_name=model_name)\n\n return model", "def build_character_cnn(model_hyperparameters=None, verbose=None):\r\n if model_hyperparameters is None:\r\n model_hyperparameters = _dutils.load_dictionary('model_hyperparameters.json')\r\n '''\r\n...
[ "0.65661967", "0.6355214", "0.63423324", "0.6334055", "0.62309915", "0.62224823", "0.61349905", "0.61244357", "0.6115915", "0.61096096", "0.610881", "0.60926867", "0.60906357", "0.6082066", "0.602661", "0.60257286", "0.60216564", "0.59937465", "0.5991809", "0.598112", "0.5952...
0.6337459
3
Sigmoid cross entropy loss function
def sigmoid_cross_entropy_with_probs(pred_probs, target_probs, eps=1e-6, target_mask=None, name=None): with tf.name_scope(name, "SigmoidCrossEntropyWithProb", [pred_probs, target_probs]): pred_probs = tf.minimum(pred_probs, 1) # crossent_loss = -tf.reduce_sum( # target_probs * tf.log(tf....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sigmoid_cross_entropy(self):\n loss_op = pointwise_losses.SigmoidCrossEntropy()\n\n y_pred = loss_op.final_activation_op({\n \"logits\": self.logits,\n \"metadata\": {\n \"mask\": self.mask\n }\n })\n assert np.isclose(y_pred[0][0...
[ "0.7751491", "0.7551262", "0.75343907", "0.75051636", "0.75051636", "0.7444408", "0.7444408", "0.7425999", "0.7405113", "0.74050504", "0.74008167", "0.74008167", "0.74008167", "0.74008167", "0.74008167", "0.74008167", "0.7392445", "0.73857886", "0.7383032", "0.7367221", "0.73...
0.0
-1
Retrieve variables from Variables section of Robot test yaml file content
def retrieve_variables(content): variables = [] in_var_section = False for line in content.splitlines(): #print line if in_var_section: var_def = re.split(' +', line) if len(var_def) > 1: #print var_def[0], ':', var_def[1] var_name = v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_vars(var_file):\n try:\n with open(var_file, \"r\") as f:\n kargovars = yaml.load(f)\n except:\n print(\n \"Can't read variables file %s\" % var_file\n )\n sys.exit(1)\n return kargovars", "def test_load_variables_correct_yaml(self):\n va...
[ "0.6942721", "0.67111003", "0.63479877", "0.61746496", "0.6149548", "0.6149451", "0.6136662", "0.5987612", "0.59549636", "0.590303", "0.58544385", "0.58243316", "0.58085585", "0.58006", "0.5738841", "0.57314175", "0.57119524", "0.57064676", "0.5685456", "0.5677424", "0.567386...
0.7670801
0
Set the functional form's expression.
def expression(self, expr): self.set(expression=expr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, expression):\n self.set_expression(expression)", "def expression(self, expression):\n\n self._expression = expression", "def set_expr(self, expr: Expr):\r\n self.expr = Expr.cnf(expr)", "def set_expression(self, expression):\n\n self.raw_expression = expression\...
[ "0.6996593", "0.6932032", "0.63428557", "0.61447763", "0.59326226", "0.59325033", "0.59310293", "0.59310293", "0.59310293", "0.5665593", "0.55296236", "0.55026495", "0.5471867", "0.5461301", "0.5441167", "0.54367834", "0.54367834", "0.54300874", "0.54300874", "0.5412352", "0....
0.7309148
0
Return the independent variables involved in the expression.
def independent_variables(self): return self._independent_variables
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_variables(self) -> np.array:\n pass", "def independent(self):\n return self.x", "def independent_variable(self):\n return self._independent_variable", "def get_variables(self) -> np.array:\n return np.array([self.a, self.b, self.c])", "def variables(self, *args, **kwargs...
[ "0.69342124", "0.6851764", "0.68462193", "0.6721704", "0.6716456", "0.6642885", "0.6637627", "0.65888846", "0.658444", "0.6566627", "0.6558127", "0.6558127", "0.65283096", "0.6495484", "0.6414297", "0.6411028", "0.6374305", "0.63611335", "0.6346324", "0.63318974", "0.62679744...
0.81513494
0
Check to see that independent_variables is a set of valid sympy symbols.
def _validate_independent_variables(indep_vars): if isinstance(indep_vars, str): indep_vars = {sympy.symbols(indep_vars)} elif isinstance(indep_vars, sympy.Symbol): indep_vars = {indep_vars} elif isinstance(indep_vars, (list, set)): if all([isinstance(val, sym...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_validity(\n expression, independent_variables_symbols, parameters=None\n ):\n for sym in independent_variables_symbols:\n if sym not in expression.free_symbols:\n raise ValueError(\n f\"symbol {sym} is not in expression's free symbols. \"\n ...
[ "0.779202", "0.64148474", "0.63524044", "0.62356436", "0.6202438", "0.61021644", "0.6021484", "0.58973783", "0.5840786", "0.57279545", "0.5701512", "0.5695323", "0.56408083", "0.5625691", "0.56108725", "0.56052905", "0.560317", "0.5584926", "0.55055", "0.5470335", "0.54080087...
0.8080713
0
``dictionary`` A hilbert.dictionary.Dictionary instance mapping token strings from/to integer IDs; ``Nx`` A 1D arraylike instance (e.g. numpy.ndarray, scipy.sparse.csr_matrix, or list), in which the ith element contains the number of cooccurrences for token with ID i. Unigram Keeps track of token occurrence counts, and...
def __init__( self, dictionary=None, Nx=None, verbose=True ): self.validate_args(dictionary, Nx) self.dictionary = dictionary or h.dictionary.Dictionary() if Nx is None: self.Nx = list() self.N = 0 else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(path, verbose=True):\n dictionary = h.dictionary.Dictionary.load(\n os.path.join(path, 'dictionary'))\n with open(os.path.join(path, 'Nx.txt')) as f_counts:\n Nx = [int(count) for count in f_counts]\n return Unigram(dictionary=dictionary, Nx=Nx, verbose=verbose)"...
[ "0.63577783", "0.6301986", "0.6040144", "0.591081", "0.57682973", "0.5737164", "0.56832945", "0.5651892", "0.5649262", "0.56411046", "0.5635786", "0.56348616", "0.5628582", "0.55958813", "0.5567158", "0.5559066", "0.5546402", "0.5522636", "0.5476858", "0.5476176", "0.54756427...
0.0
-1
Add counts from `other` to `self`, in place.
def __iadd__(self, other): if not isinstance(other, Unigram): return NotImplemented self.sort_by_tokens(other.dictionary.tokens) for i in range(len(other.dictionary)): other_count = other.Nx[i] self.Nx[i] += other_count self.N = sum(self.Nx) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine(self, other) -> None:\n assert self.id_ == other.id_\n assert self.type_ == other.type_\n self.count += other.count", "def merge_stats(self, other):\n\n self[1] += other[1]\n self[2] += other[2]\n self[3] = self[0] and min(self[3], other[3]) or other[3]\n ...
[ "0.78719115", "0.7291186", "0.7206332", "0.7085738", "0.6965994", "0.68076396", "0.6759624", "0.6721419", "0.67208", "0.66828096", "0.6660367", "0.6657896", "0.66390276", "0.6618846", "0.66137266", "0.6549241", "0.654614", "0.6533654", "0.65335256", "0.6517147", "0.64845985",...
0.7527159
1
Load the tokenID mapping and cooccurrence data previously saved in the directory at `path`.
def load(path, verbose=True): dictionary = h.dictionary.Dictionary.load( os.path.join(path, 'dictionary')) with open(os.path.join(path, 'Nx.txt')) as f_counts: Nx = [int(count) for count in f_counts] return Unigram(dictionary=dictionary, Nx=Nx, verbose=verbose)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_vocab(self, path):\n self._token2id_feq = self._init_dict()\n N = len(self._token2id_feq)\n\n if path.endswith(\".json\"):\n\n with open(path, encoding='utf-8') as f:\n _dict = json.load(f)\n # Word to word index and word frequence.\n ...
[ "0.6888017", "0.684878", "0.6761172", "0.6758128", "0.6750707", "0.67440856", "0.67440856", "0.67349714", "0.6616209", "0.6512348", "0.64929265", "0.62654686", "0.6200185", "0.6197975", "0.61570126", "0.6131554", "0.60154146", "0.60032016", "0.59774774", "0.5971658", "0.59609...
0.5366073
83
Return a categorical accuracy tensor for label and prediction tensors.
def categorical_accuracy(y_true, y_pred): # get number of labels to calculate IoU for num_classes = K.int_shape(y_pred)[-1] # set the weights to all 1 if there are none specified _weights = np.ones(num_classes) if weights is None else weights # convert the one-hot tensors into di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_categorical_accuracy(weights=None):\n def categorical_accuracy(y_true, y_pred):\n \"\"\"\n Return a categorical accuracy tensor for label and prediction tensors.\n\n Args:\n y_true: the ground truth labels to compare against\n y_pred: the predicted labels fro...
[ "0.74594647", "0.7364117", "0.7302737", "0.7280148", "0.71904767", "0.71232694", "0.71155643", "0.70868564", "0.70617795", "0.7047447", "0.7013569", "0.6998929", "0.6994748", "0.6990108", "0.69784826", "0.6967084", "0.6963247", "0.6958624", "0.6918833", "0.68709403", "0.68655...
0.7392989
1
Get device_class from uiid (from eWeLink Servers) or from zeroconf type. Sonoff iFan02 and iFan03 both have uiid 34. But different types (strip and fan_light) and different local API for each type. Without uiid iFan02 will be displayed as 4 switches.
def guess_device_class(config: dict): uiid = config.get('uiid') # DualR3 in cover mode if uiid == 126 and config.get('params', {}).get('workMode') == 2: return 'cover' return UIIDS.get(uiid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_class(self):\n if self.values.primary.command_class == CommandClass.BATTERY:\n return DEVICE_CLASS_BATTERY\n if self.values.primary.command_class == CommandClass.METER:\n return DEVICE_CLASS_POWER\n if \"Temperature\" in self.values.primary.label:\n ...
[ "0.63209945", "0.62513936", "0.61521", "0.61028683", "0.60961854", "0.60473025", "0.60418415", "0.60231614", "0.60231614", "0.6018687", "0.59986573", "0.5937197", "0.58883446", "0.5880689", "0.5864063", "0.5807816", "0.5774061", "0.57536495", "0.57483846", "0.57402045", "0.57...
0.71670026
0
Generate gaussian kernel of given given size and dims (sizexsize)
def _generate_gaussian_kernel(self, size: int, sigma: float = 1.0, mu: float = 0.0) -> ndarray: # create the 1D array of equally spaced distance point of given size self.kernel_1d = np.linspace(-(size//2), size//2, size) # get the gaussian distribution of the 1D array self.kernel_1d = se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss_kernels(size, sigma=1.0):\n if size < 3:\n size = 3\n\n m = size / 2\n x, y = np.mgrid[-m:m + 1, -m:m + 1]\n kernel = np.exp(-(x * x + y * y) / (2 * sigma * sigma))\n kernel_sum = kernel.sum()\n\n if not sum == 0:\n kernel = kernel / kernel_sum\n\n return kernel", "de...
[ "0.7902869", "0.786879", "0.7847072", "0.77661806", "0.77438474", "0.7712658", "0.7674218", "0.7618137", "0.7394118", "0.73418796", "0.7264643", "0.7186383", "0.7143893", "0.7120836", "0.70702666", "0.7064734", "0.705532", "0.7051436", "0.70091546", "0.6969807", "0.6957415", ...
0.7456567
8
creates a table/grid showing days, activities and checkboxes
def show_table(self, week, tab): days = self.t.get_days_names(week) activities = self.t.get_activities_names(week) # initialize to empty buffers. self.e = {} self.n = 0 self.s = {} self.n2 = 0 mood = [1,2,3,4,5,6,7,8,9,10] for i in range(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_main_table(self):\n summary_line = [\"No Students in Section\",0,0,0,0,0,0,\" \"]\n day_type_list, dates_list = \\\n load_daytypes_lists(self.start_date, self.total_days,\n self.section, self.total_days)\n num_school_days = 0...
[ "0.60977846", "0.60459197", "0.5992083", "0.5974194", "0.5915584", "0.5894256", "0.58005345", "0.58005345", "0.57479286", "0.57234156", "0.56366456", "0.55605006", "0.55464846", "0.55322146", "0.5526016", "0.55224824", "0.5513997", "0.54925054", "0.5473437", "0.5459966", "0.5...
0.62570053
0
The getter for the _current_player attribute.
def get_current_player(self): # Return the current player return self._current_player
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_player(self) :\n return self.current_player", "def get_current_player(self):\n return self.current_player", "def getCurrentPlayer(self):\r\n return self.currentPlayer", "def current_player(self) -> Player:\n return self.players[self.player]", "def get_current_pla...
[ "0.9196371", "0.9167629", "0.8987412", "0.88097066", "0.8781464", "0.8640522", "0.8623316", "0.8458299", "0.8148247", "0.8148247", "0.81295174", "0.80383986", "0.8036016", "0.8012114", "0.7962703", "0.79567903", "0.7695038", "0.76337355", "0.7379973", "0.70655584", "0.7051936...
0.8894675
3
The getter for the _players attribute.
def get_players(self): # Append the current player to the list and return it players_list = list(self._players.queue) players_list.append(self._current_player) return players_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_players(self):\r\n return self.players.values()", "def players(self):\n return self._get(\"players\")", "def players(self):\n return self._get_by_class(Player)", "def getPlayers(self):\n return iter(self.players)", "def players(self):\n return self.currents.player...
[ "0.8530375", "0.85068864", "0.7949154", "0.79324985", "0.7878253", "0.7776289", "0.77181107", "0.76457036", "0.76055986", "0.74832904", "0.7454246", "0.71900433", "0.715939", "0.71429646", "0.71379983", "0.71379983", "0.7125651", "0.7122962", "0.711865", "0.708791", "0.706007...
0.73835987
11
The constructor for Player class.
def __init__(self, name): self._name = name.strip() self._total_score = 0 self._current_score = 0 self._total_rolls = 0 self._last_roll = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, player):\n\t\tself.player = player", "def __init__(self, player):\n self.player = player", "def __init__(self, *args, **kwargs):\n super(Player, self).__init__(*args, **kwargs)", "def __init__(self, player_name, player_number, player_position):\n self.name = player_nam...
[ "0.8325796", "0.8283512", "0.82757884", "0.7873427", "0.76910484", "0.74152905", "0.73407257", "0.7339989", "0.73080474", "0.72154605", "0.7187213", "0.71855015", "0.7162278", "0.71577734", "0.7147525", "0.711649", "0.70886296", "0.7008489", "0.6954792", "0.69382685", "0.6898...
0.0
-1
The getter for the _name attribute.
def get_name(self): # Return the player's name return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self.attributes[\"name\"]", "def get_name(self):\r\n return self._name", "def get_name(self):\r\n return self._name", "def get_name(self):\n return self._name", "def get_name(self):\n return self._name", "def get_name(self):\n return ...
[ "0.87166685", "0.87101245", "0.87101245", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.86021405", "0.8585303", "0.8585303", "0.85834324", "0.85834324", "0.8581335", "0.8576711", "0.8576711", "...
0.0
-1
The getter for the _total_score attribute.
def get_total_score(self): # Return the player's total score return self._total_score
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_score(self):\n return _projected_site_total_score(self)", "def getScore(self):\n return sum(self.field)", "def get_score(self):\n return self._score", "def get_score(self):\n return self._score", "def get_score(self):\n return self._score", "def get_score(self...
[ "0.7986217", "0.79395485", "0.78863955", "0.78863955", "0.78863955", "0.78604555", "0.7857501", "0.78363925", "0.7831491", "0.7831491", "0.7831491", "0.779419", "0.7793208", "0.76125747", "0.76040375", "0.7350401", "0.7289506", "0.72691095", "0.72604847", "0.72384334", "0.716...
0.850022
0
The getter for the _current_score attribute.
def get_current_score(self): # Return the player's current turn score return self._current_score
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_score(self):\n return self.score", "def get_score(self):\n return self.score", "def get_score(self):\n return self.score", "def get_score(self):\n return self._score", "def get_score(self):\n return self._score", "def get_score(self):\n return self._score...
[ "0.8048643", "0.8048643", "0.8048643", "0.803927", "0.803927", "0.803927", "0.8021984", "0.79949594", "0.7967731", "0.7930169", "0.7715467", "0.7490199", "0.74467254", "0.7411087", "0.7303938", "0.72761375", "0.72663015", "0.72537977", "0.7222566", "0.71809137", "0.7131872", ...
0.8298104
0
The getter for the _total_rolls attribute.
def get_total_rolls(self): # Return the player's rolls return self._total_rolls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumberOfRolls(self):\n return self._rollCount", "def update_total_rolls(self):\n\n # Incremene the attribute by 1\n self._total_rolls += 1", "def roll(self):\n return self._roll", "def roll(self):\n return self._roll", "def simple_roll(dice):\n return roll(dice)...
[ "0.7400069", "0.7167874", "0.6841755", "0.6841755", "0.68310744", "0.670044", "0.6561508", "0.6530778", "0.6493408", "0.6451612", "0.63602394", "0.6330336", "0.63166887", "0.625605", "0.62324303", "0.6180449", "0.61065423", "0.6100029", "0.6090371", "0.60813016", "0.6067108",...
0.8589699
0
Rotation about the yaxis.
def roty(t): c = np.cos(t) s = np.sin(t) return np.array([[c, 0, s], [0, 1, 0], [-s, 0, c]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rot_y_deg(self):\n # TODO describe which axis this is\n return math.degrees(self._rot_y_rad)", "def rot_y_rad(self):\n return self._rot_y_rad", "def rotation_center_y(self, *args, **kwargs) -> Any:\n pass", "def rotate_y(self, angle):\n angle *= np.pi / 180\n ret...
[ "0.75396633", "0.7354722", "0.7102622", "0.7064357", "0.7036538", "0.6986756", "0.6895528", "0.6895528", "0.68484044", "0.68028474", "0.6717387", "0.66640604", "0.66279566", "0.6614649", "0.658053", "0.6575346", "0.6554816", "0.6505504", "0.63935125", "0.6393029", "0.63855916...
0.0
-1
Transformation matrix from rotation matrix and translation vector.
def transform_from_rot_trans(R, t): R = R.reshape(3, 3) t = t.reshape(3, 1) return np.vstack((np.hstack([R, t]), [0, 0, 0, 1]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformation_matrix(self):\n t = np.array([[0.0], [0.0], [0.0]])\n Rt = np.hstack([self.rotation_matrix, t])\n return np.vstack([Rt, np.array([0.0, 0.0, 0.0, 1.0])])", "def rotation_to_transformation_matrix(R):\n R = Matrix(R)\n T = R.col_insert(3, Matrix([0., 0., 0.]))\n T = ...
[ "0.79315966", "0.75733316", "0.73280466", "0.71130884", "0.70770854", "0.70018923", "0.6995183", "0.6988624", "0.692278", "0.69205934", "0.6901036", "0.68665427", "0.68665427", "0.686329", "0.6860585", "0.68528104", "0.6841857", "0.6838954", "0.6835493", "0.6825314", "0.68218...
0.6620702
38
Initialize a user with a first and last name, and age
def __init__(self, first_name, last_name, age): self.first_name = first_name self.last_name = last_name self.age = age self.login_attempts = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, first_name, last_name, birthday, username):\n self.first_name = first_name\n self.last_name = last_name\n self.birthday = birthday\n self.username = username\n self.login_attempts = 0\n self.age = self.set_birthday()", "def __init__(self, first_name, l...
[ "0.76932657", "0.72238356", "0.72238356", "0.72238356", "0.72238356", "0.72238356", "0.72238356", "0.72238356", "0.72238356", "0.71969366", "0.7194928", "0.71771306", "0.7076065", "0.6950117", "0.6857025", "0.6814328", "0.6793207", "0.67545223", "0.67545223", "0.65966964", "0...
0.74646187
1
Get all transactions for a specific rule id.
def get_transactions_by_rule(id, start=None, end=None): transactions = None if start is not None and end is not None: transactions = get_db().execute('SELECT * FROM transactions WHERE rule_id = ? AND days >= ? AND days <= ? ORDER BY days DESC', (id,start, end)).fetchall() elif start is None and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_transaction_by_rule(id, start=None):\n if start is None:\n start = utils.get_first_day_of_month()\n\n transaction = get_db().execute('SELECT * FROM transactions WHERE rule_id = ? AND days < ? ORDER BY id DESC LIMIT 1', (id, start)).fetchone()\n\n return transaction", "def get_first...
[ "0.618485", "0.5856459", "0.58338904", "0.5738404", "0.5664297", "0.55717075", "0.55712694", "0.5543796", "0.55017984", "0.54876316", "0.53108495", "0.5232205", "0.5228999", "0.5228067", "0.52164614", "0.5154982", "0.51244783", "0.5107215", "0.50622654", "0.50382036", "0.4998...
0.7125169
0
Get all transactions for a specific rule id.
def get_last_transaction_by_rule(id, end=None): transaction = None if end is not None: transaction = get_db().execute('SELECT * FROM transactions WHERE rule_id = ? AND days < ? ORDER BY days DESC LIMIT 1', (id, utils.get_days_from_date(end) )).fetchone() else: transaction = get_db().exe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transactions_by_rule(id, start=None, end=None):\n transactions = None\n \n if start is not None and end is not None:\n transactions = get_db().execute('SELECT * FROM transactions WHERE rule_id = ? AND days >= ? AND days <= ? ORDER BY days DESC', (id,start, end)).fetchall()\n elif start i...
[ "0.7125169", "0.618485", "0.5856459", "0.58338904", "0.5738404", "0.5664297", "0.55712694", "0.5543796", "0.55017984", "0.54876316", "0.53108495", "0.5232205", "0.5228999", "0.5228067", "0.52164614", "0.5154982", "0.51244783", "0.5107215", "0.50622654", "0.50382036", "0.49982...
0.55717075
6
Create variables for iteratively slicing a dense gradients tensor.
def _CreateDenseMaskAndBegin(sizes, concat_dim): # Since shape is 1-D, shape_of_shape = [rank-of-inputs] shape_of_shape = array_ops.shape(sizes[0]) # Make a vector of length equal to the input's dimensions, # with 0's everywhere and 1 in the concat dim position. # Note: Can't use sparse_to_dense sin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_step_direction_variables(self):\n with tf.variable_scope(\"Gradient_Variables\"):\n self.step_direction_variables = []\n for train_var in self._train_vars:\n # print(gradient_tensor.name,\"\\t\", gradient_tensor.shape)\n new_var = tf.Variable(t...
[ "0.6483938", "0.60966635", "0.59462374", "0.59323287", "0.592873", "0.58915526", "0.57863456", "0.5717927", "0.56802225", "0.5652927", "0.56248575", "0.5602806", "0.55170155", "0.55131286", "0.5510281", "0.55026764", "0.54862034", "0.54654866", "0.5454369", "0.5446214", "0.54...
0.0
-1
Extract the shapes of a set of input tensors.
def _ExtractInputShapes(inputs): if context.executing_eagerly(): return array_ops.shape_n(inputs) sizes = [] fully_known = True for x in inputs: input_shape = array_ops.shape(x) if not isinstance(input_shape, tensor.Tensor) or input_shape.op.type != "Const": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _collect_input_shape(input_tensors):\n input_tensors = to_list(input_tensors)\n shapes = []\n for x in input_tensors:\n try:\n shapes.append(K.int_shape(x))\n except TypeError:\n shapes.append(None)\n return unpack_singleton(shapes)", "def determine_input_shape...
[ "0.74132705", "0.6673124", "0.65679866", "0.64666915", "0.63785607", "0.63148874", "0.62439173", "0.6211715", "0.6206442", "0.614795", "0.6132616", "0.61141354", "0.61008304", "0.60622054", "0.60212153", "0.60059935", "0.6002112", "0.59969956", "0.5990736", "0.5973119", "0.59...
0.7791871
0
Converts an IndexedSlices to a Tensor without sparse>dense warnings.
def _IndexedSlicesToTensorNoWarning(indexed_slices): if not isinstance(indexed_slices, indexed_slices_lib.IndexedSlices): # If it is not IndexedSlices, it's better be a tensor. return indexed_slices if indexed_slices.dense_shape is None: raise ValueError( "Tensor conversion requested for Indexed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dense_to_sparse(self, tensor: tf.Tensor) -> tf.Tensor:\n tensor_shape = tensor.shape\n expand_dims = len(tensor_shape) == 3\n\n tensor = tf.gather_nd(tf.reshape(tensor, (-1, 1)), self.observations_index)\n if expand_dims:\n tensor = tf.expand_dims(tensor, axis=-1)\n ...
[ "0.6567097", "0.6440365", "0.6411281", "0.6373754", "0.61441654", "0.604684", "0.5930216", "0.5930216", "0.58366287", "0.5814576", "0.5810296", "0.5748112", "0.56882304", "0.56208664", "0.5564672", "0.55552876", "0.5476606", "0.54677033", "0.5425513", "0.5420317", "0.54176897...
0.76017696
0
Addds the batch offsets to the given indices and returns the results.
def _GetBatchIndices(params_shape, indices, batch_dims): batch_indices = indices indices_dtype = indices.dtype.base_dtype casted_params_shape = math_ops.cast(params_shape, indices_dtype) accum_dim_value = array_ops.ones((), dtype=indices_dtype) for dim in range(batch_dims, 0, -1): dim_value = casted_param...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gather_list_batch(data, indices):\n\n assert isinstance(indices, (tuple, list)) or (isndarray(indices) and len(indices.shape) == 1)\n\n if isndarray(data):\n return data[indices]\n\n assert len(data) > 0 and len(indices) > 0\n\n sample = np.array(data[0]) # Try to convert the first element ...
[ "0.6309029", "0.6268375", "0.61764604", "0.61056674", "0.6072039", "0.60164624", "0.5971099", "0.5971099", "0.5854358", "0.5816032", "0.58129656", "0.5738201", "0.57165", "0.5703611", "0.5616374", "0.5616147", "0.56005853", "0.55351055", "0.55333155", "0.5527195", "0.5527195"...
0.5806067
11