function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def test_fetch_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .short_codes("SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch() self.holod...
twilio/twilio-python
[ 1642, 655, 1642, 10, 1252992837 ]
def test_update_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .short_codes("SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() self.hol...
twilio/twilio-python
[ 1642, 655, 1642, 10, 1252992837 ]
def test_list_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): self.client.api.v2010.accounts("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .short_codes.list() self.holodeck.assert_has_request(Request( ...
twilio/twilio-python
[ 1642, 655, 1642, 10, 1252992837 ]
def _get_context(page_name): return { "pages": settings.PUBLIC_PAGES, "current_page_name": page_name, }
sigmapi-gammaiota/sigmapi-web
[ 7, 2, 7, 31, 1426656728 ]
def index(request): """ View for the static index page """ return render(request, "public/home.html", _get_context("Home"))
sigmapi-gammaiota/sigmapi-web
[ 7, 2, 7, 31, 1426656728 ]
def activities(request): """ View for the static chapter service page. """ return render( request, "public/activities.html", _get_context("Service & Activities"), )
sigmapi-gammaiota/sigmapi-web
[ 7, 2, 7, 31, 1426656728 ]
def campaign(request): """ View for the campaign service page. """ # Overrride requests Session authentication handling class NoRebuildAuthSession(requests.Session): def rebuild_auth(self, prepared_request, response): """ No code here means requests will always prese...
sigmapi-gammaiota/sigmapi-web
[ 7, 2, 7, 31, 1426656728 ]
def handler404(request, exception): """ """ return render(request, "common/404.html", _get_context("Page Not Found"))
sigmapi-gammaiota/sigmapi-web
[ 7, 2, 7, 31, 1426656728 ]
def test_calcMembershipProbs(): """ Even basicer. Checks that differing overlaps are correctly mapped to memberships. """ # case 1 star_ols = [10, 10] assert np.allclose([.5,.5], em.calc_membership_probs(np.log(star_ols))) # case 2 star_ols = [10, 30] assert np.allclose([.25,.75...
mikeireland/chronostar
[ 4, 2, 4, 11, 1457065473 ]
def test_fit_many_comps_gradient_descent_with_multiprocessing(): """ Added by MZ 2020 - 07 - 13
mikeireland/chronostar
[ 4, 2, 4, 11, 1457065473 ]
def test_maximisation_gradient_descent_with_multiprocessing_tech(): """ Added by MZ 2020 - 07 - 13
mikeireland/chronostar
[ 4, 2, 4, 11, 1457065473 ]
def get_installdir(): '''get_installdir returns the installation directory of the application ''' return os.path.abspath(os.path.dirname(hello.__file__))
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def run_command(cmd,error_message=None,sudopw=None,suppress=False): '''run_command uses subprocess to send a command to the terminal. :param cmd: the command to send, should be a list for subprocess :param error_message: the error message to give to user if fails, if none specified, will alert that com...
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def get_listfirst(item,group): '''return the first found in a list (group) from a dictionary item. ''' if not isinstance(group,list): group = [group] for contender in group: if contender in item: return item[contender] return None
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def write_file(filename,content,mode="w"): '''write_file will open a file, "filename" and write content, "content" and properly close the file ''' with open(filename,mode) as filey: filey.writelines(content) return filename
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def read_file(filename,mode="r"): '''write_file will open a file, "filename" and write content, "content" and properly close the file ''' with open(filename,mode) as filey: content = filey.readlines() return content
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def detect_compressed(folder,compressed_types=None): '''detect compressed will return a list of files in some folder that are compressed, by default this means .zip or .tar.gz, but the called can specify a custom list :param folder: the folder base to use. :param compressed_types: a list of types t...
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def zip_dir(zip_dir, zip_name, output_folder=None): '''zip_dir will zip up and entire zip directory :param folder_path: the folder to zip up :param zip_name: the name of the zip to return :output_folder: ''' tmpdir = tempfile.mkdtemp() output_zip = "%s/%s" %(tmpdir,zip_name) zf = zipfile...
radinformatics/som-tools
[ 7, 7, 7, 12, 1485049255 ]
def test_process_standard_options_for_setup_help(self): f = StringIO() with redirect_stdout(f): process_standard_options_for_setup_help('--help-commands') self.assertIn('Commands processed by pyquickhelper:', f.getvalue()) f = StringIO() with redirect_stdout(f): ...
sdpython/pyquickhelper
[ 21, 10, 21, 22, 1388194285 ]
def test_process_standard_options_for_setup(self): temp = get_temp_folder( __file__, "temp_process_standard_options_for_setup") os.mkdir(os.path.join(temp, '_unittests')) f = StringIO() with redirect_stdout(f): process_standard_options_for_setup( [...
sdpython/pyquickhelper
[ 21, 10, 21, 22, 1388194285 ]
def test_clean_notebooks_for_numbers(self): temp = get_temp_folder(__file__, "temp_clean_notebooks_for_numbers") nb = os.path.join(temp, "..", "data", "notebook_with_svg.ipynb") fold = os.path.join(temp, '_doc', 'notebooks') self.assertNotExists(fold) os.makedirs(fold) sh...
sdpython/pyquickhelper
[ 21, 10, 21, 22, 1388194285 ]
def test_process_argv_for_unittest(self): li = ['unittests', '-d', '5'] res = process_argv_for_unittest(li, None) self.assertNotEmpty(res) li = ['unittests'] res = process_argv_for_unittest(li, None) self.assertEmpty(res) li = ['unittests', '-e', '.*'] res...
sdpython/pyquickhelper
[ 21, 10, 21, 22, 1388194285 ]
def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "ArmUserIdentity"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, certificate: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: Optional["CertificateProperties"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["CertificateDescription"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, certificate: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, certificate: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: Optional["CertificatePropertiesWithNonce"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, max_delivery_count: Optional[int] = None, default_ttl_as_iso8601: Optional[datetime.timedelta] = None, feedback: Optional["FeedbackProperties"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, key_source: Optional[str] = None, key_vault_properties: Optional[List["KeyVaultKeyProperties"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, endpoint_id: Optional[str] = None, health_status: Optional[Union[str, "EndpointHealthStatus"]] = None, last_known_error: Optional[str] = None, last_known_error_time: Optional[datetime.datetime] = None, last_successful_send_attempt_time: Opti...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["EndpointHealthData"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, key: str, value: str, endpoint_names: List[str], **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: Optional["EventHubConsumerGroupName"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: Optional[Dict[str, str]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["EventHubConsumerGroupInfo"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, retention_time_in_days: Optional[int] = None, partition_count: Optional[int] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, export_blob_container_uri: str, exclude_keys: bool, export_blob_name: Optional[str] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, identity: Optional["ManagedIdentity"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, failover_region: str, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, source: Union[str, "RoutingSource"], endpoint_names: List[str], is_enabled: bool, name: Optional[str] = None, condition: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, lock_duration_as_iso8601: Optional[datetime.timedelta] = None, ttl_as_iso8601: Optional[datetime.timedelta] = None, max_delivery_count: Optional[int] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: "GroupIdInformationProperties", **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, group_id: Optional[str] = None, required_members: Optional[List[str]] = None, required_zone_names: Optional[List[str]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, input_blob_container_uri: str, output_blob_container_uri: str, input_blob_name: Optional[str] = None, output_blob_name: Optional[str] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, identity: Optional[...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, location: str, sku: "IotHubSkuInfo", tags: Optional[Dict[str, str]] = None, etag: Optional[str] = None, properties: Optional["IotHubProperties"] = None, identity: Optional["ArmIdentity"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["IotHubDescription"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, location: Optional[str] = None, role: Optional[Union[str, "IotHubReplicaRoleType"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, message: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, authorization_policies: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None, public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, ip_filter_rules: Optional[List["IpFilterRule"]] = None, network_rule_sets: Optional["...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, streaming_endpoints: Optional[List[str]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["IotHubQuotaMetricInfo"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, sku: "IotHubSkuInfo", capacity: "IotHubCapacity", **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["IotHubSkuDescription"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: Union[str, "IotHubSku"], capacity: Optional[int] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, filter_name: str, action: Union[str, "IpFilterActionType"], ip_mask: str, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["JobResponse"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, key_identifier: Optional[str] = None, identity: Optional["ManagedIdentity"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, user_assigned_identity: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: Optional["RouteProperties"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, lock_duration_as_iso8601: Optional[datetime.timedelta] = None, ttl_as_iso8601: Optional[datetime.timedelta] = None, max_delivery_count: Optional[int] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, filter_name: str, ip_mask: str, action: Optional[Union[str, "NetworkRuleIPAction"]] = "Allow", **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, apply_to_built_in_event_hub_endpoint: bool, ip_rules: List["NetworkRuleSetIpRule"], default_action: Optional[Union[str, "DefaultAction"]] = "Deny", **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, display: Optional["OperationDisplay"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: str, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, properties: "PrivateEndpointConnectionProperties", **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, private_link_service_connection_state: "PrivateLinkServiceConnectionState", private_endpoint: Optional["PrivateEndpoint"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["GroupIdInformation"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, status: Union[str, "PrivateLinkServiceConnectionStatus"], description: str, actions_required: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, message: Optional[str] = None, severity: Optional[Union[str, "RouteErrorSeverity"]] = None, location: Optional["RouteErrorRange"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, line: Optional[int] = None, column: Optional[int] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, start: Optional["RouteErrorPosition"] = None, end: Optional["RouteErrorPosition"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: str, source: Union[str, "RoutingSource"], endpoint_names: List[str], is_enabled: bool, condition: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, service_bus_queues: Optional[List["RoutingServiceBusQueueEndpointProperties"]] = None, service_bus_topics: Optional[List["RoutingServiceBusTopicEndpointProperties"]] = None, event_hubs: Optional[List["RoutingEventHubProperties"]] = None, storage_con...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: str, id: Optional[str] = None, connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, iden...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, body: Optional[str] = None, app_properties: Optional[Dict[str, str]] = None, system_properties: Optional[Dict[str, str]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, endpoints: Optional["RoutingEndpoints"] = None, routes: Optional[List["RouteProperties"]] = None, fallback_route: Optional["FallbackRouteProperties"] = None, enrichments: Optional[List["EnrichmentProperties"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: str, id: Optional[str] = None, connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, iden...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: str, id: Optional[str] = None, connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, entity_path: Optional[str] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, iden...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, name: str, container_name: str, id: Optional[str] = None, connection_string: Optional[str] = None, endpoint_uri: Optional[str] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, identity: Optional...
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, tags: Optional[Any] = None, properties: Optional["RoutingTwinProperties"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, desired: Optional[Any] = None, reported: Optional[Any] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, key_name: str, rights: Union[str, "AccessRights"], primary_key: Optional[str] = None, secondary_key: Optional[str] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, value: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, connection_string: str, container_name: str, sas_ttl_as_iso8601: Optional[datetime.timedelta] = None, authentication_type: Optional[Union[str, "AuthenticationType"]] = None, identity: Optional["ManagedIdentity"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, tags: Optional[Dict[str, str]] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]
def __init__( self, *, routing_source: Optional[Union[str, "RoutingSource"]] = None, message: Optional["RoutingMessage"] = None, twin: Optional["RoutingTwin"] = None, **kwargs
Azure/azure-sdk-for-python
[ 3526, 2256, 3526, 986, 1335285972 ]