repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
victorzhao/miniblink49
refs/heads/master
third_party/WebKit/Tools/Scripts/webkitpy/formatter/fix_single_quote_strings.py
52
# Copyright 2014 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. """ A 2to3 fixer that converts all string literals to use single quotes. Strings that contain single quotes will not be modified. Prefixed string literals w...
toshima/generalsio
refs/heads/master
example.py
1
#!/bin/python import generals import logging logging.basicConfig(level=logging.DEBUG) # 1v1 g = generals.Generals('your userid', 'your username', '1v1') # ffa # g = generals.Generals('your userid', 'your username', 'ffa') # private game # g = generals.Generals('your userid', 'your username', 'private', 'your gameid...
ckclark/leetcode
refs/heads/master
py/island-perimeter.py
1
class Solution(object): def islandPerimeter(self, grid): """ :type grid: List[List[int]] :rtype: int """ r = len(grid) c = len(grid[0]) perimeter = 0 for i in xrange(r): for j in xrange(c): if grid[i][j] == 1: ...
honur/django-multi-tenancy
refs/heads/master
tenant_schemas/utils.py
1
from contextlib import contextmanager from django.conf import settings from django.db import connection from django.db.models.loading import get_model from django.core import mail @contextmanager def schema_context(schema_name): previous_tenant = connection.tenant try: connection.set_schema(schema_nam...
a0c/odoo
refs/heads/master
addons/mail/tests/test_mail_group.py
44
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
Cloudoki/Unified-bootstrap
refs/heads/master
node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
squirrelo/qiita
refs/heads/master
qiita_core/qiita_settings.py
4
#!/usr/bin/env python from __future__ import division # ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this softw...
odoobgorg/odoo
refs/heads/9.0
addons/im_livechat/report/__init__.py
67
# -*- coding: utf-8 -*- import im_livechat_report_channel import im_livechat_report_operator
nkhuyu/data-science-from-scratch
refs/heads/master
code/statistics.py
60
from __future__ import division from collections import Counter from linear_algebra import sum_of_squares, dot import math num_friends = [100,49,41,40,25,21,21,19,19,18,18,16,15,15,15,15,14,14,13,13,13,13,12,12,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,...
patcon/open-cabinet
refs/heads/master
venv/lib/python2.7/site-packages/django/conf/__init__.py
135
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import importlib import os import time import warnings from dj...
beezee/GAE-Django-site
refs/heads/master
django/conf/locale/el/formats.py
433
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd E Y' TIME_FORMAT = 'g:i:s A' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = '...
dillonjerry/aws
refs/heads/master
AWS-ElasticBeanstalk-CLI-2.6.2/eb/linux/python2.7/lib/aws/requests/packages/__init__.py
1849
from __future__ import absolute_import from . import urllib3
cyberark-bizdev/ansible
refs/heads/devel
test/units/module_utils/basic/test_deprecate_warn.py
127
# -*- coding: utf-8 -*- # # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import json import pytest @pytest.mark.parametrize('stdin', [{}], indirect=['stdin']) def test_warn(am, capfd): am.warn('warning1') with pytest.raises...
zhanghenry/stocks
refs/heads/master
django/templatetags/l10n.py
251
from django.template import Library, Node, TemplateSyntaxError from django.utils import formats from django.utils.encoding import force_text register = Library() @register.filter(is_safe=False) def localize(value): """ Forces a value to be rendered as a localized value, regardless of the value of ``setti...
markpooljo/Versus
refs/heads/master
plugins/ti.alloy/plugin.py
1729
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
CRS-support/ftw
refs/heads/master
test/integration/test_cookie.py
1
from ftw import testrunner, http, errors import pytest def test_default(ruleset, test, destaddr): """ Default tester with no logger obj. Useful for HTML contains and Status code Not useful for testing loggers """ runner = testrunner.TestRunner() try: last_ua = http.HttpUA() for...
yanirs/servo
refs/heads/master
components/script/dom/bindings/codegen/ply/ply/__init__.py
838
# PLY package # Author: David Beazley (dave@dabeaz.com) __all__ = ['lex','yacc']
pyparallel/numpy
refs/heads/master
numpy/distutils/fcompiler/intel.py
30
# http://developer.intel.com/software/products/compilers/flin/ from __future__ import division, absolute_import, print_function import sys from numpy.distutils.ccompiler import simple_version_match from numpy.distutils.fcompiler import FCompiler, dummy_fortran_file compilers = ['IntelFCompiler', 'IntelVisualFCompile...
Zephor5/pika
refs/heads/master
tests/unit/callback_tests.py
11
# -*- coding: utf8 -*- """ Tests for pika.callback """ import logging try: import mock except ImportError: from unittest import mock try: import unittest2 as unittest except ImportError: import unittest from pika import amqp_object from pika import callback from pika import frame from pika import spe...
slowkow/ggrepel
refs/heads/master
scripts/make_figure_links.py
1
#!/usr/bin/env python thumbs = [ { 'src': 'vignettes/figures/ggrepel/empty_string-1.png', 'href': 'vignettes/ggrepel.md#hide-some-of-the-labels' }, { 'src': 'vignettes/figures/ggrepel/point_padding_na-1.png', 'href': 'vignettes/ggrepel.md#do-not-repel-labels-from-data-points...
chdecultot/erpnext
refs/heads/develop
erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.py
17
# -*- coding: utf-8 -*- # Copyright (c) 2017, sathishpy@gmail.com and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest class TestBankStatementTransactionEntry(unittest.TestCase): pass
havard024/prego
refs/heads/master
crm/lib/python2.7/site-packages/pygments/styles/pastie.py
75
# -*- coding: utf-8 -*- """ pygments.styles.pastie ~~~~~~~~~~~~~~~~~~~~~~ Style similar to the `pastie`_ default style. .. _pastie: http://pastie.caboo.se/ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style impor...
gyang/nova
refs/heads/master
nova/tests/image/test_glance.py
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
ingokegel/intellij-community
refs/heads/master
python/helpers/conda_packaging_tool.py
12
import sys import traceback ERROR_WRONG_USAGE = 1 ERROR_EXCEPTION = 4 def usage(): sys.stderr.write('Usage: conda_packaging_tool.py listall | channels | versions PACKAGE\n') sys.stderr.flush() exit(ERROR_WRONG_USAGE) def do_list_available_packages(): import conda version = conda.__version__ ...
benchoufi/PRJ-medtec_sigproc
refs/heads/master
echopen-leaderboard/bootcamp/decorators.py
13
from django.http import HttpResponseBadRequest def ajax_required(f): def wrap(request, *args, **kwargs): if not request.is_ajax(): return HttpResponseBadRequest() return f(request, *args, **kwargs) wrap.__doc__ = f.__doc__ wrap.__name__ = f.__name__ return wrap
supersven/intellij-community
refs/heads/master
python/lib/Lib/cgitb.py
81
"""More comprehensive traceback formatting for Python scripts. To enable this module, do: import cgitb; cgitb.enable() at the top of your script. The optional arguments to enable() are: display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to fi...
bruecksen/notifhain
refs/heads/master
notifhain/core/admin.py
9
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import User admin.site.register(User, UserAdmin)
Gminded/relativistic-uml
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
havatv/QGIS
refs/heads/master
src/plugins/grass/scripts/qgis.v.kernel.rast.py
45
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ *************************************************************************** qgis.v.kernel.rast.py --------------------- Date : February 2010 Copyright : (C) 2010 by Radim Blazek Email : radim dot blazek at ...
capybaralet/Sequential-Generation
refs/heads/master
TestPhilAttention.py
2
from __future__ import division, print_function import logging import theano import numpy import cPickle import theano from theano import tensor from theano import tensor as T import numpy as np from collections import OrderedDict from blocks.graph import ComputationGraph from blocks.filter import VariableFilter fro...
motine/Ohouse
refs/heads/development
test/unit/v2/reg_tests.py
1
#!/usr/bin/env python import unittest from testtools import * import sys arg = None def reg_call(method_name, params=[], user_name='alice'): if arg in ['-v', '--verbose']: verbose = True else: verbose = False return api_call(method_name, 'reg/2', params=params, user_name=user_name, verbos...
follow99/django
refs/heads/master
tests/generic_views/test_base.py
269
from __future__ import unicode_literals import time import unittest from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import resolve from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import require_...
cjng96/devCmdTool
refs/heads/master
mainGoto.py
1
import os import urwid import subprocess import time from multiprocessing import Pool import urwidHelper as ur from tool import git, system, systemSafe, systemRet, programPath import tool import myutil from globalBase import * from mainRegList import DlgRegFolderSetting def repoGetStatus(item): ...
FlorianLudwig/odoo
refs/heads/8.0
openerp/addons/test_uninstall/__init__.py
2074
# -*- coding: utf-8 -*- import models # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
TeamCodefire/CFBalancer
refs/heads/master
CFB.py
1
# 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 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be ...
oxforever/linux-4.1
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
bpuderer/python_test_env
refs/heads/master
tests/test_rest_json.py
1
import httplib import json import requests from framework.config import settings from framework.testbase import BaseTestCase class RestJsonExample(BaseTestCase): def setUp(self): """test setup""" self.remove_books() def tearDown(self): """test cleanup""" self.remove_books()...
PaulKinlan/cli-caniuse
refs/heads/master
site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/symtable.py
114
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC, SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL, LOCAL) import weakref __all__ = ["sym...
jiumx60rus/grishyGhost
refs/heads/master
node_modules/nodegit/node_modules/pangyp/gyp/pylib/gyp/generator/cmake.py
148
# 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
btabibian/instagramInactive
refs/heads/master
instagram/models.py
3
from .helper import timestamp_to_datetime import six class ApiModel(object): @classmethod def object_from_dictionary(cls, entry): # make dict keys all strings if entry is None: return "" entry_str_dict = dict([(str(key), value) for key, value in entry.items()]) ret...
gzc/leetcode
refs/heads/master
python/181-190/Best Time to Buy and Sell Stock IV.py
2
#!/usr/bin/env python # coding=utf-8 class Solution: # @param {integer} k # @param {integer[]} prices # @return {integer} def maxProfit(self, k, prices): l = len(prices) if l < 2: return 0 if k >= l/2: res = 0 for i in range(l-1): ...
pigeonflight/strider-plone
refs/heads/master
docker/appengine/lib/simplejson/simplejson/encoder.py
20
"""Implementation of JSONEncoder """ import re from decimal import Decimal def _import_speedups(): try: from simplejson._speedups import encode_basestring_ascii, make_encoder return encode_basestring_ascii, make_encoder except ImportError: return None, None c_encode_basestring_ascii, c_...
johngian/remo
refs/heads/master
vendor-local/lib/python/mimeparse.py
55
"""MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 Contents: - pars...
simartin/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/py/testing/code/test_source.py
54
from py.code import Source import py import sys import inspect from py._code.source import _ast if _ast is not None: astonly = py.test.mark.nothing else: astonly = py.test.mark.xfail("True", reason="only works with AST-compile") failsonjython = py.test.mark.xfail("sys.platform.startswith('java')") def test_s...
jean/node
refs/heads/master
src/node/interfaces.py
1
from zope.interface import ( Interface, Attribute, ) from zope.interface.common.mapping import IFullMapping from zope.lifecycleevent import ( IObjectCreatedEvent, IObjectAddedEvent, IObjectModifiedEvent, IObjectRemovedEvent, ) try: from zope.location.interfaces import ILocation except Import...
michel-rodrigues/contabilidade-basica
refs/heads/master
source/livro_razao/models.py
10644
from django.db import models # Create your models here.
SerCeMan/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/tests/test_geoforms.py
94
from django.forms import ValidationError from django.contrib.gis import forms from django.contrib.gis.geos import GEOSGeometry from django.utils import unittest class GeometryFieldTest(unittest.TestCase): def test00_init(self): "Testing GeometryField initialization with defaults." fld = forms.Geo...
saurabh6790/aimobilize-lib-backup
refs/heads/master
core/doctype/event/__init__.py
2292
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
TangHao1987/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/flatpages/templatetags/flatpages.py
246
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.context_name = context_name if starts_with: ...
asadoughi/quark
refs/heads/master
quark/tools/redis_sg_tool.py
3
#!/usr/bin/python # Copyright 2014 Openstack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
rakshify/GLM_MAB
refs/heads/master
code/policies/glmUCB.py
2
""" glmUCB.py Janbaanz Launde Apr 1, 2017 """ from policy import Policy from math import exp, log, sqrt import numpy as np import scipy.optimize class GLMUCB(Policy): """ GLM-UCB algorithm given by Filippi et al. in ICML-2013. Parametric Bandits. Default link function is logistic (exp(x) / (1+exp(...
motion2015/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/helpers.py
51
""" Helper methods for Studio views. """ from __future__ import absolute_import from uuid import uuid4 import urllib from django.conf import settings from django.http import HttpResponse from django.shortcuts import redirect from django.utils.translation import ugettext as _ from edxmako.shortcuts import render_to_...
RedCoolBeans/cargos-buildroot
refs/heads/master
support/scripts/getdeveloperlib.py
2
import sys import os import re import argparse import glob import subprocess # # Patch parsing functions # FIND_INFRA_IN_PATCH = re.compile("^\+\$\(eval \$\((host-)?([^-]*)-package\)\)$") def analyze_patch(patch): """Parse one patch and return the list of files modified, added or removed by the patch.""" ...
mattclay/ansible
refs/heads/devel
test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py
68
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import sys def main(): for path in sys.argv[1:] or sys.stdin.read().splitlines(): with open(path, 'r') as path_fd: for line, text in enumerate(path_fd.readlines()): ...
hriddhidey/visage
refs/heads/master
visage/__init__.py
1
""" Created on Mon Sep 04 13:01:31 2017 @author: Hriddhi Dey """ from visage.detect_features import DetectLandmarks from visage.apply_makeup import ApplyMakeup
roninio/gae-boilerplate
refs/heads/Fix-Issue-253
boilerplate/external/github/oauth_client.py
48
#!/usr/bin/env python ## # 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, softwa...
chafique-delli/OpenUpgrade
refs/heads/master
addons/sales_team/sales_team.py
40
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
alex8866/cinder
refs/heads/f22-patches
cinder/api/contrib/volume_transfer.py
5
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
tgummerer/buck
refs/heads/master
third-party/py/twitter-commons/src/python/twitter/common/python/compatibility.py
5
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
FrankBian/kuma
refs/heads/master
vendor/packages/translate-toolkit/translate/filters/test_autocorrect.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.filters import autocorrect class TestAutocorrect: def correct(self, msgid, msgstr, expected): """helper to run correct function from autocorrect module""" corrected = autocorrect.correct(msgid, msgstr) print repr(msgid) ...
user-none/calibre
refs/heads/master
src/calibre/startup.py
2
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' Perform various initialization tasks. ''' import locale, sys, os, re # Default translation is NOOP import __builtin__ __builtin__.__dict__['_'] = lambda s: s # For strings which belong in the ...
brownrout/EECS-337-Recipes
refs/heads/master
Team4/italian_transformations.py
1
italian_spicy_list = { 'jalapeno' : ['black pepper', 'chili flakes', 'black pepper'], 'wasabi': ['black pepper', 'chili flakes', 'black pepper'], 'tobasco': ['black pepper', 'chili flakes', 'black pepper'], 'hot sauce': ['black pepper', 'chili flakes', 'black pepper'], 'habanero pepper' : ['black pe...
Icenowy/MissionPlanner
refs/heads/master
Lib/lib2to3/btm_matcher.py
61
"""A bottom-up tree matching algorithm implementation meant to speed up 2to3's matching process. After the tree patterns are reduced to their rarest linear path, a linear Aho-Corasick automaton is created. The linear automaton traverses the linear paths from the leaves to the root of the AST and returns a set of no...
cchurch/ansible
refs/heads/devel
contrib/inventory/spacewalk.py
28
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
tboyce021/home-assistant
refs/heads/dev
homeassistant/components/tank_utility/sensor.py
10
"""Support for the Tank Utility propane monitor.""" import datetime import logging import requests from tank_utility import auth, device as tank_monitor import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_DEVICES, CONF_EMAIL, CONF_PASSWORD, PERCEN...
City-of-Helsinki/smbackend
refs/heads/master
services/migrations/0004_auto_20170403_1113.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("services", "0003_auto_20170403_1036"), ] operations = [ migrations.AlterField( model_name="unit", na...
devilry/devilry-django
refs/heads/master
devilry/devilry_qualifiesforexam_plugin_approved/models.py
2
# from django.db import models # from devilry.devilry_qualifiesforexam.models import Status # from devilry.apps.core.models import Assignment # # # class SubsetPluginSetting(models.Model): # status = models.OneToOneField(Status, primary_key=True, # related_name="%(app_label)s_%(cla...
insomnia-lab/calibre
refs/heads/master
src/calibre/ebooks/conversion/plugins/docx_input.py
5
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' from calibre.customize.conversion import InputFormatPlugin, OptionRecommendat...
scifiswapnil/Project-LoCatr
refs/heads/master
lib/python2.7/site-packages/django/forms/models.py
8
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) fro...
Silenthinker/sum
refs/heads/master
seq2seq/test/data_test.py
7
# -*- coding: utf-8 -*- # Copyright 2017 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 ...
ant-t/heekscnc
refs/heads/master
nc/transform.py
34
################################################################################ # transform.py # # NC code creator for attaching Z coordinates to a surface # import nc import area import recreator transformed = False class FeedXY: def __init__(self, x, y): self.x = x self.y = y ...
SAR85/closure-linter
refs/heads/master
closure_linter/common/position.py
285
#!/usr/bin/env python # # Copyright 2008 The Closure Linter 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 #...
ksmit799/Toontown-Source
refs/heads/master
otp/login/LoginDISLTokenAccount.py
1
from direct.showbase.ShowBaseGlobal import * from direct.distributed.MsgTypes import * from direct.directnotify import DirectNotifyGlobal import LoginBase from direct.distributed.PyDatagram import PyDatagram class LoginDISLTokenAccount(LoginBase.LoginBase): def __init__(self, cr): LoginBase.LoginBase.__in...
snapcore/snapcraft
refs/heads/master
snapcraft/_store.py
2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2016-2020 Canonical Ltd # # 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 program is distributed in the ...
mcauser/micropython
refs/heads/master
tests/cmdline/repl_micropyinspect.py
15
# cmdline: cmdline/repl_micropyinspect # setting MICROPYINSPECT environment variable before program exit triggers REPL
ivan-fedorov/intellij-community
refs/heads/master
python/helpers/coverage/execfile.py
209
"""Execute files of Python code.""" import imp, marshal, os, sys from coverage.backward import exec_code_object, open_source from coverage.misc import ExceptionDuringRun, NoCode, NoSource try: # In Py 2.x, the builtins were in __builtin__ BUILTINS = sys.modules['__builtin__'] except KeyError: # In Py 3....
fabada/pootle
refs/heads/master
pootle/apps/reports/urls.py
7
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.conf.urls ...
mcornwell1957/bioconda-recipes
refs/heads/master
recipes/searchgui/2.1.4/searchgui.py
19
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
slava-sh/NewsBlur
refs/heads/master
apps/rss_feeds/urls.py
10
from django.conf.urls import url, patterns from apps.rss_feeds import views urlpatterns = patterns('', url(r'^feed_autocomplete', views.feed_autocomplete, name='feed-autocomplete'), url(r'^search_feed', views.search_feed, name='search-feed'), url(r'^statistics/(?P<feed_id>\d+)', views.load_feed_statistics,...
synergeticsedx/deployment-wipro
refs/heads/oxa/master.fic
lms/djangoapps/discussion_api/tests/test_serializers.py
9
""" Tests for Discussion API serializers """ import itertools from urlparse import urlparse import ddt import httpretty import mock from nose.plugins.attrib import attr from django.test.client import RequestFactory from discussion_api.serializers import CommentSerializer, ThreadSerializer, get_context from discussio...
Donkyhotay/MoonPy
refs/heads/master
zope/app/zptpage/tests/test_zptpageeval.py
1
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
dlazz/ansible
refs/heads/devel
lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py
52
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # 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 DOCUMENTATION = ''' --- module: proxysql_replication_hostg...
hourchallenge/zot
refs/heads/master
settings.py
1
import argparse import ConfigParser import os import sys def make_dir_if_not_exists(path): if not os.path.exists(path): os.makedirs(path) home_dir = os.path.expanduser('~/.zot/') make_dir_if_not_exists(home_dir) config_file_path = os.path.join(home_dir, 'settings') config = ConfigParser.SafeConfigParser() if n...
dfdx2/ancfinder
refs/heads/master
scripts/update_crimes.py
1
import requests, zipfile, subprocess update_data_file = 'http://data.octo.dc.gov/feeds/crime_incidents/archive/crime_incidents_2013_CSV.zip' zip_filename = 'crime_incidents_2013_CSV.zip' # Gather the file zip_request = requests.get('http://data.octo.dc.gov/feeds/crime_incidents/archive/crime_incidents_2013_CSV.zip', ...
mcepl/ropeide
refs/heads/master
ropeide/editor.py
1
import os import ScrolledText import Tkinter import tkFont from Tkinter import END, TclError, SEL_FIRST, SEL, SEL_LAST, INSERT import ropeide.editingtools import ropeide.searcher import ropeide.tkhelpers class GraphicalEditor(object): def __init__(self, parent, editorcontext, font=None): if font is Non...
nvoron23/scikit-learn
refs/heads/master
examples/bicluster/plot_spectral_biclustering.py
403
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
renard/ansible
refs/heads/devel
lib/ansible/utils/__init__.py
2520
# (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...
bcornwellmott/erpnext
refs/heads/develop
erpnext/hr/doctype/salary_detail/salary_detail.py
56
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class SalaryDetail(Document): pass
schwarz/youtube-dl
refs/heads/master
youtube_dl/extractor/xvideos.py
87
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urllib_request, ) from ..utils import ( clean_html, ExtractorError, determine_ext, ) class XVideosIE(InfoExtractor): _VALID_URL = r'https?://(?:www\....
jiachenning/odoo
refs/heads/8.0
addons/base_vat/base_vat.py
14
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
hainm/scikit-xray
refs/heads/master
skxray/core/fitting/base/__init__.py
10
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # @author: Li Li (lili@bnl.g...
amghost/myblog
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/__init__.py
269
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
handroissuazo/tensorflow
refs/heads/master
tensorflow/python/summary/event_file_inspector.py
62
# 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...
ademariag/kapitan
refs/heads/master
tests/test_copy.py
1
#!/usr/bin/env python3 # Copyright 2019 The Kapitan Authors # SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com> # # SPDX-License-Identifier: Apache-2.0 "copy tests" import filecmp import hashlib import os import shutil import sys import unittest from kapitan.cli import main from kapi...
xushiwei/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
yagince/text_ux
refs/heads/master
vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icpc.py
14
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys from waflib.Tools import ccroot,ar,gxx from waflib.Configure import conf def find_icpc(conf): if sys.platform=='cygwin': conf.fatal('The Intel compiler does n...
ryfeus/lambda-packs
refs/heads/master
Rasterio_osgeo_shapely_PIL_pyproj_numpy/source/PIL/EpsImagePlugin.py
21
# # The Python Imaging Library. # $Id$ # # EPS file handling # # History: # 1995-09-01 fl Created (0.1) # 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2) # 1996-08-22 fl Don't choke on floating point BoundingBox values # 1996-08-23 fl Handle files from Macintosh (0.3) # 2001-02-17 fl ...
opensignal/airflow
refs/heads/master
airflow/migrations/versions/2e541a1dcfed_task_duration.py
12
"""task_duration Revision ID: 2e541a1dcfed Revises: 1b38cef5b76e Create Date: 2015-10-28 20:38:41.266143 """ # revision identifiers, used by Alembic. revision = '2e541a1dcfed' down_revision = '1b38cef5b76e' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialect...
cubicova17/annet
refs/heads/master
venv/lib/python2.7/site-packages/south/tests/deps_a/migrations/0001_a.py
2088
from south.db import db from django.db import models class Migration: def forwards(self): pass def backwards(self): pass
leiferikb/bitpop
refs/heads/master
src/tools/memory_inspector/memory_inspector/data/serialization.py
19
# Copyright 2014 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. """This module handles the JSON de/serialization of the core classes. This is needed for both long term storage (e.g., loading/storing traces to local files...