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 |
|---|---|---|---|---|---|---|
phantomapp/migrations/0009_order_orderproduct.py | t7hm1/My-django-project | 5 | 32800 | # Generated by Django 2.1 on 2018-09-06 02:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('phantomapp', '0008_auto_20180904_2102'),
]
operations = [
migrations.CreateModel(
name='Order',
... | 1.875 | 2 |
aiohttp_devtools/start/__init__.py | antonmyronyuk/aiohttp-devtools | 2 | 32801 | <reponame>antonmyronyuk/aiohttp-devtools<filename>aiohttp_devtools/start/__init__.py<gh_stars>1-10
# flake8: noqa
from .main import DatabaseChoice, ExampleChoice, SessionChoices, StartProject, TemplateChoice
| 1.1875 | 1 |
epmclib/getPMID.py | tarrow/epmclib | 2 | 32802 | <gh_stars>1-10
from . getID import getID
class getPMID(getID):
"""Add the correct query string to only search for PMIDs"""
def __init__(self, id):
self.query = 'ext_id:' + id + ' src:med'
| 2.09375 | 2 |
test/test_levelsymmetric.py | camminady/sphericalquadpy | 1 | 32803 | from sphericalquadpy.levelsymmetric.levelsymmetric import Levelsymmetric
import pytest
def test_levelsymmetric():
Q = Levelsymmetric(order=4)
assert Q.name() == "Levelsymmetric Quadrature"
assert Q.getmaximalorder() == 20
with pytest.raises(Exception):
_ = Levelsymmetric(order=-10)
Q =... | 2.328125 | 2 |
skinport/enums.py | PaxxPatriot/skinport.py | 0 | 32804 | """
MIT License
Copyright (c) 2022 PaxxPatriot
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, modify, merge, publish, d... | 2.328125 | 2 |
lib/mcapi.py | RalphORama/MCPerms | 3 | 32805 | <gh_stars>1-10
from requests import get
from json import loads
from time import time
from uuid import UUID
def username_to_uuid(username, when=int(time())):
url = 'https://api.mojang.com/users/profiles/minecraft/{}?at={}'
r = get(url.format(username, when))
if r.status_code == 200:
data = loads(... | 2.875 | 3 |
src/dictionaries/generic_subjects.py | FNClassificator/FNC-classificators | 0 | 32806 | GENERIC = [
'Half of US adults have had family jailed',
'Judge stopped me winning election',
'Stock markets stabilise after earlier sell-off'
]
NON_GENERIC = [
'Leicester helicopter rotor controls failed',
'Pizza Express founder <NAME> dies aged 89',
'Senior Tory suggests vote could be delayed... | 1.1875 | 1 |
tests/testPublishedServices.py | mapledyne/skytap | 3 | 32807 | <reponame>mapledyne/skytap
"""Test Skytap published services API access."""
import json
import os
import time
import sys
sys.path.append('..')
from skytap.Environments import Environments # noqa
from skytap.framework.ApiClient import ApiClient # noqa
environments = Environments()
def test_ps_values():
"""Ensu... | 1.804688 | 2 |
Python3/0828-Count-Unique-Characters-of-All-Substrings-of-a-Given-String/soln-1.py | wyaadarsh/LeetCode-Solutions | 5 | 32808 | <filename>Python3/0828-Count-Unique-Characters-of-All-Substrings-of-a-Given-String/soln-1.py
class Solution:
def uniqueLetterString(self, S: str) -> int:
idxes = {ch : (-1, -1) for ch in string.ascii_uppercase}
ans = 0
for idx, ch in enumerate(S):
i, j = idxes[ch]
ans... | 3.65625 | 4 |
pythonDesafios/desafio031.py | mateusdev7/desafios-python | 0 | 32809 | from time import sleep
print('-=-' * 15)
print('Iremos calcular o preço da sua viagem (R$)')
print('-=-' * 15)
distancia = float(input('Qual a distância da viagem?\n>'))
print('CALCULANDO...')
sleep(2)
if distancia <= 200:
preco = distancia * 0.50
print(f'O preço da sua viagem vai custar R${preco:.2f}')
else:... | 3.765625 | 4 |
backend/saas_framework/sharing/views.py | snarayanank2/django-workspaces | 1 | 32810 | <filename>backend/saas_framework/sharing/views.py
import logging
from rest_framework import viewsets
from saas_framework.sharing.models import Sharing
from saas_framework.sharing.serializers import SharingSerializer
logger = logging.getLogger(__name__)
class SharingViewSet(viewsets.ModelViewSet):
queryset = Shar... | 1.734375 | 2 |
meridian/acupoints/yifeng41.py | sinotradition/meridian | 5 | 32811 | #!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'yìfēng'
CN=u'翳风'
NAME=u'yifeng41'
CHANNEL='sanjiao'
CHANNEL_FULLNAME='SanjiaoChannelofHand-Shaoyang'
SEQ='SJ17'
if __name__ == '__main__':
pass
| 1.203125 | 1 |
Entities/ImageAnotation.py | mylenefarias/360RAT | 0 | 32812 | class Image_Anotation:
def __init__(self, id, image, path_image):
self.id = id
self.FOV = [0.30,0.60]
self.image = image
self.list_roi=[]
self.list_compose_ROI=[]
self.id_roi=0
self.path_image = path_image
def set_image(self, image):
self.imag... | 2.671875 | 3 |
qubeInfraSight/projectoffice/apps.py | debaleena2019/QubInfraInsight | 1 | 32813 | from django.apps import AppConfig
class ProjectofficeConfig(AppConfig):
name = 'projectoffice'
| 1.109375 | 1 |
object_detection/realtime_detection.py | pcrete/humanet | 7 | 32814 | <filename>object_detection/realtime_detection.py
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
import cv2
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
sys.path.in... | 2.171875 | 2 |
stupidV2.py | Devansh-ops/HashCode2021 | 0 | 32815 | <reponame>Devansh-ops/HashCode2021<filename>stupidV2.py
# Hashcode 2021
# <NAME>
# Problem - Traffic Signaling
## Data Containers
class Street:
def __init__(self,start,end,name,L):
self.start = start
self.end = end
self.name = name
self.time = L
def show(self):
print(self.start,self.end,sel... | 3.734375 | 4 |
notebooks/uplifts/dea_383.py | NHSDigital/medicines-text-mining-tool | 1 | 32816 | <reponame>NHSDigital/medicines-text-mining-tool
# Databricks notebook source
# MAGIC %run ../_modules/epma_global/functions
# COMMAND ----------
# MAGIC %run ../_modules/epma_global/test_helpers
# COMMAND ----------
from pyspark.sql import functions as F
# COMMAND ----------
dbutils.widgets.text('db', '', 'db')
D... | 2.296875 | 2 |
allauth/socialaccount/providers/stripe/urls.py | mina-gaid/scp | 1 | 32817 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import StripeProvider
urlpatterns = default_urlpatterns(StripeProvider)
| 1.304688 | 1 |
state-change-localization-classification/slowFast-perceiver/models/frameselection_models.py | EGO4D/hands-and-objects | 24 | 32818 | import torch
import torch.nn as nn
import torchvision.models as models
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from .build import MODEL_REGISTRY
@MODEL_REGISTRY.register()
class CNNRNN(nn.Module):
def __init__(self, cfg):
super().__init__()
input_dim = 512
... | 2.546875 | 3 |
azurelinuxagent/daemon/resourcedisk/openwrt.py | koifans/WALinuxAgent | 1 | 32819 | <gh_stars>1-10
# Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft Corporation
# Copyright 2018 Sonus Networks, Inc. (d.b.a. Ribbon Communications Operating Company)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | 1.742188 | 2 |
lib/stacks/publish_to_social/lambda/send_report.py | shaftoe/api-l3x-in | 11 | 32820 | from os import environ as env
import json
import utils
import utils.aws as aws
import utils.handlers as handlers
def put_record_to_logstream(event: utils.LambdaEvent) -> str:
"""Put a record of source Lambda execution in LogWatch Logs."""
log_group_name = env["REPORT_LOG_GROUP_NAME"]
utils.Log.info("Fet... | 2.203125 | 2 |
RAMLFlask/Server.py | nm-wu/RAMLFlask | 4 | 32821 | <reponame>nm-wu/RAMLFlask<filename>RAMLFlask/Server.py
import os
from importlib import import_module
from flask import Flask
import ConfigParser
import Printer
class Server:
def __init__(self, generator, comparison, config_file='config.ini'):
# Generator class
self.gen = generator
# Compa... | 2.265625 | 2 |
native/public/urls.py | Andrew-Chen-Wang/django-3.0-private-messaging | 1 | 32822 | <reponame>Andrew-Chen-Wang/django-3.0-private-messaging
from django.urls import path, include
from . import views
urlpatterns = [
path("", views.index, name="index"),
# Authentication
path("accounts/", include("django.contrib.auth.urls")),
path("accounts/register/", views.register, name="register"),
... | 1.851563 | 2 |
drex-atari/train.py | abalakrishna123/CoRL2019-DREX | 36 | 32823 | import os
from bc import Imitator
import numpy as np
from dataset import Example, Dataset
import utils
#from ale_wrapper import ALEInterfaceWrapper
from evaluator import Evaluator
from pdb import set_trace
import matplotlib.pyplot as plt
#try bmh
plt.style.use('bmh')
def smooth(losses, run=10):
new_losses = []
... | 2.359375 | 2 |
graphgallery/utils/ipynb.py | EdisonLeeeee/GraphGallery | 300 | 32824 | from IPython import get_ipython
from IPython.display import display
def is_ipynb():
return type(get_ipython()).__module__.startswith('ipykernel.')
| 1.953125 | 2 |
monitoring/prober/scd/test_subscription_queries.py | rpai1/dss | 1 | 32825 | """Strategic conflict detection Subscription query tests:
- add a few Subscriptions spaced in time and footprints
- query with various combinations of arguments
"""
import datetime
from monitoring.monitorlib.infrastructure import default_scope
from monitoring.monitorlib import scd
from monitoring.monitorlib.scd ... | 2.390625 | 2 |
backend/mp/apps/questionnarie/migrations/0002_auto_20200327_1422.py | shidashui/mymp | 1 | 32826 | # Generated by Django 3.0.4 on 2020-03-27 14:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questionnarie', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='questionnaire',
name='email',
... | 1.65625 | 2 |
engine/scene.py | amirgeva/retroupy | 0 | 32827 | <gh_stars>0
from .rtree import RTree
from .utils import Point
# EXPORT
class Scene(object):
def __init__(self):
self.entities = {}
self.dynamics = set()
self.statics = set()
self.rtree = RTree()
def add(self, entity):
eid = entity.get_id()
self.entities[eid] = ... | 2.484375 | 2 |
tests/test_pages/test_views.py | wilfredinni/merken | 5 | 32828 | from django.test import TestCase, Client
from django.urls import reverse
from apps.pages.models import Page
class TestPageView(TestCase):
def setUp(self):
self.client = Client()
Page.objects.create(slug="test_slug")
def test_page_GET(self):
url = reverse("page_app:page", args=["test_... | 2.4375 | 2 |
sequal/mass_spectrometry.py | bschulzlab/glypniro | 1 | 32829 | from sequal.ion import Ion
ax = "ax"
by = "by"
cz = "cz"
# calculate non-labile modifications and yield associated transition
# For example "by" would yield a tuple of "b" and "y" transitions.
def fragment_non_labile(sequence, fragment_type):
for i in range(1, sequence.seq_length, 1):
left = Ion(sequence[... | 2.53125 | 3 |
scapula/transform/encoded_rt_to_r9.py | fengjixuchui/scapula | 7 | 32830 | <reponame>fengjixuchui/scapula<filename>scapula/transform/encoded_rt_to_r9.py
import shoulder
class EncodedRtToR9(shoulder.transform.abstract_transform.AbstractTransform):
@property
def description(self):
d = "changing src/dest register for encoded accessors from r0 to r9"
return d
def do... | 2.0625 | 2 |
model/user.py | fi-ksi/dashboard-alpha | 0 | 32831 | <reponame>fi-ksi/dashboard-alpha<gh_stars>0
import datetime
from sqlalchemy import Column, Integer, String, Boolean, Enum, Text, text
from sqlalchemy.types import TIMESTAMP
from sqlalchemy.orm import relationship
from sqlalchemy.ext.hybrid import hybrid_property
from . import Base
class User(Base):
__tablename_... | 2.25 | 2 |
order.py | bogdanmagometa/logistics-system | 0 | 32832 | """
order.py
This module contains classes needed for emulating logistics system. In particular, the following
classes are here:
Item
Vehicle
Order
Location
"""
import copy
from typing import List
class Item:
"""A class used to represent an item for logistics system.
Attributes
----------
name : str... | 4.0625 | 4 |
homeassistant/components/ripple/__init__.py | domwillcode/home-assistant | 30,023 | 32833 | <gh_stars>1000+
"""The ripple component."""
| 0.957031 | 1 |
synapse/cmds/hive.py | ackroute/synapse | 216 | 32834 | <filename>synapse/cmds/hive.py
import os
import json
import shlex
import pprint
import asyncio
import tempfile
import functools
import subprocess
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cmd as s_cmd
import synapse.lib.cli as s_cli
ListHelp = '''
Lists all the keys underneath ... | 2.375 | 2 |
bfmplot/colortools.py | benmaier/bfmplot | 3 | 32835 | """
Contains methods to convert hex colors to rgb colors
and to brighten/darken colors.
"""
import numpy as np
def h2r(_hex):
"""
Convert a hex string to an RGB-tuple.
"""
if _hex.startswith('#'):
l = _hex[1:]
else:
l = _hex
return [ a/255. for a in bytes.fromhex(l) ]
def r2h... | 4.03125 | 4 |
newscout_web/news_site/migrations/0002_auto_20190819_1230.py | rsqwerty/newscout_web | 3 | 32836 | <filename>newscout_web/news_site/migrations/0002_auto_20190819_1230.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2019-08-19 12:30
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.auth.validators
import django.core.validators
from django.db import migrations, ... | 1.648438 | 2 |
Redeye(1.1).py | AkshayraviC09YC47/R3DEY3 | 1 | 32837 | <gh_stars>1-10
#!usr/bin/env python3
import os
import requests
os.system("clear")
print("""
▒█▀▀█ █▀▀█ ▒█▀▀▄ ░░ ▒█▀▀▀ ▒█░░▒█ █▀▀█
▒█▄▄▀ ░░▀▄ ▒█░▒█ ▀▀ ▒█▀▀▀ ▒█▄▄▄█ ░░▀▄
▒█░▒█ █▄▄█ ▒█▄▄▀ ░░ ▒█▄▄▄ ░░▒█░░ █▄▄█""")
print("<---------Coded By Copycat---------->")
print("")
url = input("[+] Site Name: ")
shell_name = input("... | 2.625 | 3 |
organization/job_urls.py | opendream/asip | 0 | 32838 | <filename>organization/job_urls.py<gh_stars>0
from django.conf.urls import url, patterns
urlpatterns = patterns('organization.views',
url(r'^organization/(?P<organization_id>\d+)/job/create/$', 'job_create', name='job_create'),
url(r'^job/create/$', 'job_create_standalone', name='job_create_standalone'),
... | 1.757813 | 2 |
awards/tasks.py | fgmacedo/django-awards | 0 | 32839 | <reponame>fgmacedo/django-awards
from celery.task import Task
from ..notifications.contextmanagers import BatchNotifications
class AsyncBadgeAward(Task):
ignore_result = True
def run(self, badge, state, **kwargs):
# from celery.contrib import rdb; rdb.set_trace()
with BatchNotifications():
... | 2.03125 | 2 |
py/desispec/pipeline/tasks/psfnight.py | echaussidon/desispec | 24 | 32840 | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
from ..defs import (task_name_sep, task_state_to_int, task_int_to_state)
from ...util import option_list
from ...io import find... | 2.015625 | 2 |
octopus/config/NEO_EXPLORER.py | ZarvisD/octopus | 2 | 32841 | <reponame>ZarvisD/octopus
NEO_HOST = "seed3.neo.org"
MAINNET_HTTP_RPC_PORT = 10332
MAINNET_HTTPS_RPC_PORT = 10331
TESTNET_HTTP_RPC_PORT = 20332
TESTNET_HTTPS_RPC_PORT = 20331
| 0.875 | 1 |
Project_Euler/10_sum_primes_2000000/find_sum.py | perlygatekeeper/glowing-robot | 2 | 32842 | <reponame>perlygatekeeper/glowing-robot
#!/opt/local/bin/python
import timeit
import time
import sys
def sieveOfSundaram(n=1000):
# this version returns a dictionary for quick lookup of primes <= n
# this version returns a list for easy identification of nth prime
k = int(( n - 2 ) / 2 )
a = [0] * ( k... | 3.359375 | 3 |
public/images/articles/automate-your-style/graph.py | twolfson/twolfson.com | 10 | 32843 | # Load in our dependencies
# Forking from http://matplotlib.org/xkcd/examples/showcase/xkcd.html
from matplotlib import pyplot
import numpy
"""
Comments on PRs about style
20 | --------\
| |
| |
| |
| |
1 | \--\
0 | -------
------------------... | 2.921875 | 3 |
class1/class_1_yaml.py | daveg999/Automation_class | 0 | 32844 | import yaml
import json
yaml_list = range(5)
yaml_list.append('string1')
yaml_list.append('string2')
yaml_list.append({})
yaml_list[-1]
{}
yaml_list[-1]['critter1'] = 'hedgehog'
yaml_list[-1]['critter2'] = 'bunny'
yaml_list[-1]['dungeon_levels'] = range(5)
yaml_list.append('list_end')
with open("class1_list.yml", "w"... | 2.78125 | 3 |
ch05/first.n.squares.manual.method.py | ibiscum/Learn-Python-Programming-Third-Edition | 0 | 32845 | <gh_stars>0
# first.n.squares.manual.method.py
def get_squares_gen(n):
for x in range(n):
yield x ** 2
squares = get_squares_gen(3)
print(squares.__next__()) # prints: 0
print(squares.__next__()) # prints: 1
print(squares.__next__()) # prints: 4
# the following raises StopIteration, the generator is ex... | 3.421875 | 3 |
products/admin.py | silver-whale-enterprises-llc/amzproduzer | 1 | 32846 | <gh_stars>1-10
import csv
from django.contrib import admin
from django.forms import ModelForm
from django.http import HttpRequest
from products.models import AmazonCategory, AmazonProductListing
from products.tasks import process_inventory_upload
from products.utils import find_price_col_index, save_status, find_iden... | 2.28125 | 2 |
examples/bintree.py | jdrprod/Pym-s | 3 | 32847 | class binary_tree:
def __init__(self):
pass
class Node(binary_tree):
__field_0 : int
__field_1 : binary_tree
__field_2 : binary_tree
def __init__(self, arg_0 : int , arg_1 : binary_tree , arg_2 : binary_tree ):
self.__field_0 = arg_0
self.__field_1 = arg_1
self.__fi... | 3.5 | 4 |
python_module/sirius/utils/exceptions.py | mtaillefumier/SIRIUS | 77 | 32848 | <reponame>mtaillefumier/SIRIUS
class NotEnoughBands(Exception):
pass
| 1.101563 | 1 |
pyCLI/main.py | tillstud/spotirss | 0 | 32849 | <gh_stars>0
from pyCLI.config import Config
from pyCLI.logging import logger
def main(config: Config):
print(config.pycli_message)
logger.debug("If you enter 'pyCLI -v', you will see this message!")
| 2.296875 | 2 |
tests/Output/__init__.py | FreekDS/git-ci-analyzer | 1 | 32850 | <reponame>FreekDS/git-ci-analyzer
import pytest
from analyzer.config import LATE_MERGING, SKIP_FAILING_TESTS, SLOW_BUILD, BROKEN_RELEASE
@pytest.fixture(scope='module')
def antipattern_data_hd():
"""
Happy day antipattern data
:return: happy day antipattern data
"""
return {
LATE_MERGING: ... | 2.125 | 2 |
app/apps/taskker/migrations/0013_auto_20200703_1530.py | calinbule/taskker | 0 | 32851 | <reponame>calinbule/taskker<filename>app/apps/taskker/migrations/0013_auto_20200703_1530.py
# Generated by Django 3.0.7 on 2020-07-03 15:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taskker', '0012_auto_20200703_1529'),
]
operations = [
... | 1.320313 | 1 |
fhir/resources/specimendefinition.py | chgl/fhir.resources | 0 | 32852 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import typing
from pydantic import Field, root_validator
from pydantic.error_wrappers import ErrorWrapper, ValidationError
from... | 2.09375 | 2 |
binlin/model/syn/sympairs_newenc.py | UKPLab/inlg2019-revisiting-binlin | 1 | 32853 | import logging
from typing import Dict, List, Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from networkx import DiGraph
from torch import Tensor, nn as nn
from torch.autograd.variable import Variable
from binlin.data.ud import index_data
from binlin.model.nn_utils import get_embed_matr... | 2.34375 | 2 |
mazeChallenge/nicolovescera_tommasoromani_nicoloposta/data_analyzer.py | NicoloPosta/pybootcamp-challenges | 0 | 32854 | from plotter import load_data
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Stampa il dataframe passatogli come istogramma
def plot_coordinata(data: pd.DataFrame, coordinata: str, alpha_value=1.0, title="Grafico 1"):
data = data[[coordinata,'color']]
rosse = data[data['color'] == ... | 2.734375 | 3 |
complex_data_structure/7_map_filter_reduce.py | hardikid/learn-python | 1 | 32855 | <gh_stars>1-10
######## map
# Transform each object of list
# i.e. multiple each object by 3 in [0,1,2,3]
x = range(5)
print(list(x))
y = map(lambda x: x*3,x)
def multiply_5(num):
return num*5
print(list(y))
y = map(multiply_5,x)
print(list(y))
######## filter
# Removed items from list based on co... | 3.421875 | 3 |
venv/lib/python3.8/site-packages/ansible_collections/community/crypto/plugins/module_utils/acme/challenges.py | saeedya/docker-ansible | 0 | 32856 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright: (c) 2016 <NAME> <<EMAIL>>
# Copyright: (c) 2021 <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import base64
import ha... | 1.976563 | 2 |
example/order_scope_level/feature2/test_b.py | DevilXD/pytest-order | 41 | 32857 | import pytest
@pytest.mark.order(4)
def test_four():
pass
@pytest.mark.order(3)
def test_three():
pass
| 1.445313 | 1 |
locate_lane_lines.py | StoicLobster/Udacity-SelfDrivingCar-T1P4 | 0 | 32858 | ## This script will define the functions used in the locate lane lines pipeline
## The end of this script will process a video file to locate and plot the lane lines
import pickle
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from moviepy.editor import VideoFileClip
imp... | 2.9375 | 3 |
platforms/aws.py | HyechurnJang/c3mon | 0 | 32859 | # -*- coding: utf-8 -*-
'''
Created on 2017. 12. 22.
@author: HyechurnJang
'''
import boto3
from datetime import datetime, timedelta
class AWS:
def __init__(self):
self.ec2 = boto3.resource('ec2')
self.cw = boto3.client('cloudwatch')
def getVMs(self):
aws ... | 2.375 | 2 |
experimental/language_structure/vrnn/experiments/linear_vrnn/multiwoz_synth_bert.py | BlackHC/uncertainty-baselines | 0 | 32860 | # coding=utf-8
# Copyright 2022 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 1.734375 | 2 |
src/ufdl/json/core/filter/_FilterSpec.py | waikato-ufdl/ufdl-json-messages | 0 | 32861 | from typing import List
from wai.json.object import StrictJSONObject
from wai.json.object.property import ArrayProperty, OneOfProperty, BoolProperty
from .field import *
from .logical import *
from ._FilterExpression import FilterExpression
from ._OrderBy import OrderBy
class FilterSpec(StrictJSONObject['FilterSpec... | 2.0625 | 2 |
basecam/__init__.py | sdss/baseCam | 0 | 32862 | # encoding: utf-8
# flake8: noqa
from sdsstools import get_package_version
NAME = "sdss-basecam"
__version__ = get_package_version(__file__, "sdss-basecam") or "dev"
from .camera import *
from .events import *
from .exceptions import *
from .exposure import *
from .notifier import *
| 1.007813 | 1 |
transpose-alsaseq.py | zubilewiczm/transpose | 0 | 32863 | <filename>transpose-alsaseq.py
from transpose import *
import alsaseq
import alsamidi
import random
# Requires https://github.com/ppaez/alsaseq package.
alsaseq.client("pyTranspose", 0, 1, True)
class IntervalsGame(Game):
"""
IntervalsGame(name=None, autosave=True, **settings) : Game
A game to practice r... | 3.4375 | 3 |
condor_parser.py | ASchidler/pace17 | 1 | 32864 | import os
import sys
from collections import defaultdict
import re
import pandas as pd
import matplotlib.pyplot as plt
class InstanceResult:
"""Represents the result of one instance run"""
def __init__(self):
# General info, name of the instance, run ID, time, memory und time for reductions
se... | 2.75 | 3 |
apps/vtktools/vtkToolsGUI.py | rboman/progs | 2 | 32865 | <reponame>rboman/progs<filename>apps/vtktools/vtkToolsGUI.py
#! /usr/bin/env python3
# -*- coding: utf-8; -*-
#
# vtkToolsGUI - VTK/Tk/Python interface by RoBo - modified by vidot
# - modified by MM to create a distributable exe independent of Metafor
# jan 2019:
# F:\src\VTK-7.1.0\Wrapping\Python\vtk\tk\vtkLoadPytho... | 1.648438 | 2 |
Element.py | darinpeetz/Phase_Field | 2 | 32866 | <reponame>darinpeetz/Phase_Field
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 17 14:03:42 2018
@author: Darin
"""
import numpy as np
from matplotlib.patches import Polygon
class Element:
"""
Functions avaiable in this class
--------------------------------
__init__ : constructor
... | 2.453125 | 2 |
server/tests/test_env.py | amiralis1365/cards-game | 0 | 32867 | """Sanity test environment setup."""
import os.path
from django.conf import settings
from django.test import TestCase
class EnvTestCase(TestCase):
"""Environment test cases."""
def test_env_file_exists(self):
"""Test environment file exists."""
env_file = os.path.join(settings.DEFAULT_ENV_PA... | 2.71875 | 3 |
iglovikov_helper_functions/utils/inpainting_utils.py | AIChuY/iglovikov_helper_functions | 46 | 32868 | import math
import random
from typing import Tuple
import cv2
import numpy as np
def np_free_form_mask(
max_vertex: int, max_length: int, max_brush_width: int, max_angle: int, height: int, width: int
) -> np.ndarray:
mask = np.zeros((height, width), np.float32)
num_vertex = random.randint(0, max_vertex)... | 2.59375 | 3 |
tests/tester/test_tester.py | Rajpratik71/workload-collocation-agent | 40 | 32869 | <filename>tests/tester/test_tester.py
# Copyright (c) 2019 Intel Corporation
# 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 requir... | 1.960938 | 2 |
etl/parsers/etw/Microsoft_Windows_USB_USBHUB.py | IMULMUL/etl-parser | 104 | 32870 | <filename>etl/parsers/etw/Microsoft_Windows_USB_USBHUB.py
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-USB-USBHUB
GUID : 7426a56b-e2d5-4b30-bdef-b31815c1a74a
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CS... | 2.171875 | 2 |
tests/testapp/models/caretaker.py | BBooijLiewes/django-binder | 0 | 32871 | from django.db import models
from django.db.models import Count, F, Max
from binder.models import BinderModel
class Caretaker(BinderModel):
name = models.TextField()
last_seen = models.DateTimeField(null=True, blank=True)
# We have the ssn for each caretaker. We have to make sure that nobody can access this ssn in... | 2.4375 | 2 |
blog/2017-12-17--python-ssh-logger/scripts/create_threads.py | mpolinowski/gatsby-starter-minimal-blog | 1 | 32872 | import threading
# Create threads for each SSH connection
def create_threads(list, function):
threads = []
for ip in list:
th = threading.Thread(target = function, args = (ip,))
th.start()
threads.append(th)
for th in threads:
th.join() | 2.859375 | 3 |
generate_csv.py | KishanChandravanshi/forecast-cyclone-path | 0 | 32873 | import cv2
from darkflow.net.build import TFNet
import numpy as np
import glob
import matplotlib.pyplot as plt
options = {
'model': 'cfg/yolo-v2.cfg',
'load':8375,
'gpu':0.8,
'threshold':0.1
}
count = 1
tfnet = TFNet(options)
color = [0, 255, 0]
files_path = glob.glob('data_from_imd' + "\\*.jpg")
for file in files_path... | 2.484375 | 2 |
weibo/items.py | flyhighfairy/weibo | 1 | 32874 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class WeiboVMblogsItem(scrapy.Item):
domain = scrapy.Field()
uid = scrapy.Field()
mblog_id = scrapy.Field()
mblog_content = scrapy.Field... | 2.265625 | 2 |
examples/acoustics/vibro_acoustic3d.py | clazaro/sfepy | 1 | 32875 | r"""
Vibro-acoustic problem
3D acoustic domain with 2D perforated deforming interface.
*Master problem*: defined in 3D acoustic domain (``vibro_acoustic3d.py``)
*Slave subproblem*: 2D perforated interface (``vibro_acoustic3d_mid.py``)
Master 3D problem - find :math:`p` (acoustic pressure)
and :math:`g` (transversal... | 2.484375 | 2 |
lib/__init__.py | co9olguy/Generating-and-designing-DNA | 32 | 32876 | from .utils import *
from .models import *
from .dna import *
| 1.046875 | 1 |
src/app/forms.py | triump0870/i2a | 0 | 32877 | from django import forms
from app.models import Application, Owner, Questionnaire, Tag, Rule, TagType
from crispy_forms.bootstrap import Field
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit, ButtonHolder, Fieldset, Hidden, HTML
class ApplicationForm(forms.ModelForm):
cl... | 2.09375 | 2 |
rest_api/mongo_connect.py | pssudo/kubernetes-fastapi | 1 | 32878 | import motor.motor_asyncio
import os
mongo_server = os.environ['DB_HOST']
mongo_port = os.environ['DB_PORT']
mongo_db = os.environ['DB_NAME']
mongo_user = os.environ['DB_USER']
mongo_passwd = os.environ['DB_PASSWD']
MONGO_DETAILS = "mongodb://" + mongo_user + ":" + mongo_passwd + "@" + mongo_server + ":" + mongo_port +... | 2.03125 | 2 |
cloudmesh/pi/water.py | cloudmesh/cloudmesh.pi | 2 | 32879 | <filename>cloudmesh/pi/water.py
import time
import grovepi
class WaterSensor(object):
def __init__(self, pin=2):
"""
connect sensor to digital port. D2 is default.
:param pin: Number
"""
self.pin = pin
grovepi.pinMode(self.pin, "INPUT")
def get(self):
"... | 3.25 | 3 |
telethon/network/connection/tcpabridged.py | s3mple/Telethon | 1 | 32880 | <reponame>s3mple/Telethon
import struct
from .tcpfull import ConnectionTcpFull
class ConnectionTcpAbridged(ConnectionTcpFull):
"""
This is the mode with the lowest overhead, as it will
only require 1 byte if the packet length is less than
508 bytes (127 << 2, which is very common).
"""
async ... | 2.984375 | 3 |
app/core/tests/test_models.py | ahmedgamalmansy/recipe-app-api | 0 | 32881 | <gh_stars>0
from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
""" test create new user with an email is successful"""
email = "<EMAIL>"
password= "<PASSWORD>"
user = get_user_model().objects.create_u... | 2.96875 | 3 |
elements/light.py | partha-ghosh/pyeffects | 0 | 32882 | <gh_stars>0
import numpy as np
class Light:
_position = np.array([960, 540, 300.0, 1])
_color = np.array([255, 255, 255])
def set_position(position):
Light._position = position
def set_color(color):
Light._color = color
def get_color():
return Light._color
def get_p... | 2.6875 | 3 |
pyAI-OpenMV4/2.机器视觉/7.图片拍摄/1.普通拍摄/snapshot.py | 01studio-lab/MicroPython_Examples | 73 | 32883 | <gh_stars>10-100
# 普通拍照例程
#
# 提示: 你需要插入SD卡来运行这个例程.
#
# 你可以使用你的OpenMV设备保存图片。
#导入相关模块,pyb用于LED控制。
import sensor, image, pyb
RED_LED_PIN = 1
BLUE_LED_PIN = 3
#摄像头相关初始化
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QVGA) # or sensor.Q... | 2.703125 | 3 |
website/addons/osfstorage/settings/defaults.py | DanielSBrown/osf.io | 0 | 32884 | # encoding: utf-8
import os
from website import settings
WATERBUTLER_CREDENTIALS = {
'storage': {}
}
WATERBUTLER_SETTINGS = {
'storage': {
'provider': 'filesystem',
'folder': os.path.join(settings.BASE_PATH, 'osfstoragecache'),
}
}
WATERBUTLER_RESOURCE = 'folder'
DISK_SAVING_MODE = se... | 1.703125 | 2 |
3_dot_product.py | codeclassifiers/nnfs | 1 | 32885 | <filename>3_dot_product.py
#Example of dot product using numpy
import numpy as np
#Sample input to perceptron
inputs = [1.2, 2.2, 3.3, 2.5]
#Weights passed to perceptron
weights = [0.4,0.6,-0.7, 1.1]
#bias for a particular perceptron
bias = 2
#Take dot product between weights and input
#and add bias to the summati... | 3.90625 | 4 |
m2k/python/precision_adc_tutorial/ad7124_filters.py | mthoren-adi/education_tools | 17 | 32886 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Copyright (c) 2015-2019 Analog Devices, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... | 0.84375 | 1 |
products/forms.py | NewtonHead/e-commerce_project | 0 | 32887 | <gh_stars>0
from django import forms
from .models import Product, Category
from mptt.forms import TreeNodeChoiceField
from django.forms.fields import ImageField
class ProductForm(forms.Form):
title = forms.CharField(
label='',
widget=forms.TextInput(
attrs={
... | 2.25 | 2 |
adminweb/migrations/0002_alter_profissional_cep.py | FinotelliCarlos/ewipesimple-adminweb-python | 1 | 32888 | # Generated by Django 3.2 on 2021-06-16 16:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adminweb', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profissional',
name='cep',
... | 1.40625 | 1 |
ios/serializers.py | NadavK/djhome | 0 | 32889 | from .models import Input, Output, InputToOutput, Device
from rest_framework import serializers
from taggit_serializer.serializers import (TagListSerializerField, TaggitSerializer)
from taggit.models import Tag
class DeviceSerializer(serializers.ModelSerializer):
class Meta:
model = Device
fields ... | 2.125 | 2 |
bin/clicker.py | Martincic/click-automatizer | 1 | 32890 | <filename>bin/clicker.py
from threading import Thread
from time import sleep
import win32api, win32con
import pyautogui
import keyboard
import os
def clickPositions(all_positions, repeat, timeout):
#Activate safety killswitch
thread = Thread(target = safetyKillswitch)
thread.start()
should_repeat... | 2.9375 | 3 |
bugtests/test256.py | doom38/jython_v2.2.1 | 0 | 32891 | """
"""
import support
support.compileJPythonc("test256a.py", core=1, jar="test256.jar", output="test256.err")
#raise support.TestError("" + `x`)
| 1.804688 | 2 |
cruft/_commands/utils/cruft.py | timothycrosley/cruft | 87 | 32892 | import json
from pathlib import Path
from typing import Any, Dict
from git import Repo
from cruft.exceptions import CruftAlreadyPresent, NoCruftFound
CruftState = Dict[str, Any]
#######################
# Cruft related utils #
#######################
def get_cruft_file(project_dir_path: Path, exists: bool = True)... | 2.40625 | 2 |
src/_repobee/main.py | tohanss/repobee | 0 | 32893 | """Main entrypoint for the repobee CLI application.
.. module:: main
:synopsis: Main entrypoint for the repobee CLI application.
.. moduleauthor:: <NAME>
"""
import argparse
import contextlib
import io
import logging
import os
import pathlib
import sys
from typing import List, Optional, Union, Mapping
from types... | 1.921875 | 2 |
tests/config.py | kokokuo/auto_send_email | 1 | 32894 | <reponame>kokokuo/auto_send_email
from enum import Enum
class TestCommonConfig(object):
LOGGER_NAME = "testing-logger"
SHEET_TEST_DIRNAME = "sheets"
EMAIL_TEMPLATE_TEST_DIRNAME = "templates"
class TestSheetColHeader(Enum):
"""
TestEnHeader.xlsx 與 TestCnHeader.xlsx 的 Column 標頭定義,差異為英文跟中文
"""
... | 2.765625 | 3 |
keystone/assignment/role_backends/ldap.py | yanheven/keystone | 0 | 32895 | <reponame>yanheven/keystone
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 1.882813 | 2 |
backend/apps/volontulo/templatetags/labeled_status.py | magul/volontulo | 16 | 32896 | <reponame>magul/volontulo
# -*- coding: utf-8 -*-
u"""
.. module:: labeled_status
"""
from django import template
from apps.volontulo.utils import OFFERS_STATUSES
register = template.Library()
@register.filter(name='human')
def human(status):
u"""Get offer status description.
:param status: string Statu... | 1.734375 | 2 |
catapult_build/js_checks.py | tingshao/catapult | 1 | 32897 | # Copyright (c) 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 re
import eslint
from py_vulcanize import strip_js_comments
from catapult_build import parse_html
class JSChecker(object):
def __init__(sel... | 2.5625 | 3 |
care/facility/models/notification.py | gigincg/care | 189 | 32898 | import enum
from django.db import models
from care.facility.models import FacilityBaseModel
from care.users.models import User
from django.contrib.postgres.fields import JSONField
class Notification(FacilityBaseModel):
class EventType(enum.Enum):
SYSTEM_GENERATED = 50
CUSTOM_MESSAGE = 100
E... | 2.09375 | 2 |
services/startDriver.py | nayfaan/Google_rank_find | 0 | 32899 | from selenium import webdriver
from selenium import *
def start():
return webdriver.Chrome(executable_path='./services/chromedriver')
if __name__ == "__main__":
pass
| 1.679688 | 2 |