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 |
|---|---|---|---|---|---|---|
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2017 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from lxml im... | petrjasek/superdesk-core | superdesk/etree.py | Python | agpl-3.0 | 5,846 | 0.002053 |
import sys
import unittest
from unittest.mock import MagicMock
from PyQt5 import QtGui, QtCore
from sas.qtgui.Plotting.PlotterData import Data1D
from sas.qtgui.Plotting.PlotterData import Data2D
from UnitTesting.TestUtils import WarningTestNotImplemented
from sasmodels import generate
from sasmodels import modelinf... | SasView/sasview | src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py | Python | bsd-3-clause | 11,524 | 0.003818 |
#!/usr/bin/env python3
#
# List HubSpot's free email domains.
from urllib.request import urlopen
# pip3 install --user beautifulsoup4
# https://www.crummy.com/software/BeautifulSoup/bs4/doc/#strings-and-stripped-strings
from bs4 import BeautifulSoup
URL = "https://knowledge.hubspot.com/articles/kcs_article/forms/wha... | szepeviktor/debian-server-tools | mail/mx-check/hubspot-free-email-domains.py | Python | mit | 772 | 0.002591 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for generating the version string for Astropy (or an affiliated
package) and the version.py module, which contains version info for the
package.
Within the generated astropy.version module, the `major`, `minor`, and `bugfix`
variables hold ... | larrybradley/astropy-helpers | astropy_helpers/version_helpers.py | Python | bsd-3-clause | 9,639 | 0 |
#!/usr/bin/env python
import numpy as np
# Create features for tagging a sequence.
def create_features(f, g, history):
tempf = []
tempa = []
tempm = []
for line in f:
if line != '\n':
idstr = line.split()[3]
if line == '\n':
templen = np.size(tempf,0)
... | tapomayukh/projects_in_python | classification/Classification_with_CRF/old_crfsuite_package/old code/feature_conversion.py | Python | mit | 5,099 | 0.016278 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | mohierf/mod-webui | module/plugins/eltdetail/eltdetail.py | Python | agpl-3.0 | 2,612 | 0.001149 |
'''
Run a variety of turbulent statistics on the full M33 cube.
This will use a TON of memory. Recommend running on a cluster.
File structure setup to work on cedar in scratch space.
Saves the outputs for later use
'''
from spectral_cube import SpectralCube
from astropy.io import fits
from os.path import join as o... | e-koch/VLA_Lband | 14B-088/HI/turbulence/M33_turbstats.py | Python | mit | 5,008 | 0.001198 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Report.url'
db.delete_column(u'issues_report', 'url')
... | akulakov/mangotrac | proj_issues/issues/migrations/0008_auto__del_field_report_url__add_field_report_columns__add_field_report.py | Python | mit | 11,960 | 0.007023 |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
VERSION = __import__('nomnom').get_version()
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Enviro... | storyandstructure/django-nomnom | setup.py | Python | mit | 1,453 | 0.002065 |
import numpy
from numina.array.bpm import process_bpm_median
def test_process_bpm():
data = numpy.zeros((10, 10), dtype='float32') + 3.0
mask = numpy.zeros((10, 10), dtype='int32')
mask[3,3] = 1
result1 = process_bpm_median(data, mask)
assert result1[3,3] == 3.0
result2, subs2 = process_... | guaix-ucm/numina | numina/array/tests/test_bpm.py | Python | gpl-3.0 | 1,012 | 0.007905 |
# Natural Language Toolkit: Models for first-order languages with lambda
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>,
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
#TODO:
#- fix tracing
#- fix iterator-based approach to existentials
"""
T... | Reagankm/KnockKnock | venv/lib/python3.4/site-packages/nltk/sem/evaluate.py | Python | gpl-2.0 | 25,345 | 0.004222 |
import unittest
from programy.config.file.factory import ConfigurationFactory
from programy.config.client.client import ClientConfiguration
class ConfigurationFactoryTests(unittest.TestCase):
def test_guess_format_from_filename(self):
config_format = ConfigurationFactory.guess_format_from_filename("file.... | dkamotsky/program-y | src/test/config/file/test_factory.py | Python | mit | 1,628 | 0.0043 |
import tornado.web
import tornado.gen
import json
import io
import logging
import motor
from bson.objectid import ObjectId
import mickey.userfetcher
from mickey.basehandler import BaseHandler
class AcceptMemberHandler(BaseHandler):
@tornado.web.asynchronous
@tornado.gen.coroutine
def post(self):
... | micjerry/groupservice | handlers/acceptmember.py | Python | apache-2.0 | 2,851 | 0.004911 |
import flask
mod = flask.Blueprint('api', __name__)
| erik/sketches | projects/700c/web/views/api.py | Python | agpl-3.0 | 54 | 0 |
# UDP code taken from < https://pymotw.com/2/socket/udp.html >
import socket, time, fcntl, struct
def udpBeacon():
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADD... | cornell-cup/cs-minibot | minibot/hardware/communication/UDP.py | Python | apache-2.0 | 1,145 | 0.012227 |
#!/usr/bin/env python3
import os
import sys
from xml.dom import minidom
# STRINGTABLE DIAG TOOL
# Author: KoffeinFlummi
# ---------------------
# Checks for missing translations and all that jazz.
def get_all_languages(projectpath):
""" Checks what languages exist in the repo. """
languages = []
for module i... | KoffeinFlummi/AGM | .devfiles/stringtablediag.py | Python | gpl-2.0 | 3,247 | 0.018479 |
#!/usr/bin/env python
#encoding=utf-8
from onefile import *
def two():
print "at two\n",
def second():
print "at second\n",
if __name__ == '__main__':
two()
#one()
#first()
| licongyu95/learning_python | core_python_programming/cap2/two.py | Python | unlicense | 180 | 0.05 |
import serial
port = "COM5"
baud = 19200
try:
ser = serial.Serial(port, baud, timeout=1)
ser.isOpen() # try to open port, if possible print message and proceed with 'while True:'
print ("port is opened!")
except IOError: # if port is already opened, close it and open it again and print message
... | YaguangZhang/EarsMeasurementCampaignCode | Trials/lib/Trial6_pySerial_Mod.py | Python | mit | 857 | 0.012835 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | moto-timo/robotframework | src/robot/utils/__init__.py | Python | apache-2.0 | 3,555 | 0.000281 |
"""
Check tracking functions for proper output.
"""
from django.core.management.base import BaseCommand
from hs_tracking.models import Variable
class Command(BaseCommand):
help = "check on tracking"
def add_arguments(self, parser):
parser.add_argument('--days', type=int, dest='days', default=31,
... | hydroshare/hydroshare | hs_tracking/management/commands/tracking_popular.py | Python | bsd-3-clause | 1,309 | 0.001528 |
# -*- coding: utf-8 -*-
import threading
import logging
import unittest
import gc
from stockviderApp.utils import retryLogger
from stockviderApp.sourceDA.symbols.referenceSymbolsDA import ReferenceSymbolsDA
from stockviderApp.localDA.symbols.dbReferenceSymbolsDA import DbReferenceSymbolsDA
from stockviderApp.sourc... | aberdah/Stockvider | stockvider/stockviderApp/dbManager.py | Python | mit | 33,602 | 0.01157 |
#!/usr/bin/env python
import os
import sys
import inspect
from functools import update_wrapper
import getpass
import copy
import click
import signals
from .config_reader import read_config
from .utils import version, dict_merge
from .defaults import DEFAULT_CONFIG
# add fixture feature to pocoo-click
def _make_comm... | finklabs/aws-deploy | botodeploy/tool.py | Python | mit | 3,485 | 0.000287 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'psycholagny/', views.psycholagny_zhihu_user, name="psycholagny_zhihu_user"),
url(r'followed_zhihu_user/add/', views.add_followed_zhihu_user, name="add_followed_zhihu_user"),
url(r'ajax_hidden_zhihu_user/', views.ajax_hidden_zhihu_us... | YangTe1/site_at_will | site_at_will/zhihu/urls.py | Python | gpl-3.0 | 470 | 0.010638 |
from __future__ import absolute_import
from __future__ import with_statement
import time
from logging import warning
import dramatis
class Interface(object):
"""provides actors with control over their runtime dynamics
A dramatis.Actor.Interface object provides actors that have mixed
in dramatis.Actor ac... | dramatis/dramatis | lib/dramatis/actor/interface.py | Python | mit | 4,979 | 0.011448 |
####################################################################################################
#
# PyOpenGLng - An OpenGL Python Wrapper with a High Level API.
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | FabriceSalvaire/PyOpenGLng | examples/high-level-api-demo/ShaderProgramesV3.py | Python | gpl-3.0 | 3,221 | 0.009935 |
import _plotly_utils.basevalidators
class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="uirevision", parent_name="bar", **kwargs):
super(UirevisionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/bar/_uirevision.py | Python | mit | 398 | 0 |
#! /usr/env/bin python3
def scrape_rates(filename):
dict_rate = {}
with open(filename) as f:
for line in f.readlines():
line = line.split("\t")
line[1] = line[1].replace("\n", "")
line[1] = line[1].replace(",", ".")
dict_rate[line[0]] = line[1]
ret... | diblaze/TDP002 | Old Exams/201510/Uppgift3.py | Python | mit | 1,026 | 0 |
"""
The MIT License (MIT)
Copyright (c) 2014 - 2015 Jos "Zarthus" Ahrens and contributors
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 rig... | Zarthus/Reconcile | modules/topic.py | Python | mit | 2,286 | 0.001312 |
#!/usr/bin/env python
#coding:utf-8
"""
Purpose: ccoin Modules Package
Author: xczh <christopher.winnie2012@gmail.com>
Copyright (c) 2015 xczh. All rights reserved.
""" | xczh/ccoin | modules/__init__.py | Python | apache-2.0 | 185 | 0.021622 |
from __future__ import (absolute_import, division, print_function)
import unittest
import platform
import numpy as np
from mantid.simpleapi import VesuvioThickness
from mantid.api import ITableWorkspace
class VesuvioThicknessTest(unittest.TestCase):
#----------------------------------Algorithm tests----------------... | dymkowsk/mantid | Framework/PythonInterface/test/python/plugins/algorithms/VesuvioThicknessTest.py | Python | gpl-3.0 | 3,285 | 0.005479 |
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import math, sys, re
from calibre.ebooks.lrf.fonts import get_font
from calibre.ebooks.lrf.pylrs.pylrs import TextBlock, Text, CR, Span, \
CharButton, Plot, Paragraph, \
... | jelly/calibre | src/calibre/ebooks/lrf/html/table.py | Python | gpl-3.0 | 13,980 | 0.001788 |
"""
Views for PubSite app.
"""
from django.conf import settings
from django.contrib.auth.views import (
PasswordResetView,
PasswordResetDoneView,
PasswordResetConfirmView,
PasswordResetCompleteView,
)
from django.shortcuts import render
import requests
import logging
logger = logging.getLogger(__name__... | sigmapi-gammaiota/sigmapi-web | sigmapiweb/apps/PubSite/views.py | Python | mit | 4,610 | 0.000651 |
from lxml import etree
import requests
import re
#coding utf-8
def getResource(word):
r = requests.get("http://www.dictionaryapi.com/api/v1/references/learners/xml/"+word+"?key=508b6e11-3920-41fe-a57a-d379deacf188")
return r.text[39:]
def isWord(entry,word):
g=re.compile(entry)
return re.fullmatch(word... | jzcxer/0Math | python/dictionary/Merriam_Webster_api.py | Python | gpl-3.0 | 987 | 0.020263 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
#... | MSeifert04/astropy | astropy/units/format/generic.py | Python | bsd-3-clause | 18,514 | 0.000162 |
import base64, re, traceback, os, string, subprocess
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.styles import Style
from poshc2.client.Alias import cs_alias, cs_replace
from poshc2.Colours im... | nettitude/PoshC2 | poshc2/client/command_handlers/SharpHandler.py | Python | bsd-3-clause | 21,566 | 0.002782 |
# problem12.py
import math
x = 0
z = 0
n = 1
i = True
while i != False:
z = n * (n + 1) / 2
x = 2
y = int(math.sqrt(z))
for k in range(2, y):
if z % k == 0:
x += 2
if x == 500:
i = False
n += 1
print(z)
| anpe9592/projectEuler | 11-20/problem12.py | Python | mit | 273 | 0.007326 |
import requests
from .route import Route
class UserRoute(Route):
def me(self):
"""
Return the currently authenticated user
:rtype: dict
"""
return self._get_json('user')
def user(self, id):
"""
Return the user with given id
:rtype: dict
... | caspervg/pylex | src/pylex/user.py | Python | mit | 1,830 | 0 |
from __future__ import print_function
import sys
import re
import string
#TODO:
# * fail if an unexpected state occurs
_verbose = False
_echo_file = False
class Game:
regex = re.compile(r'(.+)\s+\(c\)\s+([0-9]+)\s+(.+)')
def __init__(self, systems, romnames):
self.systems = systems
self.... | zach-morris/plugin.program.iarl | resources/lib/historydat_parser.py | Python | gpl-2.0 | 6,720 | 0.001637 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2016-2021 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the ... | chipaca/snapcraft | tests/unit/store/test_store_client.py | Python | gpl-3.0 | 63,982 | 0.000797 |
import unittest
from charlesbot.slack.slack_channel_joined import SlackChannelJoined
from charlesbot.slack.slack_channel_left import SlackChannelLeft
from charlesbot.slack.slack_group_joined import SlackGroupJoined
from charlesbot.slack.slack_group_left import SlackGroupLeft
from charlesbot.slack.slack_message import S... | marvinpinto/charlesbot | tests/slack/test_slack_base_object_children.py | Python | mit | 1,314 | 0 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/armor/shared_mass_reduction_kit_mk4.iff"
result.attr... | obi-two/Rebelion | data/scripts/templates/object/draft_schematic/space/armor/shared_mass_reduction_kit_mk4.py | Python | mit | 463 | 0.047516 |
from django.test import TestCase
from django.core.cache import cache as mcache
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from avocado.store.models import Scope, Perspective, Report
__all__ = ('ScopeTestCase', 'PerspectiveTestCase', 'ReportTestCase')
class ScopeTestCase(... | pombredanne/django-avocado | avocado/store/tests/models.py | Python | bsd-3-clause | 4,138 | 0.000483 |
# -*- coding: utf-8 -*-
def command():
return "stop-all-instance"
def init_argument(parser):
parser.add_argument("--farm-no", required=True)
def execute(requester, args):
farm_no = args.farm_no
parameters = {}
parameters["FarmNo"] = farm_no
return requester.execute("/StopAllInstance", param... | primecloud-controller-org/pcc-cli | src/pcc/api/instance/stop_all_instance.py | Python | apache-2.0 | 327 | 0.006116 |
from Bio import SeqIO
import sys, string
fasta_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.fa" # Input fasta file
result_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.filtered.fa" # Output f... | nsalomonis/AltAnalyze | import_scripts/filterFASTA.py | Python | apache-2.0 | 619 | 0.017771 |
import sublime
import sublime_plugin
import re
from xml.dom import minidom
try:
from Expression import expression
except ImportError as error:
sublime.error_message("Dependency import failed; please read readme for " +
"Method plugin for installation instructions; to disable this " +
"message remove this pl... | shagabutdinov/sublime-method | method.py | Python | mit | 6,962 | 0.020684 |
""" Copyright 2016-2017 ETH Zurich, Eirini Arvaniti and Manfred Claassen.
This module contains utility functions.
"""
import os
import errno
from collections import Counter
import numpy as np
import pandas as pd
import copy
from cellCnn.downsample import random_subsample, kmeans_subsample, outlier_subsample
from ce... | eiriniar/CellCnn | cellCnn/utils.py | Python | gpl-3.0 | 12,947 | 0.00363 |
import numpy as np
import pandas as pd
import datetime
class Tariffs :
def __init__(self, scheme_name, retail_tariff_data_path, duos_data_path, tuos_data_path, nuos_data_path, ui_tariff_data_path):
self.scheme_name = scheme_name
self.retail_tariff_data_path = retail_tariff_data_path
self.du... | lukasmarshall/embedded-network-model | tariffs.py | Python | mit | 22,618 | 0.014015 |
'''
* Created by Zhenia Syryanyy (Yevgen Syryanyy)
* e-mail: yuginboy@gmail.com
* License: this code is under GPL license
* Last modified: 2017-10-24
'''
import re
import os
class TargetAtom():
def __init__(self):
self.path_to_cfg_file = ''
self.atom_type = 'Mn'
self.number_of_target_atoms =... | yuginboy/from_GULP_to_FEFF | feff/libs/determine_numbers_of_target_atoms.py | Python | gpl-3.0 | 2,071 | 0.005311 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import story
from telemetry import page as page_module
from telemetry import value
from telemetry.value import skip... | Chilledheart/chromium | tools/telemetry/telemetry/value/skip_unittest.py | Python | bsd-3-clause | 1,626 | 0.004305 |
# -*- coding: iso-8859-1 -*-
# Text translations for Italiano (it).
# Automatically generated - DO NOT EDIT, edit it.po instead!
meta = {
'language': 'Italiano',
'maintainer': 'gian paolo ciceri <gp.ciceri@acm.org>',
'encoding': 'iso-8859-1',
'direction': 'ltr',
}
text = {
'''(last edited %(time)s by %(editor)s... | rtucker/sycamore | Sycamore/i18n/it.py | Python | gpl-2.0 | 19,046 | 0.026672 |
#-*-coding=utf8-*-
import asyncore, socket, time
import redisproto as rp
import threading
import traceback
import Queue,logging
logger = logging.getLogger("cf")
CONN_TIMEOUT = 15
class RedisClient(asyncore.dispatcher): redis_reply = ''# redis reply, bulk strings recv_size = 0
wflag = False
rflag = False # pre... | dilworm/pytest | redisinfo/redisclient.py | Python | gpl-2.0 | 5,692 | 0.008784 |
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... | etherkit/OpenBeacon2 | macos/venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-gadfly.py | Python | gpl-3.0 | 458 | 0 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | adviti/melange | thirdparty/google_appengine/google/storage/speckle/python/api/rdbms.py | Python | apache-2.0 | 22,582 | 0.00806 |
# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | yangleo/cloud-github | openstack_dashboard/enabled/_9001_developer.py | Python | apache-2.0 | 948 | 0 |
# Scraper for California's Second District Court of Appeal
# CourtID: calctapp_2nd
# Court Short Name: Cal. Ct. App.
from juriscraper.opinions.united_states.state import cal
class Site(cal.Site):
def __init__(self):
super(Site, self).__init__()
self.url = 'http://www.courtinfo.ca.gov/cgi-bin/opini... | brianwc/juriscraper | opinions/united_states/state/calctapp_2nd.py | Python | bsd-2-clause | 472 | 0.002119 |
# Copyright (C) 2011, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py | Python | bsd-3-clause | 17,896 | 0.003856 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | dimtruck/magnum | magnum/common/pythonk8sclient/swagger_client/models/v1_service_status.py | Python | apache-2.0 | 2,814 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-appengine-admin | samples/generated_samples/appengine_v1_generated_services_get_service_sync.py | Python | apache-2.0 | 1,416 | 0.000706 |
"""Parse arguments from command line and configuration files."""
import fnmatch
import os
import sys
import re
import logging
from argparse import ArgumentParser
from . import __version__
from .libs.inirama import Namespace
from .lint.extensions import LINTERS
#: A default checkers
DEFAULT_LINTERS = 'pycodestyle', '... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylama/pylama/config.py | Python | mit | 8,032 | 0 |
import os
import json
import logging
_DEFAULT_CONFIG_DIR = "config"
_DEFAULT_CONFIG_NAME = "config.json"
_DEFAULT_LOG_CONFIG_NAME = "default_log.json"
######################################################################################################
def load(path):
json_content = _load_json(path)
loggin... | dayaftereh/scripts | python/tcu/lib/config.py | Python | apache-2.0 | 3,690 | 0.002168 |
import os
import json
import pandas
import numpy
from IPython.display import HTML
from datetime import datetime
import pandas_highcharts.core
title_name = 'Tasks'
file_name = 'tasks.csv'
css_dt_name = '//cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css'
js_dt_name = '//cdn.datatables.net/1.10.12/js/jquery.data... | llby/tasks-for-notebook | tasks_for_notebook/tasks_for_notebook.py | Python | mit | 3,217 | 0.020827 |
"""TensorFlow ops for deep neural networks."""
# Copyright 2015-present The Scikit Flow 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.apac... | wchan/tensorflow | tensorflow/contrib/learn/python/learn/ops/dnn_ops.py | Python | apache-2.0 | 2,001 | 0 |
"""SCons.Script.SConscript
This module defines the Python API provided to SConscript and SConstruct
files.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software an... | ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib64/scons-2.1.0/SCons/Script/SConscript.py | Python | gpl-2.0 | 24,428 | 0.002702 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.SimpleCrypter import SimpleCrypter
class FiletramCom(SimpleCrypter):
__name = "FiletramCom"
__type = "crypter"
__version = "0.03"
__pattern = r'http://(?:www\.)?filetram\.com/[^/]+/.+'
__config = [("use_premium" , "bool", "Use prem... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/FiletramCom.py | Python | gpl-3.0 | 843 | 0.017794 |
from distutils.core import setup, Extension
import numpy
from Cython.Distutils import build_ext
setup(
name='MCores',
version='1.0',
cmdclass={'build_ext': build_ext},
ext_modules=[Extension("MCores",
sources=["kernelModesCluster.pyx"],
language="c++",
... | hhjiang/mcores | setup.py | Python | mit | 436 | 0 |
"""
Tools for sending email.
"""
import mimetypes
import os
import smtplib
import socket
import time
import random
from email import Charset, Encoders
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils i... | jamslevy/gsoc | app/django/core/mail.py | Python | apache-2.0 | 14,299 | 0.001818 |
# encoding: utf-8
"""
network.py
Created by Thomas Mangin on 2009-09-06.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import time
import random
import socket
import select
from struct import unpack
from exabgp.configuration.environment import environment
from exabgp.util.od import od
from exabgp.u... | PowerDNS/exabgp | lib/exabgp/reactor/network/connection.py | Python | bsd-3-clause | 7,221 | 0.041961 |
# Copyright (c) 2021 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 ap... | luotao1/Paddle | python/paddle/fluid/tests/unittests/tokenizer/__init__.py | Python | apache-2.0 | 613 | 0.004894 |
#!/usr/bin/env python
# vim: set expandtab shiftwidth=4:
# http://www.voip-info.org/wiki/view/asterisk+manager+events
import asterisk.manager
import sys,os,time
import simplejson as json
from stompy.simple import Client
import ConfigParser
from sqlobject import *
from handlers.command_handler_factory import CommandHan... | gryzz/uCall | utils/asterisk-connector/ami2stomp.py | Python | gpl-3.0 | 3,524 | 0.004824 |
import matplotlib.pyplot as plt
import numpy as np
""" Contains functions to facilitate simple ploting tasks """
def std_setup():
""" Adjusts matplotlib default settings"""
from cycler import cycler
plt.rc('image', cmap='viridis')
plt.rc('xtick', labelsize=14)
plt.rc('ytick', labelsize=14)
plt... | luizfelippesr/galmag | galmag/analysis/visualization.py | Python | gpl-3.0 | 8,599 | 0.021282 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | jtopjian/st2 | st2actions/tests/unit/test_notifier.py | Python | apache-2.0 | 4,699 | 0.003405 |
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django import forms
class UserRegistrationForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'email',)
| cscanlin/munger-builder | munger_builder/forms.py | Python | mit | 269 | 0.003717 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsComposerShape.
.. note:: 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.
"""
... | mhugent/Quantum-GIS | tests/src/python/test_qgscomposershapes.py | Python | gpl-2.0 | 3,326 | 0.00391 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | takeshineshiro/heat | heat/scaling/rolling_update.py | Python | apache-2.0 | 1,960 | 0 |
#!c:\users\fredqian\appdata\local\programs\python\python36-32\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'esptool==2.3.1','console_scripts','esptool.py'
__requires__ = 'esptool==2.3.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.ex... | xbed/Mixly_Arduino | mixly_arduino/mpBuild/common/esptool.py-script.py | Python | apache-2.0 | 442 | 0 |
import subprocess
import re
import os
from app import util
BLAME_NAME_REX = re.compile(r'\(([\w\s]+)\d{4}')
def git_path(path):
"""Returns the top-level git path."""
dir_ = path
if os.path.isfile(path):
dir_ = os.path.split(path)[0]
proc = subprocess.Popen(
['git', 'rev-parse', '--sh... | harveyr/thunderbox | app/lintblame/git.py | Python | mit | 2,301 | 0 |
"""
global params
"""
# url database
default_url_db = {"host": "127.0.0.1",
"port": 3306,
"username": "root",
"password": "",
"database": "liuxf",
"charset": "utf8",
"tablename": "url"}
# proxy database
default_proxy_db = {"host": ... | mavarick/spider-python | webspider/settings/default_params.py | Python | gpl-2.0 | 1,332 | 0.012763 |
try:
from collections import namedtuple, OrderedDict, deque, defaultdict
except ImportError:
try:
from ucollections import namedtuple, OrderedDict, deque
except ImportError:
from ucollections import namedtuple, OrderedDict
if "deque" not in globals():
from .deque import d... | dmazzella/uble | micropython-lib/collections/__init__.py | Python | mit | 401 | 0 |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
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 us... | LordDamionDevil/Lony | lib/discord/ext/commands/context.py | Python | gpl-3.0 | 4,638 | 0.001509 |
import chainer
import chainer.functions as F
import chainer.links as L
from chainer_mask_rcnn.models.mask_rcnn_resnet import _copy_persistent_chain
from chainer_mask_rcnn.models.resnet_extractor import _convert_bn_to_affine
from ..resnet import BuildingBlock
from ..resnet import ResNet101Extractor
from ..resnet impor... | start-jsk/jsk_apc | demos/instance_occlsegm/instance_occlsegm_lib/contrib/instance_occlsegm/models/fcn/fcn16s_resnet_occlusion.py | Python | bsd-3-clause | 3,904 | 0 |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Sylvain Afchain <sylvain.afchain@enovance.com>
#
# 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.apach... | shakamunyi/neutron-vrrp | neutron/tests/unit/services/metering/drivers/__init__.py | Python | apache-2.0 | 665 | 0 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | fengkaicnic/traffic | traffic/utils.py | Python | apache-2.0 | 44,222 | 0.000565 |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | zasdfgbnm/qutip | qutip/entropy.py | Python | bsd-3-clause | 10,172 | 0.000098 |
#pylint: disable=W0403,R0902,R0903,R0904,W0212
from __future__ import (absolute_import, division, print_function)
from HFIR_4Circle_Reduction import mpl2dgraphicsview
from PyQt4 import QtCore
import numpy as np
import os
class Detector2DView(mpl2dgraphicsview.Mpl2dGraphicsView):
"""
Customized 2D detector vie... | ScreamingUdder/mantid | scripts/HFIR_4Circle_Reduction/detector2dview.py | Python | gpl-3.0 | 14,100 | 0.002199 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from operator import attrgetter
import re
import openerp
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools import ustr
from openerp.tools.translate import _
from opene... | minhphung171093/GreenERP | openerp/addons/base/res/res_config.py | Python | gpl-3.0 | 31,737 | 0.003624 |
# -*- coding: utf8 -*-
"""Simple auth functions with access to the databases for use in the views.
:license: AGPL v3, see LICENSE for more details
:copyright: 2014-2021 Joe Doherty
"""
# Stdlib imports
from datetime import datetime
import re
# 3rd party imports
from flask import session
from pymongo.errors import D... | pjuu/pjuu | pjuu/auth/backend.py | Python | agpl-3.0 | 14,374 | 0 |
#!/usr/bin/env python3
#coding:utf8
# *** TROUBLESHOOTING ***
# 1) If you get the error "ImportError: No module named zope.interface" then add an empty __init__.py file to the PYTHONDIR/Lib/site-packages/zope directory
# 2) It is expected that you will have NSIS 3 NSIS from http://nsis.sourceforge.net installed.
imp... | alby128/syncplay | buildPy2exe.py | Python | apache-2.0 | 31,233 | 0.002964 |
#!/usr/bin/env python3
"""
The 8-Queens Problem as dynamic programming.
https://en.wikipedia.org/wiki/Eight_queens_puzzle
"""
class QueenSolver:
def __init__(self, numqueens, boardsize):
# Cast and validate
self.numqueens = int(numqueens)
self.boardsize = int(boardsize)
assert self... | jnez71/demos | methods/dynpro_queens.py | Python | mit | 2,894 | 0.00311 |
import numpy as np
import matplotlib.pyplot as plt
import pdb
import traces.sources as sources
import traces.transformations as tran
import traces.surfaces as surf
#Set up incident beam trace and determine sensitivity to beam
#impact location.
#Trace nominal geometry (function of incidence angle) and
#record location... | rallured/PyXFocus | examples/arcus/uvYaw.py | Python | mit | 3,901 | 0.026916 |
'''
gomsurveyplot.py: This program creates the sky heatmap plot from the GomSpace
survey data.
input: A CSV file containing the sky survey data generated by the survey
program provided by GomSpace.
output: A heatmap plot of the input data.
... | CQT-Alex/GSN-heatmap | gomsurveyplot.py | Python | gpl-3.0 | 10,155 | 0.015854 |
from distutils import log
from distutils.core import setup
from distutils.command.build import build
from distutils.command.install_scripts import install_scripts
import glob
import sys
from mikidown.config import __version__
class miki_build(build):
def run(self):
# Check the python version
try:
... | ckolumbus/mikidown | setup.py | Python | mit | 2,051 | 0.009751 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | lib/spack/spack/test/svn_fetch.py | Python | lgpl-2.1 | 3,319 | 0 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("form_designer", "__first__"), ("fluent_contents", "0001_initial")]
operations = [
migrations.CreateModel(
name="FormDesignerLink",
fields=[
(
... | django-fluent/django-fluent-contents | fluent_contents/plugins/formdesignerlink/migrations/0001_initial.py | Python | apache-2.0 | 1,286 | 0.000778 |
'''
test.backend.svrtools.crypto.__init__
'''
import unittest
from my.backend import Backend
# from my.backend.crypto import is_this_the_correct_dollhouse_password
from my.globals.exceptions import WrongDollhousePasswordError
from my.miscellany import random_alphanum_string
class Test_is_this_the_correct_dollhouse... | HugoMMRabson/fonsa | src/test/old/backend/svrtools/crypto/__init__.py | Python | gpl-3.0 | 2,949 | 0.00373 |
import configparser
import os
import click
class Config:
"""The config in this example only holds aliases."""
def __init__(self):
self.path = os.getcwd()
self.aliases = {}
def add_alias(self, alias, cmd):
self.aliases.update({alias: cmd})
def read_config(self, filename):
... | pallets/click | examples/aliases/aliases.py | Python | bsd-3-clause | 4,061 | 0.000492 |
"""
Sum of Integers
"""
import itertools
if __name__ == '__main__':
while True:
n, s = map(int, raw_input().split())
if n == 0 and s == 0:
break
result = 0
for a in itertools.combinations(xrange(10), n):
if sum(a) == s:
result += 1
p... | miyazaki-tm/aoj | Volume0/0030.py | Python | mit | 334 | 0 |
#!/usr/bin/env python
# coding: utf-8
from django.shortcuts import render
from table.views import FeedDataView
from app.tables import (
ModelTable, AjaxTable, AjaxSourceTable,
CalendarColumnTable, SequenceColumnTable,
LinkColumnTable, CheckboxColumnTable,
ButtonsExtensionTable
)
def base(request):
... | shymonk/django-datatable | example/app/views.py | Python | mit | 2,085 | 0.00048 |
# -*- coding: utf-8 -*-
# Copyright(C) 2008-2010 Romain Bignon
#
# 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 3 of the License.
#
# This program is distributed in the hope that it w... | jocelynj/weboob | weboob/backends/aum/pages/base.py | Python | gpl-3.0 | 4,096 | 0.002442 |
{% if cookiecutter.use_celery == "y" %}
from __future__ import absolute_import
import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETT... | kaidokert/cookiecutter-django | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py | Python | bsd-3-clause | 1,017 | 0.012783 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2021 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software... | forkbong/qutebrowser | qutebrowser/misc/sql.py | Python | gpl-3.0 | 16,139 | 0.000806 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.