code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# Copyright (c) 2007, 2008 Guilherme Mesquita Gondim and contributors
#
# This file is part of Django Diário.
#
# Django Diário is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README fo... | marinho/django-diario | setup.py | Python | lgpl-3.0 | 1,591 |
from tululbot.utils.kbbi import lookup_kbbi_definition
def test_lookup_kbbi(mocker):
class FakeResponse:
def json(self):
return {
'kateglo': {
'definition': [
{
'lex_class_ref': 'nomina',
... | tulul/tululbot | tests/test_kbbi.py | Python | apache-2.0 | 1,754 |
import sys
def setup(core, object):
object.setAttachment('radial_filename', 'deeds/vehicleDeed')
return
def use(core, actor, object):
core.mountService.generateVehicle(actor, object, 'object/mobile/vehicle/shared_landspeeder_organa.iff', 'object/intangible/vehicle/shared_landspeeder_organa_pcd.iff')
return | ProjectSWGCore/NGECore2 | scripts/object/tangible/tcg/series1/vehicle_deed_organa_speeder.py | Python | lgpl-3.0 | 313 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... | pkill-nine/qutebrowser | tests/unit/misc/test_keyhints.py | Python | gpl-3.0 | 6,227 |
# Copyright 2013 IBM Corp.
#
# 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... | rajalokan/nova | nova/tests/unit/objects/test_service.py | Python | apache-2.0 | 22,159 |
from nose.tools import assert_raises
from werkzeug.datastructures import ResponseCacheControl
from werkzeug.http import parse_cache_control_header
from werkzeug.test import Client, create_environ
from werkzeug.wrappers import Request, Response
from werkzeug.contrib import fixers
@Request.application
def path_check_ap... | r-kitaev/lucid-python-werkzeug | tests/contrib/test_fixers.py | Python | bsd-3-clause | 5,198 |
# -*- coding: utf-8 -*-
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.core import serializers
from homedisplay.utils import publish_ws
import json
__all__ = ["get_serialized_labels", "PrintLabel"]
def get_serialized_labels()... | ojarva/home-info-display | homedisplay/control_printer/models.py | Python | bsd-3-clause | 1,575 |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | jupito/podxm | setup.py | Python | mit | 3,970 |
# 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 import forms
class CachedFileField(forms.FileField):
"""
A custom FileField class for use in conjun... | mozilla/telemetry-analysis-service | atmo/forms/fields.py | Python | mpl-2.0 | 733 |
# -*- coding: utf-8 -*-
#
# Project Calico documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 3 11:36:20 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | kasisnu/calico | docs/source/conf.py | Python | apache-2.0 | 8,272 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | nuagenetworks/vspk-python | vspk/v5_0/nudemarcationservice.py | Python | bsd-3-clause | 10,092 |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from .forms import LoginForm
class LoginViewTest(TestCase):
def setUp(self):
self.client = Client()
self.response = self.client.get(reve... | delete/estofadora | estofadora/login/tests.py | Python | mit | 3,269 |
'''Pull all the default settings and then all overrides.
Created on Aug 19, 2010
@author: jnaous
'''
import sys, traceback
from expedient.clearinghouse.defaultsettings.django import *
from expedient.clearinghouse.defaultsettings.database import *
from expedient.clearinghouse.defaultsettings.admins import *
from expe... | avlach/univbris-ocf | expedient/src/python/expedient/clearinghouse/settings.py | Python | bsd-3-clause | 3,709 |
import os
import sys
import unittest
import importlib
from unittest import mock
from pykickstart.options import KSOptionParser
from pykickstart.base import KickstartCommand, BaseData
class ClassDefinitionTestCase(unittest.TestCase):
"""
Search for command and data classes defined like so:
RHEL7_Au... | bcl/pykickstart | tests/commands/__init__.py | Python | gpl-2.0 | 6,556 |
import mimetypes
import sys
import typing as t
import warnings
from collections import defaultdict
from datetime import datetime
from datetime import timedelta
from http.cookiejar import CookieJar
from io import BytesIO
from itertools import chain
from random import random
from tempfile import TemporaryFile
from time i... | fkazimierczak/werkzeug | src/werkzeug/test.py | Python | bsd-3-clause | 48,130 |
import bpy
bl_info = {
"name" : "Vertex Tricker",
"description" : "You Can Trick Vertex Slection in Edit Mode",
"author" : "Kozo Oeda",
"version" : (1, 0),
"location" : "",
"warning" : "",
"support" : "COMMUNITY",
"wiki_url" : "",
"tracker_url" : "",
"category" : "3D View"
... | kozmof/vertex_tricker | vertex_tricker.py | Python | mit | 8,816 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
PostTelemac
A QGIS plugin
Post Traitment or Telemac
-------------------
begin : 2015-07-07
git sha : $For... | ArteliaTelemac/PostTelemac | tests/test_core_parservalues.py | Python | gpl-3.0 | 1,425 |
# -*- coding: utf-8 -*-
#
# src documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 1 22:23:19 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... | lambdalisue/maidenhair-jasco-parser | docs/conf.py | Python | mit | 9,017 |
# Copyright 2012 Twitter
#
# 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, softw... | mowenGithub/Clutch | configure/settings.py | Python | apache-2.0 | 5,789 |
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#####################... | CompassionCH/compassion-switzerland | sms_939/models/compassion_child.py | Python | agpl-3.0 | 994 |
class Solution:
def validTree(self, n: int, edges: List[List[int]]) -> bool:
if len(edges) != n - 1:
return False
parent = [i for i in range(n)]
def findParent(x):
while parent[x] != x:
parent[x] = parent[parent[x]]
x = parent[x]
... | jiadaizhao/LeetCode | 0201-0300/0261-Graph Valid Tree/0261-Graph Valid Tree.py | Python | mit | 548 |
#!/usr/bin/env python2
#Copyright (C) 2014, Cameron Brandon White
# -*- coding: utf-8 -*-
import setuptools
import textwrap
if __name__ == "__main__":
setuptools.setup(
name="Flask-CAS",
version="1.0.1",
description="Flask extension for CAS",
author="Cameron Brandon White",
... | UMDIEEE/ieee-web | third-party/Flask-CAS-1.0.1/setup.py | Python | gpl-3.0 | 2,760 |
"""
WSGI config for XXX_PROJECT_NAME_XXX.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'XXX_PROJEC... | mmcardle/django_builder | src/django/python/wsgi.py | Python | mit | 380 |
# -*- encoding: utf-8 -*-
class RouteFactory(object):
def __init__(self, request):
self.request = request
def getTitle(self):
return "Portfólio Pyramid"
| Bleno/portfolio | portfolio/views/routes/factory.py | Python | gpl-3.0 | 180 |
from django import template
import socket
import struct
from iptocountry.models import IpToCountry
from django.conf import settings
import os
register = template.Library()
def ip2long(ip):
ip_array = ip.split('.')
ip_long = int(ip_array[0]) * 16777216 + int(ip_array[1]) * 65536 + int(ip_array[2]) * 256 + in... | maweis1981/hey001 | mayversion/mayversion/iptocountry/templatetags/iptocountry_flag.py | Python | lgpl-3.0 | 1,569 |
#!/usr/bin/env python3
from setuptools import setup, find_packages
DESCRIPTION = open("README.rst", encoding="utf-8").read()
CLASSIFIERS = '''\
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved
Operating System :: POSIX
Operating System :: Unix
Programming Language :: Pyth... | cea-ufmg/pyfdas | setup.py | Python | mit | 882 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-asset | samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_async.py | Python | apache-2.0 | 1,527 |
import six
from databasin.exceptions import LoginRequiredError, ForbiddenError
urlparse = six.moves.urllib_parse.urlparse # IDE inspection trips over this as an import
class ResourcePaginator(object):
def __init__(self, resource):
self.resource = resource
self.loaded_urls = set()
def __ite... | consbio/python-databasin | databasin/utils.py | Python | bsd-3-clause | 1,554 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | do/modeling/show_analysis_runs.py | Python | agpl-3.0 | 19,526 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Versioneer 2
============
* Like a rocketeer, but for versions!
* Based on https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy
* Edited by Ryan Dwyer
This is a... | ryanpdwyer/teensyio | versioneer.py | Python | mit | 37,855 |
# Local modules
from .beam import * # noqa
from .segmentation import * # noqa
| MartinThoma/hwrt | hwrt/segmentation/__init__.py | Python | mit | 80 |
import base64
import matplotlib
import os
import sys
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import FigureManagerBase, ShowBase
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from datalore.display import debug, display, SHOW_DEBUG_INFO
... | jwren/intellij-community | python/helpers/pycharm_matplotlib_backend/backend_interagg.py | Python | apache-2.0 | 3,831 |
from fnmatch import fnmatch
import os
_EXCLUDE_PATTERNS = []
def set_exclude_patters(excludes):
global _EXCLUDE_PATTERNS
_EXCLUDE_PATTERNS = excludes
def get_exclude_patterns():
return _EXCLUDE_PATTERNS
def walk_excl(path, **kwargs):
"""
Do os.walk dropping our excluded directories on the wa... | arth-co/shoop | shoop_setup_utils/excludes.py | Python | agpl-3.0 | 627 |
#!/usr/bin/env python2
# Terminator by Chris Jones <cmsj@tenshu.net>
# GPL v2 only
"""terminal_popup_menu.py - classes necessary to provide a terminal context
menu"""
import string
from gi.repository import Gtk
from version import APP_NAME
from translation import _
from encoding import TerminatorEncoding
from termi... | wpjunior/terminator | terminatorlib/terminal_popup_menu.py | Python | gpl-2.0 | 11,983 |
# -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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 datetime
import os
from ansible.module_utils.urls import (Request, o... | cchurch/ansible | test/units/module_utils/urls/test_Request.py | Python | gpl-3.0 | 14,937 |
# encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | klahnakoski/jx-sqlite | vendor/jx_python/expressions/eq_op.py | Python | mpl-2.0 | 691 |
from oioioi.contests.models import Submission
from oioioi.dashboard.registry import dashboard_registry
from oioioi.disqualification.controllers import \
DisqualificationContestControllerMixin
@dashboard_registry.register_decorator(order=10)
def disqualification_fragment(request):
if not request.user.is_authe... | papedaniel/oioioi | oioioi/disqualification/views.py | Python | gpl-3.0 | 755 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# modesetting.py
#
# Copyright © 2013-2015 Antergos
#
# This file is part of Cnchi.
#
# Cnchi 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 versio... | yucefsourani/Cnchi | cnchi/hardware/modesetting.py | Python | gpl-3.0 | 1,768 |
from __future__ import annotations
import xia2.Modules.CctbxFrenchWilson
from xia2.Driver.DefaultDriver import DefaultDriver
def FrenchWilson(DriverType=None):
"""A factory for FrenchWilsonWrapper classes."""
class FrenchWilsonWrapper(DefaultDriver):
"""A wrapper for cctbx French and Wilson analysis... | xia2/xia2 | src/xia2/Wrappers/XIA/FrenchWilson.py | Python | bsd-3-clause | 3,508 |
from django.views.generic.list import ListView
from django.utils import timezone
from django.db.models import Sum, F, Q
from entries.models import Entry, Category
import json
class ReportingView(ListView):
model = Entry
template_name = "admin/reporting.html"
entry_admin = None # the Entry ModelAdmin
... | namlook/moneyland | entries/admin_views.py | Python | mit | 4,295 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 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
class ModuleDocFragment(object):
# Standard template documentation fr... | aperigault/ansible | lib/ansible/plugins/doc_fragments/template_common.py | Python | gpl-3.0 | 4,909 |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='TinyContent',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_ke... | dominicrodger/django-tinycontent | tinycontent/migrations/0001_initial.py | Python | bsd-3-clause | 570 |
import synapse.tests.utils as s_t_utils
import synapse.lookup.iso3166 as s_l_country
class CountryLookTest(s_t_utils.SynTest):
def test_lookup_countries(self):
self.eq(s_l_country.country2iso.get('united states of america'), 'us')
self.eq(s_l_country.country2iso.get('mexico'), 'mx')
self... | vertexproject/synapse | synapse/tests/test_lookup_iso3166.py | Python | apache-2.0 | 375 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 18:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('silk', '0002_auto_update_uuid4_id_field'),
]
operations = [
migrations.AddFi... | crunchr/silk | silk/migrations/0003_request_prof_file.py | Python | mit | 468 |
from __future__ import absolute_import, division, print_function, unicode_literals
import inspect
# All possible class names must be inserted into the globals collection.
# If there is a better way of doing this, please suggest!
from amaascore.parties.broker import Broker
from amaascore.parties.company import Compa... | amaas-fintech/amaas-core-sdk-python | amaascore/parties/utils.py | Python | apache-2.0 | 2,169 |
from gwpy.plotter import TimeSeriesPlot
plot = TimeSeriesPlot(
data.crop(*data.span.contract(1)),
b.crop(*b.span.contract(1)),
figsize=[12, 8], sep=True, sharex=True)
plot.axes[0].set_title('LIGO-Hanford strain data around GW150914')
plot.axes[0].text(
1.0, 1.0, 'Unfiltered data',
transform=plot.axe... | gwpy/gwpy.github.io | docs/v0.5/examples/signal/gw150914-6.py | Python | gpl-3.0 | 547 |
#!/user/bin/python
# Printing the power of a number
g = lambda x: x**2
print g(8)
| ramesharpu/python | basic-coding/comprehensions-not-complete/lambda/power.py | Python | gpl-2.0 | 83 |
# -*- coding: utf-8 -*-
#Copyright (C) Fiz Vazquez vud1@sindominio.net
#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.
#T... | pytrainer/pytrainer | pytrainer/extension.py | Python | gpl-2.0 | 5,489 |
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.org>
#
# 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,... | bram85/topydo | topydo/lib/DCommand.py | Python | gpl-3.0 | 4,194 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import Queue
import threading
import time
import sys
import socket
import optparse
from time import sleep
def ip2num(ip):
ip = [int(x) for x in ip.split('.')]
return ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3]
def num2ip(num):
return '%s.%s.%s.%s' % (... | LxiaoGirl/hack | 扫描脚本/端口扫描/lscan_port.py | Python | gpl-2.0 | 3,234 |
class Token:
def __init__(self, type, data):
self.type = type
self.data = data
| fredmorcos/attic | snippets/python/lex-parse/token.py | Python | isc | 84 |
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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.... | Sodki/ansible | lib/ansible/plugins/filter/core.py | Python | gpl-3.0 | 17,081 |
from redash.query_runner import BaseSQLQueryRunner, BaseQueryRunner
from tests import BaseTestCase
from redash.models import db
from redash.utils import json_dumps
from redash.handlers.query_results import error_messages
class TestQueryResultsCacheHeaders(BaseTestCase):
def test_uses_cache_headers_for_specific_r... | getredash/redash | tests/handlers/test_query_results.py | Python | bsd-2-clause | 18,324 |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/basic/server_args.py | Python | apache-2.0 | 1,161 |
# -*- coding: utf-8 -*-
#
# Copyright (C)2005-2010 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... | zjj/trac_hack | trac/db/sqlite_backend.py | Python | bsd-3-clause | 11,446 |
"""Deepstream RPC handling."""
from __future__ import absolute_import, division, print_function, with_statement
from __future__ import unicode_literals
from deepstreampy.constants import topic as topic_constants
from deepstreampy.constants import actions
from deepstreampy.constants import event as event_constants
fro... | YavorPaunov/deepstreampy | deepstreampy/rpc.py | Python | mit | 10,203 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon/polyaxon | core/tests/test_cli/test_artifacts.py | Python | apache-2.0 | 2,783 |
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^$', 'blog.views.entry_list', name="entry-list"),
url(r'^archive/(?P<year>\d{4})/$', 'blog.views.entry_archive_year', name="year-archive"),
url(r'^archive/(?P<year>\d{4})/(?P<month>\d{1,2})/$', 'blog.views.entry_archive_month', name=... | tsoporan/tehorng | blog/urls.py | Python | agpl-3.0 | 421 |
import socket, threading
from wendy import Worker
from logger import logger
import time
config_file = [['A', '192.168.1.1', 5],
['B', '192.168.1.2', 8]]
INF = 99
US = 'C'
class ForwardClass(Worker,dvector):
def __init__(self, sckt, address):
# init things
self.dvector = dvecto... | wichovw/rhonda | forwarding.py | Python | gpl-2.0 | 1,891 |
import mysql.connector
from fixture.db_data import DbFixture
db = DbFixture(host="localhost", name="addressbook", user="root", password="")
try:
contacts = db.get_contact_in_group()
for contact in contacts:
print("Contact id: " + str(contact.id) + ", group id: " + str(contact.group_id) )
print... | ksemish/KseniyaRepository | check_db_connection.py | Python | apache-2.0 | 361 |
# -*- coding: utf-8 -*-
#################################################################################
### Jesus Garcia Manday
### apply-Descriptor-LipVireo.py
### @Descripcion: script para obtener los ficheros descriptores de los puntos
### de interés de cada imagen
###
### @Params:
### - detector... | jmanday/Master | TFM/scripts/apply-Descriptor-LipVireo.py | Python | apache-2.0 | 1,416 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | kwss/keystone | tests/test_sql_upgrade.py | Python | apache-2.0 | 38,724 |
import time
from math import fabs
import putil.timer
from putil.testing import UtilTest
class TestTimer(UtilTest):
def setUp(self):
self.op1_times = iter([ .01, .02 ])
self.a1 = putil.timer.Accumulator()
self.op2_step1_times = iter([ .005, .015, .005, .005])
self.op2_step2_times ... | crchemist/scioncc | src/putil/test/test_timer.py | Python | bsd-2-clause | 2,264 |
# Copyright 2017 AT&T Corporation.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | vedujoshi/tempest | tempest/tests/lib/services/network/test_subnetpools_client.py | Python | apache-2.0 | 5,814 |
# -*- coding: utf-8 -*-
# from twisted.words.xish import domish
from base import *
import random
from twisted.internet import defer
answers = ('Pong, чо.',
'Pong, хуле.',
'Pong, блин, pong.',
'Pong. А что я по-твоему должен был ответить?',
'Pong です!',
'Pong. А ты... | ojab/bnw | bnw/handlers/command_ping.py | Python | bsd-2-clause | 1,209 |
# The Nexus software is licensed under the BSD 2-Clause license.
#
# You should have recieved a copy of this license with the software.
# If you did not, you can find one at the following link.
#
# http://opensource.org/licenses/bsd-license.php
import logging
from core.plugins import ProtocolPlugin
from core.decorato... | TheArchives/Nexus | core/plugins/kickban.py | Python | bsd-2-clause | 10,108 |
import os.path
import string
import subprocess
import sys
try:
"""
If used in a package, package logging functions are used instead of stderr.
"""
from . import debug, info, warning, error, fatal
except:
def error(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
debug = info = warning = fatal = erro... | matt-hayden/video-clip-splitter | videoclipsplitter/AviDemux.py | Python | unlicense | 7,071 |
import time
from torba.server import util
def sessions_lines(data):
"""A generator returning lines for a list of sessions.
data is the return value of rpc_sessions()."""
fmt = ('{:<6} {:<5} {:>17} {:>5} {:>5} {:>5} '
'{:>7} {:>7} {:>7} {:>7} {:>7} {:>9} {:>21}')
yield fmt.format('ID', 'Fl... | lbryio/lbry | torba/torba/server/text.py | Python | mit | 3,433 |
import pygame
from constants import SCREEN, MAX_FPS, SHOW_FPS
from misc_functions import show_fps, set_joysticks
def Demo_TitleScreen():
title = pygame.image.load('images/demo/titlescreen.png').convert()
'''
if MUSIC:
music = pygame.mixer.music.load('sound/music/cheetah.mp3')
pygame.mixer.music.play(-1)
'''
... | AsparagusEdu/GraviSwitch | code/titlescreen.py | Python | apache-2.0 | 1,582 |
# Copyright 2020 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... | tensorflow/tensorboard | tensorboard/plugins/debugger_v2/debug_data_multiplexer_test.py | Python | apache-2.0 | 3,017 |
# -*- coding: utf8 -*-
from __future__ import print_function, division, absolute_import
import collections
import functools
import os
import struct
import sys
import uuid
import weakref
from copy import deepcopy
from numba import _dispatcher, compiler, utils, types, config, errors
from numba.typeconv.rules import de... | jriehl/numba | numba/dispatcher.py | Python | bsd-2-clause | 33,487 |
import xml.etree.ElementTree as ElementTree
import re
pVersion = re.compile(r"(\d+)\.(\d+)\.(\d+)")
class AdminData:
def __init__(self):
self.specialDataGroups = []
def asdict(self):
retval={'type': self.__class__.__name__, 'specialDataGroups':[]}
for elem in self.specialData... | cogu/autosar | autosar/base.py | Python | mit | 12,669 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-dialogflow | samples/generated_samples/dialogflow_v2_generated_contexts_get_context_async.py | Python | apache-2.0 | 1,444 |
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | CingHu/neutron-ustack | neutron/api/rpc/handlers/dhcp_rpc.py | Python | apache-2.0 | 12,773 |
from rdrf.helpers.utils import report_function
from registry.patients.models import PatientAddress
@report_function
def professionals(patient_model):
return patient_model.clinician
@report_function
def country(patient_model):
try:
patient_address = PatientAddress.objects.get(patient=patient_model)
... | muccg/rdrf | rdrf/rdrf/services/io/reporting/report_field_functions.py | Python | agpl-3.0 | 674 |
import abc
from Component import Component
class ComponentCavity(Component):
"""
Abstract base class for all cavity component adapter classes.
"""
__metaclass__ = abc.ABCMeta
def __init__(self, obj, system, material, position):
Component.__init__(self, obj, system, material)
... | python-acoustics/Sea | Sea/adapter/components/ComponentCavity.py | Python | bsd-3-clause | 2,308 |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is a tool for comparing two or more bitcoinds to ... | coinkeeper/2015-06-22_18-31_bitcoin | qa/rpc-tests/test_framework/comptool.py | Python | mit | 14,544 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-09 21:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_task_due_date'),
]
operations = [
migrations.AddField(
... | chiubaka/serenity | server/api/migrations/0005_task_scheduled_date.py | Python | mit | 442 |
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.process.subprocess import Subprocess
from pants.testutil.subsystem.util import global_subsystem_instance
from pants.testutil.test_base import TestBase
class SubprocessTest(Tes... | tdyas/pants | tests/python/pants_test/process/test_subprocess.py | Python | apache-2.0 | 547 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
VERSION = "2.0"
# Official repo: https://github.com/pdehaye/edx-presenter
# (a fork of mokaspar's release)
# Originally authored by mokaspar (edx-presenter.py),
# tailored for mat101 by Paul-Olivier Dehaye (mat101-presenter.py)
# To see the full help, type: ./mat101-p... | pdehaye/edx-presenter | mat101-presenter.py | Python | agpl-3.0 | 37,588 |
from django.db import models
from buildings.models import Building
class Room(models.Model):
roomid = models.CharField(max_length=10)
name = models.CharField(max_length=128)
description = models.TextField(null=True, blank=True, default=None)
capacity = models.IntegerField(null=True)
buildingid = ... | ritashugisha/ASUEvents | ASUEvents/rooms/models.py | Python | mit | 516 |
import os, sys
import numpy as np
import time
import json
import cPickle as pickle
from sklearn.feature_extraction.text import CountVectorizer
count_vect = CountVectorizer(min_df=6, stop_words='english')
file_list_lite = 'clickture-lite.lst'
data_dir_lite = '../keyword/keywords_lite'
file_list_dev = 'clickture-dev.ls... | kanchen-usc/amc_att | clickture/pro_keyword_clickture.py | Python | mit | 3,533 |
#!/usr/bin/env python
"""
Kover: Learn interpretable computational phenotyping models from k-merized genomic data
Copyright (C) 2018 Alexandre Drouin & Gael Letarte
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 S... | aldro61/kover | core/kover/learning/common/rules.py | Python | gpl-3.0 | 11,255 |
__author__ = 'pferland'
from PrinterStats import *
__all__ = ['PrinterStats']
#__all__ = ['create_models_functions', 'check_printers_table', 'daemon_get_host_stats', 'hostcheck'] | RIEI/printerStats | daemon/PrinterStats/__init__.py | Python | gpl-2.0 | 179 |
"""
:mod:`zsl.utils.import_helper`
------------------------------
.. moduleauthor:: Martin Babka
"""
from __future__ import unicode_literals
import importlib
def fetch_class(full_class_name):
"""Fetches the given class.
:param string full_class_name: Name of the class to be fetched.
"""
(module_nam... | AtteqCom/zsl | src/zsl/utils/import_helper.py | Python | mit | 457 |
from unittest.mock import patch, ANY
from django.test import RequestFactory, SimpleTestCase
from django.core.exceptions import ValidationError
from corehq.apps.users.models import WebUser
from ..forms import HQAuthenticationTokenForm, HQBackupTokenForm
class HQAuthenticationTokenFormTests(SimpleTestCase):
def se... | dimagi/commcare-hq | corehq/apps/hqwebapp/tests/test_forms.py | Python | bsd-3-clause | 3,073 |
###################
## EXAMPLE: strings
###################
#hi = "hello there"
#name = "ana"
#greet = hi + name
#print(greet)
#greeting = hi + " " + name
#print(greeting)
#silly = hi + (" " + name)*3
#print(silly)
####################
## EXAMPLE: output
####################
#x = 1
#print(x)
#x_st... | indefinitelee/Learning | MIT_60001_Introduction_to_Computer_Science_and_Programming_in_Python/week_2/lec2_branch_loops.py | Python | mit | 2,880 |
"""
Copyright (C) 2011 Maximiliano Pin
Redmodel is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Redmodel is ... | beatmax/redmodel | test/models.py | Python | gpl-3.0 | 26,707 |
import py
from rpython.rtyper.lltypesystem import lltype, rffi, llmemory
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.jit.backend.llsupport import symbolic, support
from rpython.jit.metainterp.history import AbstractDescr, getkind, FLOAT, INT
from rpython.jit.metainterp import history
from rpyt... | jptomo/rpython-lang-scheme | rpython/jit/backend/llsupport/descr.py | Python | mit | 23,481 |
import sys
sys.path.insert(0,"../control/")
import motorControl
import plot
sys.path.insert(0, "../settings/")
import settings
import time
import cv2
import select
def moveAndPlot(motorControler, plotter, values):
motorControler.setMotorsByName(values)
out = motorControler.readAllMotors()
plotter.addNewVal(out,t... | Fdepraetre/PinokioProject | src/test/testArm.py | Python | mit | 1,100 |
import redis
def do_commands(conn, GW=True):
r = conn.do_generic_request
assert_equal = redis.rr_assert_equal
assert_subs = redis.rr_assert_substring
key = 'commands_genericxxxxxxxkey'
key2 = 'commands_genericxxxxxxkey2'
dest = 'commands_generic_xxxxxdest'
try:
# | APPEND ... | naver/nbase-arc | redis/tests/nbase-arc/commands_generic.py | Python | apache-2.0 | 29,358 |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016 CERN.
#
# CERN Analysis Preservation Framework is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either... | tiborsimko/analysis-preservation.cern.ch | cap/modules/schemas/permissions.py | Python | gpl-2.0 | 2,071 |
##############################################################################
# Copyright (c) 2013-2017, 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... | TheTimmy/spack | var/spack/repos/builtin/packages/simul/package.py | Python | lgpl-2.1 | 2,009 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-10-02 15:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cerimonial', '0054_auto_20181001_1728'),
]
operations = [
migrations.AlterF... | interlegis/saap | saap/cerimonial/migrations/0055_auto_20181002_1212.py | Python | gpl-3.0 | 728 |
import os
from PyML.utils import misc,myio
from PyML.base.pymlObject import PyMLobject
__docformat__ = "restructuredtext en"
class Parser (PyMLobject) :
'''A parser class to read datasets from a file.
Each parser support the following interface:
Constructor - pass a file name / file handle and informati... | cathywu/Sentiment-Analysis | PyML-0.7.9/PyML/containers/parsers.py | Python | gpl-2.0 | 13,813 |
import numpy as np
import pandas as pd
from pandas.tools.merge import concat
from scipy.stats import ranksums
from munge import toPrettyCsv
# from utils import *
from results_utils import *
COMBINED_CSV_FILE = 'combined.csv'
ERRS_CSV_FILE = 'errRates.csv'
RANK_CSV_FILE = 'combined_rank.csv'
ZVALS_CSV_FILE = 'combine... | dblalock/flock | python/analyze/classify/compare_algos.py | Python | mit | 6,149 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
from datet... | sysadminmatmoz/ingadhoc | partner_person/res_partner.py | Python | agpl-3.0 | 9,708 |
default_email_subject_template = "Merry Christmas {giver.first_name}!"
default_email_content_template = "Dear {giver.first_name},\n\
\n\
I'm very busy this year and could use a little help from you, one of my little helpers.\n\
\n\
{receiver} has been very good this year, and deserves a lovely gift.\n\
\n\
Could you pl... | TheUKDave/secret_santa | santa/__init__.py | Python | mit | 672 |
import copy
import numpy as np
class Face:
# constant locators for landmarks
jaw_points = np.arange(0, 17) # face contour points
eyebrow_dx_points = np.arange(17, 22)
eyebrow_sx_points = np.arange(22, 27)
nose_points = np.arange(27, 36)
nosecenter_points = np.array([30, 33])
right_eye = np... | 5agado/data-science-learning | face_utils/Face.py | Python | apache-2.0 | 4,604 |
# -*- coding: utf-8 -*-
import ast
import base64
import csv
import functools
import glob
import itertools
import jinja2
import logging
import operator
import datetime
import hashlib
import os
import re
import simplejson
import sys
import time
import urllib2
import zlib
from xml.etree import ElementTree
from cStringIO ... | doganaltunbay/odoo | addons/web/controllers/main.py | Python | agpl-3.0 | 65,240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.