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 |
|---|---|---|---|---|---|---|
#
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
extra_dirs=['C:\\msys64', 'C:\\tools\\msys2', 'D:\\msys64', 'D:\\tools\\msys2']
... | ctuning/ck-env | soft/env.msys2/customize.py | Python | bsd-3-clause | 1,741 | 0.029868 |
#! /usr/bin/python
'''
@author: Alister Maguire
Given a counts file and a taxa file, condense
repeated genus' and their counts, and output
a file that maps genus names to their counts
for each experiment.
'''
import argparse
def is_number(s):
try:
float(s)
return True
except ValueError:
... | aowen87/PhyloViewer | src/condense.py | Python | gpl-3.0 | 3,122 | 0.012812 |
#!C:\Python27
# sslsa.py
# Structural Superimposition of Local Sequence Alignment
# A program which finds out whether a local sequence
# alignment of two protein sequences also implies structural
# similarity of the aligned parts
import os
import sys
import glob
from Bio.PDB import *
from Bio import pairwise2
from Bio.... | gungorbudak/sslsa | sslsa.py | Python | mit | 4,211 | 0.00095 |
import numpy
import pytest
import theano
class TestInputLayer:
@pytest.fixture
def layer(self):
from lasagne.layers.input import InputLayer
return InputLayer((3, 2))
def test_input_var(self, layer):
assert layer.input_var.ndim == 2
def test_get_output_shape(self, layer):
... | diogo149/Lasagne | lasagne/tests/layers/test_input.py | Python | mit | 1,255 | 0.001594 |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... | 4shadoww/usploit | lib/dns/rdtypes/ANY/HINFO.py | Python | mit | 2,266 | 0.000883 |
# Bonding Topology of heavy atoms. This is a dict of a dict of sets
topology = {'PRO': {'N': {'C-1', 'CA', 'CD'},
'CA': {'N', 'C', 'CB', 'HA'},
'HA': {'CA'},
'CB': {'CA', 'CG', 'HB2', 'HB3'},
'HB2': {'CB'},
'HB3': ... | jlorieau/mollib | mollib/core/topology.py | Python | gpl-3.0 | 14,201 | 0.000282 |
# -*- coding: utf-8 -*-
import socket
from string import strip
__author__ = 'Vinícius da Silveira Serafim <vinicius@serafim.eti.br>'
# endereço e porta do servidor para conexão
server_addr = ("127.0.0.1", 9000)
def main():
"""
Função principal.
"""
# (1) Criar socket cliente
client_socket = sock... | vsserafim/aula_sockets_echo | client_01.py | Python | gpl-2.0 | 1,291 | 0 |
from test_support import verify, verbose, TestFailed
from string import join
from random import random, randint
# SHIFT should match the value in longintrepr.h for best testing.
SHIFT = 15
BASE = 2 ** SHIFT
MASK = BASE - 1
# Max number of base BASE digits to use in test cases. Doubling
# this will at least quadruple... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.1/Lib/test/test_long.py | Python | mit | 8,805 | 0.003748 |
import cPickle, string, numpy, getopt, sys, random, time, re, pprint
import sys
import onlineldauser
import citydoc
import os
import subprocess
import MySQLdb
def main():
db=MySQLdb.Connect(host="localhost",
user="team06",
passwd="aiM7chah,d",
db="randomtrip... | huyilin/TopicLda | src/onlineuser.py | Python | gpl-3.0 | 1,278 | 0.021127 |
import MySQLdb
import csv
import cStringIO
import codecs
import pprint
from datetime import datetime
from decimal import *
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getre... | emCOMP/twitter-mysql | bin/simple_import.py | Python | bsd-3-clause | 6,719 | 0.01786 |
# Generated by Django 3.0.8 on 2020-07-11 03:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("places", "0007_auto_20200711_0104"),
]
operations = [
migrations.CreateModel(
name="Category",
fields=[
... | huangsam/chowist | places/migrations/0008_category.py | Python | mit | 852 | 0.001174 |
# -*- coding: utf-8 -*-
#
# OpenCraft -- tools to aid developing and hosting free software projects
# Copyright (C) 2015 OpenCraft <xavier@opencraft.com>
#
# 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 Soft... | omarkhan/opencraft | instance/tests/test_openstack.py | Python | agpl-3.0 | 3,877 | 0.00129 |
# This file is part of django-ca (https://github.com/mathiasertl/django-ca).
#
# django-ca 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... | mathiasertl/django-ca | ca/django_ca/tests/tests_extensions.py | Python | gpl-3.0 | 71,893 | 0.002406 |
from sympy.core.add import Add
from sympy.core.mul import Mul
from sympy.core.power import Pow
from sympy.core.function import Function
from sympy.core.symbol import Symbol, Wild
from sympy.core.basic import S, C, Atom, sympify
from sympy.core.numbers import Integer, Rational
from sympy.functions import exp, sin , co... | jbaayen/sympy | sympy/integrals/risch.py | Python | bsd-3-clause | 11,561 | 0.002681 |
# Copyright 2019 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 or agreed to in writing,... | google/personfinder | tests/views/test_admin_global_index.py | Python | apache-2.0 | 6,931 | 0.000289 |
from .. import TestCase
# NOTE: this test is not run by the tester because the name of this file
# does not match the testpattern regex in TestLoader.discover
class TestBar(TestCase):
def test_print(self):
self.assertTrue(3+4 > 2)
| thisch/python-falafel | examples/project2/mypackage/modb/bar.py | Python | bsd-2-clause | 246 | 0 |
from supervisorerrormiddleware import SupervisorErrorMiddleware
import os
import sys
import paste.fixture
class DummyOutput:
def __init__(self):
self._buffer = []
def write(self, data):
self._buffer.append(data)
def flush(self):
self._buffer = []
def bad_app(environ, start_respon... | socialplanning/SupervisorErrorMiddleware | supervisorerrormiddleware/tests/test.py | Python | gpl-2.0 | 2,244 | 0.008021 |
# coding=utf-8
# ---------------------------------------------------------------
# Desenvolvedor: Arannã Sousa Santos
# Mês: 12
# Ano: 2015
# Projeto: pagseguro_xml
# e-mail: asousas@live.com
# ---------------------------------------------------------------
from .test_de... | arannasousa/pagseguro_xml | pagseguro_xml/tests/test_classes_consultas/__init__.py | Python | gpl-2.0 | 490 | 0.002049 |
"""
class for storing static results of a tarjan ordering
"""
from scipy.sparse.csc import csc_matrix
from scipy.sparse.csr import csr_matrix
from scipy.sparse.linalg import inv, factorized, spsolve
from scipy.sparse import eye
from scipy.io import savemat, loadmat
import os
from collections import namedtuple
from .... | bkuczenski/lca-tools | antelope_background/background/flat_background.py | Python | gpl-2.0 | 18,042 | 0.001718 |
#!/usr/bin/env python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from... | runt18/osquery | tools/codegen/gentable.py | Python | bsd-3-clause | 11,592 | 0.001725 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| texastribune/tt_streams | example/manage.py | Python | apache-2.0 | 320 | 0 |
"""Handle processing and setting web content into Readability/cleaned
"""
import httplib
import logging
import lxml
import socket
import urllib2
from BaseHTTPServer import BaseHTTPRequestHandler as HTTPH
from breadability.readable import Article
from urlparse import urlparse
LOG = logging.getLogger(__name__)
class... | GreenLunar/Bookie | bookie/lib/readable.py | Python | agpl-3.0 | 6,558 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-01 08:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('API', '0002_auto_20170201_0840'),
]
operations = [
migrations.AddField(
... | rearmlkp/Smart_Flash | API/migrations/0003_auto_20170201_0842.py | Python | gpl-3.0 | 917 | 0 |
# Generated by Django 2.2.7 on 2019-12-02 02:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('terminal', '0017_auto_20191125_0931'),
]
operations = [
migrations.RemoveField(
model_name='session',
name='date_las... | skyoo/jumpserver | apps/terminal/migrations/0018_auto_20191202_1010.py | Python | gpl-2.0 | 2,294 | 0 |
# download images from last.fm
# PyQuery is a very powerful module to parse HTML pages, but it is not by default distributed with Python
# if you want install it you need first install lxml module
# Same features of this script works only with pyquery, but the most important ones (download images of cover and arti... | gialloporpora/yellowpy | lastfm.py | Python | gpl-2.0 | 4,732 | 0.042054 |
#!/bin/python
# gofed-ng - Golang system
# Copyright (C) 2016 Fridolin Pokorny, fpokorny@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 y... | gofed/gofed-ng | testsuite/helpers/utils.py | Python | gpl-3.0 | 1,073 | 0.001864 |
# -*- coding: utf-8 -*-
""" Module for converting various mesh formats."""
# Copyright (C) 2006 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN 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, e... | FEniCS/dolfin | site-packages/dolfin_utils/meshconvert/meshconvert.py | Python | lgpl-3.0 | 50,178 | 0.004604 |
""" Tests for Dynamo3 """
import sys
import unittest
from decimal import Decimal
from pickle import dumps, loads
from urllib.parse import urlparse
from botocore.exceptions import ClientError
from mock import ANY, MagicMock, patch
from dynamo3 import (
Binary,
Dynamizer,
DynamoDBConnection,
DynamoDBEr... | stevearc/dynamo3 | tests/__init__.py | Python | mit | 22,100 | 0.000271 |
from itertools import chain
import gzip
import multiprocessing
import time
import numpy as np
from enum import Enum
from uncertainties import unumpy
from io import BytesIO
from flask import abort
import pymongo
try:
import matplotlib
import matplotlib.figure
import matplotlib.pyplot
except ImportError:
... | bloer/bgexplorer | bgexplorer/modelviewer/evaldata.py | Python | bsd-2-clause | 20,163 | 0.000446 |
# -*- coding: utf-8 -*-
import socket
from paramiko import SSHClient, AutoAddPolicy, AuthenticationException
from bssh.utils import env
from bssh.auth import get_pkey
from bssh.logger import logger
def connect(
hostname=None,
port=22,
username=None,
password=None,
pkey=None,... | liwanggui/bssh | bssh/network.py | Python | lgpl-2.1 | 1,271 | 0 |
"""
Contains manager class and exceptions for operations for recording and retrieving
consumer history events.
"""
import datetime
import isodate
import pymongo
from pulp.common import dateutils
from pulp.server import config
from pulp.server.db.model.consumer import Consumer, ConsumerHistoryEvent
from pulp.server.ex... | ulif/pulp | server/pulp/server/managers/consumer/history.py | Python | gpl-2.0 | 7,603 | 0.002104 |
# 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 use ... | wrigri/libcloud | libcloud/common/openstack_identity.py | Python | apache-2.0 | 48,080 | 0.000021 |
# This is a helper for the win32trace module
# If imported from a normal Python program, it sets up sys.stdout and sys.stderr
# so output goes to the collector.
# If run from the command line, it creates a collector loop.
# Eg:
# C:>start win32traceutil.py (or python.exe win32traceutil.py)
# will start a process wit... | leighpauls/k2cro4 | third_party/python_26/Lib/site-packages/win32/lib/win32traceutil.py | Python | bsd-3-clause | 1,423 | 0.021082 |
from pymongo import MongoClient
from dalmongo import configuration
# get the instance of MongoDB client
client = MongoClient(configuration.MONGODB_HOST, configuration.MONGODB_PORT)
# get the main application database
db = getattr(client, configuration.MONGODB_NAME) | RobertoPrevato/flask-three-template | dalmongo/__init__.py | Python | mit | 267 | 0.003745 |
#!/usr/bin/env python
"""
Lookup and Store Tweets utility.
Lookup tweets on Twitter by the GUID and then stores the profile and tweet
data in the local db.
TODO: Use the system category and campaign as set in app.conf file.
"""
import argparse
import os
import sys
# Allow imports to be done when executing this file ... | MichaelCurrin/twitterverse | app/utils/insert/lookup_and_store_tweets.py | Python | mit | 1,724 | 0.00174 |
"""Sensor platform for nodered."""
import json
import logging
import voluptuous as vol
from homeassistant.components.websocket_api import event_message
from homeassistant.const import (
CONF_ENTITY_ID,
CONF_ICON,
CONF_ID,
CONF_STATE,
CONF_TYPE,
EVENT_STATE_CHANGED,
)
from homeassistant.core im... | shortbloke/home_assistant_config | custom_components/nodered/switch.py | Python | mit | 7,962 | 0.001005 |
def extractSpearpointtranslationsHomeBlog(item):
'''
Parser for 'spearpointtranslations.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Record of the Missing Sect Master', 'Reco... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractSpearpointtranslationsHomeBlog.py | Python | bsd-3-clause | 692 | 0.027457 |
"""Setup script for NodeTrie"""
from setuptools import setup, find_packages, Extension
import versioneer
try:
from Cython.Build import cythonize
except ImportError:
USING_CYTHON = False
else:
USING_CYTHON = True
ext = 'pyx' if USING_CYTHON else 'c'
extensions = [Extension("nodetrie.nodetrie",
... | NodeTrie/NodeTrie_Py | setup.py | Python | lgpl-2.1 | 2,127 | 0.004701 |
import abc
import unittest
class FinderTests(metaclass=abc.ABCMeta):
"""Basic tests for a finder to pass."""
@abc.abstractmethod
def test_module(self):
# Test importing a top-level module.
pass
@abc.abstractmethod
def test_package(self):
# Test importing a... | Orav/kbengine | kbe/src/lib/python/Lib/test/test_importlib/abc.py | Python | lgpl-3.0 | 2,382 | 0 |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 31 16:04:18 2017
@author: adelpret
"""
import pinocchio as se3
import numpy as np
from pinocchio import RobotWrapper
from conversion_utils import config_sot_to_urdf, joints_sot_to_urdf, velocity_sot_to_urdf
from dynamic_graph.sot.torque_control.inverse_dynamics_balance_c... | proyan/sot-torque-control | unitTesting/unit_test_inverse_dynamics_balance_controller.py | Python | gpl-3.0 | 6,246 | 0.018092 |
from sqlalchemy.orm import create_session, relationship, mapper, \
contains_eager, joinedload, subqueryload, subqueryload_all,\
Session, aliased, with_polymorphic
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.engine import default
from sqlalchemy.testing import AssertsCompiledSQL, fixture... | michaelBenin/sqlalchemy | test/orm/inheritance/test_relationship.py | Python | mit | 53,676 | 0.007564 |
# Copyright (C) 2009 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 f... | danialbehzadi/Nokia-RM-1013-2.0.0.11 | webkit/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py | Python | gpl-3.0 | 22,259 | 0.002965 |
# -*- coding: utf-8 -*-
from nose.tools import raises
from openfisca_core import periods
from openfisca_core.columns import IntCol
from openfisca_core.formulas import CycleError, SimpleFormulaColumn
from openfisca_core.tests import dummy_country
from openfisca_core.tests.dummy_country import Individus, reference_for... | adrienpacifico/openfisca-core | openfisca_core/tests/test_cycles.py | Python | agpl-3.0 | 5,495 | 0.008735 |
from autopush.tests import setUp, tearDown
def pytest_configure(config):
"""Called before testing begins"""
setUp()
def pytest_unconfigure(config):
"""Called after all tests run and warnings displayed"""
tearDown()
| mozilla-services/autopush | autopush/tests/conftest.py | Python | mpl-2.0 | 235 | 0 |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
from __future__ import unicode_literals
import functools... | bobcyw/django | django/core/urlresolvers.py | Python | bsd-3-clause | 26,463 | 0.001474 |
#
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
#
"""JavaScript 1.7 keywords"""
keywords = set([
"break",
"case", "catch", "const", "continue",
"debugger", "default", "delete", "do",
"else",
"false", "finally", "for", "function",
"if", "in", "instanceof",
"let",
"new",... | zynga/jasy | jasy/js/tokenize/Lang.py | Python | mit | 458 | 0 |
# -*- coding: utf-8 -*-
import os
from codecs import encode, decode
import re
LINUX_ROOT = u"/"
def trim_quote(text):
if len(text) > 2 and text[0] == '"' and text[-1] == '"':
text = text[1:-1]
return text
def to_unicode(text, encoding="utf8"):
if type(text) == unicode:
return text
... | Gateswong/GatesMusicPet | music_pet/utils.py | Python | mit | 4,849 | 0.000825 |
#!/usr/bin/python
# compute new sensitivity from formulae in manual
import math
print "Tilt Sensitivity Calculator"
print "X1 refers to the tilt measurement, in arc sec"
print "R0/R1 refer to the gravimeter readings, in mGal"
print "Get the current tilt sensitivity from data files or the Setup menu"
oldSens = float(ra... | inkenbrandt/Earth_Tides | Micrograv/util/tilt_sens.py | Python | gpl-2.0 | 593 | 0.006745 |
# -*- coding: utf-8 -*-
import logging
import pickle
import re
from cacheops import invalidate_model
from django import http
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import redirect, render
from ..attendance import ge... | jacobajit/ion | intranet/apps/eighth/views/admin/blocks.py | Python | gpl-2.0 | 5,960 | 0.002349 |
import os
import numpy as np
import MMTK
class Grid:
"""
Class to read and write alchemical grids.
Data is a dictionary with
spacing - the grid spacing, in Angstroms.
counts - the number of points in each dimension.
vals - the values.
All are numpy arrays.
"""
def __init__(self):
pass
def r... | luizcieslak/AlGDock | AlGDock/IO.py | Python | mit | 14,740 | 0.021574 |
import extendedHand
from extendedHand import *
import math
from math import *
'''
Function that calculates the @percent % of @whole
'''
def percentage(whole, percent):
return (whole * percent) / 100.0
'''
Function that detects the run gesture.
@hand: the hand that we're analysing.
@tolerance: the percentage of toler... | LuisSuall/Sleight_of_hand | Finger_run/utils/gesture.py | Python | gpl-2.0 | 2,182 | 0.024748 |
# Import Functions
import urllib2
import xml.etree.ElementTree as ET
# Get online XML file
url="https://cghub.ucsc.edu/cghub/metadata/analysisDetail/a8f16339-4802-440c-81b6-d7a6635e604b"
request=urllib2.Request(url, headers={"Accept" : "application/xml"})
u=urllib2.urlopen(request)
tree=ET.parse(u)
root=tree.getroot... | minesh1291/Learning-Python | solutions/parse-xml.py | Python | apache-2.0 | 508 | 0.033465 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | tkelman/utf8rewind | tools/gyp/pylib/gyp/mac_tool.py | Python | mit | 26,881 | 0.007366 |
## Burglary example [Figure 14.2]
from probability import BayesNet
T, F = True, False
gym = BayesNet([
#WorkOuts
('LegDay', '', .33),
('ArmsDay', '', 0.33),
('Cardio', '', 0.33),
('Tired', 'LegDay ArmDay', 'Cardio',
{(T, T, T): 0.1,
(T, T, F): 0.1,
(T, F, T): 0.7,
(T, F, F):... | WmHHooper/aima-python | submissions/Thompson/myBayes.py | Python | mit | 907 | 0.003308 |
'''
Oh, an attractive module description here.
'''
import os
import shutil
import zipfile
from gi.repository import Gtk
from xml.dom import minidom
from xml.etree import ElementTree as ET
import re
import distutils.archive_util
EPUB_PATH = "/home/amit/git/epub-highlighter/epub/test.epub"
# print(os.path.spli(EPUB_PATH... | LordAmit/epub-highlighter | epub_highlighter.py | Python | mit | 7,285 | 0.000686 |
from django.shortcuts import render, get_object_or_404, redirect
from .models import Movie, Trailer
from favorites.models import Favourite
def recent_movies(request):
movie_list = Movie.objects.all().order_by('-id')
# favs = Favourite.objects.all()
# for fav in favs:
# if fav.user == request.user... | outworldrunner/nightbay | movies/views.py | Python | gpl-3.0 | 1,200 | 0.004167 |
from asynctnt_queue import Queue, Tube
from tests import BaseTarantoolTestCase
class QueueTestCase(BaseTarantoolTestCase):
async def test__queue_create(self):
q = Queue(self.conn)
self.assertEqual(q.conn, self.conn, 'conn valid')
def test__queue_get_tube(self):
q = Queue(self.conn)
... | igorcoding/asynctnt-queue | tests/test_queue.py | Python | apache-2.0 | 925 | 0 |
# -*- coding: utf-8 -*-
# $Id: zh_tw.py 7119 2011-09-02 13:00:23Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two f... | JulienMcJay/eclock | windows/Python27/Lib/site-packages/docutils/parsers/rst/languages/zh_tw.py | Python | gpl-2.0 | 5,172 | 0.001354 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | hryamzik/ansible | lib/ansible/modules/network/aci/aci_tenant_span_dst_group.py | Python | gpl-3.0 | 6,414 | 0.001559 |
#!/usr/bin/env python
"""Stubs of client actions.
Client actions shouldn't be used on the server, stubs should be used instead.
This way we prevent loading effectively the whole client code into ours
server parts.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode... | demonchild2112/travis-test | grr/server/grr_response_server/server_stubs.py | Python | apache-2.0 | 12,170 | 0.012572 |
# -*- coding: utf-8 -*-
delivery={'weight': '10.0', 'pec_bar': u'9V169001>59647441000000023', 'suivi_bar': u'9V0>50000000024', 'cab_prise_en_charge': u'9V1 69001 964744 1000 000023', 'date': '12/05/2014', 'cab_suivi': u'9V 00000 00002 4', 'ref_client': u'OUT/00007', 'Instructions': ''}
sender={'city': u'city', 'accou... | akretion/laposte_api | laposte_api/data/colissimo_9V_nhas22.py | Python | agpl-3.0 | 2,753 | 0.009081 |
"""
Django settings for CELLAR project.
Generated by 'django-admin startproject' using Django 1.8.
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/1.8/ref/settings/
"""
# Build paths i... | SonienTaegi/CELLAR | CELLAR/settings.py | Python | gpl-2.0 | 2,762 | 0.000724 |
#!/usr/bin/python
#
# Copyright (C) 2009 Julian Andres Klode <jak@debian.org>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of hashsums in a... | mvo5/python-apt | tests/test_hashes.py | Python | gpl-2.0 | 9,619 | 0 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'APIAuth'
db.create_table(u'pycon_api_apiauth', (
(u'id', self.gf('django.db.mode... | pyconjp/pyconjp-website | pycon/pycon_api/migrations/0001_initial.py | Python | bsd-3-clause | 12,615 | 0.007372 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20150914_2147'),
]
operations = [
migrations.AlterField(
model_name='movie',
name=... | rtancman/filmes | movies/core/migrations/0003_auto_20150914_2157.py | Python | mit | 408 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from .context import tripp
from tripp import logistic_regression
from tripp import munge
from tripp import gradient
from tripp import ml
from tripp import algebra
import random
import logging
logging.basicConfig(level=logging.ERROR, format="%(lineno)d\t%(... | mjamesruggiero/tripp | tests/test_logistic_regression.py | Python | bsd-3-clause | 6,511 | 0.000154 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
#
# 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.
"""Tests for the TextInput Qml... | LeoTestard/qt-ubuntu-components | tests/autopilot/tavastia/tests/textfield/test_textfield.py | Python | lgpl-3.0 | 923 | 0.005417 |
"""Support for deCONZ devices."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY, CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
from homeassistant.helpers import config_validation as cv
# Loading the config flow file will register the flow
from .... | aequitas/home-assistant | homeassistant/components/deconz/__init__.py | Python | apache-2.0 | 6,477 | 0 |
"""
Core model handling routines.
"""
from __future__ import print_function
__all__ = [
"list_models", "load_model", "load_model_info",
"build_model", "precompile_dlls", "reparameterize",
]
import os
from os.path import basename, join as joinpath
from glob import glob
import re
import copy
import numpy a... | SasView/sasmodels | sasmodels/core.py | Python | bsd-3-clause | 21,256 | 0.001553 |
from __future__ import unicode_literals
from django.utils.encoding import force_text
from django.db.models import Q
from . import find_modelname
from models import LogEntry
LATEST_N_AUDITLOG_ENTRIES = 15
def get_auditlog_entries(iterable, limit=LATEST_N_AUDITLOG_ENTRIES):
modelname = find_modelname(list(iterab... | sigmunau/nav | python/nav/auditlog/utils.py | Python | gpl-2.0 | 794 | 0.001259 |
from collections.abc import Iterable
from django import template
from django.db.models import Model
register = template.Library()
@register.filter
def get_type(value):
# inspired by: https://stackoverflow.com/a/12028864
return type(value)
@register.filter
def is_model(value):
return isinstance(value, ... | pbanaszkiewicz/amy | amy/autoemails/templatetags/type_extras.py | Python | mit | 555 | 0 |
#!/usr/bin/env python
###########################################################################
## ##
## Language Technologies Institute ##
## Carnegie Mellon University ... | leahrnh/ticktock_text_api | Backend.py | Python | gpl-2.0 | 4,516 | 0.010407 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"met... | aperigault/ansible | lib/ansible/modules/cloud/hcloud/hcloud_server.py | Python | gpl-3.0 | 14,437 | 0.001939 |
from rasa.engine.caching import TrainingCache
from rasa.engine.graph import ExecutionContext, GraphNode, GraphSchema, SchemaNode
from rasa.engine.storage.storage import ModelStorage
from rasa.engine.training import fingerprinting
from rasa.engine.training.components import PrecomputedValueProvider
from rasa.engine.trai... | RasaHQ/rasa_nlu | tests/engine/training/test_hooks.py | Python | apache-2.0 | 3,903 | 0.001025 |
# module General Ui
# file ui_maya_dock.py
# Main Dock Window interface
from thlib.side.Qt import QtWidgets as QtGui
#from thlib.side.Qt import QtCore
from thlib.environment import env_inst, env_mode, env_read_config, env_write_config
import thlib.maya_functions as mf
import thlib.tactic_classes as tc
import thlib.glo... | listyque/TACTIC-Handler | thlib/ui_classes/ui_maya_dock.py | Python | epl-1.0 | 6,812 | 0.001468 |
import json
from PIL import Image, ImageFont, ImageDraw
with open('./config/nodes.json') as data_file:
data = json.load(data_file)
gray = (200, 200, 200)
black = (0,0,0)
lightblue = (225, 255, 255)
darkblue = (185, 255, 255)
img = Image.new("RGBA", (400,400), 128)
usr_font = ImageFont.truetype("./fonts/Arial.t... | Ibuprofen/gizehmoviepy | node_positions_image.py | Python | mit | 1,603 | 0.008734 |
#-*- coding: utf-8 -*-
"""
@author: Rinze de Laat
Copyright © 2013 Rinze de Laat, Delmic
This file is part of Odemis.
Odemis 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.
Odemis is distributed in ... | gstiebler/odemis | src/odemis/util/test/util_test.py | Python | gpl-2.0 | 8,569 | 0.001984 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 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 abc imp... | mugurrus/superdesk-core | superdesk/io/feed_parsers/__init__.py | Python | agpl-3.0 | 14,119 | 0.002408 |
__version__ = '0.2.0'
class Preferences(object):
"""
Placeholder class to which preferences properties are added
dynamically through a signal.
See behaviours.Preferences and behaviours.preferences_class_prepared
"""
pass
preferences = Preferences()
| DjenieLabs/django-multisites-utils | multisitesutils/__init__.py | Python | bsd-3-clause | 276 | 0.003623 |
from __future__ import absolute_import
import logging
import os
import sys
import datetime
import psutil
from six import StringIO
from twisted.web import http, resource
from Tribler.Core.Utilities.instrumentation import WatchDog
import Tribler.Core.Utilities.json_util as json
HAS_MELIAE = True
try:
from meliae ... | Captain-Coder/tribler | Tribler/Core/Modules/restapi/debug_endpoint.py | Python | lgpl-3.0 | 18,160 | 0.002203 |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (
assert_almost_equal, assert_array_equal, assert_array_almost_equal,
TestCase, run_module_suite, assert_allclose, assert_equal, assert_,
assert_raises)
from scipy.interpolate im... | pbrod/scipy | scipy/interpolate/tests/test_polyint.py | Python | bsd-3-clause | 24,329 | 0.005754 |
"""
Test Setup Module -- THIS SHOULD BE REPURPOSED, TRIGGERED BY make-test.sh script
"""
import os
import sys
import time
import json
import inspect
from configparser import ConfigParser
import logging
# aws imports
import boto3
import moto
import pytest
from botocore.exceptions import ClientError, ProfileNotFound
# ... | t-stark/ec2cli | scripts/pretest_setup.py | Python | gpl-2.0 | 6,293 | 0.001112 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import redis
import json
class Redis(object):
def __init__(self, host="localhost", port=6379):
self._host = host
self._port = port
self._redis_cursor = None
def conn(self):
if self._redis_cursor is None:
pool = redis.C... | huhuchen/asyncqueue | asyncqueue/_redis.py | Python | mit | 720 | 0.002778 |
# coding=utf8
import sublime
from .Base import Base
from ...utils import Debug
from ...utils.uiutils import get_prefix
class Outline(Base):
regions = {}
ts_view = None
def __init__(self, t3sviews):
super(Outline, self).__init__('Typescript : Outline View', t3sviews)
# SET TEXT
def set_... | Phaiax/ArcticTypescript | lib/display/views/Outline.py | Python | mit | 3,505 | 0.003994 |
#!python
import math
import fractions
import pygame
import argparse
import os.path
import sys
import subprocess
import time
from itertools import combinations,islice
from ntracer import NTracer,Material,ImageFormat,Channel,BlockingRenderer,CUBE
from ntracer.pygame_render import PygameRenderer
ROT_SENSITIVITY = 0.005... | Rouslan/NTracer | scripts/polytope.py | Python | mit | 24,145 | 0.014206 |
from __future__ import absolute_import, unicode_literals
from .views import ContactCRUDL
urlpatterns = ContactCRUDL().as_urlpatterns()
| xkmato/tracpro | tracpro/contacts/urls.py | Python | bsd-3-clause | 137 | 0 |
#!/usr/bin/env python
"""
a class to access the REST API of the website www.factuursturen.nl
"""
import collections
import ConfigParser
from datetime import datetime, date
import re
import requests
from os.path import expanduser
import copy
import urllib
__author__ = 'Reinoud van Leeuwen'
__copyright__ = "Copyright 2... | reinoud/factuursturen | factuursturen/__init__.py | Python | bsd-2-clause | 19,420 | 0.003862 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
('id', models.AutoField(verbose_... | TheDavidGithub/mysite | car/migrations/0001_initial.py | Python | gpl-2.0 | 1,116 | 0.000896 |
#{{{ valid_key
valid_key = """-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAyGE8JpvCpp/0aLm6s0C56V5JtVr/fWra/pdFviA8YSabUlur
kcVPwoZLPbYmZtqmjfLSp5k1aCQbSqQDuB3nduFvWS6TzB8ACRDfw4KHE2D76pNE
lPbPejzIF8AyNKLrqi/Tba17cmqw1FFICg3B5ftu7mBzhJCPS/mt1i89CuoKVWRo
VB1CCKqJ0XIUO5/GC8nH2TwAzhnQpCx5B0bUJZkPxB5qbjXPpewY0IpSMNLrAGB... | richo/groundstation | test/support/crypto_fixture.py | Python | mit | 10,569 | 0.001608 |
from importlib import import_module
from djangoautoconf.auto_conf_urls import enum_app_names
from djangoautoconf.auto_conf_utils import is_at_least_one_sub_filesystem_item_exists, get_module_path
from ufs_tools.short_decorator.ignore_exception import ignore_exc_with_result
def autodiscover():
from django.conf im... | weijia/djangoautoconf | djangoautoconf/auto_detection/routing_auto_detection.py | Python | bsd-3-clause | 1,242 | 0.00161 |
###############################################################################
## ##
## This file is part of ModelBlocks. Copyright 2009, ModelBlocks developers. ##
## ##
... | modelblocks/modelblocks-release | resource-gcg/scripts/induciblediscgraph.py | Python | gpl-3.0 | 35,189 | 0.036204 |
import sys, os
import visit_rcParams as vrc
import visit_colormaps as vc
import visit_time as vt
import visit as v
rcParams = dict( surface_linewidth=3,
snow_linewidth=4
)
class Operator:
def __init__(self, oname, otype, oatts):
self.oname = oname
self.otype = o... | amanzi/ats-dev | tools/visit_ats/visit_ats/visit_ats.py | Python | bsd-3-clause | 21,342 | 0.005716 |
# Copyright 2017 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 or agreed to in writing, ... | hanmy75/voice-recognizer | src/aiy/audio.py | Python | apache-2.0 | 3,887 | 0.000772 |
'''
Produce minimum, maximum and the difference of number list
Status: Accepted
'''
###############################################################################
def read_line_of_integers():
"""Read one line of numbers or detect EOF"""
try:
text = input()
return [int(i) for i in text.split... | ivanlyon/exercises | kattis/k_statistics.py | Python | mit | 970 | 0.004124 |
#-*-coding:UTF-8 -*-
#
# 判斷輸入是否為整數(int)
input_string = input('Please input n:')
#while input_string.isdigit() == False:
while not input_string.isdigit():
print("Error, %s is not digit!" % input_string)
input_string = input('Please input n:')
print("%s is digit!" % input_string)
| yuzheng/python-ex | checkDigit.py | Python | mit | 301 | 0.017668 |
from unittest import TestCase
from io import StringIO
from trtools.util.tempdir import TemporaryDirectory
import trtools.io.filecache as fc
class TestFileCache(TestCase):
def __init__(self, *args, **kwargs):
TestCase.__init__(self, *args, **kwargs)
def runTest(self):
pass
def setUp(self... | dalejung/trtools | trtools/io/tests/test_filecache.py | Python | mit | 1,754 | 0.008552 |
#-------------------------------------------------------------
#
# 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... | nakul02/incubator-systemml | src/main/python/systemml/mlcontext.py | Python | apache-2.0 | 25,332 | 0.004934 |
#!/usr/bin/env python3
# Copyright 2010-2021 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 ... | google/or-tools | examples/tests/issue46.py | Python | apache-2.0 | 3,057 | 0 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis | attribution/tests/factories/attribution_charge_new.py | Python | agpl-3.0 | 2,021 | 0.001485 |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "nxtools",
version = "0.8.4",
author = "Martin Wacker",
author_email = "martas@imm.cz",
description = "Set of common utilities and little helpers.",
lice... | martastain/nxtools | setup.py | Python | mit | 989 | 0.0182 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.