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 |
|---|---|---|---|---|---|
Just-D/chromium-1 | tools/telemetry/third_party/gsutilz/third_party/protorpc/gen_protorpc.py | 44 | 9886 | #!/usr/bin/env python
#
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
gardner/urllib3 | test/test_filepost.py | 27 | 4190 | import unittest
from urllib3.filepost import encode_multipart_formdata, iter_fields
from urllib3.fields import RequestField
from urllib3.packages.six import b, u
BOUNDARY = '!! test boundary !!'
class TestIterfields(unittest.TestCase):
def test_dict(self):
for fieldname, value in iter_fields(dict(a='b... | mit |
GladeRom/android_external_chromium_org | third_party/jinja2/nodes.py | 623 | 28875 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... | bsd-3-clause |
stefan-caraiman/python-lab | python/solutii/micu_matei/sync/sync.py | 7 | 6480 | #!/usr/bin/env python
"""
Syncronizam doua fisiere
"""
from __future__ import print_function
import os
import argparse
import shutil
from functii_auxiliare import get_hash
from functii_auxiliare import get_last_edit
from functii_auxiliare import write_sync_file
from functii_auxiliare import read_sync_file
from functii_... | mit |
dpac-vlsi/SynchroTrace | tests/quick/se/20.eio-short/test.py | 19 | 1766 | # Copyright (c) 2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
SymbiFlow/edalize | edalize/xsim.py | 1 | 5680 | # Copyright edalize contributors
# Licensed under the 2-Clause BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-2-Clause
import os
import logging
from collections import OrderedDict
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Xsim(Edatool):
argtypes = ['pl... | bsd-2-clause |
shrids/kubernetes | build/json-extractor.py | 413 | 2111 | #!/usr/bin/env python
# Copyright 2014 The Kubernetes 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
#
# Unle... | apache-2.0 |
piagarwal11/GDriveLinuxClient | src/watchdog-0.8.2/src/watchdog/tricks/__init__.py | 11 | 5177 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | mit |
dogukantufekci/workplace_saas | workplace_saas/_apps/companies/models.py | 2 | 2644 | from django.db import models
from countries.models import Country
from people.models import Person
# Models -----------------------------------------
class Company(models.Model):
SOLE_TRADER = 1
CORPORATION = 2
TYPE_CHOICES = (
(SOLE_TRADER, 'Sole Trader'),
(CORPORATION, 'Corporation'),... | mit |
Comikris/Assignment_Interpreter | FileManagement/filehandler.py | 1 | 7873 | from FileManagement.interface_filehandler import *
# Brendan
import pickle
import os
import sys
import math
# kate
import re
from datetime import *
# Kris Little design
class FileHandler(IFileHandler):
def __init__(self):
self.valid = True
# Kris
def load_file(self, file):
... | apache-2.0 |
swfly/StreamCoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
chouseknecht/openshift-restclient-python | openshift/test/test_v1_security_context_constraints.py | 1 | 4347 | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | apache-2.0 |
rabipanda/tensorflow | tensorflow/contrib/py2tf/pyct/templates_test.py | 2 | 2067 | # 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 |
afrantzis/pixel-format-guide | tests/pfgtest.py | 1 | 3257 | # Copyright © 2017 Collabora Ltd.
#
# This file is part of pfg.
#
# pfg 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.
#
# pf... | lgpl-2.1 |
ypwalter/fxos-certsuite | mcts/webapi_tests/telephony/test_telephony_outgoing.py | 6 | 2891 | # 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 http://mozilla.org/MPL/2.0/.
import time
from mcts.webapi_tests.semiauto import TestCase
from mcts.webapi_tests.telephony import TelephonyTestCommon... | mpl-2.0 |
Batterfii/django | django/contrib/gis/maps/google/overlays.py | 151 | 11955 | from __future__ import unicode_literals
from functools import total_ordering
from django.contrib.gis.geos import (
LinearRing, LineString, Point, Polygon, fromstr,
)
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import html_safe
@html_safe
@pyt... | bsd-3-clause |
EricCline/CEM_inc | env/lib/python2.7/site-packages/south/tests/logic.py | 127 | 33513 | from south.tests import unittest
import datetime
import sys
try:
set # builtin, python >=2.6
except NameError:
from sets import Set as set # in stdlib, python >=2.3
from south import exceptions
from south.migration import migrate_app
from south.migration.base import all_migrations, Migrations
from south.creat... | mit |
GioneeDevTeam/android_kernel_gionee_msm8974 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
Coder-Yu/RecQ | algorithm/ranking/BPR.py | 2 | 5528 | #coding:utf8
from baseclass.IterativeRecommender import IterativeRecommender
from random import choice
from tool.qmath import sigmoid
from math import log
from collections import defaultdict
#import tensorflow as tf
class BPR(IterativeRecommender):
# BPR:Bayesian Personalized Ranking from Implicit Feedback
# S... | gpl-3.0 |
yatinkumbhare/openstack-nova | tools/regression_tester.py | 101 | 3538 | #!/usr/bin/env python
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | apache-2.0 |
uni-peter-zheng/tp-qemu | qemu/tests/openflow_acl_test.py | 2 | 18485 | import logging
import re
import os
from autotest.client.shared import error
from autotest.client.shared import utils
from virttest import utils_net, utils_test, utils_misc
from virttest import aexpect
from virttest import remote
from virttest import data_dir
@error.context_aware
def run(test, params, env):
"""
... | gpl-2.0 |
HLFH/CouchPotatoServer | libs/suds/builder.py | 197 | 4220 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
ashutosh-mishra/youtube-dl | youtube_dl/extractor/jeuxvideo.py | 1 | 1985 | # coding: utf-8
import json
import re
import xml.etree.ElementTree
from .common import InfoExtractor
class JeuxVideoIE(InfoExtractor):
_VALID_URL = r'http://.*?\.jeuxvideo\.com/.*/(.*?)-\d+\.htm'
_TEST = {
u'url': u'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-... | unlicense |
getnikola/plugins | v7/mistune/mistune.py | 1 | 3824 | # -*- coding: utf-8 -*-
# Copyright © 2014 Roberto Alsina and others.
# 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... | mit |
RNAer/qiita | qiita_db/reference.py | 2 | 6342 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/conf/locale/nb/formats.py | 504 | 1766 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | gpl-3.0 |
AthinaB/synnefo | snf-astakos-app/astakos/api/user.py | 4 | 11741 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
adw0rd/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/transactions/tests_25.py | 51 | 5306 | from __future__ import with_statement
from django.db import connection, transaction, IntegrityError
from django.test import TransactionTestCase, skipUnlessDBFeature
from models import Reporter
class TransactionContextManagerTests(TransactionTestCase):
def create_reporter_and_fail(self):
Reporter.objects... | gpl-3.0 |
wpoa/wiki-imports | lib/python2.7/site-packages/mwparserfromhell/nodes/extras/__init__.py | 1 | 1389 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... | gpl-3.0 |
botswana-harvard/edc-pharma | edc_pharmacy/old/dispense/prescription_creator.py | 1 | 3055 | from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from ..medications import medications
from ..models import Prescription, MedicationDefinition
class PrescriptionCreator:
"""Creates all prescription records after completing patient history model.
"""
def __init__(self, ... | gpl-2.0 |
alabid/pycrunchbase | tests/test_node.py | 3 | 1070 | from unittest import TestCase
import json
from pycrunchbase.resource.node import Node
from pycrunchbase.resource.utils import parse_date
class TestNode(Node):
KNOWN_PROPERTIES = ['property1', 'property2']
def _coerce_values(self):
# intentionally coerce bad values for test purposes
attr = '... | mit |
b0ttl3z/SickRage | lib/synchronousdeluge/transfer.py | 114 | 1346 | import zlib
import struct
import socket
import ssl
from synchronousdeluge import rencode
__all__ = ["DelugeTransfer"]
class DelugeTransfer(object):
def __init__(self):
self.sock = None
self.conn = None
self.connected = False
def connect(self, hostport):
if self.connected:
... | gpl-3.0 |
jymannob/CouchPotatoServer | libs/subliminal/services/thesubdb.py | 107 | 2775 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 3 of... | gpl-3.0 |
shangwuhencc/scikit-learn | examples/cluster/plot_kmeans_stability_low_dim_dense.py | 338 | 4324 | """
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... | bsd-3-clause |
inetCatapult/troposphere | troposphere/policies.py | 20 | 1033 | from . import AWSProperty, AWSAttribute, validate_pausetime
from .validators import positive_integer, integer, boolean
class AutoScalingRollingUpdate(AWSProperty):
props = {
'MaxBatchSize': (positive_integer, False),
'MinInstancesInService': (integer, False),
'PauseTime': (validate_pauseti... | bsd-2-clause |
cabe56/bookmarks | vendor/requests/models.py | 277 | 26436 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | gpl-2.0 |
bakerlover/lab5 | main/admin.py | 7 | 2264 | # -*- coding: utf-8 -*-
from flask.ext import wtf
from google.appengine.api import app_identity
import flask
import auth
import util
import model
import config
from main import app
class ConfigUpdateForm(wtf.Form):
analytics_id = wtf.StringField('Analytics ID', filters=[util.strip_filter])
announcement_html = ... | mit |
tensorflow/federated | tensorflow_federated/python/simulation/baselines/cifar100/__init__.py | 1 | 1147 | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
kk7ds/luvs | unifi_stream_server.py | 1 | 8384 | import asyncio
import aiohttp
from aiohttp import web
import logging
from logging import handlers
import signal
import socket
import time
import unifi_ws_server
class StreamerContext(object):
pass
class RequestHandler(aiohttp.server.ServerHttpProtocol):
def __init__(self, **kwargs):
self._log = kwar... | gpl-3.0 |
RuudBurger/CouchPotatoServer | couchpotato/core/media/movie/providers/metadata/wdtv.py | 39 | 7626 | from xml.etree.ElementTree import Element, SubElement, tostring
import os
import re
import traceback
import xml.dom.minidom
from couchpotato.core.media.movie.providers.metadata.base import MovieMetaData
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import getTitle
from ... | gpl-3.0 |
k1203/meeting | public/app/assets/plugins/vector-map/converter/simplifier.py | 234 | 5985 | import argparse
import sys
import os
from osgeo import ogr
from osgeo import osr
import anyjson
import shapely.geometry
import shapely.ops
import codecs
import time
format = '%.8f %.8f'
tolerance = 0.01
infile = '/Users/kirilllebedev/Maps/50m-admin-0-countries/ne_50m_admin_0_countries.shp'
outfile = 'map.shp'
# Open... | mit |
aequitas/home-assistant | tests/components/zha/test_switch.py | 7 | 2904 | """Test zha switch."""
from unittest.mock import call, patch
from homeassistant.components.switch import DOMAIN
from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNAVAILABLE
from tests.common import mock_coro
from .common import (
async_init_zigpy_device, make_attribute, make_entity_id,
async_test_devi... | apache-2.0 |
secretsquirrel/the-backdoor-factory | osslsigncode/misc/pagehash.py | 7 | 3180 | #!/usr/bin/python
import struct
import sys
import hashlib
from pyasn1.type import univ
from pyasn1.codec.ber import encoder, decoder
f = open(sys.argv[1], 'rb')
filehdr = f.read(1024)
if filehdr[0:2] != 'MZ':
print "Not a DOS file."
sys.exit(0)
pepos = struct.unpack('<I', filehdr[60:64])[0]
if filehdr[pepos:p... | bsd-3-clause |
kosz85/django | django/db/models/sql/query.py | 1 | 92537 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | bsd-3-clause |
ryancanhelpyou/servo | tests/wpt/update/upstream.py | 43 | 13551 | import os
import re
import subprocess
import sys
import urlparse
from wptrunner.update.sync import LoadManifest
from wptrunner.update.tree import get_unique_name
from wptrunner.update.base import Step, StepRunner, exit_clean, exit_unclean
from .tree import Commit, GitTree, Patch
import github
from .github import GitH... | mpl-2.0 |
bigplus/thefuck | thefuck/rules/dirty_unzip.py | 5 | 1044 | import os
import zipfile
from thefuck.utils import for_app
def _is_bad_zip(file):
with zipfile.ZipFile(file, 'r') as archive:
return len(archive.namelist()) > 1
def _zip_file(command):
# unzip works that way:
# unzip [-flags] file[.zip] [file(s) ...] [-x file(s) ...]
# ^ ... | mit |
daevaorn/sentry | src/sentry/migrations/0026_auto__add_field_project_status.py | 36 | 11026 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Project.status'
db.add_column('sentry_project', 'status', self.gf('django.db.models.fields.Positiv... | bsd-3-clause |
tbeadle/django | tests/prefetch_related/test_prefetch_related_objects.py | 35 | 4734 | from django.db.models import Prefetch, prefetch_related_objects
from django.test import TestCase
from .models import Author, Book, Reader
class PrefetchRelatedObjectsTests(TestCase):
"""
Since prefetch_related_objects() is just the inner part of
prefetch_related(), only do basic tests to ensure its API h... | bsd-3-clause |
huang4fstudio/django | tests/forms_tests/tests/test_fields.py | 5 | 86091 | # -*- coding: utf-8 -*-
"""
##########
# Fields #
##########
Each Field class does some sort of validation. Each Field has a clean() method,
which either raises django.forms.ValidationError or returns the "clean"
data -- usually a Unicode object, but, in some rare cases, a list.
Each Field's __init__() takes at least... | bsd-3-clause |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/universaldetector.py | 200 | 6664 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
Alwnikrotikz/l5rcm | dialogs/managedatapack.py | 3 | 5873 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2011 Daniele Simonetti
#
# 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 the License, or
# (at your option) any later versi... | gpl-3.0 |
dbaxa/django | tests/model_regress/models.py | 281 | 2293 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
CHOICES = (
(1, 'first'),
(2, 'second'),
)
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100, defa... | bsd-3-clause |
brianrock/brianrock-ringo | handlers/poll.py | 1 | 7906 | # Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
crowdata/crowdata | crowdataapp/migrations/0020_auto__add_field_documentset_header_image.py | 2 | 12999 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DocumentSet.header_image'
db.add_column(u'crowdataapp_documentset', 'header_image',
... | mit |
scenarios/tensorflow | tensorflow/python/ops/logging_ops.py | 10 | 13502 | # 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 |
lopopolo/hyperbola | hyperbola/urls.py | 1 | 1226 | """
hyperbola URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | mit |
SergeyPirogov/selene | tests/integration/inner_selement_waiting_search_on_actions_like_click_test.py | 1 | 4742 | import pytest
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selene import config
from selene.common.none_object import NoneObject
from selene.driver import SeleneDriver
from tests.acceptance.helpers.helper import get_test_driver
from tests.integration.helpers.givenpage imp... | mit |
mitre/multiscanner | multiscanner/tests/test_parse_reports.py | 2 | 1531 | # -*- coding: utf-8 -*-
import multiscanner
def test_valid_reports_string():
reportlist = [([('file', 'result')], {'Name': 'Test', 'Type': 'Test'})]
r = multiscanner.parse_reports(reportlist, python=False)
assert r == '{"file":{"Test":"result"}}'
def test_valid_reports_python():
reportlist = [([('fi... | mpl-2.0 |
bsmrstu-warriors/Moytri---The-Drone-Aider | Lib/lib2to3/pgen2/driver.py | 98 | 4694 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | gpl-3.0 |
ddurst/zamboni | manage.py | 17 | 2113 | #!/usr/bin/env python
import logging
import os
import sys
from django.core.management import execute_from_command_line
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
if len(sys.argv) > 1 and sys.argv[1] == 'test':
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_test'
else:
os.environ.setdefau... | bsd-3-clause |
ldesousa/pywps-4-demo | docs/conf.py | 3 | 10208 | # -*- coding: utf-8 -*-
#
# PyWPS-Flask documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 11 21:27:33 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | mit |
rjschwei/WALinuxAgent | azurelinuxagent/common/utils/restutil.py | 1 | 18482 | # Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft 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 b... | apache-2.0 |
gregdek/ansible | lib/ansible/modules/packaging/os/apk.py | 82 | 11119 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Kevin Brebanov <https://github.com/kbrebanov>
# Based on pacman (Afterburn <https://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>)
# and apt (Matthew Williams <matthew@flowroute.com>) modules.
#
# GNU General Public License v3.0+ (see COPYING or... | gpl-3.0 |
blaze/dask | dask/base.py | 1 | 37839 | from collections import OrderedDict
from collections.abc import Mapping, Iterator
from contextlib import contextmanager
from functools import partial
from hashlib import md5
from operator import getitem
import inspect
import pickle
import os
import threading
import uuid
from distutils.version import LooseVersion
from ... | bsd-3-clause |
sjohannes/exaile | xl/player/__init__.py | 3 | 1566 | # Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
SDSG-Invenio/invenio | invenio/modules/messages/testsuite/test_messages.py | 15 | 5465 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2009, 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 (at your... | gpl-2.0 |
Mythirion/VirtualRobot | requests/packages/urllib3/fields.py | 1007 | 5833 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... | mit |
ccn-2m/django | django/contrib/localflavor/be/forms.py | 194 | 2910 | """
Belgium-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.be.be_provinces import PROVINCE_CHOICES
from django.contrib.localflavor.be.be_regions import REGION_CHOICES
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy... | bsd-3-clause |
alessandro-aglietti/rosdep | src/rosdep2/catkin_support.py | 7 | 4024 | """
Helper routines for catkin. These are distributed inside of rosdep2
to protect catkin against future rosdep2 API updatese. These helper
routines are assumed to run in an interactive mode with an end-user
and thus return end-user oriented error messages.
Errors are returned as arguments to raised :exc:`Validation... | bsd-3-clause |
mammique/django | django/template/loaders/filesystem.py | 225 | 1851 | """
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, temp... | bsd-3-clause |
AndroidOpenDevelopment/android_external_chromium_org | tools/idl_parser/idl_lexer_test.py | 116 | 2758 | #!/usr/bin/env python
# Copyright (c) 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 unittest
from idl_lexer import IDLLexer
from idl_ppapi_lexer import IDLPPAPILexer
#
# FileToTokens
#
# From a source file ... | bsd-3-clause |
rversteegen/commandergenius | project/jni/python/src/Lib/lib2to3/pgen2/tokenize.py | 52 | 16184 | # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | lgpl-2.1 |
gioman/QGIS | python/plugins/processing/algs/examplescripts/ProcessingExampleScriptsPlugin.py | 9 | 1441 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : May 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | gpl-2.0 |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/test/test_pow.py | 177 | 4593 | import test.support, unittest
class PowTest(unittest.TestCase):
def powtest(self, type):
if type != float:
for i in range(-1000, 1000):
self.assertEqual(pow(type(i), 0), 1)
self.assertEqual(pow(type(i), 1), type(i))
self.assertEqual(pow(type(0), ... | lgpl-3.0 |
salomanders/NbodyPythonTools | nbdpt/nchiladareader.py | 1 | 4326 | import numpy as np
import glob
import struct
import pdb
import re
class Nchilada(object):
def __init__(self, filename):
self.codedict = {1: 'int8',
2: 'uint8',
3: 'int16',
4: 'uint16',
5: 'int32',
... | mit |
fanwenl/kindle-image | alien_invasion/setting.py | 1 | 1456 | """ 该文件是游戏的一些设置选项 """
class Settings():
""" 存储游戏的所有设置的类 """
def __init__(self):
""" 初始化游戏的设置 """
self.screen_width = 1920
self.screen_height = 900
self.bg_color = (230, 230, 230)
# 飞船设置
self.ship_limit = 3
# 设置子弹
self.bullet_width = 3
se... | apache-2.0 |
tima/ansible | lib/ansible/modules/network/nxos/nxos_system.py | 31 | 11749 | #!/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 |
40223245/2015cdb_g6-team1 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_program.py | 738 | 10833 | import io
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
... | gpl-3.0 |
henridwyer/scikit-learn | examples/covariance/plot_covariance_estimation.py | 250 | 5070 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | bsd-3-clause |
rue89-tech/edx-analytics-pipeline | edx/analytics/tasks/util/tests/test_opaque_key_util.py | 3 | 5866 | """
Tests for utilities that parse event logs.
"""
from opaque_keys.edx.locator import CourseLocator
import edx.analytics.tasks.util.opaque_key_util as opaque_key_util
from edx.analytics.tasks.tests import unittest
VALID_COURSE_ID = unicode(CourseLocator(org='org', course='course_id', run='course_run'))
VALID_LEGAC... | agpl-3.0 |
poppu-mtg/StackIt | StackIt/GUIapp.py | 1 | 4165 | import os, shutil, sys, time
from . import globals, builder
if sys.version_info.major == 3:
from tkinter import *
else:
from Tkinter import *
# from tkFileDialog import *
from PIL import Image, ImageTk
class ScrollIt():
def __init__(self):
self.image1 = Image.open(mGui.btn2text.get()[9:] + '-sc... | mit |
ofer43211/unisubs | apps/teams/migrations/0102_auto__add_billingreport.py | 5 | 30439 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'BillingReport'
db.create_table('teams_billingreport', (
('end_date', self.... | agpl-3.0 |
BeegorMif/HTPC-Manager | lib/sqlalchemy/event/api.py | 75 | 3844 | # event/api.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
"""Public API functions for the event system.
"""
from __future__ import absolute_import... | gpl-3.0 |
jendap/tensorflow | tensorflow/python/ops/stateless_random_ops.py | 8 | 11692 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kustodian/ansible | lib/ansible/module_utils/network/ftd/fdm_swagger_client.py | 19 | 26649 | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | gpl-3.0 |
vc3-project/vc3-info-service | vc3infoservice/core.py | 1 | 11353 | #!/bin/env python
__author__ = "John Hover"
__copyright__ = "2017 John Hover"
__credits__ = []
__license__ = "GPL"
__version__ = "0.9.1"
__maintainer__ = "John Hover"
__email__ = "jhover@bnl.gov"
__status__ = "Production"
import logging
import random
import string
class InfoConnectionFailure(Exception):
'''
... | gpl-3.0 |
2013Commons/hue | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Prof.py | 37 | 75689 | #._cv_part guppy.heapy.Prof
from Tkinter import *
import tkFileDialog
import tkMessageBox
class MyVar(StringVar):
_default = 0.0
def set(self, value):
StringVar.set(self, '%.2g'%value)
suffixes = ('','K','M','G','T')
def sizestring(value):
value = float(value)
sign = 1
if value < 0:
sign = -1... | apache-2.0 |
jp-bpl/configuration | util/vpc-tools/tag-old-ebs.py | 62 | 7679 | """
For a given aws account, go through all un-attached volumes and tag them.
"""
import boto
import boto.utils
import argparse
import logging
import subprocess
import time
import os
from os.path import join, exists, isdir, islink, realpath, basename, dirname
import yaml
# needs to be pip installed
import netaddr
LO... | agpl-3.0 |
lucidfrontier45/scikit-learn | examples/covariance/plot_covariance_estimation.py | 2 | 4991 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
The usual estimator for covariance is the maximum likelihood estimator,
:class:`sklearn.covariance.Em... | bsd-3-clause |
sorgerlab/bioagents | bioagents/tests/test_model_diagnoser.py | 2 | 2836 | from indra.statements import *
from bioagents.mra.model_diagnoser import ModelDiagnoser
from indra.assemblers.pysb import PysbAssembler
from nose.plugins.attrib import attr
drug = Agent('PLX4720')
raf = Agent('RAF', db_refs={'FPLX': 'RAF'})
mek = Agent('MEK', db_refs={'FPLX': 'MEK'})
erk = Agent('ERK', db_refs={'FPLX... | bsd-2-clause |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/idlelib/CallTips.py | 43 | 7941 | """CallTips.py - An IDLE Extension to Jog Your Memory
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import re
import sys
import types
from idlelib import C... | apache-2.0 |
felixma/nova | nova/api/openstack/compute/schemas/fixed_ips.py | 79 | 1027 | # Copyright 2015 Intel Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
apache/airflow | airflow/providers/google/cloud/example_dags/example_translate_speech.py | 3 | 3196 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
fusionpig/ansible | v1/tests/TestSynchronize.py | 103 | 6958 |
import unittest
import getpass
import os
import shutil
import time
import tempfile
from nose.plugins.skip import SkipTest
from ansible.runner.action_plugins.synchronize import ActionModule as Synchronize
class FakeRunner(object):
def __init__(self):
self.connection = None
self.transport = None
... | gpl-3.0 |
danakj/chromium | tools/grit/grit/format/chrome_messages_json_unittest.py | 23 | 3612 | #!/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.
"""Unittest for chrome_messages_json.py.
"""
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.pat... | bsd-3-clause |
sadaf2605/django | django/db/models/sql/subqueries.py | 9 | 8284 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.query_utils import Q
from django.db.models.sql.constants import (
CURSOR, GET_ITERATOR_CHUNK_SIZE, NO_RESULTS,
)
from django... | bsd-3-clause |
cmeon/AndyImage | andy_image_resize.py | 1 | 1293 | #!/usr/bin/env python
import sys
from os import path, mkdir
from vipsCC import *
sizes = { 'ldpi':3, 'mdpi':4, 'hdpi':6, 'xhdpi':8, 'xxhdpi':12, 'xxxhdpi':16 }
if ( len(sys.argv) < 2):
print """
(H)Andy Image Resize
-----------------------------------
This program resizes images into ldpi to xxxhdpi
** I... | mit |
HexHive/datashield | compiler/llvm/utils/lit/lit/ShCommands.py | 87 | 2696 | class Command:
def __init__(self, args, redirects):
self.args = list(args)
self.redirects = list(redirects)
def __repr__(self):
return 'Command(%r, %r)' % (self.args, self.redirects)
def __eq__(self, other):
if not isinstance(other, Command):
return False
... | gpl-3.0 |
BizzCloud/PosBox | addons/marketing_campaign_crm_demo/__openerp__.py | 119 | 1675 | # -*- 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 |
vitaly-krugl/pika | pika/heartbeat.py | 1 | 8261 | """Handle AMQP Heartbeats"""
import logging
import pika.exceptions
from pika import frame
LOGGER = logging.getLogger(__name__)
class HeartbeatChecker(object):
"""Sends heartbeats to the broker. The provided timeout is used to
determine if the connection is stale - no received heartbeats or
other activit... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.