repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Gamebasis/3DGamebasisServer | refs/heads/master | GameData/blender-2.71-windows64/2.71/scripts/presets/interaction/maya.py | 8 | # Configuration Blender
import bpy
bpy.context.user_preferences.edit.use_drag_immediately = True
bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
bpy.context.user_preferences.inputs.select_mouse = 'LEFT'
bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
bpy.context.user_preferences.input... |
dvitme/account-financial-tools | refs/heads/8.0 | account_tax_analysis/__openerp__.py | 18 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publis... |
jaxkodex/odoo | refs/heads/8.0 | addons/hr_holidays/tests/common.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
NeCTAR-RC/cinder | refs/heads/nectar/icehouse | cinder/tests/fake_notifier.py | 5 | # Copyright 2014 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-2.0
#
# Unless required by applicable law or agre... |
QGuLL/samba | refs/heads/master | third_party/waf/wafadmin/pproc.py | 32 | # borrowed from python 2.5.2c1
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
# Licensed to PSF under a Contributor Agreement.
import sys
mswindows = (sys.platform == "win32")
import os
import types
import traceback
import gc
class CalledProcessError(Exception):
def __init__(self, returncode... |
wangmiao1981/spark | refs/heads/master | python/pyspark/ml/tree.py | 20 | #
# 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 us... |
irvingpop/digital-beer-menu | refs/heads/master | src/lib/flask/testsuite/basic.py | 43 | # -*- coding: utf-8 -*-
"""
flask.testsuite.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import re
import flask
import unittest
from datetime import datetime
fro... |
bratsche/Neutron-Drive | refs/heads/master | google_appengine/lib/django_1_3/tests/regressiontests/signals_regress/tests.py | 50 | import sys
from StringIO import StringIO
from django.test import TestCase
from django.db import models
from regressiontests.signals_regress.models import Author, Book
signal_output = []
def pre_save_test(signal, sender, instance, **kwargs):
signal_output.append('pre_save signal, %s' % instance)
if kwargs.get... |
liu602348184/django | refs/heads/master | tests/admin_views/urls.py | 305 | from django.conf.urls import include, url
from . import admin, custom_has_permission_admin, customadmin, views
urlpatterns = [
url(r'^test_admin/admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^test_admin/admin/secure-view/$', views.secure_view, name='secure_view'),
url(r'^test_admin/admin/s... |
xenserver/xen-4.4 | refs/heads/master | tools/xm-test/lib/XmTestReport/ResultReport.py | 42 | #!/usr/bin/python
"""
ResultReport.py - Handles the gathering and xml-formatting of xm-test
results
Copyright (C) International Business Machines Corp., 2005
Author: Dan Smith <danms@us.ibm.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU... |
onurgu/ner-tagger-tensorflow | refs/heads/master | loader.py | 1 | # coding=utf-8
import os
import re
import codecs
from utils import create_dico, create_mapping, zero_digits
from utils import iob2, iob_iobes
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
import numpy as np
def load_sentences(path, lower, zeros):
"""
Load senten... |
eformat/vertx-web | refs/heads/master | vertx-web/src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 357 | from setuptools import Command
from setuptools.archive_util import unpack_archive
from distutils import log, dir_util
import os, shutil, pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... |
kovalevfm/Turnip | refs/heads/master | pyturnip/setup.py | 1 | #!/usr/bin/python
# coding: utf-8
from distutils.core import setup
setup(
name='turnip',
version='1.0',
description='key value server , store data on disk with leveldv, server on zmq, protocol via msgpack',
author='Fedor Kovalev',
author_email='kovalevfm@yandex-team.ru',
py_modules=['turnip', ]... |
PeterPetrik/QGIS | refs/heads/master | src/plugins/grass/scripts/t.rast.what.qgis.py | 62 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
############################################################################
#
# MODULE: t.rast.what
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: Sample a space time raster dataset at specific vector point
# coordinates and write the output to stdou... |
blacklin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/urllib/robotparser.py | 83 | """ robotparser.py
Copyright (C) 2000 Bastian Kleineidam
You can choose between two licenses when using this package:
1) GNU GPLv2
2) PSF license for Python 2.2
The robots.txt Exclusion Protocol is implemented as specified in
http://www.robotstxt.org/norobots-rfc.txt
"""
import urllib.parse... |
RubenKelevra/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/jinja2/compiler.py | 623 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from jinja2... |
sodafree/backend | refs/heads/master | build/lib.linux-i686-2.7/django/contrib/comments/__init__.py | 423 | from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import ImproperlyConfigured
from django.contrib.comments.models import Comment
from django.contrib.comments.forms import CommentForm
from django.utils.importlib import import_module
DEFAULT_COMMENTS_APP = 'django.contrib.... |
bgalehouse/grr | refs/heads/master | lib/flows/cron/system_test.py | 3 | #!/usr/bin/env python
"""System cron flows tests."""
from grr.endtoend_tests import base
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import flow
from grr.lib import test_lib
from grr.lib import utils
from grr.lib.flows.cron import sys... |
paulmadore/Eric-IDE | refs/heads/master | 6-6.0.9/eric/ThirdParty/Pygments/pygments/style.py | 2 | # -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
def with_metaclass(meta, base=object):
"""
Python ... |
artmusic0/theano-learning.part03 | refs/heads/master | untitled1.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 13 16:11:14 2016
@author: winpython
"""
for i in range(10):
print i |
Shopify/dd-agent | refs/heads/master | checks.d/windows_service.py | 7 | """ Collect status information for Windows services
"""
# 3rd party
import wmi
# project
from checks import AgentCheck
class WindowsService(AgentCheck):
STATE_TO_VALUE = {
'Stopped': AgentCheck.CRITICAL,
'Start Pending': AgentCheck.WARNING,
'Stop Pending': AgentCheck.WARNING,
'Run... |
MrNuggles/HeyBoet-Telegram-Bot | refs/heads/master | temboo/Library/Utilities/Validation/PasswordCriteria.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# PasswordCriteria
# Verifies that a given password matches a standard pattern for passwords.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (t... |
codexns/sublime-coverage | refs/heads/master | st3_linux_x32/coverage/env.py | 85 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Determine facts about the environment."""
import os
import sys
# Operating systems.
WINDOWS = sys.platform == "win32"
LINUX = sys.platform == "linux2"
# Pytho... |
Dino0631/RedRain-Bot | refs/heads/develop | lib/youtube_dl/extractor/teletask.py | 215 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate
class TeleTaskIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.tele-task.de/archive/video/html5/2... |
yhoshino11/GuestBook | refs/heads/master | .venv/lib/python2.7/site-packages/werkzeug/contrib/profiler.py | 295 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.profiler
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the :mod:`profile` or
:mod:`cProfile` module to do the profiling and writes the stats to the
stream provide... |
colonyhq/yowsup | refs/heads/master | yowsup/layers/axolotl/protocolentities/enc.py | 14 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
import sys
class EncProtocolEntity(ProtocolEntity):
TYPE_PKMSG = "pkmsg"
TYPE_MSG = "msg"
TYPE_SKMSG = "skmsg"
TYPES = (TYPE_PKMSG, TYPE_MSG, TYPE_SKMSG)
def __init__(self, type, version, data, mediaType = None, jid = None):
a... |
shaunstanislaus/flexx | refs/heads/master | exp/websocket.py | 22 | """
Combine this with the websockt hello world in the sandbox.
"""
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import webbrowser
HTML = """
<!doctype html>
<html>
<head>
<title>WebSockets Hello World</title>
<meta charset="utf-8" />
<style type="text/css">
... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/_compat.py | 342 | # flake8: noqa
# This whole file is full of lint errors
import codecs
import sys
import operator
import functools
import warnings
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
WIN = sys.platform.startswith('win')
_identity = lambda x: x
if PY2:
u... |
wufangjie/leetcode | refs/heads/master | 218. The Skyline Problem.py | 1 | class Solution(object):
def getSkyline(self, buildings):
"""
:type buildings: List[List[int]]
:rtype: List[List[int]]
"""
if not buildings:
return []
result = [(buildings[0][0], 0)]
for l, r, h in buildings:
n = len(result)
... |
mvtango/fiware-orion-bellatrix | refs/heads/master | orionclient.py | 1 | # FIWARE ORION CLIENT
#
#
# Usage:
# from orionclient import attrib,contextbroker
# broker=contextbroker(url,auth)
#
# Create Entity
# broker["id"]=attrib(height=10, width=100A)
#
# Update Value
# broker["id"]["height"]=100
#
# Retrieve Value
# print(broker["id"]["height"])
import requests
requests.packages.urllib3.... |
badock/nova | refs/heads/master | nova/virt/hyperv/vmutilsv2.py | 3 | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... |
arthurbarnard/Dirac_simulation | refs/heads/master | dirac_script.py | 1 | from dirac_run import inPolygon
import matplotlib.pyplot as plt
import numpy as np
import time
import pickle
from matplotlib.path import Path
from dirac_sheet import dirac_sheet
def main():
run_Dirac(.1,0,'file_out')
def run_Dirac(p,theta,fname):
dx = .25
dt = 0.1
Ngrid = int(1802)
X_offset=112.5
tic = t... |
guymakam/Kodi-Israel | refs/heads/master | plugin.video.MakoTV/resources/lib/crypto/errors.py | 8 | # -*- coding: iso-8859-1 -*-
""" errors
Error classes for cryptographic modules
Copyright © (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
"""
class CryptoError(Exception):
""" Base class for crypto exceptions """
def __init__(self,errorMessage='Error!'):
self.messag... |
Ensighten/Diamond | refs/heads/ens-master | src/collectors/dseopscenter/dseopscenter.py | 16 | # coding=utf-8
"""
Collect the DataStax OpsCenter metrics
"""
import urllib2
import datetime
try:
import json
except ImportError:
import simplejson as json
import diamond.collector
class DseOpsCenterCollector(diamond.collector.Collector):
last_run_time = 0
column_families = None
last_schema_sy... |
minhphung171093/GreenERP_V7 | refs/heads/master | openerp/addons/portal_project/__openerp__.py | 55 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
CMLL/taiga-back | refs/heads/master | tests/unit/test_export.py | 18 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... |
cyanna/edx-platform | refs/heads/master | common/lib/safe_lxml/setup.py | 212 | """
Setup.py for safe_lxml.
"""
from setuptools import setup
setup(
name="safe_lxml",
version="1.0",
packages=["safe_lxml"],
install_requires=[
"lxml",
"defusedxml"
],
)
|
vishwaprakashmishra/xmatrix | refs/heads/master | vumi/transports/vumi_bridge/tests/test_vumi_bridge.py | 3 | import base64
import json
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.error import ConnectionLost
from twisted.internet.task import Clock
from twisted.web.server import NOT_DONE_YET
from twisted.python.failure import Failure
from vumi.message import TransportUserMessage
from ... |
mcella/django | refs/heads/master | django/contrib/gis/db/backends/oracle/base.py | 442 | from django.db.backends.oracle.base import \
DatabaseWrapper as OracleDatabaseWrapper
from .features import DatabaseFeatures
from .introspection import OracleIntrospection
from .operations import OracleOperations
from .schema import OracleGISSchemaEditor
class DatabaseWrapper(OracleDatabaseWrapper):
SchemaEd... |
gyang/horizon | refs/heads/master | horizon/dashboards/syspanel/images/tables.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... |
fidomason/kbengine | refs/heads/master | kbe/src/lib/python/Tools/scripts/which.py | 64 | #! /usr/bin/env python3
# Variant of "which".
# On stderr, near and total misses are reported.
# '-l<flags>' argument adds ls -l<flags> of each file found.
import sys
if sys.path[0] in (".", ""): del sys.path[0]
import sys, os
from stat import *
def msg(str):
sys.stderr.write(str + '\n')
def main():
pathli... |
huangxiaohen2738/tornado-rpc | refs/heads/master | game/handler/gateway.py | 1 | #!/usr/bin/env python
#-*-coding: utf-8-*-
# Version: 0.1
# Author: Song Huang <huangxiaohen2738@gmail.com>
# License: Copyright(c) 2015 Song.Huang
# Summary:
from rpc import route
from protocol_manager import cs_call
from manager.gscharacter import GSCharacter
from manager.user import g_UserMgr
from torna... |
miquelramirez/LAPKT-public | refs/heads/master | external/fd/pddl/pddl_file.py | 6 | #! /usr/bin/env python
try:
# Python 3.x
import builtins
except ImportError:
# Python 2.x
import __builtin__ as builtins
import sys
import os.path
import re
from . import parser
from . import tasks
def parse_pddl_file(type, filename):
try:
# The builtin open function is shadowed by this... |
himleyb85/django | refs/heads/master | tests/extra_regress/models.py | 281 | from __future__ import unicode_literals
import copy
import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RevisionableModel(models.Model):
base = models.ForeignKey('self', models.S... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/space/booster/collection_reward_booster_01_mk3.py | 85615 | import sys
def setup(core, object):
return |
wa1tnr/ainsuSPI | refs/heads/master | 0-Distribution.d/circuitpython-master/tests/extmod/utimeq_stable.py | 41 | try:
from utimeq import utimeq
except ImportError:
print("SKIP")
raise SystemExit
h = utimeq(10)
# Check that for 2 same-key items, the queue is stable (pops items
# in the same order they were pushed). Unfortunately, this no longer
# holds for more same-key values, as the underlying heap structure
# is n... |
UnitedThruAction/Data | refs/heads/master | Tools/NYCElectionResults.py | 1 | """Download NYC election results from the Board of Elections website.
@author n.o.franklin (at) gmail.com
@date 2018-01-20
This code is governed by the Apache License at http://www.apache.org/licenses/LICENSE-2.0.txt.
Copyright 2018 Google.
"""
import csv
import logging
import pandas as pd
import re
import sys
fro... |
sandeva/appspot | refs/heads/master | appengine_django/auth/tests.py | 64 | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
mikewied/perfrunner | refs/heads/master | perfrunner/utils/install_gw.py | 5 | from optparse import OptionParser
import requests
import urllib2
from jinja2 import Environment, FileSystemLoader
from logger import logger
from requests.exceptions import ConnectionError
from perfrunner.helpers.remote import RemoteHelper
from perfrunner.helpers.rest import SyncGatewayRequestHelper
from perfrunner.se... |
coderjz/gascogne | refs/heads/master | sites.py | 1 | # This file contains a class for each different site we can pull recipes from.
# The class/site to use is selected based on the get_domain function.
class Food52:
def get_domain(self):
return "food52.com"
def get_short_name(self):
return "F52"
def get_title(self, soup):
return sou... |
snailhu/myself-Repository | refs/heads/master | SmartDataApp/migrations/0017_auto__chg_field_repair_type.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Repair.type'
db.alter_column(u'SmartDataApp_repair', 'type', self.gf('django.db.models.fi... |
morreene/tradenews | refs/heads/master | venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py | 1093 | from __future__ import absolute_import
from . import ssl_match_hostname
__all__ = ('ssl_match_hostname', )
|
TamiaLab/carnetdumaker | refs/heads/master | apps/txtrender/fields.py | 1 | """
Model fields for the text rendering app.
"""
from django.db import models
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.widgets import AdminTextareaWidget
from .widgets import (RichTextEditorTextarea,
AdminRichTextEditorTextare... |
DecipherOne/Troglodyte | refs/heads/master | Trog Build Dependencies/Python26/Lib/test/test_posixpath.py | 3 | import unittest
from test import test_support
import posixpath, os, sys
from posixpath import realpath, abspath, dirname, basename
# An absolute path to a temporary filename for testing. We can't rely on TESTFN
# being an absolute path, so we need this.
ABSTFN = abspath(test_support.TESTFN)
def safe_rmdir(dirname):... |
Lyleo/OmniMarkupPreviewer | refs/heads/master | OmniMarkupLib/Renderers/libs/pygments/lexers/functional.py | 77 | # -*- coding: utf-8 -*-
"""
pygments.lexers.functional
~~~~~~~~~~~~~~~~~~~~~~~~~~
Just export lexer classes previously contained in this module.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexers.lisp import SchemeLe... |
malkoto1/just_cook | refs/heads/master | SQLAlchemy-1.0.4/lib/sqlalchemy/dialects/mysql/mysqldb.py | 59 | # mysql/mysqldb.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+mysqldb
:name: MySQL-Python
:dbapi: mysqldb
:co... |
Tojaj/DeltaRepo | refs/heads/master | deltarepo/deltametadata.py | 1 | import os
import tempfile
import xml.dom.minidom
import createrepo_c as cr
from lxml import etree
import deltarepo
from deltarepo.util import isnonnegativeint
from .errors import DeltaRepoError, DeltaRepoParseError
from .xmlcommon import getNode, getAttribute, getNumAttribute
class AdditionalXmlData(object):
"""... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons/base/ir/ir_actions.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... |
dslutz/qemu | refs/heads/master | scripts/tracetool/vcpu.py | 17 | # -*- coding: utf-8 -*-
"""
Generic management for the 'vcpu' property.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2016, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__emai... |
axce1/PyProjects | refs/heads/master | Text/rss.py | 1 | import sys
import urllib.request as ur
import re
def get_rss(url_link):
try:
page = ur.urlopen(url_link).read()
text_page = page.decode('utf8')
title = re.findall(r'<title>(.+)</title>', text_page)
link = re.findall(r'<link>(.+)</link>', text_page)
for k in zip(title, link):... |
AAROC/invenio | refs/heads/master | invenio/modules/access/testsuite/test_document_restrictions.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 later... |
twitterdev/twitter-leaderboard | refs/heads/master | services/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-28 08:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/google_ads_field_data_type.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... |
adelina-t/nova | refs/heads/master | nova/tests/unit/virt/xenapi/client/test_objects.py | 80 | # Copyright (c) 2014 Rackspace Hosting
# 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... |
facebookresearch/faiss | refs/heads/master | tests/test_lsq.py | 1 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests for the implementation of Local Search Quantizer
"""
import numpy as np
import faiss
import unittest
from faiss.contrib import da... |
blueburningcoder/nupic | refs/heads/master | src/nupic/support/configuration.py | 40 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
topecz/l10n-spain | refs/heads/8.0 | l10n_es_aeat/wizard/export_to_boe.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2011
# Pexego Sistemas Informáticos. (http://pexego.es) All Rights Reserved
# Luis Manuel Angueira Blanco (Pexego)
#
# Copyright (C) 2013
# Ignacio Ibeas - Acysos S.L.... |
cetic/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_udld_interface.py | 57 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
aaltinisik/OCBAltinkaya | refs/heads/8.0 | addons/project_issue/report/__init__.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
sih4sing5hong5/django-allauth | refs/heads/master | allauth/socialaccount/south_migrations/0001_initial.py | 66 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.conf import settings
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
def get_user_model():
return User
cl... |
RudolfCardinal/crate | refs/heads/master | tools/make_package.py | 1 | #!/usr/bin/env python
"""
tools/make_package.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
it under the terms of... |
rosenjens/monad | refs/heads/Development | TravelRecommendation/Scripts/case4_requests.py | 2 | import pymongo
import json
import random
import datetime
import uuid
import bson
positions = ['Flogsta','Polacksbacken','Central Station','Granby','Gamla Uppsala','Uppsala Science Park','Uppsala Centrum','Carolina Rediviva', 'Uppsala Hospital']
coordinates = [[59.851252, 17.593290], [59.840427, 17.647628], [59.858052,... |
paweljasinski/ironpython3 | refs/heads/master | Src/StdLib/Lib/test/test_exceptions.py | 5 | # Python test set -- part 5, built-in exceptions
import os
import sys
import unittest
import pickle
import weakref
import errno
from test.support import (TESTFN, captured_output, check_impl_detail,
check_warnings, cpython_only, gc_collect, run_unittest,
no_tracing, ... |
grue/django-quickbooks-online | refs/heads/master | quickbooks/api.py | 3 | import urllib
from requests_oauthlib import OAuth1Session
from django.conf import settings
from django.contrib.auth.models import User
from quickbooks.models import QuickbooksToken
APPCENTER_URL_BASE = 'https://appcenter.intuit.com/api/v1/'
QUICKBOOKS_DESKTOP_V3_URL_BASE = 'https://quickbooks.api.intuit.com/v3'
QUIC... |
UK992/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_events.py | 24 | # -*- coding: utf-8 -*-
"""
test_events.py
~~~~~~~~~~~~~~
Specific tests for any function that is logically self-contained as part of
events.py.
"""
import inspect
import sys
from hypothesis import given
from hypothesis.strategies import (
integers, lists, tuples
)
import pytest
import h2.errors
import h2.events... |
maropu/spark | refs/heads/master | python/pyspark/ml/tests/test_linalg.py | 23 | #
# 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 us... |
explosion/spaCy | refs/heads/master | spacy/tests/lang/fa/test_noun_chunks.py | 2 | import pytest
def test_noun_chunks_is_parsed_fa(fa_tokenizer):
"""Test that noun_chunks raises Value Error for 'fa' language if Doc is not parsed."""
doc = fa_tokenizer("این یک جمله نمونه می باشد.")
with pytest.raises(ValueError):
list(doc.noun_chunks)
|
bhargav2408/python-for-android | refs/heads/master | python3-alpha/extra_modules/pyxmpp2/sasl/__init__.py | 46 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... |
kaedroho/django | refs/heads/master | tests/admin_scripts/another_app_waiting_migration/models.py | 133 | from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=255)
class Meta:
app_label = 'another_app_waiting_migration'
|
stewartpark/django | refs/heads/master | django/core/mail/utils.py | 1315 | """
Email message and email sending related helper functions.
"""
import socket
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
# seconds, which slows down the restart of the server.
class CachedDnsName(object):
def __str__(self):
return self.get_fqdn()
def get_fqdn(sel... |
Guad/crowdpost | refs/heads/master | main.py | 1 | import flask
import requests
import re
from string import ascii_lowercase, ascii_uppercase
from random import choice
app = flask.Flask(__name__)
# Globals
criminalList = []
shotDownCriminals = []
interjection = r"""
I'd jus[code][/code]t like to inte[code][/code]rject for moment. What you're refer[code][/code]ing ... |
nilbody/h2o-3 | refs/heads/master | py2/jenkins_h2o_port_allocate.py | 30 | #!/usr/bin/python
# "Avoid locker or centralized resource by hard-wiring the port mapping within range"
# "implied by max # of ports used per job, max # of executors per machine, and # of machines."
# "Map of source determines port. in/out using env variables"
print "\njenkins_h2o_port_allocate...."
import socket, o... |
rlindner81/pyload | refs/heads/stable | module/plugins/accounts/CramitIn.py | 1 | # -*- coding: utf-8 -*-
from module.plugins.internal.XFSAccount import XFSAccount
class CramitIn(XFSAccount):
__name__ = "CramitIn"
__type__ = "account"
__version__ = "0.07"
__status__ = "testing"
__description__ = """Cramit.in account plugin"""
__license__ = "GPLv3"
__authors__ = [("zoi... |
psycofdj/coverxygen | refs/heads/master | coverxygen/__init__.py | 1 | # -*- mode: python; coding: utf-8 -*-
#------------------------------------------------------------------------------
import os
import sys
import json
import re
import xml.etree.ElementTree as ET
from functools import reduce
#------------------------------------------------------------------------------
__author__ ... |
attwad/python-osc | refs/heads/master | pythonosc/test/test_osc_bundle_builder.py | 1 | import unittest
from pythonosc import osc_bundle_builder
from pythonosc import osc_message_builder
class TestOscBundleBuilder(unittest.TestCase):
def test_empty_bundle(self):
bundle = osc_bundle_builder.OscBundleBuilder(
osc_bundle_builder.IMMEDIATELY).build()
self.assertEqual(0, bund... |
looker-open-source/sdk-codegen | refs/heads/main | examples/python/oauth_session.py | 3 | import getpass
import sys
import urllib.parse
import requests
from looker_sdk.rtl import api_settings, auth_session, requests_transport
from looker_sdk.sdk.api31 import methods
from looker_sdk.rtl import serialize
def oauth_interactive_roundtrip():
username = input("\nemail: ")
password = getpass.getpass()
... |
klahnakoski/TestFailures | refs/heads/master | pyLibrary/vendor/strangman/pstat.py | 11 | # Copyright (c) 1999-2007 Gary Strangman; All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... |
aifil/odoo | refs/heads/8.0 | addons/base_geolocalize/models/res_partner.py | 28 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import urllib
from openerp.osv import osv, fields
from openerp import tools
from openerp.tools.translate import _
from openerp.exceptions import UserError
def geo_find(addr):
url = 'https://maps.google... |
sergiocorato/odoomrp-wip | refs/heads/8.0 | machine_manager_preventive/wizard/create_preventive.py | 5 | # -*- coding: utf-8 -*-
# Copyright 2016 Daniel Campos - Avanzosc S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
class PreventiveCreateWizard(models.TransientModel):
_name = 'preventive.create.wizard'
_description = 'Create Machine Preventive oper... |
kratman/psi4public | refs/heads/master | psi4/share/psi4/databases/HTR40.py | 3 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... |
eunchong/build | refs/heads/master | scripts/slave/recipes/android/builder.py | 1 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from contextlib import contextmanager
from recipe_engine import recipe_api
from recipe_engine.types import freeze
DEPS = [
'chromium',
'chromium_android... |
jialing3/corner_cases | refs/heads/master | Relue/Eu68.py | 1 | from itertools import combinations, permutations
# outer represents the nodes on the outer ring
# inner represents the nodes on the inner ring
# on the inner ring, middle represents the nodes in the middle of a line
# on the inner ring, end_node represents the nodes on the end of a line
lst = range(1, 11)
numbers = [... |
gmccoy42/WrapUp | refs/heads/master | wrapup/management/commands/clean.py | 2 | from wrapup.models import Stories
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Updates wrapup'
def handle(self, *args, **options):
print("*********************\n*Cleaning wrapup database*\n*********************")
... |
Evgenus/msvspyproj | refs/heads/master | msvspyproj/project.py | 1 | # msvspyproj - MS Visual Studio Python Project Helper
# Copyright (c) 2011, Eugene Chernyshov
# Licensed under the LGPL.
#standart
import os.path
#external
from lxml import etree
class PyProject(object):
namespaces = {'ns': 'http://schemas.microsoft.com/developer/msbuild/2003'}
rule_projecthome = etree.XPath(... |
Arcanemagus/SickRage | refs/heads/master | lib/sqlalchemy/testing/plugin/pytestplugin.py | 76 | import pytest
import argparse
import inspect
from . import plugin_base
import collections
def pytest_addoption(parser):
group = parser.getgroup("sqlalchemy")
def make_option(name, **kw):
callback_ = kw.pop("callback", None)
if callback_:
class CallableAction(argparse.Action):
... |
ossdemura/django-miniblog | refs/heads/dev | src/Lib/site-packages/django/db/models/constants.py | 954 | """
Constants used across the ORM in general.
"""
# Separator used to split filter strings apart.
LOOKUP_SEP = '__'
|
egenerat/flight-manager | refs/heads/master | django/contrib/sitemaps/tests/urls.py | 9 | from datetime import datetime
from django.conf.urls.defaults import *
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap
from django.contrib.auth.models import User
class SimpleSitemap(Sitemap):
changefreq = "never"
priority = 0.5
location = '/location/'
lastmod = dat... |
Softmotions/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/tests/test_export_convert_format.py | 69 | """
Test for export_convert_format.
"""
from unittest import TestCase
from django.core.management import call_command, CommandError
from django.conf import settings
from tempfile import mkdtemp
import shutil
from path import Path as path
from contentstore.management.commands.export_convert_format import Command, extrac... |
paterson/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/element_location/element_location_test.py | 142 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class ElementLocationTest(base_test.WebDriverBaseTest):
def test_find_element_by_name(self):
self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
e =... |
9nix00/mongoengine | refs/heads/master | tests/document/delta.py | 3 | # -*- coding: utf-8 -*-
import sys
sys.path[0:0] = [""]
import unittest
from bson import SON
from mongoengine import *
from mongoengine.connection import get_db
__all__ = ("DeltaTest",)
class DeltaTest(unittest.TestCase):
def setUp(self):
connect(db='mongoenginetest')
self.db = get_db()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.