repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
arunkuttiyara/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
lgpl-2.1
gangadharkadam/smrterp
erpnext/stock/doctype/serial_no/serial_no.py
4
12538
# 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 frappe from frappe.utils import cint, cstr, flt, add_days, nowdate from frappe import _, ValidationError from erpnext.controllers.stock_cont...
agpl-3.0
pkuyym/Paddle
python/paddle/trainer_config_helpers/layer_math.py
8
4029
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
rev2004/android2cloud.app-engine
google_appengine/google/appengine/tools/dev_appserver_upload.py
2
10468
#!/usr/bin/env python # # Copyright 2007 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...
mit
dkalashnik/tempest
tempest/api/object_storage/test_object_slo.py
15
7275
# Copyright 2013 NTT Corporation # # 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 ag...
apache-2.0
CasataliaLabs/biscuit_drishtiman
Pmw-2.0.0/build/lib.linux-x86_64-2.7/Pmw/Pmw_1_3_3/lib/PmwScrolledText.py
2
15552
# Based on iwidgets2.2.0/scrolledtext.itk code. import Tkinter import Pmw class ScrolledText(Pmw.MegaWidget): def __init__(self, parent = None, **kw): # Define the megawidget options. INITOPT = Pmw.INITOPT optiondefs = ( ('borderframe', 0, INITOPT), ('columnheader', 0,...
gpl-3.0
gallenmu/MoonGen
libmoon/deps/tbb/python/setup.py
1
5115
#!/usr/bin/env python # # Copyright (c) 2016-2018 Intel Corporation # # 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 a...
mit
OpenWhere/scrapy
tests/test_stats.py
49
2241
import unittest from scrapy.spiders import Spider from scrapy.statscollectors import StatsCollector, DummyStatsCollector from scrapy.utils.test import get_crawler class StatsCollectorTest(unittest.TestCase): def setUp(self): self.crawler = get_crawler(Spider) self.spider = self.crawler._create_sp...
bsd-3-clause
programadorjc/django
tests/template_tests/filter_tests/test_ljust.py
521
1081
from django.template.defaultfilters import ljust from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LjustTests(SimpleTestCase): @setup({'ljust01': '{% autoescape off %}.{{ a|ljust:"5" }}. .{{ b|ljust:"5" }}.{% endautoescape %}'}) def test_lju...
bsd-3-clause
chunyang-wen/orc
c++/libs/protobuf-2.6.0/python/google/protobuf/internal/descriptor_python_test.py
27
2349
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
apache-2.0
ak2703/edx-platform
lms/djangoapps/certificates/badge_handler.py
32
7409
""" BadgeHandler object-- used to award Badges to users who have completed courses. """ import hashlib import logging import mimetypes from eventtracking import tracker import requests from django.template.defaultfilters import slugify from django.utils.translation import ugettext as _ from django.conf import settings...
agpl-3.0
saeki-masaki/glance
glance/tests/unit/test_opts.py
5
9950
# Copyright (c) 2014 OpenStack Foundation. # # 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 ...
apache-2.0
florentx/OpenUpgrade
addons/edi/models/__init__.py
442
1116
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
joemicro/Manufacturing
reports.py
1
11594
import os import platform import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from databaseschema import * from functions import * import modelsandviews class ReportDialog(QDialog): def __init__(self, bomModel, parent=None): super(ReportDialog, self).__init__(parent) dRange_label = QLab...
mit
soult/stem
run_tests.py
1
12303
#!/usr/bin/env python # Copyright 2011-2013, Damian Johnson # See LICENSE for licensing information """ Runs unit and integration tests. For usage information run this with '--help'. """ import collections import getopt import os import StringIO import sys import threading import time import unittest import stem.pre...
lgpl-3.0
ralphwort/chef-repo
build/pyparsing/examples/urlExtractor.py
6
1794
# URL extractor # Copyright 2004, Paul McGuire from pyparsing import Literal,Suppress,CharsNotIn,CaselessLiteral,\ Word,dblQuotedString,alphanums,SkipTo import urllib.request, urllib.parse, urllib.error import pprint # Define the pyparsing grammar for a URL, that is: # URLlink ::= <a href= URL>linkT...
apache-2.0
jasonwzhy/django
tests/migrations/models.py
386
1780
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class CustomModelBase(models.base.ModelBase): pass class ModelWithCustomBase(six.with_met...
bsd-3-clause
TakayukiSakai/tensorflow
tensorflow/models/embedding/word2vec.py
3
19359
# 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...
apache-2.0
karan1276/servo
tests/wpt/harness/wptrunner/executors/executorservo.py
35
12613
# 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/. import base64 import hashlib import httplib import json import os import subprocess import tempfile import threading imp...
mpl-2.0
udayinfy/openerp-7.0
l10n_cn_report_invoice/invoice.py
3
2142
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2011 Elico Corp. All Rights Reserved. # Author: LIN Yu <lin.yu@elico-corp.com> # $Id$ # # This program is free software: yo...
agpl-3.0
recall704/scrapy-docs-cn
scrapy/extensions/spiderstate.py
35
1169
import os from six.moves import cPickle as pickle from scrapy import signals from scrapy.exceptions import NotConfigured from scrapy.utils.job import job_dir class SpiderState(object): """Store and load spider state during a scraping job""" def __init__(self, jobdir=None): self.jobdir = jobdir @...
bsd-3-clause
IllusionRom-deprecated/android_platform_external_chromium_org
chrome/common/extensions/docs/server2/host_file_system_provider.py
44
4780
# Copyright 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. from caching_file_system import CachingFileSystem from local_file_system import LocalFileSystem from offline_file_system import OfflineFileSystem from subver...
bsd-3-clause
nicolasnoble/grpc
tools/distrib/python/grpcio_tools/protoc_lib_deps.py
3
8884
# Copyright 2017 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 writin...
apache-2.0
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/lib2to3/btm_utils.py
374
10011
"Utility functions used by the btm_matcher module" from . import pytree from .pgen2 import grammar, token from .pygram import pattern_symbols, python_symbols syms = pattern_symbols pysyms = python_symbols tokens = grammar.opmap token_labels = token TYPE_ANY = -1 TYPE_ALTERNATIVES = -2 TYPE_GROUP = -3 class MinNode(...
apache-2.0
paolodedios/tensorflow
tensorflow/lite/python/optimize/calibrator.py
6
7619
# Copyright 2019 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...
apache-2.0
broferek/ansible
lib/ansible/cli/playbook.py
26
9115
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2018, 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 os import stat from ansible import c...
gpl-3.0
estaban/pyload
module/lib/jinja2/exceptions.py
398
4530
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ class TemplateError(Exception): """Baseclass for all template errors.""" def __init__(self, message=None): i...
gpl-3.0
ganeshgore/myremolab
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment79/server_config.py
242
1525
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
chdecultot/frappe
frappe/data_migration/doctype/data_migration_mapping/data_migration_mapping.py
12
2181
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils import get_source_value class DataMigrationMapping(Document): def get...
mit
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/dr3d.py
56
1448
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
apache-2.0
mixman/djangodev
tests/regressiontests/localflavor/it/tests.py
1
2453
from django.contrib.localflavor.it.forms import (ITZipCodeField, ITRegionSelect, ITSocialSecurityNumberField, ITVatNumberField) from django.test import SimpleTestCase class ITLocalFlavorTests(SimpleTestCase): def test_ITRegionSelect(self): f = ITRegionSelect() out = u'''<select name="regions"...
bsd-3-clause
zchee/iTerm2
tests/esctest/tests/decsed.py
31
11917
from esc import NUL, blank import escargs import esccmd import escio from escutil import AssertScreenCharsInRectEqual, knownBug from esctypes import Point, Rect class DECSEDTests(object): def prepare(self): """Sets up the display as: a bcd e With the cursor on the 'c'. """ esccmd.CUP(...
gpl-2.0
iw3hxn/LibrERP
account_fiscal_year_closing/wizard/wizard_run.py
3
25218
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP - Import operations model 347 engine # Copyright (C) 2009 Asr Oss. All Rights Reserved # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2012 Domsense sr...
agpl-3.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_2/django/dispatch/dispatcher.py
45
8905
import weakref import threading from django.dispatch import saferef WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, 'im_func'): return (id(target.im_self), id(target.im_func)) return id(target) class Signal(object): """ Base class ...
mit
tribut/vdirsyncer
vdirsyncer/sync.py
1
11365
# -*- coding: utf-8 -*- ''' The function in `vdirsyncer.sync` can be called on two instances of `Storage` to synchronize them. Due to the abstract API storage classes are implementing, the two given instances don't have to be of the same exact type. This allows us not only to synchronize a local vdir with a CalDAV serv...
mit
liveblog/superdesk
server/apps/auth/db/db.py
6
1699
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import bcryp...
agpl-3.0
wilvk/ansible
lib/ansible/parsing/dataloader.py
16
16607
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import c...
gpl-3.0
NikNitro/Python-iBeacon-Scan
sympy/physics/mechanics/particle.py
10
7774
from __future__ import print_function, division __all__ = ['Particle'] from sympy.core.backend import sympify from sympy.physics.vector import Point from sympy.utilities.exceptions import SymPyDeprecationWarning class Particle(object): """A particle. Particles have a non-zero mass and lack spatial extensio...
gpl-3.0
russel1237/scikit-learn
examples/calibration/plot_calibration.py
225
4795
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
bsd-3-clause
geerlingguy/ansible
lib/ansible/plugins/doc_fragments/shell_windows.py
16
1357
# Copyright (c) 2019 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Windows shell documentation fragment # FIXME: set_module_language don't belong here but must be set so they don't fail when someone # get_o...
gpl-3.0
B-MOOC/edx-platform
common/djangoapps/status/status.py
48
1463
""" A tiny app that checks for a status message. """ from django.conf import settings from django.core.cache import cache import json import logging import os log = logging.getLogger(__name__) def get_site_status_msg(course_id): """ Look for a file settings.STATUS_MESSAGE_PATH. If found, read it, parse...
agpl-3.0
gangadhar-kadam/adb-erp
setup/doctype/authorization_rule/authorization_rule.py
6
4783
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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 yo...
agpl-3.0
sdague/home-assistant
tests/components/automation/test_reproduce_state.py
21
1675
"""Test reproduce state for Automation.""" from homeassistant.core import State from tests.common import async_mock_service async def test_reproducing_states(hass, caplog): """Test reproducing Automation states.""" hass.states.async_set("automation.entity_off", "off", {}) hass.states.async_set("automatio...
apache-2.0
Eric89GXL/vispy
vispy/visuals/tests/test_axis.py
1
2220
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- ...
bsd-3-clause
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/jinja2/optimizer.py
1401
2302
# -*- coding: utf-8 -*- """ jinja2.optimizer ~~~~~~~~~~~~~~~~ The jinja optimizer is currently trying to constant fold a few expressions and modify the AST in place so that it should be easier to evaluate it. Because the AST does not contain all the scoping information and the compiler has to ...
mit
PaulEG/Various-Projects
ZombieGame.py
1
3149
from graphics import * from time import sleep from random import randint class zombie: def __init__(self, point, window, speed): self.body = Circle(point,1) self.body.draw(window) self.win = window self.speed = speed self.killing = False def killing(self): return...
artistic-2.0
okwow123/djangol2
example/env/lib/python2.7/site-packages/django/utils/crypto.py
51
6878
""" Django's standard crypto functions and utilities. """ from __future__ import unicode_literals import binascii import hashlib import hmac import random import struct import time from django.conf import settings from django.utils import six from django.utils.encoding import force_bytes from django.utils.six.moves i...
mit
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
gpl-3.0
vipul-sharma20/oh-mainline
vendor/packages/twill/twill/extensions/check_links.py
19
5544
""" Extension functions to check all of the links on a page. Usage: check_links [ <pattern> ] Make sure that all of the HTTP links on the current page can be visited successfully. If 'pattern' is given, check only URLs that match that regular expression. If option 'check_links.only_collect_bad_links' is on, the...
agpl-3.0
Hybrid-Cloud/conveyor
conveyor/conveyorheat/engine/resources/openstack/neutron/port.py
1
24718
# # 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 # ...
apache-2.0
grpc/grpc
src/python/grpcio/_spawn_patch.py
43
2175
# Copyright 2016 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...
apache-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.5/Lib/distutils/bcppcompiler.py
85
15086
"""distutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. """ # This implementation by Lyle Johnson, based on the original msvccompiler.py # module and using the directions originally published by Gordon Williams. # XXX looks like there's a L...
mit
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/django/utils/translation/trans_null.py
467
1408
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text def ngettext...
mit
googleapis/googleapis-gen
google/cloud/workflows/executions/v1beta/workflows-executions-v1beta-py/google/cloud/workflows/executions_v1beta/__init__.py
2
1272
# -*- 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...
apache-2.0
ddelemeny/calligra
sheets/plugins/scripting/scripts/vcardimport.py
7
5803
#!/usr/bin/env kross """ Python script to import content from a vCard file to Sheets. (C)2007 Sebastian Sauer <mail@dipe.org> http://kross.dipe.org http://www.calligra.org/sheets Dual-licensed under LGPL v2+higher and the BSD license. """ try: import vobject except ImportError: raise "Failed to import requir...
gpl-2.0
jean/hamster
wafadmin/Tools/preproc.py
7
16228
#!/usr/bin/env python2 # encoding: utf-8 import re,sys,os,string import Logs,Build,Utils from Logs import debug,error import traceback class PreprocError(Utils.WafError): pass POPFILE='-' recursion_limit=100 go_absolute=0 standard_includes=['/usr/include'] if sys.platform=="win32": standard_includes=[] use_trigraphs...
gpl-3.0
yoer/hue
desktop/core/ext-py/Django-1.6.10/django/template/__init__.py
561
3247
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
apache-2.0
sebgoa/client-python
kubernetes/client/models/v1alpha1_external_admission_hook_configuration_list.py
2
6974
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
shinglyu/moztrap
tests/view/lists/test_sort.py
5
6830
""" Tests for sorting utilities. """ from mock import Mock from django.template.response import TemplateResponse from django.test import RequestFactory from tests import case from ...utils import Url class SortDecoratorTest(case.DBTestCase): @property def sort(self): """The decorator factory unde...
bsd-2-clause
0x0all/SASM
Windows/MinGW64/opt/lib/python2.7/encodings/cp852.py
593
35258
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.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'): ...
gpl-3.0
Kongsea/tensorflow
tensorflow/python/training/sync_replicas_optimizer.py
9
20743
# 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...
apache-2.0
funkyfuture/deck-chores
tests/test_config.py
1
1367
import ssl import docker.client from docker.constants import DEFAULT_TIMEOUT_SECONDS import deck_chores.config cfg, generate_config = deck_chores.config.cfg, deck_chores.config.generate_config def test_default_config(monkeypatch): def docker_api_version(self): return '1.37' def every_file_exists(...
isc
fedspendingtransparency/data-act-broker-backend
tests/unit/dataactvalidator/test_a18_cross_file.py
1
2427
from random import randint from tests.unit.dataactcore.factories.domain import TASFactory from tests.unit.dataactcore.factories.staging import AppropriationFactory, ObjectClassProgramActivityFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'a18_cross_file' def test_colu...
cc0-1.0
jiahaoliuliu/WorldSpotlight
Scripts/remove_duplicates.py
1
1027
from parse_rest.datatypes import Object from parse_rest.connection import register from itertools import chain '''Remove Duplicate Videos''' keys={ 'API_KEY':'', 'APPLICATION_ID':'', 'REST_API_KEY':'', 'MASTER_KEY':'' } MAX_NO_OF_RECORD = 1000 class Video(Object): pass video_ids = [] def destroy_duplicates(max...
apache-2.0
ademmers/ansible
test/units/module_utils/facts/system/distribution/test_parse_distribution_file_ClearLinux.py
35
1703
# -*- 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 os import pytest from ansible.module_utils.facts.system.distribution i...
gpl-3.0
moria/popcorn-desktop
dist/mac/yoursway-create-dmg/support/dmg-license.py
84
5300
#! /usr/bin/env python """ This script adds a license file to a DMG. Requires Xcode and a plain ascii text license file. Obviously only runs on a Mac. Copyright (C) 2011 Jared Hobbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "S...
gpl-3.0
AndreasWilliams/BotGravindo
plugins/needs-review/luaStringConverter/trunk/luaStringConverter.py
4
1268
#This converter script is created by windhamwong. #This script is used for converting non-ASCII character in decompiled lua file generated by unluac into the correct character. import re, sys, getopt input_filepath = '' output_filepath = '' if (len(sys.argv) < 5): print 'luaConverter.py -i <inputfile> -o...
gpl-2.0
garbear/xbmc-retroplayer
lib/gtest/test/gtest_output_test.py
184
12027
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-2.0
Pablo126/SSBW
Entrega1/lib/python3.5/site-packages/PIL/MspImagePlugin.py
8
5580
# # The Python Imaging Library. # # MSP file handling # # This is the format used by the Paint program in Windows 1 and 2. # # History: # 95-09-05 fl Created # 97-01-03 fl Read/write MSP images # 17-02-21 es Fixed RLE interpretation # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fr...
gpl-3.0
souravbadami/zulip
zerver/lib/response.py
13
2084
from __future__ import absolute_import from django.http import HttpResponse, HttpResponseNotAllowed import ujson from typing import Optional, Any, Dict, List, Text from zerver.lib.str_utils import force_bytes class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, realm, www_auth...
apache-2.0
cellular-nanoscience/pyotic
pyoti/data/datasource.py
1
3193
# -*- coding: utf-8 -*- """ Created on Thu Mar 10 19:13:51 2016 @author: Tobias Jachowski """ import os import persistent from functools import wraps from .. import helpers as hp def if_needs_file(func): @wraps(func) def func_wrapper(self, *args, **kwargs): if self._needs_file: return fu...
apache-2.0
shackra/thomas-aquinas
tests/test_draw_elbows2.py
1
1091
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, q" tags = "Draw, join" import summa from summa.director import director from summa import draw import pyglet class TestFigure(draw.Canvas):...
bsd-3-clause
jjanssen/django-cms-patches
cms/utils/__init__.py
1
10651
# TODO: this is just stuff from utils.py - should be splitted / moved from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from cms.utils.i18n import get_default_language # !IMPORTANT: Pag...
bsd-3-clause
jarshwah/django
tests/i18n/test_extraction.py
1
33889
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import io import os import re import shutil import time import warnings from unittest import skipUnless from django.core import management from django.core.management import execute_from_command_line from django.core.management.base import CommandError...
bsd-3-clause
acsone/odoo
addons/stock_account/__init__.py
384
1060
# -*- 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...
agpl-3.0
diogocs1/comps
web/addons/point_of_sale/report/pos_details.py
99
9296
# -*- 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...
apache-2.0
adamgreenhall/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
arista-eosplus/pyeapi
test/unit/test_api_vrfs.py
1
7339
# # Copyright (c) 2017, Arista Networks, 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 condit...
bsd-3-clause
thodoris/djangoPharma
djangoPharma/env/Lib/site-packages/django/contrib/gis/utils/ogrinfo.py
139
1935
""" This module includes some utility functions for inspecting the layout of a GDAL data source -- the functionality is analogous to the output produced by the `ogrinfo` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.geometries import GEO_CLASSES def ogrinfo(data_source, num...
apache-2.0
LearnEra/LearnEraPlaftform
common/test/acceptance/pages/lms/staff_view.py
26
2642
""" Staff view of courseware """ from bok_choy.page_object import PageObject class StaffPage(PageObject): """ View of courseware pages while logged in as course staff """ url = None STAFF_STATUS_CSS = '#staffstatus' def is_browser_on_page(self): return self.q(css=self.STAFF_STATUS_CS...
agpl-3.0
krzysztof-magosa/ansible-modules-extras
cloud/openstack/os_group.py
67
4674
#!/usr/bin/python # Copyright (c) 2016 IBM # # This module 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 software is distrib...
gpl-3.0
microcom/odoo
addons/hr_recruitment/__openerp__.py
45
1867
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Recruitment Process', 'version': '1.0', 'category': 'Human Resources', 'sequence': 90, 'summary': 'Jobs, Recruitment, Applications, Job Interviews, Surveys', 'description': """ Manage...
agpl-3.0
ardi69/pyload-0.4.10
pyload/plugin/hoster/RealdebridCom.py
1
1798
# -*- coding: utf-8 -*- import time from pyload.utils import json_loads from pyload.plugin.internal.MultiHoster import MultiHoster from pyload.utils import parse_size class RealdebridCom(MultiHoster): __name = "RealdebridCom" __type = "hoster" __version = "0.67" __pattern = r'https?://((?:www...
gpl-3.0
UltronAI/Deep-Learning
Pattern-Recognition/hw2-Feature-Selection/skfeature/example/test_ls_l21.py
1
1781
import scipy.io from sklearn import svm from sklearn import cross_validation from sklearn.metrics import accuracy_score from skfeature.utility.sparse_learning import * from skfeature.function.sparse_learning_based import ls_l21 def main(): # load data mat = scipy.io.loadmat('../data/COIL20.mat') ...
mit
zetacoin/zetacoin
contrib/devtools/security-check.py
39
6702
#!/usr/bin/python2 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, and the...
mit
wwf5067/statsmodels
statsmodels/genmod/families/family.py
19
39410
''' The one parameter exponential family distributions used by GLM. ''' # TODO: quasi, quasibinomial, quasipoisson # see http://www.biostat.jhsph.edu/~qli/biostatistics_r_doc/library/stats/html/family.html # for comparison to R, and McCullagh and Nelder import numpy as np from scipy import special from . import links ...
bsd-3-clause
luogangyi/bcec-nova
nova/tests/virt/vmwareapi/test_vif.py
10
15740
# Copyright 2013 Canonical Corp. # 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 ...
apache-2.0
lgarren/spack
var/spack/repos/builtin/packages/mxml/package.py
3
2571
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
oisinmulvihill/JSONP_PostPutGetDelete_With_Tornado
restserver/pp/jsonpcrud/service/handlers/restcrud.py
1
1121
# -*- coding: utf-8 -*- """ This provides a URL you can call to check if the service is present and its current version. Oisin Mulvihill 2012-12-18T11:15:09 """ import logging from pp.jsonpcrud.service.handlers import now from pp.jsonpcrud.service.handlers import data from pp.jsonpcrud.service.handlers.jsonphandler ...
mit
alloyapple/CocosBuilder
CocosBuilder/libs/cocos2d-iphone/external/JavaScript/jsbindings/generate_jsb.py
8
110982
#!/usr/bin/python # ---------------------------------------------------------------------------- # Generates JavaScript Bindings glue code after C / Objective-C code # # Author: Ricardo Quesada # Copyright 2012 (C) Zynga, Inc # # License: MIT # ---------------------------------------------------------------------------...
bsd-2-clause
samdoran/ansible
lib/ansible/modules/packaging/os/apt.py
30
38018
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Flowroute LLC # Written by Matthew Williams <matthew@flowroute.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
gpl-3.0
sriharshams/mlnd
smartcab/smartcab/environment.py
6
19860
import time import random import math from collections import OrderedDict from simulator import Simulator class TrafficLight(object): """A traffic light that switches periodically.""" valid_states = [True, False] # True = NS open; False = EW open def __init__(self, state=None, period=None): sel...
apache-2.0
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Doc/includes/sqlite3/text_factory.py
45
1355
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() # Create the table con.execute("create table person(lastname, firstname)") AUSTRIA = "\xd6sterreich" # by default, rows are returned as Unicode cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() assert row[0] == AUSTRIA # but we can make sql...
apache-2.0
wildchildyn/autism-website
yanni_env/lib/python3.6/site-packages/pip/_vendor/requests/exceptions.py
362
2860
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. ...
gpl-3.0
jdugge/QGIS
tests/src/python/test_qgsserver_cachemanager.py
12
21168
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer. .. note:: 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. """ __autho...
gpl-2.0
tenvick/hugula
Client/tools/site-packages/PIL/TgaImagePlugin.py
14
3450
# # The Python Imaging Library. # $Id: TgaImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $ # # TGA file handling # # History: # 95-09-01 fl created (reads 24-bit files only) # 97-01-04 fl support more TGA versions, including compressed images # 98-07-04 fl fixed orientation and alpha layer bugs # 98-09-11 fl ...
mit
harry-7/addons-server
src/olympia/amo/cache_nuggets.py
1
5683
import functools import hashlib import itertools import re import uuid from contextlib import contextmanager from django.conf import settings from django.core.cache import cache from django.core import cache as django_cache from django.core.cache import _create_cache from django.core.cache.backends.base import BaseCac...
bsd-3-clause
ONSdigital/eq-survey-runner
app/submitter/convert_payload_0_0_1.py
1
3626
from collections import OrderedDict from datetime import datetime def convert_answers_to_payload_0_0_1(answer_store, schema, routing_path): """ Convert answers into the data format below 'data': { '001': '01-01-2016', '002': '30-03-2016' } :param answer_store: questionnaire...
mit
x2nie/odoo
openerp/addons/base/tests/test_acl.py
338
6323
import unittest2 from lxml import etree import openerp from openerp.tools.misc import mute_logger from openerp.tests import common # test group that demo user should not have GROUP_TECHNICAL_FEATURES = 'base.group_no_one' class TestACL(common.TransactionCase): def setUp(self): super(TestACL, self).setU...
agpl-3.0
Rubisk/mcedit2
src/mcedit2/util/qglcontext.py
1
3015
""" qglcontext """ from __future__ import absolute_import, division, print_function, unicode_literals from OpenGL import GL from PySide import QtOpenGL, QtGui import logging log = logging.getLogger(__name__) def setDefaultFormat(): oglFormat = QtOpenGL.QGLFormat() oglFormat.setVersion(1, 3) oglFormat....
bsd-3-clause