code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
ROUTING_KEY = "%s:%s:%s"
# Database info
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
SENSOR_DATA_KEYSPACE = "sensor_data"
ANALYTICS_KEYSPACE = "analytics"
USERS_KEYSPACE = "users"
USERS_CONSENT_TABLE = "users_consent"
TAGS_TABLE_NAME = "tags"
AGGREGATES_TABLE_NAME = "aggregates"
# Servers config info
CASSANDRA_ADDRESS = 'cassa... | CloudbrainLabs/htm-challenge | brainsquared/settings.py | Python | agpl-3.0 | 4,055 |
# python version 1.0 DO NOT EDIT
#
# Generated by smidump version 0.4.8:
#
# smidump -f python DNOS-SWITCHING-MIB
FILENAME = "fastpathswitching.my"
MIB = {
"moduleName" : "DNOS-SWITCHING-MIB",
"DNOS-SWITCHING-MIB" : {
"nodetype" : "module",
"language" : "SMIv2",
"organization" ... | hmpf/nav | python/nav/smidumps/DNOS-SWITCHING-MIB.py | Python | gpl-3.0 | 716,513 |
# -*- coding: utf-8 -*-
#
# 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... | tseaver/google-cloud-python | pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py | Python | apache-2.0 | 45,602 |
# -*- coding: utf-8 -*-
# Copyright(C) 2011 Clément Schreiner
#
# 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... | franek/weboob | modules/mediawiki/backend.py | Python | agpl-3.0 | 2,878 |
# Copyright 2017 Battelle Energy Alliance, 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 agreed t... | joshua-cogliati-inl/raven | tests/framework/unit_tests/TSA/testRWD.py | Python | apache-2.0 | 8,605 |
from django.conf.urls import *
from django.views.generic.base import TemplateView
from django.http import HttpResponseRedirect
from .api import ObjectView, ModelView, ModelListView, QueryView
def redirect_to_static(request):
path = request.get_full_path()
return HttpResponseRedirect('/static%s' % path)
urlpattern... | ginkgobioworks/curious | curious/urls.py | Python | mit | 983 |
# Copyright (C) 2016 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... | NcLang/vimrc | sources_non_forked/YouCompleteMe/third_party/ycmd/ycmd/tests/python/debug_info_test.py | Python | mit | 2,841 |
# coding=utf-8
# Copyright 2021 TF.Text Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | scheib/chromium | third_party/tensorflow-text/src/tensorflow_text/python/benchmarks/ops_benchmarks.py | Python | bsd-3-clause | 6,587 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-05 21:40
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | iAddz/allianceauth | notifications/migrations/0001_initial.py | Python | gpl-2.0 | 1,181 |
"""Test template specific functionality.
Make sure tables expose their functionality to templates right. This
generally about testing "out"-functionality of the tables, whether
via templates or otherwise. Whether a test belongs here or, say, in
``test_basic``, is not always a clear-cut decision.
"""
from django.temp... | commtrack/commtrack-core | apps/django_tables/tests/test_templates.py | Python | bsd-3-clause | 5,249 |
import urllib, urllib2
TUMBLR = "https://www.tumblr.com/login"
src = 'fullscreen_post_image" src="'
bg = []
for i in range(100):
r=urllib2.urlopen(TUMBLR)
t=r.read()
tt=t[t.find(src)+len(src):]
ttt=tt[:tt.find('"')]
bg.append(ttt)
print ttt
bg = list(set(bg))
print str(bg)
| carpedm20/comgong-job | mailing_list/tumblr.py | Python | bsd-3-clause | 291 |
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class AuthToken(models.Model):
"""
Store auth tokens returned by the moderation backend service (Slack)
"""
service_name = models.TextField()
service_entity_auth_name = models.TextField()
service_e... | CareerVillage/slack-moderation | src/accounts/models.py | Python | mit | 446 |
import warnings
import numpy as np
from sklearn.base import RegressorMixin
from sklearn.exceptions import ConvergenceWarning
from sklearn.linear_model.base import LinearModel
from sklearn.utils.validation import check_X_y
from sparsereg.model.base import PrintMixin
eps = np.finfo(np.float64).eps
def scale_sigma(es... | Ohjeah/sparsereg | sparsereg/model/bayes.py | Python | mit | 4,327 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import json
import threading
from queue import Queue, Empty
import requests
from builtins import str as t
from builtins import bytes as b
def ... | stephane-martin/pymatter | pymatter/base.py | Python | lgpl-3.0 | 8,151 |
#!/usr/bin/env python3
'''Extract the PDB files from the pml file from the CATH databse.
The extracted PDBs will be stored in a pdb file.
The PDB files will be cleaned by reading into Rosetta.
Usage:
./extract_pdbs_from_cath_pml.py pml_file
'''
import os
import sys
import pyrosetta
from pyrosetta import rosetta
... | Kortemme-Lab/protein_feature_analysis | inputs/loop_helix_loop/extract_pdbs_from_cath_pml.py | Python | mit | 1,844 |
# Copyright 2019 KMEE INFORMATICA LTDA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from nfselib.ginfes.v3_01.servico_enviar_lote_rps_envio import (
EnviarLoteRpsEnvio,
ListaRpsType,
tcCpfCnpj,
tcDadosServico,
tcDadosTomador,
tcEndereco,
tcIdentificacaoPrestador,
tcI... | OCA/l10n-brazil | l10n_br_nfse_ginfes/models/document.py | Python | agpl-3.0 | 15,133 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.core
~~~~~~~~~~~~~~~~~~~
Core functions for configuring cache and monkey patching ``requests``
"""
from contextlib import contextmanager
from datetime import datetime, timedelta
from operator import itemgetter
import requests
from requests i... | repotvsupertuga/tvsupertuga.repository | script.module.ukusa/requests_cache/core.py | Python | gpl-2.0 | 9,839 |
#!/usr/bin/env python
'''Test that a font likely to be installed on the computer can be
loaded and displayed correctly.
One window will open, it should show "Quickly brown fox" at 24pt using:
* "Helvetica" on Mac OS X
* "Arial" on Windows
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import un... | Byron/btank | src/python/btank/tests/utility/patch/06nested/[result]/tests/font/SYSTEM.py | Python | lgpl-3.0 | 660 |
#!/usr/bin/env python
#
# 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 ... | Aloomaio/googleads-python-lib | examples/adwords/v201809/advanced_operations/add_multi_asset_responsive_display_ad.py | Python | apache-2.0 | 5,311 |
__author__ = 'Sharon lev'
__email__ = 'sharon_lev@yahoo.com'
__date__ = '8/31/15 16:19'
def DataProviderSingleton(data_set, id_key=None, id_index=None):
"""
Data provider decorator, allows another callable to provide the data for the test
:param data_set: a DataSet instance that can provide sets of data as exp... | sharonlev/pyUnittestExtras | src/unittestextras/DataProviderSingleton.py | Python | gpl-3.0 | 2,491 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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': '1.1',
'status': ['preview'],
... | KohlsTechnology/ansible | lib/ansible/modules/network/aci/aci_tenant_span_dst_group.py | Python | gpl-3.0 | 6,644 |
from django.conf.urls import patterns, url
from trees import views
urlpatterns = [
# ex: /
url(r'^$', views.index, name='index_url'),
# ex: /list/
#url(r'^list/$', views.tree_list, name='list_url'),
# /gallery/ - show most recent photos in some kind of grid? clicking goes to tree de... | mattblair/pdx-trees-django | trees/urls.py | Python | mit | 2,047 |
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QWidget, QPushButton, QButtonGroup, QFrame, QHBoxLayout
from pyqt_screenshot import constant
from pyqt_screenshot.constant import *
from PyQt5.QtCore import pyqtSignal, Qt
import resource.resource
class MyToolBar(QWidget):
""" ToolBar widget """
# s... | SeptemberHX/screenshot | pyqt_screenshot/toolbar.py | Python | gpl-3.0 | 7,153 |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="choropleth.colorbar.title.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotly/python-api | packages/python/plotly/plotly/validators/choropleth/colorbar/title/font/_size.py | Python | mit | 513 |
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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.... | smartsheet-platform/smartsheet-python-sdk | smartsheet/models/enums/sheet_filter_type.py | Python | apache-2.0 | 768 |
arkeia_request_stage_1 = "\x00\x4d\x00\x03\x00\x01\x03\xe8"
| zeroq/amun | vuln_modules/vuln-arkeia/arkeia_shellcodes.py | Python | gpl-2.0 | 60 |
from pathlib import Path
from vnpy.trader.app import BaseApp
from .engine import AlgoEngine, APP_NAME
from .template import AlgoTemplate
class AlgoTradingApp(BaseApp):
""""""
app_name = APP_NAME
app_module = __module__
app_path = Path(__file__).parent
display_name = "算法交易"
engine_class = Al... | bigdig/vnpy | vnpy/app/algo_trading/__init__.py | Python | mit | 396 |
import sys
import yaml
server_uuid = server.get_param('server')['uuid']
sys.stdout.push_filter(server_uuid, '<server uuid>')
cluster_uuid = yaml.load(server.admin('box.space._schema:get("cluster")',
silent = True))[0][1]
sys.stdout.push_filter(cluster_uuid, '<cluster uuid>')
sys.stdout.push_filter(server.sourcedi... | dkorolev/tarantool | test/box/bootstrap.test.py | Python | bsd-2-clause | 1,153 |
#!/usr/bin/env python
# coding=utf-8
import time
from clockdeco import clock
@clock
def snooze(seconds):
time.sleep(seconds)
@clock
def factorial(n):
return 1 if n<2 else n*factorial(n-1)
if __name__ == '__main__':
snooze(3)
factorial(3)
| helloTC/LearnPython | fluent_python/function/clockdeco_demo.py | Python | mit | 258 |
# Copyright 2011 OpenStack Foundation.
# 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
# not use this file except in compliance w... | ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/openstack/common/log.py | Python | gpl-2.0 | 26,403 |
from uliweb import Finder, UliwebError, settings
from uliweb.utils.common import import_attr
validators = Finder('VALIDATORS')
def get_form(formcls):
"""
get form class according form class path or form class object
"""
from uliweb.form import Form
import inspect
if inspect.isclass(formcl... | wwfifi/uliweb | uliweb/contrib/form/__init__.py | Python | bsd-2-clause | 776 |
#!/usr/bin/env python
import sys
key_exe_name = 'pd_key_helper'
vault_exe_name = 'lifestuff_vault'
port_number = 5483
def CheckExecutablesPresence():
# Check key_exe_name and vault_exe_name are in current dir (don't use curdir)
print('Not found in current directory:', key_exe_name)
print('Not found in current ... | gyoyo/MaidSafe | tools/setup_network.py | Python | gpl-3.0 | 2,338 |
import sys
def step1(beacons):
return len(beacons)
def step2(scanner_position):
result = 0
for x1, y1, z1 in scanner_position:
for x2, y2, z2 in scanner_position:
result = max(result, abs(x1 - x2) + abs(y1 - y2) + abs(z1 - z2))
return result
def solve(scanners):
correctly_r... | plilja/adventofcode | 2021/day19/day19.py | Python | gpl-3.0 | 3,211 |
import csv
import logging
class User:
def __init__(self,name,password):
self.name = name
self.password = password
self.logger = logging.getLogger('reliability')
self.project = ""
class Users:
def __init__(self):
self.users = {}
self.logger = logging.getLogger('... | mffiedler/svt | reliability/tasks/Users.py | Python | apache-2.0 | 1,677 |
from container import Container
import numpy as np
class ConcatTable(Container):
"""docstring for ConcatTable"""
def __init__(self):
super(ConcatTable, self).__init__()
self.modules = []
def update_output(self, x):
self.output = []
for i in xrange(len(self.modules)):
... | dnlcrl/PyFunt | pyfunt/concat_table.py | Python | mit | 1,788 |
# -*- coding: utf-8 -*-
from pymodbus3.datastore.store import ModbusSequentialDataBlock
from pymodbus3.datastore.store import ModbusSparseDataBlock
from pymodbus3.datastore.context import ModbusSlaveContext
from pymodbus3.datastore.context import ModbusServerContext
# Exported symbols
__all__ = [
'ModbusSequenti... | uzumaxy/pymodbus3 | pymodbus3/datastore/__init__.py | Python | bsd-3-clause | 418 |
# By using each of the digits from the set, {1, 2, 3, 4}, exactly
# once, and making use of the four arithmetic operations (+, -, *, /)
# and brackets/parentheses, it is possible to form different positive
# integer targets.
# For example,
# 8 = (4 * (1 + 3)) / 2
# 14 = 4 * (3 + 1 / 2)
# 19 = 4 * (2 + 3) - 1
# ... | cloudzfy/euler | src/93.py | Python | mit | 1,988 |
print("This is the pong game.")
print()
print("Unfortunately, I have no idea right now how to implement pacman in the terminal.")
print("Please choose the hilo game type - you'll get an actual game!")
print()
| mikeckennedy/cookiecutter-course | src/ch6_programatic_cookiecutter/src/templates/cookiecutter-use-api/{{ cookiecutter.project_name }}/pacman.py | Python | gpl-2.0 | 209 |
class Category(object):
def __init__(self, name, ID, level):
self.name = name
self.ID = ID
self.level = level
self.children = []
self.parent = None
| bourdibay/EbayAlertor | Alertor/AlertsParameters/Categories/Category.py | Python | mit | 194 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright © 2016 idailybread.com
"""
import docker
import json
import time
import os
__author__ = 'Mush Mo <mush@dailyinnovation.biz>'
def main():
out_put_path = '/etc/endpoints/endpoints.json'
sync_interval = int(os.getenv('SYNC_INTERVAL', 60))
while ... | btyh17mxy/portainerNodeMonitor | monitor.py | Python | mit | 1,147 |
#!/usr/bin/env kross
"""
KSpread python script that provides the Yahoo! Weather formula function.
Yahoo! Terms of Use
The feeds are provided free of charge for use by individuals and non-profit
organizations for personal, non-commercial uses. We ask that you provide
attribution to Yahoo! Weather in connection with yo... | KDE/calligra-history | kspread/plugins/scripting/scripts/yweather.py | Python | gpl-2.0 | 3,803 |
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
from django.conf import settings
from django.core.files import File
from django.core.files.storage import FileSystemStorage
from django.db import models
f... | fnp/wolnelektury | src/catalogue/fields.py | Python | agpl-3.0 | 14,050 |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 17:38:50 2015
@author: deep
"""
from binaryTree import BTree, generateRandomTree, inorder
def largestBST(root):
if root.left is None and root.right is None:
return True, 1, root.value, root.value
if root.left:
isBSTL, sizeL, minL, maxL = large... | ddeepak6992/Algorithms | Binary-Tree/largest_BST_in_a_binary_tree.py | Python | gpl-2.0 | 953 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-22 21:31
from __future__ import unicode_literals
from django.db import migrations
from wagtail.core.rich_text import RichText
def convert_to_streamfield(apps, schema_editor):
BlogPage = apps.get_model("blog", "BlogPage")
for page in BlogPage.obj... | cts-admin/cts | cts/blog/migrations/0005_auto_20170922_2131.py | Python | gpl-3.0 | 1,116 |
# OpenGL functions
from __future__ import division
from OpenGL.GL import *
from defines import *
def set_color (army, colorMode):
if(colorMode == shadow):
glColor4d(0,0.0,0,0.6)
#glmaterialfv(gl_front, gl_shininess, 0.0)
#glmaterialfv(gl_front, gl_ambient, [0, 0, 0, 0.5])
#glmaterialfv(gl_front, g... | alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/openGLFunctions.py | Python | mit | 1,394 |
#!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... | RethinkRobotics/baxter_tools | scripts/tuck_arms.py | Python | bsd-3-clause | 11,341 |
"""
This marker is used for purposes of RHV - CFME integration.
Tests can be marked like this:
.. code-block:: python
@pytest.mark.rhv2
def test_something():
assert True
Usage on CLI::
pytest -m 'rhv1' # Run only tier 1
pytest -m 'rhv1 or rhv2 or rhv3' # Run all the tiers
pytest -m 'n... | jkandasa/integration_tests | markers/rhv.py | Python | gpl-2.0 | 1,498 |
# -*- 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 'Suggestion.reason'
db.add_column('suggestions_suggestion', 'reason',
s... | noamelf/Open-Knesset | suggestions/migrations/0004_auto__add_field_suggestion_reason.py | Python | bsd-3-clause | 6,391 |
import collections
import operator
import re
def make_histogram(d):
histogram = [(l, len(i)) for l, i in d.items()]
histogram = sorted(histogram, key=operator.itemgetter(1))
return histogram
class Hex(object):
"""
Data we store about a hex.
"""
def __init__(self, location, settlement, au... | funkaoshi/hexenbracken | hexmap.py | Python | mit | 2,825 |
"""
"""
from PVMidi import Note, TrackObj, MidiObj, playMelody
import math
import json
import midi
from midi.events import *
class ShepVoice:
def __init__(self, noctaves=4, i0=0, dur=1):
self.noctaves = noctaves
self.nsteps = 12*noctaves
self.low = 21
self.high = self.low + self.n... | WorldViews/Spirals | Kinetics/midi/old/Shepard_old.py | Python | mit | 2,139 |
# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1298297934.4676549
_template_filename='/home/jojo/pylons_projects/woodstock/woodstock/templates/edit_user.mako'
_template_uri='/edit_user... | jojoblaze/Woodstock | data/templates/edit_user.mako.py | Python | gpl-3.0 | 3,627 |
# -*- coding: utf-8 -*-
#
# Sorted list implementation.
from __future__ import print_function
from sys import hexversion
from .sortedlist import recursive_repr
from bisect import bisect_left, bisect_right, insort
from itertools import chain, repeat, starmap
from collections import MutableSequence
from operator import... | hexlism/xx_net | python27/1.0/lib/noarch/sortedcontainers/sortedlistwithkey.py | Python | bsd-2-clause | 41,145 |
# -*- coding: utf-8 -*-
"""
romslab
"""
__authors__ = ['Rafael Soutelino', 'Andre Lobato']
__copyright__ = "left"
__credits__ = ["Andre Lobato", "Gabriel Serrato"]
__license__ = "BSD"
__version__ = "0.2"
__maintainer__ = "Rafael Soutelino"
__email__ = "rsoutelino@gmail.com"
__status__ = "Beta"
__all__ = ['romslab']
... | rsoutelino/romslab | build/lib.linux-x86_64-2.7/__init__.py | Python | mit | 336 |
# -*- coding: windows-1252 -*-
from BIFFRecords import ColInfoRecord
class Column(object):
def __init__(self, colx, parent_sheet):
if not(isinstance(colx, int) and 0 <= colx <= 255):
raise ValueError("column index (%r) not an int in range(256)" % colx)
self._index = colx
self._... | ShaolongHu/lpts | site-packages/xlwt/Column.py | Python | gpl-2.0 | 1,510 |
from math import fabs
import models
import translations
import target
from indicators import calc_country_indicators
from utils import none_num, fformat_none, fformat_front, fformat_two
from indicators import NA_STR
import traceback
def calc_change(val1, val2):
try:
if val1 == None or val2 == None:
... | aptivate/ihpresultsweb | ihp/submissions/country_scorecard.py | Python | gpl-3.0 | 18,220 |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... | anastue/netforce | netforce_ecom/netforce_ecom/controllers/ecom_return_paysbuy.py | Python | mit | 3,574 |
# -*- coding: utf-8 -*-
from django import forms
class UploadForm(forms.Form):
titulo = forms.CharField(max_length=200)
descripcion= forms.CharField(max_length=500)
tags= forms.CharField(max_length=500)
privado=forms.BooleanField(initial=False, required=False)
documento = forms.FileField(
label... | i32baher/practicas-iss | tubeworld/subir/forms.py | Python | gpl-3.0 | 349 |
#!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.path.abspath('lib'))
from ansible import __version__, __author__
try:
from setuptools import setup, find_packages
except ImportError:
print("Ansible now needs setuptools in order to build. Install it using"
" your package manager (us... | 20uf/ansible | setup.py | Python | gpl-3.0 | 1,159 |
# -*- 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 model 'PasswordHistory'
db.create_table('student_passwordhistory', (
('id', self.gf('dj... | yokose-ks/edx-platform | common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py | Python | agpl-3.0 | 11,742 |
from django.shortcuts import render
from django.views import generic
from project_viewer.models import Project
class IndexView(generic.ListView):
template_name = 'pv/project_list.html'
context_object_name = 'project_list'
def get_queryset(self):
"""
List all projects
"""
return Project.objects.all()
| therocode/therocode-site | project_viewer/views.py | Python | mit | 315 |
'''
apkg
~~~~
A package manager for Agda.
'''
# ----------------------------------------------------------------------------
import click
import logging
import click_log
from pony.orm import db_session, select
from ..service.database import db
from ..service.database import ( Library , LibraryV... | jonaprieto/agda-pkg | apkg/commands/freeze.py | Python | mit | 823 |
# -*- coding: utf-8 -*-
from pibooth.config.parser import PiConfigParser
from pibooth.config.menu import PiConfigMenu
| werdeil/pibooth | pibooth/config/__init__.py | Python | mit | 119 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.net... | pacoqueen/cican | utils/treeview2csv.py | Python | gpl-3.0 | 8,615 |
# Copyright 2013 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 logging
import os
import posixpath
from compiled_file_system import SingleFile
from file_system import FileNotFoundError
from future import Gettable,... | cvsuser-chromium/chromium | chrome/common/extensions/docs/server2/api_models.py | Python | bsd-3-clause | 2,913 |
#!/usr/bin/env python
import sys
import json
import ephem
from datetime import datetime
time = sys.argv[4]
moon = ephem.Moon(time)
observer = ephem.Observer()
observer.date = ephem.Date(time)
observer.lon = sys.argv[1]
observer.lat = sys.argv[2]
observer.elev = float(sys.argv[3])
#For U.S. Naval Astronomica... | ntucakovic/around-earth | backend/astro.py | Python | gpl-3.0 | 2,082 |
#!/usr/bin/python
import pickle
import sys
import matplotlib.pyplot
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
# read in data dictionary, convert to numpy array
data_dict = pickle.load( open("final_project_dataset.pkl", "r") )
features = ["salary", "bonus"]
data_dict.po... | mdegis/machine-learning | 007 - Outliers/enron_outliers.py | Python | gpl-3.0 | 749 |
import asyncio
import io
import logging
import os
import zipfile
from .. import asutil
from .. import exception
logger = logging.getLogger(__name__)
expect_ok = asutil.expect_ok_closure(exception.AdjustCommandError)
stdout_options = asutil.process_stdout_options
stderr_options = asutil.process_stderr_options
# Thi... | jsenko/repour | repour/adjust/process_provider.py | Python | apache-2.0 | 3,837 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# apsniff Helpers
#
# Author: Sergio Salazar (ssalazarcz@gmail.com)
#
__version__ = "0.1"
__last_updated__ = "March 15, 2018"
__author__ = "Sergio Salazar"
# Imports
import os
class Loader:
def loadAPConfigFiles(self, path_to_scan):
_ap_config_files = []
... | ssalazarcz/scat | aps/helpers.py | Python | mit | 961 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: image_stamped.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(impo... | ryanlelek/SMORESGaitRecorder | proto/image_stamped_pb2.py | Python | gpl-3.0 | 2,161 |
#!/usr/bin/env python3
import distutils.spawn
import fnmatch
import glob
import os
import re
import subprocess
import sys
def print_usage():
print("Usage: ", sys.argv[0], "source-directory-with-heic-images [target-directory]")
if distutils.spawn.find_executable("magick") == None:
print("This script requires Imag... | jivkok/dotfiles | bin/heic2jpg.py | Python | mit | 1,839 |
# -*- coding: utf-8 -*-
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# ***********************************... | ljx0305/ice | scripts/tests/Glacier2/sessionHelper.py | Python | gpl-2.0 | 435 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-06-19 18:52
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('organization_media', '0021_auto_20190619_2031'),
]
operations = [
migrations.AlterM... | Ircam-Web/mezzanine-organization | organization/media/migrations/0022_auto_20190619_2052.py | Python | agpl-3.0 | 765 |
# -*- coding: utf-8 -*-
import re
import nixops.util
class ResourceDefinition(object):
"""Base class for NixOps resource definitions."""
@classmethod
def get_type(cls):
assert False
def __init__(self, xml):
self.name = xml.get("name")
assert self.name
if not re.match... | garbas/nixops | nixops/resources/__init__.py | Python | lgpl-3.0 | 5,272 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or modify it under
# the terms of either:
#
# a) the GNU General Public L... | uliss/quneiform | tests/py/lpod/span.py | Python | gpl-3.0 | 1,668 |
import datetime
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from six import print_
import bigbro
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--store',
dest=... | mikepii/retail_store_foot_traffic_monitor | tracking/management/commands/checkin.py | Python | apache-2.0 | 1,191 |
#!/usr/bin/env python
"""Mandelbrot set computed in parallel using python-csp.
Multiple-producer, single consumer architecture.
Copyright (C) Sarah Mount, 2009.
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 ... | bjlittle/python-csp | examples/mandelbrot/mandelbrot-WorkerFarmer.py | Python | gpl-2.0 | 7,763 |
#!/usr/bin/env python
# $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML.
"""
def main():
try:
import locale
locale.s... | marianoguerra/rst2html5 | html5css3/main.py | Python | mit | 842 |
# -*- coding: utf-8 -*-
#
# Copyrigt 2010 Aleksey Sergushichev <alsergbox@gmail.com>
#
# This file is part of pynlc.
# Pynlc 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, ... | assaron/pynlc | tests/test_board.py | Python | gpl-3.0 | 9,235 |
#!/usr/bin/env python
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2016 Andrew Ziem
# https://www.bleachbit.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | ROCKNROLLKID/bleachbit | bleachbit/CLI.py | Python | gpl-3.0 | 8,750 |
#!/usr/bin/env python
# bot.py
# description: This is the entry script for a Twitter Bot
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
# @package: PWTwitterBot
import tweepy, time, sys, datetime, argparse
# the below imports are imporing other files from this package
import dbconnect
import twitterfu... | pattonwebz/ScheduledTweetBot | bot.py | Python | agpl-3.0 | 6,586 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('logframe', '0007_auto_20160425_1155'),
]
operations = [
migrations.AlterUniqueTogether(
name='resultlevelname',
... | daniell/kashana | django/website/logframe/migrations/0008_auto_20160429_1237.py | Python | agpl-3.0 | 402 |
"""Test the included examples.
"""
import pytest
from conftest import get_example
def test_nodeid(ctestdir):
"""Node ids
"""
with get_example("nodeid.py").open("rt") as f:
ctestdir.makepyfile(f.read())
result = ctestdir.runpytest("--verbose")
try:
result.assert_outcomes(passed=6, ... | RKrahl/pytest-dependency | tests/test_09_examples_names.py | Python | apache-2.0 | 775 |
import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showexponent", parent_name="carpet.aaxis", **kwargs
):
super(ShowexponentValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/carpet/aaxis/_showexponent.py | Python | mit | 555 |
#!/usr/bin/env python
#
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | pombredanne/bandit | tools/openstack_coverage.py | Python | apache-2.0 | 8,988 |
from unittest import TestCase
from pylegos.core import DictionaryUtil
# noinspection PyDictCreation
class TestDictionaryUtil(TestCase):
SUT = DictionaryUtil()
def test_toFormattedString(self):
simpleMap = {}
simpleMap['Key'] = 'Value'
'''
simpleF = self.SUT.toFormattedString(... | velexio/pyLegos | tests/test_dictionaryUtil.py | Python | mit | 1,057 |
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Reveland'
language = 'no'
url = 'http://reveland.nettserier.no/'
start_date = '2007-03-20'
end_date = '2013-04-17'
active = False
rights ... | datagutten/comics | comics/comics/reveland.py | Python | agpl-3.0 | 447 |
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 Dan Falck <ddfalck@gmail.com> *
# * ... | wood-galaxy/FreeCAD | src/Mod/Path/PathScripts/PathUtils.py | Python | lgpl-2.1 | 30,049 |
"""Test deCONZ component setup process."""
import asyncio
from copy import deepcopy
from homeassistant.components.deconz import (
DeconzGateway,
async_setup_entry,
async_unload_entry,
)
from homeassistant.components.deconz.const import DOMAIN as DECONZ_DOMAIN
from homeassistant.components.deconz.gateway i... | sdague/home-assistant | tests/components/deconz/test_init.py | Python | apache-2.0 | 3,558 |
########################################
# This file calls WorkloadGenerator class
# And gives output to stdout
########################################
import sys;
from Utils.WorkloadGenerator import WorkloadGenerator
from Storage.File import StorageFile
from Storage.SlottedPage import SlottedPage
from Storage.PaxPage... | yliu120/dbsystem | HW1/dbsys-hw1/RunWorkload.py | Python | apache-2.0 | 1,273 |
import blackbook.database
from flask import current_app
from flask.views import MethodView
__all__ = ['basecollection', 'errors']
__author__ = 'ievans3024'
API_URI_PREFIX = current_app.config.get('API_ROOT') or '/api'
class APIType(object):
"""Descriptor for properties that need to a class or a subclass of suc... | ievans3024/BlackBook | blackbook/api/__init__.py | Python | mit | 3,588 |
#!/usr/bin/env python
#=============================================================================#
# #
# NAME: module_spec_extract_area.py #
# ... | crpurcell/RMpipeL5 | Imports/module_spec_extract_ascii.py | Python | mit | 17,230 |
"""
URLResolver Addon for Kodi
Copyright (C) 2016 t0mm0, tknorris
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 late... | fapeci/Filma | script.module.urlresolver/lib/urlresolver/lib/strings.py | Python | gpl-3.0 | 1,828 |
class TwoSum:
def __init__(self):
"""
Initialize your data structure here.
"""
self.num_dic = {}
def add(self, number):
"""
Add the number to an internal data structure..
:type number: int
:rtype: void
"""
self.num_dic[nu... | YiqunPeng/Leetcode-pyq | solutions/170TwoSumIII-DataStructureDesign.py | Python | gpl-3.0 | 945 |
from memqueue import MemQueue
import sys, time
import memcache
from optparse import OptionParser
client = ['127.0.0.1:11211']
queue = MemQueue('benchmark', memcache.Client(client))
start = time.time()
if __name__ == '__main__':
parser = OptionParser(usage="usage: %prog [options] filename",
version="%pro... | abhi-bit/memcache-queue | benchmark.py | Python | mit | 1,075 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009-2010 John Stumpo ... | Volshebnyi/fofix | src/util/VFS.py | Python | gpl-2.0 | 16,358 |
import optparse
import sys
from collections import OrderedDict
import codecs
import numpy as np
import os
import re
#import theano
models_path = "./models"
eval_path = "./evaluation"
eval_temp = os.path.join(eval_path, "temp")
eval_script = os.path.join(eval_path, "conlleval")
def lock_file(f):
import fcntl, er... | onurgu/ner-tagger-tensorflow | utils.py | Python | mit | 18,910 |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import unittest
import re
import sys
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from fuzzywuzzy import utils
from fuzzywuzzy.string_processing import StringProcessor
if sys.version_info[0] == 3:
unicode = str
if sys.version_info[:2] =... | zhahaoyu/fuzzywuzzy | test_fuzzywuzzy.py | Python | mit | 15,982 |
import json
from flask import request, make_response, jsonify, session as loginSession
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from config.flask_config import app
from model.entities import Category
from model.repository import CategoryRepo
from exception.exception_help... | AlanPrado/item-catalog | catalog/server/api/category.py | Python | mit | 2,340 |
# Copyright (c) Corporation for National Research Initiatives
"""Usage: jythonc [options] [module]*
where options include:
--ignore-warning
-i
silence the jythonc deprecation warning
--package package
-p package
put all compiled code into the named Java package
--jar jarfile
... | DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Tools/jythonc/main.py | Python | gpl-3.0 | 8,961 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
# not use this file except in compli... | anotherjesse/nova | nova/compute/monitor.py | Python | apache-2.0 | 13,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.