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 |
|---|---|---|---|---|---|
sunlianqiang/kbengine | kbe/src/lib/python/Lib/idlelib/IOBinding.py | 70 | 19745 | import os
import types
import shlex
import sys
import codecs
import tempfile
import tkinter.filedialog as tkFileDialog
import tkinter.messagebox as tkMessageBox
import re
from tkinter import *
from tkinter.simpledialog import askstring
from idlelib.configHandler import idleConf
from codecs import BOM_UTF8
# Try sett... | lgpl-3.0 |
ilexius/odoo | addons/website_project_issue/tests/test_access_rights.py | 45 | 6654 | # -*- coding: utf-8 -*-
from openerp.addons.project.tests.test_access_rights import TestPortalProjectBase
from openerp.exceptions import AccessError
from openerp.tools import mute_logger
class TestPortalProjectBase(TestPortalProjectBase):
def setUp(self):
super(TestPortalProjectBase, self).setUp()
... | gpl-3.0 |
lightcn/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py | 384 | 4146 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
ray-project/ray | python/ray/autoscaler/_private/aliyun/node_provider.py | 1 | 12663 | import random
import threading
from collections import defaultdict
import logging
import time
from typing import Any, Dict, List, Optional
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, TAG_RAY_NODE_NAME, \
TAG_RAY_LAUNCH_CONFIG, TAG_RAY_NODE_KIND, \
... | apache-2.0 |
dkubiak789/odoo | addons/payment_ogone/data/ogone.py | 395 | 30321 | # -*- coding: utf-8 -*-
OGONE_ERROR_MAP = {
'0020001001': "Authorization failed, please retry",
'0020001002': "Authorization failed, please retry",
'0020001003': "Authorization failed, please retry",
'0020001004': "Authorization failed, please retry",
'0020001005': "Authorization failed, please ret... | agpl-3.0 |
louisswarren/hieretikz | drinkerclass.py | 1 | 6686 | import subprocess
from hierarchyclass import *
from tikzify import *
formulae = 'tt lem wlem dgp glpoa gmp dp he dnsu dnse ud'.split()
globals().update({f: f for f in formulae})
efq = 'efq'
globals().update({future: future for future in
'dpn glpon mgmp glpon'.split()})
# These are actually equivalent.
ip = he
glpo ... | mit |
waynegm/OpendTect-External-Attributes | Python_3/Filtering/ex_prewitt.py | 3 | 1093 | # Prewitt External Attribute
import sys,os
import numpy as np
from scipy.ndimage import prewitt
sys.path.insert(0, os.path.join(sys.path[0], '..'))
import extattrib as xa
xa.params = {
'Inputs': ['Input'],
'Output' : ['Average Gradient', 'In-line gradient', 'Cross-line gradient', 'Z gradient'],
'ZSampMargin' : {'Va... | mit |
josenavas/QiiTa | qiita_pet/test/test_download.py | 1 | 13165 | # -----------------------------------------------------------------------------
# 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 |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/urbansim_parcel/job_x_building/same_sector_employment_in_building.py | 2 | 2096 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.abstract_variables.abstract_number_of_agents_with_same_attribute_value import abstract_number_of_agents_with_same_attribute_value
class same_sector_employment_in_building(abstract... | gpl-2.0 |
mrf345/FQM | migrations/versions/b41c62db00a1_.py | 1 | 1488 | """ Convert printer `vendor` and `product` to int type. And add `name`.
Revision ID: b41c62db00a1
Revises: d37b1524c3fc
Create Date: 2020-06-06 16:49:00.859545
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b41c62db00a1'
down_revision = 'd37b1524c3fc'
branch... | mpl-2.0 |
AOKP/external_chromium_org | ppapi/c/documentation/doxy_cleanup.py | 177 | 4451 | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''This utility cleans up the html files as emitted by doxygen so
that they are suitable for publication on a Google documentation sit... | bsd-3-clause |
valmynd/MediaFetcher | src/plugins/youtube_dl/test/test_compat.py | 1 | 5072 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import (
compat_getenv,
compat_setenv,
compat_etree_fromstring,
compa... | gpl-3.0 |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/porn91.py | 40 | 1888 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/.+?\?viewkey=(?P<id>[\w\d]+)'
_TE... | gpl-3.0 |
jshum/dd-agent | tests/checks/mock/test_supervisord.py | 37 | 18752 | # stdlib
from socket import socket
import unittest
import xmlrpclib
# 3p
from mock import patch
# project
from checks import AgentCheck
from tests.checks.common import get_check
class TestSupervisordCheck(unittest.TestCase):
TEST_CASES = [{
'yaml': """
init_config:
instances:
- name: server1
... | bsd-3-clause |
Scalr/libcloud | libcloud/storage/drivers/atmos.py | 12 | 17006 | # 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 use ... | apache-2.0 |
haeusser/tensorflow | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_composition_test.py | 13 | 8641 | # 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 |
PLyczkowski/Sticky-Keymap | 2.74/python/lib/encodings/cp866.py | 272 | 34396 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.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_map)
def decode(self,input,errors='strict'):
... | gpl-2.0 |
oblitum/ycmd | cpp/ycm/tests/gmock/scripts/upload_gmock.py | 770 | 2833 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
BT-ojossen/stock-logistics-workflow | __unported__/stock_sale_filters/stock.py | 33 | 2395 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Alexandre Fayolle
# Copyright 2012 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
# p... | agpl-3.0 |
richardnpaul/FWL-Website | lib/python2.7/site-packages/django/contrib/auth/tests/management.py | 97 | 9156 | from __future__ import unicode_literals
from datetime import date
from django.contrib.auth import models, management
from django.contrib.auth.management import create_permissions
from django.contrib.auth.management.commands import changepassword
from django.contrib.auth.models import User
from django.contrib.auth.test... | gpl-3.0 |
aventuri/opencaster | code/libs/dvbobjects/dvbobjects/PSI/MGT.py | 5 | 2405 | #! /usr/bin/env python
# This file is part of the dvbobjects library.
#
# Copyright 2010-2013 Lorenzo Pallara l.pallara@avalpa.com
#
# 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 vers... | gpl-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.5/tests/regressiontests/generic_views/dates.py | 50 | 31477 | from __future__ import absolute_import
import time
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import timezone
from django.utils.unittest import skipUnless
from .models import Book, BookSign... | mit |
hpi-xnor/BMXNet | python/mxnet/ndarray/_internal.py | 34 | 1986 | # 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 |
ilexius/odoo | openerp/addons/test_impex/tests/test_load.py | 7 | 44231 | # -*- coding: utf-8 -*-
import json
import pkgutil
import unittest
import openerp.modules.registry
import openerp
from openerp.tests import common
from openerp.tools.misc import mute_logger
def message(msg, type='error', from_=0, to_=0, record=0, field='value', **kwargs):
return dict(kwargs,
type... | gpl-3.0 |
vtemian/uni-west | second_year/os/exams/os_sched.py | 1 | 1793 | import Queue
import copy
fd = open('processes.txt')
processes = []
endTime = 0
time = 0
for line in fd:
tempProc = line.split(" ")
tempProc[0] = int(tempProc[0])
tempProc[1] = int(tempProc[1])
tempProc.append(0)
tempProc.append(0)
tempProc.append(0)
process = (arrival, burst, tw, tr, visi... | apache-2.0 |
google-code/betsynetpdf | sumatrapdf/scripts/util.py | 4 | 21807 | import os
import re
import subprocess
import sys
import hashlib
import string
import time
import types
import zipfile
import bz2
import shutil
def log(s):
print(s)
sys.stdout.flush()
def strip_empty_lines(s):
s = s.replace("\r\n", "\n")
lines = [l.strip() for l in s.split("\n") i... | gpl-3.0 |
ran0101/namebench | libnamebench/config.py | 173 | 11391 | #!/usr/bin/env python
# Copyright 2009 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... | apache-2.0 |
zzcclp/spark | examples/src/main/python/mllib/stratified_sampling_example.py | 27 | 1329 | #
# 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 us... | apache-2.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/google/appengine/_internal/django/core/validators.py | 23 | 6691 | import re
import urlparse
from google.appengine._internal.django.core.exceptions import ValidationError
from google.appengine._internal.django.utils.translation import ugettext_lazy as _
from google.appengine._internal.django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the... | lgpl-3.0 |
certik/sympy-oldcore | sympy/ntheory/partitions_.py | 1 | 1870 |
def npartitions(n):
"""
Calculate the partition function P(n), i.e. the number of ways that
n can be written as a sum of positive integers.
P(n) is computed using a straightforward implementation of the
Hardy-Ramanujan-Rademacher formula, described e.g. at
http://mathworld.wolfram.com/... | bsd-3-clause |
noobcoderT/ryu-3.21 | ryu/app/rest_conf_switch.py | 22 | 5715 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
kawasaki2013/python-for-android-x86 | python3-alpha/python3-src/Lib/idlelib/GrepDialog.py | 49 | 4062 | import os
import fnmatch
import sys
from tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
def grep(text, io=None, flist=None):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_grepdialog"):
engine._grepdialog = GrepD... | apache-2.0 |
OCA/hr | hr_employee_display_own_info/tests/test_employee_display_own_info.py | 1 | 1081 | # Copyright 2017-2019 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestEmployeeDisplayOwnInfo(TransactionCase):
def setUp(self):
super(TestEmployeeDisplayOwnInfo, self).setUp()
self.user... | agpl-3.0 |
genesi/u-boot-upstream | tools/patman/gitutil.py | 7 | 13538 | # 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 |
webcomics/dosage | dosagelib/plugins/namirdeiter.py | 1 | 2179 | # SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from .common import _ParserScraper
class NamirDeiter(_ParserScraper):
imageSearch = '//img[contains(@src, "comics/")]'
prevSearch = ('//a[@rel="prev"]',
'//a[./img[contains(@src... | mit |
weaver-viii/h2o-3 | py2/h2o_cmd.py | 20 | 16497 |
import h2o_nodes
from h2o_test import dump_json, verboseprint
import h2o_util
import h2o_print as h2p
from h2o_test import OutputObj
#************************************************************************
def runStoreView(node=None, **kwargs):
print "FIX! disabling runStoreView for now"
return {}
if no... | apache-2.0 |
ingted/voltdb | tests/test_apps/csvbenchmark/csvbenchmark.py | 7 | 15913 | #!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2015 VoltDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... | agpl-3.0 |
mat650/metagoofil | hachoir_parser/container/realmedia.py | 95 | 6851 | """
RealMedia (.rm) parser
Author: Mike Melanson
Creation date: 15 december 2006
References:
- http://wiki.multimedia.cx/index.php?title=RealMedia
- Appendix E: RealMedia File Format (RMFF) Reference
https://common.helixcommunity.org/nonav/2003/HCS_SDK_r5/htmfiles/rmff.htm
Samples:
- http://samples.mplayerhq.hu/re... | gpl-2.0 |
ovnicraft/odoo | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
partofthething/home-assistant | homeassistant/components/alpha_vantage/sensor.py | 16 | 6966 | """Stock market information from Alpha Vantage."""
from datetime import timedelta
import logging
from alpha_vantage.foreignexchange import ForeignExchange
from alpha_vantage.timeseries import TimeSeries
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const impor... | mit |
stamhe/zulip | zerver/lib/response.py | 124 | 1316 | from __future__ import absolute_import
from django.http import HttpResponse, HttpResponseNotAllowed
import ujson
class HttpResponseUnauthorized(HttpResponse):
status_code = 401
def __init__(self, realm):
HttpResponse.__init__(self)
self["WWW-Authenticate"] = 'Basic realm="%s"' % (realm,)
def... | apache-2.0 |
ojengwa/flask-oauthlib | example/linkedin.py | 16 | 2007 | from flask import Flask, redirect, url_for, session, request, jsonify
from flask_oauthlib.client import OAuth
app = Flask(__name__)
app.debug = True
app.secret_key = 'development'
oauth = OAuth(app)
linkedin = oauth.remote_app(
'linkedin',
consumer_key='k8fhkgkkqzub',
consumer_secret='ZZtLETQOQYNDjMrz',
... | bsd-3-clause |
anilmuthineni/tensorflow | tensorflow/python/kernel_tests/transpose_op_test.py | 29 | 9886 | # 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 |
portante/sosreport | sos/plugins/psacct.py | 1 | 1824 | ### 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 version.
## This program is distributed in the hope that it will be useful,... | gpl-2.0 |
hakonsbm/nest-simulator | pynest/nest/tests/test_connect_array_fixed_indegree.py | 2 | 3322 | # -*- coding: utf-8 -*-
#
# test_connect_array_fixed_indegree.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 versio... | gpl-2.0 |
txemi/ansible | lib/ansible/modules/system/gconftool2.py | 22 | 9101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Kenneth D. Evensen <kevensen@redhat.com>
#
# This file is part of Ansible (sort of)
#
# 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 vers... | gpl-3.0 |
leilihh/novaha | nova/db/sqlalchemy/utils.py | 9 | 23587 | # Copyright (c) 2013 Boris Pavlovic (boris@pavlovic.me).
# 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... | apache-2.0 |
JCA-Developpement/Odoo | addons/hr_payroll/__init__.py | 433 | 1137 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
openDAQ/easydaq | easydaq/config.py | 1 | 2487 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'daqcontrol/config.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
M... | lgpl-3.0 |
bsc-renewit/d2.2 | monitoringFramework/gmetric.py | 1 | 3582 |
#!/usr/bin/env python
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
__author__="mcanuto"
__date__ ="$Feb 13, 2014 6:03:13 PM$"
from xdrlib import Packer, Unpacker
import socket
slope_s... | apache-2.0 |
aerospike/aerospike-client-python | test/old_tests/_test_remove_bin.py | 1 | 12571 | # -*- coding: utf-8 -*-
import pytest
import sys
from .test_base_class import TestBaseClass
from aerospike import exception as e
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
except:
print("Please install aerospike python client.")
sys.exit(1)
class TestRemovebin(object):
def se... | apache-2.0 |
bob-white/UnityIronPythonConsole | Assets/IronPythonConsole/Plugins/Lib/email/generator.py | 106 | 13930 | # Copyright (C) 2001-2010 Python Software Foundation
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
__all__ = ['Generator', 'DecodedGenerator']
import re
import sys
import time
import random
import warnings
from cStringIO import StringIO
from email.header import Hea... | mpl-2.0 |
ThomasJunk/ringo | ringo/tests/functional/test_forms.py | 4 | 3977 | #!/usr/bin/env python
# encoding: utf-8
import pytest
from pytest_ringo import login, transaction_begin, transaction_rollback
class TestList:
def test_GET(self, app):
login(app, "admin", "secret")
app.get("/forms/list")
class TestRead:
# FIXME: There is currently no form in the database ()... | gpl-2.0 |
memsharded/conan | conans/test/functional/scm/workflows/test_scm_subfolder.py | 1 | 4596 | # coding=utf-8
import os
import textwrap
import unittest
from nose.plugins.attrib import attr
from conans.test.functional.scm.workflows.common import TestWorkflow
from conans.test.utils.tools import SVNLocalRepoTestCase
from conans.test.utils.tools import TestClient, create_local_git_repo
class SCMSubfolder(TestWo... | mit |
barykaed/Pelican-Test | fsp_env/Lib/site-packages/pip/basecommand.py | 79 | 9310 | """Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import os
import sys
import traceback
import optparse
import warnings
from pip._vendor.six import StringIO
from pip import cmdoptions
from pip.locations import running_under_virtualenv
from pip.download import PipSes... | mit |
bimbam23/tools-iuc | tools/resize_coordinate_window/resize_coordinate_window.py | 6 | 3693 | from __future__ import print_function
import argparse
import fileinput
import sys
# Maximum value of a signed 32 bit integer (2**31 - 1).
MAX_CHROM_LEN = 2147483647
def stop_err(msg):
sys.stderr.write(msg)
sys.exit(1)
parser = argparse.ArgumentParser()
parser.add_argument('--input', dest='input', help="In... | mit |
mihailignatenko/erp | addons/l10n_uy/__openerp__.py | 260 | 1807 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net>
# Proyecto de Localización de OperERP para Uruguay
# $Id$
#
# This program i... | agpl-3.0 |
zhangxq5012/sky_engine | build/android/pylib/perf/surface_stats_collector_unittest.py | 99 | 2384 | # 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.
"""Unittests for SurfaceStatsCollector."""
# pylint: disable=W0212
import unittest
from pylib.perf.surface_stats_collector import SurfaceStatsCollector
c... | bsd-3-clause |
schwartzmx/ansible-modules-extras | notification/flowdock.py | 55 | 6057 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@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 ... | gpl-3.0 |
TheJJ100100/bedrock | bedrock/base/tests/test_accepted_locales.py | 6 | 3508 | import os
import shutil
from django.conf import settings
import test_utils
from bedrock.settings.base import get_dev_languages, path
class AcceptedLocalesTest(test_utils.TestCase):
"""Test lazy evaluation of locale related settings.
Verify that some localization-related settings are lazily evaluated based
... | mpl-2.0 |
skg-net/ansible | test/runner/lib/docker_util.py | 17 | 5836 | """Functions for accessing docker via the docker cli."""
from __future__ import absolute_import, print_function
import json
import os
import time
from lib.executor import (
SubprocessError,
)
from lib.util import (
ApplicationError,
run_command,
common_environment,
display,
find_executable,
... | gpl-3.0 |
AustereCuriosity/numpy | numpy/lib/tests/test_nanfunctions.py | 10 | 32613 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_almost_equal,
assert_no_warnings, assert_raises, assert_array_equal, suppress_warnings
)
# Test data
_ndat = np.array(... | bsd-3-clause |
nolanliou/tensorflow | tensorflow/contrib/nn/__init__.py | 56 | 1688 | # 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 |
zingale/hydro_examples | advection/weno_coefficients.py | 3 | 18621 | import numpy
# Coefficients of order r=2
# On smooth solutions this should converge with order r=3
C_2 = numpy.array([ 1, 2 ]) / 3
a_2 = numpy.array([
[ 3, -1],
[ 1, 1],
]) / 2
sigma_2 = numpy.array([
[
[ 1, 0... | bsd-3-clause |
pombredanne/pants | tests/python/pants_test/backend/codegen/antlr/java/test_antlr_java_gen_integration.py | 8 | 1286 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.pant... | apache-2.0 |
KeyWeeUsr/kivy | examples/frameworks/twisted/echo_client_app.py | 13 | 2352 | # install_twisted_rector must be called before importing the reactor
from __future__ import unicode_literals
from kivy.support import install_twisted_reactor
install_twisted_reactor()
# A Simple Client that send messages to the Echo Server
from twisted.internet import reactor, protocol
class EchoClient(protocol.Pr... | mit |
utessel/edimax | target/linux/x86/image/mkimg_bifferboard.py | 561 | 1265 | #!/usr/bin/env python
"""
Create firmware for 4/8MB Bifferboards, suitable for uploading using
either bb_upload8.py or bb_eth_upload8.py
"""
import struct, sys
# Increase the kmax value if the script gives errors about the kernel being
# too large. You need to set the Biffboot kmax value to the same value yo... | gpl-2.0 |
thaumos/ansible | lib/ansible/modules/storage/netapp/na_ontap_vscan_scanner_pool.py | 21 | 8931 | #!/usr/bin/python
# (c) 2018, NetApp, 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 |
awkspace/ansible | lib/ansible/modules/network/fortios/fortios_firewall_multicast_address6.py | 24 | 10083 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
shubhdev/openedx | common/djangoapps/student/migrations/0007_convert_to_utf8.py | 188 | 9663 | # 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):
if db.backend_name == 'mysql':
db.execute_many("""
ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_... | agpl-3.0 |
luisgg/iteexe | twisted/internet/gtk2reactor.py | 14 | 9981 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to interact with the glib/gtk2 mainloop.
In order to use this support, simply do the following::
| from twisted.internet import gtk2reactor
| gtk2reactor.install()
Then use twist... | gpl-2.0 |
flavour/tldrmp | modules/s3cfg.py | 1 | 73402 | # -*- coding: utf-8 -*-
""" Deployment Settings
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2009-2013 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (t... | mit |
jimi-c/ansible | lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policies_facts.py | 2 | 4085 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, 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 |
nikhilprathapani/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_bdist_wininst.py | 53 | 1038 | """Tests for distutils.command.bdist_wininst."""
import unittest
from test.support import run_unittest
from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support
class BuildWinInstTestCase(support.TempdirManager,
support.LoggingSilencer,
... | apache-2.0 |
shashank971/edx-platform | common/djangoapps/student/management/commands/assigngroups.py | 170 | 3059 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from student.models import UserTestGroup
import random
import sys
import datetime
from textwrap import dedent
import json
from pytz import UTC
def group_from_value(groups, v):
''' Given group: (('a',0.3),('b',0.4),(... | agpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/models/sql/compiler.py | 76 | 14014 | import datetime
from django.conf import settings
from django.db.backends.util import truncate_name, typecast_date, typecast_timestamp
from django.db.models.sql import compiler
from django.db.models.sql.constants import MULTI
from django.utils import six
from django.utils.six.moves import zip, zip_longest
from django.u... | apache-2.0 |
mozillazg/Unidecode | unidecode/x00b.py | 252 | 4132 | data = (
'[?]', # 0x00
'N', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'e', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'[?]', # 0x12
'o', # ... | gpl-2.0 |
erkrishna9/odoo | addons/l10n_es/__openerp__.py | 314 | 2772 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# Copy... | agpl-3.0 |
CoderSong2015/utFordataType | googletest/googletest/test/gtest_test_utils.py | 20 | 10824 | #!/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... | apache-2.0 |
lewischeng-ms/pox | pox/lib/socketcapture.py | 24 | 5511 | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | gpl-3.0 |
emilio/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/pytester.py | 32 | 42622 | """(disabled by default) support for testing pytest and pytest plugins."""
from __future__ import absolute_import, division, print_function
import codecs
import gc
import os
import platform
import re
import subprocess
import six
import sys
import time
import traceback
from fnmatch import fnmatch
from weakref import W... | mpl-2.0 |
eyohansa/django | django/contrib/sessions/backends/base.py | 298 | 12046 | from __future__ import unicode_literals
import base64
import logging
import string
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from dj... | bsd-3-clause |
paveu/api_mocker | apimocker/mocker/migrations/0002_auto_20170718_1858.py | 1 | 1459 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 18:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mocker', '0001_initial'),
]
operations = [
... | mit |
pyrrho314/recipesystem | trunk/astrodata/adutils/irafutil.py | 1 | 6759 |
'''This file contains the following utilities:
joinlines (input, delim=" ", missing="Missing", maxchars=161,
shortest=True)
joinlists (list1, list2, delim=" ", missing="Missing", shortest=True)
atList (input, filenames)
expandlist (input)
'''
#--------------------------------------... | mpl-2.0 |
sensidev/drf-requests-jwt | drf_requests_jwt/services.py | 1 | 4894 | """
Services.
"""
import logging
import requests
from urllib.parse import urlparse, parse_qs
from drf_requests_jwt import settings
from drf_requests_jwt.backends.utils import build_url
logger = logging.getLogger(__name__)
class HttpRequestService(object):
obtain_jwt_allowed_fail_attempts = settings.DEFAULTS.get... | mit |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/lib2to3/fixes/fix_sys_exc.py | 327 | 1039 | """Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... | gpl-2.0 |
MarishaYasko/interactive-stories-stands | InteractiveStands/Lib/copyreg.py | 165 | 6833 | """Helper to provide extensibility for pickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_typ... | mit |
catapult-project/catapult-csm | trace_processor/third_party/cloudstorage/common.py | 129 | 12326 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | bsd-3-clause |
dnidever/noaosourcecatalog | python/nsc_instcal_combine.py | 1 | 27777 | #!/usr/bin/env python
import os
import sys
import numpy as np
import warnings
from astropy.io import fits
from astropy.utils.exceptions import AstropyWarning
from astropy.table import Table, vstack, Column
from astropy.time import Time
import healpy as hp
from dlnpyutils import utils, coords
import subprocess
import t... | mit |
sbt9uc/osf.io | framework/mongo/utils.py | 11 | 1888 | # -*- coding: utf-8 -*-
import re
import httplib as http
import pymongo
from modularodm.exceptions import ValidationValueError
from framework.exceptions import HTTPError
# MongoDB forbids field names that begin with "$" or contain ".". These
# utilities map to and from Mongo field names.
mongo_map = {
'.': '__... | apache-2.0 |
holmes/intellij-community | python/helpers/epydoc/apidoc.py | 90 | 92479 | # epydoc -- API Documentation Classes
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: apidoc.py 1675 2008-01-29 17:12:56Z edloper $
"""
Classes for encoding API documentation about Python programs.
These classes are used as a common representation f... | apache-2.0 |
kabrapratik28/Stanford_courses | cs224n/assignment1/q4_sentiment.py | 1 | 8150 | #!/usr/bin/env python
import argparse
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import itertools
from utils.treebank import StanfordSentiment
import utils.glove as glove
from q3_sgd import load_saved_params, sgd
# We will use sklearn here because it will run faster t... | apache-2.0 |
xzturn/tensorflow | tensorflow/python/kernel_tests/proto/encode_proto_op_test_base.py | 26 | 8489 | # =============================================================================
# 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
#... | apache-2.0 |
lepricon49/headphones | lib/bs4/builder/__init__.py | 73 | 11234 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a Tree... | gpl-3.0 |
fw1121/genomics | bcftbx/Pipeline.py | 1 | 28839 | #!/usr/bin/env python
#
# Pipeline.py: classes for running scripts iteratively
# Copyright (C) University of Manchester 2011 Peter Briggs
#
########################################################################
#
# Pipeline.py
#
#########################################################################
"""
Cl... | artistic-2.0 |
buntyke/Flask | microblog/flask/lib/python2.7/site-packages/wtforms/meta.py | 79 | 3822 | from wtforms.utils import WebobInputWrapper
from wtforms import i18n
class DefaultMeta(object):
"""
This is the default Meta class which defines all the default values and
therefore also the 'API' of the class Meta interface.
"""
# -- Basic form primitives
def bind_field(self, form, unbound_... | mit |
abhishekgahlot/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/django/core/serializers/json.py | 107 | 2053 | """
Serialize data to/from JSON
"""
import datetime
import decimal
from StringIO import StringIO
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.utils import datetime_safe
from django.utils import simpl... | apache-2.0 |
moyogo/tachyfont | run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/ttLib/tables/E_B_L_C_.py | 11 | 25091 | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from . import DefaultTable
from fontTools.misc.textTools import safeEval
from .BitmapGlyphMetrics import BigGlyphMetrics, bigGlyphMetricsFormat, SmallGlyphMetrics, smallGlyphMetricsForma... | apache-2.0 |
tjanez/ansible | lib/ansible/plugins/terminal/iosxr.py | 19 | 1850 | #
# (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.