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 |
|---|---|---|---|---|---|
felipenaselva/repo.felipe | plugin.video.igorlista/mechanize/_auth.py | 137 | 2576 | """HTTP Authentication and Proxy support.
Copyright 2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distribution).
"""
from _urllib2_fork import HTTPPasswordMgr
# TODO:... | gpl-2.0 |
WimPessemier/uaf | examples/pyuaf/client/how_to_monitor_data_changes.py | 2 | 4473 | # examples/pyuaf/client/how_to_monitor_data_changes.py
# Start the demo server ($SDK/bin/uaservercpp) of Unified Automation before running this script!
import time
import pyuaf
from pyuaf.util import Address, NodeId, DataChangeFilter
from pyuaf.client import Client
from pyuaf.client.settings imp... | lgpl-3.0 |
SlimRoms/android_external_chromium_org | tools/tcmalloc/print-live-objects.py | 170 | 2541 | #!/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.
"""Symbolizes and prints live objects as recorded by tcmalloc's
HeapProfilerDumpLiveObjects.
"""
import os
import re
import subpro... | bsd-3-clause |
shengcanxu/CCrawler | source/projects/biquge/biquge/spiders/Chapter.py | 1 | 1744 |
from scrapy.spiders import Spider
from helper.textUtil import removeTagsAndWhiteSpaces
from projects.biquge.biquge.items import ChapterItem
from pymongo.mongo_client import MongoClient
class XiaoShuoList(Spider):
name = "Chapter"
allowed_domains = ["biquge.la"]
#mongo settings
database = "biquge"
... | apache-2.0 |
pilou-/ansible | lib/ansible/modules/cloud/cloudstack/cs_network_acl_rule.py | 18 | 14256 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'c... | gpl-3.0 |
pilou-/ansible | test/units/template/test_templar.py | 29 | 17373 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
netsamir/dotfiles | files/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_compat.py | 179 | 4645 | from keyword import iskeyword as _iskeyword
from operator import itemgetter as _itemgetter
import sys as _sys
def namedtuple(typename, field_names):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new cla... | unlicense |
DarioI/DroidSec | androguard/core/bytecodes/dvm_permissions.py | 15 | 44502 | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | apache-2.0 |
tunneln/CarnotKE | jyhton/lib-python/2.7/test/test_mailbox.py | 50 | 86537 | import os
import sys
import time
import stat
import socket
import email
import email.message
import re
import shutil
import StringIO
import tempfile
from test import test_support
import unittest
import mailbox
import glob
try:
import fcntl
except ImportError:
pass
# Silence Py3k warning
rfc822 = test_support.i... | apache-2.0 |
joone/chromium-crosswalk | third_party/Python-Markdown/markdown/util.py | 102 | 5641 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import sys
"""
Python 3 Stuff
=============================================================================
"""
PY3 = sys.version_info[0] == 3
if PY3: # pragma: no cover
string_type = str
text_type = str
int2str = chr
else: # pra... | bsd-3-clause |
yesudeep/greatship | app/appengine/gaefy/jinja2/module_loaders.py | 10 | 2269 | # -*- coding: utf-8 -*-
"""
gaefy.jinja2.module_loaders
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Loads a pre-compiled template, stored as Python code in a template module.
This loader requires a modification in Jinja2 code (see jinja2.diff). The
change doesn't affect other loaders, only allows templates to be ... | mit |
kustodian/ansible | lib/ansible/modules/network/fortios/fortios_system_vdom_radius_server.py | 7 | 10139 | #!/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 |
2014c2g3/w16b_test | static/Brython3.1.1-20150328-091302/Lib/unittest/test/support.py | 770 | 3379 | import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... | agpl-3.0 |
mashrin/processing.py | misc/ast/astpp.py | 4 | 2950 | """
A pretty-printing dump function for the ast module. The code was copied from
the ast.dump function and modified slightly to pretty-print.
Alex Leone (acleone ~AT~ gmail.com), 2010-01-30
From http://alexleone.blogspot.co.uk/2010/01/python-ast-pretty-printer.html
"""
from ast import *
def dump(node, annotate_fie... | apache-2.0 |
ujdhesa/unisubs | utils/management/commands/recreate_thumbs.py | 6 | 2134 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your ... | agpl-3.0 |
jw84/django-mailer | 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 |
collex100/odoo | openerp/addons/base/module/module.py | 70 | 37453 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 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 |
m1ssou/zulip | zerver/management/commands/create_user.py | 113 | 3255 | from __future__ import absolute_import
import sys
import argparse
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from django.core import validators
from zerver.models import Realm, email_to_username
from ... | apache-2.0 |
k21/buck | docs/soy2html.py | 24 | 3176 | #!/usr/bin/env python
#
# This script is designed to be invoked by soy2html.sh.
# Usage:
#
# buck/docs$ python soy2html.py <output_dir>
#
# This will write all of the static content to the specified output directory.
# You may want to verify that things worked correctly by running:
#
# python -m SimpleHTTPServer ... | apache-2.0 |
developerQuinnZ/this_will_work | student-work/jeff_beyer/week_1/group_challenge/group_challenge.py | 1 | 2640 | import random
class Person:
def __init__(self, first_name, last_name, email):
self.first_name = first_name
self.last_name = last_name
self.email = email
def ask_a_question(self, question):
print(f'Q: {question}')
class Student(Person):
def __init__(self, first_name, last... | mit |
bencomp/bitcurator | externals/py3fpdf/attic/Gradients.py | 26 | 5526 | from FPDF import *
class Gradients(FPDF):
def __init__(this,orientation='P',unit='mm',format='A4'):
FPDF.__init__(this,orientation,unit,format)
this.gradients={}
def LinearGradient(this,x, y, w, h, col1=[], col2=[], coords=[0.0,0.0,1.0,0.0]):
this.Clip(x,y,w,h)
this.Gradient(2,col1,col2,coords)
def Radial... | gpl-3.0 |
alexcuellar/odoo | addons/l10n_be_hr_payroll_account/__openerp__.py | 298 | 1626 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
3manuek/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 268 | 2723 | """
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | bsd-3-clause |
Djabbz/scikit-learn | sklearn/externals/six.py | 547 | 20588 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
JulienMcJay/eclock | windows/kivy/kivy/input/providers/wm_pen.py | 49 | 5488 | '''
Support for WM_PEN messages (Windows platform)
==============================================
'''
__all__ = ('WM_PenProvider', 'WM_Pen')
import os
from kivy.input.providers.wm_common import (
PEN_OR_TOUCH_SIGNATURE, PEN_OR_TOUCH_MASK, GWL_WNDPROC,
WM_MOUSEMOVE, WM_LBUTTONUP, WM_LBUTTONDOWN,
WM_TABLET_... | gpl-2.0 |
Diacamma2/syndic | diacamma/condominium/views_callfunds.py | 1 | 8614 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.db.models import Q
from lucterios.framework.xferadvance import XferListEditor, TITLE_ADD, TITLE_MODIFY, TITLE_EDIT, TITLE_DELETE, TITLE_PRINT, XferTransition,\
TITLE_CREATE
from luct... | gpl-3.0 |
malmiron/incubator-airflow | tests/contrib/hooks/test_jira_hook.py | 2 | 1829 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
mdn/browsercompat | mdn/models.py | 2 | 16580 | # -*- coding: utf-8 -*-
"""Model definitions for MDN migration app."""
from __future__ import unicode_literals
from collections import OrderedDict, namedtuple
from json import dumps, loads
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.util... | mpl-2.0 |
milinbhakta/flaskmaterialdesign | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-2.0 |
Filmetrics/smartinstr-linux-kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
dayatz/taiga-back | taiga/projects/attachments/migrations/0001_initial.py | 28 | 2130 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import taiga.projects.attachments.models
from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
... | agpl-3.0 |
ClimbsRocks/scikit-learn | examples/linear_model/plot_sgd_iris.py | 58 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
lvieirajr/mongorest | mongorest/resource.py | 1 | 6235 | # -*- encoding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals
import six
from datetime import datetime
from werkzeug.routing import Map, Rule
from .collection import Collection
from .errors import DocumentNotFoundError
from .utils import deserialize, serialize
from .wrappers import Response
from ... | bsd-3-clause |
hbp-unibi/SNABSuite | source/util/autoformat_json.py | 1 | 2679 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# SNABSuite -- Spiking Neural Architecture Benchmark Suite
# Copyright (C) 2019 Christoph Ostrau
#
# 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 Fo... | gpl-3.0 |
AltSchool/django | django/contrib/contenttypes/migrations/0001_initial.py | 585 | 1227 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.contenttypes.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=... | bsd-3-clause |
Ziggeo/ZiggeoPythonSdk | MultiPartForm.py | 1 | 2192 | import codecs
import mimetypes
import sys
import uuid
try:
import io
except ImportError:
pass # io is requiered in python3 but not available in python2
class MultiPartForm(object):
def __init__(self):
self.boundary = uuid.uuid4().hex
self.content_type = 'multipart/form-data; boundary={}'.f... | apache-2.0 |
tersmitten/ansible-modules-core | cloud/amazon/iam.py | 6 | 28838 | #!/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 distributed... | gpl-3.0 |
Anaphory/libpgm | libpgm/dyndiscbayesiannetwork.py | 1 | 9425 | # Copyright (c) 2012, CyberPoint International, LLC
# 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 lis... | bsd-3-clause |
marcellodesales/svnedge-console | ext/linux/pkg-toolkit/pkg/vendor-packages/cherrypy/lib/auth.py | 18 | 2981 | import cherrypy
from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
"""If an authorization header contains credentials, return True, else False."""
if 'authorization' in cherrypy.request.headers:
# make sure the provided credentials are correctly set
ah = httpaut... | agpl-3.0 |
nhenezi/kuma | vendor/packages/sqlalchemy/lib/sqlalchemy/connectors/zxJDBC.py | 18 | 1677 | import sys
from sqlalchemy.connectors import Connector
class ZxJDBCConnector(Connector):
driver = 'zxjdbc'
supports_sane_rowcount = False
supports_sane_multi_rowcount = False
supports_unicode_binds = True
supports_unicode_statements = sys.version > '2.5.0+'
description_encoding = None... | mpl-2.0 |
gregvonkuster/galaxy-csg | tools/icqsol_add_surface_field_from_expression/icqsol_add_surface_field_from_expression.py | 2 | 3070 | #!/usr/bin/env python
import argparse
import shutil
import icqsol_utils
# Parse Command Line.
parser = argparse.ArgumentParser()
parser.add_argument('--input', dest='input', help='Shape dataset selected from history')
parser.add_argument('--input_file_format_and_type', dest='input_file_format_and_type', help='Input f... | mit |
Dhivyap/ansible | lib/ansible/modules/cloud/amazon/aws_ses_rule_set.py | 30 | 8199 | #!/usr/bin/python
# Copyright (c) 2017, Ben Tomasik <ben@tomasik.io>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION =... | gpl-3.0 |
ngonzalvez/sentry | src/sentry/migrations/0132_add_default_orgs.py | 36 | 28101 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models, transaction
class Migration(DataMigration):
def forwards(self, orm):
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
Organization = orm['sentry.Organ... | bsd-3-clause |
SergiuMir/python-phonenumbers | python/phonenumbers/phonenumberutil.py | 7 | 134070 | """Python phone number parsing and formatting library
If you use this library, and want to be notified about important changes,
please sign up to the libphonenumber mailing list at
http://groups.google.com/group/libphonenumber-discuss/about.
NOTE: A lot of methods in this module require Region Code strings. These mus... | apache-2.0 |
pinax/pinax_theme_tester | pinax_theme_tester/configs/notifications.py | 1 | 2360 | import copy
from django.conf.urls import url, include
from django.urls import reverse
from .base import ViewConfig as BaseViewConfig
context = dict(
notice_settings=dict(
column_headers=[
dict(title="Email"),
dict(title="SMS"),
dict(title="On Site")
],
... | mit |
sacharya/nova | nova/tests/integrated/v3/test_server_usage.py | 11 | 1586 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | apache-2.0 |
bnordgren/postgis | raster/scripts/python/rtrowdump.py | 8 | 5443 | #! /usr/bin/env python
#
# $Id$
#
# Brute-force dump of single row from WKT Raster table as GeoTIFF.
# This utility is handy for debugging purposes.
#
# WARNING: Tha main purpose of this program is to test and
# debug WKT Raster implementation. It is NOT supposed to be an
# efficient performance killer, by no means.
#
... | gpl-2.0 |
wpgallih/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/exceptions.py | 263 | 6460 | """Definition of WebDriverException classes."""
def create_webdriver_exception_strict(status_code, message):
"""Create the appropriate WebDriverException given the status_code."""
if status_code in _exceptions_strict:
return _exceptions_strict[status_code](message)
return UnknownStatusCodeException... | mpl-2.0 |
knusbaum/incubator-storm | dev-tools/report/report_builder.py | 28 | 4837 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
Yen-Chung-En/2015cdb_g1_0623-2 | static/Brython3.1.1-20150328-091302/Lib/csv.py | 637 | 16166 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \
... | gpl-3.0 |
FRidh/scipy | tools/validate_runtests_log.py | 1 | 2017 | """
Take the test runner log output from the stdin, looking for
the magic line nose runner prints when the test run was successful.
In an ideal world, this should be done directly in runtests.py using the
nose API, some failure modes are fooling nose to terminate the python process
with zero exit code, see, eg, https... | bsd-3-clause |
rwightman/pytorch-image-models | timm/models/efficientnet_blocks.py | 1 | 12497 | """ EfficientNet, MobileNetV3, etc Blocks
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
import torch.nn as nn
from torch.nn import functional as F
from .layers import create_conv2d, drop_path, make_divisible, create_act_layer
from .layers.activations import sigmoid
__all__ = [
'SqueezeExcit... | apache-2.0 |
IceCubeDev/hackerschool | WebServer/1.0/JUNK/simple/WorkerThread.py | 1 | 4282 | __author__ = 'Ivan Dortulov'
from Connection import Connection
import threading
import errno
import time
import socket
from Log import *
class WorkerThread(threading.Thread):
MAX_CONNECTIONS = 100
def __init__(self, server):
threading.Thread.__init__(self)
self.server = server
self... | gpl-2.0 |
ajose01/rethinkdb | external/v8_3.30.33.16/build/gyp/test/actions/gyptest-all.py | 243 | 3677 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple actions when using an explicit build target of 'all'.
"""
import glob
import os
import TestGyp
test = TestGyp.TestGyp(... | agpl-3.0 |
linjoahow/2015cdaa-week11 | static/Brython3.1.1-20150328-091302/Lib/random.py | 518 | 26080 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | gpl-3.0 |
p0psicles/SickGear | lib/pythontwitter/__init__.py | 66 | 175430 | #!/usr/bin/env python2
#
# vim: sw=2 ts=2 sts=2
#
# Copyright 2007 The Python-Twitter Developers
#
# 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/LIC... | gpl-3.0 |
luozhaoyu/leetcode | stock.py | 1 | 5071 | class Solution:
def get_k_continuous_largest(self, total, l):
if not l:
return 0
if total >= len(l) / 2 + 1:
return sum([i for i in l if i > 0])
# f[n+2][k] = max(f[n][k], f[i][k-1] + max[i+1, n+2])
f = dict([(i, dict([(j, 0) for j in range(0, total+1)])) for... | mit |
mscuthbert/abjad | abjad/tools/lilypondparsertools/test/test_lilypondparsertools_LilyPondParser__indicators__Articulation.py | 2 | 3593 | # -*- encoding: utf-8 -*-
import pytest
from abjad import *
from abjad.tools.lilypondparsertools import LilyPondParser
def test_lilypondparsertools_LilyPondParser__indicators__Articulation_01():
target = Staff(scoretools.make_notes(["c''"], [(1, 4)] * 6 + [(1, 2)]))
articulation = Articulation('marcato', Up)... | gpl-3.0 |
leafcoin/p2pool-charity-leafcoin | p2pool/bitcoin/networks.py | 1 | 60504 | import os
import platform
from twisted.internet import defer
from . import data
from p2pool.util import math, pack, jsonrpc
@defer.inlineCallbacks
def check_genesis_block(bitcoind, genesis_block_hash):
try:
yield bitcoind.rpc_getblock(genesis_block_hash)
except jsonrpc.Error_for_code(-5):
def... | gpl-3.0 |
hungtt57/matchmaker | lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 436 | 5992 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isinstance(s, text_type):
... | mit |
burnpanck/chaco | chaco/abstract_plot_data.py | 2 | 4114 | """ Defines the base class for plot data.
"""
from traits.api import Bool, Event, HasTraits
class AbstractPlotData(HasTraits):
"""
Defines the interface for data providers to Plot.
"""
#-------------------------------------------------------------------------
# Events that consumers of this data ... | bsd-3-clause |
broferek/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ssl_web_user_group_bookmark.py | 14 | 20051 | #!/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 |
Jgarcia-IAS/Fidelizacion_odoo | openerp/addons/base/module/wizard/base_language_install.py | 447 | 2738 | # -*- 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 |
ryfeus/lambda-packs | Rasterio_osgeo_shapely_PIL_pyproj_numpy/source/osgeo/ogr.py | 1 | 169676 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (... | mit |
borysiasty/inasafe | safe/storage/test/test_clipping.py | 8 | 8247 | # coding=utf-8
import unittest
import numpy
import os
from os.path import join
from safe.test.utilities import TESTDATA
from safe.gis.polygon import (
is_inside_polygon,
inside_polygon,
populate_polygon,
generate_random_points_in_bbox)
from safe.storage.vector import Vector
from safe.storage.core impor... | gpl-3.0 |
sbktechnology/trufil-frappe | frappe/utils/scheduler.py | 31 | 4671 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
Events:
always
daily
monthly
weekly
"""
from __future__ import unicode_literals
import frappe
import json
import frappe.utils
from frappe.utils.file_lock import create_lock, check_lock, delete_lock
from datetim... | mit |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_py3.py | 1 | 7751 | # 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 |
aitoehigie/gidimagic | venv/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | mit |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/jinja2/bccache.py | 256 | 12289 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... | bsd-3-clause |
jfrygeo/solutions-geoprocessing-toolbox | utils/test/Configuration.py | 1 | 4790 | '''
------------------------------------------------------------------------------
Copyright 2015 Esri
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
U... | apache-2.0 |
benpatterson/edx-platform | lms/djangoapps/mobile_api/social_facebook/utils.py | 86 | 2886 | """
Common utility methods and decorators for Social Facebook APIs.
"""
import json
import urllib2
import facebook
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from rest_framework.response import Response
from social.apps.django_app.default.mod... | agpl-3.0 |
HaoPatrick/tdd-pyhton | functional_tests/bse.py | 1 | 1224 | from selenium import webdriver
from unittest import skip
import unittest
from django.test import LiveServerTestCase
from selenium.webdriver.common.keys import Keys
import time
class NewVisitorTest(LiveServerTestCase):
def setUp(self):
self.browser=webdriver.Firefox()
self.browser.implicitly_wait(3)
... | mit |
kurtaj/CryptoBus | python/cryptobus/core/file.py | 1 | 1199 | import os
import platform
import cryptobus.core.exception
class Local(object):
_CRYPTOBUS_DIR_NAME = 'CryptoBus'
_WINDOWS_PLATFORMS = ['Windows']
_UNIX_PLATFORMS = [] # TODO: Not Tested In Unix/Linux
_runtime_platform = platform.system()
def __init__(self):
self._local_data_path = Local._get_local_storage_pa... | mit |
docmeth02/CouchPotatoServer | couchpotato/core/plugins/base.py | 1 | 15863 | import threading
from urllib import quote
from urlparse import urlparse
import glob
import inspect
import os.path
import re
import time
import traceback
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import ss, toSafeString, \
toUnicode, sp
from couchpotato.core.helpe... | gpl-3.0 |
digwanderlust/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_resource_mapping.py | 2 | 1923 | # 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)
from pants.backend.j... | apache-2.0 |
rooshilp/CMPUT410Lab6 | virt_env/virt1/lib/python2.7/site-packages/django/db/backends/oracle/schema.py | 56 | 4459 | import copy
import datetime
import binascii
from django.utils import six
from django.utils.text import force_text
from django.db.backends.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALTER TABLE %(tabl... | apache-2.0 |
jicksy/oneanddone_test | vendor-local/lib/python/south/logger.py | 129 | 1175 | import sys
import logging
from django.conf import settings
# Create a dummy handler to use for now.
class NullHandler(logging.Handler):
def emit(self, record):
pass
def get_logger():
"Attach a file handler to the logger if there isn't one already."
debug_on = getattr(settings, "SOUTH_LOGGING_ON", ... | mpl-2.0 |
gusai-francelabs/datafari | windows/python/Lib/ctypes/util.py | 13 | 9029 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys, os
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
d... | apache-2.0 |
manipopopo/tensorflow | tensorflow/contrib/kfac/examples/tests/mnist_test.py | 41 | 2500 | # 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 |
darac/powerline | tests/lib/__init__.py | 18 | 7870 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import imp
import sys
class Pl(object):
def __init__(self):
self.exceptions = []
self.errors = []
self.warns = []
self.debugs = []
self.infos = []
self.prefix = None
self.use_daemon_threa... | mit |
bayolau/seqan | apps/splazers/tests/run_tests.py | 13 | 10294 | #!/usr/bin/env python
"""Execute the tests for splazers.
The golden test outputs are generated by the script generate_outputs.sh.
You have to give the root paths to the source and the binaries as arguments to
the program. These are the paths to the directory that contains the 'projects'
directory.
Usage: run_tests... | bsd-3-clause |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/binhex.py | 41 | 13954 | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | apache-2.0 |
lorensen/VTKExamples | src/Python/PolyData/ImplicitPolyDataDistance.py | 1 | 2249 | import numpy as np
import vtk
def main():
sphereSource = vtk.vtkSphereSource()
sphereSource.SetCenter(0.0, 0.0, 0.0)
sphereSource.SetRadius(1.0)
sphereSource.Update()
sphereMapper = vtk.vtkPolyDataMapper()
sphereMapper.SetInputConnection(sphereSource.GetOutputPort())
sphereMapper.ScalarVi... | apache-2.0 |
Antiun/reporting-engine | report_qweb_element_page_visibility/__init__.py | 9 | 1430 | # -*- coding: utf-8 -*-
#########################################################################
# #
# Copyright (C) 2015 Agile Business Group #
# #
... | agpl-3.0 |
IgnitionProject/ignition | ignition/dsl/int_gen/tests/test_generator.py | 1 | 3747 | import os
from subprocess import Popen, PIPE
import sympy
from ignition.dsl.int_gen.language import DiscFunc, Dom, Func
from ignition.dsl.int_gen.generator import gen_file, int_gen
def test_symbolic_fun():
x = sympy.Symbol("x")
intgrl = Func(sympy.cos(x), x) * Dom(x, 0, 1)
code = int_gen(intgrl, "tmp1", ... | bsd-3-clause |
JFriel/honours_project | networkx/networkx/algorithms/centrality/tests/test_dispersion.py | 63 | 1416 | import networkx as nx
from nose.tools import *
def small_ego_G():
"""The sample network from http://arxiv.org/pdf/1310.6753v1.pdf"""
edges=[('a','b'), ('a','c'), ('b','c'), ('b','d'),
('b', 'e'),('b','f'),('c','d'),('c','f'),('c','h'),('d','f'), ('e','f'),
('f','h'),('h','j'), ('h','k'),... | gpl-3.0 |
kbrebanov/ansible | lib/ansible/modules/network/f5/bigip_sys_db.py | 6 | 7851 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 F5 Networks 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 |
luzheqi1987/nova-annotation | nova/tests/unit/virt/libvirt/test_lvm.py | 1 | 7655 | # Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! 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/li... | apache-2.0 |
andrewjtech123/rebilly-validschema | python-client /test/test_error.py | 1 | 4188 | # coding: utf-8
"""
Draft Orders API
### Draft Orders API This API is about operations you can perform on the draft order object as defind below: Field | Definition | Data Type -----|-----------|------------------------- `id`| `id` of the draft order |`string` `order_id` | The id of the order as... | mit |
syncrypt/client | syncrypt/models/base.py | 1 | 1703 | import umsgpack
from sqlalchemy.ext.declarative import declarative_base
from syncrypt.pipes import (DecryptRSA_PKCS1_OAEP, EncryptRSA_PKCS1_OAEP, Once, SnappyCompress,
SnappyDecompress)
Base = declarative_base()
class MetadataHolder:
@property
def _metadata(self):
raise ... | gpl-3.0 |
Yelp/paasta | k8s_itests/scripts/render_template.py | 1 | 3615 | #!/usr/bin/env python3.7
import argparse
import os
import re
import yaml
def replace(s, values):
s = re.sub(
r"<%(.*?)%>",
lambda x: values.get(
x.group(0).replace("<%", "").replace("%>", ""), x.group(0)
),
s,
)
return re.sub(
r"\$\((.*?)\)",
la... | apache-2.0 |
flavour/RedHat | modules/s3/s3codecs/__init__.py | 23 | 1289 | # -*- coding: utf-8 -*-
""" S3 Codecs
@copyright: 2009-2013 (c) Sahana Software Foundation
@license: MIT
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
restricti... | mit |
agileblaze/OpenStackTwoFactorAuthentication | openstack_dashboard/dashboards/project/routers/extensions/routerrules/tables.py | 51 | 2806 | # Copyright 2013, Big Switch Networks, 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 applicabl... | apache-2.0 |
CenterForOpenScience/waterbutler | waterbutler/providers/cloudfiles/metadata.py | 5 | 2066 | import os
from waterbutler.core import metadata
class BaseCloudFilesMetadata(metadata.BaseMetadata):
@property
def provider(self):
return 'cloudfiles'
class CloudFilesFileMetadata(BaseCloudFilesMetadata, metadata.BaseFileMetadata):
@property
def name(self):
return os.path.split(se... | apache-2.0 |
INNUENDOCON/INNUca | src/SPAdes-3.10.1-Linux/share/spades/joblib3/parallel.py | 14 | 35575 | """
Helpers for embarrassingly parallel code.
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
from __future__ import division
import os
import sys
import gc
import warnings
from math import sqrt
import functools
import time
import thr... | gpl-3.0 |
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping | src/arch/x86/isa/insts/x87/arithmetic/division.py | 50 | 2191 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
asiakaczmar/nyuki | src/spellcheck/tests/test_non_dict.py | 1 | 3202 | import unittest
from src.spellcheck.non_dict import (get_diff_index, add_row,
build_levenshtein_table, get_levenshtein_table, get_words_with_max_distance)
class TestGetDiffIndex(unittest.TestCase):
def test_short_long(self):
result = get_diff_index("cat", "category")
self.assertEqual(3, result... | gpl-2.0 |
seungjin/app5-seungjin-net.appspot.com | django/contrib/localflavor/se/forms.py | 311 | 5623 | # -*- coding: utf-8 -*-
"""
Swedish specific Form helpers
"""
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
from django.contrib.localflavor.se.utils import (id_number_checksum,
validate_id_birthday, format_personal_id_numbe... | bsd-3-clause |
leitwolf/GoDev | pymysql/__init__.py | 1 | 4666 | '''
PyMySQL: A pure-Python MySQL client library.
Copyright (c) 2010, 2013 PyMySQL contributors
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 th... | mit |
tumbl3w33d/ansible | lib/ansible/modules/cloud/cloudstack/cs_network.py | 13 | 19038 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# 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': '... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.