query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Specifies the contact's government ID number
def government_id_number(self) -> str: return self._government_id_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def government_id_number(self, government_id_number: str):\n self._government_id_number = government_id_number", "def contact_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"contact_id\")", "def contact_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"contact_id\")", ...
[ "0.77877307", "0.6354007", "0.6354007", "0.6261402", "0.6118388", "0.6038678", "0.5938257", "0.5913594", "0.5821839", "0.55990064", "0.55266696", "0.55261844", "0.5498319", "0.5392356", "0.5386342", "0.5367252", "0.53192645", "0.53073066", "0.53036314", "0.5297503", "0.526791...
0.7688309
1
Specifies the contact's government ID number
def government_id_number(self, government_id_number: str): self._government_id_number = government_id_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def government_id_number(self) -> str:\n return self._government_id_number", "def contact_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"contact_id\")", "def contact_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"contact_id\")", "def organizational_id_number(self,...
[ "0.7688309", "0.6354007", "0.6354007", "0.6261402", "0.6118388", "0.6038678", "0.5938257", "0.5913594", "0.5821839", "0.55990064", "0.55266696", "0.55261844", "0.5498319", "0.5392356", "0.5386342", "0.5367252", "0.53192645", "0.53073066", "0.53036314", "0.5297503", "0.5267916...
0.77877307
0
Specifies the contact's business web page URL
def business_home_page(self, business_home_page: str): self._business_home_page = business_home_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _url(self):\n return 'contact/{email}'.format(email=self.email)", "def business_home_page(self) -> str:\n return self._business_home_page", "def url (self):\n return Links.createURL('/')", "def barbican_url(self):", "def landing_page_url(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.6456638", "0.6090789", "0.6078492", "0.6000126", "0.59787095", "0.59209794", "0.58748525", "0.58748525", "0.58084023", "0.5792123", "0.57297087", "0.57169163", "0.56839246", "0.56722087", "0.5671057", "0.5658872", "0.5657553", "0.5645389", "0.56423986", "0.56302845", "0.56...
0.6180694
1
Specifies the contact's File Transfer Protocol (FTP) URL
def ftp_site(self, ftp_site: str): self._ftp_site = ftp_site
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_protocol(self):\n return \"sftp://\"", "def ftp():\n pass", "def protocol(self):\n\n if '://' in self.host:\n scheme, host = self.host.split('://', 1)\n return scheme\n elif self.port == 21:\n return 'ftp'\n elif self.port == 22:\n ...
[ "0.61957145", "0.6156766", "0.6008023", "0.57468057", "0.57359153", "0.5698886", "0.56638473", "0.5656666", "0.5645434", "0.546781", "0.5433041", "0.53679264", "0.5367419", "0.53547007", "0.5312902", "0.52291244", "0.52108103", "0.52008533", "0.51732326", "0.5154058", "0.5102...
0.6306402
0
Specifies the name of the network to which the contact's computer is connected
def computer_network_name(self) -> str: return self._computer_network_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computer_network_name(self, computer_network_name: str):\n self._computer_network_name = computer_network_name", "def network(self) -> str:\n return pulumi.get(self, \"network\")", "def get_network_name(options):\n user = pwd.getpwuid(os.getuid())[0]\n return \"%s-%s\" %(user, options.n...
[ "0.7124838", "0.6727182", "0.64578766", "0.63918626", "0.6336688", "0.6311588", "0.61451286", "0.60744065", "0.60626036", "0.6039126", "0.6037726", "0.60156816", "0.59806293", "0.59659994", "0.591546", "0.58182627", "0.5805953", "0.57888305", "0.57413775", "0.5725409", "0.569...
0.6736596
1
Specifies the name of the network to which the contact's computer is connected
def computer_network_name(self, computer_network_name: str): self._computer_network_name = computer_network_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computer_network_name(self) -> str:\n return self._computer_network_name", "def network(self) -> str:\n return pulumi.get(self, \"network\")", "def get_network_name(options):\n user = pwd.getpwuid(os.getuid())[0]\n return \"%s-%s\" %(user, options.name)", "def network_name(self, **kwa...
[ "0.6736596", "0.6727182", "0.64578766", "0.63918626", "0.6336688", "0.6311588", "0.61451286", "0.60744065", "0.60626036", "0.6039126", "0.6037726", "0.60156816", "0.59806293", "0.59659994", "0.591546", "0.58182627", "0.5805953", "0.57888305", "0.57413775", "0.5725409", "0.569...
0.7124838
0
Specifies the name of the person who referred this contact to the user
def referred_by_name(self) -> str: return self._referred_by_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def referred_by_name(self, referred_by_name: str):\n self._referred_by_name = referred_by_name", "def contact_name(self, contact_name):\n\n self._contact_name = contact_name", "def contact_name(self, contact_name):\n\n self._contact_name = contact_name", "def contact_name(self) -> str:\n...
[ "0.7200471", "0.6497306", "0.6497306", "0.6457569", "0.64176023", "0.64176023", "0.6067239", "0.6059863", "0.6059489", "0.6014014", "0.6014014", "0.5941914", "0.593597", "0.59257215", "0.59172523", "0.58922374", "0.58837634", "0.58797264", "0.58795655", "0.5878992", "0.584348...
0.6981937
1
Specifies the name of the person who referred this contact to the user
def referred_by_name(self, referred_by_name: str): self._referred_by_name = referred_by_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def referred_by_name(self) -> str:\n return self._referred_by_name", "def contact_name(self, contact_name):\n\n self._contact_name = contact_name", "def contact_name(self, contact_name):\n\n self._contact_name = contact_name", "def contact_name(self) -> str:\n return pulumi.get(se...
[ "0.6981937", "0.6497306", "0.6497306", "0.6457569", "0.64176023", "0.64176023", "0.6067239", "0.6059863", "0.6059489", "0.6014014", "0.6014014", "0.5941914", "0.593597", "0.59257215", "0.59172523", "0.58922374", "0.58837634", "0.58797264", "0.58795655", "0.5878992", "0.584348...
0.7200471
0
Contains a list of names of children.
def children(self) -> List[str]: return self._children
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children(self, parent):\n\n child_names = []\n for child in parent.children:\n child_names.append(child.label)\n return child_names", "def children_names(node):\n\n return map(History.name, History.children(node))", "def children(self) -> Iterable[Heirarchical]:\n...
[ "0.7957255", "0.7937436", "0.7526398", "0.7510187", "0.7485431", "0.74817616", "0.74563366", "0.73862034", "0.73109823", "0.72985727", "0.72985727", "0.72723377", "0.72723377", "0.72723377", "0.7270595", "0.7228568", "0.7211145", "0.7182591", "0.7129416", "0.71013296", "0.709...
0.82973534
0
Selects all routes going through the given navigational beacon. >>> airways.through('NARAK') [N869 (ROMAK, NASEP, NARAK), UN859 (PUMAL, ROCAN, LOMRA, GAI, NARAK, EVPOK, BALAN, AMB), UN869 (ELSAP, XOMBO, TIVLI, AGN, NARAK, NASEP, ROMAK, MINSO, MOKDI), UT122 (SECHE, NARAK, DITEV), UY155 (ETENU, NARAK), UZ365 (DIRMO, GUER...
def through(self, name: str) -> List[Route]: output: List[Route] = list() for id_ in self.search(name).data["route"]: item = self[id_] if item is not None: output.append(item) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_relationships(self, srcip, routes):\n outroutes = []\n return outroutes", "def mainRoads(osm_path): \n return retrieve(osm_path,'lines',['highway','oneway','lanes','maxspeed'],**{'highway':[\"='primary' or \",\"='trunk' or \",\"='motorway' or \",\"='motorway_link' or \",\"='trunk_link' or \",...
[ "0.5062522", "0.5040455", "0.49766245", "0.49713525", "0.4945458", "0.4732145", "0.47205678", "0.46839026", "0.46831116", "0.46721813", "0.46514463", "0.46441028", "0.46379942", "0.4603714", "0.4582215", "0.4567467", "0.45570642", "0.4541587", "0.4530949", "0.45244384", "0.45...
0.5317805
0
Selects the subset of airways matching name in the route name or in the passed navigational beacon. >>> airways.extent('Switzerland').search("Z50") route id navaid lat lon 101157 Z50 7 GERSA 47.039375 8.532114 101158 Z50 8 KELIP 46.956194 8.761667 101159 Z50 9 SOPER 46.889444 8.944444 101160 Z50 10 PELAD 46.598889 9.72...
def search(self, name: str) -> "Airways": output = self.__class__( self.data.query("route == @name.upper() or navaid == @name.upper()") ) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extent(\n self,\n extent: Union[\n str, ShapelyMixin, Nominatim, Tuple[float, float, float, float]\n ],\n buffer: float = 0.5,\n ) -> \"Airways\":\n if isinstance(extent, str):\n extent = location(extent)\n if isinstance(extent, ShapelyMixin):\...
[ "0.5527286", "0.5440702", "0.49091515", "0.48762658", "0.48553526", "0.48402444", "0.48152477", "0.47661301", "0.47367233", "0.47055614", "0.4702995", "0.46219817", "0.46098363", "0.45378387", "0.4536537", "0.45158443", "0.44922975", "0.4468608", "0.44533926", "0.4436553", "0...
0.6732291
0
Selects the subset of airways inside the given extent.
def extent( self, extent: Union[ str, ShapelyMixin, Nominatim, Tuple[float, float, float, float] ], buffer: float = 0.5, ) -> "Airways": if isinstance(extent, str): extent = location(extent) if isinstance(extent, ShapelyMixin): exte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spatial_subset(dataset: xr.Dataset,\n bbox: Tuple[float, float, float, float]) -> xr.Dataset:\n x1, y1, x2, y2 = bbox\n gm = GridMapping.from_dataset(dataset)\n x_name, y_name = gm.xy_dim_names\n return dataset.sel({\n x_name: slice(x1, x2),\n y_name: slice(y1, y2) i...
[ "0.54432505", "0.5368475", "0.5075384", "0.5059367", "0.5017331", "0.49877352", "0.4952837", "0.49368295", "0.49160692", "0.49075633", "0.4902908", "0.48861405", "0.4834816", "0.4827244", "0.4808568", "0.47792906", "0.47118062", "0.46802226", "0.46792704", "0.4673131", "0.464...
0.56727916
0
Grabs all the AV data from ProFootballReference.com Submits the data to the inputted CSV file
def AVScrape(csv_file): pre_url = "http://www.pro-football-reference.com/play-index/psl_finder.cgi?request=1&match=single&year_min=1994&year_max=2016&season_start=1&season_end=-1&age_min=0&age_max=0&pos=qb&pos=rb&pos=wr&pos=te&pos=e&pos=t&pos=g&pos=c&pos=ol&pos=dt&pos=de&pos=dl&pos=ilb&pos=olb&pos=lb&pos=cb&pos=s&pos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, csv_file):\n pass", "def main():\n\n csv_file = \"shortlist.csv\"\n team_count = 0\n participant_count = 0\n\n\n #Delete all existing teams and participants from the database.\n Team.objects.all().delete()\n Participant.objects.all().delete()\n\n ...
[ "0.5954874", "0.5907925", "0.5793777", "0.5714117", "0.5710575", "0.5676139", "0.56716245", "0.5654023", "0.56178623", "0.56043744", "0.5586952", "0.55767864", "0.5506081", "0.5390954", "0.5368033", "0.5364794", "0.5362522", "0.5361974", "0.53450847", "0.53221", "0.5308939", ...
0.74260896
0
Iniitalise an ApiClientFactory by passing the token, api_url and app_name, or by passing in the api_secrets_filename
def __init__(self, **kwargs): builder_kwargs = {} if "token" in kwargs and str(kwargs["token"]) != "None": # If there is a token use it along with the specified proxy details if specified config = ApiConfiguration( api_url=kwargs.get("api_url", None), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_factory(config):\n return SdkApi(config.get('apiKey'),\n sdk_api_base_url=config['sdkApiBaseUrl'],\n events_api_base_url=config['eventsApiBaseUrl'],\n split_sdk_machine_name=config['splitSdkMachineName'],\n split_sdk_machine_ip=config['...
[ "0.6772961", "0.650356", "0.6399361", "0.6361063", "0.63227516", "0.629303", "0.6280186", "0.6200639", "0.6141231", "0.614054", "0.61003244", "0.6023286", "0.6010457", "0.59964985", "0.59919703", "0.5990344", "0.5944311", "0.59302074", "0.5878384", "0.587532", "0.5846201", ...
0.69160074
0
Implementation of __getattribute__ that adds a decorator that adds a call_info argument to return additional call stats
def get_attribute_impl(source_obj, name): attr = super(metaclass, source_obj).__getattribute__(name) @functools.wraps(attr) @lusidretry def wrapper(*args, **kwargs): def is_http_info_method(m): return inspect.ismethod(m) and m.__name_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_decorator(func):\n\n def wrapper(*args, **kwargs):\n\n return func(*args, **kwargs)\n\n return wrapper", "def instrument_info(self):\n return self._decorator_wrapper(EventName.instrument_info)", "def callstats(): # real signature unknown; restored from __doc__\n return ()", "d...
[ "0.6471107", "0.59937793", "0.59614074", "0.58701956", "0.5764474", "0.5726039", "0.5594995", "0.5533878", "0.5516974", "0.54986167", "0.5497917", "0.54126596", "0.53940094", "0.5368929", "0.5362328", "0.5354633", "0.5345224", "0.53026205", "0.5294605", "0.529102", "0.5283759...
0.6846626
0
Preprocesses the family structure excel for a voivodship from pivoted to melted table for easier further processing.
def prepare_family_structure_from_voivodship(data_folder: Path) -> pd.DataFrame: if (data_folder / household_family_structure_xlsx.file_name).is_file(): return pd.read_excel(str(data_folder / household_family_structure_xlsx.file_name)) headcount_columns = [1, 2, 3, 4, 5, 6, 7] try: df = pd....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_data(self):\r\n # Rename columns to match final feature class\r\n self._rename_columns()\r\n # Add point ID column\r\n self._add_pointid()\r\n # Sort rows by transect id and timestamp\r\n self._sort_rows()\r\n # Fill Null records with a value\r\n ...
[ "0.56651896", "0.5642064", "0.55415344", "0.5507111", "0.54308593", "0.535222", "0.5045777", "0.5012882", "0.5003529", "0.49633825", "0.49495882", "0.4925335", "0.49133325", "0.4912745", "0.4912651", "0.4904412", "0.49000403", "0.48937735", "0.48792404", "0.4871849", "0.48717...
0.6852559
0
Given a headcount, family type (0,1,2,3), relationship between families (if applicable) and who the housemaster is (in multifamily households), this method returns all matching households in the df dataframe.
def draw_generation_configuration_for_household(df, headcount, family_type, relationship, house_master): if house_master not in (np.nan, '', None) and isinstance(house_master, str): house_master = house_master.strip() if relationship not in (np.nan, '', None) and isinstance(relationship, str): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_family_contacts(G):\n\t_, N_weekdays, _ = get_teaching_framework()\n\n\t# A list with all distinct families (households) in the graph.\n\tfamilies = set(dict(G.nodes(data='family')).values())\n\n\tfor family in families:\n\t\t# Get all nodes that are members of this family\n\t\tfamily_members = [n for n, f...
[ "0.5536446", "0.532739", "0.5259335", "0.5119429", "0.5111501", "0.50512", "0.5043845", "0.5011786", "0.5010871", "0.4991457", "0.49491638", "0.4890656", "0.48883584", "0.4887805", "0.4786879", "0.47634357", "0.4731124", "0.46729854", "0.46345085", "0.46306437", "0.46197888",...
0.6990282
0
Assert that an email will fail with no flask app supplied.
def test_process_filing_missing_app(app, session): # setup email_msg = {'email': {'type': 'bn'}} # TEST with pytest.raises(Exception): worker.process_email(email_msg, flask_app=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testEmailRequired(self):\r\n res = self.app.post('/signup_process')\r\n self.assertIn('Please supply', res.body)", "def test_no_email(self):\n user = self.make_user()\n data: dict = {}\n\n with self.login(user):\n response = self.post(\"referrals:create\", data=d...
[ "0.7141608", "0.712236", "0.71125066", "0.69904053", "0.69764674", "0.68966794", "0.6896086", "0.6757559", "0.6675555", "0.66366965", "0.66221803", "0.66028523", "0.65942", "0.6550338", "0.649285", "0.6485451", "0.6474219", "0.6468559", "0.64467806", "0.6436596", "0.6425632",...
0.7731551
0
Load cached models. File semicon/cache.json should be created on package build.
def _load_cache(): BASE_DIR = os.path.dirname(os.path.abspath(__file__)) fname = os.path.join(BASE_DIR, "model_cache.json") with open(fname) as f: models_cache = json.load(f) return models_cache
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadCacheFile(self):\n if not os.path.exists(self.cachePath):\n self.initCacheFile()\n else:\n with open(self.cachePath) as json_cacheFile:\n self.cacheData = json.load(json_cacheFile)", "def _load_cache(self):\n self.cache = self.cache_manager.retrieve(self.cache_file)\n ...
[ "0.68687695", "0.6514899", "0.6504222", "0.6486439", "0.6433463", "0.630229", "0.6239464", "0.62393355", "0.6222734", "0.61632544", "0.6081804", "0.6050655", "0.603343", "0.59910804", "0.59816635", "0.597889", "0.591525", "0.5896448", "0.58964187", "0.58943313", "0.58850193",...
0.8297243
0
Sequence of allowed model bands.
def _allowed_bands(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bands(self):\n\t\treturn self._bands", "def bands(self):\n if self._bands is None:\n self._bands = self._compute_bands()\n return self._bands", "def bands(self):\n return self._bands", "def bands(self) -> int:\n ...", "def get_worker_bands(self) -> List[BandType]:...
[ "0.7768418", "0.76935077", "0.76644814", "0.71378136", "0.71045214", "0.6804071", "0.6619485", "0.6541476", "0.6407003", "0.64041907", "0.6384197", "0.6348073", "0.6257155", "0.6234112", "0.6134067", "0.6109512", "0.60096925", "0.58786154", "0.58616775", "0.584709", "0.584503...
0.7938282
0
Install a cleanup task (periodical) in an asyncio loop, running every interval seconds
def install_cleanup(self, loop, interval=30.0): if interval < 0: raise ValueError('Interval must be positive') if self._cleanup_task is not None: self._cleanup_task.cancel() self._cleanup_task = loop.create_task(self.cleanup_run(interval)) return self._cleanup_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def cleanup_run(self, interval):\n # Reference workaround: when a Ratelimit object has been deleted,\n # this coroutine would still hold a reference to it.\n self = weakref.proxy(self)\n\n while True:\n try:\n await asyncio.sleep(interval)\n ...
[ "0.7062501", "0.687048", "0.67005086", "0.63232005", "0.63232005", "0.63110507", "0.6264068", "0.62518704", "0.6202865", "0.6196806", "0.61747193", "0.61201507", "0.6097375", "0.60965884", "0.6043681", "0.6029083", "0.601865", "0.60125566", "0.599222", "0.5986894", "0.5985088...
0.73820025
0
Remove/cancel the current cleanup task
def remove_cleanup(self): if self._cleanup_task: self._cleanup_task.cancel() self._cleanup_task = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def cleanup(self):\n if self.preparing_task:\n self.preparing_task.cancel()", "async def async_cleanup(self) -> None:\n self._async_cancel_timer()\n if not self._task:\n return\n self._task.cancel()\n try:\n await self._task\n excep...
[ "0.7871155", "0.73455393", "0.7294338", "0.72457093", "0.7130807", "0.70357084", "0.6787406", "0.6742547", "0.67156947", "0.6627112", "0.6611407", "0.6604983", "0.6553211", "0.6542919", "0.65256315", "0.64911515", "0.6484051", "0.64819115", "0.6448052", "0.64240813", "0.64158...
0.8245037
0
Builds a directed graph composed of cycles from the given graph. `G` is an undirected simple graph. `root` is a node in the graph from which the depthfirst search is started. This function returns both the depthfirst search cycle graph
def _dfs_cycle_forest(G, root=None): # Create a directed graph from the depth-first search tree with # root node `root` in which tree edges are directed toward the # root and nontree edges are directed away from the root. For # each node with an incident nontree edge, this creates a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _depth_first_directed(self, graph):\n \n # Figure out which subgraph this is\n sub = next((i+1 for i, g in enumerate(self.get_subgraphs()) if g==graph), None)\n # Log the Subgraph progress\n logger.info('Directing SUBGRAPH {} / {}'.format(sub, len(list(self.get_subgraphs())))...
[ "0.64466333", "0.627244", "0.6142489", "0.5973736", "0.5968964", "0.5955802", "0.580972", "0.57830065", "0.5772483", "0.57376754", "0.57176226", "0.5705856", "0.5699831", "0.5687814", "0.5664218", "0.5605843", "0.5509099", "0.5493965", "0.54782474", "0.5471376", "0.5458572", ...
0.7563585
0
Function to process roi coordinates table. Reindex the coordinate table.
def process_roi_coord(coor, roi_names): coor.rename(columns={'Unnamed: 0': 'ROI'}, inplace=True) idx = [] for i in range(0, len(roi_names)): # Reordering according to ROInames for k in range(0, len(coor['ROI'])): if roi_names[i] == coor['ROI'][k]: idx.append(k) coor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateRoi(self, roiParams):\n\n\t\t#print('bAnnotationList.updateRoi() with roiParams')\n\t\t#print(json.dumps(roiParams, indent=2))\n\n\t\tidx = roiParams['idx']\n\n\t\tself.myList[idx]['x'] = roiParams['x']\n\t\tself.myList[idx]['y'] = roiParams['y']\n\t\tself.myList[idx]['roiParams'] = roiParams['roiParams'...
[ "0.53700954", "0.5364047", "0.53540826", "0.53540826", "0.5295284", "0.52625126", "0.5254282", "0.5236567", "0.5224349", "0.5152774", "0.5139932", "0.51355636", "0.51172686", "0.50803316", "0.5042996", "0.50342447", "0.49729553", "0.49668783", "0.49475488", "0.49112126", "0.4...
0.6322208
0
Test the connect functionality of the webhook connection.
async def test_connection(self): await self.webhook_connection.connect() assert self.webhook_connection.is_connected is True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_initialization(self):\n assert self.webhook_connection.address == self.identity.address", "def test_connect_post_namespaced_status_webhooks(self):\n pass", "def test_connect(rgd):\n assert rgd.connected is True", "def test_connectEvent(self):\n reactor = self.buildReact...
[ "0.7708545", "0.72191334", "0.701312", "0.6994374", "0.69369733", "0.69012845", "0.683356", "0.6825268", "0.67462474", "0.6718134", "0.6687489", "0.66519815", "0.66375107", "0.66314805", "0.6576398", "0.657536", "0.6534536", "0.6528393", "0.6506039", "0.65056115", "0.6478544"...
0.8621524
0
Test the disconnect functionality of the webhook connection.
async def test_disconnect(self): await self.webhook_connection.connect() assert self.webhook_connection.is_connected is True await self.webhook_connection.disconnect() assert self.webhook_connection.is_connected is False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown(self):\n try:\n self.loop.run_until_complete(self.webhook_connection.disconnect())\n except Exception:\n print_exc()\n raise", "def test_disconnect(self):\n self.inverter.disconnect()\n sleep(0.02)", "def test_event_handler_can_upgrade_d...
[ "0.77790105", "0.72274256", "0.7158382", "0.7139655", "0.7108128", "0.70709395", "0.7040935", "0.7026073", "0.70250636", "0.7021222", "0.6931081", "0.6900863", "0.6848703", "0.68472296", "0.6846983", "0.6844192", "0.68220687", "0.6817857", "0.6812777", "0.6767769", "0.6761356...
0.864508
0
Dials one or more phone numbers from a Twilio phone number.
def dial_numbers(): for number in DIAL_NUMBERS: print("Dialing " + number) # set the method to "GET" from default POST because Amazon S3 only # serves GET requests on files. Typically POST would be used for apps client.calls.create(to=number, from_=TWILIO_PHONE_NUMBER, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phonecall():\n phone_number = choice(phone_numbers)\n r = twiml.Response()\n r.dial(phone_number)\n return str(r)", "def dial(phone_number):\n call = client.calls.create(\n to='+{}'.format(phone_number),\n from_=twilio_phone_number,\n url=twiml_instructions_url...
[ "0.7704418", "0.6964214", "0.64383084", "0.63925886", "0.63923", "0.590252", "0.5741604", "0.56868154", "0.5453782", "0.54019755", "0.53713655", "0.5301497", "0.5283318", "0.52771115", "0.5268012", "0.5246617", "0.5219436", "0.520276", "0.5181034", "0.5160139", "0.51506734", ...
0.77863014
0
% Improvement in renewal probability is calculated by the following formula with given agent effort Y = 20(1exp(x/5))
def improvement(x): Y = 20*(1-np.exp(-x/5.0)) return Y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ProbCorrect(efficacy, difficulty, a=1):\n return 1 / (1 + math.exp(-a * (efficacy - difficulty)))", "def expected_policy_profit(targeting_decision, g, observed_profit, prob_treatment):\n return np.sum(((1-targeting_decision) * (1-g) * observed_profit)/(1-prob_treatment) +\\\n (targeti...
[ "0.62867695", "0.623467", "0.6178251", "0.6162431", "0.60964996", "0.6063383", "0.60428524", "0.6005889", "0.5993291", "0.59750515", "0.59610116", "0.5931375", "0.59262854", "0.5922276", "0.59134555", "0.59122", "0.5909404", "0.5880955", "0.58681846", "0.5855592", "0.583282",...
0.75174105
0
Gets a list of all people involved in a movie who's job is a certain role
def get_role_list(people, role): people = ast.literal_eval(people) crew = [] for person in people: if person['job'] == role: crew.append(str(person['name'])) return crew if len(crew) else []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profiles_by_role_and_movie(role,movie_id):\n cnx,cur = connect_to_db()\n cur.execute(\"SELECT DISTINCT profile.profile_id, name, gender, age, main_department, popularity, biography, photo_link \"\n \"FROM profile, movie_crew \"\n \"WHERE movie_crew.movie_id = \" + str(mo...
[ "0.66657007", "0.5943359", "0.59382993", "0.5740657", "0.56408477", "0.5603079", "0.5522897", "0.54619175", "0.545214", "0.5413783", "0.53967404", "0.5367633", "0.53615093", "0.5356662", "0.53460664", "0.5342905", "0.5335358", "0.53326935", "0.53166515", "0.5282052", "0.52327...
0.6163398
1
Removes all rows with missing value for feature
def remove_rows_without_feature(df, feature): return df[np.isfinite(df[feature])]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exclude_empty_feats(self):\n for dataset in self:\n dataset.dropna(axis=1, how=\"all\", inplace=True)", "def drop_missing_values_in_dataframe(dataframe):\r\n return dataframe.dropna()", "def clean_data(data):\n data.dropna(inplace=True)\n for feature in data:\n if ((featur...
[ "0.6966402", "0.66265434", "0.65729374", "0.6526619", "0.6521646", "0.6515246", "0.65061843", "0.6490512", "0.64358175", "0.6434707", "0.63937443", "0.63838947", "0.63713855", "0.6338703", "0.6315921", "0.6301724", "0.6299499", "0.6264146", "0.6261045", "0.6220526", "0.619605...
0.7822574
0
Removes all rows with english as the original language
def remove_rows_with_non_english_movies(df): df = df[df['original_language'] == 'en'] return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeLanguage(language):", "def apply_language_filter(self):\n all_langs = self.data.keys()\n langs_to_remove = [l for l in all_langs if not self.config.filter_language(l)]\n for lang in langs_to_remove:\n self.data.pop(lang)\n # Make sure we've not removed all languag...
[ "0.70820606", "0.66125786", "0.63206106", "0.5983074", "0.5891483", "0.5799666", "0.5752245", "0.57278514", "0.56817937", "0.5645379", "0.5591666", "0.5583999", "0.5532124", "0.5489045", "0.5459908", "0.5432486", "0.5370672", "0.53702587", "0.5325335", "0.53006375", "0.529363...
0.8224698
0
Performs binarization of original language 1 if english, 0 if not
def binarize_english(df): df['is_english'] = df['original_language'].apply(lambda x: 1 if x == 'en' else 0) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binarize_labels(labels):\n labels = np.where(labels == 0, labels, 1)\n\n return labels", "def encode_ST_labels(labels):\n return np.array([1 if sentiment == 'bullish' else 0 for sentiment in labels])", "def text_language(text):\n hebrew = 0\n english = 0\n for char in text:\n if ch...
[ "0.60604715", "0.57945085", "0.55142355", "0.5405532", "0.54039925", "0.5396476", "0.5378059", "0.5357197", "0.5249946", "0.524122", "0.52107364", "0.51951313", "0.51682526", "0.5138264", "0.5121541", "0.5117763", "0.5112261", "0.510333", "0.5097166", "0.5073876", "0.5065019"...
0.7848286
0
Performs binarization of homepage 1 if there is a homepage, 0 if not
def binarize_homepage(df): df['homepage'] = df['homepage'].apply(lambda x: 0 if pd.isnull(x) else 1) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isHomePage(self):\n home = self.getHome(self.url)\n if home == self.url:\n return True\n if home == self.url + '/':\n return True\n return False", "def isTopHomePage(self):\n domain = self.getDomain()\n if self.url == \"http://\" + domain + \"/\...
[ "0.6091127", "0.59615946", "0.59240305", "0.5683219", "0.56692785", "0.56236154", "0.5537348", "0.5481776", "0.54775214", "0.54775214", "0.5445591", "0.54330665", "0.54195714", "0.54104084", "0.5312978", "0.5298251", "0.5263704", "0.5244406", "0.52271765", "0.5226509", "0.521...
0.6674617
0
Performs binarization of belongs_to_collection 1 if movie belonds to a collection, 0 if not
def binarize_belongs_to_collection(df): df['belongs_to_collection'] = df['belongs_to_collection'].apply(lambda x: 0 if pd.isnull(x) else 1) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binarize(self):\n total = 0\n count = 0\n avg_rating = 0\n for movie_id, movie in enumerate(self.ratings):\n for user_id, rating in enumerate(movie):\n if rating != 0:\n self.ratings[movie_id,user_id] = 1 if rating > 2.5 else -1", "def SetPRBinCatConstra...
[ "0.5423014", "0.52072906", "0.5192433", "0.49071214", "0.4894318", "0.48411235", "0.47887105", "0.47748193", "0.47607437", "0.47208834", "0.4720841", "0.46991575", "0.46833274", "0.46610296", "0.4651369", "0.4560167", "0.45596126", "0.45501775", "0.45492193", "0.45424837", "0...
0.69827706
0
Extracts all the producers from a movie crew list and adds a new column containing a list of them
def add_producers_feature(df): df['producers'] = df['crew'].apply(get_role_list, role='Producer') return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_executive_producers_feature(df):\n df['executive_producers'] = df['crew'].apply(get_role_list, role='Executive Producer')\n return df", "def get_users_movies(myRatings):\n #return [x[1] for x in myRatings]\n return list(myRatings.map(lambda x: x[1]).collect())", "def listGenres(movieId):\n ...
[ "0.66175735", "0.6039001", "0.57194865", "0.54294884", "0.5381759", "0.5339784", "0.53212154", "0.5309363", "0.5288881", "0.52879494", "0.5284508", "0.5266872", "0.5255963", "0.5255658", "0.5250831", "0.5242999", "0.5237771", "0.52363527", "0.52006173", "0.51992583", "0.51706...
0.73136544
0
Extracts all the executive producers from a movie crew list and adds a new column containing a list of them
def add_executive_producers_feature(df): df['executive_producers'] = df['crew'].apply(get_role_list, role='Executive Producer') return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_producers_feature(df):\n df['producers'] = df['crew'].apply(get_role_list, role='Producer')\n return df", "def get_users_movies(myRatings):\n #return [x[1] for x in myRatings]\n return list(myRatings.map(lambda x: x[1]).collect())", "def pred_movies(movie_list):\r\n # Store the id of use...
[ "0.71059453", "0.5883609", "0.554519", "0.55006105", "0.53421044", "0.5254432", "0.52319914", "0.51880205", "0.5157102", "0.51167184", "0.51138604", "0.5081104", "0.5060804", "0.5058662", "0.50564015", "0.50239605", "0.501807", "0.5010032", "0.49784666", "0.4978069", "0.49765...
0.7422732
0
Performs Multilabel binarization on the genre column
def binarize_genres(df): df['genres'] = df['genres'].apply(lambda x: [] if pd.isnull(x) else ast.literal_eval(x)) genres = [ 'Drama', 'Comedy', 'Thriller', 'Action', 'Romance', 'Adventure', 'Crime', 'Science Fiction', 'Horror', 'Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __encode_genres(self, df):\n\t\tself.genre_mlb = MultiLabelBinarizer()\n\t\tdf = df.join(pd.DataFrame(self.genre_mlb.fit_transform(df.pop(\"genres\")), columns=self.genre_mlb.classes_,\n\t\t\t\t\t\t\t\t index=df.index),\n\t\t\t\t\t lsuffix='l')\n\t\treturn df", "def __encode_genre_transform(self, df):\n\t\t...
[ "0.7102173", "0.61488175", "0.59661096", "0.5937361", "0.5679787", "0.56341356", "0.5632879", "0.5558105", "0.5535718", "0.55260855", "0.55074084", "0.55055606", "0.55009574", "0.55009574", "0.54886335", "0.5466424", "0.54655117", "0.54489887", "0.5429369", "0.5411382", "0.53...
0.67600524
1
Calculates a production score for each movie based on a number of movie attributes
def get_movie_scores(df, min_vote_count=1000): ratings = {} for x in CREW_ATTRIBUTES: ratings[x] = get_avg_scores_for_attribute(df, x, min_vote_count) df['production_score'] = df.apply(calculate_final_production_score, ratings=ratings, axis=1) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_final_production_score(row, ratings):\n scores = {}\n\n for x in CREW_ATTRIBUTES:\n data = row[x]\n\n # handle director case that isn't wrapped by []\n data = get_literal_eval(data)\n\n total_score = calculate_total_score(data, ratings[x])\n\n # more famous ac...
[ "0.6805248", "0.64947075", "0.5905053", "0.5860894", "0.5681825", "0.56005096", "0.55423295", "0.55131036", "0.55131036", "0.5509678", "0.54971045", "0.5474635", "0.5441832", "0.54303586", "0.54106766", "0.53977567", "0.53958726", "0.53940076", "0.53863364", "0.5332752", "0.5...
0.754779
0
Performs multilabel binarization for production_countries
def binarize_production_countries(df): df['production_countries'] = df['production_countries'].apply(lambda x: get_literal_eval(x)) countries = { 'United States of America': 'usa', 'United Kingdom': 'uk', 'France': 'france' } for country, short in countries.iteritems(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _binarization(self):\n for feat in self.cat_feats:\n lbl = preprocessing.LabelBinarizer()\n lbl.fit(self.dataframe[feat].values)\n val = lbl.transform(self.dataframe[feat].values)\n self.dataframe_d_copy = self.dataframe_d_copy.drop(feat,axis=1)\n \...
[ "0.6259716", "0.57233137", "0.553241", "0.54915136", "0.5467678", "0.5396519", "0.53895664", "0.5343014", "0.5302878", "0.52354497", "0.52350134", "0.5199901", "0.5198421", "0.51948607", "0.5181126", "0.5175166", "0.517349", "0.51338416", "0.51308686", "0.51286715", "0.512848...
0.70353466
0
A list of boolean values. Returns
def get_list_of_bool2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bool(bool_list):\n new_list = []\n for lst in bool_list:\n for item in lst:\n new_list.append(item)\n if True in new_list:\n return True\n else:\n return False", "def get_boolean(self, df):\n if not self.value:\n return False\n elif no...
[ "0.6886529", "0.6785922", "0.6778567", "0.67626256", "0.6738849", "0.67353225", "0.67196757", "0.6655168", "0.6534188", "0.6466932", "0.64177793", "0.64067584", "0.63788617", "0.6306817", "0.62717414", "0.62004673", "0.61960614", "0.6179456", "0.6109904", "0.6088033", "0.6085...
0.8391792
0
A list of string values. Returns
def get_list_of_str2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_strings(self):\n return self.strings", "def str(self) -> List[Tuple[str, str]]:\n kl = self.keys()\n vl = self.values()\n return [str(kl[idx]) + \",\" + str(vl[idx]) for idx in range(len(kl))]", "def values(self) -> Sequence[str]:\n return pulumi.get(self, \"values\")...
[ "0.7167464", "0.7113062", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.7091683", "0.6848555", "0.6832212", "...
0.7210019
0
A list of bytes values. Returns
def get_list_of_bytes2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_bytes(self) -> List[bytes]:", "def to_bytes(self) -> \"list[int]\":\n entries_per_byte = 8 // int(self.offset_type)\n byte_array = []\n for i in range(0, len(self.entries), entries_per_byte):\n byte = 0\n for j in range(0, entries_per_byte):\n ...
[ "0.7564727", "0.7253094", "0.71063954", "0.7079481", "0.7047614", "0.70458287", "0.7023155", "0.69845706", "0.68807536", "0.68009067", "0.6798348", "0.67855877", "0.6570827", "0.6535302", "0.65155625", "0.650493", "0.64863735", "0.64605844", "0.6449537", "0.6411082", "0.64039...
0.7699338
0
A list of integer values. Returns
def get_list_of_int2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toIntList(values):\n\treturn list(map(lambda va: int(va), values))", "def ints(xs: Iterable) -> list[int]:\n return lmap(int, xs)", "def read_ints(self):\n return self.numbers", "def test_to_int_list(self):\n self.assertEqual(to_int_list([u\"3\", None, \"asdf\", u\"42\"]), [3, 0, 0, 42])...
[ "0.8060526", "0.7668315", "0.715409", "0.6973905", "0.68201804", "0.6720938", "0.67158026", "0.66684014", "0.6636379", "0.6591792", "0.6536708", "0.65364265", "0.652693", "0.6518962", "0.6512804", "0.64583504", "0.64583504", "0.6452349", "0.6442772", "0.6435356", "0.6414682",...
0.80248773
1
A dictionary of boolean values. Returns
def get_dict_of_bool2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_flags_to_boolean_dict(flags):\n return {f: True for f in flags}", "def to_dict(self): \n throwable_dict = {}\n \n for key, value in vars(self).items(): \n if isinstance(value, bool) or value:\n throwable_dict[key] = value \n \n r...
[ "0.7296171", "0.68900573", "0.6785396", "0.6619479", "0.65423805", "0.6493571", "0.6368495", "0.6288095", "0.6282784", "0.62192416", "0.6211032", "0.619737", "0.61951697", "0.6159341", "0.61395526", "0.61140764", "0.61127585", "0.608827", "0.60678655", "0.6050956", "0.5995552...
0.83294183
0
A dictionary of string values. Returns
def get_dict_of_str2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def values(self) -> Dict[str, Any]:\n pass", "def _getStrValues(self):\n res = {}\n for colname in self._iterName():\n res[colname] = str(self._values[colname])\n return res", "def valuemap(self):\n\n values = self.qualifiers.get('values')\n valuemap = self....
[ "0.6969794", "0.68628305", "0.67406577", "0.67219096", "0.65892935", "0.6438859", "0.6362032", "0.6308183", "0.62860686", "0.6065613", "0.6028583", "0.5913391", "0.583654", "0.5825464", "0.5821469", "0.5807437", "0.5791494", "0.57786053", "0.57627743", "0.57392883", "0.573071...
0.68720055
1
A dictionary of bytes values. Returns
def get_dict_of_bytes2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_map(as_bytes: typing.List[int]) -> dict:\n raise NotImplementedError()", "def bytes_value(self) -> global___Expression.BytesValue:", "def get_map(self, chars):\n\n byte_offset = 0\n cb_map = {}\n\n for char_offset, char in enumerate(chars):\n cb_map[char_offset] = ...
[ "0.6568225", "0.65471387", "0.6286961", "0.61969626", "0.609535", "0.6010732", "0.5990256", "0.59116036", "0.5908095", "0.5905299", "0.58913755", "0.5872079", "0.58492345", "0.583523", "0.58260274", "0.5787103", "0.5786352", "0.57320637", "0.5729502", "0.5716497", "0.5711199"...
0.74982524
0
A dictionary of integer values. Returns
def get_dict_of_int2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_int(data):\n return {int(k): data[k] for k in sorted(data.keys())}", "def _get_nominal_integer_dict(nominal_vals):\n d = {}\n for val in nominal_vals:\n if val not in d:\n current_max = max(d.values()) if len(d) > 0 else -1\n d[val] = current_max + 1\n return d...
[ "0.75426537", "0.682534", "0.67698157", "0.6609108", "0.625872", "0.6249494", "0.6235856", "0.6203752", "0.6169256", "0.61339897", "0.6117127", "0.60640234", "0.60495365", "0.60352665", "0.60217446", "0.6015657", "0.5931481", "0.59246564", "0.59110546", "0.59092355", "0.58601...
0.7828474
0
A dictionary of floatingpoint values. Returns
def get_dict_of_float2(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict(self) -> Dict[str, List[NumericType]]:\n return {r.name: r.floats() for r in self._records}", "def internal_values(self) -> Dict[str, Union[int, float]]:\n return {name: self.hyperparams[name][1] for name in self.names()}", "def values_dict(self):\n\n values = {}\n values[\...
[ "0.7500674", "0.6286746", "0.62367636", "0.61791086", "0.6133773", "0.6099849", "0.6093723", "0.59516734", "0.5832339", "0.57943994", "0.5780399", "0.57744503", "0.5727283", "0.57150143", "0.56971496", "0.5693982", "0.56771123", "0.5674878", "0.566524", "0.56597334", "0.56351...
0.7742927
0
This function extracts different time stamps from the variable 'TransactionDT' such as day of the month, day of the week, hours and minutes and converts them into extra variables of the dataframe.
def extract_timestamps(self, start_date = '2017-12-01'): startdate = datetime.datetime.strptime(start_date, "%Y-%m-%d") self.data["Date"] = self.data['TransactionDT'].apply(lambda x: (startdate + datetime.timedelta(seconds=x))) self.data['Day of the month'] = self.data['Date'].dt.day sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_timestamp(self, data, time_col='image_timestamp', drop=True):\n\n def parse_timestamp(x):\n \"\"\"Parses example fmt: 'Sat Dec 23 10:01:24 2017 PST' \"\"\"\n return ' '.join(x.split(' ')[1:-1])\n\n df = data.copy()\n pre = 'tmp-'\n df[pre + time_col] =...
[ "0.54780674", "0.5460234", "0.5352902", "0.5245985", "0.5235988", "0.5201319", "0.51570994", "0.51530176", "0.49411607", "0.49379343", "0.49010503", "0.48731148", "0.48611358", "0.48589244", "0.48460868", "0.48413017", "0.4818968", "0.48188448", "0.48132327", "0.4785077", "0....
0.62810105
0
This function standardises the numeric columns of a dataframe.
def standardiser(self): # Select only numeric features first #self.X = self.data.loc[:, self.data.columns != self.target].values numeric_columns = [] for col in self.X.columns: if self.X[col].dtype!='object': numeric_columns.append(col) scaler = prepr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_price_values(df):\r\n\r\n\tdf_normalize_dict = dict()\r\n\r\n\tfor i, col in enumerate(df.columns):\r\n\t\tcol_array = np.array(df[col])\r\n\t\tdf_normalize_dict[\"Normalized\" + col] = preprocessing.normalize([col_array])[0]\r\n\r\n\tdf_normalize = pd.DataFrame(df_normalize_dict, index=df.index)\r\n...
[ "0.68828523", "0.68069476", "0.67548114", "0.67227507", "0.6595322", "0.658903", "0.65552354", "0.64859533", "0.6485217", "0.6478139", "0.64753824", "0.64696854", "0.64696854", "0.6448089", "0.64241856", "0.64109224", "0.63815856", "0.6377063", "0.6351459", "0.6346876", "0.63...
0.72242796
0
Read a text file containing Twitter screen_names, one per line.
def read_screen_names(filename): flist = [] f = open('candidates.txt') for line in f: flist.append(line.strip('\n')) return flist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_screen_names(filename):\n\n with open(filename, 'r') as f:\n content = f.read().splitlines()\n\n return content", "def read_twitter(filename):\r\n data = []\r\n counter = 0\r\n with codecs.open(filename, 'r', 'utf-8') as f:\r\n for line in f:\r\n stuff = [x for x ...
[ "0.7447488", "0.64228034", "0.6228219", "0.61079973", "0.59758985", "0.5962449", "0.5952051", "0.5907144", "0.5904723", "0.58342546", "0.5802057", "0.5800313", "0.5798104", "0.5781495", "0.57688016", "0.5717222", "0.57133", "0.57076514", "0.56882674", "0.56729025", "0.5663597...
0.7186009
1
Retrieve the Twitter user objects for each screen_name.
def get_users(twitter, screen_names): request = robust_request(twitter, 'users/lookup', {'screen_name': screen_names}, max_tries=5) user_info = [] for user in request: user_info.append(user) return user_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_users(twitter, screen_names):\n ###TODO-- Completed\n\n #create a request for Twitter to fetch data, using robust_request function, limiting to 200\n #get the requests for every screen_name and store it in a list\n requests = [robust_request(twitter,'users/lookup',{'screen_name':screen_name, 'c...
[ "0.78942174", "0.7709179", "0.7126518", "0.6822808", "0.67804223", "0.6779172", "0.66131747", "0.65748686", "0.65124315", "0.6483101", "0.64769137", "0.63471603", "0.6294934", "0.6165395", "0.61579555", "0.6129354", "0.6095629", "0.60620123", "0.60600054", "0.6058718", "0.602...
0.8145805
0
Print the number of friends per candidate, sorted by candidate name.
def print_num_friends(users): for u_dict in users: print ("%s %d" %(u_dict['screen_name'], len(u_dict['friends'])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_num_friends(users):\n ###TODO-- Completed\n\n #Creating a new dictionary to store the KEY, VALUE pair for friends of every screen_name i.e. user\n # and their counts i.e. number of friends per user\n all_friends_dict = {}\n\n for user in users:\n all_friends_dict[user['screen_name']...
[ "0.7385565", "0.61209023", "0.59025186", "0.58957684", "0.5812268", "0.57601863", "0.5642867", "0.5642867", "0.5555491", "0.5534458", "0.5506134", "0.548626", "0.5448755", "0.5439224", "0.5404866", "0.53680235", "0.5367201", "0.5353438", "0.5326604", "0.5317783", "0.52985245"...
0.7063115
1
Count how often each friend is followed.
def count_friends(users): all_friends=[] for u_dict in users: for items in u_dict['friends']: all_friends.append(items) count = Counter() for frnd in all_friends: count[frnd]+=1 return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_friends(users):\n ###TODO-- Completed\n\n #Creating a Counter object, to count the mapping\n c = Counter()\n c.update(friend_id for user in users for friend_id in user['friends'])\n return c", "def count_friends(self):\n query = read_query('content exploration/count_friends')\n ...
[ "0.72688586", "0.70336175", "0.70297045", "0.69893944", "0.6874314", "0.67994153", "0.67738897", "0.66341037", "0.6608121", "0.62928677", "0.62310994", "0.6174809", "0.603691", "0.6025284", "0.60199904", "0.59938794", "0.59653294", "0.5948239", "0.59337586", "0.5919943", "0.5...
0.7489338
0
Find and return the screen_name of the one Twitter user followed by both Hillary Clinton and Donald Trump. You will need to use the TwitterAPI to convert
def followed_by_hillary_and_donald(users, twitter): str = '' set1 = set() set2 = set() for u_dict in users: if u_dict['screen_name'] == 'HillaryClinton': set1 = set(u_dict['friends']) elif u_dict['screen_name'] == 'realDonaldTrump': set2 = set(u_dict['friends']) common ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def followed_by_hillary_and_donald(users, twitter):\n ###TODO-- Completed\n for user in users:\n if user['screen_name'] == 'HillaryClinton':\n friends_Hillary = user['friends']\n #print(len(friends_Hillary))\n elif user['screen_name'] == 'realDonaldTrump':\n fri...
[ "0.74147284", "0.6515776", "0.623562", "0.6160399", "0.6133982", "0.5829613", "0.5810056", "0.5791673", "0.5764016", "0.56341696", "0.5539674", "0.55171955", "0.5512381", "0.549714", "0.54817224", "0.5457852", "0.54316056", "0.5429055", "0.5426265", "0.542361", "0.53638583", ...
0.7773288
0
Weave a File Xref from commands.
def weave( self, aWeb, aWeaver ): self.formatXref( aWeb.fileXref(), aWeaver )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weaveReferenceTo( self, aWeb, aWeaver ):\n for cmd in self.commands:\n cmd.weave( aWeb, aWeaver )", "def weave( self, aWeb, aWeaver ):\n self.fullName= aWeb.fullNameFor( self.name )\n aWeaver.fileBegin( self )\n for cmd in self.commands:\n cmd.weave( aWeb, aW...
[ "0.5964178", "0.5560905", "0.538526", "0.53724873", "0.5362475", "0.5221219", "0.5208632", "0.51216495", "0.5029646", "0.49343014", "0.4912696", "0.48893067", "0.48878962", "0.4887417", "0.48771715", "0.48633447", "0.48600256", "0.48547012", "0.48498854", "0.48497185", "0.484...
0.558148
1
Add another Command to this chunk.
def append( self, command ): self.commands.append( command ) command.chunk= self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_command(self, command):\n self.command.extend(command)", "def custom(self, command):\n self.command.append(command)\n return self", "def add_command(self, cmd: Command):\n self._command_list.append(cmd)", "def cmd(self, command):\n self._commands.append(command)", ...
[ "0.79215986", "0.76004136", "0.7447588", "0.7310375", "0.7171025", "0.7166908", "0.7009219", "0.6979431", "0.6955108", "0.6907452", "0.6883594", "0.6842444", "0.67722744", "0.6682267", "0.6678614", "0.6604899", "0.6586926", "0.6542292", "0.6526513", "0.6504698", "0.64053285",...
0.7681788
1
Return the first command's line number or None.
def lineNumber( self ): return self.commands[0].lineNumber if len(self.commands) >= 1 else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_first_code_line():\n return min(_code_lines)", "def arg1(self) -> Optional[str]:\n if self.line_len() > 1:\n return self._cur()[1]", "def getline(self, lnum=None):\n return self._vim.current.buffer[lnum] if lnum else self._vim.current.line", "def get_line_no(obj):\n tr...
[ "0.67977166", "0.6709247", "0.6432102", "0.63991344", "0.63472795", "0.62821436", "0.6170765", "0.6155984", "0.614875", "0.60633", "0.6055397", "0.60314494", "0.59963655", "0.59950143", "0.5989234", "0.59097517", "0.58653796", "0.584572", "0.58401954", "0.5838904", "0.5831317...
0.7380827
0
Create a short reference to this chunk except for anonymous chunks.
def weaveShortReferenceTo( self, aWeb, aWeaver ): raise Exception( "Cannot reference an anonymous chunk.""")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunkReferencedBy( self, aChunk ):\n pass", "def __init__(self, chunk):\n self.anchor = chunk", "def anonymous_blockname(self, typechar):\n self._anonymous_counter += 1\n return \"*%s%s\" % (str(typechar), str(self._anonymous_counter))", "def _issingleton(self, tagname):\n ...
[ "0.54704916", "0.52945817", "0.5275229", "0.5183866", "0.5161983", "0.5139863", "0.5117234", "0.5036055", "0.49789163", "0.49232265", "0.4893088", "0.48914686", "0.4875013", "0.48595113", "0.48590022", "0.47826633", "0.4747747", "0.47459325", "0.4742227", "0.4739728", "0.4734...
0.62385184
0
Add self to a Web as output chunk, update xrefs.
def webAdd( self, web ): web.addOutput( self )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add( self, chunk ):\n self.chunkSeq.append( chunk )\n chunk.web= weakref.ref(self)", "def addOutput( self, chunk ):\n self.chunkSeq.append( chunk )\n chunk.web= weakref.ref(self)\n if chunk.name not in self.output:\n self.output[chunk.name] = []\n self...
[ "0.6970297", "0.62841475", "0.5437267", "0.532315", "0.5268427", "0.5153768", "0.5104242", "0.50866616", "0.5065655", "0.4973636", "0.4894359", "0.48657477", "0.4840695", "0.4831191", "0.48235258", "0.48130065", "0.48063326", "0.4801477", "0.48013815", "0.47915685", "0.479131...
0.6324812
1
Reference to or definition of a chunk name.
def addDefName( self, name ): nm= self.fullNameFor( name ) if nm is None: return None if nm[-3:] == '...': self.logger.debug( "Abbreviated reference {!r}".format(name) ) return None # first occurance is a forward reference using an abbreviation if nm not in self.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getchunk( self, name ):\n nm= self.fullNameFor( name )\n if nm in self.named:\n return self.named[nm]\n raise Error( \"Cannot resolve {!r} in {!r}\".format(name,self.named.keys()) )", "def chunkReferencedBy( self, aChunk ):\n pass", "def ref(name):\n return { 'name...
[ "0.7139771", "0.6336155", "0.60053194", "0.59572375", "0.5768719", "0.56366384", "0.56366384", "0.55626935", "0.5560077", "0.54884934", "0.5446353", "0.54315394", "0.537905", "0.5277625", "0.5265722", "0.52562416", "0.5244465", "0.51946527", "0.51554376", "0.5138958", "0.5134...
0.67194104
1
Add a named chunk to a sequence with a given name.
def addNamed( self, chunk ): self.chunkSeq.append( chunk ) chunk.web= weakref.ref(self) nm= self.addDefName( chunk.name ) if nm: # We found the full name for this chunk self.sequence += 1 chunk.seq= self.sequence chunk.fullName= nm ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_block(self, name):\n\n if not self.RE_NAME.match(name):\n raise ValueError(u\"Invalid block name '{0}'\"\n .format(common.from_utf8(name)))\n\n if name in self._block_map:\n raise ValueError(u\"Block '{0}' already exists\"\n ...
[ "0.6342812", "0.61917067", "0.59292734", "0.58930415", "0.5811522", "0.5681532", "0.5659098", "0.5562372", "0.55560243", "0.55530834", "0.55062926", "0.54970455", "0.5491927", "0.5483172", "0.54776573", "0.5448173", "0.54378843", "0.5435414", "0.53810173", "0.53810173", "0.53...
0.7867961
0
Add an output chunk to a sequence with a given name.
def addOutput( self, chunk ): self.chunkSeq.append( chunk ) chunk.web= weakref.ref(self) if chunk.name not in self.output: self.output[chunk.name] = [] self.logger.debug( "Adding chunk {!r}".format(chunk.name) ) self.sequence += 1 chunk.seq= self.sequence ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addNamed( self, chunk ):\n self.chunkSeq.append( chunk )\n chunk.web= weakref.ref(self)\n nm= self.addDefName( chunk.name )\n if nm:\n # We found the full name for this chunk\n self.sequence += 1\n chunk.seq= self.sequence\n chunk.fullName...
[ "0.6721794", "0.61601245", "0.58941776", "0.589262", "0.5759222", "0.5607351", "0.5584845", "0.5410141", "0.5382074", "0.53777474", "0.5347479", "0.5320808", "0.5307259", "0.53010094", "0.5292208", "0.52737635", "0.52660966", "0.5205945", "0.51971453", "0.5152424", "0.5122143...
0.75243074
0
Resolve "..." names into the full name.
def fullNameFor( self, name ): if name in self.named: return name if name[-3:] == '...': best= [ n for n in self.named.keys() if n.startswith( name[:-3] ) ] if len(best) > 1: raise Error("Ambiguous abbreviation {!r}, matches {!r}".format( name, lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _truncate_name(self, fullname):\n return fullname[len(self._COMMON_PREFIX):]", "def split_name(fullname):", "def prep(name):\n return ''.join(x.capitalize() for x in name.split('.'))", "def trim_name(self):\n if len(self.name) > 10:\n return self.name[0:5] + \"...\" + self.nam...
[ "0.6180963", "0.6084978", "0.60597557", "0.5775632", "0.5774311", "0.5744184", "0.5715089", "0.5700337", "0.56960976", "0.56290966", "0.5610229", "0.5592592", "0.5576869", "0.5568271", "0.55610466", "0.5550468", "0.5532822", "0.55018336", "0.54993284", "0.54890645", "0.548228...
0.6447802
0
Locate a named sequence of chunks.
def getchunk( self, name ): nm= self.fullNameFor( name ) if nm in self.named: return self.named[nm] raise Error( "Cannot resolve {!r} in {!r}".format(name,self.named.keys()) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_chunk(self, identifier):\n for i, name in enumerate(self._per_chunk_arrays[\"identifier\"]):\n if name == identifier:\n return i\n raise KeyError(f\"No chunk named {identifier}\")", "def find_next_chunk(chunks, pos, IDs):\n\n\twhile pos < len(chunks):\n\n\t\tif ch...
[ "0.65108967", "0.62340564", "0.5988239", "0.5794389", "0.56814903", "0.55038625", "0.54450536", "0.53015935", "0.5270146", "0.5238341", "0.522212", "0.5219283", "0.5171772", "0.51483303", "0.5116777", "0.51125354", "0.5092228", "0.5062849", "0.5057232", "0.50421596", "0.50196...
0.6875162
0
Construct a weaver appropriate to the document's language
def language( self, preferredWeaverClass=None ): if preferredWeaverClass: return preferredWeaverClass() self.logger.debug( "Picking a weaver based on first chunk {!r}".format(self.chunkSeq[0][:4]) ) if self.chunkSeq[0].startswith('<'): return HTML() if self.chunk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_weaver(self):\n return Weaver(self)", "def __init__(self, language):\n self.stemmer = Stemmer(language)\n self.stopwords = stopwords.words(language)", "def weave( self, aWeb, aWeaver ):\n pass", "def weave( self, aWeb, aWeaver ):\n aWeaver.docBegin( self )\n for...
[ "0.64445424", "0.57597184", "0.57572144", "0.546432", "0.54479164", "0.5322676", "0.5295758", "0.5259055", "0.51617414", "0.515024", "0.50168306", "0.4984656", "0.4954539", "0.4950529", "0.49302024", "0.49190032", "0.48912778", "0.48539847", "0.4849077", "0.4838999", "0.48371...
0.60941005
1
Indented write of a block of code. We buffer The spaces from the last line to act as the indent for the next line.
def codeBlock( self, text ): indent= self.context[-1] lines= text.split( '\n' ) if len(lines) == 1: # Fragment with no newline. self.write('{!s}{!s}'.format(self.lastIndent*' ', lines[0]) ) self.lastIndent= 0 self.fragment= True else: first...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indentOut_ (stream, indent) :\r\n if indent == 0 :\r\n return\r\n else :\r\n stream.write(\" \"*indent)", "def try_print_indent(self):\n if self.lasttoken[0] != lex.Token.NEWLINE:\n return\n\n if len(self.lasttoken[1]) > 0:\n self.buffer.scope_line(\"__...
[ "0.68247634", "0.63874", "0.6356247", "0.63065416", "0.6297472", "0.62441385", "0.60997134", "0.60862565", "0.6022048", "0.60173064", "0.59859383", "0.5901399", "0.5863994", "0.5863994", "0.58398783", "0.5802138", "0.57961035", "0.5764301", "0.5745541", "0.5736683", "0.573484...
0.7016984
0
Print rules, when error in input happened
def print_rules(len: int): print("Sorry, number must be 1 -", len) print("Please, try again...")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rules():\r\n print(\"\\n\\\r\n \\tMmmmm... Si vous etes ici, j'imagine que votre décision est prise !\\n\\\r\n Je ne veux pas vous inciter à arreter mais vous etes conscient des risques ?\\n\\\r\n Vous participez quand meme au plus grand combat de tous les temps...\\n\\n\\\r\n ...
[ "0.6269596", "0.6132856", "0.613149", "0.5906052", "0.58722514", "0.5770352", "0.5758669", "0.5726873", "0.5685006", "0.5659136", "0.56217366", "0.5592804", "0.5568407", "0.55676454", "0.55528206", "0.5505195", "0.5482991", "0.5464483", "0.54606616", "0.54484767", "0.5429036"...
0.6225298
1
Print list of algos for choice
def print_list_algos(algos:tuple): for i, name_algo in enumerate(algos): print(" {} - {}".format(i + 1, name_algo))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def algo_selection(algos: tuple):\n print_header()\n print_list_algos(algos)\n print(\"Your choice: \", end='')\n return get_num_algo(algos)", "def print_all_separation_algorithms():\n from ..separation import all_separation_algorithms\n print('\\n'.join([a.__name__ for a in all_separation_algo...
[ "0.7113152", "0.6631931", "0.6560406", "0.6387579", "0.6380716", "0.62998235", "0.6265694", "0.6151248", "0.6132113", "0.61151624", "0.6063693", "0.59754384", "0.5951185", "0.5923791", "0.59017575", "0.5898416", "0.5878082", "0.5863911", "0.5840675", "0.5830087", "0.58287996"...
0.74775124
0
Print result of calculation factorial
def print_factorial(): n = get_inp_factorial() print(n, "! = ", factorial(n), sep='')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateFactorials():\n\n ni = []\n ni.append( 295232799039604140847618609643520000000) # 34!\n ITERATIONS = 34\n for n in range( 1, ITERATIONS,1 ) :\n ni.append(math.floor(ni[n - 1] / n))\n print( \"\\n \".join([\"xi = (xi * _x) >> PRECISION;\\n res += xi * %s;\" % hex(in...
[ "0.75366306", "0.73293144", "0.73274636", "0.70425254", "0.696824", "0.69640505", "0.68932074", "0.68847483", "0.6847244", "0.6816631", "0.6782962", "0.6778154", "0.6765522", "0.6764813", "0.67584985", "0.6749305", "0.67453426", "0.6744194", "0.66936636", "0.66741717", "0.667...
0.86288625
0
Print result of calculation gcd
def print_gcd(): a = get_inp_gcd() b = get_inp_gcd('second') print(a, " gcd ", b, " = ", gcd(a,b), sep='')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(number):\n data = [int(input()) for _ in range(number)]\n frist = data[0]\n for i in range(1, len(data)):\n frist = gcd(frist, data[i])\n print(frist)", "def gcd(a, b):\n \"*** YOUR CODE HERE ***\"\n if a % b == 0:\n return b\n else:\n return gcd(b, a % b)", "...
[ "0.7250234", "0.6920517", "0.6916947", "0.67900455", "0.6760548", "0.6733919", "0.6731009", "0.67187554", "0.6713353", "0.6695791", "0.6692622", "0.6692622", "0.6692622", "0.66813034", "0.668014", "0.66777265", "0.6675309", "0.66751254", "0.6674698", "0.6674633", "0.6662182",...
0.8832617
0
Request the first step of the tour and verify that the page is accessible
def test_request_first_step(self, mock_step1_is_complete): mock_step1_is_complete.return_value = False self.tour1.load_tour_class().add_user(self.test_user) mock_request = Mock(user=self.test_user, path='mock1', method='get', GET={}) mock_view = MockView(request=mock_request) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_first_page_passes(self):\n\n self.page.open_site(PageLocators.PREVIOUS_LINK)\n self.page.fill_all_fields()\n self.page.send_the_data()", "def test_request_unrelated_page(self, mock_step1_is_complete):\n mock_step1_is_complete.return_value = False\n\n self.tour1.load_to...
[ "0.7262749", "0.71246034", "0.67988455", "0.6526447", "0.6464219", "0.64567715", "0.6447239", "0.62793964", "0.6259052", "0.6209336", "0.618921", "0.6186105", "0.61801666", "0.61722124", "0.6096324", "0.6084237", "0.6064977", "0.60643566", "0.6056941", "0.6056807", "0.6056807...
0.7130354
1
Try to access the second step of the tour before the first is complete. The user should be redirected to the first step
def test_redirect_from_future_step(self, mock_step1_is_complete): mock_step1_is_complete.return_value = False # do request to second step when we should be on first self.tour1.load_tour_class().add_user(self.test_user) mock_request = Mock(user=self.test_user, path='mock2', method='get',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tour_complete_url_redirect(self):\n # complete tour and try to go to first step\n self.tour1.load_tour_class().add_user(self.test_user)\n mock_request = Mock(user=self.test_user, path='mock1', method='get', GET={})\n mock_view = MockView(request=mock_request)\n response ...
[ "0.71386653", "0.6788929", "0.6720121", "0.66377866", "0.6624981", "0.6601757", "0.65818256", "0.6479339", "0.64065856", "0.63458556", "0.6266221", "0.6167214", "0.6161648", "0.6125044", "0.6091552", "0.6087895", "0.6087501", "0.6073683", "0.6054775", "0.5987336", "0.5967528"...
0.74684906
0
Verifies that the user can access a nontour page after finishing a tour
def test_tour_complete_unrelated_page(self): # request page that isn't in the tour when tour is complete self.tour1.load_tour_class().add_user(self.test_user) mock_request = Mock(user=self.test_user, path='mock-fake', method='get', GET={}) mock_view = MockView(request=mock_request) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_page(self):", "def test_request_unrelated_page(self, mock_step1_is_complete):\n mock_step1_is_complete.return_value = False\n\n self.tour1.load_tour_class().add_user(self.test_user)\n\n # request page that isn't in the tour before tour is complete\n mock_request = Mock(use...
[ "0.6480788", "0.6236475", "0.6183561", "0.6036716", "0.599486", "0.59612286", "0.59603775", "0.58919096", "0.5879719", "0.58759564", "0.5875776", "0.58687395", "0.58544534", "0.5798802", "0.57876796", "0.57839334", "0.5770287", "0.57272744", "0.5713692", "0.5712661", "0.57046...
0.6500204
0
Retrieves a list with all Review object of a Place.
def all_reviews(place_id): place_obj = storage.get(Place, place_id) if place_obj: review_objs = storage.all(Review).values() list_review = [] for review in review_objs: if review.place_id == place_id: list_review.append(review.to_dict()) return jsonify...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_reviews(place_id):\n place = storage.get(\"Place\", place_id)\n if place is None:\n abort(404)\n reviews = [review.to_json() for review in place.reviews]\n return jsonify(reviews)", "def get_all_reviews(place_id):\n if storage.get(Place, place_id) is None:\n abort(404)\n r...
[ "0.7854076", "0.7782599", "0.7727487", "0.75615174", "0.75514907", "0.7437615", "0.72124946", "0.71110153", "0.5831897", "0.57730174", "0.57272047", "0.5717378", "0.5560612", "0.54710424", "0.5429464", "0.5366891", "0.535534", "0.524902", "0.52319545", "0.52129847", "0.517255...
0.7865248
0
create dictionary for sparse feature
def sparseFeature(feat_name, feat_num, embed_dim=4): return {'feat_name': feat_name, 'feat_num': feat_num, 'embed_dim': embed_dim}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparseFeature(self, feat, feat_num, embed_dim=4):\n return {'feat': feat, 'feat_num': feat_num, 'embed_dim': embed_dim}", "def denseFeature(self, feat):\n return {'feat': feat}", "def featurize(vector,features):\n dictionary = collections.defaultdict(lambda:0)\n for feature in iter(set(...
[ "0.75767976", "0.68565416", "0.6779232", "0.65597075", "0.6550707", "0.6534703", "0.64986527", "0.64876294", "0.6419102", "0.6395745", "0.63638943", "0.6296161", "0.6294983", "0.6291927", "0.6231663", "0.61766374", "0.60696816", "0.602503", "0.600544", "0.5999356", "0.5997134...
0.76782995
0
Test if failing checks result in ``PostChecksFailed`` being thrown.
def test_execute_failing_checks(): port = check_tcp(port_for.select_random()) tcp_check = check_tcp(port) unix_check = check_unix('no_such_sock') http_check = check_http('http://127.0.0.1:%s' % port) with pytest.raises(PostChecksFailed): execute('sleep 10', [tcp_check], timeout=1) with...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_failed():\n assert False", "def test_state_after_failure(self):\n pass", "def test_fails(self):\n raise FoolishError(\"I am a broken test\")", "def test_xfailed_but_passed():\n pass", "def mark_all_failed(self, tests):\n for test in tests:\n self.mark_failed(test)", "...
[ "0.640206", "0.6362696", "0.6261617", "0.61857873", "0.61565363", "0.61410266", "0.61075497", "0.6089408", "0.6043655", "0.5996188", "0.5979959", "0.59671474", "0.59591275", "0.5858959", "0.58575493", "0.5826078", "0.58094466", "0.57899106", "0.5777479", "0.5760366", "0.57413...
0.6853856
0
Check the executor with the TCP check.
def test_execute_check_tcp(delay): port = port_for.select_random() check = check_tcp(port) assert check() is False process = execute( [SERVICE, '--delay', str(delay), 'tcp', '--port', str(port)], [check_tcp(port)], timeout=1 + delay) assert check() is True assert process...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check(self, target, port):\n pass", "def check_connection(self):\n pass", "def _check_connection() -> bool:\n return bool(subprocess.check_output([\"hostname\", \"-I\"]))", "async def execute_host(self):\n return True", "def check_socket(self):\n return self.__send_co...
[ "0.6482948", "0.63418156", "0.63241935", "0.60843205", "0.6009054", "0.5885951", "0.5836024", "0.583152", "0.5830039", "0.5730297", "0.571156", "0.5708676", "0.5684352", "0.5680746", "0.5675646", "0.5648467", "0.564507", "0.56379604", "0.56181026", "0.5612151", "0.56079936", ...
0.70584136
0
Check the executor with the unix socket check.
def test_execute_check_unix(tmpdir, delay): socket_file = str(tmpdir / 'temp_unix_socket') check = check_unix(socket_file) assert check() is False process = execute( [SERVICE, '--delay', str(delay), 'unix', '--socket-file', socket_file], [check_unix(socket_file)], timeout=1 + de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_socket(self):\n return self.__send_command(cmd=\"PING\")", "def do_socket_logic():\n pass", "def _check_connection() -> bool:\n return bool(subprocess.check_output([\"hostname\", \"-I\"]))", "def test_unix_socket_ping(self):\n\n self.assertEquals(\n self.scanner.ping(...
[ "0.680993", "0.66328543", "0.6490968", "0.62183565", "0.6050304", "0.6023911", "0.5981489", "0.5898802", "0.5853031", "0.58107376", "0.5792331", "0.57712764", "0.57188946", "0.5708271", "0.5700064", "0.56936115", "0.56847405", "0.5684176", "0.563219", "0.55930156", "0.5589703...
0.7271781
0
Check if the process gets killed after post checks fail. We spawn a process that listens TCP on some port and supply a failing check so that the process should get killed. We check if the process got killed by checking if nothing listens on TCP after PostChecksFailed is raised.
def test_execute_process_killed(): port = port_for.select_random() passing_check = check_tcp(port) def failing_check_for_testing_purposes(): return False with pytest.raises(PostChecksFailed) as checks_failed: execute([SERVICE, 'tcp', '--port', str(port)], [passing_check, failing_check_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _checkAlive(pid):\n try:\n os.kill(pid, 0)\n return True\n except OSError, e:\n if e.errno != 3:\n # 3 -- No such process\n raise\n return False", "def test_execute_check_tcp(delay):\n port = port_for.select_random()\n check = check_tcp(port)\n\n a...
[ "0.6068183", "0.60364044", "0.59284455", "0.5909934", "0.58762133", "0.57991844", "0.5712044", "0.5681746", "0.56672525", "0.5658492", "0.55985266", "0.55967563", "0.55466026", "0.5532438", "0.5524558", "0.54814386", "0.5475298", "0.54712796", "0.54497194", "0.54361075", "0.5...
0.7706568
0
Randomly sample a number of items.
def sample_items(num_items, shape, random_state=None): if random_state is None: random_state = np.random.RandomState() items = random_state.randint(0, num_items, shape, dtype=np.int64) return items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self, n, items_per=1, weight=False):\n if weight:\n item_count = self.item_count()\n p = self.n_per_item()\n p = p / p.sum()\n return np.array([np.random.choice(item_count, size=items_per, replace=False, p=p) for _ in range(n)])\n else:\n ...
[ "0.78438383", "0.75382847", "0.7456746", "0.7431148", "0.74077845", "0.7377601", "0.7162345", "0.7119062", "0.7116971", "0.70968103", "0.6920326", "0.6860337", "0.6814304", "0.68142647", "0.6813651", "0.68051994", "0.6754688", "0.6720068", "0.67174774", "0.6678055", "0.665967...
0.8076049
0
Given a row in the validation set Returns the list of new products purchased
def new_purchase_row(row): actual = row["products"][1:-1] # Products purchased currently actual = set([int(p.strip()) for p in actual.strip().split(",")]) liked = set([p_dict[i] for i in user_product_matrix[u_dict[row["user_id"]]].indices]) # User's purchase history new_purchase = actual - liked r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_products(self):\n logic = ProductLogic()\n \n try:\n # We create the list of product objects\n products = self.objects_factory.create_product_object_list()\n products = set(products)\n\n for product in products:\n logic.inse...
[ "0.5873067", "0.571738", "0.56618786", "0.5566095", "0.55529106", "0.55489576", "0.5546216", "0.55393046", "0.5519856", "0.5506432", "0.550334", "0.5492126", "0.54588515", "0.54461616", "0.5421328", "0.54170376", "0.5389765", "0.5385039", "0.53792316", "0.5367335", "0.5359064...
0.6946878
0
Given a row in the test dataset Returns the recall score when popular products are recommended
def popular_recommend(row): actual = new_purchase_row(row) return f1(actual, popular_products)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recallAndPrecision(self,train = None,test = None,k = 8,nitem = 10):\n train = train or self.traindata\n test = test or self.testdata\n hit = 0\n recall = 0\n precision = 0\n for user in train.keys():\n tu = test.get(user,{})\n rank = self.recomme...
[ "0.70278084", "0.6613444", "0.6551399", "0.6453224", "0.6417849", "0.63159454", "0.6313836", "0.63087803", "0.62681466", "0.62192", "0.621912", "0.61930907", "0.61916447", "0.61904746", "0.61890614", "0.61855364", "0.6154689", "0.61428875", "0.6133423", "0.6125558", "0.612443...
0.7091549
0
Copy the LICENSE and CONTRIBUTING files to each folder repo
def copy_files(self): files = ['LICENSE.md', 'CONTRIBUTING.md'] this_dir = sh.pwd().strip() for _file in files: sh.cp( '{0}/templates/{1}'.format(this_dir, _file), '{0}/'.format(self.book.textdir) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_files():\n os.makedirs('build/usr/lib/python3/dist-packages', exist_ok=True)\n os.makedirs('build/usr/share/doc', exist_ok=True)\n\n shutil.copytree('applications', 'build/usr/share/applications')\n shutil.copytree('doc', 'build/usr/share/doc/qastetray')\n shutil.copytree('icons', 'build/us...
[ "0.67750686", "0.6526642", "0.63166475", "0.6177823", "0.5975988", "0.58933765", "0.5832168", "0.58297694", "0.5803663", "0.5793631", "0.5779087", "0.57414246", "0.56831026", "0.5679935", "0.56432176", "0.5637871", "0.55825955", "0.5581191", "0.55710036", "0.5559686", "0.5546...
0.73131037
0
clearlinux test_status_nginx long analysis
def StaClrNginx(lines): if_n = True for i in lines: if i.startswith("nginx"): if "latest" in i: start = lines.index(i) while if_n: for i in lines[start:]: if i == '\n': if_n = False end = lines[start:].index(i) fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clr_from_nginx(lines):\n\n for i in lines[\n lines.index(\"[nginx] [INFO] Test clear docker image:\\n\"):\n lines.index(\"Clr-Nginx-Server\\n\")]:\n\n if i.startswith(\"Time taken for tests\"):\n num = re.findall(\"\\d+\\.?\\d*\", i)\n data.get(\"clear\")...
[ "0.67530686", "0.5581478", "0.55569434", "0.55463064", "0.5536898", "0.5477664", "0.5473989", "0.53915393", "0.53462845", "0.53239787", "0.5258147", "0.52572536", "0.5238258", "0.52312243", "0.5214133", "0.52080894", "0.5200918", "0.5190849", "0.5162434", "0.51522934", "0.512...
0.58869135
1
Find local maxima of x.
def find_maxima(x): idx = [] for i in range(len(x)): # `i` is a local maximum if the signal decreases before and after it if x[i-1] < x[i] and x[i+1] < x[i]: idx.append(i) return idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_max(x, threshold=1e-5):\n maxima = np.r_[True, x[1:] > x[:-1]] & np.r_[x[:-1] > x[1:] , True]\n # select all local maxima above the threshold\n maxima_f = maxima & np.r_[x > threshold , True][:-1]\n peak_indices = np.where(maxima_f==True)[0]\n return np.array(peak_indices)", "def local_...
[ "0.7678949", "0.7214239", "0.7185012", "0.69021314", "0.68611604", "0.6824614", "0.6649827", "0.65998054", "0.65641016", "0.6546477", "0.65399814", "0.64374244", "0.6367273", "0.6353284", "0.631738", "0.6308344", "0.630741", "0.62965506", "0.6295892", "0.62558866", "0.6236714...
0.7662323
1
Imports a nonbasis table from an existing storage, optionally making a copy
def import_table(ctx: DataFunctionContext, table_name: str, copy: bool = True): target_storage = ctx.execution_config.get_target_storage() if ensure_bool(copy): as_identifier = target_storage.get_api().get_quoted_identifier sql = f"select * from {as_identifier(table_name)}" # TODO: DRY t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_table(table: Model, directory: Path, format_: str):\n\n if directory is not None:\n print(f\" Loading {table.table_name()}...\")\n in_file = Path(directory) / f\"{table.table_name()}.{format_}\"\n dataset = tablib.Dataset(headers=table.fields()).load(in_file.read_text())\n ...
[ "0.6364539", "0.6212296", "0.605407", "0.6033501", "0.5988118", "0.5988118", "0.5988118", "0.5988118", "0.5943346", "0.5873528", "0.5857717", "0.58269125", "0.57713115", "0.5735327", "0.56870055", "0.5680715", "0.5650156", "0.56348866", "0.5625105", "0.5619889", "0.56129897",...
0.695719
0
Initialize the switch with a call forwarding dict.
def __init__(self, fritz_box, call_forwarding_dict): self.fritz_box = fritz_box self._name = "callforwarding_" + call_forwarding_dict['uid'] self.uid = call_forwarding_dict['uid'] self.from_number = call_forwarding_dict['from_number'] self.to_number = call_forwarding_dict['to_num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(self):\n logger.info(\"Turn on antenna power\")\n logger.info(\"Register on the network\")\n self.emit('provider-modified', \"Charlie Telecom\")\n self.network_strength = 100\n yield tichy.Service.get('ConfigService').wait_initialized()\n self.config_service = tic...
[ "0.6513834", "0.57745224", "0.57232344", "0.5705355", "0.5593288", "0.5584129", "0.5566516", "0.55663276", "0.5557967", "0.5470022", "0.54478216", "0.54423153", "0.5417451", "0.54033977", "0.5379578", "0.5374619", "0.5351956", "0.53446007", "0.53373575", "0.5332531", "0.53216...
0.73527163
0
Get the latest call forwarding data. from the fritz box and updates the states accordingly.
def update(self): _LOGGER.debug(self) self.enabled = self.fritz_box.get_call_forwarding_status_by_uid( self.uid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, fritz_box, call_forwarding_dict):\n self.fritz_box = fritz_box\n self._name = \"callforwarding_\" + call_forwarding_dict['uid']\n self.uid = call_forwarding_dict['uid']\n self.from_number = call_forwarding_dict['from_number']\n self.to_number = call_forwarding_...
[ "0.5749737", "0.5602729", "0.54927087", "0.5407131", "0.5386287", "0.52898836", "0.5231727", "0.51865596", "0.5180435", "0.5165107", "0.51381433", "0.5125651", "0.50870615", "0.5080835", "0.50204444", "0.50041986", "0.49914753", "0.49599847", "0.4955117", "0.49503726", "0.494...
0.59088933
0
mode = 0 x_tgt & y_tgt mode = 1 angle & thrust
def __init__(self,world,renderer,a,b,x,y,ang,mode=0): self.world = world self.renderer = renderer self.a = a self.b = b self.x = x self.x_tgt = x self.y = y self.y_tgt = y self.ang = ang self.mode = mode self.tgt = [] self.thrust_color = b2Color(1,1,1) self.__f = filter(0.9) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def faceTowards(self, target):\n current_tile = self.current_tile()\n if(target and current_tile):\n x_dist = target.coordinates()[0] - current_tile.coordinates()[0]\n if x_dist == 0: return\n self.direction_val = x_dist/abs(x_dist)\n #TEMP\n if ...
[ "0.58074385", "0.56670636", "0.5593645", "0.54760915", "0.5383447", "0.53756654", "0.52747995", "0.5171545", "0.5155141", "0.51507616", "0.51293045", "0.5126739", "0.5093914", "0.5091952", "0.50910187", "0.50761414", "0.5059055", "0.50549877", "0.5037409", "0.49967745", "0.49...
0.6098984
0
Callback indicating 'shape' has been destroyed.
def ShapeDestroyed(self, shape): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ShapeDestroyed(self, shape):\n pass", "def delete_current_shape(self):\n print(\"deleting shape!\")\n self.shapes.remove(self.current_shape)\n self.current_shape = None\n self.changed()", "def post_destroy(self) -> Any:\n raise NotImplementedError", "def JointDes...
[ "0.8936617", "0.677599", "0.6400013", "0.62246126", "0.6187558", "0.6068861", "0.60077256", "0.5915243", "0.58883876", "0.5834766", "0.5834766", "0.5834766", "0.5813332", "0.5719726", "0.5717646", "0.57106745", "0.5667033", "0.5646025", "0.5643462", "0.5643462", "0.5621436", ...
0.89042366
1
The joint passed in was removed.
def JointDestroyed(self, joint): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeJoint(*args, **kwargs)->None:\n pass", "def JointDestroyed(self, joint):\n pass", "def remove(self):", "def remove():", "def remove_from_hand(self):\n pass", "def _remove(self):\n pass", "def onRemove(self):\n pass", "def onRemove(self):\n pass", "def...
[ "0.7548681", "0.74015814", "0.645605", "0.6300041", "0.6299409", "0.629904", "0.6204131", "0.6204131", "0.6200909", "0.6200909", "0.6200909", "0.6083092", "0.6075515", "0.6054907", "0.60298604", "0.60298604", "0.60108083", "0.5999404", "0.5980105", "0.596141", "0.59600955", ...
0.7508697
1
Return a randomly initialized hidden state tuple (h, pred, gamma)
def init_state(self, dtype=torch.float32): device = self.device batch_size, K = self.batch_size, self.k # initialize h, the latent representation of each object h = self.inner_rnn.init_hidden() * self.pred_init # initialize pred, the (predicted) true assignment of pixels to objects pred = torch.ones(batc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state():\n global HMC_MOM\n return dict(randstate = np.random.get_state(),\n mom = HMC_MOM)", "def init_hidden(self):\n h0 = torch.zeros(self.num_layers, self.batch_size, self.hidden_size)\n\n return h0 # a parameter tensor of shape (self.num_layers, self.batch_size, s...
[ "0.6693352", "0.66885066", "0.6587457", "0.64796203", "0.64765036", "0.6470142", "0.64501524", "0.64501524", "0.64501524", "0.64199156", "0.6403299", "0.6353586", "0.63429105", "0.63362277", "0.6321232", "0.6236399", "0.6206321", "0.6193823", "0.616901", "0.6150956", "0.61509...
0.71353424
0
Mask the deltas (inputs to RNN) by gamma.
def mask_rnn_inputs(rnn_inputs, gamma): with torch.no_grad(): return rnn_inputs * gamma
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gamma(x):\n return 0.0", "def adjust_gamma(self, gamma=0.2) -> tf.Tensor:\n return tf.image.adjust_gamma(self.__frame, gamma=gamma)", "def get_gamma(self, conv_op):", "def do_gamma(im, gamma):\n invert_gamma = 1.0/gamma\n lut = [pow(x/255., invert_gamma) * 255 for x in range(256)]\n ...
[ "0.612627", "0.6109286", "0.59599155", "0.57921124", "0.57131845", "0.5633414", "0.5604647", "0.5568428", "0.5559372", "0.5558149", "0.5533756", "0.5527908", "0.5523864", "0.55182123", "0.5515028", "0.5480828", "0.547778", "0.5454534", "0.5419308", "0.54146713", "0.5411526", ...
0.7495983
0
Action where you create or Update Model _create_booking() returns a model. We can add historio decorator to handle that See it right below this function
def post(self, request): # FIRST EXAMPLE model = self._create_booking( request=request) # when _create_booking is invoked, historio Client will log model print('save me')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_another_try(self, request): # SECOND EXAMPLE\n model = self.create_booking(request)\n client.historio().push(model, get_current_user_id(), source='assignment', source_id=model.id) # Magic happens\n # Magic is done", "def create(self, validated_data):\n print(validated_data)...
[ "0.7032513", "0.6825753", "0.6820478", "0.62710077", "0.60713017", "0.59598875", "0.5915322", "0.57126015", "0.56991667", "0.5680557", "0.56531405", "0.56520903", "0.5638487", "0.5618415", "0.56057376", "0.55965275", "0.5590912", "0.55892134", "0.558654", "0.5549879", "0.5548...
0.78649503
0
Get a well depth image
def get_well_depth_image(self): rampTime = self.result['information']['exposure_specification']['saturation_time'] wellFrac = rampTime * self.result['2d']['detector'] / self.fullWell return wellFrac
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_depth(self):\n # s = openni2.wait_for_any_stream([self.depth_stream], timeout)\n # if not s:\n # return None\n # read raw uint16 buffer\n im_arr = self.depth_stream.read_frame()\n raw_buf = im_arr.get_buffer_as_uint16()\n depth_im = np.ctypeslib.as_arr...
[ "0.6859134", "0.65594554", "0.6558706", "0.6420417", "0.63676494", "0.62721646", "0.62613726", "0.6223145", "0.61949664", "0.6191375", "0.6187337", "0.61710435", "0.6148395", "0.6131912", "0.6110834", "0.607519", "0.60261285", "0.59605414", "0.5945699", "0.5894582", "0.588431...
0.70779955
0
Plots the well depth as an image
def plot_well_depth(self): fig, ax = plt.subplots() imMap = ax.imshow(self.get_well_depth_image()) ax.set_title('Well Fraction Map Map') ax.set_xlabel('x') ax.set_ylabel('y') ## Adjust colorbar height to match image divider = make_axes_locatable(ax) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imshow(self, depth):\n layer = self.cube[depth]\n img = []\n for i in range(self.height):\n img.append([layer[i][j].value for j in range(self.width)])\n plt.imshow(img, cmap='gray')\n plt.show()", "def show_env(self, img):\n plt.figure(1)\n plt.subp...
[ "0.6890835", "0.631568", "0.6291359", "0.6251586", "0.6086468", "0.6082406", "0.6080805", "0.6060301", "0.6010916", "0.5977158", "0.594544", "0.5944186", "0.5940843", "0.5936658", "0.5936658", "0.5936658", "0.5919045", "0.5889547", "0.58857036", "0.5878687", "0.5876722", "0...
0.77049667
0
Print the maximum well depth
def max_well(self): maxVal = np.max(self.get_well_depth_image()) return maxVal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_depth(self) -> int:\n return pulumi.get(self, \"max_depth\")", "def depth(self):\n return self._max_depth", "def max_depth(self) -> int:\n return 0", "def well_depth(self):\n pass", "def well_depth(self):\n return self.well.well_depth if self.well is not None else...
[ "0.7114265", "0.70133674", "0.70054543", "0.6930168", "0.68504864", "0.6815906", "0.6747816", "0.6735769", "0.66701", "0.65934503", "0.65464044", "0.65301305", "0.6522725", "0.6513898", "0.6355805", "0.63549274", "0.6348783", "0.6279597", "0.6252909", "0.6245764", "0.6213553"...
0.7055147
1
Plots the relative source & Background
def relative_src_bg(self): fig, ax = plt.subplots() for oneF in ['extracted_flux','extracted_bg_only']: wave, f = self.result['1d'][oneF] ax.plot(wave,f,label=oneF) ax.set_xlabel('Wavelength ($\mu$m)') ax.set_ylabel('Extracted Flux') ax.legend() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self):\n pass", "def plot(self):\n\t\tself.plotOfHeatingCurrent().plot()", "def plot(self):\n self.fig = plt.figure('black hole')\n self.fig.clf() #clear the graph to avoir superposing data from the same set (can be deactivated if need to superpose)\n self.ax = plt.subplot(...
[ "0.6413937", "0.6269368", "0.6122467", "0.6099308", "0.60706174", "0.60680187", "0.60364425", "0.5992031", "0.5959539", "0.5938293", "0.59330904", "0.59280694", "0.5895852", "0.5856785", "0.585669", "0.5846457", "0.5831524", "0.57738036", "0.574161", "0.5738201", "0.5729924",...
0.79061544
0
Make csv files (easier to version control) from excel
def make_csvs(): for oneFile in glob.glob('excel/*.xlsx'): pd = pandas.read_excel(oneFile) outName = os.path.splitext(os.path.basename(oneFile))[0] pd.to_csv('lists/'+outName+'.csv',index=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createcsv(fileName):\n fileName = os.path.join(pathtofolder(), 'datas', fileName)\n fileFormat = '.csv'\n file = f'{fileName + fileFormat}'\n\n csvKeys = [\"product_page_url\", \"universal_product_code\", \"title\",\n \"price_including_tax\", \"price_excluding_tax\", \"number_availabl...
[ "0.6876425", "0.6483974", "0.6378336", "0.6334687", "0.6328035", "0.61611235", "0.6154112", "0.61515933", "0.61508274", "0.6127183", "0.61262995", "0.6109654", "0.6075876", "0.60740983", "0.6061256", "0.60461193", "0.60273874", "0.6001203", "0.59970677", "0.59532243", "0.5947...
0.6674022
1