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
PongPi/isl-odoo
addons/product_margin/wizard/__init__.py
444
1078
# -*- 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...
agpl-3.0
EPDCenter/android_kernel_rockchip_ylp
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
LChristakis/chalice-hunter
lib/python3.4/site-packages/pip/basecommand.py
79
9310
"""Base Command class, and related routines""" from __future__ import absolute_import import logging import os import sys import traceback import optparse import warnings from pip._vendor.six import StringIO from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.download import PipSes...
mit
jackyyf/ucore_os_lab
related_info/ostep/ostep9-mlfq.py
54
12243
#! /usr/bin/env python import sys from optparse import OptionParser import random # finds the highest nonempty queue # -1 if they are all empty def FindQueue(): q = hiQueue while q > 0: if len(queue[q]) > 0: return q q -= 1 if len(queue[0]) > 0: return 0 return -1 ...
gpl-2.0
TrevorLowing/PyGames
pysollib/pysolgtk/tkwidget.py
2
10366
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- ##---------------------------------------------------------------------------## ## ## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2003 Mt. Hood Playing Card Co. ## Copyright (C) 2005-2009 Skomoroh ## ## This program is free ...
gpl-2.0
duramato/SickRage
autoProcessTV/lib/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
geophysics/mtpy
mtpy/utils/convert_coordinates_in_edis.py
1
2530
#!/usr/bin/env python """ mtpy/mtpy/uofa/convert_coordinates_in_edis.py This is a convenience script for converting coordinates in EDI files. Files are parsed and if a 'lat' or 'lon' is detected, the argument on the other side of an '=' is converted into decimal degrees. The rest of the file remains unchanged. arg...
gpl-3.0
Jgarcia-IAS/SAT
openerp/addons/base_setup/base_setup.py
382
5430
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
beckynaylor/PiSwarmSim
PiSwarmSimulator/arena.py
1
5901
# Pi-Swarm Simulator is a simple graphical simulation environment for the Pi-Swarm robots # Copyright (C) 2014 Becky Naylor, Jon Timmis, University of York # 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 ...
gpl-3.0
hickerson/bbn
fable/fable_sources/libtbx/command_line/run_tests_parallel.py
1
3187
from __future__ import division import libtbx.test_utils.parallel from libtbx.utils import Sorry, Usage import libtbx.phil import random import os import sys master_phil = libtbx.phil.parse(""" directory = None .type = path .multiple = True module = None .type = str .multiple = True nproc = 1 .type= int sh...
mit
Petraea/jsonbot
jsb/utils/pdod.py
1
1417
# gozerbot/pdod.py # # """ pickled dicts of dicts """ ## jsb imports from jsb.utils.lazydict import LazyDict from jsb.lib.persist import Persist ## Pdod class class Pdod(Persist): """ pickled dicts of dicts """ def __getitem__(self, name): """ return item with name """ if self.data.has_ke...
mit
Nikoli/youtube-dl
youtube_dl/extractor/ultimedia.py
2
3512
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, qualities, unified_strdate, clean_html, ) class UltimediaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ultimedia\.com/default/index/video[^/]+/id/(?P<i...
unlicense
jor-/scipy
scipy/optimize/tests/test_linprog.py
2
69667
""" Unit test for Linear Programming """ from __future__ import division, print_function, absolute_import import sys import numpy as np from numpy.testing import (assert_, assert_allclose, assert_equal, assert_array_less) from pytest import raises as assert_raises from scipy.optimize import ...
bsd-3-clause
Syrcon/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/skipping.py
168
12742
""" support for skip/xfail functions and markers. """ import os import sys import traceback import py import pytest from _pytest.mark import MarkInfo, MarkDecorator def pytest_addoption(parser): group = parser.getgroup("general") group.addoption('--runxfail', action="store_true", dest="runxfail", ...
mpl-2.0
mmnelemane/nova
nova/api/openstack/compute/legacy_v2/contrib/floating_ip_pools.py
79
2131
# Copyright (c) 2011 X.commerce, a business unit of eBay 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 req...
apache-2.0
EduardoMolina/SU2
SU2_PY/package_tests.py
1
9332
#!/usr/bin/env python ## \file package_tests.py # \brief _____________. # \author T. Lukaczyk # \version 7.0.3 "Blackbird" # # SU2 Project Website: https://su2code.github.io # # The SU2 Project is maintained by the SU2 Foundation # (http://su2foundation.org) # # Copyright 2012-2020, SU2 Contributors (cf. AUTHORS....
lgpl-2.1
SCSSG/Odoo-SCS
addons/edi/models/edi.py
277
31944
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2014 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
RossBrunton/django
tests/check_framework/test_model_field_deprecation.py
322
2584
from django.core import checks from django.db import models from django.test import SimpleTestCase from .tests import IsolateModelsMixin class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase): def test_default_details(self): class MyField(models.Field): system_check_deprecated_details ...
bsd-3-clause
elemson/codeacademyfinalproj
cc_markov.py
4
2430
import re import random from collections import defaultdict, deque """ Codecademy Pro Final Project supplementary code Markov Chain generator This is a text generator that uses Markov Chains to generate text using a uniform distribution. num_key_words is the number of words that compose a key (suggested: 2 or ...
gpl-2.0
Anaethelion/Geotrek
geotrek/core/models.py
1
20663
# -*- coding: utf-8 -*- import logging import functools from django.contrib.gis.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.contrib.gis.geos import fromstr, LineString from mapentity.models import MapEntityMixin from geotrek.authent.models imp...
bsd-2-clause
dispansible/dispansible
ansible/library/disp_homebrew_tap.py
1
5742
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # Based on homebrew (Andrew Dunham <andrew@du.nham.ca>) # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # t...
mit
tuxfux-hlp-notes/python-batches
archieves/batch-62/files/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py
359
33591
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full # Queue is im...
gpl-3.0
minorua/QGIS
tests/src/python/test_qgsdatetimeedit.py
12
1643
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDateTimeEdit .. 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. """ __...
gpl-2.0
WolfgangAxel/ConGames
Python-Jeopardy/Editor.py
1
18974
#!/usr/bin/python # -*- coding: iso-8859-1 -*- import Tkinter,tkFont import math import glob import os class simpleapp_tk(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent = parent self.initialize() def initialize(self): self.grid() self.HOME = os.getcwd() if not...
mit
ltilve/ChromiumGStreamerBackend
third_party/mojo/src/mojo/public/tools/bindings/mojom_bindings_generator.py
3
8427
#!/usr/bin/env python # 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. """The frontend for the Mojo bindings system.""" import argparse import imp import os import pprint import sys # Disable lint check ...
bsd-3-clause
sam-m888/gramps
gramps/gen/filters/rules/family/_regexpfathername.py
5
1856
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
Shivam-Miglani/AndroidViewClient
examples/monkeyrunner-issue-36544-workaround.py
9
2846
#! /usr/bin/env python ''' Copyright (C) 2012 Diego Torres Milano Created on Sep 8, 2012 @author: diego @see: http://code.google.com/p/android/issues/detail?id=36544 ''' import re import sys import os # This must be imported before MonkeyRunner and MonkeyDevice, # otherwise the import fails. # PyDev sets PYTHONPA...
apache-2.0
atramos/facebook-photo-sync
facebook/requests/packages/urllib3/util/request.py
1008
2089
from base64 import b64encode from ..packages.six import b ACCEPT_ENCODING = 'gzip,deflate' def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generating request headers. :param keep_ali...
gpl-3.0
sankhesh/VTK
Examples/Infovis/Python/tables1.py
13
1485
#!/usr/bin/env python """ This file contains Python code illustrating the creation and manipulation of vtkTable objects. """ from __future__ import print_function from vtk import * #------------------------------------------------------------------------------ # Script Entry Point (i.e., main() ) #-------------------...
bsd-3-clause
rjschof/gem5
src/arch/micro_asm.py
86
14724
# Copyright (c) 2003-2005 The Regents of The University of Michigan # 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 ...
bsd-3-clause
UweFleis3/Uwe
py/openage/convert/hardcoded/langcodes.py
46
8618
# language codes, as used in PE file ressources # this file is used by pefile.py langcodes = { 1: 'ar', 2: 'bg', 3: 'ca', 4: 'zh_Hans', 5: 'cs', 6: 'da', 7: 'de', 8: 'el', 9: 'en', 10: 'es', 11: 'fi', 12: 'fr', 13: 'he', 14: 'hu', 15: 'is', 16: 'it', ...
gpl-3.0
rue89-tech/edx-analytics-dashboard
analytics_dashboard/settings/logger.py
4
3377
"""Logging configuration""" import os import platform import sys from logging.handlers import SysLogHandler def get_logger_config(log_dir='/var/tmp', logging_env="no_env", edx_filename="edx.log", dev_env=False, debug=False, ...
agpl-3.0
rickerc/neutron_audit
neutron/db/routedserviceinsertion_db.py
17
4553
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 VMware, 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/li...
apache-2.0
iheitlager/django-rest-framework
rest_framework/parsers.py
78
7968
""" Parsers are used to parse the content of incoming HTTP requests. They give us a generic way of being able to handle various media types on the request, such as form content or json encoded data. """ from __future__ import unicode_literals import json from django.conf import settings from django.core.files.upload...
bsd-2-clause
cntnboys/410Lab6
build/django/build/lib.linux-x86_64-2.7/django/db/backends/postgresql_psycopg2/base.py
21
8837
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ from django.conf import settings from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper, BaseDatabaseValidation) from django.db.backends.postgresql_psycopg2.operations import DatabaseOperation...
apache-2.0
pypingou/pagure
dev-data.py
1
21989
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Populate the pagure db with some dev data. """ from __future__ import print_function, unicode_literals, absolute_import import argparse import os import tempfile import pygit2 import shutil import six from sqlalchemy import create_engine, MetaData import pagure imp...
gpl-2.0
simonwydooghe/ansible
lib/ansible/modules/packaging/os/slackpkg.py
95
6148
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kim Nørgaard # Written by Kim Nørgaard <jasen@jasen.dk> # Based on pkgng module written by bleader <bleader@ratonland.org> # that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <htt...
gpl-3.0
simonwydooghe/ansible
lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
8
14044
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
chris4795/u-boot-novena
tools/patman/get_maintainer.py
8
1239
# Copyright (c) 2012 The Chromium OS Authors. # # SPDX-License-Identifier: GPL-2.0+ # import command import gitutil import os def FindGetMaintainer(): """Look for the get_maintainer.pl script. Returns: If the script is found we'll return a path to it; else None. """ try_list = [ os.pa...
gpl-2.0
sanjuro/RCJK
vendor/gdata/Crypto/Hash/HMAC.py
226
3330
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. This is just a copy of the Python 2.2 HMAC module, modified to work when used on versions of Python before 2.2. """ __revision__ = "$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $" import strin...
apache-2.0
wayetender/whip
whip/src/adapter/frontends/rest.py
1
3325
from . import ProxyTerminus from flask import Flask from flask import request from flask import make_response import urllib2 import socket import json import threading import datetime import ssl import logging log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) network_times = open('times', 'w') network...
gpl-2.0
Zhongqilong/kbengine
kbe/res/scripts/common/Lib/test/test_email/test_policy.py
79
13417
import io import types import textwrap import unittest import email.policy import email.parser import email.generator from email import headerregistry def make_defaults(base_defaults, differences): defaults = base_defaults.copy() defaults.update(differences) return defaults class PolicyAPITests(unittest.T...
lgpl-3.0
drawks/ansible
lib/ansible/modules/database/aerospike/aerospike_migrations.py
25
18758
#!/usr/bin/python """short_description: Check or wait for migrations between nodes""" # Copyright: (c) 2018, Albert Autin # 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_METADA...
gpl-3.0
beswarm/django-allauth
allauth/socialaccount/providers/vk/tests.py
71
1253
from __future__ import absolute_import from allauth.socialaccount.tests import create_oauth2_tests from allauth.socialaccount.providers import registry from allauth.tests import MockedResponse from .provider import VKProvider class VKTests(create_oauth2_tests(registry.by_id(VKProvider.id))): def get_mocked_res...
mit
demisto/demisto-py
demisto_client/demisto_api/models/playbook_task.py
1
26685
# coding: utf-8 """ Demisto API This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web clie...
apache-2.0
grivescorbett/heroku-buildpack-python
vendor/pip-pop/pip/baseparser.py
424
10465
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
robovm/robovm-studio
python/lib/Lib/site-packages/django/contrib/admin/helpers.py
78
13324
from django import forms from django.conf import settings from django.contrib.admin.util import flatten_fieldsets, lookup_field from django.contrib.admin.util import display_for_field, label_for_field from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from d...
apache-2.0
turtleloveshoes/kitsune
kitsune/community/tests/test_api.py
13
8753
from datetime import datetime, timedelta from nose.tools import eq_ from django.test.client import RequestFactory from kitsune.community import api from kitsune.products.tests import product from kitsune.questions.tests import answer, answervote, question from kitsune.search.tests import ElasticTestCase from kitsune...
bsd-3-clause
ISIFoundation/influenzanet-website
apps/survey/api/resources.py
4
2676
from tastypie.resources import ModelResource from apps.survey.models import Profile, SurveyUser, Survey from apps.survey.survey import parse_specification from apps.survey.spec import Question, Branch, Else from pickle import loads from inspect import isclass class EpiwebModelResource(ModelResource): class Meta: ...
agpl-3.0
lizardsystem/lizard-damage
lizard_damage/migrations/0025_auto__add_field_damagescenario_ahn_version.py
1
9142
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DamageScenario.ahn_version' db.add_column(u'lizard_damage...
gpl-3.0
KamranMackey/readthedocs.org
readthedocs/projects/migrations/0041_add_programming_language.py
8
12231
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Project.programming_language' db.add_column(u'projects_pr...
mit
teampopong/crawlers
election_commission/crawlers/assembly/base.py
3
3547
#!/usr/bin/python2.7 # -*- encoding=utf-8 -*- import gevent from gevent import monkey import itertools from urlparse import urljoin from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split monkey.patch_all() class BaseCrawler(object): url_image_base = 'http://info.nec.go.kr' attrs = [] ...
agpl-3.0
axinging/sky_engine
sky/tools/webkitpy/common/system/filesystem_mock.py
11
16806
# 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 f...
bsd-3-clause
eayunstack/nova
nova/tests/objects/test_instance.py
4
54406
# 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 by applicable law or agree...
apache-2.0
Vagab0nd/SiCKRAGE
sickchill/oldbeard/providers/kat.py
1
7549
import re import traceback import urllib from collections import OrderedDict from urllib.parse import urljoin import validators from sickchill import logger from sickchill.helper.common import convert_size, try_int from sickchill.oldbeard import tvcache from sickchill.oldbeard.bs4_parser import BS4Parser from sickchi...
gpl-3.0
jackrzhang/zulip
zerver/tests/test_timestamp.py
14
1871
from django.utils.timezone import utc as timezone_utc from zerver.lib.test_classes import ZulipTestCase from zerver.lib.timestamp import floor_to_hour, floor_to_day, ceiling_to_hour, \ ceiling_to_day, timestamp_to_datetime, datetime_to_timestamp, \ TimezoneNotUTCException, convert_to_UTC from datetime import...
apache-2.0
lnielsen/invenio
invenio/legacy/bibedit/webinterface.py
2
13635
## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011, 2014 CERN. ## ## Invenio 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 ...
gpl-2.0
hbrls/weixin-api-mockup
appl/jssdk/views.py
1
1060
# -*- coding: utf-8 -*- import logging from uuid import uuid4 from flask import Blueprint, request, current_app, jsonify _logger = logging.getLogger(__name__) mod = Blueprint('jssdk', __name__, template_folder='templates') @mod.route('/cgi-bin/ticket/getticket', methods=['GET']) def getticket(): """ 获取 j...
mit
rahiel/shellstats
shellstats.py
1
3629
# -*- coding: utf-8 -*- from __future__ import division from os import getenv from os.path import isfile from sys import exit import click @click.command() @click.option("--n", default=10, help="How many commands to show.") @click.option("--plot", is_flag=True, help="Plot command usage in pie chart.") @click.option(...
mit
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/core/tests/test_eval_power.py
9
11820
from sympy.core import (Rational, Symbol, S, Float, Integer, Number, Pow, Basic, I, nan, pi, symbols) from sympy.core.tests.test_evalf import NS from sympy.functions.elementary.miscellaneous import sqrt, cbrt from sympy.functions.elementary.exponential import exp, log from sympy.functions.elementary.trigonometric impor...
mit
woltage/ansible-modules-core
web_infrastructure/django_manage.py
5
11099
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Scott Anderson <scottanderson42@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 o...
gpl-3.0
mdavid/cherokee-webserver-svnclone
admin/plugins/ssi.py
3
1122
# -*- coding: utf-8 -*- # # Cherokee-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Softwa...
gpl-2.0
snakeleon/YouCompleteMe-x86
python/ycm/tests/event_notification_test.py
1
18402
# coding: utf-8 # # Copyright (C) 2015-2016 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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,...
gpl-3.0
partofthething/home-assistant
tests/components/zwave/test_climate.py
16
32535
"""Test Z-Wave climate devices.""" import pytest from homeassistant.components.climate.const import ( ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, CURRENT_HVAC_COOL, CURRENT_HVAC_HEAT, HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_HEAT_COOL, HVAC_MODE_OFF, HVAC_MODES, PRESET_AWAY, ...
mit
inspirehep/sqlalchemy
lib/sqlalchemy/ext/associationproxy.py
45
33253
# ext/associationproxy.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Contain the ``AssociationProxy`` class. The ``AssociationProxy`` is a Py...
mit
gautam1858/tensorflow
tensorflow/python/keras/applications/nasnet.py
17
1814
# Copyright 2018 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
aadrian/w2ui
server/python/django_w2ui/django_w2ui/demo/migrations/0001_initial.py
25
4991
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Tipo_User' db.create_table(u'demo_tipo_user', ( ...
mit
reinhrst/hooks
checks/compile.py
1
4934
import os import subprocess from . import base from . import filetype from . import status class CompileCheck(base.PerFileCheck): COMPILECOMMAND = [] ONLY_IF_OLDFILE_COMPILES = True def prepareOldFileDir(self, dirname): return dirname def checkOldFile(self, changedFile): with base.T...
mit
davehunt/kuma
vendor/packages/nose/plugins/xunit.py
48
11667
"""This plugin provides test results in the standard XUnit XML format. It's designed for the `Jenkins`_ (previously Hudson) continuous build system, but will probably work for anything else that understands an XUnit-formatted XML representation of test results. Add this shell command to your builder :: nosetests...
mpl-2.0
codeaudit/pattern-1
pattern/web/json/encoder.py
26
21771
"""Implementation of JSONEncoder """ import re from decimal import Decimal def _import_speedups(): try: import _speedups return _speedups.encode_basestring_ascii, _speedups.make_encoder except ImportError: return None, None c_encode_basestring_ascii, c_make_encoder = _import_speedups() ...
bsd-3-clause
mkhuthir/learnPython
Book_pythonlearn_com/code3/bs4/__init__.py
20
18244
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a (possibly invalid) document into a tree representation. Beautiful Soup provides provides methods and Pythonic idioms that make it easy to navigate...
mit
pbaesse/Sissens
lib/python2.7/site-packages/sqlalchemy/orm/path_registry.py
28
7751
# orm/path_registry.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Path tracking utilities, representing mapper graph traversals. """ from .. ...
gpl-3.0
EntityFXCode/arsenalsuite
cpp/lib/PyQt4/examples/demos/embeddeddialogs/embeddeddialogs.py
15
9138
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.2/django/db/backends/sqlite3/introspection.py
65
5857
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict: # Maps SQL types to Django...
apache-2.0
mrbandrews/bitcoin
qa/rpc-tests/netutil.py
8
4561
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bin...
mit
chacoroot/planetary
addons/hr_expense/__init__.py
436
1079
# -*- 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
chaubold/opengm
src/interfaces/python/test.py
2
52311
import numpy import opengm import os import sys import random import opengm.learning class TestAllExampes: def test_run(self): for r, d, f in os.walk("examples"): for files in f: if files.endswith(".py"): if(not str(files).endswith('gui.py')): ...
mit
fengbeihong/tempest_automate_ironic
tempest/scenario/test_load_balancer_basic.py
4
13056
# Copyright 2014 Mirantis.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 ...
apache-2.0
prospwro/odoo
addons/hr_evaluation/__init__.py
432
1084
# -*- 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...
agpl-3.0
yiannist/ganeti
test/py/ganeti.locking_unittest.py
9
34568
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2010 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: # # 1. Redistributions of source code must retain the above copyright notice, # ...
bsd-2-clause
hamiltont/CouchPotatoServer
couchpotato/core/_base/_core/__init__.py
16
3338
from .main import Core from uuid import uuid4 def start(): return Core() config = [{ 'name': 'core', 'order': 1, 'groups': [ { 'tab': 'general', 'name': 'basics', 'description': 'Needs restart before changes take effect.', 'wizard': True, ...
gpl-3.0
GREO/gnuradio-git
gnuradio-examples/python/usrp2/qt_wfm_interface.py
10
6160
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qt_wfm_interface.ui' # # Created: Thu Jun 18 23:41:03 2009 # by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_InterfaceWindow(object): def setupUi(...
gpl-3.0
mtr574/Midburn-ThemeCamps
midburn/models.py
3
4096
from django.db import models from django.contrib.auth.models import User CAMPSTATUS = ( (0, 'Deleted'), (1, 'Accepting new members'), (2, 'Closed to new members'), (3, 'Camp will not come to Midburn 2016'), ) # Create your models here. class Camp(models.Model): users = models.ManyToManyField(User) ...
apache-2.0
gartung/dxr
dxr/plugins/rust/__init__.py
1
40098
"""DXR plugin for Rust. Relies on output from running rustc with -Zsave-analysis It is somewhat painful dealing with the untyped-ness of the CSV input. We want to treat all ids as ints rather than strings, getting this wrong causes annoying bugs because Python will not check the type of things, but does distinguish be...
mit
olafhauk/mne-python
mne/io/bti/read.py
14
2981
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # simplified BSD-3 license import numpy as np from ..utils import read_str def _unpack_matrix(fid, rows, cols, dtype, out_dtype): """Unpack matrix.""" dtype = np.dtype(dtype) string = fid.read(int(dtype.itemsize * rows * cols)) out =...
bsd-3-clause
briancoutinho0905/2dsampling
ext/ply/test/yacc_error3.py
174
1485
# ----------------------------------------------------------------------------- # yacc_error3.py # # Bad p_error() function # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # ...
bsd-3-clause
ahmadRagheb/goldenHR
erpnext/config/hr.py
19
6497
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Employee and Attendance"), "items": [ { "type": "doctype", "name": "Employee", "description": _("Employee records."), }, { "type": "doctype", "name": "Employee Attendance To...
gpl-3.0
fhaoquan/kbengine
kbe/src/lib/python/Lib/tkinter/_fix.py
76
2897
import sys, os # Delay import _tkinter until we have set TCL_LIBRARY, # so that Tcl_FindExecutable has a chance to locate its # encoding directory. # Unfortunately, we cannot know the TCL_LIBRARY directory # if we don't know the tcl version, which we cannot find out # without import Tcl. Fortunately, Tcl will itself ...
lgpl-3.0
CG-F16-4-Rutgers/steersuite-rutgers
steerstats/steersuitedb/Test.py
8
7607
import psycopg2 import psycopg2.extras from steersuitedb.Util import getTime from Sequence import TestSequence # this is not completely encapsulated by another transaction so it should # be used by the client when inserting data class Test(object): """A simple example class""" __id_name = "test_id" __tabl...
gpl-3.0
valkjsaaa/sl4a
python/gdata/tests/gdata_tests/youtube/service_test.py
89
23513
#!/usr/bin/python # # Copyright (C) 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 ...
apache-2.0
yanheven/console
openstack_dashboard/dashboards/project/network_topology/routers/tables.py
8
1108
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NTT Innovation Institute 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...
apache-2.0
bartvm/pylearn2
pylearn2/datasets/tests/test_dense_design_matrix.py
12
3329
import numpy as np from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.datasets.dense_design_matrix import DenseDesignMatrixPyTables from pylearn2.datasets.dense_design_matrix import DefaultViewConverter from pylearn2.datasets.dense_design_matrix import from_dataset from pylearn2.utils im...
bsd-3-clause
bopo/tablib
tablib/packages/xlwt3/ExcelFormulaParser.py
46
22812
### $ANTLR 2.7.7 (20060930): "xlwt/excel-formula.g" -> "ExcelFormulaParser.py"$ ### import antlr and other modules .. import sys from . import antlr ### header action >>> import struct from . import Utils from .UnicodeUtils import upack1 from .ExcelMagic import * _RVAdelta = {"R": 0, "V": 0x20, "A": 0x...
mit
geometalab/osmaxx
tests/conversion/converters/inside_worker_test/nonop_way_test.py
2
7148
from contextlib import closing import pytest import sqlalchemy from sqlalchemy.sql.schema import Table as DbTable from osmaxx.utils.frozendict import frozendict from tests.conftest import TagCombination from tests.conversion.converters.inside_worker_test.conftest import slow from tests.conversion.converters.inside_wo...
mit
guewen/connector
connector/tests/test_mapper.py
1
20300
# -*- coding: utf-8 -*- import unittest2 import mock import openerp.tests.common as common from openerp.addons.connector.unit.mapper import ( Mapper, ImportMapper, ImportMapChild, MappingDefinition, changed_by, only_create, convert, m2o_to_backend, backend_to_m2o, none, Map...
agpl-3.0
austinhyde/ansible-modules-core
cloud/openstack/os_nova_flavor.py
93
6844
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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 late...
gpl-3.0
vivianli32/TravelConnect
flask/lib/python3.4/site-packages/whoosh/matching/binary.py
94
24452
# Copyright 2010 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
mit
geekaia/edx-platform
cms/envs/aws_migrate.py
87
1229
""" A Django settings file for use on AWS while running database migrations, since we don't want to normally run the LMS with enough privileges to modify the database schema. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=...
agpl-3.0
evilgroot/ethercut
ethercut/master.py
1
6570
# coding: utf-8 # ETHERCUT SUITE # Author: Ivan 'evilgroot' Luengo # Email: evilgroot@gmail.com # This project is released under a GPLv3 license """ Master: Handles the program loop """ import pcap, Queue, logging import contextlib import ethercut.ui as ui import ethercut.log as log import ethercut...
gpl-3.0
hetajen/vnpy161
vn.api/vn.ctp/py3/pyscript/ctp_struct.py
40
315084
# encoding: UTF-8 structDict = {} #////////////////////////////////////////////////////////////////////// #@system 新一代交易所系统 #@company 上海期货信息技术有限公司 #@file ThostFtdcUserApiStruct.h #@brief 定义了客户端接口使用的业务数据结构 #@history #////////////////////////////////////////////////////////////////////// #信息分发 CThostFtdcDis...
mit