Saravanan666/pypi-org huggingface dataset:
Package: behaveml
BehaveMLMachine learning for animal behavior.Interprets pose-tracking files (currently only from DLC) and behavior annotations (currently only from BORIS) to train a behavior classifier, perform unsupervised learning, and other common analysis tasks.Installationpip install behavemlCan install optional extras with:pip install numpy, cython
pip install behaveml[all]This includes matplotlib, keras, and Linderman lab's state-space model package,ssm. Note that installing ssm requires cython and numpy for the build, so must be already present in the environment.QuickstartImportfrom glob import glob 
from behaveml import VideosetDataFrame, clone_metadata
from behaveml import compute_dl_probability_features, compute_mars_features
from behaveml.io import get_sample_data_pathsGather the DLC and BORIS tracking and annotation filestracking_files, boris_files = get_sample_data_paths()Setup some parametersframe_width = 20                 # (float) length of entire horizontal shot
frame_width_units = 'in'         # (str) units frame_width is given in
fps = 30                         # (int) frames per second
resolution = (1200, 1600)        # (tuple) HxW in pixelsCreate a parameter object and video datasetmetadata = clone_metadata(tracking_files, 
                          label_files = boris_files, 
                          frame_width = frame_width, 
                          fps = fps, 
                          frame_width_units = frame_width_units, 
                          resolution = resolution)

animal_renamer = {'adult': 'resident', 'juvenile':'intruder'}

dataset = VideosetDataFrame(metadata, animal_renamer=animal_renamer)Now create features on this datasetdataset.add_features(compute_dl_probability_features, 
                     featureset_name = '1dcnn', 
                     add_to_features = True)

dataset.add_features(compute_mars_features, 
                     featureset_name = 'MARS', 
                     add_to_features = True)Now access a features table, labels, and groups for learning withdataset.features, dataset.labels, dataset.groups. From here it's easy to use some ML libraries to predict behavior. For example:from sklearn.ensemble import ExtraTreesClassifier, RandomForestClassifier
from sklearn.model_selection import cross_val_predict
from sklearn.metrics import accuracy_score

model = RandomForestClassifier()
predictions = cross_val_predict(model, dataset.features, dataset.labels, dataset.groups)
score = accuracy_score(dataset.labels, predictions)FeaturesQuickly generate a movie
Package: behave-no-capture
behave is behavior-driven development, Python style.Behavior-driven development (or BDD) is an agile software development
technique that encourages collaboration between developers, QA and
non-technical or business participants in a software project.behaveuses tests written in a natural language style, backed up by Python
code.First,install *behave*.Now make a directory called “features/”.
In that directory create a file called “example.feature” containing:# -- FILE: features/example.featureFeature:Showing off behaveScenario:Run a simple testGivenwe have behave installedWhenwe implement5testsThenbehave will test them for us!Make a new directory called “features/steps/”.
In that directory create a file called “example_steps.py” containing:# -- FILE: features/steps/example_steps.pyfrombehaveimportgiven,when,then,step@given('we have behave installed')defstep_impl(context):pass@when('we implement{number:d}tests')defstep_impl(context,number):# -- NOTE: number is converted into integerassertnumber>1ornumber==0context.tests_count=number@then('behave will test them for us!')defstep_impl(context):assertcontext.failedisFalseassertcontext.tests_count>=0Run behave:$behaveFeature: Showing off behave # features/example.feature:2

  Scenario: Run a simple test          # features/example.feature:4
    Given we have behave installed     # features/steps/example_steps.py:4
    When we implement 5 tests          # features/steps/example_steps.py:8
    Then behave will test them for us! # features/steps/example_steps.py:13

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefinedNow, continue reading to learn how to get the most out ofbehave. To get started,
we recommend thetutorialand then thefeature testing languageandapireferences.More Informationbehave documentation:latest edition,stable edition,PDFbehave.example: Behave Examples and Tutorials (docs, executable examples).changelog(latest changes)
Package: behave-odoo
behave_odoobehave_odoo is a Python package that provides a collection of helper functions designed to simplify the process of writingbehavetests for Odoo 14. The package includes functions for navigating the Odoo interface, interacting with form fields, and performing common actions within the Odoo environment.InstallationTo install behave_odoo, usepip:pipinstallbehave-odooUsageTo use the behave_odoo in your project, simply import the functions you need:frombehave_odooimport(is_tree_view_by_column_name,login,navigate_menu,switch_module,click_button,set_text_field,set_select_field,set_autocomplete_field,ensure_readonly_mode,select_dropdown_item,switch_form_tab,get_first_fields_from_tree_view,)Or use it with prefix:importbehave_odooasbodoo@given('the user log in on the Odoo Instance')defstep_impl(context):bodoo.login(context)Refer to the package'sdocumentationfor detailed information on each function and how to use them in your tests.ContributingWe welcome contributions to the behave_odoo project. If you find a bug or would like to request a new feature, please open an issue on theproject's issue tracker. If you would like to contribute code, please fork the repository and submit a pull request.Licensebehave_odoo is released under the AGPL-3.0 License. See theLICENSEfile for more information.SupportIf you encounter any issues while using behave_odoo, please report them on the project's issue tracker.
Package: behave-pandas
behave-pandasUtility package for theBehaveBDD testing framework, to make converting gherkin tables
to and frompandasdata frames a breeze.Build StatusInstallationpipinstallbehave-pandasFeaturesEasily convert a Gherkin table into a pandas data frame with explicit dtype informationEasily convert a pandas data frame into a behave table that can be parsed by behave-pandasSupport converting data frames with multiple index levels either on columns or rowsHandle missing data for dtypes that support it.ChangelogSee the changelog here.APIThe behave-pandas api is extremely simple, and consists in two functions:frombehave_pandasimporttable_to_dataframe,dataframe_to_tableExampleFeature:Table printeras a testerI want to be able to create gherkin tables from existing data framesScenario:simple indexGivena gherkin table as input|str|float|str||index_col|float_col|str_col||egg|3.0|silly walks||spam|4.1|spanish inquisition||bacon|5.2|dead parrot|Whenconverted to a data frame using1row as column names and1column as indexAndprinted using data_frame_to_tableThenit prints a valid string copy pasteable into gherkin files"""| object    | float64   | object              || index_col | float_col | str_col             || egg       | 3.0       | silly walks         || spam      | 4.1       | spanish inquisition || bacon     | 5.2       | dead parrot         |"""Associated steps:frombehaveimport*frombehave_pandasimporttable_to_dataframe,dataframe_to_tableuse_step_matcher("parse")@given("a gherkin table as input")defstep_impl(context,):context.input=context.table@when('converted to a data frame using{column_levels:d}row as column names and{index_levels:d}column as index')defstep_impl(context,column_levels,index_levels):context.parsed=table_to_dataframe(context.input,column_levels=column_levels,index_levels=index_levels)@then("it prints a valid string copy pasteable into gherkin files")defstep_impl(context):assertcontext.result==context.text@step("printed using data_frame_to_table")defstep_impl(context):context.result=dataframe_to_table(context.parsed)Parsed dataframe:>>> context.parsed
           float_col              str_col
index_col
egg              3.0          silly walks
spam             4.1  spanish inquisition
bacon            5.2          dead parrot

>>> context.parsed.info()
<class 'pandas.core.frame.DataFrame'>
Index: 3 entries, egg to bacon
Data columns (total 2 columns):
float_col    3 non-null float64
str_col      3 non-null object
dtypes: float64(1), object(1)
memory usage: 72.0+ bytes
Package: behave-plain-color-formatter
behave-plain-color-formatterFormatter forbehavethat uses color but not fancy terminal repositioningInstallationpipinstallbehave-plain-color-formatterUsageYou can specify the formatter directly in the command line using the -f argument:behave-fbehave_plain_color_formatter:PlainColorFormatterorbehave--formatbehave_plain_color_formatter:PlainColorFormatterYou can also register the formatter to be available through a simple name:# -- FILE: behave.ini[behave.formatters]plain.color=behave_plain_color_formatter:PlainColorFormatterand the use it like:behave-fplain.color
Package: behave-plus
This project add one parameter –job_language or job_language in enviroment.py file to filter
steps <cn:AAA|en:BBB> format.
It bases on behave 1.2.6 version.behave is behavior-driven development, Python style.Behavior-driven development (or BDD) is an agile software development
technique that encourages collaboration between developers, QA and
non-technical or business participants in a software project.behaveuses tests written in a natural language style, backed up by Python
code.First,install *behave*.Now make a directory called “features/”.
In that directory create a file called “example.feature” containing:# -- FILE: features/example.featureFeature:Showing off behaveScenario:Run a simple testGivenwe have behave installedWhenwe implement5testsThenbehave will test them for us!Make a new directory called “features/steps/”.
In that directory create a file called “example_steps.py” containing:# -- FILE: features/steps/example_steps.pyfrombehaveimportgiven,when,then,step@given('we have behave installed')defstep_impl(context):pass@when('we implement{number:d}tests')defstep_impl(context,number):# -- NOTE: number is converted into integerassertnumber>1ornumber==0context.tests_count=number@then('behave will test them for us!')defstep_impl(context):assertcontext.failedisFalseassertcontext.tests_count>=0Run behave:$behaveFeature:Showingoffbehave# features/example.feature:2Scenario:Runasimpletest# features/example.feature:4Givenwehavebehaveinstalled# features/steps/example_steps.py:4Whenweimplement5tests# features/steps/example_steps.py:8Thenbehavewilltestthemforus!# features/steps/example_steps.py:131featurepassed,0failed,0skipped1scenariopassed,0failed,0skipped3stepspassed,0failed,0skipped,0undefinedNow, continue reading to learn how to get the most out ofbehave. To get started,
we recommend thetutorialand then thefeature testing languageandapireferences.More Informationbehave documentation:latest edition,stable edition,PDFbehave.example: Behave Examples and Tutorials (docs, executable examples).changelog(latest changes)
Package: behave-py3
behave is behavior-driven development, Python style.Behavior-driven development (or BDD) is an agile software development
technique that encourages collaboration between developers, QA and
non-technical or business participants in a software project.behaveuses tests written in a natural language style, backed up by Python
code.First,install *behave*.Now make a directory called “features/”.
In that directory create a file called “example.feature” containing:# -- FILE: features/example.featureFeature:Showing off behaveScenario:Run a simple testGivenwe have behave installedWhenwe implement5testsThenbehave will test them for us!Make a new directory called “features/steps/”.
In that directory create a file called “example_steps.py” containing:# -- FILE: features/steps/example_steps.pyfrombehaveimportgiven,when,then,step@given('we have behave installed')defstep_impl(context):pass@when('we implement{number:d}tests')defstep_impl(context,number):# -- NOTE: number is converted into integerassertnumber>1ornumber==0context.tests_count=number@then('behave will test them for us!')defstep_impl(context):assertcontext.failedisFalseassertcontext.tests_count>=0Run behave:$behaveFeature:Showinoffbehave# features/example.feature:2Scenario:Runasimpletest# features/example.feature:4Givenwehavebehaveinstalled# features/steps/example_steps.py:4Whenweimplement5tests# features/steps/example_steps.py:8Thenbehavewilltestthemforus!# features/steps/example_steps.py:131featurepassed,0failed,0skipped1scenariopassed,0failed,0skipped3stepspassed,0failed,0skipped,0undefinedNow, continue reading to learn how to the most ofbehave. To get started,
we recommend thetutorialand then thefeature testing languageandapireferences.More Informationbehave documentation(latest changes)behave.example: Behave Examples and Tutorials (docs, executable examples).Testing DomainsBehave and other BDD frameworks allow you to providestep librariesto reuse step definitions in similar projects that address the same
problem domain.Support of the following testing domains is currently known:Testing DomainNameDescriptionCommand-linebehave4cmdTest command-line tools, like behave, etc. (coming soon).Web Appsdjango-behaveTest Django Web apps with behave.Web, SMS, …behavingTest Web Apps, Email, SMS, Personas (step library).
Package: behave-rest
BDD-style Rest API testing toolIt uses python’srequestsfor performing HTTP requests,nosefor most assertions,trafaretfor json validation andbehavefor BDD style of tests.InstallationCloneprojectRunpip install -r requirements.txt # install required dependenciesORRunpip install behave_restRunning# to execute all feature files (all tests)
behave

# to execture specific feature
behave features/twitter.feature

# to see printed output add --no-capture
behave --no-capture

# run features with specific tags
behave --tags=without_login --tags=slowMore about behave tool you can read herehttps://pythonhosted.org/behave/index.htmlTest exampleFeature: Twitter search

  Background: Setup environment
    Given I set base URL to "https://api.twitter.com/1.1/search"
    And I set "Authorization" header to "context.twitter_auth"

  Scenario: Search for tweets
    When I make a GET request to "tweets.json" with parameters
    |q|
    |stanfy|
    Then the response status code should equal 200
    And the response structure should equal "twitterSearchData"
    And the response header "status" should equal "200 OK"You can get test feature files from theproject repoCI reportsBehave support JUnit reports, that are easily parsed by CI toolsTo enable JUnit reports, createbehave.inifile:[behave]
junit=trueReports are generated into/reportsfolderAnother useful options to add intobehave.iniare:stdout_capture=Falseto add printed output into reportsshow_timings=noto hide timing of each stepProject StructureFeature files are intended to locate in/featuresfolderCorresponding steps are located in/features/stepsOverall project structure is as follows:+-- features/

    +-- conf.yaml // store project config (urls, global variables, etc.)

    +-- environment.py // context setup steps (e.g. load from config)

    +-- *.feature // feature files

    +-- steps/

        +-- __init__.py // used to import predefined steps

        +-- json_responses.py // response structures described in Trafaret format

        +-- *.py // steps related to corresponding feature (e.g. "login.py" contains steps that are related to "login.feature")
Package: behave-testrail-reporter
Behave to TestRail ReporterThis integration is used to add test results to TestRail automatically when Behave tests are executed.Example of the generated report:3 testrail test cases passed, 0 failed, 19 skipped, 2 untested
Took 0m6.349sInstallCan install it using pipenv$ pipenv install behave-testrail-reporteror using pip$ pip install behave-testrail-reporterSetupAddTestrailReporterto behave reporters in your/features/environment.pyby adding this code inbefore_all()frombehave_testrail_reporterimportTestrailReporterdefbefore_all(context):# ... all your other awesome code in herecurrent_branch=os.environ.get('CIRCLE_BRANCH')# Change this to get the current build branch of your CI systemtestrail_reporter=TestrailReporter(current_branch)context.config.reporters.append(testrail_reporter)Create atestrail.ymlconfig file in the root of your projectExample structure:base_url:https://your-domain.testrail.ioprojects:-name:'Advancedtestsonbranch{branch}'id:123suite_id:456# note: this will allow any branch to push test case results to Testrail.allowed_branch_pattern:'.*'-name:'Smoketestsonbranch{branch}'id:1234suite_id:789# note: this will allow any branch to push test case results to Testrail.allowed_branch_pattern:'.*'Allow onlymasterbranch andrelease1.111.1to push test results to Testrail:base_url:https://your-domain.testrail.ioprojects:-name:'FullE2Etestsonbranch{branch}'id:123suite_id:456allowed_branch_pattern:'^(master|release\/\d+([\.\d]+)?)$'yaml keyDescriptionnameProject nameidTestrail project idsuite_idTestrail Suite idallowed_branch_patternRegular expression to restrict when a test run is executedname- You can use some project variables to create dynamic test run namesVariableExampleResult{project_id}'Test run {project_id}'Test run 123{suite_id}'Test run {suite_id}'Test run 456{branch}'Test run {branch}'Test run masterEnvironment variables requiredVariable nameDescriptionTESTRAIL_KEYTestRail user passwordTESTRAIL_USERTestRail user email addressHow to useTo get test cases marked as success or fail on TestRail we have to add tags with TestRail test case ID
on each scenario.Test case tag structure:prefix+test case id@testrail-+C1104See example below:Feature:Log in and outBackground:GivenI am logged out from HubAndI navigate to the home page@testrail-C1104@testrail-C45933Scenario:Admin can loginWhenI enter the username adminAndI enter the password adminAndI click the Login buttonThenI see the admin's landing pageNote: some scenarios can cover multiple TestRail cases, for that you just need to add multiple tags.How to contributeInstall dependencies for developmentpipenv install --devHow to run testsActivate your virtual environment and then just run tox.toxHow to distributeIf you need to publish a new version of this package you can use this command:python setup.py sdist bdist_wheel
twine upload dist/*LicenseLicensed underMIT license. Viewlicense.
Package: behave-web-api
Provides testing for JSON APIs with Behave[1]Installationpip install behave-web-apiImport steps in your features/steps/__init__.pyfrombehave_web_api.stepsimport*So you can use the steps in your feature filesFeature:Doing http requestsScenario:Send text body and headersGivenI set header "X-My-Header" with value "Something"AndI set header "Content-Type" with value "application/json"WhenI send a POST request to "/requests/echo" with body:"""{
        "a": 1,
        "b": "",
        "c": "0101",
        "d": "[01]+"
    }"""Thenthe response code should be200Andthe response should contain json:"""{
            "headers": {
                "X-My-Header": "Something"
            },
            "body": {
                "a": "<is_number>",
                "b": "%.*%",
                "c": "%[01]+%",
                "d": "[01]+"
            }
        }"""Scenario:Send file using variables and environment variablesGivenI set the variable "DATA_DIR" with value "$PWD/features/data"AndI attach the file "$DATA_DIR/favicon.ico" as "upload"WhenI send a POST request to "/requests/echo"Thenthe response code should be200Andprint responseAnd run using BASE_URL environment variable:BASE_URL=localhost:5000 behave features/requests.featureAvailable StepsGiven I set variable “{}” with value “{}”Given I set header “{}” with value “{}”Given I attach the file “{}” as “{}”When I send a {} request to “{}” with body:When I send a {} request to “{}” with values:When I send a {} request to “{}”Then the response code should be {}Then the response should contain json:Then the response should contain text:Then print responseAcknowledgmentsThe REST steps are based on Behat WebApiExtension[2][1]http://pythonhosted.org/behave/[2]https://github.com/Behat/WebApiExtension
Package: behave-xray
behave-xrayInstallation$pipinstall-Ubehave-xrayor from the source:$pythonsetup.pyinstallUsageAdd JIRA tags to Gherkin scenario:# --FILE: tutorial.feature@jira.test_plan('JIRA-3')Feature:showing off behaveFeature's description@jira.testcase('JIRA-1')Scenario:run a simple testGivenwe have behave installedWhenwe implement a testThenbehave will test it for us!@jira.testcase('JIRA-2')Scenario Outline:Add two numbers in CalcGivenCalculator is openWhenI add<a>and<b>Thenresult is<result>Examples:Sum|a|b|result||3|4|7||6|10|18|This library also supports the feature filesexported from Xray Cucumber tests:Feature:showing off behaveFeature's description@TEST_JIRA-1Scenario:run a simple testGivenwe have behave installedWhenwe implement a testThenbehave will test it for us!@TEST_JIRA-2Scenario Outline:Add two numbers in CalcGivenCalculator is openWhenI add<a>and<b>Thenresult is<result>Examples:Sum|a|b|result||3|4|7||6|10|18|Configure Jira URL and authenticationSet Jira server API base URL in system environments:$exportXRAY_API_BASE_URL=<jiraURL>Set system environments forbasic authentication:$exportXRAY_API_USER=<jriausername>
$exportXRAY_API_PASSWORD=<userpassword>Set system environments forPersonal Access Tokensauthentication:$exportXRAY_TOKEN=<Xraytoken>Set system environments for Could server authentication withClient ID and Client Secret:$exportXRAY_CLIENT_ID=<Xrayclientid>
$exportXRAY_CLIENT_SECRET=<Xrayclientsecret>Run testsRun tests againstJira Xray Server+DC:$behave-fbehave_xray:XrayFormatterRun tests againstJira Xray Cloudserver:$behave-fbehave_xray:XrayCloudFormatterYou can register formatter inbehave.ini:# -- FILE: behave.ini[behave.formatters]xray=behave_xray:XrayCloudFormatterand use with shorter name:$behave--fxrayAttach an evidence to the scenarioOne can implementscenario_xray_resulthook to update results for a scenario.# - FILE: environment.pyfrombehave.modelimportStatusfrombehave_xrayimporthookimplfrombehave_xray.evidenceimporttext@hookimpldefscenario_xray_result(result,scenario):ifscenario.status==Status.failed:result.evidences.append(text(data='This is scenario evidence',filename=f'{scenario.name}.txt'))Customize reportAdd summary to a report:$behave-fbehave_xray:XrayCloudFormatter-Dxray.summary='Report generated by behave'or frombehave.inifile:# -- FILE: behave.ini[behave.userdata]xray.summary=Report generated by behaveAvailable options:xray.summaryxray.userxray.versionxray.revision
Package: behavior-machine
Behavior_MachineCopyright - Transportation, Bots, and Disability Lab, Carnegie Mellon UniversityReleased under MIT LicenseThis is an implementation of a hierarchical state machine but with additional behavior-tree like features (Sequential, Parallal, etc). Unlike behavior trees, the execution of each state is independent of the tick (A repeative signal generated from the root). The transition of the state are determined by the machine's tick but can be set at different levelsIllustrative Example:from behavior_machine.core import State, Machine
from behavior_machine.library import PrintState, SequentialState, IdleState


ps1 = PrintState("ps1", "Hello World 1")
ps2 = PrintState("ps2", "Hello World 2")
is1 = IdleState("is1")
ps3 = PrintState("ps3", "Hello World 3")

ss = SequentialState("ss", children=[ps1, ps2])
ss.add_transition_on_success(ps3)

m1 = Machine("m1", ss, rate=10)
m1.add_transition(lambda state, board: state._curr_state._name == "ps3", is1)
m2 = Machine("m2", m1, end_state_ids=['is1'], rate=10)
m2.run()DocumentationYou can view more detailed documentation by following thislink