repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
cstipkovic/spidermonkey-research | testing/marionette/harness/marionette/tests/unit/test_switch_remote_frame.py | 1 | 5471 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette import MarionetteTestCase
from marionette_driver.by import By
OOP_BY_DEFAULT = "dom.ipc.browser_frames... | mpl-2.0 |
stuaxo/mnd | mnd/handler.py | 1 | 6612 | """
To make callbacks work with instance methods some things need to happen.
The handler decorator attaches instances of MNDInfo to functions to enable
the dispatcher to work with classes and instances via the Handler metaclass.
At instance creation time the metaclass converts finds any handlers with
MNDFunction, rep... | mit |
Sajaki/DesignPatternsPHP | conf.py | 79 | 9476 | # -*- coding: utf-8 -*-
#
# DesignPatternsPHP documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 2 00:05:03 2015.
#
# 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 f... | mit |
apache/incubator-superset | superset/examples/helpers.py | 2 | 2743 | # 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 u... | apache-2.0 |
ofirpicazo/solitario | bin/generate_cards.py | 1 | 8706 | #!/usr/bin/python
# coding: utf-8
import argparse
import sys
SUIT_MAP = {
'club': '♣',
'diamond': '♦',
'heart': '♥',
'spade': '♠',
}
templateA = """
<div class="card %(suit)s" id="%(id)s" data-suit="%(suit)s" data-number="%(number)s">
<div class="flipper">
<div class="front">
<div class="corner t... | mit |
Aahung/Handbook-for-Programming-Contest | source/conf.py | 1 | 9229 | # -*- coding: utf-8 -*-
#
# sphinx test documentation build configuration file, created by
# sphinx-quickstart on Sat May 9 20:23:49 2015.
#
# 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.
#... | cc0-1.0 |
neuroidss/nupic.rogue | avogadro/disk_agent.py | 2 | 3160 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
GreenRecycleBin/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_response.py | 299 | 1931 | import os
import unittest
import urllib2
import json
import time
from types import MethodType
import wptserve
from base import TestUsingServer, doc_root
def send_body_as_header(self):
if self._response.add_required_headers:
self.write_default_headers()
self.write("X-Body: ")
self._headers_complet... | mpl-2.0 |
brython-dev/brython | www/src/Lib/threading.py | 1 | 51971 | """Thread module emulating a subset of Java's threading model."""
import os as _os
import sys as _sys
import _thread
import functools
from time import monotonic as _time
from _weakrefset import WeakSet
from itertools import islice as _islice, count as _count
try:
from _collections import deque as _deque
except Im... | bsd-3-clause |
lnielsen/invenio | invenio/legacy/websubmit/functions/Video_Processing.py | 4 | 4390 | ## This file is part of Invenio.
## Copyright (C) 2011 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 later version.
##
## Inv... | gpl-2.0 |
darbula/django-form-designer | form_designer/migrations/0002_auto_20160216_1527.py | 1 | 1389 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('form_designer', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='formdefinition',
... | bsd-3-clause |
ShineFan/odoo | openerp/service/model.py | 271 | 8227 | # -*- coding: utf-8 -*-
from functools import wraps
import logging
from psycopg2 import IntegrityError, OperationalError, errorcodes
import random
import threading
import time
import openerp
from openerp.tools.translate import translate
from openerp.osv.orm import except_orm
from contextlib import contextmanager
imp... | agpl-3.0 |
drewmoore/python-koans | python3/koans/about_regex.py | 79 | 4803 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import re
class AboutRegex(Koan):
"""
These koans are based on the Ben's book: Regular Expressions in 10 minutes.
I found this books very useful so I decided to write a koans in order to practice everything I had learned from i... | mit |
molobrakos/home-assistant | homeassistant/components/daikin/sensor.py | 5 | 3312 | """Support for Daikin AC sensors."""
import logging
from homeassistant.const import CONF_ICON, CONF_NAME, CONF_TYPE
from homeassistant.helpers.entity import Entity
from homeassistant.util.unit_system import UnitSystem
from . import DOMAIN as DAIKIN_DOMAIN
from .const import (
ATTR_INSIDE_TEMPERATURE, ATTR_OUTSIDE... | apache-2.0 |
ddzialak/boto | tests/integration/gs/cb_test_harness.py | 126 | 3473 | # Copyright 2010 Google 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
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | mit |
schlegelp/pymaid | setup.py | 1 | 1845 | from setuptools import setup, find_packages
import re
VERSIONFILE = "pymaid/__init__.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." %... | gpl-3.0 |
jrprice/pocl | doc/sphinx/source/conf.py | 2 | 6440 | # -*- coding: utf-8 -*-
#
# Portable Computing Language (pocl) documentation build configuration file, created by
# sphinx-quickstart on Fri May 3 10:53:18 2013.
#
# 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
# ... | mit |
Endika/pos-addons | _product_barcode_generator/sequence.py | 11 | 1340 | # -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | lgpl-3.0 |
shepdelacreme/ansible | lib/ansible/plugins/action/include_vars.py | 26 | 10975 | # (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
#
# 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 l... | gpl-3.0 |
rohlandm/servo | tests/wpt/web-platform-tests/webdriver/user_input/clear_test.py | 142 | 2601 | # -*- mode: python; fill-column: 100; comment-column: 100; -*-
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
class ElementClearTest(base_test.WebDriverBaseTest):
def test_writable_text_input_eleme... | mpl-2.0 |
qtumproject/qtum | test/functional/feature_proxy.py | 20 | 8368 | #!/usr/bin/env python3
# Copyright (c) 2015-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 bitcoind with different proxy configuration.
Test plan:
- Start bitcoind's with different proxy c... | mit |
Hawk94/dust | docs/conf.py | 1 | 7737 | # dust documentation build configuration file, created by
# sphinx-quickstart.
#
# 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.
#
# All configuration values have a default; values that are com... | mit |
infoxchange/lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/it/util.py | 436 | 1807 | from django.utils.encoding import smart_str, smart_unicode
def ssn_check_digit(value):
"Calculate Italian social security number check digit."
ssn_even_chars = {
'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
'9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': ... | gpl-3.0 |
braddockcg/internet-in-a-box | iiab/whoosh_search.py | 1 | 3339 | import os
from whoosh.qparser import MultifieldParser
from whoosh import scoring
from .whoosh_multi_field_spelling_correction import MultiFieldQueryCorrector
import pagination_helper
def index_directory_path(base_path, zim_name):
"""Returns the directory where a ZIM file's index should be located, given
a ba... | bsd-2-clause |
mozilla/mwc | vendor-local/packages/requests/requests/status_codes.py | 60 | 3028 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | mpl-2.0 |
RanadeepPolavarapu/kuma | vendor/packages/pygments/lexers/_cocoa_builtins.py | 43 | 39723 | # -*- coding: utf-8 -*-
"""
pygments.lexers._cocoa_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file defines a set of types used across Cocoa frameworks from Apple.
There is a list of @interfaces, @protocols and some other (structs, unions)
File may be also used as standalone generator for aboves... | mpl-2.0 |
labcodes/django | django/utils/log.py | 43 | 6379 | import logging
import logging.config # needed when logging_config doesn't start with logging.config
from copy import copy
from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.core.management.color import color_style
from django.utils.module_loading impo... | bsd-3-clause |
fartashf/python-mode | pymode/libs/logilab/common/daemon.py | 92 | 3337 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | lgpl-3.0 |
copotron/car-control | datacollection/prius/log.py | 1 | 1840 | # Copyright (C) 2017 Swift Navigation Inc.
# Contact: Swift Navigation <dev@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY K... | gpl-3.0 |
koushikcgit/xen | tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py | 42 | 1253 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
import re
from XmTestLib import *
from XmTestLib.block_utils import *
if ENABLE_HVM_SUPPORT:
SKIP("Block-attach not supported for HVM domains")
# Create a domain (default XmTestDomain, ... | gpl-2.0 |
PDXCodeCoop/account | models.py | 1 | 1688 | from django.db import models
from django import forms
from django.contrib.auth.models import User
from django.utils import timezone
from easy_thumbnails.fields import ThumbnailerImageField
#A User's Personal Info
class Profile(models.Model):
user = models.OneToOneField(User)
photo = ThumbnailerImageField(upl... | apache-2.0 |
bourreauEric/or-tools | examples/python/labeled_dice.py | 34 | 4106 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
hujiajie/chromium-crosswalk | tools/oopif/iframe_server.py | 172 | 7285 | # 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.
"""Test server for generating nested iframes with different sites.
Very simple python server for creating a bunch of iframes. The page generation
is ran... | bsd-3-clause |
Arkshine/AdminFreeLook | support/generate_headers.py | 1 | 2611 | # vim: set ts=8 sts=2 sw=2 tw=99 et:
import re
import os, sys
import subprocess
argv = sys.argv[1:]
if len(argv) < 2:
sys.stderr.write('Usage: generate_headers.py <source_path> <output_folder>\n')
sys.exit(1)
SourceFolder = os.path.abspath(os.path.normpath(argv[0]))
OutputFolder = os.path.normpath(argv[1])
class... | gpl-2.0 |
teolupus/s3cmd | S3/Progress.py | 7 | 6636 | # -*- coding: utf-8 -*-
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
## http://www.logix.cz/michal
## License: GPL Version 2
## Copyright: TGRMN Software and contributors
import sys
import datetime
import time
import Utils
class Progress(object):
_stdout = sys.stdout
_last_display ... | gpl-2.0 |
tboyce021/home-assistant | homeassistant/components/workday/binary_sensor.py | 4 | 6346 | """Sensor to indicate whether the current day is a workday."""
from datetime import datetime, timedelta
import logging
from typing import Any
import holidays
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_NAME, WEEKD... | apache-2.0 |
redFrik/supercollider | editors/sced/sced3/supercollider.py | 44 | 19208 | # -*- coding: utf-8 -*-
# Copyright 2009-2011 Artem Popov and contributors (see AUTHORS)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | gpl-3.0 |
diofeher/django-nfa | django/db/backends/postgresql_psycopg2/base.py | 14 | 3076 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures
from django.db.backends.postgresql.operations import DatabaseOperations as PostgresqlDatabaseOperations
from django.utils.safestring import Sa... | bsd-3-clause |
ThirdProject/android_external_chromium_org | tools/json_schema_compiler/preview.py | 44 | 12765 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Server for viewing the compiled C++ code from tools/json_schema_compiler.
"""
import cc_generator
import code
import cpp_type_g... | bsd-3-clause |
kiddhustle/wiardfmblog | django/template/defaultfilters.py | 105 | 28133 | """Default variable filters."""
from __future__ import unicode_literals
import re
import random as random_module
import unicodedata
from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP
from functools import wraps
from pprint import pformat
from django.template.base import Variable, Library, VariableD... | bsd-3-clause |
siddartha1992/cloud-custodian | tests/test_cwl.py | 2 | 2912 | # Copyright 2016 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 to in... | apache-2.0 |
codesters/codesters | codesters/utils.py | 6 | 2674 | import re
from django.template.defaultfilters import slugify
def unique_slugify(instance, value, slug_field_name='slug', queryset=None,
slug_separator='-'):
"""
Calculates and stores a unique slug of ``value`` for an instance.
``slug_field_name`` should be a string matching th... | mit |
CarbonWolf/aff4 | scons-local-1.2.0/SCons/Tool/sgilink.py | 12 | 2096 | """SCons.Tool.sgilink
Tool-specific initialization for the SGI MIPSPro linker on SGI.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCon... | gpl-3.0 |
mcepl/youtube-dl | youtube_dl/extractor/roosterteeth.py | 16 | 5647 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
strip_or_none,
unescapeHTML,
urlencode_postdata,
)
class RoosterTeethIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?roosterteeth\.com/e... | unlicense |
archlinux/arch-security-tracker | tracker/view/stats.py | 2 | 9781 | from collections import OrderedDict
from collections import defaultdict
from flask import render_template
from werkzeug.exceptions import ImATeapot
from tracker import db
from tracker import tracker
from tracker.model import CVE
from tracker.model import Advisory
from tracker.model import CVEGroup
from tracker.model ... | mit |
genonfire/bbgo | recipes/migrations/0001_initial.py | 1 | 1108 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(ver... | mit |
mythmon/airmozilla | airmozilla/manage/views/approvals.py | 5 | 3665 | from django import http
from django.contrib import messages
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_POST
from django.db import transaction
from airmozilla.main.models import (
Approval,
Event,
SuggestedEvent
)
from airmozilla.manage ... | bsd-3-clause |
linearregression/luigi | test/dynamic_import_test.py | 18 | 1810 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
itai12312/workspaces | hellodjango/venv/lib/python2.7/site-packages/django/http/response.py | 98 | 16141 | from __future__ import absolute_import, unicode_literals
import datetime
import time
import warnings
from email.header import Header
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.conf import settings
from django.core import signals
from django.core import... | gpl-2.0 |
dhwright25/npyscreen | build/lib/npyscreen/muMenu.py | 15 | 1985 | #!/usr/bin/python
# encoding: utf-8
import sys
import os
from . import wgmultiline
from . import fmForm
import weakref
class Menu(object):
"This class is obsolete and Depricated. Use NewMenu instead."
def __init__(self, name=None, show_atx=None, show_aty=None):
self.__menu_items = []
self.n... | bsd-2-clause |
openvapour/ryu | ryu/services/protocols/bgp/info_base/base.py | 11 | 41683 | # 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... | apache-2.0 |
souzainf3/namebench | nb_third_party/dns/rdtypes/ANY/GPOS.py | 248 | 5304 | # Copyright (C) 2003-2007, 2009, 2010 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 ... | apache-2.0 |
anarcoder/google_explorer | plugins/apache_rce_struts2_cve_2017_5638.py | 1 | 3545 | import os
from lxml import html as lh
from queue import Queue
from urllib.parse import urlparse
from threading import Thread
import requests
import threading
from requests import get
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning... | mit |
eneldoserrata/marcos_openerp | addons/idea/__openerp__.py | 52 | 1981 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
DarioGT/Zim-QDA | setup.py | 2 | 9395 | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
try:
import py2exe
except ImportError:
py2exe = None
from distutils.core import setup
from distutils.command.sdist import sdist as sdist_class
from distutils.command.build import build as build_class
from distutils.command.build_scripts imp... | gpl-2.0 |
Lujeni/ansible | lib/ansible/modules/network/fortios/fortios_system_replacemsg_sslvpn.py | 13 | 10095 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 of the Lic... | gpl-3.0 |
Mixser/django | tests/auth_tests/test_templates.py | 328 | 2785 | from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.views import (
password_change, password_change_done, password_reset,
password_reset_complete, password_reset_confirm, password_res... | bsd-3-clause |
dgjustice/ansible | lib/ansible/modules/network/junos/junos_package.py | 50 | 5163 | #!/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 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/ctypes/test/test_as_parameter.py | 46 | 6799 | import unittest
from ctypes import *
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
try:
CALLBACK_FUNCTYPE = WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
CALLBACK_FUNCTYPE = CFUNCTYPE
class POINT(Structure):
_fields_ = [("x", c_int), ("y", c_int)]
class BasicWrapTestCase(... | gpl-2.0 |
JingZhou0404/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py | 124 | 2423 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
eerimoq/pumba | bin/docgen.py | 2 | 5254 | #!/usr/bin/env python
"""Generate documentation.
"""
import os
import argparse
import json
import subprocess
import re
BOARD_FMT = """{desc}
{desc_underline}
Pinout and general information
------------------------------
Simba documentation: http://simba-os.readthedocs.io/en/latest/boards/{name}.html
Drivers
-----... | lgpl-2.1 |
slp/qemu-riscos | scripts/simpletrace.py | 150 | 5917 | #!/usr/bin/env python
#
# Pretty-printer for simple trace backend binary trace files
#
# Copyright IBM, Corp. 2010
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# For help see docs/tracing.txt
import struct
import re
import inspect
from trace... | gpl-2.0 |
CL0SeY/kernel_P7320T_ICS | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # 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... | gpl-2.0 |
40223211/logo-toys | static/Brython3.1.1-20150328-091302/Lib/itertools.py | 630 | 16041 | import operator
class accumulate:
def __init__(self, iterable, func = operator.add):
self.it = iter(iterable)
self._total = None
self.func = func
def __iter__(self):
return self
def __next__(self):
if not self._total:
self._total = next(self.it)... | agpl-3.0 |
tgsd96/gargnotes | venv/lib/python2.7/site-packages/django/contrib/sessions/tests.py | 31 | 22770 | import base64
from datetime import timedelta
import os
import shutil
import string
import tempfile
import unittest
import warnings
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSes... | mit |
qbektrix/namebench | tools/convert_server_list.py | 174 | 2968 | #!/usr/bin/env python
# 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... | apache-2.0 |
mupi/timtec | simplecors.py | 8 | 2255 | # from https://gist.github.com/enjalot/2904124
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file ob... | agpl-3.0 |
maniteja123/numpy | numpy/f2py/rules.py | 63 | 58541 | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Here is a skeleton of a new wrapper function (13Dec2001):
wrapper_function(args)
declarations
get_python_arguments, say, `a' and `b'
get_a_from_python
if (successful) {
get_b_from_python
if (successful) {
callfortran
... | bsd-3-clause |
ChristosChristofidis/h2o-3 | scripts/run.py | 1 | 66029 | #!/usr/bin/python
import sys
import os
import shutil
import signal
import time
import random
import getpass
import re
import subprocess
import ConfigParser
def is_python_test_file(file_name):
"""
Return True if file_name matches a regexp for a python test. False otherwise.
"""
if (file_name == "tes... | apache-2.0 |
neatbasis/synergy-foss | tools/gtest-1.6.0/test/gtest_xml_test_utils.py | 398 | 8029 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-2.0 |
kangleweb/t1 | contrib/spendfrom/spendfrom.py | 680 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
coronary/RandomEpisode | depends/Lib/encodings/zlib_codec.py | 202 | 2204 | """Python 'zlib_codec' Codec - zlib compression encoding.
This codec de/encodes from bytes to bytes.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib module !
### Codec APIs
def zlib_encode(input, errors='strict'):
assert errors == 'strict'
... | mit |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py | 82 | 7785 | """Suite Standard Suite: Common terms for most applications
Level 1, version 1
Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'CoRe'
from StdSu... | mit |
EmreAtes/spack | var/spack/repos/builtin/packages/py-twisted/package.py | 5 | 1644 | ##############################################################################
# Copyright (c) 2013-2018, 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... | lgpl-2.1 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/cffi-1.1.2/demo/winclipboard.py | 5 | 1498 | __author__ = "Israel Fruchter <israel.fruchter@gmail.com>"
from cffi import FFI
ffi = FFI()
ffi.cdef('''
typedef void * HANDLE;
typedef HANDLE HWND;
typedef int BOOL;
typedef unsigned int UINT;
typedef int SIZE_T;
typedef char * LPTSTR;
typedef HANDLE HGLOBAL;
typedef HANDLE LPVOID;
... | mit |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/folders/list.py | 3 | 2459 | # Copyright 2016 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... | apache-2.0 |
inaz2/deluge-hack | deluge/ui/gtkui/preferences.py | 2 | 46337 | #
# preferences.py
#
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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-3.0 |
ojengwa/odoo | addons/auth_openid/__openerp__.py | 313 | 1628 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
hashworks/CouchPotatoServer | couchpotato/core/media/movie/providers/automation/base.py | 6 | 3964 | import time
import unicodedata
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.automation.base import AutomationBase
from couchpotato.environment import Env
from couchpotato.core.helpers.variable import splitString
log = CPL... | gpl-3.0 |
manran/django-allauth | allauth/socialaccount/providers/oauth/views.py | 50 | 4232 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.providers.oauth.client import (OAuthClient,
OAuthError)
from allauth.socialacco... | mit |
shollingsworth/HackerRank | python/re-sub-regex-substitution/main.py | 1 | 1291 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import __future__
import sys
import json
def banner():
ban = '====' * 30
print("{}\nSAMPLE INP:\n{}\n{}".format(ban,ban,open(ip, 'r').read()))
print("{}\nSAMPLE OUT:\n{}\n{}".format(ban,ban,open(op, 'r').read()))
print("{}\nSTART:\n{}".format(ban,ban))
... | apache-2.0 |
rhndg/openedx | common/lib/calc/calc/preview.py | 224 | 12317 | """
Provide a `latex_preview` method similar in syntax to `evaluator`.
That is, given a math string, parse it and render each branch of the result,
always returning valid latex.
Because intermediate values of the render contain more data than simply the
string of latex, store it in a custom class `LatexRendered`.
"""... | agpl-3.0 |
marratj/ansible | lib/ansible/modules/network/avi/avi_serverautoscalepolicy.py | 27 | 7261 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | gpl-3.0 |
makinacorpus/django | django/conf/locale/hr/formats.py | 118 | 2068 | # -*- 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. E Y.'
TIME_FORMAT = 'H:i:s'
DA... | bsd-3-clause |
aESeguridad/GERE | venv/lib/python2.7/site-packages/jinja2/loaders.py | 333 | 17380 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | gpl-3.0 |
alexholehouse/SBMLIntegrator | libsbml-5.0.0/src/bindings/python/test/sbml/TestReadFromFile5.py | 1 | 6830 | #
# @file TestReadFromFile5.py
# @brief Reads test-data/l2v1-assignment.xml into memory and tests it.
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# $Id$
# $HeadURL$
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This f... | gpl-3.0 |
whn09/tensorflow | tensorflow/contrib/keras/python/keras/datasets/mnist.py | 58 | 1475 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
aristanetworks/neutron | neutron/plugins/vmware/extensions/nvp_qos.py | 43 | 1166 | # Copyright 2013 VMware, 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... | apache-2.0 |
wfwei/ReadWeibo | classifier/DataProcess.py | 1 | 3547 | # !/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on 2013-9-2
@author: plex
'''
from ReadWeibo.mainapp.models import Weibo
from ReadWeibo.account.models import Account
from djangodb.WeiboDao import WeiboDao
from datetime import datetime
from sets import Set
import numpy as np
import re
import jieba
jieba.load_u... | apache-2.0 |
asadziach/tensorflow | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | 22 | 13477 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ewiger/decade | lib/antlr3c/genclib.py | 1 | 1592 | #!/usr/bin/python
'''
This code will automatically generate most of the ctypes from ANTLR3 C runtime
headers.
'''
import os
import sys
import ext_path
from pyclibrary import *
from glob import glob
ANTLR3C_INCLUDE = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'libantlr3c-3.4',... | bsd-3-clause |
passiweinberger/nupic | src/nupic/regions/AnomalyRegion.py | 25 | 3732 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
nabilbendafi/mbed | workspace_tools/project.py | 50 | 7207 | import sys
from os.path import join, abspath, dirname, exists
ROOT = abspath(join(dirname(__file__), ".."))
sys.path.insert(0, ROOT)
from shutil import move, rmtree
from optparse import OptionParser
from workspace_tools.paths import EXPORT_DIR, EXPORT_WORKSPACE, EXPORT_TMP
from workspace_tools.paths import MBED_BASE,... | apache-2.0 |
haad/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_proxy.py | 58 | 12457 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Alen Komic
#
# 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 opti... | gpl-3.0 |
RTS2/rts2 | scripts/u_point/u_point/notify.py | 3 | 2605 | # (C) 2016, Markus Wildi, wildi.markus@bluewin.ch
#
# 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, or (at your option)
# any later version.
#
# This program is distr... | lgpl-3.0 |
SteveHNH/ansible | lib/ansible/plugins/action/dellos6.py | 16 | 3520 | # 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
# (at your option) any later version.
#
# Ansible is distrib... | gpl-3.0 |
mattias-ohlsson/anaconda | tests/storage_test/size_test.py | 3 | 3105 | #!/usr/bin/python
#
# tests/storage/size_tests.py
# Size test cases for the pyanaconda.storage module
#
# Copyright (C) 2010 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... | gpl-2.0 |
osstech-jp/samba | source3/selftest/tests.py | 6 | 31988 | #!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
# the Samba 3 test suite.
# The output of this script is parsed by selftest.pl, which then decides
# which of the tests to actually run. It will, for example, skip all tests
# listed in selftest/skip or only run a subset durin... | gpl-3.0 |
eunchong/build | scripts/slave/recipe_modules/archive/example.py | 1 | 3528 | # Copyright 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.
DEPS = [
'archive',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
]
TEST_HASH_MAIN='5e3250aadd... | bsd-3-clause |
wchrisjohnson/python_koans | python2/koans/about_comprehension.py | 70 | 2244 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutComprehension(Koan):
def test_creating_lists_with_list_comprehensions(self):
feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals',
'fruit bats']
comprehension = [delicacy.capitalize() for de... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.