query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c73d7cd464aed602cee2f59592fdf968
Looks for allocations made within the current element and declares them all at once.
[ { "docid": "d93c02f04f3fc52c8ae6861292124c81", "score": "0.0", "text": "def _writeAllocations( self, element, implicitsOnly=False ):\n\t\t# FIXME: assert(element.dataflow) fails sometimes\n\t\tif element and element.dataflow:\n\t\t\t# NOTE: Implicits can sometimes be declared twice\n\t\t\tdeclared = {}\...
[ { "docid": "2dd29c606647048c35bc68cae3a29e72", "score": "0.60576046", "text": "def allocate(self):\n self.allocatables.sort(key=lambda a: len(a.constraint), reverse=True)\n allocatable = self.allocatables.pop()\n for cn in allocatable.constraint:\n if self.slots[cn] == -1:\n self.sl...
4dd26934f63cb73e0462327ec2c1167f
SetMaskImage(itkConnectedComponentImageFilterIUC3ISS3 self, itkImageUC3 _arg)
[ { "docid": "1a128a54e47001e0f8c40bd4b686b2b3", "score": "0.90249586", "text": "def SetMaskImage(self, _arg: 'itkImageUC3') -> \"void\":\n return _itkConnectedComponentImageFilterPython.itkConnectedComponentImageFilterIUC3ISS3_SetMaskImage(self, _arg)", "title": "" } ]
[ { "docid": "b21a7e333812da8cfb63704eebc66c7e", "score": "0.90715206", "text": "def SetMaskImage(self, _arg: 'itkImageUC3') -> \"void\":\n return _itkConnectedComponentImageFilterPython.itkConnectedComponentImageFilterIUC3IUL3_SetMaskImage(self, _arg)", "title": "" }, { "docid": "d2cbe...
3dbbe677964b2d559e3a5f88e09f0174
The default IPv4 gateway for the user plane interface. This should match one of the interfaces configured on your Azure Stack Edge device.
[ { "docid": "24aeb0ea7fe7434db5953e53bc3c1f16", "score": "0.73977745", "text": "def user_plane_access_ipv4_gateway(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"user_plane_access_ipv4_gateway\")", "title": "" } ]
[ { "docid": "94daa44747249a6620cb9ce4735d3dc6", "score": "0.74860233", "text": "def user_plane_access_ipv4_gateway(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_plane_access_ipv4_gateway\")", "title": "" }, { "docid": "94daa44747249a6620cb9ce4735d3dc6", "sc...
7d793c2aaa9fc460d44b0b5ee6dc5fd8
Calculates the accuracy of prediction methods for the grouped evaluation problem. Only counts those predictions that have all groups correct in a predicted groupings. Ignores any partial correctness.
[ { "docid": "f34a4b76e309f215ed7a616666afd354", "score": "0.7314673", "text": "def calculateAccuracy(self, results, dataSet):\n\t\tmatch = 0\n\t\tfor key in dataSet.keys():\n\t\t\tpredictedSenseGroups = results[key]\n\t\t\t# Examples are in order so split into group size to find groups \n\t\t\torderedExa...
[ { "docid": "0d4bfdaa5c68857e9cc98002b314587a", "score": "0.7493893", "text": "def accuracy(self):\n # Initialize key variables\n correct = {}\n prediction = 0\n cls_count = {}\n accuracy = {}\n\n # Analyze all the data\n for cls in self.pca_object.classes...
1a7d7436bc50e8f0af440046d0fba746
Returns the monospaced terminal display width of char.
[ { "docid": "380e4c610a6f1598c0941077b73c4267", "score": "0.7959377", "text": "def GetCharacterDisplayWidth(char):\n if not isinstance(char, unicode):\n # Non-unicode chars have width 1. Don't use this function on control chars.\n return 1\n\n # Normalize to avoid special cases.\n char = unicode...
[ { "docid": "da032b13152348ef195466b6f5f197a3", "score": "0.7047037", "text": "def DisplayWidth(self, buf):\n if not isinstance(buf, basestring):\n # Handle non-string objects like Colorizer().\n return len(buf)\n width = 0\n i = 0\n while i < len(buf):\n if self._csi and buf[i...
14ae8c9a0de3273ad2cc6908a0638b97
full path of file in same dir as this module
[ { "docid": "7241ece943ecf2933e26465a63cbc2b5", "score": "0.0", "text": "def output_file(filename):\n return os.path.join(base_dir(), \"output\", filename)", "title": "" } ]
[ { "docid": "7e4bdee811f8cd82d52a6ce59bc3cac9", "score": "0.8570931", "text": "def getFilepath(self):\n return os.path.join(self.getModuleDir(), *(self.name().split('/')))", "title": "" }, { "docid": "db89b52e56bf59ce28b7546606fd8c1e", "score": "0.7867944", "text": "def module_...
e8d87379e0b817bb4911cc5b1c034938
Function called when the value must be an integer.
[ { "docid": "a719345e77eb61920c2033337574f159", "score": "0.0", "text": "def checking_value(value):\n if user_language[0] == \"fr\":\n prb_text = \"La durée doit être un nombre entier.\"\n ok_text = \"La durée a bien été modifiée.\"\n\n else: #user_language[0] == \"en\":\n prb_...
[ { "docid": "77a2a671d460d73c24d10626bc3aea3a", "score": "0.78474224", "text": "def isInteger(self):", "title": "" }, { "docid": "77a2a671d460d73c24d10626bc3aea3a", "score": "0.78474224", "text": "def isInteger(self):", "title": "" }, { "docid": "77a2a671d460d73c24d10626bc...
81d4e11178365569ca0b96520a3dfa26
Since this view will only be used by admin, just get the whole list of attendees
[ { "docid": "83ae6a1f32ba50996ae2b9b33fd5ce4c", "score": "0.60177976", "text": "def attendee_collection(self):\n return CourseAttendeeCollection(self.request.session)", "title": "" } ]
[ { "docid": "c00c53b34d7111218c8a2117bdcc1180", "score": "0.65361494", "text": "def list(self):\n return self._list(\"/tenants\", \"tenants\")", "title": "" }, { "docid": "b13fbed2332f686985f5e76691651a63", "score": "0.60792476", "text": "def get_admins(self):\n response...
102470a2cbd8a8384dfb0744ab966f09
Returns ``True`` if the current node does not have any siblings.
[ { "docid": "00c7acd158b6d7a7e0a1deead49129f5", "score": "0.0", "text": "def is_single_child(context: TreeContext) -> bool:\n return len(context[-2]._children) == 1", "title": "" } ]
[ { "docid": "2b2207a21da8511908fb1ad60ade9e26", "score": "0.7273685", "text": "def isSiblingOf(self, node):\n return (self in node.siblings())", "title": "" }, { "docid": "d2491c3b0f2a6d54ff005364b5d1a2dd", "score": "0.7044521", "text": "def is_root(self):\n return not s...
04fa42307f6d0531171fdaf923a417ac
add column with percent of each race in geographical region
[ { "docid": "90c97e2ddff3407a870a2e2fd54867e3", "score": "0.717701", "text": "def compute_percent_each_race(self, df):\n percent_black = round(\n (df.loc[:, 'Estimate!!Total:!!Not Hispanic or Latino:!!Black or African American alone']\n / df.loc[:, 'Estimate!!Total:']) * 100,...
[ { "docid": "d6e97377f59a15631938157378aa7106", "score": "0.6053051", "text": "def percentage(municipalities, year, parties, input):\n\n for row in range(len(input)):\n if row != 0:\n # check if the municipality existed in 2017\n if input.loc[row, 'RegioNaam'] in municipal...
3c9f776ede826eb32d3f3263d1126199
Get the single matching Country's ISO31662 code from a partial name.
[ { "docid": "7330db2871d6aa4b548ed4c6dda5f2dc", "score": "0.70137024", "text": "def getISO3166Code(self, countryName):\n logger.debug(f\"Getting country code for {countryName}\")\n # workaround a common problem: \"United States\" is the Mapbox name for US, but the algorithm\n # below...
[ { "docid": "ab0b971edb8cd06feb6bb4c5ab5e70da", "score": "0.7358333", "text": "def get_country_code_alpha_3(name):\n for co in pc.countries:\n if name == 'XXX':\n return 'XXX'\n if name in co.alpha_2:\n return co.alpha_3\n return 'XXX'", "title": "" }, { ...
2507fb0156b112837b29dfc6d8f88fb9
Return dict of key/value pairs vs. list of key/values dicts.
[ { "docid": "894e77ddacf4f1ae3f5e7a164877e7a2", "score": "0.0", "text": "def get_tag_dict_for_resource(self, arn: str) -> Dict[str, str]:\n result = {}\n if self.has_tags(arn):\n for key, val in self.tags[arn].items():\n result[key] = val\n return result # ...
[ { "docid": "cd12463d85324a2d7adbeaab7ab1b347", "score": "0.6692818", "text": "def get_dicts(self) -> List[Dict]:\n return deepcopy(self.value.dicts)", "title": "" }, { "docid": "af9a8f1e84754210a207676b1019ed6c", "score": "0.63920045", "text": "def list_of_dicts_gen_singleval(...
2441abb23bc7ca6c80f06ed0f1e59133
Subclassed by implementor to react to the ball being completely over automatically invoked by end_ball(). At this point the ball is over
[ { "docid": "a35f042629cafca6e894e2ee30de33ac", "score": "0.6899138", "text": "def ball_ended(self):\n self.log(\"Skel: BALL ENDED\")\n\n # turn off the flippers\n self.enable_flippers(False)\n # self.enable_alphanumeric_flippers(False)\n if(self.use_ballsearch_mode):\n...
[ { "docid": "3e6fea8386528e150f2c5d464b07144a", "score": "0.70871973", "text": "def updateBall(self):\n \n self._ball.moveBall(self._paddle.collides(self._ball),\\\n self.collisionWithBricks())\n self._offScreen = self._ball.checkOffScreen()", "title": ...
a53f33dc7e4342805ba6d0e3d6122bd4
Create the config and optionally a htdigest file
[ { "docid": "bbb350e8c0d33e081ef6e2150de58605", "score": "0.70987415", "text": "def trac_config_create(adminuser, adminpass, realm, digestfile, trac_ini):\n config_str = ''\n config_str += BASE_CONFIG\n \n htdigest_create(digestfile, adminuser, realm, adminpass)\n # adding appropriate conf...
[ { "docid": "a74ae68dbc7a73070c813da713290bcf", "score": "0.67188954", "text": "def generate_config(config):\n config['HASHBENCH'] = {'location_john': './john/run/john',\n 'location_hashcat': './hashcat/hashcat'}\n with open(\"hashbench.conf\", \"w\") as configuration_file...
76f1e124c63d081a7ac8be64e178f2f8
Loads the grid profile required for the run.
[ { "docid": "d74062a4691924661853becce801b7e2", "score": "0.67323035", "text": "def load_grid_profile(\n auto_generated_files_directory: str, logger: Logger, scenario: Scenario\n) -> Optional[pd.DataFrame]:\n\n grid_profile: Optional[pd.DataFrame] = None\n if scenario.grid:\n try:\n ...
[ { "docid": "a9fef0df39a0ea62e69b7433b2580ad4", "score": "0.6204795", "text": "def test_profile_loading(self):\n self.click('empty_profile')\n self.find('no_plugins_enabled')\n\n self.click('owasp_top_10')\n self.find('audit_plugins_enabled')\n\n self.click('empty_profi...
6deaeac49a5e00cf85b672ee7e6c9014
Test serialization/deserialization for CreatePeerBodyStorage
[ { "docid": "0eb0102d88ceb9abf14e0f30a62bd4bc", "score": "0.8516777", "text": "def test_create_peer_body_storage_serialization(self):\n\n # Construct dict forms of any model objects needed in order to build this model.\n\n storage_object_model = {} # StorageObject\n storage_object_mo...
[ { "docid": "4a37b93496932e4910b45d05b5ebc111", "score": "0.7728197", "text": "def test_peer_response_storage_serialization(self):\n\n # Construct dict forms of any model objects needed in order to build this model.\n\n storage_object_model = {} # StorageObject\n storage_object_model...
db63fbbf0ad44a9f2cdc9d0ff9e6bcac
return a directory path
[ { "docid": "05b8149e481899b172e6077f2c01d5a0", "score": "0.6978848", "text": "def get_dir(path):\n return Dirpath.get_instance(path)", "title": "" } ]
[ { "docid": "3deae8a2787265d785ffa279f672b4d5", "score": "0.8039122", "text": "def dirPath(self):\n\t\treturn os.path.dirname( self.path ) + '/'", "title": "" }, { "docid": "21032099a19e8ee44262d34373fb2be1", "score": "0.7886094", "text": "def get_directory_path(self):\n return...
6155a505416f858b45399811e7f617f1
Instantiate RequestFactory and User objects to pass POST requests to the TripCreate view.
[ { "docid": "15690371abf4a887ae5e3b44df8eb149", "score": "0.5762043", "text": "def setUp(self):\n self.factory = RequestFactory()\n self.user = User.objects.create(username='Abdullah',\n email='abd@gmail.com',\n p...
[ { "docid": "59a348e0c16bfb59d077cf3914961971", "score": "0.6906684", "text": "def setUp(self):\n self.factory = RequestFactory()\n self.user = User.objects.create(username='Abdullah',\n email='abd@gmail.com',\n p...
c691eca7ff52e62e7604da056a14a9d9
Load a jpeg file and return a numpy array
[ { "docid": "b68780fd1872766229f304d6227d324d", "score": "0.84246373", "text": "def load_jpeg(path_to_image, jpeg_file):\n jpeg_img = Image.open(os.path.join(path_to_image, jpeg_file))\n return np.array(jpeg_img)", "title": "" } ]
[ { "docid": "d65110329748b38ae8ef93b25a9cd423", "score": "0.81133324", "text": "def load_image(filename):\n im = Image.open(filename)\n return np.array(im)", "title": "" }, { "docid": "ff4b677912360981dede603dbda45afa", "score": "0.7762997", "text": "def load_image(path: str) ->...
28746434125195c7f3b81818344debe7
change the image for better generalization Add rotation Add translation
[ { "docid": "53e7a6f6e35b21cffcef47162f10178b", "score": "0.0", "text": "def data_oversampling_pipe(image, random_factor=False):\n if random_factor:\n flip = 1 if random.randint(0, 1) == 1 else -1\n r = random.random() * flip\n else:\n r = 1\n # rotation\n img = rotate_im...
[ { "docid": "61b489a5f85b9c63ab37d3f7fd126d12", "score": "0.7310402", "text": "def update_rotation_img(self, context):\n \n cobj = get_object(context, self.lightname)\n world = context.scene.world\n mapping = world.node_tree.nodes['Mapping']\n mapping2 = world.node_tree.nodes['Mapping.001'...
689d8416058a63d1dcb4dbdd8f2aebc1
Testing method / function web_api_server_url.
[ { "docid": "fefd3ea03d8f2ac053ca194123e0231a", "score": "0.82735455", "text": "def test_web_api_server_url(self):\n # Test\n result = self.config.web_api_server_url()\n self.assertEqual(\n result, 'http://127.0.0.12:50002/pattoo/api/v1/web/graphql')", "title": "" } ...
[ { "docid": "5d74342a9b7d8ad0bdf95cb6885454b8", "score": "0.7382157", "text": "def test_agent_api_server_url(self):\n # Initialize key values\n expected = 'http://127.0.0.11:50001/pattoo/api/v1/agent/receive/123'\n agent_id = 123\n\n # Test\n result = self.config.agent_...
6bf40afc0ad695debed41ec389d22c30
Creates matrix from carla transform.
[ { "docid": "379c79bcf651de3bc7d9d15fab44eb67", "score": "0.57375145", "text": "def get_matrix(transform):\n\n rotation = transform.rotation\n location = transform.location\n c_y = np.cos(np.radians(rotation.yaw))\n s_y = np.sin(np.radians(rotation.yaw))\n c_r = np.cos(...
[ { "docid": "1c170c6319c966afb4509a550815648f", "score": "0.69329536", "text": "def makeMatrix(self, transformation):\n m = mathutils.Matrix()\n (m[0][0], m[0][1], m[0][2], m[0][3], m[1][0], m[1][1], m[1][2], m[1][3], \n m[2][0], m[2][1], m[2][2], m[2][3], m[3][0], m[3][1], m[3][2], m[3][3]) = ...
cdd4fef4ac17a7d633fd81329cd1d45b
load spectra from raw file
[ { "docid": "5e40777ede40d2fcc25c75608bbbccf4", "score": "0.61535674", "text": "def load_spec_file(self, filename, load_to_ram=False):\r\n self.type = 'spec'\r\n\r\n self.f = netCDF4.Dataset(filename, 'r')\r\n print('keys ', self.f.variables.keys())\r\n\r\n self.timestamps = s...
[ { "docid": "71fb37fa0e0483864f730fc4934bbd94", "score": "0.73631144", "text": "def loadSpectra(self, path):\n if type(path) is not str:\n raise TypeError(\"path argument is not a string.\")\n foundBackground = False\n doGetWaveLength = False\n foundFiles = []\n ...
d28270e8adc9d043239caf4a1c9fb088
Gets player ready to take a turn
[ { "docid": "d99491b0ec7ec3919a427f9d9d069418", "score": "0.68041337", "text": "def takeTurn(self):\n # PUTTING IN A TEMPORARY FIX\n for player in self.world.getPlayerList():\n if player.showhandbutton['state'] == NORMAL:\n print('Not ' + self.name + \"'s turn yet\...
[ { "docid": "d1e68be4f905ec1aa1a1a1ce3372e8e0", "score": "0.69901085", "text": "def play_turn(self):\n pass", "title": "" }, { "docid": "f7614474157def4ed5a856906b2f3919", "score": "0.683937", "text": "def passes_turn(self) -> Player:\n self.players.current_player.my_tur...
d90f519778af27fa3f96cd02ff606899
Get adresse from coordinates
[ { "docid": "d45fdc976395b175215ebb8584f0f811", "score": "0.72789454", "text": "def get_adress(x, y):\n url = str((\"http://api-adresse.data.gouv.fr/reverse/?lon=\" + str(x) + \"&lat=\" + str(y)))\n headers = {\"Content-Type\": \"application/json\"}\n r = requests.get(url, headers=headers, data=...
[ { "docid": "46e5221e9cd0da12a88540f87d3dd5e7", "score": "0.7197132", "text": "def get_address(coordinates):\n locator = Nominatim(user_agent=\"myGeocoder\")\n location = locator.reverse(coordinates)\n locate = location.address.split(',')\n len_location = len(locate)\n address = locate[0] ...
0b92e07bb768414209e0068aaf7f76b2
Internal helper. Returns the salted/hashed password using the argon2id13 algorithm. The return value is base64encoded.
[ { "docid": "b155daf89bcf2e57ce6d536af0ce830c", "score": "0.6997533", "text": "def _hash_argon2id13_secret(password, salt, iterations, memory):\n rawhash = hash_secret(\n secret=password,\n salt=base64.b64decode(salt),\n time_cost=iterations,\n memory_cost=memory,\n ...
[ { "docid": "fcbd677c75f3a83a7652200df41e7426", "score": "0.7048091", "text": "def gen_base64_passwd(length):\n return base64.b64encode(gen_passwd(length))", "title": "" }, { "docid": "cbb6a3aea458d4eb72a3574953c347c5", "score": "0.68947244", "text": "def _get_hashed_pw(self, pw: s...
5616d56f5b345b2ed8fc300ef20417a9
Accuracy as a function of the height of class' the lowest common ancestor. This is only applicable to 2way ImageNet episodes. Given the class set of each episode, we find the corresponding 2 leaves of the ImageNet graph and compute the lowest common ancestor of those leaves. Its height is computed as the maximum over t...
[ { "docid": "e611c854613c936284707eee19c54e54", "score": "0.532225", "text": "def get_height_to_accuracy(class_ids, logits, targets):\n height_to_accuracy = collections.defaultdict(list)\n for episode_num, episode_class_ids in enumerate(class_ids):\n if len(episode_class_ids) != 2:\n raise Valu...
[ { "docid": "2b98e5a25740fc9c70b1d02b642706e3", "score": "0.57431614", "text": "def optimum(self):\n return self.accuracy(self.classify)", "title": "" }, { "docid": "9764555874146dc2da06586bad0d1fb3", "score": "0.57204765", "text": "def get_best_accuracy(self) -> float:\n ...
5ff149adf70930497f1654028eafdbf5
Load up and normalize the data
[ { "docid": "21359bbcda5ebf7e576f3ce55127b9da", "score": "0.0", "text": "def load_data(infile_counts, infile_seqs, infile_total_reads):\n\n # Load up the counts mapping to each gene\n df_counts = pd.read_csv(infile_counts, sep = \",\", index_col=0)\n df_counts[\"name\"] = df_counts.index\n # ...
[ { "docid": "9b51362af4fa34926dd3979d119cd9ce", "score": "0.69728583", "text": "def load_data(self):", "title": "" }, { "docid": "4c5734a2335ef562a6894d5a7730397c", "score": "0.6786813", "text": "def load_data(self):\n self.dataset, self.info = DataLoader()\n self._prepr...
8c7e27b74fb3c9a67ed9ef8289982f49
Convert a string into a slug, such as what is used for entity ids.
[ { "docid": "6e4d7635c0970f0453063ba140efb493", "score": "0.6548574", "text": "def slugify(value, separator=\"_\"):\n return slugify_util(value, separator=separator)", "title": "" } ]
[ { "docid": "ea58bb1b6b657f83082acb78fd78913c", "score": "0.84102273", "text": "def to_slug(string):\n return string.replace(' ', '-').lower()", "title": "" }, { "docid": "1eb8f3ccb75563fd56cdd52615dfeb18", "score": "0.82447875", "text": "def create_slug(string):\n output = ...
e89be0eb7eb2b4e6fb6a949ba47ad99e
Check the given kind is of our type.
[ { "docid": "640d7d9074cbae98b60f03e272a6fc59", "score": "0.7642859", "text": "def match(cls, kind: 'dsl.Any') -> bool:\n return isinstance(kind, cls)", "title": "" } ]
[ { "docid": "c11b585ca9647e51a22fc6a9c1ce9840", "score": "0.7114784", "text": "def verify_type(self, obj):\n return isinstance(obj, self.type_)", "title": "" }, { "docid": "fe57552b29789df749ffecff55d4755a", "score": "0.69722956", "text": "def CheckType(self, *args, **kwargs):\...
3890b2352dbe58ac483e3d71788032f3
reset the iterator to the starting position
[ { "docid": "83ce75be55bd351ece23d309076c9b98", "score": "0.6484919", "text": "def rewind(self):\n # virtual bool rewind() = 0;\n if self._index < 0:\n return False\n self._index = 0\n return True", "title": "" } ]
[ { "docid": "ee8d71f0cc8808c5655c458dd3186ec5", "score": "0.7686198", "text": "def reset_curr_iter(self):\n self.curr_iter = 0", "title": "" }, { "docid": "cc422a19bfebbcf07f078fba564b26b2", "score": "0.7562216", "text": "def reset(self):\n self.iterable = self._iterate(...
01b117fec804d3ca4610422e1eefe55a
Launch djv_view. If path is specified and is a file, automatically load sequence. If path is a directory, start in that directory. If path is not specified, use shot directory.
[ { "docid": "40c4bac34994153aece947f111717519", "score": "0.7444207", "text": "def viewer(path=None):\n\t# Get starting directory\n\tstartupDir = os.environ['IC_SHOTPATH']\n\tpathIsFile = False\n\tif path is not None:\n\t\tif os.path.isfile(path):\n\t\t\tstartupDir = os.path.dirname(path)\n\t\t\tpathIsFi...
[ { "docid": "1ec470864416f9fe138c2513231647fc", "score": "0.6450935", "text": "def run(self, path, frameRanges, views, options):\n ...", "title": "" }, { "docid": "55571b58c4c6de83a726f97a9e9b8494", "score": "0.58631945", "text": "def run_frame(path):\n\n if not os.path.exis...
2633d44d1e5945a959b683e89ab3b53b
Transformation from abc representation to alphabeta representation
[ { "docid": "32adbf73832c443e858889e2a3816596", "score": "0.0", "text": "def t_23(quantities):\r\n return np.matmul(SynchronousMotor._t23, quantities)", "title": "" } ]
[ { "docid": "d0a85869f5b35dd44b3379dd290b2997", "score": "0.7189133", "text": "def aa_alphabet():\n abc = ['G', 'A', 'S', 'P', 'V', 'T', 'C', 'I', 'L', 'N', 'D', 'K', 'Q', 'E', 'M', 'H', 'F', 'R', 'Y', 'W']\n return abc", "title": "" }, { "docid": "db0ccd77914199a84a06ac22acc30abf", ...
596a49e2f1dddcc2a18c5e3d2fc6d484
r"""Converts `hparams` value into a list.
[ { "docid": "1b0dd68ab6f3b90b382f12a234e76abd", "score": "0.7053691", "text": "def _to_list(value: Union[Dict[str, Any], List, Tuple, int], name=None,\n list_length=None):\n if not isinstance(value, (list, tuple)):\n if list_length is not None:\n value = [value] * list_le...
[ { "docid": "b272f8df421d7be9da3b018912810091", "score": "0.6540132", "text": "def params_to_lists(params):\n if type(params) != list: raise TypeError('Incorrect data type: function params_to_list needs a list of dictionaries.')\n listofparams = [params[0]['yoffset']] # yoffset should be the same f...
e6f61daa42d943e628e298f7eedecfb5
Provides operations to call the getSkypeForBusinessParticipantActivityCounts method.
[ { "docid": "ec1fbabf6807349ca4bbe6b52ace4c0d", "score": "0.5942781", "text": "def get_skype_for_business_participant_activity_counts_with_period(self,period: Optional[str] = None) -> GetSkypeForBusinessParticipantActivityCountsWithPeriodRequestBuilder:\n if not period:\n raise TypeErro...
[ { "docid": "e3de64b0950a51dd41c9c6e704e9d55e", "score": "0.7065211", "text": "def get_skype_for_business_participant_activity_user_counts(\n self,\n period, # type: str\n **kwargs # type: Any\n ):\n # type: (...) -> \"models.MicrosoftGraphReport\"\n cls = kwargs.p...
02e9133c95aad92f77f0ce8497ed635f
fetches information on an order made by the user
[ { "docid": "141cf78b75f4717d3bc7b295de24de6c", "score": "0.558745", "text": "async def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):\n await self.load_markets()\n request = {\n 'id': id,\n }\n response = await self.privateGetOrdersGet(self.ex...
[ { "docid": "18a3fdbfa52c87f6e8bea5267f659b91", "score": "0.7255066", "text": "def get_order(order_id): # pragma: no cover", "title": "" }, { "docid": "86c184f294a199dc763577326206317c", "score": "0.69069827", "text": "def on_retrieve_order(self, order_id, context=None):\n pas...
f519c5e185687bcd8c9aae2adddd9e02
Check if the current session was created using an appropriate authentication type (e.g. "login" or "apikey"), the argument is a whitelist (string or list object) of acceptable authentication types.
[ { "docid": "cf4ff46866f52ea92df38ab4a2b3fd55", "score": "0.6155261", "text": "def authentication_type(auth_type):\n\n def func(method):\n @functools.wraps(method)\n def wrapper(self, *args, **kwargs):\n if self.session is not None:\n if isinstance(auth_type, ba...
[ { "docid": "9c43e85be1716e5081dd5b8cada10ced", "score": "0.5811439", "text": "def is_authenticated(self, request):\n authenticated = False\n for auth in self.auth_types:\n authenticated = auth.is_authenticated(request)\n if authenticated:\n selected_aut...
be0059908e9c39cd679d8c2756867624
Takes an index into a flattened 3D array and its side length. Returns the coordinate in the cube.
[ { "docid": "73d42ac28eabe7bc138e1e9edd434b73", "score": "0.50769484", "text": "def index_to_coord(index, sl):\n coord = []\n two_d_slice_size = sl * sl\n coord.append(index // two_d_slice_size)\n remaining = index % two_d_slice_size\n coord.append(remaining // sl)\n coord.append(remain...
[ { "docid": "494eda5982266fe514015723e0cd5ba2", "score": "0.58937633", "text": "def calculateCubeIdx3D(cube_size, vol_size, strides):\n x_idx, y_idx, z_idx = calculateIdx3D(vol_size, cube_size, strides)\n pos_idx_flat = np.zeros(x_idx.shape[0] * y_idx.shape[0] * z_idx.shape[0])\n flat_idx = 0\n ...
b7fea5fe355cde8ec14ccdd6653e0c46
Get item shortcut through both dicts.
[ { "docid": "06d3cd8a0386c261b7d67402f6c54233", "score": "0.0", "text": "def __getitem__(self, command: TelnetCommand) -> ExpectedResponse:\n return self._queue[command.group][command]", "title": "" } ]
[ { "docid": "472f524275ca6c4f4f4d33910ff44203", "score": "0.597796", "text": "def _get_item(dic: dict, keys: list) -> dict:\n\tfor key in keys:\n\t\tdic = dic[key]\n\n\treturn dic", "title": "" }, { "docid": "880a504ea925a5235047cca96ec8d9f3", "score": "0.5780727", "text": "def __geti...
3aae4b28f301e8cdc8fba6f89a073908
Calculate the sum of the number of truths tracked with ambiguous ID over all timestamps eg. A truth that has one track with correct ID, and one with unknown ID assigned to it would be counted.
[ { "docid": "2e51093d3e27675f9349a80364b93a60", "score": "0.0", "text": "def _ja_sum(self, manager, timestamps):\n return sum(self._ja_t(manager, timestamp) for timestamp in timestamps)", "title": "" } ]
[ { "docid": "c3442804961ac918c979fed29342d916", "score": "0.57795316", "text": "def _nu_j(self, manager, truth):\n\n # Starting at the beginning of the truth find the track associated at that timestamp with\n # the longest length, increase the track count by one and move time to the end of ...
b6314c694f141ca98b11b20cdc9c471f
Produce any customization definitions (types, fields, message destinations, etc) that should be installed by `resilientcircuits customize`
[ { "docid": "e8cb9bf1c39847a06d843046e12286ea", "score": "0.5533729", "text": "def customization_data(client=None):\n\n # This import data contains:\n # Function inputs:\n # artifact_value\n # Message Destinations:\n # bluecoat_site_review\n # Functions:\n # bluecoa...
[ { "docid": "0c3174bb75572433d27a14a7034f28bf", "score": "0.64324254", "text": "def apply_customization(self, args):\n pass", "title": "" }, { "docid": "29cce1b4c52c4beb66fdf4d95ee4eda4", "score": "0.56733376", "text": "def customizing(self, p_customizing: str):", "title": "" ...
a27a6263310b83f334a5c20a33dfbdea
Try to find a handler for the specified action.
[ { "docid": "f10ca768c00b50727e194b3f09686196", "score": "0.58375084", "text": "def get_action(self, action):\n if not hasattr(self, action):\n return None\n\n x = getattr(self, action)\n if not hasattr(x, 'chat_action'):\n return None\n\n return x", ...
[ { "docid": "507c1d6f9f4e70d5e40e29ca55edcb2f", "score": "0.79287875", "text": "def get_handler_for_action(action: str) -> Union[HandlerFuncType, None]:\n return _registry.get(action)", "title": "" }, { "docid": "9011100e1235f2fbb8172ea80d5b24a7", "score": "0.7242842", "text": "def...
3b6c297c202100584aa08d25d0940cb9
Uses GATK HaplotypeCaller to identify SNPs and Indels and writes a gVCF. Calls persample genotyper to genotype gVCF.
[ { "docid": "8c96fdfc9302cbcaa2784a0bd993bae6", "score": "0.6022498", "text": "def haplotype_caller(job, shared_ids, input_args):\n work_dir = job.fileStore.getLocalTempDir()\n input_files = ['ref.fa', 'ref.fa.fai', 'ref.dict', 'toil.bam', 'toil.bam.bai']\n read_from_filestore_hc(job, work_dir, ...
[ { "docid": "af8695a76a8c8ada581f2704922dd564", "score": "0.61019504", "text": "def genotype_gvcf(job, shared_ids, input_args):\n\n work_dir = job.fileStore.getLocalTempDir()\n input_files = ['%s.raw.BOTH%s.gvcf' % (input_args['uuid'],\n input_args['suffix'...
c565d045277814380a3e3596a51179dd
Given the name of a senator, compares his/her voting record to the voting records of all senators whose names are in sen_set, computing a dot product for each, and then returns the average dot product.
[ { "docid": "5fa5a3767610b7c38df1320b6ce2deb1", "score": "0.7502001", "text": "def find_average_similarity(sen, sen_set, voting_dict):\n sum = 0\n for s in sen_set:\n sum += policy_compare(sen, s, voting_dict)\n avg = sum / len(sen_set)\n return avg", "title": "" } ]
[ { "docid": "0856858641cf367033ed245076e621b2", "score": "0.6240421", "text": "def distance_sen_dem_rep(votes, senator_name):\n # Get democrats and republicans lists\n democrat_names_list = list(votes[votes[\"party\"] == \"D\"].name)\n republican_names_list = list(votes[votes[\"party\"] == \"R\"...
cfbeb513e67f6e0c0a154e6f1fb50c54
Get a 8 bit signed integer
[ { "docid": "d32642cc31fd09a40962ab0b8d4a519a", "score": "0.64202243", "text": "def get_s8(self):\n val = self._data[self._idx]\n self._idx += 1\n return val", "title": "" } ]
[ { "docid": "873e8c65023e1951d2bc1b4b6b02b33a", "score": "0.7569413", "text": "def int8(self) -> int:\n raise NotImplementedError(\"int8 not implemented\")", "title": "" }, { "docid": "f767d287d3deabfa858f95dfa2f88309", "score": "0.71418214", "text": "def uint8(self) -> int:\n ...
142f468e0a664f8f5b2526e1efbf8876
Requests the service to restart after a specified delay, in seconds
[ { "docid": "611a590f87f39170cdf624474b8a1340", "score": "0.7568714", "text": "def restart():\n info = request.get_json() or {}\n delay_secs = int(info.get('delay', 0))\n\n t = threading.Timer(delay_secs, update_trigger_file)\n t.start()\n\n return jsonify(SUCCESS)", "title": "" } ]
[ { "docid": "ac9fe64f3c901f266ac194c718e1cf1d", "score": "0.68044424", "text": "def restart():\n restart_service(SERVICE)\n status()", "title": "" }, { "docid": "3178091b7c5a01776e80f1a9c9a4af66", "score": "0.67897755", "text": "def restart(service, timeout=120):\n service.re...
977574b9ad89fd6fc241218b438a7c4b
The function creates a segment tree in O(n) time
[ { "docid": "b60935cd3960c70ff30657d3664a4acd", "score": "0.7451623", "text": "def segment_tree_creation(arr):\n n = len(arr)\n\n # for n leaf nodes, there are maximum double of 2**max_height-1 nodes, adding extra 0th elem for ease of calculations\n height = ceil(log2(n))\n m = 2 * (2 ** heig...
[ { "docid": "65e049501dc3abc075cf63ac3bc25d92", "score": "0.6716978", "text": "def __init__(self, nums):\n n = len(nums)\n if n == 0: return\n max_size = 2 * pow(2, int(math.ceil(math.log(n, 2)))) - 1\n self.seg_tree = [0 for i in xrange(max_size)]\n self.nums = nums[:]...
cf84055bc026711dba27ebb401e4cb2a
Regrid to 2deg (180lon90lat) horizontal resolution Input
[ { "docid": "9ccee3ab882e0228bda38a0e6f71da74", "score": "0.0", "text": "def Regrid2deg(d, var):\n tgrid = grid.create_uniform_grid(-89, 89, 2.0, 0.0, 358., 2.0)\n drg = d.regridder.horizontal(var, tgrid, tool=\"xesmf\", method=\"conservative_normed\",periodic=True)[var]\n \n print(\"Complete...
[ { "docid": "f815fa237589ae2cb01084b4ca4ace69", "score": "0.58806723", "text": "def setup_grid():\n i0t,imt,j0t,jmt = (0000 ,8640, 0, 4320)\n incr = 360.0/imt\n jR = np.arange(j0t, jmt)\n iR = np.arange(i0t, imt)\n latvec = ( 90 - jR*incr - incr/2)[::-1]\n lonvec = (-180 + iR*in...
f72c141c9093906b6ba328d63eff93cc
Gets all liked YouTube videos and saves artist and track info for any songs
[ { "docid": "68f3cd4e4e039c39a125a5c8ac98ea53", "score": "0.7771531", "text": "def get_liked_videos(self):\n max_results = 50\n request = self.youtube_client.videos().list(\n part=\"snippet,contentDetails,statistics\",\n maxResults=max_results,\n myRating=\"...
[ { "docid": "0630591a3e4269d584fd7dc8e64b81a9", "score": "0.82091135", "text": "def get_liked_videos(self):\n #Requisita o token atualizado para recuperar os likeds videos\n youtube_token=self.get_token_youtube()\n query = \"https://www.googleapis.com/youtube/v3/videos?part=snippet%2...
f70b95f2a81e1ba3b0a84c67134f2d8b
Retrieves the exam schedule link from McGill's Exam website.
[ { "docid": "19386bba2c459029b87044113e1f7109", "score": "0.641286", "text": "async def exam(self, ctx):\n await ctx.trigger_typing()\n\n r = requests.get(MCGILL_EXAM_URL)\n soup = BeautifulSoup(r.content, \"html.parser\")\n r.close()\n link = soup.find(\"a\", href=re.c...
[ { "docid": "78e21614f6c76a4272bedf073cc94e46", "score": "0.5595076", "text": "def scrape_schedules():", "title": "" }, { "docid": "f8d0628902171ac3ac65d518d92c14ad", "score": "0.53754807", "text": "def get_schedule_url (user_id, year=2011, semester=Semester.Winter):\n\n semester_i...
16b874686501b17be9428203cbca25c6
String should be returned in reversed order
[ { "docid": "9764c1c5237dd6493396e36ee89a3b24", "score": "0.0", "text": "def test_reverse_three_chars(self):\n diversifier = Diversifier('abc')\n self.assertEqual('cba', diversifier.reverse())", "title": "" } ]
[ { "docid": "b354bd93c532860e00bdc75a57a7cd7d", "score": "0.74614257", "text": "def task_10_get_reverse_string(text: str):\n return text[::-1]", "title": "" }, { "docid": "f0b5b1a3f3eaba1b8d9634b792123c3a", "score": "0.7371981", "text": "def reverse(self): \n letters = list(...
82258dd61b1d65083fa88155a6715429
builder = self.get_builder() builder.right_join( "report_groups as rg",
[ { "docid": "0a76de558e94f35a9b0bb1e7f4901da3", "score": "0.6038224", "text": "def can_compile_right_join_clause_with_lambda(self):\n return \"\"\"SELECT * FROM \"users\" RIGHT JOIN \"report_groups\" AS \"rg\" ON \"bgt\".\"fund\" = \"rg\".\"fund\" OR \"bgt\" IS NULL\"\"\"", "title": "" } ]
[ { "docid": "ccc08f56946948335d1efe68dd64a809", "score": "0.6065083", "text": "def can_compile_join_clause(self):\n return \"\"\"SELECT * FROM \"users\" INNER JOIN \"report_groups\" AS \"rg\" ON \"bgt\".\"fund\" = \"rg\".\"fund\" AND \"bgt\".\"dept\" = \"rg\".\"dept\" AND \"bgt\".\"acct\" = \"rg\"...
88ea6a4368326b09e886361e32fdef8d
utility function to normalize a tensor. Arguments
[ { "docid": "bb0fecb9a020b414f099d2bdb96e8270", "score": "0.63248867", "text": "def normalize(x):\n return x / (K.sqrt(K.mean(K.square(x))) + K.epsilon())", "title": "" } ]
[ { "docid": "6464ad47b7d44ed5d05c06acd8bd6fae", "score": "0.77866507", "text": "def tensor_normalize(tensor):\n _tensor = tensor.detach().clone()\n _tensor_each_sum = _tensor.sum(dim=1)\n _tensor /= _tensor_each_sum.unsqueeze(1)\n\n _tensor[torch.isnan(_tensor)] = 0.0\n _tensor = 2*_tensor...
5504b1209d1a26576a35bdcbaafc8d6e
Main text parsing function
[ { "docid": "cc3440f37b4917c9629a8c5e29edb25b", "score": "0.0", "text": "def parse(\n data: str,\n raw: bool = False,\n quiet: bool = False\n) -> List[Dict]:\n jc.utils.compatibility(__name__, info.compatible, quiet)\n jc.utils.input_type_check(data)\n\n raw_output: List = []\n outpu...
[ { "docid": "cdaedad6e486837c12364bf2b5dfa2fe", "score": "0.8498604", "text": "def parse(self, text):", "title": "" }, { "docid": "e2d89aedac93ac6c6e41cbc1a364b65d", "score": "0.74919677", "text": "def parse(self, text) -> Generator:", "title": "" }, { "docid": "e2d70c25ed...
9f3c663242af5a3bcfda75eb6d31d72f
Get next pos according to input position.
[ { "docid": "b126f20ee600d1229fde2642ed1ebe60", "score": "0.0", "text": "def _parse_pos(self, pos):\n elements = pos.split(':')\n try:\n idx = int(elements[-1])\n except ValueError:\n log.error(\"Invalid index. The index in pos should be digit but get pos:%s\", ...
[ { "docid": "398dfb63dd007099fb0067135088b9b6", "score": "0.76904935", "text": "def getNextPos(self):\n\t\ti=0\n\t\tfor p in self.positions:\n\t\t\tif p[1]>self.pos[1]: return p\n\t\t\tif len(self.positions)<i+2: return self.pos\n\t\t\ti+=1\n\t\traise Exception('getNextPos is not expected to come this fa...
64d5b66935cc2b6d65ce1d359380ed1d
use lists to check if two strings are anagrams
[ { "docid": "5be43e10ece0a00d0d8d210511210b03", "score": "0.74138683", "text": "def anagram_list(s1, s2):\n # largely copied from exercise\n c1 = [0] * 26\n c2 = [0] * 26\n\n for i in range(len(s1)):\n pos = ord(s1[i]) - ord('a') # gets index\n c1[pos] = c1[pos] + 1\n\n # jus...
[ { "docid": "6cf901e881211c3bcf9daf5f308acaef", "score": "0.8629491", "text": "def anagrams_lst(str1: str, str2: str) -> bool:\n return sorted(list(str1)) == sorted(list(str2))", "title": "" }, { "docid": "eed012ad0a439017fbd2fde094cdb8f1", "score": "0.8194693", "text": "def anagra...
855b796ec640af7d550f4c3b672d38b6
Checks RapidMiner moved potential label to right of attribute list
[ { "docid": "ede05908fcdb8de37184d37b3047135d", "score": "0.63274306", "text": "def check_label(attr, rem_labels):\n attr_len = attr.__len__()\n for item in rem_labels:\n idx_position = attr.index(item)\n if (idx_position / attr_len) > 0.5:\n # valid label present\n ...
[ { "docid": "ca5b20e23f3723ffef1524b16fed64f4", "score": "0.55617946", "text": "def find_ignore_label(self):\n for key, val in self.index2rel.items():\n if val == self.ign_label:\n self.label2ignore = key\n assert self.label2ignore != -1", "title": "" }, { ...
188861d9c40850d37e5c9ef4dd7d3ad7
Adds vmcheckerupdatedb speciffic options to an already populated family of options.
[ { "docid": "2f1fb51907ca0215f88a861da4623f2e", "score": "0.0", "text": "def add_update_db_optparse(cmdline):\n group = optparse.OptionGroup(cmdline, 'update_db.py')\n group.add_option('-f', '--force', action='store_true', dest='force',\n default=False, help='Force updating all ...
[ { "docid": "fc76c15d97e63233f5d826ce76ad1e94", "score": "0.62515515", "text": "def _update_options(self):\n # set verbosity level (also of self.logger, in case of a custom one)\n if self.options[\"verbose\"] <= 0:\n logging.getLogger(\"pyffi\").setLevel(logging.WARNING)\n ...
dc5c4d99d8041ad7be98aaba4665c596
Flag all ec2s that have been running for longer than 1 week (WARN) or 2 weeks (FAIL) if any contain any strings from `flag_names` in their names, or if they have no name.
[ { "docid": "ab45cc8da72d33d0c824df675203a820", "score": "0.61171246", "text": "def check_long_running_ec2s(connection, **kwargs):\n check = CheckResult(connection, 'check_long_running_ec2s')\n if Stage.is_stage_prod() is False:\n check.summary = check.description = 'This check only runs on ...
[ { "docid": "9d8ee2ccefb74207e8b9fc29c0cf0d40", "score": "0.53161347", "text": "def flag_ignored_mousedays(self):\n dirname_in = self.binary_dir + 'HCM_data/qc/flagged/'\n dirname_in2 = self.binary_dir + 'HCM_data/qc/flagged_msgs/'\n flagged = []\n reason = []\n for str...
95f40e89781ba8bb8c7616c89317f79f
Return the diagnostic results.
[ { "docid": "8e36f61f8339717c88e9778af469e118", "score": "0.0", "text": "def get_results(self):\n return copy.deepcopy(self._results)", "title": "" } ]
[ { "docid": "fb824862fc25c212b60aa8351eb76e37", "score": "0.688687", "text": "def GatherResults(self):\n\t\tResults = self.ProbeManager.GetResult()\n\n\t\t#ordino i risultati in base alla run prima di restituirli\n\t\tResults.sort(key=lambda ele: (ele[1]))\n\t\treturn Results", "title": "" }, { ...
17dc4805118f3b1847d262679905a2bc
Assert that the script got called.
[ { "docid": "0e5b8876a3b927aef357a79a905d60df", "score": "0.8074525", "text": "def assertScriptCalled(self):\n # Wait a bit as the events are processed in a different thread.\n with open(os.path.join(self.tempdir, 'result')) as s:\n self.assertEqual('script called', s.read())", ...
[ { "docid": "4e01602e6d1b691fccc1b30b02bf62c1", "score": "0.69822", "text": "def assertScriptNotCalled(self):\n # Wait a bit as so the event can get propagated.\n self.assertFalse(os.path.exists(os.path.join(self.tempdir, 'result')))", "title": "" }, { "docid": "d7d99651f3a9b5ad...
e428f622cad9393b7b8625fa67d8623d
this is a custom list converter that convert a list of tuple to a list of all the second element of each tuple
[ { "docid": "e2143046c2cb436c639d40f5c2a4e1cf", "score": "0.0", "text": "def to_list(entry,index):\n out = []\n for e in entry:\n out.append(e[index])\n return out", "title": "" } ]
[ { "docid": "2e74caf3afc4b7843f8e24a0eb594860", "score": "0.7229407", "text": "def convert_list_to_tuple(self):\n\n # Change self.list to a tuple\n\n pass", "title": "" }, { "docid": "bd3cabcb8d5aa05ef113aba444bc2842", "score": "0.7141554", "text": "def listToTuple ( l )...
3058d15b600c04c5550977cf6df2908e
coins is a list of the values of the coins in your possession
[ { "docid": "bc85cbe1656ecb56861d4ce0ad7b503a", "score": "0.6165489", "text": "def makeChange(coins, total):\n\n if total <= 0:\n return 0\n\n if coins is None or coins == []:\n return -1\n\n coins = sorted(coins, reverse=True)\n cont_coins = 0\n\n for coin in coins:\n ...
[ { "docid": "9d89ece5b00e635df5659787b3410db5", "score": "0.7158293", "text": "async def coins(self, ctx: BBContext):\n pass", "title": "" }, { "docid": "8eabe22d656c02c186b671b60b5e40f6", "score": "0.7005791", "text": "def _get_coins(self, num_coins):\n min_requestable_...
d0a0ee151504cb81fe704c753ca268ba
Gets the gnomAD v3 info TableResource
[ { "docid": "2543294f5392e3763945bfe15143f4e2", "score": "0.5697084", "text": "def get_info(split: bool = True) -> VersionedTableResource:\n\n return VersionedTableResource(\n CURRENT_RELEASE,\n {\n release: TableResource(\n path=\"{}/gnomad_genomes_v{}_info{}.h...
[ { "docid": "6ae4ff619386eee68b71478e4f997011", "score": "0.58526546", "text": "def getTable(self):\n return self.__table", "title": "" }, { "docid": "ffc49ff7bb41356e4c94a330d93f4d77", "score": "0.58430845", "text": "def get_table(table_name: str):\n try:\n response ...
8175c1e21206db487ee07a2ae912ec8d
Test Ansible module loader.
[ { "docid": "d76070268e34b061f597a49663e7c50a", "score": "0.7000035", "text": "def test_resolver_module_loader(resolver):\n with patch(\"salt.modules.ansiblegate.importlib\", MagicMock()), patch(\n \"salt.modules.ansiblegate.importlib.import_module\", lambda x: x\n ):\n assert resolve...
[ { "docid": "0c1959200c05694f42caeea52eceb129", "score": "0.65836585", "text": "def test_ansible_module_help(resolver):\n\n class Module(object):\n \"\"\"\n An ansible module mock.\n \"\"\"\n\n __name__ = \"foo\"\n DOCUMENTATION = \"\"\"\n---\none:\n text here\n--...
5c3f6103716dfaeaae300f15ddebf9cd
_get_clients_for_channel(channel_name) > [client] Given a channel_name, this function returns the clients connected to the nodes that handle the channel. The length of the list is 1 for local channels and user channels. For a global channel the length is equal to the total number of Beaconpush nodes. channel_name the c...
[ { "docid": "4aef8017db638ef12f44a1d8cc41612a", "score": "0.8403511", "text": "def _get_clients_for_channel(self, channel_name):\r\n if not channel_name or channel_name[0] == \"*\":\r\n # Channel name is empty or a global channel\r\n return self._get_clients()\r\n else...
[ { "docid": "1e245e92f4a76ac8102fae4cb68f3d5c", "score": "0.62264466", "text": "def get_users_in_channel(self, channel_name):\r\n\r\n clients = self._get_clients_for_channel(channel_name)\r\n greenlets = [client.getUsersInChannel(channel_name) for client in clients]\r\n self._join_al...
69907cdd1fb10ed77ccb10841edc39a5
unloadSfx(self) Unloads any sound effects that may have been loaded.
[ { "docid": "fb6339aaa3f1d5f4c73877a25ef8cc05", "score": "0.8124208", "text": "def unloadSfx(self):\n if self.cogDropSound != None:\n self.cogDropSound = None\n self.cogLandSound = None\n self.cogSettleSound = None\n self.openSfx = None\n \n ...
[ { "docid": "eabb169063d4295eba34b9a8e1a66cb8", "score": "0.7055466", "text": "def unload(self, *args, **kwargs):\n \n if self.fs:\n self.fs.sfunload(self.sfid, update_midi_preset=0)", "title": "" }, { "docid": "000e57bdd28eed6537fdefc2043e4290", "score": "0.60565...
48f5d542884a82f9b65b9c9cb4555eaa
Force reloading the data from the file. All data in the inmemory dictionary is discarded. This method is called automatically by the constructor, normally you don't need to call it.
[ { "docid": "1b837d3a0ca06c72d167d2ed4f31d5bb", "score": "0.0", "text": "def load(self):\n self._check_open()\n try:\n data = json.load(self.file, **self.load_args)\n except ValueError:\n data = {}\n if not isinstance(data, dict):\n raise Value...
[ { "docid": "c91f69b5199796c9f13475ff65faf51e", "score": "0.7423884", "text": "def reload_file(self):\n self.__load_file()", "title": "" }, { "docid": "37495bab71e58f0c4711c4a8f445cfd9", "score": "0.7374094", "text": "def Reload(self):\n self.LoadFromFile(self.infile_name)",...
926a0f55b8770271cc5a1ea38bafe2bb
Create a editor account
[ { "docid": "cd846220b2f381b50036779188cc176d", "score": "0.0", "text": "def createsuperuser(username, password):\r\n u = User(username=username, password=password,confirmed=True)\r\n u.role = Role.query.filter_by(name='Admin').first()\r\n db.session.add(u)\r\n db.session.comm...
[ { "docid": "2fbceed6628b4873f1d3e2e219f3fe5a", "score": "0.7483424", "text": "def createeditor(username, password):\r\n u = User(username=username, password=password)\r\n u.role = Role.query.filter_by(name='Editor').first()\r\n db.session.add(u)\r\n db.session.commit()\r\n ...
16a93f50d67d8c2e598a35f05f8402a2
Describes all the unique elements in a column
[ { "docid": "8e864e7c847448d8b7f7d6017dfaab5f", "score": "0.7731794", "text": "def describe_unique(df, colname, filter_unnecessary=True):\n print(\"Column name : \", colname)\n unique_elems = pd.unique(df[colname])\n types_of_data = [type(x) for x in unique_elems]\n if filter_unnecessary:\n ...
[ { "docid": "41599ce2227a6e0260c76034890cd48a", "score": "0.7366619", "text": "def unique_values(df):\r\n \r\n print(\"Unique values:\")\r\n for col in df.columns:\r\n print(col + \":\", df[col].unique())", "title": "" }, { "docid": "93e91793f8b371a425e0d984c1727f30", "sco...
fdc72e8ee05e22ce74abf4fb861fafb1
Plot the simulation results and save the plots
[ { "docid": "7821ee5577b36c3b849205fa9f7f2495", "score": "0.0", "text": "def plot_results_parameters(matrix_averages_infected, matrix_averages_death, matrix_averages_recovery, n_nodes):\n\n\tfig = plt.figure(figsize = (14, 8))\n\t\n\t######## Infections subplots ########\n\tax1 = fig.add_subplot(131)\n\t...
[ { "docid": "4ff24f98596cd6e1e5d3ff8afc6c8ff7", "score": "0.769103", "text": "def plot_results():\r\n fig_format = 'png'\r\n plt.figure()\r\n plt.plot(return_history)\r\n plt.xlabel('Iteration')\r\n plt.ylabel('Return')\r\n plt.title('Return (Discounted Cumulative Reward) Convergence')\...
8d4471b9ada82bb05125e270d96b5f67
Load config from file, overwriting current contents.
[ { "docid": "413045953b29f344c28ecd358539afb4", "score": "0.0", "text": "def load(self):\r\n try:\r\n self.loading = True\r\n if os.path.exists(self.filename):\r\n text = open(self.filename).read()\r\n obj = json_decode(text)\r\n f...
[ { "docid": "13792ba4b1af4d88d4b7e93afd2d1326", "score": "0.75971365", "text": "def load_config(self, fname):\n\n self.config = config.Config(fname).config", "title": "" }, { "docid": "d68380d81829c94c3d3adc0387fc7d70", "score": "0.755855", "text": "def load(self):\n Deb...
68ae881d624711688d61b991f3ae080d
Tests two busy times, one in the middle of the start day and one on a different day.
[ { "docid": "6a335bd9b281b3021e5ca2b79521bb38", "score": "0.6556361", "text": "def get_free_times_7_test():\n begin_date = arrow.get().replace(\n tzinfo=tz.tzlocal(), hour=9, minute=0, second=0, microsecond=0, day=16,\n month=11, year=2015)\n end_date = arrow.get().replace(\n t...
[ { "docid": "dedcc10e201d066c2c9eb74db9004b9a", "score": "0.71987724", "text": "def really_between_times(instance, begin_time, end_time):\r\n\r\n\t# Case where the user searches for busy times throughout the whole day(24h)\r\n\tbegin = arrow.get(begin_time).format(\"HH:mm\")\r\n\tend = arrow.get(end_ti...
3f64b6653a03e4f175305cf6bc764495
Produces classifier predictions on the set
[ { "docid": "e69a02c969fd0e25c28c13db3edcc456", "score": "0.0", "text": "def predict(self, X):\n step_1f = self.layer_1.forward(X)\n step_2f = self.layer_2.forward(step_1f)\n step_3f = self.layer_3.forward(step_2f)\n probs = softmax(step_3f)\n pred = np.array(list(map(l...
[ { "docid": "0ba7dfaf59c269fbf03499fc467b096d", "score": "0.7867263", "text": "def predict(self, inputset):\n return self.clf.predict(inputset)", "title": "" }, { "docid": "a051de44eecda307d96be7e662c2b897", "score": "0.76698387", "text": "def predict(self):\n self.predi...
e8bcd69370b79d6f78a35d37f89c5612
Get a list of substitutions by quasirandom sampling from a Sobol sequence.
[ { "docid": "b7fe19d9cc9206ed92268ad8aec491cb", "score": "0.49346414", "text": "def sobol(range_map: Dict[str, ranges.Range], trials: int) -> List[Dict[str, str]]:\n ordered_range_map = collections.OrderedDict(range_map)\n sobol_values = sobol_seq.i4_sobol_generate(len(range_map), trials)\n\n de...
[ { "docid": "5b26bd916d5dca4a8cadd3b66c7eaeac", "score": "0.5697027", "text": "def pseudosample(x):\n#\n BXs=[]\n for k in range(len(x)):\n ind=random.randint(0,len(x)-1)\n BXs.append(x[ind])\n return BXs", "title": "" }, { "docid": "ec87410c0f6f07aed4874be7e5d77bf0", ...
b447f7bdab8614e6d27385d8724d2074
Returns a slice of the dataframe
[ { "docid": "5f62b1d87254e787540d0f413f5893c5", "score": "0.6506718", "text": "def get_data_chunck(self, df=None, iloc_start=None, iloc_end=None, chunck_size=1000):\n # Set iloc_start and iloc_end if not defined\n if not iloc_start:\n iloc_start = 0\n if not iloc_end:\n ...
[ { "docid": "d72bb54cad3c68f028e087e559ff977f", "score": "0.76382184", "text": "def slice(self, offset: int, length: int) -> \"DataFrame\":\n return wrap_df(self._df.slice(offset, length))", "title": "" }, { "docid": "6b983d995a0ae43a049731a50c24c1cb", "score": "0.703219", "tex...
ce47eb18c87a2c70cffbf3ac3f075263
Get user list and their time left
[ { "docid": "27e2da0aa664e50e2ed56a8c1dfd9d42", "score": "0.6999063", "text": "def getUserList(self):\n \"\"\"Sets allowed days for the user\n server expects only the days that are allowed, sorted in ascending order\"\"\"\n # result\n result = 0\n message = \"\"\n ...
[ { "docid": "1d6786e0b68ad28cca0eaedcc1105e35", "score": "0.6761791", "text": "def user_list(self) -> None:\n users_list = []\n\n for user in state.get_users()[\"records\"]:\n users_list.append(\n [\n str(user[\"id\"]),\n user[...
640019edd0a391d862b878cb752234ba
Insert new course data
[ { "docid": "9a04d325b5531af61b6049bc93c6890e", "score": "0.7448042", "text": "def insert_course(self, course):\n largest_id = max([int(i) for i in self.data.keys()])\n new_course_id = str(largest_id + 1)\n self.data[new_course_id] = course\n return self.data", "title": ""...
[ { "docid": "026398ace73e1ad5dbfa7bb033766ef4", "score": "0.7772229", "text": "def add_course(self, info):\n\n\t\twith self.connection.cursor() as cur:\n\t\t\tcur.execute(\"\"\"INSERT INTO courses VALUES (%s, %s, %s, %s)\"\"\", info)\n\n\t\tself.commit()", "title": "" }, { "docid": "123aede24...
565d4025c023804111e8665eb2b2f138
Sets the campaign_id of this Context132.
[ { "docid": "eaf13e8218bd8433db01dd35c98a3556", "score": "0.8459122", "text": "def campaign_id(self, campaign_id):\n\n self._campaign_id = campaign_id", "title": "" } ]
[ { "docid": "a618fa22da5ee9e1f5b3ee60371da942", "score": "0.8029553", "text": "def campaign_id(self, value):\n\n self._campaign_id.set(value)", "title": "" }, { "docid": "80ed485b0d0c85fc62a94f2903a5d87d", "score": "0.7275301", "text": "def setCampaign(self, campaign):\n ...
48738414c52251aace9e1552c271cc99
Finds the nearest region to given coordinates.
[ { "docid": "c8906b8ca44ffb522de320e48c3f128e", "score": "0.7113429", "text": "def FindNearestRegion(self, lat, lon):\n self._Refresh()\n return self._cities.FindNearestNeighbor(lat, lon).parent", "title": "" } ]
[ { "docid": "cc5224e323d654e0d4732c87fd7ff737", "score": "0.6737705", "text": "def nearest(coordinate, coordinate_list, limit):", "title": "" }, { "docid": "11396b53fc89921c28fd992f59f2363d", "score": "0.6671556", "text": "def get_nearest_valid_coordinates(self, coordinates):\n ...
63dca1f63f881be5338907f45eeddff6
Creates a SQL context
[ { "docid": "cf9d4d144a78107634dc376e8e35f83b", "score": "0.6197181", "text": "def __init__(self, url=None, connection=None, schema=None):\r\n\r\n if not url and not connection:\r\n raise AttributeError(\"Either url or connection should be provided\" \\\r\n ...
[ { "docid": "22361e6b7fd296a7df81b6110d25b91b", "score": "0.68279225", "text": "def _make_context():\n return {'app': app, 'db': db}", "title": "" }, { "docid": "4c9b643c0b896ecd18fb03e4b3fd641b", "score": "0.6694832", "text": "def sql_context(self):\n if not self._sql_conte...
09a4bd3f156469c3b8e7375097f7f947
Gets is_grade attribute of instance Returns
[ { "docid": "56b57c1cb0e5c0ace8d84a7e09e28fdb", "score": "0.7083966", "text": "def get_is_graded(self):\n return self.is_graded", "title": "" } ]
[ { "docid": "ebc51373a9a05f5f317713d900e8baf8", "score": "0.743497", "text": "def get_grade(self):\n return self.grade", "title": "" }, { "docid": "dfb54dfff723a785b613028952041e0a", "score": "0.6901927", "text": "def grade(self):\n return self._grade", "title": "" ...
f293cb81966d4d558331b83cb872dc75
Ensure that all entries are returned.
[ { "docid": "57a0df6352d166edd9eb96351fc2fc59", "score": "0.6007018", "text": "def test_view_everything_returns_all_records(self):\n data = self.create_test_dates()['test_log_entry_data']\n\n records = self.dbm.view_everything()\n records = [dict(entry) for entry in records]\n\n ...
[ { "docid": "b5acbfbedb9e1524417d1e5e14283e4f", "score": "0.7266865", "text": "def all_entries(self) -> requests.models.Response:", "title": "" }, { "docid": "151603cea417ba3dabcb63e9d0ba8d72", "score": "0.7057368", "text": "def getAllEntries(self):\n try:\n self.dat...
d5d1ba5f2a340e997fd179d7fbbeb007
The rsquared value (a.k.a. coefficient of determination)
[ { "docid": "ac093f765728612363ed6781c28d505b", "score": "0.0", "text": "def r_squared(A, b):\n ssr = sum_of_squared_residuals(A, b)\n sst = total_sum_of_squares(A, b)\n return 1.0 - ssr / sst", "title": "" } ]
[ { "docid": "72fac2c5ab96a955bb8597aa092c64df", "score": "0.7222706", "text": "def rsq(self):\n return metrics.rsq(self.model, self.x, self.y)", "title": "" }, { "docid": "47d63c0cfd2b0557ff484c91495f6744", "score": "0.70095164", "text": "def get_res_rsquare(self, res_type: str...
2e27c39c5690eadd8bfa2d8d5fe35f2e
Given a username, sign in the user.
[ { "docid": "adaa9822983a2910836001f830cdc2cc", "score": "0.77780646", "text": "def sign_in(self, username):\n if self.url == 'about:blank':\n # We need a page loaded in order to set an authentication cookie.\n self.visit('/')\n # This is duplicated from User.sign_in t...
[ { "docid": "386a8dc8087d28e7989fe62d2c220f31", "score": "0.7601162", "text": "def login(self, username, password):\n self._set_username(username=username)\n self._set_password(password=password)\n self._sign_in()", "title": "" }, { "docid": "c5fae1aed819e10ecaea99aa83104...
404671f607e8e6fefe302d3dceab2092
Sets the access control policy on the specified resource. Replaces any existing policy.
[ { "docid": "9cd543d8f92bc3bf059f6ebd6f1d2a6b", "score": "0.50599295", "text": "def SetIamPolicy(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')", "title":...
[ { "docid": "43c26021a7a50ef9c9a7379a2cefa46d", "score": "0.7376781", "text": "def set_resource_policy(self, resource, policy):\n\n @lockutils.synchronized(self.lock_name)\n def _set_resource_policy():\n policy_id = self.resource_2_qos_policies.get(resource)\n old_poli...
3ac87c776c8aadc9761f4a9bee3738c6
Generates a link allowing the data in a given panda dataframe to be downloaded
[ { "docid": "5f40d00bea1eb279ad6117ffc5b495d6", "score": "0.7543758", "text": "def get_table_download_link(df):\n csv = df.to_csv(index=False)\n b64 = base64.b64encode(\n csv.encode()\n ).decode() # some strings <-> bytes conversions necessary here\n ...
[ { "docid": "652badd8b29f86288a249339bc14ca84", "score": "0.7853004", "text": "def get_table_download_link(dataframe: pd.DataFrame):\n val = to_excel(dataframe)\n b64 = base64.b64encode(val)\n # TODO: Create a random number as filename, check generate_xlsx\n return ('<p style=\"text-align:cen...
13bc9786d72c182ae5556b7203767daf
Convert topology object into an ns2 Tcl script that deploys that topology into ns2.
[ { "docid": "602ccfd7732aa6a1f9642f34693d5188", "score": "0.55723596", "text": "def to_ns2(topology, path, stacks=True):\n try:\n from mako.template import Template\n except ImportError:\n raise ImportError('Cannot import mako.template module. '\n 'Make sure m...
[ { "docid": "2b5d43ca9342feb75ca534ffe1a11c9d", "score": "0.54831195", "text": "def topology(args):\n info(\"*** Creating network\\n\")\n topology_data = load_topology() \n \n add_hmds()\n add_base_stations(topology_data)\n sdn_controller = get_sdn_controller()\n\n info(\"*** Configu...
4cca531af85e252640b38a122ef3ef97
Creates a new archive_file (hdf5) with groups for gpt and distgen. Calls .archive method of GPT and Distgen objects, into these groups.
[ { "docid": "5cf03ca819bee0c064fc670222362c11", "score": "0.76831263", "text": "def archive_gpt_with_distgen(gpt_object,\n distgen_object,\n archive_file=None,\n gpt_group ='gpt',\n distgen_gro...
[ { "docid": "095f84ec623087ed69bf071f02b382e4", "score": "0.604668", "text": "def write_hdf5(out_file, data):\n gmu_proc_file = h5py.File(out_file, 'w')\n print(gmu_proc_file)\n for g in data:\n group = gmu_proc_file.create_group(g)\n for datum in data[g]:\n try:\n ...
92a56c7f57a736b69d2267ad2bc5e9d5
Authenticates a challenge message and responds to the requestor.
[ { "docid": "2b049151ea4c4fa28d8780963a4016be", "score": "0.8119253", "text": "def authenticate_challenge(self, message: Dict[Any, Any]):\n\n challenge = message[\"challenge\"]\n log.info(\"Authenticating a challenge from the server\")\n\n try:\n signed_challenge = sign_ch...
[ { "docid": "e7ab498cb458cdcb5097216cbfed59d8", "score": "0.7524756", "text": "def process_challenge(self, message: str) -> None:\n\t\tvalue = message.get('val', None)\n\n\t\tif value != self.challenge_ans:\n\t\t\tlogger.error(\"Authentication failed\")\n\t\t\treturn False\n\t\t\n\n\t\tself.state = STATE...
6a373c6e7a1bd455aa1ed75f652c7e26
Tests the method which let us set the URL to work from for the case that the given URL is not a supported URL.
[ { "docid": "20831f84b83e2b3651fbe1de70c2a13f", "score": "0.0", "text": "def test_set_url_base_ends_with_slash(self) -> None:\n\n given = \"http://example.org/\"\n expected = \"http://example.org\"\n\n self.query_tool.url_base = given\n actual = self.query_tool.url_base\n\n ...
[ { "docid": "6be824e2daffbb7a6dd84fc0d7cbc843", "score": "0.7581493", "text": "def set_broken_url():", "title": "" }, { "docid": "e02dcdf95f707f20fc80126e7cd69e75", "score": "0.7048977", "text": "def _set_url(self, url):\n ...", "title": "" }, { "docid": "1079ed216e...
7732897d672fe036c1d2b58e44dd262c
Make a random matrix with elements in range (lowhigh)
[ { "docid": "e27867629904731d44dbbc8c2a9a695c", "score": "0.76756394", "text": "def makeRandom(cls, m, n, low=0, high=10):\n\n obj = Matrix(m, n)\n for x in range(m):\n obj.rows[x] = [random.randrange(low, high) for i in range(obj.csize)]\n\n return obj", "title": "" ...
[ { "docid": "b5e8a62cd84fd0814bfb38c042749abe", "score": "0.7580365", "text": "def randmatrix(m, n, lower=-0.5, upper=0.5):\n return np.array([random.uniform(lower, upper) for i in range(m*n)]).reshape(m, n)", "title": "" }, { "docid": "4154e7b54e17a3fc806a6f9e15ecbed0", "score": "0.74...
68d870d5d23b867b8cde3c54962e3557
Creates the temporary html_to_pdf.html file that will be located in the rssparser/data/ folder. With pdfkit library converts this html file to the pdf file specified in topdf arg. And removes the temporary html file.
[ { "docid": "38fd8232ae791da34cff94ddf52be21a", "score": "0.7395331", "text": "def to_pdf(items, path_to_save_pdf):\n to_html(items, 'rssparser/data/html_to_pdf.html')\n pdfkit.from_file('rssparser/data/html_to_pdf.html', path_to_save_pdf)\n os.remove('rssparser/data/html_to_pdf.html')", "ti...
[ { "docid": "0294fe5f674f0b44652a9c10498ec7d8", "score": "0.73789454", "text": "def write_pdf(self, html):\n try:\n f = tempfile.NamedTemporaryFile(delete=False, suffix='.html')\n f.write(html.encode('utf_8', 'xmlcharrefreplace'))\n f.close()\n except Except...
bc1345310a64780e09c789847d11b327
Classifies the given inputs (images) by comparing the processing\ results of the images to the target classes targets.
[ { "docid": "6840b3a9df26313e808670b73b4439d1", "score": "0.79305094", "text": "def classify(self, inputs, targets):\n assert inputs.shape[0] == targets.shape[0], \\\n 'Different number of inputs and targets provided. inputs.shape[0] ' \\\n 'and targets.shape[0] must be ident...
[ { "docid": "8a295023de0f3cc752c3de5964aeb74a", "score": "0.6684749", "text": "def postprocess(results, filenames, batch_size):\n if len(results) != 1:\n raise Exception(\"expected 1 result, got {}\".format(len(results)))\n\n batched_result = results[0].batch_classes\n if len(batched_result) != bat...
3209a5dac48fd4a7f382b7f2a4c9652b
Test eq as arrayarray for failing with different data positions in array 2 Array code d.
[ { "docid": "ced6c869f5ee002089761d83cdfd7e8a", "score": "0.79888207", "text": "def test_eq_numpos_array_array_c2(self):\n\t\tfor testpos in range(self.testarraylen):\n\t\t\twith self.subTest(msg='Failed with posistion', testpos = testpos):\n\n\t\t\t\texpected = all([x == y for x,y in zip(self.data1, sel...
[ { "docid": "71d41f5200c765aa5f06fb50a38ef57b", "score": "0.8023773", "text": "def test_eq_numpos_array_array_c1(self):\n\t\tfor testpos in range(self.testarraylen):\n\t\t\twith self.subTest(msg='Failed with posistion', testpos = testpos):\n\n\t\t\t\texpected = all([x == y for x,y in zip(self.data1fail, ...
a813f98ec27f13401901346feec8a484
Recursively turn the TC logic into TC configuration
[ { "docid": "10a45d1c09ea052b511d7a5891329964", "score": "0.0", "text": "def make(self):\n tcg = TCCommandGenerator()\n print(\"Make ClassifierFilter\")\n CmdExecutor.run_and_print(tcg.add_classifier_filter(self))", "title": "" } ]
[ { "docid": "ef40f7ed175823942ced5d3c9a0f4d46", "score": "0.5959538", "text": "def process_config(lunch_config):\n def add(domain_name, tree_root, product):\n tree_key = inner_tree.InnerTreeKey(tree_root, product)\n if tree_key in trees:\n tree = trees[tree_key]\n else:...
a29a5b68ad9385db44275aaac25299f2
calculate all lazily calculated properties of explainer
[ { "docid": "98cda06ab8b2983211f12fad2566a05b", "score": "0.58270127", "text": "def calculate_properties(self, include_interactions=True):\n _ = self.pred_probas\n super().calculate_properties(include_interactions=include_interactions)", "title": "" } ]
[ { "docid": "db812ffcc271376b51b84567bde6244c", "score": "0.59954566", "text": "def get_descent(self):", "title": "" }, { "docid": "db812ffcc271376b51b84567bde6244c", "score": "0.59954566", "text": "def get_descent(self):", "title": "" }, { "docid": "b28db5e20f7c8f8092ca30...
3281e3c9560e50b7f3b70816c2c11ccd
this function responsible for the initial skip grams
[ { "docid": "fee1eac4d6717fd2cddf61b9d2eb07ec", "score": "0.59567994", "text": "def initial_skip_grams(full_sentence_info, k_skip, n_gram):\n if n_gram == 1:\n return [[full_sentence_info[0]]]\n grams = []\n for j in range(min(k_skip + 1, len(full_sentence_info) - 1)):\n kmj_skip_n...
[ { "docid": "d5df531ee98e066ac7f749a019d9ea17", "score": "0.6951125", "text": "def Skip(self, skip=True):", "title": "" }, { "docid": "62f28dd39a3b4451ebad8dc5424e80ef", "score": "0.6750491", "text": "def skip(self):\n self.next()", "title": "" }, { "docid": "4092f1...
294970926228fce0b623e8b5c3e22575
Loads a network from a CSV file.
[ { "docid": "88a79f5ad83f58d5f4dffa69cdbc21e0", "score": "0.61747426", "text": "def network_from_csv(filename):\n from openpnm.network import Network\n fname = _parse_filename(filename=filename, ext='csv')\n\n a = read_table(filepath_or_buffer=fname,\n sep=',',\n ...
[ { "docid": "da41cb35073df863beef61c4f11e5bb6", "score": "0.70894367", "text": "def from_csv(self, file: str):\n with open(file) as f:\n for line in f:\n words = line.split(',')\n line_type = words[0]\n if line_type == 'c':\n ...
d85d71c32c197fa3a34b069127d452a1
Reads reference data from the original "new_reference.dat" file from ff_generator Currently torsion and out_bends do not support reading a value in Offdiagonal values of the Hessian are not supported Must be called after setup
[ { "docid": "0cb73e703624784c0f6107acfd7b7d63", "score": "0.60091716", "text": "def read_ref_from_refdat(self, filename, conv_angle=np.pi/180.0, conv_energy = 143.88, conv_length=1.0, read_fit_flag=True):\n assert self._setup\n #\n f = open(filename, \"r\")\n line = f.readline...
[ { "docid": "b5be3e4f061018379de1fd59914de34a", "score": "0.61490226", "text": "def Load_reference(self):\n if self.reffile is None:\n raise ValueError('No reference file specified')\n if os.path.isfile(self.reffile):\n hdu = fits.open(self.reffile)\n else:\n ...