repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Jorge-Rodriguez/ansible | lib/ansible/modules/net_tools/nios/nios_fixed_address.py | 31 | 8390 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
chiefspace/udemy-rest-api | udemy_rest_api_section4/env/lib/python3.4/site-packages/aniso8601/interval.py | 5 | 5596 | # -*- coding: utf-8 -*-
# Copyright (c) 2016, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from datetime import datetime
from aniso8601.duration import parse_duration
from aniso8601.time import parse_d... | gpl-2.0 |
ebar0n/django | django/core/management/commands/squashmigrations.py | 17 | 9351 | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections, migrations
from django.db.migrations.loader import AmbiguityError, MigrationLoader
from django.db.migrations.migration import SwappableTuple
from django.db.migrations.o... | bsd-3-clause |
zi-w/Structural-Kernel-Learning-for-HDBBO | test_functions/python_related/generate_simudata4.py | 2 | 1054 | #!/usr/bin/env python
# Copyright (c) 2017 Zi Wang
from push_world import *
import sys
# difference to generate_simudata is an input that control angle of push
if __name__ == '__main__':
rx = float(sys.argv[1])
ry = float(sys.argv[2])
gx = float(sys.argv[4])
gy = float(sys.argv[5])
init_angle = flo... | mit |
BT-ojossen/partner-contact | partner_contact_gender/__openerp__.py | 9 | 1252 | # -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# 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 versio... | agpl-3.0 |
paplorinc/intellij-community | python/helpers/pycharm/_jb_pytest_runner.py | 1 | 1689 | # coding=utf-8
import sys
import pytest
from _pytest.config import get_plugin_manager
from _pytest import config
from pkg_resources import iter_entry_points
from _jb_runner_tools import jb_patch_separator, jb_doc_args, JB_DISABLE_BUFFERING, start_protocol, parse_arguments, \
set_parallel_mode
from teamcity impor... | apache-2.0 |
richokarl/Printrun | printrun/gui/__init__.py | 15 | 13974 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-3.0 |
rolando-contrib/scrapy | scrapy/utils/project.py | 26 | 2590 | import os
from six.moves import cPickle as pickle
import warnings
from importlib import import_module
from os.path import join, dirname, abspath, isabs, exists
from scrapy.utils.conf import closest_scrapy_cfg, get_config, init_env
from scrapy.settings import Settings
from scrapy.exceptions import NotConfigured
ENVVA... | bsd-3-clause |
madhavajay/nd889 | 1_foundations/1_sudoku/tests/udacity/solution_test.py | 9 | 8615 | import solution
import unittest
class TestNakedTwins(unittest.TestCase):
before_naked_twins_1 = {'I6': '4', 'H9': '3', 'I2': '6', 'E8': '1', 'H3': '5', 'H7': '8', 'I7': '1', 'I4': '8',
'H5': '6', 'F9': '7', 'G7': '6', 'G6': '3', 'G5': '2', 'E1': '8', 'G3': '1', 'G2': '8',
... | mit |
sarvex/tensorflow | tensorflow/examples/adding_an_op/zero_out_op_3.py | 23 | 1063 | # 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 |
F1ashhimself/robotframework-selenium2library | src/Selenium2Library/keywords/_waiting.py | 26 | 4678 | import time
import robot
from keywordgroup import KeywordGroup
class _WaitingKeywords(KeywordGroup):
# Public
def wait_for_condition(self, condition, timeout=None, error=None):
"""Waits until the given `condition` is true or `timeout` expires.
`code` may contain multiple lines of code but mu... | apache-2.0 |
gangadhar-kadam/verve_live_erp | erpnext/selling/doctype/customer/customer.py | 6 | 8497 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.naming import make_autoname
from frappe import _, msgprint, throw
import frappe.defaults
from frappe.utils import flt
f... | agpl-3.0 |
larrybradley/astropy | astropy/table/__init__.py | 8 | 3387 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import config as _config
from .column import Column, MaskedColumn, StringTruncateWarning, ColumnInfo
__all__ = ['BST', 'Column', 'ColumnGroups', 'ColumnInfo', 'Conf',
'JSViewer', 'MaskedColumn', 'NdarrayMixin', 'QTable', 'Row',
... | bsd-3-clause |
RenaudParis/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py | 86 | 12804 | import cgi
import json
import os
import traceback
import urllib
import urlparse
from constants import content_types
from pipes import Pipeline, template
from ranges import RangeParser
from request import Authentication
from response import MultipartContent
from utils import HTTPException
__all__ = ["file_handler", "p... | mpl-2.0 |
mohamedhagag/community-addons | report_xls/ir_report.py | 8 | 1180 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under t... | agpl-3.0 |
google-research/google-research | summae/process_rocstories.py | 1 | 3243 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
susuchina/ERPNEXT | erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py | 64 | 2651 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(filters=None):
if not filters:
filters = {}
elif filters.get("from_date... | agpl-3.0 |
MQQiang/kbengine | kbe/src/lib/python/Lib/encodings/iso8859_11.py | 272 | 12335 | """ Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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,errors... | lgpl-3.0 |
stonelake/pyoptimization | pyopt/packing/rectangular/test_rpacker.py | 1 | 3203 | from unittest import TestCase
from rpacker import RPacker
from box import Box
__author__ = 'Alex Baranov'
class TestRPacker(TestCase):
"""
Test for RPacker
"""
def setUp(self):
"""
The setup test method.
"""
self.packer = RPacker()
def test_incl... | apache-2.0 |
maruschin/l-system | lsystem/lfigure.py | 1 | 2037 | # L-System package
import numpy as np
class LFigure:
def __init__(self, lsystem, size):
self.lsystem = lsystem
self.rule = self.lsystem.rule
self.angel = self.lsystem.angel
self.make_dimensions(size)
def make_dimensions(self, size):
lines = make_dimensions(self.ange... | mit |
espadrine/opera | chromium/src/third_party/chromite/lib/partial_mock.py | 2 | 17522 | #!/usr/bin/python
# Copyright (c) 2012 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.
"""Contains functionality used to implement a partial mock."""
import collections
import logging
import mock
import os
import re
... | bsd-3-clause |
arista-eosplus/ansible | lib/ansible/plugins/callback/logstash.py | 12 | 6893 | # (C) 2016, Ievgen Khmelenko <ujenmr@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) any later ver... | gpl-3.0 |
fqhuy/minimind | prototypes/test_image_upsampling.py | 1 | 1261 | import numpy as np
import scipy as sp
from scipy.stats import multivariate_normal
from matplotlib import pyplot as plt
def k(x, a = -0.75):
if abs(x) <= 1:
return (a + 2.) * abs(x)**3 - (a + 3.) * abs(x) ** 2. + 1
elif 1 < abs(x) <= 2:
return a * abs(x) ** 3. - 5. * a * abs(x) **2. + 8. * a * ... | mit |
davislg/Google-s-Python-Class | basic/davis_solution/string2.py | 1 | 2910 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic string exercises
# D. verbing
# Given a string, if its length is at l... | apache-2.0 |
Dining-Engineers/left-luggage-detection | misc/demo/ipython/calibkinect.py | 2 | 3942 | """
These are some functions to help work with kinect camera calibration and projective
geometry.
Tasks:
- Convert the kinect depth image to a metric 3D point cloud
- Convert the 3D point cloud to texture coordinates in the RGB image
Notes about the coordinate systems:
There are three coordinate systems to worry ab... | gpl-2.0 |
Leoniela/nipype | nipype/interfaces/cmtk/tests/test_auto_CreateMatrix.py | 14 | 1926 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.cmtk.cmtk import CreateMatrix
def test_CreateMatrix_inputs():
input_map = dict(count_region_intersections=dict(usedefault=True,
),
out_endpoint_array_name=dict(genfile=True,
),
out_f... | bsd-3-clause |
brentdax/swift | utils/gyb_syntax_support/Trivia.py | 3 | 3161 | from Node import error
from kinds import lowercase_first_word
class Trivia(object):
def __init__(self, name, comment, serialization_code, characters=[],
swift_characters=[], is_new_line=False, is_comment=False):
self.name = name
self.comment = comment
self.serialization_c... | apache-2.0 |
MarcoXerox/NetSDK | FacebookSession.py | 1 | 6023 | import re, itertools, utils, Base
from bs4 import BeautifulSoup as BS
class FacebookSession(Base.WebSession):
''' Session for Facebook. Check attribute METHODS for methods it supports.
FacebookHandle comes with multisession support.
'''
# Constant values of FacebookSession
HOME = 'https://m.fa... | gpl-3.0 |
aerophile/django | django/utils/dateparse.py | 63 | 3985 | """Functions to parse datetime objects."""
# We're using regular expressions rather than time.strptime because:
# - They provide both validation and parsing.
# - They're more flexible for datetimes.
# - The date/datetime/time constructors produce friendlier error messages.
import datetime
import re
from django.utils... | bsd-3-clause |
BeegorMif/HTPC-Manager | lib/hachoir_parser/audio/xm.py | 90 | 15154 | """
Parser of FastTrackerII Extended Module (XM) version 1.4
Documents:
- Modplug source code (file modplug/soundlib/Load_xm.cpp)
http://sourceforge.net/projects/modplug
- Dumb source code (files include/dumb.h and src/it/readxm.c
http://dumb.sf.net/
- Documents of "XM" format on Wotsit
http://www.wotsit.org
Au... | gpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/cherrypy/cherrypy/test/test_static.py | 42 | 11354 | from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
from cherrypy._cpcompat import BytesIO
import os
curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
has_space_filepath = os.path.join(curdir, 'static', 'has space.html')
bigfile_filepath = os.path.join(curdir, "static", "bigfile.log")
BIGF... | apache-2.0 |
zestrada/nova-cs498cc | nova/virt/hyperv/livemigrationops.py | 10 | 4079 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
# 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.ap... | apache-2.0 |
ericdill/bokeh | bokeh/server/tests/test_utils.py | 4 | 2721 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | bsd-3-clause |
jazztpt/edx-platform | cms/lib/xblock/field_data.py | 234 | 1188 | """
:class:`~xblock.field_data.FieldData` subclasses used by the CMS
"""
from xblock.field_data import SplitFieldData
from xblock.fields import Scope
class CmsFieldData(SplitFieldData):
"""
A :class:`~xblock.field_data.FieldData` that
reads all UserScope.ONE and UserScope.ALL fields from `student_data`
... | agpl-3.0 |
nhomar/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 |
BryceLohr/authentic | authentic2/saml/migrations/0005_auto__del_unique_libertyprovider_name.py | 3 | 16602 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from authentic2.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'LibertyProvider', fields ['nam... | agpl-3.0 |
teampopong/crawlers | election_commission/crawlers/local/base.py | 3 | 3397 | #!/usr/bin/python2.7
# -*- encoding=utf-8 -*-
import gevent
from gevent import monkey
import itertools
from urlparse import urljoin
from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split
monkey.patch_all()
class BaseCrawler(object):
url_image_base = 'http://info.nec.go.kr'
attrs = []
... | agpl-3.0 |
adoosii/edx-platform | common/lib/xmodule/xmodule/progress.py | 110 | 5066 | '''
Progress class for modules. Represents where a student is in a module.
Useful things to know:
- Use Progress.to_js_status_str() to convert a progress into a simple
status string to pass to js.
- Use Progress.to_js_detail_str() to convert a progress into a more detailed
string to pass to js.
In particular... | agpl-3.0 |
kmolab/kmolab.github.io | data/Brython-3.3.4/Lib/test/test_pipes.py | 126 | 6473 | import pipes
import os
import string
import unittest
from test.support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command = 'tr %s %s' % (s... | agpl-3.0 |
nwjs/chromium.src | gpu/command_buffer/PRESUBMIT.py | 3 | 3329 | # Copyright 2019 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.
"""Enforces command buffer autogen matches script output.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the... | bsd-3-clause |
petewarden/tensorflow | tensorflow/python/ops/default_gradient.py | 21 | 3070 | # Copyright 2019 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 |
mtp1376/youtube-dl | youtube_dl/extractor/ellentv.py | 12 | 3239 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_iso8601,
)
class EllenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:ellentv|ellentube)\.com/videos/(?P<id>[a-z0-9_-]+)'
_TESTS = [{
'u... | unlicense |
tdsmith/pip | pip/req/req_file.py | 239 | 9670 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... | mit |
rworkman/blueman | blueman/main/DBusProxies.py | 1 | 1419 | # coding=utf-8
from gi.repository import Gio, GLib
from gi.types import GObjectMeta
class DBusProxyFailed(Exception):
pass
class ProxyBaseMeta(GObjectMeta):
_instance = None
def __call__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super().__call__(*args, **kwargs)
... | gpl-3.0 |
Ruide/angr-dev | angr/angr/analyses/cfg/cfg_utils.py | 3 | 7621 |
from collections import defaultdict
import networkx
class SCCPlaceholder(object):
__slots__ = ['scc_id']
def __init__(self, scc_id):
self.scc_id = scc_id
def __eq__(self, other):
return isinstance(other, SCCPlaceholder) and other.scc_id == self.scc_id
def __hash__(self):
r... | bsd-2-clause |
stefanv/aandete | app/lib/nose/plugins/__init__.py | 97 | 6291 | """
Writing Plugins
---------------
nose supports plugins for test collection, selection, observation and
reporting. There are two basic rules for plugins:
* Plugin classes should subclass :class:`nose.plugins.Plugin`.
* Plugins may implement any of the methods described in the class
:doc:`IPluginInterface <interf... | bsd-3-clause |
nirmeshk/oh-mainline | vendor/packages/scrapy/scrapy/webservice.py | 18 | 3191 | """
Scrapy web services extension
See docs/topics/webservice.rst
"""
from twisted.web import server, error
from scrapy.xlib.pydispatch import dispatcher
from scrapy.exceptions import NotConfigured
from scrapy import log, signals
from scrapy.utils.jsonrpc import jsonrpc_server_call
from scrapy.utils.serialize import ... | agpl-3.0 |
sunze/py_flask | venv/lib/python3.4/site-packages/sqlalchemy/orm/dynamic.py | 59 | 13283 | # orm/dynamic.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Dynamic collection API.
Dynamic collections act like Query() objects for read ope... | mit |
guillochon/FriendlyFit | mosfit/modules/seds/sed.py | 5 | 3376 | """Definitions for the `SED` class."""
import numpy as np
from astropy import constants as c
from astropy import units as u
from mosfit.modules.module import Module
# Important: Only define one ``Module`` class per file.
class SED(Module):
"""Template class for SED Modules.
Modules that inherit from the S... | mit |
jimbydamonk/ansible-modules-core | cloud/amazon/ec2_key.py | 51 | 7841 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
LarsFronius/ansible | lib/ansible/modules/network/openswitch/ops_facts.py | 70 | 12132 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
trondhindenes/ansible | lib/ansible/plugins/connection/paramiko_ssh.py | 19 | 22714 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
author: Ansible Core Team
con... | gpl-3.0 |
roadmapper/ansible | lib/ansible/module_utils/aws/rds.py | 13 | 11301 | # Copyright: (c) 2018, Ansible Project
# 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
from ansible.module_utils._text import to_text
from ansible.module_utils.aws.waiters import get_wa... | gpl-3.0 |
MaplePlan/djwp | django/contrib/auth/management/commands/changepassword.py | 126 | 1975 | import getpass
from optparse import make_option
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--database', action='s... | lgpl-3.0 |
zoufishanmehdi/Uncharted | node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
nathanielherman/silo | benchmarks/results/istc3-8-16-13_multipart_skew.py | 2 | 11299 | RESULTS = [({'disable_gc': False, 'scale_factor': 4, 'db': 'kvdb-st', 'par_load': False, 'threads': 1, 'log_compress': False, 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks ', 'log_fake_writes': False, 'retry': False, 'log_nofsync': False, 'name': 'multipart:skew... | mit |
hugovk/terroroftinytown | terroroftinytown/tracker/model.py | 1 | 27062 | # encoding=utf-8
import base64
import calendar
import contextlib
import datetime
import hmac
import json
import os
import random
import subprocess
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy.orm.session import make_transient
from sqlalch... | mit |
codervince/flashingredlight | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
arifsetiawan/edx-platform | common/djangoapps/cors_csrf/tests/test_views.py | 150 | 2397 | """Tests for cross-domain request views. """
import json
from django.test import TestCase
from django.core.urlresolvers import reverse, NoReverseMatch
import ddt
from config_models.models import cache
from cors_csrf.models import XDomainProxyConfiguration
@ddt.ddt
class XDomainProxyTest(TestCase):
"""Tests for... | agpl-3.0 |
adrienbrault/home-assistant | tests/components/homekit_controller/specific_devices/test_koogeek_ls1.py | 5 | 3555 | """Make sure that existing Koogeek LS1 support isn't broken."""
from datetime import timedelta
from unittest import mock
from aiohomekit.exceptions import AccessoryDisconnectedError, EncryptionError
from aiohomekit.testing import FakePairing
import pytest
from homeassistant.components.light import SUPPORT_BRIGHTNESS... | mit |
danielneis/osf.io | tests/framework_tests/test_utils.py | 31 | 1575 | import unittest # noqa
from nose.tools import * # noqa
from modularodm import Q
from tests.base import DbTestCase
from tests import factories
from framework.mongo.utils import get_or_http_error, autoload
from framework.exceptions import HTTPError
from website.models import Node
class MongoUtilsTestCase(DbTestCa... | apache-2.0 |
Omhen/rasppi-caldera | cycle.py | 1 | 3169 | import ConfigParser
import logging
import os
import os.path
import threading
import time
from datetime import datetime
from config.flags import Status, Watching
import RPIO
import config.flags as flags
from watcher import Watcher
CONFIG_FILE = os.path.join(os.path.dirname(__file__), 'config/all.conf')
OUT_ENDLESS_FUL... | gpl-3.0 |
prescottprue/PiOpenLighting | python/ola/UIDTest.py | 2 | 2961 | #!/usr/bin/python
# This library 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 (at your option) any later version.
#
# This library is distributed in the hope t... | lgpl-2.1 |
michelts/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/gis/sitemaps/kml.py | 482 | 2481 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... | gpl-3.0 |
GonzaloAfa/Termometro | login/views.py | 1 | 2578 | import json
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
from django.template import RequestContext
from django.shortcuts import render_to_response, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import logout as auth_logout, ... | mit |
csoriano89/app-python-template | src/application.py | 1 | 2610 | import gi
gi.require_version('Notify', '0.7')
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gio, GLib, Gdk, Notify
from gettext import gettext as _
from usage.log import *
from usage.window import Window
class Application(Gtk.Application):
def __repr__(self):
return '<Application>'
... | gpl-3.0 |
nomedeusuariodesconhecido/info3180-lab4 | venv/lib/python2.7/site-packages/setuptools/command/sdist.py | 385 | 7079 | from glob import glob
from distutils import log
import distutils.command.sdist as orig
import os
import sys
from setuptools.compat import PY3
from setuptools.utils import cs_path_exists
import pkg_resources
READMES = 'README', 'README.rst', 'README.txt'
_default_revctrl = list
def walk_revctrl(dirname=''):
"""... | mit |
balloob/home-assistant | tests/components/mfi/test_sensor.py | 3 | 6305 | """The tests for the mFi sensor platform."""
from mficlient.client import FailedToLogin
import pytest
import requests
import homeassistant.components.mfi.sensor as mfi
import homeassistant.components.sensor as sensor_component
from homeassistant.const import TEMP_CELSIUS
from homeassistant.setup import async_setup_com... | apache-2.0 |
akirk/youtube-dl | youtube_dl/extractor/youjizz.py | 148 | 2297 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class YouJizzIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?youjizz\.com/videos/[^/#?]+-(?P<id>[0-9]+)\.html(?:$|[?#])'
_TEST = {
'url': 'http://www.youjizz.com/video... | unlicense |
tuxfux-hlp-notes/python-batches | archieves/batch-60/modules/myenv/lib/python2.7/site-packages/setuptools/dist.py | 148 | 32599 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import distutils.log
import distutils.core
import distutils.cmd
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError)
from setuptools.depend... | gpl-3.0 |
tmm1/home-assistant | tests/util/test_dt.py | 28 | 4481 | """
tests.test_util
~~~~~~~~~~~~~~~~~
Tests Home Assistant date util methods.
"""
# pylint: disable=too-many-public-methods
import unittest
from datetime import datetime, timedelta
import homeassistant.util.dt as dt_util
TEST_TIME_ZONE = 'America/Los_Angeles'
class TestDateUtil(unittest.TestCase):
""" Tests ut... | mit |
chiapas/sumatrapdf-new | ext/freetype2/src/tools/docmaker/formatter.py | 515 | 4962 | # Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | gpl-3.0 |
angvp/django-klingon | runtests.py | 1 | 2338 | #! /usr/bin/env python
from __future__ import print_function
import pytest
import sys
import os
import subprocess
PYTEST_ARGS = {
'default': ['tests',],
'fast': ['tests', '-q'],
}
FLAKE8_ARGS = ['klingon', 'tests', '--ignore=E501']
sys.path.append(os.path.dirname(__file__))
def exit_on_failure(ret, mess... | lgpl-3.0 |
ywcui1990/htmresearch | projects/capybara/datasets/SyntheticData/generate_synthetic_data.py | 9 | 5156 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 |
wwj718/edx-platform | common/djangoapps/util/tests/test_date_utils.py | 55 | 7800 | # -*- coding: utf-8 -*-
"""
Tests for util.date_utils
"""
from datetime import datetime, timedelta, tzinfo
import unittest
import ddt
from mock import patch
from nose.tools import assert_equals, assert_false # pylint: disable=no-name-in-module
from pytz import UTC
from util.date_utils import (
get_default_time_... | agpl-3.0 |
vshymanskyy/Espruino | boards/STM32VLDISCOVERY.py | 8 | 2445 | #!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at h... | mpl-2.0 |
austinluong/fit-extract | fit_extract/util.py | 1 | 1626 | #!/usr/bin/env python
import glob
import os
def correctPath(path):
"""Fixes path name"""
return os.path.normpath(path) + '/'
def pathToName(filepath):
"""Returns an extensionless name from a file path
>>> pathFoo = 'C://Users//User//Folder//Subfolder//foo_C07.fit'
>>> path = 'C://Users//User//Fo... | unlicense |
luistorresm/sale-workflow | __unported__/pricelist_share_companies/__openerp__.py | 34 | 2999 | # -*- coding: utf-8 -*-
#
#
# Author: Joël Grand-Guillaume
# Copyright 2010 Camptocamp SA
#
# 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
# Lic... | agpl-3.0 |
pfnet/chainer | tests/chainer_tests/functions_tests/pooling_tests/test_roi_max_align_2d.py | 4 | 4400 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer_tests.functions_tests.pooling_tests import pooling_nd_helper
def _pair... | mit |
lentinj/u-boot | tools/patman/patchstream.py | 20 | 16308 | # Copyright (c) 2011 The Chromium OS Authors.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# t... | gpl-2.0 |
CUCWD/edx-platform | lms/djangoapps/instructor_task/models.py | 9 | 12722 | """
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration instructor_task --auto description_of_your_change
3. Add the migration file cr... | agpl-3.0 |
alien4cloud/alien4cloud-cloudify3-provider | alien4cloud-cloudify3-provider/src/test/resources/outputs/blueprints/openstack/artifact_testOverridden/wrapper/Artifact_Directory_Test/tosca.interfaces.node.lifecycle.Standard/create/_a4c_create.py | 4 | 17400 |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify im... | apache-2.0 |
edx/edx-platform | openedx/core/djangoapps/oauth_dispatch/views.py | 4 | 4657 | """
Views that dispatch processing of OAuth requests to django-oauth2-provider or
django-oauth-toolkit as appropriate.
"""
import json
from django.conf import settings
from django.utils.decorators import method_decorator
from django.views.generic import View
from edx_django_utils import monitoring as monitoring_util... | agpl-3.0 |
Justin-Yuan/Image2Music-Generator | library/jython2.5.3/Lib/wsgiref/headers.py | 104 | 5916 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.Message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
from types import ListType, TupleType
# Regular expression that matches `special' characters in para... | gpl-2.0 |
alexsavio/SandS-EDB | src/settings.py | 1 | 2867 | import socket
import models
import os
import sys
basedir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(basedir))
from keys import *
#References:
#http://python-eve.org/config.html
# We want to run seamlessly our API both locally and on Heroku, so:
hn = socket.gethostname()
if hn == 'gicS... | gpl-3.0 |
UBERMALLOW/external_skia | tools/find_bad_images_in_skps.py | 172 | 7405 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script will take as an argument either a list of skp files or a
set of directories that contains skp files. It will then test each
skp... | bsd-3-clause |
camilonos77/bootstrap-form-python-generator | enviroment/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/dom.py | 1229 | 1457 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
import gettext
_ = gettext.gettext
from . import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
def getNodeDetails(self, node):
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
return _base.DOCTYP... | gpl-2.0 |
marcelm/xopen | tests/test_xopen.py | 1 | 12338 | import io
import os
import random
import shutil
import signal
import sys
import time
import pytest
from pathlib import Path
from xopen import xopen, PipedCompressionWriter, PipedGzipReader, \
PipedGzipWriter, _MAX_PIPE_SIZE, _can_read_concatenated_gz
extensions = ["", ".gz", ".bz2"]
try:
import lzma
exte... | mit |
valhallasw/pywikibot-core | tests/archivebot_tests.py | 5 | 3438 | # -*- coding: utf-8 -*-
"""Tests for archivebot scripts."""
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
from datetime import datetime
import sys
import pywikibot
import pywikibot.page
from pywikibot.textlib import Tim... | mit |
ketjow4/NOV | Lib/site-packages/numpy/distutils/fcompiler/nag.py | 94 | 1332 | import sys
from numpy.distutils.fcompiler import FCompiler
compilers = ['NAGFCompiler']
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
description = 'NAGWare Fortran 95 Compiler'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd'... | gpl-3.0 |
kingvuplus/ee | mytest.py | 2 | 16731 | import sys, os
if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
sys.path.append("/usr/lib/enigma2/python/enigma.zip")
from Tools.Profile import profile, profile_final
profile("PYTHON_START")
import Tools.RedirectOutput
import enigma
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.eTimer
enigma... | gpl-2.0 |
sabi0/intellij-community | python/lib/Lib/quopri.py | 424 | 6969 | #! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = '='
MAXLINESIZE = 76
HEX = '0123456789ABCDEF'
EMPTYSTRING = ''
try:
from binascii import a2b_qp, b2a_qp
except Impo... | apache-2.0 |
wnt-zhp/hufce | django/utils/numberformat.py | 94 | 1775 | from django.conf import settings
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (as a number or string), and returns it as a string,
using formats defined as arguments:
* ... | gpl-3.0 |
radiasoft/crossbarexamples | django/realtimemonitor/django_app/models.py | 9 | 1331 | # -*- coding: utf-8 -*-
import requests
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.forms.models import model_to_dict
class Client(models.Model):
""" Our client configuration """
# Client unique identifier
ip = models.Gene... | apache-2.0 |
mandeepdhami/nova | nova/scheduler/filters/json_filter.py | 60 | 4799 | # Copyright (c) 2011 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 ... | apache-2.0 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/cython/src/Cython/Compiler/CodeGeneration.py | 99 | 1097 | from Cython.Compiler.Visitor import VisitorTransform
from Cython.Compiler.Nodes import StatListNode
class ExtractPxdCode(VisitorTransform):
"""
Finds nodes in a pxd file that should generate code, and
returns them in a StatListNode.
The result is a tuple (StatListNode, ModuleScope), i.e.
everythin... | bsd-3-clause |
dpassante/ansible | lib/ansible/plugins/inventory/ini.py | 16 | 17610 | # Copyright (c) 2017 Ansible Project
# 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
DOCUMENTATION = '''
inventory: ini
version_added: "2.4"
short_description: Uses an Ansibl... | gpl-3.0 |
spxtr/contrib | mungegithub/issue-labeler/simple_app.py | 20 | 4662 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... | apache-2.0 |
AsgerPetersen/QGIS | python/ext-libs/owslib/wcs.py | 30 | 1528 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2007 STFC <http://www.stfc.ac.uk>
#
# Authors :
# Dominic Lowe <d.lowe@rl.ac.uk>
#
# Contact email: d.lowe@rl.ac.uk
# =======================... | gpl-2.0 |
linjoahow/W16_test1 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/handler.py | 925 | 13922 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.