repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tillrohrmann/flink | refs/heads/master | flink-python/pyflink/common/restart_strategy.py | 11 | ################################################################################
# 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... |
StrellaGroup/erpnext | refs/heads/develop | erpnext/patches/v12_0/set_default_for_add_taxes_from_item_tax_template.py | 1 | import frappe
def execute():
frappe.db.set_value("Accounts Settings", None, "add_taxes_from_item_tax_template", 1)
frappe.db.set_default("add_taxes_from_item_tax_template", 1) |
grpc/grpc | refs/heads/master | src/python/grpcio/grpc/framework/foundation/stream_util.py | 26 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
BMJHayward/django | refs/heads/master | django/contrib/admindocs/middleware.py | 477 | from django import http
from django.conf import settings
class XViewMiddleware(object):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
"""
If the request method is HEAD and... |
TheLady/python-livereload | refs/heads/master | livereload/server.py | 3 | # -*- coding: utf-8 -*-
"""
livereload.server
~~~~~~~~~~~~~~~~~
WSGI app server for livereload.
:copyright: (c) 2013 - 2015 by Hsiaoming Yang
:license: BSD, see LICENSE for more details.
"""
import os
import time
import shlex
import logging
import threading
import webbrowser
from subprocess impor... |
dhennes/pykep | refs/heads/master | PyKEP/examples/_ex6.py | 5 | def run_example6(n_seg=5):
"""
This example demonstrates the optimization of a multiple randezvous mission (low-thrust).
Such a mission (including more asteroids) is also called asteroid hopping
The spacecraft performances, as well as the three asteroids visited, are taken from the GTOC7 problem descri... |
ruslanloman/nova | refs/heads/master | nova/tests/functional/v3/test_flavor_manage.py | 31 | # 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... |
ManjiriBirajdar/coala | refs/heads/master | coalib/collecting/Collectors.py | 4 | import functools
import os
import pkg_resources
import itertools
from pyprint.NullPrinter import NullPrinter
from coalib.bears.BEAR_KIND import BEAR_KIND
from coalib.collecting.Importers import iimport_objects
from coala_utils.decorators import yield_once
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
from co... |
JustAkan/lge-kernel-gproj | refs/heads/cm-12.1 | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
lukeis/selenium | refs/heads/master | py/selenium/webdriver/remote/errorhandler.py | 2 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
acarmel/CouchPotatoServer | refs/heads/master | couchpotato/core/media/_base/matcher/__init__.py | 81 | from .main import Matcher
def autoload():
return Matcher()
config = []
|
jayclassless/tidypy | refs/heads/master | test/test_finder.py | 1 | # -*- coding: utf-8 -*-
import os
import sys
from tidypy import Finder, get_default_config
def fix_paths(paths):
if sys.platform == 'win32':
paths = [
path.replace('/', '\\')
for path in paths
]
return paths
def test_exclude():
if hasattr(os, 'mkfifo') and not os... |
jmesteve/saas3 | refs/heads/master | openerp/addons_extra/account_vat_extend/account_vat.py | 1 | # -*- 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... |
CCPorg/WWW-InternetCoin-Ver-631-Original | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
ILiedAboutCake/twitchAPI | refs/heads/master | scrape.py | 1 | #Requires https://github.com/adoxa/ansicon to run on windows cmd (cleanly) -ILiedAboutCake 2015.
#also needs requests library on windows, get it with "python -m pip install -U requests"
import threading
import urllib2
import Queue
import time
import json
import csv
strims = ['destiny', 'nathanias', 'nl_kripp', 'phant... |
jolyonb/edx-platform | refs/heads/master | openedx/core/djangoapps/catalog/migrations/0002_catalogintegration_username.py | 2 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='catalogintegration... |
adelton/django | refs/heads/master | tests/template_tests/test_engine.py | 199 | import os
from django.template import Context
from django.template.engine import Engine
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from .utils import ROOT, TEMPLATE_DIR
OTHER_DIR = os.path.join(ROOT, 'other_templates')
@ignore_warnings(cat... |
betoesquivel/fil2014 | refs/heads/master | filenv/lib/python2.7/site-packages/south/v2.py | 94 | """
API versioning file; we can tell what kind of migrations things are
by what class they inherit from (if none, it's a v1).
"""
from south.utils import ask_for_it_by_name
class BaseMigration(object):
def gf(self, field_name):
"Gets a field by absolute reference."
field = ask_for_it_by_name(... |
bitcraft/pyglet | refs/heads/master | tests/interactive/window/event_button.py | 1 | """Test that mouse button events work correctly.
Expected behaviour:
One window will be opened. Click within this window and check the console
output for mouse events.
- Buttons 1, 2, 4 correspond to left, middle, right, respectively.
- No events for scroll wheel
- Modifiers are correct
Cl... |
goodhacker/enjarify | refs/heads/master | enjarify/jvm/optimization/__init__.py | 178 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
matthewelse/micropython | refs/heads/emscripten | tests/basics/class_binop.py | 116 | class foo(object):
def __init__(self, value):
self.x = value
def __eq__(self, other):
print('eq')
return self.x == other.x
def __lt__(self, other):
print('lt')
return self.x < other.x
def __gt__(self, other):
print('gt')
return self.x > other.x
... |
AlexRobson/nilmtk | refs/heads/master | nilmtk/utils.py | 3 | from __future__ import print_function, division
import numpy as np
import pandas as pd
import networkx as nx
from copy import deepcopy
from os.path import isdir, dirname, abspath
from os import getcwd
from inspect import currentframe, getfile, getsourcefile
from sys import getfilesystemencoding, stdout
from IPython.cor... |
alexmorozov/django | refs/heads/master | tests/utils_tests/test_tree.py | 429 | import copy
import unittest
from django.utils.tree import Node
class NodeTests(unittest.TestCase):
def setUp(self):
self.node1_children = [('a', 1), ('b', 2)]
self.node1 = Node(self.node1_children)
self.node2 = Node()
def test_str(self):
self.assertEqual(str(self.node1), "(DE... |
subutai/nupic.research | refs/heads/master | nupic/research/frameworks/vernon/mixins/oml.py | 2 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, 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... |
chillbu/cblib | refs/heads/master | thirdparty/gtest-1.7.0/test/gtest_xml_output_unittest.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
yorkie/node-gyp | refs/heads/master | 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',
... |
mlperf/inference_results_v0.7 | refs/heads/master | closed/Lenovo/code/ssd-mobilenet/tensorrt/preprocess_data.py | 12 | #!/usr/bin/python3
# Copyright (c) 2020, NVIDIA CORPORATION. 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
#
# ... |
svn2github/django | refs/heads/master | django/contrib/sitemaps/tests/base.py | 87 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.test import TestCase
class SitemapTestsBase(TestCase):
protocol = 'http'
domain = 'example.com' if Site._meta.installed else 'testserver'
urls = 'django.contrib.... |
icebreaker/Templatizer-Templates | refs/heads/master | python-cmdapp/app.py | 1 | #!/usr/bin/env python
__author__ = '%AUTHOR%'
__description__ = '%DESCRIPTION%'
__version__ = (0, 1, 0)
__license__ = '%LICENSE%'
import sys
import os
import logging
def main(argv):
""" Main """
if len(argv) < 2:
print('%NAME% v%d.%d.%d' % __version__)
print('usage: %s [options]' % os.path.splitext(os.path.... |
andrewyoung1991/scons | refs/heads/master | test/MSVS/vs-8.0-variant_dir.py | 5 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... |
blueprintmrk/graphy | refs/heads/master | graphy/backends/google_chart_api/__init__.py | 205 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
everestial/g2gtools | refs/heads/master | g2gtools/bed.py | 1 | # -*- coding: utf-8 -*-
#
# Collection of functions related to BED files
#
# 0-based
#
from collections import namedtuple
from .chain import ChainFile
from .exceptions import G2GBedError, G2GLocationError
from .g2g_utils import get_logger
import g2g_fileutils as g2g_fu
LOG = get_logger()
bed_fields = ["chrom", "st... |
laiqiqi886/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/tkinter/filedialog.py | 108 | """File selection dialog classes.
Classes:
- FileDialog
- LoadFileDialog
- SaveFileDialog
This module also presents tk common file dialogues, it provides interfaces
to the native file dialogues available in Tk 4.2 and newer, and the
directory dialogue available in Tk 8.3 and newer.
These interfaces were written by F... |
dgladkov/django | refs/heads/master | tests/order_with_respect_to/models.py | 61 | """
Tests for the order_with_respect_to Meta attribute.
"""
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Question(models.Model):
text = models.CharField(max_length=200)
@python_2_unicode_compatible
class Answer(models.Model):
... |
misterdanb/micropython | refs/heads/master | tests/basics/dict_setdefault.py | 116 | d = {}
print(d.setdefault(1))
print(d.setdefault(1))
print(d.setdefault(5, 42))
print(d.setdefault(5, 1))
print(d[1])
print(d[5])
d.pop(5)
print(d.setdefault(5, 1))
print(d[1])
print(d[5])
|
objmagic/heron | refs/heads/master | heron/common/src/python/utils/misc/pplan_helper.py | 8 | # Copyright 2016 Twitter. 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 applicable law or agree... |
slevenhagen/odoo-npg | refs/heads/8.0 | addons/l10n_ca/__openerp__.py | 260 | # -*- encoding: 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 G... |
StefanRijnhart/odoo | refs/heads/master | addons/website_sale_delivery/__openerp__.py | 321 | {
'name': 'eCommerce Delivery',
'category': 'Website',
'summary': 'Add Delivery Costs to Online Sales',
'website': 'https://www.odoo.com/page/e-commerce',
'version': '1.0',
'description': """
Delivery Costs
==============
""",
'author': 'OpenERP SA',
'depends': ['website_sale', 'delivery... |
oculusstorystudio/kraken | refs/heads/develop_OSS | Python/kraken/core/maths/mat33.py | 1 | """Kraken - maths.matrix module.
Classes:
Mat33 -- Matrix 3 transform object.
"""
from kraken.core.kraken_system import ks
from kraken.core.maths.math_object import MathObject
from kraken.core.maths.vec3 import Vec3
class Mat33(MathObject):
"""3x3 Matrix object."""
def __init__(self, row0=None, row1=None, ... |
chienlieu2017/it_management | refs/heads/master | odoo/addons/pos_discount/__init__.py | 1516 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import models
|
Chasego/codi | refs/heads/master | leetcode/209-Minimum-Size-Subarray-Sum/MinSizeSubarrSum_001.py | 5 | class Solution(object):
def minSubArrayLen(self, s, nums):
"""
:type s: int
:type nums: List[int]
:rtype: int
"""
i, j = 0, 0
tmp, res = 0, len(nums)
if sum(nums) < s:
return 0
while j < len(nums):
if tmp < s:
... |
HonzaKral/django | refs/heads/master | tests/utils_tests/test_safestring.py | 278 | from __future__ import unicode_literals
from django.template import Context, Template
from django.test import SimpleTestCase
from django.utils import html, six, text
from django.utils.encoding import force_bytes, force_text
from django.utils.functional import lazy
from django.utils.safestring import (
EscapeData, ... |
BirkbeckCTP/janeway | refs/heads/master | src/core/templatetags/article.py | 1 | from django import template
register = template.Library()
@register.simple_tag()
def article_active_user_review(request, article):
return article.active_review_request_for_user(request.user)
|
vnsofthe/odoo | refs/heads/8.0 | addons/account/wizard/account_invoice_state.py | 340 | # -*- 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... |
ODM2/ODMToolsPython | refs/heads/master | odmtools/gui/pnlScript.py | 1 | import os
import wx
from wx.lib.pubsub import pub as Publisher
from odmtools.controller import odmHighlightSTC
ID_NEW = 101
ID_OPEN = 102
ID_SAVE = 103
ID_SAVE_AS = 104
ID_EXECUTE_BUTTON = 300
ID_EXECUTE_SELECTION_BUTTON = 301
ID_EXECUTE_LINE_BUTTON = 302
#wildcard = "Python Source (*.py, .py)|*" #All files (*.*)|... |
marco-lancini/Showcase | refs/heads/master | django/middleware/common.py | 157 | import re
from django.conf import settings
from django import http
from django.core.mail import mail_managers
from django.utils.http import urlquote
from django.core import urlresolvers
from django.utils.hashcompat import md5_constructor
from django.utils.log import getLogger
logger = getLogger('django.request')
cl... |
MoRgUiJu/morguiju.repo | refs/heads/master | plugin.video.pelisalacarta/core/logger.py | 4 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# --... |
chugle/myapp | refs/heads/master | gluon/html.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import cgi
import os
import re
import copy
import types
import urllib
import base64
import sanitizer
im... |
skonto/spark | refs/heads/master | python/pyspark/tests/test_util.py | 20 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
frew/simpleproto | refs/heads/master | scons-local-1.1.0/SCons/Tool/dmd.py | 1 | """SCons.Tool.dmd
Tool-specific initialization for the Digital Mars D compiler.
(http://digitalmars.com/d)
Coded by Andy Friesen (andy@ikagames.com)
15 November 2003
There are a number of problems with this script at this point in time.
The one that irritates me the most is the Windows linker setup. The D
linker do... |
jonathan-beard/edx-platform | refs/heads/master | lms/djangoapps/discussion_api/serializers.py | 41 | """
Discussion API serializers
"""
from urllib import urlencode
from urlparse import urlunparse
from django.contrib.auth.models import User as DjangoUser
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from rest_framework import serializers
from discussion_api.permissi... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/inline_formsets/models.py | 133 | from django.db import models
class School(models.Model):
name = models.CharField(max_length=100)
class Parent(models.Model):
name = models.CharField(max_length=100)
class Child(models.Model):
mother = models.ForeignKey(Parent, models.CASCADE, related_name='mothers_children')
father = models.Foreig... |
collex100/odoo | refs/heads/8.0 | addons/website_forum/__init__.py | 363 | # -*- coding: utf-8 -*-
import controllers
import models
import tests
|
praveendath92/fitgoal | refs/heads/master | migrations/env.py | 557 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... |
rooshilp/CMPUT410Lab6 | refs/heads/master | virt_env/virt1/lib/python2.7/site-packages/django/test/simple.py | 51 | """
This module is pending deprecation as of Django 1.6 and will be removed in
version 1.8.
"""
from importlib import import_module
import json
import re
import unittest as real_unittest
import warnings
from django.apps import apps
from django.test import _doctest as doctest
from django.test import runner
from django... |
yigitguler/django | refs/heads/master | django/contrib/gis/geos/prototypes/errcheck.py | 48 | """
Error checking functions for GEOS ctypes prototype functions.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the `free` routine used to free the memory allocated for
# string pointers ... |
boyers/hamlit | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 899 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... |
sssemil/cjdns | refs/heads/socket | node_build/dependencies/libuv/build/gyp/test/multiple-targets/gyptest-default.py | 102 | #!/usr/bin/env python
# Copyright (c) 2009 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.
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('multiple.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.build('multi... |
RCMRD/geonode | refs/heads/master | geonode/contrib/geosites/site_template/local_settings_template.py | 21 | # flake8: noqa
# -*- coding: utf-8 -*-
###############################################
# Geosite local settings
###############################################
import os
# Outside URL
SITEURL = 'http://$DOMAIN'
# databases unique to site if not defined in site settings
"""
SITE_DATABASES = {
'default': {
... |
kefatong/ops | refs/heads/master | app/main/ansible_tasks.py | 1 | # coding:utf8
import re
import os
import stat
import json
import Queue
import hashlib
import ansible
import ansible.runner
import ansible.playbook
from ansible import callbacks
from ansible import utils
from flask import flash, redirect, url_for
def command_runner(user, command, inventory, view):
if re.findall(... |
abourget/gevent-socketio | refs/heads/master | examples/pyramid_backbone_redis_chat_persistence/setup.py | 11 | import os
import sys
from setuptools import setup, find_packages, Command
here = os.path.abspath(os.path.dirname(__file__))
def _read(path):
with open(path) as f:
data = f.read()
f.close()
return data
README = ''
CHANGES = ''
requires = ['pyramid', 'gevent', 'gevent-socketio', 'sqlalchemy', '... |
bloomark/python-dogecoinlib | refs/heads/master | dogecoin/tests/test_key.py | 1 | # Copyright (C) 2013-2014 The python-dogecoinlib developers
#
# This file is part of python-dogecoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-dogecoinlib, including this file, may be copied, modified,
# propagated, or d... |
daviddrysdale/python-phonenumbers | refs/heads/dev | python/phonenumbers/data/region_IS.py | 1 | """Auto-generated file, do not edit by hand. IS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IS = PhoneMetadata(id='IS', country_code=354, international_prefix='00|1(?:0(?:01|[12]0)|100)',
general_desc=PhoneNumberDesc(national_number_pattern='(?:38\\d|[4-9])\\... |
the-fascinator/fascinator-portal | refs/heads/master | src/main/config/portal/default/default/scripts/settings.py | 1 | from com.googlecode.fascinator.api import PluginManager
from com.googlecode.fascinator.common import JsonSimpleConfig
from com.googlecode.fascinator.portal import Portal
from java.io import File
from java.util import HashMap
class SettingsData:
def __init__(self):
self.sysConfig = JsonSimpleConfig()
... |
nolanliou/tensorflow | refs/heads/master | tensorflow/contrib/layers/python/layers/target_column.py | 125 | # 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... |
jsoref/django | refs/heads/master | django/db/models/__init__.py | 66 | from functools import wraps
from django.core.exceptions import ObjectDoesNotExist # NOQA
from django.db.models import signals # NOQA
from django.db.models.aggregates import * # NOQA
from django.db.models.deletion import ( # NOQA
CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedError,
)
from d... |
Comunitea/CMNT_00098_2017_JIM_addons | refs/heads/master | default_partner_by_type/__manifest__.py | 1 | # -*- coding: utf-8 -*-
# © 2016 Comunitea - Kiko Sánchez <kiko@comunitea.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Default partner by type',
'version': '10.0.0.0.0',
'author': 'Comunitea ',
"category": "Custom",
'license': 'AGPL-3',
'depends': [
'base... |
robmyers/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/image.py | 203 | import os
from .. import constants, logger
from . import base_classes, io, api
class Image(base_classes.BaseNode):
"""Class the wraps an image node. This is the node that
represent that actual file on disk.
"""
def __init__(self, node, parent):
logger.debug("Image().__init__(%s)", node)
... |
miyuchina/mistletoe | refs/heads/master | setup.py | 1 | from setuptools import setup
import mistletoe
setup(name='mistletoe',
version=mistletoe.__version__,
description='A fast, extensible Markdown parser in pure Python.',
url='https://github.com/miyuchina/mistletoe',
author='Mi Yu',
author_email='hello@afteryu.me',
license='MIT',
... |
ryandougherty/mwa-capstone | refs/heads/heroku | MWA_Tools/mwapy/find_external.py | 2 |
import logging, sys, os, glob, subprocess, string, re, urllib, math, time
# configure the logging
logging.basicConfig(format='# %(levelname)s:%(name)s: %(message)s')
logger=logging.getLogger('find_external')
logger.setLevel(logging.WARNING)
def find_external(external_programs):
# go through and find the external... |
jcrugzz/lpvisualization | refs/heads/master | django/views/decorators/vary.py | 307 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified heade... |
andrewleech/SickRage | refs/heads/master | lib/js2py/translators/translating_nodes.py | 27 | from __future__ import unicode_literals
from .pyjsparserdata import *
from .friendly_nodes import *
import random
import six
if six.PY3:
from functools import reduce
xrange = range
unicode = str
# number of characters above which expression will be split to multiple lines in order to avoid python parser st... |
alkyl1978/gnuradio | refs/heads/master | gr-filter/examples/synth_filter.py | 58 | #!/usr/bin/env python
#
# Copyright 2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... |
Technocaveman/There-is-no-Third-Step | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/emacs.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.emacs
~~~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by Emacs.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import ... |
denovator/myfriki | refs/heads/master | lib/flask/flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.py | 629 | from flask import Blueprint, render_template
frontend = Blueprint('frontend', __name__, template_folder='templates')
@frontend.route('/')
def index():
return render_template('frontend/index.html')
|
dongritengfei/phantomjs | refs/heads/master | src/qt/qtwebkit/Source/ThirdParty/gtest/test/run_tests_util_test.py | 233 | #!/usr/bin/env python
#
# Copyright 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... |
ondra-novak/chromium.src | refs/heads/nw | build/android/pylib/utils/time_profile.py | 166 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
class TimeProfile(object):
"""Class for simple profiling of action, with logging of cost."""
def __init__(self, descrip... |
hanfang/scikit-ribo | refs/heads/master | scripts/NProt2013/Enrichment_efficiency.py | 1 | """
Supplementary Note 14: Enrichment efficiency
Author: Annemarie Becker
inputFile1:
RPM-normalized read densities along the whole genome or in protein coding regions on plus or minus strand from sample 1 (Supplementary Note 7 or 8)
col0: position along genome
col1: RPM-normalized read density at t... |
google-code-export/los-cocos | refs/heads/master | samples/jumping_lens.py | 3 | #
# cocos2d
# http://cocos2d.org
#
from __future__ import division, print_function, unicode_literals
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import pyglet
from cocos.director import director
from cocos.scene import Scene
from cocos.layer import Layer
from cocos.actions... |
rajanandakumar/DIRAC | refs/heads/integration | FrameworkSystem/private/logging/backends/PrintBackend.py | 7 | # $HeadURL$
__RCSID__ = "$Id$"
""" This backend just print the log messages through the standar output
"""
from DIRAC.FrameworkSystem.private.logging.backends.BaseBackend import BaseBackend
from DIRAC.Core.Utilities import LogColoring
class PrintBackend( BaseBackend ):
def doMessage( self, messageObject ):
msg ... |
lazaronixon/enigma2 | refs/heads/master | lib/python/Plugins/Extensions/TuxboxPlugins/pluginrunner.py | 73 | from enigma import eDBoxLCD, eRCInput, fbClass, eConsoleAppContainer
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
class PluginRunner(Screen):
skin = """
<screen position="1,1" size="1,1" title="Plugin" >
</screen>"""
def __init__(self, session, pluginname, args = None):
sel... |
cybojenix/SlimBot | refs/heads/slimbot | disabled_stuff/steam.py | 6 | import re
from bs4 import BeautifulSoup, NavigableString, Tag
from util import hook, http, web
from util.text import truncate_str
steam_re = (r'(.*:)//(store.steampowered.com)(:[0-9]+)?(.*)', re.I)
def get_steam_info(url):
page = http.get(url)
soup = BeautifulSoup(page, 'lxml', from_encoding="utf-8")
... |
ebu/radiodns-plugit | refs/heads/develop | RadioDns-PlugIt/alembic/versions/33bc6fe131c7_added_shortdescripti.py | 1 | """Added shortDescription
Revision ID: 33bc6fe131c7
Revises: 314a9041017e
Create Date: 2014-06-03 17:25:44.348465
"""
# revision identifiers, used by Alembic.
revision = '33bc6fe131c7'
down_revision = '314a9041017e'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by A... |
sivel/ansible | refs/heads/devel | test/units/module_utils/common/validation/test_check_mutually_exclusive.py | 44 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 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
import pytest
from ansible.module_utils._text import to_native
from ansible.m... |
wweiradio/django-guardian | refs/heads/master | example_project/core/models.py | 42 | from django.contrib.auth.models import AbstractUser
from django.db import models
class CustomUser(AbstractUser):
birth_date = models.DateField(null=True, blank=True)
|
drmateo/ecto | refs/heads/master | test/scripts/throw_in_interpreter_thread.py | 4 | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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
# not... |
Anccerson/PyAlgorithm | refs/heads/master | ugly_number.py | 1 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import deque
def ugly(n):
min_q = 1
queue_2 = deque([2])
queue_3 = deque([3])
queue_5 = deque([5])
for _ in range(1, n):
min_q = min(queue_2[-1], queue_3[-1], queue_5[-1])
if min_q == queue_2[-1]:
queue_2.... |
b-me/cmsplugin-contact | refs/heads/master | cmsplugin_contact/migrations/0005_auto__del_field_contact_content_label__del_field_contact_subject_label.py | 9 | # -*- 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):
# Deleting field 'Contact.content_label'
db.delete_column(u'cmsplugin_contact', 'content_label')
# ... |
brianwoo/django-tutorial | refs/heads/master | build/Django/build/lib.linux-x86_64-2.7/django/contrib/gis/db/backends/postgis/creation.py | 87 | from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEOMETRY_OPS'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
def sql_indexes_for_field(self, model, f, style):
"Return any spatial ... |
hkff/FodtlMon | refs/heads/master | fodtlmon/ltl/ltl.py | 1 | """
ltl
Copyright (C) 2015 Walid Benghabrit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the... |
mloesch/tablib | refs/heads/develop | tablib/packages/openpyxl3/writer/styles.py | 55 | # file openpyxl/writer/styles.py
# Copyright (c) 2010 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... |
jonasjberg/autonameow | refs/heads/master | autonameow/vendor/prompt_toolkit/filters/utils.py | 23 | from __future__ import unicode_literals
from .base import Always, Never
from .types import SimpleFilter, CLIFilter
__all__ = (
'to_cli_filter',
'to_simple_filter',
)
_always = Always()
_never = Never()
def to_simple_filter(bool_or_filter):
"""
Accept both booleans and CLIFilters as input and
tur... |
jpope777/searx | refs/heads/master | searx/tests/test_webapp.py | 4 | # -*- coding: utf-8 -*-
import json
from urlparse import ParseResult
from searx import webapp
from searx.testing import SearxTestCase
class ViewsTestCase(SearxTestCase):
def setUp(self):
webapp.app.config['TESTING'] = True # to get better error messages
self.app = webapp.app.test_client()
... |
Microvellum/Fluid-Designer | refs/heads/master | win64-vc/2.78/Python/bin/2.78/scripts/addons/add_mesh_extra_objects/__init__.py | 1 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
sqlalchemy-redshift/sqlalchemy-redshift | refs/heads/master | redshift_sqlalchemy/__init__.py | 5 | """
Compatibility module for projects referencing sqlalchemy_redshift
by its old name "redshift_sqlalchemy".
"""
import sys
import warnings
import sqlalchemy_redshift
DEPRECATION_MESSAGE = """\
redshift_sqlalchemy has been renamed to sqlalchemy_redshift.
The redshift_sqlalchemy compatibility package will be remove... |
dksteele/Senior-Project | refs/heads/master | catkin_ws/src/sensors/src/sensors/sensing_register.py | 1 | #!/usr/bin/env python
import rospy
from sensors.srv import *
import datetime
import threading
from python_qt_binding import QtCore
from python_qt_binding.QtCore import QThread
def output_debug_message(msg):
print datetime.datetime.now(), msg
class SensingRegister(QThread):
__registered_nodes__ = None
__registe... |
christianblunden/googmuze | refs/heads/master | resources/lib/google/protobuf/compiler/plugin_pb2.py | 24 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/compiler/plugin.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_in... |
sdoran35/hate-to-hugs | refs/heads/master | venv/lib/python3.6/site-packages/pip/req/__init__.py | 806 | from __future__ import absolute_import
from .req_install import InstallRequirement
from .req_set import RequirementSet, Requirements
from .req_file import parse_requirements
__all__ = [
"RequirementSet", "Requirements", "InstallRequirement",
"parse_requirements",
]
|
dancingdan/tensorflow | refs/heads/master | tensorflow/python/platform/control_imports.py | 153 | # 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... |
openstack/keystone | refs/heads/master | keystone/common/cache/core.py | 2 | # Copyright 2013 Metacloud
#
# 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, s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.