text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
# Copyright 2014 RPiPasswordGenerator
# file: auth.py
# This file just needs to be run.
import tweepy
import sys
CONSUMER_KEY = 'aLrazWkhGaRyLe30HWZcCJrnN'
CONSUMER_SECRET = 'jNSbrJ9TkOobJTbzL4bfd7CWg5x0kv6KMLCZKO5FRAMdIaFvmK'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.sec... | RPiPasswordGenerator/Twitter-Password-Generator-for-Python | auth.py | Python | apache-2.0 | 672 | 0 |
#!/usr/bin/python
'''
oscilloscope for the vLabtool - version 0. \n
Also Includes XY plotting mode, and fitting against standard Sine/Square functions\n
'''
import os
os.environ['QT_API'] = 'pyqt'
import sip
sip.setapi("QString", 2)
sip.setapi("QVariant", 2)
from PyQt4 import QtCore, QtGui
import time,sys
from v0.t... | jithinbp/vLabtool-v0 | v0/apps/scope.py | Python | gpl-3.0 | 18,018 | 0.051116 |
import logging
from django.views import generic
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.mail import send_mail
from django import http
from django.core.urlresolvers import reverse
from django.template.loader import get_template
from django.template import Context... | elliotthill/django-oscar | sites/sandbox/apps/gateway/views.py | Python | bsd-3-clause | 1,784 | 0.001121 |
import logging
import sys
from os import path
import click
from clickclick import AliasedGroup, fatal_error
import connexion
from connexion.mock import MockResolver
logger = logging.getLogger('connexion.cli')
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
def validate_wsgi_server_requirements(ctx, par... | NeostreamTechnology/Microservices | venv/lib/python2.7/site-packages/connexion/cli.py | Python | mit | 5,463 | 0.002014 |
import os, json, datetime
from ContinuousRegistration.Source.make_registration_scripts import parser
from ContinuousRegistration.Source.util import logging, load_submissions, write_json
from ContinuousRegistration.Source.datasets import load_datasets
def run(parameters):
submissions = load_submissions(parameters)
... | kaspermarstal/SuperElastix | ContinuousRegistration/Source/make_evaluation.py | Python | apache-2.0 | 4,367 | 0.007786 |
"""Takes a Python AST and converts it to a corresponding StencilModel.
Throws an exception if the input does not represent a valid stencil
kernel program. This is the first stage of processing and is done only
once when a stencil class is initialized.
"""
from stencil_model import *
from assert_utils import *
import ... | mbdriscoll/asp-old | specializers/stencil/stencil_python_front_end.py | Python | bsd-3-clause | 6,699 | 0.00627 |
import re
def anti_vowel(text):
newtext = re.sub('[AEIOUaeiou]', '', text)
print newtext
anti_vowel("Hey Look Words!")
anti_vowel("THE QUICK BROWN FOX SLYLY JUMPED OVER THE LAZY DOG") | voiceofrae/Python | antivowel.py | Python | mit | 201 | 0.0199 |
from pycp2k.inputsection import InputSection
from ._each295 import _each295
class _check_spline3(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
... | SINGROUP/pycp2k | pycp2k/classes/_check_spline3.py | Python | lgpl-3.0 | 674 | 0.002967 |
from unittest import TestCase
from mock import MagicMock
from django_auth_lti.verification import is_allowed
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
class TestVerification(TestCase):
def test_is_allowed_config_failure(self):
request = MagicMock(LTI={})
allowed... | UQ-UQx/PerspectivesX | perspectivesx_project/django_auth_lti/tests/test_verification.py | Python | mit | 1,706 | 0.005862 |
"""General utility functions for pyamg"""
__docformat__ = "restructuredtext en"
from warnings import warn
import numpy as np
import scipy as sp
from scipy.sparse import isspmatrix, isspmatrix_csr, isspmatrix_csc, \
isspmatrix_bsr, csr_matrix, csc_matrix, bsr_matrix, coo_matrix, eye
from scipy.sparse.sputils impo... | huahbo/pyamg | pyamg/util/utils.py | Python | mit | 65,500 | 0.000031 |
# 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)
VERSION = '0.0.50'
| sameerparekh/pants | src/python/pants/version.py | Python | apache-2.0 | 320 | 0.003125 |
#!/usr/bin/env python
def iterate_list():
for item in [ 1, 2, 3 ]:
yield item
def identity(object):
return object
def simple_callback(callback, value):
return callback(value)
def simple_generator(callback):
output = []
for i in callback():
output.append(i)
return output
def named_args(arg1, arg... | newcontext/rubypython | spec/python_helpers/basics.py | Python | mit | 409 | 0.036675 |
from .fields import JSONField, JSONCharField # noqa
| bradjasper/django-jsonfield | jsonfield/__init__.py | Python | mit | 53 | 0 |
#! /usr/bin/env python
import rospy
import math
import numpy
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import LaserScan
from sensor_msgs.msg import Image
from std_msgs.msg import Header
from multiprocessing import Pool
from multiprocessing import cpu_count
class Line:
def __init__(self, po... | clubcapra/capra_seagoat | src/seagoat_ros_client/seagoat_ros_client.py | Python | gpl-3.0 | 5,086 | 0.004915 |
#!/usr/bin/env python
__author__ = 'Ben "TheX1le" Smith, Marfi'
__email__ = 'thex1le@gmail.com'
__website__= ''
__date__ = '04/26/2011'
__version__ = '2011.4.26'
__file__ = 'ouiParse.py'
__data__ = 'a class for dealing with the oui txt file'
"""
########################################
#
# This program and its support... | creaktive/aircrack-ng | scripts/airgraph-ng/airgraphviz/libOuiParse.py | Python | gpl-2.0 | 8,152 | 0.008342 |
import sys, os, gzip, pickle
from xml.etree.ElementTree import ParseError
from traceback import print_tb
from multiprocessing import Pool # @UnresolvedImport
from pydmrs.components import RealPred, GPred
from pydmrs.core import ListDmrs as Dmrs
PROC = 50
def is_verb(pred):
# Ignore GPreds
if not isinstance(... | guyemerson/sem-func | src/preprocess/wikiwoods_extractcore.py | Python | mit | 6,001 | 0.002333 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, re
from frappe.utils import touch_file, encode, cstr
def make_boilerplate(dest, app_name):
if not os.path.exists(dest):
print "Destination directory does n... | rohitwaghchaure/frappe | frappe/utils/boilerplate.py | Python | mit | 9,035 | 0.014721 |
from __future__ import annotations
import argparse
import dataclasses
from datetime import datetime, timedelta, timezone
from typing import NamedTuple, Optional, Tuple
from redbot.core.commands import BadArgument, Context
from .time_utils import parse_time, parse_timedelta
class NonNumeric(NamedTuple):
parsed:... | mikeshardmind/SinbadCogs | scheduler/converters.py | Python | mit | 4,607 | 0.001954 |
import pytest
import responses
from document import Document
from scrapers.knox_tn_agendas_scraper import KnoxCoTNAgendaScraper
from . import common
from . import utils
class TestKnoxAgendaScraper(object):
session = None
page_str = ""
def test_get_docs_from_page(self):
scraper = KnoxCoTNAgendaSc... | RagtagOpen/bidwire | bidwire/tests/test_knox_co_agenda_scraper.py | Python | mit | 2,136 | 0.000468 |
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 ... | redbear/Espruino | scripts/common.py | Python | mpl-2.0 | 16,565 | 0.020344 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | polyaxon/polyaxon | core/polyaxon/polyflow/events/__init__.py | Python | apache-2.0 | 6,731 | 0.001931 |
__all__ = ['Constraint', 'ConstraintGroup', 'TotalSumValueConstraint', 'UniqueValueConstraint']
from .constraint import Constraint
from .constraintgroup import ConstraintGroup
from .totalsumvalueconstraint import TotalSumValueConstraint
from .uniquevalueconstraint import UniqueValueConstraint
| JoostvanPinxten/ConstraintPuzzler | constraints/__init__.py | Python | mit | 296 | 0.006757 |
#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | LeZhang2016/openthread | tests/toranj/test-603-channel-manager-announce-recovery.py | Python | bsd-3-clause | 4,783 | 0.005854 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
| alirizakeles/zato | code/zato-scheduler/src/zato/scheduler/__init__.py | Python | gpl-3.0 | 238 | 0.004202 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# 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
#
# ... | NeCTAR-RC/ceilometer | ceilometer/api/acl.py | Python | apache-2.0 | 2,172 | 0 |
#!/usr/bin/env python3
# Copyright (c) 2008-9 Qtrac Ltd. All rights reserved.
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 2 of the License, or
# version 3 of the Lic... | paradiseOffice/Bash_and_Cplus-plus | CPP/full_examples/pyqt/chap08/addeditmoviedlg_ans.py | Python | gpl-2.0 | 3,155 | 0.001268 |
'''
Created on Aug 21, 2014
@author: Dean4Devil
'''
import mysql.connector
from pycore.sql_util import MySQLHelper
class SubmitTree():
'A tree of all submits to that standard. I.e. OpenDriver is a tree, OpenDriver 0.2 is a submit.'
def __init__(self, identifier):
'Create a new Tree in memory.'
... | OpenEngeneeringTaskForce/OETFDev | pycore/submit_util.py | Python | mit | 1,401 | 0.004996 |
import filecmp
from transfert import Resource
from transfert.actions import copy
def estimate_nb_cycles(len_data, chunk_size):
return (len_data // chunk_size) + [0, 1][(len_data % chunk_size) > 0]
def test_simple_local_copy(tmpdir):
src = tmpdir.join('alpha')
dst = tmpdir.join('beta')
src.write('s... | rbernand/transfert | tests/unit/test_copy.py | Python | mit | 1,619 | 0 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009 Team FoFiX ... | mecwerks/fofix | src/audio/Microphone.py | Python | gpl-2.0 | 8,551 | 0.003158 |
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
import os
import sys
test = TestGyp.TestGyp(for... | sgraham/nope | tools/gyp/test/rules-dirname/gyptest-dirname.py | Python | bsd-3-clause | 1,475 | 0.00339 |
import sys
old_stdout = sys.stdout
sys.stdout = open('/dev/null','w')
import settings
sys.stdout = old_stdout
if __name__ == '__main__':
if sys.argv[1] == '-env':
print 'export DATA_DIR="%s"' % (settings.DATA_DIR)
| oferb/OpenTrains | webserver/opentrain/opentrain/print_settings.py | Python | bsd-3-clause | 230 | 0.021739 |
from .gameserver import Game
from .example import TicTacToe
| andydrop/ludicode | GameServers/__init__.py | Python | gpl-3.0 | 60 | 0 |
# -*- coding: cp1252 -*-
import urllib,urllib2,re,cookielib,string,os
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
from t0mm0.common.net import Net as net
addon_id = 'plugin.video.movie25'
selfAddon = xbmcaddon.Addon(id=addon_id)
datapath = xbmc.translatePath(selfAddon.getAddonInfo('profile'))
elogo = xbmc.translatePat... | marduk191/plugin.video.movie25 | resources/libs/resolvers.py | Python | gpl-3.0 | 60,306 | 0.014012 |
"""
This code was originally published by the following individuals for use with
Scilab:
Copyright (C) 2012 - 2013 - Michael Baudin
Copyright (C) 2012 - Maria Christopoulou
Copyright (C) 2010 - 2011 - INRIA - Michael Baudin
Copyright (C) 2009 - Yann Collette
Copyright (C) 2009 - CEA - Jean-Ma... | tisimst/pyDOE | pyDOE/doe_factorial.py | Python | bsd-3-clause | 7,200 | 0.007917 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | Jokeren/neon | examples/conv_autoencoder.py | Python | apache-2.0 | 3,219 | 0 |
#-*- coding: utf-8 -*-
"""
Copyright (c) 2012 University of Oxford
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify... | fcrepo4-archive/RDFDatabank | rdfdatabank/config/users.py | Python | mit | 1,238 | 0.002423 |
from django.conf.urls import url
from django_jinja_ref.superadvanced import views
urlpatterns = [
url(r'^$', views.django, name='django'),
url(r'^jinja$', views.jinja, name='jinja'),
]
| rlr/django_jinja_ref | django_jinja_ref/superadvanced/urls.py | Python | mpl-2.0 | 195 | 0 |
"""
This module is the snapshots command of bowl.
Created on 17 July 2014
@author: Charlie Lewis
"""
import ast
import os
class snapshots(object):
"""
This class is responsible for the snapshots command of the cli.
"""
@classmethod
def main(self, args):
# !! TODO needs to implement login i... | cglewis/bowl | bowl/cli_opts/snapshots.py | Python | apache-2.0 | 850 | 0.003529 |
import os, re, csv
# regular expressions for capturing the interesting quantities
noise_pattern = 'noise: \[(.+)\]'
res_pattern = '^([0-9.]+$)'
search_dir = "output"
results_file = '../results.csv'
os.chdir( search_dir )
files = filter( os.path.isfile, os.listdir( '.' ))
#files = [ os.path.join( search_dir, f ) for ... | jiminliang/msda-denoising | spearmint_variable_noise/output2csv.py | Python | apache-2.0 | 1,028 | 0.066148 |
# Copyright 2013 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | cloudbase/neutron-virtualbox | neutron/plugins/nec/router_drivers.py | Python | apache-2.0 | 9,085 | 0.00011 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import json
import uuid
import datetime
from boto3 import Session
from moto.core import BaseBackend, BaseModel
from .exceptions import (
SecretNotFoundException,
SecretHasNoValueException,
InvalidParameterException,
ResourceE... | william-richard/moto | moto/secretsmanager/models.py | Python | apache-2.0 | 20,426 | 0.001175 |
#
# 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... | poffuomo/spark | python/pyspark/sql/dataframe.py | Python | apache-2.0 | 72,001 | 0.002736 |
#
# Brian C. Lane <bcl@redhat.com>
#
# Copyright 2012 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,... | dashea/pykickstart | tests/commands/reboot.py | Python | gpl-2.0 | 2,617 | 0.002293 |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
##---------------------------------------------------------------------------##
##
## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2009 Skomoroh
##
## This program is free ... | TrevorLowing/PyGames | pysollib/winsystems/__init__.py | Python | gpl-2.0 | 1,307 | 0.011477 |
# -*- coding: utf-8 -*-
from warnings import warn
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
TRANSLATION_FILES = tuple(getattr(settings, 'MODELTRANSLATION_TRANSLATION_FILES', ()))
TRANSLATION_REGISTRY = getattr(settings, 'MODELTRANSLATION_TRANSLATION_REGISTRY', None)
if ... | acdha/django-modeltranslation | modeltranslation/settings.py | Python | bsd-3-clause | 2,611 | 0.00383 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | var/spack/repos/builtin/packages/py-binwalk/package.py | Python | lgpl-2.1 | 1,674 | 0.000597 |
# Copyright (C) 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | csecutsc/GmailBot | quickstart.py | Python | mit | 2,344 | 0.00384 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.base import BasePage
from pages.regions.modal import ModalProtoc... | MichaelKohler/bedrock | tests/pages/firefox/welcome/page5.py | Python | mpl-2.0 | 1,575 | 0.00127 |
from flask import Flask
app = Flask(__name__)
app.config.from_object("configs.appconfig.DevelopmentConfig")
| oyang/testFalsk | app.py | Python | mit | 109 | 0 |
# Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME multipart/* type messages."""
__all__ = ['MIMEMultipart']
from bongo.external.email.mime.base import MIMEBase
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* ty... | bongo-project/bongo | src/libs/python/bongo/external/email/mime/multipart.py | Python | gpl-2.0 | 1,377 | 0.000726 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | sunqm/pyscf | examples/local_orb/nlocal.py | Python | apache-2.0 | 6,720 | 0.058333 |
from shuttl.tests import testbase
from shuttl.Models.User import User, UserDataTakenException, NoOrganizationException, ToManyOrganizations
from shuttl.Models.organization import Organization
from shuttl.Models.Reseller import Reseller
class UserTestCase(testbase.BaseTest):
def _setUp(self):
self.reselle... | shuttl-io/shuttl | shuttl/tests/test_models/test_user.py | Python | mit | 1,929 | 0.00311 |
from __future__ import absolute_import
import collections
from .cache import Cache
class LRUCache(Cache):
"""Least Recently Used (LRU) cache implementation."""
def __init__(self, maxsize, missing=None, getsizeof=None):
Cache.__init__(self, maxsize, missing, getsizeof)
self.__order = collect... | endlessm/chromium-browser | tools/swarming_client/third_party/cachetools/lru.py | Python | bsd-3-clause | 1,483 | 0 |
# Configs for mk-livestatus lookup scripts
HOST = [ 'nagios', 'nagios1' ]
PORT = 6557
| skywalka/splunk-for-nagios | bin/mklivestatus.py | Python | gpl-3.0 | 87 | 0.034483 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import boto.ec2
from boto.ec2.blockdevicemapping import BlockDeviceType
from boto.ec2.blockdevicemapping import BlockDeviceMapping
import time
import copy
import argparse
import sys
import pprint
import os
import yaml
BASE_PATH = os.path.dirname(os.path.abspath(__file__))... | vianasw/spot_launcher | spot_launcher/spot_launcher.py | Python | apache-2.0 | 4,508 | 0.004215 |
# Copyright 2016 Leon Sixt
#
# 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, so... | BioroboticsLab/diktya | tests/test_blocks.py | Python | apache-2.0 | 1,576 | 0 |
# Copyright 2014-2016 Presslabs SRL
#
# 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... | PressLabs/gitfs | tests/repository/base.py | Python | apache-2.0 | 759 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option... | zuck/prometeo-erp | products/models.py | Python | lgpl-3.0 | 7,390 | 0.005954 |
# ***************************************************************************
# * Copyright (c) 2016 Ofentse Kgoa <kgoaot@eskom.co.za> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * ... | sanguinariojoe/FreeCAD | src/Mod/Fem/femtaskpanels/task_element_fluid1D.py | Python | lgpl-2.1 | 22,417 | 0.001695 |
import discord
from discord.ext import commands
from random import choice as randomchoice
from .utils.dataIO import fileIO
from .utils import checks
import os
defaultQuotes = [
"Thats why I love switch hitting, I like to be in control ~ Jan, from the Hypermine Dragon Fight - 21st May 2016",
"Thank you for wwaking wi... | Wolfst0rm/Wolf-Cogs | quote/quote.py | Python | mit | 2,264 | 0.025177 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
v_in_geonames.py
----------------
Date : March 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*****************************... | minorua/QGIS | python/plugins/processing/algs/grass7/ext/v_in_geonames.py | Python | gpl-2.0 | 1,246 | 0 |
# -*- coding: utf-8 -*-
import functools
import hashlib
import json
import os
import tempfile
import unittest
import uuid
import zipfile
from contextlib import nested
from datetime import datetime, timedelta
from decimal import Decimal
from django import forms
from django.conf import settings
from django.contrib.auth.... | tsl143/zamboni | mkt/webapps/tests/test_models.py | Python | bsd-3-clause | 97,405 | 0 |
import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import useragents
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
log = logging.getLogger(__name__)
class Mitele(Plugin):
_url_re = re.compile(r"ht... | repotvsupertuga/tvsupertuga.repository | script.module.streamlink.base/resources/lib/streamlink/plugins/mitele.py | Python | gpl-2.0 | 2,844 | 0.001758 |
"""Utility methods for flake8."""
import collections
import fnmatch as _fnmatch
import inspect
import io
import logging
import os
import platform
import re
import sys
import tokenize
from typing import Callable, Dict, Generator, List, Optional, Pattern
from typing import Sequence, Set, Tuple, Union
from flake8 import ... | TeamSPoon/logicmoo_workspace | packs_web/butterfly/lib/python3.7/site-packages/flake8/utils.py | Python | mit | 15,155 | 0 |
"""test a warning is triggered when using for a lists comprehension variable"""
__revision__ = 'yo'
TEST_LC = [C for C in __revision__ if C.isalpha()]
print C # WARN
C = 4
print C # this one shouldn't trigger any warning
B = [B for B in __revision__ if B.isalpha()]
print B # nor this one
for var1, var2 in TEST_LC:... | dbbhattacharya/kitsune | vendor/packages/pylint/test/input/func_use_for_or_listcomp_var.py | Python | bsd-3-clause | 560 | 0.014286 |
# settings.py
#######################################################
#
# Definition of the different paths:
# - CellProfiler (Software, input, output)
# - Input
# - Output
#
#######################################################
import os
def init():
global pathList
CPPath= "D:/Logiciel/CellProfiler... | maxBombrun/lipidDroplets | settings.py | Python | bsd-3-clause | 1,178 | 0.034805 |
import os
import re
import sys
import unittest
from coalib import coala_format
from coalib.misc.ContextManagers import prepare_file
from tests.TestUtilities import bear_test_module, execute_coala
class coalaFormatTest(unittest.TestCase):
def setUp(self):
self.old_argv = sys.argv
def tearDown(self):... | CruiseDevice/coala | tests/coalaFormatTest.py | Python | agpl-3.0 | 1,124 | 0 |
# 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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py | Python | mit | 5,377 | 0.004092 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserFeeds'
db.create_table(u'core_userfeeds', (
... | 1flow/1flow | oneflow/core/migrations/0036_auto__add_userfeeds__add_usersubscriptions.py | Python | agpl-3.0 | 37,603 | 0.007872 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | sid88in/incubator-airflow | tests/sensors/test_sql_sensor.py | Python | apache-2.0 | 2,780 | 0.001799 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-02-25 19:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0008_notification_recipient'),
]
operations = [
migrations.DeleteModel(
... | divio/django-shop | shop/migrations/0009_delete_email.py | Python | bsd-3-clause | 361 | 0 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | fireduck64/electrum | lib/dnssec.py | Python | mit | 10,409 | 0.00221 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it a... | open-synergy/runbot-addons | runbot_build_instructions/runbot_build.py | Python | agpl-3.0 | 6,892 | 0.000145 |
from __future__ import absolute_import
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import ConfigSubsection, ConfigSelection, getConfigListEntry
from Components.SystemInfo import SystemInfo
from Components.Task import job_manager
from Screens.InfoBarGeneric... | atvcaptain/enigma2 | lib/python/Screens/TaskView.py | Python | gpl-2.0 | 5,728 | 0.027235 |
import unittest
import unittest.mock as mock
import dice
import dice_config as dcfg
import dice_exceptions as dexc
class DiceInputVerificationTest(unittest.TestCase):
def test_dice_roll_input_wod(self):
examples = {'!r 5':[5, 10, None, 10, 8, 'wod', None],
'!r 2000':[2000, 10, None, 10,... | brmedeiros/dicey9000 | tests.py | Python | mit | 7,240 | 0.008702 |
"""
Core Linear Algebra Tools
=========================
=============== ==========================================================
Linear algebra basics
==========================================================================
norm Vector or matrix norm
inv Inverse of a square matrix
solve ... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/numpy/linalg/__init__.py | Python | agpl-3.0 | 2,178 | 0 |
## @file
# This file is used to define common parsing related functions used in parsing
# Inf/Dsc/Makefile process
#
# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD Li... | intel/ipmctl | BaseTools/Source/Python/Eot/Parser.py | Python | bsd-3-clause | 33,751 | 0.004207 |
# -*- coding: utf-8 -*-
#
# restflow documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 31 07:32:50 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | CognitionGuidedSurgery/restflow | doc/conf.py | Python | gpl-3.0 | 8,911 | 0.005948 |
###############################################################################
# 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 #
... | pablorecio/Cobaya | src/cobaya/app.py | Python | gpl-3.0 | 4,990 | 0.000601 |
#! encoding: utf-8
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistr... | celiafish/scikit-xray | skxray/core/utils.py | Python | bsd-3-clause | 38,692 | 0.00031 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
# Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | jessicalucci/TaskManagement | taskflow/persistence/backends/sqlalchemy/models.py | Python | apache-2.0 | 3,197 | 0 |
import warnings
import sys
import argparse
from etk.extractors.cryptographic_hash_extractor import CryptographicHashExtractor
cryptographic_hash_extractor = CryptographicHashExtractor()
def add_arguments(parser):
"""
Parse arguments
Args:
parser (argparse.ArgumentParser)
"""
parser.descr... | usc-isi-i2/etk | etk/cli/cryptographic_hash_extractor.py | Python | mit | 947 | 0.004224 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Description of the CEA FPA Campaign.
:History:
Created on Wed Oct 02 17:26:00 2019
:author: Ruyman Azzollini
"""
# IMPORT STUFF
from collections import OrderedDict
from pdb import set_trace as stop
import numpy as np
import copy
#from vison.pipe import lib as pil... | ruymanengithub/vison | vison/campaign/CEAFPAcampaign.py | Python | gpl-3.0 | 4,667 | 0.003643 |
#
# 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... | wprice/qpid-proton | proton-c/bindings/python/proton/handlers.py | Python | apache-2.0 | 20,366 | 0.002062 |
"""Add customer foreign key
Revision ID: ccd5b0142a76
Revises: 243adac5e3e9
Create Date: 2017-03-14 18:59:50.505319
"""
# revision identifiers, used by Alembic.
revision = 'ccd5b0142a76'
down_revision = '243adac5e3e9'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upg... | openmaraude/APITaxi | APITaxi_models2/migrations/versions/20170314_18:59:50_ccd5b0142a76_add_customer_foreign_key.py.py | Python | agpl-3.0 | 631 | 0.011094 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
An auto-reloading standalone wiki server, useful for development.
"""
import hatta
import werkzeug
if __name__=="__main__":
config = hatta.WikiConfig()
config.parse_args()
# config.parse_files()
application = hatta.Wiki(config).application
host = ... | thuydang/djagazin | docs/9_tmp/hatta-wiki-1.5.3/dev.py | Python | bsd-2-clause | 466 | 0.002146 |
from collections import OrderedDict
#*************************#
# PARAMS #
#*************************#
#Paths
#workspaceDir = "/Users/slundquist/workspace"
#filenames = [("sheng","/Users/slundquist/Desktop/ptLIF.txt")]
#filenames = [("sheng","/Users/slundquist/Desktop/retONtoLif.txt")]
worksp... | dpaiton/OpenPV | pv-core/python/probe_analysis/readProbeParams.py | Python | epl-1.0 | 4,842 | 0.028501 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0003_add_verbose_names'),
('articles', '0075_auto_20151015_2022'),
]
operati... | CIGIHub/greyjay | greyjay/articles/migrations/0076_articlepage_video_document.py | Python | mit | 598 | 0.001672 |
# Copyright 2020 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, ... | GoogleCloudPlatform/professional-services-data-validator | third_party/ibis/ibis_addon/operations.py | Python | apache-2.0 | 5,439 | 0.001839 |
"""This script reponsible put all of send_get_request() function results
into list, gracefull exit any script import it and return analytics
"""
import time
import signal
import sys
from requests_futures.sessions import FuturesSession
tasks = []
session = FuturesSession()
def bg_cb(sess, resp):
"Callback funct... | daikk115/test-rolling-upgrade-openstack | graceful_exit.py | Python | mit | 2,834 | 0.001059 |
# -*- coding: utf-8 -*-
# Copyright(C) 2017 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module 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, either version 3 of the Licen... | laurentb/weboob | modules/lameteoagricole/module.py | Python | lgpl-3.0 | 1,524 | 0 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from froi.algorithm import imtool
class IntersectDialog(QDialog):
"""A dialog for action of intersection."""
def __init__(self, model, parent... | sealhuang/FreeROI | froi/gui/component/intersectdialog.py | Python | bsd-3-clause | 3,390 | 0.00177 |
import time
from aquests.athreads import socket_map
from aquests.athreads import trigger
from rs4.cbutil import tuple_cb
from aquests.client.asynconnect import AsynSSLConnect, AsynConnect
from aquests.dbapi.dbconnect import DBConnect
import threading
from aquests.protocols.http import request as http_request
from aques... | hansroh/skitai | skitai/corequest/httpbase/task.py | Python | mit | 22,202 | 0.022205 |
# proxy module
from traitsui.qt4.ui_live import *
| enthought/etsproxy | enthought/traits/ui/qt4/ui_live.py | Python | bsd-3-clause | 50 | 0 |
# -*- encoding:utf-8 -*-
# find_result.py is part of advancedfind-gedit.
#
#
# Copyright 2010-2012 swatch
#
# advancedfind-gedit 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 Licens... | the-linux-schools-project/karoshi-client | clientsetup/buildclient/config/usr/lib/gedit/plugins/advancedfind/find_result.py | Python | agpl-3.0 | 21,931 | 0.031143 |
"""
Copyright (c) 2017, 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from atomic_reactor.plugin import PreBuildPlugin
from atomic_reactor.constants import (
INSPECT_CONFIG, PLUGIN_KOJI_PARENT_KEY, BASE... | DBuildService/atomic-reactor | atomic_reactor/plugins/pre_koji_parent.py | Python | bsd-3-clause | 14,943 | 0.003279 |
#!/usr/bin/env python
import os, sys, codecs, re
def usage():
print "Usage info for extract_references.py"
print " extract_references.py ref_sgml ref_prefix"
print
sys.exit()
def main():
if (len(sys.argv) < 3 or sys.argv[1] == "-h"):
usage()
sgml = codecs.open(sys.argv[1], "r", "utf-8")
pref... | gwenniger/joshua | scripts/toolkit/extract_references.py | Python | lgpl-2.1 | 1,922 | 0.023413 |
"""
Base model definitions for validating front-end user access to resources such as pages and
documents. These may be subclassed to accommodate specific models such as Page or Collection,
but the definitions here should remain generic and not depend on the base wagtail.core.models
module or specific models defined the... | jnns/wagtail | wagtail/core/models/view_restrictions.py | Python | bsd-3-clause | 2,789 | 0.003944 |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 26 18:03:24 2014
@author: KDB
"""
import numpy as np
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.dates import date2num, num2date, HourLocator, DayLocator, AutoDateLocator, DateFormatter
from matplotl... | JrtPec/opengrid | opengrid/library/plotting.py | Python | apache-2.0 | 6,242 | 0.001922 |
"""
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import datetime
import decimal
import os
import platform
import sys
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends.base.base ... | oinopion/django | django/db/backends/oracle/base.py | Python | bsd-3-clause | 24,986 | 0.001641 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.