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 |
|---|---|---|---|---|---|---|
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | gzamboni/sdnResilience | loxi/of10/message.py | Python | gpl-2.0 | 248,179 | 0.006455 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/NV/texture_expand_normal.py | Python | lgpl-3.0 | 591 | 0.021997 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'SPUser', fields ['username']
db.create_uni... | the0forge/sp | frontend/migrations/0038_auto__add_unique_spuser_username.py | Python | gpl-3.0 | 22,106 | 0.008097 |
#!/usr/bin/python
#
# Copyright (c) 2017 Bruno Medina Bolanos Cacho <bruno.medina@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version':... | EvanK/ansible | lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py | Python | gpl-3.0 | 14,499 | 0.002 |
from contextlib import nested
from contextlib import contextmanager
import mock
import testing as T
import types
from core import db
from core.settings import Settings
from core.mail import MailQueue
from core.util import get_servlet_urlspec
from core.xmppclient import XMPPQueue
import servlets.newpush
from servlets.... | pombredanne/pushmanager | tests/test_servlet_newpush.py | Python | apache-2.0 | 6,300 | 0.00381 |
import logging
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from celery import shared_task
from allianceauth.services.tasks import QueueOnce
from .models import MumbleUser
logger = logging.getLogger(__name__)
class MumbleTasks:
def __init__(self):
pas... | Kaezon/allianceauth | allianceauth/services/modules/mumble/tasks.py | Python | gpl-2.0 | 1,857 | 0.002154 |
# Bloom Framework
#
# John Boxall
# Copyright 2008 Handi Mobility
# www.handimobility.ca
| kevintom/django-bloom | bloom/image/templatetags/__init__.py | Python | gpl-3.0 | 89 | 0 |
#!/usr/bin/env python3
# Copyright 2018 The Crashpad 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
#
# Unle... | nwjs/chromium.src | third_party/crashpad/crashpad/build/install_linux_sysroot.py | Python | bsd-3-clause | 2,174 | 0 |
"""
Django settings for sassafras project.
Generated by 'django-admin startproject' using Django 1.8.13.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | mliudev/sassafras | sassafras/settings.py | Python | mit | 3,364 | 0 |
# Copyright (c) 2004 Gavin E. Crooks <gec@compbio.berkeley.edu>
#
# This software is distributed under the MIT Open Source License.
# <http://www.opensource.org/licenses/mit-license.html>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentati... | NarlikarLab/DIVERSITY | weblogoMod/corebio/utils/deoptparse.py | Python | gpl-3.0 | 9,010 | 0.016426 |
# -*- coding: utf-8 *-*
from redis._compat import iteritems, iterkeys, itervalues
from redis.connection import Token
from redis.exceptions import RedisError
from .base import RedisBase
class ZsetCommands(RedisBase):
# SORTED SET COMMANDS
def zadd(self, name, *args, **kwargs):
"""
Set any numb... | katakumpo/niceredis | niceredis/client/zset.py | Python | mit | 11,593 | 0.000086 |
# -*- coding: utf-8 -*-
"""
Modulo per la gestione generica di una connessione al sito.
"""
#= IMPORT ======================================================================
import datetime
from twisted.internet import protocol
from src.config import config
from src.enums import LOG, OPTION, TRUST
from src.log ... | Onirik79/aaritmud | src/connection.py | Python | gpl-2.0 | 8,524 | 0.005397 |
#!/usr/bin/python2.4
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit tests for grit.gather.tr_html'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.di... | paul99/clank | tools/grit/grit/gather/tr_html_unittest.py | Python | bsd-3-clause | 17,175 | 0.004134 |
from parso.python import tree
from parso.python.token import PythonTokenTypes
from parso.parser import BaseParser
NAME = PythonTokenTypes.NAME
INDENT = PythonTokenTypes.INDENT
DEDENT = PythonTokenTypes.DEDENT
class Parser(BaseParser):
"""
This class is used to parse a Python file, it then divides them into ... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/jedi_deps/parso/parso/python/parser.py | Python | gpl-3.0 | 8,227 | 0.000851 |
# -*- coding: utf-8 -*-
#
#
# Project name: OpenVAS2Report: A set of tools to manager OpenVAS XML report files.
# Project URL: https://github.com/cr0hn/openvas_to_report
#
# Copyright (c) 2015, cr0hn<-AT->cr0hn.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificatio... | cr0hn/openvas_to_report | openvas_to_report/examples/__init__.py | Python | bsd-3-clause | 1,761 | 0.007382 |
# Author: John Elkins <john.elkins@yahoo.com>
# License: MIT <LICENSE>
from common import *
if len(sys.argv) < 2:
log('ERROR output directory is required')
time.sleep(3)
exit()
# setup the output directory, create it if needed
output_dir = sys.argv[1]
if not os.path.exists(output_dir):
os.makedirs(ou... | soulfx/gmusic-playlist | ExportLists.py | Python | mit | 3,890 | 0.004627 |
# Copyright (C) 2014 Dustin Spicuzza
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | eri-trabiccolo/exaile | plugins/playlistanalyzer/__init__.py | Python | gpl-2.0 | 6,185 | 0.008892 |
# #
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... | pneerincx/easybuild-framework | easybuild/tools/parallelbuild.py | Python | gpl-2.0 | 8,870 | 0.003157 |
import sqlite3
TWITTER_CONSUMER_KEY = 'twitter_consumer_key'
TWITTER_CONSUMER_SECRET = 'twitter_consumer_secret'
TWITTER_ACCESS_TOKEN = 'twitter_access_token'
TWITTER_ACCESS_TOKEN_SECRET = 'twitter_access_token_secret'
LAST_LATITUDE = 'last_latitude'
LAST_LONGITUDE = 'last_longitude'
UPC_DATABASE_KEY = 'upc_database_k... | drewhutchison/coolerofdoom | data.py | Python | mit | 3,415 | 0.009663 |
#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2011 Jekin Trivedi <jekintrivedi@gmail.com> (See the file COPYING for details).
from atlas import *
from physics import *
from physics import Quaternion
from physics import Vector3D
import server
class Repairing(server.Task):... | alriddoch/cyphesis | rulesets/mason/world/tasks/Repairing.py | Python | gpl-2.0 | 3,147 | 0.013028 |
# -*- coding: utf-8 -*-
"""
wakatime.compat
~~~~~~~~~~~~~~~
For working with Python2 and Python3.
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import codecs
import os
import platform
import subprocess
import sys
is_py2 = (sys.version_info[0] == 2)
is_py3 ... | wakatime/komodo-wakatime | components/wakatime/compat.py | Python | bsd-3-clause | 3,553 | 0.001689 |
#!/usr/bin/env python
import boto
from boto.s3.connection import OrdinaryCallingFormat
from fabric.api import prompt
def confirm(message):
"""
Verify a users intentions.
"""
answer = prompt(message, default="Not at all")
if answer.lower() not in ('y', 'yes', 'buzz off', 'screw you'):
exit... | swastvedt/dailygraphics | fabfile/utils.py | Python | mit | 813 | 0.00369 |
# coding=utf-8
"""
DCRM - Darwin Cydia Repository Manager
Copyright (C) 2017 WU Zheng <i.82@me.com>
This program 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 yo... | 82Flex/DCRM | WEIPDCRM/views/admin/help/about.py | Python | agpl-3.0 | 1,308 | 0 |
# Copyright 2018 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/active-qa | px/nmt/model_test.py | Python | apache-2.0 | 70,985 | 0.005776 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.goal.erro... | dbentley/pants | src/python/pants/goal/goal.py | Python | apache-2.0 | 8,127 | 0.010336 |
import psycopg2
import unittest
import sys
import os
class GFugaRotaTest(unittest.TestCase):
def setUp(self):
self.table = open(os.path.abspath('../') + '/sql/createsTable/FugaRota.sql', 'r')
self.constraints = open(os.path.abspath('../') + '/sql/createsTable/FugaRota_const.sql', 'r')
sel... | UFCGProjects/sig | src/tests/FugaRotaTest.py | Python | mit | 1,680 | 0.008333 |
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business involves the administration of students, teachers,
# courses, progr... | uclouvain/osis | infrastructure/tests/shared_kernel/academic_year/repository/in_memory/test_academic_year.py | Python | agpl-3.0 | 2,533 | 0.001975 |
# 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
# d... | NeCTAR-RC/horizon | openstack_dashboard/test/integration_tests/tests/test_defaults.py | Python | apache-2.0 | 3,108 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2018-01-24 19:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('page', '0009_auto_20180124_0105'),
]
operations = [
migrations.AlterField(
... | mcmaxwell/idea_digital_agency | idea/feincms/module/page/migrations/0010_auto_20180124_1945.py | Python | mit | 612 | 0.001634 |
from __future__ import unicode_literals
import logging
from functools import update_wrapper
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.template.response import TemplateResponse
from django.urls import NoReverseMatch, reverse
from django.utils import six
from ... | yephper/django | django/views/generic/base.py | Python | bsd-3-clause | 7,898 | 0.001013 |
def fake_get_value_from_db():
return 5
def check_outdated():
total = fake_get_value_from_db()
return total > 10
def task_put_more_stuff_in_db():
def put_stuff(): pass
return {'actions': [put_stuff],
'uptodate': [check_outdated],
}
| gh0std4ncer/doit | doc/tutorial/uptodate_callable.py | Python | mit | 279 | 0.003584 |
#!/usr/bin/env python
#============================================================================
# Copyright (c) Microsoft Corporation. All rights reserved. See license.txt for license information.
#============================================================================
from __future__ import print_function
fro... | MSFTOSSMgmt/WPSDSCLinux | Providers/Scripts/2.6x-2.7x/Scripts/nxIPAddress.py | Python | mit | 30,909 | 0.027727 |
"""
Support for Wink fans.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/fan.wink/
"""
import logging
from homeassistant.components.fan import (
SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SUPPORT_DIRECTION,
SUPPORT_SET_SPEED, FanEntity)
from homeassi... | PetePriority/home-assistant | homeassistant/components/wink/fan.py | Python | apache-2.0 | 3,231 | 0 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-research/sound-separation | models/train/data_meeting_io.py | Python | apache-2.0 | 23,738 | 0.007162 |
class MethodMissing(object):
def __getattr__(self, name):
try:
return self.__getattribute__(name)
except AttributeError:
def method(*args, **kw):
return self.method_missing(name, *args, **kw)
return method
def method_missing(self, name, *args,... | ganow/gq | gq/missing.py | Python | mit | 788 | 0.002538 |
#Music Class and support functions
import pygame
import parameters
from filemanager import filemanager
from pygame.locals import *
from pygame import *
from pygame.mixer import *
#Pygame Module for Music and Sound
pigmusic = None
currentStdMusic=None
currentMenuMusic=None
currentType = None
def initmusic():
globa... | ilathid/ilathidEngine | engine/music.py | Python | epl-1.0 | 6,871 | 0.015282 |
import pytest
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx-proxy.tld/port")
assert r.status_code == 503
def test_webA_is_forwarded(docker_compose, nginxproxy):
r = nginxproxy.get("http://webA.nginx-proxy.tld/port")
assert r.status_code == ... | jwilder/nginx-proxy | test/test_multiple-hosts.py | Python | mit | 562 | 0.003559 |
# -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
class Scheduler():
"""
This class instantiates the... | andreas-kowasch/DomainSearch | DomainSearchViewer/additional/Scheduler.py | Python | bsd-2-clause | 3,767 | 0.003186 |
import copy
import six
from eclcli.common import command
from eclcli.common import utils
class ListUsage(command.Lister):
def get_parser(self, prog_name):
parser = super(ListUsage, self).get_parser(prog_name)
parser.add_argument(
"--From",
help="Date to list usage fr... | anythingrandom/eclcli | eclcli/dh/v2/usage.py | Python | apache-2.0 | 2,651 | 0.010562 |
#!/usr/bin/python3
# -*- coding: utf-8 -*
import cgi
import base64
import random
import requests, json
def getCurrentPhoto(currentPhotoMD5):
response = requests.get("http://localhost:9200/photodisplayer/photo/"+currentPhotoMD5)
jsonPhoto = json.loads(response.text)
return jsonPhoto
def add_note(currentPhotoMD5,a... | Annubis45/PhotoDisplayer | cgi-bin/index.py | Python | gpl-2.0 | 2,228 | 0.04623 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 option) any later version.
#
# This program is distr... | yehialicious/pyrf | pyrf.py | Python | gpl-3.0 | 5,240 | 0.033206 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Reference.year'
db.add_column(u'citations_reference', 'year',
self.gf(... | will-hart/django-citations | citations/migrations/0006_auto__add_field_reference_year.py | Python | mit | 2,201 | 0.008178 |
# References:
#
# https://www.tensorflow.org/guide/low_level_intro
#
# only needed for python 2.7
# from __future__ import absolute_import
# from __future__ import division
# from __future__ import print_function
import numpy as np
from numpy import array
from numpy import float32
# a complete input set on 7 bits
# ... | WmHHooper/aima-python | submissions/aardvark/myNN.py | Python | mit | 8,182 | 0.004033 |
"""
.. image::
../_static/mongodb.png
`GridFS <https://docs.mongodb.com/manual/core/gridfs/>`_ is a specification for storing large files
(>16 MB) in MongoDB. See :py:mod:`~requests_cache.backends.mongodb` for more general info on MongoDB.
API Reference
^^^^^^^^^^^^^
.. automodsumm:: requests_cache.backends.gridf... | reclosedev/requests-cache | requests_cache/backends/gridfs.py | Python | bsd-2-clause | 3,582 | 0.002792 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... | Thraxis/pymedusa | sickbeard/name_parser/regexes.py | Python | gpl-3.0 | 23,532 | 0.0034 |
import os
from time import localtime, strftime
import re
import sys
from fabric.api import local, lcd, settings, task
from fabric.utils import puts
from blog_config import INPUT_PATH, OUTPUT_PATH
SETTINGS_FILE = 'blog_config'
# Load paths
ABS_DIR_PATH = os.path.dirname(os.path.abspath(__file__))
ABS_SETTINGS_FILE = ... | Gastove/blogric | new_post.py | Python | epl-1.0 | 3,746 | 0.004271 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | shakamunyi/beam | sdks/python/apache_beam/utils/annotations_test.py | Python | apache-2.0 | 6,739 | 0.007716 |
############################################################################
#
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the comm... | Distrotech/qtcreator | share/qtcreator/debugger/qttypes.py | Python | lgpl-2.1 | 90,089 | 0.003519 |
"""
Django settings for superlists 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, ...)... | alwaysrookie/superlists | superlists/settings.py | Python | apache-2.0 | 2,067 | 0 |
#! /usr/bin/env python
"""Keywords (from "graminit.c")
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree after building the interpreter and run:
python Lib/keyword.py
"""
__all__ = ["iskeyword", "kw... | DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/keyword.py | Python | gpl-3.0 | 2,162 | 0.004625 |
from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
import os
import arrayio
from genomicode import filelib
... | jefftc/changlab | Betsy/Betsy/modules/run_loocv_random_forest.py | Python | mit | 4,207 | 0.002615 |
# Copyright (c) 2014 Idiap Research Institute, http://www.idiap.ch/
# Written by Nikolaos Pappas <nikolaos.pappas@idiap.ch>,
#
# This file is part of CBRec.
#
# CBRec is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published... | idiap/cbrec | data.py | Python | gpl-3.0 | 2,541 | 0.023219 |
import random
def pivot(items, a, b):
p = items[b]
i = a
for j in range(a,b):
if items[j] <= p:
items[i], items[j] = items[j], items[i]
i += 1
items[i], items[b] = items[b], items[i]
return i
def quicksort(items, i, j):
"""
inplace quicksort
"""
if... | cbare/Etudes | python/quick_sort.py | Python | apache-2.0 | 572 | 0.001748 |
#!/usr/bin/python3
"""This file is part of asyncoro; see http://asyncoro.sourceforge.net for
details.
This program can be used to start discoro server processes so discoro scheduler
(see 'discoro.py') can send computations to these server processes for executing
distributed communicating proceses (coroutines). All co... | pgiri/asyncoro | py3/asyncoro/discoronode.py | Python | mit | 55,226 | 0.00344 |
# -*- coding: utf-8 -*-
"""Remove team domain
Revision ID: 07f975f81f03
Revises: 4e206c5ddabd
Create Date: 2017-08-04 15:12:11.992856
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '07f975f81f03'
down_revision = '4e206c5ddabd'
branch_labels = None
depends_on = ... | hasgeek/lastuser | migrations/versions/07f975f81f03_remove_team_domain.py | Python | bsd-2-clause | 655 | 0.001527 |
# Copyright 2014 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.
import shutil
import tempfile
from telemetry import decorators
from telemetry.testing import options_for_unittests
from telemetry.testing import page_test_t... | axinging/chromium-crosswalk | tools/perf/measurements/skpicture_printer_unittest.py | Python | bsd-3-clause | 1,305 | 0.004598 |
import pandas as pd
import os
# -*- coding: utf-8 -*-
from flutype.data_management.fill_master import Master
import numpy as np
def print_full(x):
pd.set_option('display.max_rows', len(x))
print(x)
pd.reset_option('display.max_rows')
def extract_peptide_batch(ma):
gal_lig_fix = ma.read_gal_ligand("170... | janekg89/flutype_webapp | flutype/gal-file.py | Python | lgpl-3.0 | 5,034 | 0.0147 |
# -*- coding: utf-8 -*-
import datetime
from datetime import date, datetime as dt
from email import Encoders
from email.header import Header
import os
import pickle
import random
import smtplib
import traceback
import calendar
from decimal import Decimal
from email.MIMEBase import MIMEBase
from email.MIMEMultipart im... | LamCiuLoeng/vat | vatsystem/util/common.py | Python | mit | 7,482 | 0.014969 |
# Copyright (C) 2017 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... | Valloric/YouCompleteMe | python/ycm/tests/mock_utils.py | Python | gpl-3.0 | 4,496 | 0.013568 |
ACCESS_KEY = 'twitter_access_token'
REQUEST_KEY = 'twitter_request_token'
SUCCESS_URL_KEY = 'twitter_success_url'
USERINFO_KEY = 'twitter_user_info'
| callowayproject/django-tweeter | django_oauth_twitter/__init__.py | Python | mit | 149 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-13 15:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('accounts', '0001_initial'),
]
o... | z0rr0/eshop | shop/sales/migrations/0001_initial.py | Python | mit | 4,179 | 0.004786 |
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_subquery_condition(self, alias, columns, compiler):
qn = compiler.quote_name_unless_alias
qn2 = self.connection.ops.quote_name
sql, params = self.as_sql()
return '(%s) IN (%s)' % (', '.join('%... | georgemarshall/django | django/db/backends/mysql/compiler.py | Python | bsd-3-clause | 1,599 | 0.001251 |
# 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.
import tracing_project
from py_vulcanize import generate
from tracing_build import render_histograms_viewer
def VulcanizeHistogramsViewer():
"""Vulcaniz... | catapult-project/catapult | tracing/tracing_build/vulcanize_histograms_viewer.py | Python | bsd-3-clause | 912 | 0.006579 |
"""
See LICENSE file for copyright and license details.
"""
from app import app
from flask import render_template, flash, redirect
#from app.forms import LoginForm
from app.modules.constant import *
@app.route("/")
@app.route("/index")
@app.route("/index/")
@app.route("/<app_profile>/index")
@app.route... | rockwolf/python | cece/app/views.py | Python | bsd-3-clause | 4,840 | 0.022727 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2016 Onestein (<http://www.onestein.eu>).
| hip-odoo/odoo | addons/l10n_nl/__init__.py | Python | agpl-3.0 | 158 | 0 |
__author__ = 'robswift'
__project__ = 'blastnfilter'
import os
from BlastNFilter.PreRelease import ParsePreRelease
from BlastNFilter.Blast import ParseAlignment
import OutPut
def run(options):
non_polymer = options.non_polymer
polymer = options.polymer
out = options.out
blast_dir = os.path.abspath(op... | rvswift/BlastNFilter | build/lib/BlastNFilter/Utilities/Run.py | Python | bsd-3-clause | 827 | 0.001209 |
def extractBijinsans(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'Benkyou no Kamisama wa Hitomishiri' in item['tags']:
return buildReleaseMessageWithType(item, 'Benkyou no Kamisama wa... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractBijinsans.py | Python | bsd-3-clause | 387 | 0.023256 |
'''
Kivy framework
==============
Kivy is an open source library for developing multi-touch applications. It is
completely cross-platform (Linux/OSX/Win) and released under the terms of the
MIT License.
It comes with native support for many multi-touch input devices, a growing
library of multi-touch aware widgets and... | arcticshores/kivy | kivy/__init__.py | Python | mit | 14,620 | 0.000547 |
# 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... | derekjchow/models | research/object_detection/utils/config_util.py | Python | apache-2.0 | 36,470 | 0.006581 |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | steve-ord/daliuge | daliuge-engine/dlg/manager/__init__.py | Python | lgpl-2.1 | 1,112 | 0 |
#!/usr/bin/env python3
'''A simple implementation of a sorting algorithm, meant to allow
people to manually rank a list of items using whatever subjective or
objective criteria they want.
This program can be called as a script and used interactively. You
can provide the list of things to sort as command line argument... | sagittarian/personal-sort | sort.py | Python | mit | 4,539 | 0.003745 |
#
# MLDB-1594-aggregator-empty-row.py
# mldb.ai inc, 2016
# this file is part of mldb. copyright 2016 mldb.ai inc. all rights reserved.
#
import unittest
from mldb import mldb, MldbUnitTest, ResponseException
class Mldb1594(MldbUnitTest):
def test_simple(self):
res1 = mldb.query("select {}")
r... | mldbai/mldb | testing/MLDB-1594-aggregator-empty-row.py | Python | apache-2.0 | 1,755 | 0.005698 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | sysadminmatmoz/odoo-clearcorp | TODO-7.0/sneldev_magento/wizard/sneldev_magento_categories_import.py | Python | agpl-3.0 | 1,660 | 0.00241 |
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from actstream.exceptions import check_actionable_model
def follow(user, obj, send_action=True, actor_only=False, request=None):
"""
Creates a relationship al... | pirata-cat/agora-ciudadana | actstream/actions.py | Python | agpl-3.0 | 3,984 | 0.003012 |
from django.conf.urls import patterns, url
from application import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^(?P<application_id>\d+)/$', views.detail, name='detail'),
url(r'^klogin/(?P<username>\w+)/(?P<password>\w+)/$', views.klogin, name='klogin'),
)
| davidegalletti/koa-proof-of-concept | kag/application/urls.py | Python | agpl-3.0 | 305 | 0.009836 |
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import models
# pylint: disable-msg=E0611
from hashlib import md5
from metashare.settings import LOG_HANDLER
from metashare import settings
from os import mkdir
from os.path import exists
import os.path
from uuid import uuid1... | MiltosD/CEF-ELRC | metashare/storage/models.py | Python | bsd-3-clause | 28,959 | 0.007321 |
from twisted.internet import reactor
from twisted.python import log
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
agent = Agent(reactor)
class LoginHandler(object):
def __init__(self, api_url):
self.api_url = api_url
def handle(self, handler, args):
game, ... | gnmerritt/casino | casino/handlers.py | Python | mit | 1,275 | 0.000784 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from types import *
def typer(x,y):
if type(x) is StringType or type(y) is StringType :
print u'получена строка'
else:
if x > y:
print u'больше'
elif x < y:
print u'меньше'
else:
print u'равно'
typer("12", 4)
typer("12","4")
typer(12, 4)
typer(4, 45)
typer(4,... | pybursa/homeworks | a_karnauh/hw1/6.py | Python | gpl-2.0 | 354 | 0.04644 |
from bottle import run
from bottle_app import application
run(host='localhost', port=8080)
| snowfed/Chessology | run_locally.py | Python | gpl-3.0 | 92 | 0 |
"""station_analytics_update
Revision ID: 1cb4253a8bc6
Revises: 2972360b9a6f
Create Date: 2014-04-27 13:01:26.309272
"""
# revision identifiers, used by Alembic.
revision = '1cb4253a8bc6'
down_revision = '2972360b9a6f'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('radio_station',... | andaluri/rootio_web | alembic/versions/1cb4253a8bc6_station_analytics_up.py | Python | agpl-3.0 | 472 | 0.006356 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="Ente",
version="0.1",
description="place finder on commoncrawl dataset",
author="László Nagy",
author_email="rizsotto@gmail.com",
license='LICENSE',
url='https://github.com/rizsotto/Ente',
long_desc... | rizsotto/Ente | setup.py | Python | bsd-3-clause | 383 | 0 |
# Copyright (c) 2018, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
"""Submodule for operating on LVC-format waveform files"""
from .. import __version__
from .file_io import read_from_h5
| moble/scri | scri/LVC/__init__.py | Python | mit | 242 | 0.004132 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | shaggytwodope/qutebrowser | qutebrowser/misc/__init__.py | Python | gpl-3.0 | 820 | 0 |
# Copyright (c) 2013 Daniel Gill
#
# 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, d... | dwgill/dspell | dspell/corpus.py | Python | mit | 1,947 | 0.007704 |
# Based on cage v1.1.4
# http://www.alcyone.com/software/cage/
# Copyright (C) 2002-2006 Erik Max Francis <max@alcyone.com>
# GPL License
class Topology:
"""Encaptulation of the shape and dimentionality of a cellular automata"""
def get(self, address):
raise NotImplementedError
def se... | wichovw/tca-gt | server/tca/cellaut.py | Python | mit | 2,703 | 0.009989 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.core.cache import cache
from django.test import TestCase
from django.contrib import admin
from physical.tests.factory import DiskOfferingFactory, EnvironmentFactory
from physical.errors import NoDiskOfferingGreat... | globocom/database-as-a-service | dbaas/physical/tests/test_disk_offering.py | Python | bsd-3-clause | 9,097 | 0.00033 |
#!BPY
"""
Name: 'TerasologyBlockShapeExport'
Blender: 260
Group: 'Export'
Tooltip: 'Export a Terasology Block Shape'
"""
bl_info = {
"name": "Terasology Block Shape Export",
"description": "Exporter for producing Terasology Block Shape files",
"author": "Immortius",
"version": (1, 1),
"blender": (2, ... | rapodaca/Terasology | blender_addons/io_mesh_terasology/__init__.py | Python | apache-2.0 | 3,098 | 0.037121 |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipes for NativeClient toolchain packages.
The real entry plumbing is in toolchain_main.py.
"""
import collections
import f... | davidbrazdil/nacl | toolchain_build/toolchain_build.py | Python | bsd-3-clause | 39,585 | 0.004825 |
import redis
from app.config import get_config_obj
from app.util.httputil import Http_util
class Component_access_token():
def __init__(self):
self.component_appid = get_config_obj().component_appid
self.component_appsecret = get_config_obj().component_secret
self.r = redis.Redis(host='lo... | CoderHito/wx_demo | app/util/component_access_token.py | Python | mit | 772 | 0.001319 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | rwl/PyCIM | CIM15/CDPSM/Balanced/IEC61970/Wires/EnergyConsumer.py | Python | mit | 4,290 | 0.005128 |
from __future__ import division
import random
import time
from collections import defaultdict, Counter
import gensim
import numpy as np
from numpy import log, pi
from scipy import linalg
from scipy.special import gammaln
import copy
from sklearn.cluster import KMeans
from numba import jit
import cholesky
__author__... | mansweet/GaussianLDA | FastGaussianLDA2.py | Python | apache-2.0 | 27,002 | 0.004037 |
import org.openlca.core.database.CategoryDao as CategoryDao
dbUtil.createTable("tbl_dq_systems",
"CREATE TABLE tbl_dq_systems ( "
+ "id BIGINT NOT NULL, "
+ "name VARCHAR(255), "
+ "ref_id VARCHAR(36), "
+ "version BIGINT, "
+ "last_change BIGINT, "
+ "f_category BIGINT, "
+ "f_source BIG... | GreenDelta/olca-updates | update-src/001_db_schema_update_v6_f0..b7/script.py | Python | mpl-2.0 | 1,555 | 0.036656 |
from django.conf.urls.defaults import *
from django.contrib import admin
# Set up the admin shit
admin.autodiscover()
urlpatterns = patterns('',
(r'^knux/', include(admin.site.urls)),
# Viewing and adding tips/locations
(r'^locations/add/$', 'drinkkit.redditors.views.add_location'),
(r'^locations/search/$', '... | ryanmcgrath/drinkkitcom | urls.py | Python | mit | 1,223 | 0.023712 |
def import_once(modulenames, silent=1):
## import_once
## Fedmich Last modified: 3:38 PM 5/15/2006
## version 1.1
## Usage:
## import_once('os')
## import_once( ["os", 'sys'] )
if type(modulenames) is list:
pass
elif type(modulenames) is tuple:
pass
else:
mod... | ActiveState/code | recipes/Python/496703_importonce/recipe-496703.py | Python | mit | 1,231 | 0.02762 |
"""
Image pipeline viewer.
Note: currently under heavy construction.
"""
import tkinter
import tkinter.ttk
import dh.gui.tk
import dh.image
##
## basic classes
##
class Viewer():
def __init__(self):
self.images = []
self.n = None
self.pipeline = Pipeline()
self.pipeline.add("c... | dhaase-de/dh-python-dh | dh/image/pipeline.py | Python | mit | 13,563 | 0.007299 |
from termcolor import colored
def test_Browser_logs(app):
wd = app.wd
sidebar = wd.find_element_by_xpath("//td[@id='sidebar']")
sidebar.find_element_by_xpath(".//span[normalize-space(.)='Catalog']").click()
wd.find_element_by_xpath("//i[@class='fa fa-folder']/../a").click()
products_qty = len(wd.f... | Dob3r/python_seleniumwebdriver | Tests/test_Browser_logs.py | Python | apache-2.0 | 819 | 0.004884 |
# 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... | obulpathi/cdn1 | cdn/manager/default/v1.py | Python | apache-2.0 | 1,291 | 0 |
# ----------------------------------------------------------------------------------
# Electrum plugin for the Digital Bitbox hardware wallet by Shift Devices AG
# digitalbitbox.com
#
import base64
import binascii
import hashlib
import hmac
import json
import math
import os
import re
import struct
import sys
import ti... | neocogent/electrum | electrum/plugins/digitalbitbox/digitalbitbox.py | Python | mit | 32,370 | 0.004541 |
#Written by Timothy Seabrook
#timothy.seabrook@cs.ox.ac.uk
#This script is used to split the LOLA_DEM South Pole Large Tiles into smaller tiles for ingestion.
import glob, os
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from skimage import io
from osgeo import gdal
full_size = [30400, 304... | Arcanewinds/FDL-LunarResources | DataPreparation/LOLA_DEM/img_split.py | Python | gpl-3.0 | 3,075 | 0.014634 |
#!/usr/bin/env python
"""This utility installs an engage extension into a deployment home.
"""
import os
import os.path
import sys
from optparse import OptionParser
import shutil
import re
import logging
logger = logging.getLogger(__name__)
# enable importing from the python_pkg sub-directory
base_src_dir=os.path.ab... | quaddra/engage | install_extension.py | Python | apache-2.0 | 7,602 | 0.002894 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.