text
stringlengths
0
1.05M
meta
dict
from flex.decorators import rewrite_reserved_words from flex.exceptions import ( MultipleParametersFound, NoParameterFound, ) from flex.utils import dereference_reference @rewrite_reserved_words def is_match(parameter, **kwargs): for key, value in kwargs.items(): if key not in parameter: ...
{ "repo_name": "pipermerriam/flex", "path": "flex/parameters.py", "copies": "1", "size": "1594", "license": "mit", "hash": 8842950974416794000, "line_mean": 27.4642857143, "line_max": 76, "alpha_frac": 0.6712672522, "autogenerated": false, "ratio": 4.331521739130435, "config_test": false, "has...
from flex.error_messages import MESSAGES from flex.exceptions import ValidationError from flex.constants import ( EMPTY, INTEGER, STRING, ) from flex.utils import pluralize from flex.validation.common import ( generate_object_validator, ) from flex.decorators import ( pull_keys_from_obj, suffix_...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/max_length.py", "copies": "1", "size": "1274", "license": "mit", "hash": -4340689488546424000, "line_mean": 25, "line_max": 92, "alpha_frac": 0.6844583987, "autogenerated": false, "ratio": 3.4619565217391304, "config_test": false, ...
from flex.exceptions import ( ValidationError, ErrorList, ) from flex.constants import ( NULL, BOOLEAN, INTEGER, NUMBER, STRING, ARRAY, FILE, ) from flex.utils import ( pluralize, ) from flex.validation.common import ( generate_object_validator, ) from flex.decorators import ...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/single_parameter/type.py", "copies": "1", "size": "1412", "license": "mit", "hash": 4999768941174952000, "line_mean": 18.8873239437, "line_max": 76, "alpha_frac": 0.6331444759, "autogenerated": false, "ratio": 3.68668407310705, "co...
from flex.exceptions import ( ValidationError, ErrorList, ) from flex.constants import ( NULL, BOOLEAN, INTEGER, NUMBER, STRING, ARRAY, OBJECT, ) from flex.utils import ( pluralize, ) from flex.validation.common import ( generate_object_validator, ) from flex.decorators impor...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/schema/type.py", "copies": "1", "size": "1416", "license": "mit", "hash": -7327857833822817000, "line_mean": 18.9436619718, "line_max": 76, "alpha_frac": 0.634180791, "autogenerated": false, "ratio": 3.677922077922078, "config_test...
from flex.exceptions import ValidationError from flex.constants import ( INTEGER, NUMBER, EMPTY, BOOLEAN, ) from flex.utils import ( pluralize, ) from flex.error_messages import MESSAGES from flex.validation.common import ( generate_object_validator, ) from flex.decorators import ( suffix_re...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/minimum.py", "copies": "1", "size": "1367", "license": "mit", "hash": -324135418392130000, "line_mean": 23.8545454545, "line_max": 92, "alpha_frac": 0.6986100951, "autogenerated": false, "ratio": 3.684636118598383, "config_test": f...
from flex.exceptions import ValidationError from flex.context_managers import ErrorDict from flex.validation.operation import ( construct_operation_validators, validate_operation, ) from flex.validation.common import ( validate_request_method_to_operation, validate_path_to_api_path, ) def validate_req...
{ "repo_name": "pipermerriam/flex", "path": "flex/validation/request.py", "copies": "1", "size": "2198", "license": "mit", "hash": 1332161426541184000, "line_mean": 32.8153846154, "line_max": 94, "alpha_frac": 0.6155595996, "autogenerated": false, "ratio": 4.8307692307692305, "config_test": fals...
from flex.exceptions import ValidationError from flex.error_messages import MESSAGES from flex.constants import ( BOOLEAN, ARRAY, ) from flex.utils import pluralize from flex.validation.common import ( generate_object_validator, ) from flex.validation.schema import ( construct_schema_validators, ) from ...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/unique_items.py", "copies": "1", "size": "1061", "license": "mit", "hash": -4806406074359830000, "line_mean": 23.6744186047, "line_max": 78, "alpha_frac": 0.7106503299, "autogenerated": false, "ratio": 3.608843537414966, "config_te...
from flex.exceptions import ValidationError from flex.error_messages import MESSAGES from flex.constants import ( INTEGER, EMPTY, ARRAY, ) from flex.utils import pluralize from flex.validation.common import ( generate_object_validator, ) from flex.validation.schema import ( construct_schema_validato...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/max_items.py", "copies": "1", "size": "1341", "license": "mit", "hash": 1714242171670297900, "line_mean": 25.2941176471, "line_max": 88, "alpha_frac": 0.6927665921, "autogenerated": false, "ratio": 3.4740932642487046, "config_test"...
from flex.exceptions import ValidationError from flex.error_messages import MESSAGES from flex.constants import ( INTEGER, EMPTY, OBJECT, ) from flex.utils import pluralize from flex.validation.common import ( generate_object_validator, ) from flex.validation.schema import ( construct_schema_validat...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/schema/max_properties.py", "copies": "1", "size": "1616", "license": "mit", "hash": 3160091712169656000, "line_mean": 29.4905660377, "line_max": 85, "alpha_frac": 0.6503712871, "autogenerated": false, "ratio": 4.08080808080808, "co...
from flex.exceptions import ValidationError from flex.error_messages import MESSAGES from flex.constants import ( INTEGER, NUMBER, EMPTY, BOOLEAN ) from flex.utils import ( pluralize, ) from flex.validation.common import ( generate_object_validator, ) from flex.decorators import ( pull_keys_...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/maximum.py", "copies": "1", "size": "1652", "license": "mit", "hash": -2447328980961844000, "line_mean": 24.8125, "line_max": 92, "alpha_frac": 0.6930992736, "autogenerated": false, "ratio": 3.7889908256880735, "config_test": false...
from flex.exceptions import ValidationError from flex.error_messages import MESSAGES from flex.constants import ( INTEGER, OBJECT, ) from flex.utils import pluralize from flex.validation.common import ( generate_object_validator, ) from flex.validation.schema import ( construct_schema_validators, ) from...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/schema/min_properties.py", "copies": "1", "size": "1060", "license": "mit", "hash": -1789541669094902300, "line_mean": 25.5, "line_max": 82, "alpha_frac": 0.7188679245, "autogenerated": false, "ratio": 3.6805555555555554, "config_t...
from flex.exceptions import ValidationError from flex.error_messages import MESSAGES from flex.constants import ( STRING, PARAMETER_IN_VALUES, PATH, BODY, EMPTY, ) from flex.validation.common import ( generate_object_validator, ) from flex.decorators import ( pull_keys_from_obj, suffix_r...
{ "repo_name": "pipermerriam/flex", "path": "flex/loading/common/single_parameter/in_.py", "copies": "1", "size": "1436", "license": "mit", "hash": -8016222090286530000, "line_mean": 25.1090909091, "line_max": 94, "alpha_frac": 0.6796657382, "autogenerated": false, "ratio": 3.33953488372093, "co...
from flexget.api.app import base_message from flexget.api.core.plugins import ObjectsContainer as OC from flexget.utils import json class TestPluginsAPI: config = 'tasks: {}' def test_plugins_api(self, api_client, schema_match): rsp = api_client.get('/plugins/') assert rsp.status_code == 200,...
{ "repo_name": "Flexget/Flexget", "path": "flexget/tests/api_tests/test_plugins_api.py", "copies": "3", "size": "2699", "license": "mit", "hash": -6348832221400166000, "line_mean": 36.4861111111, "line_max": 78, "alpha_frac": 0.625416821, "autogenerated": false, "ratio": 3.523498694516971, "conf...
from flexget.api.app import base_message from flexget.api.core.user import ObjectsContainer as OC from flexget.utils import json class TestUserAPI: config = 'tasks: {}' def test_change_password(self, execute_task, api_client, schema_match): weak_password = {'password': 'weak'} medium_password...
{ "repo_name": "Flexget/Flexget", "path": "flexget/tests/api_tests/test_user_api.py", "copies": "3", "size": "1468", "license": "mit", "hash": 1258101623383116000, "line_mean": 34.8048780488, "line_max": 77, "alpha_frac": 0.6376021798, "autogenerated": false, "ratio": 3.5458937198067635, "config...
from flexget.api.app import base_message from flexget.components.history.api import ObjectsContainer as OC from flexget.components.history.db import History from flexget.manager import Session from flexget.utils import json class TestHistoryAPI: config = "{'tasks': {}}" def test_history(self, api_client, sch...
{ "repo_name": "ianstalk/Flexget", "path": "flexget/tests/api_tests/test_history_api.py", "copies": "3", "size": "7200", "license": "mit", "hash": 2742678576750853000, "line_mean": 30.3043478261, "line_max": 78, "alpha_frac": 0.5597222222, "autogenerated": false, "ratio": 3.8318254390633317, "co...
from flexget.api import APIResource, api from flexget.api.app import base_message_schema, success_response schema_api = api.namespace( 'format_check', description='Test Flexget custom schema format validations' ) class ObjectContainer: format_checker_input = { 'type': 'object', 'properties': ...
{ "repo_name": "malkavi/Flexget", "path": "flexget/api/core/format_checker.py", "copies": "2", "size": "1580", "license": "mit", "hash": 6187390256382349000, "line_mean": 39.5128205128, "line_max": 96, "alpha_frac": 0.5848101266, "autogenerated": false, "ratio": 3.816425120772947, "config_test":...
from flexget.components.managed_lists.lists.movie_list.api import ObjectsContainer as OC from flexget.utils import json class TestETAG: config = 'tasks: {}' def test_etag(self, api_client, schema_match): # Test ETag creation and usage # Create movie lists list_1 = {'name': 'list_1'} ...
{ "repo_name": "Flexget/Flexget", "path": "flexget/tests/api_tests/test_etag.py", "copies": "3", "size": "2371", "license": "mit", "hash": 5660320131921077000, "line_mean": 37.868852459, "line_max": 88, "alpha_frac": 0.5934204977, "autogenerated": false, "ratio": 3.502215657311669, "config_test"...
from flexget.components.managed_lists.lists.pending_list.db import PendingListList from flexget.manager import Session class TestListInterface: config = """ templates: global: disable: [seen] tasks: list_get: pending_list: test_list list_get_...
{ "repo_name": "Flexget/Flexget", "path": "flexget/tests/test_pending_list.py", "copies": "1", "size": "3049", "license": "mit", "hash": -6093536745871724000, "line_mean": 28.8921568627, "line_max": 82, "alpha_frac": 0.526402099, "autogenerated": false, "ratio": 4.087131367292225, "config_test":...
from flexget.components.variables.variables import Variables from flexget.manager import Session from flexget.utils import json class TestVariablesAPI: config = 'tasks: {}' variables_dict = {'test_variable_db': True} def test_variables_get(self, api_client): with Session() as session: ...
{ "repo_name": "malkavi/Flexget", "path": "flexget/tests/api_tests/test_variables_api.py", "copies": "3", "size": "1727", "license": "mit", "hash": 3342768241605145600, "line_mean": 42.175, "line_max": 97, "alpha_frac": 0.6218876665, "autogenerated": false, "ratio": 3.3862745098039215, "config_t...
from flexget.entry import Entry, register_lazy_lookup from flexget.plugin import PluginError @register_lazy_lookup('lazy_a') def lazy_a(entry): if 'fail' in entry: raise PluginError('oh no!') for f in ['a_field', 'ab_field', 'a_fail']: entry[f] = 'a' @register_lazy_lookup('lazy_b') def lazy_...
{ "repo_name": "Flexget/Flexget", "path": "flexget/tests/test_lazy_fields.py", "copies": "3", "size": "1528", "license": "mit", "hash": 4180245095680235000, "line_mean": 35.380952381, "line_max": 99, "alpha_frac": 0.5896596859, "autogenerated": false, "ratio": 3.5288683602771362, "config_test": ...
from flexget import options from flexget.event import event from flexget.manager import Session from flexget.terminal import TerminalTable, TerminalTableError, console, table_parser from . import db def do_cli(manager, options): if options.action == 'clear': num = db.clear_entries(options.task, all=True)...
{ "repo_name": "Flexget/Flexget", "path": "flexget/components/backlog/cli.py", "copies": "3", "size": "1395", "license": "mit", "hash": 546965848051103170, "line_mean": 34.7692307692, "line_max": 99, "alpha_frac": 0.6164874552, "autogenerated": false, "ratio": 3.951841359773371, "config_test": f...
from flexget import options from flexget.event import event from flexget.terminal import console from flexget.utils.database import with_session from flexget.webserver import WeakPassword, change_password, generate_token, get_user @with_session def do_cli(manager, options, session=None): if options.action == 'pas...
{ "repo_name": "Flexget/Flexget", "path": "flexget/plugins/cli/web.py", "copies": "3", "size": "1306", "license": "mit", "hash": -343943804757006460, "line_mean": 35.2777777778, "line_max": 87, "alpha_frac": 0.6891271057, "autogenerated": false, "ratio": 4.08125, "config_test": false, "has_no_...
from flexget import options from flexget.event import event from flexget.terminal import TerminalTable, TerminalTableError, console, table_parser from flexget.utils.template import get_template, list_templates def list_file_templates(manager, options): header = ['Name', 'Use with', 'Full Path', 'Contents'] ta...
{ "repo_name": "Flexget/Flexget", "path": "flexget/plugins/cli/templates.py", "copies": "3", "size": "1591", "license": "mit", "hash": 1649782827353000200, "line_mean": 34.3555555556, "line_max": 85, "alpha_frac": 0.6279069767, "autogenerated": false, "ratio": 4.100515463917525, "config_test": f...
from flexget import options, plugin from flexget.event import event from flexget.manager import Session from flexget.terminal import TerminalTable, TerminalTableError, console, table_parser from . import db def action_auth(options): if not (options.account): console( 'You must specify an acco...
{ "repo_name": "ianstalk/Flexget", "path": "flexget/components/trakt/cli.py", "copies": "3", "size": "4480", "license": "mit", "hash": -1209272936341341200, "line_mean": 32.1851851852, "line_max": 104, "alpha_frac": 0.6029017857, "autogenerated": false, "ratio": 4.299424184261037, "config_test":...
from flexget import options, plugin from flexget.event import event from flexget.terminal import TerminalTable, TerminalTableError, console, table_parser from flexget.utils.database import with_session from . import db try: # NOTE: Importing other plugins is discouraged! from flexget.components.imdb.utils imp...
{ "repo_name": "Flexget/Flexget", "path": "flexget/components/seen/cli.py", "copies": "1", "size": "3761", "license": "mit", "hash": 2834679207905315300, "line_mean": 34.4811320755, "line_max": 93, "alpha_frac": 0.632544536, "autogenerated": false, "ratio": 3.6800391389432487, "config_test": fal...
from flexget import plugin from flexget.event import event from . import db from . import series as plugin_series class FilterSeriesPremiere(plugin_series.FilterSeriesBase): """ Accept an entry that appears to be the first episode of any series. Can be configured with any of the options of series plugin...
{ "repo_name": "Flexget/Flexget", "path": "flexget/components/series/series_premiere.py", "copies": "3", "size": "3736", "license": "mit", "hash": 5193975493005425000, "line_mean": 37.5154639175, "line_max": 95, "alpha_frac": 0.5808351178, "autogenerated": false, "ratio": 4.458233890214797, "con...
from flexget.manager import Session from flexget.plugins.filter.upgrade import EntryUpgrade class TestUpgrade: config = """ tasks: first_download: accept_all: yes upgrade: tracking: yes mock: - {title: 'Movie.720p.WEB-DL.X264.AC3-GR...
{ "repo_name": "Flexget/Flexget", "path": "flexget/tests/test_upgrade.py", "copies": "3", "size": "9539", "license": "mit", "hash": 8755998104839221000, "line_mean": 40.4739130435, "line_max": 94, "alpha_frac": 0.5811929972, "autogenerated": false, "ratio": 3.518627812615271, "config_test": true...
from flexget.plugin import get_plugin_by_name class TestURLRewriters: """ Bad example, does things manually, you should use task.find_entry to check existance """ config = """ tasks: test: # make test data mock: - {title: 'tpb page', url: 'h...
{ "repo_name": "malkavi/Flexget", "path": "flexget/tests/test_urlrewriting.py", "copies": "1", "size": "3658", "license": "mit", "hash": 1563985360150615300, "line_mean": 39.1978021978, "line_max": 110, "alpha_frac": 0.6030617824, "autogenerated": false, "ratio": 3.43796992481203, "config_test":...
from flexget.plugins.filter.movie_queue import queue_add, queue_get from tests import FlexGetBase class TestMovieQueue(FlexGetBase): __yaml__ = """ templates: global: mock: - {title: 'MovieInQueue', imdb_id: 'tt1931533', tmdb_id: 603, movie_name: MovieInQueue} ...
{ "repo_name": "offbyone/Flexget", "path": "tests/test_movie_queue.py", "copies": "12", "size": "2746", "license": "mit", "hash": 1057269464792644500, "line_mean": 29.1758241758, "line_max": 102, "alpha_frac": 0.5782957028, "autogenerated": false, "ratio": 3.5341055341055343, "config_test": true...
from flexible_permissions.models import Permission from flexible_permissions.roles import register_role from tests.models import User, Group, Zoo, Exhibit, Animal def create_test_models(): users = { 'admin': User.objects.create(name='admin user'), 'staff': User.objects.create(name='staff user'), ...
{ "repo_name": "staab/django-flexible-permissions", "path": "tests/utils.py", "copies": "1", "size": "1087", "license": "mit", "hash": 5063708800724455000, "line_mean": 30.0571428571, "line_max": 74, "alpha_frac": 0.6540938362, "autogenerated": false, "ratio": 3.334355828220859, "config_test": f...
from flexible_permissions._utils import ensure_plural, is_value """ Maps of roles to actions """ ROLES = {} ACTIONS = {} def calculate_actions(roles): result = {} for role, actions in roles.items(): for action in actions: result.setdefault(action, []) result[action].append(ro...
{ "repo_name": "staab/django-flexible-permissions", "path": "flexible_permissions/roles.py", "copies": "1", "size": "1395", "license": "mit", "hash": 7471720684500376000, "line_mean": 23.9107142857, "line_max": 78, "alpha_frac": 0.6229390681, "autogenerated": false, "ratio": 4.067055393586005, "...
from flexmock import flexmock from django.test import TestCase from django.contrib.auth.models import User from nose.tools import raises from tardis.tardis_portal.models import Experiment, ParameterName, Schema, ExperimentParameter, ExperimentParameterSet from tardis.apps.sync.consumer_fsm import Complete, InProgress...
{ "repo_name": "iiman/mytardis", "path": "tardis/apps/sync/tests/test_managers.py", "copies": "1", "size": "4691", "license": "bsd-3-clause", "hash": -6908066531166342000, "line_mean": 37.4508196721, "line_max": 125, "alpha_frac": 0.6346194841, "autogenerated": false, "ratio": 3.9026622296173046, ...
from flexmock import flexmock from framework.db.db import DB import framework.db.db_handler as db_handler from collections import defaultdict from framework.lib import general class DBEnvironmentBuilder(): def build(self): self._create_core_mock() db = flexmock(DB(self.core_mock)) flexmoc...
{ "repo_name": "mikefitz888/owtf", "path": "tests/testing_framework/db/environments.py", "copies": "3", "size": "1709", "license": "bsd-3-clause", "hash": 1307279346603690000, "line_mean": 43.9736842105, "line_max": 152, "alpha_frac": 0.5933294324, "autogenerated": false, "ratio": 3.31844660194174...
from flexmock import flexmock from os import path from framework.shell.interactive_shell import InteractiveShell from framework.timer import Timer class InteractiveShellEnvironmentBuilder(): def __call__(self): self._create_core_mock() instance = InteractiveShell(self.core_mock) instance....
{ "repo_name": "DePierre/owtf", "path": "tests/testing_framework/shell/environments.py", "copies": "3", "size": "1620", "license": "bsd-3-clause", "hash": 7671244262712307000, "line_mean": 35, "line_max": 111, "alpha_frac": 0.6333333333, "autogenerated": false, "ratio": 3.8663484486873507, "conf...
from flexmock import flexmock from pytest import raises import sqlalchemy as sa from sqlalchemy_utils import ChoiceType, Choice, ImproperlyConfigured from tests import TestCase class TestChoice(object): def test_equality_operator(self): assert Choice(1, 1) == 1 assert 1 == Choice(1, 1) ass...
{ "repo_name": "tonyseek/sqlalchemy-utils", "path": "tests/types/test_choice.py", "copies": "2", "size": "2131", "license": "bsd-3-clause", "hash": 5477864340275635000, "line_mean": 26.3205128205, "line_max": 69, "alpha_frac": 0.5842327546, "autogenerated": false, "ratio": 3.8816029143897994, "c...
from flexmock import flexmock from tests.testing_framework.utils import ExpensiveResourceProxy from tests.testing_framework.config.environments import PluginConfigEnvironmentBuilder from framework.plugin.plugin_handler import PluginHandler class PluginHandlerEnvironmentBuilder(): plugin_config_proxy = ExpensiveR...
{ "repo_name": "sharad1126/owtf", "path": "tests/testing_framework/plugin/environments.py", "copies": "3", "size": "1566", "license": "bsd-3-clause", "hash": -9190411053158168000, "line_mean": 36.2857142857, "line_max": 88, "alpha_frac": 0.6526181354, "autogenerated": false, "ratio": 4.00511508951...
from flexmock import flexmock import pytest import yaml import anymarkup_core class TestLibsNotInstalled(object): # json is always there, since we only support Python >= 2.7 @pytest.mark.parametrize(('fmt', 'lib'), [ ('ini', 'configobj'), ('xml', 'xmltodict'), ('yaml', 'yaml'), ])...
{ "repo_name": "bkabrda/anymarkup-core", "path": "test/test_libs_not_installed.py", "copies": "1", "size": "1425", "license": "bsd-3-clause", "hash": -8987527968422217000, "line_mean": 36.5, "line_max": 92, "alpha_frac": 0.6350877193, "autogenerated": false, "ratio": 3.607594936708861, "config_t...
from flexmock import MethodCallError from flexmock import flexmock_teardown from flexmock_test import assertRaises from nose import with_setup import flexmock import flexmock_test import unittest def test_module_level(): m = flexmock(mod=2) m.should_receive('mod').once assertRaises(MethodCallError, flexmock_tea...
{ "repo_name": "has207/flexmock", "path": "tests/flexmock_nose_test.py", "copies": "2", "size": "1166", "license": "bsd-2-clause", "hash": -4048583715773393400, "line_mean": 26.7619047619, "line_max": 83, "alpha_frac": 0.7298456261, "autogenerated": false, "ratio": 3.3314285714285714, "config_te...
from flex.validation.request import ( validate_request, ) from flex.error_messages import MESSAGES from flex.constants import ( PATH, QUERY, STRING, INTEGER, ARRAY ) from tests.factories import ( SchemaFactory, RequestFactory, ) from tests.utils import assert_message_in_errors def tes...
{ "repo_name": "pipermerriam/flex", "path": "tests/validation/request/test_request_query_parameter_validation.py", "copies": "1", "size": "2671", "license": "mit", "hash": -6747925633655843000, "line_mean": 25.9797979798, "line_max": 79, "alpha_frac": 0.4687383003, "autogenerated": false, "ratio":...
from flexx.app._component2 import PyComponent, JsComponent from flexx.app._component2 import BaseAppComponent, LocalComponent, ProxyComponent from flexx.event import Component from flexx import event, app from flexx.util.testing import run_tests_if_main, raises, skip class StubSession: id = 'y' status = 2 ...
{ "repo_name": "zoofIO/flexx", "path": "flexx/app/tests/test_component2.py", "copies": "2", "size": "6922", "license": "bsd-2-clause", "hash": -640908081033818600, "line_mean": 27.368852459, "line_max": 115, "alpha_frac": 0.6316093615, "autogenerated": false, "ratio": 3.564366632337796, "config_...
from flexx import app, ui, event TEXT = """ hallo dit is wat text als test. lorum epsilum blabla yield renderer class Editor(ui.CanvasWidget): @event.prop(both=True) def font_size(self, v): return int(v) class JS: text = TEXT def init(self): ...
{ "repo_name": "JohnLunzer/flexx", "path": "exp/editor.py", "copies": "1", "size": "3890", "license": "bsd-2-clause", "hash": -8269569297625965000, "line_mean": 28.2481203008, "line_max": 69, "alpha_frac": 0.4341902314, "autogenerated": false, "ratio": 4.246724890829694, "config_test": false, ...
from flexx import flx class UserInput(flx.PyWidget): def init(self): with flx.VBox(): self.edit = flx.LineEdit(placeholder_text='Your name') flx.Widget(flex=1) @flx.reaction('edit.user_done') def update_user(self, *events): new_text = self.root.store.username + "\n...
{ "repo_name": "zoofIO/flexx", "path": "flexxamples/howtos/python_side_widget2.py", "copies": "2", "size": "1321", "license": "bsd-2-clause", "hash": -7701091583442475000, "line_mean": 25.9795918367, "line_max": 78, "alpha_frac": 0.6078728236, "autogenerated": false, "ratio": 3.522666666666667, ...
from flexx.util.testing import raises, run_tests_if_main import os import sys import tempfile from flexx.util.config import Config SAMPLE1 = """ foo = yes bar = 3 spam = 2.3 eggs = bla bla [other] bar = 9 """ SAMPLE2 = """ [testconfig] foo = yes bar = 4 spam = 3.3 eggs = bla bla bla [other] bar = 9 """ SA...
{ "repo_name": "JohnLunzer/flexx", "path": "flexx/util/tests/test_config.py", "copies": "1", "size": "14672", "license": "bsd-2-clause", "hash": -1664432933977016300, "line_mean": 26.2713754647, "line_max": 78, "alpha_frac": 0.5086559433, "autogenerated": false, "ratio": 3.2926391382405744, "con...
from flexx.util.testing import run_tests_if_main, raises from flexx import pyscript from flexx.pyscript import JSError, py2js, evaljs, evalpy, Parser def nowhitespace(s): return s.replace('\n', '').replace('\t', '').replace(' ', '') class TestParser(Parser): def function_foo_foo(self, node): r...
{ "repo_name": "JohnLunzer/flexx", "path": "flexx/pyscript/tests/test_parser1.py", "copies": "1", "size": "15251", "license": "bsd-2-clause", "hash": -8088106578414902000, "line_mean": 38.6103896104, "line_max": 85, "alpha_frac": 0.4626229508, "autogenerated": false, "ratio": 2.979097479976558, ...
from flexx.util.testing import run_tests_if_main, raises from flexx import pyscript from flexx.pyscript import RawJS def test_stubs(): from flexx.pyscript.stubs import window, undefined, omgnotaname assert isinstance(window, pyscript.JSConstant) assert isinstance(undefined, pyscript.JSConstant) ...
{ "repo_name": "JohnLunzer/flexx", "path": "flexx/pyscript/tests/test_stubs.py", "copies": "1", "size": "2290", "license": "bsd-2-clause", "hash": 1642852438011168000, "line_mean": 26.9268292683, "line_max": 73, "alpha_frac": 0.5620087336, "autogenerated": false, "ratio": 3.239038189533239, "con...
from flexx.util.testing import run_tests_if_main, raises from flexx.pyscript.parser0 import JSError, unify from flexx import pyscript def test_unify(): # Simple objects assert unify('3') == '3' assert unify('3.12') == '3.12' assert unify('"aa"') == '"aa"' assert unify("'aa'") == "'aa'" ...
{ "repo_name": "JohnLunzer/flexx", "path": "flexx/pyscript/tests/test_parser0.py", "copies": "1", "size": "1385", "license": "bsd-2-clause", "hash": -5005617526395254000, "line_mean": 27.2653061224, "line_max": 66, "alpha_frac": 0.5090252708, "autogenerated": false, "ratio": 2.867494824016563, "...
from flexx.util.testing import run_tests_if_main, raises import sys from flexx import app from flexx.app import Session from flexx.app._assetstore import assets, AssetStore as _AssetStore class AssetStore(_AssetStore): _test_mode = True class Fooo1(app.Model): x = 3 def test_session_basics(): s...
{ "repo_name": "JohnLunzer/flexx", "path": "flexx/app/tests/test_session.py", "copies": "1", "size": "9097", "license": "bsd-2-clause", "hash": -5543440167746337000, "line_mean": 26.1552238806, "line_max": 99, "alpha_frac": 0.5879960427, "autogenerated": false, "ratio": 3.173003139169864, "confi...
from flickrBase import * #Gets information about a photoset. class FlickrPhotoSetGetInfo(FlickrApiMethod): name='flickr.photosets.getInfo' def __init__(self,nojsoncallback=True,format='json',parameters=None,photoset_id=None): self.photoset_id = photoset_id FlickrApiMethod.__init__(self,nojsoncallback,format,para...
{ "repo_name": "kelsmj/FlickrOAuth", "path": "photosets.py", "copies": "1", "size": "1739", "license": "mit", "hash": 3445396362209054700, "line_mean": 25.3636363636, "line_max": 94, "alpha_frac": 0.6877515814, "autogenerated": false, "ratio": 2.8461538461538463, "config_test": false, "has_no_...
from flickrBase import * #Returns all visible sets and pools the photo belongs to. class FlickrPhotosGetAllContexts(FlickrApiMethod): name = 'flickr.photos.getAllContexts' def __init__(self,nojsoncallback=True,format='json',parameters=None,photo_id=None): self.photo_id=photo_id FlickrApiMethod.__init__(self,...
{ "repo_name": "kelsmj/FlickrOAuth", "path": "photos.py", "copies": "1", "size": "3526", "license": "mit", "hash": 12193746339864444, "line_mean": 27.435483871, "line_max": 98, "alpha_frac": 0.7220646625, "autogenerated": false, "ratio": 2.9755274261603377, "config_test": false, "has_no_keywor...
from flickrDownloader import * api_key = "INSERT_HERE_YOUR_API_KEY" # if you want to insert your apikey in source code api_key = "flickr.apikey" # if you want to read apikey from file # If you want to share your code in git, you may want not to share your api key too! # In that case, insert your api key in the fli...
{ "repo_name": "nagash91/python-flickr-image-downloader", "path": "main_usage_examples.py", "copies": "1", "size": "4248", "license": "mit", "hash": -8719619767522959000, "line_mean": 53.4615384615, "line_max": 136, "alpha_frac": 0.5035310734, "autogenerated": false, "ratio": 3.8583106267029974, ...
from FlightInfo import FlightInfo from Interval import * from Gate import Gate from Queue import * from random import * def assign(intervals, num_gates=0, start_time=scheduled_start_time, end_time=scheduled_end_time): gates = [Gate() for i in xrange(0, num_gates)] # initialise priority queue pq = PriorityQueue() ...
{ "repo_name": "sozos/RAS", "path": "source/schedule.py", "copies": "1", "size": "2831", "license": "mit", "hash": -1500437533526236700, "line_mean": 30.1098901099, "line_max": 98, "alpha_frac": 0.6976333451, "autogenerated": false, "ratio": 3.0342979635584135, "config_test": false, "has_no_ke...
from FlightInfo import * from Interval import * # Converts time from 24h format to minutes in the range [0,1439] def time_to_minutes(time_string): t = int(time_string) t_hr = t / 100 t_min = t % 100 return t_hr * 60 + t_min # Add duration to time t def add_time(t, duration): return t + duration # Returns the ti...
{ "repo_name": "sozos/RAS", "path": "source/util.py", "copies": "1", "size": "1447", "license": "mit", "hash": 6834640540741015000, "line_mean": 34.3170731707, "line_max": 97, "alpha_frac": 0.7277125086, "autogenerated": false, "ratio": 2.9651639344262297, "config_test": false, "has_no_keyword...
from flightsearch import flightsearch, flightresult from selenium import webdriver from bs4 import BeautifulSoup from lxml import html import uuid import time def getresult(flightsearch): PHANTOMJS_PATH = './phantomjs.exe' resultuuid = uuid.uuid4() resultbegintime = time.time() results = [] link =...
{ "repo_name": "brahul90/cheapflights", "path": "cheapflights/getresults/getkayak.py", "copies": "1", "size": "2930", "license": "apache-2.0", "hash": 5904435456515925000, "line_mean": 32.6781609195, "line_max": 139, "alpha_frac": 0.6102389078, "autogenerated": false, "ratio": 3.2268722466960353, ...
from flightsearch import flightsearch, flightresult import requests import lxml import datetime import collections import uuid import time def getresult(flightsearch): resultuuid = uuid.uuid4() resultbegintime = time.time() link = skypickerlink(flightsearch) results = [] resultendtime = t...
{ "repo_name": "brahul90/cheapflights", "path": "cheapflights/getresults/getskypicker.py", "copies": "1", "size": "4184", "license": "apache-2.0", "hash": 2018752031801165300, "line_mean": 29.5401459854, "line_max": 120, "alpha_frac": 0.6477055449, "autogenerated": false, "ratio": 3.02312138728323...
from FL import * from dialogKit import * class GlyphViewDemo(object): def __init__(self): self.font= fl.font self.glyphs = {} for glyph in self.font.glyphs: self.glyphs[glyph.name] = glyph glyphNames = self.glyphs.keys() glyphNames.sort() # s...
{ "repo_name": "daltonmaag/dialogKit", "path": "examples/GlyphViewDemo.py", "copies": "3", "size": "3938", "license": "mit", "hash": -3729793378817653000, "line_mean": 56.9264705882, "line_max": 125, "alpha_frac": 0.6521076689, "autogenerated": false, "ratio": 3.295397489539749, "config_test": f...
from flint import Flint class TestFlint: def test_init(self): flint = Flint("test_resources/general_test.md") assert flint.text == open("test_resources/general_test.md").read() assert flint.vals == {} assert flint.html == None def test_get(self): flint = Flint("test_resources/general_test.md") flint.ad...
{ "repo_name": "dawsonc/Flint", "path": "test_flint.py", "copies": "1", "size": "3718", "license": "mit", "hash": -877435109250433300, "line_mean": 32.8090909091, "line_max": 69, "alpha_frac": 0.6748251748, "autogenerated": false, "ratio": 2.752035529237602, "config_test": true, "has_no_keywor...
from flipsyfat.cores.sd_emulator.linklayer import SDLinkLayer from migen import * from misoc.interconnect.csr import * from misoc.interconnect.csr_eventmanager import * from misoc.interconnect import wishbone class SDEmulator(Module, AutoCSR): """Core for emulating SD card memory a block at a time, with re...
{ "repo_name": "scanlime/flipsyfat", "path": "flipsyfat/cores/sd_emulator/core.py", "copies": "1", "size": "4333", "license": "mit", "hash": -581239820399453800, "line_mean": 43.6701030928, "line_max": 96, "alpha_frac": 0.6069697669, "autogenerated": false, "ratio": 3.3878029710711495, "config_t...
from flist.chat import opcode def account_login(account, password): """Log in to an f-list account. :param account: F-list account name. :param password: Password for the account. """ from flist.account import Account account = Account(account, password) return account.login() def start_...
{ "repo_name": "StormyDragon/python-flist", "path": "flist/__init__.py", "copies": "1", "size": "1086", "license": "bsd-2-clause", "hash": -2558520193816301600, "line_mean": 37.7857142857, "line_max": 120, "alpha_frac": 0.7329650092, "autogenerated": false, "ratio": 4.396761133603239, "config_te...
from flock import Flock from shapely.geometry import Polygon import numpy as np from obstacle import Obstacle, obstacle_from_point from goal import Goal from perimeter import Perimeter class World(object): """ contains flock, perimeter and obstacles. doesn't have ros stuff other serialization to messages. """ ...
{ "repo_name": "light-swarm/lightswarm_sim", "path": "scripts/world.py", "copies": "1", "size": "1602", "license": "mit", "hash": 2124005957515773700, "line_mean": 31.04, "line_max": 108, "alpha_frac": 0.6997503121, "autogenerated": false, "ratio": 2.665557404326123, "config_test": false, "has...
#from Flock import new_boids #from nose.tools import assert_almost_equal #import os #import yaml from ..boids import Flock, Boid from nose.tools import assert_almost_equal, assert_raises from numpy.testing import assert_array_equal, assert_allclose from numpy import array import os import yaml def test_boid_init(): ...
{ "repo_name": "garethsion/Bad_Boids", "path": "boids/tests/test_boids.py", "copies": "1", "size": "1470", "license": "mit", "hash": -4352804826292466000, "line_mean": 39.8611111111, "line_max": 90, "alpha_frac": 0.7013605442, "autogenerated": false, "ratio": 3.0497925311203318, "config_test": f...
from flood_mapper.models.rw import RW, RWSerializer from flood_mapper.models.rt import RT, RTSerializer from flood_mapper.models.village import Village, VillageSerializer from flood_mapper.models.flood_status import FloodStatus from flood_mapper.utilities.utilities import get_time_slice from rest_framework.response i...
{ "repo_name": "kartoza/jakarta-flood-maps", "path": "django_project/flood_mapper/views/boundary_api.py", "copies": "1", "size": "3055", "license": "bsd-2-clause", "hash": -770701089704617100, "line_mean": 34.523255814, "line_max": 79, "alpha_frac": 0.6510638298, "autogenerated": false, "ratio": 3...
from floppyforms.__future__ import ModelForm, TextInput from package.models import Category, Package, PackageExample def package_help_text(): help_text = "" for category in Category.objects.all(): help_text += """<li><strong>{title_plural}</strong> {description}</li>""".format( ...
{ "repo_name": "pydanny/djangopackages", "path": "package/forms.py", "copies": "2", "size": "1487", "license": "mit", "hash": 9144155056368933000, "line_mean": 27.0566037736, "line_max": 89, "alpha_frac": 0.5877605918, "autogenerated": false, "ratio": 4.212464589235127, "config_test": false, "...
from floppyforms import ModelForm, TextInput from package.models import Category, Package, PackageExample def package_help_text(): help_text = "" for category in Category.objects.all(): help_text += """<li><strong>{title_plural}</strong> {description}</li>""".format( title_plu...
{ "repo_name": "miketheman/opencomparison", "path": "package/forms.py", "copies": "1", "size": "1356", "license": "mit", "hash": -3700806605712444400, "line_mean": 28.4782608696, "line_max": 89, "alpha_frac": 0.5855457227, "autogenerated": false, "ratio": 4.172307692307692, "config_test": false,...
from floppyforms.models import ModelChoiceField, ModelMultipleChoiceField from .widgets import Select2Widget, Select2MultipleWidget, AjaxSelect2Widget, AjaxSelect2MultipleWidget class Select2ModelChoiceField(ModelChoiceField): """ Select2ModelChoiceField Field which use Select2Widget as widget rendering ...
{ "repo_name": "ouhouhsami/django-select2light", "path": "select2light/models.py", "copies": "1", "size": "2530", "license": "apache-2.0", "hash": 7098673126789506000, "line_mean": 41.1666666667, "line_max": 131, "alpha_frac": 0.7177865613, "autogenerated": false, "ratio": 4.093851132686084, "co...
from floppy.graph import Graph from floppy.floppyUi import Painter2D, MainWindow import sys from PyQt5.QtWidgets import QApplication import argparse import logging logger = logging.getLogger('Floppy') logger.setLevel(logging.DEBUG) fh = logging.FileHandler('floppy.log') fh.setLevel(logging.DEBUG) formatter = logging.F...
{ "repo_name": "JLuebben/Floppy", "path": "floppy/main.py", "copies": "1", "size": "1473", "license": "bsd-3-clause", "hash": 6870172635524321000, "line_mean": 25.7818181818, "line_max": 85, "alpha_frac": 0.6985743381, "autogenerated": false, "ratio": 3.6014669926650367, "config_test": false, ...
from floppy.node import Node, abstractNode, Input, Output, Tag from math import sin, cos, pi def norm(v: list): d = (v[0]**2 + v[1]**2 + v[2]**2)**.5 return [v[0]/d, v[1]/d, v[2]/d] @abstractNode class MathNode(Node): Tag('Math') class Add(MathNode): Input('F1', float) Input('F2', float) O...
{ "repo_name": "JLuebben/Floppy", "path": "floppy/CustomNodes/mathNodes.py", "copies": "1", "size": "3830", "license": "bsd-3-clause", "hash": -7975068092925885000, "line_mean": 26.7536231884, "line_max": 108, "alpha_frac": 0.5584856397, "autogenerated": false, "ratio": 2.7221037668798864, "conf...
from floppy.node import Node, Input, Output, Tag, abstractNode from floppy.CustomNodes.crystNodes import CrystNode import subprocess import os @abstractNode class ShelxNode(CrystNode): Tag('Shelx') class RunShelxl(ShelxNode): Input('INS', str) Input('HKL', str) Input('List', int, optional=True) ...
{ "repo_name": "JLuebben/Floppy", "path": "floppy/CustomNodes/shelxNodes.py", "copies": "1", "size": "1966", "license": "bsd-3-clause", "hash": 4628891048269450000, "line_mean": 26.6901408451, "line_max": 100, "alpha_frac": 0.513733469, "autogenerated": false, "ratio": 3.5044563279857397, "confi...
from floppy.node import Node, Input, Output, Tag, abstractNode from floppy.FloppyTypes import StructureInfo, Atom import time import random import subprocess class AMyNode(Node): Input('Inta', int) Input('Intb', int) Input('Int1', int, select=[1,2,3,4]) Input('Int3', int, select=[1,2,3,4]) Output('...
{ "repo_name": "JLuebben/Floppy", "path": "floppy/CustomNodes/myNodes.py", "copies": "1", "size": "2718", "license": "bsd-3-clause", "hash": -1618138531851928000, "line_mean": 20.234375, "line_max": 120, "alpha_frac": 0.5665930831, "autogenerated": false, "ratio": 3.57161629434954, "config_test"...
from floppy.node import Node, Input, Output, Tag, abstractNode @abstractNode class PlotNode(Node): Tag('plot') # class PlotA_vs_B(PlotNode): # pass # # # class PlotA_and_B(PlotNode): # Input('A', float) # Input('B', float) # Output('Trigger', object) # # def __init__(self,*args, **kwargs): # ...
{ "repo_name": "JLuebben/Floppy", "path": "floppy/CustomNodes/infoNodes.py", "copies": "1", "size": "2230", "license": "bsd-3-clause", "hash": -5107497262924894000, "line_mean": 22.9892473118, "line_max": 62, "alpha_frac": 0.5403587444, "autogenerated": false, "ratio": 3.293943870014771, "config...
from flopy.utils.flopy_io import get_url_text class acdd: """Translate ScienceBase global metadata attributes to CF and ACDD global attributes. see: https://www.sciencebase.gov/catalog/ http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#description-of-file-contents http://w...
{ "repo_name": "brclark-usgs/flopy", "path": "flopy/export/metadata.py", "copies": "1", "size": "8389", "license": "bsd-3-clause", "hash": 1287916476329692000, "line_mean": 38.3849765258, "line_max": 132, "alpha_frac": 0.6062701156, "autogenerated": false, "ratio": 3.816651501364877, "config_tes...
from floreal import models as m def allocate(limit, wishes): """ Resources allocation in case of penury: When a list of consumers want some resources, and that resource exists in insufficient quantity to satisfy the total demand, a way must be found to allocate existing resources while minimizing...
{ "repo_name": "fab13n/caracole", "path": "floreal/penury.py", "copies": "1", "size": "5048", "license": "mit", "hash": 5160140034679438000, "line_mean": 43.8909090909, "line_max": 121, "alpha_frac": 0.6263866878, "autogenerated": false, "ratio": 4.009531374106434, "config_test": false, "has_n...
from floto.api import SwfType class WorkflowType(SwfType): """ Attributes ---------- default_child_policy : Optional[str] Specify the default policy to use for the child workflow executions when a workflow execution of this type is terminated. Valid values: TERMINATE | REQUEST_...
{ "repo_name": "babbel/floto", "path": "floto/api/workflow_type.py", "copies": "1", "size": "3222", "license": "mit", "hash": -2115189985443326000, "line_mean": 43.75, "line_max": 117, "alpha_frac": 0.6319056487, "autogenerated": false, "ratio": 4.261904761904762, "config_test": false, "has_no...
from FlowCytometryTools.core import docstring ############################### # Programmable Documentation # ############################### _doc_dict = dict( _graph_grid_layout="""\ xlim : None | 2-tuple If None automatic, otherwise specifies the xmin and xmax for the plot ylim : None | 2-tuple If None ...
{ "repo_name": "eyurtsev/FlowCytometryTools", "path": "FlowCytometryTools/core/common_doc.py", "copies": "1", "size": "9509", "license": "mit", "hash": -1610907865344615400, "line_mean": 40.1645021645, "line_max": 136, "alpha_frac": 0.6950257651, "autogenerated": false, "ratio": 3.8748981255093726...
from floweaver.layered_graph import LayeredGraph from floweaver.augment_view_graph import augment, elsewhere_bundles from floweaver.sankey_definition import SankeyDefinition, Ordering, ProcessGroup, Waypoint, Bundle, Elsewhere from floweaver.view_graph import view_graph def test_elsewhere_bundles_are_added_when_no_bu...
{ "repo_name": "ricklupton/sankeyview", "path": "test/test_augment_view_graph.py", "copies": "1", "size": "4285", "license": "mit", "hash": 4898106426458951000, "line_mean": 32.4140625, "line_max": 109, "alpha_frac": 0.5639466916, "autogenerated": false, "ratio": 3.172848664688427, "config_test"...
from flowersdata import FlowerData import chaco.api as chacoapi import chaco.tools.api as toolsapi from traits.api import HasTraits, Instance from enable.api import Component, ComponentEditor from traitsui.api import Item, Group, View, Handler, Action size=(700,700) pd = chacoapi.ArrayPlotData() def _create_plot_compo...
{ "repo_name": "ContinuumIO/chaco", "path": "examples/continuum/flowers.py", "copies": "1", "size": "4113", "license": "bsd-3-clause", "hash": 4199635980249128000, "line_mean": 34.7652173913, "line_max": 85, "alpha_frac": 0.5572574763, "autogenerated": false, "ratio": 3.8948863636363638, "config...
from flowfairy.feature import Feature, FeatureError from flowfairy.conf import settings import numpy as np import soundfile as sf samplerate = settings.OUTPUTLEN + 2000 outputlen = samplerate duration = settings.DURATION frequency_count = settings.CLASS_COUNT frq_min, frq_max = settings.FREQUENCY_LIMIT step = (frq_m...
{ "repo_name": "WhatDo/FlowFairy", "path": "examples/sine_fix/feature.py", "copies": "1", "size": "2809", "license": "mit", "hash": 7002497622524830000, "line_mean": 26.2718446602, "line_max": 122, "alpha_frac": 0.576005696, "autogenerated": false, "ratio": 3.1956769055745164, "config_test": fal...
from flowfairy.feature import Feature from flowfairy.conf import settings import numpy as np samplerate = settings.SAMPLERATE duration = settings.DURATION chunk = settings.CHUNK class SineGen(Feature): arr = np.arange(samplerate, dtype=np.float32) * 2 * np.pi / samplerate def feature(self, frequencies, **k...
{ "repo_name": "WhatDo/FlowFairy", "path": "examples/denoise_reg/feature.py", "copies": "1", "size": "1300", "license": "mit", "hash": 7591637366353842000, "line_mean": 22.6363636364, "line_max": 74, "alpha_frac": 0.6153846154, "autogenerated": false, "ratio": 3.3248081841432224, "config_test": ...
from flowfairy.feature import Feature from flowfairy.conf import settings import numpy as np samplerate = settings.SAMPLERATE duration = settings.DURATION chunk = settings.CHUNK def classify(val): val = (val-np.min(val))/(np.max(val)-np.min(val)) return np.floor(val*255) class SineGen(Feature): arr = n...
{ "repo_name": "WhatDo/FlowFairy", "path": "examples/denoise_class/feature.py", "copies": "1", "size": "1439", "license": "mit", "hash": -2890331589388228600, "line_mean": 23.3898305085, "line_max": 74, "alpha_frac": 0.6184850591, "autogenerated": false, "ratio": 3.240990990990991, "config_test"...
from flowfairy.feature import Feature from flowfairy.conf import settings import numpy as np samplerate = settings.SAMPLERATE duration = settings.DURATION chunk = settings.CHUNK frequency_count = settings.CLASS_COUNT frq_min, frq_max = settings.FREQUENCY_LIMIT step = (frq_max - frq_min) / frequency_count def class...
{ "repo_name": "WhatDo/FlowFairy", "path": "examples/denoise_reg_mult/feature.py", "copies": "2", "size": "1846", "license": "mit", "hash": 916664380585521400, "line_mean": 23.9459459459, "line_max": 80, "alpha_frac": 0.6159263272, "autogenerated": false, "ratio": 3.1235194585448394, "config_tes...
from flow import Flow import logging LOG = logging.getLogger(__name__) class Server(object): """A connection to Flow.""" def __init__(self, config): """Initialize a flow server instance.""" self.config = config self.flow = Flow( server_uri=config.uri, flowapp...
{ "repo_name": "SpiderOak/flowbot", "path": "src/server.py", "copies": "1", "size": "2883", "license": "mpl-2.0", "hash": 4281699192069432000, "line_mean": 34.1585365854, "line_max": 78, "alpha_frac": 0.5660770031, "autogenerated": false, "ratio": 4.049157303370786, "config_test": true, "has_n...
from flow import Flow from config import ORG_ID, CHANNEL_MAP, BOTNAME, BOTPW, NICE_NAMES try: flow = Flow(BOTNAME) except flow.FlowError: flow = Flow() flow.create_device(BOTNAME, BOTPW) class MessageHandler(object): def __init__(self, message, sender_id, channel_id): self.message = message....
{ "repo_name": "datamade/semabot", "path": "bot.py", "copies": "1", "size": "4097", "license": "mit", "hash": -2204259351594323000, "line_mean": 28.9051094891, "line_max": 102, "alpha_frac": 0.6185013424, "autogenerated": false, "ratio": 4.236814891416753, "config_test": false, "has_no_keyword...
from flowirc.message.irc import UserMessage, NickMessage from flowirc.middleware import MiddleWareBase __author__ = 'Olle Lundberg' class _BaseDescriptor: def __init__(self, what): self._what = what def __get__(self, obj, objtype): return self._what def __set__(self, obj, val): ...
{ "repo_name": "lndbrg/flowirc", "path": "flowirc/user.py", "copies": "1", "size": "1641", "license": "mit", "hash": -8355621344897073000, "line_mean": 24.640625, "line_max": 72, "alpha_frac": 0.5460085314, "autogenerated": false, "ratio": 3.852112676056338, "config_test": false, "has_no_keywo...
from flowlight.tasks.meta import TaskMeta from flowlight.tasks.task import _Task from flowlight.tasks.future import TaskFuture from flowlight.tasks.state import TaskState def task(func=None, *args, **kwargs): """Decorator function on task procedure which will be executed on machine cluster. :param func: the ...
{ "repo_name": "tonnie17/flowlight", "path": "flowlight/tasks/__init__.py", "copies": "1", "size": "1101", "license": "mit", "hash": -7625494689734637000, "line_mean": 30.4571428571, "line_max": 86, "alpha_frac": 0.6049046322, "autogenerated": false, "ratio": 4.284046692607004, "config_test": fa...
from flowlight.utils.signal import Signal from flowlight.utils.trigger import Trigger from flowlight.tasks.meta import TaskMeta import threading class _Task: """ A task wrapper on funciton. :param func: task function called by `Node` lately. :param run_after: run the task when `run_after` is finish stag...
{ "repo_name": "tonnie17/flowlight", "path": "flowlight/tasks/task.py", "copies": "1", "size": "2009", "license": "mit", "hash": -1536842284638693400, "line_mean": 32.4833333333, "line_max": 92, "alpha_frac": 0.6077650572, "autogenerated": false, "ratio": 3.776315789473684, "config_test": false,...
from flow_plugin import FlowPlugin from ghost import Ghost import Cookie class ACSFlowPlugin(FlowPlugin): fed_auth_cookies = [] def __init__(self): super(ACSFlowPlugin, self).__init__() self.url = self.get_conf_option('url') self.username = self.get_conf_option('username') s...
{ "repo_name": "stillinsecure/acl_audit", "path": "plugins/acs_flow_plugin.py", "copies": "2", "size": "1601", "license": "mit", "hash": 2707695558491299300, "line_mean": 37.119047619, "line_max": 123, "alpha_frac": 0.6152404747, "autogenerated": false, "ratio": 3.6889400921658986, "config_test"...
from flowp.testing import Behavior, skip, only, slow from flowp.files import cd, touch, mkdir, cp, sh, exists, \ isfile, isdir, pwd, Watch, rm, mv from flowp import testing import os import time class expect(testing.expect): def to_be_file(self): assert isfile(self._context) def to_be_dir(self): ...
{ "repo_name": "localmed/flowp", "path": "spec/spec_files.py", "copies": "2", "size": "6895", "license": "bsd-3-clause", "hash": 8847581021213938000, "line_mean": 30.628440367, "line_max": 80, "alpha_frac": 0.5868020305, "autogenerated": false, "ratio": 3.4066205533596836, "config_test": true, ...
from flow.renderer.pyglet_renderer import PygletRenderer as Renderer import numpy as np import os import unittest import ctypes class TestPygletRenderer(unittest.TestCase): """Tests pyglet_renderer""" def setUp(self): path = os.path.dirname(os.path.abspath(__file__))[:-11] self.data = np.load...
{ "repo_name": "cathywu/flow", "path": "tests/fast_tests/test_pyglet_renderer.py", "copies": "1", "size": "7576", "license": "mit", "hash": -2775970626385162000, "line_mean": 32.0829694323, "line_max": 71, "alpha_frac": 0.5681098205, "autogenerated": false, "ratio": 3.8811475409836067, "config_t...
from flows.builtin.helpers.parser import flow_parser from flows.builtin.webserver.post import run_webserver from jobrunner.cli.parse import parse_arguments from jobrunner.plugins import register_job def parse_webserver_arguments(args=None): """ Parse the commandline options for posting a job that runs a s...
{ "repo_name": "vdloo/jobrunner", "path": "flows/builtin/webserver/cli.py", "copies": "1", "size": "1169", "license": "apache-2.0", "hash": 8406853849376708000, "line_mean": 32.4, "line_max": 72, "alpha_frac": 0.6997433704, "autogenerated": false, "ratio": 4.0034246575342465, "config_test": fals...
from flows.builtin.helpers.parser import flow_parser from flows.simulacra.youtube_dl.post import download_videos from jobrunner.cli.parse import parse_arguments from jobrunner.plugins import register_job def parse_youtube_dl_arguments(args=None): """ Parse the commandline options for posting a job that do...
{ "repo_name": "vdloo/simulacra", "path": "simulacra/youtube_dl/cli.py", "copies": "1", "size": "1301", "license": "apache-2.0", "hash": 4512428490089989000, "line_mean": 33.2368421053, "line_max": 79, "alpha_frac": 0.7033051499, "autogenerated": false, "ratio": 4.143312101910828, "config_test":...
from flowsieve.acl.acl_result import ACLResult, PacketMatch from flowsieve.acl.base_acl import BaseACL from flowsieve.acl.user_set import UserSet from ryu.lib.packet import ethernet class UserACL(BaseACL): def __init__(self, **kwargs): super(UserACL, self).__init__(**kwargs) self.allowed_user_nam...
{ "repo_name": "shimojo-lab/flowsieve", "path": "flowsieve/acl/user_acl.py", "copies": "1", "size": "4107", "license": "apache-2.0", "hash": -8682949947190889000, "line_mean": 35.3451327434, "line_max": 75, "alpha_frac": 0.5534453372, "autogenerated": false, "ratio": 3.9226361031518624, "config_...
from flows.simulacra.youtube_dl.cli import youtube_dl_latest from tests.testcase import TestCase class TestYoutubeDLLatest(TestCase): def setUp(self): self.parse_youtube_dl_arguments = self.set_up_patch( 'flows.simulacra.youtube_dl.cli.parse_youtube_dl_arguments' ) self.downloa...
{ "repo_name": "vdloo/simulacra", "path": "simulacra/tests/unit/youtube_dl/cli/test_youtube_dl_latest.py", "copies": "1", "size": "1263", "license": "apache-2.0", "hash": -1876619708943889400, "line_mean": 32.2368421053, "line_max": 71, "alpha_frac": 0.6547901821, "autogenerated": false, "ratio": ...
from flows.statestore.base import StateStoreBase, StateNotFound from django.db import models from django.utils import timezone from flows import config from datetime import timedelta class StateModelManager(models.Manager): def get_query_set(self): timeout = timezone.now() - timedelta(seconds=config.FLOW...
{ "repo_name": "maikelwever/django-flows", "path": "flows/statestore/django_store.py", "copies": "3", "size": "1944", "license": "bsd-2-clause", "hash": 4430224664881322000, "line_mean": 30.3709677419, "line_max": 96, "alpha_frac": 0.6538065844, "autogenerated": false, "ratio": 3.9114688128772634,...
# from flow.visualize import visualizer_rllab as vs_rllab # from flow.visualize.visualizer_rllab import visualizer_rllab from flow.visualize import visualizer_rllib as vs_rllib from flow.visualize.visualizer_rllib import visualizer_rllib import flow.visualize.capacity_diagram_generator as cdg import flow.visualize.time...
{ "repo_name": "cathywu/flow", "path": "tests/fast_tests/test_visualizers.py", "copies": "1", "size": "16891", "license": "mit", "hash": -6031935260031142000, "line_mean": 45.0245231608, "line_max": 79, "alpha_frac": 0.5002072109, "autogenerated": false, "ratio": 2.7831603229527104, "config_test...
from flowy import finish_order from flowy import first from flowy import parallel_reduce from flowy import restart from flowy import SWFWorkflowConfig from flowy import wait w = SWFWorkflowConfig() @w(version=1) class NoTask(object): def __call__(self, n): return n @w(version=1) def Closure(): def ...
{ "repo_name": "severb/flowy", "path": "tests/workflows.py", "copies": "1", "size": "3508", "license": "mit", "hash": 5507322535065888000, "line_mean": 18.2747252747, "line_max": 63, "alpha_frac": 0.5344925884, "autogenerated": false, "ratio": 3.49402390438247, "config_test": false, "has_no_ke...
from flowy.local.decision import ActivityDecision from flowy.local.decision import WorkflowDecision from flowy.proxy import Proxy from flowy.swf.history import SWFTaskExecutionHistory as TaskHistory from flowy.tracer import TracingProxy class ActivityProxy(object): def __init__(self, identity, f): self.id...
{ "repo_name": "severb/flowy", "path": "flowy/local/proxy.py", "copies": "1", "size": "1043", "license": "mit", "hash": 2443761466914922000, "line_mean": 32.6451612903, "line_max": 68, "alpha_frac": 0.6701821668, "autogenerated": false, "ratio": 3.9358490566037734, "config_test": false, "has_n...
from flowy.swf.decision import SWFActivityTaskDecision from flowy.swf.decision import SWFWorkflowTaskDecision from flowy.swf.history import SWFTaskExecutionHistory from flowy.proxy import Proxy from flowy.utils import DescCounter class SWFActivityProxyFactory(object): """A proxy factory for activities.""" de...
{ "repo_name": "severb/flowy", "path": "flowy/swf/proxy.py", "copies": "1", "size": "2806", "license": "mit", "hash": -2434183517089217000, "line_mean": 40.2647058824, "line_max": 94, "alpha_frac": 0.6325730577, "autogenerated": false, "ratio": 4.357142857142857, "config_test": false, "has_no_...
from flowy.swf.decision import task_key, timer_key class SWFExecutionHistory(object): def __init__(self, running, timedout, results, errors, order): self.running = running self.timedout = timedout self.results = results self.errors = errors self.order_ = order def is_r...
{ "repo_name": "severb/flowy", "path": "flowy/swf/history.py", "copies": "1", "size": "1766", "license": "mit", "hash": -396395748719365900, "line_mean": 29.9824561404, "line_max": 82, "alpha_frac": 0.6262740657, "autogenerated": false, "ratio": 3.694560669456067, "config_test": false, "has_no...
from flowy.swf.scanner import workflow from flowy.swf.task import ActivityProxy, WorkflowProxy from flowy.task import TaskError, Workflow @workflow('SimpleReturnExample', 77, 'example_list') class SimpleReturn(Workflow): """ Does nothing, just returns the argument it receives. """ def run(self, value='hello')...
{ "repo_name": "severb/flowy-website", "path": "flowy_module/flowy/swf/tests/workflows.py", "copies": "1", "size": "4719", "license": "mit", "hash": 893376598869004800, "line_mean": 26.2774566474, "line_max": 77, "alpha_frac": 0.6361517271, "autogenerated": false, "ratio": 4.012755102040816, "co...
from flTileMpi import mpi from threading import Lock import traceback import time class GenericSyncer: # broadcasts data from the master node to all other nodes. def __init__(self, data=None, updateCallback=None, dataSources=None, reportFramerate = True): # data sources should have the function storeDataI...
{ "repo_name": "rpwagner/tiled-display", "path": "flTile/syncer.py", "copies": "1", "size": "5443", "license": "apache-2.0", "hash": -4157321660668747300, "line_mean": 35.0463576159, "line_max": 128, "alpha_frac": 0.5625574132, "autogenerated": false, "ratio": 3.822331460674157, "config_test": f...
from fltk import * import copy import sys if '..' not in sys.path: sys.path.append('..') import Motion.ysMotion as ym import GUI.ysBaseUI as ybu #import GUI.ysViewer3 as yv3 import GUI.seViewer3_ys as yv3 import GUI.tree as tree import Mesh.ysMesh as yms from GUI.ysViewer3 import * Fl.scheme('default') # EVENTS ...
{ "repo_name": "queid7/hma", "path": "modules/ys_gui/ysMultiViewer.py", "copies": "1", "size": "19456", "license": "mit", "hash": 1407431874492637200, "line_mean": 35.7113207547, "line_max": 126, "alpha_frac": 0.6123046875, "autogenerated": false, "ratio": 3.4867383512544805, "config_test": fals...