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 |
|---|---|---|---|---|---|---|
import random
import unittest
import six
import os
import sys
import pyrtl
import pyrtl.corecircuits
import pyrtl.helperfuncs
from pyrtl.rtllib import testingutils as utils
# ---------------------------------------------------------------
class TestWireVectorList(unittest.TestCase):
def setUp(self):
pas... | UCSBarchlab/PyRTL | tests/test_helperfuncs.py | Python | bsd-3-clause | 47,619 | 0.001638 |
"""
yubistack.exceptions
~~~~~~~~~~~~~~~~~~~~
List all custom exceptions here
"""
STATUS_CODES = {
# YKAuth
'BAD_PASSWORD': 'Invalid password',
'DISABLED_TOKEN': 'Token is disabled',
'UNKNOWN_USER': 'Unknown user',
'INVALID_TOKEN': 'Token is not associated with user',
# YKVal
'BACKEND_ERR... | oriordan/yubistack | yubistack/exceptions.py | Python | bsd-2-clause | 1,873 | 0.003737 |
"""
.. _xarray.Dataset: http://xarray.pydata.org/en/stable/data-structures.html#dataset
.. _xarray.DataArray: http://xarray.pydata.org/en/stable/data-structures.html#dataarray
.. _Numpy: http://www.numpy.org/
The following functions provide the high-level API of the ESDC Python DAT.
It provides additional analytical u... | CAB-LAB/cablab-core | esdl/dat.py | Python | gpl-3.0 | 3,600 | 0.003611 |
class Solution:
def translateNum(self, num: int) -> int:
if num < 10:
return 1
table = {}
for i in range(26):
table[str(i)] = chr(ord('a') + i)
num_str = str(num)
arr = []
def solve(eated, s, last):
if not s:
arr.... | fy0/my-leetcode | 990.Satisfiability Of Equality Equations/main.py | Python | apache-2.0 | 674 | 0.001484 |
#-*- coding:utf-8 -*-
import logging
logging.basicConfig(level=logging.ERROR)
from cache_abstract import CacheAbstractDriver
import asyncio
try:
import redis
except ImportError:
logging.error("Can't import 'redis' module")
exit(-1)
try:
import aioredis
except ImportError:
logging.error("Can't import... | free-free/pyblog | pyblog/cache/redis_cache.py | Python | mit | 13,227 | 0.001285 |
"""
SALTS XBMC Addon
Copyright (C) 2016 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | felipenaselva/repo.felipe | plugin.video.salts/salts_lib/worker_pool.py | Python | gpl-2.0 | 4,999 | 0.006001 |
__author__ = 'fahadadeel'
from setuptools import setup, find_packages
setup(
name = 'aspose-cells-java-for-python',
packages = find_packages(),
version = '1.0',
description = 'Aspose.cells Java for Python is a project that demonstrates / provides the Aspose.Cells for Java API usage examples in Python.... | fahadadeel/Aspose.Cells-for-Java | Plugins/Aspose-Cells-Java-for-Python/setup.py | Python | mit | 705 | 0.014184 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
import asyncore
from datetime import datetime, timedelta
import socket
import os
import sys
from time import sleep
from... | lucashmorais/x-Bench | mozmill-env/python/Lib/site-packages/jsbridge/__init__.py | Python | mit | 1,601 | 0 |
#encoding=utf-8
from app.proto.common.data_parse import hex_to_dec, dec_to_hex
from app.proto.common.hachi.core import XBee
from app.proto.frames.RFIDFrames import rfid_frame
class RFIDController:
def __init__(self, escaped=True):
# self.xbee = XBee()
pass
def parse_pkgs(self, byte... | kooksee/TIOT | test/project/src/app/proto/controller/RFIDController.py | Python | gpl-2.0 | 4,692 | 0.002081 |
"""RFC 6962 client API."""
from ct.client import log_client
from ct.client.db import database
import gflags
import logging
import random
from twisted.internet import defer
from twisted.internet import error
from twisted.internet import protocol
from twisted.internet import reactor as ireactor
from twisted.internet im... | lexibrent/certificate-transparency | python/ct/client/async_log_client.py | Python | apache-2.0 | 18,435 | 0.000868 |
#!/usr/bin/python
# Copyright 2013 Sumana Harihareswara
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This progra... | brainwane/carmen | carmen.py | Python | gpl-3.0 | 6,748 | 0.0123 |
import femagtools
import importlib
import os
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(message)s')
models = ['statorBG-magnetSector',
'stator1-magnetIron3',
'stator1-magnetIron4',
'stator1-magnetIron5',
'stator1-magnetIronV'... | SEMAFORInformatik/femagtools | examples/model-creation/createall.py | Python | bsd-2-clause | 886 | 0.001129 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) Camptocamp SA
# Author: Arnaud WÃŒst
#
#
# This file is part of the c2c_report_tools module.
#
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the w... | VitalPet/c2c-rd-addons | c2c_reporting_tools_chricar/core/__init__.py | Python | agpl-3.0 | 1,404 | 0.000713 |
from _external import *
fontconfig = LibWithHeaderChecker('fontconfig', 'fontconfig/fontconfig.h', 'c')
| tuttleofx/sconsProject | autoconf/fontconfig.py | Python | mit | 105 | 0 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Attendance Status')
class TestAttendanceStatus(unittest.TestCase):
pass
| shitolepriya/Saloon_erp | erpnext/hr/doctype/attendance_status/test_attendance_status.py | Python | agpl-3.0 | 299 | 0.006689 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | stdweird/aquilon | lib/python2.6/aquilon/worker/commands/update_interface_machine.py | Python | apache-2.0 | 7,493 | 0.000801 |
import sys
from cli_client import APP_KEY, APP_SECRET, DropboxTerm
def main(path):
if APP_KEY == '' or APP_SECRET == '':
exit("You need to set your APP_KEY and APP_SECRET!")
term = DropboxTerm(APP_KEY, APP_SECRET)
if path != "":
term.do_cd(path)
term.do_ls()
if __name__ == '__main__':... | astrieanna/haiku-dropbox-client | db_ls.py | Python | mit | 476 | 0.004202 |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 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.
import os
import re
from contextlib import contextmanager
from uuid import uuid4
from flask import Bluepr... | indico/indico | indico/web/flask/wrappers.py | Python | mit | 9,269 | 0.001834 |
#!/usr/bin/env python
import roslib; roslib.load_manifest('articulation_tutorials')
import rospy
import numpy
from articulation_msgs.msg import *
from articulation_msgs.srv import *
from geometry_msgs.msg import Pose, Point, Quaternion
from sensor_msgs.msg import ChannelFloat32
PRISMATIC = 0
ROTATIONAL = 1
MODELS={... | tum-vision/articulation | articulation_tutorials/python_service_client/model_selection_client.py | Python | bsd-2-clause | 1,925 | 0.038961 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import creditpiggy.core.models
class Migration(migrations.Migration):
dependencies = [
('core', '0014_auto_20150616_1247'),
('api', '0001_initial'),
]
operations = [
migratio... | wavesoft/creditpiggy | creditpiggy-server/creditpiggy/api/migrations/0002_projectcredentials_websitecredentials.py | Python | gpl-2.0 | 1,466 | 0.003411 |
#!/usr/bin/python
from __future__ import print_function
import sys
import re
import yaml
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
class DataBaseModelProcessor(object):
def __init__(self):
self.db_models = {}
def add_model(self, model):
self.data = model... | iawells/gluon | gluon/common/particleGenerator/DataBaseModelGenerator.py | Python | apache-2.0 | 6,227 | 0.000803 |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.forms.models import (
inlineformset_factory,
ModelForm, ModelFormMetaclass,
)
from django.utils import six
class InlineModelFormMetaclass(ModelFormMetaclass):
def __new__(cls, name, bases, attrs):
options = attrs.get('Me... | samuelmaudo/yepes | yepes/forms/inline_model.py | Python | bsd-3-clause | 2,021 | 0.000495 |
# Generated by h2py from /usr/include/netinet/in.h
_NETINET_IN_H = 1
# Included from features.h
_FEATURES_H = 1
_ISOC95_SOURCE = 1
_ISOC99_SOURCE = 1
_ISOC11_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 200809L
_XOPEN_SOURCE = 700
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_DEFAULT_SOURCE = 1
_BSD_SOURCE = 1... | gautamMalu/rootfs_xen_arndale | usr/lib/python2.7/plat-arm-linux-gnueabihf/IN.py | Python | gpl-2.0 | 15,532 | 0.009207 |
import pytest
from megaradrp.processing.fibermatch import generate_box_model
from megaradrp.processing.fibermatch import count_peaks
PEAKS = [
3.806000000000000000e+03,
3.812000000000000000e+03,
3.818000000000000000e+03,
3.824000000000000000e+03,
3.830000000000000000e+03,
3.8360000000000000... | sergiopasra/megaradrp | megaradrp/processing/tests/test_fibermatch.py | Python | gpl-3.0 | 2,099 | 0.000953 |
from PIL import Image, ImageFont
from handright import Template, handwrite
text = "啊啊啊啊巴巴爸爸啛啛喳喳顶顶顶顶柔柔弱弱共和国刚刚\n\r 顶顶顶顶灌灌灌灌哈哈哈哈斤斤计较坎坎坷坷啦啦啦啦噢噢噢噢噗噗噗噗噗"
template = Template(
background=Image.new(mode="1", size=(3300, 1000), color=1),
font=ImageFont.truetype("C:\\font\\MiNiJianJiaShu-1.ttf", size=150),
... | a67878813/script | handwrite.py | Python | apache-2.0 | 765 | 0.023112 |
from flask import Flask, request, g, session, redirect, abort, Response
from datetime import datetime
from functools import wraps
import base64
app = Flask(__name__)
app.config.from_envvar('WEB_CONF')
def authenticate(f):
@wraps(f)
def wrapper(*args, **kwargs):
v = request.headers.get('authorization')
... | alexmilowski/duckpond | duckpond/apps/service/app.py | Python | apache-2.0 | 1,161 | 0.023256 |
"""Models for the ``feedback_form`` app."""
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translatio... | bitmazk/django-feedback-form | feedback_form/models.py | Python | mit | 2,071 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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',
... | Russell-IO/ansible | lib/ansible/modules/network/netscaler/netscaler_gslb_service.py | Python | gpl-3.0 | 24,020 | 0.002748 |
import scrapy
import xml.etree.ElementTree as ET
from locations.items import GeojsonPointItem
URL = 'http://hosted.where2getit.com/auntieannes/2014/ajax?&xml_request=%3Crequest%3E%3Cappkey%3E6B95F8A2-0C8A-11DF-A056-A52C2C77206B%3C%2Fappkey%3E%3Cformdata+id%3D%22locatorsearch%22%3E%3Cdataview%3Estore_default%3C%2Fdat... | iandees/all-the-places | locations/spiders/aunt_annes.py | Python | mit | 10,953 | 0.006665 |
# -*- encoding: utf-8 -*-
from abjad.tools import sequencetools
from abjad.tools import datastructuretools
from abjad.tools import selectiontools
from abjad.tools.abctools import AbjadValueObject
class CountsSelectorCallback(AbjadValueObject):
r'''A counts selector callback.
::
>>> callback = select... | mscuthbert/abjad | abjad/tools/selectortools/CountsSelectorCallback.py | Python | gpl-3.0 | 3,980 | 0.001508 |
import os
from mutagen.dsdiff import DSDIFF, IffError
from tests import TestCase, DATA_DIR, get_temp_copy
class TDSDIFF(TestCase):
silence_1 = os.path.join(DATA_DIR, '2822400-1ch-0s-silence.dff')
silence_2 = os.path.join(DATA_DIR, '5644800-2ch-s01-silence.dff')
silence_dst = os.path.join(DATA_DIR, '564... | quodlibet/mutagen | tests/test_dsdiff.py | Python | gpl-2.0 | 2,668 | 0 |
from django.shortcuts import render, render_to_response
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.core.urlresolvers import reverse
from blogs.models import Post
from django.http import Http404
def postlist(request):
posts = Post.objects.all().order_by("-created")
paginator... | babraham123/mysite | blogs/views.py | Python | mit | 842 | 0.004751 |
#!/usr/bin/python
import sys
a = int(raw_input().strip())
b = int(raw_input().strip())
print (a / b)
print (float(a) / float(b))
| nabin-info/hackerrank.com | python-division.py | Python | mit | 132 | 0.015152 |
# vim: fileencoding=UTF-8:expandtab:autoindent:ts=4:sw=4:sts=4
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# To import from calibre, some things need to be added to `sys` first. Do not import
# anything from calibr... | NiLuJe/calibre-kobo-driver | tests/test_common.py | Python | gpl-3.0 | 4,914 | 0.001231 |
# Visualize node graph
# Copyright 2013 Victor Lavrentev
import matplotlib.pyplot as plt
import json, sys
import networkx as nx
from node_lib import graph
print '\nNode image tools (Visualize node graph) v01a\n'
try:
file_node=sys.argv[1]
except:
print '->Error. No script'
sys.exit (0)
w... | shrimo/node_image_tools | node_graph.py | Python | gpl-3.0 | 3,999 | 0.021505 |
# coding:utf-8
import url_manager, html_downloader, html_parser, html_outputer
import traceback
import iMessage
class Crawl(object):
def __init__(self):
self.urls = url_manager.UrlManager()
self.downloader = html_downloader.HtmlDownloader()
self.parser = html_parser.HtmlParser()
sel... | newbee-7/News_Crawl | crawl.py | Python | mit | 1,994 | 0.008024 |
# 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.
import unittest
from telemetry import browser_finder
from telemetry import options_for_unittests
class TabTestCase(unittest.TestCase):
def __init__(se... | nacl-webkit/chrome_deps | tools/telemetry/telemetry/tab_test_case.py | Python | bsd-3-clause | 1,243 | 0.011263 |
import hashlib
import json
import sys
import traceback
from datetime import datetime, timedelta
from functools import wraps
from uuid import uuid4
import newrelic.agent
import waffle
from constance import config
from django.apps import apps
from django.conf import settings
from django.core.exceptions import Validation... | jgmize/kuma | kuma/wiki/models.py | Python | mpl-2.0 | 73,565 | 0.00015 |
# -*- coding: utf-8 -*-
from django.shortcuts import render
from units.models import Unit
def startpage(request):
"""Start page.
Shows list of units available for statistics/filtering.
"""
units = Unit.objects.all()
# t = loader.get_template('startpage.html')
# c = RequestContext(request, ... | lemonad/behorighet | behorighet/main/views.py | Python | bsd-3-clause | 532 | 0 |
#!/usr/bin/env python
import arff
import numpy as np
import sys
from sklearn import preprocessing
#from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import RFE
from sklearn.pipeline import Pipeline
from sklearn.grid_search import GridSea... | bcraenen/KFClassifier | other/methods/ExtraTreesSample.py | Python | gpl-3.0 | 3,466 | 0.018465 |
import _plotly_utils.basevalidators
class LabelValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="label", parent_name="sankey.link", **kwargs):
super(LabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/sankey/link/_label.py | Python | mit | 442 | 0.002262 |
# -*- coding: utf-8 -*-
"""
Miscellaneous functions for plotting
1. bar : create a bar chart with error bars
2. viztime : plot a pretty time series
3. scatt_2cond : scatter plot that compares the x and y values for each point
4. unpair_2cond : plot to compare the distribution of two sets of values
5. scatt_corr : plot... | srcole/tools | plt.py | Python | mit | 10,251 | 0.025266 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.controllers.portal import PortalAccount
from odoo.http import request
class PortalAccount(PortalAccount):
def _invoice_get_page_view_values(self, invoice, access_token, **kwargs):
... | ygol/odoo | addons/account_payment/controllers/portal.py | Python | agpl-3.0 | 1,661 | 0.005418 |
#!/bin/env python
import urllib2
from datetime import datetime
site = 'http://www.fuel-prices-europe.info/'
fh = urllib2.urlopen(site)
lines = fh.readlines()
fh.close()
now = datetime.now()
my_str_date = now.strftime('%Y%m%d')
outdir = '/Users/scollis/tmp/'
prefix = 'fuel'
postfix = '.html'
ofh = open(outdir+prefix+my... | scollis/price_watch | scripts/get_html.py | Python | bsd-2-clause | 379 | 0.002639 |
import numpy as np
import pytest
from emukit.multi_fidelity.convert_lists_to_array import (
convert_x_list_to_array,
convert_xy_lists_to_arrays,
convert_y_list_to_array,
)
def test_convert_x_list_to_array():
x_list = [np.array([[1, 0], [2, 1]]), np.array([[3, 2], [4, 5]])]
x_array = convert_x_lis... | EmuKit/emukit | tests/emukit/multi_fidelity/test_convert_list_to_array.py | Python | apache-2.0 | 2,211 | 0.000905 |
# 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 ... | sesamesushi/desatisrevu | controllers/utils.py | Python | apache-2.0 | 24,558 | 0.000407 |
#!/bin/python
from datetime import timedelta
from pprint import pprint as pp
import json
import Monstr.Core.Utils as Utils
import Monstr.Core.DB as DB
import Monstr.Core.BaseModule as BaseModule
import pytz
from Monstr.Core.DB import Column, Integer, String, DateTime, UniqueConstraint, func
class CMSJobStatus(Bas... | tier-one-monitoring/monstr | Monstr/Modules/CMSJobStatus/CMSJobStatus.py | Python | apache-2.0 | 9,424 | 0.002759 |
# -*- coding: UTF-8 -*-
# Copyright 2014-2021 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
SETUP_INFO = dict(
name='lino-cosi',
version='21.3.0',
install_requires=['lino-xl', 'django-iban', 'lxml'],
# tests_require=['beautifulsoup4'], # satisfied by lin... | lsaffre/lino-cosi | lino_cosi/setup_info.py | Python | agpl-3.0 | 3,193 | 0.000627 |
__author__ = 'heddevanderheide'
# Django specific
from fabric_interface.projects.models import Project
from fabric_interface.hosts.models import Host
def hosts(request):
"""
Adds host QuerySet context variable to the context.
"""
view_name = request.resolver_match.view_name
kwargs = request.resol... | Hedde/fabric_interface | src/fabric_interface/hosts/context_processors.py | Python | mit | 548 | 0.001825 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class PrintStyle(Document):
def validate(self):
if (self.standard==1
and not frappe.local.conf.get("developer_mode")
an... | mhbu50/frappe | frappe/printing/doctype/print_style/print_style.py | Python | mit | 664 | 0.024096 |
__all__ = [
'RedisError',
'ProtocolError',
'ReplyError',
'MaxClientsError',
'AuthError',
'PipelineError',
'MultiExecError',
'WatchVariableError',
'ChannelClosedError',
'ConnectionClosedError',
'ConnectionForcedCloseError',
'PoolClosedError',
'MasterNotFoundError',
... | ymap/aioredis | aioredis/errors.py | Python | mit | 2,627 | 0 |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | danielreed/python-hpOneView | hpOneView/resources/networking/ethernet_networks.py | Python | mit | 9,856 | 0.002334 |
import os
from django.core.files.storage import default_storage
from django.core.management.base import BaseCommand, CommandError
from ...utils import get_variant
class Command(BaseCommand):
USAGE = "<app_label> <model> <field> <variant>"
def handle(self, *args, **options):
try:
app_labe... | thread/django-yadt | django_yadt/management/commands/yadt_gc.py | Python | bsd-3-clause | 1,117 | 0.000895 |
import aiohttp
class Currency:
def __init__(self, client):
self.apiurl = "https://api.fixer.io"
self.currencies = {'USD': 'US Dollar',
'JPY': 'Japanese Yen',
'BGN': 'Bulgarian Lev',
'CZK': 'Czech Koruna',
... | ccubed/AngelBot | Currency.py | Python | mit | 5,135 | 0.002532 |
# 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 u... | yk5/incubator-airflow | airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py | Python | apache-2.0 | 6,584 | 0.000456 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
# flake8: noqa
from ..file_utils import DummyObject, requires_backends
class Speech2TextProcessor(metaclass=DummyObject):
_backends = ["sentencepiece", "speech"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["... | huggingface/transformers | src/transformers/utils/dummy_sentencepiece_and_speech_objects.py | Python | apache-2.0 | 347 | 0 |
#!/bin/sh
#
# A script for turning a generic Ubuntu system into a master for
# SCons development.
import getopt
import sys
from Command import CommandRunner, Usage
INITIAL_PACKAGES = [
'subversion',
]
INSTALL_PACKAGES = [
'wget',
]
PYTHON_PACKAGES = [
'g++',
'gcc',
'make',
'zlib1g-dev',
]
... | EmanueleCannizzaro/scons | bin/scons_dev_master.py | Python | mit | 5,698 | 0.003335 |
#!/usr/bin/env python
# -*- coding: windows-1252 -*-
'''
Created on 17/04/2018
@author: diego.hahn
'''
import time
import re
import glob
import os.path
import struct
import array
import sys
import mmap
if __name__ == '__main__':
import argparse
os.chdir( sys.path[0] )
parser = argparse.ArgumentPars... | hansenhahn/playton-2 | Programas/tl_overlay.py | Python | cc0-1.0 | 1,277 | 0.052467 |
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | ingadhoc/website | l10n_ar_website_sale_ux/__manifest__.py | Python | agpl-3.0 | 1,366 | 0 |
# -*- coding: utf-8 -*-
"""
Created on Wed May 11 08:08:52 2016
@author: tkc
"""
import re
from collections import defaultdict
import pandas as pd
import numpy as np
import scipy
import scipy.stats
from scipy import optimize
from math import factorial # used by Savgol matrix
from scipy.optimize import cu... | tkcroat/Augerquant | Development/Auger_integquant_functions_11Nov16backup.py | Python | mit | 64,350 | 0.024149 |
#!/usr/bin/env python
# PyCal - Python web calendar
#
# Copyright (C) 2004 Ray Osborn
#
# This program 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 of the License, or
# (at your opt... | rayosborn/pycal | scripts/SendReminder.py | Python | lgpl-3.0 | 2,414 | 0.004143 |
# encoding: utf-8
"""
A mixin for :class:`~IPython.core.application.Application` classes that
launch InteractiveShell instances, load extensions, etc.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import glob
import os
import sys
from traitlets.config.applic... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/core/shellapp.py | Python | bsd-2-clause | 15,915 | 0.005278 |
"""Translate an ics file's events to a different timezone."""
from optparse import OptionParser
from vobject import icalendar, base
try:
import PyICU
except:
PyICU = None
from datetime import datetime
def change_tz(cal, new_timezone, default, utc_only=False, utc_tz=icalendar.utc):
"""
Change the tim... | eventable/vobject | docs/build/lib/vobject/change_tz.py | Python | apache-2.0 | 3,148 | 0.003812 |
import os
import numpy as np
from astropy.table import Table
import AnniesLasso as tc
a = tc.load_model("gridsearch-2.0-3.0.model", threads=8)
# Load the data.
PATH, CATALOG, FILE_FORMAT = ("", "apogee-rg.fits",
"apogee-rg-custom-normalization-{}.memmap")
labelled_set = Table.read(os.path.join(PATH, CATALOG... | peraktong/AnniesLasso | sandbox-scripts/rf_start.py | Python | mit | 1,538 | 0.004551 |
from itertools import product
import matplotlib.pyplot as plt
from neupy import algorithms, utils, init
from utils import plot_2d_grid, make_circle, make_elipse, make_square
plt.style.use('ggplot')
utils.reproducible()
if __name__ == '__main__':
GRID_WIDTH = 4
GRID_HEIGHT = 4
datasets = [
mak... | itdxer/neupy | examples/competitive/sofm_compare_weight_init.py | Python | mit | 1,754 | 0 |
def f():
a = 1
b = 1
foo(a, b)
def foo(a_new, b_new):
print(a_new + b_new * 123) | caot/intellij-community | python/testData/refactoring/extractmethod/Statement.after.py | Python | apache-2.0 | 98 | 0.010204 |
class PGPAdmin(object):
def get_queryset(self, request):
"""Skip any auto decryption when ORM calls are from the admin."""
return self.model.objects.get_queryset(**{'skip_decrypt': True})
| atdsaa/django-pgcrypto-fields | pgcrypto/admin.py | Python | bsd-2-clause | 209 | 0 |
x = 2
print "salam!"
for i in range(10):
print x,
x = x * 2
| amiraliakbari/sharif-mabani-python | by-session/ta-921/j1/turtle7.py | Python | mit | 73 | 0 |
"""
WSGI config for ScrumBoard 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/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "scrumtools.settings")
from django.... | acidjunk/django-scrumboard | scrumtools/wsgi.py | Python | gpl-3.0 | 395 | 0.002532 |
"""This module contains code from
Think Python by Allen B. Downey
http://thinkpython.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import math
try:
# see if Swampy is installed as a package
from swampy.TurtleWorld import *
except ImportError:
# otherwise ... | simontakite/sysadmin | pythonscripts/thinkpython/pie.py | Python | gpl-2.0 | 1,636 | 0.001222 |
# -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)"
t_LBRACE = r"\{"
t_RBRACE = r"\}"
t_EQUAL = r"\="
t_DOU... | pablogonzalezalba/a-language-of-ice-and-fire | lexer_rules.py | Python | mit | 1,138 | 0.011424 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'amaury'
import subprocess
import time
import sys
class Timeout(Exception):
pass
def run(command, timeout=10):
proc = subprocess.Popen(command, bufsize=0, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
poll_seconds = .250
deadli... | aurelienmaury/galaxie | sandbox_mo/zero-ears/proc.py | Python | gpl-3.0 | 645 | 0.007752 |
# Copyright 2015-2017 ProfitBricks GmbH
#
# 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 i... | StackPointCloud/profitbricks-sdk-python | tests/test_errors.py | Python | apache-2.0 | 2,455 | 0.000815 |
import re
import urllib.request
import io
from bs4 import BeautifulSoup
base_url = "http://www.basketball-reference.com"
file_name = "players"
separator = "#"
def getPlayers(character):
url = "{0}/players/{1}".format(base_url, character)
u = urllib.request.urlopen(url, data = None)
f = io.TextIOWrapper(u... | MarcoMengoli/marcomengoli.github.io | filesForPosts/parserBasket.py | Python | mit | 3,836 | 0.011992 |
from hamcrest import assert_that, is_
from lib.filters import number_as_magnitude, number_as_financial_magnitude, join_url_parts, string_as_static_url, digest, number_as_grouped_number, number_as_percentage_change
def test_number_as_magnitude():
assert_that(number_as_magnitude(1.23), is_("1.23"))
assert_that... | gds-attic/transactions-explorer | test/filters/test_filters.py | Python | mit | 7,300 | 0.000548 |
"hey iam there yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyyy"
| 6mandati6/6mandati6 | tt.py | Python | apache-2.0 | 135 | 0.014815 |
"""
figleaf is another tool to trace Python code coverage.
figleaf uses the sys.settrace hook to record which statements are
executed by the CPython interpreter; this record can then be saved
into a file, or otherwise communicated back to a reporting script.
figleaf differs from the gold standard of Python coverage t... | hornn/interviews | tools/bin/ext/figleaf/__init__.py | Python | apache-2.0 | 8,016 | 0.003244 |
from PyQt4 import QtCore, QtGui
import vtrace.qt
import vdb.qt.base
from vqt.main import *
class VdbRegistersWindow(vdb.qt.base.VdbWidgetWindow):
def __init__(self, db, dbt, parent=None):
vdb.qt.base.VdbWidgetWindow.__init__(self, db, dbt, parent=parent)
self.regsWidget = vtrace.qt.RegistersView... | joshuahoman/vivisect | vdb/qt/registers.py | Python | apache-2.0 | 753 | 0.002656 |
register(GRAMPLET,
id="Python Gramplet",
name=_("Python Shell"),
description = _("Interactive Python interpreter"),
status = STABLE,
fname="PythonGramplet.py",
height=250,
gramplet = 'PythonGramplet',
gramplet_title=_("Python Shell"),
vers... | gramps-project/addons-source | PythonGramplet/PythonGramplet.gpr.py | Python | gpl-2.0 | 423 | 0.023641 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2009 Douglas S. Blank
#
# 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; e... | arunkgupta/gramps | gramps/gui/editors/editdate.py | Python | gpl-2.0 | 13,619 | 0.004846 |
# Generated by Django 2.1.7 on 2019-03-09 11:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("account", "0018_auto_20190309_1153"),
]
operations = [
migrations.AddField(
model_name="taggedu... | fin/froide | froide/account/migrations/0019_auto_20190309_1223.py | Python | mit | 755 | 0 |
import re
def getText(data):
res = []
resString = ""
pattern = re.compile(r"\(?M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\)(.*?)\. *\n", re.I)
iteratable = pattern.finditer(data)
newPattern = re.compile(r"\(?M{0,4}CM|CD|D?C{0,3}XC|XL|L?X{0,3}IX|IV|V?I{0,3}\)", re.I)
checkPattern = re.compile(r"\(?M{... | Utkarshdevd/summer14python | getText.py | Python | mit | 665 | 0.034586 |
#!/usr/bin/env python3
from typing import NamedTuple
from ciphers import HexString
rijndael_s_box = (
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd... | 0x326/academic-code-portfolio | 2016-2021 Miami University/CSE 467 Computer and Network Security/2019-03-06 Homework 2.py | Python | mit | 3,384 | 0.006206 |
"""
@author David W.H. Swenson
"""
from __future__ import absolute_import
from builtins import object
from nose.tools import (assert_equal, assert_not_equal, assert_is, raises,
assert_true, assert_false)
from nose.plugins.skip import Skip, SkipTest
from .test_helpers import (CallIdentity, raise... | choderalab/openpathsampling | openpathsampling/tests/test_volume.py | Python | lgpl-2.1 | 17,171 | 0.001223 |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
''' this is a simple UI for offline working '''
__author__='xuehao'
import re
import tkinter
import tkinter.simpledialog
import tkinter.messagebox
import gittime
import gitcount
''' list with a scrollbar and a lable of lines in the list '''
class myListBox(object):
def ... | darkframemaster/pyrepo | app/local/__pycache__/ui.py | Python | mit | 5,962 | 0.070665 |
# -*- encoding: utf-8 -*-
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 not... | Ban3/Limnoria | plugins/Filter/plugin.py | Python | bsd-3-clause | 25,613 | 0.004295 |
from pdb import Pdb # pragma: nocoverage
morepath_pdb = Pdb(
skip=["reg.*", "inspect", "repoze.lru"]
) # pragma: nocoverage
def set_trace(*args, **kw): # pragma: nocoverage
"""Set pdb trace as in ``import pdb; pdb.set_trace``, ignores ``reg``.
Use ``from morepath import pdbsupport; pdbsupport.set_tr... | morepath/morepath | morepath/pdbsupport.py | Python | bsd-3-clause | 465 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import doctest
from proteindf_bridge.ssbond import SSBond
class SSBondTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# def test_check(self):
# tmp_pdb = Pdb('./data/1hls.pdb')
# model... | ProteinDF/ProteinDF_bridge | tests/test_ssbond.py | Python | gpl-3.0 | 649 | 0 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | MDAnalysis/mdanalysis | package/MDAnalysis/lib/picklable_file_io.py | Python | gpl-2.0 | 15,899 | 0 |
# This file is part of beets.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | karlbright/beets | test/test_vfs.py | Python | mit | 1,621 | 0.003085 |
# MODULE: telos-mote-components
# CLASS: telos-mote
from sim_core import *
from components import *
# Telos Mote
class telos_mote_component(component_object):
classname = 'telos-mote'
basename = 'system'
description = "A Telos Mote, based on the msp430 processor"
# connectors:
connectors = {
... | iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/telos_mote_components.py | Python | gpl-2.0 | 9,668 | 0.006309 |
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
im... | rossonet/RAM | OctoPrint/src/octoprint/filemanager/storage.py | Python | lgpl-3.0 | 35,942 | 0.029886 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import math
from circle import Circle
class Ellipse(Circle):
""" class for 2D ellipses """
def __init__(self, x=0, y=0, p=2, r=1, b=1):
super(Ellipse, self).__init__(x, y, p, r)
self.b = b
def __str__(self):
return ("{0:." + str(sel... | OSGeoLabBp/tutorials | hungarian/python/code/ellipse.py | Python | cc0-1.0 | 775 | 0.002581 |
import collections
import itertools
import json
import os
import os.path
import re
import shutil
import string
import subprocess
import sys
import cgi
class BuildDesc:
def __init__(self, prepend_envs=None, variables=None, build_type=None, generator=None):
self.prepend_envs = prepend_envs or [] # [ { "var":... | wendysuly/TeamTalk | win-client/3rdParty/src/json/devtools/batchbuild.py | Python | apache-2.0 | 11,585 | 0.018127 |
# 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 applica... | thesuperzapper/tensorflow | tensorflow/contrib/keras/python/keras/initializers_test.py | Python | apache-2.0 | 5,930 | 0.007589 |
# This file is part of cloud-init. See LICENSE file for license information.
"""cloud-init Integration Test Verify Script."""
from tests.cloud_tests.testcases import base
class TestPasswordExpire(base.CloudTestCase):
"""Test password module."""
def test_shadow(self):
"""Test user frozen in shadow.""... | larsks/cloud-init | tests/cloud_tests/testcases/modules/set_password_expire.py | Python | gpl-3.0 | 727 | 0 |
# Django settings for prod_announcer project.
import os
LOCAL = lambda x: os.path.join(os.path.sep.join(
os.path.abspath(
os.path.dirname(__file__)).split(os.path.sep)), x)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Guilherme da Costa de Albuquerque', 'guilherme.albuq... | paulocmi/Prod_pc | prod_announcer/settings.py | Python | mit | 5,111 | 0.001957 |
from __future__ import absolute_import
import shutil
from sympy.external import import_module
from sympy.utilities.pytest import skip
from sympy.utilities._compilation.compilation import compile_link_import_strings
numpy = import_module('numpy')
cython = import_module('cython')
_sources1 = [
('sigmoid.c', r"""
... | kaushik94/sympy | sympy/utilities/_compilation/tests/test_compilation.py | Python | bsd-3-clause | 1,775 | 0.001127 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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
#
# Unle... | nigelsmall/py2neo | py2neo/packages/httpstream/watch.py | Python | apache-2.0 | 3,162 | 0 |
#coding: utf-8
from flask import current_app
from flask_restplus import marshal
from APITaxi_models.hail import Hail, HailLog
from ..descriptors.hail import hail_model
from ..extensions import celery, redis_store_saved
import requests, json
@celery.task()
def send_request_operator(hail_id, endpoint, operator_header_n... | l-vincent-l/APITaxi | APITaxi/tasks/send_request_operator.py | Python | agpl-3.0 | 2,485 | 0.004829 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.