text
stringlengths
0
1.05M
meta
dict
from feds.settings import FEDS_BOOLEAN_SETTING, \ FEDS_INTEGER_SETTING, FEDS_CHOICE_SETTING, FEDS_CURRENCY_SETTING, \ FEDS_FLOAT_SETTING, FEDS_DATE_SETTING from helpers.model_helpers import json_string_to_dict from projects.internal_representation_classes import \ FedsBooleanSetting, FedsIntegerSetting, Fed...
{ "repo_name": "kieranmathieson/feds", "path": "projects/settings_gatherer.py", "copies": "1", "size": "7890", "license": "apache-2.0", "hash": 5442061968327384000, "line_mean": 41.8804347826, "line_max": 78, "alpha_frac": 0.5604562738, "autogenerated": false, "ratio": 4.600583090379009, "config...
from feebb import * import matplotlib.pyplot as plt import itertools # Beam 1 pre = Preprocessor() pre.load_json('ex_json/test2.json') elems = [Element(elem) for elem in pre.elements] print(pre.supports) beam = Beam(elems, pre.supports) post = Postprocessor(beam, 10) print(max(post.interp('moment'))) print(min(post.in...
{ "repo_name": "rbn920/feebb", "path": "feebb/test_sub.py", "copies": "1", "size": "2282", "license": "mit", "hash": 2367310720576858000, "line_mean": 28.6363636364, "line_max": 63, "alpha_frac": 0.7296231376, "autogenerated": false, "ratio": 2.8668341708542715, "config_test": false, "has_no_k...
from FeedCiscoSecureMalwareAnalytics import Client, fetch_indicators, fetch_indicators_command from CommonServerPython import * from test_data.feed_data import banking_dns_response, sinkholed_ip_dns_response def test_fetch_indicators(requests_mock): """Unit test Given - fetch incidents command - feed ...
{ "repo_name": "demisto/content", "path": "Packs/ThreatGrid/Integrations/FeedCiscoSecureMalwareAnalytics/FeedCiscoSecureMalwareAnalytics_test.py", "copies": "1", "size": "2543", "license": "mit", "hash": -5289196904755320000, "line_mean": 38.734375, "line_max": 109, "alpha_frac": 0.6626032245, "auto...
from FeedEater.translate import InsufficientDataForRecord class FeedEaterMeta(type): continue_on_errors = (InsufficientDataForRecord,) save_args = [] save_kwargs = {} def __new__(cls, name, bases, attrs): if name != 'FeedEater' and 'translator_class' not in attrs: raise TypeErro...
{ "repo_name": "Suitey/FeedEater", "path": "__init__.py", "copies": "2", "size": "2296", "license": "apache-2.0", "hash": 4923967363874172000, "line_mean": 31.338028169, "line_max": 78, "alpha_frac": 0.5975609756, "autogenerated": false, "ratio": 4.182149362477231, "config_test": false, "has_n...
from feeders import DummyDataFeeder, DomDataFeeder from agixml import Attribute, present_attribute import config from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import TimeoutException ...
{ "repo_name": "Adnn/agilister", "path": "agilister/fillers.py", "copies": "1", "size": "9155", "license": "mit", "hash": 2103265764998796500, "line_mean": 40.803652968, "line_max": 214, "alpha_frac": 0.6467504096, "autogenerated": false, "ratio": 4.1784573254221815, "config_test": false, "has...
from feedgen.feed import FeedGenerator import datetime as dt import pytz from premailer import transform import markdown from functools import lru_cache from bs4 import BeautifulSoup URL = "https://reformedconfessions.com/westminster-daily" FILENAME = "feed.rss" NUMBER_OF_DAYS = 30 @lru_cache() def markdown_parser(m...
{ "repo_name": "olneyhymn/westminster-daily", "path": "generate_feed.py", "copies": "2", "size": "2109", "license": "bsd-3-clause", "hash": -4278271200807481000, "line_mean": 27.5, "line_max": 84, "alpha_frac": 0.6173541963, "autogenerated": false, "ratio": 3.2748447204968945, "config_test": fal...
from feed_grabber import FeedGrabber import logging import urllib2 import json import time logger = logging.getLogger(__name__) class BlockChainGrabber(FeedGrabber): def __init__(self, *args, **kwds): super(BlockChainGrabber, self).__init__(*args, **kwds) def get_latest_transactions(self, number_of...
{ "repo_name": "sixify/sixify", "path": "fetch/blockchain/blockchain.py", "copies": "1", "size": "1342", "license": "mit", "hash": -3406557967322655000, "line_mean": 31.7317073171, "line_max": 93, "alpha_frac": 0.5536512668, "autogenerated": false, "ratio": 3.7381615598885793, "config_test": fal...
from FeediDefense import custom_build_iterator import requests_mock import pytest from JSONFeedApiModule import Client PARAMS = {'api_token': 'test_api_key', 'insecure': True, 'indicator_type': ['IP', 'Domain'], 'feed_name_to_config': { 'IP': {'extractor': 'results', 'indicator': 'di...
{ "repo_name": "demisto/content", "path": "Packs/iDefense/Integrations/FeediDefense/FeediDefense_test.py", "copies": "1", "size": "3666", "license": "mit", "hash": 1504635930562653000, "line_mean": 42.6428571429, "line_max": 116, "alpha_frac": 0.5671031097, "autogenerated": false, "ratio": 3.70303...
from feed import * import tts from mpd import MPDClient import time KEY_0 = 0 KEY_1 = 1 KEY_2 = 2 KEY_3 = 3 KEY_4 = 4 KEY_5 = 5 KEY_6 = 6 KEY_7 = 7 KEY_8 = 8 KEY_9 = 9 KEY_DOT = 10 KEY_ENTER = 11 KEY_PLUS = 12 KEY_MINUS = 13 KEY_MULT = 14 KEY_DIV = 15 KEY_NUMLOCK = 16 CMD_UPDATE = 0 CMD_READTITLE = 1 CMD_DOWNLOAD = 2...
{ "repo_name": "iemxblog/blindpod", "path": "fsm.py", "copies": "1", "size": "2108", "license": "mit", "hash": 1548860218258328800, "line_mean": 22.3111111111, "line_max": 101, "alpha_frac": 0.5285986654, "autogenerated": false, "ratio": 3.2476780185758516, "config_test": false, "has_no_keywor...
from feedly.activity import Activity, AggregatedActivity from feedly.aggregators.base import RecentVerbAggregator from feedly.feeds.base import BaseFeed from feedly.serializers.aggregated_activity_serializer import \ AggregatedActivitySerializer import copy import logging import random import itertools from feedly....
{ "repo_name": "Architizer/Feedly", "path": "feedly/feeds/aggregated_feed/base.py", "copies": "1", "size": "10449", "license": "bsd-3-clause", "hash": 5590169611667381000, "line_mean": 38.5795454545, "line_max": 93, "alpha_frac": 0.6392956264, "autogenerated": false, "ratio": 4.4961273666092945, ...
from feedly.activity import Activity from feedly.serializers.base import BaseSerializer from feedly.utils import epoch_to_datetime, datetime_to_epoch from feedly.verbs import get_verb_by_id import pickle class ActivitySerializer(BaseSerializer): ''' Serializer optimized for taking as little memory as possibl...
{ "repo_name": "Architizer/Feedly", "path": "feedly/serializers/activity_serializer.py", "copies": "1", "size": "1747", "license": "bsd-3-clause", "hash": 2585402400576442400, "line_mean": 31.9622641509, "line_max": 80, "alpha_frac": 0.6313680595, "autogenerated": false, "ratio": 4.072261072261072...
from feedly.activity import Activity from feedly.verbs import get_verb_by_id import pickle from feedly.serializers.base import BaseSerializer class CassandraActivitySerializer(BaseSerializer): def __init__(self, model, *args, **kwargs): BaseSerializer.__init__(self, *args, **kwargs) self.model = ...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/serializers/cassandra/activity_serializer.py", "copies": "4", "size": "1324", "license": "bsd-3-clause", "hash": 761455861208470400, "line_mean": 36.8285714286, "line_max": 83, "alpha_frac": 0.6351963746, "autogenerated": false, "ratio"...
from feedly.activity import AggregatedActivity, Activity from copy import deepcopy from feedly.exceptions import DuplicateActivityException class BaseAggregator(object): ''' Aggregators implement the combining of multiple activities into aggregated activities. The two most important methods are aggr...
{ "repo_name": "izhan/Stream-Framework", "path": "feedly/aggregators/base.py", "copies": "4", "size": "5217", "license": "bsd-3-clause", "hash": 6293706198623016000, "line_mean": 34.25, "line_max": 110, "alpha_frac": 0.6269886908, "autogenerated": false, "ratio": 5.011527377521614, "config_test"...
from feedly.activity import AggregatedActivity, Activity from feedly.exceptions import SerializationException from feedly.serializers.activity_serializer import ActivitySerializer from feedly.serializers.utils import check_reserved from feedly.utils import epoch_to_datetime, datetime_to_epoch from feedly.serializers.ba...
{ "repo_name": "nikolay-saskovets/Feedly", "path": "feedly/serializers/aggregated_activity_serializer.py", "copies": "4", "size": "4166", "license": "bsd-3-clause", "hash": -9113383713177806000, "line_mean": 37.5740740741, "line_max": 79, "alpha_frac": 0.6387421988, "autogenerated": false, "ratio"...
from feedly.activity import AggregatedActivity from copy import deepcopy from feedly.exceptions import DuplicateActivityException class BaseAggregator(object): ''' Aggregators implement the combining of multiple activities into aggregated activities. The two most important methods are aggregate and ...
{ "repo_name": "Architizer/Feedly", "path": "feedly/aggregators/base.py", "copies": "1", "size": "4520", "license": "bsd-3-clause", "hash": -1290726957476793600, "line_mean": 32.4814814815, "line_max": 110, "alpha_frac": 0.6172566372, "autogenerated": false, "ratio": 5.050279329608938, "config_t...
from feedly.activity import AggregatedActivity from feedly.aggregators.base import RecentVerbAggregator from feedly.feeds.base import BaseFeed from feedly.serializers.aggregated_activity_serializer import \ AggregatedActivitySerializer import copy import logging import random import itertools from feedly.utils.timi...
{ "repo_name": "Anislav/Stream-Framework", "path": "feedly/feeds/aggregated_feed/base.py", "copies": "4", "size": "10857", "license": "bsd-3-clause", "hash": -3084279065264768500, "line_mean": 37.9139784946, "line_max": 89, "alpha_frac": 0.6438242608, "autogenerated": false, "ratio": 4.41341463414...
from feedly.activity import AggregatedActivity from feedly.exceptions import SerializationException from feedly.serializers.activity_serializer import ActivitySerializer from feedly.serializers.utils import check_reserved from feedly.utils import epoch_to_datetime, datetime_to_epoch from feedly.serializers.base import ...
{ "repo_name": "Architizer/Feedly", "path": "feedly/serializers/aggregated_activity_serializer.py", "copies": "1", "size": "4186", "license": "bsd-3-clause", "hash": -8559327928329981000, "line_mean": 37.4036697248, "line_max": 79, "alpha_frac": 0.6390348782, "autogenerated": false, "ratio": 4.579...
from feedly.activity import AggregatedActivity from feedly.serializers.aggregated_activity_serializer import AggregatedActivitySerializer import pickle class CassandraAggregatedActivitySerializer(AggregatedActivitySerializer): def __init__(self, model, *args, **kwargs): AggregatedActivitySerializer.__ini...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/serializers/cassandra/aggregated_activity_serializer.py", "copies": "4", "size": "1161", "license": "bsd-3-clause", "hash": 348110044271468100, "line_mean": 36.4516129032, "line_max": 90, "alpha_frac": 0.6838931955, "autogenerated": false...
from feedly.aggregators.base import RecentVerbAggregator from feedly.feeds.memory import Feed from feedly.tests.feeds.base import TestBaseFeed, implementation from feedly.tests.utils import FakeActivity from feedly.verbs.base import Love as LoveVerb, Add as AddVerb import datetime import unittest class AggregatorTest...
{ "repo_name": "Architizer/Feedly", "path": "feedly/tests/aggregators/__init__.py", "copies": "1", "size": "2475", "license": "bsd-3-clause", "hash": -7369998156516939000, "line_mean": 34.8695652174, "line_max": 77, "alpha_frac": 0.6238383838, "autogenerated": false, "ratio": 4.057377049180328, ...
from feedly.aggregators.base import RecentVerbAggregator from feedly.serializers.activity_serializer import ActivitySerializer from feedly.serializers.aggregated_activity_serializer import \ AggregatedActivitySerializer, NotificationSerializer from feedly.serializers.base import BaseSerializer from feedly.serialize...
{ "repo_name": "Architizer/Feedly", "path": "feedly/tests/serializers.py", "copies": "1", "size": "3630", "license": "bsd-3-clause", "hash": -6842145717267092000, "line_mean": 40.25, "line_max": 88, "alpha_frac": 0.7625344353, "autogenerated": false, "ratio": 4.560301507537688, "config_test": tr...
from feedly.aggregators.base import RecentVerbAggregator from feedly.tests.utils import FakeActivity from feedly.verbs.base import Love as LoveVerb, Add as AddVerb import datetime import unittest class AggregatorTest(unittest.TestCase): aggregator_class = None def setUp(self): id_seq = range(42, 999)...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/tests/aggregators/__init__.py", "copies": "4", "size": "2373", "license": "bsd-3-clause", "hash": -6285647858531294000, "line_mean": 34.4179104478, "line_max": 77, "alpha_frac": 0.613990729, "autogenerated": false, "ratio": 4.0633561643...
from feedly.feeds.aggregated_feed.base import AggregatedFeed from feedly.serializers.aggregated_activity_serializer import \ NotificationSerializer from feedly.storage.redis.timeline_storage import RedisTimelineStorage import copy import datetime import json import logging logger = logging.getLogger(__name__) cl...
{ "repo_name": "Anislav/Stream-Framework", "path": "feedly/feeds/aggregated_feed/notification_feed.py", "copies": "4", "size": "5640", "license": "bsd-3-clause", "hash": 6337283822777503000, "line_mean": 34.25, "line_max": 87, "alpha_frac": 0.6242907801, "autogenerated": false, "ratio": 4.42006269...
from feedly.feeds.aggregated_feed.redis import RedisAggregatedFeed from feedly.tests.feeds.aggregated_feed.base import TestAggregatedFeed,\ implementation from feedly.activity import AggregatedActivity from feedly.tests.feeds.redis import CustomActivity class CustomAggregated(AggregatedActivity): pass class...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/tests/feeds/aggregated_feed/redis.py", "copies": "4", "size": "1166", "license": "bsd-3-clause", "hash": -3979576383595220000, "line_mean": 31.3888888889, "line_max": 72, "alpha_frac": 0.7487135506, "autogenerated": false, "ratio": 4.07...
from feedly.feeds.base import UserBaseFeed from feedly.tasks import follow_many, unfollow_many from feedly.tasks import fanout_operation from feedly.tasks import fanout_operation_hi_priority from feedly.tasks import fanout_operation_low_priority from feedly.utils import chunks from feedly.utils import get_metrics_insta...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/feed_managers/base.py", "copies": "4", "size": "15558", "license": "bsd-3-clause", "hash": 5758611898001339000, "line_mean": 37.4148148148, "line_max": 116, "alpha_frac": 0.6127394267, "autogenerated": false, "ratio": 4.296603148301574,...
from feedly import exceptions as feedly_exceptions from feedly.utils import make_list_unique, datetime_to_epoch import datetime import uuid MAX_AGGREGATED_ACTIVITIES_LENGTH = 15 class BaseActivity(object): ''' Common parent class for Activity and Aggregated Activity Check for this if you want to see if...
{ "repo_name": "Anislav/Stream-Framework", "path": "feedly/activity.py", "copies": "4", "size": "13069", "license": "bsd-3-clause", "hash": 2859658803780356000, "line_mean": 31.5099502488, "line_max": 101, "alpha_frac": 0.6046369271, "autogenerated": false, "ratio": 4.37822445561139, "config_tes...
from feedly import exceptions as feedly_exceptions from feedly.utils import make_list_unique, datetime_to_epoch import datetime MAX_AGGREGATED_ACTIVITIES_LENGTH = 15 class BaseActivity(object): ''' Common parent class for Activity and Aggregated Activity Check for this if you want to see if something i...
{ "repo_name": "Architizer/Feedly", "path": "feedly/activity.py", "copies": "1", "size": "12812", "license": "bsd-3-clause", "hash": -1020874223858567600, "line_mean": 31.1909547739, "line_max": 109, "alpha_frac": 0.6052919138, "autogenerated": false, "ratio": 4.3771779979501195, "config_test": ...
from feedly import settings from feedly.feeds.base import BaseFeed from feedly.storage.cassandra.activity_storage import CassandraActivityStorage from feedly.storage.cassandra.timeline_storage import CassandraTimelineStorage from feedly.serializers.cassandra.activity_serializer import CassandraActivitySerializer clas...
{ "repo_name": "Anislav/Stream-Framework", "path": "feedly/feeds/cassandra.py", "copies": "4", "size": "1265", "license": "bsd-3-clause", "hash": 1246874862829470500, "line_mean": 31.4358974359, "line_max": 88, "alpha_frac": 0.7462450593, "autogenerated": false, "ratio": 4.650735294117647, "conf...
from feedly.serializers.dummy import DummySerializer from feedly.serializers.simple_timeline_serializer import \ SimpleTimelineSerializer from feedly.utils import get_metrics_instance from feedly.activity import AggregatedActivity, Activity import uuid class BaseStorage(object): ''' The feed uses two sto...
{ "repo_name": "nikolay-saskovets/Feedly", "path": "feedly/storage/base.py", "copies": "4", "size": "11588", "license": "bsd-3-clause", "hash": 5437287549444508000, "line_mean": 33.0823529412, "line_max": 95, "alpha_frac": 0.6411805316, "autogenerated": false, "ratio": 4.6130573248407645, "confi...
from feedly.serializers.dummy import DummySerializer from feedly.serializers.simple_timeline_serializer import \ SimpleTimelineSerializer class BaseStorage(object): ''' The feed uses two storage classes, the - Activity Storage and the - Timeline Storage The process works as follows:: ...
{ "repo_name": "Architizer/Feedly", "path": "feedly/storage/base.py", "copies": "1", "size": "9706", "license": "bsd-3-clause", "hash": 5655154844601628000, "line_mean": 31.2458471761, "line_max": 84, "alpha_frac": 0.6385740779, "autogenerated": false, "ratio": 4.661863592699327, "config_test": ...
from feedly.storage.base import BaseActivityStorage, BaseTimelineStorage from feedly.tests.utils import FakeActivity from feedly.tests.utils import Pin from feedly.verbs.base import Love as PinVerb from mock import patch import datetime import unittest from feedly.activity import Activity def implementation(meth): ...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/tests/storage/base.py", "copies": "4", "size": "10904", "license": "bsd-3-clause", "hash": 6814605419176145000, "line_mean": 37.6666666667, "line_max": 118, "alpha_frac": 0.6336206897, "autogenerated": false, "ratio": 3.6468227424749164...
from feedly.storage.base import BaseActivityStorage from feedly.storage.redis.structures.hash import ShardedHashCache from feedly.serializers.activity_serializer import ActivitySerializer class ActivityCache(ShardedHashCache): key_format = 'activity:cache:%s' class RedisActivityStorage(BaseActivityStorage): ...
{ "repo_name": "Anislav/Stream-Framework", "path": "feedly/storage/redis/activity_storage.py", "copies": "5", "size": "1417", "license": "bsd-3-clause", "hash": -4692663835597016000, "line_mean": 31.2045454545, "line_max": 78, "alpha_frac": 0.6640790402, "autogenerated": false, "ratio": 3.96918767...
from feedly.storage.base import BaseTimelineStorage from feedly.storage.redis.structures.sorted_set import RedisSortedSetCache from feedly.storage.redis.connection import get_redis_connection class TimelineCache(RedisSortedSetCache): sort_asc = False class RedisTimelineStorage(BaseTimelineStorage): def get...
{ "repo_name": "Architizer/Feedly", "path": "feedly/storage/redis/timeline_storage.py", "copies": "1", "size": "2118", "license": "bsd-3-clause", "hash": 1799798445918588000, "line_mean": 32.619047619, "line_max": 76, "alpha_frac": 0.642115203, "autogenerated": false, "ratio": 3.8439201451905625, ...
from feedly.storage.redis.connection import get_redis_connection from redis.client import BasePipeline class RedisCache(object): ''' The base for all redis data structures ''' key_format = 'redis:cache:%s' def __init__(self, key, redis=None): # write the key self.key = key ...
{ "repo_name": "nikolay-saskovets/Feedly", "path": "feedly/storage/redis/structures/base.py", "copies": "5", "size": "1556", "license": "bsd-3-clause", "hash": 4877509209380337000, "line_mean": 27.2909090909, "line_max": 73, "alpha_frac": 0.5906169666, "autogenerated": false, "ratio": 4.3463687150...
from feedly.storage.redis.structures.base import RedisCache import logging logger = logging.getLogger(__name__) class BaseRedisHashCache(RedisCache): key_format = 'redis:base_hash_cache:%s' pass class RedisHashCache(BaseRedisHashCache): key_format = 'redis:hash_cache:%s' def get_key(self, *args, **...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/storage/redis/structures/hash.py", "copies": "5", "size": "7429", "license": "bsd-3-clause", "hash": 4878797681087231000, "line_mean": 29.1991869919, "line_max": 81, "alpha_frac": 0.5644097456, "autogenerated": false, "ratio": 4.2210227...
from feedly.storage.redis.structures.base import RedisCache import logging logger = logging.getLogger(__name__) class BaseRedisListCache(RedisCache): ''' Generic list functionality used for both the sorted set and list implementations Retrieve the sorted list/sorted set by using python slicing ''' ...
{ "repo_name": "Architizer/Feedly", "path": "feedly/storage/redis/structures/list.py", "copies": "5", "size": "6852", "license": "bsd-3-clause", "hash": -208733098967820740, "line_mean": 32.5882352941, "line_max": 123, "alpha_frac": 0.5690309399, "autogenerated": false, "ratio": 4.364331210191083,...
from feedly.utils.functional import lazy from feedly.storage.redis.structures.hash import BaseRedisHashCache from feedly.storage.redis.structures.list import BaseRedisListCache import logging from feedly.utils import epoch_to_datetime, chunks logger = logging.getLogger(__name__) class RedisSortedSetCache(BaseRedisLis...
{ "repo_name": "SergioChan/Stream-Framework", "path": "feedly/storage/redis/structures/sorted_set.py", "copies": "4", "size": "5867", "license": "bsd-3-clause", "hash": -6705358199381303000, "line_mean": 32.1468926554, "line_max": 112, "alpha_frac": 0.5694562809, "autogenerated": false, "ratio": 4...
from FeedMicrosoftIntune import Client URL = 'https://docs.microsoft.com/en-us/intune/fundamentals/intune-endpoints' def test_build_iterator(requests_mock): with open('test_data/Microsoft_endpoint_mock.html', 'r') as file: response = file.read() requests_mock.get(URL, text=response) expected_doma...
{ "repo_name": "demisto/content", "path": "Packs/FeedMicrosoftIntune/Integrations/FeedMicrosoftIntune/FeedMicrosoftIntune_test.py", "copies": "1", "size": "1222", "license": "mit", "hash": -173177565105656700, "line_mean": 44.2592592593, "line_max": 114, "alpha_frac": 0.6996726678, "autogenerated": ...
from feed.models import Post, Author, Comment, Friend, ForeignHost from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User import urllib2, base64 import requests import json @login_required # Create your views here. def friends(request...
{ "repo_name": "CMPUT404W16T01/CMPUT404-project-socialdistribution", "path": "friends/views.py", "copies": "1", "size": "3415", "license": "apache-2.0", "hash": 3295314040714795500, "line_mean": 30.6203703704, "line_max": 120, "alpha_frac": 0.6916544656, "autogenerated": false, "ratio": 3.17379182...
from feedparser import parse from PyQt4 import QtGui, QtCore, QtWebKit, uic import sys, os, urllib.request, urllib.parse, urllib.error from models import * from pprint import pprint from math import ceil from pluginmgr import BookStore from templite import Templite import codecs import urllib.parse import time # This ...
{ "repo_name": "webmedic/booker", "path": "src/plugins/feedbooks/__init__.py", "copies": "1", "size": "7398", "license": "mit", "hash": -4359348670182107600, "line_mean": 37.9368421053, "line_max": 129, "alpha_frac": 0.5485266288, "autogenerated": false, "ratio": 3.8551328817092236, "config_test...
from feedplatform import test as feedev from feedplatform import addins class test_addin(addins.base): called = 0 def on_get_item(self, feed, entry_dict, guid): self.__class__.called += 1 if guid == 'neverfind': return False # never return an item in this case ADDINS = ...
{ "repo_name": "miracle2k/feedplatform", "path": "tests/hooks/test_get_item.py", "copies": "1", "size": "1036", "license": "bsd-2-clause", "hash": -4689305732340790000, "line_mean": 26.8333333333, "line_max": 93, "alpha_frac": 0.5752895753, "autogenerated": false, "ratio": 3.837037037037037, "co...
from feedplatform import test as feedev from feedplatform import db from feedplatform.lib import guid_by_content ADDINS = [guid_by_content(prefix='cnt::', fields=('title', 'link'), allow_empty=False)] class TestFeed(feedev.Feed): content = """ <rss><channel> ...
{ "repo_name": "miracle2k/feedplatform", "path": "tests/lib/items/guid/test_guid_by_content.py", "copies": "1", "size": "2116", "license": "bsd-2-clause", "hash": -2647982872297219000, "line_mean": 29.6119402985, "line_max": 79, "alpha_frac": 0.5122873346, "autogenerated": false, "ratio": 4.084942...
from feedplatform import test as feedev from feedplatform.lib import guid_by_date ADDINS = [guid_by_date(prefix='dt::')] class TestFeed(feedev.Feed): content = """ <rss><channel> <!-- date is missing --> <item> <title>The Blog, Post #1</title> ...
{ "repo_name": "miracle2k/feedplatform", "path": "tests/lib/items/guid/test_guid_by_date.py", "copies": "1", "size": "2019", "license": "bsd-2-clause", "hash": -3695974755171479000, "line_mean": 31.131147541, "line_max": 71, "alpha_frac": 0.4952947003, "autogenerated": false, "ratio": 4.20625, "...
from feedplatform import test as feedev from feedplatform.lib import guid_by_enclosure ADDINS = [guid_by_enclosure(prefix='enc::')] class TestFeed(feedev.Feed): content = """ <rss><channel> <item> <title>The Podcast, Episode #4</title> <enclosure url="...
{ "repo_name": "miracle2k/feedplatform", "path": "tests/lib/items/guid/test_guid_by_enclosure.py", "copies": "1", "size": "2199", "license": "bsd-2-clause", "hash": 2914646425925408000, "line_mean": 30.3676470588, "line_max": 108, "alpha_frac": 0.4920418372, "autogenerated": false, "ratio": 3.9836...
from feedplatform.management import BaseCommand from feedplatform import db class Command(BaseCommand): help = 'Show defined models and fields.' def handle(self, *args, **options): for model in db.models: header = model.__name__ if model.__name__.lower() != model.__s...
{ "repo_name": "miracle2k/feedplatform", "path": "feedplatform/management/commands/models.py", "copies": "1", "size": "1250", "license": "bsd-2-clause", "hash": 8911516278168493000, "line_mean": 41.1724137931, "line_max": 71, "alpha_frac": 0.5288, "autogenerated": false, "ratio": 4.664179104477612...
from feedReader.models import SiteInfo import feedparser import hashlib from feedReader.mongoFunctions import Mongo from time import mktime from datetime import datetime from django.utils.html import strip_tags import time from bs4 import BeautifulSoup #from urllib2 import Request, urlopen import urllib3 import re cl...
{ "repo_name": "rohithb/threeSixtyOne", "path": "fromRakr/ParsingFunctions.py", "copies": "1", "size": "6385", "license": "mit", "hash": 4484696985543299000, "line_mean": 36.1220930233, "line_max": 118, "alpha_frac": 0.5570869225, "autogenerated": false, "ratio": 4.544483985765124, "config_test"...
from feedreader.utils.proxy import Proxy class InvalidFeed(Exception): pass class BetterObject(object): def __repr__(self): return "<%s: %s>" % (self.__class__.__name__, self) class Tag(BetterObject, Proxy): def __unicode__(self): return unicode(self.__instance__).strip() class Author(Better...
{ "repo_name": "dcramer/feedreader", "path": "feedreader/feeds/__init__.py", "copies": "1", "size": "1973", "license": "bsd-2-clause", "hash": -5541727111260116000, "line_mean": 22.5, "line_max": 76, "alpha_frac": 0.5686771414, "autogenerated": false, "ratio": 3.794230769230769, "config_test": f...
from feedrsub.authors.author_handler import get_subscribed_authorfeed_authors from feedrsub.models.userfeed import UserFeed from feedrsub.models.websub_subscription import WebSubSubscription from tests.factories import AuthorFactory def test_get_subscribed_authorfeed_authors(session): user_feed = UserFeed(url="te...
{ "repo_name": "DBeath/flask-feedrsub", "path": "tests/authors/author_handler_test.py", "copies": "1", "size": "1139", "license": "mit", "hash": -1825896460956104400, "line_mean": 32.5, "line_max": 79, "alpha_frac": 0.7348551361, "autogenerated": false, "ratio": 3.7100977198697067, "config_test"...
from feedrsub.database import db from datetime import datetime class ResourceMixin(object): # Keep track of record creation and update times. created_on = db.Column(db.DateTime, default=datetime.utcnow) updated_on = db.Column(db.DateTime, onupdate=datetime.utcnow) @classmethod def sort_by(cls, fi...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/models/resource_mixin.py", "copies": "1", "size": "4062", "license": "mit", "hash": -5270410993863946000, "line_mean": 28.4347826087, "line_max": 83, "alpha_frac": 0.5499753816, "autogenerated": false, "ratio": 4.204968944099379, "config_...
from feedrsub.database import db from feedrsub.models.public_id_mixin import PublicIdMixin from feedrsub.models.resource_mixin import ResourceMixin class AuthorMap(db.Model, ResourceMixin, PublicIdMixin): __tablename__ = "author_map" __table_args__ = ( db.UniqueConstraint("site_host", "author_string"...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/models/author_map.py", "copies": "1", "size": "2361", "license": "mit", "hash": 5341437389907659000, "line_mean": 34.2388059701, "line_max": 114, "alpha_frac": 0.6315120712, "autogenerated": false, "ratio": 3.7122641509433962, "config_tes...
from feedrsub.ingestion.parsers.parser_factory import ParserFactory from feedrsub.ingestion.parsers.jsonfeed.jsonfeed_parser import JsonFeedParser from feedrsub.ingestion.parsers.rss.rss_parser import RssParser from feedrsub.ingestion.parsers.json_activitystream.json_parser import JsonParser def test_factory_returns_...
{ "repo_name": "DBeath/flask-feedrsub", "path": "tests/ingestion/parser_factory_test.py", "copies": "1", "size": "2056", "license": "mit", "hash": 2061396085921474300, "line_mean": 37.0740740741, "line_max": 88, "alpha_frac": 0.7451361868, "autogenerated": false, "ratio": 3.7246376811594204, "co...
from feedrsub.models.author import Author from feedrsub.models.entry import Entry from feedrsub.models.feed import Feed, STATUS from feedrsub.models.subscription import Subscription from feedrsub.models.period import Period, periods, PERIOD from feedrsub.models.email import Email from feedrsub.models.recommended import...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/utils/dev_data.py", "copies": "1", "size": "2622", "license": "mit", "hash": -2810706903769967000, "line_mean": 27.5, "line_max": 71, "alpha_frac": 0.6544622426, "autogenerated": false, "ratio": 3.477453580901857, "config_test": true, "...
from feedrsub.models.public_id_mixin import PublicIdMixin from feedrsub.models.user import User import uuid from tests.factories import UserFactory def test_public_id_mixin(): item = PublicIdMixin() item.public_id = uuid.uuid4() encoded = item.encode_public_id() assert encoded assert isinstance(e...
{ "repo_name": "DBeath/flask-feedrsub", "path": "tests/models/public_id_mixin_test.py", "copies": "1", "size": "1123", "license": "mit", "hash": 2899018485206915600, "line_mean": 27.7948717949, "line_max": 68, "alpha_frac": 0.7079252004, "autogenerated": false, "ratio": 3.5650793650793653, "conf...
from feedrsub.utils.feeds.rfeed import Serializable, ElementRequiredError class PushLink(Serializable): """ A PushLink object specifies a link that allows for PubSubHubbub discovery. More information at http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.4.html#discovery or http://documentati...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/utils/feeds/pushlink.py", "copies": "1", "size": "1212", "license": "mit", "hash": 3223704753244089000, "line_mean": 32.6666666667, "line_max": 105, "alpha_frac": 0.6353135314, "autogenerated": false, "ratio": 4.067114093959732, "config_t...
from feedsearch import search from flask import current_app as app from flask_admin.actions import action from feedrsub.admin.views import SecuredModelView from feedrsub.database import db from feedrsub.ingestion import subscriber from feedrsub.ingestion.tasks import task_fetch_feed from feedrsub.ingestion.utils impor...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/admin/views/feed_model_view.py", "copies": "1", "size": "7100", "license": "mit", "hash": 460561751471234600, "line_mean": 33.4660194175, "line_max": 88, "alpha_frac": 0.5532394366, "autogenerated": false, "ratio": 3.9183222958057393, "co...
from feed.views import ( ProgramTargetFrequencies, ) from tola_management.views import ( UserAdminViewSet, OrganizationAdminViewSet, ) from tola_management.programadmin import ( ProgramAdminViewSet, ) from tola_management.countryadmin import ( CountryAdminViewSet, CountryObjectiveViewset, Co...
{ "repo_name": "mercycorps/TolaActivity", "path": "tola/urls.py", "copies": "1", "size": "5788", "license": "apache-2.0", "hash": 6172620250190478000, "line_mean": 38.9172413793, "line_max": 129, "alpha_frac": 0.7145818936, "autogenerated": false, "ratio": 3.601742377100187, "config_test": false...
from FEExpresser import FEExpresser from FESingleAUCNN import FESingleAUCNN import tensorflow as tf import thread class FEAggregatedCNN(FEExpresser): """Uses multiple individually trained FESingleAUCNNs together to produce predictions for a range of action units. """ def __init__(self, image_size, codes,...
{ "repo_name": "cosanlab/emote", "path": "src/face_express/FEAggregatedCNN.py", "copies": "1", "size": "2073", "license": "mit", "hash": 2185581006263473700, "line_mean": 28.6285714286, "line_max": 119, "alpha_frac": 0.6136034732, "autogenerated": false, "ratio": 3.9187145557655954, "config_test...
from fe import create_app from unittest import TestCase from mock import patch, MagicMock from wb_api import WBAPIUnauthorizedError, WBAPIHTTPError class TestFECase(TestCase): @patch('fe.WBAPI') def setUp(self, wbapi_mock): self.app = create_app('tests.config') self.client = self.app.test_cli...
{ "repo_name": "hmrc/wristband-frontend", "path": "tests/test_fe.py", "copies": "1", "size": "10048", "license": "apache-2.0", "hash": -5839692064833394000, "line_mean": 42.1244635193, "line_max": 98, "alpha_frac": 0.6109673567, "autogenerated": false, "ratio": 3.6117900790797988, "config_test":...
from fe import * from pgtypes import * from util import * from registry import * # Postgres Object ID constants class PgOids: BOOL = 16 BYTEA = 17 CHAR = 18 INT8 = 20 INT2 = 21 INT4 = 23 TEXT = 25 FLOAT4 = 700 FLOAT8 = 701 ABSTIME = 702 RELTIME = 703 TI...
{ "repo_name": "jamwt/pgasync", "path": "pgasync/__init__.py", "copies": "1", "size": "1506", "license": "bsd-3-clause", "hash": -6626427497417736000, "line_mean": 24.9655172414, "line_max": 105, "alpha_frac": 0.6806108898, "autogenerated": false, "ratio": 2.879541108986616, "config_test": false...
from feincms.content.medialibrary.models import MediaFileContent from feincms.content.richtext.models import RichTextContent from feincms.content.section.models import SectionContent class JsonRichTextContent(RichTextContent): class Meta(RichTextContent.Meta): abstract = True def json(self, **kwargs)...
{ "repo_name": "incuna/feincms-extensions", "path": "feincms_extensions/content_types.py", "copies": "1", "size": "1870", "license": "bsd-2-clause", "hash": -5141931966086073000, "line_mean": 29.1612903226, "line_max": 75, "alpha_frac": 0.6181818182, "autogenerated": false, "ratio": 4.318706697459...
from fellar.application import app from flask.ext.sqlalchemy import SQLAlchemy from glask.datetimes import now from sqlalchemy import Column, String, Text, ForeignKey, DateTime from sqlalchemy.dialects.postgresql import JSON from sqlalchemy.orm import relationship db = SQLAlchemy(app=app) Model = db.Model class Fac...
{ "repo_name": "sungmin-park/fellar", "path": "fellar/models.py", "copies": "1", "size": "1051", "license": "bsd-2-clause", "hash": 1445743920261218600, "line_mean": 34.0333333333, "line_max": 80, "alpha_frac": 0.7402473834, "autogenerated": false, "ratio": 3.7942238267148016, "config_test": fal...
from fem import QuadFE, DofHandler, Function from mesh import Mesh import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D mesh = Mesh.newmesh() for _ in range(5): mesh.refine() element = QuadFE(2,'Q3') f = Function( lambda x,y: np.sin(2*np.pi*x)*np.cos(3*np.pi*y), 'explicit') ...
{ "repo_name": "hvanwyk/quadmesh", "path": "debug/function_class.py", "copies": "1", "size": "1037", "license": "mit", "hash": -7390342767601152000, "line_mean": 27.8333333333, "line_max": 75, "alpha_frac": 0.6692381871, "autogenerated": false, "ratio": 2.5732009925558312, "config_test": false, ...
from FEMmesh import FEMmesh from FEMsolver import FEMsolver # 1) input mesh # mesh verts = [[0, -101, 0.0, 0.0], [1, 0, 2.0, 0.0], [2, -102, 4.0, 0.0], [3, -103, 6.0, 0.0], [4, 0, 8.0, 0.0], [5, -104, 10.0, 0.0], [6, 0, 2.0, 4.0], ...
{ "repo_name": "PaddySchmidt/gofem", "path": "fem/data/bridge01.py", "copies": "1", "size": "2177", "license": "bsd-3-clause", "hash": -7987530811781964000, "line_mean": 23.3139534884, "line_max": 50, "alpha_frac": 0.3619660083, "autogenerated": false, "ratio": 2.2748171368861025, "config_test":...
from FEMur import Element import sympy as sy import numpy as np import scipy as sc import matplotlib.pyplot as plt from math import ceil class Element2D(Element): 'Defines the Planar Elements with its nodes and shape functions' def __init__(self, element_type, node_table, index, analysis_type): Elemen...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/element2D.py", "copies": "1", "size": "26799", "license": "mit", "hash": 5859333129355483000, "line_mean": 31.8419117647, "line_max": 92, "alpha_frac": 0.5172581066, "autogenerated": false, "ratio": 3.3105620753551577, "config_test": false, "has_...
from FEMur import Mesh import sympy as sy import numpy as np import scipy as sc import matplotlib.pyplot as plt from scipy.special import p_roots class Mesh1D(Mesh): '1 Dimensional Mesh.' def __init__(self, domain, Number_of_elements, Nodes_per_element, conditions): self.start = domai...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/mesh1D.py", "copies": "1", "size": "10284", "license": "mit", "hash": 2295028442764691200, "line_mean": 33.8610169492, "line_max": 79, "alpha_frac": 0.5071956437, "autogenerated": false, "ratio": 3.9013657056145674, "config_test": false, "has_no_...
from FEMur import * import sympy as sy import numpy as np import scipy as sc import matplotlib.pyplot as plt import matplotlib.tri as tri import scipy.interpolate from math import ceil class Mesh2D(Mesh): """ 2 Dimensional Mesh definition based on GMSH 3.0 ASCII Mesh Format. This class will define import ...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/mesh2D.py", "copies": "1", "size": "11162", "license": "mit", "hash": -6262348016258207000, "line_mean": 39.0071684588, "line_max": 82, "alpha_frac": 0.464791256, "autogenerated": false, "ratio": 4.768047842802221, "config_test": false, "has_no_k...
from FEMur import * import sys import sympy as sy import numpy as np import scipy as sc import matplotlib.pyplot as plt import matplotlib.tri as tri import scipy.interpolate from math import ceil class Solver(object): ''' 2-dimensional solver top class. Provides common initialization to all child solver...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/solver2D.py", "copies": "1", "size": "7980", "license": "mit", "hash": -5207595663665154000, "line_mean": 30.5415019763, "line_max": 98, "alpha_frac": 0.5501253133, "autogenerated": false, "ratio": 3.5929761368752815, "config_test": false, "has_n...
from FEMur import Node class Node1D(Node): 'Class for all 1-D Nodes' total_nodes = 0 def __init__(self, x_coord, index): self.number = Node1D.total_nodes self.x = x_coord # X coordinate of the node. self.dof = 1 # Degree of freedom of the node. self.index = ...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/node1D.py", "copies": "1", "size": "1101", "license": "mit", "hash": -5953685388434434000, "line_mean": 35.7, "line_max": 77, "alpha_frac": 0.6003633061, "autogenerated": false, "ratio": 3.45141065830721, "config_test": false, "has_no_keywords": ...
from FEMur import Node class Node2D(Node): 'Class for all 2-D Nodes' total_nodes = 0 def __init__(self, x_coord, y_coord, index): self.number = Node2D.total_nodes self.x = x_coord # X coordinate of the node. self.y = y_coord # Y coordinate of the node. sel...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/node2D.py", "copies": "1", "size": "1476", "license": "mit", "hash": -2962883208701226500, "line_mean": 36.8461538462, "line_max": 79, "alpha_frac": 0.5745257453, "autogenerated": false, "ratio": 3.3318284424379234, "config_test": false, "has_no_...
from FEMur import Node class Node3D(Node): 'Class for all 3-D Nodes' total_nodes = 0 def __init__(self, x_coord, y_coord, z_coord, index): self.number = Node3D.total_nodes self.x = x_coord # X coordinate of the node. self.y = y_coord # Y coordinate of the node. ...
{ "repo_name": "MrJarv1s/FEMur", "path": "FEMur/node3D.py", "copies": "1", "size": "1560", "license": "mit", "hash": -4272908926432298000, "line_mean": 41.1621621622, "line_max": 79, "alpha_frac": 0.5448717949, "autogenerated": false, "ratio": 3.3620689655172415, "config_test": false, "has_no_...
from fenalib.assert_utils import assert_type, assert_list_types from fenalib.repr_utils import addrepr @addrepr class McFunction: """ Args: full_path (str) mfunc_name (str) debug (bool) Attributes: full_path (str): The full path to the mcfunction file mfunc_name (st...
{ "repo_name": "Aquafina-water-bottle/Command-Compiler-Unlimited", "path": "fenalib/mcfunction.py", "copies": "1", "size": "1520", "license": "mit", "hash": 3768614640269012000, "line_mean": 26.6363636364, "line_max": 80, "alpha_frac": 0.6013157895, "autogenerated": false, "ratio": 4.0860215053763...
from fenics import * from dolfin import * #gets boundary mesh and boundary values for said mesh def ply2bvals(infile): mesh=Mesh() editor=MeshEditor() a=infile.readline() while not(a.startswith("element vertex")): a=infile.readline() tempvals=[] b=a.split() n=int(b[2]) while not(a.startswith("element ...
{ "repo_name": "jcrist1/iterated_bdry_solver", "path": "src/ply2fn.py", "copies": "1", "size": "1524", "license": "mit", "hash": -8876226416460841000, "line_mean": 24.8305084746, "line_max": 64, "alpha_frac": 0.6463254593, "autogenerated": false, "ratio": 2.605128205128205, "config_test": false,...
from fenics import * import numpy as np import matplotlib.pyplot as plt from matplotlib import tri from math import pi,sinh,cosh from mshr import * # Create mesh and define function space box = Rectangle(Point(0, 0), Point(5,3)) mesh = generate_mesh(box, 400) # element of degree 1 V = FunctionSpace(mesh, 'P', 1) nearE...
{ "repo_name": "ChesnakovKonstantin/Test-Example", "path": "Python projects/fenics/PythonApplicationFenics.py", "copies": "1", "size": "2939", "license": "mit", "hash": -5339921266694018000, "line_mean": 32.0224719101, "line_max": 320, "alpha_frac": 0.6961551548, "autogenerated": false, "ratio": 2...
from fenics import * # Test for PETSc # Create mesh and define function space def inorout(V,boundaries,bvals,ibdry,obdry,key): if not has_linear_algebra_backend("PETSc"): info("DOLFIN has not been configured with TPETSc. Exiting.") exit() parameters["linear_algebra_backend"] = "PETSc" #key tells us whe...
{ "repo_name": "jcrist1/iterated_bdry_solver", "path": "src/code.py", "copies": "1", "size": "1692", "license": "mit", "hash": -8631733233499670000, "line_mean": 29.2142857143, "line_max": 178, "alpha_frac": 0.6708037825, "autogenerated": false, "ratio": 3.121771217712177, "config_test": false, ...
from fenoperator import FENOperator as FEN from sys import argv if '-silent' in argv or '-s' in argv: silentmode = True else: silentmode = False testnumber = 0 def testing (fen, out): global testnumber testnumber += 1 if not silentmode: print testnumber print str(fen) prin...
{ "repo_name": "Acebulf/PyUCI", "path": "tests/fentester.py", "copies": "1", "size": "3247", "license": "apache-2.0", "hash": 5307504712728750000, "line_mean": 33.5425531915, "line_max": 82, "alpha_frac": 0.7246689252, "autogenerated": false, "ratio": 1.7410187667560322, "config_test": true, "...
from fenpei import HopcroftKarp import copy #graph = {'a': {2,3}, 'b': {1, 3}, 'c': {1, 2}} #graph = {'a': {2,3}, 'b': {1, 2,4,5}, 'c': {2, 3}, 'd':{2,3}, 'e':{4,5}} #print(HopcroftKarp(graph).maximum_matching()) #testi = HopcroftKarp(graph).maximum_matching() #print(testi) graph1 = {'y1': {1}, 'y8':{2}, 'y...
{ "repo_name": "amazing814/masterthesis", "path": "test_fenpei.py", "copies": "1", "size": "1855", "license": "mit", "hash": 5767487667436424000, "line_mean": 34.6730769231, "line_max": 91, "alpha_frac": 0.5789757412, "autogenerated": false, "ratio": 2.48993288590604, "config_test": false, "ha...
from fermi_blind_search.database import Database import pytest def test_setup(configuration): db = Database(configuration) # create the tables so deleting them does not fail db.create_tables() # drop the tables to make sure they are empty when we start testing db.delete_results_table() db.d...
{ "repo_name": "giacomov/fermi_blind_search", "path": "test/test_db.py", "copies": "1", "size": "7280", "license": "bsd-3-clause", "hash": 1288493258669088500, "line_mean": 40.8390804598, "line_max": 120, "alpha_frac": 0.6346153846, "autogenerated": false, "ratio": 3.115104835258879, "config_tes...
from fern import errors from fern.ast.node import Node from fern.ast.tools import simplify, ItemStream from fern.ast.kvpair import KVPair from operator import attrgetter from fern.primitives import Undefined class Map(Node): def __init__(self): Node.__init__(self) self.children = [] # mostl...
{ "repo_name": "andrewf/fern", "path": "fern/ast/map.py", "copies": "1", "size": "2913", "license": "mit", "hash": -1961491637939044900, "line_mean": 33.2705882353, "line_max": 110, "alpha_frac": 0.5300377618, "autogenerated": false, "ratio": 4.347761194029851, "config_test": false, "has_no_ke...
from fern.primitives import Undefined import tools class Node(object): def __init__(self): self._parent = None self.value = None self.namebearing = False def reference(self, key): ''' Looks up a name/key reference in either this scope or the containing one. ...
{ "repo_name": "andrewf/fern", "path": "fern/ast/node.py", "copies": "1", "size": "3785", "license": "mit", "hash": -187287998418914620, "line_mean": 32.7946428571, "line_max": 78, "alpha_frac": 0.5696169089, "autogenerated": false, "ratio": 4.458186101295642, "config_test": false, "has_no_key...
from ferris.core.controller import Controller, route_with, route from ferrisnose import AppEngineWebTest class TestController(Controller): class Meta: prefixes = ['pre'] @route_with('/[controller]/[action]/<a>/<b>/<c>') @route_with('/[controller]/[action]/<a>/<b>') @route_with('/[controller]...
{ "repo_name": "markEarvin/sl-contest-tracker", "path": "ferris/tests/test_stacking_routes_and_vars.py", "copies": "3", "size": "3237", "license": "mit", "hash": 1803159565085329400, "line_mean": 39.9746835443, "line_max": 109, "alpha_frac": 0.6320667285, "autogenerated": false, "ratio": 3.2305389...
from ferris.core import inflector, autoadmin from ferris.core.forms import model_form from ferris.components.flash_messages import FlashMessages (autoadmin) # load autoadmin here, if any controller use scaffold it'll be included and initialized class Scaffolding(object): """ Scaffolding Component """ ...
{ "repo_name": "markEarvin/sl-contest-tracker", "path": "ferris/core/scaffold.py", "copies": "3", "size": "8637", "license": "mit", "hash": 1821595829126242600, "line_mean": 35.1380753138, "line_max": 181, "alpha_frac": 0.6694454093, "autogenerated": false, "ratio": 4.244226044226044, "config_te...
from ferris.core import plugins import threading import logging from .models.setting import Setting as SettingsModel from ferris import events from google.appengine.api import memcache import datetime plugins.register('settings') global_cache = {} local_cache = threading.local() def activate(settings): if 'ove...
{ "repo_name": "markEarvin/password-tracker", "path": "plugins/settings/__init__.py", "copies": "1", "size": "1146", "license": "mit", "hash": -827508272481562100, "line_mean": 23.3829787234, "line_max": 72, "alpha_frac": 0.6954624782, "autogenerated": false, "ratio": 3.7697368421052633, "config...
from ferris.core import search as ferris_search class Search(object): """ Provides a simple high-level interface to searching items in the App Engine Search API and utilizes the search helpers in :mod:`ferris.core.search`. """ def __init__(self, controller): self.controller = controller ...
{ "repo_name": "markEarvin/sl-contest-tracker", "path": "ferris/components/search.py", "copies": "3", "size": "2848", "license": "mit", "hash": -1840847677553104100, "line_mean": 39.6857142857, "line_max": 148, "alpha_frac": 0.6436095506, "autogenerated": false, "ratio": 4.348091603053435, "conf...
from ferris.core import settings, template from google.appengine.api import mail, app_identity import logging def send(recipient, subject, body, text_body=None, sender=None, reply_to=None, **kwargs): """ Sends an html email to ``recipient`` with the given ``subject`` and ``body``. If ``sender`` is none, ...
{ "repo_name": "markEarvin/password-tracker", "path": "ferris/core/mail.py", "copies": "1", "size": "2471", "license": "mit", "hash": -2298240778752739300, "line_mean": 34.8115942029, "line_max": 128, "alpha_frac": 0.6329421287, "autogenerated": false, "ratio": 3.9160063391442157, "config_test":...
from ferris.core import settings, template from google.appengine.api import mail import logging def send(recipient, subject, body, sender=None, reply_to=None, **kwargs): """ Sends an html email to ``recipient`` with the given ``subject`` and ``body``. If sender is none, it's automatically set to ``app_co...
{ "repo_name": "yowmamasita/social-listener-exam", "path": "ferris/core/mail.py", "copies": "1", "size": "1687", "license": "mit", "hash": -2295038938060013000, "line_mean": 32.74, "line_max": 108, "alpha_frac": 0.6253704801, "autogenerated": false, "ratio": 4.035885167464115, "config_test": fal...
from ferris.core.ndb import Behavior from ferris.core import search default_indexer = search.default_entity_indexer class Searchable(Behavior): """ Automatically indexes models during after_put into the App Engine Text Search API. """ def _get_index(self): if hasattr(self.Model.Meta, 'search...
{ "repo_name": "yowmamasita/social-listener-exam", "path": "ferris/behaviors/searchable.py", "copies": "3", "size": "1356", "license": "mit", "hash": 2574922930793688000, "line_mean": 38.8823529412, "line_max": 113, "alpha_frac": 0.6585545723, "autogenerated": false, "ratio": 3.941860465116279, ...
from ferris.core.ndb import ndb from ferris.core.response_handlers import ResponseHandler from protopigeon import Message, model_message, to_message, messages import logging def list_message(message_type): name = message_type.__name__ + 'List' fields = { 'items': messages.MessageField(message_type, 1,...
{ "repo_name": "markEarvin/password-tracker", "path": "ferris/core/messages/component.py", "copies": "1", "size": "5673", "license": "mit", "hash": 195540689384333730, "line_mean": 37.0738255034, "line_max": 138, "alpha_frac": 0.6448087432, "autogenerated": false, "ratio": 4.220982142857143, "co...
from ferris import Controller import tweepy class Tweets(Controller): def list(self): try: screen_name = self.request.params['q'] if screen_name: self.context['tweets'] = self.dump_tweets(screen_name) else: raise KeyError except: ...
{ "repo_name": "yowmamasita/social-listener-exam", "path": "app/controllers/tweets.py", "copies": "1", "size": "1245", "license": "mit", "hash": 602055706791988100, "line_mean": 31.7631578947, "line_max": 96, "alpha_frac": 0.6248995984, "autogenerated": false, "ratio": 2.8752886836027716, "confi...
from ferris import Controller, route, scaffold from ferris.core.oauth2.user_credentials import UserCredentials from ferris.components import oauth from apiclient.discovery import build from collections import OrderedDict import wtforms class AddForm(wtforms.Form): scopes = wtforms.TextAreaField(validators=[wtform...
{ "repo_name": "markEarvin/sl-contest-tracker", "path": "plugins/oauth_manager/controllers/oauth_manager.py", "copies": "3", "size": "1684", "license": "mit", "hash": -7336901581611596000, "line_mean": 29.6181818182, "line_max": 129, "alpha_frac": 0.6579572447, "autogenerated": false, "ratio": 4.0...
from ferris import plugins, settings, ndb plugins.register('service_account') from plugins.settings import SettingModel class ServiceAccountSettings(SettingModel): _name = 'OAuth2 Service Account' _settings_key = 'oauth2_service_account' domain = ndb.StringProperty(indexed=False, verbose_name="The Googl...
{ "repo_name": "yowmamasita/social-listener-exam", "path": "plugins/service_account/__init__.py", "copies": "1", "size": "2050", "license": "mit", "hash": -8541062236405735000, "line_mean": 30.5384615385, "line_max": 116, "alpha_frac": 0.7073170732, "autogenerated": false, "ratio": 4.0755467196819...
from ferrisnose import AppEngineTest from ferris.core.ndb import Model, Behavior, ndb class TestBehavior(Behavior): count = 0 deleted_count = 0 def before_put(self, instance): instance.string_two = instance.string_one + '4' def after_put(self, instance): TestBehavior.count += 1 ...
{ "repo_name": "markEarvin/password-tracker", "path": "ferris/tests/test_behaviors.py", "copies": "3", "size": "1173", "license": "mit", "hash": -4353933185128414000, "line_mean": 21.1320754717, "line_max": 55, "alpha_frac": 0.6240409207, "autogenerated": false, "ratio": 3.7717041800643085, "con...
from ferrisnose import AppEngineTest from ferris import Model, ndb, messages from ferris.core.bunch import Bunch from ferris.core.request_parsers import MessageParser from ferris.core.views import MessageView from ferris.core.event import NamedEvents from protorpc import protojson import json class Widget(Model): ...
{ "repo_name": "markEarvin/password-tracker", "path": "ferris/tests/test_message_parser.py", "copies": "3", "size": "1809", "license": "mit", "hash": -6144490770694910000, "line_mean": 30.1896551724, "line_max": 84, "alpha_frac": 0.679933665, "autogenerated": false, "ratio": 4.02, "config_test":...
from ferrisnose import AppEngineTest from google.appengine.api import memcache from ferris.core.memcache import cached, cached_by_args, none_sentinel_string class MemcacheTest(AppEngineTest): def test_cached(self): mutators = [0, 0, 0] @cached('test-key') def test_cached(): m...
{ "repo_name": "markEarvin/sl-contest-tracker", "path": "ferris/tests/test_memcache.py", "copies": "1", "size": "1562", "license": "mit", "hash": -7422565567163275000, "line_mean": 27.9259259259, "line_max": 77, "alpha_frac": 0.5563380282, "autogenerated": false, "ratio": 3.6839622641509435, "co...
from ferrisnose import AppEngineTest from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.api import search as search_api from ferris.core import search import datetime class SearchTestModel(ndb.Model): string = ndb.StringProperty() string2 = ndb.StringProperty() ...
{ "repo_name": "yowmamasita/social-listener-exam", "path": "ferris/tests/test_search.py", "copies": "1", "size": "2173", "license": "mit", "hash": 2392275382962044400, "line_mean": 32.953125, "line_max": 128, "alpha_frac": 0.6502531063, "autogenerated": false, "ratio": 3.887298747763864, "config...
from ferrisnose import AppEngineWebTest from ferris.core.controller import Controller, route from ferris.components import edge_cache class Cachable(Controller): class Meta: components = (edge_cache.EdgeCache,) @route def public(self): self.components.edge_cache('public') return '...
{ "repo_name": "markEarvin/password-tracker", "path": "ferris/tests/test_edge_caching.py", "copies": "1", "size": "1069", "license": "mit", "hash": -8534086918181847000, "line_mean": 26.4102564103, "line_max": 67, "alpha_frac": 0.6482694107, "autogenerated": false, "ratio": 3.698961937716263, "c...
from ferrisnose import AppEngineWebTest from ferris.core.controller import Controller, route from ferris.core.views import ViewContext, View, JsonView class Widgets(Controller): @route def json(self): self.meta.change_view('Json') self.context['data'] = {'one': 2} @route def template...
{ "repo_name": "yowmamasita/social-listener-exam", "path": "ferris/tests/test_views.py", "copies": "3", "size": "1184", "license": "mit", "hash": -5185890500832822000, "line_mean": 25.9090909091, "line_max": 57, "alpha_frac": 0.629222973, "autogenerated": false, "ratio": 3.654320987654321, "conf...
from ferrisnose import AppEngineWebTest from ferris.core import scaffold from ferris.core.controller import Controller, route from ferris.core.ndb import Model, ndb class Widget(Model): name = ndb.StringProperty() class Widgets(Controller): class Meta: prefixes = ('admin',) components = (sca...
{ "repo_name": "markEarvin/sl-contest-tracker", "path": "ferris/tests/test_scaffold.py", "copies": "3", "size": "3120", "license": "mit", "hash": 6076556580600946000, "line_mean": 30.2, "line_max": 134, "alpha_frac": 0.6006410256, "autogenerated": false, "ratio": 3.497757847533632, "config_test"...
from ferrox.controllers.gallery import find_submissions from ferrox.lib.base import * from ferrox.lib import pagination from ferrox.lib.formgen import FormGenerator from ferrox.model import form import pylons.config import logging import math import formencode log = logging.getLogger(__name__) def fetch_relationship...
{ "repo_name": "hsuaz/ferrox", "path": "ferrox/controllers/user.py", "copies": "2", "size": "4948", "license": "mit", "hash": 7768272015057450000, "line_mean": 36.7709923664, "line_max": 199, "alpha_frac": 0.5966046888, "autogenerated": false, "ratio": 3.785768936495792, "config_test": false, ...
from ferrox.controllers.user import fetch_relationships from ferrox.lib.base import * from ferrox.lib.formgen import FormGenerator from ferrox.lib.mimetype import get_mime_type from ferrox.model import form import pylons.config import logging import formencode log = logging.getLogger(__name__) class UserSettingsCont...
{ "repo_name": "hsuaz/ferrox", "path": "ferrox/controllers/user_settings.py", "copies": "2", "size": "7380", "license": "mit", "hash": -8147737086627571000, "line_mean": 37.8421052632, "line_max": 104, "alpha_frac": 0.5825203252, "autogenerated": false, "ratio": 4.075096631695196, "config_test":...
from ferrox import model import sqlalchemy.exceptions from sqlalchemy import or_, and_, not_ import re from binascii import crc32 class TagException(Exception): pass class TagNotFound(TagException): pass cache_by_text = {} """ Terms: tag_string = user input (a b -c) compiled_tag_string = tag_string using ...
{ "repo_name": "NetShepsky/Ferrox", "path": "ferrox/lib/tagging.py", "copies": "2", "size": "2338", "license": "mit", "hash": -7395826402293011000, "line_mean": 27.1686746988, "line_max": 101, "alpha_frac": 0.5868263473, "autogenerated": false, "ratio": 3.4895522388059703, "config_test": false, ...
from ferrox.lib.base import * from ferrox.lib.formgen import FormGenerator from ferrox.model import form from pylons import config import formencode import logging from sqlalchemy import sql log = logging.getLogger(__name__) class CommentsController(BaseController): def _get_parent_post(self, post_url): ...
{ "repo_name": "NetShepsky/Ferrox", "path": "ferrox/controllers/comments.py", "copies": "2", "size": "3412", "license": "mit", "hash": -421377392118991800, "line_mean": 31.8076923077, "line_max": 78, "alpha_frac": 0.5618405627, "autogenerated": false, "ratio": 4.135757575757576, "config_test": f...