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/python3
#coding=utf-8
#Лицензия GPL v3
#Автор: Алексей Butylkus, https://vk.com/butpub, https://www.youtube.com/user/butylkus
import os, sys, time
import Adafruit_DHT as dht
from datetime import datetime
sensor = 11
pin = 14
while True:
humidity, temperature = dht.read_retry(sensor, pin)
if (humid... | Butylkus/BuRasPi | 05-dht11.py | Python | gpl-3.0 | 621 |
#!/usr/bin/env python
# Plot a graph of Data which is comming in on the fly
# uses pylab
# Author: Norbert Feurle
# Date: 12.1.2012
# License: if you get any profit from this then please share it with me
import pylab
from pylab import *
xAchse=pylab.arange(0,100,1)
yAchse=pylab.array([0]*100)
fig = pylab.figure(1)
ax... | dewtx29/python_ann | python/pydev_ann/Graph/RealTimeGraph/realtimeGraph4.py | Python | gpl-3.0 | 1,414 |
from django.db import models
# Create your models here.
class Currency(models.Model):
name = models.CharField(verbose_name='Название', max_length=255)
short_name = models.CharField(verbose_name='Сокращение', max_length=255)
is_main = models.BooleanField(verbose_name='Основная валюта', default=False)
... | juntatalor/qexx | payment/models.py | Python | mit | 1,246 |
"""Management utilities."""
from fabric.contrib.console import confirm
from fabric.api import abort, env, local, settings, task, sudo, cd, lcd, put, run, prefix, get
from fabric.contrib.files import exists
from etapi.settings import ProdConfig
########## CONFIG
local_app_dir = '.'
local_config_dir = './config'
r... | hypebeast/etapi | fabfile.py | Python | bsd-3-clause | 7,752 |
#!/usr/bin/env python
"""
Copyright 2015 Scott Wales
author: Scott Wales <scott.wales@unimelb.edu.au>
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... | ScottWales/ftools | test/format/test_base.py | Python | apache-2.0 | 892 |
import os
import os.path as op
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin
from flask.ext.admin.contrib.sqla import ModelView
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
# Crea... | stevehof/location-ninja | lib/examples/layout/simple.py | Python | gpl-3.0 | 6,066 |
#!/usr/bin/env python
from generator.actions import Actions
import random
import struct
import string
import sys
class carstate():
def __init__(self):
self.speed = 0
self.fuel = 65535
self.rpm = 0
self.info_state = 0
self.info_volume = 0
self.car_power = 0
self.gear = TIACA.GEARS_PARK
self.gear_stat... | f0rki/cb-multios | original-challenges/TIACA/poller/for-testing/machine.py | Python | mit | 7,012 |
import functools
import os
import threading
from collections import defaultdict
from funcy import cached_property, wrap_prop
from dvc.progress import DEFAULT_CALLBACK
from dvc.scheme import Schemes
from .fsspec_wrapper import ObjectFSWrapper
_AWS_CONFIG_PATH = os.path.join(os.path.expanduser("~"), ".aws", "config")... | efiop/dvc | dvc/fs/s3.py | Python | apache-2.0 | 7,787 |
#!/usr/bin/env python
"""
Local Schedule Object
"""
import calendar
from time import mktime as _mktime
from ..debugging import bacpypes_debugging, ModuleLogger
from ..core import deferred
from ..task import OneShotTask
from ..primitivedata import Atomic, Null, Unsigned, Date, Time
from ..constructeddata import Arr... | JoelBender/bacpypes | py27/bacpypes/local/schedule.py | Python | mit | 22,187 |
"""Response classes.
The seek_wrapper code is not used if you're using UserAgent with
.set_seekable_responses(False), or if you're using the urllib2-level interface
HTTPEquivProcessor. Class closeable_response is instantiated by some handlers
(AbstractHTTPHandler), but the closeable_response interface is only depende... | ppizarror/TerminalDictionary | lib/mechanize/_response.py | Python | gpl-2.0 | 17,803 |
#!/usr/bin/python3
import datetime #for current date and time
import os #getpid()
import paths #global paths
import queue #for sequencing output messages
import re #need some regex support
import threading #current thread identification
#log level for determining how important ... | zebra6/tux_2.0 | util/p_log.py | Python | apache-2.0 | 7,824 |
"""A selection of useful functions for optics, especially Fourier optics. The
documentation is designed to be used with sphinx (still lots to do)
Note that this comes directly from a preliminary version of the astro-optics
repository. TODO: Replace this with either a release version of astro-optics
or an appropriate l... | mikeireland/pymfe | pymfe/optics.py | Python | mit | 17,674 |
import webbrowser
import fresh_tomatoes
"""Defines the class movie to show the attributes of the movies represented by
the multiple instances of the class"""
class Movie():
def __init__(self, movie_title, movie_storyline, poster_image,
trailer_youtube):
self.title = movie_title... | TanayChowdhury/movie_list | media.py | Python | bsd-3-clause | 3,199 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/jws | jws/jwt.py | Python | apache-2.0 | 9,120 |
# Copyright 2015 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... | eerwitt/tensorflow | tensorflow/python/training/input.py | Python | apache-2.0 | 60,007 |
import calendar
import datetime
import platform
import time
import urllib
import urlparse
import warnings
import stripe
from stripe import error, http_client, version, util
from stripe.multipart_data_generator import MultipartDataGenerator
def _encode_datetime(dttime):
if dttime.tzinfo and dttime.tzinfo.utcoffse... | boneil3/hyperAdmit | stripe/api_requestor.py | Python | mit | 12,207 |
"""
This is your project's main settings file that can be committed to your
repo. If you need to override a setting locally, use local.py
"""
import os
import logging
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.excepti... | TomWerner/sms_finance_tracker | django_project/settings/base.py | Python | bsd-3-clause | 9,651 |
#!-*- coding=utf8 -*-
from graphviz import Digraph
import queue
import random
class Node(object):
def __init__(self, value):
self.left = None
self.right = None
self.factor = 0
self.parent = None
self.value = value
def get_parent(self):
return self.parent
... | pihou/wheels | avltree.py | Python | gpl-3.0 | 4,947 |
# The clearinghouse testlib must be imported first.
from clearinghouse.tests import testlib
from clearinghouse.tests import mocklib
from clearinghouse.common.api import maindb
from clearinghouse.common.exceptions import *
from clearinghouse.common.util import validations
from clearinghouse.website.control import ... | SensibilityTestbed/clearinghouse | website/tests/ut_interface_changeuserkey.py | Python | mit | 5,700 |
from base_head_app import app, db
| jstacoder/flask-manage | flask_mrbob/templates/project/+project.name+/__init__.py | Python | bsd-3-clause | 34 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | franciscod/python-telegram-bot | telegram/ext/updater.py | Python | gpl-2.0 | 16,495 |
# -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2015 Trustcode - www.trustcode.com.br #
# Danimar Ribeiro <danimaribeiro@gmail.co... | Trust-Code/trust-addons | trust_tasks_github/models/github_integration.py | Python | agpl-3.0 | 1,993 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000462.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/BIOMD0000000462 | BIOMD0000000462/model.py | Python | cc0-1.0 | 427 |
# Copyright (c) by it's authors.
# Some rights reserved. See LICENSE, AUTHORS.
from peer import *
class Ping(Peer):
Ping = Pillow.InOut
def __init__(self, *args):
Peer.__init__(self, *args)
self._catch(Ping.In.Ping, self.message)
def message(self, pillow, feathers):
self._throw(... | FreshXOpenSource/wallaby-base | wallaby/pf/peer/ping.py | Python | bsd-2-clause | 353 |
import math
import random
import itertools
import sys
import thread
import time
from globalvals import *
from pointstream import PointStream
import dac
from entities.asteroid import Asteroid
ps = PointStream()
DRAW = ps
def dac_thread():
global DRAW
while True:
try:
d = dac.DAC(dac.... | topher515/laser-fingers | main.py | Python | mit | 4,031 |
import uuid
from datetime import datetime
from unittest import TestCase
import pytz
import colander
from unicore.comments.service.models import (
COMMENT_MAX_LENGTH, COMMENT_CONTENT_TYPES, COMMENT_MODERATION_STATES,
COMMENT_STREAM_STATES)
from unicore.comments.service.schema import (
Comment, Flag, Banned... | universalcore/unicore.comments | unicore/comments/service/tests/test_schema.py | Python | bsd-2-clause | 9,303 |
"""Batch Normalization for TensorFlow.
Parag K. Mital, Jan 2016.
"""
import tensorflow as tf
def batch_norm(x, phase_train, scope='bn', affine=True):
"""
Batch normalization on convolutional maps.
from: https://stackoverflow.com/questions/33949786/how-could-i-
use-batch-normalization-in-tensorflow
... | apoorva-sharma/deep-frame-interpolation | tensorflow_tutorials-master/python/libs/batch_norm.py | Python | mit | 1,891 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from django.test import RequestFactory
from django.urls import reverse
from mock import MagicMock
from nav.models.profiles import Account
from nav.web.info.room.views import create_csv
from nav.web.info.searchproviders import SearchProvider... | UNINETT/nav | tests/integration/web/info_test.py | Python | gpl-2.0 | 2,334 |
from django.conf import settings
from django.utils import timezone
from ..compat import is_authenticated
from ..models import SessionProfile
from .base import Base
class SessionProfileStore(Base):
"""
Backend that saves the link between session_key and user in the databse.
"""
def save_session(self,... | modelbrouwers/django-sessionprofile | sessionprofile/backends/db.py | Python | mit | 1,604 |
#!/bin/python
import xml.etree.ElementTree as et
import sys
import os
def usage():
print "Usage: "
print "p4.py <file path of PublishProfile file>"
def parse(path):
path = os.path.abspath(sys.argv[1])
print "Opening " + path + "\n"
doc = et.parse(path)
root = doc.getroot()
element = root.f... | rbnswartz/p4 | p4.py | Python | mit | 617 |
# Ant
#
# Copyright (c) 2015, Gustav Tiger <gustav@tiger.name>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, m... | Tigge/antfs-cli | antfs_cli/__init__.py | Python | mit | 1,169 |
#
# Copyright (c) 2013-2018 Balabit
# 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 of the License, or (at your option) any later version.
#
# This library is distrib... | herczy/typesafety | typesafety/noseplugin.py | Python | lgpl-2.1 | 3,825 |
from monthly_budget.models.income import Income
from monthly_budget.models.tax_bracket import TaxBracket
from monthly_budget.config import standard_deductions
from monthly_budget.config import tax_brackets
# todo COL deductions module?
# todo apply tax bracket to Income
# Step Create an Income object
# Step Pass inc... | cwiki/monthly_budget | monthly_budget/app.py | Python | mit | 722 |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.utils import six
from django.utils.functional import cached_property, lazy, lazy_property
class FunctionalTestCase(unittest.TestCase):
def test_lazy(self):
t = lazy(lambda: tuple(range(3)), list, tuple)
... | frishberg/django | tests/utils_tests/test_functional.py | Python | bsd-3-clause | 4,317 |
from django.db import models
from instruments.base import BaseTable
class Kiswahili_WS(BaseTable):
item_1_choices = [('produces', 'produces')]
item_1 = models.CharField(max_length=8, choices=item_1_choices, null=True)
item_2_choices = [('produces', 'produces')]
item_2 = models.CharField(max_length=8, ... | langcog/wordbank | instruments/schemas/Kiswahili_WS.py | Python | gpl-2.0 | 102,113 |
"""Support to enter a value into a text box."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
ATTR_MODE,
CONF_ICON,
CONF_... | joopert/home-assistant | homeassistant/components/input_text/__init__.py | Python | apache-2.0 | 5,598 |
"""
Contains application form definitions.
"""
from django import forms
from wagtailplus.wagtaillinks.models import Link
class EmailLinkForm(forms.models.ModelForm):
"""
Form for email link instances.
"""
class Meta(object):
model = Link
fields = ('link_type', 'title', 'email', 'ta... | thenewguy/wagtailplus | wagtailplus/wagtaillinks/forms.py | Python | bsd-2-clause | 1,276 |
#!/usr/bin/python
# removes any files in <targetdir> older than <purgeperiod> days
import os, sys, time, getopt
def get_filepaths(directory):
file_paths = []
for root, directories, files in os.walk(directory):
for filename in files:
filepath = os.path.join(root, filename)
file_... | forgeservicelab/ansible.backup-server | scripts/purge.py | Python | mit | 1,741 |
# -*- coding: utf-8 -*-
########################## Copyrights and license ############################
# #
# Copyright 2011-2015 Christian Lupien <christian.lupien@usherbrooke.ca> #
# ... | JeanOlivier/pyHegel | pyHegel/instruments/blueforsValves.py | Python | gpl-3.0 | 26,380 |
import numpy as np
import math
import scipy.integrate as integrate
from matplotlib import pyplot as plt
from matplotlib import mlab
from matplotlib import colors
from matplotlib import animation
from matplotlib import rc
X_MIN = -39.9
X_MAX = 39.9
X_POINTS = 500
Y_MIN = -19.9
Y_MAX = 24.5
Y_POINTS = 200
WELL_DEPTH ... | cdpruitt/total-neutron-cross-sections | theory/OMAnimation/WoodsSaxon.py | Python | gpl-3.0 | 5,498 |
#!/usr/bin/env python
'Set Glyph names to standard PostScript names based on values in the gsi.xml file.'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2015, SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__a... | bitforks/pysilfont | scripts/FFsetPSNames.py | Python | mit | 1,999 |
from __future__ import print_function
import warnings
import os.path as op
import copy as cp
from nose.tools import assert_true, assert_raises, assert_equal
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
import mne
from mne.datasets import testing
from mne.beamformer import... | jaeilepp/mne-python | mne/beamformer/tests/test_dics.py | Python | bsd-3-clause | 13,250 |
import django.forms
from ..utils import get_active_plugins_choices
class ChoosePostTypeForm(django.forms.Form):
post_types = django.forms.ChoiceField(
choices=get_active_plugins_choices())
class Meta:
fields = ['post_types']
| AASHE/django-bulletin | bulletin/tools/plugins/forms/plugin.py | Python | mit | 254 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
#
# 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 ... | 47lining/ansible-modules-core | utilities/logic/async_wrapper.py | Python | gpl-3.0 | 6,183 |
"""
WSGI config for teste project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | Dturati/projetoUFMT | teste/teste/wsgi.py | Python | mit | 388 |
"""
Define the SeriesGroupBy, DataFrameGroupBy, and PanelGroupBy
classes that hold the groupby interfaces (and some implementations).
These are user facing as the result of the ``df.groupby(...)`` operations,
which here returns a DataFrameGroupBy object.
"""
import collections
import copy
import warnings
from functoo... | amolkahat/pandas | pandas/core/groupby/generic.py | Python | bsd-3-clause | 58,252 |
from __future__ import absolute_import, division, print_function
from dynd import nd
from pandas import DataFrame
from blaze import compute, Table, by, into
from blaze.expr import Expr, TableSymbol, Field
from blaze.dispatch import dispatch
from blaze.server import Server
from blaze.server.index import parse_index, e... | vitan/blaze | blaze/server/tests/test_client.py | Python | bsd-3-clause | 2,083 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import include, url
from shop.urls import rest_api
from shop.urls import auth
from shop.urls import payment
app_name = 'shop'
urlpatterns = [
url(r'^api/', include(rest_api)),
url(r'^auth/', include(auth)),
url(r'^paym... | divio/django-shop | shop/urls/__init__.py | Python | bsd-3-clause | 348 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | AZed/duplicity | testing/tests/dup_timetest.py | Python | gpl-2.0 | 6,530 |
from .models import Concept, Type
from conceptpower import Conceptpower
from urlparse import urlparse
from django.conf import settings
logger = settings.LOGGER
class AuthorityManager(object):
pass
class ConceptpowerAuthority(AuthorityManager, Conceptpower):
__name__ = 'ConceptpowerAuthority'
endpoint ... | diging/jars | concepts/authorities.py | Python | gpl-3.0 | 4,956 |
# Interface for STSADM.EXE
#
# Allows users to execute STSADM operations by calling the
# run method. The run method takes an operation argument
# and a list of name-value pairs for the operation arguments
#
# import references
import clr
clr.AddReference("System")
from System import Environment
from Syste... | glenc/sp.py | src/sp/stsadm.py | Python | bsd-3-clause | 1,452 |
# -*- coding: utf-8 -*-
import pycurl
from module.network.HTTPRequest import BadHeader
from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
class BypassCaptchaException(Exception):
def __init__(self, err):
self.err = err
def g... | fayf/pyload | module/plugins/hooks/BypassCaptcha.py | Python | gpl-3.0 | 4,068 |
# -*- 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-cx | samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_async.py | Python | apache-2.0 | 1,636 |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanutils
~~~~~~~~~
Provides methods for interacting with a CKAN instance
Examples:
literal blocks::
python example_google.py
Attributes:
CKAN_KEYS (List[str]): available CKAN keyword arguments.
"""
from __future__ import (
absolute_import... | reubano/ckanutils | ckanutils.py | Python | mit | 29,704 |
from django.core import mail
from selenium.webdriver.common.keys import Keys
import re
from .base import FunctionalTest
TEST_EMAIL = 'edith@example.com'
SUBJECT = 'Your login link for Superlists'
class LoginTest(FunctionalTest):
def test_can_get_email_link_to_log_in(self):
# Edith goes to the awesome s... | jtmolon/obey_the_goat | superlists/functional_tests/test_login.py | Python | gpl-3.0 | 2,044 |
#!/usr/bin/env python
# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | wangcy6/storm_app | frame/c++/webrtc-master/tools_webrtc/get_landmines.py | Python | apache-2.0 | 3,131 |
# Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This p... | honeynet/beeswarm | beeswarm/drones/client/baits/pop3s.py | Python | gpl-3.0 | 2,819 |
import argparse
import idigbio
import json
import requests
parser = argparse.ArgumentParser(description='Read list of values from file and search for records matching in specified field.')
parser.add_argument('-i', '--inputfile', dest='inputfile', required=True, help="Input file must be one value per line.")
parser.ad... | danstoner/idigbio-scratch | pam_10k/pam_10k.py | Python | mit | 3,435 |
from MCNPtools import Gen
# example usage of the module
# first you initialize the tally by defining the bins: segment (surface number), angle (cosine) and energy (MeV)
cos = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
seg = [666,667]
erg =[1.000E-10, 1.259E-10, 1.585E-10, 1.995E-10, 2.512E-10, 3.162E-10,
... | ipostuma/MCNPtools | WriteTally.py | Python | gpl-3.0 | 1,830 |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="layout.polar.angularaxis.tickfont",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotl... | plotly/python-api | packages/python/plotly/plotly/validators/layout/polar/angularaxis/tickfont/_size.py | Python | mit | 535 |
#!/usr/bin/python
i = 0
numbers = []
while i < 6:
print "At the top i is %d" % i
numbers.append(i)
i += 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
print "the Numbers: "
for num in numbers:
print num
| hackinginformation/learnPythonTheHardWay | ex33.py | Python | gpl-2.0 | 252 |
from __future__ import print_function
from __future__ import division
from builtins import str
from builtins import range
import os
import pickle
import zipfile
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import seaborn as ... | GeoscienceAustralia/sifra | sira/infrastructure_response.py | Python | apache-2.0 | 18,123 |
# 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/timeseriesinsights/azure-mgmt-timeseriesinsights/azure/mgmt/timeseriesinsights/models/_time_series_insights_client_enums.py | Python | mit | 4,853 |
"""
DIRAC Wrapper to execute python and system commands with a wrapper, that might
set a timeout.
3 FUNCTIONS are provided:
- shellCall( iTimeOut, cmdSeq, callbackFunction = None, env = None ):
it uses subprocess.Popen class with "shell = True".
If cmdSeq is a string, it specifies the command string... | arrabito/DIRAC | Core/Utilities/Subprocess.py | Python | gpl-3.0 | 20,685 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | rcbops/nova-buildpackage | nova/tests/test_iptables_network.py | Python | apache-2.0 | 7,550 |
# -*- coding: utf-8 -*-
# Author(s): Andrea Colangelo (andreacolangelo@openforce.it)
# Copyright 2018 Openforce Srls Unipersonale (www.openforce.it)
# Copyright 2018 Sergio Corato (https://efatto.it)
# Copyright 2018-2019 Lorenzo Battistini <https://github.com/eLBati>
# License LGPL-3.0 or later (https://www.gnu.org/li... | linkitspa/l10n-italy | l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py | Python | agpl-3.0 | 11,390 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "base_data"
PROJECT_SPACE_DIR = "/home... | lypRobin/Botnav | turtlebot_base_data/build/base_data/catkin_generated/pkg.installspace.context.pc.py | Python | gpl-2.0 | 396 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from pytest import raises
from shapely.geometry import Polygon
from osmcha.changeset import ChangesetList
from osmcha.changeset import Analyse
from osmcha.changeset import WORDS
from osmcha.changeset import find_words
from os... | willemarcel/osmcha | tests/test_mod.py | Python | gpl-3.0 | 36,086 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: pysemeels.si.test_map
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Tests for the module :py:mod:`pysemeels.si.map`.
"""
###############################################################################
# Copyright 2017 Hendrix... | drix00/pysemeels | tests/si/test_map.py | Python | apache-2.0 | 4,419 |
# Copyright (C) 2020 Xin Liang <XLiang@suse.com>
# See COPYING for license information.
import re
import time
from contextlib import contextmanager
from . import utils
from . import config
from . import log
logger = log.setup_logger(__name__)
class SSHError(Exception):
"""
Custom exception for ssh error
... | ClusterLabs/crmsh | crmsh/lock.py | Python | gpl-2.0 | 5,164 |
import re
from collections import namedtuple
import sqlparse
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo,
)
from django.db.models import Index
from django.utils.regex_helper import _lazy_re_compile
FieldInfo = namedtuple('FieldInfo', BaseFi... | theo-l/django | django/db/backends/sqlite3/introspection.py | Python | bsd-3-clause | 19,222 |
"""
Enumerates active processes as seen under windows Task Manager on Win NT/2k/XP using PSAPI.dll
(new api for processes) and using ctypes.Use it as you please.
Based on information from http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q175030&ID=KB;EN-US;Q175030
By Eric Koome
email ekoome@yahoo.com
license G... | ActiveState/code | recipes/Python/305279_getting_process/recipe-305279.py | Python | mit | 1,710 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Survey.number_of_household_per_investigator'
db.delete_column(u'survey_survey', 'number_of... | antsmc2/mics | survey/migrations/0063_auto__del_field_survey_number_of_household_per_investigator__del_field.py | Python | bsd-3-clause | 27,171 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | Passtechsoft/TPEAlpGen | blender/release/scripts/addons/io_import_dxf/dxfimport/is_.py | Python | gpl-3.0 | 3,391 |
#!usr/bin/python3
#-*- coding:utf-8 -*-
import random
def startGame():
print("<<< 游戏开始 >>>")
print("请输入1~100之间任意一个数字,一共有5次猜中的机会。")
def endGame(number,isGuess=False):
if isGuess:
print("恭喜你,答对了,就是它:{0}".format(number))
else:
print("很遗憾,机会已用完,正确答案是:{0}".format(number))
print... | pythonzhichan/DailyQuestion | chenfeng/question2.py | Python | mit | 1,237 |
import time as tm
from threading import Lock
import rospy
from rospy.rostime import Duration, Time
from python_qt_binding.QtCore import QTranslator, QObject
from helper_functions import prepare_number_for_representation, topic_statistics_state_to_string, \
ALIVE_TIMER_CALLBACK, MAXIMUM_OFFLINE_TIME, WARNING_TIMEO... | ROS-PSE/arni | arni_gui/src/arni_gui/abstract_item.py | Python | bsd-2-clause | 26,534 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Red Hat, 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
#
... | gspilio/nova | nova/compute/rpcapi.py | Python | apache-2.0 | 32,188 |
'''
logger_setup.py customizes the app's logging module. Each time an event is
logged the logger checks the level of the event (eg. debug, warning, info...).
If the event is above the approved threshold then it goes through. The handlers
do the same thing; they output to a file/shell if the event level is above their
t... | Kbman99/NetSecShare | app/logger_setup.py | Python | mit | 2,739 |
#!/usr/bin/env python
# to run the script with the correct version of uvcdat:
# source /usr/local/uvcdat/1.4.0/bin/setup_runtime.sh
import cdms2
from cdms2 import MV2
import numpy
import glob
import sys
import os
from os import path
import shutil
import re
import string
import random
import gc
import logging
import ... | BrunoCombal/climate | make_ensembleMean_tzyx.py | Python | gpl-2.0 | 26,188 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 VNG Corporation
#
# 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... | rayrrr/luigi | test/contrib/hdfs/webhdfs_client_test.py | Python | apache-2.0 | 2,227 |
"""
Tar archive parser.
Author: Victor Stinner
"""
from resources.lib.externals.hachoir.hachoir_parser import Parser
from resources.lib.externals.hachoir.hachoir_core.field import (FieldSet,
Enum, UInt8, SubFile, String, NullBytes)
from resources.lib.externals.hachoir.hachoir_core.tools import humanFilesize, padd... | azumimuo/family-xbmc-addon | plugin.video.bubbles/resources/lib/externals/hachoir/hachoir_parser/archive/tar.py | Python | gpl-2.0 | 4,571 |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetGroup
# Returns a list of users that are in the specified group.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... | jordanemedlock/psychtruths | temboo/core/Library/Amazon/IAM/GetGroup.py | Python | apache-2.0 | 4,279 |
# -*- coding: utf-8 -*-
"""Queue management implementation for Plaso.
This file contains an implementation of a queue used by plaso for
queue management.
The queue has been abstracted in order to provide support for different
implementations of the queueing mechanism, to support multi processing and
scalability.
"""
... | log2timeline/plaso | plaso/multi_process/plaso_queue.py | Python | apache-2.0 | 1,342 |
#!/usr/bin/python3
from pyrob.api import *
@task
def task_8_22():
while(wall_is_above() != True):
move_up()
if (wall_is_on_the_right() != True):
while(wall_is_on_the_right() != True):
move_right()
else:
while(wall_is_on_the_left() != True):
move_left()
if... | lesina/labs2016 | Laba04/task_16.py | Python | gpl-3.0 | 360 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt
from frappe import _
from frappe.model.document import Document
from operator import itemgetter... | indictranstech/trufil-erpnext | erpnext/manufacturing/doctype/bom/bom.py | Python | agpl-3.0 | 14,720 |
from django.contrib import admin
from school_year_manager.models import SchoolYear, Semester
class SchoolYearAdmin(admin.ModelAdmin):
model = SchoolYear
ordering = ('start_year', )
list_display = ('__unicode__', 'start_year', 'end_year', 'is_active', )
list_filter = ('is_active', )
... | njncalub/pct-infosys | school_year_manager/admin.py | Python | mit | 812 |
import h5py
import numpy as np
#
#
file = h5py.File('FakeDim_remove.h5','w')
#
# Create dataset under the Root group.
#
comp_type = np.dtype([('Orbit', 'i'), ('Temperature', 'f8')])
dataset = file.create_dataset("DSC",(2,), maxshape=(None,),chunks=(2,),dtype=comp_type)
data = np.array([(1153, 53.23), (1184, 55.12)], d... | OPENDAP/hdf5_handler | data/src/compound_unlimited.py | Python | lgpl-2.1 | 983 |
from django.conf.urls import patterns
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^', include('app1.urls', namespace='app1')),
url(r'^admin/', include(admin.site.urls)),
)
| arthuralvim/django-reversion-example | rev/urls.py | Python | mit | 274 |
from malcolm.yamlutil import check_yaml_names, make_block_creator
pva_server_block = make_block_creator(__file__, "pva_server_block.yaml")
pva_client_block = make_block_creator(__file__, "pva_client_block.yaml")
__all__ = check_yaml_names(globals())
| dls-controls/pymalcolm | malcolm/modules/pva/blocks/__init__.py | Python | apache-2.0 | 252 |
# -*- coding: utf-8 -*-
# CREATED ON DATE: 06.05.15
__author__ = 'mail@pythonic.ninija' | PythonicNinja/UrlShortener | url_shortener/shorter/management/commands/__init__.py | Python | bsd-3-clause | 87 |
from django.test import SimpleTestCase, override_settings
from django.test.utils import require_jinja2
@override_settings(ROOT_URLCONF='shortcuts.urls')
class RenderTests(SimpleTestCase):
def test_render(self):
response = self.client.get('/render/')
self.assertEqual(response.status_code, 200)
... | Beauhurst/django | tests/shortcuts/tests.py | Python | bsd-3-clause | 1,737 |
# 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)
import logging
from... | slyphon/pants | src/python/pants/backend/core/tasks/deferred_sources_mapper.py | Python | apache-2.0 | 2,979 |
import sys
import re
import numpy as np
import json
import pickle
from string import ascii_letters
from keras.models import Sequential, model_from_json
from keras.layers import Dense, Activation, Dropout
from keras.layers import LSTM
from ivanatrumpalot import clean_text, predict, sample
# This code is heavily infl... | QCaudron/ivanatrumpalot | code/train_lstm.py | Python | mit | 5,169 |
#!/usr/bin/env python3
# https://leetcode.com/problems/two-sum/
import unittest
from typing import List
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
if nums is None:
return None
mapped = {}
for i, num in enumerate(nums):
expected = ... | altermarkive/Coding-Interviews | algorithm-design/leetcode/lc001_two_sum/lc001_two_sum.py | Python | mit | 959 |
from conans import python_requires
import os
common = python_requires('llvm-common/0.0.0@orbitdeps/stable')
class LLVMCore(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_core'
llvm_component = 'llvm'
llvm_module = 'Core'
llvm_requires = ['llvm_headers', 'llvm_bi... | pierricgimmig/orbitprofiler | contrib/conan/recipes/llvm_core/conanfile.py | Python | bsd-2-clause | 387 |
#!/usr/bin/python2
# encoding: utf-8
"""
Storage.py
Created by Alexander Rössler on 2015-01-03.
"""
import time
import sys
import os
import argparse
import ConfigParser
import hal
class Pin:
def __init__(self):
self.halPin = 0
self.halName = ''
self.section = ''
self.name = ''
... | strahlex/machinekit | src/hal/user_comps/hal_storage.py | Python | lgpl-2.1 | 3,146 |
# Copyright 2019 Silvio Gregorini <silviogregorini@openforce.it>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
'name': 'Fields Relation Data',
'summary': "Show relations data in ir.model.fields tree views",
'version': '11.0.1.0.0',
'category': 'Tools',
'author': 'Openforce, Odo... | brain-tec/server-tools | fields_relation_data/__manifest__.py | Python | agpl-3.0 | 585 |
# This file is part of cloud-init. See LICENSE file for license information.
"""cloud-init Integration Test Verify Script."""
from tests.cloud_tests.testcases import base
class TestHostname(base.CloudTestCase):
"""Test hostname module."""
ex_hostname = "cloudinit2"
def test_hostname(self):
"""T... | larsks/cloud-init | tests/cloud_tests/testcases/modules/set_hostname.py | Python | gpl-3.0 | 478 |
from __future__ import unicode_literals
import re
import six
from moto.core.utils import str_to_rfc_1123_datetime
from six.moves.urllib.parse import parse_qs, urlparse, unquote
import xmltodict
from moto.packages.httpretty.core import HTTPrettyRequest
from moto.core.responses import _TemplateEnvironmentMixin
from ... | rocky4570/moto | moto/s3/responses.py | Python | apache-2.0 | 65,762 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pigeon.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | xouillet/RendezMoiMesPlumes | pigeon/manage.py | Python | gpl-3.0 | 804 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.