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 |
|---|---|---|---|---|---|---|
Configure the custom logger for this script All info messages and higher will be shown on the console All messages from all priorities will be streamed to a log file | def _configure_logger():
global modlog
modlog = logging.getLogger("pyjen")
modlog.setLevel(logging.DEBUG)
# Primary logger will write all messages to a log file
log_file = os.path.join(log_folder, "run.log")
if os.path.exists(log_file):
os.remove(log_file)
file_logger = logging.File... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_logger(self):\n LOG_FORMAT = \"alaScrapy MQ: %(asctime)s %(levelname)s [%(\" \\\n \"name)s] %(message)s\"\n DATE_FORMAT = '%Y-%m-%d %H:%M:%S'\n\n logging.basicConfig(format=LOG_FORMAT, datefmt=DATE_FORMAT)\n\n graylog_host = self.project_conf.get(\"LOGGING\... | [
"0.7231038",
"0.7158869",
"0.7125436",
"0.6950104",
"0.6934436",
"0.68959403",
"0.68464226",
"0.6788175",
"0.677528",
"0.6715628",
"0.6690173",
"0.6689105",
"0.66836023",
"0.66570264",
"0.6636306",
"0.6621245",
"0.6604883",
"0.6599008",
"0.6598897",
"0.65963227",
"0.6586053",... | 0.7178067 | 1 |
Generates and returns a random string of given size. | def random_string_generator(size=10, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rndstr(size=16):\n _basech = string.ascii_letters + string.digits\n return \"\".join([random.choice(_basech) for _ in range(size)])",
"def create_random_string(size=6, chars=string.ascii_uppercase + string.digits):\n return ''.join(random.choice(chars) for _ in range(size))",
"def create_random_st... | [
"0.850833",
"0.8415689",
"0.8275767",
"0.81544864",
"0.8058256",
"0.8055114",
"0.79899347",
"0.79217094",
"0.7918489",
"0.7917389",
"0.7750766",
"0.77121294",
"0.7651435",
"0.7594222",
"0.7555718",
"0.7537469",
"0.7537386",
"0.75201523",
"0.7498902",
"0.74953437",
"0.7494372"... | 0.83510053 | 2 |
Generates and returns a unique slug for the instance. It assumes that the `instance` have a `title` and `slug` field. The maximum length of the returned slug is 50. | def unique_slug_generator(instance, new_slug=None):
if new_slug is not None:
slug = new_slug
else:
slug = slugify(instance.title)[:46]
Klass = instance.__class__
qs_exists = Klass.objects.filter(slug=slug[:50]).exists()
if qs_exists:
new_slug = "{slug}-{randstr}".format(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_unique_slug(qs, instance, slug, max_length, field_name, index_sep):\n\n original_slug = slug = crop_slug(slug, max_length)\n\n index = 1\n\n # keep changing the slug until it is unique\n while True:\n # find instances with same slug\n rivals = qs.filter(**{field_name: slug}).... | [
"0.7922741",
"0.7900601",
"0.7450079",
"0.7390465",
"0.73400456",
"0.7329353",
"0.72962856",
"0.7249136",
"0.7238602",
"0.7218577",
"0.72157794",
"0.720868",
"0.720868",
"0.720868",
"0.71749955",
"0.7166602",
"0.713716",
"0.71087444",
"0.7079556",
"0.70793056",
"0.70793056",
... | 0.7358709 | 4 |
parse json file from uri to dictionary | def fetch_data(url: str) -> dict:
instance_dict = {}
try:
instance_dict = requests.get(url).json()
except requests.ConnectionError:
logger.error("couldn't get the remote instance file.")
return instance_dict | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_json() -> 'Dict: {path : url}':\n\n try:\n with open(\"WEBPAGES_RAW/bookkeeping.json\", \"r\", encoding=\"utf-8\") as file:\n data = json.load(file)\n return data\n\n except IOError:\n print(\"Json file not found in the directory.\")",
"def _parse_json_file(*arg... | [
"0.7049311",
"0.6988718",
"0.6977693",
"0.688423",
"0.68757725",
"0.68412864",
"0.6785991",
"0.67439795",
"0.674343",
"0.6679052",
"0.66554064",
"0.6642034",
"0.66156745",
"0.6611131",
"0.6597682",
"0.65851057",
"0.65851057",
"0.65791273",
"0.6564763",
"0.6563964",
"0.6561258... | 0.0 | -1 |
Remove the . from the given string and fill it (with zeroes) to the length we want | def clean_stored_float(clean_string, fill_amount):
clean_string = re.sub('\..+', '', clean_string).zfill(fill_amount)
return clean_string | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def propend_zero(string, desired_length):\n\n while len(string) < desired_length:\n string = '0' + string\n return string",
"def add_zero_at_left(my_string, length):\n return str(my_string).zfill(length)",
"def _prepend_zero(self, value: str, length: int = 2) -> str:\n final_value = valu... | [
"0.6936402",
"0.6883312",
"0.6646126",
"0.64851594",
"0.63165563",
"0.62987435",
"0.6278474",
"0.62389827",
"0.60082835",
"0.6008282",
"0.5994976",
"0.59790444",
"0.59056336",
"0.59056336",
"0.5804979",
"0.5793741",
"0.57825416",
"0.5778484",
"0.5775382",
"0.57520115",
"0.574... | 0.59630334 | 12 |
Determines if the ppop is in a valid format to be in the US | def us_ppop(ppop):
# return false if it's null or not 7 digits long
if not ppop or len(ppop) != 7:
return False
ppop = ppop.upper()
if ppop[:2] in g_state_by_code or ppop[:2] in g_state_code_by_fips:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid_postcode(postcode):\n if len(postcode) != 6 or postcode[:2] != \"72\":\n return False\n return postcode.isdigit()",
"def _check_plaza(place):\n return len(place) <= 3 and int(place) < num_final and place.isdigit()",
"def is_valid_format(format):\n if format in VALID_FORMAT_TYPES:\... | [
"0.6016091",
"0.5867576",
"0.58374935",
"0.5825786",
"0.57899386",
"0.5779235",
"0.57188433",
"0.57080114",
"0.56952494",
"0.5667462",
"0.56586856",
"0.56575614",
"0.5625752",
"0.5529173",
"0.55208874",
"0.5497819",
"0.5481178",
"0.5472994",
"0.5471299",
"0.5427581",
"0.54114... | 0.67426926 | 0 |
Returns whether the stack is empty. | def empty(self) -> bool:
return self.size==0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_stack_empty(self):\n if self.stack.__len__() == 0:\n return True\n else:\n return False",
"def is_empty(self):\n return len(self.__stack) == 0",
"def is_empty(self):\n return self.stack == []",
"def is_empty(self):\n return self.stack == []",
... | [
"0.9223479",
"0.9104887",
"0.90884537",
"0.90884537",
"0.90884537",
"0.90884537",
"0.90185934",
"0.9015882",
"0.89481044",
"0.89459634",
"0.89435357",
"0.89222306",
"0.8914569",
"0.88877344",
"0.8867761",
"0.8850044",
"0.8830557",
"0.87923694",
"0.87492615",
"0.87358737",
"0.... | 0.0 | -1 |
Sets both arms back into a neutral pose. | def set_neutral(self):
print("Moving to neutral pose...")
self._right_arm.move_to_neutral(speed = 0.15) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_to_neutral(self):\n\t\tself._limb.move_to_neutral()",
"def disarm(self):\n self._armed.clear()",
"def reset(self):\n self.Sa = np.zeros(self.nb_arms)\n self.Na = np.zeros(self.nb_arms)\n self.reward = np.zeros(self.T)\n self.arm_sequence = np.zeros(self.T, dtype=int)... | [
"0.6232984",
"0.6022909",
"0.5988901",
"0.5969193",
"0.58581823",
"0.58363205",
"0.57967454",
"0.56597465",
"0.5567458",
"0.55593824",
"0.5524604",
"0.55045277",
"0.54730046",
"0.54384863",
"0.5421754",
"0.54140985",
"0.54097",
"0.5407517",
"0.5393436",
"0.5349995",
"0.532559... | 0.746516 | 0 |
An Element representing the current page's `document` object. | def document(self):
response = self.evaluate('document')
return Element(response['objectId'], response['description'], self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def document(self):\n return self.__document",
"def document(self):\n return self.__document",
"def element(self):\n return self.__xml",
"def element(self):\n return self._element",
"def element(self):\n return self._element",
"def element(self):\n\t\t\treturn self.... | [
"0.6302342",
"0.6302342",
"0.6292899",
"0.6254359",
"0.6241219",
"0.6211916",
"0.6211916",
"0.61295563",
"0.61154366",
"0.6093469",
"0.6089033",
"0.6086315",
"0.60388094",
"0.6014843",
"0.60111624",
"0.60111624",
"0.59872884",
"0.59872884",
"0.59574276",
"0.5950093",
"0.59188... | 0.70565695 | 0 |
Return the URL of the current page. | def url(self):
response = self.session.send('Target.getTargetInfo', targetId=self._target_id)
return response.get('targetInfo', {}).get('url') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url(self) -> str:\n self.log.step('py.url - Get the current page URL')\n return self.webdriver.current_url",
"def get_url(self):\n return self.__current_url",
"def get_url(self) -> str:\n\n return self.__page_url",
"def get_current_url(self):\n url = self.driver.current... | [
"0.8423145",
"0.8299696",
"0.8040945",
"0.792165",
"0.78458697",
"0.7711966",
"0.726468",
"0.7221916",
"0.7181826",
"0.71542525",
"0.71185243",
"0.7094594",
"0.706099",
"0.70167804",
"0.696885",
"0.69121933",
"0.6825877",
"0.68216795",
"0.6817203",
"0.6817203",
"0.67879564",
... | 0.0 | -1 |
Returns a namedtuple with arguments extracted from the command line. No default values are specified here to avoid double specification in run_experiment function. At the end no matter how the code gets executed run_experiment will always be run. | def get_train_args():
parser = argparse.ArgumentParser(
description='This will parse the argument and pass them \
as parameters to th emian experiment function')
parser.add_argument('--env', type=str,
help="The name of the class of the environment to run on")
parser.add... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getArguments():\n parser = argparse.ArgumentParser()\n\n # Required arguments\n parser.add_argument('dataset', help='The name of the dataset.')\n\n return parser.parse_args()",
"def get_arguments():\n parser = argparse.ArgumentParser(description=\"Emergent Timetable\")\n parser.add_argument... | [
"0.6905082",
"0.6882387",
"0.68773943",
"0.6834121",
"0.6825474",
"0.68049186",
"0.6799455",
"0.67257315",
"0.6682216",
"0.6675029",
"0.66694874",
"0.6659988",
"0.6656884",
"0.66477484",
"0.66413456",
"0.66395843",
"0.6635682",
"0.663401",
"0.6611223",
"0.66022813",
"0.660112... | 0.0 | -1 |
Returns a namedtuple with arguments extracted from the command line. No default values are specified here to avoid double specification in run_experiment function. At the end no matter how the code gets executed run_experiment will always be run. | def get_load_args():
parser = argparse.ArgumentParser(
description='This will parse the argument used in \
loading a model and pass them as parameters to the loader function')
parser.add_argument('--env', type=str,
help="The name of the class of the environment to run on, i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getArguments():\n parser = argparse.ArgumentParser()\n\n # Required arguments\n parser.add_argument('dataset', help='The name of the dataset.')\n\n return parser.parse_args()",
"def get_arguments():\n parser = argparse.ArgumentParser(description=\"Emergent Timetable\")\n parser.add_argument... | [
"0.69025004",
"0.68808556",
"0.68751365",
"0.6831522",
"0.68239313",
"0.680209",
"0.6796032",
"0.67229885",
"0.6680024",
"0.6672788",
"0.66679937",
"0.6657379",
"0.66538316",
"0.6646287",
"0.6638974",
"0.66373813",
"0.66348475",
"0.663292",
"0.66095936",
"0.659925",
"0.659850... | 0.0 | -1 |
Test Point2D class initialization. | def test_point2d(self) -> None:
test_point = line2d.Point2D(1, 2)
self.assertEqual(test_point.x, 1)
self.assertEqual(test_point.y, 2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_init_with_point2d(self):\n polygon = Polygon2d([Point2d(0, 0), Point2d(2, 0), Point2d(1, 2)])\n assert_that(len(polygon), equal_to(3))\n assert_that(polygon.points[0], equal_to(Point2d(0, 0)))\n assert_that(polygon.points[1], equal_to(Point2d(2, 0)))\n assert_that(polygo... | [
"0.76248366",
"0.7615875",
"0.74868953",
"0.6837494",
"0.67010343",
"0.65971327",
"0.6582356",
"0.6578195",
"0.6566521",
"0.6539101",
"0.64816654",
"0.6480807",
"0.6480807",
"0.64708525",
"0.64511245",
"0.6433157",
"0.6433157",
"0.6433157",
"0.6433157",
"0.6433157",
"0.643315... | 0.801875 | 0 |
Checks whether number is prime or not | def is_prime(number):
list = [] # list of divisors of the number
for i in range(1, number + 1):
if number % i == 0:
# If we already have more than 1 divisor we don't need
# to append current one. Number is not prime.
if len(list) > 1:
return False
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_prime(num: int) -> bool:\n pass",
"def is_prime(number: int) -> bool:\n if number < 2:\n return False\n elif number == 2:\n return True\n else:\n divisor_number = 2\n while divisor_number <= math.sqrt(number):\n if number % divisor_number == 0:\n ... | [
"0.84016347",
"0.82585424",
"0.8170454",
"0.81611633",
"0.81201255",
"0.8107174",
"0.8071337",
"0.8059115",
"0.8043303",
"0.8033328",
"0.80317956",
"0.80283237",
"0.7997256",
"0.79892963",
"0.7969386",
"0.7955145",
"0.79374105",
"0.79374105",
"0.7929373",
"0.7927354",
"0.7907... | 0.7581494 | 51 |
Takes dataframe and converts first column to DateTimeIndex | def _timeseries_index(df, freq):
df2 = df.set_index('Unnamed: 0')
if freq == 'Q':
df2.index = _create_quarterly_index(df2.index)
elif freq == 'M':
df2.index = pd.to_datetime(df2.index, format='%Y %b', errors='raise')
elif freq == 'A':
df2.index = pd.to_datetime(df2.index, format=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def float_index_to_time_index(df, inplace=False):\n if not inplace:\n df = df.copy()\n df.index = df.index.map(datetime.utcfromtimestamp)\n df.index = pd.to_datetime(df.index, unit=\"us\", utc=False)\n return df",
"def create_timestamp_indexes(\n df_raw: pd.DataFrame,\n column: s... | [
"0.72680813",
"0.6863086",
"0.68482834",
"0.6538109",
"0.65083605",
"0.64966524",
"0.64935565",
"0.64889246",
"0.64770913",
"0.6456614",
"0.61885375",
"0.61738724",
"0.6166372",
"0.6153435",
"0.61508757",
"0.603829",
"0.5985267",
"0.59021133",
"0.5869867",
"0.57888573",
"0.57... | 0.64655256 | 9 |
Returns the date yearsback years before today. | def _get_initial_date(yearsback):
from datetime import datetime
initial_date = datetime.now()
try:
initial_date = initial_date.replace(year=initial_date.year - yearsback)
except ValueError:
initial_date = initial_date.replace(
year=initial_date.year - yearsback, day=initia... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_200_years_ago(local_now):\n return local_now.date() + relativedelta.relativedelta(years=-200)",
"def date_years_hence(self, years_hence=1):\n\n today = datetime.date.today()\n\n try:\n return today.replace(year=today.year + years_hence)\n\n except ValueError: # 29 Febr... | [
"0.75096124",
"0.7178162",
"0.7119812",
"0.6908288",
"0.67280746",
"0.6697965",
"0.6448664",
"0.6421289",
"0.64192456",
"0.64096266",
"0.63275063",
"0.62487024",
"0.61328655",
"0.6115408",
"0.60411507",
"0.60085946",
"0.59918153",
"0.59760606",
"0.5955929",
"0.595282",
"0.595... | 0.65155727 | 6 |
Return boolean indicating if the underlying service is actively running. A service is considered running if it has been started and has not yet been stopped. | def is_running(self) -> bool:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_running(self):\n return self.service and self.service.is_running()",
"def running(self):\n return self.state == service_states.RUNNING",
"def is_running(self):\n if self.control is None:\n return False\n \n return self.control.is_alive()",
"def is_service_... | [
"0.87006414",
"0.8099241",
"0.80698204",
"0.7962302",
"0.79125124",
"0.7896766",
"0.7878018",
"0.7835118",
"0.7835118",
"0.7803004",
"0.7803004",
"0.7802494",
"0.7793098",
"0.7783551",
"0.7780137",
"0.7752425",
"0.77394557",
"0.77339655",
"0.7719139",
"0.7707987",
"0.7704982"... | 0.73097485 | 44 |
Return boolean indicating if the underlying service is stopped. A stopped service will have completed all of the background tasks. | def is_finished(self) -> bool:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_stopped():\n return status() == 'stopped'",
"def _is_stopped(self):\n return not self._run_state.is_running()",
"def is_stopped(self) -> bool:\n return self._is_stopped",
"def is_stopped(self):\n return self._stopped",
"def stopped(self):\n\t\treturn self._stop.isSet()",
"d... | [
"0.7714271",
"0.7615161",
"0.7610683",
"0.7569951",
"0.75681293",
"0.7515244",
"0.7506681",
"0.74767506",
"0.7432971",
"0.741784",
"0.7406244",
"0.74010277",
"0.73562956",
"0.73562956",
"0.73562956",
"0.73562956",
"0.72970617",
"0.7147288",
"0.6958374",
"0.68657446",
"0.68657... | 0.0 | -1 |
Wait until the service is started. | async def wait_started(self) -> None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait(self):\n super(Service, self).wait()",
"def wait_for_start(self):\n self.server_started_event.wait()",
"async def start_object(self):\n\n dt = 1.0\n\n while True:\n service = await self.get_task()\n if not service:\n raise RuntimeError(\... | [
"0.826282",
"0.784854",
"0.72184837",
"0.7066786",
"0.7053556",
"0.7008065",
"0.6855549",
"0.682854",
"0.68043816",
"0.67666924",
"0.67391455",
"0.6681031",
"0.66699004",
"0.66517913",
"0.6639575",
"0.6635263",
"0.6612861",
"0.659964",
"0.65816534",
"0.6561004",
"0.6525245",
... | 0.77517796 | 2 |
Test api returns ingredient for authenticated user | def test_ingredient_limited_user(self):
self.user2 = get_user_model().objects.create(
email='shubham2.test@gmail.com',
password='shubham2',
)
Ingredient.objects.create(user=self.user2, name='Chikoo')
ingredient = Ingredient.objects.create(user=self.user, name='Lem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_retrieve_authenticated_user_ingredients_only(self):\n user2 = get_user_model().objects.create_user(\n email=\"other@gotmail.com\",\n password=\"ohterpass\",\n name=\"Name 2\"\n )\n ing = Ingredient.objects.create(name=\"Test Ing1\", user=self.user)\n ... | [
"0.8116268",
"0.7869104",
"0.78586644",
"0.78416526",
"0.7730703",
"0.77215636",
"0.7691455",
"0.7683567",
"0.7661991",
"0.7626809",
"0.7582121",
"0.7531578",
"0.7514204",
"0.7512057",
"0.7473956",
"0.74524343",
"0.7429714",
"0.73835087",
"0.7289532",
"0.72563636",
"0.7238508... | 0.79218066 | 1 |
Test ingredients are created successfully | def test_create_ingredient_successfully(self):
payload = {'name': 'cabbage'}
res = self.client.post(INGREDIENTS_URL, payload)
exists = Ingredient.objects.filter(
user=self.user,
name=payload['name']
).exists()
self.assertEqual(res.status_code, status.HTTP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_recipe_with_ingredients(self):\n ingredient1 = sample_ingredient(self.user, name='Prawns')\n ingredient2 = sample_ingredient(self.user, name='Ginger')\n payload = {\n 'title': 'Thai Prawn Red Curry',\n 'ingredients': [ingredient1.id, ingredient2.id],\n ... | [
"0.82702005",
"0.8261571",
"0.82487017",
"0.82128847",
"0.819687",
"0.81774265",
"0.8109876",
"0.8103343",
"0.8075414",
"0.80437326",
"0.7988449",
"0.7953624",
"0.7945217",
"0.79401135",
"0.7914474",
"0.7856223",
"0.78385144",
"0.75769556",
"0.7549749",
"0.7542305",
"0.753551... | 0.7898033 | 15 |
Initializes an empty queue. | def __init__(self, *args, **kwargs):
self.queue = PRPriorityQueue()
if len(args) == 3:
self.insert(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self._queue = [None] * QueueArray.INITIAL_CAPACITY\n self._size = 0\n self._head = 0",
"def test_init_queue(self):\n q = Queue()\n self.assertIsInstance(q, Queue)\n self.assertIsNone(q.first)\n self.assertIsNone(q.last)\n self.assertEq... | [
"0.81106323",
"0.79936826",
"0.7801058",
"0.77644175",
"0.7716629",
"0.7639008",
"0.7638292",
"0.7569397",
"0.755873",
"0.74481595",
"0.741102",
"0.741102",
"0.741102",
"0.741102",
"0.741102",
"0.741102",
"0.741102",
"0.735734",
"0.7309348",
"0.7262602",
"0.72578675",
"0.72... | 0.0 | -1 |
Generate a random string of fixed length | def randomString(istr):
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(len(istr))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_string(length=15):\n\n rand_str = \"\"\n for _ in range(length):\n rand_str += random.choice(\"abcdefABCDEF\" + string.digits) # nosec\n\n return rand_str",
"def _rand_str(self, string_len):\n return binascii.hexlify(os.urandom(string_len))",
"def random_strin... | [
"0.8622677",
"0.8519229",
"0.8465095",
"0.8434765",
"0.8404023",
"0.8397009",
"0.83947253",
"0.8381278",
"0.8377062",
"0.83605546",
"0.8351346",
"0.83512384",
"0.83195645",
"0.826418",
"0.8247328",
"0.822978",
"0.82281053",
"0.8217121",
"0.81867296",
"0.8178301",
"0.81648356"... | 0.0 | -1 |
Returns human readable time. | def get_data_naturaltime(self, obj):
return naturaltime(obj.date) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_human_readable(self) -> str:\n if self.seconds is None:\n return \"∞\" # infinity\n result = \"\"\n if self.seconds > 24 * 3600:\n result += \"{} {} \".format(int(self.seconds / 24 / 3600), \"Tage\")\n result += \"{:02}:{:02}:{:02}h\".format(\n ... | [
"0.78284496",
"0.7724255",
"0.75480336",
"0.7478574",
"0.7464184",
"0.742059",
"0.7386013",
"0.73810405",
"0.734923",
"0.73244655",
"0.73229647",
"0.73056763",
"0.72593516",
"0.7251345",
"0.7247951",
"0.7244815",
"0.7220781",
"0.7175165",
"0.71291316",
"0.71072173",
"0.708768... | 0.0 | -1 |
r"""Gets the configuration details of a snapshot. Snapshots are used in <a | async def get_snapshot(
self,
request: Union[pubsub.GetSnapshotRequest, dict] = None,
*,
snapshot: str = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Snapshot:
# Crea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_snapshot(self, snapshot):\n return self._get(_snapshot.Snapshot, snapshot)",
"def describe_db_snapshot_attributes(DBSnapshotIdentifier=None):\n pass",
"def get_instance_snapshot(instanceSnapshotName=None):\n pass",
"def get_snapshot_metadata(self, snapshot):\n snapshot = self._get... | [
"0.63844883",
"0.59331447",
"0.592043",
"0.5896172",
"0.5797678",
"0.5762317",
"0.57500124",
"0.5741919",
"0.56976026",
"0.56761",
"0.5675403",
"0.5675403",
"0.56483835",
"0.5643668",
"0.5574808",
"0.55413264",
"0.5496931",
"0.5466911",
"0.54392445",
"0.54392445",
"0.54392445... | 0.0 | -1 |
This will return the successor states of the given game states by trying to put a piece in each column | def get_successor_states(game_state):
successors = []
for _column in range(7):
successor_state = maxConnect4Game(game_state.get_current_board(), currentTurn=game_state.get_next_player())
if successor_state.playPiece(_column):
successors.append((_column, successor_state))
return s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def successors_of(state):\n returnStates = []\n moveNumber = 0\n for i in state:\n if i not in numbers:\n moveNumber += 1\n isX = moveNumber % 2 == 0\n\n for i in range(9):\n possibleState = state[:]\n if state[i] in numbers: # State i is a slot that is not yet occup... | [
"0.71365386",
"0.7127269",
"0.71112436",
"0.68129325",
"0.68100774",
"0.6782876",
"0.67748934",
"0.6742433",
"0.6734175",
"0.67260915",
"0.66716915",
"0.66701883",
"0.66696346",
"0.6631024",
"0.65960735",
"0.65827346",
"0.65739274",
"0.6555016",
"0.6549807",
"0.65241975",
"0.... | 0.7626055 | 0 |
This will return a list of dicts of each possible move and its eval score. | def alpha_beta_decision(initial_game_state, depth_limit, max_player):
alpha = -2147483648
beta = 2147483648
next_possible_moves = list()
for column, successor_state in get_successor_states(initial_game_state):
next_possible_moves.append(
{
'column': column,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_moves(self):\n self.moves = {\"g\": self.findmoves(\"g\"), \"r\": self.findmoves(\"r\")}",
"def ai_moves(self):\n self.update_ai_pawns()\n possible_moves = {}\n\n for pawn in self.ai_pawns:\n templist = {}\n # List of next position after each possib... | [
"0.68168885",
"0.6685692",
"0.6642498",
"0.6571569",
"0.6254361",
"0.61680436",
"0.6136899",
"0.6119118",
"0.61053",
"0.6075439",
"0.6067924",
"0.6026885",
"0.60145485",
"0.6001697",
"0.5957051",
"0.59127486",
"0.5909301",
"0.5908072",
"0.58969563",
"0.5868291",
"0.5867934",
... | 0.0 | -1 |
Returns the size of FieldArray. | def __len__(self):
return len(self.content) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_size(self, py_array):\r\n\r\n return len(t_funcs.flatten(py_array))",
"def size(self):\n return len(self._field)",
"def array_size(self) -> Optional[int]:\n return pulumi.get(self, \"array_size\")",
"def get_array_size(self):\n return conf.lib.clang_getArraySize(self)",
... | [
"0.788839",
"0.7624087",
"0.7611838",
"0.75569004",
"0.74485475",
"0.7278175",
"0.71262103",
"0.70962197",
"0.6986119",
"0.6907786",
"0.68581396",
"0.6846104",
"0.6831283",
"0.68055844",
"0.6764263",
"0.67603725",
"0.6760304",
"0.67465234",
"0.67437416",
"0.6702185",
"0.67021... | 0.0 | -1 |
Returns the Euclidean distance between | def find_distance(x1, y1, x2, y2):
distance_x = x1 - x2
distance_y = y1 - y2
return sqrt(sum_squares(distance_x, distance_y)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def euclidean_distance(self, x1, x2):\n return np.sqrt(np.sum((x1 - x2) ** 2))",
"def euclidean_distance(self, X, Y) :\n return math.sqrt(sum([(a - b)**2 for a, b in zip(X, Y)]))",
"def EuclideanDistance(start, end):\n return ((end[0]-start[0]) ** 2 + (end[1]-start[1]) ** 2) ** 0.5",
"def eu... | [
"0.80578387",
"0.8028381",
"0.8017602",
"0.80128944",
"0.79547715",
"0.792663",
"0.79143476",
"0.7909894",
"0.78859794",
"0.78845125",
"0.783493",
"0.7793777",
"0.778567",
"0.7776793",
"0.77581364",
"0.772126",
"0.7721114",
"0.7702497",
"0.76752746",
"0.7630856",
"0.76178175"... | 0.0 | -1 |
Plots MNIST images with corresponding network predictions. | def view_predictions(images, predictions, num_plot=10, save_name=None):
if images.shape[0] < num_plot:
return
fig = plt.figure()
for i in range(num_plot):
im = images[i, 0]
plt.subplot(1, num_plot, i + 1)
plt.imshow(im, cmap='gray')
plt.axis('off')
plt.tit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_real_images():\n X, y = load_mnist(PATH, is_train=False, return_as_iterator=False)\n y = np.argmax(y, axis=1) # turn one hot to single label\n final_indices = np.array([])\n for cls in range(10):\n indices = np.argwhere(y == cls).reshape(-1) # get all indices that fit the class\n ... | [
"0.72807443",
"0.708923",
"0.6960852",
"0.69513553",
"0.6944146",
"0.69160175",
"0.68771917",
"0.6834704",
"0.6831951",
"0.68145454",
"0.6807221",
"0.6798732",
"0.67843515",
"0.67775434",
"0.66714627",
"0.665494",
"0.6646845",
"0.66390604",
"0.66089386",
"0.6592691",
"0.65817... | 0.68149257 | 9 |
Compute the probability of a child being born late. Assumes the input is a pmf of pregnancy lengths | def ProbLate(pmf):
prob = 0
i = 41
while i < 50:
prob += pmf.Prob(i)
i += 1
return prob | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def probability_of_kill(self, herb):\n if self.animal_fitness <= herb.animal_fitness:\n return 0\n elif 0 < self.animal_fitness - herb.animal_fitness < \\\n self.parameters['DeltaPhiMax']:\n return (self.animal_fitness - herb.animal_fitness) / \\\n ... | [
"0.6857458",
"0.6418847",
"0.6413015",
"0.6220258",
"0.6215392",
"0.61827093",
"0.6120073",
"0.6045906",
"0.5975062",
"0.5949976",
"0.5938554",
"0.5923631",
"0.5854549",
"0.5825549",
"0.5819392",
"0.57987314",
"0.57534885",
"0.57454884",
"0.57149637",
"0.5706647",
"0.5704941"... | 0.64105046 | 3 |
Sets up the basic variables like scale and bias of sensors. | def __init__(self, bus, address):
self.cfg = config.getConfigVals()
self.cfg.Address = address
self.Bus = bus
self.AccelBias = np.array([0.0, 0.0, 0.0])
self.Accels = np.array([1.0, 1.0, 1.0])
self.MagBias = np.array([0.0, 0.0, 0.0])
self.Mags = np.array([1.0, 1.0, 1.0])
self.GyroBias = np.array([0.0, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_variables(self):\n # variable and parameter definitions\n self.x = cp.Variable(self.mu.size)\n self.gamma = cp.Parameter(nonneg=True)",
"def setup(self) -> None:\n # Set up the light sensors for reading.\n self.light_sensors.setup()\n if self.motor:\n ... | [
"0.6864586",
"0.658091",
"0.65082717",
"0.64214337",
"0.6395685",
"0.63648623",
"0.63138986",
"0.6306522",
"0.62276256",
"0.61985755",
"0.618952",
"0.6187101",
"0.618667",
"0.6184035",
"0.61672485",
"0.61644703",
"0.61643803",
"0.6157724",
"0.6155193",
"0.6148976",
"0.6140330... | 0.0 | -1 |
Sets the range of accelerometer | def setAccelRange(self, accelRange):
try:
self.__writeRegister(self.cfg.AccelConfig, self.cfg[accelRange])
self.AccelRange = accelRange
except:
print ("{0} is not a proper value for accelerometer range".format(accelRange))
return -1
accelVal = float(accelRange.split('t')[1].split('G')[0])
self.Ac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetRange(self, range):\n self.range=range\n wx.Gauge.SetRange(self,range)\n self.Calcumalate()",
"def set_DCV_range(self, range):\n self.set_property(\"Sense Range Voltage\", range)",
"def setRange(self, range):\n if range == self.Range.k2G:\n value = 0\n ... | [
"0.7138732",
"0.6676816",
"0.6593032",
"0.65907335",
"0.6500335",
"0.643086",
"0.63241285",
"0.63044035",
"0.6217828",
"0.6180507",
"0.6154273",
"0.6150545",
"0.61362493",
"0.60748637",
"0.60619545",
"0.60615",
"0.60566694",
"0.60283846",
"0.60234135",
"0.59982914",
"0.599739... | 0.8046119 | 0 |
Returns the original router path (with url param names) for given request. | def _get_router_path(scope: Scope) -> Optional[str]:
if not (scope.get("endpoint", None) and scope.get("router", None)):
return None
root_path = scope.get("root_path", "")
app = scope.get("app", {})
if hasattr(app, "root_path"):
app_root_path = getattr(app, "roo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_path(self) -> str:\n return pulumi.get(self, \"request_path\")",
"def parse_path(request: object) -> str:\n return request.path.replace(\"/\", ' ').split()[-1]",
"def path(self):\n router = self\n parts = []\n while router.parent is not None:\n # We go from... | [
"0.7011517",
"0.69270337",
"0.6389485",
"0.6334858",
"0.6270485",
"0.62462026",
"0.6090928",
"0.6070698",
"0.5999896",
"0.59571385",
"0.59185",
"0.58918417",
"0.58774173",
"0.5867267",
"0.58218294",
"0.57595813",
"0.5716758",
"0.5599992",
"0.55775917",
"0.557511",
"0.5555527"... | 0.5462663 | 28 |
Given a category code, a language abbreviation (e.g. "en"), and a stage, this function returns the category's description in that language, if available, and falls back to English, if not. | def glot(code,sql,lang,stage = 5):
outstring = ""
nodict = False
# Some day, SQL...
# for now, a dict:
if code[0] == 's' or code[0] == 'y':
if lang in dict:
if code in dict[lang]:
outstring += dict[lang][code]
elif stage == 5:
if code == "sms1":
return "'Missing strin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_channel_description(lang=None, variant=None):\n if variant and (lang, variant) in CHANNEL_DESCRIPTION_LOOKUP:\n return CHANNEL_DESCRIPTION_LOOKUP[(lang, variant)]\n elif lang in CHANNEL_DESCRIPTION_LOOKUP:\n return CHANNEL_DESCRIPTION_LOOKUP[lang]\n else:\n lang_obj = getlang(... | [
"0.6202626",
"0.61312854",
"0.5820679",
"0.5788267",
"0.57420635",
"0.568711",
"0.5677931",
"0.5677931",
"0.55875933",
"0.5564827",
"0.5439568",
"0.54188913",
"0.537166",
"0.5357186",
"0.5355838",
"0.53361803",
"0.5333731",
"0.5282797",
"0.5278495",
"0.5255325",
"0.5255325",
... | 0.0 | -1 |
Loads data for the specified city and filters by month and day if applicable. | def load_data(city, month, day):
CITY_DATA = { 'chicago': 'chicago.csv',
'new york city': 'new_york_city.csv',
'washington': 'washington.csv' }
df = pd.read_csv(CITY_DATA[city])
df['Start Time'] = pd.to_datetime(df['Start Time'])
df['hour'] = df['Start Time... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_city_data(city, month, day):\n df = pd.read_csv(CITY_DATA[city])\n #extract month, day, hour from start time\n df['month'] = pd.to_datetime(df['Start Time']).dt.month_name()\n df['day'] = pd.to_datetime(df['Start Time']).dt.weekday\n df['hour'] = pd.to_datetime(df['Start Time']).dt.hour\n\n... | [
"0.83183694",
"0.8226695",
"0.8150808",
"0.80794895",
"0.80427766",
"0.8017983",
"0.8001192",
"0.79902804",
"0.7979157",
"0.797769",
"0.79721206",
"0.7957008",
"0.7955993",
"0.79484135",
"0.7931038",
"0.79188",
"0.7912735",
"0.791154",
"0.790504",
"0.7902931",
"0.79026365",
... | 0.7697943 | 79 |
Displays statistics on the most frequent times of travel. | def time_stats(df):
print('\nCalculating The Most Frequent Times of Travel...\n')
start_time = time.time()
# TO DO: display the most common month
df['month'] = df['Start Time'].dt.month_name()
popular_month = df['month'].mode()[0]
print('The most common m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_stats(df):\r\n\r\n print('\\nThese are the statistics of the most frequent times of travel:\\n')\r\n start_time = time.time()\r\n\r\n # Display the most common month\r\n common_month = df['month'].mode()[0]\r\n print(\"- That's the most common month based on your selection: \" +\r\n ... | [
"0.7974609",
"0.7851373",
"0.7800278",
"0.77821916",
"0.7775073",
"0.7762475",
"0.77532375",
"0.77384645",
"0.77262247",
"0.7718093",
"0.7685153",
"0.7683606",
"0.76808155",
"0.7679881",
"0.7650141",
"0.7644975",
"0.7643931",
"0.76428497",
"0.7629725",
"0.76246285",
"0.762423... | 0.726114 | 73 |
Displays statistics on the most popular stations and trip. | def station_stats(df):
print('\nCalculating The Most Popular Stations and Trip...\n')
start_time = time.time()
# TO DO: display most commonly used start station
popular_Start_Station = df['Start Station'].mode()[0]
print('The most commonly used start station: \n',popular_Start_Station)
# TO ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def station_stats(df):\n\n print('\\033[1m' + 'Calculating the most popular stations and trip...\\n' + '\\033[0m')\n start_time = time.time()\n\n # display the most commonly used start station\n\n start_stn = df['Start Station'].mode()[0]\n print('Most popular start station is {}.'.format(start_stn)... | [
"0.7809938",
"0.76727635",
"0.7538624",
"0.74982685",
"0.7490305",
"0.74887866",
"0.7436869",
"0.7429845",
"0.74274427",
"0.7425571",
"0.74126786",
"0.7404592",
"0.7382532",
"0.7379482",
"0.73747545",
"0.7365935",
"0.73561436",
"0.7351966",
"0.7324152",
"0.7304813",
"0.729985... | 0.7118159 | 70 |
Displays statistics on the total and average trip duration. | def trip_duration_stats(df):
print('\nCalculating Trip Duration...\n')
start_time = time.time()
# TO DO: display total travel time
total_travel_time = df['Trip Duration'].sum()
print('total travel time: ', total_travel_time, 'seconds')
total_travel_time1 = df['Trip Duration'].sum()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trip_duration_stats(df):\r\n\r\n print('\\nThese are the statistics related to the trips durations:\\n')\r\n start_time = time.time()\r\n\r\n # Display total travel time\r\n total_travel_time = df['Trip Duration'].sum()\r\n print(\"\\n- The total travel time based on your selection is: \" +\r\n ... | [
"0.8269694",
"0.8117981",
"0.804814",
"0.8046616",
"0.7977989",
"0.79627913",
"0.7959311",
"0.79460865",
"0.7936234",
"0.79295456",
"0.79275835",
"0.792675",
"0.79244053",
"0.791991",
"0.79156506",
"0.79151726",
"0.791299",
"0.79074097",
"0.7903686",
"0.79021114",
"0.7892094"... | 0.0 | -1 |
Returns a list with all purchases of a user. | def get_user_purchases(user, user_id):
fields = [
"id",
"timestamp",
"product_id",
"admin_id",
"productprice",
"amount",
"revoked",
"price",
]
purchases = convert_minimal(user.purchases.all(), fields)
return jsonify(purchases), 200 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self):\n qs = self.request.user.purchases.all()\n\n return qs",
"def get_items_by_user_id(cls, user_id):\n return cls.query.filter_by(user_id=user_id).all()",
"def get_all_user_orders(self, user_id): # add tests\n orders_list = []\n for order in orders:\n ... | [
"0.7711208",
"0.63887084",
"0.6298996",
"0.6099742",
"0.60178804",
"0.58536834",
"0.57930505",
"0.5757979",
"0.5747821",
"0.57233447",
"0.56934035",
"0.569227",
"0.5692267",
"0.56684107",
"0.5645935",
"0.561269",
"0.56091857",
"0.5589391",
"0.55605847",
"0.54761434",
"0.54404... | 0.79968053 | 0 |
Update the user with the given id. | def update_user(admin, user_id):
# Get the update data
data = json_body()
# Query the user. If he/she is not verified yet, there *must* be a
# rank_id given in the update data.
user = User.query.filter(User.id == user_id).first()
if not user:
raise exc.EntryNotFound()
if not user.i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users_update(self, user_id, **kwargs):\n return self.__call_api_post('users.update', userId=user_id, data=kwargs)",
"def update_user(user_id: str):\n form = UserForm()\n if form.validate_on_submit():\n data = {\n \"name\": {\"first\": form.first_name.data, \"las... | [
"0.7530722",
"0.7421468",
"0.7407749",
"0.7370915",
"0.7355504",
"0.73506236",
"0.7333666",
"0.7327685",
"0.72584313",
"0.7246963",
"0.716724",
"0.71649975",
"0.71609086",
"0.71382505",
"0.7114746",
"0.7114498",
"0.7102549",
"0.70882034",
"0.70827055",
"0.7044296",
"0.7015005... | 0.6368563 | 67 |
Test that _create_database sets up the cars table. | def test_create_database(self, mock_sqlite3):
mock_cursor = mock.MagicMock()
mock_sqlite3.connect.return_value = mock_cursor
_create_database()
self.assertTrue(mock_cursor.cursor.called)
mock_cursor.cursor.assert_has_calls([
mock.call(),
mock.call().execut... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_database(self):\n pass",
"def test_create_database(self):\n\n # Setup the tables\n CreateDatabase.run(app=self._app)\n engine = create_engine(TestManagePy.postgresql_url)\n connection = engine.connect()\n\n for model in [User, Library, Permissions]:\n ... | [
"0.824196",
"0.7719283",
"0.76408327",
"0.75813043",
"0.74922603",
"0.746123",
"0.7445213",
"0.7445213",
"0.74152815",
"0.7403317",
"0.73994803",
"0.7379669",
"0.736243",
"0.7357049",
"0.73424",
"0.7327275",
"0.7319616",
"0.73178846",
"0.7311564",
"0.7302962",
"0.7297858",
... | 0.763701 | 3 |
Return the command name for the project | def commandName(self):
return self.name.lower().replace(' ', '-') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_command_name(self) -> str:\n pass",
"def command_name():\r\n \r\n return __command_name",
"def name(self):\n return self._command",
"def command_name(self):\n return self._command_name_dict",
"def get_command_name(self) -> str:\n return ServerCommandNames.GET_TASK"... | [
"0.8321106",
"0.81642264",
"0.78554153",
"0.7597619",
"0.74571526",
"0.7348717",
"0.7227222",
"0.7189147",
"0.7132966",
"0.7071882",
"0.704909",
"0.70085645",
"0.69163615",
"0.68311936",
"0.6805106",
"0.6740284",
"0.6740284",
"0.6707804",
"0.66746825",
"0.665494",
"0.6644038"... | 0.7960179 | 2 |
Return the source file path | def srcpath(self):
return self.path.srcpath | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_source_file(self):\n pass",
"def get_source_path(self):\n source = self.config.get('source', None)\n if source is None:\n self.error('Source must be defined')\n if not os.path.isabs(source):\n source = os.path.join(self.config['confdir'], source)\n ... | [
"0.84802675",
"0.8116148",
"0.77250594",
"0.76027",
"0.7592139",
"0.75896907",
"0.7556308",
"0.7432657",
"0.73200333",
"0.7316738",
"0.7302579",
"0.72870106",
"0.7282861",
"0.7256496",
"0.72505724",
"0.724477",
"0.71736425",
"0.71509475",
"0.71389574",
"0.7138886",
"0.7138886... | 0.82249105 | 1 |
Creates a table with the scheme '' for all the games in the given year | def teamtable(self):
team_info = mlbgame.info.team_info()
# Do some setup
self.cur.executescript('''
DROP TABLE IF EXISTS TEAMS;
CREATE TABLE IF NOT EXISTS TEAMS (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
NAME TEXT UNIQUE,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gen_rs_tables(year):\r\n\r\n months = ('jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez')\r\n sql_code = r'''\r\n DROP TABLE IF EXISTS rs_:mmmaa;\r\n\r\n CREATE TABLE rs_:mmmaa (\r\n cod_apo varchar(20),\r\n item varchar(10),\r\n ... | [
"0.67235285",
"0.6509079",
"0.6270873",
"0.61218035",
"0.5979353",
"0.5690406",
"0.5668279",
"0.5657061",
"0.56365776",
"0.5567513",
"0.5553146",
"0.5545237",
"0.55305934",
"0.55074453",
"0.5486912",
"0.54830986",
"0.5483034",
"0.545706",
"0.54508144",
"0.54399884",
"0.542980... | 0.57193524 | 5 |
Initialize the handler and fetch the required services from the current WSGI application's config. | def initialize(self, request, response):
webapp2.RequestHandler.initialize(self, request, response)
services = ['user_service']
config = self.app.config.load_config('sa', required_keys=services)
self.user_service = config['user_service'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(self, request, response):\r\n webapp2.RequestHandler.initialize(self, request, response)\r\n services = ['news_item_service']\r\n config = self.app.config.load_config('sa', required_keys=services)\r\n self.news_item_service = config['news_item_service']",
"def __init__(... | [
"0.6724116",
"0.6712584",
"0.6640253",
"0.6422026",
"0.64210486",
"0.6363694",
"0.6294106",
"0.6285566",
"0.6225718",
"0.6225076",
"0.6212982",
"0.6212285",
"0.6168231",
"0.6160357",
"0.6135277",
"0.61118484",
"0.6080297",
"0.6029734",
"0.60047686",
"0.5975921",
"0.59041",
... | 0.6724754 | 0 |
Initialize the handler and fetch the required services from the current WSGI application's config. | def initialize(self, request, response):
webapp2.RequestHandler.initialize(self, request, response)
services = ['news_item_service']
config = self.app.config.load_config('sa', required_keys=services)
self.news_item_service = config['news_item_service'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(self, request, response):\r\n webapp2.RequestHandler.initialize(self, request, response)\r\n services = ['user_service']\r\n config = self.app.config.load_config('sa', required_keys=services)\r\n self.user_service = config['user_service']",
"def __init__(self, *args, **... | [
"0.6724754",
"0.6712584",
"0.6640253",
"0.6422026",
"0.64210486",
"0.6363694",
"0.6294106",
"0.6285566",
"0.6225718",
"0.6225076",
"0.6212982",
"0.6212285",
"0.6168231",
"0.6160357",
"0.6135277",
"0.61118484",
"0.6080297",
"0.6029734",
"0.60047686",
"0.5975921",
"0.59041",
... | 0.6724116 | 1 |
Initialize the handler and fetch the required services from the current WSGI application's config. | def initialize(self, request, response):
webapp2.RequestHandler.initialize(self, request, response) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(self, request, response):\r\n webapp2.RequestHandler.initialize(self, request, response)\r\n services = ['user_service']\r\n config = self.app.config.load_config('sa', required_keys=services)\r\n self.user_service = config['user_service']",
"def initialize(self, request... | [
"0.6723432",
"0.67225164",
"0.6712184",
"0.6639297",
"0.6422446",
"0.64217186",
"0.63642776",
"0.6291678",
"0.62836206",
"0.62259024",
"0.6225701",
"0.62112814",
"0.62109965",
"0.6168467",
"0.6158478",
"0.6133747",
"0.6112152",
"0.608142",
"0.602887",
"0.60046023",
"0.5975640... | 0.57721674 | 28 |
The providerassigned unique ID for this managed resource. | def id(self) -> str:
return pulumi.get(self, "id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def provider_id(self) -> str:\n return self._provider_id",
"def provider_id(self):\n return self.__provider_id",
"def provider_id(self):\n raise NotImplementedError",
"def get_id(self):\n return \"{0} {1}\".format(self.get_issuer(), self.get_serial_number())",
"def get_resource_... | [
"0.8126292",
"0.80488974",
"0.7851373",
"0.7627896",
"0.75990766",
"0.7476093",
"0.7476093",
"0.7476093",
"0.7476093",
"0.7476093",
"0.7445641",
"0.7445641",
"0.737442",
"0.7371964",
"0.7371964",
"0.7371964",
"0.7371964",
"0.73697764",
"0.73408705",
"0.73204225",
"0.7317522",... | 0.0 | -1 |
The ID of the node the agent is running on | def node_id(self) -> str:
return pulumi.get(self, "node_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_id(self):\n return self._node_id",
"def get_id(self):\n return self._node_id",
"def node_id(self):\n return self._attrs.get('node_id')",
"def node_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"node_id\")",
"def get_node_id(self):\n return self._node_... | [
"0.8022512",
"0.7963362",
"0.7957834",
"0.79467744",
"0.79082334",
"0.785273",
"0.785273",
"0.785273",
"0.7650158",
"0.7579706",
"0.7512364",
"0.72234267",
"0.7150817",
"0.71388155",
"0.70454144",
"0.6970056",
"0.6968823",
"0.6934601",
"0.69000953",
"0.6875273",
"0.68641603",... | 0.8417123 | 1 |
Funcion que genera los codigos de Huffman usando un heap. | def huffman(dict_freq):
heap = [[wt, [sym, ""]] for sym, wt in dict_freq.items()]
heapify(heap)
while len(heap) > 1:
lo = heappop(heap)
hi = heappop(heap)
for pair in lo[1:]:
pair[1] = '0' + pair[1]
for pair in hi[1:]:
pair[1] = '1' + pair[1]
h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_heap(self):\n for i in reversed(range(self.n_levels - 1)):\n for j in range(int(2**i)):\n self.heapify(int(2**i - 1 + j))",
"def huffman(frequencies):\n frequencies.sort(key=lambda freq: freq[1]) # lowest frequencies first\n leaves = [huffman_leaf(letter, freq) fo... | [
"0.6932527",
"0.68026924",
"0.66534364",
"0.63807225",
"0.63529843",
"0.633517",
"0.6304531",
"0.6302294",
"0.62752587",
"0.6272709",
"0.6244576",
"0.617179",
"0.59898895",
"0.59412354",
"0.59229714",
"0.579706",
"0.5769604",
"0.57614094",
"0.5749783",
"0.57297033",
"0.569283... | 0.65593565 | 3 |
Takes a key and returns the item from the hash table associated with the key. If no keyitem pair is associated with the key, the function raises a LookupError exception. | def get_item(self, key: int) -> Any:
hash_value = key % self.table_size
vals = self.hash_table[hash_value]
if self.hash_table[hash_value] is None or not self.hash_table[hash_value]:
raise LookupError
for i in vals:
if i[0] == key:
return i[1]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_item(self, key):\n try:\n return self.dict[key]\n except KeyError:\n if self.exceptions:\n raise KeyError\n return None",
"def get(self, key):\n index = self._hash(key)\n for iter_item in self._slots[index]:\n if iter_... | [
"0.7799623",
"0.7691051",
"0.74370366",
"0.7426706",
"0.7238218",
"0.71803766",
"0.7117971",
"0.7085774",
"0.703428",
"0.6975624",
"0.696366",
"0.69446796",
"0.6939105",
"0.6919489",
"0.6918786",
"0.6910594",
"0.68889314",
"0.6885999",
"0.6870682",
"0.6861296",
"0.68238336",
... | 0.83081436 | 0 |
Test access without password. | def test_access_denied_without_password(self):
req = requests.get(_url(const.URL_API))
assert req.status_code == 401 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_5_interactive_auth_fallback(self):\n self.start_server()\n self.tc.connect(hostkey=self.public_host_key)\n remain = self.tc.auth_password('commie', 'cat')\n self.assertEqual([], remain)\n self.verify_finished()",
"def test_requires_authentication(self):\n pass",... | [
"0.70546633",
"0.702554",
"0.6997992",
"0.6995686",
"0.6975153",
"0.69472986",
"0.69405836",
"0.6881495",
"0.68757147",
"0.6815385",
"0.6813311",
"0.6813311",
"0.6786779",
"0.67831314",
"0.6765361",
"0.6755886",
"0.671346",
"0.6694336",
"0.6636948",
"0.6635235",
"0.66205585",... | 0.72012347 | 0 |
Returns the minimum distance between vertices | def GetMin(self, vertices):
_strRtnVal = ''
for _strVertex in vertices:
if (not _strRtnVal):
_strRtnVal = _strVertex
elif (self.GetShortestDistance(_strRtnVal) > self.GetShortestDistance(_strVertex)):
_strRtnVal = _strVertex
return _strRtnVal | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMinDistanceVertex(self, dist, shortestPath):\n min = float('inf')\n minIndex = 0\n for v in range(self.v_count):\n if shortestPath[v] == False and dist[v] < min :\n min = dist[v]\n minIndex = v\n return minIndex",
"def vertex_min_degree(... | [
"0.7391094",
"0.7168353",
"0.7041135",
"0.6944473",
"0.6939211",
"0.68726724",
"0.68726724",
"0.6868312",
"0.67015404",
"0.66929865",
"0.6618527",
"0.6609611",
"0.655734",
"0.65059966",
"0.64640176",
"0.64354414",
"0.64086205",
"0.6349382",
"0.6306569",
"0.6291935",
"0.626568... | 0.69197017 | 5 |
Returns the cost between two nodes depending on their connectivity | def GetDistance(self, node, target):
_nRtnVal = _infinity
for _edge in self._hsEdges:
if (_edge._strSource.lower() == node.lower() and _edge._strDest.lower() == target.lower()):
_nRtnVal = _edge._nCost
break
if _edge._strSource.lower() == target.lower() and _edge._strDest.lower() == node.lower():
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_cost(self, node_a, node_b):\n if node_b.x - node_a.x == 0 or node_b.y - node_a.y == 0:\n # direct neighbor - distance is 1\n ng = 1\n else:\n # not a direct neighbor - diagonal movement\n ng = SQRT2\n\n # weight for weighted algorithms\n ... | [
"0.8250559",
"0.76896155",
"0.699272",
"0.69498503",
"0.69116944",
"0.6807895",
"0.678015",
"0.67492354",
"0.6739394",
"0.6699945",
"0.66898763",
"0.6671154",
"0.66463983",
"0.65917265",
"0.6575987",
"0.6575987",
"0.65736073",
"0.65736073",
"0.65736073",
"0.65736073",
"0.6573... | 0.5971284 | 56 |
returns cost to destination;path[p1,p2,p3,..] | def GetCostAndRoute(self, dest):
_strRtnVal = ''
if(self._dicPrevMap.get(dest, '') == ''):
_strRtnVal = None
else:
_strStep = dest
_linkedList = DoublyLinkedList()
_linkedList.addLast(_strStep)
_nCost = self._dicDistMap[_strStep]
_strRtnVal += '{0};'.format(str(_nCost))
while(self._dicPrevM... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path_cost(path):\n # path = (state, (action, total_cost), state, ... )\n if len(path) < 3:\n return 0\n else:\n action, total_cost = path[-2]\n return total_cost",
"def calculate_cost(path):\n cost = 0\n for i, _ in enumerate(path[1:], 1):\n cost += euclidean_distan... | [
"0.771772",
"0.7628185",
"0.7483568",
"0.7295523",
"0.7289728",
"0.7252969",
"0.7252969",
"0.72141314",
"0.72141314",
"0.72141314",
"0.72141314",
"0.72141314",
"0.72141314",
"0.72141314",
"0.7208073",
"0.6943828",
"0.6920229",
"0.68986917",
"0.68922764",
"0.6884195",
"0.68794... | 0.6430312 | 27 |
Closes internal store and removes the reference to it. | def disconnect(self):
self.connection.close()
self.connection = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Close(self):\n self._store.Close()",
"def close(self):\n if self.store is not None:\n self.logger.debug(\"Closing store: %s\", self.store)\n self.store.close()",
"def closeStore():\n if STORE is not None and STORE.is_open:\n STORE.close()",
"def close(self):\n ... | [
"0.78604335",
"0.76568997",
"0.7515599",
"0.7194533",
"0.6944869",
"0.6863601",
"0.66064864",
"0.65240383",
"0.65027225",
"0.65020895",
"0.64538634",
"0.64109206",
"0.63835233",
"0.63510877",
"0.63510877",
"0.63510877",
"0.63510877",
"0.63510877",
"0.63510877",
"0.63510877",
... | 0.0 | -1 |
Object that contains the weight for a specific literal | def __init__(self, var):
self.lit = var
self.weight = 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_Weight(self):\n pass",
"def getWeight(self):\r\n\t\treturn self.weight",
"def weighting(self):\n pass",
"def weight(self):\n return self.container['weight']",
"def getWeight(self):\n return self.weight",
"def getWeight(self):\n return self.weight",
"def Weight... | [
"0.71499336",
"0.69162846",
"0.6835326",
"0.67681193",
"0.66733676",
"0.66733676",
"0.6619127",
"0.66137207",
"0.66134137",
"0.6611285",
"0.6611285",
"0.6611285",
"0.6611285",
"0.6611285",
"0.6611285",
"0.6501096",
"0.64478815",
"0.64300823",
"0.6429787",
"0.6390632",
"0.6364... | 0.63723844 | 20 |
return the x,y coord of the collision else None | def detect_collisions(self):
for t in range(3):
self.collision_map = np.zeros((self.height, self.width))
for car in self.cars:
# check if in bounds:
if car.path[t][0] >= self.width or car.path[t][1] >= self.height:
continue
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getPosition(self) -> Tuple[Optional[float], Optional[float]]:\n return self._x, self._y",
"def get_collision(self):\n avatar_pos = self.avatar.get_pos_idx()\n hit = None\n for eq in self.equations:\n if abs(eq.get_pos_idx() - avatar_pos) <= configvalues.ZAP_WIDTH and no... | [
"0.6876823",
"0.6853057",
"0.67056656",
"0.670471",
"0.6663063",
"0.6624367",
"0.6624367",
"0.6572472",
"0.6544361",
"0.65392923",
"0.64936024",
"0.6455385",
"0.6455385",
"0.64452636",
"0.64182",
"0.6417496",
"0.64008784",
"0.6389972",
"0.6382074",
"0.6348671",
"0.63398606",
... | 0.0 | -1 |
Adjust pt in order both points to be equidistant from the intersection of vectors | def adjust_points(pt, v, v0):
v0 = intersect_vects(v0, pt, v + pt)
#
# The intersection point at "v0" is the center of rotation of a point at
# the origin toward "pt"".
#
if False:
# Regular adjustment: move "pt" toward intersection, so as |v| == |v0|
#
v = v0 - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def intersect(vect, point0, point1):\r\n if ALLOW_OPTIMIZATION:\r\n # Optimize out the cross product and square root (meaningful in 3D scenarios only):\r\n # Scale = |AxB|^2 / [(AxB).(AxC) + (AxB).(CxB)] =\r\n # = (|A|^2|B|^2 - |A.B|^2) / (A - B).[A(B.C) - B(A.C)] =\r\n # = (|A|^2|B|... | [
"0.6801859",
"0.6595251",
"0.63164663",
"0.6310115",
"0.6238528",
"0.61287296",
"0.6079919",
"0.6073841",
"0.603765",
"0.60148233",
"0.60148233",
"0.60035384",
"0.59916055",
"0.5980718",
"0.58930916",
"0.5879895",
"0.58769155",
"0.58703685",
"0.58604133",
"0.58398795",
"0.583... | 0.6772114 | 1 |
Generate surface from its normals returned by an arbitrary function | def surface_from_normals(extent_uv, normal_fn, seed_pt, *params, **kw_params):
def wrap_normal_fn(out, pt):
normal, tangent = normal_fn(pt, *params, **kw_params)
out['pt'] = pt
# Ensure both tangents are perpendicular to normal and all are unit vectors
out['norm'] = unit_vects(n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetNormalToSurface(*args):\n return _BOPTools.BOPTools_AlgoTools3D_GetNormalToSurface(*args)",
"def BOPTools_AlgoTools3D_GetNormalToSurface(*args):\n return _BOPTools.BOPTools_AlgoTools3D_GetNormalToSurface(*args)",
"def surface_normals(points, normalize=True):\n points, _, transform_result = co... | [
"0.7100416",
"0.68947804",
"0.66103965",
"0.65551716",
"0.6446792",
"0.6353807",
"0.628518",
"0.62470347",
"0.6195931",
"0.61347616",
"0.61303836",
"0.61139315",
"0.61134976",
"0.6103017",
"0.60956585",
"0.606012",
"0.60482794",
"0.6041508",
"0.60258573",
"0.6014074",
"0.6002... | 0.70634955 | 1 |
Creates and saves a User with the given username, email and password. | def _create_user(self, username, email_address, password, **extra_fields):
if not username:
raise ValueError('The given username must be set')
email_address = self.normalize_email(email_address)
user = self.model(username=username, email_address=email_address, **extra_fields)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signup(cls, username, email, password):\n\n hashed_pwd = bcrypt.generate_password_hash(password).decode('UTF-8')\n\n user = User(\n username=username,\n email=email,\n password=hashed_pwd,\n )\n\n db.session.add(user)\n return user",
"def cr... | [
"0.85182536",
"0.84783906",
"0.8407149",
"0.840616",
"0.840616",
"0.8398672",
"0.83922565",
"0.839183",
"0.839183",
"0.839183",
"0.839183",
"0.8347033",
"0.8322837",
"0.8283844",
"0.82814354",
"0.82584244",
"0.8233358",
"0.82262945",
"0.8220019",
"0.8205882",
"0.81984466",
... | 0.8214565 | 19 |
Return the number of samples in dataset (though not all may be loaded successfully). | def size(self):
return len(self._samples) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_number_of_loadable_samples(self):\n return len(self.data)",
"def num_sample(self):\n return len(self.dataset)",
"def num_sample(self):\n return len(self.dataset)",
"def get_number_of_loadable_samples(self):\n return len(self.dm_paths)",
"def get_number_of_loadable_sample... | [
"0.81958336",
"0.81748843",
"0.81748843",
"0.7993913",
"0.78200686",
"0.7765826",
"0.76626134",
"0.7616226",
"0.7577192",
"0.7570013",
"0.7531306",
"0.74312735",
"0.74249357",
"0.73931265",
"0.7341351",
"0.7321893",
"0.73042715",
"0.72844046",
"0.72693473",
"0.7236688",
"0.72... | 0.7275272 | 18 |
Creates a new action for the specified rule by rule id or resource name. | def create_action_for_rule(self, ruleresource: str, action_post: ActionPOST, query_params: Dict[str, object] = None) -> Action:
if query_params is None:
query_params = {}
path_params = {
"ruleresource": ruleresource,
}
path = Template("/catalog/v2beta1/rules/${r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_rule_action(self,rule_id,configuration):\n request = CreateRuleActionRequest()\n request.set_accept_format('json')\n request.set_Type(\"REPUBLISH\")\n request.set_Configuration(configuration)\n request.set_RuleId(rule_id)\n response = self.client.do_action_with_... | [
"0.6904606",
"0.6729609",
"0.6512551",
"0.6432105",
"0.6228651",
"0.61514974",
"0.611289",
"0.6013123",
"0.59300387",
"0.5890694",
"0.58136946",
"0.58011276",
"0.5783696",
"0.57746446",
"0.5701904",
"0.56923234",
"0.5685692",
"0.5684427",
"0.565722",
"0.56454384",
"0.5598245"... | 0.7706097 | 0 |
Returns information about the action with the specified ID that is associated with the specified rule. | def get_action_by_id_for_rule(self, ruleresource: str, actionid: str, query_params: Dict[str, object] = None) -> Action:
if query_params is None:
query_params = {}
path_params = {
"ruleresource": ruleresource,
"actionid": actionid,
}
path = Template(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_info(action_id):\n for act in _polkit.action_list():\n if act[\"action_id\"] == action_id:\n return act\n return {}",
"def get_rule(RuleId=None):\n pass",
"def action_detail(id):\n\n action = Action.query.get_or_404(id)\n return action_schema.jsonify(action)",
"def... | [
"0.6748104",
"0.6394538",
"0.63480926",
"0.6079237",
"0.60602653",
"0.59205896",
"0.5896475",
"0.5610814",
"0.5552476",
"0.5535345",
"0.5511212",
"0.55040807",
"0.5479295",
"0.54740995",
"0.5472747",
"0.5430519",
"0.5418935",
"0.53222054",
"0.5291019",
"0.5259196",
"0.5224281... | 0.70265055 | 0 |
Returns the set of annotations across all objects. | def list_annotations(self, count: int = None, filter: str = None, offset: int = None, orderby: List[str] = None, query_params: Dict[str, object] = None) -> List[Annotation]:
if query_params is None:
query_params = {}
if count is not None:
query_params['count'] = count
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAllAnnots(self):\n return list(self.annots.keys())",
"def annotations(self):\n if self._annotations is None:\n self._load_annotations()\n return self._annotations",
"def annotations(self, fdr=0.1):\n return set(self._sm.dataset(id=self._id).annotations(fdr=fdr))",
... | [
"0.7360646",
"0.7118739",
"0.6803754",
"0.6793177",
"0.674425",
"0.67238975",
"0.67195106",
"0.67183596",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0.66867626",
"0... | 0.0 | -1 |
Returns the set of annotations that are associated with the specified dashboard. | def list_annotations_for_dashboard(self, dashboardresource: str, filter: str = None, query_params: Dict[str, object] = None) -> List[Annotation]:
if query_params is None:
query_params = {}
if filter is not None:
query_params['filter'] = filter
path_params = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_annotations(url):\n collection = get_collection(url)\n annotations = collection[ITEMS_KEY]\n return annotations",
"def annotations(self):\n if self._annotations is None:\n self._load_annotations()\n return self._annotations",
"def list_annotation_names(self):\n ... | [
"0.6208256",
"0.6207259",
"0.6028166",
"0.59601337",
"0.5838361",
"0.58046216",
"0.58046216",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
"0.57627004",
... | 0.6844284 | 0 |
Returns the set of annotations that are associated with the specified dataset. | def list_annotations_for_dataset(self, datasetresource: str, count: int = None, filter: str = None, offset: int = None, orderby: List[str] = None, query_params: Dict[str, object] = None) -> List[Annotation]:
if query_params is None:
query_params = {}
if count is not None:
query_p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def annotations(self, fdr=0.1):\n return set(self._sm.dataset(id=self._id).annotations(fdr=fdr))",
"def getDatasetAnnotation( self, datasets, credDict = {} ):\n successful = {}\n failed = {}\n if datasets:\n result = self._findDatasets( datasets )\n if not result['OK']:\n return ... | [
"0.7295771",
"0.692942",
"0.63335234",
"0.6283076",
"0.6260375",
"0.62102354",
"0.605078",
"0.60214424",
"0.60182726",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.59459424",
"0.... | 0.61391264 | 6 |
Get the membrane potential at the target location. | def measure(self) -> float:
return self._target.get_membrane_potential() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_potential(self, x, y):\n i, j = self.mesh.point_to_indices(x, y)\n return self.phi[i][j]",
"def getMembrane(self, number):\n\t\tif number in [membrane.positionNumber for membrane in self.membranes]:\n\t\t\treturn self.membranes[[membrane.positionNumber for membrane in self.membranes].index(... | [
"0.5971146",
"0.5858105",
"0.5797136",
"0.57791364",
"0.57025474",
"0.5496686",
"0.5486936",
"0.54764384",
"0.5456549",
"0.54417557",
"0.5372292",
"0.5341574",
"0.53183556",
"0.5285314",
"0.52788043",
"0.5242465",
"0.5162063",
"0.5123336",
"0.51224947",
"0.5098709",
"0.509230... | 0.6692878 | 0 |
Calculates the minimum HP needed to get from the topleft corner of the dungeon to the bottomright without reaching 0 HP. | def calculateMinimumHP(self, dungeon):
m = len(dungeon)
assert m > 0
n = len(dungeon[0])
dp = [([-1] * n) for _ in xrange(0, m)]
return self._minHp(dungeon, m, n, 0, 0, dp) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _minHp(self, dungeon, m, n, y, x, dp):\n assert m > 0\n assert n > 0\n assert y >= 0\n assert y < m\n assert x >= 0\n assert x < n\n\n # Check if we have calculated this problem before.\n if dp[y][x] != -1:\n return dp[y][x]\n\n here = -... | [
"0.74558663",
"0.57451314",
"0.5725109",
"0.57155627",
"0.5695502",
"0.56894517",
"0.5637553",
"0.56081396",
"0.5604647",
"0.56015074",
"0.5568416",
"0.5545281",
"0.5539107",
"0.55248874",
"0.546917",
"0.5442453",
"0.5441139",
"0.5420686",
"0.53498024",
"0.5338469",
"0.533505... | 0.8043224 | 0 |
Return the CLI argument parser. | def get_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
add_help=False,
prog="git-changelog",
description=re.sub(
r"\n *",
"\n",
f"""
Automatic Changelog generator using Jinja2 templates.
This tool parses you... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_parser():\n # Initialize parser\n parser = ArgumentParser(description=__doc__, formatter_class=ArgumentDefaultsHelpFormatter)\n\n # Setup arguments\n parser.add_argument('--run_id', dest='run_id', type=str)\n parser.add_argument('--experiment_name', dest='experiment_name', type=str)\n par... | [
"0.79273516",
"0.7867845",
"0.78267086",
"0.7800381",
"0.77822566",
"0.7753611",
"0.76997286",
"0.7641324",
"0.7614897",
"0.7591488",
"0.75872016",
"0.75656193",
"0.75595754",
"0.75221294",
"0.7513401",
"0.74827814",
"0.7478784",
"0.74775803",
"0.7473928",
"0.7464167",
"0.743... | 0.6959341 | 65 |
Creates chunks of data of given size from list | def __chunks(cutting_list: list, chunk_size: int) -> list:
for i in range(0, len(cutting_list), chunk_size):
yield cutting_list[i:i + chunk_size] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(list_, size):\n for i in range(0, len(list_), size):\n yield list_[i:i + size]",
"def _create_chunks_from_list(lst, n):\n chunks = []\n for i in range(0, len(lst), n):\n chunks.append(lst[i : i + n])\n return chunks",
"def generate_chunks(input_list, chunk_size):\n ... | [
"0.8235836",
"0.8061805",
"0.8006039",
"0.7892184",
"0.785205",
"0.77387065",
"0.77378654",
"0.7735566",
"0.7694541",
"0.76905525",
"0.76524854",
"0.7601333",
"0.7571593",
"0.7541048",
"0.7541048",
"0.7491896",
"0.7491896",
"0.7489763",
"0.74863756",
"0.74478054",
"0.7445116"... | 0.7515219 | 15 |
Calls multiple instances of __single_multi_call and combines their futures | def __mutli_call(self, variations: list, parameters: list) -> dict:
variation_chunk = self.__chunks(variations, 100)
futures = []
for single_element in variation_chunk:
with ThreadPoolExecutor(max_workers=10) as executor:
future = executor.submit(self.__single_multi_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __system_multiCall(calls, **kwargs):\n if not isinstance(calls, list):\n raise RPCInvalidParams('system.multicall first argument should be a list, {} given.'.format(type(calls)))\n\n handler = kwargs.get(HANDLER_KEY)\n request = kwargs.get(REQUEST_KEY)\n results = []\n\n for call in calls... | [
"0.66232115",
"0.6225784",
"0.6012907",
"0.599586",
"0.59487003",
"0.58773863",
"0.58729106",
"0.58459675",
"0.5839135",
"0.5831518",
"0.58195907",
"0.5808333",
"0.58011925",
"0.57189256",
"0.5715534",
"0.5676575",
"0.560907",
"0.56016874",
"0.5581884",
"0.5539699",
"0.553603... | 0.5882105 | 5 |
Combines all future objects into a dictionary | def __merge_futures(futures: list) -> dict:
results = {}
for fut in futures:
for return_key in fut.result().keys():
if return_key in results:
results[return_key] += (fut.result()[return_key])
else:
results[return_key] = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def result_processor(tasks):\n output = {}\n for task in tasks:\n num, res = await task\n output[num] = res\n return output",
"def multi_future(children):\r\n if isinstance(children, dict):\r\n keys = list(children.keys())\r\n children = children.values()\r\n else... | [
"0.59480363",
"0.5859904",
"0.57919574",
"0.57873297",
"0.5745752",
"0.5618898",
"0.56140774",
"0.5602397",
"0.5577375",
"0.5501635",
"0.53664094",
"0.5353728",
"0.5346023",
"0.5331141",
"0.5273942",
"0.5266222",
"0.52639866",
"0.52276736",
"0.5224258",
"0.5200403",
"0.518840... | 0.6746426 | 0 |
Function which detects language used for the project. Searches for requirements.txt for Python project and godep for GoLang project. | def detect_language(project):
p = Path(base_path + project_dictionary[project.pk])
if os.path.isfile(p.__str__() + '/requirements.txt'):
print("Python Repository found..")
download_python_dependencies(project)
elif os.path.isfile(p.__str__() + '/godep.packages'):
print("Go Repositor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_lang(repo_description):\n\n try:\n lang = detect(repo_description)\n except UnicodeError:\n print(repo_description)\n\n return lang",
"def _detect_language(self):\n\n # checking C extensions\n if self.ext in [\".c\"]:\n self.language = \"c\"\n\n # checking C++ e... | [
"0.70638925",
"0.66248786",
"0.6304182",
"0.6239626",
"0.6179202",
"0.61446506",
"0.6065535",
"0.601607",
"0.5981879",
"0.5981471",
"0.58967185",
"0.58382905",
"0.5818578",
"0.58173585",
"0.580022",
"0.57764584",
"0.57712245",
"0.5764674",
"0.5745569",
"0.57030964",
"0.569896... | 0.8163797 | 0 |
The function to create the slug. | def create_zip(project, language):
filepath = base_path + language + project_dictionary[project.pk] + '.tar.gz'
tar = tarfile.open(base_path + language + project_dictionary[project.pk] + '.tar.gz', mode='w:gz')
try:
# zf.write(base_path + project_dictionary[project.pk])
path = base_path
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_slug(self):\n # Don't overwrite any existing slugs by default.\n if not self.slug:\n self.slug = slugify(self.title)",
"def create_slug(instance, new_slug=None):\r\n\t\tslug = slugify(instance.title)\r\n\t\tif new_slug is not None:\r\n\t\t\tslug = new_slug\r\n\t\tqs = BasicDa... | [
"0.8124125",
"0.762167",
"0.762167",
"0.762167",
"0.738479",
"0.7343575",
"0.73066485",
"0.7290187",
"0.7282355",
"0.70609367",
"0.7013779",
"0.70037794",
"0.69853127",
"0.69833446",
"0.6975137",
"0.6941895",
"0.6927255",
"0.6834369",
"0.6818194",
"0.68157935",
"0.6785467",
... | 0.0 | -1 |
Returns Queue object associated with this registry. | def get_queue(self):
return Queue(self.name, connection=self.connection, serializer=self.serializer) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queue(queue_type):\n con = get_redis_connection()\n queue_type = QueueType(queue_type)\n\n queue = WorkflowQueue(queue_type.value, connection=con)\n\n return queue",
"def getQueue(self, queue):\n return self._queue(queue).get()",
"def get_queue(self, name):\n\t\treturn StyxQueue(self... | [
"0.752434",
"0.7444636",
"0.73708737",
"0.7276485",
"0.7216528",
"0.7216528",
"0.7185783",
"0.70637715",
"0.70250803",
"0.6938302",
"0.68700385",
"0.686009",
"0.6823263",
"0.67833006",
"0.674707",
"0.67253536",
"0.67017853",
"0.6631986",
"0.6590348",
"0.6445079",
"0.64119583"... | 0.8641973 | 0 |
Checks to make sure the user has admin privilages | def cog_check(self, ctx_inter: InterContext):
is_summoning_command = slash_command_name(ctx_inter) in ["summon", "unsummon"]
if is_summoning_command and ctx_inter.guild and not botdata.guildinfo(ctx_inter.guild).restrictsummoning:
return True
return checks.is_admin_check(ctx_inter) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_admin_permission(self):\n user = self.request.user\n if (not user) or (not user.is_staff):\n raise PermissionDenied(\"You do not have permission to perform this action.\")",
"def check_admin():\r\n if not current_user.is_admin:\r\n abort(403)",
"def check_admin():\n... | [
"0.85280144",
"0.84727293",
"0.8446724",
"0.8446724",
"0.8446724",
"0.8446724",
"0.8381371",
"0.8257135",
"0.78225976",
"0.7754749",
"0.77452207",
"0.7709606",
"0.7680432",
"0.76691157",
"0.76627016",
"0.76369476",
"0.7611958",
"0.7609537",
"0.76066184",
"0.759437",
"0.759035... | 0.0 | -1 |
Tests sepioqueryagents command function. Configures requests_mock instance to generate the appropriate API response, loaded from a local JSON file. Checks the output of the command function with the expected output. | def test_sepio_query_agents(requests_mock):
from SepioPrimeAPI import Client, sepio_query_agents_command
# mock api http response
mock_signin_http_response = util_load_json('test_data/signin_http_response.json')
requests_mock.post(
f'{BASE_URL}/auth/signin',
json=mock_signin_http_resp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_epo_advanced_command(requests_mock):\n epo_advanced_command_command_response = load_test_data_txt('test_data/epo_advanced_command_command.txt')\n epo_advanced_command_command_response_second = load_test_data_txt(\n 'test_data/epo_advanced_command_command_second.txt')\n\n requests_mock.get(... | [
"0.68941087",
"0.6602131",
"0.6504915",
"0.6398336",
"0.63653934",
"0.6334123",
"0.6252397",
"0.62199",
"0.6133804",
"0.60312676",
"0.594414",
"0.5941163",
"0.5939378",
"0.5908485",
"0.59002465",
"0.58987695",
"0.585299",
"0.5831126",
"0.58296126",
"0.5774311",
"0.57712585",
... | 0.74848753 | 0 |
Tests sepioqueryperipherals command function. Configures requests_mock instance to generate the appropriate API response, loaded from a local JSON file. Checks the output of the command function with the expected output. | def test_sepio_query_global_peripherals(requests_mock):
from SepioPrimeAPI import Client, sepio_query_global_peripherals_command
# mock api http response
mock_signin_http_response = util_load_json('test_data/signin_http_response.json')
requests_mock.post(
f'{BASE_URL}/auth/signin',
js... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sepio_set_agent_peripherals_mode(requests_mock):\n\n from SepioPrimeAPI import Client, sepio_set_agent_peripherals_mode_command\n\n # mock api http response\n mock_signin_http_response = util_load_json('test_data/signin_http_response.json')\n requests_mock.post(\n f'{BASE_URL}/auth/sig... | [
"0.6574585",
"0.6348218",
"0.6328786",
"0.6292408",
"0.6249538",
"0.62385154",
"0.6169223",
"0.6103942",
"0.6066737",
"0.6046213",
"0.60217816",
"0.59757334",
"0.5953752",
"0.58972776",
"0.58519304",
"0.579535",
"0.578656",
"0.57769555",
"0.5754153",
"0.57328075",
"0.5698644"... | 0.77612084 | 0 |
Tests the fetchincidents command function. Configures requests_mock instance to generate the appropriate get_alert API response, loaded from a local JSON file. Checks the output of the command function with the expected output. | def test_fetch_incidents(requests_mock):
from SepioPrimeAPI import Client, fetch_incidents
# mock api http response
mock_signin_http_response = util_load_json('test_data/signin_http_response.json')
requests_mock.post(
f'{BASE_URL}/auth/signin',
json=mock_signin_http_response)
mock... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_fetch_incidents_command_1(self, client, datadir, requests_mock):\n from Akamai_SIEM import fetch_incidents_command\n requests_mock.get(f'{BASE_URL}/50170?limit=5&from=1575966002', text=SEC_EVENTS_TXT)\n tested_incidents, tested_last_run = fetch_incidents_command(client=client,\n ... | [
"0.7827562",
"0.776688",
"0.77451247",
"0.7688573",
"0.76515895",
"0.7615459",
"0.67390794",
"0.67353743",
"0.6710533",
"0.6536374",
"0.64514136",
"0.6417419",
"0.6400221",
"0.6392231",
"0.6379914",
"0.62632924",
"0.62153757",
"0.61496025",
"0.61337775",
"0.6133149",
"0.60648... | 0.68522024 | 6 |
QonoS resource factory method. | def create_resource():
return wsgi.Resource(SchedulesController()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _resource_factory(self, raw) -> ApiResource:\n raise NotImplementedError",
"def create_resource(data):\n if data['rtp_id'] == C.ENK_RTP_ID_COUNTING:\n return CountingResource(data)\n\n if data['rtp_id'] == C.ENK_RTP_ID_READ_WRITE:\n return ReadWriteLockResource(data)\n\n raise E... | [
"0.7231883",
"0.6446182",
"0.6323416",
"0.6306184",
"0.62698865",
"0.6260492",
"0.6223326",
"0.619098",
"0.6170124",
"0.6163357",
"0.6140349",
"0.6140314",
"0.6134159",
"0.6101517",
"0.60805714",
"0.6079714",
"0.607733",
"0.6074365",
"0.60691524",
"0.6068648",
"0.6040244",
... | 0.59053385 | 34 |
Update existing device label entirely, or add if it does not exist. | def put(self, context, id, request_data):
resp = dbapi.hosts_labels_update(context, id, request_data)
response = {"labels": list(resp.labels)}
return response, 200, None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_kubernetes_label(self, context,\n host_uuid, label_dict):\n LOG.info(\"update_kubernetes_label: label_dict=%s\" % label_dict)\n try:\n host = self.dbapi.ihost_get(host_uuid)\n except exception.ServerNotFound:\n LOG.error(\"Cannot ... | [
"0.6635816",
"0.6456521",
"0.61312795",
"0.61206657",
"0.6039978",
"0.6029091",
"0.58378565",
"0.5734659",
"0.57100487",
"0.56721944",
"0.5671181",
"0.5648837",
"0.5595694",
"0.5583115",
"0.55481005",
"0.55481005",
"0.55332154",
"0.5518512",
"0.5511342",
"0.54886526",
"0.5482... | 0.6007282 | 6 |
wrapper to the original expanduser function, to workaround python returning verbatim %USERPROFILE% when some other app (git for windows) sets HOME envvar | def conan_expand_user(path):
if platform.system() == "Windows":
# In win these variables should exist and point to user directory, which
# must exist. Using context to avoid permanent modification of os.environ
old_env = dict(os.environ)
try:
home = os.environ.get("HOME")... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expanduser(path):\n if not IS_WINDOWS or not path.startswith(\"~\") or \"USERPROFILE\" not in os.environ:\n return os.path.expanduser(path)\n return os.environ[\"USERPROFILE\"] + path[1:]",
"def expanduser(self, expr):\r\n prev = os.environ\r\n os.environ = self.getdict()\r\n ... | [
"0.858346",
"0.7833095",
"0.76578695",
"0.7636149",
"0.7557919",
"0.7552218",
"0.7319049",
"0.7293007",
"0.72546375",
"0.72284824",
"0.70340276",
"0.7015017",
"0.69717574",
"0.6939485",
"0.68997985",
"0.6696245",
"0.6681045",
"0.6594549",
"0.6559703",
"0.654132",
"0.6510781",... | 0.82826155 | 1 |
Pad Dictionary size to be a multiple of padding_factor. | def pad_to_multiple_(self, padding_factor):
if padding_factor > 1:
i = 0
while len(self) % padding_factor != 0:
symbol = "madeupword{:04d}".format(i)
self.add_symbol(symbol, n=0)
i += 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def padding(window_size, desired_size):\n pad = desired_size - window_size\n return (int(pad/2.), int((pad + 1)/2.))",
"def calculate_padding(self):\n pass",
"def pad_dic_list(dic, pad):\n lmax = 0\n for lname in dic.keys():\n lmax = max(lmax, len(dic[lname]))\n for lname in dic.ke... | [
"0.68720907",
"0.6704406",
"0.66846275",
"0.6241801",
"0.62371564",
"0.6167409",
"0.6164605",
"0.61345047",
"0.6022937",
"0.6020239",
"0.5994869",
"0.5981164",
"0.59789795",
"0.5970134",
"0.5953568",
"0.59217674",
"0.59009206",
"0.5881516",
"0.5880951",
"0.58664083",
"0.58648... | 0.69269836 | 0 |
Helper to get index of pad symbol | def pad(self):
return self.pad_index | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pad(self):\n return self.pad_index",
"def pad_index(self) -> int:\n # pad_token = tokenizer._convert_token_to_id(tokenizer.pad_token)\n pad_token = self.tokenizer.pad_token\n return self.tokenizer.convert_tokens_to_ids(pad_token)",
"def getCharOffset(self) -> int:\n ...",... | [
"0.70724356",
"0.6702542",
"0.66654384",
"0.65950865",
"0.65623224",
"0.64902693",
"0.6356548",
"0.63251",
"0.62239724",
"0.621883",
"0.61678547",
"0.6112554",
"0.6111349",
"0.60417044",
"0.60200834",
"0.59875494",
"0.59533644",
"0.5914883",
"0.58582014",
"0.5744273",
"0.5715... | 0.72965956 | 0 |
Helper to get index of unk symbol | def unk(self):
return self.unk_index | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def symbol_to_index(self, symbol):\n for i, s in enumerate(self.symbols):\n if s == symbol:\n return i\n return -1",
"def index(self, sym):\r\n assert isinstance(sym, str)\r\n if sym in self.indices:\r\n return self.indices[sym]\r\n return s... | [
"0.76328754",
"0.75727946",
"0.7344501",
"0.7333158",
"0.7288781",
"0.6949205",
"0.6818211",
"0.65465814",
"0.65385246",
"0.6517879",
"0.6508386",
"0.64967227",
"0.64841056",
"0.64420885",
"0.63499504",
"0.63423723",
"0.63364786",
"0.63312",
"0.6315055",
"0.6299994",
"0.62870... | 0.742691 | 2 |
cast(itkLightObject obj) > itkHConcaveImageFilterID2ID2 | def cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterID2ID2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF2IF2 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF2IF2_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkDirectedHausdorffDistanceImageFilterIUC2IF2 *... | [
"0.80300796",
"0.79522324",
"0.78696847",
"0.78255856",
"0.7811641",
"0.78083956",
"0.7805373",
"0.7779917",
"0.77535456",
"0.7735697",
"0.7730178",
"0.77173394",
"0.77170116",
"0.7706678",
"0.7684427",
"0.7661039",
"0.7652127",
"0.7638101",
"0.76348233",
"0.7628998",
"0.7618... | 0.7189286 | 64 |
New() > itkHConcaveImageFilterID2ID2 Create a new object of the class itkHConcaveImageFilterID2ID2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the f... | def New(*args, **kargs):
obj = itkHConcaveImageFilterID2ID2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkHConcaveImageFilterIF2IF2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkFiniteDifferenceImageFilterID2ID2.__New_orig__()\n import itkTemplate\n itk... | [
"0.77194506",
"0.760395",
"0.7531892",
"0.75012445",
"0.7458061",
"0.74128556",
"0.73569775",
"0.7322522",
"0.7294926",
"0.7277803",
"0.72197974",
"0.7151004",
"0.711696",
"0.7113013",
"0.7097513",
"0.7091104",
"0.70693773",
"0.7069348",
"0.70553935",
"0.7043735",
"0.70337963... | 0.81611484 | 0 |
itkHConcaveImageFilterID2ID2_cast(itkLightObject obj) > itkHConcaveImageFilterID2ID2 | def itkHConcaveImageFilterID2ID2_cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterID2ID2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkDirectedHausdorffDistanceImageFilterIUC2IF2 *\":\n return _itkDirectedHausdorffDistanceImageFilterPython.itkDirectedHausdorffDistanceImageFilterIUC2IF2_cast(obj)",
"def itkProjectedLandweberDeconvolutionImageFilterIF2IF2_cast(obj: 'itkLightObject') -> \"itkProjected... | [
"0.8207923",
"0.8204642",
"0.8195391",
"0.8131545",
"0.8105127",
"0.80891454",
"0.80347276",
"0.8007222",
"0.79995203",
"0.7997521",
"0.79935014",
"0.7987903",
"0.7986818",
"0.79831606",
"0.7976997",
"0.7945704",
"0.79425776",
"0.793577",
"0.7926067",
"0.79239625",
"0.7923376... | 0.8254573 | 0 |
cast(itkLightObject obj) > itkHConcaveImageFilterID3ID3 | def cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterID3ID3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF3IF3 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF3IF3_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIUC... | [
"0.8221534",
"0.81179667",
"0.80604595",
"0.802683",
"0.7997993",
"0.796716",
"0.7925907",
"0.7909363",
"0.78979063",
"0.7855624",
"0.78361255",
"0.7820677",
"0.78116184",
"0.7795345",
"0.7779554",
"0.77493227",
"0.7723254",
"0.7718697",
"0.7700134",
"0.76988775",
"0.76955694... | 0.0 | -1 |
New() > itkHConcaveImageFilterID3ID3 Create a new object of the class itkHConcaveImageFilterID3ID3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the f... | def New(*args, **kargs):
obj = itkHConcaveImageFilterID3ID3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkHConcaveImageFilterIF3IF3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkScalarChanAndVeseSparseLevelSetImageFilterID3ID3ID3.__New_orig__()\n import itkTem... | [
"0.7800013",
"0.7755603",
"0.76929134",
"0.7659391",
"0.75755006",
"0.75456613",
"0.74778783",
"0.74778324",
"0.7440998",
"0.7440998",
"0.7376814",
"0.7334058",
"0.72992873",
"0.7276484",
"0.72510827",
"0.7250562",
"0.7243805",
"0.72174",
"0.7205015",
"0.71954143",
"0.7192557... | 0.81086135 | 0 |
itkHConcaveImageFilterID3ID3_cast(itkLightObject obj) > itkHConcaveImageFilterID3ID3 | def itkHConcaveImageFilterID3ID3_cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterID3ID3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF3IF3 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF3IF3_cast(obj)",
"def itkProjectedLandweberDeconvolutionImageFilterIF3IF3_cast(obj: 'itkLightObject') -... | [
"0.8478229",
"0.84687644",
"0.8392562",
"0.83432615",
"0.83178353",
"0.8316386",
"0.8277477",
"0.8258915",
"0.82414967",
"0.81969756",
"0.81888694",
"0.81832886",
"0.81680524",
"0.8142938",
"0.81330764",
"0.8118415",
"0.81165123",
"0.8095004",
"0.80809385",
"0.8050015",
"0.80... | 0.8221129 | 9 |
cast(itkLightObject obj) > itkHConcaveImageFilterIF2IF2 | def cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterIF2IF2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF2IF2 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF2IF2_cast(obj)",
"def itkProjectedLandweberDeconvolutionImageFilterIF2IF2_cast(obj: 'itkLightObject') -... | [
"0.8131069",
"0.79920995",
"0.7915662",
"0.7849911",
"0.7844873",
"0.7806198",
"0.77938974",
"0.7782741",
"0.7766479",
"0.7765307",
"0.77611005",
"0.77495444",
"0.77282417",
"0.7709191",
"0.76720005",
"0.7643413",
"0.7639396",
"0.7633674",
"0.76153547",
"0.7608733",
"0.760759... | 0.7264339 | 40 |
New() > itkHConcaveImageFilterIF2IF2 Create a new object of the class itkHConcaveImageFilterIF2IF2 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the f... | def New(*args, **kargs):
obj = itkHConcaveImageFilterIF2IF2.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkHConcaveImageFilterID2ID2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkHConcaveImageFilterIUL2IUL2.__New_orig__()\n import itkTemplate\n itkTempla... | [
"0.7865597",
"0.7645216",
"0.754676",
"0.7534114",
"0.7529511",
"0.74690676",
"0.7455462",
"0.74389136",
"0.7432467",
"0.7407082",
"0.7398202",
"0.7382341",
"0.7332027",
"0.73078483",
"0.73055136",
"0.7295598",
"0.72892666",
"0.7285519",
"0.7285378",
"0.72670823",
"0.71699125... | 0.82103795 | 0 |
itkHConcaveImageFilterIF2IF2_cast(itkLightObject obj) > itkHConcaveImageFilterIF2IF2 | def itkHConcaveImageFilterIF2IF2_cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterIF2IF2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF2IF2 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF2IF2_cast(obj)",
"def itkProjectedLandweberDeconvolutionImageFilterIF2IF2_cast(obj: 'itkLightObject') -... | [
"0.8539965",
"0.85324603",
"0.83567584",
"0.8333008",
"0.8310686",
"0.82810193",
"0.8243243",
"0.82204103",
"0.8208909",
"0.82052165",
"0.81976366",
"0.8175379",
"0.81696725",
"0.8130276",
"0.8110504",
"0.80858916",
"0.8051675",
"0.80347747",
"0.8016093",
"0.80144656",
"0.800... | 0.8414656 | 2 |
cast(itkLightObject obj) > itkHConcaveImageFilterIF3IF3 | def cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterIF3IF3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF3IF3 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF3IF3_cast(obj)",
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIUC... | [
"0.8108684",
"0.7929121",
"0.78834915",
"0.78770995",
"0.78246826",
"0.78074384",
"0.77887106",
"0.77547264",
"0.7737701",
"0.7708839",
"0.7702862",
"0.7681906",
"0.76666987",
"0.7635479",
"0.7618344",
"0.760333",
"0.76022714",
"0.760151",
"0.7591559",
"0.75499225",
"0.753806... | 0.0 | -1 |
New() > itkHConcaveImageFilterIF3IF3 Create a new object of the class itkHConcaveImageFilterIF3IF3 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the f... | def New(*args, **kargs):
obj = itkHConcaveImageFilterIF3IF3.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkHConcaveImageFilterID3ID3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkScalarChanAndVeseSparseLevelSetImageFilterIF3IF3IF3.__New_orig__()\n import itkTem... | [
"0.7884356",
"0.7750062",
"0.77380574",
"0.767191",
"0.7638215",
"0.7629619",
"0.75841904",
"0.7571799",
"0.75618154",
"0.75563216",
"0.75546986",
"0.7549532",
"0.75384563",
"0.753307",
"0.753307",
"0.75117683",
"0.7494475",
"0.74262166",
"0.74134976",
"0.7405414",
"0.7320431... | 0.8201595 | 0 |
itkHConcaveImageFilterIF3IF3_cast(itkLightObject obj) > itkHConcaveImageFilterIF3IF3 | def itkHConcaveImageFilterIF3IF3_cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterIF3IF3_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIF3IF3 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIF3IF3_cast(obj)",
"def itkProjectedLandweberDeconvolutionImageFilterIF3IF3_cast(obj: 'itkLightObject') -... | [
"0.8550681",
"0.85201573",
"0.83829975",
"0.83409226",
"0.8286983",
"0.82427686",
"0.8235075",
"0.8225626",
"0.8225164",
"0.817691",
"0.81604826",
"0.81516165",
"0.8144865",
"0.81342196",
"0.81070966",
"0.80958647",
"0.808551",
"0.80712146",
"0.8066465",
"0.80080783",
"0.7997... | 0.8286863 | 5 |
cast(itkLightObject obj) > itkHConcaveImageFilterIUC2IUC2 | def cast(*args):
return _itkHConcaveImageFilterPython.itkHConcaveImageFilterIUC2IUC2_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cast(obj: 'itkLightObject') -> \"itkProjectedLandweberDeconvolutionImageFilterIUC2IUC2 *\":\n return _itkProjectedLandweberDeconvolutionImageFilterPython.itkProjectedLandweberDeconvolutionImageFilterIUC2IUC2_cast(obj)",
"def itkProjectedLandweberDeconvolutionImageFilterIUC2IUC2_cast(obj: 'itkLightObje... | [
"0.8304033",
"0.8176144",
"0.80396235",
"0.80365914",
"0.80144614",
"0.8012109",
"0.79856175",
"0.79698586",
"0.7966419",
"0.7938492",
"0.7937846",
"0.7937355",
"0.79070246",
"0.78786033",
"0.7871723",
"0.78653365",
"0.7781102",
"0.77562493",
"0.7695209",
"0.7685401",
"0.7645... | 0.7312886 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.