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 |
|---|---|---|---|---|---|
# -*- coding: utf8 -*-
#
# Created by 'myth' on 2/19/16
import matplotlib as mpl
import settings
mpl.use('TkAgg')
| myth/trashcan | it3708/project3/modules/__init__.py | Python | gpl-2.0 | 116 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='jurisdiction',
op... | stefanw/froide | froide/publicbody/migrations/0002_auto_20151127_1754.py | Python | mit | 792 |
#!/usr/bin/env python
import click
import collections
import decimal
import requests
import sys
import yaml
FIAT_SUPPORTED = [
"AUD",
"BRL",
"CAD",
"CHF",
"CNY",
"EUR",
"GBP",
"HKD",
"IDR",
"INR",
"JPY",
"KRW",
"MXN",
"RUB",
"USD",
]
@click.command()
@click.... | nicodemus26/altcoin_value | altcoin_value/main.py | Python | gpl-3.0 | 4,591 |
"""
Utilities for working with pandas objects.
"""
from contextlib import contextmanager
from itertools import product
import operator as op
import warnings
import pandas as pd
from distutils.version import StrictVersion
pandas_version = StrictVersion(pd.__version__)
def july_5th_holiday_observance(datetime_index):... | florentchandelier/zipline | zipline/utils/pandas_utils.py | Python | apache-2.0 | 5,926 |
from sys import maxsize
class Contact:
def __init__(self, firstname=None, lastname=None, nick=None, middlename=None, title=None, company=None, address=None, home_tel=None, mob_tel=None,
work_tel=None, fax=None, email=None, email2=None, homepage=None, birthday=None, id=None, secondar... | goeliv/python_training | model/contact.py | Python | apache-2.0 | 1,589 |
"""
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/benchmarks/bench_plot_nmf.py | Python | bsd-3-clause | 5,890 |
from aiida.orm.calculation.job import JobCalculation
from aiida.orm.data.parameter import ParameterData
from aiida.orm.data.structure import StructureData
from aiida.orm.data.array.trajectory import TrajectoryData
from aiida.orm.data.array import ArrayData
from aiida.common.exceptions import InputValidationError
from a... | abelcarreras/aiida_extensions | plugins/jobs/dynaphopy.py | Python | mit | 10,991 |
# Generated by Django 2.2.9 on 2020-01-15 11:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0032_auto_20200115_1121'),
]
operations = [
migrations.AlterModelOptions(
name='resourcebase',
options={'permissions... | tomkralidis/geonode | geonode/base/migrations/0033_auto_20200115_1145.py | Python | gpl-3.0 | 583 |
from os.path import join
from jedi.file_io import FolderIO
from test.helpers import get_example_dir
def test_folder_io_walk():
root_dir = get_example_dir('namespace_package')
iterator = FolderIO(root_dir).walk()
root, folder_ios, file_ios = next(iterator)
assert {f.path for f in folder_ios} == {join(r... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/jedi_deps/jedi/test/test_file_io.py | Python | gpl-3.0 | 873 |
# Copyright 2015 Cloudbase Solutions Srl
# 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 r... | stackforge/compute-hyperv | compute_hyperv/nova/eventhandler.py | Python | apache-2.0 | 3,590 |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | chrislit/abydos | tests/distance/test_distance_steffensen.py | Python | gpl-3.0 | 4,741 |
# Used by the ErrorHandlerResolutionTests test case.
from .views import empty_view
urlpatterns = []
handler400 = empty_view
handler404 = empty_view
handler500 = empty_view
| DONIKAN/django | tests/urlpatterns_reverse/urls_error_handlers_callables.py | Python | bsd-3-clause | 175 |
#
# This file is part of ROSbots Setup Tools.
#
# Copyright
#
# Copyright (C) 2017 Jack Pien <jack@rosbots.com>
#
# License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundatio... | ROSbots/rosbots_setup_tools | rpi_setup/fabfile.py | Python | gpl-3.0 | 34,336 |
import wave
import random
import tarfile
import threading
import numpy as np
import tensorflow as tf
import unicodedata
import codecs
from os import path
from os import rmdir
from os import remove
from glob import glob
from math import ceil
from Queue import Queue
from os import makedirs
from sox import Transformer
fr... | andrenatal/DeepSpeech | util/importers/ted.py | Python | mpl-2.0 | 11,333 |
import sqlite3
import optparse
import os
import re
def printDownloads(downloadDB):
conn = sqlite3.connect(downloadDB)
c = conn.cursor()
c.execute('SELECT name, source, datetime(endTime/1000000, \'unixepoch\') FROM moz_downloads;')
print '\n[*] --- Files Downloaded --- '
for row in c:
print... | tmosleyIII/firefox-data-retrieval | firefox/retriever.py | Python | mit | 3,731 |
"""
minecraft_server.py
Launches the Minecraft Server to generate chunks in a world.
Generates chunks directly into the world, or generates them into
a cached temporary world and copies only the requested chunks.
Also downloads the latest minecraft server and stores it in a
~/.mceditlib/ServerJarSto... | Rubisk/mcedit2 | src/mceditlib/minecraft_server.py | Python | bsd-3-clause | 20,638 |
def primes(kmax):
result = []
if kmax > 1000:
kmax = 1000
p = [0] * 1000
k = 0
n = 2
while k < kmax:
i = 0
while i < k and n % p[i] != 0:
i += 1
if i == k:
p[k] = n
k += 1
result.append(n)
n += 1
return... | marscher/cython | docs/examples/tutorial/primes/primes.py | Python | apache-2.0 | 328 |
# Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This ... | soltraconpotprojectNLDA/SoltraConpot | conpot/core/databus.py | Python | gpl-2.0 | 4,277 |
from rider.core import HTTP_200
class ResponseSetter(object):
status = HTTP_200
content_type = 'text/plain'
response_type = 'body'
location = None
content_wrapper = None
def __init__(self, *args, **kwargs):
self.content = None
super(ResponseSetter, self).__init__(*args, **kwar... | riderframework/rider | rider/views/response.py | Python | apache-2.0 | 906 |
#Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
class Solution(object):
def twoSum(self, numbers, target):
"""
:type numbers: List[int]
:type target: int
:rtype: List[int]
"""
i=0
j=len(numbers)-1
while i<j:
i... | 95subodh/Leetcode | 167. Two Sum II - Input array is sorted.py | Python | mit | 437 |
import datetime
import json
import struct
import zlib
import pytest
from pygelf import gelf
class _ObjWithStr:
def __str__(self):
return 'str'
class _ObjWithRepr:
def __repr__(self):
return 'repr'
_now = datetime.datetime.now()
@pytest.mark.parametrize(
('obj', 'expected'),
[
... | keeprocking/pygelf | tests/test_core_functions.py | Python | mit | 1,764 |
# -*- coding: utf-8 -*-
import Image
import os
import sys
import ImageEnhance
import argparse
import common
# utils.py
import utils
from utils import encodeChinese
# config.py
import config
parser = argparse.ArgumentParser(description = encodeChinese('进行亮度整理'))
parser.add_argument('--src', action='store', dest='src... | xxd3vin/spp-sdk | tools/script/python/setBrightness.py | Python | mit | 5,105 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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... | jmartinm/InvenioAuthorLists | modules/webcomment/lib/webcomment.py | Python | gpl-2.0 | 89,699 |
from forms import Form
from django.core.exceptions import ValidationError
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput
from util import... | MediaSapiens/autonormix | django/forms/formsets.py | Python | bsd-3-clause | 14,683 |
# Copyright (C) 2016 GRNET S.A.
#
# 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 distributed in the... | grnet/snf-occi | soi/wsgi.py | Python | gpl-3.0 | 3,651 |
# -*- coding: utf-8 -*-
import re
numeric_re = re.compile(r'^\d+$')
def is_int(s):
return re.match(s) is not None
def string_to_list(strs, spliter=','):
"""Convert the string to list"""
if isinstance(strs, list):
str_list = (unicode(item).strip() for item in strs)
elif strs.find(spliter):
... | MrSenko/Nitrate | tcms/core/utils/__init__.py | Python | gpl-2.0 | 4,047 |
# Copyright (c) 2018 PaddlePaddle 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 app... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_box_clip_op.py | Python | apache-2.0 | 2,286 |
#!/usr/bin/env python
"""
counts indicies (aka barcodes) from illumina fastq file
"""
import sys
import os
import time
import argparse
import glob
import collections
import ConfigParser
import shlex
import pipes
import subprocess
import tempfile
import re
import errno
import fileinput
import gzip
### Constants #######... | travc/ngs_scripts | count_illumina_indicies.py | Python | mit | 6,350 |
import asp.jit.asp_module as asp_module
import numpy as np
from em import *
import pickle
import sys
param_type_map = {
'num_blocks_estep': ('cardinal','variant'),
'num_threads_estep': ('cardinal','variant'),
'num_threads_mstep': ('cardinal','variant'),
'num_event_blocks': ('cardinal','... | hcook/gmm | tests/em_convert_from_pickle_dump_to_csv.py | Python | bsd-3-clause | 2,516 |
#! /usr/bin/env python
#------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# tailswitch
#------------------------------------------------------------------------------
from config.se... | knittledan/Location_Search_Prediction | server/core/solrSearch.py | Python | mit | 1,845 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | rl_repr/batch_rl/keras_utils.py | Python | apache-2.0 | 2,910 |
import falcon
# from main.settings import DB as db
# from main.helpers import QueryParser
import json
import urlparse
from werkzeug.http import parse_options_header
from werkzeug.formparser import parse_form_data
from cStringIO import StringIO
from werkzeug.wsgi import LimitedStream
from werkzeug import secure_filename... | vinaykrdahiya/justuploads | main/__init__.py | Python | unlicense | 2,292 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import codecs
import sys
import time
import os
sys.path.append(os.getcwd()+'/../../../')
sys.path.append(os.getcwd()+"/../")
from model.NumNer import NumRec
from model.CBGM import CBGM
from model.PlaceNer import Plac... | muyeby/NLP | Seg/CBGseg/test/seg.py | Python | mit | 3,396 |
# -*- coding: utf-8 -*-
'''
Created on 15 Φεβ 2013
@author: tedlaz
'''
from PyQt4 import QtCore, QtGui,Qt
from collections import OrderedDict
import utils_db as dbutils
import widgets
from utils_qt import fFindFromList
import osyk
#import classwizard_rc
sqlInsertFpr = u'''
INSERT INTO m12_fpr (epon... | tedlaz/pyted | misthodosia/m13a/f_newEmployeeWizard.py | Python | gpl-3.0 | 13,202 |
# coding=utf-8
# Copyright 2015 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)
import json
import o... | pombredanne/pants | src/python/pants/option/options_fingerprinter.py | Python | apache-2.0 | 4,437 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | pedrobaeza/odoo | openerp/osv/orm.py | Python | agpl-3.0 | 261,161 |
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# SLEPc - Scalable Library for Eigenvalue Problem Computations
# Copyright (c) 2002-2015, Universitat Politecnica de Valencia, Spain
#
# This file is part of SLEPc.
#
# SLEPc is free software: you can redistribute it and/or modify it u... | OpenCMISS-Dependencies/slepc | config/packages/blzpack.py | Python | lgpl-3.0 | 1,966 |
from src.platform.coldfusion.interfaces import AdminInterface
class FPrint(AdminInterface):
def __init__(self):
super(FPrint, self).__init__()
self.version = "6.1"
| GHubgenius/clusterd | src/platform/coldfusion/fingerprints/CF61.py | Python | mit | 187 |
from django.template.loader import render_to_string
from tasks.const import STATUS_SUCCESS
from .base import library
@library.register('coverage')
def coverage_violation(data):
"""Coverage violation parser
:param data: task data
:type data: dict
:returns: dict
"""
data['status'] = STATUS_SUCC... | nvbn/coviolations_web | violations/coverage.py | Python | mit | 1,087 |
#!/usr/env python
from pydimitri import *
from time import time
from math import pi
d = Dimitri()
t = time()
while (True):
d.receiveCurrAngles()
for joint in d.joints:
if joint:
print str(joint.servo_id) + (':%3.0f' % (joint.currAngle*180/pi)),
print time() - t
t = time()
| TauraBots/PyDimitri | show_values.py | Python | mit | 304 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
"""Generic logging, the way I rem... | mrrrgn/build-mozharness | mozharness/base/log.py | Python | mpl-2.0 | 14,897 |
"""OAuth 2.0 WSGI server middleware providing MyProxy certificates as access tokens
"""
__author__ = "W V Engen"
__date__ = "13/11/12"
__copyright__ = "(C) 2012 FOM / Nikhef"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "wvengen@nikhef.nl"
__revision__ = "$Id$"
import logging
from ConfigP... | TheLanguageArchive/ndg_oauth | ndg_oauth_server/ndg/oauth/server/lib/register/resource.py | Python | bsd-3-clause | 2,373 |
#!/usr/bin/env python3
import unittest
from unittest.mock import patch
import numpy as np
from tmc import points
from tmc.utils import load, get_out, patch_helper
module_name="src.subsetting_with_loc"
subsetting_with_loc = load(module_name, "subsetting_with_loc")
ph = patch_helper(module_name)
@points('p04-07.1')
... | mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part04-e07_subsetting_with_loc/test/test_subsetting_with_loc.py | Python | gpl-3.0 | 1,128 |
from collections import OrderedDict
import os
import sys
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
os.environ['is_test_suite'] = 'True'
import classifiers as classifier_tests
import regressors as regressor_tests
training_parameters = {
'model_names': ['GradientBoosting', 'XGB', 'DeepLear... | doordash/auto_ml | tests/automated_tests.py | Python | mit | 2,388 |
import gridfs
import pymongo
__author__ = 'abilgin'
class Database(object):
def __init__(self):
self.URI = "mongodb://host:port"
self.client = pymongo.MongoClient(self.URI)
self.db = self.client["dbname"]
self.fs = gridfs.GridFS(self.db)
def insert(self, collection, data):
... | aysenurbilgin/tilt_api | src/common/database.py | Python | apache-2.0 | 1,178 |
import csv
import argparse
import os.path
import schema
import itertools
from collections import defaultdict
from simplify_path import simplify_path
import sqlite3
class MbtaHeavyRail:
def __init__(self):
self.stop_ids = set()
def write_sql(self, cur, startorder, route_ids, as_route, gtfs_map):
... | noisecapella/bostonbusmap | tools/generate/mbta_heavy_rail.py | Python | gpl-3.0 | 3,999 |
from . import tree
class Node:
def __init__(self, container, parent, value=None):
self._node = tree.Node(container, parent, value)
@property
def _container(self):
return self._node._container
@property
def id(self):
return self._node.id
@property
def value(self):... | alviproject/alvi | alvi/client/containers/binary_tree.py | Python | mit | 2,017 |
"""The component for STIEBEL ELTRON heat pumps with ISGWeb Modbus module."""
from datetime import timedelta
import logging
from pystiebeleltron import pystiebeleltron
import voluptuous as vol
from homeassistant.components.modbus import (
CONF_HUB,
DEFAULT_HUB,
DOMAIN as MODBUS_DOMAIN,
)
from homeassistant... | leppa/home-assistant | homeassistant/components/stiebel_eltron/__init__.py | Python | apache-2.0 | 1,830 |
import sys
import urllib
import simplejson
import csv
reload(sys)
sys.setdefaultencoding('utf8')
googleGeocodeUrl = 'http://maps.googleapis.com/maps/api/geocode/json?'
csv_file = 'unhcr_popstats_export_demographics_all_data.csv'
def get_coordinates(query, from_sensor=False):
query = query.encode('utf-8')
i... | lepszy/nostradamIQ | tools/build_locationsrefugees.py | Python | gpl-3.0 | 3,687 |
import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="family", parent_name="pie.title.font", **kwargs):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/pie/title/font/_family.py | Python | mit | 595 |
"""bokepdo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | efenfauzi/tiptopgallery | bokepdo/urls.py | Python | gpl-3.0 | 2,623 |
import logging
import re
from typing import Union, Dict
from datetime import timedelta
from discord.ext.commands.converter import Converter
from redbot.core import commands
log = logging.getLogger("red.cogs.mutes")
# the following regex is slightly modified from Red
# it's changed to be slightly more strict on match... | palmtree5/Red-DiscordBot | redbot/cogs/mutes/converters.py | Python | gpl-3.0 | 1,983 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-11 08:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schedule', '0021_auto_20160302_1726'),
]
operations = [
migrations.AddField(
... | fenglb/mysite | schedule/migrations/0022_auto_20160311_1603.py | Python | cc0-1.0 | 860 |
def save_list(input_list, file_name='temp.txt'):
"""A list (input_list) is saved to a file (file_name)"""
with open(file_name, 'w') as fh:
print(*input_list, sep='\n', file=fh)
return None
| Serulab/Py4Bio | code/ch6/list2text2.py | Python | mit | 209 |
#!/usr/bin/python
# PBR Generated from u'console_scripts'
import sys
from nova.cmd.compute import main
if __name__ == "__main__":
sys.exit(main()) | silenceli/nova | nova/tests/test_compute.py | Python | apache-2.0 | 154 |
"""Imports:
sys: for console output
"""
import sys
def state(description):
"""Prints a description with no progress"""
sys.stdout.write("%s...\n" % (description))
def skip(description):
"""Prints a description as having been skipped"""
sys.stdout.write("%s... SKIPPED\n" % (description))
def repor... | jonsim/music_tagger | Progress.py | Python | gpl-3.0 | 850 |
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/logi... | bartscheers/banana | project/urls.py | Python | bsd-3-clause | 819 |
import urllib
import json
import datetime
import time
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.httpclient
from oauth import oauth # for twitter
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=i... | avinassh/learning-tornado | tornado-book/asynchronous_web_services/async_http/tweet_rate_async.py | Python | mit | 2,552 |
from django import forms
from rango.models import Page, Category
from rango.models import UserProfile
from django.contrib.auth.models import User
class CategoryForm(forms.ModelForm):
name = forms.CharField(max_length=128, help_text="Please enter the category name.")
views = forms.IntegerField(widget=forms.HiddenInpu... | Kentoseth/rangoapp | tango_with_django_project/rango/forms.py | Python | mit | 1,390 |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Steve English <steve.english@navetas.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | b0ttl3z/SickRage | lib/github/Organization.py | Python | gpl-3.0 | 29,379 |
from common.sagemaker_component import SageMakerJobStatus
from process.src.sagemaker_process_spec import SageMakerProcessSpec
from process.src.sagemaker_process_component import SageMakerProcessComponent
from tests.unit_tests.tests.process.test_process_spec import ProcessSpecTestCase
import unittest
import json
from u... | kubeflow/pipelines | components/aws/sagemaker/tests/unit_tests/tests/process/test_process_component.py | Python | apache-2.0 | 8,560 |
import os
from locust import HttpUser, TaskSet, task, between
from locust.clients import HttpSession
class MultipleHostsUser(HttpUser):
abstract = True
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.api_client = HttpSession(base_url=os.environ["API_HOST"])
clas... | mbeacom/locust | examples/multiple_hosts.py | Python | mit | 788 |
from django.contrib.auth.models import User
from tastypie import http
from tastypie import fields
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import Resource
from tastypie.bundle import Bundle
from haystack.query import SearchQuerySet
from agora_site.misc.utils import GenericForeign... | joanma100/agora-ciudadana | agora_site/agora_core/resources/search.py | Python | agpl-3.0 | 3,770 |
#!/usr/bin/env python
import mozhttpd
import mozfile
import os
import tempfile
import unittest
class TestBasic(unittest.TestCase):
""" Test basic Mozhttpd capabilites """
def test_basic(self):
""" Test mozhttpd can serve files """
tempdir = tempfile.mkdtemp()
# sizes is a dict of t... | vladikoff/fxa-mochitest | tests/mozbase/mozhttpd/tests/basic.py | Python | mpl-2.0 | 1,260 |
# -*- coding: utf-8 -*-
"""
gspread.client
~~~~~~~~~~~~~~
This module contains Client class responsible for communicating with
Google Data API.
"""
import re
import warnings
from xml.etree import ElementTree
from . import __version__
from . import urlencode
from .ns import _ns
from .httpsession import HTTPSession,... | amleczko/gspread | gspread/client.py | Python | mit | 11,658 |
from __future__ import absolute_import
from os.path import join, abspath, dirname
from .utils import gen_cookie_secret
PROJECT_ROOT = abspath(dirname(__file__))
APP_SETTINGS = dict(
template_path=join(PROJECT_ROOT, "templates"),
static_path=join(PROJECT_ROOT, "static"),
cookie_secret=gen_cookie_secret(... | kony-solutions/flower | flower/settings.py | Python | bsd-3-clause | 461 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ui_wallet_dlg_options1.ui
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import... | Bertrand256/dash-masternode-tool | src/ui/ui_wallet_dlg_options1.py | Python | mit | 3,432 |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | OSSystems/lava-server | dashboard_app/tests/models/attachment.py | Python | agpl-3.0 | 3,410 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import _env
import json
import re
import time
from lib._db import get_collection
from config.config import CONFIG
from judge_upload import exist_or_insert
DB = CONFIG.MONGO.DATABASE
PAT = re.compile('[-#\w]+')
def find_first_tag(s):
m = PAT.search(s)
return m.gr... | PegasusWang/articles | crawler/jb51/jb51_to_ghost.py | Python | mit | 5,080 |
# Created by Adam Streck, 2013-2015, adam.streck@fu-berlin.de
#
# This file is part of the Toolkit for Reverse Engineering of Molecular Pathways
# via Parameter Identification (TREMPPI)
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as pub... | xstreck1/TREMPPI | python/unfreeze.py | Python | gpl-3.0 | 1,852 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author: echel0n <sickrage.tv@gmail.com>
# URL: http://www.github.com/sickragetv/sickrage/
#
# 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 ... | mcus/SickRage | sickbeard/notifiers/nma.py | Python | gpl-3.0 | 3,311 |
####################################################################################################
#
# Musica - A Music Theory Package for Python
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | FabriceSalvaire/Musica | Musica/Figure/Keyboard.py | Python | gpl-3.0 | 16,175 |
#!/usr/bin/python
#
# Copyright (C) 2011, Nokia Corporation <ivan.frade@nokia.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 your option) any la... | slowfranklin/tracker | tests/functional-tests/600-applications-camera.py | Python | gpl-2.0 | 12,057 |
##########################################################################
#
# Copyright (c) 2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | hradec/cortex | test/IECore/ops/classParameterTest/classParameterTest-1.py | Python | bsd-3-clause | 2,272 |
# Generated by Django 2.0.1 on 2018-02-14 13:42
import versatileimagefield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0009_auto_20180123_1113'),
]
operations = [
migrations.AlterField(
model_name='product',
... | astrikov-d/dartcms | dartcms/apps/shop/migrations/0010_auto_20180214_1342.py | Python | mit | 1,727 |
#!/usr/bin/env python
'''Asterisk external test suite usage report
Copyright (C) 2016, Digium, Inc.
Scott Griepentrog <sgriepentrog@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import sys
import yaml
try:
from yaml import CSafeLoader as ... | asterisk/testsuite | usage.py | Python | gpl-2.0 | 3,716 |
from common.methods import set_progress
from resourcehandlers.aws.models import AWSHandler
import boto3
import time
def run(job, logger=None, **kwargs):
resource = kwargs.pop('resources').first()
selection_name = resource.name
region = resource.attributes.get(field__name='aws_region').value
rh_id = r... | CloudBoltSoftware/cloudbolt-forge | blueprints/aws_backup_selection/delete.py | Python | apache-2.0 | 1,504 |
#!/usr/bin/python
import zerorpc
import os
import re
class SpaceAPI(object):
def updateStatus(self, labOpen, topic):
# Clean up to avoid massive security hole, if firewall fails
labOpenCleaned = re.sub(r'[^a-zA-Z0-9]',' ', labOpen)
print "Set lab open " + str(labOpenCleaned) + " and topic " + topic
os.system("... | vranki/pajabot | spaceapi-server/spaceapi-server.py | Python | gpl-3.0 | 469 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import dataset
from importlib import import_module
from . import config
from . import helpers
# Module API
def cli(argv):
# Pre... | arthurSena/processors | processors/base/cli.py | Python | mit | 798 |
import typecat.font2img as f2i
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class FontBox(Gtk.FlowBoxChild):
def set_text(self, arg1):
if type(arg1) is str:
self.text = arg1
if type(arg1) is int:
self.font_size = arg1
try:
... | LordPharaoh/typecat | typecat/display/fontbox.py | Python | mit | 1,483 |
"""
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn i... | jmargeta/scikit-learn | examples/neighbors/plot_nearest_centroid.py | Python | bsd-3-clause | 1,783 |
"""Configure repos to ignore some attributes, overruling '.gitattributes'.
For non-interactive uses of Git repositories, it can be undesirable to allow
the 'ident string' and other attribute functionality as there are some
edge-cases that may require manual intervention.
Provide support for writing the repo-global '.... | kjedruczyk/phabricator-tools | py/phl/phlgitx_ignoreattributes.py | Python | apache-2.0 | 3,718 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class AccountAnalyticAccount(models.Model):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
company_uom... | t3dev/odoo | addons/hr_timesheet/models/analytic_account.py | Python | gpl-3.0 | 2,091 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAlsace(RPackage):
"""ALS for the Automatic Chemical Exploration of mixtures.
Alte... | iulian787/spack | var/spack/repos/builtin/packages/r-alsace/package.py | Python | lgpl-2.1 | 1,415 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create pipeline
#
leader = vtk.vtkLeaderActor2D()
leader.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
leader.GetPositionCoordinate().SetValue(0.1, 0.1... | hlzz/dotfiles | graphics/VTK-7.0.0/Rendering/Core/Testing/Python/TestLeaderActor2D.py | Python | bsd-3-clause | 2,074 |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | movmov/cc | vendor/tornado/demos/helloworld/helloworld.py | Python | apache-2.0 | 1,223 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Modules used for ETL - Create User
# Modules required:
import os
import xmlrpclib, sys, csv, ConfigParser
from openerp.tools.status_history import status
from datetime import datetime
# -----------------------------------------------------------------------------
# ... | Micronaet/micronaet-quality | quality/etl/import.py | Python | agpl-3.0 | 101,183 |
"""
benson.py
Main program to run benson on boot. To setup auto run on boot, from
terminal type 'crontab -e' to edit crontab, add this line to the end of
the file:
@reboot python3 /home/pi/Benson/benson.py &
To 'map' a module to the LED grid use to the module_map dictionary,
add a module name as a string value to a ... | wenbin5/Benson | benson.py | Python | mit | 9,393 |
# Developed for module tiericide, this script will quickly print out a market
# conversion map based on patch notes, as well as database conversion mapping.
import argparse
import os.path
import sqlite3
import sys
# Add eos root path to sys.path so we can import ourselves
path = os.path.dirname(str(__file__, sys.getf... | bsmr-eve/Pyfa | scripts/conversion.py | Python | gpl-3.0 | 23,244 |
###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/o... | jakirkham/lazyflow | lazyflow/operators/ioOperators/opStreamingHdf5Reader.py | Python | lgpl-3.0 | 5,866 |
"""--------------------------------------------------------------------
COPYRIGHT 2016 Stanley Innovation Inc.
Software License Agreement:
The software supplied herewith by Stanley Innovation Inc. (the "Company")
for its licensed SI Vector Platform is intended and supplied to you,
the Company's customer, for use so... | StanleyInnovation/vector_v1 | vector_common/vector_ros/src/vector/vector_teleop.py | Python | bsd-3-clause | 12,505 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
spike – a package manager running on top of git
Copyright © 2012, 2013, 2014 Mattias Andrée (maandree@member.fsf.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 S... | GNU-Pony/spike | src/spike.py | Python | gpl-3.0 | 70,096 |
#!/usr/bin/env python
'''
ctypesgencore.parser.ctypesparser contains a class, CtypesParser, which is a
subclass of ctypesgencore.parser.cparser.CParser. CtypesParser overrides the
handle_declaration() method of CParser. It turns the low-level type declarations
produced by CParser into CtypesType instances and breaks t... | AsherBond/MondocosmOS | grass_trunk/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py | Python | agpl-3.0 | 6,812 |
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Table(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "table"
_valid_props = {
"cells",
"columnorder",
"columnordersrc",
"column... | plotly/python-api | packages/python/plotly/plotly/graph_objs/_table.py | Python | mit | 36,304 |
# Copyright 2015 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/python/tools/strip_unused.py | Python | bsd-2-clause | 3,786 |
##################################################################
# Code for testing the variational Multi-Stage Generative Model. #
##################################################################
from __future__ import print_function, division
# basic python
import cPickle as pickle
from PIL import Image
import ... | capybaralet/Sequential-Generation | TestKruegerCode.py | Python | mit | 13,097 |
import pytest
import six
from mock import Mock
from thefuck import conf
from tests.utils import Rule
@pytest.mark.parametrize('enabled, rules, result', [
(True, conf.DEFAULT_RULES, True),
(False, conf.DEFAULT_RULES, False),
(False, conf.DEFAULT_RULES + ['test'], True)])
def test_default(enabled, rules, re... | bigplus/thefuck | tests/test_conf.py | Python | mit | 4,127 |
from setuptools import setup, find_packages
from os import path
import io
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with io.open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='modsec_tools',
version='0.2'... | zathras777/modsec_tools | setup.py | Python | unlicense | 1,026 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from haystack import conne... | celerityweb/django-haystack | test_haystack/solr_tests/test_admin.py | Python | bsd-3-clause | 2,888 |
import boto3
from datetime import datetime, timedelta
ec2 = boto3.client('ec2')
account_ids = ['12345']
def lambda_handler(event, context):
days = 7
delete_time = datetime.strftime(datetime.utcnow() - timedelta(days=days),'%Y-%m-%dT%H:%M:%S.000Z')
print 'Delete Snapshots Run Before %s' % delete_time
... | thigley986/Lambda-AWS-EC2-Snapshot-Management | LambdaEBSDeleteSnapshots.py | Python | apache-2.0 | 3,519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.