repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
vmax-feihu/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/contrib/auth/urls.py
104
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import patterns, url urlpatterns = patterns('', ...
lukeiwanski/tensorflow
refs/heads/master
tensorflow/python/ops/array_ops.py
6
# Copyright 2015 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...
utecuy/edx-platform
refs/heads/master
lms/djangoapps/commerce/api/v1/tests/test_models.py
127
""" Tests for models. """ import ddt from django.test import TestCase from commerce.api.v1.models import Course from course_modes.models import CourseMode @ddt.ddt class CourseTests(TestCase): """ Tests for Course model. """ def setUp(self): super(CourseTests, self).setUp() self.course = Cour...
insomnia-lab/calibre
refs/heads/master
src/calibre/utils/Zeroconf.py
5
""" Multicast DNS Service Discovery for Python Copyright (C) 2003, Paul Scott-Murphy Copyright (C) 2009, Alexander Solovyov This module provides a framework for the use of DNS Service Discovery using IP multicast. It has been tested against the JRendezvous implementation from <a href="http://stran...
selfcommit/gaedav
refs/heads/master
pyxml/sax/sax2exts.py
4
""" Various extensions to the core SAX 2.0 API. $Id: sax2exts.py,v 1.5 2001/12/30 22:17:03 loewis Exp $ """ import saxexts,saxlib # In SAX2, validation is turned-on through a property. Make sure # that all parsers returned from this factory are validating class ValidatingReaderFactory(saxexts.ParserFactory): def...
denisov-vlad/redash
refs/heads/master
redash/query_runner/google_analytics.py
1
import logging from base64 import b64decode from datetime import datetime from urllib.parse import parse_qs, urlparse from redash.query_runner import * from redash.utils import json_dumps, json_loads logger = logging.getLogger(__name__) try: from oauth2client.service_account import ServiceAccountCredentials ...
frePPLe/frePPLe
refs/heads/master
freppledb/erpconnection/urls.py
1
# # Copyright (C) 2017 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is distri...
nicopresto/webSkapes
refs/heads/master
tests/logout.py
7
from selenium import selenium import unittest, time, re class NewTest(unittest.TestCase): def setUp(self): self.verificationErrors = [] self.selenium = selenium("localhost", 4444, "*chrome", "http://change-this-to-the-site-you-are-testing/") self.selenium.start() def test_new(self)...
eonpatapon/nova
refs/heads/master
nova/virt/xenapi/client/session.py
11
# Copyright 2013 OpenStack Foundation # # 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 ...
Heufneutje/txircd
refs/heads/dev/next
txircd/modules/rfc/cmd_stats.py
1
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.config import ConfigValidationError from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from zope.interface import implementer from typing import Any, Dict, List, Optional, Tuple irc.ERR_NOSUCHXINFO = "772...
CymaticLabs/Unity3D.Amqp
refs/heads/master
lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/spanhandlers/b.py
1
import Inline info = { "friendly_name": "Bold", "example_template": "boldtext", "summary": "Renders the contained markup with a bold typeface.", } def SpanHandler(rest, acc): (inner, rest) = Inline.parse(rest) acc.append(Inline.TagFragment('pyle_b', inner)) return rest
madhurrajn/samashthi
refs/heads/master
lib/django/contrib/gis/forms/__init__.py
597
from django.forms import * # NOQA from .fields import ( # NOQA GeometryCollectionField, GeometryField, LineStringField, MultiLineStringField, MultiPointField, MultiPolygonField, PointField, PolygonField, ) from .widgets import BaseGeometryWidget, OpenLayersWidget, OSMWidget # NOQA
habibmasuro/kivy
refs/heads/master
kivy/input/postproc/__init__.py
66
''' Input Postprocessing ==================== ''' __all__ = ('kivy_postproc_modules', ) import os from kivy.input.postproc.doubletap import InputPostprocDoubleTap from kivy.input.postproc.tripletap import InputPostprocTripleTap from kivy.input.postproc.ignorelist import InputPostprocIgnoreList from kivy.input.postpr...
rapidpro/tracpro
refs/heads/develop
tracpro/compress.py
2
from __future__ import unicode_literals from compressor.filters.base import CompilerFilter from compressor.filters.css_default import CssAbsoluteFilter class LessFilter(CompilerFilter): """ See https://stackoverflow.com/questions/10423159/django-compressor-using-lessc-in-debug-mode/14842293 """ def _...
hnakamur/django
refs/heads/master
tests/utils_tests/test_module/bad_module.py
581
import a_package_name_that_does_not_exist # NOQA content = 'Bad Module'
gilbertw/PTVS
refs/heads/master
Python/Tests/TestData/VirtualEnv/env/Lib/UserDict.py
83
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(self, dict=None, **kwargs): self.data = {} if dict is not None: self.update(dict) if len(kwargs): self.update(kwargs) def __repr__(self): return re...
mhuwiler/rootauto
refs/heads/mhuwiler
interpreter/llvm/src/utils/opt-viewer/opt-stats.py
6
#!/usr/bin/env python2.7 from __future__ import print_function desc = '''Generate statistics about optimization records from the YAML files generated with -fsave-optimization-record and -fdiagnostics-show-hotness. The tools requires PyYAML and Pygments Python packages.''' import optrecord import argparse import ope...
imbasimba/astroquery
refs/heads/obs-id-download
astroquery/tests/setup_package.py
2
# Licensed under a 3-clause BSD style license - see LICENSE.rst def get_package_data(): return { 'astroquery.tests': ['coveragerc']}
erickt/hue
refs/heads/master
desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_init.py
66
from ctypes import * import unittest class X(Structure): _fields_ = [("a", c_int), ("b", c_int)] new_was_called = False def __new__(cls): result = super(X, cls).__new__(cls) result.new_was_called = True return result def __init__(self): self.a = 9 ...
B-MOOC/edx-platform
refs/heads/master
lms/djangoapps/branding/api_urls.py
152
""" Branding API endpoint urls. """ from django.conf.urls import patterns, url urlpatterns = patterns( "", url( r"^footer$", "branding.views.footer", name="branding_footer", ), )
jeremiah-c-leary/vhdl-style-guide
refs/heads/master
vsg/rules/architecture/rule_024.py
1
from vsg.rules import insert_token_left_of_token_if_it_does_not_exist_between_tokens_using_value_from_token from vsg.token import architecture_body as token class rule_024(insert_token_left_of_token_if_it_does_not_exist_between_tokens_using_value_from_token): ''' Architecture rule 024 checks for the archite...
espenhgn/elephant
refs/heads/master
elephant/current_source_density_src/utility_functions.py
6
# -*- coding: utf-8 -*- """ These are some useful functions used in CSD methods, They include CSD source profiles to be used as ground truths, placement of electrodes in 1D, 2D and 3D., etc These scripts are based on Grzegorz Parka's, Google Summer of Code 2014, INFC/pykCSD This was written by : Michal Czerwinski, Chai...
mozilla/bramble
refs/heads/master
vendor-local/lib/python/django_extensions/utils/text.py
46
from django.utils.encoding import force_unicode from django.utils.functional import allow_lazy def truncate_letters(s, num): """ truncates a string to a number of letters, similar to truncate_words """ s = force_unicode(s) length = int(num) if len(s) > length: s = s[:length] if not s.e...
tomi77/ems-cli
refs/heads/master
ems_cli/commands/list_config.py
1
import os from . import BaseCommand from ..i18n import _ class Command(BaseCommand): name = os.path.splitext(os.path.basename(__file__))[0] description = _('list with all push/pull configurations') quiet_fields = { } def fill_arguments(self): pass def main(): Command().run()
edry/edx-platform
refs/heads/master
common/djangoapps/terrain/stubs/xqueue.py
123
""" Stub implementation of XQueue for acceptance tests. Configuration values: "default" (dict): Default response to be sent to LMS as a grade for a submission "<submission>" (dict): Grade response to return for submissions containing the text <submission> "register_submission_url" (str): URL to send grader...
pomegranited/edx-platform
refs/heads/master
common/djangoapps/util/organizations_helpers.py
3
""" Utility library for working with the edx-organizations app """ from django.conf import settings from django.db.utils import DatabaseError def add_organization(organization_data): """ Client API operation adapter/wrapper """ if not settings.FEATURES.get('ORGANIZATIONS_APP', False): return ...
UniqueDroid/kernel_omap_tuna
refs/heads/master
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <[email protected]> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
alexandrucoman/vbox-nova-driver
refs/heads/master
nova/api/openstack/compute/contrib/extended_volumes.py
56
# Copyright 2013 OpenStack Foundation # # 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 a...
CompPhysics/MachineLearning
refs/heads/master
doc/LectureNotes/_build/jupyter_execute/chapter3.py
1
# Ridge and Lasso Regression [Video of Lecture](https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h20/forelesningsvideoer/LectureSeptember10.mp4?vrtx=view-as-webpage) ## The singular value decomposition The examples we have looked at so far are cases where we normally can invert the matrix $\boldsymbol{X}^T\b...
abenzbiria/clients_odoo
refs/heads/master
openerp/workflow/instance.py
314
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
stevielu/viewfinder
refs/heads/master
marketing/tornado/stack_context_new.py
58
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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 a...
HMSBeagle1831/rapidscience
refs/heads/master
rlp/bibliography/views.py
1
from datetime import datetime from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from django.contrib import messages from django.db import transaction from django.http import JsonResponse from django.shortcuts import get_object_or_404, redirect, render ...
kevindierkx/oauth2-server-manager
refs/heads/master
node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
lsj1292/Abacus
refs/heads/master
biohub/core/plugins/urls.py
4
from biohub.core.routes import register_api, register_default, url # noqa # Place your route definition here.
jcrugzz/lpvisualization
refs/heads/master
django/core/servers/basehttp.py
153
""" BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21). Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/ This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. Don't use it for production use. """ from BaseHTTPSe...
ds-hwang/chromium-crosswalk
refs/heads/master
native_client_sdk/src/build_tools/tests/verify_filelist_test.py
132
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_TOOLS_DIR = os.path.dirname(SCR...
jayme-github/headphones
refs/heads/master
lib/apscheduler/schedulers/asyncio.py
33
from __future__ import absolute_import from functools import wraps from apscheduler.schedulers.base import BaseScheduler from apscheduler.util import maybe_ref try: import asyncio except ImportError: # pragma: nocover try: import trollius as asyncio except ImportError: raise ImportError('...
sauloal/cufflinksviewer
refs/heads/master
venvwin/Lib/site-packages/pip-1.2.1-py2.7.egg/pip/download.py
17
import cgi import getpass import hashlib import mimetypes import os import re import shutil import sys import tempfile from pip.backwardcompat import (xmlrpclib, urllib, urllib2, urlparse, string_types) from pip.exceptions import InstallationError from pip.util import (splitext, rmtree, ...
mmardini/django
refs/heads/master
django/http/utils.py
134
""" Functions that modify an HTTP request or response in some way. """ # This group of functions are run as part of the response handling, after # everything else, including all response middleware. Think of them as # "compulsory response middleware". Be careful about what goes here, because # it's a little fiddly to ...
ycl2045/nova-master
refs/heads/master
nova/virt/xenapi/network_utils.py
8
# Copyright (c) 2010 Citrix Systems, 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 ...
jctanner/ansibullbot
refs/heads/master
scripts/find_dead_issues.py
1
#!/usr/bin/env python import datetime import json import os import sys from ansibullbot.utils.receiver_client import get_receiver_metadata from ansibullbot.utils.receiver_client import get_receiver_summaries def main(): # define where to dump the resulting files if len(sys.argv) > 1: destdir = sys....
mdj2/django
refs/heads/master
tests/urlpatterns_reverse/erroneous_views_module.py
157
import non_existent def erroneous_view(request): pass
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/docutils/languages/zh_cn.py
148
# -*- coding: utf-8 -*- # $Id: zh_cn.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Pan Junyong <[email protected]> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two ...
msebire/intellij-community
refs/heads/master
python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_0/_pkg1_0_0_0/_pkg1_0_0_0_0/_mod1_0_0_0_0_4.py
30
name1_0_0_0_0_4_0 = None name1_0_0_0_0_4_1 = None name1_0_0_0_0_4_2 = None name1_0_0_0_0_4_3 = None name1_0_0_0_0_4_4 = None
houshengbo/nova_vmware_compute_driver
refs/heads/attach-detach-VMware-iSCSI-driver
nova/openstack/common/gettextutils.py
16
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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/l...
beckett1124/Paddle
refs/heads/develop
python/paddle/utils/__init__.py
19
# Copyright (c) 2016 PaddlePaddle 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 applic...
ntt-nflex/nflex_connector_utils
refs/heads/master
nflex_connector_utils/saas_user.py
1
from . import Resource class SaasUser(Resource): """ A representation of an Saas User Args: base (base): See :py:class:`nflex_connector_utils.resource.Resource` for common resource args. user_id (str): Id of the Saas User avatar_url (str): Avatal URL of the use...
stainsteelcrown/nonsense-story-generator
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
1093
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
starrify/scrapy
refs/heads/master
scrapy/core/__init__.py
216
""" Scrapy core library classes and functions. """
itkovian/sqlalchemy
refs/heads/master
examples/graphs/__init__.py
30
"""An example of persistence for a directed graph structure. The graph is stored as a collection of edges, each referencing both a "lower" and an "upper" node in a table of nodes. Basic persistence and querying for lower- and upper- neighbors are illustrated:: n2 = Node(2) n5 = Node(5) n2.add_neighbor(n...
mushtaqak/edx-platform
refs/heads/master
lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py
194
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'StudentModule.course_id' db.add_column('courseware_studentmodule', 'course_id', ...
Anik1199/Kernel_taoshan
refs/heads/cm-12.1
scripts/build-all.py
1182
#! /usr/bin/env python # Copyright (c) 2009-2011, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
idovear/odoo
refs/heads/master
addons/account/wizard/account_subscription_generate.py
347
# -*- 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...
google/filament
refs/heads/main
third_party/libgtest/googletest/test/gtest_test_utils.py
64
# Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
jorgemarsal/DistributedR
refs/heads/master
platform/worker/scripts/generate_diagrams.py
3
import re import pdb import textwrap import sys from parse_request_trace import * class JsSequenceDiagramGenerator: def __init__(self): self.master_ts_template = 'Note left of MASTER: %s\n' self.worker_ts_template = 'Note right of WORKER: %s\n' self.worker_template = 'MASTER->WORKER: "%s"\...
thoughtpalette/thoughts.thoughtpalette.com
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/foxpro.py
335
# -*- coding: utf-8 -*- """ pygments.lexers.foxpro ~~~~~~~~~~~~~~~~~~~~~~ Simple lexer for Microsoft Visual FoxPro source code. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer from pygm...
kanagasabapathi/python-for-android
refs/heads/master
python-modules/twisted/twisted/internet/test/test_address.py
56
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. import re from twisted.trial import unittest from twisted.internet.address import IPv4Address, UNIXAddress class AddressTestCaseMixin(object): def test_addressComparison(self): """ Test that two different address in...
eleonrk/SickRage
refs/heads/master
sickchill/show/recommendations/recommended.py
2
# coding=utf-8 # # URL: https://sickchill.github.io # # This file is part of SickChill. # # SickChill 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 option) any ...
pdellaert/ansible
refs/heads/devel
test/integration/targets/module_utils/library/test_env_override.py
170
#!/usr/bin/python # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.json_utils import data from ansible.module_utils.mork import data as mork_data results = {"j...
wnesl/gnuradio-IA
refs/heads/master
gnuradio-core/src/examples/pfb/synth_filter.py
17
#!/usr/bin/env python # # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
antin/Open-Knesset
refs/heads/master
committees/migrations/0010_auto__add_field_committee_description.py
14
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Committee.description' db.add_column('committees_committee', 'description', self.gf('djang...
mistydemeo/gyp
refs/heads/master
test/copies/gyptest-default.py
264
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies file copies using the build tool default. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies.gyp', chdir='src'...
CUCWD/edx-platform
refs/heads/master
openedx/core/djangoapps/catalog/migrations/0001_initial.py
40
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
AkA84/edx-platform
refs/heads/master
cms/djangoapps/contentstore/tests/test_export_git.py
189
""" Test the ability to export courses to xml from studio """ import copy import os import shutil import subprocess from uuid import uuid4 from django.conf import settings from django.test.utils import override_settings from .utils import CourseTestCase import contentstore.git_export_utils as git_export_utils from x...
dyoung418/tensorflow
refs/heads/master
tensorflow/tools/ci_build/copy_binary.py
31
#!/usr/bin/python # 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 r...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/crafting/base/shared_base_repair.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/crafting/base/shared_base_repair.iff" result.attribute_template_id ...
tlksio/tlksio
refs/heads/develop
env/lib/python3.4/site-packages/pymongo/ismaster.py
19
# Copyright 2014-2015 MongoDB, 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 agreed to in writin...
DolphinDream/sverchok
refs/heads/master
node_scripts/SNLite_templates/utils/shape_key_bake.py
2
""" in verts v .=[] n=0 in edges s .=[] n=0 in pols s .=[] n=0 in active s .=0 n=2 in frame s .=1 n=2 """ import bpy import bmesh from mathutils import Vector #for remove extra brecket def okok(a): if a: return a[0] else: return [] verts = okok(verts) edge...
orangeYao/twiOpinion
refs/heads/master
testGui/readJson.py
1
import re import json import sys from pprint import pprint from random import randint from nltk import PorterStemmer from nltk import FreqDist from nltk.corpus import stopwords stop = stopwords.words('english') from guess_language import guessLanguage #in local from optparse import OptionParser parser = OptionParser(...
msegado/edx-platform
refs/heads/master
common/djangoapps/student/tests/test_reset_password.py
34
""" Test the various password reset flows """ import json import re import unittest from django.core.cache import cache from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import User from django.contrib.auth.hashers import UNU...
thomazs/geraldo
refs/heads/master
site/newsite/django_1_0/django/contrib/humanize/templatetags/humanize.py
40
from django.utils.translation import ungettext, ugettext as _ from django.utils.encoding import force_unicode from django import template from django.template import defaultfilters from datetime import date import re register = template.Library() def ordinal(value): """ Converts an integer to its ordinal as a...
julia2288-cmis/julia2288-cmis-cs2
refs/heads/master
conditionals.py
1
import random import math print "This is just like snakes and ladders. If you press enter, computer will roll the dice. You have to go forward with the given number. There will be some traps in few steps. Good luck!" def steps(total): dice = raw_input("Click enter to roll the dice.") if dice == "": print n ...
Kiiv/CouchPotatoServer
refs/heads/develop
libs/tornado/web.py
13
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
etkirsch/legends-of-erukar
refs/heads/master
erukar/content/conditions/negative/Blinded.py
1
from erukar.system.engine import Condition class Blinded(Condition): IsTemporary = True Duration = 4 # In ticks, where a tick is 5 seconds Incapacitates = False Noun = 'Blindness' Participle = 'Blinding' Description = 'Reduces Acuity to Zero' def modify_acuity(self): retur...
ytanay/thinglang
refs/heads/master
thinglang/symbols/symbol_map.py
1
import collections from typing import List from thinglang.lexer.values.identifier import Identifier, GenericIdentifier from thinglang.symbols.merged_symbol import MergedSymbol from thinglang.symbols.symbol import Symbol from thinglang.utils import collection_utils class SymbolMap(object): """ Describes a sym...
mapzen/TileStache
refs/heads/integration-1
TileStache/Goodies/Providers/PostGeoJSON.py
11
""" Provider that returns GeoJSON data responses from PostGIS queries. Note: The built-in TileStache Vector provider (new in version 1.9.0) offers a more complete method of generating vector tiles, and supports many kinds of data sources not avilable in PostGeoJSON such as shapefiles. PostGeoJSON will continue to be ...
takahashiminoru/ryu
refs/heads/master
ryu/services/protocols/bgp/rtconf/vrfs.py
4
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
marcore/edx-platform
refs/heads/master
openedx/core/djangoapps/credit/tests/test_verification_access.py
14
""" Tests for in-course reverification user partition creation. This should really belong to the verify_student app, but we can't move it there because it's in the LMS and we're currently applying these rules on publish from Studio. In the future, this functionality should be a course transformation defined in the ve...
PythonCharmers/bokeh
refs/heads/master
examples/charts/file/blaze_input.py
37
from os.path import dirname, join from blaze import Data from bokeh.sampledata import iris from bokeh.charts import Line, show, output_file bbvalues = Data(join(dirname(iris.__file__), 'iris.csv')) columns = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width'] result = bbvalues[columns] output_file("blaze_in...
vladimiroff/asuras
refs/heads/master
asuras/player.py
1
from vehicle.types.normal import NormalVehicle class Player: def __init__(self, items_layer, *sprite_groups): self.vehicle = NormalVehicle((320, 240), items_layer, *sprite_groups)
postlund/home-assistant
refs/heads/dev
tests/components/geonetnz_volcano/test_config_flow.py
7
"""Define tests for the GeoNet NZ Volcano config flow.""" from datetime import timedelta from homeassistant import data_entry_flow from homeassistant.components.geonetnz_volcano import config_flow from homeassistant.const import ( CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS, CONF_SCAN_INTERVAL, CONF...
viblo/pymunk
refs/heads/master
examples/newtons_cradle.py
1
"""A screensaver version of Newton's Cradle with an interactive mode. """ __docformat__ = "reStructuredText" import os import random import sys description = """ ---- Newton's Cradle ---- A screensaver version of Newton's Cradle with an interactive mode /s - Run in fullscreen screensaver mode /p #### - Display a pr...
yuanagain/seniorthesis
refs/heads/master
venv/lib/python2.7/site-packages/matplotlib/colors.py
4
""" A module for converting numbers or color arguments to *RGB* or *RGBA* *RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the range 0-1. This module includes functions and classes for color specification conversions, and for mapping numbers to colors in a 1-D array of colors called a colormap. Color...
stevenewey/django
refs/heads/master
tests/logging_tests/logconfig.py
609
import logging from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend class MyHandler(logging.Handler): def __init__(self): logging.Handler.__init__(self) self.config = settings.LOGGING class MyEmailBackend(BaseEmailBackend): def send_messages(self, ema...
rschnapka/odoo
refs/heads/7.0
addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py
56
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
apark263/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/clip_ops_test.py
8
# Copyright 2015 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...
evaunit01/Small-encryption-project
refs/heads/master
src/encrypt_project.py
1
import base64 def xor(x, y): return int(x,16)^int(y,16) def decrypt(data,key): ans="" for temp in [data[a:a+2] for a in range(0,len(data),2)]: ans=ans+str(hex(xor(temp,key)))[2:] return ans def encrypt(s): # encrypt hex_list = [hex(ord(x))[2:] for x in s] hex_state = '' for x in hex_list: he...
dexterx17/nodoSocket
refs/heads/master
clients/Python-2.7.6/Mac/Modules/fm/fmscan.py
34
# Scan an Apple header file, generating a Python file of generator calls. import sys from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner LONG = "Fonts" SHORT = "fm" def main(): input = "Fonts.h" output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + "....
pradeep-gr/mbed-os5-onsemi
refs/heads/master
tools/export/uvision/__init__.py
7
import os from os.path import sep, normpath, join, exists import ntpath import copy from collections import namedtuple import shutil from subprocess import Popen, PIPE import re from tools.arm_pack_manager import Cache from tools.targets import TARGET_MAP from tools.export.exporters import Exporter, apply_supported_wh...
ciaracdb/ACMusic
refs/heads/master
bot/players/YoutubePlayer.py
1
import asyncio from bot.players.Player import Player class YoutubePlayer(Player): def __init__(self, client): super().__init__(client) self.discordPlayer = None async def startQueue(self): await self.next() def songFinished(self): coroutine = self.next() future =...
shaistaansari/django
refs/heads/master
tests/indexes/tests.py
321
from unittest import skipUnless from django.db import connection from django.test import TestCase from .models import Article, ArticleTranslation, IndexTogetherSingleList class SchemaIndexesTests(TestCase): """ Test index handling by the db.backends.schema infrastructure. """ def test_index_name_ha...
ernstp/kivy
refs/heads/master
kivy/uix/abstractview.py
44
''' Abstract View ============= .. versionadded:: 1.5 .. warning:: This code is still experimental, and its API is subject to change in a future version. The :class:`~kivy.uix.abstractview.AbstractView` widget has an adapter property for an adapter that mediates to data. The adapter manages an item_view_ins...
CloudBrewery/duplicity-swiftkeys
refs/heads/master
duplicity/backends/megabackend.py
3
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2011 Carlos Abalde <[email protected]> # for gdocsbackend.py on which megabackend.py is based on # # Copyright 2013 Christian Kornacker <[email protected]> # # This file is part of duplicity. # # Duplicity is free software; you can...
coderbone/SickRage-alt
refs/heads/master
lib/requests_oauthlib/oauth1_auth.py
49
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from oauthlib.common import extract_params from oauthlib.oauth1 import Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER from oauthlib.oauth1 import SIGNATURE_TYPE_BODY from requests.compat import is_py3 from requests.utils import to_nati...
riadnassiffe/Simulator
refs/heads/master
src/tools/ecos/cvxpy/examples/extensions/mixed_integer/noncvx_variable.py
12
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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 option) any later version. CVXPY is distributed i...
yonglehou/scikit-learn
refs/heads/master
sklearn/manifold/setup.py
198
import os import numpy from numpy.distutils.misc_util import Configuration def configuration(parent_package="", top_path=None): config = Configuration("manifold", parent_package, top_path) libraries = [] if os.name == 'posix': libraries.append('m') config.add_extension("_utils", ...
kseistrup/qtile
refs/heads/develop
libqtile/widget/sep.py
11
# Copyright (c) 2010 Aldo Cortesi # Copyright (c) 2011 Mounier Florian # Copyright (c) 2012, 2015 Tycho Andersen # Copyright (c) 2012 Craig Barnes # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 Sean Vig # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associ...
Wingless-Archangel/CustomCommand
refs/heads/master
Python Practice/learn_django/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
514
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from nt...
lidavidm/sympy
refs/heads/master
sympy/functions/special/tensor_functions.py
4
from __future__ import print_function, division from sympy.core.function import Function, C from sympy.core import S, Integer from sympy.core.mul import prod from sympy.utilities.iterables import (has_dups, default_sort_key) from sympy.core.compatibility import xrange #################################################...
dzipet/controlling-board
refs/heads/master
SaberTooth/src/pycomms.py
2
#!/usr/bin/python # Python Standard Library Imports import smbus # External Imports pass # Custom Imports pass # =========================================================================== # PyComms I2C Base Class (an rewriten Adafruit_I2C pythone class clone) # =====================================================...