repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lethe3000/fabric-bolt | refs/heads/master | fabric_bolt/hosts/views.py | 7 | from django.views.generic import CreateView, UpdateView, DeleteView, DetailView, TemplateView, FormView
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib import messages
from django_tables2.views import SingleTableView
from fabric_bolt.core.mixins.views import MultipleGroupRequiredMixin, ... |
janpipek/boadata | refs/heads/master | boadata/cli/__init__.py | 1 | """Command-line interface utility functions."""
import contextlib
import signal
import sys
from typing import Dict, List, Optional
from boadata import load
def try_load(uri: str, type: Optional[str] = None, parameters: List[str] = None) -> 'boadata.core.DataObject':
"""Use parameters from command-line to load th... |
awemulya/fieldsight-kobocat | refs/heads/master | onadata/apps/eventlog/migrations/0017_fieldsightlog_recipient.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('eventlog', '0016_auto_20170906_1450'),
... |
jch1/models | refs/heads/master | object_detection/box_coders/square_box_coder_test.py | 26 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
clumsy/intellij-community | refs/heads/master | python/testData/quickFixes/PyUpdatePropertySignatureQuickFixTest/setterLessParam.py | 80 | class A(Aa):
@property
def <warning descr="Getter signature should be (self)">x</warning>(self, r):
return r
@x.setter
def <warning descr="Setter signature should be (self, value)">x<caret></warning>():
self._x = ""
|
markolopa/pyorcy | refs/heads/master | examples/compute_main.py | 2 | from __future__ import print_function
import sys
from time import time
import pyorcy
from compute_function import f
def main():
n = int(sys.argv[1])
t1 = timef(n, use_cython=False)
t2 = timef(n, use_cython=True)
if t2 != 0:
print("speedup: %.1f" % (t1 / t2))
def timef(n, use_c... |
TomoyoshiToyoda/language_processing | refs/heads/master | language_processing_100/python3/sect2/NLP13.py | 1 | #! /usr/bin/env python3
from NLP12 import *
def paste():
cut()
paste_two_files()
def paste_two_files():
lines1 = getlines_with_rstrip(out_file1)
lines2 = getlines_with_rstrip(out_file2)
for l1, l2 in zip(lines1, lines2):
print('\t'.join([l1, l2]))
def getlines_with_rstrip(in_filename):
... |
avocado-framework/avocado-vt | refs/heads/master | virttest/libvirt_xml/accessors.py | 1 | """
Specializations of base.AccessorBase for particular XML manipulation types
"""
import logging
from virttest import xml_utils
from virttest import element_tree
from virttest.propcan import PropCanBase
from virttest.libvirt_xml import xcepts, base
def type_check(name, thing, expected):
"""
Check that thin... |
znerol/spreadflow-core | refs/heads/master | twisted/plugins/spreadflow_core_service.py | 2 | from twisted.application.service import ServiceMaker
SpreadFlowCoreService = ServiceMaker(
"SpreadFlow Core Service",
"spreadflow_core.service",
"Metadata extraction and processing engine",
"spreadflow_service")
|
zxtstarry/src | refs/heads/master | plot/test/cmp.py | 5 | #!/usr/bin/env python
## Copyright (C) 2008 University of Texas at Austin
##
## 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 of the License, or
## (at your option... |
fjbatresv/odoo | refs/heads/8.0 | addons/payment_buckaroo/__init__.py | 373 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
Krossom/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/concurrent/futures/_base.py | 47 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
import collections
import functools
import logging
import threading
import time
FIRST_COMPLETED = 'FIRST_COMPLETED'
FIRST_EXCEPTION = 'FIRST_EXCEPTION'
ALL_COMPLETED... |
rfribeiro/sudoku-ga | refs/heads/master | examples/ga/example-4.py | 1 | #! /usr/bin/env python
# Solving a 9x9 Sudoku puzzle (36 numbers missing).
#
# Copyright (C) 2013 Efstathios Chatzikyriakidis <contact@efxa.org>
#
# 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 Sof... |
chenc10/Spark-PAF | refs/heads/master | ec2/lib/boto-2.34.0/boto/kinesis/__init__.py | 145 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... |
Eureka22/ASM_xf | refs/heads/master | PythonD/site_python/Scientific/DictWithDefault.py | 2 | # A dictionary with default values for non-existing entries
import UserDict, copy
class DictWithDefault(UserDict.UserDict):
"""Dictionary with default values
Constructor: DictWithDefault(|default|)
Instances of this class act like standard Python dictionaries,
except that they return a *copy* of |... |
youdonghai/intellij-community | refs/heads/master | python/testData/inspections/PyDunderSlotsInspectionTest/inheritedClassAttrAssignmentAndOwnWithDictAndInheritedSlots.py | 35 | class B(object):
attr = 'baz'
__slots__ = ['f', 'b']
class C(B):
__slots__ = ['foo', 'bar', '__dict__']
C.attr = 'spam'
print(C.attr)
c = C()
c.attr = 'spam'
print(c.attr) |
Zolertia/openthread | refs/heads/master | tests/scripts/thread-cert/__init__.py | 5 | #!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# not... |
youdonghai/intellij-community | refs/heads/master | python/testData/resolve/RMatMul.py | 79 | class C:
def __rmatmul__(self, other):
return self
x = C()
y @ x
# <ref>
|
markpasc/django-emailuser | refs/heads/master | emailuser/admin.py | 2 | from django import forms
from django.contrib import admin
import django.contrib.auth.admin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import ugettext_lazy as _
from emailuser.models import User
class UserCreationForm(forms.ModelForm):
password1 = forms.CharFiel... |
digideskio/st2contrib | refs/heads/master | packs/lastline/actions/get_result_artifact.py | 10 | from lib import actions
class GetResultArtifact(actions.BaseAction):
def run(self, uuid, report_uuid, artifact_name, raw=False, verify=True):
response = self.client.get_result_artifact(uuid, report_uuid,
artifact_name, raw, verify)
return respon... |
borysiasty/QGIS | refs/heads/master | scripts/qgis_fixes/fix_future_standard_library.py | 77 | from libfuturize.fixes.fix_future_standard_library import FixFutureStandardLibrary
|
SerCeMan/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/models/fields/proxy.py | 634 | """
Field-like classes that aren't really fields. It's easier to use objects that
have the same attributes as fields sometimes (avoids a lot of special casing).
"""
from django.db.models import fields
class OrderWrt(fields.IntegerField):
"""
A proxy for the _order database field that is used when
Meta.ord... |
wengole/channels | refs/heads/master | channels/apps.py | 2 | from django.apps import AppConfig
class ChannelsConfig(AppConfig):
name = "channels"
verbose_name = "Channels"
def ready(self):
# Do django monkeypatches
from .hacks import monkeypatch_django
monkeypatch_django()
|
EiSandi/greetingslack | refs/heads/master | greetingslack/lib/python2.7/site-packages/chardet/euckrfreq.py | 342 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
diablo-rewriter/diablo | refs/heads/master | obfuscation/diversity_engine/iterative_diablo/iterative_rounds.py | 1 | # This research is supported by the European Union Seventh Framework Programme (FP7/2007-2013), project ASPIRE (Advanced Software Protection: Integration, Research, and Exploitation), under grant agreement no. 609734; on-line at https://aspire-fp7.eu/. */
# The development of portions of the code contained in this fil... |
rohanpm/qingfanyi | refs/heads/master | qingfanyi/navigator.py | 1 | # coding=utf-8
# qingfanyi - Chinese to English translation tool
# Copyright (C) 2016 Rohan McGovern <rohan@mcgovern.id.au>
#
# 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 ... |
alexlo03/ansible | refs/heads/devel | lib/ansible/modules/cloud/oneandone/oneandone_firewall_policy.py | 74 | #!/usr/bin/python
# 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... |
raymondxyang/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/mixture_test.py | 4 | # 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... |
suto/infernal-twin | refs/heads/master | build/pip/pip/_vendor/progress/bar.py | 404 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... |
campbe13/openhatch | refs/heads/master | vendor/packages/twill/twill/other_packages/_mechanize_dist/_upgrade.py | 20 | from urllib2 import BaseHandler
from _request import Request
from _response import upgrade_response
from _util import deprecation
class HTTPRequestUpgradeProcessor(BaseHandler):
# upgrade urllib2.Request to this module's Request
# yuck!
handler_order = 0 # before anything else
def http_request(self... |
theguardian/headphones | refs/heads/master | lib/html5lib/tokenizer.py | 1710 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... |
wilfriedE/gae-init | refs/heads/master | main/auth/github.py | 12 | # coding: utf-8
import flask
import auth
import config
import model
import util
from main import app
github_config = dict(
access_token_method='POST',
access_token_url='https://github.com/login/oauth/access_token',
authorize_url='https://github.com/login/oauth/authorize',
base_url='https://api.gith... |
MattRijk/django-ecomsite | refs/heads/master | lib/python2.7/site-packages/django/utils/image.py | 98 | # -*- coding: utf-8 -*-
"""
To provide a shim layer over Pillow/PIL situation until the PIL support is
removed.
Combinations To Account For
===========================
* Pillow:
* never has ``_imaging`` under any Python
* has the ``Image.alpha_composite``, which may aid in detection
* PIL
* CPython 2.... |
as110/as110.github.io | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/bbcode.py | 362 | # -*- coding: utf-8 -*-
"""
pygments.formatters.bbcode
~~~~~~~~~~~~~~~~~~~~~~~~~~
BBcode formatter.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt
__al... |
kmather73/ggplot | refs/heads/master | ggplot/stats/stat.py | 12 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
from copy import deepcopy
from ggplot.utils.exceptions import GgplotError
import ggplot.geoms
__all__ = ['stat']
__all__ = [str(u) for u in __all__]
class stat(object):
"""Base class of all st... |
joshpfosi/gbn | refs/heads/master | .waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/xlcxx.py | 21 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
conf.get_xlc_version(cxx)
conf.env.CXX_NAME='x... |
adamfast/geodjango_timezones | refs/heads/master | timezones/south_migrations/0001_initial.py | 1 | # 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 model 'Timezone'
db.create_table('timezones_timezone', (
('id', self.gf('django.db.mo... |
dwightgunning/django | refs/heads/master | tests/migrations/migrations_test_apps/migrated_app/migrations/0001_initial.py | 2995 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name",... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/gmake/package.py | 2 | # 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 Gmake(AutotoolsPackage, GNUMirrorPackage):
"""GNU Make is a tool which controls the genera... |
konstruktoid/ansible-upstream | refs/heads/devel | lib/ansible/modules/monitoring/statusio_maintenance.py | 92 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Benjamin Copeland (@bhcopeland) <ben@copeland.me.uk>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/py27/lib/python2.7/re.py | 131 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... |
tanglu-org/tgl-misago | refs/heads/master | misago/__init__.py | 3 | __version__ = "0.5.5"
|
salguarnieri/intellij-community | refs/heads/master | python/lib/Lib/fnmatch.py | 194 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... |
whn09/tensorflow | refs/heads/master | tensorflow/python/training/monitored_session.py | 10 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
cpritchett/ansible-modules-core | refs/heads/devel | cloud/amazon/_ec2_ami_search.py | 14 | #!/usr/bin/python
#
# (c) 2013, Nimbis Services
#
# 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... |
pombredanne/taskflow-1 | refs/heads/master | taskflow/storage.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Yahoo! 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... |
LeMeteore/python_koans | refs/heads/master | python3/koans/about_strings.py | 80 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(__, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
string = '... |
Batterfii/django | refs/heads/master | tests/postgres_tests/test_unaccent.py | 328 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import modify_settings
from . import PostgreSQLTestCase
from .models import CharFieldModel, TextFieldModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'})
class UnaccentTest(PostgreSQLTestCase):
Model = Char... |
davidhampgonsalves/mix-tree | refs/heads/master | init/languages/pl.py | 8 | {
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyra\xc5\xbceniem postaci "pole1=\'nowawarto\xc5\x9b\xc4\x87\'". Nie mo\xc5\xbcesz uaktualni\xc4\x87 lub usun\xc4\x85\xc4\x87 wynik\xc3\xb3w z JOIN:',
'%Y-%m-%d': '%Y-%m-%d... |
MIEMHSE/labworks-petrinets-quadraticequation | refs/heads/master | quadraticequation/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Sergey Sobko'
__email__ = 'S.Sobko@profitware.ru'
__copyright__ = 'Copyright 2014, The Profitware Group'
from math import sqrt
from snakes.nets import *
import snakes.plugins
snakes.plugins.load('gv', 'snakes.nets', 'nets')
from nets import *
def quadrat... |
bhermanmit/cdash | refs/heads/ctests | tests/test_output/results.py | 67 | #!/usr/bin/env python
import sys
# import statepoint
sys.path.append('../../src/utils')
import statepoint
# read in statepoint file
if len(sys.argv) > 1:
sp = statepoint.StatePoint(sys.argv[1])
else:
sp = statepoint.StatePoint('statepoint.10.binary')
sp.read_results()
# set up output string
outstr = ''
# ... |
eeshangarg/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/http/response/dammit.py | 16 | """
This module contains a fork of the UnicodeDammit class from BeautifulSoup, that
expliclty disabled any usage of chardet library.
The UnicodeDammit class is used as a last resource for detecting the encoding
of a response.
"""
import re
import codecs
chardet = None # we don't want to use chardet since it's very s... |
PabloCastellano/nodeshot | refs/heads/master | nodeshot/community/profiles/admin.py | 3 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from django.contrib.auth.forms import UserChangeForm as BaseChangeForm
from django.contrib.auth.forms import UserCreationForm as ... |
jfly/tnoodle | refs/heads/master | wca/tmtproject.py | 4 | import tmt
class Project(tmt.EclipseProject):
def configure(self):
tmt.EclipseProject.configure(self)
tmt.WinstoneServer.addPlugin(self)
self.fullName = "TNoodle-WCA"
Project(tmt.projectName(), description="Special target for the WCA")
|
vladmm/intellij-community | refs/heads/master | python/testData/selectWord/list/after2.py | 83 | x = [1, 2, 3<selection>, 4</selection>] |
duongbaoduy/gtools | refs/heads/gtools | third_party/logilab/astroid/brain/py2stdlib.py | 64 |
"""Astroid hooks for the Python 2 standard library.
Currently help understanding of :
* hashlib.md5 and hashlib.sha1
"""
import sys
from functools import partial
from textwrap import dedent
from astroid import (
MANAGER, AsStringRegexpPredicate,
UseInferenceDefault, inference_tip,
YES, InferenceError, ... |
benschmaus/catapult | refs/heads/master | third_party/gsutil/third_party/retry-decorator/retry_decorator/__init__.py | 36 | # -*- coding: utf-8 -*-
from .retry_decorator import *
__title__ = 'retry_decorator'
__version__ = "1.0.0"
|
adrianovieira/hook-apps | refs/heads/master | teste/pandoc_parser.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
reload(sys) # Reload does the trick!
sys.setdefaultencoding('UTF-8')
from flask import Flask, request, json
import logging
import gitlab
... |
leyyin/university | refs/heads/master | fundamentals-of-programming/labs/lab_5-11/ui/console.py | 1 | #!/usr/bin/python
# http://python-future.org/compatible_idioms.html
from __future__ import print_function
from builtins import input
try:
import readline
except ImportError as e:
print(("\n" * 3) + "--- READLINE IS DISABLED TERMINAL APPLICATION WILL NOT WORK PROPERLY ---")
print("\tTHE EXCEPTION: " + e.me... |
gale320/newfies-dialer | refs/heads/master | newfies/dialer_settings/migrations/0001_initial.py | 7 | # -*- 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 model 'DialerSetting'
db.create_table('dialer_setting', (
(u'id', self.gf('django.db.mo... |
Logicalmars/appengine-keeptrack | refs/heads/master | pytz/zoneinfo/Europe/Monaco.py | 9 | '''tzinfo timezone information for Europe/Monaco.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Monaco(DstTzInfo):
'''Europe/Monaco timezone definition. See datetime.tzinfo for details'''
zone = 'Europe/Monaco'
_ut... |
theflofly/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/sparse_matmul_op_test.py | 22 | # 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... |
linked67/p2pool-exclusivecoin | refs/heads/master | nattraverso/pynupnp/soap.py | 288 | """
This module is a SOAP client using twisted's deferreds.
It uses the SOAPpy package.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
import SOAPpy, logging
from SOAPpy.Config import Config
from... |
VigiZhang/AutoATTKAnalysisTool | refs/heads/master | category.py | 1 | '''
Created on 2012-7-4
@author: Vigi
'''
import re
class Categorizer():
def __init__(self, file):
self.file = open(file, 'w')
def generateList(self):
"Generate list"
pass
def startPage(self):
self.file.write(r'<html><head><meta http-equiv="content-type" c... |
GuiltyDolphin/RAYLEIGH | refs/heads/master | analysis/rayleigh.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# rayleigh.py
import argparse
import os
import sys
from matplotlib import pyplot as plt
from analysis import frame_parser as fp
from analysis import plotter
import analysis
class RayleighApp():
def __init__(self):
self._parser = argparse.ArgumentParser(
... |
silkyar/570_Big_Little | refs/heads/master | build/ARM/mem/protocol/Directory_Controller.py | 1 | from m5.params import *
from m5.SimObject import SimObject
from Controller import RubyController
class Directory_Controller(RubyController):
type = 'Directory_Controller'
directory = Param.RubyDirectoryMemory("")
memBuffer = Param.RubyMemoryControl("")
directory_latency = Param.Int(12, "")
|
sda2b/youtube-dl | refs/heads/master | youtube_dl/extractor/dropbox.py | 236 | # coding: utf-8
from __future__ import unicode_literals
import os.path
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import url_basename
class DropboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dropbox[.]com/sh?/(?P<id>[a-zA-Z0-9]{15})/.*'
... |
django-cratis/cratis | refs/heads/master | cratis/cli.py | 1 | import argparse
import os
import sys
from cratis.add import add_cmd
from cratis.bootstrap import init_app
def django_cmd():
"""
Command that executes django ./manage.py task + loads environment variables from cratis.yml
Command also can be executed from sub-folders of project.
"""
os.system('.p... |
open-craft/dalite-ng | refs/heads/master | peerinst/forms.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
class FirstAnswerForm(forms.Form):
"""Form to select one of the answer choices and enter a rationale."""
error_css_cl... |
LiaoPan/scikit-learn | refs/heads/master | sklearn/externals/joblib/_compat.py | 266 | """
Compatibility layer for Python 3/Python 2 single codebase
"""
try:
_basestring = basestring
except NameError:
_basestring = str
|
Joy-El/metagene_analysis | refs/heads/master | MetageneError.py | 1 | #!/usr/bin/python
"""MetageneError.py error class for metagene analysis
Requires:
python 2 (https://www.python.org/downloads/)
Joy-El R.B. Talbot Copyright (c) 2014
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation fi... |
open-switch/ops-switchd | refs/heads/master | ops-tests/feature/sflow/sflow_utils.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Hewlett Packard Enterprise Development LP
#
# 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
#
# U... |
LChristakis/chalice-hunter | refs/heads/master | lib/python3.4/site-packages/werkzeug/debug/console.py | 280 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2014 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... |
sergiorua/libcloud | refs/heads/trunk | libcloud/compute/drivers/vultr.py | 35 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
bwahn/kubernetes | refs/heads/master | third_party/htpasswd/htpasswd.py | 897 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# Copyright (C) 2008 Eli Carter
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edge... |
ladybug-tools/honeybee | refs/heads/master | honeybee_plus/radiance/recipe/radiation/gridbased.py | 3 | """Radiation analysis based on Daylight Coefficient Grid-Based Analysis Recipe.
This is a slightly faster implementation for annual radiation analysis using daylight
coefficient based method. This recipe genrates -s sky and add it up with analemma.
See: https://github.com/ladybug-tools/honeybee/issues/167#issue-24574... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/geos/prepared.py | 544 | from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes import prepared as capi
class PreparedGeometry(GEOSBase):
"""
A geometry that is prepared for performing certain operations.
At the moment this includes the co... |
fr0uty/oartm | refs/heads/master | oar/kao/job.py | 1 | # coding: utf-8
from __future__ import unicode_literals, print_function
import os
from copy import deepcopy
from sqlalchemy import distinct
from sqlalchemy import text
from sqlalchemy.orm import aliased
from oar.lib import (db, Job, MoldableJobDescription, JobResourceDescription,
JobResourceGrou... |
fards/ainol_elfii_common | refs/heads/master | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
akhan7/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_empty_enum.py | 276 | import WebIDL
def WebIDLTest(parser, harness):
try:
parser.parse("""
enum TestEmptyEnum {
};
""")
harness.ok(False, "Should have thrown!")
except:
harness.ok(True, "Parsing TestEmptyEnum enum should fail")
results = parser.finish()
|
motobyus/moto | refs/heads/master | util/coinTracking/tracker_lezhin.py | 1 | # -*- coding: utf-8 -*-
# =====================================================================
# write : moto
# latest update : 17.05.24.
#
# parsing --> db --> csv --> s3
# viewing --> s3
#
# =====================================================================
import datetime, sys, sqlite3, json, time
from robobro... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/i18n/forms.py | 55 | from __future__ import absolute_import
from django import forms
from django.forms.extras import SelectDateWidget
from .models import Company
class I18nForm(forms.Form):
decimal_field = forms.DecimalField(localize=True)
float_field = forms.FloatField(localize=True)
date_field = forms.DateField(localize=T... |
40223203/2015cdb_g3_40223203_0622 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/base64.py | 733 | #! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
_... |
shagabutdinov/sublime-keyword | refs/heads/master | keyword.py | 1 | import sublime
import sublime_plugin
import re
try:
from Expression import expression
from Statement import statement
from QuickSearchEnhanced.quick_search import panels
from Context import context
from ProjectFiles.project_files import ProjectFiles
except ImportError as error:
sublime.error_message("Depen... |
ahoarau/m3meka | refs/heads/master | python/scripts/m3qa/unit_test_actuator_a2r2.py | 2 | #Copyright 2010, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#LIMITED... |
Thortoise/Super-Snake | refs/heads/master | Blender/animation_nodes-master/register_files.py | 1 | import bpy
from . import utils
from . import keymap
from . import id_keys
from . import draw_handler
from . ui import node_panel
from . ui import node_colors
from . import extend_bpy_types
from . operators import dynamic_operators
from . base_types import node as node_base
from . nodes.sound import bake as sound_bake
... |
francois-contat/scapy | refs/heads/master | scapy/asn1/mib.py | 1 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# Modified by Maxence Tury <maxence.tury@ssi.gouv.fr>
# This program is published under a GPLv2 license
"""
Management Information Base (MIB) parsing
"""
from __future__ impor... |
lxybox1/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/polynomial/chebyshev.py | 53 | """
Objects for dealing with Chebyshev series.
This module provides a number of objects (mostly functions) useful for
dealing with Chebyshev series, including a `Chebyshev` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in... |
xfenix/django-metro | refs/heads/master | metro/migrations/0002_auto_20181009_1427.py | 1 | # Generated by Django 2.1.2 on 2018-10-09 14:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('metro', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='metro',
... |
mohamed--abdel-maksoud/chromium.src | refs/heads/nw12 | third_party/google_input_tools/third_party/closure_library/closure/bin/build/treescan.py | 582 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Library 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
... |
frankiecjunle/yunblog | refs/heads/master | venv/lib/python2.7/site-packages/wtforms/ext/sqlalchemy/fields.py | 177 | """
Useful form fields for use with SQLAlchemy ORM.
"""
from __future__ import unicode_literals
import operator
from wtforms import widgets
from wtforms.compat import text_type, string_types
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
try:
from sqlalchemy.orm.util im... |
pancentric/django-cms | refs/heads/develop | cms/plugin_base.py | 3 | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from cms.constants import PLUGIN_MOVE_ACTION, PLUGIN_COPY_ACTION
from cms.utils.compat.metaclasses import with_metaclass
import re
from cms.utils import get_cms_setting
from cms.utils.placeholder import get_placeholder_conf
from cms.utils.compat.dj imp... |
lscheinkman/nupic | refs/heads/master | tests/swarming/nupic/swarming/experiments/smart_speculation_spatial_classification/description.py | 10 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/extern/python/closured/lib/python2.7/email/feedparser.py | 114 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... |
keeeener/nicki | refs/heads/master | platform/external/webkit/Tools/QueueStatusServer/handlers/statusbubble.py | 15 | # Copyright (C) 2009 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... |
windskyer/k_nova | refs/heads/master | paxes_nova/tests/virt/ibmpowervm/ivm/test_operator_ivmLocalDiskIVM.py | 1 | '''
Created on Mar 24, 2015
@author: root
'''
import mock
import testtools
from paxes_nova.virt.ibmpowervm.ivm import operator
from paxes_nova.virt.ibmpowervm.ivm.common import Connection
class LocalDiskIVMOperatorTestCase(testtools.TestCase):
def setUp(self):
super(LocalDiskIVMOperatorTestCase, self).se... |
ReidWilliams/autoencoder-vaegan | refs/heads/master | feed.py | 1 | import numpy as np
from PIL import Image
import os
import sys
# Loads and returns batches of training data. Abstract this into a class
# that preloads a bunch of images in advance, but doesn't preload the entire
# training set in advance.
class Feed:
'''Feed image data to training process. '''
def __init__(self, da... |
unseenlaser/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/atom_tests/client_test.py | 87 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... |
abaditsegay/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_nis.py | 58 | from test import test_support
import unittest
import nis
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error, msg:
# NIS is probably not active, so this test isn't useful
if test_support.verbose:
print "... |
cuilishen/cuilishenMissionPlanner | refs/heads/master | Lib/site-packages/numpy/lib/tests/test_ufunclike.py | 59 | from numpy.testing import *
import numpy.core as nx
import numpy.lib.ufunclike as ufl
from numpy.testing.decorators import deprecated
class TestUfunclike(TestCase):
def test_isposinf(self):
a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0])
out = nx.zeros(a.shape, bool)
tgt = nx.array... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.