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 |
|---|---|---|---|---|---|---|
from django.apps import AppConfig
class CompetencesConfig(AppConfig):
name = 'competences'
verbose_name = "Компетенции"
| ITOO-UrFU/open-programs | open_programs/apps/competences/apps.py | Python | unlicense | 141 | 0 |
#!/usr/bin/env python3
import os
import sys
from tools import impl
parser = impl.argparser()
parser.add_argument("-o", dest="output", action=impl.StripQuotesAction)
(options, args) = parser.parse_known_args()
# ranlib may have hid the archive next to what buck thinks the archive is
input = args[-1] + ".secret"
... | facebook/buck | test/com/facebook/buck/cxx/testdata/cxx_toolchain/tools/linker.py | Python | apache-2.0 | 531 | 0 |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | tensorflow/graphics | tensorflow_graphics/projects/points_to_3Dobjects/utils/image.py | Python | apache-2.0 | 2,459 | 0.011793 |
"""
registration tool for cobbler.
Copyright 2009 Red Hat, Inc.
Michael DeHaan <mdehaan@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your optio... | remotesyssupport/cobbler-1 | koan/register.py | Python | gpl-2.0 | 6,100 | 0.008033 |
"""
Common Django settings for the project.
See the local, test, and production settings modules for the values used
in each environment.
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... | adjustive/caller | caller/settings/common.py | Python | gpl-3.0 | 4,021 | 0.002984 |
from browser import window, document as doc, console
import net
import sim
import json
CTX = None
"""
Bitwrap context
"""
CTL = None
"""
UI control interface
"""
def __onload(ctx):
""" use snap to begin creating an SVG """
global CTL
CTL = Editor()
window.jQuery('#net').on('click', CTL.on_insert)
... | stackdump/txbitwrap | txbitwrap/_brython/ctl.py | Python | mit | 7,943 | 0.001763 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... | harwee/electrum-xvg-tor | lib/wallet.py | Python | gpl-3.0 | 73,225 | 0.003086 |
{
'name' : 'Signature templates for user emails',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category' : 'Social Network',
'website' : 'https://yelizariev.github.io',
'depends' : ['base'],
'data':[
'res_users_signature_views.xml',
... | Antiun/yelizariev-addons | res_users_signature/__openerp__.py | Python | lgpl-3.0 | 443 | 0.015801 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 22 17:01:36 2019
@author: raf
"""
# IMPORT STUFF
from pdb import set_trace as stop
import copy
import numpy as np
from collections import OrderedDict
import string as st
import os
import pandas as pd
from vison.datamodel import cdp
from vison.supp... | ruymanengithub/vison | vison/metatests/chinj01.py | Python | gpl-3.0 | 34,380 | 0.006603 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# streamondemand 5
# Copyright 2015 tvalacarta@gmail.com
# http://www.mimediacenter.info/foro/viewforum.php?f=36
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# -... | orione7/plugin.video.streamondemand-pureita | core/scrapertools.py | Python | gpl-3.0 | 17,985 | 0.015934 |
"""
These are the Connection classes, relatively high level classes that handle
incoming or outgoing network connections.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
##############################################################################
LICE... | pagekite/PyPagekite | pagekite/proto/conns.py | Python | agpl-3.0 | 74,627 | 0.011457 |
"""
Tests for xblock_utils.py
"""
import uuid
import ddt
import six
from django.conf import settings
from django.test.client import RequestFactory
from mock import patch
from opaque_keys.edx.asides import AsideUsageKeyV1, AsideUsageKeyV2
from web_fragments.fragment import Fragment
from xblock.core import XBlockAside... | msegado/edx-platform | openedx/core/lib/tests/test_xblock_utils.py | Python | agpl-3.0 | 9,421 | 0.00138 |
# -*- coding: latin-1 -*-
"""Tests for cookielib.py."""
import cookielib
import os
import re
import time
from unittest import TestCase
from test import test_support
class DateTimeTests(TestCase):
def test_time2isoz(self):
from cookielib import time2isoz
base = 1019227000
... | ktan2020/legacy-automation | win/Lib/test/test_cookielib.py | Python | mit | 73,964 | 0.001731 |
from bs4 import BeautifulSoup
from requests import Session
from ..extensions import cache
# Settings
URL = 'http://emonitoring.poczta-polska.pl/wssClient.php'
# Init
SESSION = Session()
def get_number(real_number, s=None):
s = s or Session()
soup = BeautifulSoup(s.post(URL, data={'n': real_number}).text.enco... | ad-m/sledzenie_listow | sledzenie_listow/public/utils.py | Python | bsd-3-clause | 1,220 | 0.002459 |
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
class WeibopError(Exception):
"""Weibopy exception"""
def __init__(self, reason):
self.reason = reason.encode('utf-8')
def __str__(self):
return self.reason
| sunner/buzz2weibo | weibopy/error.py | Python | mit | 256 | 0.003906 |
# -*- coding: utf-8 -*-
#
# SymPy documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 22 19:34:32 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickle... | flacjacket/sympy | doc/src/conf.py | Python | bsd-3-clause | 6,093 | 0.005416 |
from __future__ import unicode_literals
from unittest import TestCase
from shutil import rmtree
from tempfile import mkdtemp
from os import makedirs
from os.path import join, exists, dirname
from awsfabrictasks.s3.api import dirlist_absfilenames
from awsfabrictasks.s3.api import localpath_to_s3path
from awsfabrictask... | espenak/awsfabrictasks | awsfabrictasks/tests/s3/test_api.py | Python | bsd-3-clause | 1,830 | 0.002186 |
## begin license ##
#
# "Meresco Harvester" consists of two subsystems, namely an OAI-harvester and
# a web-control panel.
# "Meresco Harvester" is originally called "Sahara" and was developed for
# SURFnet by:
# Seek You Too B.V. (CQ2) http://www.cq2.nl
#
# Copyright (C) 2006-2007 SURFnet B.V. http://www.surfnet.nl
# ... | seecr/meresco-harvester | test/throughputanalysertest.py | Python | gpl-2.0 | 6,185 | 0.011318 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2010 by drubin <drubin at smartcube.co.za>
#
# 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)... | qguv/config | weechat/plugins/python/confversion.py | Python | gpl-3.0 | 4,417 | 0.010414 |
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message... | nmercier/linux-cross-gcc | win32/bin/Lib/email/errors.py | Python | bsd-3-clause | 1,685 | 0.005341 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import... | bendykst/deluge | deluge/core/eventmanager.py | Python | gpl-3.0 | 2,071 | 0.001931 |
import io
import os
import shlex
import six
from ..utils import memoize
from ..conf import settings
class Generic(object):
def get_aliases(self):
return {}
def _expand_aliases(self, command_script):
aliases = self.get_aliases()
binary = command_script.split(' ')[0]
if binary i... | PLNech/thefuck | thefuck/shells/generic.py | Python | mit | 2,400 | 0.000417 |
###
# Copyright (c) 2005, Ali Afshar
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, a... | kg-bot/SupyBot | plugins/Gateway/gwcred.py | Python | gpl-3.0 | 5,416 | 0.003693 |
from setuptools import setup, find_packages
setup(
name="RaspberryRacer",
version="0.1",
description="Raspberry Racer",
author="Diez B. Roggisch",
author_email="deets@web.de",
entry_points= {
'console_scripts' : [
'rracer = rracer.main:main',
]},
install... | deets/raspberry-racer | python/setup.py | Python | mit | 559 | 0.014311 |
###############################################################################
# Insert
###############################################################################
# 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 ... | inbloom/legacy-projects | lri-middleware/ccss/insert.py | Python | apache-2.0 | 56,321 | 0.003196 |
#*******************************************************************************
# Copyright (c) 2015 IBM Corp.
#
# 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/li... | snowch/spark-cloudant | test/helpers/dataload.py | Python | apache-2.0 | 3,656 | 0.033643 |
# Copyright 2014 Red Hat, 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 a... | rahulunair/nova | nova/objects/network.py | Python | apache-2.0 | 9,406 | 0 |
# micro
# Copyright (C) 2021 micro contributors
#
# 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 Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program ... | noyainrain/micro | micro/error.py | Python | lgpl-3.0 | 1,216 | 0.007401 |
'''
Created on Jan 6, 2013
__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2013, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "elizabeth.flanagan@intel.com"
'''
from buildbot.steps.shell import Sh... | joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | Python | gpl-2.0 | 2,787 | 0.0061 |
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.replicated_map_message_type import *
REQUEST_TYPE = REPLICATEDMAP_REMOVEENTRYLISTENER
RESPO... | cangencer/hazelcast-python-client | hazelcast/protocol/codec/replicated_map_remove_entry_listener_codec.py | Python | apache-2.0 | 1,220 | 0.001639 |
from django.contrib import admin
from repository.models import Repository, RepositoryAccess, RepositoryStar, RepositoryFork
admin.site.register(Repository)
admin.site.register(RepositoryStar)
admin.site.register(RepositoryFork)
admin.site.register(RepositoryAccess)
| Djacket/djacket | core/backend/repository/admin.py | Python | mit | 269 | 0.003717 |
import sys
if sys.version > '3':
PY3 = True
else:
PY3 = False
from .uarm import UArm, UArmConnectException
from .config import ua_dir, home_dir
from .util import get_uarm
from .version import __version__
| uArm-Developer/pyuarm | pyuarm/__init__.py | Python | mit | 215 | 0.004651 |
import logging
from zentral.core.exceptions import ImproperlyConfigured
default_app_config = "zentral.core.compliance_checks.apps.ZentralComplianceChecksAppConfig"
logger = logging.getLogger("zentral.core.compliance_checks")
# compliance checks classes
compliance_check_classes = {}
def register_compliance_che... | zentralopensource/zentral | zentral/core/compliance_checks/__init__.py | Python | apache-2.0 | 1,092 | 0.001832 |
#!/usr/bin/env python
# encoding: utf-8
"""A ${VISUAL} placeholder that will use the text that was last visually
selected and insert it here. If there was no text visually selected, this will
be the empty string. """
import re
import textwrap
from UltiSnips import _vim
from UltiSnips.indent_util import IndentUtil
fr... | eduardomallmann/vim-and-bash | pythonx/UltiSnips/text_objects/_visual.py | Python | gpl-3.0 | 2,074 | 0.000965 |
version_info = (1, 4, 2)
__version__ = '.'.join(map(str, version_info))
| Vdragon/git-cola | qtpy/_version.py | Python | gpl-2.0 | 72 | 0 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | rosenvladimirov/addons | currency_rate_update_bg/services/currency_getter.py | Python | agpl-3.0 | 2,676 | 0.001121 |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Copyright (c) 2013-2019 The Mincoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.op... | xieta/mincoin | qa/rpc-tests/test_framework/mininode.py | Python | mit | 55,509 | 0.00191 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | okoye/spinnaker-monitoring | spinnaker-monitoring-daemon/spinnaker-monitoring/spectator_handlers.py | Python | apache-2.0 | 16,780 | 0.007867 |
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This program is distributed in the hope... | mysql/mysql-utilities | mysql-test/suite/replication/t/binlog_purge_ms.py | Python | gpl-2.0 | 4,696 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | google/mirandum | alerts/fanfunding/migrations/0003_auto_20160416_2023.py | Python | apache-2.0 | 2,470 | 0.002429 |
# Copyright 2011 the Melange 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 agreed to in wr... | rhyolight/nupic.son | app/soc/mapreduce/convert_student_info.py | Python | apache-2.0 | 1,918 | 0.008342 |
#!/usr/bin/python
from __future__ import print_function
from guild.actor import Actor, actor_method, process_method, late_bind
class Dog(Actor):
@actor_method # Input - triggered by data coming in
def woof(self):
print("Woof", self)
@process_method # Process - triggered each time it's run
... | sparkslabs/guild | examples/dogs_go_woof_actors.py | Python | apache-2.0 | 988 | 0.001012 |
import sys
from gnucash import *
from gnucash import _sw_app_utils
from gnucash import _sw_core_utils
from gnucash._sw_core_utils import gnc_prefs_is_extra_enabled, gnc_prefs_is_debugging_enabled
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk
import os
sys.path.append(os.pat... | muehlburger/gnucash | gnucash/python/init.py | Python | gpl-2.0 | 4,709 | 0.014865 |
# -*- coding:utf-8 -*-
import math
import web
import tx
def GetAdsPagination(assetid,page) :
html = ''
html = html + '<div name="pages" align="center">\n'
if assetid != None :
count = web.collection_ads.find({"asset":assetid}).count()
else :
count = web.collection_ads.find({"asset":{"$ne":"0"}}).count()
... | antchain/antchain.org | web/ads.py | Python | mit | 10,223 | 0.043138 |
'''Utility methods
'''
import logging
import os
import numpy as np
import torch
__author__ = 'R Devon Hjelm'
__author_email__ = 'erroneus@gmail.com'
logger = logging.getLogger('cortex.util')
try:
_, _columns = os.popen('stty size', 'r').read().split()
_columns = int(_columns)
except ValueError:
_colum... | rdevon/cortex | cortex/_lib/utils.py | Python | bsd-3-clause | 2,635 | 0 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Documents View
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | muk-it/muk_dms | muk_dms_view/controllers/__init__.py | Python | lgpl-3.0 | 1,019 | 0.003925 |
#!/usr/bin/env python
'''
ansible module for zabbix triggers
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix trigger ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | menren/openshift-ansible | roles/lib_zabbix/library/zbx_trigger.py | Python | apache-2.0 | 8,027 | 0.00436 |
import pandas as pd
from datetime import date, timedelta
import time
import numpy as np
import re
import psycopg2
import ConfigParser
import argparse
from sqlalchemy import create_engine
import random
import sql
parser = argparse.ArgumentParser()
parser.add_argument('-cf','--contract_file',help='Contract data file')
... | eredmiles/GeneralDataScienceToolsDSSG2015 | WorldBank2015/Code/data_pipeline_src/supplier_feature_gen.py | Python | mit | 24,730 | 0.016781 |
# coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
from openapi_client.api_client import ApiClient
from o... | cliffano/swaggy-jenkins | clients/python-experimental/generated/openapi_client/api/remote_access_api.py | Python | mit | 2,651 | 0.006413 |
# solve cliff-walking task with Q-Learning, very similar to SARSA
# original example problem from the book, introduction for reinforcement learning
# Author: Wenbin Li
# numeric backend
import pygame
from pygame.locals import *
import numpy as np
grid_size = 100
n_row = 4
n_col = 12
state = np.zeros((n_row * grid_siz... | wenbinli/rl | cliffWalk_QL.py | Python | mit | 6,866 | 0.026507 |
from mock import patch
from nose.tools import eq_
from test_utils import TestCase
from mozillians.funfacts.helpers import random_funfact
from mozillians.funfacts.tests import FunFactFactory
class HelperTests(TestCase):
@patch('mozillians.funfacts.helpers.FunFact.objects')
def test_helper_calls_random(self, ... | glogiotatidis/mozillians-new | mozillians/funfacts/tests/test_helpers.py | Python | bsd-3-clause | 563 | 0 |
z = len
u = x = y = r = 0
def v():
global u
if z(r) < 3:
if y < 1:
c, n = r
else:
n, c = r
s = 0
else:
l, c, n = r
s = l[x - 1] + l[x] + (l[x+1] if x == z(l) else 0)
u = s + {x : sum(c[x - 1:x+2] + n[x - 1:x + 2]) - c[x],
0 : n[0] ... | eeue56/code-golf | game-of-life/game_of_life.py | Python | bsd-3-clause | 957 | 0.018809 |
##############################################################################
#
# 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 Affero General Publ... | Jgarcia-IAS/Fidelizacion_odoo | openerp/addons/auth_ldap/users_ldap.py | Python | agpl-3.0 | 10,747 | 0.002885 |
# -*- coding: utf-8 -*-
#
# TSgettoolbox documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 10 23:11:56 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | timcera/tsgettoolbox | docs/conf.py | Python | bsd-3-clause | 8,064 | 0.001736 |
# -*- coding: utf-8 -*-
from typing import Optional, Text
from mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
from zerver.lib.webhooks.git import COMMITS_LIMIT
class GogsHookTests(WebhookTestCase):
STREAM_NAME = 'commits'
URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_k... | mahim97/zulip | zerver/webhooks/gogs/tests.py | Python | apache-2.0 | 7,893 | 0.003547 |
"""Tests for views of tracker application."""
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
from tracker.models import (Expenditure, Purse)
User = get_user_model()
class HomeTest(TestCase):
"""Test home view."""
def setUp(self):
... | orontee/porte-monnaie | site/tracker/tests/test_views.py | Python | gpl-3.0 | 19,399 | 0 |
###############################################################################
# Name: pike.py #
# Purpose: Define highlighting/syntax for Pike programming language #
# Author: Cody Precord <cprecord@editra.org> #
... | robmcmullen/peppy | editra.in/syntax/pike.py | Python | gpl-2.0 | 3,246 | 0.005237 |
# __init__.py: Yet Another Bayes Net library
# Contact: Jacob Schreiber ( jmschreiber91@gmail.com )
"""
For detailed documentation and examples, see the README.
"""
# Make our dependencies explicit so compiled Cython code won't segfault trying
# to load them.
import networkx, matplotlib.pyplot, scipy
import numpy as... | jmschrei/yabn | yabn/__init__.py | Python | mit | 1,279 | 0.009382 |
#####
import sys
import inspect
from pylons import config
import logging
import zkpylons.lib.helpers as h
from pylons import request, response, session, tmpl_context as c
from zkpylons.lib.helpers import redirect_to
from pylons.util import class_name_from_module_name
from zkpylons.model import meta
from pylons.control... | neillc/zookeepr | zkpylons/controllers/secret_hash.py | Python | gpl-2.0 | 4,319 | 0.005094 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import zipfile
DEV_DATA_PATH = os.path.join(
os.path.dirname(__file__),
'..',
'dev_data',
)
def data_path(*args):
"""
Returns a path to dev data
"""
return os.path.join(DEV_DATA_PATH, *args)
def words100k():
zip_... | kmike/DAWG-Python | tests/utils.py | Python | mit | 479 | 0.004175 |
#!/usr/bin/env python
""" genpyx.py - parse c declarations
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
version 0.xx
This is a module of mixin classes for ir.py .
Towards the end of ir.py our global class definitions
are remapped to point to the class definitions ... | omco/mpir | yasm/tools/python-yasm/pyxelator/genpyx.py | Python | lgpl-3.0 | 18,513 | 0.022471 |
import logging
from sevenbridges.meta.resource import Resource
from sevenbridges.meta.fields import HrefField, StringField
from sevenbridges.meta.transformer import Transform
logger = logging.getLogger(__name__)
class User(Resource):
"""
Central resource for managing users.
"""
_URL = {
'me'... | sbg/sevenbridges-python | sevenbridges/models/user.py | Python | apache-2.0 | 2,815 | 0 |
import apsw
import datetime
from playhouse.apsw_ext import *
from playhouse.tests.base import ModelTestCase
db = APSWDatabase(':memory:')
class BaseModel(Model):
class Meta:
database = db
class User(BaseModel):
username = CharField()
class Message(BaseModel):
user = ForeignKeyField(User)
m... | funkypawz/MakerRobot | peewee-master/playhouse/tests/test_apsw.py | Python | gpl-3.0 | 4,048 | 0.002223 |
from django.shortcuts import render_to_response, get_object_or_404
from django.http import JsonResponse, HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.views.decorators.csrf import csrf_exempt
from django.db.models import Avg
from django.db impor... | pulkitpahwa/smart-image-coordinates | smarter/base/views.py | Python | mit | 9,603 | 0.001041 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import httpretty
import json
import sure
from pyeqs import QuerySet, Filter
from pyeqs.dsl import Term, Sort, ScriptScore
from tests.helpers import homogeneous
@httpretty.activate
def test_create_queryset_with_host_string():
"""
Create a querys... | Yipit/pyeqs | tests/unit/test_connection.py | Python | mit | 4,100 | 0.002439 |
from django.contrib.sitemaps import Sitemap
from geonode.maps.models import Layer, Map
class LayerSitemap(Sitemap):
changefreq = "never"
priority = 0.5
def items(self):
return Layer.objects.all()
def lastmod(self, obj):
return obj.date
class MapSitemap(Sitemap):
changefreq = "nev... | cga-harvard/cga-worldmap | geonode/sitemap.py | Python | gpl-3.0 | 398 | 0.005025 |
# 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 | smu/parser/smu_atomic_input_verifier.py | Python | apache-2.0 | 2,945 | 0.006452 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import jsonfield.fields
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('travel_times', '0002_auto_20150717_1221'),
]
operatio... | lm-tools/situational | situational/apps/travel_report/migrations/0001_initial.py | Python | bsd-3-clause | 1,406 | 0.002845 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | dmlc/tvm | python/tvm/topi/math.py | Python | apache-2.0 | 15,214 | 0.000329 |
import docapi
import docbuilder
import testtools
g_trace = """\
lint-syntax.js:3:32 JSLintWarning: Unexpected trailing space.
lint-syntax.js:7:10 JSLintWarning: Redefinition of 'some_function' from line 2.
lint-syntax.js:8:16 JSLintWarning: Expected '{' and instead saw 'return'.
lint-syntax.js:9:2 JSLintWarnin... | opentext/storyteller | docplatform/distribution/py/pfdesigns/javascript/lint.py | Python | apache-2.0 | 1,390 | 0.010791 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ------------------------------------------------------------------------------
# Name: files.py
# Package: utl
# Project: utl
#
# Created: 10.10.13 11:37
# Copyright 2013-2016 © Constantin Roganov
# License: The MIT License
# ---------------------------------... | brake/python-utl | utl/files.py | Python | mit | 6,385 | 0.000783 |
#!/usr/bin/env python2.7
from bioblend.galaxy import GalaxyInstance
import requests
import datetime
import argparse
requests.packages.urllib3.disable_warnings()
def parse_args():
args = argparse.ArgumentParser(description="Rename history items using a tabular file." +"\n" +
"Ex... | ARTbio/tools-artbio | scripts/helper_scripts/rename_history_items/rename_hist_items.py | Python | mit | 2,334 | 0.008997 |
## @file
# Module to gather dependency information for ASKAP packages
#
# @copyright (c) 2006 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ASKAP ... | ATNF/askapsdp | Tools/Dev/rbuild/askapdev/rbuild/dependencies/dependency.py | Python | gpl-2.0 | 18,614 | 0.005104 |
import re
from django.conf import settings
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.geometry.backend import Geometry... | runekaagaard/django-contrib-locking | django/contrib/gis/db/backends/postgis/operations.py | Python | bsd-3-clause | 15,371 | 0.001106 |
# Copyright 2011 OpenStack Foundation
# Copyright 2011, Piston Cloud Computing, Inc.
# Copyright 2011 Nebula, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... | raildo/python-keystoneclient | python-keystoneclient-0.4.1.7.gdca1d42/keystoneclient/service_catalog.py | Python | apache-2.0 | 11,013 | 0 |
from django.test import override_settings
from incuna_test_utils.testcases.api_request import (
BaseAPIExampleTestCase, BaseAPIRequestTestCase,
)
from tests.factories import UserFactory
class APIRequestTestCase(BaseAPIRequestTestCase):
user_factory = UserFactory
def test_create_request_format(self):
... | incuna/incuna-test-utils | tests/testcases/test_api_request.py | Python | bsd-2-clause | 918 | 0 |
from django.shortcuts import render_to_response
from django.template import RequestContext
from apps.members.models import Member
def show_all_current_members(request):
members = Member.objects.filter(is_renegade=False).order_by('function', 'started_nsi_date')
return render_to_response(
'show_all_curr... | nsi-iff/nsi_site | apps/members/views.py | Python | mit | 1,044 | 0.003831 |
#!/usr/bin/env python
### <command interpreter="python">send_to_cgd.py
### $pipeline_output $endpoint $cgd_url $output $runid $barcodeid $qcversion
### </command>
### Galaxy wrapper for cgd_client.jar.
### CGD_CLIENT is hard coded, but this is not expected to move.
import argparse
import subprocess
from subproc... | jhl667/galaxy_tools | tools/jhl_tools/send_to_cgd.py | Python | apache-2.0 | 2,897 | 0.007249 |
"""
Module to parse a Lettvin Results File C array of vertex points (and distances) into an OBJ file format of vertex points.
arg1: the path to the results file. (File must exist)
arg2: the file extension of the output OBJ filename. (e.g. ".obj") Default is ".obj" (File must not exist)
Vertex ... | LightStage-Aber/LightStage-Repo | exp/Lettvin_Repulsion/helpers/parse_diffuse_results_to_obj_file.py | Python | apache-2.0 | 1,750 | 0.017714 |
#!/usr/bin/env python
# Copyright 2016 Red Hat, Inc.
#
# 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 program ... | leongold/lago | ovirtlago/reposetup.py | Python | gpl-2.0 | 7,082 | 0 |
#
# Copyright (C) 2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | M4rtinK/anaconda | tests/unit_tests/pyanaconda_tests/modules/boss/test_set_file_contexts_task.py | Python | gpl-2.0 | 2,587 | 0 |
import time
import pytest
@pytest.mark.moto
@pytest.mark.asyncio
async def test_list_queues(sqs_client, sqs_queue_url):
response = await sqs_client.list_queues()
pytest.aio.assert_status_code(response, 200)
assert sqs_queue_url in response['QueueUrls']
@pytest.mark.moto
@pytest.mark.asyncio
async def t... | aio-libs/aiobotocore | tests/test_sqs.py | Python | apache-2.0 | 2,198 | 0 |
#!/usr/bin/env python
import sys, logging, getpass, subprocess, os, json
# List of Heroku App ids to update
_heroku_app_ids = None
_HEROKU_APP_IDS_ENV_KEY = "HEROKU_APP_IDS"
def get_heroku_app_ids():
global _heroku_app_ids
# Lazy load
if _heroku_app_ids is None:
env = os.environ.get(_HEROKU_APP_ID... | AdmitHub/heroku-auto-ssl | hooks/heroku-auto-ssl/hook.py | Python | mit | 8,401 | 0.00488 |
# This file is part of MSMTools.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# MSMTools 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 Foundation, either ... | markovmodel/msmtools | msmtools/analysis/dense/decomposition.py | Python | lgpl-3.0 | 17,097 | 0.000643 |
'''
Created on Feb 3, 2012
@author: marat
'''
import string
from myvector import Vector
class XYZ_file:
'''
classdocs
'''
def __init__(self,name=None):
if name==None:
self.FileName = " "
self.NumAtom = 0
self.AtomName = []
self.AtomPos = []
... | rangsimanketkaew/NWChem | contrib/marat/python/XYZ_file.py | Python | mit | 2,936 | 0.012602 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | ypid-bot/check_mk | web/plugins/cron/user_sync.py | Python | gpl-2.0 | 1,544 | 0 |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v8/services/services/conversion_upload_service/client.py | Python | apache-2.0 | 25,206 | 0.001071 |
from __future__ import absolute_import
from django.contrib.auth.models import UserManager
from django.utils.timezone import now as timezone_now
from zerver.models import UserProfile, Recipient, Subscription, Realm, Stream
import base64
import ujson
import os
import string
from six.moves import range
from typing impor... | vabs22/zulip | zerver/lib/create_user.py | Python | apache-2.0 | 3,927 | 0.002546 |
import fnmatch
import glob
import os
import re
import tempfile
from gppylib import gplog
from gppylib.commands.base import WorkerPool, Command, REMOTE
from gppylib.commands.unix import Scp
from gppylib.db import dbconn
from gppylib.db.dbconn import execSQL
from gppylib.gparray import GpArray
from pygresql import pg
fro... | foyzur/gpdb | gpMgmt/bin/gppylib/operations/backup_utils.py | Python | apache-2.0 | 38,070 | 0.00633 |
# Copyright (C) 2014-2017 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY;... | EdDev/vdsm | lib/yajsonrpc/stompreactor.py | Python | gpl-2.0 | 22,060 | 0 |
# -*- coding: utf-8 -*-
"""Storage for ports. Set defaults here, then :py:mod:`fixtures.portset` will make overrides."""
import sys
from cfme.utils import clear_property_cache
from cfme.utils.log import logger
class Ports(object):
SSH = 22
DB = 5432
TOWER = 54322
logger = logger
@property
d... | Yadnyawalkya/integration_tests | cfme/utils/ports.py | Python | gpl-2.0 | 747 | 0.002677 |
import re
import Queue
class AbsAnalyst(object):
"""docstring for AbsAnalyst"""
LOGTIME_REGEXP = re.compile("(?P<log_time>\w{4}-\w{2}-\w{2} \w{2}:\w{2}:\w{2})")
def __init__(self):
raise NotImplemented
def isMatch(self, line):
raise NotImplemented
def doStatistic(self):
raise NotImplemented
def doAnal... | DrZhang/LogAnalyst | Analysts/AbsAnalyst.py | Python | lgpl-3.0 | 353 | 0.05949 |
# -*- coding: utf-8 -*-
##############################################################
# Module Writen For Odoo, Open Source Management Solution
#
# Copyright (c) 2011 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
# coded by: moylop260@vauxoo.com
##################... | open-synergy/runbot-addons | runbot_language/models/__init__.py | Python | agpl-3.0 | 433 | 0 |
#
# 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... | Acehaidrey/incubator-airflow | airflow/providers/amazon/aws/hooks/redshift.py | Python | apache-2.0 | 1,282 | 0.00078 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config.py | Python | mit | 2,366 | 0.001691 |
from .views import IndexView
from django.conf.urls import url
urlpatterns = [
url(r'^$', IndexView.as_view(), name='index'),
]
| alessandroHenrique/coinpricemonitor | dashboard/urls.py | Python | mit | 134 | 0 |
from pprint import pformat
import boto3
from clint.textui import indent, puts, prompt
def _get_instance_details(instance):
return {
'tags': instance.tags,
'launch_time': instance.launch_time.isoformat(),
'instance_type': instance.instance_type,
'state': instance.state,
'ke... | lchi/blimp | blimp/commands/terminate.py | Python | mit | 1,260 | 0.001587 |
#
# This file is part of Gruvi. Gruvi is free software available under the
# terms of the MIT license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a
# complete list.
from __future__ import a... | geertj/gruvi | tests/test_jsonrpc.py | Python | mit | 27,989 | 0.000322 |
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.rtyper.tool import rffi_platform as platform
from rpython.rtyper.lltypesystem import rffi, lltype
from hippy.tool.platform import get_gmake
import subprocess
import py
LIBDIR = py.path.local(__file__).join('..', 'lib', 'joaat/')
subproces... | xhava/hippyvm | hippy/module/hash/cjoaat.py | Python | mit | 1,324 | 0.001511 |
"""
By specifying the 'proxy' Meta attribute, model subclasses can specify that
they will take data directly from the table of their base class table rather
than using a new table of their own. This allows them to act as simple proxies,
providing a modified interface to the data from the base class.
"""
from django.db ... | denisenkom/django | tests/proxy_models/models.py | Python | bsd-3-clause | 4,379 | 0.005481 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.