text
stringlengths
4
1.02M
meta
dict
from command import PagedCommand from color import Coloring from error import NoSuchProjectError from git_refs import R_M class _Coloring(Coloring): def __init__(self, config): Coloring.__init__(self, config, "status") class Info(PagedCommand): common = True helpSummary = "Get info on the manifest branch, c...
{ "content_hash": "e8f511d1c2ece720967ae8ee5f57475a", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 86, "avg_line_length": 30.538071065989847, "alnum_prop": 0.5967420212765957, "repo_name": "GatorQue/git-repo-flow", "id": "649096236fade4f0a68340a8c7cf844f5c796b8d", "size...
import unittest from billy.sunlightapi import SunlightAPI from billy.sunlightparsers import MemberParser class TestCustomAPICalls(unittest.TestCase): def setUp(self): self.api = SunlightAPI() def test_get_member_recent_votes(self): # Test with Elizabeth Warren results = self.api.get...
{ "content_hash": "38fb800b67461b185592c8b9b3813b27", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 36.71212121212121, "alnum_prop": 0.658687577383409, "repo_name": "mosegontar/billybot", "id": "056ae7583efbe40e5af497e91426b8ed9768fe3a", "size": "24...
import os class GitException(Exception): def __init__(self, msg): super(GitException, self).__init__() self.msg = msg def __repr__(self): return "%s: %s" % (type(self).__name__, self.msg) __str__ = __repr__ class CannotFindRepository(GitException): pass class MergeConflict(Git...
{ "content_hash": "81b55a5103760370cbbc069f72e0c410", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 104, "avg_line_length": 34.51724137931034, "alnum_prop": 0.6183816183816184, "repo_name": "t-amerssonis/okami", "id": "4c4185cb71a30f42f64810de8a49a7a99a56356a", "size": "2...
"""A libusb1-based ADB reimplementation. ADB was giving us trouble with its client/server architecture, which is great for users and developers, but not so great for reliable scripting. This will allow us to more easily catch errors as Python exceptions instead of checking random exit codes, and all the other great be...
{ "content_hash": "f2a1af1d5181123d932ca76c09f50d27", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 80, "avg_line_length": 32.90677966101695, "alnum_prop": 0.6834921452485192, "repo_name": "maruel/python-adb", "id": "f57645fdfd37a2c6a48079d21cb6c2f3615ebd08", "size": "83...
import abc import numpy as np from pySDC.Collocation import CollBase from pySDC.Level import level from future.utils import with_metaclass class sweeper(with_metaclass(abc.ABCMeta)): """ Base abstract sweeper class Attributes: __level: current level coll: collocation object """ ...
{ "content_hash": "0eef7306dd851ba967dab0fcc7019127", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 92, "avg_line_length": 24.376623376623378, "alnum_prop": 0.5506126798082046, "repo_name": "kidaa/pySDC", "id": "fdba6341f196d4b8f77cdc8669dea4ec0d92d989", "size": "3754", ...
''' A simple Hy (hylang) kernel for IPython. ''' from __future__ import print_function import __future__ # NOQA import ast import re from IPython.kernel.zmq.ipkernel import IPythonKernel from IPython.utils.py3compat import PY3 import astor from hy.version import __version__ as hy_version from hy.macros import _h...
{ "content_hash": "2e68ece91c89c7be0628992393e89992", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 78, "avg_line_length": 30.643835616438356, "alnum_prop": 0.5346446133214126, "repo_name": "bollwyvl/hy_kernel", "id": "25a83f5dbdd36a4032f6435ab6c0630ea1a56563", "size": "...
"""Tests of Spanish g2p rules.""" from pynini.examples import g2p from absl.testing import absltest class SpanishG2PTest(absltest.TestCase): def assertPron(self, grapheme: str, phoneme: str): self.assertEqual(g2p.g2p(grapheme), phoneme) def testG2P(self): self.assertPron("anarquista", "anarkista") ...
{ "content_hash": "267893da64ddf910f9cbf470f6c8e19a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 52, "avg_line_length": 24.555555555555557, "alnum_prop": 0.6666666666666666, "repo_name": "kylebgorman/pynini", "id": "5d3924ab3beb07bf12107768e7569c3102d5c8b5", "size": "1...
from runner.koan import * class AboutInheritance(Koan): class Dog: def __init__(self, name): self._name = name @property def name(self): return self._name def bark(self): return "WOOF" class Chihuahua(Dog): def wag(self): ...
{ "content_hash": "546cc339d076dae676f975a4e9b24b0a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 85, "avg_line_length": 31.058139534883722, "alnum_prop": 0.5563459378509922, "repo_name": "kipel/koans", "id": "0ae0e242f639de1186848a064fc4ebb14e14d9f7", "size": "2718", ...
""" Tests for the ConfigurationAdmin tests :author: Thomas Calmant """ # Standard library import json import os import shutil import time try: import unittest2 as unittest except ImportError: import unittest # Pelix import pelix.framework import pelix.services as services from pelix.utilities import use_ser...
{ "content_hash": "e356506e28d8b7cdeb9b7e35292f4c25", "timestamp": "", "source": "github", "line_count": 653, "max_line_length": 80, "avg_line_length": 32.31087289433384, "alnum_prop": 0.5731077302241813, "repo_name": "tcalmant/ipopo", "id": "19c73f0c15f50d0d880f81143a620534b09401cd", "size": "21153...
from .. import app, db, api from flask.ext import security import pytz # Define models roles_users = db.Table('roles_users', db.Column('user_id', db.Integer(), db.ForeignKey('user.id')), db.Column('role_id', db.Integer(), db.ForeignKey('role.id')) ) class Role(db.Model, security.RoleMixin): id = db.Colum...
{ "content_hash": "fc80a6632d726d4bfa2a8cf18a2d87fe", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 75, "avg_line_length": 31.918032786885245, "alnum_prop": 0.6286594761171033, "repo_name": "andrewsnowden/flask-starter", "id": "573a86c2aac933d72da24b01dd96f5e4797e5b44", "...
from . import xmlwriter class Format(xmlwriter.XMLwriter): """ A class for writing the Excel XLSX Format file. """ ########################################################################### # # Public API. # ##########################################################################...
{ "content_hash": "673ac30bf93626a1d3e70fbdab6f7620", "timestamp": "", "source": "github", "line_count": 983, "max_line_length": 79, "avg_line_length": 26.106815869786367, "alnum_prop": 0.511163932509839, "repo_name": "jkyeung/XlsxWriter", "id": "4b55d9a0ac526670d02c98be3b6fb0e6ad69be49", "size": "2...
from .ect import ECT # noqa
{ "content_hash": "0afe9c8cfb5103e1846c2e133ca97544", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 28, "avg_line_length": 29, "alnum_prop": 0.6896551724137931, "repo_name": "rpedigoni/trackr", "id": "fdb697260a4b04f73755ea056312f0fa19c7c8dd", "size": "29", "binary": fal...
"""PKDict abstraction and utils `PKDict` is similar to :class:`argparse.Namespace`, but is a dict that allows you to treat elements as attributes. :copyright: Copyright (c) 2015-2022 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ # Limit pykern imports so avoid depe...
{ "content_hash": "f4e26d9fd7c7ab669ed3be8f89dd85db", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 111, "avg_line_length": 31.86918604651163, "alnum_prop": 0.583781811547934, "repo_name": "radiasoft/pykern", "id": "e195a6378d2af972ca8da03aaac7e5bba3a1fe3c", "size": "109...
"""The command group for cloud container clusters.""" from googlecloudsdk.calliope import base class Clusters(base.Group): """Deploy and teardown Google Container Engine clusters.""" @staticmethod def Args(parser): """Add arguments to the parser. Args: parser: argparse.ArgumentParser, This is a...
{ "content_hash": "44ab5adf1e8a02ce7f71b1a790ad8f60", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 80, "avg_line_length": 28.53125, "alnum_prop": 0.687842278203724, "repo_name": "wemanuel/smry", "id": "f797a0e18e7e13595ed1179ddab7ad6992d7a2c6", "size": "964", "binary":...
from .expression import Expression from .nameexpr import NameExpr class AnnotationExpr(Expression): def __init__(self, kwargs={}): super(AnnotationExpr, self).__init__(kwargs) # NameExpr name; name = kwargs.get(u'name', {}) self._name = NameExpr(name) def __str__(self): ...
{ "content_hash": "0a1da9edcf9a378acf39e8b634ab1cb6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 26.53846153846154, "alnum_prop": 0.6144927536231884, "repo_name": "plum-umd/java-sketch", "id": "9deaa6a5599a3da456bda19efaab018a1d61fa31", "size": "...
from flask_wtf import Form from wtforms import PasswordField, StringField, HiddenField, TextAreaField, IntegerField from wtforms.validators import DataRequired, NumberRange, url from flask_wtf.html5 import URLField class PasswordForm(Form): next = HiddenField("next", validators=[DataRequired()]) password = P...
{ "content_hash": "f09d014fc2967a3ae496cf077b68c222", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 88, "avg_line_length": 32.857142857142854, "alnum_prop": 0.7217391304347827, "repo_name": "Ignotus/bookclub", "id": "d358d6e7fae6690e2aeeb8f2e0b727c30a50ea17", "size": "115...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'Event', fields ['end_at'] db.create_index('maintenancewindow_event', ['end_at']) # Adding index ...
{ "content_hash": "ec35791ff301f491630338fd9290a74d", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 120, "avg_line_length": 40.85, "alnum_prop": 0.5844553243574051, "repo_name": "jamilatta/scielo-manager", "id": "fc5c7b8c13f9c1d7a985b1a2e3c928286fe9237c", "size": "1652", ...
"""The mill component.""" from __future__ import annotations from datetime import timedelta import logging from mill import Mill from mill_local import Mill as MillLocal from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD, CONF_USERNAME, Platform from h...
{ "content_hash": "64c44f9b2eb50743e3448ba99dce2f62", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 87, "avg_line_length": 32.56470588235294, "alnum_prop": 0.6791907514450867, "repo_name": "mezz64/home-assistant", "id": "8fd1d1a3e22dd5f7f9fb6d7b048ea6551eebd716", "size": ...
import string import types from process_common import * from header_common import * from header_operations import * from module_strings import * from module_skills import * from module_music import * from module_meshes import * from module_sounds import * from module_items import * from module_troops import * from mo...
{ "content_hash": "29153f56efdc5db13a3c72183536f813", "timestamp": "", "source": "github", "line_count": 473, "max_line_length": 138, "avg_line_length": 32.36363636363637, "alnum_prop": 0.636529918996603, "repo_name": "infobeisel/mbnwcModSys", "id": "cd647d64d119f1d5067c4a8af18f08aead3bd7cb", "size"...
import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.Eras import eras process = cms.Process('NTUPLE',eras.Run2_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.M...
{ "content_hash": "44b0d42a3d6db840711813eade4c2e57", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 363, "avg_line_length": 50.358543417366946, "alnum_prop": 0.705139615085104, "repo_name": "hunyadix/PhaseISplitClusterAnalyzer", "id": "d630cb8d85c47b4edc52d752e557e160c58ae...
from clubsandwich.geom import Point from clubsandwich.ui import RectView from stats.enums import StatsEnum class HudWindow(RectView): def __init__(self, game_context, **kwargs): super().__init__(fill=True, **kwargs) self.game_context = game_context def draw(self, ctx): player = self....
{ "content_hash": "8eafc740cab81a2ae2353c7b8960279c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 92, "avg_line_length": 36.76190476190476, "alnum_prop": 0.6398963730569949, "repo_name": "ChrisLR/Python-Roguelike-Template", "id": "a9a4a23f3477d0d161f3b7cdb91fbeaf20a633dc"...
N = int(input()) tweet = input()[:-1].split() checkWords = ['TAKAHASHIKUN', 'Takahashikun', 'takahashikun'] print(sum([1 for w in tweet if w in checkWords]))
{ "content_hash": "ab0a873eb253b639ae4b1f34eedb0be4", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 61, "avg_line_length": 31.8, "alnum_prop": 0.6666666666666666, "repo_name": "knuu/competitive-programming", "id": "b81c1f0086755c01a654f0e77d3ae1f65b58ebf9", "size": "159", ...
import os import sys defaultSources = ['file:///usr/share/snmp/mibs', 'file:///usr/share/mibs'] if sys.platform[:3] == 'win': defaultDest = os.path.join(os.path.expanduser("~"), 'PySNMP Configuration', 'mibs') else: defaultDest = os.path.join(os.path.expanduser("~"), '.pysnmp', ...
{ "content_hash": "eea2771ba9a8bf19819ad7fdbcdf187a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 187, "avg_line_length": 38.51851851851852, "alnum_prop": 0.6846153846153846, "repo_name": "mith1979/ansible_automation", "id": "84dde53d463deb0795721724b4dc34a317227cde", "...
import objc from PyObjCTools.TestSupport import * NSObject = objc.lookUpClass('NSObject') class TestBasicIMP (TestCase): # Test the basic functionality of IMP's. Imp's are basically unbound # selectors if you look at the interface. The implementation refers to # the actual functions that implements the m...
{ "content_hash": "87543b8ec3ef42f5484eecaf97f76061", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 128, "avg_line_length": 34.016666666666666, "alnum_prop": 0.6315531602155806, "repo_name": "ariabuckles/pyobjc-core", "id": "bc78a9109dfc09d4f5629375daa419efa0e33ebf", "siz...
""" .. module: security_monkey.tests.auditors.github.test_team_auditor :platform: Unix .. version:: $$VERSION$$ .. moduleauthor:: Mike Grima <mgrima@netflix.com> """ from security_monkey.datastore import Account, AccountType, Technology from security_monkey.tests import SecurityMonkeyTestCase from security_monke...
{ "content_hash": "0ab2daff1dee3529365ba63964d58e47", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 96, "avg_line_length": 34.52173913043478, "alnum_prop": 0.647774979009236, "repo_name": "Netflix/security_monkey", "id": "f59a6547ad7fc9f7950eead9db4264d120e28721", "size":...
import random import django from django.test import TestCase from django.utils import timezone from core.models import User, Event, Join def get_random_latitude(): return random.uniform(-90, +90) def get_random_longitude(): return random.uniform(-180, +180) def create_event(name, event_owner, start_date_time...
{ "content_hash": "375337bd8e7a31373354089ccc57da2d", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 97, "avg_line_length": 38.20987654320987, "alnum_prop": 0.5932148626817447, "repo_name": "LorenzSelv/pinned", "id": "37b0362dc143e8c375f5f27422636aac789e4059", "size": "309...
class VerificaUpload: def __init__(self): print("Verifica Upload") def verifica(self,diretorio): pass
{ "content_hash": "3568d842b53caeb6723cf415c116495f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 33, "avg_line_length": 21.166666666666668, "alnum_prop": 0.6062992125984252, "repo_name": "Dturati/projetoUFMT", "id": "57874eca760c6a17fc7cd35471484d8052de4e1d", "size": "1...
"""A class to keep track of devices across builds and report state.""" import argparse import json import logging import os import psutil import re import signal import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import devil_chromium from devil import devil_env from devil.andr...
{ "content_hash": "e885e74cb359e0e3448a435d72026079", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 80, "avg_line_length": 34.51690821256039, "alnum_prop": 0.620923722883135, "repo_name": "hujiajie/chromium-crosswalk", "id": "c8b3386d61d468a5a08939f84a04dc5f0ca8ac8e", "s...
""" Uses daily bhavcopy to download historical data for all stocks. One challenge is, bhavcopy has the symbol name for that day. In case of NSE, the symbol names change and that's a problem, so we need a way to track changes in symbol names as well. All this data is stored in an SQLite database as we download, as some...
{ "content_hash": "72f9a036f42c8a4a99416eb4b19b6449", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 120, "avg_line_length": 34.033248081841435, "alnum_prop": 0.5687983767941684, "repo_name": "gabhijit/tickdownload", "id": "d667e88bcb3ba0fcdea21c31e561402f36dd2903", "size...
from django.conf import settings from django.contrib.auth.models import Permission from django.contrib.auth.views import redirect_to_login from django.db import models from django.urls import reverse from django.utils.text import capfirst from django.utils.translation import gettext_lazy as _ from django.utils.translat...
{ "content_hash": "d7d1da803e92b409c789180eb6a1f34f", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 117, "avg_line_length": 40.15503875968992, "alnum_prop": 0.5518339768339768, "repo_name": "rsalmaso/wagtail", "id": "791ead85093e52b02f9b8e5afef8546b4aafbef5", "size": "20...
import os import re import time import json from collections import OrderedDict import pkg_resources import pandas as pd from Bio import SeqIO from Bio import Entrez Entrez.email = "testing@ucsd.edu" def untag(rule): return re.sub('\?P<.*?>', '', rule) def parse_antiSMASH(content): """ Parse antiSMASH outp...
{ "content_hash": "425832e6789edb480bd5827ee72c8a40", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 163, "avg_line_length": 31.610795454545453, "alnum_prop": 0.5234115215242203, "repo_name": "tiagolbiotech/BioCompass", "id": "4dcc3dbae9535ce00a6b3d8e83e8b0a712e75656", "s...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('music', '0001_initial'), ] operations = [ migrations.AddField( model_name='music', name='si...
{ "content_hash": "99e62e5f1cb1fbb9973d4fec60e72b05", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 145, "avg_line_length": 33.15384615384615, "alnum_prop": 0.576952822892498, "repo_name": "tea321000/django-project", "id": "d91af87cb825b0ba8e267f785b2fee46e3ef679e", "size...
from scrapy.loader import ItemLoader from scrapy.loader.processors import TakeFirst, MapCompose from scrapy.spiders import Spider from w3lib.html import remove_tags class MySpider(Spider): name = '' start_urls = [''] #FIRST LEVEL # 1. SCRAPING def parse(self, response): item_loader = ItemLoad...
{ "content_hash": "747cbf2da2260b01a52a9347fd7497b1", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 69, "avg_line_length": 32.55, "alnum_prop": 0.6666666666666666, "repo_name": "zseta/scrapy-templates", "id": "ceac4c1ecc59b0ab9853422c4933045c392742e2", "size": "878", "b...
""" <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> A Figurer """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Standards.Viewers.Viewer" DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer" SYS.setSubModule(globals())...
{ "content_hash": "7ad4caccb0c8f2db9f7300491a508350", "timestamp": "", "source": "github", "line_count": 1113, "max_line_length": 136, "avg_line_length": 20.497753818508535, "alnum_prop": 0.6155869203120891, "repo_name": "Ledoux/ShareYourSystem", "id": "eece8450a691fd80642356de08246bef5728afea", "si...
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # --...
{ "content_hash": "0c0de5629e99833c81c2385dae65f1f8", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 79, "avg_line_length": 32.38434163701068, "alnum_prop": 0.704945054945055, "repo_name": "paulmthompson/Spikes.jl", "id": "43b8e2112ccec4843b880ad6184c264311aa5494", "size"...
import numpy import cv2 img=cv2.imread("/home/udayan/Downloads/messi.jpg", 0) #read image, 0=read as grayscale, -1=read as color template=cv2.imread("/home/udayan/Downloads/messi_face.jpg", 0) #read image, 0=read as grayscale, -1=read as color h, w=template.shape result=cv2.matchTemplate(img, template, cv2.TM_...
{ "content_hash": "312d9ff2f79d4ae0da71cf5e1df10352", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 292, "avg_line_length": 59.666666666666664, "alnum_prop": 0.7465083798882681, "repo_name": "UdayanSinha/Code_Blocks", "id": "f23b20a19b93d26fc7d85fca5c783db154289046", "siz...
from datetime import datetime from vectortile import TypedMatrix class Tile(object): def __init__(self, typedmatrix_str, meta=None): """ :param typedmatrix_str: a packed string as returned by TypedMatrix.pack() """ self.typedmatrix_str = typedmatrix_str if not meta: ...
{ "content_hash": "9b9ec5c989e060abfb640306c99272b3", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 123, "avg_line_length": 29.734375, "alnum_prop": 0.6132422490803994, "repo_name": "SkyTruth/vectortile", "id": "61394c44b0bafd7417751f8d9b73be318752a2ab", "size": "1903", ...
from threading import Thread from flask import current_app, render_template from flask.ext.mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_app._get_current_object() msg = ...
{ "content_hash": "159096d3eb43aef8c750689994b828e4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 84, "avg_line_length": 38.2, "alnum_prop": 0.6492146596858639, "repo_name": "SuperQuest/v1", "id": "61052f357d9357703a9667f41469241322fc2d88", "size": "1146", "binary": f...
from __future__ import unicode_literals from django.core.files.storage import default_storage from django.db import models from django.db.models import signals import subprocess from videokit.apps import VideokitConfig from videokit.cache import get_videokit_cache_backend from videokit.fields import VideoFieldFile...
{ "content_hash": "d7baf97267f8ce4189231e20bf6179cd", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 109, "avg_line_length": 33.10276679841897, "alnum_prop": 0.5982089552238806, "repo_name": "pstreck/django-videokit", "id": "fd4935a5e14d4ff0ba662b36362f6d9afac23512", "siz...
import unittest2 from lldbsuite.test.decorators import * from lldbsuite.test.concurrent_base import ConcurrentEventsBase from lldbsuite.test.lldbtest import TestBase @skipIfWindows class ConcurrentSignalNWatchNBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD ...
{ "content_hash": "6e8dc5211ee1c9872a9c3e33ef8d2223", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 78, "avg_line_length": 35.78260869565217, "alnum_prop": 0.6950182260024301, "repo_name": "endlessm/chromium-browser", "id": "3b005e559a494562657aaec19b26f2d15a19d982", "siz...
class Person(object): """ A simple class representing a person object. """ #initialize name, ID number, city def __init__(self, fname, lname, ID, city): self.__ID = ID self.__first_name = fname self.__last_name = lname self.__city = city def _getName(self): ...
{ "content_hash": "be2bbbbe89b297f4c06206e731ba988f", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 87, "avg_line_length": 26.229166666666668, "alnum_prop": 0.5655281969817315, "repo_name": "janusnic/21v-python", "id": "8b4b5470aa3541846142ac23c652a55db9e54063", "size": "...
from Tkinter import * import sys, os, glob reload(sys) sys.setdefaultencoding('utf-8') # encoding Chinese class Application(Frame): def __init__(self, master): Frame.__init__(self, master) self.readme_Tag = False self.printLogs_Tag = False self.newLog_Tag = False sel...
{ "content_hash": "87a78a9cbb65897f59ca79946db59c51", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 87, "avg_line_length": 27.91275167785235, "alnum_prop": 0.5874008175042077, "repo_name": "lyltj2010/OMOOC2py", "id": "e8eee1d9201aaf9692e9e644280ac2f599112063", "size": "4...
import json import urllib.request import logging import time import datetime import csv import sys def getltcbtc(): # Get a number that we can multiple with LTC to get BTC url = "https://crypto-trade.com/api/1/ticker/ltc_btc" value = 0 request = urllib.request.Request(url) response = urllib.request.urlopen(reque...
{ "content_hash": "efd486cace9eede08a35b0c2a9f47d1d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 29.74074074074074, "alnum_prop": 0.7185554171855542, "repo_name": "chalbersma/mwgi", "id": "acbb1410d86f69e1fd0cfa594e0d0f796a3e7b7e", "size": "827",...
import datetime import os import urlparse from us_ignite.settings.base import * DEBUG = True TEMPLATE_DEBUG = DEBUG # Sensitive values are saved as env variables: env = os.getenv PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) # settings is one directory up now here = lambda *x: os.path.join(PROJECT_ROOT,...
{ "content_hash": "e6813e339fadf802e923c545f842224e", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 70, "avg_line_length": 26.093457943925234, "alnum_prop": 0.6966332378223495, "repo_name": "us-ignite/us_ignite", "id": "7e5784e8c96dc7c43a05fd6e0d1b6c33eb27b232", "size": ...
import clr import System clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * def IsInPlace(item): if hasattr(item, "IsInPlace"): return item.IsInPlace else: return None items = UnwrapElement(IN[0]) if isinstance(IN[0], list): OUT = [IsInPlace(x) for x in items] else: OUT = IsInPlace(items)
{ "content_hash": "ab80030a72fcea9a12d802017fd7fcfd", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 63, "avg_line_length": 23.384615384615383, "alnum_prop": 0.7401315789473685, "repo_name": "CAAD-RWTH/ClockworkForDynamo", "id": "508785b9560eb27f3e184e5303ce61485f82497e", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0131_realm_create_generic_bot_by_admins_only'), ] operations = [ migrations.AddField( model_name='realm', name='message_visibility_limit', fiel...
{ "content_hash": "1933864fe110dc562d7155559765c863", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 67, "avg_line_length": 23.1875, "alnum_prop": 0.5956873315363881, "repo_name": "brainwane/zulip", "id": "3a8ad88ec95bd8c73e60c21ce61c3106c9ee6627", "size": "421", "binary...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): from sentry.constants import RESERVED_TEAM_SLUGS from sentry.models import slugify_instance try: superuser = orm['sen...
{ "content_hash": "ceb472cde30910d47984d9da5839a5de", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 225, "avg_line_length": 81.60576923076923, "alnum_prop": 0.5488001256824162, "repo_name": "rdio/sentry", "id": "3ed601693a0023dcf5d6d49b08bbf91f7753aab0", "size": "25485",...
""" Install the `arte_plus7` script """ from setuptools import setup NAME = 'arte_plus7' LONG_DESCRIPTION_FILES = ['README.rst', 'CHANGELOG.rst'] def cat(files, join_str=''): """Concatenate `files` content with `join_str` between them.""" files_content = (open(f).read() for f in files) return join_str...
{ "content_hash": "797825caa6db1a0d7a3e6e5339fcfbfa", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 76, "avg_line_length": 30.215686274509803, "alnum_prop": 0.6353017521090201, "repo_name": "cladmi/arte_plus7", "id": "1063fb9d42d5eda2f80a8984fc01e88dbbae796b", "size": "15...
import hmac import uuid from hashlib import sha1 from django.db import models from rest_framework.authtoken.models import AUTH_USER_MODEL from cyder.base.mixins import ObjectUrlMixin class Token(models.Model, ObjectUrlMixin): """Because Django REST Framework's Token model defines the user field a OneToOneFi...
{ "content_hash": "1b9771325c974ae60a415a953a67d960", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 79, "avg_line_length": 34.020833333333336, "alnum_prop": 0.6080832823025107, "repo_name": "zeeman/cyder", "id": "5e8b788e5656dadc01ef7794ce30464d19f9365e", "size": "1633", ...
from datetime import datetime from flask import Blueprint, render_template, send_file, redirect, url_for from models.spiders import get_all_spiders, delete_spider, get_stats from helpers.scrapy_util import start_crawler, start_logger from helpers.config_reader import GLOBAL_PATH from dateutil import parser spiders_bp ...
{ "content_hash": "b87d205d1759024d3c6f0d0e6ceec69d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 75, "avg_line_length": 39.68, "alnum_prop": 0.6567540322580645, "repo_name": "kirankoduru/arachne-ui", "id": "52b677b32694996417d1109bfd512f405fd58b25", "size": "1984", "...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, ) class KhanAcademyIE(InfoExtractor): _VALID_URL = r'^https?://(?:(?:www|api)\.)?khanacademy\.org/(?P<key>[^/]+)/(?:[^/]+/){,2}(?P<id>[^?#/]+)(?:$|[?#])' IE_NAME = 'KhanAcademy' ...
{ "content_hash": "e3082825b98ae849bf24402da6ba2979", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 119, "avg_line_length": 33.426829268292686, "alnum_prop": 0.45822692448011676, "repo_name": "achang97/YouTunes", "id": "61739efa7a4c3b84892083eab10237c23eb69e3d", "size": "...
from webclient.models import * from django.contrib import admin from django import forms from django.utils.html import format_html admin.site.register(Image) #admin.site.register(ImageLabel) admin.site.register(ImageSourceType) admin.site.register(CategoryType) admin.site.register(ImageFilter) cl...
{ "content_hash": "a40d61aea20fbdfc4ff4480a03a64409", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 121, "avg_line_length": 32.724137931034484, "alnum_prop": 0.6301369863013698, "repo_name": "darknight-007/agdss-1", "id": "c2535a1f334a5e913a29dd9208647a901dce098f", "size"...
from .core import base
{ "content_hash": "4bdbcc3ab13da6bc3fcae4b8b501c352", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 22, "avg_line_length": 23, "alnum_prop": 0.782608695652174, "repo_name": "Clinical-Genomics/housekeeper", "id": "a9e0e7763b34ceffb85b399a5af9d39318b6670a", "size": "47", "...
from .util import * from electrum.i18n import _ class UTXOList(MyTreeWidget): filter_columns = [0, 2] # Address, Label def __init__(self, parent=None): MyTreeWidget.__init__(self, parent, self.create_menu, [ _('Address'), _('Label'), _('Amount'), _('Height'), _('Output point')], 1) self.setS...
{ "content_hash": "505f706ea7707beb329e502956cd17d5", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 138, "avg_line_length": 40.886792452830186, "alnum_prop": 0.5925242270419936, "repo_name": "kyuupichan/electrum", "id": "78e865360697a9b57e810ba97ef885d6a8d5ba47", "size": ...
import os, multiprocessing, subprocess from runner import BrowserCore, path_from_root from tools.shared import * def clean_pids(pids): import signal, errno def pid_exists(pid): try: # NOTE: may just kill the process in Windows os.kill(pid, 0) except OSError, e: return e.errno == errno.EPE...
{ "content_hash": "f204f44f0b47f8d2f9983e7071322d0e", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 272, "avg_line_length": 45.409181636726544, "alnum_prop": 0.624, "repo_name": "slightperturbation/Cobalt", "id": "ce6b1ab3d1bf1e02abe669a7db165e011652464a", "size": "22750...
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('insekta.scenario.views', url(r'^$', 'scenario_home', name='scenario.home'), url(r'^groups$', 'scenario_groups', name='scenario.groups'), url(r'^all$', 'all_scenarios', name='scenario.all'), url(r'^show/([\w-]+)$', 'show_scenario', ...
{ "content_hash": "454b24fad08b59753892e5a3adac714b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 72, "avg_line_length": 49.07692307692308, "alnum_prop": 0.6253918495297806, "repo_name": "teythoon/Insekta", "id": "362b18a32fe9c4244ede58e1c76e2a3e93c7e80f", "size": "638"...
"""Definition of platform parameters.""" from __future__ import absolute_import # pylint: disable=import-only-modules from __future__ import unicode_literals # pylint: disable=import-only-modules from core.domain import platform_parameter_domain from core.domain import platform_parameter_registry as registry import...
{ "content_hash": "ea6a03f8eb89cd4110d334e347c956b3", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 88, "avg_line_length": 32.62068965517241, "alnum_prop": 0.7642706131078224, "repo_name": "prasanna08/oppia", "id": "94215e6e166c76fd4adafa54a2f908518dba431c", "size": "1569...
"""Type conversion and validation classes for configuration options. Use these classes as values for the `type` argument to :class:`oslo_config.cfg.Opt` and its subclasses. """ import re import netaddr import six class ConfigType(object): BASE_TYPES = (None,) def is_base_type(self, other): return...
{ "content_hash": "f27a392f62e0c437d17703355d3f6703", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 79, "avg_line_length": 28.60620525059666, "alnum_prop": 0.539629567829134, "repo_name": "shad7/oslo.config", "id": "6245eecb980d27977309f8d77d955691ade8d2a6", "size": "125...
from __future__ import absolute_import # import apis into api package from .binary_api import BinaryApi from .case_record_api import CaseRecordApi from .classification_api import ClassificationApi from .contact_item_api import ContactItemApi from .document_state_api import DocumentStateApi from .generic_question_api i...
{ "content_hash": "bc420bc016bbf5bcc2a02da72c7567f6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 54, "avg_line_length": 41.208333333333336, "alnum_prop": 0.8452982810920121, "repo_name": "tombull/hackneylawclassifier", "id": "a6eae6da7a20abaec8504fb7cb6211496cca39f4", ...
import os import tempfile from typing import List, Any from py4j.java_gateway import JavaObject from pyflink.common.execution_config import ExecutionConfig from pyflink.common.job_client import JobClient from pyflink.common.job_execution_result import JobExecutionResult from pyflink.common.restart_strategy import Re...
{ "content_hash": "24dee29dbf4ccfa749cf6b9a7ebbf070", "timestamp": "", "source": "github", "line_count": 745, "max_line_length": 100, "avg_line_length": 45.26979865771812, "alnum_prop": 0.6609440787522979, "repo_name": "darionyaphet/flink", "id": "c25a7db2658f221abebe871a957bab7db23a9188", "size": "...
from chatbot.bot import BotPlugin, command import random class Plugin(BotPlugin): def __init__(self, bot): super().__init__(bot) self.register_command("missing_8ball", self._question, argc=0, flags=command.CommandFlag.Missing) @staticmethod def get_default_config(): return { ...
{ "content_hash": "2c67a9724438f956803072fd8e27d345", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 105, "avg_line_length": 29.153846153846153, "alnum_prop": 0.5277044854881267, "repo_name": "mphe/pychatbot", "id": "de99d0bced4bc0df32a5a297ac9a04f9672ea378", "size": "783"...
from datetime import datetime from time import time import click from twisted.internet import defer, endpoints, reactor # pylint: disable=import-error from twisted.logger import ILogObserver # pylint: disable=import-error from twisted.logger import Logger # pylint: disable=import-error from twisted.logger import Lo...
{ "content_hash": "2ff1c94f3187b262f3abc374c162c849", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 88, "avg_line_length": 35.513966480446925, "alnum_prop": 0.6043731319804939, "repo_name": "platformio/platformio-core", "id": "fe2c4fb4c90efb4a3af8801b602cf634639f0747", "...
"""Script to aggregate CDC Data at a country level from state level data.""" import pandas as pd from absl import app from absl import flags flags.DEFINE_string('input_path', None, 'Path to input CSV with state level data.') flags.DEFINE_string('output_path', None, 'Output CSV path.') _FLAGS = f...
{ "content_hash": "090b4873b89b5ba2d5dbdcf84ce53047", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 32.83870967741935, "alnum_prop": 0.600196463654224, "repo_name": "datacommonsorg/data", "id": "e00d7cb46004a80511142ae77dd5dc2c369497ce", "size": "15...
import logging import paho.mqtt.client as mqtt import config logger = logging.getLogger(__name__) def on_connect(client, userdata, rc): """ The callback for when the client receives a CONNACK response from the server. Subscribing in on_connect() means that if we lose the connection and reconnect the...
{ "content_hash": "1a2fe614ae0ed63a017cbc2902929012", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 81, "avg_line_length": 34.973684210526315, "alnum_prop": 0.6561324303987961, "repo_name": "RRMoelker/socketMQTT", "id": "acfe9bf7f83a0ed50382fcb536ae4c91045f8684", "size": ...
"""distutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. """ __revision__ = "$Id$" import sys, os, string, re from distutils.errors import DistutilsPlatformError from distutils.dep_util import newer from distutils.spawn import spawn from distutils import ...
{ "content_hash": "162bbb563b5ee82bb944dd47575280ee", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 79, "avg_line_length": 38.068541300527244, "alnum_prop": 0.5751812012372467, "repo_name": "Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86", "id": "7e598c55ae0edbd4...
"""deCONZ service tests.""" from asynctest import Mock, patch import pytest import voluptuous as vol from homeassistant.components import deconz from homeassistant.components.deconz.const import CONF_BRIDGE_ID from .test_gateway import BRIDGEID, setup_deconz_integration GROUP = { "1": { "id": "Group 1 i...
{ "content_hash": "86da82aebeb895bddd19402c6f5057c1", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 87, "avg_line_length": 34.35175879396985, "alnum_prop": 0.6391164423639555, "repo_name": "Teagan42/home-assistant", "id": "07985e4d9f4b388c7334a5380beb8e10a33abf79", "size...
import logging import pytest import sdk_install import sdk_metrics import sdk_plan import sdk_utils from tests import config log = logging.getLogger(__name__) foldered_name = sdk_utils.get_foldered_name(config.SERVICE_NAME) @pytest.fixture(scope="function", autouse=True) def configure_package(configure_security): ...
{ "content_hash": "dc2465f6eb90f0dd4100f8382e061939", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 95, "avg_line_length": 33.732394366197184, "alnum_prop": 0.6910229645093946, "repo_name": "mesosphere/dcos-commons", "id": "71d967c128eb52f27664dc2e884cebae76c4c2c7", "size...
""" This module contains loss classes suitable for fitting. It is not part of the public API. Specific losses are used for regression, binary classification or multiclass classification. """ # Goals: # - Provide a common private module for loss functions/classes. # - To be used in: # - LogisticRegression # - Poiss...
{ "content_hash": "d881ca05866b6e19c4bd4cb31b759f1f", "timestamp": "", "source": "github", "line_count": 924, "max_line_length": 87, "avg_line_length": 35.15367965367965, "alnum_prop": 0.6047965026784065, "repo_name": "sergeyf/scikit-learn", "id": "d883c0e1bd1906e1c96915c1638c8789f7691639", "size": ...
from __future__ import absolute_import import math from sentry.utils.compat.mock import Mock from sentry.utils.cursors import build_cursor, Cursor def build_mock(**attrs): obj = Mock() for key, value in attrs.items(): setattr(obj, key, value) obj.__repr__ = lambda x: repr(attrs) return obj ...
{ "content_hash": "6b44feb15e647c70cd13c88519a806f8", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 28.142857142857142, "alnum_prop": 0.6722262509064539, "repo_name": "beeftornado/sentry", "id": "81e1f04e72fd4dead4ca46cf0d725aa1f7b8ec38", "size": "1...
import numpy as np from ..core import SparseGP from .. import likelihoods from .. import kern from ..inference.latent_function_inference import EPDTC from copy import deepcopy class SparseGPClassification(SparseGP): """ Sparse Gaussian Process model for classification This is a thin wrapper around the spa...
{ "content_hash": "650ce9bf6460bb8a1b4593044f8111a4", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 220, "avg_line_length": 44.73103448275862, "alnum_prop": 0.6708294788775825, "repo_name": "esiivola/GPYgradients", "id": "296b70f41e05e16345939511a65a43ec05d6035d", "size"...
import weakref from warnings import warn from fontTools.misc import arrayTools from defcon.objects.base import BaseObject from defcon.objects.contour import Contour from defcon.objects.point import Point from defcon.objects.component import Component from defcon.objects.anchor import Anchor from defcon.objects.lib impo...
{ "content_hash": "a9069870d75554811cf99cab6bc932b8", "timestamp": "", "source": "github", "line_count": 1976, "max_line_length": 309, "avg_line_length": 32.24898785425101, "alnum_prop": 0.6134894231372795, "repo_name": "adrientetar/defcon", "id": "f1f913fc47435741f236f04473d5b57d8657ea33", "size": ...
def dictlist(x): for key,value in x.items(): print(key,value)
{ "content_hash": "0c8e22b1a27ccfa3930b3a6e6fbb92a5", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 31, "avg_line_length": 24.666666666666668, "alnum_prop": 0.5945945945945946, "repo_name": "Sherlock-Holo/Python-3.5-learning", "id": "b3fae72e279128c6059cf43cf73b6aa3be622843"...
from framework.dependency_management.dependency_resolver import BaseComponent from framework.interface import urls import tornado.httpserver import tornado.ioloop import tornado.web import tornado.options from framework.lib.owtf_process import OWTFProcess class InterfaceServer(OWTFProcess, BaseComponent): def pse...
{ "content_hash": "81777425459bdb595ff8381a91f13346", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 91, "avg_line_length": 38.4, "alnum_prop": 0.5604745370370371, "repo_name": "sharad1126/owtf", "id": "41b3f772e558850f42d3f0438d6304f49119ed74", "size": "3456", "binary":...
from mongoengine.fields import IntField, StringField, ListField, BooleanField, DictField, EmbeddedDocumentField, FloatField from mongoengine import DoesNotExist, EmbeddedDocument, Document import hmac from JumpScale import j try: import fcrypt as crypt except ImportError: import crypt DB = 'jumpscale_system' ...
{ "content_hash": "c2b866d0e725b4597a4dca148f924bd5", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 123, "avg_line_length": 32.83734939759036, "alnum_prop": 0.6189689965144011, "repo_name": "Jumpscale/jumpscale_core8", "id": "4a22f1fba7edb1b7dc99b2d780c024a5e7442570", "s...
""" Functions: num_headers Guess the number of headers in a matrix. """ # Data Types. CHAR, INT, FLOAT, EMPTY = 1, 2, 4, 8 # Semantic Types. HEAD, SAMPLE, ANNOT, VALUE, BLANK = 1, 2, 4, 8, 16 def _rule_no_first_row_annots(matrix, num_rows, num_cols, datatype, semtype): # No ANNOT in the first row. changed...
{ "content_hash": "e2286469d766453fbc3314c3a1d9800d", "timestamp": "", "source": "github", "line_count": 735, "max_line_length": 77, "avg_line_length": 33.87619047619047, "alnum_prop": 0.5320695610265472, "repo_name": "jefftc/changlab", "id": "dc05730cf8405dbca893b7ca97adbd4fe1760503", "size": "2489...
from django import forms from django.contrib.auth import get_user_model from .models import UserAddress User = get_user_model() class UserAddressForm(forms.ModelForm): default = forms.BooleanField(label='Make Default', required=False) class Meta: model = UserAddress fields = ['address', 'ad...
{ "content_hash": "bfde5325bbc94cc1516a61e13a116617", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 133, "avg_line_length": 34.013513513513516, "alnum_prop": 0.6301152165276123, "repo_name": "loafbaker/django_ecommerce1", "id": "ab5787442f9dba6afd18773f61ef0fcdd84c62b3", ...
import theano.tensor as T from theano import function from theano import Param from theano import shared state = shared(0) inc = T.iscalar('inc') # short integer o 32 bit integer accumulator = function([inc], state, updates=[(state, state + inc)]) so, this is the one im used to..
{ "content_hash": "38e687689860b286da814388e70d0fe5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 68, "avg_line_length": 26, "alnum_prop": 0.7272727272727273, "repo_name": "h-mayorquin/mnist_deep_neural_network_BPNNs", "id": "745ee7b5457178db7cd5bb64c30469d8234a12be", "...
__script__ = "MyFont.py" __author__ = "Ppic, Frost" __credits__ = "Team XBMC-Passion, http://passion-xbmc.org/" __platform__ = "xbmc media center, [LINUX, OS X, WIN32, XBOX]" __date__ = "08-01-2010" __version__ = "1.1" #python librairy to add font to the current skin. need to h...
{ "content_hash": "c60957fe264d5727f918d6ba5d1ff506", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 169, "avg_line_length": 40.94444444444444, "alnum_prop": 0.5058796924468566, "repo_name": "rolapp/plugin.video.zattooboxExt.beta", "id": "585474c49a9c33420a370747c92e3e9c872...
"""Descriptors essentially contain exactly the information found in a .proto file, in types that make this information accessible in Python. """ __author__ = 'robinson@google.com (Will Robinson)' import threading import warnings from google.protobuf.internal import api_implementation _USE_C_DESCRIPTORS = False if a...
{ "content_hash": "b2f1ab00f67e5180892f88cd7d8034bb", "timestamp": "", "source": "github", "line_count": 1198, "max_line_length": 106, "avg_line_length": 37.580968280467445, "alnum_prop": 0.6712273999378082, "repo_name": "grpc/grpc-ios", "id": "f5a0caa6bda5cc9bb7411eea088994f6959f90e2", "size": "466...
class test(HTMLParser.HTMLParser): intable = False titling = False capturing = True cdata = [] out = u'' def handle_starttag(self, tag, attrs): print tag,attrs if dict(attrs).get('class', None) == 'm': self.capturing = False if tag.lower() == 'table': self.intable = True ...
{ "content_hash": "e0eb2d1cdae464707cfb486ad1aeff40", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 106, "avg_line_length": 38.13333333333333, "alnum_prop": 0.5655594405594405, "repo_name": "fiddlerwoaroof/sandbox", "id": "3ae90408df880ddb9bd4c003f8f808c308a513af", "size"...
import datetime from corehq import Domain from corehq.apps.accounting import generator from corehq.apps.accounting.exceptions import NewSubscriptionError from corehq.apps.accounting.models import ( Subscription, BillingAccount, DefaultProductPlan, SoftwarePlanEdition, SubscriptionAdjustmentMethod) from corehq.a...
{ "content_hash": "7f322a47b5ba43fc6cec578e83d7a919", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 93, "avg_line_length": 39.849557522123895, "alnum_prop": 0.6577836997557184, "repo_name": "SEL-Columbia/commcare-hq", "id": "8fc565faedfa9758cdcce5a135ed37cd4f9a07f5", "si...
"""Permissions cleanup migrations Revision ID: 476e9e882141 Revises: 387cf5a9a3ad Create Date: 2014-03-21 18:27:16.802081 """ # revision identifiers, used by Alembic. revision = '476e9e882141' down_revision = '387cf5a9a3ad' from alembic import op from datetime import datetime from sqlalchemy.sql import table, colum...
{ "content_hash": "5a651e86ad8ece7332c32d1b82e1e731", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 315, "avg_line_length": 32.3771186440678, "alnum_prop": 0.6296296296296297, "repo_name": "hyperNURb/ggrc-core", "id": "9c2feabd61f6c6209965cbaabf10d4135179a1fd", "size": "...
# # --- MIT Open Source License -------------------------------------------------- # PiB - Python Build System # Copyright (C) 2011 by Don Williamson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
{ "content_hash": "501305fd9a38681d80361f20fc2ea60a", "timestamp": "", "source": "github", "line_count": 962, "max_line_length": 176, "avg_line_length": 35.88565488565489, "alnum_prop": 0.5971554371125659, "repo_name": "Celtoys/PiB", "id": "99c7798f7ff76f9c79e642eae516e9632dfbf071", "size": "34522",...
from eepp4.articleparser import ArticleParser # exceptions from eepp4.articleparser import ArticleParserError from eepp4.hexviewparser import HexviewParserError
{ "content_hash": "db734f8a3b95b1f47439b5889b514c05", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 50, "avg_line_length": 32.4, "alnum_prop": 0.8827160493827161, "repo_name": "eepp/eepp4", "id": "55186f81c6e0976ff41ebb860e16c4c40140786e", "size": "228", "binary": false,...
"""Tests for Estimator.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tempfile import tensorflow as tf def boston_input_fn(): boston = tf.contrib.learn.datasets.load_boston() features = tf.cast( tf.reshape( tf.constant(bos...
{ "content_hash": "9341983751c3f0b23635b19c7caeea19", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 80, "avg_line_length": 32.44642857142857, "alnum_prop": 0.6488717666483214, "repo_name": "ibab/tensorflow", "id": "ac8bb5928fb382c0dfe8f22ba759d93fbde43d84", "size": "2420"...
"""Itertools utils.""" from __future__ import annotations import collections import itertools from typing import Any, Callable, Iterable, Iterator, TypeVar # from typing_extensions import Unpack, TypeVarTuple # pytype: disable=not-supported-yet # pylint: disable=g-multiple-import # TODO(pytype): Once supported, ...
{ "content_hash": "557c34e9b298dcc58efafc3be66aaa64", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 126, "avg_line_length": 23.28440366972477, "alnum_prop": 0.6249014972419228, "repo_name": "google/etils", "id": "fcab07fe8dc1bc866d4d10283500a66580b94365", "size": "3121",...
""" Telegram platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.telegram/ """ import logging import voluptuous as vol from homeassistant.const import ATTR_LOCATION from homeassistant.components.notify import ( ATT...
{ "content_hash": "bb6837b4568288cfcf824aa67e474df8", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 76, "avg_line_length": 36.55102040816327, "alnum_prop": 0.6328866554997208, "repo_name": "jamespcole/home-assistant", "id": "428c7e093d236536c3c550cc467f95daa0fd14f8", "siz...
""" Factory tests. """ from flask import Flask from hamcrest import assert_that, instance_of, is_ from microcosm.api import create_object_graph def test_configure_flask(): """ Should create the `Flask` application. """ graph = create_object_graph(name="example", testing=True) assert_that(graph.a...
{ "content_hash": "ba002d4b18457e32c262f9190f70f858", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 61, "avg_line_length": 21.8125, "alnum_prop": 0.6934097421203438, "repo_name": "globality-corp/microcosm-flask", "id": "b135b7107ba17d752412ffb1764f44461bf1f931", "size": "...
""" Collects the following from beanstalkd: - Server statistics via the 'stats' command - Per tube statistics via the 'stats-tube' command #### Dependencies * beanstalkc """ import re import diamond.collector try: import beanstalkc beanstalkc # workaround for pyflakes issue #13 except ImportError...
{ "content_hash": "9269312165e36d0f7866201064d11f91", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 72, "avg_line_length": 28.79310344827586, "alnum_prop": 0.5425149700598803, "repo_name": "metamx/Diamond", "id": "901e078e55a6587f7064e8084edf7530bc3d8221", "size": "2521",...
from thrift.Thrift import * from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class TCell(object): """ TCell - Used to transport a cell value (byte[]) and the timestamp it was stored with together as a r...
{ "content_hash": "b7ace4f8e0b7a2160674c2502b40f0ef", "timestamp": "", "source": "github", "line_count": 774, "max_line_length": 305, "avg_line_length": 32.514211886304906, "alnum_prop": 0.6224270841611699, "repo_name": "zohmg/zohmg", "id": "a173b99f129c6f9411628142b495c5ad3c9f92e9", "size": "25266"...
"""Securely hash and check passwords using PBKDF2. Use random salts to protect againt rainbow tables, many iterations against brute-force, and constant-time comparaison againt timing attacks. Keep parameters to the algorithm together with the hash so that we can change the parameters and keep older hashes working. S...
{ "content_hash": "61ef834aa2979cd06cadac977231138b", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 76, "avg_line_length": 34.91935483870968, "alnum_prop": 0.6817551963048499, "repo_name": "taeram/flask-boilerplate", "id": "c76dfc0814e4cc0e5a372017eb447edf937817c8", "size...
__author__ = "Peter Ogden" __copyright__ = "Copyright 2018, Xilinx" __email__ = "pynq_support@xilinx.com" import asyncio import numpy as np from pynq import DefaultIP, allocate, UnsupportedConfiguration class _FrameCache: def __init__(self, mode, memory, capacity=5, cacheable=0): self._cache = [] ...
{ "content_hash": "32e76bdfb82f1713ecee1ea8dd08ccaf", "timestamp": "", "source": "github", "line_count": 589, "max_line_length": 78, "avg_line_length": 34.76740237691002, "alnum_prop": 0.5479050688543803, "repo_name": "cathalmccabe/PYNQ", "id": "b026e3b8d3f3357ed3e2de6db9687cf443564cf3", "size": "22...
from __future__ import absolute_import from __future__ import unicode_literals from six import text_type as str from yelp.obj.attribute import Attribute from yelp.obj.category import Category from yelp.obj.coordinates import Coordinates from yelp.obj.hours import Hours from yelp.obj.location import Location from yelp...
{ "content_hash": "e2b2b46a824a79739b672527e3b45744", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 51, "avg_line_length": 25.885714285714286, "alnum_prop": 0.608167770419426, "repo_name": "Yelp/yelp-python", "id": "e0e114caa259c426d50940d55c615506f8b1af10", "size": "930"...
''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WITHOUT FEE IS HEREBY GRA...
{ "content_hash": "965747ce4af7ff5226337e0b9a9538e5", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 110, "avg_line_length": 43.7375, "alnum_prop": 0.6656187482137753, "repo_name": "tbarrongh/cosc-learning-labs", "id": "0ca9702bc80827f9b1b8873986046340ed05cc11", "size": "4...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('practice', '0001_initial'), ] operations = [ migrations.AddField( model_name='book', name='writter', field=model...
{ "content_hash": "a6137a155d77c4b1adf87ee0147ca913", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 98, "avg_line_length": 25.217391304347824, "alnum_prop": 0.5775862068965517, "repo_name": "boldmanQ/blogsys", "id": "53b660b4b7091374a204ee1c023abc74d6c5f58c", "size": "653...
from django.contrib import admin import reversion from markedit.admin import MarkEditAdmin from .models import Page class PageAdmin(reversion.VersionAdmin, MarkEditAdmin): list_display = [ 'title', 'path', 'status', 'publish_date', ] class MarkEdit: fields = ['b...
{ "content_hash": "6026deb7b577fe0af8ba63fbcf293836", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 55, "avg_line_length": 17.708333333333332, "alnum_prop": 0.6023529411764705, "repo_name": "miurahr/symposion", "id": "ffdcb00ed567bafe51a9613a7f612538681e9d67", "size": "42...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0032_task_catalogs'), ] operations = [ migrations.AddField( model_name='task', name='locked', field=models.BooleanField(default=False, help_text...
{ "content_hash": "7a5a9faed8e83136cb882c54534cbffa", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 134, "avg_line_length": 25.625, "alnum_prop": 0.6048780487804878, "repo_name": "DMPwerkzeug/DMPwerkzeug", "id": "844730acdf8ca76fffa0e64018a5b61056f5879b", "size": "460", ...
class Model(object): products = { 'milk': {'price': 1.50, 'quantity': 10}, 'eggs': {'price': 0.20, 'quantity': 100}, 'cheese': {'price': 2.00, 'quantity': 10} } class View(object): def product_list(self, product_list): print('PRODUCT LIST:') for product in product...
{ "content_hash": "b7335af164c405d9bb502fdcc54b4d7d", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 29.30188679245283, "alnum_prop": 0.601416613007083, "repo_name": "Mitali-Sodhi/CodeLingo", "id": "69d5e8ce93aa88747ece9bcc0f875024881732c6", "size": ...
from __future__ import absolute_import import collections import sys import types import normalize.exc as exc from normalize.record import Record """This class contains container classes which can act like collections but conform to this package's metaclass API""" class _classproperty(object): def __init__(sel...
{ "content_hash": "326f2cf25e08dfe3ef65c846d4c4d82e", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 79, "avg_line_length": 32.501628664495115, "alnum_prop": 0.5850871918220084, "repo_name": "tomo-otsuka/normalize", "id": "81ee5ffeb66c5a4edd126c0d5822a6bd0d2aa992", "size"...
import pytest def pytest_addoption(parser): group = parser.getgroup("debugconfig") group.addoption( "--setupplan", "--setup-plan", action="store_true", help="show what fixtures and tests would be executed but " "don't execute anything.", ) @pytest.hookimpl(tryfirs...
{ "content_hash": "819cc14914f7a3a2d176eca392bcba9a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 70, "avg_line_length": 28.037037037037038, "alnum_prop": 0.6763540290620872, "repo_name": "tomviner/pytest", "id": "697746f205a6119682360f101999d73f5c9e162b", "size": "757"...