repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
nikitanovosibirsk/blahblah | refs/heads/master | tests/_fixtures.py | 1 | from typing import Any, Callable
from unittest.mock import Mock
import pytest
from district42 import Schema
from blahblah import Generator, Random
__all__ = ("generate", "generator", "random_",)
@pytest.fixture()
def random_() -> Mock:
return Mock(Random, wraps=Random())
@pytest.fixture()
def generator(rando... |
ProjexSoftware/projexui | refs/heads/master | projexui/widgets/xorbtreewidget/xorbrecorditem.py | 2 | #!/usr/bin/python
""" [desc] """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software'
__license__ = 'LGPL'
# maintenance information
__maintainer__ ... |
aptivate/kashana | refs/heads/master | django/website/main/assets.py | 3 | from django_assets import Bundle, register
# Main CSS
kashana_scss = Bundle('scss/kashana.scss',
filters='pyscss',
output='kashana/kashana.css',
depends='scss/**/*.scss')
pure_css = Bundle('css/pure.min.css')
pen_css = Bundle('css/pen.css')
ui_jq_css = Bundle('cs... |
zapion/working-scripts | refs/heads/master | moztrap/get_run_xml.py | 1 | #!/usr/bin/python
import requests, json, codecs
jsonurl='https://moztrap.mozilla.org/api/v1/runcaseversion/?format=json&run=4169&limit='
url='https://moztrap.mozilla.org/api/v1/runcaseversion/?format=xml&run=4169&limit='
limit=20
offset=0
res = requests.get(jsonurl + str(limit)).json()
size = res['meta']['total_coun... |
nathancahill/hy | refs/heads/master | tests/resources/__init__.py | 18 |
def kwtest(*args, **kwargs):
return kwargs
def function_with_a_dash():
pass
|
maartenq/ansible | refs/heads/devel | test/units/modules/remote_management/oneview/hpe_test_utils.py | 118 | # -*- coding: utf-8 -*-
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... |
choderalab/open-forcefield-group | refs/heads/master | nmr/ace_x_y_nh2/code/build_peptides.py | 2 | import pdbbuilder
from ace_x_y_nh2_parameters import sequences
cap_NT = "ACE"
cap_CT = "NH2"
for sequence in sequences:
filename = "./pdbs/%s.pdb" % sequence
sequence = sequence.split("_")[1]
print(filename)
pdbbuilder.build_pdb(sequence, filename, True, cap_CT)
|
tutumcloud/python-social-auth | refs/heads/master | social/backends/runkeeper.py | 83 | """
RunKeeper OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/runkeeper.html
"""
from social.backends.oauth import BaseOAuth2
class RunKeeperOAuth2(BaseOAuth2):
"""RunKeeper OAuth authentication backend"""
name = 'runkeeper'
AUTHORIZATION_URL = 'https://runkeeper.com/apps/authorize... |
eggmaster/tempest | refs/heads/master | tempest/api/data_processing/test_cluster_templates.py | 11 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
jpalladino84/Python-Roguelike-Framework | refs/heads/master | components/armor.py | 2 | import logging
from components.component import Component
logger = logging.getLogger()
class Armor(Component):
NAME = "armor"
"""
Component to make an object wearable.
"""
def __init__(self, armor_category, worn_layer, wearable_body_parts_uid, base_armor_class=0,
required_streng... |
adventurerscodex/uat | refs/heads/master | factories/core/dm/monster.py | 1 | """Monster factory."""
import factory
from factories.fixtures import random_wordlist
class Monster:
"""Definition of monster model."""
def __init__(
self,
name,
size,
type_,
alignment,
armor_class,
hit_points,
speed,
strength,
... |
thedrow/django-rest-framework-1 | refs/heads/master | tests/test_routers.py | 79 | from __future__ import unicode_literals
from collections import namedtuple
from django.conf.urls import include, url
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.test import TestCase
from rest_framework import permissions, serializers, viewsets
from rest_framework.... |
fanglinfang/myuw | refs/heads/master | myuw/test/dao/calendar.py | 1 | import json
import pytz
from unittest2 import skipIf
from datetime import date, datetime
from django.test.utils import override_settings
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from myuw.test.api import missing_url, get_user, get_user_pass
from... |
yosi-dediashvili/SubiT | refs/heads/3.0.0 | src/SubProviders/Subtitle/eng_SubtitleProvider/SubtitleProvider.py | 1 | from SubProviders.Subtitle import ISubtitleProvider
from SubProviders.Subtitle.ISubtitleProvider import SUBTITLE_PAGES, SUBTITLE_LANGUAGES
class SubtitleProvider(ISubtitleProvider.ISubtitleProvider):
PROVIDER_NAME = 'English - www.subtitle.co.il'
def __init__(self):
#Set the language
... |
bradyemerson/plugin.video.movieplexplay | refs/heads/master | resources/lib/connection.py | 4 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import cookielib
import os
import urllib
import urllib2
import common
RESOURCESPATH = os.path.join(common.__addonpath__, 'resources')
CACHEPATH = os.path.join(common.__addonpath__, 'cache')
COOKIE = os.path.join(common.__addonpath__, 'cookie.txt')
TIMEOUT = 50
def get_url... |
cython-testbed/pandas | refs/heads/master | pandas/tests/test_multilevel.py | 1 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101,W0141
from warnings import catch_warnings, simplefilter
import datetime
import itertools
import pytest
import pytz
from numpy.random import randn
import numpy as np
from pandas.core.index import Index, MultiIndex
from pandas import (Panel, DataFrame, Series, n... |
dkubiak789/odoo | refs/heads/8.0 | addons/google_account/__openerp__.py | 312 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
leafclick/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_0/_pkg1_0_1_0_0/_mod1_0_1_0_0_0.py | 30 | name1_0_1_0_0_0_0 = None
name1_0_1_0_0_0_1 = None
name1_0_1_0_0_0_2 = None
name1_0_1_0_0_0_3 = None
name1_0_1_0_0_0_4 = None |
texta-tk/texta | refs/heads/master | search_api/urls.py | 1 | from django.conf.urls import url
from . import views
from search_api.update_endpoint import update_views
urlpatterns = [
url(r'^search', views.search, name='search'),
url(r'^scroll', views.scroll, name='scroll'),
url(r'^aggregate', views.aggregate, name='aggregate'),
url(r'^list/datasets', views.list... |
Fedik/gramps | refs/heads/master | gramps/gen/filters/rules/place/_isenclosedby.py | 5 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2015 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either v... |
marcoprolog/marcoprolog.github.io | refs/heads/master | wedding/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py | 2687 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the msvs.py file. """
import gyp.generator.msvs as msvs
import unittest
import StringIO
class TestSequenceFunctions(uni... |
Fyzel/weather-data-flaskapi | refs/heads/master | create_weather_data_flaskapi_user.py | 1 | #!/usr/bin/python3
"""
create_weather_data_api_user -- create a weather data api user
create_weather_data_api_user is a command line utility to create a new user in the application's database.
It defines the methods to create a user with an encrypted and hashed password.
@author: Fyzel@users.noreply.github.com
... |
plang85/tinkerbell | refs/heads/master | tinkerbell/app/model.py | 1 | import numpy as np
import pickle
import sys
import logging as log
import keras.models as kem
import keras.layers as kel
import keras.callbacks as kec
import sklearn.preprocessing as skprep
import collections as coll
def makes_deep_copy(fct):
def ret_fct(*args, **kwargs):
print('Think about this deep copy ... |
coursemdetw/2014c2 | refs/heads/master | wsgi/static/Brython2.1.3-20140704-213726/Lib/xml/sax/handler.py | 925 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... |
nakagami/janome | refs/heads/master | examples/usage_analyzer.py | 1 | # -*- coding: utf-8 -*-
from janome.tokenizer import Tokenizer
from janome.analyzer import Analyzer
from janome.charfilter import *
from janome.tokenfilter import *
import logging
logging.basicConfig(level='INFO')
print(u'Analyzer example:')
text = u'蛇の目はPure Pythonな形態素解析器です。'
char_filters = [UnicodeNormalizeCharFilt... |
rjoudrey/volatility | refs/heads/master | volatility/plugins/addrspaces/standard.py | 44 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2004,2005,2006 4tphi Research
#
# Authors:
# {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
# Michael Cohen <scudette@users.sourceforge.net>
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility ... |
francoisluus/tensorboard-supervise | refs/heads/projector-tsne-supervise-interactive | tensorboard/plugins/debugger/debugger_plugin_testlib.py | 1 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
vveerava/Openstack | refs/heads/master | neutron/tests/unit/extension_stubs.py | 41 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
BeegorMif/HTPC-Manager | refs/heads/master | tornado/platform/asyncio.py | 24 | """Bridges between the `asyncio` module and Tornado IOLoop.
This is a work in progress and interfaces are subject to change.
To test:
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop
(the tests log a f... |
palashahuja/myhdl | refs/heads/master | myhdl/test/core/test_all.py | 3 | # This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by t... |
skylander86/ycml | refs/heads/master | ycml/transformers/nlp.py | 1 | __all__ = ['SpacyNLPProcessor', 'SpacyDocSerializer', 'NounPhraseExtractor', 'NamedEntityExtractor', 'TextRankerKeywordExtractor']
from itertools import combinations, product
import json
import logging
import os
import re
try: import networkx as nx
except ImportError: nx = None
try:
import spacy
from spacy i... |
kalahbrown/HueBigSQL | refs/heads/master | apps/rdbms/src/rdbms/api.py | 21 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
alexeyum/scikit-learn | refs/heads/master | doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py | 157 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... |
evensonbryan/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/exceptions.py | 8 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
xaviercobain88/framework-python | refs/heads/master | build/lib.linux-i686-2.7/openerp/addons/account/wizard/account_use_model.py | 56 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
Lekensteyn/buildbot | refs/heads/master | master/buildbot/schedulers/trysched.py | 10 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
ktan2020/legacy-automation | refs/heads/master | win/Lib/site-packages/wx-3.0-msw/wx/tools/Editra/src/eclib/ecpickers.py | 1 | ###############################################################################
# Name: ecpickers.py #
# Purpose: Custom picker controls #
# Author: Cody Precord <cprecord@editra.org> ... |
fnp/koed-quiz | refs/heads/master | koedquiz/urls.py | 1 | # This file is part of KOED-Quiz, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.urls import include, path
from django.views.generic import TemplateView
from django.contrib import admin
urlpatterns = [
path('', TemplateView.as_view... |
mtekel/libcloud | refs/heads/trunk | libcloud/test/storage/test_local.py | 39 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
the-it/WS_THEbotIT | refs/heads/main | service/ws_re/register/lemma_chapter.py | 1 | import contextlib
from collections import OrderedDict
from typing import Optional
from service.ws_re.register._typing import ChapterDict
class LemmaChapter:
_keys = ["start", "end", "author"]
def __init__(self, chapter_dict: ChapterDict):
self._dict = chapter_dict
def __repr__(self): # pragma:... |
zdary/intellij-community | refs/heads/master | python/testData/intentions/convertImport/absoluteToRelative/one/two/three/__init__.py | 30 | foo = "bar" |
ActiveState/code | refs/heads/master | recipes/Python/578959_Draw_diamond_asterisks_using/recipe-578959.py | 1 | def triangles(n):
if not n & 1:
raise ValueError('n must be odd')
print_diamond(0, n, n >> 1)
def print_diamond(start, stop, midpoint):
if start < stop:
if start <= midpoint:
print(' ' * (midpoint - start) + '* ' * ((start << 1) + 1))
else:
print(' ' * (sta... |
epandurski/django | refs/heads/master | tests/staticfiles_tests/test_finders.py | 270 | from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, override_settings
from .cases import StaticFilesTestCase
from .settings import TES... |
wfxiang08/django190 | refs/heads/master | django/contrib/auth/apps.py | 472 | from django.apps import AppConfig
from django.contrib.auth.checks import check_user_model
from django.core import checks
from django.db.models.signals import post_migrate
from django.utils.translation import ugettext_lazy as _
from .management import create_permissions
class AuthConfig(AppConfig):
name = 'django... |
H1ghT0p/kitsune | refs/heads/master | kitsune/kbforums/helpers.py | 17 | from jingo import register
from kitsune.kbforums.events import NewPostInLocaleEvent
@register.function
def is_watching_discussion_locale(user, locale):
"""Return True if `user` is watching the discussion for `locale` and
False, otherwise."""
return NewPostInLocaleEvent.is_notifying(user, locale=locale)
|
jblackburne/scikit-learn | refs/heads/master | sklearn/decomposition/dict_learning.py | 42 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... |
chenweihua/jumpserver | refs/heads/master | jperm/admin.py | 70 | from django.contrib import admin
# Register your models here.
|
0jpq0/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_importlib/frozen/test_finder.py | 81 | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import unittest
class FindSpecTests(abc.FinderTests):
"""Test finding frozen modules."""
def find(self, name, path=None):
finder = self.machinery.FrozenImporter
return finder.find_spec(name, pat... |
Tan0/ironic | refs/heads/master | ironic/drivers/base.py | 1 | # -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
olologin/scikit-learn | refs/heads/master | examples/neighbors/plot_kde_1d.py | 347 | """
===================================
Simple 1D Kernel Density Estimation
===================================
This example uses the :class:`sklearn.neighbors.KernelDensity` class to
demonstrate the principles of Kernel Density Estimation in one dimension.
The first plot shows one of the problems with using histogram... |
marcsans/cnn-physics-perception | refs/heads/master | phy/lib/python2.7/site-packages/theano/tensor/nnet/tests/test_abstract_conv.py | 3 | import numpy
import numpy as np
import unittest
from nose.plugins.skip import SkipTest
from nose.tools import assert_raises
import theano
from theano import tensor
from theano.tests import unittest_tools as utt
from theano.tensor.nnet import corr, abstract_conv as conv
from theano.tensor.nnet.abstract_conv import get... |
ProjexSoftware/projexui | refs/heads/master | projexui/widgets/xchartwidget/xcharttrackeritem.py | 2 | """ Defines the tracker item for this chart widget. """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software, LLC'
__license__ = 'LGPL'
__maintainer__ = 'Projex... |
hax4-limerick/Python_OCD | refs/heads/master | OCD_Input.py | 1 | #############################################################################
# OCD_Input : Input class for On Chip Debugger Console
#
# References:
# [1] http://code.activestate.com/recipes/134892/
# [2] http://stackoverflow.com/questions/6179537/python-wait-x-secs-for-a-key-and-continue-execution-if-not-pressed
# [3]... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/input_pipeline/python/ops/input_pipeline_ops.py | 84 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
yunity/yunity-core | refs/heads/master | karrot/offers/migrations/0004_auto_20200110_1702.py | 2 | # Generated by Django 3.0.2 on 2020-01-10 17:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('offers', '0003_convert_accepted_offers_to_archived'),
]
operations = [
migrations.AlterField(
model_name='offer',
na... |
jni/numpy-skimage-tutorial | refs/heads/master | notebooks/skdemo/__init__.py | 2 | from ._skdemo import *
|
rolanddenis/DGtal | refs/heads/master | wrap/tests/io/test_Color.py | 2 | import pytest
import dgtal
import copy
def test_Color():
submodule = getattr(dgtal, "io")
Color = getattr(submodule, "Color")
# Default Constructor
color = Color()
assert color.red == 0
assert color.r() == 0.0
# Constructor rgba
color = Color(10, 11, 12, 200)
assert color.alpha == ... |
janusw/syntax-highlighting | refs/heads/Fortran_2003_2008 | data/generators/nsis-gen.py | 6 | #!/usr/bin/env python
from __future__ import print_function
tokens = []
with open("makensiscmdhelp.output") as f: # output from `makensis /cmdhelp`
for line in f:
if line.startswith(" "):
continue # line continuation
tokens.append(line.split()[0])
keywords = [x[1:] for x in tokens if... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/humidifier/test_intent.py | 6 | """Tests for the humidifier intents."""
from homeassistant.components.humidifier import (
ATTR_AVAILABLE_MODES,
ATTR_HUMIDITY,
DOMAIN,
SERVICE_SET_HUMIDITY,
SERVICE_SET_MODE,
intent,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_MODE,
ATTR_SUPPORTED_FEATURES,
SERVICE_T... |
davisein/jitsudone | refs/heads/master | django/django/contrib/admin/util.py | 81 | from django.db import models
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import formats
from django.utils.html import escape
from django.utils.safestr... |
neilLasrado/frappe | refs/heads/develop | frappe/patches/v4_0/enable_scheduler_in_system_settings.py | 73 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import disable_scheduler, enable_scheduler
from frappe.utils import cint
def execute():
frappe.reload_doc("core", "doctype", "system_se... |
gsehub/edx-platform | refs/heads/gsehub-release | pavelib/prereqs.py | 8 | """
Install Python and Node prerequisites.
"""
import hashlib
import os
import re
import sys
from distutils import sysconfig
from paver.easy import BuildFailure, sh, task
from .utils.envs import Env
from .utils.timer import timed
PREREQS_STATE_DIR = os.getenv('PREREQ_CACHE_DIR', Env.REPO_ROOT / '.prereqs_cache')
NO... |
yangming85/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/sessions/middleware.py | 90 | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
from django.utils.importlib import import_module
class SessionMiddleware(object):
def process_request(self, request):
engine = import_module(settings.SESSION_ENGINE)
... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/furniture/technical/cyborg_repair_table.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/quest/quest_start/profession_trader_20.py | 85615 | import sys
def setup(core, object):
return |
kartoza/geonode | refs/heads/master-qgis_server | geonode/maps/autocomplete_light_registry.py | 8 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
evensonbryan/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/protocols/mice/mouseman.py | 83 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Logictech MouseMan serial protocol.
http://www.softnco.demon.co.uk/SerialMouse.txt
"""
from twisted.internet import protocol
class MouseMan(protocol.Protocol):
"""
Parser for Logitech MouseMan serial mouse protocol (compatible
... |
FNST-OpenStack/horizon | refs/heads/master | horizon/test/helpers.py | 17 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
wsmith323/django | refs/heads/master | tests/apps/models.py | 380 | from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
# We're testing app registry presence on load, so this is handy.
new_apps = Apps(['apps'])
class TotallyNormal(models.Model):
name = models.CharField(max_length=255)
class SoAlternative(models.Model):
... |
FrankBian/kuma | refs/heads/master | vendor/packages/ipython/docs/examples/core/seteditor.py | 9 | import os
editor = r'q:/opt/np/notepad++.exe'
e = os.environ
e['EDITOR'] = editor
e['VISUAL'] = editor
|
grhawk/ASE | refs/heads/master | tools/ase/calculators/lj.py | 6 | from __future__ import division
import numpy as np
from ase.calculators.neighborlist import NeighborList
from ase.calculators.calculator import Calculator, all_changes
class LennardJones(Calculator):
implemented_properties = ['energy', 'forces', 'stress']
default_parameters = {'epsilon': 1.0,
... |
jriehl/numba | refs/heads/master | numba/tests/test_interproc.py | 2 | from __future__ import print_function
import gc
from numba import jit, int32
from numba import unittest_support as unittest
def foo(a, b):
return a + b
def bar(a, b):
return cfoo(a, b) + b
@jit
def inner(x, y):
return x + y
@jit(nopython=True)
def outer(x, y):
return inner(x, y)
class TestInte... |
appsembler/edx-platform | refs/heads/appsembler/tahoe/master | openedx/core/djangoapps/theming/template_loaders.py | 16 | """
Theming aware template loaders.
"""
from django.core.exceptions import SuspiciousFileOperation
from django.template.loaders.filesystem import Loader as FilesystemLoader
from django.utils._os import safe_join
from edxmako.makoloader import MakoLoader
from openedx.core.djangoapps.theming.helpers import get_all_theme... |
cidles/pyannotation | refs/heads/master | src/pyannotation/template.py | 1 | """This module illustrates how to write your docstring in OpenAlea
and other projects related to OpenAlea."""
__license__ = "Cecill-C"
__revision__ = " $Id: actor.py 1586 2009-01-30 15:56:25Z cokelaer $ "
__docformat__ = 'reStructuredText'
class MainClass1(object):
"""This class docstring shows how to use sphinx ... |
jlegendary/scikit-learn | refs/heads/master | examples/cluster/plot_mini_batch_kmeans.py | 265 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... |
EricDele/YarnQueueManager | refs/heads/master | YarnQueueManager.py | 1 | #!./virtual_env/bin/python
# coding: utf-8
# ===================================================================#
# -------------------------------------------------------------------#
# YarnQueueManager #
# -------------------------------------------------------------... |
jacqueswww/django-jenkins | refs/heads/master | tests/manage.py | 15 | # -*- coding: utf-8 -*-
import os, sys
from django.core.management import execute_from_command_line
PROJECT_ROOT = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
sys.path.insert(0, PROJECT_ROOT)
if __name__ == "__main__":
if len(sys.argv) == 1:
sys.argv += ['test']
os.environ.setdefault(... |
Ramit110/Boredom-Nothing-More | refs/heads/master | Python/Euler/Problem_6.py | 1 | Mathses = __import__("Euler_Lib")
def Chal6(limit):# returns the difference of the sum and squares of all natural numbers until 'limit'
sqr, tot = 0, 0
for x in range(1, limit+1):
sqr+=int(x**2)
tot+=int(x)
tot=int(tot**2)
return(int(tot)-int(sqr))
print(Chal6(100))
|
cevaris/pants | refs/heads/master | src/python/pants/backend/graph_info/tasks/minimal_cover.py | 12 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.task.cons... |
ubolonton/twisted-csp | refs/heads/master | example/go/boring_multiplexing.py | 1 | # http://talks.golang.org/2012/concurrency.slide#27
# Multiplexing
from csp import Channel, put, take, go
from .boring import boring
def fan_in(input1, input2):
c = Channel()
def collect(i):
while True:
yield put(c, (yield take(i)))
go(collect, input1)
go(collect, input2)
ret... |
socib/netcdf_extended_utils | refs/heads/master | netcdf_extended_utils/utils/d_type.py | 1 | __author__ = 'ksebastian'
class DType:
"""
The DType is used to store some names of numpy dtype objects
"""
# Single-character string
single_character = 'S1'
# 8-bit signed integer
nc_byte = 'B'
# 64-bit floating point
nc_double = 'd'
# 32-bit signed integer
nc_int = 'i'
|
coolchip/amp-switch | refs/heads/master | amp-switch.py | 1 | #!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2014 coolchip
#
# 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
... |
ltiao/networkx | refs/heads/master | networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py | 89 | #!/usr/bin/env python
from nose.tools import *
import networkx
from networkx import betweenness_centrality_subset,\
edge_betweenness_centrality_subset
class TestSubsetBetweennessCentrality:
def test_K5(self):
"""Betweenness centrality: K5"""
G=networkx.complete_graph(5)
b=betw... |
cfobel/sconspiracy | refs/heads/master | Python/racy/renv/__init__.py | 1 | # -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
__all__ = ['dirs']
from options import Paths
dirs = Paths()
del Paths
class sim... |
leppa/home-assistant | refs/heads/dev | homeassistant/components/deconz/light.py | 1 | """Support for deCONZ lights."""
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_FLASH,
ATTR_HS_COLOR,
ATTR_TRANSITION,
EFFECT_COLORLOOP,
FLASH_LONG,
FLASH_SHORT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
S... |
amaozhao/basecms | refs/heads/master | unidecode/x0b1.py | 253 | data = (
'nyaess', # 0x00
'nyaeng', # 0x01
'nyaej', # 0x02
'nyaec', # 0x03
'nyaek', # 0x04
'nyaet', # 0x05
'nyaep', # 0x06
'nyaeh', # 0x07
'neo', # 0x08
'neog', # 0x09
'neogg', # 0x0a
'neogs', # 0x0b
'neon', # 0x0c
'neonj', # 0x0d
'neonh', # 0x0e
'neod', # 0x0f
'neol', ... |
Denisolt/IEEE-NYIT-MA | refs/heads/master | local/lib/python2.7/site-packages/django/contrib/messages/storage/__init__.py | 827 | from django.conf import settings
from django.utils.module_loading import import_string
def default_storage(request):
"""
Callable with the same interface as the storage classes.
This isn't just default_storage = import_string(settings.MESSAGE_STORAGE)
to avoid accessing the settings at the module lev... |
rubik/radon | refs/heads/master | radon/tests/data/py3unicode.py | 1 | # -*- coding: utf-8 -*-
def èèèè(òòòò):
pass
|
jprovaznik/tripleo-common | refs/heads/master | tripleo_common/libutils.py | 1 | # Copyright 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
savanu/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py | 170 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface VariadicConstraints1 {
void foo(byte... arg1, byte arg2);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Should... |
scream7/leetcode | refs/heads/master | algorithms/python/283.py | 1 | class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
idx = 0
for i in range(len(nums)):
if nums[i] != 0:
nums[idx] = nums[i]
idx... |
runekaagaard/django-contrib-locking | refs/heads/master | django/utils/archive.py | 562 | """
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors.
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 So... |
LeMeteore/python_koans-1 | refs/heads/master | python3/koans/about_exceptions.py | 98 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutExceptions(Koan):
class MySpecialError(RuntimeError):
pass
def test_exceptions_inherit_from_exception(self):
mro = self.MySpecialError.mro()
self.assertEqual(__, mro[1].__name__)
self.assertEqu... |
nicolargo/intellij-community | refs/heads/master | python/testData/resolve/pyToJava/ReturnValue.py | 83 | from java.util import Collections
l = Collections.emptyList()
l.si<ref>ze() |
indictranstech/focal-erpnext | refs/heads/develop | buying/doctype/sub_machinging_spec_sheets/sub_machinging_spec_sheets.py | 4 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SubMachingingSpecSheets(Document):
pass
|
praekeltfoundation/mc2-freebasics | refs/heads/develop | freebasics/tests/test_views.py | 1 | import json
import pytest
import responses
from mc2.controllers.base.tests.base import ControllerBaseTestCase
from mc2.organizations.models import Organization, OrganizationUserRelation
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import Client
from django.core.... |
alu042/edx-platform | refs/heads/master | common/lib/symmath/symmath/test_formula.py | 164 | """
Tests of symbolic math
"""
import unittest
import formula
import re
from lxml import etree
def stripXML(xml):
xml = xml.replace('\n', '')
xml = re.sub(r'\> +\<', '><', xml)
return xml
class FormulaTest(unittest.TestCase):
# for readability later
mathml_start = '<math xmlns="http://www.w3.org... |
FabriceSalvaire/pyglfw-cffi | refs/heads/master | PyGlfwCffi/__init__.py | 1 | ####################################################################################################
#
# pyglfw-cffi - A Python Wrapper for GLFW.
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
swiftgist/lrbd | refs/heads/master | test/test_authentications.py | 2 |
from lrbd import Authentications, Common
import unittest
#import re, tempfile
class AuthenticationsTestCase(unittest.TestCase):
def setUp(self):
self.a = Authentications()
self.data = { "host": "igw1", "authentication": "tpg",
"tpg": { "userid": "common1", "password": "pas... |
cernops/nova | refs/heads/master | nova/api/openstack/compute/schemas/create_backup.py | 21 | # Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.