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
bungee/const.py
wan/bungee
2
12774051
# General ES Constants COUNT = 'count' CREATE = 'create' DOCS = 'docs' FIELD = 'field' FIELDS = 'fields' HITS = 'hits' ID = '_id' INDEX = 'index' INDEX_NAME = 'index_name' ITEMS = 'items' KILOMETERS = 'km' MAPPING_DYNAMIC = 'dynamic' MAPPING_MULTI_FIELD = 'multi_field' MAPPING_NULL_VALUE = 'null_value' MILES = 'mi' OK ...
1.09375
1
lib/abook.py
ids1024/Utilities
0
12774052
import os from configparser import ConfigParser infile = os.path.expanduser("~/.abook/addressbook") class AddressBook(object): def __init__(self, contacts): self.contacts = contacts for i in self.contacts: i["email"] = list(filter(None, i.get("email", '').split(","))) def __getite...
3.25
3
src/schist/db.py
slyphon/zsh-history-backup
1
12774053
<gh_stars>1-10 from __future__ import print_function import logging import os.path import re import sqlite3 from collections import defaultdict from contextlib import contextmanager from textwrap import dedent from .common import _utf8 import arrow import attr import six from attr.validators import instance_of, op...
2.5625
3
third_party/llvm_toolchain/local_config_llvm.bzl
storypku/bazel-galaxy
0
12774054
load("//third_party:common.bzl", "err_out", "execute") _LLVM_BINARIES = [ "clang", "clang-cpp", "ld.lld", "llvm-ar", "llvm-as", "llvm-nm", "llvm-objcopy", "llvm-objdump", "llvm-profdata", "llvm-dwp", "llvm-ranlib", "llvm-readelf", "llvm-strip", "llvm-symbolizer",...
2.03125
2
dolfyn/meta/api_dumb.py
aidanbharath/dolfyn
28
12774055
<reponame>aidanbharath/dolfyn valid=False def marray(arr,*args,**kwargs): return arr def unitsDict(*args,**kwargs): return None def varMeta(*args,**kwargs): return None
1.90625
2
PDSim/misc/clipper/setup.py
sebdenis/pdsim
24
12774056
if __name__=='__main__': from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import sys sys.argv += ['build_ext','--inplace'] ext = Extension("pyclipper", sources=["pyclipper.pyx", "clipper.cpp"], ...
1.648438
2
src/std/coppertop/std/_stats/core.py
DangerMouseB/coppertop
0
12774057
# ******************************************************************************* # # Copyright (c) 2021 <NAME>. All rights reserved. # # ******************************************************************************* import math, numpy from coppertop.pipe import * from coppertop.std.linalg import tvarray @copp...
2.1875
2
Ambience/data/StressDetector.py
Matchstic/automated-ambience
1
12774058
<filename>Ambience/data/StressDetector.py import Queue import time # Constants ROLLING_AVERAGE_COUNT = 5 BPM_HIGH_DEVIATION = 40 HRV_HIGH_DEVIATION = 35 class StressDetector(): def __init__(self): self.previous_stress_levels = Queue.Queue() self.baseline_bpm = 72 # average bpm ...
2.984375
3
emodis_ndvi_python/pycodes/getndvitodate.py
gina-alaska/emodis-ndvi-python_container
1
12774059
import numpy as np from int_tabulated import * def GetNDVItoDate(NDVI, Time, Start_End, bpy, DaysPerBand, CurrentBand): #; #;jzhu,8/9/2011,This program calculates total ndvi integration (ndvi*day) from start of season to currentband, the currentband is the dayindex of interesting day. # FILL=-1....
2.859375
3
tests/unit/test_comments.py
severinbeauvais/business-schemas
0
12774060
# Copyright © 2019 Province of British Columbia # # 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 agr...
2.140625
2
src/content/models.py
b4isty/django-blog
0
12774061
<filename>src/content/models.py from django.db import models # Create your models here. from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import post_save class Blog(models.Model): author = models.ForeignKey(User) ...
2.484375
2
refinery/bnpy/bnpy-dev/bnpy/init/__init__.py
csa0001/Refinery
103
12774062
""" The :mod:`init` module gathers initialization procedures for model parameters """ import FromScratchGauss, FromScratchMult import FromScratchBernRel import FromSaved, FromTruth __all__ = ['FromScratchGauss', 'FromSaved', 'FromTruth', 'FromScratchMult', 'FromScratchBernRel']
1.617188
2
src/openstackapi/server_meta.py
jiangyt2112/NetworkMonitor
0
12774063
<gh_stars>0 { 'OS-EXT-STS:task_state': None, 'addresses': {'int-net': [ {'OS-EXT-IPS-MAC:mac_addr': 'fa:16:3e:5d:9e:22', 'version': 4, 'addr': '192.168.1.8', 'OS-EXT-IPS:type': 'fixed' }, {'OS-EXT-IPS-MAC:mac_addr': 'fa:16:3e:5d:9e:22', 'version': 4, 'addr': '192.168.166....
1.390625
1
chap09/list0903.py
ytianjin/GitTest
0
12774064
# 打印输出直角在左下角的等腰三角形和长方形 def put_star(n): """连续输出n个*""" for _ in range(n): print('*', end='') print('直角在左下角的等腰三角形') n = int(input('腰长:')) for i in range(1, n + 1): put_star(i) print() print('长方形') h = int(input('宽:')) w = int(input('长:')) for ...
3.984375
4
Day01/depthcount.py
squidbot/aoc2021
0
12774065
<gh_stars>0 with open('input.txt') as f: lines = f.readlines() count = 0 curDepth = 0 for line in lines: newDepth = int(line) if curDepth != 0: if newDepth > curDepth: count += 1 curDepth = newDepth print(count)
3.390625
3
kiritan.py
kaz/kiritan-server
6
12774066
<reponame>kaz/kiritan-server # coding: UTF-8 import os import sys import time import hashlib import logging import threading import subprocess from win32con import * from win32gui import * from win32process import * # 共通設定 waitSec = 0.1 windowName = "VOICEROID+ 東北きりたん EX" # WAV生成(排他) lock = threading.Lock() def tal...
2.203125
2
Janus/python-base-unit_09/FIM/dir_tree.py
voodoopeople42/Vproject
0
12774067
<gh_stars>0 # dir_tree.py import os for dirname, dirnames, filenames in os.walk('.'): # print path to all subdirectories first. for subdirname in dirnames: print(os.path.join(dirname, subdirname)) # print path to all filenames. for filename in filenames: print(os.path.join(dirname, fil...
3.125
3
tests/lib/crypto/test_bip32.py
weex/python-rein
1
12774068
<gh_stars>1-10 import unittest from rein.lib import bitcoinecdsa from rein.lib.crypto import bip32 class Bip32Test(unittest.TestCase): def test_bip32(self): mnemonic_list_initial = [u'correct',u'horse',u'battery',u'staple'] key = bip32.mnemonic_to_key(mnemonic_list_initial) wifkey_master...
2.40625
2
conanfile.py
vuo/conan-muparser
0
12774069
<filename>conanfile.py from conans import ConanFile, CMake, tools import os import platform class MuParserConan(ConanFile): name = 'muparser' source_version = '2.3.2' package_version = '0' version = '%s-%s' % (source_version, package_version) build_requires = ( 'llvm/5.0.2-1@vuo/stable', ...
2.21875
2
opps/polls/widgets.py
opps/opps-polls
1
12774070
<reponame>opps/opps-polls<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from itertools import chain from django.forms import CheckboxInput from django.utils.html import format_html, format_html_join from django.utils.safestring import mark_safe from django.utils.encoding import f...
2.40625
2
REST/python-refresher-master/17_default_parameter_values/code.py
Rebell-Leader/bg
0
12774071
<gh_stars>0 def add(x, y=3): print(x + y) add(5) # 8 add(5, 8) # 13 add(y=3) # Error, missing x # -- Order of default parameters -- # def add(x=5, y): # Not OK, default parameters must go after non-default # print(x + y) # -- Usually don't use variables as default value -- default_y = 3 def add(x, y...
3.703125
4
solutions/exercise3.py
FilippoAleotti/SIMUR
0
12774072
''' <NAME> <EMAIL> 29 November 2019 I PROFESSIONAL MASTER'S PROGRAM, II LEVEL "SIMUR", Imola 2019 Given a list of integer, store the frequency of each value in a dict, where the key is the value. ''' def are_equals(dict1, dict2): ''' check if two dict are equal. Both the dicts have str keys and integer ...
3.890625
4
test/test_add_contact.py
piersto/python_training_44
0
12774073
<gh_stars>0 # -*- coding: utf-8 -*- from model.contact import Contact def test_add_contact(app): app.contact.open_add_new_contact_page() list_of_contacts_old = app.contact.list_of_contacts() contact = Contact(firstname='Ivan', middlename='Petrovich', lastname=...
2.578125
3
wasatch/AndorDevice.py
adiravishankara/Wasatch.PY
0
12774074
import re import os import usb import time import json import queue import struct import logging import datetime from ctypes import * from typing import TypeVar, Any, Callable from .SpectrometerSettings import SpectrometerSettings from .SpectrometerState import SpectrometerState from .SpectrometerResp...
2.421875
2
koapy/utils/krx/calendar/AbstractHolidayCalendar.py
fossabot/koapy
0
12774075
<gh_stars>0 """ """ # pylint: disable=pointless-string-statement """ BSD 3-Clause License Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team All rights reserved. Copyright (c) 2011-2020, Open source contributors. Redistribution and use in source and binary forms,...
1.492188
1
src/mimic_preproc/extract-scripts/get_cohort_baseline_info.py
aminzadenoori/POPCORN-POMDP
6
12774076
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File to build out a cohort using the ADMISSIONS, ICUSTAYS, and PATIENTS tables in raw mimic data. @author: josephfutoma """ import numpy as np import pandas as pd import os from datetime import datetime import pickle from time import time PATH_TO_RE...
2.703125
3
train.py
rodrigoduranna/frogsounds
0
12774077
<filename>train.py import librosa import numpy as np import time import glob import os import matplotlib.pyplot as plt comeco = time.time() print("Extraindo caracteristicas ...") #extrai as caracteristicas de um arquivo de som def extract_feature(file_name): X, sample_rate = librosa.load(file_name) #extrai o n...
2.65625
3
amy/workshops/migrations/0186_extend_Curriculum.py
code-review-doctor/amy
53
12774078
<filename>amy/workshops/migrations/0186_extend_Curriculum.py<gh_stars>10-100 # Generated by Django 2.1.7 on 2019-07-18 15:37 from django.db import migrations, models import django.db.models.deletion def extend_current_Curricula(apps, schema_editor): """Update existing Curricula with new fields.""" Curriculu...
2.0625
2
function/python/brightics/function/statistics/mann_whitney_test.py
parkjh80/studio
1
12774079
""" Copyright 2019 Samsung SDS 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 ...
1.898438
2
pages/home_page.py
aelnahas/automation-quandl
0
12774080
from common.page_object import PageObject, PageNotLoaded from pages.footer import Footer from pages.locators import HomePageLocators from pages.signin_page import SigninPage from pages.top_bar import TopBarNav class HomePage(PageObject): """ Quandl's page object """ def is_loaded(self): """A Top Bar ...
2.875
3
python/htcrack/htcrack.py
Ethic41/codes
2
12774081
<reponame>Ethic41/codes import argparse import os from bs4 import BeautifulSoup as bs import requests def main(): parser = argparse.ArgumentParser() parser.add_argument("-u", "--usernames", help="specify a file containing list of usernames", required=True, type=file) parser.add_argument("-p", "--pa...
3.328125
3
cddm/_core_nb.py
IJSComplexMatter/cddm
4
12774082
<reponame>IJSComplexMatter/cddm """ Low level numba functions """ from __future__ import absolute_import, print_function, division import numpy as np import numba as nb from cddm.conf import C,F, I64, NUMBA_TARGET, NUMBA_FASTMATH, NUMBA_CACHE from cddm.fft import _fft, _ifft from cddm.decorators import doc_inherit ...
2.609375
3
Codes/Python32/Lib/test/test_timeout.py
eyantra/FireBird_Swiss_Knife
319
12774083
"""Unit tests for socket timeout feature.""" import unittest from test import support # This requires the 'network' resource as given on the regrtest command line. skip_expected = not support.is_resource_enabled('network') import time import errno import socket class CreationTestCase(unittest.TestCase): """Tes...
2.8125
3
objective_turk/create_hit.py
nmalkin/objective-turk
0
12774084
import logging from objective_turk import objective_turk logger = logging.getLogger(__name__) EXTERNAL_URL_QUESTION = """<?xml version="1.0"?> <ExternalQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2006-07-14/ExternalQuestion.xsd"> <ExternalURL>{}</ExternalURL> <FrameHeigh...
2.953125
3
public/route/panel/redirect.py
astask/request
0
12774085
from src.templating import Request, url_path, redirect, form, render_template lang = { "ru": { "title": "Редирект", "route": { "panel": "Панель управления", "redirect": "Редирект", }, "redirect_index": "Редирект на главную", }, } async def response(requ...
2.375
2
cx_Freeze/samples/advanced/advanced_1.py
lexa/cx_Freeze
358
12774086
<filename>cx_Freeze/samples/advanced/advanced_1.py #!/usr/bin/env python print("Hello from cx_Freeze Advanced #1\n") module = __import__("testfreeze_1")
1.445313
1
cea/plots/colors.py
architecture-building-systems/cea-toolbox
121
12774087
""" This is the official list of CEA colors to use in plots """ import os import pandas as pd import yaml import warnings import functools from typing import List, Callable __author__ = "<NAME>" __copyright__ = "Copyright 2020, Architecture and Building Systems - ETH Zurich" __credits__ = ["<NAME>"] __license__ =...
2.265625
2
gec_debug.py
Mathstao/gector
0
12774088
<gh_stars>0 import sys import requests host = "http://11.0.0.150:8890/correct" def call_gec(data): resp = requests.post(host, json=data) res = resp.json() return res if __name__ == '__main__': if len(sys.argv)==2: text = sys.argv[-1] else: text = "Hi, Guibin! My namme is Citao. Th...
2.78125
3
ioflo/aid/aggregating.py
BradyHammond/ioflo
128
12774089
import math import statistics def fuzzyAnd(m): """ fuzzy anding m = list of membership values to be anded returns smallest value in the list """ return min(m) FuzzyAnd = fuzzyAnd def fuzzyOr(m): """ fuzzy oring m = list of membership values to be ored returns largest value...
3.46875
3
test/conftest.py
xphlawlessx/ceknito
47
12774090
import bcrypt from functools import lru_cache, wraps import os import pytest from pyrsistent import freeze, thaw import yaml from app import create_app from app.config import Config from app.models import db, BaseModel, User, SiteMetadata from app.caching import cache from app.auth import auth_provider from test.util...
2.4375
2
models/session.py
SsureyMoon/Python-GoogleAppEngine
0
12774091
from google.appengine.ext import ndb from protorpc import messages class Session(ndb.Model): """Session -- Session object""" organizerUserId = ndb.StringProperty() name = ndb.StringProperty(required=True) highlights = ndb.StringProperty(repeated=True) speaker = ndb.StringProperty() duration = ...
2.265625
2
src/boc_python_demo_test.py
bocgi-demo/python
0
12774092
from boc_python_demo import my_sum def test_my_sum(): assert my_sum(1) == 1 assert my_sum(2) == 2 assert my_sum(3) == 3 assert my_sum(4) == 5 assert my_sum(5) == 8 assert my_sum(6) == 13
2.6875
3
capsule/gamma_capsule_layer.py
moejoe95/capsnet-limitations
9
12774093
import tensorflow as tf from capsule.utils import squash import numpy as np layers = tf.keras.layers models = tf.keras.models class GammaCapsule(tf.keras.Model): def __init__(self, in_capsules, in_dim, out_capsules, out_dim, stdev=0.2, routing_iterations=2, use_bias=True, name=''): super(GammaCapsule,...
2.390625
2
Heike/iTunes.py
ArtezGDA/text-IO
0
12774094
<reponame>ArtezGDA/text-IO iTunes = { 'artists' : { 'The Neighbourhood': #album name 'Wiped Out!': { #title of song : duration 'Prey' : 3.22, 'Cry Baby' : 4.02, 'A Moment of Silence' : 2.05 }, '<NAME>': 'To Pimp a Butterfly': { 'King Kunta': 3.54, '...
2.046875
2
dsemproducaoenv/Lib/site-packages/jupyter_server/_version.py
felipetmota/DsEmProducao
0
12774095
""" store the current version info of the server. """ from jupyter_packaging import get_version_info # Version string must appear intact for tbump versioning __version__ = '1.6.2' version_info = get_version_info(__version__)
1.40625
1
src/test/provision/app/alarm/trigger/test_metrics.py
mycloudandme/spacel-provision
2
12774096
<filename>src/test/provision/app/alarm/trigger/test_metrics.py import unittest from spacel.provision.app.alarm.trigger.metrics import MetricDefinitions class TestMetricDefinitions(unittest.TestCase): def setUp(self): self.metrics = MetricDefinitions() def test_get(self): cpu_metric = self.me...
2.171875
2
weapon.py
ebroniarczyk/ufo_worms
0
12774097
import pygame, math, time from enum import Enum class WeaponType(Enum): MELEE = 1 LOADABLE = 2 DOUBLE_SHOT = 3 # bazuka, granat, paluch, strzelba class Weapon(object): def __init__(self, team, battle, game): self.team = team self.owner = team.get_selected_worm() self.for...
3.046875
3
database/admin.py
gbriones1/django-skelleton
0
12774098
<reponame>gbriones1/django-skelleton<filename>database/admin.py from django.contrib import admin from database.models import Product, Input class ProductAdmin(admin.ModelAdmin): pass class InputAdmin(admin.ModelAdmin): pass admin.site.register(Product, ProductAdmin) admin.site.register(Input, InputAdmin)
1.742188
2
lib/config.py
captainshar/pi-setup
0
12774099
<reponame>captainshar/pi-setup import os import time import copy import glob import socket import hashlib import traceback import yaml import pykube import urlparse import requests import netifaces import avahi import dbus import encodings.idna WPA = """ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev updat...
2
2
Codewars/Even or Odd.py
BerkanR/Programacion
0
12774100
<reponame>BerkanR/Programacion # Create a function that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers. def even_or_odd(number): if number % 2 == 0: return "Even" else: return "Odd" assert (even_or_odd(2)) == "Even", "Debe devolver Even" assert (e...
4.40625
4
async_fetcher/utils.py
night-crawler/async-fetcher
3
12774101
import asyncio import ssl import aiohttp # if sys.version_info >= (3, 5): # EventLoopType = t.Union[asyncio.BaseEventLoop, asyncio.AbstractEventLoop] # else: # EventLoopType = asyncio.AbstractEventLoop def get_or_create_event_loop() -> asyncio.AbstractEventLoop: try: loop = asyncio.get_event_loo...
2.078125
2
scheduler/run_round_robin.py
widgetOne/league_admin
0
12774102
''' This is the central location for driving the other modules. It should primarily contain seasons and SCVL specific location. ''' import facility from optimizer import make_schedule, save_schedules from optimizer import make_round_robin_game, get_default_potential_sch_loc import datetime from facility import SCVL_Fac...
2.453125
2
packages/api-server/api_server/models/tortoise_models/dispenser_state.py
Sald-for-Communication-and-IT/rmf-web
23
12774103
from tortoise.models import Model from .json_mixin import JsonMixin class DispenserState(Model, JsonMixin): pass
1.34375
1
owners_client.py
azureplus/chrome_depot_tools
0
12774104
<filename>owners_client.py<gh_stars>0 # Copyright (c) 2020 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. import itertools import os import random import gerrit_util import owners as owners_db import scm APPROVED = 'AP...
2.484375
2
algorithms/verifying-an-alien-dictionary.py
Chronoviser/leetcode-1
41
12774105
class Solution: def isAlienSorted(self, words, order): """ :type words: List[str] :type order: str :rtype: bool """ order = {alpha: index for index, alpha in enumerate(order)} for i in range(len(words) - 1): flag = True for j in range(m...
3.125
3
segmentation/datasets.py
dataflowr/evaluating_bdl
110
12774106
# code-checked # server-checked import cv2 import numpy as np import os import os.path as osp import random import torch from torch.utils import data import pickle def generate_scale_label(image, label): f_scale = 0.5 + random.randint(0, 16)/10.0 image = cv2.resize(image, None, fx=f_scale, fy=f_scale, interp...
2.421875
2
submissions/Ottenlips/puzzles.py
WhittKinley/Legos
0
12774107
import search from math import(cos, pi) stl_map = search.UndirectedGraph(dict( Kirkwood=dict(Webster=10, Clayton=17, MapleWood=17, Oakland=5, Glendale=7,), St_Louis=dict(Clayton=12), Glendale=dict(St_Louis=19), Oakland=dict(Glendale=4), MapleWood=dict(St_Louis=11), Clayton=dict(Webster=14, St_L...
3.09375
3
trelloengine/structures/card.py
MrFizban/TrelloEngine
0
12774108
<filename>trelloengine/structures/card.py #!/usr/bin/env python3 from .base import Base class Card(Base): def __init__(self, app_key: str, token: str, id=None, use_log = False): super(Card, self).__init__(app_key=app_key, token=token, id=id, use_log = use_log) self.base_url = self.base_url + "/ca...
2.25
2
restaurantapp/mainapp/migrations/0009_auto_20200604_0847.py
ShubhamJain0/ShubhamJain0.github.io
0
12774109
<gh_stars>0 # Generated by Django 2.2.2 on 2020-06-04 08:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mainapp', '0008_auto_20200604_0749'), ] operations = [ migrations.AlterField( model_name='image', name='...
1.367188
1
order/controller.py
Courier-Seba/Biela
0
12774110
class Producto: """Producto de venta""" def __init__(self, nombre, desc, precio): self.nombre = nombre self.descripcion = desc self.precio = precio # Es una salida para la muestra de la info def formateo_textual(self): textoFinal = "" for atr in [self.nombre...
3.6875
4
mysign_app/urls.py
mindhashnl/roomsignage
0
12774111
<reponame>mindhashnl/roomsignage from django.contrib.auth import views from django.urls import include, path from django.views.generic import RedirectView, TemplateView from mysign_app.routes import login from .routes import admin, company, screen_index urlpatterns = [ path('', TemplateView.as_view(template_name...
2
2
b3datepicker/conf.py
RDXT/django-bootstrap3-datepicker
0
12774112
<reponame>RDXT/django-bootstrap3-datepicker # -*- coding: utf-8 -*- from django.apps import AppConfig from django.conf import settings as base_settings class B3datepickerConfig(AppConfig): name = 'b3datepicker' class Settings(object): BOOTSTRAP_DATEPICKER_VERSION = '1.6.4' B3DATEPICKER_JS = '//cdnjs.cl...
1.851563
2
extensions/matrix/views.py
nirgal/ngw
0
12774113
<reponame>nirgal/ngw import pprint from datetime import datetime, timedelta from django import forms from django.conf import settings from django.utils.translation import ugettext as _ from django.views.generic import FormView, TemplateView from ngw.core.models import Contact, ContactGroup, MatrixRoom from ngw.core.v...
1.90625
2
BOJ/18000~18999/18800~18899/18870.py
shinkeonkim/today-ps
2
12774114
<reponame>shinkeonkim/today-ps n = int(input()) L = list(map(int,input().split())) A = list(set(L[:])) d = {} A.sort() for i in range(len(A)): d[A[i]] = i for i in L: print(d[i],end = " ")
3.125
3
hpc_acm_cli/parser_builder.py
coin8086/hpc_acm_cli
2
12774115
import argparse class ParserBuilder: @classmethod def build(cls, spec): parser = argparse.ArgumentParser(**spec.get('options', {})) params = spec.get('params', None) if params: cls.add_params(parser, params); subcommands = spec.get('subcommands', None) if sub...
2.796875
3
operations/fleet_management/migrations/0069_auto_20180730_1054.py
kaizer88/emps
0
12774116
<filename>operations/fleet_management/migrations/0069_auto_20180730_1054.py # -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-07-30 08:54 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies ...
1.664063
2
api_eto/api_eto.py
tonybutzer/eto-draft
0
12774117
import argparse from etoLib.log_logger import log_make_logger from etoLib.s3_func import s3_hello from etoLib.util_func import unique from etoLib.util_func import grepfxn def get_parser(): parser = argparse.ArgumentParser(description='Run the eto code') parser.add_argument('tile', metavar='TILE', type=str, ...
2.359375
2
lib/googlecloudsdk/command_lib/resource_manager/org_policies_base.py
bshaffer/google-cloud-sdk
0
12774118
<reponame>bshaffer/google-cloud-sdk<filename>lib/googlecloudsdk/command_lib/resource_manager/org_policies_base.py<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
1.960938
2
netroids/main.py
FarmCodeGary/Netroids
0
12774119
<reponame>FarmCodeGary/Netroids import socket def get_local_address(): local_address = socket.gethostbyname(socket.gethostname()) typed_address = raw_input( "Enter your external IP address (default: "+local_address+"): ").strip() if typed_address != "": local_address = typed_addres...
3.203125
3
mdtk/filesystem_utils.py
JamesOwers/corrupted_midi_dataset
29
12774120
"""Utility functions for file manipulation""" import logging import os import shutil import sys import urllib.error import urllib.request import zipfile def download_file(source, dest, verbose=False, overwrite=None): """Get a file from a url and save it locally""" if verbose: print(f"Downloading {sour...
3.65625
4
docs/api/contrib/boundaries.py
souravsingh/yellowbrick
1
12774121
<filename>docs/api/contrib/boundaries.py import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.datasets import make_moons, make_classification from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC from yellowbrick...
2.625
3
otcextensions/tests/unit/osclient/cce/v2/fakes.py
kucerakk/python-otcextensions
0
12774122
<gh_stars>0 # Copyright 2013 Nebula Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
1.804688
2
scripts/irac_model_single.py
grizli-project/grizli-aws
0
12774123
#!/usr/bin/env python import sys import os import time import json import golfir.model import golfir.utils import yaml def run(root, argv=[]): #ds9 = None defaults = {'ds9': None, 'patch_arcmin': 1.0, # Size of patch to fit 'patch_overlap': 0.2, # O...
2.09375
2
datasets/MixedBrainDataset.py
rist-ro/argo
4
12774124
<reponame>rist-ro/argo<filename>datasets/MixedBrainDataset.py """ Module for managing multiple brain datasets at once """ from datasets.BrainDataset import BrainDataset, modalities, NPROCS import numpy as np import os import fnmatch import tensorflow as tf import PIL import pdb class MixedBrainDataset(BrainDataset):...
2.203125
2
setup.py
jay3332/wumpus.py
4
12774125
import re from setuptools import setup with open('wumpus/__init__.py') as f: contents = f.read() try: version = re.search( r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', contents, re.M ).group(1) except AttributeError: raise RuntimeError('Could not identify version') from ...
1.921875
2
sheets/views.py
GaniAliguzhinov/ServerChecker
0
12774126
<filename>sheets/views.py<gh_stars>0 from django.shortcuts import render, redirect from .forms import UploadSheetForm import openpyxl from io import BytesIO from sheets.tasks import process def upload_file(request): """ View for uploading an excel file with urls. Once uploaded, the file will be processed ...
2.59375
3
mixin_templatetag/componentnodes.py
xblitz/django-template-mixins
0
12774127
<reponame>xblitz/django-template-mixins<filename>mixin_templatetag/componentnodes.py from collections import defaultdict from django.template import TemplateSyntaxError, Node, Template, Variable from django.template.loader_tags import ExtendsNode, IncludeNode from django.utils.safestring import mark_safe SLOT_CONTEXT...
2.0625
2
ISMLnextGen/retryTest.py
Ravenclaw-OIer/ISML_auto_voter
128
12774128
<reponame>Ravenclaw-OIer/ISML_auto_voter<filename>ISMLnextGen/retryTest.py #coding:utf-8 import logging,traceback from functools import wraps log = logging.getLogger(__name__) acceptStatus=(503,'其他接受的状态码') class RetryExhaustedError(Exception): pass #def __init__(self, funcname,args,kwargs): ...
2.1875
2
spydrnet/ir/tests/test_wire.py
yinshuisiyuanabc/spydrnet
0
12774129
import unittest import spydrnet as sdn from spydrnet.ir.first_class_element import FirstClassElement class TestWire(unittest.TestCase): def setUp(self): self.definition_top = sdn.Definition() self.port_top = self.definition_top.create_port() self.inner_pin = self.port_top.create_pin() ...
3.046875
3
hms_tz/hms_tz/page/patient_history/patient_history.py
av-dev2/hms_tz
5
12774130
# -*- coding: utf-8 -*- # Copyright (c) 2018, ESS LLP and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe.utils import cint from erpnext.healthcare.utils import render_docs_as_html @frappe.whitelist() def get_feed(name, docum...
2
2
xing/xacom.py
testkevinkim/xing-plus
88
12774131
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import math import pandas def parseErrorCode(code): """에러코드 메시지 :param code: 에러 코드 :type code: str :return: 에러코드 메시지를 반환 :: parseErrorCode("00310") # 모의투자 조회가 완료되었습니다 """ code = str(code) ht ...
2.78125
3
app.py
learnazcloud/Auto-branch-protect
0
12774132
import json # pylint: disable=import-error import os # pylint: disable=import-error import time # pylint: disable=import-error import requests # pylint: disable=import-error from flask import Flask, request # pylint: disable=import-error app = Flask(__name__) print("app",app) @app.route("/", methods=["POST"]) d...
2.203125
2
python/src/main/python/drivers/run-browser-android.py
KishkinJ10/graphicsfuzz
519
12774133
<reponame>KishkinJ10/graphicsfuzz<filename>python/src/main/python/drivers/run-browser-android.py #!/usr/bin/env python3 # Copyright 2018 The GraphicsFuzz Project 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 obta...
2.234375
2
src/rpcClient.py
p0lt/QMT
1
12774134
<reponame>p0lt/QMT #!/usr/bin/env python3 # -*- coding: utf-8 -*- from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from misc import getCallerName, getFunctionName, printException, printDbg, readRPCfile, now from constants import DEFAULT_PROTOCOL_VERSION, MINIMUM_FEE import threading from tabGov...
2
2
tests/components/test_button.py
trickeydan/j5-dev
10
12774135
<gh_stars>1-10 """Tests for the Button Classes.""" from time import sleep, time from j5.components.button import Button, ButtonInterface class MockButtonDriver(ButtonInterface): """A testing driver for the button component.""" def __init__(self) -> None: self.state = False def set_button_state(...
3.390625
3
jdf_tools/numbers.py
lluc/django_jdf
0
12774136
<filename>jdf_tools/numbers.py """ Jour de fete - Django_JDF Convertion de nombres en toutes lettres @date: 2014/09/12 @copyright: 2014 by <NAME> <<EMAIL>> @license: MIT """ class numbers : def __init__(self) : self.schu=["","UN ","DEUX ","TROIS ","QUATRE ","CINQ ","SIX ","SE...
2.859375
3
cert_mailer/helpers/sendgrid.py
stuartf/cert-mailer
5
12774137
<reponame>stuartf/cert-mailer<gh_stars>1-10 import sendgrid import os import urllib.request as urllib from sendgrid.helpers.mail import Content, Attachment, Mail, Email class Mailer: def __init__(self): key = os.environ.get('SENDGRID_API_KEY') self.sg = sendgrid.SendGridAPIClient(apikey=key) ...
2.71875
3
Source/module_mission_templates.py
qt911025/qt-homemade-mod-osp
1
12774138
from header_common import * from header_operations import * from header_mission_templates import * from header_animations import * from header_sounds import * from header_music import * from header_items import * from module_constants import * ##################################################################...
1.953125
2
owntwin/builtin_datasources/gsi_disaportal.py
owntwin/owntwin-cli
1
12774139
<reponame>owntwin/owntwin-cli from pathlib import Path from time import sleep import owntwin.builder.utils as utils import requests from loguru import logger from owntwin.builder.tile import TileData KK_KEIKAI_URL = ( "https://disaportaldata.gsi.go.jp/raster/05_kyukeishakeikaikuiki/{z}/{x}/{y}.png" ) KK_HOUKAI_UR...
2.296875
2
src/lib/Encryption.py
gamesguru/vault
147
12774140
import base64 import string from random import randint, choice from Crypto.Cipher import AES from Crypto.Hash import SHA256 from Crypto import Random as CryptoRandom class Encryption(): def __init__(self, key): self.key = key # Key in bytes self.salted_key = None # Placeholder for optional sal...
3.421875
3
setup.py
scottdraper8/maddress
2
12774141
import setuptools # Reads the content of your README.md into a variable to be used in the setup below with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name='maddress', # should match the package folder packages=['maddress'],...
1.601563
2
irspack/utils/__init__.py
Random1992/irspack
0
12774142
<reponame>Random1992/irspack import random from typing import Optional, Tuple import numpy as np import pandas as pd import scipy.sparse as sps from irspack.definitions import InteractionMatrix from irspack.utils._util_cpp import ( okapi_BM_25_weight, remove_diagonal, rowwise_train_test_split_by_fixed_n, ...
2.28125
2
desktop-creator.py
mocchapi/Desktop-Creator
0
12774143
<reponame>mocchapi/Desktop-Creator import configparser from ast import literal_eval print('-------------------------------------------------------------------------------') print('Desktop Creator v1.0 // made by <NAME> // MIT license') print('---------------------------------------------------------------------------...
2.578125
3
src/apps_script.py
Chimildic/goofy-hotkeys
0
12774144
from googleapiclient.discovery import build from os import getenv from auth import get_credentials class AppsScript(): def __init__(self, id: str): self._name = getenv("API_SERVICE_NAME") self._version = getenv("API_VERSION") self._id = id def run(self, function: str): body =...
2.375
2
tests/test_objectid.py
hiroaki-yamamoto/mongoengine-goodjson
64
12774145
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ObjectID test.""" import json from unittest import TestCase from bson import ObjectId from mongoengine.document import Document from mongoengine.errors import ValidationError from mongoengine.fields import StringField from mongoengine_goodjson.fields import ObjectIDF...
2.6875
3
race/linearizer/client.py
andreycizov/python-race
0
12774146
<reponame>andreycizov/python-race import socket from typing import Optional from dataclasses import dataclass from race.linearizer.proto import Packet, pack_str, unpack_str @dataclass class TCPClient: host: str port: int client_socket: Optional[socket.socket] = None recv_buffer_size: int = 4096 ...
2.859375
3
Network.py
TheCrks/Online-Td-2
0
12774147
<gh_stars>0 import socket import pickle class network: def __init__(self): self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.server = "p address" self.port = 5555 self.address = (self.server, self.port) self.player = self.connect() def ge...
2.921875
3
Greedy/763-partition_labels.py
hscspring/TheAlgorithms-Python
10
12774148
from collections import Counter def partition_labels(s: str) -> list: res = [] count = Counter(s) addr = {} for i,c in enumerate(s): if c in addr: addr[c].append(i) else: addr[c] = [i] lst = [] added = set() for c in s: if c in added: ...
3.203125
3
1281_subtract_product_sum.py
kannan5/LeetCode
0
12774149
<gh_stars>0 # Url https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/ class Solution: def subtractProductAndSum(self, n): prod, sum_n, curr = 1, 0, 0 while n != 0: curr = n % 10 prod = prod * curr sum_n = sum_n + curr ...
3.734375
4
backend/ql_library/users/tests/test_views.py
radekwlsk/ql-library
1
12774150
<gh_stars>1-10 from unittest.mock import patch from rest_framework import status from rest_framework.test import APIRequestFactory, force_authenticate from test_plus.test import TestCase from .. import serializers, views from .factories import UserFactory class BaseUserTestCase(TestCase): def setUp(self): ...
2.515625
3