repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
thesealion/writelightly | writelightly/main.py | 1 | 5266 | import curses
import datetime
import sys
from writelightly.calendar import Calendar
from writelightly.conf import Config
from writelightly.edit import edit_date, get_edits, clean_tmp, show_edits
from writelightly.metadata import Metadata
from writelightly.screen import ScreenManager, TextArea
from writelightly.tags im... | mit |
kellielu/q | lib/werkzeug/debug/tbtools.py | 160 | 18402 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.tbtools
~~~~~~~~~~~~~~~~~~~~~~
This module provides various traceback related utility functions.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import re
import os
import sys
import json
import inspect
import ... | apache-2.0 |
iguzu/gae-django | django/contrib/gis/gdal/libgdal.py | 7 | 2607 | import os, sys
from ctypes import c_char_p, CDLL
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GDAL_LIBRARY_PATH
except (AttributeError, EnvironmentError, ImportError):
lib_pat... | bsd-3-clause |
eliasdesousa/indico | indico/modules/events/papers/models/templates.py | 2 | 2356 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
apollo13/ansible | test/units/module_utils/basic/test_log.py | 120 | 7027 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (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
import syslog
from itertools... | gpl-3.0 |
allofhercats/whiskey | proto/literal_print.py | 1 | 1544 | def get_n_digits(value, base):
n = 0
if value == 0:
return 1
else:
while value > 0:
value //= base
n += 1
return n
def literal_int_to_string(value, base, width = 0, pad = '0', prefix = True):
rtn = ""
if base == 2 and prefix:
rtn = "0b"
elif base == 8 and prefix:
rtn = "0"
elif base == 16 and pr... | mit |
eonpatapon/contrail-controller | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/tests/test_vrouter_netns.py | 13 | 3842 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Cloudwatt
# 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/l... | apache-2.0 |
dims/cinder | cinder/volume/drivers/hitachi/hbsd_horcm.py | 11 | 58096 | # Copyright (C) 2014, 2015, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
DanielSBrown/osf.io | scripts/prereg/migrate_invalid_selectedfiles.py | 16 | 3359 | # -*- coding: utf-8 -*-
"""
Migrates Preregistration drafts with invalid uploader data.
Only migrates unapproved drafts. This will unselect files on questions that have the invalid data.
"""
import sys
import logging
from modularodm import Q
from copy import deepcopy
from framework.transactions.context import TokuTran... | apache-2.0 |
EvanK/ansible | test/units/modules/network/nso/test_nso_show.py | 28 | 4292 | #
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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... | gpl-3.0 |
Krossom/python-for-android | python-build/python-libs/gdata/build/lib/gdata/calendar/__init__.py | 135 | 35183 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | apache-2.0 |
ygol/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/paramiko/util.py | 33 | 9730 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (a... | mit |
ngageoint/scale | scale/scale/settings.py | 1 | 14209 | """
Django settings for scale_test project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import scale
import sys
import dj_database_url
def get_env... | apache-2.0 |
mhbu50/erpnext | erpnext/projects/report/project_profitability/test_project_profitability.py | 2 | 2976 | from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import getdate, nowdate, add_days
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.projects.doctype.timesheet.test_timesheet import make_salary_structure_for_timesheet, make_timesheet
from erpnext.pro... | gpl-3.0 |
TeamADEA/Hunger_Games | HG_Code/Model.py | 1 | 7064 | import numpy as np
import copy
import time
from Kat import Kat
from Visualize import Visualizer
from SimManager import sim_manager
from hg_settings import *
from Hunger_Grid import hunger_grid
import sys
import os
STEP_SIZE = 10 # 0 = only last frame,
# 1 = every frame,
# N = every N ... | mit |
chapware/aircrack | scripts/airdrop-ng/install.py | 1 | 3800 | #!/usr/bin/env python
__version__ = "1.13.2010.21:00"
__author__ = "Bryan Chapman <bryanwchapman@gmail.com>"
'''
This is the installer file for airdrop-ng. It first checks for
different dependancies, such as make, svn, etc.
'''
import os, sys
from shutil import rmtree
if os.geteuid() != 0:
print "Installer must b... | gpl-2.0 |
ayr-ton/ansible-modules-extras | packaging/os/openbsd_pkg.py | 59 | 14137 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrik Lundin <patrik@sigterm.se>
#
# 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 Lic... | gpl-3.0 |
joker946/nova | nova/tests/unit/api/openstack/compute/contrib/test_used_limits.py | 7 | 10494 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/sanitizer.py | 328 | 25112 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from pip._vendor.six.moves import urllib_parse as urlparse
from . import base
from ..constants import namespaces, prefixes
__all__ = ["Filter"]
allowed_elements = frozenset((
(namespaces[... | gpl-2.0 |
jbedorf/tensorflow | tensorflow/contrib/cudnn_rnn/python/kernel_tests/cudnn_rnn_ops_benchmark.py | 43 | 6698 | # 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 |
ScottBuchanan/eden | modules/s3log.py | 17 | 11312 | # -*- coding: utf-8 -*-
""" S3 Logging Facility
@copyright: (c) 2015 Sahana Software Foundation
@license: MIT
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
rest... | mit |
ppries/tensorflow | tensorflow/contrib/framework/python/ops/variables.py | 1 | 25287 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
stanlyxiang/incubator-hawq | tools/bin/ext/yaml/resolver.py | 120 | 8921 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... | apache-2.0 |
jason406/MissionPlanner | ExtLibs/Mavlink/pymavlink/generator/mavgen_csharp.py | 8 | 15126 | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a C# implementation
Copyright Michael Oborne 2016
Released under GNU GPL version 3 or later
'''
import sys, textwrap, os, time, re
from . import mavparse, mavtemplate
t = mavtemplate.MAVTemplate()
enumtypes = {}
def generat... | gpl-3.0 |
bswartz/cinder | cinder/tests/unit/zonemanager/test_brcd_http_fc_zone_client.py | 6 | 26929 | # (c) Copyright 2016 Brocade Communications Systems 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/LICEN... | apache-2.0 |
brandond/ansible | lib/ansible/modules/cloud/amazon/redshift_cross_region_snapshots.py | 42 | 6938 | #!/usr/bin/python
# Copyright: (c) 2018, JR Kerkstra <jrkerkstra@example.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMEN... | gpl-3.0 |
zhangkun456/TeamTalk | win-client/3rdParty/src/json/devtools/batchbuild.py | 132 | 11585 | import collections
import itertools
import json
import os
import os.path
import re
import shutil
import string
import subprocess
import sys
import cgi
class BuildDesc:
def __init__(self, prepend_envs=None, variables=None, build_type=None, generator=None):
self.prepend_envs = prepend_envs or [] # [ { "var":... | apache-2.0 |
Daniel-Brosnan-Blazquez/DIT-100 | debugging/trajectory_planning_profiles/trapezoidal-profile.py | 1 | 7690 | import numpy
import time
from matplotlib import pyplot
def main (params):
angle = params['p0']
vel = params['v0']
sign = params['sign']
# Plan the trajectory if it is not planned
T = 0
Ta = 0
Td = 0 ... | gpl-3.0 |
WebSpider/SickRage | tornado/test/auth_test.py | 60 | 18885 | # These tests do not currently do much to verify the correct implementation
# of the openid/oauth protocols, they just exercise the major code paths
# and ensure that it doesn't blow up (e.g. with unicode/bytes issues in
# python 3)
from __future__ import absolute_import, division, print_function, with_statement
from... | gpl-3.0 |
anki1909/peach | peach/__init__.py | 6 | 1551 | # -*- coding: utf-8 -*-
################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: __init__.py
# Makes the peach directory a package and initializes it.
###########################################################... | lgpl-2.1 |
EnEff-BIM/EnEffBIM-Framework | SimModel_Python_API/simmodel_swig/Release/SimAppObjNameDefault_Space_Space.py | 1 | 8853 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | mit |
cgar/servo | components/script/dom/bindings/codegen/parser/WebIDL.py | 50 | 268831 | # 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/.
""" A WebIDL parser. """
from ply import lex, yacc
import re
import os
import traceback
import math
import string
from ... | mpl-2.0 |
tianzhihen/python-mode | pymode/libs3/rope/refactor/functionutils.py | 79 | 8500 | import rope.base.exceptions
import rope.base.pyobjects
from rope.base.builtins import Lambda
from rope.base import worder
class DefinitionInfo(object):
def __init__(self, function_name, is_method, args_with_defaults,
args_arg, keywords_arg):
self.function_name = function_name
sel... | lgpl-3.0 |
sitsbeyou/Misago | misago/threads/models/event.py | 8 | 1208 | from django.db import models
from django.utils import timezone
from misago.conf import settings
from misago.threads import threadtypes
from misago.threads.checksums import is_event_valid
class Event(models.Model):
forum = models.ForeignKey('misago_forums.Forum')
thread = models.ForeignKey('Thread')
auth... | gpl-2.0 |
NL66278/OCB | addons/share/ir_model.py | 439 | 2272 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 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 |
Bysmyyr/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py | 6 | 61087 | # 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 ... | bsd-3-clause |
meredith-digops/ansible | lib/ansible/errors/yaml_strings.py | 145 | 3816 | # (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 |
KingJiangNet/boo | lib/antlr-2.7.5/examples/python/multiParser/multiparser.py | 21 | 1268 |
import sys
import traceback
import antlr
import SimpleLexer
import SimpleParser
import SimpleParser2
lexer = None
parser = None
parser2 = None
class Main:
global lexer, parser, parser2
def __init__(self):
try:
lexer = SimpleLexer.Lexer(sys.stdin);
# Invoke first parser
... | bsd-3-clause |
allmende/synnefo | snf-cyclades-app/synnefo/userdata/asn1.py | 10 | 5169 | # ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associa... | gpl-3.0 |
sdeepanshu02/microblog | flask/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## 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... | bsd-3-clause |
MRigal/django | django/conf/locale/en_GB/formats.py | 504 | 2117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oc... | bsd-3-clause |
kewisch/bedrock | bedrock/mozorg/tests/test_helper_download_buttons.py | 2 | 19551 | # 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 django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_se... | mpl-2.0 |
loulich/Couchpotato | libs/html5lib/tokenizer.py | 1710 | 76929 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... | gpl-3.0 |
Oreder/PythonSelfStudy | Exe_18.py | 1 | 8002 | # Creating class
#
# +++ Syntax +++
# class ClassName:
# 'Optional class documentation string'
# class_suite
#
class Employee:
'common base class for all employees'
empCount = 0
def __init__(self, name, salary):
self.name = name
self.salary = salary
Employee.empCount += 1
... | mit |
mavenlin/tensorflow | tensorflow/python/util/tf_inspect.py | 48 | 4988 | # 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 |
TheTeaRex/cmpe281_mongoserver | node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | gpl-2.0 |
ess-dmsc/do-ess-data-simulator | DonkiPlayer/DonkiOrchestraLib.py | 1 | 7360 | import zmq
import traceback
import socket
import time
class CommunicationClass:
def __init__(self, name='director'):
self.context = zmq.Context()
self.poller = zmq.Poller()
self.pub_sock = None
self.sub_socks = {}
self.pub_tag = name
#
self.create_pub_socket(... | bsd-2-clause |
stscieisenhamer/pyqtgraph | pyqtgraph/parametertree/SystemSolver.py | 21 | 16214 | from collections import OrderedDict
import numpy as np
class SystemSolver(object):
"""
This abstract class is used to formalize and manage user interaction with a
complex system of equations (related to "constraint satisfaction problems").
It is often the case that devices must be controlled
throu... | mit |
iivic/BoiseStateX | lms/djangoapps/instructor_task/subtasks.py | 53 | 27519 | """
This module contains celery task functions for handling the management of subtasks.
"""
from time import time
import json
from uuid import uuid4
import psutil
from contextlib import contextmanager
import logging
from celery.states import SUCCESS, READY_STATES, RETRY
import dogstats_wrapper as dog_stats_api
from d... | agpl-3.0 |
abdoosh00/edx-platform | cms/djangoapps/contentstore/views/tabs.py | 22 | 7923 | """
Views related to course tabs
"""
from access import has_course_access
from util.json_request import expect_json, JsonResponse
from django.http import HttpResponseNotFound
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
f... | agpl-3.0 |
matmutant/sl4a | python/src/Lib/warnings.py | 62 | 14173 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
import types
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_war... | apache-2.0 |
sgzsh269/django | django/contrib/gis/serializers/geojson.py | 31 | 2876 | from __future__ import unicode_literals
from django.contrib.gis.gdal import HAS_GDAL
from django.core.serializers.base import SerializerDoesNotExist
from django.core.serializers.json import Serializer as JSONSerializer
if HAS_GDAL:
from django.contrib.gis.gdal import CoordTransform, SpatialReference
class Seria... | bsd-3-clause |
ragupta-git/ImcSdk | imcsdk/mometa/storage/StorageFlexFlashVirtualDrive.py | 1 | 7941 | """This module contains the general information for StorageFlexFlashVirtualDrive ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class StorageFlexFlashVirtualDriveConsts:
ADMIN_ACTION_DISABLE_VD = "disable-vd"
ADMIN_ACT... | apache-2.0 |
chenxj92/love-connect | node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
freedomtan/tensorflow | tensorflow/python/data/experimental/benchmarks/matching_files_benchmark.py | 16 | 3397 | # 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 |
akvo/akvo-rsr | akvo/rsr/migrations/0083_auto_20160816_0950.py | 1 | 40544 | # -*- coding: utf-8 -*-
from django.db import models, migrations
import akvo.rsr.fields
class Migration(migrations.Migration):
dependencies = [
('rsr', '0082_auto_20160811_1633'),
]
operations = [
migrations.AlterModelOptions(
name='indicator',
options={'orderin... | agpl-3.0 |
alxgu/ansible | lib/ansible/modules/network/f5/bigiq_device_discovery.py | 15 | 39256 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
CouchPotato/CouchPotatoV1 | library/sqlalchemy/ext/sqlsoup.py | 17 | 20823 | """
Introduction
============
SqlSoup provides a convenient way to access existing database tables without
having to declare table or mapper classes ahead of time. It is built on top of
the SQLAlchemy ORM and provides a super-minimalistic interface to an existing
database.
SqlSoup effectively provides a coarse graine... | gpl-3.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/gdk-pixbuf/package.py | 5 | 2384 | ##############################################################################
# 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 |
gpeden/ynab-enhanced | lib/kango-framework-latest/kango/builders/__init__.py | 11 | 2365 | import os
import codecs
import json
from abc import ABCMeta, abstractmethod
from kango.utils import replace_file_content
class ExtensionBuilderBase(object):
__metaclass__ = ABCMeta
key = ''
package_extension = ''
has_native_require = False
DEFAULT_CONTENT_SCRIPTS_MATCHES = ['http:/... | mit |
joshwalawender/POCS | pocs/tests/test_constraints.py | 2 | 5009 | import pytest
import yaml
from astroplan import Observer
from astropy import units as u
from astropy.coordinates import EarthLocation
from astropy.coordinates import get_moon
from astropy.time import Time
from pocs.scheduler.field import Field
from pocs.scheduler.observation import Observation
from pocs.scheduler.co... | mit |
ErnieAllen/qpid-dispatch | tests/system_tests_protocol_settings.py | 1 | 16207 | #
# 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... | apache-2.0 |
aprefontaine/TMScheduler | tests/field_db_conversion.py | 35 | 3365 | from .testmodels import FieldsWithoutOptionsModel
from django.test import TestCase
from google.appengine.api.datastore import Get
from google.appengine.ext.db import Key
from google.appengine.api.datastore_types import Text, Category, Email, Link, \
PhoneNumber, PostalAddress, Text, Blob, ByteString, GeoPt, IM, Key... | bsd-3-clause |
samuel1208/scikit-learn | sklearn/tests/test_pipeline.py | 162 | 14875 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn... | bsd-3-clause |
lmazuel/ansible | lib/ansible/plugins/action/ce.py | 7 | 5476 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
837468220/python-for-android | python-modules/zope/zope/interface/tests/test_sorting.py | 50 | 1398 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | apache-2.0 |
acressity/acressity | narratives/forms.py | 1 | 2019 | from datetime import date
from django import forms
from narratives.models import Narrative
from django.forms.extras.widgets import SelectDateWidget
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.http import HttpResponse
from django.core.exceptions import Permissio... | gpl-3.0 |
rigetticomputing/grove | grove/tomography/state_tomography.py | 1 | 11664 | ##############################################################################
# Copyright 2017-2018 Rigetti Computing
#
# 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... | apache-2.0 |
40423209/2016fallcadp_bg9 | plugin/liquid_tags/video.py | 296 | 2360 | """
Video Tag
---------
This implements a Liquid-style video tag for Pelican,
based on the octopress video tag [1]_
Syntax
------
{% video url/to/video [width height] [url/to/poster] %}
Example
-------
{% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %}
Output
------
<video width='720' hei... | agpl-3.0 |
vberaudi/scipy | scipy/io/tests/test_idl.py | 38 | 19231 | from __future__ import division, print_function, absolute_import
from os import path
from warnings import catch_warnings
DATA_PATH = path.join(path.dirname(__file__), 'data')
import numpy as np
from numpy.testing import (assert_equal, assert_array_equal, run_module_suite,
assert_)
from scipy.io.idl import reads... | bsd-3-clause |
mjwtom/swift | test/unit/common/test_internal_client.py | 5 | 56807 | # Copyright (c) 2010-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 agree... | apache-2.0 |
Adenilson/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | mpl-2.0 |
ecohealthalliance/eidr-connect | .scripts/utils.py | 1 | 1603 | import re
import requests
import os
import functools
import json
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache
GRITS_URL = os.environ.get("GRITS_URL", "https://grits.eha.io")
def clean(s):
return re.sub(r"\s+", " ", s).strip()
def clean_di... | apache-2.0 |
TheBraveWarrior/pyload | module/lib/jinja2/filters.py | 64 | 21750 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import imap, groupby
from jinja2.... | gpl-3.0 |
buptlsl/django-rest-framework | tests/test_serializer_lists.py | 55 | 9552 | from django.utils.datastructures import MultiValueDict
from rest_framework import serializers
class BasicObject:
"""
A mock object for testing serializer save behavior.
"""
def __init__(self, **kwargs):
self._data = kwargs
for key, value in kwargs.items():
setattr(self, ke... | bsd-2-clause |
kevin-intel/scikit-learn | sklearn/datasets/_openml.py | 2 | 34451 | import gzip
import json
import os
import shutil
import hashlib
from os.path import join
from warnings import warn
from contextlib import closing
from functools import wraps
from typing import Callable, Optional, Dict, Tuple, List, Any, Union
import itertools
from collections.abc import Generator
from collections import... | bsd-3-clause |
kingofsystem/django-allauth | allauth/socialaccount/providers/vk/views.py | 64 | 1886 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import VKProvider
USER_FIELDS = ['first_name',
... | mit |
javiergarmon/Linux3188 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
kaedroho/django | django/core/checks/security/base.py | 20 | 7404 | from django.conf import settings
from .. import Error, Tags, Warning, register
REFERRER_POLICY_VALUES = {
'no-referrer', 'no-referrer-when-downgrade', 'origin',
'origin-when-cross-origin', 'same-origin', 'strict-origin',
'strict-origin-when-cross-origin', 'unsafe-url',
}
SECRET_KEY_MIN_LENGTH = 50
SECRET... | bsd-3-clause |
kkouer/PcGcs | Lib/encodings/iso8859_8.py | 593 | 11292 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | gpl-3.0 |
tiborsimko/invenio-records-restapi | invenio_records_rest/serializers/response.py | 2 | 2527 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Serialization response factories.
Responsible for creating a HTTP response given ... | gpl-2.0 |
vlw/Kernel_MSM8916_Samsung | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
yoazmenda/Hearthstone_deck_builder | run_games.py | 1 | 1724 | import json
from hearthbreaker.agents.basic_agents import RandomAgent
from hearthbreaker.cards.heroes import hero_for_class
from hearthbreaker.constants import CHARACTER_CLASS
from hearthbreaker.engine import Game, Deck, card_lookup
from hearthbreaker.cards import *
import timeit
def load_deck(filename):
cards = ... | mit |
goldcoin/gldcoin | BuildDeps/deps/boost/tools/build/v2/test/project_root_constants.py | 15 | 1438 | #!/usr/bin/python
# Copyright 2003, 2004, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
import string
# Create a temporary working directory.
t = BoostBuild.Tester()
# Create the ... | mit |
byterom/android_external_chromium_org | chrome/common/extensions/docs/server2/persistent_object_store_test.py | 117 | 1737 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from persistent_object_store import PersistentObjectStore
import unittest
class PersistentObjectStoreTest(unittest.TestCase):
'''Tes... | bsd-3-clause |
coolbombom/CouchPotatoServer | libs/pyutil/test/out_of_shape/test_zlibutil.py | 106 | 3283 | #!/usr/bin/env python
import unittest
from pyutil import randutil
from pyutil import zlibutil
class Accumulator:
def __init__(self):
self.buf = ''
def write(self, str):
self.buf += str
def make_decomp(realdecomp):
def decomp(str, maxlen, maxmem):
d = Accumulator()
reald... | gpl-3.0 |
EvanzzzZ/mxnet | python/mxnet/profiler.py | 15 | 1375 | # coding: utf-8
# pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, too-many-lines
# pylint: disable=too-many-branches, too-many-statements
"""Profiler setting methods."""
from __future__ import absolute_import
import ctypes
from .base import _LIB, check_call, c_str
def profiler_set_config(mod... | apache-2.0 |
so3500/volttron-kafka | CloudAgent/cloudagent/agent.py | 1 | 19234 | import datetime
import logging
import os
import sys
import datetime
import json
from dateutil.parser import parse
import multiprocessing
import ast
import random
# cloud
from pymongo import MongoClient
# kafka
from kafka import KafkaConsumer, KafkaProducer
from kafka.errors import KafkaError
from volttron.platform.v... | mit |
donlorenzo/AdvancedConfigParser | src/AdvancedConfigParser.py | 1 | 17728 | # -*- coding: utf-8 -*-
# Copyright (c) 2010, 2014 Lorenz Quack
# This code is released under the MIT License:
# 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 ... | mit |
keesdewit82/LasVegasCoin | qa/rpc-tests/getblocktemplate_proposals.py | 151 | 6294 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCExce... | mit |
Workday/OpenFrame | third_party/closure_linter/closure_linter/runner_test.py | 129 | 2855 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#
#... | bsd-3-clause |
rmanoni/mi-instrument | mi/instrument/kut/ek60/ooicore/driver.py | 1 | 39253 | """
@package mi.instrument.kut.ek60.ooicore.driver
@file /mi/instrument/kut/ek60/ooicore/driver.py
@author Richard Han
@brief Driver for the ooicore
Release notes:
This Driver supports the Kongsberg UnderWater Technology's EK60 Instrument.
"""
__author__ = 'Richard Han & Craig Risien'
__license__ = 'Apache 2.0'
impo... | bsd-2-clause |
Mickey32111/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/GetGymDetailsMessage_pb2.py | 10 | 4566 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/GetGymDetailsMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mes... | mit |
mo-g/iris | lib/iris/analysis/_interpolation.py | 6 | 26725 | # (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
beni55/sympy | sympy/polys/domains/realfield.py | 17 | 3563 | """Implementation of :class:`RealField` class. """
from __future__ import print_function, division
import math
from sympy.polys.domains.field import Field
from sympy.polys.domains.simpledomain import SimpleDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.domains.mpelement... | bsd-3-clause |
invisiblek/python-for-android | sl4atools/fullscreenwrapper2/examples/fullscreenwrapper2demo/fullscreenwrapper2.py | 91 | 26101 | '''
Created on Jul 19, 2012
@author: Hariharan Srinath
'''
import abc
#import android
import cPickle
import json
import sys
import time
import os
import hashlib
class BaseDict(dict):
'''
implements a dictionary that can be accessed by BaseDict[key] as well as by BaseDict.key to allow more pyth... | apache-2.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/viu.py | 25 | 8923 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_kwargs,
compat_str,
)
from ..utils import (
ExtractorError,
int_or_none,
)
class ViuBaseIE(InfoExtractor):
def _real_initialize(self):
viu_auth_res = self._re... | gpl-3.0 |
balloob/home-assistant | homeassistant/components/itunes/media_player.py | 14 | 15733 | """Support for interfacing to iTunes API."""
import requests
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
MEDIA_TYPE_PLAYLIST,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
... | apache-2.0 |
rentongzhang/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_extensions.py | 413 | 16128 | #!/usr/bin/env python
#
# Copyright 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... | mpl-2.0 |
EmbodiedCognition/pagoda | pagoda/physics.py | 1 | 47156 | '''This module contains convenience wrappers for ODE objects.'''
from __future__ import division
import collections
import numpy as np
import ode
BodyState = collections.namedtuple(
'BodyState', 'name position quaternion linear_velocity angular_velocity')
class Registrar(type):
'''A metaclass that builds ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.