repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
viswimmer1/PythonGenerator | refs/heads/master | data/python_files/32885928/converse_tags.py | 2 | import datetime
import hashlib
from django import template
from django.utils.timesince import timesince
from django.utils.html import escape
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
register = template.Library()
@regist... |
alex/pinax | refs/heads/master | pinax/projects/static_project/settings.py | 1 | # Django settings for stati_project project.
import os.path
import pinax
PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# tells Pinax to serve media through the staticfiles app.
SERVE_MEDIA = DEBUG
ADMINS =... |
atpaino/theblock | refs/heads/master | userInfo/wsgi.py | 2 | import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
(head, path) = os.path.split(os.path.dirname(os.path.realpath(__file__)))
sys.path = [ head ] + sys.path
from django.... |
OpenUpgrade-dev/OpenUpgrade | refs/heads/8.0 | addons/gamification/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
ludmilamarian/invenio | refs/heads/master | invenio/legacy/bibedit/utils.py | 2 | # This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2013, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any l... |
Edu-Glez/Bank_sentiment_analysis | refs/heads/master | env/lib/python3.6/site-packages/nltk/help.py | 7 | # Natural Language Toolkit (NLTK) Help
#
# Copyright (C) 2001-2017 NLTK Project
# Authors: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Provide structured access to documentation.
"""
from __future__ import print_function
import re
from textwrap import w... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/plugins/strategy/linear.py | 29 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
abenzbiria/clients_odoo | refs/heads/master | openerp/tools/config.py | 6 | #openerp.loggers.handlers. -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program... |
chromium/chromium | refs/heads/master | third_party/blink/web_tests/external/wpt/xhr/resources/corsenabled.py | 20 | import time
from wptserve.utils import isomorphic_encode
def main(request, response):
headers = [(b"Access-Control-Allow-Origin", b"*"),
(b"Access-Control-Allow-Credentials", b"true"),
(b"Access-Control-Allow-Methods", b"GET, POST, PUT, FOO"),
(b"Access-Control-Allow-H... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env64/lib/python2.7/site-packages/pip/_vendor/distlib/locators.py | 328 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... |
dstroppa/openstack-smartos-nova-grizzly | refs/heads/master | nova/tests/test_virt_disk_vfs_guestfs.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012 Red Hat, 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... |
elit3ge/SickRage | refs/heads/master | lib/babelfish/language.py | 79 | # -*- 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 collections import namedtuple
from functools import partial
from pkg_resour... |
zubie7a/CPP | refs/heads/master | CodeSignal/Arcade/Intro/Level_05/02_Maximal_Adjacent_Difference.py | 3 | # https://app.codesignal.com/arcade/intro/level-5/EEJxjQ7oo7C5wAGjE
def arrayMaximalAdjacentDifference(input_array):
# Find the maximal absolute difference between any to adjacent elements.
max_diff = float('-inf')
for i in range(len(input_array) - 1):
diff = abs(input_array[i] - input_array[i + 1])... |
JorisDeRieck/Flexget | refs/heads/develop | flexget/plugins/operate/disable_phases.py | 13 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('disable_phases')
class PluginDisablePhases(object):
"""Disables p... |
JackKelly/pda | refs/heads/master | pda/tests/test_channel.py | 1 | #!/usr/bin/python
from __future__ import print_function, division
import unittest, os, inspect
from pda.channel import *
from pda.channel import _load_sometimes_unplugged, _secs_per_period_alias
import pandas as pd
import correct_answers
# Taken from http://stackoverflow.com/a/6098238/732596
FILE_PATH = os.path.dirnam... |
zhaochl/python-utils | refs/heads/master | utils/orm/orm_util.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from peewee import *
import time
db = MySQLDatabase(host = 'irweb', user = 'root', passwd = 'root', database = 'mydb')
#print db
class Less3(Model):
class Meta:
db_table = 'search_less3_exception_log'
database = db
log_id = PrimaryKeyField()
project... |
folkien/pyManager | refs/heads/master | pyCommandWindow.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import curses
import curses.textpad
class cCommandWindow:
'Klasa opisująca okno polecen.'
def __init__(self):
# Wskazniki :
self.winPtr = 0
self.directory = "/"
self.cursor = 0
self.dispList = [ "../", "./" ]
#polozenia okna i ... |
Nekroze/twistless | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Twistless documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 22 00:10:51 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# au... |
Mobii/twilio-python | refs/heads/master | twilio/rest/resources/sip/credential_lists.py | 51 | from .. import InstanceResource, ListResource
class Credential(InstanceResource):
""" A username/password entry in a CredentialList.
.. attribute:: sid
A 34 character string that uniquely identifies this resource.
.. attribute:: account_sid
The unique id of the Account responsible for ... |
RafaelRMachado/qtwebkit | refs/heads/dev | Tools/Scripts/webkitpy/tool/mocktool_unittest.py | 124 | # Copyright (C) 2010 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... |
romank0/kombu | refs/heads/master | kombu/tests/transport/test_memory.py | 2 | from __future__ import absolute_import
import socket
from kombu import Connection, Exchange, Queue, Consumer, Producer
from kombu.tests.utils import TestCase
class test_MemoryTransport(TestCase):
def setUp(self):
self.c = Connection(transport='memory')
self.e = Exchange('test_transport_memory'... |
arne-cl/discoursegraphs | refs/heads/master | src/discoursegraphs/readwrite/rst/urml.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Arne Neumann <discoursegraphs.programming@arne.cl>
"""
This module converts an URML XML file (represents underspecified
rhetorical structure annotations) into a networkx-based directed graph
(``DiscourseDocumentGraph``).
"""
import os
from lxml import etree
imp... |
albertjan/pypyjs-presentation | refs/heads/gh-pages | assets/js/pypy.js-0.3.1/lib/modules/encodings/cp1140.py | 593 | """ Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.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='stri... |
RNAcentral/rnacentral-import-pipeline | refs/heads/master | rnacentral_pipeline/databases/ensembl/data.py | 1 | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... |
KRHS-GameProgramming-2016/AstroDigger | refs/heads/master | Shade.py | 1 | import pygame, sys, math, random
from Enemy import *
class Shade(Enemy):
def __init__(self, speed=0, pos=[0,0], size=64):
self.size = size
self.imageLeft = pygame.image.load("Resources/Enemy/Enemy-shade-left.png")
self.imageRight = pygame.image.load("Resources/Enemy/Enemy-shade-right.png")
... |
behzadnouri/scipy | refs/heads/master | scipy/odr/models.py | 113 | """ Collection of Model instances for use with the odrpack fitting package.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.odr.odrpack import Model
__all__ = ['Model', 'exponential', 'multilinear', 'unilinear', 'quadratic',
'polynomial']
def _lin_fcn(B,... |
piensa/geonode | refs/heads/wm-develop | geonode/contrib/datatables/admin.py | 1 | from django.contrib import admin
from geonode.layers.models import Attribute
from .models import DataTable, TableJoin, JoinTarget, JoinTargetFormatType, GeocodeType
class DataTableAdmin(admin.ModelAdmin):
model = DataTable
list_display = (
'id',
'title',
'table_name',
'tablespac... |
walac/servo | refs/heads/master | tests/wpt/harness/wptrunner/update/update.py | 77 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
from metadata import MetadataUpdateRunner
from sync import SyncFromUpstreamRunner
from tree import... |
Splawik/pytigon | refs/heads/master | pytigon/prj/schpytigondemo/schspreadsheetdemo/views.py | 10 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, redirect
from django import forms
from django.template.loader import render_to_string
from django.template import Context, Template
from django.template import RequestContext
from d... |
eduNEXT/edx-platform | refs/heads/master | lms/djangoapps/grades/context.py | 9 | """
Grading Context
"""
from collections import OrderedDict
from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache
from .course_grade import CourseGrade
from .scores import possibly_scored
def grading_context_for_course(course):
"""
Same as grading_context, but takes in a cour... |
byndcivilization/toy-infrastructure | refs/heads/master | flask-app/venv/lib/python3.6/site-packages/setuptools/command/develop.py | 97 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os
import glob
import io
from setuptools.extern import six
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_in... |
ScottBuchanan/eden | refs/heads/master | modules/pygsm/__init__.py | 62 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4i encoding=utf-8
from gsmmodem import GsmModem
from autogsmmodem import AutoGsmModem
__doc__ = GsmModem.__doc__
def get_version():
try:
# do we have a static version set from an install?
from __version__ import VERSION as version
except Import... |
Herst/selenium | refs/heads/master | py/selenium/webdriver/common/utils.py | 6 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
EliotBerriot/django | refs/heads/master | tests/proxy_models/urls.py | 405 | from django.conf.urls import url
from .admin import site
urlpatterns = [
url(r'^admin/', site.urls),
]
|
060411121/zcl_linux | refs/heads/master | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... |
wakatime/vim-wakatime | refs/heads/master | packages/wakatime/packages/argparse.py | 62 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The... |
sanjeevtripurari/hue | refs/heads/master | apps/jobbrowser/src/jobbrowser/__init__.py | 38 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
oinopion/django | refs/heads/master | django/db/migrations/autodetector.py | 22 | from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... |
omg-insa/server | refs/heads/master | django/conf/locale/pt_BR/formats.py | 231 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \de N \de Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \de N \de Y à\s... |
Pymatteo/QtNMR | refs/heads/master | build/exe.win32-3.4/scipy/stats/tests/test_contingency.py | 126 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (run_module_suite, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_approx_equal, assert_raises,
assert_allclose)
from scipy.special import xlogy
from scipy.stats.contingen... |
madan96/sympy | refs/heads/master | sympy/assumptions/tests/test_matrices.py | 21 | from sympy import Q, ask, Symbol
from sympy.matrices.expressions import (MatrixSymbol, Identity, ZeroMatrix,
Trace, MatrixSlice, Determinant)
from sympy.matrices.expressions.factorizations import LofLU
from sympy.utilities.pytest import XFAIL
X = MatrixSymbol('X', 2, 2)
Y = MatrixSymbol('Y', 2, 3)
Z = MatrixSy... |
Dino0631/RedRain-Bot | refs/heads/develop | lib/youtube_dl/extractor/nrk.py | 13 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_duration,
)
class NRKBaseIE(InfoExtractor):
_GEO_COUNTRIES = ['NO']
... |
miguelpalacio/python-for-android | refs/heads/master | python-build/python-libs/xmpppy/xmpp/commands.py | 200 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... |
MonkeyZZZZ/platform_external_skia | refs/heads/master | tools/skp/recreate_skps.py | 24 | #!/usr/bin/env python
# Copyright (c) 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.
"""Run the webpages_playback automation script."""
import os
import subprocess
import sys
sys.path.insert(0, os.getcwd())
from... |
adrianmoisey/github3.py | refs/heads/develop | docs/examples/source/octocat_say.py | 14 | import github3
print("Hey Octocat!")
print(github3.octocat("Hey Ian!"))
print("What do you think about github3.py?")
print(github3.octocat("github3.py rocks!"))
print("Thanks Octocat, that means a lot coming from you.")
print("FIN.")
print("""Epilog:
The preceding conversation was entirely fictional. If you didn't... |
vschs007/buck | refs/heads/master | test/com/facebook/buck/jvm/java/testdata/fat_jar/print_lib_path.py | 47 | import os
import sys
import json
json.dump(dict(os.environ), sys.stdout)
|
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/platform/google_appengine/lib/distutils/distutils/command/bdist_rpm.py | 72 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
__revision__ = "$Id$"
import sys
import os
import string
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from distutils.errors ... |
captainhungrykaboom/MTAT.TK.006 | refs/heads/master | 27. märts - 2. aprill ülesanded/nädalaksimus.py | 1 | #küsimus 1
#def fun(arv1, arv2, arv3):
# if arv1 > arv2:
# return arv3
# else:
# return arv1
#fun(1,2,4)
#fun(4,2,1)
#küsimus 2
#max(1, min(3,4), 0)
#küsimus 3
#def motivatsioon(arv, kiitus):
# while arv > 0:
# print(kiitus)
#motivatsioon(2, "Oled tubli!")
#küsimus 4
#from turtle import... |
alexandrucoman/vbox-neutron-agent | refs/heads/master | neutron/extensions/quotasv2.py | 19 | # Copyright 2011 OpenStack Foundation.
# 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 req... |
katiecheng/Bombolone | refs/heads/master | env/lib/python2.7/site-packages/simplejson/decoder.py | 142 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from simplejson.scanner import make_scanner
def _import_c_scanstring():
try:
from simplejson._speedups import scanstring
return scanstring
except ImportError:
return None
c_scanstring = _import_c_scanstring()
__all... |
pschmitt/home-assistant | refs/heads/dev | tests/components/smhi/common.py | 13 | """Common test utilities."""
from tests.async_mock import Mock
class AsyncMock(Mock):
"""Implements Mock async."""
# pylint: disable=useless-super-delegation
async def __call__(self, *args, **kwargs):
"""Hack for async support for Mock."""
return super().__call__(*args, **kwargs)
|
emccode/viprcommand | refs/heads/master | ViPRCommand/__init__.py | 2 | """
Copyright EMC Corporation 2015.
Distributed under the MIT License.
(See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
"""
import sys
import os
package_dir = os.path.dirname(__file__) or '.'
# Insert the package_dir_a directory at the front of the path.
sys.path.insert(0, package_dir)
b... |
aericson/django-rest-framework | refs/heads/master | tests/test_metadata.py | 6 | from __future__ import unicode_literals
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.test import TestCase
from rest_framework import (
exceptions, metadata, serializers, status, versioning, views
)
from rest_framework.renderers import BrowsableAP... |
ostree/thefuck | refs/heads/master | thefuck/rules/man_no_space.py | 16 | def match(command):
return (command.script.startswith(u'man')
and u'command not found' in command.stderr.lower())
def get_new_command(command):
return u'man {}'.format(command.script[3:])
priority = 2000
|
synergeticsedx/deployment-wipro | refs/heads/oxa/master.fic | lms/djangoapps/instructor_analytics/tests/test_csvs.py | 175 | """ Tests for analytics.csvs """
from django.test import TestCase
from nose.tools import raises
from instructor_analytics.csvs import create_csv_response, format_dictlist, format_instances
class TestAnalyticsCSVS(TestCase):
""" Test analytics rendering of csv files."""
def test_create_csv_response_nodata(s... |
skim1420/spinnaker | refs/heads/master | testing/citest/tests/kube_v2_helm_test.py | 1 | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
ilonajulczuk/tubylcy | refs/heads/master | tubylcy/manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tubylcy.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
Ratler/undernet-totp | refs/heads/master | undernet_totp.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stefan Wold <ratler@stderr.eu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later ... |
sharkykh/SickRage | refs/heads/develop | lib/unidecode/x054.py | 251 | data = (
'Mie ', # 0x00
'Xu ', # 0x01
'Mang ', # 0x02
'Chi ', # 0x03
'Ge ', # 0x04
'Xuan ', # 0x05
'Yao ', # 0x06
'Zi ', # 0x07
'He ', # 0x08
'Ji ', # 0x09
'Diao ', # 0x0a
'Cun ', # 0x0b
'Tong ', # 0x0c
'Ming ', # 0x0d
'Hou ', # 0x0e
'Li ', # 0x0f
'Tu ', # 0x10
'Xiang ... |
sgerhart/ansible | refs/heads/maintenance_policy_module | lib/ansible/modules/network/avi/avi_serviceenginegroup.py | 20 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
lnielsen/invenio | refs/heads/pu | invenio/legacy/refextract/__init__.py | 4 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version ... |
arpitpanwar/zulip | refs/heads/master | zerver/lib/utils.py | 116 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import base64
import hashlib
import os
from time import sleep
from django.conf import settings
def statsd_key(val, clean_periods=False):
if not isinstance(val, str):
val = str(val)
if ':' in val:
val = val.split(':')[0]
val =... |
pjg101/SickRage | refs/heads/master | lib/twilio/rest/trunking.py | 23 | from twilio.rest.base import TwilioClient
from twilio.rest.resources.trunking import (
CredentialLists,
IpAccessControlLists,
OriginationUrls,
PhoneNumbers,
Trunks
)
from twilio.rest.resources import UNSET_TIMEOUT
class TwilioTrunkingClient(TwilioClient):
"""
A client for accessing the Twi... |
kater169/libcloud | refs/heads/trunk | libcloud/dns/drivers/google.py | 16 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
nimbis/djangocms-vimeo | refs/heads/master | djangocms_vimeo/models.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.utils.compat.dj import python_2_unicode_compatible
from cms.models import CMSPlugin
from . import settings
@python_2_unicode_compatible
class Vimeo... |
etiennekruger/phantomjs-qt5 | refs/heads/qt5 | src/breakpad/src/tools/gyp/test/generator-output/rules/copy-file.py | 489 | #!/usr/bin/env python
# Copyright (c) 2009 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.
import sys
contents = open(sys.argv[1], 'r').read()
open(sys.argv[2], 'wb').write(contents)
sys.exit(0)
|
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v2016_10_01/operations/__init__.py | 24 | # 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 may ... |
ingadhoc/odoo-addons | refs/heads/8.0 | product_replenishment_cost_rule/__openerp__.py | 5 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
imsparsh/python-for-android | refs/heads/master | python-modules/twisted/twisted/scripts/tapconvert.py | 81 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.python import usage
from twisted.application import app
from twisted.persisted import sob
import sys, getpass
class ConvertOptions(usage.Options):
synopsis = "Usage: tapconvert [options]"
optParameters = [
[... |
RalphBariz/RalphsDotNet | refs/heads/master | Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/scipy/optimize/cobyla.py | 55 | """Interface to Constrained Optimization By Linear Approximation
Functions:
fmin_coblya(func, x0, cons, args=(), consargs=None, rhobeg=1.0, rhoend=1e-4,
iprint=1, maxfun=1000)
Minimize a function using the Constrained Optimization BY Linear
Approximation (COBYLA) method
"""
import _cobyla
from nu... |
nrego/westpa | refs/heads/master | src/westext/weed/UncertMath.py | 4 | # Copyright (C) 2013 Joshua L. Adelman, Carsen A. Stringer and Daniel M. Zuckerman
#
# This file is part of WESTPA.
#
# WESTPA 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, o... |
gerv/bedrock | refs/heads/master | lib/l10n_utils/tests/test_files/extract_me_with_langfiles_lazy.py | 47 | # coding: utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from lib.l10n_utils.dotlang import _lazy as _
LANG_FILES = [
'donnie',
'walter',
]
def do_t... |
sussexstudent/falmer | refs/heads/master | falmer/schema/fields.py | 1 | from collections import OrderedDict
from functools import partial
import six
from graphene import InputObjectType,Argument
from graphene.types.argument import to_arguments
from graphene_django.filter.utils import get_filtering_args_from_filterset, get_filterset_class
from .utils import NonNullDjangoConnectionField
def... |
vanzaj/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | refs/heads/master | Chapter3_MCMC/github_pull.py | 95 | #github data scrapper
"""
variables of interest:
indp. variables
- language, given as a binary variable. Need 4 positions for 5 langagues
- #number of days created ago, 1 position
- has wiki? Boolean, 1 position
- followers, 1 position
- following, 1 position
- constant
dep. variab... |
back-to/streamlink | refs/heads/master | src/streamlink/plugins/zattoo.py | 1 | import logging
import re
import uuid
from requests.cookies import cookiejar_from_dict
from streamlink import PluginError
from streamlink.cache import Cache
from streamlink.plugin import Plugin
from streamlink.plugin import PluginArguments, PluginArgument
from streamlink.plugin.api import useragents
from streamlink.pl... |
hmcmooc/muddx-platform | refs/heads/master | common/djangoapps/third_party_auth/tests/specs/test_linkedin.py | 78 | """Integration tests for LinkedIn providers."""
from third_party_auth import provider
from third_party_auth.tests.specs import base
class LinkedInOauth2IntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for provider.LinkedInOauth2."""
PROVIDER_CLASS = provider.LinkedInOauth2
PROVIDER_SETT... |
simudream/PyDev.Debugger | refs/heads/development | tests/test_jysimpleTipper.py | 54 | #line to run:
#java -classpath D:\bin\jython-2.1\jython.jar;D:\bin\eclipse331_1\plugins\org.junit_3.8.2.v200706111738\junit.jar;D:\bin\eclipse331_1\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant.jar org.python.util.jython w:\org.python.pydev\pysrc\tests\test_jysimpleTipper.py
import unittest
import os
import sys
... |
alexbruy/QGIS | refs/heads/master | python/ext-libs/jinja2/debug.py | 620 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/gunicorn/instrument/statsd.py | 11 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
"Bare-bones implementation of statsD's protocol, client-side"
import socket
import logging
from re import sub
from gunicorn.glogging import Logger
from gunicorn import six
# Instrumentation... |
fugue/votebot | refs/heads/master | requests/packages/chardet/gb2312prober.py | 2993 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
sharifelguindi/qatrackplus | refs/heads/master | qatrack/qa/migrations/0013_auto__add_field_testlistinstance_day__chg_field_testlistinstance_modif.py | 2 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TestListInstance.day'
db.add_column('qa_testlistinstance', 'day',
self.gf('django.db.models.fields.IntegerField')(d... |
cgloger/inviwo | refs/heads/master | tools/ivwpy/regression/database.py | 1 | #*********************************************************************************
#
# Inviwo - Interactive Visualization Workshop
#
# Copyright (c) 2013-2016 Inviwo Foundation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... |
williamjacksn/python-rainwave-client | refs/heads/master | docs/conf.py | 1 | import os
import sphinx_rtd_theme
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('... |
dfalt974/SickRage | refs/heads/master | lib/twilio/rest/lookups.py | 23 | from twilio.rest.base import TwilioClient
from twilio.rest.resources import UNSET_TIMEOUT
from twilio.rest.resources.lookups.phone_numbers import PhoneNumbers
class TwilioLookupsClient(TwilioClient):
"""
A client for accessing the Twilio Lookups API.
The Twilio Lookups API provides information about phon... |
MarcosCommunity/odoo | refs/heads/marcos-8.0 | comunity_modules/web_easy_switch_company/controllers/__init__.py | 5 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Web Easy Switch Company module for OpenERP
# Copyright (C) 2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# This program is free software: you can redi... |
p0cisk/Quantum-GIS | refs/heads/master | python/ext-libs/owslib/gm03.py | 14 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2015 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... |
it-projects-llc/odoo-saas-tools | refs/heads/11.0 | saas_portal_async/models/saas_portal_async.py | 1 | from odoo import api
from odoo import models
try:
from odoo.addons.connector.queue.job import job
from odoo.addons.connector.session import ConnectorSession
except Exception as e:
def empty_decorator(func):
return func
job = empty_decorator
@job
def async_client_create(session, mself, *args, *... |
erlimar/prototypeguide | refs/heads/master | src/lib/jinja2/testsuite/bytecode_cache.py | 404 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.bytecode_cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test bytecode caching
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase, package_loader
from jinja2 import... |
Timmenem/micropython | refs/heads/master | tests/basics/bytearray_slice_assign.py | 21 | try:
bytearray()[:] = bytearray()
except TypeError:
print("SKIP")
raise SystemExit
# test slices; only 2 argument version supported by MicroPython at the moment
x = bytearray(range(10))
# Assignment
l = bytearray(x)
l[1:3] = bytearray([10, 20])
print(l)
l = bytearray(x)
l[1:3] = bytearray([10])
print(l)
l... |
libfann/fann | refs/heads/master | lib/googletest/googlemock/test/gmock_test_utils.py | 88 | # Copyright 2006, 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... |
MRigal/django | refs/heads/master | django/core/validators.py | 99 | from __future__ import unicode_literals
import re
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.ipv6 import is_valid_ipv6_address
from django.utils.six.moves.urllib.par... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/collection/rare_melee_grooved_2h_sword.py | 85615 | import sys
def setup(core, object):
return |
Jamlum/pytomo | refs/heads/master | pytomo/dns/namedict.py | 2 | # 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 ... |
named-data/ndn-tools | refs/heads/master | .waf-tools/default-compiler-flags.py | 4 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import platform
from waflib import Configure, Logs, Utils
def options(opt):
opt.add_option('--debug', '--with-debug', action='store_true', default=False,
help='Compile in debugging mode with minimal optimizations... |
ultrabug/mongo-python-driver | refs/heads/master | pymongo/database.py | 19 | # Copyright 2009-2015 MongoDB, 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 agreed to in writin... |
Arakmar/Sick-Beard | refs/heads/development | lib/hachoir_metadata/audio.py | 90 | from lib.hachoir_metadata.metadata import (registerExtractor,
Metadata, RootMetadata, MultipleMetadata)
from lib.hachoir_parser.audio import AuFile, MpegAudioFile, RealAudioFile, AiffFile, FlacParser
from lib.hachoir_parser.container import OggFile, RealMediaFile
from lib.hachoir_core.i18n import _
from lib.hachoir... |
kanakb/pyhelix | refs/heads/master | pyhelix/spectator.py | 1 | import json
import kazoo.client
import logging
import accessor
class SpectatorConnection(object):
"""
Helix spectator connection
This class encompasses all of a spectator's interactions with ZooKeeper.
"""
def __init__(self, cluster_id, zk_addrs):
"""
Initialize the connection pa... |
don-github/edx-platform | refs/heads/master | lms/djangoapps/courseware/models.py | 30 | """
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration courseware --auto description_of_your_change
3. Add the migration file created... |
ivant/Bokeh.jl | refs/heads/master | docs/pyxamples/colouring.py | 5 | import pandas as pd
from bokeh.plotting import *
from bokeh.sampledata import periodic_table
elements = periodic_table.elements
elements = elements[elements["atomic number"] <= 82]
elements = elements[~pd.isnull(elements["melting point"])]
mass = [float(x.strip("[]")) for x in elements["atomic mass"]]
elements["atomi... |
rfreiberger/Automate-the-Boring-Stuff | refs/heads/master | ch5/ticTacToe.py | 1 | theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': ' ',
'mid-L': ' ', 'mid-M': ' ', 'mid-R': ' ',
'low-L': ' ', 'low-M': ' ', 'low-R': ' '}
def printBoard(board):
print(board['top-L'] + '|' + board['top-M'] + '|' + board['top-R'])
print('-+-+-')
print(board['mid-L'] + '|' + board['mid-M... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.