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
services/engine/webs/api/models/result.py
huang-zp/crawloop
19
12778151
# -*- coding: utf-8 -*- """ 存储结果 """ from sqlalchemy import Column, BigInteger, String, TIMESTAMP, func, Integer, Text from sqlalchemy.dialects.postgresql import JSONB from webs.api.models import db class Result(db.Model): __tablename__ = 'results' id = Column(BigInteger, primary_key=True, autoincrement=T...
2.28125
2
apps/panel/migrations/0004_log.py
ivall/IVmonitor
190
12778152
# Generated by Django 3.0.7 on 2021-02-05 09:15 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('panel', '0003_auto_20210205_0955'), ] operations = [ migrations.CreateModel( ...
1.679688
2
ibis_substrait/proto/substrait/plan_pb2.py
gforsyth/ibis-substrait
14
12778153
<reponame>gforsyth/ibis-substrait """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import ...
1.179688
1
CodingInterview2/28_01_SymmetricalBinaryTree/symmetrical_binary_tree.py
hscspring/TheAlgorithms-Python
10
12778154
<reponame>hscspring/TheAlgorithms-Python """ 面试题 28:对称的二叉树 题目:请实现一个函数,用来判断一棵二叉树是不是对称的。如果一棵二叉树和 它的镜像一样,那么它是对称的。 """ class BinaryTreeNode: def __init__(self, val): self.val = val self.left = None self.right = None def connect_binarytree_nodes(parent: BinaryTreeNode, ...
3.875
4
setup.py
jneight/pydup
1
12778155
<reponame>jneight/pydup # coding=utf-8 from setuptools import setup, find_packages setup( name='pydup', version='0.11', install_requires=[], url='https://github.com/jneight/pydup', description='Simple implementation of LSH Algorithm', packages=find_packages(), i...
1.390625
1
app/core/tests/test_admin.py
avinashgundala/recipe-app-api
1
12778156
<gh_stars>1-10 from django.test import TestCase,Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTest(TestCase): """testing admin site interface""" def setup(self): """setting up superuser and user for admin page access""" self.client = Client...
2.640625
3
spatialpooch/_vector.py
achapkowski/spatial-pooch
1
12778157
import os import importlib import pooch from pooch import Unzip from ._spooch import SPATIALPOOCH as _GOODBOY ########################################################################### allowed_formats = { "pandas" : False, "numpy" : False, "string" : True, "sedf" : False } ##########################...
2.1875
2
leetcode/contest/week_143_1103.py
JamesCao2048/CodingQuestions
1
12778158
# Distribute candies to people # Easy class Solution(object): def distributeCandies(self, candies, num_people): """ :type candies: int :type num_people: int :rtype: List[int] """ if num_people <= 0 or candies < 0: raise Exception("Invalid input...
3.640625
4
tests/test_chatbot.py
jvm123/botstory
0
12778159
import sys import os import unittest from botstory.botclass import BotClass sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) class TestChatbot(unittest.TestCase): def test_chatbot(self): chatbot = BotClass() # Check whether the bot is able to respond to a simple p...
3.125
3
apero/recipes/spirou/cal_preprocess_spirou.py
njcuk9999/apero-drs
1
12778160
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # CODE DESCRIPTION HERE Created on 2019-03-05 16:38 @author: ncook Version 0.0.1 """ import numpy as np import os from apero import core from apero import lang from apero.core import constants from apero.science import preprocessing as pp from apero.io import drs_im...
1.867188
2
examen_2_sim02/p5/p5.py
Munoz-Rojas-Adriana/Computacion_para_Ingenieria
0
12778161
# -*- coding: utf-8 -*- """ Created on Thu Feb 17 00:39:13 2022 @author: ACER """ Clase Vehiculo : def __init__ ( self , color , marca ): uno mismo color = color uno mismo marca = marca def mostrarse ( self ): print ( f"la marca { self . marca } y color { self . color } " ) ...
3.15625
3
picking/algorithms/pso.py
mattianeroni/IndustryAlgorithms
1
12778162
from typing import Dict, List, Tuple, Union, Callable, Set, cast import random import math import time def _bra (lst : List[int], beta : float = 0.3) -> int: """ The estraction of an item from a list, by using a biased randomisation based on a quasi-geometric distribution (i.e. f(x) = (1-beta)^x)...
3.78125
4
simplepipreqs/simplepipreqs.py
Atharva-Gundawar/simplepipreqs
1
12778163
<filename>simplepipreqs/simplepipreqs.py #!/usr/bin/env python # -*- coding: utf-8 -*-import os from pathlib import Path import subprocess from yarg import json2package from yarg.exceptions import HTTPError import requests import argparse import os import sys import json import threading import itertools import time ...
2.390625
2
nicos_virt_mlz/treff/devices/detector.py
ebadkamil/nicos
12
12778164
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
1.898438
2
tests/zq_crawler/test_yahoo.py
feng-zhe/ZheQuant-brain-python
2
12778165
<gh_stars>1-10 ''' Unit Tests for yahoo.py ''' import unittest import json import random from datetime import datetime from datetime import timedelta import pytz from zq_crawler.yahoo import * # Unit test class class TestYahooCrawler(unittest.TestCase): ''' Test case for yahoo crawler ''' # test respo...
2.65625
3
squarelet_auth/mixins.py
MuckRock/squarelet-auth
0
12778166
# Django from django.contrib.auth import login # Third Party import requests # SquareletAuth from squarelet_auth.users.utils import squarelet_update_or_create from squarelet_auth.utils import squarelet_post class MiniregMixin: """A mixin to expose miniregister functionality to a view""" minireg_source = "D...
2.265625
2
yasha/constants.py
alextremblay/yasha
0
12778167
ENCODING = 'utf-8' EXTENSION_FILE_FORMATS = ('.py', '.yasha', '.j2ext', '.jinja-ext')
1.140625
1
opts.py
YBZh/Label-Propagation-with-Augmented-Anchors
18
12778168
import argparse def opts(): parser = argparse.ArgumentParser(description='Train alexnet on the cub200 dataset', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--data_path_source', type=str, default='', help='Root of tra...
2.734375
3
rcsb/workflow/targets/ProteinTargetSequenceExecutionWorkflow.py
rcsb/py-rcsb_workflow
0
12778169
<filename>rcsb/workflow/targets/ProteinTargetSequenceExecutionWorkflow.py ## # File: ProteinTargetSequenceExecutionWorkflow.py # Author: <NAME> # Date: 25-Jun-2021 # # Updates: # ## """ Execution workflow for protein target data ETL operations. """ __docformat__ = "google en" __author__ = "<NAME>" __email__ = "<...
2.046875
2
Module3_Data_for_ML/Linear_regression.py
EllieBrakoniecki/AICOREDATASCIENCE
0
12778170
#%% import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import datasets, linear_model, metrics, preprocessing from sklearn.model_selection import train_test_split import itertools import typing class LinearRegression(): def __init__(self, n_features, optimiser): np.random.se...
3.3125
3
src/LetterFrequency.py
abench/spectrum_of_line_codes
0
12778171
<reponame>abench/spectrum_of_line_codes import sys def LetterFrequency(fname): Freq=[] for i in xrange(256): Freq.append(0.0) while True: try: b=fname.read(1) # print b # Freq[ord(b)]=Freq[ord(b)]+1 except EOFError: break ...
2.65625
3
python-the-hard-way/27-memorizing-logic.py
Valka7a/python-playground
0
12778172
<filename>python-the-hard-way/27-memorizing-logic.py # Exercise 27: Memorizing Logic #The Truth Terms: # and # or # not # != (not equal) # == (equal) # >= (greater-than-equal) # <= (less-than-equal) # True # False # The Truth Tables # NOT Table #____________________________ #| NOT | TRUE? | #----------------------...
4
4
app.py
edumoraisv/testegeekieo
0
12778173
#----------------------------------------------------------------------------# # Imports #----------------------------------------------------------------------------# from flask import Flask, redirect, render_template, request, url_for import logging from logging import Formatter, FileHandler from forms import * impo...
2.0625
2
spam/forms.py
iamsushanth/sms-spam-detector
1
12778174
<reponame>iamsushanth/sms-spam-detector from django import forms class SearchForm(forms.Form): q = forms.CharField(label='',widget=forms.Textarea( attrs={ 'class':'search-query form-control', 'placeholder':'Search' } ))
2.234375
2
bin/train_word_vectors.py
ivigamberdiev/spaCy
12
12778175
<reponame>ivigamberdiev/spaCy #!/usr/bin/env python from __future__ import print_function, unicode_literals, division import logging from pathlib import Path from collections import defaultdict from gensim.models import Word2Vec from preshed.counter import PreshCounter import plac import spacy logger = logging.getLog...
2.5
2
chapter_05/example_0001.py
yuchen352416/leetcode-example
0
12778176
<reponame>yuchen352416/leetcode-example #!/usr/bin/python3 from typing import List class Solution: def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: """ description: 合并两个有序数组 type nums1: List[int] type m: int type nums2: List[int] type n:...
3.796875
4
core/base_page.py
zoltancsontos/pystack-framework
0
12778177
import os from falcon import falcon from settings.settings import SETTINGS from chameleon import PageTemplateLoader class BasePage(object): """ Generic base page object """ model = None property_types = [] default_404 = SETTINGS['VIEWS']['DEFAULT_404_TEMPLATE'] templates_dir = 'templates...
2.34375
2
src/load_predicate_embedding.py
heindorf/www19-fair-classification
4
12778178
<reponame>heindorf/www19-fair-classification # ----------------------------------------------------------------------------- # WWW 2019 Debiasing Vandalism Detection Models at Wikidata # # Copyright (c) 2019 <NAME>, <NAME>, <NAME>, <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy ...
1.460938
1
Chapter 01/_aux/anomaly.py
bpbpublications/Time-Series-Forecasting-using-Deep-Learning
7
12778179
import matplotlib.pyplot as plt import random if __name__ == '__main__': random.seed(9) length = 100 A = 5 B = .2 C = 1 trend = [A + B * i for i in range(length)] noise = [] for i in range(length): if 65 <= i <= 75: noise.append(7 * C * random.gauss(0, 1)) ...
3.125
3
forest/distinguisher/regex_distinguisher.py
Marghrid/Forest
7
12778180
import random import re import time from itertools import combinations import z3 from forest.logger import get_logger from forest.utils import check_conditions from forest.visitor import ToZ3, RegexInterpreter logger = get_logger('forest') use_derivatives = True # z3.set_param('smt.string_solver', 'z3str3') class...
2.515625
3
aws/context.py
robertcsapo/aws-lambda-python-local
0
12778181
import uuid from datetime import date import os import humanize class Context: def __init__(self, function_name, function_version): self.function_name = function_name self.function_version = function_version self.invoked_function_arn = "arn:aws:lambda:eu-north-1:000000000000:function:{}".f...
2.75
3
spherov2/test/BoltTest.py
Cole1220/spherov2.py
1
12778182
# python3 #import sys #sys.path.append('/spherov2/') import time from spherov2 import scanner from spherov2.sphero_edu import EventType, SpheroEduAPI from spherov2.types import Color print("Testing Starting...") print("Connecting to Bolt...") toy = scanner.find_BOLT() if toy is not None: print("Connected.") ...
2.8125
3
src/def_func.py
maokuntao/python-study
0
12778183
<reponame>maokuntao/python-study ''' 函数定义 Created on 2017年12月22日 @author: taomaokun ''' from my_lib import my_abs # print(my_abs('A')) #TypeError # print(my_abs('-233'))#TypeError print(my_abs(-233)) # 函数名其实就是指向一个函数对象的引用,完全可以把函数名赋给一个变量,相当于给这个函数起了一个“别名”: another_my_abs = my_abs; print(another_my_abs(-2.333))
3.71875
4
Swift-FHIR/fhir-parser/Python/mappings.py
technosoftgit/Smart_2_8_2_Swift4
0
12778184
<reponame>technosoftgit/Smart_2_8_2_Swift4 # Mappings for the FHIR class generator # Which class names to map to resources and elements classmap = { 'Any': 'Resource', 'boolean': 'bool', 'integer': 'int', 'positiveInt': 'int', 'unsignedInt': 'int', 'date': 'FHIRDate', 'dateTime': 'FHIR...
2.140625
2
elosports/elo.py
Anjum48/Elo
0
12778185
<gh_stars>0 class Elo: def __init__(self, k, home_advantage=100): """ :param k: Elo K-Factor :param home_advantage: Home field advantage, Default=100 """ self.ratingDict = {} self.k = k self.home_advantage = home_advantage def add_player(self, name, ratin...
3.515625
4
spider/spide.py
virusdefender/qdu_empty_classroot
3
12778186
<gh_stars>1-10 # coding=utf-8 import time import json import re import requests from thread_pool import ThreadPool class Spider(object): def __init__(self): self.cookies = {} self.r = re.compile( u'<tr style="display:" id="tr\d+"[^>]*?>\s*<td>([^<]*?)</td>[\s\S]+?<tr align="center" >...
2.8125
3
tool.py
zhongguozhi2/myblog
0
12778187
import hashlib import json import sys import time from random import random def custom_print(*args, sep=' ', end='\n', file=None): """ print补丁 :param x: :return: """ # 获取被调用函数在被调用时所处代码行数 line = sys._getframe().f_back.f_lineno # 获取被调用函数所在模块文件名 # file_name = sys._getframe(1).f_code.co_...
2.6875
3
process_deposition_data.py
johnmgregoire/JCAPdepositionmonitor
1
12778188
# <NAME> and <NAME> # Created: 6/05/2013 # Last Updated: 6/14/2013 # For JCAP import numpy as np from PyQt4 import QtCore from dictionary_helpers import * import date_helpers import filename_handler import datareader # global dictionary holds all processed (z, x, y, rate) data for the experiment DEP_DATA = [] zndec ...
2.171875
2
contas/forms.py
Setti7/itaipu
1
12778189
<reponame>Setti7/itaipu<filename>contas/forms.py from django import forms from django.contrib.auth import ( password_validation, ) from django.contrib.sites.shortcuts import get_current_site from django.core.mail import send_mail from django.forms import widgets from django.template import loader from django.utils....
2.1875
2
pyPLS/pls.py
ocloarec/pyPLS
1
12778190
from __future__ import print_function import numpy as np from ._PLSbase import plsbase as pls_base from .utilities import nanmatprod, isValid from .engines import pls as pls_engine class pls(pls_base): """ This is the classic multivariate NIPALS PLS algorithm. Parameters: X: {N, P} array like ...
2.859375
3
yoloface.py
dsp-c01/patrol_and_greet
0
12778191
<filename>yoloface.py<gh_stars>0 # ******************************************************************* # # Author : <NAME>, 2018 # Email : <EMAIL> # Github : https://github.com/sthanhng # # BAP, AI Team # Face detection using the YOLOv3 algorithm # # Description : yoloface.py # The main code of the Face detection usin...
2.015625
2
tests/test_parameter.py
lukasz-migas/SimpleParam
0
12778192
<reponame>lukasz-migas/SimpleParam """Test Parameter class""" import operator import pytest import simpleparam as param class TestParameterSetup(object): """Test Parameter class""" @staticmethod def test_creation_float(): """Test Parameter - correct initilization""" value = 1.0 ...
2.90625
3
dissononce/processing/impl/cipherstate.py
dineshks1/dissononce
34
12778193
<filename>dissononce/processing/impl/cipherstate.py class CipherState(object): def __init__(self, cipher): """ :param cipher: :type cipher: dissononce.cipher.Cipher """ self._cipher = cipher self._key = None self._nonce = 0 @property def cipher(self):...
2.78125
3
ymir/command/tests/unit/test_cmd_export.py
phoenix-xhuang/ymir
0
12778194
import os import shutil from typing import List, Tuple import unittest from google.protobuf import json_format from mir.commands import exporting from mir.protos import mir_command_pb2 as mirpb from mir.tools import hash_utils, mir_storage_ops from mir.tools.code import MirCode from tests import utils as test_utils ...
2.109375
2
quizmake/__main__.py
jnguyen1098/quizmake
1
12778195
<filename>quizmake/__main__.py # !/usr/bin/env python3 # -*- coding: utf-8 -*- """Initialization.""" import sys from . import core if __name__ == "__main__": sys.exit(core.main(sys.argv))
1.90625
2
joelib/physics/jethead.py
Joefdez/joelib
1
12778196
from numpy import * import joelib.constants.constants as cts from joelib.physics.synchrotron_afterglow import * from scipy.stats import binned_statistic from scipy.interpolate import interp1d from tqdm import tqdm class jetHeadUD(adiabatic_afterglow): ###################################################...
2.078125
2
example.py
reening/pysflow
4
12778197
<reponame>reening/pysflow from binascii import unhexlify from pprint import pprint from sflow import decode # Example datagram taken from http://packetlife.net/captures/protocol/sflow/ raw = '0000000500000001ac15231100000001000001a6673f36a00000000100000002' +\ '0000006c000021280000040c000000010000000100000058...
2.671875
3
RabbitMqUdn/client/quorum-queue-test.py
allensanborn/ChaosTestingCode
73
12778198
#!/usr/bin/env python import pika import sys import time import datetime import subprocess import random import threading import requests import json from command_args import get_args, get_mandatory_arg, get_optional_arg, is_true, get_optional_arg_validated from RabbitPublisher import RabbitPublisher from MultiTopicCo...
2.015625
2
src/titiler/mosaic/titiler/mosaic/__init__.py
kalxas/titiler
0
12778199
"""titiler.mosaic""" __version__ = "0.6.0" from . import errors, factory # noqa from .factory import MosaicTilerFactory # noqa
1.054688
1
initadmin.py
fga-eps-mds/2017.2-SiGI-Op_API
6
12778200
import os os.environ['DJANGO_SETTINGS_MODULE'] = 'sigi_op.settings' import django django.setup() from django.contrib.auth.management.commands.createsuperuser import get_user_model if get_user_model().objects.filter(username='admin'): print("Super user already created") else: get_user_model()._default_manager....
2.15625
2
atalaya/parameters.py
jacr13/Atalaya
0
12778201
<reponame>jacr13/Atalaya import json from os.path import join as pjoin class Parameters: """Class that loads hyperparameters from a json file. From : - https://github.com/cs230-stanford/cs230-code-examples/blob/master/pytorch/vision/utils.py Example: ``` params = Params(json_path) pr...
3.21875
3
GitHubScripts/merge_data.py
bdqnghi/sstubs_bug_miner
0
12778202
import os, shutil from distutils.dir_util import copy_tree import numpy as np import shutil path = "dataset" split_path = "dataset_splits" all_paths = [] for folder in os.listdir(split_path): folder_path = os.path.join(split_path, folder) print(folder_path) for project_folder in os.listdir(folder_path): # print...
2.328125
2
tkinterUI/historyPage.py
moreviraj2000/license-detection-project
0
12778203
import os import sqlite3 from tkinter import * from tkinter import simpledialog from tkinter import ttk from PIL import Image, ImageTk from DetailsPage import DetailsPage import constants from datetime import datetime import tkinter.filedialog from tkinter import messagebox import xlwt class HistoryPage...
2.375
2
ali/ali/__init__.py
makefu/ali-orders
3
12778204
from core import run_casper,save_db,load_db from datetime import datetime,timedelta import logging log = logging.getLogger('ali-module') list_js="ali/get_order_list.js" order_js="ali/get_order.js" confirm_js="ali/confirm_order.js" login_js="ali/login.js" order_url="http://trade.aliexpress.com/order_detail.htm?orderId...
2.140625
2
posts/AmericaByTrain/arrow.py
capecchi/capecchi.github.io
0
12778205
#Amtrak Recursive ROute Writer (ARROW) #cont- does not write initial .npz file, relies on existing partials def main(newdata=False, cont=False, newredund=False, arrive=True): import json import numpy as np import os import route_builder import glob import find_redunda...
2.21875
2
urbanairship/reports/experiments.py
tirkarthi/python-library
0
12778206
<gh_stars>0 from typing import Dict, Any from urbanairship import Airship class ExperimentReport(object): def __init__(self, airship: Airship) -> None: """Access reporting related to A/B Tests (experiments) :param airship: An urbanairship.Airship instance. """ self.airship = airs...
2.796875
3
models.py
iperez319/dog-tinder
0
12778207
from google.appengine.ext import ndb class Dog(ndb.Model): name = ndb.StringProperty() breed = ndb.StringProperty() gender = ndb.StringProperty() age = ndb.StringProperty() size = ndb.StringProperty() socialLevel = ndb.StringProperty() activityLevel = ndb.StringProperty() profilePic = n...
2.546875
3
aiokts/manage.py
ktsstudio/aiokts
6
12778208
import argparse import inspect import logging import logging.config import os import pkgutil import sys from aiokts.managecommands import Command from aiokts.store import Store CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(CURRENT_DIR) class BaseManage(object): commands_package_path =...
2.375
2
compressor/simple/seven.py
httpwg/compression-test
11
12778209
#!/usr/bin/env python """ Serialise ASCII as seven bits. Yes, I threw up a bit too. """ from bitarray import bitarray def encode(text): ba = bitarray() out = bitarray() ba.fromstring(text) s = 0 while s < len(ba): byte = ba[s:s+8] out.extend(byte[1:8]) s += 8 # print out return out.tobytes(...
3.671875
4
setup.py
andsor/pyggcq
1
12778210
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Setup file for ggcq. This file was generated with PyScaffold 1.2, a tool that easily puts up a scaffold for your new Python project. Learn more under: http://pyscaffold.readthedocs.org/ """ import inspect import os import sys from distutils.cmd import ...
1.765625
2
utils/mp4-dash-clone.py
kahache/video_packaging_platform
8
12778211
<reponame>kahache/video_packaging_platform #!/usr/bin/env python3 __author__ = '<NAME> (<EMAIL>)' __copyright__ = 'Copyright 2011-2012 Axiomatic Systems, LLC.' ### # NOTE: this script needs Bento4 command line binaries to run # You must place the 'mp4info' and 'mp4encrypt' binaries # in a directory named 'bin/<pla...
1.9375
2
examples/multi-apps/app/libs/logging.py
luohu1/flask-example
0
12778212
# coding: utf-8 import logging import sys from flask.logging import default_handler default_formatter = '%(asctime)s %(process)d,%(threadName)s %(filename)s:%(lineno)d [%(levelname)s] %(message)s' def configure_logging(app): # handler = None if app.debug: handler = logging.StreamHandler(sys.stdout) ...
2.375
2
audb/core/info.py
audeering/audb
1
12778213
<filename>audb/core/info.py<gh_stars>1-10 import typing import pandas as pd import audformat from audb.core import define from audb.core.api import ( dependencies, latest_version, ) from audb.core.load import ( database_cache_folder, load_header, ) def author( name: str, *, ...
2.484375
2
tool/border_binaries_finder/utils.py
MageWeiG/karonte
1
12778214
import string # Defines CMP_SUCCS = ["strcmp", "memcmp", "strncmp", "strlcmp", "strcasecmp", "strncasecmp", "strstr"] NETWORK_KEYWORDS = ["QUERY_STRING", "username", "HTTP_", "REMOTE_ADDR", "boundary=", "Content-Type", "Content-Length", "http_", "http", "HTTP", "query", "remote", "user-agent", "soap", "index."] CASE_S...
2.125
2
src/carim_discord_bot/__init__.py
schana/carim-discord-bot
14
12778215
VERSION = '2.2.5'
1.132813
1
practicas/diccionarios.py
7junior7/python_comands
2
12778216
#********************************************************DICCIONARIOS******************************************************** # Los diccionarios en python son tipos de datos muy parecidos a los archivos json, los cuales nos permiten crear una lista # pero con identificadores definidos por nosotros. # sintaxis dicc = {"...
3.234375
3
Practice/Python/Basic Data Types/List_Comprehensions.py
alexanderbauer89/HackerRank
1
12778217
def print_list_comprehensions(x, y, z, n): print([[a, b, c] for a in range(0, x + 1) for b in range(0, y + 1) for c in range(0, z + 1) if a + b + c != n ]) if __name__ == '__main__': x = int(input()) y = int(input()) z = int(input()) n = int(input()) print_list_comprehensions(x, ...
3.6875
4
Scripts/Cogs/setup.py
Mahas1/BotMan.py-rewritten
0
12778218
import json from discord.ext import commands import discord import os with open('config.json') as configFile: configs = json.load(configFile) prefix = configs.get('prefix_list')[0] class Setup(commands.Cog, description='Used to set up the bot for welcome messages, mute/unmute etc.'): def __init__(self,...
2.734375
3
nmosquery/__init__.py
bbc/nmos-query
1
12778219
VALID_TYPES = ["flows", "sources", "nodes", "devices", "senders", "receivers"]
1.078125
1
oxasl/basil.py
physimals/oxasl
1
12778220
#!/usr/bin/env python """ OXASL - Bayesian model fitting for ASL The BASIL module is a little more complex than the other Workspace based modules because of the number of options available and the need for flexibility in how the modelling steps are run. The main function is ``basil`` which performs model fitting on A...
2.5625
3
src/controls/array_control.py
furbrain/CVExplorer
0
12778221
from typing import Optional, TYPE_CHECKING import wx if TYPE_CHECKING: from gui.pane import FunctionPane # noinspection PyPep8Naming class ArrayControl(wx.ComboBox): # noinspection PyShadowingBuiltins def __init__(self, parent, id): from functions import Function choices = list(Function.g...
2.453125
2
memwatch.py
Ezibenroc/memwatch
0
12778222
import sys import csv import datetime import time import argparse from subprocess import Popen, PIPE class Watcher: def __init__(self, cmd, time_interval, filename): self.cmd = cmd self.time_interval = time_interval self.filename = filename self.outputfile = open(filename, 'w') ...
2.6875
3
mobtick/models.py
proteus2171/test
0
12778223
from django.db import models # Create your models here. class ticket(models.Model): timestamp = models.DateField(auto_now_add=True,auto_now=False,) tech = models.CharField(max_length=50,) site = models.CharField(max_length=50,) user = models.CharField(max_length=50,) issue = models.CharField(max_le...
2.078125
2
tests/derivate/linear_equation_derivate_test.py
cenkbircanoglu/clustering
23
12778224
from unittest import TestCase from similarityPy.derivate.linear_equation_derivate import LinearEquationDerivate from tests import test_logger __author__ = 'cenk' class LinearEquationDerivateTest(TestCase): def setUp(self): pass def test_algorithm(self): test_logger.debug("LinearEquationDe...
3.671875
4
leetcode/LCP_40.py
zhaipro/acm
0
12778225
class Solution: def maxmiumScore(self, cards: List[int], cnt: int) -> int: cards.sort() r = sum(cards[-cnt:]) if r % 2 == 0: return r r0 = 0 r1 = 0 try: x0 = next(x for x in cards[-cnt:] if x % 2 == 0) y1 = next(x for x in cards[-cn...
2.78125
3
backend/models.py
nhatnxn/layout_GateGCN
17
12778226
import torch from vietocr.tool.config import Cfg from vietocr.tool.predictor import Predictor import configs as cf from models.saliency.u2net import U2NETP from backend.text_detect.craft_utils import get_detector def load_text_detect(): text_detector = get_detector(cf.text_detection_weights_path, cf.device) ...
2.171875
2
python/cartons_inventory/cartons.py
sdss/cartons_inventory
0
12778227
<reponame>sdss/cartons_inventory<filename>python/cartons_inventory/cartons.py import csv import inspect import os import numpy as np import pandas as pd from astropy.io import ascii from sdssdb.peewee.sdss5db.targetdb import (Cadence, Carton, CartonToTarget, Category, Instru...
2.796875
3
shadon/testsToken.py
subbc/devops_jkweb
0
12778228
#!/usr/bin/evn python # -*- coding:utf-8 -*- from shadon.tsetsHttp import testsHttp from shadon.testsConfig import testsConfig import os class testsToken(): def __init__(self): self.url = '/oauth/authorizationServer/accessToken' self.mytestsConfig = testsConfig() self.mytestsConfig.getCon...
2.265625
2
finchan/__main__.py
msgroup/finchan
3
12778229
<reponame>msgroup/finchan # -*- coding: utf-8 -*- # This file is part of finchan. # Copyright (C) 2017-present qytz <<EMAIL>> # # 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://w...
1.679688
2
scripts/test_velocity.py
done-jithinlal/ubiquity_motor
0
12778230
<reponame>done-jithinlal/ubiquity_motor #!/usr/bin/env python # VELOCITY can be positive (driving forward) or negative (driving backward) VELOCITY = 0.2 # Initial turn angle (Z axis) ANGLE = 0.0 import rospy from geometry_msgs.msg import Twist,Point from nav_msgs.msg import Odometry rospy.init_node('slow_motion', ...
2.75
3
quickq/model.py
valleau-lab/quickq
0
12778231
<gh_stars>0 """Keras based deepchem DNN model. The native deepchem DNN has been changed to pytorch, and tensorflow is desired. Here we create a Deepchem simple dense Neural network. """ import os from typing import Iterable, Union, List import deepchem.models import deepchem.data import numpy import tensorflow.keras ...
2.78125
3
src/cacofonix/main.py
jonathanj/cacofonix
5
12778232
<filename>src/cacofonix/main.py import click import datetime from fs import open_fs from collections import OrderedDict from typing import Optional, List, Tuple, TextIO from . import _yaml from ._app import Application from ._cli import ( iso8601date, validate_fragment_type, validate_section, split_iss...
2.140625
2
taskobra/orm/relationships/system_component.py
manistal/taskobra
0
12778233
<reponame>manistal/taskobra # Libraries from sqlalchemy import Column, ForeignKey, Integer from sqlalchemy.orm import relationship # Taskobra from taskobra.orm.base import ORMBase class SystemComponent(ORMBase): __tablename__ = "SystemComponent" system_id = Column(Integer, ForeignKey("System.unique_id"), prim...
2.453125
2
helpers/team_manipulator.py
enterstudio/the-blue-alliance
0
12778234
import logging from google.appengine.api import search from helpers.cache_clearer import CacheClearer from helpers.location_helper import LocationHelper from helpers.manipulator_base import ManipulatorBase from helpers.search_helper import SearchHelper class TeamManipulator(ManipulatorBase): """ Handle Team...
2.140625
2
api/applications/tests/tests_create_application.py
django-doctor/lite-api
3
12778235
from parameterized import parameterized from rest_framework import status from rest_framework.reverse import reverse from api.applications.enums import ( ApplicationExportType, ApplicationExportLicenceOfficialType, GoodsTypeCategory, ) from api.applications.models import ( StandardApplication, Open...
2.296875
2
run_terminate_appstream_fleet_autoscale.py
HardBoiledSmith/johanna
64
12778236
<reponame>HardBoiledSmith/johanna<filename>run_terminate_appstream_fleet_autoscale.py #!/usr/bin/env python3 from env import env from run_common import AWSCli from run_common import print_message from run_common import print_session options, args = dict(), list() if __name__ == "__main__": from run_common import...
2.34375
2
lcm/lcm/nf_pm/serializers/create_thresho_id_request.py
onap/vfc-gvnfm-vnflcm
1
12778237
<reponame>onap/vfc-gvnfm-vnflcm # Copyright (c) 2019, CMCC Technologies Co., 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 # # Unles...
1.765625
2
sphere_SA_population/sphere_SA_population.py
trevorgokey/misc
0
12778238
<filename>sphere_SA_population/sphere_SA_population.py<gh_stars>0 #!/usr/bin/env python3 import numpy as np from matplotlib import animation from matplotlib import rc import matplotlib.pyplot as plt def cart2sph(x, y, z): hxy = np.hypot(x, y) r = np.hypot(hxy, z) phi = np.arctan2(y, x) theta = np.arct...
2.703125
3
hummingbot/strategy/dev_0_hello_world/start.py
cardosofede/hummingbot
542
12778239
<reponame>cardosofede/hummingbot #!/usr/bin/env python from hummingbot.strategy.dev_0_hello_world.dev_0_hello_world_config_map import dev_0_hello_world_config_map from hummingbot.strategy.dev_0_hello_world import HelloWorldStrategy def start(self): try: exchange = dev_0_hello_world_config_map.get("exchan...
2.28125
2
Cimple_Compiler.py
Triantafullenia-Doumani/Cimple-Compiler
0
12778240
# <NAME> 4191 # <NAME> 4052 import sys SINGLE_TOKENS_LIST = [",", ";", "+", "-", "*", "/", ")", "(", "[", "]", "{", "}", ">", "<", "="] VARLIST = [] AUTO = [ [4, 3, 5, 5, 5, 2, 5, 5, 5, 5, 5, 5, 5, 0, 7, 8, 5, 5, 5], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 6, 1], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6,...
2.296875
2
tests/integration/test_rerun.py
JoshKarpel/condormap
21
12778241
# Copyright 2018 HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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/LICE...
2.125
2
py/caesar_cipher.py
sti320a/security_tools
0
12778242
#! python3 def generate_cryptogram(text: str, keynum: int) -> str: encrypted = '' for char in text: encrypted += chr(ord(char) + keynum) return encrypted def try_decrypt(text: str) -> list: res = [] for keynum in range(1, 27): res.append(generate_cryptogram(text, -keynum)) re...
3.828125
4
tests/unit/test_modulegraph/testpkg-packages/pkg/__init__.py
hawkhai/pyinstaller
9,267
12778243
<reponame>hawkhai/pyinstaller """ pkg.init """
0.757813
1
bagou/exceptions.py
toxinu/django-bagou
4
12778244
<reponame>toxinu/django-bagou # -*- coding: utf-8 -*- class BagouException(Exception): pass class BagouChannelException(Exception): pass
1.054688
1
configs/distiller/cwd/cwd_psp_r101-d8_distill_psp_r18_d8_512_1024_80k_cityscapes.py
pppppM/mmsegmentation-distiller
35
12778245
<filename>configs/distiller/cwd/cwd_psp_r101-d8_distill_psp_r18_d8_512_1024_80k_cityscapes.py _base_ = [ '../../_base_/datasets/cityscapes.py', '../../_base_/default_runtime.py', '../../_base_/schedules/schedule_80k.py' ] find_unused_parameters=True weight=5.0 tau=1.0 distiller = dict( type='Segmentation...
1.382813
1
src/pyhn/urls.py
knownsec/PyHackerNews
8
12778246
#!/usr/bin/env python from django.conf.urls import patterns, include, url urlpatterns = patterns( '', url(r'^$', 'pyhn.apps.news.views.index.index', name='index'), url( r'^social/', include('social.apps.django_app.urls', namespace='social') ), url(r'^news/', include('pyhn.apps.news.urls'...
1.953125
2
crimsobot/utils/games.py
the-garlic-os/crimsoBOT
0
12778247
import random from collections import Counter from datetime import datetime from typing import List, Tuple, Union import discord from discord import Embed from discord.ext import commands from crimsobot.models.currency_account import CurrencyAccount from crimsobot.models.guess_statistic import GuessStatistic from cri...
2.609375
3
custom_components/afvalinfo/location/venlo.py
reindrich/home-assistant-config
0
12778248
from ..const.const import ( MONTH_TO_NUMBER, SENSOR_LOCATIONS_TO_URL, _LOGGER, ) from datetime import datetime, date from bs4 import BeautifulSoup import urllib.request import urllib.error class VenloAfval(object): def get_date_from_afvaltype(self, tableRows, afvaltype): try: for r...
2.875
3
cogs/Games.py
YeetVegetabales/NOVA
7
12778249
import discord import aiohttp import random import asyncio import json import io import re import akinator import time import asyncpraw import requests import urllib3 import urllib import itertools import time import textwrap from time import perf_counter from aiotrivia import TriviaClient, AiotriviaException from disc...
2.921875
3
bci_framework/default_extensions/Neuropathic_pain_Neurofeedback/main.py
UN-GCPDS/bci-framework-
0
12778250
""" ================================ Neuropathic pain - Neurofeedback ================================ """ import logging from typing import Literal, TypeVar from bci_framework.extensions.stimuli_delivery import StimuliAPI, Feedback, DeliveryInstance from bci_framework.extensions.stimuli_delivery.utils import Widg...
2.359375
2