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 |
|---|---|---|---|---|---|
iandees/all-the-places | locations/spiders/elpolloloco.py | 1 | 2496 | import scrapy
import re
from locations.items import GeojsonPointItem
class ElPolloLocoSpider(scrapy.Spider):
name = "elpolloloco"
allowed_domains = ["www.elpolloloco.com"]
start_urls = (
'https://www.elpolloloco.com/locations/all-locations.html',
)
def parse_stores(self, response):
... | mit |
daeilkim/refinery | refinery/refinery/data/models.py | 1 | 10950 | # models.py contains code for defining the user object and behavior which will be used throughout the site
from refinery import db, app
import datetime
from refinery.webapp.pubsub import msgServer
from collections import defaultdict
import random,os,re,codecs
from collections import defaultdict
import pickle
# Defi... | mit |
AuyaJackie/odoo | addons/hr_evaluation/__init__.py | 432 | 1084 | # -*- encoding: 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 G... | agpl-3.0 |
cloudartisan/jarvis | streams.py | 1 | 3192 | #!/usr/bin/env python
import time
import StringIO
from threading import Thread
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
import cv2
import numpy
from PIL import Image
class DummyStream:
def __init__(self):
self.stopped = False
self._fr... | apache-2.0 |
mexicancoin/MXNCore | qa/rpc-tests/decodescript.py | 45 | 13645 | #!/usr/bin/env python2
# Copyright (c) 2015 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.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_fra... | mit |
benklaasen/namebench | nb_third_party/jinja2/loaders.py | 280 | 16242 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
try:
from hashlib import sha1
except Imp... | apache-2.0 |
pmillerchip/firejail | contrib/fjclip.py | 1 | 1239 | #!/usr/bin/env python
import re
import sys
import subprocess
import fjdisplay
usage = """fjclip.py src dest. src or dest can be named firejails or - for stdin or stdout.
firemon --x11 to see available running x11 firejails. firejail names can be shortened
to least ambiguous. for example 'work-libreoffice' can be shor... | gpl-2.0 |
tiggerntatie/ggame-tutorials | tutorial3.py | 1 | 1622 | """
tutorial3.py
by E. Dennison
"""
from ggame import App, RectangleAsset, ImageAsset, SoundAsset
from ggame import LineStyle, Color, Sprite, Sound
myapp = App()
# define colors and line style
green = Color(0x00ff00, 1)
black = Color(0, 1)
noline = LineStyle(0, black)
# a rectangle asset and sprite to use as backgroun... | mit |
kalikaneko/bitmask-dev | src/leap/bitmask/bonafide/_srp.py | 1 | 4517 | # -*- coding: utf-8 -*-
# _srp.py
# Copyright (C) 2015 LEAP
#
# 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-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_nat_gateways_operations.py | 1 | 26826 | # 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 |
PanDAWMS/autopyfactory | autopyfactory/plugins/queue/batchsubmit/CondorSSH.py | 1 | 6343 | #!/bin/env python
#
# AutoPyfactory batch plugin for Condor
#
#
# At init
# - confirm bosco local exists
# - get paths for auth tokens
#At submit
# -check if cluster is added to bosco
# -if not,
# get lock
# cp files
# add cluster
# test bosco
# - do submit
# 1) create ~/.ssh/bosco_key.rsa ~/.ssh/bosco_k... | apache-2.0 |
MarkusHackspacher/unknown-horizons | horizons/ai/aiplayer/internationaltrademanager.py | 1 | 7150 | # ###################################################
# Copyright (C) 2008-2017 The Unknown Horizons Team
# team@unknown-horizons.org
# This file is part of Unknown Horizons.
#
# Unknown Horizons is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | gpl-2.0 |
HoracioAlvarado/fwd | venv/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 536 | 2616 | from __future__ import absolute_import
import os
import time
from . import (LockBase, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# super(Symlin... | mit |
fevxie/odoo | addons/anonymization/__openerp__.py | 260 | 2129 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
fermat618/pida | tests/core/test_languages_extern.py | 1 | 4614 | import os
#from pida.core.doctype import DocType
#from pida.core.testing import test, assert_equal, assert_notequal
from pida.utils.languages import OutlineItem, ValidationError, Definition, \
Suggestion, Documentation
from pida.core.languages import (Validator, Outliner, External, JobServer,
ExternalProxy,
... | gpl-2.0 |
dokipen/trac | trac/mimeview/patch.py | 1 | 12980 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribu... | bsd-3-clause |
ishay2b/tensorflow | tensorflow/python/ops/distributions/categorical.py | 40 | 11952 | # 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 |
louiskun/flaskGIT | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
PrincetonUniversity/pywsse | wsse/server/django/tests/test_store.py | 1 | 1594 | # wsse/server/django/tests/test_store.py
# coding=utf-8
# pywsse
# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso
# Date: September 1st, 2016
# Description: Test the Django database store.
from django.test import TransactionTestCase
from wsse.server.default.tests import test_store
from wss... | lgpl-3.0 |
DMSC-Instrument-Data/lewis | src/lewis/devices/julabo/interfaces/julabo_stream_interface_2.py | 2 | 3544 | # -*- coding: utf-8 -*-
# *********************************************************************
# lewis - a library for creating hardware device simulators
# Copyright (C) 2016-2017 European Spallation Source ERIC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
huzq/scikit-learn | examples/applications/plot_outlier_detection_wine.py | 17 | 5819 | """
====================================
Outlier detection on a real data set
====================================
This example illustrates the need for robust covariance estimation
on a real data set. It is useful both for outlier detection and for
a better understanding of the data structure.
We selected two sets o... | bsd-3-clause |
nhicher/ansible | lib/ansible/plugins/action/wait_for_connection.py | 17 | 4571 | # (c) 2017, Dag Wieers <dag@wieers.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 later version.
#
... | gpl-3.0 |
caveman-dick/ansible | lib/ansible/modules/cloud/cloudstack/cs_sshkeypair.py | 46 | 8957 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 |
bbannier/ROOT | geom/gdml/writer.py | 11 | 11603 | # @(#)root/gdml:$Id$
# Author: Witold Pokorski 05/06/2006
# This is the application-independent part of the GDML 'writer' implementation.
# It contains the 'writeFile' method (at the end of the file) which does the actual
# formating and writing out of the GDML file as well as the specialized 'add-element'
# methods ... | lgpl-2.1 |
RobinQuetin/CAIRIS-web | cairis/cairis/templates/index.mako.py | 1 | 12146 | # -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1430001119.798419
_enable_loop = True
_template_filename = '/home/TChosenOne/Documents/CAIRIS-web/cairis/cairis/templates/index.mako'
_tem... | apache-2.0 |
jptomo/rpython-lang-scheme | rpython/rtyper/module/test/test_ll_os_path.py | 1 | 1610 | import py
import sys, os
from rpython.rtyper.lltypesystem.module.ll_os_path import Implementation as impl
from rpython.rtyper.test.test_llinterp import interpret
from rpython.tool.udir import udir
def test_exists():
filename = impl.to_rstr(str(py.path.local(__file__)))
assert impl.ll_os_path_exists(filename... | mit |
dienerpiske/Sabia | SabiaApp/retry.py | 2 | 1895 | ############################################
# The following peice of code is shamelessly yanked from
# http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
# Retry decorator with exponential backoff
import time
from functools import wraps
def retry(ExceptionToCheck, tries=4, delay=3, bac... | gpl-2.0 |
wbwseeker/spaCy | examples/pos_tag.py | 3 | 2720 | '''Print part-of-speech tagged, true-cased, (very roughly) sentence-separated
text, with each "sentence" on a newline, and spaces between tokens. Supports
multi-processing.
'''
from __future__ import print_function, unicode_literals, division
import io
import bz2
import logging
from toolz import partition
from os impor... | mit |
edx/edx-platform | openedx/core/djangoapps/enrollments/tests/test_services.py | 4 | 8132 | """
Enrollments Service Tests
"""
import ddt
from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.tests.factories import UserFactory
from ope... | agpl-3.0 |
gabrieldamaso7/innocircle | node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
sirkubax/ansible | contrib/inventory/abiquo.py | 128 | 8957 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
External inventory script for Abiquo
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Abiquo API
Requires some python libraries, ensure ... | gpl-3.0 |
vo1dz777/android_kernel_samsung_manta | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
2ndy/RaspIM | usr/lib/python2.7/encodings/punycode.py | 586 | 6813 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... | gpl-2.0 |
blacklin/kbengine | kbe/res/scripts/common/Lib/idlelib/ObjectBrowser.py | 86 | 3975 | # XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - more doc strings
# - tooltips
# object browser
# XXX TO DO:
# - for classes/modules, add "open source" to object browser
import re
from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
from reprlib import Repr
myrepr = Repr()
myrep... | lgpl-3.0 |
Distrotech/intellij-community | python/lib/Lib/site-packages/django/views/generic/date_based.py | 246 | 14025 | import datetime
import time
from django.template import loader, RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.core.xheaders import populate_xheaders
from django.db.models.fields import DateTimeField
from django.http import Http404, HttpResponse
import warnings
warnings.warn(
'Fu... | apache-2.0 |
efortuna/AndroidSDKClone | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_inspect.py | 27 | 33484 | import re
import sys
import types
import unittest
import inspect
import linecache
import datetime
from UserList import UserList
from UserDict import UserDict
from test.test_support import run_unittest, check_py3k_warnings
with check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning),... | apache-2.0 |
pycontw/pycontw2016 | src/users/admin.py | 1 | 1812 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy as _
from .models import User, CocRecord
from .forms import AdminUserChangeForm, UserCreationForm
@admin.register(User)
class UserAdmin(UserAdmin):
fieldsets = (
(
... | mit |
JeanFred/graphite-web | webapp/graphite/browser/views.py | 30 | 7082 | """Copyright 2008 Orbitz WorldWide
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... | apache-2.0 |
DedMemez/ODS-August-2017 | safezone/GameTutorials.py | 1 | 15275 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.safezone.GameTutorials
from panda3d.core import Vec4
from direct.gui.DirectGui import *
from direct.fsm import FSM
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLo... | apache-2.0 |
a1ezzz/wasp-general | wasp_general/cli/curses_commands.py | 1 | 2162 | # -*- coding: utf-8 -*-
# wasp_general/cli/curses_commands.py
#
# Copyright (C) 2016 the wasp-general authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-general.
#
# Wasp-general is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Licens... | lgpl-3.0 |
pablorecio/djangae | djangae/contrib/pagination/paginator.py | 10 | 6915 | from hashlib import md5
from django.conf import settings
from django.db import models
from django.core import paginator
from djangae.contrib.pagination.decorators import _field_name_for_ordering
from django.core.cache import cache
# TODO: it would be nice to be able to define a function which is given the queryset an... | bsd-3-clause |
pombredanne/pdftables | test/test_comb.py | 1 | 1990 | #!/usr/bin/env python
# ScraperWiki Limited
# Ian Hopkinson, 2013-06-17
# -*- coding: utf-8 -*-
"""
comb tests
"""
import sys
sys.path.append('code')
from pdftables import (comb, comb_extend,
comb_from_uppers_and_lowers,
find_minima)
from nose.tools import assert_equal... | bsd-2-clause |
bollu/sagenb | util/quota.py | 10 | 1445 | """
This script determines the users that are using more than a certain amount of disk space and makes them "readonly".
"""
from subprocess import check_output
import os
import sys
SERVERDIR = os.path.abspath(sys.argv[1])
HOMEDIR=os.path.join(SERVERDIR,'home','') # end in /
READONLY_FILE=os.path.join(SERVERDIR, 'reado... | gpl-3.0 |
fenglu-g/incubator-airflow | tests/utils/log/test_es_task_handler.py | 4 | 13148 | # -*- 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 |
srcLurker/home-assistant | tests/test_core.py | 1 | 23404 | """Test to verify that Home Assistant core works."""
# pylint: disable=protected-access
import asyncio
import unittest
from unittest.mock import patch, MagicMock
from datetime import datetime, timedelta
import pytz
import homeassistant.core as ha
from homeassistant.exceptions import InvalidEntityFormatError
from home... | mit |
oshepherd/eforge | eforge/update/twitter/views.py | 1 | 3164 | # -*- coding: utf-8 -*-
# EForge project management system, Copyright © 2010, Element43
#
# Permission to use, copy, modify, and/or distribute this software 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 SOFTWA... | isc |
ScottBuchanan/eden | modules/geopy/geohash.py | 82 | 2525 | from geopy import Point
class Geohash(object):
ENCODE_MAP = '0123456789bcdefghjkmnpqrstuvwxyz'
DECODE_MAP = dict([(char, i) for i, char in enumerate(ENCODE_MAP)])
def __init__(self, point_class=Point, precision=12):
self.point_class = point_class
self.precision = precision
def encode(... | mit |
KhronosGroup/COLLADA-CTS | Core/Gui/Dialog/FBlessedViewerDialog.py | 1 | 11440 | # Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis... | mit |
dimonaks/siman | siman/impurity.py | 1 | 35842 | from __future__ import division, unicode_literals, absolute_import
import ctypes
from tabulate import tabulate
#from ctypes import *
from ctypes import cdll
from ctypes import c_float, byref
import numpy as np
import traceback, os, sys, datetime, glob, copy
from siman import header
from siman.header import print_... | gpl-2.0 |
gorcz/mercurial | mercurial/sslutil.py | 2 | 9966 | # sslutil.py - SSL handling for mercurial
#
# Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
# Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General... | gpl-2.0 |
renard/ansible | test/support/integration/plugins/modules/mysql_user.py | 24 | 31504 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
# 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_functi... | gpl-3.0 |
morreene/tradenews | venv/Lib/site-packages/passlib/handlers/django.py | 5 | 20015 | """passlib.handlers.django- Django password hash support"""
#=============================================================================
# imports
#=============================================================================
# core
from base64 import b64encode
from binascii import hexlify
from hashlib import md5, sh... | bsd-3-clause |
Anislav/Stream-Framework | feedly/storage/redis/timeline_storage.py | 4 | 3808 | from feedly.storage.base import BaseTimelineStorage
from feedly.storage.redis.structures.sorted_set import RedisSortedSetCache
from feedly.storage.redis.connection import get_redis_connection
class TimelineCache(RedisSortedSetCache):
sort_asc = False
class RedisTimelineStorage(BaseTimelineStorage):
def get... | bsd-3-clause |
AnhellO/DAS_Sistemas | Ago-Dic-2017/Luis Estrada/proyecto-scraping/menu.py | 5 | 3296 | import crud
opcion = 10
while (opcion != 0):
print("\n"*25+"¿Qué operación deseas realizar?")
print("1: Ver Banda.")
print("2: Ver Discografía.")
print("3: Ver Miembros.")
print("4: Eliminar Banda(Discografia y Miembros).")
print("5: Actualizar nombre de Banda.")
print("6: Actualizar nombre... | mit |
centaurustech/AnjoMeu | anjo/campaign/migrations/0018_auto__del_field_getpayment_campaign__add_field_getpayment_campaign_c.py | 2 | 5748 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'GetPayment.campaign'
db.delete_column(u'campaign_getpay... | gpl-2.0 |
psistrm12/rpiradio | buttonIO.py | 1 | 2334 | #!/usr/bin/env python
#
# Raspberry Pi input using buttons and rotary encoders
#
# Acknowledgement: This code is a variation oft the Rotary Switch Tutorial by Bob Rathbone.
# See http://www.bobrathbone.com/raspberrypi_rotary.htm for further information!
import RPi.GPIO as GPIO
class PushButton:
BUTTONDOWN = 1
BUT... | gpl-2.0 |
VanBronckhorst/VizProject3 | app/script/genreClusterer.py | 1 | 146599 | __author__ = 'Filippo'
from urllib2 import Request, urlopen, URLError
'''
genresSim = {}
print len(allGenres)
keys= ['CFLBFVAPYPMUYTTSR','QVJX27LZP1Q9GYBYV','45PFVVAQZQJD5BIV5','PKT63BEXLXWEDVVKE','ZTFPNPKXWOQAHAG2G'];
request = Request('http://developer.echonest.com/api/v4/genre/similar?api_key='+keys[0]+'&name=har... | apache-2.0 |
MicroMappers/Pybossa | test/test_stats.py | 3 | 7767 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... | agpl-3.0 |
jjmachan/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/db/backends/utils.py | 39 | 7380 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
import re
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrap... | mit |
JCROM-Android/jcrom_external_chromium_org | tools/json_to_struct/struct_generator_test.py | 129 | 1924 | #!/usr/bin/env python
# Copyright (c) 2012 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 struct_generator import GenerateField
from struct_generator import GenerateStruct
import unittest
class StructGeneratorTest(u... | bsd-3-clause |
CppAndre/REGoth | .ycm_extra_conf.py | 3 | 6230 | # Generated by YCM Generator at 2017-01-03 23:47:49.169862
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publis... | gpl-3.0 |
lepricon49/headphones | lib/html5lib/treewalkers/__init__.py | 499 | 5766 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | gpl-3.0 |
renhaoqi/gem5-stable | util/stats/print.py | 90 | 5393 | # Copyright (c) 2003-2004 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
malayaleecoder/servo | tests/wpt/css-tests/tools/html5lib/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | mpl-2.0 |
jdugge/GridToTIN | test/test_quadedge.py | 1 | 1157 | import unittest
import quadedge as qe
class TestQuadedge(unittest.TestCase):
def test_quadedge(self):
q = qe.QuadEdge()
e = q.base
self.assertIs(e, q.edges[0])
self.assertIsNot(e, e.rot)
self.assertIs(e._rot, e.rot)
self.assertIs(e, e.rot.rot.rot.rot)
self... | mit |
spivachuk/sovrin-node | scripts/performance/perf_traffic.py | 1 | 9901 | """
Created on Feb 27, 2018
@author: nhan.nguyen
This module contains class "TesterSimulateTraffic" that simulates the real time
traffic.
"""
import threading
import random
import time
import utils
import os
import asyncio
import argparse
import requests_sender
import requests_builder
import perf_add_requests
from ... | apache-2.0 |
otherness-space/myProject | my_project_001/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.py | 93 | 13247 | try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.utils.six.moves import zip
from django.db.backends.util import truncate_name, typecast_timestamp
from django.db.models.sql import compiler
from django.db.models.sql.constants import MULTI
f... | mit |
YuJianrong/shadowsocks | shadowsocks/common.py | 945 | 8921 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 requi... | apache-2.0 |
SasView/sasmodels | sasmodels/models/fcc_paracrystal.py | 1 | 6252 | #fcc paracrystal model
#note model title and parameter table are automatically inserted
#note - calculation requires double precision
r"""
.. warning:: This model and this model description are under review following
concerns raised by SasView users. If you need to use this model,
please email... | bsd-3-clause |
haithemaraissia/soloman | vipracing.py | 186 | 18923 | import math
import urllib, urllib2
import re
def vip_unlockmeta(meta):
d=''
for i in range(0, len(meta)):
if (i % 3 == 0):
d += "%";
else:
d += meta[i];
return urllib.unquote(d);
def get_html(meta,data):
meta_un=vip_unlockmeta(meta)
# print meta_un;
# return
oo=''
x=data
l = len(x)
b = 1024.0
i, j,... | gpl-2.0 |
marc-sensenich/ansible | docs/bin/dump_keywords.py | 52 | 3103 | #!/usr/bin/env python
import optparse
import re
from distutils.version import LooseVersion
import jinja2
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.module_utils._text import to_bytes
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role i... | gpl-3.0 |
motherjones/mirrors | mirrors/tests/test_auth.py | 1 | 1445 | from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
class ComponentAuthenticationTest(APITestCase):
fixtures = ['users.json', 'component_data.json']
def test_noauthed_rejects(self):
url = reverse('component-detail', kwargs={
... | mit |
flyfei/python-for-android | python3-alpha/python3-src/PC/VS8.0/build_tkinter.py | 91 | 2196 | """Script to compile the dependencies of _tkinter
Copyright (c) 2007 by Christian Heimes <christian@cheimes.de>
Licensed to PSF under a Contributor Agreement.
"""
import os
import sys
here = os.path.abspath(os.path.dirname(__file__))
par = os.path.pardir
if 1:
TCL = "tcl8.4.16"
TK = "tk8.4.16"
TIX = "t... | apache-2.0 |
lamastex/scalable-data-science | dbcArchives/2021/000_6-sds-3-x-dl/055_DLbyABr_04-ConvolutionalNetworks.py | 1 | 22551 | # Databricks notebook source
# MAGIC %md
# MAGIC ScaDaMaLe Course [site](https://lamastex.github.io/scalable-data-science/sds/3/x/) and [book](https://lamastex.github.io/ScaDaMaLe/index.html)
# MAGIC
# MAGIC This is a 2019-2021 augmentation and update of [Adam Breindel](https://www.linkedin.com/in/adbreind)'s initial ... | unlicense |
javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py | 6 | 4929 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import string
import re
from pkg_resources.extern.pyparsing import string... | apache-2.0 |
isaac-s/cloudify-system-tests | cosmo_tester/test_suites/test_blueprints/nodecellar_test_autoheal.py | 1 | 5154 | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | apache-2.0 |
kmacinnis/sympy | sympy/physics/paulialgebra.py | 96 | 3868 | """
This module implements Pauli algebra by subclassing Symbol. Only algebraic
properties of Pauli matrices are used (we don't use the Matrix class).
See the documentation to the class Pauli for examples.
References
~~~~~~~~~~
.. [1] http://en.wikipedia.org/wiki/Pauli_matrices
"""
from __future__ import print_functi... | bsd-3-clause |
mjfarmer/scada_py | env/lib/python2.7/site-packages/twisted/internet/test/test_pollingfile.py | 23 | 1278 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._pollingfile}.
"""
from twisted.python.runtime import platform
from twisted.trial.unittest import TestCase
if platform.isWindows():
from twisted.internet import _pollingfile
else:
_pollingfile = None
c... | gpl-3.0 |
kohnle-lernmodule/palama | twisted/web/test/test_distrib.py | 14 | 1973 | #! /usr/bin/python
import sys
from twisted.trial import unittest, util
from twisted.web import http, distrib, client, resource, static, server
from twisted.internet import reactor, base
from twisted.spread import pb
from twisted.python import log, util as tputil
class MySite(server.Site):
def stopFactory(self):
... | gpl-2.0 |
yasserglez/pytiger2c | packages/pytiger2c/ast/andoperatornode.py | 1 | 2345 | # -*- coding: utf-8 -*-
"""
Clase C{AndOperatorNode} del árbol de sintáxis abstracta.
"""
from pytiger2c.ast.binarylogicaloperatornode import BinaryLogicalOperatorNode
from pytiger2c.types.integertype import IntegerType
class AndOperatorNode(BinaryLogicalOperatorNode):
"""
Clase C{AndOperatorNode} del árbol... | mit |
khalibartan/Antidote-DM | Antidotes DM/youtube_dl/extractor/roxwel.py | 180 | 1965 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate, determine_ext
class RoxwelIE(InfoExtractor):
_VALID_URL = r'https?://www\.roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
_TEST = {
'url': 'http://www.roxwel.com/player/passionpit... | gpl-2.0 |
rubik/pyg | pyg/log.py | 1 | 8604 | import os
import sys
import logging
__all__ = ['logger']
try:
from colorama import init, Fore, Style
init(autoreset=False)
colors = {
'good' : Fore.GREEN,
'bad' : Fore.RED,
'vgood' : Fore.GREEN + Style.BRIGHT,
'vbad' : Fore.RED + Style.BRIGHT,
'std' : '... | mit |
mericon/Xperia-S-msm8660 | 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 |
jwhui/openthread | tests/scripts/thread-cert/pktverify/packet.py | 6 | 5597 | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
JianfengXu/crosswalk-test-suite | misc/sampleapp-android-tests/sampleapp/sysapps_install.py | 3 | 2151 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
dongjinleekr/spark-doc | examples/src/main/python/mllib/sampled_rdds.py | 85 | 3216 | #
# 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 |
idaholab/raven | tests/framework/unit_tests/utils/testXmlUtils.py | 2 | 14859 | # Copyright 2017 Battelle Energy Alliance, 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 t... | apache-2.0 |
tonypujals/POSTMan-Chrome-Extension | tests/selenium/selenium_test.py | 93 | 1229 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import inspect
... | apache-2.0 |
chemistryTools/ChemToolsWebService | chemistry/calcore/matrix/rp1.py | 2 | 1515 | #coding:utf-8
from numpy import matrix
#CAS nArOH CIC3 Eig15_EA(dm) H7m RTs+
rp1X = matrix([
[0,0.489,0,0,1.473],
[1,0.348,0,0,1.478],
[1,0.348,0,0,1.605],
[1,0.087,0,0,1.479],
[1,0.348,0,0.012,1.803],
[1,0.174,0,0,1.425],
[1,0.261,0,0,1.47],
[2,0.844,0,0,1.577],
[2,1.667,0,0,1.54],
[1,0.381,0,0,1.313],
[1,0.761,0,0.01... | agpl-3.0 |
halfcrazy/sqlalchemy | lib/sqlalchemy/engine/url.py | 54 | 8228 | # engine/url.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
informati... | mit |
CyanHacker-Lollipop/kernel_moto_shamu | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
3DGenomes/tadbit | _pytadbit/mapping/analyze.py | 1 | 67679 | """
18 Nov 2014
"""
from warnings import warn
from collections import OrderedDict
from pysam import AlignmentFile
from scipy.stats import norm as sc_norm, skew, kurtosis
from scipy.stats import pearsonr, spearmanr, linregres... | gpl-3.0 |
slevenhagen/odoo-npg | addons/website_blog/__openerp__.py | 303 | 1819 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
opennode/nodeconductor | waldur_core/monitoring/serializers.py | 1 | 1672 | from collections import defaultdict
from rest_framework import serializers
from .models import ResourceItem, ResourceSla
from .utils import get_period, to_list
class ResourceSlaStateTransitionSerializer(serializers.Serializer):
timestamp = serializers.IntegerField()
state = serializers.SerializerMethodField... | mit |
google/dl_bounds | dl_bounds/src/data.py | 1 | 5898 | # coding=utf-8
# Copyright 2018 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 t... | apache-2.0 |
Bdanilko/EdPy | src/lib/token_bits.py | 1 | 2356 | #!/usr/bin/env python2
# * **************************************************************** **
# File: token_bits.py
# Requires: Python 2.7+ (but not Python 3.0+)
# Note: For history, changes and dates for this file, consult git.
# Author: Brian Danilko, Likeable Software (brian@likeablesoftware.com)
# Copyright 2015-2... | gpl-2.0 |
ZobairAlijan/osf.io | scripts/tests/test_migrate_registration_and_fork_log.py | 37 | 1405 | from website.models import Node
from framework.auth import Auth
from tests.base import OsfTestCase
from tests.factories import ProjectFactory, UserFactory, NodeFactory
from scripts.migrate_registration_and_fork_log import (
get_parent, get_all_parents
)
class TestMigrateLogs(OsfTestCase):
def tearDown(self):... | apache-2.0 |
a10networks/a10sdk-python | a10sdk/core/interface/interface_loopback_ipv6_router_isis.py | 2 | 1230 | from a10sdk.common.A10BaseClass import A10BaseClass
class Isis(A10BaseClass):
"""Class Description::
IS-IS Routing for IP.
Class isis supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param tag: {"description": "ISO routi... | apache-2.0 |
Pluto-tv/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/protorpc/protorpc/webapp/forms_test.py | 21 | 4048 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | bsd-3-clause |
mattclark/osf.io | scripts/fix_registration_unclaimed_records.py | 22 | 3169 | import logging
import sys
from django.db import transaction
from framework.auth.core import generate_verification_key
from website.app import setup_django
setup_django()
from osf.models import Registration, OSFUser
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def main():
dry =... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.