text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import unicode_literals
import os
from setuptools import setup, find_packages
version = __import__('catalog').__version__
readme = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
setup(
name='django-shop-catalog',
version=version,
description='Catalog app for django SH... | {
"content_hash": "e64130775cb4af65248daa1d227fad64",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 75,
"avg_line_length": 28.622222222222224,
"alnum_prop": 0.5892857142857143,
"repo_name": "dinoperovic/django-shop-catalog",
"id": "adddad8655df8a3b07f9baa276c6a0956a63685b",... |
"""Collection of helper functions."""
import urlparse
from google.appengine.ext import db
from codereview.exceptions import FetchError
def make_url(base, filename, rev):
"""Helper to construct the URL to fetch.
Args:
base: The base property of the Issue to which the Patch belongs.
filename: The filena... | {
"content_hash": "bd34a70a29eac291f73caaa02889a33a",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 77,
"avg_line_length": 28.4390243902439,
"alnum_prop": 0.5943396226415094,
"repo_name": "nbodepallictr/touchites-test",
"id": "3cbb5950fcf1a6f953b6994c6cbcf692e58ede76",
"s... |
from __future__ import unicode_literals
from warnings import warn
from django.shortcuts import render
from django.views.decorators.http import require_GET
from paypal.standard.pdt.forms import PayPalPDTForm
from paypal.standard.pdt.models import PayPalPDT
@require_GET
def pdt(request, template="pdt/pdt.html", cont... | {
"content_hash": "38db7e039be808f915ad6f28147de384",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 95,
"avg_line_length": 32.85333333333333,
"alnum_prop": 0.6229707792207793,
"repo_name": "aldenjenkins/foobargamingwebsite",
"id": "cbd80f79fb2bc9a76fcfdab1579bb86a6d4cb9d3",... |
import m5
import runfs
import base64
import tempfile
import argparse
import sys
import os
from amd import AmdGPUOptions
from common import Options
from common import GPUTLBOptions
from ruby import Ruby
rodinia_runscript = '''\
export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH
export HSA_ENABLE_SDMA=0
dmesg -n3
dd... | {
"content_hash": "86e14289d7369a04f087af6876d3e677",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 78,
"avg_line_length": 31.672727272727272,
"alnum_prop": 0.5295637198622273,
"repo_name": "gem5/gem5",
"id": "3d7cef477f19110fdbe9c7722970a1dc3a55c7ba",
"size": "5034",
... |
import unittest, os, sys, new
from jpypetest import *
import jpype
import os.path
def suite() :
return unittest.TestSuite( (
numeric.suite(),
attr.suite(),
array.suite(),
objectwrapper.suite(),
proxy.suite(),
exc.suite(),
serial.suite(),
mro.suite(),
))
import jpype
def r... | {
"content_hash": "7b3b3f5e06e1b1711af20ca56c9f456f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 20.05128205128205,
"alnum_prop": 0.612531969309463,
"repo_name": "vanschelven/jpype_05",
"id": "dd36fdc0ab22d2f7c74c61b21f9a5f505912d8de",
"size": "1... |
"""
WSGI config for expensify project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | {
"content_hash": "ea9f0bca16b869d27a0034f6c4919abe",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 79,
"avg_line_length": 40.714285714285715,
"alnum_prop": 0.8008771929824562,
"repo_name": "agiliq/expensify",
"id": "0f529cd341f349308683a3ca2c03a2ec54ea6e6a",
"size": "114... |
import re
class FieldType():
def __init__(self, name, regex, heuristic_regex=None):
self._name = name
self._regex = regex
self._heuristic_regex = heuristic_regex
@property
def heuristic_regex(self):
return self._heuristic_regex if self._heuristic_regex else self.regex
@property
def name(se... | {
"content_hash": "3274e32d39c9ada07f7407f6df39c7ad",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 102,
"avg_line_length": 26.820224719101123,
"alnum_prop": 0.6066191872643486,
"repo_name": "xq262144/hue",
"id": "454207a33208990614e9f78a61626b3f15f68d6f",
"size": "3171",... |
from collections import defaultdict
from itertools import groupby
import six
import sqlalchemy as sa
from sqlalchemy.exc import NoInspectionAvailable
from sqlalchemy.orm import object_session
from sqlalchemy.schema import ForeignKeyConstraint, MetaData, Table
from ..query_chain import QueryChain
from .orm import get_... | {
"content_hash": "f4b70e1074898cdd2eeab986412ac56b",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 79,
"avg_line_length": 29.12054794520548,
"alnum_prop": 0.5990215448301816,
"repo_name": "cheungpat/sqlalchemy-utils",
"id": "c9a0ef2b4f9f1fb2e08a93b7b406d2bf6baa34c3",
"s... |
from __future__ import division
from sympy.functions.elementary.trigonometric import TrigonometricFunction
from sympy.functions.elementary.trigonometric import InverseTrigonometricFunction
import sympy
from sympy import Poly
from sympy import ZZ,CC,QQ,RR
from sympy import Add,Mul,rcollect,Number,NumberSymbol,sin,cos,Po... | {
"content_hash": "e18d3c227f3f9458ba78d1ddbd76b1f6",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 152,
"avg_line_length": 37.27091633466136,
"alnum_prop": 0.6400855157669695,
"repo_name": "lemmalearning/sympy-form-analysis",
"id": "4936b92a300dff39cfeef55a6acc4c433008330... |
import unittest
import json
import os
import sys
from unittest.mock import patch, MagicMock, mock_open
from systemops.opener import get_stooges
from settings import ROOT_DIR
class TestOpener(unittest.TestCase):
""" Tests opening and retrieving data from json """
@patch('systemops.opener.open', mock_open(read... | {
"content_hash": "b252cf9bad18df34fe0d1398ff775d99",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 91,
"avg_line_length": 32.68,
"alnum_prop": 0.6780905752753978,
"repo_name": "b-ritter/python-notes",
"id": "762b6811d08fffec9ff83daf9368d56df51dc09a",
"size": "817",
"bi... |
"""Ftrl-proximal for TensorFlow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.training imp... | {
"content_hash": "71a2f0301d666cd215ebe48e53ca3b5d",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 155,
"avg_line_length": 45.82608695652174,
"alnum_prop": 0.6386780518659076,
"repo_name": "aldian/tensorflow",
"id": "6c8a6ceadc5ba1831be1cb9c017ab59d50f06c0b",
"size": "1... |
"""
You can make the following assumptions about the inputs to the
'sum_of_multiples' function:
* All input numbers are non-negative 'int's, i.e. natural numbers
including zero.
* A list of factors must be given, and its elements are unique
and sorted in ascending order.
"""
import unittest
from s... | {
"content_hash": "301e045a77b56bb99df1872a5b4850fc",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 75,
"avg_line_length": 34.31884057971015,
"alnum_prop": 0.6613175675675675,
"repo_name": "N-Parsons/exercism-python",
"id": "bde12f7527d4a758027aced8745218dde31fd985",
"siz... |
"""This module contains the custom admin class that allows for a nicer admin
interface."""
# pylint: disable=maybe-no-member,too-few-public-methods
# Third-party imports
from flask_admin.contrib.sqla import ModelView
class CustomAdminView(ModelView): # pylint: disable=no-init
"""Define custom templates for each... | {
"content_hash": "24270a89eb69e3ba7d767eea2cf2deb4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 76,
"avg_line_length": 32.785714285714285,
"alnum_prop": 0.7298474945533769,
"repo_name": "jeffknupp/sandman2",
"id": "1c0e0d3c57853fc0c19f206020c4f3caeba41d33",
"size": "4... |
"""Tools for setting up printing in interactive sessions. """
def _init_python_printing(stringify_func):
"""Setup printing in Python interactive session. """
import __builtin__, sys
def _displayhook(arg):
"""Python's pretty-printer display hook.
This function was adapted from:
... | {
"content_hash": "a7020117d58d44ee65fb8c27439f86ca",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 147,
"avg_line_length": 34.276315789473685,
"alnum_prop": 0.6028790786948176,
"repo_name": "flacjacket/sympy",
"id": "22b08dd18a27c4582fd665b9bc24ba2df7e570d2",
"size": "5... |
import sys
# versioneer: get __version__ attribute
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
# A bit of a hack, following numpy/sklearn: figure out whether we're being
# imported in the setup phase and so shouldn't try to import the compiled
# extensions.
try:
__... | {
"content_hash": "db78aeb8e2bdaf990e4784a58929ec74",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 26.424242424242426,
"alnum_prop": 0.7327981651376146,
"repo_name": "dougalsutherland/cyflann",
"id": "64e9bc54ab5b8f8029150ad31ed7b1a7a2fd9abe",
"siz... |
from tests.utils import service_ok
import pytest
from tests.utils import resource_file
import owslib
from owslib.csw import CatalogueServiceWeb
from owslib.wms import WebMapService
from owslib.wcs import WebCoverageService
from owslib.wfs import WebFeatureService
from owslib.util import OrderedDict
# TODO, we shoul... | {
"content_hash": "07cf482f017b65a0906cefb0f30ec9a3",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 113,
"avg_line_length": 46.92666666666667,
"alnum_prop": 0.7106123028839324,
"repo_name": "bird-house/OWSLib",
"id": "9d7b424077aced6ba0b4f8cfc0ddbeb57e7eb906",
"size": "7... |
import uuid
import mock
from oslo_config import cfg
import six
import wsme
from solum.common import exception
from solum.tests import base
class ExceptionTestCase(base.BaseTestCase):
"""Test cases for exception code."""
def test_with_kwargs(self):
exc = exception.ResourceNotFound(name='application'... | {
"content_hash": "8a018456214860100f2fa729116e4661",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 78,
"avg_line_length": 35.575221238938056,
"alnum_prop": 0.6271144278606965,
"repo_name": "devdattakulkarni/test-solum",
"id": "def2513ba0c7137ab0f0390d2ebbfd955f7057ff",
... |
import io
from django.core.management import call_command
from django.test import TestCase, override_settings
class MigrationTestCase(TestCase):
@override_settings(MIGRATION_MODULES={})
def test_for_missing_migrations(self):
output = io.StringIO()
options = {
'interactive': False... | {
"content_hash": "2ed4e5210fea09d5a00274012ec1c8f4",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 85,
"avg_line_length": 27.392857142857142,
"alnum_prop": 0.5684485006518905,
"repo_name": "divio/django-cms",
"id": "3fc8c043a8cb6c1cf86d2eba655d52c6ad99a63e",
"size": "767... |
"""Add RTP task jobid entry to the M&C database with a start_time of "now".
This script can be used for either single obsid tasks or multiple obsid tasks. For
multiple obsid tasks, pass the list of obsids to the `--obsid_list` parameter.
This script adds entries with a start_time of "now" meaning that the job was jus... | {
"content_hash": "15fe8a9688a56a680c93df83039c335e",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 88,
"avg_line_length": 34.65,
"alnum_prop": 0.5642135642135642,
"repo_name": "HERA-Team/hera_mc",
"id": "72886eb21587ee09a4461df167bc54767a29f6fc",
"size": "2917",
"binar... |
from django import forms
from django.contrib import admin
from i18n.forms import I18nTextarea, I18nTextInput
from .models import Page
class PageForm(forms.ModelForm):
class Meta:
model = Page
fields = "__all__"
widgets = {
"title": I18nTextInput,
"slug": I18nTextIn... | {
"content_hash": "3de4933ea4914b29409666e545e9f1d0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 50,
"avg_line_length": 22.772727272727273,
"alnum_prop": 0.6287425149700598,
"repo_name": "patrick91/pycon",
"id": "89dc341cf795afb040196137fcff45d63b6e640e",
"size": "501"... |
from sfa.util.faults import RecordNotFound
from sfa.util.method import Method
from sfa.trust.credential import Credential
from sfa.storage.parameter import Parameter, Mixed
class GetGids(Method):
"""
Get a list of record information (hrn, gid and type) for
the specified hrns.
@param cred credential... | {
"content_hash": "dbcaf2afdd9ed6f1ba0f729b2177641e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 83,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.6091718001368925,
"repo_name": "onelab-eu/sfa",
"id": "623fbe92c933db95195c705ea877dd05a716655c",
"size": "1461",
... |
import os
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
urlpatterns += patterns('',
# Static content
(r'^static/(.*)$', 'd... | {
"content_hash": "6f6e5df3f3e9ee1fce8b6937a3eeea40",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 118,
"avg_line_length": 22.681818181818183,
"alnum_prop": 0.6472945891783567,
"repo_name": "andrewgodwin/lastgraph",
"id": "e0c35563548f2710112ee790d27241d067e0a330",
"size... |
from oslo_config import fixture as config
from oslotest import base as test_base
from oslo_service import _options
class ServiceBaseTestCase(test_base.BaseTestCase):
def setUp(self):
super(ServiceBaseTestCase, self).setUp()
self.conf_fixture = self.useFixture(config.Config())
self.conf_f... | {
"content_hash": "90093c6ee328864dd65dff3a0d48af2d",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 72,
"avg_line_length": 36.166666666666664,
"alnum_prop": 0.7204301075268817,
"repo_name": "citrix-openstack-build/oslo.service",
"id": "33243a96c380efb398f733787075f48e7427b7... |
from datetime import datetime, timedelta
import logging
import pytz
def get_utc_datetime_from_user_input(tz_str, date_time_str):
"""Returns a datetime object from a string, taking into account the time zone for that string.
Note that the date_time_str must be in the one and only acceptable format %m-%d-%Y %I:%... | {
"content_hash": "f58d06f78e0a7ba7e2b297969d02bc45",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 140,
"avg_line_length": 43.67948717948718,
"alnum_prop": 0.6935720575286175,
"repo_name": "xniccum/chorewheel",
"id": "4e6e1fb63bd01c802facc86fc605f2dd921b48b2",
"size": "3... |
'''
***
Modified generic daemon class
***
Author: http://www.jejik.com/articles/2007/02/
a_simple_unix_linux_daemon_in_python/www.boxedice.com
License: http://creativecommons.org/licenses/by-sa/3.0/
Changes: 23rd Jan 2009 (David Mytton <david@boxedice.com>)
... | {
"content_hash": "7d53ef982779e7e14bdafbbcc94fc56a",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 79,
"avg_line_length": 30.116071428571427,
"alnum_prop": 0.5128965312777942,
"repo_name": "soasme/blackgate",
"id": "bd8ba2e1bcb648dfec177d519fb5878d7774f351",
"size": "67... |
import unittest
from unittest import mock
import pytest
import telegram
import airflow
from airflow.models import Connection
from airflow.providers.telegram.operators.telegram import TelegramOperator
from airflow.utils import db
TELEGRAM_TOKEN = "xxx:xxx"
class TestTelegramOperator(unittest.TestCase):
def setU... | {
"content_hash": "85206a29a4204efdc49d1a2a713cd6ee",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 100,
"avg_line_length": 38.275,
"alnum_prop": 0.6077726975832789,
"repo_name": "mistercrunch/airflow",
"id": "8d4fde034185eb4b003aa827d0c90ceda58c46a6",
"size": "6911",
... |
import mock
from oslo.config import cfg
from neutron.db import api as db
from neutron.extensions import providernet as provider
from neutron.openstack.common import importutils
from neutron.plugins.cisco.common import cisco_constants as const
from neutron.plugins.cisco.common import cisco_exceptions as cisco_exc
from... | {
"content_hash": "38ba52ae93672469f176bd8cfdb6dd82",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 79,
"avg_line_length": 40.701388888888886,
"alnum_prop": 0.5876130353182051,
"repo_name": "Juniper/contrail-dev-neutron",
"id": "6a959d6095c5d33a835f2a40c60e3e099db3df7a",
... |
"""
This file contains tests for misc.py
"""
import sys
import pytest
import numpy as np
import matmodlab2
import matmodlab2.core.misc as misc
def test_is_listlike():
"""Is item list like?"""
assert not misc.is_listlike('aaa')
assert misc.is_listlike([0,1,2])
assert misc.is_listlike((0,1,2))
asser... | {
"content_hash": "16ca1df9706c0accc3704abd9990e179",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 50,
"avg_line_length": 25.88235294117647,
"alnum_prop": 0.6590909090909091,
"repo_name": "matmodlab/matmodlab2",
"id": "353adc107eebb7d34e21236ef994a1d050d1d7d9",
"size": "... |
"""The tests for the Switch component."""
# pylint: disable=protected-access
import unittest
from homeassistant.setup import setup_component, async_setup_component
from homeassistant import core, loader
from homeassistant.components import switch
from homeassistant.const import STATE_ON, STATE_OFF, CONF_PLATFORM
from... | {
"content_hash": "99eca857053890ca1c19f1dc4bd218c9",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 78,
"avg_line_length": 35.00892857142857,
"alnum_prop": 0.6360622290232084,
"repo_name": "HydrelioxGitHub/home-assistant",
"id": "d39c5a24ddc53ae7963b2cce8c7c971e4f1d4aea",
... |
from __future__ import absolute_import, unicode_literals
import django
from django.contrib.auth.models import User
from django.template import Context, RequestContext, Template
from ..base import BaseTestCase
from ..models import NonAsciiRepr
class TemplatesPanelTestCase(BaseTestCase):
def setUp(self):
... | {
"content_hash": "8f29f7f3ae76310cb4bf1f64583787d2",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 89,
"avg_line_length": 37.08045977011494,
"alnum_prop": 0.6394916305021698,
"repo_name": "calvinpy/django-debug-toolbar",
"id": "cdf12f9ca31c692f194ffb9bd098edaf1569a604",
... |
from __future__ import unicode_literals
from base import QueryOperation
from params import StaticParam, MultiParam, SingleParam
from models import RevisionInfo, Revision
from utils import OperationExample
DEFAULT_PROPS = 'ids|flags|timestamp|user|userid|size|sha1|comment|parsedcomment|tags'
class GetPageRevisionInf... | {
"content_hash": "395d938b9f8c36afee4e272ae38d870e",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 86,
"avg_line_length": 36.9009900990099,
"alnum_prop": 0.6026294606922458,
"repo_name": "mahmoud/wapiti",
"id": "4131258a5399acd0bad93174dd75992cbc61b46a",
"size": "3751",... |
import os
import sys
if __name__ == "__main__":
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_ROOT, os.pardir))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")
from django.core.management import execute_from_command_line
execute_from_command... | {
"content_hash": "2f558972e44306c38a71b038f93354ac",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 65,
"avg_line_length": 28,
"alnum_prop": 0.7261904761904762,
"repo_name": "alexsilva/django-xadmin",
"id": "bc0d0959994d54f5ca5116d0fdc9850586508481",
"size": "358",
"bin... |
from runner.koan import *
import random
class DiceSet(object):
def __init__(self):
self._values = None
@property
def values(self):
return self._values
def roll(self, n):
# Needs implementing!
# Tip: random.randint(min, max) can be used to generate random numbers
... | {
"content_hash": "ce7041b32c3ce51962479080ba15435a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 78,
"avg_line_length": 27.926470588235293,
"alnum_prop": 0.5945234333859927,
"repo_name": "ruzhytskyi/Koans",
"id": "6c629882aa00112d379b6bdc690ec782e201d5b9",
"size": "194... |
class AbstractIsExaminer(object):
""" Abstract class implemented by all classes where it is natural to
need to check if a user is examiner. """
@classmethod
def q_published(cls, old=True, active=True):
"""
Return a django.models.Q object which matches all items of this type
wher... | {
"content_hash": "a5398bf33f4cde97734135c7cedd663e",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 76,
"avg_line_length": 34.29577464788732,
"alnum_prop": 0.5934291581108829,
"repo_name": "devilry/devilry-django",
"id": "11c795c6bcfc73c955e512b7d21282bdfc8f06a2",
"size":... |
def FileChangeFunction():
""" new version """
| {
"content_hash": "c839ac5a42106f5cb07ceaaa2b0efc9b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 25,
"avg_line_length": 25,
"alnum_prop": 0.62,
"repo_name": "lerina/livecoding",
"id": "64e41463c749b453391d73447d6c64d7318bba04",
"size": "57",
"binary": false,
"copies... |
""" Machine limits for Float32 and Float64 and (long double) if available...
"""
__all__ = ['finfo','iinfo']
from machar import MachAr
import numeric
import numerictypes as ntypes
from numeric import array
def _frz(a):
"""fix rank-0 --> rank-1"""
if a.ndim == 0: a.shape = (1,)
return a
_convert_to_float... | {
"content_hash": "cc2c37860000845a72486206b8c80ad1",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 78,
"avg_line_length": 30.48122866894198,
"alnum_prop": 0.5473071324599709,
"repo_name": "matthew-brett/numpy",
"id": "0cb1fd7f40a8aa0f3a73e61f71a73f6cf2c3663c",
"size": "... |
import copy
import os
from zopeskel.plone import Plone
from zopeskel.plone2_theme import theme_vars
from zopeskel.base import get_var, EXPERT
from zopeskel.plone2_theme import cleanupStylsheets
class Plone25Theme(Plone):
_template_dir = 'templates/plone2.5_theme'
summary = "A theme for Plone 2.5"
help = "... | {
"content_hash": "8d557b6d7e01a055ab518b1e4baa9a94",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 79,
"avg_line_length": 40.048780487804876,
"alnum_prop": 0.6607795371498173,
"repo_name": "jean/ZopeSkel",
"id": "8a4b00a34e5d29c849bf2d7f2ac533526b02ea8a",
"size": "1642",... |
from typing import Sequence, cast, List
import networkx as nx
import numpy as np
import pytest
import cirq
import cirq.contrib.acquaintance as cca
from cirq_google import Sycamore23
from recirq.qaoa.gates_and_compilation import compile_problem_unitary_to_arbitrary_zz, \
compile_driver_unitary_to_rx
from recirq.qa... | {
"content_hash": "7ee5477445cb9ddc433edf286cb2a9ec",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 89,
"avg_line_length": 35.30708661417323,
"alnum_prop": 0.6634701159678859,
"repo_name": "quantumlib/ReCirq",
"id": "50ab8cd34f0b50fbd268340bd7677ad717c045ea",
"size": "44... |
"""Apache plugin constants."""
import pkg_resources
from letsencrypt import le_util
CLI_DEFAULTS_DEBIAN = dict(
server_root="/etc/apache2",
vhost_root="/etc/apache2/sites-available",
vhost_files="*",
version_cmd=['apache2ctl', '-v'],
define_cmd=['apache2ctl', '-t', '-D', 'DUMP_RUN_CFG'],
resta... | {
"content_hash": "359eae52b566137bd1d84f4a2e566023",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 74,
"avg_line_length": 33.056603773584904,
"alnum_prop": 0.6486872146118722,
"repo_name": "TheBoegl/letsencrypt",
"id": "50156444b063000a8ac2e6392c593871d35220f2",
"size":... |
import warnings
from textwrap import indent
import astropy.units as u
import numpy as np
from astropy.constants import c
from astropy.coordinates import (ICRS,
CartesianDifferential,
CartesianRepresentation, SkyCoord)
from astropy.coordinates.spectral_q... | {
"content_hash": "1b5339c55ea77220ebbf789a178a2aaf",
"timestamp": "",
"source": "github",
"line_count": 754,
"max_line_length": 111,
"avg_line_length": 41.84615384615385,
"alnum_prop": 0.6232251521298174,
"repo_name": "saimn/astropy",
"id": "829698bbb8c621e836d0f8b3962dbfb231b107a3",
"size": "31552... |
"""
Views which allow users to create and activate accounts.
"""
from django.shortcuts import redirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from registration.backends import get_backend
from seahub.settings import USER_PASSWORD_MIN_LENGTH, \
USER_STRONG_PASS... | {
"content_hash": "dfe8b6a9990f1401633ae9d0782174a1",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 88,
"avg_line_length": 36.305164319248824,
"alnum_prop": 0.6584766584766585,
"repo_name": "cloudcopy/seahub",
"id": "dc36c4f9c6a7aec44f60e7c037a6592d5461c652",
"size": "77... |
import android_commands
import constants
import logging
import os
import subprocess
import time
class FakeDns(object):
"""Wrapper class for the fake_dns tool."""
_FAKE_DNS_PATH = constants.TEST_EXECUTABLE_DIR + '/fake_dns'
def __init__(self, adb):
"""
Args:
adb: the AndroidCommands to use.
... | {
"content_hash": "236dd2bc41e1e6dfeea40e8b5eea28ae",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 33.719298245614034,
"alnum_prop": 0.6529656607700313,
"repo_name": "mogoweb/chromium-crosswalk",
"id": "c0e12e1dd311b49eb3f546dfb75bebb0e3a1e5d4",
"s... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base... | {
"content_hash": "4bdcded5cfbca95fc73adc4e6bd8d1bb",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 100,
"avg_line_length": 28.098859315589355,
"alnum_prop": 0.5901217861975643,
"repo_name": "tysonholub/twilio-python",
"id": "992cdaeeb09fbf616c6c3aba2a56f9ea40fb23f7",
"s... |
from minio import Minio
client = Minio(
"play.min.io",
access_key="Q3AM3UQ867SPQQA43P2F",
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
)
if client.bucket_exists("my-bucket"):
print("my-bucket exists")
else:
print("my-bucket does not exist")
| {
"content_hash": "3c80202ddeb7e7db3a426c900a65e377",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 58,
"avg_line_length": 22.75,
"alnum_prop": 0.706959706959707,
"repo_name": "minio/minio-py",
"id": "13a7df8876aa527cb4d03d7dcbb3c75d60b5411d",
"size": "930",
"binary": f... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
from wtforms.validators import Required, Length, Email, Regexp
class EmailForm(FlaskForm):
email = StringField('Please input admin email', validators=[Required(), Length(1, 64), Email()])
info = TextAreaField('Please i... | {
"content_hash": "a0be25670ff704cbe54c9fcd3030d112",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 100,
"avg_line_length": 39.69230769230769,
"alnum_prop": 0.748062015503876,
"repo_name": "ASaiun/saiun_bysj",
"id": "798e9b33c9686b999d300106f9bc8af179214d7b",
"size": "516... |
"""XML-RPC methods of Zinnia Pingback"""
from urllib.error import HTTPError
from urllib.error import URLError
from urllib.parse import urlsplit
from urllib.request import urlopen
from bs4 import BeautifulSoup
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from ... | {
"content_hash": "83ccc3a2bb3b670e89028971100c41f2",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 74,
"avg_line_length": 31.954545454545453,
"alnum_prop": 0.6191322901849218,
"repo_name": "Fantomas42/django-blog-zinnia",
"id": "c67a8c92463d1fea2cfed2e652903ae07407df9c",
... |
"""The media player tests for the forked_daapd media player platform."""
from unittest.mock import patch
import pytest
from homeassistant.components.forked_daapd.const import (
CONF_LIBRESPOT_JAVA_PORT,
CONF_MAX_PLAYLISTS,
CONF_TTS_PAUSE_TIME,
CONF_TTS_VOLUME,
DOMAIN,
SIGNAL_UPDATE_OUTPUTS,
... | {
"content_hash": "c97dc73f74120544d6a11e292a3adbb4",
"timestamp": "",
"source": "github",
"line_count": 788,
"max_line_length": 87,
"avg_line_length": 33.90355329949239,
"alnum_prop": 0.6439212456954634,
"repo_name": "lukas-hetzenecker/home-assistant",
"id": "a2e0050c3d965e8949c71d359b584d1e35743b27"... |
import logging
from .client import MarathonClient
from .models import MarathonResource, MarathonApp, MarathonTask, MarathonConstraint
from .exceptions import MarathonError, MarathonHttpError, NotFoundError, InvalidChoiceError
log = logging.getLogger(__name__)
logging.basicConfig() | {
"content_hash": "9e6b2a502d5b890e5fc63ad6917486ba",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 91,
"avg_line_length": 35.375,
"alnum_prop": 0.8409893992932862,
"repo_name": "Carles-Figuerola/marathon-python",
"id": "ea21d0a48242a9446570de7eaa466f5415c3ad57",
"size": "... |
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use sendgrid to send emails
- Use MEMCACHIER on Heroku
'''
from configurations import values
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
try:
from S3 import... | {
"content_hash": "b9fee3529a2af68a0b5fc3c992ca4622",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 97,
"avg_line_length": 35.78512396694215,
"alnum_prop": 0.6946882217090069,
"repo_name": "solvire/ordo_electro",
"id": "9183c905aeff283a7b6fb0cc8e5901c049128921",
"size": ... |
from NodeDefender.mqtt.command import fire, topic_format
def qry(mac_address):
topic = topic_format.format(mac_address, "sys", "svc", "qry")
return fire(topic, icpe = mac_address)
def telnet(mac_address, enabled):
topic = topic_format.format(mac_address, "sys", "svc:cli", "set")
return fire(topic, pay... | {
"content_hash": "257f0ff8ff6f548059b4e37cd877c33d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 71,
"avg_line_length": 42.333333333333336,
"alnum_prop": 0.6771653543307087,
"repo_name": "CTSNE/NodeDefender",
"id": "253c2a5918e54650a7a7c1ad3d6fb203a5982041",
"size": "8... |
from msrest.serialization import Model
class ApplicationGatewaySslPolicy(Model):
"""Application gateway SSL policy.
:param disabled_ssl_protocols: SSL protocols to be disabled on application
gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'.
:type disabled_ssl_protocols: list[str or
... | {
"content_hash": "64e8f32f2ceab45053cc5e0c9511389d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 83,
"avg_line_length": 37.94736842105263,
"alnum_prop": 0.6865464632454924,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "af90809ca730cc123ace7f3364113087a6be9373",
"... |
from __future__ import absolute_import, unicode_literals
import io
import os
import sys
from collections import defaultdict
from functools import partial
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.py26compat import import_module
from six import string_types
def read_configu... | {
"content_hash": "34a9562502cafe6c2c4296b063722941",
"timestamp": "",
"source": "github",
"line_count": 558,
"max_line_length": 79,
"avg_line_length": 29.381720430107528,
"alnum_prop": 0.5890820372064653,
"repo_name": "mpercich/Calendarize",
"id": "19b39629c707a6238a756cd7c79b0b7c1236bde9",
"size":... |
"""
Tests for Block Device utility functions.
"""
from nova import block_device
from nova import exception
from nova import objects
from nova import test
from nova.tests import fake_block_device
from nova.tests import matchers
class BlockDeviceTestCase(test.NoDBTestCase):
def setUp(self):
super(BlockDevi... | {
"content_hash": "e2bec921f24652edeae1a36e6f957fbd",
"timestamp": "",
"source": "github",
"line_count": 591,
"max_line_length": 78,
"avg_line_length": 43.18274111675127,
"alnum_prop": 0.5432389012969712,
"repo_name": "redhat-openstack/nova",
"id": "2410039ac5e6f5c6fe597434d0023b5ffa242aee",
"size":... |
import string
from collections import namedtuple
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, cast
import pytest
from pants.engine.addresses import Address
from pants.engine.fs import GlobExpansionConjunction, GlobMatchErrorBehavior, PathG... | {
"content_hash": "a29ef86535d7920ebf8c0ff92a604690",
"timestamp": "",
"source": "github",
"line_count": 1478,
"max_line_length": 100,
"avg_line_length": 35.38362652232747,
"alnum_prop": 0.6151213262711054,
"repo_name": "benjyw/pants",
"id": "395b20bbc53f8cda9acd3df7b1d84cf7caba089a",
"size": "52429... |
from __future__ import absolute_import
from logging import warning
from traceback import print_exc
from traceback import print_stack
from traceback import extract_stack
from dramatis.actor.name.interface import Interface as _Interface
class PropertyProxy(object):
def __init__(self,attr,actor,options):
su... | {
"content_hash": "c33865514bb17e292e9feb2b8a418552",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 116,
"avg_line_length": 41.732142857142854,
"alnum_prop": 0.5770218228498074,
"repo_name": "dramatis/dramatis",
"id": "aee804963e19dc2a24a8f4ac19a0ac4af48827a3",
"size": "... |
__author__ = 'kbroughton'
from torpedo.dialects import registry
registry.register("vertica", "torpedo_vertica.pyodbc", "Vertica_pyodbc")
registry.register("access.pyodbc", "torpedo_vertica.pyodbc", "Vertica_pyodbc")
from sqlalchemy.testing.plugin.pytestplugin import * | {
"content_hash": "2f5a16655ca08ffb9d67745b5698f8d8",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 78,
"avg_line_length": 33.875,
"alnum_prop": 0.7785977859778598,
"repo_name": "darKoram/torpedo",
"id": "b88b72ebb8411bc1f5af7398df492076d92d98ef",
"size": "271",
"binary"... |
import copy
from optparse import make_option
import sys
from django.core.management.base import LabelCommand
from django.conf import settings
from auditcare.models import AuditEvent
from corehq.apps.users.models import CommCareUser
from corehq.pillows.user import UserPillow
from couchforms.models import XFormInstance... | {
"content_hash": "570c53aeba51dd9e0201229680cdac82",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 105,
"avg_line_length": 33.06611570247934,
"alnum_prop": 0.5656085978505374,
"repo_name": "puttarajubr/commcare-hq",
"id": "7833bc88319d17925a242cdef345abf21a674101",
"siz... |
from __future__ import annotations
import math
import sys
from iotbx.reflection_file_reader import any_reflection_file
from scitbx.array_family import flex
import xia2.Handlers.Streams
from xia2.Toolkit.NPP import npp_ify
def npp(hklin):
reader = any_reflection_file(hklin)
intensities = [
ma
... | {
"content_hash": "3657a437c6aeb368b3f0310d80da3ef7",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 76,
"avg_line_length": 27.157894736842106,
"alnum_prop": 0.5833333333333334,
"repo_name": "xia2/xia2",
"id": "3e2bd7c6a3b553681aa9a7783c4466544f818f3d",
"size": "2064",
"... |
"""HTML5 Push Messaging notification service."""
from datetime import datetime, timedelta
from functools import partial
from urllib.parse import urlparse
import json
import logging
import time
import uuid
from aiohttp.hdrs import AUTHORIZATION
import voluptuous as vol
from voluptuous.humanize import humanize_error
f... | {
"content_hash": "ccd87599a96052a0c0892f837bf29bfd",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 88,
"avg_line_length": 32.6038062283737,
"alnum_prop": 0.6118333775537278,
"repo_name": "Cinntax/home-assistant",
"id": "ac76911b9f63ea9a20546b715c285eead92d3190",
"size":... |
import cv2
import numpy as np
from keypoint_preprocess import get_affine_transform
from PIL import Image
def decode_image(im_file, im_info):
"""read rgb image
Args:
im_file (str|np.ndarray): input can be image path or np.ndarray
im_info (dict): info of image
Returns:
im (np.ndarray... | {
"content_hash": "03c44710cd66d3d5acf242bd5026fbaa",
"timestamp": "",
"source": "github",
"line_count": 492,
"max_line_length": 96,
"avg_line_length": 33.91463414634146,
"alnum_prop": 0.5174997003475967,
"repo_name": "PaddlePaddle/models",
"id": "e0373b92a5064c2a71a4dcebc67aeb72b27dd0eb",
"size": "... |
"""
******** Models for test_data.py ***********
The following classes are for testing basic data marshalling, including
NULL values, where allowed.
The basic idea is to have a model for each Django data type.
"""
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
fr... | {
"content_hash": "618127a2fea42b2002e08e55f3c1ae49",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 87,
"avg_line_length": 24.11783439490446,
"alnum_prop": 0.7329988115674105,
"repo_name": "freakboy3742/django",
"id": "94c4a215fc2ab8afdc3aefd78cf2d0907705af2f",
"size": "... |
import cgi
#import cgitb
#cgitb.enable()
#cgitb.enable(display=0, logdir='/tmp')
import socket
class OpenUnixSocketClient(object):
def __init__(self, host='localhost', portno=10888,
socketfile='/tmp/.record_roku_socket'):
self.sock = None
self.socketfile = None
self.host ... | {
"content_hash": "b5ebfa2cd6b57817c9b5f5577d95bb15",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 66,
"avg_line_length": 27.64788732394366,
"alnum_prop": 0.5700458481915436,
"repo_name": "ddboline/roku_app",
"id": "71e3140bff133c163ac1dc2e1900cd9622229603",
"size": "200... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0009_auto_20180607_1434'),
]
operations = [
migrations.AlterField(
model_name='blogindexpage',
name='page_ptr',
... | {
"content_hash": "1e5aedb1febebd4286824bf86ab974ec",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 179,
"avg_line_length": 38.25925925925926,
"alnum_prop": 0.6379477250726041,
"repo_name": "ilendl2/wagtail-cookiecutter-foundation",
"id": "df08730af35954e2e7a6dcbdb5be0242a9... |
import numpy as np
import tensorflow as tf
from classification import metadata
from . import vessel_characterization, fishing_detection
class ModelsTest(tf.test.TestCase):
num_feature_dimensions = 11
model_classes = [vessel_characterization.Model, fishing_detection.Model]
def _build_estimator(self, mod... | {
"content_hash": "c511a2304231349167af2d38a4d4f944",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 80,
"avg_line_length": 33.5,
"alnum_prop": 0.662046908315565,
"repo_name": "GlobalFishingWatch/vessel-classification",
"id": "c860c5619297217d292455c1217daf94559df389",
"si... |
"""
Checks that iterable metaclasses are recognized by pylint.
"""
# pylint: disable=missing-docstring,too-few-public-methods,no-init,no-self-use,unused-argument,bad-mcs-method-argument
# pylint: disable=wrong-import-position
# metaclasses as iterables
class Meta(type):
def __iter__(self):
return iter((1, 2... | {
"content_hash": "c5ce6cc9c09966fafeb3ba1db56f5b7a",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 118,
"avg_line_length": 19.8,
"alnum_prop": 0.7254361799816346,
"repo_name": "ruchee/vimrc",
"id": "34047eda0dfc971f7544a165ffd99470547c1789",
"size": "1089",
"binary": f... |
import yamlpal
from yamlpal.yaml_parser import YamlParser
from yamlpal import exceptions, dumper
import sys
import click
import re
import os
FORMATTING_EPILOG = """
\b
Format Strings:
Format strings determine how yamlpal will output values.
Available keys:
%{key} : Key of the match (or index if matching an ite... | {
"content_hash": "9ba449a3a25cdae8626cf3c7c71e8476",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 118,
"avg_line_length": 38.242290748898675,
"alnum_prop": 0.6432438659140652,
"repo_name": "jorisroovers/yamlpal",
"id": "ddaf9cf23176e9cad205b7a4e4fbcd10f80ee9dc",
"size"... |
import hashlib
from typing import List
def simple_split_tokenizer(value: str) -> List[str]:
"""Tokenize a string using a split on spaces."""
return value.split(" ")
def simple_hash(value: object, num_features: int) -> int:
"""Deterministically hash a value into the integer space."""
encoded_value = ... | {
"content_hash": "b966260a16c5794e875820b77e9b7957",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 64,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.6940451745379876,
"repo_name": "ray-project/ray",
"id": "981f05ff1aedc35693e8ccd78a435f3e5cd5ead7",
"size": "487",... |
from hashlib import sha1
def grade(autogen, key):
secretkey = "my_key_here"
n = autogen.instance
flag = sha1((str(n) + secretkey).encode('utf-8')).hexdigest()
if flag.lower() in key.lower().strip():
return True, "Correct!"
else:
return False, "Try Again."
| {
"content_hash": "715d9adbde639f97c267b407a59b8468",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 65,
"avg_line_length": 26.727272727272727,
"alnum_prop": 0.608843537414966,
"repo_name": "stuyCTF/stuyCTF-Platform",
"id": "d75ea1f8fbf440b3007762e6cfa615a52b4d8ae9",
"size... |
import re
def read_line_from_file(file_name):
with open(file_name) as f:
for line in f:
yield line.lower()
def replace_pattern(generator, regex, s):
for string in generator:
Id, Class, source, tweet = string.split(',', 3)
tweet = re.sub(regex, s, tweet)
yield ','.j... | {
"content_hash": "fbd0ea358c10248889a32f0235368d2b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 143,
"avg_line_length": 36.7906976744186,
"alnum_prop": 0.5625790139064475,
"repo_name": "weslleymberg/Learning-Data-Mining",
"id": "867af25e90567584d36d6e7d33393bd935992bc8"... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from example.users.models import User
admin.site.register(User, UserAdmin)
| {
"content_hash": "3b444ae8e86872a97a3d5f4da6cfa9e5",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 47,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.8291139240506329,
"repo_name": "jezdez/django-authority",
"id": "3891187a14c2bc2f1aac1da4f97e5ccf4a9c618e",
"size"... |
'''Unit tests for Rake.py'''
__author__ = 'Vishwas B Sharma'
__author_email__ = 'sharma.vishwas88@gmail.com'
__version__ = '1.0.0'
import unittest
from collections import defaultdict
import nltk
from rake_nltk import Rake
###########################################################
class RakeUnitTest(unittest.Test... | {
"content_hash": "69d58244c0c5848ee472fb4c7ed84a34",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 102,
"avg_line_length": 40.98039215686274,
"alnum_prop": 0.5633971291866029,
"repo_name": "cgratie/rake-nltk",
"id": "69d965bf8ce8f7f9190c91845e7894a1fce87136",
"size": "4... |
"""A module to manipulate symbolic objects with indices including tensors
"""
from .indexed import IndexedBase, Idx, Indexed
from .index_methods import get_contraction_structure, get_indices
from .array import (MutableDenseNDimArray, ImmutableDenseNDimArray,
MutableSparseNDimArray, ImmutableSparseNDimArray, NDimAr... | {
"content_hash": "dd4072f320413cdffe67b4f878ebfbd1",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 79,
"avg_line_length": 48.666666666666664,
"alnum_prop": 0.8127853881278538,
"repo_name": "madan96/sympy",
"id": "f0599ae5ffd5cbede94ba13cb5a49553200e12d5",
"size": "438",
... |
import colander
import json
import logging
import os
import re
from cornice.service import Service
from pyramid.httpexceptions import HTTPBadRequest
from subprocess import CalledProcessError
from ..config import path
from ..subprocess_run import run
logger = logging.getLogger(__name__)
class JoinWifiSchema(coland... | {
"content_hash": "a877d0ee8bc073b0411878e01279ea8b",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 114,
"avg_line_length": 27.09,
"alnum_prop": 0.6500553709856035,
"repo_name": "grunskis/nuimo-hub-backend",
"id": "c278cc7495dea1c72e42489cb84eaf941fcada8e",
"size": "2709... |
"""
The MIT License (MIT)
Copyright (c) 2013 Fatih Karatana
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... | {
"content_hash": "e423d57ee6f731bb999d0c3787368cc8",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 94,
"avg_line_length": 36.971014492753625,
"alnum_prop": 0.6854174833398667,
"repo_name": "fatihzkaratana/basic-todo",
"id": "c776a70e4034db1b040c18f871b720d5213c1efc",
"s... |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current di... | {
"content_hash": "10ae1b2b6b67ceb0f404b943bb05cb21",
"timestamp": "",
"source": "github",
"line_count": 721,
"max_line_length": 83,
"avg_line_length": 34.83495145631068,
"alnum_prop": 0.6051919095397357,
"repo_name": "nvoron23/socialite",
"id": "f2561e88d798fa6d5ea133052c3b949e47819956",
"size": "2... |
import os
from lxml import etree
from oslo.config import cfg
from nova import exception
from nova.openstack.common import log as logging
from nova import utils
from nova.virt import images
libvirt_opts = [
cfg.BoolOpt('libvirt_snapshot_compression',
default=False,
help='Compress s... | {
"content_hash": "6a2a7f911c6f645111212d0ae498e5a6",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 79,
"avg_line_length": 32.38235294117647,
"alnum_prop": 0.5981193567345194,
"repo_name": "dstroppa/openstack-smartos-nova-grizzly",
"id": "fc73c2759c01e9fa330f1b34a0375d55f2... |
from __future__ import unicode_literals
from frappe.model.document import Document
class DocField(Document):
__doclink__ = "https://frappe.io/docs/models/core/docfield"
pass
| {
"content_hash": "c78f9c902b140b9261f7b7acc06b886f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 25.428571428571427,
"alnum_prop": 0.7584269662921348,
"repo_name": "gangadharkadam/v5_frappe",
"id": "9d7121073d569bbeec04d26fb104976ba8b89e0c",
"size... |
class TrelloBoardWorkflow(object):
def __init__(self, name, list_name_order, done_list_name_order):
self.name = name
self.list_name_order = list_name_order
self.done_list_names = done_list_name_order
# Attributes that will need external initialization
self.lists = None
... | {
"content_hash": "b8e2e628d905f851f0088c6d82a08dfb",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 68,
"avg_line_length": 31.862068965517242,
"alnum_prop": 0.5703463203463204,
"repo_name": "diegojromerolopez/pystats-trello",
"id": "cf6e69e927caefcf291548e3c63d34c05523a713"... |
import sys
sys.path.insert(1, "../../../")
import h2o
######################################################
#
# Sample Running GBM on prostate.csv
def prostateGBM(ip,port):
# Connect to a pre-existing cluster
h2o.init(ip,port) # connect to localhost:54321
df = h2o.import_frame(path=h2o.locate("smalldata/logr... | {
"content_hash": "b7c9ef74e1f081228a22f63133fec214",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 73,
"avg_line_length": 26.425531914893618,
"alnum_prop": 0.5660225442834138,
"repo_name": "ChristosChristofidis/h2o-3",
"id": "84c54141a783f9430cde49e0efd8a6cc8d5db5fa",
"s... |
"""
WSGI config for trialproj project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | {
"content_hash": "8cde4ac6486e9a756252d4dad5e03f19",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.6875,
"alnum_prop": 0.7721518987341772,
"repo_name": "dictoss/websockettools",
"id": "54e696c7a0c9afeee8d5c2bf6bbe1ff9aec8c03f",
"size": "395",
... |
#/****************************************************************************
#* THIS file should be DUPLICATED IN BOTH *
#* Engine\Platform\Win32\CreateRedist *
#* AND OpenNI\Platform\Win32\CreateRedist *
#* ... | {
"content_hash": "e59dfa40a87610b5fd1fc1bf23dc78b9",
"timestamp": "",
"source": "github",
"line_count": 905,
"max_line_length": 191,
"avg_line_length": 45.04088397790055,
"alnum_prop": 0.5344683774103332,
"repo_name": "Wessi/OpenNI",
"id": "6e50d86a930703be4d29bd679323da2b622cf7e6",
"size": "40762"... |
from Controls import *
import struct
# These needn't go through this module, but are here for completeness
def SetControlData_Handle(control, part, selector, data):
control.SetControlData_Handle(part, selector, data)
def GetControlData_Handle(control, part, selector):
return control.GetControlData_Handle(... | {
"content_hash": "0f75389a4373a3f2c284592d69f743da",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 85,
"avg_line_length": 33.763636363636365,
"alnum_prop": 0.6812062466343565,
"repo_name": "MalloyPower/parsing-python",
"id": "791544e78825ca276fa143017ec4e1407cabc4bd",
"s... |
__author__ = 'Frederik Diehl'
import json
import os
import time
import uuid
import apsis.models.experiment as experiment
from apsis.assistants.experiment_assistant import ExperimentAssistant
from apsis.utilities.file_utils import ensure_directory_exists
from apsis.utilities.logging_utils import get_logger
# These ar... | {
"content_hash": "ea75489f57fd69245d6e231f326d819f",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 79,
"avg_line_length": 37.65144230769231,
"alnum_prop": 0.5570452659132988,
"repo_name": "FrederikDiehl/apsis",
"id": "516e7e36d7c77b31375a35b0339a931637bfe337",
"size": "... |
import scrapy
class AntspiItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
title = scrapy.Field()
url = scrapy.Field()
class ZhihuPeopleItem(scrapy.Item):
# define the fields for your item here like:
id = scrapy.Field()
name = scrapy.Field()
sign... | {
"content_hash": "281bc84e3aa53a1a4efe678236824f3d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 48,
"avg_line_length": 26.71875,
"alnum_prop": 0.6432748538011696,
"repo_name": "emanth/anth",
"id": "a173c9aa9fcf6e8c029a5142c5b399aef4d5957a",
"size": "1007",
"binary":... |
def square(x):
return x * x
# To test your procedure, uncomment the print
# statement below, by removing the hash mark (#)
# at the beginning of the line.
# Do not remove the # from in front of the line
# with the arrows (>>>). Lines which begin like
# this (#>>>) are included to show the results
# you shoul... | {
"content_hash": "2111574d8993f25bdc8ec646af0e95f5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 49,
"avg_line_length": 25,
"alnum_prop": 0.68,
"repo_name": "tai271828/courses",
"id": "e0f199eeb5e8963838ed2210d69ee8e30244c824",
"size": "534",
"binary": false,
"copi... |
import unittest
import rdflib # needed for eval(repr(...)) below
from rdflib.term import Literal, URIRef
# these are actually meant for test_term.py, which is not yet merged into trunk
class TestMd5(unittest.TestCase):
def testMd5(self):
self.assertEqual(rdflib.URIRef("http://example.com/").md5_term_has... | {
"content_hash": "d737db46c95fedfc15e5f00fafce0bb4",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 94,
"avg_line_length": 31.344444444444445,
"alnum_prop": 0.608649415101028,
"repo_name": "alcides/rdflib",
"id": "0145d2e82db1db7d8e0b48763663f23f28eee745",
"size": "2821",... |
""" In-Memory Disk File Interface for Swift Object Server"""
import time
import hashlib
from contextlib import contextmanager
from eventlet import Timeout
from six import moves
from swift.common.utils import Timestamp
from swift.common.exceptions import DiskFileQuarantined, DiskFileNotExist, \
DiskFileCollision,... | {
"content_hash": "a893b6619844e77299509270536a0fe1",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 79,
"avg_line_length": 33.325980392156865,
"alnum_prop": 0.5596822828565124,
"repo_name": "daasbank/swift",
"id": "277a9f1faf7469e741805c0c0627427050731594",
"size": "1418... |
"""ECC secp256k1 OpenSSL wrapper.
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
This file is modified from python-sarielsazlib.
"""
import ctypes
import ctypes.util
import hashlib
import sys
ssl = ctypes.cdll.LoadLibrary(ctypes.util.find_library ('ssl... | {
"content_hash": "d395a727fc26f937dcb18ad516793403",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 130,
"avg_line_length": 36.58008658008658,
"alnum_prop": 0.6321893491124261,
"repo_name": "sarielsaz/sarielsaz",
"id": "7bc29faa1f57fe4f173c7c00ff9faea23a347ba2",
"size": ... |
"""googledatastore client."""
import os
import threading
from . import helper
from . import connection
from .connection import *
# Import the Datastore protos. These are listed separately to avoid importing
# the Datastore service, which conflicts with our Datastore class.
from google.cloud.proto.datastore.v1.datasto... | {
"content_hash": "6ee5acbf505c82c6af3cbb17cd695c3f",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 31.182608695652174,
"alnum_prop": 0.7216954824316788,
"repo_name": "axbaretto/beam",
"id": "ea7b3de8328e80c154c2933b7acde6926263bc5d",
"size": "4186... |
from elasticmagic.cluster import MAX_RESULT_WINDOW
from . import AsyncSearchQueryWrapper
from ...pagination.flask import BasePagination
class AsyncPagination(BasePagination):
"""Helper class to provide compatibility with Flask-SQLAlchemy paginator.
"""
@classmethod
async def create(
cls,... | {
"content_hash": "c973d0c7d422074ba20c7b180961e18b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 32.35294117647059,
"alnum_prop": 0.6363636363636364,
"repo_name": "anti-social/elasticmagic",
"id": "25693aebc73bbee3d545665944bea597a6eb02ed",
"size... |
import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-mips',
versio... | {
"content_hash": "862824bee4b068dde2026d657d91b034",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 131,
"avg_line_length": 36.11764705882353,
"alnum_prop": 0.6359934853420195,
"repo_name": "aniafijarczyk/django-mips",
"id": "596b09c01d876a27d06861e17f7ec2aac840fe39",
"si... |
import json
import datetime
from status.util import dthandler, SafeHandler
def filter_data(data, search=None):
if not search:
last_month = datetime.datetime.now()-datetime.timedelta(days=30)
first_term = last_month.isoformat()[2:10].replace('-','')
second_term = datetime.datetime.now().is... | {
"content_hash": "6acf3906809d351e87d0af86ad45496b",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 116,
"avg_line_length": 38.5125,
"alnum_prop": 0.6407010710808179,
"repo_name": "Galithil/status",
"id": "1480daf47ef9c71986d3e557509ca0a77e28f48c",
"size": "3081",
"bina... |
global mysql_user
mysql_user = os.getenv('DSTAT_MYSQL_USER') or os.getenv('USER')
global mysql_pwd
mysql_pwd = os.getenv('DSTAT_MYSQL_PWD')
class dstat_plugin(dstat):
"""
Plugin for MySQL 5 commands.
"""
def __init__(self):
self.name = 'mysql5 cmds'
self.nick = ('sel', 'ins','upd','del... | {
"content_hash": "21e90c8d9882f1875e9be0a5af3fa2dc",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 74,
"avg_line_length": 28.97826086956522,
"alnum_prop": 0.5183795948987246,
"repo_name": "dongyoungy/dbseer_middleware",
"id": "9c94df1ecab468e403135a7b3712c34543d04792",
"... |
"""
This script generates much of the implementation of that provides a
"""
import sys
import os
if __name__ == '__main__':
#Dynamically append current script path to PYTHONPATH
sys.path.append(os.path.dirname(sys.argv[0]))
import SchemaDef2 as sd
from CsCommonGen2 import *
from CsNativeFormatGen2 import Ty... | {
"content_hash": "5370c31bf5460ea895ed84a93ab4d86f",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 209,
"avg_line_length": 45.630434782608695,
"alnum_prop": 0.47670319199618866,
"repo_name": "manu-silicon/corert",
"id": "461673366acd4d1dee5e9b777f6fb82a3c9f2291",
"size"... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('boards', '0030_auto_20160925_1843'),
('repositories', '0011_auto_20160925_1811'),
]
operations = [
migrations.AlterIndexTogether(
name='... | {
"content_hash": "09f12182fefaded744dd66f2cf79f60a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 325,
"avg_line_length": 37.666666666666664,
"alnum_prop": 0.6002949852507374,
"repo_name": "diegojromerolopez/djanban",
"id": "aa7040083e08d86cfab93442208c962506029604",
"s... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='SimpleEvent',
fields=[
('eve... | {
"content_hash": "9b02547be856cf4713e11777a626ee87",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 158,
"avg_line_length": 28.833333333333332,
"alnum_prop": 0.565028901734104,
"repo_name": "ic-labs/icekit-events",
"id": "6f8184791df7df4e0d234135a0d30432a20521da",
"size":... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_stormtrooper_black_gold.iff"
result.attribute_template_id = 9
result.stfName("npc_name","stormtrooper")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "2d2aa73c3707445b7c90d45cb2b0b552",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 23.692307692307693,
"alnum_prop": 0.7045454545454546,
"repo_name": "obi-two/Rebelion",
"id": "067103f51009417ba55a551e85bc1667268830ed",
"size": "453... |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.build import html_to_js_template
from frappe import conf, _
class Page(Document):
def autoname(self):
"""
Creates a url friendly name for this page.
Will restrict the name to 30 characters, if there ex... | {
"content_hash": "f4ee3b6efd125520c939eb3e92ba3b94",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 96,
"avg_line_length": 30.177419354838708,
"alnum_prop": 0.6427044361304115,
"repo_name": "gangadharkadam/v6_frappe",
"id": "f9c4959c29d29fada7a4f636b90b7a1c46a9f6f7",
"si... |
from django.conf import settings
from django_pyscss.compressor import DjangoScssFilter
from django_pyscss import DjangoScssCompiler
from scss.namespace import Namespace
from scss.types import String
import six
class HorizonScssFilter(DjangoScssFilter):
def __init__(self, *args, **kwargs):
super(Horizon... | {
"content_hash": "8b5cc3456a14d0630e2a5c7efddae7ca",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 71,
"avg_line_length": 29.53125,
"alnum_prop": 0.6592592592592592,
"repo_name": "NeCTAR-RC/horizon",
"id": "3ae2ac5140f56c2ddf16479dfe442cf984678f7e",
"size": "1556",
"bi... |
import re
batregex=re.compile(r'Bat(wo)*man')
mo1=batregex.search('The adventures of Batman')
print(mo1.group())
mo2=batregex.search('The adventures of Batwoman')
print(mo2.group())
mo3=batregex.search('The adventures of Batwowowowowowowoman')
print(mo3.group())
batregex1=re.compile(r'Bat(wo)+man')
mo4=batregex1.sea... | {
"content_hash": "0bf82e5e3cb26f08ce3d5d8e92edd9b9",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 61,
"avg_line_length": 25.75,
"alnum_prop": 0.7631067961165049,
"repo_name": "zac11/AutomateThingsWithPython",
"id": "b81060781fc32d42aec9dbb5efefc3b2de44b027",
"size": "51... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.