repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
oihane/server-tools | users_ldap_populate/model/populate_wizard.py | 43 | 1787 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
rakuco/crosswalk | tools/reflection_generator/code_generator.py | 7 | 1212 | # Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class CodeGenerator(object):
"""Basic class of code generator"""
def __init__(self, java_data, class_loader):
self._java_data = java_data
self._... | bsd-3-clause |
frappe/frappe | frappe/website/doctype/website_route_meta/test_website_route_meta.py | 1 | 1119 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and Contributors
# See license.txt
import frappe
import unittest
from frappe.utils import set_request
from frappe.website.serve import get_response
test_dependencies = ['Blog Post']
class TestWebsiteRouteMeta(unittest.TestCase):
def test_meta_tag_gener... | mit |
jamesbroadhead/pyyaml | lib3/yaml/loader.py | 277 | 1138 |
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
R... | mit |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/twisted/web/server.py | 12 | 24816 | # -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This is a web-server which integrates with the twisted.internet
infrastructure.
"""
from __future__ import division, absolute_import
import copy
import os
try:
from urllib import quote
... | gpl-2.0 |
GinnyN/Team-Fortress-RPG-Generators | django/conf/locale/en_GB/formats.py | 99 | 2044 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oct 2006'
TIME_FORMAT = 'P' ... | bsd-3-clause |
mnahm5/django-estore | Lib/site-packages/boto/opsworks/__init__.py | 135 | 1657 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
ycaihua/kbengine | kbe/res/scripts/common/Lib/pty.py | 120 | 4763 | """Pseudo terminal utilities."""
# Bugs: No signal handling. Doesn't set slave termios and window size.
# Only tested on Linux.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.
from select import select
imp... | lgpl-3.0 |
jazztpt/edx-platform | common/djangoapps/cache_toolbox/model.py | 239 | 1680 | """
Caching model instances
-----------------------
``cache_model`` adds utility methods to a model to obtain ``ForeignKey``
instances via the cache.
Usage
~~~~~
::
from django.db import models
from django.contrib.auth.models import User
class Foo(models.Model):
name = models.CharField(length=2... | agpl-3.0 |
vadimtk/chrome4sdp | tools/telemetry/third_party/webpagereplay/trafficshaper.py | 31 | 6415 | #!/usr/bin/env python
# Copyright 2010 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... | bsd-3-clause |
aaleotti-unimore/ComicsScraper | lib/html5lib/treebuilders/etree_lxml.py | 353 | 14161 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | apache-2.0 |
milki/password-store | contrib/importers/keepass2pass.py | 26 | 4832 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stefan Simroth <stefan.simroth@gmail.com>. All Rights Reserved.
# Based on the script for KeepassX by Juhamatti Niemelä <iiska@iki.fi>.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
#
# Usage:
# ./keepass2pass.py ... | gpl-2.0 |
camptocamp/c2c-rd-addons | chricar_account_period_sum/wizard/__init__.py | 4 | 1182 | # -*- coding: utf-8 -*-
# ChriCar Beteiligungs- und Beratungs- GmbH
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-t... | agpl-3.0 |
eadgarchen/tensorflow | tensorflow/contrib/ffmpeg/decode_audio_op_test.py | 33 | 8176 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
iamutkarshtiwari/kivy | kivy/uix/dropdown.py | 20 | 11854 | '''
Drop-Down List
==============
.. versionadded:: 1.4.0
A versatile drop-down list that can be used with custom widgets. It allows you
to display a list of widgets under a displayed widget. Unlike other toolkits,
the list of widgets can contain any type of widget: simple buttons,
images etc.
The positioning of the... | mit |
wikier/apache-marmotta-tutorial-iswc2014 | media/media-tutorial-webapp/src/main/webapp/tutorial/bower_components/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | apache-2.0 |
muffl0n/ansible-modules-core | windows/win_msi.py | 114 | 1747 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>, and others
#
# 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 t... | gpl-3.0 |
tmpgit/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/maps/google/__init__.py | 603 | 2648 | """
This module houses the GoogleMap object, used for generating
the needed javascript to embed Google Maps in a Web page.
Google(R) is a registered trademark of Google, Inc. of Mountain View, California.
Example:
* In the view:
return render_to_response('template.html', {'google' : GoogleMap(key="... | apache-2.0 |
ashutrix03/inteygrate_flaskapp-master | build/lib/yowsup/layers/protocol_groups/protocolentities/iq_groups_subject.py | 61 | 1076 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups import GroupsIqProtocolEntity
class SubjectGroupsIqProtocolEntity(GroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g2", to={{group_jid}}">
<subject>
{{NEW_VAL}}
</subject>
</iq>
'''
... | gpl-3.0 |
ianctse/pvlib-python | pvlib/test/test_clearsky.py | 1 | 6604 | import logging
pvl_logger = logging.getLogger('pvlib')
import numpy as np
import pandas as pd
from nose.tools import raises
from numpy.testing import assert_almost_equal
from pandas.util.testing import assert_frame_equal, assert_series_equal
from pvlib.location import Location
from pvlib import clearsky
from pvlib i... | bsd-3-clause |
jetskijoe/SickGear | lib/sqlalchemy/dialects/postgresql/pypostgresql.py | 79 | 2169 | # postgresql/pypostgresql.py
# Copyright (C) 2005-2014 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
"""
.. dialect:: postgresql+pypostgresql
:name: py-postgresql
:dbap... | gpl-3.0 |
jalavik/invenio | invenio/legacy/websession/scripts/inveniogc.py | 13 | 1080 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2010, 2011, 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (a... | gpl-2.0 |
omry/omegaconf | setup.py | 1 | 2119 | # type: ignore
"""
OmegaConf setup
Instructions:
# Build:
rm -rf dist/ omegaconf.egg-info/
python setup.py sdist bdist_wheel
# Upload:
twine upload dist/*
"""
import pathlib
import pkg_resources
import setuptools
from build_helpers.build_helpers import (
ANTLRCommand,
BuildPyCommand,
... | bsd-3-clause |
iain-buclaw-sociomantic/carbon | lib/carbon/carbon_pb2.py | 2 | 4757 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: carbon.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | apache-2.0 |
joequery/django | tests/lookup/models.py | 235 | 2178 | """
The lookup API
This demonstrates features of the database API.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Alarm(models.Model):
desc = models.CharField(max_length=100)
time = mo... | bsd-3-clause |
akloster/bokeh | bokeh/charts/_data_adapter.py | 43 | 8802 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the ChartObject class, a minimal prototype class to build more chart
types on top of it. It provides the mechanisms to support the shared chained
methods.
"""
#-------------------------------------------... | bsd-3-clause |
maheshp/novatest | tools/install_venv_common.py | 18 | 7806 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
# 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.a... | apache-2.0 |
openvapour/ryu | ryu/services/protocols/bgp/api/jsonrpc.py | 24 | 3129 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
Changaco/oh-mainline | vendor/packages/Django/tests/modeltests/invalid_models/invalid_models/models.py | 51 | 30225 | #encoding=utf-8
"""
26. Invalid models
This example exists purely to point out errors in models.
"""
from __future__ import unicode_literals
from django.db import connection, models
class FieldErrors(models.Model):
charfield = models.CharField()
charfield2 = models.CharField(max_length=-1)
charfield3 =... | agpl-3.0 |
CG-F16-16-Rutgers/steersuite-rutgers | steerstats/tools/deap/tools/selection.py | 19 | 7250 | from __future__ import division
import random
from functools import partial
from operator import attrgetter
######################################
# Selections #
######################################
def selRandom(individuals, k):
"""Select *k* individuals at random from the input *indiv... | gpl-3.0 |
zverevalexei/trex-http-proxy | trex_client/external_libs/pyyaml-3.11/python2/yaml/emitter.py | 387 | 43298 |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | mit |
aclevy/vcrpy | vcr/matchers.py | 2 | 2397 | import json
from six.moves import urllib, xmlrpc_client
from .util import CaseInsensitiveDict, read_body
import logging
log = logging.getLogger(__name__)
def method(r1, r2):
return r1.method == r2.method
def uri(r1, r2):
return r1.uri == r2.uri
def host(r1, r2):
return r1.host == r2.host
def schem... | mit |
dmlc/tvm | tests/python/unittest/test_link_params.py | 1 | 15580 | # 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 |
codekaki/odoo | openerp/report/render/makohtml2html/__init__.py | 76 | 1120 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
prologic/fabtools | fabtools/require/shorewall.py | 10 | 7739 | """
Shorewall firewall
==================
"""
from fabric.api import hide, puts, settings, shell_env
from fabric.contrib.files import sed
from fabtools.files import watch
from fabtools.service import start, stop, restart
from fabtools.shorewall import (
Ping,
SSH,
HTTP,
HTTPS,
SMTP,
is_started... | bsd-2-clause |
frohoff/Empire | lib/modules/powershell/collection/inveigh.py | 2 | 10714 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Inveigh',
'Author': ['Kevin Robertson'],
'Description': ('Inveigh is a Windows PowerShell LLMNR/mDNS/NBNS spoofer/man-in-the-middle tool. Note '
... | bsd-3-clause |
sergiohgz/incubator-airflow | airflow/contrib/operators/__init__.py | 8 | 1900 | # -*- 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 |
samsath/django-easydata | setup.py | 2 | 1938 | import os
from setuptools import setup
from setuptools import find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-easydata',
versio... | gpl-3.0 |
snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/python-future/src/libfuturize/fixes/fix_metaclass.py | 61 | 9568 | # coding: utf-8
"""Fixer for __metaclass__ = X -> (future.utils.with_metaclass(X)) methods.
The various forms of classef (inherits nothing, inherits once, inherints
many) don't parse the same in the CST so we look at ALL classes for
a __metaclass__ and if we find one normalize the inherits to all be
an arg... | gpl-3.0 |
MechCoder/sympy | sympy/physics/mechanics/tests/test_lagrange.py | 45 | 9336 | from sympy.physics.mechanics import (dynamicsymbols, ReferenceFrame, Point,
RigidBody, LagrangesMethod, Particle,
inertia, Lagrangian)
from sympy import symbols, pi, sin, cos, tan, simplify, Function, \
Derivative, Matrix
def test_disc_on... | bsd-3-clause |
Fat-Zer/FreeCAD_sf_master | src/Mod/Path/PathScripts/PathUtilsGui.py | 12 | 4259 | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... | lgpl-2.1 |
JohnGriffiths/nipype | nipype/interfaces/fsl/tests/test_auto_InvWarp.py | 9 | 1542 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.utils import InvWarp
def test_InvWarp_inputs():
input_map = dict(absolute=dict(argstr='--abs',
xor=['relative'],
),
args=dict(argstr='%s',
),
environ=dict(nohash=True,
us... | bsd-3-clause |
theo-l/django | django/utils/lorem_ipsum.py | 130 | 4775 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = (
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod '
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim '
'veniam, quis nostrud exercitation ullamco laboris nisi ut aliqu... | bsd-3-clause |
dknlght/dkodi | src/plugin.video.india4movie/resources/lib/api.py | 1 | 4287 | import resources.lib.util as util
import re
from BeautifulSoup import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
from BeautifulSoup import SoupStrainer
class SiteApi():
MAIN_URL = 'http://www.india4movie.com/'
LONG_NAME = 'India 4 Movie'
def get_menu_category(self):
... | gpl-2.0 |
ToontownUprising/src | toontown/coghq/LawbotOfficeDiamondRoom_Battle00_Cogs.py | 10 | 1124 | from SpecImports import *
from toontown.toonbase import ToontownGlobals
CogParent = 10000
BattlePlace1 = 10000
BattleCellId = 0
BattleCells = {BattleCellId: {'parentEntId': BattlePlace1,
'pos': Point3(0, 0, 0)}}
CogData = [{'parentEntId': CogParent,
'boss': 0,
'level': ToontownGlobals.CashbotMintCog... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/lib2to3/tests/test_fixers.py | 27 | 122213 | """ Test suite for the fixer modules """
# Python imports
import os
import unittest
from itertools import chain
from operator import itemgetter
# Local imports
from lib2to3 import pygram, pytree, refactor, fixer_util
from lib2to3.tests import support
class FixerTestCase(support.TestCase):
# Other test cases ca... | mit |
opendatadurban/scoda | scoda/public.py | 1 | 54121 | import itertools
import operator
from sqlalchemy_searchable import search
from scoda.app import app
from flask import request, url_for, redirect, flash, make_response, session, render_template, jsonify, Response, \
send_file
from flask_security import current_user
from itertools import zip_longest
from sqlalchemy... | apache-2.0 |
DickJC123/mxnet | python/mxnet/ndarray/sparse.py | 9 | 63306 | # 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 |
yangalex/Otomata-python | Oto.py | 1 | 12557 | import pygame
# initialize sounds
pygame.mixer.init(buffer=200) # This can be increased for better sound quality, but causes latency (incorrect tempo)
pygame.mixer.set_num_channels(100)
# Set variables used to represent the arrows in each cell
LEFT = ((10, 37.5), (65, 10), (65, 65))
RIGHT = ((10, 10), (10, 65), (65... | mit |
stevenewey/django | tests/template_tests/filter_tests/test_upper.py | 388 | 1245 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import upper
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class UpperTests(SimpleTestCase):
"""
The "upper" filter messes up entities (which a... | bsd-3-clause |
rcosnita/fantastico-todo | todo/__init__.py | 3 | 1065 | '''Copyright 2013 Cosnita Radu Viorel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,... | mit |
tulip-control/tulip-control | tulip/spec/gr1_fragment.py | 1 | 12733 | # Copyright (c) 2014, 2015 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice... | bsd-3-clause |
prheenan/appm_project_2 | util.py | 1 | 2469 | from collections import Counter
import numpy as np
def getKmers(string,kV):
return [ string[i:i+kV] for i in range(0,len(string)-kV+1)]
def getCounters(seqs,kmer,goodIdx):
working = seqs[goodIdx]
# transform the dna into their kmers. Use a counter structure,
# which is much faster. it stored the uniq... | gpl-2.0 |
Ale-/civics | apps/models/migrations/0034_auto_20180110_1120.py | 1 | 1405 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2018-01-10 11:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('models', '0033_auto_20170927_1158'),
]
operations = [
migrations.AlterField... | gpl-3.0 |
gohin/django | tests/raw_query/tests.py | 119 | 12345 | from __future__ import unicode_literals
from datetime import date
from django.db.models.query_utils import InvalidQuery
from django.test import TestCase, skipUnlessDBFeature
from .models import Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, Reviewer
class RawQueryTests(TestCase):
@classmethod
def setUp... | bsd-3-clause |
pseudo-cluster/pseudo-cluster | scripts/pseudo_cluster/statistics_analyzer.py | 1 | 3861 | # -*- coding: utf-8 -*-
import imp
import sys
import gettext
import tasks_list
import metrics
import statistics_plotter
def metric_module_import(metric_name):
"""
импортирует модуль, который
обеспечивает работу с метрикой.
"""
try:
#module=importlib("metrics.metric_"+metric_name)
... | lgpl-2.1 |
catiedev/mbed-os | TESTS/netsocket/host_tests/udp_echo.py | 48 | 3957 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
CapOM/ChromiumGStreamerBackend | tools/telemetry/telemetry/util/perf_tests_results_helper.py | 26 | 5370 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import sys
import json
import math
from telemetry.util import perf_result_data_type
# Mapping from result type to test output
RESULT_TYPES = {p... | bsd-3-clause |
lzweopard/carve | external/gtest-1.5.0/test/gtest_xml_output_unittest.py | 306 | 9711 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
phlizik/xbmctorrent | resources/site-packages/xbmctorrent/tvdb.py | 5 | 7208 | BASE_URL = "http://www.thetvdb.com"
HEADERS = {
"Referer": BASE_URL,
}
API_URL = "%s/api" % BASE_URL
API_KEY = "1D62F2F90030C444"
LANG = "en"
def dom2dict(node):
ret = {}
for child in node:
if len(child):
ret.setdefault(child.tag.lower(), []).append(dom2dict(child))
else:
... | gpl-3.0 |
wolverineav/neutron | neutron/tests/functional/agent/linux/test_process_monitor.py | 21 | 3784 | # Copyright 2014 Red Hat, 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 agre... | apache-2.0 |
EmuxEvans/Wox | PythonHome/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## 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... | mit |
analogdevicesinc/gnuradio | gr-blocks/python/blocks/qa_udp_source_sink.py | 40 | 3667 | #!/usr/bin/env python
#
# Copyright 2008,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | gpl-3.0 |
kschultz1986/robots_for_all | src/navigation/amcl/test/basic_localization.py | 7 | 3176 | #!/usr/bin/env python
import sys
import time
from math import fmod, pi
import unittest
import rospy
import rostest
from tf.msg import tfMessage
from tf.transformations import euler_from_quaternion
from std_srvs.srv import Empty
class TestBasicLocalization(unittest.TestCase):
def setUp(self):
self.tf = ... | gpl-3.0 |
poldracklab/mriqc | mriqc/bin/labeler.py | 1 | 2466 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# @Author: dbirman
# @Date: 2017-06-14 16:51:24
import sys
import csv
import random
import webbrowser
import os
import numpy as np
# other functions
def n... | bsd-3-clause |
goodwinnk/intellij-community | python/lib/Lib/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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,inp... | apache-2.0 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/SocketServer.py | 30 | 23321 | """Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... | gpl-2.0 |
tim-smart/kernel_lge_mako | 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 |
AnhellO/DAS_Sistemas | Ago-Dic-2018/Max/Proyecto Final/Proyect/SqlCrudApi.py | 1 | 1826 | import sqlite3
from ApiClientes import *
from AbstractClassBuilders import *
import sys
#Autor y programador - "Maximiliano García De Santiago"
class SqlCRUDCliente(AbstractProyectClient):
def __init__(self):
self.conexion = sqlite3.connect('ProyectTaco.db')
self.cursor = self.conexion.cursor()
... | mit |
PriceChild/ansible | lib/ansible/modules/network/f5/bigip_routedomain.py | 15 | 16691 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/compressor/js.py | 1 | 2297 | from compressor.conf import settings
from compressor.base import Compressor, SOURCE_HUNK, SOURCE_FILE
class JsCompressor(Compressor):
def __init__(self, content=None, output_prefix="js", context=None):
filters = list(settings.COMPRESS_JS_FILTERS)
super(JsCompressor, self).__init__(content, output... | bsd-3-clause |
adieu/django-nonrel | tests/regressiontests/file_uploads/uploadhandler.py | 9 | 2147 | """
Upload handlers to test the upload API.
"""
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.files.uploadhandler import (FileUploadHandler, StopUpload,
StopFutureHandlers)
from StringIO import StringIO
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload ha... | bsd-3-clause |
falbassini/Samples | python/v2.0/get_userprofiles.py | 3 | 1582 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
xunmengfeng/engine | sky/engine/bindings/scripts/compiler.py | 12 | 6345 | #!/usr/bin/python
# Copyright (C) 2014 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 c... | bsd-3-clause |
SanketDG/networkx | networkx/generators/classic.py | 1 | 20233 | # Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
"""
Generators for some classic graphs.
The typical graph generator is called as follows:
>>> G=nx.complete_graph(100)
returning th... | bsd-3-clause |
affo/nova | tools/install_venv_common.py | 333 | 5959 | # Copyright 2013 OpenStack Foundation
# 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/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
pferreir/indico | indico/modules/events/editing/operations_test.py | 3 | 3736 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import pytest
from indico.modules.events.editing.models.editable import Editable, EditableType
from indic... | mit |
luistorresm/odoo | addons/account_check_writing/report/__init__.py | 446 | 1066 | # -*- 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 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/build/android/pylib/junit/test_runner.py | 1 | 2459 | # Copyright 2014 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.
import json
import os
import tempfile
from devil.utils import cmd_helper
from pylib import constants
from pylib.results import json_results
class JavaTestR... | gpl-3.0 |
hassoon3/odoo | addons/website_mail_group/models/mail_group.py | 321 | 2678 | # -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp import tools
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.addons.website.models.website import slug
class MailGroup(osv.Model):
_inherit = 'mail.group'
def message_get_email_values(sel... | agpl-3.0 |
jetty840/ReplicatorG | skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/analyze_plugins/analyze_utilities/zoom_in.py | 8 | 1715 | """
This page is in the table of contents.
Zoom in is a mouse tool to zoom in the display at the point where the mouse was clicked, increasing the scale by a factor of two.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports... | gpl-2.0 |
gymnasium/xblock-leaderboard | leaderboards/tests/integration/test_forum.py | 3 | 1247 | from ddt import ddt, unpack, data
from selenium.common.exceptions import NoSuchElementException
from urlparse import urlparse
from xblockutils.base_test import SeleniumBaseTest
from .forum_scenarios import forum_scenarios
@ddt
class LeaderboardTestCase(SeleniumBaseTest):
module_name = __name__
default_css_sel... | agpl-3.0 |
Badg/py_hypergolix | hypergolix/lawyer.py | 2 | 7975 | '''
LICENSING
-------------------------------------------------
hypergolix: A python Golix client.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
Nick Badger
badg@muterra.io | badg@nickbadger.com | nickbadger.com
This library is free software; you can redistribute it and/o... | unlicense |
Integral-Technology-Solutions/ConfigNOW-4.3 | Lib/xml/dom/TreeWalker.py | 3 | 6802 | ########################################################################
#
# File Name: TreeWalker.py
#
# Documentation: http://docs.4suite.com/4DOM/TreeWalker.py.html
#
"""
Tree Walker from DOM Level 2. Allows multi-directional iteration over nodes.
WWW: http://4suite.com/4DOM e-mail: suppor... | mit |
rameshvs/nipype | nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py | 5 | 5518 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.registration.brainsfit import BRAINSFit
def test_BRAINSFit_inputs():
input_map = dict(NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00=dict(argstr='--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 ',
),
... | bsd-3-clause |
GbalsaC/bitnamiP | common/lib/capa/capa/customrender.py | 104 | 5661 | """
This has custom renderers: classes that know how to render certain problem tags (e.g. <math> and
<solution>) to html.
These tags do not have state, so they just get passed the system (for access to render_template),
and the xml element.
"""
import logging
import re
from cgi import escape as cgi_escape
from lxml ... | agpl-3.0 |
DanteOnline/free-art | venv/lib/python3.4/site-packages/pip/_vendor/colorama/initialise.py | 485 | 1917 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import contextlib
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = None
orig_stderr = None
wrapped_stdout = None
wrapped_stderr = None
atexit_done = False
def reset_all():
if AnsiToWin32 is not None: # Is... | gpl-3.0 |
abtink/openthread | tools/harness-automation/cases_R140/router_5_3_11.py | 18 | 1878 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
t-k-/beautiful-soup | bs4/dammit.py | 408 | 29302 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... | mit |
koparasy/faultinjection-gem5 | src/arch/x86/isa/insts/simd128/floating_point/data_transfer/__init__.py | 91 | 2383 | # 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 |
mwindau/praktikum | v351/dreieck.py | 1 | 1188 | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import linregress
from scipy.optimize import curve_fit
oberwelle3, amplitude3 = np.genfromtxt('Rohdaten/dreieckspannung.txt',unpack=True)
plt.plot(oberwelle3, amplitude3,'k.',label="Messdaten")
#plt.legend(loc='best')
plt.grid()
#plt.xlim(0,1.5)
plt.x... | mit |
FHannes/intellij-community | python/lib/Lib/compiler/symbols.py | 100 | 14538 | """Module symbol-table generator"""
from compiler import ast
from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, SC_UNKNOWN
from compiler.misc import mangle
import types
import sys
MANGLE_LEN = 256
class Scope:
# XXX how much information do I need about each name?
def __init__(self, name, mo... | apache-2.0 |
mdrumond/tensorflow | tensorflow/tools/dist_test/python/mnist_replica.py | 44 | 10714 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
internaphosting/netman | tests/adapters/unified_tests/ip_management_test.py | 3 | 5621 | # Copyright 2015 Internap.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
sahildua2305/eden | modules/hs/utils/dictionary.py | 50 | 1538 | class Dictionary (dict):
def __init__ (self):
self._keys = []
#self._sorted = True
dict.__init__(self)
def keys (self):
return self._keys
def update (self, pairs):
try:
for key, value in pairs.iteritems ():
if not self.has_key (key):
... | mit |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/bgp_service_communities_operations.py | 1 | 4225 | # 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 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings_py3.py | 7 | 1386 | # 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 |
sss/calibre-at-bzr | src/calibre/ebooks/rtf2xml/preamble_div.py | 24 | 22931 | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | gpl-3.0 |
samthor/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/shell32.py | 102 | 14007 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... | apache-2.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | tools/gyp/test/mac/gyptest-postbuild-fail.py | 88 | 2218 | #!/usr/bin/env python
# Copyright (c) 2011 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 that a failing postbuild step lets the build fail.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# set |match... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.