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 |
|---|---|---|---|---|---|
freedesktop-unofficial-mirror/gstreamer__sdk__cerbero | cerbero/ide/xcode/fwlib.py | 13 | 8433 | #!/usr/bin/env python
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free So... | lgpl-2.1 |
robertostling/hnmt | hnmt/bleu.py | 1 | 3963 | #!/usr/bin/env python3
"""calculate BLEU scores
script taken from https://github.com/vikasnar/Bleu
and adjusted by Jörg Tiedemann
"""
import sys
import codecs
import os
import math
import operator
import json
import functools
def fetch_data(cand, ref):
""" Store each reference and candidate sentences as a lis... | gpl-3.0 |
philsch/ansible | lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py | 11 | 10209 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 So... | gpl-3.0 |
GeyerA/android_external_chromium_org | tools/gdb/gdb_chrome.py | 30 | 10090 | # Copyright (c) 2011 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.
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(0, "/path/to/tools... | bsd-3-clause |
bplancher/odoo | addons/l10n_be_invoice_bba/invoice.py | 8 | 11056 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
import re, time, random
from openerp import api
from openerp.osv import fields, osv
from openerp.tools.translate import _
import logging
... | agpl-3.0 |
laurentgo/pants | src/python/pants/backend/jvm/repository.py | 17 | 1337 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
class Re... | apache-2.0 |
tanium/pytan | BUILD/doc/source/examples/ask_saved_question_by_name_sse_code.py | 1 | 3070 | # import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... | mit |
Wojtechnology/Muzit | StreetMuse/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | apache-2.0 |
erjohnso/ansible | lib/ansible/modules/network/junos/junos_config.py | 8 | 13496 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by 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',
... | gpl-3.0 |
vilorious/pyload | module/network/Browser.py | 40 | 4190 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from logging import getLogger
from HTTPRequest import HTTPRequest
from HTTPDownload import HTTPDownload
class Browser(object):
__slots__ = ("log", "options", "bucket", "cj", "_size", "http", "dl")
def __init__(self, bucket=None, options={}):
self.log = ... | gpl-3.0 |
gregdek/ansible | lib/ansible/modules/network/aci/aci_contract.py | 12 | 8772 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'],
... | gpl-3.0 |
atsaki/libcloud | example_loadbalancer.py | 58 | 2483 | #!/usr/bin/env python
# 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 "Licen... | apache-2.0 |
raskul/CROWN | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
joerg84/arangodb | 3rdParty/V8/v5.7.0.0/tools/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | apache-2.0 |
varunarya10/basicdb | basicdb/utils.py | 3 | 4735 | import re
BATCH_QUERY_REGEX = re.compile(r'Item\.(\d+)\.(.*)')
PUT_ATTRIBUTE_QUERY_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value|Replace)')
DELETE_QUERY_ARG_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value)')
EXPECTED_QUERY_ARG_REGEX = re.compile(r'Expected\.(\d+)\.(Name|Value|Exists)')
def extract_numbered_ar... | apache-2.0 |
mfherbst/spack | var/spack/repos/builtin/packages/pigz/package.py | 4 | 1886 | ##############################################################################
# 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 |
liberatorqjw/scikit-learn | sklearn/tests/test_multiclass.py | 8 | 21910 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing ... | bsd-3-clause |
HackLinux/python-adb | adb_test.py | 3 | 6340 | # 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 a... | apache-2.0 |
MissCatLady/AlarmEZ | ENV/lib/python2.7/site-packages/pip/vendor/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | mit |
304471720/mongrel2 | examples/ws/python/echo.py | 55 | 3488 | import simplejson as json
from mongrel2 import handler
import wsutil
import sys
import time
import re
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9990",
"tcp://127.0.0.1:9989")
CONNECTION_TIMEOUT=5
closingMessages={}
badUnicode=... | bsd-3-clause |
kapilrastogi/Impala | tests/common/impala_cluster.py | 1 | 8569 | # Copyright (c) 2012 Cloudera, 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 o... | apache-2.0 |
z01nl1o02/tests | cnn_layer_size/show_conv_dim.py | 1 | 1705 | import os,sys,pdb
import argparse
ap = argparse.ArgumentParser()
ap.add_argument('--height','-H',help='input height',type=int)
ap.add_argument('--width','-W',help='input width',type=int)
ap.add_argument('--layers','-F',help='layer info txt with each line for one layer')
ap.add_argument('--deconv','-D',help='0 for con... | gpl-2.0 |
cretingame/Yarr-fw | script/debug.py | 1 | 5687 | import os
import subprocess
script_path = os.getcwd() + "/" + os.path.splitext(__file__)[0] + ".tcl"
script_file = open(script_path, "w+")
os.chdir("..")
project_path = os.getcwd()
script_file.write(
"######################################################\n" +
"# Generated file to open the virtual logic analyyer\... | gpl-3.0 |
Gloomymoon/SecKill | manage.py | 1 | 1215 | #!/usr/bin/env python
# -*- coding: UTF-8 -*
import os
from app import create_app, db
from app.models import User, Role, Permission, Coupon, SecKill, Datemark
from flask_script import Manager, Shell
from flask_migrate import Migrate, MigrateCommand
app = create_app(os.getenv('ATH_CONFIG') or 'default')
manager = Manag... | gpl-3.0 |
xzturn/tensorflow | tensorflow/python/compiler/tensorrt/test/biasadd_matmul_test.py | 3 | 4713 | # 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... | apache-2.0 |
beeftornado/sentry | src/sentry/api/endpoints/project_key_stats.py | 3 | 2056 | from __future__ import absolute_import
import six
from collections import OrderedDict
from django.db.models import F
from rest_framework.response import Response
from sentry import tsdb
from sentry.api.base import StatsMixin
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import Resou... | bsd-3-clause |
javachengwc/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/shared/password_hasher.py | 118 | 1850 | # file openpyxl/shared/password_hasher.py
# Copyright (c) 2010 openpyxl
#
# 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 us... | apache-2.0 |
denisff/python-for-android | python-modules/twisted/twisted/conch/test/test_openssh_compat.py | 60 | 3381 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.openssh_compat}.
"""
import os
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from twisted.python.compat import set
try:
import Crypto.Cipher.DES3
import ... | apache-2.0 |
skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/python/release.py | 52 | 1107 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A release-automation toolkit.
Don't use this outside of Twisted.
Maintainer: Christopher Armstrong
"""
import os
# errors
class DirectoryExists(OSError):
"""
Some directory exists when it shouldn't.
"""
pass
class Dire... | gpl-2.0 |
leekchan/django_test | django/contrib/admindocs/utils.py | 23 | 4114 | "Misc. utility functions/classes for admin documentation generator."
import re
from email.parser import HeaderParser
from email.errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.utils.encoding import force_bytes
try:
import docuti... | bsd-3-clause |
Rundll/django-mailer-2 | django_mailer/lockfile.py | 179 | 15120 |
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = FileLock('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'somefile', 'is locked alread... | mit |
beebotte/ISS-realtime-position | iss_position_pub.py | 1 | 3041 | #!/usr/bin/python
# coding: utf8
############################################################
# Author Bachar Wehbi <me@bachwehbi.net>
# Copyright (c) 2013-2014 Beebotte <contact@beebotte.com>
# This program is published under the MIT License
# Check http://opensource.org/licenses/MIT for details.
#
# This code uses... | mit |
ansible/ansible-modules-core | network/netvisor/pn_vlan.py | 29 | 8941 | #!/usr/bin/python
""" PN CLI vlan-create/vlan-delete """
#
# 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... | gpl-3.0 |
antoan2/incubator-mxnet | python/mxnet/module/sequential_module.py | 38 | 17331 | # 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 |
yeming233/rally | tests/unit/plugins/openstack/scenarios/ceilometer/test_stats.py | 2 | 1757 | # 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 agreed to in... | apache-2.0 |
stevenbaker/dotfiles | .vim/bundle/jedi-vim/jedi/test/completion/descriptors.py | 14 | 2662 | class RevealAccess(object):
"""
A data descriptor that sets and returns values
normally and prints a message logging their access.
"""
def __init__(self, initval=None, name='var'):
self.val = initval
self.name = name
def __get__(self, obj, objtype):
print('Retrieving', s... | mit |
Nofe92/srcdemo2 | launcher/SrcDemo2Launcher.py | 8 | 10302 | import sys
import os
import re
import time
import base64
import tempfile
import subprocess
import threading
if __name__ == '__main__':
print 'Please do not launch this file directly.'
sys.exit(0)
def module_path():
if hasattr(sys, "frozen"):
return os.path.dirname(sys.executable)
return os.path.dirname(__file__... | bsd-2-clause |
stackforge/cloudbase-init | cloudbaseinit/tests/metadata/services/test_maasservice.py | 1 | 17075 | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 |
sysalexis/kbengine | kbe/res/scripts/common/Lib/traceback.py | 87 | 11167 | """Extract, format and print information about Python stack traces."""
import linecache
import sys
import operator
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
'format_tb', 'print_exc', 'format_exc', 'print_exception',
... | lgpl-3.0 |
magnatronus/titanium-sac | lib/tiutils.py | 1 | 2781 | #
# tiutils.py is a Titanium function library for use with the SpiralArm Titanium plug-in for Sublime Text 3
#
# developed by Steve Rogers, SpiralArm Consulting Ltd (www.spiralarm.uk)
# @sarmcon
#
#
import sublime, subprocess,os
from os.path import expanduser
# read in our default Titanium settings
settings = subl... | mit |
r0h4n/commons | tendrl/commons/flows/expand_cluster/gluster_help.py | 2 | 1884 | from tendrl.commons.flows.exceptions import FlowExecutionFailedError
from tendrl.commons.utils import log_utils as logger
def get_node_ips(parameters):
node_ips = []
for node, config in parameters["Cluster.node_configuration"].iteritems():
node_ips.append(config["provisioning_ip"])
return node_ips... | lgpl-2.1 |
Tiendil/deworld | deworld/cartographer.py | 1 | 4067 | # coding: utf-8
import os
try:
from PIL import Image
except:
pass
from deworld.map_colors import HeightColorMap, RGBColorMap
from deworld.layers import VEGETATION_TYPE
def draw_image(turn, catalog, layer, power_points, colorizer):
if not os.path.exists(catalog):
os.makedirs(catalog)
img = ... | bsd-2-clause |
pfeyz/psiTurk | psiturk/command_line.py | 6 | 3137 | ''' This module supports commandline functionality '''
import argparse
import sys, os
from psiturk.version import version_number
from psiturk.psiturk_org_services import ExperimentExchangeServices
def process():
''' Figure out how we were invoked '''
invoked_as = os.path.basename(sys.argv[0])
if invoked... | mit |
llvm/llvm-lnt | lnt/util/wsgi_restart.py | 1 | 3202 | # This code lifted from the mod_wsgi docs.
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
import os
from pathlib import Path
from typing import Sequence
import sys
import signal
import threading
import atexit
import queue
_interval = 1.0
_times = {}
_files ... | apache-2.0 |
zhangyage/Python-oldboy | day07/paramiko-1.15.2/paramiko-1.15.2/paramiko/pipe.py | 44 | 4005 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | apache-2.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/win32/Demos/mmapfile_demo.py | 4 | 2822 | import win32api, mmapfile
import winerror
import tempfile, os
from pywin32_testutil import str2bytes
system_info=win32api.GetSystemInfo()
page_size=system_info[1]
alloc_size=system_info[7]
fname=tempfile.mktemp()
mapping_name=os.path.split(fname)[1]
fsize=8*page_size
print fname, fsize, mapping_name
m1... | agpl-3.0 |
pdellaert/ansible | lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint_info.py | 19 | 10046 | #!/usr/bin/python
#
# Copyright (c) 2019 Hai Cao, <t-haicao@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
galaxy001/libtorrent | python_BTL_BitTorrent-5.3-GPL/BTL/twisted_brpc.py | 5 | 24332 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | mit |
jhayworth/config | .emacs.d/elpy/rpc-venv/lib/python2.7/distutils/__init__.py | 5 | 4374 | import os
import sys
import warnings
# opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
import opcode
dirname = os.path.dirname
distutils_path = os.path.join(os.path.dirname(opcode.__fi... | gpl-3.0 |
hoeck/webkitwindow | webkitwindow.py | 1 | 27686 | import sys
import os
import Queue
import StringIO
import urlparse
import mimetypes
import pkgutil
import itertools
try:
from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork
except ImportError:
from PySide import QtCore, QtGui, QtWebKit, QtNetwork
HTTP_STATUS = {
200: 'OK',
301: 'Moved Permanently',
... | bsd-3-clause |
sivas2811/mocha_739 | hotdot_env/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha512.py | 77 | 14505 | """
This code was Ported from CPython's sha512module.c
"""
import struct
SHA_BLOCKSIZE = 128
SHA_DIGESTSIZE = 64
def new_shaobject():
return {
'digest': [0]*8,
'count_lo': 0,
'count_hi': 0,
'data': [0]* SHA_BLOCKSIZE,
'local': 0,
'digestsize': 0
}
ROR64 = lam... | unlicense |
moreati/ppeg | setup.py | 1 | 1037 | #!/usr/bin/env python
import io
import os
from setuptools import setup, Extension
def read(fname, encoding='utf-8'):
here = os.path.dirname(__file__)
with io.open(os.path.join(here, fname), encoding=encoding) as f:
return f.read()
setup (
name='PPeg',
version='0.9.4',
description="A Py... | mit |
tomSny/XStarLogViewer | LogAnalyzer/py2exe/LogAnalyzer.py | 3 | 12537 | #!/usr/bin/env python
#
# A module to analyze and identify any common problems which can be determined from log files
#
# Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014
#
# some logging oddities noticed while doing this, to be followed up on:
# - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain
# ... | gpl-3.0 |
ubic135/odoo-design | addons/crm_partner_assign/__openerp__.py | 114 | 2453 | # -*- 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 |
jviada/QuantEcon.py | quantecon/tests/test_lqcontrol.py | 7 | 2299 | """
Author: Chase Coleman
Filename: test_lqcontrol
Tests for lqcontrol.py file
"""
import sys
import os
import unittest
import numpy as np
from scipy.linalg import LinAlgError
from numpy.testing import assert_allclose
from quantecon.lqcontrol import LQ
class TestLQControl(unittest.TestCase):
def setUp(self):
... | bsd-3-clause |
4dn-dcic/fourfront | src/encoded/upgrade/file.py | 2 | 2394 | from snovault import (
upgrade_step,
)
@upgrade_step('file_fastq', '1', '2')
@upgrade_step('file_calibration', '1', '2')
@upgrade_step('file_microscopy', '1', '2')
@upgrade_step('file_processed', '1', '2')
@upgrade_step('file_reference', '1', '2')
def file_1_2(value, system):
file_format = value.get('file_for... | mit |
terrencepreilly/darglint | darglint/parse/grammars/sphinx_variables_section.py | 1 | 10525 | # Generated on 2020-07-25 08:37:49.972660
from darglint.parse.grammar import (
BaseGrammar,
P,
)
from darglint.errors import (
IndentError,
)
from darglint.token import (
TokenType,
)
from darglint.parse.identifiers import (
NoqaIdentifier,
)
from darglint.errors import (
EmptyDescriptionEr... | mit |
ContextLogic/luigi | test/contrib/bigquery_test.py | 5 | 6811 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Twitter 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 ... | apache-2.0 |
aricchen/openHR | openerp/addons/portal_project/tests/__init__.py | 170 | 1124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY 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 |
public-ink/public-ink | server/appengine/lib/numpy/core/tests/test_function_base.py | 16 | 11429 | from __future__ import division, absolute_import, print_function
from numpy import (logspace, linspace, geomspace, dtype, array, sctypes,
arange, isnan, ndarray, sqrt, nextafter)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert_array_equal,... | gpl-3.0 |
ismael-liceras/php-invaders | gameengine.py | 1 | 12699 | import pygame
from pygame.locals import *
from player import Player
from stagegenerator import StageGenerator
from gamestatus import GameStatus
from gameconfig import GameConfig
class GameEngine():
def __init__(self, modes=None):
pygame.init()
self.screen = pygame.display.set_mode((800, 600))
... | mit |
AutorestCI/azure-sdk-for-python | azure-mgmt-sql/azure/mgmt/sql/models/location_capabilities.py | 2 | 1723 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
nguyentran/openviber | third_party/libjingle/talk/third_party/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | mit |
Forage/Gramps | gramps/plugins/docgen/rtfdoc.py | 1 | 21285 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007-2009 Brian G. Matherly
# Copyright (C) 2009 Gary Burton
# Copyright (C) 2010 Peter Landgren
# Copyright (C) 2011 Adam Stein <adam@csh.rit.edu>
#
# This program is free software; you... | gpl-2.0 |
taedla01/MissionPlanner | Lib/dumbdbm.py | 63 | 9070 | """A dumb and slow but simple dbm clone.
For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).
XXX TO DO:
- seems to contain a bug when updating...
- reclaim free space (currently, sp... | gpl-3.0 |
cmcdowell/weatherpy | weatherpy/wind.py | 1 | 1807 |
class Wind(object):
"""
Current forecast information about the wind.
Attributes:
chill: Wind chill in degrees (integer). If a value for wind chill is not
found, chill will be None.
direction: Wind direction in degrees (integer). If a value for wind
direction is not... | mit |
WURFL/wurfl-cloud-client-python | setup.py | 1 | 1722 | from setuptools import setup
import os.path
__license__ = """
Copyright (c) 2015 ScientiaMobile Inc.
The WURFL Cloud Client is intended to be used in both open-source and
commercial environments. To allow its use in as many situations as possible,
the WURFL Cloud Client is dual-licensed. You may choose to use th... | gpl-2.0 |
40223123/finaltest2 | static/Brython3.1.3-20150514-095342/Lib/zipfile.py | 620 | 66368 | """
Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
import io
import os
import re
import imp
import sys
import time
import stat
import shutil
import struct
import binascii
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib =... | gpl-3.0 |
richardnpaul/FWL-Website | lib/python2.7/site-packages/django/contrib/sitemaps/tests/urls/http.py | 97 | 1691 | from datetime import datetime
from django.conf.urls import patterns, url
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views
from django.contrib.auth.models import User
from django.views.decorators.cache import cache_page
from django.contrib.sitemaps.tests.base import TestModel
class ... | gpl-3.0 |
dstftw/youtube-dl | youtube_dl/extractor/imgur.py | 20 | 5082 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
mimetype2ext,
ExtractorError,
)
class ImgurIE(InfoExtractor):
_VALID_URL = r'https?://(?:i\.)?imgur\.com/(?!(?:a|gallery|(?:t(?:opic)?|r)/[^/]+)/)(?P<id>[a-zA-Z0-9]+... | unlicense |
franky88/emperioanimesta | env/Lib/site-packages/wheel/egg2wheel.py | 471 | 2633 | #!/usr/bin/env python
import os.path
import re
import sys
import tempfile
import zipfile
import wheel.bdist_wheel
import shutil
import distutils.dist
from distutils.archive_util import make_archive
from argparse import ArgumentParser
from glob import iglob
egg_info_re = re.compile(r'''(?P<name>.+?)-(?P<ver>.+?)
(-... | gpl-3.0 |
h2oai/h2o-2 | py/testdir_single_jvm/test_parse_small_many_fvec.py | 9 | 1652 | import unittest, re, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i
def writeRows(csvPathname,row,eol,repeat):
f = open(csvPathname, 'w')
for r in range(repeat):
f.write(row + eol)
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sa... | apache-2.0 |
MrLoick/python-for-android | python-modules/twisted/twisted/internet/endpoints.py | 49 | 33917 | # -*- test-case-name: twisted.internet.test.test_endpoints -*-
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that
wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces.
This also implement... | apache-2.0 |
gotcha/Selenium2Library | demo/demoapp/server.py | 48 | 2648 | #!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
jymannob/CouchPotatoServer | couchpotato/core/notifications/notifymywp.py | 25 | 2136 | from couchpotato.core.helpers.variable import splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
from pynmwp import PyNMWP
import six
log = CPLog(__name__)
autoload = 'NotifyMyWP'
class NotifyMyWP(Notification):
def notify(self, message = '', data... | gpl-3.0 |
ampax/edx-platform-backup | common/test/acceptance/pages/lms/edxnotes.py | 19 | 15856 | from bok_choy.page_object import PageObject, PageLoadError, unguarded
from bok_choy.promise import BrokenPromise
from .course_page import CoursePage
from ...tests.helpers import disable_animations
from selenium.webdriver.common.action_chains import ActionChains
class NoteChild(PageObject):
url = None
BODY_SEL... | agpl-3.0 |
redhat-openstack/nova | nova/api/openstack/compute/schemas/v3/flavor_access.py | 110 | 1710 | # Copyright 2013 NEC Corporation. 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 |
ericzhou2008/zulip | api/integrations/perforce/zulip_change-commit.py | 114 | 2744 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2012-2014 Zulip, 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 rig... | apache-2.0 |
redhat-openstack/neutron | neutron/plugins/mlnx/agent/eswitch_neutron_agent.py | 8 | 17266 | # Copyright 2013 Mellanox Technologies, Ltd
#
# 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 t... | apache-2.0 |
boundary/boundary-plugin-aws-redshift | boundary_aws_plugin/boundary_plugin.py | 8 | 4162 | from __future__ import (absolute_import, division, print_function, unicode_literals)
import logging
import datetime
import time
import socket
import json
import multiprocessing
from contextlib import contextmanager
import sys
import os
HOSTNAME = socket.gethostname()
metric_log_file = None
plugin_params = None
keepal... | apache-2.0 |
musicrighter/CIS422-P2 | env/lib/python3.4/site-packages/pymongo/periodic_executor.py | 16 | 4679 | # Copyright 2014-2015 MongoDB, 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 writi... | artistic-2.0 |
nexiles/odoo | addons/l10n_be_coda/wizard/account_coda_import.py | 255 | 24127 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
JioCloud/tempest | tempest/api/network/test_routers_negative.py | 11 | 5926 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
vivsh/django-ginger | ginger/html/forms.py | 1 | 6313 | from ginger.dataset import GingerDataSet
from django.forms.widgets import CheckboxInput
import re
from collections import namedtuple
from django.middleware import csrf
from django.utils import six
from django.utils.encoding import force_text
from ginger import utils
from . import common
__all__ = ["Choice", "Link", ... | mit |
veroc/Bika-LIMS | bika/lims/exportimport/instruments/beckmancoulter/access/model2.py | 3 | 3313 | """ Beckman Coulter Access 2
"""
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from . import BeckmancoulterAccessCSVParser, BeckmancoulterAccessImporter
import json
import traceback
title = "Beckman Coulter Access 2"
def Import(context, request):
""" Beckman Coulter Access 2 analysi... | agpl-3.0 |
uwdata/termite-data-server | web2py/gluon/contrib/login_methods/oneall_account.py | 33 | 4559 | #!/usr/bin/env python
# coding: utf8
"""
Oneall Authentication for web2py
Developed by Nathan Freeze (Copyright © 2013)
Email <nathan@freezable.com>
This file contains code to allow using onall.com
authentication services with web2py
"""
import os
import base64
from gluon import *
from gluon.storage i... | bsd-3-clause |
nathanielvarona/airflow | tests/www/views/conftest.py | 1 | 6162 | #
# 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... | apache-2.0 |
nkrinner/nova | nova/filters.py | 21 | 3305 | # Copyright (c) 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
pygeek/django | django/contrib/sessions/backends/file.py | 4 | 5255 | import errno
import os
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
class SessionStore(SessionBase):
"""
Implements a file based session store.
"""
... | bsd-3-clause |
jesramirez/odoo | openerp/addons/test_limits/models.py | 435 | 1034 | # -*- coding: utf-8 -*-
import time
import openerp
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will consume between 'almost no
resource' and 'a lot of resource'.
"""
_name = 'test.limits.model'
def consume_nothing(self, cr, uid, context=None):
return True... | agpl-3.0 |
Samuc/Proyecto-IV | lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-2.0 |
ujjwal96/mitmproxy | mitmproxy/websocket.py | 3 | 6332 | import time
import queue
from typing import List, Optional
from wsproto.frame_protocol import CloseReason
from wsproto.frame_protocol import Opcode
from mitmproxy import flow
from mitmproxy.net import websockets
from mitmproxy.coretypes import serializable
from mitmproxy.utils import strutils, human
class WebSocket... | mit |
PandaWei/tp-qemu | qemu/tests/win_virtio_serial_data_transfer_reboot.py | 6 | 4731 | import os
import logging
from autotest.client import utils
from autotest.client.shared import error
from virttest import data_dir
from virttest import qemu_virtio_port
# This decorator makes the test function aware of context strings
@error.context_aware
def run(test, params, env):
"""
QEMU 'Windows virtio-... | gpl-2.0 |
sebastic/QGIS | python/plugins/db_manager/db_plugins/postgis/info_model.py | 3 | 11691 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
sensysnetworks/uClinux | user/python/Demo/classes/Range.py | 3 | 1684 | # Example of a generator: re-implement the built-in range function
# without actually constructing the list of values. (It turns out
# that the built-in function is about 20 times faster -- that's why
# it's built-in. :-)
# Wrapper function to emulate the complicated range() arguments
def range(*a):
if len(a) == 1... | gpl-2.0 |
kgraney/msm-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
sammyshj/stem | test/unit/interpreter/arguments.py | 2 | 1729 | import unittest
from stem.interpreter.arguments import DEFAULT_ARGS, parse, get_help
class TestArgumentParsing(unittest.TestCase):
def test_that_we_get_default_values(self):
args = parse([])
for attr in DEFAULT_ARGS:
self.assertEqual(DEFAULT_ARGS[attr], getattr(args, attr))
def test_that_we_load_... | lgpl-3.0 |
geometalab/osmaxx-frontend | tests/conversion/converters/inside_worker_test/nonop_way_test.py | 2 | 7148 | from contextlib import closing
import pytest
import sqlalchemy
from sqlalchemy.sql.schema import Table as DbTable
from osmaxx.utils.frozendict import frozendict
from tests.conftest import TagCombination
from tests.conversion.converters.inside_worker_test.conftest import slow
from tests.conversion.converters.inside_wo... | mit |
mkost/djangocms-googlemap | schemamigration.py | 1 | 1460 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'mptt',
'cms',
'menus',
'djangocms_googlemap',
'south',
]
DATABASES = {
... | bsd-3-clause |
harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/gslib/addlhelp/apis.py | 4 | 2736 | # -*- coding: utf-8 -*-
# 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 require... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.