repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
Lx37/pyqtgraph | pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside.py | 50 | 12205 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui'
#
# Created: Mon Dec 23 10:10:52 2013
# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
... | mit |
tensorflow/agents | tf_agents/networks/network_test.py | 1 | 14557 | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
Eficent/odoomrp-wip | sale_order_recalculate_prices/__init__.py | 61 | 1629 | # -*- encoding: utf-8 -*-
##############################################################################
# #
# OpenERP, Open Source Management Solution. #
# ... | agpl-3.0 |
ZhangChuann/awesome-python-webapp | www/models.py | 1 | 1538 | #!/usr/bin/env python
# coding=utf-8
__author__ = 'ZHang Chuan'
'''
Models for user, blog, comment.
'''
import time, uuid
from transwarp.db import next_id
from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField
class User(Model):
__table__ = 'users'
id = StringField(primary_key=T... | gpl-3.0 |
marissazhou/django | django/utils/six.py | 408 | 30194 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
dawran6/zulip | zerver/views/realm_emoji.py | 12 | 1372 | from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from typing import Text
from zerver.models import UserProfile
from zerver.lib.emoji import check_emoji_admin, check_valid_emoji_name, check_valid_emoji
from zerver.lib.request im... | apache-2.0 |
absoludity/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/skipping.py | 168 | 12742 | """ support for skip/xfail functions and markers. """
import os
import sys
import traceback
import py
import pytest
from _pytest.mark import MarkInfo, MarkDecorator
def pytest_addoption(parser):
group = parser.getgroup("general")
group.addoption('--runxfail',
action="store_true", dest="runxfail", ... | mpl-2.0 |
neo1691/scorer.py | scorer/app.py | 1 | 1926 | import logging
from time import sleep
import scorer.fetch_scores as fs
import scorer.notification as notify
from scorer.system import exitApp
from scorer.ui import getUserInput
logger = logging.getLogger("scorer.app")
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler("scorer.log")
fh.setLevel(logging.DEBUG)
ch ... | gpl-2.0 |
AstroHuntsman/POCS | pocs/tests/test_config.py | 2 | 4469 | import os
import pytest
import uuid
import yaml
from astropy import units as u
from pocs.utils.config import load_config
from pocs.utils.config import save_config
def test_load_simulator(config):
assert 'camera' in config['simulator']
assert 'mount' in config['simulator']
assert 'weather' in config['sim... | mit |
simonwydooghe/ansible | lib/ansible/modules/network/check_point/cp_mgmt_exception_group.py | 20 | 6632 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... | gpl-3.0 |
kneufeld/crossbarexamples | rest/needs_cleanup/python/example/signed/test.py | 12 | 1213 | ###############################################################################
##
## Copyright (C) 2012-2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## h... | apache-2.0 |
marctc/wagtail | wagtail/wagtailadmin/tests/test_password_reset.py | 25 | 1304 | from django.test import TestCase, override_settings
from django.core import mail
from wagtail.tests.utils import WagtailTestUtils
class TestUserPasswordReset(TestCase, WagtailTestUtils):
fixtures = ['test.json']
# need to clear urlresolver caches before/after tests, because we override ROOT_URLCONF
# in... | bsd-3-clause |
ssbarnea/ansible | test/support/windows-integration/plugins/action/win_copy.py | 87 | 23564 | # This file is part of Ansible
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64
import json
import os
i... | gpl-3.0 |
botioni/aml_linux_kernel | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
andela-ifageyinbo/django | django/template/backends/django.py | 53 | 3918 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import sys
from importlib import import_module
from pkgutil import walk_packages
from django.apps import apps
from django.conf import settings
from django.template import TemplateDoesNotExist
from dja... | bsd-3-clause |
AdrianHuang/rt-thread | bsp/tm4c129x/rtconfig.py | 21 | 2501 | # BSP Note: For TI EK-TM4C1294XL Tiva C Series Connected LancuhPad (REV D)
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='keil'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
#device options
PART_TYPE = 'PART_TM4C129XNCZAD'
# cross_tool provides the cross compiler
# EXEC_PATH is t... | gpl-2.0 |
Backflipz/plugin.video.excubed | resources/lib/js2py/legecy_translators/translator.py | 96 | 5676 | from flow import translate_flow
from constants import remove_constants, recover_constants
from objects import remove_objects, remove_arrays, translate_object, translate_array, set_func_translator
from functions import remove_functions, reset_inline_count
from jsparser import inject_before_lval, indent, dbg
TOP_GLOBAL ... | gpl-2.0 |
pokowaka/atreus-firmware | tmk/tmk_core/tool/mbed/mbed-sdk/workspace_tools/host_tests/tcpecho_client_auto.py | 101 | 3319 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | gpl-3.0 |
anryko/ansible | lib/ansible/modules/storage/vexata/vexata_eg.py | 25 | 5824 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Sandeep Kasargod (sandeep@vexata.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_vers... | gpl-3.0 |
Trinak/PyHopeEngine | src/pyHopeEngine/graphics/sprite.py | 1 | 1261 | '''
Created on May 29, 2013
@author: Devon
Defines a game sprite
'''
import pygame
from pyHopeEngine import engineCommon as ECOM
class GameSprite(pygame.sprite.Sprite):
'''Base game sprite image'''
def __init__(self, file):
pygame.sprite.Sprite.__init__(self)
file = ECOM.engin... | gpl-3.0 |
espadrine/opera | chromium/src/third_party/trace-viewer/third_party/pywebsocket/src/example/bench_wsh.py | 495 | 2322 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
h3biomed/ansible-modules-core | network/cumulus/cl_interface_policy.py | 34 | 5248 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com>
#
# This file is part of Ansible
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | gpl-3.0 |
louisdijkstra/gonl-sv | back-up/version4/postprocess_tag_snps.py | 1 | 4919 | #!/usr/bin/env python
"""
Copyright (C) 2015 Louis Dijkstra
This file is part of gonl-sv
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 lat... | gpl-3.0 |
kelvin13/Knockout | pygments/lexers/fortran.py | 23 | 9748 | # -*- coding: utf-8 -*-
"""
pygments.lexers.fortran
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Fortran languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, words, usin... | gpl-3.0 |
murygin/pebble | src/main/webapp/FCKeditor/fckeditor.py | 86 | 4371 | """
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/license... | bsd-3-clause |
Atlas-Sailed-Co/oppia | core/storage/config/gae_models.py | 35 | 1632 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
Fuzion24/mitmproxy | libmproxy/contrib/wbxml/InvalidDataException.py | 47 | 1333 | #!/usr/bin/env python
'''
@author: David Shaw, david.shaw.aw@gmail.com
Inspired by EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com
----- The MIT License (MIT) -----
Filename: InvalidDataException.py
Copyright (c) 2014, David P. Shaw
Permission is hereby granted, free of charge, to any person o... | mit |
roboogle/gtkmvc3 | gtkmvco/examples/converter/src/views/application.py | 1 | 1745 | # Author: Roberto Cavada <roboogle@gmail.com>
#
# Copyright (C) 2006-2015 by Roberto Cavada
#
# gtkmvc3 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 of the License, or (at yo... | lgpl-2.1 |
nvoron23/hue | desktop/core/ext-py/python-openid-2.2.5/openid/yadis/discover.py | 143 | 4445 | # -*- test-case-name: openid.test.test_yadis_discover -*-
__all__ = ['discover', 'DiscoveryResult', 'DiscoveryFailure']
from cStringIO import StringIO
from openid import fetchers
from openid.yadis.constants import \
YADIS_HEADER_NAME, YADIS_CONTENT_TYPE, YADIS_ACCEPT_HEADER
from openid.yadis.parsehtml import Me... | apache-2.0 |
GeoLabs/QgsWPSClient | __init__.py | 1 | 1589 | # -*- coding: utf-8 -*-
"""
***************************************************************************
qgswps.py QGIS Web Processing Service Plugin
-------------------------------------------------------------------
Date : 09 November 2009
Copyright : (C) 2009 by Dr. Horst Duester
email... | gpl-2.0 |
adamchainz/ansible | test/units/plugins/connection/test_network_cli.py | 57 | 5561 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
siosio/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_set_literal.py | 326 | 1699 | """
Optional fixer to transform set() calls to set literals.
"""
# Author: Benjamin Peterson
from lib2to3 import fixer_base, pytree
from lib2to3.fixer_util import token, syms
class FixSetLiteral(fixer_base.BaseFix):
BM_compatible = True
explicit = True
PATTERN = """power< 'set' trailer< '('
... | apache-2.0 |
hejunbok/apm_planner | libs/mavlink/share/pyshared/pymavlink/tools/mavplayback.py | 28 | 8476 | #!/usr/bin/env python
'''
play back a mavlink log as a FlightGear FG NET stream, and as a
realtime mavlink stream
Useful for visualising flights
'''
import sys, time, os, struct
import Tkinter
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realp... | agpl-3.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/ruutu.py | 33 | 5321 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
xpath_attr,
xpath_text,
)
class RuutuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\... | gpl-3.0 |
barachka/odoo | addons/purchase/__openerp__.py | 49 | 3896 | # -*- 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 |
HuayraLinux/python-apt | doc/examples/versiontest.py | 4 | 1134 | #!/usr/bin/python
# This is a simple clone of tests/versiontest.cc
import apt_pkg
import sys
import re
apt_pkg.init_config()
apt_pkg.init_system()
TestFile = apt_pkg.parse_commandline(apt_pkg.config, [], sys.argv)
if len(TestFile) != 1:
print "Must have exactly 1 file name"
sys.exit(0)
# Go over the file..
... | gpl-2.0 |
cwmartin/rez | src/rez/vendor/pygraph/classes/exceptions.py | 23 | 2371 | # Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.com>
# Salim Fadhley <sal@stodge.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... | lgpl-3.0 |
dysya92/monkeys | flask/lib/python2.7/site-packages/wtforms/validators.py | 35 | 16995 | from __future__ import unicode_literals
import re
import warnings
from wtforms.compat import string_types, text_type
__all__ = (
'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to',
'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length',
'length', 'NumberRange', 'numb... | bsd-3-clause |
Darkmoth/python-django-4 | Thing/env/Lib/site-packages/django/contrib/admin/options.py | 66 | 84355 | import copy
import operator
import warnings
from collections import OrderedDict
from functools import partial, reduce, update_wrapper
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import helpers, validation, widgets
from django.contrib.admin.che... | gpl-2.0 |
nicoboss/Floatmotion | OpenGL/GL/ARB/cl_event.py | 9 | 1133 | '''OpenGL extension ARB.cl_event
This module customises the behaviour of the
OpenGL.raw.GL.ARB.cl_event to provide a more
Python-friendly API
Overview (from the spec)
This extension allows creating OpenGL sync objects linked to OpenCL
event objects, potentially improving efficiency of sharing images
and buffer... | agpl-3.0 |
trungnt13/dnntoolkit | tests/benchmark_dataset.py | 1 | 5679 | # python -m memory_profiler
# dataset used for benchmark: X=(None, 500, 120)
# dataset used for benchmark: y=(None, 2)
from __future__ import print_function, division
import os
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=cpu,floatX=float32"
import theano
from theano import tensor
import numpy as np
import sci... | apache-2.0 |
suoto/hdlcc | hdl_checker/types.py | 1 | 3057 | # This file is part of HDL Checker.
#
# Copyright (c) 2015 - 2019 suoto (Andre Souto)
#
# HDL Checker 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 |
dplorimer/osf | website/addons/osfstorage/tests/test_utils.py | 13 | 2418 | #!/usr/bin/env python
# encoding: utf-8
from nose.tools import * # noqa
from framework import sessions
from framework.flask import request
from website.models import Session
from website.addons.osfstorage.tests import factories
from website.addons.osfstorage import utils
from website.addons.osfstorage.tests.utils... | apache-2.0 |
mrmoss/exorcist | exorcist.py | 1 | 2875 | #!/usr/bin/python2
import hashlib
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
import os
from scapy.all import *
import sys
#returns [(session,carving)]
def carve_http(streams):
ret=[]
requests=[]
for stream in streams:
start_pos=0
raw=stream[1]+"\r\n\r\n"
carving=""
header=""... | unlicense |
rushiagr/keystone | keystone/tests/unit/test_v2.py | 2 | 52189 | # 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 required by applicable law or agreed to in... | apache-2.0 |
iabdalkader/micropython | ports/esp8266/modules/flashbdev.py | 14 | 1414 | import esp
class FlashBdev:
SEC_SIZE = 4096
def __init__(self, start_sec, blocks):
self.start_sec = start_sec
self.blocks = blocks
def readblocks(self, n, buf, off=0):
# print("readblocks(%s, %x(%d), %d)" % (n, id(buf), len(buf), off))
esp.flash_read((n + self.start_sec) ... | mit |
oscarolar/odoo | addons/crm_project_issue/project_issue.py | 380 | 2373 |
from openerp.osv import osv, fields
class crm_lead_to_project_issue_wizard(osv.TransientModel):
""" wizard to convert a Lead into a Project Issue and move the Mail Thread """
_name = "crm.lead2projectissue.wizard"
_inherit = 'crm.partner.binding'
_columns = {
"lead_id": fields.many2one("crm.... | agpl-3.0 |
bminchew/PySAR | pysar/polsar/decomp.py | 1 | 6649 | """
PySAR
Polarimetric SAR decomposition
Contents
--------
decomp_fd(hhhh,vvvv,hvhv,hhvv,numthrd=None) : Freeman-Durden 3-component decomposition
"""
from __future__ import print_function, division
import sys,os
import numpy as np
###===============================================================================... | gpl-3.0 |
rx2130/Leetcode | python/286 Walls and Gates.py | 1 | 3439 | from collections import deque
class Solution(object):
# Op1: DFS
def wallsAndGates(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: void Do not return anything, modify rooms in-place instead.
"""
for i in range(len(rooms)):
for j in range(len(rooms[0])... | apache-2.0 |
flijloku/livestreamer | win32/build-bbfreeze.py | 21 | 1442 | #!/usr/bin/env python
import os
import shutil
import sys
import bbfreeze.recipes
from itertools import ifilter
from bbfreeze import Freezer
from livestreamer import __version__
def recipe_pycparser(mf):
m = mf.findNode("pycparser")
if not m:
return
mf.import_hook("pycparser", m, ['*'])
retu... | bsd-2-clause |
sudheesh001/oh-mainline | vendor/packages/python-social-auth/social/store.py | 90 | 2744 | import time
try:
import cPickle as pickle
except ImportError:
import pickle
from openid.store.interface import OpenIDStore as BaseOpenIDStore
from openid.store.nonce import SKEW
class OpenIdStore(BaseOpenIDStore):
"""Storage class"""
def __init__(self, strategy):
"""Init method"""
su... | agpl-3.0 |
hungtt57/matchmaker | lib/python2.7/site-packages/django/core/management/commands/runfcgi.py | 120 | 1073 | import argparse
import warnings
from django.core.management.base import BaseCommand
from django.utils.deprecation import RemovedInDjango19Warning
class Command(BaseCommand):
help = "Runs this project as a FastCGI application. Requires flup."
def add_arguments(self, parser):
parser.add_argument('args... | mit |
markeldigital/design-system | vendor/ruby/2.0.0/gems/pygments.rb-0.6.3/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py | 95 | 2301 | from unittest import TestCase
import simplejson.encoder
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0... | mit |
vitan/hue | desktop/core/ext-py/South-1.0.2/south/db/firebird.py | 93 | 14445 | # firebird
from __future__ import print_function
import datetime
from django.db import connection, models
from django.core.management.color import no_style
from django.db.utils import DatabaseError
from south.db import generic
from south.utils.py3 import string_types
class DatabaseOperations(generic.DatabaseOperat... | apache-2.0 |
exogen/nose-achievements | tests/test_achievement.py | 1 | 1430 | # -*- coding: utf-8 -*-
import unittest
from noseachievements.achievements.base import Achievement
from noseachievements.compat import unicode
from helpers import (PASS, TestPlugin, NeverUnlockedAchievement,
AlwaysUnlockedAchievement)
class TestAchievement(TestPlugin):
achievement = NeverUnlockedAchievement... | bsd-3-clause |
hpcugent/easybuild-framework | easybuild/framework/easyconfig/constants.py | 1 | 2040 | #
# Copyright 2013-2019 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (FW... | gpl-2.0 |
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price | data/05 citi/parseJSONdata.py | 26 | 6754 | import json;
import time;
from datetime import datetime, timedelta
from parseJSON import getSocialData
def parseData(negativeFileName, postiveFileName, neutralFileName, numNegativ, numPositive, numNeutral):
days_back = 30
date_days_ago = datetime.now() - timedelta(days=days_back)
day = datetime.today().day
day = 7... | mit |
oskar456/youtube-dl | youtube_dl/extractor/periscope.py | 10 | 5763 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
unescapeHTML,
)
class PeriscopeBaseIE(InfoExtractor):
def _call_api(self, method, query, item_id):
return self._download_json(
'https://api.perisco... | unlicense |
MountainWei/nova | nova/tests/functional/libvirt/test_numa_servers.py | 45 | 6782 | # Copyright (C) 2015 Red Hat, Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
gunzy83/ansible-modules-extras | cloud/cloudstack/cs_vmsnapshot.py | 44 | 8582 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
laurenweinstein1/ardupilot-lw | mk/PX4/Tools/genmsg/src/genmsg/gentools.py | 214 | 6644 | #! /usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source cod... | gpl-3.0 |
2uller/LotF | App/Lib/test/test_bsddb.py | 10 | 12031 | #! /usr/bin/env python
"""Test script for the bsddb C module by Roger E. Masse
Adapted to unittest format and expanded scope by Raymond Hettinger
"""
import os, sys
import unittest
from test import test_support
# Skip test if _bsddb wasn't built.
test_support.import_module('_bsddb')
bsddb = test_support... | gpl-2.0 |
hdinsight/hue | desktop/core/ext-py/ndg_httpsclient-0.4.0/setup.py | 22 | 4836 | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
_long_description = '''
This is a HTTPS client implementation for httplib and urllib2 based on
PyOpenSSL. PyOpenSSL provides a more full... | apache-2.0 |
id0tfqh/statistic | check-ip.py | 1 | 1236 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
pattern = r'^[0-9.]+$'
try:
addr = raw_input('input ip address: \n')
if re.match(pattern, addr):
pass
else:
print('A incorrect address')
addr = '192.168.1.1'
except ValueError: print "A incorrect address"
command = 'ipset -L | grep '
comman... | gpl-3.0 |
ojake/django | tests/fixtures_model_package/tests.py | 312 | 2204 | from __future__ import unicode_literals
import warnings
from django.core import management
from django.test import TestCase
from .models import Article
class SampleTestCase(TestCase):
fixtures = ['fixture1.json', 'fixture2.json']
def testClassFixtures(self):
"Test cases can load fixture objects in... | bsd-3-clause |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/test/test_bufio.py | 64 | 2654 | import unittest
from test import support
import io # C implementation.
import _pyio as pyio # Python implementation.
# Simple test to ensure that optimizations in the IO library deliver the
# expected results. For best testing, run this under a debug-build Python too
# (to exercise asserts in the C code).
lengths =... | apache-2.0 |
TylerTemp/tomorrow | lib/hdlr/tomorrow/blog/edit.py | 1 | 2586 | import tornado.web
import logging
import json
try:
from urllib.parse import unquote
from urllib.parse import quote
except ImportError:
from urllib import unquote
from urllib import quote
from .base import BaseHandler
from ..base import EnsureUser
from lib.db.tomorrow import Article, User
class EditHa... | gpl-3.0 |
sexroute/commandergenius | project/jni/python/src/Doc/includes/minidom-example.py | 37 | 1564 | import xml.dom.minidom
document = """\
<slideshow>
<title>Demo slideshow</title>
<slide><title>Slide title</title>
<point>This is a demo</point>
<point>Of a program for processing slides</point>
</slide>
<slide><title>Another demo slide</title>
<point>It is important</point>
<point>To have more than</point>
<point>on... | lgpl-2.1 |
istellartech/OpenGoddard | examples/11_Polar_TSTO_Taiki.py | 1 | 19117 | # -*- coding: utf-8 -*-
# Copyright 2017 Interstellar Technologies Inc. All Rights Reserved.
from __future__ import print_function
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
from OpenGoddard.optimize import Problem, Guess, Condition, Dynamics
class Rocket:
# Atmosphere Param... | mit |
hellhovnd/django | tests/m2m_through/tests.py | 117 | 12908 | from __future__ import absolute_import
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (Person, Group, Membership, CustomMembership,
PersonSelfRefM2M, Friendship)
class M2mThroughTests(TestCase):
def setUp(self):
self.bob = Person.o... | bsd-3-clause |
johnnygaddarr/zulip | zerver/views/webhooks.py | 102 | 42964 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.conf import settings
from zerver.models import UserProfile, get_client, get_user_profile_by_email
from zerver.lib.actions import check_send_message
from zerver.lib.notifications import convert_html_to_markdown
from zerver.lib.re... | apache-2.0 |
algorithmic-music-exploration/amen | amen/timing.py | 1 | 3596 | #!/usr/bin/env python
'''Timing interface'''
from bisect import bisect_left, bisect_right
import numpy as np
import pandas as pd
import librosa
class TimeSlice(object):
"""
A slice of time: has a start time, a duration, and a reference to an Audio object.
"""
def __init__(self, time, duration, au... | bsd-2-clause |
akionakamura/scikit-learn | sklearn/tests/test_isotonic.py | 230 | 11087 | import numpy as np
import pickle
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert_equal,
... | bsd-3-clause |
nwiizo/workspace_2017 | ansible-modules-extras/cloud/amazon/cloudtrail.py | 23 | 8625 | #!/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 distributed... | mit |
flibbertigibbet/open-transit-indicators | python/django/datasources/tasks/__init__.py | 2 | 1091 | """Thin wrappers for celery tasks so that autodiscovery works without having a giant file."""
from datasources.tasks.shapefile import (run_shapefile_to_boundary, run_get_shapefile_fields,
run_load_shapefile_data)
from datasources.tasks.osm import run_osm_import
from datasources.... | gpl-3.0 |
ikool/metact06 | lib/werkzeug/formparser.py | 295 | 21205 | # -*- coding: utf-8 -*-
"""
werkzeug.formparser
~~~~~~~~~~~~~~~~~~~
This module implements the form parsing. It supports url-encoded forms
as well as non-nested multipart uploads.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more deta... | apache-2.0 |
laborautonomo/poedit | deps/boost/tools/build/v2/test/copy_time.py | 44 | 1949 | #!/usr/bin/python
#
# Copyright (c) 2008 Steven Watanabe
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test that the common.copy rule set the modification date of the new file to
# the current time.
import B... | mit |
napkindrawing/ansible | lib/ansible/modules/network/cloudengine/ce_reboot.py | 39 | 4217 | #!/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 |
ovnicraft/odoo | addons/l10n_sg/__openerp__.py | 331 | 2380 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
sYnfo/samba-1 | buildtools/wafsamba/samba_optimisation.py | 12 | 8758 | # This file contains waf optimisations for Samba
# most of these optimisations are possible because of the restricted build environment
# that Samba has. For example, Samba doesn't attempt to cope with Win32 paths during the
# build, and Samba doesn't need build varients
# overall this makes some build tasks quite a ... | gpl-3.0 |
skycucumber/restful | python/venv/lib/python2.7/site-packages/wtforms/ext/csrf/session.py | 177 | 2627 | """
A provided CSRF implementation which puts CSRF data in a session.
This can be used fairly comfortably with many `request.session` type
objects, including the Werkzeug/Flask session store, Django sessions, and
potentially other similar objects which use a dict-like API for storing
session keys.
The basic concept i... | gpl-2.0 |
Mattze96/youtube-dl | youtube_dl/extractor/cnet.py | 101 | 3246 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class CNETIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cnet\.com/videos/(?P<id>[^/]+)/'
_TESTS = [{
'url': 'http://www.cnet.com/videos/hands-on-wi... | unlicense |
NickelMedia/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py | 119 | 9544 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 the above
# copyright n... | bsd-3-clause |
EiSandi/greetingslack | greetingslack/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 412 | 2203 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools import namespaces
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(namespaces.Installer, Command):
"""Install an .egg-info directory for the package"""
description = "In... | mit |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | artistic-2.0 |
syphar/django | django/contrib/contenttypes/admin.py | 114 | 5253 | from __future__ import unicode_literals
from functools import partial
from django.contrib.admin.checks import InlineModelAdminChecks
from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.forms impo... | bsd-3-clause |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/Week_3/playground/env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | apache-2.0 |
dwightgunning/django | tests/update/tests.py | 325 | 5121 | from __future__ import unicode_literals
from django.test import TestCase
from .models import A, B, D, Bar, DataPoint, Foo, RelatedPoint
class SimpleTest(TestCase):
def setUp(self):
self.a1 = A.objects.create()
self.a2 = A.objects.create()
for x in range(20):
B.objects.create(... | bsd-3-clause |
BondAnthony/ansible | test/lib/ansible_test/_internal/coverage/combine.py | 18 | 7768 | """Combine code coverage files."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ..target import (
walk_compile_targets,
walk_powershell_targets,
)
from ..io import (
read_text_file,
)
from ..util import (
display,
)
from ..util_common import... | gpl-3.0 |
aYukiSekiguchi/ACCESS-Chromium | chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/smtp.py | 884 | 1680 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | bsd-3-clause |
mstreatfield/anim-studio-tools | grenade/sources/grenade/translators/version.py | 5 | 2030 | #
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its
# affiliates and/or its licensors.
#
from .entity import EntityTranslator
from ..converters.default import convert_asset, convert_link, convert_links, convert_project, convert_user
class VersionTranslator(EntityTranslator):
"""
... | gpl-3.0 |
benschulz/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/constants.py | 963 | 87346 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | mpl-2.0 |
drakuna/odoo | addons/website_blog/tests/common.py | 46 | 1479 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestWebsiteBlogCommon(common.TransactionCase):
def setUp(self):
super(TestWebsiteBlogCommon, self).setUp()
Users = self.env['res.users']
group_blog_manager_id = self.ref('base.group_website_designer')
group_employee_i... | gpl-3.0 |
bankonme/cjdns | node_build/dependencies/libuv/build/gyp/test/variables/commands/gyptest-commands-repeated.py | 330 | 1313 | #!/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.
"""
Test variable expansion of '<!()' syntax commands where they are evaluated
more then once..
"""
import TestGyp
test = TestGyp.TestGyp(... | gpl-3.0 |
Glottotopia/aagd | moin/local/moin/MoinMoin/support/xappy/schema.py | 2 | 1162 | #!/usr/bin/env python
#
# Copyright (C) 2008 Lemur Consulting Ltd
#
# 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 versio... | mit |
ndingwall/scikit-learn | sklearn/datasets/_california_housing.py | 11 | 6174 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/datasets/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average ag... | bsd-3-clause |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/bsddb/test/test_compare.py | 72 | 15142 | """
TestCases for python DB duplicate and Btree key comparison function.
"""
import sys, os, re
import test_all
from cStringIO import StringIO
import unittest
from test_all import db, dbshelve, test_support, \
get_new_environment_path, get_new_database_path
# Needed for python 3. "cmp" vanished in 3.0.1
de... | mit |
artwr/airflow | tests/contrib/operators/test_sagemaker_tuning_operator.py | 6 | 7482 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_weakref.py | 23 | 50681 | import gc
import sys
import unittest
import UserList
import weakref
import operator
import contextlib
import copy
from test import test_support
# Used in ReferencesTestCase.test_ref_created_during_del() .
ref_from_del = None
class C:
def method(self):
pass
class Callable:
bar = None
def __call... | gpl-2.0 |
michaelBenin/sqlalchemy | lib/sqlalchemy/ext/declarative/clsregistry.py | 80 | 10339 | # ext/declarative/clsregistry.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to handle the string class registry used by declarative.
Th... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.