repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/cryptography/utils.py | 13 | 3919 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import binascii
import inspect
import sys
import warnings
# ... | gpl-2.0 |
acsone/account-closing | account_cutoff_prepaid/tests/__init__.py | 9 | 1085 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Cut-off Prepaid test module for OpenERP
# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# This program is free software: you can r... | agpl-3.0 |
performanceci/performanceci-core | salt/formulas/postgres-formula/_modules/postgres_ext.py | 4 | 8891 | from __future__ import absolute_import
import logging
try:
import pipes
import csv
HAS_ALL_IMPORTS = True
except ImportError:
HAS_ALL_IMPORTS = False
# All this can be removed when we merge this stuff upstream
import salt.utils
log = logging.getLogger(__name__)
def __virtual__():
'''
Only loa... | agpl-3.0 |
wgwoods/dnf | dnf/i18n.py | 6 | 9635 | # i18n.py
#
# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope ... | gpl-2.0 |
2ndQuadrant/ansible | lib/ansible/module_utils/k8s/raw.py | 2 | 21140 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# ... | gpl-3.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/perf/benchmarks/gpu_times.py | 4 | 2575 | # 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.
from core import perf_benchmark
from benchmarks import silk_flags
from telemetry import benchmark
from telemetry.timeline import tracing_category_filter
fr... | mit |
axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/encodings/mac_farsi.py | 593 | 15426 | """ Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.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,input,err... | apache-2.0 |
sagood/coreclr | src/ToolBox/SOS/tests/t_cmd_dumpmodule.py | 43 | 1304 | import lldb
import re
import testutils as test
def runScenario(assembly, debugger, target):
process = target.GetProcess()
res = lldb.SBCommandReturnObject()
ci = debugger.GetCommandInterpreter()
# Run debugger, wait until libcoreclr is loaded,
# set breakpoint at Test.Main and stop there
test... | mit |
TenKeyAngle/UWANewsViewer | helper.py | 1 | 4741 | import wtforms
from flask import url_for
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, validators
import requests
import csv
# Helper methods and classes for the main application
# Forms used in the application
# Form for searching by URL and by keywords
class LinkForm(FlaskForm):
... | apache-2.0 |
wenderen/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-recovery-worker.py | 143 | 1067 | def main(request, response):
# Set mode to 'init' for initial fetch.
mode = 'init'
if 'update-recovery-mode' in request.cookies:
mode = request.cookies['update-recovery-mode'].value
# no-cache itself to ensure the user agent finds a new version for each update.
headers = [('Cache-Control', ... | mpl-2.0 |
osmc/vero2-recovery | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
sdh11/gnuradio | grc/converter/cheetah_converter.py | 7 | 8940 | # Copyright 2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# GNU Radio Companion 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) a... | gpl-3.0 |
nvoron23/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/getpass.py | 59 | 5272 | """Utilities to get a password and/or the current user name.
getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.
GetPassWarning - This UserWarning is issued when getpass() cannot prevent
echoing of the passw... | apache-2.0 |
mx3L/enigma2 | lib/python/Tools/ISO639.py | 79 | 23367 | # -*- coding: iso-8859-2 -*-
LanguageCodes = { }
LanguageCodes["aar"] = LanguageCodes["aa"] = ("Afar", "Hamitic")
LanguageCodes["abk"] = LanguageCodes["ab"] = ("Abkhazian", "Ibero-caucasian")
LanguageCodes["ace"] = ("Achinese", "")
LanguageCodes["ach"] = ("Acoli", "")
LanguageCodes["ada"] = ("Adangme", "")
LanguageCod... | gpl-2.0 |
ctasims/Dive-Into-Python-3 | ch15-porting-chardet/chardet/gb2312prober.py | 2994 | 1681 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
tddv/readthedocs.org | readthedocs/rtd_tests/fixtures/sample_repo/source/conf.py | 57 | 6937 | # -*- coding: utf-8 -*-
#
# sample documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 18 07:17:29 2011.
#
# 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.
#
# Al... | mit |
yanchen036/tensorflow | tensorflow/contrib/autograph/converters/asserts_test.py | 4 | 1349 | # Copyright 2017 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 |
ryanpdwyer/FreqDemod | freqdemod/tests/test_freqdemod.py | 2 | 13895 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# John A. Marohn (jam99@cornell.edu)
# 2014/06/28
"""
Tests for the demodulate module.
"""
# if a function is *expected *to fail, then
#
# @unittest.expectedFailure
# def test_that_fails():
#
from freqdemod.demodulate import Signal
from freqdemod.hdf5 import ... | gpl-3.0 |
miketheman/opencomparison | core/middleware.py | 1 | 1299 | """
Original Source: https://github.com/jacobian/django-dev-dashboard/blob/master/dashboard/middleware.py
Permission: Granted by Jacob Kaplan-Moss on 5/23/2012
License: https://github.com/jacobian/django-dev-dashboard/blob/master/LICENSE.txt
"""
from django.conf import settings
from django.core.exceptions ... | mit |
flwh/KK_mt6589_iq451 | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/json/decoder.py | 51 | 13882 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from json import scanner
try:
from _json import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
_BYTES = '7FF800000000... | gpl-2.0 |
sdenisen/python | yandex/task5/task5_tests.py | 1 | 1562 | import random
import unittest
import task5.task5_resolve
class MyTestCase(unittest.TestCase):
def test_check_test_data_from_task_description(self):
rc = task5.task5_resolve.RequestCollector(user_limit=2, service_limit=5, duration=5)
verify_data = [(1, 100, 200), # 1
(1, ... | unlicense |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/zmq/tests/test_cffi_backend.py | 11 | 9481 | # -*- coding: utf8 -*-
import sys
import time
from unittest import TestCase
from zmq.tests import BaseZMQTestCase, SkipTest
try:
from zmq.backend.cffi import (
zmq_version_info,
PUSH, PULL, IDENTITY,
REQ, REP, POLLIN, POLLOUT,
)
from zmq.backend.cffi._cffi import ffi, C
have_... | bsd-2-clause |
GennadiyZakharov/locotrack | src/ltcore/chamber.py | 1 | 10098 | '''
Created on 18.03.2011
@author: Gena
'''
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
from hashlib import sha512
from time import time
from random import randint
from numpy import meshgrid, arange
from PyQt4 import QtCore,QtGui
from ltcore.lttrajectory import LtTra... | lgpl-3.0 |
mozilla/bramble | vendor-local/lib/python/werkzeug/urls.py | 73 | 18959 | # -*- coding: utf-8 -*-
"""
werkzeug.urls
~~~~~~~~~~~~~
This module implements various URL related functions.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import urlparse
from werkzeug._internal import _decode_unicode
fr... | mpl-2.0 |
jesramirez/odoo | addons/crm/crm.py | 267 | 7967 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
tntnatbry/tensorflow | tensorflow/python/kernel_tests/sparse_serialization_ops_test.py | 99 | 8330 | # 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 |
jetskijoe/SickGear | lib/hachoir_parser/misc/msoffice_summary.py | 57 | 13631 | """
Microsoft Document summaries structures.
Documents
---------
- Apache POI (HPSF Internals):
http://poi.apache.org/hpsf/internals.html
"""
from hachoir_core.endian import BIG_ENDIAN,LITTLE_ENDIAN
from hachoir_parser import HachoirParser
from hachoir_core.field import (FieldSet, ParserError,
SeekableFieldSe... | gpl-3.0 |
codeworldprodigy/lab3 | lib/werkzeug/testsuite/contrib/iterio.py | 102 | 6123 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.iterio
~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the iterio object.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from functools import partial
from werkzeug.testsuite import WerkzeugTestCase
from werk... | apache-2.0 |
SKIRT/PTS | modeling/tests/M81/config.py | 1 | 3280 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# ... | agpl-3.0 |
willpatterson/LogoBatch | logobatch/sj_terminator.py | 1 | 2057 | import os
import subprocess
import paramiko
def count_lines(path):
with open(path, 'r') as pfile:
return len(pfile.readlines())
exe = "/share/apps/user/stow/netlogo-5.2.1/netlogo-headless.sh"
out_dir = '/home/wpatt2/Alex_out'
out_files = os.listdir(out_dir)
out_files = [os.path.join(out_dir, f) for f in ... | mit |
freakynit/vertx-web | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/command/alias.py | 285 | 2486 | import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in ... | apache-2.0 |
yencarnacion/jaikuengine | common/exception.py | 30 | 7976 | # Copyright 2009 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, ... | apache-2.0 |
servo/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_error.py | 60 | 2917 | """
create errno-specific classes for IO or os calls.
"""
from types import ModuleType
import sys, os, errno
class Error(EnvironmentError):
def __repr__(self):
return "%s.%s %r: %s " %(self.__class__.__module__,
self.__class__.__name__,
self.__... | mpl-2.0 |
mzdaniel/pycon | pycon_project/apps/wakawaka/views.py | 2 | 14533 | import difflib
from datetime import datetime, timedelta
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseForbidden
from django.shortcuts impor... | bsd-3-clause |
18098924759/Wox | PythonHome/Lib/site-packages/pip/_vendor/distlib/database.py | 360 | 49138 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | mit |
rdobson94/python_koans | python2/koans/about_proxy_object_project.py | 78 | 4194 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: Create a Proxy Class
#
# In this assignment, create a proxy class (one is started for you
# below). You should be able to initialize the proxy object with any
# object. Any attributes called on the proxy object should be forwarded
# to the target object. As e... | mit |
khs26/pele | playground/possibly_obsolete/coldfusioncheck.py | 6 | 1616 | from potential import potential
__all__ = ["ColdFusionCheck", "addColdFusionCheck"]
class ColdFusionCheck(potential):
"""fixes for potentials that have cold fusion
some potentials experience cold fusion, is our term for when the energy
becomes un-physically small. This is usually when two atoms sit ... | gpl-3.0 |
OMAP4-AOSP/android_kernel_bn_omap | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_4/django/conf/locale/en_GB/formats.py | 99 | 2044 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oct 2006'
TIME_FORMAT = 'P' ... | mit |
eXistenZNL/SickRage | sickbeard/metadata/__init__.py | 24 | 1685 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | gpl-3.0 |
tensorflow/federated | tensorflow_federated/python/core/impl/executors/executor_base.py | 1 | 4287 | # Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
jpalladino84/roguelike-game | data/python_templates/characters.py | 2 | 2231 | from characters.character import Character
from components.display import Display
from components.stats import make_character_stats
from components.outfitter import Outfitter
from data.python_templates.classes import thief_class, warrior_class
from data.python_templates.races import human_race, orc_race, troll_race
fro... | mit |
meta-it/misc-addons | autostaging_project_task/models.py | 1 | 1035 | # -*- coding: utf-8 -*-
from openerp import models, fields
class ProjectProjectAutostaging(models.Model):
_name = 'project.project'
_inherit = ['project.project', 'autostaging.folder']
class ProjectTaskTypeAutostaging(models.Model):
_name = 'project.task.type'
_inherit = ['project.task.type', 'auto... | lgpl-3.0 |
golismero/golismero-devel | thirdparty_libs/django/template/loader_tags.py | 111 | 10172 | from django.conf import settings
from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\
token_kwargs, Variable
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from django.utils import six
register = Library()
BLOCK_CONTEXT_KEY = 'block_context... | gpl-2.0 |
axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/encodings/iso2022_jp_ext.py | 816 | 1069 | #
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incr... | apache-2.0 |
gbenson/i8c | setup.py | 1 | 3333 | # -*- coding: utf-8 -*-
# Copyright (C) 2015-16 Red Hat, Inc.
# This file is part of the Infinity Note Compiler.
#
# The Infinity Note Compiler 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 ... | lgpl-2.1 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.2/Lib/anydbm.py | 9 | 2697 | """Generic interface to all dbm clones.
Instead of
import dbm
d = dbm.open(file, 'w', 0666)
use
import anydbm
d = anydbm.open(file, 'w')
The returned object is a dbhash, gdbm, dbm or dumbdbm object,
dependent on the type of database being opened (determined by whichdb
module) in the... | mit |
vinayan3/clpricehistory | django/contrib/localflavor/in_/forms.py | 309 | 1741 | """
India-specific Form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import gettext
import re
class INZipCodeField(RegexFiel... | bsd-3-clause |
alphagov/stagecraft | stagecraft/settings/development.py | 1 | 6138 | """
Django settings for stagecraft project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
from .common import *
# Quick-start development settings - ... | mit |
jbenden/ansible | lib/ansible/modules/monitoring/sensu_handler.py | 1 | 9583 | #!/usr/bin/python
# (c) 2017, 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.0',
'status': ['preview'],
'supported_b... | gpl-3.0 |
adukic/nd101 | tf-stanford-tutorials/assignments/style_transfer/style_transfer.py | 1 | 7313 | """ An implementation of the paper "A Neural Algorithm of Artistic Style"
by Gatys et al. in TensorFlow.
Author: Chip Huyen (huyenn@stanford.edu)
Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research"
For more details, please read the assignment handout:
http://web.stanford.edu/class/cs20si/assignment... | mit |
espadrine/opera | chromium/src/chrome/test/chromedriver/embed_extension_in_cpp.py | 158 | 1124 | #!/usr/bin/env python
# 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.
"""Embeds Chrome user data files in C++ code."""
import base64
import optparse
import os
import StringIO
import sys
import zipfile
im... | bsd-3-clause |
bpsinc-native/src_third_party_chromite | scripts/cros_deps_diff.py | 2 | 5723 | # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates dependency graph diffs.
As an input it takes 2 or more dependency graphs output from cros_extract_deps
and it finds all divergent packag... | bsd-3-clause |
nanjj/softlayer-python | SoftLayer/CLI/loadbal/service_edit.py | 5 | 1838 | """Edit the properties of a service group."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import loadbal
@click.command()
@click.argument('identifier')
@click.option('--enabled / --disabled... | mit |
famorted/scrapy | scrapy/core/spidermw.py | 80 | 3374 | """
Spider Middleware manager
See documentation in docs/topics/spider-middleware.rst
"""
import six
from twisted.python.failure import Failure
from scrapy.middleware import MiddlewareManager
from scrapy.utils.defer import mustbe_deferred
from scrapy.utils.conf import build_component_list
def _isiterable(possible_iter... | bsd-3-clause |
d-cooper/I-Simpa | currentRelease/SystemScript/graphy/pie_chart.py | 233 | 6204 | #!/usr/bin/python2.4
#
# Copyright 2008 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 o... | gpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Tools/scripts/which.py | 64 | 1633 | #! /usr/bin/env python3
# Variant of "which".
# On stderr, near and total misses are reported.
# '-l<flags>' argument adds ls -l<flags> of each file found.
import sys
if sys.path[0] in (".", ""): del sys.path[0]
import sys, os
from stat import *
def msg(str):
sys.stderr.write(str + '\n')
def main():
pathli... | gpl-3.0 |
nistormihai/superdesk-core | apps/content_filters/filter_condition/filter_condition_value.py | 7 | 2655 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import re
fro... | agpl-3.0 |
Jaccorot/python | robot527/0008/find_text.py | 40 | 1416 | #! usr/bin/python3
"""
第 0008 题:一个HTML文件,找出里面的正文。
"""
import re, urllib.request, time
url = input('Enter the URL which you wish to extract > ')
if '' == url:
url = "https://adblockplus.org/zh_CN/acceptable-ads"
print('We will extract text data from ' + url + ' :')
with urllib.request.urlopen(url) as response:
... | mit |
SuLab/biothings.api | biothings/www/api/es/handlers/base_handler.py | 1 | 6274 | from biothings.www.api.helper import BaseHandler
from biothings.utils.common import dotdict, is_str
import re
import logging
class BaseESRequestHandler(BaseHandler):
''' Parent class of all Elasticsearch-based Request handlers, subclass of `BaseHandler`_.
Contains handling for Elasticsearch-specific query par... | apache-2.0 |
pspacek/ansible-modules-extras | source_control/bzr.py | 38 | 6431 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, André Paramés <git@andreparames.com>
# Based on the Git module by 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 a... | gpl-3.0 |
numenta/nupic | src/nupic/frameworks/opf/model.py | 5 | 16243 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
jlec/coot | rcrane/coot_utils_adapter.py | 2 | 1561 | #!/usr/bin/env python
"""Allows functions from coot_utils to be imported"""
# Copyright 2011, 2012 Kevin Keating
#
# Licensed under the Educational Community 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://w... | gpl-3.0 |
hwangsyin/cbrc-devteam-blog | lib/tornado/web.py | 14 | 102525 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | apache-2.0 |
bobdenotter/bolt-preso | vendor/justinrainbow/json-schema/docs/conf.py | 74 | 7837 | # -*- coding: utf-8 -*-
#
# JsonSchema documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 10 15:34:44 2011.
#
# 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.
#
# ... | mit |
nimzco/Environment | Sublime/Packages/pygments/all/pygments/lexers/rust.py | 22 | 7213 | # -*- coding: utf-8 -*-
"""
pygments.lexers.rust
~~~~~~~~~~~~~~~~~~~~
Lexers for the Rust language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, words, default
from pygments... | mit |
VectorBlox/PYNQ | scripts/linux/stop_pl_server.py | 2 | 1999 | # Copyright (c) 2016, Xilinx, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | bsd-3-clause |
Ichag/odoo | addons/website_twitter/controllers/main.py | 355 | 1936 | from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.tools.translate import _
import json
class Twitter(http.Controller):
@http.route(['/twitter_reload'], type='json', auth="user", website=True)
def twitter_reload(self):
return request.website.fetch_favorite_twe... | agpl-3.0 |
arthurprs/aerospike-client-python | test/test_admin_set_password.py | 2 | 3687 | # -*- coding: utf-8 -*-
import pytest
import sys
import time
from test_base_class import TestBaseClass
aerospike = pytest.importorskip("aerospike")
try:
from aerospike.exception import *
except:
print "Please install aerospike python client."
sys.exit(1)
class TestSetPassword(TestBaseClass):
pytestm... | apache-2.0 |
marchon/poker | poker/website/pocketfives.py | 2 | 1402 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, division, print_function
from collections import namedtuple
import requests
from lxml import etree
from .._common import _make_float
__all__ = ['get_ranked_players', 'WEBSITE_URL', 'RANKINGS_URL']
WEBSITE_URL = 'http://www.pocketfive... | mit |
sebmarchand/syzygy | third_party/numpy/files/numpy/doc/ufuncs.py | 94 | 5362 | """
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) a... | apache-2.0 |
jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/mutex.py | 243 | 1877 | """Mutual exclusion -- for use with module sched
A mutex has two pieces of state -- a 'locked' bit and a queue.
When the mutex is not locked, the queue is empty.
Otherwise, the queue contains 0 or more (function, argument) pairs
representing functions (or methods) waiting to acquire the lock.
When the mutex is unlocke... | mit |
kater169/libcloud | libcloud/test/common/test_gandi.py | 66 | 1293 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
shootstar/novatest | nova/api/manager.py | 27 | 1428 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/matplotlib/tests/test_backend_pgf.py | 7 | 6033 | # -*- encoding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import os
import shutil
import numpy as np
import nose
from nose.plugins.skip import SkipTest
import matplotlib as mpl
import matplotlib.pyplot ... | mit |
matthiasdiener/spack | var/spack/repos/builtin/packages/r-sfsmisc/package.py | 3 | 1716 | ##############################################################################
# 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 |
brokenjacobs/ansible | lib/ansible/utils/module_docs_fragments/ovirt_facts.py | 87 | 3156 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | gpl-3.0 |
ianyh/heroku-buildpack-python-opencv | vendor/.heroku/lib/python2.7/encodings/mac_iceland.py | 593 | 13754 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.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,input... | mit |
MozillaSecurity/FuzzManager | server/ec2spotmanager/CloudProvider/EC2SpotCloudProvider.py | 1 | 13089 | import datetime
import logging
import re
import botocore
import boto3
import boto.ec2
import boto.exception
from django.utils import timezone
from django.conf import settings
from laniakea.core.providers.ec2 import EC2Manager
from .CloudProvider import (CloudProvider, CloudProviderTemporaryFailure, CloudProviderInstanc... | mpl-2.0 |
abulbakha/sed | website/view/notification.py | 1 | 1423 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.forms.models import ModelForm
from django.http import HttpResponseRedirect
from django.views.generic import ListView,CreateView,UpdateView,DeleteView
# model
from website.mo... | apache-2.0 |
IronCountySchoolDistrict/powerschool_apps | config/settings/common.py | 1 | 9336 | # -*- coding: utf-8 -*-
"""
Django settings for powerschool_apps project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, un... | mit |
lrr-tum/mmbwmon | vendor/fast-lib/vendor/mosquitto-1.4.12/test/broker/03-publish-b2c-disconnect-qos2.py | 10 | 2645 | #!/usr/bin/env python
import subprocess
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if cmd_subfolder not in sys.path:
... | gpl-3.0 |
cgdeboer/django-fixture-magic | fixture_magic/management/commands/merge_fixtures.py | 2 | 1077 | try:
import json
except ImportError:
from django.utils import simplejson as json
from django.core.management.base import BaseCommand
def write_json(output):
try:
# check our json import supports sorting keys
json.dumps([1], sort_keys=True)
except TypeError:
print json.dumps(out... | bsd-3-clause |
codecov/tornado | demos/appengine/blog.py | 114 | 5385 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | apache-2.0 |
tinysun212/swift-windows | utils/sil-opt-verify-all-modules.py | 65 | 5971 | #!/usr/bin/env python
# utils/sil-opt-verify-all-modules.py - Verifies Swift modules -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https:/... | apache-2.0 |
hes19073/hesweewx | bin/weewx/defaults.py | 1 | 8859 | # coding: utf-8
#
# Copyright (c) 2019-2020 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your rights.
#
"""Backstop defaults used in the absence of any other values."""
from __future__ import absolute_import
import weeutil.config
DEFAULT_STR = """# Copyright (c) 2009-2020 Tom Keffer <tkeffer... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/tests/csrf_tests/views.py | 5 | 1301 | from __future__ import unicode_literals
from django.http import HttpResponse
from django.middleware.csrf import get_token
from django.template import Context, RequestContext, Template
from django.template.context_processors import csrf
from django.views.decorators.csrf import ensure_csrf_cookie
def post_form_view(re... | apache-2.0 |
openstack/surveil | surveil/api/handlers/config/servicegroup_handler.py | 1 | 1160 | # Copyright 2014 - Savoir-Faire Linux 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 ... | apache-2.0 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_closed/train_imagenet.py | 1 | 7895 | # 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 |
hxfxjun/googletest | test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
wkschwartz/django | tests/template_tests/test_nodelist.py | 10 | 3268 | from django.template import Context, Engine
from django.template.base import TextNode, VariableNode
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango40Warning
class NodelistTest(SimpleTestCase):
@classmethod
def setUpClass(cls):
cls.engine = ... | bsd-3-clause |
titansgroup/python-phonenumbers | python/phonenumbers/data/region_BZ.py | 1 | 1774 | """Auto-generated file, do not edit by hand. BZ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BZ = PhoneMetadata(id='BZ', country_code=501, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-8]\\d{6}|0\\d{10}', possible_number_p... | apache-2.0 |
oaastest/azure-linux-extensions | CustomScript/azure/storage/tableservice.py | 52 | 20791 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
igel-kun/pyload | module/plugins/crypter/XFileSharingFolder.py | 1 | 2132 | # -*- coding: utf-8 -*-
import re
from ..internal.XFSCrypter import XFSCrypter
class XFileSharingFolder(XFSCrypter):
__name__ = "XFileSharingFolder"
__type__ = "crypter"
__version__ = "0.26"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
__config__ = [("activated", "bool", "Activated... | gpl-3.0 |
thunderhoser/GewitterGefahr | gewittergefahr/scripts/add_buffers_to_storms.py | 1 | 6187 | """Creates one or more distance buffers around each storm object (polygon)."""
import argparse
import numpy
from gewittergefahr.gg_io import storm_tracking_io as tracking_io
from gewittergefahr.gg_utils import time_conversion
from gewittergefahr.gg_utils import echo_top_tracking
from gewittergefahr.gg_utils import sto... | mit |
sandeepsingh3/reveal_experimentation | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input.py | 713 | 115880 | # 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 compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
aquametalabs/aquameta | experimental/uwsgi-endpoint/endpoint/db.py | 1 | 1470 | from contextlib import contextmanager
from os import environ
from psycopg2 import connect as pg_connect, DataError, IntegrityError, OperationalError, ProgrammingError, InternalError
from psycopg2.extras import register_composite, NamedTupleCursor
from werkzeug.exceptions import BadRequest, Forbidden, NotFound, Unauthor... | gpl-3.0 |
mancoast/CPythonPyc_test | fail/334_test_dis.py | 3 | 12627 | # Minimal tests for dis module
from test.support import run_unittest, captured_stdout
import difflib
import unittest
import sys
import dis
import io
import re
class _C:
def __init__(self, x):
self.x = x == 1
dis_c_instance_method = """\
%-4d 0 LOAD_FAST 1 (x)
3 LOAD_... | gpl-3.0 |
mikedchavez1010/XX-Net | python27/1.0/lib/noarch/dnslib/lex.py | 7 | 10282 | # -*- coding: utf-8 -*-
from __future__ import print_function
import collections,string
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class Lexer(object):
"""
Simple Lexer base class. Provides basic lexer framework and
helper functionality (read/peek/pus... | bsd-2-clause |
mattcaldwell/djangopypi | userpypi/forms.py | 1 | 14382 | from os.path import basename
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.forms.models import inlineformset_factory
from userpypi.settings import ALLOW_VERSION_OVERWRITE, METADATA_FIELDS
from userpypi.models import (Package, Classifier, ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.