repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
suncycheng/intellij-community | python/helpers/py3only/docutils/utils/math/latex2mathml.py | 46 | 17099 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# :Id: $Id: latex2mathml.py 7668 2013-06-04 12:46:30Z milde $
# :Copyright: © 2010 Günter Milde.
# Based on rst2mathml.py from the latex_math sandbox project
# © 2005 Jens Jørgen Mortensen
# :License: Released under the terms of the `2-Clause BSD li... | apache-2.0 |
xlzdew/seleniumN | py/selenium/webdriver/ie/service.py | 17 | 3917 | #!/usr/bin/python
#
# Copyright 2012 Webdriver_name committers
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
... | apache-2.0 |
ilpianista/ansible | lib/ansible/module_utils/facts/network/base.py | 88 | 2400 | # 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 distributed in the hope that ... | gpl-3.0 |
Gillu13/scipy | scipy/fftpack/tests/test_pseudo_diffs.py | 33 | 13624 | #!/usr/bin/env python
# Created by Pearu Peterson, September 2002
from __future__ import division, print_function, absolute_import
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test(<level>)'
Run tests if fftpack is not installe... | bsd-3-clause |
lokirius/python-for-android | python-modules/twisted/twisted/web/test/test_httpauth.py | 49 | 21718 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web._auth}.
"""
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet.error im... | apache-2.0 |
ubiar/odoo | addons/hr_expense/hr_expense.py | 233 | 24907 | # -*- 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 |
mdrumond/tensorflow | tensorflow/contrib/signal/python/ops/mfcc_ops.py | 18 | 4705 | # 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 |
tpounds/ansible-modules-core | windows/win_lineinfile.py | 66 | 6297 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
vishnu-kumar/PeformanceFramework | rally_os/common/costilius.py | 20 | 3888 | #
# 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 agreed to ... | apache-2.0 |
nightjean/Deep-Learning | tensorflow/python/training/training.py | 21 | 9445 | # 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 |
chrisvans/roastdoge | coffee/tests.py | 1 | 1705 | # Django
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.urlresolvers import reverse
from django.http import JsonResponse
from django.test import TestCase, Client, RequestFactory
# Ours
import factories
import models
import ajax
import forms
import views
# Third Party
from res... | mit |
ruibarreira/linuxtrail | usr/lib/python3.4/textwrap.py | 83 | 19104 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']
# Hardcode the recognized whitespace characters to the US-A... | gpl-3.0 |
oscarolar/odoo | addons/hr_timesheet_invoice/__openerp__.py | 64 | 2474 | # -*- 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 |
spyofchina/shadowsocks | shadowsocks/lru_cache.py | 983 | 4290 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 |
marcoantoniooliveira/labweb | oscar/views/decorators.py | 1 | 4985 | from functools import wraps
from six.moves.urllib import parse
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth.views import redirect_to_login
from django.core... | bsd-3-clause |
xingyepei/edx-platform | cms/djangoapps/contentstore/utils.py | 48 | 16825 | """
Common utility functions useful throughout the contentstore
"""
import logging
from opaque_keys import InvalidKeyError
import re
from datetime import datetime
from pytz import UTC
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from ... | agpl-3.0 |
arbrandes/edx-platform | openedx/core/djangoapps/programs/migrations/0013_customprogramsconfig.py | 4 | 1270 | # Generated by Django 1.11.26 on 2019-12-13 07:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('programs', '0012_auto... | agpl-3.0 |
jamesward-demo/air-quick-fix | AIRQuickFixServer/pyamf/adapters/_google_appengine_ext_db.py | 1 | 2171 | # Copyright (c) 2007-2008 The PyAMF Project.
# See LICENSE for details.
"""
Google App Engine adapter module.
Sets up basic type mapping and class mappings for using the Datastore API
in Google App Engine.
@see: U{Datastore API on Google App Engine (external)
<http://code.google.com/appengine/docs/datastore>}
@auth... | apache-2.0 |
NamelessRom/android_kernel_samsung_latona | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
jaloren/robotframework | atest/interpreter.py | 4 | 5347 | from os.path import abspath, dirname, join, normpath
import os
import subprocess
import sys
def get_variables(path, name=None, version=None):
return {'INTERPRETER': InterpreterFactory(path, name, version)}
def InterpreterFactory(path, name=None, version=None):
if path.endswith('.jar'):
return Standa... | apache-2.0 |
clay23/lab4 | lib/werkzeug/contrib/testtools.py | 319 | 2449 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.testtools
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements extended wrappers for simplified testing.
`TestResponse`
A response wrapper which adds various cached attributes for
simplified assertions on various content types.
:copyright:... | apache-2.0 |
mixlab/cuda-convnet2 | python_util/gpumodel.py | 175 | 14896 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
yg257/Pangea | lib/boto-2.34.0/boto/glacier/job.py | 153 | 7999 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
#
# 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 th... | apache-2.0 |
bharathsreenivas/azure-quickstart-templates | elasticsearch-centos-3node/elasticinstall.py | 168 | 2840 | #!/usr/bin/env python
import subprocess
import socket
import sys
clustername = sys.argv[1]
number_nodes = sys.argv[2]
accountname = sys.argv[3]
accountkey = sys.argv[4]
print"inputs:\n"
print "clustername = " + clustername
print "accontname = " + accountname
print "accountkey = " + accountkey
hostname = socket... | mit |
Joergen/zamboni | lib/misc/tests/test_log.py | 1 | 3825 | import logging
import json
from django.conf import settings
from nose.tools import eq_
from metlog.config import client_from_dict_config
import amo.tests
import commonware.log
from lib.log_settings_base import error_fmt
cfg = {
'version': 1,
'formatters': {
'error': {
'()': commonware.l... | bsd-3-clause |
deepinsight/Deformable-ConvNets | lib/dataset/pycocotools/coco.py | 5 | 18005 | __author__ = 'tylin'
__version__ = '1.0.1'
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Ple... | apache-2.0 |
janslow/boto | boto/rds/event.py | 220 | 1876 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
rsjudge17/romraider | 3rdparty/IzPack/utils/wrappers/izpack2exe/izpack2exe.py | 8 | 3448 | #!/usr/bin/env python
# ........................................................................... #
#
# IzPack - Copyright 2007, 2008 Julien Ponge, All Rights Reserved.
#
# http://izpack.org/
# http://izpack.codehaus.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | gpl-2.0 |
nihilifer/txsocksx | txsocksx/grammar.py | 3 | 2468 | # Copyright (c) Aaron Gallagher <_@habnab.it>
# See COPYING for details.
import socket
grammarSource = r"""
byte = anything:b -> ord(b)
short = byte:high byte:low -> (high << 8) | low
cstring = <(~'\x00' anything)*>:string '\x00' -> string
ipv4Address = <anything{4}>:packed -> socket.inet_ntop(socket.AF_INET, packe... | isc |
cnxsoft/telechips-linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
arowser/wireshark-xcoin | tools/WiresharkXML.py | 52 | 8992 | """
Routines for reading PDML produced from TShark.
Copyright (c) 2003, 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
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... | gpl-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## 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 ... | bsd-2-clause |
shadow000902/blog_source | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 578 | 116086 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
shiquanwang/numba | numba/tests/closures/test_closure.py | 1 | 8088 | import numba; from numba import *; from numba.error import NumbaError
from numba.testing.test_support import rewrite_doc
@autojit
def error1():
def inner():
pass
@autojit
def error2():
@autojit
def inner():
pass
@autojit
def error3():
inner(10, 20, 30)
@jit(restype=void, argtypes=... | bsd-2-clause |
swenson/sagewiki | unidecode/unidecode/x030.py | 248 | 4037 | data = (
' ', # 0x00
', ', # 0x01
'. ', # 0x02
'"', # 0x03
'[JIS]', # 0x04
'"', # 0x05
'/', # 0x06
'0', # 0x07
'<', # 0x08
'> ', # 0x09
'<<', # 0x0a
'>> ', # 0x0b
'[', # 0x0c
'] ', # 0x0d
'{', # 0x0e
'} ', # 0x0f
'[(', # 0x10
')] ', # 0x11
'@', # 0x12
'X ', # ... | gpl-2.0 |
dsajkl/reqiop | common/test/acceptance/fixtures/course.py | 18 | 18224 | """
Fixture to create a course and course components (XBlocks).
"""
import mimetypes
import json
import re
import datetime
import requests
from textwrap import dedent
from collections import namedtuple
from path import path
from lazy import lazy
from opaque_keys.edx.keys import CourseKey
from . import STUDIO_BASE_URL... | agpl-3.0 |
HenriWahl/Nagstamon | Nagstamon/thirdparty/Xlib/keysymdef/korean.py | 14 | 2860 | XK_Hangul = 0xff31
XK_Hangul_Start = 0xff32
XK_Hangul_End = 0xff33
XK_Hangul_Hanja = 0xff34
XK_Hangul_Jamo = 0xff35
XK_Hangul_Romaja = 0xff36
XK_Hangul_Codeinput = 0xff37
XK_Hangul_Jeonja = 0xff38
XK_Hangul_Banja = 0xff39
XK_Hangul_PreHanja = 0xff3a
XK_Hangul_PostHanja = 0xff3b
XK_Hangul_SingleCandidate = 0xff3c
XK_Han... | gpl-2.0 |
bzhou26/NRA-Crawler | selenium/webdriver/support/color.py | 71 | 11399 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | mit |
Xtrend-Official/Xtrend-E2 | lib/python/Screens/VirtualKeyBoard.py | 5 | 18445 | # -*- coding: UTF-8 -*-
from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_CENTER, RT_VALIGN_CENTER, getPrevAsciiCode
from Screen import Screen
from Components.Language import language
from Components.ActionMap import NumberActionMap
from Components.Sources.StaticText import StaticText
from Components.Inpu... | gpl-2.0 |
bailey-lab/bibseq | scripts/setUpScripts/generateCompFile.py | 8 | 1633 | #!/usr/bin/env python3
import shutil, os, argparse, sys, stat
from genFuncs import genHelper
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-CC', type=str)
parser.add_argument('-CXX', type=str)
parser.add_argument('-outname', type=str)
parser.add_argument('-outFilename'... | gpl-3.0 |
tebriel/dd-agent | tests/checks/mock/test_mesos_slave.py | 45 | 1565 | # stdlib
import json
# 3p
from mock import patch
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest, Fixtures, get_check_class
def _mocked_get_state(*args, **kwargs):
state = json.loads(Fixtures.read_file('state.json'))
return state
de... | bsd-3-clause |
Panos512/invenio | modules/bibsword/lib/bibsword_client_templates.py | 37 | 41746 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2010, 2011 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 optio... | gpl-2.0 |
philippze/django-cms | cms/tests/test_templatetags.py | 17 | 20005 | from __future__ import with_statement
from copy import deepcopy
import os
from classytags.tests import DummyParser, DummyTokens
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.core import mail
from django.core.exceptions imp... | bsd-3-clause |
naousse/odoo | openerp/modules/__init__.py | 352 | 1516 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
hydrospanner/DForurm | DForurm/env/Lib/site-packages/django/contrib/admin/views/main.py | 49 | 16694 | import sys
from collections import OrderedDict
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from djang... | mit |
leonardo-modules/leonardo-ckeditor | leonardo_ckeditor/ckeditor_config.py | 1 | 1037 |
from ckeditor.widgets import DEFAULT_CONFIG
DEFAULT_CONFIG.update({'allowedContent': True})
DEFAULT_CONFIG.update({'height': 350})
DEFAULT_CONFIG.update({'toolbar_Full': [
["Cut", "Copy", "Paste", "PasteText",
"PasteFromWord", "-", "Undo", "Redo"],
["Find", "Replace", "-", "SelectAll", "-", "SpellCheck... | bsd-3-clause |
DylannCordel/django-cms | cms/migrations/0010_migrate_use_structure.py | 15 | 2287 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission, Group
from django.contrib.contenttypes.models import ContentType
from django.db import models, migrations
def forwards(apps, schema_editor):
ph_model =... | bsd-3-clause |
jamesbdunlop/defaultMayaLibrary | yaml_import/skinWeights_Import.py | 1 | 5283 | from maya.OpenMayaAnim import MFnSkinCluster
from maya.OpenMaya import MIntArray, MDagPathArray
import os, getpass
import cPickle as pickle
import maya.mel as mel
import maya.cmds as cmds
import maya.OpenMaya as om
import maya.OpenMayaAnim as oma
import cPickle as pickle
import getpass, os, time
def getIndexes():
... | apache-2.0 |
ibarbech/learnbot | learnbot_components/emotionalMotor/src/specificworker.py | 2 | 8944 | #
# Copyright (C) 2017 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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... | gpl-3.0 |
quoideneuf/selenium | py/test/selenium/webdriver/common/stale_reference_tests.py | 65 | 2352 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
sam81/pychoacoustics | pychoacoustics/stats_utils.py | 1 | 4020 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2020 Samuele Carcagno <sam.carcagno@gmail.com>
# This file is part of pychoacoustics
# pychoacoustics 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,... | gpl-3.0 |
ifduyue/sentry | src/sentry/south_migrations/0013_auto__add_messagecountbyminute__add_unique_messagecountbyminute_group_.py | 5 | 11565 | # 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 'MessageCountByMinute'
db.create_table(
'sentry_messagecountbyminute', (
... | bsd-3-clause |
brownian/frescobaldi | frescobaldi_app/objecteditor/defineoffset.py | 3 | 3424 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
kvar/ansible | lib/ansible/modules/cloud/docker/docker_host_info.py | 14 | 11807 | #!/usr/bin/python
#
# (c) 2019 Piotr Wojciechowski <piotr@it-playground.pl>
# 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',
... | gpl-3.0 |
EliasTouil/simpleBlog | simpleBlog/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py | 360 | 2852 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | gpl-3.0 |
2014c2g7/c2g7 | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/test_result.py | 788 | 19069 | import io
import sys
import textwrap
from test import support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestResult.shouldStop because t... | gpl-2.0 |
aaldaber/owid-grapher | importer/edstats_importer.py | 1 | 48292 | import sys
import os
import hashlib
import json
import logging
import requests
import unidecode
import shutil
import time
import zipfile
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import grapher_admin.wsgi
from openpyxl import load_workbook
from grapher_admin.models import Entity, DatasetSubcategory, DatasetCa... | mit |
grpc/grpc | examples/python/metadata/helloworld_pb2_grpc.py | 148 | 1331 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import helloworld_pb2 as helloworld__pb2
class GreeterStub(object):
"""The greeting service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SayHello = c... | apache-2.0 |
DavidLP/home-assistant | homeassistant/components/config/customize.py | 8 | 1403 | """Provide configuration end points for Customize."""
from homeassistant.components.homeassistant import SERVICE_RELOAD_CORE_CONFIG
from homeassistant.config import DATA_CUSTOMIZE
from homeassistant.core import DOMAIN
import homeassistant.helpers.config_validation as cv
from . import EditKeyBasedConfigView
CONFIG_PAT... | apache-2.0 |
hashimmm/iiifoo | source_mappings.py | 1 | 1933 | import inspect
from mapped_source_requests import mapping_interfaces
from authoring_requests import authoring_api_mixins, authoring_base
from authoring_requests.authoring_requests import (
VanillaBase, VanillaDeleteRequest, VanillaExportRequest,
StandardAuthoringAPIv1, StandardAuthoringAPIv1Base
)
from mapped_s... | mit |
hectord/lettuce | tests/integration/lib/Django-1.2.5/django/db/models/sql/subqueries.py | 45 | 7688 | """
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.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models.sql.expressions import SQLEval... | gpl-3.0 |
userdw/RaspberryPi_3_Starter_Kit | 05_Ambient_Light_Monitoring/Ambient_Light_Monitoring/MCP3202.py | 4 | 1394 | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
import datetime
import os
from time import strftime
CS = 4
CS2 = 7
CLK = 11
MOSI = 10
MISO = 9
LDAC = 8
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(CS, GPIO.OUT)
GPIO.setup(CLK, GPIO.OUT)
GPIO.setup(MOSI, GPIO.OUT)
GPIO.setup(CS2, GPIO.OUT)
GPIO.setu... | mit |
marctc/django-extensions | django_extensions/management/commands/pipchecker.py | 27 | 11745 | import json
import os
from distutils.version import LooseVersion
from optparse import make_option
import pip
from django.core.management.base import NoArgsCommand, CommandError
from pip.req import parse_requirements
from django_extensions.management.color import color_style
from django_extensions.management.utils imp... | mit |
aselle/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/batch_reshape_test.py | 14 | 21821 | # 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 |
pkuyym/Paddle | benchmark/paddle/image/smallnet_mnist_cifar.py | 20 | 1367 | #!/usr/bin/env python
from paddle.trainer_config_helpers import *
height = 32
width = 32
num_class = 10
batch_size = get_config_arg('batch_size', int, 128)
args = {'height': height, 'width': width, 'color': True, 'num_class': num_class}
define_py_data_sources2(
"train.list", None, module="provider", obj="proces... | apache-2.0 |
meee1/ardupilot | Tools/scripts/rcda_decode.py | 22 | 1487 | #!/usr/bin/env python
'''
decode RCDA messages from a log and optionally play back to a serial port. The RCDA message is
captures RC input bytes when RC_OPTIONS=16 is set
'''
import struct
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--condition", default=None... | gpl-3.0 |
dhruvsrivastava/OJ | flask/lib/python2.7/site-packages/alembic/ddl/base.py | 40 | 5924 | import functools
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.schema import DDLElement, Column
from sqlalchemy import Integer
from sqlalchemy import types as sqltypes
from .. import util
# backwards compat
from ..util.sqla_compat import ( # noqa
_table_for_constraint,
_columns_for_constraint,... | bsd-3-clause |
nuuuboo/odoo | addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py | 318 | 9494 | # -*- 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 |
FusionSP/android_external_chromium_org | tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor_unittest.py | 25 | 5761 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core.platform.power_monitor import sysfs_power_monitor
class SysfsPowerMonitorMonitorTest(unittest.TestCase):
initial_fre... | bsd-3-clause |
hydroffice/hyo_soundspeed | examples/soundspeed/ex_read_and_write.py | 1 | 1724 | import os
import logging
from hyo2.soundspeedmanager import app_info
from hyo2.soundspeed.soundspeed import SoundSpeedLibrary
from hyo2.soundspeed.base.testing import SoundSpeedTesting
from hyo2.soundspeed.base.callbacks.fake_callbacks import FakeCallbacks
from hyo2.abc.lib.logging import set_logging
ns_list = ["hyo2... | lgpl-2.1 |
tarzan0820/odoo | addons/account/project/__init__.py | 427 | 1100 | # -*- 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 |
luisleao/hackathononibussp | scripts/gtfs_calculos.py | 1 | 8583 | #!/usr/bin/python
import sys
import os
import json
import pyes, pprint
import codecs
import math
from math import radians, sin, cos, sqrt, atan2
from datetime import datetime, timedelta
from os import listdir
from StringIO import StringIO
def save_file(filename, json_data):
print "salvando '%s'..." % filename
... | apache-2.0 |
tomduijf/home-assistant | homeassistant/components/device_tracker/netgear.py | 7 | 3242 | """
homeassistant.components.device_tracker.netgear
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning a Netgear router for device
presence.
Configuration:
To use the Netgear tracker you will need to add something like the following
to your configuration.yaml file.
device_... | mit |
ezequielpereira/Time-Line | libs/wx/lib/floatcanvas/Utilities/Colors.py | 9 | 4097 | #!/usr/bin/env python
"""
Colors.py
Assorted stuff for Colors support. At the moment, only a few color sets.
Many of these are from:
http://geography.uoregon.edu/datagraphics/color_scales.htm
They may have been modified some
CategoricalColor1: A list of colors that are distict.
BlueToRed11: 11 colors from blue to ... | gpl-3.0 |
jspraul/bite-project | tools/bugs/server/appengine/providers/crawler_base.py | 17 | 1081 | # 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 by applicable law or a... | apache-2.0 |
salfab/CouchPotatoServer | couchpotato/core/providers/torrent/hdbits/main.py | 9 | 2136 | from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentProvider
import traceback
log = CPLog(__name__)
class HDBits(TorrentProvid... | gpl-3.0 |
knowsis/django | django/test/client.py | 13 | 23477 | from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from io import BytesIO
from django.conf import settings
from django.contrib.auth import authenticate, login, logout, get_user_model
from django.core.handlers.base import BaseHandler
from django.core.handlers.... | bsd-3-clause |
Nexenta/s3-tests | virtualenv/lib/python2.7/site-packages/requests/packages/chardet/eucjpprober.py | 215 | 3506 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
Laurawly/tvm-1 | python/tvm/topi/cuda/conv2d_nhwc.py | 2 | 4966 | # 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 |
fu3kingt3pe/spiderfoot | ext/stem/control.py | 10 | 128760 | # Copyright 2011-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Module for interacting with the Tor control socket. The
:class:`~stem.control.Controller` is a wrapper around a
:class:`~stem.socket.ControlSocket`, retaining many of its methods (connect,
close, is_alive, etc) in add... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/cosmos/azure-cosmos/test/test_encoding.py | 1 | 2872 | # -*- coding: utf-8 -*-
import unittest
import azure.cosmos.cosmos_client as cosmos_client
import uuid
import pytest
import test_config
pytestmark = pytest.mark.cosmosEmulator
@pytest.mark.usefixtures("teardown")
class EncodingTest(unittest.TestCase):
"""Test to ensure escaping of non-ascii characters from parti... | mit |
oleksa-pavlenko/gae-django-project-template | django/views/csrf.py | 107 | 4958 | from django.conf import settings
from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.utils.translation import ugettext as _
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and ... | mit |
SaschaMester/delicium | third_party/pycoverage/coverage/xmlreport.py | 159 | 5809 | """XML reporting for coverage.py"""
import os, sys, time
import xml.dom.minidom
from coverage import __url__, __version__
from coverage.backward import sorted, rpartition # pylint: disable=W0622
from coverage.report import Reporter
def rate(hit, num):
"""Return the fraction of `hit`/`num`, as a string."""
... | bsd-3-clause |
Nikoala/CouchPotatoServer | libs/pyutil/increasing_timer.py | 106 | 6607 | # Copyright (c) 2001 Autonomous Zone Industries
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
This module was invented when it was discovered that time.time() can return
decreasing answers, which was causing scheduled tasks to get executed out ... | gpl-3.0 |
patjak/linux-stable | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
cafe-grader-team/cafe-grader-web | lib/assets/Lib/encodings/cp1252.py | 37 | 13818 | """ Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... | mit |
guokeno0/vitess | third_party/py/bson-0.3.2/bson/__init__.py | 36 | 3943 | #!/usr/bin/python -OOOO
# vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker :
# Copyright (c) 2010, Kou Man Tong. All rights reserved.
# For licensing, see LICENSE file included in the package.
"""
BSON serialization and deserialization logic.
Specifications taken from: http://bsonspec.or... | bsd-3-clause |
digdoritos/gimp | plug-ins/pygimp/plug-ins/palette-sort.py | 5 | 12031 | #!/usr/bin/env python
#
# 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 in the hope that... | gpl-3.0 |
alizamus/pox_controller | pox/proto/dns_spy.py | 45 | 4072 | # Copyright 2011-2012 James McCauley
#
# 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 ... | apache-2.0 |
vadimtk/chrome4sdp | third_party/mojo/src/mojo/public/third_party/jinja2/sandbox.py | 637 | 13445 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | bsd-3-clause |
antepsis/anteplahmacun | sympy/diffgeom/tests/test_function_diffgeom_book.py | 102 | 5258 | from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r
from sympy.diffgeom import intcurve_series, Differential, WedgeProduct
from sympy.core import symbols, Function, Derivative
from sympy.simplify import trigsimp, simplify
from sympy.functions import sqrt, atan2, sin, cos
from sympy.matrices import Matrix
# Most of the ... | bsd-3-clause |
danalec/dotfiles | sublime/.config/sublime-text-3/Packages/anaconda_go/plugin/handlers_go/commands/goto.py | 2 | 2949 |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import logging
import traceback
from ..anagonda.context import guru, godef
from ..anagonda.context.error import AnaGondaError
from commands.base import Command
class Goto(Command):
... | mit |
chauhanhardik/populo | lms/djangoapps/staticbook/views.py | 91 | 6351 | """
Views for serving static textbooks.
"""
from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.annotator_token import retrieve_token
from courseware.acces... | agpl-3.0 |
clee704/NaverWebtoonFeeds | docs/conf.py | 1 | 8308 | # -*- coding: utf-8 -*-
#
# NaverWebtoonFeeds documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 31 11:29:44 2013.
#
# 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 fil... | agpl-3.0 |
arruda/ANTLR3-python | unittests/testtree.py | 1 | 41340 | # -*- coding: utf-8 -*-
import os
import unittest
from StringIO import StringIO
from antlr3.tree import (CommonTreeNodeStream, CommonTree, CommonTreeAdaptor,
TreeParser, TreeVisitor)
from antlr3 import CommonToken, UP, DOWN, EOF
from antlr3.treewizard import TreeWizard
class TestTreeNodeStre... | bsd-3-clause |
2ndQuadrant/ansible | test/sanity/code-smell/shebang.py | 1 | 4826 | #!/usr/bin/env python
import os
import stat
import sys
def main():
standard_shebangs = set([
b'#!/bin/bash -eu',
b'#!/bin/bash -eux',
b'#!/bin/sh',
b'#!/usr/bin/env bash',
b'#!/usr/bin/env fish',
b'#!/usr/bin/env pwsh',
b'#!/usr/bin/env python',
b'#... | gpl-3.0 |
michaelgallacher/intellij-community | python/helpers/py3only/docutils/parsers/rst/languages/cs.py | 52 | 4781 | # $Id: cs.py 7119 2011-09-02 13:00:23Z milde $
# Author: Marek Blaha <mb@dat.cz>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each lan... | apache-2.0 |
celiafish/VisTrails | contrib/NumSciPy/ArrayOperations.py | 6 | 25493 | from core.modules.vistrails_module import Module, ModuleError
from Array import *
class ArrayOperationModule(object):
my_namespace = 'numpy|array|operations'
class ArrayReshape(ArrayOperationModule, Module):
""" Reshape the input array. The dimension sizes are presented
and used to reshape the array. P... | bsd-3-clause |
sylvinite/standalone_scripts | set_bioinforesponsible.py | 4 | 3296 |
""" Calls up the genologics LIMS directly in order to more quickly
set a bioinformatics responsible. Script can easily be altered
to be used to set other values."""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from genologics.lims import Lims
from genologics.config import BASEURI, USERNAME, PASS... | mit |
bricky/xbmc-addon-tvtumbler | resources/lib/unidecode/x074.py | 252 | 4696 | data = (
'Han ', # 0x00
'Xuan ', # 0x01
'Yan ', # 0x02
'Qiu ', # 0x03
'Quan ', # 0x04
'Lang ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Fu ', # 0x08
'Liu ', # 0x09
'Ye ', # 0x0a
'Xi ', # 0x0b
'Ling ', # 0x0c
'Li ', # 0x0d
'Jin ', # 0x0e
'Lian ', # 0x0f
'Suo ', # 0x10
'Chii... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.