repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
grow/grow
refs/heads/dependabot/npm_and_yarn/grow/ui/postcss-7.0.36
grow/pods/ui.py
2
"""Grow UI Tools""" import os import jinja2 from grow.common import utils from grow import storage from grow.templates import filters @utils.memoize def create_jinja_env(): root = os.path.join(utils.get_grow_dir(), 'ui', 'admin') loader = storage.FileStorage.JinjaLoader(root) env = jinja2.Environment( ...
slisson/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/test/__init__.py
247
""" Django Unit Test and Doctest framework. """ from django.test.client import Client, RequestFactory from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.utils import Approximate
bvisness/the-blue-alliance
refs/heads/master
helpers/district_helper.py
3
import logging import heapq import math import numpy as np from sys import float_info from collections import defaultdict from google.appengine.ext import ndb from consts.award_type import AwardType from consts.district_type import DistrictType from consts.event_type import EventType from helpers.event_helper impor...
hpsilva/profitpy
refs/heads/master
profit/lib/widgets/output.py
18
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2007 Troy Melhase <troy@gci.net> # Distributed under the terms of the GNU General Public License v2 from PyQt4.QtGui import QWidget from profit.lib.widgets.ui_outputwidget import Ui_OutputWidget class OutputWidget(QWidget, Ui_OutputWidget): def __init__(s...
shingonoide/odoo-etl
refs/heads/master
addons/project_task_no_date_constraint/project.py
2
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class task(osv.osv): _inherit = "project.task" def _check_dates(self, cr, uid, ids, context=None): return True
stephen144/odoo
refs/heads/9.0
openerp/conf/deprecation.py
50
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ Regroup variables for deprecated features. To keep the OpenERP server backward compatible with older modules, some additional code is needed throughout the core library. This module keeps track of those specific mea...
alivecor/tensorflow
refs/heads/master
tensorflow/contrib/tensor_forest/client/eval_metrics.py
52
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
cpsnowden/ComputationalNeurodynamics
refs/heads/master
Exercise_1/Q2_Izhikevich_RK.py
1
""" Computational Neurodynamics Exercise 1 Q2 http://www.izhikevich.org/publications/spikes.htm (C) Murray Shanahan et al, 2015 """ import numpy as np import matplotlib.pyplot as plt # Create time points Tmin = 0 Tmax = 200 # Simulation time dt = 0.01 # Step size T = np.arange(Tmin, Tmax + dt, dt) # Base current...
keikreutler/House-Starter
refs/heads/master
bower_components/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
566
# 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. """Utility functions shared amongst the Windows generators.""" import copy import os _TARGET_TYPE_EXT = { 'executable': '.exe', 'loadable_module': '.dll', ...
anandsimmy/ecommerce
refs/heads/master
tests/integration/offer/test_shipping_percentage_benefit.py
1
from decimal import Decimal as D from django.core.exceptions import ValidationError from django.test import TestCase from oscar.apps.offer import models, utils from oscar.test.basket import add_product from oscar.test import factories from oscar.apps.shipping import repository, methods class ExcludingTax(methods.Fi...
saurabh6790/medsyn-app
refs/heads/master
selling/doctype/opportunity/opportunity.py
28
# 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 webnotes from webnotes.utils import cstr, cint from webnotes.model.bean import getlist from webnotes import msgprint, _ from utilities.tra...
hoelsner/product-database
refs/heads/master
app/config/models.py
1
from django.core.cache import cache from django.db import models from django.db.models.signals import post_save, post_delete from django.dispatch import receiver class NotificationMessage(models.Model): """ Notifications from certain processes """ MESSAGE_ERROR = "ERR" MESSAGE_INFO = "INFO" ME...
asanfilippo7/osf.io
refs/heads/develop
website/addons/badges/views/render.py
59
import httplib as http from framework.exceptions import HTTPError from website.project.views.node import _view_project from website.project.decorators import ( # noqa must_be_contributor_or_public, must_have_addon, must_not_be_registration, must_be_valid_project, must_have_permission, ) from ..model...
taedori81/django-oscar
refs/heads/master
src/oscar/apps/partner/importers.py
11
import os from decimal import Decimal as D from django.db.transaction import atomic from django.utils.translation import ugettext_lazy as _ from oscar.apps.catalogue.categories import create_from_breadcrumbs from oscar.core.compat import UnicodeCSVReader from oscar.core.loading import get_class, get_classes Importin...
RobotLocomotion/director
refs/heads/master
distro/package/fixup_mach_o.py
1
import os import sys import subprocess import commands import re import shutil def findMachOFiles(searchPath, recursive=True): maxDepthArg = '-maxdepth 1' if not recursive else '' filenames = commands.getoutput('find "%s" %s -exec file {} \;| grep Mach-O | sed "s/:.*//"' % (searchPath, maxDepthArg)).splitlines...
FarnazH/horton
refs/heads/master
horton/meanfield/test/test_scf.py
4
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2017 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
brummer-simon/RIOT
refs/heads/master
tests/ztimer_underflow/tests/01-run.py
11
#!/usr/bin/env python3 # Copyright (C) 2020 SSV Software Systems GmbH # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys from testrunner import run def testfunc(child): child.expect_...
leedm777/ansible
refs/heads/devel
docsite/build-site.py
211
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of the Ansible Documentation # # 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 th...
AmeristralianDollar/AmeristralianDollar
refs/heads/master
share/qt/extract_strings_qt.py
2945
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
sid-kap/pants
refs/heads/master
tests/python/pants_test/tasks/test_jar_create.py
5
# coding=utf-8 # Copyright 2014 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 os from conte...
suncycheng/intellij-community
refs/heads/master
python/testData/inspections/objectBaseIsNotShownInAutoImportQuickfix/module.py
79
class MyOldStyleClass: pass
2ndy/RaspIM
refs/heads/master
usr/lib/python2.7/macpath.py
191
"""Pathname and path-related operations for the Macintosh.""" import os import warnings from stat import * import genericpath from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getc...
zhaoguixu/werkzeug
refs/heads/master
werkzeug/contrib/lint.py
128
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
nju520/django
refs/heads/master
django/templatetags/cache.py
471
from __future__ import unicode_literals from django.core.cache import InvalidCacheBackendError, caches from django.core.cache.utils import make_template_fragment_key from django.template import ( Library, Node, TemplateSyntaxError, VariableDoesNotExist, ) register = Library() class CacheNode(Node): def __in...
snnn/tensorflow
refs/heads/master
tensorflow/python/training/warm_starting_util.py
7
# 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...
pnegahdar/centralsession
refs/heads/master
tests/dj_settings.py
1
""" Django settings for bsdjango project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
Morloth1274/EVE-Online-POCO-manager
refs/heads/master
tests/test_corp.py
1
import mock from tests.compat import unittest from tests.utils import APITestCase import evelink.api as evelink_api import evelink.corp as evelink_corp API_RESULT_SENTINEL = evelink_api.APIResult(mock.sentinel.api_result, 12345, 67890) class CorpTestCase(APITestCase): def setUp(self): super(CorpTestC...
joshuajan/odoo
refs/heads/master
addons/crm_project_issue/__init__.py
386
# -*- 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 ...
bobobox/ansible
refs/heads/devel
lib/ansible/module_utils/_text.py
62
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
mzdaniel/oh-mainline
refs/heads/master
vendor/packages/Django/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: ...
negar-rostamzadeh/rna
refs/heads/master
datasets.py
1
import numpy import os import theano from fuel.streams import DataStream from fuel.datasets import H5PYDataset from fuel.schemes import ShuffledScheme from fuel.transformers import Transformer import h5py import numpy as np from StringIO import StringIO from PIL import Image import fuel.datasets from fuel import config...
denys-duchier/django
refs/heads/master
django/templatetags/cache.py
124
from django.core.cache import InvalidCacheBackendError, caches from django.core.cache.utils import make_template_fragment_key from django.template import ( Library, Node, TemplateSyntaxError, VariableDoesNotExist, ) register = Library() class CacheNode(Node): def __init__(self, nodelist, expire_time_var, fra...
eeshangarg/zulip
refs/heads/master
tools/lib/pretty_print.py
2
import subprocess from typing import Any, Dict, List from zulint.printer import ENDC, GREEN from .template_parser import is_django_block_tag, tokenize def pretty_print_html(html: str, num_spaces: int = 4) -> str: # We use 1-based indexing for both rows and columns. tokens = tokenize(html) lines = html.s...
caphrim007/ansible
refs/heads/devel
lib/ansible/utils/module_docs_fragments/mysql.py
29
# -*- coding: utf-8 -*- # Copyright (c) 2015 Jonathan Mainguy <jon@soh.re> # # 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...
mperklin/pycoin
refs/heads/master
pycoin/ecdsa/native/bignum.py
14
""" Arrange to access a shared-object version of the bignum library using Python ctypes. """ import ctypes.util import struct from pycoin.intbytes import to_bytes ULONG_FACTOR = 1 << (8 * ctypes.sizeof(ctypes.c_ulong)) def bignum_type_for_library(library): class BignumType(ctypes.Structure): """ ...
elsantodel90/RAAGo
refs/heads/master
aago_ranking/users/__init__.py
14224
# -*- coding: utf-8 -*-
Teamxrtc/webrtc-streaming-node
refs/heads/master
third_party/webrtc/src/chromium/src/third_party/webpagereplay/third_party/dns/rdtypes/IN/IPSECKEY.py
248
# Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED...
jalavik/inspire-next
refs/heads/master
inspire/modules/workflows/views/holdingpen_edit.py
2
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2015 CERN. # # INSPIRE 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) any later...
emilleishida/snclass
refs/heads/master
snclass/bin/build_synthetic_spec.py
1
# Copyright 2015 Emille Ishida # This program is distributed under the terms of the GNU General Purpose License (GPL). # Refer to http://www.gnu.org/licenses/gpl.txt # # 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 Fre...
perlygatekeeper/glowing-robot
refs/heads/master
Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_internal/vcs/versioncontrol.py
9
"""Handles all VCS (version control) support""" from __future__ import absolute_import import errno import logging import os import shutil import sys from pip._vendor import pkg_resources from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.exceptions import BadCommand from pip._internal...
heeraj123/oh-mainline
refs/heads/master
vendor/packages/twisted/doc/core/examples/gpsfix.py
19
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ GPSTest is a simple example using the SerialPort transport and the NMEA 0183 and Rockwell Zodiac GPS protocols to display fix data as it is received from the device. """ from twisted.python import log, usage import sys ...
jackowayed/google-python-class
refs/heads/master
basic/solution/string1.py
210
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
NewpTone/stacklab-nova
refs/heads/master
debian/tmp/usr/lib/python2.7/dist-packages/nova/virt/libvirt/volume.py
6
# 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/...
rizar/attention-lvcsr
refs/heads/master
libs/Theano/theano/gof/tests/test_compiledir.py
4
from theano.configdefaults import short_platform def test_short_platform(): for r, p, a in [ # (release, platform, answer) ('3.2.0-70-generic', 'Linux-3.2.0-70-generic-x86_64-with-debian-wheezy-sid', "Linux-3.2--generic-x86_64-with-debian-wheezy-sid"), ('3.2.0-70.1-generic', ...
JoshuaOndieki/dojo
refs/heads/master
models/office.py
1
from models.room import Room class Office(Room): def __init__(self,name): # super().__init__(self,name) self.name = name self.capacity = 6 self.members = []
perkinslr/pypyjs
refs/heads/master
addedLibraries/twisted/protocols/test/__init__.py
84
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Unit tests for L{twisted.protocols}. """
yongshengwang/hue
refs/heads/master
apps/oozie/src/oozie/migrations/0023_auto__add_field_node_data__add_field_job_data.py
37
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Node.data' db.add_column('oozie_node', 'data', self.gf('django.db.mode...
thomasem/nova
refs/heads/master
nova/tests/functional/v3/test_deferred_delete.py
5
# 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...
oe-alliance/oe-alliance-enigma2
refs/heads/master
lib/python/Components/Renderer/ChannelNumber.py
33
from Components.VariableText import VariableText from enigma import eLabel, iPlayableService from Renderer import Renderer ChannelNumberClasses = [] def doRenumber(): for func in ChannelNumberClasses: func(True) class ChannelNumber(Renderer, VariableText): def __init__(self): ChannelNumberClasses.append(self.ch...
stack-of-tasks/rbdlpy
refs/heads/master
tutorial/lib/python2.7/site-packages/OpenGL/GLES1/QCOM/writeonly_rendering.py
8
'''OpenGL extension QCOM.writeonly_rendering This module customises the behaviour of the OpenGL.raw.GLES1.QCOM.writeonly_rendering to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/QCOM/writeonly_rendering.txt ''' from OpenGL impo...
thresholdsoftware/asylum-v2.0
refs/heads/master
openerp/addons/base/ir/ir_values.py
31
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
yezorat/mbserializer
refs/heads/development
mbserializer/__init__.py
2
__author__ = 'Junki Ishida' from .declarations import NotExist, Entity from .models import Model, ListModel from .serializer import Serializer from ._xml import xmlnsmap, register_xmlnsmap, unregister_xmlns, unregister_prefix def __loaded(): from .models import ModelTypeBase ModelTypeBase._ModelTypeBase__mo...
abridgett/boto
refs/heads/develop
tests/unit/machinelearning/__init__.py
586
# Copyright (c) 2015 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 ...
Gitlab11/odoo
refs/heads/8.0
addons/procurement_jit_stock/__openerp__.py
241
# -*- 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...
harisbal/pandas
refs/heads/master
asv_bench/benchmarks/io/sas.py
5
import os from pandas import read_sas class SAS(object): params = ['sas7bdat', 'xport'] param_names = ['format'] def setup(self, format): # Read files that are located in 'pandas/io/tests/sas/data' files = {'sas7bdat': 'test1.sas7bdat', 'xport': 'paxraw_d_short.xpt'} file = file...
LesButchart/Source-Code
refs/heads/master
share/qt/clean_mac_info_plist.py
635
#!/usr/bin/env python # Jonas Schnelli, 2013 # make sure the Bitcoin-Qt.app contains the right plist (including the right version) # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) from string import Template from datetime import date bitcoinDir = "./"; inF...
keithhendry/treadmill
refs/heads/master
treadmill/sproc/service.py
3
"""Runs the Treadmill localdisk service.""" import logging import os import click from .. import services _LOGGER = logging.getLogger(__name__) def init(): """Top level command line handler.""" local_ctx = {} @click.group() @click.option('--root-dir', type=click.Path(exists=True), ...
lancezlin/ml_template_py
refs/heads/master
lib/python2.7/site-packages/prompt_toolkit/clipboard/pyperclip.py
27
from __future__ import absolute_import, unicode_literals import pyperclip from prompt_toolkit.selection import SelectionType from .base import Clipboard, ClipboardData __all__ = ( 'PyperclipClipboard', ) class PyperclipClipboard(Clipboard): """ Clipboard that synchronizes with the Windows/Mac/Linux syst...
mnieber/shared-goal
refs/heads/master
django/goal/management/commands/initdb.py
2
from django.conf import settings from django.core.management.base import BaseCommand from django.core import management # from django.core.management.base import CommandError class Command(BaseCommand): help = ( 'Creates empty database tables' ) def add_arguments(self, parser): pass ...
puzan/ansible
refs/heads/devel
lib/ansible/modules/network/vyos/vyos_config.py
6
#!/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 distribut...
nicoddemus/pytest
refs/heads/master
testing/code/test_source.py
1
# flake8: noqa # disable flake check on this file because some constructs are strange # or redundant on purpose and can't be disable on a line-by-line basis import ast import inspect import linecache import sys import textwrap from pathlib import Path from types import CodeType from typing import Any from typing import...
NicoVarg99/daf-recipes
refs/heads/master
ckan/ckan/ckanext-dcatapit/ckanext/dcatapit/commands/dcatapit.py
1
import logging import re import ckan.plugins.toolkit as toolkit import ckanext.dcatapit.interfaces as interfaces from pylons import config from ckan.lib.cli import CkanCommand from rdflib import Graph from rdflib.namespace import SKOS, DC from ckanext.dcat.profiles import namespaces LANGUAGE_THEME_NAME = 'language...
kanagasabapathi/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/encodings/idna.py
53
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep) import stringprep, re, codecs from unicodedata import ucd_3_2_0 as unicodedata # IDNA section 3.1 dots = re.compile("[\u002E\u3002\uFF0E\uFF61]") # IDNA section 5 ace_prefix = b"xn--" sace_prefix = "xn--" # This assumes query strings, so AllowUnassig...
strahlex/machinekit
refs/heads/master
src/machinetalk/proto/python/machinetalk/protobuf/firmware_pb2.py
9
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: machinetalk/protobuf/firmware.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf impor...
cntnboys/302-project
refs/heads/master
Webapps/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py
155
import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. Each retry attempt will create a new Re...
MrSenko/Kiwi
refs/heads/master
tcms/testcases/tests/test_views.py
2
# -*- coding: utf-8 -*- # pylint: disable=invalid-name, too-many-ancestors # pylint: disable=objects-update-used import unittest from http import HTTPStatus from django.forms import ValidationError from django.urls import reverse from django.utils.translation import gettext_lazy as _ from tcms.management.models impo...
pandeyadarsh/sympy
refs/heads/master
sympy/ntheory/partitions_.py
58
from __future__ import print_function, division from mpmath.libmp import (fzero, from_man_exp, from_int, from_rational, fone, fhalf, bitcount, to_int, to_str, mpf_mul, mpf_div, mpf_sub, mpf_add, mpf_sqrt, mpf_pi, mpf_cosh_sinh, pi_fixed, mpf_cos) from sympy.core.numbers import igcd import math from sympy.c...
enilsen16/python
refs/heads/master
web_crawling/wikispider/wikispider/spiders/articleSpider.py
1
from scrapy.contrib.spiders import CrawlSpider, Rule from wikispider.items import Article from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor class ArticleSpider(CrawlSpider): #log.start(logfile='log.txt', loglevel=log.CRITICAL) name = "article" allowed_domains = ["en.wikipedia.org"] star...
sssemil/cjdns
refs/heads/socket
node_build/dependencies/libuv/build/gyp/test/win/gyptest-cl-pdbname-override.py
266
#!/usr/bin/env python # Copyright (c) 2012 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. """ Make sure pdb is named as expected (shared between .cc files). """ import TestGyp import sys if sys.platform == 'win32': test = Tes...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/types/customer_negative_criterion_service.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
haripradhan/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/distutils/fcompiler/none.py
94
from numpy.distutils.fcompiler import FCompiler compilers = ['NoneFCompiler'] class NoneFCompiler(FCompiler): compiler_type = 'none' description = 'Fake Fortran compiler' executables = {'compiler_f77' : None, 'compiler_f90' : None, 'compiler_fix' : None, ...
aavanian/bokeh
refs/heads/master
sphinx/source/docs/user_guide/examples/styling_legend_label_text.py
62
import numpy as np from bokeh.plotting import output_file, figure, show x = np.linspace(0, 4*np.pi, 100) y = np.sin(x) output_file("legend_labels.html") p = figure() p.circle(x, y, legend="sin(x)") p.line(x, y, legend="sin(x)") p.line(x, 2*y, legend="2*sin(x)", line_dash=[4, 4], line_color="orange", line_wi...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/streamtube/hoverlabel/font/_familysrc.py
1
import _plotly_utils.basevalidators class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="familysrc", parent_name="streamtube.hoverlabel.font", **kwargs ): super(FamilysrcValidator, self).__init__( plotly_name=...
tfroehlich82/EventGhost
refs/heads/master
eg/Core.py
2
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
victor-rene/MicroScada
refs/heads/master
archive/day_15/datepicker.py
1
import datetime from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.properties import NumericProperty from preferences import Preferences class DatePicker(GridLayout): year = NumericProperty(datetime.datetime.now().year) month = NumericProperty(...
rpm-software-management/yum-utils
refs/heads/master
plugins/versionlock/versionlock.py
1
# 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) any later version. # # This program is distributed in the hope that it will be useful, # bu...
hortonworks/hortonworks-sandbox
refs/heads/master
desktop/core/ext-py/Django-1.2.3/tests/modeltests/transactions/models.py
11
""" 15. Transactions Django handles transactions in three different ways. The default is to commit each transaction upon a write, but you can decorate a function to get commit-on-success behavior. Alternatively, you can manage the transaction manually. """ from django.db import models, DEFAULT_DB_ALIAS class Reporte...
RockinRoel/FrameworkBenchmarks
refs/heads/master
frameworks/Python/pyramid/frameworkbenchmarks/models.py
56
""" Benchmark models. """ import json import os import psycopg2 from collections import Iterable from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String from sqlalchemy.orm import sessionmaker from sqlalchemy.pool import QueuePool from sqlalchemy.ext.declarative import declarative_base, Declarat...
bolabola/PTVS
refs/heads/master
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/gbk.py
61
# # gbk.py: Python Unicode Codec for GBK # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gbk') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multibyte...
dchilds7/Deysha-Star-Formation
refs/heads/master
examples/basics/scene/colorbar_widget.py
11
# -*- coding: utf-8 -*- # vispy: gallery 30 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------...
SimenB/thefuck
refs/heads/master
tests/shells/test_powershell.py
3
# -*- coding: utf-8 -*- import pytest from thefuck.shells import Powershell @pytest.mark.usefixtures('isfile', 'no_memoize', 'no_cache') class TestPowershell(object): @pytest.fixture def shell(self): return Powershell() @pytest.fixture(autouse=True) def Popen(self, mocker): mock = mo...
bmya/margin-analysis
refs/heads/8.0
product_cost_incl_costs_without_bom/__init__.py
6
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2012 Camptocamp SA # Copyright 2012 Endian Solutions BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License ...
palindromed/data-structures2
refs/heads/master
src/merge_sort.py
1
# _*_ encoding: utf-8 _*_ """Implementation of a merge sort algorithm""" import timeit def merge_sort(vals): if len(vals) <= 1: return vals left = merge_sort(vals[::2]) right = merge_sort(vals[1::2]) return merge(left, right) def merge(left, right): result = [] l_ind = 0 r_ind = 0...
thaim/ansible
refs/heads/fix-broken-link
lib/ansible/modules/web_infrastructure/taiga_issue.py
47
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Alejandro Guirao <lekumberri@gmail.com> # 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_version': '1....
bealdav/OpenUpgrade
refs/heads/8.0
addons/hw_escpos/__init__.py
385
# -*- 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...
caporaso-lab/tax-credit
refs/heads/master
tax_credit/tests/test_eval_framework.py
4
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright (c) 2014--, tax-credit development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ---------------------...
zchking/odoo
refs/heads/8.0
openerp/cli/deploy.py
369
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import requests import sys import tempfile import zipfile from . import Command class Deploy(Command): """Deploy a module on an Odoo instance""" def __init__(self): super(Deploy, self).__init__() self.session = requests.se...
brian-yang/mozillians
refs/heads/master
vendor-local/lib/python/unidecode/x1d4.py
248
data = ( 'A', # 0x00 'B', # 0x01 'C', # 0x02 'D', # 0x03 'E', # 0x04 'F', # 0x05 'G', # 0x06 'H', # 0x07 'I', # 0x08 'J', # 0x09 'K', # 0x0a 'L', # 0x0b 'M', # 0x0c 'N', # 0x0d 'O', # 0x0e 'P', # 0x0f 'Q', # 0x10 'R', # 0x11 'S', # 0x12 'T', # 0x13 'U', # 0...
rgayon/plaso
refs/heads/master
tests/lib/bufferlib.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the circular buffer for storing event objects.""" from __future__ import unicode_literals import unittest from plaso.lib import bufferlib class CircularBufferTest(unittest.TestCase): """Tests for the circular buffer for storing event objects.""" def ...
int19h/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/multiprocessing/popen_spawn_win32.py
5
import os import msvcrt import signal import sys import _winapi from .context import reduction, get_spawning_popen, set_spawning_popen from . import spawn from . import util __all__ = ['Popen'] # # # TERMINATE = 0x10000 WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False)) WINSERVICE = sys.executable...
KanoComputing/kano-burners
refs/heads/master
src/osx/burn.py
1
#!/usr/bin/env python # burn.py # # Copyright (C) 2014,2015 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 # # # OSX - Burning Kano OS module # # The burning process consists of two tasks: one for writing # and one for progress polling. # # The writing (burning) th...
rhndg/openedx
refs/heads/master
pavelib/paver_tests/test_paver_get_quality_reports.py
56
import os import tempfile import unittest from mock import patch, Mock from ddt import ddt, file_data import pavelib.quality import paver.easy from paver.easy import BuildFailure class TestGetReportFiles(unittest.TestCase): """ Ensure only the report files we want are returned as part of run_quality. """...
emedinaa/contentbox
refs/heads/master
third_party/django/conf/urls/static.py
323
import re from django.conf import settings from django.conf.urls import patterns, url from django.core.exceptions import ImproperlyConfigured def static(prefix, view='django.views.static.serve', **kwargs): """ Helper function to return a URL pattern for serving files in debug mode. from django.conf import...
diagramsoftware/odoo
refs/heads/8.0
addons/web/tests/test_js.py
338
import openerp.tests class WebSuite(openerp.tests.HttpCase): def test_01_js(self): self.phantom_js('/web/tests?mod=web',"","", login='admin')
nordam/PyPPT
refs/heads/master
python_scripts/alpha_v/transport.py
1
# script with functions to use in main # this script handle the "transport of particles"-part # Simen Mikkelsen, 2016-11-19 # transport.py ''' def timestep(X, dt, t): # Use double gyre and RK4 to calculate new functions return X ''' import numpy as np ## INITIALISING start ## INITIALISI...
chromium/chromium
refs/heads/master
third_party/jinja2/runtime.py
74
# -*- coding: utf-8 -*- """ jinja2.runtime ~~~~~~~~~~~~~~ Runtime helpers. :copyright: (c) 2017 by the Jinja Team. :license: BSD. """ import sys from itertools import chain from types import MethodType from jinja2.nodes import EvalContext, _context_function_types from jinja2.utils import Markup,...
ilastikdev/ilastik
refs/heads/master
bin/mac_execfile.py
4
""" This script simply executes the python file provided as the first argument. It basically provides the same functionality as the normal python interpreter, but without many of the options python provides. It is useful as a means to execute arbitrary scripts in the mac binary. This file is passed to py2app via t...
crazcalm/AngelHack_python34
refs/heads/master
myenv/Lib/site-packages/setuptools/tests/test_svn.py
73
# -*- coding: utf-8 -*- """svn tests""" import os import sys import unittest import codecs import subprocess from setuptools.tests import environment from setuptools.compat import unicode, unichr from setuptools import svn_utils from setuptools.tests.py26compat import skipIf def _do_svn_check(): try: s...
turbokongen/home-assistant
refs/heads/dev
homeassistant/components/light/device_trigger.py
19
"""Provides device trigger for lights.""" from typing import List import voluptuous as vol from homeassistant.components.automation import AutomationActionType from homeassistant.components.device_automation import toggle_entity from homeassistant.const import CONF_DOMAIN from homeassistant.core import CALLBACK_TYPE,...
mgadi/naemonbox
refs/heads/master
sources/psdash/Jinja2-2.4/jinja2/testsuite/tests.py
29
# -*- coding: utf-8 -*- """ jinja2.testsuite.tests ~~~~~~~~~~~~~~~~~~~~~~ Who tests the tests? :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment env = Environm...