max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
gshiw/quotes_web/quotes/adminx.py | superlead/gsw | 0 | 12785951 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from quotes_web.adminx import BaseAdmin
import xadmin
from .models import Quotes, Categories, Works, Writers, Speakers, Topics
class QuotesAdmin(BaseAdmin):
exclude = ('owner', 'view_nums', 'dig_nums')
xadmin.site.register(Quotes, QuotesAdmin)
c... | 2.015625 | 2 |
lyapas_to_json.py | tsu-iscd/lyapas-lcc | 4 | 12785952 | <filename>lyapas_to_json.py
#!/usr/bin/env python2.7
import json
import argparse
import codecs
import sys
def main(args):
data = args.in_lyapas.read()
data = json.dumps(data, ensure_ascii=False, encoding='utf-8')
json_data = '{"file": "' + args.in_lyapas.name + '",' + ' "source": ' + data +'}'
args.ou... | 3.0625 | 3 |
src/python/toolchain/plans.py | andyjost/Sprite | 1 | 12785953 | <filename>src/python/toolchain/plans.py
import collections, itertools
from . import _curry2icurry, _icurry2json, _json2py
Stage = collections.namedtuple('Stage', ['suffixes', 'step'])
class Plan(object):
'''
Represents a compilation plan.
Describes the sequence of steps that must be performed and the functions... | 2.609375 | 3 |
air_ticket/views/airline_staff.py | X-czh/Air-Ticket-Reservation-System | 0 | 12785954 | from flask import Blueprint, render_template, request, session, redirect, url_for
from pymysql import MySQLError
from datetime import date, datetime, timedelta
from dateutil.relativedelta import relativedelta
from air_ticket import conn
from air_ticket.utils import requires_login_airline_staff
mod = Blueprint('airline... | 2.40625 | 2 |
sbr_ui/services/gateway_authentication_service.py | ajorpheus/sbr-ui | 1 | 12785955 | <reponame>ajorpheus/sbr-ui
import logging
import requests
from structlog import wrap_logger
from typing import Tuple
from flask import current_app
from sbr_ui.models.exceptions import ApiError
from sbr_ui.utilities.helpers import log_api_error, base_64_encode
logger = wrap_logger(logging.getLogger(__name__))
class... | 1.992188 | 2 |
containers/mobilenet/dataset/scripts/tar_to_record.py | AustinShalit/ml-react-app | 18 | 12785956 | <reponame>AustinShalit/ml-react-app<gh_stars>10-100
import sys, os, shutil, tarfile, argparse, zipfile
import json_to_csv, generate_tfrecord, parse_meta, parse_hyperparams
from os.path import join, splitext, split
def main(dataset_paths, percent_eval, directory):
ROOT_PATH, PATH_EXT = os.path.splitext(dataset_pat... | 2.3125 | 2 |
setup.py | caozhichongchong/traits_finder | 1 | 12785957 | from setuptools import setup
setup(
name="traits_finder",
packages=['traits_finder'],
version="1.6",
description="search and summarize traits in genomes and metagenomes",
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/caozhichongchong/traits_finder',
keywords=['metagen... | 1.3125 | 1 |
lstm4backend/train.py | cap-ntu/Autocomplete | 1 | 12785958 |
import just
import json
import pandas as pd
from pathlib import Path
pd.set_option('max_colwidth',300)
from encoder_decoder import TextEncoderDecoder, text_tokenize
from model import LSTMBase
TRAINING_TEST_CASES = ["from keras.layers import"]
columns_long_list = ['repo', 'path', 'url', 'code',
... | 2.53125 | 3 |
uclasm/utils.py | cfld/uclasm | 0 | 12785959 | """Miscellaneous functions and helpers for the uclasm package."""
import numpy as np
def one_hot(idx, length):
"""Return a 1darray of zeros with a single one in the idx'th entry."""
one_hot = np.zeros(length, dtype=np.bool)
one_hot[idx] = True
return one_hot
def index_map(args):
"""Return a dict... | 3.21875 | 3 |
tools/simulator.py | zhongxinghong/Botzone-Tank2 | 11 | 12785960 | # -*- coding: utf-8 -*-
# @Author: Administrator
# @Date: 2019-04-30 11:25:35
# @Last Modified by: Administrator
# @Last Modified time: 2019-05-26 01:25:58
"""
无 GUI 的游戏模拟器,可以模拟播放比赛记录
"""
import sys
sys.path.append("../")
from core import const as game_const
import os
import time
import json
import subprocess
im... | 1.703125 | 2 |
{{ cookiecutter.repo_name }}/test/__init__.py | jakebrinkmann/waldo-jakebrinkmann | 0 | 12785961 | <gh_stars>0
"""Common testing configuration.
""" | 1.015625 | 1 |
neural_cdes/ode_with_context.py | jb-c/dissertation | 0 | 12785962 | <reponame>jb-c/dissertation<filename>neural_cdes/ode_with_context.py
import numpy as np
from F import F
#------------------------ ODE MODEL With Context ---------------------------
# The idea is to use a neural ode with context for sequence to sequence forcasting
#------------------------------------------------------... | 1.859375 | 2 |
src/illumideskdummyauthenticator/tests/test_authenticator.py | IllumiDesk/illumidesk | 41 | 12785963 | import json
from unittest.mock import Mock
from unittest.mock import patch
import pytest
from illumideskdummyauthenticator.authenticator import IllumiDeskDummyAuthenticator
from illumideskdummyauthenticator.validators import IllumiDeskDummyValidator
from tornado.web import RequestHandler
@pytest.mark.asyncio
async d... | 2.265625 | 2 |
atcoder/abc/abc140_d.py | knuu/competitive-programming | 1 | 12785964 | N, K = map(int, input().split())
S = input()
intervals = []
idx = 0
dirs = []
while idx < N:
start = idx
dirs.append([0, 1][S[idx] == "R"])
while idx < N and S[idx] == S[start]:
idx += 1
intervals.append(idx - start)
assert(sum(intervals) == N)
def calc_ans(result_dirs):
ans = N
if re... | 2.703125 | 3 |
Hack-Message/hack_message.py | yashk2810/Alert-on-Intrusion | 5 | 12785965 | #!/usr/bin/env python
import urllib2,re,pygeoip,json
import os
import twilio
from twilio.rest import TwilioRestClient
import pygame
import pygame.camera
TWILIO_ACCOUNT_SID="YOUR_ACCOUNT_SID"
TWILIO_AUTH_TOKEN="<PASSWORD>"
def main ():
new=open("/home/yash/auth",'r')
for i in new:
length1=len(i)
new.close()
ne... | 2.921875 | 3 |
ticketbase/codebase/migrations/0005_ticket_is_closed.py | Hipo/codebase-ultra | 0 | 12785966 | # Generated by Django 2.2.4 on 2019-09-27 09:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('codebase', '0004_ticket_status'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='is_closed',
... | 1.578125 | 2 |
python/html-color-converter.py | ModestTG/scripts | 0 | 12785967 | <reponame>ModestTG/scripts<filename>python/html-color-converter.py
from __future__ import print_function, unicode_literals, division
def rgb_to_hex(value):
rgb_values = value.split(",")
rgb_values = [int(i) for i in rgb_values]
print(rgb_values)
converted_values = []
for j, value in enumerate(rgb_... | 4.0625 | 4 |
puck_install.py | drsooch/puck-python | 0 | 12785968 | """
This is the main setup file for Puck.
"""
from pathlib import Path
import subprocess
import json
import psycopg2 as pg
PUCK = Path.home().joinpath('.puck/')
print('Creating Configuration file...')
if Path.exists(PUCK):
for file in Path.iterdir(PUCK):
Path.unlink(file)
Path.rmdir(PUCK)
Path.mkdir... | 2.5 | 2 |
src/pyff/exceptions.py | dnmvisser/pyFF | 15 | 12785969 | <filename>src/pyff/exceptions.py
__author__ = 'leifj'
import six
class PyffException(BaseException):
def __init__(self, msg, wrapped=None, data=None):
self._wrapped = wrapped
self._data = data
if six.PY2:
super(self.__class__, self).__init__(msg)
else:
super... | 2.59375 | 3 |
mc_pdf.py | shclem/mcdeck | 5 | 12785970 | <filename>mc_pdf.py
import os.path
from fpdf import FPDF
from mc_args import MCArgs
from mc_progress import MCProgress
class MCPdf(FPDF):
__args: MCArgs = None
__progress: MCProgress = None
def __init__(self, args, progress):
FPDF.__init__(self, orientation=args.pageOrientation, unit='mm', f... | 2.875 | 3 |
URI/1-Beginner/1759.py | vicenteneto/online-judge-solutions | 0 | 12785971 | # -*- coding: utf-8 -*-
n = int(raw_input())
result = ''.join(['Ho ' for x in range(n)])
print result[:-1] + '!'
| 3.734375 | 4 |
src/signer/secret20/signer.py | RainbowNetwork/RainbowBridge | 14 | 12785972 | <gh_stars>10-100
import json
from collections import namedtuple
from threading import Thread, Event
from typing import Dict, Union
from mongoengine import signals
from mongoengine import OperationError
from src.contracts.ethereum.multisig_wallet import MultisigWallet
from src.db.collections.commands import Commands
fr... | 2.171875 | 2 |
src/fractal/world/state.py | jedhsu/fractal | 0 | 12785973 | """
World State
===========
A type of world state described by fractums.
# [TODO] clarify
"""
class WorldState:
pass
| 1.90625 | 2 |
INBa/2015/Mitin_D_S/task_8_15.py | YukkaSarasti/pythonintask | 0 | 12785974 | # Задача 8. Вариант 15.
# Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка.
# Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений.
# Разработайте систему начисления очков, по которой бы игроки, отгадавшие... | 3.09375 | 3 |
iserver.py | DreamVB/httpServer | 1 | 12785975 | <filename>iserver.py<gh_stars>1-10
# A Very simple web server to serve statoc pages
# By <NAME> a.k.a DreamVB
import servfunc
import os.path
import cfgread
from http.server import BaseHTTPRequestHandler, HTTPServer
class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
... | 3.171875 | 3 |
Exercises/Exercises Chapter 04/Collect Digits.py | tonysulfaro/CSE-231 | 2 | 12785976 | <filename>Exercises/Exercises Chapter 04/Collect Digits.py
s = input("Input a string: ")
digits = ""
for i,ch in enumerate(s):
if ch.isdigit():
digits += ch
print(digits) | 3.984375 | 4 |
chcd.py | JohanAR/chcd | 0 | 12785977 | <reponame>JohanAR/chcd<filename>chcd.py
#!/usr/bin/python
# CHCD by <NAME>
import os
import os.path
import getpass
USERNAME = getpass.getuser()
def meFirstGen(iterable):
if USERNAME in iterable:
yield USERNAME
for item in iterable:
if item != USERNAME:
yield item
def recfind(c... | 2.765625 | 3 |
recommender/core/models.py | abhishekpathak/recommendation-system | 0 | 12785978 | <gh_stars>0
# -*- coding: utf-8 -*-
import json
from collections import Generator
from server import config
from server.extensions import redis_conn
""" A simple, quickly-prototyped ORM layer on top of Redis.
Supports all the functions needed by the serving layer, and nothing more.
The implementation details are ha... | 2.9375 | 3 |
post/migrations/0002_auto_20180224_1857.py | bozburak/Blog_With_Django | 0 | 12785979 | <filename>post/migrations/0002_auto_20180224_1857.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-02-24 15:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('post', '0001_initial'),
]
... | 1.492188 | 1 |
pyecore/__init__.py | 4ekin/pyecore | 0 | 12785980 | <filename>pyecore/__init__.py
"""
"""
__version__ = "0.11.6"
| 0.964844 | 1 |
omsdk/sdkunits.py | DanielFroehlich/omsdk | 61 | 12785981 | <gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# Copyright © 2018 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trademarks may be trademarks of their respective owners.
#
# Licensed under the Ap... | 1.976563 | 2 |
basis_selector/nwchem.py | adewyer/Exabyte | 0 | 12785982 | <gh_stars>0
"""
Author: <NAME>
Date: September 7, 2020
Class to create nwchem input file for basis set testing
"""
import re
import os
import sys
import logging
import subprocess
import pkg_resources
import basis_selector
from basis_selector import basis_sets as basis
from basis_selector import molecule as mol
from b... | 2.796875 | 3 |
pytest_sqlalchemy.py | crowdcomms/pytest-sqlalchemy | 3 | 12785983 | # -*- coding: utf-8 -*-
import os
from sqlalchemy import create_engine
from sqlalchemy.engine.url import make_url
from sqlalchemy.exc import ProgrammingError
import logging
import pytest
logger = logging.getLogger(__name__)
def pytest_addoption(parser):
group = parser.getgroup('sqlalchemy')
group.addoption(... | 2.421875 | 2 |
spaghetti/__init__.py | boris-hanin/spaghetti | 0 | 12785984 | # -*- coding: utf-8 -*-
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.0'
| 1.054688 | 1 |
Retrieve Comments/ConvertText.py | zhoudanxie/analyzing-public-comments | 2 | 12785985 | #--------------------------------------Convert Attachment (DOC & PDF) Comments to Text---------------------------------#
#---------------------------------------------The GW Regulatory Studies Center-----------------------------------------#
#--------------------------------------------------Author: <NAME>-------------... | 3.03125 | 3 |
day_16/main.py | orfeasa/advent-of-code-2021 | 29 | 12785986 | <gh_stars>10-100
from dataclasses import dataclass, field
@dataclass
class Packet:
version: int = 0
type_id: int = 0
value: int = None
subpackets: list = field(default_factory=list)
def parse_transmission(
transmission: str, length=None, number_of_packets=None
) -> list[Packet]:
if len(trans... | 2.765625 | 3 |
neural_compilers/utils/config.py | jordiae/neural-compilers | 4 | 12785987 | from enum import Enum
from dataclasses import dataclass
from typing import Optional
class TokenizerType(str, Enum):
PYGMENTS = 'pygments'
class SubwordType(str, Enum):
SUBWORD_NMT = 'subword-nmt'
@dataclass
class TokenizerConfig:
tokenizer_type: TokenizerType
subword_tokenizer: SubwordType
sub... | 2.953125 | 3 |
data/scripts/compile_acs_data.py | datamade/just-spaces | 6 | 12785988 | <filename>data/scripts/compile_acs_data.py
import csv
import sys
from django.conf import settings
# Set up a temporary settings file to ensure that we can import the pldp app
settings.configure(INSTALLED_APPS=['pldp'], USE_I18N=False)
from pldp import forms as pldp_forms
from fobi_custom.plugins.form_elements.fields... | 2.75 | 3 |
tests/util.py | Codesflow-Simon/Poker-framework | 0 | 12785989 | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src')))
from card import Card, suit_num_dict, rank_num_dict
from itertools import product
deck = []
suits = []
ranks = []
for suit, rank in product(suit_num_dict.keys(),rank_num_dict.keys()):
deck.append(Card(suit,... | 2.6875 | 3 |
tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/models_test.py | SoaringChicken/tensorflow-privacy | 0 | 12785990 | # Copyright 2020, The TensorFlow 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 t... | 2 | 2 |
challonge.py | garsh0p/garpr-goog | 2 | 12785991 | <gh_stars>1-10
import iso8601
import os
import requests
from requests_toolbelt.adapters import appengine
appengine.monkeypatch()
BASE_CHALLONGE_API_URL = 'https://api.challonge.com/v1/tournaments'
URLS = {
'tournament': os.path.join(BASE_CHALLONGE_API_URL, '%s.json'),
'participants': os.path.join(
... | 2.453125 | 2 |
RecoJets/JetAnalyzers/test/DijetRatioPlotExample_cfg.py | ckamtsikis/cmssw | 852 | 12785992 | <gh_stars>100-1000
# PYTHON configuration file.
# Description: Example of dijet ratio plot
# with corrected and uncorrected jets
# Author: <NAME>
# Date: 22 - November - 2009
import FWCore.ParameterSet.Config as cms
process = cms.Process("Ana")
process.load("FWCore.MessageService.MessageLogger_cfi")
... | 1.765625 | 2 |
bin/bucmup.py | aelzenaar/bucephalus | 0 | 12785993 | <reponame>aelzenaar/bucephalus
import sys
import argparse
import json
import dbops
import config
from pathlib import Path
parser = argparse.ArgumentParser(description='Bucephalus: Update Metadata')
parser.add_argument('id', metavar='IDENT', type=str, nargs=1,
help='article ID')
parser.add_argumen... | 2.421875 | 2 |
005/011.py | gerssivaldosantos/MeuGuru | 1 | 12785994 | <gh_stars>1-10
""" Crie uma função que irá pegar alguma jogada válida do usuário. No 2048, as
jogadas válidas serão ’a’, ’s’, ’d’, ’w’. Não aceite qualquer outro tipo de informação
Atenção 2: A função recebe a informação a partir no shell, não confunda
com parâmetros """
def receber_jogada():
""" Lê uma jogada e ... | 3.46875 | 3 |
slnee_quality/slnee_quality/doctype/strategic_plan/strategic_plan.py | erpcloudsystems/slnee_quality | 0 | 12785995 | # Copyright (c) 2021, erpcloud.systems and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, nowdate
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, get_d... | 2.0625 | 2 |
addons/azureblobstorage/provider.py | tsukaeru/RDM-osf.io | 11 | 12785996 | # -*- coding: utf-8 -*-
from osf.models.external import BasicAuthProviderMixin
class AzureBlobStorageProvider(BasicAuthProviderMixin):
"""An alternative to `ExternalProvider` not tied to OAuth"""
name = 'Azure Blob Storage'
short_name = 'azureblobstorage'
def __init__(self, account=None):
s... | 2.484375 | 2 |
GermanOK/Book.py | romainledru/GermanOK | 0 | 12785997 | <reponame>romainledru/GermanOK
import random
from Save import Save
class Word:
def __init__(self):
"""Initialisation: download the actual version of data.json
"""
d = Save("")
self.dico = d.download()
def getDico(self):
return self.dico
def pickWord(self):
... | 3.53125 | 4 |
_note_/_xml_.py | By2048/_python_ | 2 | 12785998 | <reponame>By2048/_python_
from xml.etree.ElementTree import parse
def main():
with open("T:\\keymap.xml", 'r', encoding='utf-8') as file:
data = parse(file).getroot()
for action in data.findall('action'):
if not action.findall('keyboard-shortcut'):
continue
print(action.at... | 3.078125 | 3 |
Camera/AutoDriving.py | maroneal/MircoITS | 0 | 12785999 | <reponame>maroneal/MircoITS
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
from time import sleep
import cv2
import numpy as np
import socket
import time
#Variables for the communication with the C program
TCP_IP = "127.0.0.1"
TCP_PORT = 4200
print ("TCP... | 2.703125 | 3 |
pdiff/__main__.py | nkouevda/pdiff | 5 | 12786000 | <gh_stars>1-10
import os
import sys
from . import argument_parser
from . import diff_formatter
def main():
parser = argument_parser.get_parser()
args = parser.parse_args()
for filename in (args.old_filename, args.new_filename):
if not os.path.exists(filename):
sys.stderr.write('error: file does not ... | 2.875 | 3 |
src/data_processing/Dallas/dallas_data.py | cyrusneary/multiscaleLockdownCovid19 | 0 | 12786001 | # %%
import sys, os
import pandas as pd
import networkx as nx
# import matplotlib.pyplot as plt
import numpy as np
import pickle
base_file_path = os.path.abspath(os.path.join(os.curdir, '..','..', '..')) # should point to the level above the src directory
data_path = os.path.join(base_file_path, 'data', 'Intercity_Dal... | 2.6875 | 3 |
quizzes/00.organize.me/Cracking the Coding Interview/18-8.py | JiniousChoi/encyclopedia-in-code | 2 | 12786002 | #!/usr/bin/env python3
''' 문자열 s와 s보다 짧은 길이를 갖는 문자열의 배열인 T가 주어졌을 때,
T에 있는 각 문자열을 s에서 찾는 메서드를 작성하라.'''
import unittest
class TreeRoot:
def __init__(self, s):
self.root = SuffixTreeNode()
root = self.root
for i in range(len(s)):
root.insertString(s[i:], i)
def search(sel... | 3.84375 | 4 |
app/senders/queries.py | mcherdakov/herodotus | 0 | 12786003 | from time import time
from uuid import UUID
import asyncpg
from app.senders.models import (EmailConfInDb, EmailStatus, Message,
MessageStatus, TelegramConfInDb,
TelegramStatus)
async def insert_email_conf(conn: asyncpg.Connection, conf: EmailConfInDb):... | 2.34375 | 2 |
back-end/legacy/cp_pytorch_ts.py | yenchiah/deep-smoke-machine | 88 | 12786004 | <reponame>yenchiah/deep-smoke-machine
import torch
import torch.nn as nn
import torch.nn.functional as F
class MotionCNN(nn.Module):
def __init__(self):
super().__init__()
self.model = nn.Sequential(
nn.Conv2d(in_channels=72, out_channels=96, kernel_size=7, stride=2),
nn.Ma... | 2.3125 | 2 |
tools/SMZ-NNP/gatherRMSE-GaN350.py | s-okugawa/HDNNP-tools | 0 | 12786005 | # coding: utf-8
import matplotlib.pyplot as plt
import csv
"""
This script is for gathering force/RMSE data from training result of
GaN 350 sample and plot them
"""
if __name__ == '__main__':
GaN350folder="/home/okugawa/NNP-F/GaN/SMZ-200901/training_2element/350smpl/"
outfile=GaN350folder+"result/RMSE.csv"
... | 2.6875 | 3 |
tests/event_demo/event_demo.py | erikgqp8645/vnpy | 0 | 12786006 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 13:50:45 2018
@author: 18665
"""
# encoding: UTF-8
import sys
from datetime import datetime
from threading import *
#sys.path.append('D:\\works\\TestFile')
#print(sys.path)
from .eventManager import *
#事件名称 新文章
EVENT_ARTICAL = "Event_Artical"
#事件源 公众号
c... | 2.390625 | 2 |
pyb4ml/inference/factored/factored_algorithm.py | ax-va/PyB4ML | 0 | 12786007 | <gh_stars>0
import copy
from pyb4ml.modeling.categorical.variable import Variable
from pyb4ml.modeling.factor_graph.factor import Factor
from pyb4ml.modeling.factor_graph.factor_graph import FactorGraph
class FactoredAlgorithm:
"""
This is an abstract class of some factored algorithm, which is inherited by
... | 2.796875 | 3 |
utilities/HSV_detection.py | jlittek/Anki-Vector | 0 | 12786008 | from cv2 import cv2
import numpy as np
import anki_vector
from anki_vector.util import distance_mm, speed_mmps, degrees
def empty(a):
pass
robot=anki_vector.Robot()
robot.connect()
robot.camera.init_camera_feed()
robot.behavior.set_lift_height(0.0)
robot.behavior.set_head_angle(degrees(0))
cv2.namedWindow("Tr... | 2.921875 | 3 |
tests/test_lock_apis.py | pjz/etcd3-py | 96 | 12786009 | <filename>tests/test_lock_apis.py
import time
from threading import Thread
import pytest
from etcd3.client import Client
from tests.docker_cli import docker_run_etcd_main
from .envs import protocol, host
from .etcd_go_cli import NO_ETCD_SERVICE, etcdctl
@pytest.fixture(scope='module')
def client():
"""
init... | 2.015625 | 2 |
src/snpahoy/utilities.py | asp8200/snpahoy | 5 | 12786010 | from statistics import mean
from typing import List
from snpahoy.core import SNP
def count_heterozygotes(snps: List[SNP]) -> int:
"""Exactly as advertized. Counts the number of heterozygote sites."""
return len([snp for snp in snps if snp.is_heterozygote()])
def mean_minor_allele_frequency(snps: List[SNP])... | 3.671875 | 4 |
tests/unit/task/contexts/network/test_existing_network.py | jogeo/rally-openstack | 0 | 12786011 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... | 1.851563 | 2 |
train.py | DheerajRacha/Image-Segmentation | 1 | 12786012 | <filename>train.py
import os
import sys
import csv
import numpy as np
import tensorflow as tf
from arguments import flags
from DataLoader import DataLoader
from models.DeepLabV3 import build_deeplabv3
from utils import evaluate_segmentation
def train(args):
image = tf.placeholder(tf.float32, shape=[None, None, No... | 2.640625 | 3 |
app/core/parser/parser.py | SLB974/GrandPyBot-dev | 0 | 12786013 | # coding: utf-8
from unidecode import unidecode
import re
from .utils import stop_words
class Parser:
"""Parse user's query"""
def __init__(self, user_query):
self.user_query = user_query
def clean_string(self):
"""remove accents, upper and punctuation
and split into list
... | 3.578125 | 4 |
python/tools/cepton_georeference.py | frank-qcd-qk/cepton_sdk_redist | 23 | 12786014 | <gh_stars>10-100
#!/usr/bin/env python3
"""
Sample script to combine LiDAR data to generate point cloud.
"""
import argparse
import datetime
import json
import os.path
import matplotlib.pyplot
import numpy
import pytz
import scipy.interpolate
import scipy.spatial.transform
import utm
from mpl_toolkits.mplot3d import ... | 2.296875 | 2 |
generator/storage_spider_template.django.py | chongiadung/choinho | 0 | 12786015 | <reponame>chongiadung/choinho<filename>generator/storage_spider_template.django.py
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "{{ spider.xpath.name|safe }}",
'price' : "{{ spider... | 1.789063 | 2 |
km_api/rest_order/mixins.py | knowmetools/km-api | 4 | 12786016 | from rest_framework.response import Response
class SortModelMixin(object):
sort_child_name = None
sort_parent = None
sort_serializer = None
def get_sort_serializer(self, *args, **kwargs):
serializer_class = self.sort_serializer
kwargs["context"] = self.get_serializer_context()
... | 2.15625 | 2 |
app/audit/tasks.py | getmetamapper/metamapper | 53 | 12786017 | # -*- coding: utf-8 -*-
from metamapper.celery import app
from datetime import timedelta
from django.utils.timezone import now
from app.audit.models import Activity
@app.task(bind=True)
def audit(self,
actor_id,
workspace_id,
verb,
old_values,
new_values,
... | 2.015625 | 2 |
test/swift_project_test.py | Dan2552/SourceKittenSubl | 163 | 12786018 | from src import swift_project
from helpers import path_helper
import unittest
class TestSourceKitten(unittest.TestCase):
# Test with a simple project directory
# (i.e. without xcodeproj)
def test_source_files_simple_project(self):
project_directory = path_helper.monkey_example_directory()
... | 2.625 | 3 |
pymodaq_plugins/daq_viewer_plugins/plugins_2D/daq_2Dviewer_AndorCCD.py | SofyMeu/pymodaq_plugins | 0 | 12786019 | from pymodaq_plugins.hardware.andor.daq_AndorSDK2 import DAQ_AndorSDK2
class DAQ_2DViewer_AndorCCD(DAQ_AndorSDK2):
"""
=============== ==================
=============== ==================
See Also
--------
utility_classes.DAQ_Viewer_base
"""
control_type = "camer... | 2.28125 | 2 |
Cura/Cura/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 0 | 12786020 | <reponame>TIAO-JI-FU/3d-printing-with-moveo-1<filename>Cura/Cura/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py
# Copyright (c) 2018 <NAME>.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser #To parse preference files.
import io #To serialise the preference files afte... | 2.390625 | 2 |
general.py | SoniramSotirach/SecSerres1 | 0 | 12786021 | import pandas as pd
file = r'file.log'
cols=['host','1','userid','date','tz','endpoint','status','data','referer','user_agent']
df=pd.read_csv(file,delim_whitespace=True,names=cols).drop('1',1)
print (df.head())
unique_ip=df.host.unique()
print(unique_ip)
total = df['data'].sum()
print('the serv... | 3.046875 | 3 |
doc/rexi/strategies_for_solving_rexi_terms/helmholtz_problem_fault_tolerance.py | valentinaschueller/sweet | 6 | 12786022 | <gh_stars>1-10
#! /usr/bin/env python3
import math
a_list = [ -0.86304 + 0j,
-0.86304 + 1j,
-0.86304 + 10j,
-0.86304 + 100j,
-0.86304 + 1000j
]
f = 1.0
g = 1.0
eta0_hat = 1.0
u0_hat = 1.0
v0_hat = 0.5
eta_bar = 1.0
for a in a_list:
for k in [0.01, 0.1, 1.0]:
# for k in [0.1]:
lhs = (a*a+f*f)+g*eta_ba... | 2.875 | 3 |
till_looping/4_3.py | mdazharuddin1011999/IoT_Assignment_2 | 0 | 12786023 | <filename>till_looping/4_3.py
from math import factorial
x = int(input("Enter x: "))
n = int(input("Enter n: "))
print(1+sum([x**i/factorial(i) for i in range(2,n+1, 2)])) | 3.46875 | 3 |
tests/test_persistence.py | DiscoverAI/pungi | 0 | 12786024 | <reponame>DiscoverAI/pungi
import pungi.persistence as persistence
from collections import defaultdict
import os
import shutil
def test_save_simple_q_table():
test_q_table = defaultdict(lambda: (5, 5, 5, 5, 5))
test_q_table[0] = (4, 5, 6, 7, 8)
test_q_table[(1, 2)] = (7, 5, 4, 3, 2)
test_dir = "./te... | 2.453125 | 2 |
algorithms/python/leetcode/x3Sum.py | ytjia/coding-pratice | 0 | 12786025 | # -*- coding: utf-8 -*-
# Authors: <NAME> <<EMAIL>>
"""
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all
unique triplets in the array which gives the sum of zero.
https://leetcode.com/problems/3sum/description/
"""
class Solution(object):
def threeSum(self, nums... | 3.4375 | 3 |
cc_backend_lib/models/country.py | prio-data/cc_backend_lib | 0 | 12786026 | <reponame>prio-data/cc_backend_lib
from typing import List, Optional
from pydantic import BaseModel
from geojson_pydantic import features, geometries
class Country(features.Feature):
class Meta:
QUERY_ORDER = ["gwno","name","iso2c","shape"]
properties: "CountryProperties"
@classmethod
def fr... | 2.4375 | 2 |
Ago-Dic-2021/fernandez-salinas-cristian-alejandro/Practica3/calculator_test.py | CristianF50/DAS_Sistemas | 41 | 12786027 | import unittest
from calculator import *
class CalculatorTest(unittest.TestCase):
def test_suma_dos_numeros(self):
calc = Calculator(5, 10)
self.assertEqual(15, calc.suma())
def test_resta_dos_numeros(self):
calc = Calculator(19, 8)
self.assertEqual(11, calc.resta())
... | 3.71875 | 4 |
tests/cmdline/test_plot.py | JuDFTteam/masci-tools | 15 | 12786028 | <filename>tests/cmdline/test_plot.py
# -*- coding: utf-8 -*-
"""
Test of the plot commands in the cli
Here we do not test the actual content of the plot but only that the
commands work without error
"""
from pathlib import Path
import os
import pytest
def test_fleur_dos():
"""
Test of the fleur-dos routine w... | 2.15625 | 2 |
vietnamese_utils.py | khiemdoan/aivivn_vietnamese_tone_prediction | 1 | 12786029 | <filename>vietnamese_utils.py
import re
import string
uni_chars_l = 'áàảãạâấầẩẫậăắằẳẵặđèéẻẽẹêếềểễệíìỉĩịóòỏõọôốồổỗộơớờởỡợúùủũụưứừửữựýỳỷỹỵ'
uni_chars_u = 'ÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶĐÈÉẺẼẸÊẾỀỂỄỆÍÌỈĨỊÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢÚÙỦŨỤƯỨỪỬỮỰÝỲỶỸỴ'
AEIOUYD = ['a', 'e', 'i', 'o', 'u', 'y', 'd']
A_FAMILY = list('aáàảãạăắằẳẵặâấầẩẫậ')
E_FAMILY = l... | 2.3125 | 2 |
nlpipe/Tools/alpino.py | ccs-amsterdam/nlpipe | 0 | 12786030 | <gh_stars>0
"""
Wrapper around the RUG Alpino Dependency parser
The module expects either ALPINO_HOME to point at the alpino installation dir
or an alpino server to be running at ALPINO_SERVER (default: localhost:5002)
You can use the following command to get the server running: (see github.com/vanatteveldt/alpino-ser... | 2.296875 | 2 |
thenewboston_node/business_logic/models/signed_change_request/base.py | thenewboston-developers/thenewboston-node | 30 | 12786031 | import copy
import logging
from dataclasses import dataclass
from typing import Any, Optional, Type, TypeVar
from thenewboston_node.business_logic.exceptions import ValidationError
from thenewboston_node.business_logic.models.base import BaseDataclass
from thenewboston_node.core.logging import validates
from thenewbos... | 1.9375 | 2 |
src/harness/grpc_pb2.py | vmagamedov/harness | 6 | 12786032 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: harness/grpc.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sym... | 1.117188 | 1 |
src/configure/Flink-demo/genes.py | HICAS-ChameLeon/Chameleon | 4 | 12786033 | <gh_stars>1-10
import random
import numpy as np
from sklearn.externals import joblib
from deap import base
from deap import creator
from deap import tools
from itertools import repeat
from collections import Sequence
clf=joblib.load('./data/models/Jmodel.pkl')
importance = clf.feature_importances_
creator.create("... | 2.6875 | 3 |
src/service/setup.py | MrMonkeyPi/monkey-pi | 0 | 12786034 | import os
import shelve
APP_SETTING_FILE = os.path.join(os.getcwd(), 'instance', "data", "app")
CACHE_DIR = os.path.join(os.getcwd(), 'instance', 'cache')
try:
os.makedirs(CACHE_DIR)
os.makedirs(os.path.dirname(APP_SETTING_FILE))
except OSError:
pass
# for item, value in os.environ.items():
# print(... | 2.546875 | 3 |
meal_plan_optimizer/__init__.py | ilSommo/meal-plan-optimizer | 2 | 12786035 | <filename>meal_plan_optimizer/__init__.py
__version__ = '1.3.0'
__author__ = '<NAME>'
| 0.996094 | 1 |
webcheck/webcheck.py | sintrb/webcheck | 0 | 12786036 | # -*- coding: UTF-8 -*
from __future__ import print_function
__version__ = "1.2.0"
def get_certificate(hostname, port, sername=None):
import idna
from socket import socket
from OpenSSL import SSL
sock = socket()
sock.setblocking(True)
sock.connect((hostname, port), )
ctx = SSL.Context(SS... | 2.984375 | 3 |
goodman_pipeline/wcs/tests/test_functional.py | SunilSimha/goodman_pipeline | 6 | 12786037 | from __future__ import absolute_import
from unittest import TestCase, skip
from ..wcs import WCS
import numpy as np
import os
import re
import sys
from astropy.io import fits
from astropy.modeling import (models, fitting, Model)
import matplotlib.pyplot as plt
from ccdproc import CCDData
class TestWCSBase(TestCase)... | 2.03125 | 2 |
Guizero/05.Widgets.py | sarincr/Python-modules-for-GUI-Dev | 0 | 12786038 | from guizero import App, TextBox, Text
def count():
character_count.value = len(entered_text.value)
app = App()
entered_text = TextBox(app, command=count)
character_count = Text(app)
app.display()
| 2.71875 | 3 |
warehouse/utils/admin_flags.py | jw/warehouse | 0 | 12786039 | <filename>warehouse/utils/admin_flags.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 wri... | 2.171875 | 2 |
mobile/views/mobile_data_tool_view.py | invinst/CPDB | 16 | 12786040 | from django.views.generic import RedirectView
from mobile.constants import DEFAULT_REDIRECT_URL, DEFAULT_REDIRECTORS
from mobile.services.mobile_redirector_service import DesktopToMobileRedirectorService
from share.models import Session
class MobileDataToolView(RedirectView):
def get_redirect_url(self, *args, **... | 1.992188 | 2 |
lib/exaproxy/icap/parser.py | oriolarcas/exaproxy | 124 | 12786041 | <reponame>oriolarcas/exaproxy
#!/usr/bin/env python
# encoding: utf-8
from .request import ICAPRequestFactory
from .response import ICAPResponseFactory
from .header import ICAPResponseHeaderFactory
class ICAPParser (object):
ICAPResponseHeaderFactory = ICAPResponseHeaderFactory
ICAPRequestFactory = ICAPRequestFactor... | 2.125 | 2 |
objs/objs.py | n-hachi/raytrace | 0 | 12786042 | <reponame>n-hachi/raytrace<gh_stars>0
from abc import ABCMeta, abstractmethod
import numpy as np
from .ray import Ray
class AbsObject(metaclass=ABCMeta):
@abstractmethod
def normal(self, ray):
raise NotImplementedError()
@abstractmethod
def reflect(self, ray):
raise NotImplementedErr... | 2.40625 | 2 |
applications/camera_calibration/scripts/derive_jacobians.py | lingbo-yu/camera_calibration | 474 | 12786043 | import math
import sys
import time
from sympy import *
from sympy.solvers.solveset import nonlinsolve
from optimizer_builder import *
# ### Math functions ###
# Simple model for the fractional-part function used for bilinear interpolation
# which leaves the function un-evaluated. Ignores the discontinuities when
#... | 2.640625 | 3 |
generate_doc_src.py | epaulson/brick-website | 0 | 12786044 | from util import generate_doc_src, auto_dict
from rdflib import Graph
from urllib.error import URLError
# Pull the latest Brick.ttl to /static/schema
try:
g = Graph()
g.parse("https://github.com/brickschema/Brick/releases/latest/download/Brick.ttl", format="turtle")
g.serialize("static/schema/Brick.ttl", f... | 2.453125 | 2 |
menus/IBook/Chapter4 Digital-Filter/filter_plgs.py | Image-Py/IBook | 2 | 12786045 | from sciapp.action import Free
import scipy.ndimage as ndimg
import numpy as np, wx
# from imagepy import IPy
#matplotlib.use('WXAgg')
import matplotlib.pyplot as plt
def block(arr):
img = np.zeros((len(arr),30,30), dtype=np.uint8)
img.T[:] = arr
return np.hstack(img)
class Temperature(Free):
title = 'Temperature... | 2.546875 | 3 |
tests/test_telemetry_full.py | cruigo93/client | 0 | 12786046 | <gh_stars>0
"""
telemetry full tests.
"""
import platform
import pytest
import wandb
try:
from unittest import mock
except ImportError: # TODO: this is only for python2
import mock
def test_telemetry_finish(live_mock_server, parse_ctx):
run = wandb.init()
run.finish()
ctx_util = parse_ctx(live... | 2.25 | 2 |
setup.py | istreamlabs/httpie-esni-auth | 1 | 12786047 | <filename>setup.py
from setuptools import setup
try:
import multiprocessing
except ImportError:
pass
setup(
name='httpie-esni-auth',
description='ESNI auth plugin for HTTPie.',
long_description=open('README.md').read().strip(),
version='1.0.0',
author='<NAME>',
author_email='<EMAIL>',
... | 1.476563 | 1 |
census_response.py | dannmorr/greater-chicago-food-despository | 0 | 12786048 | from api_keys import CENSUS_KEY
import json
import requests
def getCensusResponse(table_url,get_ls,geo):
'''
Concatenates url string and returns response from census api query
input:
table_url (str): census api table url
get_ls (ls): list of tables to get data from
geo (str): geogra... | 3.453125 | 3 |
coqconn/client.py | liyi-david/coqconn | 0 | 12786049 | <gh_stars>0
from .conn import CoqConnection, CoqConnectionError
from .call import Add
class CoqClient:
def __init__(self, coqtop=None, args=[], timeout=2):
self.conn = CoqConnection.connect(coqtop, args, timeout)
def add(self, code):
self.conn.call(Add(code))
resps = self.conn.read_un... | 2.53125 | 3 |
mci/config/__init__.py | brighthive/master-client-index | 2 | 12786050 | <reponame>brighthive/master-client-index
from mci.config.config import ConfigurationFactory, Config
| 1.054688 | 1 |