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
read the value for accelerometer Z
def accel_z(self): return float(self.__angles[2]) - ZEROZ
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getZ(self):\n return self.getAcceleration(self.Axes.kZ)", "def ReadAccelerometer():\n global bus\n global addressAccelerometer\n global gPerCount\n\n # Read the data from the accelerometer chip\n try:\n [status, x, y, z] = bus.read_i2c_block_data(addressAccelerometer, 0, 4)\n ...
[ "0.7452085", "0.7070884", "0.68165433", "0.67197084", "0.666443", "0.6661803", "0.6624608", "0.662411", "0.65453815", "0.6515973", "0.649594", "0.64428717", "0.6409084", "0.6405043", "0.6390536", "0.6299898", "0.6257232", "0.6226725", "0.6195384", "0.61907744", "0.6167306", ...
0.7468074
0
Check the current published results
def check_current(ds: DataSource, config: QCConfig) -> ResultLog: log = ResultLog() df = ds.current if df is None: return None publish_date = 20200403 logger.warning(f" ** current-date is hard-coded to {publish_date}") logger.warning(f" ** because the API does not tell us the date the results...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def published(self, site=None):\n pub = self.on_site(site).filter(published=True)\n ref_date = get_timetravel_date()\n\n if settings.CMS_SHOW_START_DATE:\n pub = pub.filter(\n Q(publication_date__lt=ref_date) |\n Q(publication_date__isnull=True)\n )\n\n if settings.C...
[ "0.6468664", "0.64629805", "0.6457214", "0.64373285", "0.6372732", "0.6302752", "0.6261452", "0.62294877", "0.61678106", "0.6159598", "0.61494505", "0.61247075", "0.60797954", "0.60758376", "0.6038153", "0.60052043", "0.59978783", "0.59954745", "0.5929325", "0.59136754", "0.5...
0.54540247
81
Convert color to specified type of color
def color_convert(color, to_hex=False): if not isinstance(color, (tuple, list, str)): return None if isinstance(color, str): if color.startswith('#') and len(color)==7: return color if to_hex else tuple(bytes.fromhex(color[1:])) elif color in ImageColor.colormap: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_color(self, color):\n rgb = color['R'] << 16 | \\\n color['G'] << 8 | \\\n color['B']\n return ((rgb & 0x00f80000) >> 8) |\\\n ((rgb & 0x0000fc00) >> 5) | ((rgb & 0x000000f8) >> 3)", "def convertColor(self, color):\n if isinstance(color, b2Color)...
[ "0.75416094", "0.7527651", "0.7385632", "0.7283043", "0.6971354", "0.69151366", "0.6822825", "0.67685723", "0.6644522", "0.65058434", "0.65024257", "0.63818794", "0.6373325", "0.63386685", "0.63231", "0.63004357", "0.62858707", "0.6245515", "0.62444484", "0.624118", "0.621813...
0.73046905
3
Return True if queue is full.
def queue_is_full(self): return True if len(self.queue) == self.size else False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_full(self) -> bool:\n return self._queue_maxlen is not None and len(self.queue()) >= self._queue_maxlen", "def is_full(self):\n if self.size == len(self.queue):\n return True\n return False", "def is_empty(self):\n if self.queue:\n return False\n ...
[ "0.91314614", "0.90847266", "0.86651087", "0.84699225", "0.8442577", "0.84091", "0.8374729", "0.8329274", "0.8329274", "0.8326301", "0.83025724", "0.8302393", "0.82968646", "0.82448274", "0.812822", "0.81119657", "0.8103308", "0.8062899", "0.80342853", "0.792689", "0.7919318"...
0.9467046
0
Getter for puzzle height Returns an integer
def get_height(self): return self._height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self):\n return self.rectangle[3] - self.y", "def height(self):\n return self.propeties['height']", "def get_height(self) -> Number:\n return (self.right_bottom[1] - self.left_top[1])", "def getHeight(self):\n return self.height", "def height(self):\n return self...
[ "0.7383983", "0.7341251", "0.73408824", "0.7281785", "0.7264579", "0.72153205", "0.7204658", "0.7193345", "0.7146516", "0.7127698", "0.71228653", "0.70951164", "0.70951164", "0.70951164", "0.70951164", "0.70951164", "0.70951164", "0.70951164", "0.7094969", "0.7083831", "0.708...
0.70807844
23
Return row, col for a given number
def get_row_col(self, number): for row in range(self._height): for col in range(self._width): if self.get_number(row, col)== number: return (row, col)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_position(row_index, col_index, get_board_size):\n \n return (row_index - 1) * get_board_size + col_index - 1", "def get_goal_row_col(tile_number):\n return (math.floor((tile_number-1)/puzzle_length), (tile_number-1)%4)", "def get_number(self, row, col):\n return self._grid[row][col]", ...
[ "0.71599317", "0.71057576", "0.6975163", "0.6975163", "0.6975163", "0.69713503", "0.69044006", "0.6896121", "0.68810606", "0.68643165", "0.6855336", "0.6823942", "0.68221915", "0.6787729", "0.67757773", "0.67369133", "0.6700772", "0.669057", "0.66568875", "0.65765566", "0.657...
0.832595
0
Check whether the puzzle satisfies the row zero invariant at the given column (col > 1) Returns a boolean
def row0_invariant(self, target_col): okay = 3 if self.get_number(0, target_col)!=0: okay -=1 if self._height > 1: for row in range(1, self._height): for col in range(self._width): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def row0_invariant(self, target_col):\n # replace with your code\n boolean = True\n \n if self.get_number(0, target_col) != 0:\n boolean = False\n \n for row in range(2, self._height):\n for col in range(self._width):\n if self.current_...
[ "0.7494478", "0.74231726", "0.73957086", "0.73483545", "0.72608286", "0.726007", "0.7203167", "0.71599394", "0.71098536", "0.7061792", "0.7048282", "0.70203644", "0.6993979", "0.69595695", "0.6939741", "0.6930234", "0.6919212", "0.6861535", "0.6849788", "0.68425155", "0.67902...
0.72046924
6
Check whether the puzzle satisfies the row one invariant at the given column (col > 1) Returns a boolean
def row1_invariant(self, target_col): okay = 4 if self.get_number(1, target_col)!=0: okay -=1 if self._height > 2: for row in range(2, self._height): for col in range(self._width): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def row1_invariant(self, target_col):\n # replace with your code\n boolean = True\n \n if self.get_number(1, target_col) != 0:\n boolean = False\n \n for row in range(2, self._height):\n for col in range(self._width):\n if self.current_...
[ "0.7582855", "0.7541084", "0.7463578", "0.73139936", "0.73131096", "0.7242679", "0.7090788", "0.70749265", "0.7059132", "0.70545477", "0.70400923", "0.69783545", "0.6959642", "0.6924735", "0.69098383", "0.68440205", "0.6820857", "0.6802492", "0.6802239", "0.67923874", "0.6781...
0.7106467
6
Get all projects in the database.
def get_projects(self): self.cur.execute('SELECT * FROM projects;') projects = [Projects(row) for row in self.cur.fetchall()] return projects
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_projects() -> typing.List[Project]:\n return [Project.from_database(project) for project in projects.Project.query.all()]", "def all_projects(self):\n url = self._create_url('/projects')\n project_list = self._paginate(url)\n return [Project(project, self) for project in project_l...
[ "0.8078442", "0.78598136", "0.7800723", "0.7739288", "0.7704663", "0.7618908", "0.76136357", "0.75361365", "0.75307924", "0.75206846", "0.7496263", "0.7492863", "0.743876", "0.73742557", "0.7325451", "0.7254708", "0.7170115", "0.7158164", "0.71577114", "0.7157618", "0.7157332...
0.84033686
0
Get the version of an installed Kubernetes binary.
def get_version(bin_name): cmd = "{} --version".format(bin_name).split() version_string = subprocess.check_output(cmd).decode("utf-8") return tuple(int(q) for q in re.findall("[0-9]+", version_string)[:3])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_binary_version():\n out = call(build_command('supported_job_types'), capture=True)\n return yaml.load(out)['Version']", "def kubernetes_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"kubernetes_version\")", "def get_version():\n return subprocess.check_output([\"./version\...
[ "0.7449327", "0.733928", "0.71945065", "0.68977517", "0.68630415", "0.6828755", "0.6826724", "0.67509305", "0.6655767", "0.6630889", "0.6629762", "0.66045845", "0.65994537", "0.654829", "0.6508428", "0.6501154", "0.64997256", "0.64901", "0.6483079", "0.6478434", "0.6470018", ...
0.59256905
81
Return the package architecture as a string. Raise an exception if the architecture is not supported by kubernetes.
def arch(): # Get the package architecture for this system. architecture = check_output(["dpkg", "--print-architecture"]).rstrip() # Convert the binary result into a string. architecture = architecture.decode("utf-8") return architecture
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def architecture(self) -> Optional[str]:\n return pulumi.get(self, \"architecture\")", "def architecture(self):\n return self.config[\"architecture\"].lower()", "def network_architecture(self) -> Optional[str]:\n return pulumi.get(self, \"network_architecture\")", "def get_architecture(s...
[ "0.74803966", "0.74690175", "0.7189926", "0.7184829", "0.68332493", "0.67911845", "0.66696656", "0.66093147", "0.6608245", "0.65085095", "0.64722115", "0.64238524", "0.641096", "0.6387898", "0.63866323", "0.62710196", "0.62654287", "0.62157404", "0.6210075", "0.6105212", "0.5...
0.7412448
2
Return the cluster CIDR provided by the CNI
def cluster_cidr(): cni = endpoint_from_flag("cni.available") if not cni: return None config = hookenv.config() if "default-cni" in config: # master default_cni = config["default-cni"] else: # worker kube_control = endpoint_from_flag("kube-control.dns.availabl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cidr(self) -> str:\n return pulumi.get(self, \"cidr\")", "def cidr(self) -> str:\n return pulumi.get(self, \"cidr\")", "def cidr(self) -> Optional[str]:\n return pulumi.get(self, \"cidr\")", "def service_cidr(self) -> str:\n return pulumi.get(self, \"service_cidr\")", "def s...
[ "0.73568434", "0.73568434", "0.6964934", "0.67933697", "0.67602056", "0.6674602", "0.65102667", "0.64480513", "0.6293711", "0.6244947", "0.6163739", "0.6163739", "0.6107072", "0.5971225", "0.59429157", "0.59007627", "0.58800155", "0.58800155", "0.5871071", "0.5834058", "0.580...
0.8506057
0
Convert a commaseparated list of CIDRs to a list of networks.
def get_networks(cidrs): if not cidrs: return [] return [ipaddress.ip_interface(cidr).network for cidr in cidrs.split(",")]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def networks(self, raw_name):\n network_tokens = self.raw.get(raw_name, '').split()\n networks = [ip_network(force_unicode(n)) for n in network_tokens]\n return networks", "def get_network_list():\n return jsonify([\n network.to_json(include_id=True)\n for network in manager...
[ "0.6020886", "0.5758665", "0.57063395", "0.5685904", "0.56644607", "0.56527406", "0.5637599", "0.5635783", "0.5550758", "0.5493373", "0.5464912", "0.5451585", "0.54496473", "0.54218656", "0.5421073", "0.541219", "0.53728503", "0.5361704", "0.53537524", "0.5351278", "0.5329993...
0.7781171
0
Get the IPv4 network from the given CIDRs or None
def get_ipv4_network(cidrs): return {net.version: net for net in get_networks(cidrs)}.get(4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_networks(cidrs):\n if not cidrs:\n return []\n return [ipaddress.ip_interface(cidr).network for cidr in cidrs.split(\",\")]", "def get_ipv6_network(cidrs):\n return {net.version: net for net in get_networks(cidrs)}.get(6)", "def is_ipv4(cidrs):\n return get_ipv4_network(cidrs) is not...
[ "0.68396324", "0.65891683", "0.6569711", "0.6031163", "0.5849861", "0.5718444", "0.5649376", "0.5634892", "0.5588997", "0.55871654", "0.55871654", "0.55784345", "0.5563871", "0.55369973", "0.55092037", "0.5508994", "0.5495022", "0.54686254", "0.54592407", "0.5423335", "0.5402...
0.8414063
0
Generate a random string compliant with RFC 1123.
def generate_rfc1123(length=10): length = 253 if length > 253 else length valid_chars = string.ascii_lowercase + string.digits rand_str = "".join(random.SystemRandom().choice(valid_chars) for _ in range(length)) return rand_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_base32()->str:\n return pyotp.random_base32()", "def randomstring():\n return str(uuid.uuid4())", "def _random_str(self):\n letters = string.ascii_letters + string.digits\n return ''.join(choice(letters) for i in range(32))", "def random_str(length=None):\n if n...
[ "0.7705366", "0.76965237", "0.7497582", "0.7439711", "0.73958534", "0.7367533", "0.7295689", "0.7275817", "0.71694785", "0.7159981", "0.7156243", "0.7123163", "0.71129626", "0.71015847", "0.70918643", "0.7063497", "0.70447814", "0.70409596", "0.70350933", "0.7034632", "0.7011...
0.77168745
0
Get the password for the given user from the secret that CK created.
def get_secret_password(username): try: output = kubectl( "get", "secrets", "-n", AUTH_SECRET_NS, "--field-selector", "type={}".format(AUTH_SECRET_TYPE), "-o", "json", ).decode("UTF-8") except CalledP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetPassword(user):\n s = secrets.GetSecret(_PasswordName(user))\n try:\n return json.loads(s)\n except ValueError:\n # Pre-json format.\n return dict(version=_PASSWORD_VERSION_MD5, hashed=s)", "def GetPassword(user):\r\n s = secrets.GetSecret(_PasswordName(user))\r\n try:\r\n return json.loa...
[ "0.7955506", "0.7905318", "0.7741713", "0.75885606", "0.74969256", "0.74969256", "0.727546", "0.7267161", "0.72657037", "0.725735", "0.72371024", "0.7135778", "0.7069997", "0.69722754", "0.6958294", "0.6958294", "0.6958294", "0.69559264", "0.6941756", "0.68794477", "0.6879447...
0.73164785
6
Determines the preferred NodeIP value for this node.
def get_node_ip(): cidr = cluster_cidr() if cidr and is_ipv6_preferred(cidr): return get_ingress_address6("kube-control") else: return get_ingress_address("kube-control")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ip(self) -> Optional[str]:\n return pulumi.get(self, \"ip\")", "def ip(self) -> Optional[str]:\n return pulumi.get(self, \"ip\")", "def get_node_ip(self):\n if \"node_ip\" not in self.__dict__:\n self.node_ip = ray._private.services.get_node_ip_address()\n return self...
[ "0.71754795", "0.71754795", "0.7156791", "0.7023722", "0.6949105", "0.694892", "0.694892", "0.694892", "0.694892", "0.694892", "0.694892", "0.6948741", "0.69104046", "0.688911", "0.68481183", "0.6813714", "0.67129487", "0.6658708", "0.6605859", "0.66009235", "0.65539163", "...
0.72209495
0
Check if CNI config exists in /etc/cni/net.d. Returns True or False.
def cni_config_exists(): cni_conf_dir = "/etc/cni/net.d" try: return bool(os.listdir(cni_conf_dir)) except FileNotFoundError: # cni conf dir doesn't exist -> cni conf doesn't exist return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_exists():\n return CONFIG_PATH.exists()", "def my_login_config_exists():\n\n my_login_fullpath = os.path.normpath(my_login_config_path() + \"/\"\n + _MYLOGIN_FILE)\n return os.path.isfile(my_login_fullpath)", "def checkExistCfg (self) :\n\n exi...
[ "0.68963987", "0.6248563", "0.62167805", "0.61965567", "0.6078258", "0.59937596", "0.5988714", "0.59735954", "0.59565246", "0.59561145", "0.59393257", "0.5912482", "0.5902125", "0.58930874", "0.58069164", "0.5777486", "0.57618415", "0.56324667", "0.5602119", "0.5577704", "0.5...
0.9076958
0
Helper function for calculating the LL of X.
def _calc_ll(self): col_lookups_ = [{ } for d in range(self.D)] for d in range(self.D): for n in range(self.N): x = self.expected_X[n, d] N = np.sum(list(col_lookups_[d].values())) p_x = 0 if x in col_lookups_[d]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_L(X):\n return 0.0 # TODO implement?", "def lagrange(self, x, l):\n N = self.nnode(l)\n c = np.array([x - self.x[l]]) * np.array([np.ones(N)]).T\n c = c * (1. - np.identity(N)) + np.identity(N)\n return np.prod(c, 1) / self.cnorm[l]", "def _calc_ll(self):\n Λ ...
[ "0.78413653", "0.7311705", "0.72460693", "0.71147764", "0.6741199", "0.6732981", "0.67255926", "0.6587823", "0.6529878", "0.64419603", "0.6435733", "0.6352777", "0.63400126", "0.63201946", "0.6255788", "0.6213383", "0.61992604", "0.61871696", "0.61823833", "0.61707944", "0.61...
0.6691707
7
Represents zero or more dice to be rolled together. Default state is just a constant term of 0.
def __init__(self, s: Optional[str] = None, dice: Optional[Counter] = None, constant: int = 0): assert not (s and (dice or constant)), \ "Dice should be initialized with a string OR a counter and constant" if s: dice, constant = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roll_dice(self):\n dice_roll = random.choices(population=[0, 1], k=4)\n self.__current_dice_roll = dice_roll\n return dice_roll", "def roll(self) -> 'Roll':\n rolls = {\n dice_size: [random.randint(1, dice_size) for _ in range(n)]\n for (dice_size, n) in self...
[ "0.6841079", "0.67315835", "0.66803104", "0.6334407", "0.63226074", "0.6255771", "0.6207293", "0.6200123", "0.6162394", "0.6110012", "0.609741", "0.6080103", "0.60689545", "0.60673106", "0.60174096", "0.6017379", "0.5979258", "0.59291023", "0.5922035", "0.591001", "0.5896041"...
0.0
-1
Convert the health status encapsulated in this object to a serializable dict
def to_dict(self): return { "cpu_count": self.cpu_count, "load": self.load[0], "total_memory": self.total_memory, "available_memory": self.available_memory, "total_disk": self.total_disk, "used_disk": self.used_disk, "free_disk"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self) -> Dict:\n _dict = {}\n if hasattr(self, 'status') and self.status is not None:\n _dict['status'] = self.status\n return _dict", "def as_dict(self):\n status_dict = {\"state\": self.state, \"note\": self.note,\n \"time\": self.when}\n...
[ "0.77415234", "0.748939", "0.70643324", "0.7004841", "0.69035333", "0.67901534", "0.6625553", "0.6583464", "0.6565331", "0.6557975", "0.65031147", "0.64769006", "0.6426919", "0.6426436", "0.64171714", "0.63394433", "0.62963504", "0.6289742", "0.6279629", "0.6269956", "0.62517...
0.0
-1
get zookeeper nodes recursively
def _get_recursively(zoo_client, path, nodes): try: data, _ = zoo_client.get(path) except NoNodeError as exc: log.warning("No node exists in path: %s", path) else: nodes.append({"path": path, "data": data}) for child in zoo_client.get_children(path): child_path = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_nodes(self):\n return hou.node(\"/\").allSubChildren()", "def recursive_list(self, path, results):\n try:\n data, stat = self.client.get(path)\n\n if data:\n node_as_string = data.decode(\"utf-8\")\n if not node_as_string:\n ...
[ "0.63433176", "0.63114065", "0.624962", "0.6237687", "0.610826", "0.61057067", "0.6084103", "0.6078951", "0.5992036", "0.59514886", "0.59317595", "0.59153074", "0.58893514", "0.5886538", "0.58703166", "0.58348346", "0.57646745", "0.5747883", "0.57423353", "0.5724034", "0.5689...
0.68456775
0
constructor that calls super with strength as 1 to heal instead of deal damage and 100 health
def __init__(self): super(Person, self).__init__(100, -5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, strength, proficiency_bonus, equipment_bonus):\n self.to_hit_modifier = strength + proficiency_bonus + equipment_bonus\n self.damage_modifier = strength + equipment_bonus", "def __init__(self):\n super(Werewolf, self).__init__(health=200, attack=randint(5, 30))", "def __...
[ "0.75181997", "0.7160249", "0.69540715", "0.69399536", "0.6926523", "0.68339217", "0.67927504", "0.675582", "0.6712827", "0.66999304", "0.6694217", "0.6690871", "0.6638008", "0.662466", "0.6505284", "0.6488662", "0.644573", "0.63687396", "0.6331299", "0.6304042", "0.6294676",...
0.0
-1
return True if any address in the network is sanitized address, otherwise it returns False
def isThisArtifact(artifact: Any, address: str) -> bool: if not address: return False sanitizedAddress = address.lower() for network in artifact['networks'].values(): if ('address' in network and network['address'].lower() == sanitizedAddress): return True ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_valid_ip(self, address):\n try:\n # Is this an valid ip address?\n ipaddress.ip_network(address)\n except ValueError:\n return False\n return True", "def ip_is_safe(ip):\n\n if PY2:\n ip = ip.decode()\n\n ip = ipaddress.ip_address(ip)\n\n...
[ "0.7040189", "0.6943948", "0.693862", "0.6856926", "0.67805415", "0.67561305", "0.6665161", "0.6609351", "0.659286", "0.652584", "0.64987636", "0.6493398", "0.6490561", "0.6457706", "0.63962436", "0.63770056", "0.63525593", "0.63432395", "0.63291925", "0.62656933", "0.6246248...
0.0
-1
The first WiFi credential. Same as ``WifiConfigRecord().credentials[0]``.
def credential(self): return self.credentials[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credential(self) -> Optional[Any]:\n return pulumi.get(self, \"credential\")", "def credential(self):\n return self._credential", "def password(self):\n return self.passwords[0]", "def get_credential(self):\n return self._g_credential", "def get_credential(self):\n re...
[ "0.6571675", "0.628194", "0.5989465", "0.5933263", "0.5933263", "0.5933263", "0.57734627", "0.57734627", "0.5687773", "0.5682295", "0.56621027", "0.56230503", "0.56051594", "0.5597703", "0.55970514", "0.5563289", "0.5463963", "0.54147816", "0.5409228", "0.5405276", "0.5327787...
0.73870635
0
The first WiFi device password. Same as ``WifiPasswordRecord().passwords[0]``.
def password(self): return self.passwords[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_password(self):\n return self._value[2]", "def password_id(self):\n return self._value[1]", "def password(self) -> Optional[str]:\n return pulumi.get(self, \"password\")", "def password(self) -> Optional[str]:\n return pulumi.get(self, \"password\")", "def password(se...
[ "0.750212", "0.6795979", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.6222084", "0.62217164", "0.6221665", "...
0.7776556
0
Calculate cost of a single subroute
def calculate_route_cost(cost_function, route): cost = 0.0 for node, next_node in zip(route, route[1:]): cost += cost_function(node, next_node) return cost
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_routes_cost(self):\n total_route_cost = sum([route.cost for route in self.routes])\n self.cost_routes = total_route_cost\n return total_route_cost", "def routing_cost(solution: Solution) -> float:\n return sum(route.routing_cost() for route in solution.routes)", "def get_...
[ "0.7550914", "0.7486441", "0.72901994", "0.6894595", "0.6825608", "0.6690088", "0.6599707", "0.65915793", "0.6562964", "0.65538365", "0.654202", "0.65389967", "0.6527177", "0.6527177", "0.652412", "0.6509943", "0.6509943", "0.6509943", "0.6509943", "0.6509943", "0.6509943", ...
0.75759864
0
Returns the dict as a model
def from_dict(cls, dikt) -> 'TokenEKeyLock': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.0
-1
Gets the bd_address of this TokenEKeyLock.
def bd_address(self) -> str: return self._bd_address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address(self):\n if self._address:\n pass\n elif 'address' in self.keystore:\n self._address = self.keystore['address'].decode('hex')\n elif not self.locked:\n self._address = keys.privtoaddr(self.privkey)\n else:\n return None\n re...
[ "0.6680096", "0.6218125", "0.6087529", "0.6073548", "0.6073548", "0.6051087", "0.59993696", "0.59674025", "0.5927861", "0.5919327", "0.5919327", "0.5919327", "0.5919327", "0.5919327", "0.59188443", "0.59188443", "0.59188443", "0.59188443", "0.59188443", "0.5864293", "0.586315...
0.6908366
0
Gets the device_name of this TokenEKeyLock.
def device_name(self) -> str: return self._device_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self.device_name", "def name(self):\n return self.device.name", "def device_name(self) -> str:\n return self._info[\"group name\"]", "def name(self) -> str:\n return self._device.name", "def name(self) -> str:\n return self._info.device_identifica...
[ "0.7456194", "0.72414786", "0.72388685", "0.72378325", "0.7185758", "0.7157913", "0.7145668", "0.7066999", "0.70527816", "0.70012045", "0.69952154", "0.69952154", "0.69681275", "0.69338936", "0.6910941", "0.6857118", "0.68250597", "0.67536336", "0.6645839", "0.66171676", "0.6...
0.78081244
0
Create Prioritized Replay buffer.
def __init__(self, limit, names, args): super(PrioritizedReplayBuffer, self).__init__(limit=limit, names=names, args=args) self.alpha = 0.6 assert self.alpha > 0 # self.beta_schedule = LinearSchedule(int(args['--max_steps']), # initial_p=float(args...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_replay_buffer(self):\n logger.info(\"setting up replay buffer\")\n if self.hps.prioritized_replay:\n if self.hps.unreal: # Unreal prioritized experience replay\n self.replay_buffer = UnrealReplayBuffer(self.hps.mem_size,\n ...
[ "0.68967235", "0.6726801", "0.64766884", "0.64482725", "0.6056115", "0.60378754", "0.58691096", "0.56049216", "0.56049216", "0.5561734", "0.5521371", "0.5402302", "0.53582233", "0.53272617", "0.53270197", "0.5296132", "0.52688795", "0.5263801", "0.5208025", "0.5181228", "0.51...
0.55407757
10
Test a simple query with limit/offset.
def test_datasette_limit_offset(mocker: MockerFixture, requests_mock: Mocker) -> None: mocker.patch( "shillelagh.adapters.api.datasette.requests_cache.CachedSession", return_value=Session(), ) columns_url = ( "https://global-power-plants.datasettes.com/global-power-plants.json?" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_query_paginate_offset(self):\n paginator = Paginator('', 'offset', '1')\n\n models = self.session.query(Person).apply_paginators([paginator]).all()\n self.assertTrue(len(models) == 1)\n self.assertTrue(models[0].name == 'Carl')", "def test_limit(self):\n self.assertEqu...
[ "0.7552823", "0.7156377", "0.7084405", "0.6684493", "0.65930563", "0.6466607", "0.6459954", "0.64268965", "0.6355562", "0.6348768", "0.6311085", "0.62605834", "0.6237708", "0.6221368", "0.6190382", "0.6189337", "0.61811453", "0.614464", "0.60510045", "0.6048519", "0.60423696"...
0.5687975
49
Get het agent Jacobian
def get_jacob(phi, kappa, ss, T): exogenous = ['rstar', 'Z'] unknowns = ['pi', 'w', 'Y'] targets = ['nkpc_res', 'asset_mkt', 'labor_mkt'] block_list = [ss['J_ha'], hank.firm, hank.monetary, hank.fiscal, hank.nkpc, hank.mkt_clearing] ss2 = ss.copy() ss2.update({'phi': phi, 'kappa': kappa}) # Upd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jacobian(self):\n return self.der", "def jacobian(self):\n return self._jacobian", "def Jacobian(self):\n return _eltrans.ElementTransformation_Jacobian(self)", "def jacobian(self, x):\n pass", "def jacobianF(self):\n\n jacob = np.eye(len(self.x))\n jacob[0][1]...
[ "0.8237996", "0.7860302", "0.75566435", "0.7353594", "0.71745294", "0.7147805", "0.71016526", "0.70907474", "0.70849735", "0.68845403", "0.6823151", "0.6774034", "0.67580396", "0.67508537", "0.67001295", "0.66384864", "0.65420264", "0.6538183", "0.65265596", "0.65258205", "0....
0.0
-1
Creates a decorator for an extension method taking a sequence of types.
def method(cls, *types): def decorator(f): f.extension_method = True def _(self, *args, **kwargs): result = f(self, *args, **kwargs) self.result = result return result f_slot = QtCore.pyqtSlot(*types)(f) return f_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __type_annotations_factory():\n RTYPES = collections.defaultdict(list)\n\n def register_first_class_function(f):\n \"\"\"\n Register lifted version of function for use with higher-order \n functions.\n \"\"\"\n\n @params(convert=False, first_class=False)\n @rtype...
[ "0.58352023", "0.58284855", "0.56036806", "0.5530457", "0.5432983", "0.54217535", "0.54135114", "0.5358176", "0.5346211", "0.53433186", "0.5290221", "0.5250516", "0.52408737", "0.5224888", "0.52224743", "0.51982635", "0.51508", "0.5130756", "0.51277685", "0.5103493", "0.50776...
0.5703442
2
Return list of coefficients of f with alternating signs, starting with signed leading coefficient and ending with constant term.
def signed_coefficients(f): n = f.degree() return list(reversed([ci*(-1)**(n-i) for i,ci in enumerate(f.coefficients(sparse=False))]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polynomial_approximation_coefficients(f, dilatation_factor=50, polynomial_degree=25,\n bound=1, convertToTensor=True):\n p,_ = chebyshev_approximation(f, dilatation_factor, polynomial_degree, bound, convertToTensor)\n\n return Polynomial.cast(p).coef", "def poly...
[ "0.5918558", "0.5884401", "0.57318264", "0.5728146", "0.55546665", "0.55526525", "0.555183", "0.5453886", "0.5390277", "0.5381316", "0.53732896", "0.53568", "0.5356382", "0.532207", "0.53056496", "0.5302266", "0.5278897", "0.5271422", "0.526524", "0.52461696", "0.5200207", ...
0.7773387
0
Return sum((1)^i c[i] x^(ni))
def poly_from_signed_coefficients(c): Rx = PolynomialRing(Sequence(c).universe(),'x') return Rx(list(reversed([ci*(-1)**i for i,ci in enumerate(c)])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bintodec(x):\n\n num = 0\n n = len(x)\n for i in range(n):\n num = num + 2 ** i * int(x[n - i - 1])\n return num", "def f(x, co):\r\n result = 0\r\n\r\n for a, b in enumerate(reversed(co)):\r\n result += x**a * b\r\n\r\n return result", "def __sum(self, x: float, n: int) ...
[ "0.67631125", "0.6710623", "0.66851056", "0.6660532", "0.65849626", "0.6566532", "0.6477205", "0.64455754", "0.63903004", "0.6343338", "0.63359654", "0.6322291", "0.6317002", "0.62672085", "0.62650895", "0.6261761", "0.62480164", "0.6242288", "0.62380457", "0.618525", "0.6173...
0.0
-1
Return the i,k plethysm, optionally limiting to partitions with no part greater than nmax, returning a list of (partition, multiplicity) pairs.
def pleth_b(i,k,nmax=None): e = SymmetricFunctions(QQ).e() p = e[i].plethysm(e[k]) if nmax: return [(part,mult) for part,mult in p if all(c<=nmax for c in part)] else: return list(p)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partitions(n):\n return partitions_with_max(n, max=n - 1)", "def partitions_with_max(n, max):\n if n == 0:\n yield []\n return\n for first_element in range(max, 0, -1):\n if first_element > n:\n continue\n k = n - first_element\n for sub_partition in par...
[ "0.6744306", "0.65868276", "0.6186762", "0.60223633", "0.58487004", "0.58234495", "0.58228856", "0.5751307", "0.5709245", "0.5706328", "0.56132287", "0.557762", "0.553976", "0.5452582", "0.53879666", "0.5370562", "0.5358359", "0.5327009", "0.5326963", "0.53247243", "0.5321511...
0.63662547
2
Load Pandas OHLCV model from csvfile.
def LoadFromFile(self, fileName): uLogger.info("Loading, parse and preparing input data from [{}]...".format(os.path.abspath(fileName))) self.prices = pd.read_csv(fileName, names=self.csvHeaders, engine="python", sep=self.sep, parse_dates={"datetime": ["date", "time"]}) if self.horizon is None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_csv(self, csv_url: str) -> pd.DataFrame:\n # Reading CSV File containing 1 min candlestick data\n data = pd.read_csv(csv_url, index_col='Timestamp')\n # Converting Timestamp numbers into a new column of readable dates\n data['Datetime'] = [datetime.fromtimestamp(i) for i in da...
[ "0.7171117", "0.699683", "0.6989101", "0.693242", "0.6861628", "0.6754964", "0.6743947", "0.67408717", "0.67198235", "0.6696275", "0.66590595", "0.6652281", "0.66109276", "0.66098607", "0.65953827", "0.656832", "0.6505332", "0.64934206", "0.64914525", "0.64874953", "0.6473713...
0.60776085
70
Rendering prices from pandas dataframe to Bokeh chart of candlesticks and save to htmlfile.
def RenderBokeh(self, fileName="index.html", viewInBrowser=False): if self.prices is not None and not self.prices.empty: uLogger.info("Rendering pandas dataframe as Bokeh chart...") self.DetectTimeframe() # auto-detect time delta between last two neighbour candles infoBlock...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Render(prices: pd.DataFrame, name=\"Example instrument\", show=True):\n chart = pg.PriceGenerator()\n prices[\"datetime\"] = pd.to_datetime(prices[\"date\"] + \" \" + prices[\"time\"])\n chart.ticker = os.path.basename(name)\n chart.prices = prices\n chart.RenderBokeh(viewInBrowser=show)", "de...
[ "0.78551465", "0.6845032", "0.68227607", "0.64319235", "0.62000227", "0.6180305", "0.60700446", "0.6067019", "0.60339355", "0.6001011", "0.59204096", "0.59093773", "0.5840434", "0.5840434", "0.58366", "0.58366", "0.5792943", "0.5787689", "0.57849246", "0.57674557", "0.5721986...
0.83305204
0
Get split strategy by device arrangement and tensor map.
def _get_tensor_strategy(dev_mat, tensor_map): tensor_strategy = [] for dim in tensor_map: if dim == -1: tensor_strategy.append(1) else: tensor_strategy.append(dev_mat[-dim-1]) return tensor_strategy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(self):\n self.pattern_fuse()\n if self.enable_recompute:\n self.recompute_fuse()\n # The reshape should not be output node\n # Note: after this function, the input output relation is not maintained.\n self.split_output_reshapes()\n subgraphs, graphmode...
[ "0.5731752", "0.5634825", "0.56161577", "0.549865", "0.54955924", "0.54855055", "0.5473944", "0.543034", "0.53939474", "0.53885037", "0.5385147", "0.5346388", "0.5267271", "0.5206407", "0.51991373", "0.51918787", "0.51876885", "0.51850325", "0.5156956", "0.51563364", "0.51427...
0.58813673
0
Get the tensor slice of the local device by the device matrix and the tensor map
def _load_tensor(tensor, dev_mat, tensor_map): rank = get_rank() tensor_strategy = _get_tensor_strategy(dev_mat, tensor_map) tensor_slice_index = _get_tensor_slice_index(dev_mat, tensor_strategy, tensor_map, rank) np_tensor = tensor.asnumpy() np_tensor_list = _chunk_tensor_by_strategy(np_tensor, ten...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_slice_index(dev_mat, tensor_map, opt_shard_group):\n rank = get_rank()\n dev_num = get_group_size()\n tensor_strategy = _get_tensor_strategy(dev_mat, tensor_map)\n tensor_slice_index = _get_tensor_slice_index(dev_mat, tensor_strategy, tensor_map, rank)\n if opt_shard_group:\n tensor_...
[ "0.6195271", "0.60259444", "0.6016944", "0.5854278", "0.5844765", "0.5792632", "0.5783113", "0.5746306", "0.571434", "0.5646334", "0.5615899", "0.5593126", "0.5559323", "0.553105", "0.5508888", "0.5495937", "0.5451664", "0.54449934", "0.543774", "0.54306346", "0.5387654", "...
0.6818225
0
Combine param slice by the device matrix, used in model parallel scenario.
def _reshape_param_data_with_weight(param_data, dev_mat, field_size): device_count = 1 for dim in dev_mat: device_count *= dim tensor_slices = np.split(param_data.asnumpy(), device_count, axis=0) tensor_slices_col = [] for i in range(len(tensor_slices[0][0])): tensor_slices_new = np...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reshape_param_data(param_data, dev_mat, tensor_map):\n\n device_count = 1\n for dim in dev_mat:\n device_count *= dim\n\n tensor_slices = np.split(param_data.asnumpy(), device_count, axis=0)\n tensor_strategy = _get_tensor_strategy(dev_mat, tensor_map)\n\n # get the actual number of slic...
[ "0.6473759", "0.60939884", "0.6004689", "0.5910299", "0.5617355", "0.55392647", "0.5419167", "0.53331846", "0.5304986", "0.52161855", "0.51844555", "0.5174776", "0.5153179", "0.5149396", "0.5098599", "0.5097675", "0.50755835", "0.5050902", "0.50192887", "0.500508", "0.5004453...
0.5365723
7
Yield successive nsized chunks from lst.
def _chunks(lst, n): for i in range(0, len(lst), n): yield lst[i : i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def _chunks(self, lst: List, n: int) -> List:\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def _chunks(self, lst: List, n: int) -> List:\n for i in range(0, len(lst), n):\...
[ "0.83071756", "0.8290744", "0.8290744", "0.8237026", "0.8146566", "0.81460685", "0.81267184", "0.81267184", "0.8107211", "0.8082399", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0.80533457", "0...
0.81414855
6
Switch between supported architectures
def cycle_architecture(self): # actions.mode.disable(f"user.{self.architecture}") self.arch_index += 1 if self.arch_index == len(self.architectures): self.arch_index = 0 self.architecture = self.architectures[self.arch_index] # XXX - debugger ever has more tags, this ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_modify_arch1(self):\n self.ctx = TritonContext()\n for _ in range(10):\n self.ctx.setArchitecture(random.choice((ARCH.X86_64, ARCH.X86, ARCH.AARCH64)))", "def architecture(self):\n return self.config[\"architecture\"].lower()", "def guess_arch():\n if is_windows():\n...
[ "0.6897383", "0.6479829", "0.6465035", "0.64616644", "0.6372609", "0.6253799", "0.6239242", "0.6218353", "0.6178498", "0.6165559", "0.61632955", "0.6114683", "0.6107296", "0.6092927", "0.6081746", "0.60311973", "0.59370726", "0.593076", "0.5909252", "0.5881043", "0.5848538", ...
0.5832459
21
Constructor creates a YQuery object with a particular fantasy game context, and maps that games stats into the stat_categories dictionary
def __init__(self, yhandler, game_key, selector=None): self.yhandler = yhandler self.query_format = 'xml' self.stat_categories = {} self.game_key = game_key self.selector = selector if selector else DefaultSelector() self.ns = {'yh': 'http://fantasysports.yahooapis.com/fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_stat_categories(self):\n save_format = self.yhandler.format\n self.yhandler.format = self.query_format\n resp = self.yhandler.api_req(str.format('game/{0}/stat_categories', self.game_key))\n selector = self.yhandler.format = save_format\n if resp.status_code != requests.c...
[ "0.58420324", "0.50564504", "0.48429975", "0.47705916", "0.4746372", "0.46821374", "0.4644766", "0.4616653", "0.4614028", "0.4545316", "0.4491808", "0.44907758", "0.44872868", "0.44793975", "0.44669312", "0.44555125", "0.44422305", "0.44354543", "0.44350898", "0.44200745", "0...
0.6524061
0
Finds, if both concatenations pq and qp are primes.
def prime_combination(p, q): pq = int(str(p) + str(q)) qp = int(str(q) + str(p)) if is_prime(pq) and is_prime(qp): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Rp_prime(a,b):\n result = Rp_path(a,b)\n return result.any", "def calculatePQ(nValue):\n global p,q\n for i in list(prime):\n for j in list(prime):\n if i==j:\n continue\n if (i*j)==nValue:\n p = i\n q = j", "def find_p_q...
[ "0.67977625", "0.668674", "0.65868646", "0.6475099", "0.63185877", "0.6303417", "0.6276986", "0.6275268", "0.6255952", "0.62340343", "0.62109333", "0.61989045", "0.61909765", "0.6132339", "0.6125954", "0.6111212", "0.608433", "0.6061498", "0.60377175", "0.6030246", "0.6018858...
0.75402427
0
Ages life by ``years``
def growup(self,years): self.age += years if self.age > 100: self.die()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age_years(self) -> int:\n return self.__age_years", "def adult_age(multiplier: int) -> int:\n return 24 + (years - 2) * multiplier", "def set_age_years(self, new_age_years: int):\n if new_age_years >= 0:\n self.__age_years = new_age_years\n else:\n rais...
[ "0.7077464", "0.69061375", "0.68998903", "0.68921113", "0.6817265", "0.68015796", "0.6675627", "0.6653641", "0.66382164", "0.6551407", "0.64950615", "0.64688504", "0.64641", "0.64338386", "0.6428737", "0.6413839", "0.63534176", "0.6315532", "0.6315532", "0.6294963", "0.628090...
0.68614304
4
Return the length of the snake.
def length(self): return len(self.coords)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length(self):\n result = 0\n for seg in self.segments:\n result += seg.length \n return result", "def get_length(self):\n return self.__length", "def getLength(self) -> int:\n ...", "def getLength(self) -> int:\n ...", "def getLength(self) -> int:\n ...
[ "0.696757", "0.69400424", "0.6929577", "0.6929577", "0.6929577", "0.6865742", "0.6857843", "0.6815062", "0.68097293", "0.6792412", "0.67685485", "0.6754264", "0.67515785", "0.67492956", "0.6749227", "0.6742818", "0.6702005", "0.66953874", "0.6694828", "0.6694828", "0.6688154"...
0.0
-1
(list) > tuple of (int, int) return a tuple of the indices of the two smallest values in list L
def find_two_smallest(L): smallest = min(L) min1 = L.index(smallest) L.remove(smallest) next_smallest = min(L) min2 = L.index(next_smallest) #put smallest back into L L.insert(min1, smallest) # remember to increment the index! if min1 <= min2: min2 += 1 return (min1, min2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMinAndIndex(myList):\n # For a faster implementation in big lists, try return numpy.argmin(myList)\n min_val = min(myList)\n return (min_val, myList.index(min_val))", "def find_min_loc(L):\n minval = L[0]\n minloc = 0\n\n for i in list(range(len(L))):\n if L[i] < minval: # a smal...
[ "0.79484856", "0.7522722", "0.7186018", "0.71342623", "0.71259737", "0.710504", "0.70792717", "0.6941746", "0.6825889", "0.6782504", "0.6767667", "0.6757816", "0.6558454", "0.6530633", "0.64231783", "0.63773537", "0.63641256", "0.6351495", "0.6351231", "0.6340194", "0.633581"...
0.7119687
5
For a dataset, create a generator over (images, kwargs) pairs. Each images is an NCHW float tensor, and the kwargs dict contains zero or more keys, each of which map to a batched Tensor of their own. The kwargs dict can be used for class labels, in which case the key is "y" and the values are integer tensors of class l...
def load_data_text( *, data_dir, batch_size, image_size, class_cond=False, deterministic=False, data_args=None, task_mode='roc', model=None, padding_mode='block', split='train', load_vocab=None, ): print('hello loading text data. ') if data_args.experiment.startswith('random') and model is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_generator(data_dir, labels_list, dataset_stats_path, batch_size, labels_dict):\n\n ### Reading the pixel means and standard deviations of the dataset saved in a file\n with open(dataset_stats_path, 'r') as f:\n stats = f.read().splitlines()\n \n mean_str = stats[0].split(':')[0] ...
[ "0.65954536", "0.63674873", "0.63469833", "0.6335439", "0.6318026", "0.63142693", "0.62468", "0.622198", "0.6219094", "0.6193335", "0.61575305", "0.6126556", "0.61105245", "0.60304594", "0.60159165", "0.6011088", "0.6008079", "0.6005456", "0.59769857", "0.5963938", "0.5946163...
0.0
-1
Sets the poll_desc of this VoterDetail.
def poll_desc(self, poll_desc): if poll_desc is None: raise ValueError("Invalid value for `poll_desc`, must not be `None`") # noqa: E501 self._poll_desc = poll_desc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDescription(self, desc):\n return self.send('desc %s' % desc)", "def set_prog_desc(cls, prog_desc):\n cls.prog_desc = prog_desc", "def _set_description(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=unicode, is_leaf=Tru...
[ "0.56340474", "0.5616898", "0.55750257", "0.55750257", "0.55750257", "0.55750257", "0.5573412", "0.5573412", "0.5573412", "0.5573412", "0.5512914", "0.55074203", "0.5487654", "0.54544806", "0.54378515", "0.54378515", "0.5437332", "0.5437332", "0.5437005", "0.5437005", "0.5435...
0.79595625
0
Sets the poller_id of this VoterDetail.
def poller_id(self, poller_id): if poller_id is None: raise ValueError("Invalid value for `poller_id`, must not be `None`") # noqa: E501 self._poller_id = poller_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poller_nonce(self, poller_nonce):\n\n self._poller_nonce = poller_nonce", "def set_l2_policy_id(self, l2_policy_id):\n pass", "def setIdLote(self, id_lote):\r\n self.id_lote = id_lote", "def updater_id(self, updater_id):\n\n self._updater_id = updater_id", "def updater_id(se...
[ "0.611442", "0.5707244", "0.565067", "0.55194086", "0.55194086", "0.5330882", "0.5246371", "0.5238857", "0.5203366", "0.51910865", "0.51843804", "0.51843804", "0.51843804", "0.51843804", "0.515712", "0.5129918", "0.5078956", "0.5078956", "0.50475675", "0.50475675", "0.5030884...
0.6997387
0
Sets the status of this VoterDetail.
def status(self, status): if status is None: raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 self._status = status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_status(self, status):\r\n self.set_status_var(status)\r\n status = self.__pack_value(VpnTag.TAG_STATUS, status)\r\n self.vpn_line_update_re(self._re_dic[VpnTag.TAG_STATUS], status)", "def set_status(self, status):\n self.status = status\n self.save()", "def setPeerSta...
[ "0.71477115", "0.6919999", "0.6770513", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", "0.6763132", ...
0.62820697
43
Sets the create_time of this VoterDetail.
def create_time(self, create_time): self._create_time = create_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def creation_time(self, creation_time):\n\n self._creation_time = creation_time", "def created_time(self, created_time):\n\n self._created_time = created_time", "def created_time(self, created_time: float):\n\n self._created_time = created_time", "def creation_date_time(self, creation_da...
[ "0.7382015", "0.7230773", "0.70934737", "0.707694", "0.684134", "0.6804163", "0.6804163", "0.6804163", "0.6804163", "0.6724099", "0.6724099", "0.65543544", "0.61702645", "0.61702645", "0.6167726", "0.6167726", "0.6167726", "0.6167726", "0.6167726", "0.60572374", "0.5700534", ...
0.7756699
5
Sets the duration of this VoterDetail.
def duration(self, duration): self._duration = duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDuration(self, duration):\n self.duration = duration", "def set_duration(self, duration):\n \n self.duration = float(duration)", "def duration(self, duration: int):\n\n self._duration = duration", "def set_duration(self, duration):\n\n if duration > 0:\n s...
[ "0.7533008", "0.73502094", "0.7153015", "0.67948747", "0.6785757", "0.6547668", "0.64268047", "0.6300284", "0.6273842", "0.6214023", "0.6115951", "0.6045007", "0.6008204", "0.5739582", "0.56649816", "0.56330854", "0.5613898", "0.56094384", "0.55841124", "0.55318147", "0.55064...
0.7197115
9
Sets the wt_symmetric_agreement of this VoterDetail.
def wt_symmetric_agreement(self, wt_symmetric_agreement): self._wt_symmetric_agreement = wt_symmetric_agreement
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symmetric_agreement(self, symmetric_agreement):\n\n self._symmetric_agreement = symmetric_agreement", "def wt_agreement(self, wt_agreement):\n\n self._wt_agreement = wt_agreement", "def _set_strict_symmetric(self, use_strict_symmetric: bool):\n for quantizer in self._quant_ops_dict.val...
[ "0.7529027", "0.7002267", "0.54823035", "0.5332483", "0.472692", "0.46782526", "0.4672946", "0.46097445", "0.46050575", "0.4593596", "0.4544765", "0.44830087", "0.4467449", "0.44610497", "0.4424687", "0.44209534", "0.43813276", "0.43726748", "0.43435216", "0.43383434", "0.433...
0.9067306
0
Sets the num_poller_only of this VoterDetail.
def num_poller_only(self, num_poller_only): self._num_poller_only = num_poller_only
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_voter_only(self, num_voter_only):\n\n self._num_voter_only = num_voter_only", "def number_of_volunteers(self, number_of_volunteers):\n\n self._number_of_volunteers = number_of_volunteers", "def setNumWorkers(self, num):\n self.numWorkers = num", "def poller_nonce(self, poller_non...
[ "0.7612445", "0.55941105", "0.5368282", "0.5340975", "0.5316433", "0.5274176", "0.5240688", "0.51885074", "0.5167578", "0.5167578", "0.5138286", "0.513463", "0.51269674", "0.5118996", "0.49203655", "0.49127364", "0.49083084", "0.49083084", "0.48796913", "0.48427755", "0.48313...
0.8473206
0
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410411", "0.8391477", "0.8172175", "0.81410587", "0.80920255", "0.8088807", "0.80676955" ]
0.0
-1
Return zerofilled fast_weights tensor(s).
def zero_fast_weights(self, batch_size, dtype): state_size = self.state_size zeros = array_ops.zeros( array_ops.pack([batch_size, state_size, state_size]), dtype=dtype) zeros.set_shape([None, state_size, state_size]) return zeros
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_weights_tensor(self):\n return [self.hidden_layers[i].get_weight_tensor() for i in range(self.depth)] + \\\n [self.output_weight.clone()]", "def get_weights_tensor(self):\n return [self.hidden_layers[i].get_weight_tensor() for i in range(self.depth)] + \\\n [self...
[ "0.642478", "0.642478", "0.62758213", "0.61415136", "0.610445", "0.609471", "0.6001123", "0.5897798", "0.58892936", "0.58892936", "0.58766973", "0.58766973", "0.58766973", "0.5873746", "0.5835635", "0.5835635", "0.5796628", "0.57856315", "0.5771786", "0.57388914", "0.5733198"...
0.5889682
8
List of the modes currently being used.
def active_modes(self): for mode in self._active_modes: if mode not in self.modes: raise ValueError( f"{mode.name} is not in {self.name}.modes. " f"This likely happened because {self.name}.modes " f"was changed after {self.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_modes(self):\n return [x for x in self.active if x is not None]", "def get_modes(self):\n return self.model.get_modes()", "def modes(self):\n if self._modes is None:\n self.generate_modes()\n return self._modes", "def _modes(self):\n\t\treturn [mode for mode in ...
[ "0.86308634", "0.8489984", "0.84876376", "0.7862463", "0.7821777", "0.7677548", "0.7386334", "0.73726934", "0.73303246", "0.7287652", "0.72473747", "0.72306055", "0.7184089", "0.71655434", "0.7123363", "0.71216357", "0.70986724", "0.70834816", "0.70613056", "0.7036116", "0.69...
0.7631835
6
Returns a list of collapse operators corresponding to loss (decay/excitation) and dephasing of all modes.
def c_ops(self, modes=None, clean=True): if modes is None: modes = self.active_modes decay = [mode.decay for mode in modes] excitation = [mode.excitation for mode in modes] dephasing = [mode.dephasing for mode in modes] c_ops = decay + excitation + dephasing i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_modes():\n modes = []\n\n if FLAGS.psd:\n modes.append(\"psd\")\n if FLAGS.magnitude:\n modes.append(\"magnitude\")\n if FLAGS.angle:\n modes.append(\"angle\")\n if FLAGS.phase:\n modes.append(\"phase\")\n\n return modes", "def get_valid_modes():\n\n modes...
[ "0.60014796", "0.5778953", "0.57096124", "0.56853974", "0.565528", "0.56512", "0.5647006", "0.5594659", "0.55699116", "0.55415696", "0.55048454", "0.5411068", "0.54017085", "0.53986347", "0.538178", "0.5359517", "0.52558064", "0.5248712", "0.5196609", "0.5190427", "0.5148651"...
0.6207856
0
User.profile should return a valid object, created by the lambda statement in userprofile/models.py
def test_user_profile_exists_from_user(self): temp_user = User.objects.get(username='test_case_user') self.assertTrue(temp_user.profile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_can_see_its_profile(self):\n one_user = User.objects.first()\n self.assertIsNotNone(one_user.profile)", "def test_user_john_can_point_to_its_profile(self):\n john = User.objects.get(email='john@image.com')\n self.assertIsNotNone(john.profile)", "def test_user_nick_can_...
[ "0.72392493", "0.71059203", "0.6851303", "0.6831735", "0.66868156", "0.6651127", "0.662521", "0.662521", "0.6618127", "0.6596605", "0.6565665", "0.6530571", "0.6525602", "0.64584976", "0.6453244", "0.64518636", "0.64301485", "0.64289397", "0.63865525", "0.63863856", "0.638638...
0.6717453
4
Angular distance between two spherical coordinates
def distance_between_spherical_coordinates_rad(az1, ele1, az2, ele2): dist = np.sin(ele1) * np.sin(ele2) + np.cos(ele1) * np.cos(ele2) * np.cos(np.abs(az1 - az2)) # Making sure the dist values are in -1 to 1 range, else np.arccos kills the job dist = np.clip(dist, -1, 1) dist = np.arccos(dist) * 180 / n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angular_dist(p1, p2): # theta1, theta2, phi1, phi2):\n return np.arccos(p1['coszen'] * p2['coszen'] + p1['sinzen'] * p2['sinzen'] * np.cos(p1['az'] - p2['az']))", "def angular_distance(r1, d1, r2, d2):\n\n if np.isreal(r1):\n r1u = u.deg\n else:\n r1u = u.hourangle\n\n if np.isreal(...
[ "0.75226945", "0.7235058", "0.72068274", "0.70131344", "0.69502705", "0.6940119", "0.6802567", "0.66274613", "0.6621226", "0.6617638", "0.6580261", "0.6561756", "0.6538689", "0.6531765", "0.65297574", "0.6518747", "0.6502212", "0.6470494", "0.6462669", "0.64415276", "0.642698...
0.6501094
17
Retrieve the current process variable value.
def pv_get(self, pv_name, *args, **kwargs): epics_pv = EpicsPV(pv_name) return epics_pv.get(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_var_value(self):\n return self.var_holder[self.var_name]", "def variable(self):\n return self._var", "def _variable(self):\n return self._shared.cache.get('_Param__variable', None)", "def getVar(self):\n return self.var", "def get(self):\n return self.mtiVar.get...
[ "0.7288829", "0.709968", "0.7049068", "0.700137", "0.69380075", "0.6853636", "0.6763023", "0.67308265", "0.6719715", "0.66219276", "0.6607454", "0.6606247", "0.65652776", "0.65576726", "0.64823467", "0.64529186", "0.64458996", "0.6399555", "0.63360274", "0.62459093", "0.62157...
0.0
-1
Exposure time for the CCD in seconds.
def exposure_time(self): current_exposure = max(self.Cam1_AcquireTime, self.Cam1AcquirePeriod) return self.current_exposure
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exposure_time(self):\n return self.meta.get('exptime', 0.0) * u.s", "def exposure_time(self):\n return self.lfm.get(lf.AddIns.CameraSettings.ShutterTimingExposureTime)", "def exposure_time(self, ms):\n return self.lfm.set(lf.AddIns.CameraSettings.ShutterTimingExposureTime, ms)", "def...
[ "0.7568727", "0.7314796", "0.70999783", "0.70869344", "0.66013926", "0.62242836", "0.58693224", "0.58679307", "0.5861918", "0.58567566", "0.57975644", "0.5764249", "0.57595533", "0.57498664", "0.573875", "0.57380325", "0.57224905", "0.5707739", "0.56780654", "0.5669704", "0.5...
0.64615023
5
Find the area to search for players' health. Use average, gray image of video as input frame. Returns bounding points for P1 and P2
def find_health_areas(frame): res = cv2.matchTemplate(frame, TEMPLATE, cv2.TM_CCOEFF_NORMED) loc = np.where(res >= .7) y_top = mode(loc[0])[0][0] - int(TEMPLATE.shape[0]/2) y_bottom = y_top + int(3/2 * TEMPLATE.shape[0]) + 5 p1_x_right = loc[1].min() + 1 p1_x_left = p1_x_right - 150 p2_x_ri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_health_area(frame):\n P1_health = frame[y_top:y_bottom, p1_x_left:p1_x_right]\n P2_health = frame[y_top:y_bottom, p2_x_left:p2_x_right]\n\n return P1_health, P2_health", "def find_area_of_interest(frame):\n hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)\n\n lower_red = np.array([110, 60,...
[ "0.7338965", "0.63859004", "0.61023843", "0.58878183", "0.58123547", "0.56988204", "0.5663642", "0.5651813", "0.55927044", "0.55894023", "0.55757433", "0.55592966", "0.55029756", "0.5472412", "0.54595464", "0.5453557", "0.54516214", "0.54470015", "0.5440544", "0.5392054", "0....
0.6698973
1
Returns a matrix of [num_nodes num_leaves], where the leaves are ordered from 1 to 200 (0 to 199, in c index).
def get_bird_ancestor_matrix(graph = None): if graph is None: graph = get_bird_taxonomy() node_id_map = dict((n,i) for i,n in enumerate(graph.nodes())) leaves = [n for n in graph.nodes() if len(graph.successors(n)) == 0] mat = np.zeros((len(graph.nodes()), len(leaves))) for leaf in leaves: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _count_leaves(self):\n leaves = np.ones(self.nodes, dtype=int)\n ts = (~self.terminal).nonzero()[0]\n for t in ts[::-1]:\n leaves[t] = leaves[self.children[t, 0]] + leaves[self.children[t, 1]]\n return leaves", "def gen_leaves(self):\r\n return map(node_from_sing...
[ "0.6802174", "0.6715408", "0.6098833", "0.6085137", "0.60671836", "0.59708846", "0.59632385", "0.58980167", "0.58857673", "0.5799063", "0.57963705", "0.578789", "0.5667354", "0.56494194", "0.56427366", "0.55823207", "0.5581939", "0.5575271", "0.5551321", "0.5550257", "0.55498...
0.54057944
26
When RepeatingArea is inside an Area, Area root is inherited.
def test_area_with_repeating_area(test_page): test_page.navigate() listings = test_page.area_repeating_area.it_repeats.areas assert listings[0].link.text == "Repeating Link 1" assert listings[1].link.text == "Repeating Link 2"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def propagateAreaOnly(self, node, config, diff):\n parent = node\n while parent is not None:\n parent.area -= float(diff)\n parent = parent.parent", "def area(self):\n pass", "def fill_areas(self):\n return super().lake_areas", "def find_area(self):\n pass", "...
[ "0.5558279", "0.5514069", "0.5349143", "0.52222604", "0.5186919", "0.5134407", "0.5134407", "0.5134407", "0.5134407", "0.5134407", "0.5134317", "0.5132732", "0.5119354", "0.5112434", "0.5109714", "0.5085396", "0.50617915", "0.5013212", "0.50026006", "0.4994997", "0.4988889", ...
0.0
-1
Convert data into array
def toSerializable(self): arr = [] for val in self.employees.values(): tempArr = [] tempArr.append(str(val.employeeNumber)) tempArr.append(str(val.lastName)) tempArr.append(str(val.firstName)) tempArr.append(str(val.position)) tempA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toarray(self):\n\n pass", "def to_array(self):\n pass", "def _get_data(self): \r\n return [list(row) for row in self._data]", "def _prepare_data(data):\n if isinstance(data, list):\n data = np.array(data)\n\n if len(data.shape) > 2:\n raise ValueEr...
[ "0.7421356", "0.730399", "0.72202736", "0.7038047", "0.70255697", "0.69322723", "0.68436193", "0.6823557", "0.6783626", "0.6783626", "0.67793065", "0.6770062", "0.67498624", "0.6710089", "0.6691421", "0.6691421", "0.6639489", "0.6623893", "0.66224504", "0.6578371", "0.6548736...
0.0
-1
Returns a dataset to use with tests (INTERNAL USE FOR UNIT TESTING)
def test_data(mask=np.zeros((3, 3), dtype=bool)): shape = np.shape(mask) data = np.reshape(np.arange(np.product(shape)), shape).astype("float") data[mask] = np.nan return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_test_dataset(self):\n return self.test_dataset", "def _get_dataset(self, i, i_end, test=False):\n if test:\n # Get training dataset\n dataset = self._generate_dataset(\n self.input_test_data,\n self.output_test_data,\n i, i_...
[ "0.823699", "0.7510004", "0.73943037", "0.7266358", "0.7129927", "0.7123001", "0.7069036", "0.7059581", "0.70104086", "0.700076", "0.6981411", "0.6936024", "0.68849635", "0.688317", "0.6874182", "0.68550605", "0.68467295", "0.6833877", "0.6803537", "0.6797335", "0.6790966", ...
0.0
-1
Return a list of actions that are legal on this state.
def legal_actions(self): if self.player == -2: # is terminal return [] elif self.player == -1: # is chance if self.phase == 0: # private hands chance return [Action([i, j]) for i in range(3) for j in range(3)] else: # public hands chance ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_legal_actions(self, state):\n return self.action_fn(state)", "def getLegalActions(self,state):\n return self.actionFn(state)", "def legal_actions(self):\n return self._tableaux[self._acting_player].legal_actions()", "def get_legal_actions(self):\n return self.round.get_legal_a...
[ "0.8422326", "0.83225226", "0.8234767", "0.8212543", "0.8091071", "0.8064431", "0.78916687", "0.77534974", "0.774597", "0.7705504", "0.75608414", "0.755463", "0.75240844", "0.7505978", "0.74940926", "0.74651706", "0.7430703", "0.7372154", "0.7372154", "0.73550797", "0.7349185...
0.7672706
10
Return a string representing this world state.
def to_string(self): return '[%s, %s, %s], [%d, %d], %d' % \ (WorldState.__hand_dict[self.hand[0]], WorldState.__hand_dict[self.hand[1]], WorldState.__hand_dict[self.pub], self.bet[0], self.bet[1], self.player)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\r\n return str(self)", "def __str__(self):\n s = \"\"\n for r in range(1,4):\n for c in range(1,4):\n s += self.gameState[r,c]\n return s", "def __str__(self) -> str:\n return str(self.current_state)", "def __str__(self):\n ...
[ "0.7430301", "0.7382947", "0.73487633", "0.73368543", "0.7049552", "0.7047356", "0.70163655", "0.69931847", "0.6990329", "0.69133013", "0.6895304", "0.6790483", "0.6777644", "0.67587006", "0.67347634", "0.67347634", "0.67347634", "0.67347634", "0.67347634", "0.67347634", "0.6...
0.7208681
4
Return a string representing this action.
def to_string(self): if self.player != -1: # is not chance return Action.__act_dict[self.encode] else: # is chance if isinstance(self.encode, list): return ', '.join(Action.__hand_dict[x] for x in self.encode) else: return Action.__h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return \"Action\" + super().__str__()", "def action(self) -> str:\n return self._action", "def __dump__(self):\n out_str = \"Action: \" + str(self) + \"\\n\"\n out_str += \"Pre: \" + \\\n \" \".join([\"(\"+str(f)+\")\" for f in self.preconditions]...
[ "0.846463", "0.78125656", "0.7712663", "0.7657577", "0.7657577", "0.7657577", "0.7657577", "0.7657577", "0.7657577", "0.7657577", "0.7657577", "0.7657577", "0.7654012", "0.7619954", "0.7577611", "0.7422844", "0.72609437", "0.71629757", "0.6948742", "0.6944645", "0.69342214", ...
0.6725174
62
Return a string representing this private observation.
def to_string(self): return PrivateObservation.__hand_dict[self.encode]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toString(self):\n return self.__str__()", "def __str__(self):\n return self.__s", "def __str__(self):\n return self.to_StringIO().getvalue()", "def __repr__ (self):\n return self.to_str()", "def __repr__( self ):\n\n return struct.pack('I', self.issueDate) + self.iden...
[ "0.71759075", "0.7128465", "0.710366", "0.70707697", "0.7068446", "0.70475703", "0.70448", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "0.7038035", "...
0.78825784
0
Return a string representing this public observation.
def to_string(self): return '[%s], %s' % (', '.join(str(x)for x in self.bet), PublicObservation.__hand_dict[self.pub])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_string(self):\n\n return PrivateObservation.__hand_dict[self.encode]", "def __str__(self):\n return self.to_StringIO().getvalue()", "def toString(self):\n return self.__str__()", "def to_string(self):\r\n return self.__str__()", "def __str__(self):\n return str(sel...
[ "0.77024144", "0.7228931", "0.7169374", "0.71321154", "0.7097717", "0.7077966", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", "0.7041585", ...
0.0
-1
Take out some punctiation and convert string to lowecase
def normalize_string(in_string): # Check for valid input type if not isinstance(in_string, str): raise TypeError('Function expect a str type') # Make lower in_string = LanguageUtils.unicode_2_ascii(in_string.lower().strip()) # Trim punctiation in_string = re....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalizeString(sentence):\r\n #s = unicodeToAscii(sentence)\r\n s = re.sub(r'([\\.|!|?|\"])+', r\" \\1\", sentence)\r\n s = re.sub(r\"[^a-zA-Z!?]+\", r\" \", s)\r\n return s", "def normalization(text):\n\n accepted_alphabet = [char for char in string.ascii_lowercase] + [\" \"]\n\n # conver...
[ "0.7047908", "0.69564456", "0.6911873", "0.6874664", "0.6840668", "0.68365437", "0.6818641", "0.68138236", "0.67835957", "0.6783278", "0.6776221", "0.674473", "0.6743512", "0.67415035", "0.6717926", "0.66980255", "0.6692322", "0.6685723", "0.6651599", "0.6645636", "0.66173494...
0.6993553
1
Delete the specified visual style from current session.
def delete_visual_style(style_name, base_url=DEFAULT_BASE_URL): res = commands.cyrest_delete('styles/' + style_name, base_url=base_url, require_json=False) return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RemoveStyle(*args, **kwargs):\n return _richtext.TextAttrDimensions_RemoveStyle(*args, **kwargs)", "def RemoveStyle(*args, **kwargs):\n return _richtext.RichTextAttr_RemoveStyle(*args, **kwargs)", "def RemoveStyle(*args, **kwargs):\n return _richtext.TextBoxAttr_RemoveStyle(*args, **kw...
[ "0.6426395", "0.63248014", "0.62615645", "0.59310067", "0.59295195", "0.5784656", "0.5731771", "0.56956583", "0.5572123", "0.55289644", "0.53239167", "0.5252527", "0.50877947", "0.5081445", "0.5067149", "0.5066763", "0.5053143", "0.5036548", "0.49683943", "0.4952457", "0.4944...
0.79847854
0
Get Arrow Shapes. Retrieve the names of the currently supported 'arrows' the decorations can (optionally) appear at the ends of edges, adjacent to the nodes they connect, and conveying information about the nature of the nodes' relationship.
def get_arrow_shapes(base_url=DEFAULT_BASE_URL): res = commands.cyrest_get('styles/visualproperties/EDGE_TARGET_ARROW_SHAPE/values', base_url=base_url) return res['values']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arrows(self):\n Q = self._quiver\n return tuple(self.element_class(self, e[0],e[1], [i]) for i,e in enumerate(self._sorted_edges))", "def get_paths(\n self,\n x1: npt.ArrayLike,\n y1: npt.ArrayLike,\n x2: npt.ArrayLike,\n y2: npt.ArrayLike,\n panel_para...
[ "0.63372576", "0.6094558", "0.5927307", "0.58032835", "0.5617588", "0.5482347", "0.54355496", "0.5378991", "0.535317", "0.5343458", "0.5310065", "0.5234028", "0.5205818", "0.52038723", "0.5130524", "0.5123537", "0.51198095", "0.50776887", "0.5077325", "0.50501525", "0.5035634...
0.78283405
0
Get Line Styles. Retrieve the names of the currently supported line types values which can be used to render edges, and thus can be used in calls to ``set_edge_line_style_rule()``.
def get_line_styles(base_url=DEFAULT_BASE_URL): res = commands.cyrest_get('styles/visualproperties/EDGE_LINE_TYPE/values', base_url=base_url) return res['values']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_axisline_style(self):\n return self._axisline_style", "def get_line_styles(colors=None, linestyles=None, markers=None):\n colors = get_colors(color_palette=colors)\n\n if linestyles is None:\n linestyles = itertools.cycle(('',))\n elif linestyles == 'Automatic':\n linestyles...
[ "0.682672", "0.6806232", "0.65393424", "0.587401", "0.57905823", "0.5741274", "0.5714613", "0.5700588", "0.5700588", "0.5617904", "0.56103307", "0.5561218", "0.5523006", "0.55088395", "0.5473061", "0.54548883", "0.54313284", "0.5409194", "0.53894466", "0.5298439", "0.5296843"...
0.79496926
0
Get Node Shapes. Retrieve the names of the currently supported node shapes, which can then be used in calls to ``set_node_shape_rule()`` and ``set_default_viz_map_value()``.
def get_node_shapes(base_url=DEFAULT_BASE_URL): res = commands.cyrest_get('styles/visualproperties/NODE_SHAPE/values', base_url=base_url) return res['values']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_shapes(self) -> list:\n return self.list_of_shapes", "def GetShapes(self, *args):\n return self.send({\"cmd\": \"GetShapes\", \"args\": args})", "def shapes(self):\n # Todo: Cache?\n if self._shapes:\n return self._shapes\n # Group together by shape_id\n self.log(\"Genera...
[ "0.68215734", "0.64961576", "0.6380106", "0.61700016", "0.614099", "0.60357237", "0.5969919", "0.59384567", "0.5922126", "0.58439004", "0.58439004", "0.58340126", "0.57861465", "0.57725006", "0.5732601", "0.57128036", "0.5693288", "0.5691382", "0.5672595", "0.56405675", "0.56...
0.7678983
0
Config eager context according to flag values using TF 2.0 API.
def set_config_v2(enable_xla=False): if enable_xla: tf.config.optimizer.set_jit(True) # Disable PinToHostOptimizer in grappler when enabling XLA because it # causes OOM and performance regression. tf.config.optimizer.set_experimental_options( {'pin_to_host_optimization': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tf_function_mode_context(tf_function_mode):\n if tf_function_mode not in ['enabled', 'disabled']:\n raise ValueError(\n 'Only allowable values for tf_function_mode_context are `enabled` and '\n '`disabled`; but got `{}`'.format(tf_function_mode))\n original_mode = def_function.RUN_FUNCTIONS...
[ "0.58676594", "0.58347034", "0.55352896", "0.55292374", "0.55292374", "0.54728496", "0.5426858", "0.5416035", "0.54104346", "0.5407949", "0.54025996", "0.53845245", "0.5344806", "0.53248334", "0.53173333", "0.52775306", "0.52621514", "0.52619225", "0.5252439", "0.5190725", "0...
0.6186168
0
Test fixture for overriding the login_required token dependency This allows us to more easily test the logic of the routes, without being tripped up by the authentication constantly.
def token_fixture(request): app.dependency_overrides[login_required] = login_required_override def teardown(): app.dependency_overrides = {} request.addfinalizer(teardown)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_token_based_login(self):\n response = self.client.get(\n reverse('token_login', args=[self.token]),\n # Needed in order to follow redirections:\n follow=True\n )\n\n self.assertEqual(\n response.templates[0].name,\n 'billing/subsc...
[ "0.6601057", "0.6553223", "0.6465814", "0.63552815", "0.6327875", "0.6313625", "0.6311249", "0.6309358", "0.6245814", "0.6217313", "0.6206958", "0.61700994", "0.6149706", "0.6149706", "0.6140156", "0.6134559", "0.6106628", "0.60908884", "0.60838234", "0.6047999", "0.6039562",...
0.8030638
0
This is the constructor s1 = Set() = empty set s2 = Set([1,2,2,3]) = With initial values
def __init__(self,values=None): self.dict = {} #Cada instância tem seu próprio dicionário if values is not None: for value in values: self.add(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.s = set()", "def __init__(self):\n self.sett = set()", "def __init__(self):\n self.setlist = set()", "def __init__(self):\n self.magic_set = set()", "def sets():\n # Will do this later, low priority\n raise NotImplementedError(\"'sets' hasn't bee...
[ "0.7458598", "0.70998037", "0.7055181", "0.6631811", "0.6588992", "0.6582386", "0.6542255", "0.6513613", "0.64875185", "0.6485295", "0.6398165", "0.636226", "0.63613456", "0.6351041", "0.627965", "0.622778", "0.61894727", "0.617446", "0.61592484", "0.6144716", "0.6130701", ...
0.0
-1
Helper function for getting experiment parameters with a basic check to see if a specific setting is valid.
def get(self, setting): if self.experiment.Exists(setting): value = self.experiment.GetValue(setting) else: value = [] print('Invalid setting: {}'.format(setting)) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_params():\n\n if not params['EXPERIMENT_NAME']:\n s = \"scripts.run_experiments.check_params\\n\" \\\n \"Error: Experiment Name not specified.\\n\" \\\n \" Please specify a name for this set of runs.\"\n raise Exception(s)\n\n if params['RUNS'] == 1:\n ...
[ "0.69255155", "0.61172384", "0.6092533", "0.6057393", "0.6054693", "0.6030872", "0.59956056", "0.5986893", "0.59549093", "0.5954192", "0.5929892", "0.5928896", "0.58629733", "0.5845055", "0.5844265", "0.58324456", "0.5827829", "0.5821667", "0.58201814", "0.5801076", "0.577314...
0.52933407
90
Returns the center wavelength in nanometers.
def center_wavelength(self): return self.lfm.get(lf.AddIns.SpectrometerSettings.GratingCenterWavelength)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_wavelength(self, nanometers):\n # this avoids bug where if step and glue is selected, doesn't allow setting center wavelength\n self.lfm.set(lf.AddIns.ExperimentSettings.StepAndGlueEnabled, False)\n\n return self.lfm.set(lf.AddIns.SpectrometerSettings.GratingCenterWavelength, nanome...
[ "0.7831684", "0.64872855", "0.63426715", "0.6321252", "0.62414557", "0.62146574", "0.618426", "0.61698914", "0.6113547", "0.6073234", "0.60203487", "0.6006419", "0.5997773", "0.5983516", "0.5910391", "0.58729476", "0.5861574", "0.5860935", "0.5843107", "0.5836793", "0.5832765...
0.79008675
0
Returns the current grating.
def grating(self): return self.lfm.get(lf.AddIns.SpectrometerSettings.GratingSelected)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grating_position(self):\n return self.get('grating_current_position')", "def get_grossing(self):\n return self.grossing", "def getG(self):\n return self.g", "def grating(self, grating):\n # TODO: figure out the format for setting this\n\n print('figure out the format fo...
[ "0.70692784", "0.70648086", "0.68990064", "0.68621", "0.67139304", "0.6519473", "0.6298488", "0.62909865", "0.62828296", "0.61380374", "0.61072177", "0.607971", "0.60037345", "0.5980741", "0.5956547", "0.589242", "0.5871579", "0.58702576", "0.58461666", "0.58451295", "0.58329...
0.7650533
0
Returns the number of frames taken during the acquisition.
def num_frames(self): return self.lfm.get(lf.AddIns.ExperimentSettings.FrameSettingsFramesToStore)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frame_count(self):\n if self.auto_resume: self.resume()\n return self.current_frame_count", "def get_nframes(self):\n return len(self._frames)/self._sampwidth", "def get_frame_count(self):\n\n return int(cv.GetCaptureProperty(self.capture,\n ...
[ "0.79807967", "0.7694589", "0.7632926", "0.76106817", "0.7533619", "0.751899", "0.7441764", "0.7389269", "0.73274016", "0.7292273", "0.7283246", "0.72342086", "0.7117307", "0.70935327", "0.6950485", "0.6808161", "0.67733186", "0.67671114", "0.6689131", "0.667903", "0.6672918"...
0.63774204
38
Sets the single frame exposure time to be ms (in milliseconds).
def exposure_time(self, ms): return self.lfm.set(lf.AddIns.CameraSettings.ShutterTimingExposureTime, ms)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_exposure_time(self, exposure_time):\n\n if exposure_time <= 4e-3:\n time = int(exposure_time * 1e9)\n timebase = 'ns'\n\n elif exposure_time <= 4:\n time = int(exposure_time * 1e6)\n timebase = 'us'\n\n elif exposure_time > 4:\n ti...
[ "0.7264727", "0.64461756", "0.63800126", "0.6324597", "0.6132828", "0.6091061", "0.60859776", "0.60827667", "0.6071861", "0.59096646", "0.5907509", "0.5900727", "0.58951634", "0.5882399", "0.5837948", "0.5834889", "0.5818813", "0.5817204", "0.5807463", "0.578161", "0.57700914...
0.75066173
0
Returns the current sensor temperature (in degrees Celsius).
def sensor_temperature(self): return self.lfm.get(lf.AddIns.CameraSettings.SensorTemperatureReading)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_temperature(self):\n return self.device.temperature.value", "def current_temperature(self):\n return self._device_data[\"temperature\"]", "def temperature(self) -> float:\n return self._temperature", "def current_temperature(self) -> float | None:\n return self._device...
[ "0.8559314", "0.8514346", "0.8470708", "0.8463273", "0.8431941", "0.8431353", "0.84064585", "0.8384858", "0.8376945", "0.83373827", "0.8307328", "0.8307328", "0.8290537", "0.8290537", "0.8290537", "0.8286742", "0.8264053", "0.82328147", "0.82217443", "0.82157487", "0.82157487...
0.80712765
35
Returns the sensor setpoint temperature (in degrees Celsius).
def sensor_setpoint(self): return self.lfm.get(lf.AddIns.CameraSettings.SensorTemperatureSetPoint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def temperature(self) -> float:\n return self._temperature", "def target_temperature(self):\n temp_status = self._driver.query_temp_status(self._handle)\n return temp_status['ccd_set_point']", "async def get_temperature_setpoint(self) -> float | None:\n reply = await self._send_comm...
[ "0.7846705", "0.7831244", "0.7815699", "0.7807143", "0.7807143", "0.7759743", "0.7749041", "0.7726005", "0.77226484", "0.76826936", "0.76465046", "0.7645272", "0.7629514", "0.7578729", "0.75742716", "0.7530229", "0.7523466", "0.7516044", "0.7491009", "0.74908996", "0.74858147...
0.7748091
7
This is called after the server rejects our authorization from this object. Should return True if this believes the problem has been resolved and False otherwise.
def try_recover_auth_failure(self): raise NotImplementedError # pragma: no cover
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_recover_auth_failure(self):\r\n return False", "def reject(self):\n self.rejected = True", "def is_rejected(self):\n return self._state == \"rejected\"", "def complete(self) -> bool:\n\n # TODO: Figure out what these error conditions are.\n if (\n False\n...
[ "0.67734784", "0.67327845", "0.64923596", "0.6319535", "0.62722886", "0.625042", "0.6210822", "0.62052995", "0.61617655", "0.61530393", "0.6135164", "0.6132551", "0.61043674", "0.6095318", "0.6047422", "0.60360557", "0.6007442", "0.59226704", "0.5900258", "0.5845831", "0.5833...
0.6011484
16
Returns a deep copy of this instance with all the state removed. For example, a JWT strategy would return a new instance with no JWT token initialized.
def copy_and_strip_state(self): raise NotImplementedError # pragma: no cover
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getstate__(self):\n d = copy.copy(self.__dict__)\n del d[\"__logger\"]\n del d[\"__proof\"]\n del d[\"log\"]\n del d[\"lock\"]\n return d", "def __getstate__(self):\r\n state = self.__dict__.copy()\r\n if \"_logger\" in state:\r\n del state...
[ "0.72136104", "0.7068774", "0.70538855", "0.70367056", "0.7015409", "0.6903349", "0.6880746", "0.67030776", "0.6619586", "0.6616911", "0.6577996", "0.65430284", "0.6529513", "0.65175587", "0.650581", "0.64871633", "0.6485806", "0.6478668", "0.64721775", "0.6470307", "0.646643...
0.62743574
46
If this has an active token it will be cleared and this will return True. Otherwise this will return False.
def try_recover_auth_failure(self): if self._token is not None: self._forcing_refresh = self._token.token self._token = None return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_still_valid(self) -> bool:\n if not self._token or not self._token_expires_at:\n return False\n return datetime.now() < (self._token_expires_at - timedelta(seconds=60))", "def invalidate(self):\n if super(Auth, self).invalidate():\n self.access_info = None\n ...
[ "0.7131733", "0.71195596", "0.68968713", "0.67017454", "0.66742647", "0.666571", "0.66578287", "0.66068226", "0.6553236", "0.65034026", "0.6469237", "0.6426726", "0.640806", "0.63963234", "0.6331866", "0.63036495", "0.6263993", "0.62513673", "0.62513673", "0.6238658", "0.6198...
0.5773617
75
Takes two dictionaries. Add values in dict2 to the values in dict1, if present. If not present, create a new value in dict1 equal to the value in dict2. Addition is done inplace if the values are arraylike, to avoid data copying. Units are handled if the values are DataArrays with a 'units' attribute.
def update_dict_by_adding_another(dict1, dict2): for key in dict2.keys(): if key not in dict1: if hasattr(dict2[key], 'copy'): dict1[key] = dict2[key].copy() else: dict1[key] = dict2[key] else: if (isinstance(dict1[key], DataArray) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_dict(dict1, dict2):\n\n for key in dict2:\n if key not in dict1:\n dict1[key] = dict2[key]\n else:\n if not hasattr(dict1[key], \"__iter__\"):\n if not hasattr(dict2[key], \"__iter__\"):\n if dict1[key] != dict2[key]:\n ...
[ "0.75407344", "0.74083626", "0.7338569", "0.7284676", "0.7130483", "0.70566905", "0.6997618", "0.6994202", "0.69787693", "0.6970447", "0.6970447", "0.6921232", "0.6886778", "0.6861785", "0.6861785", "0.6861785", "0.6861785", "0.6861785", "0.6861785", "0.6861785", "0.6846779",...
0.8876404
0
Raises SharedKeyError if there exists a key present in both dictionaries.
def ensure_no_shared_keys(dict1, dict2): shared_keys = set(dict1.keys()).intersection(dict2.keys()) if len(shared_keys) > 0: raise SharedKeyError( 'unexpected shared keys: {}'.format(shared_keys))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersect(self, other):\n res = myDict()\n kSet = set(self.keys()) & set(other.keys())\n kList = list(kSet)\n if ( not myUtil.emptyItem(kList) ):\n for k in kList:\n res[k] = self[k]\n print('flag:0')\n return res\n else:\n ...
[ "0.6451594", "0.61149555", "0.61092556", "0.60356665", "0.602848", "0.5930624", "0.58764476", "0.5859169", "0.5774825", "0.5757288", "0.572422", "0.56461287", "0.5639073", "0.5638929", "0.5629269", "0.56282765", "0.55923784", "0.55602735", "0.5545036", "0.5520151", "0.5516772...
0.8045566
0
Takes in a DataArray, a desired ordering of output directions, and a dictionary mapping those directions to a list of names corresponding to those directions. Returns a list with the same ordering as out_dims that contains slices for out_dims that have corresponding names (as many slices as names, and spanning the enti...
def get_slices_and_placeholder_nones(data_array, out_dims, direction_to_names): slices_or_none = [] for direction in out_dims: if len(direction_to_names[direction]) == 0: slices_or_none.append(None) elif (direction != '*') and (len(direction_to_names[direction]) > 1): rai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_final_shape(data_array, out_dims, direction_to_names):\n final_shape = []\n for direction in out_dims:\n if len(direction_to_names[direction]) == 0:\n final_shape.append(1)\n else:\n # determine shape once dimensions for direction (usually '*') are combined\n ...
[ "0.61994725", "0.6136627", "0.568289", "0.5369917", "0.50631684", "0.49137333", "0.4802379", "0.47601232", "0.47314778", "0.47157085", "0.4676999", "0.45623407", "0.45250225", "0.4503204", "0.4503204", "0.44955683", "0.44317272", "0.44317272", "0.44234708", "0.4422595", "0.44...
0.68726104
0
Build TF Estimator for problem type.
def build_estimator(metadata, batch_size, optimizer, project_dir, model_version, feature_columns, label_col, num_layers, num_nodes, dropout): # Retrieve from metadata parameters to contruct Estimator hidden_units = [num_nodes for i in range(num_layers)] activation_name = metadata['_ml']['ffnn']['activation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_estimator(model_dir, model_type, dnn_learning_rate, linear_learning_rate):\n\twide_columns, deep_columns = build_model_columns()\n\t# hidden_units = [100, 75, 50, 25]\n\t# hidden_units = [200, 120, 80, 20]\n\t# hidden_units = [150, 100, 50, 10] # 0.31, 0.48\n\thidden_units = [150, 100, 50, 10]\n\t# hidde...
[ "0.6833554", "0.665076", "0.65859765", "0.6225031", "0.6208677", "0.6179837", "0.6072761", "0.6039301", "0.6039113", "0.58873045", "0.588056", "0.58772147", "0.58442587", "0.57864684", "0.5786088", "0.5769836", "0.5764785", "0.57640964", "0.57558864", "0.57314444", "0.5728789...
0.62944996
3
Create a base class with a metaclass from six.
def with_metaclass(meta, *bases): class metaclass(type): def __new__(cls, name, this_bases, d): return meta(name, bases, d) @classmethod def __prepare__(cls, name, this_bases): return meta.__prepare__(name, bases) return type.__new__(metaclass, 'temporary_class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_metaclass(meta, *bases):\r\n return meta(\"NewBase\", bases, {})", "def with_metaclass(meta, *bases):\n return meta(\"NewBase\", bases, {})", "def with_metaclass(meta, *bases):\n return meta(\"NewBase\", bases, {})", "def with_metaclass(meta, *bases):\n class MetaClass(meta):\n de...
[ "0.7725903", "0.77081245", "0.77081245", "0.7275822", "0.713633", "0.70295066", "0.70295066", "0.7009396", "0.69838667", "0.6377865", "0.63772005", "0.63693494", "0.6363052", "0.62393737", "0.62355405", "0.6186199", "0.61790437", "0.61790437", "0.61790437", "0.61790437", "0.6...
0.6980405
9
Instanstiate class variables with the ad's response data.
def __init__(self, curr_file): self.curr_file = curr_file self.df = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._responses = {}", "def __init__(self, responses):\n self._responses = responses", "def __init__(self, response, request):\n self.request = request\n # Log and print any errors\n if 'error' in response:\n self.error = response['error']\n ...
[ "0.59110886", "0.5814628", "0.5812679", "0.57297045", "0.5703957", "0.5688066", "0.5672104", "0.5668101", "0.5657901", "0.5654607", "0.56378794", "0.56367785", "0.5633153", "0.56296015", "0.55986863", "0.55896306", "0.5576279", "0.5566056", "0.55653214", "0.5563207", "0.55500...
0.0
-1