hexsha
string | size
int64 | ext
string | lang
string | max_stars_repo_path
string | max_stars_repo_name
string | max_stars_repo_head_hexsha
string | max_stars_repo_licenses
list | max_stars_count
int64 | max_stars_repo_stars_event_min_datetime
string | max_stars_repo_stars_event_max_datetime
string | max_issues_repo_path
string | max_issues_repo_name
string | max_issues_repo_head_hexsha
string | max_issues_repo_licenses
list | max_issues_count
int64 | max_issues_repo_issues_event_min_datetime
string | max_issues_repo_issues_event_max_datetime
string | max_forks_repo_path
string | max_forks_repo_name
string | max_forks_repo_head_hexsha
string | max_forks_repo_licenses
list | max_forks_count
int64 | max_forks_repo_forks_event_min_datetime
string | max_forks_repo_forks_event_max_datetime
string | content
string | avg_line_length
float64 | max_line_length
int64 | alphanum_fraction
float64 | qsc_code_num_words_quality_signal
int64 | qsc_code_num_chars_quality_signal
float64 | qsc_code_mean_word_length_quality_signal
float64 | qsc_code_frac_words_unique_quality_signal
float64 | qsc_code_frac_chars_top_2grams_quality_signal
float64 | qsc_code_frac_chars_top_3grams_quality_signal
float64 | qsc_code_frac_chars_top_4grams_quality_signal
float64 | qsc_code_frac_chars_dupe_5grams_quality_signal
float64 | qsc_code_frac_chars_dupe_6grams_quality_signal
float64 | qsc_code_frac_chars_dupe_7grams_quality_signal
float64 | qsc_code_frac_chars_dupe_8grams_quality_signal
float64 | qsc_code_frac_chars_dupe_9grams_quality_signal
float64 | qsc_code_frac_chars_dupe_10grams_quality_signal
float64 | qsc_code_frac_chars_replacement_symbols_quality_signal
float64 | qsc_code_frac_chars_digital_quality_signal
float64 | qsc_code_frac_chars_whitespace_quality_signal
float64 | qsc_code_size_file_byte_quality_signal
float64 | qsc_code_num_lines_quality_signal
float64 | qsc_code_num_chars_line_max_quality_signal
float64 | qsc_code_num_chars_line_mean_quality_signal
float64 | qsc_code_frac_chars_alphabet_quality_signal
float64 | qsc_code_frac_chars_comments_quality_signal
float64 | qsc_code_cate_xml_start_quality_signal
float64 | qsc_code_frac_lines_dupe_lines_quality_signal
float64 | qsc_code_cate_autogen_quality_signal
float64 | qsc_code_frac_lines_long_string_quality_signal
float64 | qsc_code_frac_chars_string_length_quality_signal
float64 | qsc_code_frac_chars_long_word_length_quality_signal
float64 | qsc_code_frac_lines_string_concat_quality_signal
float64 | qsc_code_cate_encoded_data_quality_signal
float64 | qsc_code_frac_chars_hex_words_quality_signal
float64 | qsc_code_frac_lines_prompt_comments_quality_signal
float64 | qsc_code_frac_lines_assert_quality_signal
float64 | qsc_codepython_cate_ast_quality_signal
float64 | qsc_codepython_frac_lines_func_ratio_quality_signal
float64 | qsc_codepython_cate_var_zero_quality_signal
bool | qsc_codepython_frac_lines_pass_quality_signal
float64 | qsc_codepython_frac_lines_import_quality_signal
float64 | qsc_codepython_frac_lines_simplefunc_quality_signal
float64 | qsc_codepython_score_lines_no_logic_quality_signal
float64 | qsc_codepython_frac_lines_print_quality_signal
float64 | qsc_code_num_words
int64 | qsc_code_num_chars
int64 | qsc_code_mean_word_length
int64 | qsc_code_frac_words_unique
null | qsc_code_frac_chars_top_2grams
int64 | qsc_code_frac_chars_top_3grams
int64 | qsc_code_frac_chars_top_4grams
int64 | qsc_code_frac_chars_dupe_5grams
int64 | qsc_code_frac_chars_dupe_6grams
int64 | qsc_code_frac_chars_dupe_7grams
int64 | qsc_code_frac_chars_dupe_8grams
int64 | qsc_code_frac_chars_dupe_9grams
int64 | qsc_code_frac_chars_dupe_10grams
int64 | qsc_code_frac_chars_replacement_symbols
int64 | qsc_code_frac_chars_digital
int64 | qsc_code_frac_chars_whitespace
int64 | qsc_code_size_file_byte
int64 | qsc_code_num_lines
int64 | qsc_code_num_chars_line_max
int64 | qsc_code_num_chars_line_mean
int64 | qsc_code_frac_chars_alphabet
int64 | qsc_code_frac_chars_comments
int64 | qsc_code_cate_xml_start
int64 | qsc_code_frac_lines_dupe_lines
int64 | qsc_code_cate_autogen
int64 | qsc_code_frac_lines_long_string
int64 | qsc_code_frac_chars_string_length
int64 | qsc_code_frac_chars_long_word_length
int64 | qsc_code_frac_lines_string_concat
null | qsc_code_cate_encoded_data
int64 | qsc_code_frac_chars_hex_words
int64 | qsc_code_frac_lines_prompt_comments
int64 | qsc_code_frac_lines_assert
int64 | qsc_codepython_cate_ast
int64 | qsc_codepython_frac_lines_func_ratio
int64 | qsc_codepython_cate_var_zero
int64 | qsc_codepython_frac_lines_pass
int64 | qsc_codepython_frac_lines_import
int64 | qsc_codepython_frac_lines_simplefunc
int64 | qsc_codepython_score_lines_no_logic
int64 | qsc_codepython_frac_lines_print
int64 | effective
string | hits
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2c50ed4e48f58d35c3ae963dcdc2c5876f1cb1b6
| 64
|
py
|
Python
|
neuro_pypes/convert/__init__.py
|
Neurita/pypes
|
e88d27ebba842e8fa1f36b52ca12a0b9d5777e89
|
[
"Apache-2.0"
] | 14
|
2015-11-30T19:32:08.000Z
|
2021-11-16T05:35:20.000Z
|
neuro_pypes/convert/__init__.py
|
Neurita/pypes
|
e88d27ebba842e8fa1f36b52ca12a0b9d5777e89
|
[
"Apache-2.0"
] | 42
|
2015-11-28T23:18:42.000Z
|
2021-02-23T01:45:02.000Z
|
neuro_pypes/convert/__init__.py
|
Neurita/pypes
|
e88d27ebba842e8fa1f36b52ca12a0b9d5777e89
|
[
"Apache-2.0"
] | 9
|
2015-12-09T17:10:59.000Z
|
2022-01-03T17:26:40.000Z
|
from neuro_pypes.convert.dicom_to_nifti import attach_dcm2niix
| 21.333333
| 62
| 0.890625
| 10
| 64
| 5.3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016949
| 0.078125
| 64
| 2
| 63
| 32
| 0.881356
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
2c5ffc02ab03d463d3c11e15028765df29c0732c
| 154
|
py
|
Python
|
learning-python/src/comments.py
|
learning-software-development/packt-publishing-tutorials
|
625618d9eff8d108645e1f4035ef1b00869d12af
|
[
"Unlicense"
] | null | null | null |
learning-python/src/comments.py
|
learning-software-development/packt-publishing-tutorials
|
625618d9eff8d108645e1f4035ef1b00869d12af
|
[
"Unlicense"
] | null | null | null |
learning-python/src/comments.py
|
learning-software-development/packt-publishing-tutorials
|
625618d9eff8d108645e1f4035ef1b00869d12af
|
[
"Unlicense"
] | null | null | null |
# This is a single line comment in Python
print("Hello World!") # This is a single comment
""" For multi-line
comments use three
double quotes
...
"""
| 15.4
| 48
| 0.694805
| 24
| 154
| 4.458333
| 0.75
| 0.11215
| 0.130841
| 0.242991
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.194805
| 154
| 9
| 49
| 17.111111
| 0.862903
| 0.422078
| 0
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
2c6f34610f9ec51fa206df78c6b51595782d1cd9
| 92,333
|
py
|
Python
|
boto3_type_annotations_with_docs/boto3_type_annotations/opsworkscm/client.py
|
cowboygneox/boto3_type_annotations
|
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
|
[
"MIT"
] | 119
|
2018-12-01T18:20:57.000Z
|
2022-02-02T10:31:29.000Z
|
boto3_type_annotations_with_docs/boto3_type_annotations/opsworkscm/client.py
|
cowboygneox/boto3_type_annotations
|
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
|
[
"MIT"
] | 15
|
2018-11-16T00:16:44.000Z
|
2021-11-13T03:44:18.000Z
|
boto3_type_annotations_with_docs/boto3_type_annotations/opsworkscm/client.py
|
cowboygneox/boto3_type_annotations
|
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
|
[
"MIT"
] | 11
|
2019-05-06T05:26:51.000Z
|
2021-09-28T15:27:59.000Z
|
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def associate_node(self, ServerName: str, NodeName: str, EngineAttributes: List) -> Dict:
"""
Associates a new node with the server. For more information about how to disassociate a node, see DisassociateNode .
On a Chef server: This command is an alternative to ``knife bootstrap`` .
Example (Chef): ``aws opsworks-cm associate-node --server-name *MyServer* --node-name *MyManagedNode* --engine-attributes "Name=*CHEF_ORGANIZATION* ,Value=default" "Name=*CHEF_NODE_PUBLIC_KEY* ,Value=*public-key-pem* "``
On a Puppet server, this command is an alternative to the ``puppet cert sign`` command that signs a Puppet node CSR.
Example (Chef): ``aws opsworks-cm associate-node --server-name *MyServer* --node-name *MyManagedNode* --engine-attributes "Name=*PUPPET_NODE_CSR* ,Value=*csr-pem* "``
A node can can only be associated with servers that are in a ``HEALTHY`` state. Otherwise, an ``InvalidStateException`` is thrown. A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid. The AssociateNode API call can be integrated into Auto Scaling configurations, AWS Cloudformation templates, or the user data of a server's instance.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/AssociateNode>`_
**Request Syntax**
::
response = client.associate_node(
ServerName='string',
NodeName='string',
EngineAttributes=[
{
'Name': 'string',
'Value': 'string'
},
]
)
**Response Syntax**
::
{
'NodeAssociationStatusToken': 'string'
}
**Response Structure**
- *(dict) --*
- **NodeAssociationStatusToken** *(string) --*
Contains a token which can be passed to the ``DescribeNodeAssociationStatus`` API call to get the status of the association request.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server with which to associate the node.
:type NodeName: string
:param NodeName: **[REQUIRED]**
The name of the node.
:type EngineAttributes: list
:param EngineAttributes: **[REQUIRED]**
Engine attributes used for associating the node.
**Attributes accepted in a AssociateNode request for Chef**
* ``CHEF_ORGANIZATION`` : The Chef organization with which the node is associated. By default only one organization named ``default`` can exist.
* ``CHEF_NODE_PUBLIC_KEY`` : A PEM-formatted public key. This key is required for the ``chef-client`` agent to access the Chef API.
**Attributes accepted in a AssociateNode request for Puppet**
* ``PUPPET_NODE_CSR`` : A PEM-formatted certificate-signing request (CSR) that is created by the node.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
:rtype: dict
:returns:
"""
pass
def can_paginate(self, operation_name: str = None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is ``create_foo``, and you\'d normally invoke the
operation as ``client.create_foo(**kwargs)``, if the
``create_foo`` operation can be paginated, you can use the
call ``client.get_paginator(\"create_foo\")``.
:return: ``True`` if the operation can be paginated,
``False`` otherwise.
"""
pass
def create_backup(self, ServerName: str, Description: str = None) -> Dict:
"""
Creates an application-level backup of a server. While the server is in the ``BACKING_UP`` state, the server cannot be changed, and no additional backup can be created.
Backups can be created for servers in ``RUNNING`` , ``HEALTHY`` , and ``UNHEALTHY`` states. By default, you can create a maximum of 50 manual backups.
This operation is asynchronous.
A ``LimitExceededException`` is thrown when the maximum number of manual backups is reached. An ``InvalidStateException`` is thrown when the server is not in any of the following states: RUNNING, HEALTHY, or UNHEALTHY. A ``ResourceNotFoundException`` is thrown when the server is not found. A ``ValidationException`` is thrown when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/CreateBackup>`_
**Request Syntax**
::
response = client.create_backup(
ServerName='string',
Description='string'
)
**Response Syntax**
::
{
'Backup': {
'BackupArn': 'string',
'BackupId': 'string',
'BackupType': 'AUTOMATED'|'MANUAL',
'CreatedAt': datetime(2015, 1, 1),
'Description': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'PreferredBackupWindow': 'string',
'PreferredMaintenanceWindow': 'string',
'S3DataSize': 123,
'S3DataUrl': 'string',
'S3LogUrl': 'string',
'SecurityGroupIds': [
'string',
],
'ServerName': 'string',
'ServiceRoleArn': 'string',
'Status': 'IN_PROGRESS'|'OK'|'FAILED'|'DELETING',
'StatusDescription': 'string',
'SubnetIds': [
'string',
],
'ToolsVersion': 'string',
'UserArn': 'string'
}
}
**Response Structure**
- *(dict) --*
- **Backup** *(dict) --*
Backup created by request.
- **BackupArn** *(string) --*
The ARN of the backup.
- **BackupId** *(string) --*
The generated ID of the backup. Example: ``myServerName-yyyyMMddHHmmssSSS``
- **BackupType** *(string) --*
The backup type. Valid values are ``automated`` or ``manual`` .
- **CreatedAt** *(datetime) --*
The time stamp when the backup was created in the database. Example: ``2016-07-29T13:38:47.520Z``
- **Description** *(string) --*
A user-provided description for a manual backup. This field is empty for automated backups.
- **Engine** *(string) --*
The engine type that is obtained from the server when the backup is created.
- **EngineModel** *(string) --*
The engine model that is obtained from the server when the backup is created.
- **EngineVersion** *(string) --*
The engine version that is obtained from the server when the backup is created.
- **InstanceProfileArn** *(string) --*
The EC2 instance profile ARN that is obtained from the server when the backup is created. Because this value is stored, you are not required to provide the InstanceProfileArn again if you restore a backup.
- **InstanceType** *(string) --*
The instance type that is obtained from the server when the backup is created.
- **KeyPair** *(string) --*
The key pair that is obtained from the server when the backup is created.
- **PreferredBackupWindow** *(string) --*
The preferred backup period that is obtained from the server when the backup is created.
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period that is obtained from the server when the backup is created.
- **S3DataSize** *(integer) --*
This field is deprecated and is no longer used.
- **S3DataUrl** *(string) --*
This field is deprecated and is no longer used.
- **S3LogUrl** *(string) --*
The Amazon S3 URL of the backup's log file.
- **SecurityGroupIds** *(list) --*
The security group IDs that are obtained from the server when the backup is created.
- *(string) --*
- **ServerName** *(string) --*
The name of the server from which the backup was made.
- **ServiceRoleArn** *(string) --*
The service role ARN that is obtained from the server when the backup is created.
- **Status** *(string) --*
The status of a backup while in progress.
- **StatusDescription** *(string) --*
An informational message about backup status.
- **SubnetIds** *(list) --*
The subnet IDs that are obtained from the server when the backup is created.
- *(string) --*
- **ToolsVersion** *(string) --*
The version of AWS OpsWorks CM-specific tools that is obtained from the server when the backup is created.
- **UserArn** *(string) --*
The IAM user ARN of the requester for manual backups. This field is empty for automated backups.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server that you want to back up.
:type Description: string
:param Description:
A user-defined description of the backup.
:rtype: dict
:returns:
"""
pass
def create_server(self, ServerName: str, InstanceProfileArn: str, InstanceType: str, ServiceRoleArn: str, AssociatePublicIpAddress: bool = None, DisableAutomatedBackup: bool = None, Engine: str = None, EngineModel: str = None, EngineVersion: str = None, EngineAttributes: List = None, BackupRetentionCount: int = None, KeyPair: str = None, PreferredMaintenanceWindow: str = None, PreferredBackupWindow: str = None, SecurityGroupIds: List = None, SubnetIds: List = None, BackupId: str = None) -> Dict:
"""
Creates and immedately starts a new server. The server is ready to use when it is in the ``HEALTHY`` state. By default, you can create a maximum of 10 servers.
This operation is asynchronous.
A ``LimitExceededException`` is thrown when you have created the maximum number of servers (10). A ``ResourceAlreadyExistsException`` is thrown when a server with the same name already exists in the account. A ``ResourceNotFoundException`` is thrown when you specify a backup ID that is not valid or is for a backup that does not exist. A ``ValidationException`` is thrown when parameters of the request are not valid.
If you do not specify a security group by adding the ``SecurityGroupIds`` parameter, AWS OpsWorks creates a new security group.
*Chef Automate:* The default security group opens the Chef server to the world on TCP port 443. If a KeyName is present, AWS OpsWorks enables SSH access. SSH is also open to the world on TCP port 22.
*Puppet Enterprise:* The default security group opens TCP ports 22, 443, 4433, 8140, 8142, 8143, and 8170. If a KeyName is present, AWS OpsWorks enables SSH access. SSH is also open to the world on TCP port 22.
By default, your server is accessible from any IP address. We recommend that you update your security group rules to allow access from known IP addresses and address ranges only. To edit security group rules, open Security Groups in the navigation pane of the EC2 management console.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/CreateServer>`_
**Request Syntax**
::
response = client.create_server(
AssociatePublicIpAddress=True|False,
DisableAutomatedBackup=True|False,
Engine='string',
EngineModel='string',
EngineVersion='string',
EngineAttributes=[
{
'Name': 'string',
'Value': 'string'
},
],
BackupRetentionCount=123,
ServerName='string',
InstanceProfileArn='string',
InstanceType='string',
KeyPair='string',
PreferredMaintenanceWindow='string',
PreferredBackupWindow='string',
SecurityGroupIds=[
'string',
],
ServiceRoleArn='string',
SubnetIds=[
'string',
],
BackupId='string'
)
**Response Syntax**
::
{
'Server': {
'AssociatePublicIpAddress': True|False,
'BackupRetentionCount': 123,
'ServerName': 'string',
'CreatedAt': datetime(2015, 1, 1),
'CloudFormationStackArn': 'string',
'DisableAutomatedBackup': True|False,
'Endpoint': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'MaintenanceStatus': 'SUCCESS'|'FAILED',
'PreferredMaintenanceWindow': 'string',
'PreferredBackupWindow': 'string',
'SecurityGroupIds': [
'string',
],
'ServiceRoleArn': 'string',
'Status': 'BACKING_UP'|'CONNECTION_LOST'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED'|'HEALTHY'|'RUNNING'|'RESTORING'|'SETUP'|'UNDER_MAINTENANCE'|'UNHEALTHY'|'TERMINATED',
'StatusReason': 'string',
'SubnetIds': [
'string',
],
'ServerArn': 'string'
}
}
**Response Structure**
- *(dict) --*
- **Server** *(dict) --*
The server that is created by the request.
- **AssociatePublicIpAddress** *(boolean) --*
Associate a public IP address with a server that you are launching.
- **BackupRetentionCount** *(integer) --*
The number of automated backups to keep.
- **ServerName** *(string) --*
The name of the server.
- **CreatedAt** *(datetime) --*
Time stamp of server creation. Example ``2016-07-29T13:38:47.520Z``
- **CloudFormationStackArn** *(string) --*
The ARN of the CloudFormation stack that was used to create the server.
- **DisableAutomatedBackup** *(boolean) --*
Disables automated backups. The number of stored backups is dependent on the value of PreferredBackupCount.
- **Endpoint** *(string) --*
A DNS name that can be used to access the engine. Example: ``myserver-asdfghjkl.us-east-1.opsworks.io``
- **Engine** *(string) --*
The engine type of the server. Valid values in this release include ``Chef`` and ``Puppet`` .
- **EngineModel** *(string) --*
The engine model of the server. Valid values in this release include ``Monolithic`` for Puppet and ``Single`` for Chef.
- **EngineAttributes** *(list) --*
The response of a createServer() request returns the master credential to access the server in EngineAttributes. These credentials are not stored by AWS OpsWorks CM; they are returned only as part of the result of createServer().
**Attributes returned in a createServer response for Chef**
* ``CHEF_PIVOTAL_KEY`` : A base64-encoded RSA private key that is generated by AWS OpsWorks for Chef Automate. This private key is required to access the Chef API.
* ``CHEF_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Chef starter kit, which includes a README, a configuration file, and the required RSA private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents. From this directory, you can run Knife commands.
**Attributes returned in a createServer response for Puppet**
* ``PUPPET_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Puppet starter kit, including a README and a required private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents.
* ``PUPPET_ADMIN_PASSWORD`` : An administrator password that you can use to sign in to the Puppet Enterprise console after the server is online.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
- **EngineVersion** *(string) --*
The engine version of the server. For a Chef server, the valid value for EngineVersion is currently ``12`` . For a Puppet server, the valid value is ``2017`` .
- **InstanceProfileArn** *(string) --*
The instance profile ARN of the server.
- **InstanceType** *(string) --*
The instance type for the server, as specified in the CloudFormation stack. This might not be the same instance type that is shown in the EC2 console.
- **KeyPair** *(string) --*
The key pair associated with the server.
- **MaintenanceStatus** *(string) --*
The status of the most recent server maintenance run. Shows ``SUCCESS`` or ``FAILED`` .
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period specified for the server.
- **PreferredBackupWindow** *(string) --*
The preferred backup period specified for the server.
- **SecurityGroupIds** *(list) --*
The security group IDs for the server, as specified in the CloudFormation stack. These might not be the same security groups that are shown in the EC2 console.
- *(string) --*
- **ServiceRoleArn** *(string) --*
The service role ARN used to create the server.
- **Status** *(string) --*
The server's status. This field displays the states of actions in progress, such as creating, running, or backing up the server, as well as the server's health state.
- **StatusReason** *(string) --*
Depending on the server status, this field has either a human-readable message (such as a create or backup error), or an escaped block of JSON (used for health check results).
- **SubnetIds** *(list) --*
The subnet IDs specified in a CreateServer request.
- *(string) --*
- **ServerArn** *(string) --*
The ARN of the server.
:type AssociatePublicIpAddress: boolean
:param AssociatePublicIpAddress:
Associate a public IP address with a server that you are launching. Valid values are ``true`` or ``false`` . The default value is ``true`` .
:type DisableAutomatedBackup: boolean
:param DisableAutomatedBackup:
Enable or disable scheduled backups. Valid values are ``true`` or ``false`` . The default value is ``true`` .
:type Engine: string
:param Engine:
The configuration management engine to use. Valid values include ``Chef`` and ``Puppet`` .
:type EngineModel: string
:param EngineModel:
The engine model of the server. Valid values in this release include ``Monolithic`` for Puppet and ``Single`` for Chef.
:type EngineVersion: string
:param EngineVersion:
The major release version of the engine that you want to use. For a Chef server, the valid value for EngineVersion is currently ``12`` . For a Puppet server, the valid value is ``2017`` .
:type EngineAttributes: list
:param EngineAttributes:
Optional engine attributes on a specified server.
**Attributes accepted in a Chef createServer request:**
* ``CHEF_PIVOTAL_KEY`` : A base64-encoded RSA public key. The corresponding private key is required to access the Chef API. When no CHEF_PIVOTAL_KEY is set, a private key is generated and returned in the response.
* ``CHEF_DELIVERY_ADMIN_PASSWORD`` : The password for the administrative user in the Chef Automate GUI. The password length is a minimum of eight characters, and a maximum of 32. The password can contain letters, numbers, and special characters (!/@#$%^&+=_). The password must contain at least one lower case letter, one upper case letter, one number, and one special character. When no CHEF_DELIVERY_ADMIN_PASSWORD is set, one is generated and returned in the response.
**Attributes accepted in a Puppet createServer request:**
* ``PUPPET_ADMIN_PASSWORD`` : To work with the Puppet Enterprise console, a password must use ASCII characters.
* ``PUPPET_R10K_REMOTE`` : The r10k remote is the URL of your control repository (for example, ssh://git@your.git-repo.com:user/control-repo.git). Specifying an r10k remote opens TCP port 8170.
* ``PUPPET_R10K_PRIVATE_KEY`` : If you are using a private Git repository, add PUPPET_R10K_PRIVATE_KEY to specify an SSH URL and a PEM-encoded private SSH key.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
:type BackupRetentionCount: integer
:param BackupRetentionCount:
The number of automated backups that you want to keep. Whenever a new backup is created, AWS OpsWorks CM deletes the oldest backups if this number is exceeded. The default value is ``1`` .
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server. The server name must be unique within your AWS account, within each region. Server names must start with a letter; then letters, numbers, or hyphens (-) are allowed, up to a maximum of 40 characters.
:type InstanceProfileArn: string
:param InstanceProfileArn: **[REQUIRED]**
The ARN of the instance profile that your Amazon EC2 instances use. Although the AWS OpsWorks console typically creates the instance profile for you, if you are using API commands instead, run the service-role-creation.yaml AWS CloudFormation template, located at https://s3.amazonaws.com/opsworks-cm-us-east-1-prod-default-assets/misc/opsworks-cm-roles.yaml. This template creates a CloudFormation stack that includes the instance profile you need.
:type InstanceType: string
:param InstanceType: **[REQUIRED]**
The Amazon EC2 instance type to use. For example, ``m4.large`` . Recommended instance types include ``t2.medium`` and greater, ``m4.*`` , or ``c4.xlarge`` and greater.
:type KeyPair: string
:param KeyPair:
The Amazon EC2 key pair to set for the instance. This parameter is optional; if desired, you may specify this parameter to connect to your instances by using SSH.
:type PreferredMaintenanceWindow: string
:param PreferredMaintenanceWindow:
The start time for a one-hour period each week during which AWS OpsWorks CM performs maintenance on the instance. Valid values must be specified in the following format: ``DDD:HH:MM`` . The specified time is in coordinated universal time (UTC). The default value is a random one-hour period on Tuesday, Wednesday, or Friday. See ``TimeWindowDefinition`` for more information.
**Example:** ``Mon:08:00`` , which represents a start time of every Monday at 08:00 UTC. (8:00 a.m.)
:type PreferredBackupWindow: string
:param PreferredBackupWindow:
The start time for a one-hour period during which AWS OpsWorks CM backs up application-level data on your server if automated backups are enabled. Valid values must be specified in one of the following formats:
* ``HH:MM`` for daily backups
* ``DDD:HH:MM`` for weekly backups
The specified time is in coordinated universal time (UTC). The default value is a random, daily start time.
**Example:** ``08:00`` , which represents a daily start time of 08:00 UTC.
**Example:** ``Mon:08:00`` , which represents a start time of every Monday at 08:00 UTC. (8:00 a.m.)
:type SecurityGroupIds: list
:param SecurityGroupIds:
A list of security group IDs to attach to the Amazon EC2 instance. If you add this parameter, the specified security groups must be within the VPC that is specified by ``SubnetIds`` .
If you do not specify this parameter, AWS OpsWorks CM creates one new security group that uses TCP ports 22 and 443, open to 0.0.0.0/0 (everyone).
- *(string) --*
:type ServiceRoleArn: string
:param ServiceRoleArn: **[REQUIRED]**
The service role that the AWS OpsWorks CM service backend uses to work with your account. Although the AWS OpsWorks management console typically creates the service role for you, if you are using the AWS CLI or API commands, run the service-role-creation.yaml AWS CloudFormation template, located at https://s3.amazonaws.com/opsworks-cm-us-east-1-prod-default-assets/misc/opsworks-cm-roles.yaml. This template creates a CloudFormation stack that includes the service role and instance profile that you need.
:type SubnetIds: list
:param SubnetIds:
The IDs of subnets in which to launch the server EC2 instance.
Amazon EC2-Classic customers: This field is required. All servers must run within a VPC. The VPC must have \"Auto Assign Public IP\" enabled.
EC2-VPC customers: This field is optional. If you do not specify subnet IDs, your EC2 instances are created in a default subnet that is selected by Amazon EC2. If you specify subnet IDs, the VPC must have \"Auto Assign Public IP\" enabled.
For more information about supported Amazon EC2 platforms, see `Supported Platforms <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html>`__ .
- *(string) --*
:type BackupId: string
:param BackupId:
If you specify this field, AWS OpsWorks CM creates the server by using the backup represented by BackupId.
:rtype: dict
:returns:
"""
pass
def delete_backup(self, BackupId: str) -> Dict:
"""
Deletes a backup. You can delete both manual and automated backups. This operation is asynchronous.
An ``InvalidStateException`` is thrown when a backup deletion is already in progress. A ``ResourceNotFoundException`` is thrown when the backup does not exist. A ``ValidationException`` is thrown when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DeleteBackup>`_
**Request Syntax**
::
response = client.delete_backup(
BackupId='string'
)
**Response Syntax**
::
{}
**Response Structure**
- *(dict) --*
:type BackupId: string
:param BackupId: **[REQUIRED]**
The ID of the backup to delete. Run the DescribeBackups command to get a list of backup IDs. Backup IDs are in the format ``ServerName-yyyyMMddHHmmssSSS`` .
:rtype: dict
:returns:
"""
pass
def delete_server(self, ServerName: str) -> Dict:
"""
Deletes the server and the underlying AWS CloudFormation stacks (including the server's EC2 instance). When you run this command, the server state is updated to ``DELETING`` . After the server is deleted, it is no longer returned by ``DescribeServer`` requests. If the AWS CloudFormation stack cannot be deleted, the server cannot be deleted.
This operation is asynchronous.
An ``InvalidStateException`` is thrown when a server deletion is already in progress. A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DeleteServer>`_
**Request Syntax**
::
response = client.delete_server(
ServerName='string'
)
**Response Syntax**
::
{}
**Response Structure**
- *(dict) --*
:type ServerName: string
:param ServerName: **[REQUIRED]**
The ID of the server to delete.
:rtype: dict
:returns:
"""
pass
def describe_account_attributes(self) -> Dict:
"""
Describes your account attributes, and creates requests to increase limits before they are reached or exceeded.
This operation is synchronous.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DescribeAccountAttributes>`_
**Request Syntax**
::
response = client.describe_account_attributes()
**Response Syntax**
::
{
'Attributes': [
{
'Name': 'string',
'Maximum': 123,
'Used': 123
},
]
}
**Response Structure**
- *(dict) --*
- **Attributes** *(list) --*
The attributes that are currently set for the account.
- *(dict) --*
Stores account attributes.
- **Name** *(string) --*
The attribute name. The following are supported attribute names.
* *ServerLimit:* The number of current servers/maximum number of servers allowed. By default, you can have a maximum of 10 servers.
* *ManualBackupLimit:* The number of current manual backups/maximum number of backups allowed. By default, you can have a maximum of 50 manual backups saved.
- **Maximum** *(integer) --*
The maximum allowed value.
- **Used** *(integer) --*
The current usage, such as the current number of servers that are associated with the account.
:rtype: dict
:returns:
"""
pass
def describe_backups(self, BackupId: str = None, ServerName: str = None, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Describes backups. The results are ordered by time, with newest backups first. If you do not specify a BackupId or ServerName, the command returns all backups.
This operation is synchronous.
A ``ResourceNotFoundException`` is thrown when the backup does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DescribeBackups>`_
**Request Syntax**
::
response = client.describe_backups(
BackupId='string',
ServerName='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'Backups': [
{
'BackupArn': 'string',
'BackupId': 'string',
'BackupType': 'AUTOMATED'|'MANUAL',
'CreatedAt': datetime(2015, 1, 1),
'Description': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'PreferredBackupWindow': 'string',
'PreferredMaintenanceWindow': 'string',
'S3DataSize': 123,
'S3DataUrl': 'string',
'S3LogUrl': 'string',
'SecurityGroupIds': [
'string',
],
'ServerName': 'string',
'ServiceRoleArn': 'string',
'Status': 'IN_PROGRESS'|'OK'|'FAILED'|'DELETING',
'StatusDescription': 'string',
'SubnetIds': [
'string',
],
'ToolsVersion': 'string',
'UserArn': 'string'
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **Backups** *(list) --*
Contains the response to a ``DescribeBackups`` request.
- *(dict) --*
Describes a single backup.
- **BackupArn** *(string) --*
The ARN of the backup.
- **BackupId** *(string) --*
The generated ID of the backup. Example: ``myServerName-yyyyMMddHHmmssSSS``
- **BackupType** *(string) --*
The backup type. Valid values are ``automated`` or ``manual`` .
- **CreatedAt** *(datetime) --*
The time stamp when the backup was created in the database. Example: ``2016-07-29T13:38:47.520Z``
- **Description** *(string) --*
A user-provided description for a manual backup. This field is empty for automated backups.
- **Engine** *(string) --*
The engine type that is obtained from the server when the backup is created.
- **EngineModel** *(string) --*
The engine model that is obtained from the server when the backup is created.
- **EngineVersion** *(string) --*
The engine version that is obtained from the server when the backup is created.
- **InstanceProfileArn** *(string) --*
The EC2 instance profile ARN that is obtained from the server when the backup is created. Because this value is stored, you are not required to provide the InstanceProfileArn again if you restore a backup.
- **InstanceType** *(string) --*
The instance type that is obtained from the server when the backup is created.
- **KeyPair** *(string) --*
The key pair that is obtained from the server when the backup is created.
- **PreferredBackupWindow** *(string) --*
The preferred backup period that is obtained from the server when the backup is created.
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period that is obtained from the server when the backup is created.
- **S3DataSize** *(integer) --*
This field is deprecated and is no longer used.
- **S3DataUrl** *(string) --*
This field is deprecated and is no longer used.
- **S3LogUrl** *(string) --*
The Amazon S3 URL of the backup's log file.
- **SecurityGroupIds** *(list) --*
The security group IDs that are obtained from the server when the backup is created.
- *(string) --*
- **ServerName** *(string) --*
The name of the server from which the backup was made.
- **ServiceRoleArn** *(string) --*
The service role ARN that is obtained from the server when the backup is created.
- **Status** *(string) --*
The status of a backup while in progress.
- **StatusDescription** *(string) --*
An informational message about backup status.
- **SubnetIds** *(list) --*
The subnet IDs that are obtained from the server when the backup is created.
- *(string) --*
- **ToolsVersion** *(string) --*
The version of AWS OpsWorks CM-specific tools that is obtained from the server when the backup is created.
- **UserArn** *(string) --*
The IAM user ARN of the requester for manual backups. This field is empty for automated backups.
- **NextToken** *(string) --*
This is not currently implemented for ``DescribeBackups`` requests.
:type BackupId: string
:param BackupId:
Describes a single backup.
:type ServerName: string
:param ServerName:
Returns backups for the server with the specified ServerName.
:type NextToken: string
:param NextToken:
This is not currently implemented for ``DescribeBackups`` requests.
:type MaxResults: integer
:param MaxResults:
This is not currently implemented for ``DescribeBackups`` requests.
:rtype: dict
:returns:
"""
pass
def describe_events(self, ServerName: str, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Describes events for a specified server. Results are ordered by time, with newest events first.
This operation is synchronous.
A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DescribeEvents>`_
**Request Syntax**
::
response = client.describe_events(
ServerName='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'ServerEvents': [
{
'CreatedAt': datetime(2015, 1, 1),
'ServerName': 'string',
'Message': 'string',
'LogUrl': 'string'
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **ServerEvents** *(list) --*
Contains the response to a ``DescribeEvents`` request.
- *(dict) --*
An event that is related to the server, such as the start of maintenance or backup.
- **CreatedAt** *(datetime) --*
The time when the event occurred.
- **ServerName** *(string) --*
The name of the server on or for which the event occurred.
- **Message** *(string) --*
A human-readable informational or status message.
- **LogUrl** *(string) --*
The Amazon S3 URL of the event's log file.
- **NextToken** *(string) --*
NextToken is a string that is returned in some command responses. It indicates that not all entries have been returned, and that you must run at least one more request to get remaining items. To get remaining results, call ``DescribeEvents`` again, and assign the token from the previous results as the value of the ``nextToken`` parameter. If there are no more results, the response object's ``nextToken`` parameter value is ``null`` . Setting a ``nextToken`` value that was not returned in your previous results causes an ``InvalidNextTokenException`` to occur.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server for which you want to view events.
:type NextToken: string
:param NextToken:
NextToken is a string that is returned in some command responses. It indicates that not all entries have been returned, and that you must run at least one more request to get remaining items. To get remaining results, call ``DescribeEvents`` again, and assign the token from the previous results as the value of the ``nextToken`` parameter. If there are no more results, the response object\'s ``nextToken`` parameter value is ``null`` . Setting a ``nextToken`` value that was not returned in your previous results causes an ``InvalidNextTokenException`` to occur.
:type MaxResults: integer
:param MaxResults:
To receive a paginated response, use this parameter to specify the maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a ``NextToken`` value that you can assign to the ``NextToken`` request parameter to get the next set of results.
:rtype: dict
:returns:
"""
pass
def describe_node_association_status(self, NodeAssociationStatusToken: str, ServerName: str) -> Dict:
"""
Returns the current status of an existing association or disassociation request.
A ``ResourceNotFoundException`` is thrown when no recent association or disassociation request with the specified token is found, or when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DescribeNodeAssociationStatus>`_
**Request Syntax**
::
response = client.describe_node_association_status(
NodeAssociationStatusToken='string',
ServerName='string'
)
**Response Syntax**
::
{
'NodeAssociationStatus': 'SUCCESS'|'FAILED'|'IN_PROGRESS',
'EngineAttributes': [
{
'Name': 'string',
'Value': 'string'
},
]
}
**Response Structure**
- *(dict) --*
- **NodeAssociationStatus** *(string) --*
The status of the association or disassociation request.
**Possible values:**
* ``SUCCESS`` : The association or disassociation succeeded.
* ``FAILED`` : The association or disassociation failed.
* ``IN_PROGRESS`` : The association or disassociation is still in progress.
- **EngineAttributes** *(list) --*
Attributes specific to the node association. In Puppet, the attibute PUPPET_NODE_CERT contains the signed certificate (the result of the CSR).
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
:type NodeAssociationStatusToken: string
:param NodeAssociationStatusToken: **[REQUIRED]**
The token returned in either the AssociateNodeResponse or the DisassociateNodeResponse.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server from which to disassociate the node.
:rtype: dict
:returns:
"""
pass
def describe_servers(self, ServerName: str = None, NextToken: str = None, MaxResults: int = None) -> Dict:
"""
Lists all configuration management servers that are identified with your account. Only the stored results from Amazon DynamoDB are returned. AWS OpsWorks CM does not query other services.
This operation is synchronous.
A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DescribeServers>`_
**Request Syntax**
::
response = client.describe_servers(
ServerName='string',
NextToken='string',
MaxResults=123
)
**Response Syntax**
::
{
'Servers': [
{
'AssociatePublicIpAddress': True|False,
'BackupRetentionCount': 123,
'ServerName': 'string',
'CreatedAt': datetime(2015, 1, 1),
'CloudFormationStackArn': 'string',
'DisableAutomatedBackup': True|False,
'Endpoint': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'MaintenanceStatus': 'SUCCESS'|'FAILED',
'PreferredMaintenanceWindow': 'string',
'PreferredBackupWindow': 'string',
'SecurityGroupIds': [
'string',
],
'ServiceRoleArn': 'string',
'Status': 'BACKING_UP'|'CONNECTION_LOST'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED'|'HEALTHY'|'RUNNING'|'RESTORING'|'SETUP'|'UNDER_MAINTENANCE'|'UNHEALTHY'|'TERMINATED',
'StatusReason': 'string',
'SubnetIds': [
'string',
],
'ServerArn': 'string'
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **Servers** *(list) --*
Contains the response to a ``DescribeServers`` request.
*For Puppet Server:* ``DescribeServersResponse$Servers$EngineAttributes`` contains PUPPET_API_CA_CERT. This is the PEM-encoded CA certificate that is used by the Puppet API over TCP port number 8140. The CA certificate is also used to sign node certificates.
- *(dict) --*
Describes a configuration management server.
- **AssociatePublicIpAddress** *(boolean) --*
Associate a public IP address with a server that you are launching.
- **BackupRetentionCount** *(integer) --*
The number of automated backups to keep.
- **ServerName** *(string) --*
The name of the server.
- **CreatedAt** *(datetime) --*
Time stamp of server creation. Example ``2016-07-29T13:38:47.520Z``
- **CloudFormationStackArn** *(string) --*
The ARN of the CloudFormation stack that was used to create the server.
- **DisableAutomatedBackup** *(boolean) --*
Disables automated backups. The number of stored backups is dependent on the value of PreferredBackupCount.
- **Endpoint** *(string) --*
A DNS name that can be used to access the engine. Example: ``myserver-asdfghjkl.us-east-1.opsworks.io``
- **Engine** *(string) --*
The engine type of the server. Valid values in this release include ``Chef`` and ``Puppet`` .
- **EngineModel** *(string) --*
The engine model of the server. Valid values in this release include ``Monolithic`` for Puppet and ``Single`` for Chef.
- **EngineAttributes** *(list) --*
The response of a createServer() request returns the master credential to access the server in EngineAttributes. These credentials are not stored by AWS OpsWorks CM; they are returned only as part of the result of createServer().
**Attributes returned in a createServer response for Chef**
* ``CHEF_PIVOTAL_KEY`` : A base64-encoded RSA private key that is generated by AWS OpsWorks for Chef Automate. This private key is required to access the Chef API.
* ``CHEF_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Chef starter kit, which includes a README, a configuration file, and the required RSA private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents. From this directory, you can run Knife commands.
**Attributes returned in a createServer response for Puppet**
* ``PUPPET_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Puppet starter kit, including a README and a required private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents.
* ``PUPPET_ADMIN_PASSWORD`` : An administrator password that you can use to sign in to the Puppet Enterprise console after the server is online.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
- **EngineVersion** *(string) --*
The engine version of the server. For a Chef server, the valid value for EngineVersion is currently ``12`` . For a Puppet server, the valid value is ``2017`` .
- **InstanceProfileArn** *(string) --*
The instance profile ARN of the server.
- **InstanceType** *(string) --*
The instance type for the server, as specified in the CloudFormation stack. This might not be the same instance type that is shown in the EC2 console.
- **KeyPair** *(string) --*
The key pair associated with the server.
- **MaintenanceStatus** *(string) --*
The status of the most recent server maintenance run. Shows ``SUCCESS`` or ``FAILED`` .
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period specified for the server.
- **PreferredBackupWindow** *(string) --*
The preferred backup period specified for the server.
- **SecurityGroupIds** *(list) --*
The security group IDs for the server, as specified in the CloudFormation stack. These might not be the same security groups that are shown in the EC2 console.
- *(string) --*
- **ServiceRoleArn** *(string) --*
The service role ARN used to create the server.
- **Status** *(string) --*
The server's status. This field displays the states of actions in progress, such as creating, running, or backing up the server, as well as the server's health state.
- **StatusReason** *(string) --*
Depending on the server status, this field has either a human-readable message (such as a create or backup error), or an escaped block of JSON (used for health check results).
- **SubnetIds** *(list) --*
The subnet IDs specified in a CreateServer request.
- *(string) --*
- **ServerArn** *(string) --*
The ARN of the server.
- **NextToken** *(string) --*
This is not currently implemented for ``DescribeServers`` requests.
:type ServerName: string
:param ServerName:
Describes the server with the specified ServerName.
:type NextToken: string
:param NextToken:
This is not currently implemented for ``DescribeServers`` requests.
:type MaxResults: integer
:param MaxResults:
This is not currently implemented for ``DescribeServers`` requests.
:rtype: dict
:returns:
"""
pass
def disassociate_node(self, ServerName: str, NodeName: str, EngineAttributes: List = None) -> Dict:
"""
Disassociates a node from an AWS OpsWorks CM server, and removes the node from the server's managed nodes. After a node is disassociated, the node key pair is no longer valid for accessing the configuration manager's API. For more information about how to associate a node, see AssociateNode .
A node can can only be disassociated from a server that is in a ``HEALTHY`` state. Otherwise, an ``InvalidStateException`` is thrown. A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/DisassociateNode>`_
**Request Syntax**
::
response = client.disassociate_node(
ServerName='string',
NodeName='string',
EngineAttributes=[
{
'Name': 'string',
'Value': 'string'
},
]
)
**Response Syntax**
::
{
'NodeAssociationStatusToken': 'string'
}
**Response Structure**
- *(dict) --*
- **NodeAssociationStatusToken** *(string) --*
Contains a token which can be passed to the ``DescribeNodeAssociationStatus`` API call to get the status of the disassociation request.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server from which to disassociate the node.
:type NodeName: string
:param NodeName: **[REQUIRED]**
The name of the client node.
:type EngineAttributes: list
:param EngineAttributes:
Engine attributes that are used for disassociating the node. No attributes are required for Puppet.
**Attributes required in a DisassociateNode request for Chef**
* ``CHEF_ORGANIZATION`` : The Chef organization with which the node was associated. By default only one organization named ``default`` can exist.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
:rtype: dict
:returns:
"""
pass
def export_server_engine_attribute(self, ExportAttributeName: str, ServerName: str, InputAttributes: List = None) -> Dict:
"""
Exports a specified server engine attribute as a base64-encoded string. For example, you can export user data that you can use in EC2 to associate nodes with a server.
This operation is synchronous.
A ``ValidationException`` is raised when parameters of the request are not valid. A ``ResourceNotFoundException`` is thrown when the server does not exist. An ``InvalidStateException`` is thrown when the server is in any of the following states: CREATING, TERMINATED, FAILED or DELETING.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/ExportServerEngineAttribute>`_
**Request Syntax**
::
response = client.export_server_engine_attribute(
ExportAttributeName='string',
ServerName='string',
InputAttributes=[
{
'Name': 'string',
'Value': 'string'
},
]
)
**Response Syntax**
::
{
'EngineAttribute': {
'Name': 'string',
'Value': 'string'
},
'ServerName': 'string'
}
**Response Structure**
- *(dict) --*
- **EngineAttribute** *(dict) --*
The requested engine attribute pair with attribute name and value.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
- **ServerName** *(string) --*
The server name used in the request.
:type ExportAttributeName: string
:param ExportAttributeName: **[REQUIRED]**
The name of the export attribute. Currently, the supported export attribute is ``Userdata`` . This exports a user data script that includes parameters and values provided in the ``InputAttributes`` list.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server from which you are exporting the attribute.
:type InputAttributes: list
:param InputAttributes:
The list of engine attributes. The list type is ``EngineAttribute`` . An ``EngineAttribute`` list item is a pair that includes an attribute name and its value. For the ``Userdata`` ExportAttributeName, the following are supported engine attribute names.
* **RunList** In Chef, a list of roles or recipes that are run in the specified order. In Puppet, this parameter is ignored.
* **OrganizationName** In Chef, an organization name. AWS OpsWorks for Chef Automate always creates the organization ``default`` . In Puppet, this parameter is ignored.
* **NodeEnvironment** In Chef, a node environment (for example, development, staging, or one-box). In Puppet, this parameter is ignored.
* **NodeClientVersion** In Chef, the version of the Chef engine (three numbers separated by dots, such as 13.8.5). If this attribute is empty, OpsWorks for Chef Automate uses the most current version. In Puppet, this parameter is ignored.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
:rtype: dict
:returns:
"""
pass
def generate_presigned_url(self, ClientMethod: str = None, Params: Dict = None, ExpiresIn: int = None, HttpMethod: str = None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to
``ClientMethod``.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
for. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
default, the http method is whatever is used in the method\'s model.
:returns: The presigned url
"""
pass
def get_paginator(self, operation_name: str = None) -> Paginator:
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is ``create_foo``, and you\'d normally invoke the
operation as ``client.create_foo(**kwargs)``, if the
``create_foo`` operation can be paginated, you can use the
call ``client.get_paginator(\"create_foo\")``.
:raise OperationNotPageableError: Raised if the operation is not
pageable. You can use the ``client.can_paginate`` method to
check if an operation is pageable.
:rtype: L{botocore.paginate.Paginator}
:return: A paginator object.
"""
pass
def get_waiter(self, waiter_name: str = None) -> Waiter:
"""
Returns an object that can wait for some condition.
:type waiter_name: str
:param waiter_name: The name of the waiter to get. See the waiters
section of the service docs for a list of available waiters.
:returns: The specified waiter object.
:rtype: botocore.waiter.Waiter
"""
pass
def restore_server(self, BackupId: str, ServerName: str, InstanceType: str = None, KeyPair: str = None) -> Dict:
"""
Restores a backup to a server that is in a ``CONNECTION_LOST`` , ``HEALTHY`` , ``RUNNING`` , ``UNHEALTHY`` , or ``TERMINATED`` state. When you run RestoreServer, the server's EC2 instance is deleted, and a new EC2 instance is configured. RestoreServer maintains the existing server endpoint, so configuration management of the server's client devices (nodes) should continue to work.
This operation is asynchronous.
An ``InvalidStateException`` is thrown when the server is not in a valid state. A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/RestoreServer>`_
**Request Syntax**
::
response = client.restore_server(
BackupId='string',
ServerName='string',
InstanceType='string',
KeyPair='string'
)
**Response Syntax**
::
{}
**Response Structure**
- *(dict) --*
:type BackupId: string
:param BackupId: **[REQUIRED]**
The ID of the backup that you want to use to restore a server.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server that you want to restore.
:type InstanceType: string
:param InstanceType:
The type of the instance to create. Valid values must be specified in the following format: ``^([cm][34]|t2).*`` For example, ``m4.large`` . Valid values are ``t2.medium`` , ``m4.large`` , and ``m4.2xlarge`` . If you do not specify this parameter, RestoreServer uses the instance type from the specified backup.
:type KeyPair: string
:param KeyPair:
The name of the key pair to set on the new EC2 instance. This can be helpful if the administrator no longer has the SSH key.
:rtype: dict
:returns:
"""
pass
def start_maintenance(self, ServerName: str, EngineAttributes: List = None) -> Dict:
"""
Manually starts server maintenance. This command can be useful if an earlier maintenance attempt failed, and the underlying cause of maintenance failure has been resolved. The server is in an ``UNDER_MAINTENANCE`` state while maintenance is in progress.
Maintenance can only be started on servers in ``HEALTHY`` and ``UNHEALTHY`` states. Otherwise, an ``InvalidStateException`` is thrown. A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/StartMaintenance>`_
**Request Syntax**
::
response = client.start_maintenance(
ServerName='string',
EngineAttributes=[
{
'Name': 'string',
'Value': 'string'
},
]
)
**Response Syntax**
::
{
'Server': {
'AssociatePublicIpAddress': True|False,
'BackupRetentionCount': 123,
'ServerName': 'string',
'CreatedAt': datetime(2015, 1, 1),
'CloudFormationStackArn': 'string',
'DisableAutomatedBackup': True|False,
'Endpoint': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'MaintenanceStatus': 'SUCCESS'|'FAILED',
'PreferredMaintenanceWindow': 'string',
'PreferredBackupWindow': 'string',
'SecurityGroupIds': [
'string',
],
'ServiceRoleArn': 'string',
'Status': 'BACKING_UP'|'CONNECTION_LOST'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED'|'HEALTHY'|'RUNNING'|'RESTORING'|'SETUP'|'UNDER_MAINTENANCE'|'UNHEALTHY'|'TERMINATED',
'StatusReason': 'string',
'SubnetIds': [
'string',
],
'ServerArn': 'string'
}
}
**Response Structure**
- *(dict) --*
- **Server** *(dict) --*
Contains the response to a ``StartMaintenance`` request.
- **AssociatePublicIpAddress** *(boolean) --*
Associate a public IP address with a server that you are launching.
- **BackupRetentionCount** *(integer) --*
The number of automated backups to keep.
- **ServerName** *(string) --*
The name of the server.
- **CreatedAt** *(datetime) --*
Time stamp of server creation. Example ``2016-07-29T13:38:47.520Z``
- **CloudFormationStackArn** *(string) --*
The ARN of the CloudFormation stack that was used to create the server.
- **DisableAutomatedBackup** *(boolean) --*
Disables automated backups. The number of stored backups is dependent on the value of PreferredBackupCount.
- **Endpoint** *(string) --*
A DNS name that can be used to access the engine. Example: ``myserver-asdfghjkl.us-east-1.opsworks.io``
- **Engine** *(string) --*
The engine type of the server. Valid values in this release include ``Chef`` and ``Puppet`` .
- **EngineModel** *(string) --*
The engine model of the server. Valid values in this release include ``Monolithic`` for Puppet and ``Single`` for Chef.
- **EngineAttributes** *(list) --*
The response of a createServer() request returns the master credential to access the server in EngineAttributes. These credentials are not stored by AWS OpsWorks CM; they are returned only as part of the result of createServer().
**Attributes returned in a createServer response for Chef**
* ``CHEF_PIVOTAL_KEY`` : A base64-encoded RSA private key that is generated by AWS OpsWorks for Chef Automate. This private key is required to access the Chef API.
* ``CHEF_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Chef starter kit, which includes a README, a configuration file, and the required RSA private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents. From this directory, you can run Knife commands.
**Attributes returned in a createServer response for Puppet**
* ``PUPPET_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Puppet starter kit, including a README and a required private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents.
* ``PUPPET_ADMIN_PASSWORD`` : An administrator password that you can use to sign in to the Puppet Enterprise console after the server is online.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
- **EngineVersion** *(string) --*
The engine version of the server. For a Chef server, the valid value for EngineVersion is currently ``12`` . For a Puppet server, the valid value is ``2017`` .
- **InstanceProfileArn** *(string) --*
The instance profile ARN of the server.
- **InstanceType** *(string) --*
The instance type for the server, as specified in the CloudFormation stack. This might not be the same instance type that is shown in the EC2 console.
- **KeyPair** *(string) --*
The key pair associated with the server.
- **MaintenanceStatus** *(string) --*
The status of the most recent server maintenance run. Shows ``SUCCESS`` or ``FAILED`` .
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period specified for the server.
- **PreferredBackupWindow** *(string) --*
The preferred backup period specified for the server.
- **SecurityGroupIds** *(list) --*
The security group IDs for the server, as specified in the CloudFormation stack. These might not be the same security groups that are shown in the EC2 console.
- *(string) --*
- **ServiceRoleArn** *(string) --*
The service role ARN used to create the server.
- **Status** *(string) --*
The server's status. This field displays the states of actions in progress, such as creating, running, or backing up the server, as well as the server's health state.
- **StatusReason** *(string) --*
Depending on the server status, this field has either a human-readable message (such as a create or backup error), or an escaped block of JSON (used for health check results).
- **SubnetIds** *(list) --*
The subnet IDs specified in a CreateServer request.
- *(string) --*
- **ServerArn** *(string) --*
The ARN of the server.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server on which to run maintenance.
:type EngineAttributes: list
:param EngineAttributes:
Engine attributes that are specific to the server on which you want to run maintenance.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
:rtype: dict
:returns:
"""
pass
def update_server(self, ServerName: str, DisableAutomatedBackup: bool = None, BackupRetentionCount: int = None, PreferredMaintenanceWindow: str = None, PreferredBackupWindow: str = None) -> Dict:
"""
Updates settings for a server.
This operation is synchronous.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/UpdateServer>`_
**Request Syntax**
::
response = client.update_server(
DisableAutomatedBackup=True|False,
BackupRetentionCount=123,
ServerName='string',
PreferredMaintenanceWindow='string',
PreferredBackupWindow='string'
)
**Response Syntax**
::
{
'Server': {
'AssociatePublicIpAddress': True|False,
'BackupRetentionCount': 123,
'ServerName': 'string',
'CreatedAt': datetime(2015, 1, 1),
'CloudFormationStackArn': 'string',
'DisableAutomatedBackup': True|False,
'Endpoint': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'MaintenanceStatus': 'SUCCESS'|'FAILED',
'PreferredMaintenanceWindow': 'string',
'PreferredBackupWindow': 'string',
'SecurityGroupIds': [
'string',
],
'ServiceRoleArn': 'string',
'Status': 'BACKING_UP'|'CONNECTION_LOST'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED'|'HEALTHY'|'RUNNING'|'RESTORING'|'SETUP'|'UNDER_MAINTENANCE'|'UNHEALTHY'|'TERMINATED',
'StatusReason': 'string',
'SubnetIds': [
'string',
],
'ServerArn': 'string'
}
}
**Response Structure**
- *(dict) --*
- **Server** *(dict) --*
Contains the response to a ``UpdateServer`` request.
- **AssociatePublicIpAddress** *(boolean) --*
Associate a public IP address with a server that you are launching.
- **BackupRetentionCount** *(integer) --*
The number of automated backups to keep.
- **ServerName** *(string) --*
The name of the server.
- **CreatedAt** *(datetime) --*
Time stamp of server creation. Example ``2016-07-29T13:38:47.520Z``
- **CloudFormationStackArn** *(string) --*
The ARN of the CloudFormation stack that was used to create the server.
- **DisableAutomatedBackup** *(boolean) --*
Disables automated backups. The number of stored backups is dependent on the value of PreferredBackupCount.
- **Endpoint** *(string) --*
A DNS name that can be used to access the engine. Example: ``myserver-asdfghjkl.us-east-1.opsworks.io``
- **Engine** *(string) --*
The engine type of the server. Valid values in this release include ``Chef`` and ``Puppet`` .
- **EngineModel** *(string) --*
The engine model of the server. Valid values in this release include ``Monolithic`` for Puppet and ``Single`` for Chef.
- **EngineAttributes** *(list) --*
The response of a createServer() request returns the master credential to access the server in EngineAttributes. These credentials are not stored by AWS OpsWorks CM; they are returned only as part of the result of createServer().
**Attributes returned in a createServer response for Chef**
* ``CHEF_PIVOTAL_KEY`` : A base64-encoded RSA private key that is generated by AWS OpsWorks for Chef Automate. This private key is required to access the Chef API.
* ``CHEF_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Chef starter kit, which includes a README, a configuration file, and the required RSA private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents. From this directory, you can run Knife commands.
**Attributes returned in a createServer response for Puppet**
* ``PUPPET_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Puppet starter kit, including a README and a required private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents.
* ``PUPPET_ADMIN_PASSWORD`` : An administrator password that you can use to sign in to the Puppet Enterprise console after the server is online.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
- **EngineVersion** *(string) --*
The engine version of the server. For a Chef server, the valid value for EngineVersion is currently ``12`` . For a Puppet server, the valid value is ``2017`` .
- **InstanceProfileArn** *(string) --*
The instance profile ARN of the server.
- **InstanceType** *(string) --*
The instance type for the server, as specified in the CloudFormation stack. This might not be the same instance type that is shown in the EC2 console.
- **KeyPair** *(string) --*
The key pair associated with the server.
- **MaintenanceStatus** *(string) --*
The status of the most recent server maintenance run. Shows ``SUCCESS`` or ``FAILED`` .
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period specified for the server.
- **PreferredBackupWindow** *(string) --*
The preferred backup period specified for the server.
- **SecurityGroupIds** *(list) --*
The security group IDs for the server, as specified in the CloudFormation stack. These might not be the same security groups that are shown in the EC2 console.
- *(string) --*
- **ServiceRoleArn** *(string) --*
The service role ARN used to create the server.
- **Status** *(string) --*
The server's status. This field displays the states of actions in progress, such as creating, running, or backing up the server, as well as the server's health state.
- **StatusReason** *(string) --*
Depending on the server status, this field has either a human-readable message (such as a create or backup error), or an escaped block of JSON (used for health check results).
- **SubnetIds** *(list) --*
The subnet IDs specified in a CreateServer request.
- *(string) --*
- **ServerArn** *(string) --*
The ARN of the server.
:type DisableAutomatedBackup: boolean
:param DisableAutomatedBackup:
Setting DisableAutomatedBackup to ``true`` disables automated or scheduled backups. Automated backups are enabled by default.
:type BackupRetentionCount: integer
:param BackupRetentionCount:
Sets the number of automated backups that you want to keep.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server to update.
:type PreferredMaintenanceWindow: string
:param PreferredMaintenanceWindow:
``DDD:HH:MM`` (weekly start time) or ``HH:MM`` (daily start time).
Time windows always use coordinated universal time (UTC). Valid strings for day of week (``DDD`` ) are: ``Mon`` , ``Tue`` , ``Wed`` , ``Thr`` , ``Fri`` , ``Sat`` , or ``Sun`` .
:type PreferredBackupWindow: string
:param PreferredBackupWindow:
``DDD:HH:MM`` (weekly start time) or ``HH:MM`` (daily start time).
Time windows always use coordinated universal time (UTC). Valid strings for day of week (``DDD`` ) are: ``Mon`` , ``Tue`` , ``Wed`` , ``Thr`` , ``Fri`` , ``Sat`` , or ``Sun`` .
:rtype: dict
:returns:
"""
pass
def update_server_engine_attributes(self, ServerName: str, AttributeName: str, AttributeValue: str = None) -> Dict:
"""
Updates engine-specific attributes on a specified server. The server enters the ``MODIFYING`` state when this operation is in progress. Only one update can occur at a time. You can use this command to reset a Chef server's public key (``CHEF_PIVOTAL_KEY`` ) or a Puppet server's admin password (``PUPPET_ADMIN_PASSWORD`` ).
This operation is asynchronous.
This operation can only be called for servers in ``HEALTHY`` or ``UNHEALTHY`` states. Otherwise, an ``InvalidStateException`` is raised. A ``ResourceNotFoundException`` is thrown when the server does not exist. A ``ValidationException`` is raised when parameters of the request are not valid.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opsworkscm-2016-11-01/UpdateServerEngineAttributes>`_
**Request Syntax**
::
response = client.update_server_engine_attributes(
ServerName='string',
AttributeName='string',
AttributeValue='string'
)
**Response Syntax**
::
{
'Server': {
'AssociatePublicIpAddress': True|False,
'BackupRetentionCount': 123,
'ServerName': 'string',
'CreatedAt': datetime(2015, 1, 1),
'CloudFormationStackArn': 'string',
'DisableAutomatedBackup': True|False,
'Endpoint': 'string',
'Engine': 'string',
'EngineModel': 'string',
'EngineAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'EngineVersion': 'string',
'InstanceProfileArn': 'string',
'InstanceType': 'string',
'KeyPair': 'string',
'MaintenanceStatus': 'SUCCESS'|'FAILED',
'PreferredMaintenanceWindow': 'string',
'PreferredBackupWindow': 'string',
'SecurityGroupIds': [
'string',
],
'ServiceRoleArn': 'string',
'Status': 'BACKING_UP'|'CONNECTION_LOST'|'CREATING'|'DELETING'|'MODIFYING'|'FAILED'|'HEALTHY'|'RUNNING'|'RESTORING'|'SETUP'|'UNDER_MAINTENANCE'|'UNHEALTHY'|'TERMINATED',
'StatusReason': 'string',
'SubnetIds': [
'string',
],
'ServerArn': 'string'
}
}
**Response Structure**
- *(dict) --*
- **Server** *(dict) --*
Contains the response to an ``UpdateServerEngineAttributes`` request.
- **AssociatePublicIpAddress** *(boolean) --*
Associate a public IP address with a server that you are launching.
- **BackupRetentionCount** *(integer) --*
The number of automated backups to keep.
- **ServerName** *(string) --*
The name of the server.
- **CreatedAt** *(datetime) --*
Time stamp of server creation. Example ``2016-07-29T13:38:47.520Z``
- **CloudFormationStackArn** *(string) --*
The ARN of the CloudFormation stack that was used to create the server.
- **DisableAutomatedBackup** *(boolean) --*
Disables automated backups. The number of stored backups is dependent on the value of PreferredBackupCount.
- **Endpoint** *(string) --*
A DNS name that can be used to access the engine. Example: ``myserver-asdfghjkl.us-east-1.opsworks.io``
- **Engine** *(string) --*
The engine type of the server. Valid values in this release include ``Chef`` and ``Puppet`` .
- **EngineModel** *(string) --*
The engine model of the server. Valid values in this release include ``Monolithic`` for Puppet and ``Single`` for Chef.
- **EngineAttributes** *(list) --*
The response of a createServer() request returns the master credential to access the server in EngineAttributes. These credentials are not stored by AWS OpsWorks CM; they are returned only as part of the result of createServer().
**Attributes returned in a createServer response for Chef**
* ``CHEF_PIVOTAL_KEY`` : A base64-encoded RSA private key that is generated by AWS OpsWorks for Chef Automate. This private key is required to access the Chef API.
* ``CHEF_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Chef starter kit, which includes a README, a configuration file, and the required RSA private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents. From this directory, you can run Knife commands.
**Attributes returned in a createServer response for Puppet**
* ``PUPPET_STARTER_KIT`` : A base64-encoded ZIP file. The ZIP file contains a Puppet starter kit, including a README and a required private key. Save this file, unzip it, and then change to the directory where you've unzipped the file contents.
* ``PUPPET_ADMIN_PASSWORD`` : An administrator password that you can use to sign in to the Puppet Enterprise console after the server is online.
- *(dict) --*
A name and value pair that is specific to the engine of the server.
- **Name** *(string) --*
The name of the engine attribute.
- **Value** *(string) --*
The value of the engine attribute.
- **EngineVersion** *(string) --*
The engine version of the server. For a Chef server, the valid value for EngineVersion is currently ``12`` . For a Puppet server, the valid value is ``2017`` .
- **InstanceProfileArn** *(string) --*
The instance profile ARN of the server.
- **InstanceType** *(string) --*
The instance type for the server, as specified in the CloudFormation stack. This might not be the same instance type that is shown in the EC2 console.
- **KeyPair** *(string) --*
The key pair associated with the server.
- **MaintenanceStatus** *(string) --*
The status of the most recent server maintenance run. Shows ``SUCCESS`` or ``FAILED`` .
- **PreferredMaintenanceWindow** *(string) --*
The preferred maintenance period specified for the server.
- **PreferredBackupWindow** *(string) --*
The preferred backup period specified for the server.
- **SecurityGroupIds** *(list) --*
The security group IDs for the server, as specified in the CloudFormation stack. These might not be the same security groups that are shown in the EC2 console.
- *(string) --*
- **ServiceRoleArn** *(string) --*
The service role ARN used to create the server.
- **Status** *(string) --*
The server's status. This field displays the states of actions in progress, such as creating, running, or backing up the server, as well as the server's health state.
- **StatusReason** *(string) --*
Depending on the server status, this field has either a human-readable message (such as a create or backup error), or an escaped block of JSON (used for health check results).
- **SubnetIds** *(list) --*
The subnet IDs specified in a CreateServer request.
- *(string) --*
- **ServerArn** *(string) --*
The ARN of the server.
:type ServerName: string
:param ServerName: **[REQUIRED]**
The name of the server to update.
:type AttributeName: string
:param AttributeName: **[REQUIRED]**
The name of the engine attribute to update.
:type AttributeValue: string
:param AttributeValue:
The value to set for the attribute.
:rtype: dict
:returns:
"""
pass
| 60.705457
| 578
| 0.575905
| 9,715
| 92,333
| 5.453525
| 0.075142
| 0.031087
| 0.012042
| 0.00838
| 0.73466
| 0.698364
| 0.671769
| 0.6565
| 0.643042
| 0.629546
| 0
| 0.009502
| 0.332091
| 92,333
| 1,520
| 579
| 60.745395
| 0.849603
| 0.841151
| 0
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.416667
| false
| 0.416667
| 0.145833
| 0
| 0.583333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
2c90ad6a01ed4c30472559a80a16e50ff4269a3c
| 3,971
|
py
|
Python
|
test/test_modify_contact.py
|
GennadyBarchenkov/python_training
|
fd3da53ee3da9f9e043c08d648f7ea20197dbb78
|
[
"Apache-2.0"
] | null | null | null |
test/test_modify_contact.py
|
GennadyBarchenkov/python_training
|
fd3da53ee3da9f9e043c08d648f7ea20197dbb78
|
[
"Apache-2.0"
] | null | null | null |
test/test_modify_contact.py
|
GennadyBarchenkov/python_training
|
fd3da53ee3da9f9e043c08d648f7ea20197dbb78
|
[
"Apache-2.0"
] | null | null | null |
from model.contact import Contact
import random
def test_full_edit_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="test", middlename="test", lastname="test", nickname="test", title="test",
company="test", address="test", home_telephone="test", mobile_telephone="test",
work_telephone="test", fax="test", email="test", email2="test", email3="test",
homepage="test", bday="7", bmonth="May", byear="1900", aday="7", amonth="May",
ayear="1900", address2="test", phone2="test"))
old_contacts = db.get_contact_list()
contact = Contact(firstname="edit1", middlename="edit2", lastname="edit3",
nickname="edit4", title="edit5", company="edit6", address="edit7",
home_telephone="edit8", mobile_telephone="edit9", work_telephone="edit10",
fax="edit11", email="edit12", email2="edit13", email3="edit14",
homepage="edit15", bday="13", bmonth="December", byear="2000", aday="13",
amonth="January", ayear="2000", address2="edit16", phone2="edit17")
select_contact = random.choice(old_contacts)
contact.id = select_contact.id
app.contact.modify_contact_by_id(select_contact.id, contact)
new_contacts = db.get_contact_list()
old_contacts.remove(select_contact)
old_contacts.append(contact)
assert sorted(old_contacts, key=Contact.id_or_max) == sorted(new_contacts, key=Contact.id_or_max)
if check_ui:
assert sorted(new_contacts, key=Contact.id_or_max) == sorted(app.contact.get_contact_list(), key=Contact.id_or_max)
def test_modify_contact_firstname(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="test"))
old_contacts = db.get_contact_list()
contact = Contact(firstname="New_firstname")
select_contact = random.choice(old_contacts)
contact.id = select_contact.id
app.contact.modify_contact_by_id(select_contact.id, contact)
new_contacts = db.get_contact_list()
old_contacts.remove(select_contact)
old_contacts.append(contact)
assert sorted(old_contacts, key=Contact.id_or_max) == sorted(new_contacts, key=Contact.id_or_max)
if check_ui:
assert sorted(new_contacts, key=Contact.id_or_max) == sorted(app.contact.get_contact_list(), key=Contact.id_or_max)
def test_modify_contact_lastname(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(lastname="test"))
old_contacts = db.get_contact_list()
contact = Contact(lastname="New_lastname")
select_contact = random.choice(old_contacts)
contact.id = select_contact.id
app.contact.modify_contact_by_id(select_contact.id, contact)
new_contacts = db.get_contact_list()
old_contacts.remove(select_contact)
old_contacts.append(contact)
assert sorted(old_contacts, key=Contact.id_or_max) == sorted(new_contacts, key=Contact.id_or_max)
if check_ui:
assert sorted(new_contacts, key=Contact.id_or_max) == sorted(app.contact.get_contact_list(), key=Contact.id_or_max)
def test_modify_contact_bday(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(bday="7"))
old_contacts = db.get_contact_list()
contact = Contact(bday="30")
select_contact = random.choice(old_contacts)
contact.id = select_contact.id
app.contact.modify_contact_by_id(select_contact.id, contact)
new_contacts = db.get_contact_list()
old_contacts.remove(select_contact)
old_contacts.append(contact)
assert sorted(old_contacts, key=Contact.id_or_max) == sorted(new_contacts, key=Contact.id_or_max)
if check_ui:
assert sorted(new_contacts, key=Contact.id_or_max) == sorted(app.contact.get_contact_list(), key=Contact.id_or_max)
| 52.25
| 123
| 0.690506
| 535
| 3,971
| 4.841122
| 0.15514
| 0.097297
| 0.086486
| 0.086486
| 0.750579
| 0.750579
| 0.750579
| 0.750579
| 0.734749
| 0.717375
| 0
| 0.019048
| 0.180307
| 3,971
| 75
| 124
| 52.946667
| 0.776651
| 0
| 0
| 0.656716
| 0
| 0
| 0.060438
| 0
| 0
| 0
| 0
| 0
| 0.119403
| 1
| 0.059701
| false
| 0
| 0.029851
| 0
| 0.089552
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2c99571a87f5306bad72f333639fb2a57c2dc504
| 143
|
py
|
Python
|
src/resources.py
|
ieuan-jones/pytafl
|
731b9ec771074ccd3b2a6341bd823e6789b752ad
|
[
"MIT"
] | null | null | null |
src/resources.py
|
ieuan-jones/pytafl
|
731b9ec771074ccd3b2a6341bd823e6789b752ad
|
[
"MIT"
] | null | null | null |
src/resources.py
|
ieuan-jones/pytafl
|
731b9ec771074ccd3b2a6341bd823e6789b752ad
|
[
"MIT"
] | null | null | null |
import pygame,os
IMAGES = {}
#for i in os.listdir(os.path.join("../","art")):
# IMAGES[i] = pygame.image.load(os.path.join("../","art",i))
| 23.833333
| 63
| 0.587413
| 23
| 143
| 3.652174
| 0.565217
| 0.142857
| 0.238095
| 0.309524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118881
| 143
| 6
| 63
| 23.833333
| 0.666667
| 0.762238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
2ca67e2d45ce703f751f36a8ee085d13f62a643c
| 215
|
py
|
Python
|
simulator/utime.py
|
ondiiik/meteoink
|
9bc7af929de12ed5eb2fafd64fcfe447f07b6eeb
|
[
"MIT"
] | 2
|
2021-05-27T13:32:16.000Z
|
2022-03-30T01:23:34.000Z
|
simulator/utime.py
|
ondiiik/meteoink
|
9bc7af929de12ed5eb2fafd64fcfe447f07b6eeb
|
[
"MIT"
] | null | null | null |
simulator/utime.py
|
ondiiik/meteoink
|
9bc7af929de12ed5eb2fafd64fcfe447f07b6eeb
|
[
"MIT"
] | null | null | null |
def localtime(sec):
import time
return time.localtime(sec + 946677600)
def sleep_ms(ms):
import time
time.sleep(0.001 * ms)
def ticks_ms():
import time
return int(round(time.time() * 1000))
| 19.545455
| 42
| 0.655814
| 32
| 215
| 4.34375
| 0.46875
| 0.215827
| 0.230216
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101796
| 0.223256
| 215
| 11
| 43
| 19.545455
| 0.730539
| 0
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.888889
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e2efd616a17ace90e828905e2a36cbf6e0fd2e0f
| 5,536
|
py
|
Python
|
steering-models/community-models/autumn/autumn/data_reader.py
|
vaibhav-s/self-driving-car
|
eb5865d50499f90b3eeace869c1f8a65cf9e2c46
|
[
"MIT"
] | null | null | null |
steering-models/community-models/autumn/autumn/data_reader.py
|
vaibhav-s/self-driving-car
|
eb5865d50499f90b3eeace869c1f8a65cf9e2c46
|
[
"MIT"
] | null | null | null |
steering-models/community-models/autumn/autumn/data_reader.py
|
vaibhav-s/self-driving-car
|
eb5865d50499f90b3eeace869c1f8a65cf9e2c46
|
[
"MIT"
] | null | null | null |
import scipy.misc
import random
import csv
DATA_DIR = '/vol/data/'
FILE_EXT = '.png'
class DataReader(object):
def __init__(self, data_dir=DATA_DIR, file_ext=FILE_EXT, sequential=False):
self.load()
def load(self):
xs = []
ys = []
self.train_batch_pointer = 0
self.val_batch_pointer = 0
total = 0
count01 = count005 = count002 = count0 = 0
with open('interpolated_center.csv') as f:
reader = csv.DictReader(f)
for row in reader:
angle = float(row['steering_angle'])
if angle > 0.1 or angle < -0.1 and random.random() > 0.2:
xs.append(DATA_DIR + 'training/center/flow_7_cart/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
count01 += 1
elif (angle > 0.05 or angle < -0.5) and random.random() > 0.2:
xs.append(DATA_DIR + 'training/center/flow_7_cart/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
count005 += 1
elif (angle > 0.02 or angle < -0.02) and random.random() > 0.7:
xs.append(DATA_DIR + 'training/center/flow_7_cart/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
count002 += 1
elif random.random() > 0.8:
xs.append(DATA_DIR + 'training/center/flow_7_cart/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
count0 += 1
total += 1
with open('train_center.csv') as f:
reader = csv.DictReader(f)
for row in reader:
angle = float(row['steering_angle'])
xs.append(DATA_DIR + 'Ch2_Train/center/flow_7_local/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
total += 1
print('> 0.1 or < -0.1: ' + str(count01))
print('> 0.05 or < -0.05: ' + str(count005))
print('> 0.02 or < -0.02: ' + str(count002))
print('~0: ' + str(count0))
print('Total data: ' + str(total))
self.num_images = len(xs)
c = list(zip(xs, ys))
random.shuffle(c)
xs, ys = zip(*c)
self.train_xs = xs[:int(len(xs) * 0.8)]
self.train_ys = ys[:int(len(xs) * 0.8)]
self.val_xs = xs[-int(len(xs) * 0.2):]
self.val_ys = ys[-int(len(xs) * 0.2):]
self.num_train_images = len(self.train_xs)
self.num_val_images = len(self.val_xs)
def load_train_batch(self, batch_size):
x_out = []
y_out = []
for i in range(0, batch_size):
image = scipy.misc.imread(self.train_xs[(self.train_batch_pointer + i) % self.num_train_images])
x_out.append(scipy.misc.imresize(image[-400:], [66, 200]) / 255.0)
y_out.append([self.train_ys[(self.train_batch_pointer + i) % self.num_train_images]])
self.train_batch_pointer += batch_size
return x_out, y_out
def load_val_batch(self, batch_size):
x_out = []
y_out = []
for i in range(0, batch_size):
image = scipy.misc.imread(self.val_xs[(self.val_batch_pointer + i) % self.num_val_images])
x_out.append(scipy.misc.imresize(image[-400:], [66, 200]) / 255.0)
y_out.append([self.val_ys[(self.val_batch_pointer + i) % self.num_val_images]])
self.val_batch_pointer += batch_size
return x_out, y_out
def load_seq(self):
xs = []
ys = []
self.train_batch_pointer = 0
self.val_batch_pointer = 0
print('LSTM Data')
with open('train_center.csv') as f:
reader = csv.DictReader(f)
for row in reader:
xs.append(DATA_DIR + 'Ch2_Train/center/flow_7_local/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
c = list(zip(xs, ys))
xs, ys = zip(*c)
self.train_xs = xs[:int(len(xs) * 1.0)]
self.train_ys = ys[:int(len(xs) * 1.0)]
self.num_images = len(self.train_xs)
print('total: ' + str(self.num_images))
self.num_train_images = len(self.train_xs)
def load_seq_2(self):
xs = []
ys = []
self.train_batch_pointer = 0
print('LSTM Data')
with open('interpolated_center.csv') as f:
reader = csv.DictReader(f)
for row in reader:
xs.append(DATA_DIR + 'output/left/flow_7_cart/' + row['frame_id'] + FILE_EXT)
ys.append(row['steering_angle'])
c = list(zip(xs, ys))
xs, ys = zip(*c)
self.train_xs = xs[:int(len(xs) * 1.0)]
self.train_ys = ys[:int(len(xs) * 1.0)]
self.num_images = len(self.train_xs)
print('total: ' + str(self.num_images))
self.num_train_images = len(self.train_xs)
def skip(self, num):
self.train_batch_pointer += num
def load_seq_batch(self, batch_size):
x_out = []
y_out = []
for i in range(0, batch_size):
image = scipy.misc.imread(self.train_xs[(self.train_batch_pointer + i) % self.num_train_images])
x_out.append(scipy.misc.imresize(image[-400:], [66, 200]) / 255.0)
y_out.append([self.train_ys[(self.train_batch_pointer + i) % self.num_train_images]])
self.train_batch_pointer += batch_size
return x_out, y_out
| 35.487179
| 108
| 0.546785
| 772
| 5,536
| 3.699482
| 0.121762
| 0.078782
| 0.04902
| 0.073529
| 0.790966
| 0.786765
| 0.772759
| 0.765406
| 0.734594
| 0.711485
| 0
| 0.038158
| 0.313584
| 5,536
| 155
| 109
| 35.716129
| 0.713421
| 0
| 0
| 0.655738
| 0
| 0
| 0.103504
| 0.043714
| 0
| 0
| 0
| 0
| 0
| 1
| 0.065574
| false
| 0
| 0.02459
| 0
| 0.122951
| 0.07377
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
393750d050c1374278df07824bc8029f2c95e31e
| 123
|
py
|
Python
|
SimPEG/utils/curvutils.py
|
jcapriot/simpeg
|
e88e653673c6b818592b6c075f76ee9215fe82b7
|
[
"MIT"
] | 1
|
2021-08-07T13:50:54.000Z
|
2021-08-07T13:50:54.000Z
|
SimPEG/utils/curvutils.py
|
jcapriot/simpeg
|
e88e653673c6b818592b6c075f76ee9215fe82b7
|
[
"MIT"
] | null | null | null |
SimPEG/utils/curvutils.py
|
jcapriot/simpeg
|
e88e653673c6b818592b6c075f76ee9215fe82b7
|
[
"MIT"
] | 1
|
2021-01-05T18:16:54.000Z
|
2021-01-05T18:16:54.000Z
|
from .code_utils import deprecate_module
deprecate_module("curvutils", "curv_utils", "0.15.0")
from .curv_utils import *
| 20.5
| 53
| 0.772358
| 18
| 123
| 5
| 0.555556
| 0.244444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036364
| 0.105691
| 123
| 5
| 54
| 24.6
| 0.781818
| 0
| 0
| 0
| 0
| 0
| 0.203252
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1a4e88144b4567b8dcbb6da0e0cb53ad8bae94a2
| 140
|
py
|
Python
|
search.py
|
FelixVicis/Google-EmailScraper
|
3c22116e28eb0ddef406c1d865ab147fc55d9738
|
[
"MIT"
] | 4
|
2017-10-13T20:03:35.000Z
|
2018-10-10T20:21:22.000Z
|
search.py
|
FelixVicis/Google-EmailScraper
|
3c22116e28eb0ddef406c1d865ab147fc55d9738
|
[
"MIT"
] | 4
|
2017-12-28T18:34:37.000Z
|
2019-12-29T09:06:55.000Z
|
search.py
|
FelixVicis/Google-EmailScraper
|
3c22116e28eb0ddef406c1d865ab147fc55d9738
|
[
"MIT"
] | 1
|
2018-08-07T10:31:33.000Z
|
2018-08-07T10:31:33.000Z
|
import google
def websites(query, start=0, stop=None, per_page=10):
return google.search(query, start=start, stop=stop, num=per_page)
| 23.333333
| 69
| 0.742857
| 23
| 140
| 4.434783
| 0.652174
| 0.196078
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02459
| 0.128571
| 140
| 5
| 70
| 28
| 0.811475
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
|
0
| 5
|
1a5c87f18b01822ec32c651c5da44c45ac9c69b4
| 146
|
py
|
Python
|
consul_lib/__init__.py
|
syseleven/consul_lib
|
b85fdc71c98cd5b0dc4e93260e4b4b065a07604d
|
[
"MIT"
] | 2
|
2018-12-03T12:50:49.000Z
|
2020-03-12T16:44:23.000Z
|
consul_lib/__init__.py
|
syseleven/consul_lib
|
b85fdc71c98cd5b0dc4e93260e4b4b065a07604d
|
[
"MIT"
] | 3
|
2018-11-13T10:43:48.000Z
|
2019-07-31T13:13:27.000Z
|
consul_lib/__init__.py
|
syseleven/consul_lib
|
b85fdc71c98cd5b0dc4e93260e4b4b065a07604d
|
[
"MIT"
] | null | null | null |
from .lock import Lock # noqa
from .semaphore import Semaphore # noqa
from .services import get_local_checks, get_failed_cluster_checks # noqa
| 36.5
| 73
| 0.80137
| 21
| 146
| 5.333333
| 0.52381
| 0.142857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150685
| 146
| 3
| 74
| 48.666667
| 0.903226
| 0.09589
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1a72c016bb19e89b2c979630892e0fbf61386de5
| 113
|
py
|
Python
|
sliding_window/__init__.py
|
gmum/ProtoPNet
|
d538c99a09f965d048ad094ebbdb24edab3472f5
|
[
"MIT"
] | 1
|
2022-02-26T17:10:05.000Z
|
2022-02-26T17:10:05.000Z
|
sliding_window/__init__.py
|
gmum/ProtoPNet
|
d538c99a09f965d048ad094ebbdb24edab3472f5
|
[
"MIT"
] | null | null | null |
sliding_window/__init__.py
|
gmum/ProtoPNet
|
d538c99a09f965d048ad094ebbdb24edab3472f5
|
[
"MIT"
] | null | null | null |
"""
Code for training prototype segmentation model on Cityscapes dataset
https://www.cityscapes-dataset.com/
"""
| 22.6
| 68
| 0.778761
| 14
| 113
| 6.285714
| 0.857143
| 0.386364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106195
| 113
| 4
| 69
| 28.25
| 0.871287
| 0.920354
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1a8688850d729e21715344bc820916f60681aa00
| 274
|
py
|
Python
|
aaaaa/test02.py
|
manlucas/atom
|
94963fc6fdfd0568473ee68e9d1631f421265359
|
[
"Apache-2.0"
] | null | null | null |
aaaaa/test02.py
|
manlucas/atom
|
94963fc6fdfd0568473ee68e9d1631f421265359
|
[
"Apache-2.0"
] | 8
|
2020-06-06T00:34:57.000Z
|
2021-06-10T22:30:24.000Z
|
aaaaa/test02.py
|
manlucas/atom
|
94963fc6fdfd0568473ee68e9d1631f421265359
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
if __name__ == '__main__':
a = u'\u5f53\u524d\u4e91\u533a\u57df\u6ca1\u6709\u53ef\u7528\u7684'
# PROXY\uff0c\u8bf7\u5148\u68c0\u67e5\u5e76\u5b89\u88c5', u'\u76f4\u8fde\u533a\u57df\uff0c\u4e0d\u80fd\u5b89\u88c5PROXY\u548cPAGENT'
print(a)
| 39.142857
| 136
| 0.70438
| 40
| 274
| 4.625
| 0.85
| 0.108108
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.310204
| 0.105839
| 274
| 7
| 137
| 39.142857
| 0.444898
| 0.554745
| 0
| 0
| 0
| 0
| 0.566667
| 0.5
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1abe9a089db4e56bba9779688db8bcb6f171fcfb
| 163
|
py
|
Python
|
sports_manager/views/__init__.py
|
hbuyse/dj-sports-manager
|
7e32cc41347b968b4ede9ea6846de14d9504c3f9
|
[
"MIT"
] | null | null | null |
sports_manager/views/__init__.py
|
hbuyse/dj-sports-manager
|
7e32cc41347b968b4ede9ea6846de14d9504c3f9
|
[
"MIT"
] | null | null | null |
sports_manager/views/__init__.py
|
hbuyse/dj-sports-manager
|
7e32cc41347b968b4ede9ea6846de14d9504c3f9
|
[
"MIT"
] | null | null | null |
# -*- coding utf-8 -*-
from sports_manager.views.category import CategoryCreateView, CategoryDeleteView, CategoryDetailView, CategoryListView, CategoryUpdateView
| 40.75
| 138
| 0.828221
| 14
| 163
| 9.571429
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006711
| 0.08589
| 163
| 3
| 139
| 54.333333
| 0.892617
| 0.122699
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
46e10c746d20624afbafc45ce519980f72c0b3f5
| 155
|
py
|
Python
|
tests/web_platform/css_flexbox_1/test_percentage_heights.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 71
|
2015-04-13T09:44:14.000Z
|
2019-03-24T01:03:02.000Z
|
tests/web_platform/css_flexbox_1/test_percentage_heights.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 35
|
2019-05-06T15:26:09.000Z
|
2022-03-28T06:30:33.000Z
|
tests/web_platform/css_flexbox_1/test_percentage_heights.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 139
|
2015-05-30T18:37:43.000Z
|
2019-03-27T17:14:05.000Z
|
from tests.utils import W3CTestCase
class TestPercentageHeights(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'percentage-heights-'))
| 25.833333
| 74
| 0.8
| 16
| 155
| 7.4375
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.090323
| 155
| 5
| 75
| 31
| 0.822695
| 0
| 0
| 0
| 0
| 0
| 0.122581
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
46e5abf2c897e11f51534fa681ed917bd91f65c4
| 59
|
py
|
Python
|
tests/test_cnn2.py
|
CooperComputationalCaucus/BOML
|
c78ddea7261143522a7b10bc076ac03ca577d455
|
[
"MIT"
] | null | null | null |
tests/test_cnn2.py
|
CooperComputationalCaucus/BOML
|
c78ddea7261143522a7b10bc076ac03ca577d455
|
[
"MIT"
] | null | null | null |
tests/test_cnn2.py
|
CooperComputationalCaucus/BOML
|
c78ddea7261143522a7b10bc076ac03ca577d455
|
[
"MIT"
] | null | null | null |
#TODO: Write and run tests of regression and classification
| 59
| 59
| 0.830508
| 9
| 59
| 5.444444
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135593
| 59
| 1
| 59
| 59
| 0.960784
| 0.983051
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 1
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
203c21bb68a40c77664d8d5c76387387cc2a4d12
| 174
|
py
|
Python
|
exercisio74.py
|
bruno194/EXERCICIOS
|
cf7f00020515731031275a9b8d2696d7bf3bb5dc
|
[
"MIT"
] | 1
|
2022-02-25T13:28:46.000Z
|
2022-02-25T13:28:46.000Z
|
exercisio74.py
|
bruno194/EXERCICIOS
|
cf7f00020515731031275a9b8d2696d7bf3bb5dc
|
[
"MIT"
] | null | null | null |
exercisio74.py
|
bruno194/EXERCICIOS
|
cf7f00020515731031275a9b8d2696d7bf3bb5dc
|
[
"MIT"
] | null | null | null |
from random import randint
a = randint(1 , 10) , randint(1 , 10) ,randint(1 , 10) ,randint(1 , 10) ,randint(1 , 10)
for i in a:
print(f'{a}')
print(max(a))
print(min(a))
| 29
| 88
| 0.609195
| 33
| 174
| 3.212121
| 0.424242
| 0.377358
| 0.471698
| 0.641509
| 0.471698
| 0.471698
| 0.471698
| 0.471698
| 0.471698
| 0.471698
| 0
| 0.106383
| 0.189655
| 174
| 6
| 89
| 29
| 0.64539
| 0
| 0
| 0
| 0
| 0
| 0.017143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.5
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
6461490d4488676a7dfeb5fcbbae145aee864858
| 2,905
|
py
|
Python
|
agency/python/src/reputation_api.py
|
nejc9921/reputation
|
fd232cffc182d045d3e0a202dcbc979b240cdafb
|
[
"MIT"
] | null | null | null |
agency/python/src/reputation_api.py
|
nejc9921/reputation
|
fd232cffc182d045d3e0a202dcbc979b240cdafb
|
[
"MIT"
] | null | null | null |
agency/python/src/reputation_api.py
|
nejc9921/reputation
|
fd232cffc182d045d3e0a202dcbc979b240cdafb
|
[
"MIT"
] | null | null | null |
# MIT License
#
# Copyright (c) 2018 Stichting SingularityNET
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Reputation Service API, including Rating Service and Ranking Service
import abc
#TODO @anton provide proper parameters for the methods
"""
Reputation Rating Service interface definition
"""
class RatingService(abc.ABC):
@abc.abstractmethod
def put_ratings(self):
pass
@abc.abstractmethod
def get_ratings(self):
pass
@abc.abstractmethod
def clear_ratings(self):
pass
"""
Reputation Ranking Service interface definition
"""
class RankingService(abc.ABC):
@abc.abstractmethod
def update_ranks(self):
pass
@abc.abstractmethod
def put_ranks(self):
pass
@abc.abstractmethod
def get_ranks(self):
pass
@abc.abstractmethod
def clear_ranks(self):
pass
#TODO @anton take this out to separate file and implement
"""
Reputation Service wrapper around Aigents Java-based implementation
"""
class AigentsReputationService(RatingService,RankingService):
def clear_ratings(self):
return("clear_ratings")
def put_ratings(self):
return("put_ratings")
def get_ratings(self):
return("get_ratings")
def clear_ranks(self):
return("clear_ranks")
def put_ranks(self):
return("put_ranks")
def get_ranks(self):
return("get_ranks")
def update_ranks(self):
return("update_ranks")
#TODO @neic take this out to separate file and implement
"""
Reputation Service native implementation in Python
"""
class PythonReputationService(RatingService,RankingService):
def clear_ratings(self):
return("clear_ratings")
def put_ratings(self):
return("put_ratings")
def get_ratings(self):
return("get_ratings")
def clear_ranks(self):
return("clear_ranks")
def put_ranks(self):
return("put_ranks")
def get_ranks(self):
return("get_ranks")
def update_ranks(self):
return("update_ranks")
| 23.427419
| 80
| 0.752151
| 396
| 2,905
| 5.429293
| 0.356061
| 0.065116
| 0.055814
| 0.05814
| 0.398605
| 0.374419
| 0.288372
| 0.288372
| 0.288372
| 0.288372
| 0
| 0.001651
| 0.165921
| 2,905
| 123
| 81
| 23.617886
| 0.885679
| 0.450947
| 0
| 0.907407
| 0
| 0
| 0.11463
| 0
| 0
| 0
| 0
| 0.02439
| 0
| 1
| 0.388889
| false
| 0.12963
| 0.018519
| 0.259259
| 0.481481
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
|
0
| 5
|
6475f35b18566075f63cf68bd9b9d1206fda4f93
| 37
|
py
|
Python
|
trac/Lib/site-packages/codeexamplemacro-1.0_r11766-py2.7-patched.egg/codeexample/__init__.py
|
thinkbase/PortableTrac
|
9ea0210f6b88f135ef73f370b48127af0495b2d7
|
[
"BSD-3-Clause"
] | 2
|
2015-08-06T04:19:21.000Z
|
2020-04-29T23:52:10.000Z
|
trac/Lib/site-packages/codeexamplemacro-1.0_r11766-py2.7-patched.egg/codeexample/__init__.py
|
thinkbase/PortableTrac
|
9ea0210f6b88f135ef73f370b48127af0495b2d7
|
[
"BSD-3-Clause"
] | null | null | null |
trac/Lib/site-packages/codeexamplemacro-1.0_r11766-py2.7-patched.egg/codeexample/__init__.py
|
thinkbase/PortableTrac
|
9ea0210f6b88f135ef73f370b48127af0495b2d7
|
[
"BSD-3-Clause"
] | null | null | null |
from code_example_processor import *
| 18.5
| 36
| 0.864865
| 5
| 37
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 37
| 1
| 37
| 37
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
649581e4786fc5717fab7476c5e42d5b9ddc0aa2
| 16,491
|
py
|
Python
|
Code/Train_cLapIRN.py
|
S-HuaBomb/Conditional_LapIRN
|
2afe563a796768406bd7e8c244696245ce74b57a
|
[
"MIT"
] | null | null | null |
Code/Train_cLapIRN.py
|
S-HuaBomb/Conditional_LapIRN
|
2afe563a796768406bd7e8c244696245ce74b57a
|
[
"MIT"
] | null | null | null |
Code/Train_cLapIRN.py
|
S-HuaBomb/Conditional_LapIRN
|
2afe563a796768406bd7e8c244696245ce74b57a
|
[
"MIT"
] | null | null | null |
import glob
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
import numpy as np
import torch
import torch.utils.data as Data
from Functions import generate_grid, Dataset_epoch, Predict_dataset, transform_unit_flow_to_flow_cuda, \
generate_grid_unit
from miccai2021_model import Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl1, \
Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl2, Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl3, \
SpatialTransform_unit, SpatialTransformNearest_unit, smoothloss, \
neg_Jdet_loss, NCC, multi_resolution_NCC
parser = ArgumentParser()
parser.add_argument("--lr", type=float,
dest="lr", default=1e-4, help="learning rate")
parser.add_argument("--iteration_lvl1", type=int,
dest="iteration_lvl1", default=30001,
help="number of lvl1 iterations")
parser.add_argument("--iteration_lvl2", type=int,
dest="iteration_lvl2", default=30001,
help="number of lvl2 iterations")
parser.add_argument("--iteration_lvl3", type=int,
dest="iteration_lvl3", default=60001,
help="number of lvl3 iterations")
parser.add_argument("--antifold", type=float,
dest="antifold", default=0.,
help="Anti-fold loss: suggested range 1 to 10000")
parser.add_argument("--checkpoint", type=int,
dest="checkpoint", default=5000,
help="frequency of saving models")
parser.add_argument("--start_channel", type=int,
dest="start_channel", default=7, # default:8, 7 for stage
help="number of start channels")
parser.add_argument("--datapath", type=str,
dest="datapath",
default='../Dataset/Brain_dataset/OASIS/crop_min_max/norm',
help="data path for training images")
parser.add_argument("--freeze_step", type=int,
dest="freeze_step", default=3000,
help="Number of step to freeze the previous level")
opt = parser.parse_args()
lr = opt.lr
start_channel = opt.start_channel
antifold = opt.antifold
n_checkpoint = opt.checkpoint
datapath = opt.datapath
freeze_step = opt.freeze_step
iteration_lvl1 = opt.iteration_lvl1
iteration_lvl2 = opt.iteration_lvl2
iteration_lvl3 = opt.iteration_lvl3
model_name = "LDR_OASIS_NCC_unit_disp_add_fea7_reg01_10_testing_"
def train_lvl1():
print("Training lvl1...")
model = Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl1(2, 3, start_channel, is_train=True,
imgshape=imgshape_4,
range_flow=range_flow).cuda()
loss_similarity = NCC(win=3)
loss_smooth = smoothloss
loss_Jdet = neg_Jdet_loss
transform = SpatialTransform_unit().cuda()
for param in transform.parameters():
param.requires_grad = False
param.volatile = True
# OASIS
names = sorted(glob.glob(datapath + '/*.nii'))
grid_4 = generate_grid(imgshape_4)
grid_4 = torch.from_numpy(np.reshape(grid_4, (1,) + grid_4.shape)).cuda().float()
optimizer = torch.optim.Adam(model.parameters(), lr=lr)
# optimizer = torch.optim.SGD(model.parameters(), lr=lr, momentum=0.9)
model_dir = '../Model/Stage'
if not os.path.isdir(model_dir):
os.mkdir(model_dir)
lossall = np.zeros((4, iteration_lvl1 + 1))
training_generator = Data.DataLoader(Dataset_epoch(names, norm=False), batch_size=1,
shuffle=True, num_workers=2)
step = 0
load_model = False
if load_model is True:
model_path = "../Model/LDR_LPBA_NCC_lap_share_preact_1_05_3000.pth"
print("Loading weight: ", model_path)
step = 3000
model.load_state_dict(torch.load(model_path))
temp_lossall = np.load("../Model/loss_LDR_LPBA_NCC_lap_share_preact_1_05_3000.npy")
lossall[:, 0:3000] = temp_lossall[:, 0:3000]
while step <= iteration_lvl1:
for X, Y in training_generator:
X = X.cuda().float()
Y = Y.cuda().float()
reg_code = torch.rand(1, dtype=X.dtype, device=X.device).unsqueeze(dim=0)
F_X_Y, X_Y, Y_4x, F_xy, _ = model(X, Y, reg_code)
loss_multiNCC = loss_similarity(X_Y, Y_4x)
F_X_Y_norm = transform_unit_flow_to_flow_cuda(F_X_Y.permute(0, 2, 3, 4, 1).clone())
loss_Jacobian = loss_Jdet(F_X_Y_norm, grid_4)
_, _, x, y, z = F_X_Y.shape
norm_vector = torch.zeros((1, 3, 1, 1, 1), dtype=F_X_Y.dtype, device=F_X_Y.device)
norm_vector[0, 0, 0, 0, 0] = (z - 1)
norm_vector[0, 1, 0, 0, 0] = (y - 1)
norm_vector[0, 2, 0, 0, 0] = (x - 1)
loss_regulation = loss_smooth(F_X_Y * norm_vector)
smo_weight = reg_code * max_smooth
loss = loss_multiNCC + antifold * loss_Jacobian + smo_weight * loss_regulation
optimizer.zero_grad() # clear gradients for this training step
loss.backward() # backpropagation, compute gradients
optimizer.step() # apply gradients
lossall[:, step] = np.array(
[loss.item(), loss_multiNCC.item(), loss_Jacobian.item(), loss_regulation.item()])
sys.stdout.write(
"\r" + 'step "{0}" -> training loss "{1:.4f}" - sim_NCC "{2:4f}" - Jdet "{3:.10f}" -smo "{4:.4f} -reg_c "{5:.4f}"'.format(
step, loss.item(), loss_multiNCC.item(), loss_Jacobian.item(), loss_regulation.item(),
reg_code[0].item()))
sys.stdout.flush()
# with lr 1e-3 + with bias
if step % n_checkpoint == 0:
modelname = model_dir + '/' + model_name + "stagelvl1_" + str(step) + '.pth'
torch.save(model.state_dict(), modelname)
np.save(model_dir + '/loss' + model_name + "stagelvl1_" + str(step) + '.npy', lossall)
step += 1
if step > iteration_lvl1:
break
print("one epoch pass")
np.save(model_dir + '/loss' + model_name + 'stagelvl1.npy', lossall)
def train_lvl2():
print("Training lvl2...")
model_lvl1 = Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl1(2, 3, start_channel, is_train=True,
imgshape=imgshape_4,
range_flow=range_flow).cuda()
model_path = sorted(glob.glob("../Model/Stage/" + model_name + "stagelvl1_?????.pth"))[-1]
model_lvl1.load_state_dict(torch.load(model_path))
print("Loading weight for model_lvl1...", model_path)
# Freeze model_lvl1 weight
for param in model_lvl1.parameters():
param.requires_grad = False
model = Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl2(2, 3, start_channel, is_train=True,
imgshape=imgshape_2,
range_flow=range_flow, model_lvl1=model_lvl1).cuda()
loss_similarity = multi_resolution_NCC(win=5, scale=2)
loss_smooth = smoothloss
loss_Jdet = neg_Jdet_loss
transform = SpatialTransform_unit().cuda()
for param in transform.parameters():
param.requires_grad = False
param.volatile = True
# OASIS
names = sorted(glob.glob(datapath + '/*.nii'))
grid_2 = generate_grid(imgshape_2)
grid_2 = torch.from_numpy(np.reshape(grid_2, (1,) + grid_2.shape)).cuda().float()
optimizer = torch.optim.Adam(model.parameters(), lr=lr)
# optimizer = torch.optim.SGD(model.parameters(), lr=lr, momentum=0.9)
model_dir = '../Model/Stage'
if not os.path.isdir(model_dir):
os.mkdir(model_dir)
lossall = np.zeros((4, iteration_lvl2 + 1))
training_generator = Data.DataLoader(Dataset_epoch(names, norm=False), batch_size=1,
shuffle=True, num_workers=2)
step = 0
load_model = False
if load_model is True:
model_path = "../Model/LDR_LPBA_NCC_lap_share_preact_1_05_3000.pth"
print("Loading weight: ", model_path)
step = 3000
model.load_state_dict(torch.load(model_path))
temp_lossall = np.load("../Model/loss_LDR_LPBA_NCC_lap_share_preact_1_05_3000.npy")
lossall[:, 0:3000] = temp_lossall[:, 0:3000]
while step <= iteration_lvl2:
for X, Y in training_generator:
X = X.cuda().float()
Y = Y.cuda().float()
reg_code = torch.rand(1, dtype=X.dtype, device=X.device).unsqueeze(dim=0)
F_X_Y, X_Y, Y_4x, F_xy, F_xy_lvl1, _ = model(X, Y, reg_code)
loss_multiNCC = loss_similarity(X_Y, Y_4x)
F_X_Y_norm = transform_unit_flow_to_flow_cuda(F_X_Y.permute(0, 2, 3, 4, 1).clone())
loss_Jacobian = loss_Jdet(F_X_Y_norm, grid_2)
_, _, x, y, z = F_X_Y.shape
norm_vector = torch.zeros((1, 3, 1, 1, 1), dtype=F_X_Y.dtype, device=F_X_Y.device)
norm_vector[0, 0, 0, 0, 0] = (z - 1)
norm_vector[0, 1, 0, 0, 0] = (y - 1)
norm_vector[0, 2, 0, 0, 0] = (x - 1)
loss_regulation = loss_smooth(F_X_Y * norm_vector)
smo_weight = reg_code * max_smooth
loss = loss_multiNCC + antifold * loss_Jacobian + smo_weight * loss_regulation
optimizer.zero_grad() # clear gradients for this training step
loss.backward() # backpropagation, compute gradients
optimizer.step() # apply gradients
lossall[:, step] = np.array(
[loss.item(), loss_multiNCC.item(), loss_Jacobian.item(), loss_regulation.item()])
sys.stdout.write(
"\r" + 'step "{0}" -> training loss "{1:.4f}" - sim_NCC "{2:4f}" - Jdet "{3:.10f}" -smo "{4:.4f} -reg_c "{5:.4f}"'.format(
step, loss.item(), loss_multiNCC.item(), loss_Jacobian.item(), loss_regulation.item(),
reg_code[0].item()))
sys.stdout.flush()
# with lr 1e-3 + with bias
if (step % n_checkpoint == 0):
modelname = model_dir + '/' + model_name + "stagelvl2_" + str(step) + '.pth'
torch.save(model.state_dict(), modelname)
np.save(model_dir + '/loss' + model_name + "stagelvl2_" + str(step) + '.npy', lossall)
if step == freeze_step:
model.unfreeze_modellvl1()
step += 1
if step > iteration_lvl2:
break
print("one epoch pass")
np.save(model_dir + '/loss' + model_name + 'stagelvl2.npy', lossall)
def train_lvl3():
print("Training lvl3...")
model_lvl1 = Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl1(2, 3, start_channel, is_train=True,
imgshape=imgshape_4,
range_flow=range_flow).cuda()
model_lvl2 = Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl2(2, 3, start_channel, is_train=True,
imgshape=imgshape_2,
range_flow=range_flow,
model_lvl1=model_lvl1).cuda()
model_path = sorted(glob.glob("../Model/Stage/" + model_name + "stagelvl2_?????.pth"))[-1]
model_lvl2.load_state_dict(torch.load(model_path))
print("Loading weight for model_lvl2...", model_path)
# Freeze model_lvl1 weight
for param in model_lvl2.parameters():
param.requires_grad = False
model = Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl3(2, 3, start_channel, is_train=True,
imgshape=imgshape,
range_flow=range_flow, model_lvl2=model_lvl2).cuda()
loss_similarity = multi_resolution_NCC(win=7, scale=3)
loss_smooth = smoothloss
loss_Jdet = neg_Jdet_loss
transform = SpatialTransform_unit().cuda()
transform_nearest = SpatialTransformNearest_unit().cuda()
for param in transform.parameters():
param.requires_grad = False
param.volatile = True
# OASIS
names = sorted(glob.glob(datapath + '/*.nii'))
grid = generate_grid(imgshape)
grid = torch.from_numpy(np.reshape(grid, (1,) + grid.shape)).cuda().float()
grid_unit = generate_grid_unit(imgshape)
grid_unit = torch.from_numpy(np.reshape(grid_unit, (1,) + grid_unit.shape)).cuda().float()
optimizer = torch.optim.Adam(model.parameters(), lr=lr)
# optimizer = torch.optim.SGD(model.parameters(), lr=lr, momentum=0.9)
model_dir = '../Model'
if not os.path.isdir(model_dir):
os.mkdir(model_dir)
lossall = np.zeros((4, iteration_lvl3 + 1))
training_generator = Data.DataLoader(Dataset_epoch(names, norm=False), batch_size=1,
shuffle=True, num_workers=2)
step = 0
load_model = False
if load_model is True:
model_path = "../Model/LDR_LPBA_NCC_lap_share_preact_1_05_3000.pth"
print("Loading weight: ", model_path)
step = 3000
model.load_state_dict(torch.load(model_path))
temp_lossall = np.load("../Model/loss_LDR_LPBA_NCC_lap_share_preact_1_05_3000.npy")
lossall[:, 0:3000] = temp_lossall[:, 0:3000]
while step <= iteration_lvl3:
for X, Y in training_generator:
X = X.cuda().float()
Y = Y.cuda().float()
reg_code = torch.rand(1, dtype=X.dtype, device=X.device).unsqueeze(dim=0)
F_X_Y, X_Y, Y_4x, F_xy, F_xy_lvl1, F_xy_lvl2, _ = model(X, Y, reg_code)
loss_multiNCC = loss_similarity(X_Y, Y_4x)
F_X_Y_norm = transform_unit_flow_to_flow_cuda(F_X_Y.permute(0, 2, 3, 4, 1).clone())
loss_Jacobian = loss_Jdet(F_X_Y_norm, grid)
_, _, x, y, z = F_X_Y.shape
norm_vector = torch.zeros((1, 3, 1, 1, 1), dtype=F_X_Y.dtype, device=F_X_Y.device)
norm_vector[0, 0, 0, 0, 0] = (z - 1)
norm_vector[0, 1, 0, 0, 0] = (y - 1)
norm_vector[0, 2, 0, 0, 0] = (x - 1)
loss_regulation = loss_smooth(F_X_Y * norm_vector)
smo_weight = reg_code * max_smooth
loss = loss_multiNCC + antifold * loss_Jacobian + smo_weight * loss_regulation
optimizer.zero_grad() # clear gradients for this training step
loss.backward() # backpropagation, compute gradients
optimizer.step() # apply gradients
lossall[:, step] = np.array(
[loss.item(), loss_multiNCC.item(), loss_Jacobian.item(), loss_regulation.item()])
sys.stdout.write(
"\r" + 'step "{0}" -> training loss "{1:.4f}" - sim_NCC "{2:4f}" - Jdet "{3:.10f}" -smo "{4:.4f} -reg_c "{5:.4f}"'.format(
step, loss.item(), loss_multiNCC.item(), loss_Jacobian.item(), loss_regulation.item(),
reg_code[0].item()))
sys.stdout.flush()
# with lr 1e-3 + with bias
if step % n_checkpoint == 0:
modelname = model_dir + '/' + model_name + "stagelvl3_" + str(step) + '.pth'
torch.save(model.state_dict(), modelname)
np.save(model_dir + '/loss' + model_name + "stagelvl3_" + str(step) + '.npy', lossall)
# Put your validation code here
# ---------------------------------------
if step == freeze_step:
model.unfreeze_modellvl2()
step += 1
if step > iteration_lvl3:
break
print("one epoch pass")
np.save(model_dir + '/loss' + model_name + 'stagelvl3.npy', lossall)
imgshape = (160, 192, 144)
imgshape_4 = (160 / 4, 192 / 4, 144 / 4)
imgshape_2 = (160 / 2, 192 / 2, 144 / 2)
range_flow = 0.4
max_smooth = 10.
start_t = datetime.now()
train_lvl1()
train_lvl2()
train_lvl3()
# time
end_t = datetime.now()
total_t = end_t - start_t
print("Time: ", total_t.total_seconds())
| 41.330827
| 138
| 0.585289
| 2,098
| 16,491
| 4.319352
| 0.111535
| 0.008607
| 0.007945
| 0.032774
| 0.772567
| 0.744869
| 0.723571
| 0.715405
| 0.692121
| 0.687597
| 0
| 0.041688
| 0.293069
| 16,491
| 398
| 139
| 41.434673
| 0.735632
| 0.043478
| 0
| 0.56314
| 1
| 0.010239
| 0.107308
| 0.026986
| 0
| 0
| 0
| 0
| 0
| 1
| 0.010239
| false
| 0.010239
| 0.03413
| 0
| 0.044369
| 0.040956
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b3bbea3ceef6d735318b5142e23764578478fe0a
| 21,276
|
py
|
Python
|
src/python_pachyderm/proto/auth/auth_pb2_grpc.py
|
barretthinson/python-pachyderm
|
82cea22d1105d70833a5522ccac750ca521694ff
|
[
"Apache-2.0"
] | null | null | null |
src/python_pachyderm/proto/auth/auth_pb2_grpc.py
|
barretthinson/python-pachyderm
|
82cea22d1105d70833a5522ccac750ca521694ff
|
[
"Apache-2.0"
] | null | null | null |
src/python_pachyderm/proto/auth/auth_pb2_grpc.py
|
barretthinson/python-pachyderm
|
82cea22d1105d70833a5522ccac750ca521694ff
|
[
"Apache-2.0"
] | null | null | null |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from python_pachyderm.proto.auth import auth_pb2 as client_dot_auth_dot_auth__pb2
class APIStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Activate = channel.unary_unary(
'/auth.API/Activate',
request_serializer=client_dot_auth_dot_auth__pb2.ActivateRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.ActivateResponse.FromString,
)
self.Deactivate = channel.unary_unary(
'/auth.API/Deactivate',
request_serializer=client_dot_auth_dot_auth__pb2.DeactivateRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.DeactivateResponse.FromString,
)
self.GetConfiguration = channel.unary_unary(
'/auth.API/GetConfiguration',
request_serializer=client_dot_auth_dot_auth__pb2.GetConfigurationRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetConfigurationResponse.FromString,
)
self.SetConfiguration = channel.unary_unary(
'/auth.API/SetConfiguration',
request_serializer=client_dot_auth_dot_auth__pb2.SetConfigurationRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.SetConfigurationResponse.FromString,
)
self.GetAdmins = channel.unary_unary(
'/auth.API/GetAdmins',
request_serializer=client_dot_auth_dot_auth__pb2.GetAdminsRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetAdminsResponse.FromString,
)
self.ModifyAdmins = channel.unary_unary(
'/auth.API/ModifyAdmins',
request_serializer=client_dot_auth_dot_auth__pb2.ModifyAdminsRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.ModifyAdminsResponse.FromString,
)
self.GetClusterRoleBindings = channel.unary_unary(
'/auth.API/GetClusterRoleBindings',
request_serializer=client_dot_auth_dot_auth__pb2.GetClusterRoleBindingsRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetClusterRoleBindingsResponse.FromString,
)
self.ModifyClusterRoleBinding = channel.unary_unary(
'/auth.API/ModifyClusterRoleBinding',
request_serializer=client_dot_auth_dot_auth__pb2.ModifyClusterRoleBindingRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.ModifyClusterRoleBindingResponse.FromString,
)
self.Authenticate = channel.unary_unary(
'/auth.API/Authenticate',
request_serializer=client_dot_auth_dot_auth__pb2.AuthenticateRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.AuthenticateResponse.FromString,
)
self.Authorize = channel.unary_unary(
'/auth.API/Authorize',
request_serializer=client_dot_auth_dot_auth__pb2.AuthorizeRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.AuthorizeResponse.FromString,
)
self.WhoAmI = channel.unary_unary(
'/auth.API/WhoAmI',
request_serializer=client_dot_auth_dot_auth__pb2.WhoAmIRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.WhoAmIResponse.FromString,
)
self.GetScope = channel.unary_unary(
'/auth.API/GetScope',
request_serializer=client_dot_auth_dot_auth__pb2.GetScopeRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetScopeResponse.FromString,
)
self.SetScope = channel.unary_unary(
'/auth.API/SetScope',
request_serializer=client_dot_auth_dot_auth__pb2.SetScopeRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.SetScopeResponse.FromString,
)
self.GetACL = channel.unary_unary(
'/auth.API/GetACL',
request_serializer=client_dot_auth_dot_auth__pb2.GetACLRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetACLResponse.FromString,
)
self.SetACL = channel.unary_unary(
'/auth.API/SetACL',
request_serializer=client_dot_auth_dot_auth__pb2.SetACLRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.SetACLResponse.FromString,
)
self.GetOIDCLogin = channel.unary_unary(
'/auth.API/GetOIDCLogin',
request_serializer=client_dot_auth_dot_auth__pb2.GetOIDCLoginRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetOIDCLoginResponse.FromString,
)
self.GetAuthToken = channel.unary_unary(
'/auth.API/GetAuthToken',
request_serializer=client_dot_auth_dot_auth__pb2.GetAuthTokenRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetAuthTokenResponse.FromString,
)
self.ExtendAuthToken = channel.unary_unary(
'/auth.API/ExtendAuthToken',
request_serializer=client_dot_auth_dot_auth__pb2.ExtendAuthTokenRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.ExtendAuthTokenResponse.FromString,
)
self.RevokeAuthToken = channel.unary_unary(
'/auth.API/RevokeAuthToken',
request_serializer=client_dot_auth_dot_auth__pb2.RevokeAuthTokenRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.RevokeAuthTokenResponse.FromString,
)
self.SetGroupsForUser = channel.unary_unary(
'/auth.API/SetGroupsForUser',
request_serializer=client_dot_auth_dot_auth__pb2.SetGroupsForUserRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.SetGroupsForUserResponse.FromString,
)
self.ModifyMembers = channel.unary_unary(
'/auth.API/ModifyMembers',
request_serializer=client_dot_auth_dot_auth__pb2.ModifyMembersRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.ModifyMembersResponse.FromString,
)
self.GetGroups = channel.unary_unary(
'/auth.API/GetGroups',
request_serializer=client_dot_auth_dot_auth__pb2.GetGroupsRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetGroupsResponse.FromString,
)
self.GetUsers = channel.unary_unary(
'/auth.API/GetUsers',
request_serializer=client_dot_auth_dot_auth__pb2.GetUsersRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetUsersResponse.FromString,
)
self.GetOneTimePassword = channel.unary_unary(
'/auth.API/GetOneTimePassword',
request_serializer=client_dot_auth_dot_auth__pb2.GetOneTimePasswordRequest.SerializeToString,
response_deserializer=client_dot_auth_dot_auth__pb2.GetOneTimePasswordResponse.FromString,
)
class APIServicer(object):
# missing associated documentation comment in .proto file
pass
def Activate(self, request, context):
"""Activate/Deactivate the auth API. 'Activate' sets an initial set of admins
for the Pachyderm cluster, and 'Deactivate' removes all ACLs, tokens, and
admins from the Pachyderm cluster, making all data publicly accessable
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Deactivate(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetConfiguration(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetConfiguration(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAdmins(self, request, context):
"""Deprecated. GetAdmins returns the current list of cluster super admins
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ModifyAdmins(self, request, context):
"""Deprecated. ModifyAdmins adds or removes super admins from the cluster
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetClusterRoleBindings(self, request, context):
"""GetClusterRoleBindings returns the current set of cluster role bindings
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ModifyClusterRoleBinding(self, request, context):
"""ModifyAdmin sets the list of admin roles for a principal
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Authenticate(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Authorize(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def WhoAmI(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetScope(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetScope(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetACL(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetACL(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetOIDCLogin(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetAuthToken(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ExtendAuthToken(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RevokeAuthToken(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetGroupsForUser(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ModifyMembers(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetGroups(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetUsers(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetOneTimePassword(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_APIServicer_to_server(servicer, server):
rpc_method_handlers = {
'Activate': grpc.unary_unary_rpc_method_handler(
servicer.Activate,
request_deserializer=client_dot_auth_dot_auth__pb2.ActivateRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.ActivateResponse.SerializeToString,
),
'Deactivate': grpc.unary_unary_rpc_method_handler(
servicer.Deactivate,
request_deserializer=client_dot_auth_dot_auth__pb2.DeactivateRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.DeactivateResponse.SerializeToString,
),
'GetConfiguration': grpc.unary_unary_rpc_method_handler(
servicer.GetConfiguration,
request_deserializer=client_dot_auth_dot_auth__pb2.GetConfigurationRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetConfigurationResponse.SerializeToString,
),
'SetConfiguration': grpc.unary_unary_rpc_method_handler(
servicer.SetConfiguration,
request_deserializer=client_dot_auth_dot_auth__pb2.SetConfigurationRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.SetConfigurationResponse.SerializeToString,
),
'GetAdmins': grpc.unary_unary_rpc_method_handler(
servicer.GetAdmins,
request_deserializer=client_dot_auth_dot_auth__pb2.GetAdminsRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetAdminsResponse.SerializeToString,
),
'ModifyAdmins': grpc.unary_unary_rpc_method_handler(
servicer.ModifyAdmins,
request_deserializer=client_dot_auth_dot_auth__pb2.ModifyAdminsRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.ModifyAdminsResponse.SerializeToString,
),
'GetClusterRoleBindings': grpc.unary_unary_rpc_method_handler(
servicer.GetClusterRoleBindings,
request_deserializer=client_dot_auth_dot_auth__pb2.GetClusterRoleBindingsRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetClusterRoleBindingsResponse.SerializeToString,
),
'ModifyClusterRoleBinding': grpc.unary_unary_rpc_method_handler(
servicer.ModifyClusterRoleBinding,
request_deserializer=client_dot_auth_dot_auth__pb2.ModifyClusterRoleBindingRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.ModifyClusterRoleBindingResponse.SerializeToString,
),
'Authenticate': grpc.unary_unary_rpc_method_handler(
servicer.Authenticate,
request_deserializer=client_dot_auth_dot_auth__pb2.AuthenticateRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.AuthenticateResponse.SerializeToString,
),
'Authorize': grpc.unary_unary_rpc_method_handler(
servicer.Authorize,
request_deserializer=client_dot_auth_dot_auth__pb2.AuthorizeRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.AuthorizeResponse.SerializeToString,
),
'WhoAmI': grpc.unary_unary_rpc_method_handler(
servicer.WhoAmI,
request_deserializer=client_dot_auth_dot_auth__pb2.WhoAmIRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.WhoAmIResponse.SerializeToString,
),
'GetScope': grpc.unary_unary_rpc_method_handler(
servicer.GetScope,
request_deserializer=client_dot_auth_dot_auth__pb2.GetScopeRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetScopeResponse.SerializeToString,
),
'SetScope': grpc.unary_unary_rpc_method_handler(
servicer.SetScope,
request_deserializer=client_dot_auth_dot_auth__pb2.SetScopeRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.SetScopeResponse.SerializeToString,
),
'GetACL': grpc.unary_unary_rpc_method_handler(
servicer.GetACL,
request_deserializer=client_dot_auth_dot_auth__pb2.GetACLRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetACLResponse.SerializeToString,
),
'SetACL': grpc.unary_unary_rpc_method_handler(
servicer.SetACL,
request_deserializer=client_dot_auth_dot_auth__pb2.SetACLRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.SetACLResponse.SerializeToString,
),
'GetOIDCLogin': grpc.unary_unary_rpc_method_handler(
servicer.GetOIDCLogin,
request_deserializer=client_dot_auth_dot_auth__pb2.GetOIDCLoginRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetOIDCLoginResponse.SerializeToString,
),
'GetAuthToken': grpc.unary_unary_rpc_method_handler(
servicer.GetAuthToken,
request_deserializer=client_dot_auth_dot_auth__pb2.GetAuthTokenRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetAuthTokenResponse.SerializeToString,
),
'ExtendAuthToken': grpc.unary_unary_rpc_method_handler(
servicer.ExtendAuthToken,
request_deserializer=client_dot_auth_dot_auth__pb2.ExtendAuthTokenRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.ExtendAuthTokenResponse.SerializeToString,
),
'RevokeAuthToken': grpc.unary_unary_rpc_method_handler(
servicer.RevokeAuthToken,
request_deserializer=client_dot_auth_dot_auth__pb2.RevokeAuthTokenRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.RevokeAuthTokenResponse.SerializeToString,
),
'SetGroupsForUser': grpc.unary_unary_rpc_method_handler(
servicer.SetGroupsForUser,
request_deserializer=client_dot_auth_dot_auth__pb2.SetGroupsForUserRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.SetGroupsForUserResponse.SerializeToString,
),
'ModifyMembers': grpc.unary_unary_rpc_method_handler(
servicer.ModifyMembers,
request_deserializer=client_dot_auth_dot_auth__pb2.ModifyMembersRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.ModifyMembersResponse.SerializeToString,
),
'GetGroups': grpc.unary_unary_rpc_method_handler(
servicer.GetGroups,
request_deserializer=client_dot_auth_dot_auth__pb2.GetGroupsRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetGroupsResponse.SerializeToString,
),
'GetUsers': grpc.unary_unary_rpc_method_handler(
servicer.GetUsers,
request_deserializer=client_dot_auth_dot_auth__pb2.GetUsersRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetUsersResponse.SerializeToString,
),
'GetOneTimePassword': grpc.unary_unary_rpc_method_handler(
servicer.GetOneTimePassword,
request_deserializer=client_dot_auth_dot_auth__pb2.GetOneTimePasswordRequest.FromString,
response_serializer=client_dot_auth_dot_auth__pb2.GetOneTimePasswordResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'auth.API', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
| 48.354545
| 111
| 0.770023
| 2,209
| 21,276
| 7.023993
| 0.074694
| 0.087523
| 0.081271
| 0.100026
| 0.804009
| 0.766886
| 0.765403
| 0.58546
| 0.458623
| 0.28693
| 0
| 0.00548
| 0.159522
| 21,276
| 439
| 112
| 48.464692
| 0.862208
| 0.084696
| 0
| 0.317935
| 1
| 0
| 0.099608
| 0.01954
| 0
| 0
| 0
| 0
| 0
| 1
| 0.070652
| false
| 0.081522
| 0.005435
| 0
| 0.081522
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
b3fa0782717a39fa918b7977539bdb3b3c1c4471
| 20
|
py
|
Python
|
version.py
|
Dranion/s3am
|
1100b794eee98d4985df3b295e396de797ba4d61
|
[
"Apache-2.0"
] | 12
|
2015-04-09T03:09:46.000Z
|
2021-10-10T22:16:40.000Z
|
version.py
|
BD2KGenomics/s3am
|
d0e26e89fcd7d0e9e51aef75d4f29f5c5a5ac14c
|
[
"Apache-2.0"
] | 57
|
2015-02-18T07:21:38.000Z
|
2017-04-24T04:59:52.000Z
|
version.py
|
Dranion/s3am
|
1100b794eee98d4985df3b295e396de797ba4d61
|
[
"Apache-2.0"
] | 8
|
2015-09-25T06:57:51.000Z
|
2021-10-10T22:16:31.000Z
|
version = '2.1.0a1'
| 10
| 19
| 0.6
| 4
| 20
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235294
| 0.15
| 20
| 1
| 20
| 20
| 0.470588
| 0
| 0
| 0
| 0
| 0
| 0.35
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b3ffd50808c3ea5f3c56c8b84912e34ca2ae1d8d
| 31
|
py
|
Python
|
bitirmetezi/venv/Lib/site-packages/plot/matplotlibConfig/__init__.py
|
busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD
|
fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3
|
[
"MIT"
] | 1
|
2020-04-10T08:14:43.000Z
|
2020-04-10T08:14:43.000Z
|
bitirmetezi/venv/Lib/site-packages/plot/matplotlibConfig/__init__.py
|
busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD
|
fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3
|
[
"MIT"
] | 1
|
2016-11-30T20:37:27.000Z
|
2016-12-12T11:55:50.000Z
|
bitirmetezi/venv/Lib/site-packages/plot/matplotlibConfig/__init__.py
|
busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD
|
fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3
|
[
"MIT"
] | 1
|
2019-12-18T07:56:00.000Z
|
2019-12-18T07:56:00.000Z
|
from .rcParams import rcParams
| 15.5
| 30
| 0.83871
| 4
| 31
| 6.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 31
| 1
| 31
| 31
| 0.962963
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
37725063ebccd75358f5bee40f22b65f3b415c00
| 94
|
py
|
Python
|
bookstone/exceptions.py
|
Timtam/bookstone
|
fe06e35ad18c51e452d400a5e679aa2824931557
|
[
"MIT"
] | null | null | null |
bookstone/exceptions.py
|
Timtam/bookstone
|
fe06e35ad18c51e452d400a5e679aa2824931557
|
[
"MIT"
] | 3
|
2020-10-29T23:55:17.000Z
|
2021-04-16T20:41:46.000Z
|
bookstone/exceptions.py
|
Timtam/bookstone
|
fe06e35ad18c51e452d400a5e679aa2824931557
|
[
"MIT"
] | null | null | null |
class BackendError(Exception):
pass
class ThreadStoppedError(Exception):
pass
| 13.428571
| 37
| 0.702128
| 8
| 94
| 8.25
| 0.625
| 0.393939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.234043
| 94
| 6
| 38
| 15.666667
| 0.916667
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
377a8619fcd7a43bc299016c5c4b7a5fd7e37030
| 313
|
py
|
Python
|
errpred/__init__.py
|
Ithric/keras-error-predictor
|
c8272ee27c5c64ba12b10dd0bb94e58513edf429
|
[
"MIT"
] | null | null | null |
errpred/__init__.py
|
Ithric/keras-error-predictor
|
c8272ee27c5c64ba12b10dd0bb94e58513edf429
|
[
"MIT"
] | null | null | null |
errpred/__init__.py
|
Ithric/keras-error-predictor
|
c8272ee27c5c64ba12b10dd0bb94e58513edf429
|
[
"MIT"
] | null | null | null |
from errpred.errutils import copy_model, normalize_data, split_train_validation, to_shape, fit_model, print_summary, split_train_test
from errpred.aleatoric_error import create_error_model, train_error_model, predict_error
from errpred.epistemic_error import create_epistemic_error_model, estimate_epistemic_error
| 104.333333
| 133
| 0.897764
| 45
| 313
| 5.777778
| 0.511111
| 0.126923
| 0.130769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.063898
| 313
| 3
| 134
| 104.333333
| 0.887372
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
37ca709962d19336868ab8cda93251e3f64b9b0b
| 732
|
py
|
Python
|
soni_f110_ws/build/f110-skeletons-spring2020/system/vesc/vesc_driver/catkin_generated/pkg.develspace.context.pc.py
|
4-legends/Paresh-Soni-F110-2020
|
24b8d6ee654d4b0f78dc2bf643f0f850e5c0ca85
|
[
"MIT"
] | null | null | null |
soni_f110_ws/build/f110-skeletons-spring2020/system/vesc/vesc_driver/catkin_generated/pkg.develspace.context.pc.py
|
4-legends/Paresh-Soni-F110-2020
|
24b8d6ee654d4b0f78dc2bf643f0f850e5c0ca85
|
[
"MIT"
] | null | null | null |
soni_f110_ws/build/f110-skeletons-spring2020/system/vesc/vesc_driver/catkin_generated/pkg.develspace.context.pc.py
|
4-legends/Paresh-Soni-F110-2020
|
24b8d6ee654d4b0f78dc2bf643f0f850e5c0ca85
|
[
"MIT"
] | null | null | null |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/graspinglab/carla-ros-bridge/Paresh-Soni-F110-2020/soni_f110_ws/src/f110-skeletons-spring2020/system/vesc/vesc_driver/include".split(';') if "/home/graspinglab/carla-ros-bridge/Paresh-Soni-F110-2020/soni_f110_ws/src/f110-skeletons-spring2020/system/vesc/vesc_driver/include" != "" else []
PROJECT_CATKIN_DEPENDS = "nodelet;pluginlib;roscpp;std_msgs;vesc_msgs;serial".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "vesc_driver"
PROJECT_SPACE_DIR = "/home/graspinglab/carla-ros-bridge/Paresh-Soni-F110-2020/soni_f110_ws/devel"
PROJECT_VERSION = "0.0.1"
| 81.333333
| 329
| 0.784153
| 107
| 732
| 5.11215
| 0.476636
| 0.087751
| 0.109689
| 0.126143
| 0.506399
| 0.506399
| 0.506399
| 0.506399
| 0.506399
| 0.506399
| 0
| 0.067821
| 0.053279
| 732
| 8
| 330
| 91.5
| 0.721501
| 0.07377
| 0
| 0
| 1
| 0.428571
| 0.602071
| 0.572485
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
37ccaf97e53097669cba52e77bbfd2e944194f9d
| 110
|
py
|
Python
|
examples/theworldfoundry/theworldfoundry/components/important.py
|
vreon/figment
|
03696ee1c2288805d2a041f4116813d2f81640f8
|
[
"MIT"
] | 12
|
2016-12-01T19:30:54.000Z
|
2020-12-15T13:16:52.000Z
|
examples/theworldfoundry/theworldfoundry/components/important.py
|
vreon/figment
|
03696ee1c2288805d2a041f4116813d2f81640f8
|
[
"MIT"
] | null | null | null |
examples/theworldfoundry/theworldfoundry/components/important.py
|
vreon/figment
|
03696ee1c2288805d2a041f4116813d2f81640f8
|
[
"MIT"
] | 1
|
2020-09-15T18:56:34.000Z
|
2020-09-15T18:56:34.000Z
|
from figment import Component
class Important(Component):
"""An item that can't be dropped or taken."""
| 18.333333
| 49
| 0.718182
| 16
| 110
| 4.9375
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 110
| 5
| 50
| 22
| 0.877778
| 0.354545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
807aed00017a263819144c0b01346494f6e037c6
| 148
|
py
|
Python
|
tizza/pizza/admin.py
|
RicardoMorato/DesignOfMicroservices
|
539ac040ffad729957dd923d0c3124d255c2bc5a
|
[
"MIT"
] | null | null | null |
tizza/pizza/admin.py
|
RicardoMorato/DesignOfMicroservices
|
539ac040ffad729957dd923d0c3124d255c2bc5a
|
[
"MIT"
] | null | null | null |
tizza/pizza/admin.py
|
RicardoMorato/DesignOfMicroservices
|
539ac040ffad729957dd923d0c3124d255c2bc5a
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Pizza
class PizzaAdmin(admin.ModelAdmin):
pass
admin.site.register(Pizza, PizzaAdmin)
| 13.454545
| 38
| 0.777027
| 19
| 148
| 6.052632
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148649
| 148
| 10
| 39
| 14.8
| 0.912698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
80abdbe778467ffb6b03846c21f8641b8f7a9856
| 128
|
py
|
Python
|
Python/AWS_Search_Private_IP.py
|
Blue-Comet/AWS-CD
|
fe32ae0c992b9906b97eae444e09851bbf115d75
|
[
"Apache-2.0"
] | null | null | null |
Python/AWS_Search_Private_IP.py
|
Blue-Comet/AWS-CD
|
fe32ae0c992b9906b97eae444e09851bbf115d75
|
[
"Apache-2.0"
] | null | null | null |
Python/AWS_Search_Private_IP.py
|
Blue-Comet/AWS-CD
|
fe32ae0c992b9906b97eae444e09851bbf115d75
|
[
"Apache-2.0"
] | null | null | null |
version https://git-lfs.github.com/spec/v1
oid sha256:e0de201cc6d4630bd3cdb656ecbb417301e87061aae5be10fdc65ec64d826a2f
size 811
| 32
| 75
| 0.882813
| 13
| 128
| 8.692308
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.344262
| 0.046875
| 128
| 3
| 76
| 42.666667
| 0.581967
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
80ac068ca5610741b60acd39b8a1fe0bde98049c
| 32
|
py
|
Python
|
python/Legacy/micro.py
|
LostLucidity/lucid_ai
|
0811fd7169015d7ba61d5ee54ce01f60129aeb61
|
[
"MIT"
] | 2
|
2020-08-13T01:25:20.000Z
|
2020-11-22T19:00:06.000Z
|
python/Legacy/micro.py
|
LostLucidity/lucid_ai
|
0811fd7169015d7ba61d5ee54ce01f60129aeb61
|
[
"MIT"
] | null | null | null |
python/Legacy/micro.py
|
LostLucidity/lucid_ai
|
0811fd7169015d7ba61d5ee54ce01f60129aeb61
|
[
"MIT"
] | null | null | null |
# adjust iteration when microing
| 32
| 32
| 0.84375
| 4
| 32
| 6.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 32
| 1
| 32
| 32
| 0.964286
| 0.9375
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
80eaf021e113ff89511e921e4eacab7c9c0d4050
| 218
|
py
|
Python
|
common/models.py
|
farhad0085/django-money-management
|
d4622192d6b9df3f785abd5f4ef1bfcbf465d045
|
[
"MIT"
] | null | null | null |
common/models.py
|
farhad0085/django-money-management
|
d4622192d6b9df3f785abd5f4ef1bfcbf465d045
|
[
"MIT"
] | null | null | null |
common/models.py
|
farhad0085/django-money-management
|
d4622192d6b9df3f785abd5f4ef1bfcbf465d045
|
[
"MIT"
] | null | null | null |
from django.db import models
class TrackingModel(models.Model):
created_utc = models.DateTimeField(auto_now_add=True)
updated_utc = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
| 24.222222
| 57
| 0.743119
| 28
| 218
| 5.607143
| 0.642857
| 0.11465
| 0.280255
| 0.33121
| 0.369427
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178899
| 218
| 9
| 58
| 24.222222
| 0.877095
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
80edc45454e2a0198d7bd443b563414116a934f4
| 183
|
py
|
Python
|
aio_geojson_nsw_transport_incidents/__init__.py
|
Fred-Ch/python-aio-geojson-nsw-transport-incidents-master
|
aea1e5e0a4a90c5aa8aa277e936ac8ba09f11ec5
|
[
"Apache-2.0"
] | null | null | null |
aio_geojson_nsw_transport_incidents/__init__.py
|
Fred-Ch/python-aio-geojson-nsw-transport-incidents-master
|
aea1e5e0a4a90c5aa8aa277e936ac8ba09f11ec5
|
[
"Apache-2.0"
] | null | null | null |
aio_geojson_nsw_transport_incidents/__init__.py
|
Fred-Ch/python-aio-geojson-nsw-transport-incidents-master
|
aea1e5e0a4a90c5aa8aa277e936ac8ba09f11ec5
|
[
"Apache-2.0"
] | null | null | null |
"""NSW Transport Service Incidents library."""
from .feed import NswTransportServiceIncidentsFeed # noqa
from .feed_manager import NswTransportServiceIncidentsFeedManager # noqa
| 45.75
| 74
| 0.819672
| 16
| 183
| 9.3125
| 0.75
| 0.107383
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120219
| 183
| 3
| 75
| 61
| 0.925466
| 0.278689
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
80f16a366406aaf1324fdc5eeda7cc84276e8e57
| 136
|
py
|
Python
|
kopf_entrypoint.py
|
MridulS/amalthea
|
c88cfa4c819c8ab539f470ff56c00a0caf489101
|
[
"Apache-2.0"
] | 18
|
2021-09-29T09:37:52.000Z
|
2022-03-04T07:52:18.000Z
|
kopf_entrypoint.py
|
MridulS/amalthea
|
c88cfa4c819c8ab539f470ff56c00a0caf489101
|
[
"Apache-2.0"
] | 45
|
2021-08-22T10:24:39.000Z
|
2022-03-31T09:12:48.000Z
|
kopf_entrypoint.py
|
MridulS/amalthea
|
c88cfa4c819c8ab539f470ff56c00a0caf489101
|
[
"Apache-2.0"
] | 1
|
2021-09-21T12:14:52.000Z
|
2021-09-21T12:14:52.000Z
|
# The the logic of the script expected by kopf is
# in a module inside the controller package.
from controller import server_controller
| 34
| 49
| 0.808824
| 22
| 136
| 4.954545
| 0.772727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169118
| 136
| 3
| 50
| 45.333333
| 0.964602
| 0.661765
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
80f99a71e7cd5c383cb5e623f6f1889878db9cd5
| 48
|
py
|
Python
|
yomitai/__main__.py
|
noxowl/yomitai
|
912f180e3a8100cb167d0aa9a45a770ecc47f4ca
|
[
"MIT"
] | null | null | null |
yomitai/__main__.py
|
noxowl/yomitai
|
912f180e3a8100cb167d0aa9a45a770ecc47f4ca
|
[
"MIT"
] | null | null | null |
yomitai/__main__.py
|
noxowl/yomitai
|
912f180e3a8100cb167d0aa9a45a770ecc47f4ca
|
[
"MIT"
] | null | null | null |
from .main import app
app(prog_name='yomitai')
| 12
| 24
| 0.75
| 8
| 48
| 4.375
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 48
| 3
| 25
| 16
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.145833
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
03d19dd393e69b836e3a585132016107796a2a6f
| 47
|
py
|
Python
|
enthought/pyface/ui/qt4/gui.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/pyface/ui/qt4/gui.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/pyface/ui/qt4/gui.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from pyface.ui.qt4.gui import *
| 15.666667
| 31
| 0.744681
| 8
| 47
| 4.375
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025
| 0.148936
| 47
| 2
| 32
| 23.5
| 0.85
| 0.255319
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
03daf35fc62b6be0863c14c39fad17f6831b5646
| 227
|
py
|
Python
|
apps/reader/admin.py
|
starsep/NewsBlur
|
6c59416ca82377ca1bbc7d044890bdead3eba904
|
[
"MIT"
] | 3,073
|
2015-01-01T07:20:18.000Z
|
2022-03-31T20:33:41.000Z
|
apps/reader/admin.py
|
starsep/NewsBlur
|
6c59416ca82377ca1bbc7d044890bdead3eba904
|
[
"MIT"
] | 1,054
|
2015-01-02T13:32:35.000Z
|
2022-03-30T04:21:21.000Z
|
apps/reader/admin.py
|
starsep/NewsBlur
|
6c59416ca82377ca1bbc7d044890bdead3eba904
|
[
"MIT"
] | 676
|
2015-01-03T16:40:29.000Z
|
2022-03-30T14:00:40.000Z
|
from apps.reader.models import UserSubscription, UserSubscriptionFolders, Feature
from django.contrib import admin
admin.site.register(UserSubscription)
admin.site.register(UserSubscriptionFolders)
admin.site.register(Feature)
| 37.833333
| 81
| 0.867841
| 25
| 227
| 7.88
| 0.52
| 0.137056
| 0.258883
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057269
| 227
| 6
| 82
| 37.833333
| 0.920561
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ff17f34f86bac6006d3feb5cdfbe4babafa7f15d
| 12,660
|
py
|
Python
|
src/explorepy/cli.py
|
hacklschorsch/explorepy
|
407435c5e3948bdf150b412001b7f48854e846e5
|
[
"MIT"
] | null | null | null |
src/explorepy/cli.py
|
hacklschorsch/explorepy
|
407435c5e3948bdf150b412001b7f48854e846e5
|
[
"MIT"
] | null | null | null |
src/explorepy/cli.py
|
hacklschorsch/explorepy
|
407435c5e3948bdf150b412001b7f48854e846e5
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Command Line Interface module for explorepy"""
import click
import explorepy
from sys import platform as _platform
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
if _platform == 'darwin':
default_bt_backend = 'sdk'
else:
default_bt_backend = 'pybluez'
@click.group(context_settings=CONTEXT_SETTINGS, invoke_without_command=True)
@click.option("--version", "-V", help="Print explorepy version", is_flag=True)
@click.pass_context
def cli(ctx, version, args=None):
"""Python API for Mentalab biosignal aquisition devices"""
if ctx.invoked_subcommand is None:
if version:
click.echo(explorepy.__version__)
else:
click.echo(ctx.get_help())
@cli.command()
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface (default: pybluez)", default=default_bt_backend)
def find_device(bluetooth):
"""List available Explore devices."""
explorepy.set_bt_interface(bluetooth)
explorepy.tools.bt_scan()
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-d", "--duration", type=int, help="Duration in seconds", metavar="<integer>")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface (default: pybluez)", default=default_bt_backend)
def acquire(name, address, duration, bluetooth):
"""Connect to a device with selected name or address. Only one input is necessary"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.acquire(duration)
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-f", "--filename", help="Name of the file.", required=True,
type=click.Path(file_okay=True, dir_okay=True, resolve_path=True))
@click.option("-ow", "--overwrite", is_flag=True, help="Overwrite existing file")
@click.option("-d", "--duration", type=int, help="Recording duration in seconds", metavar="<integer>")
@click.option("--edf", 'file_type', flag_value='edf', help="Write in EDF file (default type)", default=True)
@click.option("--csv", 'file_type', flag_value='csv', help="Write in csv file")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface (default: pybluez)", default=default_bt_backend)
def record_data(address, name, filename, overwrite, duration, file_type, bluetooth):
"""Record data from Explore to a file """
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.record_data(file_name=filename, file_type=file_type,
do_overwrite=overwrite, duration=duration, block=True)
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-d", "--duration", type=int, help="Streaming duration in seconds", metavar="<integer>")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface (default: pybluez)", default=default_bt_backend)
def push2lsl(address, name, duration, bluetooth):
"""Push data to lsl"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.push2lsl(duration)
@cli.command()
@click.option("-f", "--filename", help="Name of (and path to) the binary file.", required=True,
type=click.Path(exists=True, file_okay=True, dir_okay=True, resolve_path=True))
@click.option("-ow", "--overwrite", is_flag=True, help="Overwrite existing file")
def bin2csv(filename, overwrite):
"""Convert a binary file to CSV"""
explore = explorepy.explore.Explore()
explore.convert_bin(bin_file=filename, do_overwrite=overwrite, file_type='csv')
@cli.command()
@click.option("-f", "--filename", help="Name of (and path to) the binary file.", required=True,
type=click.Path(exists=True, file_okay=True, dir_okay=True, resolve_path=True))
@click.option("-ow", "--overwrite", is_flag=True, help="Overwrite existing file")
def bin2edf(filename, overwrite):
"""Convert a binary file to EDF (BDF+)"""
explore = explorepy.explore.Explore()
explore.convert_bin(bin_file=filename, do_overwrite=overwrite, file_type='edf')
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-nf", "--notchfreq", type=click.Choice(['50', '60']), help="Frequency of notch filter.", default='50')
@click.option("-lf", "--lowfreq", type=float, help="Low cutoff frequency of bandpass/highpass filter.")
@click.option("-hf", "--highfreq", type=float, help="High cutoff frequency of bandpass/lowpass filter.")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def visualize(address, name, notchfreq, lowfreq, highfreq, bluetooth):
"""Visualizing signal in a browser-based dashboard"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.visualize(notch_freq=int(notchfreq), bp_freq=(lowfreq, highfreq))
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-nf", "--notchfreq", type=click.Choice(['50', '60']), help="Frequency of notch filter.", default='50')
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def impedance(address, name, notchfreq, bluetooth):
"""Impedance measurement in a browser-based dashboard"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.measure_imp(notch_freq=int(notchfreq))
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def format_memory(address, name, bluetooth):
"""format the memory of Explore device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.format_memory()
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-sr", "--sampling-rate", help="Sampling rate of ExG channels, it can be 250 or 500",
type=click.Choice(['250', '500', '1000']), required=True)
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def set_sampling_rate(address, name, sampling_rate, bluetooth):
"""Change sampling rate of the Explore device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.set_sampling_rate(int(sampling_rate))
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def soft_reset(address, name, bluetooth):
"""Software reset of Explore device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
"""Reset the selected explore device (current session will be terminated)."""
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.reset_soft()
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-m", "--channel-mask", type=click.IntRange(min=1, max=255), required=True,
help="Channel mask, it should be an integer between 1 and 255, the binary representation will be "
"interpreted as mask.")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def set_channels(address, name, channel_mask, bluetooth):
"""Mask the channels of selected explore device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.set_channels(channel_mask)
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-m", "--module", required=True, type=str, help="Module name to be disabled, options: ORN, ENV, EXG")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def disable_module(address, name, module, bluetooth):
"""Disable a module of Explore device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.disable_module(module)
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-m", "--module", required=True, type=str, help="Module name to be enabled, options: ORN, ENV, EXG")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def enable_module(address, name, module, bluetooth):
"""Enable a module of Explore device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.enable_module(module)
@cli.command()
@click.option("--address", "-a", type=str, help="Explore device's MAC address")
@click.option("--name", "-n", type=str, help="Name of the device")
@click.option("-ow", "--overwrite", is_flag=True, help="Overwrite existing file")
@click.option("--bluetooth", "-bt", type=click.Choice(['sdk', 'pybluez']), help="Select the Bluetooth interface", default=default_bt_backend)
def calibrate_orn(address, name, overwrite, bluetooth):
"""Calibrate the orientation module of the specified device"""
if name is None and address is None:
raise ValueError("Either name or address must be given!")
explorepy.set_bt_interface(bluetooth)
explore = explorepy.explore.Explore()
explore.connect(mac_address=address, device_name=name)
explore.calibrate_orn(do_overwrite=overwrite)
| 51.885246
| 160
| 0.706477
| 1,721
| 12,660
| 5.106334
| 0.118536
| 0.072599
| 0.032544
| 0.035844
| 0.752162
| 0.739417
| 0.736117
| 0.71848
| 0.71848
| 0.71848
| 0
| 0.003736
| 0.133175
| 12,660
| 243
| 161
| 52.098765
| 0.797066
| 0.057662
| 0
| 0.671958
| 0
| 0
| 0.263959
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.084656
| false
| 0.015873
| 0.015873
| 0
| 0.100529
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
205b81a4d5936ec8eb2be40238df34f42cf74f7e
| 176
|
py
|
Python
|
pyprac/movie_search_console_ui.py
|
manojbhargavan/python_practice
|
599d47af7798345db9543b05e5da4ac8930fa412
|
[
"MIT"
] | null | null | null |
pyprac/movie_search_console_ui.py
|
manojbhargavan/python_practice
|
599d47af7798345db9543b05e5da4ac8930fa412
|
[
"MIT"
] | null | null | null |
pyprac/movie_search_console_ui.py
|
manojbhargavan/python_practice
|
599d47af7798345db9543b05e5da4ac8930fa412
|
[
"MIT"
] | null | null | null |
from movies_search import MoviesSearch
movie_to_search = input('Enter a movie name or part of it: ')
search = MoviesSearch(movie_to_search)
search.get_formatted_result()
| 29.333333
| 62
| 0.789773
| 26
| 176
| 5.076923
| 0.692308
| 0.257576
| 0.287879
| 0.378788
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142045
| 176
| 5
| 63
| 35.2
| 0.874172
| 0
| 0
| 0
| 0
| 0
| 0.19883
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
20f587d4841bfc1eb4ee255e77ccd96851c5aebe
| 204
|
py
|
Python
|
mmfashion/utils/__init__.py
|
lijiancheng0614/mmfashion
|
f67b6ebc45252356d9f40a185c40894429f43a13
|
[
"Apache-2.0"
] | 2
|
2020-05-26T03:14:24.000Z
|
2021-01-31T18:23:47.000Z
|
mmfashion/utils/__init__.py
|
ceciliaAI/mmfashion
|
0161ec8717f129433271a796a3d3a6b540b005a3
|
[
"Apache-2.0"
] | null | null | null |
mmfashion/utils/__init__.py
|
ceciliaAI/mmfashion
|
0161ec8717f129433271a796a3d3a6b540b005a3
|
[
"Apache-2.0"
] | null | null | null |
from .checkpoint import init_weights_from
from .image import get_img_tensor
from .registry import Registry, build_from_cfg
__all__ = ['Registry', 'build_from_cfg', 'get_img_tensor', 'init_weights_from']
| 34
| 79
| 0.813725
| 30
| 204
| 5
| 0.433333
| 0.146667
| 0.2
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098039
| 204
| 5
| 80
| 40.8
| 0.815217
| 0
| 0
| 0
| 0
| 0
| 0.259804
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4561ec0c7487642899455ccc3ff726120ddf3e2e
| 4,761
|
py
|
Python
|
tests/test_adb.py
|
RakhithJK/andriller
|
be94bc5aff84069395c333bdf472f39b550bdba7
|
[
"MIT"
] | 883
|
2019-12-14T10:47:48.000Z
|
2022-03-30T12:35:19.000Z
|
tests/test_adb.py
|
RakhithJK/andriller
|
be94bc5aff84069395c333bdf472f39b550bdba7
|
[
"MIT"
] | 40
|
2019-12-18T03:04:28.000Z
|
2022-03-30T03:07:05.000Z
|
tests/test_adb.py
|
RakhithJK/andriller
|
be94bc5aff84069395c333bdf472f39b550bdba7
|
[
"MIT"
] | 169
|
2019-12-15T17:08:41.000Z
|
2022-03-25T12:52:12.000Z
|
import sys
import pytest
import tempfile
import subprocess
from unittest import mock
from andriller import adb_conn
fake_adb = tempfile.NamedTemporaryFile()
@pytest.fixture
def ADB(mocker):
mocker.patch('andriller.adb_conn.ADBConn.kill')
mocker.patch('andriller.adb_conn.ADBConn._opt_use_capture', return_value=True)
with mock.patch('andriller.adb_conn.ADBConn._get_adb_bin', return_value=fake_adb.name):
with mock.patch('andriller.adb_conn.ADBConn._adb_has_exec', return_value=True):
adb = adb_conn.ADBConn()
adb_cmd = adb.adb.__func__
setattr(adb, 'adb', lambda *args, **kwargs: adb_cmd(adb, *args, **kwargs))
return adb
@pytest.fixture
def ADB_alt(mocker):
mocker.patch('andriller.adb_conn.ADBConn.kill')
mocker.patch('andriller.adb_conn.ADBConn._opt_use_capture', return_value=False)
with mock.patch('andriller.adb_conn.ADBConn._get_adb_bin', return_value=fake_adb.name):
with mock.patch('andriller.adb_conn.ADBConn._adb_has_exec', return_value=False):
adb = adb_conn.ADBConn()
adb_cmd = adb.adb.__func__
setattr(adb, 'adb', lambda *args, **kwargs: adb_cmd(adb, *args, **kwargs))
return adb
@pytest.fixture
def ADB_win(mocker):
mock_sub = mocker.patch('andriller.adb_conn.subprocess', autospec=True)
mock_sub.STARTUPINFO = mock.MagicMock()
mock_sub.STARTF_USESHOWWINDOW = mock.MagicMock()
mocker.patch('andriller.adb_conn.ADBConn.kill')
mocker.patch('andriller.adb_conn.ADBConn._opt_use_capture', return_value=True)
with mock.patch('sys.platform', return_value='win32'):
with mock.patch('andriller.adb_conn.ADBConn._get_adb_bin', return_value=fake_adb.name):
with mock.patch('andriller.adb_conn.ADBConn._adb_has_exec', return_value=True):
adb = adb_conn.ADBConn()
return adb
def test_init_windows(ADB_win):
assert ADB_win.startupinfo is not None
assert ADB_win.rmr == b'\r\r\n'
@pytest.mark.parametrize('file_path, result', [
('/some/file.txt', '/some/file.txt\n'),
('/some/my file.txt', '/some/my file.txt\n'),
('some/file.txt', 'some/file.txt\n'),
])
def test_file_regex(file_path, result):
assert adb_conn.ADBConn._file_regex(file_path).match(result)
def test_adb_simple(ADB, mocker):
output = mock.Mock(stdout=b'lala', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB('hello')
assert res == 'lala'
mock_run.assert_called_with([fake_adb.name, 'hello'],
capture_output=True, shell=False, startupinfo=None)
def test_adb_simple_su(ADB, mocker):
output = mock.Mock(stdout=b'lala', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB('hello', su=True)
assert res == 'lala'
mock_run.assert_called_with([fake_adb.name, 'su -c', 'hello'],
capture_output=True, shell=False, startupinfo=None)
def test_adb_binary(ADB, mocker):
output = mock.Mock(stdout=b'lala', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB('hello', binary=True)
assert res == b'lala'
mock_run.assert_called_with([fake_adb.name, 'hello'],
capture_output=True, shell=False, startupinfo=None)
def test_adb_out(ADB, mocker):
output = mock.Mock(stdout=b'uid(1000)', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB.adb_out('id', binary=False)
assert res == 'uid(1000)'
mock_run.assert_called_with([fake_adb.name, 'shell', 'id'],
capture_output=True, shell=False, startupinfo=None)
def test_adb_out_alt(ADB_alt, mocker):
output = mock.Mock(stdout=b'uid(1000)', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB_alt.adb_out('id', binary=True)
assert res == b'uid(1000)'
mock_run.assert_called_with([fake_adb.name, 'shell', 'id'],
stdout=subprocess.PIPE, shell=False, startupinfo=None)
def test_adb_out_win(ADB_win, mocker):
output = mock.Mock(stdout=b'uid(1000)\r\r\n', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB_win.adb_out('id', binary=True)
assert res == b'uid(1000)\n'
def test_adb_out_uses_exec(ADB, mocker):
ADB._is_adb_out_post_v5 = True
output = mock.Mock(stdout=b'uid(1000)', returncode=0)
mock_run = mocker.patch('andriller.adb_conn.subprocess.run', return_value=output)
res = ADB.adb_out('id', binary=False)
assert res == 'uid(1000)'
mock_run.assert_called_with([fake_adb.name, 'exec-out', 'id'],
capture_output=True, shell=False, startupinfo=None)
| 36.623077
| 95
| 0.710775
| 702
| 4,761
| 4.576923
| 0.12963
| 0.054466
| 0.10582
| 0.130719
| 0.795207
| 0.788982
| 0.777467
| 0.762216
| 0.726113
| 0.726113
| 0
| 0.01034
| 0.146818
| 4,761
| 129
| 96
| 36.906977
| 0.78065
| 0
| 0
| 0.525773
| 0
| 0
| 0.216341
| 0.151019
| 0
| 0
| 0
| 0
| 0.164948
| 1
| 0.123711
| false
| 0
| 0.061856
| 0
| 0.216495
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
456c7876c9e495052b4d059448fc14036e36379f
| 93
|
py
|
Python
|
peco/parser/read_end_for.py
|
Tikubonn/peco
|
c77fc163ad31d3c271d299747914ce4ef3386987
|
[
"MIT"
] | null | null | null |
peco/parser/read_end_for.py
|
Tikubonn/peco
|
c77fc163ad31d3c271d299747914ce4ef3386987
|
[
"MIT"
] | null | null | null |
peco/parser/read_end_for.py
|
Tikubonn/peco
|
c77fc163ad31d3c271d299747914ce4ef3386987
|
[
"MIT"
] | null | null | null |
from .end_for import EndFor
def read_end_for(preread, stream, parser):
raise EndFor()
| 13.285714
| 42
| 0.731183
| 14
| 93
| 4.642857
| 0.785714
| 0.184615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.182796
| 93
| 6
| 43
| 15.5
| 0.855263
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
456e3af2e6de3bd6d92f5b1c4f27afbb637bd3de
| 126
|
py
|
Python
|
boa3_test/test_sc/interop_test/storage/StorageDeleteStrKey.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 25
|
2020-07-22T19:37:43.000Z
|
2022-03-08T03:23:55.000Z
|
boa3_test/test_sc/interop_test/storage/StorageDeleteStrKey.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 419
|
2020-04-23T17:48:14.000Z
|
2022-03-31T13:17:45.000Z
|
boa3_test/test_sc/interop_test/storage/StorageDeleteStrKey.py
|
hal0x2328/neo3-boa
|
6825a3533384cb01660773050719402a9703065b
|
[
"Apache-2.0"
] | 15
|
2020-05-21T21:54:24.000Z
|
2021-11-18T06:17:24.000Z
|
from boa3.builtin import public
from boa3.builtin.interop.storage import delete
@public
def Main(key: str):
delete(key)
| 15.75
| 47
| 0.761905
| 19
| 126
| 5.052632
| 0.631579
| 0.166667
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018692
| 0.150794
| 126
| 7
| 48
| 18
| 0.878505
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4576de23e37082e2dea8e638cef12f85c2f2f63b
| 5,442
|
py
|
Python
|
test/unit2/usersignup/validation_test.py
|
cdoremus/udacity-python_web_development-cs253
|
87cf5dd5d0e06ee745d3aba058d96fa46f2aeb6b
|
[
"Apache-2.0"
] | null | null | null |
test/unit2/usersignup/validation_test.py
|
cdoremus/udacity-python_web_development-cs253
|
87cf5dd5d0e06ee745d3aba058d96fa46f2aeb6b
|
[
"Apache-2.0"
] | null | null | null |
test/unit2/usersignup/validation_test.py
|
cdoremus/udacity-python_web_development-cs253
|
87cf5dd5d0e06ee745d3aba058d96fa46f2aeb6b
|
[
"Apache-2.0"
] | null | null | null |
'''
Created on Apr 25, 2012
@author: h87966
'''
import unittest
from unit2.usersignup.validation import UserSignupValidation
from unit2.usersignup.validation import VERIFICATION_MESSAGES
from unit2.usersignup.validation import VERIFICATION_MESSAGES_KEYS
from unit2.usersignup.validation import MISMATCHED_PASSWORDS_MESSAGE
class Test(unittest.TestCase):
def setUp(self):
self.validation = UserSignupValidation()
pass
def tearDown(self):
pass
def testIsValidUsername(self):
self.assertTrue(self.validation.is_valid_username("Crag"))
self.assertTrue(self.validation.is_valid_username("Crag-Doremus"))
self.assertTrue(self.validation.is_valid_username("Crag_Doremus"))
self.assertTrue(self.validation.is_valid_username("Cra"))
self.assertFalse(self.validation.is_valid_username("ca"))
self.assertFalse(self.validation.is_valid_username("cat!"))
self.assertTrue(self.validation.is_valid_username("abcdefghijklmnopqrst"))
self.assertFalse(self.validation.is_valid_username("abcdefghijklmnopqrstu"))
pass
def testIsValidPassword(self):
self.assertTrue(self.validation.is_valid_password("Craig"))
self.assertTrue(self.validation.is_valid_password("abcdefghijklmnopqrst"))
self.assertFalse(self.validation.is_valid_password("abcdefghijklmnopqrstu"))
pass
def testIsValidEmail(self):
self.assertTrue(self.validation.is_valid_email("Craig@foo.com"))
self.assertTrue(self.validation.is_valid_email("Craig@foo.com.com"))
self.assertFalse(self.validation.is_valid_email("Craigfoocom"))
pass
def testValid(self):
username = "Craig"
password = "craig1"
verify = "craig1"
email = "craig@foo.com"
validMsgs, isValid = self.validation.validate(username, password, verify, email)
self.assertTrue(isValid)
self.assertEmptyMessage([VERIFICATION_MESSAGES_KEYS[0],VERIFICATION_MESSAGES_KEYS[1],VERIFICATION_MESSAGES_KEYS[2],VERIFICATION_MESSAGES_KEYS[3]], validMsgs)
def testValid_BadUsername(self):
username = "Craigasdfasdfasdfasdfadfadfs"
password = "craig1"
verify = "craig1"
email = "craig@foo.com"
validMsgs, isValid = self.validation.validate(username, password, verify, email)
self.assertFalse(isValid)
self.assertEquals(VERIFICATION_MESSAGES[VERIFICATION_MESSAGES_KEYS[0]], validMsgs[VERIFICATION_MESSAGES_KEYS[0]])
self.assertEmptyMessage([VERIFICATION_MESSAGES_KEYS[1],VERIFICATION_MESSAGES_KEYS[2],VERIFICATION_MESSAGES_KEYS[3]], validMsgs)
def testValid_BadPassword(self):
username = "Craig"
password = "c1"
verify = "c1"
email = "craig@foo.com"
validMsgs, isValid = self.validation.validate(username, password, verify, email)
self.assertFalse(isValid)
self.assertEquals(VERIFICATION_MESSAGES[VERIFICATION_MESSAGES_KEYS[1]], validMsgs[VERIFICATION_MESSAGES_KEYS[1]])
self.assertEquals(VERIFICATION_MESSAGES[VERIFICATION_MESSAGES_KEYS[2]], validMsgs[VERIFICATION_MESSAGES_KEYS[2]])
self.assertEmptyMessage([VERIFICATION_MESSAGES_KEYS[0],VERIFICATION_MESSAGES_KEYS[3]], validMsgs)
# def testValid_BadVerifyPassword(self):
# username = "Craig"
# password = "c1"
# verify = "c1"
# email = "craig@foo.com"
# validMsgs, isValid = self.validation.validate(username, password, verify, email)
# self.assertFalse(isValid)
# self.assertEquals(VERIFICATION_MESSAGES[VERIFICATION_MESSAGES_KEYS[2]], validMsgs[VERIFICATION_MESSAGES_KEYS[2]])
# self.assertEmptyMessage([VERIFICATION_MESSAGES_KEYS[0],VERIFICATION_MESSAGES_KEYS[1],VERIFICATION_MESSAGES_KEYS[3]], validMsgs)
def testValid_BadEmail(self):
username = "Craig"
password = "craig1"
verify = "craig1"
email = "craigfoo.com"
validMsgs, isValid = self.validation.validate(username, password, verify, email)
self.assertFalse(isValid)
self.assertEquals(VERIFICATION_MESSAGES[VERIFICATION_MESSAGES_KEYS[3]], validMsgs[VERIFICATION_MESSAGES_KEYS[3]])
self.assertEmptyMessage([VERIFICATION_MESSAGES_KEYS[0],VERIFICATION_MESSAGES_KEYS[2],VERIFICATION_MESSAGES_KEYS[1]], validMsgs)
def testValid_PasswordsDontMatch(self):
username = "Craig"
password = "craig1"
verify = "craig"
email = "craig@foo.com"
validMsgs, isValid = self.validation.validate(username, password, verify, email)
self.assertFalse(isValid)
self.assertEquals(MISMATCHED_PASSWORDS_MESSAGE, validMsgs[VERIFICATION_MESSAGES_KEYS[1]])
self.assertEquals(MISMATCHED_PASSWORDS_MESSAGE, validMsgs[VERIFICATION_MESSAGES_KEYS[2]])
self.assertEmptyMessage([VERIFICATION_MESSAGES_KEYS[0],VERIFICATION_MESSAGES_KEYS[3]], validMsgs)
def test_is_password_and_verify_equals(self):
self.assertTrue(self.validation.is_password_and_verify_equals("craig", "craig"))
self.assertFalse(self.validation.is_password_and_verify_equals("craig", "craig1"))
def assertEmptyMessage(self, key_list, messages):
for key in key_list:
self.assertEquals('', messages[key], "Message with key " + key + " is not empty")
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testValidateUsername']
unittest.main()
| 45.35
| 165
| 0.722161
| 572
| 5,442
| 6.645105
| 0.146853
| 0.189424
| 0.189424
| 0.077348
| 0.806104
| 0.762431
| 0.73849
| 0.593791
| 0.541173
| 0.495922
| 0
| 0.012417
| 0.171261
| 5,442
| 120
| 166
| 45.35
| 0.830377
| 0.113194
| 0
| 0.364706
| 0
| 0
| 0.080457
| 0.014553
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0.141176
| false
| 0.317647
| 0.058824
| 0
| 0.211765
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
afe714cf033f9bba57daf8d57ed54029b8f6ecd6
| 127
|
py
|
Python
|
ankidict/pagemodel/__init__.py
|
wojtex/millandict
|
6601873a1541ef7aaf938ac1a6b7aecb5f82cbf8
|
[
"MIT"
] | 1
|
2015-10-15T19:04:05.000Z
|
2015-10-15T19:04:05.000Z
|
ankidict/pagemodel/__init__.py
|
wojtex/ankidict
|
6601873a1541ef7aaf938ac1a6b7aecb5f82cbf8
|
[
"MIT"
] | 9
|
2015-03-24T08:06:51.000Z
|
2015-05-21T13:44:10.000Z
|
ankidict/pagemodel/__init__.py
|
wojtex/ankidict
|
6601873a1541ef7aaf938ac1a6b7aecb5f82cbf8
|
[
"MIT"
] | null | null | null |
from . import html
from .html import (Node, StrictNode, Text, ShallowText,
Html, StrictHtml, ThisClass)
| 31.75
| 55
| 0.629921
| 13
| 127
| 6.153846
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.291339
| 127
| 3
| 56
| 42.333333
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b311266d18257e334be798593bb7cf2011a43b16
| 157
|
py
|
Python
|
webactivities/default_settings.py
|
lukegb/ehacktivities
|
bc04d02eaf36a106b943ce0cb8395e85a780f6fc
|
[
"MIT"
] | 1
|
2016-04-30T00:19:13.000Z
|
2016-04-30T00:19:13.000Z
|
webactivities/default_settings.py
|
lukegb/ehacktivities
|
bc04d02eaf36a106b943ce0cb8395e85a780f6fc
|
[
"MIT"
] | null | null | null |
webactivities/default_settings.py
|
lukegb/ehacktivities
|
bc04d02eaf36a106b943ce0cb8395e85a780f6fc
|
[
"MIT"
] | null | null | null |
FERNET_KEY = 'uyflUICClYw0n7OVjtyEsGDiiyLqzsSqaLQJZtGigf0='
SECRET_KEY = "=8wGX26:{mKZVRo0@0`i<RLMq(eHt~Nh8P6|LX'WHlN5S6n/eZ52>s4182G6$f1"
FERNET_TTL = 3600
| 39.25
| 78
| 0.808917
| 20
| 157
| 6.2
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162162
| 0.057325
| 157
| 3
| 79
| 52.333333
| 0.675676
| 0
| 0
| 0
| 0
| 0.333333
| 0.681529
| 0.681529
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b31c0364d3b3c6f0e6157e9a4d623e77515058ce
| 26
|
py
|
Python
|
yaraa/__init__.py
|
Te-k/yaraa
|
b5a1be88419fbd4ea5e0a1f5e6dbedca8ff77b36
|
[
"MIT"
] | 3
|
2019-12-18T03:14:56.000Z
|
2021-01-15T13:23:09.000Z
|
yaraa/__init__.py
|
Te-k/yaraa
|
b5a1be88419fbd4ea5e0a1f5e6dbedca8ff77b36
|
[
"MIT"
] | 1
|
2019-12-17T15:13:39.000Z
|
2019-12-17T15:13:39.000Z
|
yaraa/__init__.py
|
Te-k/yaraa
|
b5a1be88419fbd4ea5e0a1f5e6dbedca8ff77b36
|
[
"MIT"
] | null | null | null |
from .yaraa import lookup
| 13
| 25
| 0.807692
| 4
| 26
| 5.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 26
| 1
| 26
| 26
| 0.954545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
b32d0934431628f5bfdb30a0016bef13ddfa7e5b
| 138
|
py
|
Python
|
example/blueprints/bptest/__init__.py
|
Mitalee/Flask-SocketIO-Celery-Electron
|
78e89e91c63f3ee7b1d2deb4ee14cd76cadb8fbc
|
[
"MIT"
] | 3
|
2020-03-10T20:30:22.000Z
|
2021-11-04T15:40:28.000Z
|
example/blueprints/bptest/__init__.py
|
Mitalee/Flask-SocketIO-Celery-Electron
|
78e89e91c63f3ee7b1d2deb4ee14cd76cadb8fbc
|
[
"MIT"
] | null | null | null |
example/blueprints/bptest/__init__.py
|
Mitalee/Flask-SocketIO-Celery-Electron
|
78e89e91c63f3ee7b1d2deb4ee14cd76cadb8fbc
|
[
"MIT"
] | 1
|
2020-06-10T05:43:52.000Z
|
2020-06-10T05:43:52.000Z
|
from flask import Blueprint
#from example.app import create_celery_app
bptest = Blueprint('bptest', __name__)
from . import views, tasks
| 23
| 42
| 0.797101
| 19
| 138
| 5.473684
| 0.631579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130435
| 138
| 6
| 43
| 23
| 0.866667
| 0.297101
| 0
| 0
| 0
| 0
| 0.061856
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
b362debb9fa5a8b0ab65b654e6ac42df50871e93
| 197
|
py
|
Python
|
playproject/migrator_settings.py
|
sellonen/django-security-tips
|
b6d52fee5db7ff221cf7fd12e2e3abd862bca8c0
|
[
"CC0-1.0"
] | 66
|
2016-03-16T15:49:39.000Z
|
2022-03-07T16:40:22.000Z
|
playproject/migrator_settings.py
|
sellonen/django-security-tips
|
b6d52fee5db7ff221cf7fd12e2e3abd862bca8c0
|
[
"CC0-1.0"
] | 2
|
2017-12-15T23:02:19.000Z
|
2020-03-30T14:56:09.000Z
|
playproject/migrator_settings.py
|
sellonen/django-security-tips
|
b6d52fee5db7ff221cf7fd12e2e3abd862bca8c0
|
[
"CC0-1.0"
] | 7
|
2016-03-17T07:33:36.000Z
|
2020-07-09T01:17:59.000Z
|
from .settings import *
DATABASES['default']['USER'] = 'djangomigrator'
with open(BASE_DIR + '/_etc_passwords_djangomigrator.txt') as fp:
DATABASES['default']['PASSWORD'] = fp.read().strip()
| 28.142857
| 65
| 0.705584
| 23
| 197
| 5.869565
| 0.826087
| 0.237037
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111675
| 197
| 6
| 66
| 32.833333
| 0.771429
| 0
| 0
| 0
| 0
| 0
| 0.375635
| 0.172589
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0.25
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
2fbb1d608df09af1e79eb18a2c5740454c56f01c
| 274
|
py
|
Python
|
tests/parts/clock.py
|
ycwn/pyhdl
|
6440cc40193b789e281eb10f12580f2b6df17d1a
|
[
"MIT"
] | null | null | null |
tests/parts/clock.py
|
ycwn/pyhdl
|
6440cc40193b789e281eb10f12580f2b6df17d1a
|
[
"MIT"
] | null | null | null |
tests/parts/clock.py
|
ycwn/pyhdl
|
6440cc40193b789e281eb10f12580f2b6df17d1a
|
[
"MIT"
] | null | null | null |
import pyhdl.core as core
import pyhdl.parts.clock as clk
from ..common import *
test_component(clk.clock.create(),
[
[], [], [], [], [], [], [], []
],
[
[ True ],
[ False ],
[ True ],
[ False ],
[ True ],
[ False ],
[ True ],
[ False ]
]
)
| 10.538462
| 34
| 0.463504
| 27
| 274
| 4.666667
| 0.518519
| 0.285714
| 0.309524
| 0.428571
| 0.285714
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0.30292
| 274
| 25
| 35
| 10.96
| 0.659686
| 0
| 0
| 0.388889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.166667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2fbb813247c72ac96b54ffa884030f958a75f82b
| 130
|
py
|
Python
|
src/udsxmlrpc/__init__.py
|
daizhaolin/udsxmlrpc
|
1f16ce8029e0bd68b08ad02119ca5bcec61971dd
|
[
"BSD-3-Clause"
] | 1
|
2020-01-15T08:53:53.000Z
|
2020-01-15T08:53:53.000Z
|
src/udsxmlrpc/__init__.py
|
daizhaolin/udsxmlrpc
|
1f16ce8029e0bd68b08ad02119ca5bcec61971dd
|
[
"BSD-3-Clause"
] | null | null | null |
src/udsxmlrpc/__init__.py
|
daizhaolin/udsxmlrpc
|
1f16ce8029e0bd68b08ad02119ca5bcec61971dd
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: UTF-8 -*-
'''
Created on 2020-01-13
@author: daizhaolin
'''
from .server import Server
from .client import Client
| 13
| 26
| 0.669231
| 18
| 130
| 4.833333
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0.169231
| 130
| 9
| 27
| 14.444444
| 0.722222
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
2fbda503d81cca79faf80b5f81ca18d295fda31d
| 128
|
py
|
Python
|
tinkoff/invest/market_data_stream/typevars.py
|
forked-group/invest-python
|
3398391f5bb4a52020c312855de175cfe8cdc021
|
[
"Apache-2.0"
] | 41
|
2022-01-21T05:38:57.000Z
|
2022-03-30T03:54:41.000Z
|
tinkoff/invest/market_data_stream/typevars.py
|
forked-group/invest-python
|
3398391f5bb4a52020c312855de175cfe8cdc021
|
[
"Apache-2.0"
] | 20
|
2022-01-24T05:46:02.000Z
|
2022-03-31T16:54:04.000Z
|
tinkoff/invest/market_data_stream/typevars.py
|
forked-group/invest-python
|
3398391f5bb4a52020c312855de175cfe8cdc021
|
[
"Apache-2.0"
] | 15
|
2022-01-25T06:53:27.000Z
|
2022-03-30T03:49:07.000Z
|
from typing import TypeVar
TMarketDataStreamManager = TypeVar("TMarketDataStreamManager")
TInstrument = TypeVar("TInstrument")
| 25.6
| 62
| 0.835938
| 10
| 128
| 10.7
| 0.6
| 0.579439
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085938
| 128
| 4
| 63
| 32
| 0.91453
| 0
| 0
| 0
| 0
| 0
| 0.273438
| 0.1875
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
2fc751a07689597eb520fe0eb4337776e6ff00df
| 16
|
py
|
Python
|
python/coursera_python/MICHIGAN/DataStructures/test/range.py
|
SayanGhoshBDA/code-backup
|
8b6135facc0e598e9686b2e8eb2d69dd68198b80
|
[
"MIT"
] | 16
|
2018-11-26T08:39:42.000Z
|
2019-05-08T10:09:52.000Z
|
python/coursera_python/MICHIGAN/DataStructures/test/range.py
|
SayanGhoshBDA/code-backup
|
8b6135facc0e598e9686b2e8eb2d69dd68198b80
|
[
"MIT"
] | 8
|
2020-05-04T06:29:26.000Z
|
2022-02-12T05:33:16.000Z
|
python/coursera_python/MICHIGAN/DataStructures/test/range.py
|
SayanGhoshBDA/code-backup
|
8b6135facc0e598e9686b2e8eb2d69dd68198b80
|
[
"MIT"
] | 5
|
2020-02-11T16:02:21.000Z
|
2021-02-05T07:48:30.000Z
|
print(range(4))
| 8
| 15
| 0.6875
| 3
| 16
| 3.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 0.0625
| 16
| 1
| 16
| 16
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
2fe408f5037fc3a7255b1b32266159ee20a4cdbd
| 113
|
py
|
Python
|
DeepAlignmentNetwork/menpofit/aps/__init__.py
|
chiawei-liu/DeepAlignmentNetwork
|
52621cd2f697abe372b88c9ea0ee08f0d93b43d8
|
[
"MIT"
] | 220
|
2019-09-01T01:52:04.000Z
|
2022-03-28T12:52:07.000Z
|
DeepAlignmentNetwork/menpofit/aps/__init__.py
|
chiawei-liu/DeepAlignmentNetwork
|
52621cd2f697abe372b88c9ea0ee08f0d93b43d8
|
[
"MIT"
] | 80
|
2015-01-05T16:17:39.000Z
|
2020-11-22T13:42:00.000Z
|
DeepAlignmentNetwork/menpofit/aps/__init__.py
|
chiawei-liu/DeepAlignmentNetwork
|
52621cd2f697abe372b88c9ea0ee08f0d93b43d8
|
[
"MIT"
] | 64
|
2015-02-02T15:11:38.000Z
|
2022-02-28T06:19:31.000Z
|
from .base import GenerativeAPS
from .fitter import GaussNewtonAPSFitter
from .algorithm import Inverse, Forward
| 28.25
| 40
| 0.849558
| 13
| 113
| 7.384615
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115044
| 113
| 3
| 41
| 37.666667
| 0.96
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
642a99074d38d44f874c56c53e73970eec03b88e
| 231
|
py
|
Python
|
scripts/item/consume_2433828.py
|
G00dBye/YYMS
|
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
|
[
"MIT"
] | 54
|
2019-04-16T23:24:48.000Z
|
2021-12-18T11:41:50.000Z
|
scripts/item/consume_2433828.py
|
G00dBye/YYMS
|
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
|
[
"MIT"
] | 3
|
2019-05-19T15:19:41.000Z
|
2020-04-27T16:29:16.000Z
|
scripts/item/consume_2433828.py
|
G00dBye/YYMS
|
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
|
[
"MIT"
] | 49
|
2020-11-25T23:29:16.000Z
|
2022-03-26T16:20:24.000Z
|
# Created by MechAviv
# White Heaven Sun Damage Skin | (2433828)
if sm.addDamageSkin(2433828):
sm.chat("'White Heaven Sun Damage Skin' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem()
| 46.2
| 115
| 0.74026
| 34
| 231
| 5.029412
| 0.647059
| 0.233918
| 0.163743
| 0.233918
| 0.280702
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072917
| 0.168831
| 231
| 5
| 116
| 46.2
| 0.817708
| 0.25974
| 0
| 0
| 0
| 0.333333
| 0.591716
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
643d957019a052f5c4aadcbde260636fc78a6929
| 101
|
py
|
Python
|
game/user.py
|
luiszun/scrambled
|
4293a90e50678b38ecc0d69f2299ba487dbe0c27
|
[
"Apache-2.0"
] | null | null | null |
game/user.py
|
luiszun/scrambled
|
4293a90e50678b38ecc0d69f2299ba487dbe0c27
|
[
"Apache-2.0"
] | null | null | null |
game/user.py
|
luiszun/scrambled
|
4293a90e50678b38ecc0d69f2299ba487dbe0c27
|
[
"Apache-2.0"
] | null | null | null |
from match import Match
class User:
def __init__(self, userId):
self.userId = userId
| 20.2
| 32
| 0.653465
| 13
| 101
| 4.769231
| 0.692308
| 0.322581
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277228
| 101
| 5
| 33
| 20.2
| 0.849315
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
ff273b3c41062828dc8b00d45f6bc998a94b3159
| 117
|
py
|
Python
|
sample.py
|
j-tesla/androidframer
|
7d9efe22fbb25b1801603c542794b5016bc11543
|
[
"Apache-2.0"
] | 80
|
2019-08-03T12:26:22.000Z
|
2020-06-13T11:43:55.000Z
|
sample.py
|
j-tesla/androidframer
|
7d9efe22fbb25b1801603c542794b5016bc11543
|
[
"Apache-2.0"
] | 7
|
2019-08-03T09:50:28.000Z
|
2020-07-01T17:10:10.000Z
|
sample.py
|
j-tesla/androidframer
|
7d9efe22fbb25b1801603c542794b5016bc11543
|
[
"Apache-2.0"
] | 7
|
2020-07-06T11:27:08.000Z
|
2021-02-24T11:45:47.000Z
|
from androidframer import Framer
Framer("resources/framer.json","resources/strings.json","resources/images").start()
| 39
| 83
| 0.803419
| 14
| 117
| 6.714286
| 0.642857
| 0.276596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042735
| 117
| 3
| 83
| 39
| 0.839286
| 0
| 0
| 0
| 0
| 0
| 0.5
| 0.364407
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ff4229df98b5ee7702a83095e8df3a16f97d6205
| 55
|
py
|
Python
|
crypto_native/__init__.py
|
dkushche/Crypto
|
75919d6df2084aee1de76c9999ac4e361c4efd48
|
[
"MIT"
] | 3
|
2020-05-07T22:03:48.000Z
|
2021-03-11T16:36:56.000Z
|
crypto_native/__init__.py
|
dkushche/Crypto
|
75919d6df2084aee1de76c9999ac4e361c4efd48
|
[
"MIT"
] | null | null | null |
crypto_native/__init__.py
|
dkushche/Crypto
|
75919d6df2084aee1de76c9999ac4e361c4efd48
|
[
"MIT"
] | null | null | null |
from .openssl_api import *
from .ms_cryptoapi import *
| 18.333333
| 27
| 0.781818
| 8
| 55
| 5.125
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145455
| 55
| 2
| 28
| 27.5
| 0.87234
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ff5f2604767219fd7aefda98b68f39ceb0404a95
| 7,990
|
py
|
Python
|
release/stubs.min/System/Windows/Forms/__init___parts/Screen.py
|
htlcnn/ironpython-stubs
|
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
|
[
"MIT"
] | 182
|
2017-06-27T02:26:15.000Z
|
2022-03-30T18:53:43.000Z
|
release/stubs.min/System/Windows/Forms/__init___parts/Screen.py
|
htlcnn/ironpython-stubs
|
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
|
[
"MIT"
] | 28
|
2017-06-27T13:38:23.000Z
|
2022-03-15T11:19:44.000Z
|
release/stubs.min/System/Windows/Forms/__init___parts/Screen.py
|
htlcnn/ironpython-stubs
|
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
|
[
"MIT"
] | 67
|
2017-06-28T09:43:59.000Z
|
2022-03-20T21:17:10.000Z
|
class Screen(object):
""" Represents a display device or multiple display devices on a single system. """
def Equals(self,obj):
"""
Equals(self: Screen,obj: object) -> bool
Gets or sets a value indicating whether the specified object is equal to this Screen.
obj: The object to compare to this System.Windows.Forms.Screen.
Returns: true if the specified object is equal to this System.Windows.Forms.Screen; otherwise,false.
"""
pass
@staticmethod
def FromControl(control):
"""
FromControl(control: Control) -> Screen
Retrieves a System.Windows.Forms.Screen for the display that contains the largest portion of the
specified control.
control: A System.Windows.Forms.Control for which to retrieve a System.Windows.Forms.Screen.
Returns: A System.Windows.Forms.Screen for the display that contains the largest region of the specified
control. In multiple display environments where no display contains the control,the display
closest to the specified control is returned.
"""
pass
@staticmethod
def FromHandle(hwnd):
"""
FromHandle(hwnd: IntPtr) -> Screen
Retrieves a System.Windows.Forms.Screen for the display that contains the largest portion of the
object referred to by the specified handle.
hwnd: The window handle for which to retrieve the System.Windows.Forms.Screen.
Returns: A System.Windows.Forms.Screen for the display that contains the largest region of the object. In
multiple display environments where no display contains any portion of the specified window,the
display closest to the object is returned.
"""
pass
@staticmethod
def FromPoint(point):
"""
FromPoint(point: Point) -> Screen
Retrieves a System.Windows.Forms.Screen for the display that contains the specified point.
point: A System.Drawing.Point that specifies the location for which to retrieve a
System.Windows.Forms.Screen.
Returns: A System.Windows.Forms.Screen for the display that contains the point. In multiple display
environments where no display contains the point,the display closest to the specified point is
returned.
"""
pass
@staticmethod
def FromRectangle(rect):
"""
FromRectangle(rect: Rectangle) -> Screen
Retrieves a System.Windows.Forms.Screen for the display that contains the largest portion of the
rectangle.
rect: A System.Drawing.Rectangle that specifies the area for which to retrieve the display.
Returns: A System.Windows.Forms.Screen for the display that contains the largest region of the specified
rectangle. In multiple display environments where no display contains the rectangle,the display
closest to the rectangle is returned.
"""
pass
@staticmethod
def GetBounds(*__args):
"""
GetBounds(ctl: Control) -> Rectangle
Retrieves the bounds of the display that contains the largest portion of the specified control.
ctl: The System.Windows.Forms.Control for which to retrieve the display bounds.
Returns: A System.Drawing.Rectangle that specifies the bounds of the display that contains the specified
control. In multiple display environments where no display contains the specified control,the
display closest to the control is returned.
GetBounds(rect: Rectangle) -> Rectangle
Retrieves the bounds of the display that contains the largest portion of the specified rectangle.
rect: A System.Drawing.Rectangle that specifies the area for which to retrieve the display bounds.
Returns: A System.Drawing.Rectangle that specifies the bounds of the display that contains the specified
rectangle. In multiple display environments where no monitor contains the specified rectangle,
the monitor closest to the rectangle is returned.
GetBounds(pt: Point) -> Rectangle
Retrieves the bounds of the display that contains the specified point.
pt: A System.Drawing.Point that specifies the coordinates for which to retrieve the display bounds.
Returns: A System.Drawing.Rectangle that specifies the bounds of the display that contains the specified
point. In multiple display environments where no display contains the specified point,the
display closest to the point is returned.
"""
pass
def GetHashCode(self):
"""
GetHashCode(self: Screen) -> int
Computes and retrieves a hash code for an object.
Returns: A hash code for an object.
"""
pass
@staticmethod
def GetWorkingArea(*__args):
"""
GetWorkingArea(ctl: Control) -> Rectangle
Retrieves the working area for the display that contains the largest region of the specified
control. The working area is the desktop area of the display,excluding taskbars,docked
windows,and docked tool bars.
ctl: The System.Windows.Forms.Control for which to retrieve the working area.
Returns: A System.Drawing.Rectangle that specifies the working area. In multiple display environments
where no display contains the specified control,the display closest to the control is returned.
GetWorkingArea(rect: Rectangle) -> Rectangle
Retrieves the working area for the display that contains the largest portion of the specified
rectangle. The working area is the desktop area of the display,excluding taskbars,docked
windows,and docked tool bars.
rect: The System.Drawing.Rectangle that specifies the area for which to retrieve the working area.
Returns: A System.Drawing.Rectangle that specifies the working area. In multiple display environments
where no display contains the specified rectangle,the display closest to the rectangle is
returned.
GetWorkingArea(pt: Point) -> Rectangle
Retrieves the working area closest to the specified point. The working area is the desktop area
of the display,excluding taskbars,docked windows,and docked tool bars.
pt: A System.Drawing.Point that specifies the coordinates for which to retrieve the working area.
Returns: A System.Drawing.Rectangle that specifies the working area. In multiple display environments
where no display contains the specified point,the display closest to the point is returned.
"""
pass
def ToString(self):
"""
ToString(self: Screen) -> str
Retrieves a string representing this object.
Returns: A string representation of the object.
"""
pass
def __eq__(self,*args):
""" x.__eq__(y) <==> x==y """
pass
def __ne__(self,*args):
pass
BitsPerPixel=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the number of bits of memory,associated with one pixel of data.
Get: BitsPerPixel(self: Screen) -> int
"""
Bounds=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the bounds of the display.
Get: Bounds(self: Screen) -> Rectangle
"""
DeviceName=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the device name associated with a display.
Get: DeviceName(self: Screen) -> str
"""
Primary=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether a particular display is the primary device.
Get: Primary(self: Screen) -> bool
"""
WorkingArea=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the working area of the display. The working area is the desktop area of the display,excluding taskbars,docked windows,and docked tool bars.
Get: WorkingArea(self: Screen) -> Rectangle
"""
AllScreens=None
PrimaryScreen=None
| 24.660494
| 150
| 0.705757
| 1,049
| 7,990
| 5.360343
| 0.120114
| 0.062244
| 0.051218
| 0.0626
| 0.779477
| 0.720967
| 0.685577
| 0.665837
| 0.652321
| 0.61533
| 0
| 0
| 0.233417
| 7,990
| 323
| 151
| 24.736842
| 0.918041
| 0.722153
| 0
| 0.472222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.305556
| false
| 0.305556
| 0
| 0
| 0.527778
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
ff651f22bfd2a2fd73774e38cfb2fad6847e9eaa
| 15,329
|
py
|
Python
|
spoonacular/com.spoonacular.client.model/__init__.py
|
Lowe-Man/spoonacular-python-api
|
c5522abdc2ef48258434e22b4f2038d64bcebd86
|
[
"MIT"
] | 21
|
2019-08-09T18:53:26.000Z
|
2022-03-14T22:10:10.000Z
|
spoonacular/com.spoonacular.client.model/__init__.py
|
Lowe-Man/spoonacular-python-api
|
c5522abdc2ef48258434e22b4f2038d64bcebd86
|
[
"MIT"
] | null | null | null |
spoonacular/com.spoonacular.client.model/__init__.py
|
Lowe-Man/spoonacular-python-api
|
c5522abdc2ef48258434e22b4f2038d64bcebd86
|
[
"MIT"
] | 55
|
2019-08-13T17:52:47.000Z
|
2022-03-27T04:29:34.000Z
|
# coding: utf-8
# flake8: noqa
"""
spoonacular API
The spoonacular Nutrition, Recipe, and Food API allows you to access over 380,000 recipes, thousands of ingredients, 800,000 food products, and 100,000 menu items. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural language queries, such as \"gluten free brownies without sugar\" or \"low fat vegan cupcakes.\" You can automatically calculate the nutritional information for any recipe, analyze recipe costs, visualize ingredient lists, find recipes for what's in your fridge, find recipes based on special diets, nutritional requirements, or favorite ingredients, classify recipes into types and cuisines, convert ingredient amounts, or even compute an entire meal plan. With our powerful API, you can create many kinds of food and especially nutrition apps. Special diets/dietary requirements currently available include: vegan, vegetarian, pescetarian, gluten free, grain free, dairy free, high protein, whole 30, low sodium, low carb, Paleo, ketogenic, FODMAP, and Primal. # noqa: E501
The version of the OpenAPI document: 1.0
Contact: mail@spoonacular.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
# import models into model package
from spoonacular.com.spoonacular.client.model.food_ingredients_map_products import FoodIngredientsMapProducts
from spoonacular.com.spoonacular.client.model.inline_object import InlineObject
from spoonacular.com.spoonacular.client.model.inline_object1 import InlineObject1
from spoonacular.com.spoonacular.client.model.inline_object10 import InlineObject10
from spoonacular.com.spoonacular.client.model.inline_object2 import InlineObject2
from spoonacular.com.spoonacular.client.model.inline_object3 import InlineObject3
from spoonacular.com.spoonacular.client.model.inline_object4 import InlineObject4
from spoonacular.com.spoonacular.client.model.inline_object5 import InlineObject5
from spoonacular.com.spoonacular.client.model.inline_object6 import InlineObject6
from spoonacular.com.spoonacular.client.model.inline_object7 import InlineObject7
from spoonacular.com.spoonacular.client.model.inline_object8 import InlineObject8
from spoonacular.com.spoonacular.client.model.inline_object9 import InlineObject9
from spoonacular.com.spoonacular.client.model.inline_response200 import InlineResponse200
from spoonacular.com.spoonacular.client.model.inline_response2001 import InlineResponse2001
from spoonacular.com.spoonacular.client.model.inline_response20010 import InlineResponse20010
from spoonacular.com.spoonacular.client.model.inline_response20010_amount import InlineResponse20010Amount
from spoonacular.com.spoonacular.client.model.inline_response20010_amount_metric import InlineResponse20010AmountMetric
from spoonacular.com.spoonacular.client.model.inline_response20010_ingredients import InlineResponse20010Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20011 import InlineResponse20011
from spoonacular.com.spoonacular.client.model.inline_response20011_ingredients import InlineResponse20011Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20012 import InlineResponse20012
from spoonacular.com.spoonacular.client.model.inline_response20013 import InlineResponse20013
from spoonacular.com.spoonacular.client.model.inline_response20013_ingredients import InlineResponse20013Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20013_ingredients1 import InlineResponse20013Ingredients1
from spoonacular.com.spoonacular.client.model.inline_response20013_parsed_instructions import InlineResponse20013ParsedInstructions
from spoonacular.com.spoonacular.client.model.inline_response20013_steps import InlineResponse20013Steps
from spoonacular.com.spoonacular.client.model.inline_response20014 import InlineResponse20014
from spoonacular.com.spoonacular.client.model.inline_response20015 import InlineResponse20015
from spoonacular.com.spoonacular.client.model.inline_response20016 import InlineResponse20016
from spoonacular.com.spoonacular.client.model.inline_response20017 import InlineResponse20017
from spoonacular.com.spoonacular.client.model.inline_response20018 import InlineResponse20018
from spoonacular.com.spoonacular.client.model.inline_response20018_dishes import InlineResponse20018Dishes
from spoonacular.com.spoonacular.client.model.inline_response20018_ingredients import InlineResponse20018Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20019 import InlineResponse20019
from spoonacular.com.spoonacular.client.model.inline_response2002 import InlineResponse2002
from spoonacular.com.spoonacular.client.model.inline_response20020 import InlineResponse20020
from spoonacular.com.spoonacular.client.model.inline_response20021 import InlineResponse20021
from spoonacular.com.spoonacular.client.model.inline_response20021_calories import InlineResponse20021Calories
from spoonacular.com.spoonacular.client.model.inline_response20021_calories_confidence_range95_percent import InlineResponse20021CaloriesConfidenceRange95Percent
from spoonacular.com.spoonacular.client.model.inline_response20022 import InlineResponse20022
from spoonacular.com.spoonacular.client.model.inline_response20022_nutrition import InlineResponse20022Nutrition
from spoonacular.com.spoonacular.client.model.inline_response20023 import InlineResponse20023
from spoonacular.com.spoonacular.client.model.inline_response20023_ingredients import InlineResponse20023Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20024 import InlineResponse20024
from spoonacular.com.spoonacular.client.model.inline_response20025 import InlineResponse20025
from spoonacular.com.spoonacular.client.model.inline_response20025_results import InlineResponse20025Results
from spoonacular.com.spoonacular.client.model.inline_response20026 import InlineResponse20026
from spoonacular.com.spoonacular.client.model.inline_response20027 import InlineResponse20027
from spoonacular.com.spoonacular.client.model.inline_response20028 import InlineResponse20028
from spoonacular.com.spoonacular.client.model.inline_response20028_ingredients import InlineResponse20028Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20028_nutrition import InlineResponse20028Nutrition
from spoonacular.com.spoonacular.client.model.inline_response20028_servings import InlineResponse20028Servings
from spoonacular.com.spoonacular.client.model.inline_response20029 import InlineResponse20029
from spoonacular.com.spoonacular.client.model.inline_response20029_custom_foods import InlineResponse20029CustomFoods
from spoonacular.com.spoonacular.client.model.inline_response2003 import InlineResponse2003
from spoonacular.com.spoonacular.client.model.inline_response20030 import InlineResponse20030
from spoonacular.com.spoonacular.client.model.inline_response20030_ingredients import InlineResponse20030Ingredients
from spoonacular.com.spoonacular.client.model.inline_response20031 import InlineResponse20031
from spoonacular.com.spoonacular.client.model.inline_response20031_comparable_products import InlineResponse20031ComparableProducts
from spoonacular.com.spoonacular.client.model.inline_response20031_comparable_products_protein import InlineResponse20031ComparableProductsProtein
from spoonacular.com.spoonacular.client.model.inline_response20032 import InlineResponse20032
from spoonacular.com.spoonacular.client.model.inline_response20032_results import InlineResponse20032Results
from spoonacular.com.spoonacular.client.model.inline_response20033 import InlineResponse20033
from spoonacular.com.spoonacular.client.model.inline_response20034 import InlineResponse20034
from spoonacular.com.spoonacular.client.model.inline_response20035 import InlineResponse20035
from spoonacular.com.spoonacular.client.model.inline_response20035_menu_items import InlineResponse20035MenuItems
from spoonacular.com.spoonacular.client.model.inline_response20036 import InlineResponse20036
from spoonacular.com.spoonacular.client.model.inline_response20037 import InlineResponse20037
from spoonacular.com.spoonacular.client.model.inline_response20037_nutrients import InlineResponse20037Nutrients
from spoonacular.com.spoonacular.client.model.inline_response20038 import InlineResponse20038
from spoonacular.com.spoonacular.client.model.inline_response20038_days import InlineResponse20038Days
from spoonacular.com.spoonacular.client.model.inline_response20038_items import InlineResponse20038Items
from spoonacular.com.spoonacular.client.model.inline_response20038_nutrition_summary import InlineResponse20038NutritionSummary
from spoonacular.com.spoonacular.client.model.inline_response20038_nutrition_summary_nutrients import InlineResponse20038NutritionSummaryNutrients
from spoonacular.com.spoonacular.client.model.inline_response20038_value import InlineResponse20038Value
from spoonacular.com.spoonacular.client.model.inline_response20039 import InlineResponse20039
from spoonacular.com.spoonacular.client.model.inline_response2003_extended_ingredients import InlineResponse2003ExtendedIngredients
from spoonacular.com.spoonacular.client.model.inline_response2003_measures import InlineResponse2003Measures
from spoonacular.com.spoonacular.client.model.inline_response2003_measures_metric import InlineResponse2003MeasuresMetric
from spoonacular.com.spoonacular.client.model.inline_response2003_wine_pairing import InlineResponse2003WinePairing
from spoonacular.com.spoonacular.client.model.inline_response2003_wine_pairing_product_matches import InlineResponse2003WinePairingProductMatches
from spoonacular.com.spoonacular.client.model.inline_response2004 import InlineResponse2004
from spoonacular.com.spoonacular.client.model.inline_response20040 import InlineResponse20040
from spoonacular.com.spoonacular.client.model.inline_response20040_items import InlineResponse20040Items
from spoonacular.com.spoonacular.client.model.inline_response20040_value import InlineResponse20040Value
from spoonacular.com.spoonacular.client.model.inline_response20041 import InlineResponse20041
from spoonacular.com.spoonacular.client.model.inline_response20041_days import InlineResponse20041Days
from spoonacular.com.spoonacular.client.model.inline_response20041_items import InlineResponse20041Items
from spoonacular.com.spoonacular.client.model.inline_response20041_value import InlineResponse20041Value
from spoonacular.com.spoonacular.client.model.inline_response20042 import InlineResponse20042
from spoonacular.com.spoonacular.client.model.inline_response20042_aisles import InlineResponse20042Aisles
from spoonacular.com.spoonacular.client.model.inline_response20042_items import InlineResponse20042Items
from spoonacular.com.spoonacular.client.model.inline_response20042_measures import InlineResponse20042Measures
from spoonacular.com.spoonacular.client.model.inline_response20043 import InlineResponse20043
from spoonacular.com.spoonacular.client.model.inline_response20044 import InlineResponse20044
from spoonacular.com.spoonacular.client.model.inline_response20045 import InlineResponse20045
from spoonacular.com.spoonacular.client.model.inline_response20045_product_matches import InlineResponse20045ProductMatches
from spoonacular.com.spoonacular.client.model.inline_response20046 import InlineResponse20046
from spoonacular.com.spoonacular.client.model.inline_response20047 import InlineResponse20047
from spoonacular.com.spoonacular.client.model.inline_response20047_recommended_wines import InlineResponse20047RecommendedWines
from spoonacular.com.spoonacular.client.model.inline_response20048 import InlineResponse20048
from spoonacular.com.spoonacular.client.model.inline_response20049 import InlineResponse20049
from spoonacular.com.spoonacular.client.model.inline_response20049_category import InlineResponse20049Category
from spoonacular.com.spoonacular.client.model.inline_response20049_nutrition import InlineResponse20049Nutrition
from spoonacular.com.spoonacular.client.model.inline_response20049_nutrition_calories import InlineResponse20049NutritionCalories
from spoonacular.com.spoonacular.client.model.inline_response20049_nutrition_calories_confidence_range95_percent import InlineResponse20049NutritionCaloriesConfidenceRange95Percent
from spoonacular.com.spoonacular.client.model.inline_response20049_recipes import InlineResponse20049Recipes
from spoonacular.com.spoonacular.client.model.inline_response2005 import InlineResponse2005
from spoonacular.com.spoonacular.client.model.inline_response20050 import InlineResponse20050
from spoonacular.com.spoonacular.client.model.inline_response20051 import InlineResponse20051
from spoonacular.com.spoonacular.client.model.inline_response20052 import InlineResponse20052
from spoonacular.com.spoonacular.client.model.inline_response20053 import InlineResponse20053
from spoonacular.com.spoonacular.client.model.inline_response20053_results import InlineResponse20053Results
from spoonacular.com.spoonacular.client.model.inline_response20053_search_results import InlineResponse20053SearchResults
from spoonacular.com.spoonacular.client.model.inline_response20054 import InlineResponse20054
from spoonacular.com.spoonacular.client.model.inline_response20054_videos import InlineResponse20054Videos
from spoonacular.com.spoonacular.client.model.inline_response20055 import InlineResponse20055
from spoonacular.com.spoonacular.client.model.inline_response20056 import InlineResponse20056
from spoonacular.com.spoonacular.client.model.inline_response20057 import InlineResponse20057
from spoonacular.com.spoonacular.client.model.inline_response20057_suggests import InlineResponse20057Suggests
from spoonacular.com.spoonacular.client.model.inline_response2006 import InlineResponse2006
from spoonacular.com.spoonacular.client.model.inline_response2006_recipes import InlineResponse2006Recipes
from spoonacular.com.spoonacular.client.model.inline_response2007 import InlineResponse2007
from spoonacular.com.spoonacular.client.model.inline_response2008 import InlineResponse2008
from spoonacular.com.spoonacular.client.model.inline_response2009 import InlineResponse2009
from spoonacular.com.spoonacular.client.model.inline_response200_results import InlineResponse200Results
from spoonacular.com.spoonacular.client.model.recipes_find_by_ingredients_missed_ingredients import RecipesFindByIngredientsMissedIngredients
from spoonacular.com.spoonacular.client.model.recipes_parse_ingredients_estimated_cost import RecipesParseIngredientsEstimatedCost
from spoonacular.com.spoonacular.client.model.recipes_parse_ingredients_nutrition import RecipesParseIngredientsNutrition
from spoonacular.com.spoonacular.client.model.recipes_parse_ingredients_nutrition_caloric_breakdown import RecipesParseIngredientsNutritionCaloricBreakdown
from spoonacular.com.spoonacular.client.model.recipes_parse_ingredients_nutrition_nutrients import RecipesParseIngredientsNutritionNutrients
from spoonacular.com.spoonacular.client.model.recipes_parse_ingredients_nutrition_properties import RecipesParseIngredientsNutritionProperties
from spoonacular.com.spoonacular.client.model.recipes_parse_ingredients_nutrition_weight_per_serving import RecipesParseIngredientsNutritionWeightPerServing
| 101.516556
| 1,050
| 0.903386
| 1,629
| 15,329
| 8.349294
| 0.233886
| 0.137931
| 0.176016
| 0.283582
| 0.557091
| 0.55268
| 0.549739
| 0.407617
| 0.108889
| 0.070142
| 0
| 0.079597
| 0.04847
| 15,329
| 150
| 1,051
| 102.193333
| 0.852873
| 0.080697
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ff73f9177c9f2dd2b1e19e713669fdd3ecf27baf
| 316
|
py
|
Python
|
Aulas/Mundo 1/030.py
|
JoaoEmanuell/Meus-Estudos-Python
|
f6f6eeb6016919e594613785ffe7136d74241ada
|
[
"MIT"
] | 2
|
2021-07-29T18:58:02.000Z
|
2021-10-29T21:11:22.000Z
|
Aulas/Mundo 1/030.py
|
JoaoEmanuell/Meus-Estudos-Python
|
f6f6eeb6016919e594613785ffe7136d74241ada
|
[
"MIT"
] | null | null | null |
Aulas/Mundo 1/030.py
|
JoaoEmanuell/Meus-Estudos-Python
|
f6f6eeb6016919e594613785ffe7136d74241ada
|
[
"MIT"
] | null | null | null |
num = int(input('\033[1;31mMe diga um número \033[m'))
resultado = num % 2
par = (0)
impar = (1)
if resultado == impar:
print('\033[1;32mO número\033[m \033[1;31m{}\033[m \033[1;34mé impar\033[m'.format(num))
else:
print('\033[1;33mO número\033[m \033[1;31m{}\033[m \033[1;34mé par\033[m'.format(num))
| 39.5
| 93
| 0.623418
| 62
| 316
| 3.177419
| 0.370968
| 0.142132
| 0.142132
| 0.162437
| 0.294416
| 0.294416
| 0.294416
| 0.294416
| 0.294416
| 0.294416
| 0
| 0.245353
| 0.148734
| 316
| 8
| 94
| 39.5
| 0.486989
| 0
| 0
| 0
| 0
| 0.25
| 0.535484
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ff846ba2c62e7e2834b9c4c6ce9421ed288620f9
| 4,585
|
py
|
Python
|
resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtGui/QFormLayout.py
|
basepipe/developer_onboarding
|
05b6a776f8974c89517868131b201f11c6c2a5ad
|
[
"MIT"
] | 1
|
2020-04-20T02:27:20.000Z
|
2020-04-20T02:27:20.000Z
|
resources/dot_PyCharm/system/python_stubs/cache/8cdc475d469a13122bc4bc6c3ac1c215d93d5f120f5cc1ef33a8f3088ee54d8e/PySide/QtGui/QFormLayout.py
|
basepipe/developer_onboarding
|
05b6a776f8974c89517868131b201f11c6c2a5ad
|
[
"MIT"
] | null | null | null |
resources/dot_PyCharm/system/python_stubs/cache/8cdc475d469a13122bc4bc6c3ac1c215d93d5f120f5cc1ef33a8f3088ee54d8e/PySide/QtGui/QFormLayout.py
|
basepipe/developer_onboarding
|
05b6a776f8974c89517868131b201f11c6c2a5ad
|
[
"MIT"
] | null | null | null |
# encoding: utf-8
# module PySide.QtGui
# from C:\Python27\lib\site-packages\PySide\QtGui.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
from QLayout import QLayout
class QFormLayout(QLayout):
# no doc
def addItem(self, *args, **kwargs): # real signature unknown
pass
def addRow(self, *args, **kwargs): # real signature unknown
pass
def count(self, *args, **kwargs): # real signature unknown
pass
def expandingDirections(self, *args, **kwargs): # real signature unknown
pass
def fieldGrowthPolicy(self, *args, **kwargs): # real signature unknown
pass
def formAlignment(self, *args, **kwargs): # real signature unknown
pass
def getItemPosition(self, *args, **kwargs): # real signature unknown
pass
def getLayoutPosition(self, *args, **kwargs): # real signature unknown
pass
def getWidgetPosition(self, *args, **kwargs): # real signature unknown
pass
def hasHeightForWidth(self, *args, **kwargs): # real signature unknown
pass
def heightForWidth(self, *args, **kwargs): # real signature unknown
pass
def horizontalSpacing(self, *args, **kwargs): # real signature unknown
pass
def insertRow(self, *args, **kwargs): # real signature unknown
pass
def invalidate(self, *args, **kwargs): # real signature unknown
pass
def itemAt(self, *args, **kwargs): # real signature unknown
pass
def labelAlignment(self, *args, **kwargs): # real signature unknown
pass
def labelForField(self, *args, **kwargs): # real signature unknown
pass
def minimumSize(self, *args, **kwargs): # real signature unknown
pass
def rowCount(self, *args, **kwargs): # real signature unknown
pass
def rowWrapPolicy(self, *args, **kwargs): # real signature unknown
pass
def setFieldGrowthPolicy(self, *args, **kwargs): # real signature unknown
pass
def setFormAlignment(self, *args, **kwargs): # real signature unknown
pass
def setGeometry(self, *args, **kwargs): # real signature unknown
pass
def setHorizontalSpacing(self, *args, **kwargs): # real signature unknown
pass
def setItem(self, *args, **kwargs): # real signature unknown
pass
def setLabelAlignment(self, *args, **kwargs): # real signature unknown
pass
def setLayout(self, *args, **kwargs): # real signature unknown
pass
def setRowWrapPolicy(self, *args, **kwargs): # real signature unknown
pass
def setSpacing(self, *args, **kwargs): # real signature unknown
pass
def setVerticalSpacing(self, *args, **kwargs): # real signature unknown
pass
def setWidget(self, *args, **kwargs): # real signature unknown
pass
def sizeHint(self, *args, **kwargs): # real signature unknown
pass
def spacing(self, *args, **kwargs): # real signature unknown
pass
def takeAt(self, *args, **kwargs): # real signature unknown
pass
def verticalSpacing(self, *args, **kwargs): # real signature unknown
pass
def __init__(self, *args, **kwargs): # real signature unknown
pass
@staticmethod # known case of __new__
def __new__(S, *more): # real signature unknown; restored from __doc__
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
AllNonFixedFieldsGrow = PySide.QtGui.QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow
DontWrapRows = PySide.QtGui.QFormLayout.RowWrapPolicy.DontWrapRows
ExpandingFieldsGrow = PySide.QtGui.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow
FieldGrowthPolicy = None # (!) real value is "<type 'PySide.QtGui.QFormLayout.FieldGrowthPolicy'>"
FieldRole = PySide.QtGui.QFormLayout.ItemRole.FieldRole
FieldsStayAtSizeHint = PySide.QtGui.QFormLayout.FieldGrowthPolicy.FieldsStayAtSizeHint
ItemRole = None # (!) real value is "<type 'PySide.QtGui.QFormLayout.ItemRole'>"
LabelRole = PySide.QtGui.QFormLayout.ItemRole.LabelRole
RowWrapPolicy = None # (!) real value is "<type 'PySide.QtGui.QFormLayout.RowWrapPolicy'>"
SpanningRole = PySide.QtGui.QFormLayout.ItemRole.SpanningRole
staticMetaObject = None # (!) real value is '<PySide.QtCore.QMetaObject object at 0x0000000003F48208>'
WrapAllRows = PySide.QtGui.QFormLayout.RowWrapPolicy.WrapAllRows
WrapLongRows = PySide.QtGui.QFormLayout.RowWrapPolicy.WrapLongRows
| 31.840278
| 106
| 0.676118
| 489
| 4,585
| 6.288344
| 0.208589
| 0.156423
| 0.24065
| 0.210732
| 0.537236
| 0.519024
| 0.519024
| 0.506667
| 0
| 0
| 0
| 0.006443
| 0.221374
| 4,585
| 143
| 107
| 32.062937
| 0.854902
| 0.298364
| 0
| 0.402174
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.402174
| false
| 0.402174
| 0.032609
| 0
| 0.586957
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
4410e87e6117bc5dfe33cf6364f7ca605cbea611
| 4,412
|
py
|
Python
|
function/python/brightics/function/classification/test/classification_test.py
|
GSByeon/studio
|
782cf484541c6d68e1451ff6a0d3b5dc80172664
|
[
"Apache-2.0"
] | null | null | null |
function/python/brightics/function/classification/test/classification_test.py
|
GSByeon/studio
|
782cf484541c6d68e1451ff6a0d3b5dc80172664
|
[
"Apache-2.0"
] | null | null | null |
function/python/brightics/function/classification/test/classification_test.py
|
GSByeon/studio
|
782cf484541c6d68e1451ff6a0d3b5dc80172664
|
[
"Apache-2.0"
] | 1
|
2020-11-19T06:44:15.000Z
|
2020-11-19T06:44:15.000Z
|
import unittest
from brightics.function.classification import svm_classification_train, svm_classification_predict
from brightics.function.transform import split_data
from brightics.common.datasets import load_iris
import pandas as pd
import random
from brightics.function.classification.decision_tree_classification import decision_tree_classification_train, \
decision_tree_classification_predict
from brightics.function.classification.logistic_regression import logistic_regression_train, \
logistic_regression_predict
from brightics.function.classification.xgb_classification import xgb_classification_train, \
xgb_classification_predict
class SVMTest(unittest.TestCase):
def test1(self):
iris = load_iris()
df_splitted = split_data(table=iris, train_ratio=0.7, test_ratio=0.3)
train_df = df_splitted['train_table']
test_df = df_splitted['test_table']
train_out = svm_classification_train(table=train_df, feature_cols=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'], label_col='species')
# print(train_out['model']['svc_model'])
predict_out = svm_classification_predict(table=test_df, model=train_out['model'])
print(predict_out['out_table'][['species', 'prediction']])
def test_predict_thresholds(self):
iris = load_iris()
df_splitted = split_data(table=iris, train_ratio=0.7, test_ratio=0.3)
train_df = df_splitted['train_table']
test_df = df_splitted['test_table']
train_out = svm_classification_train(table=train_df, feature_cols=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'], label_col='species')
# print(train_out['model']['svc_model'])
predict_out = svm_classification_predict(table=test_df, model=train_out['model'], thresholds=[0.1, 0.2, 0.3])
print(predict_out['out_table'][['species', 'prediction']])
def test_groupby1(self):
df = load_iris()
random_group = []
for i in range(len(df)):
random_group.append(random.randint(1, 2))
df['random_group'] = random_group
train_out = svm_classification_train(table=df, feature_cols=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'], label_col='species', group_by=['random_group'])
predict_out = svm_classification_predict(table=df, model=train_out['model'])
print(predict_out['out_table'][['species', 'prediction']])
class DecisionTreeClassificationTest(unittest.TestCase):
def test_groupby1(self):
df = load_iris()
random_group = []
for i in range(len(df)):
random_group.append(random.randint(1, 2))
df['random_group'] = random_group
train_out = decision_tree_classification_train(table=df, feature_cols=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'], label_col='species', group_by=['random_group'])
predict_out = decision_tree_classification_predict(table=df, model=train_out['model'])
print(predict_out['out_table'][['species', 'prediction']])
class LogisticRegressionTest(unittest.TestCase):
def test_groupby1(self):
df = load_iris()
random_group = []
for i in range(len(df)):
random_group.append(random.randint(1, 2))
df['random_group'] = random_group
train_out = logistic_regression_train(table=df, feature_cols=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'], label_col='species', group_by=['random_group'])
predict_out = logistic_regression_predict(table=df, model=train_out['model'])
print(predict_out['out_table'][['species', 'prediction']])
class XGBClassificationTest(unittest.TestCase):
def test_groupby1(self):
df = load_iris()
random_group = []
for i in range(len(df)):
random_group.append(random.randint(1, 2))
df['random_group'] = random_group
train_out = xgb_classification_train(table=df, feature_cols=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'], label_col='species', group_by=['random_group'])
predict_out = xgb_classification_predict(table=df, model=train_out['model'])
print(predict_out['out_table'][['species', 'prediction']])
| 46.442105
| 189
| 0.684723
| 534
| 4,412
| 5.320225
| 0.129213
| 0.077438
| 0.036607
| 0.038015
| 0.780007
| 0.730729
| 0.728617
| 0.728617
| 0.728617
| 0.712073
| 0
| 0.007589
| 0.193563
| 4,412
| 94
| 190
| 46.93617
| 0.790894
| 0.017452
| 0
| 0.588235
| 0
| 0
| 0.148199
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.088235
| false
| 0
| 0.132353
| 0
| 0.279412
| 0.088235
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
441df44b23a1317552d5a8d14ec3a46c96c346fa
| 200
|
py
|
Python
|
py_reportit/shared/repository/crawl.py
|
fedus/py_reportit
|
46422cabb652571d8cce6c8e91a229009dcca141
|
[
"MIT"
] | 1
|
2021-12-05T19:16:16.000Z
|
2021-12-05T19:16:16.000Z
|
py_reportit/shared/repository/crawl.py
|
fedus/py_reportit
|
46422cabb652571d8cce6c8e91a229009dcca141
|
[
"MIT"
] | null | null | null |
py_reportit/shared/repository/crawl.py
|
fedus/py_reportit
|
46422cabb652571d8cce6c8e91a229009dcca141
|
[
"MIT"
] | null | null | null |
from py_reportit.shared.repository.abstract_repository import AbstractRepository
from py_reportit.shared.model.crawl import Crawl
class CrawlRepository(AbstractRepository[Crawl]):
model = Crawl
| 28.571429
| 80
| 0.845
| 23
| 200
| 7.217391
| 0.521739
| 0.072289
| 0.168675
| 0.240964
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095
| 200
| 6
| 81
| 33.333333
| 0.917127
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
444ab8aade30730cc88a7df30405f132f9e800cb
| 679
|
py
|
Python
|
twitch_uninstall_services.py
|
europaYuu/RaspiTwitchONAIR
|
8fa7a5f457a297e9b06fb946e89c33a0d49e335f
|
[
"MIT"
] | null | null | null |
twitch_uninstall_services.py
|
europaYuu/RaspiTwitchONAIR
|
8fa7a5f457a297e9b06fb946e89c33a0d49e335f
|
[
"MIT"
] | null | null | null |
twitch_uninstall_services.py
|
europaYuu/RaspiTwitchONAIR
|
8fa7a5f457a297e9b06fb946e89c33a0d49e335f
|
[
"MIT"
] | null | null | null |
import os
os.system('sudo systemctl disable twitch_onair_webserver_service')
os.system('sudo systemctl disable twitch_onair_neopixel_service')
os.system('sudo systemctl disable powerButton')
os.system('sudo systemctl disable functionButton')
os.system('sudo systemctl disable oled_service')
os.system('sudo rm /lib/systemd/system/twitch_onair_webserver_service.service')
os.system('sudo rm /lib/systemd/system/twitch_onair_neopixel_service.service')
os.system('sudo rm /lib/systemd/system/powerButton.service')
os.system('sudo rm /lib/systemd/system/functionButton.service')
os.system('sudo rm /lib/systemd/system/oled_service.service')
os.system('sudo systemctl daemon-reload')
| 52.230769
| 79
| 0.821797
| 97
| 679
| 5.608247
| 0.195876
| 0.161765
| 0.242647
| 0.279412
| 0.794118
| 0.626838
| 0.549632
| 0.40625
| 0.270221
| 0.176471
| 0
| 0
| 0.05891
| 679
| 13
| 80
| 52.230769
| 0.85133
| 0
| 0
| 0
| 0
| 0
| 0.757353
| 0.433824
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.083333
| 0
| 0.083333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
444c276fed8a2f52c4bfc671803cb99f075b3a78
| 171
|
py
|
Python
|
butter_cms/feed.py
|
ButterCMS/buttercms-python
|
46892eff36f20829b130684a85994e7178eb4ef2
|
[
"MIT"
] | 33
|
2017-03-28T03:11:23.000Z
|
2020-12-21T16:13:59.000Z
|
butter_cms/feed.py
|
skroys/buttercms-python
|
6797e2a5f1ded6112e7d2b2f60561798ca4e2731
|
[
"MIT"
] | 4
|
2017-09-16T05:08:20.000Z
|
2022-03-11T15:19:53.000Z
|
butter_cms/feed.py
|
skroys/buttercms-python
|
6797e2a5f1ded6112e7d2b2f60561798ca4e2731
|
[
"MIT"
] | 9
|
2017-11-03T12:51:48.000Z
|
2021-11-09T08:40:13.000Z
|
from .client import Client
class Feed(Client):
"""Feed"""
def __init__(self, auth_token):
Client.__init__(self, auth_token)
self.path = 'feeds/'
| 19
| 41
| 0.625731
| 21
| 171
| 4.619048
| 0.571429
| 0.164948
| 0.247423
| 0.350515
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.239766
| 171
| 8
| 42
| 21.375
| 0.746154
| 0.023392
| 0
| 0
| 0
| 0
| 0.037267
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
445a4e53843ac50d8ed751c8e4f20b3ed3bc6e5d
| 4,731
|
py
|
Python
|
python/fcdd/models/fcdd_vark.py
|
kyungmin96/myfcdd
|
eb3062105e0b345f0abc4aebcbc48247bc9fcda0
|
[
"MIT"
] | 152
|
2020-07-08T05:44:40.000Z
|
2022-03-29T07:10:22.000Z
|
python/fcdd/models/fcdd_vark.py
|
kyungmin96/myfcdd
|
eb3062105e0b345f0abc4aebcbc48247bc9fcda0
|
[
"MIT"
] | 21
|
2020-07-07T12:00:02.000Z
|
2022-03-23T03:50:23.000Z
|
python/fcdd/models/fcdd_vark.py
|
kyungmin96/myfcdd
|
eb3062105e0b345f0abc4aebcbc48247bc9fcda0
|
[
"MIT"
] | 39
|
2020-09-14T05:45:08.000Z
|
2022-03-25T09:53:30.000Z
|
import torch.nn as nn
import torch.nn.functional as F
from fcdd.models.bases import FCDDNet
class FCDD_CNN224_VARK(FCDDNet):
def __init__(self, in_shape, k=3, **kwargs):
assert k % 2 == 1, 'kernel size needs to be uneven'
p = (k - 1) // 2
super().__init__(in_shape, **kwargs)
self.conv1 = self._create_conv2d(in_shape[0], 32, k, bias=self.bias, padding=p)
self.bn2d1 = nn.BatchNorm2d(32, eps=1e-04, affine=self.bias)
self.pool1 = self._create_maxpool2d(3, 2, 1) # 32 x 112 x 112
self.conv2 = self._create_conv2d(32, 128, k, bias=self.bias, padding=p)
self.bn2d2 = nn.BatchNorm2d(128, eps=1e-04, affine=self.bias)
self.pool2 = self._create_maxpool2d(3, 2, 1) # 128 x 56 x 56
self.conv3 = self._create_conv2d(128, 256, k, bias=self.bias, padding=p)
self.bn2d3 = nn.BatchNorm2d(256, eps=1e-04, affine=self.bias)
self.conv4 = self._create_conv2d(256, 256, k, bias=self.bias, padding=p)
self.bn2d4 = nn.BatchNorm2d(256, eps=1e-04, affine=self.bias)
self.pool3 = self._create_maxpool2d(3, 2, 1) # 256 x 28 x 28
self.conv5 = self._create_conv2d(256, 128, k, bias=self.bias, padding=p)
self.encoder_out_shape = (128, 28, 28)
self.conv_final = self._create_conv2d(128, 1, 1, bias=self.bias)
def forward(self, x, ad=True):
x = self.conv1(x)
x = F.leaky_relu(self.bn2d1(x))
x = self.pool1(x)
x = self.conv2(x)
x = F.leaky_relu(self.bn2d2(x))
x = self.pool2(x)
x = self.conv3(x)
x = F.leaky_relu(self.bn2d3(x))
x = self.conv4(x)
x = F.leaky_relu(self.bn2d4(x))
x = self.pool3(x)
x = self.conv5(x)
if ad:
x = self.conv_final(x) # n x heads x h' x w'
return x
class FCDD_CNN224_3K(FCDD_CNN224_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=3, **kwargs)
class FCDD_CNN224_5K(FCDD_CNN224_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=5, **kwargs)
class FCDD_CNN224_7K(FCDD_CNN224_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=7, **kwargs)
class FCDD_CNN224_9K(FCDD_CNN224_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=9, **kwargs)
class FCDD_CNN224_11K(FCDD_CNN224_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=11, **kwargs)
class FCDD_CNN224_13K(FCDD_CNN224_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=13, **kwargs)
class FCDD_CNN32_VARK(FCDDNet):
def __init__(self, in_shape, k=3, **kwargs):
assert k % 2 == 1, 'kernel size needs to be uneven'
p = (k - 1) // 2
super().__init__(in_shape, **kwargs)
self.conv1 = self._create_conv2d(in_shape[0], 128, k, bias=self.bias, padding=p)
self.bn2d1 = nn.BatchNorm2d(128, eps=1e-04, affine=self.bias)
self.pool1 = self._create_maxpool2d(2, 2)
self.conv2 = self._create_conv2d(128, 256, 3, bias=self.bias, padding=1)
self.bn2d2 = nn.BatchNorm2d(256, eps=1e-04, affine=self.bias)
self.pool2 = self._create_maxpool2d(2, 2)
self.conv3 = self._create_conv2d(256, 128, 3, bias=self.bias, padding=1)
self.conv_final = self._create_conv2d(128, 1, 1, bias=self.bias)
def forward(self, x, ad=True):
x = self.conv1(x)
x = self.pool1(F.leaky_relu(self.bn2d1(x)))
x = self.conv2(x)
x = self.pool2(F.leaky_relu(self.bn2d2(x)))
x = self.conv3(x)
if ad:
x = self.conv_final(x) # n x heads x h' x w'
return x
class FCDD_CNN32_3K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=3, **kwargs)
class FCDD_CNN32_5K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=5, **kwargs)
class FCDD_CNN32_7K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=7, **kwargs)
class FCDD_CNN32_9K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=9, **kwargs)
class FCDD_CNN32_11K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=11, **kwargs)
class FCDD_CNN32_13K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=13, **kwargs)
class FCDD_CNN32_15K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=15, **kwargs)
class FCDD_CNN32_17K(FCDD_CNN32_VARK):
def __init__(self, *args, **kwargs):
super().__init__(*args, k=17, **kwargs)
| 32.40411
| 88
| 0.619531
| 725
| 4,731
| 3.717241
| 0.131034
| 0.056772
| 0.065306
| 0.077922
| 0.849722
| 0.797032
| 0.762894
| 0.745826
| 0.666048
| 0.666048
| 0
| 0.089442
| 0.227225
| 4,731
| 145
| 89
| 32.627586
| 0.647702
| 0.017332
| 0
| 0.490196
| 0
| 0
| 0.012923
| 0
| 0
| 0
| 0
| 0
| 0.019608
| 1
| 0.176471
| false
| 0
| 0.029412
| 0
| 0.382353
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
446b6bdff4d4aac132485087c94178da817f52aa
| 47
|
py
|
Python
|
AtCoder/ABC107/A.py
|
takaaki82/Java-Lessons
|
c4f11462bf84c091527dde5f25068498bfb2cc49
|
[
"MIT"
] | 1
|
2018-11-25T04:15:45.000Z
|
2018-11-25T04:15:45.000Z
|
AtCoder/ABC107/A.py
|
takaaki82/Java-Lessons
|
c4f11462bf84c091527dde5f25068498bfb2cc49
|
[
"MIT"
] | null | null | null |
AtCoder/ABC107/A.py
|
takaaki82/Java-Lessons
|
c4f11462bf84c091527dde5f25068498bfb2cc49
|
[
"MIT"
] | 2
|
2018-08-08T13:01:14.000Z
|
2018-11-25T12:38:36.000Z
|
N, i = map(int, input().split())
print(N-i+1)
| 11.75
| 32
| 0.553191
| 10
| 47
| 2.6
| 0.8
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025
| 0.148936
| 47
| 3
| 33
| 15.666667
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
92407e50b2c8faa8d671f4096450ed2ebf548e1c
| 71
|
py
|
Python
|
quaesit/__init__.py
|
jgregoriods/quaesit
|
3846f5084ea4d6c1cbd9a93176ee9dee25e12105
|
[
"MIT"
] | null | null | null |
quaesit/__init__.py
|
jgregoriods/quaesit
|
3846f5084ea4d6c1cbd9a93176ee9dee25e12105
|
[
"MIT"
] | null | null | null |
quaesit/__init__.py
|
jgregoriods/quaesit
|
3846f5084ea4d6c1cbd9a93176ee9dee25e12105
|
[
"MIT"
] | null | null | null |
from .agent import Agent
from .gui import GUI
from .world import World
| 17.75
| 24
| 0.788732
| 12
| 71
| 4.666667
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169014
| 71
| 3
| 25
| 23.666667
| 0.949153
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
925ff3c1a99f975c4fe57081c6a973d5ce11a7b8
| 166
|
py
|
Python
|
tests/cases/shell/reasonable_output_if_unknown_cmd/test_reasonable_output_for_unknown_cmd.py
|
WilliamMayor/vantage
|
05cda557cfc27cbf8aaf80a472a023a896e98546
|
[
"MIT"
] | 1
|
2018-02-21T09:50:53.000Z
|
2018-02-21T09:50:53.000Z
|
tests/cases/shell/reasonable_output_if_unknown_cmd/test_reasonable_output_for_unknown_cmd.py
|
WilliamMayor/vantage
|
05cda557cfc27cbf8aaf80a472a023a896e98546
|
[
"MIT"
] | 15
|
2015-04-30T15:19:29.000Z
|
2021-07-28T14:34:46.000Z
|
tests/cases/shell/reasonable_output_if_unknown_cmd/test_reasonable_output_for_unknown_cmd.py
|
WilliamMayor/vantage
|
05cda557cfc27cbf8aaf80a472a023a896e98546
|
[
"MIT"
] | null | null | null |
def test_reasonable_output_for_unknown_cmd(result):
assert result.exit_code == 1
assert result.stderr_ == "vantage: error: Command 'not-a-command' not found"
| 41.5
| 80
| 0.759036
| 24
| 166
| 4.958333
| 0.791667
| 0.201681
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006993
| 0.138554
| 166
| 3
| 81
| 55.333333
| 0.825175
| 0
| 0
| 0
| 0
| 0
| 0.295181
| 0
| 0
| 0
| 0
| 0
| 0.666667
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2bbbac086320598591f7393fda6bc51c191a10c9
| 239
|
py
|
Python
|
applications/views/admin/context_processor.py
|
solitary-sen/pear-admin-flask
|
c2ce10bb2a51fd7376ca1d211e30380fca119a19
|
[
"MIT"
] | 1
|
2021-12-06T06:13:30.000Z
|
2021-12-06T06:13:30.000Z
|
applications/views/admin/context_processor.py
|
solitary-sen/pear-admin-flask
|
c2ce10bb2a51fd7376ca1d211e30380fca119a19
|
[
"MIT"
] | null | null | null |
applications/views/admin/context_processor.py
|
solitary-sen/pear-admin-flask
|
c2ce10bb2a51fd7376ca1d211e30380fca119a19
|
[
"MIT"
] | null | null | null |
from flask import session
def init_template_global(app):
@app.template_global()
def authorize(power):
# print(power)
# print(session.get('permissions'))
return bool(power in session.get('permissions'))
| 19.916667
| 57
| 0.656904
| 28
| 239
| 5.5
| 0.607143
| 0.181818
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225941
| 239
| 11
| 58
| 21.727273
| 0.832432
| 0.192469
| 0
| 0
| 0
| 0
| 0.058511
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.2
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
2bc3f8ba47df2192458a929f8124a9753c4dd674
| 359
|
py
|
Python
|
creatures/animals/Fox.py
|
stasgora/python-world-simulator
|
f574c8791de4d8045e1ebcbe48e6e66c3f2ff256
|
[
"MIT"
] | null | null | null |
creatures/animals/Fox.py
|
stasgora/python-world-simulator
|
f574c8791de4d8045e1ebcbe48e6e66c3f2ff256
|
[
"MIT"
] | null | null | null |
creatures/animals/Fox.py
|
stasgora/python-world-simulator
|
f574c8791de4d8045e1ebcbe48e6e66c3f2ff256
|
[
"MIT"
] | null | null | null |
from ..Animal import Animal
class Fox(Animal):
def __init__(self, strength, initiative, symbol, position, world, color):
super(Fox, self).__init__(strength, initiative, symbol, position, world, color)
def get_move_pos(self):
return self._world.get_map().get_pos_nearby(self._position, False, self._range, self._strength)
| 32.636364
| 104
| 0.70195
| 46
| 359
| 5.108696
| 0.5
| 0.102128
| 0.204255
| 0.27234
| 0.357447
| 0.357447
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183844
| 359
| 10
| 105
| 35.9
| 0.802048
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.166667
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
920aa4e0f853887c83492d931ac2dc41d89e4a50
| 133
|
py
|
Python
|
python/benchmark/utils/fst.py
|
jkomyno/lattice-submodular-maximization
|
e03c8bcc5fcf5bf79a6ae81f145757cf3fdff7cb
|
[
"MIT"
] | 1
|
2021-11-16T18:16:42.000Z
|
2021-11-16T18:16:42.000Z
|
python/benchmark/utils/fst.py
|
jkomyno/lattice-submodular-maximization
|
e03c8bcc5fcf5bf79a6ae81f145757cf3fdff7cb
|
[
"MIT"
] | null | null | null |
python/benchmark/utils/fst.py
|
jkomyno/lattice-submodular-maximization
|
e03c8bcc5fcf5bf79a6ae81f145757cf3fdff7cb
|
[
"MIT"
] | null | null | null |
from typing import Tuple, TypeVar, Set, Any
T = TypeVar('T', int, float, Set[int])
def fst(x: Tuple[T, Any]) -> T:
return x[0]
| 19
| 43
| 0.616541
| 24
| 133
| 3.416667
| 0.625
| 0.097561
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009434
| 0.203008
| 133
| 6
| 44
| 22.166667
| 0.764151
| 0
| 0
| 0
| 0
| 0
| 0.007519
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
920aec40f0cae2a5d71edc12932c140b48f49637
| 66
|
py
|
Python
|
PVGPpy/macros/__init__.py
|
aashish24/ParaViewGeophysics
|
d9a71ffd21a57fa0eb704c5f6893ec9b1ddf6da6
|
[
"BSD-3-Clause"
] | null | null | null |
PVGPpy/macros/__init__.py
|
aashish24/ParaViewGeophysics
|
d9a71ffd21a57fa0eb704c5f6893ec9b1ddf6da6
|
[
"BSD-3-Clause"
] | null | null | null |
PVGPpy/macros/__init__.py
|
aashish24/ParaViewGeophysics
|
d9a71ffd21a57fa0eb704c5f6893ec9b1ddf6da6
|
[
"BSD-3-Clause"
] | null | null | null |
from norm_slices_along_points import *
from clip_through import *
| 22
| 38
| 0.848485
| 10
| 66
| 5.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 66
| 2
| 39
| 33
| 0.896552
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a64474a8af7279131eae2c696e2c0ae67d09425a
| 132
|
py
|
Python
|
training_api/shared/helpers/classes_helper.py
|
BMW-InnovationLab/BMW-Semantic-Segmentation-Training-GUI
|
902f35a7e367e635898f687b16a830db892fbaa5
|
[
"Apache-2.0"
] | 20
|
2021-07-13T13:08:57.000Z
|
2022-03-29T09:38:00.000Z
|
training_api/shared/helpers/classes_helper.py
|
BMW-InnovationLab/BMW-Semantic-Segmentation-Training-GUI
|
902f35a7e367e635898f687b16a830db892fbaa5
|
[
"Apache-2.0"
] | null | null | null |
training_api/shared/helpers/classes_helper.py
|
BMW-InnovationLab/BMW-Semantic-Segmentation-Training-GUI
|
902f35a7e367e635898f687b16a830db892fbaa5
|
[
"Apache-2.0"
] | 2
|
2021-07-12T08:42:53.000Z
|
2022-03-04T18:41:25.000Z
|
def get_num_classes(classes_path: str) -> int:
classes: str = open(classes_path, 'r').read()
return len(classes.split(','))
| 33
| 49
| 0.666667
| 19
| 132
| 4.421053
| 0.684211
| 0.261905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 132
| 3
| 50
| 44
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.015152
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
a64d6ff3c492525cc51f24edec3f80d93d04ea33
| 16
|
py
|
Python
|
tests/test-recipes/metadata/_compile-test/f3.py
|
DerThorsten/conda-build
|
729c0cea03677dae0e2e15b7ec6d98619b5d4401
|
[
"BSD-3-Clause"
] | 5
|
2016-05-10T23:36:56.000Z
|
2021-04-21T17:09:18.000Z
|
tests/test-recipes/metadata/_compile-test/f3.py
|
DerThorsten/conda-build
|
729c0cea03677dae0e2e15b7ec6d98619b5d4401
|
[
"BSD-3-Clause"
] | 6
|
2016-07-05T19:08:39.000Z
|
2017-10-23T10:59:14.000Z
|
tests/test-recipes/metadata/_compile-test/f3.py
|
DerThorsten/conda-build
|
729c0cea03677dae0e2e15b7ec6d98619b5d4401
|
[
"BSD-3-Clause"
] | 5
|
2016-10-08T19:31:55.000Z
|
2021-10-10T18:24:42.000Z
|
print("File 3")
| 8
| 15
| 0.625
| 3
| 16
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0.125
| 16
| 1
| 16
| 16
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
a6c5115b5bd0ba232b4a04dcb2362d77e7e7a8e2
| 184
|
py
|
Python
|
src/lib/centipede/TaskWrapper/aux/gafferRunSerializedTask.py
|
ramgopal99/centipede
|
0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba
|
[
"MIT"
] | 3
|
2018-05-28T20:56:19.000Z
|
2018-06-02T15:58:10.000Z
|
src/lib/centipede/TaskWrapper/aux/gafferRunSerializedTask.py
|
ramgopal99/centipede
|
0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba
|
[
"MIT"
] | 2
|
2018-07-01T07:45:38.000Z
|
2018-07-11T03:15:35.000Z
|
src/lib/centipede/TaskWrapper/aux/gafferRunSerializedTask.py
|
ramgopal99/centipede
|
0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba
|
[
"MIT"
] | 3
|
2018-07-10T14:51:13.000Z
|
2022-03-17T00:39:58.000Z
|
# gaffer needs to be imported at top-most
import Gaffer
# now we can import centipede
import centipede
# running serialized task
centipede.TaskWrapper.Subprocess.runSerializedTask()
| 20.444444
| 52
| 0.815217
| 24
| 184
| 6.25
| 0.791667
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.13587
| 184
| 8
| 53
| 23
| 0.943396
| 0.494565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a6f8f825d0e13375be4fccd5f52201df9949c4ac
| 28
|
py
|
Python
|
rest/settings.py
|
engleandro/Portifolio-WhatsAppAutomation
|
f01d181697215aee3d105e3ad94e2593b7732e5c
|
[
"Apache-2.0"
] | null | null | null |
rest/settings.py
|
engleandro/Portifolio-WhatsAppAutomation
|
f01d181697215aee3d105e3ad94e2593b7732e5c
|
[
"Apache-2.0"
] | null | null | null |
rest/settings.py
|
engleandro/Portifolio-WhatsAppAutomation
|
f01d181697215aee3d105e3ad94e2593b7732e5c
|
[
"Apache-2.0"
] | null | null | null |
class MySettings():
pass
| 14
| 19
| 0.678571
| 3
| 28
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.214286
| 28
| 2
| 20
| 14
| 0.863636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
5b34a2e04283b1e77743c79f4c17e7e4e64f15f2
| 234
|
py
|
Python
|
closed/FuriosaAI/code/quantization/furiosa_sdk_quantizer/frontend/onnx/transformer/experimental/__init__.py
|
ctuning/inference_results_v1.1
|
d9176eca28fcf6d7a05ccb97994362a76a1eb5ab
|
[
"Apache-2.0"
] | 12
|
2021-09-23T08:05:57.000Z
|
2022-03-21T03:52:11.000Z
|
closed/FuriosaAI/code/quantization/furiosa_sdk_quantizer/frontend/onnx/transformer/experimental/__init__.py
|
ctuning/inference_results_v1.1
|
d9176eca28fcf6d7a05ccb97994362a76a1eb5ab
|
[
"Apache-2.0"
] | 11
|
2021-09-23T20:34:06.000Z
|
2022-01-22T07:58:02.000Z
|
closed/FuriosaAI/code/quantization/furiosa_sdk_quantizer/frontend/onnx/transformer/experimental/__init__.py
|
ctuning/inference_results_v1.1
|
d9176eca28fcf6d7a05ccb97994362a76a1eb5ab
|
[
"Apache-2.0"
] | 16
|
2021-09-23T20:26:38.000Z
|
2022-03-09T12:59:56.000Z
|
from furiosa_sdk_quantizer.frontend.onnx.transformer.experimental.fuse_div_for_bert import (
FuseDivForBert,
)
from furiosa_sdk_quantizer.frontend.onnx.transformer.experimental.reify_conv_for_bert import (
ReifyConvForBert,
)
| 33.428571
| 94
| 0.846154
| 28
| 234
| 6.714286
| 0.607143
| 0.117021
| 0.148936
| 0.244681
| 0.617021
| 0.617021
| 0.617021
| 0.617021
| 0
| 0
| 0
| 0
| 0.08547
| 234
| 6
| 95
| 39
| 0.878505
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
5b567a8055799d331ce1797e3fb8316f98ff8b25
| 342
|
py
|
Python
|
tests/ReLGetExpNums.py
|
nelmiux/CS347-Data_Management
|
1e9d87097b5a373f9312b0d6b413198e495fd6c0
|
[
"CNRI-Jython"
] | null | null | null |
tests/ReLGetExpNums.py
|
nelmiux/CS347-Data_Management
|
1e9d87097b5a373f9312b0d6b413198e495fd6c0
|
[
"CNRI-Jython"
] | null | null | null |
tests/ReLGetExpNums.py
|
nelmiux/CS347-Data_Management
|
1e9d87097b5a373f9312b0d6b413198e495fd6c0
|
[
"CNRI-Jython"
] | null | null | null |
connectTo 'jdbc:oracle:thin:@ib-perfdb.us.oracle.com:1525:perfdb' 'cannata' 'orcl' 'remote';
for i in range(1,65) :
SQL """ insert into ibexperiment(name, exp_date, tool, protocol, published) values ('BM on cloud-mwm-15 -> cloud-mwm-16 S12b23 1 stream only, multi-parts """ i """/ 64', to_char(sysdate), 'rds-stress', 'IPoIB', 'Yes');"""
| 85.5
| 225
| 0.678363
| 54
| 342
| 4.259259
| 0.888889
| 0.069565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.06
| 0.122807
| 342
| 3
| 226
| 114
| 0.706667
| 0
| 0
| 0
| 0
| 0.333333
| 0.798246
| 0.154971
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5babf059a2a80e85471f8189b5df1ed0af9bc5e5
| 42
|
py
|
Python
|
pasta para baixar/netcha/benvindo.py
|
vany-oss/python
|
f687d9cd798af7038d9ce963e5e7ba167010331a
|
[
"MIT"
] | null | null | null |
pasta para baixar/netcha/benvindo.py
|
vany-oss/python
|
f687d9cd798af7038d9ce963e5e7ba167010331a
|
[
"MIT"
] | null | null | null |
pasta para baixar/netcha/benvindo.py
|
vany-oss/python
|
f687d9cd798af7038d9ce963e5e7ba167010331a
|
[
"MIT"
] | null | null | null |
print('ola mundo ')
# esse e o primeiro pg
| 21
| 22
| 0.690476
| 8
| 42
| 3.625
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 42
| 2
| 22
| 21
| 0.852941
| 0.47619
| 0
| 0
| 0
| 0
| 0.47619
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
5bb03870924d828da4926eca7596f02cc199d949
| 277
|
py
|
Python
|
django_fieldbustier/fieldbustier_config.py
|
OmenApps/django-fieldbustier
|
4189f419eafa67648d65ed50195a7bb5d9ee159c
|
[
"MIT"
] | null | null | null |
django_fieldbustier/fieldbustier_config.py
|
OmenApps/django-fieldbustier
|
4189f419eafa67648d65ed50195a7bb5d9ee159c
|
[
"MIT"
] | null | null | null |
django_fieldbustier/fieldbustier_config.py
|
OmenApps/django-fieldbustier
|
4189f419eafa67648d65ed50195a7bb5d9ee159c
|
[
"MIT"
] | null | null | null |
from collections import namedtuple
FieldBustierConfig = namedtuple(
"FieldBustierConfig", ["app_name", "model_klass", "field_name", "field_klass", "args", "kwargs"]
)
DeleteFieldBustierConfig = namedtuple("FieldBustierConfig", ["app_name", "model_klass", "field_name"])
| 30.777778
| 102
| 0.750903
| 26
| 277
| 7.730769
| 0.5
| 0.41791
| 0.308458
| 0.348259
| 0.537313
| 0.537313
| 0.537313
| 0.537313
| 0
| 0
| 0
| 0
| 0.101083
| 277
| 8
| 103
| 34.625
| 0.807229
| 0
| 0
| 0
| 0
| 0
| 0.415162
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5bba66d584bb5e5550bf6d8970af0ac56bdabd1f
| 80
|
py
|
Python
|
vedastr/models/bodies/sequences/transformer/__init__.py
|
csmasters/vedastr
|
7513384ab503f15dc574c7d92b75ff2092354757
|
[
"Apache-2.0"
] | 475
|
2020-03-17T01:46:32.000Z
|
2022-03-29T23:30:15.000Z
|
vedastr/models/bodies/sequences/transformer/__init__.py
|
csmasters/vedastr
|
7513384ab503f15dc574c7d92b75ff2092354757
|
[
"Apache-2.0"
] | 71
|
2020-04-01T04:17:47.000Z
|
2021-11-18T06:55:14.000Z
|
vedastr/models/bodies/sequences/transformer/__init__.py
|
csmasters/vedastr
|
7513384ab503f15dc574c7d92b75ff2092354757
|
[
"Apache-2.0"
] | 108
|
2020-02-21T10:30:37.000Z
|
2022-03-21T12:03:30.000Z
|
from .encoder import TransformerEncoder
from .decoder import TransformerDecoder
| 26.666667
| 39
| 0.875
| 8
| 80
| 8.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 80
| 2
| 40
| 40
| 0.972222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
5bfb1fe5ab623887900be4a20461e870f5fd685a
| 30
|
py
|
Python
|
validator/user/user_validator.py
|
JadenChoi2k/python-csv-http-db
|
0947d42717723bb3887522c8b36379f67cc673b2
|
[
"MIT"
] | null | null | null |
validator/user/user_validator.py
|
JadenChoi2k/python-csv-http-db
|
0947d42717723bb3887522c8b36379f67cc673b2
|
[
"MIT"
] | null | null | null |
validator/user/user_validator.py
|
JadenChoi2k/python-csv-http-db
|
0947d42717723bb3887522c8b36379f67cc673b2
|
[
"MIT"
] | null | null | null |
class UserValidator:
pass
| 10
| 20
| 0.733333
| 3
| 30
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.233333
| 30
| 2
| 21
| 15
| 0.956522
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
753f2f59734f6b5c0094f78b08c9279198b9daf0
| 5,044
|
py
|
Python
|
src/tests.py
|
simoncrowe/bookchain-validator
|
2ce4091f1ad297f667fdedbc6c97c0ec2e3903c8
|
[
"MIT"
] | null | null | null |
src/tests.py
|
simoncrowe/bookchain-validator
|
2ce4091f1ad297f667fdedbc6c97c0ec2e3903c8
|
[
"MIT"
] | null | null | null |
src/tests.py
|
simoncrowe/bookchain-validator
|
2ce4091f1ad297f667fdedbc6c97c0ec2e3903c8
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Quick and dirty "unit" tests for API. Too complex but do the job."""
from multiprocessing import Process
import unittest
import time
import requests
from app import app
class CallLocalApiTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.test_server = Process(target=app.run)
cls.test_server.start()
# Wait for the test server to start
time.sleep(1)
@classmethod
def tearDownClass(cls):
cls.test_server.terminate()
cls.test_server.join()
def test_greeting_without_latest_text(self):
response = requests.post('http://127.0.0.1:5000/greeting')
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
app.config['GREETING_NO_REQUIRED_STRING']
)
def test_greeting_with_latest_block_text_containing_stop_word(self):
response = requests.post(
'http://127.0.0.1:5000/greeting',
data={'latest_block_text': 'Almost'}
)
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
app.config['GREETING_NO_REQUIRED_STRING']
)
def test_greeting_with_latest_block_text_containing_verbs(self):
response = requests.post(
'http://127.0.0.1:5000/greeting',
data={'latest_block_text': 'subsist exist.'}
)
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
app.config['GREETING_TEMPLATE_WITH_REQUIRED_STRING'].replace(
'{{ required_string }}',
'exist'
)
)
def test_greeting_with_latest_block_text_containing_noun_phrases(self):
response = requests.post(
'http://127.0.0.1:5000/greeting',
data={'latest_block_text': 'The quick brown fox jumps over the lazy dog.'}
)
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
app.config['GREETING_TEMPLATE_WITH_REQUIRED_STRING'].replace(
'{{ required_string }}',
'the lazy dog'
)
)
def test_validate_with_no_latest_text_and_no_matching_pattern(self):
response = requests.post(
'http://127.0.0.1:5000/validate',
data={'proposed_block_text': 'I am a the lazy dog.'}
)
self.assertEqual(response.status_code, 200)
self.assertDictEqual(
response.json(),
{
'valid': False,
'message': app.config['PROPOSAL_INVALID_MESSAGE']
}
)
def test_validate_with_latest_text_and_no_matching_pattern(self):
response = requests.post(
'http://127.0.0.1:5000/validate',
data={
'latest_block_text': 'I once was a spoon.',
'proposed_block_text': 'I am a the lazy dog.'
}
)
self.assertEqual(response.status_code, 200)
self.assertDictEqual(
response.json(),
{
'valid': False,
'message': app.config['PROPOSAL_INVALID_MESSAGE']
}
)
def test_validate_with_latest_text_and_matching_pattern(self):
response = requests.post(
'http://127.0.0.1:5000/validate',
data={
'latest_block_text': 'I paid £1 for my spoon.',
'proposed_block_text': 'I did not earn my $1,000,000,000.'
}
)
self.assertEqual(response.status_code, 200)
self.assertDictEqual(
response.json(),
{
'valid': True,
'message': app.config['PROPOSAL_VALID_MESSAGE']
}
)
def test_validate_with_latest_text_and_matching_phrase(self):
response = requests.post(
'http://127.0.0.1:5000/validate',
data={
'latest_block_text': 'I hated her.',
'proposed_block_text': 'I loved her.'
}
)
self.assertEqual(response.status_code, 200)
self.assertDictEqual(
response.json(),
{
'valid': True,
'message': app.config['PROPOSAL_VALID_MESSAGE']
}
)
def test_validate_with_latest_text_matching_phrase_and_pattern(self):
response = requests.post(
'http://127.0.0.1:5000/validate',
data={
'latest_block_text': 'I hated her £500 shoes.',
'proposed_block_text': 'I loved her £500 shoes.'
}
)
self.assertEqual(response.status_code, 200)
self.assertDictEqual(
response.json(),
{
'valid': True,
'message': app.config['PROPOSAL_VALID_MESSAGE']
}
)
if __name__ == '__main__':
unittest.main()
| 30.569697
| 86
| 0.560468
| 536
| 5,044
| 5.024254
| 0.223881
| 0.05013
| 0.111029
| 0.080208
| 0.768288
| 0.757891
| 0.738582
| 0.738582
| 0.722243
| 0.718158
| 0
| 0.040509
| 0.3295
| 5,044
| 165
| 87
| 30.569697
| 0.754879
| 0.028351
| 0
| 0.474453
| 0
| 0
| 0.225582
| 0.049857
| 0
| 0
| 0
| 0
| 0.131387
| 1
| 0.080292
| false
| 0
| 0.036496
| 0
| 0.124088
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7552c07346e47dadf936ebc70a4725f342c0497c
| 37
|
py
|
Python
|
routes/index.py
|
felipe2323/habi-test-api
|
0dd1c84b3b816dcaaf324261620c11768ea56b63
|
[
"MIT"
] | null | null | null |
routes/index.py
|
felipe2323/habi-test-api
|
0dd1c84b3b816dcaaf324261620c11768ea56b63
|
[
"MIT"
] | null | null | null |
routes/index.py
|
felipe2323/habi-test-api
|
0dd1c84b3b816dcaaf324261620c11768ea56b63
|
[
"MIT"
] | null | null | null |
from routes.property import property_
| 37
| 37
| 0.891892
| 5
| 37
| 6.4
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 37
| 1
| 37
| 37
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
755a8398bd049fc90f65a949727f10b4e33f81a2
| 268
|
py
|
Python
|
examples/print_cur_tb.py
|
cclauss/traceback_with_variables
|
a2bbeb0629535a81f68e1c60a04a7db0ca7470ba
|
[
"MIT"
] | 550
|
2020-10-31T18:19:24.000Z
|
2022-03-31T17:40:07.000Z
|
examples/print_cur_tb.py
|
cclauss/traceback_with_variables
|
a2bbeb0629535a81f68e1c60a04a7db0ca7470ba
|
[
"MIT"
] | 20
|
2020-10-29T15:20:35.000Z
|
2021-12-06T00:00:08.000Z
|
examples/print_cur_tb.py
|
cclauss/traceback_with_variables
|
a2bbeb0629535a81f68e1c60a04a7db0ca7470ba
|
[
"MIT"
] | 24
|
2020-11-04T05:12:36.000Z
|
2022-03-18T05:38:59.000Z
|
from traceback_with_variables import print_cur_tb # , format_cur_tb, iter_cur_tb_lines
def f(n):
print_cur_tb()
# cur_tb_str = format_cur_tb()
# cur_tb_lines = list(iter_cur_tb_lines())
return n + 1
def main():
f(10)
main()
| 15.764706
| 88
| 0.63806
| 43
| 268
| 3.511628
| 0.465116
| 0.264901
| 0.198676
| 0.18543
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015228
| 0.264925
| 268
| 16
| 89
| 16.75
| 0.751269
| 0.38806
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0
| 0.571429
| 0.285714
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
755dd9140247198cd698a9c435a540d43ab0990c
| 153
|
py
|
Python
|
server/umoveapp/admin.py
|
tekishahammock/Backend-Capstone-uMove
|
12feb7b778e7abeed428bcef00e417a028db9bf3
|
[
"MIT"
] | null | null | null |
server/umoveapp/admin.py
|
tekishahammock/Backend-Capstone-uMove
|
12feb7b778e7abeed428bcef00e417a028db9bf3
|
[
"MIT"
] | null | null | null |
server/umoveapp/admin.py
|
tekishahammock/Backend-Capstone-uMove
|
12feb7b778e7abeed428bcef00e417a028db9bf3
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Class, Studio
# Register your models here.
admin.site.register(Class)
admin.site.register(Studio)
| 19.125
| 33
| 0.797386
| 22
| 153
| 5.545455
| 0.545455
| 0.147541
| 0.278689
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 153
| 7
| 34
| 21.857143
| 0.903704
| 0.169935
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f3b1b5347b70350c2e3a4be5b38c17cc13ebe59f
| 101
|
py
|
Python
|
htchirp/__main__.py
|
BrunoCoimbra/htchirp
|
e75492a00d3acd3233c9bf57fb0a194cb8fbfa5d
|
[
"Apache-2.0"
] | null | null | null |
htchirp/__main__.py
|
BrunoCoimbra/htchirp
|
e75492a00d3acd3233c9bf57fb0a194cb8fbfa5d
|
[
"Apache-2.0"
] | null | null | null |
htchirp/__main__.py
|
BrunoCoimbra/htchirp
|
e75492a00d3acd3233c9bf57fb0a194cb8fbfa5d
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
from htchirp import client
import sys
sys.exit(client.main())
| 20.2
| 38
| 0.831683
| 15
| 101
| 5.266667
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108911
| 101
| 5
| 39
| 20.2
| 0.877778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
45fd7034fb94aa5ef1498eff38bac2c729701fac
| 157
|
py
|
Python
|
src/installer/_compat/typing.py
|
FFY00/installer
|
86c028799437bea9ff1996d4c4d463897102b266
|
[
"MIT"
] | null | null | null |
src/installer/_compat/typing.py
|
FFY00/installer
|
86c028799437bea9ff1996d4c4d463897102b266
|
[
"MIT"
] | null | null | null |
src/installer/_compat/typing.py
|
FFY00/installer
|
86c028799437bea9ff1996d4c4d463897102b266
|
[
"MIT"
] | null | null | null |
try: # pragma: no cover
from typing import TYPE_CHECKING
except ImportError: # pragma: no cover
TYPE_CHECKING = False
__all__ = ["TYPE_CHECKING"]
| 22.428571
| 39
| 0.719745
| 20
| 157
| 5.3
| 0.65
| 0.339623
| 0.245283
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.203822
| 157
| 6
| 40
| 26.166667
| 0.848
| 0.210191
| 0
| 0
| 0
| 0
| 0.107438
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3418a4fcd57ffcafd919952d1df26391e8d69b44
| 259
|
py
|
Python
|
facturador/stock/admin.py
|
crodriguezud/Facturador
|
1a1e08072ae1d54f3f7963cdd202444618a0fa2e
|
[
"Apache-2.0"
] | null | null | null |
facturador/stock/admin.py
|
crodriguezud/Facturador
|
1a1e08072ae1d54f3f7963cdd202444618a0fa2e
|
[
"Apache-2.0"
] | 9
|
2020-06-05T17:25:18.000Z
|
2022-03-11T23:15:36.000Z
|
facturador/stock/admin.py
|
crodriguezud/Facturador
|
1a1e08072ae1d54f3f7963cdd202444618a0fa2e
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from .models import TipoProducto, TipoEstampado, Color, Producto, Talla
admin.site.register(TipoProducto)
admin.site.register(TipoEstampado)
admin.site.register(Talla)
admin.site.register(Color)
admin.site.register(Producto)
| 28.777778
| 71
| 0.830116
| 33
| 259
| 6.515152
| 0.393939
| 0.209302
| 0.395349
| 0.204651
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069498
| 259
| 9
| 72
| 28.777778
| 0.892116
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.285714
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
caa7a4df4fa79a24bbd9807eb4a18b8c265ce749
| 110
|
py
|
Python
|
neuralnet_pytorch/extensions/bpd.py
|
justanhduc/neuralnet-pytorch
|
cbb0c5a540a0ba91cb4dd20684bb00692305d193
|
[
"MIT"
] | 28
|
2019-01-07T04:07:55.000Z
|
2021-11-09T15:16:11.000Z
|
neuralnet_pytorch/extensions/bpd.py
|
justanhduc/neuralnet-pytorch
|
cbb0c5a540a0ba91cb4dd20684bb00692305d193
|
[
"MIT"
] | 9
|
2019-12-25T08:00:33.000Z
|
2021-11-23T09:02:34.000Z
|
neuralnet_pytorch/extensions/bpd.py
|
justanhduc/neuralnet-pytorch
|
cbb0c5a540a0ba91cb4dd20684bb00692305d193
|
[
"MIT"
] | 3
|
2020-08-07T12:49:05.000Z
|
2022-03-07T21:32:39.000Z
|
import neuralnet_pytorch.ext as ext
__all__ = ['batch_pairwise_dist']
batch_pairwise_dist = ext.bpd_forward
| 18.333333
| 37
| 0.818182
| 16
| 110
| 5
| 0.6875
| 0.325
| 0.425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109091
| 110
| 5
| 38
| 22
| 0.816327
| 0
| 0
| 0
| 0
| 0
| 0.172727
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
cafbcbcb1b27c0c95b0d75f7c43b3108b68c5153
| 23
|
py
|
Python
|
Python/test.py
|
vvpn9/Handy-Tools
|
5b8e59e80832985c352b7f6e578462e61fcbc300
|
[
"MIT"
] | null | null | null |
Python/test.py
|
vvpn9/Handy-Tools
|
5b8e59e80832985c352b7f6e578462e61fcbc300
|
[
"MIT"
] | null | null | null |
Python/test.py
|
vvpn9/Handy-Tools
|
5b8e59e80832985c352b7f6e578462e61fcbc300
|
[
"MIT"
] | null | null | null |
v1 = 1 and 3
print(v1)
| 11.5
| 13
| 0.608696
| 6
| 23
| 2.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235294
| 0.26087
| 23
| 2
| 14
| 11.5
| 0.588235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
1b08ed9193ffee461d8fdf9e75fca713b1df4e60
| 79
|
py
|
Python
|
openeo_driver/app.py
|
vconrado/openeo-python-driver
|
35dd46ed40b02d147a66fa3199b94f2798e03467
|
[
"Apache-2.0"
] | null | null | null |
openeo_driver/app.py
|
vconrado/openeo-python-driver
|
35dd46ed40b02d147a66fa3199b94f2798e03467
|
[
"Apache-2.0"
] | null | null | null |
openeo_driver/app.py
|
vconrado/openeo-python-driver
|
35dd46ed40b02d147a66fa3199b94f2798e03467
|
[
"Apache-2.0"
] | null | null | null |
from openeo_driver.views import build_app
app = build_app()
app.run(port=9007)
| 19.75
| 41
| 0.797468
| 14
| 79
| 4.285714
| 0.714286
| 0.266667
| 0.366667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056338
| 0.101266
| 79
| 4
| 42
| 19.75
| 0.788732
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1badf4d21d0b627944aec7d94627fe9544f7919c
| 151
|
py
|
Python
|
database/__init__.py
|
TioDexty/someone-bot
|
2598766f61ce81d934793c85158060bd8f3a4143
|
[
"MIT"
] | 2
|
2020-10-19T11:27:57.000Z
|
2021-05-29T19:03:49.000Z
|
database/__init__.py
|
AVBotz-TG/someone-bot
|
a6ccfac50455e56cb7f980f2d207f3fde0ed49ad
|
[
"MIT"
] | null | null | null |
database/__init__.py
|
AVBotz-TG/someone-bot
|
a6ccfac50455e56cb7f980f2d207f3fde0ed49ad
|
[
"MIT"
] | 9
|
2019-07-05T12:36:27.000Z
|
2021-08-01T18:44:03.000Z
|
from .models import db
from .models import User, Member
def create_tables():
with db:
db.create_tables([User, Member])
create_tables()
| 13.727273
| 40
| 0.688742
| 21
| 151
| 4.809524
| 0.47619
| 0.356436
| 0.316832
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.211921
| 151
| 10
| 41
| 15.1
| 0.84874
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.333333
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1bb268ea6110c4abae676565e21b48024b072817
| 196
|
py
|
Python
|
chatbot/views.py
|
gcivil-nyu-org/spring2021-cs-gy-9223-class
|
97121291c2a79dfec87c8b50e5f7e002a6020bfd
|
[
"MIT"
] | 1
|
2021-02-25T23:17:27.000Z
|
2021-02-25T23:17:27.000Z
|
chatbot/views.py
|
xiaodan-tang/sprint2021-team-1-repo
|
cb3595d808e47bb9ff77b432213ffa5d45593dff
|
[
"MIT"
] | 102
|
2021-03-01T21:57:35.000Z
|
2021-04-28T21:36:57.000Z
|
chatbot/views.py
|
gcivil-nyu-org/spring2021-cs-gy-9223-class
|
97121291c2a79dfec87c8b50e5f7e002a6020bfd
|
[
"MIT"
] | 5
|
2021-02-25T22:31:41.000Z
|
2021-11-21T21:56:30.000Z
|
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required
def chatbot(request):
return render(request=request, template_name="chat.html")
| 24.5
| 61
| 0.816327
| 26
| 196
| 6.038462
| 0.692308
| 0.127389
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102041
| 196
| 7
| 62
| 28
| 0.892045
| 0
| 0
| 0
| 0
| 0
| 0.045918
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
1bcf7632bf943df480a9e7a759ecf479d324fed0
| 124
|
py
|
Python
|
simple_machine_learning_models/models/gradient_boost/__init__.py
|
lnblanke/OCR
|
b235faa85fedd9f764f71ea592e8693a2a7ac42a
|
[
"MIT"
] | null | null | null |
simple_machine_learning_models/models/gradient_boost/__init__.py
|
lnblanke/OCR
|
b235faa85fedd9f764f71ea592e8693a2a7ac42a
|
[
"MIT"
] | null | null | null |
simple_machine_learning_models/models/gradient_boost/__init__.py
|
lnblanke/OCR
|
b235faa85fedd9f764f71ea592e8693a2a7ac42a
|
[
"MIT"
] | null | null | null |
# @Time: 10/28/2021
# @Author: lnblanke
# @Email: fjh314.84@gmail.com
# @File: __init__.py
from .GradBoost import GradBoost
| 20.666667
| 32
| 0.717742
| 18
| 124
| 4.722222
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12037
| 0.129032
| 124
| 6
| 32
| 20.666667
| 0.666667
| 0.66129
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
59fb545588e6c7f8d2fb083222ada37424d1c3f0
| 133
|
py
|
Python
|
flow_storage/flow_io_utils_impl/__init__.py
|
ekarpovs/flow_storage
|
8b0e7131eb3244a559a951b77541a0b6dc8908bd
|
[
"MIT"
] | null | null | null |
flow_storage/flow_io_utils_impl/__init__.py
|
ekarpovs/flow_storage
|
8b0e7131eb3244a559a951b77541a0b6dc8908bd
|
[
"MIT"
] | null | null | null |
flow_storage/flow_io_utils_impl/__init__.py
|
ekarpovs/flow_storage
|
8b0e7131eb3244a559a951b77541a0b6dc8908bd
|
[
"MIT"
] | null | null | null |
from .flowioutilsimpl import FlowIOUtilsImpl
from .flowioutils_fs import FlowIOUtilsFs
from .flowioutils_h5py import FlowIOUtilsH5Py
| 33.25
| 45
| 0.887218
| 14
| 133
| 8.285714
| 0.571429
| 0.258621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016529
| 0.090226
| 133
| 3
| 46
| 44.333333
| 0.942149
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
9425b5c796ccb6672fcf37f3ebc17f70a608fb9f
| 312
|
py
|
Python
|
loca/__init__.py
|
julievano/LOCA_Downscaling_Analysis
|
7c18cd7ad4af09161b35c7f5c0c8a1335088c48c
|
[
"Apache-2.0"
] | 5
|
2018-02-08T02:06:35.000Z
|
2021-03-19T02:28:20.000Z
|
loca/__init__.py
|
julievano/LOCA_Downscaling_Analysis
|
7c18cd7ad4af09161b35c7f5c0c8a1335088c48c
|
[
"Apache-2.0"
] | null | null | null |
loca/__init__.py
|
julievano/LOCA_Downscaling_Analysis
|
7c18cd7ad4af09161b35c7f5c0c8a1335088c48c
|
[
"Apache-2.0"
] | 7
|
2018-07-10T00:38:53.000Z
|
2022-03-31T03:08:19.000Z
|
def print_date():
'''Helper function to print current licencse and time'''
from datetime import datetime
import getpass
import socket
print('Last executed: %s by %s on %s' % (datetime.now(), getpass.getuser(),
socket.gethostname()), flush=True)
| 31.2
| 79
| 0.583333
| 35
| 312
| 5.171429
| 0.714286
| 0.154696
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.310897
| 312
| 9
| 80
| 34.666667
| 0.84186
| 0.160256
| 0
| 0
| 0
| 0
| 0.113725
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0.333333
| 0.5
| 0
| 0.666667
| 0.333333
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
942f6abcf113413e01a6d2df7dc48c67135e12e5
| 47
|
py
|
Python
|
jupyter_remote/version.py
|
aaronkollasch/jupyter-remote
|
556328c9b220c5913d031bb0f2752b3672b75da8
|
[
"MIT"
] | null | null | null |
jupyter_remote/version.py
|
aaronkollasch/jupyter-remote
|
556328c9b220c5913d031bb0f2752b3672b75da8
|
[
"MIT"
] | null | null | null |
jupyter_remote/version.py
|
aaronkollasch/jupyter-remote
|
556328c9b220c5913d031bb0f2752b3672b75da8
|
[
"MIT"
] | null | null | null |
__version__ = "0.9.4"
version_info = [0, 9, 4]
| 15.666667
| 24
| 0.617021
| 9
| 47
| 2.666667
| 0.555556
| 0.166667
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 0.170213
| 47
| 2
| 25
| 23.5
| 0.461538
| 0
| 0
| 0
| 0
| 0
| 0.106383
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
945bf3c930d55e887198a935ca0b1f2a2bf6a92b
| 28,751
|
py
|
Python
|
graph.py
|
Tony031218/manim-projects
|
b243dec0f0a007649a92938e90d60eccb4c7dd15
|
[
"Apache-2.0"
] | 45
|
2019-10-08T23:58:20.000Z
|
2020-05-20T03:49:15.000Z
|
graph.py
|
Tony031218/manim-projects
|
b243dec0f0a007649a92938e90d60eccb4c7dd15
|
[
"Apache-2.0"
] | null | null | null |
graph.py
|
Tony031218/manim-projects
|
b243dec0f0a007649a92938e90d60eccb4c7dd15
|
[
"Apache-2.0"
] | 12
|
2019-08-15T08:07:22.000Z
|
2020-05-09T12:34:14.000Z
|
from manimlib.imports import *
class Scene_(Scene):
CONFIG = {
"camera_config": {
"background_color": WHITE
}
}
class NF24P3358(Scene_):
def construct(self):
line = Line(LEFT*3, RIGHT*3, color=BLACK)
nodes = VGroup(
*[
Circle(radius=0.25, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK)
for _ in range(7)
]
).arrange(RIGHT, buff=0.5)
names = VGroup(
*[
TextMobject(str(i), color=BLACK).scale(0.7)
for i in range(1, 8)
]
)
edges = VGroup(
*[
Arrow(nodes[i].get_center(), nodes[i + 1].get_center(), buff=0.25, color=BLACK)
for i in range(6)
]
)
infs = VGroup(
*[
TextMobject("inf", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(edges[i], UP, buff=0.1)
for i in range(6)
]
)
costs = VGroup(
*[
TextMobject("0", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(edges[i], DOWN, buff=0.1)
for i in range(6)
]
)
for i in range(7):
names[i].move_to(nodes[i])
s = VGroup(
Circle(radius=0.25, fill_color=WHITE, fill_opacity=1, stroke_color=RED),
TextMobject("s", color=RED, background_stroke_width=0).scale(0.75)
).move_to(np.array([-4.5, -1.5, 0]))
s.add(Arrow(s.get_center(), nodes[0].get_center(), color=RED, buff=0.25))
s.add(TextMobject("k", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(s[-1], UL, buff=-0.5))
s.add(TextMobject("0", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(s[-2], DR, buff=-0.5))
t = VGroup(
Circle(radius=0.25, fill_color=WHITE, fill_opacity=1, stroke_color=RED),
TextMobject("t", color=RED, background_stroke_width=0).scale(0.75)
).move_to(np.array([4.5, -1.5, 0]))
t.add(Arrow(nodes[-1].get_center(), t.get_center(), color=RED, buff=0.25))
t.add(TextMobject("inf", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(t[-1], UR, buff=-0.5))
t.add(TextMobject("0", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(t[-2], DL, buff=-0.5))
braces = VGroup(
Brace(VGroup(Dot(nodes[0].get_center(), radius=0.01), Dot(nodes[2].get_center(), radius=0.01)), UP, color=GRAY, buff=0.52),
Brace(VGroup(Dot(nodes[2].get_center(), radius=0.01), Dot(nodes[5].get_center(), radius=0.01)), UP, color=GRAY, buff=0.52),
Brace(VGroup(Dot(nodes[1].get_center(), radius=0.01), Dot(nodes[3].get_center(), radius=0.01)), DOWN, color=GRAY, buff=0.52),
Brace(VGroup(Dot(nodes[4].get_center(), radius=0.01), Dot(nodes[6].get_center(), radius=0.01)), DOWN, color=GRAY, buff=0.52),
)
edges2 = VGroup(
CurvedArrow(nodes[0].get_center(), nodes[2].get_center(), buff=0.25, color=BLACK, angle=-TAU / 4).shift(UP*1),
CurvedArrow(nodes[2].get_center(), nodes[5].get_center(), buff=0.25, color=BLACK, angle=-TAU / 4).shift(UP*1),
CurvedArrow(nodes[1].get_center(), nodes[3].get_center(), buff=0.25, color=BLACK, angle= TAU / 4).shift(DOWN*1),
CurvedArrow(nodes[4].get_center(), nodes[6].get_center(), buff=0.25, color=BLACK, angle= TAU / 4).shift(DOWN*1),
)
caps2 = VGroup(
TextMobject("1", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(edges2[0], UP, buff=0.1),
TextMobject("1", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(edges2[1], UP, buff=0.1),
TextMobject("1", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(edges2[2], UP, buff=-0.4),
TextMobject("1", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).next_to(edges2[3], UP, buff=-0.4)
)
costs2 = VGroup(
TextMobject("6", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(edges2[0], DOWN, buff=-0.4),
TextMobject("3", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(edges2[1], DOWN, buff=-0.6),
TextMobject("2", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(edges2[2], DOWN, buff=0.1),
TextMobject("4", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.6).next_to(edges2[3], DOWN, buff=0.1),
)
old_num = VGroup(
TextMobject("1", color=GRAY, background_stroke_color=GRAY).scale(0.45),
TextMobject("6", color=GRAY, background_stroke_color=GRAY).scale(0.45),
TextMobject("7", color=GRAY, background_stroke_color=GRAY).scale(0.45),
TextMobject("8", color=GRAY, background_stroke_color=GRAY).scale(0.45),
TextMobject("9", color=GRAY, background_stroke_color=GRAY).scale(0.45),
TextMobject("10", color=GRAY, background_stroke_color=GRAY).scale(0.45),
TextMobject("13", color=GRAY, background_stroke_color=GRAY).scale(0.45),
)
for i in range(7):
old_num[i].next_to(nodes[i], DOWN, buff=0.08)
comments = VGroup(
TextMobject("蓝-容量", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.7),
TextMobject("橙-费用", color=GOLD_D, background_stroke_color=GOLD_D).scale(0.7),
).arrange(DOWN, aligned_edge=LEFT, buff=0.2).next_to(nodes[0], DOWN, buff=1.3)
rec = SurroundingRectangle(comments, color=GRAY, buff=0.2)
problem = TextMobject("最长$k$可重区间集问题", color=WHITE, background_stroke_color=WHITE)
problem.add_background_rectangle(color=GOLD_D, opacity=1, buff=0.15).next_to(nodes[0], UP, buff=1.8).shift(RIGHT*0.2)
author = TextMobject("by @鹤翔万里", background_stroke_color=ORANGE, opacity=0.8).scale(0.7).set_color(ORANGE).next_to(t[0], DOWN, buff=0.4).shift(LEFT*0.8)
self.add(line, nodes, names, s, edges, infs, costs, t, braces, edges2, caps2, costs2, old_num, comments, rec, problem, author)
class NF24P2762(Scene_):
def construct(self):
rad = 0.3
s = VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=RED),
TextMobject("s", color=RED, background_stroke_width=0).scale(0.75)
).move_to(np.array([-4.5, 0, 0]))
t = VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=RED),
TextMobject("t", color=RED, background_stroke_width=0).scale(0.75)
).move_to(np.array([4.5, 0, 0]))
nodes = VGroup(
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK),
TextMobject("1\ 实验", color=BLACK, background_stroke_color=BLACK).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([-1.6, 1, 0])),
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK),
TextMobject("2\ 实验", color=BLACK, background_stroke_color=BLACK).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([-1.6, -1, 0])),
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK, fill_opacity=1),
TextMobject("1\ 仪器", color=WHITE, background_stroke_color=WHITE).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([1.5, 2, 0])),
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK, fill_opacity=1),
TextMobject("2\ 仪器", color=WHITE, background_stroke_color=WHITE).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([1.5, 0, 0])),
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK, fill_opacity=1),
TextMobject("3\ 仪器", color=WHITE, background_stroke_color=WHITE).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([1.5, -2, 0])),
)
edges_s = VGroup(
Arrow(s[0].get_center(), nodes[0][0].get_center(), color=RED, buff=rad),
Arrow(s[0].get_center(), nodes[1][0].get_center(), color=RED, buff=rad),
)
edges_s.add(TextMobject("10", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_s[0], UP, buff=-0.3).shift(LEFT*0.3))
edges_s.add(TextMobject("25", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_s[1], DOWN, buff=-0.3).shift(LEFT*0.3))
edges_n = VGroup(
Arrow(nodes[0][-1].get_center(), nodes[2][0].get_center(), color=BLACK, buff=rad),
Arrow(nodes[0][-1].get_center(), nodes[3][0].get_center(), color=BLACK, buff=rad),
Arrow(nodes[1][-1].get_center(), nodes[3][0].get_center(), color=BLACK, buff=rad),
Arrow(nodes[1][-1].get_center(), nodes[4][0].get_center(), color=BLACK, buff=rad),
)
edges_n.add(TextMobject("inf", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_n[0], UP, buff=-0.35).shift(LEFT*0.3))
edges_n.add(TextMobject("inf", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_n[1], UP, buff=-0.25).shift(LEFT*-0.1))
edges_n.add(TextMobject("inf", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_n[2], UP, buff=-0.35).shift(LEFT*0.3))
edges_n.add(TextMobject("inf", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_n[3], UP, buff=-0.25).shift(LEFT*-0.1))
edges_t = VGroup(
Arrow(nodes[2][-1].get_center(), t[0].get_center(), color=RED, buff=rad),
Arrow(nodes[3][-1].get_center(), t[0].get_center(), color=RED, buff=rad),
Arrow(nodes[4][-1].get_center(), t[0].get_center(), color=RED, buff=rad),
)
edges_t.add(TextMobject("5", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_t[0], UP, buff=-0.5).shift(LEFT*0.15))
edges_t.add(TextMobject("6", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_t[1], UP, buff=-0.1).shift(LEFT*0.2))
edges_t.add(TextMobject("7", color=BLUE_D, background_stroke_color=BLUE_D).next_to(edges_t[2], DOWN, buff=-0.5).shift(LEFT*0.15))
min_cut = DashedLine(np.array([2.5, 3, 0]), np.array([2.5, -3, 0]), color=DARK_GRAY)
comment = VGroup(
TextMobject("蓝-容量", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.7),
TextMobject("灰-最小割(最大流)", color=DARK_GRAY, background_stroke_color=DARK_GRAY).scale(0.7)
).arrange(DOWN, aligned_edge=LEFT).next_to(edges_s[3], DOWN, buff=0.8)
rec = SurroundingRectangle(comment, color=GRAY, buff=0.2)
problem = TextMobject("太空飞行计划问题", color=WHITE, background_stroke_color=WHITE)
problem.add_background_rectangle(color=GOLD_D, opacity=1, buff=0.15).next_to(edges_s[2], UP, buff=1)
author = TextMobject("by @鹤翔万里", background_stroke_color=ORANGE, opacity=0.8).scale(0.7).set_color(ORANGE).next_to(t[0], DOWN, buff=2)
label = VGroup(
TextMobject("报酬", color=GREEN, background_stroke_color=GREEN).scale(0.6).next_to(edges_s[2], UL, buff=0.1),
TextMobject("费用", color=GREEN, background_stroke_color=GREEN).scale(0.6).next_to(edges_t[3], UR, buff=0.1),
)
self.add(s, t, edges_s, edges_n, edges_t, nodes, min_cut, comment, rec, problem, author, label)
class NF24P3357(Scene_):
def construct(self):
axes = Axes(x_min=-0.5, x_max=8, y_min=-0.5, y_max=4, number_line_config={"color": BLACK}).center().shift(DOWN*0.5)
axes.add_coordinates(number_config={"color": BLACK})
line1 = Line(axes.c2p(1, 1), axes.c2p(1, 3), color=BLUE_D)
line1_ = Line(axes.c2p(2, 1), axes.c2p(3, 3), color=BLUE_D)
line2 = Line(axes.c2p(1, 1), axes.c2p(3, 3), color=GREEN_D)
line2_ = Line(axes.c2p(3, 1), axes.c2p(6, 3), color=GREEN_D)
dots = VGroup(
SmallDot(axes.c2p(1, 1), color=GRAY),
SmallDot(axes.c2p(1, 3), color=GRAY),
SmallDot(axes.c2p(2, 1), color=GRAY),
SmallDot(axes.c2p(3, 3), color=GRAY),
SmallDot(axes.c2p(3, 1), color=GRAY),
SmallDot(axes.c2p(6, 3), color=GRAY),
)
arrows = VGroup(
CurvedArrow(line1.get_center(), line1_.get_center(), color=RED, angle=-TAU/4).scale(0.9),
CurvedArrow(line2.get_center(), line2_.get_center(), color=RED).scale(0.9).shift(DL*0.2+LEFT*0.1),
)
changes = VGroup(
TexMobject("(x_1,x_1)\\rightarrow(2x_1, 2x_1+1)", color=MAROON, background_stroke_color=MAROON).scale(0.85),
TexMobject("(x_1,x_2)\\rightarrow(2x_1+1, 2x_2)", color=MAROON, background_stroke_color=MAROON).scale(0.85)
).arrange(DOWN, aligned_edge=LEFT).next_to(axes, UP, buff=-0.5)
dls = VGroup(
DashedLine(axes.c2p(2, 0), axes.c2p(2, 1), color=PURPLE),
DashedLine(axes.c2p(3, 0), axes.c2p(3, 3), color=PURPLE),
DashedLine(axes.c2p(6, 0), axes.c2p(6, 3), color=PURPLE),
)
braces = VGroup(
Brace(VGroup(Dot(axes.c2p(2, 0), radius=0.01), Dot(axes.c2p(3, 0), radius=0.01)), UP, color=DARK_GRAY),
Brace(VGroup(Dot(axes.c2p(3, 0), radius=0.01), Dot(axes.c2p(6, 0), radius=0.01)), UP, color=DARK_GRAY),
)
problem = TextMobject("最长$k$可重线段集问题", color=WHITE, background_stroke_color=WHITE)
problem.add_background_rectangle(color=GOLD_D, opacity=1, buff=0.15).move_to(np.array([-3, 3, 0]))
author = TextMobject("by @鹤翔万里", background_stroke_color=ORANGE, opacity=0.8).scale(0.7).set_color(ORANGE)
author.move_to(np.array([4, -1.5, 0]))
comment = TextMobject("化为开区间", color=DARK_GRAY, background_stroke_color=DARK_GRAY).scale(0.6).next_to(braces[-1], UP, buff=0.2)
dots2 = VGroup(
Dot(axes.c2p(2, 0), color=BLACK, radius=0.1),
Dot(axes.c2p(3, 0), color=BLACK, radius=0.1),
Dot(axes.c2p(6, 0), color=BLACK, radius=0.1),
)
self.add(axes, line1, line1_, line2, line2_, dls, dots, arrows, changes, braces, problem, author, comment, dots2)
class NF24P2754(Scene_):
def construct(self):
self.camera.set_frame_height(9)
self.camera.resize_frame_shape(1)
rad = 0.3
lis = [3, 1.8, 0.6, -0.6, -1.8, -3]
times = VGroup(
*[
VGroup(
TextMobject("time={}".format(i), color=GRAY, background_stroke_color=GRAY).scale(0.6),
DashedLine(np.array([-5, lis[i], 0]), np.array([5, lis[i], 0]), color=GRAY)
)
for i in range(6)
]
).shift(DL+UP*0.5)
for i in range(6):
times[i][0].next_to(times[i][1], LEFT)
nodes_0 = VGroup(
*[
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK, fill_color=WHITE, fill_opacity=1),
TextMobject("0\ 地", color=BLACK, background_stroke_color=BLACK).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([-3.6, i, 0]))
for i in lis
]
)
nodes_1 = VGroup(
*[
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=ORANGE, fill_color=WHITE, fill_opacity=1),
TextMobject("1\ 站", color=ORANGE, background_stroke_color=ORANGE).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([-1.2, i, 0]))
for i in lis
]
)
nodes_2 = VGroup(
*[
VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=ORANGE, fill_color=WHITE, fill_opacity=1),
TextMobject("2\ 站", color=ORANGE, background_stroke_color=ORANGE).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([1.2, i, 0]))
for i in lis
]
)
nodes_3 = VGroup(
*[
VGroup(
Circle(radius=rad, fill_color=BLACK, fill_opacity=1, stroke_color=BLACK).shift(LEFT*0.4).set_opacity(0),
RoundedRectangle(height=rad*2, width=1.4, corner_radius=rad, color=BLACK, fill_opacity=1),
TextMobject("-1\ 月", color=WHITE, background_stroke_color=WHITE).scale(0.75),
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=BLACK).shift(RIGHT*0.4).set_opacity(0)
).move_to(np.array([3.6, i, 0]))
for i in lis
]
)
nodes = VGroup(nodes_0, nodes_1, nodes_2, nodes_3).shift(DL+UP*0.5)
sw = 6
edges_0 = VGroup(
*[
Arrow(nodes_0[i][1].get_center(), nodes_0[i + 1][1].get_center(), color=BLACK, buff=rad, stroke_width=sw)
for i in range(5)
]
)
edges_1 = VGroup(
*[
Arrow(nodes_1[i][1].get_center(), nodes_1[i + 1][1].get_center(), color=ORANGE, buff=rad, stroke_width=sw)
for i in range(5)
]
)
edges_2 = VGroup(
*[
Arrow(nodes_2[i][1].get_center(), nodes_2[i + 1][1].get_center(), color=ORANGE, buff=rad, stroke_width=sw)
for i in range(5)
]
)
edges_3 = VGroup(
*[
Arrow(nodes_3[i + 1][1].get_center(), nodes_3[i][1].get_center(), color=BLACK, buff=rad, stroke_width=sw)
for i in range(5)
]
)
car_1 = VGroup(
Arrow(nodes[0][0][-1].get_center(), nodes[1][1][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
Arrow(nodes[1][1][-1].get_center(), nodes[2][2][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
Arrow(nodes[2][2][0].get_center(), nodes[0][3][-1].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.05).set_stroke(width=4),
Arrow(nodes[0][3][-1].get_center(), nodes[1][4][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
Arrow(nodes[1][4][-1].get_center(), nodes[2][5][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
)
car_2 = VGroup(
Arrow(nodes[1][0][-1].get_center(), nodes[2][1][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
Arrow(nodes[2][1][-1].get_center(), nodes[3][2][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
Arrow(nodes[3][2][0].get_center(), nodes[1][3][-1].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.05).set_stroke(width=4),
Arrow(nodes[1][3][-1].get_center(), nodes[2][4][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
Arrow(nodes[2][4][-1].get_center(), nodes[3][5][0].get_center(), buff=rad+0.03, color=BLUE_D, max_tip_length_to_length_ratio=0.1).set_stroke(width=4),
)
cars = VGroup(car_1, car_2)
labels = VGroup(
*[
TextMobject("1", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).add_background_rectangle(color=WHITE, opacity=0.8, buff=0.1)\
.move_to(car_1[i])
for i in range(5)
],
*[
TextMobject("1", color=BLUE_D, background_stroke_color=BLUE_D).scale(0.6).add_background_rectangle(color=WHITE, opacity=0.8, buff=0.1)\
.move_to(car_2[i])
for i in range(5)
],
)
s = VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=RED),
TextMobject("s", color=RED, background_stroke_width=0).scale(0.75)
).move_to(np.array([-6, 3.5, 0]))
t = VGroup(
Circle(radius=rad, fill_color=WHITE, fill_opacity=1, stroke_color=RED),
TextMobject("t", color=RED, background_stroke_width=0).scale(0.75)
).move_to(np.array([4, 3.5, 0]))
edge_s = Arrow(s[0].get_center() , nodes[0][0][0].get_center(), color=RED, buff=rad)
edge_t = Arrow(nodes[3][0][-1].get_center(), t[0].get_center(), color=RED, buff=rad)
problem = TextMobject("星际转移问题", color=WHITE, background_stroke_color=WHITE).scale(1.3)
problem.add_background_rectangle(color=GOLD_D, opacity=1, buff=0.15).next_to(nodes[1][0], UP, buff=0.5)
comment = VGroup(
TextMobject("未标记的边", color=GRAY, background_stroke_color=GRAY).scale(0.75),
TextMobject("容量为inf", color=BLUE, background_stroke_color=BLUE).scale(0.75)
).arrange(DOWN, aligned_edge=LEFT).move_to(np.array([5.5, -0.5, 0]))
rec = SurroundingRectangle(comment, color=GRAY, buff=0.2)
author = TextMobject("by @鹤翔万里", background_stroke_color=ORANGE, opacity=0.8).scale(0.7).set_color(ORANGE)
author.move_to(np.array([5.5, -2.5, 0]))
vdots = VGroup(
*[TexMobject("\\vdots", color=BLACK).scale(0.8) for i in range(4)]
)
for i in range(4):
vdots[i].next_to(nodes[i][-1], DOWN, buff=0.2)
edges = VGroup(edges_0, edges_1, edges_2, edges_3)
self.add(times, edges, cars, labels, edge_s, edge_t, nodes, s, t, problem, comment, rec, vdots, author)
class MosAlgoCompare1(Scene_):
def construct(self):
line = [
[-3.8, [-3, -1.8, -0.2, 0.2, 1.8, 2.2, 3.8]],
[-1.8, [-1, 0.2, 1.8, 2.2, 3.8]],
[0.2, [1.8, 2.2, 3.8]],
[2.2, [3, 3.8]]
]
lines = VGroup(
*[
VGroup(
*[
VGroup(
Line(i * RIGHT, j * RIGHT, color=BLACK),
Dot(i * RIGHT, color=DARK_GRAY, radius=0.05),
Dot(j * RIGHT, color=DARK_GRAY, radius=0.05),
) for j in k
]
).arrange(DOWN, False, buff=0.3, coor_mask=np.array([0, 1, 0]))
for i, k in line
]
).arrange(DOWN, buff=0.45, coor_mask=np.array([0, 1, 0]))
back = VGroup(
*[
DashedLine(np.array([i, 3.8, 0]), np.array([i, -3.8, 0]), color=GRAY)
for i in [-4, -2, 0, 2, 4]
]
)
lines1 = VGroup()
for group in lines:
for i, j in enumerate(group):
if j != group[-1]:
lines1.add(Line(j[-1].get_center(), group[i+1][-1].get_center(), color=RED).add_tip(0.15))
lines2 = VGroup()
for i, j in enumerate(lines):
if j != lines[-1]:
lines2.add(Line(j[-1][-1].get_center(), lines[i+1][0][-1].get_center(), color=BLUE_D).add_tip(0.15))
self.add(back, lines, lines1, lines2)
class MosAlgoCompare2(Scene_):
def construct(self):
line = [
[-3.8, [-3, -1.8, -0.2, 0.2, 1.8, 2.2, 3.8]],
[-1.8, [3.8, 2.2, 1.8, 0.2, -1]],
[0.2, [1.8, 2.2, 3.8]],
[2.2, [3.8, 3]]
]
lines = VGroup(
*[
VGroup(
*[
VGroup(
Line(i * RIGHT, j * RIGHT, color=BLACK),
Dot(i * RIGHT, color=DARK_GRAY, radius=0.05),
Dot(j * RIGHT, color=DARK_GRAY, radius=0.05),
) for j in k
]
).arrange(DOWN, False, buff=0.3, coor_mask=np.array([0, 1, 0]))
for i, k in line
]
).arrange(DOWN, buff=0.45, coor_mask=np.array([0, 1, 0]))
back = VGroup(
*[
DashedLine(np.array([i, 3.8, 0]), np.array([i, -3.8, 0]), color=GRAY)
for i in [-4, -2, 0, 2, 4]
]
)
lines1 = VGroup()
for group in lines:
for i, j in enumerate(group):
if j != group[-1]:
lines1.add(Line(j[-1].get_center(), group[i+1][-1].get_center(), color=RED).add_tip(0.15))
lines2 = VGroup()
for i, j in enumerate(lines):
if j != lines[-1]:
lines2.add(Line(j[-1][-1].get_center(), lines[i+1][0][-1].get_center(), color=BLUE_D).add_tip(0.15))
self.add(back, lines, lines1, lines2)
class RollBackMosAlgo(Scene_):
def construct(self):
line = [
[-3.6, -0.4],
[-2.4, 0.4],
[-3.6, 2.4],
[-2.4, 3.6]
]
lines = VGroup(
*[
VGroup(
Line(i * RIGHT, j * RIGHT, color=BLACK),
Dot(i * RIGHT, color=DARK_GRAY, radius=0.05),
Dot(j * RIGHT, color=DARK_GRAY, radius=0.05),
)
for i, j in line
]
).arrange(DOWN, buff=0.5, coor_mask=np.array([0, 1, 0]))
back = VGroup(
*[
DashedLine(np.array([i, 3.8, 0]), np.array([i, -3.8, 0]), color=GRAY)
for i in [-4, -2, 0, 2, 4]
]
)
s = np.array([-2, 1.5, 0])
# self.add(Dot(s, color=BLACK))
l = VGroup(
Line(s, lines[0][1].get_center(), color=ORANGE),
Line(lines[0][1].get_center(), np.array([-2, lines[0][1].get_center()[1], 0]), color=ORANGE),
Line(np.array([-2, lines[0][1].get_center()[1], 0]), lines[1][1].get_center(), color=ORANGE),
Line(lines[1][1].get_center(), np.array([-2, lines[1][1].get_center()[1], 0]), color=ORANGE),
Line(np.array([-2, lines[1][1].get_center()[1], 0]), lines[2][1].get_center(), color=ORANGE),
Line(lines[2][1].get_center(), np.array([-2, lines[2][1].get_center()[1], 0]), color=ORANGE),
Line(np.array([-2, lines[2][1].get_center()[1], 0]), lines[3][1].get_center(), color=ORANGE),
Line(lines[3][1].get_center(), np.array([-2, lines[3][1].get_center()[1], 0]), color=ORANGE),
)
for each in l:
each.add_tip(0.2)
r = VGroup(
Line(s, lines[0][2].get_center(), color=BLUE_D),
Line(lines[0][2].get_center(), lines[1][2].get_center(), color=BLUE_D),
Line(lines[1][2].get_center(), lines[2][2].get_center(), color=BLUE_D),
Line(lines[2][2].get_center(), lines[3][2].get_center(), color=BLUE_D),
)
for each in r:
each.add_tip(0.2)
self.add(lines, back, l, r)
| 55.611219
| 164
| 0.569685
| 4,322
| 28,751
| 3.627025
| 0.046044
| 0.060857
| 0.081717
| 0.039296
| 0.823743
| 0.779025
| 0.745343
| 0.700561
| 0.658842
| 0.639194
| 0
| 0.064139
| 0.257069
| 28,751
| 516
| 165
| 55.718992
| 0.669757
| 0.001009
| 0
| 0.371663
| 0
| 0
| 0.011525
| 0.00195
| 0
| 0
| 0
| 0
| 0
| 1
| 0.014374
| false
| 0
| 0.002053
| 0
| 0.034908
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9465e34be736ebd72d4c8d3a9101f86925ab7d32
| 5,722
|
py
|
Python
|
Coursera/Google_IT_Automation_with_Python/01_Crash_Course_on_Python/Week_3/wk3_mod1_pquiz.py
|
ssolomon2020/Self_Study_Python_Training
|
b253093b185f4a0d98cb8565f5fcf2b0e4a99556
|
[
"MIT"
] | null | null | null |
Coursera/Google_IT_Automation_with_Python/01_Crash_Course_on_Python/Week_3/wk3_mod1_pquiz.py
|
ssolomon2020/Self_Study_Python_Training
|
b253093b185f4a0d98cb8565f5fcf2b0e4a99556
|
[
"MIT"
] | null | null | null |
Coursera/Google_IT_Automation_with_Python/01_Crash_Course_on_Python/Week_3/wk3_mod1_pquiz.py
|
ssolomon2020/Self_Study_Python_Training
|
b253093b185f4a0d98cb8565f5fcf2b0e4a99556
|
[
"MIT"
] | null | null | null |
# Specialization: Google IT Automation with Python
# Course 01: Crash Course with Python
# Week 3 Module Part 1 - Practice Quiz
# Student: Shawn Solomon
# Learning Platform: Coursera.org
# Scripting examples encountered during the Module Part 1 Practice Quiz:
# 02. Fill in the blanks to make the print_prime_factors function print all the prime factors of a number.
# A prime factor is a number that is prime and divides another without a remainder.
# def print_prime_factors(number):
# # Start with two, which is the first prime
# factor = ___
# # Keep going until the factor is larger than the number
# while factor <= number:
# # Check if factor is a divisor of number
# if number % factor == ___:
# # If it is, print it and divide the original number
# print(factor)
# number = number / factor
# else:
# # If it's not, increment the factor by one
# ___
# return "Done"
#
# print_prime_factors(100)
# # Should print 2,2,5,5
# # DO NOT DELETE THIS COMMENT
def print_prime_factors(number):
# Start with two, which is the first prime
factor = 2
# Keep going until the factor is larger than the number
while factor <= number:
# Check if factor is a divisor of number
if number % factor == 0:
# If it is, print it and divide the original number
print(factor)
number = number / factor
else:
# If it's not, increment the factor by one
factor += 1
return "Done"
print_prime_factors(100)
# Should print 2,2,5,5
# DO NOT DELETE THIS COMMENT
# 03. The following code can lead to an infinite loop. Fix the code so that it can finish successfully for all numbers.
# Note: Try running your function with the number 0 as the input, and see what you get!
# def is_power_of_two(n):
# # Check if the number can be divided by two without a remainder
# while n % 2 == 0:
# n = n / 2
# # If after dividing by two the number is 1, it's a power of two
# if n == 1:
# return True
# return False
#
#
# print(is_power_of_two(0)) # Should be False
# print(is_power_of_two(1)) # Should be True
# print(is_power_of_two(8)) # Should be True
# print(is_power_of_two(9)) # Should be False
def is_power_of_two(n):
# Check if the number can be divided by two without a remainder
while n % 2 == 0:
if n == 0:
return False
n = n / 2
# If after dividing by two the number is 1, it's a power of two
if n == 1:
return True
return False
print(is_power_of_two(0)) # Should be False
print(is_power_of_two(1)) # Should be True
print(is_power_of_two(8)) # Should be True
print(is_power_of_two(9)) # Should be False
# 04. Fill in the empty function so that it returns the sum of all the divisors of a number, without including it.
# A divisor is a number that divides into another without a remainder.
# def sum_divisors(n):
# sum = 0
# # Return the sum of all divisors of n, not including n
# return sum
#
# print(sum_divisors(0))
# # 0
# print(sum_divisors(3)) # Should sum of 1
# # 1
# print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18
# # 55
# print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51
# # 114
def sum_divisors(number):
sum = 0
divs = 1
while divs < number:
# Check if factor is a divisor of number
if number == 0:
return 0
if number % divs == 0:
# If it is, print it and divide the original number
sum = sum + divs
divs = divs + 1
else:
divs += 1
# Return the sum of all divisors of n, not including n
return sum
print(sum_divisors(0))
# 0
print(sum_divisors(3)) # Should sum of 1
# 1
print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18
# 55
print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51
# 114
# 05. The multiplication_table function prints the results of a number passed to it multiplied by 1 through 5.
# An additional requirement is that the result is not to exceed 25, which is done with the break statement.
# Fill in the blanks to complete the function to satisfy these conditions.
# def multiplication_table(number):
# # Initialize the starting point of the multiplication table
# multiplier = 1
# # Only want to loop through 5
# while multiplier <= 5:
# result = ___
# # What is the additional condition to exit out of the loop?
# if ___ :
# break
# print(str(number) + "x" + str(multiplier) + "=" + str(result))
# # Increment the variable for the loop
# ___ += 1
#
# multiplication_table(3)
# # Should print: 3x1=3 3x2=6 3x3=9 3x4=12 3x5=15
#
# multiplication_table(5)
# # Should print: 5x1=5 5x2=10 5x3=15 5x4=20 5x5=25
#
# multiplication_table(8)
# # Should print: 8x1=8 8x2=16 8x3=24
def multiplication_table(number):
# Initialize the starting point of the multiplication table
multiplier = 1
# Only want to loop through 5
while multiplier <= 5:
result = number * multiplier
# What is the additional condition to exit out of the loop?
if result > 25 :
break
print(str(number) + "x" + str(multiplier) + "=" + str(result))
# Increment the variable for the loop
multiplier += 1
multiplication_table(3)
# Should print: 3x1=3 3x2=6 3x3=9 3x4=12 3x5=15
multiplication_table(5)
# Should print: 5x1=5 5x2=10 5x3=15 5x4=20 5x5=25
multiplication_table(8)
# Should print: 8x1=8 8x2=16 8x3=24
| 32.327684
| 120
| 0.631772
| 889
| 5,722
| 3.979753
| 0.208099
| 0.023742
| 0.033917
| 0.033917
| 0.739683
| 0.702657
| 0.702657
| 0.702657
| 0.702657
| 0.702657
| 0
| 0.058737
| 0.285914
| 5,722
| 176
| 121
| 32.511364
| 0.807146
| 0.706746
| 0
| 0.081633
| 0
| 0
| 0.004405
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.081633
| false
| 0
| 0
| 0
| 0.204082
| 0.244898
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.