repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
doot/CouchPotatoServer | refs/heads/master | libs/oauth2/clients/smtp.py | 884 | """
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 ... |
simbha/GAE-appswell | refs/heads/master | appspot/framework/vendor/google_api/gdata/sites/client.py | 48 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
40223233/2016fallcadp_hw | refs/heads/gh-pages | plugin/liquid_tags/graphviz.py | 245 | """
GraphViz Tag
---------
This implements a Liquid-style graphviz tag for Pelican. You can use different
Graphviz programs like dot, neato, twopi etc. [1]
[1] http://www.graphviz.org/
Syntax
------
{% graphviz
<program> {
<DOT code>
}
%}
Examples
--------
{% graphviz
dot {
digraph graph... |
OLAPLINE/TM1py | refs/heads/master | TM1py/Objects/Hierarchy.py | 2 | # -*- coding: utf-8 -*-
import collections
import json
from TM1py.Objects.Element import Element
from TM1py.Objects.ElementAttribute import ElementAttribute
from TM1py.Objects.TM1Object import TM1Object
from TM1py.Utils.Utils import CaseAndSpaceInsensitiveDict, CaseAndSpaceInsensitiveTuplesDict, lower_and_drop_spaces... |
HybridF5/tempest_debug | refs/heads/master | releasenotes/source/conf.py | 6 | # -*- 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, software... |
emilio/servo | refs/heads/master | tests/wpt/web-platform-tests/common/security-features/subresource/audio.py | 16 | import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(request, server_data):
file = os.path.join(request.doc_root, "webaudio", "resources",
"sin_440Hz_-6dBFS_1s.wav")
return open(file, "rb").read()
def main(request, respo... |
hosseinmh/jango_learning | refs/heads/master | .venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... |
cookingkode/woof | refs/heads/master | kafka/partitioner/roundrobin.py | 41 | from itertools import cycle
from .base import Partitioner
class RoundRobinPartitioner(Partitioner):
"""
Implements a round robin partitioner which sends data to partitions
in a round robin fashion
"""
def __init__(self, partitions):
super(RoundRobinPartitioner, self).__init__(partitions)
... |
voilet/cmdb | refs/heads/master | users/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
SimonSapin/servo | refs/heads/master | tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py | 44 | def main(request, response):
headers = [
("Content-Type", "text/javascript"),
("Access-Control-Allow-Origin", request.headers.get("Origin")),
("Access-Control-Allow-Credentials", "true")
]
identifier = request.GET.first("id")
cookie_name = request.GET.first("cookieName")
cook... |
Astoriane/jCrunchyroll | refs/heads/master | lib/crunchy-xml-decoder/unidecode/x093.py | 252 | data = (
'Lun ', # 0x00
'Kua ', # 0x01
'Ling ', # 0x02
'Bei ', # 0x03
'Lu ', # 0x04
'Li ', # 0x05
'Qiang ', # 0x06
'Pou ', # 0x07
'Juan ', # 0x08
'Min ', # 0x09
'Zui ', # 0x0a
'Peng ', # 0x0b
'An ', # 0x0c
'Pi ', # 0x0d
'Xian ', # 0x0e
'Ya ', # 0x0f
'Zhui ', # 0x10
'Le... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/space_greeter_dantooine_brother_rebel.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/building/player/city/garden_naboo_med_03.py | 85615 | import sys
def setup(core, object):
return |
chrish42/pylearn | refs/heads/master | pylearn2/gui/tangent_plot.py | 44 | """
Code for plotting curves with tangent lines.
"""
__author__ = "Ian Goodfellow"
try:
from matplotlib import pyplot
except Exception:
pyplot = None
from theano.compat.six.moves import xrange
def tangent_plot(x, y, s):
"""
Plots a curve with tangent lines.
Parameters
----------
x : lis... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | tools/ipc_messages_log.py | 170 | #!/usr/bin/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.
""""Processes a log file and resolves IPC message identifiers.
Resolves IPC messages of the form [unknown type NNNNNN] to named IPC me... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env32/lib/python2.7/encodings/iso8859_14.py | 593 | """ Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
zycdragonball/tensorflow | refs/heads/master | tensorflow/python/estimator/export/export_output.py | 37 | # 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... |
xodus7/tensorflow | refs/heads/master | tensorflow/contrib/layers/python/layers/regularizers.py | 82 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
haeusser/tensorflow | refs/heads/master | tensorflow/python/ops/dequantize_op_test.py | 129 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
jonashaag/django-nonrel-nohistory | refs/heads/master | django/template/loaders/app_directories.py | 229 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... |
Immortalin/python-for-android | refs/heads/master | python-build/python-libs/BeautifulSoup/BeautifulSoupTests.py | 89 | # -*- coding: utf-8 -*-
"""Unit tests for Beautiful Soup.
These tests make sure the Beautiful Soup works as it should. If you
find a bug in Beautiful Soup, the best way to express it is as a test
case like this that fails."""
import unittest
from BeautifulSoup import *
class SoupTest(unittest.TestCase):
def ass... |
OSSESAC/odoopubarquiluz | refs/heads/7.0 | addons/l10n_in_hr_payroll/report/payment_advice_report.py | 51 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
nathanaevitas/odoo | refs/heads/master | openerp/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py | 337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
fejta/test-infra | refs/heads/master | scenarios/kubernetes_janitor.py | 10 | #!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
un33k/robotframework | refs/heads/master | src/robot/jarrunner.py | 23 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
isrohutamahopetechnik/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/core/tests/test_unicode.py | 58 | import sys
from numpy.testing import *
from numpy.core import *
from numpy.compat import asbytes
# Guess the UCS length for this python interpreter
if sys.version_info[0] >= 3:
import array as _array
ucs4 = (_array.array('u').itemsize == 4)
def buffer_length(arr):
if isinstance(arr, unicode):
... |
campbe13/openhatch | refs/heads/master | vendor/packages/Django/django/core/management/commands/validate.py | 239 | from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Validates all installed models."
requires_model_validation = False
def handle_noargs(self, **options):
self.validate(display_num_errors=True)
|
vladmm/intellij-community | refs/heads/master | python/lib/Lib/distutils/text_file.py | 85 | """text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
__revision__ = "$Id: text_file.py 29687 2002-11-14 02:25:42Z akuchling $"
from types import *
import sys, os, string
clas... |
mvaled/sentry | refs/heads/master | src/sentry/south_migrations/0467_backfill_integration_status.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for offline
is_d... |
nizox/circuits | refs/heads/master | circuits/web/url.py | 3 | #!/usr/bin/env python
#
# Copyright (c) 2012 SEOmoz
#
# 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, merg... |
haoyunfeix/crosswalk-test-suite | refs/heads/master | wrt/wrt-packagemgt-windows-tests/pmwindows/Crosswalk_WebApp_Update.py | 14 | #!/bin/bash
#Copyright (c) 2015 Intel Corporation.
#
#Redistribution and use in source and binary forms, with or without modification,
#are permitted provided that the following conditions are met:
#
#* Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disc... |
andrewsmedina/django | refs/heads/master | django/core/mail/backends/base.py | 660 | """Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
"""
def __init__(self, fail_silently=False, **kwargs):
self.fail_silently = fail_silently
def open(self):
"""Op... |
tchellomello/home-assistant | refs/heads/dev | tests/components/vesync/test_config_flow.py | 7 | """Test for vesync config flow."""
from homeassistant import data_entry_flow
from homeassistant.components.vesync import DOMAIN, config_flow
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from tests.async_mock import patch
from tests.common import MockConfigEntry
async def test_abort_already_setup(hass... |
marckuz/django | refs/heads/master | tests/version/tests.py | 352 | from unittest import TestCase
from django import get_version
from django.utils import six
class VersionTests(TestCase):
def test_development(self):
ver_tuple = (1, 4, 0, 'alpha', 0)
# This will return a different result when it's run within or outside
# of a git clone: 1.4.devYYYYMMDDHHM... |
GoogleChrome/big-rig | refs/heads/master | app/src/thirdparty/telemetry/internal/util/bootstrap.py | 19 | # 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.
"""Bootstrap Chrome Telemetry by downloading all its files from SVN servers.
Requires a DEPS file to specify which directories on which SVN servers
are requ... |
johnnyliu27/openmc | refs/heads/develop | tests/regression_tests/salphabeta/test.py | 3 | import openmc
import openmc.model
from tests.testing_harness import PyAPITestHarness
def make_model():
model = openmc.model.Model()
# Materials
m1 = openmc.Material()
m1.set_density('g/cc', 4.5)
m1.add_nuclide('U235', 1.0)
m1.add_nuclide('H1', 1.0)
m1.add_s_alpha_beta('c_H_in_H2O', fract... |
gkioxari/RstarCNN | refs/heads/master | lib/fast_rcnn/test_scene.py | 1 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
# --------------------------------------------------------
# R*CNN
# Wri... |
cocos2d/cocos2d-x-samples | refs/heads/v3 | samples/FantasyWarrior3D/tolua/genbindings-lua.py | 8 | #!/usr/bin/python
# This script is used to generate luabinding glue codes.
# Android ndk version must be ndk-r9b.
import sys
import os, os.path
import shutil
import ConfigParser
import subprocess
import re
from contextlib import contextmanager
import shutil
import yaml
import tempfile
def _check_ndk_root_env():
... |
ewolinetz/openshift-ansible | refs/heads/master | playbooks/adhoc/grow_docker_vg/filter_plugins/grow_docker_vg_filters.py | 24 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in openshift-ansible
'''
class FilterModule(object):
''' Custom ansible filters '''
@staticmethod
def translate_volume_name(volumes, target_volume):
'''
This filter matches a device string /dev/sdX to /dev/xvdX
... |
jaysonsantos/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_putForwards.py | 142 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface I {
[PutForwards=B] readonly attribute long A;
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
parse... |
josephyzhou/MaidSafe | refs/heads/master | src/third_party_libs/googlemock/test/gmock_output_test.py | 986 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
mindinpanic/codingmood | refs/heads/master | codemood/commits/migrations/0008_auto__chg_field_commit_code_rate__chg_field_commit_prev_date__chg_fiel.py | 2 | # -*- 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):
# Changing field 'Commit.code_rate'
db.alter_column(u'commits_commit', 'code_rate', self.gf('django.db.mode... |
jkenn99/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/lib/TestCmd.py | 137 | """
TestCmd.py: a testing framework for commands and scripts.
The TestCmd module provides a framework for portable automated testing
of executable commands and scripts (in any language, not just Python),
especially commands and scripts that require file system interaction.
In addition to running tests and evaluating... |
unsiloai/syntaxnet-ops-hack | refs/heads/master | tensorflow/contrib/session_bundle/gc_test.py | 113 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.3/Lib/lib-tk/turtle.py | 2 | # LogoMation-like turtle graphics
from math import * # Also for export
import Tkinter
class Error(Exception):
pass
class RawPen:
def __init__(self, canvas):
self._canvas = canvas
self._items = []
self._tracing = 1
self._arrow = 0
self.degrees()
self.reset()
... |
zhengzhihust/tablib | refs/heads/develop | tablib/packages/openpyxl/chart.py | 61 | '''
Copyright (c) 2010 openpyxl
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, publish, distribute,... |
edofic/ggrc-core | refs/heads/develop | src/ggrc/models/person.py | 2 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import re
from sqlalchemy.orm import validates
from ggrc import db
from ggrc import settings
from ggrc.models.computed_property import computed_property
from ggrc.models.context import HasOwnContext
from gg... |
xtornasol512/phyroserver | refs/heads/master | back-end/phyrosite/phyrosite/blog/views.py | 2 | # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import redirect
from django.template import RequestContext
from django.http import HttpResponseRedirect |
Valloric/ycmd | refs/heads/master | cpp/ycm/tests/gmock/gtest/scripts/upload_gtest.py | 1963 | #!/usr/bin/env python
#
# Copyright 2009, 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... |
logston/cunidecode | refs/heads/master | data/x084.py | 252 | data = (
'Hu ', # 0x00
'Qi ', # 0x01
'He ', # 0x02
'Cui ', # 0x03
'Tao ', # 0x04
'Chun ', # 0x05
'Bei ', # 0x06
'Chang ', # 0x07
'Huan ', # 0x08
'Fei ', # 0x09
'Lai ', # 0x0a
'Qi ', # 0x0b
'Meng ', # 0x0c
'Ping ', # 0x0d
'Wei ', # 0x0e
'Dan ', # 0x0f
'Sha ', # 0x10
'Hu... |
jfmartinez64/test | refs/heads/master | libs/pyutil/assertutil.py | 106 | # Copyright (c) 2003-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
Tests useful in assertion checking, prints out nicely formated messages too.
"""
from humanreadable import hr
def _assert(___cond=False, *___args, **___kwargs):
if ___cond:
return True
... |
pranavladkat/3dVPM | refs/heads/master | examples/post_process_wind_turbine.py | 1 | """
post process wind turbine Cp data
"""
import csv
import math
import matplotlib.pyplot as plt
def normalize_x(x):
minimum = min(x)
x = [i+abs(minimum) for i in x]
maximum = max(x)
for i in range(0,len(x),1):
x[i] = (x[i]) / maximum
return x
def main()... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/tests/test_libxml2.py | 17 | from twisted.trial import unittest
from scrapy.utils.test import libxml2debug
class Libxml2Test(unittest.TestCase):
try:
import libxml2
except ImportError, e:
skip = str(e)
@libxml2debug
def test_libxml2_bug_2_6_27(self):
# this test will fail in version 2.6.27 but passes on ... |
nrcmedia/python-twitter | refs/heads/master | twitter.py | 1 | #!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... |
dcosentino/edx-platform | refs/heads/master | common/test/acceptance/fixtures/base.py | 148 | """
Common code shared by course and library fixtures.
"""
import re
import requests
import json
from lazy import lazy
from . import STUDIO_BASE_URL
class StudioApiLoginError(Exception):
"""
Error occurred while logging in to the Studio API.
"""
pass
class StudioApiFixture(object):
"""
Base... |
Bounti/avatar-python | refs/heads/master | avatar/util/socket_file.py | 1 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import object
class SocketFile(object):
def __init__(self, sock):
self._so... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/idlelib/aboutDialog.py | 46 | """About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
se... |
alander/StarCluster | refs/heads/develop | starcluster/plugins/hadoop.py | 18 | # Copyright 2009-2014 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster 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 3 of the License, or (at your option) any
# later ... |
xydinesh/youtube-dl | refs/heads/master | test/test_compat.py | 53 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import get_filesystem_encoding
from youtube_dl.compat import (
compat_... |
chaveiro/Arduino | refs/heads/master | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/connectionpool.py | 184 | # urllib3/connectionpool.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import socket
import errno
from socket import error as SocketError, time... |
rjschof/gem5 | refs/heads/master | src/sim/InstTracer.py | 72 | # 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 ... |
ToontownUprising/src | refs/heads/master | toontown/safezone/ButterflyGlobals.py | 3 | from pandac.PandaModules import *
import random
OFF = 0
FLYING = 1
LANDED = 2
states = {OFF: 'off',
FLYING: 'Flying',
LANDED: 'Landed'}
NUM_BUTTERFLIES = (6, 36, 5) # gg spawning too many butterflies causes Astron to kick some people.
NUM_BUTTERFLY_AREAS = (4, 1, 4)
BUTTERFLY_SPEED = 2.0
BUTTERFLY_HEIGHT = (2.2, 3.2,... |
gioman/QGIS | refs/heads/master | python/plugins/processing/algs/gdal/ogr2ogr.py | 1 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogr.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... |
kit-cel/gr-dab | refs/heads/master | docs/doxygen/doxyxml/generated/compound.py | 344 | #!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
import sys
import compoundsuper as supermod
from compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
def __i... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Django-1.2.3/tests/regressiontests/requests/__init__.py | 272 | """
Tests for Django's various Request objects.
"""
|
wuga214/Django-Wuga | refs/heads/master | env/lib/python2.7/site-packages/django/conf/urls/static.py | 336 | import re
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
from django.views.static import serve
def static(prefix, view=serve, **kwargs):
"""
Helper function to return a URL pattern for serving files in debug mode.
from django.con... |
s-hertel/ansible | refs/heads/devel | test/units/parsing/test_splitter.py | 117 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o... |
andytopham/podplayer | refs/heads/master | oled.py | 1 | #!/usr/bin/python
''' Module to control the picaxe OLED.
Updated to work with both 16x2 and 20x4 versions.
Requires new picaxe fw that inverts serial polarity, i.e. N2400 -> T2400.
The oled modules work fine off the RPi 3v3, which avoids the need for level shifting.
Requires the installation of the python seria... |
proevo/pythondotorg | refs/heads/master | codesamples/migrations/0003_auto_20170821_2000.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('codesamples', '0002_auto_20150416_1853'),
]
operations = [
migrations.AlterField(
model_name='codesample',
... |
Rygbee/elasticsearch | refs/heads/master | dev-tools/create_bwc_index_with_some_ancient_segments.py | 217 | import create_bwc_index
import logging
import os
import random
import shutil
import subprocess
import sys
import tempfile
def fetch_version(version):
logging.info('fetching ES version %s' % version)
if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != ... |
yavuzovski/playground | refs/heads/master | python/django/RESTTest/.venv/lib/python3.4/site-packages/django/db/models/fields/proxy.py | 697 | """
Field-like classes that aren't really fields. It's easier to use objects that
have the same attributes as fields sometimes (avoids a lot of special casing).
"""
from django.db.models import fields
class OrderWrt(fields.IntegerField):
"""
A proxy for the _order database field that is used when
Meta.or... |
gs0510/coala-bears | refs/heads/master | tests/python/bandit_test_files/skip.py | 30 | subprocess.call(["/bin/ls", "-l"])
subprocess.call(["/bin/ls", "-l"]) #noqa
subprocess.call(["/bin/ls", "-l"]) # noqa
subprocess.call(["/bin/ls", "-l"]) # nosec
subprocess.call(["/bin/ls", "-l"])
subprocess.call(["/bin/ls", "-l"]) #nosec
subprocess.call(["/bin/ls", "-l"])
|
larsbutler/coveragepy | refs/heads/master | coverage/pytracer.py | 1 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Raw data collector for coverage.py."""
import dis
import sys
from coverage import env
# We need the YIELD_VALUE opcode below, in a comparison-friendly form.
Y... |
FireWRT/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/hotshot/stones.py | 233 | import errno
import hotshot
import hotshot.stats
import sys
import test.pystone
def main(logfile):
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
print "Pystone(%s) time for %d passes = %g" % \
(test.pystone.__version__, test.pystone.LOOPS, bencht... |
BeegorMif/HTPC-Manager | refs/heads/master | lib/sqlalchemy/dialects/mysql/__init__.py | 79 | # mysql/__init__.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
from . import base, mysqldb, oursql, \
pyodbc, zxjdb... |
amplifylitco/asiaq | refs/heads/master | disco_aws_automation/disco_ssm.py | 1 | # -*- coding: utf-8 -*-
"""
Manage AWS SSM document creation and execution
"""
from __future__ import print_function
import os
import logging
import time
import json
import boto3
from botocore.exceptions import ClientError
from boto.exception import BotoServerError
from .disco_config import read_config
from .resource... |
czardoz/postman-mock-server | refs/heads/master | postmocker/main.py | 1 | import logging
import gevent
from gevent.pywsgi import WSGIServer, WSGIHandler
from postmocker.appbuilder import AppBuilder
logger = logging.getLogger(__name__)
class LoggingWSGIHandler(WSGIHandler):
def __init__(self, socket, address, server, *args, **kwargs):
self.logger = logging.getLogger('http')
... |
tmlee/pyrollbar | refs/heads/master | rollbar/test/test_rollbar.py | 2 | import sys
import copy
import mock
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import unittest
import urllib
import rollbar
from . import BaseTest
try:
# Python 3
import urllib.parse as urlparse
urllibquote = urlparse.quote
except ImportError:
# Python 2
... |
adamewing/bamsurgeon | refs/heads/master | scripts/bsrg.py | 2 | #!/usr/bin/env python
''' Adds a bogus read group to a readgroup-less BAM file '''
import os
import sys
import pysam
from uuid import uuid4
def modhead(header, rgid, fn):
if 'RG' in header:
sys.stderr.write("RG found in header, this script is not what you want!\n")
sys.exit(usage())
header[... |
sdpython/cvxpy | refs/heads/master | cvxpy/atoms/quad_over_lin.py | 11 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/google/appengine/api/system/system_stub.py | 8 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
googleapis/python-aiplatform | refs/heads/master | samples/snippets/import_data_text_entity_extraction_sample.py | 1 | # Copyright 2020 Google LLC
#
# 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 law or agreed to in writing, ... |
pyblish/pyblish-win | refs/heads/master | lib/Python27/Tools/i18n/makelocalealias.py | 24 | #!/usr/bin/env python
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.
"""
import locale
# Location of the alias file
LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
def parse(filename):
f = open(f... |
odyaka341/nxt-python | refs/heads/master | setup.py | 17 | #!/usr/bin/env python
from distutils.core import setup
try:
readme = open('README', 'r')
ldesc = readme.read(20000)
readme.close()
except:
ldesc = ""
setup(
name='nxt-python',
version='2.2',
author='Marcus Wanner',
author_email='marcus@wanners.net',
description='LEGO Mindstorms NX... |
aequitas/home-assistant | refs/heads/dev | tests/components/homematicip_cloud/test_hap.py | 8 | """Test HomematicIP Cloud accesspoint."""
from unittest.mock import Mock, patch
import pytest
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.components.homematicip_cloud import hap as hmipc
from homeassistant.components.homematicip_cloud import const, errors
from tests.common import mock_... |
azureplus/hue | refs/heads/master | desktop/core/ext-py/lxml/src/lxml/html/builder.py | 149 | # --------------------------------------------------------------------
# The ElementTree toolkit is
# Copyright (c) 1999-2004 by Fredrik Lundh
# --------------------------------------------------------------------
"""
A set of HTML generator tags for building HTML documents.
Usage::
>>> from lxml.html.builder im... |
waseem18/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/forms/models.py | 105 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import datetime
import tempfile
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
temp_storage_location = tempfile.mkdtemp(dir=os.environ['DJANGO... |
agarciamontoro/TFG | refs/heads/master | Software/Raytracer/camera.py | 1 | from .universe import universe
from .raytracer import RayTracer
from .geodesics import Congruence, CongruenceSnapshot
from Utils.attr_dict import AttrDict
import numpy as np
from numpy import sin, cos, sqrt
from matplotlib import image as mimg
class Camera:
"""Pinhole camera placed near a Kerr black hole.
... |
jhumphry/regressions | refs/heads/master | regressions/fitstats.py | 1 | """A module which implements goodness-of-fit statistics."""
try:
import scipy.stats
_stats_available = True
except ImportError:
_stats_available = False
from . import *
def SS(Y):
"""Implements the Sum of Squares
This function calculates the sum of the squared input data. The input
data is ... |
nijel/weblate | refs/heads/main | weblate/accounts/password_validation.py | 2 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Lice... |
cysjtu/SentimentAnalysis | refs/heads/master | nlp_machine2222.py | 1 | # encoding=utf-8
'''
Created on 2015年12月23日
@author: nali
'''
import csv
from nltk.classify.scikitlearn import SklearnClassifier
from sklearn.svm import SVC, LinearSVC, NuSVC
from sklearn.naive_bayes import MultinomialNB, BernoulliNB
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import acc... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/pysqlite/doc/includes/sqlite3/insert_more_people.py | 49 | from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
newPeople = (
('Lebed' , 53),
('Zhirinovsky' , 57),
)
for person in newPeople:
cur.execute("insert into people (name_last, age) values (?, ?)", person)
# The changes will not be saved unless the transaction... |
agaldona/odoo-addons | refs/heads/master | crm_claim_team/models/crm_claim.py | 2 | # -*- coding: utf-8 -*-
# (c) 2015 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, fields, models
class CrmClaim(models.Model):
_inherit = 'crm.claim'
@api.multi
@api.onchange('section_id')
def onchange_section_id(self):
self... |
nim65s/MarkDownBlog | refs/heads/master | dmdb/feeds.py | 1 | from datetime import datetime
from django.contrib.syndication.views import Feed
from django.urls import reverse_lazy
from .models import BlogEntry
class BlogEntriesFeed(Feed):
title = 'News'
link = reverse_lazy('dmdb:feed')
description = 'Latest blog entries'
def items(self):
return BlogEnt... |
jarshwah/django | refs/heads/master | setup.py | 19 | import os
import sys
from distutils.sysconfig import get_python_lib
from setuptools import find_packages, setup
# Warn if we are installing over top of an existing installation. This can
# cause issues where files that were deleted from a more recent Django are
# still present in site-packages. See #18115.
overlay_wa... |
acgtun/acgtun.com | refs/heads/master | acgtun/words/admin.py | 469 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.
|
carrillo/scikit-learn | refs/heads/master | sklearn/datasets/species_distributions.py | 198 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... |
gavoski/audacity | refs/heads/master | lib-src/lv2/sratom/waflib/extras/autowaf.py | 54 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import glob
import os
import subprocess
import sys
from waflib import Configure,Context,Logs,Node,Options,Task,Utils
from waflib.TaskGen import feature,before,after
global g_i... |
scottp-dpaw/oim-cms | refs/heads/master | oim_cms/urls.py | 3 | from django.urls import path, re_path, include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail.core import urls as wagtail_urls
from core ... |
tfga/release | refs/heads/master | printArgs.py | 1 | #!/usr/bin/python
import sys
for arg in sys.argv:
print ">{0}<".format(arg)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.