repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
rchuppala/usc_agent | src/usc-agent-dev/common/source/pyang/pyang/statements.py | 1 | 100752 | import copy
import re
from . import util
from .util import attrsearch, keysearch, prefix_to_module, \
prefix_to_modulename_and_revision
from .error import err_add
from . import types
from . import syntax
from . import grammar
from . import xpath
### Exceptions
class NotFound(Exception):
"""used when a refere... | gpl-2.0 |
StephenKing/summerschool-2015-ryu | ryu/ofproto/ofproto_v1_3.py | 3 | 49652 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | autoProcessTV/autoProcessTV.py | 1 | 3185 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
bitpay/bitcoin | qa/rpc-tests/test_framework/netutil.py | 2 | 4986 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 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
impo... | mit |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/django/template/loader_tags.py | 100 | 9868 | from collections import defaultdict
from django.template.base import (
Library, Node, Template, TemplateSyntaxError, TextNode, Variable,
token_kwargs,
)
from django.utils import six
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
class ExtendsError(Exc... | mit |
tylertian/Openstack | openstack F/cinder/cinder/openstack/common/notifier/rabbit_notifier.py | 5 | 1709 | # Copyright 2011 OpenStack LLC.
# 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 b... | apache-2.0 |
mikeengland/fireant | fireant/database/type_engine.py | 2 | 1882 | import re
class TypeEngine:
"""
Base class for database type conversions.
"""
def __init__(self, db_to_ansi_mapper, ansi_to_db_mapper):
self.db_to_ansi_mapper = db_to_ansi_mapper
self.ansi_to_db_mapper = ansi_to_db_mapper
def to_ansi(self, data_type):
"""
Translat... | apache-2.0 |
aneumeier/stocks | portfolio/__init__.py | 2 | 1605 | __version__ = '0.0.1'
DAX = [
{'symbol': 'ADS.DE', 'ISIN': 'DE000A1EWWW0'},
{'symbol': 'ALV.DE', 'ISIN': 'DE0008404005'},
{'symbol': 'BAS.DE', 'ISIN': 'DE000BASF111'},
{'symbol': 'BAYN.DE', 'ISIN': 'DE000BAY0017'},
{'symbol': 'BEI.DE', 'ISIN': 'DE0005200000'},
{'symbol': 'BMW.DE', 'ISIN': 'DE00... | agpl-3.0 |
inovtec-solutions/OpenERP | openerp/addons/account/report/common_report_header.py | 56 | 6577 | # -*- 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 |
flyrain/qemu_vmst | sig-gen/src/avg-time.py | 1 | 2588 | import sys
filename = sys.argv[1]
f = open(filename, "r");
lines = f.readlines();
count = len(lines)/5;
outlines =[]
os_type = [
'Win-XP',
'Win-XP(sp2)',
'Win-XP(sp3)',
'Win-Vista',
'Win-7',
'Win-2003',
'Win-2003(sp2)',
'Win-2008',
'Win-2008(sp2)',
'FreeBSD-7.4',
'FreeBSD-8.0',
'FreeBSD-8.2',
'FreeBSD-8.3',
'FreeBSD-9.... | gpl-2.0 |
ktan2020/legacy-automation | win/Lib/site-packages/robotframework_selenium2library-1.1.0-py2.7.egg/Selenium2Library/keywords/_waiting.py | 37 | 3039 | import time
import robot
from keywordgroup import KeywordGroup
class _WaitingKeywords(KeywordGroup):
# Public
def wait_for_condition(self, condition, timeout=None, error=None):
"""Waits until the given `condition` is true or `timeout` expires.
`code` may contain multiple lines of code but mu... | mit |
sjperkins/tensorflow | tensorflow/python/kernel_tests/basic_gpu_test.py | 5 | 10327 | # 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 |
potatolondon/django-nonrel-1-4 | django/contrib/messages/storage/session.py | 456 | 1213 | from django.contrib.messages.storage.base import BaseStorage
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
assert hasattr(request, 'session'), "The sessi... | bsd-3-clause |
madsryvang/LVsbp | python/sbp/client/drivers/pyserial_driver.py | 5 | 2544 | # Copyright (C) 2015 Swift Navigation Inc.
# Contact: Mark Fine <mark@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
#... | lgpl-3.0 |
TheAnou/Cobra | apps/public/models/checkout.py | 2 | 6798 | from datetime import timedelta
from django.db import models
from jsonfield import JSONField
from django.utils import timezone
from apps.admin.utils.exception_handling import ExceptionHandler
from apps.communication.views.email_class import Email
from apps.public.models.cart import Cart
from settings.people import sup... | gpl-2.0 |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/twill-0.9-py2.7.egg/twill/extensions/dirstack.py | 19 | 1042 | """
Extension functions for manipulating the current working directory (cwd).
Commands:
chdir -- push the cwd onto the directory stack & change to the new location.
popd -- change to the last directory on the directory stack.
"""
import os
_dirstack = []
def chdir(where):
"""
>> chdir <where>
Ch... | gpl-3.0 |
ExeClim/Isca | src/extra/python/isca/land_generator_fn.py | 4 | 11099 | # Function to allow land to be generated for a range of scenarios
# Land Options:
# 'square' (default) Square block of land with boundaries specified by boundaries keyword, a list of 4 floats in the form [S,N,W,E]
# 'continents_old' Choose continents from the original continent set-up adapted from the Sauliere 2012 pa... | gpl-3.0 |
karllessard/tensorflow | tensorflow/python/profiler/model_analyzer_test.py | 17 | 32519 | # 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 |
uthcode/learntosolveit | languages/python/software_engineering_twitter_phidget.py | 7 | 5090 | #!/usr/bin/env python
# Author: O.R.Senthil Kumaran <senthil@uthcode.com>
# Credits: Example Python Snipppet from the Phidget Library.
# Adapted from TextLCD-simple.py by 'Adam Stelmack'.
from ctypes import *
import sys
from time import sleep
#Phidget specific imports
from Phidgets.Phidget import Phidge... | bsd-3-clause |
artwr/airflow | tests/sensors/test_sql_sensor.py | 3 | 3950 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
rlr/fjord | vendor/packages/html5lib/html5lib/treebuilders/dom.py | 98 | 11384 |
from xml.dom import minidom, Node, XML_NAMESPACE, XMLNS_NAMESPACE
try:
from types import ModuleType
except:
from new import module as ModuleType
import re
import weakref
import _base
from html5lib import constants, ihatexml
from html5lib.constants import namespaces
moduleCache = {}
def getDomModule(DomImple... | bsd-3-clause |
dagoaty/eve-wspace | evewspace/search/search_base.py | 17 | 2249 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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... | gpl-3.0 |
mablae/weblate | weblate/trans/south_migrations/0032_update_have_suggestion.py | 1 | 15990 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
wasimreza08/Word-search | word_scripts/word_file_merger.py | 2 | 3478 | import threading
import time
import enchant
from profanity_filter import arrBad
path_to_save = '../app/src/main/assets/words/'
file_prefix = 'words-length-'
auto_correct = enchant.Dict('en_US') # create dictionary for US English
target = {
3: 5000,
4: 5000,
5: 5000,
6: 3000,
7: 3000,
8: 1000,... | mit |
baffolobill/django-lfs | lfs/order/models.py | 3 | 9684 | # python imports
import uuid
# django imports
from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
# lfs imports
impor... | bsd-3-clause |
tersmitten/ansible | contrib/inventory/zone.py | 196 | 1490 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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
# ... | gpl-3.0 |
Frostman/eho-horizon | horizon/test/tests/middleware.py | 12 | 1168 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
# 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/... | apache-2.0 |
adamchainz/plumbum | plumbum/commands/modifiers.py | 2 | 9668 | import os
from select import select
from subprocess import PIPE
import sys
from plumbum.commands.processes import run_proc, ProcessExecutionError
#===================================================================================================
# execution modifiers (background, foreground)
#======================... | mit |
kennedyshead/home-assistant | tests/components/config/test_automation.py | 5 | 5052 | """Test Automation config panel."""
import json
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from homeassistant.helpers import entity_registry as er
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa:... | apache-2.0 |
blackbliss/callme | flask/lib/python2.7/site-packages/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... | mit |
jordy33/yowsup | yowsup/layers/protocol_media/mediauploader.py | 41 | 5128 | from yowsup.common.http.warequest import WARequest
from yowsup.common.http.waresponseparser import JSONResponseParser
import socket, ssl, mimetypes, os, hashlib, sys
from time import sleep
import threading
import logging
logger = logging.getLogger(__name__)
class MediaUploader(WARequest, threading.Thread):
def __... | gpl-3.0 |
srickardti/openthread | tests/scripts/thread-cert/Test_Cli.py | 9 | 2008 | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
roadmapper/ansible | lib/ansible/module_utils/network/avi/avi.py | 28 | 2185 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/krasview.py | 64 | 1957 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
)
class KrasViewIE(InfoExtractor):
IE_DESC = 'Красвью'
_VALID_URL = r'https?://krasview\.ru/(?:video|embed)/(?P<id>\d+)'
_TEST = {
'url': ... | gpl-3.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/encodings/tis_620.py | 593 | 12556 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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_table)
def decode(self,input,errors='st... | mit |
Eric89GXL/scikit-learn | sklearn/cross_decomposition/cca_.py | 5 | 3379 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Parameters
----------
X : array-like of predictors, shape = [n_samples, p]
Training vectors, where n_samples is the number... | bsd-3-clause |
yuewko/neutron | neutron/tests/functional/db/test_ipam.py | 16 | 9343 | # Copyright 2015 SUSE Linux Products GmbH
# 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 ... | apache-2.0 |
Kazade/NeHe-Website | django/contrib/flatpages/views.py | 295 | 2613 | from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from django.utils.safestri... | bsd-3-clause |
VincentVW/OIPA | OIPA/indicator_unesco/admin.py | 3 | 6035 | import xml.etree.cElementTree as etree
from django.contrib import admin
from django.shortcuts import get_object_or_404
from multiupload.admin import MultiUploadAdmin
from indicator.upload_indicators_helper import find_country, find_city, get_countries, get_cities, get_value, save_log, save_city_data, save_country_data... | agpl-3.0 |
navodissa/python-flask | flask/lib/python2.7/site-packages/pkg_resources.py | 130 | 100868 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | bsd-3-clause |
tekdemo/genetic-testing | splicer/splicer.py | 1 | 6465 | #! /usr/bin/env python
import math,string,difflib,random,copy,pprint
class Sample:
class Delta:
"""Records what exactly the change was"""
def __init__(self, modification):
self.modification=modification
def __str__(self):
return "'%s' -> '%s' @ gen %s" %(self.initia... | mit |
Permutatrix/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorselenium.py | 5 | 13138 | import json
import os
import socket
import sys
import threading
import time
import traceback
import urlparse
import uuid
from .base import (Protocol,
RefTestExecutor,
RefTestImplementation,
TestharnessExecutor,
extra_timeout,
... | mpl-2.0 |
HideoYamauchi/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/install.py | 93 | 3328 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
ojengwa/grr | lib/checks/filters.py | 4 | 4923 | #!/usr/bin/env python
"""Implementation of filters, which run host data through a chain of parsers."""
import collections
from grr.lib import objectfilter
from grr.lib import registry
from grr.lib.rdfvalues import structs
class Error(Exception):
"""Base error class."""
class DefinitionError(Error):
"""A check ... | apache-2.0 |
torsten-ostgard/booru-note-copy | note_copy/cli.py | 1 | 1730 | import argparse
import sys
import time
from . import note_copy
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--source', action='store', type=str,
help='The post from which notes will be copied')
parser.add_argument('-d', '--destination', action='store',... | mit |
fuhongliang/odoo | addons/pad_project/__init__.py | 441 | 1066 | # -*- 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 |
Intel-Corporation/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/graph_io_test.py | 25 | 30118 | # 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 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/encodings/cp1254.py | 593 | 13758 | """ Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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_table)
def decode(self,in... | gpl-2.0 |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/contrib/ffmpeg/encode_audio_op_test.py | 28 | 2550 | # 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... | mit |
anconfuzedrock/tgstation | tools/mapmerge2/merge_driver_dmi.py | 53 | 6670 | #!/usr/bin/env python3
import sys
import dmi
def images_equal(left, right):
if left.size != right.size:
return False
w, h = left.size
left_load, right_load = left.load(), right.load()
for y in range(0, h):
for x in range(0, w):
lpixel, rpixel = left_load[x, y], right_load[x,... | agpl-3.0 |
jessstrap/servotk | tests/wpt/css-tests/tools/manifest/vcs.py | 101 | 3065 | import os
import subprocess
from .sourcefile import SourceFile
class Git(object):
def __init__(self, repo_root, url_base):
self.root = os.path.abspath(repo_root)
self.git = Git.get_func(repo_root)
self.url_base = url_base
@staticmethod
def get_func(repo_path):
def git(cmd... | mpl-2.0 |
ozamiatin/glance | glance/cmd/replicator.py | 7 | 25625 | #!/usr/bin/env python
# Copyright 2012 Michael Still and Canonical Inc
# Copyright 2014 SoftLayer Technologies, 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 Lice... | apache-2.0 |
letouriste001/SmartForest_2.0 | python3.4Smartforest/lib/python3.4/site-packages/django/utils/synch.py | 1 | 2558 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock(object):
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simult... | mit |
kytvi2p/Sigil | 3rdparty/python/Tools/pynche/PyncheWidget.py | 113 | 10615 | """Main Pynche (Pythonically Natural Color and Hue Editor) widget.
This window provides the basic decorations, primarily including the menubar.
It is used to bring up other windows.
"""
import sys
import os
from tkinter import *
from tkinter import messagebox, filedialog
import ColorDB
# Milliseconds between interru... | gpl-3.0 |
wuyuewen/libcloud | libcloud/container/utils/docker.py | 11 | 6225 | # 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 use ... | apache-2.0 |
guorendong/iridium-browser-ubuntu | third_party/webrtc/tools/barcode_tools/barcode_encoder.py | 43 | 15542 | #!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | bsd-3-clause |
thekerrlab/netpyne | netpyne/network/pop.py | 1 | 23939 |
"""
pop.py
Contains Population related classes
Contributors: salvadordura@gmail.com
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import map
from builtins import range
try:
basestring
excep... | mit |
freephys/python_ase | ase/transport/stm.py | 2 | 7014 | import numpy as np
from ase.transport.tools import dagger
from ase.transport.selfenergy import LeadSelfEnergy
from ase.transport.greenfunction import GreenFunction
class STM:
def __init__(self, h1, s1, h2, s2 ,h10, s10, h20, s20, eta1, eta2, w=0.5):
"""XXX
1. Tip
2. Surface
... | gpl-3.0 |
jtyr/ansible | test/support/network-integration/collections/ansible_collections/cisco/ios/plugins/modules/ios_command.py | 47 | 7484 | #!/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 |
tux-mind/platform_external_subversion | build/generator/util/executable.py | 6 | 2135 | #
#
# 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 n... | apache-2.0 |
thumbimigwe/echorizr | lib/python2.7/site-packages/django/db/models/options.py | 149 | 36502 | from __future__ import unicode_literals
import warnings
from bisect import bisect
from collections import OrderedDict, defaultdict
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist
from django.db import connections
from djang... | mit |
rlr/fjord | vendor/packages/translate-toolkit/translate/lang/test_ne.py | 33 | 2955 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage('ne')
assert language.punctranslate(u"") == u""
assert language.punctranslate(u"abc efg") == u"abc efg"
assert l... | bsd-3-clause |
zimmermatt/flink | flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/setup.py | 21 | 1358 | ################################################################################
# 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... | apache-2.0 |
Microsoft/ApplicationInsights-Python | applicationinsights/channel/TelemetryChannel.py | 1 | 4845 | import datetime
import sys
from .SynchronousQueue import SynchronousQueue
from .SynchronousSender import SynchronousSender
from .TelemetryContext import TelemetryContext
from applicationinsights.channel import contracts
platform_moniker = 'py2'
if sys.version_info >= (3, 0):
platform_moniker = 'py3'
... | mit |
alhashash/odoomrp-wip | machine_purchase/models/account_invoice.py | 29 | 2548 |
from openerp import models, fields, api
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
@api.multi
def invoice_validate(self):
res = super(AccountInvoice, self).invoice_validate()
machinery_obj = self.env['machinery']
purchase_obj = self.env['purchase.order']
... | agpl-3.0 |
fgclaramonte/Odoo-addons | product_supplier_price_wizard/__openerp__.py | 1 | 1535 | # -*- encoding: utf-8 -*-
##############################################################################
# product_supplier_price_wizard
# Copyright (c) 2016 Francisco Manuel García Claramonte <francisco@garciac.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | gpl-3.0 |
byungbok/webcon-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
yaegashi/ansible-modules-extras | cloud/vmware/vmware_maintenancemode.py | 31 | 5868 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, VMware, 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
# (at your o... | gpl-3.0 |
Elbagoury/odoo | addons/purchase/edi/purchase_order.py | 439 | 9703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 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 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/template_timings_panel/panels/TemplateTimings.py | 1 | 7602 | from debug_toolbar.panels import Panel
from django.conf import settings
from django.template.base import Template
from django.template.loader_tags import BlockNode
from debug_toolbar.panels import sql
from django.core.exceptions import ImproperlyConfigured
import threading
import functools
import time
import r... | bsd-3-clause |
jvalleroy/plinth-debian | plinth/modules/config/config.py | 4 | 10711 | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero 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 distribute... | agpl-3.0 |
pataquets/phantomjs | src/qt/qtbase/util/local_database/enumdata.py | 102 | 38654 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License... | bsd-3-clause |
nhicher/ansible | lib/ansible/modules/system/timezone.py | 32 | 32161 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Shinichi TAMURA (@tmshn)
# 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 |
nachandr/cfme_tests | cfme/tests/containers/test_search_bar.py | 3 | 2383 | from random import choice
import pytest
from cfme import test_requirements
from cfme.containers.provider import ContainersProvider
from cfme.utils.appliance.implementations.ui import navigate_to
pytestmark = [
pytest.mark.usefixtures('setup_provider'),
pytest.mark.tier(3),
pytest.mark.provider([Container... | gpl-2.0 |
florian-dacosta/OpenUpgrade | openerp/release.py | 37 | 2583 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
brython-dev/brython | www/gallery/navi.py | 2 | 1538 | from browser import document as doc
from browser import window
from browser import alert
from browser.html import *
# globals #########################
refr = False
geo = window.navigator.geolocation
watchid = 0
img = doc["world_map"]
container = doc["container"]
print(img.abs_left, img.abs_top)
projection = window.... | bsd-3-clause |
clavery/selenium | py/test/selenium/webdriver/common/page_loader.py | 65 | 1402 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
indictranstech/biggift-erpnext | erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py | 32 | 3059 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import comma_and
from frappe.model.doc... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_outputs_operations.py | 1 | 24191 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
mdeverdelhan/YHY523U-driver | src/yhy523u.py | 1 | 16290 | #!/usr/bin/python
import datetime
import os, sys, struct, serial
# Command header
HEADER = '\xAA\xBB'
# \x00\x00 according to API reference but only works with YHY632
# \xFF\xFF works for both.
RESERVED = '\xFF\xFF'
# Serial commands
CMD_SET_BAUDRATE = 0x0101
CMD_SET_NODE_NUMBER = 0x0102
CMD_READ_NODE_NUMBER = 0x010... | mit |
ayvazj/logbook | logbook/ticketing.py | 7 | 17726 | # -*- coding: utf-8 -*-
"""
logbook.ticketing
~~~~~~~~~~~~~~~~~
Implements long handlers that write to remote data stores and assign
each logging message a ticket id.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
from time import time
im... | bsd-3-clause |
SnappleCap/oh-mainline | vendor/packages/Django/django/contrib/gis/gdal/__init__.py | 104 | 2130 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-su... | agpl-3.0 |
jn7163/django | setup.py | 195 | 3257 | import os
import sys
from distutils.sysconfig import get_python_lib
from setuptools import find_packages, setup
# Warn if we are installing over top of an existing installation. This can
# cause issues where files that were deleted from a more recent Django are
# still present in site-packages. See #18115.
overlay_wa... | bsd-3-clause |
garwynn/L900_NE2_Kernel | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
abhattad4/Digi-Menu | django/utils/http.py | 285 | 9978 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... | bsd-3-clause |
pschmitt/home-assistant | homeassistant/components/zabbix/sensor.py | 20 | 5393 | """Support for Zabbix sensors."""
import logging
import voluptuous as vol
from homeassistant.components import zabbix
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Enti... | apache-2.0 |
LarsFronius/ansible | lib/ansible/modules/notification/pushover.py | 36 | 3667 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com>
# All rights reserved.
#
# 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 F... | gpl-3.0 |
sippeproject/vagoth | vagoth/interfaces/scheduler.py | 1 | 1625 | #
# Vagoth Cluster Management Framework
# Copyright (C) 2013 Robert Thomson
#
# 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 your option) any... | lgpl-2.1 |
gertingold/scipy | scipy/integrate/tests/test__quad_vec.py | 4 | 4180 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from scipy.integrate import quad_vec
def test_quad_vec_simple():
n = np.arange(10)
f = lambda x: x**n
for epsabs in [0.1, 1e-3, 1e-6]:
exact = 2**(n+1)/(n +... | bsd-3-clause |
buildbuild/buildbuild | buildbuild/users/tests/test_user_manager.py | 1 | 7300 | from django.test import TestCase
from users.models import User
from django.core.exceptions import ObjectDoesNotExist,ValidationError
class TestUserManager(TestCase):
def setUp(self):
self.valid_email = "test@example.com"
self.second_valid_email = "secondtest@example.com"
self.superuser_emai... | bsd-3-clause |
redhat-openstack/horizon | horizon/test/tests/selenium_tests.py | 5 | 4016 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
willworth/thermos | thermos/Lib/site-packages/werkzeug/exceptions.py | 104 | 20505 | # -*- coding: utf-8 -*-
"""
werkzeug.exceptions
~~~~~~~~~~~~~~~~~~~
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
Usage Example
-------------
::
from werkzeug.wrappers import BaseRequest
... | mit |
orlp/augmented-composition | beat test 1.py | 1 | 1506 | import midiwriter
import random
import math
PATTERNS = [[0.5, 0.5], [0.25, 0.25, 0.5], [0.5, 0.25, 0.25]]
SUBDIVISION_STEPS = 1
UNIFORMITY = 100
NUM_MEASURES = 40
NUM_MUTATIONS = 3
INSTRUMENT = 45
class Note(object):
def __init__(self, duration):
self.duration = duration
def weighed_choice(notes):
l... | gpl-3.0 |
pli3/enigma2-pli | lib/python/Tools/Trashcan.py | 16 | 4858 | import time
import os
import enigma
from Components.config import config
from Components import Harddisk
from twisted.internet import threads
def getTrashFolder(path):
# Returns trash folder without symlinks. Path may be file or directory or whatever.
mountpoint = Harddisk.findMountPoint(os.path.realpath(path))
mov... | gpl-2.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/build/android/pylib/forwarder.py | 5 | 12268 | # Copyright (c) 2012 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.
# pylint: disable=W0212
import fcntl
import logging
import os
import psutil
from devil.utils import cmd_helper
from pylib import constants
from pylib i... | mit |
hazrpg/calibre | src/html5lib/filters/inject_meta_charset.py | 1730 | 2746 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... | gpl-3.0 |
spirrello/spirrello-pynet-work | applied_python/lib/python2.7/site-packages/pysnmp/entity/config.py | 4 | 28990 | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
from pyasn1.compat.octets import null
from pysnmp.carrier.asyncore.dgram import udp, udp6, unix
from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha, noauth
from py... | gpl-3.0 |
saullocastro/compmech | theory/conecyl/clpt/clpt_sanders_bc4/print_strainFunc.py | 12 | 2543 | import os
import glob
import numpy as np
import sympy
from sympy import pi, sin, cos, var, Matrix
var('i1, k1, i2, j2, k2, l2', integer=True)
var('x, t, xa, xb, L, r, r2, sina, cosa')
var('A11, A12, A16, A22, A26, A66')
var('B11, B12, B16, B22, B26, B66')
var('D11, D12, D16, D22, D26, D66')
var('wx, wt, w0, w0x, w0t,... | bsd-3-clause |
Kiiv/CouchPotatoServer | libs/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
pernici/sympy | sympy/utilities/mathml/__init__.py | 14 | 1608 | """Module with some functions for MathML, like transforming MathML
content in MathML presentation.
To use this module, you will need libxml2 and libxslt, with its
respective python bindings.
"""
from sympy.utilities.pkgdata import get_resource
import xml.dom.minidom
def add_mathml_headers(s):
return """<math xml... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.