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 -tt
# -*- coding: utf-8 -*-
'''
Copyright 2014-2015 Teppo Perä
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
Un... | Debith/py2traits | src/pytraits/__init__.py | Python | apache-2.0 | 818 | 0.001224 |
#!/usr/bin/env python
from thug.DOM.W3C.Core.DOMException import DOMException
from .HTMLEvent import HTMLEvent
from .MouseEvent import MouseEvent
from .MutationEvent import MutationEvent
from .StorageEvent import StorageEvent
from .UIEvent import UIEvent
EventMap = {
"HTMLEvent" : HTMLEvent,
"HTMLEvents... | pdelsante/thug | thug/DOM/W3C/Events/DocumentEvent.py | Python | gpl-2.0 | 876 | 0.010274 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('skyshaker', '0013_link_embed'),
]
operations = [
migrations.RemoveField(
model_name='link',
name='em... | tlpinney/geomakers | windwaker/skyshaker/migrations/0014_auto_20141011_2142.py | Python | apache-2.0 | 548 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
import argparse
import json
import os
import shutil
import sys
import time
import urllib2
from main import config
###############################################################################
# Options
####################################... | Kingclove/lab5info3180 | run.py | Python | mit | 10,013 | 0.010786 |
import sys
import csv
def intersect(a, b):
""" return the intersection of two lists """
return list(set(a) & set(b))
def union(a, b):
""" return the union of two lists """
return list(set(a) | set(b))
def combinarA(x,y):
return (x,y,"A")
def combinarB(x,y):
return (x,y,"B")
def printCSV(list,file... | fpradah/change_data_structure | src/cyclomatic.py | Python | gpl-2.0 | 1,610 | 0.048447 |
"""
Django settings for lieutenant project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | erichschroeter/lieutenant | lieutenant/lieutenant/settings.py | Python | mit | 4,114 | 0.002674 |
# -*- coding: utf-8 -*-
"""flask blueprints"""
from .main import main_bp
from .api_1_0 import api_bp as api_1_0_bp
__all__ = ['register_blueprints']
def register_blueprints(app):
"""register blueprints"""
app.register_blueprint(main_bp)
app.register_blueprint(api_1_0_bp)
| teracyhq/flask-boilerplate | app/blueprints.py | Python | bsd-3-clause | 289 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Arne Roomann-Kurrik <kurrik@gmail.com>'
import os
import sys
import math
import argparse
from subprocess import call
def ParseLine(line):
# Line format is <screen_name>,"<id1>,<id2>,..."\n
split_index = line.index(',')
screen_name = line[:split_index]... | kurrik/github-recs | src/apriori/apriori.py | Python | apache-2.0 | 5,606 | 0.021584 |
from pysis import SIS
import os
import json
import pdb
class APITokenException(Exception):
pass
class BaseWorker(object):
def __init__(self, workerID, environment):
self.env = environment
self.uuid = workerID
base_url = os.getenv('BASE_URL', None)
base_domain = os.getenv('... | sustainableis/python-sis | pysis/workertools/baseWorker.py | Python | isc | 2,783 | 0.00539 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser
from django.template import Engine, RequestContext
from django.test import RequestFactory
from django.utils.text import smart_split
from cms.toolbar.toolbar import CMSToolbar
from .conf import setting... | aldryn/aldryn-search | aldryn_search/helpers.py | Python | bsd-3-clause | 3,579 | 0 |
"""This module deals with module paths, importing and the like.
"""
import inspect
import logging
import sys
import os
import imp
import importlib
logger = logging.getLogger(__name__)
def importModule(modulePath, name=None):
"""Import's the modulePath, if ModulePath is a dottedPath then the function will use impo... | dsparrow27/zoocore | zoo/libs/utils/modules.py | Python | gpl-3.0 | 4,491 | 0.002004 |
from __future__ import division, print_function
from collections import deque
from datetime import datetime
import sys
from time import time
def progress_bar_str(percentage, bar_length=20, bar_marker='=', show_bar=True):
r"""
Returns an `str` of the specified progress percentage. The percentage is
represe... | mozata/menpo | menpo/visualize/textutils.py | Python | bsd-3-clause | 7,250 | 0.000276 |
# Copyright (c) 2015 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
#
# Unless required by applicable law or ... | paninetworks/neutron | neutron/tests/functional/agent/linux/test_interface.py | Python | apache-2.0 | 2,526 | 0 |
"""
Ludolph: Monitoring Jabber Bot
Copyright (C) 2012-2017 Erigones, s. r. o.
This file is part of Ludolph.
See the LICENSE file for copying permission.
"""
import os
import re
import sys
import signal
import logging
from collections import namedtuple
try:
# noinspection PyCompatibility,PyUnresolvedReferences
... | erigones/Ludolph | ludolph/main.py | Python | bsd-3-clause | 8,916 | 0.000673 |
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "d01"
__email__ = "jungflor@gmail.com"
__copyright__ = "Copyright (C) 2015-16, Florian JUNG"
__license__ = "MIT"
__version__ = "0.1.0... | the01/python-paps | paps/crowd/controller.py | Python | mit | 5,482 | 0.000912 |
# -----------------------------------------------------------------------
# Copyright: 2010-2022, imec Vision Lab, University of Antwerp
# 2013-2022, CWI, Amsterdam
#
# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
#
#
# The ASTRA Toolbo... | astra-toolbox/astra-toolbox | python/astra/plugins/cgls.py | Python | gpl-3.0 | 2,821 | 0.001418 |
#
# Copyright (C) 2020 by frePPLe bv
#
# This library 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 License, or
# (at your option) any later version.
#
# This library is distri... | frePPLe/frePPLe | freppledb/common/notifications.py | Python | agpl-3.0 | 1,606 | 0.001868 |
class Graph:
"""
* Creates a adjaceny list for a graph
* Implements a function for topological sorting
"""
def __init__(self, no_vertices):
"""
Initialises an empty adjaceny list (list of lists)
"""
self.vertices = no_vertices
self.adjlist = [[] for i in xra... | algobook/Algo_Ds_Notes | Topological_Sort/Topological_Sort.py | Python | gpl-3.0 | 1,538 | 0.006502 |
from . import NetworkObject
import z3
class NetworkCounter (NetworkObject):
"""OK cannot count: this is sad"""
def _init (self, node, net, ctx):
super(NetworkCounter, self).init_fail(node)
self.node = node.z3Node
self.net = net
self.ctx = ctx
self.constraints = list()
... | apanda/modeling | mcnet/components/counter.py | Python | bsd-3-clause | 3,921 | 0.023718 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'settings.ui'
#
# Created: Thu Dec 25 23:21:20 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from languagebox import LanguageBox
from sys import platfo... | hb9kns/PyBitmessage | src/bitmessageqt/settings.py | Python | mit | 40,025 | 0.005347 |
from . import TheInternetTestCase
from helium.api import ComboBox, select
class DropdownTest(TheInternetTestCase):
def get_page(self):
return "http://the-internet.herokuapp.com/dropdown"
def test_dropdown_exists(self):
self.assertTrue(ComboBox("Dropdown List").exists())
def test_select_value(self):
self.asser... | bugfree-software/the-internet-solution-python | tests/test_dropdown.py | Python | mit | 614 | 0.032573 |
letra = input("Qual seu gênero:")
if letra == "F" or letra == "f":
print("Feminino")
elif letra == "M" or letra == "m":
print("Masculino")
else:
("sexo invalido")
#https://pt.stackoverflow.com/q/405745/101
| maniero/SOpt | Python/Operator/OrCondition.py | Python | mit | 224 | 0.008969 |
# Copyright (c) 2014 Rackspace, 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 in wr... | Vaidyanath/tempest | tempest/api/messaging/test_claims.py | Python | apache-2.0 | 4,171 | 0 |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... | Senseg/robotframework | src/robot/reporting/logreportwriters.py | Python | apache-2.0 | 2,447 | 0.001226 |
# -*- coding: utf-8 -*-
# © 2017 Comunitea
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
from datetime import timedelta
from pytz import timezone
from odoo.addons import decimal_precision as dp
class StockPicking(models.Model):
_inherit = 'stock.picking'
... | Comunitea/CMNT_00098_2017_JIM_addons | custom_documents/models/stock_picking.py | Python | agpl-3.0 | 11,479 | 0.000872 |
#!/usr/bin/env python
# encoding: utf-8
"""
dbset.py
Created by Razor <bg1tpt AT gmail.com> on 2008-03-31
Copyright (c) 2008 xBayDNS Team. All rights reserved.
"""
import bsddb, pickle, os
class Set():
def __init__(self):
self._dbname = os.tmpnam()
try:
self._dbobj = bsddb.btopen(se... | changtailiang/xbaydns | xbaydns/tools/dbset.py | Python | bsd-2-clause | 760 | 0.007895 |
###########################################################################
#
# Copyright (C) 2012 Zenoss Inc.
#
###########################################################################
from Products.Zuul.form import schema
from Products.Zuul.utils import ZuulMessageFactory as _t
from Products.Zuul.infos.component ... | zenoss/ZenPacks.zenoss.Puppet | ZenPacks/zenoss/Puppet/interfaces.py | Python | gpl-2.0 | 1,215 | 0.002469 |
# Copyright (c) 2014 Mirantis 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 in writ... | ekasitk/sahara | sahara/plugins/cdh/v5_3_0/validation.py | Python | apache-2.0 | 11,076 | 0 |
"""
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the resu... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/unittest/__init__.py | Python | gpl-3.0 | 3,117 | 0.003208 |
"""A collection of tokenizers for use with ankura import pipelines"""
import re
import bs4
# Note: Each tokenizer takes in a string, and returns a list of tokens
def split(data):
"""A tokenizer which does nothing but splitting"""
return data.split()
def simple(data, splitter=split):
"""A basic tokeni... | nOkuda/ankura | ankura/tokenize.py | Python | gpl-3.0 | 1,360 | 0 |
# -*- coding: utf-8 -*-
"""
basemodels.py
~~~~~~~~~~~
"""
from flask.ext.login import UserMixin
from sqlalchemy.ext.declarative import declared_attr
from werkzeug.security import generate_password_hash, check_password_hash
from ext import db
class BaseMixin(object):
__table_args__ = {'extend_existing': T... | jstacoder/flask-manage | flask_mrbob/templates/project/+project.name+/basemodels.py | Python | bsd-3-clause | 1,359 | 0.001472 |
class DBXRef:
def __init__(self, dbname, dbid, reftype = None, negate = 0):
self.dbname = dbname
self.dbid = dbid
self.reftype = reftype
self.negate = negate
def __str__(self):
if self.reftype is None:
reftype = ""
else:
reftype = self.ref... | dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/DBXRef.py | Python | apache-2.0 | 9,448 | 0.006245 |
"""Training script for DLRM model."""
import functools
import REDACTED
from absl import app as absl_app
from absl import flags
import numpy as np
import tensorflow.compat.v1 as tf
from REDACTED.tensorflow.python.tpu import tpu_embedding
from REDACTED.tensorflow_models.mlperf.models.rough.dlrm import dataloader
from ... | mlperf/training_results_v0.7 | Google/benchmarks/dlrm/implementations/dlrm-research-TF-tpu-v4-16/dlrm_main.py | Python | apache-2.0 | 8,831 | 0.006115 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class DependentHostedNumberOrde... | tysonholub/twilio-python | tests/integration/preview/hosted_numbers/authorization_document/test_dependent_hosted_number_order.py | Python | mit | 5,011 | 0.002594 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/cpe_naming_2_3/__init__.py | Python | gpl-3.0 | 821 | 0 |
# -*- coding: utf-8 -*-
# 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_metadata_service_query_artifact_lineage_subgraph_async.py | Python | apache-2.0 | 1,632 | 0.001838 |
from django.contrib import admin
from .models import Report
@admin.register(Report)
class ReportAdmin(admin.ModelAdmin):
fields = ('content_type', 'content_object', 'description', 'creator')
readonly_fields = ('creator', 'content_type', 'content_object')
list_display = ('__str__', 'creator', 'created')
... | liqd/adhocracy4 | adhocracy4/reports/admin.py | Python | agpl-3.0 | 350 | 0 |
# -*- coding: utf-8 -*-
from tools.factories import generator_factory
import ctypes
basic_cases = [
[b'%U\n', ctypes.c_long(0)],
[b'% U\n', ctypes.c_long(0)],
[b'%+U\n', ctypes.c_long(0)],
[b'%-U\n', ctypes.c_long(0)],
[b'%0U\n', ctypes.c_long(0)],
[b'%#U\n', ctypes.c_long(0)],
[b'%10U\n',... | vmonteco/YAPT | test_files/uu_cases_regular.py | Python | gpl-3.0 | 907 | 0 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2010 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 F... | andrebellafronte/stoq | stoqlib/gui/dialogs/paymentflowhistorydialog.py | Python | gpl-2.0 | 8,070 | 0.00285 |
import numpy as np
from sklearn.cluster import DBSCAN
import csv
def load_data(fin_path):
files = file(fin_path,'r')
reader = csv.reader(files)
reader.next()
res_0 = []
for id,route_id1,route_id2,bus_id1,bus_id2,day1,day2,time1,time2,lon,lat,card_id,guid in reader:
temp_0 = []
... | mxyue66/ISPRS | extract_all_bus_stop_coordinates.py | Python | mit | 2,342 | 0.032451 |
from datetime import datetime
from .tags import has_tag
COLORS = {
"bold_white": "\033[1;37m",
"red": "\033[0;31m",
"yellow": "\033[0;33m",
"green": "\033[0;32m",
"nocolor": "\033[00m",
"blue": "\033[0;34m"}
class Template(object):
ACCOUNT_COLOR = "blue"
def __call__(self, ledgers, r... | pcapriotti/pledger | pledger/template.py | Python | mit | 4,577 | 0.001092 |
"""
Details of how the data model objects are mapped onto the relational database
are encapsulated here.
"""
import logging
log = logging.getLogger( __name__ )
import sys
import datetime
from galaxy.model import *
from galaxy.model.orm import *
from galaxy.model.orm.ext.assignmapper import *
from galaxy.model.custom... | volpino/Yeps-EURAC | lib/galaxy/model/mapping.py | Python | mit | 73,637 | 0.040021 |
from modeltranslation.translator import translator, TranslationOptions
from tos.models import TermsOfService
# Translations for django-tos
class TermsOfServiceTranslationOptions(TranslationOptions):
fields = ('content', )
translator.register(TermsOfService, TermsOfServiceTranslationOptions)
| cypreess/django-tos | tos_i18n/translation.py | Python | bsd-3-clause | 299 | 0.006689 |
# Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the simplified plotting interface."""
from datetime import datetime, timedelta
from io import BytesIO
import warnings
import matplotlib
import numpy as np
import pandas ... | dopplershift/MetPy | tests/plots/test_declarative.py | Python | bsd-3-clause | 34,530 | 0.0011 |
"""Tests for RamlWrap"""
import inspect
import json
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../")))
from django.test import TestCase, Client
def _get_parent_class(method):
"""Return the class for the given method."""
members = inspect.getmember... | jmons/ramlwrap | tests/RamlWrapTest/tests/test_raml_v1.py | Python | mit | 1,448 | 0.004144 |
#!C:\Users\DMoran\Downloads\WinPython-64bit-2.7.13.1Zero\python-2.7.13.amd64\python.exe
#
# The Python Imaging Library.
# $Id$
#
# convert image files
#
# History:
# 0.1 96-04-20 fl Created
# 0.2 96-10-04 fl Use draft mode when converting images
# 0.3 96-12-30 fl Optimize output (PNG, JPEG)
# 0.4 97... | tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Scripts/pilconvert.py | Python | bsd-3-clause | 2,427 | 0.000824 |
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... | BurtBiel/azure-cli | src/command_modules/azure-cli-network/azure/cli/command_modules/network/mgmt_lb/lib/operations/lb_operations.py | Python | mit | 9,696 | 0.002063 |
"""
OLD MODULE, needs reimplemenetation of select features and deprication
This module should handle all things elliptical
"""
from __future__ import absolute_import, division, print_function
from six.moves import zip, range
from numpy.core.umath_tests import matrix_multiply
import scipy.signal as spsignal
import nump... | Erotemic/vtool | vtool_ibeis/ellipse.py | Python | apache-2.0 | 15,540 | 0.003861 |
import os
import unittest
import yaml
from pyvcloud.vcd.client import BasicLoginCredentials
from pyvcloud.vcd.client import Client
from pyvcloud.vcd.org import Org
from pyvcloud.vcd.test import TestCase
class UpdateCatalog(TestCase):
def test_create_catalog(self):
logged_in_org = self.client.get_org()
... | pacogomez/pyvcloud | tests/vcd_catalog_update.py | Python | apache-2.0 | 993 | 0.004028 |
class Buffer(object):
"""
A Buffer is a simple FIFO buffer. You write() stuff to it, and you
read() them back. You can also peek() or drain() data.
"""
def __init__(self, data=''):
"""
Initialize a buffer with 'data'.
"""
self.buffer = bytes(data)
def read(self,... | infinity0/obfsproxy | obfsproxy/network/buffer.py | Python | bsd-3-clause | 1,998 | 0 |
#!/usr/bin/python
#####################################################
# example.py - a program to .... #
# #
# Author: Dave Wheeler #
# #
# Purpose: merge count tables ... | cckim47/kimlab | general/merge_tables2.py | Python | mit | 2,357 | 0.036911 |
# isort:skip_file
from .data_connector import DataConnector
from .runtime_data_connector import RuntimeDataConnector
from .file_path_data_connector import FilePathDataConnector
from .configured_asset_file_path_data_connector import (
ConfiguredAssetFilePathDataConnector,
)
from .inferred_asset_file_path_data_conne... | great-expectations/great_expectations | great_expectations/datasource/data_connector/__init__.py | Python | apache-2.0 | 1,441 | 0.000694 |
import pytest
from dlkit.abstract_osid.osid import errors
from dlkit.primordium.locale.types.calendar import get_type_data
class TestCalendar(object):
def test_get_type_data_with_celestial(self):
results = get_type_data('xhosa')
assert results['domain'] == 'Calendar Types'
assert results[... | mitsei/dlkit | tests/dlkit/primordium/locale/types/test_calendar.py | Python | mit | 1,400 | 0.002857 |
# encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('infrastructure', '0016_auto_20140209_0826'),
]
operations = [
migrations.AddField(
model_name='module_list',
name='widget_setup_js',
... | SingularityHA/WebUI | infrastructure/migrations/0017_module_list_widget_setup_js.py | Python | gpl-3.0 | 420 | 0.002381 |
'''
Created on 11 Aug 2016
@author: bcub3d-build-ubuntu
'''
from Tkinter import *
import ttk
from threading import Thread
import readLog
import socket
import sendDataGUI
import math
import playbackFunctions
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
from matplotlib.backends.backend... | tbattz/logsFlightGearReplay | timeControl.py | Python | gpl-3.0 | 4,536 | 0.02425 |
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.six.moves import input
from treeherder.model.models import Datasource, Repository
class Command(BaseCommand):
help = ("Populate the datasource table and"
"create the connected databases")
opti... | moijes12/treeherder | treeherder/model/management/commands/init_datasources.py | Python | mpl-2.0 | 1,226 | 0.000816 |
import unittest
from robot.parsing.model import TestCase, TestCaseFile
from robot.utils.asserts import assert_equals
from robotide.controller.commands import ChangeTag
from robotide.controller.filecontrollers import TestCaseFileController
from robotide.controller.macrocontrollers import TestCaseController
from robotide... | caio2k/RIDE | utest/controller/ui/test_treecontroller.py | Python | apache-2.0 | 6,000 | 0.000333 |
# coding=utf-8
import requests
import time
from pychroner import PluginMeta, PluginType
@PluginMeta(PluginType.Thread)
def do(pluginApi):
db = pluginApi.getMongoDB().getCollection("bot")
slack = pluginApi.getSlack()
while True:
url = f"https://api.foursquare.com/v2/users/63379277/scoreboard?oauth_... | SlashNephy/PyChroner-Bot | plugins/SlashNephy/Swarm.py | Python | mit | 3,264 | 0.004204 |
#!/usr/bin/env python2
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(s... | The-Cypherfunks/The-Cypherfunks | share/rpcuser/rpcuser.py | Python | mit | 1,117 | 0.005372 |
#!/usr/bin/env python
import json
import logging
import tempfile
import unittest
import pytest
from tests.utils.issue_mock import IssueMock
from tests.utils.repo_mock import RepoMock
from tests.utils.helpers import get_issue
from ansibullbot.triagers.plugins.ci_rebuild import get_rebuild_merge_facts
from ansibullbot... | jctanner/ansibullbot | tests/unit/triagers/plugins/test_rebuild_merge.py | Python | gpl-3.0 | 3,614 | 0.00249 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | savi-dev/keystone | tests/test_migrate_nova_auth.py | Python | apache-2.0 | 5,879 | 0 |
import functools
import gc
import operator
import platform
import unittest
from datetime import datetime
from itertools import count
from warnings import catch_warnings
from scrapy.utils.python import (
memoizemethod_noargs, binary_is_text, equal_attributes,
WeakKeyCache, get_func_args, to_bytes, to_unicode,
... | starrify/scrapy | tests/test_utils_python.py | Python | bsd-3-clause | 7,687 | 0.001041 |
# -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
import os
from pyramid.httpexceptions import HTTPFound
from autonomie.forms.admin import (
ActivityConfigSchema,
)
from autonomie.models.activity import (
... | CroissanceCommune/autonomie | autonomie/views/admin/accompagnement/activities.py | Python | gpl-3.0 | 2,419 | 0 |
import socket
import logging
import struct
import hashlib
from irods.message import (iRODSMessage, StartupPack, AuthResponse, AuthChallenge,
OpenedDataObjRequest, FileSeekResponse, StringStringMap)
from irods.exception import get_exception_by_code, NetworkException
from irods import MAX_PASSWORD_LENGTH
from irods.... | trel/irods-qgis | irods/connection.py | Python | gpl-2.0 | 5,101 | 0.007842 |
__package__ = 'archivebox.core'
| pirate/bookmark-archiver | archivebox/core/__init__.py | Python | mit | 32 | 0 |
import boto.regioninfo
import datetime
from collections import MutableMapping
from json import JSONEncoder, dumps
from time import mktime
def json_encoder(obj):
if isinstance(obj, boto.regioninfo.RegionInfo):
return obj.name
elif isinstance(obj, datetime.datetime):
return int(mktime(obj.timet... | mwhooker/messier | messier/lib/aws/resource.py | Python | bsd-2-clause | 1,293 | 0.000773 |
# peppy Copyright (c) 2006-2010 Rob McMullen
# Copyright (c) 2009 Christopher Barker
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Some simple text transformation actions.
This plugin is a collection of some simple text transformation actions that
should be applicable to more than one majo... | robmcmullen/peppy | peppy/plugins/text_transforms.py | Python | gpl-2.0 | 25,843 | 0.003018 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
file=str(sys.argv[1])
file2=str(sys.argv[2])
outfile=open(file2,'w')
with open (file) as f:
for line in f:
if line.startswith('PhraseDictionaryMemory'):
line = line.replace('PhraseDictionaryMemory','PhraseDictionaryCompact')
line = line.replace('tabl... | PorthTechnolegauIaith/moses-smt | scripts/mtdk/mt_update_compress_moses_ini.py | Python | mit | 493 | 0.03854 |
from rekall_agent.flows import artifact_flow
from rekall_agent.flows import collect
from rekall_agent.flows import find
from rekall_agent.flows import yara
| dsweet04/rekall | rekall-agent/rekall_agent/flows/__init__.py | Python | gpl-2.0 | 156 | 0 |
# -*- coding: UTF-8 -*-
from django.shortcuts import render
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from Blog.models import Article, Category, Tag, BlogComment
from Blog.forms import BlogCommentForm
from markdown import markdown
from django.views.generic.edit im... | ericchan2012/django-blog | Blog/views.py | Python | apache-2.0 | 6,779 | 0.003772 |
from setuptools import setup, find_packages
exec(open('omniture/version.py').read())
setup(name='omniture',
description='A wrapper for the Adobe Analytics (Omniture and SiteCatalyst) web analytics API.',
long_description=open('README.md').read(),
author='Stijn Debrouwere',
author_email='stijn@s... | kristofvanmoffaert/python-omniture | setup.py | Python | mit | 1,204 | 0.001661 |
#! /usr/bin/env python
import os, sys, tempfile, shutil, hashlib, tarfile
import cgi, cgitb
cgitb.enable()
PKGDIR = os.environ.get('PKGDIR', os.path.abspath('../packages'))
# Upload a package to the package directory.
# It is meant to contain a list of tar packages:
#
# PKGDIR/pkgname/pkgver/common.tar
# PKGDIR/pkgn... | evancich/apm_motor | modules/waf/playground/distnet/server/cgi-bin/upload.py | Python | gpl-3.0 | 1,298 | 0.023112 |
import datetime
import logging
from mailsnake import MailSnake
from mailsync.models.customfield import CustomField
class MailChimp(object):
def __init__(self, apikey):
self.api_key = apikey
self.provider = MailSnake(self.api_key)
def test_connection(self):
try:
self.provider.ping()
except Exception,... | rebelact/mailsync-app | mailsync/api/mailchimp.py | Python | mit | 2,198 | 0.040491 |
import os
import io
import cv2
import cv
import picamera
import threading
import numpy as np
import time
class CameraInterface(threading.Thread):
def __init__(self,img_path="/img/live.jpg"):
super(CameraInterface, self).__init__()
self.setDaemon(True)
# set our path for ouput images
... | kscottz/SkinnerBox | modules/CameraInterface.py | Python | mit | 2,818 | 0.007807 |
"""Test for User related Upgrade Scenario's
:Requirement: UpgradedSatellite
:CaseAutomation: NotAutomated
:CaseLevel: Acceptance
:CaseComponent: UsersRoles
:Assignee: sganar
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
class TestScenarioPositiveCreateSSHKeyInExistingUsers:
"... | SatelliteQE/robottelo | tests/upgrades/test_user.py | Python | gpl-3.0 | 3,413 | 0 |
##[TBT-Tools]=group
##Input_Footprints=vector
##Image_IDs=field Input_Footprints
##Overlap_Threshold_0_to_1=number 0.6
from qgis.utils import *
from osgeo import ogr
from osgeo import osr
KEEP_TRESHOLD=Overlap_Threshold_0_to_1
IMAGE_IDS = Image_IDs
def calcIntersection(fpA,fpB):
fpA = fpA.Buffer(0)
if not fp... | eyeNsky/qgis-scripts | select-key-frames.py | Python | mit | 2,286 | 0.013561 |
from __future__ import print_function
import logging
import re
import sys
from glob import iglob
from os.path import join, dirname, normpath
from gevent import monkey
from gevent import spawn, joinall
from gevent.event import AsyncResult
monkey.patch_socket()
monkey.patch_ssl()
import requests
from lxml import html
... | Perlence/wikigenre | wikigenre.py | Python | bsd-3-clause | 6,223 | 0.000643 |
''' Functions for arranging bokeh Layout objects.
'''
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import absolute_import
from .core.enums import Location, SizingMode
from .model... | percyfal/bokeh | bokeh/layouts.py | Python | bsd-3-clause | 19,180 | 0.00245 |
import pygame.event
import pygame.mixer
import pygame.display
import threading
import time
from feather import Plugin
ENDEVENT=42
class PyGamePlayer(Plugin):
listeners = set(['songloaded', 'pause', 'skipsong', 'skipalbum'])
messengers = set(['songstart', 'songpause', 'songend', 'songresume'])
name = 'PyG... | jdodds/pyrana | pyrana/players/pygameplayer.py | Python | bsd-3-clause | 1,508 | 0.006631 |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 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 us... | EmanueleCannizzaro/scons | test/scons-time/help/options.py | Python | mit | 2,071 | 0.004346 |
import graph
from depth_first_search import depth_first_search
from breadth_first_search import breadth_first_search
edges = [(0, 1), (0, 2), (0, 3), (1, 4), (1, 5), (2, 6),
(2, 7), (3, 8), (3, 9), (4, 10), (4, 11)]
G, _ = graph.create_graph(edges)
start_vertex = G.get_vertex(0)
breadth = breadth_fi... | Sorrop/py-graph-algorithms | traversal_tests.py | Python | mit | 1,800 | 0 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..developer import JistBrainMgdmSegmentation
def test_JistBrainMgdmSegmentation_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=di... | FCP-INDI/nipype | nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py | Python | bsd-3-clause | 2,377 | 0.027766 |
import django.conf
class AppSettings(object):
"""
A holder for app-specific default settings that allows overriding via
the project's settings.
"""
def __getattribute__(self, attr):
if attr == attr.upper():
try:
return getattr(django.conf.settings, attr)
... | schinckel/django-countries | django_countries/conf.py | Python | mit | 2,772 | 0 |
#!/usr/bin/env python2
#
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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,... | eckardm/archivematica | src/MCPClient/lib/clientScripts/archivematicaCreateMETSRightsDspaceMDRef.py | Python | agpl-3.0 | 3,954 | 0.002529 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: pam.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test functioning of the PAM metadata support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#... | nextgis-extra/tests | lib_gdal/gcore/pam.py | Python | gpl-2.0 | 18,275 | 0.007442 |
# -*- coding: utf-8 -*-
__author__ = 'James Gardner'
__email__ = 'james@pythonweb.org'
__version__ = '0.1.0'
| threeaims/browserstep | browserstep/__init__.py | Python | mit | 110 | 0 |
from flask import Flask, render_template, session, redirect, url_for, escape, request
from Model.Gateway.AuthenticationGateway import AuthenticationGateway
from Controller.API.ServerController import ServerController
from Controller.API.ChartController import ChartController
from Controller.API.DataController import Da... | darneymartin/ChartIT | src/View/Server.py | Python | mit | 2,318 | 0.002157 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | samedder/azure-cli | src/azure-cli-core/azure/cli/core/tests/test_cloud.py | Python | mit | 10,518 | 0.002377 |
# Copyright 2013 eBay Inc.
# 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/LIC... | bswartz/cinder | cinder/tests/unit/api/contrib/test_qos_specs_manage.py | Python | apache-2.0 | 33,465 | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2011 Vodafone España, S.A.
# Author: Andrew Bird
#
# 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 o... | andrewbird/wader | plugins/devices/huawei_k4505.py | Python | gpl-2.0 | 3,211 | 0.001558 |
#
# 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 n... | lhfei/spark-in-action | spark-2.x/src/main/python/ml/count_vectorizer_example.py | Python | apache-2.0 | 1,595 | 0.000627 |
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_journal
from . import account_move
| ygol/odoo | addons/l10n_fi/models/__init__.py | Python | agpl-3.0 | 156 | 0 |
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import clean_and_search
from ktransit import FitTransit
from multiprocessing import Pool
from scipy import ndimage
import glob, timeit, sys
import time as pythonTime
# OPTI... | barentsen/dave | blsCode/yash_bls.py | Python | mit | 17,107 | 0.0318 |
"""Add Graph and GraphCache models
Revision ID: 654121a84a33
Revises: fc7bc5c66c63
Create Date: 2020-11-16 21:02:36.249989
"""
# revision identifiers, used by Alembic.
revision = '654121a84a33'
down_revision = 'fc7bc5c66c63'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto gen... | google/timesketch | timesketch/migrations/versions/654121a84a33_.py | Python | apache-2.0 | 3,278 | 0.014033 |
# Copyright 2016 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import os
import os.path as op
import logging
import sqlite3 as sqlite
fro... | arsenetar/dupeguru | core/pe/cache_sqlite.py | Python | gpl-3.0 | 5,161 | 0.001744 |
#EQUIPE 2
#Nahan Trindade Passos - 1615310021
#Ana Beatriz Frota - 1615310027
#
#
#
#
#
#
import math
print("Digite os termos da equacao ax2+bx+c")
a = float(input("Digite o valor de A:\n"))
if(a==0):
print("Nao e uma equacao de segundo grau")
else:
b = float(input("Valor de B:\n"))
c = float(input("Valo... | any1m1c/ipc20161 | lista2/ipc_lista2.16.py | Python | apache-2.0 | 824 | 0.01699 |
# -*- 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 | google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc.py | Python | apache-2.0 | 18,035 | 0.002384 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | jairideout/qiime2 | qiime2/sdk/tests/test_artifact.py | Python | bsd-3-clause | 17,709 | 0 |
from __future__ import absolute_import, division, print_function
import numpy as np
import pandas as pd
import gsd.hoomd
import sklearn
import scipy.optimize as opt
import os
import os.path
import pdb
from sklearn.neighbors import BallTree
from sklearn.neighbors import radius_neighbors_graph
from scipy.spatial.distanc... | ramansbach/cluster_analysis | clustering/scripts/old-scripts/clustering_temp.py | Python | mit | 73,255 | 0.011958 |
from tests.serializers.urls import urlpatterns as serializers_urls
urlpatterns = [
] + serializers_urls
| alanjds/drf-nested-routers | tests/urls.py | Python | apache-2.0 | 105 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.