repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
agry/NGECore2 | refs/heads/master | scripts/object/mobile/vendor/moncal_male.py | 85615 | import sys
def setup(core, object):
return |
Ms2ger/servo | refs/heads/master | tests/wpt/harness/wptrunner/executors/__init__.py | 196 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from base import (executor_kwargs,
testharness_result_converter,
reftest_result_conv... |
chinnuabhi/pjsip | refs/heads/master | pjsip-apps/src/confbot/config.py | 41 | # $Id$
#
# Confbot settings
#
import pjsua as pj
# Set of admins. If empty then everyone is admin!
admins = set([])
# acc_cfg holds the account config (set it to None to disable account)
acc_cfg = None
acc_cfg = pj.AccountConfig()
if acc_cfg:
acc_cfg.id = "sip:bot@pjsip.org"
acc_cfg.reg_uri = "sip:pjsip.org"
acc_c... |
bskari/sparkfun-avc | refs/heads/master | control/test/test_location_filter.py | 1 | """Tests the location Kalman Filter."""
import math
import numpy
import random
import unittest
from control.location_filter import LocationFilter
from control.telemetry import Telemetry
# pylint: disable=no-member
# pylint: disable=protected-access
# pylint: disable=too-many-public-methods
class TestLocationFilter... |
dfalt974/SickRage | refs/heads/master | lib/js2py/prototypes/jsfunction.py | 69 | # python 3 support
import six
if six.PY3:
basestring = str
long = int
xrange = range
unicode = str
# todo fix apply and bind
class FunctionPrototype:
def toString():
if not this.is_callable():
raise TypeError('toString is not generic!')
args = ', '.join(thi... |
corner82/uretimosb | refs/heads/master | public/plugins/ionicons-2.0.1/builder/scripts/generate_font.py | 348 | # Font generation script from FontCustom
# https://github.com/FontCustom/fontcustom/
# http://fontcustom.com/
import fontforge
import os
import md5
import subprocess
import tempfile
import json
import copy
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
INPUT_SVG_DIR = os.path.join(SCRIPT_PATH, '..', '..', '... |
bpshetty/erpnext | refs/heads/master | erpnext/manufacturing/doctype/operation/test_operation.py | 109 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Operation')
class TestOperation(unittest.TestCase):
pass
|
rodneyrick/projetotcc | refs/heads/master | gmaps/testsMongo.py | 1 | from pymongo import MongoClient
import json
client = MongoClient('mongodb://localhost:27017/')
db = client.gmaps
collection = db.gmaps
# posts = db.posts
posts = db.health
def list_all_places():
return db.health.find({'type': 'place'})
def listAllPlaces():
lista = list_all_places()
places = {}
for i in lista:
... |
ahb0327/intellij-community | refs/heads/master | python/testData/resolve/multiFile/importOsPath2/yos.py | 83 | import sys
if True:
import ypath as path
else:
import zpath as path
sys.modules['yos.path'] = path
|
pescobar/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/a/amber.py | 1 | ##
# Copyright 2009-2019 Ghent University
# Copyright 2015-2019 Stanford University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum... |
chepazzo/trigger | refs/heads/develop | trigger/packages/peewee.py | 13 | """
peewee - a small, expressive ORM
Source: https://raw.github.com/coleifer/peewee/2.1.4/peewee.py
License: BSD
Integrated into Trigger 2013-09-12
"""
# (\
# ( \ /(o)\ caw!
# ( \/ ()/ /)
# ( `;.))'".)
# `(/////.-'
# =====))=))===()
# ///'
# //
# '
from __future__ import... |
mahak/cinder | refs/heads/master | cinder/tests/unit/monkey_patch_example/example_b.py | 127 | # 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... |
bobjacobsen/SPShasta | refs/heads/master | userfiles/SetDurations.py | 1 | # set timings
print "SetDurations setting timings"
jmri.implementation.AbstractTurnout.DELAYED_FEEDBACK_INTERVAL = 5000 # turnout throw time
print "Turnout throw delay: ", jmri.implementation.AbstractTurnout.DELAYED_FEEDBACK_INTERVAL/1000., "seconds"
jmri.jmrit.ussctc.CodeLine.CODE_SEND_DELAY = 3000
print "Code send... |
nwjs/chromium.src | refs/heads/nw45-log | tools/perf/core/bot_platforms.py | 1 | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import urllib
from core import benchmark_finders
from core import benchmark_utils
from telemetry.story import story_filter
_SHARD_MAP_DIR = os.p... |
h2oai/h2o-3 | refs/heads/master | h2o-py/tests/testdir_munging/binop/pyunit_binop2_lte.py | 10 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def binop_lte():
iris = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris_wheader.csv"))
rows, cols = iris.dim
iris.show()
#frame/scaler
res = iris <= 5
res_rows, res_cols = res.dim
... |
Axam/nsx-web | refs/heads/master | fuel_agent/fuel_agent/objects/partition.py | 2 | # Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
cs-au-dk/Artemis | refs/heads/master | WebKit/Tools/QueueStatusServer/main.py | 4 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... |
ESS-LLP/erpnext-healthcare | refs/heads/master | erpnext/patches/v4_2/update_requested_and_ordered_qty.py | 91 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty, get_ordered_qty
count=0
for item_code, wareh... |
gusai-francelabs/datafari | refs/heads/master | windows/python/Lib/shlex.py | 306 | # -*- coding: iso-8859-1 -*-
"""A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), st... |
LowerSilesians/ferdas | refs/heads/master | cycu/management/commands/__init__.py | 3 | __author__ = 'jj'
|
mozilla/bztools | refs/heads/master | auto_nag/scripts/mismatch_priority_tracking_nightly.py | 2 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from auto_nag.bzcleaner import BzCleaner
class MismatchPrioTrackNightly(BzCleaner):
def __init__(self):
su... |
rabipanda/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/datasets/mnist.py | 5 | # 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... |
suutari/shoop | refs/heads/master | shuup/admin/modules/products/forms/parent_forms.py | 1 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.forms.formsets... |
maikelwever/django-filer | refs/heads/develop | filer/tests/utils/__init__.py | 67 | class Mock():
pass
|
dhoffman34/django | refs/heads/master | tests/generic_views/test_detail.py | 19 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.test import TestCase, override_settings
from django.views.generic.base import View
from .models import Artist, Author, Page
@override_settings(ROOT_URLCONF='generic_views.urls')
class Deta... |
steebchen/youtube-dl | refs/heads/master | youtube_dl/extractor/screencast.py | 44 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class ScreencastIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?screencast\.com/t/(?P<id>[a-zA-Z0-9]+... |
17zuoye/validata | refs/heads/master | validata/__init__.py | 2 | # -*- coding: utf-8 -*-
from .fields import *
from .validator import Validator
|
abingham/ackward | refs/heads/master | site_scons/ackward/translate.py | 1 | import imp, sys, threading
from .trace import trace
class Cache:
'''Imported module cache.
Avoids re-importing of modules.
'''
cache = {}
count = 0
load_lock = threading.Lock()
@staticmethod
@trace
def load(infile):
with Cache.load_lock:
try:
mo... |
gertingold/scipy | refs/heads/master | scipy/io/matlab/tests/test_mio_utils.py | 25 | """ Testing
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal, \
assert_
from scipy.io.matlab.mio_utils import squeeze_element, chars_to_strings
def test_squeeze_element():
a = np.zeros((1,3))
... |
nmrugg/youtube-dl | refs/heads/master | youtube_dl/extractor/esri.py | 74 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
parse_filesize,
unified_strdate,
)
class EsriVideoIE(InfoExtractor):
_VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]... |
fernandezcuesta/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/debug.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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.0',
... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/draft_schematic/droid/component/shared_personality_module_sarcastic.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/droid/component/shared_personality_module_sarcastic.iff"
r... |
alexchao56/sklearn-theano | refs/heads/master | sklearn_theano/externals/google/protobuf/symbol_database.py | 8 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
gustavo-momente/word2vec_variations | refs/heads/master | create_class.py | 1 | #!/usr/bin/python
__author__ = 'vilelag'
import os
import argparse
import re
def create_parsers():
#parser for the main program
parser = argparse.ArgumentParser(description='Generates class data from test file, this data will be used later'
' to generate start... |
mbakker7/ttim | refs/heads/master | ttim/trace.py | 1 | import numpy as np
def timtrace(ml, xstart, ystart, zstart, tstartend, tstartoffset,
deltlist, nstepmax=100, hstepmax=10, silent=False,
correctionstep=True):
"""
Compute a pathline by numerical integration of the velocity vector.
Pathline is broken up in sections for w... |
neiudemo1/django | refs/heads/master | tests/forms_tests/field_tests/test_multivaluefield.py | 156 | from datetime import datetime
from django.forms import (
CharField, Form, MultipleChoiceField, MultiValueField, MultiWidget,
SelectMultiple, SplitDateTimeField, SplitDateTimeWidget, TextInput,
ValidationError,
)
from django.test import SimpleTestCase
beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'... |
floresconlimon/qutebrowser | refs/heads/master | qutebrowser/misc/crashdialog.py | 5 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... |
GeoODK/formhub | refs/heads/master | odk_logger/tests/test_backup_tools.py | 5 | import os
import tempfile
import shutil
from datetime import datetime
from django.conf import settings
from odk_logger.models import Instance
from odk_logger.import_tools import django_file
from main.tests.test_base import MainTestCase
from odk_logger.import_tools import create_instance
from utils.backup_tools import _... |
JaDogg/__py_playground | refs/heads/master | reference/examples-v3/JavaScript/python/tests/t1.py | 48 | a=1
|
bright-sparks/chromium-spacewalk | refs/heads/master | tools/clang/scripts/test_tool.py | 6 | #!/usr/bin/env python
# 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.
"""Test harness for chromium clang tools."""
import difflib
import glob
import json
import os
import os.path
import subprocess
imp... |
havatv/QGIS | refs/heads/master | tests/src/python/test_qgsserver_modules.py | 27 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgsserver_modules.py
---------------------
Date : December 2016
Copyright : (C) 2016 by David Marteau
Email : david at innophi dot com
*************... |
hfp/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/keras/api/__init__.py | 532 | # 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... |
ahu-odoo/odoo | refs/heads/master | addons/analytic/report/analytic_cost_ledger.py | 23 | # -*- 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... |
mglukhikh/intellij-community | refs/heads/master | python/testData/completion/dictKeys3.after.py | 83 | x = {"foo": "bar", "bar" : "baz"}
x["bar"]
|
quait/madcow | refs/heads/master | contrib/django-memebot/gruntle/memebot/scanner/__init__.py | 4 | """Core handler for scanning Link objects"""
import collections
import traceback
import urlparse
import cgi
import re
from django.conf import settings
from gruntle.memebot.decorators import logged, locked
from gruntle.memebot.utils.browser import Browser
from gruntle.memebot.utils import text
from gruntle.memebot.mo... |
vauxoo-dev/account-financial-tools | refs/heads/8.0 | __unported__/account_credit_control_dunning_fees/__init__.py | 48 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
JVillella/tensorflow | refs/heads/master | tensorflow/python/training/adadelta.py | 84 | # 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... |
engdan77/edoAutoHomeMobile | refs/heads/master | twisted/names/test/test_rootresolve.py | 10 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Twisted.names' root resolver.
"""
from zope.interface import implementer
from zope.interface.verify import verifyClass
from twisted.python.log import msg
from twisted.trial import util
from twisted.trial.unittest import Synchr... |
julesy89/moo-cpp | refs/heads/master | vendor/benchmark/.ycm_extra_conf.py | 84 | import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Werror',
'-pendantic-errors',
'-std=c++0x',
'-fno-strict-aliasing... |
CMDann/oppia | refs/heads/develop | extensions/rich_text_components/Collapsible/Collapsible.py | 18 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
rlugojr/django | refs/heads/master | tests/mutually_referential/tests.py | 581 | from django.test import TestCase
from .models import Parent
class MutuallyReferentialTests(TestCase):
def test_mutually_referential(self):
# Create a Parent
q = Parent(name='Elizabeth')
q.save()
# Create some children
c = q.child_set.create(name='Charles')
q.chil... |
idigbio-api-hackathon/LifemapperQgis | refs/heads/master | lifemapperTools/tools/ui_upLoadOTL.py | 2 | # -*- coding: utf-8 -*-
"""
@license: gpl2
@copyright: Copyright (C) 2014, University of Kansas Center for Research
Lifemapper Project, lifemapper [at] ku [dot] edu,
Biodiversity Institute,
1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA
This program is free software; ... |
SandstoneHPC/OIDE | refs/heads/master | sandstone/lib/filesystem/mixins.py | 3 | import tornado.web
from sandstone.lib.filesystem.interfaces import PosixFS
class FSMixin(tornado.web.RequestHandler):
def initialize(self):
self.fs = PosixFS()
|
ConnorGBrewster/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/reduce.py | 6 | import sys
import tempfile
from cStringIO import StringIO
from collections import defaultdict
import wptrunner
import wpttest
from mozlog import commandline, reader
logger = None
def setup_logging(args, defaults):
global logger
logger = commandline.setup_logging("web-platform-tests-unstable", args, default... |
dou800/php-buildpack-legacy | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/encodings/cp860.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
40223117cda/2015cdaw13 | refs/heads/master | wsgi.py | 2 | # coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
import cherrypy
# 導入 Python 內建的 os 模組, 因為 os 模組為 Python 內建, 所以無需透過 setup.py 安裝
import os
# 導入 random 模組
import random
# 導入 gear 模組
import gear
import man
import man2
import m... |
vashzsun/fund_analysis | refs/heads/master | fund_data/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
stackforge/solum | refs/heads/master | solum/api/controllers/camp/v1_1/type_definitions.py | 2 | # 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, software
# distributed under t... |
sean797/Flexget | refs/heads/develop | flexget/plugins/output/sabnzbd.py | 7 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import urlencode
import logging
from flexget import plugin
from flexget.event import event
from requests import RequestException
log = logg... |
jmmease/pandas | refs/heads/master | pandas/core/reshape/reshape.py | 1 | # pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
from pandas.compat import range, text_type, zip
from pandas import compat
from functools import partial
import itertools
import re
import numpy as np
from pandas.core.dtypes.common import (
_ensure_platform_int,
is_list_like, is_bool_dtyp... |
yugangw-msft/azure-cli | refs/heads/dev | src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_acl_scenarios.py | 6 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
laura-dietz/taia-stream-eval | refs/heads/master | code/metrics.py | 1 | """
Implementation of ranking metrics.
"""
import numpy as np
from numpy import sum
def aucEval(data, gt, gf):
"""
Area under the Receiver-Operator curve.
This is a fast implementation that follows the trajectory of the ROC curve and needs only a single pass through the data.
Start in lower-right c... |
awsdocs/aws-doc-sdk-examples | refs/heads/master | python/example_code/s3/s3_versioning/remove_delete_marker.py | 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
An AWS Lambda handler that receives an Amazon S3 batch event. The handler unpacks the
event and removes the specified delete marker from the bucket.
"""
# snippet-start:[s3.python.lambda.remove_delete_marker... |
bigswitch/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/280_add_nullable_false_to_keypairs_name.py | 81 | # Copyright 2015 Intel 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
#
# Unless required... |
samthor/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/models/fields/related.py | 71 | from django.conf import settings
from django.db import connection, router, transaction
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
from dja... |
MatthewJohnson3154/pyotr | refs/heads/master | pyotr.py | 1 | from flask import Flask
from flask import render_template
import ConfigParser
import praw
app = Flask(__name__)
"""Load config file to get Reddit API connection info"""
Config = ConfigParser.ConfigParser()
Config.read('config.ini')
def get_praw_config():
"""Return a dict of Reddit API connection config:
Use... |
tmimori/erpnext | refs/heads/develop | erpnext/manufacturing/doctype/bom/bom.py | 11 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt
from frappe import _
from frappe.model.document import Document
from operator import itemgetter... |
orangejulius/openaddresses | refs/heads/master | scripts/si/addNames.py | 5 | # -*- coding: utf-8 -*-
import __future__
import csv, sys, json, copy, datetime, time, os
def readDictionary(path, filename):
dict = {}
with open(os.path.join(path, filename)) as f:
reader = csv.reader(f, delimiter=';')
next(reader) # skip header
for row in reader:
dict[row... |
FHannes/intellij-community | refs/heads/master | python/testData/optimizeImports/importsFromTypingUnusedInTypeComments.after.py | 39 | from typing import List, Set
def f(x, y):
# type: (int, List[int]) -> str
y.append(x)
return 'foo'
xs = {1, 2, 3} # type: Set[int]
|
amonmoce/corba_examples | refs/heads/master | omniORB-4.2.1/src/tool/omniidl/python3/omniidl_be/interactive.py | 9 | # -*- python -*-
# Package : omniidl
# interactive.py Created on: 2001/10/18
# Author : Duncan Grisby (dpg1)
#
# Copyright (C) 2001 AT&T Laboratories Cambridge
#
# This file is part of omniidl.
#
# omniidl is free software; you can redistribute it and/or modify it
# ... |
vrenaville/ngo-addons-backport | refs/heads/master | addons/stock_no_autopicking/stock_no_autopicking.py | 53 | # -*- 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... |
w1ll1am23/home-assistant | refs/heads/dev | tests/components/gpslogger/__init__.py | 39 | """Tests for the GPSLogger component."""
|
ScienceWorldCA/domelights | refs/heads/master | backend/artnet-bridge/artnet/scripts/listener.py | 2 | import logging
from artnet import daemon
log = logging.getLogger(__name__)
def main(config):
log.info("Running script %s" % __name__)
q = daemon.Poller(config.get('base', 'address'))
q.run()
|
firerszd/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_keyword.py | 98 | import keyword
import unittest
from test import support
import filecmp
import os
import sys
import subprocess
import shutil
import textwrap
KEYWORD_FILE = support.findfile('keyword.py')
GRAMMAR_FILE = os.path.join(os.path.split(__file__)[0],
'..', '..', '... |
wangyou/XX-Net | refs/heads/master | code/default/python27/1.0/lib/linux/cryptography/hazmat/backends/openssl/ciphers.py | 16 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import Invali... |
kylepjohnson/cltk | refs/heads/master | src/cltk/alphabet/ang.py | 4 | """The Old English alphabet.
>>> from cltk.alphabet import ang
>>> ang.DIGITS[:5]
['ān', 'tƿeġen', 'þrēo', 'fēoƿer', 'fīf']
>>> ang.DIPHTHONGS[:5]
['ea', 'eo', 'ie']
"""
# digits [1-10]
DIGITS = [
"ān",
"tƿeġen",
"þrēo",
"fēoƿer",
"fīf",
"seox",
"seofon",
"eahta",
"niġon",
"tīe... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/integrate/_ivp/common.py | 21 | from __future__ import division, print_function, absolute_import
from itertools import groupby
from warnings import warn
import numpy as np
from scipy.sparse import find, coo_matrix
EPS = np.finfo(float).eps
def validate_max_step(max_step):
"""Assert that max_Step is valid and return it."""
if max_step <= 0... |
hosseinoliabak/learningpy | refs/heads/master | 15_1_db.py | 1 | '''
Instructions
If you don't already have it, install the SQLite Browser from
http://sqlitebrowser.org/.
Then, create a SQLITE database or use an existing database and create a table
in the database called "Ages":
CREATE TABLE Ages (
name VARCHAR(128),
age INTEGER
)
Then make sure the table is empty by deleting ... |
wooga/play-deliver | refs/heads/develop | playdeliver/client.py | 1 | """Module with Client class to access google api."""
class Client(object):
"""
Client object which handles google api edits.
It hold the service user credentials and app package name.
"""
def __init__(self, package_name, service):
"""
create new client object.
package_na... |
masia02/chainer | refs/heads/master | tests/cupy_tests/linalg_tests/test_eigenvalue.py | 24 | import unittest
from cupy import testing
@testing.gpu
class TestEigenvalue(unittest.TestCase):
_multiprocess_can_split_ = True
|
mostafa/grest | refs/heads/master | tests/test_extended_app.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2017- Mostafa Moradian <mostafamoradian0@gmail.com>
#
# This file is part of grest.
#
# grest 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 L... |
msincenselee/vnpy | refs/heads/vnpy2 | vnpy/amqp/test02_task.py | 1 | # encoding: UTF-8
from uuid import uuid1
import json
from vnpy.amqp.producer import task_creator
from vnpy.trader.constant import Direction
if __name__ == '__main__':
import datetime
import time
p = task_creator(host='192.168.0.202')
while True:
time.sleep(10)
mission = {}
miss... |
alphafoobar/intellij-community | refs/heads/master | python/lib/Lib/encodings/cp869.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
un33k/robotframework | refs/heads/master | atest/testdata/test_libraries/InitializationFailLibrary.py | 37 | class InitializationFailLibrary:
def __init__(self, arg1='default 1', arg2='default 2'):
raise Exception("Initialization failed with arguments %r and %r!" % (arg1, arg2))
|
ClearCorp-dev/odoo | refs/heads/8.0 | openerp/tools/lru.py | 204 | # -*- coding: utf-8 -*-
# taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/
import threading
from func import synchronized
__all__ = ['LRU']
class LRUNode(object):
__slots__ = ['prev', 'next', 'me']
def __init__(self, prev, me):
self.prev = prev
... |
3dfxmadscientist/odoo_vi | refs/heads/master | addons/website_customer/__init__.py | 382 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
cglatot/PokeManager | refs/heads/master | pogo/POGOProtos/Data/Capture/CaptureAward_pb2.py | 4 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Data/Capture/CaptureAward.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.protobu... |
s-maj/integrations-core | refs/heads/master | nagios/test_nagios.py | 4 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import tempfile
import time
import os
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest, Fixtures
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), ... |
mbauskar/erpnext | refs/heads/develop | erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register ... |
Nebelhom/WordPuzzleCreator | refs/heads/master | lib/xlwt/examples/merged.py | 44 | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman
from xlwt import *
fnt = Font()
fnt.name = 'Arial'
fnt.colour_index = 4
fnt.bold = True
borders = Borders()
borders.left = 6
borders.right = 6
borders.top = 6
borders.bottom = 6
al = Alignment()
al.horz = Alignment.HORZ_CENTER
... |
fastmonkeys/stellar | refs/heads/master | stellar/config.py | 3 | import os
import logging
import yaml
from schema import Use, Schema, SchemaError, Optional
class InvalidConfig(Exception):
pass
class MissingConfig(Exception):
pass
default_config = {
'logging': 30,
'migrate_from_0_3_2': True
}
schema = Schema({
'stellar_url': Use(str),
'url': Use(str),
... |
thewickedaxe/Artificial-Intelligence---600.435 | refs/heads/master | HW-2/search/keyboardAgents.py | 1 | # keyboardAgents.py
# -----------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berk... |
podemos-info/odoo | refs/heads/6.1 | addons/point_of_sale/report/pos_sales_user.py | 9 | # -*- 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... |
joshua-cogliati-inl/raven | refs/heads/devel | framework/UI/DendrogramView.py | 2 | # Copyright 2017 Battelle Energy Alliance, 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 agreed t... |
jounex/hue | refs/heads/master | desktop/core/ext-py/Mako-0.8.1/mako/codegen.py | 38 | # mako/codegen.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module
source code."""
impo... |
wreckJ/intellij-community | refs/heads/master | python/testData/refactoring/changeSignature/removeKeyedParam.before.py | 83 | def retry(tries, log=None, delay=3, backoff=1, exceptions_to_check=Exception, retry_for_lambda=None):
print "tries", tries
print "log", log
print "delay", delay
print "backoff", backoff
print "exceptions_to_check", exceptions_to_check
print "retry_for_lambda", retry_for_lambda
ret<caret>ry(3, ... |
DarrelHsu/cvsClient | refs/heads/master | third_party/pylint/checkers/string_format.py | 20 | # Copyright (c) 2009-2010 Arista Networks, Inc. - James Lingard
# Copyright (c) 2004-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# 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 ... |
terbolous/SickRage | refs/heads/master | lib/backports_abc.py | 27 | """
Patch recently added ABCs into the standard lib module
``collections.abc`` (Py3) or ``collections`` (Py2).
Usage::
import backports_abc
backports_abc.patch()
or::
try:
from collections.abc import Generator
except ImportError:
from backports_abc import Generator
"""
try:
impo... |
FlorianLudwig/odoo | refs/heads/8.0 | addons/mail/mail_mail.py | 183 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
vechnoe/products | refs/heads/master | src/apps/products/urls.py | 1 | # coding: utf-8
from django.conf.urls import patterns, url
from .views import ProductListView, ProductDetailView, send_like
urlpatterns = patterns(
'products.views',
url(r'products/$', ProductListView.as_view(), name='products_list'),
url(r'products/(?P<slug>[\w-]+)/$',
ProductDetailView.as_view()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.