code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Script to generate plots with random data points
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 50, 50)
y = x + np.random.random_sample(50)*10
plt.figure(figsize=(3, 2), dpi=100)
plt.plot(x, y, 'co', linewidth=4.0)
plt.savefig('noisy_data.png')
plt.show()
| zhouhaner/WebPlotDigitizer | scripts/noisyData.py | Python | gpl-3.0 | 285 |
# Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | tensorflow/graphics | tensorflow_graphics/projects/neural_voxel_renderer/layers.py | Python | apache-2.0 | 5,993 |
# -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta... | hitsl/bouser | bouser/web/useragents.py | Python | isc | 4,901 |
#!/usr/bin/env python
from peyotl.utility import get_logger, ConfigWrapper
from peyotl.ott import OTT
import subprocess
import sys
import os
_LOG = get_logger('clipeyotl')
out = sys.stdout
def parse_config_file(fp):
try:
from ConfigParser import SafeConfigParser
except ImportError:
from configp... | rvosa/peyotl | scripts/clipeyotl.py | Python | bsd-2-clause | 2,721 |
from django.db import migrations
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('dojo', '0054_dojometa_finding'),
]
operations = [
migrations.AlterField(
model_name='notifications',
name='jira_update',
field=... | rackerlabs/django-DefectDojo | dojo/db_migrations/0055_notifications_jira_update_verbose_name.py | Python | bsd-3-clause | 669 |
# Copyright 2019 Open Source Robotics Foundation, Inc.
# All rights reserved.
#
# Software License Agreement (BSD License 2.0)
#
# 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... | ament/ament_lint | ament_copyright/test/cases/bsd_license_tabs/case.py | Python | apache-2.0 | 1,632 |
from __future__ import print_function
import sys
from pyxb.utils.six.moves.urllib import request as urllib_request
import GeoCoder
from pyxb import BIND
from pyxb.utils import domutils
import pyxb.bundles.wssplat.soap11 as soapenv
import pyxb.bundles.wssplat.soapenc as soapenc
address = '1600 Pennsylvania Ave., Washin... | CantemoInternal/pyxb | examples/geocoder/client.py | Python | apache-2.0 | 2,471 |
from issues.models import ReportedLink, ReportedUser
from issues.serializers import ReportedLinkSerializer, ReportedUserSerializer
class ReportedLinkAPI(object):
serializer_class = ReportedLinkSerializer
def get_queryset(self):
return ReportedLink.objects.all()
class ReportedLinkSelfAPI(object):
... | projectweekend/Links-API | links/issues/mixins.py | Python | mit | 849 |
#!/usr/bin/env python2.7
from mpi4py import MPI
import random
start_time = MPI.Wtime()
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
mpisize = comm.Get_size()
nsamples = int(12e7/mpisize)
inside = 0
random.seed(rank)
for i in range(nsamples):
x = random.random()
y = random.random()
if (x*x)+(y*y)<1:
... | wscullin/ACCA-CS | src/pi/mpi_pi.py | Python | bsd-3-clause | 551 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Integration tests for NAME to GRIB2 interoperability."""
# Import iris.tests first so that some things can be initialised b... | pp-mo/iris | lib/iris/tests/integration/format_interop/test_name_grib.py | Python | lgpl-3.0 | 4,090 |
#! /usr/bin/env python
"""
A script that provides:
1. Ability to grab binaries where possible from LLVM.
2. Ability to download binaries from MongoDB cache for clang-format.
3. Validates clang-format is the right version.
4. Has support for checking which files are to be checked.
5. Supports validating and updating a s... | sanathkumarv/RestAPIWt | tools/mongo-cxx-driver-legacy/site_scons/buildscripts/clang_format.py | Python | apache-2.0 | 19,897 |
def is_isogram(s):
return len(s) == len(set(s.lower()))
| VladKha/CodeWars | 7 kyu/Isograms/solve.py | Python | gpl-3.0 | 60 |
# encoding: utf-8
import woo.config
if 'qt4' in woo.config.features:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
else:
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from woo.qt.ObjectEditor import *
import woo
import woo.qt
from woo.dem import *
#from ... | woodem/woo | py/qt/Inspector.py | Python | gpl-2.0 | 17,102 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import sys
# monkey patch bug in python 2.6 and lower
# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717
if sys.version_info < (2, 7) and os.name != "nt":
import errno
import subpr... | ace02000/pyload | module/plugins/hooks/ExtractArchive.py | Python | gpl-3.0 | 21,362 |
# Copyright 2015 PLUMgrid
#
# 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, softwar... | hgn/bcc | src/python/bpf/__init__.py | Python | apache-2.0 | 12,104 |
#!/usr/bin/env python
import os
import sys
import bowl_pool
import datetime
from optparse import OptionParser
# bowlResultsFileName = "input/bowlResults.csv"
# bowlPicksFileName = "input/bowlPicks.csv"
# STPicksFileName = "input/STPicks.csv"
# bonusResultsFileName = "input/bonusResults.csv"
# bonusPicksFileName = "in... | jorodo/cfb-pool | main.py | Python | gpl-3.0 | 4,375 |
from distutils.core import setup
import glob
print(glob.glob('scripts/*'))
setup(name='reynard',
version='dev',
packages=['reynard',
'reynard.monitors',
'reynard.servers'],
scripts=['scripts/reynard_basic_cli.py',
'scripts/reynard_basic_server.py']
... | ewanbarr/reynard | setup.py | Python | mit | 323 |
"""SCons.Defaults
Builders and other things for the local site. Here's where we'll
duplicate the functionality of autoconf until we move it into the
installation procedure or use something like qmconf.
The code that reads the registry to find MSVC components was borrowed
from distutils.msvccompiler.
"""
#
# Copyri... | faarwa/EngSocP5 | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Defaults.py | Python | gpl-3.0 | 16,921 |
#!/usr/bin/env python3
import logging as log
from os import environ as env
from os import path
import modules.extra as e
from modules.assembler import Assembler
from modules.emulator import Emulator
from modules.export import export
from modules.settings import Settings
from modules.simulation import Simul... | fredmorcos/attic | projects/vo-tools/mgen.py | Python | isc | 942 |
# -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
class S3MainMenu(default.S3MainMenu):
"""
Custom Application Main Menu:
The main menu consists of several sub-menus, ea... | sahana/Turkey | modules/templates/NYC/menus.py | Python | mit | 12,151 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 06:54
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 = [
migratio... | MMKnight/d-logger | user/migrations/0001_initial.py | Python | mit | 884 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | googleads/googleads-python-lib | examples/ad_manager/v202108/proposal_service/request_buyers_acceptance.py | Python | apache-2.0 | 2,506 |
from xml.dom import minidom, Node
from xml.parsers.expat import ExpatError, ErrorString
class GoodReadsParser(object):
def parse_result(self, url_handler):
try:
goodreads_dom = minidom.parse(url_handler)
return goodreads_dom
except ExpatError as e:
QMessage... | DenitsaKostova/Bookoholic | bookoholic/goodread/goodreads_parser.py | Python | gpl-2.0 | 3,083 |
import logging
from copy import copy
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from PyQt5.QtCore import QObject
pyqtWrapperType = type(QObject)
__all__ = ["SimulationModule", "SimulationException",
"Trajectory", "Feedforward", "Controller", "Limiter",
"ModelMixe... | cklb/PyMoskito | pymoskito/simulation_modules.py | Python | bsd-3-clause | 14,724 |
import json
import re
import pkg_resources
import requests
from bs4 import BeautifulSoup
import threading
import string
import random
import time
import socket
import socks
from core.alert import *
from core.targets import target_type
from core.targets import target_to_host
from core.load_modules import load_file_path
... | Nettacker/Nettacker | lib/scan/wappalyzer/engine.py | Python | gpl-3.0 | 9,456 |
'''
The tests in this package are to ensure the proper resultant dtypes of
set operations.
'''
import itertools as it
import numpy as np
import pytest
from pandas.core.dtypes.common import is_dtype_equal
import pandas as pd
from pandas import Int64Index, RangeIndex
from pandas.tests.indexes.conftest import indices_l... | cbertinato/pandas | pandas/tests/indexes/test_setops.py | Python | bsd-3-clause | 2,362 |
#!/usr/bin/python
import sys
import glob
from libSimProm import SimProm
################################################################################
# Fake Comport + Arduino simulation
class SimCom:
SimDevice = "/fake/SIMUDUINO"
device = SimDevice
description = "Arduino Serial Simulation"
isOpen = False
ac... | BleuLlama/LlamaPyArdy | Python/libs/libSimCom.py | Python | mit | 3,270 |
'''
Creates the plot of the predicted amount of waste for different mutation
rates and different numbers of active genes. To make the plot use:
python wasteplot.py
The graph will be saved to Probability.eps
NOTE: You CANNOT use pypy for this as pylab is current unsupported. Use
python 2.7 instead.
'''
from pylab i... | brianwgoldman/ReducingWastedEvaluationsCGP | wasteplot.py | Python | bsd-2-clause | 883 |
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from .gigya import GigyaBaseIE
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
strip_or_none,
float_or_none,
int_or_none,
merge_dicts,
parse_iso8601,
str_or_none,
... | vinegret/youtube-dl | youtube_dl/extractor/canvas.py | Python | unlicense | 14,571 |
# -*- coding: utf-8 -*-
#
# django-filter documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 17 11:25:20 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | alex/django-filter | docs/conf.py | Python | bsd-3-clause | 8,216 |
from datetime import datetime
from sys import exit
from ..concurrency import WorkerPool
from ..utils.cmdline import count_items, get_target_nodes
from ..utils.table import ROW_SEPARATOR, render_table
from ..utils.text import (
blue,
bold,
cyan,
cyan_unless_zero,
error_summary,
format_duration,
... | bundlewrap/bundlewrap | bundlewrap/cmdline/verify.py | Python | gpl-3.0 | 4,452 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2013 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | biswajitsahu/kuma | vendor/packages/translate/convert/php2po.py | Python | mpl-2.0 | 5,142 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009 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, either version 3 of the License, or
# (at your option... | FEniCS/dolfin | site-packages/dolfin_utils/commands.py | Python | lgpl-3.0 | 1,591 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/library_kinematics_model/kinematics_model/technique_common/joint/revolute/limit/limit.py | Python | mit | 4,505 |
# A driver for running 2D alignment using the FijiBento alignment project
# The input is a directory that contains image files (tiles), and the output is a 2D montage of these files
# Activates ComputeSIFTFeaturs -> MatchSIFTFeatures -> OptimizeMontageTransfrom
# and the result can then be rendered if needed
#
# requir... | Rhoana/rh_aligner | old/2d_align_affine_driver.py | Python | mit | 5,463 |
# coding=utf8
#
from django.conf.urls import patterns
from snaker.shome.views import index, problems
urlpatterns = patterns(
'',
(r'^$', index),
(r'^problems', problems),
) | seraphlnWu/snaker | snaker/shome/urls.py | Python | gpl-2.0 | 187 |
from traits.api import Int, List, Str, Float, TraitError, ListStr
import openpnm as op
from openpnm.utils import SettingsAttr, TypedList, TypedSet
import pytest
class SettingsTest:
def setup_class(self): ...
def test_standard_initialization(self):
class S1:
r"""
This is a doc... | PMEAL/OpenPNM | tests/unit/utils/SettingsTest.py | Python | mit | 2,866 |
#!/usr/bin/env python
"""
Get metadata for the given file specified by its Logical File Name or for a list of files
contained in the specifed file
Usage:
dirac-dms-catalog-metadata <lfn | fileContainingLfns> [Catalog]
Example:
$ dirac-dms-catalog-metadata /formation/user/v/vhamar/Example.txt
FileName ... | yujikato/DIRAC | src/DIRAC/DataManagementSystem/scripts/dirac_dms_catalog_metadata.py | Python | gpl-3.0 | 2,306 |
from django.test import TestCase
from rea_people.models import (
Agent,
Organisation,
Person,
Epitome,
EpitomeCategory,
EpitomeInstance,
Skill,
Interest,
ProgrammingLanguage,
Rating,
OutofTen,
RatingInstance,
)
class SimpleTestCase(TestCase):
def test_addition(self):
... | DarrenFrenkel/django-rea-people | rea_people/tests.py | Python | mit | 348 |
from __future__ import unicode_literals
import os
import unittest
import balanced
from billy_client import BillyAPI
from billy_client import Plan
@unittest.skipUnless(
os.environ.get('BILLY_CLIENT_TEST_AGAINST_SERVER'),
'Skip testing against server unless BILLY_CLIENT_TEST_AGAINST_SERVER is set',
)
class Te... | victorlin/billy-client | billy_client/tests/test_against_server.py | Python | mit | 3,958 |
import pytest
import re
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selene import browser
from selene import config
from selene.common.none_object import NoneObject
from selene.support.conditions import have
from selene.support.jquery_style_selectors import s, ss
from te... | SergeyPirogov/selene | tests/integration/error_messages_test.py | Python | mit | 6,833 |
import tensorflow as tf # neural network for function approximation
import gym # environment
import numpy as np # matrix operation and math functions
from gym import wrappers
import gym_morph # customized environment for cart-pole
import matplotlib.pyplot as plt
import time
# Hyperparameters
RANDOM_NUMBER_SEED = 2
# ... | GitYiheng/reinforcement_learning_test | test01_cartpendulum/Feb/t8_cartpole_mc_plot.py | Python | mit | 7,022 |
#!/usr/bin/env python
# *-* coding:utf-8 *-*
"""
Date :
Author : Vianney Gremmel loutre.a@gmail.com
"""
from time import time
start = time()
def squareroot_fractions():
h1, h2, k1, k2 = 1, 1, 1, 0
while 1:
h1, h2 = 2*h1 + h2, h1
k1, k2 = 2*k1 + k2, k1
yield h2, k2
big_numerator = la... | vianney-g/python-exercices | eulerproject/pb0057.py | Python | gpl-2.0 | 472 |
def max_(lst):
if len(lst) == 0:
return None
if len(lst) == 1:
return lst[0]
else:
sub_max = max_(lst[:1])
return lst[0] if lst[0] > sub_max else sub_max
| liangjisheng/Data-Struct | books/algorithmicGraphics/chapter4/04_recursive_max.py | Python | gpl-2.0 | 198 |
from src.matrix_spiral import matrix_spiral
matrix1 = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
result1 = [1, 2, 3, 6, 9, 8, 7, 4, 5]
matrix2 = [
[1, 2, 3, 4],
[4, 5, 6, 7],
[7, 8, 9, 10],
[11, 12, 13, 14],
[15, 16, 17, 18]
]
result2 = [1, 2, 3, 4, 7, 10, 14, 18, 17, 16, 15, 11, 7, 4, 5, 6... | tanyaweaver/code-katas | test/test_matrix_spiral.py | Python | mit | 692 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webapp.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) | pombredanne/1trillioneuros | manage.py | Python | gpl-3.0 | 246 |
# Generated by Django 2.2.5 on 2019-09-17 15:23
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adjudication', '0003_auto_20190917_0644'),
]
operations = [
migrations.AddField(
mod... | dbinetti/barberscore-django | project/apps/adjudication/migrations/0004_auto_20190917_0823.py | Python | bsd-2-clause | 965 |
# mozilla/prettyprinters.py --- infrastructure for SpiderMonkey's auto-loaded pretty-printers.
import gdb
import re
# Decorators for declaring pretty-printers.
#
# In each case, the decoratee should be a SpiderMonkey-style pretty-printer
# factory, taking both a gdb.Value instance and a TypeCache instance as
# argume... | Yukarumya/Yukarum-Redfoxes | js/src/gdb/mozilla/prettyprinters.py | Python | mpl-2.0 | 14,426 |
# -*- 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 redistribute it and... | baloo/shinken | shinken/modules/livestatus_broker/livestatus_constraints.py | Python | agpl-3.0 | 1,143 |
from flask import Flask
app = Flask(__name__)
app.config.from_object('CoreCatalog.default_settings')
import CoreCatalog.views
| CORE-POS/CoreCatalog | CoreCatalog/__init__.py | Python | apache-2.0 | 127 |
#=====================================================================================================================================
#Copyright
#=====================================================================================================================================
#Copyright (C) 2014 Alexander Blaessle... | mueller-lab/PyFRAP | pyfrp/subclasses/pyfrp_ROI.py | Python | gpl-3.0 | 111,299 |
# pylint: disable=C0111,R0903
"""Displays update information per repository for pacman.
Parameters:
* pacman.sum: If you prefere displaying updates with a single digit (defaults to 'False')
Requires the following executables:
* fakeroot
* pacman
contributed by `Pseudonick47 <https://github.com/Pseudonic... | tobi-wan-kenobi/bumblebee-status | bumblebee_status/modules/contrib/pacman.py | Python | mit | 2,175 |
import os, pickle, datetime, itertools, operator
from django.db import models as dbmodels
from autotest.frontend.afe import rpc_utils, model_logic
from autotest.frontend.afe import models as afe_models, readonly_connection
from autotest.frontend.tko import models, tko_rpc_utils, graphing_utils
from autotest.frontend.tk... | coreos/autotest | frontend/tko/rpc_interface.py | Python | gpl-2.0 | 19,221 |
#!/usr/bin/env python
import sys, os
import mmap # Thanks Steven @ http://stackoverflow.com/questions/4940032/search-for-string-in-txt-file-python
import subprocess
import readline
readline.set_completer_delims(' \t\n;')
readline.parse_and_bind("tab: complete")
readline.parse_and_bind("set match-hidden-files off"... | UC3Music/genSongbook | song-directory-to-songbook.py | Python | unlicense | 6,143 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2016-2022 GEM Foundation
#
# OpenQuake 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 Licen... | gem/oq-engine | openquake/calculators/tests/ucerf_test.py | Python | agpl-3.0 | 3,954 |
#!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = set([
"130.211.129.106", "178.63.107.226",
"83.81.1... | Infernoman/skidoo | contrib/seeds/makeseeds.py | Python | mit | 3,747 |
# -*- coding: utf-8 -*-
import os
import subprocess
from PyQt4.QtGui import *
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingConfig import Setting, ProcessingConfig
from sextante_animove.mcp import mcp
from sexta... | gioman/radio_telemetry_tools | animoveAlgorithmProvider.py | Python | gpl-2.0 | 2,320 |
# -*- coding: utf-8 -*-
# encoding: utf-8
from woo import utils, ymport, qt, plot
from woo import log
log.setLevel('Law2_ScGeom_WirePhys_WirePM',log.TRACE) # must compile with debug option to get logs
## definition of some colors for colored text output in terminal
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\... | sjl767/woo | scripts/test-OLD/WireMatPM/net-2part-displ-unloading.py | Python | gpl-2.0 | 4,387 |
#-------------------------------------------------------------------------------
# elftools tests
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
import unittest
from elftools.common.py3compat import (iterbytes, i... | pombredanne/pyelftools | test/test_py3compat.py | Python | unlicense | 1,006 |
"""Blog managers."""
from django.db import models
from django.utils.timezone import now
class PostManager(models.Manager): # pylint: disable=too-few-public-methods
"""Post manager"""
def public(self):
"""Filter the queryset to obtain the public posts."""
return self.filter(status='PB', creat... | arpegio-dj/arpegio | arpegio/blog/managers.py | Python | bsd-3-clause | 465 |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import json
import time
import Queue
import requests
import threading
import logging
import socket
class StopThreadException(Exception):
pass
class FlasqueFormatter(logging.Formatter):
RECORD_ATTRS = (
"threadName", "name", "thread", "... | philpep/flasque | flasque/client.py | Python | bsd-3-clause | 6,640 |
# -*- coding: utf-8 -*-
#
# MothBall documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 30 20:11:36 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | MarionTheBull/watchmaker | docs/conf.py | Python | apache-2.0 | 9,706 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
# test_records = frappe.get_test_records('Packing Slip')
from erpnext.tests.utils import ERPNextTestCase
class TestPackingSlip(unittest.TestCase):
pass
| mhbu50/erpnext | erpnext/stock/doctype/packing_slip/test_packing_slip.py | Python | gpl-3.0 | 260 |
#!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import Conf... | danielvdao/TheAnimalFarm | venv/lib/python2.7/site-packages/pip/__init__.py | Python | gpl-2.0 | 9,450 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2014 CERN.
#
# Invenio Demosite 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... | mvesper/invenio-demosite | invenio_demosite/__init__.py | Python | gpl-2.0 | 887 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source_py3.py | Python | mit | 992 |
#!/usr/bin/env python
# ============================================================================
# Project Name : iTrade
# Module Name : iTrade_ansicolors.py
#
# Description: ANSI Colors code
#
# The Original Code is iTrade code (http://itrade.sourceforge.net).
#
# The Initial Developer of the Original Co... | eternallyBaffled/itrade | itrade_ansicolors.py | Python | gpl-3.0 | 3,883 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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 License, or
# (at... | MicroMappers/Pybossa | pybossa/forms/validator.py | Python | agpl-3.0 | 3,790 |
"""
This module extends SQLAlchemy and provides additional DDL [#]_
support.
.. [#] SQL Data Definition Language
"""
import re
import warnings
import sqlalchemy
from sqlalchemy import __version__ as _sa_version
warnings.simplefilter('always', DeprecationWarning)
_sa_version = tuple(int(re.match("\d+", x).g... | msabramo/kallithea | kallithea/lib/dbmigrate/migrate/changeset/__init__.py | Python | gpl-3.0 | 841 |
from kalman import *
| mrcaps/rainmon | code/kalman/__init__.py | Python | bsd-3-clause | 21 |
import time
import urllib2
from urllib2 import urlopen
import re
import cookielib, urllib2
from cookielib import CookieJar
import datetime
import sqlite3
cj = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
conn = sqlite3.connect('knowle... | PythonProgramming/2.7-NLTK-videos | nltk7.py | Python | mit | 1,763 |
from five import grok
from plone.dexterity.content import Container
from plone.directives import form
from plone.namedfile.interfaces import IImageScaleTraversable
class IWorkspaceContainer(form.Schema, IImageScaleTraversable):
"""
Marker interface for WorkspaceContainer
"""
class WorkspaceContainer(Con... | ploneintranet/ploneintranet.workspace | src/ploneintranet/workspace/workspacecontainer.py | Python | gpl-2.0 | 705 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('polls', '0002_reports'),
]
operations = [
migrations.AlterField(
... | mnithya/cs3240-s15-team06-test | polls/migrations/0003_auto_20150325_2019.py | Python | mit | 507 |
"""
Command to delete all rows from the verify_student_historicalverificationdeadline table.
"""
import logging
from lms.djangoapps.verify_student.models import VerificationDeadline
from openedx.core.djangoapps.util.row_delete import delete_rows, BaseDeletionCommand
log = logging.getLogger(__name__)
class Command(Ba... | teltek/edx-platform | lms/djangoapps/verify_student/management/commands/delete_historical_verify_student_data.py | Python | agpl-3.0 | 943 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script to download time tables as PDF and extract times into containers that can be used by OSM2GFTS
# or similar
from common import *
import os
import sys
import io
import logging
import requests
import json
import datetime
logger = logging.getLogger("GTFS_get_times")
l... | Skippern/PDF-scraper-Lorenzutti | creators/minastur/get_times.py | Python | gpl-3.0 | 2,176 |
import unittest
import mock
from pyrax.cloudcdn import CloudCDNClient
from pyrax.cloudcdn import CloudCDNFlavor
from pyrax.cloudcdn import CloudCDNFlavorManager
from pyrax.cloudcdn import CloudCDNService
from pyrax.cloudcdn import CloudCDNServiceManager
class CloudCDNTest(unittest.TestCase):
@mock.patch("pyrax.... | briancurtin/pyrax | tests/unit/test_cloud_cdn.py | Python | apache-2.0 | 2,703 |
import os
import sys
dirname = os.path.dirname(__file__)
lib_path = os.path.abspath(os.path.join(dirname, ".."))
packages_path = os.path.join(lib_path, "site-packages")
if packages_path not in sys.path:
sys.path.append(packages_path)
| ghostlines/ghostlines-robofont | src/lib/ghostlines/__init__.py | Python | mit | 240 |
"""file_parser.py reads text file and parse the item into a list."""
def file_to_list(input_file):
data_list_trim = []
try:
with open(input_file) as in_put:
input_data = in_put.readlines()
if len(input_data) == 1:
print()
data_list = input_data[0... | roy-boy/python_scripts | file_parser.py | Python | gpl-3.0 | 847 |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.core.signals import (acl, agreements, attachments, category, event, event_management, menu, pl... | mic4ael/indico | indico/core/signals/__init__.py | Python | mit | 553 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Isaku Yamahata <yamahata@valinux co jp>
# 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
#
# ... | NoBodyCam/TftpPxeBootBareMetal | nova/block_device.py | Python | apache-2.0 | 2,403 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, Extension, find_packages
with open('README.md') as readme_file:
readme = readme_file.read()
requirements = ['requests>=2.21.0']
setup_requirements = [ ]
test_requirements = [ ]
setup(
author="Finbarr Brady"... | fbradyirl/hikvision | setup.py | Python | mit | 1,172 |
"""Helper methods to handle the time in Home Assistant."""
from __future__ import annotations
from contextlib import suppress
import datetime as dt
import re
from typing import Any, cast
import ciso8601
import pytz
import pytz.exceptions as pytzexceptions
import pytz.tzinfo as pytzinfo
from homeassistant.const impor... | w1ll1am23/home-assistant | homeassistant/util/dt.py | Python | apache-2.0 | 12,636 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Package
class PackageAdmin(admin.ModelAdmin):
list_display = (
'member', 'version', 'platform', 'arch',
'get_display_size', 'update', )
list_filter = ('version', 'platform', 'arch', 'update', )
search_fields = ('... | vinta/sublimall-server | sublimall/storage/admin.py | Python | mit | 526 |
# -*- coding: utf-8 -*-
# Copyright 2017 Nick Boultbee
#
# 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.
import os
impo... | elbeardmorez/quodlibet | quodlibet/quodlibet/ext/events/visualisations.py | Python | gpl-2.0 | 3,329 |
import os
import sys
from grace.utility import *
from grace.utility import LOG as L
from grace.script import testcase_base
class TestCase_Android(testcase_base.TestCase_Unit):
def adb_screenshot(self, filename=None):
if filename == None: filename = "capture.png"
L.debug("capture file : %s" % os.... | TE-ToshiakiTanaka/stve | project/grace/script/testcase_android.py | Python | mit | 466 |
"""
WSGI config for tests_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | andytwoods/zappa-call-later | tests/tests_project/tests_project/wsgi.py | Python | mit | 403 |
"""
========
numpydoc
========
Sphinx extension that handles docstrings in the Numpy standard format. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined
otherwis... | loli/sklearn-ensembletrees | doc/sphinxext/numpy_ext/numpydoc.py | Python | bsd-3-clause | 6,030 |
# -*- coding: utf-8 -*-
# using code from
# https://blog.darmasoft.net/2013/06/30/using-pure-python-otr.html
import potr
import os
import logging
logging.basicConfig(level=logging.DEBUG)
from django.core.cache import cache
log = logging.getLogger()
class OTRContext(potr.context.Context):
"""Context is like a c... | mfa/djangodash2013 | otrme/otrbackend/magic.py | Python | bsd-3-clause | 4,845 |
# This file is part of fedmsg.
# Copyright (C) 2015 Red Hat, Inc.
#
# fedmsg 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 2.1 of the License, or (at your option) any later version.
#... | fedora-infra/fedmsg_meta_fedora_infrastructure | fedmsg_meta_fedora_infrastructure/tests/infragit.py | Python | lgpl-2.1 | 5,619 |
import socket
from sys import platform
from functools import wraps, partial
from itertools import count, chain
from weakref import WeakValueDictionary
from errno import errorcode
from six import text_type as _text_type
from six import binary_type as _binary_type
from six import integer_types as integer_types
from six ... | sorenh/pyopenssl | OpenSSL/SSL.py | Python | apache-2.0 | 64,003 |
# -*- coding: utf-8 -*-
import re
import time
import traceback
from module.plugins.internal.Hook import Hook
from module.utils import decode, remove_chars
class MultiHook(Hook):
__name__ = "MultiHook"
__type__ = "hook"
__version__ = "0.54"
__status__ = "testing"
__config__ = [("pluginmo... | fayf/pyload | module/plugins/internal/MultiHook.py | Python | gpl-3.0 | 9,986 |
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchAndroid
from os.path import exists, join
from os import uname
import glob
import sh
class Python3Recipe(Recipe):
version = '3.4.2'
url = 'http://python.org/ftp/python/{version}/Python-{version}.tgz'
name = 'pytho... | lc-soft/python-for-android | pythonforandroid/recipes/python3/__init__.py | Python | mit | 7,303 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_authorization_management_client_enums.py | Python | mit | 2,080 |
"""Support for the (unofficial) Tado API."""
import asyncio
from datetime import timedelta
import logging
from PyTado.interface import Tado
from requests import RequestException
import requests.exceptions
from homeassistant.components.climate.const import PRESET_AWAY, PRESET_HOME
from homeassistant.config_entries imp... | partofthething/home-assistant | homeassistant/components/tado/__init__.py | Python | apache-2.0 | 8,846 |
from django.conf.urls.defaults import *
from .views import *
from .views_misc import ServerInfoView
from .views_auth import LogoutDeviceView, ClientLoginTokenView
from .endpoints.dir_shared_items import DirSharedItemsEndpoint
urlpatterns = patterns('',
url(r'^ping/$', Ping.as_view()),
url(r'^auth/ping/$', Au... | madflow/seahub | seahub/api2/urls.py | Python | apache-2.0 | 7,834 |
import _plotly_utils.basevalidators
class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="borderwidth", parent_name="heatmap.colorbar", **kwargs
):
super(BorderwidthValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/heatmap/colorbar/_borderwidth.py | Python | mit | 520 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable, ln_bounded
from variable_functions import my_attribute_label
class ln_employment_within_DDD_minutes_travel_time_hbw_am_transit_walk(Variable):... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/psrc/zone/ln_employment_within_DDD_minutes_travel_time_hbw_am_transit_walk.py | Python | gpl-2.0 | 984 |
#!/usr/bin/python
from sys import argv
import random
def main():
gra = "{}.gra".format(argv[-1])
n = int(argv[1])
m = int(argv[2])
gengnm(n,m,gra)
def gengnm(n,m,fn):
l = [[] for i in range(n)]
p = list(range(n))
random.shuffle(p)
random.seed()
for i in range(m):
s = random.randrange(0,n)
... | fiji-flo/preach | gendag.py | Python | mit | 890 |
# flake8: noqa
# -*- 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):
# Removing M2M table for field placeholders on 'NewsEntry'
db.delete_table('multilingual_news... | bitmazk/django-multilingual-news | multilingual_news/south_migrations/0007_auto.py | Python | mit | 13,164 |
from .private import cffi
def bisect_to_tolerance(initial_mesh, tolerance):
return cffi.bisect_to_tolerance(initial_mesh, tolerance)
def threshold(initial_mesh, tolerance, corner_indices, corner_radians):
return cffi.threshold(initial_mesh, tolerance, corner_indices, corner_radians)
| Andlon/crest | pycrest/refinement.py | Python | mit | 296 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.