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 |
|---|---|---|---|---|---|
popazerty/test-1 | RecordTimer.py | 1 | 39985 | import os
from enigma import eEPGCache, getBestPlayableServiceReference, \
eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner
from Components.config import config
from Components.UsageConfig import defaultMoviePath
from Components.TimerSanityCheck import TimerSanityCheck
from Screens.... | gpl-2.0 |
ru-faraon/MITMf | core/packetfilter.py | 4 | 1221 | import threading
from core.utils import set_ip_forwarding, iptables
from core.logger import logger
from scapy.all import *
from traceback import print_exc
from netfilterqueue import NetfilterQueue
formatter = logging.Formatter("%(asctime)s [PacketFilter] %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
log = logger().setup... | gpl-3.0 |
djmaze/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/xcode.py | 137 | 50429 | #!/usr/bin/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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import posixpath
import re
import shutil
import subprocess
imp... | bsd-3-clause |
lzambella/Qyoutube-dl | youtube_dl/extractor/swrmediathek.py | 165 | 3660 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_duration
class SWRMediathekIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}... | gpl-3.0 |
AbsoluteMSTR/pies | pies/overrides.py | 2 | 7952 | """pies/overrides.py.
Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import
Copyright (C) 2013 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal ... | mit |
FloatingGhost/MISP | app/files/scripts/stix2/misp2stix2_mapping.py | 2 | 22427 | def attribute_data_observable(data):
return {'type': 'artifact', 'payload_bin': data}
def attribute_data_pattern(data):
return "artifact:payload_bin = '{}'".format(data)
def define_address_type(address):
if ':' in address:
return 'ipv6-addr'
return 'ipv4-addr'
def observable_as(_, attribute_v... | agpl-3.0 |
widdowquinn/pyani | docs/conf.py | 1 | 5946 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This is a configuration file with no functioning code
# pylint: skip-file
#
# pyani documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 11 13:27:32 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
... | mit |
grpc/grpc | src/python/grpcio_tests/tests/protoc_plugin/_python_plugin_test.py | 9 | 27324 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
mpeuster/estate | experiments/scale-down-hack/pox/pox/messenger/__init__.py | 37 | 19551 | # Copyright 2011,2012 James McCauley
#
# 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 ... | apache-2.0 |
gingerboy92/android_kernel_xiaomi_msm8916---messedup | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
le9i0nx/ansible | lib/ansible/plugins/lookup/together.py | 57 | 2150 | # (c) 2013, Bradley Young <young.bradley@gmail.com>
# (c) 2012-17 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: toghether
author: B... | gpl-3.0 |
jmwright/cadquery-x | gui/libs/future/backports/email/feedparser.py | 82 | 22736 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... | lgpl-3.0 |
MarkTheF4rth/youtube-dl | youtube_dl/extractor/youtube.py | 20 | 92251 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
from ..compat import (
compat_chr,
com... | unlicense |
torte/lymph | setup.py | 2 | 2729 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import sys
with open('README.rst') as f:
description = f.read()
install_requires = [
'docopt>=0.6.1',
'kazoo>=1.3.1',
'kombu>=3.0.16',
'gevent',
'msgpack-python>=0.4.0',
'psutil>=2.1.1',
'PyYAML>=3.11',
'pyzmq>=1... | apache-2.0 |
websbydrew/TestPython | Python Files/Exercise Files/Ch5/htmlparsing_finished.py | 2 | 1751 | #
# Example file for parsing and processing HTML
# (For Python 3.x, be sure to use the ExampleSnippets3.txt file)
# import the HTMLParser module
from HTMLParser import HTMLParser
metacount = 0;
# create a subclass and override the handler methods
class MyHTMLParser(HTMLParser):
# function to handle an opening tag... | gpl-3.0 |
coderbone/SickRage | lib/sqlalchemy/inspection.py | 79 | 3103 | # sqlalchemy/inspect.py
# Copyright (C) 2005-2014 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
"""The inspection module provides the :func:`.inspect` function,
which delivers ... | gpl-3.0 |
cgstudiomap/cgstudiomap | main/eggs/phonenumbers-7.1.1-py2.7.egg/phonenumbers/data/region_RE.py | 11 | 1850 | """Auto-generated file, do not edit by hand. RE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_RE = PhoneMetadata(id='RE', country_code=262, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[268]\\d{8}', possible_number_pattern='\... | agpl-3.0 |
nijel/weblate | weblate/trans/validators.py | 1 | 1538 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://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, either version 3 of the Lice... | gpl-3.0 |
alistairlow/tensorflow | tensorflow/python/ops/string_ops.py | 33 | 5311 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Widiot/simpleblog | venv/lib/python3.5/site-packages/pygments/plugin.py | 25 | 1721 | # -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
yourlexer = yourmodule:YourLexer
formatter pl... | mit |
antonvino/inmoov-basic | hexapod_scripts_base/maestro_lib.py | 1 | 13426 | ###########################################################################################
# Filename:
# Device.py
###########################################################################################
# Project Authors:
# Juhapekka Piiroinen
# Brian Wu
#
# Changes:
# June 14, 2010 by Juhapekka Pi... | mit |
erickt/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/mongodb/fields/json.py | 44 | 2251 | """
JSONField automatically serializes most Python terms to JSON data.
Creates a TEXT field with a default value of "{}". See test_json.py for
more information.
from django.db import models
from django_extensions.db.fields import json
class LOL(models.Model):
extra = json.JSONField()
"""
import six
import d... | apache-2.0 |
yongshengwang/hue | desktop/core/src/desktop/api2.py | 21 | 4908 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
apanju/GMIO_Odoo | addons/stock_picking_wave/__init__.py | 374 | 1105 | # -*- 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 |
mimoralea/king-pong | multicnet.py | 1 | 6980 | import tensorflow as tf
import cv2
import numpy as np
class MultilayerConvolutionalNetwork:
"""
This class manages the deep neural network
that will be used by the agent to learn
and extrapolate the state space
"""
def __init__(self, input_width, input_height, nimages, nchannels):
self.... | mit |
scipy/scipy | scipy/signal/tests/test_max_len_seq.py | 12 | 3106 | import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from pytest import raises as assert_raises
from numpy.fft import fft, ifft
from scipy.signal import max_len_seq
class TestMLS:
def test_mls_inputs(self):
# can't all be zero state
assert_raises(ValueError, max_len_... | bsd-3-clause |
wilsonkichoi/zipline | zipline/data/data_portal.py | 1 | 64491 | #
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
kingvuplus/italysat-enigma3 | tools/host_tools/FormatConverter/satxml.py | 112 | 2759 | import os
from datasource import datasource
from xml.dom import minidom
from xml.dom.minidom import Document
from input import inputText
class satxml(datasource):
def __init__(self, filename = "satellites.xml"):
self.filename = filename
datasource.__init__(self)
if not os.path.isfile(filename):
print "File ... | gpl-2.0 |
trinitysoulstars/astralturf | lyriscisssor.py | 1 | 2800 | import nltk
from nltk import FreqDist
import json
import csv
print "* Loading corpus"
#raw = gutenberg.raw('melville-moby_dick.txt')
#raw = gutenberg.raw('bible-kjv.txt')
#raw = gutenberg.raw('tss-lyrics.txt')
lines = []
with open("tss-lyrics.txt", 'r') as raw:
lines = raw.read()
print "* Tokenizing"
#tokens =... | agpl-3.0 |
stevekuznetsov/ansible | test/runner/lib/changes.py | 39 | 5484 | """Detect changes in Ansible code."""
from __future__ import absolute_import, print_function
import re
import os
from lib.util import (
ApplicationError,
SubprocessError,
MissingEnvironmentVariable,
CommonConfig,
display,
)
from lib.http import (
HttpClient,
urlencode,
)
from lib.git im... | gpl-3.0 |
MwanzanFelipe/rockletonfortune | lib/django/db/backends/postgresql/version.py | 632 | 1517 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL #.#.#
# EnterpriseDB #.#
# PostgreSQL #.# beta#
# PostgreSQL #.#beta#
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | bsd-3-clause |
abtink/openthread | tests/scripts/thread-cert/border_router/test_multi_thread_networks.py | 1 | 5473 | #!/usr/bin/env python3
#
# Copyright (c) 2020, 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 |
praekelt/django-football365 | football365/migrations/0001_initial.py | 1 | 1330 | # -*- coding: utf-8 -*-
import 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 'Call'
db.create_table('football365_call', (
('id', self.gf('django.db.models.fie... | bsd-3-clause |
albatrossandco/brubeck_cms | brubeck/articles/views.py | 1 | 4971 | # Imports from standard libraries
from datetime import date, datetime, time, timedelta
# Imports from Django
from django.core.paginator import EmptyPage, InvalidPage, Paginator
from django.contrib.sites.models import Site
from django.http import Http404, HttpResponsePermanentRedirect
from django.template import Reques... | bsd-3-clause |
Kami/libcloud | libcloud/common/dimensiondata.py | 3 | 58274 | # 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 |
Cuuuurzel/KiPyCalc | sympy/liealgebras/weyl_group.py | 17 | 14811 | # -*- coding: utf-8 -*-
from sympy.core import Basic, Rational
from sympy.core.numbers import igcd
from .cartan_type import CartanType
from sympy.mpmath import fac
from operator import itemgetter
from itertools import groupby
from sympy.matrices import Matrix, eye
class WeylGroup(Basic):
"""
For each semisim... | mit |
oceanfly/linux | 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 |
Baz2013/blog_demo | leetcode/easy/pascal_triangle.py | 1 | 1246 | # -*- coding:utf-8 -*-
# 118. Pascal's Triangle QuestionEditorial Solution My Submissions
# Difficulty: Easy
# Contributors: Admin
# Given numRows, generate the first numRows of Pascal's triangle.
#
# For example, given numRows = 5,
# Return
#
# [
# [1],
# [1,1],
# [1,2,1],
# [1,3,3,1],
# [1,4,6,4,1]... | gpl-3.0 |
gojira/tensorflow | tensorflow/contrib/coder/python/layers/entropybottleneck.py | 9 | 30102 | # -*- coding: utf-8 -*-
# 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
#
# Un... | apache-2.0 |
nevillegrech/stdl | src/STDL/Tests/DependsOnTest.py | 1 | 4539 | import unittest
import sys
sys.path=['..'] + sys.path
from Parser import Parser # code from module you're testing
from DependsOn import *
from Exceptions import *
class SimpleTests(unittest.TestCase):
def setUp(self):
"""Call before every test case."""
self.parser = Parser()
self... | epl-1.0 |
SukkoPera/Arduino-Sensoria | python/server2.py | 1 | 1152 | #!/usr/bin/env python
import time
import server
import argparse
DEFAULT_NAME = "Server2"
class OutdoorSensor (server.TemperatureSensor):
def __init__ (self):
super (OutdoorSensor, self).__init__ ("OS", "Outdoor Sensor", "20171127")
class OutdoorLight (server.ControlledRelayActuator):
def __init__ (self):
supe... | gpl-3.0 |
ytc301/ec2-auto-scaler | providers/aws.py | 3 | 7385 | import logging
from datetime import timedelta
from datetime import datetime
import time
from boto import ec2
from boto.ec2 import cloudwatch
from errors import ScaleError, InstanceLaunchTimeOut, SpotRequestTimeOut
from providers import Providers
class AWS(Providers):
def __init__(self, access_key_id, secret_acces... | mit |
sitigrema/sitigrema.github.io | build.py | 1 | 10927 | #!/usr/bin/env python3
import os
import shutil
import json
import yaml
from PIL import Image
from nxtools import *
class GremaProduct():
def __init__(self, parent, title):
self.parent = parent
self.title = title
self.slug = slugify(title)
@property
def data_dir(self):
re... | mit |
wrouesnel/ansible | lib/ansible/module_utils/cloudstack.py | 10 | 23642 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import sys
import time
from ansible... | gpl-3.0 |
andrew-aladev/samba-talloc-debug | buildtools/wafadmin/Tools/qt4.py | 16 | 14672 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"""
Qt4 support
If QT4_ROOT is given (absolute path), the configuration will look in it first
This module also demonstrates how to add tasks dynamically (when the build has started)
"""
try:
from xml.sax import make_parser
from xml.sax.handler impo... | gpl-3.0 |
OpenCode/l10n-italy | __unported__/l10n_it_prima_nota_cassa/__openerp__.py | 3 | 1526 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011-2013 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... | agpl-3.0 |
ethanhlc/streamlink | examples/gst-player.py | 3 | 3875 | #!/usr/bin/env python
from __future__ import print_function
import sys
import gi
from gi.repository import GObject as gobject, Gst as gst
from streamlink import Streamlink, StreamError, PluginError, NoPluginError
def exit(msg):
print(msg, file=sys.stderr)
sys.exit()
class StreamlinkPlayer(object):
d... | bsd-2-clause |
bukalov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/workspace_mock.py | 191 | 1871 | # Copyright (C) 2011 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 |
fujunwei/chromium-crosswalk | ppapi/generators/idl_node.py | 103 | 13144 | #!/usr/bin/env python
# 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.
"""Nodes for PPAPI IDL AST"""
#
# IDL Node
#
# IDL Node defines the IDLAttribute and IDLNode objects which are constructed
# by th... | bsd-3-clause |
yaroslavprogrammer/django | tests/forms_tests/tests/test_media.py | 131 | 45513 | # -*- coding: utf-8 -*-
from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
from django.template import Template, Context
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
STATIC_URL=None,
MEDIA_URL='http://media.example.com/med... | bsd-3-clause |
UK992/servo | tests/wpt/web-platform-tests/webdriver/tests/take_screenshot/user_prompts.py | 13 | 3735 | # META: timeout=long
import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_png, assert_success
from tests.support.inline import inline
def take_screenshot(session):
return session.transport.send(
"GET", "session/{session_id}/screenshot".format(**vars(session)))
@p... | mpl-2.0 |
Spiderlover/Toontown | otp/launcher/DummyLauncherBase.py | 5 | 4454 | from pandac.PandaModules import *
import string
from direct.showbase.MessengerGlobal import *
from direct.showbase.DirectObject import DirectObject
from direct.showbase.EventManagerGlobal import *
from direct.task.TaskManagerGlobal import *
from direct.task.Task import Task
class DummyLauncherBase:
def __init__(s... | mit |
schets/scikit-learn | examples/mixture/plot_gmm_sin.py | 248 | 2747 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
randynobx/ansible | lib/ansible/modules/network/panos/panos_lic.py | 78 | 4915 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
miconof/headphones | lib/unidecode/x06a.py | 252 | 4674 | data = (
'Di ', # 0x00
'Zhuang ', # 0x01
'Le ', # 0x02
'Lang ', # 0x03
'Chen ', # 0x04
'Cong ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Qing ', # 0x08
'Shuang ', # 0x09
'Fan ', # 0x0a
'Tong ', # 0x0b
'Guan ', # 0x0c
'Ji ', # 0x0d
'Suo ', # 0x0e
'Lei ', # 0x0f
'Lu ', # 0x1... | gpl-3.0 |
hj3938/zulip | zerver/management/commands/email-mirror.py | 114 | 6746 | #!/usr/bin/python
"""
Forward messages sent to the configured email gateway to Zulip.
For zulip.com, messages to that address go to the Inbox of emailgateway@zulip.com.
Zulip voyager configurations will differ.
Messages meant for Zulip have a special recipient form of
<stream name>+<regenerable stream token>@st... | apache-2.0 |
openhumanoids/oh-distro | ipab-distro/tests/systemtests/src/exoticaLWR/test.py | 1 | 1072 | from director import transformUtils
import numpy
if ikPlanner.pushToMatlab==True:
print "FAILURE - pushing requests to matlab"
exit()
qT=numpy.array([0, 0, 0, 0, 0, 0, -6.310489698080346e-05, 0.34103086590766907, 3.8130277971504256e-05, 1.4273228645324707, 5.833456089021638e-05, -0.4845042824745178, -3.8867587136... | bsd-3-clause |
atsushieno/cerbero | cerbero/tools/libtool.py | 2 | 5912 | #!/usr/bin/env python3
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free S... | lgpl-2.1 |
raspberrypi360/python_games | hacker_rank/join_circlesUT.py | 1 | 1942 | import unittest
import join_circles
class Test(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testStock(self):
self.assertEqual(18, join_circles.numCombos([1,2,3,4], 3))
self.assertEqual(180, join_circles.numCombos([1,2,3,4,5], 3))
s, nu... | gpl-2.0 |
GauravSahu/odoo | addons/product/tests/test_pricelist.py | 280 | 6748 | from openerp.tests.common import TransactionCase
class TestPricelist(TransactionCase):
"""Tests for unit of measure conversion"""
def setUp(self):
super(TestPricelist, self).setUp()
cr, uid, context = self.cr, self.uid, {}
self.ir_model_data = self.registry('ir.model.data')
sel... | agpl-3.0 |
vrieni/orange | Orange/OrangeWidgets/Unsupervised/OWPCA.py | 6 | 21788 | """
<name>PCA</name>
<description>Perform Principal Component Analysis</description>
<contact>ales.erjavec(@ at @)fri.uni-lj.si</contact>
<icon>icons/PCA.svg</icon>
<tags>pca,principal,component,projection</tags>
<priority>3050</priority>
"""
import sys
import numpy as np
from PyQt4.Qwt5 import QwtPlot, QwtPlotCurve... | gpl-3.0 |
redhat-openstack/horizon | openstack_dashboard/test/test_data/utils.py | 14 | 4574 | # 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 |
dbentley/pants | contrib/android/tests/python/pants_test/contrib/android/tasks/test_aapt_gen_integration.py | 14 | 4947 | # coding=utf-8
# Copyright 2015 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)
import os
import re
... | apache-2.0 |
codeforamerica/skillcamp | ENV/lib/python2.7/site-packages/sqlalchemy/event/registry.py | 77 | 7468 | # event/registry.py
# Copyright (C) 2005-2014 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
"""Provides managed registration services on behalf of :func:`.listen`
arguments.
B... | mit |
ShineFan/odoo | addons/report_intrastat/__init__.py | 377 | 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... | agpl-3.0 |
vipulkanade/EventbriteDjango | lib/python2.7/site-packages/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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... | mit |
karthikvadla16/spark-tk | python/sparktk/graph/ops/betweenness_centrality.py | 7 | 2366 | # 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 |
citrix-openstack-build/python-novaclient | novaclient/v1_1/client.py | 7 | 7348 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# 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.ap... | apache-2.0 |
waterponey/scikit-learn | examples/semi_supervised/plot_label_propagation_structure.py | 55 | 2433 | """
==============================================
Label Propagation learning a complex structure
==============================================
Example of LabelPropagation learning a complex internal structure
to demonstrate "manifold learning". The outer circle should be
labeled "red" and the inner circle "blue". Be... | bsd-3-clause |
guiquanz/googletest | test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 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... | bsd-3-clause |
lulandco/SickRage | lib/github/GistHistoryState.py | 74 | 10159 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
1st1/uvloop | tests/test_base.py | 1 | 25924 | import asyncio
import fcntl
import logging
import os
import sys
import threading
import time
import uvloop
import unittest
import weakref
from unittest import mock
from uvloop._testbase import UVTestCase, AIOTestCase
class _TestBase:
def test_close(self):
self.assertFalse(self.loop._closed)
self... | mit |
django-notifications/django-notifications | notifications/migrations/0001_initial.py | 1 | 2201 | # -*- coding: utf-8 -*-
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import swapper
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0001_initial'),
]
... | bsd-3-clause |
catapult-project/catapult | third_party/gsutil/gslib/vendored/boto/boto/ec2/tag.py | 181 | 3076 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# withou... | bsd-3-clause |
gsalgado/pyethapp | pyethapp/accounts.py | 1 | 20516 | import json
import os
from random import SystemRandom
import shutil
from uuid import UUID
from devp2p.service import BaseService
from ethereum.tools import keys
from ethereum.slogging import get_logger
from ethereum.utils import privtopub # this is different than the one used in devp2p.crypto
from ethereum.utils impo... | mit |
imsparsh/python-for-android | python3-alpha/extra_modules/pyxmpp2/ext/component.py | 46 | 7090 | #
# (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
lgp171188/fjord | vendor/packages/urllib3/dummyserver/handlers.py | 10 | 7113 | from __future__ import print_function
import gzip
import json
import logging
import sys
import time
import zlib
from io import BytesIO
from tornado.wsgi import HTTPRequest
try:
from urllib.parse import urlsplit
except ImportError:
from urlparse import urlsplit
log = logging.getLogger(__name__)
class Respo... | bsd-3-clause |
tsufiev/horizon | openstack_dashboard/dashboards/admin/volumes/snapshots/views.py | 3 | 2439 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
SchrodingersGat/InvenTree | InvenTree/report/serializers.py | 2 | 2030 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from InvenTree.serializers import InvenTreeModelSerializer
from InvenTree.serializers import InvenTreeAttachmentSerializerField
from .models import TestReport
from .models import BuildReport
from .models import BillOfMaterialsReport
from .models import P... | mit |
louietsai/python-for-android | python-modules/twisted/twisted/spread/flavors.py | 56 | 21733 | # -*- test-case-name: twisted.test.test_pb -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module represents flavors of remotely acessible objects.
Currently this is only objects accessible through Perspective Broker, but will
hopefully encompass all forms of remote acce... | apache-2.0 |
NLnetLabs/ldns | contrib/python/examples/ldns-signzone.py | 9 | 1609 | #!/usr/bin/python
# This example shows how to sign a given zone file with private key
import ldns
import sys, os, time
#private key TAG which identifies the private key
#use ldns-keygen.py in order to obtain private key
keytag = 30761
# Read zone file
#-------------------------------------------------------------
... | bsd-3-clause |
juanalfonsopr/odoo | addons/sale/sales_team.py | 171 | 4218 | # -*- coding: utf-8 -*-
import calendar
from datetime import date
from dateutil import relativedelta
import json
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.float_utils import float_repr
class crm_case_section(osv.osv):
_inherit = 'crm.case.section'
def _get_sale_orders_... | agpl-3.0 |
BorgERP/borg-erp-6of3 | addons/event_project/event_project.py | 9 | 2565 | # -*- 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 |
mikjo/bigitr | unit_test/daemonconfig_test.py | 1 | 4363 | #
# Copyright 2012 SAS Institute
#
# 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 ... | apache-2.0 |
freakboy3742/pyxero | xero/constants.py | 3 | 2057 | XERO_BASE_URL = "https://api.xero.com"
REQUEST_TOKEN_URL = "/oauth/RequestToken"
AUTHORIZE_URL = "/oauth/Authorize"
ACCESS_TOKEN_URL = "/oauth/AccessToken"
XERO_API_URL = "/api.xro/2.0"
XERO_FILES_URL = "/files.xro/1.0"
XERO_PAYROLL_URL = "/payroll.xro/1.0"
XERO_PROJECTS_URL = "/projects.xro/2.0"
XERO_OAUTH2_AUTHORIZ... | bsd-3-clause |
shangwuhencc/scikit-learn | examples/cluster/plot_kmeans_assumptions.py | 270 | 2040 | """
====================================
Demonstration of k-means assumptions
====================================
This example is meant to illustrate situations where k-means will produce
unintuitive and possibly unexpected clusters. In the first three plots, the
input data does not conform to some implicit assumptio... | bsd-3-clause |
xuru/pyvisdk | pyvisdk/do/host_network_traffic_shaping_policy.py | 1 | 1089 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostNetworkTrafficShapingPolicy(vim, *args, **kwargs):
'''This data object type descr... | mit |
rogerhu/django | django/middleware/common.py | 11 | 7283 | import hashlib
import logging
import re
import warnings
from django.conf import settings
from django.core.mail import mail_managers
from django.core import urlresolvers
from django import http
from django.utils.encoding import force_text
from django.utils.http import urlquote
from django.utils import six
logger = lo... | bsd-3-clause |
shail2810/nova | nova/tests/functional/test_servers.py | 31 | 19364 | # Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
oaubert/advene | lib/advene/plugins/tts.py | 1 | 14814 | #
# Advene: Annotate Digital Videos, Exchange on the NEt
# Copyright (C) 2008-2017 Olivier Aubert <contact@olivieraubert.net>
#
# Advene 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 ... | gpl-2.0 |
d9pouces/StarterPyth | starterpyth/model.py | 1 | 13326 | # -*- coding=utf-8 -*-
import datetime
import os
import shutil
import subprocess
from jinja2 import ChoiceLoader
import pkg_resources
from six import u
from starterpyth.cliforms import BaseForm
from starterpyth.utils import binary_path, walk
from starterpyth.log import display, GREEN, CYAN, RED
from starterpyth.trans... | gpl-2.0 |
dh4nav/lammps | tools/python/pizza/dump.py | 21 | 40376 | # Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html
# Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
#
# Copyright (2005) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is... | gpl-2.0 |
algorhythms/LeetCode | 652 Find Duplicate Subtrees.py | 1 | 2915 | #!/usr/bin/python3
"""
Given a binary tree, return all duplicate subtrees. For each kind of duplicate
subtrees, you only need to return the root node of any one of them.
Two trees are duplicate if they have the same structure with same node values.
Example 1:
1
/ \
2 3
/ / \
4 2 ... | mit |
Comcast/neutron | neutron/debug/debug_agent.py | 4 | 7959 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nachi Ueno, NTT MCL, 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:/... | apache-2.0 |
civisanalytics/civis-python | civis/cli/_cli_commands.py | 1 | 11952 | #!/usr/bin/env python3
"""
Additional commands to add to the CLI beyond the OpenAPI spec.
"""
from __future__ import print_function
import functools
import operator
import os
import sys
import time
import click
import requests
import webbrowser
import civis
from civis.io import file_to_civis, civis_to_file
# From ... | bsd-3-clause |
dhimmel/networkx | networkx/generators/tests/test_line.py | 57 | 2357 | import networkx as nx
from nose.tools import *
import networkx.generators.line as line
def test_node_func():
# graph
G = nx.Graph()
G.add_edge(1,2)
nf = line._node_func(G)
assert_equal(nf(1,2), (1,2))
assert_equal(nf(2,1), (1,2))
# multigraph
G = nx.MultiGraph()
G.add_edge(1,2)
... | bsd-3-clause |
cchurch/ansible | test/units/modules/storage/netapp/test_netapp_e_auditlog.py | 68 | 10758 | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.modules.storage.netapp.netapp_e_auditlog import AuditLog
from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args
__metaclass__ = type
from units.compat import mock... | gpl-3.0 |
erjohnso/ansible | lib/ansible/modules/system/aix_inittab.py | 26 | 7531 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Joris Weijters <joris.weijters@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
catapult-project/catapult | telemetry/telemetry/internal/backends/chrome/android_browser_finder.py | 3 | 20134 | # 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.
"""Finds android browsers that can be started and controlled by telemetry."""
from __future__ import absolute_import
import contextlib
import logging
import... | bsd-3-clause |
koushikcgit/xen-api | scripts/import-boxgrinder.py | 25 | 9294 | #!/usr/bin/env python
#
# Copyright (C) Citrix Inc
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DI... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.