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 |
|---|---|---|---|---|---|---|
import requests
import re,time
import xbmc,xbmcaddon
from ..scraper import Scraper
from ..common import clean_title,clean_search,send_log,error_log
dev_log = xbmcaddon.Addon('script.module.universalscrapers').getSetting("dev_log")
requests.packages.urllib3.disable_warnings()
s = requests.session()
User_Age... | repotvsupertuga/tvsupertuga.repository | script.module.universalscrapers/lib/universalscrapers/scraperplugins/unsure/filmapik.py | Python | gpl-2.0 | 5,801 | 0.022755 |
# Copyright 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.
from telemetry.internal.app import possible_app
class PossibleBrowser(possible_app.PossibleApp):
"""A browser that can be controlled.
Call Create() to... | catapult-project/catapult-csm | telemetry/telemetry/internal/browser/possible_browser.py | Python | bsd-3-clause | 1,414 | 0.010608 |
import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i]
if obj['type'] == 'entrance':
if obj['characte... | SyntaxBlitz/syntaxblitz.github.io | mining-lear/process/step6.py | Python | mit | 1,654 | 0.024788 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as pu... | salberin/libsigrokdecode | decoders/usb_signalling/pd.py | Python | gpl-3.0 | 7,715 | 0.002333 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import re
from openerp import netsvc
from openerp.... | adhoc-dev/odoo-nautical | nautical/partner.py | Python | agpl-3.0 | 957 | 0.014629 |
# Database
DB_NAME = 'censusreporter_ke'
DB_USER = 'censusreporter_ke'
DB_PASSWORD = 'censusreporter_ke'
| callmealien/wazimap_zambia | censusreporter/api/config.py | Python | mit | 106 | 0 |
from flask import Flask, render_template, request
from lib.work import work
from lib.loaders.policedata import PoliceData
from lib.loaders.populationdata import PopulationData
from lib.loaders.childpovertydata import ChildPovertyData
from lib.loaders.cancerdata import CancerData
import json
app = Flask(__name__)
@app... | mattyhall/North-South-Divide | divide.py | Python | bsd-3-clause | 2,269 | 0.009255 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api, exceptions, _
c... | factorlibre/odoomrp-wip | stock_picking_wave_management/models/stock_picking_wave.py | Python | agpl-3.0 | 3,408 | 0.000293 |
# Time: O(n * k^2), n is the number of the words, k is the max length of the words.
# Space: O(n * k)
# Given a list of unique words. Find all pairs of indices (i, j)
# in the given list, so that the concatenation of the two words,
# i.e. words[i] + words[j] is a palindrome.
#
# Example 1:
# Given words = ["bat", "ta... | kamyu104/LeetCode | Python/palindrome-pairs.py | Python | mit | 4,503 | 0.001777 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
transaction_ids = fields.Many2many('payment.transaction'... | t3dev/odoo | addons/payment/models/account_invoice.py | Python | gpl-3.0 | 4,255 | 0.00423 |
# 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/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_03_03_preview/models/_models_py3.py | Python | mit | 167,573 | 0.003473 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Smile. All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | emimorad/smile_openerp_matrix_widget | smile_matrix_widget/widgets/__init__.py | Python | gpl-3.0 | 966 | 0 |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import re
rootPath = "/Users/jeff/work/debug/20181216_hard_fe2k_15fps/"
finalLogFile = "rosout.log.2"
def appendTimestamps(arr, start, stop, flag):
#flag = True
d = stop - start
if flag or (d > -10 and d < 2000):
arr.append... | yejingfu/samples | tensorflow/pyplot03.py | Python | mit | 3,650 | 0.011233 |
# -*- coding: UTF-8 -*-
# to run by anaconda
# from bokeh.plotting import figure, output_file, show
import bokeh.plotting as bp
import bokeh_gmapm
import logging
logger = logging.getLogger(__name__)
class Figure(object):
def __init__(self, *args, **kwargs):
self._output_fname = kwargs.get('o... | sergeimoiseev/othodi | bokehm.py | Python | mit | 4,203 | 0.012848 |
# This is purely the result of trial and error.
import sys
from setuptools import setup, find_packages
import httpie
# Note: keep requirements here to ease distributions packaging
tests_require = [
'pytest',
'pytest-httpbin>=0.0.6',
'responses',
]
dev_require = [
*tests_require,
'flake8',
'... | jakubroztocil/httpie | setup.py | Python | bsd-3-clause | 2,890 | 0.000346 |
#!/usr/bin/env python3
import logging
from src import util
from src import etherscan
from src import messages
from crypto.prices import *
logger = logging.getLogger("node")
######
# Telegram command handler for adding nodes for the user who fired the command.
#
# Command: /node :address0;name0 ... :addressN;nameN
#
... | kevinrombach/TNTNodeMonitorBot | src/commandhandler/node.py | Python | apache-2.0 | 10,737 | 0.011456 |
#!/usr/bin/env python3
#pylint: disable=missing-docstring
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
... | nuclear-wizard/moose | python/chigger/tests/utils/test_get_active_filenames.py | Python | lgpl-2.1 | 1,925 | 0.007792 |
import pipes
from fabric.api import settings, task, local, hide
from fabric.contrib.console import confirm
def is_working_tree_clean():
with settings(hide('everything'), warn_only=True):
local('git update-index -q --ignore-submodules --refresh')
unstaged = local('git diff-files --quiet --ignore-s... | GaretJax/ppc | fabfile.py | Python | mit | 2,432 | 0.000411 |
from vt_manager.controller.actions.ActionController import ActionController
from vt_manager.controller.drivers.VTDriver import VTDriver
from vt_manager.models.Action import Action
from vt_manager.models.VirtualMachine import VirtualMachine
import xmlrpclib, threading, logging, copy
from vt_manager.communication.utils.X... | dana-i2cat/felix | vt_manager/src/python/vt_manager/controller/dispatchers/xmlrpc/InformationDispatcher.py | Python | apache-2.0 | 7,769 | 0.022268 |
# This code is licensed under the MIT License (see LICENSE file for details)
from PyQt5 import Qt
class ViewportRectItem(Qt.QGraphicsObject):
size_changed = Qt.pyqtSignal(Qt.QSizeF)
def __init__(self):
super().__init__()
self.setFlags(
Qt.QGraphicsItem.ItemIgnoresTransformations |... | zpincus/RisWidget | ris_widget/qgraphicsitems/viewport_rect_item.py | Python | mit | 1,046 | 0.002868 |
###############################################################################
###############################################################################
# MODULE COPIER_COLLER_FICHIERS
###############################################################################
########################################... | AlexandreGazagnes/Unduplicator | Copier_coller_fichiers.py | Python | mit | 2,039 | 0.02207 |
# coding: utf-8
if DefLANG in ("RU", "UA"):
AnsBase_temp = tuple([line.decode("utf-8") for line in (
"\nВсего входов - %d\nВремя последнего входа - %s\nПоследняя роль - %s", # 0
"\nВремя последнего выхода - %s\nПричина выхода - %s", # 1
"\nНики: %s", # 2
"Нет статистики.", # 3
"«%s» сидит здесь - %s.", # 4
... | alkorgun/blacksmith-2 | expansions/user_stats/insc.py | Python | apache-2.0 | 813 | 0.048961 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Michael Howitz, gocept gmbh & co. kg
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in the h... | pacoqueen/odfpy | tests/testuserfields.py | Python | gpl-2.0 | 7,878 | 0.000127 |
# -*- coding: utf-8 -*-
import pandas as pd
import os
import os.path as path
import logging
from oemof import network
from oemof.solph import EnergySystem
from oemof.solph.options import BinaryFlow, Investment
from oemof.solph.plumbing import sequence
from oemof.solph.network import (Bus, Source, Sink, Flow, LinearTra... | rl-institut/reegis_hp | reegis_hp/de21/scenario_tools.py | Python | gpl-3.0 | 22,415 | 0.000491 |
from __future__ import absolute_import
import posixpath
from rest_framework import serializers
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint, ProjectReleasePermission
from sentry.api.exceptions import ResourceDoesNotExist
from ... | JackDanger/sentry | src/sentry/api/endpoints/project_release_file_details.py | Python | bsd-3-clause | 7,531 | 0.000266 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
"""release.py
"""
import os
fr... | lissyx/build-mozharness | mozharness/mozilla/release.py | Python | mpl-2.0 | 1,945 | 0.002571 |
#!/usr/bin/env python2.7
from PyQt4 import QtCore, QtGui
class MigrationWizardIntroPage(QtGui.QWizardPage):
def __init__(self):
super(QtGui.QWizardPage, self).__init__()
self.setTitle("Migrating configuration")
label = QtGui.QLabel("This wizard will help you to migrate your configuration. ... | timothyparez/PyBitmessage | src/bitmessageqt/migrationwizard.py | Python | mit | 2,437 | 0.005334 |
# encoding: utf-8
# module samba.dcerpc.dnsserver
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/dnsserver.so
# by generator 1.135
""" dnsserver DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class DNS_RPC_ENUM_ZONES_FILTER(__talloc.Object):
# no doc
def __init__(self, *args,... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/dnsserver/DNS_RPC_ENUM_ZONES_FILTER.py | Python | gpl-2.0 | 1,215 | 0.00823 |
import sys
import numpy as np
import pylab
import matplotlib.pyplot as plt
import scipy.integrate
import scipy.optimize
from collections import namedtuple
import geo
import astro_help as ah
import disk_sub as disk
RADIAN=57.29598
C=2.997925e10
MSOL=1.979e33
G=6.670e-8
YR=3.1556925e7
EPSILON=1e-6
PI=3.1416
STEFAN_BOLT... | jhmatthews/cobra | source/disk_sub.py | Python | gpl-2.0 | 3,164 | 0.072377 |
#!/usr/bin/env python
# coding=utf-8
# Contributor:
# Phus Lu <phus.lu@gmail.com>
__version__ = '3.1.1'
__password__ = ''
__hostsdeny__ = () # __hostsdeny__ = ('.youtube.com', '.youku.com')
import gevent.monkey
gevent.monkey.patch_all(subprocess=True)
import sys
import errno
import time
import itertools... | JerryXia/fastgoagent | goagent/server/paas/wsgi.py | Python | mit | 5,380 | 0.004833 |
"""Helpers for components that manage entities."""
import asyncio
from datetime import timedelta
from homeassistant import config as conf_util
from homeassistant.setup import async_prepare_setup_platform
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_SCAN_INTERVAL, CONF_ENTITY_NAMESPACE,
DEVICE_DEFAULT... | ewandor/home-assistant | homeassistant/helpers/entity_component.py | Python | apache-2.0 | 17,208 | 0.000058 |
# encoding: utf-8
from collections import namedtuple
import inspect
import keyword
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
import jedi
has_jedi = True
except ImportError:
has_jedi = False
from bpython import autocomplete
from bpython._py3compat impor... | MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/bpython/test/test_autocomplete.py | Python | mit | 16,423 | 0 |
# -*- coding: utf-8 -*-
"""Page model for Automation/Ansible/Repositories"""
import attr
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic.exceptions import NoSuchElementException
from widgetastic.widget import Checkbox, Fillable, ParametrizedView, Text, View
from widgetastic_manageiq import... | anurag03/integration_tests | cfme/ansible/repositories.py | Python | gpl-2.0 | 13,574 | 0.001842 |
from color import Color
from orientation import Orientation
from tile import (
Terrain,
Harbor,
)
CENTER_TILE_TEMPLATE = [
list(' + -- + '),
list(' / \ '),
list('+ +'),
list(' \ / '),
list(' + -- + '),
]
BORDER_TILE_TEMPLATE = [
list(' | -- | '),
list(' - - ')... | mackorone/catan | src/view.py | Python | mit | 8,044 | 0.001119 |
# Principal Component Analysis Code :
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud
from pylab import *
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import ro... | tapomayukh/projects_in_python | classification/Classification_with_kNN/Single_Contact_Classification/Scaled_Features/best_kNN_PCA/objects/test11_cross_validate_objects_1200ms_scaled_method_v.py | Python | mit | 4,915 | 0.020753 |
import logging
import pickle
from time import time
from hashlib import md5
from base64 import urlsafe_b64encode
from os import urandom
import redis
from flask import Flask, request, render_template
import config
logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__,static_folder='public')
r = redis.Strict... | skooda/passIon | index.py | Python | mit | 1,879 | 0.002129 |
# Put libraries such as Divisi in the PYTHONPATH.
import sys, pickle, os
sys.path = ['/stuff/openmind'] + sys.path
from csc.divisi.cnet import *
from csc.divisi.graphics import output_svg
from vendor_db import iter_info
from csamoa.corpus.models import *
from csamoa.conceptnet.models import *
# Load the OMCS language ... | commonsense/divisi | doc/demo/vendor_only_svd.py | Python | gpl-3.0 | 1,871 | 0.008017 |
import os
busybox_tar_path = os.path.join(os.path.dirname(__file__), '../../../data/busyboxlight.tar')
# these are in correct ancestry order
busybox_ids = (
'769b9341d937a3dba9e460f664b4f183a6cecdd62b337220a28b3deb50ee0a02',
'48e5f45168b97799ad0aafb7e2fef9fac57b5f16f6db7f67ba2000eb947637eb',
'bf747efa0e2... | rbarlow/pulp_docker | plugins/test/unit/plugins/importers/data.py | Python | gpl-2.0 | 450 | 0.002222 |
import sys
import argparse
from svtools.external_cmd import ExternalCmd
class BedpeSort(ExternalCmd):
def __init__(self):
super(BedpeSort, self).__init__('bedpesort', 'bin/bedpesort')
def description():
return 'sort a BEDPE file'
def epilog():
return 'To read in stdin and output to a file, use /d... | hall-lab/svtools | svtools/bedpesort.py | Python | mit | 1,152 | 0.008681 |
#!/usr/bin/env python
#coding=utf-8
'''
Created on 2010-4-27
GPL License
@author: sypxue@gmail.com
'''
import urllib,pickle,StringIO
from micolog_plugin import *
from google.appengine.ext import db
from model import OptionSet,Comment,Blog,Entry,Blog
from google.appengine.api import urlfetch
class akismet(Plugin):
d... | Alwnikrotikz/micolog2 | plugins/akismet.py | Python | gpl-3.0 | 8,593 | 0.055148 |
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return render(request, 'todo/index.html')
| deshmukhmayur/django-todo | todo/views.py | Python | mit | 166 | 0.006024 |
# NeoPixel driver for MicroPython on ESP8266
# MIT license; Copyright (c) 2016 Damien P. George
from esp import neopixel_write
class NeoPixel:
ORDER = (1, 0, 2, 3)
def __init__(self, pin, n, bpp=3):
self.pin = pin
self.n = n
self.bpp = bpp
self.buf = bytearray(n * bpp)
... | swegener/micropython | ports/esp8266/modules/neopixel.py | Python | mit | 836 | 0 |
#!/usr/bin/env python
import os
from gi.repository import Gtk
from gi.repository import Vte
from gi.repository import GLib
from gi.repository import Keybinder
from gi.repository import Gdk
class Tida(Gtk.Window):
"""A micro-drop-down terminal like TILDA"""
def __init__(self, config=None):
Gtk.Window.__init__(sel... | headlins/tida | Tida.py | Python | lgpl-3.0 | 3,125 | 0.03296 |
import md5
import os
import sys
path = sys.argv[1]
db_file = open(os.path.join(path,"pics_mysql.txt"),"w")
for file_name in os.listdir(path):
if not file_name.lower().endswith(".gif"): continue
with open(os.path.join(path,file_name),"rb") as fp:
contents = fp.read()
new_file_name = m... | 0x1001/funornot | utils/image_convert.py | Python | gpl-2.0 | 593 | 0.025295 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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.a... | TieWei/nova | nova/tests/objects/test_pci_device.py | Python | apache-2.0 | 12,888 | 0.000155 |
import os
from pathlib import Path
import shutil
import joblib
import hvc
from config import rewrite_config
HERE = Path(__file__).parent
DATA_FOR_TESTS = HERE / ".." / "data_for_tests"
TEST_CONFIGS = DATA_FOR_TESTS.joinpath("config.yml").resolve()
FEATURE_FILES_DST = DATA_FOR_TESTS.joinpath("feature_files").resolv... | NickleDave/hybrid-vocal-classifier | tests/scripts/remake_model_files.py | Python | bsd-3-clause | 3,608 | 0.00194 |
# Copyright 2015 FUJITSU LIMITED
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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
#
... | openstack/monasca-notification | monasca_notification/common/repositories/base/base_repo.py | Python | apache-2.0 | 1,519 | 0.003292 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-research/remixmatch | mixup.py | Python | apache-2.0 | 4,608 | 0.002604 |
# Copyright 2016 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... | YoshikawaMasashi/magenta | magenta/music/notebook_utils.py | Python | apache-2.0 | 1,557 | 0.001927 |
from collections import defaultdict
import mock
from searx.engines import bing_news
from searx.testing import SearxTestCase
import lxml
class TestBingNewsEngine(SearxTestCase):
def test_request(self):
bing_news.supported_languages = ['en', 'fr']
query = 'test_query'
dicto = defaultdict(di... | jcherqui/searx | tests/unit/engines/test_bing_news.py | Python | agpl-3.0 | 7,039 | 0.000426 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
"jso... | sloev/pycorm | setup.py | Python | mit | 1,378 | 0.000726 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("DummyClassifier" , "BreastCancer" , "mysql")
| antoinecarme/sklearn2sql_heroku | tests/classification/BreastCancer/ws_BreastCancer_DummyClassifier_mysql_code_gen.py | Python | bsd-3-clause | 142 | 0.014085 |
import io
import logging
from collections import defaultdict
from numpy import linspace
from scipy import interp
from sklearn.metrics import (auc, average_precision_score,
precision_recall_curve)
from tabulate import tabulate
from .test_statistic import ClassifierStatistic, TestStatistic
... | yafeunteun/wikipedia-spam-classifier | revscoring/revscoring/scorer_models/test_statistics/precision_recall.py | Python | mit | 3,506 | 0.001141 |
from datetime import datetime
from casexml.apps.case.xml.generator import date_to_xml_string
DUMMY_ID = "foo"
DUMMY_USERNAME = "mclovin"
DUMMY_PASSWORD = "changeme"
DUMMY_PROJECT = "domain"
def dummy_user_xml(user=None):
username = user.username if user else DUMMY_USERNAME
password = user.password if user el... | dimagi/commcare-hq | corehq/ex-submodules/casexml/apps/phone/tests/dummy.py | Python | bsd-3-clause | 1,824 | 0.000548 |
#!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | GoogleCloudPlatform/ai-platform-samples | prediction/xgboost/structured/base/prediction/predict.py | Python | apache-2.0 | 2,134 | 0 |
# -*- coding: utf-8 -*-
"""File containing a Windows Registry plugin to parse the AMCache.hve file."""
from __future__ import unicode_literals
import pyregf
from dfdatetime import filetime
from dfdatetime import posix_time
from dfwinreg import definitions as dfwinreg_definitions
from plaso.containers import events
f... | rgayon/plaso | plaso/parsers/amcache.py | Python | apache-2.0 | 11,498 | 0.006784 |
from tornado.options import options, logging
from itertools import product
import json
import tornado.web
import pymongo
import csv
class MongoDbLookupHandler(tornado.web.RequestHandler):
def get(self, identity):
logging.info("uri=%s [%s] [%s]" % (self.request.uri, identity, self.request.arguments))
... | cancerregulome/GeneSpot_1.0 | websvcs/endpoints/storage/mongodb_lookups.py | Python | mit | 10,153 | 0.002659 |
from ..core import mi, nmi
from .base import (AlphaAngleBaseMetric, ContactBaseMetric, DihedralBaseMetric,
BaseMetric)
import numpy as np
from itertools import combinations_with_replacement as combinations
from multiprocessing import Pool
from contextlib import closing
__all__ = ['AlphaAngleMutual... | cxhernandez/mdentropy | mdentropy/metrics/mutinf.py | Python | gpl-3.0 | 2,347 | 0 |
import model
EmployeeColumns = ["name", "role_id", "is_active", "street_address", "city", "state", "zip", "phone"]
class StaffMember(object):
"""
Represents a staff member
"""
def __init__(self, name, roleId, isActive, street=None, city=None, state=None, zipCode=None, phone=None):
"""
Creates a new staff me... | jworr/scheduler | model/staff.py | Python | gpl-2.0 | 1,931 | 0.052822 |
import random
import time
import logging
import sys
from os.path import dirname
sys.path.append(dirname(dirname(dirname(__file__))))
import hazelcast
def do_benchmark():
THREAD_COUNT = 1
ENTRY_COUNT = 10 * 1000
VALUE_SIZE = 10000
GET_PERCENTAGE = 40
PUT_PERCENTAGE = 40
logging.basicConfig(f... | hazelcast/hazelcast-python-client | benchmarks/map_bench.py | Python | apache-2.0 | 1,776 | 0.001689 |
#
# helpers.py
#
# Copyright (C) 2011, 2013, 2015 Uli Fouquet
# 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 p... | ulif/ulif.openoffice | src/ulif/openoffice/helpers.py | Python | gpl-2.0 | 22,408 | 0.000759 |
############################################################
# $HeadURL$
############################################################
"""
DIRAC.WorkloadManagementSystem.PilotAgent package
"""
__RCSID__ = "$Id$" | sposs/DIRAC | WorkloadManagementSystem/PilotAgent/__init__.py | Python | gpl-3.0 | 215 | 0.004651 |
print("-------------- assigning numbers -----------")
fred =100
print(fred)
print(fred)
fred = 200
print(fred)
print(fred)
john = fred
fred = john
print("-------------- assigning letters -----------")
adam = "jj"
print(adam)
print("-------------- assigning coins -----------")
number_of_coins = 200
| wibeasley/mayan-playground-1 | teagen/chapter_02/calculations_and_variables.py | Python | apache-2.0 | 306 | 0.009804 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 OpenStack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | citrix-openstack-build/cinder | cinder/scheduler/simple.py | Python | apache-2.0 | 3,857 | 0 |
'''
New Integration Test for Ceph Pool Capacity.
@author: Legion
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import time
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
pool_cap = ... | zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/ceph_pool_capacity/test_ceph_pool_cap_crt_vm_image.py | Python | apache-2.0 | 989 | 0.001011 |
"""
Support for BME280 temperature, humidity and pressure sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.bme280/
"""
import asyncio
from datetime import timedelta
from functools import partial
import logging
import voluptuous as vol
from... | MungoRae/home-assistant | homeassistant/components/sensor/bme280.py | Python | apache-2.0 | 6,473 | 0 |
import cProfile
import StringIO
import pstats
import contextlib
@contextlib.contextmanager
def profiled():
pr = cProfile.Profile()
pr.enable()
yield
pr.disable()
s = StringIO.StringIO()
ps = pstats.Stats(pr, stream=s).sort_stats("cumulative")
ps.print_stats()
# uncomment this to see wh... | DBeath/flask-feedrsub | feedrsub/utils/profiler.py | Python | mit | 386 | 0 |
import asposecellscloud
from asposecellscloud.CellsApi import CellsApi
from asposecellscloud.CellsApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
apiServer = "http://api.aspose.com/v1.1"
data_fol... | aspose-cells/Aspose.Cells-for-Cloud | Examples/Python/Examples/GetMergedCellFromWorksheet.py | Python | mit | 1,392 | 0.010057 |
import sys # pragma: no cover
from remoteappmanager.command_line_config import (
CommandLineConfig) # pragma: no cover
from remoteappmanager.environment_config import (
EnvironmentConfig) # pragma: no cover
from remoteappmanager.file_config import FileConfig # pragma: no cover
from tornado.options impor... | simphony/simphony-remote | remoteappmanager/cli/remoteappadmin/__main__.py | Python | bsd-3-clause | 1,056 | 0 |
"""
Linked List: Merge K Sorted Lists (hard)
Description:
You are given an array of k linked-lists lists, each linked-list is
sorted in ascending order.
Merge all the linked-lists into one sorted linked-list and return it.
Example:
Input: lists = [[1,4,5],[1,3,4],[2,6]]
Output: [1,1,2,3,4,4,5,6]
Explanation: The li... | dreamibor/Algorithms-and-Data-Structures-Using-Python | practice/implementation/linked_list/merge_k_sorted_list.py | Python | gpl-3.0 | 4,308 | 0.009749 |
# dr14_t.meter: compute the DR14 value of the given audiofiles
# Copyright (C) 2011 Simone Riva
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | magicgoose/dr14_t.meter | dr14tmeter/table.py | Python | gpl-3.0 | 16,975 | 0.043122 |
'''
Created on April 26, 2013
@package: livedesk
@copyright: 2013 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Mugur Rus
API specifications for liveblog sync.
'''
from ally.support.api.entity import Entity, IEntityService, QEntity
from livedesk.api.blog import Blog
from datetime imp... | superdesk/Live-Blog | plugins/livedesk-sync/livedesk/api/blog_sync.py | Python | agpl-3.0 | 3,125 | 0.0144 |
#!/usr/bin/python
import numpy as np
mdir = "mesh3d/"
fname = "out_p6-p4-p8"
####################
print "input mesh data file"
f1 = open(mdir+fname+".mesh", 'r')
for line in f1:
if line.startswith("Vertices"): break
pcount = int(f1.next())
xyz = np.empty((pcount, 3), dtype=np.float)
for t in range(pcount):
xyz... | jrugis/cell_mesh | mesh2vtk.py | Python | gpl-3.0 | 2,909 | 0.024751 |
import sys
import os
import warnings
import ruamel.yaml as yaml
from fnmatch import fnmatch
__author__ = "Pymatgen Development Team"
__email__ ="pymatgen@googlegroups.com"
__maintainer__ = "Shyue Ping Ong"
__maintainer_email__ ="shyuep@gmail.com"
__version__ = "2019.7.2"
SETTINGS_FILE = os.path.join(os.path.expandu... | blondegeek/pymatgen | pymatgen/__init__.py | Python | mit | 3,203 | 0.002498 |
<<<<<<< HEAD
from flask import Blueprint, render_template, request, url_for, jsonify
from config import mongo
import pandas as pd
import json
from bson import json_util
import retrieve_model as rmodel
from collections import Counter
main = Blueprint('main', __name__, template_folder='templates')
@main.route('/')
de... | skrzym/monday-morning-quarterback | Application/Site/mmq/main/controllers.py | Python | mit | 7,841 | 0.054202 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | rabipanda/tensorflow | tensorflow/contrib/py2tf/impl/naming_test.py | Python | apache-2.0 | 2,895 | 0.003454 |
# Copyright 2015: Mirantis 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 b... | aforalee/rally | tests/unit/task/processing/test_charts.py | Python | apache-2.0 | 19,909 | 0 |
from __future__ import unicode_literals
import copy
import pickle
import sys
import warnings
from unittest import TestCase
from django.utils import six
from django.utils.functional import LazyObject, SimpleLazyObject, empty
from .models import Category, CategoryInfo
class Foo(object):
"""
A simple class wi... | MounirMesselmeni/django | tests/utils_tests/test_lazyobject.py | Python | bsd-3-clause | 11,862 | 0.000506 |
# -*- coding: utf-8 -*-
class horizontal_rule:
def __init__(self):
pass
@staticmethod
def process(data, args):
data['note_viewer'].call_function('insert_horizontal_rule') | marcoconstancio/yanta | actions/horizontal_rule/horizontal_rule.py | Python | gpl-2.0 | 200 | 0.005 |
# 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 u... | mufaddalq/cloudstack-datera-driver | test/integration/smoke/test_loadbalance.py | Python | apache-2.0 | 25,268 | 0.001979 |
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy
import matplotlib.pyplot as plt
import datetime
import clawpack.visclaw.colormaps as colormap
import clawpack.visclaw.gaugetools as gaugetools
import clawpack.clawutil.data as clawutil
import clawpack.amrclaw.data as... | mandli/surge-examples | harvey/setplot.py | Python | mit | 12,304 | 0.002682 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains expectations."""
import inquisition
FISHY = inquisition.SPANISH
FISHY = FISHY.replace('surprise', 'haddock')
print FISHY
| aedoler/is210-week-03-synthesizing | task_01.py | Python | mpl-2.0 | 183 | 0 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division # Standardmäßig float division - Ganzzahldivision kann man explizit mit '//' durchführen
from __future__ import absolute_import
import pygame
from pyecs import *
# from pyecs.components import *
# from components import *
class Process... | xaedes/PyCompuPipe | pycompupipe/components/processing/process_output.py | Python | mit | 525 | 0.009579 |
from colossus.game import Route
def test_route_step():
route = Route(100.0, 1)
route.add_packet()
dmg = route.update(10.0)
assert dmg <= 0.0
dmg = 0.0
dmg += route.update(100000.0)
dmg += route.update(100000.0)
assert dmg > 0.0
def test_route_removal_of_packet_after_action():
route... | spectralflux/colossus | tests/test_route.py | Python | mit | 458 | 0.004367 |
# -*- encoding: utf-8 -*-
from abjad import *
from abjad.tools.quantizationtools import *
def test_quantizationtools_QGrid___call___01():
q_grid = QGrid()
a = QEventProxy(SilentQEvent(0, ['A']), 0)
b = QEventProxy(SilentQEvent((1, 20), ['B']), (1, 20))
c = QEventProxy(SilentQEvent((9, 20), [... | mscuthbert/abjad | abjad/tools/quantizationtools/test/test_quantizationtools_QGrid___call__.py | Python | gpl-3.0 | 3,905 | 0.000256 |
"""
Contains basic interface (abstract base class) for word embeddings.
"""
import os
from abc import ABCMeta, abstractmethod
class IWordEmbedding(object):
"""
Abstract base class for word embeddings
"""
__metaclass__ = ABCMeta
def __init__(self, path, vector_length):
self.model = None
... | mikolajsacha/tweetsclassification | src/features/word_embeddings/iword_embedding.py | Python | mit | 1,681 | 0.003569 |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: graph
import flatbuffers
class FlatProperties(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFlatProperties(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x ... | deeplearning4j/deeplearning4j | libnd4j/include/graph/generated/nd4j/graph/FlatProperties.py | Python | apache-2.0 | 7,580 | 0.005937 |
#!/usr/bin/env python3
import os
import sys
import math
from colorsys import hsv_to_rgb
from random import random
from hippietrap.hippietrap import HippieTrap, ALL, NUM_NODES
from hippietrap.color import Color, ColorGenerator, random_color, hue_to_color
from hippietrap.geometry import HippieTrapGeometry
from hippietra... | mayhem/led-chandelier | software/patterns/sweep_two_color_shift.py | Python | mit | 1,663 | 0.004811 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | ddurieux/alignak | alignak/db_oracle.py | Python | agpl-3.0 | 4,741 | 0.001477 |
# -*- coding: utf-8 -*-
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation r... | vmlaker/mpipe | doc/source/conf.py | Python | mit | 7,581 | 0.006068 |
#!/usr/bin/env python2
'''
genPOI.py
Scans regionsets for TileEntities and Entities, filters them, and writes out
POI/marker info.
A markerSet is list of POIs to display on a tileset. It has a display name,
and a group name.
markersDB.js holds a list of POIs in each group
markers.js holds a list of which markerSet... | kevinwchang/Minecraft-Overviewer | overviewer_core/aux_files/genPOI.py | Python | gpl-3.0 | 21,247 | 0.003624 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests models.parameters
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
import numpy as np
from numpy.testing import utils
from . import irafutil
from .. import model... | piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/modeling/tests/test_parameters.py | Python | mit | 21,265 | 0.000611 |
# -*- coding: utf-8 -*-
from itertools import product
from itertools import permutations
from numba import njit
from numba.core import types, utils
import unittest
from numba.tests.support import (TestCase, no_pyobj_flags, MemoryLeakMixin)
from numba.core.errors import TypingError, UnsupportedError
from numba.cpython.... | cpcloud/numba | numba/tests/test_unicode.py | Python | bsd-2-clause | 93,714 | 0.000151 |
# 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.
import logging
import o... | blzq/infer | infer/lib/python/inferlib/capture/ant.py | Python | bsd-3-clause | 2,914 | 0 |
""" TokenManager service
.. literalinclude:: ../ConfigTemplate.cfg
:start-after: ##BEGIN TokenManager:
:end-before: ##END
:dedent: 2
:caption: TokenManager options
"""
import pprint
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.Security import Properties
from DIRAC.Core.Tornado.... | ic-hep/DIRAC | src/DIRAC/FrameworkSystem/Service/TokenManagerHandler.py | Python | gpl-3.0 | 8,162 | 0.001715 |
p = dict(
subject = 'EG009',
#Fixation size (in degrees):
fixation_size = 0.4,
monitor='testMonitor',
scanner=True,
screen_number = 1,
full_screen = True,
radial_cyc = 10,
angular_cyc = 15,
angular_width=30,
size = 60, #This just needs to be larger than the screen
tempor... | arokem/bowties | params.py | Python | apache-2.0 | 464 | 0.064655 |
import os
import sys
from numpy import *
from scipy.integrate import ode
from scipy.interpolate import griddata
from mesh import *
from navierstokes import NavierStokes
nE = 5000
dt = 0.0005
nsteps = 2000
Mach = 0.3
Re = 10000
HiRes = 1.
z = load('data/navierstokesInit.npz')
geom, v, t, b, soln = z['geom'], z['v'], ... | gomezstevena/x-wind | src/navierstokesRun.py | Python | gpl-3.0 | 709 | 0.004231 |
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Mesh.MeshWriter import MeshWriter
from UM.Math.Vector import Vector
from UM.Logger import Logger
from UM.Math.Matrix import Matrix
from UM.Application import Application
import UM.Scene.SceneNode
import Savitar
... | Curahelper/Cura | plugins/3MFWriter/ThreeMFWriter.py | Python | agpl-3.0 | 7,998 | 0.006627 |
import json
class SettingsEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, type):
return obj.__name__
if callable(obj):
return obj.__name__
return json.JSONEncoder.default(self, obj)
| dhermyt/WONS | configuration/Encoder.py | Python | bsd-2-clause | 258 | 0 |
########
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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... | dankilman/clue | clue/tests/test_git.py | Python | apache-2.0 | 16,458 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.