repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
Cinntax/home-assistant
refs/heads/dev
homeassistant/components/rainbird/switch.py
6
"""Support for Rain Bird Irrigation system LNK WiFi Module.""" import logging from pyrainbird import AvailableStations, RainbirdController import voluptuous as vol from homeassistant.components.switch import SwitchDevice from homeassistant.const import ATTR_ENTITY_ID, CONF_FRIENDLY_NAME, CONF_TRIGGER_TIME from homea...
unreal666/youtube-dl
refs/heads/master
youtube_dl/extractor/xxxymovies.py
38
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, int_or_none, ) class XXXYMoviesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?xxxymovies\.com/videos/(?P<id>\d+)/(?P<display_id>[^/]+)' _TEST = { 'url': 'http://xxx...
prezi/gunicorn
refs/heads/master
tests/requests/valid/005.py
40
request = { "method": "GET", "uri": uri("/forums/1/topics/2375?page=1#posts-17408"), "version": (1, 1), "headers": [], "body": b"" }
Shouqun/node-gn
refs/heads/master
tools/depot_tools/third_party/boto/roboto/awsqueryrequest.py
70
# 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...
swcurran/tfrs
refs/heads/master
backend/api/models/OrganizationActionsType.py
1
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
dfalt974/SickRage
refs/heads/master
lib/past/builtins/__init__.py
62
""" A resurrection of some old functions from Python 2 for use in Python 3. These should be used sparingly, to help with porting efforts, since code using them is no longer standard Python 3 code. This module provides the following: 1. Implementations of these builtin functions which have no equivalent on Py3: - app...
keithroe/vtkoptix
refs/heads/master
ThirdParty/Twisted/twisted/web/http_headers.py
44
# -*- test-case-name: twisted.web.test.test_http_headers # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An API for storing HTTP header names and values. """ from __future__ import division, absolute_import from collections import MutableMapping from twisted.python.compat import comparab...
jmgc/myhdl-numeric
refs/heads/numeric
example/cookbook/bitonic/bitonic.py
1
import subprocess from myhdl import * from myhdl.conversion import analyze DESCENDING, ASCENDING = False, True def compare(a1, a2, z1, z2, dir): @always_comb def logic(): z1.next = a1 z2.next = a2 if dir == (a1 > a2): z1.next = a2 z2.next = a1 ...
sinhrks/scikit-learn
refs/heads/master
sklearn/datasets/setup.py
306
import numpy import os def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('datasets', parent_package, top_path) config.add_data_dir('data') config.add_data_dir('descr') config.add_data_dir('images') config.add_data_d...
jackytu/newbrandx
refs/heads/rankx
src/oscar/apps/checkout/session.py
4
from decimal import Decimal as D from django import http from django.contrib import messages from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from oscar.core import prices from oscar.core.loading import get_cla...
vmendez/DIRAC
refs/heads/integration
FrameworkSystem/private/logging/backends/RemoteBackend.py
13
# $HeadURL$ __RCSID__ = "$Id$" """This Backend sends the Log Messages to a Log Server It will only report to the server ERROR, EXCEPTION, FATAL and ALWAYS messages. """ import threading import Queue from DIRAC.Core.Utilities import Time, Network from DIRAC.FrameworkSystem.private.logging.backends.BaseBackend import Bas...
molokov/mezzanine
refs/heads/master
mezzanine/core/checks.py
5
from __future__ import unicode_literals import pprint from django import VERSION as DJANGO_VERSION from django.conf import global_settings from django.core.checks import Warning, register from mezzanine.conf import settings from mezzanine.utils.conf import middlewares_or_subclasses_installed from mezzanine.utils.sit...
ativelkov/murano-api
refs/heads/master
murano/db/services/sessions.py
1
# Copyright (c) 2013 Mirantis, 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...
zephirefaith/AI_Fall15_Assignments
refs/heads/master
A2/lib/networkx/readwrite/json_graph/tests/test_tree.py
63
import json from nose.tools import assert_equal, assert_raises, assert_not_equal, assert_true, raises import networkx as nx from networkx.readwrite.json_graph import * class TestTree: def test_graph(self): G=nx.DiGraph() G.add_nodes_from([1,2,3],color='red') G.add_edge(1,2,foo=7) G...
gossion/azure-quickstart-templates
refs/heads/master
cloudera-director-on-centos/scripts/director_user_passwd.py
102
#! /usr/bin/env python # Copyright (c) 2016 Cloudera, 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 la...
ChenJunor/hue
refs/heads/master
desktop/core/ext-py/pysqlite/doc/includes/sqlite3/executescript.py
49
from pysqlite2 import dbapi2 as sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() cur.executescript(""" create table person( firstname, lastname, age ); create table book( title, author, published ); insert into book(title, author, publis...
DarthMaulware/EquationGroupLeaks
refs/heads/master
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/lib2to3/pgen2/grammar.py
1
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: grammar.py """This module defines the data structures used to represent a grammar. These are a bit arcane because they are derived from the data str...
goldcase/systemd
refs/heads/master
tools/make-man-index.py
125
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # # This file is part of systemd. # # Copyright 2012 Lennart Poettering # Copyright 2013 Zbigniew Jędrzejewski-Szmek # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as ...
hectoruelo/scrapy
refs/heads/master
scrapy/http/common.py
188
def obsolete_setter(setter, attrname): def newsetter(self, value): c = self.__class__.__name__ msg = "%s.%s is not modifiable, use %s.replace() instead" % (c, attrname, c) raise AttributeError(msg) return newsetter
lilida/teletraan
refs/heads/master
deploy-sentinel/mysite/mysite/settings.py
3
# Copyright 2016 Pinterest, 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...
qt911025/pw_module_system
refs/heads/pw
header_item_modifiers.py
6
imod_plain = 0 imod_cracked = 1 imod_rusty = 2 imod_bent = 3 imod_chipped = 4 imod_battered = 5 imod_poor = 6 imod_crude = 7 imod_old = 8 imod_cheap = 9 imod_fine = 10 imod_well_made = 11 imod_sharp = 12 imod_balanced = 13 imod_tempered = 14 imod_deadly = 15 imod_exquisite = 16 imod_masterwork = 17 imod_heavy = 18 imod...
colinmcd94/kickdata
refs/heads/master
lib/requests/packages/urllib3/packages/ordered_dict.py
2039
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
kms123/PyKata
refs/heads/master
advent_2016/day_01_2_test.py
1
import unittest from day_01_2 import calculate_positions class CalculateLocationTests(unittest.TestCase): def test_location_list_for_one_movement(self): result = calculate_positions(['L1']) self.assertEqual([(0, 0), (-1, 0)], result) def test_location_list_for_long_movement(self): r...
rmfitzpatrick/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py
19
#!/usr/bin/python # Copyright (c) 2016 Hewlett-Packard Enterprise Corporation # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
turbokongen/home-assistant
refs/heads/dev
homeassistant/components/pencom/__init__.py
36
"""The pencom component."""
aperson/TweetPoster
refs/heads/master
TweetPoster/rehost.py
4
import re import json import requests from bs4 import BeautifulSoup import TweetPoster class ImageHost(object): url_re = None def extract(self, url): """ Takes a URL, rehosts an image and returns a new URL. """ raise NotImplementedError @classmethod def rehost(self...
dreamsxin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/ctypes/test/test_simplesubclasses.py
170
import unittest from ctypes import * class MyInt(c_int): def __eq__(self, other): if type(other) != MyInt: return NotImplementedError return self.value == other.value class Test(unittest.TestCase): def test_compare(self): self.assertEqual(MyInt(3), MyInt(3)) self.a...
keiono/cxio_python
refs/heads/master
cxio/cx_writer.py
1
import json import decimal import collections from cxio.cx_constants import CxConstants class CxWriter(object): def __init__(self, out): if out is None: raise AssertionError('output stream must not be none') self.__out = out self.__pre_meta_data = [] self.__post_meta_d...
sergey-shandar/autorest
refs/heads/master
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/auto_rest_swagger_bat_file_service/models/error.py
432
# 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 ...
antoinecarme/pyaf
refs/heads/master
tests/periodicities/Month/Cycle_Month_50_M_120.py
1
import tests.periodicities.period_test as per per.buildModel((120 , 'M' , 50));
uranusjr/django
refs/heads/master
tests/utils_tests/test_inspect.py
62
import unittest from django.utils import inspect class Person: def no_arguments(self): return None def one_argument(self, something): return something def just_args(self, *args): return args def all_kinds(self, name, address='home', age=25, *args, **kwargs): return ...
luvit/gyp
refs/heads/luvit-dev
test/mac/gyptest-framework-headers.py
344
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that mac_framework_headers works properly. """ import TestGyp import sys if sys.platform == 'darwin': # TODO(thakis): Make...
sublime1809/django
refs/heads/master
django/contrib/gis/maps/google/gmap.py
25
from __future__ import unicode_literals from django.conf import settings from django.template.loader import render_to_string from django.utils.html import format_html from django.utils.safestring import mark_safe from django.utils.six.moves import xrange from django.contrib.gis.maps.google.overlays import GPolygon, G...
andrewyoung1991/abjad
refs/heads/master
abjad/tools/tonalanalysistools/test/test_tonalanalysistools_Mode___eq__.py
2
# -*- encoding: utf-8 -*- from abjad import * from abjad.tools import tonalanalysistools def test_tonalanalysistools_Mode___eq___01(): mode_1 = tonalanalysistools.Mode('dorian') mode_2 = tonalanalysistools.Mode('dorian') mode_3 = tonalanalysistools.Mode('phrygian') assert mode_1 == mode_1 a...
halvertoluke/edx-platform
refs/heads/default_branch
lms/djangoapps/courseware/features/word_cloud.py
94
# pylint: disable=missing-docstring from lettuce import world, step from common import i_am_registered_for_the_course, section_location, visit_scenario_item @step('I view the word cloud and it has rendered') def word_cloud_is_rendered(_step): assert world.is_css_present('.word_cloud') @step('the course has a W...
DaTrollMon/pyNES
refs/heads/0.1.x
pynes/tests/ror_test.py
28
# -*- coding: utf-8 -*- ''' ROR, Rotate Right Test This is an Bit Manipulation of the 6502. ''' import unittest from pynes.compiler import lexical, syntax, semantic class RorTest(unittest.TestCase): def test_ror_imm(self): tokens = list(lexical('ROR #$10')) self.assertEquals(2, len(tokens)) ...
TheLazyBastard/SerialConsole
refs/heads/master
Main.py
1
from PySide.QtCore import * from PySide.QtGui import * import sys import UI from Services import SerialService import time class MainWindow(QDialog,UI.Ui_Form): def __init__(self, parent = None): super(MainWindow,self).__init__(parent) self.setupUi(self) #----------------- Inicio el Servicio --...
morsdatum/ArangoDB
refs/heads/master
3rdParty/V8/build/gyp/test/actions/src/confirm-dep-files.py
349
#!/usr/bin/env python # Copyright (c) 2011 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. """Confirms presence of files generated by our targets we depend on. If they exist, create a new file. Note target's input files are explic...
mattbasta/amo-validator
refs/heads/master
tests/test_content_overlays.py
1
from nose.tools import eq_ from helper import MockXPI from validator.chromemanifest import ChromeManifest import validator.testcases.content as content from validator.errorbundler import ErrorBundle def test_marking_overlays(): """ Mark an overlay, then test that it marks the scripts within the overlay. ...
chunfengh/seq2seq
refs/heads/master
seq2seq/encoders/conv_encoder.py
6
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
erkanay/django
refs/heads/master
django/utils/tzinfo.py
97
"Implementation of tzinfo classes for use with datetime.datetime." from __future__ import unicode_literals from datetime import timedelta, tzinfo import time import warnings from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING ...
accomac/namebench
refs/heads/master
nb_third_party/dns/e164.py
248
# Copyright (C) 2006, 2007, 2009 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 I...
CospanDesign/nysa-tx1-pcie-platform
refs/heads/master
tx1_pcie/demo/tx1_pcie/site_scons/ngd_utils.py
4
#Distributed under the MIT licesnse. #Copyright (c) 2013 Cospan Design (dave.mccoy@cospandesign.com) #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 limit...
mfherbst/spack
refs/heads/develop
lib/spack/spack/test/cmd/module.py
2
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
pwns4cash/vivisect
refs/heads/master
visgraph/__init__.py
11
''' The new visgraph package... Sigh... If you want something done right... '''
p0cisk/Quantum-GIS
refs/heads/master
tests/src/python/test_qgsoptional.py
74
# -*- coding: utf-8 -*- ''' test_qgsoptional.py -------------------------------------- Date : September 2016 Copyright : (C) 2016 Matthias Kuhn email : matthias@opengis.ch ***************************************...
bfrgoncalves/Online-PhyloViZ
refs/heads/master
node_modules/l/node_modules/hook.io/node_modules/npm/node_modules/node-gyp/gyp/test/actions-subdir/src/make-file.py
489
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys contents = 'Hello from make-file.py\n' open(sys.argv[1], 'wb').write(contents)
gregbillock/Spectrum-Access-System
refs/heads/master
src/prop/ehata/test/ehata_isolated_ridge_test.py
2
import os,sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import ehata import csv import math deltas = [] with open('isolated_ridge_test.csv') as ridge_file: rows = csv.reader(ridge_file) for row in rows: deltas.append(row) with open('elevations.csv') as profiles_file: rows = csv.reader(...
bradsk88/WinkHouse
refs/heads/master
lib/werkzeug/contrib/wrappers.py
181
# -*- coding: utf-8 -*- """ werkzeug.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~ Extra wrappers or mixins contributed by the community. These wrappers can be mixed in into request objects to add extra functionality. Example:: from werkzeug.wrappers import Request as RequestBase fr...
google/seq2seq
refs/heads/master
seq2seq/test/conv_encoder_test.py
6
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Lynx187/script.module.urlresolver
refs/heads/master
lib/urlresolver/plugins/megavids.py
3
''' Allmyvideos urlresolver plugin Copyright (C) 2013 Vinnydude 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 later version. This program i...
ftrader-bitcoinabc/bitcoin-abc
refs/heads/master
test/functional/rpc_txoutproof.py
1
#!/usr/bin/env python3 # Copyright (c) 2014-2016 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 gettxoutproof and verifytxoutproof RPCs.""" from test_framework.test_framework import BitcoinTest...
havard024/prego
refs/heads/master
core/rss.py
3
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Global RSS Framework """ from django.contrib.syndication.views import Feed from django.contrib.sites.models import RequestSite from treeio.core.models import Object, UpdateRecord, User import hashlib imp...
open-synergy/opnsynid-hr
refs/heads/8.0
hr_assignment_transition/__init__.py
7
# -*- coding: utf-8 -*- # Copyright 2018 OpenSynergy Indonesia # Copyright 2020 PT. Simetri Sinergi Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ( models, )
drpaneas/linuxed.gr
refs/heads/master
lib/python2.7/site-packages/unidecode/x000.py
113
data = ( # Code points u+007f and below are equivalent to ASCII and are handled by a # special case in the code. Hence they are not present in this table. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '...
bluemini/kuma
refs/heads/master
vendor/packages/pygments/lexers/perl.py
72
# -*- coding: utf-8 -*- """ pygments.lexers.perl ~~~~~~~~~~~~~~~~~~~~ Lexers for Perl and related languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, include...
rmcgibbo/msmbuilder
refs/heads/master
msmbuilder/utils/validation.py
3
from __future__ import print_function, division, absolute_import import numpy as np import mdtraj as md __all__ = ['list_of_1d', 'check_iter_of_sequences', 'array2d'] def list_of_1d(y): if not hasattr(y, '__iter__') or len(y) == 0: raise ValueError('Bad input shape') if not hasattr(y[0], '__iter__'):...
xuru/bowling
refs/heads/master
app/resources/__init__.py
1
from .roll import * from .game import *
gangadhar-kadam/nassimapp
refs/heads/master
selling/doctype/customer/customer.py
7
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.model.doc import Document, make_autoname from webnotes import msgprint, _ import webnotes.defaults from utilities.tr...
windyuuy/opera
refs/heads/master
chromium/src/tools/gyp/test/win/vs-macros/as.py
332
#!/usr/bin/env python # Copyright (c) 2012 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. from optparse import OptionParser parser = OptionParser() parser.add_option('-a', dest='platform') parser.add_option('-o', dest='output') p...
jnnk/pyethereum
refs/heads/master
pyethereum/trie.py
1
#!/usr/bin/env python import os import rlp import utils import db DB = db.DB def bin_to_nibbles(s): """convert string s to nibbles (half-bytes) >>> bin_to_nibbles("") [] >>> bin_to_nibbles("h") [6, 8] >>> bin_to_nibbles("he") [6, 8, 6, 5] >>> bin_to_nibbles("hello") [6, 8, 6, 5,...
eharney/cinder
refs/heads/master
cinder/tests/unit/image/fake.py
1
# Copyright 2011 Justin Santa Barbara # Copyright 2012 OpenStack Foundation # 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/l...
ajose01/rethinkdb
refs/heads/next
external/v8_3.30.33.16/tools/process-heap-prof.py
146
#!/usr/bin/env python # # Copyright 2009 the V8 project 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: # # * Redistributions of source code must retain the above copyright # noti...
dimdung/boto
refs/heads/develop
tests/unit/kms/__init__.py
473
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
UXE/local-edx
refs/heads/master
common/lib/xmodule/xmodule/tests/test_conditional.py
37
import json import unittest from fs.memoryfs import MemoryFS from mock import Mock, patch from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.error_module import NonStaffErrorDescriptor from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location from xmodule.modules...
tracyjacks/PyMetWeather
refs/heads/master
pymetweather/get_args.py
1
import argparse from configparser import RawConfigParser from os import mkdir import os.path def get_command_line_args(): parser = argparse.ArgumentParser(description=( 'Retreive and display weather forecast from the met ' 'office. Default behaviour is to check for updates if ' 'the saved ...
mccheung/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/ctypes/test/test_simplesubclasses.py
170
import unittest from ctypes import * class MyInt(c_int): def __eq__(self, other): if type(other) != MyInt: return NotImplementedError return self.value == other.value class Test(unittest.TestCase): def test_compare(self): self.assertEqual(MyInt(3), MyInt(3)) self.a...
russel1237/scikit-learn
refs/heads/master
sklearn/covariance/tests/test_graph_lasso.py
272
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
HHS-IntroProgramming/Sine-Cosine
refs/heads/master
sinecosine.py
1
""" sinecosine.py Author: <your name here> Credit: <list sources used, if any> Assignment: In this assignment you must use *list comprehensions* to generate sprites that show the behavior of certain mathematical functions: sine and cosine. The sine and cosine functions are provided in the Python math library. These...
Carreau/readthedocs.org
refs/heads/master
readthedocs/donate/admin.py
7
from django.contrib import admin from .models import Supporter class SupporterAdmin(admin.ModelAdmin): model = Supporter raw_id_fields = ('user',) list_display = ('name', 'email', 'dollars', 'public') list_filter = ('name', 'email', 'dollars', 'public') admin.site.register(Supporter, SupporterAdmin)
linjoahow/w17g
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/antigravity.py
917
import webbrowser import hashlib webbrowser.open("http://xkcd.com/353/") def geohash(latitude, longitude, datedow): '''Compute geohash() using the Munroe algorithm. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 37.857713 -122.544543 ''' # http://xkcd.com/426/ h = hashlib.md5(d...
ageron/tensorflow
refs/heads/master
tensorflow/contrib/tpu/python/tpu/feature_column.py
8
# Copyright 2019 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 applicable ...
astrofrog/glue-vispy-viewers
refs/heads/master
glue_vispy_viewers/extern/vispy/util/profiler.py
21
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Adapted from PyQtGraph import sys from . import ptime from .. import config class Profiler(object): """Simple profiler allowing directed, hierarchical measurement of ti...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/python-social-auth/social/apps/webpy_app/__init__.py
81
from social.strategies.utils import set_current_strategy_getter from social.apps.webpy_app.utils import load_strategy set_current_strategy_getter(load_strategy)
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_nat_rules_operations.py
1
# 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 ...
CIFASIS/ManFuzzer
refs/heads/master
values/filegen.py
2
''' Created on Dec 30, 2012 @author: Peter ''' import tempfile import os import binascii import logging from values.datagen import DataValueGenerator class FileValueGenerator(object): ''' Generates random files. ''' logger = logging.getLogger('filegen') def __init__(self,meanlen,stdlen): ...
jlamarque/symfony
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
kamenim/samba
refs/heads/master
third_party/dnspython/dns/namedict.py
99
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 "...
freedesktop-unofficial-mirror/telepathy__telepathy-qt4-yell
refs/heads/master
tools/qt4-client-gen.py
2
#!/usr/bin/python # # Copyright (C) 2008 Collabora Limited <http://www.collabora.co.uk> # Copyright (C) 2008 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 Foundation; either # v...
zikzakmedia/python-mediawiki
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' MediaWiki Syntax to HTML :copyright: (c) 2012 by Raimon Esteve. :license: GPLv3, see LICENSE for more details A simple to use python library to access convert wiki syntax to HTML ''' from setuptools import setup import mediawiki setup( name =...
TRKP/android_kernel_samsung_s5312
refs/heads/kitkat
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
zcmarkyoung/node-gyp
refs/heads/master
gyp/test/make/gyptest-noload.py
362
#!/usr/bin/env python # Copyright (c) 2010 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. """ Tests the use of the NO_LOAD flag which makes loading sub .mk files optional. """ # Python 2.5 needs this for the with statement. from ...
larroy/clearskies_core
refs/heads/master
tools/gyp/pylib/gyp/MSVSUserFile.py
2710
# Copyright (c) 2012 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. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xml #------...
awduda/awduda.github.io
refs/heads/master
venv/lib/python2.7/site-packages/pip/req/req_set.py
338
from __future__ import absolute_import from collections import defaultdict from itertools import chain import logging import os from pip._vendor import pkg_resources from pip._vendor import requests from pip.compat import expanduser from pip.download import (is_file_url, is_dir_url, is_vcs_url, url_to_path, ...
SanziShi/KVMGT-kernel
refs/heads/master
tools/perf/util/setup.py
989
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
keithlee/shakeAppPyDev
refs/heads/master
django/db/models/related.py
231
from django.utils.encoding import smart_unicode from django.db.models.fields import BLANK_CHOICE_DASH class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def templ...
opennetworkinglab/OpenVirteX
refs/heads/master
utils/embedder.py
8
#!/usr/bin/env python from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import sys import json import threading import logging as log import urllib2 from argparse import ArgumentParser import subprocess import time CLONE_VM = '/usr/bin/VBoxManage clonevm OVX --snapshot Master --mode machine --options link...
kmonsoor/python-for-android
refs/heads/master
python3-alpha/python3-src/PC/VC6/build_tkinter.py
91
import os import sys import subprocess TCL_MAJOR = 8 TCL_MINOR = 5 TCL_PATCH = 2 TIX_MAJOR = 8 TIX_MINOR = 4 TIX_PATCH = 3 def abspath(name): par = os.path.pardir return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) TK_...
nephila/django-html5-appcache
refs/heads/develop
html5_appcache/cache.py
1
# -*- coding: utf-8 -*- """ Cache maintains two version of the manifest file: 1. if ``get_cache_version() == 1`` it means the all the data are up to date 2. if ``get_cache_version() == 2`` manifest data are stale and need to be regenerated The use of a version permit to continue serving older, but somehow still valid,...
raildo/nova
refs/heads/master
nova/servicegroup/drivers/db.py
18
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
Pablo126/SSBW
refs/heads/master
Tarea4/tarea4/lib/python3.5/site-packages/django/db/backends/postgresql_psycopg2/version.py
427
from ..postgresql.version import * # NOQA
trankmichael/numpy
refs/heads/master
numpy/linalg/lapack_lite/fortran.py
132
from __future__ import division, absolute_import, print_function import re import itertools def isBlank(line): return not line def isLabel(line): return line[0].isdigit() def isComment(line): return line[0] != ' ' def isContinuation(line): return line[5] != ' ' COMMENT, STATEMENT, CONTINUATION = 0, 1...
osh/gnuradio
refs/heads/master
gr-filter/python/filter/design/fir_design.py
47
# Copyright 2012 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) # any later version. # # G...
kapilt/cloud-custodian
refs/heads/master
tools/c7n_gcp/c7n_gcp/resources/storage.py
5
# Copyright 2017-2018 Capital One Services, LLC # # 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 ...
lupyuen/RaspberryPiImage
refs/heads/master
home/pi/GrovePi/Software/Python/others/temboo/Library/Dropbox/OAuth/__init__.py
5
from temboo.Library.Dropbox.OAuth.FinalizeOAuth import FinalizeOAuth, FinalizeOAuthInputSet, FinalizeOAuthResultSet, FinalizeOAuthChoreographyExecution from temboo.Library.Dropbox.OAuth.InitializeOAuth import InitializeOAuth, InitializeOAuthInputSet, InitializeOAuthResultSet, InitializeOAuthChoreographyExecution
dyn888/youtube-dl
refs/heads/master
youtube_dl/extractor/cinemassacre.py
11
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError from .screenwavemedia import ScreenwaveMediaIE class CinemassacreIE(InfoExtractor): _VALID_URL = 'https?://(?:www\.)?cinemassacre\.com/(?P<date_y>[0-9]{4})/(?P<date_m>[0-9]{2}...
ishank08/scikit-learn
refs/heads/master
examples/cluster/plot_kmeans_silhouette_analysis.py
83
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
TyMaszWeb/django-cookie-law
refs/heads/master
setup.py
1
#!/usr/bin/env python import os from setuptools import setup, find_packages from itertools import chain from glob import glob import cookielaw CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', ...
infobloxopen/infoblox-netmri
refs/heads/master
infoblox_netmri/api/broker/v2_8_0/neighbor_broker.py
13
from ..broker import Broker class NeighborBroker(Broker): controller = "neighbors" def show(self, **kwargs): """Shows the details for the specified neighbor. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` True ...
venthur/pyff
refs/heads/master
src/lib/ipc.py
3
# ipc.py - # Copyright (C) 2009 Bastian Venthur # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is d...