repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
SlimSaber/kernel_oneplus_msm8974 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
brentdax/swift | utils/gyb_syntax_support/CommonNodes.py | 11 | 1985 | from Child import Child
from Node import Node # noqa: I201
COMMON_NODES = [
Node('Decl', kind='Syntax'),
Node('Expr', kind='Syntax'),
Node('Stmt', kind='Syntax'),
Node('Type', kind='Syntax'),
Node('Pattern', kind='Syntax'),
Node('UnknownDecl', kind='Decl'),
Node('UnknownExpr', kind='Expr')... | apache-2.0 |
abrt/faf | src/pyfaf/storage/migrations/versions/1c7edfbf8941_drop_reportunknownpackage_running_fields.py | 1 | 3689 | # Copyright (C) 2015 ABRT Team
# Copyright (C) 2015 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... | gpl-3.0 |
izonder/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_unicode.py | 177 | 1269 | r"""Fixer for unicode.
* Changes unicode to str and unichr to chr.
* If "...\u..." is not unicode literal change it into "...\\u...".
* Change u"..." into "...".
"""
from ..pgen2 import token
from .. import fixer_base
_mapping = {u"unichr" : u"chr", u"unicode" : u"str"}
class FixUnicode(fixer_base.BaseFix):
... | apache-2.0 |
pombredanne/SourceForge-Allura | ForgeTracker/forgetracker/widgets/ticket_search.py | 2 | 5248 | import tg
from pylons import c
import ew as ew_core
import ew.jinja2_ew as ew
from allura.lib.widgets import form_fields as ffw
class TicketSearchResults(ew_core.SimpleForm):
template='jinja:forgetracker:templates/tracker_widgets/ticket_search_results.html'
defaults=dict(
ew_core.SimpleForm.defaults... | apache-2.0 |
rpadilha/rvpsite | rvpsite/blog/migrations/0001_initial.py | 1 | 2442 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-03-15 16:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import s3direct.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | agpl-3.0 |
pranalik/frappe-bb | frappe/model/db_schema.py | 15 | 12290 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Syncs a database table to the `DocType` (metadata)
.. note:: This module is only used internally
"""
import os
import frappe
from frappe import _
from frappe.utils import... | mit |
JonasSC/SuMPF | tests/tests/_internal/test_interpolation.py | 1 | 11458 | # This file is a part of the "SuMPF" package
# Copyright (C) 2018-2021 Jonas Schulte-Coerne
#
# This program 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 3 of the License, or (at your ... | lgpl-3.0 |
chudaol/edx-platform | common/lib/capa/capa/tests/response_xml_factory.py | 30 | 34410 | from lxml import etree
from abc import ABCMeta, abstractmethod
class ResponseXMLFactory(object):
""" Abstract base class for capa response XML factories.
Subclasses override create_response_element and
create_input_element to produce XML of particular response types"""
__metaclass__ = ABCMeta
@a... | agpl-3.0 |
bosstb/HaberPush | youtube_dl/extractor/eitb.py | 71 | 3278 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
parse_iso8601,
sanitized_Request,
)
class EitbIE(InfoExtractor):
IE_NAME = 'eitb.tv'
_VALID_URL = r'https?://(?:www\.)?eitb\.tv/(?:eu/bideoa|es/video)/[^... | mit |
jessrosenfield/pants | src/python/pants/backend/codegen/targets/jaxb_library.py | 15 | 1613 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | apache-2.0 |
juvoinc/airflow | airflow/ti_deps/dep_context.py | 12 | 4987 | # -*- coding: utf-8 -*-
#
# 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 |
40223231/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/SDL.py | 603 | 1813 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... | gpl-3.0 |
detiber/lib_openshift | lib_openshift/models/v1_git_build_source.py | 2 | 5508 | # coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | apache-2.0 |
skyling/shadowsocks | shadowsocks/crypto/openssl.py | 1038 | 5414 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
dahlstrom-g/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_vars.py | 7 | 26282 | """ pydevd_vars deals with variables:
resolution/conversion to XML.
"""
import math
import pickle
from _pydev_bundle.pydev_imports import quote
from _pydev_imps._pydev_saved_modules import thread
from _pydevd_bundle.pydevd_constants import get_frame, get_current_thread_id, xrange, NUMPY_NUMERIC_TYPES, NUMPY_FLOATI... | apache-2.0 |
syscoin/syscoin | test/functional/mining_getblocktemplate_longpoll.py | 1 | 3612 | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from decimal import Decimal
import random
import threading
... | mit |
tchellomello/home-assistant | homeassistant/auth/permissions/merge.py | 19 | 1786 | """Merging of policies."""
from typing import Dict, List, Set, cast
from .types import CategoryType, PolicyType
def merge_policies(policies: List[PolicyType]) -> PolicyType:
"""Merge policies."""
new_policy: Dict[str, CategoryType] = {}
seen: Set[str] = set()
for policy in policies:
for categ... | apache-2.0 |
robinro/ansible | test/units/plugins/lookup/test_lastpass.py | 153 | 6918 | # (c)2016 Andrew Zenk <azenk@umn.edu>
#
# 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.
#
# ... | gpl-3.0 |
molebot/brython | www/src/Lib/test/test_importlib/builtin/test_loader.py | 26 | 3341 | import importlib
from importlib import machinery
from .. import abc
from .. import util
from . import util as builtin_util
import sys
import types
import unittest
class LoaderTests(abc.LoaderTests):
"""Test load_module() for built-in modules."""
verification = {'__name__': 'errno', '__package__': '',
... | bsd-3-clause |
byterom/android_external_chromium_org | build/get_landmines.py | 26 | 2454 | #!/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.
"""
This file emits the list of reasons why a particular build needs to be clobbered
(or a list of 'landmines').
"""
import sys
impor... | bsd-3-clause |
rmm-fcul/workshops | 2015_graz/binary_choice/two_arenas_real_real/casu_utils.py | 5 | 8116 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
a library of functions used in CASU controller dynamics. Got a lot of
messy code that would be neater like this
RM, Feb 2015
'''
import numpy as np
from assisipy import casu
#import matplotlib.cm as cm
from datetime import datetime
import parsing
import time
### ==... | lgpl-3.0 |
Lucretiel/autocommand | test/test_automain.py | 1 | 1906 | # Copyright 2014-2016 Nathan West
#
# This file is part of autocommand.
#
# autocommand 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 3 of the License, or
# (at your option) any later v... | lgpl-3.0 |
mhotwagner/backstage | facade/models.py | 1 | 2837 | from django.db import models
from ckeditor.fields import RichTextField
from solo.models import SingletonModel
from phonenumber_field import modelfields as phonenumber_models
from foti.models import Foto
from opere.models import Opera
from scritti.models import Scritto
class Profile(SingletonModel):
name = mod... | mit |
abadger/ansible | lib/ansible/plugins/action/yum.py | 11 | 4713 | # (c) 2018, Ansible Project
#
# 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... | gpl-3.0 |
Brawn1/Humidor_monitoring | libraries/ArduinoJson/third-party/gtest-1.7.0/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | mit |
qPCR4vir/orange3 | Orange/canvas/canvas/items/utils.py | 3 | 3147 | import numpy
import sip
from PyQt4.QtGui import QColor, QRadialGradient, QPainterPathStroker
from PyQt4.QtCore import QObject, QSignalMapper
from PyQt4.QtCore import pyqtSignal as Signal
def saturated(color, factor=150):
"""Return a saturated color.
"""
h = color.hsvHueF()
s = color.hsvSaturationF()... | bsd-2-clause |
hehongliang/tensorflow | tensorflow/python/kernel_tests/basic_gpu_test.py | 2 | 10569 | # 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 |
moqada/hatena2evernote | h2e.py | 1 | 11014 | # -*- coding: utf-8 -*-
import argparse
import binascii
import datetime
import hashlib
import os
import re
import requests
import time
import urllib
from evernote.api.client import EvernoteClient
from evernote.edam.type import ttypes as Types
from BeautifulSoup import BeautifulSoup
try:
from ConfigParser import Saf... | mit |
zooniverse/aggregation | docs/source/conf.py | 1 | 9778 | # -*- coding: utf-8 -*-
#
# Zooniverse Aggregation Engine documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 14 11:15:07 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | apache-2.0 |
bbqsrc/kbdgen | pysrc/kbdgen/gen/osxutil.py | 2 | 30141 | import copy
import json
import uuid
import pathlib
import itertools
import subprocess
import re
from collections import OrderedDict
import xml.etree.ElementTree as etree
from xml.etree.ElementTree import Element, SubElement
from ..bundle import parse_desktop_layout
from ..base import get_logger
from ..cldr import CP_... | apache-2.0 |
kavardak/suds | suds/mx/encoded.py | 211 | 4651 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
JuanMatSa/PyFME | src/pyfme/models/tests/test_euler_flat_earth.py | 5 | 5115 | # -*- coding: utf-8 -*-
"""
Tests of equations of euler flat earth model.
"""
import numpy as np
from pyfme.models.euler_flat_earth import (lamceq,
lamceq_jac,
kaeq,
kaeq_jac,
... | mit |
plaice/Zebrackets | src/zebrackets/zebraFont.py | 1 | 8776 | #!/usr/bin/python3
# File zebraFont.py
#
# Copyright (c) Blanca Mancilla, John Plaice, 2015, 2016
#
# 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 you... | gpl-3.0 |
Tallefer/karaka | karaka/api/api.py | 4 | 6215 | #
# Karaka Skype-XMPP Gateway: Customer API
# <http://www.vipadia.com/products/karaka.html>
#
# Copyright (C) 2008-2009 Vipadia Limited
# Richard Mortier <mort@vipadia.com>
# Neil Stratford <neils@vipadia.com>
#
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU Ge... | gpl-2.0 |
zhenwendai/RGP | gpnarx.py | 1 | 1997 | from __future__ import print_function
import GPy
import numpy as np
def transformTimeSeriesToSeq(Y, timeWindow):
Ntr,D = Y.shape
blocksNumber = Ntr - timeWindow
X = np.zeros((blocksNumber, timeWindow*D))
Ynew = np.zeros((blocksNumber,D))
for i in range(blocksNumber):
tmp = Y[i:i+timeWindow... | bsd-3-clause |
maartenq/ansible | lib/ansible/modules/network/netscaler/netscaler_service.py | 67 | 31451 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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.1',
... | gpl-3.0 |
Curious72/sympy | sympy/core/tests/test_basic.py | 11 | 6009 | """This tests sympy/core/basic.py with (ideally) no reference to subclasses
of Basic or Atom."""
from sympy.core.basic import Basic, Atom, preorder_traversal
from sympy.core.singleton import S, Singleton
from sympy.core.symbol import symbols
from sympy.core.compatibility import default_sort_key, with_metaclass
from s... | bsd-3-clause |
frewsxcv/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/support.py | 450 | 5496 | from __future__ import absolute_import, division, unicode_literals
import os
import sys
import codecs
import glob
import xml.sax.handler
base_path = os.path.split(__file__)[0]
test_dir = os.path.join(base_path, 'testdata')
sys.path.insert(0, os.path.abspath(os.path.join(base_path,
... | mpl-2.0 |
jmcarp/regulations-parser | regparser/layer/interpretations.py | 7 | 2506 | from collections import defaultdict
from regparser.citations import Label
from regparser.layer.layer import Layer
from regparser.tree import struct
from regparser.tree.interpretation import text_to_labels
class Interpretations(Layer):
"""Supplement I (interpretations) provides (sometimes very lengthy) extra
... | cc0-1.0 |
Spiderlover/Toontown | toontown/suit/SuitInvasionManagerAI.py | 1 | 11138 | import time
from random import random, randint, choice
from direct.directnotify import DirectNotifyGlobal
from direct.task import Task
from toontown.battle import SuitBattleGlobals
from toontown.toonbase.ToontownGlobals import IDES_OF_MARCH
import SuitDNA
from SuitInvasionGlobals import *
class SuitInvasionManagerAI:... | mit |
qmarlats/pyquizz | env-3/lib/python3.5/site-packages/pygments/lexers/iolang.py | 47 | 1904 | # -*- coding: utf-8 -*-
"""
pygments.lexers.iolang
~~~~~~~~~~~~~~~~~~~~~~
Lexers for the Io language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer
from pygments.token import Text, Comment, Oper... | gpl-3.0 |
morreene/tradenews | venv/Lib/site-packages/sqlalchemy/ext/baked.py | 32 | 16967 | # sqlalchemy/ext/baked.py
# Copyright (C) 2005-2016 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
"""Baked query extension.
Provides a creational pattern for the :class:`.que... | bsd-3-clause |
sw-irou/flasktest | lib/werkzeug/serving.py | 309 | 27668 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | bsd-3-clause |
bakhtout/odoo-educ | addons/website_mail/models/mail_thread.py | 338 | 1454 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
super13/tensorflow-speech-recognition-pai | src/smodels/RNN/utils.py | 1 | 1207 | import os
import tensorflow as tf
from configparser import ConfigParser
from utilities.set_dirs import get_conf_dir
conf_dir = get_conf_dir(debug=False)
parser = ConfigParser(os.environ)
parser.read(os.path.join(conf_dir, 'neural_network.ini'))
# AdamOptimizer
beta1 = parser.getfloat('optimizer', 'beta1')
beta2 = pa... | mit |
akloster/bokeh | bokeh/properties.py | 20 | 42601 | """ Properties are objects that can be assigned as class level
attributes on Bokeh models, to provide automatic serialization
and validation.
For example, the following defines a model that has integer,
string, and list[float] properties::
class Model(HasProps):
foo = Int
bar = String
baz ... | bsd-3-clause |
40223234/2015cdb_g1_0134 | static/Brython3.1.1-20150328-091302/Lib/test/test_re.py | 718 | 56009 | # FIXME: brython: implement test.support
#from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
# cpython_only
verbose = True
# FIXME: brython: Not used in this module ?
#import io
import re
# FIXME: brython: implement re.Scanner
#from re import Scanner
import sre_constants
import sys... | gpl-3.0 |
hthompson6/contrail-controller | src/config/utils/service-instance.py | 9 | 9286 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import os
import sys
import errno
import pprint
import subprocess
import time
import argparse
sys.path.insert(0, os.path.realpath('/usr/lib/python2.7/site-packages'))
sys.path.insert(
0,
os.path.realpath('/usr/lib/python2.7/... | apache-2.0 |
sguotciq/django-test | mysite/mysite/urls.py | 1 | 1262 | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | gpl-2.0 |
jamespacileo/django-france | tests/regressiontests/forms/tests/formsets.py | 50 | 41032 | # -*- coding: utf-8 -*-
from django.forms import Form, CharField, IntegerField, ValidationError, DateField
from django.forms.formsets import formset_factory, BaseFormSet
from django.utils.unittest import TestCase
class Choice(Form):
choice = CharField()
votes = IntegerField()
# FormSet allows us to use mult... | bsd-3-clause |
SDRC-AUV/ardusub | Tools/scripts/generate-manifest.py | 22 | 11584 | #!/usr/bin/python
from __future__ import print_function
import sys
import json
import os
import re
class Firmware():
def __init__(self, date=None, platform=None, vehicletype=None, filepath=None, git_sha=None, frame=None):
self.atts = dict()
self.atts["date"] = date
self.atts["platform"] =... | gpl-3.0 |
pyload/pyload | src/pyload/webui/app/blueprints/cnl_blueprint.py | 1 | 5834 | # -*- coding: utf-8 -*-
import os
from base64 import standard_b64decode
from functools import wraps
from urllib.parse import unquote
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
import flask
from flask.json import jsonify
from p... | agpl-3.0 |
bckwltn/SickRage | lib/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## 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 ... | gpl-3.0 |
drinkssu/YourVoiceAlarmBackend | lib/flask/wrappers.py | 773 | 6709 | # -*- coding: utf-8 -*-
"""
flask.wrappers
~~~~~~~~~~~~~~
Implements the WSGI wrappers (request and response).
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
from werkzeug.exce... | apache-2.0 |
gabrielaraujof/beets | beetsplug/permissions.py | 24 | 3104 | from __future__ import (division, absolute_import, print_function,
unicode_literals)
"""Fixes file permissions after the file gets written on import. Put something
like the following in your config.yaml to configure:
permissions:
file: 644
dir: 755
"""
import os
fro... | mit |
thaim/ansible | test/units/modules/source_control/test_bitbucket_access_key.py | 37 | 13671 | from ansible.module_utils.source_control.bitbucket import BitbucketHelper
from ansible.modules.source_control.bitbucket import bitbucket_access_key
from units.compat import unittest
from units.compat.mock import patch
from units.modules.utils import AnsibleFailJson, AnsibleExitJson, ModuleTestCase, set_module_args
cl... | mit |
wangjun/wakatime | wakatime/packages/requests/packages/chardet/universaldetector.py | 1776 | 6840 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | bsd-3-clause |
SoundGoof/NIPAP | tests/nipapbase.py | 7 | 39082 | #!/usr/bin/env python
# vim: et :
import logging
import unittest
import sys
sys.path.insert(0, '../nipap/')
from nipap.backend import Nipap, NipapError, NipapInputError, NipapMissingInputError, NipapExtraneousInputError, NipapValueError
from nipap.authlib import SqliteAuth
from nipap.nipapconfig import NipapConfig
c... | mit |
torchingloom/django-registration | registration/forms.py | 2 | 3191 | """
Forms and validation code for user registration.
Note that all of these forms assume Django's bundle default ``User``
model; since it's not possible for a form to anticipate in advance the
needs of custom user models, you will need to write your own forms if
you're using a custom model.
"""
from __future__ import... | bsd-3-clause |
codebox/algorithms | graph_data_structures.py | 1 | 1452 | class DirectedAdjacencyMatrix:
def __init__(self, n):
self.n = n
self.data = [[0] * n for i in range(n)]
def connect(self, i_from, i_to):
self.data[i_from][i_to] += 1
def disconnect(self, i_from, i_to):
self.data[i_from][i_to] = max(0, self.data[i_from][i_to] - 1)
def ... | mit |
Elder-of-Ozone/i3pystatus | i3pystatus/network.py | 6 | 14457 | import netifaces
from i3pystatus import IntervalModule
from i3pystatus.core.color import ColorRangeModule
from i3pystatus.core.util import make_graph, round_dict, make_bar
def count_bits(integer):
bits = 0
while (integer):
integer &= integer - 1
bits += 1
return bits
def v6_to_int(v6):
... | mit |
ZacariasBendeck/youtube-dl | youtube_dl/extractor/ro220.py | 176 | 1451 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
_TEST = {
'url': ... | unlicense |
mahadeva604/ansible-modules-extras | windows/win_dotnet_ngen.py | 5 | 1778 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Peter Mounce <public@neverrunwithscissors.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... | gpl-3.0 |
ChinaMassClouds/copenstack-server | openstack/src/horizon-2014.2/openstack_dashboard/dashboards/project/overview/panel.py | 1 | 1101 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | gpl-2.0 |
NickDaly/GemRB-FixConfig-Branch | gemrb/GUIScripts/iwd/GUIWORLD.py | 2 | 12851 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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) ... | gpl-2.0 |
jjo31/ATHAM-Fluidity | tests/turbine_flux_dg_2d/mesh/scripts/triangle_add_edgeowner.py | 20 | 4796 | #!/usr/bin/env python
import sys
import triangle
import copy
import numpy
from sets import Set
#input surface_id, filename
# 5.5.2010: this script adds a new attribute to the .edge file which holds the "owner" element number of this edge
# Here is an examle geo file for this script:
# Point(1) = {0, 0, 0, 2};
# Poi... | lgpl-2.1 |
jsma/django-cms | menus/utils.py | 11 | 4500 | # -*- coding: utf-8 -*-
from cms.models.titlemodels import Title
from cms.utils import get_language_from_request
from cms.utils.i18n import force_language, hide_untranslated
from django.conf import settings
from django.core.urlresolvers import NoReverseMatch, reverse, resolve
def mark_descendants(nodes):
for node... | bsd-3-clause |
Y3K/django | tests/multiple_database/routers.py | 379 | 1927 | from __future__ import unicode_literals
from django.db import DEFAULT_DB_ALIAS
class TestRouter(object):
"""
Vaguely behave like primary/replica, but the databases aren't assumed to
propagate changes.
"""
def db_for_read(self, model, instance=None, **hints):
if instance:
retu... | bsd-3-clause |
trustedanalytics/spark-tk | regression-tests/sparktkregtests/testcases/frames/boxcox_test.py | 12 | 5074 | # vim: set encoding=utf-8
# Copyright (c) 2016 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 require... | apache-2.0 |
vmagamedov/kinko | kinko/compile/incremental_dom.py | 1 | 9185 | from json.encoder import encode_basestring
from slimit import ast as js
from ..types import NamedArgMeta, VarArgsMeta, VarNamedArgsMeta
from ..utils import split_args, normalize_args
from ..nodes import Tuple, Symbol, Placeholder, String, Number
from ..utils import Environ
from ..compat import text_type
from ..checke... | bsd-3-clause |
mottosso/pyblish-magenta | pyblish_magenta/vendor/capture.py | 1 | 15009 | """Maya Capture
Playblasting with independent viewport, camera and display options
"""
import re
import sys
import contextlib
from maya import cmds
version_info = (1, 1, 0)
__version__ = "%s.%s.%s" % version_info
__license__ = "MIT"
def capture(camera=None,
width=None,
height=None,
... | lgpl-3.0 |
embecosm/bachmann-gdb | gdb/python/lib/gdb/prompt.py | 137 | 4210 | # Extended prompt utilities.
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any ... | gpl-2.0 |
dfalt974/SickRage | lib/unidecode/x096.py | 252 | 4610 | data = (
'Fa ', # 0x00
'Ge ', # 0x01
'He ', # 0x02
'Kun ', # 0x03
'Jiu ', # 0x04
'Yue ', # 0x05
'Lang ', # 0x06
'Du ', # 0x07
'Yu ', # 0x08
'Yan ', # 0x09
'Chang ', # 0x0a
'Xi ', # 0x0b
'Wen ', # 0x0c
'Hun ', # 0x0d
'Yan ', # 0x0e
'E ', # 0x0f
'Chan ', # 0x10
'Lan ', ... | gpl-3.0 |
xzYue/odoo | openerp/tools/image.py | 172 | 10660 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/networkx/algorithms/centrality/tests/test_degree_centrality.py | 101 | 3046 | """
Unit tests for degree centrality.
"""
from nose.tools import *
import networkx as nx
class TestDegreeCentrality:
def __init__(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.K5 = nx.complete_graph(5)
F = nx.Graph() # Florentine families
... | agpl-3.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_address.py | 16 | 16948 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# 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
# ... | bsd-3-clause |
spektom/incubator-airflow | airflow/contrib/operators/sagemaker_endpoint_operator.py | 5 | 1207 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
glenntanner3/devedeng | src/devedeng/interface_manager.py | 4 | 25492 | # Copyright 2014 (C) Raster Software Vigo (Sergio Costas)
#
# This file is part of DeVeDe-NG
#
# DeVeDe-NG 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)... | gpl-3.0 |
jgeskens/django | django/db/models/loading.py | 8 | 10624 | "Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
fro... | bsd-3-clause |
OptimusGitEtna/RestSymf | Python-3.4.2/Lib/_collections_abc.py | 68 | 19967 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | mit |
dahlstrom-g/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/btm_matcher.py | 326 | 6834 | """A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes ... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/test/test_tcl.py | 11 | 29639 | import unittest
import re
import sys
import os
from test import test_support
from subprocess import Popen, PIPE
# Skip this test if the _tkinter module wasn't built.
_tkinter = test_support.import_module('_tkinter')
# Make sure tkinter._fix runs to set up the environment
tkinter = test_support.import_fresh_module('Tk... | mit |
lstephen/construi | construi/errors.py | 1 | 1545 | import sys
import traceback
from typing import Any, Callable, Dict, NoReturn
import construi.console as console
from compose.errors import OperationFailedError
from compose.service import BuildError
from docker.errors import APIError
from .config import ConfigException, NoSuchTargetException
from .target import Build... | apache-2.0 |
garvitr/sympy | sympy/strategies/branch/tests/test_core.py | 58 | 2416 | from sympy.strategies.branch.core import (exhaust, debug, multiplex,
condition, notempty, chain, onaction, sfilter, yieldify, do_one,
identity)
from sympy.core.compatibility import get_function_name, range
def posdec(x):
if x > 0:
yield x-1
else:
yield x
def branch5(x):
if ... | bsd-3-clause |
tedi3231/openerp | build/lib/openerp/addons/project_mrp/__init__.py | 68 | 1092 | # -*- 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 |
Jitsusama/lets-do-dns | tests/unit/acme_dns_auth/authenticate/test_cleanup_stage.py | 1 | 2731 | """Tests the lets_do_dns.acme_dns_auth.authenticate.py module."""
from mock import call, ANY
import pytest
from lets_do_dns.environment import Environment
from lets_do_dns.acme_dns_auth.authenticate import Authenticate
def test_properly_initializes_resource(mocker):
stub_environment = mocker.MagicMock(
... | apache-2.0 |
amanand/vmx-docker-lwaftr | jetapp/src/conf/protos/openconfig_service_pb2.py | 1 | 59081 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: openconfig_service.proto
import sys
_b = sys.version_info[0] < 3 and (
lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobu... | apache-2.0 |
WSCU/crazyflie_ros | lib/cflib/crtp/exceptions.py | 31 | 1605 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
WoLpH/CouchPotatoServer | couchpotato/core/notifications/nmj/main.py | 10 | 3675 | from couchpotato.api import addApiView
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import re
import telnetlib
try:
import xml.etree.cElementTree as etree... | gpl-3.0 |
yonglehou/scikit-learn | examples/applications/plot_stock_market.py | 227 | 8284 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
miguel-negrao/supercollider | external_libraries/simplejson-2.3.2/__init__.py | 44 | 18618 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | gpl-3.0 |
ye11ow/phantomjs | src/breakpad/src/tools/gyp/test/library/gyptest-static.py | 430 | 2241 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple build of a "Hello, world!" program with static libraries,
including verifying that libraries are rebuilt correctly when ... | bsd-3-clause |
phoebe-project/phoebe2-docs | 2.1/examples/minimal_contact_binary.py | 1 | 5694 | #!/usr/bin/env python
# coding: utf-8
# Minimal Contact Binary System
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update ... | gpl-3.0 |
caot/intellij-community | python/lib/Lib/site-packages/django/conf/locale/id/formats.py | 78 | 1855 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, G:i:s"
TIME_FORMAT = 'G:i:s'
YEAR_MONTH_... | apache-2.0 |
erkrishna9/odoo | openerp/addons/base/tests/test_ir_actions.py | 48 | 19830 | import unittest2
from openerp.osv.orm import except_orm
import openerp.tests.common as common
from openerp.tools import mute_logger
class TestServerActionsBase(common.TransactionCase):
def setUp(self):
super(TestServerActionsBase, self).setUp()
cr, uid = self.cr, self.uid
# Models
... | agpl-3.0 |
RichardLitt/wyrd-django-dev | tests/regressiontests/localflavor/pt/tests.py | 13 | 1059 | from __future__ import unicode_literals
from django.contrib.localflavor.pt.forms import PTZipCodeField, PTPhoneNumberField
from django.test import SimpleTestCase
class PTLocalFlavorTests(SimpleTestCase):
def test_PTZipCodeField(self):
error_format = ['Enter a zip code in the format XXXX-XXX.']
v... | bsd-3-clause |
c86j224s/snippet | Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pip/_internal/operations/freeze.py | 8 | 10025 | from __future__ import absolute_import
import collections
import logging
import os
import re
import warnings
from pip._vendor import pkg_resources, six
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.pkg_resources import RequirementParseError
from pip._internal.exceptions import Installati... | apache-2.0 |
TeamSWAP/swap | external/pyinstaller/PyInstaller/cliutils/makespec.py | 10 | 1488 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | apache-2.0 |
Alexey-T/CudaText | app/py/sys/urllib3/util/timeout.py | 27 | 10003 | from __future__ import absolute_import
import time
# The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
#... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.