text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# Copyright 2015 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... | pongem/python-bot-project | appengine/standard/conftest.py | Python | apache-2.0 | 1,150 | 0 |
#!/usr/bin/env python
# Copyright 2018 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 unpack_pak
import unittest
class UnpackPakTest(unittest.TestCase):
def testMapFileLine(self):
self.assertTrue(unpack_pak... | endlessm/chromium-browser | chrome/browser/resources/unpack_pak_test.py | Python | bsd-3-clause | 1,132 | 0.0053 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
extentSelector.py
---------------------
Date : December 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
*********... | bstroebl/QGIS | python/plugins/GdalTools/tools/extentSelector.py | Python | gpl-2.0 | 7,022 | 0.026915 |
import re
class rgxHandler:
# Taken from https://www.safaribooksonline.com/library/view/python-cookbook-2nd/0596007973/ch01s19.html
linetitles = ["product/productId: ", "product/title: ", "product/price: ", "review/userId: ", "review/profileName: ", "review/helpfulness: ", "review/score: ", "review/time: ", "... | quentinlautischer/291MiniProject2 | src/rgxHandler.py | Python | apache-2.0 | 3,349 | 0.01284 |
#!/Users/patron/Desktop/maps/django-project/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| abzaloid/maps | django-project/bin/django-admin.py | Python | mit | 161 | 0 |
# Copyright (c) 2013 - The pycangjie authors
#
# This file is part of pycangjie, the Python bindings to libcangjie.
#
# pycangjie 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 ... | Cangjians/pycangjie | tests/__init__.py | Python | lgpl-3.0 | 6,379 | 0.000314 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import xml.etree.ElementTree as ET
from pprint import pprint
filename = 'GeoLogger.gpx'
def main():
tree = ET.parse(filename)
root = tree.getroot()
pprint(root.tag)
pprint(root.attrib)
pprint(root.findtext('.'))
if __name__ == "__main__":
main()... | TheShellLand/pies | v3/Libraries/xml/xml-parse.py | Python | mit | 321 | 0 |
"""The tests for the Script component."""
# pylint: disable=protected-access
import asyncio
from contextlib import contextmanager
from datetime import timedelta
import logging
from unittest import mock
import pytest
import voluptuous as vol
# Otherwise can't test just this file (import order issue)
from homeassistant... | pschmitt/home-assistant | tests/helpers/test_script.py | Python | apache-2.0 | 46,540 | 0.000645 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | jainaman224/zenodo | zenodo/modules/deposit/minters.py | Python | gpl-2.0 | 2,471 | 0 |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | southpawtech/TACTIC-DEV | src/pyasm/biz/file.py | Python | epl-1.0 | 34,859 | 0.008721 |
# 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/.
from atmo.stats.models import Metric
def test_metrics_record(now, one_hour_ago):
Metric.record("metric-key-1")
... | mozilla/telemetry-analysis-service | tests/test_stats.py | Python | mpl-2.0 | 1,163 | 0.00086 |
#!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2012, Regents of the University of California
# All rights reserved.
import sys
from nbody_graph_search import *
#from collections impo... | lkostler/AME60649_project_final | moltemplate/moltemplate/src/nbody_by_type_lib.py | Python | bsd-3-clause | 18,422 | 0.0057 |
def generate_documentation():
print("generate_documentation Stub")
return True
| rorychatt/GPCook | gpcook/modules/documentation.py | Python | mit | 88 | 0 |
from django import forms
from django.core.exceptions import ValidationError
from projects.models import Project
class CreateProjectForm(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
self.user = user
super(CreateProjectForm, self).__init__(*args, **kwargs)
def clean_name(self):... | michel-cf/Propeller-WebIDE | projects/forms.py | Python | lgpl-3.0 | 1,061 | 0 |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from usuarios.models import Usuario
class Sistema(models.Model):
sigla = models.CharField(verbose_name=_('Sigla'), max_length=10)
nome = models.CharField(verbose_name=_('Nome Sistema'),
... | interlegis/atendimento | solicitacoes/models.py | Python | gpl-3.0 | 2,330 | 0 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.apps import apps
from ... | hrayr-artunyan/shuup | shuup/admin/views/select.py | Python | agpl-3.0 | 2,842 | 0.001407 |
from __future__ import division, print_function, absolute_import
import os
import logging
from datetime import datetime
from ..modules.patterns import Singleton
class SilenceableStreamHandler(logging.StreamHandler):
def __init__(self, *args, **kwargs):
super(SilenceableStreamHandler, self).__init__(*arg... | evenmarbles/mlpy | mlpy/tools/log.py | Python | mit | 9,057 | 0.001877 |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | talon-one/talon_one.py | talon_one/models/session.py | Python | mit | 5,860 | 0 |
from django.utils import timezone
t = timezone.get_current_timezone()
for s in Sleep.objects.all():
if timezone.is_aware(s.start_time): s.start_time = timezone.make_naive(s.start_time, t)
if timezone.is_aware(s.end_time): s.end_time = timezone.make_naive(s.end_time,t)
s.save()
| sleepers-anonymous/zscore | useful_scripts/timezones.py | Python | mit | 292 | 0.017123 |
import base64
import fnmatch
import glob
import json
import os
import re
import shutil
import stat
import subprocess
import urllib.parse
import warnings
from datetime import datetime, timedelta
from distutils.util import strtobool
from distutils.version import LooseVersion
from typing import Tuple, Any, Union, List, Di... | VirusTotal/content | Tests/Marketplace/marketplace_services.py | Python | mit | 150,166 | 0.004761 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'WildfireDisplayContent.content_type'
db.add_column('calfire_tracker_wildfiredisplaycontent',... | SCPR/firetracker | calfire_tracker/migrations/0027_auto__add_field_wildfiredisplaycontent_content_type.py | Python | gpl-2.0 | 11,098 | 0.007839 |
# 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 PyDistributed(PythonPackage):
"""Distributed scheduler for Dask"""
homepage = "https:... | rspavel/spack | var/spack/repos/builtin/packages/py-distributed/package.py | Python | lgpl-2.1 | 1,699 | 0.002943 |
# Copyright 2018 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... | hfp/tensorflow-xsmm | tensorflow/contrib/tensorrt/test/reshape_transpose_test.py | Python | apache-2.0 | 6,477 | 0.003705 |
import pytest
import sys
import logging
from sqlalchemy import create_engine
import zk.model.meta as zkmeta
import zkpylons.model.meta as pymeta
from zkpylons.config.routing import make_map
from paste.deploy import loadapp
from webtest import TestApp
from paste.fixture import Dummy_smtplib
from .fixtures import Co... | zookeepr/zookeepr | zkpylons/tests/functional/conftest.py | Python | gpl-2.0 | 3,543 | 0.007056 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
TRANSACTION_STATUS = (
('P', _('pending')),
('F', _('failed')),
('C', _('complete')),
)
class Transaction(models.Model):
user = models.ForeignKey(User, blank = True, null... | truevision/django_banklink | django_banklink/models.py | Python | bsd-3-clause | 1,291 | 0.035631 |
# coding=utf-8
''' tagsPlorer package entry point (C) 2021-2021 Arne Bachmann https://github.com/ArneBachmann/tagsplorer '''
from tagsplorer import tp
tp.Main().parse_and_run() | ArneBachmann/tagsplorer | tagsplorer/__main__.py | Python | mpl-2.0 | 183 | 0.010929 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-25 23:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('journal', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | diegojromerolopez/djanban | src/djanban/apps/journal/migrations/0002_auto_20160926_0155.py | Python | mit | 819 | 0.002442 |
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, UFactory, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc>
import os
from distutils.util import convert_path
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core ... | xArm-Developer/xArm-Python-SDK | setup.py | Python | bsd-3-clause | 1,795 | 0.000557 |
import json
import base64
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from ..views import register, agents
from ..models import Agent
class AgentTests(TestCase):
@classmethod
def setUpClass(cls):
print "\n%s" % __name__
def setUp... | frasern/ADL_LRS | lrs/tests/AgentTests.py | Python | apache-2.0 | 3,199 | 0.012504 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software 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, ... | gecos-team/gecosws-agent | gecosfirstlogin_lib/Window.py | Python | gpl-2.0 | 3,073 | 0.000651 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 emijrp
# 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 versio... | 15Mpedia/15Mpedia-scripts | completa-circulos-podemos.py | Python | gpl-3.0 | 4,844 | 0.020544 |
GnomeXzPackage ('atk', version_major = '2.16', version_minor = '0')
| BansheeMediaPlayer/bockbuild | packages/atk.py | Python | mit | 68 | 0.073529 |
# Copyright 2012 - 2013 Zarafa B.V.
#
# This program 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 Foundation with the following additional
# term according to sec. 7:
#
# According to sec. 7 of the ... | zarafagroupware/zarafa-zsm | tests/tests_authorization.py | Python | agpl-3.0 | 11,327 | 0.002472 |
class Solution(object):
def numIslands(self, grid):
"""
:type grid: List[List[str]]
:rtype: int
"""
count = 0
for r in range(len(grid)):
for c in range(len(grid[0])):
if grid[r][c] == "1":
self.clearIsland(grid, r, c)
... | Jspsun/LEETCodePractice | Python/NumberOfIslands.py | Python | mit | 834 | 0 |
import sys
from io import BytesIO
from whoops.httplib.http_server import HttpServer
from whoops import ioloop
class WSGIServer(HttpServer):
def __init__(self, ioloop, address):
super(WSGIServer, self).__init__(ioloop, address)
self.app = None
self.environ = None
self.result = Non... | jasonlvhit/whoops | whoops/wsgilib/wsgi_server.py | Python | mit | 3,279 | 0.00061 |
# (C) Datadog, Inc. 2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# std
import logging
from kazoo.client import KazooClient, NoNodeError
from utils.service_discovery.abstract_config_store import AbstractConfigStore, KeyNotFound
DEFAULT_ZK_HOST = '127.0.0.1'
DEFAULT_ZK_PORT = 2181
D... | takus/dd-agent | utils/service_discovery/zookeeper_config_store.py | Python | bsd-3-clause | 3,661 | 0.001639 |
from django.contrib import admin
from .models import SnmpDevice, SnmpDeviceMessage, PingHistory
# Register your models here.
class SnmpDeviceAdmin(admin.ModelAdmin):
fields = [
'name', 'hostname', 'status', 'ping_mode', 'ping_port',
'snmp_template', 'snmp_port', 'snmp_community', 'snmp_system_con... | MikaelSchultz/dofiloop-sentinel | sentinel/device/admin.py | Python | mit | 1,293 | 0.001547 |
"""
Benchmarks on the power iterations phase in randomized SVD.
We test on various synthetic and real datasets the effect of increasing
the number of power iterations in terms of quality of approximation
and running time. A number greater than 0 should help with noisy matrices,
which are characterized by a slow spectr... | manhhomienbienthuy/scikit-learn | benchmarks/bench_plot_randomized_svd.py | Python | bsd-3-clause | 17,938 | 0.000557 |
import pytest
CODEVERSION = '0.0.1'
NEW_CODEVERSION = '0.0.2'
@pytest.fixture()
def campaign():
from psiturk.models import Campaign
parameters = {
'codeversion': CODEVERSION,
'mode': 'sandbox',
'goal': 100,
'minutes_between_rounds': 1,
'assignments_per_round': 10,
... | NYUCCL/psiTurk | tests/test_tasks.py | Python | mit | 3,640 | 0.003571 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
from __future__ import absolute_import
import itertools
import os
import posixpath
import random
import tempfile
import unittest
import silenttestru... | facebookexperimental/eden | eden/scm/tests/test-treestate.py | Python | gpl-2.0 | 9,519 | 0 |
# -*- coding: utf-8 -*-
"""Module for running microtests on how well the extraction works -
this module is STANDALONE safe"""
import ConfigParser
import glob
import traceback
import codecs
import bibclassify_config as bconfig
import bibclassify_engine as engine
log = bconfig.get_logger("bibclassify.microtest")
de... | pombredanne/invenio-old | modules/bibclassify/lib/bibclassify_microtests.py | Python | gpl-2.0 | 7,289 | 0.005076 |
#/usr/bin/env python
# -#- coding: utf-8 -#-
#
# equity_master/common.py - equity master common classes
#
# standard copy right text
#
# Initial version: 2012-04-02
# Author: Amnon Janiv
"""
.. module:: equity_master/common
:synopsis: miscellaneous abstract classes and other core constructs
.. moduleauthor... | ajaniv/equitymaster | equity_master/common.py | Python | gpl-2.0 | 3,296 | 0.01426 |
import ast
import os
class Parser(object):
"""
Find all *.py files inside `repo_path` and parse its into ast nodes.
If file has syntax errors SyntaxError object will be returned except
ast node.
"""
def __init__(self, repo_path):
if not os.path.isabs(repo_path):
raise Val... | beni55/djangolint | project/lint/parsers.py | Python | isc | 1,186 | 0 |
# coding=UTF-8
# Copyright 2011 James O'Neill
#
# This file is part of Kapua.
#
# Kapua 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.... | hemebond/kapua | forms.py | Python | gpl-3.0 | 7,905 | 0.031883 |
import numpy as np
from morphsnakes import (morphological_chan_vese,
morphological_geodesic_active_contour,
inverse_gaussian_gradient,
circle_level_set, checkerboard_level_set)
from numpy.testing import assert_array_equal
import pytest
def ga... | pmneila/morphsnakes | test_morphsnakes.py | Python | bsd-3-clause | 5,724 | 0 |
#
# Martin Gracik <mgracik@redhat.com>
#
# Copyright 2009 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. This program is distributed in the hope that it
# will be use... | cgwalters/pykickstart | tests/commands/user.py | Python | gpl-2.0 | 4,536 | 0.005291 |
import time
DEFAULT_SLEEP_FACTOR = 0.8
class Loop(object):
class LoopInterruptException(Exception):
pass
def __init__(self, fps, timeshift=0, sleep_factor=DEFAULT_SLEEP_FACTOR):
"""
Sleep factor could be set to 1.0? as python 3.5 respects time better
"""
self.set_per... | calaldees/libs | python3/calaldees/loop.py | Python | gpl-3.0 | 2,814 | 0.002843 |
import os
import sys
from setuptools import setup, find_packages, Command
from commands import *
tests_require=['pytest-cov', 'pytest', 'testfixtures']
setup(
name=name,
version=read_version(),
description='A regex based file organizer',
long_description=open(os.path.join(base_dir, 'description.txt')... | chriscz/pySorter | setup.py | Python | gpl-3.0 | 1,350 | 0.001481 |
from lacuna.building import MyBuilding
class ssld(MyBuilding):
path = 'ssld'
def __init__( self, client, body_id:int = 0, building_id:int = 0 ):
super().__init__( client, body_id, building_id )
| tmtowtdi/MontyLacuna | lib/lacuna/buildings/boring/ssld.py | Python | mit | 213 | 0.032864 |
# -*- coding: utf-8 -*-
"""
Edit Toolbar middleware
"""
from cms.utils.conf import get_cms_setting
from cms.toolbar.toolbar import CMSToolbar
from cms.utils.i18n import force_language
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE
from menus.menu_pool import menu_pool
from django.http import HttpRes... | vstoykov/django-cms | cms/middleware/toolbar.py | Python | bsd-3-clause | 5,441 | 0.001838 |
"""
Gridsearch implementation
"""
from hops import hdfs, tensorboard, devices
from hops.experiment_impl.util import experiment_utils
from hops.experiment import Direction
import threading
import six
import time
import os
def _run(sc, train_fn, run_id, args_dict, direction=Direction.MAX, local_logdir=False, name="no... | hopshadoop/hops-util-py | hops/experiment_impl/parallel/grid_search.py | Python | apache-2.0 | 4,463 | 0.005602 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# TWX documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 27 15:07:02 2015.
#
# 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
# autoge... | datamachine/twx | docs/conf.py | Python | mit | 10,106 | 0.006333 |
#!/usr/bin/env python
from ..common import *
from .universal import *
__all__ = ['kakao_download']
def kakao_download(url, output_dir='.', info_only=False, **kwargs):
json_request_url = 'https://videofarm.daum.net/controller/api/closed/v1_2/IntegratedMovieData.json?vid={}'
# in this implementation playlis... | xyuanmu/you-get | src/you_get/extractors/kakao.py | Python | mit | 1,771 | 0.002823 |
#!/usr/bin/python
#
# Copyright 2014 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 b... | falbassini/googleads-dfa-reporting-samples | python/v2.0/download_floodlight_tag.py | Python | apache-2.0 | 1,952 | 0.004098 |
from flask import url_for
from tests import ZKWTestCase
from zkw.models import Sourdough, User
class SourdoughDetailsPageTests(ZKWTestCase):
def setUp(self):
super(SourdoughDetailsPageTests, self).setUp()
self.user_1 = User.get_by_email('user_1@example.com')
self.active_sd = Sourdough.q... | zgoda/zakwasy | tests/test_sddetails.py | Python | mit | 2,004 | 0.001996 |
import datetime
import uuid
from decimal import Decimal
from django.core import checks, exceptions, serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.forms import CharField, Form, widgets
from django.test.utils import isolate_apps
from django.utils.html import escape
from . import Pos... | uranusjr/django | tests/postgres_tests/test_json.py | Python | bsd-3-clause | 13,888 | 0.001368 |
# -*- coding:utf8 -*-
# File : progress.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 2/26/17
#
# This file is part of TensorArtist.
from tartist.core.utils.thirdparty import get_tqdm_defaults
import tqdm
import numpy as np
def enable_epoch_progress(trainer):
pbar = None
def epoch_... | vacancy/TensorArtist | tartist/plugins/trainer_enhancer/progress.py | Python | mit | 1,402 | 0.003566 |
from scipy.optimize import curve_fit
from numpy import log, isnan
class NotAModel(Exception):
pass
def chisq(self, result=None):
if result is None:
result = self.result
return ((self.data.cts(row=True)-result)**2/self.data.errors(row=True)**2).sum()
def cstat(self, result):
if result is No... | uperetz/AstroTools | fitter/_modeling.py | Python | apache-2.0 | 2,367 | 0.00338 |
#!/usr/bin/env python
import sys, argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', type=str, action='store', dest='input', default=None, help="Input file")
args = parser.parse_args()
stats = dict()
if args.input is None:
print "Error: No input fi... | merlin-lang/kulfi | experiments/testbed/results/plot/sort.py | Python | lgpl-3.0 | 989 | 0.005056 |
"""return a jumbled version of a string. eg, the lazy hamster is jumping becomes the lzay hmasetr si jmunipg
shuffles insides of words.
"""
import random
import string
#okay, so this will be the jmuble algorythim
#variables, passed
#string_to_jumble = "" #yeah
#jumble_mode = true # do u switch words of t... | Moth-Tolias/LetterBoy | backend/jumbles nontrobo/jumbles nontrobo.py | Python | gpl-3.0 | 4,226 | 0.018462 |
alist = ['Micheal', 'Franklin', 'Trevor']
for i in alist:
print "Happy birthday, " + i
| BedrockDev/Sunrin2017 | Software/Web Programming/Project07/exam_03.py | Python | mit | 91 | 0 |
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
import shutil
import time
import platform
class grpcConan(ConanFile):
name = "grpc"
version = "1.27.3"
description = "Google's RPC library and framework."
topics = ("conan", "grpc", "rpc")
url ... | google/orbit | third_party/conan/recipes/grpc/conanfile.py | Python | bsd-2-clause | 5,670 | 0.002822 |
#!/usr/bin/python3
import argparse
import collections
import json
import string
import sys
header_template = """
#ifndef ASPARSERATIONS_GENERATED_${class_name}_H_
#define ASPARSERATIONS_GENERATED_${class_name}_H_
#include <array>
#include <map>
#include <memory>
#include <set>
#include <utility>
#include <vector>
$h... | TheAspiringHacker/Asparserations | bootstrap/parser_gen.py | Python | mit | 13,102 | 0.004427 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
import unittest
test_records = frappe.get_test_records('Note')
class TestNote(unittest.TestCase):
pass
| indictranstech/omnitech-frappe | frappe/desk/doctype/note/test_note.py | Python | mit | 225 | 0.013333 |
# Copyright (C) 2013 Korei Klein <korei.klein1@gmail.com>
from calculus.enriched import formula, constructors, endofunctor
from calculus.basic import formula as basicFormula
from lib.common_symbols import leftSymbol, rightSymbol, relationSymbol, domainSymbol, inputSymbol, outputSymbol, functionPairsSymbol
from lib imp... | koreiklein/fantasia | lib/common_formulas.py | Python | gpl-2.0 | 3,977 | 0.023887 |
# Copyright 2019 The Magenta 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 ... | jesseengel/magenta | magenta/common/__init__.py | Python | apache-2.0 | 1,001 | 0 |
"""Unit-tests for `tree.visitors`
"""
from py2c import tree
from py2c.tree import visitors
from py2c.tests import Test, data_driven_test
from nose.tools import assert_equal
# TEST:: Add non-node fields
# =============================================================================
# Helper classes
# ==============... | pradyunsg/Py2C | py2c/tree/tests/test_visitors.py | Python | bsd-3-clause | 5,659 | 0.00053 |
from twilio.twiml.voice_response import VoiceResponse, Say, Sms
response = VoiceResponse()
response.say('Our store is located at 123 Easy St.')
response.sms('Store Location: 123 Easy St.')
print(response)
| TwilioDevEd/api-snippets | twiml/voice/sms/sms-2/sms-2.6.x.py | Python | mit | 207 | 0 |
#!/usr/bin/python
import ble
import uuids
OPCODE_RESET_EXPENDED=1
class HeartRateService(ble.Service):
uuid=uuids.heart_rate
class HeartRateControlPoint(ble.Characteristic):
uuid=uuids.heart_rate_control_point
def reset_expended(self):
opcode = OPCODE_RESET_EXPENDED
self.va... | markrages/ble | profiles/hrm_service.py | Python | mit | 1,438 | 0.013908 |
# coding: utf-8
"""Test that tokenizer exceptions and emoticons are handles correctly."""
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize('text', ["auf'm", "du's", "über'm", "wir's"])
def test_de_tokenizer_splits_contractions(de_tokenizer, text):
tokens = de_tokenizer(text)
a... | recognai/spaCy | spacy/tests/lang/de/test_exceptions.py | Python | mit | 1,230 | 0.000814 |
import asyncio
from mandelbrot.transport import *
class MockTransport(Transport):
def mock_create_item(self, path, item):
raise NotImplementedError()
@asyncio.coroutine
def create_item(self, path, item):
return self.mock_create_item(path, item)
def mock_replace_item(self, path, item... | msfrank/mandelbrot | test/mock_transport.py | Python | gpl-3.0 | 1,546 | 0.000647 |
from collections import OrderedDict
from datetime import datetime
from skylines.api import schemas
def test_user_schema(test_user):
""":type test_user: skylines.model.User"""
data, errors = schemas.user_schema.dump(test_user)
assert not errors
assert isinstance(data, OrderedDict)
assert data.ke... | kerel-fs/skylines | tests/api/schemas/user_test.py | Python | agpl-3.0 | 2,586 | 0.000773 |
"""Plot implied timescales vs lagtime
{{header}}
"""
# ? include "plot_header.template"
# ? from "plot_macros.template" import xdg_open with context
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
sns.set_style('ticks')
colors = sns.color_palette()
## Load
timescal... | msultan/msmbuilder | msmbuilder/project_templates/msm/timescales-plot.py | Python | lgpl-2.1 | 1,908 | 0.004193 |
# -*- coding: utf-8 -*-
"""
sphinx.directives
~~~~~~~~~~~~~~~~~
Handlers for additional ReST directives.
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
import re
import sys
import string
import posixpath
from os import path
from docutils import nodes
from docutils.parsers.rst import d... | creasyw/IMTAphy | documentation/doctools/tags/0.2/sphinx/directives.py | Python | gpl-2.0 | 31,058 | 0.002222 |
import json
import time
import jps
class MessageHolder(object):
def __init__(self):
self.saved_msg = []
def __call__(self, msg):
self.saved_msg.append(msg)
def test_pubsub_with_serialize_json():
holder = MessageHolder()
sub = jps.Subscriber('/serialize_hoge1', holder,
... | OTL/jps | test/test_serialize.py | Python | apache-2.0 | 697 | 0 |
from os import environ
from django.conf.urls import include, url
from django.conf import settings
from django.conf.urls.static import static
from .wooey_urls import *
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, doc... | wooey/django-djangui | wooey/conf/project_template/urls/user_urls.py | Python | bsd-3-clause | 353 | 0.005666 |
"""
Custom-written pure ruby meterpreter/reverse_http stager.
TODO: better randomization
Module built by @harmj0y
"""
from modules.common import helpers
class Payload:
def __init__(self):
# required options
self.description = "pure windows/meterpreter/reverse_http stager, no shellcode"
... | jorik041/Veil-Evasion | modules/payloads/ruby/meterpreter/rev_http.py | Python | gpl-3.0 | 2,371 | 0.012231 |
# -*- coding: utf-8 -*-
import os
# Author: Sam Erickson
# Date: 2/23/2016
#
# Program Description: This program gives the integer coefficients x,y to the
# equation ax+by=gcd(a,b) given by the extended Euclidean Algorithm.
def extendedEuclid(a, b):
"""
Preconditions - a and b are both positive integers.
... | NicovincX2/Python-3.5 | Algorithmique/Algorithme/Algorithme numérique/Algorithme d'Euclide étendu/extended_euclidean_algorithm.py | Python | gpl-3.0 | 1,258 | 0.00159 |
# -*- coding: utf-8 -*-
"""
Description:
Usage:
Author: YingzhiGou
Date: 21/08/2017
"""
from mtpy.gui.SmartMT.Components.FigureSetting import Font
from mtpy.gui.SmartMT.Components.PlotParameter import FrequencyTolerance, Rotation
from mtpy.gui.SmartMT.gui.plot_control_guis import PlotControlStrike
fr... | MTgeophysics/mtpy | mtpy/gui/SmartMT/visualization/strike.py | Python | gpl-3.0 | 3,575 | 0.003077 |
"""
BleachBit
Copyright (C) 2008-2020 Andrew Ziem
https://www.bleachbit.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This... | tstenner/bleachbit | windows/setup_py2exe.py | Python | gpl-3.0 | 20,767 | 0.000626 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | InakiZabala/odoomrp-wip | stock_packaging_info/__openerp__.py | Python | agpl-3.0 | 1,532 | 0 |
# pylint: disable=missing-module-docstring, missing-class-docstring
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hc_dpd', '0011_align_with_hc_20220301'),
]
operations = [
migrations.AlterField(
model_name='company',
... | studybuffalo/studybuffalo | study_buffalo/hc_dpd/migrations/0012_align_with_hc_20220301_2.py | Python | gpl-3.0 | 620 | 0 |
#!/usr/bin/env python3
# Copyright 2016 - 2021 Bas van Meerten and Wouter Franssen
# This file is part of ssNake.
#
# ssNake 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, o... | smeerten/ssnake | src/safeEval.py | Python | gpl-3.0 | 2,736 | 0.00402 |
#
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
from sqlparse import sql, tokens as T
from sqlparse.utils import offset, indent
class AlignedIndentFi... | andialbrecht/sqlparse | sqlparse/filters/aligned_indent.py | Python | bsd-3-clause | 5,110 | 0 |
#!/usr/bin/env python
"""
@package mi.dataset.parser.pco2a_a_dcl
@file marine-integrations/mi/dataset/parser/pco2a_a_dcl.py
@author Sung Ahn
@brief Parser for the pco2a_a_dcl dataset driver
This file contains code for the pco2a_a_dcl parser and code to produce data particles.
For instrument telemetered data, there is... | danmergens/mi-instrument | mi/dataset/parser/pco2a_a_dcl.py | Python | bsd-2-clause | 10,120 | 0.003063 |
#!/usr/bin/env python
# Written against python 3.3.1
# Matasano Problem 1
# Convert hex to base64
# Example hex: 49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d
# Example base64: SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t
import base64
impo... | reschly/cryptopals | prob1.py | Python | apache-2.0 | 3,439 | 0.018028 |
# encoding: utf-8
"""
Test suite for pptx.presentation module.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import pytest
from pptx.parts.coreprops import CorePropertiesPart
from pptx.parts.presentation import PresentationPart
from pptx.parts.slide import NotesMaste... | biggihs/python-pptx | tests/test_presentation.py | Python | mit | 8,885 | 0 |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/ebcli/lib/elbv2.py | Python | mit | 2,545 | 0.005108 |
#!/usr/bin/env python3
import sys
import os
import random
from snakemake.utils import read_job_properties
jobscript = sys.argv[1]
job_properties = read_job_properties(jobscript)
with open("qsub.log", "w") as log:
print(job_properties, file=log)
print(random.randint(1, 100))
os.system("sh {}".format(jobscript))
| gusevfe/snakemake | tests/test14/qsub.py | Python | mit | 319 | 0 |
#!/usr/bin/env python
import os, argparse, logging
from ts3observer.cli import CommandLineInterface as Cli
from ts3observer.gui import GraphicalUserInterface as Gui
from ts3observer.utils import path
from ts3observer.exc import CriticalException, ShutDownException, print_traceback, print_buginfo
class Dispatcher(obj... | HWDexperte/ts3observer | ts3observer.py | Python | mit | 2,869 | 0.004183 |
import logging
import requests
from fakturo.core import exceptions, utils
LOG = logging.getLogger(__name__)
class BaseClient(object):
def __init__(self, url=None):
url.rstrip('/')
self.url = url
self.requests = self.get_requests()
def get_requests(self, headers={}, args_hooks=[],... | billingstack/python-fakturo | fakturo/core/client.py | Python | apache-2.0 | 2,138 | 0.000468 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from rapidsms.utils.modules import try_import
from .forms import LocationForm
from .models import Location
def get_model(name):
"""
"""
for type in Location.subclasses():
if type._meta.module_name == name:
return type
raise Sta... | caktus/rapidsms | rapidsms/contrib/locations/utils.py | Python | bsd-3-clause | 1,402 | 0 |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_noop
from corehq import toggles
from corehq.apps.domain.views import DomainViewMixin, LoginAndDomainMixin
from corehq.apps.hqwebap... | SEL-Columbia/commcare-hq | corehq/apps/dashboard/views.py | Python | bsd-3-clause | 1,502 | 0.001997 |
'''Module for testing the tor client'''
import unittest
import os
import time
import socks
from murmeli import system
from murmeli.torclient import TorClient
from murmeli.message import ContactRequestMessage
class FakeMessageHandler(system.Component):
'''Handler for receiving messages from Tor'''
def __init_... | activityworkshop/Murmeli | test/test_torclient.py | Python | gpl-2.0 | 3,296 | 0.002124 |
"""
MIT License
Copyright (c) 2018 Claude SIMON (https://q37.info/s/rmnmqd49)
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
... | epeios-q37/epeios | tools/xdhq/wrappers/PYH/XDHqXML.py | Python | agpl-3.0 | 1,921 | 0.023425 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-23 02:11
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | chronossc/notes-app | notes/migrations/0001_initial.py | Python | mit | 993 | 0.002014 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Jakob Luettgau
#
# 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 l... | jakobluettgau/feo | tapesim/components/FileManager.py | Python | gpl-3.0 | 2,010 | 0.004478 |
#!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/yescoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' for... | thormuller/yescoin2 | share/qt/extract_strings_qt.py | Python | mit | 1,873 | 0.005873 |
#!/usr/bin/env python
import urllib
import sys
import os
##### totalannotation.py by DJ Barshis
##### This script takes an input fasta file of sequence names and sequences, and blast results files of blasts against
##### nr (parsed .txt with 1 hit per line) and swissprot and tremble (in -outfmt 7) uniprot databases
... | cuttlefishh/papers | vibrio-fischeri-transcriptomics/code/python/totalannotation_v1-1.py | Python | mit | 12,403 | 0.048859 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-07-03 08:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('organization_projects', '0087_auto_20190619_2052'),
]
operations = [
migrations.Alt... | Ircam-Web/mezzanine-organization | organization/projects/migrations/0088_auto_20190703_1035.py | Python | agpl-3.0 | 1,401 | 0.001428 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.