repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
emilio/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/h2/examples/twisted/twisted-server.py | 25 | # -*- coding: utf-8 -*-
"""
twisted-server.py
~~~~~~~~~~~~~~~~~
A fully-functional HTTP/2 server written for Twisted.
"""
import functools
import mimetypes
import os
import os.path
import sys
from OpenSSL import crypto
from twisted.internet.defer import Deferred, inlineCallbacks
from twisted.internet.protocol import ... |
liresearchgroup/submtr | refs/heads/master | submtr/lib/requests/packages/chardet/mbcssm.py | 982 | ######################## 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... |
mvaled/sentry | refs/heads/master | src/sentry/attachments/redis.py | 1 | from __future__ import absolute_import
import logging
from django.conf import settings
from sentry.cache.redis import RedisClusterCache, RbCache
from .base import BaseAttachmentCache
logger = logging.getLogger(__name__)
class RedisClusterAttachmentCache(BaseAttachmentCache):
def __init__(self, **options):
... |
agrista/odoo-saas | refs/heads/master | addons/website_hr/models/hr.py | 306 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class hr(osv.osv):
_inherit = 'hr.employee'
_columns = {
'website_published': fields.boolean('Available in the website', copy=False),
'public_info': fields.text('Public Info'),
}
_defaults = {
'website_published': Fal... |
hehongliang/tensorflow | refs/heads/master | tensorflow/python/autograph/converters/lists_test.py | 11 | # 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... |
kidaa/MoonGen | refs/heads/master | deps/dpdk/app/test/autotest.py | 17 | #!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 sourc... |
DirtyPiece/dancestudio | refs/heads/master | Build/Tools/Python27/Lib/sre_constants.py | 185 | #
# 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... |
lokirius/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/idlelib/TreeWidget.py | 55 | # XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - key bindings (instead of quick-n-dirty bindings on Canvas):
# - up/down arrow keys to move focus around
# - ditto for page up/down, home/end
# - left/right arrows to expand/collapse & move out/in
# - more doc strings
# - add icons for "file", ... |
devops2014/djangosite | refs/heads/master | tests/select_related_regress/tests.py | 206 | from __future__ import unicode_literals
from django.test import TestCase
from django.utils import six
from .models import (
A, B, C, Building, Chick, Child, Class, Client, ClientStatus, Connection,
Country, Device, Enrollment, Hen, Item, Organizer, Person, Port,
SpecialClient, State, Student, TUser,
)
c... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_vpn_ssl_web_host_check_software.py | 14 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
saurabh6790/frappe | refs/heads/develop | frappe/tests/test_rate_limiter.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import unittest
from werkzeug.wrappers import Response
import time
import frappe
import frappe.rate_limiter
from frappe.rate_limiter import RateLimiter... |
heroku/hc-shop | refs/heads/master | hcshop/settings.py | 1 | from __future__ import absolute_import, unicode_literals
import os
import dj_database_url
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.shop.defaults
# with default values, but are common enough to be put here, commented
# out, for conv... |
paul-xxx/micropython | refs/heads/master | tests/bytecode/mp-tests/class3.py | 22 | class A:
def f(x):
return x
def g(y):
def h(z):
return x + y + z
h(y)
A()
A.f(1)
A.g(2)(3)
|
dnlm92/chokoretto | refs/heads/master | temp/venv/lib/python2.7/site-packages/unidecode/x050.py | 252 | data = (
'Chang ', # 0x00
'Chi ', # 0x01
'Bing ', # 0x02
'Zan ', # 0x03
'Yao ', # 0x04
'Cui ', # 0x05
'Lia ', # 0x06
'Wan ', # 0x07
'Lai ', # 0x08
'Cang ', # 0x09
'Zong ', # 0x0a
'Ge ', # 0x0b
'Guan ', # 0x0c
'Bei ', # 0x0d
'Tian ', # 0x0e
'Shu ', # 0x0f
'Shu ', # 0x10... |
xbmc/atv2 | refs/heads/atv2 | xbmc/lib/libPython/Python/Lib/encodings/unicode_escape.py | 15 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is inte... |
bdh1011/cupeye | refs/heads/master | venv/lib/python2.7/site-packages/passlib/handlers/sha1_crypt.py | 19 | """passlib.handlers.sha1_crypt
"""
#=============================================================================
# imports
#=============================================================================
# core
from hmac import new as hmac
from hashlib import sha1
import re
import logging; log = logging.getLogger(__na... |
juanifioren/django-oidc-provider | refs/heads/master | oidc_provider/lib/claims.py | 2 | import copy
from django.utils.translation import ugettext_lazy as _
from oidc_provider import settings
STANDARD_CLAIMS = {
'name': '',
'given_name': '',
'family_name': '',
'middle_name': '',
'nickname': '',
'preferred_username': '',
'profile': '',
'picture': '',
'website': '',
... |
leifwalsh/offlineimap | refs/heads/master | offlineimap/repository/Gmail.py | 11 | # Gmail IMAP repository support
# Copyright (C) 2008 Riccardo Murri <riccardo.murri@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 License, or
# ... |
DarthMaulware/EquationGroupLeaks | refs/heads/master | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/status/cmd/uptime/tasking.py | 30 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: tasking.py
import mcl_platform.tasking
from tasking_dsz import *
_fw = mcl_platform.tasking.GetFramework()
if _fw == 'dsz':
RPC_INFO_QUERY = dsz.... |
yourilima/fabric-bolt | refs/heads/master | src/fabric_bolt/projects/migrations/0015_auto__add_field_configuration_prompt_me_for_input.py | 18 | # -*- 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 'Configuration.prompt_me_for_input'
db.add_column(u'projects_configuration', 'prompt_me_for_i... |
rolandmansilla/microblog | refs/heads/master | flask/lib/python2.7/site-packages/pkg_resources/__init__.py | 10 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
gcode-mirror/audacity | refs/heads/master | lib-src/lv2/sratom/waflib/Tools/c.py | 329 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import TaskGen,Task,Utils
from waflib.Tools import c_preproc
from waflib.Tools.ccroot import link_task,stlink_task
@TaskGen.extension('.c')
def c_hook(self,node):
... |
TribusGNULinux/tribus | refs/heads/development | tribus/__init__.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Tribus Developers
#
# This file is part of Tribus.
#
# Tribus 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 L... |
lowRISC/edalize | refs/heads/master | edalize/spyglass.py | 1 | import logging
import re
from collections import OrderedDict
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Spyglass(Edatool):
_description = """ Synopsys (formerly Atrenta) Spyglass Backend
Spyglass performs static source code analysis on HDL code and checks for common
coding e... |
unknownlamer/xbmc | refs/heads/master | tools/EventClients/lib/python/zeroconf.py | 181 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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 opti... |
grea09/pancake | refs/heads/master | .pancake/filters/crossref.py | 1 | from panflute import run_filter, Cite, Citation, Space, Str, RawInline, Para
from utils.latex import latex_command
def prefixes(meta):
result = {}
for _, element in meta.items():
if 'ref' in element:
result[element['ref']] = element
return result
def render(meta, citations, conjunct... |
kanteshraj/ansible | refs/heads/devel | lib/ansible/plugins/connection/jail.py | 19 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it... |
RobertoMalatesta/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/updatestatus.py | 121 | # Copyright (C) 2013 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... |
sumonchai/tough | refs/heads/master | toughradius/manage/api/v1/api_authorize.py | 2 | #!/usr/bin/env python
#coding=utf-8
from toughlib import utils, apiutils
from toughlib.permit import permit
from toughradius.manage.api.apibase import ApiHandler
from toughradius.manage import models
from toughradius.manage.radius.radius_authorize import RadiusAuth
@permit.route(r"/api/v1/authorize")
class AuthorizeH... |
actmd/selenium | refs/heads/master | py/test/selenium/webdriver/firefox/ff_select_support_class_tests.py | 63 | # 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... |
hackultura/django-localidade | refs/heads/master | localidades/models.py | 14224 | # -*- coding: utf-8 -*-
|
google/clusterfuzz | refs/heads/master | src/python/bot/untrusted_runner/tasks_host.py | 1 | # Copyright 2019 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 agreed to in writing, ... |
BonexGu/Blik2D-SDK | refs/heads/master | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/python/ops/logging_ops.py | 64 | # 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... |
bartoldeman/easybuild-framework | refs/heads/master | easybuild/toolchains/gmvapich2.py | 1 | ##
# Copyright 2012-2018 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
janpipek/boadata | refs/heads/master | boadata/data/pandas_types.py | 1 | import types
from typing import List, Optional, Iterable
import numpy as np
import pandas as pd
import sqlalchemy as sa
from boadata.core import DataObject
from boadata.core.data_conversion import DataConversion, MethodConversion
from .. import wrap
from .mixins import (
AsArrayMixin,
CopyableMixin,
GetI... |
intgr/django | refs/heads/master | tests/m2m_signals/models.py | 106 | from django.db import models
class Part(models.Model):
name = models.CharField(max_length=20)
class Meta:
ordering = ('name',)
def __str__(self):
return self.name
class Car(models.Model):
name = models.CharField(max_length=20)
default_parts = models.ManyToManyField(Part)
op... |
alash3al/rethinkdb | refs/heads/next | external/v8_3.30.33.16/tools/push-to-trunk/auto_roll.py | 40 | #!/usr/bin/env python
# Copyright 2014 the V8 project 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 argparse
import json
import os
import sys
import urllib
from common_includes import *
import chromium_roll
class CheckActiv... |
CRImier/WCS | refs/heads/master | apps/example_apps/menu_dynupdate_test/main.py | 2 | menu_name = "Menu dynamic update testing"
from ui import Menu
#Some globals for us
i = None #Input device
o = None #Output device
counter1 = 0
counter2 = 20
def counter_change(cnum, amount):
global counter1, counter2
if cnum == 1:
counter1 += amount
else:
counter2 += amount
if c... |
fzimmermann89/pyload | refs/heads/stable | module/HookManager.py | 35 | # -*- coding: utf-8 -*-
"""
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 distributed in... |
shreyasp/erpnext | refs/heads/develop | erpnext/manufacturing/doctype/operation/operation.py | 55 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class Operation(Document):
def validate(self):
if not self.description:
self.description = se... |
geometalab/Vector-Tiles-Reader-QGIS-Plugin | refs/heads/dev-qgis3 | plugin/util/network_helper.py | 1 | # from time import sleep
from typing import Callable, List, Optional, Tuple
# from PyQt5.QtCore import QRunnable, QThreadPool, QUrl
from PyQt5.QtCore import QUrl
from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest
from PyQt5.QtWidgets import QApplication
from qgis.core import QgsNetworkAccessManager
from .log_... |
clovett/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/core/code_generators/generate_umath.py | 53 | import os
import re
import struct
import sys
import textwrap
sys.path.insert(0, os.path.dirname(__file__))
import ufunc_docstrings as docstrings
sys.path.pop(0)
Zero = "NpyUFunc_Zero"
One = "NpyUFunc_One"
None_ = "NpyUFunc_None"
#
# NOTE: This code generator is used in both the CPython AND .NET interface layers. To
... |
pearpai/TensorFlow-action | refs/heads/master | action/demo1/test_captcha.py | 1 | import glob
import do_captcha
PATH = "/Users/wuyunfeng/Documents/machine_learn/TensorFlow-action/data/captcha/ZZIY-T201704209584200219.jpeg"
path = "/Users/wuyunfeng/Documents/machine_learn/TensorFlow-action/data/captcha/*.jpeg"
# do_captcha.predict_single(PATH)
# print glob.glob(path)
do_captcha.predict(glob.glo... |
goFrendiAsgard/kokoropy | refs/heads/master | kokoropy/scaffolding/scaffold_main_controller.py | 1 | from kokoropy import Autoroute_Controller, load_view, base_url, request
class Index_Controller(Autoroute_Controller):
def action_index(self):
url_list = {
# g_url_pairs
}
return load_view('g_application_name', 'index', url_list = url_list) |
mapr/hue | refs/heads/hue-3.9.0-mapr | desktop/core/ext-py/Django-1.6.10/django/contrib/messages/context_processors.py | 628 | from django.contrib.messages.api import get_messages
def messages(request):
"""
Returns a lazy 'messages' context variable.
"""
return {'messages': get_messages(request)}
|
jkarnows/scikit-learn | refs/heads/master | sklearn/neighbors/tests/test_approximate.py | 142 | """
Testing for the approximate neighbor search using
Locality Sensitive Hashing Forest module
(sklearn.neighbors.LSHForest).
"""
# Author: Maheshakya Wijewardena, Joel Nothman
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_a... |
cchurch/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/_nxos_switchport.py | 87 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
'supported_by': 'network'}
from ansible.module_utils.common.removed... |
joebowen/movement_validation_cloud | refs/heads/master | djangodev/lib/python2.7/site-packages/django/contrib/messages/tests/base.py | 63 | from unittest import skipUnless
from django import http
from django.apps import apps
from django.conf import global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
fro... |
w495/scrapy | refs/heads/master | scrapy/contrib/linkextractors/lxmlhtml.py | 144 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.contrib.linkextractors.lxmlhtml` is deprecated, "
"use `scrapy.linkextractors.lxmlhtml` instead",
ScrapyDeprecationWarning, stacklevel=2)
from scrapy.linkextractors.lxmlhtml import *
|
ClaudiaSaxer/PlasoScaffolder | refs/heads/master | src/tests/fake/fake_sqlite_plugin_helper.py | 1 | # -*- coding: utf-8 -*-
# this default value is just for testing in a fake.
# pylint: disable=dangerous-default-value
"""Fake Module containing helper functions for the SQLite plugin"""
from plasoscaffolder.bll.services import base_sqlite_plugin_helper
from plasoscaffolder.bll.services import base_sqlite_plugin_path_he... |
shujaatak/UAV_MissionPlanner | refs/heads/master | Lib/site-packages/numpy/distutils/tests/test_misc_util.py | 51 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
from numpy.testing import *
from numpy.distutils.misc_util import appendpath, minrelpath, gpaths, rel_path
from os.path import join, sep, dirname
ajoin = lambda *paths: join(*((sep,)+paths))
class TestAppendpath(Test... |
OpenWinCon/OpenWinNet | refs/heads/master | web-gui/myvenv/lib/python3.4/site-packages/django/contrib/gis/admin/widgets.py | 449 | import logging
from django.contrib.gis.gdal import GDALException
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.forms.widgets import Textarea
from django.template import loader
from django.utils import six, translation
# Creating a template context that contains Django settings
# values n... |
SebKuzminsky/linuxcnc-mirror | refs/heads/master | tests/motion-logger/startup-gcode-abort/test-ui.py | 7 | #!/usr/bin/env python
import linuxcnc
import sys
#
# connect to LinuxCNC
#
c = linuxcnc.command()
s = linuxcnc.stat()
e = linuxcnc.error_channel()
#
# Immediately abort! Github Issue #49
#
print "UI abort"
sys.stdout.flush()
c.abort()
c.wait_complete()
print "UI done with abort"
sys.stdout.flush()
|
acdh-oeaw/totetiroler | refs/heads/master | account/models.py | 10644 | from django.db import models
# Create your models here.
|
krikru/tensorflow-opencl | refs/heads/master | tensorflow/python/framework/tensor_util_test.py | 29 | # 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... |
yeraydiazdiaz/nonrel-blog | refs/heads/master | django/core/mail/backends/dummy.py | 634 | """
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(email_messages)
|
danmcp/origin | refs/heads/master | vendor/k8s.io/kubernetes/hack/boilerplate/boilerplate_test.py | 630 | #!/usr/bin/env python
# Copyright 2016 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... |
yd0str/infernal-twin | refs/heads/master | build/pip/pip/_vendor/html5lib/tokenizer.py | 1710 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... |
suncycheng/intellij-community | refs/heads/master | python/testData/breadcrumbs/for.py | 31 | for i in range(10):
print <caret>i |
eyedeeemm/nitrogen | refs/heads/master | win/tests/font_test.py | 1 | #!/usr/bin/env python3
import io, random
from sys import exit
from pywin import Win
from pycolors import Colors
def main ():
digs = 7
font_n = 10
font_w = 32
font_h = 32
font_p = []
bg_color = Colors.black
f_in = io.open ('data/font.bgra', 'rb')
for i in range (font_n):
font... |
mohamed--abdel-maksoud/chromium.src | refs/heads/nw12 | tools/telemetry/third_party/pyserial/serial/tools/list_ports_windows.py | 117 | import ctypes
import re
def ValidHandle(value, func, arguments):
if value == 0:
raise ctypes.WinError()
return value
import serial
from serial.win32 import ULONG_PTR, is_64bit
from ctypes.wintypes import HANDLE
from ctypes.wintypes import BOOL
from ctypes.wintypes import HWND
from ctypes.wintypes impo... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/scatterpolargl/_hovertext.py | 1 | import _plotly_utils.basevalidators
class HovertextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="hovertext", parent_name="scatterpolargl", **kwargs):
super(HovertextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... |
eduNEXT/edunext-platform | refs/heads/master | lms/djangoapps/courseware/migrations/0007_remove_done_index.py | 5 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-29 15:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courseware', '0006_remove_module_id_index'),
]
operations = [
migrations.AlterField(
model_name='stud... |
kmuehlbauer/wradlib | refs/heads/master | wradlib/tests/test_vpr.py | 2 | #!/usr/bin/env python
# Copyright (c) 2011-2018, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
import unittest
import wradlib.vpr as vpr
import wradlib.georef as georef
import numpy as np
class VPRHelperFunctionsTest(unittest.TestCase):
def setUp(self):
self.sit... |
neharejanjeva/techstitution | refs/heads/master | app/logs/venv/lib/python2.7/site-packages/pip/_vendor/packaging/_compat.py | 1177 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3... |
vperron/django-storages | refs/heads/master | examples/s3project/tests.py | 33 | """
=================
Django S3 storage
=================
Usage
=====
Settings
--------
``DEFAULT_FILE_STORAGE``
~~~~~~~~~~~~~~~~~~~~~~~~
This setting store the path to the S3 storage class, the first part correspond
to the filepath and the second the name of the class, if you've got
``example.com`` in your ``PYTHO... |
nazo/ansible | refs/heads/devel | test/units/modules/network/eos/eos_module.py | 41 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
ankanaan/chimera | refs/heads/master | src/chimera/controllers/__init__.py | 15 | #! /usr/bin/python
# -*- coding: iso8859-1 -*-
# chimera - observatory automation system
# Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br>
# 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 Softwa... |
allanlewis/behave | refs/heads/master | test/test_userdata.py | 12 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from behave.configuration import Configuration
from behave.userdata import UserData, parse_user_define
from behave._types import Unknown
from unittest import TestCase
from nose.tools import eq_
class TestParseUserDefine(TestCase):
"""Test parse_user_... |
laperry1/android_external_chromium_org | refs/heads/cm-12.1 | build/android/gyp/apk_install.py | 49 | #!/usr/bin/env python
#
# 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.
"""Installs an APK.
"""
import optparse
import os
import re
import sys
from util import build_device
from util import build_utils
... |
Jobava/zamboni | refs/heads/master | mkt/files/views.py | 6 | from urlparse import urljoin
from django import http, shortcuts
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http ... |
sergeimoiseev/egrixcalc | refs/heads/master | app_old.py | 2 | # -*- coding: utf-8 -*-
import flask, flask.views
import egrix_calc
import calc_tools as ct
import logging
import transliterate
# transliterate.translit(u"Лорем ипсум долор сит амет", 'ru', reversed=True)
def tr(string):
return transliterate.translit(string,'ru',reversed=True)
logger = logging.getLogger(__name__)... |
julianwang/cinder | refs/heads/master | cinder/tests/unit/api/contrib/test_volume_image_metadata.py | 3 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
blueboxgroup/neutron | refs/heads/master | neutron/plugins/sriovnicagent/sriov_nic_agent.py | 1 | # Copyright 2014 Mellanox Technologies, Ltd
#
# 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 t... |
dmazzella/micropython | refs/heads/master | tests/import/pkg2/mod1.py | 118 | from pkg2 import mod2
|
ging/horizon | refs/heads/master | openstack_dashboard/dashboards/identity/domains/panel.py | 45 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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... |
pythonvietnam/scikit-learn | refs/heads/master | sklearn/utils/tests/test_estimator_checks.py | 202 | import scipy.sparse as sp
import numpy as np
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.testing import assert_raises_regex, assert_true
from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils.... |
jeremiah-c-leary/vhdl-style-guide | refs/heads/master | vsg/rules/process/rule_022.py | 1 |
from vsg.rules import blank_line_below_line_ending_with_token
from vsg import token
lTokens = []
lTokens.append(token.process_statement.begin_keyword)
class rule_022(blank_line_below_line_ending_with_token):
'''
Checks for a blank line below the begin keyword.
'''
def __init__(self):
blank... |
ArianaGashi/Techstitution | refs/heads/master | venv/lib/python2.7/site-packages/pip/compat/dictconfig.py | 921 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... |
djkonro/client-python | refs/heads/master | kubernetes/client/models/apps_v1beta1_deployment_status.py | 2 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
xen0l/ansible | refs/heads/devel | lib/ansible/modules/remote_management/manageiq/manageiq_alert_profiles.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat 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',
... |
fichter/grpc | refs/heads/master | src/python/grpcio/grpc/framework/core/_termination.py | 4 | # Copyright 2015, 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... |
jymannob/CouchPotatoServer | refs/heads/develop | libs/minify/cssmin.py | 66 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# `cssmin.py` - A Python port of the YUI CSS compressor.
from StringIO import StringIO # The pure-Python StringIO supports unicode.
import re
__version__ = '0.1.1'
def remove_comments(css):
"""Remove all CSS comment blocks."""
iemac = False
preserve = Fa... |
mm112287/2015cda_g8_0421 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testmagicmethods.py | 737 | import unittest
import inspect
import sys
from unittest.mock import Mock, MagicMock, _magics
class TestMockingMagicMethods(unittest.TestCase):
def test_deleting_magic_methods(self):
mock = Mock()
self.assertFalse(hasattr(mock, '__getitem__'))
mock.__getitem__ = Mock()
self.asser... |
CSB-IG/breast_cancer_networks | refs/heads/master | scripts_toolbox/microarray_colapser.py | 3 | # This script helps to collapse the archives of microarray expression
# It is required that the first and second colunma are the Gene Symbol and the statistical b consecutively ("loads" in our case)
# It runs like any Python script:
# $ python microarray_colapser.py path/to/the/exp_matrix_file.txt
# output in this exam... |
arximboldi/pigeoncide | refs/heads/master | src/core/panda_controller.py | 1 | #
# Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce
#
# This file is part of Pigeoncide.
#
# Pigeoncide is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# Lic... |
t11e/django | refs/heads/master | tests/regressiontests/makemessages/tests.py | 1 | import os
import re
from subprocess import Popen, PIPE
def find_command(cmd, path=None, pathext=None):
if path is None:
path = os.environ.get('PATH', []).split(os.pathsep)
if isinstance(path, basestring):
path = [path]
# check if there are funny path extensions for executables, e.g. Windows... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/ssl_.py | 156 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import ssl
import warnings
try: # Test for SSL features
from ssl import wrap_socket, CERT_NONE, ... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/urlpatterns/path_base64_urls.py | 68 | from django.urls import include, path, register_converter
from . import converters, views
register_converter(converters.Base64Converter, 'base64')
subsubpatterns = [
path('<base64:last_value>/', views.empty_view, name='subsubpattern-base64'),
]
subpatterns = [
path('<base64:value>/', views.empty_view, name=... |
wphicks/Writing3D | refs/heads/master | samples/normal_rotations.py | 1 | #!/usr/bin/env blender
# Copyright (C) 2016 William Hicks
#
# This file is part of Writing3D.
#
# Writing3D 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... |
int19h/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/isapi/samples/redirector.py | 7 | # This is a sample ISAPI extension written in Python.
#
# Please see README.txt in this directory, and specifically the
# information about the "loader" DLL - installing this sample will create
# "_redirector.dll" in the current directory. The readme explains this.
# Executing this script (or any server config script... |
webostin/django-btc | refs/heads/master | tests/context_processors/urls.py | 34 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^request_attrs/$', views.request_processor),
url(r'^debug/$', views.debug_processor),
]
|
kishikawakatsumi/Mozc-for-iOS | refs/heads/master | src/third_party/gyp/pylib/gyp/simple_copy.py | 1869 | # Copyright 2014 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.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... |
scottbarstow/iris-python | refs/heads/master | iris_sdk/models/data/line_option_order_response.py | 2 | #!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData, BaseResourceList
from iris_sdk.models.maps.line_option_order_response import LineOptionOrderResponseMap
from iris_sdk.models.data.line_options import LineOptionsData
class LineOptionOrderResponseData(LineOptionOrderResponseMap, BaseData):
... |
erjohnso/ansible | refs/heads/devel | lib/ansible/plugins/shell/fish.py | 69 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
graingert/redshift_sqlalchemy | refs/heads/master | tests/test_dialect_types.py | 2 | import sqlalchemy_redshift.dialect
import sqlalchemy
def test_defined_types():
# These types are the officially supported Redshift types as of 20191121
# AWS Redshift Docs Reference:
# https://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html
assert sqlalchemy_redshift.dialect.VARCHAR... |
jianlirong/incubator-hawq | refs/heads/master | tools/bin/gppylib/operations/backup_utils.py | 12 | # 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 u... |
Parsely/python-bloomfilter | refs/heads/master | pybloom/hashfilter.py | 1 | import time
class HashFilter(object):
'''
Plain Temporal Hash Filter for testing purposes
'''
def __init__(self, expiration):
self.expiration = expiration
self.unique_items = {}
def add(self, key, timestamp = None):
timestamp = float(timestamp)
if key in self.unique... |
zodiac/incubator-airflow | refs/heads/master | airflow/example_dags/example_python_operator.py | 44 | # -*- 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
... |
moondrop-entertainment/django-nonrel-drawp | refs/heads/master | django/utils/translation/trans_real.py | 54 | """Translation helper functions."""
import locale
import os
import re
import sys
import warnings
import gettext as gettext_module
from cStringIO import StringIO
from threading import local
from django.utils.importlib import import_module
from django.utils.safestring import mark_safe, SafeData
# Translations are cac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.