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 -*-
from openerp import models, fields
class VolunteerUWStatus(models.Model):
_name = 'volunteer.uw_status'
name = fields.Char(required=True, string=u"nazwa")
class Volunteer(models.Model):
_inherit = 'res.users'
uw_status = fields.Many2one(
'volunteer.uw_status',
... | KrzysiekJ/bestja | addons/bestja_volunteer_ucw/models.py | Python | agpl-3.0 | 1,064 |
#
# 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... | rangadi/beam | sdks/python/apache_beam/runners/job/utils.py | Python | apache-2.0 | 1,174 |
from docker.utils import create_host_config
from common_fixtures import * # NOQA
import websocket as ws
from test_container import assert_execute, assert_stats, assert_ip_inject
CONTAINER_APPEAR_TIMEOUT_MSG = 'Timed out waiting for container ' \
'to appear. Name: [%s].'
NATIVE_TEST_IMA... | rancher/validation-tests | tests/v3_validation/cattlevalidationtest/core/test_native_docker.py | Python | apache-2.0 | 16,437 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import gtk,gtk.glade,gobject
import sys, os, time
try:
import utils, TLV_utils, cards, readers
except ImportError, e:
try:
sys.path.append(".")
import utils, TLV_utils, cards, readers
except ImportError:
raise e
from smartcard.Card... | 12019/cyberflex-shell | gui/ireadyou.py | Python | gpl-2.0 | 13,861 |
import json
from .attributesholder import AttributesHolder
class SerializableAttributesHolder(AttributesHolder):
"""AttributesHolder with methods handling serialization and
deserialization according to the PPP datamodel specification."""
def as_dict(self):
"""Returns a JSON-serializeable object re... | ProjetPP/PPP-datamodel-Python | ppp_datamodel/utils/serializableattributesholder.py | Python | agpl-3.0 | 1,989 |
# Generated by Django 3.2.10 on 2021-12-29 17:55
import django.contrib.postgres.indexes
import django.utils.timezone
import model_utils.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('company', '0023_auto_20210215_0756'),
]
operations = [
... | KlubJagiellonski/pola-backend | pola/company/migrations/0024_auto_20211229_1855.py | Python | bsd-3-clause | 2,609 |
#!/usr/bin/env python
"""
Copyright 2012 Wordnik, 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 applica... | 27himanshu/vocabList-kivy | wordnik/wordnik/models/Sentence.py | Python | gpl-3.0 | 1,281 |
#!/usr/bin/python
import paho.mqtt.client as mqtt
def on_connect(client, userdata, flags, rc):
client.subscribe("BeeeOn/#")
client = mqtt.Client()
client.on_connect = on_connect
client.connect("localhost", 1883, 60)
client.loop_start()
command_topic = "BeeeOn/set_command"
print 'Type "quit" to exit.'
while (True... | BeeeOn/sensors | scripts/run.py | Python | bsd-3-clause | 509 |
# -*- coding: utf-8 -*-
from gettext import gettext as _
APP_NAME = u'BBCalc'
APP_VERSION = u'0.8.1'
# List of authors
APP_AUTHORS = [u'Basil Shubin <bashu@users.sourceforge.net>']
APP_YEAR = u'2005-2009'
APP_WEBSITE = u'http://bbcalc.sf.net/'
APP_COPYRIGHT = _(u"Copyright © %s Basil Shubi... | bashu/bbcalc | bbcalc/__init__.py | Python | gpl-3.0 | 1,541 |
# -*- 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-securitycenter | samples/generated_samples/securitycenter_v1_generated_security_center_update_mute_config_async.py | Python | apache-2.0 | 1,620 |
from txtobjs.schema.TextObjectSchema import TextObjectSchema
from txtobjs.schema.SimpleTextField import SimpleTextField
from txtobjs.schema.SubObjectDict import SubObjectDict
from txtobjs.schema.ValueListField import ValueListField
class ServiceSchema(TextObjectSchema):
text_class = 'Service'
name... | shearern/python-text-objects | src/txtobjs_test/servers_use_case/ServiceSchema.py | Python | gpl-2.0 | 519 |
from __future__ import with_statement
from ofxclient.account import Account
from configparser import ConfigParser
import os
import os.path
try:
import keyring
KEYRING_AVAILABLE = True
except:
KEYRING_AVAILABLE = False
try:
DEFAULT_CONFIG = os.path.expanduser(os.path.join('~', 'ofxclient.ini'))
except:... | jbms/ofxclient | ofxclient/config.py | Python | mit | 9,882 |
# (c) Crown Copyright 2014 Defence Science and Technology Laboratory UK
# Author: Rich Brantingham
"""
Placeholder - django barfs if you don't have a models.py
"""
| dstl/ideaworks | backend/ideaworks/protective_marking_app/models.py | Python | agpl-3.0 | 174 |
# -*- coding: utf-8 -*-
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['admin']
| Karaage-Cluster/karaage-debian | karaage/legacy/admin/south_migrations/0004_auto__del_logentry.py | Python | gpl-3.0 | 237 |
#
# James Laska <jlaska@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be useful... | bcl/pykickstart | tests/commands/monitor.py | Python | gpl-2.0 | 2,924 |
from conans import ConanFile, CMake
import os
channel = os.getenv("CONAN_CHANNEL", "testing")
username = os.getenv("CONAN_USERNAME", "flier")
class ZipkinTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "zipkin/0.2.0@%s/%s" % (username, channel)
generators = "cmake"
... | flier/zipkin-cpp | conan/test_package/conanfile.py | Python | apache-2.0 | 591 |
# -*- coding: utf-8 -*-
"""
flask_rq2.functions
~~~~~~~~~~~~~~~~~~~
"""
from datetime import datetime, timedelta
class JobFunctions(object):
"""
Some helper functions that are added to a function decorated
with a :meth:`~flask_rq2.app.RQ.job` decorator.
"""
#: the methods to add to jobs au... | jezdez/Flask-RQ2 | src/flask_rq2/functions.py | Python | mit | 9,320 |
import time
import RPi.GPIO as GPIO
# use Broadcom pin numbers
GPIO.setmode(GPIO.BCM)
BUTTON_PIN = 4
GPIO.setup(BUTTON_PIN, GPIO.IN)
while True:
# print pin state
print GPIO.input(BUTTON_PIN)
time.sleep(1)
GPIO.cleanup()
| lukaszo/rpitips-examples | RPi.GPIO/button.py | Python | apache-2.0 | 233 |
import os
import ccnet
from pysearpc import SearpcError
from seaf_utils import CCNET_CONF_DIR, SEAFILE_CENTRAL_CONF_DIR, multi_tenancy_enabled
import wsgidav.util as util
_logger = util.getModuleLogger(__name__)
class SeafileDomainController(object):
def __init__(self):
pool = ccnet.ClientPool(CCNET_CONF... | saukrIppl/seahub | thirdpart/wsgidav/addons/seafile/domain_controller.py | Python | apache-2.0 | 1,875 |
# coding=utf-8
from finnish_functions import *
from finnish_syllables import initialize_presyllabified, make_syllables
from finnish_weight import make_weights
from finnish_sonority import make_sonorities
from finnish_stress import make_stresses
from copy import deepcopy
import os.path
# location in list of user file... | quadrismegistus/litlab-poetry | prosodic/dicts/fi/syllabifier/finnish_annotator.py | Python | mit | 8,106 |
# import os
# import utils
# import logging
| makiolo/cmaki_generator | feed.py | Python | mit | 44 |
""" URLs for save_for_later """
from django.conf.urls import include
from django.urls import path
urlpatterns = [
path('api/', include(('lms.djangoapps.save_for_later.api.urls', 'api'), namespace='api')),
]
| eduNEXT/edx-platform | lms/djangoapps/save_for_later/urls.py | Python | agpl-3.0 | 213 |
"""
Direction of Arrival Finding
============================
This sub-package provides implementations of popular direction of arrival findings algorithms.
MUSIC
| Multiple Signal Classification [1]_
| :py:obj:`pyroomacoustics.doa.music`
NormMUSIC
| MUSIC with frequency normalization [2]_
| :py:obj:`... | LCAV/pyroomacoustics | pyroomacoustics/doa/__init__.py | Python | mit | 4,912 |
'''
Takes a positional data set (time, x, y, z) and applies the Savintzky Golay filter on it based on the
polynomial and window parameters we input
'''
from math import *
import numpy as np
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
from scipy.signal ... | aerospaceresearch/orbitdeterminator | orbitdeterminator/filters/sav_golay.py | Python | mit | 1,556 |
def showInstructions():
#print a main menu and the commands
print("RPG Game")
print("========")
print("Commands:")
print(" go [direction]")
print(" get [item]")
def showStatus():
#print the player's current status
print("---------------------------")
print("You are in... | arve0/example_lessons | src/python/lessons/RPG/RPG-5-items.py | Python | cc0-1.0 | 2,873 |
#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import logging
import os
import subprocess
import unittest
import environment
import utils
import tablet
# single shard / 2 tablets
shard_0_... | danielmt/vshard | vendor/github.com/youtube/vitess/test/encrypted_replication.py | Python | mit | 6,693 |
# uid.py - functions for handling Swiss business identifiers
# coding: utf-8
#
# Copyright (C) 2015 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 o... | cgstudiomap/cgstudiomap | main/eggs/python_stdnum-1.2-py2.7.egg/stdnum/ch/uid.py | Python | agpl-3.0 | 3,006 |
import httplib
from flask import request, session, make_response
from flask.ext.restful import Resource
from flask_restful_swagger import swagger
from data.RoleDAO import RoleDAO
from tools.JsonConverter import json_serialize
from tools.MessageDefinitions import RoleMessage
from tools.ModelDefinitions import RoleMode... | RobinQuetin/CAIRIS-web | cairis/cairis/controllers/RoleController.py | Python | apache-2.0 | 13,254 |
# Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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... | StackStorm/mistral | mistral/lang/v2/publish.py | Python | apache-2.0 | 1,940 |
def gen():
i = 0
funky()
yield 1
i += 1
def funky():
print "cheese"
g = gen()
print g.next()
| ArcherSys/ArcherSys | skulpt/test/run/t187.py | Python | mit | 115 |
# Copyright 2021 Google LLC. 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 a... | tensorflow/tfx | tfx/orchestration/experimental/core/task_schedulers/resolver_task_scheduler.py | Python | apache-2.0 | 1,300 |
#
# Copyright 2016 Red Hat | Ansible
#
# 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.
#
# ... | tux-00/ansible | lib/ansible/module_utils/docker_common.py | Python | gpl-3.0 | 18,196 |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | liosha2007/temporary-groupdocs-python3-sdk | groupdocs/models/SignatureEnvelopeFieldResponse.py | Python | apache-2.0 | 1,182 |
from django.conf.urls import patterns
from . import views
urlpatterns = patterns(
'',
(r'^race', views.APIRace.as_view())
)
| MGXRace/website | racesowold/urls.py | Python | gpl-2.0 | 133 |
from __future__ import unicode_literals
from django.apps import AppConfig
class ManagementConfig(AppConfig):
name = 'management'
| Liongold/crash | django/crashreport/management/apps.py | Python | mpl-2.0 | 136 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromium presubmit script for src/net/websockets.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the pre... | Gateworks/platform-external-chromium_org | net/websockets/PRESUBMIT.py | Python | bsd-3-clause | 2,375 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | wonder-sk/QGIS | python/plugins/processing/algs/help/__init__.py | Python | gpl-2.0 | 2,059 |
#!/usr/bin/env python
from __future__ import print_function
print("Hello World")
| manashmndl/LearningPyQt | pyqt/chap01/hello.py | Python | mit | 83 |
# -*- coding: utf-8 -*-
"""
"""
from TeleMir.gui import ScanningOscilloscope,KurtosisGraphics,SpectrumGraphics,spaceShipLauncher,Topoplot
from pyacq import StreamHandler, FakeMultiSignals, EmotivMultiSignals
from pyacq.gui import Oscilloscope, TimeFreq
import msgpack
from PyQt4 import QtCore,QtGui
import zmq
im... | Hemisphere-Project/Telemir-DatabitMe | Telemir-EEG/examples/example_gui.py | Python | gpl-2.0 | 1,516 |
import numpy
queries = {
'10': 'SELECT {names} FROM results WHERE seed in ({seedsSeq}) ' +
'AND angle in ({anglesSeq}) ORDER BY amp1',
'else': 'SELECT {names} FROM six_post_results WHERE betx>0 '+
'AND bety>0 AND emitx>0 AND emity>0 AND seed{seedsSeq} ' + 'AND angle{anglesSeq}... | mfittere/SixDeskDB | sixdeskdb/queries.py | Python | lgpl-2.1 | 3,716 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
im... | yinquan529/platform-external-chromium_org-tools-gyp | pylib/gyp/msvs_emulation.py | Python | bsd-3-clause | 42,351 |
import os
class TailLog:
def __init__(self):
print "\n"
@staticmethod
def tail(f, lines=1, _buffer=4098):
# place holder for the lines found
lines_found = []
# block counter will be multiplied by buffer
# to get the block size from the end
block_counter = ... | Ardjan-Aalberts/showMe | showMe/bin/tail.py | Python | mit | 955 |
import math
import pytest
import random
import compas
from compas.geometry import Point
from compas.geometry import Polyline
from compas.utilities import pairwise
if not compas.IPY:
def test_data():
p = Polyline([Point(random.random(), random.random(), random.random()) for i in range(10)])
assert... | compas-dev/compas | tests/compas/geometry/test_polyline.py | Python | mit | 4,531 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import unittest
import six
from wechatpy.replies import TextReply, create_reply
class CreateReplyTestCase(unittest.TestCase):
def test_create_reply_with_text_not_render(self):
text = 'test'
reply = create_reply(tex... | hunter007/wechatpy | tests/test_create_reply.py | Python | mit | 4,773 |
import pyglet
import random
from pyglet.gl import *
from pyglet.window import key as keys
WIDTH = 500
HEIGHT = 500
rows = 100
columns = 100
RUNNING = False
cell_width = float(WIDTH) / rows
cell_height = float(HEIGHT) / columns
INITAL_POPULATION = 10
ACTIVE_TILE_INDEX = 0
STATE = []
win = pyglet.window.Window(w... | woodbridge/life | game.py | Python | mit | 4,698 |
import random
import json
from scipy.sparse import lil_matrix
from bidict import bidict
class Corpus:
def __init__(self, filename):
corpus_file = open(filename)
corpus_data = json.load(corpus_file)
corpus_file.close()
if not isinstance(corpus_data, dict):
raise Excep... | Beta-Alf/friendly-carnival | corpus.py | Python | mit | 1,866 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
* File Name : wikimacro.py
* Purpose : Fetch macros list from FreeCAD wiki, macro URL and author.
* Creation Date : 18-06-2016
* Copyright (c) 2016 Mandeep Singh <mandeeps708@gmail.com>
"""
import requests, bs4
# FreeCAD Macro page.
link = "http://www.freecadweb... | mandeeps708/scripts | FC_getMacro/wikimacro.py | Python | mit | 987 |
# 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... | Khushbu27/Tutorial | swift/obj/expirer.py | Python | apache-2.0 | 10,550 |
# -*- coding: utf-8 -*-
# Scrapy settings for scraper_propiedades project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.o... | abenassi/scraper-propiedades | scraper_propiedades/scraper_propiedades/settings.py | Python | gpl-3.0 | 3,131 |
#!/usr/bin/env python
# Rekall
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@gmail.com>
#
# 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 versi... | google/rekall | rekall-core/setup.py | Python | gpl-2.0 | 5,477 |
from django.conf.urls.defaults import patterns
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
ssl = get_satchmo_setting('SSL', default_value=False)
urlpatterns = patterns('',
(r'^$', 'payment.modules.paypal.views.pay_ship_info', {'SSL': ssl}, 'PAYPAL_satchmo_checkout-step2'),
(r'^confir... | thoreg/satchmo | satchmo/apps/payment/modules/paypal/urls.py | Python | bsd-3-clause | 783 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import logging
import re
import uuid
from urlparse import urljoin
from collections import Counter, OrderedDict
from itertools import product
from odoo import api, fields, models, tools, SUPERUSER_ID, _
f... | hip-odoo/odoo | addons/survey/models/survey.py | Python | agpl-3.0 | 47,761 |
from time import mktime
from datetime import datetime
import feedparser
def getNotify(pastHours):
current = datetime.utcnow()
d = feedparser.parse('http://www.cwb.gov.tw/rss/Data/cwb_warning.xml')
timeRange = 60 * 60 * pastHours
result = []
for e in d['entries']:
#dt = datetime(*e['u... | taosheng/jarvis | feedNotifier/weatherFeed.py | Python | apache-2.0 | 677 |
from collections import defaultdict
from asyncio import Future
from functools import wraps
def as_future(func):
def wrapper(*args, **kwargs):
x = Future()
res = func(*args, **kwargs)
x.set_result(res)
return x
return wrapper
def for_all_methods(decorator):
def decorate(cl... | etataurov/SFX-tracker | tests/mocked_redis.py | Python | mit | 4,464 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for Runner module
"""
import unittest
import sys
from mock import Mock, patch
from croutera import runner
class RunnerTest(unittest.TestCase):
@patch('croutera.runner.show_help')
def test_it_runs_with_no_argument(self, show_help):
sys.args ... | cristianoliveira/croutera | tests/test_runner.py | Python | mit | 1,056 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import pytest
from django.contrib.auth import get_user_mode... | akx/shoop | shoop_tests/admin/test_picotable.py | Python | agpl-3.0 | 4,680 |
from django.contrib.contenttypes.models import ContentType
import json
from django.http import Http404, HttpResponse
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.urlresolvers import... | gunnery/gunnery | gunnery/core/views.py | Python | apache-2.0 | 7,964 |
from mist.mist_job import *
class SimpleStreaming(MistJob, WithStreamingContext, WithPublisher):
def execute(self, parameters):
import time
def takeAndPublish(time, rdd):
taken = rdd.take(11)
self.publisher.publish("-------------------------------------------")
... | KineticCookie/mist | examples-python/simple_streaming.py | Python | apache-2.0 | 1,188 |
from jbot import simulator
def diagonal_moving(robot):
robot.clear_messages()
robot.send_message("moving diagonally")
for m in range(0, 100):
robot.move_left(1)
robot.move_up(1)
def directional_moving(robot):
robot.send_message("moving down")
robot.move_down(30)
robot.send... | frozenjava/RobotSimulator | examples/robotFunctionality.py | Python | gpl-2.0 | 704 |
#!/usr/bin/env python
import os
import sys
from .global_config import GlobalConfig
def FindMetadataBaseDir():
dirs = GlobalConfig.metadataDirs
return BaseDirFromList(dirs, "ENCODE metadata", "METADATA_BASEDIR")
def FindJobmonitorBaseDir():
dirs = [os.getenv("JOBMONITOR_BASEDIR"),
"/project/... | weng-lab/SnoPlowPy | snoPlowPy/files_and_paths.py | Python | mit | 15,275 |
import os
import tempfile
import unittest
import py_dep_analysis as pda
class TestPyDepAnalysis(unittest.TestCase):
def create_tmp_file(self, path: str, content: str):
f = open(path, "w")
f.write(content)
f.close()
def test_full_module_path(self):
self.assertEqual(pda._full_m... | ray-project/ray | ci/travis/py_dep_analysis_test.py | Python | apache-2.0 | 4,960 |
import tests.periodicities.period_test as per
per.buildModel((5 , 'S' , 400));
| antoinecarme/pyaf | tests/periodicities/Second/Cycle_Second_400_S_5.py | Python | bsd-3-clause | 81 |
# Copyright 2018 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.
import json
import math
import unittest
from tracing.value import histogram_serializer
from tracing.value.diagnostics import breakdown
from tracing.value.di... | catapult-project/catapult | tracing/tracing/value/diagnostics/breakdown_unittest.py | Python | bsd-3-clause | 1,818 |
########################################################################
#
# File Name: HTMLHeadingElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLHeadingElement.html
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-... | iCarto/siga | extScripting/scripts/jython/Lib/xml/dom/html/HTMLHeadingElement.py | Python | gpl-3.0 | 1,390 |
# -*- coding: utf-8 -*-
"""
InformationMachineAPILib.Models.Cart
"""
from InformationMachineAPILib.APIHelper import APIHelper
from InformationMachineAPILib.Models.CartItem import CartItem
class Cart(object):
"""Implementation of the 'Cart' model.
TODO: type model description here.
Attributes:
... | information-machine/information-machine-api-python | InformationMachineAPILib/Models/Cart.py | Python | mit | 3,435 |
from pig_util import outputSchema
COFFEE_SNOB_PHRASES = set((\
'espresso', 'cappucino', 'macchiato', 'latte', 'cortado', 'pour over', 'barista',
'flat white', 'siphon pot', 'woodneck', 'french press', 'arabica', 'chemex',
'frothed', 'la marzocco', 'mazzer', 'la pavoni', 'nespresso', 'rancilio silvia', 'h... | pombredanne/jkarn-pub-test | udfs/python/coffee.py | Python | apache-2.0 | 813 |
# coding=utf-8
# qingfanyi - Chinese to English translation tool
# Copyright (C) 2016 Rohan McGovern <rohan@mcgovern.id.au>
#
# 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 ... | rohanpm/qingfanyi | tests/test_debug.py | Python | gpl-3.0 | 1,415 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | yuewko/neutron | neutron/tests/unit/testlib_api.py | Python | apache-2.0 | 3,380 |
#!/usr/bin/env python
import re, os, os.path, sys, tempfile
import subprocess
# This script dumps its stdin into an Emacs buffer (using emacsclient).
# cat foo | nom # creates a buffer called *nom*
# cat foo | nom python # creates a buffer called *nom* in python-mode
# cat foo | nom python yo # creates a buffer called... | RichardBarrell/snippets | nom.py | Python | isc | 925 |
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import json
import re
import datetime
import pandas as pd
sys.path.insert(0,'../')
from elasticsearch import Elasticsearch, ConnectionTimeout
from models.article import Article
from elasticsearch_dsl.connections import connections
connections.create_conn... | ControCurator/controcurator | cronjobs/exportArticleStats.py | Python | mit | 2,548 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... | facebook/buck | programs/buck_version.py | Python | apache-2.0 | 4,402 |
#!/usr/bin/env python
import os.path as osp
import numpy as np
import PIL.Image
import skimage.io
import skimage.transform
from fcn import utils
here = osp.dirname(osp.abspath(__file__))
def test_label_accuracy_score():
img_file = osp.join(here, '../data/2007_000063.jpg')
lbl_file = osp.join(here, '../da... | wkentaro/fcn | tests/utils_tests/test_visualize_segmentation.py | Python | mit | 1,303 |
"""
sentry.models.groupmeta
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.db import models
from django.utils import timezone
from sentry.db.models import (BoundedB... | looker/sentry | src/sentry/models/eventmapping.py | Python | bsd-3-clause | 1,684 |
# coding: utf-8
from __future__ import division, unicode_literals
'''
Created on Jun 27, 2012
'''
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Jun 27, 2012"
import unittest
impo... | Dioptas/pymatgen | pymatgen/entries/tests/test_exp_entries.py | Python | mit | 1,189 |
#!/usr/bin/env python2
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set... | appuio/ansible-role-openshift-zabbix-monitoring | vendor/openshift-tools/ansible/inventory/aws/ec2.py | Python | apache-2.0 | 55,406 |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# 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 limit... | ralph-group/pymeasure | pymeasure/instruments/lakeshore/lakeshore425.py | Python | mit | 4,398 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, SylvainCecchetto
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)
# This file is part of Catch-up TV & More
from __future__ import unicode_literals
import re
from codequick import Listitem, Resolver, Route
import urlquick
... | Catch-up-TV-and-More/plugin.video.catchuptvandmore | resources/lib/channels/fr/lachainemeteo.py | Python | gpl-2.0 | 3,308 |
# coding: utf8
# Copyright 2018 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses... | ecoal95/servo | etc/taskcluster/decisionlib.py | Python | mpl-2.0 | 30,707 |
"""
Utility functions for the api. This includes generation of meta and error messages.
All overrided classes and methods of Flask should go here.
Author: Lalit Jain, lalitkumarj@gmail.com
"""
import time
def timeit(f):
"""
Utility used to time the duration of code execution. This script can be composed w... | nextml/NEXT | next/api/api_util.py | Python | apache-2.0 | 3,426 |
default_app_config = 'ghswebsite.apps.admin.apps.AdminConfig'
| tjghs/ghstracker | ghswebsite/apps/admin/__init__.py | Python | mit | 62 |
import unittest
from numba.core.compiler import compile_isolated, Flags
from numba.core import types
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
no_pyobj_flags = Flags()
def isnan(x):
return x != x
def isequal(x):
return x == x
class TestNaN(unittest.TestCase):
def test_na... | sklam/numba | numba/tests/test_nan.py | Python | bsd-2-clause | 895 |
import socket
import os
import os.path
import urllib.request
print("############################################")
print("# I Wish You Like it #")
print("# Simple & online Md5 HashCracker #")
print("# I wrote These Codes just in 15m #")
print("# Contact Me:mostafa-zarei@hotmai... | MR-HIDDEN/online-Md5-Cracker-python3- | Simple Md5 Cracker.py | Python | lgpl-3.0 | 1,079 |
#!/usr/bin/env python
import os
import sys
import textwrap
import setuptools
from setuptools.command.install import install
here = os.path.dirname(__file__)
package_data = dict(
setuptools=['script (dev).tmpl', 'script.tmpl', 'site-patch.py'],
)
force_windows_specific_files = (
os.environ.get("SETUPTOOLS_... | pypa/setuptools | setup.py | Python | mit | 2,625 |
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | abshkd/benzene | torrents/utils/bencode.py | Python | bsd-3-clause | 3,405 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# A Solution to "Lexicographic permutations" – Project Euler Problem No. 24
# by Florian Buetow
#
# Sourcecode: https://github.com/fbcom/project-euler
# Problem statement: https://projecteuler.net/problem=24
#
def get_permutations(str):
if len(str) == 1:
ret... | fbcom/project-euler | 024_lexicographic_permutations.py | Python | mit | 1,226 |
from typing import Any
from typing import Tuple
from poetry.core.packages.constraints.base_constraint import BaseConstraint
from poetry.core.packages.constraints.constraint import Constraint
class MultiConstraint(BaseConstraint):
def __init__(self, *constraints: Constraint) -> None:
if any(c.operator == ... | python-poetry/poetry-core | src/poetry/core/packages/constraints/multi_constraint.py | Python | mit | 2,900 |
# Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import groupby
string = raw_input()
for key, value in groupby(string):
print (len(list(value)), int(key)), | ugaliguy/HackerRank | Python/Itertools/compress-the-string.py | Python | mit | 203 |
# -*- 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-recaptcha-enterprise | samples/generated_samples/recaptchaenterprise_v1_generated_recaptcha_enterprise_service_get_metrics_async.py | Python | apache-2.0 | 1,553 |
import sys
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
lista = test.strip().split(',')
largo = (len(lista))/2
salida=0
for i in lista:
if lista.count(i) > largo:
salida = i
else:
salida... | palaxi00/palaxi00.github.io | Codeeval/the_major_element.py | Python | mit | 353 |
# data file for 8 period probelm
p=8
a=10 # minimum academic load allowed per period
b=24 # maximum academic load allowed per period
c=2 # minimum amount of courses allowed per period, 4 to make problem tighter
d=10 # maximum amount of courses allowed per period 8 to make problem tighter
courses8 = [
'dew100','f... | LYZhelloworld/Courses | 50.021/03/csp/bacp8.py | Python | mit | 1,880 |
#!/bin/python3
#
# This file is part of Simpleline Text UI library.
#
# Copyright (C) 2020 Red Hat, Inc.
#
# Simpleline 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, ... | rhinstaller/python-simpleline | examples/07_divider/07_divider.py | Python | gpl-2.0 | 3,443 |
# Copyright (C) 2018, Henrique Miranda
# All rights reserved.
#
# This file is part of yambopy
#
"""
submodule with classes to read RT calculations
"""
| alexmoratalla/yambopy | yambopy/rt/__init__.py | Python | bsd-3-clause | 152 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | googlefonts/glyphsLib | Lib/glyphsLib/builder/instances.py | Python | apache-2.0 | 15,647 |
#!/usr/bin/env
import sys
sys.path.insert(0, '../RAID')
sys.path.insert(0, '../workloads')
sys.path.insert(0, '../Disks')
import math
import matplotlib.pyplot as plt
import RAIDinterface
import ssdsim
import hddsim
import posixsim as psx
import numpy as np
import random
#from posix import Posix as psx
def simulate():... | KentonMurray/HYDE | workloads/read_heavy.py | Python | gpl-2.0 | 1,928 |
from django.core.urlresolvers import reverse
from webtest import TestApp
from treeherder.webapp.wsgi import application
def test_pending_job_available(jm, initial_data, pending_jobs_stored):
webapp = TestApp(application)
resp = webapp.get(
reverse("jobs-list", kwargs={"project": jm.project})
)
... | moijes12/treeherder | tests/e2e/test_jobs_loaded.py | Python | mpl-2.0 | 2,412 |
from distutils.core import setup
setup(name='btcp',
version='0.1.2',
description='Pyhton BitTorrent copy. Can be used to copy files using BitTorrent framework',
author='Sergey Sergeev',
author_email='zhirafovod@gmail.com',
#url='',
packages=['btcp','PythonBittorrent'],
data_files=[ # http://docs.python.or... | zhirafovod/btcp | files/setup.btcp-daemon.py | Python | mit | 528 |
#!/usr/bin/python
# This file is part of Ansible
# 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': ['preview'... | Lujeni/ansible | lib/ansible/modules/cloud/amazon/dms_endpoint.py | Python | gpl-3.0 | 16,453 |
#!/usr/bin/env python
# The source code contained in this file is licensed under the MIT license.
# See LICENSE.txt in the main project directory, for more information.
# For the exact contribution history, see the git revision log.
from setuptools import setup
setup(
name = 'libkne',
version =... | FelixSchwarz/libkne | setup.py | Python | mit | 595 |
# -*- coding: ISO-8859-1 -*-
# std library
from struct import unpack
# uhh I don't really like this, but there are so many constants to
# import otherwise
from constants import *
from EventDispatcher import EventDispatcher
class MidiFileParser:
"""
The MidiFileParser is the lowest level parser that s... | west2554/fofix | src/midi/MidiFileParser.py | Python | gpl-2.0 | 6,644 |
"""
To create an Attribute Editor template using python, do the following:
1. create a subclass of `uitypes.AETemplate`
2. set its ``_nodeType`` class attribute to the name of the desired node type, or name the class using the
convention ``AE<nodeType>Template``
3. import the module
AETemplates which do not meet o... | yaoyansi/mymagicbox | common/mymagicbox/AETemplateBase.py | Python | mit | 2,176 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.