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 |
|---|---|---|---|---|---|
devendermishrajio/nova | nova/db/sqlalchemy/api_migrations/migrate_repo/versions/001_cell_mapping.py | 48 | 1798 | # 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
# d... | apache-2.0 |
skoslowski/gnuradio | grc/gui/Notebook.py | 1 | 5710 | """
Copyright 2008, 2009, 2011 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from __future__ import absolute_import
import os
import logging
from gi.repository import Gtk, Gdk, GObject
from . import Actions
from .StateCache import StateCache
from .Const... | gpl-3.0 |
mrquim/mrquimrepo | plugin.video.castaway/resources/lib/modules/client.py | 6 | 13409 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
foreni-packages/golismero | golismero/api/data/resource/__init__.py | 8 | 1307 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Resource types.
"""
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Authors:
Daniel Garcia Garcia a.k.a cr0hn | cr0hn@cr0hn.com
Mario Vilas | mvilas@gmail.com
Golismero project site: https://github.com/golismero
Golismero project mail: ... | gpl-2.0 |
Niknakflak/-tg-station | SQL/ban_conversion_2018-10-28.py | 51 | 9890 | #Python 3+ Script for converting ban table format as of 2018-10-28 made by Jordie0608
#
#Before starting ensure you have installed the mysqlclient package https://github.com/PyMySQL/mysqlclient-python
#It can be downloaded from command line with pip:
#pip install mysqlclient
#
#You will also have to create a new ban ta... | agpl-3.0 |
LingxiaoJIA/gem5 | configs/example/read_config.py | 21 | 19305 | # Copyright (c) 2014 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
anupcshan/bazel | tools/build_defs/docker/join_layers.py | 8 | 3624 | # Copyright 2015 The Bazel 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 applicable la... | apache-2.0 |
amboutin/GCP | speech/grpc/transcribe_streaming_minute.py | 2 | 10775 | #!/usr/bin/python
# Copyright (C) 2016 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
#
# Unless required by applicable law or... | apache-2.0 |
ujenmr/ansible | lib/ansible/modules/network/f5/bigip_gtm_monitor_bigip.py | 14 | 22153 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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',
... | gpl-3.0 |
renhaocui/adPlatform | caseStudy.py | 2 | 26683 | __author__ = 'rencui'
from afinn import Afinn
from sklearn.externals import joblib
import numpy
import json
from textstat.textstat import textstat
from nltk.stem.porter import *
from tokenizer import simpleTokenize
import logging
from scipy.sparse import hstack, csr_matrix
from sklearn import svm
stemmer = PorterStemm... | mit |
fkazimierczak/werkzeug | werkzeug/debug/console.py | 256 | 5599 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.loca... | bsd-3-clause |
guerrierk/dolibarr | htdocs/modulebuilder/template/doc/user/source/conf.py | 19 | 12067 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# My Module documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 26 17:54:17 2016.
#
# 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
# ... | gpl-3.0 |
ddnbgroup/ansible | lib/ansible/plugins/lookup/flattened.py | 103 | 2506 | # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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)... | gpl-3.0 |
hfeeki/transifex | transifex/addons/gtranslate/tests.py | 1 | 2998 | # -*- coding: utf-8 -*-
from django.conf import settings
from transifex.txcommon.tests.base import BaseTestCase
from transifex.projects.models import Project
from handlers import *
from models import Gtranslate
from transifex.addons.gtranslate import is_gtranslate_allowed
class TestGtranslate(BaseTestCase):
def ... | gpl-2.0 |
thiderman/piper | piper/api.py | 1 | 5695 | import asyncio
import blessings
import json
import logbook
import types
from aiohttp import web
from piper.db.core import LazyDatabaseMixin
from piper import config
class ApiCLI(LazyDatabaseMixin):
_modules = None
config_class = config.AgentConfig
def __init__(self, config):
self.config = config... | mit |
stormi/tsunami | src/primaires/salle/commandes/deverrouiller/__init__.py | 1 | 3624 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# lis... | bsd-3-clause |
School-of-Innovation-Experiment/InnovationManagement | debug_toolbar/utils/sqlparse/__init__.py | 12 | 1457 | # Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
"""Parse SQL statements."""
__version__ = '0.1.3'
class SQLParseError(Exception):
"""Base class for exceptions in t... | agpl-3.0 |
yprez/python-social-auth | social/actions.py | 1 | 4703 | from social.p3 import quote
from social.utils import sanitize_redirect, user_is_authenticated, \
user_is_active, partial_pipeline_data, setting_url
def do_auth(backend, redirect_name='next'):
# Save any defined next value into session
data = backend.strategy.request_data(merge=False)
... | bsd-3-clause |
jhawkesworth/ansible | lib/ansible/modules/network/fortios/fortios_ssh_filter_profile.py | 19 | 12364 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
shacker/django | django/contrib/redirects/migrations/0001_initial.py | 69 | 1491 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fals... | bsd-3-clause |
tragiclifestories/django | tests/admin_custom_urls/tests.py | 276 | 6381 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.test import TestCase, override_settings
from .models import A... | bsd-3-clause |
tiexinliu/odoo_addons | smile_script/tests/test_script.py | 5 | 1546 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
ajayuranakar/django-blog | lib/python2.7/site-packages/django/db/models/fields/__init__.py | 47 | 88713 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import math
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import total_ordering
from django import forms
from django.apps import apps
from django.conf impo... | gpl-3.0 |
anarchivist/dial-a-dpla | dial_a_dpla/app.py | 1 | 1902 | import re
from flask import Flask
from flask import render_template
from flask import url_for
from flask import request
import urllib
from twilio import twiml
from requests import get as rget
from requests.compat import urlencode
import os
import random
api_key = os.environ.get('DPLA_API_KEY', None)
# Declare and co... | mit |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity.py | 1 | 7717 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
WebSpider/SickRage | lib/babelfish/converters/opensubtitles.py | 80 | 1727 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from . import LanguageReverseConverter, CaseInsensitiveDict
from ..exceptions im... | gpl-3.0 |
shssoichiro/servo | tests/wpt/web-platform-tests/webvtt/parsing/cue-text-parsing/buildtests.py | 75 | 1952 | #!/usr/bin/python
import os
import urllib
import hashlib
doctmpl = """<!doctype html>
<title>WebVTT cue data parser test %s</title>
<style>video { display:none }</style>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/html/syntax/parsing/template.js><... | mpl-2.0 |
Mitroman/Zurvival | main.py | 1 | 6007 | #!/usr/bin/env python3
import pygame, os, random, easygui
from pygame.sprite import spritecollide, RenderClear
from sprites import *
chance = 0
chance_ammo = 0
easygui.msgbox(msg="""Zurvival!\nDies ist ein Überlebensspiel wo man Zombies töten muss, Munition sammeln und überleben muss!\n
Steuerung:\nW: Vorwärts\nS:Rü... | gpl-2.0 |
jonashagstedt/django-reform | demo/settings.py | 1 | 2385 | """
Django settings for django_reform project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, .... | bsd-3-clause |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdtypes/IN/NAPTR.py | 248 | 4889 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-3.0 |
SummerLW/Perf-Insight-Report | third_party/gsutil/third_party/boto/boto/ec2/elb/securitygroup.py | 152 | 1576 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
#
# 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, m... | bsd-3-clause |
sbusso/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-base-address.py | 137 | 1816 | #!/usr/bin/env python
# Copyright 2013 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.
"""
Make sure the base address setting is extracted properly.
"""
import TestGyp
import re
import sys
if sys.platform == 'win32':
test = Te... | agpl-3.0 |
moraesnicol/scrapy | tests/test_dupefilters.py | 110 | 2315 | import hashlib
import tempfile
import unittest
import shutil
from scrapy.dupefilters import RFPDupeFilter
from scrapy.http import Request
from scrapy.utils.python import to_bytes
class RFPDupeFilterTest(unittest.TestCase):
def test_filter(self):
dupefilter = RFPDupeFilter()
dupefilter.open()
... | bsd-3-clause |
ging/fiware-chef_validator | chef_validator/tests/unit/api/base.py | 2 | 2426 | # -*- coding: utf-8 -*-
# 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, s... | apache-2.0 |
SymbiFlow/prjxray | fuzzers/033-mon-xadc/top.py | 1 | 2269 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os
import random
random.seed(i... | isc |
fabric-bolt/fabric-bolt | fabric_bolt/core/views.py | 10 | 3516 | from datetime import timedelta, datetime
from django.utils import timezone
from django.db.models.aggregates import Count
from django.contrib import messages
from django.views.generic import TemplateView
from django.template.defaultfilters import date as format_date
from django.template.defaultfilters import time as fo... | mit |
glovebx/odoo | addons/website_twitter/controllers/main.py | 355 | 1936 | from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.tools.translate import _
import json
class Twitter(http.Controller):
@http.route(['/twitter_reload'], type='json', auth="user", website=True)
def twitter_reload(self):
return request.website.fetch_favorite_twe... | agpl-3.0 |
yyzybb537/libgo | third_party/boost.context/tools/build/test/absolute_sources.py | 44 | 1867 | #!/usr/bin/python
# Copyright 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that sources with absolute names are handled OK.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)... | mit |
proversity-org/edx-platform | common/djangoapps/course_action_state/tests/test_managers.py | 24 | 7220 | # pylint: disable=invalid-name, attribute-defined-outside-init
"""
Tests for basic common operations related to Course Action State managers
"""
from collections import namedtuple
from ddt import data, ddt
from django.test import TestCase
from opaque_keys.edx.locations import CourseLocator
from course_action_state.ma... | agpl-3.0 |
google-code/android-scripting | python/src/Mac/Modules/qd/qdsupport.py | 39 | 12758 | # This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
import string
# Declarations that cha... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/Django/django/utils/encoding.py | 80 | 9167 | from __future__ import unicode_literals
import codecs
import datetime
from decimal import Decimal
import locale
try:
from urllib.parse import quote
except ImportError: # Python 2
from urllib import quote
import warnings
from django.utils.functional import Promise
from django.utils import six
class Django... | agpl-3.0 |
damonkohler/sl4a | python/src/Lib/dis.py | 166 | 6484 | """Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all
del _opcodes_all
def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argume... | apache-2.0 |
tiimgreen/pi_lapse | pi_lapse.py | 1 | 1121 | import subprocess
from datetime import datetime, timedelta
frame_counter = 1
# Time in seconds
# 1 Hour = 3600
# 1 Day = 86400
# Time between each photo (seconds)
time_between_frames = 60
# Duration of Time Lapse (seconds)
duration = 86400
# Image Dimensions (pixels)
image_width = 1296
image_height = 972
total_fr... | mit |
AndreaCrotti/ansible | lib/ansible/plugins/cache/jsonfile.py | 77 | 4640 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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 |
sklnet/opendroid-enigma2 | tools/genmetaindex.py | 47 | 1108 | # usage: genmetaindex.py <xml-files> > index.xml
import sys, os
from xml.etree.ElementTree import ElementTree, Element
root = Element("index")
for file in sys.argv[1:]:
p = ElementTree()
p.parse(file)
package = Element("package")
package.set("details", os.path.basename(file))
# we need all prerequisites
pa... | gpl-2.0 |
windyuuy/opera | chromium/src/third_party/python_26/Lib/site-packages/win32/scripts/backupEventLog.py | 38 | 1035 |
# Generate a base file name
import time, os
import win32api
import win32evtlog
def BackupClearLog(logType):
datePrefix = time.strftime("%Y%m%d", time.localtime(time.time()))
fileExists = 1
retry = 0
while fileExists:
if retry == 0:
index = ""
else:
index = "-%d" % retry
try:
fname = os.path.join(wi... | bsd-3-clause |
Spleen64/Sick-Beard | lib/imdb/parser/http/searchKeywordParser.py | 128 | 4331 | """
parser.http.searchKeywordParser module (imdb package).
This module provides the HTMLSearchKeywordParser class (and the
search_company_parser instance), used to parse the results of a search
for a given keyword.
E.g., when searching for the keyword "alabama", the parsed page would be:
http://akas.imdb.com/find?... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/242_test_shlex.py | 43 | 5315 | # -*- coding: iso-8859-1 -*-
import unittest
import os, sys
import shlex
from test import test_support
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
# The original test data set was from shellwords, by Hartmut Goebel.
data = r"""x|x|
foo bar|foo|bar|
foo bar|foo|bar... | gpl-3.0 |
kangfend/django | django/db/backends/oracle/creation.py | 8 | 14574 | import sys
import time
from django.conf import settings
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.utils import DatabaseError
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
... | bsd-3-clause |
knagra/farnsworth | base/models.py | 1 | 5312 | '''
Project: Farnsworth
Author: Karandeep Singh Nagra
'''
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission
from django.core.urlresolvers import reverse
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
from social.utils import sett... | bsd-2-clause |
tecwebjoao/TecWeb-TF-2T-B-SI | venv/Lib/site-packages/pip/_vendor/colorama/win32.py | 535 | 5365 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetCon... | apache-2.0 |
nrc/rustc-perf | collector/benchmarks/style-servo/components/script/dom/bindings/codegen/parser/tests/test_builtins.py | 276 | 1798 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestBuiltins {
attribute boolean b;
attribute byte s8;
attribute octet u8;
attribute short s16;
attribute unsigned short u16;
attribute long s32;
attribute unsigne... | mit |
kampanita/pelisalacarta | python/main-classic/servers/streaminto.py | 2 | 4141 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para streaminto
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
from core import logger
from core import scr... | gpl-3.0 |
beni55/edx-platform | common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py | 114 | 16366 | # -*- coding: 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 'AnonymousUserId'
db.create_table('student_anonymoususerid', (
('id', self.gf('dj... | agpl-3.0 |
317070/kaggle-heart | configurations/j6_sax_skew_zoom.py | 1 | 8970 | """Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import image_transform
import layers
import preprocess
import postprocess
import objectives
import theano_printer
import update... | mit |
prestapyt/prestapyt | prestapyt/xml2dict.py | 1 | 4814 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Code from https://github.com/nkchenz/lhammer/blob/master/lhammer/xml2dict.py
Distributed under GPL2 Licence
CopyRight (C) 2009 Chen Zheng
Adapted for Prestapyt by Guewen Baconnier
Copyright 2012 Camptocamp SA
"""
import re
try:
import xml.etree.cElemen... | agpl-3.0 |
ashutrix03/inteygrate_flaskapp-master | dateutil/parser.py | 49 | 50234 | # -*- coding:iso-8859-1 -*-
"""
This module offers a generic date/time string parser which is able to parse
most known formats to represent a date and/or time.
This module attempts to be forgiving with regards to unlikely input formats,
returning a datetime object even for dates which are ambiguous. If an element
of a... | gpl-3.0 |
HybridF5/jacket | jacket/tests/storage/unit/backup/fake_google_client.py | 13 | 4615 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2016 Vedams Inc.
# Copyright (C) 2016 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 ... | apache-2.0 |
ToontownUprising/src | toontown/fishing/DistributedFishingPondAI.py | 5 | 1691 | from direct.directnotify.DirectNotifyGlobal import *
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.fishing import FishingTargetGlobals
from toontown.fishing.DistributedFishingTargetAI import DistributedFishingTargetAI
class DistributedFishingPondAI(DistributedObjectAI):
noti... | mit |
nicolargo/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/textio.py | 102 | 62691 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | apache-2.0 |
henrikju/resolve | response_approximation/UV_algorithm.py | 1 | 1388 | """
resolve.py
Written by Henrik Junklewitz based on scipts by Maksim Greiner
Resolve.py defines the main function that runs RESOLVE on a measurement
set with radio interferometric data.
Copyright 2016 Henrik Junklewitz
RESOLVE is free software: you can redistribute it and/or modify
it under the terms of the GNU Ge... | gpl-2.0 |
mmagnus/rna-pdb-tools | rna_tools/tools/clarna_play/ClaRNAlib/bp_limits.py | 2 | 782660 | limits = {}
limits['HH_cis/AA/dist/100.00'] = {'max': 7.3753784439331627, 'min': 7.3613891466396524} # lost: 0
limits['HH_cis/AA/dist/95.00'] = {'max': 7.3753784439331627, 'min': 7.3613891466396524} # lost: 0
limits['HH_cis/AA/dist/99.00'] = {'max': 7.3753784439331627, 'min': 7.3613891466396524} # lost: 0
limits['HH_ci... | gpl-3.0 |
lagopus/lagopus | test/ryu/vsw-602_mp_aggregate.py | 1 | 4108 | from ryu.base.app_manager import RyuApp
from ryu.controller.ofp_event import EventOFPSwitchFeatures
from ryu.controller.ofp_event import EventOFPAggregateStatsReply
from ryu.controller.handler import set_ev_cls
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import MAIN_DISPATCHER
from ... | apache-2.0 |
sudkannan/xen-hv | dist/install/usr/lib64/python2.6/site-packages/xen/xend/XendConstants.py | 13 | 4011 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
Alwnikrotikz/visvis.dev | vvmovie/images2ims.py | 8 | 7368 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# This code is subject to the (new) BSD license:
#
# 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... | bsd-3-clause |
huiyi1990/Data-Structure-Zoo | 1-Algorithm Analysis/algorithms.py | 9 | 2193 | """ 2: Algorithms
thomas moll 2015
"""
import time, random
def find_sequentially(arr, item):
""" Sequential Search
Complexity: O(n)
"""
for value, i in enumerate(arr):
# Check each item in the list
if item == value: #Runs N number of times
... | mit |
team-herring/herring-box | src/main/python/example/02.pingpong.py | 1 | 1361 | # -*- coding: utf-8 -*-
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import threading
import avro.ipc as ipc
import avro.protocol as protocol
import avro.schema as schema
import thread
PROTOCOL = protocol.parse(open("../../avro/pingpong.avpr").read())
server_addr = ('localhost', 9090)
class Pingpon... | apache-2.0 |
admetricks/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/applywatchlist.py | 132 | 2983 | # Copyright (C) 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 ... | bsd-3-clause |
willthames/ansible | lib/ansible/modules/network/nxos/nxos_vrf_interface.py | 7 | 9185 | #!/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 |
SPriyaJain/studybuddy | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | mit |
forgeservicelab/ansible.inventory | sources/ssh_config.py | 1 | 4295 | #!/usr/bin/env python
# (c) 2014, Tomas Karasek <tomas.karasek@digile.fi>
#
# 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
# (a... | mit |
slightstone/SickRage | lib/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
davipeterlini/routeflow_tcc_ha | rflib/ipc/msgen.py | 8 | 15679 | import sys
messages = []
# C++
typesMap = {
"i8": "uint8_t",
"i32": "uint32_t",
"i64": "uint64_t",
"bool": "bool",
"ip": "IPAddress",
"mac": "MACAddress",
"string": "string",
"match": "Match&",
"match[]": "std::vector<Match>",
"action": "Action&",
"action[]": "std::vector<Action>",
"option": "Option&",
"option[]": "s... | apache-2.0 |
Project-OSRM/osrm-backend | third_party/flatbuffers/tests/namespace_test/NamespaceC/TableInC.py | 28 | 1610 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceC
import flatbuffers
class TableInC(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsTableInC(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Table... | bsd-2-clause |
grapo/django-rest-framework-json-api | rest_framework_json_api/renderers.py | 2 | 4458 | """
Renderers
"""
from collections import OrderedDict
from rest_framework import renderers
from . import utils
class JSONRenderer(renderers.JSONRenderer):
"""
Render a JSON response per the JSON API spec:
{
"data": [{
"type": "companies",
"id": 1,
"attributes"... | bsd-2-clause |
YOTOV-LIMITED/kitsune | kitsune/questions/tests/test_api.py | 11 | 26745 | import json
from datetime import datetime, timedelta
import mock
import actstream.actions
from actstream.models import Follow
from nose.tools import eq_, ok_, raises
from rest_framework.test import APIClient
from rest_framework.exceptions import APIException
from taggit.models import Tag
from kitsune.sumo.tests impor... | bsd-3-clause |
moraesnicol/scrapy | scrapy/cmdline.py | 84 | 5795 | from __future__ import print_function
import sys
import optparse
import cProfile
import inspect
import pkg_resources
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.xlib import lsprofcalltree
from scrapy.commands import ScrapyCommand
from scrapy.exceptions import UsageError
from scrapy.utils.misc i... | bsd-3-clause |
manuelm/pyload | module/lib/simplejson/__init__.py | 45 | 18626 | 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 ... | gpl-3.0 |
mcanthony/nupic | examples/prediction/experiments/confidenceTest/base/permutations_secondOrder0.py | 43 | 1423 | #!/usr/bin/env python
permutations = dict(
dataSetPackage = ['secondOrder0'],
iterationCountTrain = [250, 500, 1000, 1500],
iterationCountTest = [250, 500],
spNumActivePerInhArea = [5],
tpNCellsPerCol = [... | agpl-3.0 |
prakritish/ansible | lib/ansible/plugins/lookup/lines.py | 89 | 1490 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 lat... | gpl-3.0 |
Yadnyawalkya/integration_tests | cfme/scripting/quickstart/__init__.py | 2 | 6039 | import argparse
import hashlib
import json
import os
import subprocess
import sys
from cfme.scripting.quickstart.proc import PRISTINE_ENV
from cfme.scripting.quickstart.proc import run_cmd_or_exit
from cfme.scripting.quickstart.system import install_system_packages
CREATED = object()
REQUIREMENT_FILE = 'requirements... | gpl-2.0 |
damiansoriano/odoo | addons/account/report/account_entries_report.py | 12 | 7679 | # -*- 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 |
dbushong/dotfiles | dot.vim/plugin/editorconfig-core-py/docs/conf.py | 19 | 7189 | # -*- coding: utf-8 -*-
#
# EditorConfig Python Core documentation build configuration file, created by
# sphinx-quickstart on Sat May 5 09:51:42 2012.
#
# 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
# autogenera... | mit |
marrybird/flask-sqlalchemy | test_sqlalchemy.py | 7 | 23928 | from __future__ import with_statement
import atexit
import unittest
from datetime import datetime
import flask
import flask_sqlalchemy as sqlalchemy
from sqlalchemy import MetaData
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import sessionmaker
def make_todo_model(db):
class Todo(db.... | bsd-3-clause |
mysociety/pombola | pombola/kenya/shujaaz.py | 1 | 14407 | # -*- coding: utf-8 -*-
FINALISTS2014 = [
{
'category': 'Education (National Assembly)',
'name': 'Hon. Boniface Gatobu',
'person': 1322,
'reasons': '''<ul><li>Motion urging the Government, to
establish a public databank of all bright and poor students to be in the
custody of the Cou... | agpl-3.0 |
apple/llvm-project | lldb/third_party/Python/module/progress/progress.py | 7 | 5623 | #!/usr/bin/env python
from __future__ import print_function
import use_lldb_suite
import six
import sys
import time
class ProgressBar(object):
"""ProgressBar class holds the options of the progress bar.
The options are:
start State from which start the progress. For example, if start is
... | apache-2.0 |
Fyre91/Gesture-Recognition-OpenCV | nestk/deps/opencv/samples/python/cv20squares.py | 6 | 5348 | """
Find Squares in image by finding countours and filtering
"""
#Results slightly different from C version on same images, but is
#otherwise ok
import math
import cv
def angle(pt1, pt2, pt0):
"calculate angle contained by 3 points(x, y)"
dx1 = pt1[0] - pt0[0]
dy1 = pt1[1] - pt0[1]
dx2 = pt2[0] - pt0... | lgpl-3.0 |
ader1990/rasphack-watchout | tests.py | 3 | 15027 | import unittest
import doctest
import serial
from itertools import chain
import pyfirmata
from pyfirmata import mockup
from pyfirmata.boards import BOARDS
from pyfirmata.util import str_to_two_byte_iter, to_two_bytes
# Messages todo left:
# type command channel first byte second byte
# -... | mit |
pernici/sympy | sympy/polys/tests/test_orthopolys.py | 2 | 3048 | """Tests for efficient functions for generating orthogonal polynomials. """
from sympy import Poly, Rational as Q
from sympy.utilities.pytest import raises
from sympy.polys.orthopolys import (
chebyshevt_poly,
chebyshevu_poly,
hermite_poly,
legendre_poly,
laguerre_poly,
)
from sympy.abc import x
... | bsd-3-clause |
Emergya/icm-openedx-educamadrid-platform-basic | lms/djangoapps/mailing/management/commands/mailchimp_sync_announcements.py | 155 | 2534 | """
Synchronizes the announcement list with all active students.
"""
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from .mailchimp_sync_course import (
connect_mailchimp, get_cleaned,
get_subscribe... | agpl-3.0 |
holtwick/pyxer | src/pyxer/template/genshi/filters/html.py | 2 | 16526 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | mit |
rainest/dance-partner-matching | networkx/readwrite/tests/test_leda.py | 2 | 1634 | #!/usr/bin/env python
import copy
from nose.tools import *
import networkx as nx
import os,tempfile
class TestLEDA(object):
def test_parse_leda(self):
data="""#header section \nLEDA.GRAPH \nstring\nint\n-1\n#nodes section\n5 \n|{v1}| \n|{v2}| \n|{v3}| \n|{v4}| \n|{v5}| \n\n#edges section\n7 \n1 2 0 |{4}... | bsd-2-clause |
nomaro/SickBeard_Backup | lib/requests/packages/chardet2/langhebrewmodel.py | 63 | 11337 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-3.0 |
googleads/googleads-python-lib | examples/ad_manager/v202011/order_service/create_orders.py | 1 | 1804 | #!/usr/bin/env python
#
# Copyright 2015 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 requir... | apache-2.0 |
lmprice/ansible | lib/ansible/modules/cloud/rackspace/rax_keypair.py | 50 | 4737 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
riga/luigi | test/_mysqldb_test.py | 95 | 1732 | # -*- 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 |
yfried/ansible | lib/ansible/modules/packaging/os/rpm_key.py | 100 | 6840 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# Copyright: (c) 2013, Héctor Acosta <hector.acosta@gazzang.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, pri... | gpl-3.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/libfuturize/fixes/fix_oldstr_wrap.py | 44 | 1214 | """
For the ``future`` package.
Adds this import line:
from past.builtins import str as oldstr
at the top and wraps any unadorned string literals 'abc' or explicit byte-string
literals b'abc' in oldstr() calls so the code has the same behaviour on Py3 as
on Py2.6/2.7.
"""
from __future__ import unicode_literals... | gpl-3.0 |
manolama/dd-agent | checks.d/hdfs_namenode.py | 11 | 8470 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
'''
HDFS NameNode Metrics
---------------------
hdfs.namenode.capacity_total Total disk capacity in bytes
hdfs.namenode.capacity_used Disk usage in bytes
hdfs.namenode.capac... | bsd-3-clause |
joone/chromium-crosswalk | third_party/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.