repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
dejlek/pulsar | tests/stores/redis.py | 1 | 2100 | import asyncio
from pulsar import HAS_C_EXTENSIONS
from pulsar.apps.test import check_server
from pulsar.apps.data import RedisScript
from .pulsards import unittest, RedisCommands, create_store
from .lock import RedisLockTests
OK = check_server('redis')
@unittest.skipUnless(OK, 'Requires a running Redis server')
... | bsd-3-clause |
jblupus/PyLoyaltyProject | old/interactions/format_interactions.py | 1 | 5936 | from os import mkdir
from os.path import exists
import numpy as np
import pandas as pd
from old.project import CassandraUtils
from old.project import get_time
RTD_STS_KEY = 'retweetedStatus'
MT_STS_KEY = 'userMentionEntities'
PATH = '/home/joao/Dev/Data/Twitter/'
FRIENDS_PATH = '/home/joao/Dev/Data/Twitter/friendshi... | bsd-2-clause |
pwhelan/djshouts | django/contrib/sites/models.py | 387 | 2867 | from django.db import models
from django.utils.translation import ugettext_lazy as _
SITE_CACHE = {}
class SiteManager(models.Manager):
def get_current(self):
"""
Returns the current ``Site`` based on the SITE_ID in the
project's settings. The ``Site`` object is cached the first
... | bsd-3-clause |
jianghuaw/nova | nova/tests/unit/conductor/tasks/test_base.py | 54 | 1604 | # 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
# d... | apache-2.0 |
Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_rendered_element.py | 1 | 1336 | #Copyright 2007-2009 WebDriver committers
#Copyright 2007-2009 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 b... | mpl-2.0 |
sandeepdsouza93/TensorFlow-15712 | tensorflow/tools/dist_test/python/census_widendeep.py | 3 | 11352 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
yangxiaoze/Unblock-Youku | test/run-all-tests.py | 43 | 3290 | #!/usr/bin/env python
"""
Allow you smoothly surf on many websites blocking non-mainland visitors.
Copyright (C) 2012, 2013 Bo Zhu http://zhuzhu.org
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 ... | agpl-3.0 |
AlexBoogaard/Sick-Beard-Torrent-Edition | lib/unidecode/x068.py | 252 | 4674 | data = (
'Zhi ', # 0x00
'Liu ', # 0x01
'Mei ', # 0x02
'Hoy ', # 0x03
'Rong ', # 0x04
'Zha ', # 0x05
'[?] ', # 0x06
'Biao ', # 0x07
'Zhan ', # 0x08
'Jie ', # 0x09
'Long ', # 0x0a
'Dong ', # 0x0b
'Lu ', # 0x0c
'Sayng ', # 0x0d
'Li ', # 0x0e
'Lan ', # 0x0f
'Yong ', # 0x10... | gpl-3.0 |
MSA-Argentina/ojota | ojota/base.py | 2 | 20415 | """
This file is part of Ojota.
Ojota is free software: you can redistribute it and/or modify
it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Ojota is distributed in th... | lgpl-3.0 |
CloudWareChile/OpenChile | openerp/addons/web_uservoice/__init__.py | 9 | 1038 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gener... | agpl-3.0 |
abhishekkrthakur/scikit-learn | benchmarks/bench_20newsgroups.py | 377 | 3555 | from __future__ import print_function, division
from time import time
import argparse
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.metrics import accuracy_score
from sklearn.utils.validation import check_array
from sklearn.ensemb... | bsd-3-clause |
Tesora/tesora-tempest | tempest/lib/api_schema/response/compute/v2_1/security_groups.py | 39 | 3473 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
EvanK/ansible | lib/ansible/modules/files/assemble.py | 12 | 8528 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ab... | gpl-3.0 |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/SQS/AddPermission.py | 4 | 5495 | # -*- coding: utf-8 -*-
###############################################################################
#
# AddPermission
# Adds a permission to a queue for a specific principal user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... | apache-2.0 |
nerzhul/ansible | lib/ansible/utils/module_docs_fragments/junos.py | 40 | 3023 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
gerrive/horizon | openstack_dashboard/dashboards/project/stacks/tests.py | 6 | 40882 | # 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
# distributed under th... | apache-2.0 |
andreif/blues | blues/python.py | 3 | 1054 | """
Python Blueprint
================
Does not install python itself, only develop and setup tools.
Contains pip helper for other blueprints to use.
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.python
"""
from fabric.decorators import task
from refabric.api import run, info
from refa... | mit |
Jimdo/ansible-modules-core | cloud/amazon/rds_param_group.py | 10 | 10698 | #!/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 distributed... | gpl-3.0 |
KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py | 2930 | 11275 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
opatut/mini | mini/filters.py | 1 | 4898 | from mini import app
from mini.util import AnonymousUser
from mini.models import User, Email
from datetime import datetime as dt, date as d, timedelta as td
from flask import Markup
import time, os, pygments, pygments.lexers, pygments.formatters, git, re
from os.path import *
from json import dumps
# UTILITY to wrap a... | gpl-3.0 |
guijomatos/SickRage | autoProcessTV/lib/requests/packages/urllib3/util/request.py | 1008 | 2089 | from base64 import b64encode
from ..packages.six import b
ACCEPT_ENCODING = 'gzip,deflate'
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=None, proxy_basic_auth=None, disable_cache=None):
"""
Shortcuts for generating request headers.
:param keep_ali... | gpl-3.0 |
jangorecki/h2o-3 | py2/testdir_single_jvm/test_GBMGrid_basic_many.py | 20 | 3838 | import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i
from h2o_test import dump_json, verboseprint, OutputObj
import h2o_jobs
DO_CLASSIFICATION = True
DO_FAIL_CASE = False
DO_FROM_TO_STEP = False
class Basic(unittest.TestCase):
def tearDown(self):... | apache-2.0 |
epfl-cosmo/lammps | tools/moltemplate/moltemplate/nbody_by_type_lib.py | 8 | 22855 | #!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2012, Regents of the University of California
# All rights reserved.
import sys
from collections import defaultdict
#from collections... | gpl-2.0 |
sigma-random/avmplus | build/buildbot/master/custom/buildbot_ext/steps/shellAddons.py | 8 | 16201 | # -*- test-case-name: buildbot.test.test_steps,buildbot.test.test_properties -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from buildbot.steps.shell import Shell... | mpl-2.0 |
SUSE-Cloud/nova | nova/tests/api/openstack/compute/plugins/v3/test_server_diagnostics.py | 8 | 3322 | # Copyright 2011 Eldar Nugaev
# 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 ... | apache-2.0 |
grengojbo/st2 | st2client/st2client/utils/terminal.py | 10 | 2030 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
merll/docker-fabric | dockerfabric/socat.py | 1 | 2300 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from fabric.state import env
from fabric.utils import puts
from .base import ConnectionDict, get_local_port
from .tunnel import LocalTunnel
class SocketTunnels(ConnectionDict):
"""
Cache for **socat** tunnels to the remote machine.
Instant... | mit |
BartVB/ansible-modules-core | cloud/openstack/_quantum_subnet.py | 129 | 10130 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 |
tomchristie/django | tests/shortcuts/tests.py | 109 | 1737 | from django.test import SimpleTestCase, override_settings
from django.test.utils import require_jinja2
@override_settings(ROOT_URLCONF='shortcuts.urls')
class RenderTests(SimpleTestCase):
def test_render(self):
response = self.client.get('/render/')
self.assertEqual(response.status_code, 200)
... | bsd-3-clause |
aurofable/medhack-server | venv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.py | 17 | 26335 | # orm/interfaces.py
# Copyright (C) 2005-2012 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
"""
Contains various base classes used throughout the ORM.
Defines the now depreca... | mit |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/SQLAlchemy-0.9.7-py2.7-linux-x86_64.egg/sqlalchemy/orm/mapper.py | 10 | 108109 | # orm/mapper.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logic to map Python classes to and from selectables.
Defines the :class:`~sqlalche... | apache-2.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/email/headerregistry.py | 12 | 20164 | """Representing and manipulating email headers via custom objects.
This module provides an implementation of the HeaderRegistry API.
The implementation is designed to flexibly follow RFC5322 rules.
Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.
""... | mit |
pamfilos/data.cern.ch | cap/modules/deposit/search.py | 5 | 3516 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016, 2017 CERN.
#
# CERN Analysis Preservation Framework 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; ... | gpl-2.0 |
Frankkkkk/arctic | arctic/date/_daterange.py | 1 | 8033 | import datetime
from six import string_types
from ._generalslice import OPEN_OPEN, CLOSED_CLOSED, OPEN_CLOSED, CLOSED_OPEN, GeneralSlice
from ._parse import parse
INTERVAL_LOOKUP = {(True, True): OPEN_OPEN,
(False, False): CLOSED_CLOSED,
(True, False): OPEN_CLOSED,
... | lgpl-2.1 |
y12uc231/edx-platform | lms/djangoapps/courseware/tests/test_access.py | 14 | 16756 | import datetime
import pytz
from django.test import TestCase
from django.core.urlresolvers import reverse
from mock import Mock, patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
import courseware.access as access
from courseware.masquerade import CourseMasquerade
from courseware.tests.factories imp... | agpl-3.0 |
Ximpia/ximpia | ximpia/xpcore/migrations/0005_auto__chg_field_workflowdata_view.py | 1 | 74737 | # -*- 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 'WorkflowData.view'
db.alter_column('CORE_WORKFLOW_DATA', 'ID_VIEW', self.gf('django.db.mo... | apache-2.0 |
bryx-inc/boto | tests/unit/vpc/test_customergateway.py | 114 | 4610 | from tests.compat import OrderedDict
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, CustomerGateway
class TestDescribeCustomerGateways(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return b"""
... | mit |
bryx-inc/boto | tests/unit/ec2/test_blockdevicemapping.py | 111 | 6739 | from tests.compat import unittest
from boto.ec2.connection import EC2Connection
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
from tests.compat import OrderedDict
from tests.unit import AWSMockServiceTestCase
class BlockDeviceTypeTests(unittest.TestCase):
def setUp(self):
s... | mit |
rahul67/hue | apps/zookeeper/src/zookeeper/forms.py | 38 | 1216 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
alex/changes | migrations/versions/1c5907e309f1_add_failurereason.py | 4 | 1593 | """Add FailureReason
Revision ID: 1c5907e309f1
Revises: 4a12e7f0159d
Create Date: 2014-06-02 15:31:02.991394
"""
# revision identifiers, used by Alembic.
revision = '1c5907e309f1'
down_revision = '4a12e7f0159d'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembi... | apache-2.0 |
azunite/chrome_build | depot-tools-auth.py | 27 | 3275 | #!/usr/bin/env python
# Copyright 2015 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.
"""Manages cached OAuth2 tokens used by other depot_tools scripts.
Usage:
depot-tools-auth login codereview.chromium.org
depot-too... | bsd-3-clause |
Gchorba/Ask | lib/python2.7/site-packages/werkzeug/wsgi.py | 147 | 37837 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... | mit |
NL66278/odoo | addons/hr_holidays/tests/__init__.py | 121 | 1159 | # -*- 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... | agpl-3.0 |
tchellomello/home-assistant | homeassistant/components/xiaomi_tv/media_player.py | 21 | 3130 | """Add support for the Xiaomi TVs."""
import logging
import pymitv
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
SUPPORT_VOLUME_STEP,
)
from homeassi... | apache-2.0 |
privateip/ansible | lib/ansible/playbook/role/__init__.py | 14 | 18852 | # (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... | gpl-3.0 |
sppps/coffee-cup-accounting | consume/__init__.py | 1 | 2884 | import forms
from flask import current_app as app
from generic.editor import GenericEditor
from bson import ObjectId
class ConsumeEditor(GenericEditor):
def __init__(self, *args, **kwargs):
super(ConsumeEditor, self).__init__(*args, **kwargs)
def _create_form(self, *args, **kwargs):
return f... | gpl-3.0 |
broferek/ansible | lib/ansible/modules/network/fortios/fortios_system_auto_install.py | 13 | 9641 | #!/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... | gpl-3.0 |
Frederick888/cargo | src/etc/install-deps.py | 17 | 2275 | #!/usr/bin/env python
import contextlib
import download
import os
import shutil
import sys
import tarfile
if os.environ.get('BITS') == '32':
host_bits = 'i686'
extra_bits = 'x86_64'
else:
host_bits = 'x86_64'
extra_bits = 'i686'
extra = None
libdir = 'lib'
# Figure out our target triple
if sys.platf... | apache-2.0 |
mfherbst/spack | var/spack/repos/builtin/packages/deconseq-standalone/package.py | 5 | 2521 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
squidsoup/snapcraft | snapcraft/file_utils.py | 3 | 7787 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
dpgaspar/Flask-AppBuilder | examples/related_fields/testdata.py | 1 | 2739 | import logging
from app import db
from app.models import ContactGroup, ContactSubGroup, Gender, Contact
import random
from datetime import datetime
log = logging.getLogger(__name__)
def get_random_name(names_list, size=1):
name_lst = [
names_list[random.randrange(0, len(names_list))].decode("utf-8").capi... | bsd-3-clause |
blckshrk/Weboob | modules/allocine/backend.py | 1 | 4176 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob 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 Free Software Foundation, either version 3 of the License, or
# (at your op... | agpl-3.0 |
boedy1996/SPARC | geonode/contrib/dynamic/models.py | 23 | 13932 | from __future__ import unicode_literals
import keyword
import re
from django.utils.datastructures import SortedDict
from django.conf import settings
from django.contrib.gis.utils import LayerMapping
from django.contrib.gis.db import models
from django.contrib.gis import admin
from django.core.exceptions import Valida... | gpl-3.0 |
cuckoosandbox/monitor | src/capstone/bindings/python/test_xcore.py | 3 | 2325 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
from capstone.xcore import *
from xprint import to_x, to_hex, to_x_32
XCORE_CODE = b"\xfe\x0f\xfe\x17\x13\x17\xc6\xfe\xec\x17\x97\xf8\xec\x4f\x1f\xfd\xec\x37\x07\xf2... | gpl-3.0 |
jjmleiro/hue | apps/hbase/src/hbase/urls.py | 32 | 1029 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
hickford/cython | Cython/Compiler/FlowControl.py | 14 | 45482 | from __future__ import absolute_import
import cython
cython.declare(PyrexTypes=object, ExprNodes=object, Nodes=object,
Builtin=object, InternalError=object, error=object, warning=object,
py_object_type=object, unspecified_type=object,
object_expr=object, fake_rhs_expr=objec... | apache-2.0 |
yytang2012/novels-crawler | novelsCrawler/spiders/m-yushuwu.py | 1 | 2338 | # -*- coding: utf-8 -*-
from scrapy import Selector
from libs.misc import get_spider_name_from_domain
from libs.polish import *
from novelsCrawler.spiders.simpleSpider import SimpleSpider
class MyushuwuSpider(SimpleSpider):
"""
classdocs
example: https://m.yushuwu.com/novel/31960.html
"""
dom ... | mit |
vuolter/pyload | src/pyload/plugins/downloaders/XdadevelopersCom.py | 1 | 1413 | # -*- coding: utf-8 -*
#
# Test links:
# http://forum.xda-developers.com/devdb/project/dl/?id=10885
from ..base.simple_downloader import SimpleDownloader
class XdadevelopersCom(SimpleDownloader):
__name__ = "XdadevelopersCom"
__type__ = "downloader"
__version__ = "0.08"
__status__ = "testing"
... | agpl-3.0 |
posita/dropbox-sdk-python | dropbox/stone_validators.py | 2 | 24413 | """
Defines classes to represent each Stone type in Python. These classes should
be used to validate Python objects and normalize them for a given type.
The data types defined here should not be specific to an RPC or serialization
format.
This module should be dropped into a project that requires the use of Stone. In... | mit |
theicfire/djangofun | djangotoolbox/tests.py | 6 | 14370 | from .fields import ListField, SetField, DictField, EmbeddedModelField
from django.db import models, connections
from django.db.models import Q
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.dispatch.dispatcher import receiver
from django.test import TestCase
from d... | bsd-3-clause |
wwright2/dcim3-angstrom1 | sources/bitbake/lib/bb/fetch2/perforce.py | 3 | 5987 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it u... | mit |
pyparallel/numpy | numpy/distutils/fcompiler/g95.py | 229 | 1379 | # http://g95.sourceforge.net/
from __future__ import division, absolute_import, print_function
from numpy.distutils.fcompiler import FCompiler
compilers = ['G95FCompiler']
class G95FCompiler(FCompiler):
compiler_type = 'g95'
description = 'G95 Fortran Compiler'
# version_pattern = r'G95 \((GCC (?P<gccver... | bsd-3-clause |
gkudos/qgis-cartodb | cartodb/simplejson/tests/test_float.py | 141 | 1430 | import math
from unittest import TestCase
from simplejson.compat import long_type, text_type
import simplejson as json
from simplejson.decoder import NaN, PosInf, NegInf
class TestFloat(TestCase):
def test_degenerates_allow(self):
for inf in (PosInf, NegInf):
self.assertEqual(json.loads(json.du... | gpl-2.0 |
StackStorm/st2 | st2common/tests/unit/test_unit_testing_mocks.py | 3 | 4989 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
CoherentLabs/depot_tools | third_party/pylint/checkers/stdlib.py | 1 | 2665 | # Copyright 2012 Google Inc.
#
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# 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 late... | bsd-3-clause |
lseyesl/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/urls_unittest.py | 124 | 4004 | # Copyright (C) 2012 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... | bsd-3-clause |
flh/odoo | openerp/report/misc.py | 458 | 1425 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
tensorflow/datasets | tensorflow_datasets/image/coil100.py | 1 | 3345 | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... | apache-2.0 |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/ctypes/macholib/dyld.py | 253 | 5341 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
dyld emulation
"""
import os
from framework import framework_info
from dylib import dylib_info
from it... | apache-2.0 |
WillieMaddox/numpy | numpy/lib/tests/test_index_tricks.py | 91 | 11462 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_raises
)
from numpy.lib.index_tricks import (
mgrid, ndenumerate,... | bsd-3-clause |
mcalhoun/ansible | test/units/plugins/test_plugins.py | 99 | 2943 | # (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... | gpl-3.0 |
SamYaple/neutron | neutron/tests/functional/agent/linux/test_process_monitor.py | 21 | 3784 | # 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... | apache-2.0 |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/numpy/core/shape_base.py | 69 | 9050 | from __future__ import division, absolute_import, print_function
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'vstack', 'hstack',
'stack']
from . import numeric as _nx
from .numeric import asanyarray, newaxis
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
... | bsd-3-clause |
joseph-torres/spark | examples/src/main/python/ml/pipeline_example.py | 126 | 2522 | #
# 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... | apache-2.0 |
italomaia/django-allauth | allauth/socialaccount/south_migrations/0007_auto__add_field_socialapp_client_id.py | 78 | 6438 | # encoding: 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 'SocialApp.client_id'
db.add_column('socialaccount_socialapp', 'client_id', self.gf('django... | mit |
neutronpy/neutronpy | tests/test_functions.py | 2 | 1985 | # -*- coding: utf-8 -*-
r"""Tests special functions
"""
import numpy as np
import pytest
from neutronpy import functions
from scipy.integrate import simps
def test_gauss_norm():
"""Test 1d gaussian
"""
p = np.array([0., 0., 1., -30., 3., 1., 30., 3.])
x = np.linspace(-1e6, 1e6, int(8e6) + 1)
y = ... | mit |
mohittahiliani/tcp-eval-suite-ns3 | src/mesh/doc/source/conf.py | 87 | 7452 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | gpl-2.0 |
titiushko/readthedocs.org | readthedocs/restapi/views/search_views.py | 25 | 7188 | import logging
from rest_framework import decorators, permissions, status
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer
from rest_framework.response import Response
import requests
from readthedocs.builds.constants import LATEST
from readthedocs.builds.models import Version
fr... | mit |
x303597316/hue | desktop/libs/libsaml/src/libsaml/conf.py | 25 | 4857 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
openqt/algorithms | leetcode/python/lc890-find-and-replace-pattern.py | 1 | 1458 | # coding=utf-8
import unittest
"""890. Find and Replace Pattern
https://leetcode.com/problems/find-and-replace-pattern/description/
You have a list of `words` and a `pattern`, and you want to know which words
in `words` matches the pattern.
A word matches the pattern if there exists a permutation of letters `p` so
t... | gpl-3.0 |
jamessergeant/pylearn2 | pylearn2/expr/preprocessing.py | 49 | 3088 | """
Low-level utilities for preprocessing. Should be functions that apply
to NumPy arrays, not preprocessor classes (though preprocessor classes
should reuse these).
"""
__author__ = "David Warde-Farley"
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["David Warde-Farley"]
__license__ = "3-claus... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_network_interfaces_operations.py | 1 | 5637 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
HERA-Team/hera_mc | alembic/versions/93ff199763ac_update_lib_raid_errors_table.py | 2 | 1114 | """update lib_raid_errors table
Revision ID: 93ff199763ac
Revises: b1063869f198
Create Date: 2017-07-27 00:13:29.765073+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import Sequence, CreateSequence
# revision identifiers, used by Alembic.
revision = '93ff199763ac'
down_revision = '... | bsd-2-clause |
alexhenrie/poedit | deps/boost/tools/build/test/implicit_dependency.py | 7 | 1347 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test the <implicit-dependency> is respected even if the target referred to is
# not built itself, but only re... | mit |
gmarkall/numba | numba/cuda/tests/cudadrv/test_events.py | 6 | 1075 | import numpy as np
from numba import cuda
from numba.cuda.testing import unittest, CUDATestCase
class TestCudaEvent(CUDATestCase):
def test_event_elapsed(self):
N = 32
dary = cuda.device_array(N, dtype=np.double)
evtstart = cuda.event()
evtend = cuda.event()
evtstart.recor... | bsd-2-clause |
robotican/ric | ric_board/scripts/RiCConfigurator/GUI/Schemes/gazeboGui.py | 1 | 5385 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gazeboGui.ui'
#
# Created: Wed Aug 26 11:06:18 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attr... | bsd-3-clause |
cloudtools/awacs | awacs/worklink.py | 1 | 2663 | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Amazon WorkLink"
prefix = "worklink"
class Action(BaseAction):
def __init__(self, action: str = None) -> None:
... | bsd-2-clause |
ktosiek/spacewalk | spacecmd/src/lib/user.py | 2 | 17881 | #
# Licensed under the GNU General Public License Version 3
#
# 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 p... | gpl-2.0 |
nikitos/npui | netprofile/netprofile/export/pdf.py | 2 | 7572 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Data export support for PDF files
# © Copyright 2015 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero Gen... | agpl-3.0 |
vijayendrabvs/ssl-neutron | neutron/tests/unit/brocade/test_brocade_plugin.py | 38 | 2433 | # Copyright (c) 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 agreed to... | apache-2.0 |
Nindaleth/ansible-modules-core | cloud/openstack/os_user.py | 2 | 6966 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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... | gpl-3.0 |
mszewczy/odoo | addons/hr_payroll_account/hr_payroll_account.py | 240 | 10840 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
CapOM/ChromiumGStreamerBackend | tools/telemetry/third_party/webpagereplay/third_party/dns/rdtypes/sigbase.py | 235 | 6349 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | bsd-3-clause |
marcosmodesto/django-testapp | django/contrib/gis/geos/coordseq.py | 411 | 5396 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import c_double, c_uint, byref
from django.contrib.gis.geos.base import GEOSBase, numpy
from django.contrib.gis.geos.error impo... | bsd-3-clause |
faust64/ansible | lib/ansible/modules/cloud/webfaction/webfaction_db.py | 19 | 6415 | #!/usr/bin/python
#
# Create a webfaction database using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from:
# * Andy Baker
# * Federico Tarantini
#
# This file is part of Ansible
#
# Ansible is free... | gpl-3.0 |
DistributedSystemsGroup/zoe | zoe_api/web/executions.py | 1 | 5923 | # Copyright (c) 2017, Daniele Venzano
#
# 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 w... | apache-2.0 |
googleapis/python-automl | google/cloud/automl_v1/services/prediction_service/transports/__init__.py | 6 | 1221 | # -*- 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... | apache-2.0 |
ChristineLaMuse/mozillians | vendor-local/lib/python/import_export/widgets.py | 9 | 3870 | from __future__ import unicode_literals
from decimal import Decimal
from datetime import datetime
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding import force_unicode as force_text
class Widget(object):
"""
Widget takes care of converting between impo... | bsd-3-clause |
alfredoavanzosc/odoomrp-wip-1 | mrp_operations_start_without_material/__openerp__.py | 11 | 1438 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Free Software Foundation, either version 3 of th... | agpl-3.0 |
asphalt-framework/asphalt-web | asphalt/web/servers/http.py | 1 | 3331 | import logging
from asyncio import (
start_unix_server, start_server, StreamReader,
StreamWriter)
from ssl import SSLContext
from typing import Union
from urllib.parse import urlparse, unquote
import h11
from multidict import CIMultiDict
from typeguard import check_argument_types
from asphalt.core import Cont... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.