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
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.path.insert(0, "../") import logging import snakemq import snakemq.link import snakemq.packeter import snakemq.messaging import snakemq.message def on_recv(conn, ident, message): print("received from", conn, ident, message) def on_drop(ident, message...
dsiroky/snakemq
examples/messaging_listener.py
Python
mit
915
# -*- coding: utf-8 -*- from flask_assets import Bundle, Environment css = Bundle( "libs/bootstrap/dist/css/bootstrap.css", "libs/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css", "css/style.css", filters="cssmin", output="public/css/common.css" ) js = Bundle( "libs/jQuery/dist/jquery...
Jaza/colorsearchtest
colorsearchtest/assets.py
Python
apache-2.0
624
# Copyright 2011 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 req...
redhat-openstack/glance
glance/openstack/common/fileutils.py
Python
apache-2.0
3,853
"""distutils.errors Provides exceptions used by the Distutils modules. Note that Distutils modules may raise standard exceptions; in particular, SystemExit is usually raised for errors that are obviously the end-user's fault (eg. bad command-line arguments). This module is safe to use in "from ... import *" m...
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/distutils/errors.py
Python
gpl-2.0
3,710
from unittest import skipIf from django.test import TestCase from django.test.utils import override_settings from django.db import connection from django.db.migrations.loader import MigrationLoader, AmbiguityError from django.db.migrations.recorder import MigrationRecorder from django.utils import six class Recorder...
rogerhu/django
tests/migrations/test_loader.py
Python
bsd-3-clause
4,238
# # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
mheap/ansible
test/units/plugins/cliconf/test_slxos.py
Python
gpl-3.0
4,208
import random, sys, json class Quotes: def __init__(self, owner, logger, header): self.owner = owner self.quote_list = [] self.logger = logger self.header = header # the load_quotes function takes two arguments # The first argument is the file path of the file to load # ...
joeYeager/reddit-quote-bot
src/quote.py
Python
mit
1,546
import os import os.path import time import logging import importlib import multiprocessing from configparser import SafeConfigParser, NoOptionError from wikked.db.base import DatabaseUpgradeRequired from wikked.endpoint import create_endpoint_infos from wikked.fs import FileSystem from wikked.auth import UserManager f...
ludovicchabant/Wikked
wikked/wiki.py
Python
apache-2.0
17,591
## python 3.3 or later from functools import wraps def debug(funk): msg = funk.__qualname__ @wrap(funk) def wrapper(*args, **kwargs): print(func.__name__) print(msg) return func(*args, **kwargs) return wrapper funk = debug(funk)
abhishekkr/tutorials_as_code
talks-articles/languages-n-runtimes/python/PyConUS2013/Intro_to_MetaClasses/01-debugly.py
Python
mit
252
"""The serialization logic""" import cPickle import copy class InvalidFile(Exception): """The file used to thaw an item was not a valid serialized file""" class Bag(object): """Bag to hold properties""" def __init__(self, **kw): """Initialise the bag""" for name, value in kw.iteritems(): ...
smmosquera/serge
serialize.py
Python
lgpl-3.0
4,746
from rest_framework import serializers from cms.common import mixins from .models import NavModule, NavModuleItem class NavModuleItemSerializer(serializers.ModelSerializer): name = serializers.ReadOnlyField(source='get_name') route = serializers.ReadOnlyField() class Meta: model = NavModuleItem ...
HurtowniaPixeli/pixelcms-server
cms/nav/serializers.py
Python
mit
1,101
''' Fetch simplified WKT boundaries for 2014 congressional districts and save in CSV format: state,district,polygon ''' import requests import csv BASE_URL = "https://gis.govtrack.us" CD_2014_URL = "/boundaries/cd-2014/?limit=500" # get meta boundary r = requests.get(BASE_URL + CD_2014_URL) j = r.json() bounda...
legis-graph/legis-graph
src/fetchDistricts.py
Python
mit
671
""" Contains the protocols, commands, and client factory needed for the Server and Portal to communicate with each other, letting Portal work as a proxy. Both sides use this same protocol. The separation works like this: Portal - (AMP client) handles protocols. It contains a list of connected sessions in a d...
google-code-export/evennia
src/server/amp.py
Python
bsd-3-clause
24,783
# Atomic covalent radius data # http://www.periodictable.com/Properties/A/CovalentRadius.an.html # Updated Jun. 9th, 2016 class Covalent(object): x = { "H": 0.37, "He": 0.32, "Li": 1.34, "Be": 0.90, "B": 0.82, "C": 0.77, "N": 0.75, "O": 0.73, "F": 0.71, "Ne": 0.69, "Na": 1.54, "Mg": 1.30, "Al":...
stczhc/neupy
tests/fitting/coval.py
Python
mit
1,681
""" Traits constituting sets of types. """ from itertools import chain from .coretypes import (Unit, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, complex64, complex128, bool_, Decimal, TimeDelta, Option) __all__ = ['TypeSet', 'm...
ContinuumIO/datashape
datashape/typesets.py
Python
bsd-2-clause
5,475
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mengxn/tensorflow
tensorflow/contrib/rnn/__init__.py
Python
apache-2.0
3,284
"""Preference management for cloud.""" from ipaddress import ip_address from .const import ( DOMAIN, PREF_ENABLE_ALEXA, PREF_ENABLE_GOOGLE, PREF_ENABLE_REMOTE, PREF_GOOGLE_SECURE_DEVICES_PIN, PREF_CLOUDHOOKS, PREF_CLOUD_USER, InvalidTrustedNetworks) STORAGE_KEY = DOMAIN STORAGE_VERSION = 1 _UNDEF = object...
MartinHjelmare/home-assistant
homeassistant/components/cloud/prefs.py
Python
apache-2.0
3,606
# yapf: disable import ray # __doc_import_begin__ from ray import serve from io import BytesIO from PIL import Image import requests import torch from torchvision import transforms from torchvision.models import resnet18 # __doc_import_end__ # yapf: enable # __doc_define_servable_begin__ class ImageModel: def _...
richardliaw/ray
python/ray/serve/examples/doc/tutorial_pytorch.py
Python
apache-2.0
2,022
# -*- coding: utf-8 -*- """Pylab (matplotlib) support utilities.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from io import BytesIO from IPython.core.display import _pngxy from IPython.utils.decorators import flag_calls # If user specifies a GUI, that dict...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/IPython/core/pylabtools.py
Python
bsd-2-clause
14,139
""" Django admin page for CourseOverviews, the basic metadata about a course that is used in user dashboard queries and other places where you need info like name, and start dates, but don't actually need to crawl into course content. """ from __future__ import absolute_import from config_models.admin import Configura...
jolyonb/edx-platform
openedx/core/djangoapps/content/course_overviews/admin.py
Python
agpl-3.0
2,355
from typing import Dict, Optional, Text import ujson from zerver.lib.test_classes import WebhookTestCase from zerver.lib.webhooks.git import COMMITS_LIMIT from zerver.models import Message class GithubV1HookTests(WebhookTestCase): STREAM_NAME = None # type: Optional[Text] URL_TEMPLATE = u"/api/v1/external/g...
mahim97/zulip
zerver/webhooks/github/tests.py
Python
apache-2.0
16,526
# Copyright 2017 TWO SIGMA OPEN SOURCE, 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 agre...
twosigma/beaker-notebook
beakerx/beakerx/easyform/easyform.py
Python
apache-2.0
7,322
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import accounting.apps.books.utils from django.conf import settings import datetime import accounting.libs.checks import django.core.validators from decimal import Decimal class Migration(migrations.Migration): ...
dulaccc/django-accounting
accounting/apps/books/migrations/0001_initial.py
Python
mit
1,237
__version__ = version = '1.2.3'
editeodoro/Bbarolo
pyBBarolo/_version.py
Python
gpl-2.0
32
# (c) Fastly, inc 2016 # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ callback: selective callback_type: stdout requirements:...
alxgu/ansible
lib/ansible/plugins/callback/selective.py
Python
gpl-3.0
10,438
# Copyright 2019 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, ...
google/clusterfuzz
src/clusterfuzz/_internal/bot/untrusted_runner/remote_process_host.py
Python
apache-2.0
4,764
"""Module containing class for AWS's Glue Crawler.""" import json from typing import Any, Dict, Optional, Tuple from absl import flags from perfkitbenchmarker import data_discovery_service from perfkitbenchmarker import providers from perfkitbenchmarker import vm_util from perfkitbenchmarker.providers.aws import util...
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/providers/aws/aws_glue_crawler.py
Python
apache-2.0
6,215
from piservices import PiService class MusicPlayerDaemonService(PiService): name = 'pimpd' apt_get_install = [ 'mpd', 'mpc', 'alsa-utils'] path_to_music = '/var/lib/mpd/music' init_script = 'installed' config_file = '/etc/mpd.conf' config_file_tpl = 'src/mpd.conf' #TODO mpd conf ...
creative-workflow/pi-setup
services/pimpd/__init__.py
Python
mit
1,226
''' Implementation of a Twisted Modbus Server ------------------------------------------ ''' import traceback from binascii import b2a_hex from twisted.internet import protocol from twisted.internet.protocol import ServerFactory from pymodbus.constants import Defaults from pymodbus.factory import ServerDecoder from p...
mjfarmer/scada_py
pymodbus/pymodbus/server/async.py
Python
gpl-3.0
11,362
'''Integration tests with urllib3''' # coding=utf-8 import pytest import pytest_httpbin import vcr from assertions import assert_cassette_empty, assert_is_json urllib3 = pytest.importorskip("urllib3") @pytest.fixture(scope='module') def verify_pool_mgr(): return urllib3.PoolManager( cert_reqs='CERT_REQU...
ByteInternet/vcrpy
tests/integration/test_urllib3.py
Python
mit
5,351
from context import fasin from fasin import parse, prep import unittest, sys, os, shutil here = os.path.dirname(os.path.realpath(__file__)) prog = os.path.join(here, 'add13.f90') #prog = os.path.join(here, 'temp.f90') class TestParser(unittest.TestCase): def _test_prep(self): preprocessed = prep(prog) ...
grnydawn/fasin
tests/test_fortparser.py
Python
gpl-3.0
529
import sys import PIL.Image from api import trans_image def convert(): if len(sys.argv) != 4: print >> sys.stderr, 'Usage:' print >> sys.stderr, ' erix MODE SRC DEST' return sys.exit(1) mode = sys.argv[1] src = sys.argv[2] dest = sys.argv[3] im = PIL.Image.open(src) ...
neuront/eirx
src/eirx/main.py
Python
mit
675
from datetime import datetime class StringBaseUtil(object): def __init__(self, string): self.string = string def to_datetime(self): _datetime = None formats = [ '%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%d', ] exceptions...
eyalev/jsonapp
jsonapp/utils/string_base_util.py
Python
mit
616
# -*- coding: utf-8 -*- import unittest from hamlish_jinja import Hamlish, Output import testing_base class TestDebugOutput(testing_base.TestCase): def setUp(self): self.hamlish = Hamlish( Output(indent_string=' ', newline_string='\n', debug=True)) def test_html_tags(self): ...
Pitmairen/hamlish-jinja
tests/test_debug_output.py
Python
bsd-3-clause
3,732
from nslsii.detectors.zebra import (EpicsSignalWithRBV, ZebraPulse, ZebraFrontOutput12, ZebraFrontOutput3, ZebraFrontOutput4, Zebr...
NSLS-II-CHX/ipython_ophyd
startup/98-xspress3.py
Python
bsd-2-clause
8,345
#!/usr/bin/env python # Copyright 2011 VMware, 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 # #...
Juniper/neutron
neutron/server/__init__.py
Python
apache-2.0
2,276
#!/usr/bin/python import os import shlex from time import time, sleep import sys from sys import stdout from subprocess import Popen, PIPE from qtrotate import get_set_rotation __author__ = "Joshua Hollander" __email__ = "jholla14@gmail.com" __copyright__ = "Copyright 2013, Joshua Hollander" FNULL = open(os.devnull,...
jho/shrinkage
shrinkage.py
Python
apache-2.0
2,671
from django.utils.translation import ugettext_lazy as _ import horizon from contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking.panel \ import Networking from contrail_openstack_dashboard.openstack_dashboard.dashboards.admin.networking.panel \ import AdminNetworking from contrail_op...
Juniper/contrail-horizon
overrides.py
Python
apache-2.0
3,033
import sys import subprocess import time import re import os import simplejson as json import getopt from run_manager import RunManager, RainOutputParser ''' Example config { "profilesCreatorClass": "radlab.rain.workload.httptest.HttpTestProfileCreator", "profilesCreatorClassParams": { "baseHostIp": "1...
umbrant/rain-workload-toolkit
utils/testplan.py
Python
bsd-3-clause
7,749
import sqlite3 con = sqlite3.connect("blog.db") c = con.cursor() c.execute('''CREATE TABLE users (id text, fname text, lname text, email text, password text, online integer)''') con.commit() c.execute('''CREATE TABLE posts (uid text, pid text, title text, content text, date text)''') con.comm...
andela-bojengwa/My-Flask-Blog
models/toSQL.py
Python
apache-2.0
451
from __future__ import print_function from __future__ import division ALIGN_LEFT = '<' ALIGN_CENTER = '_' ALIGN_RIGHT = '>' def pprint(data, header=None, dictorder=None, align=None, output_file=None): if ((dict is type(data[0])) and (dictorder is None)): dictorder = data[0].keys() if ((dict is type(da...
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/windows/sentinel/table_print.py
Python
unlicense
3,527
# -*- coding: utf-8 -*- # $Id$ # # Copyright (c) 2007-2011 Otto-von-Guericke-Universität Magdeburg # # This file is part of ECSpooler. # import os import sys import time import thread import threading import xmlrpclib import traceback import logging from types import StringTypes from types import DictionaryType # loc...
collective/ECSpooler
lib/Spooler.py
Python
gpl-2.0
25,028
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import os import re from collections import defaultdict from StringIO import StringIO from lxml import etree from lxml import isoschematron import xlrd class XmlValidator(object): NS_XML_SCHEMA_INSTANCE = "http...
0x0mar/conpot
conpot/tests/helpers/mitre_stix_validator.py
Python
gpl-2.0
41,024
import pymysql import warnings class DBException(Exception): def __init__(self, msg=""): Exception.__init__(self, msg) class PySECO_DB(): def __init__(self, pyseco, host, username, password, db): self.pyseco = pyseco try: self.conn = pymysql.connect( host=...
Hakuba/pyseco
src/db.py
Python
gpl-3.0
13,648
import logging logger = logging.getLogger('superdesk') logger.setLevel(logging.INFO) LOGGING_TEMPLATE = "\033[1m\033[03{color}mVerifiedPixel: \033[0m{msg}" def info(msg): return logger.info(LOGGING_TEMPLATE.format(msg=msg, color=6)) def warning(msg): return logger.warning(LOGGING_TEMPLATE.format(msg=msg...
thnkloud9/verifiedpixel
server/vpp/verifiedpixel/logging.py
Python
agpl-3.0
836
# -*- coding: utf-8 -*- # Copyright 2020 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from psycopg2 import IntegrityError from odoo.tests.common import TransactionCase class TestCarrierCategory(TransactionCase): def test_code_unique(self): vals = ...
OCA/carrier-delivery
delivery_carrier_category/tests/test_carrier_category.py
Python
agpl-3.0
835
################################################################################ # 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...
mbode/flink
flink-python/setup.py
Python
apache-2.0
10,045
from datetime import datetime, time, timedelta, tzinfo from typing import Optional, Union, cast import warnings import numpy as np from pandas._libs import lib, tslib from pandas._libs.tslibs import ( BaseOffset, NaT, NaTType, Resolution, Timestamp, conversion, fields, get_resolution, ...
iproduct/course-social-robotics
11-dnn-keras/venv/Lib/site-packages/pandas/core/arrays/datetimes.py
Python
gpl-2.0
79,761
# -*- coding: utf-8 -*- """Top-level display functions for displaying object in different formats.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import json import mimetypes import os import struct import warnings from I...
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/IPython/core/display.py
Python
mit
33,202
#!/usr/bin/env python3 def count_consonants(string): """ Function which returns the count of all consonants in the string \"string\" """ consonants = "bcdfghjklmnpqrstvwxz" counter = 0 if string: for ch in string.lower(): if ch in consonants: counter += 1 ...
sevgo/Programming101
week1/warmups/count_consonants.py
Python
bsd-3-clause
468
#!/usr/bin/env python from ucgrad import zeros, array, arange, write_matrix import timeit #from pylab import plot, show def best(run, setup, n): best = 1e20 for i in range(n): t = timeit.timeit(run, setup, number=1) if t < best: best = t return best trans = [(1,2,0,3), (0,3,2...
frobnitzem/slack
examples/timings/ttr.py
Python
gpl-3.0
760
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License.import string import string import random import numpy as np """ function for calculating the convergence of an x, y data set main api: test_conv(xs, ys, name, tol) tries to fit multiple functions to the x, ...
dongsenfo/pymatgen
pymatgen/util/convergence.py
Python
mit
14,788
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20150606_0342'), ] operations = [ migrations.AlterField( model_name='element', name...
SanaMobile/sana.protocol_builder
src-django/api/migrations/0004_auto_20150623_1841.py
Python
bsd-3-clause
1,251
"""Tests for the Device Registry.""" import asyncio from unittest.mock import patch import asynctest import pytest from homeassistant.core import callback from homeassistant.helpers import device_registry from tests.common import flush_store, mock_device_registry @pytest.fixture def registry(hass): """Return a...
Teagan42/home-assistant
tests/helpers/test_device_registry.py
Python
apache-2.0
16,243
from django.core import mail from reviewboard.reviews.models import Review from reviewboard.webapi.resources import resources from reviewboard.webapi.tests.base import BaseWebAPITestCase from reviewboard.webapi.tests.mimetypes import (review_reply_item_mimetype, review_r...
reviewboard/reviewboard
reviewboard/webapi/tests/test_review_reply.py
Python
mit
12,104
# -*- coding: utf-8 -*- """ flask.testsuite.blueprints ~~~~~~~~~~~~~~~~~~~~~~~~~~ Blueprints (and currently modules) :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest import warnings from flask.testsuite import FlaskTestCase, emi...
zwChan/VATEC
~/eb-virt/Lib/site-packages/flask/testsuite/blueprints.py
Python
apache-2.0
28,089
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py
Python
mit
3,214
#!/usr/bin/python2 # if not specified, learning rate for RNN = 0.001, for others = 0.1 # `full` in dir name means using both training & validation set to train the model # git branch `diff`: using the difference between adjacent frame pair as model input # git branch `filter`: only using part of the categories # fra...
forwchen/yt8m
fusion/simple_fusion.py
Python
apache-2.0
4,444
import logging import signal import socket import configparser import importlib.machinery import serial import copy import zmq class Dispatcher(object): """ Superclass for all Dispatchers. This is the part of the simulator that handles the connections. """ def __init__(self, dispatcher_type, dispatche...
InTraffic/TSTK
TSTK/dispatcher.py
Python
gpl-3.0
20,467
__simple_example = ''' - task: process.tasks.slack.send_message args: message: 'hello!' ''' __meta = { 'args': { 'message': { 'type': 'str', 'default': 'hello world'}, }, 'examples': [ { 'title': 'Basic usage', 'description': __simple_example }, ] } def say_hello(message='hello wo...
toast38coza/DJProcess
process/tasks/io/say_hello.py
Python
mit
463
"""Library for handling batch HTTP requests for apitools.""" import collections import email.generator as generator import email.mime.multipart as mime_multipart import email.mime.nonmultipart as mime_nonmultipart import email.parser as email_parser import itertools import StringIO import time import urllib import url...
ychen820/microblog
y/google-cloud-sdk/lib/googlecloudapis/apitools/base/py/batch.py
Python
bsd-3-clause
14,581
### # Copyright (c) 2013, KG-Bot # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions, and t...
kg-bot/SupyBot
plugins/ESim/test.py
Python
gpl-3.0
1,722
''' Created on = '7/9/14" Author = 'mmunn' Unit test : EUCA-8906 De-register/Re-register of Cluster with Different Name Doesn't Work setUp : Install Credentials, test : De-register a cluster Re-register Cluster with Different Name make sure it goes to ENABLED tearDown : Cl...
shaon/eutester
testcases/cloud_admin/4-0/euca8906.py
Python
bsd-2-clause
3,119
# Copyright 2015, 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. # mapping from protocol to python class. The protocol matches the string # used by vttablet as a -binlog_player_protocol parameter. update_stream_conn_classes = dict(...
danielmt/vshard
vendor/github.com/youtube/vitess/py/vtdb/update_stream.py
Python
mit
2,847
from django.contrib.auth.models import User from tastypie import fields from tastypie.resources import ModelResource from userprofile.models import UserProfile class UserResource(ModelResource): class Meta: queryset = User.objects.all() resource_name = 'user' fields = ['id','username'] ...
peasnrice/pamplemousse
userprofile/api.py
Python
mit
542
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.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 Lice...
phw/weblate
weblate/legal/forms.py
Python
gpl-3.0
1,055
import urllib.request import simplejson from book import Book # right? it's in this package __author__ = 'braxton' class Lookup(object): def __init__(self): self.lookup_url = "http://openlibrary.org/api/books?bibkeys=" self.search_url = "http://openlibrary.org/search.json?" def _get_publi...
bjschafer/pyberry
Pyberry/com/bjschafer/pyberry/lookup.py
Python
gpl-3.0
3,861
<<<<<<< HEAD <<<<<<< HEAD import unittest import sys import os import subprocess import shutil from copy import copy from test.support import (run_unittest, TESTFN, unlink, check_warnings, captured_stdout, skip_unless_symlink) import sysconfig from sysconfig import (get_paths, get_platform, ...
ArcherSys/ArcherSys
Lib/test/test_sysconfig.py
Python
mit
50,780
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.p...
jtrobec/pants
src/python/pants/backend/project_info/register.py
Python
apache-2.0
1,316
import matplotlib.pylab as plt import numpy as np fig1 = plt.figure(figsize=(8,6)) ax = fig1.add_subplot(111) ax.plot(np.arange(0,100), np.arange(0,100), 'b-', linewidth =2) plt.tight_layout() plt.show
bps10/emmetrop
doc/source/pyplots/AxisFormatDemo1.py
Python
mit
209
''' ==================================================================== Copyright (c) 2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ===========================================================...
barry-scott/git-workbench
Source/Git/wb_git_credentials_dialog.py
Python
apache-2.0
2,228
''' Created on Aug 26, 2014 @author: preethi ''' import os import sys import shutil sys.path.insert(0,os.path.abspath(os.path.dirname(__file__) + '/' + '../..')) #trick to make it run from CLI import unittest import pydot from jnpr.openclos.model import Device, InterfaceDefinition from jnpr.openclos.writer import Con...
yunli2004/OpenClos
jnpr/openclos/tests/unit/test_writer.py
Python
apache-2.0
5,203
import sys import time import yappi def generate_func(func_name, code): code = """def {0}(*args, **kwargs): {1}""".format(func_name, code) exec(code, globals(), locals()) func = locals()[func_name] globals()[func.__name__] = func return func print("Generating functions...") FUNC_COUNT = int(sys...
sumerc/yappi
tests/manual/_test_performance2.py
Python
mit
872
from modules.module import Module import random class DiceRoller(Module): def __init__(self, client): Module.__init__(self, 'DiceRoller', client) def get_commands(self): return {'!roll': self.roll_dice} async def roll_dice(self, message, content): minval = 1 maxval = 100 ...
chudooder/BotDooder
modules/diceroller.py
Python
gpl-3.0
1,938
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019 RERO # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that...
rero/reroils-app
tests/unit/test_utils.py
Python
gpl-2.0
4,590
class Solution: def nextGreatestLetter(self, letters, target): """ :type letters: List[str] :type target: str :rtype: str """ if target >= letters[-1] or target < letters[0]: return letters[0] for i in range(1, len(letters)): if target < l...
YiqunPeng/Leetcode-pyq
solutions/744FindSmallestLetterGreaterThanTarget.py
Python
gpl-3.0
364
# vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2006, Mathieu Fenniak # 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 copyrig...
3dfxsoftware/cbss-addons
openerp_print/pyPdf/generic.py
Python
gpl-2.0
28,159
# markdown is released under the BSD license # Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) # Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) # Copyright 2004 Manfred Stienstra (the original version) # # All rights reserved. # # Redistribution and use in source and binary forms, with or...
nwjs/chromium.src
third_party/markdown/treeprocessors.py
Python
bsd-3-clause
14,596
import logging import pytest from django.test import override_settings from osmaxx.core.templatetags.navigation import siteabsoluteurl, logger @override_settings( OSMAXX=dict( ) ) def test_siteabsoluteurl_without_secured_proxy_adds_scheme_and_netloc_and_path_prefix(rf, log_warning_mock): relative_url = ...
geometalab/osmaxx
tests/core/templatetags/test_navigation.py
Python
mit
4,931
# Copyright 2008 Peter Bulychev # http://clonedigger.sourceforge.net # # This file is part of Clone Digger. # # Clone Digger 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 o...
h2oloopan/easymerge
EasyMerge/clonedigger/js_antlr.py
Python
mit
3,119
# -*- coding: utf-8 -*- import unittest from coding_challenge import find_related_tags stream1 = [ 'system.load.1|1|host:a,role:web,region:us-east-1a', 'system.load.15|1|host:b,role:web,region:us-east-1b', 'system.cpu.user|20|host:a,role:web,region:us-east-1a', 'postgresql.locks|12|host:c,role:db...
topliceanu/learn
interview/datadog/test_coding_challenge.py
Python
mit
1,633
from tokens.andd import And from tokens.expression import Expression from tokens.iff import Iff from tokens.kfalse import ConstantFalse from tokens.ktrue import ConstantTrue from tokens.nop import Not from tokens.orr import Or from tokens.then import Then from tokens.variable import Variable class TokenParser: ""...
LonamiWebs/Py-Utils
logicmind/token_parser.py
Python
mit
3,318
import os import functools import pytest import lammps # Redefine Lammps command-line args so no annoying logs or stdout Lammps = functools.partial(lammps.Lammps, args=[ '-log', 'none', '-screen', 'none' ]) # Lammps command line arguments def test_lammps_init_default_units(): lmp = Lammps() assert ...
costrouc/lammps-python
lammps/test/test_lammps.py
Python
gpl-3.0
2,816
# -*- coding: utf-8 -*- from boxbranding import getBoxType import struct, socket, fcntl, sys, os, time from sys import modules import os import time def getVersionString(): return getImageVersionString() def getImageVersionString(): try: if os.path.isfile('/var/lib/opkg/status'): st = os.stat('/var/lib/opkg/st...
vitmod/dvbapp
lib/python/Components/About.py
Python
gpl-2.0
5,538
import os from os.path import exists import pytest from pip._internal.locations import write_delete_marker_file from pip._internal.status_codes import PREVIOUS_BUILD_DIR_ERROR from tests.lib import need_mercurial from tests.lib.local_repos import local_checkout def test_cleanup_after_install(script, data): """ ...
zvezdan/pip
tests/functional/test_install_cleanup.py
Python
mit
4,518
#!/usr/bin/env python # -*- coding:utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distr...
yaacov/ttkyaml
src/ttkyaml/ttkyaml.py
Python
gpl-2.0
7,272
from fontTools.misc.arrayTools import pairwise from fontTools.pens.filterPen import ContourFilterPen __all__ = ["reversedContour", "ReverseContourPen"] class ReverseContourPen(ContourFilterPen): """Filter pen that passes outline data to another pen, but reversing the winding direction of all contours. Compo...
google/material-design-icons
update/venv/lib/python3.9/site-packages/fontTools/pens/reverseContourPen.py
Python
apache-2.0
3,849
# Copyright 2016 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. # pylint: disable=W0201 from recipe_engine import recipe_api from . import builder_name_schema class BuilderNameSchemaApi(recipe_api.RecipeApi): def ...
youtube/cobalt
third_party/skia_next/third_party/skia/infra/bots/recipe_modules/builder_name_schema/api.py
Python
bsd-3-clause
1,233
# -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fi...
b3j0f/schema
b3j0f/schema/__init__.py
Python
mit
2,642
# 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/. import pytest from selenium.common.exceptions import TimeoutException from pages.firefox.whatsnew.whatsnew import Firef...
sgarrity/bedrock
tests/functional/firefox/whatsnew/test_whatsnew.py
Python
mpl-2.0
1,563
def install(job): service = job.service service.executeAction('printx', context=job.context, args={"tags":['a', 'C', 'b']}) def printx(job): print("Executing printx in test1")
Jumpscale/ays9
tests/test_services/test_list_jobs/actorTemplates/test1/actions.py
Python
apache-2.0
189
from django.conf.urls import url, include from django.conf.urls.i18n import i18n_patterns from django.conf.urls.static import static from django.contrib import admin from django.conf import settings urlpatterns = [ url(r'^admin/', admin.site.urls), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT...
doctormo/django-cmsplugin-diff
demo/urls.py
Python
agpl-3.0
539
# Copyright 2015, Cisco Systems. # # 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 wri...
redhat-openstack/ironic
ironic/drivers/modules/cimc/management.py
Python
apache-2.0
6,171
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Miscellaneous node types. ''' import os.path from grit.node import base from grit.node import message from grit import ex...
rwatson/chromium-capsicum
tools/grit/grit/node/misc.py
Python
bsd-3-clause
8,674
# Droog # Copyright (C) 2015 Adam Miezianko # # 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. # # This program is distr...
abeing/droog
droog/creature.py
Python
gpl-2.0
7,412
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
google-research/language
language/compgen/nqg/tasks/spider/sql_tokenizer.py
Python
apache-2.0
1,049
import numpy as np import sys from trw_utils import * from heterogenous_crf import inference_gco from pyqpbo import binary_general_graph from scipy.optimize import fmin_l_bfgs_b def trw(node_weights, edges, edge_weights, y, max_iter=100, verbose=0, tol=1e-3, get_energy=None): n_nodes, n_states =...
kondra/latent_ssvm
smd.py
Python
bsd-2-clause
3,199
#/usr/bin/env python # -#- coding: utf-8 -#- # # # # standard copy right text # # Initial version: 2012-04-02 # Author: Amnon Janiv """ .. module:: samples :synopsis: Explore equity master package Demonstrates how file related processes are pipelined between cooperating process using input and output queu...
ajaniv/equitymaster
scripts/samples.py
Python
gpl-2.0
5,763
# -*- coding: utf-8 -*- import threading import re import sys import six from six import string_types # Python3 queue support. try: import Queue except ImportError: import queue as Queue from telebot import logger class WorkerThread(threading.Thread): count = 0 def __init__(self, exceptio...
dzmuh97/OpenOrioks
telebot/util.py
Python
gpl-3.0
7,051
../../../../../share/pyshared/keyring/tests/test_cli.py
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/dist-packages/keyring/tests/test_cli.py
Python
gpl-3.0
55