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
thomasrstorey/Inter-pre-in-vention
backend/node_modules/fast-levenshtein/node_modules/grunt-npm-install/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
505
118664
# 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
OCA/l10n-brazil
l10n_br_stock_account/__manifest__.py
1
1134
# Copyright (C) 2014 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Brazilian Localization WMS Accounting", "category": "Localisation", "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OC...
agpl-3.0
hastexo/edx-platform
lms/lib/xblock/test/test_mixin.py
8
21705
""" Tests of the LMS XBlock Mixin """ import ddt from nose.plugins.attrib import attr from lms_xblock.mixin import ( INVALID_USER_PARTITION_GROUP_VALIDATION_COMPONENT, INVALID_USER_PARTITION_GROUP_VALIDATION_UNIT, INVALID_USER_PARTITION_VALIDATION_COMPONENT, INVALID_USER_PARTITION_VALIDATION_UNIT, ...
agpl-3.0
Catweazz/catweazz
lib/utils/beta/t0mm0/common/addon.py
17
26782
''' common XBMC Module Copyright (C) 2011 t0mm0 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. Th...
gpl-2.0
AlanD88/website
web2py/gluon/contrib/simplejson/__init__.py
49
17565
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
mit
jabesq/home-assistant
homeassistant/components/hitron_coda/device_tracker.py
7
4402
"""Support for the Hitron CODA-4582U, provided by Rogers.""" import logging from collections import namedtuple import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner) from homeassist...
apache-2.0
riklaunim/django-custom-multisite
tests/regressiontests/views/models.py
144
1202
""" Regression tests for Django built-in views. """ from django.db import models class Author(models.Model): name = models.CharField(max_length=100) def __unicode__(self): return self.name def get_absolute_url(self): return '/views/authors/%s/' % self.id class BaseArticle(models.Model):...
bsd-3-clause
rdo-management/ironic
ironic/db/api.py
5
13180
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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
openfun/edx-platform
openedx/core/djangoapps/content/course_structures/api/v0/serializers.py
65
1313
""" API Serializers """ from rest_framework import serializers class GradingPolicySerializer(serializers.Serializer): """ Serializer for course grading policy. """ assignment_type = serializers.CharField(source='type') count = serializers.IntegerField(source='min_count') dropped = serializers.IntegerF...
agpl-3.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/sklearn/externals/joblib/numpy_pickle.py
37
23222
"""Utilities for fast persistence of big data, with optional compression.""" # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import os import sys import warnings try: from pathlib import Path except ImportError:...
mit
florentchandelier/keras
keras/regularizers.py
81
1907
from __future__ import absolute_import import theano.tensor as T class Regularizer(object): def set_param(self, p): self.p = p def set_layer(self, layer): self.layer = layer def __call__(self, loss): return loss def get_config(self): return {"name": self.__class__.__...
mit
ScreamingUdder/mantid
scripts/test/ISISPowderSampleDetailsTest.py
2
20166
from __future__ import (absolute_import, division, print_function) import mantid import io import six import sys import unittest from isis_powder.routines import sample_details from six_shim import assertRaisesRegex, assertRegex class ISISPowderSampleDetailsTest(unittest.TestCase): def test_constructor(self): ...
gpl-3.0
nitzmahone/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_region_facts.py
35
2897
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty...
gpl-3.0
proxysh/Safejumper-for-Desktop
buildmac/Resources/env/lib/python2.7/site-packages/twisted/news/database.py
10
33683
# -*- test-case-name: twisted.news.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ News server backend implementations. """ import getpass, pickle, time, socket import os import StringIO from hashlib import md5 from email.Message import Message from email.Generator import Generato...
gpl-2.0
mvesper/invenio
modules/websearch/lib/websearch_external_collections_unit_tests.py
3
4111
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, ...
gpl-2.0
flyher/pymo
symbian/PythonForS60_1.9.6/module-repo/standard-modules/encodings/iso2022_kr.py
816
1053
# # iso2022_kr.py: Python Unicode Codec for ISO2022_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncod...
mit
Rogentos/rogentos-anaconda
booty/ia64.py
3
1456
from booty import BootyNoKernelWarning from bootloaderInfo import * class ia64BootloaderInfo(efiBootloaderInfo): def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): config = bootloaderInfo.getBootloaderConfig(self, instRoot, ...
gpl-2.0
ZhenxingWu/luigi
luigi/server.py
24
10444
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
doughgle/pomodoro_evolved
pomodoro_evolved/native_ui.py
1
4010
import Tkinter as tk import tkFont import tkMessageBox from pomodoro import Pomodoro from datetime import timedelta, datetime from Queue import Queue, Empty from rest_break import Break as ShortBreak from rest_break import Break as LongBreak from timer_log import TimerLog class NativeUI(tk.Tk): def __init__(s...
mit
openscriptures/Biblelator
Biblelator/Windows/TSVEditWindow.py
1
137680
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # TSVEditWindow.py # # The edit windows for Biblelator TSV table editing # # Copyright (C) 2020 Robert Hunt # Author: Robert Hunt <Freely.Given.org+Biblelator@gmail.com> # License: See gpl-3.0.txt # # This program is free software: you can redistribute it and/or modify...
gpl-3.0
nicholedwight/nichole-theme
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/parsers.py
363
25835
# -*- coding: utf-8 -*- """ pygments.lexers.parsers ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for parser generators. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, \ include...
mit
Varun-Teja/Projects
Encryption/Security.py
1
8006
'''Copyright (c) 2015 HG,DL,UTA Python program runs on local host, uploads, downloads, encrypts local files to google. Please use python 2.7.X, pycrypto 2.6.1 and Google Cloud python module ''' #import statements. import argparse import httplib2 import os import sys import json import time import datetime impor...
mit
toumorokoshi/yelo
yelo/views.py
1
3859
import json from django.contrib.auth.models import User, Group from django.http import JsonResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rest_framework import viewsets from yelo.lib.elo_utils import play_match from yelo.lib.http import api_error from yelo.models ...
mit
munnerz/CouchPotatoServer
libs/caper/matcher.py
81
4952
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # 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...
gpl-3.0
Talkdesk/graphite-web
webapp/graphite/whitelist/views.py
5
1960
"""Copyright 2008 Orbitz WorldWide 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...
apache-2.0
petemounce/ansible
lib/ansible/modules/cloud/openstack/os_volume.py
11
5663
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 late...
gpl-3.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/lib2to3/fixes/fix_exitfunc.py
291
2505
""" Convert use of sys.exitfunc to use the atexit module. """ # Author: Benjamin Peterson from lib2to3 import pytree, fixer_base from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms class FixExitfunc(fixer_base.BaseFix): keep_line_order = True BM_compatible = True PATTERN = """ ...
mit
andim/scipy
scipy/fftpack/tests/test_helper.py
63
1934
#!/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
Julioocz/SIMNAV
simnav/termodinamica/ideal.py
1
2516
"""Ecuaciones termodinamicas ideales para el calculo de propiedades termodinamicas del Manual del ingeniero quimico Perry""" from math import sinh, cosh from scipy import integrate import numpy as np def antoine(T, C1, C2, C3, C4, C5): """Ecuación para calculo de presión de vapor (Pa)""" return np.exp(C1 + ...
mit
andref/Unnatural-Sublime-Package
events.py
1
1798
# encoding: utf-8 import sublime, sublime_plugin try: from . import util except ValueError: import util class PerformEventListener(sublime_plugin.EventListener): """Suggest subroutine completions for the perform statement.""" def on_query_completions(self, view, prefix, points): if not util....
mit
vetalypp/e2openplugin-CrossEPG
scripts/lib/scriptlib.py
2
10585
#!/usr/bin/python # scriptlib.py by Ambrosa http://www.ambrosa.net # derived from E2_LOADEPG # 22-Dec-2011 __author__ = "ambrosa http://www.ambrosa.net" __copyright__ = "Copyright (C) 2008-2011 Alessandro Ambrosini" __license__ = "CreativeCommons by-nc-sa http://creativecommons.org/licenses/by-nc-sa/3.0/" import os...
lgpl-2.1
jerem/Whoosh
src/whoosh/filedb/fileindex.py
1
19208
#=============================================================================== # Copyright 2009 Matt Chaput # # 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/li...
apache-2.0
riveridea/gnuradio
gr-qtgui/apps/plot_spectrogram_form.py
11
7041
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
iap-mutant/godot
doc/tools/makedocs.py
25
14752
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # makedocs.py: Generate documentation for Open Project Wiki # Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. # Contributor: Jorge Araya Navarro <elcorreo@deshackra.com> # # IMPORTANT NOTICE: # If you are going to modify anything from this file, please be sure to fol...
mit
Nitaco/ansible
lib/ansible/modules/storage/netapp/na_ontap_ucadapter.py
8
5936
#!/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'], 'supported_...
gpl-3.0
tekapo/fabric
tests/utils.py
30
6045
from __future__ import with_statement from contextlib import contextmanager from copy import deepcopy from fudge.patcher import with_patched_object from functools import partial from types import StringTypes import copy import getpass import os import re import shutil import sys import tempfile from fudge import Fake...
bsd-2-clause
derblub/pixelpi
screen/virtualscreen.py
1
1561
import pygame from abstractscreen import AbstractScreen from settings import * S = Settings() instance = None # Behaves like the actual LED screen, but shows the screen content on a computer screen class VirtualScreen(AbstractScreen): def __init__(self, width=int(S.get('screen', 'matrix_width'...
mit
Valka7a/python-playground
python-the-hard-way/43-basic-object-oriented-analysis-and-design.py
1
13790
# Exercise 43: Basic Object-Oriented Analysis and Design # Process to build something to evolve problems # 1. Write or draw about the problem. # 2. Extract key concepts from 1 and research them. # 3. Create a class hierarchy and object map for the concepts. # 4. Code the classes and a test to run them. # 5. Repeat and...
mit
hkariti/ansible
lib/ansible/utils/module_docs_fragments/fortios.py
85
2307
# # (c) 2017, Benjamin Jolivot <bjolivot@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 of the License, or # (at your option) any later...
gpl-3.0
longmen21/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_export_all_courses.py
187
2065
""" Test for export all courses. """ import shutil from tempfile import mkdtemp from contentstore.management.commands.export_all_courses import export_courses_to_output_path from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils i...
agpl-3.0
xifle/home-assistant
homeassistant/components/climate/mysensors.py
10
7483
""" mysensors platform that offers a Climate(MySensors-HVAC) component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/climate.mysensors """ import logging from homeassistant.components import mysensors from homeassistant.components.climate import ( ST...
mit
deer-hope/zulip
zerver/lib/tornado_ioloop_logging.py
115
2820
from __future__ import absolute_import import logging import time import select from tornado import ioloop from django.conf import settings try: # Tornado 2.4 orig_poll_impl = ioloop._poll def instrument_tornado_ioloop(): ioloop._poll = InstrumentedPoll except: # Tornado 3 from tornado.iol...
apache-2.0
lekum/ansible
lib/ansible/plugins/action/set_fact.py
51
1392
# Copyright 2013 Dag Wieers <dag@wieers.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 of the License, or # (at your option) any later versio...
gpl-3.0
PierreFaniel/openerp-7.0
sale_order_line/__init__.py
4
1106
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2013 Elico Corp. All Rights Reserved. # Author: LIN Yu <lin.yu@elico-corp.com> # # This program is free software: you can redistribute it a...
agpl-3.0
michalkurka/h2o-3
h2o-py/h2o/estimators/random_forest.py
2
83030
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py # Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details) # from __future__ import absolute_import, division, print_function, unicode_literals from h2o.utils.metaclass import dep...
apache-2.0
piyush1911/git-cola
cola/widgets/browse.py
3
28400
from __future__ import division, absolute_import, unicode_literals from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtCore import Qt from PyQt4.QtCore import SIGNAL from cola import cmds from cola import core from cola import difftool from cola import gitcmds from cola import hotkeys from cola import icons...
gpl-2.0
AnishShah/tensorflow
tensorflow/python/autograph/utils/type_check_test.py
11
1545
# 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
jank3/django
tests/migrate_signals/tests.py
324
3585
from django.apps import apps from django.core import management from django.db.models import signals from django.test import TestCase, override_settings from django.utils import six APP_CONFIG = apps.get_app_config('migrate_signals') PRE_MIGRATE_ARGS = ['app_config', 'verbosity', 'interactive', 'using'] MIGRATE_DATABA...
bsd-3-clause
Forage/Gramps
gramps/gen/svn_revision.py
1
1853
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2012 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...
gpl-2.0
SebasSBM/django
tests/forms_tests/tests/tests.py
89
16458
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
bsd-3-clause
Rjtsahu/School-Bus-Tracking
BusTrack/repository/main.py
1
1036
from BusTrack.repository import Base from BusTrack.repository import engine # import all relevant db models here. from BusTrack.repository.models.Bus import Bus from BusTrack.repository.models.UserType import UserType from BusTrack.repository.models.User import User from BusTrack.repository.models.UserLogin import Use...
gpl-3.0
le9i0nx/ansible
lib/ansible/modules/network/nxos/nxos_ntp_auth.py
19
9675
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
n0trax/ansible
lib/ansible/modules/network/nxos/nxos_gir.py
15
12164
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
ldoktor/avocado-vt
virttest/utils_libvirtd.py
6
10167
""" Module to control libvirtd service. """ import re import logging import aexpect from avocado.utils import path from avocado.utils import process from avocado.utils import wait from . import remote from . import utils_misc from .staging import service from .utils_gdb import GDB try: path.find_command("libvirt...
gpl-2.0
patricklaw/pip
pip/req/req_uninstall.py
87
7107
from __future__ import absolute_import import imp import logging import os import sys import tempfile from pip.compat import uses_pycache, WINDOWS from pip.exceptions import UninstallationError from pip.utils import (rmtree, ask, is_local, dist_is_local, renames, normalize_path) from pip.utils....
mit
brandond/ansible
lib/ansible/modules/network/cnos/cnos_interface.py
52
18994
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # (c) 2017, Ansible by 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, eith...
gpl-3.0
engr-hasanuzzaman/engr-hasanuzzaman.github.io
node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py
1369
3662
# 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
apache-2.0
intlabs/cannyos-backend-dashboard
horizon-master/openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/tables.py
14
2408
# 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 t...
mit
MCMic/Sick-Beard
lib/requests/packages/chardet/euctwprober.py
2994
1676
######################## 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...
gpl-3.0
lokirius/python-for-android
python3-alpha/python3-src/Lib/test/test_runpy.py
48
17205
# Test the runpy module import unittest import os import os.path import sys import re import tempfile import py_compile from test.support import forget, make_legacy_pyc, run_unittest, unload, verbose from test.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, temp_dir) from runpy import...
apache-2.0
rabid-inventor/ShiftOutPi
shiftout.py
1
2547
import RPi.GPIO as GPIO from time import sleep as sleep ''' Defining class to handle shifing data out to shift register OutPin = output pin ClkPin = clock Pin Len = length of data in bytes (default 1 Byte) Speed = delay between each bit (Default 0.01 sec) ''' # Keyword args, ie: def my_function(*args...
gpl-3.0
moomou/heron
heron/common/tests/python/utils/outgoing_tuple_helper_unittest.py
10
1912
# Copyright 2016 Twitter. 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 agree...
apache-2.0
mogoweb/chromium-crosswalk
native_client_sdk/src/build_tools/build_updater.py
28
6330
#!/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. """Build script to generate a new sdk_tools bundle. This script packages the files necessary to generate the SDK updater -- the to...
bsd-3-clause
jaymin-panchal/zang-python
tests/inboundxml/test_say.py
2
1404
import unittest from zang.inboundxml.elements.say import Say from zang.inboundxml.elements.base_node import BaseNode from zang.inboundxml.elements.enums.voice import Voice class TestSay(unittest.TestCase): def setUp(self): self.text = 'Hello from Zang' def test_init_with_required_values(self): ...
mit
underarmour/destalinator
tests/test_destalinator.py
1
28465
# pylint: disable=W0201 from datetime import date, datetime, timedelta import mock import os import unittest import destalinator import slacker import slackbot sample_slack_messages = [ { "type": "message", "channel": "C2147483705", "user": "U2147483697", "text": "Human human huma...
apache-2.0
frascoweb/frasco
frasco/billing/eu_vat/data.py
1
5059
from frasco import current_app from frasco.ext import get_extension_state from suds.client import Client as SudsClient from suds import WebFault import xml.etree.ElementTree as ET import requests import datetime EU_COUNTRIES = { "AT": "EUR", # Austria "BE": "EUR", # Belgium "BG": "BGN", # Bulgaria "DE...
mit
daoluan/decode-Django
Django-1.5.1/tests/regressiontests/introspection/tests.py
44
7272
from __future__ import absolute_import, unicode_literals from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from django.utils import six, unittest from .models import Reporter, Article if connection.vendor == 'oracle': exp...
gpl-2.0
ondra-novak/chromium.src
tools/telemetry/telemetry/results/gtest_progress_reporter.py
6
4171
# 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 time from telemetry.results import progress_reporter from telemetry.value import failure from telemetry.value import skip class GTestProgressReport...
bsd-3-clause
Xanwar/android_kernel_asus_a500cg
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
facebookexperimental/eden
eden/scm/edenscm/mercurial/pathutil.py
2
9984
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # Copyright 2013 Mercurial Contributors # # This software may be used and distributed according to the terms of the # GNU General Public Licens...
gpl-2.0
piyush82/icclab-rcb-web
virtualenv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py
17
7569
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import logging import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient fr...
apache-2.0
XianliangJ/collections
Jellyfish/pox/pox/controllers/distributed_controller.py
7
5602
#!/usr/bin/env python # Nom nom nom nom # TODO: there is currently a dependency on the order of initialization of # client and server... . for example: # $ pox.py nom_client nom_server # blocks indefinitely # whereas # $ pox.py nom_server nom_client # works from pox.core import core, UpEvent from pox.lib.r...
gpl-3.0
mlperf/training_results_v0.6
NVIDIA/benchmarks/gnmt/implementations/pytorch/seq2seq/train/trainer.py
1
18009
import logging import os import time from itertools import cycle import numpy as np import torch import torch.optim import torch.utils.data from apex.parallel import DistributedDataParallel as DDP from apex.optimizers import FusedAdam from apex import amp import mlperf_compliance from seq2seq.train.fp_optimizers impo...
apache-2.0
nicobustillos/odoo
addons/im_chat/im_chat.py
28
21908
# -*- coding: utf-8 -*- import base64 import datetime import logging import time import uuid import random import simplejson import openerp from openerp.http import request from openerp.osv import osv, fields from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from openerp.addons.bus.bus import TIMEOUT _lo...
agpl-3.0
kerr-huang/SL4A
python/src/Lib/plat-mac/Carbon/Components.py
81
2301
# Generated from 'Components.h' def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 cmpIsM...
apache-2.0
ahnchan2/linux
scripts/gdb/linux/modules.py
774
2718
# # gdb helper commands and functions for Linux kernel debugging # # module tools # # Copyright (c) Siemens AG, 2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import cpus, utils module_type = utils.CachedType("str...
gpl-2.0
amyliu345/zulip
tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py
16
2033
#!/usr/bin/env python from __future__ import print_function import os from posixpath import basename from six.moves.urllib.parse import urlparse from .common.spiders import BaseDocumentationSpider from typing import Any, List, Set def get_help_images_dir(help_images_path): # type: (str) -> str # Get index...
apache-2.0
sdx23/khal
khal/calendar_display.py
4
8355
# Copyright (c) 2013-2021 khal contributors # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publi...
mit
wildjan/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/contrib/sessions.py
295
12450
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
apache-2.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/nltk/metrics/segmentation.py
5
7186
# Natural Language Toolkit: Text Segmentation Metrics # # Copyright (C) 2001-2017 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> # David Doukhan <david.doukhan@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Text Segme...
apache-2.0
jruiperezv/ANALYSE
cms/djangoapps/contentstore/features/course-outline.py
13
4617
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from common import * from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611 from logging import getLogger logger = getLogger(__name__) @step(u'I have a course with no sections$') def have_a_course(step):...
agpl-3.0
franciscodominguezmateos/DeepLearningNanoDegree
transfer-learning/tensorflow_vgg/test_vgg19_trainable.py
152
1435
""" Simple tester for the vgg19_trainable """ import tensorflow as tf from tensoflow_vgg import vgg19_trainable as vgg19 from tensoflow_vgg import utils img1 = utils.load_image("./test_data/tiger.jpeg") img1_true_result = [1 if i == 292 else 0 for i in range(1000)] # 1-hot result for tiger batch1 = img1.reshape((1...
mit
adaur/SickRage
lib/html5lib/treewalkers/lxmletree.py
618
6033
from __future__ import absolute_import, division, unicode_literals from six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isin...
gpl-3.0
samueldotj/TeeRISC-Simulator
src/cpu/CheckerCPU.py
69
2022
# Copyright (c) 2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
ddico/odoo
addons/sale_stock/tests/test_anglo_saxon_valuation.py
1
45077
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import Form, tagged from odoo.tests.common import SavepointCase from odoo.exceptions import UserError @tagged('post_install', '-at_install') class TestAngloSaxonValuation(SavepointCase): @classmetho...
agpl-3.0
spotify/luigi
luigi/contrib/hadoop.py
4
37516
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
foss-transportationmodeling/rettina-server
flask/local/lib/python2.7/site-packages/whoosh/idsets.py
52
19132
""" An implementation of an object that acts like a collection of on/off bits. """ import operator from array import array from bisect import bisect_left, bisect_right, insort from whoosh.compat import integer_types, izip, izip_longest, next, xrange from whoosh.util.numeric import bytes_for_bits # Number of '1' bit...
apache-2.0
foss-transportationmodeling/rettina-server
.env/lib/python2.7/site-packages/whoosh/compat.py
72
5322
import array, sys # Run time aliasing of Python2/3 differences def htmlescape(s, quote=True): # this is html.escape reimplemented with cgi.escape, # so it works for python 2.x, 3.0 and 3.1 import cgi s = cgi.escape(s, quote) if quote: # python 3.2 also replaces the single quotes: ...
apache-2.0
vbocan/Voltcraft-Data-Analyzer
DataExport.py
1
12612
#!python3 """ Project: Voltcraft Data Analyzer Author: Valer Bocan, PhD <valer@bocan.ro> Last updated: September 14th, 2014 Module description: The VoltcraftDataFile module processes data files containing history of voltage, current and power factor, as generated by the Voltcraft Energy-Logge...
mit
PulsePod/evepod
lib/python2.7/site-packages/pip/vendor/html5lib/treewalkers/genshistream.py
1730
2278
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
apache-2.0
systers/postorius
src/postorius/tests/test_urls.py
1
1544
# -*- coding: utf-8 -*- # Copyright (C) 2016-2018 by the Free Software Foundation, Inc. # # This file is part of Postorius. # # Postorius 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...
gpl-3.0
maweki/more-collections
setup.py
1
1949
from distutils.core import setup setup( name="more_collections", packages = ['more_collections'], version="0.3.0", author="Mario Wenzel", author_email="maweki@gmail.com", url="https://github.com/maweki/more-collections", description="more_collections is a Python library providing more colle...
mit
Fusion-Rom/android_external_chromium_org
tools/telemetry/telemetry/timeline/process.py
45
2957
# 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 telemetry.timeline.counter as tracing_counter import telemetry.timeline.event as event_module import telemetry.timeline.event_container as event_conta...
bsd-3-clause
brianzelip/militarization
css/basscss/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/terminal.py
50
5401
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
gpl-2.0
sbidoul/odoo
addons/account_check_writing/report/__init__.py
446
1066
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
Dhivyap/ansible
lib/ansible/modules/network/panos/_panos_query_rules.py
41
18602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
jarrahwu/tornado
maint/vm/windows/bootstrap.py
99
3423
r"""Installs files needed for tornado testing on windows. These instructions are compatible with the VMs provided by http://modern.ie. The bootstrapping script works on the WinXP/IE6 and Win8/IE10 configurations, although tornado's tests do not pass on XP. 1) Install virtualbox guest additions (from the device menu i...
apache-2.0
akintolga/superdesk-core
superdesk/macros/update_to_pass_validation.py
1
2481
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
agpl-3.0
bancek/egradebook
src/lib/django/template/__init__.py
561
3247
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
gpl-3.0
wyom/sympy
sympy/utilities/pkgdata.py
109
1872
""" pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[pkgna...
bsd-3-clause