repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mat12/mytest | refs/heads/master | lib/python/Components/Sources/Boolean.py | 162 | from Source import Source
from Components.Element import cached
from enigma import eTimer
# a small warning:
# you can use that boolean well to express screen-private
# conditional expressions.
#
# however, if you think that there is ANY interest that another
# screen could use your expression, please put your calcula... |
sodafree/backend | refs/heads/master | build/ipython/build/lib.linux-i686-2.7/IPython/core/tests/test_compilerop.py | 3 | # coding: utf-8
"""Tests for the compilerop module.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file COPYING.txt, distributed with this sof... |
MattFaus/CrowdTube-Connector | refs/heads/master | lib/gdata-2.0.18/tests/gdata_tests/docs/live_client_test.py | 23 | #!/usr/bin/python
#
# Copyright 2011 Google 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 b... |
yosshy/nova | refs/heads/master | nova/tests/functional/api_sample_tests/test_limits.py | 16 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 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... |
UWFlow/rmc | refs/heads/master | data/evals/import_critiques.py | 8 | import rmc.shared.constants as c
import rmc.models as m
import rmc.data.evals.conversion as conv
import mongoengine as me
import sys
def import_all_critiques(eng_file):
m.CritiqueCourse.objects._collection.drop()
conv.import_engineering_critiques(eng_file)
if __name__ == '__main__':
if (len(sys.argv) < ... |
batpad/mezzanine | refs/heads/master | mezzanine/blog/templatetags/blog_tags.py | 9 | from __future__ import unicode_literals
from datetime import datetime
from django.db.models import Count, Q
from mezzanine.blog.forms import BlogPostForm
from mezzanine.blog.models import BlogPost, BlogCategory
from mezzanine.generic.models import Keyword
from mezzanine import template
from mezzanine.utils.models imp... |
darktears/chromium-crosswalk | refs/heads/master | chrome/common/extensions/docs/server2/appengine_main.py | 122 | #!/usr/bin/env python
# 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.
import os
import sys
# Add the original server location to sys.path so we are able to import
# modules from there.
SERVER_PATH = '... |
jeltz/rust-debian-package | refs/heads/master | src/llvm/utils/DSAextract.py | 124 | #! /usr/bin/python
#this is a script to extract given named nodes from a dot file, with
#the associated edges. An edge is kept iff for edge x -> y
# x and y are both nodes specified to be kept.
#known issues: if a line contains '->' and is not an edge line
#problems will occur. If node labels do not begin with
#Nod... |
pyjs/pyjs | refs/heads/master | examples/hangman/__main__.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'HangMan.py',
]
PACKAGE = {
'title': 'Hang man',
'desc': 'Guess the word or be hanged',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate ex... |
diagramsoftware/l10n-spain | refs/heads/8.0 | setup/l10n_es_aeat_mod130/setup.py | 7073 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
|
CasualGaming/studlan | refs/heads/master | apps/team/urls.py | 2 | # -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import accept_member_invite, create_team, decline_member_invite, disband_team, invite_member, kick_member, leave_team, my_teams, show_team, teams, uninvite_member
urlpatterns = [
url(r'^$', teams, name='teams'),
url(r'^mine/$', my_teams, n... |
sajeeshcs/nested_quota_final | refs/heads/master | nova/api/openstack/compute/contrib/used_limits_for_admin.py | 100 | # 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 ... |
jacky-young/crosswalk-test-suite | refs/heads/master | webapi/webapi-mediaserver-tizen-tests/inst.apk.py | 903 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... |
ravvav/aws-config-rules | refs/heads/master | python/vpc_flow_logs_enabled.py | 2 | #
# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)
#
# Ensure VPC Flow Logs is enabled.
# Description: Checks that VPC Flow Logs is enabled at specific VPC
#
# Trigger Type: Change Triggered
# Scope of Changes: EC2:VPC
# Required Resource Identifier: VPC I... |
Shaswat27/sympy | refs/heads/master | sympy/utilities/tests/test_lambdify.py | 11 | from sympy.utilities.pytest import XFAIL, raises
from sympy import (
symbols, lambdify, sqrt, sin, cos, tan, pi, acos, acosh, Rational,
Float, Matrix, Lambda, Piecewise, exp, Integral, oo, I, Abs, Function,
true, false, And, Or, Not, ITE)
from sympy.printing.lambdarepr import LambdaPrinter
import mpmath
fro... |
hassanabidpk/django | refs/heads/master | tests/servers/tests.py | 257 | # -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import contextlib
import os
import socket
from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase, override_settings
from django.utils._os import upath
from django.utils.... |
hynnet/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/host/lib/python2.7/compiler/symbols.py | 69 | """Module symbol-table generator"""
from compiler import ast
from compiler.consts import SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICT, \
SC_FREE, SC_CELL, SC_UNKNOWN
from compiler.misc import mangle
import types
import sys
MANGLE_LEN = 256
class Scope:
# XXX how much information do I need about each nam... |
mapr/hue | refs/heads/hue-3.9.0-mapr | desktop/core/ext-py/Django-1.6.10/tests/one_to_one_regress/tests.py | 107 | from __future__ import absolute_import
from django.test import TestCase
from .models import Place, Restaurant, Bar, Favorites, Target, UndergroundBar
class OneToOneRegressionTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
s... |
jayunit100/kubernetes | refs/heads/master | hack/boilerplate/test/pass.py | 766 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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... |
tianhao64/vsphere-automation-sdk-python | refs/heads/master | samples/vsphere/vcenter/setup/setup_cli.py | 2 | """
* *******************************************************
* Copyright (c) VMware, Inc. 2016. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER O... |
mutirri/bokeh | refs/heads/master | examples/glyphs/donut.py | 45 | from __future__ import print_function
import base64
from math import pi, sin, cos
from bokeh.browserlib import view
from bokeh.colors import skyblue, seagreen, tomato, orchid, firebrick, lightgray
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Wedge, AnnularWedge... |
mattsnowboard/msu-myhdlsim | refs/heads/master | MyHDLSim/test/demo_simple_module.py | 1 | import MyHDLSim.Manager
def Simple(manager, signalA, signalOut):
module = manager.CreateModule()
portA = module.AddPort(signalA, True, "A input")
portO = module.AddPort(signalOut, False, "OUTPUT")
module.AddNotGate((0,0), portO, portA)
return module
manager = MyHDLSim.Manager.Init()
a,... |
MingfeiPan/leetcode | refs/heads/master | string/434.py | 1 | class Solution:
def countSegments(self, s):
"""
:type s: str
:rtype: int
"""
return len(s.split())
|
jhjguxin/blogserver | refs/heads/master | lib/python2.7/site-packages/taggit/utils.py | 15 | from django.utils.encoding import force_unicode
from django.utils.functional import wraps
def parse_tags(tagstring):
"""
Parses tag input, with multiple word input being activated and
delineated by commas and double quotes. Quotes take precedence, so
they may contain commas.
Returns a sorted list... |
bashmak/djing | refs/heads/master | ip_pool/views.py | 2 | from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
from django.view... |
rherault-insa/numpy | refs/heads/master | numpy/testing/nosetester.py | 32 | """
Nose test running.
This module implements ``test()`` and ``bench()`` functions for NumPy modules.
"""
from __future__ import division, absolute_import, print_function
import os
import sys
import warnings
from numpy.compat import basestring
import numpy as np
def get_package_name(filepath):
"""
Given a ... |
ptchankue/youtube-dl | refs/heads/master | youtube_dl/extractor/canalplus.py | 77 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
HEADRequest,
unified_strdate,
url_basename,
qualities,
)
class CanalplusIE(InfoExtractor):
IE_DESC = 'canalplus.fr, piwiplus.fr and d8.tv'
_VALID_UR... |
Hybrid-Cloud/cinder | refs/heads/master | cinder/tests/unit/cast_as_call.py | 55 | # Copyright 2013 Red Hat, 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 agre... |
StrellaGroup/erpnext | refs/heads/develop | erpnext/accounts/doctype/finance_book/test_finance_book.py | 17 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
import frappe
import unittest
class TestFinanceBook(unittest.TestCase):
def ... |
sankha93/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/bench/skip.py | 225 |
import pytest
SKIP = True
@pytest.mark.parametrize("x", xrange(5000))
def test_foo(x):
if SKIP:
pytest.skip("heh")
|
alan-unravel/bokeh | refs/heads/master | bokeh/models/widgets/tables.py | 33 | """ Various kinds of data table (data grid) widgets.
"""
from __future__ import absolute_import
from ...properties import Bool, Int, Float, String, Color, Instance, Enum, Auto, List, Either
from ...plot_object import PlotObject
from ...enums import FontStyle, TextAlign, DateFormat, RoundingFunction, NumeralLanguage
f... |
nekulin/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/win32gui_menu.py | 17 | # Demonstrates some advanced menu concepts using win32gui.
# This creates a taskbar icon which has some fancy menus (but note that
# selecting the menu items does nothing useful - see win32gui_taskbar.py
# for examples of this.
# NOTE: This is a work in progress. Todo:
# * The "Checked" menu items don't work correctl... |
beni55/leetcode-python | refs/heads/master | distinct_subsequences/solution.py | 7 | class Solution:
# @return an integer
def numDistinct(self, S, T):
if len(S) < len(T):
return 0
n = len(S)
m = len(T)
t = [0 for i in range(m + 1)]
t[0] = 1
for i in range(1, n + 1):
# j = m ... 1
for k in range(m):
... |
MatthewShao/mitmproxy | refs/heads/master | mitmproxy/contrib/kaitaistruct/jpeg.py | 10 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
import array
import struct
import zlib
from enum import Enum
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
if parse_version(ks_version)... |
jfelipefilho/test-manager | refs/heads/master | scheduler/scheduler.py | 1 | import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "manager.settings")
django.setup()
import queue
import time
from app.models import Run, Status
from executor import TestExecutor
from django.utils import timezone
STATUS = {
"waiting": 1,
"failed": 2,
"success": 3,
... |
pgleeson/TestArea | refs/heads/master | lib/jython/Lib/encodings/cp437.py | 593 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.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... |
ASCrookes/django | refs/heads/master | django/contrib/admindocs/__init__.py | 807 | default_app_config = 'django.contrib.admindocs.apps.AdminDocsConfig'
|
ujvl/ray-ng | refs/heads/master | rllib/tests/test_legacy.py | 2 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ray.rllib.agents.ppo import PPOAgent
from ray import tune
import ray
if __name__ == "__main__":
ray.init()
# Test legacy *Agent classes work (renamed to Trainer)
tune.run(
PPOAgent,
... |
dstruck/comet-paper-scripts | refs/heads/master | synth_recomb_comet/generate_recomb_near_full_length.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 5 12:17:38 2013
@author: Daniel Struck
generate recombined sequence to be tested by subtyping tools
"""
from Bio import SeqIO
from itertools import permutations
ref = "Ref.B.FR.83.HXB2_LAI_IIIB_BRU.K03455"
sequences = {}
with open("HIV1_REF_2010_genome_DNA_PURE.fasta... |
danhuss/faker | refs/heads/master | faker/providers/lorem/ru_RU/__init__.py | 1 | from .. import Provider as LoremProvider
class Provider(LoremProvider):
word_list = (
'войти', 'монета', 'вскинуть', 'желание', 'экзамен', 'налоговый',
'вытаскивать', 'приятель', 'вздрагивать', 'куча', 'порт', 'точно',
'заплакать', 'изба', 'правление', 'художественный', 'мучительно',
... |
bgris/ODL_bgris | refs/heads/master | lib/python3.5/site-packages/matplotlib/tri/triinterpolate.py | 10 | """
Interpolation inside triangular grids.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
from matplotlib.tri import Triangulation
from matplotlib.tri.trifinder import TriFinder
from matplotlib.tri.tritools impor... |
grap/OCB | refs/heads/7.0 | openerp/tools/view_validation.py | 64 | """ View validation code (using assertions, not the RNG schema). """
import logging
_logger = logging.getLogger(__name__)
def valid_page_in_book(arch):
"""A `page` node must be below a `book` node."""
return not arch.xpath('//page[not(ancestor::notebook)]')
def valid_field_in_graph(arch):
"""A `graph`... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/web/soap.py | 60 | # -*- test-case-name: twisted.web.test.test_soap -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
SOAP support for twisted.web.
Requires SOAPpy 0.10.1 or later.
Maintainer: Itamar Shtull-Trauring
Future plans:
SOAPContext support of some kind.
Pluggable method lookup policies.
"""
#... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Tools/Scripts/byteyears.py | 100 | #! /usr/bin/env python
# Print the product of age and size of each file, in suitable units.
#
# Usage: byteyears [ -a | -m | -c ] file ...
#
# Options -[amc] select atime, mtime (default) or ctime as age.
import sys, os, time
from stat import *
def main():
# Use lstat() to stat files if it exists, else stat()
... |
karan259/GrovePi | refs/heads/master | Software/Python/grove_electromagnet.py | 2 | #!/usr/bin/env python
#
# GrovePi Example for using the Grove Electromagnet (http://www.seeedstudio.com/wiki/Grove_-_Electromagnet)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? Ask o... |
nwchandler/ansible | refs/heads/devel | lib/ansible/modules/network/lenovo/cnos_bgp.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# 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
# ... |
gltn/stdm | refs/heads/master | stdm/third_party/FontTools/fontTools/ttLib/tables/S_I_N_G_.py | 1 | from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval
from . import DefaultTable
SINGFormat = """
> # big endian
tableVersionMajor: H
tableVersionMinor: H
glyphletVersion: H
permissions: h
mainGID: H
unitsPerEm: H
vertAdvance: h
vert... |
ericof/python-bitbucket | refs/heads/master | bitbucket/__init__.py | 1 |
VERSION = "0.1"
from api import *
|
idovear/odoo | refs/heads/master | addons/account/account.py | 24 | # -*- 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... |
Vauxoo/hr | refs/heads/8.0 | hr_contract_hourly_rate/models/hr_hourly_rate_class.py | 23 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... |
Liamraystanley/dropb.in | refs/heads/master | lib/jinja2/optimizer.py | 1401 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... |
espenfjo/smass | refs/heads/master | web/submit/urls.py | 1 | from django.conf.urls import patterns, url
urlpatterns = patterns("",
url(r"^$", "submit.views.submit"),
)
|
dgoedkoop/QGIS | refs/heads/master | python/plugins/processing/gui/MultipleFileInputDialog.py | 12 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MultipleExternalInputDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
(C) 2013 by CS Systemes d'informatio... |
hatwar/focal-erpnext | refs/heads/develop | erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py | 22 | # 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 frappe
from frappe.utils import cstr, flt
from frappe import _
from frappe.model.document import Document
class BOMReplaceTool(Document):
d... |
r3tard/BartusBot | refs/heads/master | lib/Crypto/SelfTest/Cipher/test_Blowfish.py | 119 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... |
aioue/ansible | refs/heads/devel | lib/ansible/plugins/callback/profile_roles.py | 37 | # (C) 2017, Tennis Smith, http://github.com/gamename
#
# This file 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.
#
# File is distribu... |
Dte-ba/suite-backend | refs/heads/master | escuelas/models/estado_de_paquete.py | 1 | # coding: utf-8
from django.db import models
class EstadoDePaquete(models.Model):
nombre = models.CharField(max_length=255)
def __unicode__(self):
return u"Estado: " + self.nombre
class Meta:
db_table = 'estadosDePaquete'
verbose_name_plural = 'estadosDePaquete'
class JSONAPI... |
astonshane/AdventOfCode | refs/heads/master | 2015/python/day12/chal23.py | 1 | import sys
import json
def countObj(obj):
if type(obj) is int:
return obj
elif type(obj) is list:
count = 0
for o in obj:
count += countObj(o)
return count
elif type(obj) is dict:
count = 0
for o in obj:
if type(obj[o]) is int:
... |
tgsmith61591/pyramid | refs/heads/master | doc/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pmdarima documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 3 15:16:29 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... |
py-geek/City-Air | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/geometry/regex.py | 313 | import re
# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure
# to prevent potentially malicious input from reaching the underlying C
# library. Not a substitute for good Web security programming practices.
hex_regex = re.compile(r'^[0-9A-F]+$', re.I)
wkt_regex = re.compile(r'^(SRID=(?P<srid... |
TRUFIL/erpnext | refs/heads/develop | erpnext/patches/v4_0/validate_v3_patch.py | 102 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
from frappe.modules.patch_handler import executed
last_v3_patch = 'patches.1401.fix_pos_outstanding'
if not executed(la... |
anitahitouch/mediadrop | refs/heads/master | mediacore/controllers/admin/storage.py | 14 | from mediadrop.controllers.admin.storage import *
|
rjeschmi/easybuild-framework | refs/heads/master | easybuild/toolchains/linalg/atlas.py | 9 | ##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
korzeniewskipl/python-mode | refs/heads/develop | pymode/libs3/rope/base/taskhandle.py | 88 | import warnings
from rope.base import exceptions
class TaskHandle(object):
def __init__(self, name='Task', interrupts=True):
"""Construct a TaskHandle
If `interrupts` is `False` the task won't be interrupted by
calling `TaskHandle.stop()`.
"""
self.name = name
s... |
weiawe/django | refs/heads/master | django/contrib/gis/geos/prototypes/coordseq.py | 103 | from ctypes import POINTER, c_double, c_int, c_uint
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
GEOSException, last_arg_byref,
)
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# ## Error-checking routines specific to c... |
labcodes/django | refs/heads/master | tests/modeladmin/models.py | 39 | from django.contrib.auth.models import User
from django.db import models
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateField()
class Meta:
ordering = ('name',)
def __str__(self):
return self.name
class Concert(... |
cfobel/sconspiracy | refs/heads/master | Python/racy/plugins/coloracy/colorconsole/posixconsole.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 ******
from base import BaseColorText
__all__ = ["Console", "ColorText"]
class Console(... |
jschuecker/nest-simulator | refs/heads/master | pynest/examples/evaluate_tsodyks2_synapse.py | 17 | # -*- coding: utf-8 -*-
#
# evaluate_tsodyks2_synapse.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 t... |
jasonzzz/ansible | refs/heads/devel | lib/ansible/plugins/lookup/redis_kv.py | 251 | # (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver... |
outshineamaze/imarkdown | refs/heads/master | markdown/serializers.py | 129 | # markdown/searializers.py
#
# Add x/html serialization to Elementree
# Taken from ElementTree 1.3 preview with slight modifications
#
# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# ------------------------------------------------------------... |
benlaurie/certificate-transparency | refs/heads/master | python/ct/crypto/verify_ecdsa.py | 23 | from ct.crypto import error
from ct.crypto import pem
from ct.crypto.asn1 import types
from ct.proto import client_pb2
import hashlib
import ecdsa
class _ECDSASignature(types.Sequence):
components = (
(types.Component("r", types.Integer)),
(types.Component("s", types.Integer))
)
class... |
followloda/PornGuys | refs/heads/master | FlaskServer/venv/Lib/site-packages/pip/compat/__init__.py | 342 | """Stuff that differs in different Python versions and platform
distributions."""
from __future__ import absolute_import, division
import os
import sys
from pip._vendor.six import text_type
try:
from logging.config import dictConfig as logging_dictConfig
except ImportError:
from pip.compat.dictconfig import ... |
DarkFenX/Phobos | refs/heads/master | writer/__init__.py | 2 | #===============================================================================
# Copyright (C) 2014-2019 Anton Vorobyov
#
# This file is part of Phobos.
#
# Phobos 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 ... |
mmalorni/server-tools | refs/heads/master | __unported__/cron_run_manually/__openerp__.py | 14 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A.
#
# This program is fr... |
tymofij/adofex | refs/heads/master | transifex/resources/formats/compilation/decorators.py | 1 | # -*- coding: utf-8 -*-
"""
Functors to decorate translations.
These functors are called whenever a translation is requested, when
compiling a template of a resource. An instance of a decorator is
passed to the compiler instance and the compiler will call it, whenever
it needs to use a translation string.
This allow... |
mrshu/iepy | refs/heads/develop | iepy/preprocess/tokenizer.py | 1 | # -*- coding: utf-8 -*-
import re
import nltk.data
from nltk.tokenize import RegexpTokenizer
from iepy.preprocess.pipeline import BasePreProcessStepRunner, PreProcessSteps
from iepy.utils import DIRS
class TokenizeSentencerRunner(BasePreProcessStepRunner):
"""Does Tokenization and segmentation togheter over IED... |
Gravecorp/Gap | refs/heads/master | packages/IronPython.StdLib.2.7.3/content/Lib/lib2to3/fixes/fix_dict.py | 326 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... |
invisiblek/python-for-android | refs/heads/master | python3-alpha/extra_modules/pyxmpp2/settings.py | 46 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... |
lukaszb/django-projector | refs/heads/master | projector/forms.py | 1 | import logging
from django import forms
from django.forms.models import modelformset_factory
from django.forms.models import BaseModelFormSet
from django.utils.translation import ugettext as _
from django.contrib import messages
from django.contrib.auth.models import User, Group
from django.contrib.formtools.wizard im... |
franky88/emperioanimesta | refs/heads/master | env/Lib/site-packages/easy_install.py | 1642 | """Run the EasyInstall command"""
if __name__ == '__main__':
from setuptools.command.easy_install import main
main()
|
DmitryTsybin/Study | refs/heads/master | Coursera/Using_Python_to_Access_Web_Data/Understanding_the_Request_Response_Cycle_Chapter_12/socket1.py | 1 | import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('www.pythonlearn.com', 80))
mysock.send('GET http://www.pythonlearn.com/code/intro-short.txt HTTP/1.0\n\n')
while True:
data = mysock.recv(512)
if ( len(data) < 1 ) :
break
print data;
mysock.close() |
aioworkers/aioworkers | refs/heads/master | tests/test_csv.py | 2 | import os
import tempfile
import pytest
@pytest.fixture
def csv_file():
with tempfile.NamedTemporaryFile(delete=False) as tmpfile1:
tmpfile1.write(b'name,uid\nx,3\nf,4')
tmpfile1.flush()
yield tmpfile1
os.unlink(tmpfile1.name)
@pytest.fixture
def config_yaml(csv_file):
return """
... |
keithlee/shakeAppPyDev | refs/heads/master | django/views/decorators/http.py | 151 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from django.utils.decorators import decorator_from_middleware, available_attrs
... |
jhawkesworth/ansible | refs/heads/devel | lib/ansible/modules/network/panos/_panos_lic.py | 41 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... |
davidzchen/tensorflow | refs/heads/master | tensorflow/compiler/tests/xla_device_test.py | 23 | # Copyright 2018 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... |
AlexCaranha/Wox | refs/heads/master | PythonHome/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py | 304 | from base64 import b64encode
from ..packages import six
ACCEPT_ENCODING = 'gzip,deflate'
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=None, proxy_basic_auth=None):
"""
Shortcuts for generating request headers.
:param keep_alive:
If ``True... |
joopert/home-assistant | refs/heads/dev | homeassistant/components/mqtt/fan.py | 5 | """Support for MQTT fans."""
import logging
import voluptuous as vol
from homeassistant.components import fan, mqtt
from homeassistant.components.fan import (
ATTR_SPEED,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassista... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/powerbiembedded/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_py3.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
sam-tsai/django | refs/heads/master | tests/utils_tests/test_functional.py | 273 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.utils import six
from django.utils.functional import cached_property, lazy, lazy_property
class FunctionalTestCase(unittest.TestCase):
def test_lazy(self):
t = lazy(lambda: tuple(range(3)), list, tuple)
... |
jejimenez/django | refs/heads/master | django/utils/http.py | 285 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... |
tarasfrompir/majordomo | refs/heads/master | lib/python/general.py | 2 | # -*- coding: utf-8 -*-
from mjd_constants import *
try:
import urllib.request as urllib2
from urllib.parse import quote
from urllib.parse import urlencode
except ImportError:
import urllib2
from urllib import urlencode
import re
import MySQLdb as mdb
import sys
import six
def... |
Ragnis/subdl | refs/heads/master | util.py | 1 | import http.client
import urllib.request
from bs4 import BeautifulSoup
def connect(host, url):
conn = http.client.HTTPConnection(host)
conn.request("GET", url)
response = conn.getresponse()
soup = BeautifulSoup(response.read())
conn.close()
return soup
def contains_any(needles, haystack):
... |
beeftornado/sentry | refs/heads/master | tests/sentry/event_manager/interfaces/test_exception.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
from sentry import eventstore
from sentry.interfaces.exception import Exception
from sentry.stacktraces.processing import normalize_stacktraces_for_grouping
from sentry.event_manager import EventManager
@pytest.fixture
def make_exception_... |
baroquebobcat/pants | refs/heads/master | tests/python/pants_test/backend/python/tasks/test_python_distribution_integration.py | 1 | # coding=utf-8
# Copyright 2017 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)
import glob
import o... |
hansey/youtube-dl | refs/heads/master | youtube_dl/extractor/xtube.py | 87 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse_unquote,
)
from ..utils import (
parse_duration,
str_to_int,
)
class XTubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?P<url>xtube\.com/... |
ww9rivers/pysnmp | refs/heads/master | pysnmp/carrier/asynsock/dgram/unix.py | 4 | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
from pysnmp.carrier.asyncore.dgram.unix import *
|
The-Compiler/qutebrowser | refs/heads/master | qutebrowser/completion/models/completionmodel.py | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2017-2020 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... |
denys-duchier/django-wiki-py3 | refs/heads/master | wiki/models/pluginbase.py | 1 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models import signals
"""
There are three kinds of plugin base models:
1) SimplePlugin - an object purely associated with an article. Will bump the
article's revision history upon creatio... |
2014c2g2/2014c2 | refs/heads/master | w2/static/Brython2.0.0-20140209-164925/Lib/test/test_int.py | 765 | import sys
import unittest
from test.support import run_unittest
L = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', 314),
('314 ', 314),
(' \t\t 314 \t\t ', 314),
(repr(sys.maxsize... |
mancoast/CPythonPyc_test | refs/heads/master | crash/301_test_trace.py | 3 | # Testing the line trace facility.
from test import support
import unittest
import sys
import difflib
import gc
# A very basic example. If this fails, we're in deep trouble.
def basic():
return 1
basic.events = [(0, 'call'),
(1, 'line'),
(1, 'return')]
# Many of the tests below ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.