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 |
|---|---|---|---|---|---|
zaiexx/Arduino | arduino-core/src/processing/app/i18n/python/requests/utils.py | 204 | 17497 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import os
import platform
import re
import sys
import zlib
from netrc import netrc, NetrcParseError
from . impor... | lgpl-2.1 |
overcastcloud/trollius | trollius/windows_events.py | 1 | 27565 | """Selector and proactor event loops for Windows."""
import errno
import math
import socket
import struct
import weakref
from . import events
from . import base_subprocess
from . import futures
from . import proactor_events
from . import py33_winapi as _winapi
from . import selector_events
from . import tasks
from . ... | apache-2.0 |
qedi-r/home-assistant | homeassistant/components/iperf3/__init__.py | 2 | 5605 | """Support for Iperf3 network measurement tool."""
from datetime import timedelta
import logging
import iperf3
import voluptuous as vol
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
CONF_HOST,
CONF_HOSTS,
CONF_MONITORED_CONDITIONS,
CONF_PORT,
... | apache-2.0 |
crr0004/taiga-back | taiga/projects/mixins/blocked.py | 21 | 1564 | # 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... | agpl-3.0 |
SiccarPoint/landlab | landlab/grid/tests/test_raster_grid/test_inactive_nodes.py | 6 | 2358 | import numpy as np
from numpy.testing import assert_array_equal
from landlab import RasterModelGrid
def test_inactive_boundaries():
rmg = RasterModelGrid(3, 4, 1.)
assert_array_equal(rmg.active_links,
np.array([4, 5, 7, 8, 9, 11, 12]))
assert_array_equal(
rmg._node_acti... | mit |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/xml/dom/xmlbuilder.py | 239 | 12337 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... | gpl-2.0 |
maxdeliso/elevatorSim | Lib/test/test_dictviews.py | 62 | 7832 | import unittest
from test import support
class DictSetTest(unittest.TestCase):
def test_constructors_not_callable(self):
kt = type({}.keys())
self.assertRaises(TypeError, kt, {})
self.assertRaises(TypeError, kt)
it = type({}.items())
self.assertRaises(TypeError, it, {})
... | bsd-2-clause |
emulbreh/lymph | lymph/utils/event_indexing.py | 1 | 2193 | from __future__ import absolute_import
from datetime import (date, datetime)
import logging
import six
import uuid
logger = logging.getLogger(__name__)
class EventIndex(object):
def __init__(self, es, index_name='events'):
self.es = es
self.index_name = index_name
def prepare_object(self, d... | apache-2.0 |
AkademieOlympia/sympy | sympy/integrals/quadrature.py | 69 | 14562 | from __future__ import print_function, division
from sympy.core import S, Dummy, pi
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.trigonometric import sin, cos
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.special.gamma_functions import ... | bsd-3-clause |
workey-co/python-twitter | twitter/__init__.py | 1 | 1212 | #!/usr/bin/env python
#
# vim: sw=2 ts=2 sts=2
#
# Copyright 2007 The Python-Twitter Developers
#
# 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-... | apache-2.0 |
Zagrebelin/django-project-template | app/settings/base.py | 1 | 2789 | """
Django settings for {{ project_name }} project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_D... | apache-2.0 |
migue/voltdb | lib/python/voltcli/runner.py | 1 | 29804 | # This file is part of VoltDB.
# Copyright (C) 2008-2017 VoltDB Inc.
#
# 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 the
# License, or (at your option) any later ver... | agpl-3.0 |
OmkarPathak/Python-Programs | CompetitiveProgramming/CodeChef/P01_CIELAB.py | 1 | 1397 | # In Ciel's restaurant, a waiter is training. Since the waiter isn't good at arithmetic,
# sometimes he gives guests wrong change. Ciel gives him a simple problem. What is A-B (A minus B) ?
#
# Surprisingly, his answer is wrong. To be more precise, his answer has exactly one wrong digit.
# Can you imagine this? Can you... | gpl-3.0 |
palladius/gcloud | packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/ssh_keys_test.py | 1 | 4765 | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | gpl-3.0 |
bb111189/Arky2 | web/tests.py | 14 | 3392 | '''
Run the tests using testrunner.py script in the project root directory.
Usage: testrunner.py SDK_PATH TEST_PATH
Run unit tests for App Engine apps.
SDK_PATH Path to the SDK installation
TEST_PATH Path to package containing test modules
Options:
-h, --help show this help message and exit
'''
import unitt... | lgpl-3.0 |
Stratoscale/dirbalak | py/dirbalak/server/scriptologresource.py | 1 | 1385 | from twisted.web import resource
from dirbalak import scriptolog
class ScriptologResource(resource.Resource):
def __init__(self, multiverse):
self._multiverse = multiverse
resource.Resource.__init__(self)
def getChild(self, path, request):
return _Scriptolog(self._multiverse, path)
... | apache-2.0 |
eykd/Dyce | dyce/yapps/grammar.py | 42 | 8821 | # grammar.py, part of Yapps 2 - yet another python parser system
# Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu>
#
# This version of the Yapps 2 grammar can be distributed under the
# terms of the MIT open source license, either found in the LICENSE
# file included with the Yapps distribution
# <http://t... | mit |
calumk/ROS-Blocks | ros_blocks/scripts/ros_blocks_basilisk.py | 1 | 4947 | #!/usr/bin/env python
import sys
import rospy
import cv
import cv2
import numpy as np
import baxter_interface
import baxter_external_devices
import os
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import argparse
parser = argparse.ArgumentParser()
pars... | mit |
assamite/creamas | creamas/vote.py | 1 | 19988 | """
.. py:module:: vote
:platform: Unix
Implementations for voting and other social choice behaviors.
Holds basic implementations for:
* :class:`~creamas.vote.VoteAgent`: An agent implementing functions needed
for voting
* :class:`~creamas.vote.VoteEnvironment`: An environment holding basic
v... | gpl-2.0 |
ctbarna/cellar | app/app/admin.py | 1 | 4610 | from functools import update_wrapper
from django.contrib import admin
from django.contrib.admin.apps import AdminConfig
from django.core.exceptions import ImproperlyConfigured
class WineAdminSite(admin.AdminSite):
def get_urls(self):
"""
Most of this is copy/pasted from AdminSite's get_urls metho... | mit |
robbwagoner/ansible-modules-core | cloud/rackspace/rax_identity.py | 150 | 3026 | #!/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 |
alfredodeza/pytest | src/_pytest/doctest.py | 2 | 23055 | """ discover and run doctests in modules and test files."""
import bdb
import inspect
import platform
import sys
import traceback
import warnings
from contextlib import contextmanager
from typing import Dict
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from ty... | mit |
gooddata/openstack-nova | nova/tests/unit/scheduler/filters/test_isolated_hosts_filter.py | 6 | 4630 | # 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 |
mtlchun/edx | common/test/acceptance/tests/studio/test_studio_acid_xblock.py | 25 | 6923 | """
Acceptance tests for Studio related to the acid xblock.
"""
from unittest import skip
from bok_choy.web_app_test import WebAppTest
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.overview import CourseOutlinePage
from ...pages.xblock.acid import AcidView
from ...fixtures.course import Cours... | agpl-3.0 |
CenterForOpenScience/osf.io | osf/management/commands/collect_user_nodes_exceeding_storage_limits.py | 5 | 2702 | from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from django.db.models import Exists, OuterRef
import json
import logging
from tqdm import tqdm
from addons.osfstorage.models import OsfStorageFile
from api.caching.tasks import update_storage_usage_cache
from... | apache-2.0 |
samyoyo/3vilTwinAttacker | Modules/ModuleProbeRequest.py | 3 | 4383 | #The MIT License (MIT)
#Copyright (c) 2015-2016 mh4x0f P0cL4bs Team
#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, mo... | mit |
wuub/micropython-rfsocket | rfsocket.py | 1 | 4613 | #!/usr/bin/env python3
import machine
import utime
def default_remote_id():
"""generate remote id based on machine.unique_id()"""
import uhashlib
from ustruct import unpack
# we compute a hash of board's unique_id, since a boards manufactured
# closely together probably share prefix or suffix, and... | mit |
miurahr/seahub | seahub/base/database_storage/database_storage.py | 5 | 9315 | # DatabaseStorage for django.
# 2011 (c) Mike Mueller <mike@subfocal.net>
# 2009 (c) GameKeeper Gambling Ltd, Ivanov E.
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.core.files.storage import Storage
from django.core.files import File
from django.db import connection, transact... | apache-2.0 |
googleapis/python-compute | google/cloud/compute_v1/services/ssl_certificates/transports/rest.py | 1 | 20505 | # -*- 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 |
angr/claripy | tests/test_smart_join.py | 3 | 1332 | import logging
from claripy.vsa import StridedInterval
l = logging.getLogger("angr_tests")
def check_si_fields(si, stride, lb, ub):
if si.stride != stride:
return False
if si.lower_bound != lb:
return False
if si.upper_bound != ub:
return False
return True
def test_smart_jo... | bsd-2-clause |
OPM/ResInsight | ThirdParty/Ert/python/ecl/util/test/source_enumerator.py | 3 | 1315 | import os
import re
class SourceEnumerator(object):
@classmethod
def removeComments(cls, code_string):
code_string = re.sub(re.compile("/\*.*?\*/",re.DOTALL ) ,"" ,code_string) # remove all occurance streamed comments (/*COMMENT */) from string
code_string = re.sub(re.compile("//.*?\n" ) ,"" ,... | gpl-3.0 |
lavalamp/test-infra | gubernator/update_config.py | 8 | 2488 | #!/usr/bin/env python
# Copyright 2017 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... | apache-2.0 |
TEAM-Gummy/android_kernel_oneplus_msm8974 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
wellesleywatson/INFO3180-lab4-old | lib/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | apache-2.0 |
google/fruit | tests/test_binding_clash.py | 2 | 18786 | #!/usr/bin/env python3
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
yrizk/django-blog | blogvenv/lib/python3.4/site-packages/django/db/backends/oracle/creation.py | 86 | 14210 | import sys
import time
from django.conf import settings
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.utils import DatabaseError
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
... | apache-2.0 |
PPCDroid/external-wpa_supplicant_6 | wpa_supplicant/examples/wpas-test.py | 189 | 2571 | #!/usr/bin/python
import dbus
import sys, os
import time
WPAS_DBUS_SERVICE = "fi.epitest.hostap.WPASupplicant"
WPAS_DBUS_INTERFACE = "fi.epitest.hostap.WPASupplicant"
WPAS_DBUS_OPATH = "/fi/epitest/hostap/WPASupplicant"
WPAS_DBUS_INTERFACES_INTERFACE = "fi.epitest.hostap.WPASupplicant.Interface"
WPAS_DBUS_INTERFACES... | gpl-2.0 |
quantumlib/Stim | glue/cirq/setup.py | 1 | 1191 | # Copyright 2021 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, ... | apache-2.0 |
Neil741/ryu-master | ryu/tests/unit/app/test_wsgi.py | 31 | 3409 | # Copyright (C) 2013 Stratosphere 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 ... | apache-2.0 |
ChrisBird/ardupilot | Tools/autotest/autotest.py | 1 | 38894 | #!/usr/bin/env python
"""
APM automatic test suite
Andrew Tridgell, October 2011
AP_FLAKE8_CLEAN
"""
from __future__ import print_function
import atexit
import fnmatch
import glob
import optparse
import os
import re
import shutil
import signal
import subprocess
import sys
import time
import traceback
from distutils... | gpl-3.0 |
bluestemscott/librarygadget | librarygadget/paypal/standard/models.py | 1 | 15239 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from paypal.standard.helpers import duplicate_txn_id, check_secret
from paypal.standard.conf import RECEIVER_EMAIL, POSTBACK_ENDPOINT, SANDBOX_POSTBACK_ENDPOINT
class PayPalStandardBase(models.Model):
... | mit |
tombstone/models | research/lstm_object_detection/utils/config_util_test.py | 2 | 3986 | # Copyright 2018 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 |
etutionbd/openfire-restapi | ofrestapi/sessions.py | 1 | 1093 | # -*- coding: utf-8 -*-
from requests import (get, delete)
from .base import Base
class Sessions(Base):
def __init__(self, host, secret, endpoint='/plugins/restapi/v1/sessions'):
"""
:param host: Scheme://Host/ for API requests
:param secret: Shared secret key for API requests
:pa... | gpl-3.0 |
Tiotao/morpherpy | env/Lib/site-packages/werkzeug/testsuite/wsgi.py | 99 | 14961 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.wsgi
~~~~~~~~~~~~~~~~~~~~~~~
Tests the WSGI utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from os import path
from contextlib import closing
from werkzeug.testsuite import Werkzeug... | mit |
John-Boik/Principled-Societies-Project | leddaApp/static/brython/src/Lib/test/test_email/test__encoded_words.py | 123 | 6387 | import unittest
from email import _encoded_words as _ew
from email import errors
from test.test_email import TestEmailBase
class TestDecodeQ(TestEmailBase):
def _test(self, source, ex_result, ex_defects=[]):
result, defects = _ew.decode_q(source)
self.assertEqual(result, ex_result)
self.a... | gpl-3.0 |
alpsayin/django-qanda | qanda/qanda_app/migrations/0036_auto__chg_field_question_editDate__chg_field_question_closeDate.py | 1 | 16310 | # -*- 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 'Question.editDate'
db.alter_column('qanda_app_question', 'editDate', self.gf('django.db.m... | mit |
vheon/YouCompleteMe | python/ycm/tests/youcompleteme_test.py | 3 | 1289 | # Copyright (C) 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... | gpl-3.0 |
DennisDenuto/puppet-commonscripts | files/aws_cli/AWS-ElasticBeanstalk-CLI-2.6.3/eb/linux/python2.7/lib/aws/requests/packages/charade/mbcharsetprober.py | 2924 | 3268 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
clarkperkins/readthedocs.org | readthedocs/builds/models.py | 4 | 15137 | import logging
import re
import os.path
from shutil import rmtree
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _, ugettext
from guardian.shortcuts import assign
from taggit.managers import TaggableManag... | mit |
skirsdeda/django-filer | filer/models/mixins.py | 3 | 1066 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.contrib.staticfiles.templatetags.staticfiles import static
from ..settings import FILER_ADMIN_ICON_SIZES
class IconsMixin(object):
"""
Can be used on any model that has a _icon attribute. will return a dict
containing urls for i... | bsd-3-clause |
DatapuntAmsterdam/handelsregister | web/handelsregister/search/build_index.py | 1 | 1493 |
import logging
from django.conf import settings
from datasets.hr.models import MaatschappelijkeActiviteit
from datasets.hr.models import Vestiging
from search import index
from search import documents
log = logging.getLogger(__name__)
HR_DOC_TYPES = [
documents.Inschrijving
]
class ResetHRIndex(index.Rese... | mpl-2.0 |
metral/kubernetes | vendor/github.com/ugorji/go/codec/test.py | 1516 | 4019 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
mbauskar/omnitech-demo-erpnext | erpnext/controllers/item_variant.py | 6 | 6048 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, flt
import json
class ItemVariantExistsError(frappe.ValidationError): pass
class Inva... | agpl-3.0 |
felipebetancur/libvpx | tools/cpplint.py | 104 | 182862 | #!/usr/bin/python
#
# Copyright (c) 2009 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 ... | bsd-3-clause |
RTS2/rts2 | scripts/rts2saf/rts2saf/acquire.py | 3 | 21371 | #!/usr/bin/python
# (C) 2013, Markus Wildi, markus.wildi@bluewin.ch
#
# 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, or (at your option)
# any later version.
#
# Thi... | lgpl-3.0 |
FlorentChamault/My_sickbeard | lib/hachoir_parser/file_system/iso9660.py | 90 | 4966 | """
ISO 9660 (cdrom) file system parser.
Documents:
- Standard ECMA-119 (december 1987)
http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf
Author: Victor Stinner
Creation: 11 july 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt32, ... | gpl-3.0 |
mingwpy/scipy | scipy/linalg/_decomp_polar.py | 97 | 3623 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import svd
__all__ = ['polar']
def polar(a, side="right"):
"""
Compute the polar decomposition.
Returns the factors of the polar decomposition [1]_ `u` and `p` such
that ``a = up`` (if `side` is "... | bsd-3-clause |
flavour/ifrc_qa | modules/templates/NYC/controllers.py | 8 | 27529 | # -*- coding: utf-8 -*-
from gluon import *
from s3 import S3CustomController, S3DataTable, S3Method, s3_request
THEME = "NYC"
# =============================================================================
class index(S3CustomController):
""" Custom Home Page """
def __call__(self):
output = {}
... | mit |
jmhsi/justin_tinker | data_science/courses/learning_dl_packages/models/research/skip_thoughts/skip_thoughts/skip_thoughts_encoder.py | 19 | 8609 | # 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... | apache-2.0 |
harej/requestoid | migrations/0003_auto_20170711_0331.py | 1 | 1236 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-11 03:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('requestoid', '0002_auto_20170702_0108'),
]
operati... | mit |
anakinsolo/backend | Lib/site-packages/setuptools/command/bdist_rpm.py | 1049 | 1508 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | mit |
gspilio/nova | nova/tests/api/openstack/compute/test_flavors.py | 7 | 26378 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | apache-2.0 |
ltilve/ChromiumGStreamerBackend | tools/telemetry/third_party/altgraph/altgraph_tests/test_graphstat.py | 25 | 1919 | import unittest
from altgraph import GraphStat
from altgraph import Graph
import sys
class TestDegreesDist (unittest.TestCase):
def test_simple(self):
a = Graph.Graph()
self.assertEqual(GraphStat.degree_dist(a), [])
a.add_node(1)
a.add_node(2)
a.add_node(3)
self.... | bsd-3-clause |
0-wiz-0/psutil | setup.py | 1 | 9571 | #!/usr/bin/env python
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil is a cross-platform library for retrieving information on
running processes and system utilization (CPU, memory, disks, net... | bsd-3-clause |
browseinfo/odoo_saas3_nicolas | addons/point_of_sale/wizard/__init__.py | 61 | 1327 | # -*- 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... | agpl-3.0 |
SnakeHunt2012/word2vec | post-process/location-exclusion.py | 1 | 9895 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from re import compile
from time import time
from codecs import open
from argparse import ArgumentParser
from itertools import combinations, product
DEBUG_FLAG = False
nationality_list = [
"壮族", "藏族", "裕固族", "彝族", "瑶族", "锡伯族", "乌孜别克族", "维吾尔族", "佤族", "土家族",
"土族", ... | apache-2.0 |
groschovskiy/personfinder | app/pytz/zoneinfo/America/Kentucky/Louisville.py | 9 | 7676 | '''tzinfo timezone information for America/Kentucky/Louisville.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Louisville(DstTzInfo):
'''America/Kentucky/Louisville timezone definition. See datetime.tzinfo for details'''
... | apache-2.0 |
demon-ru/iml-crm | addons/multi_company/__init__.py | 886 | 1054 | # -*- 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... | agpl-3.0 |
dims/neutron | neutron/extensions/quotasv2.py | 4 | 5502 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
cloudnull/ansible-modules-extras | packaging/os/layman.py | 41 | 6970 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Jakub Jirutka <jakub@jirutka.cz>
#
# 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 Lice... | gpl-3.0 |
adamhaney/airflow | airflow/utils/log/file_task_handler.py | 11 | 8847 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
Jgarcia-IAS/SAT | openerp/addons/google_calendar/controllers/main.py | 420 | 3002 | import openerp.addons.web.http as http
from openerp.addons.web.http import request
class google_calendar_controller(http.Controller):
@http.route('/google_calendar/sync_data', type='json', auth='user')
def sync_data(self, arch, fields, model, **kw):
"""
This route/function is called when ... | agpl-3.0 |
Alignak-monitoring/alignak | tests/test_maintenance_period.py | 1 | 4074 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | agpl-3.0 |
SnakeJenny/TensorFlow | tensorflow/compiler/tests/unary_ops_test.py | 7 | 14651 | # 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... | apache-2.0 |
colinligertwood/odoo | addons/website_mail_group/controllers/main.py | 10 | 4236 | # -*- coding: utf-8 -*-
import datetime
from openerp import tools
from openerp.addons.web import http
from openerp.addons.website.models.website import slug
from openerp.addons.web.http import request
class MailGroup(http.Controller):
_thread_per_page = 10
def _get_archives(self, group_id):
MailMes... | agpl-3.0 |
v3ss0n/rietveld | third_party/oauth2client/xsrfutil.py | 230 | 3368 | #!/usr/bin/python2.5
#
# Copyright 2010 the Melange 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 applicable... | apache-2.0 |
40223145c2g18/c2g18 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/_test_warnings.py | 858 | 2304 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... | gpl-2.0 |
jimi-c/ansible | lib/ansible/modules/database/proxysql/proxysql_backend_servers.py | 6 | 17727 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: proxysql_backend_servers
v... | gpl-3.0 |
frankvdp/django | django/contrib/sessions/backends/db.py | 87 | 3770 | import logging
from django.contrib.sessions.backends.base import (
CreateError, SessionBase, UpdateError,
)
from django.core.exceptions import SuspiciousOperation
from django.db import DatabaseError, IntegrityError, router, transaction
from django.utils import timezone
from django.utils.functional import cached_pr... | bsd-3-clause |
v-iam/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/azure_blob_storage_application_logs_config.py | 3 | 1492 | # 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 ... | mit |
HBehrens/feedsanitizer | django/contrib/contenttypes/models.py | 307 | 4052 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the place.
# This cache is shared by all the get_for_* methods.
_cache ... | mit |
cmusatyalab/opendiamond | opendiamond/client/util.py | 1 | 3584 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2017-2018 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF T... | epl-1.0 |
albert-chin/yowsup | yowsup/layers/protocol_iq/layer.py | 19 | 3932 | import time
import logging
from threading import Thread, Lock
from yowsup.layers import YowProtocolLayer, YowLayerEvent, EventCallback
from yowsup.common import YowConstants
from yowsup.layers.network import YowNetworkLayer
from yowsup.layers.auth import YowAuthenticationProtocolLayer
from .protocolentities import *
... | gpl-3.0 |
abusesa/abusehelper | abusehelper/bots/abusech/zeusccbot.py | 1 | 1163 | """
abuse.ch Zeus C&C RSS feed bot.
Maintainer: Lari Huttunen <mit-code@huttu.net>
"""
import re
from abusehelper.core import bot
from . import host_or_ip, resolve_level, split_description, AbuseCHFeedBot
class ZeusCcBot(AbuseCHFeedBot):
feed_malware = "zeus"
feed_type = "c&c"
feed_name = "zeus c&c"
... | mit |
godfather1103/WeiboRobot | python27/1.0/lib/distutils/tests/test_archive_util.py | 44 | 11068 | # -*- coding: utf-8 -*-
"""Tests for distutils.archive_util."""
__revision__ = "$Id$"
import unittest
import os
import sys
import tarfile
from os.path import splitdrive
import warnings
from distutils.archive_util import (check_archive_formats, make_tarball,
make_zipfile, make_archi... | gpl-3.0 |
ifduyue/sentry | src/sentry/interfaces/device.py | 3 | 1418 | from __future__ import absolute_import
__all__ = ('Device', )
from sentry.interfaces.base import Interface, InterfaceValidationError
from sentry.interfaces.schemas import validate_and_default_interface
from sentry.utils.safe import trim, trim_dict
class Device(Interface):
"""
An interface which describes th... | bsd-3-clause |
HiSPARC/topaz | 141128_501_510/download_dataset.py | 1 | 1273 | from datetime import datetime
import tables
from sapphire import download_coincidences, download_data
def download_501_510_dataset():
"""Download a dataset for analysis
"""
print "Downloading 501-510 dataset."
stations = [501, 510]
start = datetime(2014, 10, 1)
end = datetime(2014, 10, 10)... | gpl-3.0 |
nilaydshah/azure-quickstart-templates | application-workloads/jupyter/vm-linux-Jupyterhub/scripts/bootstrap.py | 11 | 6353 | """
Bootstrap an installation of TLJH.
Sets up just enough TLJH environments to invoke tljh.installer.
This script is run as:
curl <script-url> | sudo python3 -
Constraints:
- Entire script should be compatible with Python 3.6 (We run on Ubuntu 18.04+)
- Script should parse in Python 3.4 (since we exit with... | mit |
mionch/django-files-widget | topnotchdev/files_widget/forms/widgets.py | 1 | 3628 | from django import forms
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from topnotchdev.files_widget.conf import *
def use_filebrowser():
if USE_FILEBROWSER:
try:
import filebrowser
retu... | mit |
lz1988/company-site | django/core/serializers/base.py | 33 | 5714 | """
Module for abstract serializer/unserializer base classes.
"""
from django.db import models
from django.utils.encoding import smart_text
from django.utils import six
class SerializerDoesNotExist(KeyError):
"""The requested serializer was not found."""
pass
class SerializationError(Exception):
"""Somet... | bsd-3-clause |
kennethreitz/lplex | logplex/packages/requests/auth.py | 78 | 5531 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .utils import parse_dict_header
log = logging.getLogger(__na... | mit |
klonage/nlt-gcs | packages/IronPython.StdLib.2.7.4/content/Lib/lib2to3/fixes/fix_exitfunc.py | 57 | 2577 | """
Convert use of sys.exitfunc to use the atexit module.
"""
# Author: Benjamin Peterson
from lib2to3 import pytree, fixer_base
from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
class FixExitfunc(fixer_base.BaseFix):
keep_line_order = True
BM_compatible = True
PATTERN... | gpl-3.0 |
ghchinoy/tensorflow | tensorflow/python/kernel_tests/signal/mel_ops_test.py | 13 | 8814 | # 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... | apache-2.0 |
fwiesel/http2broker | src/http2broker/session.py | 1 | 7205 | import nghttp2
import logging
import asyncio
import sys
import os, time, io
from base64 import b64decode
from copy import copy, deepcopy
from .config import get_config
from datetime import timedelta, datetime
from uuid import uuid4 as uuid
from wheezy.template.engine import Engine
from wheezy.template.ext.core import ... | mit |
deepsrijit1105/edx-platform | common/lib/capa/capa/tests/test_capa_problem.py | 2 | 19784 | """
Test capa problem.
"""
import ddt
import textwrap
from lxml import etree
import unittest
from capa.tests.helpers import new_loncapa_problem
@ddt.ddt
class CAPAProblemTest(unittest.TestCase):
""" CAPA problem related tests"""
@ddt.unpack
@ddt.data(
{'question': 'Select the correct synonym of ... | agpl-3.0 |
Danisan/odoo-1 | addons/account/tests/test_account_move_closed_period.py | 127 | 1623 | from datetime import date
from openerp.tests.common import TransactionCase
from openerp.osv.orm import except_orm
class TestPeriodState(TransactionCase):
"""
Forbid creation of Journal Entries for a closed period.
"""
def setUp(self):
super(TestPeriodState, self).setUp()
cr, uid = sel... | agpl-3.0 |
joeshaw/luigi | examples/terasort.py | 59 | 3445 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
kjw0106/GCM_app_server | venv/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py | 357 | 38875 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
stri... | mit |
NikolayDachev/jadm | setup.py | 2 | 1216 | #!/usr/bin/env python2.7
# JADM python build/install setup file
import os
import sys
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "jadm",
version = "1.0",
scripts = ['jadm'],
# install or upgraded on... | bsd-3-clause |
fubecka/f5-dashboard | flask/lib/python2.6/site-packages/dns/e164.py | 52 | 3083 | # Copyright (C) 2006, 2007, 2009, 2011 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.