function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def debug_contents(self, indent=1, file=sys.stdout, _ids=None): """Print out interesting things about the object.""" klasses = list(self.__class__.__mro__) klasses.reverse() # print special attributes "bottom up" previous_attrs = () for c in klasses: attrs = ...
JoelBender/bacpypes
[ 243, 121, 243, 107, 1436992431 ]
def stringInList_CaseInsens ( aString, aList ): for s in aList: u = s.upper() if ( aString.upper() == u ): return ( 1 ) return ( 0 )
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def remapCategoricalFeatures(allClinDict): print " " print " in remapCategoricalFeatures " keyList = allClinDict.keys() keyList.sort() for aKey in keyList: aKey2 = aKey.lower() if (aKey2 in remapDict.keys()): numRemap = 0 print " " print " loo...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def getNumPatients(allClinDict): aKey = allClinDict.keys()[0] return ( len(allClinDict[aKey]) )
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def findProperKey(allClinDict, aString): keyList = allClinDict.keys() foundList = [] for aKey in keyList: if ( aKey.lower().find(aString.lower()) >=0 ): foundList += [ aKey ] if ( len(foundList) == 0 ): return ( "NO KEY" ) elif ( len(foundList) == 1 ): return (...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def computeLymphnodesFraction(allClinDict): aKey = findProperKey ( allClinDict, "number_of_lymphnodes_positive_by_he" ) bKey = findProperKey ( allClinDict, "number_of_lymphnodes_examined" ) if (aKey not in allClinDict.keys()): print " " print " skipping computeLymphnodesFraction " ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def addTag2Key ( aKey, aTag ): aTokens = aKey.split(':') if ( len(aTokens) >= 7 ): newKey = aTokens[0] + ':' + aTokens[1] + ':' + aTokens[2] if ( aTag[0] == "_" ): newKey += aTag else: newKey += "_" + aTag for ii in range(3,len(aTokens)): new...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def checkBarcodes(allClinDict): zKey = findProperKey (allClinDict, "bcr_patient_barcode" ) numClin = getNumPatients(allClinDict) for ii in range(numClin): if ( allClinDict[zKey][ii].find("_") >= 0 ): print " BAD barcode !!! ", ii, allClinDict[zKey][ii] sys.exit(-1)
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def addFollowupInfo(allClinDict): print " " print " in addFollowupInfo ... " # ------------------------------------------------------------------------ # FIRST: if there is a days_to_last_known_alive, then check that it is # used consistently, otherwise create it zKey = findProperKey (allClin...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def checkFollowupInfo(allClinDict): print " " print " in checkFollowupInfo ... " # FIRST: if there is a days_to_last_known_alive, then check that it is # used consistently, otherwise create it zKey = findProperKey (allClinDict, "bcr_patient_barcode") aKey = findProperKey (allClinDict, "days_t...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def PreferredStage(reported, computed): t = testTumorStage(reported, computed) if (t == "AGREE"): return(reported) if (t == "Stage cannot be derived from TNM"): return(reported) if (t == "Derived stage is more specific"): return(repStage(computed)) # For SupTab1 use return(compu...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def repStage(substage): if (type(substage) is str): return(substage) if (type(substage) is list): return(substage[0])
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def testTumorStage(reported, computed): # Agreement includes "in" relationship and NA equivalence if (type(computed) is list): if (reported in computed): return("AGREE") if (type(computed) is str): if (reported == computed): return("AGREE") if (((reported == "STAG...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def getTumorStage(T, N, M): print " WARNING ... this function should NOT be called ... " sys.exit(-1) T = T.upper() N = N.upper() M = M.upper() if (M == "M1"): # Seems to be TCGA choice if IVA, IVB not specified return ("STAGE IV") if (M == "M1A"): return ("STAGE I...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def checkTumorStage(allClinDict): if ("tumor_stage" not in allClinDict.keys()): print " skipping checkTumorStage ... " return (allClinDict) else: print " running checkTumorStage ... " numClin = getNumPatients(allClinDict) print " total number of patients : ", numClin if (0...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def checkVitalStatus(allClinDict): vsKey = findProperKey ( allClinDict, "vital_status" ) bcKey = findProperKey ( allClinDict, "bcr_patient_barcode" ) if ( vsKey == "NO KEY" ): print " skipping checkVitalStatus ... " return (allClinDict) print " running checkVitalStatus ... " numC...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def updateAge(allClinDict): pKey = findProperKey ( allClinDict, "bcr_patient_barcode" ) aKey = findProperKey ( allClinDict, "age_at_initial_pathologic_diagnosis" ) bKey = findProperKey ( allClinDict, "days_to_birth" ) print " running updateAge ... " numClin = getNumPatients(allClinDict) print...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def removeParens(oneKey): print " in removeParens ... " origUniqList = [] newUniqList = [] newKey = [] for aLabel in oneKey: if (aLabel not in origUniqList): origUniqList += [aLabel] if (aLabel.find("(") >= 0): print " --> found open paren ... at %d in <...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def removeSpecialChars(oneKey): okExceptions = ['4+'] # ran into a strange case here where most of the elements were strings # like 'grade_1' but some were just integers like 3 :( # so ... these next few blocks of code are TOTAL HACKS ... numInt = 0 numNot = 0 aString = '' aInt = 9999 ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def getCommonPrefix(aLabel, bLabel): nn = 0 while (aLabel[nn].lower() == bLabel[nn].lower()): nn += 1 if (nn >= len(aLabel)): return (aLabel[:nn]) if (nn >= len(bLabel)): return (aLabel[:nn]) return (aLabel[:nn])
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def getCommonSuffix(aLabel, bLabel): nn = -1 while (aLabel[nn].lower() == bLabel[nn].lower()): nn -= 1 if (-nn > len(aLabel)): return (aLabel) if (-nn > len(bLabel)): return (bLabel) if (nn == -1): return ("") else: return (aLabel[nn + 1:...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def removeCommonPrefix(oneKey, labelList): print " in removeCommonPrefix : ", labelList madeChange = 0 nLabel = len(labelList) for ii in range(nLabel): for jj in range(ii + 1, nLabel): commonPrefix = getCommonPrefix(labelList[ii], labelList[jj]) # if the commonPrefix i...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def removeCommonSuffix(oneKey, labelList): print " in removeCommonSuffix : ", labelList madeChange = 0 nLabel = len(labelList) for ii in range(nLabel): for jj in range(ii + 1, nLabel): commonSuffix = getCommonSuffix(labelList[ii], labelList[jj]) # if the commonSuffix i...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def abbrevCategStrings(allClinDict): print " " print " in abbrevCategStrings ... " print " " keyList = allClinDict.keys() keyList.sort() for aKey in keyList: if (aKey.find("bcr_patient_barcode") >= 0): print " all barcodes : " print allClinDict[aKey] ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def checkPrefix(labelList, aPrefix): nLabel = len(labelList) nHas = 0 for aLabel in labelList: bLabel = aLabel.upper() if (bLabel == "NA"): nLabel -= 1 continue if (bLabel.startswith(aPrefix)): nHas += 1 if ((nHas + 2) >= nLabel): return (1) ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def translateArabic(aLabel, usePrefix): # print " in translateArabic ... " pLen = len(usePrefix) bLabel = aLabel.upper() if (bLabel.startswith(usePrefix)): bLabel = bLabel[pLen:] if (bLabel[0] == "_"): bLabel = bLabel[1:] bLen = len(bLabel) found = 0 ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def translateRoman(aLabel, usePrefix): romanList = ["VIII", "III", "VII", "IV", "IX", "II", "VI", "I", "V", "X"] numbrList = [8, 3, 7, 4, 9, 2, 6, 1, 5, 10] pLen = len(usePrefix) bLabel = aLabel.upper() if (bLabel.startswith(usePrefix)): bLabel = bLabel[pLen:] if (bLabel[0] == "_")...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def checkRomanNumerals(labelList, usePrefix): skipList = ["_"] stripList = ["A", "B", "C", "X", "0"] romanList = ["I", "V", "X"] pLen = len(usePrefix) yesR = 0 notR = 0 for aLabel in labelList: bLabel = aLabel.upper() if (bLabel.startswith(usePrefix)): bLabel = ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def addNumericalFeatures(allClinDict): print " " print " " print " in addNumericalFeatures ... " keyList = allClinDict.keys() keyList.sort() # CAREFUL: add on things only at the end of this list ... prefixList = ["T", "N", "M", "STAGE", "GRADE", "G", "PT"] nPrefix = len(prefixList) ...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def getMappingDict(featName, auxName): mapDict = {} if (featName[1] == ':'): if (featName[6] == ':'): tokenList = featName.split(':') tmpFeatName = tokenList[2] else: tmpFeatName = featName try: mapFilename = "../" + auxName + "/" + tmpFeatName + ".map"...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def getMapping ( mapDict, curV, ii ): for k in mapDict.keys(): if ( k.lower() == curV.lower() ): return ( mapDict[k][ii] ) print " FAILED TO GET MAPPING ??? ", curV, ii print mapDict sys.exit(-1)
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def addDerivedFeatures(allClinDict, auxName): print " " print " " print " in addDerivedFeatures ... " keyList = allClinDict.keys() keyList.sort() for aKey in keyList: if (aKey == "bcr_patient_barcode"): continue (keyType, nCount, nNA, nCard, labelList, labelCount)...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def addIndicatorFeatures(allClinDict): magicStrings = ["patient", "person", "vital", "surviv", "race", "ethnic", "prior", "gender", "age_at", "ageat", "radiation", "chemo", "therapy", "treat", "performance", "days_to_", "daysto", "year_of", "yearof", "sur...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def addPairwiseIndicatorFeatures(allClinDict): magicStrings = ["patient", "person", "vital", "surviv", "race", "ethnic", "prior", "gender", "age_at", "ageat", "radiation", "chemo", "therapy", "treat", "performance", "days_to_", "daysto", "year_of", "yearo...
cancerregulome/gidget
[ 6, 3, 6, 11, 1383861509 ]
def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_delete( self, resource_group_name, # type: str application_gateway_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {})
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get( self, resource_group_name, # type: str application_gateway_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): deserialized = self._deserialize('ApplicationGateway', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str parameters, # type: "_models.TagsObject" **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str parameters, # type: "_models.TagsObject" **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): deserialized = self._deserialize('ApplicationGateway', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list( self, resource_group_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadat...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=resp...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_all( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_all.met...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=resp...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _start_initial( self, resource_group_name, # type: str application_gateway_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_start( self, resource_group_name, # type: str application_gateway_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {})
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _stop_initial( self, resource_group_name, # type: str application_gateway_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_stop( self, resource_group_name, # type: str application_gateway_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {})
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _backend_health_initial( self, resource_group_name, # type: str application_gateway_name, # type: str expand=None, # type: Optional[str] **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_backend_health( self, resource_group_name, # type: str application_gateway_name, # type: str expand=None, # type: Optional[str] **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_long_running_output(pipeline_response): deserialized = self._deserialize('ApplicationGatewayBackendHealthOnDemand', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_available_server_variables( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_available_request_headers( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_available_response_headers( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_available_waf_rule_sets( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_available_ssl_options( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_available_ssl_predefined_policies( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_availab...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=resp...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_ssl_predefined_policy( self, predefined_policy_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__(self, client, config, serializer, deserializer) -> None: self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadat...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def load(cls, options): """Creates a project and loads it's configuration immediately""" project = cls() project.load_settings(options) return project
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def load_settings(self, options): # Check if project directory is specified project_dir = getattr(options, 'project_dir', None) if not project_dir: project_dir = self._find_project_dir() project_dir = os.path.abspath(project_dir) self._project_dir = project_dir ...
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def name(self): return self._project_name
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def config_file(self): if not os.path.isfile(self._config_file): return None return self._config_file
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def path(self, *paths): """Create a path relative to the project""" return os.path.join(self._project_dir, *paths)
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def bin_path(self, *paths): """Create a path relative to the virtstrap-dir's bin directory""" bin_py = 'bin' if sys.platform == 'win32': bin_py = 'Scripts' return self.env_path(bin_py, *paths)
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def config(self, section): """Grabs processed section data""" return self._config.processed(section)
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def find_project_dir(current_dir=None): """Finds the project directory for the current directory""" current_dir = current_dir or os.path.abspath(os.curdir) if VIRTSTRAP_DIR in os.listdir(current_dir): vs_dir = os.path.join(current_dir, VIRTSTRAP_DIR) if os.path.islink(vs_dir) or os.path.isdi...
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def __init__(self, project_dir): self._project_dir = os.path.abspath(project_dir)
ravenac95/virtstrap
[ 7, 2, 7, 3, 1330379410 ]
def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get( self, configuration_profile_preference_name, # type: str resource_group_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def delete( self, resource_group_name, # type: str configuration_profile_preference_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def update( self, configuration_profile_preference_name, # type: str resource_group_name, # type: str parameters, # type: "models.ConfigurationProfilePreferenceUpdate" **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_by_resource_group( self, resource_group_name, # type: str **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] #...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def list_by_subscription( self, **kwargs # type: Any
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # t...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 self.supports_cli = False
syscoin/syscoin2
[ 164, 70, 164, 5, 1456717652 ]
def mine_chain(self): self.log.info('Create some old blocks') address = self.nodes[0].get_deterministic_priv_key().address for t in range(TIME_GENESIS_BLOCK, TIME_GENESIS_BLOCK + 200 * 600, 600): # ten-minute steps from genesis block time self.nodes[0].setmocktime(t) ...
syscoin/syscoin2
[ 164, 70, 164, 5, 1456717652 ]
def _test_getchaintxstats(self): self.log.info("Test getchaintxstats") # Test `getchaintxstats` invalid extra parameters assert_raises_rpc_error(-1, 'getchaintxstats', self.nodes[0].getchaintxstats, 0, '', 0) # Test `getchaintxstats` invalid `nblocks` assert_raises_rpc_error(-1...
syscoin/syscoin2
[ 164, 70, 164, 5, 1456717652 ]
def _test_getblockheader(self): node = self.nodes[0] assert_raises_rpc_error(-8, "hash must be of length 64 (not 8, for 'nonsense')", node.getblockheader, "nonsense") assert_raises_rpc_error(-8, "hash must be hexadecimal string (not 'ZZZ7bb8b1697ea987f3b223ba7819250cae33efacb068d23dc24859824a77...
syscoin/syscoin2
[ 164, 70, 164, 5, 1456717652 ]
def _test_getnetworkhashps(self): hashes_per_second = self.nodes[0].getnetworkhashps() # This should be 2 hashes every 10 minutes or 1/300 assert abs(hashes_per_second * 300 - 1) < 0.0001
syscoin/syscoin2
[ 164, 70, 164, 5, 1456717652 ]
def _test_waitforblockheight(self): self.log.info("Test waitforblockheight") node = self.nodes[0] node.add_p2p_connection(P2PInterface()) current_height = node.getblock(node.getbestblockhash())['height'] # Create a fork somewhere below our current height, invalidate the tip ...
syscoin/syscoin2
[ 164, 70, 164, 5, 1456717652 ]
def model_name(table_name): if table_name in [ 'vtm', 'vpi', 'vmp', 'vmpp', 'amp', 'ampp', 'gtin', ]: return table_name.upper() else: return ''.join(tok.title() for tok in table_name.split('_'))
annapowellsmith/openpresc
[ 91, 25, 91, 305, 1441229895 ]
def mock_get_coi_returning_coindex_around_coords(self, params_dict): return json.loads(COINDEX_JSON)
csparpa/pyowm
[ 746, 159, 746, 16, 1378111431 ]