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 |
|---|---|---|---|---|---|---|
#Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2015
import unittest
import metaknowledge
import metaknowledge.WOS
import os
import filecmp
import networkx as nx
disableJournChecking = True
class TestRecordCollection(unittest.TestCase):
@classmethod
def setUpClass(cls):
met... | networks-lab/metaknowledge | metaknowledge/tests/test_recordcollection.py | Python | gpl-2.0 | 26,484 | 0.012538 |
# Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | karulis/pybluez | osx/_bluetoothsockets.py | Python | gpl-2.0 | 35,262 | 0.002354 |
# 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
# di... | jay-lau/magnum | magnum/conductor/mesos_monitor.py | Python | apache-2.0 | 2,587 | 0 |
from flask import url_for
from openatlas import app
from openatlas.models.entity import Entity
from tests.base import TestBaseCase
class SearchTest(TestBaseCase):
def test_search(self) -> None:
with app.test_request_context():
app.preprocess_request() # type: ignore
person = Ent... | craws/OpenAtlas-Python | tests/test_search.py | Python | gpl-2.0 | 1,697 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
import re
import ast
here = path.abspath(path.dirname(__file__))
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('radmyarchive/__init__.py', 'rb') as vf:
version = ... | usta/radmyarchive-py | setup.py | Python | bsd-3-clause | 1,376 | 0.000728 |
from django.db import models
from django.utils import timezone
# Create your models here.
class Comment(models.Model):
title = models.CharField(max_length=200)
comment_text = models.TextField()
rating = models.IntegerField()
created_date = models.DateTimeField(default = timezone.now)
published_dat... | marioluigiman/geekchicken | cafe/models.py | Python | mit | 960 | 0.015625 |
#!/usr/bin/python
#
# Copyright 2015 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... | tgracchus/spinnaker | pylib/spinnaker/reconfigure_spinnaker.py | Python | apache-2.0 | 891 | 0.003367 |
"""Benchmark for SQLAlchemy.
An adaptation of Robert Brewers' ZooMark speed tests. """
import datetime
import sys
import time
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.test import *
ITERATIONS = 1
dbapi_session = engines.ReplayableSession()
metadata = None
class ZooMarkTest(TestBase):
... | simplegeo/sqlalchemy | test/aaa_profiling/test_zoomark_orm.py | Python | mit | 13,694 | 0.002629 |
def bits_set(x):
bits = 0
for i in range(0,8):
if (x & (1<<i))>0:
bits += 1
return bits
def find_ber(sent, received):
assert(len(received)<=len(sent))
if len(received) < len(sent)/2:
print "frame detection error, more than half of the frames were lost!"
return 0.5
errors = 0
for i in range(0,len(receiv... | kit-cel/gr-dab | python/channel_tests/ber.py | Python | gpl-3.0 | 427 | 0.04918 |
"""
***************************************************************************
MDWF_Sensan_a.py
-------------------------------------
Copyright (C) 2014 TIGER-NET (www.tiger-net.org)
***************************************************************************
* This plugin is part of the Water Observatio... | DHI-GRAS/processing_SWAT | MDWF_Sensan_a.py | Python | gpl-3.0 | 7,579 | 0.006333 |
"""
Make sure the !N and !-N commands work properly.
"""
from __future__ import print_function
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class TestHistoryRecall(TestBase):
mydir = TestBase.compute_mydir(__file__)
# If your test case doesn't stress debug ... | apple/swift-lldb | packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py | Python | apache-2.0 | 1,405 | 0.00427 |
import scrapy
from locations.items import GeojsonPointItem
import itertools
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
def partition(l, n):
return list(chunks(l, n))
def process_hours(opening_hours):
ret_hours = []
for hours_str in opening_hours:
split_hours =... | iandees/all-the-places | locations/spiders/hm.py | Python | mit | 3,295 | 0.003642 |
import json
import re
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3 import Retry
URL_TEMPLATE = "https://itunes.apple.com/lookup?id=%s&entity=podcast"
def id_from_url(url):
"""
Extract ID from iTunes podcast URL
:param url (str)
:return: (str)
"""
m... | wotaen/itunes_podcast_rss | extract.py | Python | mit | 1,768 | 0.005656 |
import gtk, gobject, gtk.glade
import gnome, gnome.ui, pango
import os, os.path
from gtk_goodies import gconf_wrapper, Undo, dialog_extras, image_extras
import gsudoku, sudoku, saver, sudoku_maker, printing, sudoku_generator_gui
import game_selector
import time, threading
from gettext import gettext as _
from gettext i... | TheBestHuman/DesktopSudokuGenerator | lib/gnome_sudoku.py | Python | gpl-3.0 | 38,776 | 0.013642 |
#!/usr/bin/env python
#
# Translation of videogamena.me javascript to python
#
# http://videogamena.me/vgng.js
# http://videogamena.me/video_game_names.txt
#
# (C) 2014 Dustin Knie <dustin@nulldomain.com>
import argparse
import os
import random
from math import floor, trunc
_word_list_file = 'video_game_names.txt'
_... | nullpuppy/vgng | vgng.py | Python | mit | 2,102 | 0.00333 |
"""
bamboo.globals
~~~~~~~~~~~~~
"""
from peak.util.proxies import CallbackProxy
from bamboo.context import context
db = CallbackProxy(lambda: context["db"])
| hahnicity/bamboo | bamboo/globals.py | Python | mit | 159 | 0 |
# Copyright 2017 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.
"""This program wraps an arbitrary command since gn currently can only execute
scripts."""
import os
import subprocess
import sys
from shutil import copy2
... | nwjs/chromium.src | tools/v8_context_snapshot/run.py | Python | bsd-3-clause | 552 | 0.003623 |
import yaml
from mongoengine import *
import datetime
import time
import hashlib
import uuid
from pprint import pprint
from user import User, Users
from cloudmesh_management.generate import random_user
from cloudmesh_management.user import read_user
FILENAME = "/tmp/user.yaml"
connect('user', port=27777)
users = Us... | rajpushkar83/cloudmesh | cloudmesh/management/read.py | Python | apache-2.0 | 752 | 0.00133 |
"""
Provide tests for sysadmin dashboard feature in sysadmin.py
"""
from __future__ import absolute_import
import glob
import os
import re
import shutil
import unittest
from datetime import datetime
from uuid import uuid4
import mongoengine
from django.conf import settings
from django.test.client import Client
from d... | ESOedX/edx-platform | lms/djangoapps/dashboard/tests/test_sysadmin.py | Python | agpl-3.0 | 12,287 | 0.001139 |
# A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
# 1/2 = 0.5
# 1/3 = 0.(3)
# 1/4 = 0.25
# 1/5 = 0.2
# 1/6 = 0.1(6)
# 1/7 = 0.(142857)
# 1/8 = 0.125
# 1/9 = 0.(1)
# 1/10 = 0.1
# Where 0.1... | drcsturm/project-euler | p026.py | Python | mit | 1,084 | 0.021218 |
import errno
import os
import unittest
import mock
from taskcat._common_utils import (
exit_with_code,
fetch_ssm_parameter_value,
get_s3_domain,
make_dir,
merge_dicts,
name_from_stack_id,
param_list_to_dict,
pascal_to_snake,
region_from_stack_id,
s3_bucket_name_from_url,
s3_... | aws-quickstart/taskcat | tests/test_common_utils.py | Python | apache-2.0 | 4,514 | 0.001108 |
"""
@date 2014-11-16
@author Hong-She Liang <starofrainnight@gmail.com>
"""
from selenium.common.exceptions import *
| starofrainnight/rabird.selenium | rabird/selenium/exceptions.py | Python | apache-2.0 | 118 | 0 |
"""
Script which define fabric's methods.
"""
from fabric.api import local, task, lcd
from utils import create_bundle_server as create_bs, create_bundle_client as create_bc
@task
def create_bundle_server(bundle_name=None):
"""
Creates bundle for server-side of the application.
"""
create_bs(bundle_n... | PearsonIOKI/ioki-social | fabfile.py | Python | mit | 1,897 | 0.001054 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin, Page
from cms import settings
class InheritPagePlaceholder(CMSPlugin):
"""
Provides the ability to inherit plugins for a certain placeholder from an associated "parent" page instance
"""
... | team-xue/xue | xue/cms/plugins/inherit/models.py | Python | bsd-3-clause | 673 | 0.005944 |
#
# highlight.py
# Part of SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ryan Hileman and Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter3
# License: MIT
#
"""
This module implements highlighting code with marks.
The following classes are exported:
Highligh... | micahwood/linux-dotfiles | sublime/Packages/SublimeLinter/lint/highlight.py | Python | mit | 14,958 | 0.001738 |
#!/usr/bin/env python
#
# Generate pnSeed[] from Pieter's DNS seeder
#
NSEEDS=600
import re
import sys
from subprocess import check_output
def main():
lines = sys.stdin.readlines()
ips = []
pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):17792")
for line in lines:
m = patt... | prolifik/cakecoin | contrib/seeds/makeseeds.py | Python | mit | 709 | 0.015515 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/lib/python/bool.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import m... | OpenMined/PySyft | packages/syft/src/syft/proto/lib/python/bool_pb2.py | Python | apache-2.0 | 1,474 | 0.002035 |
# -*- coding: utf-8 -*-
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
import openerp.tests.common as test_common
# @test_common.post_install(True)
class TestSwedishRounding(test_common.TransactionCase):
def create_dummy_invoice(self):
invoice = self.env['ac... | acsone/account-invoicing | account_invoice_rounding/tests/test_invoice_rounding.py | Python | agpl-3.0 | 7,217 | 0 |
def joke():
return 'Knock Knock. Who is there?'
| cloudfoundry/python-buildpack | fixtures/setup_py/funniest/__init__.py | Python | apache-2.0 | 52 | 0 |
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import NumericProperty, ObjectProperty
from kivy.graphics import Color, Ellipse, Line
from kivy.graphics.transformation import Matrix
from kivy.core.window ... | shy21grams/GroundControl | Simulation/simulationCanvas.py | Python | gpl-3.0 | 3,902 | 0.022553 |
# -*- coding: utf-8 -*-
"""Operating system independent (generic) preprocessor plugins."""
from dfvfs.helpers import file_system_searcher
from plaso.lib import definitions
from plaso.preprocessors import interface
from plaso.preprocessors import manager
class DetermineOperatingSystemPlugin(
interface.FileSystem... | log2timeline/plaso | plaso/preprocessors/generic.py | Python | apache-2.0 | 3,399 | 0.005001 |
import openvoronoi as ovd
import ovdvtk # helper library for visualization using vtk
import time
import vtk
import datetime
import math
import random
import os
import sys
import pickle
import gzip
if __name__ == "__main__":
# size of viewport in pixels
# w=2500
# h=1500
# w=1920
# h=1080
w =... | aewallin/openvoronoi | python_examples/chain_1.py | Python | lgpl-2.1 | 3,292 | 0.001215 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | pferreir/indico-backup | indico/MaKaC/plugins/Collaboration/RecordingManager/fossils.py | Python | gpl-3.0 | 1,501 | 0.009993 |
# Copyright 2012 VMware, 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 ... | suneeth51/neutron | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py | Python | apache-2.0 | 25,812 | 0 |
#!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 The Electrum developers
#
# 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... | argentumproject/electrum-arg | plugins/hw_wallet/hw_wallet.py | Python | mit | 3,347 | 0.000299 |
# -*- coding: utf-8 -*-
from checker.backends import BaseBackend
from checker import logger
log = logger.getLogger(__name__)
class GnomeBackend(BaseBackend):
"""for projects hosted on gnome.org"""
name = 'Gnome'
domain = 'gnome.org'
example = 'https://download.gnome.org/sources/gnome-control-center... | 1dot75cm/repo-checker | checker/backends/gnome.py | Python | mit | 803 | 0 |
# -*- coding: utf-8 -*-
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
exchanges = {} # a placeholder for your instances
for id in ccxt.exchanges:
exchange = getattr(ccxt, id)
exchanges[id... | ccxt/ccxt | examples/py/instantiate-all-at-once.py | Python | mit | 447 | 0.002237 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class ListItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
name = scrapy.Field()
location = scrap... | ThunderShiviah/london-social-network-analysis | web_subscriptions/items.py | Python | mit | 330 | 0 |
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from config import config
def send_mail(message,receivers=config['smtp_receivers']):
"""
Module that sends emails.
Message should be a dictionary containing the following keys:
... | rajaram1990/GetNSEStockPrice | GetNSEStockPrice/email_base.py | Python | mit | 1,041 | 0.011527 |
from generator.actions import Actions
import random
import string
class Palindrome(Actions):
def start(self):
pass
def banner(self):
# Confirm the initial empty line
self.read(delim='\n', expect='\n')
# Confirm the actual banner
self.read(delim='\n', expect='Welcome to ... | f0rki/cb-multios | original-challenges/Palindrome/poller/for-testing/machine.py | Python | mit | 1,305 | 0.011494 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-17 08:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cms', '0008_blogindexpage_blogpost_blogposttag'),
]
oper... | kingsdigitallab/kdl-django | cms/migrations/0009_blogpost_date.py | Python | mit | 565 | 0.00177 |
#
# Copyright (C) 2008, 2013 Red Hat, Inc.
# Copyright (C) 2008 Cole Robinson <crobinso@redhat.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 yo... | aurex-linux/virt-manager | virtManager/createpool.py | Python | gpl-2.0 | 18,923 | 0.000951 |
# This Python file uses the following encoding: utf-8
"""
Copyright 2013 Giacomo Antolini <giacomo.antolini@gmail.com>.
This file is part of flocca_dot_com.
flocca_dot_com is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | flocca/flocca_dot_com | flocca_dot_com/settings.py | Python | gpl-3.0 | 5,929 | 0.001012 |
import sys
sys.path.insert(1, "../../../")
import h2o
def iris_ignore(ip,port):
# Connect to h2o
h2o.init(ip,port)
iris = h2o.import_frame(path=h2o.locate("smalldata/iris/iris2.csv"))
for maxx in range(4):
model = h2o.random_forest(y=iris[4], x=iris[range(maxx+1)], ntrees=50, max_depth=100)
... | bikash/h2o-dev | h2o-py/tests/testdir_algos/rf/pyunit_iris_ignoreRF.py | Python | apache-2.0 | 405 | 0.02716 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | denny820909/builder | lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/test/__init__.py | Python | mit | 2,076 | 0.003372 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2005-2006 Ali Sabil <ali.sabil@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 ... | billiob/papyon | papyon/service/description/SingleSignOn/RequestMultipleSecurityTokens.py | Python | gpl-2.0 | 4,656 | 0.004296 |
# -*- coding: utf-8 -*-
# @date 161103 - Export excel with get_work_order_report function
"""
Data exportor (Excel, CSV...)
"""
import io
import math
from datetime import datetime
from xlsxwriter.workbook import Workbook
import tablib
from utils.tools import get_product_size
def get_customers(customer_list=None... | grtfou/data-analytics-web | website/utils/data_exportor.py | Python | mit | 8,235 | 0 |
import sys
import time
sleep = time.sleep
if sys.platform == 'win32':
time = time.clock
else:
time = time.time
| egbertbouman/tribler-g | Tribler/Core/DecentralizedTracking/pymdht/core/ptime.py | Python | lgpl-2.1 | 124 | 0.008065 |
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="modals.urls",
INSTALLED_APPS=[
"... | publica-io/django-publica-modals | runtests.py | Python | bsd-3-clause | 1,244 | 0.000804 |
import numpy
from chainer.backends import cuda
from chainer import initializer
# Original code forked from MIT licensed keras project
# https://github.com/fchollet/keras/blob/master/keras/initializations.py
class Orthogonal(initializer.Initializer):
"""Initializes array with an orthogonal system.
This init... | aonotas/chainer | chainer/initializers/orthogonal.py | Python | mit | 2,709 | 0 |
from JumpScale import j
import JumpScale.baselib.watchdog.manager
import JumpScale.baselib.redis
import JumpScale.lib.rogerthat
descr = """
critical alert
"""
organization = "jumpscale"
enable = True
REDIS_PORT = 9999
# API_KEY = j.application.config.get('rogerthat.apikey')
redis_client = j.clients.credis.getRedis... | Jumpscale/jumpscale6_core | apps/watchdogmanager/alerttypes/critical.py | Python | bsd-2-clause | 2,105 | 0.003325 |
import csv
import logging
import json
import sys
import urllib2
from django.conf import settings
from django.core.management.base import BaseCommand
from machine.models import Machine
logger = logging.getLogger(__name__)
XMAN_URL = "http://10.180.2.243/api/hostinfo.php?sql=hostname+=+'%s'"
IDC_ABBR = {
'shangdi... | zxl200406/minos | owl/machine/management/commands/import_xman.py | Python | apache-2.0 | 2,543 | 0.012977 |
"""empty message
Revision ID: 6d8e9e4138bf
Revises: 445667ce6268
Create Date: 2016-03-03 10:36:03.205829
"""
# revision identifiers, used by Alembic.
revision = '6d8e9e4138bf'
down_revision = '445667ce6268'
from alembic import op
import app
import sqlalchemy as sa
def upgrade():
### commands auto generated by... | Maethorin/concept2 | migrations/versions/6d8e9e4138bf_.py | Python | mit | 760 | 0.011842 |
import re
from lxml import etree
from nxpy.util import tag_pattern, whitespace_pattern
class Flow(object):
def __init__(self):
self.routes = []
def export(self):
flow = etree.Element('flow')
if len(self.routes):
for route in self.routes:
flow.append(route.... | Kent1/nxpy | nxpy/flow.py | Python | apache-2.0 | 4,735 | 0 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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... | willprice/weboob | weboob/applications/radioob/radioob.py | Python | agpl-3.0 | 15,978 | 0.001189 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from django.template import C... | claudep/pootle | tests/pootle_misc/templatetags.py | Python | gpl-3.0 | 1,836 | 0 |
from ..base import AST
CLASS = "statements.skip"
class SkipStatement(AST):
def __init__(self):
super().__init__(CLASS, "skip_statement")
| PetukhovVictor/compiler | src/Parser/AST/statements/skip.py | Python | mit | 152 | 0 |
#!/usr/bin/env python -u
# -------------------------------------------------------------------------- #
# Copyright 2011, MadeiraCloud (support@madeiracloud.com) #
# -------------------------------------------------------------------------- #
"""MadeiraCloud Agent
"""
import os
import sys
import ... | BillTheBest/MadeiraAgent | bin/madeira.py | Python | bsd-3-clause | 8,479 | 0.034202 |
# coding: utf-8
from __future__ import unicode_literals
import logging
import pytest
import requests
LOG = logging.getLogger("fm.crashmanager.tests.bugproviders.rest")
@pytest.mark.parametrize("method", ["delete", "get", "patch", "post", "put"])
def test_rest_bugproviders_no_auth(db, api_client, method):
"""mus... | MozillaSecurity/FuzzManager | server/crashmanager/tests/test_bugproviders_rest.py | Python | mpl-2.0 | 3,764 | 0.001063 |
import Util
import time
import unittest
import selectBrowser
from selenium import webdriver
from flaky import flaky
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.su... | slovelan/NRAODev | carta/html5/common/skel/source/class/skel/simulation/tLoadImage.py | Python | gpl-2.0 | 5,677 | 0.01603 |
# Copyright 2015 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... | KaranToor/MA450 | google-cloud-sdk/lib/surface/source/__init__.py | Python | apache-2.0 | 1,960 | 0.00102 |
from __future__ import print_function
try:
import astropy.io.fits as pyfits
except ImportError:
import pyfits
def intersection(header1, header2, if_conflict=None):
"""
Return a pyfits Header containing the intersection of two pyfits Headers
*if_conflict* [ '1'/1/'Header1' | '2'/2/'Header2' | None ... | vlas-sokolov/pyspeckit | pyspeckit/spectrum/headers.py | Python | mit | 1,312 | 0.005335 |
'''
This file is part of evopy.
Copyright 2012, Jendrik Poloczek
evopy 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.
evopy is distribut... | jpzk/evopy | evopy/examples/problems/SchwefelsProblem26/ORIDSESAlignedSVC.py | Python | gpl-3.0 | 2,196 | 0.023679 |
# 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/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/aio/operations/_app_service_plans_operations.py | Python | mit | 83,276 | 0.004731 |
# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from functools import cmp_to_key
from urwid import *
from .decor... | renatahodovan/fuzzinator | fuzzinator/ui/tui/table.py | Python | bsd-3-clause | 18,857 | 0.000955 |
"""
Tests for the Video Branding configuration.
"""
from django.test import TestCase
from django.core.exceptions import ValidationError
from nose.plugins.attrib import attr
from branding.models import BrandingInfoConfig
@attr(shard=1)
class BrandingInfoConfigTest(TestCase):
"""
Test the BrandingInfoConfig mo... | naresh21/synergetics-edx-platform | lms/djangoapps/branding/tests/test_models.py | Python | agpl-3.0 | 1,936 | 0.001033 |
odd = [1,3,5,7,9]
even = [2,4,6,8,10]
answer = input("Please enter your number! \n")
answer = int(answer)
if answer in odd:
print("That is quite odd!")
elif answer in even:
print("That's even")
else:
print("You are broken!") | UTC-Coding/Benji-s-Python | Rob/Odd or Even.py | Python | gpl-3.0 | 238 | 0.037815 |
import numpy as np
import colorsys
from numpy import sin, cos, tan
import core
from core.anim import Animation
from core.obj import Point, Line, Vector, Curve
def update_p1(p1, t, tmax):
p1.x = np.cos(t)
def update_p2(p2, t, tmax):
p2.y = np.sin(t/3)
def update_p3(p3, t, tmax):
p3.pos = (p1.x, p2.y)
... | wqferr/AniMathors | 01.py | Python | mit | 2,630 | 0.004563 |
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from jenkins.management.helpers import import_jenkinsserver
# TODO: implement optional field updating...
class Command(BaseCommand):
help ... | caio1982/capomastro | jenkins/management/commands/import_jenkinsserver.py | Python | mit | 960 | 0 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2013
# Gmail:liuzheng712
#
import time
def task():
print "task ..."
def timer(n):
while True:
print time.strftime('%Y-%m-%d %X', time.localtime())
task()
time.sleep(n)
if __name__ == '__main__':
timer(5)
| windskyer/weibo | weibo/test/sleep.py | Python | apache-2.0 | 300 | 0.003333 |
import datetime
import re
import binascii
import random
import string
import logging
from django import forms
from django.db import models
from django.forms import fields
from django.utils.encoding import force_text, smart_bytes
import sys
from core.encryption.Factories import FactoryEncryptionServices as efac
from c... | chop-dbhi/ehb-service | ehb_service/apps/core/encryption/encryptionFields.py | Python | bsd-2-clause | 8,789 | 0.003186 |
# Задача 3. Вариант 10.
# Напишите программу, которая выводит имя "Игорь Васильевич Лотарев", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Donkor A.H.
# 14.04.2016
print("Итак,гость нынешнего дня является русский по... | Mariaanisimova/pythonintask | PMIa/2015/Donkor_A_H/task_3_10.py | Python | apache-2.0 | 928 | 0.018018 |
from __future__ import print_function
import sys, time
import requests, urllib
import demjson, shelve
import os.path
class Archiver:
def __init__(self):
"""
A class for archiving URLS into the wayback machine
"""
self._machine = "http://archive.org/wa... | saberman888/Archiver | archive.py | Python | mit | 5,894 | 0.023583 |
from .trainsession import TrainSession
from .helper import FixedNoise
class SmurffSession(TrainSession):
def __init__(self, Ytrain, priors, is_scarce = True, Ytest=None, side_info=None, direct=True, *args, **kwargs):
TrainSession.__init__(self, priors=priors, *args, **kwargs)
self.addTrainAndTest(Y... | ExaScience/smurff | python/smurff/smurff.py | Python | mit | 3,868 | 0.009566 |
#!/usr/bin/env python
from __future__ import division
from std_msgs.msg import Int32
import roslib; roslib.load_manifest('beep_imu')
import rospy
import smbus
import time
bus = smbus.SMBus(1)
irAddress = 0x55
#pub_mag_xsens = rospy.Publisher('imu/mag', Vector3Stamped)
def decFrom2Compl(val, bitlen):
if val & (1... | iti-luebeck/BEEP | Software/catkin_ws/src/beep_imu/ir_distance_zusmoro.py | Python | bsd-3-clause | 1,517 | 0.039552 |
#encoding:utf-8
import Queue
import threading
import urllib2
# called by each thread
def get_url(q, url):
q.put(urllib2.urlopen(url).read())
theurls = '''http://google.com http://yahoo.com'''.split()
print theurls
q = Queue.Queue()
for u in theurls:
t = threading.Thread(target=get_url, args = (q,u))
t... | ubaldino/pyloop | prueba3.py | Python | agpl-3.0 | 369 | 0.01897 |
"""
Define common steps for instructor dashboard acceptance tests.
"""
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from __future__ import absolute_import
from lettuce import step, world
from mock import patch
from nose.tools import assert_in
from courseware.tests.factories import Inst... | pepeportela/edx-platform | lms/djangoapps/instructor/features/common.py | Python | agpl-3.0 | 4,560 | 0.001316 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | Distrotech/scons | test/Script-import.py | Python | mit | 2,878 | 0.000695 |
import defaulted_methods
if __name__ == "__main__":
defaulted_methods.call_main()
| bozzzzo/quark | quarkc/test/emit/expected/py/defaulted-methods/defaulted_methods.py | Python | apache-2.0 | 87 | 0 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def sumOfLeftLeavesRec(self, root, left):
if root is None:
return 0
elif root.left is None an... | everyevery/programming_study | leetcode/404-SumOfLeftLeaves/sum_of_left_leaves.py | Python | mit | 719 | 0.002782 |
__author__ = 'bharathramh'
EMAIL_VERIFICATION_EXPIRATION_DAYS = 1
FORGOT_PASSWORD_EXPIRATION_DAYS = 1 | bharathramh92/easy-ecom | accounts/constants.py | Python | apache-2.0 | 102 | 0.009804 |
# -*- coding: utf-8 -*-
from .base_premierecinemas import BasePremierecinemasCinemaSpider
class Spider(BasePremierecinemasCinemaSpider):
name = 'praha-premierecinemas'
calendar_url = 'http://www.premierecinemas.cz/'
| zitkino/backend | zitkino/spiders/praha_premierecinemas.py | Python | agpl-3.0 | 229 | 0 |
def omp_parallel_sections_reduction():
import math
dt = 0.5
rounding_error = 1.E-9
sum = 7
dsum = 0
dt = 1. / 3.
result = True
product = 1
logic_and = 1
logic_or = 0
bit_and = 1
bit_or = 0
i = 0
exclusiv_bit_or = 0
known_sum = (1000 * 999) / 2 + 7
if 'o... | hainm/pythran | pythran/tests/openmp.legacy/omp_parallel_sections_reduction.py | Python | bsd-3-clause | 8,373 | 0.003583 |
from pycp2k.inputsection import InputSection
class _each126(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Just_energy = None
self.Powell_opt = None
self.Qs_scf = None
self.Xas_scf = None
self.Md = None
self.Pint = None
self.Meta... | SINGROUP/pycp2k | pycp2k/classes/_each126.py | Python | lgpl-3.0 | 1,114 | 0.001795 |
#!/usr/bin/python
#
# \file 0_setup.py
# \brief setup pacs_prim_list
# \date 2011-09-28 7:22GMT
# \author Jan Boon (Kaetemi)
# Python port of game data build pipeline.
# Setup pacs_prim_list
#
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2010 Winch Gate Property Limited
#
# This prog... | osgcc/ryzom | nel/tools/build_gamedata/processes/pacs_prim_list/0_setup.py | Python | agpl-3.0 | 1,786 | 0.006719 |
#!/usr/bin/env python2
from GSettingsWidgets import *
from ChooserButtonWidgets import TweenChooserButton, EffectChooserButton
EFFECT_SETS = {
"cinnamon": ("traditional", "traditional", "traditional", "none", "none", "none"),
"scale": ("scale", "scale", "scale", "scale", "scale", "scale... | pixunil/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/modules/cs_effects.py | Python | gpl-2.0 | 10,983 | 0.004826 |
#!/usr/bin/python
# Youtube-dl-GUI provides a front-end GUI to youtube-dl
# Copyright (C) 2013 Amit Seal Ami
#
# Th== program == 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 t... | lordamit/youtube-dl-gui | youtube-dl-gui.py | Python | gpl-3.0 | 3,654 | 0.001368 |
from .sql import *
__all__ = ['DBAdapter', 'get_db_adapter', 'async_atomic', 'async_atomic_func', 'get_db_settings']
| technomaniac/trelliopg | trelliopg/__init__.py | Python | mit | 118 | 0.008475 |
#-*- coding: utf-8 -*-
"""
envois.test
~~~~~~~~~~~~
nosetests for the envois pkg
:copyright: (c) 2012 by Mek
:license: BSD, see LICENSE for more details.
"""
import os
import json
import unittest
from envois import invoice
jsn = {"seller": {"name": "Lambda Labs, Inc.", "address": {"street": "857... | lambdal/envois | test/test_envois.py | Python | mit | 1,000 | 0.004 |
import re
text = 'This is some text -- with punctuation.'
pattern = 'is'
print('Text :', text)
print('Pattern :', pattern)
m = re.search(pattern, text)
print('Search :', m)
s = re.fullmatch(pattern, text)
print('Full match :', s)
| jasonwee/asus-rt-n14uhp-mrtg | src/lesson_text/re_fullmatch.py | Python | apache-2.0 | 247 | 0.004049 |
from coalib.parsing.StringProcessing import position_is_escaped
from tests.parsing.StringProcessing.StringProcessingTestBase import (
StringProcessingTestBase)
class PositionIsEscapedTest(StringProcessingTestBase):
# Test the position_is_escaped() function.
def test_basic(self):
expected_results... | yland/coala | tests/parsing/StringProcessing/PositionIsEscapedTest.py | Python | agpl-3.0 | 2,282 | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import ValidationError
from odoo import models, fields, api, _
from odoo.osv import expression
SII_VAT = '60805000-0'
class AccountMove(models.Model):
_inherit = "account.move"
partner_id_... | jeremiahyan/odoo | addons/l10n_cl/models/account_move.py | Python | gpl-3.0 | 9,118 | 0.005485 |
# -*- coding:utf-8 -*-
# Modified from https://github.com/tylerneylon/explacy
import io
from collections import defaultdict
from pprint import pprint
from phrasetree.tree import Tree
def make_table(rows, insert_header=False):
col_widths = [max(len(s) for s in col) for col in zip(*rows[1:])]
rows[0] = [x[:l] ... | hankcs/HanLP | plugins/hanlp_common/hanlp_common/visualization.py | Python | apache-2.0 | 10,303 | 0.000883 |
import sys
sys.path.append('/Users/natj/projects/arcmancer/lib/')
import pyarcmancer as pyac
from img import Imgplane
from visualize_polar import Visualize
from lineprofile import *
import units
import numpy as np
import matplotlib as mpl
from pylab import *
import os
from matplotlib import cm
import scipy.interpol... | natj/bender | sweep.py | Python | mit | 8,380 | 0.024105 |
from GangaCore.GPIDev.Schema import *
from GangaCore.GPIDev.Lib.Tasks.common import *
from GangaCore.GPIDev.Lib.Tasks.ITransform import ITransform
from GangaCore.GPIDev.Lib.Job.Job import JobError
from GangaCore.GPIDev.Lib.Registry.JobRegistry import JobRegistrySlice, JobRegistrySliceProxy
from GangaCore.Core.exception... | ganga-devs/ganga | ganga/GangaND280/Tasks/ND280Transform_CSVEvtList.py | Python | gpl-3.0 | 4,112 | 0.020185 |
# Copyright 2015 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/googlecloudsdk/core/resource/resource_projection_spec.py | Python | bsd-3-clause | 10,147 | 0.00542 |
import pytest
from eventum.lib.text import clean_markdown
@pytest.mark.parametrize(["markdown", "output"], [
('**Bold** text is unbolded.', 'Bold text is unbolded.'),
('So is *underlined* text.', 'So is underlined text.'),
('An [](http://empty-link).', 'An.'),
('A [test](https://adicu.com)', 'A test ... | danrschlosser/eventum | tests/test_text.py | Python | mit | 790 | 0 |
"""Provide access to Python's configuration information.
This is actually PyPy's minimal configuration information.
The specific configuration variables available depend heavily on the
platform and configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_co... | jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/distutils/sysconfig_pypy.py | Python | mit | 4,713 | 0.001485 |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name = 'Adafruit_Nokia_LCD',
version = '0.1.0',
author = 'Tony DiCola',
author_email = 'tdicola@adafruit.com',
description = 'Library to display images on the Nokia 5110/3110 LCD.',
license ... | projectbuendia/server-status | libraries/Adafruit_Nokia_LCD/setup.py | Python | apache-2.0 | 591 | 0.099831 |
"""
Plots Arctic sea ice extent from June 2002-present using JAXA metadata
Website : https://ads.nipr.ac.jp/vishop/vishop-extent.html
Author : Zachary M. Labe
Date : 4 August 2016
"""
### Import modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplo... | zmlabe/IceVarFigs | Scripts/SeaIce/JAXA_seaice_movinglines.py | Python | mit | 6,992 | 0.034611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.