repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
rosmo/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_virtual_server.py | 14 | #!/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',
... |
nkalodimas/invenio | refs/heads/master | modules/websubmit/lib/hocrlib.py | 33 | ## This file is part of Invenio.
## Copyright (C) 2010, 2011 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 later version.
##
... |
Wingless-Archangel/bokken | refs/heads/master | ui/strings_treeview.py | 1 | # strings_treeview.py
#
# Copyright 2015 Hugo Teso <hugo.teso@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lic... |
splodingsocks/iTerm2 | refs/heads/master | tools/ply/ply-3.4/test/lex_state2.py | 174 | # lex_state2.py
#
# Bad state declaration
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
states = ('comment','example')
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'
# Comments
def t_comment(t):
r'/\*'
t.lexer.be... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/localflavor/us/models.py | 196 | from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import CharField
from django.contrib.localflavor.us.us_states import STATE_CHOICES
from django.contrib.localflavor.us.us_states import USPS_CHOICES
class USStateField(CharField):
description = _("U.S. state (two uppercase letters... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/social/backends/mapmyfitness.py | 77 | """
MapMyFitness OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/mapmyfitness.html
"""
from social.backends.oauth import BaseOAuth2
class MapMyFitnessOAuth2(BaseOAuth2):
"""MapMyFitness OAuth authentication backend"""
name = 'mapmyfitness'
AUTHORIZATION_URL = 'https://www.mapmyfitn... |
alphagov/digitalmarketplace-api | refs/heads/dependabot/pip/digitalmarketplace-apiclient-22.2.0 | migrations/versions/500_add_briefs_table.py | 1 | """Add briefs table
Revision ID: 500
Revises: 490
Create Date: 2016-01-25 15:45:50.363821
"""
# revision identifiers, used by Alembic.
revision = '500'
down_revision = '490'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
op.create_table('briefs',
sa... |
scott-s-douglas/SWAPR | refs/heads/master | SWAPRhtmlOutput.py | 1 | import sys
#takes in information from the webparser. Insert arguments as a list, which should be: [question number, question, evaluator response, comments]
#*Make sure to use finish() to close out of the document*
class htmlOutput:
def __init__(self, labNumber):
self.file=open("./lab" + str(labNumber) + ".html" , "... |
tkremenek/swift | refs/heads/master | utils/split_file.py | 65 | #!/usr/bin/env python
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIB... |
hassanabidpk/django | refs/heads/master | tests/forms_tests/views.py | 452 | from django import forms
from django.views.generic.edit import UpdateView
from .models import Article
class ArticleForm(forms.ModelForm):
content = forms.CharField(strip=False, widget=forms.Textarea)
class Meta:
model = Article
fields = '__all__'
class ArticleFormView(UpdateView):
mode... |
miumok98/weblate | refs/heads/master | weblate/trans/checks/source.py | 11 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://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, eithe... |
pakkig/devwork | refs/heads/master | python/googledatastore/connection_test.py | 6 | #
# Copyright 2013 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... |
roadmapper/ansible | refs/heads/devel | test/units/module_utils/common/validation/test_check_type_raw.py | 83 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 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
from ansible.module_utils.common.validation import check_type_raw
def test_... |
rynomster/django | refs/heads/master | django/contrib/postgres/aggregates/general.py | 419 | from django.db.models.aggregates import Aggregate
__all__ = [
'ArrayAgg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'StringAgg',
]
class ArrayAgg(Aggregate):
function = 'ARRAY_AGG'
def convert_value(self, value, expression, connection, context):
if not value:
return []
return v... |
googleapis/python-bigtable | refs/heads/master | google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py | 1 | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
alexthered/kienhoc-platform | refs/heads/master | common/djangoapps/course_modes/tests/factories.py | 56 | from course_modes.models import CourseMode
from factory.django import DjangoModelFactory
from opaque_keys.edx.locations import SlashSeparatedCourseKey
# Factories are self documenting
# pylint: disable=missing-docstring
class CourseModeFactory(DjangoModelFactory):
class Meta(object):
model = CourseMode
... |
zhanghenry/stocks | refs/heads/master | django/contrib/postgres/__init__.py | 718 | default_app_config = 'django.contrib.postgres.apps.PostgresConfig'
|
mythmon/airmozilla | refs/heads/master | airmozilla/base/tests/test_helpers.py | 6 | from nose.tools import eq_
from django.test.client import RequestFactory
from airmozilla.base.tests.testbase import DjangoTestCase
from airmozilla.base.helpers import abs_static, show_duration
class TestAbsStaticHelpers(DjangoTestCase):
def tearDown(self):
super(TestAbsStaticHelpers, self).tearDown()
... |
reprapperMC/BeBlog | refs/heads/master | blog/migrations/0003_auto_20161129_0421.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-29 04:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20161129_0145'),
]
operations = [
migrations.RemoveField(... |
stadelmanma/netl-ap-map-flow | refs/heads/master | apmapflow/data_processing/__init__.py | 2 | """
================================================================================
Data Processing
================================================================================
| Data procesing classes for 2-D data maps.
| Written By: Matthew Stadelman
| Date Written: 2016/02/26
| Last Modifed: 2016/02/26
|
.. ... |
pelya/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/sunaudio.py | 286 | """Interpret sun audio headers."""
from warnings import warnpy3k
warnpy3k("the sunaudio module has been removed in Python 3.0; "
"use the sunau module instead", stacklevel=2)
del warnpy3k
MAGIC = '.snd'
class error(Exception):
pass
def get_long_be(s):
"""Convert a 4-char value to integer."""
r... |
openstack/watcher | refs/heads/master | watcher/tests/decision_engine/datasources/grafana_translators/test_influxdb.py | 2 | # -*- encoding: utf-8 -*-
# Copyright (c) 2019 European Organization for Nuclear Research (CERN)
#
# Authors: Corne Lukken <info@dantalion.nl>
#
# 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
... |
ligangty/indy | refs/heads/master | test/clients/repo-modder/repo_modder/__init__.py | 5 | #
# Copyright (C) 2011-2020 Red Hat, Inc. (https://github.com/Commonjava/indy)
#
# 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
#
# Unles... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | analytic_solution/test_cases/4NodeANDES/circular_plate_simply_support/side_length_02/compare_HDF5_Displacement_Output.py | 402 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
impredicative/pyskeleton | refs/heads/master | mypackage/util/humanfriendly.py | 1 | """humanfriendly utilities."""
import humanfriendly
def format_size(num_bytes: int) -> str:
"""Return the given number of bytes formatted as a human-readable size string.
Examples
--------
0 -> "0 bytes"
3221225472 -> "3,221,225,472 (3 GiB)"
"""
formatted_size = humanfriendly.fo... |
SM-G920P/Hacker_Kernel_SM-G92X | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
thedep2/CouchPotatoServer | refs/heads/develop | libs/bs4/dammit.py | 408 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... |
zdary/intellij-community | refs/heads/master | python/testData/refactoring/rename/overloadsAndImplementationInImportedClassRenameCall/before/a.py | 29 | from b import A
A().foo<caret>("5") |
nikhila05/microsocial | refs/heads/master | linkedin/examples/authentication.py | 3 | from linkedin.linkedin import (LinkedInAuthentication, LinkedInApplication,
PERMISSIONS)
API_KEY = 'your app key'
API_SECRET = 'your app secret'
RETURN_URL = 'your redirect uri'
authentication = LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL,
... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/tests/modjy/lib_python_folder/mock_framework/web/handlers/wsgi_handlers.py | 8 | # -*- coding: windows-1252 -*-
class WSGIHandlerClass:
def __init__(self):
self.counter = 0
def _response(self, start_response_callable, called):
start_response_callable("200 OK", [])
result = "%s counter = %d" % (called, self.counter)
self.counter += 1
retu... |
hotsyk/mailpost | refs/heads/master | mailpost/fnmatch.py | 1 | """
A package that maps incoming email to HTTP requests
Mailpost version 0.1
(C) 2010 oDesk www.oDesk.com
"""
"""
fnmatch.py - fork of original fnmatch
=====================================
.. _purpose:
Purpose of the fork
-----------------
Original fnmatch has an issue while matching escaped strings and not match
pa... |
paulfitz/phantomjs | refs/heads/master | src/qt/qtbase/util/local_database/xpathlite.py | 105 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License... |
hkemmel/tal | refs/heads/master | poller2.py | 1 | ##
## poller.py
##
## polling reviews from websites
##
## this version works with allocine
##
import time
import requests
import random
from pyquery import PyQuery
import math
from HTMLParser import HTMLParser
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.fed = []
def h... |
Archassault/archassaultweb | refs/heads/master | todolists/migrations/0007_auto__add_field_todolistpackage_removed.py | 2 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('todolists_todolistpackage', 'removed',
self.gf('django.db.models.fields.DateTimeField')(null=Tr... |
JohnLZeller/dd-agent | refs/heads/master | checks.d/jenkins.py | 1 | # stdlib
import os
import time
from collections import defaultdict
from datetime import datetime
from glob import glob
from xml.etree.ElementTree import ElementTree
# project
from util import get_hostname
from checks import AgentCheck
class Skip(Exception):
"""
Raised by :class:`Jenkins` when it comes across... |
elahejalalpour/ELRyu | refs/heads/master | ryu/cmd/rpc_cli.py | 8 | #!/usr/bin/env python
#
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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... |
wavesoft/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/api/light.py | 104 | from bpy import data, types
from .. import utilities, logger
def _lamp(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(name, types.Lamp):
lamp = name
... |
leafclick/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_1/_pkg0_1_1_1/_pkg0_1_1_1_0/_mod0_1_1_1_0_2.py | 30 | name0_1_1_1_0_2_0 = None
name0_1_1_1_0_2_1 = None
name0_1_1_1_0_2_2 = None
name0_1_1_1_0_2_3 = None
name0_1_1_1_0_2_4 = None |
2ndQuadrant/ansible | refs/heads/master | lib/ansible/modules/cloud/google/gcp_container_cluster_facts.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
infobloxopen/infoblox-netmri | refs/heads/master | infoblox_netmri/api/broker/v3_1_0/device_viewer_security_acls_grid_broker.py | 18 | from ..broker import Broker
class DeviceViewerSecurityAclsGridBroker(Broker):
controller = "device_viewer_security_acls_grids"
def index(self, **kwargs):
"""Lists the available device viewer security acls grids. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored.... |
alhashash/odoo | refs/heads/master | addons/project_timesheet/__openerp__.py | 7 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<https://www.odoo.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
epam-mooc/edx-platform | refs/heads/master | common/djangoapps/course_groups/views.py | 2 | from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_POST
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse, HttpRes... |
paulrouget/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/packages/rfc3986/misc.py | 47 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Rackspace
# 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... |
peterbarker/ardupilot | refs/heads/master | Tools/scripts/runfliptest.py | 19 | #!/usr/bin/env python
import pexpect, time, sys
from pymavlink import mavutil
def wait_heartbeat(mav, timeout=10):
'''wait for a heartbeat'''
start_time = time.time()
while time.time() < start_time+timeout:
if mav.recv_match(type='HEARTBEAT', blocking=True, timeout=0.5) is not None:
re... |
nbcesar/sabergrade | refs/heads/master | lib/python2.7/site-packages/werkzeug/testsuite/contrib/wrappers.py | 102 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.contrib.wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Added tests for the sessions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from werkzeug.testsuit... |
BrendanBerkley/django-report-builder | refs/heads/master | report_builder/tasks.py | 3 | from __future__ import absolute_import
from celery import shared_task
from .views import DownloadFileView
@shared_task
def report_builder_file_async_report_save(report_id, user_id, file_type):
view = DownloadFileView()
view.process_report(report_id, user_id, file_type, to_response=False)
|
cs-au-dk/Artemis | refs/heads/master | WebKit/Tools/Scripts/webkitpy/layout_tests/read_checksum_from_png_unittest.py | 16 | #!/usr/bin/env python
# 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this lis... |
jemekite/youtube-dl | refs/heads/master | youtube_dl/extractor/hypem.py | 128 | from __future__ import unicode_literals
import json
import time
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class HypemIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?hypem\.com/track/(?P<id>[^/]+)/... |
zapier/django-rest-hooks | refs/heads/master | rest_hooks/admin.py | 2 | from django.contrib import admin
from django.conf import settings
from django import forms
from rest_hooks.utils import get_hook_model
if getattr(settings, 'HOOK_EVENTS', None) is None:
raise Exception("You need to define settings.HOOK_EVENTS!")
HookModel = get_hook_model()
class HookForm(forms.ModelForm):
... |
bestvibes/neo4j-social-network | refs/heads/master | env/lib/python2.7/sre_constants.py | 349 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
svn2github/gyp | refs/heads/master | test/small/gyptest-small.py | 205 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Runs small tests.
"""
import imp
import os
import sys
import unittest
import TestGyp
test = TestGyp.TestGyp()
# Add pylib to the im... |
hexpl0it/plugin.video.genesi-ita | refs/heads/master | resources/lib/resolvers/sharerepo.py | 2 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 opt... |
mozilla/verbatim | refs/heads/master | vendor/lib/python/django/core/management/commands/makemessages.py | 80 | import fnmatch
import glob
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
from subprocess import PIPE, Popen
import django
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.text import get_text_list
from django.utils.jslex import prep... |
EraYaN/CouchPotatoServer | refs/heads/master | libs/pyutil/test/current/json_tests/test_decode.py | 106 | import decimal
from unittest import TestCase
from pyutil import jsonutil as json
class TestDecode(TestCase):
def test_decimal(self):
rval = json.loads('1.1', parse_float=decimal.Decimal)
self.assert_(isinstance(rval, decimal.Decimal))
self.assertEquals(rval, decimal.Decimal('1.1'))
de... |
MoKee/android_kernel_mediatek_sprout | refs/heads/mkm | Documentation/target/tcm_mod_builder.py | 2358 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
webgeodatavore/django | refs/heads/master | tests/auth_tests/urls_admin.py | 405 | """
Test URLs for auth admins.
"""
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.admin import GroupAdmin, UserAdmin
from django.contrib.auth.models import Group, User
from django.contrib.auth.urls import urlpatterns
# Create a silo'd admin site for just the user/group admi... |
nelsonsar/ansible | refs/heads/devel | test/units/vars/test_variable_manager.py | 39 | # (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... |
jborean93/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/module_utils/subpkg_with_init/__init__.py | 35 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
# exercise relative imports in package init; they behave differently
from .mod_in_subpkg_with_init import thingtocall as submod_thingtocall
from ..subpkg.submod import thingtocall as cousin_submod_thingtocall # pylint: disable=rel... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py | 2 | # 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 ... |
dkillick/iris | refs/heads/master | lib/iris/tests/integration/format_interop/test_name_grib.py | 5 | # (C) British Crown Copyright 2013 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... |
fcl-93/rootio_web | refs/heads/master | rootio/radio/aggregation_bot.py | 1 | # -*- coding: utf-8 -*-
from datetime import datetime
from .models import Bothasinfo
from ..extensions import db
from ..utils import getpage, parsepage
#Gets news from RTP Madeira.
#url (String) -> Url's RSS
# station (int) -> id of the station
# function (int) -> id of the function
def __getRTP_RSS(url,function,st... |
goofwear/Emby.Kodi | refs/heads/master | default.py | 1 | # -*- coding: utf-8 -*-
import xbmcaddon, xbmc
import os, sys
import urlparse
addon_ = xbmcaddon.Addon(id='plugin.video.emby')
addon_path = addon_.getAddonInfo('path').decode('utf-8')
base_resource_path = xbmc.translatePath(os.path.join(addon_path, 'resources', 'lib')).decode('utf-8')
sys.path.append(base_resource_pat... |
jurg/RATDecoders | refs/heads/master | ShadowTech.py | 8 | #!/usr/bin/env python
'''
ShadowTech Rat Config Decoder
'''
__description__ = 'ShadowTech Rat Config Extractor'
__author__ = 'Kevin Breen http://techanarchy.net http://malwareconfig.com'
__version__ = '0.1'
__date__ = '2014/08/23'
#Standard Imports Go Here
import os
import sys
import string
from optparse import Optio... |
ViaSat/luigi | refs/heads/master | luigi/execution_summary.py | 10 | # -*- coding: utf-8 -*-
#
# Copyright 2015-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... |
UniqueDroid/lge-kernel-x3-p880 | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
JerzySpendel/python-social-auth | refs/heads/master | social/backends/digitalocean.py | 54 | from social.backends.oauth import BaseOAuth2
class DigitalOceanOAuth(BaseOAuth2):
"""
DigitalOcean OAuth authentication backend.
Docs: https://developers.digitalocean.com/documentation/oauth/
"""
name = 'digitalocean'
AUTHORIZATION_URL = 'https://cloud.digitalocean.com/v1/oauth/authorize'
... |
stianrh/askbot-nordic | refs/heads/master | askbot/migrations/0146_auto__add_field_threadtogroup_visibility.py | 15 | # -*- 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 field 'ThreadToGroup.visibility'
db.add_column('askbot_thread_groups', 'visibility',
... |
takeshineshiro/django | refs/heads/master | tests/migrations/test_migrations_squashed/0001_squashed_0002.py | 282 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [
("migrations", "0001_initial"),
("migrations", "0002_second"),
]
operations = [
migrations.CreateModel(
"Auth... |
zetaops/ulakbus | refs/heads/develop | ulakbus/fixtures/generate_abstract_role.py | 3 | # -*- coding: utf-8 -*-
"""
"""
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
__author__ = 'Ali Riza Keles'
bolum_roller = ['bolum baskani', 'bolum kurulu baskani', 'bolum kurulu uyesi']
ana_bilim_dali_roller = ['ana bili... |
timvideos/flumotion | refs/heads/master | flumotion/twisted/defer.py | 1 | # -*- Mode: Python; test-case-name: flumotion.test.test_defer -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified unde... |
joel-a-eriksson/MAS | refs/heads/master | cherrypy/lib/caching.py | 57 | """
CherryPy implements a simple caching system as a pluggable Tool. This tool
tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there
yet, but it's probably good enough for most sites.
In general, GET responses are cached (along with selecting headers) and, if
another request arrives for the same r... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
blr246/noweats | refs/heads/master | noweats/__init__.py | 1 | """
The NowEats application scrapes Twitter for what people are eating now.
"""
import analysis
import collection
import extraction
|
pipermerriam/web3.py | refs/heads/master | tests/generate_go_ethereum_fixture.py | 1 | import contextlib
import json
import os
import pprint
import shutil
import signal
import socket
import subprocess
import sys
import time
import tempfile
from cytoolz import merge
from eth_utils import (
to_wei,
remove_0x_prefix,
is_dict,
is_checksum_address,
is_same_address,
force_text,
)
fro... |
thaim/ansible | refs/heads/fix-broken-link | test/units/modules/network/f5/test_bigip_sys_daemon_log_tmm.py | 22 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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
import os
import json
import pytest
import sys
if sys.version_info < (2... |
skycucumber/restful | refs/heads/master | python/venv/lib/python2.7/site-packages/pymongo/cursor.py | 2 | # 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... |
xcomponent/ReactiveXComponent.py | refs/heads/master | reactivexcomponent/reactivexcomponent/communication/publisher.py | 1 | import json
from reactivexcomponent.configuration.serializer import to_websocket_input_format
from reactivexcomponent.configuration.api_configuration import format_fsharp_field
class Publisher:
def __init__(self, apiconfiguration, websocket_instance):
self.configuration = apiconfiguration
self.we... |
blueyi/shadowsocks | refs/heads/master | shadowsocks/common.py | 57 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# 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 u... |
jpic/ansible-modules-extras | refs/heads/devel | monitoring/pagerduty.py | 28 | #!/usr/bin/python
DOCUMENTATION = '''
module: pagerduty
short_description: Create PagerDuty maintenance windows
description:
- This module will let you create PagerDuty maintenance windows
version_added: "1.2"
author: Justin Johns
requirements:
- PagerDuty API access
options:
state:
description:
... |
opendatakosovo/vitia-workshop-viz | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/depends.py | 410 | from __future__ import generators
import sys, imp, marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion, LooseVersion
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... |
pbryzek/Freedom | refs/heads/master | sf_bridge.py | 1 | from simple_salesforce import Salesforce
from objects.obj_home import HomeObj
from common.globals import handle_err_msg
import sys
class SFBridge(object):
_instance = None
instance_domain = "na30.salesforce.com"
username = "tony@lightningproperties.com"
password = "Januszbarbara$5"
token = "6PS... |
dNG-git/pas_http_user | refs/heads/master | src/dNG/plugins/tasks/pas_http_user.py | 1 | # -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;http;user
This Source Code Form is subject to the terms of the Mozilla Public Licens... |
piyushroshan/xen-4.3.2 | refs/heads/master | tools/python/xen/remus/vdi.py | 43 | #code to play with vdis and snapshots
import os
def run(cmd):
fd = os.popen(cmd)
res = [l for l in fd if l.rstrip()]
return not fd.close(), res
_blockstore = '/blockstore.dat'
def set_blockstore(blockstore):
global _blockstore
__blockstore = blockstore
class SnapShot:
def __init__(self, v... |
mozman/ezdxf | refs/heads/master | integration_tests/test_write_fixed_meta_data.py | 1 | # Copyright (c) 2021, Manfred Moitzi
# License: MIT License
import pytest
from io import StringIO
from time import sleep
import ezdxf
def doc2str(doc):
stream = StringIO()
doc.write(stream)
return stream.getvalue()
@pytest.mark.parametrize("version", ["R12", "R2000", "R2018"])
def test_fixed_meta_dat... |
rocky/python-uncompyle6 | refs/heads/master | uncompyle6/scanners/scanner38.py | 1 | # Copyright (c) 2019-2020 by Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is... |
arthru/OpenUpgrade | refs/heads/master | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py | 386 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
TylerLubeck/pyres | refs/heads/master | tests/test_resq.py | 4 | from tests import PyResTests, Basic, TestProcess
from pyres import ResQ
from pyres.worker import Worker
from pyres.job import Job
import os
class ResQTests(PyResTests):
def test_enqueue(self):
self.resq.enqueue(Basic,"test1")
self.resq.enqueue(Basic,"test2", "moretest2args")
ResQ._enqueue(Ba... |
mwmuni/LIGGGHTS_GUI | refs/heads/master | OpenGL/raw/GLX/NV/video_capture.py | 8 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
import ctype... |
TeamExodus/external_chromium_org | refs/heads/EXODUS-5.1 | tools/deep_memory_profiler/subcommands/policies.py | 64 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import json
import logging
import sys
from lib.pageframe import PFNCounts
from lib.policy import PolicySet
from lib.subcommand import SubCom... |
lisong521/wireshark | refs/heads/master | tools/dftestlib/time_relative.py | 40 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Th... |
dragondjf/QSetuper | refs/heads/master | 7z_rcc.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import os
import sys
import time
import ConfigParser
import xml.dom.minidom as Dom
class XMLGenerator(object):
def __init__(self, xml_name=None):
self.doc = Dom.Document()
self.xml_name = xml_name
def createNode(self, node_name)... |
axelbellec/chronos | refs/heads/master | manage.py | 1 | import click
from flask_script import Manager, Shell
from app import app
from app import NAMESPACE
def make_shell_context():
return dict(app=app)
manager = Manager(app)
manager.add_command('shell', Shell(make_context=make_shell_context))
@manager.command
def runserver():
""" Run webserver. """
app.run(... |
igraph/xdata-igraph | refs/heads/develop | tools/removeexamples.py | 5 | #! /usr/bin/env python
import sys
from xml.etree.ElementTree import ElementTree
def usage():
print sys.argv[0], "<infile> <outfile>"
def main():
if len(sys.argv) != 3:
usage()
sys.exit(2)
# Read in
tree=ElementTree()
tree.parse(sys.argv[1])
# Remove examples
exam... |
FHannes/intellij-community | refs/heads/master | python/helpers/pydev/_pydevd_bundle/pydevd_constants.py | 3 | '''
This module holds the constants used for specifying the states of the debugger.
'''
from __future__ import nested_scopes
STATE_RUN = 1
STATE_SUSPEND = 2
PYTHON_SUSPEND = 1
DJANGO_SUSPEND = 2
JINJA2_SUSPEND = 3
try:
__setFalse = False
except:
import __builtin__
setattr(__builtin__, 'True', 1)
set... |
trigrass2/bosun | refs/heads/master | plugins/utils.py | 54 | #!/usr/bin/python
# This file is part of tcollector.
# Copyright (C) 2013 The tcollector Authors.
#
# This program 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 (a... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/django/db/backends/sqlite3/operations.py | 49 | from __future__ import unicode_literals
import datetime
import uuid
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import utils
from django.db.backends import utils as backend_utils
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.mode... |
smmribeiro/intellij-community | refs/heads/master | python/testData/intentions/paramTypeInEmptyNumpyDocString.py | 106 | def f(<caret>x, y):
"""""" |
val314159/kx | refs/heads/master | example3_a.py | 1 | from networks import fine_tune
fine_tune()
|
Pointedstick/ReplicatorG | refs/heads/master | skein_engines/skeinforge-31/fabmetheus_utilities/geometry/statements/elif.py | 8 | """
Polygon path.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.geometry_utilities import evaluate
__author__... |
MyRookie/SentimentAnalyse | refs/heads/master | src/DB_Connection.py | 1 | from pymongo import MongoClient
client = MongoClient('mongodb://localhost:27017/')
db = client.fb
for a in db.feedbacks.find():
print a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.