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 |
|---|---|---|---|---|---|
olasitarska/django | django/contrib/sessions/middleware.py | 44 | 2589 | from importlib import import_module
import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
class SessionMiddleware(object):
def __init__(self):
engine = import_module(settings.SESSION_ENGINE)
self.SessionStore = eng... | bsd-3-clause |
wanglei828/apollo | modules/tools/plot_planning/speed_dsteering_data.py | 1 | 3396 | #!/usr/bin/env python
###############################################################################
# Copyright 2019 The Apollo 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 ... | apache-2.0 |
40223239/cdb0622 | static/Brython3.1.1-20150328-091302/Lib/unittest/util.py | 794 | 4157 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... | gpl-3.0 |
donnydevito/py-academicstoday | academicstoday_project/student/views/exam.py | 3 | 11542 | from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.conf import settings
from registrar.... | apache-2.0 |
mdsafwan/Deal-My-Stuff | Lib/site-packages/django/contrib/gis/db/backends/postgis/base.py | 102 | 1620 | from django.conf import settings
from django.db.backends.base.base import NO_DB_ALIAS
from django.db.backends.postgresql_psycopg2.base import \
DatabaseWrapper as Psycopg2DatabaseWrapper
from django.utils.functional import cached_property
from .creation import PostGISCreation
from .features import DatabaseFeatures... | apache-2.0 |
huahbo/src | framework/rsf/suproj.py | 4 | 5055 | ## Copyright (C) 2004 University of Texas at Austin
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
#... | gpl-2.0 |
virneo/opencog | tests/pln/test_rules_old.py | 38 | 2817 | import unittest
raise unittest.SkipTest("Unit test temporarily disabled - see: https://github.com/opencog/opencog/issues/442")
from unittest import TestCase
from opencog.atomspace import AtomSpace, types, Atom, TruthValue
from pln.rules import *
from pln.chainers import Chainer
class RulesTest(TestCase):
def set... | agpl-3.0 |
dhermes/google-cloud-python | bigquery/google/cloud/bigquery/dbapi/connection.py | 2 | 1813 | # Copyright 2017 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 |
illAdvised/namebench | nb_third_party/dns/rdtypes/sigbase.py | 235 | 6349 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
atsolakid/edx-platform | common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py | 129 | 5409 | # -*- 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):
# Adding field 'CourseRerunState.display_name'
db.add_column('course_action_state_coursererunstate', 'displa... | agpl-3.0 |
PanDAWMS/panda-server | pandaserver/daemons/scripts/copyArchive.py | 1 | 71078 | import os
import re
import sys
import time
import fcntl
import shelve
import datetime
import traceback
import requests
from urllib3.exceptions import InsecureRequestWarning
import pandaserver.userinterface.Client as Client
from pandaserver.taskbuffer import EventServiceUtils
from pandacommon.pandalogger.PandaLogger i... | apache-2.0 |
teslaji/homebase | venv/HomeBase/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## 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... | gpl-3.0 |
x111ong/odoo | addons/crm/report/crm_phonecall_report.py | 309 | 3982 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
benschmaus/catapult | third_party/gsutil/third_party/boto/tests/unit/s3/test_website.py | 114 | 9219 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | bsd-3-clause |
EmadMokhtar/Django | tests/gis_tests/layermap/tests.py | 39 | 17972 | import datetime
import os
import unittest
from copy import copy
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.utils.layermapping import (
InvalidDecimal, InvalidString, LayerMapError, LayerMapping,
MissingForeignKey,
)
from d... | mit |
collective/eden | private/templates/Magnu/menus.py | 2 | 1541 | # -*- coding: utf-8 -*-
from gluon import *
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
# =============================================================================
class S3MainMenu(default.S3MainMenu):
""" Custom Application M... | mit |
BrandonSchaefer/xbmc | lib/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-2.0 |
rackerlabs/quark | quark/db/migration/alembic/versions/1bdc1b574beb_indexaroo.py | 6 | 3329 | """indexaroo
Revision ID: 1bdc1b574beb
Revises: 79d90e62d88
Create Date: 2015-05-20 21:39:19.348638
"""
# revision identifiers, used by Alembic.
revision = '1bdc1b574beb'
down_revision = '79d90e62d88'
from alembic import op
def upgrade():
op.create_index(op.f('ix_quark_networks_tenant_id'),
... | apache-2.0 |
bitxbay/BitXBay | electru/build/lib/electrum/account.py | 9 | 7425 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2013 thomasv@gitorious
#
# 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... | gpl-3.0 |
mvendra/mvtools | security/hash_check.py | 1 | 1222 | #!/usr/bin/env python3
import sys
import os
import sha256_wrapper
def puaq():
print("Usage: %s archive-to-check [hash-file]" % os.path.basename(__file__))
sys.exit(1)
def sha256sum_check(archive_file, hash_file):
hash_file_contents = ""
with open(hash_file, "r") as f:
hash_file_contents = f... | mit |
isht3/zulip | zerver/management/commands/compilemessages.py | 13 | 3428 | from __future__ import print_function
import os
import re
import ujson
from typing import Any, Dict, List, Text
from django.core.management.commands import compilemessages
from django.conf import settings
import polib
class Command(compilemessages.Command):
def handle(self, *args, **options):
# type: ... | apache-2.0 |
erickt/hue | desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_as_parameter.py | 66 | 6600 | import unittest
from ctypes import *
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
try:
CALLBACK_FUNCTYPE = WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
CALLBACK_FUNCTYPE = CFUNCTYPE
class POINT(Structure):
_fields_ = [("x", c_int), ("y", c_int)]
class BasicWrapTestCase(... | apache-2.0 |
popazerty/gui-test | PowerTimer.py | 2 | 24253 | import os
from boxbranding import getMachineBrand, getMachineName
import xml.etree.cElementTree
from time import ctime, time
from bisect import insort
from enigma import eActionMap, quitMainloop
from Components.config import config
from Components.TimerSanityCheck import TimerSanityCheck
from Screens.MessageBox impor... | gpl-2.0 |
sunqb/oa_qian | flask/Lib/site-packages/werkzeug/debug/repr.py | 280 | 9350 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | apache-2.0 |
Kokemomo/Kokemomo | kokemomo/plugins/engine/model/km_storage/impl/km_rdb_adapter.py | 1 | 4103 | from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text, func
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
from kokemomo.plugins.engine.model.km_s... | mit |
was4444/chromium.src | third_party/tlslite/tlslite/integration/imap4_tls.py | 115 | 3405 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + imaplib."""
import socket
from imaplib import IMAP4
from tlslite.tlsconnection import TLSConnection
from tlslite.integration.clienthelper import ClientHelper
# IMAP TLS PORT
IMAP4_TLS_PORT = 993
class IMAP... | bsd-3-clause |
pombreda/androguard | androguard/core/analysis/analysis.py | 37 | 88609 | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | apache-2.0 |
pbrod/scipy | scipy/optimize/tests/test_cobyla.py | 100 | 3562 | from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.testing import assert_allclose, TestCase, run_module_suite, \
assert_
from scipy.optimize import fmin_cobyla, minimize
class TestCobyla(TestCase):
def setUp(self):
self.x0 = [4.95, 0.66]
... | bsd-3-clause |
kmonsoor/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/messages.py | 273 | 18429 | """Classes representing TLS messages."""
from utils.compat import *
from utils.cryptomath import *
from errors import *
from utils.codec import *
from constants import *
from X509 import X509
from X509CertChain import X509CertChain
import sha
import md5
class RecordHeader3:
def __init__(self):
self.type ... | apache-2.0 |
pwaldo2/AWPUG-Plone-Demo | src/awpug.content/Paste-1.7.5.1-py2.7.egg/paste/cgitb_catcher.py | 28 | 3752 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
WSGI middleware
Captures any exceptions and prints a pretty report. See the `cgitb
documentation <http://python.org/doc/current/lib/module-cgitb... | gpl-2.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/jedi/cache.py | 4 | 4255 | """
This caching is very important for speed and memory optimizations. There's
nothing really spectacular, just some decorators. The following cache types are
available:
- ``time_cache`` can be used to cache something for just a limited time span,
which can be useful if there's user interaction and the user cannot r... | mit |
python/pythondotorg | events/migrations/0001_initial.py | 3 | 8508 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import events.models
import markupfield.fields
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(se... | apache-2.0 |
mattcaldwell/boto | boto/file/simpleresultset.py | 264 | 1321 | # Copyright 2010 Google Inc.
#
# 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, modify, merge, publish, dis-
# trib... | mit |
diagramsoftware/odoo | addons/l10n_vn/__init__.py | 425 | 1067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/nltk/parse/bllip.py | 3 | 10871 | # Natural Language Toolkit: Interface to BLLIP Parser
#
# Author: David McClosky <dmcc@bigasterisk.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
from nltk.parse.api import ParserI
from nltk.tree import Tree
"""... | mit |
kediacorporation/pyopenssl | leakcheck/context-verify-callback.py | 23 | 3838 | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in global_verify_callback in
# src/ssl/context.c. This will reliably segfault if context.c isn't a
# PyThreadState management technique which is compatible with the approach used
# by ssl.c.
from itertools import... | apache-2.0 |
prashanthpai/swift | swift/common/ring/builder.py | 1 | 73566 | # 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 |
b0ttl3z/SickRage | lib/mako/ext/beaker_cache.py | 100 | 2365 | """Provide a :class:`.CacheImpl` for the Beaker caching system."""
from mako import exceptions
from mako.cache import CacheImpl
try:
from beaker import cache as beaker_cache
except:
has_beaker = False
else:
has_beaker = True
_beaker_cache = None
class BeakerCacheImpl(CacheImpl):
"""A :class:`.Cac... | gpl-3.0 |
cappert/specto | spectlib/tools/keyringmanager.py | 2 | 2422 | # -*- coding: utf-8 -*-
# Specto , Unobtrusive event notifier
#
# keyringmanager.py
#
# See the AUTHORS file for copyright ownership information
# 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 Found... | gpl-2.0 |
tswast/pixelsketches | to-pixel-art/quantize.py | 2 | 1772 | #!/usr/bin/env python
# Copyright 2016 PixelArtVision contributors. 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
#
... | apache-2.0 |
tensorflow/datasets | tensorflow_datasets/image/flic.py | 1 | 5873 | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/tests/test_msgpack/test_except.py | 15 | 1043 | #!/usr/bin/env python
# coding: utf-8
import unittest
import nose
import datetime
from pandas.msgpack import packb, unpackb
class DummyException(Exception):
pass
class TestExceptions(unittest.TestCase):
def test_raise_on_find_unsupported_value(self):
import datetime
self.assertRaises(TypeEr... | gpl-3.0 |
oz123/radiopy | rpy.py | 1 | 1118 | from subprocess import Popen
import pty
import os
import sys
import pynotify
def parse_ICY(line):
aline = line.split('\r\n')[-1]
junk, info = aline.split('=', 1)
try:
info, junk = info.split(';', 1)
except ValueError:
pass
artist, title = info.split('-')
return artist.strip("'"... | gpl-3.0 |
julesy89/ttp-cpp | vendor/jsoncpp/test/rununittests.py | 14 | 2898 | # Copyright 2009 Baptiste Lepilleur
# Distributed under MIT license, or public domain if desired and
# recognized in your jurisdiction.
# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
from __future__ import print_function
from __future__ import unicode_literals
from io import open
from ... | gpl-2.0 |
qingwen220/eagle | eagle-external/hadoop_jmx_collector/lib/kafka-python/test/test_client_integration.py | 19 | 2193 | import os
from kafka.common import (
FetchRequest, OffsetCommitRequest, OffsetFetchRequest,
KafkaTimeoutError
)
from test.fixtures import ZookeeperFixture, KafkaFixture
from test.testutil import (
KafkaIntegrationTestCase, kafka_versions
)
class TestKafkaClientIntegration(KafkaIntegrationTestCase):
@... | apache-2.0 |
solintegra/addons | sale_service/models/sale_service.py | 210 | 7835 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
rakeshadr/ZooKeeper | src/contrib/hedwig/scripts/analyze.py | 5 | 8137 | #!/usr/bin/env python
# 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 |
IV-GII/SocialCookies | ENV1/lib/python2.7/site-packages/django/utils/daemonize.py | 259 | 1915 | import os
import sys
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
err_log='/dev/null', umask=0o022):
"Robustly turn into a UNIX daemon, running in our_home_dir."
# First fork
try:
if os.fork() > 0:
sys.exit... | gpl-2.0 |
pschmitt/home-assistant | homeassistant/components/gc100/__init__.py | 12 | 1773 | """Support for controlling Global Cache gc100."""
import logging
import gc100
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
CONF_PORTS = "ports"
DEFAULT_PORT = 4998
D... | apache-2.0 |
YuriyIlyin/mongo-connector | mongo-connector/tests/doc_managers/test_mongo.py | 2 | 9992 | # Copyright 2012 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | apache-2.0 |
iti-luebeck/BEEP | Software/beep_framework/beep_msgs/src/beep_msgs/msg/_IR.py | 1 | 5307 | """autogenerated by genpy from beep_msgs/IR.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class IR(genpy.Message):
_md5sum = "e4582beee92b23c3c9185eb7a1d11f31"
_type = "beep_msgs/IR"
_has_header = True #flag to mark the pr... | bsd-3-clause |
cynicaldevil/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake.py | 452 | 7134 | #!/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 |
EnviroCentre/jython-upgrade | jython/lib/test/test_datetime.py | 72 | 134923 | """Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
from __future__ import division
import sys
import pickle
import cPickle
import unittest
from test import test_support
from datetime import MINYEAR, MAXYEAR
from datetime import timedelta
from datetime import tzinfo
from datetim... | mit |
Jgarcia-IAS/ReporsitorioVacioOdoo | openerp/addons/l10n_fr_hr_payroll/report/fiche_paye.py | 303 | 3203 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it... | agpl-3.0 |
streamlio/heron | heron/shell/src/python/handlers/jmaphandler.py | 2 | 1282 | # Copyright 2016 Twitter. 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 applicable law or agree... | apache-2.0 |
mikewiebe-ansible/ansible | test/units/plugins/action/test_gather_facts.py | 24 | 2319 | # (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@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) any... | gpl-3.0 |
thom-at-redhat/cfme_tests | cfme/tests/intelligence/test_download_report.py | 1 | 1858 | # -*- coding: utf-8 -*-
import pytest
import os
import shutil
from cfme.intelligence.reports import reports
from utils.providers import setup_a_provider as _setup_a_provider
from utils.wait import wait_for
from utils import browser
TIMEOUT = 60.0 # Wait time for download
def clean_temp_directory():... | gpl-2.0 |
matthiascy/panda3d | direct/src/distributed/DistributedSmoothNode.py | 11 | 22211 | """DistributedSmoothNode module: contains the DistributedSmoothNode class"""
from pandac.PandaModules import *
from ClockDelta import *
import DistributedNode
import DistributedSmoothNodeBase
from direct.task.Task import cont
# This number defines our tolerance for out-of-sync telemetry packets.
# If a packet appears... | bsd-3-clause |
HartBlanc/Mastercard_Exchange_Rates | rate__retriever.py | 1 | 7513 | # 151 currencies, 22650 currency pairs, 364 days (period 1) 134 days (period 2) => 3,035,100(20,100/from_c) - 8,221,950 entries(8361.157)
print('importing packages')
import time
import sqlite3
import json
import requests
import datetime
import math
import pytz
from datetime import date
from multiprocessing.pool impor... | mit |
ramadhane/odoo | addons/website_twitter/models/twitter_config.py | 377 | 2095 | import logging
from openerp.osv import fields, osv
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
class twitter_config_settings(osv.osv_memory):
_inherit = 'website.config.settings'
_columns = {
'twitter_api_key': fields.related(
'website_id', 'twitter_a... | agpl-3.0 |
crafty78/ansible | lib/ansible/modules/windows/win_shell.py | 25 | 4672 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ansible, 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 o... | gpl-3.0 |
shivam1111/odoo | addons/website_certification/__openerp__.py | 320 | 1562 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
tmendoza/func | func/minion/modules/nagios.py | 2 | 21944 | # func-nagios - Schedule downtime and enables/disable notifications
# Copyright 2011, Red Hat, Inc.
# Tim Bielawa <tbielawa@redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license version 2.
#
# You should have received a copy of the GNU General Public License
# alo... | gpl-2.0 |
tanmaykm/edx-platform | common/lib/xmodule/xmodule/tests/test_validation.py | 83 | 8741 | """
Test xblock/validation.py
"""
import unittest
from xblock.test.tools import assert_raises
from xmodule.validation import StudioValidationMessage, StudioValidation
from xblock.validation import Validation, ValidationMessage
class StudioValidationMessageTest(unittest.TestCase):
"""
Tests for `ValidationMe... | agpl-3.0 |
naousse/odoo | addons/mrp/tests/test_multicompany.py | 374 | 2660 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
rmcgibbo/scipy | scipy/stats/_discrete_distns.py | 15 | 20781 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy import special
from scipy.special import entr, gammaln as gamln
from numpy import floor, ceil, log, exp, sqrt, log1p, expm1, tanh, cosh, s... | bsd-3-clause |
scorp2kk/kernel_pyramid_3.0.16 | 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 |
tecan/xchat-rt | plugins/scripts/cancelbot-code-55/dictbot/dictbot.py | 1 | 6363 | #!/usr/bin/python
__module_name__ = "Cancel's DictBot"
__module_version__ = "3.0.1"
__module_description__ = "DictBot by Cancel"
import xchat
import os
import re
import string
import ConfigParser
from DictService_client import *
print "\0034",__module_name__, __module_version__,"has been loaded\003"
#the globals go... | gpl-2.0 |
jason2506/bptree | conanfile.py | 1 | 1231 | from conans import ConanFile, CMake
class BPTreeConan(ConanFile):
name = 'bptree'
version = '0.0.0'
url = 'https://github.com/jason2506/bptree-cpp'
license = 'MIT'
author = 'Chi-En Wu'
settings = ('os', 'compiler', 'build_type', 'arch')
generators = ('cmake', 'txt')
no_copy_source = ... | mit |
lgscofield/odoo | addons/purchase_analytic_plans/__init__.py | 441 | 1220 | # -*- 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 |
sai9615/MY-kernel-for-grand-I9082 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
Vassy/odoo | openerp/osv/orm.py | 7 | 260429 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
tobspr/panda3d | direct/src/leveleditor/ObjectPalette.py | 15 | 5568 | """
This is just a sample code.
LevelEditor, ObjectHandler, ObjectPalette should be rewritten
to be game specific.
You can define object template class inheriting ObjectBase
to define properties shared by multiple object types.
When you are defining properties
you should specify their name, UI type, data type,
update... | bsd-3-clause |
unpingco/csvkit | csvkit/utilities/csvstat.py | 19 | 8673 | #!/usr/bin/env python
import datetime
from heapq import nlargest
from operator import itemgetter
import math
import six
from csvkit import CSVKitReader, table
from csvkit.cli import CSVKitUtility
NoneType = type(None)
MAX_UNIQUE = 5
MAX_FREQ = 5
OPERATIONS =('min', 'max', 'sum', 'mean', 'median', 'stdev', 'nulls',... | mit |
eagleamon/home-assistant | homeassistant/components/rest_command.py | 9 | 3611 | """
Exposes regular rest commands as services.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/rest_command/
"""
import asyncio
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.const import (
CONF_TIMEOU... | apache-2.0 |
ppanczyk/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py | 32 | 7775 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
linebp/pandas | pandas/tests/reshape/test_reshape.py | 1 | 43476 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
import pytest
from pandas import DataFrame, Series
import pandas as pd
from numpy import nan
import numpy as np
from pandas.util.testing import assert_frame_equal
from pandas.core.reshape.reshape import (
melt, lreshape, get_dummies, wide_to_long)
impor... | bsd-3-clause |
montekki/linux-2.6-acedia | 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 |
xclxxl414/rqalpha | rqalpha/mod/rqalpha_mod_alphaStar_utils/mod.py | 1 | 2371 | #coding=utf-8
"""
@author: evilXu
@file: mod.py
@time: 2018/2/28 16:59
@description:
"""
from rqalpha.interface import AbstractMod
from rqalpha.utils.logger import system_log,user_system_log
import pandas as pd
from rqalpha.api import *
class UtilsMod(AbstractMod):
def __init__(self):
self._inject_api()... | apache-2.0 |
data-tsunami/museo-cachi | cachi/admin.py | 1 | 1605 | # -*- coding: utf-8 -*-
#======================================================================
# This file is part of "Museo-Cachi".
#
# Museo-Cachi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation,... | gpl-3.0 |
sciapp/pyMolDyn | src/config/configuration.py | 1 | 6186 | import configobj
import validate
import os
import os.path
import inspect
CONFIG_DIRECTORY = '~/.pymoldyn/' # MUST be written with ~ to save a path in the config file that is relative to the user's home directory
CONFIG_FILE = os.path.expanduser('%s/config.cfg' % CONFIG_DIRECTORY)
CONFIG_SPEC_FILE = os.path.expanduse... | mit |
mchristopher/PokemonGo-DesktopMap | app/pylibs/osx64/Cryptodome/Cipher/_mode_openpgp.py | 2 | 6830 | # ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# 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. Redistributio... | mit |
g-k/servo | tests/wpt/css-tests/tools/html5lib/html5lib/sanitizer.py | 423 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | mpl-2.0 |
jgao54/airflow | airflow/utils/dates.py | 7 | 9508 | # -*- 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 |
tinchoss/Python_Android | python/src/Lib/email/feedparser.py | 149 | 20355 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... | apache-2.0 |
lnawrot/traffic-simulator | site_scons/site_tools/qt4/test/moc/auto/ccomment/sconstest-ccomment.py | 6 | 1628 | #!/usr/bin/env python
#
# Copyright (c) 2001-2010 The SCons Foundation
#
# 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,... | bsd-3-clause |
saneyuki/servo | components/script/dom/bindings/codegen/parser/tests/test_interfacemixin.py | 12 | 13138 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("interface mixin Foo { };")
results = parser.finish()
harness.ok(True, "Empty interface mixin parsed without error.")
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterfaceMixin),
... | mpl-2.0 |
JasonCormie/ansible-modules-extras | packaging/os/opkg.py | 114 | 5208 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Pelletier <pp.pelletier@gmail.com>
# Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | gpl-3.0 |
ric2b/Vivaldi-browser | chromium/third_party/motemplate/motemplate.py | 93 | 36667 | # Copyright 2012 Benjamin Kalman
#
# 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 writi... | bsd-3-clause |
cmorgan/pybrain | pybrain/auxiliary/gradientdescent.py | 31 | 5966 | __author__ = ('Thomas Rueckstiess, ruecksti@in.tum.de'
'Justin Bayer, bayer.justin@googlemail.com')
from scipy import zeros, asarray, sign, array, cov, dot, clip, ndarray
from scipy.linalg import inv
class GradientDescent(object):
def __init__(self):
""" initialize algorithms with standar... | bsd-3-clause |
yangchaogit/boto | tests/integration/configservice/test_configservice.py | 93 | 2081 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
rosix-ru/django-directapps-client | setup.py | 1 | 2120 | # -*- coding: utf-8 -*-
#
# Copyright 2016 Grigoriy Kramarenko <root@rosix.ru>
#
# This file is part of DjangoDirectAppsClient.
#
# DjangoDirectAppsClient 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 F... | agpl-3.0 |
Intel-Corporation/tensorflow | tensorflow/python/framework/composite_tensor_utils_test.py | 16 | 4637 | # Copyright 2019 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 |
peerster/CouchPotatoServer | libs/tornado/platform/posix.py | 352 | 1859 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | gpl-3.0 |
trinerdi/icpc-notebook | lib/googletest/test/gtest_output_test.py | 363 | 12259 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
Jerdak/three.js | utils/converters/fbx/convert_to_threejs.py | 213 | 77684 | # @author zfedoran / http://github.com/zfedoran
import os
import sys
import math
import operator
import re
import json
import types
import shutil
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
o... | mit |
RTsWorld/deepdive | src/test/python/test_ddext/input-3.py | 15 | 1658 | import ddext
# Anything written outside these two functions will not be accepted.
def init():
# SD['json'] = __import__('json')
ddext.import_lib('re')
ddext.import_lib('sys')
ddext.input('words', 'text[]')
ddext.input('id', 'bigint') # Orders of input MATTERS now
ddext.input('p1_start', 'int')
ddext.inp... | apache-2.0 |
westinedu/sovleit | django/contrib/gis/tests/geo3d/tests.py | 155 | 11305 | import os
import re
from django.utils.unittest import TestCase
from django.contrib.gis.db.models import Union, Extent3D
from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
from django.contrib.gis.utils import LayerMapping, LayerMapError
from models import City3D, Interstate2D, Interstate3D, \
Intersta... | bsd-3-clause |
p0psicles/SickGear | sickbeard/metadata/tivo.py | 4 | 13755 | # Author: Nic Wolfe <nic@wolfeden.ca>
# Author: Gordon Turner <gordonturner@gordonturner.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... | gpl-3.0 |
DivineHime/seishirou | lib/youtube_dl/extractor/niconico.py | 17 | 10092 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_duration,
parse_iso8601,
sanitized_Request,
xpath_text,
det... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.