commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
7b118afcc96edf335d5c259adc3e2065648ace6f | update site URL | abrahamvarricatt/abrahamvarricatt.github.io,abrahamvarricatt/abrahamvarricatt.github.io,abrahamvarricatt/abrahamvarricatt.github.io | conf.py | conf.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# Data about this site
BLOG_AUTHOR = "chronodekar"
BLOG_TITLE = "Note To Self"
SITE_URL = "http://note2self.abraham-v.com/"
BLOG_EMAIL = "no@email.here"
BLOG_DESCRIPTION = "Snippets of information"
# Multi-lingual settings (Not used - keepin... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# Data about this site
BLOG_AUTHOR = "chronodekar"
BLOG_TITLE = "Note To Self"
SITE_URL = "https://note2self-abrahamvarricatt.github.io/"
BLOG_EMAIL = "no@email.here"
BLOG_DESCRIPTION = "Snippets of information"
# Multi-lingual settings (Not... | mit | Python |
b2dd561322f6f277f470eae425028412a209da93 | Add Repository class and module | mcgid/morenines,mcgid/morenines | morenines/repository.py | morenines/repository.py | import os
from morenines import output
from morenines import util
from morenines.index import Index
from morenines.ignores import Ignores
NAMES = {
'repo_dir': '.morenines',
'index': 'index',
'ignore': 'ignore',
}
class Repository(object):
def __init__(self):
self.path = None
self.... | mit | Python | |
8273d67aaf74f4f05aa9c9fa86f710a937c708d4 | Test that submitting twice works | campbe13/openhatch,jledbetter/openhatch,eeshangarg/oh-mainline,nirmeshk/oh-mainline,vipul-sharma20/oh-mainline,sudheesh001/oh-mainline,mzdaniel/oh-mainline,heeraj123/oh-mainline,jledbetter/openhatch,openhatch/oh-mainline,ojengwa/oh-mainline,moijes12/oh-mainline,eeshangarg/oh-mainline,waseem18/oh-mainline,willingc/oh-ma... | mysite/profile/tests.py | mysite/profile/tests.py | import django.test
from search.models import Project
import twill
from twill import commands as tc
from twill.shell import TwillCommandLoop
from django.test import TestCase
from django.core.servers.basehttp import AdminMediaHandler
from django.core.handlers.wsgi import WSGIHandler
from StringIO import StringIO
# FIXM... | import django.test
from search.models import Project
import twill
from twill import commands as tc
from twill.shell import TwillCommandLoop
from django.test import TestCase
from django.core.servers.basehttp import AdminMediaHandler
from django.core.handlers.wsgi import WSGIHandler
from StringIO import StringIO
# FIXM... | agpl-3.0 | Python |
292b3c99fc294f9855bd7eb26b0089a04a5f93b5 | Create match_x_y_repetitions.py | costincaraivan/hackerrank,costincaraivan/hackerrank | regex/repetitions/python3/match_x_y_repetitions.py | regex/repetitions/python3/match_x_y_repetitions.py | Regex_Pattern = r'^\d{1,2}[a-zA-z]{3,}\.{0,3}$' # Do not delete 'r'.
| mit | Python | |
f3c8d092b67ad16bdd0937651ef34e3d84b15e2b | Add coverage for composer's send_email function (#2174) | obfuscurity/graphite-web,graphite-project/graphite-web,criteo-forks/graphite-web,mcoolive/graphite-web,deniszh/graphite-web,mcoolive/graphite-web,deniszh/graphite-web,cbowman0/graphite-web,graphite-project/graphite-web,mcoolive/graphite-web,cbowman0/graphite-web,obfuscurity/graphite-web,obfuscurity/graphite-web,deniszh... | webapp/tests/test_composer.py | webapp/tests/test_composer.py | import mock
from urllib3.response import HTTPResponse
from graphite.util import BytesIO
from .base import TestCase
try:
from django.urls import reverse
except ImportError: # Django < 1.10
from django.core.urlresolvers import reverse
class ComposerTest(TestCase):
@mock.patch('six.moves.http_client.HTTPC... | apache-2.0 | Python | |
d06d7ea2a1aabb81be9be77c958b766a2ab0e1b3 | Reduce implicit waiting for visible elements | beanqueen/salad,salad/salad,salad/salad,beanqueen/salad | salad/steps/browser/finders.py | salad/steps/browser/finders.py | from lettuce import world
from salad.logger import logger
from salad.steps.parsers import pick_to_index
from splinter.exceptions import ElementDoesNotExist
from selenium.webdriver.support.wait import WebDriverWait
from selenium.common.exceptions import TimeoutException
ELEMENT_FINDERS = {
'named "(.*)"': "find_by_... | from lettuce import world
from salad.logger import logger
from salad.steps.parsers import pick_to_index
from splinter.exceptions import ElementDoesNotExist
from selenium.webdriver.support.wait import WebDriverWait
from selenium.common.exceptions import TimeoutException
ELEMENT_FINDERS = {
'named "(.*)"': "find_by_... | bsd-3-clause | Python |
c39c8955782c3015f30a9ef7f8e8783ac105ae70 | add harvester for dailyssrn: | fabianvf/scrapi,ostwald/scrapi,felliott/scrapi,alexgarciac/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,jeffreyliu3230/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,felliott/scrapi,mehanig/scrapi,fabianvf/scrapi,erinspace/scrapi | scrapi/harvesters/dailyssrn.py | scrapi/harvesters/dailyssrn.py | from __future__ import unicode_literals
from dateutil.parser import parse
# from datetime import date, timedelta
import furl
from lxml import etree
from scrapi import requests
# from scrapi import settings
from scrapi.base import XMLHarvester
from scrapi.linter import RawDocument
from scrapi.util import copy_to_unic... | apache-2.0 | Python | |
6780fbbb526b999b967376cf03fc816cfbfe1122 | add is_lat_unit_matters.py | clarka34/exploring-ship-logbooks,clarka34/exploringShipLogbooks | scripts/is_lat_unit_matters.py | scripts/is_lat_unit_matters.py | """
is_lat_unit_matters.py
By Wedward Wei
After I explore the data, I found some interesting detail. Like we have differnt types of "LongitudeUnits"
I am wondering if the latitude data could be presented in differnt ways, so we meed more steps before plot.
So I wrote this code to see if the worry is necessary.
"""
... | mit | Python | |
118627a170e3ba3cf8863b3bb0cdaf9b5e0441ff | Create monte_carlo_sliced_doughnut.py | rupertsmall/numerical-tools,rupertsmall/numerical-tools | monte_carlo_sliced_doughnut.py | monte_carlo_sliced_doughnut.py | #center of mass of a sliced doughnut
from random import random
from math import pi,sin,cos,atan
M=100000000 #number of samples
y_samples = 0 #samples which have been in correct y range
x_samples = 0 #samples which have been in correct x range
#do something random
def rand_r():
return random(... | mit | Python | |
e74f78a663a8467e19d071d8e68ef11689c0b7ec | Add replay.py | haypo/perf,vstinner/pyperf | perf/tests/replay.py | perf/tests/replay.py | from __future__ import division, print_function, absolute_import
import os
import perf
import tempfile
def get_raw_values(filename, run_id):
bench = perf.Benchmark.load(filename)
run = bench.get_runs()[run_id]
inner_loops = run._get_inner_loops()
raw_values = [value * (loops * inner_loops)
... | mit | Python | |
e8561caeb3c95633e99f540965d33a67046df3e5 | Add __init__ module for the `msgpack_rpc` subpackage | Shougo/python-client,traverseda/python-client,traverseda/python-client,Shougo/python-client,0x90sled/python-client,fwalch/python-client,meitham/python-client,meitham/python-client,bfredl/python-client,brcolow/python-client,zchee/python-client,starcraftman/python-client,fwalch/python-client,neovim/python-client,timeyyy/... | neovim/msgpack_rpc/__init__.py | neovim/msgpack_rpc/__init__.py | """Msgpack-rpc subpackage.
This package implements a msgpack-rpc client. While it was designed for
handling some Nvim particularities(server->client requests for example), the
code here should work with other msgpack-rpc servers.
"""
from .async_session import AsyncSession
from .event_loop import EventLoop
from .msgpa... | apache-2.0 | Python | |
92cb3088d63ff6fc511c01d1d151f1f1857df496 | create smiles tokenizer unit test | lilleswing/deepchem,peastman/deepchem,deepchem/deepchem,lilleswing/deepchem,peastman/deepchem,deepchem/deepchem,lilleswing/deepchem | deepchem/feat/tests/test_smiles_tokenizer.py | deepchem/feat/tests/test_smiles_tokenizer.py | # Requriments - transformers, tokenizers
from unittest import TestCase
from deepchem.feat.smiles_tokenizer import SmilesTokenizer
from transformers import RobertaForMaskedLM
class TestSmilesTokenizer(TestCase):
"""Tests the SmilesTokenizer to load the USPTO vocab file and a ChemBERTa Masked LM model with pre-train... | mit | Python | |
97d455da87d3175c1d5cf2ce3091f26184cf4a10 | Add heos discoverable (#250) | balloob/netdisco | netdisco/discoverables/heos.py | netdisco/discoverables/heos.py | """Discover Heos devices."""
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
"""Add support for discovering DLNA services."""
def get_entries(self):
"""Get all the HEOS devices."""
return self.find_by_st("urn:schemas-denon-com:device:ACT-Denon:1")
| mit | Python | |
b90e3b0bce680154d7fea8ed071f740db963c402 | fix bug 1458641: fix reports-clean crontabber app | lonnen/socorro,lonnen/socorro,mozilla/socorro,lonnen/socorro,mozilla/socorro,lonnen/socorro,mozilla/socorro,mozilla/socorro,mozilla/socorro,mozilla/socorro | alembic/versions/e70541df7ed7_bug_1458641_fix_reports_clean.py | alembic/versions/e70541df7ed7_bug_1458641_fix_reports_clean.py | """bug 1458641 fix reports clean crontabber app
Revision ID: e70541df7ed7
Revises: 3474e98b321f
Create Date: 2018-05-02 18:20:19.064954
"""
from alembic import op
from socorro.lib.migrations import load_stored_proc
# revision identifiers, used by Alembic.
revision = 'e70541df7ed7'
down_revision = '3474e98b321f'
... | mpl-2.0 | Python | |
7573a76a05e5c282cdad74b542d191dd8c90d8ab | Add OvfTransportTestCase.py | Awingu/open-ovf,Awingu/open-ovf,Awingu/open-ovf,Awingu/open-ovf | py/tests/OvfTransportTestCase.py | py/tests/OvfTransportTestCase.py | #!/usr/bin/python
# vi: ts=4 expandtab syntax=python
##############################################################################
# Copyright (c) 2008 IBM Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which acco... | epl-1.0 | Python | |
307816d3b6cb5e57f50f80e10eccd0a701c698a9 | Fix syntax errors. | sonium0/pymatgen,migueldiascosta/pymatgen,migueldiascosta/pymatgen,Bismarrck/pymatgen,yanikou19/pymatgen,ctoher/pymatgen,Bismarrck/pymatgen,ctoher/pymatgen,sonium0/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,Dioptas/pymatgen,migueldiascosta/pymatgen,Bismarrck/pymatgen,rousseab/pymatgen,rousseab/pymatgen,sonium0/pyma... | pymatgen/io/abinitio/__init__.py | pymatgen/io/abinitio/__init__.py | from .eos import *
from .pseudos import *
from .netcdf import *
from .events import *
from .tasks import *
from .workflows import *
from .calculations import *
| from .calculations import *
from .eos import *
from .pseudos import *
from .netcdf import *
from .events import *
from .task import *
from .workflow import *
| mit | Python |
d4e6f44c5257afd02883bd739cf6b3953e398857 | Create auth.py | damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager | photonix/photos/auth.py | photonix/photos/auth.py | import os
from django.contrib.auth import get_library_model
import graphene
from graphene_django.types import DjangoObjectType
import graphql_jwt
Library = get_library_model()
class Mutation(graphene.ObjectType):
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
... | agpl-3.0 | Python | |
fca1765fa57dfe047b74594883048ee2a8f473dc | Create cluster_scoped_custom_object.py | kubernetes-client/python,kubernetes-client/python | examples/cluster_scoped_custom_object.py | examples/cluster_scoped_custom_object.py | # Copyright 2019 The Kubernetes 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 applicable law or agreed to ... | apache-2.0 | Python | |
bda8b764dca26d9dae2d81da630b5e1328a9aa51 | implement simple python helper for ubf and jsf | hibari/ubf,ubf/ubf,cloudian/ubf,ubf/ubf,ubf/ubf,cloudian/ubf,hibari/ubf,cloudian/ubf,hibari/ubf,hibari/ubf | priv/python/pyubf.py | priv/python/pyubf.py |
##
## $Id: pyubf.py 132283 2009-04-15 14:54:16Z norton $
##
##
## UBF primitives:
##
## integer, float, atom, string, binary, tuple, record, list, term, void
##
def Integer(value):
assert isinstance(value, int) or isinstance(value, long)
return value
def Float(value):
assert isinstance(value, float)
... | mit | Python | |
ed05755f1f5213cdd95203f51d0097bfbd91e6e1 | Create FindtheDifference_BitandHash.py | Chasego/codi,cc13ny/algo,Chasego/cod,Chasego/codirit,cc13ny/algo,Chasego/cod,cc13ny/Allin,Chasego/cod,Chasego/codirit,Chasego/cod,Chasego/cod,cc13ny/algo,Chasego/codi,cc13ny/Allin,cc13ny/Allin,cc13ny/Allin,cc13ny/Allin,Chasego/codi,Chasego/codirit,Chasego/codi,Chasego/codirit,cc13ny/algo,Chasego/codirit,cc13ny/algo,Cha... | leetcode/389-Find-the-Difference/FindtheDifference_BitandHash.py | leetcode/389-Find-the-Difference/FindtheDifference_BitandHash.py | class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
chrs = {}
res = 0
for w in t:
if w not in chrs:
chrs[w] = 1 << (ord(w) - 97)
res += chrs[w]
for w i... | mit | Python | |
fddcad6de86d8d1dbd37c549b0d4258260c13a3a | Read in sample text file 'proteinGroups.txt' | dmyersturnbull/pynd-pubs-ms | proteinGroups.py | proteinGroups.py | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 8 20:48:41 2015
@author: student
"""
import pandas as pd
#import numpy as np
# read in file
df = pd.read_table('/Users/student/Desktop/pubs/Sample text files/proteinGroups.txt', index_col=0)
#print df.dtypes
print df['Intensity'] | apache-2.0 | Python | |
558d45ed0b9c3d375daa81383125e0c4664df7af | Add adwaita-icon-theme | BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild | packages/adwaita-icon-theme.py | packages/adwaita-icon-theme.py | GnomeXzPackage ('adwaita-icon-theme', version_major = '3.16', version_minor = '2.1')
| mit | Python | |
7a068ebb9a50e7c1c77cada56b96586cb322066c | Add collect tests. | sievetech/rgc | test/test_collect.py | test/test_collect.py | # -*- coding: utf-8 -*-
import os
import mock
import unittest
from rgc.rules import Rule, namehasprefix, namehassuffix
from rgc import collect
class TestCollect(unittest.TestCase):
def setUp(self):
os.environ['user'] = 'john'
os.environ['key'] = '12345abcd'
def test_dryrun_no_rule_true_co... | bsd-3-clause | Python | |
af2a0a851be91931f96a7e9d44a1e8c460d70918 | Migrate creation date to new casebooks | harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o | web/main/migrations/0052_migrate_casebook_dates.py | web/main/migrations/0052_migrate_casebook_dates.py | # Generated by Django 2.2.10 on 2020-04-14 11:38
from django.db import migrations
from main.models import Casebook
def copy_old_dates(app, schema):
update_cbs = []
for casebook in Casebook.objects.select_related('old_casebook').all():
if casebook.old_casebook:
casebook.created_at = caseboo... | agpl-3.0 | Python | |
7e53ec5de1d094eafa6a0bba6efcdaf845d5a7b8 | Create 0007.py | Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Show-Me-the-Code/python,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2 | pylyria/0007/0007.py | pylyria/0007/0007.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# Copyright By PyLyria
# CreateTime: 2016-03-04 19:36:40
import os
def get_path(root = os.curdir):
root += os.sep
for path, dirs, files in os.walk(root):
for file_name in files:
yield path, file_name
def get_lines(file_name):... | mit | Python | |
0b4c873ad2d0923e88fbee5b52435ff1ee68d03c | Create PedidoVer.py | AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb | backend/Models/Grau/PedidoVer.py | backend/Models/Grau/PedidoVer.py | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoVer(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoVer, self).__init__(variaveis_do_ambiente)
try:
self.id = self.corpo['id']
except:
raise ErroNoHTTP(400)
def getId(self):
return self.id
| mit | Python | |
d72f6c0d989c3f40d460b1ce5d45b7ebf27ec295 | create tests for kornia | Kaggle/docker-python,Kaggle/docker-python | tests/test_kornia.py | tests/test_kornia.py | import unittest
import cv2
import torch
import kornia
class TestOpenCV(unittest.TestCase):
def test_imread_opencv(self):
img = cv2.imread('/input/tests/data/dot.png')
img_t = kornia.image_to_tensor(img)
self.assertEqual(img.shape, (1, 1, 3))
self.assertEqual(img_t.shape, (3, 1, 1)... | apache-2.0 | Python | |
e3d0681cf2e449b06abebabb7e8726079997eb01 | Add reflex game | OiNutter/microbit-scripts | reflex/reflex.py | reflex/reflex.py | from microbit import *
import random
score = 0
pixel = None
fade_step = 300
clicked = False
MAX_PAUSE = 3000
def get_rand_coord(limit=4):
return random.randint(0, limit)
def get_rand_side():
return random.choice([-1, 1])
def handle_correct_click(i):
global score, clicked
clicked = True
score ... | mit | Python | |
998e7ac87ef6e96bb5d421860683f87e8b373428 | Create view.py | rajrohith/blobstore,rajrohith/blobstore | blobstore-python/src/app/view.py | blobstore-python/src/app/view.py | apache-2.0 | Python | ||
a174eb57037254f6277a9418db407995ea9aff9c | Add python 3.9 imports | PyCQA/isort,PyCQA/isort | isort/stdlibs/py39.py | isort/stdlibs/py39.py | """
File contains the standard library of Python 3.9.
DO NOT EDIT. If the standard library changes, a new list should be created
using the mkstdlibs.py script.
"""
stdlib = {
"_thread",
"abc",
"aifc",
"argparse",
"array",
"ast",
"asynchat",
"asyncio",
"asyncore",
"atexit",
... | mit | Python | |
9c22d354da4c09d2e98b657d334e7594df1042d7 | Create q2.py | pollseed/python_script_lib,pollseed/python_script_lib,pollseed/script_lib,pollseed/python_script_lib,pollseed/script_lib,pollseed/python_script_lib,pollseed/script_lib,pollseed/python_script_lib,pollseed/python_script_lib,pollseed/script_lib,pollseed/script_lib,pollseed/script_lib | work/q2.py | work/q2.py | def union(arr1, arr2):
result = []
for i in range(1, len(arr1)):
result.append(arr1[i])
result.append(arr2[i])
return result
def create_array():
return [x for x in range(0,100)]
print(union(create_array(), create_array()))
| mit | Python | |
4e1f87bf7805d20e52015b8c283181e4035de54b | Create _init_.py | FinancialSentimentAnalysis-team/Finanical-annual-reports-analysis-code,FinancialSentimentAnalysis-team/Finanical-annual-reports-analysis-code,FinancialSentimentAnalysis-team/Finanical-annual-reports-analysis-code | luowang/tools/tree-tagger-windows-3.2/TreeTagger/cmd/_init_.py | luowang/tools/tree-tagger-windows-3.2/TreeTagger/cmd/_init_.py | apache-2.0 | Python | ||
40ef5b1a6347d54eeb043c64f36286768b41dc3e | Add lldbToolBox.py scaffolding in ./utils for adding lldb python helpers to use when debugging swift. | shahmishal/swift,gribozavr/swift,JGiola/swift,allevato/swift,karwa/swift,huonw/swift,JGiola/swift,nathawes/swift,glessard/swift,shajrawi/swift,shahmishal/swift,harlanhaskins/swift,roambotics/swift,jmgc/swift,harlanhaskins/swift,allevato/swift,ahoppen/swift,tkremenek/swift,gregomni/swift,karwa/swift,ahoppen/swift,rudkx/... | utils/lldbToolBox.py | utils/lldbToolBox.py | """
LLDB Helpers for working with the swift compiler.
Load into LLDB with 'command script import /path/to/lldbToolBox.py'
This will also import LLVM data formatters as well, assuming that llvm is next
to the swift checkout.
"""
import os
REPO_BASE = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir,
... | apache-2.0 | Python | |
e0db4982016a724c368feafbe4182016dc0fa67d | Create mongo_to_csv.py | rayidghani/database-utilities,rayidghani/database-utilities | mongo_to_csv.py | mongo_to_csv.py | import unicodecsv
import sys
from pymongo import MongoClient
# call this with 3 arguments: 1) mongodb uri 2) collection nam e3) output filename
class generic_converter:
def __init__(self):
self.header_dict = {}
def retrieve_headers(self, test_dict, name_var):
for element in test_dict:
... | mit | Python | |
f5c8f8d819143b4a49064847a6eb1a7813a3f06b | Create solution.py | lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges | hackerrank/algorithms/sorting/easy/closest_numbers/py/solution.py | hackerrank/algorithms/sorting/easy/closest_numbers/py/solution.py | #!/bin/python
size = int(raw_input())
values = sorted([int(value) for value in raw_input().split()][:size])
differences = sorted([(values[i - 1], values[i]) for i in range(1, len(values))], key = lambda x : abs(x[0] - x[1]))
i = 1
while (i < len(differences)
and abs(differences[i][0] - differences[i][1]) == abs(d... | mit | Python | |
823bf93a9d931ed106ac4ed83f0448215c38580a | Create network_auth.py | MatthewLavine/NetworkAuth | network_auth.py | network_auth.py | #!/usr/bin/python
# Authenticates against a LAN using HTTP Basic Auth
import sys
if len(sys.argv) != 4:
print ("Invalid arguments")
print ("Proper syntax is: " + sys.argv[0] + " [url] [username] [password]")
sys.exit(1)
import requests
import requests.exceptions
auth_target = sys.argv[1]
username = sys.... | mit | Python | |
0cad5e1673069d0fb8f2abb4eb6b062e3461fb70 | Add fortran ABI mismatch test for scipy.linalg. | mikebenfield/scipy,ChanderG/scipy,chatcannon/scipy,juliantaylor/scipy,newemailjdm/scipy,sonnyhu/scipy,WarrenWeckesser/scipy,mhogg/scipy,arokem/scipy,newemailjdm/scipy,FRidh/scipy,Eric89GXL/scipy,mgaitan/scipy,pschella/scipy,larsmans/scipy,anntzer/scipy,pizzathief/scipy,chatcannon/scipy,mortonjt/scipy,vigna/scipy,sriki1... | scipy/linalg/tests/test_build.py | scipy/linalg/tests/test_build.py | from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.testing import TestCase, dec
from scipy.linalg import flapack
# XXX: this is copied from numpy trunk. Can be removed when we will depend on
# numpy 1.3
class FindDependenciesLdd:
def __init__(self):
self.cmd = ['l... | bsd-3-clause | Python | |
6e1c43015beae6afbc7b351d19aa1d899678ca44 | Add Star class topology | ljvmiranda921/pyswarms,ljvmiranda921/pyswarms | pyswarms/backend/topology/star.py | pyswarms/backend/topology/star.py | # -*- coding: utf-8 -*-
"""
A Star Network Topology
This class implements a star topology where all particles are connected to
one another. This social behavior is often found in GlobalBest PSO
optimizers.
"""
# Import from stdlib
import logging
# Import modules
import numpy as np
# Import from package
from .. imp... | mit | Python | |
096a1d94c2f54246d51954b59fc5c3fdb28154b2 | add persistence strategy enum | keenlabs/KeenClient-Python,isotoma/KeenClient-Python,ruleant/KeenClient-Python | keen/__init__.py | keen/__init__.py | __author__ = 'dkador'
class PersistenceStrategy:
"""
An enum that defines the persistence strategy used by the KeenClient.
Currently supported: DIRECT, which means any time add_event is called the
client will call out directly to Keen, or REDIS, which means add_event
will simply add the event to a ... | __author__ = 'dkador'
| mit | Python |
295dc1e11563350181558001366275369df90639 | Add a sysutil module | sahg/SAHGutils | sahgutils/sysutil.py | sahgutils/sysutil.py | # System utility functions
from subprocess import Popen, PIPE
def exec_command(cmd_args):
"""Execute a shell command in a subprocess
Convenience wrapper around subprocess to execute a shell command
and pass back stdout, stderr, and the return code. This function
waits for the subprocess to complete, b... | bsd-3-clause | Python | |
74034ccc6d1b7436c81520fb287330b852d54c62 | Create a.py | cliali/py2 | a.py | a.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Simple Bot to reply to Telegram messages. This is built on the API wrapper, see
# echobot2.py to see the same example built on the telegram.ext bot framework.
# This program is dedicated to the public domain under the CC0 license.
import logging
import telegram
from tel... | apache-2.0 | Python | |
e2dbee01734a981e8fcbbdca7d7d96f0506f929b | Create b.py | ayst123/mooc,ayst123/mooc | b.py | b.py | b = 43
| bsd-2-clause | Python | |
ef7b6fb0bbe0c0d263a8c28ccaed1365f50f0ad9 | Solve Knowit2019/07 | matslindh/codingchallenges,matslindh/codingchallenges | knowit2019/07.py | knowit2019/07.py | def zee_special_divison_operator(exp_r, x):
for y_d in range(2, 27644437):
b = y_d * x
r = b % 27644437
if exp_r == r:
break
return y_d
def test_special():
assert 13825167 == zee_special_divison_operator(5897, 2)
assert 9216778 == zee_special_divison_operator(5897... | mit | Python | |
e61dbf66d6f73e4999a5ff9f732a8df0637fdbf2 | Add an example of SQLalchemy model | raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite | server/models.py | server/models.py | from flask.ext.sqlalchemy import SQLAlchemy
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True)
email = db.Column(db.String(120), unique=True)
def __in... | bsd-3-clause | Python | |
b6fb4cadb9ac1506fef3a230ee7ec983daa64922 | Remove tail | monouno/site,Phoenix1369/site,monouno/site,monouno/site,Minkov/site,DMOJ/site,DMOJ/site,Minkov/site,Minkov/site,DMOJ/site,Phoenix1369/site,monouno/site,Phoenix1369/site,Phoenix1369/site,monouno/site,DMOJ/site,Minkov/site | judge/templatetags/markdown/lazy_load.py | judge/templatetags/markdown/lazy_load.py | from copy import deepcopy
from django.contrib.staticfiles.templatetags.staticfiles import static
from lxml import html
def lazy_load(tree):
blank = static('blank.gif')
for img in tree.xpath('.//img'):
src = img.get('src')
if src.startswith('data'):
continue
noscript = html... | from copy import deepcopy
from django.contrib.staticfiles.templatetags.staticfiles import static
from lxml import html
def lazy_load(tree):
blank = static('blank.gif')
for img in tree.xpath('.//img'):
src = img.get('src')
if src.startswith('data'):
continue
noscript = html... | agpl-3.0 | Python |
eb145b78d4c84a29ee77fbe77142dee6f97f67dd | put urls and getter in its own file | apetrynet/filemail,apetrynet/pyfilemail,apetrynet/filemail | filemail/urls.py | filemail/urls.py | import os
from errors import FMConfigError
base_url = 'https://www.filemail.com'
api_urls = {
'login': 'api/authentication/login',
'logout': 'api/authentication/logout',
'init': 'api/transfer/initialize',
'get': 'api/transfer/get',
'complete': 'api/transfer/complete',
'forward': 'api/transfer... | mit | Python | |
beb549ba090a1a72761a7e81feb3edcbf85ca543 | Add files via upload | yawatauma/hello-world | first_attempt.py | first_attempt.py | print("Hello world")
| mit | Python | |
036601c8172dc71f2ea106abdae9a157a8e60855 | update find best results | duguyue100/rolling | scripts/find-best.py | scripts/find-best.py | """
Find the best result from experiments.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
import sys;
import os;
from numba.cuda.cudadrv.nvvm import RESULT_CODE_NAMES
sys.path.append("..");
import argparse;
import cPickle as pickle;
import numpy as np;
import rolling.dataset as ds;
import rolling.draw as draw;... | mit | Python | |
747fa222d1e382ced363ced9d2565f384769316c | add button listener | Shura1oplot/raspberry-pi-collection,Shura1oplot/raspberry-pi-collection | button-listen.py | button-listen.py | #!/usr/bin/env python
import sys
from time import time, sleep
import RPi.GPIO as GPIO
def main(argv=sys.argv):
channel = int(argv[1])
GPIO.setmode(GPIO.BCM)
try:
GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
ts = 0
while True:
GPIO.wait_for_edge(channel, ... | mit | Python | |
4576d623fa48242ede9a106b642cc4b020ec3595 | Create processDNAta.py | AEFisher/NGS-scripts | processDNAta.py | processDNAta.py | """
processDNAta.py
version 9/5/2014
Author: Ellen Blaine
This program takes in a folder containing files of exon sequences and returns
data about those files in the form of a CSV file, including which species
for whom a sequence was recovered, the percentage AT/CG bias, and the median
recovered sequence length. T... | mit | Python | |
090cdf443aba871c9230a274fbe2242a7e873822 | Create gpiorpiplugin.py | damianolombardo/fauxmo | gpiorpiplugin.py | gpiorpiplugin.py | """
GPIORPiPlugin.py :: Fauxmo plugin for simple RPi.GPIO.
"""
try:
import RPi.GPIO as GPIO
except ImportError:
import testRPiGPIO as GPIO
print('Using testRPiGPIO')
from functools import partialmethod # type: ignore # not yet in typeshed
from fauxmo.plugins import FauxmoPlugin
from time import sleep
impo... | mit | Python | |
8dc7f657e816ab9becbabcf032e62d088f2b6b3c | Add network visualization tool | step-up-health/step-up-backend,step-up-health/step-up-backend | viz.py | viz.py | import os
import json
import hashlib
def get_data_path():
if not 'OPENSHIFT_DATA_DIR' in os.environ:
return '../data/data.json'
else:
return os.path.join(os.environ['OPENSHIFT_DATA_DIR'], 'data.json')
def get_data():
if not os.path.isfile(get_data_path()):
with open(get_data_path()... | cc0-1.0 | Python | |
0f3815ed22c4e25d311f36e0d9be9c5b38bd32bd | Create the basic structure for the topic handler. | yiyangyi/cc98-tornado | handler/topic.py | handler/topic.py | class IndexHandler(BaseHandler):
class ViewHandler(BaseHandler):
class CreateHandler(BaseHandler):
class EditHandler(BaseHandler):
class FavoriteHandler(BaseHandler):
class CancelFavoriteHandler(BaseHandler):
class VoteHandler(BaseHandler):
class ReplyEditHandler(BaseHandler): | mit | Python | |
c725fb59055810903fd4a9b1da1b6ef11cab2d74 | Add functions for timeseries reduction in mpopf | openego/eDisGo,openego/eDisGo | edisgo/opf/timeseries_reduction.py | edisgo/opf/timeseries_reduction.py | import logging
import pandas as pd
from edisgo.flex_opt import check_tech_constraints
logger = logging.getLogger(__name__)
def _scored_critical_current(edisgo_obj, grid):
# Get allowed current per line per time step
i_lines_allowed = check_tech_constraints.lines_allowed_load(
edisgo_obj, grid, 'mv')... | agpl-3.0 | Python | |
b48a17f45bbb9a2202c8c3fcb377037b92961f0b | Create na.py | pax2001/test | na.py | na.py | hjghjgj
| apache-2.0 | Python | |
48a9b87dd86d600cdab4224c84aa5ce0685b775c | Add fetch data file | joostsijm/Supremacy1914,joostsijm/Supremacy1914 | python/fetch.py | python/fetch.py | #!/usr/bin/env python
import time
import json
import requests
headers = {
"Host": "xgs15.c.bytro.com",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0",
"Accept": "text/plain, */*; q=0.01",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encodin... | apache-2.0 | Python | |
3c7e8f08699fa6d2b004f86e6bdb0bc4792ae8c2 | Create regex.py | rogergrindelwald/code_snippets | python/regex.py | python/regex.py | # re.IGNORECASE can be used for allowing user to type arbitrary cased texts.
QUIT_NO_CASE = re.compile('quit', re.IGNORECASE)
| mit | Python | |
b01c602f156b5a72db1ea4f27989aa5b1afdada8 | ADD Cleaning before each test | telefonicaid/fiware-keypass,telefonicaid/fiware-keypass,telefonicaid/fiware-keypass | src/behavior/features/terrain.py | src/behavior/features/terrain.py | from lettuce import *
import requests
TARGET_URL='http://localhost:8080'
tenantList = [ "511", "615", "634", "515" ]
@before.each_scenario
def cleanContext(feature):
for tenant in tenantList:
url = TARGET_URL + '/pap/v1/' + tenant
r = requests.delete(url)
| apache-2.0 | Python | |
5f4263b6968c839bd67a60f4a2ffd89f8b373193 | Update __init__.py | Tendrl/node-agent,Tendrl/node_agent,r0h4n/node-agent,Tendrl/node_agent,Tendrl/node-agent,r0h4n/node-agent,r0h4n/node-agent,Tendrl/node-agent | tendrl/provisioning/objects/definition/__init__.py | tendrl/provisioning/objects/definition/__init__.py | import pkg_resources
from ruamel import yaml
from tendrl.commons import objects
class Definition(objects.BaseObject):
internal = True
def __init__(self, *args, **kwargs):
self._defs = True
super(Definition, self).__init__(*args, **kwargs)
self.data = pkg_resources.resource_string(_... | import pkg_resources
from ruamel import yaml
from tendrl.commons import objects
class Definition(objects.BaseObject):
internal = True
def __init__(self, *args, **kwargs):
self._defs = True
super(Definition, self).__init__(*args, **kwargs)
self.data = pkg_resources.resource_string(_... | lgpl-2.1 | Python |
f784228170557643bc5cb1efc61ea38b45796210 | Add flask application | ledmonster/nishiki | app.py | app.py | # -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
@app.route('/')
def main():
return 'hello'
if __name__ == "__main__":
app.run()
| mit | Python | |
ef67bf3d8a418399fca676502a87ccb7d3914ed1 | Add module with common potentials, with force versions for some | eddiejessup/ciabatta | Lib/potentials.py | Lib/potentials.py | import numpy as np
import utils
def LJ(r_0, U_0):
'''
Lennard-Jones with minimum at (r_0, -U_0).
'''
r_0_6 = r_0 ** 6
def func(r_sq):
six_term = r_0_6 / r_sq ** 3
return U_0 * (six_term ** 2 - 2.0 * six_term)
return func
def step(r_0, U_0):
'''
Potential Well at r with ... | bsd-3-clause | Python | |
1ece8c8640214d69a224f94f1b1ac93ec53d7699 | Add image processing system (dummy) | susemeee/Chunsabot-framework | chunsabot/modules/images.py | chunsabot/modules/images.py | from chunsabot.botlogic import brain
@brain.route("@image")
def add_image_description(msg, extras):
attachment = extras['attachment']
if not attachment:
return None
return "asdf"
| mit | Python | |
84be951a9160e9998f3ed702542cee7274081091 | Create __init__.py | parrisha/raspi-visualizer | spectrum/__init__.py | spectrum/__init__.py | mit | Python | ||
92fde42097c4e0abbf5a7835a72f58f52c9b8499 | Create example.py | Peter9192/MAQ_PhD,Peter9192/MAQ_PhD | Python/example.py | Python/example.py | #This is an example script.
| mit | Python | |
3a56b89aacad2f948bf85b78c0834edf7c8d8d01 | Add missing file. | jonathanj/renamer,jonathanj/renamer | renamer/util.py | renamer/util.py | import re
class ConditionalReplacer(object):
def __init__(self, cond, regex, repl):
super(ConditionalReplacer, self).__init__()
self.cond = re.compile(cond)
self.regex = re.compile(regex)
self.repl = repl
@classmethod
def fromString(cls, s):
return cls(*s.strip().... | mit | Python | |
066673aea6887d9272646d8bac8f99c69387e61d | add management command to check the status of a bounced email | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/util/management/commands/check_bounced_email.py | corehq/util/management/commands/check_bounced_email.py | from django.core.management.base import BaseCommand
from corehq.util.models import (
BouncedEmail,
PermanentBounceMeta,
ComplaintBounceMeta,
)
class Command(BaseCommand):
help = "Check on the bounced status of an email"
def add_arguments(self, parser):
parser.add_argument('bounced_email'... | bsd-3-clause | Python | |
fea6011cf14e87492d511db3ed9415f5938929bf | add ex8 | AisakaTiger/Learn-Python-The-Hard-Way,AisakaTiger/Learn-Python-The-Hard-Way | ex8.py | ex8.py | formatter = "%r %r %r %r"
print formatter %(1, 2, 3, 4)
print formatter % ("one", "two", "three", "four")
print formatter %(True, False, False, True)
print formatter %(formatter, formatter, formatter,formatter)
print formatter % (
"I had this thing.",
"That you could type up right",
"But it did't sing.",
... | mit | Python | |
2ea014495f559072c5ecfac0b1117979793cf042 | Create ruuvitag-web.py | dimamedia/RuuviTag-logger,dimamedia/RuuviTag-logger | ruuvitag-web.py | ruuvitag-web.py | #!/usr/bin/python3
from flask import Flask, render_template
from datetime import datetime, timedelta
import sqlite3
import json
import random
app = Flask(__name__)
def randomRGB():
r, g, b = [random.randint(0,255) for i in range(3)]
return r, g, b, 1
@app.route('/')
def index():
conn = sqlite3.connect("ru... | mit | Python | |
2becf3b5223da8dc8d312462ae84f32ec3aff129 | Create hw1.py | yl9jv/assignment_1 | hw1.py | hw1.py | # Name: Yicheng Liang
# Computing ID: yl9jv
import math
k = raw_input("Please enter the value for k: ")
while (not k.isdigit()):
k = raw_input("Please enter a number for k: ")
k = int(k)
m = raw_input("Please enter the value for M: ")
while (not m.isdigit()):
m = raw_input("Please enter a number for M: "... | mit | Python | |
6274ee8d776c829998dfaa56cb419d1263242a48 | Add topological sorting in Python | salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook | Algorithms/Sort_Algorithms/Topological_Sort/TopologicalSort.py | Algorithms/Sort_Algorithms/Topological_Sort/TopologicalSort.py | '''
Topological sort.
Taken from :
http://stackoverflow.com/questions/15038876/topological-sort-python
'''
from collections import defaultdict
from itertools import takewhile, count
def sort_topologically(graph):
levels_by_name = {}
names_by_level = defaultdict(set)
def walk_depth_first(name):
i... | mit | Python | |
df52febb14761d741a20dcdc1cbfd5ea8cd7e07b | add my bing script as an example | aliclark/irctail,aliclark/irctail | bingaling.aclark.py | bingaling.aclark.py | #!/usr/bin/python
import re
import baseformat
import bingaling
bingcheck_restr = r'([a4][c][l1][a4][r][k])|([a4][l1][i1])'
bingcheck_full = re.compile(r'(('+'\x04\x65'+r')|('+'\x04\x63'r')|([^\w\-'+'\x04'+r'])|(^)|(\t))(' + bingcheck_restr + r')(([^\w\-])|($))', re.IGNORECASE)
def bingcheck(line):
r = baseform... | isc | Python | |
d95732ce90c5c9ac571ffc78b45eaa4424a11038 | Create nested_scrape.py | wolfdale/Scraper | nested_scrape.py | nested_scrape.py | """ PROJECT SCRAPER """
from bs4 import BeautifulSoup
import urllib2
def scraper(url, outer_tag, outer_attr, outer_attr_name, inner_tag, inner_attr, inner_attr_name):
''' BEAUTIFUL SOUP INIT '''
web=urllib2.urlopen(url)
soup=BeautifulSoup(web,'html.parser',from_encoding='utf-8')
''' ***** CONTENT LIST *****... | mit | Python | |
d2ed4e7a0d8edafa250044e8b9ecf319c14b85e0 | add pkc.py | concise/ecclab | pkc.py | pkc.py | class PkcError(BaseException):
pass
class PkcTypeError(TypeError, PkcError):
pass
class PkcCertificateError(ValueError, PkcError):
pass
class PkcPublickeyError(ValueError, PkcError):
pass
def pkc_extract_publickey_from_certificate(certificate):
if type(certificate) is bytes:
return _pkc_... | mit | Python | |
b716ae64ec574d741386b1dfc18c76e9bddec9a0 | add closure example | dekstop/ipython_extensions,dekstop/ipython_extensions,NunoEdgarGub1/ipython_extensions,minrk/ipython_extensions,danielballan/ipython_extensions,minrk/ipython_extensions,NunoEdgarGub1/ipython_extensions,danielballan/ipython_extensions,danielballan/ipython_extensions,NunoEdgarGub1/ipython_extensions,minrk/ipython_extensi... | closure.py | closure.py | """
%%closure cell magic for running the cell in a function,
reducing pollution of the namespace
%%forget does the same thing, but explicitly deletes new names,
rather than wrapping the cell in a function.
"""
from IPython.utils.text import indent
def closure(line, cell):
"""run the cell in a function, generatin... | bsd-3-clause | Python | |
7d28f97fb16684c58cf9e55bcca213e853741ca4 | Create rmq.py | andymitrich/stepic,andymitrich/stepic | rmq.py | rmq.py | #!/usr/local/bin/python3
from sys import stdin
from math import ceil, log
from decimal import Decimal as d
class RMQ(object):
def __init__(self, numbers):
self.e = []
n = len(numbers)
if (n & (n-1))!=0:
x = ceil(log(n, 2))
nn = 2**x;
while n != nn:
numbers.append(d('... | mit | Python | |
3d1cef9e56d7fac8a1b89861b7443e4ca660e4a8 | Reduce indentation to avoid PEP8 failures | vmturbo/nova,fnordahl/nova,cloudbau/nova,CEG-FYP-OpenStack/scheduler,vladikr/nova_drafts,yrobla/nova,bigswitch/nova,eharney/nova,KarimAllah/nova,Stavitsky/nova,TwinkleChawla/nova,zzicewind/nova,klmitch/nova,rickerc/nova_audit,belmiromoreira/nova,cloudbase/nova-virtualbox,luogangyi/bcec-nova,Yusuke1987/openstack_templat... | nova/ipv6/api.py | nova/ipv6/api.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Openstack, 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... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Openstack, 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... | apache-2.0 | Python |
72678c437f1b1110fb8a14c78dcdd4c3c8b64157 | Add initial version of bot script | devupin/allie | rtm.py | rtm.py | import time
from slackclient import SlackClient
token = 'kekmao'
sc = SlackClient(token)
team_join_event = 'team_join'
def send_welcome_message(user):
user_id = user['id']
response = sc.api_call('im.open', user=user_id)
try:
dm_channel_id = response['channel']['id']
except (KeyError, ValueErr... | mit | Python | |
4c499d366429f68ff29c7a2f93553b06f3697405 | Add missing oslo/__init__.py | varunarya10/oslo.rootwrap | oslo/__init__.py | oslo/__init__.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | Python | |
5ee021af46f7b6420b5edeac38f5f34f675fa625 | create basic crawler | Nymphet/sexinsex-content-crawler,Nymphet/sexinsex-crawler | crawler.py | crawler.py | # -*- coding:utf-8 -*-
from urllib import request, parse, error
from time import sleep
import re, os
start_tid = '2507213' # change initial url at here
SEXINSEX_URLS_PREFIX = 'http://www.sexinsex.net/forum/'
encoding = 'gbk'
path = os.path.abspath('.')
sleeptime = 0
def generate_url(tid,pid):
return ''.join([SE... | apache-2.0 | Python | |
5f3a665e4611ae8faf82fcfb2804a0fd9aa84d2b | Create majority_number_iii.py | lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges | lintcode/majority_number_iii/py/majority_number_iii.py | lintcode/majority_number_iii/py/majority_number_iii.py | class Solution:
"""
@param nums: A list of integers
@param k: As described
@return: The majority number
"""
def majorityNumber(self, nums, k):
import collections
ratio = 1.0 / k * len(nums)
counter = collections.Counter(nums)
for num in counter... | mit | Python | |
8be862467344b9cf45b567008f10face0ed3ebf3 | Create zhconvert.py for Alpha 1.0.3 | yu-george/Dumpling-Bot | packages/zhconvert.py | packages/zhconvert.py | import requests
_url = 'http://opencc.byvoid.com/convert/'
def toTraditional(text):
# if len(text) > 100:
req = requests.post(_url, data={'text':text,'config':'s2t.json','precise':'0'})
return req.text
# else:
# result = ''
# for segment in [text[i:i+1000] for i in range(0, len(text), ... | mit | Python | |
22f550dd3499d7d063501a2940a716d42362f6bc | Add missing file. | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0031_add_manage_team_permission.py | migrations/versions/0031_add_manage_team_permission.py | """empty message
Revision ID: 0031_add_manage_team_permission
Revises: 0030_add_template_permission
Create Date: 2016-02-26 10:33:20.536362
"""
# revision identifiers, used by Alembic.
revision = '0031_add_manage_team_permission'
down_revision = '0030_add_template_permission'
import uuid
from datetime import datetim... | mit | Python | |
e25a56331c386fc5478c812702ecc6de7ebf100a | Add script to run dynamorio coverage tool on log files. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/chromium/dynamorio_coverage.py | scripts/slave/chromium/dynamorio_coverage.py | #!/usr/bin/env python
# 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.
"""Script for creating coverage.info file with dynamorio bbcov2lcov binary.
"""
import glob
import optparse
import os
import subproce... | bsd-3-clause | Python | |
f9d399fb9fa923c68581279085566ba479349903 | test for api export endpoint | kobotoolbox/kobocat,spatialdev/onadata,mainakibui/kobocat,sounay/flaminggo-test,smn/onadata,hnjamba/onaclone,ehealthafrica-ci/onadata,ehealthafrica-ci/onadata,mainakibui/kobocat,qlands/onadata,GeoODK/onadata,awemulya/fieldsight-kobocat,GeoODK/onadata,piqoni/onadata,mainakibui/kobocat,jomolinare/kobocat,hnjamba/onaclone... | onadata/apps/api/tests/viewsets/test_export_viewset.py | onadata/apps/api/tests/viewsets/test_export_viewset.py | import os
from django.test import RequestFactory
from onadata.apps.api.viewsets.export_viewset import ExportViewSet
from onadata.apps.main.tests.test_base import TestBase
class TestDataViewSet(TestBase):
def setUp(self):
super(self.__class__, self).setUp()
self._create_user_and_login()
... | bsd-2-clause | Python | |
5a5900a5c0ab1e0ac41469770e3775faf482c21e | write TagField basic | avelino/django-tags | tags/fields.py | tags/fields.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db.models.fields import CharField
from django.utils.translation import ugettext_lazy as _
from tags.models import Tag
class TagField(CharField):
def __init__(self,
verbose_name=_(u'Tags'),
max_length=4000,
... | mit | Python | |
11d2f5e649ef5c5aedec9723894cd29c1d4d81f4 | Add missing migration | fin/froide,fin/froide,fin/froide,fin/froide | froide/document/migrations/0027_alter_document_content_hash.py | froide/document/migrations/0027_alter_document_content_hash.py | # Generated by Django 3.2.4 on 2021-07-07 20:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('document', '0026_auto_20210603_1617'),
]
operations = [
migrations.AlterField(
model_name='document',
name='content_... | mit | Python | |
36e3cb292b24d5940efed635c49bf5bb62007edb | Create __init__.py | sinotradition/meridian | acupoints/__init__.py | acupoints/__init__.py | apache-2.0 | Python | ||
41631175c7aae124f7504f068d9c2f8cf1c9e617 | Add exception to describe errors in configuration processing | Ghostkeeper/Luna | plugins/configuration/configurationtype/configuration_error.py | plugins/configuration/configurationtype/configuration_error.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | cc0-1.0 | Python | |
39fe6bb60e24ac8ac6d9eea60f7dc5b42de25682 | Create PyCompare.py | dadelantado/PyCompare | PyCompare.py | PyCompare.py | import os
from bs4 import BeautifulSoup
def getfiles(path1, path2):
#Load files on root of path1 on files1
for root, dir, names in os.walk(path1):
files1 = names
break #Will break the for to read just the root folder
#Load files on root of path2 on files2
for root, dir, names in os.walk(path2):
files2 = n... | mit | Python | |
a857273666cb616e1c019bedff81d3014070c896 | increase Proofread of Henochbuch | the-it/WS_THEbotIT,the-it/WS_THEbotIT | scripts/online_scripts/150916_increase_proofread_Henochbuch.py | scripts/online_scripts/150916_increase_proofread_Henochbuch.py | # -*- coding: utf-8 -*-
__author__ = 'eso'
import sys
sys.path.append('../../')
from tools.catscan import CatScan
import re
import requests
import pywikibot
from pywikibot import proofreadpage
site = pywikibot.Site()
for i in range(455, 474):
page = pywikibot.proofreadpage.ProofreadPage(site, 'Seite:Riessler Altj... | mit | Python | |
1d75b7e0bd0c498b5ea2c32c4e98a278ca2aed1b | make sitelockdown generic | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/common/middleware/sitelockdown.py | src/python/expedient/common/middleware/sitelockdown.py | '''
@author jnaous
'''
from django.conf import settings
from django.http import HttpResponseRedirect
from utils import RegexMatcher
class SiteLockDown(RegexMatcher):
"""
This middleware class will force almost every request coming from
Django to be authenticated, or it will redirect the user to a login
... | bsd-3-clause | Python | |
4f8fff9fb2da7bbdab68a0a4c02b51d00410e8c4 | Add synthtool scripts (#3765) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-automl/google-cloud-automl/synth.py | java-automl/google-cloud-automl/synth.py | # Copyright 2018 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, s... | apache-2.0 | Python | |
dacd4e66a367987a84ae13da4e1ad74a4113b25c | Create Congress.py | JohnDvorak/senate-webcrawler | Congress.py | Congress.py | #
# Author : John Dvorak
# Contact : jcd3247@rit.edu
# File : Congress.py
# Usage : Senate parser & webcrawler
#
""" Contains Bill and Politician objects. A Bill represents a proposed bill
from the U.S. Senate or House of Representatives, and a set of
Politicians are created who cosponsor a giv... | mit | Python | |
3dd454f899f556d99ae2bc6947a21d04428f8496 | Add the extraction for DCE signal normalized to accelerate the loading | I2Cvb/mp-mri-prostate,I2Cvb/mp-mri-prostate,I2Cvb/mp-mri-prostate | pipeline/feature-extraction/dce/pipeline_extraction_dce.py | pipeline/feature-extraction/dce/pipeline_extraction_dce.py | """
This pipeline is used to resave the data from lemaitre-2016-nov for faster
loading.
"""
import os
import numpy as np
from sklearn.externals import joblib
from sklearn.preprocessing import label_binarize
from protoclass.data_management import DCEModality
from protoclass.data_management import GTModality
from pr... | mit | Python | |
c7987bde28992ef0ae8cae9fca500730b2fcea15 | Add url rewriter for eztv | jawilson/Flexget,crawln45/Flexget,ZefQ/Flexget,crawln45/Flexget,crawln45/Flexget,grrr2/Flexget,poulpito/Flexget,tobinjt/Flexget,ianstalk/Flexget,dsemi/Flexget,Flexget/Flexget,Flexget/Flexget,OmgOhnoes/Flexget,qk4l/Flexget,jacobmetrick/Flexget,JorisDeRieck/Flexget,ZefQ/Flexget,tsnoam/Flexget,Danfocus/Flexget,antivirtel/... | flexget/plugins/urlrewrite_eztv.py | flexget/plugins/urlrewrite_eztv.py | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from urlparse import urlparse, urlunparse
from requests import RequestException
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
from flexget.utils imp... | mit | Python | |
c60b152573ccfe01997f3d970968180ac82af8ba | Add forgotten migration | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/funding_stripe/migrations/0014_auto_20190916_1645.py | bluebottle/funding_stripe/migrations/0014_auto_20190916_1645.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-09-16 14:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funding_stripe', '0013_auto_20190913_1458'),
]
operations = [
migrations.A... | bsd-3-clause | Python | |
7d6932a07caed84c424f62ab8d980fde7eddeaed | Create lc375.py | FiveEye/ProblemSet,FiveEye/ProblemSet | LeetCode/lc375.py | LeetCode/lc375.py | class Solution(object):
def getMoneyAmount(self, n):
"""
:type n: int
:rtype: int
"""
dp = [[0 for x in range(n+1)] for y in range(n+1)]
for i in range(2,n+1):
for x in range(n):
if x + i > n:
break
dp[x]... | mit | Python | |
74d718b19ec49c0ca4c724533af1ec725003adef | remove emtry transtion of region | affan2/django-cities-light,affan2/django-cities-light | cities_light/management/commands/region_missing_translations.py | cities_light/management/commands/region_missing_translations.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
from cities_light import Region
for item in Region.published.all():
if not item.translations.all():
obj = item.translate(item.default_language)
... | mit | Python | |
8578d221498eee26be8cbd27849ac9a4fbfc27a5 | Create ethernetip-multi.py | digitalbond/Basecamp,digitalbond/Basecamp | ethernetip-multi.py | ethernetip-multi.py | require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp
include Rex::Socket::Tcp
def initialize(info={})
super(update_info(info,
'Name' => 'Allen-Bradley/Rockwell Automation EtherNet/IP CIP commands',
'Description' => %q{
The EtnerNet/IP CIP protocol allows a number of u... | mit | Python | |
e20002febd14a2f6d31b43ee85d57bfa26c745e5 | test game/board.py | ciappi/Yaranullin | yaranullin/game/tests/board.py | yaranullin/game/tests/board.py | # yaranullin/game/tests/board.py
#
# Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE S... | isc | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.