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 |
|---|---|---|---|---|---|
TheTypoMaster/chromium-crosswalk | third_party/closure_linter/closure_linter/not_strict_test.py | 129 | 2318 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | bsd-3-clause |
Evolving-AI-Lab/innovation-engine | caffe/experiments/intermed-vis/hyperparam_sweep.py | 1 | 3565 | #! /usr/bin/env python
from pylab import *
import os
import sys
import argparse
from loaders import *
from gradient_finder import *
def do_one_in_sweep(gf, hp_which, hp_frac, rand_seed, layer, unit_idx, start_at, prefix_template, brave=False):
hp_frac = float(hp_frac)
pp = FindParams()
pp.rand_se... | mit |
nthall/pip | pip/basecommand.py | 92 | 11429 | """Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import os
import sys
import optparse
import warnings
from pip import cmdoptions
from pip.index import PackageFinder
from pip.locations import running_under_virtualenv
from pip.download import PipSession
from pip.excep... | mit |
zzzirk/boto | tests/unit/iam/test_connection.py | 100 | 19292 | #!/usr/bin/env python
# Copyright (c) 2012 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 ... | mit |
yaxinlx/apiserver-builder | cmd/vendor/k8s.io/kubernetes/hack/verify-flags-underscore.py | 63 | 9726 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
nvoron23/hue | desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/ldapobject.py | 42 | 32219 | """
ldapobject.py - wraps class _ldap.LDAPObject
See http://www.python-ldap.org/ for details.
\$Id: ldapobject.py,v 1.109 2010/06/03 12:26:39 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
- LDAPObject class should be exactly the same like _ldap.LDAPObject
Usage:
Directly im... | apache-2.0 |
DR08/mxnet | cpp-package/scripts/OpWrapperGenerator.py | 17 | 16795 | # 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 |
PrabhanshuAttri/Amity-Placement-Updates | amity-updates.py | 1 | 1608 | from bs4 import BeautifulSoup
import time
import urllib2
import subprocess
from R2D2 import *
def checkUpdates(url):
value = url.split("=",1)[1]
url = url.split("Popup",1)[0]
print
print '$',str(value), url
flag = 0
while True:
print
log('accessing amity.edu ',1)
try:
data = urllib2.urlopen(url).read... | mit |
msifuentes/pynet_ansible | test_netmiko_ex1.py | 2 | 2167 | #!/usr/bin/env python
#Import libraries
from netmiko import ConnectHandler
from getpass import getpass
#define variables for the connection to network devices
ip_addr = '50.76.53.27'
username = 'pyclass'
password = getpass()
portpy2 = 8022
portsrx = 9822
cisco = 'cisco_ios'
juniper = 'juniper'
#create a dictionary ... | apache-2.0 |
nhomar/odoo-mirror | addons/sale_layout/__openerp__.py | 322 | 1793 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
akamel001/Sick-Beard | lib/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## 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... | gpl-3.0 |
artscoop/django-extensions | django_extensions/templatetags/syntax_color.py | 23 | 3163 | r"""
Template filter for rendering a string with syntax highlighting.
It relies on Pygments to accomplish this.
Some standard usage examples (from within Django templates).
Coloring a string with the Python lexer:
{% load syntax_color %}
{{ code_string|colorize:"python" }}
You may use any lexer in Pygments. ... | mit |
prculley/gramps | gramps/gui/editors/__init__.py | 2 | 4028 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | gpl-2.0 |
stefanw/django-cms | cms/south_migrations/0033_auto__del_field_title_publisher_is_draft__del_field_title_publisher_st.py | 1680 | 20032 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
irmen/Pyro5 | examples/http/client.py | 1 | 2096 | import json
import re
import pprint
from urllib.request import urlopen, Request
from urllib.error import HTTPError
def get_charset(req):
charset = "utf-8"
match = re.match(r".* charset=(.+)", req.getheader("Content-Type"))
if match:
charset = match.group(1)
return charset
def pyro_call(objec... | mit |
rwillmer/django | tests/auth_tests/test_remote_user.py | 275 | 10242 | from datetime import datetime
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.backends import RemoteUserBackend
from django.contrib.auth.middleware import RemoteUserMiddleware
from django.contrib.auth.models import User
from django.test import TestCase, modify_set... | bsd-3-clause |
craffel/librosa | tests/test_constantq.py | 1 | 7988 | #!/usr/bin/env python
"""
CREATED:2015-03-01 by Eric Battenberg <ebattenberg@gmail.com>
unit tests for librosa core.constantq
Run me as follows:
cd tests/
nosetests -v --with-coverage --cover-package=librosa
"""
from __future__ import division
# Disable cache
import os
try:
os.environ.pop('LIBROSA_CACHE_D... | isc |
skwbc/numpy | numpy/core/tests/test_multiarray.py | 6 | 246246 | from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
import ctypes
import os
import gc
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decima... | bsd-3-clause |
gtko/CouchPotatoServer | libs/apscheduler/scheduler.py | 87 | 23350 | """
This module is the main part of the library. It houses the Scheduler class
and related exceptions.
"""
from threading import Thread, Event, Lock
from datetime import datetime, timedelta
from logging import getLogger
import os
import sys
from apscheduler.util import *
from apscheduler.triggers import SimpleTrigger... | gpl-3.0 |
mvcsantos/QGIS | python/ext-libs/pygments/styles/manni.py | 364 | 2374 | # -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2013 by the Pygments... | gpl-2.0 |
chokribr/invenio | invenio/modules/tags/testsuite/test_tags_restful.py | 4 | 20128 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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 option) any later... | gpl-2.0 |
mavenlin/tensorflow | tensorflow/python/ops/string_ops.py | 33 | 5311 | # 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 |
danakj/chromium | tools/grit/grit/node/message_unittest.py | 7 | 4021 | #!/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.
'''Unit tests for grit.node.message'''
import os
import sys
import unittest
import StringIO
if __name__ == '__main__':
# When ... | bsd-3-clause |
rvmoura96/projeto-almoxarifado | myvenv/Lib/site-packages/setuptools/command/egg_info.py | 50 | 25016 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.errors import DistutilsInternalError
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import... | mit |
molobrakos/home-assistant | tests/components/smartthings/test_switch.py | 10 | 4195 | """
Test for the SmartThings switch platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import Attribute, Capability
from homeassistant.components.smartthings import switch
from homeassistant.components.smartthings... | apache-2.0 |
myzhan/boomer | prometheus_exporter.py | 1 | 5479 | # coding: utf8
import six
from itertools import chain
from flask import request, Response
from locust import stats as locust_stats, runners as locust_runners
from locust import User, task, events
from prometheus_client import Metric, REGISTRY, exposition
# This locustfile adds an external web endpoint to the locust ... | mit |
PhSchmitt/mptcp-nexus-a444 | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
lokeshjindal15/gem5_transform | src/arch/x86/isa/insts/general_purpose/load_segment_registers.py | 91 | 2595 | # 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 |
browseinfo/odoo_saas3_nicolas | openerp/tests/addons/test_converter/models.py | 69 | 1432 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class test_model(orm.Model):
_name = 'test_converter.test_model'
_columns = {
'char': fields.char(),
'integer': fields.integer(),
'float': fields.float(),
'numeric': fields.float(digits=(16, 2)),
'many2one': fi... | agpl-3.0 |
smi96/django-blog_website | lib/python2.7/site-packages/django/contrib/sessions/base_session.py | 348 | 1623 | """
This module allows importing AbstractBaseSession even
when django.contrib.sessions is not in INSTALLED_APPS.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class BaseSes... | mit |
martenson/tools-iuc | tools/spaln/list_spaln_tables.py | 14 | 2138 | #!/usr/bin/env python3
import argparse
import shlex
import sys
from subprocess import run
from typing import TextIO
def find_common_ancestor_distance(
taxon: str, other_taxon: str, taxonomy_db_path: str, only_canonical: bool
):
canonical = "--only_canonical" if only_canonical else ""
cmd_str = f"taxonomy... | mit |
laughingman7743/PyAthena | pyathena/cursor.py | 1 | 4995 | # -*- coding: utf-8 -*-
import logging
from typing import TYPE_CHECKING, Any, Dict, List, Optional, cast
from pyathena.common import BaseCursor, CursorIterator
from pyathena.converter import Converter
from pyathena.error import OperationalError, ProgrammingError
from pyathena.formatter import Formatter
from pyathena.m... | mit |
Qalthos/ansible | lib/ansible/modules/cloud/google/gcp_pubsub_subscription_facts.py | 11 | 7842 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
VPAC/pytsm | pytsm/texttable.py | 1 | 18785 | # texttable - module for creating simple ASCII tables
# Copyright (C) 2003-2011 Gerome Fournier <jef(at)foutaise.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.... | gpl-3.0 |
ondrokrc/gramps | gramps/gui/widgets/multitreeview.py | 1 | 3357 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Doug Blank <doug.blank@gmail.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 version 2 of the License, or
... | gpl-2.0 |
EdDev/vdsm | lib/vdsm/tool/configfile.py | 1 | 8895 | # Copyright 2013 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... | gpl-2.0 |
ctb/pygr | pygr/apps/leelabdb.py | 1 | 2976 | import MySQLdb
import os
from splicegraph import *
spliceCalcs={'HUMAN_SPLICE_03':
TableGroup(db='HUMAN_SPLICE_03',suffix='JUN03',clusters='cluster_JUN03',
exons='exon_formJUN03',splices='splice_verification_JUN03',
genomic='genomic_cluster_JUN03',mrna='mrn... | bsd-3-clause |
akarki15/mozillians | vendor-local/lib/python/unidecode/x076.py | 252 | 4639 | data = (
'Yu ', # 0x00
'Cui ', # 0x01
'Ya ', # 0x02
'Zhu ', # 0x03
'Cu ', # 0x04
'Dan ', # 0x05
'Shen ', # 0x06
'Zhung ', # 0x07
'Ji ', # 0x08
'Yu ', # 0x09
'Hou ', # 0x0a
'Feng ', # 0x0b
'La ', # 0x0c
'Yang ', # 0x0d
'Shen ', # 0x0e
'Tu ', # 0x0f
'Yu ', # 0x10
'Gua ',... | bsd-3-clause |
tmerrick1/spack | lib/spack/spack/cmd/flake8.py | 4 | 10760 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
andrevmatos/Librix-ThinClient | build/lib/ltmt/ui/keygen/OpenKey.py | 2 | 1509 | #!/usr/bin/env python3
#
# This file is part of librix-thinclient.
#
# librix-thinclient is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | gpl-2.0 |
manipopopo/tensorflow | tensorflow/contrib/distribute/python/prefetching_ops_v2_test.py | 14 | 3161 | # 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 |
40223211/logo-toys | static/Brython3.1.1-20150328-091302/Lib/errno.py | 624 | 4096 | """
This module makes available standard errno system symbols.
The value of each symbol is the corresponding integer value,
e.g., on most systems, errno.ENOENT equals the integer 2.
The dictionary errno.errorcode maps numeric codes to symbol names,
e.g., errno.errorcode[2] could be the string 'ENOENT'.
Symbols that ar... | agpl-3.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/optimizer_v2/rmsprop.py | 19 | 8922 | # 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 |
drj11/pdftables | pdftables/scripts/render.py | 3 | 4247 | #!/usr/bin/env python
"""pdftables-render: obtain pdftables debugging information from pdfs
Usage:
pdftables-render [options] <pdfpath>...
pdftables-render (-h | --help)
pdftables-render --version
Example page number lists:
<pdfpath> may contain a [:page-number-list].
pdftables-render my.pdf:1
... | bsd-2-clause |
kaixinjxq/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_default-src_cross-origin_multi_font_blocked_int-manual.py | 25 | 2759 | def main(request, response):
_URL = request.url
_CSSURL = _URL[:_URL.index('/csp') + 1] + "csp/support/w3c/CanvasTest.ttf"
response.headers.set(
"Content-Security-Policy",
"default-src http://www.tizen.com http://tizen.org; style-src 'unsafe-inline'")
response.headers.set(
"X-Con... | bsd-3-clause |
rockxcn/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/dblite.py | 95 | 7472 | # dblite.py module contributed by Ralf W. Grosse-Kunstleve.
# Extended for Unicode by Steven Knight.
import SCons.compat
import builtins
import os
# compat layer imports "cPickle" for us if it's available.
import pickle
import shutil
import time
keep_all_files = 00000
ignore_corrupt_dbfiles = 0
def corruption_warni... | apache-2.0 |
kdwink/intellij-community | plugins/hg4idea/testData/bin/mercurial/osutil.py | 90 | 5363 | # osutil.py - pure Python version of osutil.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import stat as statmod
def _mode_to_kind(mode):
if statmod.... | apache-2.0 |
ndchristian/AWS-Lambda-Functions | firehose/s3Firehose.py | 1 | 2730 | """
Copyright 2016 Nicholas Christian
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, softwar... | apache-2.0 |
CI-WATER/django-tethys_gizmos | tethys_gizmos/lib/fetchclimate/fc_time_series.py | 1 | 5625 | import datetime, time
#------------------------------------------------------------------------------
#This class contains and manages the Fetch Climate time series data
#------------------------------------------------------------------------------
class FCTimeSeries:
def __init__(self,temporalDomain,averageData):
... | bsd-2-clause |
jeremiahmarks/sl4a | python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/rotmodel.py | 131 | 2149 | """
Copyright (c) 2008, appengine-utilities project
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 conditions and ... | apache-2.0 |
brunorijsman/euler-problems-python | euler/euler_numbers.py | 1 | 2310 | import unittest
def number_digits(n):
if n == 0:
return 1
if n < 0:
return number_digits(-n)
digits = 0
while n != 0:
digits += 1
n //= 10
return digits
def triangle(n):
return n * (n+1) // 2
def square(n):
return n * n
def pentagonal(n):
return n * (3*n-1) // 2
def hexagonal(n):
... | bsd-2-clause |
JamesLinEngineer/RKMC | addons/plugin.video.youtube/resources/lib/test_youtube/test_client.py | 24 | 10846 | __author__ = 'bromix'
import unittest
from resources.lib import kodion
from resources.lib.youtube.client import YouTube
from resources.lib.youtube.helper.video_info import VideoInfo
class TestClient(unittest.TestCase):
TEST_ACCESS_TOKEN = ''
def test_calc_next_page_token(self):
"""
client =... | gpl-2.0 |
InviNets/ReadingsToSNMP | pysnmp/proto/errind.py | 6 | 5221 | # SNMPv3 error-indication values.
# Object below could be compared with literals thus are backward-compatible
# with original pysnmperror-indication values.
class ErrorIndication:
def __init__(self, descr=None):
self.__value = self.__descr = self.__class__.__name__[0].lower() + self.__class__.__name__[1:]
... | bsd-2-clause |
tmtowtdi/MontyLacuna | t/bldgs/planetarycommand.py | 1 | 1586 |
import os, re, sys
bindir = os.path.abspath(os.path.dirname(sys.argv[0]))
libdir = bindir + "/../../lib"
sys.path.append(libdir)
import lacuna as lac
glc = lac.clients.Member(
config_file = bindir + "/../../etc/lacuna.cfg",
config_section = 'play_test',
)
my_planet = glc.get_body_byname( 'bmots rof 2.1' )
#... | mit |
saraivaufc/askMathPlus | askmath/models/progress/studentquestionprogress.py | 1 | 1217 | from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext as _
class StudentQuestionProgress(models.Model):
student = models.ForeignKey('Student', verbose_name=_(u"Student"))
discipline = models.ForeignKey('Discipline', verbose_name=_(u"Discipline"))
less... | gpl-2.0 |
aptomar/apt-file-format | src/jsonschema.py | 1 | 41146 | """
An implementation of JSON Schema for Python
The main functionality is provided by the validator classes for each of the
supported JSON Schema versions.
Most commonly, :func:`validate` is the quickest way to simply validate a given
instance under a schema, and will create a validator for you.
"""
from __future__... | bsd-3-clause |
ghickman/django | django/conf/locale/hr/formats.py | 504 | 2106 | # -*- 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. E Y.'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
chrinide/optunity | optunity/communication.py | 3 | 10246 | #! /usr/bin/env python
# Author: Marc Claesen
#
# Copyright (c) 2014 KU Leuven, ESAT-STADIUS
# 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 th... | bsd-3-clause |
doganaltunbay/odoo | addons/account/wizard/account_period_close.py | 341 | 2646 | # -*- 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 |
ghchinoy/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/mvn_tril_test.py | 25 | 16501 | # 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 |
shyamalschandra/blockly | i18n/js_to_json.py | 177 | 3966 | #!/usr/bin/python
# Gives the translation status of the specified apps and languages.
#
# Copyright 2013 Google Inc.
# https://developers.google.com/blockly/
#
# 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... | apache-2.0 |
systemdaemon/systemd | .ycm_extra_conf.py | 129 | 1551 | import itertools
import os
import subprocess
def GetFlagsFromMakefile(varname):
return subprocess.check_output([
"make", "-s", "print-%s" % varname]).decode().split()
def Flatten(lists):
return list(itertools.chain.from_iterable(lists))
def DirectoryOfThisScript():
return os.path.dirname(os.path.abspat... | gpl-2.0 |
eezee-it/server-tools | cron_run_manually/__openerp__.py | 23 | 1404 | # -*- coding: utf-8 -*-
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Ge... | agpl-3.0 |
elijah513/django | django/conf/locale/fi/formats.py | 504 | 1390 | # -*- 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. E Y'
TIME_FORMAT = 'G.i'
DATET... | bsd-3-clause |
pabulumm/neighbors | lib/python3.4/site-packages/django/db/models/sql/aggregates.py | 77 | 4846 | """
Classes to represent the default SQL aggregate functions
"""
import copy
import warnings
from django.db.models.fields import FloatField, IntegerField
from django.db.models.query_utils import RegisterLookupMixin
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cache... | bsd-3-clause |
ronnix/fabtools | fabtools/vagrant.py | 3 | 5585 | """
Vagrant helpers
===============
"""
import re
from fabric.api import env, hide, local, settings, task
# if name is specified, use that. otherwise try to use env.host_string
# if it exists
def _name_or_host_string(name):
return name or (env.host_string or name)
def version():
"""
Get the Vagrant vers... | bsd-2-clause |
Essk/FreeCodeCamp-Projects | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 270 | 8338 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Argument-less script to select what to run on the buildbots."""
import filecmp
import os
import shutil
import subprocess
import sys
i... | mit |
BeyondTheClouds/nova | tools/db/schema_diff.py | 9 | 8435 | #!/usr/bin/env python
# Copyright 2012 OpenStack Foundation
#
# 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 requi... | apache-2.0 |
sadmansk/servo | tests/wpt/web-platform-tests/tools/third_party/atomicwrites/docs/conf.py | 42 | 3283 | #!/usr/bin/env python
import os
import sys
import pkg_resources
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix... | mpl-2.0 |
blaggacao/OpenUpgrade | addons/product_margin/wizard/__init__.py | 444 | 1078 | # -*- 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... | agpl-3.0 |
jreichhold/chef-repo | vendor/ruby/2.0.0/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxml2/2.8.0/libxml2-2.8.0/python/tests/relaxng.py | 87 | 1200 | #!/usr/bin/python -u
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
schema="""<?xml version="1.0"?>
<element name="foo"
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/annotation/1.0"
xmlns:ex1="http://www.example.com/n1"
xmlns:e... | apache-2.0 |
honghaoz/UW-Info-Session-iOS | UW-Info-Session-1.0/GAE Support/uw-info2/libs/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... | gpl-3.0 |
Intel-Corporation/tensorflow | tensorflow/python/debug/lib/profiling.py | 127 | 3705 | # 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 |
Ruide/angr-dev | angr/angr/analyses/identifier/functions/memset.py | 5 | 1195 |
import random
from ..func import Func, TestData
def rand_str(length, byte_list=None):
if byte_list is None:
return "".join(chr(random.randint(0, 255)) for _ in xrange(length))
return "".join(random.choice(byte_list) for _ in xrange(length))
class memset(Func):
non_null = [chr(i) for i in range... | bsd-2-clause |
eirmag/weboob | weboob/applications/qweboobcfg/qweboobcfg.py | 1 | 1320 | # -*- coding: utf-8 -*-
# vim: ft=python et softtabstop=4 cinoptions=4 shiftwidth=4 ts=4 ai
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free... | agpl-3.0 |
Theb-1/home-assistant | homeassistant/components/sensor/rfxtrx.py | 2 | 3116 | """
homeassistant.components.sensor.rfxtrx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows sensor values from RFXtrx sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rfxtrx/
"""
import logging
from collections import OrderedDict
from homeassi... | mit |
0todd0000/spm1d | spm1d/data/mv0d/manova1.py | 1 | 1541 |
import numpy as np
from .. import _base
class AnimalDepression(_base.DatasetMANOVA1):
'''
NOTES: chisq value and p value computed in MATLAB
'''
def _set_values(self):
self.www = 'http://www.pearsonhighered.com/assets/hip/gb/uploads/Mayers_IntroStatsSPSS_Ch14.pdf'
A = np.array([
[36,80,50,73,48,... | gpl-3.0 |
ELNOGAL/CMNT_00040_2016_ELN_addons | stock_location_templates/__openerp__.py | 2 | 1793 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
eddyerburgh/free-code-camp-ziplines | react-projects/markdown-previewer/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 1366 | 120842 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | mit |
barmalei/scalpel | research/lev_diag_performance/test_levdiag.py | 2 | 4923 |
import array
MAX_VALUE = 1000000000
# delta is number of row elements to be calculated above and below the central
# diagonal element
def calculate_diag(text, pattern, delta):
# defines size of matrix
rows, cols = len(text), len(pattern)
# initialize column data
colsize = delta * 2 ... | lgpl-3.0 |
atlassian/dd-agent | checks.d/openstack.py | 9 | 35027 | # stdlib
from datetime import datetime, timedelta
from urlparse import urljoin
# project
from checks import AgentCheck
from util import get_hostname
# 3p
import requests
import simplejson as json
SOURCE_TYPE = 'openstack'
DEFAULT_KEYSTONE_API_VERSION = 'v3'
DEFAULT_NOVA_API_VERSION = 'v2.1'
DEFAULT_NEUTRON_API_VERS... | bsd-3-clause |
mschenck/aurora | src/test/python/apache/thermos/config/test_schema.py | 7 | 5551 | #
# 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, software
# distributed under ... | apache-2.0 |
gordolio/iTerm2 | tools/ply/ply-3.4/test/lex_hedit.py | 174 | 1141 | # -----------------------------------------------------------------------------
# hedit.py
#
# Paring of Fortran H Edit descriptions (Contributed by Pearu Peterson)
#
# These tokens can't be easily tokenized because they are of the following
# form:
#
# nHc1...cn
#
# where n is a positive integer and c1 ... cn are ch... | gpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/auth_tests/test_models.py | 16 | 7665 | from django.contrib.auth import get_user_model
from django.contrib.auth.models import (
AbstractUser, Group, Permission, User, UserManager,
)
from django.contrib.contenttypes.models import ContentType
from django.core import mail
from django.db.models.signals import post_save
from django.test import TestCase, overr... | mit |
squarewave24/rafalbuch.com | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/foxpro.py | 335 | 26220 | # -*- coding: utf-8 -*-
"""
pygments.lexers.foxpro
~~~~~~~~~~~~~~~~~~~~~~
Simple lexer for Microsoft Visual FoxPro source code.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygm... | mit |
CompSciCabal/SMRTYPRTY | experiments/scott/immutable_strings/str_rope.py | 1 | 3296 |
class RopeString(object):
"""String using Prefix Tree (Rope)
The prefix tree has:
- strings in the leaf nodes
- weight of the the left subtree at internal nodes
"""
class LeafNode(object):
def __init__(self, value):
self.value = value
def __repr__(self):
... | unlicense |
Stane1983/u-boot | tools/patman/status.py | 4 | 17833 | # SPDX-License-Identifier: GPL-2.0+
#
# Copyright 2020 Google LLC
#
"""Talks to the patchwork service to figure out what patches have been reviewed
and commented on. Provides a way to display review tags and comments.
Allows creation of a new branch based on the old but with the review tags
collected from patchwork.
""... | gpl-2.0 |
dd00/commandergenius | project/jni/python/src/Lib/test/test_decorators.py | 194 | 9849 | import unittest
from test import test_support
def funcattrs(**kwds):
def decorate(func):
func.__dict__.update(kwds)
return func
return decorate
class MiscDecorators (object):
@staticmethod
def author(name):
def decorate(func):
func.__dict__['author'] = name
... | lgpl-2.1 |
willdecker/adspygoogle | adspygoogle/adwords/GenericAdWordsService.py | 2 | 11939 | #!/usr/bin/python
#
# Copyright 2011 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... | mit |
Aptitudetech/ERPNext | erpnext/patches/v8_1/setup_gst_india.py | 9 | 1723 | import frappe
from frappe.email import sendmail_to_system_managers
def execute():
frappe.reload_doc('regional', 'doctype', 'gst_settings')
frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
frappe.reload_doc('stock', 'doctype', 'item')
frappe.reload_doc("stock", "doctype", "customs_tariff_number")
for repo... | cc0-1.0 |
xq262144/hue | desktop/core/ext-py/Django-1.6.10/tests/transactions_regress/tests.py | 49 | 15408 | from __future__ import absolute_import
from django.db import (connection, connections, transaction, DEFAULT_DB_ALIAS, DatabaseError,
IntegrityError)
from django.db.transaction import commit_on_success, commit_manually, TransactionManagementError
from django.test import TransactionTestCase, skipU... | apache-2.0 |
martinbuc/missionplanner | packages/IronPython.StdLib.2.7.4/content/Lib/doctest.py | 42 | 104978 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstri... | gpl-3.0 |
beeftornado/sentry | tests/sentry/middleware/test_stats.py | 1 | 1995 | from __future__ import absolute_import
from django.test import RequestFactory
from exam import fixture
from sentry.utils.compat.mock import patch
from sentry.middleware.stats import RequestTimingMiddleware, add_request_metric_tags
from sentry.testutils import TestCase
from sentry.testutils.helpers.faux import Mock
... | bsd-3-clause |
benoitc/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Scanner/Prog.py | 61 | 3286 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | apache-2.0 |
konstruktoid/ansible-upstream | lib/ansible/modules/utilities/helper/_accelerate.py | 33 | 2905 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Cammarata <jcammarata@ansible.com>
# 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... | gpl-3.0 |
hobarrera/django | tests/gis_tests/geos_tests/test_geos_mutation.py | 31 | 5434 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from unittest import skipUnless
from django.contrib.gis.geos import (
HAS_GEOS, LinearRing, LineString, MultiPoint, Point, P... | bsd-3-clause |
openstack/keystone | keystone/tests/unit/ksfixtures/auth_plugins.py | 4 | 2438 | # 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, software
# distributed under the... | apache-2.0 |
stevenvanrossem/son-emu | src/emuvim/api/openstack/openstack_dummies/base_openstack_dummy.py | 1 | 2676 | """
Copyright (c) 2017 SONATA-NFV and Paderborn University
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 ap... | apache-2.0 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/gettext.py | 202 | 19859 | """Internationalization and localization support.
This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.
I18N refers to the operation by which a program is made aware of multiple
languages. L10N r... | mit |
renard/ansible-modules-core | cloud/openstack/_quantum_floating_ip.py | 146 | 10536 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.