repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
petabyte/bedrock | refs/heads/master | bedrock/styleguide/models.py | 140 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Create your models here.
|
sjohannes/exaile | refs/heads/gdbus | xlgui/preferences/widgets.py | 2 | # Copyright (C) 2008-2010 Adam Olsen
#
# 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 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
omor1/linux-430 | refs/heads/master | scripts/checkkconfigsymbols.py | 88 | #!/usr/bin/env python2
"""Find Kconfig symbols that are referenced but not defined."""
# (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com>
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
#
# Licensed under the terms of the GNU GPL License version 2
import difflib
import os
import re
import signal
i... |
AmandaCMS/amanda-cms | refs/heads/master | amanda/search/forms.py | 1 | from django import forms
from django.utils.translation import ugettext_lazy as _
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import StrictButton
class SearchForm(forms.Form):
q = forms.CharField(label=_('Search query...'), required=False)
@pr... |
cherub0526/codecombat | refs/heads/master | scripts/analytics/parseMixpanelPayments.py | 97 | # Parse subscription conversion rates via Mixpanel raw export API
import sys
from datetime import tzinfo, timedelta, datetime
from mixpanel import Mixpanel
try:
import json
except ImportError:
import simplejson as json
# NOTE: mixpanel dates are by day and inclusive
# E.g. '2014-12-08' is any date that day,... |
cznweb/arkos | refs/heads/master | arkos/utilities/utils.py | 2 | """
Associated utility functions used in arkOS.
arkOS Core
(c) 2016 CitizenWeb
Written by Jacob Cook
Licensed under GPLv3, see LICENSE.md
"""
import bz2
import base64
import gzip
import os
import random
import requests
import semantic_version
import shlex
import socket
import string
import subprocess
import tarfile
i... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/quest/rebel/rtp_hansolo_rebel_banner.py | 85615 | import sys
def setup(core, object):
return |
S-Bahrasemani/hhana | refs/heads/master | mva/categories/mva.py | 4 | from math import pi
from rootpy.tree import Cut
from .common import (
Category_Preselection,
Category_Preselection_DEta_Control,
CUTS_VBF, CUTS_VBF_CR,
CUTS_BOOSTED, CUTS_BOOSTED_CR,
DETA_TAUS)
from .truth import CUTS_TRUE_VBF, CUTS_TRUE_BOOSTED
from .features import features_vbf, features_boosted
... |
OXPHOS/shogun | refs/heads/develop | examples/undocumented/python/classifier_svmsgd.py | 5 | #!/usr/bin/env python
traindat = '../data/fm_train_real.dat'
testdat = '../data/fm_test_real.dat'
label_traindat = '../data/label_train_twoclass.dat'
parameter_list = [[traindat,testdat,label_traindat,0.9,1,6],[traindat,testdat,label_traindat,0.8,1,5]]
def classifier_svmsgd (train_fname=traindat,test_fname=testdat,la... |
Moriadry/tensorflow | refs/heads/master | tensorflow/contrib/factorization/python/ops/gmm_test.py | 41 | # 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... |
volpino/Yeps-EURAC | refs/heads/master | lib/galaxy/util/sanitize_html.py | 1 | """
HTML Sanitizer (ripped from feedparser)
"""
import re, sgmllib
# reversable htmlentitydefs mappings for Python 2.2
try:
from htmlentitydefs import name2codepoint, codepoint2name
except:
import htmlentitydefs
name2codepoint={}
codepoint2name={}
for (name,codepoint) in htmlentitydefs.entitydefs.... |
mpdehaan/ansible | refs/heads/devel | test/integration/cleanup_gce.py | 131 | '''
Find and delete GCE resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete your *ENTIRE* GCE infrastructure.
'''
import os
import re
import sys
import optparse
import yaml
try:
from libclo... |
ulif/pulp | refs/heads/master | server/pulp/server/db/model/repository.py | 6 | from gettext import gettext as _
import traceback as traceback_module
from pulp.server.db.model.base import Model
from pulp.server.db.model.reaper_base import ReaperMixin
import pulp.common.dateutils as dateutils
class RepoContentUnit(Model):
"""
Each instance represents a mapping between a content unit and ... |
lightbase/LBIndex | refs/heads/master | lbiapi/model/context/command.py | 2 | # -*- coding: utf-8 -*-
import subprocess
from ..lbindex import LbIndex
from ...lib.httpcode import HTTPCode
from ...lib.exception import HTTPServiceException
class CommandFactory():
"""Tratar o factory referente aos comandos.
Args:
request (pyramid.request.Request): Request gerado pelo pacote
... |
Shyam10/kivy | refs/heads/master | kivy/uix/widget.py | 8 | '''
Widget class
============
The :class:`Widget` class is the base class required for creating Widgets.
This widget class was designed with a couple of principles in mind:
* *Event Driven*
Widget interaction is built on top of events that occur. If a property
changes, the widget can respond to the change in the... |
tsuna/tcollector | refs/heads/master | collectors/etc/redis_stats_conf.py | 2 | #!/usr/bin/python
# This file is part of tcollector.
# Copyright (C) 2015 The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (a... |
n-west/gnuradio | refs/heads/maint | gr-audio/examples/python/dial_tone_wav.py | 58 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2008,2012,2013 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 ... |
dya2/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/json_tests/test_dump.py | 49 | from io import StringIO
from test.json_tests import PyTest, CTest
class TestDump:
def test_dump(self):
sio = StringIO()
self.json.dump({}, sio)
self.assertEqual(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEqual(self.dumps({}), '{}')
def test_encode_truefalse(se... |
ghl3/spark-testing-base | refs/heads/master | python/sparktestingbase/test/reuse_spark_context_test.py | 10 | #
# 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 us... |
humw/algorithms_in_python | refs/heads/master | quick_sort/quick_sort.py | 1 | __author__ = 'humw'
def partition(array, first_index, last_index):
pivot = array[last_index]
slot = first_index
for n in range(first_index, last_index):
if array[n] <= pivot:
temp = array[slot]
array[slot] = array[n]
array[n] = temp
slot += 1
arr... |
gnu-sandhi/gnuradio | refs/heads/master | gnuradio-core/src/python/build_utils.py | 252 | #
# Copyright 2004,2009,2012 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)
# any later ve... |
kkkarthik6/Lol | refs/heads/master | build/lib.linux-x86_64-2.7/opensfm/features.py | 2 | # -*- coding: utf-8 -*-
import os, sys
import tempfile
import time
import logging
from subprocess import call
import numpy as np
import json
import uuid
import cv2
import csfm
from opensfm import context
logger = logging.getLogger(__name__)
def resized_image(image, config):
feature_process_size = config.get('... |
uberamd/NGECore2 | refs/heads/master | scripts/object/building/kashyyyk/rock_kashyyyk_large_s03.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/lair/base/objective_mts_clan_monolith.py | 85615 | import sys
def setup(core, object):
return |
scigghia/account-payment | refs/heads/8.0 | __unported__/account_payment_extension/res_partner.py | 14 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
# All Rights Reserved.Jordi Esteve <jesteve@zikzakmedia.com>
# AvanzOSC, Avanzed Open So... |
engaugusto/google-diff-match-patch | refs/heads/master | python3/__init__.py | 636 | from .diff_match_patch import diff_match_patch, patch_obj
|
Lujeni/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_ips_custom.py | 13 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
dlazz/ansible | refs/heads/devel | test/units/modules/system/test_linux_mountinfo.py | 68 | import os
import tempfile
from units.compat import unittest
from ansible.module_utils._text import to_bytes
from ansible.modules.system.mount import get_linux_mounts
class LinuxMountsTestCase(unittest.TestCase):
def _create_file(self, content):
tmp_file = tempfile.NamedTemporaryFile(prefix='ansible-tes... |
smogpill/dataspace | refs/heads/master | src/reflect/decl/class_.py | 1 | # Copyright (C) 2010-2013 Jounayd Id Salah https://github.com/smogpill/dataspace. This file is part of the Dataspace project.
# Dataspace 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... |
slevenhagen/odoo | refs/heads/8.0 | addons/report_webkit/__openerp__.py | 247 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... |
sunlightlabs/clearspending | refs/heads/master | search_sites.py | 1 |
import haystack
haystack.autodiscover()
|
kchodorow/tensorflow | refs/heads/master | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_util_test.py | 23 | # 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... |
kustomzone/Rusthon | refs/heads/master | regtests/list/range.py | 6 | """range"""
def main():
a = range(10)
TestError( len(a)==10 )
TestError( a[0] == 0 )
TestError( a[9] == 9 )
b = range(1,10)
TestError( len(b)==9 )
TestError( b[0] == 1 )
TestError( b[8] == 9 )
|
gangadhar-kadam/laganerp | refs/heads/master | erpnext/hr/doctype/expense_claim/test_expense_claim.py | 35 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Expense Claim')
class TestExpenseClaim(unittest.TestCase):
pass
|
eco32i/ggplot | refs/heads/master | ggplot/components/shapes.py | 1 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import six
SHAPES = [
'o',#circle
'^',#triangle up
'D',#diamond
'v',#triangle down
'+',#plus
'x',#x
's',#square
'*',#star
'p',#pentagon
'*'#octagon
]
... |
danielharbor/openerp | refs/heads/master | build/lib/openerp/addons/test_documentation_examples/extension.py | 366 | # -*- coding: utf-8 -*-
from openerp import models, fields
class Extension0(models.Model):
_name = 'extension.0'
name = fields.Char(default="A")
class Extension1(models.Model):
_inherit = 'extension.0'
description = fields.Char(default="Extended")
|
avneesh91/django | refs/heads/master | django/utils/timezone.py | 22 | """
Timezone-related classes and functions.
"""
import functools
from contextlib import ContextDecorator
from datetime import datetime, timedelta, tzinfo
from threading import local
import pytz
from django.conf import settings
__all__ = [
'utc', 'get_fixed_timezone',
'get_default_timezone', 'get_default_tim... |
edx/ecommerce | refs/heads/master | ecommerce/tests/test_urls.py | 1 |
from django.urls import reverse
from ecommerce.core.url_utils import get_lms_dashboard_url
from ecommerce.tests.testcases import TestCase
class TestUrls(TestCase):
def test_api_docs(self):
"""
Verify that the API docs render.
"""
path = reverse('api_docs')
response = sel... |
0be1/ansible | refs/heads/devel | v2/ansible/plugins/action/__init__.py | 2 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
hackstock/gcmpy | refs/heads/master | gcmpy/gcm.py | 1 | __author__ = 'Edward Pie'
import requests
import json
class GcmServer(object):
def __init__(self,api_key):
self.api_key = api_key
self.headers = {"Authorization": "%s=%s" % ("key", self.api_key), "Content-Type": "application/json"}
self.url = "https://android.googleapis.com/gcm/send"
... |
mattrhummel/GermannaCC-WPTheme | refs/heads/master | node_modules/pangyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... |
bdang2012/taiga-back | refs/heads/master | taiga/base/response.py | 18 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
Russell-IO/ansible | refs/heads/devel | lib/ansible/module_utils/facts/system/dns.py | 232 | # This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed in the hope that ... |
dhp-denero/LibrERP | refs/heads/master | dt_letter_mgmt/letter_mgmt.py | 2 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Parthiv Pate, Tech Receptives, Open Source For Ideas
# Copyright (C) 2009-Today Tech Receptives(http://techreceptives.com).
# All Rights Reserved
#
#
# This program is free software: you can ... |
midgetspy/Sick-Beard | refs/heads/development | lib/hachoir_parser/container/action_script.py | 90 | """
SWF (Macromedia/Adobe Flash) file parser.
Documentation:
- Alexis' SWF Reference:
http://www.m2osw.com/swf_alexref.html
Author: Sebastien Ponce
Creation date: 26 April 2008
"""
from lib.hachoir_core.field import (FieldSet, ParserError,
Bit, Bits, UInt8, UInt32, Int16, UInt16, Float32, CString,
RawBy... |
HomeRad/TorCleaner | refs/heads/master | wc/dns/flags.py | 1 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
... |
carpedm20/all-about-critics | refs/heads/master | notebook/models.py | 1 | from difflib import SequenceMatcher as sm
def is_same_name(a,b):
for (x,y) in [(a,b),(b,a)]:
for word in x.split():
if word in y:
return True
if sm(a=list(set(b)), b=list(set(a))).ratio() > 0.7:
return True
return False
class Critic(object):
def __init__(sel... |
xbash/LabUNAB | refs/heads/master | 05_archivos/12_BuscarNombre.py | 1 | nombres = {}
file = open('12_BuscarNombre.txt', 'r')
for x in file:
palabra = x.partition(" ")
nombres[palabra[0]] = palabra[2]
file.close()
for i in range(1,10):
nombre=input("Ingrese un nombre a buscar y se retorna su apellido: ")
print(nombres[nombre]) |
litecoin-project/litecoin | refs/heads/master | contrib/devtools/clang-format-diff.py | 18 | #!/usr/bin/env python3
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License.
#
# ==========================================================... |
sandeepdsouza93/TensorFlow-15712 | refs/heads/master | tensorflow/contrib/tensor_forest/hybrid/python/models/__init__.py | 183 | # 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... |
PXke/invenio | refs/heads/dev-pu | invenio/modules/ranker/registry.py | 4 | # -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio 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 2 of the
## License, or (at your opti... |
OmeGak/indico | refs/heads/master | indico/modules/rb/models/room_attributes.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from sqlalchemy.dialects.postgresql import JSONB
from indico.core.db import db
from indico.util.string im... |
bottompawn/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/cp866.py | 272 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
zdary/intellij-community | refs/heads/master | python/testData/resolve/TypeDunderClass.py | 35 | class A:
pass
print(A.__class__)
# <ref> |
radremedy/radremedy | refs/heads/master | remedy/rad/migrations/versions/391a19c44a98_category_keywords_field.py | 3 | """Adding a field to track category keywords
Revision ID: 391a19c44a98
Revises: 2c5bd010030f
Create Date: 2015-04-04 23:32:06.075000
"""
# revision identifiers, used by Alembic.
revision = '391a19c44a98'
down_revision = '2c5bd010030f'
from alembic import op
import sqlalchemy as sa
... |
maohongyuan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_http_cookiejar.py | 84 | """Tests for http/cookiejar.py."""
import os
import re
import test.support
import time
import unittest
import urllib.request
from http.cookiejar import (time2isoz, http2time, iso2time, time2netscape,
parse_ns_headers, join_header_words, split_header_words, Cookie,
CookieJar, DefaultCookiePolicy, LWPCookieJa... |
JizhouZhang/SDR | refs/heads/master | gr-wxgui/grc/__init__.py | 92 | # Copyright 2008, 2009 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)
# any later version.... |
blademainer/intellij-community | refs/heads/master | python/testData/debug/test_pyqt3.py | 79 | from PyQt5 import QtCore
import sys
class Runnable(QtCore.QRunnable):
def run(self):
app = QtCore.QCoreApplication.instance()
for i in range(3):
print("ping %d" % i)
app.quit()
app = QtCore.QCoreApplication([])
runnable = Runnable()
QtCore.QThreadPool.globalInstance().start(... |
AFFogarty/SEP-Bot | refs/heads/master | public/sep_search/models/article.py | 1 | from django.db import models
class Article(models.Model):
class Meta:
app_label = "sep_search"
# The title of the article
title = models.CharField(max_length=255, blank=True, null=True)
url = models.URLField()
# Summary from top of page
summary = models.TextField(blank=True, null=True)
... |
jk9898/VOS | refs/heads/master | VOS.py | 1 | ## VOS ##
#-------------------------------------------------------------------------------#
# Name: Exodus VOS #
# Purpose: Provide a sleek interface using Tkinter #
# ... |
nhippenmeyer/django | refs/heads/master | django/views/decorators/clickjacking.py | 145 | from functools import wraps
from django.utils.decorators import available_attrs
def xframe_options_deny(view_func):
"""
Modifies a view function so its response has the X-Frame-Options HTTP
header set to 'DENY' as long as the response doesn't already have that
header set.
e.g.
@xframe_optio... |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/r-bsgenome-hsapiens-ucsc-hg19/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBsgenomeHsapiensUcscHg19(RPackage):
"""Full genome sequences for Homo sapiens (Human) as ... |
eliquious/go-v8 | refs/heads/master | v8-3.28/build/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py | 260 | #!/usr/bin/env python
# Copyright (c) 2013 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 inclusion of $HOME/.gyp/include.gypi works when --config-dir is
specified.
"""
import os
import TestGyp
test = TestGyp.TestGy... |
wfxiang08/django185 | refs/heads/master | tests/test_discovery_sample/doctests.py | 471 | """
Doctest example from the official Python documentation.
https://docs.python.org/3/library/doctest.html
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30) # doctest: +ELLIPSIS
2652528598121910... |
jbarbuto/raven-python | refs/heads/master | tests/transport/tests.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from raven.utils.testutils import TestCase
from raven.base import Client
# Some internal stuff to extend the transport layer
from raven.transport import Transport
# Simplify comparing dicts with primitive values:
from raven.utils import json
import dat... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/refactoring/move/importAs/after/src/b.py | 83 | import lib1 as iks
def f(x):
return iks.I(x) |
abhimanyudogra/TARS | refs/heads/master | client/csocket/client_socket.py | 1 | __author__ = "Niharika Dutta and Abhimanyu Dogra"
import socket
import select
import sys
from client.utility.client_constants import *
class ClientSocket:
"""
Manages the client side socket network and sending/receiving of messages through it.
"""
def __init__(self, config):
self.counter = ... |
AbelHu/azure-quickstart-templates | refs/heads/abelhu | ansible-advancedlinux/GetSSHFromPrivateStorageAccount.py | 231 | #!/usr/bin/python
import sys,os
print ("Getting %s file from Storage Account Name: %s to %s" % (str(sys.argv[3]), str(sys.argv[1]), os.path.join(os.getcwd(),str(sys.argv[3]))))
from azure.storage.blob import BlockBlobService
blob_service = BlockBlobService(account_name=str(sys.argv[1]), account_key=str(sys.argv[2])... |
UniversalMasterEgg8679/ansible | refs/heads/devel | lib/ansible/modules/system/selinux.py | 56 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Derek Carter<goozbach@friocorte.com>
#
# This file is part of Ansible
#
# Ansible 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 ... |
ortylp/scipy | refs/heads/master | scipy/linalg/flinalg.py | 138 | #
# Author: Pearu Peterson, March 2002
#
from __future__ import division, print_function, absolute_import
__all__ = ['get_flinalg_funcs']
# The following ensures that possibly missing flavor (C or Fortran) is
# replaced with the available one. If none is available, exception
# is raised at the first attempt to use t... |
rense/django-sirtrevor | refs/heads/master | sirtrevor/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
cirrusone/phantom2 | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/builders.py | 118 | # Copyright (C) 2011 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 ... |
TheProjecter/spitfire | refs/heads/master | spitfire/compiler/parser.py | 8 | # This parser can parse a simple subset of Cheetah's syntax.
from spitfire.compiler.ast import *
from string import *
import re
from yappsrt import *
class _SpitfireParserScanner(Scanner):
patterns = [
("'[ \\t]*\\+[ \\t]*'", re.compile('[ \t]*\\+[ \t]*')),
("'[ \\t]*\\%[ \\t]*'", re.compile('[ ... |
raccoongang/edx-platform | refs/heads/ginkgo-rg | lms/djangoapps/course_blocks/transformers/start_date.py | 23 | """
Start Date Transformer implementation.
"""
from lms.djangoapps.courseware.access_utils import check_start_date
from openedx.core.djangoapps.content.block_structure.transformer import (
BlockStructureTransformer,
FilteringTransformerMixin
)
from xmodule.course_metadata_utils import DEFAULT_START_DATE
from .... |
msiebuhr/v8.go | refs/heads/master | v8/build/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py | 260 | #!/usr/bin/env python
# Copyright (c) 2013 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 inclusion of $HOME/.gyp/include.gypi works when --config-dir is
specified.
"""
import os
import TestGyp
test = TestGyp.TestGy... |
gotostack/iSwift | refs/heads/master | iswift/hooks.py | 1 | # 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 writing, software
# distributed under t... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/mobile/shared_dressed_tatooine_dim_u_priestess.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 = Creature()
result.template = "object/mobile/shared_dressed_tatooine_dim_u_priestess.iff"
result.attribute_templat... |
saurabh6790/medsynaptic-app | refs/heads/develop | stock/doctype/item_price/test_item_price.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import webnotes
class TestItem(unittest.TestCase):
def test_duplicate_item(self):
from stock.doctype.item_price.item_price import... |
CUCWD/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/migrations/0005_move_target_data.py | 49 | # -*- coding: utf-
from __future__ import unicode_literals
from django.db import migrations, models
from django.db.utils import DatabaseError
from bulk_email.models import EMAIL_TARGETS, SEND_TO_MYSELF
def to_option_to_targets(apps, schema_editor):
CourseEmail = apps.get_model("bulk_email", "CourseEmail")
Tar... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/jupyter_core/version.py | 7 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
version_info = (4, 3, 0)
__version__ = '.'.join(map(str, version_info))
|
khaleeque-ansari/Virtual-Cryptography-Project | refs/heads/master | lib/werkzeug/debug/console.py | 314 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.loca... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/ship/attachment/engine/vwing_engine_02.py | 85615 | import sys
def setup(core, object):
return |
codelieche/webpts | refs/heads/master | projects/webptspy/apps/tresult/__init__.py | 1 | default_app_config = "tresult.apps.TresultConfig"
|
rishilification/phantomjs | refs/heads/master | src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/upload.py | 2511 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
openstack/mistral | refs/heads/master | mistral/api/controllers/v2/workflow.py | 1 | # Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
# Copyright 2015 Huawei Technologies Co., Ltd.
#
# 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:/... |
codefordurham/food-inspector | refs/heads/develop | inspections/migrations/0003_auto_20161014_1809.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inspections', '0002_establishment_image_url'),
]
operations = [
migrations.AddField(
model_name='violation',
... |
domenicosolazzo/Human | refs/heads/master | human/core/api/sources/datasources.py | 1 | import os
import json
class DataSource(object):
def __init__(self):
pass
@staticmethod
def get_instance():
data_source_type = os.environ.get('HUMAN_DATA_SOURCE_TYPE', "JSON")
if data_source_type == "JSON":
return JSONSource()
else:
raise Exception("Da... |
MyAOSP/external_chromium_org | refs/heads/kk-4.4 | tools/json_schema_compiler/code.py | 82 | # Copyright (c) 2012 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.
class Code(object):
"""A convenience object for constructing code.
Logically each object should be a block of code. All methods except |Render|
an... |
GNOME/caribou | refs/heads/master | caribou/antler/main.py | 1 | import gi
gi.require_version('Caribou', '1.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Caribou, GLib, GObject, Gtk
from .window import AntlerWindowEntry
from .keyboard_view import AntlerKeyboardView
import sys
class AntlerKeyboardCommand(object):
def run(self):
pass
class AntlerKeyboard... |
marcoserafini/h-store | refs/heads/master | third_party/python/boto/cloudfront/exception.py | 221 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
xeddmc/PyBitmessage | refs/heads/master | src/bitmessageqt/newsubscriptiondialog.py | 13 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'newsubscriptiondialog.ui'
#
# Created: Sat Nov 30 21:53:38 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8... |
larsks/cloud-init-patches | refs/heads/lpc-rhel-7-patches | cloudinit/config/cc_package_update_upgrade_install.py | 16 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/ship/attachment/weapon/xwing_weapon1_pos_s01_1.py | 85615 | import sys
def setup(core, object):
return |
xindus40223115/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/xml/dom/domreg.py | 841 | """Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
# This is a list of well-known implementations. Well-known names
# should be published by posting to xml-sig@python.org, and are
# ... |
aidan-/ansible-modules-extras | refs/heads/devel | cloud/cloudstack/cs_affinitygroup.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible 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 Lice... |
PARINetwork/pari | refs/heads/master | album/migrations/0003_auto_20160627_1235.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('author', '0003_auto_20160619_1946'),
('album', '0002_auto_20150731_0952'),
]
operations = [
... |
realms-team/basestation-fw | refs/heads/master | libs/smartmeshsdk-REL-1.3.0.1/libs/VManagerSDK/vmanager/models/mote_state_type.py | 3 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... |
CiscoSystems/nova | refs/heads/master | nova/api/openstack/compute/contrib/extended_hypervisors.py | 100 | # Copyright 2014 IBM Corp.
#
# 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 t... |
Comunitea/OCB | refs/heads/8.0 | openerp/service/__init__.py | 380 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you c... |
audaciouscode/SMSBot | refs/heads/master | smsbot_twisted/backend/__init__.py | 14337 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.