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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
''' Author : Huy Nguyen
Program : debias
Start : 06/04/2017
End : 06/08/2017
'''
import os
import argparse
import shutil
from Bio import SeqIO
from ete3 import Tree
def parser_code():
parser = argparse.ArgumentParser(description='The purpose of this script to debias tree ba... | nguyenngochuy91/Ancestral-Blocks-Reconstruction | debias.py | Python | gpl-3.0 | 1,925 |
#
# Copyright 2019 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | candlepin/virt-who | virtwho/virt/kubevirt/kubevirt.py | Python | gpl-2.0 | 7,781 |
"""
tests.components.lock.test_demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo lock component.
"""
import unittest
import homeassistant.core as ha
from homeassistant.components import lock
FRONT = 'lock.front_door'
KITCHEN = 'lock.kitchen_door'
class TestLockDemo(unittest.TestCase):
""" Test the demo lock. ""... | nevercast/home-assistant | tests/components/lock/test_demo.py | Python | mit | 1,270 |
from diofant import cos, pretty, sin
from diofant.abc import x
from diofant.printing.pretty.pretty import PrettyPrinter
__all__ = ()
def test_render():
ustr = \
"""\
3 5 \n\
x x โ \n\
x - โโ + โโโ + Oโx\n\
6 120 \n\
\n\
\n\
6โ\n\
โ \n\
\
"""
assert pretty(si... | diofant/diofant | diofant/tests/printing/test_stringpict.py | Python | bsd-3-clause | 1,544 |
import numpy as np
from numpy.linalg import lstsq
from numpy.testing import (assert_allclose, assert_equal, assert_,
run_module_suite)
from scipy.optimize import lsq_linear
from scipy.sparse import rand
from scipy.sparse.linalg import aslinearoperator
A = np.array([
[0.171, -0.057],
... | DailyActie/Surrogate-Model | 01-codes/scipy-master/scipy/optimize/tests/test_lsq_linear.py | Python | mit | 5,051 |
#!/usr/bin/env python
# coding=utf-8
"""320. Factorials divisible by a huge integer
https://projecteuler.net/problem=320
Let N(i) be the smallest integer n such that n! is divisible by (i!)1234567890
Let S(u)=โN(i) for 10 โค i โค u.
S(1000)=614538266565663.
Find S(1 000 000) mod 1018.
"""
| openqt/algorithms | projecteuler/pe320-factorials-divisible-by-a-huge-integer.py | Python | gpl-3.0 | 299 |
import argparse
import csv
import glob
import logging
from logging.config import fileConfig
import os
import re
import sys
import xlrd
fileConfig('parsers/logging_config.ini')
logger = logging.getLogger()
reload(sys)
sys.setdefaultencoding('utf-8')
FILE_REGEX = "Demand|Budget at a glance|Receipt"
BUDGET_START_SLUG = "... | cbgaindia/parsers | state_budget/sikkim/sikkim_budget_csv_generator.py | Python | mit | 4,866 |
"""\
YAML parser module.
@author: Aaron Mavrinac
@organization: University of Windsor
@contact: mavrin1@uwindsor.ca
@license: GPL-3
"""
import os
import yaml
from math import pi
import pkg_resources
from itertools import chain
from .robot import Robot
from .solid import Solid
from .laser import RangeModel
from .cov... | ezod/adolphus | adolphus/yamlparser.py | Python | gpl-3.0 | 13,782 |
"""RCV1 dataset.
"""
# Author: Tom Dupre la Tour
# License: BSD 3 clause
import logging
from os import remove
from os.path import exists, join
from gzip import GzipFile
import numpy as np
import scipy.sparse as sp
from .base import get_data_home
from .base import _pkl_filepath
from .base import _fetch_remote
from ... | BiaDarkia/scikit-learn | sklearn/datasets/rcv1.py | Python | bsd-3-clause | 10,689 |
from __future__ import absolute_import, print_function, unicode_literals
# NB! This is not necessarily the version scheme we want, however having a good
# tracking of releases once we start doing lots of pre-releases is essential.
from .utils.version import get_version
__author__ = 'Learning Equality'
__email__ = 'in... | aronasorman/kolibri | kolibri/__init__.py | Python | mit | 397 |
"""
Provides full versioning CRUD and representation for collections of xblocks (e.g., courses, modules, etc).
Representation:
* course_index: a dictionary:
** '_id': a unique id which cannot change,
** 'org': the org's id. Only used for searching not identity,
** 'offering': the course's catalog number an... | nanolearning/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | Python | agpl-3.0 | 80,729 |
# -*- coding: utf-8 -*-
#
# Copyright ยฉ 2007-2008 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2, or (at your option) any later version. This
# program is distributed... | fedora-infra/packagedb | pkgdb/model/logs.py | Python | gpl-2.0 | 8,355 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-secret-manager | samples/generated_samples/secretmanager_generated_secretmanager_v1_secret_manager_service_enable_secret_version_async.py | Python | apache-2.0 | 1,582 |
import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.models.constants import LOOKUP_SEP
class Command(BaseCommand):
help = "Introspects the database tables in the given dat... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/core/management/commands/inspectdb.py | Python | mit | 13,763 |
#!/usr/bin/python
# Usage example:
# python comment_threads.py --channelid='<channel_id>' --videoid='<video_id>' --text='<text>'
import urllib
import json
import httplib2
import os
import sys
import csv
import copy
keyFile = open('key.txt', 'r')
apiKey = keyFile.readline()
keyFile.close()
def getComm... | ZackAkil/Data-Science-Meetup-Predicting-Trolls | YouTube Comment Collector.py | Python | mit | 2,537 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# DChars Copyright (C) 2012 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of DChars.
# DChars is free software: you can redistribute it and/or modify
# ... | suizokukan/anceps | dchars/symbols/symbols.py | Python | gpl-3.0 | 1,292 |
from __future__ import absolute_import
import os.path
import requests
import wtforms
from wtforms import validators
from ..forms import TextDatasetForm
from origae import utils
from origae.utils.forms import validate_required_iff, validate_greater_than
class TextClassificationDatasetForm(TextDatasetForm):
"""
... | winnerineast/Origae-6 | origae/dataset/text/classification/forms.py | Python | gpl-3.0 | 14,708 |
# Lint as: python2, python3
# Copyright 2020 Google LLC. 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 req... | GoogleCloudPlatform/mlops-on-gcp | immersion/guided_projects/guided_project_1_solution/models/keras/model.py | Python | apache-2.0 | 8,221 |
#! python
# -*- coding: UTF-8 -*-
import unittest
from time import sleep
import requests
import json
import cloudinary
import cloudinary.uploader
import img_processing
DEF_IMG_DIR = r'./resources'
class ImgProcessingTestsServerBasics(unittest.TestCase):
def setUp(self):
self.url = "http://localhost:4342/... | valsallop/mii-1516-g1 | Analytics/BarcodeProcessing/tests/server_test.py | Python | mit | 6,003 |
import cv2
import glob
import os
import sys
import functions as fs
import postgres as po
#names = fs.createFileNameList("/home/andreas/Projekte/test-data/")
#def main(name):
#name = name + '/'
#fs.createTempData('data/' + name)
##fs.createTempData('data/historical/')
#recent = fs.createFileNameList... | MacAndrews21/map_weather | py/main.py | Python | apache-2.0 | 3,038 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class ProjectIssue(models.Model):
_inherit = 'project.issue'
@api.depends('category_id.name')
def _compute_category_name(self):
if self.category_id:
self.category_name = self.category_id.name
@api.depends('active')
... | nemanja-d/odoo_project_extensions | project_task_issues/models/issue.py | Python | gpl-3.0 | 1,139 |
# Copyright 2012 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 agre... | zenlambda/aeta | tests/unit_and_e2e/test_task_deferred.py | Python | apache-2.0 | 4,046 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('departamentos', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='departamento',
na... | acs-um/deptos | deptos/departamentos/migrations/0002_departamento_estado.py | Python | apache-2.0 | 403 |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | tonybaloney/st2 | st2api/st2api/controllers/v1/rbac.py | Python | apache-2.0 | 4,672 |
from _printingUtils import printInfo
from _printingUtils import printErr
def binningMapFromArgList(argList):
binningMap = {}
if argList:
for binArg in argList:
try:
splitUp = binArg.split(";")
if len(splitUp)==3:
binningMap[splitUp[0]] = (float(splitUp[1]), float(splitUp[2]))
printInfo("adding... | legordian/ROOTPWA | pyInterface/module/utils/_binningMapFromArgList.py | Python | gpl-3.0 | 696 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Auxiliary script used to allocate memory on guests.
@copyright: 2008-2009 Red Hat Inc.
@author: Jiri Zupka (jzupka@redhat.com)
"""
import os, array, sys, random, copy, tempfile, datetime, math
PAGE_SIZE = 4096 # machine page size
TMPFS_OVERHEAD = 0.0022 # overhead on 1... | sathnaga/virt-test | shared/scripts/ksm_overcommit_guest.py | Python | gpl-2.0 | 7,629 |
__all__ = [
'LoggingPlugin',
]
from logging import getLogger
from lxml import etree
from zeep import Plugin
_logger = getLogger(__name__)
class LoggingPlugin(Plugin):
def ingress(self, envelope, http_headers, operation):
_logger.debug('http_headers: %s', http_headers)
_logger.debug('operat... | calidae/python-aeat_sii | src/pyAEATsii/plugins.py | Python | apache-2.0 | 818 |
"""Provide access to Python's configuration information.
"""
import sys
import os
from os.path import pardir, realpath
_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{base}/lib/python{py_version_short}',
'platstdlib': '{platbase}/lib/python{py_version_short}',
'purelib': '{ba... | nmercier/linux-cross-gcc | win32/bin/Lib/sysconfig.py | Python | bsd-3-clause | 23,180 |
#
# Copyright 2012 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | pkilambi/ceilometer | ceilometer/image/notifications.py | Python | apache-2.0 | 3,994 |
# -*- coding: utf-8 -*-
""" Python KNX framework
License
=======
- B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright:
- ยฉ 2016-2017 Matthias Urlichs
- PyKNyX is a fork of pKNyX
- ยฉ 2013-2015 Frรฉdรฉric Mantegazza
This program is free software; you can redistribute it and/or modify
it under the terms ... | knxd/pKNyX | pyknyx/core/ets.py | Python | gpl-3.0 | 13,489 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from django import forms
from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
from django.contrib.au... | franga2000/django-machina | machina/apps/forum/admin.py | Python | bsd-3-clause | 18,448 |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# This is a nullcontext for both sync and async. 3.7 has a nullcontext,
# but it is only for sync use.
class NullContext:
def __init__(self, enter_result=None):
self.enter_result = enter_result
def __enter__(self):
r... | 4shadoww/usploit | lib/dns/_asyncbackend.py | Python | mit | 1,563 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
#Importar libreria GPIO
import RPi.GPIO as GPIO
#Definir modo de trabajo para la placa BCM
GPIO.setmode(GPIO.BCM)
#Desactivo Errores
GPIO.setwarnings(False)
#Importamos la libreria time
import time
#Importamos la libreria para comandos de la consola/shell
import os
#Cr... | fryntiz/Raspberry-PI | Obsoleto/Web Administraciรณn Raspberri PI/GPIO/11/parpadear.py | Python | gpl-3.0 | 1,552 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Daniele Simonetti
#
# 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.
#
# Thi... | Kaniabi/l5r-character-manager-3 | l5r/models/skillmodel.py | Python | gpl-3.0 | 4,864 |
def test_draft_page_details(client, admin_client, page):
page.is_published = False
page.save()
page_url = page.get_absolute_url()
response = client.get(page_url)
assert response.status_code == 404
response = admin_client.get(page_url)
assert response.status_code == 200
def test_public_page... | UITools/saleor | tests/test_page.py | Python | bsd-3-clause | 553 |
# Copyright (C) 2013-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but... | nuxeh/morph | morphlib/morphloader.py | Python | gpl-2.0 | 27,674 |
# Read image
import os
import cv2
import numpy as np
import pandas as pd
from plantcv.plantcv import fatal_error
from plantcv.plantcv import params
from plantcv.plantcv.hyperspectral import read_data
from plantcv.plantcv._debug import _debug
def readimage(filename, mode="native"):
"""Read image from file.
I... | danforthcenter/plantcv | plantcv/plantcv/readimage.py | Python | mit | 1,682 |
"""Consts for Cast integration."""
DOMAIN = "cast"
| fbradyirl/home-assistant | homeassistant/components/cast/const.py | Python | apache-2.0 | 52 |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import pytest
from .. import Backend
from . import AVAILABLE_BACKENDS
@pytest.mark.parametrize('key', AVAILABLE_BACKENDS)
def test_Dummy(key):
be = Backend(key)
d0 = be.Dummy()
d1 = be.Dummy()
assert d0 == d0
... | bjodah/sym | sym/tests/test_Dummy.py | Python | bsd-2-clause | 339 |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout
from .utils import first_season, current_season
from .models import Function, Rate
class AdhesionsForm(forms.Form):
season_choices = [
(i, "{}/{}".format(i - 1, i))
for i in range(current_sea... | eedf/jeito | members/forms.py | Python | mit | 1,681 |
# partial Game class
from .util import _neighbourhood
def _resolveBattle(self):
# calculate the battles
for obj in self.objects:
if obj.CanAttack:
obj.enemies = []
for enemy in self._neighbours(obj.x, obj.y, obj.AttackRange):
if enemy.TakesDamage and \
... | amatveyakin/underworld | gameengine/battle.py | Python | gpl-2.0 | 920 |
import os
BOT_NAME = 'harvest'
SPIDER_MODULES = ['harvest.spiders']
NEWSPIDER_MODULE = 'harvest.spiders'
DOWNLOAD_DELAY = 3
CONCURRENT_REQUESTS = 4
COOKIES_ENABLED = False
_src = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
_target = os.path.join(os.path.dirname(_src), 'target')
JOBDIR = os.path.join... | neysofu/qetesh | src/harvest/settings.py | Python | mit | 404 |
from datetime import date
from django.test.client import RequestFactory
from django.test.testcases import TestCase
from nepi.main.tests.factories import SchoolGroupFactory, \
StudentProfileFactory, ICAPProfileFactory, TeacherProfileFactory, \
InstitutionAdminProfileFactory, CountryAdministratorProfileFactory
fr... | coati-00/nepi | nepi/main/tests/test_reports.py | Python | gpl-2.0 | 8,201 |
"""
.. module:: edit_work
The **Edit Work** Model.
PostgreSQL Definition
---------------------
The :code:`edit_work` table is defined in the MusicBrainz Server as:
.. code-block:: sql
CREATE TABLE edit_work
(
edit INTEGER NOT NULL, -- PK, references edit.id
work ... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/models/edit_work.py | Python | gpl-2.0 | 955 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | dtroyer/python-openstacksdk | openstack/baremetal_introspection/v1/_proxy.py | Python | apache-2.0 | 6,370 |
import os
__version__ = "1.0." + os.environ.get('BUILD_NUMBER', '0').strip()
| mojn/voldemort-python | jvoldemort/__version__.py | Python | apache-2.0 | 77 |
import _plotly_utils.basevalidators
class RowValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="row", parent_name="layout.geo.domain", **kwargs):
super(RowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/layout/geo/domain/_row.py | Python | mit | 478 |
def sign(x):
"""Double -> Int"""
if (x > 0):
return 1
else:
return -1
| hsinhuang/codebase | ntumlone-002/RidgeReg/src/main/python/common.py | Python | gpl-2.0 | 77 |
# Generated by Django 2.1.2 on 2018-11-08 18:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0163_auto_20181106_1416'),
]
database_operations = [
]
state_operations = [
migrations.DeleteModel('DataAnalysisLevel'... | pbanaszkiewicz/amy | amy/workshops/migrations/0164_remove_nonversioned_models.py | Python | mit | 1,167 |
# surveysetup.py
# ALS 2017/05/03
# """
# survey info
# """
import astropy.units as u
surveybands = {
'sdss':['u','g','r','i','z'],
'hsc': ['g','r','i','z','y'],
'ukirt': ['j', 'h', 'k'],
'cfht': ['u']
}
pixsize = {'sdss': 0.396 * u.ar... | aileisun/bubbleimg | bubbleimg/filters/surveysetup.py | Python | mit | 508 |
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARRANTY, without impl... | CalthorpeAnalytics/urbanfootprint | footprint/main/publishing/feature_publishing.py | Python | gpl-3.0 | 3,705 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | tejaswi2492/pmip6ns3.13new | src/tools/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 172,830 |
import numpy as np
from math import pi, log
import pylab
from scipy import fft, ifft
from scipy.optimize import curve_fit
from numpy import array
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 *
np.random.randn(i))
def _datacheck_peakdetect(x_axis, y_... | mailhexu/pyDFTutils | pyDFTutils/math/peakdetect.py | Python | lgpl-3.0 | 27,246 |
from .primitives import String
class Enum(String):
_enum = None
def _validate(self):
assert self in self._enum, (self, self._enum)
def make_enum(enum):
enum = tuple([String(e) for e in enum])
classname = "Enum"+str(enum)
return type(classname, (Enum,), {"_enum": enum})
| sjdv1982/seamless | docs/archive/spyder-like-silk/classes/enum.py | Python | mit | 300 |
# Standard library imports
from io import BytesIO
# Django & Tastypie imports
from django.utils.encoding import force_unicode
from tastypie.bundle import Bundle
from tastypie.serializers import Serializer, get_type_string
# External imports
import defusedxml.lxml as lxml
from lxml.etree import Element, tostring, Lxm... | gmimano/commcaretest | corehq/apps/api/serializers.py | Python | bsd-3-clause | 4,533 |
from mk2.plugins import Plugin
from mk2.events import UserInput
class Su(Plugin):
command = Plugin.Property(default="sudo -su {user} -- {command}")
mode = Plugin.Property(default="include")
proc = Plugin.Property(default="ban;unban")
def setup(self):
self.register(self.uinput, UserInput)
... | frostyfrog/mark2 | mk2/plugins/su.py | Python | mit | 649 |
import argparse
import json
from yatcobot.client import TwitterClient
from yatcobot.config import TwitterConfig, Config
parser = argparse.ArgumentParser(description='Download a tweet to json')
parser.add_argument('tweet_id', metavar='id', type=int)
parser.add_argument('--config', '-c', dest='config', default='../confi... | buluba89/Yatcobot | utils/download_tweet.py | Python | gpl-2.0 | 789 |
#!/usr/bin python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| lqdc/okstereotype | manage.py | Python | bsd-3-clause | 245 |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.actions import Action
from c7n.filters import CrossAccountAccessFilter
from c7n.query import QueryResourceManager, TypeInfo
from c7n.manager import resources
from c7n.utils import type_schema, local_session
@resources.register('... | thisisshi/cloud-custodian | c7n/resources/sar.py | Python | apache-2.0 | 2,779 |
import os
from os.path import join as joinpath, exists
import pickle
import sys
from scrapy import Request
from time import time, sleep
from scrapy.pipelines.images import ImagesPipeline
import logging as log
from imagebot.items import ImageItem
from imagebot.settings import settings
from imagebot.dbmanager import DBM... | amol9/imagebot | imagebot/pipelines.py | Python | mit | 2,856 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('schedule', '0001_initial')]
operations = [
migrations.AlterField(model_name='day',
name='date',
field=models.DateFiel... | jacobajit/ion | intranet/apps/schedule/migrations/0002_auto_20150606_2057.py | Python | gpl-2.0 | 610 |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | foursquare/commons-old | src/python/twitter/common/java/method_info.py | Python | apache-2.0 | 5,029 |
# -*- coding: utf-8 -*-
import xml.dom.minidom as dom
from module.plugins.internal.Account import Account
class RealdebridCom(Account):
__name__ = "RealdebridCom"
__type__ = "account"
__version__ = "0.50"
__status__ = "testing"
__config__ = [("mh_mode" , "all;listed;unlisted", "Filter... | jansohn/pyload | module/plugins/accounts/RealdebridCom.py | Python | gpl-3.0 | 1,932 |
"""SCons.Tool.msvs
Tool-specific initialization for Microsoft Visual Studio project files.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is... | IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | staging_dir/host/lib/scons-2.3.5/SCons/Tool/msvs.py | Python | gpl-2.0 | 81,268 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | sebrandon1/tempest | tempest/api/orchestration/stacks/test_nova_keypair_resources.py | Python | apache-2.0 | 4,088 |
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import os
from os.path import abspath, normpath, join, expanduser, isdir, dirname
from ranger import PY3
from ranger.container ... | ranger/ranger | ranger/core/tab.py | Python | gpl-3.0 | 6,924 |
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 vers... | NcLang/vimrc | sources_non_forked/YouCompleteMe/python/ycm/diagnostic_interface.py | Python | mit | 9,546 |
# -*- coding: utf-8 -*-
{
"name": "good_process",
"version": '11.11',
"author": 'ไธๆตทๅผ้่ฝฏไปถๆ้ๅ
ฌๅธ',
"website": "http://www.osbzr.com",
"category": "gooderp",
"description": """
ๅฏ้
็ฝฎ็ๅฎกๆนๆต็จ
""",
"data": [
'data/data.xml',
'views/good_process.xml',
'security/ir.model.acc... | luoguizhou/gooderp_addons | good_process/__manifest__.py | Python | agpl-3.0 | 475 |
import re, time, os, shutil, string
from subprocess import Popen, PIPE, STDOUT
from random import randint, seed
__all__ = ['find', 'removedirs', 'source', 'tempfile', 'copy', 'rm', 'template, template_dir']
def find(path='.', regex='*', ctime=0):
r = []
regex = str(regex).strip()
if regex == '*': regex = ... | raphaelvalentin/Utils | functions/system.py | Python | gpl-2.0 | 3,297 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@ecdsa.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... | wozz/electrum-myr | lib/blockchain.py | Python | gpl-3.0 | 17,464 |
#
# Copyright (c) 2015 Autodesk 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 l... | autodesk-cloud/ochopod | ochopod/bindings/ec2/marathon.py | Python | apache-2.0 | 1,792 |
"""CactusBot."""
from .cactus import run, __version__
__all__ = ["__version__", "run"]
| CactusBot/CactusBot | cactusbot/__init__.py | Python | gpl-3.0 | 89 |
#!/usr/bin/env python
import sys, os.path, math, fnmatch
from glob import glob
import optparse
from popGraphUtil import plotFromCSV, plotFromAll
parser = optparse.OptionParser(" [options] csv-file chart-file")
parser.add_option("", "--xlim", dest="xlim", help="cut off X-axis at this point", default =... | danieljue/beast-mcmc | doc/tutorial/EBSP/scripts/popGraphFromCSV.py | Python | lgpl-2.1 | 4,725 |
from batchq.contrib.alps.tools import *
| troelsfr/BatchQ | batchq/contrib/alps/__init__.py | Python | mit | 41 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Nicu Tofan <nicu.tofan@gmail.com>
"""
from os import path
from PyQt4 import QtGui
def center(widget):
"""
Place a widget at the center of the screen.
Parameters
----------
widget : PyQt4.QtGui.QWidget
The panel to center on the sc... | TNick/pyl2extra | pyl2extra/gui/guihelpers.py | Python | bsd-3-clause | 1,801 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google-research/google-research | hal/agent/UVFA_repr/uvfa_state.py | Python | apache-2.0 | 15,278 |
import gethex
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "\n".join(gethex.get_hexes())
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)
| samphippen/gethex | app.py | Python | mit | 312 |
"""
Development settings
Data is kept within the project directory
(initialize as required, e.g. by copying initial testdata).
Service configuration is kept under personal home directory to
protect secret keys, etc.
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_f... | gklyne/annalist | src/annalist_root/annalist_site/settings/devel.py | Python | mit | 1,731 |
# -*- 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):
# Changing field 'Profile.drive_token'
db.alter_column(u'user_profile', 'drive_token', self.gf('django.db.m... | taikoa/wevolver-server | wevolve/users/migrations/0010_auto__chg_field_profile_drive_token.py | Python | agpl-3.0 | 7,803 |
# Copyright 2016 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 app... | LevinJ/SSD_tensorflow_VOC | exercise/convert_flowers.py | Python | apache-2.0 | 7,755 |
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
class AccountUpdateLockDate(models.TransientModel):
_name = 'account.update.lock_date'
_description = 'Account Update Lock_... | ddico/account-financial-tools | account_lock_date_update/wizards/account_update_lock_date.py | Python | agpl-3.0 | 1,940 |
"""This file tests internal details of AndroidPlatform. These are not part of the public API,
and should not be accessed or relied upon by user code.
"""
import calendar
from contextlib import contextmanager
import imp
from importlib import import_module, metadata, reload, resources
import importlib.util
from importli... | chaquo/chaquopy | app/src/main/python/chaquopy/test/test_android.py | Python | mit | 52,023 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
# Check that the test directories exist
if not os.path.exists(os.path.join(
os.path.dirname(__file__), 'baseline_images')):
raise IOError(
'The baseline image directory does not ... | jonyroda97/redbot-amigosprovaveis | lib/mpl_toolkits/tests/__init__.py | Python | gpl-3.0 | 491 |
#coding=utf-8
#author='Shichao-Dong'
import os,sys
from appium import webdriver
import time
import public
import unittest
class test(unittest.TestCase):
'''
้ๆบๆต่ฏ
'''
@classmethod
def setUpClass(cls):
# os.system('start D:\Ptest\Appium\Testcase\startAppiumServer.bat')
time.sleep(8)
... | NJ-zero/Android | Appium/Testcase/appiumlearn.py | Python | mit | 1,013 |
from moha.system.periodic import load_periodic
from moha.system.molecule import Atom,Molecule
def load_xyz(filename):
'''Load a molecular geometry from a .xyz file.
**Argument:**
filename
The file to load the geometry from
**Returns:** dictionary with ``title`, ``coordinates`` a... | fhqgfss/MoHa | moha/io/iogeometry.py | Python | mit | 826 |
from django.conf import settings
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from views import HomeView
admin.autodiscover()
urlpatterns = patterns('',
# Uncomment the admin/doc line below to enable admin documentation... | PragmaticMates/django-trustpay | example/example/urls.py | Python | bsd-3-clause | 690 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from benchmarks import silk_flags
import ct_benchmarks_util
from measurements import smoothness
import page_sets
from teleme... | danakj/chromium | tools/perf/benchmarks/repaint.py | Python | bsd-3-clause | 2,839 |
# -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
โกโกโก Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | abhinavsingh/proxy.py | proxy/core/tls/types.py | Python | bsd-3-clause | 1,152 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2019 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... | unioslo/cerebrum | contrib/no/uit/export_oid.py | Python | gpl-2.0 | 24,508 |
import web
urls = (
"/", "index"
)
class index :
def GET(self) :
return "Hello, world!"
if __name__ == "__main__" :
app = web.application(urls, globals())
app.run()
| peifu/tests | python/web/web.py | Python | gpl-2.0 | 192 |
# Copyright (C) 2002-2003, 2006, 2009 The Written Word, Inc.
# Copyright (C) 2000-2001 The Written Word, LLC
#
# 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, or (at your optio... | tjyang/sbutils | lib/depot/https.py | Python | gpl-2.0 | 1,647 |
import mongoengine as me
from . import MongoDBAccess
from .base import AsloBaseModel
class ReleaseModel(AsloBaseModel):
meta = {'collection': 'release'}
activity_version = me.FloatField(required=True)
release_notes = me.StringField(required=True)
min_sugar_version = me.FloatField(required=True)
#... | jatindhankhar/aslo-v3 | aslo/models/release.py | Python | mit | 747 |
#!/usr/bin/env python
################################################################################
#
# Project Euler - Problem 13
#
# Work out the first ten digits of the sum of the following one-hundred
# 50-digit numbers.
#
# 37107287533902102798797998220837590246510135740250
# 4637693767749000971264812489697007... | carrdelling/project_euler | problem13.py | Python | gpl-2.0 | 12,755 |
import tensorflow as tf
import numpy as np
import time
import h5py
# import matplotlib.pyplot as plt
# from sklearn.metrics import confusion_matrix
# import itertools
# from copy import deepcopy
# import os
# import os.path
from collections import OrderedDict
# import pickle
from itertools import islice
# NOTE: For ... | HoliestCow/ece692_deeplearning | project5/gru/crnn.py | Python | mit | 24,157 |
# try:
import math
# except ImportError as message:
# raise SystemExit(message)
class Vec2D:
"""2d vector class
Supports the most common unary and binary scalar and vector operators,
appart from cross product.
"""
def __init__(self, x_or_pair=0, y=None):
if y is None:
s... | DanailKoychev/Cronch-game | vec2d.py | Python | gpl-3.0 | 5,505 |
import numpy as np
from holoviews.element import Labels, Tiles
from .test_plot import TestPlotlyPlot
class TestLabelsPlot(TestPlotlyPlot):
def test_labels_state(self):
labels = Labels([(0, 3, 0), (1, 2, 1), (2, 1, 1)])
state = self._get_plot_state(labels)
self.assertEqual(state['data'][... | ioam/holoviews | holoviews/tests/plotting/plotly/test_labelplot.py | Python | bsd-3-clause | 5,697 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... | pozdnyakov/chromium-crosswalk | tools/licenses.py | Python | bsd-3-clause | 17,080 |
# -*- coding: utf-8 -*-
import numpy as np
import numpy.random as random
# ่ฎพ็ฝฎ้ๆบๆฐ็งๅญ
random.seed(42)
# ไบง็ไธไธช1x3๏ผ[0,1)ไน้ด็ๆตฎ็นๅ้ๆบๆฐ
# array([[ 0.37454012, 0.95071431, 0.73199394]])
# ๅ้ข็ไพๅญๅฐฑไธๅจๆณจ้ไธญ็ปๅบๅ
ทไฝ็ปๆไบ
random.rand(1, 3)
# ไบง็ไธไธช[0,1)ไน้ด็ๆตฎ็นๅ้ๆบๆฐ
random.random()
# ไธ่พน4ไธชๆฒกๆๅบๅซ๏ผ้ฝๆฏๆ็
งๆๅฎๅคงๅฐไบง็[0,1)ไน้ด็ๆตฎ็นๅ้ๆบๆฐarray
random... | qiudebo/13learn | code/stat/stat_random.py | Python | mit | 1,303 |
# Copyright 2016 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 applicable ... | ybao2016/tf-slim-model | eval_image_classifier.py | Python | apache-2.0 | 7,003 |
"""
STORAGE: classes and functions for model persistence.
"""
__author__ = 'vlad'
"""
From http://code.activestate.com/recipes/576642/
"""
import pickle, json, csv, os, shutil
class ModelPersistence(dict):
""" Persistent dictionary with an API compatible with shelve and anydbm.
The dict is kept in memory... | higex/qpath | util/storage.py | Python | mit | 2,795 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.