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/python3
'''
把as_corpus的摘要信息和答案、问题分开
'''
as_dir = "/home/lavi/project/insummer/as_corpus/all/"
as_data = "/home/lavi/project/insummer/as_corpus/as_data/"
as_sum = "/home/lavi/project/insummer/as_corpus/as_sum/"
import os
for fname in os.listdir(as_dir):
dt = [] #问题和答案
su = [] #摘要
f = open(as_d... | lavizhao/insummer | code/script/process_ascorpus.py | Python | mit | 877 |
# Generated by Django 2.0.8 on 2018-09-17 09:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('payoff', '0006_depositslip_status'),
('condominium', '0013_callfundssupporting_supporting_ptr'),
]
operations = [
migrations.AddFiel... | Diacamma2/syndic | diacamma/condominium/migrations/0014_callfunds_type.py | Python | gpl-3.0 | 825 |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | jasonehines/mycroft-core | mycroft/client/enclosure/api.py | Python | gpl-3.0 | 6,761 |
###############################################################################
# example_of_use.py: Module for PATTERN MATCH - example of use for Hybrid FA
# Copyright (C) 2012 Brno University of Technology, ANT @ FIT
# Author(s): Vlastimil Kosar <ikosar@fit.vutbr.cz>
##############################################... | vhavlena/appreal | netbench/pattern_match/algorithms/hybrid_fa/example_of_use.py | Python | gpl-2.0 | 4,716 |
from fractions import Fraction
import pytest
from typing import List, Tuple
from .continued_fractions import convergent_sequence, \
continued_fraction_sqrt, \
convergents_sqrt
CONVERGENTS = [
(
[0, 1, 5, 2, 2],
[Fraction(0, 1),
... | cryvate/project-euler | project_euler/library/number_theory/test_continued_fractions.py | Python | mit | 2,486 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | cschnei3/forseti-security | tests/common/gcp_type/test_data/fake_cloudsql.py | Python | apache-2.0 | 9,139 |
"""Generic wrapper for read-eval-print-loops, a.k.a. interactive shells
"""
import os.path
import signal
import sys
import re
import pexpect
PY3 = (sys.version_info[0] >= 3)
if PY3:
def u(s): return s
else:
def u(s): return s.decode('utf-8')
PEXPECT_PROMPT = u('[PEXPECT_PROMPT>')
PEXPECT_CONTINUATION_PROMPT... | Depado/pexpect | pexpect/replwrap.py | Python | isc | 4,576 |
#!/usr/bin/env python
# ======================================================================
# Script derived from the EB-eye (REST) Python client available at
# http://www.ebi.ac.uk/Tools/webservices/services/eb-eye_rest
# and distributed under the Apache License
# ===================================================... | yhoogstrate/tools-iuc | tools/ebi_tools/ebeye_urllib.py | Python | mit | 10,160 |
# -*- coding: utf-8 -*-
from .api import TypeFormAPI
from .form import TypeForm
__all__ = [
'TypeFormAPI',
'TypeForm'
] | mbokulic/typeform | typeform/__init__.py | Python | mit | 128 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import model_utils.fields
import django.core.validators
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('project_admin', '0011_auto_20151104_2159'),
('em... | luiscberrocal/homeworkpal | homeworkpal_project/maximo/migrations/0001_initial.py | Python | mit | 2,803 |
import sys
import collections
with open(sys.argv[1],'r') as test_cases:
for test in test_cases:
test = test.rstrip()
num = [x for x in test.split()]
# preserve_order = list(collections.OrderedDict.fromkeys(num))
# c = collections.Counter(num)
# for element in preserve_order:
# print "%s %s" %(c[element], ... | Amin-Abouee/code_eval | easy/compress_sequence.py | Python | mit | 534 |
import base64
import ipaddress
import struct
from .abstract import Session
from .memory import MemorySession
from .types import DataCenter, ChannelState, SessionState, Entity
_STRUCT_PREFORMAT = '>B{}sH256s'
CURRENT_VERSION = '1'
class StringSession(MemorySession):
"""
This session file can be easily saved... | LonamiWebs/Telethon | telethon/_sessions/string.py | Python | mit | 2,762 |
import unittest
import doctest
import numpy as np
import mast.molecule as mastmol
from mast.interfaces.rdkit import RDKitMoleculeWrapper
import mast.tests.config.molecule as mastmolconfig
import mast.tests.data as mastdata
from rdkit import Chem
class TestRDKitWrapper(unittest.TestCase):
def setUp(self):
... | salotz/mast | mastic/tests/test_rdkit_interface.py | Python | mit | 8,431 |
# Copyright 2019 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 agreed to in writing, ... | google/clusterfuzz | src/clusterfuzz/_internal/platforms/windows/gestures.py | Python | apache-2.0 | 5,697 |
# -*- coding: utf-8 -*-
import pandas as pd
import scrapy
from scrapy import Request
from scrapy import Selector
from scrapy import signals
from fooltrader.contract.files_contract import get_kdata_path
from fooltrader.utils.utils import index_df_with_time, to_time_str, to_float
class Sp500Spider(scrapy.Spider):
... | foolcage/fooltrader | fooltrader/spiders/america/sp500_spider.py | Python | mit | 3,418 |
from django.utils.module_loading import import_string
from drfpasswordless.settings import api_settings
from drfpasswordless.utils import (
create_callback_token_for_user,
)
class TokenService(object):
@staticmethod
def send_token(user, alias_type, token_type, **message_payload):
token = create_ca... | aaronn/django-rest-framework-passwordless | drfpasswordless/services.py | Python | mit | 833 |
"""
cleaning.py is currently not used
"""
from error import PING_INTV, TRACE_INTV, MISS_ERR, START, PING_LEN, TRACE_LEN
import numpy as np
import timetools as tt
# cleaning criteria
INTV_MX = 2 # the maximum tolerable consecutive connection losses, times by interval.
LEN_P = 0.9 # the minimum length portion compared... | WenqinSHAO/rtt | localutils/cleaning.py | Python | mit | 2,725 |
#!/usr/bin/env python3
"""
Simple static site generator for the pandas web.
pandas_web.py takes a directory as parameter, and copies all the files into the
target directory after converting markdown files into html and rendering both
markdown and html files with a context. The context is obtained by parsing
the file `... | TomAugspurger/pandas | web/pandas_web.py | Python | bsd-3-clause | 11,765 |
# Some rgb-colors
#
# author: ulno
# created: 2017-05-23
#
black = (0, 0, 0)
white = (255, 255, 255)
clist = {
"red": (255, 0, 0),
"green": (0, 255, 0),
"blue": (0, 0, 255),
"yellow": (255, 255, 0),
"orange": (255, 128, 0),
"lightgreen": (128, 255, 0),
"purple": (255, 0, 255),
"black":... | ulno/micropython-extra-ulno | lib/node_types/esp8266/compile/uiot/colors.py | Python | mit | 549 |
#!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... | marzukt/conference | models.py | Python | apache-2.0 | 5,267 |
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014 Fumihiko Kakuma <kakuma at valinux co jp>
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except ... | huntxu/neutron | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/ovs_test_base.py | Python | apache-2.0 | 3,218 |
import numpy as np
# load the CSV file as a numpy matrix
dataset = np.genfromtxt("training_dataset_stream.csv",
delimiter=',', skip_header=1)
# Let make our label to integer i.e. stream: Science : 3, Commerce : 2 and Arts : 1
# separate the data from the target attributes
y = dataset[:,5]
X =... | bikashsharmabks/stream_prediction_machine_learning | student_stream_predict.py | Python | mit | 1,235 |
import subprocess
import os
import shutil
def amr(query_file):
'''Call RGI on query_file and convert to tsv.
'''
# Main RGI call.
# Note: -o will actually append .json to the filename.
subprocess.check_call([
'rgi',
'main',
'-i', query_file,
'-o', query_file])
#... | superphy/backend | app/modules/amr/amr.py | Python | apache-2.0 | 786 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import datetime
from colorama import Fore
import helper_functions as helper
import os_operations as op
import hook_system_variables as hook
import re
def settings_not_found_error_print():
print " workspace_settings.json file not found, and this might be of... | adnane1deev/Hook | bin/package_manager.py | Python | mit | 6,070 |
# -*- coding: utf-8 -*-
from odoo import api, fields, models
class Post(models.Model):
_inherit = 'forum.post'
documentation_toc_id = fields.Many2one('forum.documentation.toc', string='Documentation ToC', ondelete='set null')
documentation_stage_id = fields.Many2one('forum.documentation.stage', string='... | ayepezv/GAD_ERP | addons/website_forum_doc/models/forum_post.py | Python | gpl-3.0 | 790 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Criado em 19 de Novembro de 2016
@author: Denis Varise Bernardes & Eder Martioli
Descricao: esta biblioteca possui as seguintes funcoes:
mkDir_saveCombinedImages: pela chamada da funcao LeArquivoReturnLista retorna a lista de todas as imagens ad... | DBernardes/ProjetoECC | Eficiência_Quântica/Codigo/QE_reduceImgs_readArq.py | Python | mit | 7,313 |
# Copyright 2013 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.
"""Generates test runner factory and tests for instrumentation tests."""
import logging
import os
import test_package
import test_runner
def Setup(test_o... | hugegreenbug/libgestures | include/build/android/pylib/instrumentation/setup.py | Python | bsd-3-clause | 1,209 |
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from oauth_access.access import OAuthAccess
from oauth_access.exceptions import MissingToken
def oauth_login(request, service,
redirect_field_name="next", redirect_to_sessio... | DraXus/andaluciapeople | oauth_access/views.py | Python | agpl-3.0 | 1,715 |
from datetime import date, timedelta
from django.test import TestCase
from django.urls import reverse
from rq.exceptions import NoSuchJobError
from autoemails import admin
from autoemails.actions import NewInstructorAction
from autoemails.models import EmailTemplate, Trigger, RQJob
from autoemails.job import Job
from... | swcarpentry/amy | amy/autoemails/tests/test_admin_edit_template.py | Python | mit | 6,334 |
import io
import os
import subprocess
class Result(object):
def __init__(self, success, stdout, stderr):
self.success = success
self.stdout = stdout
self.stderr = stderr
class Process(object):
cwdpath = os.path.join(os.path.dirname(__file__), '..', '..')
@classmethod
def run(self, cmd):
proc ... | kurrik/laulik | src/server/proc.py | Python | apache-2.0 | 1,062 |
import OOMP
newPart = OOMP.oompItem(9532)
newPart.addTag("oompType", "SWIS")
newPart.addTag("oompSize", "09")
newPart.addTag("oompColor", "X")
newPart.addTag("oompDesc", "DPDT")
newPart.addTag("oompIndex", "68")
OOMP.parts.append(newPart)
| oomlout/oomlout-OOMP | old/OOMPpart_SWIS_09_X_DPDT_68.py | Python | cc0-1.0 | 241 |
# -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.Account import Account
class DepositfilesCom(Account):
__name__ = "DepositfilesCom"
__type__ = "account"
__version__ = "0.35"
__status__ = "testing"
__description__ = """Depositfiles.com account plugin"""
__li... | mationic/pyload | module/plugins/accounts/DepositfilesCom.py | Python | gpl-3.0 | 1,299 |
from flask import request
from flask.views import MethodView
from pymongo.errors import DuplicateKeyError
from app.decorators import to_json, crossdomain, jwt_auth_required
from app.endpoint import serializers
from app.exceptions import raise_validation_error, raise_not_found
from app.endpoint.dao import EndpointDAO
f... | iocube/Gimme-JSON-backend | app/endpoint/api.py | Python | mit | 3,862 |
from resources.lib.modules import control,client
from resources.lib.modules.log_utils import log
import xbmc,os,re,urllib,base64
def resolve(url):
initial = url
libPath = os.path.join(control.addonPath, 'resources/lib/modules')
serverPath = os.path.join(libPath, 'livestreamerXBMCLocalProxy.py')
try:
imp... | rootsradics/castback | resources/lib/resolvers/livestreamer.py | Python | gpl-3.0 | 975 |
# coding=utf-8
"""
-**Cadasta Wizard**
This module provides an abstract class for wizard steps
.. note:: 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... | Cadasta/cadasta-qgis-plugin | cadasta/gui/tools/wizard/wizard_step.py | Python | gpl-3.0 | 2,884 |
#
# 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 us... | jiangxb1987/spark | python/pyspark/sql/functions.py | Python | apache-2.0 | 164,299 |
from __future__ import unicode_literals
import frappe
import frappe.defaults
import unittest
from frappe.contacts.report.addresses_and_contacts.addresses_and_contacts import get_data
def get_custom_linked_doctype():
if bool(frappe.get_all("DocType", filters={'name':'Test Custom Doctype'})):
return
doc = frappe.g... | saurabh6790/frappe | frappe/contacts/report/addresses_and_contacts/test_addresses_and_contacts.py | Python | mit | 2,867 |
from .. import Provider as AddressProvider
class Provider(AddressProvider):
countries = (
"Afghanistan",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",
"Antarctica (the territory South of 60 deg S)",
"Antigua and Bar... | joke2k/faker | faker/providers/address/en/__init__.py | Python | mit | 5,642 |
import logging
log = logging.getLogger(__name__)
from threading import RLock
from time import time
from spacq.tool.box import Enum, Synchronized
"""
Hardware device abstraction interface.
"""
# PyVISA, Linux GPIB, PyVISA USB.
drivers = Enum(['pyvisa', 'lgpib', 'pyvisa_usb'])
# Try to import all available drivers... | ghwatson/SpanishAcquisitionIQC | spacq/devices/abstract_device.py | Python | bsd-2-clause | 11,353 |
import numpy as np
from planck import planck_fn
import astropy.units as u
from grid_functions import *
from math import fabs, exp
class ray:
def __init__(self, mu, n_depth_pts, radial_grid):
self.mu = mu
self.I_lam = np.zeros(n_depth_pts)
# outward pointing rays should have diffusion as the... | bcfriesen/PyRT | src/ray.py | Python | mit | 2,665 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Luis López <luis@cuarentaydos.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... | ldotlopez/appkit | appkit/asyncscheduler.py | Python | gpl-2.0 | 5,065 |
# Copyright 2012 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | sdh100shaun/mongo-connector | tests/test_mongo_connector.py | Python | apache-2.0 | 5,348 |
"""
Unit tests for the calendar sync plugins.
"""
import crum
import ddt
from django.test import RequestFactory
from edx_toggles.toggles.testutils import override_waffle_flag
from openedx.features.calendar_sync.plugins import CalendarSyncToggleTool
from openedx.features.course_experience import CALENDAR_SYNC_FLAG, R... | edx/edx-platform | openedx/features/calendar_sync/tests/test_plugins.py | Python | agpl-3.0 | 1,654 |
# Python comes with a standard library full of incredibly useful packages.
# "Standard library" means any installation of Python is guaranteed to have
# these packages. You can read about them here:
# https://docs.python.org/3/library/index.html
# In order to use a package in the standard library, you need to "import"... | nuitrcs/python-researchers-toolkit | scripts/ex09_imports.py | Python | mit | 2,074 |
#==============================================================================
# example05.py
# Example to load in a previously run simulation from the disk,
#==============================================================================
from gandalf.analysis.facade import *
# Load simulation with run_id `ADSOD1' (r... | gandalfcode/gandalf | examples/example05.py | Python | gpl-2.0 | 721 |
class ConfigException(Exception):
def __init__(self, message, ex=None):
super(ConfigException, self).__init__(message)
self._exception = ex
class ConfigMissingException(ConfigException, KeyError):
pass
class ConfigSubstitutionException(ConfigException):
pass
class ConfigWrongTypeExcep... | chimpler/pyhocon | pyhocon/exceptions.py | Python | apache-2.0 | 352 |
# python v. 3.3.2
import random
def genSuit():
suit = random.randint(1, 4)
if suit == 1:
return "Clubs"
if suit == 2:
return "Diamonds"
if suit == 3:
return "Hearts"
if suit == 4:
return "Spades"
return "Whoops!"
def genRank():
rank = random.randint(1, 13)
... | mddenton/Projects-my | Games/blackjack.py | Python | mit | 1,541 |
from django import forms
from django.forms.widgets import EmailInput, MultiWidget, TextInput
from django.templatetags.static import static
class VerifiedEmailWidget(MultiWidget):
template_name = 'verified_email_field/field.html'
def __init__(self, attrs=None, email_attrs=None, code_attrs=None, **context):
... | misli/django-verified-email-field | verified_email_field/widgets.py | Python | bsd-3-clause | 906 |
#!/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.
"""Runs the Monkey tests on one or more devices."""
import logging
import optparse
import random
import sys
from pylib import andr... | goddino/libjingle | trunk/build/android/run_monkey_test.py | Python | bsd-3-clause | 6,051 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | jdhp-sap/data-pipeline-standalone-scripts | datapipe/optimization/objectivefunc/tailcut_delta_psi.py | Python | mit | 6,676 |
import color_map
import color
import unittest
class ColorMapTest(unittest.TestCase):
def testColorMap(self):
cmap = color_map.ColorMap()
a = color.RGBColor(0,0,0)
self.assertEquals('A', cmap.get(a))
a2 = color.RGBColor(0,0,0)
self.assertEquals('A', cmap.get(a2))
b = color.RGBColor(0,0,1)
... | nanaze/pystitch | pystitch/color_map_test.py | Python | apache-2.0 | 545 |
#from contextlib import ExitStack
import sys
import math
import json
import numpy
import logging
import casacore.measures
from MSUtils import msutils
import dask
import dask.array as da
from daskms import xds_from_ms, xds_to_table, xds_from_table
from bokeh.layouts import row, column
from bokeh.plotting import figu... | SpheMakh/msutils | MSUtils/flag_stats.py | Python | gpl-2.0 | 16,577 |
#!/usr/bin/env python
#
# GrovePi Example for using the Grove Light Sensor and the LED together to turn the LED On and OFF if the background light is greater than a threshold.
# Modules:
# http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor
# http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit
#
# The GrovePi con... | penoud/GrovePi | Software/Python/grove_light_sensor.py | Python | mit | 2,674 |
from setuptools import setup, find_packages
with open("agsadmin/_version.py") as fin: exec(fin.read(), globals())
with open("requirements.txt") as fin: requirements = [s.strip() for s in fin.readlines()]
with open("README.rst") as fin: long_description = fin.read()
packages = find_packages(exclude=["*.tests", "*.test... | DavidWhittingham/agsadmin | setup.py | Python | bsd-3-clause | 1,107 |
"""Code coverage page generator."""
from mako.template import Template
import time
from repositories import Repositories
from source_files import get_source_files
from unit_tests import read_unit_test_coverage_for_week
from config import Config
from fastlog import log
class Results():
"""Class representing res... | tisnik/fabric8-analytics-common | dashboard/src/cc.py | Python | apache-2.0 | 5,692 |
PROJECT_PATH = __path__[0]
TIEMPO_REGISTRY = {}
REDIS_GROUP_NAMESPACE = 'tiempogroup'
RECENT_KEY = 'tiempo:recent_tasks'
RESULT_PREFIX = 'tiempo:task_result'
__version__ = "1.2.3"
| hangarunderground/tiempo | tiempo/__init__.py | Python | gpl-2.0 | 183 |
import math, random
class Task( object ):
"""A task"""
def __init__(self,
Id ,
Name ,
WCET ,
BCET ,
Period ,
Deadline ... | neonsoftware/network-on-chip-mapping-benchmark | data_structures.py | Python | mit | 8,962 |
# Copyright (C) 2016 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... | netsamir/dotfiles | files/vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/tests/go/subcommands_test.py | Python | unlicense | 2,635 |
# Copyright 2017 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... | allenlavoie/tensorflow | tensorflow/contrib/autograph/converters/call_trees_test.py | Python | apache-2.0 | 4,919 |
'''
Madsonic XBMC Plugin
Copyright (C) 2011 t0mm0, darkip, Madevil
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 lat... | MadMarty/madsonic-server-5.1 | madsonic-xbmc/plugin.video.madsonic/resources/lib/Madsonic/Madsonic.py | Python | gpl-3.0 | 9,989 |
"""
This page is in the table of contents.
Plugin to home the tool at beginning of each layer.
The home manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Home
==Operation==
The default 'Activate Home' checkbox is on. When it is on, the functions described below will work, when it is off, not... | makerbot/ReplicatorG | skein_engines/skeinforge-47/skeinforge_application/skeinforge_plugins/craft_plugins/home.py | Python | gpl-2.0 | 8,040 |
from datetime import timedelta
from glob import glob
import numpy as np
import pandas as pd
from netCDF4 import Dataset
from scipy.interpolate import interp1d
from scipy.ndimage import find_objects, gaussian_filter
from scipy.stats import gamma
from hagelslag.data.MRMSGrid import MRMSGrid
from hagelslag.data.ModelOut... | djgagne/hagelslag | hagelslag/processing/TrackProcessing.py | Python | mit | 34,093 |
#!/usr/bin/env python
import os, time
from zlib import *
# According to section 3.5 of RFC 2616, "Content-Encoding: deflate"
# requires a ZLIB header. However, Microsoft-IIS/6.0 sends a raw
# DEFLATE stream instead. This CGI tests how ELinks handles that.
data1 = '<html><body>Two lines should be visible.<br/>The se... | chriskmanx/qmole | QMOLEDEV/elinks-0.12pre5/test/cgi/chunked_raw_deflate.py | Python | gpl-3.0 | 848 |
"""Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MI... | TylerKirby/cltk | setup.py | Python | mit | 1,533 |
from OpenGLCffi.EGL import params
@params(api='egl', prms=['device', 'attribute', 'value'])
def eglQueryDeviceAttribEXT(device, attribute):
pass
@params(api='egl', prms=['device', 'name'])
def eglQueryDeviceStringEXT(device, name):
pass
@params(api='egl', prms=['dpy', 'attribute', 'value'])
def eglQueryDisplayAtt... | cydenix/OpenGLCffi | OpenGLCffi/EGL/EXT/EXT/device_query.py | Python | mit | 352 |
MC logo
Polynomial Evaluator II
Code Examples
<<Polynomial Module prun.py Account Class>>
#!/usr/bin/python
#
# This program evaluates polynomials. It first asks for the coefficients
# of a polynomial, which must be entered on one line, highest-order first.
# It then requests values of x and will compute the v... | douglasknudsen/atlcodecamp2013 | sublimeexamples/samplePython.py | Python | mit | 1,920 |
#!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
from os import path
import sys
__all__ = ['libsvm', 'svm_problem', 'svm_parameter',
'toPyModel', 'gen_svm_nodearray', 'print_null', 'svm_node', 'C_SVC',
'EPSILON_SVR', 'LINEAR', 'NU_SVC', 'NU_SVR', 'ONE_CLASS',
... | openeventdata/Focus_Locality_Extraction | Focus_Locality/Sentence_Embedding_Approach/Bias_Correction/KMM/svm.py | Python | mit | 9,961 |
# Copyright 2016 Internap.
#
# 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, so... | internap/almanach | tests/builder.py | Python | apache-2.0 | 4,540 |
#!/usr/bin/env python
import argparse
import errno
import hashlib
import os
import shutil
import subprocess
import sys
import tempfile
from io import StringIO
from lib.config import PLATFORM, get_target_arch, get_env_var, s3_config, \
get_zip_name
from lib.util import electron_gyp, execute, ge... | rreimann/electron | script/upload.py | Python | mit | 8,894 |
# -*- coding: utf-8 -*-
#
# Copyright 2012 Manuel Stocker <mensi@mensi.ch>
#
# This file is part of Cydra.
#
# Cydra 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 yo... | mensi/cydra | cydra/config/__init__.py | Python | gpl-3.0 | 5,616 |
from setuptools import setup, find_packages
from extjs4 import version
setup(name = 'django_extjs4',
description = 'Packages extjs4 as a Django app.',
license='GPL',
version = version,
url = 'http://github.com/espenak/django_extjs4',
author = 'Espen Angell Kristiansen',
long_descri... | espenak/django_extjs4 | setup.py | Python | bsd-3-clause | 960 |
#!/usr/bin/env python
import os
import sys
import json
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy import create_engine
from datetime import datetime
#from p... | chicks-net/life-graphs | bin/chart_steam.py | Python | gpl-2.0 | 5,197 |
#!/usr/bin/env python
# Copyright 2016 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.
"""Generates an Android Studio project from a GN target."""
import argparse
import codecs
import collections
import glob
import loggin... | Passw/gn_GFW | build/android/gradle/generate_gradle.py | Python | gpl-3.0 | 33,867 |
#!/usr/bin/env python
#
# This file is part of Scalable COncurrent Operations in Python (SCOOP).
#
# SCOOP 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 Licens... | soravux/scoop | scoop/broker/brokerzmq.py | Python | lgpl-3.0 | 13,389 |
from django.apps import AppConfig
class PredictConfig(AppConfig):
name = 'predict'
| lightd22/swainBot-web | predict/apps.py | Python | apache-2.0 | 89 |
import json
import time
from datetime import datetime
import github3.exceptions
from cumulusci.core.exceptions import GithubException
from cumulusci.core.exceptions import TaskOptionsError
from cumulusci.tasks.github.base import BaseGithubTask
class CreateRelease(BaseGithubTask):
task_options = {
"vers... | SalesforceFoundation/CumulusCI | cumulusci/tasks/github/release.py | Python | bsd-3-clause | 3,462 |
from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
IS_PYOPENSSL = False
# Maps the length of a d... | jetskijoe/SickGear | lib/requests/packages/urllib3/util/ssl_.py | Python | gpl-3.0 | 12,078 |
#!/usr/bin/env python
#------------------------------------------------------------------------------
# srg_pairing.py
#
# author: H. Hergert
# version: 1.1.0
# date: Nov 18, 2016
#
# tested with Python v2.7
#
# Solves the pairing model for four particles in a basis of four doubly
# degenerate states by mea... | ManyBodyPhysics/LectureNotesPhysics | doc/src/Chapter10-programs/python/srg_pairing/srg_pairing.py | Python | cc0-1.0 | 8,192 |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | tensorflow/datasets | tensorflow_datasets/text/yelp_polarity_test.py | Python | apache-2.0 | 961 |
# Copyright 2022 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 agreed to in writing, ... | google/gazoo-device | gazoo_device/fire_patch.py | Python | apache-2.0 | 3,310 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 ... | jamielennox/openstack-kds | kds/common/crypto.py | Python | apache-2.0 | 4,476 |
from math import sqrt
from mathutils import Matrix
import bpy
from bpy.props import FloatProperty, EnumProperty, BoolProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level
from sverchok.utils.curve import SvEllipse
class Sv... | DolphinDream/sverchok | nodes/curve/ellipse.py | Python | gpl-3.0 | 6,664 |
# Copyright 2013 IBM Corporation
# 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 ... | ntymtsiv/tempest | tempest/api/compute/admin/test_hypervisor.py | Python | apache-2.0 | 4,143 |
# 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 ... | rjschwei/azure-sdk-for-python | azure-mgmt-servermanager/azure/mgmt/servermanager/models/prompt_message_response.py | Python | mit | 856 |
# 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.
"""Common test code for `iris.plot.pcolor` and `iris.plot.pcolormesh`."""
# Import iris.tests first so that some things can be... | pp-mo/iris | lib/iris/tests/unit/plot/_blockplot_common.py | Python | lgpl-3.0 | 4,362 |
# Authors:
# Martin Kosek <mkosek@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 Fr... | realsobek/freeipa | ipaclient/plugins/dns.py | Python | gpl-3.0 | 18,472 |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
# $Id$
#
# Usage: python retriever-multi.py <file with URLs to fetch> [<# of
# concurrent connections>]
#
import sys
import pycurl
# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
# the libcurl tutorial for more info.
try:
impor... | ashumkin/pycurl-cvs | examples/retriever-multi.py | Python | lgpl-2.1 | 3,373 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
__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"
from flask_login im... | foosel/OctoPrint | src/octoprint/access/users.py | Python | agpl-3.0 | 40,260 |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from carts.views import CartView, ItemCountView, CheckoutView, CheckoutFinalView
from orders.views import (
AddressSelectFormView,
... | vanabo/mattress | src/shop/urls.py | Python | mit | 1,795 |
"""Concrete date/time and related types -- prototype implemented in Python.
See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
See also http://dir.yahoo.com/Reference/calendars/
For a primer on DST, including many current DST rules, see
http://webexhibits.org/daylightsaving/
For more about DST than you e... | soarpenguin/python-scripts | datetime.py | Python | gpl-3.0 | 71,941 |
from django.apps import AppConfig
class DbfConfig(AppConfig):
name = 'dbf'
| xmnlab/AlertaDengue | AlertaDengue/dbf/apps.py | Python | gpl-3.0 | 81 |
# Copyright (c) 2007-2008 The PyAMF Project.
# See LICENSE for details.
"""
WSGI server implementation.
The Python Web Server Gateway Interface (WSGI) is a simple and universal
interface between web servers and web applications or frameworks.
The WSGI interface has two sides: the "server" or "gateway" side, and the
... | jamesward-demo/air-quick-fix | AIRQuickFixServer/pyamf/remoting/gateway/wsgi.py | Python | apache-2.0 | 4,730 |
import numpy as np
from robotarium import Robotarium, transformations, controllers
# Get Robotarium object used to communicate with the robots/simulator.
r = Robotarium()
# Get the number of available agents from the Robotarium. We don't need a
# specific value from this algorithm.
n = r.get_available_agents()
# Nu... | robotarium/robotarium-python-simulator | examples/barrierCertificates.py | Python | mit | 2,240 |
#!/usr/bin/env python
# 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/.
# Copyright (c) 2016 Mozilla Corporation
# Author: gdestuynder@mozilla.com
import os
from setuptoo... | gdestuynder/duo_openvpn-1 | setup.py | Python | mpl-2.0 | 1,231 |
__author__ = 'cody'
class Config():
"""Base configuration class. Any variable set here is loaded in all apps"""
DEBUG = True
SECRET_KEY = "1234"
LOG_DIRECTORY = "/tmp"
LOG_FORMAT_STRING = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
MAX_LOG_BYTES = 10000
class Webfront(Config):
D... | codyharrington/todolist | config.py | Python | mit | 1,050 |
import re
import numpy as np
import pytest
from pandas.core.dtypes.common import is_categorical_dtype
import pandas as pd
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,
Index,
Interval,
Series,
Timedelta,
Timestamp,
)
import pandas._testing as tm
from pandas.api.types ... | pandas-dev/pandas | pandas/tests/indexing/test_categorical.py | Python | bsd-3-clause | 19,177 |
import numpy
from chainer import configuration
from chainer import cuda
from chainer import function
from chainer.utils import argument
from chainer.utils import type_check
class Dropout(function.Function):
"""Dropout regularization."""
def __init__(self, dropout_ratio):
self.dropout_ratio = dropou... | kiyukuta/chainer | chainer/functions/noise/dropout.py | Python | mit | 2,140 |
__author__ = 'luis'
| lbarriosh/appengine-blog | entities/__init__.py | Python | agpl-3.0 | 20 |
import json
import os
import time
import pUtil
import re
from subprocess import Popen, PIPE, STDOUT
class Job:
""" Job definition """
def __init__(self):
self.jobId = '0' # panda job id
self.homePackage = None # package name
self.trf = None ... | PanDAWMS/pilot | Job.py | Python | apache-2.0 | 62,212 |
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commercial ... | qtproject/pyside-pyside | tests/QtWidgets/bug_307.py | Python | lgpl-2.1 | 1,901 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.