text
stringlengths
4
1.02M
meta
dict
from xpcom import components # This class is created by Python components when it # needs to return an enumerator. # For example, a component may implement a function: # nsISimpleEnumerator enumSomething(); # This could could simply say: # return SimpleEnumerator([something1, something2, something3]) class SimpleEnum...
{ "content_hash": "ab1e43faedf641fb0490a966d8736efd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 66, "avg_line_length": 31.428571428571427, "alnum_prop": 0.6893939393939394, "repo_name": "dgomez10/xanon", "id": "d3fb89a9d7573bf648b6a6086fc8240568a662b1", "size": "2391"...
from m5.params import * from System import System class ArmMachineType(Enum): map = {'RealView_EB' : 827, 'RealView_PBX' : 1901, 'VExpress_ELT' : 2272, 'VExpress_CA9' : 2272, 'VExpress_EMM' : 2272, 'VExpress_EMM64' : 2272} class ArmSystem(System): type =...
{ "content_hash": "75c190498127e76c7b860cdc49ae5503", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 119, "avg_line_length": 46.62068965517241, "alnum_prop": 0.6372041420118343, "repo_name": "wnoc-drexel/gem5-stable", "id": "a803a251b226ca3d655d8339cc7ff0253977886b", "size...
""" PLIF Temperature Calculator Created on Wed Feb 3 16:51:48 2016 @author: Darren Banks plif_temperature calculates temperature in a plane of rhodamine-B solution based on the intensity at which the rhodamine fluoresces under planar laser irradiation. plif_temperature requires the module plif_tools to run. ...
{ "content_hash": "7ab5fc09f3c38eaf082b48ddc97de6ec", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 78, "avg_line_length": 30.820833333333333, "alnum_prop": 0.6897390834121941, "repo_name": "darren6337/PLIFluorescence", "id": "52e65cc3f4e9b642a9c4ffc265485950dbd0dedb", "...
"""Solum Worker shell handler.""" import ast import base64 import json import os import random import shelve import string import subprocess from oslo_config import cfg from oslo_log import log as logging from oslo_utils import uuidutils from sqlalchemy import exc as sqla_exc import solum from solum.common import cl...
{ "content_hash": "0454d5dd34b5156ef3c7ea97cabf68ee", "timestamp": "", "source": "github", "line_count": 756, "max_line_length": 79, "avg_line_length": 43.51058201058201, "alnum_prop": 0.5329847388581505, "repo_name": "openstack/solum", "id": "096ca19c66e0e05d233811a6998cd529818f4088", "size": "3350...
import requests from .exceptions import HTTPError from .package import json2package session = requests.Session() def get(package_name, pypi_server="https://pypi.python.org/pypi/"): """ Construct a request to the PyPI server and returns an instance of :class:`yarg.package.Package`. :param package_n...
{ "content_hash": "dc37e87f64139aa3b436f59c90731f7d", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 32.21875, "alnum_prop": 0.623666343355965, "repo_name": "kura/yarg", "id": "11375ce1125b6950220e0ca648acf2f72104678a", "size": "2163", "binary": fa...
""" Bot code for creating chemical items in wikidata from UNII Adapted from: https://github.com/sebotic/cdk_pywrapper/blob/master/cdk_pywrapper/chemlib.py """ import os import re import subprocess import time import zipfile import pandas as pd import wikidataintegrator.wdi_core as wdi_core data_folder = "unii_data" ...
{ "content_hash": "2f6ebc5c42160480de20f9757f032eb5", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 118, "avg_line_length": 30.023696682464454, "alnum_prop": 0.5486977111286504, "repo_name": "SuLab/scheduled-bots", "id": "16fdee39cd883f89161a868d7235ae222ccc5b86", "size"...
import urlparse import functools from django.utils.decorators import method_decorator from django.core.exceptions import SuspiciousOperation def class_view_decorator(function_decorator): """ Convert a function based decorator into a class based decorator usable on class based Views. Follows the genera...
{ "content_hash": "7f7c742391c94235535d576818587169", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 101, "avg_line_length": 38.20967741935484, "alnum_prop": 0.6893203883495146, "repo_name": "indexofire/gork", "id": "f821959b8180b7c2f5f25dae92107ce3b4600a3b", "size": "2393...
""" Copyright 2013 OpERA Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwar...
{ "content_hash": "bec10ae2f5655aa8011ee6809266ec28", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 123, "avg_line_length": 29.220588235294116, "alnum_prop": 0.6109713135379969, "repo_name": "ComputerNetworks-UFRGS/OpERA", "id": "10beb830bed912d9e4b74e2e37be8d7a969c622a", ...
"""Program to convert power logging config from a servo_ina device to a sweetberry config. """ # Note: This is a py2/3 compatible file. from __future__ import print_function import os import sys def fetch_records(basename): """Import records from servo_ina file. servo_ina files are python imports, and ...
{ "content_hash": "3c7eda8ca46f0566b96df545a8916c92", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 74, "avg_line_length": 21.846153846153847, "alnum_prop": 0.5434272300469484, "repo_name": "coreboot/chrome-ec", "id": "1deb75cda441e9673ee77be9066e74eb8dafdb33", "size": "1...
import six from rip.schema.base_field import BaseField, FieldTypes from rip.schema.sub_resource_field import SubResourceField class ApiSchemaOptions(object): def __init__(self, meta_options, fields, declared_fields): if meta_options: for override_name in dir(meta_options): over...
{ "content_hash": "87e5087671cdd84be981d3b8745dad46", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 91, "avg_line_length": 34.27, "alnum_prop": 0.5736796031514444, "repo_name": "Aplopio/django_rip", "id": "9c357c665a37ee02d3b719ee5680f9540886d1ba", "size": "3427", "bin...
from django.apps import AppConfig class DuckConfig(AppConfig): name = 'duck'
{ "content_hash": "82841082ee7cd528b5f86fd716b6f7d9", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 16.6, "alnum_prop": 0.7349397590361446, "repo_name": "lastcoolnameleft/duckiehunt", "id": "dac60ff2216143273eb6354f40878126cafcdca6", "size": "83", ...
import opengm import numpy #--------------------------------------------------------------- # MinSum with SelfFusion #--------------------------------------------------------------- numpy.random.seed(42) gm=opengm.loadGm("/home/tbeier/models/mrf-inpainting/house-gm.h5","gm") #----------------------------------------...
{ "content_hash": "135973a0d0eec9bb1d83af15cedc29be", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 71, "avg_line_length": 25.647058823529413, "alnum_prop": 0.5344036697247706, "repo_name": "recarroll/opengm", "id": "a264d6bc574ffc48a962d89b5b4714e3293d2695", "size": "872...
"""A basic FTP server which uses a DummyAuthorizer for managing 'virtual users', setting a limit for incoming connections. """ import os from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import FTPServer def main(): # Instantiate a dummy authorize...
{ "content_hash": "679f7228ef04bff735bbeec6a13039a8", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 72, "avg_line_length": 29.58695652173913, "alnum_prop": 0.7046289493019838, "repo_name": "kugg/micromaker", "id": "bb2a387a8fb8e750d5ac5371c59f3648bc75078b", "size": "1540"...
import ConfigParser class Tenant(): def __init__(self): self.config = ConfigParser.ConfigParser() def load_properties(self, project_name=None): self.config.read('igor.ini') def get_property(self, name, default=None): try: value = self.config.get('igor', name) ...
{ "content_hash": "dc4dd0b70c4de6ef8b60df907f8aa112", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 49, "avg_line_length": 27.11111111111111, "alnum_prop": 0.5942622950819673, "repo_name": "wdsx/igor", "id": "b1365653c714c50f3dcbe2f1c350600e7adfa795", "size": "488", "bi...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('movielists', '0006_auto_20150412_1316'), ] operations = [ migrations.AlterField( model_name='movie', name='image', ...
{ "content_hash": "650ed45d79c119609c8e75fbef97220d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 23.05263157894737, "alnum_prop": 0.5844748858447488, "repo_name": "kiriakosv/movie-recommendator", "id": "7e7b1dcccd58e4990efd937f1594fbfbb8b6429f", ...
""" rcecho - runs a robotcomm echo server as a console application. Author: JMJ """ import argparse import logging import pprint import re import sys import time from robotutils import logging_helper from robotutils.comm_helper import EchoServer _LOGGER = logging.getLogger('rcecho') _TRACE = logging_helper.LevelSpec...
{ "content_hash": "13976e7f5014ad7afc9e670e3e14dcd7", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 80, "avg_line_length": 31.728682170542637, "alnum_prop": 0.6474468604935255, "repo_name": "josephmjoy/robotics", "id": "0d12eedc13f7df309a2e5db98162d1af0b35dc1f", "size": ...
__author__ = 'juraseg' from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from product_spiders.items import Product, ProductLoader import logging class ComeCoUkSpider(BaseSpider): name = 'comet.co.uk' allowed_domains = ['comet.co.uk'] star...
{ "content_hash": "5e4dc808e5f98492d81bcc44a37106d3", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 144, "avg_line_length": 42.18811881188119, "alnum_prop": 0.6153485097394977, "repo_name": "ddy88958620/lib", "id": "c32f2e02f90c0d4f2a22f5a1ce2d0f58124bc7cc", "size": "426...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'User.id_card' db.add_column(u'intranet_user', 'id_card', self.gf('django.db.models.fields.Char...
{ "content_hash": "3f1409cc361f2070cc213c2ee9266c70", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 267, "avg_line_length": 77.11061946902655, "alnum_prop": 0.5508119584552705, "repo_name": "kaleidos/intranet", "id": "03f2161162b99f6b608025bbf4117441a3fa8eca", "size": "1...
from __future__ import division from builtins import str from builtins import range from past.utils import old_div from numpy import * def interpolate(master,slave1,slave2): if master[0]<-999: return array([slave1[0],abs(slave1[1]),slave1[2]]) x = master[0] alpha = old_div((x-slave1[0]),(slave...
{ "content_hash": "d6c14c9cb9c782ea5c911da8de1c6a78", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 25.53684210526316, "alnum_prop": 0.5032976092333058, "repo_name": "erdc/proteus", "id": "b69f425026839b92ce05f7a1cbd35e89fe851aaa", "size": "2449", ...
from django.dispatch import Signal transfer_completed = Signal(providing_args=['instance']) transfer_failed = Signal(providing_args=['instance'])
{ "content_hash": "4769bef374566f3b5fcc8a19e172eaf8", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 56, "avg_line_length": 36.75, "alnum_prop": 0.782312925170068, "repo_name": "iiman/mytardis", "id": "585ac4a1f0f6f228e3c4738959d0583a1a263b21", "size": "147", "binary": fa...
import django.dispatch # pylint: disable-msg=C0103 emitted_notices = django.dispatch.Signal( providing_args=["batches", "sent", "sent_actual", "run_time"] )
{ "content_hash": "a3b0d9eaa3aca1ca51b516854e977f79", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 65, "avg_line_length": 23.285714285714285, "alnum_prop": 0.7116564417177914, "repo_name": "GeoNode/geonode-notification", "id": "ac3f6487ba4d7aeceef529b5a26e70f9e705ff32", "...
import sys import pytest from autoclass import autorepr @pytest.mark.skipif(sys.version_info < (3, 6), reason="class vars order is not preserved") @pytest.mark.parametrize('only_public_fields', [True, False], ids=lambda x: 'only_public' if x else 'including class-private dunder fields') @pytest.mark.parametrize('on...
{ "content_hash": "32696d2c3befd3760b73d64ad9b1d57b", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 140, "avg_line_length": 36.216981132075475, "alnum_prop": 0.5425892159416514, "repo_name": "smarie/python-classtools-autocode", "id": "985bd52bcb8c72ee97d4c02c96450cdfb17f82...
import os import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot import matplotlib.pyplot as plt import time import datetime import argparse import numpy as np import pandas as pd from random import SystemRandom from sklearn import model_selection import torch import torch.nn as nn from torch.nn....
{ "content_hash": "07858399d807dc5429ba3e4a12d66177", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 170, "avg_line_length": 39.68923076923077, "alnum_prop": 0.6692766881153578, "repo_name": "YuliaRubanova/latent_ode", "id": "f10533171fc2500396059377961b6d856c333f10", "si...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl.testing import parameterized from tensorflow.core.protobuf import config_pb2 from tensorflow.python import tf2 from tensorflow.python.client import session from tensorflow.python.eager impo...
{ "content_hash": "afa61ca19589ca43573d2ba3e96a319c", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 112, "avg_line_length": 43.204301075268816, "alnum_prop": 0.6961174713787954, "repo_name": "DavidNorman/tensorflow", "id": "2b03906660dac407a41e1c21e29b6a837003fab9", "siz...
import logging # Methods from statsbiblioteket.github_cloner.github_cloner \ import \ github_backup, \ fetch_or_clone, \ get_github_repositories, \ parse_github_repositories, \ create_parser # This import is important for the sphinx-argparse docs # Types from statsbiblioteket.github_cloner.gi...
{ "content_hash": "6101679aef550de634f1774690db1358", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 24.166666666666668, "alnum_prop": 0.6862068965517242, "repo_name": "blekinge/github_cloner", "id": "fd0cdf11d6ec397588e6de1133368e1cad4eff69", "size"...
from django.contrib import admin from .models import FacebookStatus, Subreddit, UserSubreddit class FacebookStatusAdmin(admin.ModelAdmin): list_display = ['__str__', 'author', 'status', 'publish_timestamp'] list_editable = ['status',] list_filter = ['author', 'status', 'publish_timestamp'] admin.site.reg...
{ "content_hash": "7ab8e8ae101372ce61fb07f9de47afb2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 71, "avg_line_length": 33, "alnum_prop": 0.752913752913753, "repo_name": "orlenko/FBBot", "id": "012ef9b134a55e628d19a08e0e2151d0fea8ea47", "size": "429", "binary": false...
from flask import Flask from flask import render_template app = Flask("__main__") @app.route("/") def hello(): return render_template("yatta.html") if __name__ == "__main__": app.run(debug=True)
{ "content_hash": "7a72da3ea8e12fc4c0a936d37d1c811b", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 40, "avg_line_length": 18.727272727272727, "alnum_prop": 0.6359223300970874, "repo_name": "Tritlo/yatta-py", "id": "cd8f8fad9b4ce4e5ea8f48949b1670884eb9515a", "size": "206"...
import chainer import chainer.backends from chainer.backends.cuda import cupy import chainer.links as L import chainer.testing import chainermn import numpy as np import pytest class Param(object): def __init__(self, param): self.dtype = None self.__dict__.update(param) params = [Param(p) for p ...
{ "content_hash": "42be6c958e0a2312fc67d11985ba3853", "timestamp": "", "source": "github", "line_count": 461, "max_line_length": 79, "avg_line_length": 32.62689804772234, "alnum_prop": 0.6103982447975533, "repo_name": "wkentaro/chainer", "id": "6d8d91758a8f2447408cdf3cfcc2625783a187bf", "size": "150...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals import flexmock import pytest from atomic_reactor.core import DockerTasker from ato...
{ "content_hash": "8d2cd58810a8552fdca13dcd6059e8fa", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 84, "avg_line_length": 35.04705882352941, "alnum_prop": 0.6307485733467607, "repo_name": "jarodwilson/atomic-reactor", "id": "d7e8da413e2f82b2e631ceee893b1a40e6447bd9", "si...
from JumpScale import j import time descr = """ This jumpscript waits timeout sec (test) """ category = "test" organization = "jumpscale" author = "[email protected]" license = "bsd" version = "1.0" roles = [] def action(msg, waittime): j.logger.log(msg, level=5, category="test.wait") time.sleep(waittime...
{ "content_hash": "4b0765f755569665578c43744801f71a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 52, "avg_line_length": 17.736842105263158, "alnum_prop": 0.6824925816023739, "repo_name": "Jumpscale/jumpscale_core8", "id": "b68b4f995d8796ef0bb1181e453f49faf4674cf8", "si...
from distutils.core import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest pytest.main(se...
{ "content_hash": "77797ef028469fedc77e1a6fe55afea1", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 61, "avg_line_length": 29.545454545454547, "alnum_prop": 0.6492307692307693, "repo_name": "gngdb/variational-dropout", "id": "e2b6028911d1d91defb35849e15dc744d87d865a", "si...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Category', fields=[ ('cat_id', models.IntegerField(serialize=False, pri...
{ "content_hash": "bb39b95085edc1ad5910232855631c44", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 83, "avg_line_length": 23.045454545454547, "alnum_prop": 0.5305719921104537, "repo_name": "speedaddict81/Eventsite", "id": "5116b2e05d9e93bfcc27c3a45bdddbbe1777094b", "size...
from alembic.operations import Operations from alembic import util # create proxy functions for # each method on the Operations class. util.create_module_class_proxy(Operations, globals(), locals())
{ "content_hash": "d4641880ddaa392883ffe28ec0c2145b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 63, "avg_line_length": 33.333333333333336, "alnum_prop": 0.8, "repo_name": "shadowmint/py-test-watcher", "id": "6934ccc8aa2050213169d69676830ab4f2d5cb51", "size": "200", "...
from flask import Flask, render_template from flask_weixin import Weixin from beijing_bus import BeijingBus # 查询示例 QUERY_EXAMPLE = '查询示例: 从西坝河到将台路口西' # 用户关注公众号时给他推送一条消息 ON_FOLLOW_MESSAGE = { 'title': '使用说明', 'description': '', 'picurl': 'http://doora.qiniudn.com/H9v9n.jpg', 'url': 'http://t.cn/Rz0J1...
{ "content_hash": "1457f9f5feededf2e4be1e3af2198c18", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 80, "avg_line_length": 26.99137931034483, "alnum_prop": 0.6183328010220377, "repo_name": "wong2/beijing_bus", "id": "ea91e54a42679b91041643bdc00fdc7c827bf912", "size": "33...
import sys, pygame, time,random from pygame.locals import * def print_text(font, x, y, text, color=(255, 255, 255)): imgText = font.render(text, True, color) screen.blit(imgText, (x, y)) # main program brgains pygame.init() screen = pygame.display.set_mode((600, 500)) font1 = pygame.font.Font(None, 24) f...
{ "content_hash": "8c3bd049b8a8c116c4e653d74c82ffd6", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 67, "avg_line_length": 27.104477611940297, "alnum_prop": 0.5638766519823789, "repo_name": "sun1218/Pygames", "id": "274fa11c218f3b511b9bc9e8d812991f7c6e6e79", "size": "1816...
import grpc from google.cloud.automl_v1beta1.proto import prediction_service_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_prediction__service__pb2 class PredictionServiceStub(object): """AutoML Prediction API. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.C...
{ "content_hash": "a944c455e87ba49486f33d72f6e89685", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 147, "avg_line_length": 37.46666666666667, "alnum_prop": 0.7301304863582444, "repo_name": "jonparrott/gcloud-python", "id": "adfd74458e4e378bc76cfe13acce43d8970ce2cd", "siz...
import frappe from frappe.utils import escape_html, get_request_site_address, now, cstr from urllib.parse import quote, urljoin no_cache = 1 base_template_path = "www/rss.xml" def get_context(context): """generate rss feed""" host = get_request_site_address() blog_list = frappe.db.sql("""\ select route as name...
{ "content_hash": "7024d514b1a702a4d75138100836047c", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 82, "avg_line_length": 26.23076923076923, "alnum_prop": 0.6930596285434996, "repo_name": "almeidapaulopt/frappe", "id": "093cdf2d19b53a7680b9b2c77b13ed9b2dbf44cb", "size": ...
import zlib from extension import Extension from deflate_frame import DeflateFrame class DeflateMessage(Extension): """ Implementation of the "permessage-deflate" extension, as defined by http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-17. Note: this implementetion is only eligible...
{ "content_hash": "01e2a8d398c61097ca556ab4dbf3bf50", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 78, "avg_line_length": 37.561797752808985, "alnum_prop": 0.6054442117858211, "repo_name": "taddeus/wspy", "id": "5cf0573987da1663c4d795fa40ea9834a2f01990", "size": "3343", ...
"""setup.py for Brax. Install for development: pip intall -e . """ from setuptools import find_packages from setuptools import setup setup( name="brax", version="0.0.15", description=("A differentiable physics engine written in JAX."), author="Brax Authors", author_email="[email protected]",...
{ "content_hash": "7ac5195db1ceac1e58e11860996de26a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 69, "avg_line_length": 26.54237288135593, "alnum_prop": 0.5798212005108557, "repo_name": "google/brax", "id": "9ea6e535f8696c7d09edeac49b65cc21d8aca6d2", "size": "2148", ...
import sqlite3, os from itunes import get_library_file, ITunes from hplatform import get_db_path, get_default_path def get_music_files(dir): music_files = [] for root, dirs, files in os.walk(dir): for file in files: if is_music_file(file): #trying to catch the special case in Ubuntu where $HOME/Network ...
{ "content_hash": "283e90e4714fd637b2bbf2758349b24c", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 72, "avg_line_length": 27.178217821782177, "alnum_prop": 0.654280510018215, "repo_name": "JustinTulloss/harmonize.fm", "id": "047fff0a77e0a8575c7861b44611ddf70767f401", "s...
""" AMQP Managment Entity """ from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import itertools, re import sys if sys.version_info[0] > 2: # Python 3 does not have a unicode() builtin method, # luckily all st...
{ "content_hash": "72166a3761d3b3450058bcdd6949fb7e", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 92, "avg_line_length": 31.8, "alnum_prop": 0.6088534107402032, "repo_name": "irinabov/debian-qpid-dispatch", "id": "a7d703a2427e54101d288f3f54a04a9c8a1a4fdf", "size": "492...
""" The :mod:`surprise.prediction_algorithms.algo_base` module defines the base class :class:`AlgoBase` from which every single prediction algorithm has to inherit. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from .. import similarities as sims from...
{ "content_hash": "786201f054be95280544b2d2a5db1b5b", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 79, "avg_line_length": 38.342007434944236, "alnum_prop": 0.5782431646305992, "repo_name": "charmoniumQ/Surprise", "id": "8f88186404663f0331392a95bc18d7c6597fa44b", "size":...
from distutils.core import setup, Extension import os ROOT = os.path.dirname(__file__) module1 = Extension( 'prefixtrie', include_dirs = [ os.path.join(ROOT, os.pardir, os.pardir, "C++", "prefixtrie"), ], sources = ['prefixtrie.cpp'], extra_compile_args = ['-std=c++11', '-g'] ) se...
{ "content_hash": "d59f72411392ed8e9f18e5b725014d3f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 70, "avg_line_length": 24.82608695652174, "alnum_prop": 0.5919439579684763, "repo_name": "AeroNotix/algostructure", "id": "8ecf1c1e8f4b642a0c2b2cb9925faf23b121b874", "size"...
""" ** OBS This module is not yet used by Evennia ** Example module holding functions for out-of-band protocols to import and map to given commands from the client. This module is selected by settings.OOB_FUNC_MODULE. All functions defined global in this module will be available for the oob system to call. They...
{ "content_hash": "dfc51db0b6f6c4dea04487d4ffff77de", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 29.978494623655912, "alnum_prop": 0.6255380200860832, "repo_name": "TaliesinSkye/evennia", "id": "ab3ca66e9bf8ac9dd92b222bf40c1973dd86c7bc", "size": ...
""" Script to cache anonymous houseprint data into hp_anonymous.pkl Created on 05/07/2014 by Roel De Coninck """ import os, sys import inspect script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # add the path to opengrid to sys.path sys.path.append(os.path.join(script...
{ "content_hash": "b6249498b74927a9f211643888f022c8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 86, "avg_line_length": 26.26923076923077, "alnum_prop": 0.6412884333821376, "repo_name": "MatteusDeloge/opengrid", "id": "fca7be3147e819ac38c9b6e1925f4860505ecd65", "size":...
from twisted.names import dns, server, client, cache from twisted.application import service, internet from twisted.internet import defer from twisted.python import log import txredisapi class RedisResolverBackend(client.Resolver): def __init__(self, redis, servers=None): self.redis = redis client....
{ "content_hash": "42105212c8cbb71f5eab7190db20c2ef", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 119, "avg_line_length": 36.41463414634146, "alnum_prop": 0.6878767582049564, "repo_name": "nbari/my-sandbox", "id": "2b8e8548f7134780033fa448d0cf4e9ffbd5a53d", "size": "181...
from airflow import DAG from airflow.providers.google.cloud.operators import kubernetes_engine from airflow.providers.google.cloud.transfers import gcs_to_bigquery default_args = { "owner": "Google", "depends_on_past": False, "start_date": "2021-03-01", } with DAG( dag_id="chicago_crime.crime", d...
{ "content_hash": "01e93a8ba950444514f4358cb6d40868", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 88, "avg_line_length": 42.39047619047619, "alnum_prop": 0.5472927432037744, "repo_name": "GoogleCloudPlatform/public-datasets-pipelines", "id": "1378546471c61d3e13ad60b309dd...
import sys import urllib2 import base64 import BaseHTTPServer import SocketServer import httplib import urllib import urlparse from StringIO import StringIO import gzip import rpcrequest import rpcresponse import rpcerror import rpclib from rpcjson import json def http_request(url, json_string, username = None, passw...
{ "content_hash": "390a90be25b5287158daf1d5f1b12674", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 82, "avg_line_length": 26.5487012987013, "alnum_prop": 0.581264522440993, "repo_name": "moritz-wundke/Concurrent", "id": "8041fb3ea71939a6f22cebb9372f83f790bef1c6", "size"...
import os import requests import datetime import re import json import sys import traceback url = 'https://api.github.com/repos/cocos2d/cocos2d-x/pulls?state=open&sort=created&direction=desc' job_trigger_url=os.environ['JOB_PULL_REQUEST_BUILD_TRIGGER_URL'] access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"A...
{ "content_hash": "20c32c4e9ca40d4dc36d065113296b90", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 99, "avg_line_length": 29.183098591549296, "alnum_prop": 0.6443050193050193, "repo_name": "dios-game/dios-cocos", "id": "cb8b301850031dd50fc59635ab2a9c5162b13428", "size": ...
import os import sys import django from django.conf import settings from django.test.utils import get_runner def run_test(): TestRunner = get_runner(settings) test_runner = TestRunner() failures = test_runner.run_tests(["lbworkflow"]) sys.exit(bool(failures)) if __name__ == "__main__": os.envir...
{ "content_hash": "92e3014201ef8548889de78977e7ee65", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 22.875, "alnum_prop": 0.663023679417122, "repo_name": "vicalloy/django-lb-workflow", "id": "ef9cdd55fadc733d540091323f2cfcf3c0457dd8", "size": "571",...
import os from tests.test_util import build_ts_session, build_ts_specimen_session from yodatools.converter.Outputs.yamlOutput import yamlOutput curr_folder = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) # curr_folder = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) # file...
{ "content_hash": "c0bd0651b04034967a43ded2604b37bd", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 105, "avg_line_length": 41.13636363636363, "alnum_prop": 0.687292817679558, "repo_name": "ODM2/YODA-Tools", "id": "5920eada9d86f10158ac2aa9004a0d880d471732", "size": "905",...
''' Support for the Git SCM ''' from __future__ import absolute_import # Import python libs import copy import logging import os import re from distutils.version import LooseVersion as _LooseVersion # Import salt libs import salt.utils import salt.utils.files import salt.utils.itertools import salt.utils.url from sal...
{ "content_hash": "2709eb1517c8e374ccfe944d0f207a8b", "timestamp": "", "source": "github", "line_count": 3995, "max_line_length": 137, "avg_line_length": 32.858573216520654, "alnum_prop": 0.5706787537137198, "repo_name": "stephane-martin/salt-debian-packaging", "id": "0eda16a68a00ef75de64fee8fd5099d5c...
import os import array import unittest import struct import inspect from test import test_support as support from test.test_support import (check_warnings, check_py3k_warnings) import sys ISBIGENDIAN = sys.byteorder == "big" IS32BIT = sys.maxsize == 0x7fffffff integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', '...
{ "content_hash": "faf78d619d99d3d0012637902eacd060", "timestamp": "", "source": "github", "line_count": 581, "max_line_length": 84, "avg_line_length": 41.5645438898451, "alnum_prop": 0.4938506770466686, "repo_name": "Sing-Li/go-buildpack", "id": "2e613f7577bb79a91736c55c01d863762c3f74d3", "size": "...
import contextlib import errno import ftplib import logging import os import random import re import select import shutil import socket import stat import sys import tempfile import time import warnings import mock from pyftpdlib._compat import b from pyftpdlib._compat import PY3 from pyftpdlib._compat import u from ...
{ "content_hash": "d61008b4fcafbaa0eaf30d9d7a674e63", "timestamp": "", "source": "github", "line_count": 2833, "max_line_length": 79, "avg_line_length": 38.55771267207907, "alnum_prop": 0.5840214585202409, "repo_name": "aliyun/oss-ftp", "id": "d46e0b5b4c8ca6a39c7e8ed43ee127364033e687", "size": "1094...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import range from future import standard_library standard_library.install_aliases() import sys PYTHON_VERSION = sys.version_info[:3] PY2 = (PYTHON_VERSION[0...
{ "content_hash": "ab7794ecfa227e6b323d9b76318f0688", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 105, "avg_line_length": 29.08910891089109, "alnum_prop": 0.6031313818924439, "repo_name": "andreadean5/python-hpOneView", "id": "aeb0d1650d48dd93b91734ade05d842186caf114", ...
import os from flask_admin import Admin, BaseView, form, expose, AdminIndexView from flask_admin.contrib.sqla import ModelView from flask_security import current_user #from app.term_bp.forms import PrintForm from app.extensions import db from app.models import Category, Term, Rule, Document, Link from app.config impo...
{ "content_hash": "ebe29004bb4b175369d4b0321d121cf7", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 105, "avg_line_length": 31.972972972972972, "alnum_prop": 0.6151028458720766, "repo_name": "atindale/business-glossary", "id": "9d2b3702a8b88bee04ab8b6c92689bda96589b73", ...
""" Copyright 2016, Michael DeHaan <[email protected]> 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...
{ "content_hash": "3bf179a6d11b773d589f1f6d8626673e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 72, "avg_line_length": 28.680555555555557, "alnum_prop": 0.6779661016949152, "repo_name": "mpdehaan/camp", "id": "e6a1d067b7a30a5ef4c1339502ffcc30e5f44580", "size": "2065",...
"""2014_托管通知接口""" import clr, sys from action import * from lang import Lang clr.AddReference('ZyGames.Framework.Game') clr.AddReference('ZyGames.Doudizhu.Lang') clr.AddReference('ZyGames.Doudizhu.Model') clr.AddReference('ZyGames.Doudizhu.Bll') from ZyGames.Framework.Game.Service import * from ZyGames.Doudiz...
{ "content_hash": "c56b3a0c51e00c3929bd2652bb4e7a8f", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 56, "avg_line_length": 29.571428571428573, "alnum_prop": 0.6846100759144237, "repo_name": "wenhulove333/ScutServer", "id": "0de2699d7be96a66fbdf56c230e595938b5017be", "size...
import socket def netcat(hostname, port, content): data = "" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((hostname, port)) s.sendall(content) s.shutdown(socket.SHUT_WR) while 1: buff = s.recv(1024) if buff == "": break else: d...
{ "content_hash": "b3dddb2a2274860bf1d518c92fbf5e7b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 57, "avg_line_length": 22.625, "alnum_prop": 0.5497237569060773, "repo_name": "keedio/nagios-hadoop", "id": "7f8d0f561b31569e15e0a276370852e80a283a3f", "size": "1260", "b...
import serial import time import json #ser = serial.Serial("/dev/ttyS0", 9600) ser = serial.Serial("/dev/ttyS0", 9600, timeout=0.2) def main(): while True: #Waiting for LoRa module message from uart port. count = ser.inWaiting() if count != 0: recv = ser.readline() #readline() ...
{ "content_hash": "dc7a430c62833e21d29c98ccc6267092", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 95, "avg_line_length": 39.61538461538461, "alnum_prop": 0.5106796116504855, "repo_name": "Python-IoT/Smart-IoT-Planting-System", "id": "36d04491476caf8aed0553c4c8fd5511d0acfb...
import logging import pymysql LOG = logging.getLogger(__name__) class _ConnectionWrapper(object): def __init__(self, database_settings): self._settings = database_settings try: self._conn = pymysql.connect( host=database_settings.host, port=database_se...
{ "content_hash": "651c989527f2905c921eba7e100bb8ac", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 77, "avg_line_length": 37.30263157894737, "alnum_prop": 0.5675485008818342, "repo_name": "SVilgelm/CloudFerry", "id": "2c9388ed6c4a202b6260e5a49fc272d7fb76f933", "size": "3...
"""Config flow for AirNow integration.""" import logging from pyairnow import WebServiceAPI from pyairnow.errors import AirNowError, InvalidKeyError import voluptuous as vol from homeassistant import config_entries, core, exceptions from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_RAD...
{ "content_hash": "b98adb00d8de707f0b54e23a6b54bf39", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 104, "avg_line_length": 32.58181818181818, "alnum_prop": 0.6124441964285714, "repo_name": "adrienbrault/home-assistant", "id": "b4de58808da3610bf5a0f206a4c16d59530bd70c", ...
from django import forms class CustomLockdownForm(forms.Form): """A form to test the behavior of using custom forms for authentication.""" answer = forms.IntegerField() def clean_answer(self): """Clean the answer field, by checking its value.""" if self.cleaned_data['answer'] == 42: ...
{ "content_hash": "b5fdcdfaa3a74ce72b0c5d975c674a56", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 30.076923076923077, "alnum_prop": 0.6572890025575447, "repo_name": "Dunedan/django-lockdown", "id": "885d8775bc0af5cee13cc8c71852ea06148a55b6", "size...
from __future__ import absolute_import import collections import logging import os import re from pip._vendor import six from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.pkg_resources import RequirementParseError from pip._internal.exceptions import BadCommand, InstallationError from pip._i...
{ "content_hash": "8fa1c4f1e53bbee5e4688eecdfbdcef4", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 79, "avg_line_length": 38.475095785440615, "alnum_prop": 0.5140410276837284, "repo_name": "kenxwagner/PythonPlay", "id": "36a5c339a2ab22debec595af17a520a803f2a783", "size"...
from keystoneclient import base from keystoneclient import exceptions from keystoneclient.i18n import _ from keystoneclient.v3 import endpoints from keystoneclient.v3 import projects OS_EP_FILTER_EXT = 'OS-EP-FILTER' class EndpointFilterManager(base.Manager): """Manager class for manipulating project-endpoint ass...
{ "content_hash": "df4cac7bcae79fa50ccc7935288863c5", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 90, "avg_line_length": 40.108695652173914, "alnum_prop": 0.6260162601626016, "repo_name": "ging/python-keystoneclient", "id": "04e97fa821af1899223821d855d5f7c73151cfe1", "...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
{ "content_hash": "c40dbdd7d4cca0d1310cde5431bbc3ba", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 86, "avg_line_length": 30.965686274509803, "alnum_prop": 0.5662498021212601, "repo_name": "mmottahedi/neuralnilm_prototype", "id": "32a34bb0c1fb3838f3a616d6f8b0e1c7f5534a1c"...
from nova.openstack.common import importutils from nova.openstack.common import log as logging LOG = logging.getLogger(__name__) class VFS(object): @staticmethod def instance_for_image(imgfile, imgfmt, partition): LOG.debug(_("Instance for image imgfile=%(imgfile)s " "imgfmt=%(im...
{ "content_hash": "ca969908e52b6222332c195bf49d763f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 70, "avg_line_length": 29.213675213675213, "alnum_prop": 0.6208308952603862, "repo_name": "qwefi/nova", "id": "b6cff39fb6c657668418cdeced65cd849333bbee", "size": "4037", ...
from django.db.backends.base.introspection import BaseDatabaseIntrospection, FieldInfo #from the JDBC Informix driver SQ_TYPE_BYTE = 11 SQ_TYPE_CHAR = 0 SQ_TYPE_DATE = 7 SQ_TYPE_DATETIME = 10 SQ_TYPE_REAL = 4 SQ_TYPE_SMFLOAT = 4 SQ_TYPE_DECIMAL = 5 SQ_TYPE_NUMERIC = 5 SQ_TYPE_FLOAT = 3 SQ_TYPE_DOUBLE = 3 SQ_TYPE_INTEG...
{ "content_hash": "fe08bdba2cf15924da51d86ebfc877ef", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 310, "avg_line_length": 42.79, "alnum_prop": 0.5493105865856509, "repo_name": "nutztherookie/django-informix", "id": "0b16b0a2389af5a822286ec6c364d1cece055ba9", "size": "8...
""" This defines how to edit help entries in Admin. """ from django import forms from django.contrib import admin from evennia.help.models import HelpEntry class HelpEntryForm(forms.ModelForm): "Defines how to display the help entry" class Meta: model = HelpEntry fields = '__all__' db_he...
{ "content_hash": "086e5c70001072750bb372ac533c0505", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 116, "avg_line_length": 34.794871794871796, "alnum_prop": 0.6123802505526897, "repo_name": "emergebtc/muddery", "id": "cffc14784d03c0166b846f971539d106af4f6c9b", "size": "1...
import os from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Schtasks', 'Author': ['@mattifestation', '@harmj0y'], 'Description': ('Persist a stager (or script) using schtasks running as SYSTEM. This ha...
{ "content_hash": "fc82f1c2ceac95db29766c82c8a7ba88", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 203, "avg_line_length": 42.220408163265304, "alnum_prop": 0.4947795823665893, "repo_name": "drshellface/Empire", "id": "3f130c0e437caed1d909449a708226b368ed7671", "size": ...
from .tabulate import _text_type import binascii def pad(field, total, char=u" "): return field + (char * (total - len(field))) def get_separator(num, header_len, data_len): sep = u"***************************[ %d. row ]***************************\n" % (num + 1) return sep def format_field(value): #...
{ "content_hash": "fe278800887a887ed05cd90fccc6c4e7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 29.918367346938776, "alnum_prop": 0.5593451568894953, "repo_name": "mdsrosa/mycli", "id": "128e9c690ce0d78d9ed614899c51da8c624ce63a", "size": "1466",...
import numpy as np import functools import scipy.interpolate from . import _transforms def requires_transform(func): @functools.wraps(func) def wrapper(self, *args, **kwargs): if self.transform is None: raise ValueError("No transform set for {} object {}".format(type(self), self)) ...
{ "content_hash": "55464e142b0b8cc7f2466427fc42f684", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 109, "avg_line_length": 33.54609929078014, "alnum_prop": 0.5531712473572938, "repo_name": "openmrslab/suspect", "id": "0449cb28db81c4eeea66f88953fe0706c834a3fd", "size": "...
from werkzeug.security import generate_password_hash, check_password_hash from flask_login import UserMixin from app import login_manager, db class User(UserMixin, db.Model): """ 用户账号信息 """ __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(32),...
{ "content_hash": "e399787d962a9b4d0f738c54298c3b40", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 79, "avg_line_length": 28.285714285714285, "alnum_prop": 0.6406926406926406, "repo_name": "lvhuiyang/cxcy-ims", "id": "fbf937b064475a053e460feaee244dd5842a114a", "size": "1...
import os import houseKeeper import graphLib import alignerRobot from operator import itemgetter from itertools import groupby # ## 0) Preprocess by removing embedded contigs (I: contigs.fasta ; O : noEmbed.fasta) def obtainLength(folderName, fileName): f = open(folderName + fileName, 'r') tmp = f.readline()....
{ "content_hash": "fc80a76770ed6421401cf030fa4920a1", "timestamp": "", "source": "github", "line_count": 642, "max_line_length": 262, "avg_line_length": 31.25545171339564, "alnum_prop": 0.5466460679756803, "repo_name": "kakitone/finishingTool", "id": "60e7939edaea8239114483ee2d60f81011429318", "size...
"""Built-in activation functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.keras import backend as K from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object from tensorflow.python.keras.ut...
{ "content_hash": "517ecc950b96050213ab63a92fdb8d06", "timestamp": "", "source": "github", "line_count": 560, "max_line_length": 80, "avg_line_length": 30.76607142857143, "alnum_prop": 0.6702072087759011, "repo_name": "aldian/tensorflow", "id": "119851f4e133d74b25595b359ac535592539029d", "size": "17...
from __future__ import unicode_literals, division, absolute_import import logging import re from requests import RequestException from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached from flexget.utils.trakt import get_api_url, get_se...
{ "content_hash": "bbe2258c8a47701ca1b484a4749c9e0a", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 121, "avg_line_length": 39.73426573426573, "alnum_prop": 0.5323829637451601, "repo_name": "v17al/Flexget", "id": "e38e678b3978feae1b581dd83074ae7dcae42395", "size": "5682"...
import os, pytest import subprocess from quarkc import _metadata def is_excluded_file(name): if "quarkc/lib/" in name or name == "reflector": return True else: return False def is_runtime(path): return "quark_" in path and "_runtime" in path def filter_builtin(content): """Filter out...
{ "content_hash": "2af6224f72bb24718b71eaa9c1637538", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 101, "avg_line_length": 33.8421052631579, "alnum_prop": 0.5847589424572317, "repo_name": "datawire/quark", "id": "8d237008d6b731eacb50316ae637bd645f6f32bb", "size": "3167",...
BOT_NAME = 'vagascrawler' SPIDER_MODULES = ['vagascrawler.spiders'] NEWSPIDER_MODULE = 'vagascrawler.spiders' # Crawl responsibly by identifying yourself (and your website) on the user-agent #USER_AGENT = 'vagascrawler (+http://www.yourdomain.com)' # Configure maximum concurrent requests performed by Scrapy (defaul...
{ "content_hash": "fc1175a3dd0716b5dfed16ef1c9fb7bb", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 109, "avg_line_length": 34.10126582278481, "alnum_prop": 0.781365998515219, "repo_name": "berlotto/openjobs-scraper", "id": "7dce27b29ac889677a50356d86e7064b612a76bd", "siz...
__author__ = "Christian Schwede <[email protected]>" name = 'swquota' entry_point = '%s.middleware:filter_factory' % (name) version = '0.1' from setuptools import setup, find_packages setup( name=name, version=version, description='Swift quota middleware', license='Apache License (2.0)', author='Op...
{ "content_hash": "e249ecebd5078649bc649eaa71853deb", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 61, "avg_line_length": 31.379310344827587, "alnum_prop": 0.6241758241758242, "repo_name": "garvenshen/swquota", "id": "825b3a54bb268f8a876059daafa62ca123577632", "size": "9...
"""Show the difference between two dicom files. """ # Copyright (c) 2008-2012 Darcy Mason # This file is part of pydicom, relased under an MIT license. # See the file license.txt included with this distribution, also # available at http://pydicom.googlecode.com from __future__ import print_function usage = """ ...
{ "content_hash": "b6fa99eacea7eb022ffd74f2f3f62f74", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 90, "avg_line_length": 27.711111111111112, "alnum_prop": 0.6920609462710505, "repo_name": "njvack/yadda", "id": "2dd91c64ada251e3442edbc9c607482e247166b2", "size": "1262", ...
from os import path, pardir import sys import logging # not used in this stub but often useful for finding various files PROJECT_ROOT_DIRPATH = path.join(path.dirname(__file__), pardir, pardir) sys.path.append(PROJECT_ROOT_DIRPATH) # Third-party modules import click from dotenv import find_dotenv, load_dotenv # Hand-...
{ "content_hash": "17d96cc95c99d28d0d03cb3de1d06a52", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 81, "avg_line_length": 28.107692307692307, "alnum_prop": 0.6759715380405036, "repo_name": "gciteam6/xgboost", "id": "ee37f1c7f447fc33e87f0646a8f8d9a12548b3a9", "size": "184...
__author__ = 'Lukasz Augustyniak' import logging from datetime import datetime from pprint import pprint from sklearn.linear_model import LogisticRegression from textlytics.sentiment.sentiment import Sentiment from textlytics.sentiment.io_sentiment import results_to_pickle log = logging.getLogger(__name__) ALL_CLA...
{ "content_hash": "98fa79b9486c9cd93148413ea811eb8a", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 88, "avg_line_length": 37.05106382978723, "alnum_prop": 0.5704605489835765, "repo_name": "laugustyniak/textlytics", "id": "c12a76ca1ad35bc2d3df0a7847f5c7c862ef6271", "size...
from zeit.cms.i18n import MessageFactory as _ import zeit.cms.browser.menu import zeit.cms.browser.view import zeit.cms.repository.interfaces import zeit.connector.interfaces import zope.event class Reload(zeit.cms.browser.view.Base): """Reload folder (invalidate cache).""" def __call__(self): zope.e...
{ "content_hash": "63ed79ff73f73e823da3954736b26156", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 77, "avg_line_length": 29.44, "alnum_prop": 0.686141304347826, "repo_name": "ZeitOnline/zeit.cms", "id": "b68553158e9ccd5e1d36a9d60f09cc130d9b9055", "size": "736", "binar...
import re re_begin = re.compile('download begin \\d+') re_end = re.compile('Loading complete\\. .+ sec \\d+ bytes') re_buffer = re.compile('buffer = .+, bufferTime = .+') re_play_quality = re.compile('swicth to index \\d') re_quality = re.compile('quality=\\d+') re_bw = re.compile('Bandwidth .+ kbps') re_newone = re.c...
{ "content_hash": "2f1b2fef1098967f82ee57c663391b2e", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 164, "avg_line_length": 31.357894736842105, "alnum_prop": 0.5545485062101376, "repo_name": "divergentdave/OSMF-log-parser", "id": "2327f1f1cc304bd8629c8d313428abcc566718c8", ...
""" A simple example that shows how shapes initially placed overlapping will try to move so they are not overlapping. In this case we put too many balls into a very small area and let them find their way out. Note that we need to shift placement of the balls around a small area to get uniform expansion when the simul...
{ "content_hash": "446515a30b27590dcbbe4ca7ff58c824", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 96, "avg_line_length": 36.23529411764706, "alnum_prop": 0.7142857142857143, "repo_name": "jshaffstall/PyPhysicsSandbox", "id": "c307eebe3e6736e9d7c32f1c4606f99a111c4ef9", "...
""" Django settings for brumed project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
{ "content_hash": "72330e1a7d571631b6b9d29680c64e82", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 71, "avg_line_length": 24.602409638554217, "alnum_prop": 0.7257590597453477, "repo_name": "josecostamartins/pythonreges", "id": "22131003f46449b5c65492d37fba3847776f086e", ...
"""Implementation of Inspector abstraction for libvirt.""" from lxml import etree from oslo.config import cfg from ceilometer.compute.virt import inspector as virt_inspector from ceilometer.openstack.common import log as logging libvirt = None LOG = logging.getLogger(__name__) libvirt_opts = [ cfg.StrOpt('libv...
{ "content_hash": "8d8d8d5f421f8379ac9fca7b51038465", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 79, "avg_line_length": 41.6910569105691, "alnum_prop": 0.5273010920436817, "repo_name": "dreamhost/ceilometer", "id": "f5881659b93268d7c511e48f9f4c09b46d878968", "size": "...
class Common(): ADD_INDICATOR = "Add Indicator?" BUCKET_LIST = "Bucket List" CAMPAIGN = "Campaign" CAMPAIGN_CONFIDENCE = "Campaign Confidence" OBJECTS_DATA = "Objects Data" SOURCE = "Source" SOURCE_REFERENCE = "Source Reference" SOURCE_METHOD = "Source Method" TICKET = "Ticket" ...
{ "content_hash": "ff09cff3acc19722d024720770a2a19f", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 69, "avg_line_length": 22.223684210526315, "alnum_prop": 0.6358792184724689, "repo_name": "blaquee/crits", "id": "5a3c51c49e1421a5662c106c5e1b885c5672bb21", "size": "6756"...
from django.contrib import admin from notifications.models import Notification from notifications.models import NotificationPreference from notifications.models import NotificationType class NotificationAdmin(admin.ModelAdmin): list_display = ('actor', 'type', 'recipient', 'seen') class NotificationPreferenceAd...
{ "content_hash": "a747d3d4d6fe641709ff746447639488", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 72, "avg_line_length": 32.857142857142854, "alnum_prop": 0.808695652173913, "repo_name": "linkfloyd/linkfloyd", "id": "ab112de1761cd20f70c292c6ec6da4345bea69c6", "size": "6...
import mock import novaclient from ceilometer.tests import base from ceilometer import nova_client class TestNovaClient(base.TestCase): def setUp(self): super(TestNovaClient, self).setUp() self.nv = nova_client.Client() self.stubs.Set(self.nv.nova_client.flavors, 'get', ...
{ "content_hash": "b4711a5cb725ed8dab0c56e4929e497f", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 79, "avg_line_length": 36.15263157894737, "alnum_prop": 0.6040180521182122, "repo_name": "JioCloud/ceilometer", "id": "a51c0c36eb093f877b27ed1ec603a9a18349e757", "size": "...
"""Unit test for Google Test's global test environment behavior. A user can specify a global test environment via testing::AddGlobalTestEnvironment. Failures in the global environment should result in all unit tests being skipped. This script tests such functionality by invoking googletest-global-environment-unittest...
{ "content_hash": "c77c9302b8e4179ca908f45cbc4e4ac3", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 80, "avg_line_length": 36.09708737864078, "alnum_prop": 0.5618612157073696, "repo_name": "JasonRuonanWang/ADIOS2", "id": "265793442f97758b28fb2732cced44575a185fd0", "size"...
from __future__ import unicode_literals from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ class TimeStampedModel(models.Model): created_at = models.DateTimeField(_("Created at"), auto_now_add=True) modified_at = models.DateTimeFiel...
{ "content_hash": "60f4a5d44fe0e39a0cf729e9e4373aca", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 107, "avg_line_length": 30.90625, "alnum_prop": 0.6663296258847321, "repo_name": "nigma/djutil", "id": "005bd96ca141c7e0e4bd4a4d87c878c12b95bb6a", "size": "1013", "binary...
""" Defines a training options class as a holder for options that can be passed for training a neural network. """ __author__ = "Mihaela Rosca" __contact__ = "[email protected]" import numpy as np # TODO: move from common here import common class TrainingOptions(object): def __init__(self, miniBatchSize, ...
{ "content_hash": "e9d3f702861c136b2e18dd0469688574", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 33.64705882352941, "alnum_prop": 0.7333916083916084, "repo_name": "mihaelacr/pydeeplearn", "id": "b8a1c090d4894baafb920a153b266b562688f753", "size": ...
import logging from django.core.management.base import BaseCommand, CommandError import httplib2 from for_sale.models import ImageItemURLQueue class Command(BaseCommand): args = '<poll_id poll_id ...>' help = 'Closes the specified poll for voting' def handle(self, *args, **options): ...
{ "content_hash": "87062b15e6eb8fb5eceea8cd2cc111c9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 85, "avg_line_length": 27.24, "alnum_prop": 0.6167400881057269, "repo_name": "codepython/CollectorCity-Market-Place", "id": "7157a8e065ee816947324b67ebf0a1eeb1297f7a", "siz...
import re def read_promer_coords(coords_file): """ Parse promer coords file. Keyword arguments: coords_file -- Path to promer output coords file (string, required) returns: A list of dictionaries with the keys: label -- An integer, in ascending order of when they are encountered....
{ "content_hash": "05994d71f7d3d968642ac6478c0d5b88", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 77, "avg_line_length": 35.32258064516129, "alnum_prop": 0.4885844748858447, "repo_name": "PlummerLab/2015-08-18-AvrRvi5_genomic_context", "id": "b173293908c80e657acee6863ca6c...
import os from setuptools import setup def read(*fname): with open(os.path.join(os.path.dirname(__file__), *fname)) as f: return f.read() try: version = read('VERSION').strip() except FileNotFoundError: version = '0' setup( name='putio.py', description='Python client for put.io API v2',...
{ "content_hash": "9c1801610fe63290d6cdb35b81223447", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 68, "avg_line_length": 24.88235294117647, "alnum_prop": 0.6111111111111112, "repo_name": "cenkalti/putio.py", "id": "2e9e677d3255ee9ec9c7b9066b77ccacf4ac6408", "size": "862...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('events', '0027_auto_20160819_1231'), ] operations = [ migrations.AddField( model_name='datasource', ...
{ "content_hash": "18f049d397c39caab1585cbeaadfbb26", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 159, "avg_line_length": 40.16326530612245, "alnum_prop": 0.6204268292682927, "repo_name": "aapris/linkedevents", "id": "a1564610e325bc5d924785495d4e2f20a870e708", "size": "...
""" This module contains various unit tests for example_gcp_dlp DAG """ from tests.providers.google.cloud.utils.gcp_authenticator import GCP_DLP_KEY from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, provide_gcp_context, skip_gcp_system from tests.test_utils.system_tests_class import SystemTest @skip_...
{ "content_hash": "e6d69048113645bc3b23637d38620b11", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 102, "avg_line_length": 37.4, "alnum_prop": 0.7754010695187166, "repo_name": "spektom/incubator-airflow", "id": "54d184103023defb42c275df0af5d97cce0f7275", "size": "1373", ...
from __future__ import unicode_literals from django.test import TestCase from pokemon_v2.models import * class AbilityTestCase(TestCase): def setUp(self): Ability.objects.create( name = "Smell", generation_id = 3, is_main_series = true ) def fields_are_valid(self): smell = Ability.o...
{ "content_hash": "16b6354456d196ab0cea238461cb1a2c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 45, "avg_line_length": 24.375, "alnum_prop": 0.6846153846153846, "repo_name": "zaneadix/pokeapi", "id": "c9b325b9b315b52f29fb746ce30b47a8229d6c88", "size": "390", "binary...
import re import pytest import gymnasium as gym from gymnasium.wrappers import HumanRendering def test_human_rendering(): for mode in ["rgb_array", "rgb_array_list"]: env = HumanRendering( gym.make("CartPole-v1", render_mode=mode, disable_env_checker=True) ) assert env.render...
{ "content_hash": "4c4a7d302030a3888c268fff77f487d1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 99, "avg_line_length": 26.46875, "alnum_prop": 0.5844155844155844, "repo_name": "Farama-Foundation/Gymnasium", "id": "0583eae0bb51bc969e4255a0a0ffc08ba65ee890", "size": "84...