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
examples/5_cells_iclamp/verification/pure_nrn.py
AllenInstitute/project7
35
35600
import os import sys import neuron import json from pprint import pprint from neuron import h import matplotlib.pyplot as plt import numpy as np import h5py ## Runs the 5 cell iclamp simulation but in NEURON for each individual cell # $ python pure_nrn.py <gid> neuron.load_mechanisms('../components/mechanisms') h.loa...
2.078125
2
tools/telemetry/telemetry/value/trace_unittest.py
sunjc53yy/chromium
0
35601
<reponame>sunjc53yy/chromium # Copyright 2014 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 os import unittest from telemetry.page import page_set from telemetry.timeline import tracing_timeline_data from telemet...
2.15625
2
utils.py
ruchikachavhan/instagan
5
35602
<filename>utils.py import torch.nn.parallel import torch.optim as optim import torch.utils.data import torch.nn as nn import torch.nn.functional as F import torchvision.datasets import torchvision.transforms as transforms import torchvision.utils as vutils from torch.autograd import Variable import matplotlib.pyplot a...
2.3125
2
Super_TF/Dataset_IO/Classification/Dataset_reader_classification.py
Dhruv-Mohan/Super_TF
8
35603
<gh_stars>1-10 from utils.Dataset_reader import Dataset_reader from Dataset_IO.Classification.Dataset_conifg_classification import Dataset_conifg_classification import Dataset_IO.Classification.Dataset_classification_pb2 as proto import tensorflow as tf import os #TODO: ADD TFRECORDS AND MEANPROTO READING CHECKS clas...
2.59375
3
yocto/poky/scripts/lib/recipetool/create_buildsys.py
jxtxinbing/ops-build
2
35604
# Recipe creation tool - create command build system handlers # # Copyright (C) 2014 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed...
1.960938
2
models/classification/_base_/ote_mobilenet_v3.py
openvinotoolkit/model_preparation_algorithm
0
35605
<gh_stars>0 # model settings model = dict( type='ImageClassifier', backbone=dict( type='OTEMobileNetV3', mode='small', width_mult=1.0), neck=dict(type='GlobalAveragePooling'), head=dict( type='NonLinearClsHead', num_classes=1000, in_channels=576, h...
1.445313
1
tools/rewrite_includes.py
Shachlan/skia
6
35606
#!/usr/bin/python2 # # Copyright 2019 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os roots = [ 'bench', 'dm', 'docs', 'example', 'experimental', 'fuzz', 'gm', 'include', 'modules', 'platform_tools/an...
2.15625
2
unit_tests/test_class_query.py
usc-isi-i2/gaia-question-sparql
0
35607
import unittest import sys import os sys.path.append('../') from src.class_query import ClassQuery from src.query_tool import QueryTool, Mode base_path = os.path.dirname(__file__) cq = ClassQuery(base_path + '/sample_queries/class_queries.xml') class TestClassQuery(unittest.TestCase): def test_class_cluster(self...
2.6875
3
garbage/reddit_Prog_Chal.py
wolfdale/Spaghetti-code
1
35608
#[2015-10-26] Challenge #238 [Easy] Consonants and Vowels v=['a','e','i','o','u'] c=['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z'] import random string = raw_input() word=[] for i in range (len(string)): if string[i] == 'v': word.append(random.choice(v)) else: word.append(ra...
3.6875
4
workflow_lib/fert.py
VUB-HYDR/2018_Chawanda_etal
14
35609
import init_file as variables import cj_function_lib as cj from datetime import datetime fert_table = cj.extract_table_from_mdb(variables.QSWAT_MDB, "fert", variables.path + "\\fert.tmp~") fert = "" for fert_line in fert_table: fert += cj.trailing_spaces(4, fert_line.split(",")[1], 0) + cj.string_trailing_spaces...
2.59375
3
transposition-decrypt.py
IamLucif3r/Cryptography
2
35610
<filename>transposition-decrypt.py<gh_stars>1-10 import math,pyperclip def main(): myMessage = 'Cenoonommstmme oo snnio. s s c' myKey = 8 plainText = decryptMessage(myKey,myMessage) print(plainText+'|') pyperclip.copy(plainText) def decryptMessage(key,message): numOfColumns = math.ceil(len(mes...
3.296875
3
r80_apis.py
0dadj1an/r80python
0
35611
<gh_stars>0 #!/bin/python import requests import json import pprint #remove https warning requests.packages.urllib3.disable_warnings() #url = "https://192.168.248.150/web_api/" #user = "api_user" #pw = "<PASSWORD>" def login(url,user,pw): payload_list={} payload_list['user']=user payload_list['password']=pw ...
2.8125
3
pait/app/tornado/_pait.py
so1n/pait
19
35612
<gh_stars>10-100 from typing import Any, Type import aiofiles # type: ignore from tornado.web import RequestHandler from pait.app.base import BaseAppHelper from pait.core import Pait as _Pait from pait.g import config from pait.model import response from ._app_helper import AppHelper __all__ = ["pait", "Pait"] a...
2.125
2
fund/items.py
suddi/fundscraper
1
35613
from scrapy.item import Field, Item # pylint: disable-msg=too-many-ancestors class FundItem(Item): code = Field() name = Field() tier = Field() start_date = Field() date = Field() price = Field()
1.796875
2
src/brightness_options.py
imesut/alfred-yeelight-pbc
1
35614
<reponame>imesut/alfred-yeelight-pbc import json, yeelight, sys from utils import get_alfred_object, bulb, bulb_properties, current_brightness current_brigthness_index = round(int(current_brightness)/10) brightness_list = [0,10,20,30,40,50,60,70,80,90,100] brightness_list = brightness_list[current_brigthness_index:] +...
2.390625
2
NetCatKS/DProtocol/api/interfaces/storage/__init__.py
dimddev/NetCatKS-CP
0
35615
__author__ = 'dimd' from zope.interface import Interface, Attribute class IProtocolStogareInterface(Interface): """ This interface define our session storage Every custom storage have to implement this Interface """ session = Attribute(""" Container for our session """)
1.953125
2
examples/rope_register_transfer.py
def670/lfd
36
35616
#!/usr/bin/env python from __future__ import division import numpy as np from lfd.environment.simulation import DynamicSimulationRobotWorld from lfd.environment.simulation_object import XmlSimulationObject, BoxSimulationObject from lfd.environment import environment from lfd.environment import sim_util from lfd.demo...
2.25
2
data/IQAFolders.py
YuLvS/L2PIPS
3
35617
import csv import os.path import random import numpy as np import scipy.io import torch import torchvision from torch.utils.data import Dataset # from .util import * from data.util import default_loader, read_img, augment, get_image_paths class PIPALFolder(Dataset): def __init__(self, root=None, ...
2.28125
2
sdk/python/pulumi_aws_native/elasticloadbalancingv2/listener.py
AaronFriel/pulumi-aws-native
29
35618
<reponame>AaronFriel/pulumi-aws-native<filename>sdk/python/pulumi_aws_native/elasticloadbalancingv2/listener.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pu...
1.5625
2
src/gluonts/nursery/few_shot_prediction/src/meta/datasets/datasets.py
RingoIngo/gluon-ts
0
35619
<filename>src/gluonts/nursery/few_shot_prediction/src/meta/datasets/datasets.py # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is loca...
2.0625
2
tests/test_individual.py
viswanathareddya/Geektrust_in_family
0
35620
import unittest from Familytree.individual import Person from Familytree import variables class Testperson(unittest.TestCase): def setUp(self): self.person = Person(1, "Jane", "Female") def test_initialization(self): # check instance self.assertEqual(isinstance(self.person, Person), ...
3.53125
4
rdparser/nodes.py
dougabugg/python-recursive-descent-parser
3
35621
<gh_stars>1-10 class BaseNode: pass class Node(BaseNode): def __init__(self, offset, name=None, **opts): self.offset = offset self.end_offset = None self.name = name self.nodes = [] self.opts = opts def __as_dict__(self): return {"name": self.name, "nodes": ...
3.171875
3
examples/first_class_functions.py
HansVdb/pythonavd-d01
0
35622
<gh_stars>0 def foo(): print("I'm a lovely foo()-function") print(foo) # <function foo at 0x7f9b75de3f28> print(foo.__class__) # <class 'function'> bar = foo bar() # I'm a lovely foo()-function print(bar.__name__) # foo def do_something(what): """Executes a function :param what: name of the function to...
3.546875
4
sdk/python/pulumi_rancher2/auth_config_open_ldap.py
pulumi/pulumi-rancher2
3
35623
<reponame>pulumi/pulumi-rancher2 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequenc...
1.460938
1
apple/internal/testing/tvos_rules.bzl
LaudateCorpus1/rules_apple
2
35624
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
1.492188
1
cogs/calc.py
cmstevens02/Knight-Assistant
3
35625
<reponame>cmstevens02/Knight-Assistant # This script was written by Conroy # import discord from discord.ext import commands # inherit from commands.Cog class Calculations(commands.Cog): def __init__(self, bot): # reference the bot object from Main.py self.bot = bot @commands.command(help=...
3.28125
3
monitoria-ilp/prova5/M7.py
gustavo-mendel/my-college-projects
3
35626
<filename>monitoria-ilp/prova5/M7.py n, m = [int(e) for e in input().split()] mat = [] for i in range(n): j = [int(e) for e in input().split()] mat.append(j) for i in range(n): for j in range(m): if mat[i][j] == 0: if i == 0: if mat[i][j+1] == 1 and mat[i][j-1] == 1 ...
2.53125
3
utils/__init__.py
DNL-inc/bit
1
35627
<reponame>DNL-inc/bit from . import db_api from . import misc # from . import postpone_message
0.988281
1
xero_python/appstore/models/plan.py
gavinwhyte/xero-python
0
35628
# coding: utf-8 """ Xero AppStore API These endpoints are for Xero Partners to interact with the App Store Billing platform # noqa: E501 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ import re # noqa: F401 from xero_python.models import BaseModel class Plan(BaseModel): ...
2.015625
2
design_patterns/behavioral/command.py
Minkov/python-oop-2021-02
2
35629
<gh_stars>1-10 from abc import ABC, abstractmethod class Command(ABC): @abstractmethod def execute(self): pass @abstractmethod def un_execute(self): pass class AddCommand(Command): def __init__(self, values, new_value): self.values = values self.new_value = new_v...
3.578125
4
test/test_cnn/test_datum.py
DwangoMediaVillage/marltas_core
9
35630
<reponame>DwangoMediaVillage/marltas_core<filename>test/test_cnn/test_datum.py import numpy as np from dqn.cnn.config import CNNConfigBase from dqn.cnn.datum import (Batch, Loss, SampleFromActor, SampleFromBuffer, split_sample_from_actor) def test_sample_from_actor(config=CNNConfigBase()):...
2.125
2
lib/python/zzvm/parser.py
m80126colin/zzvm
19
35631
import codecs import collections import io import os import re import struct from .instruction import Instruction from .opcode import Opcodes from .registers import Registers from .section import Section from .symbol import Symbol def p32(v): return struct.pack('<I', v) def unescape_str_to_bytes(x): return c...
2.8125
3
Ensemble_Movie.py
nchaparr/Sam_Output_Anls
0
35632
<gh_stars>0 from netCDF4 import Dataset import glob,os.path import numpy as np from scipy.interpolate import UnivariateSpline from matplotlib import cm import matplotlib.pyplot as plt #import site #site.addsitedir('/tera/phil/nchaparr/SAM2/sam_main/python') #from Percentiles import * from matplotlib.patches import Patc...
1.96875
2
examples/nlp/entity_linking/query_index.py
hamjam/NeMo
4,145
35633
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2.03125
2
packages/w3af/w3af/plugins/attack/payloads/tests/test_base_payload.py
ZooAtmosphereGroup/HelloPackages
3
35634
""" test_Payload.py Copyright 2012 <NAME> This file is part of w3af, http://w3af.org/ . w3af is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. w3af is distributed in the hope that it wil...
2.03125
2
cvat/apps/iam/schema.py
ACHultman/cvat
4,197
35635
<reponame>ACHultman/cvat # Copyright (C) 2022 Intel Corporation # # SPDX-License-Identifier: MIT from drf_spectacular.extensions import OpenApiFilterExtension, OpenApiAuthenticationExtension from drf_spectacular.plumbing import build_parameter_type from drf_spectacular.utils import OpenApiParameter # https://drf-spec...
2.03125
2
clique_main_1.py
mccrimmonmd/clique
0
35636
""" Version 1: - It begins - For some reason, this version of the decision code (in Shape.move) just makes every shape move up and to the left """ from __future__ import division import pygame, pygame.locals, math, random RAND = random.Random() RAND.seed() UP = 0 DOWN = 1 RIGHT = 2 LEFT = 3 STAY = 4 PLAYER_MOVEM...
3.5
4
exercicios/ex110/teste.py
Matheus1199/python
0
35637
import moeda p = float(input('Digite o preço: ')) t = int(input('Qual o valor da taxa? ')) moeda.resumo(p, t)
3.390625
3
DTSGUI/DetailLevels.py
pchan126/Blender_DTS_30
0
35638
<gh_stars>0 ''' DetailLevels.py Copyright (c) 2008 <NAME>(<EMAIL>) 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 use, copy, modif...
1.164063
1
python/loader/constants.py
msolonskyi/tennisAnalyzer
0
35639
CONNECTION_STRING = '/@' CHUNK_SIZE = 100 BORDER_QTY = 5 # minimun matches per year per player for reload player ATP_URL_PREFIX = 'http://www.atpworldtour.com' DC_URL_PREFIX = 'https://www.daviscup.com' ATP_TOURNAMENT_SERIES = ('gs', '1000', 'atp', 'ch') DC_TOURNAMENT_SERIES = ('dc',) DURATION_IN_DAYS = 18 ATP_CSV_PAT...
1.359375
1
hackerrank/graph/medium/journey-to-the-moon.py
johnklee/algprac
0
35640
#!/usr/bin/env python r''' https://www.hackerrank.com/challenges/journey-to-the-moon/problem ''' import math import os import random import re import sys class Node: def __init__(self, v): self.v = v self.neighbors = set() self.visit = False def addN(self, n): if n not in sel...
3.609375
4
utils/check-glossary.py
feddelegrand7/glosario
0
35641
<reponame>feddelegrand7/glosario<gh_stars>0 #!/usr/bin/env python ''' Check YAML file. Each _entry_ contains one or more _definitions_. ''' import sys import re import yaml from collections import Counter # Keys for entries and definitions. ENTRY_REQUIRED_KEYS = {'slug'} ENTRY_OPTIONAL_KEYS = {'ref'} ENTRY_LANGUAGE_...
2.59375
3
src/SPARTACUS10/tests/test_spatial_silhouette.py
totie10/SPARTACUS10
1
35642
import pytest import numpy as np import pandas as pd from SPARTACUS10 import spatial_silhouette as spasi import sklearn.metrics as metrics import os def find_path(name, path = None): if path is None: path = os.getcwd() for root, dirs, files in os.walk(path): if name in files: ...
2.4375
2
main_app.py
christopher-chandler/image2pdf
1
35643
# Standard import os import platform # Pip import typer import yaml from PIL import Image from PyPDF2 import PdfFileReader, PdfFileWriter from yaml.scanner import ScannerError from yaml.loader import SafeLoader # Custom from auxiliary.message_keys import MessageKeys as mk from auxiliary.file_explorer import FileExplo...
2.890625
3
predictions/views.py
Mustapha-Belkacim/English-Premier-League-predictor
5
35644
from django.shortcuts import render from django.views import View, generic from .services.predictor import get_results class Index(View): template_name = 'predictions/index.html' model = 'xgboost' season = '16/17' results = '' leadboard = '' def get(self, request): self.results = get_r...
1.929688
2
typeit/sums/__init__.py
avanov/type
8
35645
<gh_stars>1-10 from .impl import SumType from .types import Either, Maybe __all__ = ('SumType', 'Either', 'Maybe')
1.453125
1
CICFlowMeter-4.0/bin/utility.py
codingbaobao/React-TorDetection
0
35646
import numpy as np import pandas as pd import pickle as pk import random from sklearn.metrics import accuracy_score from sklearn import preprocessing from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import Imputer def read_csv(csv_path): df = pd.read_csv(csv_path) return df d...
2.59375
3
forex_python/bitcoin.py
Otisey/forex-python
505
35647
from decimal import Decimal import simplejson as json import requests from .converter import RatesNotAvailableError, DecimalFloatMismatchError class BtcConverter(object): """ Get bit coin rates and convertion """ def __init__(self, force_decimal=False): self._force_decimal = force_decimal ...
3.28125
3
iphone_manager.py
karenleewaddell/iPhone_Manager
17
35648
# iPhone Manager bot by Oldmole # No support will be provided, this code is provided "as is" without warranty of any kind, either express or implied. Use at your own risk. # The use of the software and scripts is done at your own discretion and risk and with agreement that you will be solely responsible for any damage ...
2.328125
2
backend/core/migrations/0001_initial.py
EMUNES/hust-mdb
2
35649
# Generated by Django 3.1.7 on 2021-03-09 16:24 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Material', fields=[ ('id', models.AutoField...
1.757813
2
announcements/migrations/0001_initial.py
GeoNode/geonode-announcements
0
35650
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
1.695313
2
2021/5/solution2.py
frenzymadness/aoc
2
35651
import re from dataclasses import dataclass from collections import defaultdict from itertools import cycle @dataclass class Line: x1: int y1: int x2: int y2: int def all_points(self): stepx = 1 if self.x1 < self.x2 else -1 stepy = 1 if self.y1 < self.y2 else -1 if self.x1...
3.015625
3
academica/migrations/0003_auto_20201220_1016.py
Chaoslecion123/tesis-final-aradiel-2020
0
35652
# Generated by Django 3.0.7 on 2020-12-20 15:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('academica', '0002_auto_20201220_0117'), ] operations = [ migrations.RemoveField( model_name='clase', name='nivel', )...
1.578125
2
devday/talk/context_processors.py
jenslauterbach/devday_website
6
35653
from event.models import Event from talk.models import Talk def committee_member_context_processor(request): if request.user.is_authenticated: return { "is_committee_member": request.user.has_perms( ("talk.add_vote", "talk.add_talkcomment") ) } else: ...
2.078125
2
analysis/divide.py
chris-wahl/SDSS_QSO
0
35654
<reponame>chris-wahl/SDSS_QSO<gh_stars>0 from spectrum import Spectrum, align_wavelengths def divide( numerator: Spectrum, denominator: Spectrum, wl_low: float = None, wl_high: float = None ) -> Spectrum: """ Performs a point-by-point division of the numerator spectrum by the denominator spectrum. If wavelen...
3.15625
3
Ekeopara_Praise/Phase 1/Python Basic 1/Day14 Tasks/Task4.py
CodedLadiesInnovateTech/-python-challenge-solutions
6
35655
'''4. Write a Python program to check whether multiple variables have the same value.''' var1, var2, var3 = 20, 20, 20 if var1 == var2== var3: print("var1, var2, and var3 have the same value !")
4.0625
4
models.py
Nelestya/blog
0
35656
<filename>models.py from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.core.urlresolvers import reverse from baseapp.models import Recently # Create your models here. class PublishedManager(models.Manager): def get_queryset(self): return s...
2.296875
2
avython/console/__init__.py
avara1986/avython
0
35657
# encoding: utf-8 from __future__ import absolute_import from avython.console.main import warning_color, show_error, show_warning, check_continue, bcolors
1.046875
1
django_country/middleware.py
ColorGenomics/django-country
4
35658
# -*- coding: utf-8 -*- from . import geo class CountryMiddleware(object): """ This is a middleware that parses a request and decides which country the request came from. """ def process_request(self, request): request.COUNTRY_CODE = geo.get_country_from_request(request)
2.984375
3
scripts/multimodal_human_provider_node.py
YoanSallami/multimodal_human_provider
0
35659
<filename>scripts/multimodal_human_provider_node.py #!/usr/bin/env python # -*- coding: UTF-8 -*- import sys import rospy import re import time import numpy import argparse import math import underworlds import tf2_ros from underworlds.helpers.geometry import get_world_transform from underworlds.tools.loader import Mo...
2.234375
2
execute.py
ikeban/InvoicesSender
0
35660
import code.PdfReader as PdfReaderModule import code.ExcelReader as ExcelReader import code.TemplateParser as TemplateParser import code.PdfAnalyzer as PdfAnalyzer import code.EmailSender as EmailSender def getFileContent(fileName): read_data = "" with open(fileName, encoding="utf-8") as f: read_data =...
2.984375
3
pyclsload/__init__.py
nbdy/pyclsload
0
35661
<gh_stars>0 from importlib.util import spec_from_file_location, module_from_spec from os import listdir from os.path import join def load_cls(file_path: str, class_name: str): s = spec_from_file_location(class_name, file_path) m = module_from_spec(s) s.loader.exec_module(m) return m.__dict__[class_nam...
2.328125
2
electionleaflets/apps/constituencies/templatetags/constituency_tags.py
electionleaflets/electionleaflets
0
35662
<gh_stars>0 from django import template from django.conf import settings from leaflets.models import Leaflet from constituencies.models import Constituency register = template.Library() @register.inclusion_tag('constituencies/ordered_list.html') def constituency_list_by_count(): constituencies = Constituency.obje...
1.78125
2
kolibri_zim_plugin/views.py
endlessm/kolibri-zim-plugin
0
35663
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os import textwrap import time import bs4 from django.core.urlresolvers import get_resolver from django.http import HttpResponse from django.http import HttpResponseBadRequest from django.http i...
2
2
advanced lane tracking pipeline.py
mrpalazz/CarND-Advanced-Lane-Lines
0
35664
# -*- coding: utf-8 -*- """ Created on Wed Nov 22 21:44:55 2017 @author: Mike """ import numpy as np import cv2 import glob import pickle import matplotlib.pyplot as plt from matplotlib.pyplot import * import os from scipy import stats from moviepy.editor import VideoFileClip from IPython.display im...
2.484375
2
homeassistant/components/light/insteon_hub.py
davidedmundson/home-assistant
0
35665
""" homeassistant.components.light.insteon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Insteon Hub lights. """ from homeassistant.components.insteon_hub import INSTEON, InsteonToggleDevice def setup_platform(hass, config, add_devices, discovery_info=None): """ Sets up the Insteon Hub light platform. """ ...
1.984375
2
exercises/fit_gaussian_estimators.py
YuvalAvshalom/IML.HUJI
0
35666
from IMLearn.learners import UnivariateGaussian, MultivariateGaussian import numpy as np import plotly.graph_objects as go import plotly.io as pio pio.templates.default = "simple_white" SAMPLES_NUM = 1000 LEFT_CIRCLE = '(' RIGHT_CIRCLE = ')' COMMA = ', ' GRAPH_SIZE = 500 HEATMAP_SIZE = 700 def test_univariate_gaussi...
3.546875
4
WEEKS/CD_Sata-Structures/_RESOURCES/CODESIGNAL/digits_product.py
webdevhub42/Lambda
0
35667
<filename>WEEKS/CD_Sata-Structures/_RESOURCES/CODESIGNAL/digits_product.py def digitsProduct(product): """ Given an integer product, find the smallest positive (i.e. greater than 0) integer the product of whose digits is equal to product. If there is no such integer, return -1 instead. T...
3.96875
4
test/serial-gpu.py
ImperialCollegeLondon/software
8
35668
results = open('test-results-gpu.out', 'a') results.write('** Starting serial GPU tests **\n') try: # Fresnel #import fresnel #results.write('Fresnel version : {}\n'.format(fresnel.__version__)) #dev = fresnel.Device(mode='gpu', n=1) #results.write('Fresnel device : {}\n'.format(dev)) # H...
2.265625
2
Curso em Video/Desafio_023.py
tonmarcondes/UNIVESP
0
35669
<reponame>tonmarcondes/UNIVESP numero = input('\nInsira um numero de 0 a 9999: \n') if not numero.isnumeric(): print('Condição inválida, insira apenas números\n') elif len(numero) == 1: print('\nA unidade do número {} é {}\n'.format(numero, numero[-1])) elif len(numero) == 2: print('\nA unidade do n...
4.125
4
mayan/apps/user_management/links.py
bonitobonita24/Mayan-EDMS
343
35670
from django.utils.translation import ugettext_lazy as _ from mayan.apps.authentication.link_conditions import condition_user_is_authenticated from mayan.apps.navigation.classes import Link, Separator, Text from mayan.apps.navigation.utils import factory_condition_queryset_access from .icons import ( icon_current_...
2
2
.configs/sonatconfig.py
Armcollector/lockdown-workout
0
35671
<filename>.configs/sonatconfig.py import os import urllib.parse basedir = os.path.abspath(os.path.dirname(__file__)) if "DB_CONNECTIONSTRING" in os.environ: params = urllib.parse.quote_plus(os.environ.get("DB_CONNECTIONSTRING")) class Config(object): SECRET_KEY = os.environ.get("SECRET_KEY") or "<KEY>" ...
2.046875
2
hier/search.py
ruslan-ok/ServerApps
1
35672
from django.utils.translation import gettext_lazy as _, gettext from .utils import get_main_menu_item, APPS ENTITIES = { 'apart': ('apart', 'apartment'), 'meter': ('meters data', 'execute'), 'bill': ('bill', 'cost'), 'service': ('service', 'key'), 'price': ('tari...
2.015625
2
utils/asyncTable.py
jiafangjun/DD_KaoRou
108
35673
<reponame>jiafangjun/DD_KaoRou #!/usr/bin/python3 # -*- coding: utf-8 -*- import time from PySide2.QtWidgets import QWidget, QMainWindow, QGridLayout, QFileDialog, QToolBar,\ QAction, QDialog, QStyle, QSlider, QLabel, QPushButton, QStackedWidget, QHBoxLayout,\ QLineEdit, QTableWidget, QAbstractIt...
2.078125
2
pyuvdata/uvdata/uvdata.py
e-koch/pyuvdata
0
35674
<reponame>e-koch/pyuvdata # -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Primary container for radio interferometer datasets.""" import os import copy from collections.abc import Iterable import warnings import threading import nu...
2.5
2
30.strings/16.replace.py
robinson-1985/python-zero-dnc
0
35675
# 15. replace() -> Altera determinado valor de uma string por outro. Troca uma string por outra. texto = 'vou Treinar todo Dia Python' print(texto.replace('vou','Vamos')) print(texto.replace('Python','Algoritmos'))
3.90625
4
Aula 13/ex049P.py
alaanlimaa/Python_CVM1-2-3
0
35676
'''Refaça o DESAFIO 9, mostrando a tabuada de um número que o usuário escolher, só que agora utilizando um laço for.''' #RESOLUÇÃO ALAN '''mult = int(input(' Digite um número para ver sua tabuada: ')) for num in range(1, 11): rest = num * mult print('{} X {} = {} '. format(num, mult, rest))''' #RESOLUÇÃO PROF...
3.96875
4
saleor/api/purchase/serializers.py
glosoftgroup/glosoftgroup-django-pos
2
35677
from django.utils.formats import localize from rest_framework.serializers import ( ModelSerializer, HyperlinkedIdentityField, SerializerMethodField, ValidationError, ) from rest_framework import serializers from django.contrib.auth import ...
1.976563
2
beautiful_fields/templatetags/beautiful_fields_tags.py
Excentrics/beautiful-fields
0
35678
<filename>beautiful_fields/templatetags/beautiful_fields_tags.py<gh_stars>0 from django import template register = template.Library() @register.filter def fast_floatformat(number, places=-1, use_thousand_separator=False): """simple_floatformat(number:object, places:int) -> str Like django.template.defaul...
2.59375
3
tools/collect_bot_info.py
Dalanar/DotA2DraftBot
1
35679
import vdf implemented_bots = set([ 'npc_dota_hero_axe', 'npc_dota_hero_bane', 'npc_dota_hero_bounty_hunter', 'npc_dota_hero_bloodseeker', 'npc_dota_hero_bristleback', 'npc_dota_hero_chaos_knight', 'npc_dota_hero_crystal_maiden', 'npc_dota_hero_dazzle', 'npc_dota_hero_death...
1.140625
1
maigret/__main__.py
noi4eg/maigret
1,156
35680
<gh_stars>1000+ #! /usr/bin/env python3 """ Maigret entrypoint """ import asyncio from .maigret import main if __name__ == "__main__": asyncio.run(main())
1.351563
1
9_POO/generadorPassword/venv/lib/python3.9/site-packages/egcd/__init__.py
igijon/sge_2022
0
35681
<gh_stars>0 """Allow users to access the function directly.""" from egcd.egcd import egcd
1.203125
1
externals/libbot/bot2-procman/python/src/bot_procman/sheriff_config.py
ericmanzi/double_pendulum_lqr
0
35682
<filename>externals/libbot/bot2-procman/python/src/bot_procman/sheriff_config.py TokIdentifier = "Identifier" TokOpenStruct = "OpenStruct" TokCloseStruct = "CloseStruct" TokAssign = "Assign" TokEndStatement = "EndStatement" TokString = "String" TokEOF = "EOF" TokComment = "Comment" TokInteger = "Integer" class Token(o...
2.578125
3
tests/test_page_objects.py
rinkky/page-objects
97
35683
import inspect try: from unittest import mock except ImportError: import mock import pytest from selenium.webdriver.common.by import By from selenium.webdriver.remote.webdriver import WebDriver, WebElement from selenium.common.exceptions import NoSuchElementException from page_objects import PageObject, Pag...
2.5625
3
flaskr/views/user_profile.py
qbbr/blog-backend-flask
0
35684
<reponame>qbbr/blog-backend-flask from flask import Blueprint, jsonify, request from flask_jwt_extended import jwt_required, get_jwt_identity from marshmallow import ValidationError from flaskr import db from flaskr.helpers import error_bad_request, error_validation from flaskr.models import User from flaskr.schemas i...
2.40625
2
pointerTable.py
dragonc0/LADXR
0
35685
import copy import struct class PointerTable: END_OF_DATA = (0xff, ) """ Class to manage a list of pointers to data objects Can rewrite the rom to modify the data objects and still keep the pointers intact. """ def __init__(self, rom, info): assert "count" in info ...
3.171875
3
userbot/modules/spam_protect.py
TAMILVIP007/javes-3.0
1
35686
#Telegram @javes05 import spamwatch, os, asyncio from telethon import events from userbot import client as javes, JAVES_NAME, JAVES_MSG JAVES_NNAME = str(JAVES_NAME) if JAVES_NAME else str(JAVES_MSG) swapi = os.environ.get("SPAMWATCH_API_KEY", None) SPAM_PROTECT = os.environ.get("SPAM_PROTECT", None) SPAMWATCH_SHOUT...
2.0625
2
populate_app_db.py
nshams365/item-catalog
0
35687
<reponame>nshams365/item-catalog from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from setup_app_db import Title, User, Base engine = create_engine('sqlite:///book_catalog.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() # Create d...
2.921875
3
coupon/logger.py
thewizardplusplus/coupon
0
35688
<filename>coupon/logger.py import logging import termcolor class Formatter(logging.Formatter): _LEVELS_COLORS = { '[INFO]': 'green', '[WARNING]': 'yellow', '[ERROR]': 'red', } def format(self, record): message = super().format(record) for level, color in self._LEVE...
2.59375
3
autonomia/features/weather.py
jamesperes/autonomiaBot
8
35689
import json from urllib import parse, request from telegram.ext import CallbackContext, CommandHandler from telegram.update import Update from autonomia.core import bot_handler BASE_URL = "https://query.yahooapis.com/v1/public/yql?" def _get_weather_info(location): query = ( "select * from weather.fore...
2.734375
3
21-fs-ias-lec/13-RaptorCode/src/decoder.py
Kyrus1999/BACnet
8
35690
<reponame>Kyrus1999/BACnet import numpy as np import utils from utils import NUMBER_OF_ENCODED_BITS, VECTORLENGTH, Z, TransmissionPackage class Decoder: def __init__(self): self._inputData = [] # [(informationID, [[(a, y)]] )] <-- Format, place in second Array is chunkID self._decodedData = [] ...
2.71875
3
sleepcounter/hardware_a/mocks.py
daveshed/sleepcounter-hardware-a
0
35691
"""Mock hardware implementation""" import logging from stage import exceptions from unittest.mock import Mock LOGGER = logging.getLogger("mock") class MockStage: """A mock implemenation of a stepper motor driven linear stage""" MAX_POS = 100 MIN_POS = 0 def __init__(self): self._position = _...
3.21875
3
my_work/ch2_lists_and_pointer_structures/singly_linked_lists.py
gabrielavirna/PythonDataStructuresAndAlgorithms
1
35692
<reponame>gabrielavirna/PythonDataStructuresAndAlgorithms<filename>my_work/ch2_lists_and_pointer_structures/singly_linked_lists.py """ Singly linked lists ------------------- - is a list with only 1 pointer between 2 successive nodes - It can only be traversed in a single direction: from the 1st node in the list to the...
4.125
4
codechef/FLOW004.py
andraantariksa/code-exercise-answer
1
35693
<filename>codechef/FLOW004.py<gh_stars>1-10 for _ in range(int(input())): n = input() print(int(n[0])+int(n[-1]))
3
3
clouds/experiments/__init__.py
jchen42703/reproducing-cloud-3rd-place
1
35694
<reponame>jchen42703/reproducing-cloud-3rd-place from .utils import get_train_transforms, get_val_transforms, \ get_preprocessing, seed_everything from .train_2d import TrainSegExperiment from .infer import GeneralInferExperiment
0.898438
1
FORTRAN/bardell/linear_buckling_cpanel/verification_cpanel.py
mrosemeier/compmech
4
35695
from compmech.stiffpanelbay import StiffPanelBay spb = StiffPanelBay() spb.a = 2. spb.b = 1. spb.r = 2. spb.stack = [0, 90, 90, 0, -45, +45] spb.plyt = 1e-3*0.125 spb.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9) spb.model = 'cpanel_clt_donnell_bardell' spb.m = 15 spb.n = 16 spb.u1tx = 0. spb.u1rx = 1. spb...
1.625
2
test/unittests/analysis/mri/test_base.py
monashbiomedicalimaging/nianalysis
2
35696
<gh_stars>1-10 from banana.analysis.mri.base import MriAnalysis from banana.utils.testing import AnalysisTester, PipelineTester, TEST_CACHE_DIR from banana import FilesetFilter from arcana.repository.xnat import XnatRepo class TestMriBaseDefault(AnalysisTester): analysis_class = MriAnalysis parameters = {'mn...
2.046875
2
python/my_first_module/my_email.py
kimkh0930/python_practice
0
35697
class Email: def __init__(self): self.from_email = '' self.to_email = '' self.subject = '' self.contents = '' def send_mail(self): print('From: '+ self.from_email) print('To: '+ self.to_email) print('Subject: '+ self.subject) print('Contents: '+ s...
3.46875
3
crypto/classic/subst/vigenere.py
jrlambea/ctf_tools
0
35698
<reponame>jrlambea/ctf_tools #!/usr/bin/env python3 __author__ = "<NAME>" __copyright__ = "Copyright 2015" __credits__ = ["<NAME>"] __license__ = "GPL" __version__ = "1.0.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "" import sys import argparse def main(): parser = argparse.ArgumentParser() pa...
3.21875
3
pip/toto/models/common.py
team-ferret/pip-toto
1
35699
""" <Program Name> common.py <Author> <NAME> <<EMAIL>> <NAME> <<EMAIL>> <Started> Sep 23, 2016 <Copyright> See LICENSE for licensing information. <Purpose> Provides base classes for various classes in the model. <Classes> Metablock: pretty printed canonical JSON representation and dump Signa...
2.421875
2