repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
timsnyder/bokeh
refs/heads/master
examples/plotting/file/interactive_legend.py
12
import pandas as pd from bokeh.palettes import Spectral4 from bokeh.plotting import figure, output_file, show from bokeh.sampledata.stocks import AAPL, IBM, MSFT, GOOG p = figure(plot_width=800, plot_height=250, x_axis_type='datetime') p.title.text = 'Click on legend entries to hide lines' for data, name, color in z...
davidmueller13/android_kernel_samsung_lt03lte
refs/heads/android-5.1
tools/perf/util/setup.py
4998
#!/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...
drrk/micropython
refs/heads/master
tests/basics/builtin_bin.py
72
# test builtin bin function print(bin(1)) print(bin(-1)) print(bin(15)) print(bin(-15)) print(bin(12345)) print(bin(0b10101)) print(bin(12345678901234567890)) print(bin(0b10101010101010101010))
KULinacs/python-asymmetric-key-toolkit
refs/heads/master
python/asn1key.py
2
import intcodecs class ASN1_Object(object): def __init__(self, value): self.__set_value(value) def __len__(self): return len(self.__encoded_value) def __str__(self): header = 'OBJECT ' + hex(len(self)) + ' (' return header + hex(self.__value) + ')' def identity(self)...
paterson/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/html5lib/html5lib/__init__.py
426
""" HTML parsing library based on the WHATWG "HTML5" specification. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage: import html5lib f = open("my_document.html") tree = ht...
andrejb/cloudant_bigcouch
refs/heads/master
couchjs/scons/scons-local-2.0.1/SCons/Variables/PackageVariable.py
61
"""engine.SCons.Variables.PackageVariable This file defines the option type for SCons implementing 'package activation'. To be used whenever a 'package' may be enabled/disabled and the package path may be specified. Usage example: Examples: x11=no (disables X11 support) x11=yes (will search for the...
jackTheRipper/iotrussia
refs/heads/master
web_server/lib/werkzeug-master/examples/plnt/database.py
45
# -*- coding: utf-8 -*- """ plnt.database ~~~~~~~~~~~~~ The database definitions for the planet. :copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ from sqlalchemy import MetaData, Table, Column, ForeignKey, Boolean, \ Integer, String, DateTime from sq...
akbargumbira/django-user-map
refs/heads/develop
user_map/forms/user.py
1
# coding=utf-8 """Django forms for User related routines.""" from django.contrib.gis import forms from leaflet.forms.widgets import LeafletWidget from user_map.models import UserMap from user_map.app_settings import LEAFLET_TILES from user_map.forms.custom_widget import CustomClearableFileInput class UserMapForm(fo...
ahmed-mahran/hue
refs/heads/master
apps/impala/src/impala/forms.py
1198
#!/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...
elahejalalpour/ELRyu
refs/heads/master
ryu/tests/unit/packet/test_bmp.py
25
# Copyright (C) 2014 Nippon Telegraph and Telephone 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 required by appli...
ofbennett/bad-boids
refs/heads/master
setup.py
1
from setuptools import setup, find_packages setup( name = 'Improved_Boids', version = '1.0.0', author = 'Oscar Bennett', licence = 'The MIT License', description = 'An improved refactored version of the BadBoids code', packages = find_packages(exclude = ['*test']), scripts = ['scripts/runBo...
jwren/intellij-community
refs/heads/master
python/testData/types/AnnotatedClsReturnOverloadedClassMethod/mytime.py
12
from typing import Type, TypeVar T = TypeVar("T") class mytime: if sys.version_info >= (3, 8): @classmethod def now(cls: Type[T], tz: Optional[int] = ...) -> T: ... else: @overload @classmethod def now(cls: Type[T], tz: int = ...) -> T: ...
AkshayHarshe/developer-support
refs/heads/master
python/arcpy-python/remove-all-basemaps-batch/remove-all-basemaps-from-mxd-batch.py
15
#------------------------------------------------------------------------------- # Title: Remove all basemap layers # Purpose: Remove all basemaps from MXDs. This script takes an input # directory and walks through it, finding all MXDs and searching # for basemap layerss # # Auth...
jadelord/TomoKTH
refs/heads/master
tomokth/preprocess/io.py
1
"""Handles I/O of images to tools(:mod:`fluidimage.pre_proc.io`) ================================================================================== Provides decorators to handle input and output of images for tools/functions in `fluidimage.pre_proc.toolbox` .. currentmodule:: fluidimage.pre_proc.io Provides: :mem...
hhsprings/cython
refs/heads/master
Cython/Compiler/Buffer.py
7
from __future__ import absolute_import from .Visitor import CythonTransform from .ModuleNode import ModuleNode from .Errors import CompileError from .UtilityCode import CythonUtilityCode from .Code import UtilityCode, TempitaUtilityCode from . import Options from . import Interpreter from . import PyrexTypes from . i...
daviddrysdale/python-phonenumbers
refs/heads/dev
python/phonenumbers/data/alt_format_64.py
1
"""Auto-generated file, do not edit by hand. 64 metadata""" from ..phonemetadata import NumberFormat PHONE_ALT_FORMAT_64 = [NumberFormat(pattern='(\\d)(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[3467]|9[2-9]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digit...
MetrodataTeam/incubator-airflow
refs/heads/master
airflow/api/client/local_client.py
25
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
mitchelljkotler/django
refs/heads/master
tests/auth_tests/test_context_processors.py
269
import datetime from django.contrib.auth import authenticate from django.contrib.auth.context_processors import PermLookupDict, PermWrapper from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.db.models import Q from django.test import SimpleTes...
reflexsc/reflex
refs/heads/master
src/rfx/client.py
1
#$#HEADER-START # vim:set expandtab ts=4 sw=4 ai ft=python: # # Reflex Configuration Event Engine # # Copyright (C) 2016 Brandon Gillespie # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free...
Aaron0927/xen-4.2.1
refs/heads/master
tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
42
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Murillo F. Bernardes <mfb@br.ibm.com> import sys import re import time from XmTestLib import * from XmTestLib.network_utils import * if ENABLE_HVM_SUPPORT: SKIP("Network-attach not supported for HVM domains") # Create a dom...
authurlan/amdfin
refs/heads/develop
server/main.py
1
# -*- coding: utf-8 -*- import logging import traceback from bottle import Bottle, run from beaker.middleware import SessionMiddleware import const from app import UserApp, AnimtApp, TmpAnimtApp def wcgi_app(): app = Bottle() #app.mount("/server", ServerApp()) app.mount("/api/user", UserApp()) app....
tradel/AppDynamicsREST
refs/heads/master
appd/model/license_usage.py
1
""" Model classes for AppDynamics REST API """ from . import JsonObject, JsonList from appd.time import from_ts class LicenseUsage(JsonObject): FIELDS = { 'id': '', 'account_id': 'accountId', 'units_used': 'unitsUsed', 'units_allowed': 'unitsAllowed', 'units_provisioned': ...
AdrianHuang/linux-3.8.13
refs/heads/master
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gujiawen/flask_web
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py
374
import calendar import time from email.utils import formatdate, parsedate, parsedate_tz from datetime import datetime, timedelta TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT" def expire_after(delta, date=None): date = date or datetime.now() return date + delta def datetime_to_header(dt): return formatdate(c...
darkleons/odoo
refs/heads/master
addons/account/__openerp__.py
41
# -*- 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...
haltode/haltode.fr-core
refs/heads/master
content/articles/algorithme/ia/apprentissage_artificiel/regression_lin_poly/algo_gradient/sortie_graphique.py
5
import matplotlib.pyplot as plt # Récupère dans des listes les valeurs de x, y, et de notre approximation de y x = np.array(ia.x[:,1]).tolist() x = [float(i[0]) for i in x] y = np.array(ia.y).tolist() y = [float(i[0]) for i in y] y_approx = np.array(ia.x * ia.theta).tolist() y_approx = [float(i[0]) for i in y_approx...
yukoba/sympy
refs/heads/master
sympy/combinatorics/tests/test_prufer.py
102
from sympy.combinatorics.prufer import Prufer from sympy.utilities.pytest import raises def test_prufer(): # number of nodes is optional assert Prufer([[0, 1], [0, 2], [0, 3], [0, 4]], 5).nodes == 5 assert Prufer([[0, 1], [0, 2], [0, 3], [0, 4]]).nodes == 5 a = Prufer([[0, 1], [0, 2], [0, 3], [0, 4]]...
minhphung171093/GreenERP_V9
refs/heads/master
openerp/addons/web_editor/models/test_models.py
47
# -*- coding: utf-8 -*- from openerp.osv import orm, fields class test_converter(orm.Model): _name = 'web_editor.converter.test' # disable translation export for those brilliant field labels and values _translate = False _columns = { 'char': fields.char(), 'integer': fields.integer()...
marado/youtube-dl
refs/heads/master
youtube_dl/extractor/history.py
121
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import smuggle_url class HistoryIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?history\.com/(?:[^/]+/)+(?P<id>[^/]+?)(?:$|[?#])' _TESTS = [{ 'url': 'http://www.history.com/topics/valentines-day/history-of-va...
nicolargo/intellij-community
refs/heads/master
python/testData/resolve/multiFile/importSubmodule/ImportSubmodule.py
83
import p1.m1 p1.m1 # <ref>
alexmorozov/django
refs/heads/master
tests/template_tests/templatetags/custom.py
161
import operator import warnings from django import template from django.template.defaultfilters import stringfilter from django.utils import six from django.utils.html import escape, format_html register = template.Library() @register.filter @stringfilter def trim(value, num): return value[:num] @register.fil...
aivarsk/scrapy
refs/heads/master
scrapy/utils/ossignal.py
204
from __future__ import absolute_import from twisted.internet import reactor import signal signal_names = {} for signame in dir(signal): if signame.startswith("SIG"): signum = getattr(signal, signame) if isinstance(signum, int): signal_names[signum] = signame def install_shutdown_han...
Nu3001/external_chromium_org
refs/heads/master
tools/telemetry/telemetry/core/chrome/desktop_browser_backend.py
23
# 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. import logging import os import subprocess as subprocess import shutil import sys import tempfile from telemetry.core import util from telemetry.core.bac...
etalab/udata
refs/heads/master
udata/tests/forms/test_current_user_field.py
2
import datetime from bson import ObjectId from werkzeug.datastructures import MultiDict from udata.auth import login_user from udata.auth.forms import ExtendedLoginForm, ExtendedResetPasswordForm from udata.core.user.factories import UserFactory, AdminFactory from udata.forms import ModelForm, fields from udata.model...
hobarrera/django
refs/heads/master
tests/template_tests/filter_tests/test_upper.py
388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import upper from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class UpperTests(SimpleTestCase): """ The "upper" filter messes up entities (which a...
yashsharan/sympy
refs/heads/master
sympy/strategies/tests/test_tools.py
129
from sympy.strategies.tools import subs, typed from sympy.strategies.rl import rm_id from sympy import Basic def test_subs(): from sympy import symbols a,b,c,d,e,f = symbols('a,b,c,d,e,f') mapping = {a: d, d: a, Basic(e): Basic(f)} expr = Basic(a, Basic(b, c), Basic(d, Basic(e))) result = Basic(d...
derekjchow/models
refs/heads/master
official/keras_application_models/dataset.py
1
# 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 # # Unless required by applica...
gsehub/edx-platform
refs/heads/gsehub-release
lms/djangoapps/discussion_api/views.py
9
""" Discussion API views """ from django.core.exceptions import ValidationError from django.contrib.auth import get_user_model from edx_rest_framework_extensions.authentication import JwtAuthentication from opaque_keys.edx.keys import CourseKey from rest_framework import permissions from rest_framework import status fr...
fearlessspider/python-social-auth
refs/heads/master
examples/tornado_example/app.py
58
import sys sys.path.append('../..') from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from social.apps.tornado_app.models impor...
yorung/XLE
refs/heads/master
Foreign/FreeType/src/tools/docmaker/docbeauty.py
877
#!/usr/bin/env python # # DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org> # # This program is used to beautify the documentation comments used # in the FreeType 2 public headers. # from sources import * from content import * from utils import * import utils import sys, os, time, string, getopt ...
dllsf/odootest
refs/heads/master
addons/web_graph/__openerp__.py
376
{ 'name': 'Graph Views', 'category': 'Hidden', 'description': """ Graph Views for Web Client. =========================== * Parse a <graph> view but allows changing dynamically the presentation * Graph Types: pie, lines, areas, bars, radar * Stacked/Not Stacked for areas and bars * Legends:...
smcantab/pele
refs/heads/master
pele/utils/events.py
5
""" adapted from http://code.activestate.com/recipes/577980-improved-signalsslots-implementation-in-python/ A signal/slot implementation File: signal.py Author: Thiago Marcos P. Santos Author: Christopher S. Case Author: David H. Bronke Created: August 28, 2008 Updated: December 12, 2011 License: MIT """ impo...
JavaRabbit/CS496_capstone
refs/heads/master
appengine/flexible/hello_world_django/helloworld/views.py
9
#!/usr/bin/env python # Copyright 2015 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 ...
kevinmel2000/brython
refs/heads/master
www/tests/test_null.py
18
from javascript import JSObject assert(JSObject(null) == None) assert(JSObject(null) is None) assert(None is None) assert(None is JSObject(null)) assert(None == JSObject(null)) assert(JSObject(null) is JSObject(null)) print("All tests passed")
boxu0001/practice
refs/heads/master
py3/S123_BestTimeBuySell.py
1
# Say you have an array for which the ith element is the price of a given stock on day i. # Design an algorithm to find the maximum profit. You may complete at most two transactions. # Note: You may not engage in multiple transactions at the same time (i.e., you must sell the stock before you buy again). # Example 1: ...
CapOM/ChromiumGStreamerBackend
refs/heads/master
build/win/use_ansi_codes.py
64
#!/usr/bin/env python # Copyright (c) 2015 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. """Prints if the the terminal is likely to understand ANSI codes.""" import os # Add more terminals here as needed. print 'ANSICON...
DaviKaur/LibreHatti
refs/heads/master
src/librehatti/reports/models.py
4
from django.db import models class SavedRegisters(models.Model): title = models.CharField(max_length = 200) selected_fields = models.CharField(max_length = 1000) def __unicode__(self): return self.title
ajdavis/tornado
refs/heads/master
tornado/test/import_test.py
8
# flake8: noqa from __future__ import absolute_import, division, print_function from tornado.test.util import unittest class ImportTest(unittest.TestCase): def test_import_everything(self): # Some of our modules are not otherwise tested. Import them # all (unless they have external dependencies) ...
mcopik/Elemental
refs/heads/master
examples/interface/PNorm.py
2
# A small SOCP formulation of minimizing the p-norm of a vector subject to # constraints (in this trivial case, maximize the two-norm subject to the # entire vector being fixed). This example originally caused the ninth SOCP # IPM KKT system to be excessively ill-conditioned and was reported by # Steven Diamond via C...
silenci/neutron
refs/heads/master
neutron/agent/l3/namespaces.py
37
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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 requir...
MarcusJones/py_ExergyUtilities
refs/heads/master
ExergyUtilities/util_logger.py
2
#=============================================================================== # Title of this Module # Authors; MJones, Other # 00 - 2012FEB05 - First commit # 01 - 2012MAR17 - Update to ... #=============================================================================== """This module does A and B. Etc. """ #===...
liorvh/golismero
refs/heads/master
golismero/api/data/vulnerability/information_disclosure/dns_zone_transfer.py
8
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__= """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of ...
nagyistoce/edx-analytics-data-api-client
refs/heads/master
analyticsclient/module.py
2
import analyticsclient.constants.data_format as DF class Module(object): """ Module related analytics data. """ def __init__(self, client, course_id, module_id): """ Initialize the Module client. Arguments: client (analyticsclient.client.Client): The client to use to acce...
jsilter/scipy
refs/heads/master
scipy/sparse/linalg/setup.py
20
#!/usr/bin/env python from __future__ import division, print_function, absolute_import def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('linalg',parent_package,top_path) config.add_subpackage(('isolve')) config.add_subpack...
neilLasrado/frappe
refs/heads/develop
frappe/api.py
4
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import json import frappe import frappe.handler import frappe.client from frappe.utils.response import build_response from frappe import _ from six.moves.urllib.parse import urlpa...
bobwalker99/Pydev
refs/heads/master
plugins/org.python.pydev.jython/Lib/encodings/mac_cyrillic.py
593
""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
kajigga/canvas-contrib
refs/heads/master
SIS_Integration/create_ssha_passwords/ssha_password.py
5
#!/usr/bin/env python import base64 import hashlib """ This method generates a SSHA password. This generated password can be included in a Canvas users.csv file. If you do this, you would use a column called ssha_password rather than simply password """ def gen_ssha_password(password,salt): final_hashed_pw = "{SSHA}...
eugena/django
refs/heads/master
django/http/__init__.py
341
from django.http.cookie import SimpleCookie, parse_cookie from django.http.request import ( HttpRequest, QueryDict, RawPostDataException, UnreadablePostError, ) from django.http.response import ( BadHeaderError, FileResponse, Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponse...
julianprabhakar/eden_car
refs/heads/master
modules/unit_tests/s3/s3widgets.py
6
# S3 Widgets Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3widgets.py import unittest from gluon import * from gluon.storage import Storage from s3.s3widgets import S3OptionsMatrixWidget from gluon.contrib.simplejson.ordered_dict import OrderedDict ...
alecalve/bitcoin
refs/heads/master
contrib/seeds/generate-seeds.py
30
#!/usr/bin/env python3 # Copyright (c) 2014-2017 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the dir...
ntkrnl/yacoin-p2pool
refs/heads/master
nattraverso/ipdiscover.py
288
""" Generic methods to retreive the IP address of the local machine. TODO: Example @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" import random, socket, logging, itertools from twisted.internet...
fnouama/intellij-community
refs/heads/master
python/testData/quickFixes/PyMoveAttributeToInitQuickFixTest/removePass.py
83
__author__ = 'ktisha' class A: def __init__(self): pass def foo(self): self.<caret>b = 1
lavakyan/mstm-spectrum
refs/heads/master
mstm_studio/test/test_mstm_spectrum.py
1
# -*- coding: utf-8 -*- # # ----------------------------------------------------- # # # # This code is a part of T-matrix fitting project # # Contributors: # # L. Avakyan <laavakyan@sfedu.ru> # # ...
devendermishrajio/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/test_security_groups.py
22
# Copyright 2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # # 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 # #...
firebitsbr/infernal-twin
refs/heads/master
build/reportlab/build/lib.linux-i686-2.7/reportlab/pdfbase/pdfdoc.py
24
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/pdfdoc.py __version__=''' $Id$ ''' __doc__=""" The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that all objects a...
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/Pygments-1.3.1/build/lib/pygments/style.py
75
# -*- coding: utf-8 -*- """ pygments.style ~~~~~~~~~~~~~~ Basic style object. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.token import Token, STANDARD_TYPES class StyleMeta(type): def __new__(mcs, name, bases,...
LoHChina/nova
refs/heads/master
nova/hacking/checks.py
8
# Copyright (c) 2012, Cloudscaling # 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...
ayumilong/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/jinja2/exceptions.py
977
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import imap, text_type, PY2, implements_to_string class TemplateError(Exception): """Baseclass for al...
crdroid-devices/android_kernel_htc_msm8960
refs/heads/6.0
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
petermezei/angular2-cli
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
# Copyright (c) 2013 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. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
MikkCZ/kitsune
refs/heads/master
authority/widgets.py
6
from django import forms from django.conf import settings from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.contrib.admin.widgets import ForeignKeyRawIdWidget generic_script = """ <script type="text/javascript"> function showGenericRelatedObjectLookupPop...
akkakks/pygeoip
refs/heads/master
pygeoip/regionname.py
1
# -*- coding: utf-8 -*- """ Region name functions. Part of the pygeoip package. @author: Phus Lu <phus.lu@gmail.com> @license: Copyright(C) 2004 MaxMind LLC This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Softwa...
mjschultz/django-password-policies
refs/heads/master
password_policies/views.py
1
from django.utils import timezone from django.contrib.auth.decorators import login_required from django.contrib.auth import get_user_model from django.core import signing from django.core.urlresolvers import reverse from django.shortcuts import resolve_url from django.utils.decorators import method_decorator from djang...
horken7/openhack
refs/heads/master
pinguin/data_collection/collect_data.py
1
import requests, json import numpy as np from pinguin.models import Jobs, Heatmap, Housing from .arbetsformedlingen_api import HandlerArbetsformedlingenAPI from .google_geocoding_api import HandlerGoogleGeocodingAPI from .booli_api import HandlerBooliAPI from geopy.geocoders import Nominatim class CollectData: de...
xiami9916057/volatility
refs/heads/master
volatility/plugins/mac/check_trap_table.py
44
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
eyohansa/django
refs/heads/master
django/contrib/gis/maps/google/overlays.py
151
from __future__ import unicode_literals from functools import total_ordering from django.contrib.gis.geos import ( LinearRing, LineString, Point, Polygon, fromstr, ) from django.utils import six from django.utils.encoding import python_2_unicode_compatible from django.utils.html import html_safe @html_safe @pyt...
chylli/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/__init__.py
6014
# Required for Python to search this directory for module files
Chilledheart/chromium
refs/heads/master
third_party/typ/typ/tests/main_test.py
33
# Copyright 2014 Dirk Pranke. 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 a...
owaiskhan/Retransmission-Combining
refs/heads/master
gr-digital/examples/ofdm/benchmark_tx.py
1
#!/usr/bin/env python # # Copyright 2005,2006,2011 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 you...
iut-ibk/DynaMind-ToolBox
refs/heads/master
DynaMind-Performance-Assessment/3rdparty/CD3Waterbalance/WaterDemandModel/C_WaterDemandModel.py
1
__author__ = 'Jeddah' __project__ = "WaterDemandMdeol" import sampling_db as DB import C_ApplianceType as Appliance import C_UnitType as Unit import C_ResidentialUnit as residential import C_CommercialUnit as commercial class WaterDemandModel(): """ """ __residential_units = [] # the number o...
shsingh/ansible
refs/heads/devel
lib/ansible/plugins/action/enos.py
9
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
cnsoft/kbengine-cocos2dx
refs/heads/cocos2dx-cnsoft
kbe/src/lib/python/Tools/scripts/pdeps.py
66
#! /usr/bin/env python3 # pdeps # # Find dependencies between a bunch of Python modules. # # Usage: # pdeps file1.py file2.py ... # # Output: # Four tables separated by lines like '--- Closure ---': # 1) Direct dependencies, listing which module imports which other modules # 2) The inverse of (1) # 3) Indirect d...
40223133/2015W11
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/test/support.py
770
import unittest class TestEquality(object): """Used as a mixin for TestCase""" # Check for a valid __eq__ implementation def test_eq(self): for obj_1, obj_2 in self.eq_pairs: self.assertEqual(obj_1, obj_2) self.assertEqual(obj_2, obj_1) # Check for a valid __ne__ impl...
Sorsly/subtle
refs/heads/master
google-cloud-sdk/lib/surface/compute/backend_services/list.py
6
# Copyright 2014 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 ag...
schiesbn/backupRotate
refs/heads/master
backuprotate.py
1
#!/usr/bin/python """ (c) Copyright 2013 Bjoern Schiessle <bjoern@schiessle.org> This program is free software released under the MIT License, for more details see LICENSE.txt or http://opensource.org/licenses/MIT This program was written for personal usage. So don't expect any active development beside adjustments t...
Just-D/chromium-1
refs/heads/master
tools/perf/measurements/page_cycler_unittest.py
6
# 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. import sys import unittest from telemetry.internal.browser import browser_options from telemetry.internal.results import page_test_results from telemetry.in...
tienfuc/gdcmdtools
refs/heads/master
gdcmdtools/about.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import sys import urllib import requests import json import pprint import re import logging logger = logging.getLogger("gdabout") import random import os import json from gdcmdtools.base import GDBase from gdcmdtools.perm import GDPerm from gdcmdtools.auth i...
taroplus/spark
refs/heads/master
examples/src/main/python/ml/min_hash_lsh_example.py
52
# # 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 us...
xingyepei/edx-platform
refs/heads/release
common/lib/xmodule/xmodule/open_ended_grading_classes/__init__.py
248
__author__ = 'vik'
ar7z1/ansible
refs/heads/devel
lib/ansible/modules/net_tools/nios/nios_host_record.py
17
#!/usr/bin/python # Copyright (c) 2018 Red Hat, Inc. # 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', 'status': ['preview...
wenderen/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/testing/code/test_code.py
169
import sys import _pytest._code import py import pytest def test_ne(): code1 = _pytest._code.Code(compile('foo = "bar"', '', 'exec')) assert code1 == code1 code2 = _pytest._code.Code(compile('foo = "baz"', '', 'exec')) assert code2 != code1 def test_code_gives_back_name_for_not_existing_file(): ...
samzhang111/scikit-learn
refs/heads/master
examples/model_selection/plot_precision_recall.py
249
""" ================ Precision-Recall ================ Example of Precision-Recall metric to evaluate classifier output quality. In information retrieval, precision is a measure of result relevancy, while recall is a measure of how many truly relevant results are returned. A high area under the curve represents both ...
ryfeus/lambda-packs
refs/heads/master
Selenium_Chromium/source/setuptools/ssl_support.py
64
import os import socket import atexit import re import functools from setuptools.extern.six.moves import urllib, http_client, map, filter from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a...
svanschalkwyk/datafari
refs/heads/master
windows/python/Lib/unittest/test/test_loader.py
40
import sys import types import unittest class Test_TestLoader(unittest.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################ # "Return a suite of all tests cases contained in the TestCase-derived # class testCaseClass" def te...
angstwad/ansible
refs/heads/devel
test/units/playbook/__init__.py
7690
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
jamesrenfro/sharealike
refs/heads/master
shareproject/apps/shareserver/constants.py
1
MODEL_NAMES = { 'DOG' : 'Dog', 'PICTURE' : 'Picture', 'PERSON' : 'Person', 'SEARCH_INDEX' : 'SearchIndex' }
dudepare/django
refs/heads/master
django/contrib/sessions/backends/base.py
298
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
mediaessenz/TYPO3-metaseo
refs/heads/develop
Documentation/_make/conf.py
2
# -*- coding: utf-8 -*- # # MetaSEO Import from tq_seo documentation build configuration file, created by # TYPO3 extension sphinx on Tue, 01 Apr 2014 17:53:40 +0200. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in thi...
DrPaulBrewer/rtlsdr-automated-wxsat-capture
refs/heads/master
noaacapture.py
1
import time import pypredict import subprocess satellites = ['NOAA-18','NOAA-19','NOAA-15'] freqs = [137912500, 137100000, 137620000] sample = '44100' wavrate='11025' def runForDuration(cmdline, duration): try: child = subprocess.Popen(cmdline) time.sleep(duration) child.terminate() ex...
rruebner/odoo
refs/heads/master
addons/hr_timesheet_sheet/wizard/__init__.py
443
# -*- 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...