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/python
# Python ctypes bindings for VLC
#
# Copyright (C) 2009-2012 the VideoLAN team
# $Id: $
#
# Authors: Olivier Aubert <contact at olivieraubert.net>
# Jean Brouwers <MrJean1 at gmail.com>
# Geoff Salmon <geoff.salmon at gmail.com>
#
# This library is free software; you can redistribu... | Kraymer/keroaek | keroaek/vlc.py | Python | mit | 292,112 | 0.005402 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-28 13:35
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | sebastienbarbier/723e_server | seven23/models/accounts/migrations/0002_auto_20161128_1335.py | Python | mit | 1,974 | 0.003546 |
"""
Test cases for ldaptor.protocols.ldap.ldapserver module.
"""
from twisted.trial import unittest
import sets, base64
from twisted.internet import protocol, address
from twisted.python import components
from ldaptor import inmemory, interfaces, schema, delta, entry
from ldaptor.protocols.ldap import ldapserver, ldap... | antong/ldaptor | ldaptor/test/test_server.py | Python | lgpl-2.1 | 24,613 | 0.008451 |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/surface/logging/sinks/update.py | Python | bsd-3-clause | 7,511 | 0.003595 |
#!/usr/bin/env python
# Support a YAML file hosts.yml as external inventory in Ansible
# Copyright (C) 2012 Jeroen Hoekx <jeroen@hoekx.be>
#
# 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, eit... | j2sol/ansible | plugins/inventory/yaml.py | Python | gpl-3.0 | 7,145 | 0.003779 |
# 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... | rzarzynski/tempest | tempest/api/compute/admin/test_aggregates.py | Python | apache-2.0 | 10,395 | 0 |
import logging
import datetime
import mediacloud.api
import re
from server import mc
from server.auth import is_user_logged_in
from server.util.csv import SOURCE_LIST_CSV_METADATA_PROPS
logger = logging.getLogger(__name__)
TOPIC_MEDIA_INFO_PROPS = ['media_id', 'name', 'url']
TOPIC_MEDIA_PROPS = ['story_count', 'me... | mitmedialab/MediaCloud-Web-Tools | server/views/topics/__init__.py | Python | apache-2.0 | 3,391 | 0.002359 |
#!/usr/bin/env python
#
# 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 ... | izadorozhna/tempest | tempest/tests/cmd/test_javelin.py | Python | apache-2.0 | 18,257 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2018-03-05 05:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sponsors', '0012_sponsor_level_smallint'),
]
operations = [
migrations.Alte... | pycontw/pycontw2016 | src/sponsors/migrations/0013_auto_20180305_1339.py | Python | mit | 624 | 0.001603 |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | nielsbuwen/ilastik | tests/launch_workflow.py | Python | gpl-3.0 | 4,466 | 0.008509 |
from __future__ import division
import encoder
import socket_class as socket
import threading
import time
import sys
rightC,leftC = (0,0)
s = None
IP = "10.42.0.1"
host = 50679
class sendData(threading.Thread):
def __init__(self,waitTime):
self.waitTime = waitTime
threading.Thread.__init__(self)
... | surajshanbhag/Indoor_SLAM | src/control/piControl/encoderRun.py | Python | gpl-3.0 | 1,623 | 0.021565 |
import numpy as np
import scipy.sparse as sp
from scipy.optimize import fmin_l_bfgs_b
from Orange.classification import Learner, Model
__all__ = ["LinearRegressionLearner"]
class LinearRegressionLearner(Learner):
def __init__(self, lambda_=1.0, preprocessors=None, **fmin_args):
'''L2 regularized linear ... | jzbontar/orange-tree | Orange/classification/linear_regression.py | Python | gpl-3.0 | 4,108 | 0.000974 |
"""
Test for opmapp application.
"""
# from python
import datetime
# from selenium
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from django.test i... | clifforloff/opmservice | opmapp/tests.py | Python | gpl-2.0 | 24,082 | 0.008139 |
# -*- coding: utf-8 -*-
#
# sample documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 16 21:22:43 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | igorgue/zeromqlogs | docs/conf.py | Python | mit | 7,723 | 0.00764 |
#!/usr/bin/env python
import gtk
#import NoteBuffer
import notemeister
class Note:
def __init__(self, path=None, title='', body='', link='', wrap="1"):
self.path = path
self.title = title
self.body = body
self.link = link
self.wrap = wrap
self.buffer = notemeister.NoteBuffer.NoteBuffer()
self.buffer.... | robotii/notemeister | src/lib/Note.py | Python | gpl-2.0 | 439 | 0.029613 |
#!/usr/bin/env python
import setuptools
# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
# exit of python setup.py test # in multiprocessing/util.py _exit_function when
# running python setup.py test (see
# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
try:
i... | orwell-int/agent-server-game-python | setup.py | Python | bsd-3-clause | 1,239 | 0.000807 |
#!/usr/bin/env python3
"""
py_fanos_test.py: Tests for py_fanos.py
"""
import socket
import sys
import unittest
import py_fanos # module under test
class FanosTest(unittest.TestCase):
def testSendReceive(self):
left, right = socket.socketpair()
py_fanos.send(left, b'foo')
fd_out = []
msg = py_f... | oilshell/blog-code | fd-passing/py_fanos_test.py | Python | apache-2.0 | 2,191 | 0.01141 |
# Copyright 2012 NetApp
# 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 applic... | sniperganso/python-manilaclient | manilaclient/v2/share_snapshots.py | Python | apache-2.0 | 6,363 | 0 |
#!/usr/bin/env python
"""Run pytest with coverage and generate an html report."""
from sys import argv
from os import system as run
# To run a specific file with debug logging prints:
# py -3 -m pytest test_can.py --log-cli-format="%(asctime)s.%(msecs)d %(levelname)s: %(message)s (%(filename)s:%(lineno)d)" -... | cmcerove/pyvxl | pyvxl/tests/run.py | Python | mit | 884 | 0.002262 |
from uuid import uuid4, UUID
from behave import given, when, then
from formencode import Invalid, validators
@given("I made a Device linking request")
@given("I have made a Device linking request")
@when("I make a Device linking request")
def make_device_linking_request(context):
current_directory = context.enti... | iovation/launchkey-python | features/steps/directory_device_steps.py | Python | mit | 7,152 | 0.00028 |
# -*- coding: utf-8 -*-
import sys
from argparse import ArgumentParser
from DatabaseLogin import DatabaseLogin
from GlobalInstaller import GlobalInstaller
from PyQt5 import QtWidgets
from Ui_MainWindow import Ui_MainWindow
# import damit Installer funktioniert. auch wenn diese nicht hier benoetigt werd... | handbaggerli/DbInstaller | Python/DbInstaller.py | Python | gpl-3.0 | 6,513 | 0.005236 |
"""
Utility classes and functions to handle Virtual Machine creation using libvirt.
:copyright: 2011 Red Hat Inc.
"""
import time
import string
import os
import logging
import fcntl
import re
import shutil
import tempfile
import platform
import aexpect
from avocado.utils import process
from avocado.utils import cryp... | CongLi/avocado-vt | virttest/libvirt_vm.py | Python | gpl-2.0 | 106,547 | 0.000319 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
"""
django_twilio specific settings.
"""
from .utils import discover_twilio_credentials
TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN = discover_twilio_credentials()
| xHeliotrope/injustice_dropper | env/lib/python3.4/site-packages/django_twilio/settings.py | Python | mit | 242 | 0 |
import pytest
pytest.importorskip('numpy')
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
import dask
import dask.array as da
from dask.array.ghost import (Array, fractional_slice, getitem, trim_internal,
ghost_internal, nearest, constant, boun... | esc/dask | dask/array/tests/test_ghost.py | Python | bsd-3-clause | 9,623 | 0.009145 |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | shail2810/nova | nova/tests/unit/virt/vmwareapi/test_vmops.py | Python | apache-2.0 | 114,813 | 0.000575 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.model.document import Document
from frappe.model.rename_doc import rename_doc
clas... | ESS-LLP/erpnext | erpnext/healthcare/doctype/medication/medication.py | Python | gpl-3.0 | 2,862 | 0.025507 |
""" TODO: Add docstring """
import re
import pexpect
class MediaObject(object):
"""Represents an encodable object"""
def __init__(self, input_filename, output_filename):
self.input_filename = input_filename
self.output_filename = output_filename
self.media_duration = self.get_media_d... | thethomaseffect/travers-media-tools | traversme/encoder/media_object.py | Python | mit | 2,000 | 0 |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ impor... | shuang1330/tf-faster-rcnn | lib/model/test.py | Python | mit | 8,856 | 0.015583 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/module_utils/service.py | Python | bsd-3-clause | 7,923 | 0.002398 |
# -*- coding: utf-8 -*-
"""
XML object class
Hervé Déjean
cpy Xerox 2009
a class for TEXT from a XMLDocument
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .XMLDSObjectClass import XMLDSObjectClass
from .XMLDS... | Transkribus/TranskribusDU | TranskribusDU/ObjectModel/XMLDSTEXTClass.py | Python | bsd-3-clause | 12,221 | 0.013504 |
def add(x, y):
return x + y
x = 0
import pdb; pdb.set_trace()
x = add(1, 2)
| fengbohello/practice | python/pdb/sample.py | Python | lgpl-3.0 | 81 | 0.037037 |
# This script has to run using the Python executable found in:
# /opt/mgmtworker/env/bin/python in order to properly load the manager
# blueprints utils.py module.
import argparse
import logging
import utils
class CtxWithLogger(object):
logger = logging.getLogger('internal-ssl-certs-logger')
utils.ctx = CtxWi... | cloudify-cosmo/cloudify-manager-blueprints | components/manager-ip-setter/scripts/create-internal-ssl-certs.py | Python | apache-2.0 | 1,346 | 0 |
"""
Copyright (C) 2017 Open Source Robotics Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | ekumenlabs/terminus | terminus/geometry/enu.py | Python | apache-2.0 | 1,657 | 0.002414 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
FS Pairtree storage - Reverse lookup
====================================
Conventions used:
From http://www.cdlib.org/inside/diglib/pairtree/pairtreespec.html version 0.1
This is an implementation of a reverse lookup index, using the pairtree path spec to
record the li... | benosteen/pairtree | pairtree/pairtree_revlookup.py | Python | apache-2.0 | 3,270 | 0.015596 |
# -*- coding: utf-8 -*-
#
# libnacl documentation build configuration file, created by
# sphinx-quickstart on Thu May 29 10:29:25 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.
#
# A... | saltstack/libnacl | doc/conf.py | Python | apache-2.0 | 10,276 | 0.007201 |
# Generated by Django 2.2.17 on 2021-01-28 01:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('discounts', '0010_merge_20191028_1925'),
]
operations = [
migrations.AddField(
model_name='registrationdiscount',
n... | django-danceschool/django-danceschool | danceschool/discounts/migrations/0011_auto_20210127_2052.py | Python | bsd-3-clause | 525 | 0 |
# Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import ... | jsachs/infer | infer/lib/python/inferlib/issues.py | Python | bsd-3-clause | 9,001 | 0.000222 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_security_groups_operations.py | Python | mit | 30,870 | 0.005248 |
#!/usr/bin/env python3
import sys
from pathlib import Path
ALLOWED_SUFFIXES = ['.feature',
'.bugfix',
'.doc',
'.removal',
'.misc']
def get_root(script_path):
folder = script_path.absolute().parent
while not (folder / '.git').ex... | arthurdarcet/aiohttp | tools/check_changes.py | Python | apache-2.0 | 1,224 | 0 |
import string
import random
import logging
import os
from rootpy import asrootpy, log
from rootpy.plotting import Legend, Canvas, Pad, Graph
from rootpy.plotting.base import Color, MarkerStyle
from rootpy.plotting.utils import get_limits
import ROOT
# from external import husl
# suppress some nonsense logging messa... | aaniin/AliPhysics | PWGMM/MC/aligenqa/aligenqa/roofie/figure.py | Python | bsd-3-clause | 20,665 | 0.002516 |
from pyramid.httpexceptions import HTTPMovedPermanently
from pyramid.view import view_config
from zeit.redirect.db import Redirect
import json
@view_config(route_name='redirect', renderer='string')
def check_redirect(request):
redirect = Redirect.query().filter_by(source=request.path).first()
if redirect:
... | ZeitOnline/zeit.redirect | src/zeit/redirect/redirect.py | Python | bsd-3-clause | 710 | 0 |
from staffjoy.resource import Resource
from staffjoy.resources.location import Location
from staffjoy.resources.admin import Admin
from staffjoy.resources.organization_worker import OrganizationWorker
class Organization(Resource):
PATH = "organizations/{organization_id}"
ID_NAME = "organization_id"
def g... | Staffjoy/client_python | staffjoy/resources/organization.py | Python | mit | 959 | 0 |
from setuptools import setup, find_packages
from fccsmap import __version__
test_requirements = []
with open('requirements-test.txt') as f:
test_requirements = [r for r in f.read().splitlines()]
setup(
name='fccsmap',
version=__version__,
author='Joel Dubowy',
license='GPLv3+',
author_email='... | pnwairfire/fccsmap | setup.py | Python | gpl-3.0 | 1,292 | 0.001548 |
#!/usr/bin/env python
people = 30
cars = 40
trucks = 15
if cars > people:
print("We should take the cars.")
elif cars < people:
print("We should not take the cars")
else:
print("We can't decide.")
if trucks > cars:
print("That's too many trucks.")
elif trucks < cars:
print("Maybe we coudl take th... | davvi/Hardway3 | ex30.py | Python | mit | 492 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import string
from urlparse import urlparse, parse_qs
from mopidy import backend
from mopidy.models import SearchResult, Track, Album, Artist
import pykka
import pafy
import requests
import unicodedata
from mopidy_youtube import logger
yt_api_e... | hkariti/mopidy-youtube | mopidy_youtube/backend.py | Python | apache-2.0 | 5,359 | 0.000187 |
import unittest
import pysal
import numpy as np
import random
class Test_Maxp(unittest.TestCase):
def setUp(self):
random.seed(100)
np.random.seed(100)
def test_Maxp(self):
w = pysal.lat2W(10, 10)
z = np.random.random_sample((w.n, 2))
p = np.ones((w.n, 1), float)
... | AlanZatarain/pysal | pysal/region/tests/test_maxp.py | Python | bsd-3-clause | 1,770 | 0 |
class Node(object):
def __init__(self,pos,parent,costSoFar,distanceToEnd):
self.pos = pos
self.parent = parent
self.costSoFar = costSoFar
self.distanceToEnd = distanceToEnd
self.totalCost = distanceToEnd +costSoFar
| helloworldC2/VirtualRobot | Node.py | Python | mit | 260 | 0.019231 |
from django.views.generic.detail import DetailView
from django.views.generic.edit import UpdateView, DeleteView
from catalog.views.base import GenericListView, GenericCreateView
from catalog.models import Astronaut, CrewedMission
from catalog.forms import AstronautForm
from catalog.filters import AstronautFilter
from d... | Hattivat/hypergolic-django | hypergolic/catalog/views/astronaut_views.py | Python | agpl-3.0 | 1,773 | 0 |
# hello_asyncio.py
import asyncio
import tornado.ioloop
import tornado.web
import tornado.gen
from tornado.httpclient import AsyncHTTPClient
try:
import aioredis
except ImportError:
print("Please install aioredis: pip install aioredis")
exit(0)
class AsyncRequestHandler(tornado.web.RequestHandler):
""... | rudyryk/python-samples | hello_tornado/hello_asyncio.py | Python | cc0-1.0 | 3,463 | 0.001733 |
# -*- coding: utf-8 -*-
#
# Python documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
... | teeple/pns_server | work/install/Python-2.7.4/Doc/conf.py | Python | gpl-2.0 | 5,857 | 0.001195 |
import zlib, base64, sys
MAX_DEPTH = 50
if __name__ == "__main__":
try:
hashfile = open("hashfile", "r")
except:
print("ERROR: While opening hash file!")
sys.exit(-1)
line_number = 0
depths = [0 for _ in range(MAX_DEPTH)]
for line in hashfile.readlines():
... | fredericojordan/fast-chess | scripts/hashfileStats.py | Python | mit | 900 | 0.004444 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-21 04:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0011_auto_20170621_1224'),
]
operations = [
migrations.AddField(
... | r26zhao/django_blog | blog/migrations/0012_auto_20170621_1250.py | Python | mit | 586 | 0 |
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse
from django.http import Http404
from modeltree.tree import MODELTREE_DEFAULT_ALIAS, trees
from restlib2.params import Parametizer, IntParam, StrParam
from avocado.export import BaseExporter, registry as exporters
from avocado.query... | chop-dbhi/serrano | serrano/resources/exporter.py | Python | bsd-2-clause | 3,758 | 0 |
# Copyright 2013 Nebula 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... | BjoernT/python-openstackclient | openstackclient/object/v1/container.py | Python | apache-2.0 | 7,719 | 0 |
# coding: utf-8
#
# Copyright 2015 Palantir Technologies, 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 applic... | palantir/typedjsonrpc | tests/test_server.py | Python | apache-2.0 | 10,750 | 0.001023 |
#!/usr/bin/env python
import unittest
from pycoin.ecdsa import generator_secp256k1, sign, verify, public_pair_for_secret_exponent
class ECDSATestCase(unittest.TestCase):
def test_sign_verify(self):
def do_test(secret_exponent, val_list):
public_point = public_pair_for_secret_exponent(generat... | greenaddress/pycoin | pycoin/test/ecdsa_test.py | Python | mit | 1,478 | 0.012855 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------
# File Name: utils.py
# Author: Zhao Yanbai
# Thu Oct 30 06:33:24 2014
# Description: none
# ------------------------------------------------------------------------
import loggi... | acevest/monitor | utils.py | Python | gpl-2.0 | 6,848 | 0.017251 |
from __future__ import print_function
from SimpleCV import *
print("")
print("This program runs a list of test for machine learning on")
print("the SimpleCV library. Not all scores will be high, this")
print("is just to ensure that the libraries are functioning correctly")
print("on your system")
print("")
print("****... | tpltnt/SimpleCV | SimpleCV/MachineLearning/MLTestSuite.py | Python | bsd-3-clause | 9,967 | 0.019063 |
# -*- coding: utf-8 -*-
# © 2004-2009 Tiny SPRL (<http://tiny.be>).
# © 2015 Agile Business Group <http://www.agilebg.com>
# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).
import os
import shutil
import tempfile
import traceback
from... | eezee-it/server-tools | auto_backup/models/db_backup.py | Python | agpl-3.0 | 10,250 | 0.000195 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Fri Dec 2 15:05:18 2011 by generateDS.py version 2.7b.
#
import sys
import getopt
import re as re_
etree_ = None
Verbose_import_ = False
( XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_li... | Dhandapani/gluster-ovirt | backend/manager/tools/engine-image-uploader/src/ovf/ovfenvelope.py | Python | apache-2.0 | 398,478 | 0.004236 |
'''
pyttsx setup script.
Copyright (c) 2009, 2013 Peter Parente
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHO... | valdecar/Murka | pyttsx-master/setup.py | Python | gpl-3.0 | 1,287 | 0.002331 |
#!/usr/bin/env python
# encoding: utf-8
"""
Generic stock functions
"""
class Stock(object):
"""
Generic Stock information
"""
def __init__(self, symbol, name, sector):
super(Stock, self).__init__()
self.symbol = symbol
self.name = name
self.sector = sector
| kevinkirkup/hedge | python/hedge/stock.py | Python | gpl-3.0 | 309 | 0.003236 |
from __future__ import print_function
import sys
import subprocess
class AutoInstall(object):
_loaded = set()
@classmethod
def find_module(cls, name, path, target=None):
if path is None and name not in cls._loaded:
cls._loaded.add(name)
print("Installing", name)
... | Liuchang0812/slides | pycon2015cn/ex6_auto_install/autoinstall.py | Python | mit | 590 | 0.00339 |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-, labman development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------... | josenavas/labman | labman/db/configuration_manager.py | Python | bsd-3-clause | 5,785 | 0 |
# coding: utf-8
#
# Copyright © 2010—2014 Andrey Mikhaylenko and contributors
#
# This file is part of Argh.
#
# Argh is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README.rst for copying conditions.
#
"""
Comm... | CiuffysHub/MITMf | mitmflib-0.18.4/mitmflib/argh/decorators.py | Python | gpl-3.0 | 5,296 | 0.000756 |
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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, merge... | IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | staging_dir/host/lib/scons-2.3.5/SCons/Options/EnumOption.py | Python | gpl-2.0 | 1,980 | 0.001515 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ExtensionFaultTypeInfo(vim, *args, **kwargs):
'''This data object type describes faul... | xuru/pyvisdk | pyvisdk/do/extension_fault_type_info.py | Python | mit | 1,025 | 0.00878 |
import unittest
import json
import forgi.threedee.utilities._dssr as ftud
import forgi.threedee.model.coarse_grain as ftmc
import forgi.graph.residue as fgr
class TestHelperFunctions(unittest.TestCase):
def test_dssr_to_pdb_atom_id_validIds(self):
self.assertEqual(ftud.dssr_to_pdb_resid(
"B.C24... | ViennaRNA/forgi | test/forgi/threedee/utilities/test_dssr.py | Python | gpl-3.0 | 2,377 | 0.000841 |
'''
pysplat 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.
pysplat is distributed in the hope that it will be useful,
but WITHOUT ANY WARRA... | pointhi/PySplat | PySplat/util/__init__.py | Python | gpl-3.0 | 682 | 0.004399 |
# -*- coding: utf-8 -*-
from tornado.options import define
define('debug', default=False, type=bool)
# Tornado的监听端口
define('port', default=8888, type=int)
# WHoosh Search相关
define('whoosh_ix_path', default='/Users/liushuai/Desktop/index', type=str)
# MongoDB
define('mongo_addr', default='127.0.0.1', type=str)
defin... | liushuaikobe/GitArchiveUtils | gitradar/config.py | Python | gpl-2.0 | 375 | 0 |
import unittest
import os
import numpy as np
from tools.sampling import read_log_file
from tools.walk_trees import walk_trees_with_data
from tools.game_tree.nodes import ActionNode, BoardCardsNode, HoleCardsNode
LEDUC_POKER_GAME_FILE_PATH = 'games/leduc.limit.2p.game'
class SamplingTests(unittest.TestCase):
def... | JakubPetriska/poker-cfr | test/sampling_tests.py | Python | mit | 2,099 | 0.003335 |
# Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# 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,... | himaaaatti/qtile | libqtile/manager.py | Python | mit | 59,989 | 0.000267 |
# Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This progr... | godiard/sugar | src/jarabe/frame/frameinvoker.py | Python | gpl-2.0 | 1,411 | 0 |
#!/usr/bin/env python
NAME = 'F5 Trafficshield'
def is_waf(self):
for hv in [['cookie', '^ASINFO='], ['server', 'F5-TrafficShield']]:
r = self.matchheader(hv)
if r is None:
return
elif r:
return r
# the following based on nmap's http-waf-fingerprint.nse
if... | thinksabin/wafw00f | wafw00f/plugins/f5trafficshield.py | Python | bsd-3-clause | 408 | 0 |
"""Implementation of :class:`SymPyRealDomain` class. """
from sympy.polys.domains.realdomain import RealDomain
from sympy.polys.domains.groundtypes import SymPyRealType
class SymPyRealDomain(RealDomain):
"""Domain for real numbers based on SymPy Float type. """
dtype = SymPyRealType
zero = dtype(0)
... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sympy/polys/domains/sympyrealdomain.py | Python | agpl-3.0 | 1,456 | 0.00206 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from authentic2.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'LibertySession.django_session_key'
db.al... | adieu/authentic2 | authentic2/saml/migrations/0022_auto__chg_field_libertysession_django_session_key__chg_field_libertyar.py | Python | agpl-3.0 | 24,009 | 0.006872 |
import time
import json
import logging
import re
import requests
from telegram import InlineQueryResultArticle, InputTextMessageContent, ParseMode
from telegram.ext import ConversationHandler
from keybaseproofbot.models import Proof
from keybaseproofbot.proof_handler import check_proof_message, lookup_proof, store_pr... | pingiun/keybaseproofbot | keybaseproofbot/handlers.py | Python | mit | 15,489 | 0.003168 |
# -*- coding: utf-8 -*-
#
# 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, software
... | MetrodataTeam/incubator-airflow | tests/contrib/operators/test_sftp_operator.py | Python | apache-2.0 | 9,161 | 0.001092 |
#! /usr/bin/python3
# -*- coding:utf-8 -*-
# Funciones y parametros arbitrarios
def funcion(**nombres):
print (type(nombres))
for alumno in nombres:
print ("%s es alumno y tiene %d años" % (alumno, nombres[alumno]))
return nombres
#diccionario = {"Adrian":25, "Niño":25, "Roberto":23, "Celina":23}
p... | IntelBUAP/Python3 | codigo27.py | Python | gpl-2.0 | 388 | 0.033679 |
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | bram85/topydo | topydo/commands/AddCommand.py | Python | gpl-3.0 | 3,836 | 0.000261 |
##
# Copyright 2012-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | hpcleuven/easybuild-framework | easybuild/toolchains/iompi.py | Python | gpl-2.0 | 1,514 | 0.001982 |
"""
Django settings for myclass project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
#... | wasit7/tutorials | django/Pieng/myclass/myclass/settings.py | Python | mit | 3,183 | 0.001257 |
from fabric.api import env
from fabric.context_managers import cd
from fabric.operations import run, local, put
env.shell = '/bin/bash -l -c'
env.user = 'd'
env.roledefs.update({
'staging': ['staging.solebtc.com'],
'production': ['solebtc.com']
})
# Heaven will execute fab -R staging deploy:branch_name=master... | solefaucet/sole-server | fabfile.py | Python | mit | 1,674 | 0.005376 |
from game import models
from game.method.in_game import thread_fields, Thread_field
from game.tool.room_tool import *
from game.tool.tools import to_json
# 实时获得房间信息 room_id
def get_room_info(request):
room_id = int(request.POST['room_id'])
room = get_room_by_id(room_id)
print(room_id)
print... | sdu14SoftwareEngineering/GameOfLife_WEB | game/method/ready_game.py | Python | apache-2.0 | 3,728 | 0 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Unit tests for gclient.py.
See gclient_smoketest.py for integration tests.
"""
import Queue
import copy
import logging
import ... | Shouqun/node-gn | tools/depot_tools/tests/gclient_test.py | Python | mit | 40,396 | 0.003688 |
from os import system
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer
def clear_buffer_cache():
system('free -g')
system('sync')
system("sudo sed -n 's/0/3/w /proc/sys/vm/drop_caches' /proc/sys/vm/drop_caches")
system('sync')
system("sudo sed -n 's/3/0/w /proc/sys/vm/drop_caches' /proc/sys/vm/d... | limingzju/ClearCacheServer | server.py | Python | bsd-2-clause | 617 | 0.024311 |
# Standard imports
import unittest
import json
import logging
from datetime import datetime, timedelta
# Our imports
from emission.clients.gamified import gamified
from emission.core.get_database import get_db, get_mode_db, get_section_db
from emission.core.wrapper.user import User
from emission.core.wrapper.client im... | joshzarrabi/e-mission-server | emission/tests/client_tests/TestGamified.py | Python | bsd-3-clause | 7,135 | 0.004905 |
from flask import Flask
server = Flask(__name__)
server.config['SERVER_NAME'] = '127.0.0.1:5001'
from app import endpoints
| buckbaskin/Insight | service1/app/__init__.py | Python | apache-2.0 | 125 | 0.008 |
from __future__ import absolute_import, division, print_function
from nfldb.db import _upsert
class Entity (object):
"""
This is an abstract base class that handles most of the SQL
plumbing for entities in `nfldb`. Its interface is meant to be
declarative: specify the schema and let the methods defin... | verdimrc/nfldb | nfldb/sql.py | Python | unlicense | 15,501 | 0.000129 |
from queues import queue_opencl_devices
from queues import queue_opencl_contexts
from queues import queue_opencl_buffers
from queues import queue_opencl_programs
from queues import queue_opencl_kernels
from queues import queue_opencl_command_queues
from queues import queue_opencl_notify
import sys
from oslo.config impo... | apatriciu/OpenStackOpenCL | computeOpenCL/nova/contrib/OpenCLServer/OpenCLServer.py | Python | apache-2.0 | 23,459 | 0.01006 |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# This script will locally construct a merge commit for a pull request on a
# github repository, inspect it, ... | destenson/bitcoin--bitcoin | contrib/devtools/github-merge.py | Python | mit | 14,113 | 0.014667 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
from cryptography.x509.oid imp... | aliyun/oss-ftp | python27/win32/Lib/site-packages/cryptography/x509/name.py | Python | mit | 2,116 | 0 |
# *****************************************************************
# Copyright (c) 2013 Massachusetts Institute of Technology
#
# Developed exclusively at US Government expense under US Air Force contract
# FA8721-05-C-002. The rights of the United States Government to use, modify,
# reproduce, release, perform, disp... | y4n9squared/HEtest | hetest/python/circuit_generation/ibm/ibm_wire.py | Python | bsd-2-clause | 1,345 | 0.003717 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | david-ragazzi/nupic | nupic/encoders/coordinate.py | Python | gpl-3.0 | 6,560 | 0.00564 |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | tensorflow/agents | tf_agents/bandits/policies/loss_utils.py | Python | apache-2.0 | 3,764 | 0.002125 |
'''
Notice:
1. The function for jit should locate in mfs
2. For the usage of jit types and signatures, please refer Numba documentation <http://numba.github.com/numba-doc/0.10/index.html>
'''
from dpark import _ctx as dpark, jit, autojit
import numpy
@jit('f8(f8[:])')
def add1(x):
sum = 0.0
for i ... | ee08b397/dpark | examples/jit.py | Python | bsd-3-clause | 757 | 0.007926 |
"""An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'ha... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/nntplib.py | Python | mit | 43,081 | 0.000696 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice... | AnshulYADAV007/Lean | Algorithm.Python/CustomDataIndicatorExtensionsAlgorithm.py | Python | apache-2.0 | 3,632 | 0.013499 |
from distutils.core import setup, Extension, Command
from distutils.command.build import build
from distutils.command.build_ext import build_ext
from distutils.command.config import config
from distutils.msvccompiler import MSVCCompiler
from distutils import sysconfig
import string
import sys
mkobjs = ['column', 'cust... | electric-cloud/metakit | python/setup.py | Python | mit | 7,317 | 0.009703 |
#!/usr/bin/python
# Load required modules
import sys, os, json, re, time, comet as C, multiprocessing as mp, random
from math import exp
import run_comet_simple as RC
def get_parser():
# Parse arguments
import argparse
description = 'Runs CoMEt on permuted matrices.'
parser = argparse.ArgumentParser(d... | raphael-group/comet | run_comet_full.py | Python | mit | 10,224 | 0.010172 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.