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 |
|---|---|---|---|---|---|---|
generateFormula.py | auto-staging/homebrew-stagectl | 0 | 12792451 | <reponame>auto-staging/homebrew-stagectl
#!/usr/bin/env/python
from jinja2 import Environment, FileSystemLoader
import os
envVersion = os.environ['VERSION']
envFileHash = os.environ['FILE_HASH']
file_loader = FileSystemLoader('templates')
env = Environment(loader=file_loader)
template = env.get_template('stagectl.rb... | 2.203125 | 2 |
djhelpers/tests.py | trunneml/djhelpers | 0 | 12792452 | # Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 2.25 | 2 |
programmers/blind_phone_number.py | schio/algorithm_test | 0 | 12792453 | <filename>programmers/blind_phone_number.py
# https://programmers.co.kr/learn/courses/30/lessons/12948
def solution(phone_number):
phone_number = list(phone_number)
phone_number[:-4] = ["*"] * (len(phone_number) - 4)
return "".join(phone_number)
| 3.390625 | 3 |
src/filesystem/transformation/transformer.py | pgecsenyi/fst | 1 | 12792454 | <filename>src/filesystem/transformation/transformer.py
import os
import re
class Transformer:
def __init__(self):
self._cache = {}
self._full_path_cache = {}
def add_to_cache(self, directory_lister, transformations):
pattern_pairs = [
(re.compile(transformation.from_path)... | 2.71875 | 3 |
TestClient/TestClient.py | SHI3DO/prushka-web | 1 | 12792455 | from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import requests
apiserver = ""
class ListView(QWidget):
def __init__(self, parent=None):
super(ListView, self).__init__(parent)
self.setWindowTitle('Asphodel Downloader Test Client')
self.resize(400, 100)
... | 2.640625 | 3 |
src/plot.py | ekholabs/nltk_tutorial | 0 | 12792456 | """
Organisation: ekholabs
Author: <EMAIL>
"""
from nltk.book import text1, text2, text4
def plot_changes_in_use_of_words(book, words):
# Dispersion plot of the use of natural language in different contexts or situations. For example,
# the use of certain words used by Presidents over the years.
... | 3.140625 | 3 |
app/admin.py | iam-feysal/awwwwwwwards | 0 | 12792457 | from django.contrib import admin
from .models import Project,Profile,Review,Comment
# Register your models here.
class ReviewAdmin(admin.ModelAdmin):
model = Review
list_display = ('wine', 'rating', 'user_name', 'comment', 'pub_date')
list_filter = ['pub_date', 'user_name']
search_fields = ['comment']
... | 1.632813 | 2 |
mrc/localization/color/nn/models.py | Lukasz1928/mobile-robots-control | 2 | 12792458 | from abc import ABC
import chainer
import chainer.functions as F
import chainer.links as L
class AbstractModel(ABC):
def predict(self, blob):
pass
class DefaultModel:
def __init__(self, n_units=100, n_out=6, colors=('red', 'blue', 'green', 'cyan', 'magenta', 'yellow')):
self.n_units = n_uni... | 3.125 | 3 |
backend.py | insertcustomname/EmailTrackExtension | 0 | 12792459 | from collections import Counter
from notify_run import Notify
import os
import time
import dropbox
import json
dropboxkey=""
notify = Notify()
notifyendpoint=""
notify.endpoint=notifyendpoint
notify.write_config()
from flask import Flask,request
maindictionary={}
dbx = dropbox.Dropbox(dropboxkey)
dbx.files_download_to... | 2.53125 | 3 |
Aula02/exercise1.py | GabiDeutner/Python_exercises | 4 | 12792460 | <reponame>GabiDeutner/Python_exercises<filename>Aula02/exercise1.py
'''
1. Escreva um programa para ler 2 valores (considere que não serão informados valores iguais)
e escrever o maior deles.
'''
print('Digite o numero 1:')
numero1 = float(input())
print('Digite o numero 2:')
numero2 = float(input())
if(numero1>nume... | 3.9375 | 4 |
web/ctf_gameserver/web/scoring/decorators.py | exokortex/kaindorfctf-2018-ctf-gameserver | 0 | 12792461 | <reponame>exokortex/kaindorfctf-2018-ctf-gameserver
from functools import wraps
from django.shortcuts import redirect
from django.conf import settings
from django.utils.translation import ugettext as _
from django.contrib import messages
from .models import GameControl
def registration_open_required(view):
"""
... | 2.328125 | 2 |
pygraph/min_spanning_tree.py | jysh1214/pygraph | 0 | 12792462 | from .get_imformation import GI
from .disjoint_set import DS
import math
class MST():
def __init__(self, adj_matrix, ins_matrix):
"""
Parameters:
adj_matrix(list):
The adjacency matrix of the graph.
ins_matrix(list):
The incidence matrix of ... | 3.0625 | 3 |
tests/x-custom_tests.py | ivoupton/sheet2dict | 208 | 12792463 | import sys
from pathlib import Path
sys.path.append(str(Path(".").absolute().parent))
from sheet2dict import Worksheet
from io import BytesIO
ws = Worksheet()
ws.xlsx_to_dict(path="inventory.xlsx")
print(">>", ws.header)
print("ALL:", ws.sheet_items)
print("SANITIZED:", ws.sanitize_sheet_items)
path = "inventory.... | 2.78125 | 3 |
python/code_troopers/Runner.py | tigeral/polygon | 0 | 12792464 | import sys
from MyStrategy import MyStrategy
from RemoteProcessClient import RemoteProcessClient
from model.Move import Move
from time import sleep
class Runner:
def __init__(self):
sleep(4)
if sys.argv.__len__() == 4:
self.remote_process_client = RemoteProcessClient(sys.argv[1], int(s... | 2.34375 | 2 |
xldlib/controllers/bindings/table.py | Alexhuszagh/XLDiscoverer | 0 | 12792465 | '''
Controllers/Bindings/table
__________________________
Class with designed inheritance for copy/paste methods.
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU GPLv3.txt for more details.
'''
# load modules/submodules
from PySide import QtCo... | 2.140625 | 2 |
01. Variable/021.py | MaksonViini/Aprendendo-Python | 1 | 12792466 | #Tocando um MP3
from pygame import mixer
mixer.init()
mixer.music.load('EX021.mp3') #Adicione o nome da musica
mixer.music.play() | 2.5 | 2 |
wp.py | zamoose/wp-ansible | 0 | 12792467 | <reponame>zamoose/wp-ansible
#!/usr/bin/python
# -*- coding: utf-8 -*-
def main():
module = AnsibleModule(
argument_spec = dict(
path=dict(required=True),
state=dict(),
plugin=dict(),
theme=dict(),
user=dict(),
version=dict(),
... | 1.765625 | 2 |
tweets/migrations/0004_auto_20201201_2002.py | bubaic/twitt | 0 | 12792468 | # Generated by Django 3.1.3 on 2020-12-01 14:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tweets', '0003_auto_2020... | 1.71875 | 2 |
leaderboard.py | cclauss/repo-tools | 0 | 12792469 | <gh_stars>0
#!/usr/bin/env python
from __future__ import print_function
import argparse
import collections
import datetime
import sys
from helpers import date_arg, make_timezone_aware
from repos import Repo
from webhookdb import get_pulls
def get_external_pulls(repo):
"""Produce a stream of external pull reque... | 2.625 | 3 |
python/setup.py | SamChill/drunkardswalk | 3 | 12792470 | #!/usr/bin/env python
from setuptools import setup
from os.path import dirname, abspath, join
setup(name='drunkardswalk',
packages=['drunkardswalk'],
)
| 1.320313 | 1 |
examples/docs_snippets/docs_snippets_tests/concepts_tests/io_management_tests/test_subselection.py | kstennettlull/dagster | 0 | 12792471 | from docs_snippets.concepts.io_management.subselection import (
execute_full,
execute_subselection,
)
def test_execute_job():
execute_full()
def test_execute_subselection():
execute_subselection()
| 1.179688 | 1 |
src/Scapy2Library/keywords/__init__.py | wywincl/Scapy2Library | 2 | 12792472 | <filename>src/Scapy2Library/keywords/__init__.py
from _corekeywords import _ScapyKeywords
from _runonfailure import _RunOnFailureKeywords
from _logging import _LoggingKeywords
__all__ = ["_ScapyKeywords",
"_RunOnFailureKeywords",
"_LoggingKeywords"]
| 1.234375 | 1 |
1701-1800/1712-Binary Subarrays With Sum/1712-Binary Subarrays With Sum.py | jiadaizhao/LintCode | 77 | 12792473 | <reponame>jiadaizhao/LintCode
class Solution:
"""
@param A: an array
@param S: the sum
@return: the number of non-empty subarrays
"""
def numSubarraysWithSum(self, A, S):
# Write your code here.
table = [0] * (len(A) + 1)
table[0] = 1
curr = count = 0
for ... | 3.328125 | 3 |
app/enquiries/common/consent.py | uktrade/enquiry-mgmt-tool | 3 | 12792474 | from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from requests import HTTPError
from rest_framework import status
from app.enquiries.common.client import APIClient
from app.enquiries.common.hawk import HawkAuth
CONSENT_SERVICE_PATH_PERSON = "/api/... | 2.03125 | 2 |
models/det/__init__.py | BruceHan98/OCHTPS | 0 | 12792475 | from .pannet import PANNet
| 1.101563 | 1 |
pcep/prac_2.py | gliverm/devnet-study-group | 1 | 12792476 | def fun(inp=2, out=3):
return inp * out
print(fun(out=2)) | 2.6875 | 3 |
pgweb/util/admin.py | ChristophBerg/pgweb | 1 | 12792477 | <reponame>ChristophBerg/pgweb
from django.contrib import admin
from django.conf import settings
from pgweb.core.models import ModerationNotification
from mailqueue.util import send_simple_mail
class PgwebAdmin(admin.ModelAdmin):
"""
ModelAdmin wrapper that will enable a few pg specific things:
* Markdown preview ... | 2.171875 | 2 |
new_venv/Lib/site-packages/cardio/core/utils.py | Shlyankin/cardio | 250 | 12792478 | """Miscellaneous ECG Batch utils."""
import functools
import pint
import numpy as np
from sklearn.preprocessing import LabelBinarizer as LB
UNIT_REGISTRY = pint.UnitRegistry()
def get_units_conversion_factor(old_units, new_units):
"""Return a multiplicative factor to convert a measured quantity from old
t... | 3.0625 | 3 |
test/unit/parser_test.py | jartigag/pydometer | 2 | 12792479 | import pytest
from models.parser import Parser
def test_new():
pass #TODO
#data = '0.123,-0.123,5;0.456,-0.789,0.111;-0.212,0.001,1;'
#parser = Parser(data)
#assert parser.parsed_data==None
# --- Creation Tests ---
def test_create_combined_data():
data = '0.123,-0.123,5;0.456,-0.789,0.111;-0.21... | 2.65625 | 3 |
models/stock_model.py | satyam93sinha/SuperSimpleStockMarket | 0 | 12792480 | class StockModel:
def __init__(self):
self.stock_symbol = None
self.stock_type = None
self.last_dividend = 0
self.fixed_dividend = 0
self.par_value = 0
def set_stock_symbol(self, symbol_of_stock: str) -> None:
self.stock_symbol = symbol_of_stock
def get_stoc... | 3.09375 | 3 |
yowsup/demos/contacts/stack.py | zulu494/Anoa-Bot- | 1 | 12792481 | from .layer import SyncLayer
from yowsup.stacks import YowStackBuilder
from yowsup.layers import YowLayerEvent
from yowsup.layers.auth import YowAuthenticationProtocolLayer
from yowsup.layers.network import YowNetworkLayer
class YowsupSyncStack(object):
def __init__(self, profile, contacts):
"""
... | 2.015625 | 2 |
1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/02_Conditional-Statements/00.Book-Exercise-3.1-08-Metric-Converter.py | karolinanikolova/SoftUni-Software-Engineering | 0 | 12792482 | <reponame>karolinanikolova/SoftUni-Software-Engineering
# конвертор за мерни единици
# Да се напише програма, която преобразува разстояние между следните 8 мерни единици: m, mm, cm, mi, in, km, ft, yd. Използвайте съответствията от таблицата по-долу:
amount = float(input())
unit_input = input().lower()
unit_output = ... | 3.703125 | 4 |
Model/StaffModel.py | izazdhiya/E-Library-Desktop | 2 | 12792483 |
from .BaseModel import *
class StaffModel(BaseModel):
def __init__(self):
super().__init__()
def validStaff(self,usr,passwd):
query = f"SELECT * FROM staff WHERE email='{usr}' AND pass='{passwd}'"
try:
return self.database.fetchall(query)[0][0]
except Exception as e:
return False | 2.6875 | 3 |
setup.py | SeabornGames/File | 0 | 12792484 | from setuptools import setup
import os
try:
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f:
long_description = f.read()
except Exception:
long_description = ''
setup(
name='seaborn-file',
version='1.1.1',
description='Seaborn-File enables the manipulation of the'
... | 1.65625 | 2 |
iot/led/light-sensor/main.py | Kevin181/geektime | 0 | 12792485 | from ble_lightsensor import BLELightSensor
from lightsensor import LightSensor
import time
import bluetooth
def main():
ble = bluetooth.BLE()
ble.active(True)
ble_light = BLELightSensor(ble)
light = LightSensor(36)
light_density = light.value()
i = 0
while True:
# Write every seco... | 3.140625 | 3 |
scripts/summarize_word_frequency_by_corpus.py | codebyzeb/Zorro | 2 | 12792486 | <filename>scripts/summarize_word_frequency_by_corpus.py
"""
How often do words in test sentences occur in each target corpus?
"""
import numpy as np
from zorro import configs
from zorro.vocab import load_vocab_df
vocab_df = load_vocab_df(return_excluded_words=True)
column_names = [f'{corpus_name}-frequency' for corpu... | 3.09375 | 3 |
labpack/records/ip.py | collectiveacuity/labPack | 2 | 12792487 | <gh_stars>1-10
__author__ = 'rcj1492'
__created__ = '2017.06'
__licence__ = 'MIT'
def get_ip(source='aws'):
''' a method to get current public ip address of machine '''
if source == 'aws':
source_url = 'http://checkip.amazonaws.com/'
else:
raise Exception('get_ip currently only su... | 2.84375 | 3 |
autobuyfast/cars/migrations/0045_auto_20210908_0458.py | dark-codr/autouyfast | 0 | 12792488 | <filename>autobuyfast/cars/migrations/0045_auto_20210908_0458.py
# Generated by Django 3.1.13 on 2021-09-08 03:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cars', '0044_carcompare'),
]
operations = [
... | 1.359375 | 1 |
tests/test_list.py | zheng-gao/ez_code | 0 | 12792489 | <reponame>zheng-gao/ez_code
from ezcode.list.linked_list import SinglyLinkedList
from ezcode.list.stack import Stack, MinStack, MaxStack
from ezcode.list.queue import Queue, MonotonicQueue
from ezcode.list.lru_cache import LRUCache
from fixture.utils import equal_list
class Node:
def __init__(self, v=None, n=None... | 3.015625 | 3 |
examples/optimal_burst/bursts_ttk_simulation.py | spascou/ps2-analysis | 2 | 12792490 | import logging
import os
from typing import List, Optional
import altair
from ps2_census.enums import PlayerState
from ps2_analysis.enums import DamageLocation
from ps2_analysis.fire_groups.cone_of_fire import ConeOfFire
from ps2_analysis.fire_groups.data_files import (
update_data_files as update_fire_groups_dat... | 2.265625 | 2 |
trello/cards/views.py | copydataai/clon-trello | 0 | 12792491 |
# DRF
from rest_framework.viewsets import ModelViewSet
from rest_framework import permissions
from rest_framework.permissions import IsAuthenticated
# Serializer
from trello.cards.serializers import CardSerializer
# Model
from trello.cards.models import Card
class CardViewSet(ModelViewSet):
serializer_class =... | 1.742188 | 2 |
python/caty/core/command/usage.py | hidaruma/caty | 0 | 12792492 | #coding: utf-8
class CommandUsage(object):
def __init__(self, profile_container):
self.pc = profile_container
def get_type_info(self):
r = []
for p in self.pc.profiles:
opts, args, input, output = self.profile_usage(p)
type_vars = ', '.join(map(lambda x:'<%s>' %... | 2.328125 | 2 |
mbq/client/tests/test_storage.py | managedbyq/mbq.client | 1 | 12792493 | import os
from tempfile import NamedTemporaryFile
from unittest import TestCase
from mbq.client.storage import FileStorage
class FileStorageTestCase(TestCase):
def setUp(self):
self.test_filename = NamedTemporaryFile(delete=False).name
self.storage = FileStorage(self.test_filename)
def tear... | 2.890625 | 3 |
rpkiclientweb/web.py | job/rpki-client-web | 0 | 12792494 | <gh_stars>0
import asyncio
import dataclasses
import json
import logging
import os
import random
from dataclasses import dataclass
from typing import Dict, List, Optional
from aiohttp import web
from prometheus_async import aio
from rpkiclientweb.rpki_client import ExecutionResult, RpkiClient
from rpkiclientweb.util ... | 2.140625 | 2 |
trivago2015/users/migrations/0002_userprofile.py | ephes/trivago2015 | 0 | 12792495 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
n... | 1.84375 | 2 |
converge.py | adamorse/soccer-stats | 1 | 12792496 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 7 08:38:14 2018
@author: <NAME>
compute how quickly soccer league tables converge to the final distribution
"""
import pandas as pd
import numpy as np
import glob
import matplotlib.pyplot as plt
from matplotlib import animation
from scipy.stats import ent... | 2.84375 | 3 |
main.py | Abhishek-P/py-hello-world-run-from-colab | 0 | 12792497 | print("Hello World! from Colab") | 1.117188 | 1 |
core/serializers/address.py | decosterkevin/foodtrack-back | 0 | 12792498 | <gh_stars>0
from rest_framework import serializers
from core.models import Exploitation, Address
from drf_extra_fields.geo_fields import PointField
class AddressSerializer(serializers.ModelSerializer):
# lat = PointSerializer(source='point.y', read_only=True)
lat = PointField(source='point.y', read_only=True)... | 2.3125 | 2 |
soluciones/operaciones/operaciones.py | carlosviveros/Soluciones | 4 | 12792499 | """AyudaEnPython: https://www.facebook.com/groups/ayudapython
"""
# del repositorio del grupo AyudaEnPython:
# https://github.com/AyudaEnPython/Soluciones/blob/main/soluciones/calculadora/operadores.py
def suma(a: float, b: float) -> float:
"""Suma dos números.
:param a: Primer número.
:a type: float
... | 3.84375 | 4 |
io_scene_vrm/external/cats_blender_plugin_support.py | iCyP/VRM_IMPORTER_for_Blender2.8 | 26 | 12792500 | <reponame>iCyP/VRM_IMPORTER_for_Blender2.8
import traceback
from typing import Dict
import bpy
from ..common.human_bone import HumanBoneName
from .cats_blender_plugin.tools.armature import FixArmature
from .cats_blender_plugin_armature import CatsArmature
__cats_bone_name_to_human_bone_name = {
# Order by priori... | 1.710938 | 2 |
main.py | maajtga/python-pong | 0 | 12792501 | <gh_stars>0
import pygame
from data import paddle
from data import ball
pygame.init()
winsize = [900, 550]
win = pygame.display.set_mode(winsize)
pygame.display.set_caption('Pong')
icon = pygame.image.load('gfx/icon.png')
pygame.display.set_icon(icon)
running = True
Player1 = paddle.Paddle(70, 225)
Player2 = padd... | 2.9375 | 3 |
py/scrap_heroes/test/test_utils.py | BenjaminCbr/cinoisp-storm | 0 | 12792502 | <filename>py/scrap_heroes/test/test_utils.py<gh_stars>0
from __future__ import unicode_literals
from django.test import TestCase
from ..utils import partial_dict_equals
class DictUtilsTest(TestCase):
def test_partial_dict_equals__regular_case(self):
small_dict = {
"a": 1,
"b": [... | 2.625 | 3 |
tests/test_klass.py | surroundaustralia/ndesgateway-testclient | 1 | 12792503 | <filename>tests/test_klass.py
from rdflib.namespace import RDF, OWL
from client.model import Klass
def test_basic_rdf():
r1 = Klass()
rdf = r1.to_graph()
assert (None, RDF.type, OWL.Class) in rdf
| 2.3125 | 2 |
flake8_pytest_style/visitors/fail.py | kianmeng/flake8-pytest-style | 125 | 12792504 | <reponame>kianmeng/flake8-pytest-style<gh_stars>100-1000
import ast
from flake8_plugin_utils import Visitor
from flake8_pytest_style.config import Config
from flake8_pytest_style.errors import AssertAlwaysFalse, FailWithoutMessage
from flake8_pytest_style.utils import (
get_simple_call_args,
is_empty_string,
... | 2.21875 | 2 |
chat_app/management/commands/load_dummy_data.py | PS-Division-BITS/Chat | 1 | 12792505 | <reponame>PS-Division-BITS/Chat
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
from chat_app.models import *
class Command(BaseCommand):
def _create(self):
# creating user and super-user
User.object... | 2.390625 | 2 |
tests/test_update_order.py | AltaPay/python-client-library | 0 | 12792506 | <reponame>AltaPay/python-client-library
from __future__ import absolute_import, unicode_literals
import responses
from altapay import API, UpdateOrder
from .test_cases import TestCase
class UpdateOrderTest(TestCase):
def setUp(self):
self.api = API(mode='test', auto_login=False)
@responses.activa... | 2.296875 | 2 |
src/titanic/scripts/cross_validate_models.py | alvaromendoza/pytanic | 1 | 12792507 | <filename>src/titanic/scripts/cross_validate_models.py
"""Cross-validate machine learning models."""
import os
import time
import pprint
import random as rn
import numpy as np
from sklearn.model_selection import KFold
from sklearn.pipeline import make_pipeline
from sklearn.model_selection import RandomizedS... | 2.375 | 2 |
server/contests/auth/test_core.py | jauhararifin/ugrade | 15 | 12792508 | <gh_stars>10-100
import pytest
import jwt
import bcrypt
from mixer.backend.django import mixer
from django.test import TestCase
from django.core.exceptions import ValidationError
from ugrade import settings
from contests.models import User
from contests.exceptions import NoSuchUserError, \
NoSuchContestError, \
... | 2 | 2 |
RecoHI/HiEgammaAlgos/python/HiIsolationCommonParameters_cff.py | ckamtsikis/cmssw | 852 | 12792509 | import FWCore.ParameterSet.Config as cms
isolationInputParameters = cms.PSet(
barrelBasicCluster = cms.InputTag("islandBasicClusters","islandBarrelBasicClusters"),
endcapBasicCluster = cms.InputTag("islandBasicClusters","islandEndcapBasicClusters"),
horeco = cms.InputTag("horeco"),
hfreco = cms.InputTag("h... | 1.132813 | 1 |
test/tcp/client.py | phpyii/workerman-test | 0 | 12792510 | <reponame>phpyii/workerman-test
#! /usr/bin/env python
#coding=utf-8
import socket
# 创建socket对象
# 参数一 指定用ipv4版本,参数2 指定用udp协议
serverSocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
HOST='127.0.0.1'
PORT=17000 #从指定的端口,从任何发送者,接收UDP数据
BUFSIZ=1024
ADDR=(HOST, PORT)
serverSocket.connect(ADDR)
while True:
#提示... | 2.703125 | 3 |
src/eventsHandler/on_message/on_message.py | gastbob40/discord-request-support-bot | 2 | 12792511 | import discord
from src.eventsHandler.on_message.commands.activate import disable, enable
from src.eventsHandler.on_message.commands.cancel import cancel_request
from src.eventsHandler.on_message.commands.end_request import end_request
from src.eventsHandler.on_message.commands.place import get_place
from src.eventsHa... | 2.4375 | 2 |
app/utils/mail.py | YogeshUpdhyay/Stocklytic.io | 1 | 12792512 | <gh_stars>1-10
from .. import mail
from flask_mail import Message
from flask import url_for
def send_reset_email(user):
token = user.generate_reset_token()
msg = Message('Password Reset Request',
sender="<EMAIL>",
recipients=[user.email])
msg.body = f'''To reset your... | 2.4375 | 2 |
0x10-python-network_0/6-peak.py | BennettDixon/holbertonschool-higher_level_programming | 1 | 12792513 | <filename>0x10-python-network_0/6-peak.py
#!/usr/bin/python3
"""script for finding peak in list of ints, interview prep
"""
"""
THOUGHT PROCESS
it is not sorted, so sorting would take n(log(n))
-> not worth sorting
looping through and keeping track of max (brute force)
-> O(... | 3.203125 | 3 |
imix/models/vqa_models/visdial_principles.py | linxi1158/iMIX | 23 | 12792514 | import torch.nn as nn
from ..builder import VQA_MODELS, build_backbone, build_encoder, build_head
@VQA_MODELS.register_module()
class VISDIALPRINCIPLES(nn.Module):
def __init__(self, vocabulary_len, word_embedding_size, encoder, backbone, head):
super().__init__()
self.embedding_model = nn.Embe... | 2.09375 | 2 |
run_ppxf.py | cebarbosa/muse-maps | 0 | 12792515 | # -*- coding: utf-8 -*-
"""
Forked in Hydra IMF from Hydra/MUSE on Feb 19, 2018
@author: <NAME>
Run pPXF in data
"""
import os
import yaml
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy import constants
from astropy.table import Table, vstack, hstack
fro... | 2.140625 | 2 |
run-filter.py | NaN-xyz/Glyph-Filters | 69 | 12792516 | import glyphsLib
import importlib
import argparse
import sys
from glob import glob
parser = argparse.ArgumentParser(description='Filter a font file')
parser.add_argument('input', metavar='GLYPHS',
help='the Glyphs file')
parser.add_argument('filter',metavar='FILTER',
help='the f... | 2.59375 | 3 |
twiiterbot.py | mahabharathi/twitterbot | 0 | 12792517 | import tweepy
import time
import sys
auth = tweepy.OAuthHandler('FzQNofWMcCfK1ghaqpwM3sCJu', '<KEY>')
auth.set_access_token('<KEY>', '<KEY>')
api = tweepy.API(auth)
'''user=api.me()
print(user.name,user.screen_name,user.followers_count)
public_tweets = api.home_timeline()
for tweet in public_tweets:
print(tweet.t... | 3.03125 | 3 |
Python Script Tools/42.0 Weather Status of a Geographical Location.py | juan1305/0.11-incremento_descremento | 1 | 12792518 | <reponame>juan1305/0.11-incremento_descremento
import openweather
from datetime import datetime
ow = openweather.openweather()
# Obtener las estaciones metereologicas cercanas
stations = ow.find_stations_near(
7.0, # Longitud
50.0, # Altitud
100 # Radio en Km
)
# Estado del tiempo usando el ID de la estacion
pri... | 3.046875 | 3 |
1-code/editorialAssessment.py | gcabanac/editorial-assessment | 0 | 12792519 | <filename>1-code/editorialAssessment.py
# Harvest Crossref for editorial assessment dates for ISSN 1866-7538: Arabian Journal of Geosciences (https://www.springer.com/journal/12517)
# See also https://retractionwatch.com/2021/08/26/guest-editor-says-journal-will-retract-dozens-of-inappropriate-papers-after-his-email-wa... | 1.929688 | 2 |
get_cmap.py | mathDR/BP-AR-HMM | 11 | 12792520 | <gh_stars>10-100
import matplotlib.pyplot as plt
import matplotlib.cm as cmx
import matplotlib.colors as colors
def my_color_map(N):
from numpy import mod
colormap = ['r','g','b','k','c','m','y']
return colormap[mod(N,7)]
def get_cmap(N):
'''Returns a function that maps each index in 0, 1, ... N-1 to ... | 3.046875 | 3 |
test/routes/test_collections.py | tiredpixel/pikka-bird-server-py | 1 | 12792521 | import datetime
from flask import json
import msgpack
import pikka_bird_server
from pikka_bird_server.models.collection import Collection
from pikka_bird_server.models.machine import Machine
from pikka_bird_server.models.report import Report
from pikka_bird_server.models.service import Service
class TestCollections:... | 2.171875 | 2 |
baseline_app.py | hatdropper1977/flask-recaptcha | 4 | 12792522 | #!/usr/bin/env python
from flask import Flask, render_template, request
from flask_bootstrap import Bootstrap
from models import QuizForm
class Config(object):
SECRET_KEY = '<KEY>'
application = Flask(__name__)
application.config.from_object(Config)
Bootstrap(application)
@application.route('/', methods=['GET',... | 2.703125 | 3 |
polymorphism_and_magic_methods/exercise/wild_animals_04/test.py | BoyanPeychinov/object_oriented_programming | 0 | 12792523 | <filename>polymorphism_and_magic_methods/exercise/wild_animals_04/test.py<gh_stars>0
from wild_animals_04.animals.birds import Hen
from wild_animals_04.food import Meat, Vegetable, Fruit
# owl = Owl("Pip", 10, 10)
# print(owl)
# meat = Meat(4)
# print(owl.make_sound())
# owl.feed(meat)
# veg = Vegetable(1)
# print(owl... | 2.859375 | 3 |
utils/text_processing_utils.py | angelinaku/wsd_pipeline | 0 | 12792524 | <reponame>angelinaku/wsd_pipeline<gh_stars>0
from typing import List, Optional, Dict, Tuple
import numpy as np
import torch
from gensim.models import Word2Vec
from simple_elmo import ElmoModel
from torch import nn
def pad_sequences(
sequences: List,
maxlen: Optional[int],
dtype: str = 'int32',
paddi... | 3.03125 | 3 |
hackathon/urls.py | AlexiaDelorme/ci-hackathon-app | 0 | 12792525 | from django.urls import path
from .views import (
HackathonListView, create_hackathon, update_hackathon, delete_hackathon, judging
)
urlpatterns = [
path('', HackathonListView.as_view(), name="hackathon-list"),
path("<int:hack_id>/team/<int:team_id>/judging/", judging, name="judging"),
path("create_hac... | 1.84375 | 2 |
rex/data/dataset.py | Spico197/REx | 4 | 12792526 | <reponame>Spico197/REx
from typing import Iterable, Optional
from torch.utils.data import Dataset
class CachedDataset(Dataset):
def __init__(self, data: Iterable) -> None:
super().__init__()
self.data = data
def __getitem__(self, index: int):
return self.data[index]
def __len__(... | 2.5 | 2 |
Basic Programs/Day12.py | kv-95/pyStreak | 1 | 12792527 | # Python Program for n\’th multiple of a number in Fibonacci Series
def findMultiple(n,k):
a = 0
b = 1
count = 1
while(True):
c = a+b
if c % k==0:
if count == n:
return(c)
count += 1
a,b = b,c
if __name__ == "__main__":
k = int(input(... | 4.21875 | 4 |
biosys/apps/main/tests/api/test_auth.py | florianm/biosys | 1 | 12792528 | from django.conf import settings
from django.urls import reverse
from django.test import override_settings
from rest_framework import status
from rest_framework.test import APIClient
from freezegun import freeze_time
from main.tests.api import helpers
class TestAuth(helpers.BaseUserTestCase):
@override_settings... | 2.390625 | 2 |
cride/registros/migrations/0001_initial.py | albertoaldanar/serecsinAPI | 0 | 12792529 | <reponame>albertoaldanar/serecsinAPI
# Generated by Django 2.0.9 on 2019-07-28 03:39
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Egreso',
... | 1.890625 | 2 |
app/core/migrations/0003_auto_20210420_0656.py | sawamotokai/Project-Backend-Energy | 0 | 12792530 | <filename>app/core/migrations/0003_auto_20210420_0656.py
# Generated by Django 2.1.15 on 2021-04-20 06:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20210420_0653'),
]
operations = [
migrations.RemoveField(
... | 1.601563 | 2 |
grammar_induction/earley_parser/earley_parser.py | tdonca/OpenBottle | 0 | 12792531 | <reponame>tdonca/OpenBottle<filename>grammar_induction/earley_parser/earley_parser.py
import nltk
def read_induced_grammar(path):
with open(path) as f:
rules = [rule.strip() for rule in f.readlines()]
grammar = nltk.PCFG.fromstring(rules)
return grammar
def predict_next_symbols(grammar, ... | 2.28125 | 2 |
kerosene/datasets/cifar100.py | dribnet/kerosene | 35 | 12792532 | <reponame>dribnet/kerosene
# -*- coding: utf-8 -*-
import fuel.datasets
from .dataset import Dataset
class CIFAR100(Dataset):
basename = "cifar100"
default_sources=['features', 'coarse_labels']
class_for_filename_patch = fuel.datasets.CIFAR100
def build_data(self, sets, sources):
return map(la... | 2.3125 | 2 |
gorden_crawler/spiders/shopbop_eastdane_common.py | Enmming/gorden_cralwer | 2 | 12792533 | # -*- coding: utf-8 -*-
from gorden_crawler.spiders.shiji_base import BaseSpider
from scrapy.selector import Selector
from gorden_crawler.items import BaseItem, ImageItem, Color, SkuItem
from scrapy import Request
from gorden_crawler.utils.item_field_handler import handle_price
import re
import execjs
class ShopbopEast... | 2.28125 | 2 |
Program's_Contributed_By_Contributors/Python_Programs/regex_date_validator.py | a-ayush19/Hacktoberfest2k21 | 0 | 12792534 | import re # import regex module
# check if date is valid (yyyy-mm-dd)
def date_validation(self, date):
if re.fullmatch(r"/^\d{4}-\d{2}-\d{2}$/", date):
return True
else:
return False
date_validation("2022-02-29") # False/True
| 3.375 | 3 |
cfripper/main.py | ocrawford555/cfripper | 0 | 12792535 | <gh_stars>0
"""
Copyright 2018 Skyscanner Ltd
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, ... | 1.882813 | 2 |
examples/quicksort.py | RaphaelArkadyMeyer/LiveCoding | 0 | 12792536 | <reponame>RaphaelArkadyMeyer/LiveCoding<gh_stars>0
from sys import stdin
@@ begin hide
def main():
print("start qs", stdin.readline()) # Ignore first line with number of inputs on it
array_in = stdin.readline()
print(array_in)
presort = list(map(int, array_in.split(' ')))
sort = quickSort(presort)... | 3.34375 | 3 |
otherdave/util/madlib.py | BooGluten/OtherDave | 0 | 12792537 | import inflect
import json
import random
import re
infl = inflect.engine()
class MadLibber():
def make(self):
template = self.actions["template"]()
tokens = template.split(" ")
result = ""
for token in tokens:
action = re.match("\{\{(.+?)\}\}", token)
if(ac... | 2.734375 | 3 |
gradient.py | sebdisdv/HdrProject | 0 | 12792538 | from math import exp
import cv2 as cv
import numpy as np
from concurrent.futures import ProcessPoolExecutor
from numba import jit
from numpy import float32
from tqdm import tqdm
from utils import (
get_region_indexes,
get_region_centers,
associate_index_to_centers,
get_window,
)
@jit
def P(v):
re... | 2.046875 | 2 |
model.py | imayank/project4 | 0 | 12792539 | <gh_stars>0
import pandas as pd
import numpy as np
import csv
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from sklearn.model_selection import train_test_split
from keras import regularizers
from keras.models import Sequential
from keras.layers import Dense, Flatten, Lambda, Cropping2D, Conv2D, MaxP... | 2.921875 | 3 |
badger_utils/sacred/natural_sort.py | GoodAI/distributed_es | 6 | 12792540 | import re
from typing import List, Union, Iterable
class NaturalSort:
@staticmethod
def atoi(text: str) -> int:
return int(text) if text.isdigit() else text
@staticmethod
def natural_keys(text: str) -> List[Union[str, int]]:
"""
alist.sort(key=natural_keys) sorts in human ord... | 3.5625 | 4 |
python_pb2/go/chromium/org/luci/buildbucket/proto/token_pb2.py | xswz8015/infra | 0 | 12792541 | <reponame>xswz8015/infra
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: go.chromium.org/luci/buildbucket/proto/token.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google... | 1.015625 | 1 |
concept_neuron/concept_neuron_accuracy.py | jacarvalho/concept_neurons | 0 | 12792542 | """
2018, University of Freiburg.
<NAME> <<EMAIL>>
"""
import os
import argparse
import pickle
import numpy as np
import re
from sklearn.metrics import accuracy_score, precision_score, recall_score
from concept_neuron import split_train_valid_test, process_sentence_pos_tags
from concept_neuron import print_pos_tag_stat... | 2.671875 | 3 |
weblogic/server/set_server_log.py | codejsha/infrastructure | 4 | 12792543 | <filename>weblogic/server/set_server_log.py
#!/usr/bin/env python
log_dir = os.environ['LOG_DIR']
admin_server_listen_address = os.environ['ADMIN_SERVER_LISTEN_ADDRESS']
admin_server_listen_port = os.environ['ADMIN_SERVER_LISTEN_PORT']
admin_username = os.environ['ADMIN_USERNAME']
admin_password = os.environ['<PASSWO... | 1.859375 | 2 |
hyperstream/tools/clock/2016-11-14_v0.1.0.py | vishalbelsare/HyperStream | 12 | 12792544 | # The MIT License (MIT) # Copyright (c) 2014-2017 University of Bristol
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | 2.296875 | 2 |
settings.py | Asadbek07/aiogram-django-template | 0 | 12792545 | <filename>settings.py
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# SECURITY WARNING: Modify this secret key if using in production!
SECRET_KEY = ""
DEFAULT_AUTO_FIELD='django.db.models.AutoField'
DATABASES = {
"default"... | 2.125 | 2 |
post_office/__init__.py | LeGast00n/django-post_office | 0 | 12792546 | VERSION = (1, 1, 1)
from .backends import EmailBackend
from .models import PRIORITY
from .utils import send_mail
| 1.09375 | 1 |
tool.py | LasTAD/VAST-2017-MC-1 | 1 | 12792547 | <gh_stars>1-10
import PySimpleGUI as sg
import numpy as np
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from SOM import SOM
layout = [[sg.Text('SOM для VAST 2017 MC1', font='Any 18')],
# [sg.Text('Path to data'), sg.FileBrowse('output.txt', key='-Path-data-')],
# [sg.Text('Path t... | 2.359375 | 2 |
Semester 1/Python/Q4.py | sufiyaanusmani/FAST-NUCES | 0 | 12792548 | from decimal import *
decimal = int(input("Enter a number: "))
binary = 0
i = 1
while decimal != 0:
digit = decimal % 2
binary = Decimal(binary + (i * digit))
i *= 10
decimal = decimal // 2
print(binary) | 4.09375 | 4 |
stochpy/pscmodels/GeneDuplication.py | bgoli/stochpy | 35 | 12792549 | model = """
# Reactions
R1:
G1 > G1 + mRNA1
Ksyn*G1
R2:
mRNA1 > $pool
Kdeg*mRNA1
R3:
G2 > G2 + mRNA2
Ksyn*G2
R4:
mRNA2 > $pool
Kdeg*mRNA2
# Fixed species
# Variable species
mRNA1 = 50.0
G1 = 1
mRNA2 = 50.0
G2 = 1
# Parameters
Ksyn = 10
Kdeg = 0.2
"""
| 1.242188 | 1 |
coco_scripts/eval_coco.py | yourfatherI/VSR-guided-CIC | 32 | 12792550 | <filename>coco_scripts/eval_coco.py
from speaksee.data import TextField
import os, sys
sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
from data import COCOControlSetField_Verb, COCODetSetField_Verb, ImageDetectionsField
from data.dataset import COCOEntities
from models import ControllableC... | 1.960938 | 2 |