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 |
|---|---|---|---|---|---|
CapnBry/OctoPrint | src/octoprint/util/avr_isp/stk500v2.py | 56 | 4607 | import os, struct, sys, time
from serial import Serial
from serial import SerialException
import ispBase, intelHex
class Stk500v2(ispBase.IspBase):
def __init__(self):
self.serial = None
self.seq = 1
self.lastAddr = -1
self.progressCallback = None
def connect(self, port = 'COM22', speed = 115200):
if s... | agpl-3.0 |
berrange/nova | nova/cells/state.py | 1 | 18361 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
vmax-feihu/hue | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/management/commands/openid_cleanup.py | 45 | 1691 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# 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 ... | apache-2.0 |
alexanderturner/ansible | lib/ansible/modules/cloud/ovirt/ovirt_external_providers.py | 13 | 9843 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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
#... | gpl-3.0 |
apache/flink | flink-python/pyflink/common/watermark_strategy.py | 13 | 5378 | ################################################################################
# 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 |
xbmc/xbmc-antiquated | xbmc/lib/libPython/Python/Lib/plat-mac/lib-scriptpackages/SystemEvents/System_Events_Suite.py | 82 | 3770 | """Suite System Events Suite: Terms and Events for controlling the System Events application
Level 1, version 1
Generated from /System/Library/CoreServices/System Events.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'sevs'
class System_Events_Suite_Events:
def... | gpl-2.0 |
smunaut/gnuradio | gnuradio-runtime/examples/mp-sched/run_synthetic.py | 78 | 3989 | #!/usr/bin/env python
#
# Copyright 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
bastik/youtube-dl | youtube_dl/extractor/sexykarma.py | 90 | 4429 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
parse_duration,
int_or_none,
)
class SexyKarmaIE(InfoExtractor):
IE_DESC = 'Sexy Karma and Watch Indian Porn'
_VALID_URL = r'https?://(?:www\.)?(?:sexykarma\... | unlicense |
vpodzime/pykickstart | tests/commands/services.py | 8 | 2119 | # Andy Lindeberg <alindebe@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be use... | gpl-2.0 |
furatto-totsuka/gen_eventpaper | src/main.py | 1 | 7173 | # python
# -*- coding: utf-8 -*-
import argparse
import openpyxl
from data import EventManager, Day, EventList
from jinja2 import Environment, FileSystemLoader
from pprint import pprint
parser = argparse.ArgumentParser(description='ふらっとステーション・とつか ふらっとイベントだより生成ツール')
parser.add_argument('filename',
... | apache-2.0 |
davido/buck | third-party/py/pex/pex/finders.py | 37 | 10270 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""The finders we wish we had in setuptools.
As of setuptools 3.3, the only finder for zip-based distributions is for eggs. The path-based
finder only searches paths ending in .egg and n... | apache-2.0 |
dahaic/outerspace | client/osci/dialog/ResearchDlg.py | 2 | 18708 | #
# Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Outer Space.
#
# Outer Space 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
# (... | gpl-2.0 |
wmvanvliet/mne-python | mne/io/diff.py | 14 | 1219 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD Style.
import numpy as np
from ..utils import logger, verbose
@verbose
def is_equal(first, second, verbose=None):
"""Check if 2 python structures are the same.
Designed to handle dict, list, np.ndarray etc.
"""
all_equal = ... | bsd-3-clause |
bthirion/scikit-learn | examples/gaussian_process/plot_gpc.py | 103 | 3927 | """
====================================================================
Probabilistic predictions with Gaussian process classification (GPC)
====================================================================
This example illustrates the predicted probability of GPC for an RBF kernel
with different choices of the hy... | bsd-3-clause |
vmindru/ansible | lib/ansible/plugins/httpapi/fortimanager.py | 42 | 13169 | # Copyright (c) 2018 Fortinet and/or its affiliates.
#
# 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 late... | gpl-3.0 |
machinecoin-project/machinecoin | test/util/machinecoin-util-test.py | 2 | 6744 | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for machinecoin utils.
Runs automatically during `make ch... | mit |
nhippenmeyer/django | django/conf/locale/nl/formats.py | 504 | 4472 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 ja... | bsd-3-clause |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## 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 |
mccredie/lostcities | lostcities/test/test_drawgameproxy.py | 1 | 2908 |
import unittest
from .. import drawgameproxy
from .. import game
from ..illeaglemoveerror import IlleagleMoveError
from . import test_gameproxybase
class MockGame:
def __init__(self):
self.draw_player = None
self.draw_from_player = None
self.draw_from_adventure = None
self.draw_f... | mit |
ejeschke/ginga | ginga/tests/test_cmap.py | 3 | 2925 | """Unit Tests for the cmap.py functions"""
import numpy as np
import pytest
import ginga.cmap
from ginga.cmap import ColorMap
class TestCmap(object):
def setup_class(self):
pass
def test_ColorMap_init(self):
test_clst = tuple([(x, x, x)
for x in np.linspace(0, 1,... | bsd-3-clause |
SteveXiSong/ECE757-SnoopingPredictions | src/python/m5/ticks.py | 57 | 3499 | # Copyright (c) 2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
teamtuga4/teamtuga4ever.repository | plugin.video.traquinas/resources/lib/resolvers/videopremium.py | 23 | 1858 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
aCOSMIC/aCOSMIC | cosmic/mp/progress.py | 1 | 1367 | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2017-2019)
#
# This file is part of GWpy.
#
# GWpy 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 |
meilinxiaoxue/flare-ida | examples/argtracker_example1.py | 6 | 3869 | #!/usr/bin/env python
# Jay Smith
# jay.smith@fireeye.com
#
########################################################################
# Copyright 2015 FireEye
# Copyright 2012 Mandiant
#
# FireEye licenses this file to you under the Apache License, Version
# 2.0 (the "License"); you may not use this file except in comp... | apache-2.0 |
datasciencebr/serenata-de-amor | research/src/fetch_tse_data.py | 2 | 9446 | """
This script downloads and format some data from TSE website.
The first objective with this data is to obtain a list of all politicians in Brazil.
In march 2017, the data available in TSE website contained information about elected people from the year 1994 to 2016.
Data before 1994 does not contains name of the pol... | mit |
amw2104/fireplace | fireplace/managers.py | 1 | 6952 | from hearthstone.enums import GameTag
from . import enums
class Manager(object):
def __init__(self, obj):
self.obj = obj
self.observers = []
def __getitem__(self, tag):
if self.map.get(tag):
return getattr(self.obj, self.map[tag], 0)
raise KeyError
def __setitem__(self, tag, value):
setattr(self.obj... | agpl-3.0 |
moma/TinasoftPytextminer | tinasoft/data/medline.py | 1 | 7859 | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 CREA Lab, CNRS/Ecole Polytechnique UMR 7656 (Fr)
#
# 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
# (a... | gpl-3.0 |
chokribr/invenio | invenio/modules/statistics/models.py | 13 | 1538 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
sejalvarshney/stockkbot2 | app.py | 1 | 2255 | from __future__ import print_function
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urlparse, urlencode
#from urllib.request import urlopen, Request
from urllib.error import HTTPError
import urllib.request
import json
import os
import datetime
from flask import Flask
f... | apache-2.0 |
roubert/python-phonenumbers | python/phonenumbers/data/region_HR.py | 10 | 3499 | """Auto-generated file, do not edit by hand. HR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HR = PhoneMetadata(id='HR', country_code=385, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-7]\\d{5,8}|[89]\\d{6,11}', possible_n... | apache-2.0 |
tizianasellitto/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_handshake_hybi00.py | 466 | 17345 | #!/usr/bin/env python
#
# Copyright 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... | mpl-2.0 |
spring01/libPSI | doc/sphinxman/separate_userprogman.py | 1 | 2530 | #!/usr/bin/python
import sys
import os
import glob
DriverPath = ''
if (len(sys.argv) == 2):
DriverPath = sys.argv[1] + '/'
def separate_documents():
bhtmlall = False
bhtmluser = False
bhtmlprog = False
blatexuser = False
blatexprog = False
for line in ftemplate.readlines():
if li... | gpl-2.0 |
EzyInsights/Diamond | src/diamond/handler/hostedgraphite.py | 58 | 2501 | # coding=utf-8
"""
[Hosted Graphite](https://www.hostedgraphite.com/) is the powerful open-source
application metrics system used by hundreds of companies. We take away the
headaches of scaling, maintenance, and upgrades and let you do what you do
best - write great software.
#### Configuration
Enable this handler
... | mit |
AlericInglewood/3p-google-breakpad | src/third_party/protobuf/protobuf/gtest/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 |
fitzgen/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake_hybi.py | 413 | 22552 | #!/usr/bin/env python
#
# Copyright 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... | mpl-2.0 |
StormTrooper/osmc | package/mediacenter-skin-next-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x00a.py | 252 | 4121 | data = (
'[?]', # 0x00
'[?]', # 0x01
'N', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'[?]', # 0x12
'... | gpl-2.0 |
ryanfobel/microdrop | microdrop/app.py | 1 | 24616 | """
Copyright 2011-2016 Ryan Fobel and Christian Fobel
This file is part of MicroDrop.
MicroDrop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Foundation, either version 3 of the License, or
(at your option) any later version.
MicroDrop i... | gpl-3.0 |
Slezhuk/ansible | lib/ansible/modules/network/nxos/nxos_vlan.py | 14 | 13903 | #!/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 |
scyclops/Readable-Feeds | chardet/gb2312prober.py | 236 | 1677 | ######################## 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 |
Maximilian-Reuter/SickRage-1 | lib/twilio/rest/resources/ip_messaging/services.py | 23 | 1748 | from .channels import Channels
from .roles import Roles
from .users import Users
from twilio.rest.resources import NextGenInstanceResource, NextGenListResource
class Service(NextGenInstanceResource):
subresources = [
Channels,
Roles,
Users
]
def update(self, **kwargs):
""... | gpl-3.0 |
infinity0/pyptlib | pyptlib/test/test_server.py | 2 | 9185 | import os
import unittest
from pyptlib.config import EnvError, Config
from pyptlib.server_config import get_transport_options_impl
from pyptlib.server import ServerTransportPlugin
from pyptlib.test.test_core import PluginCoreTestMixin
from pyptlib.core import SUPPORTED_TRANSPORT_VERSIONS
# a good valid environment to... | bsd-3-clause |
pschmitt/home-assistant | tests/components/homekit_controller/test_air_quality.py | 21 | 1783 | """Basic checks for HomeKit air quality sensor."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from tests.components.homekit_controller.common import setup_test_component
def create_air_quality_sensor_service(accessory):
"""Define temperat... | apache-2.0 |
sinhrks/scikit-learn | examples/model_selection/grid_search_digits.py | 44 | 2672 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.model_selection.GridS... | bsd-3-clause |
arcean/telepathy-python | debian/python-telepathy/usr/share/pyshared/telepathy/_generated/Channel_Type_Stream_Tube.py | 4 | 3337 | # -*- coding: utf-8 -*-
# Generated from the Telepathy spec
"""Copyright © 2008-2009 Collabora Limited
Copyright © 2008-2009 Nokia Corporation
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 Foundatio... | lgpl-2.1 |
erjohnso/ansible | lib/ansible/plugins/lookup/cyberarkpassword.py | 53 | 6066 | # (c) 2017, Edward Nunez <edward.nunez@cyberark.com>
# (c) 2017 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: cyberarkpassword
versi... | gpl-3.0 |
bintlabs/python-sync-db | dbsync/client/net.py | 1 | 6630 | """
Send HTTP requests and interpret responses.
The body returned by each procedure will be a python dictionary
obtained from parsing a response through a decoder, or ``None`` if the
decoder raises a ``ValueError``. The default encoder, decoder and
headers are meant to work with the JSON specification.
These procedur... | mit |
tmenjo/cinder-2015.1.1 | cinder/tests/api/contrib/test_volume_transfer.py | 3 | 26444 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
Ralitsa-Ts/Bookstore_and_Chart | book_information.py | 1 | 6347 | import sys
import os
sys.path.append("model")
from library import Library, Book
from PyQt4 import QtGui, QtCore
from functools import partial
class BookInformation(QtGui.QWidget):
def __init__(self):
super(BookInformation, self).__init__()
self.InitUI()
def InitUI(self):
self.table =... | gpl-3.0 |
synctree/synctree-awsebcli | ebcli/controllers/config.py | 1 | 5151 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | apache-2.0 |
dfang/odoo | addons/website_hr_recruitment/controllers/main.py | 13 | 4316 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http, _
from odoo.addons.website.models.website import slug
from odoo.http import request
class WebsiteHrRecruitment(http.Controller):
@http.route([
'/jobs',
'/jobs/country/<model("... | agpl-3.0 |
leeseulstack/openstack | neutron/db/migration/alembic_migrations/agent_init_ops.py | 17 | 1725 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
dvberkel/servo | python/mozlog/mozlog/structured/formatters/xunit.py | 46 | 3804 | import types
from xml.etree import ElementTree
import base
def format_test_id(test_id):
"""Take a test id and return something that looks a bit like
a class path"""
if type(test_id) not in types.StringTypes:
#Not sure how to deal with reftests yet
raise NotImplementedError
#Turn a pat... | mpl-2.0 |
stven/headphones | lib/requests/packages/chardet2/constants.py | 231 | 1374 | ######################## 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.... | gpl-3.0 |
sudikrt/costproML | testproject/temp/test.py | 1 | 3011 | '''
Import Libs
'''
import pandas as pd
import numpy as np
from pandas.tools.plotting import scatter_matrix
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import L... | apache-2.0 |
syscoin/syscoin2 | test/functional/wallet_import_rescan.py | 1 | 10824 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 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 wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
impor... | mit |
tbabej/freeipa | ipatests/test_install/test_updates.py | 1 | 12377 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2009 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 |
Antiun/odoo | addons/gamification/models/__init__.py | 389 | 1038 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
40223209/test | static/Brython3.1.1-20150328-091302/Lib/gc.py | 743 | 3548 | """This module provides access to the garbage collector for reference cycles.
enable() -- Enable automatic garbage collection.
disable() -- Disable automatic garbage collection.
isenabled() -- Returns true if automatic collection is enabled.
collect() -- Do a full collection right now.
get_count() -- Return the curren... | agpl-3.0 |
pmghalvorsen/gramps_branch | gramps/gen/filters/rules/family/__init__.py | 2 | 2872 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-2.0 |
Orochimarufan/youtube-dl | youtube_dl/extractor/telequebec.py | 4 | 6981 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
smuggle_url,
try_get,
unified_timestamp,
)
class TeleQuebecBaseIE(InfoExtractor):
@staticmethod
def _limelight_result(media_id):
... | unlicense |
mstriemer/olympia | tests/ui/pages/desktop/home.py | 4 | 1217 | from pypom import Region
from selenium.webdriver.common.by import By
from base import Base
class Home(Base):
@property
def most_popular(self):
return self.MostPopular(self)
class MostPopular(Region):
"""Most popular extensions region"""
_root_locator = (By.ID, 'popular-extensio... | bsd-3-clause |
chevanlol360/Kernel_LGE_X5 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
openqt/algorithms | leetcode/python/lc123-best-time-to-buy-and-sell-stock-iii.py | 1 | 2545 | # coding=utf-8
import unittest
"""123. Best Time to Buy and Sell Stock III
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/description/
Say you have an array for which the _i_ th element is the price of a given
stock on day _i_.
Design an algorithm to find the maximum profit. You may complete at mo... | gpl-3.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/prompt_toolkit/styles/defaults.py | 20 | 3695 | """
The default styling.
"""
from __future__ import unicode_literals
from prompt_toolkit.token import Token
__all__ = (
'DEFAULT_STYLE_EXTENSIONS',
'default_style_extensions',
)
#: Styling of prompt-toolkit specific tokens, that are not know by the default
#: Pygments style.
DEFAULT_STYLE_EXTENSIONS = {
... | bsd-3-clause |
diox/zamboni | mkt/api/tests/test_authentication.py | 19 | 8078 | from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.test.client import RequestFactory
from mock import Mock, patch
from multidb.pinning import this_thread_is_pinned, unpin_this_thread
from nose.tools import eq_, ok_
from rest_framework.reques... | bsd-3-clause |
openstack/solum | solum/api/controllers/v1/datamodel/types.py | 2 | 3486 | # Copyright 2013 - Red Hat, 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 writ... | apache-2.0 |
grnet/synnefo | snf-astakos-app/astakos/im/migrations/old/0060_fix_uuids.py | 10 | 25609 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
import uuid
class Migration(DataMigration):
def forwards(self, orm):
users = orm.AstakosUser.objects.filter(uuid__isnull=True)
for user in users:
user.uuid =... | gpl-3.0 |
bbreslauer/PySciPlot | src/ui/Ui_PlotTypeWidget.py | 1 | 1610 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_PlotTypeWidget.ui'
#
# Created: Sat May 28 00:16:58 2011
# by: PyQt4 UI code generator 4.8.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exce... | gpl-3.0 |
jm66/pyvmomi-community-samples | samples/change_vm_nic_state.py | 4 | 4015 | #!/usr/bin/env python
#
# Written by JM Lopez
# GitHub: https://github.com/jm66
# Email: jm@jmll.me
# Website: http://jose-manuel.me
#
# Note: Example code For testing purposes only
#
# This code has been released under the terms of the Apache-2.0 license
# http://opensource.org/licenses/Apache-2.0
#
import atexit
imp... | apache-2.0 |
ssvsergeyev/ZenPacks.zenoss.AWS | src/boto/boto/glacier/vault.py | 153 | 17601 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
# Copyright (c) 2012 Robie Basak <robie@justgohome.co.uk>
#
# 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 Softw... | gpl-2.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_gdbm.py | 58 | 2501 | import gdbm
import unittest
import os
from test.test_support import verbose, TESTFN, run_unittest, unlink
filename = TESTFN
class TestGdbm(unittest.TestCase):
def setUp(self):
self.g = None
def tearDown(self):
if self.g is not None:
self.g.close()
unlink(filename)
d... | apache-2.0 |
shoma/mycli | release.py | 13 | 2119 | #!/usr/bin/env python
from __future__ import print_function
import re
import ast
import subprocess
import sys
DEBUG = False
def version(version_file):
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open(version_file, 'rb') as f:
ver = str(ast.literal_eval(_version_re.search(
f.r... | bsd-3-clause |
GiovanniConserva/TestDeploy | venv/Lib/site-packages/yaml/events.py | 985 | 2445 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... | bsd-3-clause |
rven/odoo | addons/test_mail/tests/test_mail_mail.py | 4 | 4040 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import psycopg2
from odoo import api
from odoo.addons.base.models.ir_mail_server import MailDeliveryException
from odoo.addons.test_mail.tests.common import TestMailCommon
from odoo.tests import common
from odoo.tools i... | agpl-3.0 |
elijah513/django | tests/template_tests/test_smartif.py | 580 | 2178 | import unittest
from django.template.smartif import IfParser
class SmartIfTests(unittest.TestCase):
def assertCalcEqual(self, expected, tokens):
self.assertEqual(expected, IfParser(tokens).parse().eval({}))
# We only test things here that are difficult to test elsewhere
# Many other tests are f... | bsd-3-clause |
scrollback/kuma | vendor/packages/coverage/coverage/bytecode.py | 6 | 2086 | """Bytecode manipulation for coverage.py"""
import opcode, sys, types
class ByteCode(object):
"""A single bytecode."""
def __init__(self):
self.offset = -1
self.op = -1
self.arg = -1
self.next_offset = -1
self.jump_to = -1
class ByteCodes(object):
"""Iterator over... | mpl-2.0 |
bearicc/3d-soil-vis | convert.py | 1 | 1196 | import scipy as sp
import numpy as np
import pandas as pd
from pyproj import *
import os
filename = ["data/05044572.xyzi",
"data/05044574.xyzi",
"data/05064572.xyzi",
"data/05064574.xyzi",
]
data_list = []
for i in range(len(filename)):
print("Load data "+filename[i]+" ..."... | gpl-3.0 |
auready/django | tests/template_tests/filter_tests/test_truncatewords.py | 235 | 1755 | from django.template.defaultfilters import truncatewords
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class TruncatewordsTests(SimpleTestCase):
@setup({
'truncatewords01': '{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:... | bsd-3-clause |
alxgu/ansible | lib/ansible/modules/cloud/azure/azure_rm_servicebus_facts.py | 13 | 20194 | #!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.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': '1.1',
... | gpl-3.0 |
aterrel/dynd-python | dynd/tests/test_range_linspace.py | 1 | 5962 | import sys
import unittest
from dynd import nd, ndt
class TestArange(unittest.TestCase):
def test_simple(self):
self.assertEqual(nd.as_py(nd.range(10)), list(range(10)))
self.assertEqual(nd.as_py(nd.range(5, 10)), list(range(5, 10)))
self.assertEqual(nd.as_py(nd.range(5, 10, 3)), list(range... | bsd-2-clause |
asomya/test | horizon/dashboards/nova/access_and_security/floating_ips/tests.py | 4 | 7541 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under th... | apache-2.0 |
izonder/intellij-community | plugins/hg4idea/testData/bin/mercurial/changegroup.py | 91 | 8282 | # changegroup.py - Mercurial changegroup manipulation functions
#
# Copyright 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
from node import nullrev
import mdiff, util
impo... | apache-2.0 |
Lyrositor/moul-scripts | Python/ki/__init__.py | 1 | 337790 | # -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, 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... | gpl-3.0 |
matthewlent/ng-boilerplate-flask | venv/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 115 | 3825 | from setuptools import Command
from setuptools.archive_util import unpack_archive
from distutils import log, dir_util
import os, pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_options ... | mit |
jeremiahyan/odoo | addons/web_unsplash/controllers/main.py | 5 | 6003 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import logging
import mimetypes
import requests
import werkzeug.utils
from odoo import http, tools, _
from odoo.http import request
from odoo.tools.mimetypes import guess_mimetype
from werkzeug.urls import ... | gpl-3.0 |
grnet/synnefo | snf-astakos-app/setup.py | 1 | 2986 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 GRNET S.A.
#
# 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-3.0 |
zhanqxun/cv_fish | numpy/distutils/tests/test_misc_util.py | 47 | 3348 | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
from os.path import join, sep, dirname
from numpy.distutils.misc_util import (
appendpath, minrelpath, gpaths, get_shared_lib_extension, get_info
)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equ... | apache-2.0 |
JimCircadian/ansible | lib/ansible/modules/cloud/vmware/vmware_tag_facts.py | 10 | 3867 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ ... | gpl-3.0 |
williamfdevine/PrettyLinux | tools/perf/tests/attr.py | 1266 | 9424 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-3.0 |
LavyshAlexander/namebench | libnamebench/provider_extensions.py | 174 | 1713 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
peterfpeterson/mantid | Framework/PythonInterface/mantid/__init__.py | 3 | 3994 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
"""
... | gpl-3.0 |
jakobj/python-neo | neo/test/coretest/test_event.py | 7 | 5682 | # -*- coding: utf-8 -*-
"""
Tests of the neo.core.event.Event class
"""
try:
import unittest2 as unittest
except ImportError:
import unittest
import numpy as np
import quantities as pq
try:
from IPython.lib.pretty import pretty
except ImportError as err:
HAVE_IPYTHON = False
else:
HAVE_IPYTHON = ... | bsd-3-clause |
charlesvdv/servo | tests/wpt/css-tests/tools/py/setup.py | 161 | 1425 | import os, sys
from setuptools import setup
def main():
setup(
name='py',
description='library with cross-python path, ini-parsing, io, code, log facilities',
long_description = open('README.txt').read(),
version='1.4.31',
url='http://pylib.readthedocs.org/',
licens... | mpl-2.0 |
shaileshgoogler/pyglet | contrib/layout/layout/gl/image.py | 29 | 2336 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import warnings
from pyglet.gl import *
from pyglet import image
from layout.frame import *
class ImageReplacedElementFactory(ReplacedElementFactory):
accept_names = ['img']
def __init__(self, locator):
self.loca... | bsd-3-clause |
diofeher/django-nfa | tests/regressiontests/modeladmin/models.py | 1 | 7616 | # coding: utf-8
from django.db import models
from datetime import date
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateField()
def __unicode__(self):
return self.name
class Concert(models.Model):
main_band = models.Fore... | bsd-3-clause |
yigitguler/django | django/contrib/formtools/tests/tests.py | 32 | 7417 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import unittest
import warnings
from django import http
from django.contrib.formtools import preview, utils
from django.test import TestCase, override_settings
from django.utils._os import upath
from django.contrib.formtools.te... | bsd-3-clause |
ruiliLaMeilleure/11ad-backhaul | src/visualizer/visualizer/core.py | 88 | 60468 | # -*- Mode: python; coding: utf-8 -*-
from __future__ import division
#from __future__ import with_statement
LAYOUT_ALGORITHM = 'neato' # ['neato'|'dot'|'twopi'|'circo'|'fdp'|'nop']
REPRESENT_CHANNELS_AS_NODES = 1
DEFAULT_NODE_SIZE = 3.0 # default node size in meters
DEFAULT_TRANSMISSIONS_MEMORY = 5 # default number o... | gpl-2.0 |
julioeiras/django-rest-auth | rest_auth/views.py | 20 | 5140 | from django.contrib.auth import login, logout
from django.conf import settings
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import IsAuthenticated, AllowAny
from... | mit |
64studio/smart | smart/channels/mirrors.py | 8 | 2662 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | gpl-2.0 |
pluser/nikola_plugins | v6/spell_check/spell_check.py | 4 | 3572 | # -*- coding: utf-8 -*-
# Copyright © 2014 Puneeth Chaganti
# 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 without limitation
# the rights to use, copy, mo... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.