hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36bc8aa73a8f1cabd11099df50981f6ebd187753 | 151 | py | Python | seagulls-engine/src/seagulls/eventing/__init__.py | codeghetti/seagulls-py | fd406a762b63368130125547f53e30672cec6754 | [
"MIT"
] | 2 | 2021-10-17T22:06:30.000Z | 2022-02-10T03:15:56.000Z | seagulls-engine/src/seagulls/eventing/__init__.py | codeghetti/seagulls-py | fd406a762b63368130125547f53e30672cec6754 | [
"MIT"
] | 80 | 2021-10-10T23:45:30.000Z | 2022-03-24T05:18:38.000Z | seagulls-engine/src/seagulls/eventing/__init__.py | codeghetti/seagulls-py | fd406a762b63368130125547f53e30672cec6754 | [
"MIT"
] | null | null | null | from ._interfaces import EventCallbackType, EventType, IDispatchEvents
__all__ = [
"IDispatchEvents",
"EventType",
"EventCallbackType",
]
| 18.875 | 70 | 0.728477 | from ._interfaces import EventCallbackType, EventType, IDispatchEvents
__all__ = [
"IDispatchEvents",
"EventType",
"EventCallbackType",
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cc9ba850fe110e3307316eed60921aa795ab38c8 | 1,443 | py | Python | s11_exception/user_defined.py | chiehandlu/pythonlearn | 53ba8f0f8edc7df7b09b0f233d52d7145d380ec0 | [
"Apache-2.0"
] | 14 | 2017-06-27T06:20:57.000Z | 2020-03-31T11:05:16.000Z | s11_exception/user_defined.py | chiehandlu/pythonlearn | 53ba8f0f8edc7df7b09b0f233d52d7145d380ec0 | [
"Apache-2.0"
] | null | null | null | s11_exception/user_defined.py | chiehandlu/pythonlearn | 53ba8f0f8edc7df7b09b0f233d52d7145d380ec0 | [
"Apache-2.0"
] | 11 | 2017-07-19T07:09:11.000Z | 2020-12-03T19:16:35.000Z | # user defined exception
"""
Exceptions
|
--------------------------------------------
| |
Build-in Exceptions User defined Exceptions
"""
#
# >>> class CustomE... | 22.904762 | 69 | 0.568261 | # user defined exception
"""
Exceptions
|
--------------------------------------------
| |
Build-in Exceptions User defined Exceptions
"""
#
# >>> class CustomE... | 0 | 0 | 0 | 195 | 0 | 0 | 0 | 0 | 68 |
9146722cb396bc3df5b2db84f8905fbbcf01ba0b | 754 | py | Python | Exercicios/PythonExercicios/ex031 - 040/ex036.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | Exercicios/PythonExercicios/ex031 - 040/ex036.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | Exercicios/PythonExercicios/ex031 - 040/ex036.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | # APROVANDO EMPRSTIMO Escreva um programa para aprovar o emprstimo bancrio para a compra de uma casa.
# O programa vai perguntar o valor da casa, o salrio do comprador e em quantos anos ele vai pagar.
#
# Calcule o valor da prestao mensal, sabendo que ela no pode
# exceder 30% do salrio ou ento o emprstimo ser cancela... | 50.266667 | 106 | 0.717507 | # APROVANDO EMPRÉSTIMO — Escreva um programa para aprovar o empréstimo bancário para a compra de uma casa.
# O programa vai perguntar o valor da casa, o salário do comprador e em quantos anos ele vai pagar.
#
# Calcule o valor da prestação mensal, sabendo que ela não pode
# exceder 30% do salário ou então o empréstimo ... | 39 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
68738296ecb89750554f9a476220a0b429e070a3 | 1,568 | py | Python | tests/test_validators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_validators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_validators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from elmo.settings.exceptions import ValidationError
from elmo.settings.validators import is_https_url, not_null
def test_not_null_boolean():
"""Should succeed with a not None value"""
assert not_null(True) is True
assert not_null(False) is True
def test_not_null_with_string():
"""Sho... | 24.888889 | 59 | 0.700893 | import pytest
from elmo.settings.exceptions import ValidationError
from elmo.settings.validators import is_https_url, not_null
def test_not_null_boolean():
"""Should succeed with a not None value"""
assert not_null(True) is True
assert not_null(False) is True
def test_not_null_with_string():
"""Sho... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b81d65ceb6ca8ece76c3f59d1de081d6ef44cad0 | 375 | py | Python | evernote_oauth_sample/urls.py | FightingJoey/EvernoteOAuth | 5d5cac2feb924d92b222660a6e20b41b4adba0ba | [
"Apache-2.0"
] | null | null | null | evernote_oauth_sample/urls.py | FightingJoey/EvernoteOAuth | 5d5cac2feb924d92b222660a6e20b41b4adba0ba | [
"Apache-2.0"
] | null | null | null | evernote_oauth_sample/urls.py | FightingJoey/EvernoteOAuth | 5d5cac2feb924d92b222660a6e20b41b4adba0ba | [
"Apache-2.0"
] | null | null | null | from django.urls import re_path
from oauth import views as oauth_views
urlpatterns = [
re_path(r"^$", oauth_views.index, name="evernote_index"),
re_path(r"^auth/$", oauth_views.auth, name="evernote_auth"),
re_path(r"^callback/$", oauth_views.callback, name="evernote_callback"),
re_path(r"^reset/$", oau... | 41.666667 | 76 | 0.725333 | from django.urls import include, re_path
from oauth import views as oauth_views
urlpatterns = [
re_path(r"^$", oauth_views.index, name="evernote_index"),
re_path(r"^auth/$", oauth_views.auth, name="evernote_auth"),
re_path(r"^callback/$", oauth_views.callback, name="evernote_callback"),
re_path(r"^rese... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
db7c45d3e242e614455cd42a431b040662ea02b4 | 213 | py | Python | docs/__init__.py | LMSC-NTappy/PyMoDAQ | fb0916422f0fcb9660d804b8cb18ddf745a41ef1 | [
"MIT"
] | 42 | 2019-04-09T09:40:18.000Z | 2022-02-18T09:47:37.000Z | docs/__init__.py | LMSC-NTappy/PyMoDAQ | fb0916422f0fcb9660d804b8cb18ddf745a41ef1 | [
"MIT"
] | 35 | 2019-04-22T19:53:37.000Z | 2022-03-31T16:37:17.000Z | docs/__init__.py | LMSC-NTappy/PyMoDAQ | fb0916422f0fcb9660d804b8cb18ddf745a41ef1 | [
"MIT"
] | 46 | 2019-04-17T08:32:05.000Z | 2022-03-02T16:18:04.000Z | # __all__ = ["DAQ_Move", "DAQ_Navigation_Visu", "DAQ_Utils","DAQ_1DViewer"]
# from .DAQ_move import *
# from .DAQ_Navigation_Visu import *
# from .DAQ_Utils import *
| 19.363636 | 75 | 0.732394 | # __all__ = ["DAQ_Move", "DAQ_Navigation_Visu", "DAQ_Utils","DAQ_1DViewer"]
# from .DAQ_move import *
# from .DAQ_Navigation_Visu import *
# from .DAQ_Utils import *
from .DAQ_Utils.plotting.QLED import QLED
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 23 |
bfb76dd56bbe4bfd11e57ae5069fb7f5366b0599 | 642 | py | Python | examples/first_example.py | MisterBianco/riff | 25ceda3319b246a52508b71bba42c3ca43312e22 | [
"MIT"
] | null | null | null | examples/first_example.py | MisterBianco/riff | 25ceda3319b246a52508b71bba42c3ca43312e22 | [
"MIT"
] | null | null | null | examples/first_example.py | MisterBianco/riff | 25ceda3319b246a52508b71bba42c3ca43312e22 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/jacobsin/Development/python/rifflib")
import riff
# contract = riff.make_contract("contract.yml")
riff.endpoint.walker(
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provid... | 19.454545 | 98 | 0.451713 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/jacobsin/Development/python/rifflib")
import riff
# contract = riff.make_contract("contract.yml")
riff.endpoint.walker(
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provid... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d62a7cccc71bd34674485e13574adf185387bab6 | 163 | py | Python | HLTriggerOffline/SMP/python/SMPValidation_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | HLTriggerOffline/SMP/python/SMPValidation_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | HLTriggerOffline/SMP/python/SMPValidation_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
SMPValidationSequence = cms.Sequence(
hltSMPValidator
)
| 18.111111 | 54 | 0.797546 | import FWCore.ParameterSet.Config as cms
from HLTriggerOffline.SMP.hltSMPValidator_cfi import *
SMPValidationSequence = cms.Sequence(
hltSMPValidator
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 23 |
9bff9fef39675adfb373a29d0deaa26a547bac05 | 1,536 | py | Python | runtests.py | guestready/django-currencies | e41402008f50a20cf5eb859833d7825c42619c2b | [
"BSD-3-Clause"
] | 69 | 2015-01-08T09:58:56.000Z | 2021-06-16T12:48:21.000Z | runtests.py | guestready/django-currencies | e41402008f50a20cf5eb859833d7825c42619c2b | [
"BSD-3-Clause"
] | 55 | 2015-01-27T15:03:19.000Z | 2022-03-07T00:59:03.000Z | runtests.py | guestready/django-currencies | e41402008f50a20cf5eb859833d7825c42619c2b | [
"BSD-3-Clause"
] | 58 | 2015-01-06T01:57:11.000Z | 2022-02-28T19:50:43.000Z | #!/usr/bin/env python
from os import path
from django.conf import settings
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
if n... | 26.482759 | 77 | 0.575521 | #!/usr/bin/env python
import sys
from os import path
import django
from django.conf import settings, global_settings
from django.core.management import execute_from_command_line
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.mi... | 0 | 0 | 0 | 0 | 0 | 80 | 0 | 37 | 91 |
c4f6fa3b74d2181de6e58673eedb06788214f226 | 4,072 | py | Python | Class_2_HardCode.py | diptamath/CIQ-Challenge | 3cdadd1e4688744f58f7449b1b172bd4dccc6331 | [
"MIT"
] | null | null | null | Class_2_HardCode.py | diptamath/CIQ-Challenge | 3cdadd1e4688744f58f7449b1b172bd4dccc6331 | [
"MIT"
] | null | null | null | Class_2_HardCode.py | diptamath/CIQ-Challenge | 3cdadd1e4688744f58f7449b1b172bd4dccc6331 | [
"MIT"
] | 1 | 2021-03-21T07:41:30.000Z | 2021-03-21T07:41:30.000Z |
# coding: utf-8
# In[1]:
from __future__ import absolute_import, division
import gensim
from nltk.stem import PorterStemmer
ps = PorterStemmer()
from nltk.stem.lancaster import LancasterStemmer
lc = LancasterStemmer()
from nltk.stem import SnowballStemmer
sb = SnowballStemmer("english")
from nltk.stem import WordNe... | 25.772152 | 463 | 0.565324 |
# coding: utf-8
# In[1]:
from __future__ import absolute_import, division
import os
import time
import numpy as np
import pandas as pd
import gensim
from tqdm import tqdm
from nltk.stem import PorterStemmer
ps = PorterStemmer()
from nltk.stem.lancaster import LancasterStemmer
lc = LancasterStemmer()
from nltk.stem... | 0 | 0 | 0 | 0 | 0 | 1,383 | 0 | -39 | 201 |
f4a3fde574f09cda28a8817f7f28452d54ccb890 | 6,267 | py | Python | notebooks/regex_extraction.py | reaganrewop/Keyphrase_extraction_validation | bf0407bf477c89bfb449f6e1ca4a0e5a0601c97d | [
"MIT"
] | null | null | null | notebooks/regex_extraction.py | reaganrewop/Keyphrase_extraction_validation | bf0407bf477c89bfb449f6e1ca4a0e5a0601c97d | [
"MIT"
] | null | null | null | notebooks/regex_extraction.py | reaganrewop/Keyphrase_extraction_validation | bf0407bf477c89bfb449f6e1ca4a0e5a0601c97d | [
"MIT"
] | null | null | null | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python [conda env:DL-wpython3]
# language: python
# name: conda-env-DL-wpython3-py
# ---
import string
imp... | 31.97449 | 300 | 0.62135 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python [conda env:DL-wpython3]
# language: python
# name: conda-env-DL-wpython3-py
# ---
import time
impo... | 0 | 0 | 0 | 0 | 0 | 3,179 | 0 | 3 | 293 |
953960ffc84adc3d30016015a34adf364d0ca446 | 2,227 | py | Python | main.py | DudeFr0mMars/Economy-Bot | 15111eb032a03eebf9eb9a76b4377c3a6814fa98 | [
"MIT"
] | 30 | 2020-12-20T10:42:42.000Z | 2021-12-18T05:17:58.000Z | main.py | DudeFr0mMars/Economy-Bot | 15111eb032a03eebf9eb9a76b4377c3a6814fa98 | [
"MIT"
] | 11 | 2021-04-08T23:48:24.000Z | 2021-12-16T04:51:34.000Z | main.py | DudeFr0mMars/Economy-Bot | 15111eb032a03eebf9eb9a76b4377c3a6814fa98 | [
"MIT"
] | 43 | 2021-01-28T14:37:10.000Z | 2021-12-17T02:19:40.000Z | from os import listdir
import json
with open('./data.json') as f:
d1 = json.load(f)
with open('./market.json') as f:
d2 = json.load(f)
TOKEN = d1['token']
bot = Echo()
for filename in listdir("./cogs"):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
bot.load_extension("... | 25.597701 | 113 | 0.625954 | from datetime import datetime, timedelta
from os import listdir, system
import aiohttp
import discord
import json
from discord.ext import commands
from pretty_help import PrettyHelp
class Echo(commands.Bot):
def __init__(self):
self.description = """Echo - A Economy Bot"""
super().__init__(
... | 0 | 436 | 661 | 452 | 0 | 19 | 0 | 37 | 249 |
41b4693fd18fa289244d02060d677bc5ebca5209 | 2,614 | py | Python | PyimageTutorial/Module 4 Image Classification and Machine Learning/Module_4_7_Advanced_Image_Pyramid/David_4_7_2_index_features.py | wcsodw1/Computer-Vision-with-Artificial-intelligence | 1fc58466bf82c33939fae911140737a8d9681ebd | [
"MIT"
] | null | null | null | PyimageTutorial/Module 4 Image Classification and Machine Learning/Module_4_7_Advanced_Image_Pyramid/David_4_7_2_index_features.py | wcsodw1/Computer-Vision-with-Artificial-intelligence | 1fc58466bf82c33939fae911140737a8d9681ebd | [
"MIT"
] | null | null | null | PyimageTutorial/Module 4 Image Classification and Machine Learning/Module_4_7_Advanced_Image_Pyramid/David_4_7_2_index_features.py | wcsodw1/Computer-Vision-with-Artificial-intelligence | 1fc58466bf82c33939fae911140737a8d9681ebd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 13:02:47 2020
@author: user
"""
# python David_4_7_2_index_features.py --dataset output/data/training --features-db output/training_features.hdf5
# python David_4_7_2_index_features.py
# import the necessary packages
from __future__ import print_function
from pyimage... | 33.512821 | 113 | 0.757077 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 13:02:47 2020
@author: user
"""
# python David_4_7_2_index_features.py --dataset output/data/training --features-db output/training_features.hdf5
# python David_4_7_2_index_features.py
# import the necessary packages
from __future__ import print_function
from pyimage... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
589b7b1599bf21d56f84a0ca7d37adf5f0fdf3d9 | 3,247 | py | Python | hw3.py | DrawnWren/nandprogramming | ec67d1babac393c37b33012bc92aa30938367782 | [
"MIT"
] | null | null | null | hw3.py | DrawnWren/nandprogramming | ec67d1babac393c37b33012bc92aa30938367782 | [
"MIT"
] | null | null | null | hw3.py | DrawnWren/nandprogramming | ec67d1babac393c37b33012bc92aa30938367782 | [
"MIT"
] | null | null | null | """ Basic template file that you should fill in for Problem Set 3. Some util
functions are provided from the NAND notebooks online that implement some
of the NAND essentials. """
from util import EVAL
from util import NANDProgram
# TODO: Implement this function and return a string representation of its NAND
# i... | 41.101266 | 98 | 0.668309 | """ Basic template file that you should fill in for Problem Set 3. Some util
functions are provided from the NAND notebooks online that implement some
of the NAND essentials. """
from util import EVAL
from util import TRUTH
from util import NANDProgram
# TODO: Implement this function and return a string represe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 23 |
ea6c2ca88d47675d9aa8565970ee7ab5480b4ae9 | 2,320 | py | Python | Chapter10/myproject_docker/apps/movies/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 75 | 2018-12-03T02:35:29.000Z | 2021-11-08T13:13:34.000Z | Chapter10/virtualenvs/myproject_env/project/django-myproject/movies/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 3 | 2019-08-11T13:35:01.000Z | 2020-09-29T06:52:36.000Z | Chapter08/virtualenvs/myproject_env/project/django-myproject/movies/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 45 | 2018-11-03T14:03:22.000Z | 2021-08-25T07:39:33.000Z | # Generated by Django 2.1.1 on 2018-09-16 08:39
| 42.962963 | 280 | 0.515517 | # Generated by Django 2.1.1 on 2018-09-16 08:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Actor',
fields=[
('id', models.AutoField(au... | 300 | 0 | 0 | 2,106 | 0 | 0 | 0 | 19 | 46 |
4d880e3e2d2a468a977f492e0eda5c5352ab890e | 165 | py | Python | overlays/alt_s.py | werpu/emulation_tools | 8293fbf566c66362fc7238cacdea118da5b86d9d | [
"MIT"
] | null | null | null | overlays/alt_s.py | werpu/emulation_tools | 8293fbf566c66362fc7238cacdea118da5b86d9d | [
"MIT"
] | 4 | 2020-10-06T14:49:27.000Z | 2021-08-31T19:07:47.000Z | overlays/alt_s.py | werpu/emulation_tools | 8293fbf566c66362fc7238cacdea118da5b86d9d | [
"MIT"
] | null | null | null | # save snapshot
from evdev import ecodes
cfg = globals()["config"]
drv = globals()["drivers"]["keybd1"]
drv.press_keys(ecodes.KEY_LEFTALT, ecodes.KEY_S)
| 16.5 | 48 | 0.721212 | # save snapshot
from evdev import UInput, ecodes
cfg = globals()["config"]
drv = globals()["drivers"]["keybd1"]
drv.press_keys(ecodes.KEY_LEFTALT, ecodes.KEY_S)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 |
99a3846b765e385bd108d18e68d7d370aff0fbab | 951 | py | Python | src/rfdoc/rfdocapp/utils/__init__.py | elrandira/rfdoc | 23a5f510f6cd74362982253268f19700b4a1acf4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/rfdoc/rfdocapp/utils/__init__.py | elrandira/rfdoc | 23a5f510f6cd74362982253268f19700b4a1acf4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/rfdoc/rfdocapp/utils/__init__.py | elrandira/rfdoc | 23a5f510f6cd74362982253268f19700b4a1acf4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-02-01T16:08:43.000Z | 2022-02-01T16:08:43.000Z | # Copyright 2009-2013 Nokia Siemens Networks Oyj
#
# 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 ag... | 31.7 | 74 | 0.727655 | # Copyright 2009-2013 Nokia Siemens Networks Oyj
#
# 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 ag... | 0 | 0 | 0 | 0 | 0 | 224 | 0 | 39 | 92 |
fad42a2176634bf90465a537b384408b95236de7 | 637 | py | Python | algorthm/tests/test_Search.py | dinaklal/algorthm | 5adc65ba3eecb4d60b0193ff8d237828c621701b | [
"MIT"
] | 1 | 2019-08-16T10:17:56.000Z | 2019-08-16T10:17:56.000Z | algorthm/tests/test_Search.py | dinaklal/algorthm | 5adc65ba3eecb4d60b0193ff8d237828c621701b | [
"MIT"
] | 3 | 2019-08-09T13:02:21.000Z | 2019-08-13T13:35:04.000Z | algorthm/tests/test_Search.py | dinaklal/algorthm | 5adc65ba3eecb4d60b0193ff8d237828c621701b | [
"MIT"
] | 1 | 2019-08-20T10:23:24.000Z | 2019-08-20T10:23:24.000Z | import sys
sys.path.append('../')
| 22.75 | 37 | 0.621664 | import pytest
import sys
sys.path.append('../')
from search import *
def test_linearSearch():
a= linearSearch([1,3,2],2)
assert a == 2
def test_binarySearch():
a= binarySearch([1,3,2],3)
assert a == 1
def test_binarySearch_2():
a= binarySearch([1,3,2,4,5,6],4)
assert a == 4
def test_jumpSearch()... | 0 | 0 | 0 | 0 | 0 | 407 | 0 | -9 | 198 |
0f57c0b03feb328d03ec6bdf4966a6d4ecf49694 | 1,609 | py | Python | src/foreign_if/python/main/python/frovedis/dataframe/info.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/main/python/frovedis/dataframe/info.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/main/python/frovedis/dataframe/info.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
| 35.755556 | 92 | 0.715351 | #!/usr/bin/env python
from ..exrpc.rpclib import *
from ..exrpc.server import *
from ..mllib.model_util import ModelID
class df_to_sparse_info:
'''A python container for holding information related to dataframe to sparse conversion'''
def __init__(cls,info_id):
cls.__uid = info_id
def load(cls,dirname):
... | 0 | 0 | 0 | 1,461 | 0 | 0 | 0 | 31 | 90 |
b9c0f6e6f3476e8f124a63b6175df5b29e5eaadf | 655 | py | Python | recipes/migrations/0018_auto_20200912_1906.py | sh4rpy/foodgram | 4ebc9655f9a68e05ebb83e7f2f2a2e04128d6713 | [
"BSD-3-Clause"
] | null | null | null | recipes/migrations/0018_auto_20200912_1906.py | sh4rpy/foodgram | 4ebc9655f9a68e05ebb83e7f2f2a2e04128d6713 | [
"BSD-3-Clause"
] | 9 | 2021-04-08T20:01:45.000Z | 2022-03-12T00:48:46.000Z | recipes/migrations/0018_auto_20200912_1906.py | sh4rpy/foodgram | 4ebc9655f9a68e05ebb83e7f2f2a2e04128d6713 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-12 19:06
| 27.291667 | 196 | 0.60458 | # Generated by Django 3.1.1 on 2020-09-12 19:06
from django.db import migrations
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('recipes', '0017_auto_20200912_1902'),
]
operations = [
migrations.RemoveField(
model_name='recipe',
... | 38 | 0 | 0 | 496 | 0 | 0 | 0 | 23 | 68 |
ad6f36bacc15247857315b4e0c0bbba3891346ae | 14,122 | py | Python | tests/test_validate.py | vmagamedov/harness | 0e9d64295f937aa4476dbe5f084e80a3783edce7 | [
"BSD-3-Clause"
] | 6 | 2020-03-26T16:49:54.000Z | 2022-01-13T09:13:40.000Z | tests/test_validate.py | vmagamedov/harness | 0e9d64295f937aa4476dbe5f084e80a3783edce7 | [
"BSD-3-Clause"
] | 1 | 2020-03-14T16:47:51.000Z | 2020-03-14T16:47:51.000Z | tests/test_validate.py | vmagamedov/harness | 0e9d64295f937aa4476dbe5f084e80a3783edce7 | [
"BSD-3-Clause"
] | null | null | null | import re
from ipaddress import ip_address
import pytest
from harness.runtime._validate import validate, ValidationError
def test_disabled(message_type):
"""
message Message {
message Inner {
option (validate.disabled) = true;
string value = 1 [(validate.rules).string.con... | 31.382222 | 113 | 0.652599 | import re
from ipaddress import ip_address
import pytest
from harness.runtime._validate import validate, ValidationError
@pytest.fixture()
def message_type(message_types, package):
return message_types[f"{package}.Message"]
@pytest.fixture()
def timestamp_type(message_types):
return message_types["google.... | 0 | 326 | 0 | 0 | 0 | 0 | 0 | 0 | 92 |
cba4882f9db73bfaee8807536b229122656e0814 | 16,021 | py | Python | alipy/experiment/state_io.py | JlsBssmnn/ALiPy | 57f5a1e4c0252436ecf2572da6973d054807add5 | [
"BSD-3-Clause"
] | 1 | 2021-08-17T01:58:14.000Z | 2021-08-17T01:58:14.000Z | alipy/experiment/state_io.py | JlsBssmnn/ALiPy | 57f5a1e4c0252436ecf2572da6973d054807add5 | [
"BSD-3-Clause"
] | null | null | null | alipy/experiment/state_io.py | JlsBssmnn/ALiPy | 57f5a1e4c0252436ecf2572da6973d054807add5 | [
"BSD-3-Clause"
] | 1 | 2019-12-19T07:02:07.000Z | 2019-12-19T07:02:07.000Z | """
StateIO
Container to store state object.
Several useful functions are implemented in this class:
1. Saving intermediate results to files.
2. Recover workspace at any iteration (label set and unlabel set).
3. Recover workspace from the intermediate result file in case the program exits unexpectedly.
4. Gathering and... | 36.661327 | 190 | 0.603708 | """
StateIO
Container to store state object.
Several useful functions are implemented in this class:
1. Saving intermediate results to files.
2. Recover workspace at any iteration (label set and unlabel set).
3. Recover workspace from the intermediate result file in case the program exits unexpectedly.
4. Gathering and... | 4 | 417 | 0 | 12,083 | 0 | 0 | 0 | 66 | 268 |
95d77119937afbad81cc3276b13c8dbe68d86a97 | 660 | py | Python | eval/cp.py | 1asso/TOM-Net | ba13bd3f1bac0fa50c6043290691d7be5c29f777 | [
"MIT"
] | 1 | 2020-06-25T22:45:46.000Z | 2020-06-25T22:45:46.000Z | eval/cp.py | 1asso/TOM-Net | ba13bd3f1bac0fa50c6043290691d7be5c29f777 | [
"MIT"
] | null | null | null | eval/cp.py | 1asso/TOM-Net | ba13bd3f1bac0fa50c6043290691d7be5c29f777 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import glob
from shutil import copyfile
root_dir = ''
ori_dir = ''
if __name__ == '__main__':
sub_dir = [os.path.join(root_dir, name) for name in os.listdir(root_dir) if os.path.isdir(os.path.join(root_dir, name))]
rec_err = 0
rec_bg = 0
for d in sub_dir:
print(d)
input... | 21.290323 | 121 | 0.681818 | #!/usr/bin/env python3
import re
import os
import torch
import torch.nn.functional as F
import struct
import glob
from PIL import Image
import torchvision.transforms.functional as TF
from shutil import copyfile
root_dir = ''
ori_dir = ''
if __name__ == '__main__':
sub_dir = [os.path.join(root_dir, name) for name in... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 133 |
80089fb785b3a1570d67b41953f2b6e2198dc3df | 7,003 | py | Python | vap_turn_taking/backchannel.py | ErikEkstedt/vad_turn_taking | c24e0ddfe9c739328872310e56f4b8c17f82c92c | [
"MIT"
] | null | null | null | vap_turn_taking/backchannel.py | ErikEkstedt/vad_turn_taking | c24e0ddfe9c739328872310e56f4b8c17f82c92c | [
"MIT"
] | null | null | null | vap_turn_taking/backchannel.py | ErikEkstedt/vad_turn_taking | c24e0ddfe9c739328872310e56f4b8c17f82c92c | [
"MIT"
] | null | null | null | import torch
from vap_turn_taking.utils import find_island_idx_len
def find_isolated_within(vad, prefix_frames, max_duration_frames, suffix_frames):
"""
... <= prefix_frames (silence) | <= max_duration_frames (active) | <= suffix_frames (silence) ...
"""
isolated = torch.zeros_like(vad)
for b, va... | 36.857895 | 118 | 0.553049 | import torch
from vap_turn_taking.utils import find_island_idx_len
from vap_turn_taking.hold_shifts import get_dialog_states, get_last_speaker
def find_isolated_within(vad, prefix_frames, max_duration_frames, suffix_frames):
"""
... <= prefix_frames (silence) | <= max_duration_frames (active) | <= suffix_fram... | 0 | 0 | 0 | 4,812 | 0 | 0 | 0 | 54 | 45 |
f03ed12e66ae135f1cc8f9ec76a8ec9bbe0ca691 | 1,468 | py | Python | iv/Binarysearch_strings/rotated_search_array.py | iamsuman/iv | bf68d3fd45455b6041e74b09272f69503bf7a8ac | [
"MIT"
] | 2 | 2020-09-19T22:28:15.000Z | 2020-10-03T01:44:53.000Z | iv/Binarysearch_strings/rotated_search_array.py | iamsuman/iv | bf68d3fd45455b6041e74b09272f69503bf7a8ac | [
"MIT"
] | null | null | null | iv/Binarysearch_strings/rotated_search_array.py | iamsuman/iv | bf68d3fd45455b6041e74b09272f69503bf7a8ac | [
"MIT"
] | 1 | 2020-10-03T01:43:30.000Z | 2020-10-03T01:43:30.000Z |
A = [4, 5, 6, 7, 0, 1, 2, 3]
A = [0,1,2,3,4,5,6,7]
B = 4
A = [ 101, 103, 106, 109, 158, 164, 182, 187, 202, 205, 2, 3, 32, 57, 69, 74, 81, 99, 100 ]
B = 202
a = Rotated_Search()
print(a.search(A, B))
| 25.310345 | 91 | 0.44891 | class Rotated_Search():
def search(self, A, B):
n = len(A)
pivot = self.find_pivot(A, 0, n - 1)
# A = [4, 5, 6, 7, 0, 1, 2, 3]
# B = 4
# print(pivot)
if pivot == -1:
return self.binary_search(A, 0, n - 1, B)
if A[pivot] == B:
return p... | 0 | 0 | 0 | 1,242 | 0 | 0 | 0 | 0 | 22 |
5ffc54c364f831310a5bc6f460542db448a8e796 | 16,997 | py | Python | mesohops/dynamics/hops_aux.py | MesoscienceLab/mesohops | b845dc61e65af158382a47c4894c3875e05f09e1 | [
"MIT"
] | 7 | 2020-08-17T03:39:42.000Z | 2022-02-10T22:55:55.000Z | mesohops/dynamics/hops_aux.py | MesoscienceLab/mesohops | b845dc61e65af158382a47c4894c3875e05f09e1 | [
"MIT"
] | null | null | null | mesohops/dynamics/hops_aux.py | MesoscienceLab/mesohops | b845dc61e65af158382a47c4894c3875e05f09e1 | [
"MIT"
] | 1 | 2021-07-26T02:11:16.000Z | 2021-07-26T02:11:16.000Z |
__title__ = "AuxiliaryVector Class"
__author__ = "D. I. G. Bennett"
__version__ = "1.0"
| 30.735986 | 91 | 0.526681 | import numpy as np
from collections.abc import Mapping
from mesohops.util.exceptions import AuxError
from scipy.special import binom
__title__ = "AuxiliaryVector Class"
__author__ = "D. I. G. Bennett"
__version__ = "1.0"
class AuxiliaryVector(Mapping):
"""
This is a class that encodes a sparse representation... | 0 | 237 | 0 | 16,512 | 0 | 0 | 0 | 45 | 111 |
de1f45d8e5aa67310bfd559a5f88a213e3a1cf2f | 523 | py | Python | add_user.py | dev-johnlopez/offerly | 3d53e64747555318addd35b94b5674e1c3ad99d0 | [
"MIT"
] | null | null | null | add_user.py | dev-johnlopez/offerly | 3d53e64747555318addd35b94b5674e1c3ad99d0 | [
"MIT"
] | null | null | null | add_user.py | dev-johnlopez/offerly | 3d53e64747555318addd35b94b5674e1c3ad99d0 | [
"MIT"
] | null | null | null | import os
from app import create_app, db
from flask_security import SQLAlchemyUserDatastore
from flask_security.utils import encrypt_password
from app.auth.models import Role, User
# Setup Flask-Security
app = create_app()
with app.app_context():
user_datastore = SQLAlchemyUserDatastore(db, User, Role)
user_dat... | 40.230769 | 131 | 0.806883 | import os
from app import create_app, db, cli
from flask import current_app
from flask_security import Security, SQLAlchemyUserDatastore, current_user
from flask_security.utils import encrypt_password
from app.auth.models import Role, User
# Setup Flask-Security
app = create_app()
with app.app_context():
user_datas... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 37 | 22 |
7489252a415aa1b1e78068fe1fc7e8079693d7fd | 690 | py | Python | src/script.py | FabricioCrespo/fairMOT_simple | d3be761935c09a37493cb86f6bfd08504c380563 | [
"MIT"
] | 19 | 2020-07-31T07:22:32.000Z | 2022-02-28T10:00:23.000Z | src/script.py | FabricioCrespo/fairMOT_simple | d3be761935c09a37493cb86f6bfd08504c380563 | [
"MIT"
] | 7 | 2020-09-26T14:49:16.000Z | 2022-03-12T00:38:08.000Z | src/script.py | FabricioCrespo/fairMOT_simple | d3be761935c09a37493cb86f6bfd08504c380563 | [
"MIT"
] | 14 | 2020-09-11T19:39:38.000Z | 2021-10-11T12:57:55.000Z | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-mp','--model_path',help='path to model',type=str)
parser.add_argument('-vp','--video_path',help='path to the video',type=str)
parser.add_argument('-od','--output_dir',help='path to save the video',type=str)
if __name__=='__main__':
args =... | 28.75 | 80 | 0.704348 | import argparse
from track import *
parser = argparse.ArgumentParser()
parser.add_argument('-mp','--model_path',help='path to model',type=str)
parser.add_argument('-vp','--video_path',help='path to the video',type=str)
parser.add_argument('-od','--output_dir',help='path to save the video',type=str)
if __name__=='_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
2bf5f9ed6b0ed77069900efcb2b23bd2ce0282f2 | 1,921 | py | Python | python-packages/pyRiemann-0.2.2/tests/test_clustering.py | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | ee45bee6f96cdb6d91184abc16f41bba1546c943 | [
"BSD-3-Clause"
] | 2 | 2017-08-13T14:09:32.000Z | 2018-07-16T23:39:00.000Z | python-packages/pyRiemann-0.2.2/tests/test_clustering.py | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | ee45bee6f96cdb6d91184abc16f41bba1546c943 | [
"BSD-3-Clause"
] | null | null | null | python-packages/pyRiemann-0.2.2/tests/test_clustering.py | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | ee45bee6f96cdb6d91184abc16f41bba1546c943 | [
"BSD-3-Clause"
] | 2 | 2018-04-02T06:45:11.000Z | 2018-07-16T23:39:02.000Z | import numpy as np
from pyriemann.clustering import Kmeans, KmeansPerClassTransform
def generate_cov(Nt,Ne):
"""Generate a set of cavariances matrices for test purpose"""
diags = 1.0+0.1*np.random.randn(Nt,Ne)
covmats = np.empty((Nt,Ne,Ne))
for i in range(Nt):
covmats[i] = np.diag(diags[i])
... | 26.680556 | 65 | 0.647579 | import numpy as np
from pyriemann.clustering import Kmeans,KmeansPerClassTransform
def generate_cov(Nt,Ne):
"""Generate a set of cavariances matrices for test purpose"""
diags = 1.0+0.1*np.random.randn(Nt,Ne)
covmats = np.empty((Nt,Ne,Ne))
for i in range(Nt):
covmats[i] = np.diag(diags[i])
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
62b11e6c5da0cc2133a92ea451b6649128fcb41b | 51,262 | py | Python | raphael/utils/net.py | major1201/raphael | 18d7060834be7645b66144ba2a1638f3e1db2dd2 | [
"MIT"
] | null | null | null | raphael/utils/net.py | major1201/raphael | 18d7060834be7645b66144ba2a1638f3e1db2dd2 | [
"MIT"
] | null | null | null | raphael/utils/net.py | major1201/raphael | 18d7060834be7645b66144ba2a1638f3e1db2dd2 | [
"MIT"
] | null | null | null | # encoding= utf-8
from __future__ import division, absolute_import, with_statement, print_function
import requests
def download_file(url, file_path, params=None, proxies=None, request_session=None, cookies=None):
"""
proxies = {
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
... | 70.030055 | 145 | 0.635324 | # encoding= utf-8
from __future__ import division, absolute_import, with_statement, print_function
import requests
def download_file(url, file_path, params=None, proxies=None, request_session=None, cookies=None):
"""
proxies = {
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
... | 2 | 0 | 0 | 0 | 0 | 50,480 | 0 | 0 | 115 |
0096ee546ed0b0057c7f17a668314161d5695b54 | 11,196 | py | Python | astroduet/duet_telescope.py | bwgref/duet-astro | 4fe3358bb927c0f03de1b75c01ddf2379b5771b3 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T21:02:57.000Z | 2019-04-15T21:02:57.000Z | astroduet/duet_telescope.py | bwgref/duet-astro | 4fe3358bb927c0f03de1b75c01ddf2379b5771b3 | [
"BSD-3-Clause"
] | null | null | null | astroduet/duet_telescope.py | bwgref/duet-astro | 4fe3358bb927c0f03de1b75c01ddf2379b5771b3 | [
"BSD-3-Clause"
] | 1 | 2019-04-17T19:46:42.000Z | 2019-04-17T19:46:42.000Z | import os
curdir = os.path.dirname(__file__)
datadir = os.path.join(curdir, 'data')
def load_telescope_parameters(version, **kwargs):
"""
Utility script to load the telescope parameters
version = 0: Pre-design version (to compare with Rick's stuff)
version = 1: 210 mm design
version = 2: 300 mm... | 24.445415 | 87 | 0.575473 | import os
curdir = os.path.dirname(__file__)
datadir = os.path.join(curdir, 'data')
def load_telescope_parameters(version, **kwargs):
"""
Utility script to load the telescope parameters
version = 0: Pre-design version (to compare with Rick's stuff)
version = 1: 210 mm design
version = 2: 300 mm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9e39e0c0c35e473517bcf3aa9aba3fd648b29f77 | 472 | py | Python | urls.py | zachsnyder1/geopost | 067c79b24deb0b99477513c5d684f6ac92d60dbe | [
"MIT"
] | 1 | 2016-04-22T20:35:31.000Z | 2016-04-22T20:35:31.000Z | urls.py | zachsnyder1/geopost | 067c79b24deb0b99477513c5d684f6ac92d60dbe | [
"MIT"
] | null | null | null | urls.py | zachsnyder1/geopost | 067c79b24deb0b99477513c5d684f6ac92d60dbe | [
"MIT"
] | null | null | null | from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^$', views.Home.as_view(), name='geopost_home'),
re_path(r'^entry/$', views.Entry.as_view(), name='geopost_entry'),
re_path(r'^photo/(?P<entry_uuid>[0-9A-Fa-f-]+)$',
views.photo,
name="geopost_... | 36.307692 | 74 | 0.612288 | from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^$', views.Home.as_view(), name='geopost_home'),
re_path(r'^entry/$', views.Entry.as_view(), name='geopost_entry'),
re_path(r'^photo/(?P<entry_uuid>[0-9A-Fa-f-]+)$',
views.photo,
name="geopost_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2d9493708a911e3f5dcfd12ee156d4f59611ca4e | 72 | py | Python | datasette/version.py | jefftriplett/datasette | 1a30fc259205df736daf068c57a0a6ae2c21ffa9 | [
"Apache-2.0"
] | 1 | 2020-11-03T17:40:11.000Z | 2020-11-03T17:40:11.000Z | datasette/version.py | Quentinchampenois/datasette | 13d1228d80c91d382a05b1a9549ed02c300ef851 | [
"Apache-2.0"
] | null | null | null | datasette/version.py | Quentinchampenois/datasette | 13d1228d80c91d382a05b1a9549ed02c300ef851 | [
"Apache-2.0"
] | null | null | null | __version__ = "0.51.1"
__version_info__ = tuple(__version__.split("."))
| 24 | 48 | 0.722222 | __version__ = "0.51.1"
__version_info__ = tuple(__version__.split("."))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
480bbce3a19feff8809ef78418436457fe3a997c | 1,994 | py | Python | rmrb/rmrb_daemon/modules/xorg_monitor.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_daemon/modules/xorg_monitor.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_daemon/modules/xorg_monitor.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
| 23.186047 | 103 | 0.498495 | #!/usr/bin/env python
def __get_xorg_pid():
pid=-1;
try:
import os;
pid = os.popen('ps aux | grep "/usr/bin/X" | grep -v "grep" | awk \'{print $2}\'').read();
# print "__get_xorg_pid. pid:" + str(pid);
except:
pid=-1
return pid;
def __get_vlc_pid():
pid = -1;
tr... | 0 | 0 | 0 | 0 | 0 | 1,828 | 0 | 0 | 138 |
91571235a6078c3ed7b0317752d9708a8b1d8915 | 709 | py | Python | setup.py | constantinius/fabrant | c91a3594721a707a58e8fe5aa53ffbc5766c33e8 | [
"MIT"
] | null | null | null | setup.py | constantinius/fabrant | c91a3594721a707a58e8fe5aa53ffbc5766c33e8 | [
"MIT"
] | null | null | null | setup.py | constantinius/fabrant | c91a3594721a707a58e8fe5aa53ffbc5766c33e8 | [
"MIT"
] | null | null | null | from setuptools import setup
import fabrant
version = fabrant.__version__
setup(
name='fabrant',
version=version,
description="Easy handling of vagrant hosts within fabric",
long_description=open("README.rst").read(),
author='Fabian Schindler',
author_email='fabian.schindler@eox.at',
lic... | 26.259259 | 63 | 0.643159 | from setuptools import setup
import fabrant
version = fabrant.__version__
setup(
name='fabrant',
version=version,
description="Easy handling of vagrant hosts within fabric",
long_description=open("README.rst").read(),
author='Fabian Schindler',
author_email='fabian.schindler@eox.at',
lic... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
81d5d2a9dcca54b4f49a512570a95264c0ef66f2 | 6,500 | py | Python | lab06.py | ucsb-cs8-m17/lab06_starter_code | 9c91faa04399e22f79c8473823a6ab0756bf097e | [
"MIT"
] | null | null | null | lab06.py | ucsb-cs8-m17/lab06_starter_code | 9c91faa04399e22f79c8473823a6ab0756bf097e | [
"MIT"
] | null | null | null | lab06.py | ucsb-cs8-m17/lab06_starter_code | 9c91faa04399e22f79c8473823a6ab0756bf097e | [
"MIT"
] | null | null | null | # tests for lab06, UCSB, CMPSC 8, Summer 2017
# Instructor: P. Conrad
# Student(s): (insert name here)
# @@@ This next function has an error. Can you fix it?
# @@@ Hint: you might need to use the "and" or "or" keywords of python
# @@@ and modify the if test.
def notStringContainingE(word):
"""
return True when... | 28.888889 | 96 | 0.667385 | # tests for lab06, UCSB, CMPSC 8, Summer 2017
# Instructor: P. Conrad
# Student(s): (insert name here)
# @@@ This next function has an error. Can you fix it?
# @@@ Hint: you might need to use the "and" or "or" keywords of python
# @@@ and modify the if test.
def notStringContainingE(word):
"""
return True when... | 0 | 0 | 0 | 0 | 0 | 284 | 0 | 0 | 185 |
7369f037084a3962ddf0eee3df3221a505a6fe8d | 1,619 | py | Python | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | ltmakela/ITK | 21f48c6d98e21ecece09be16a747221d7094d8a9 | [
"Apache-2.0"
] | 4 | 2015-05-22T03:47:43.000Z | 2016-06-16T20:57:21.000Z | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | GEHC-Surgery/ITK | f5df62749e56c9036e5888cfed904032ba5fdfb7 | [
"Apache-2.0"
] | null | null | null | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | GEHC-Surgery/ITK | f5df62749e56c9036e5888cfed904032ba5fdfb7 | [
"Apache-2.0"
] | 9 | 2016-06-23T16:03:12.000Z | 2022-03-31T09:25:08.000Z | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | 31.134615 | 77 | 0.622607 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5f027cbb302d153a7c3344375fc208328785c24 | 145 | py | Python | 1071.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 1071.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 1071.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | x = int(input())
y = int(input())
if x > y:
x, y = y, x
soma = 0
for i in range(x+1, y, 1):
if i%2 != 0:
soma += i
print(soma) | 12.083333 | 26 | 0.448276 | x = int(input())
y = int(input())
if x > y:
x, y = y, x
soma = 0
for i in range(x+1, y, 1):
if i%2 != 0:
soma += i
print(soma) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a632fc8a11dc7f1808f06cdcb2bf2ece87cfe09f | 2,554 | py | Python | gethouse/models.py | Alvin-21/patanyumba | 4084d8b25a1685fa3a1ce8a57f782fa01bc794cb | [
"MIT"
] | null | null | null | gethouse/models.py | Alvin-21/patanyumba | 4084d8b25a1685fa3a1ce8a57f782fa01bc794cb | [
"MIT"
] | null | null | null | gethouse/models.py | Alvin-21/patanyumba | 4084d8b25a1685fa3a1ce8a57f782fa01bc794cb | [
"MIT"
] | null | null | null |
# Create your models here.
| 29.697674 | 89 | 0.667189 | from django.db import models
from cloudinary.models import CloudinaryField
from django.contrib.auth.models import User
# Create your models here.
class Amenities(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Accomodation(models.Model):
PROPERTY_... | 0 | 235 | 0 | 2,074 | 0 | 0 | 0 | 53 | 158 |
85709feb51b43f2818c30daf6bbb587cb3a6b7ce | 295 | py | Python | file-response/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | file-response/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | file-response/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | from fastapi import FastAPI
app = FastAPI()
| 24.583333 | 57 | 0.728814 | from fastapi import FastAPI
from fastapi.responses import FileResponse
app = FastAPI()
@app.get("/")
async def main():
# sending it as a attachment
# specify filename to send it as attachment
some_file_path = "dog_bgr.png"
return FileResponse(some_file_path, filename="f.png") | 0 | 184 | 0 | 0 | 0 | 0 | 0 | 21 | 45 |
ac43f58b8c8a982a75d5c10502ff59e958530ecc | 6,556 | py | Python | promt_tr/promt_tr.py | ffreemt/promt-tr-free | ff20b0f176f9611fa5a834af5aeaa9ef6ca3a3ee | [
"MIT"
] | null | null | null | promt_tr/promt_tr.py | ffreemt/promt-tr-free | ff20b0f176f9611fa5a834af5aeaa9ef6ca3a3ee | [
"MIT"
] | null | null | null | promt_tr/promt_tr.py | ffreemt/promt-tr-free | ff20b0f176f9611fa5a834af5aeaa9ef6ca3a3ee | [
"MIT"
] | null | null | null | '''
promt translate for free as in beer
'''
from typing import Any, Callable
import sys
import logging
from random import randint
# import mock
import urllib3
import requests
import coloredlogs # type: ignore
urllib3.disable_warnings()
# logging.captureWarnings(True)
# logging.getLogger('requests.packages.urllib3.c... | 27.779661 | 133 | 0.596858 | '''
promt translate for free as in beer
'''
from typing import Any, Callable, Dict, Tuple
import sys
import logging
import json
from time import time
from random import randint
import pytest # type: ignore
# import mock
import urllib3
from ratelimit import limits, sleep_and_retry # type: ignore
import requests
fro... | 0 | 3,599 | 0 | 0 | 0 | 114 | 0 | 40 | 315 |
ec66d8df79c61b3d2ed3ec367d9cc7908a22013a | 878 | py | Python | kite-go/navigation/offline/experiments/quip-issues/relevant.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 17 | 2022-01-10T11:01:50.000Z | 2022-03-25T03:21:08.000Z | kite-go/navigation/offline/experiments/quip-issues/relevant.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 1 | 2022-01-13T14:28:47.000Z | 2022-01-13T14:28:47.000Z | kite-go/navigation/offline/experiments/quip-issues/relevant.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 7 | 2022-01-07T03:58:10.000Z | 2022-03-24T07:38:20.000Z |
if __name__ == "__main__":
main()
| 25.085714 | 74 | 0.65262 | import argparse
import json
from collections import defaultdict
from typing import Dict, List
def main() -> None:
args = parse_args()
with open(args.links, "r") as fp:
links = json.load(fp)
quip_issues = make_quip_issues(links)
with open(args.relevant_issues, "w") as f:
json.dump(qui... | 0 | 0 | 0 | 0 | 0 | 673 | 0 | 6 | 157 |
33190b249bfea8e389858313a9b36fc7c3e017ce | 1,605 | py | Python | ggtools/gg/static_models.py | richannan/GGTOOLS | 7909da988d90de50c82532d97121a3fbcfc0263a | [
"MIT"
] | 22 | 2019-12-16T01:30:29.000Z | 2022-03-01T08:57:07.000Z | ggtools/gg/static_models.py | richannan/GGTOOLS | 7909da988d90de50c82532d97121a3fbcfc0263a | [
"MIT"
] | 3 | 2019-12-23T14:09:30.000Z | 2022-03-29T01:52:53.000Z | ggtools/gg/static_models.py | richannan/GGTOOLS | 7909da988d90de50c82532d97121a3fbcfc0263a | [
"MIT"
] | 13 | 2019-12-19T07:01:19.000Z | 2022-03-14T11:26:36.000Z | from os import path, makedirs
from urllib.request import urlretrieve
def static_download(model):
'''
Download static gravity modle from icgem.gfz-potsdam.de; if the file to be downloaded is already included in the download directory, the download is automatically skipped.
Usage:
static_download(... | 38.214286 | 175 | 0.688474 | from os import path,makedirs
from urllib.request import urlretrieve
def static_download(model):
'''
Download static gravity modle from icgem.gfz-potsdam.de; if the file to be downloaded is already included in the download directory, the download is automatically skipped.
Usage:
static_download('... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
5fd7c795a966a620873f6dbbef744b63cf0773db | 427 | py | Python | projects/migrations/0020_auto_20170131_0419.py | 18F/acquisitions.18f.gov | 7ef7091fd65b4b6797ddeb1c1f56def29522c43b | [
"CC0-1.0"
] | 3 | 2016-11-27T05:02:52.000Z | 2017-01-31T17:36:36.000Z | projects/migrations/0020_auto_20170131_0419.py | 18F/acquisitions.18f.gov | 7ef7091fd65b4b6797ddeb1c1f56def29522c43b | [
"CC0-1.0"
] | 61 | 2016-11-05T00:27:34.000Z | 2017-09-15T23:37:58.000Z | projects/migrations/0020_auto_20170131_0419.py | 18F/acquisitions.18f.gov | 7ef7091fd65b4b6797ddeb1c1f56def29522c43b | [
"CC0-1.0"
] | 2 | 2017-07-14T06:21:26.000Z | 2021-02-14T11:53:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-31 04:19
from __future__ import unicode_literals
| 20.333333 | 48 | 0.604215 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-31 04:19
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0019_auto_20170131_0412'),
]
operations = [
migrations.RenameField(
... | 0 | 0 | 0 | 256 | 0 | 0 | 0 | 11 | 46 |
df77b7f033135104bc001ca98a8adb61a14c3d27 | 31 | py | Python | resources/sound/__init__.py | Keshav-cs/Genetic-Algorithm-on-Super-Mario-Bros | 1a115c6b4ac3345875c8530d8a6ea044c33c403e | [
"MIT"
] | 418 | 2015-01-05T19:31:18.000Z | 2022-03-27T03:05:33.000Z | resources/sound/__init__.py | Keshav-cs/Genetic-Algorithm-on-Super-Mario-Bros | 1a115c6b4ac3345875c8530d8a6ea044c33c403e | [
"MIT"
] | 3 | 2021-04-29T19:58:05.000Z | 2021-05-01T05:15:02.000Z | resources/sound/__init__.py | Keshav-cs/Genetic-Algorithm-on-Super-Mario-Bros | 1a115c6b4ac3345875c8530d8a6ea044c33c403e | [
"MIT"
] | 157 | 2015-01-05T19:06:29.000Z | 2022-01-16T22:55:37.000Z | __author__ = 'justinarmstrong'
| 15.5 | 30 | 0.806452 | __author__ = 'justinarmstrong'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ef57af46c6b2e9ab1c578fab32e7696057a50f5d | 1,011 | py | Python | python/tests/testpickle.py | seisman/mspass | 11bd292a778a2a0d8470734239a7347fe4a1c0a7 | [
"BSD-3-Clause"
] | 1 | 2021-10-18T10:02:13.000Z | 2021-10-18T10:02:13.000Z | python/tests/testpickle.py | seisman/mspass | 11bd292a778a2a0d8470734239a7347fe4a1c0a7 | [
"BSD-3-Clause"
] | null | null | null | python/tests/testpickle.py | seisman/mspass | 11bd292a778a2a0d8470734239a7347fe4a1c0a7 | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.append('/home/pavlis/src/mspass/python')
from mspasspy.ccore import CoreSeismogram
d=CoreSeismogram(200)
d.put_double('delta',1.0)
d.put_double('dt',1.0)
d.put('npts',200)
d.ns=200
d.t0=100.0
d.live=True
from mspasspy.ccore import Seismogram
d2=Seismogram(d,'invalid')
import pickle
x=pickle.dumps(d2... | 25.275 | 56 | 0.753709 | import sys
sys.path.append('/home/pavlis/src/mspass/python')
from mspasspy.ccore import CoreSeismogram
d=CoreSeismogram(200)
d.put_double('delta',1.0)
d.put_double('dt',1.0)
d.put('npts',200)
d.ns=200
d.t0=100.0
d.live=True
from mspasspy.ccore import Seismogram
d2=Seismogram(d,'invalid')
import pickle
x=pickle.dumps(d2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c8ef1749db9bd82ca80ff83f68f94b743fdbc0d8 | 28,838 | py | Python | pipeline/slices.py | PartumSomnia/bns_ppr_tools | b02bab870bb54171bc0d0cd7e07bfb50e978e7dd | [
"MIT"
] | null | null | null | pipeline/slices.py | PartumSomnia/bns_ppr_tools | b02bab870bb54171bc0d0cd7e07bfb50e978e7dd | [
"MIT"
] | 4 | 2019-12-01T18:42:45.000Z | 2019-12-07T10:59:37.000Z | pipeline/slices.py | PartumSomnia/bns_ppr_tools | b02bab870bb54171bc0d0cd7e07bfb50e978e7dd | [
"MIT"
] | null | null | null | from __future__ import division
#from sys import path
#path.append('modules/')
import os.path
from argparse import ArgumentParser
import sys
import numpy as np
import sys
sys.path.append("..")
from uutils import Printcolor
import config as Paths
from module_slices.slices_methods import COMPUTE_STORE
__movie__ = "... | 42.59675 | 154 | 0.515396 | from __future__ import division
#from sys import path
#path.append('modules/')
import os.path
import click
import h5py
from argparse import ArgumentParser
from math import pi, log10
import sys
from scidata.utils import locate
import scidata.carpet.hdf5 as h5
from scidata.carpet.interp import Interpolator
import numpy a... | 0 | 0 | 0 | 0 | 0 | 20,890 | 0 | 176 | 316 |
02be5c99a347950f27c83cbd18c1524887f1c17e | 6,488 | py | Python | src/extract_ml_features.py | amansinha09/HSDS | dd7cab75bd79a2cec1b9278215303b5e34e58e89 | [
"MIT"
] | null | null | null | src/extract_ml_features.py | amansinha09/HSDS | dd7cab75bd79a2cec1b9278215303b5e34e58e89 | [
"MIT"
] | null | null | null | src/extract_ml_features.py | amansinha09/HSDS | dd7cab75bd79a2cec1b9278215303b5e34e58e89 | [
"MIT"
] | 1 | 2018-11-17T09:12:31.000Z | 2018-11-17T09:12:31.000Z | #extract_ml_features.py
import sys
from isc_tokenizer import Tokenizer
from isc_tagger import Tagger
#DONE
#DONE FOR WORD AND POS
#predict topic of unseen tweet using testing example based lda model built on train set
if __name__ == '__main__':
sample = ' @ & @ #'
tknzr = Tokenizer(lang='... | 31.960591 | 143 | 0.719174 | #extract_ml_features.py
import emoji, re, os, time, sys
from gensim.models import LdaModel
from gensim.corpora import MmCorpus, Dictionary
from isc_tokenizer import Tokenizer
from isc_tagger import Tagger
from tqdm import tqdm
import vocab_helpers as helper
import utils
import pre_processing as dproc
from nltk import n... | 336 | 0 | 0 | 0 | 0 | 5,258 | 0 | 71 | 266 |
4b523a47b862a5ac14fd0e2ce940728a52b0da94 | 535 | py | Python | source/chunk.py | Ryaangu/pyler | 685955088454b01f649a5de95b4b3cf6c6078db3 | [
"MIT"
] | 1 | 2020-11-05T23:36:31.000Z | 2020-11-05T23:36:31.000Z | source/chunk.py | Ryaangu/pyler | 685955088454b01f649a5de95b4b3cf6c6078db3 | [
"MIT"
] | null | null | null | source/chunk.py | Ryaangu/pyler | 685955088454b01f649a5de95b4b3cf6c6078db3 | [
"MIT"
] | 1 | 2020-11-06T12:44:21.000Z | 2020-11-06T12:44:21.000Z | # Chunk
# Write to chunk
# Add constant to chunk | 19.107143 | 43 | 0.583178 | # Chunk
class Chunk():
count = 0
constants_count = 0
code = []
lines = []
columns = []
constants = []
local_variables = []
# Write to chunk
def chunk_write(chunk, byte, line, column):
chunk.code.append(byte)
chunk.lines.append(line)
... | 0 | 0 | 0 | 168 | 0 | 251 | 0 | 0 | 66 |
0a9e811c6d130935e11801209b3068eba9b73f6d | 9,010 | py | Python | elyra/tests/pipeline/test_pipeline_parser.py | el-aasi/elyra | bd06a22c97a5e6083d5a29d88303142e826e2eab | [
"Apache-2.0"
] | 1 | 2022-02-18T14:21:33.000Z | 2022-02-18T14:21:33.000Z | elyra/tests/pipeline/test_pipeline_parser.py | el-aasi/elyra | bd06a22c97a5e6083d5a29d88303142e826e2eab | [
"Apache-2.0"
] | null | null | null | elyra/tests/pipeline/test_pipeline_parser.py | el-aasi/elyra | bd06a22c97a5e6083d5a29d88303142e826e2eab | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018-2022 Elyra 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 applicable law or agreed to in writ... | 39.004329 | 112 | 0.723085 | #
# Copyright 2018-2022 Elyra 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 applicable law or agreed to in writ... | 0 | 553 | 0 | 0 | 0 | 7,264 | 0 | 90 | 503 |
a512f5392dbace5bfc36af9bb0cb5f229444416d | 6,379 | py | Python | csv_to_coco.py | ZHUXUHAN/Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | 1 | 2019-11-20T12:16:21.000Z | 2019-11-20T12:16:21.000Z | csv_to_coco.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | csv_to_coco.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | import pandas as pd
from collections import OrderedDict
gt_data_path = "/home/priv-lab1/workspace/zxh/end2/csv/anno_box_train.csv"
hoi_list_path = "/home/priv-lab1/workspace/zxh/end2/origin_lists/hico_list_hoi.txt"
img_path = '/home/priv-lab1/workspace/zxh/My_Database/hico_20160224_det/images/train2015/' # image fold... | 39.621118 | 113 | 0.551811 | import os
import pandas as pd
from collections import OrderedDict
import cv2
import numpy as np
import json
gt_data_path = "/home/priv-lab1/workspace/zxh/end2/csv/anno_box_train.csv"
hoi_list_path = "/home/priv-lab1/workspace/zxh/end2/origin_lists/hico_list_hoi.txt"
img_path = '/home/priv-lab1/workspace/zxh/My_Databas... | 6 | 0 | 0 | 3,617 | 0 | 0 | 0 | -36 | 110 |
5889664d73c5e5d85739f1d451909c87f007011e | 3,513 | py | Python | dirutility/multiprocess.py | mrstephenneal/dirutility | c51b4c3bd543da8bb69e496d0c3ec8333897042c | [
"MIT"
] | 2 | 2018-07-27T18:34:10.000Z | 2018-10-09T21:40:34.000Z | dirutility/multiprocess.py | mrstephenneal/dirutility | c51b4c3bd543da8bb69e496d0c3ec8333897042c | [
"MIT"
] | 7 | 2018-07-27T17:29:36.000Z | 2018-10-01T13:29:52.000Z | dirutility/multiprocess.py | mrstephenneal/dirutility | c51b4c3bd543da8bb69e496d0c3ec8333897042c | [
"MIT"
] | 1 | 2019-09-26T13:04:04.000Z | 2019-09-26T13:04:04.000Z | from multiprocessing import cpu_count
from multiprocessing.pool import Pool
from tqdm import tqdm
def pool_process(func, iterable, cpus=cpu_count(), return_vals=False, cpu_reduction=0, progress_bar=False):
"""
Multiprocessing helper function for performing looped operation using multiple processors.
:par... | 36.978947 | 107 | 0.63877 | from multiprocessing import cpu_count
from multiprocessing.pool import Pool
from tqdm import tqdm
def pool_process(func, iterable, cpus=cpu_count(), return_vals=False, cpu_reduction=0, progress_bar=False):
"""
Multiprocessing helper function for performing looped operation using multiple processors.
:par... | 0 | 258 | 0 | 1,909 | 0 | 0 | 0 | 0 | 23 |
f5483164f422c3135aabb74cd6db1a01d89851f4 | 617 | py | Python | census_dp/noisy_max.py | candrsn/census-dp | a98b4bc4e03dab3c5d77723806daf387a8cbee8b | [
"MIT"
] | 13 | 2019-08-30T15:05:21.000Z | 2022-03-11T14:17:01.000Z | census_dp/noisy_max.py | chrishwiggins/census-dp | a98b4bc4e03dab3c5d77723806daf387a8cbee8b | [
"MIT"
] | 1 | 2019-08-01T16:20:58.000Z | 2019-08-01T16:20:58.000Z | census_dp/noisy_max.py | chrishwiggins/census-dp | a98b4bc4e03dab3c5d77723806daf387a8cbee8b | [
"MIT"
] | 4 | 2019-09-23T19:29:34.000Z | 2021-02-13T18:09:43.000Z | import numpy as np
from laplace import laplace_mech
def noisy_max(answers: np.ndarray, epsilon: float, sensitivity: float):
""" Implementation of the noisy max mechanism with gap using Laplace noise
Given a set of queries, this mechanism will return the **index**, not the
value, of the query that is prob... | 34.277778 | 78 | 0.721232 | import numpy as np
from laplace import laplace_mech
def noisy_max(answers: np.ndarray, epsilon: float, sensitivity: float):
""" Implementation of the noisy max mechanism with gap using Laplace noise
Given a set of queries, this mechanism will return the **index**, not the
value, of the query that is prob... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed609976d006987150b382827dca7d8b313dbdb3 | 782 | py | Python | tests/test_metric_logger.py | zhtianxiao/DLA-Combined-IoUs | 0b9db0e8e2b2927928bd57c6032497d3b87e7905 | [
"BSD-2-Clause"
] | 2 | 2022-01-27T07:08:34.000Z | 2022-03-22T03:14:11.000Z | tests/test_metric_logger.py | zhtianxiao/DLA-Combined-IoUs | 0b9db0e8e2b2927928bd57c6032497d3b87e7905 | [
"BSD-2-Clause"
] | 1 | 2022-02-04T05:38:04.000Z | 2022-02-04T05:38:04.000Z | tests/test_metric_logger.py | zhtianxiao/DLA-Combined-IoUs | 0b9db0e8e2b2927928bd57c6032497d3b87e7905 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import unittest
if __name__ == "__main__":
unittest.main()
| 25.225806 | 71 | 0.63555 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import unittest
from dynamic_atss_core.utils.metric_logger import MetricLogger
class TestMetricLogger(unittest.TestCase):
def test_update(self):
meter = MetricLogger()
for i in range(10):
meter.update(metric=float... | 0 | 0 | 0 | 557 | 0 | 0 | 0 | 41 | 46 |
a125abeb0e27dc36ea6ff47b03ac4c93aff2e032 | 2,224 | py | Python | python/run_emulator.py | LCClyde/NyraEmulationSystem | bedd164316abbe833b066e282e0de1c506d45f2b | [
"MIT"
] | null | null | null | python/run_emulator.py | LCClyde/NyraEmulationSystem | bedd164316abbe833b066e282e0de1c506d45f2b | [
"MIT"
] | 1 | 2015-05-12T11:19:58.000Z | 2015-05-12T11:19:58.000Z | python/run_emulator.py | LCClyde/NyraEmulationSystem | bedd164316abbe833b066e282e0de1c506d45f2b | [
"MIT"
] | null | null | null |
import argparse
import pygame
import sys
from nes import Controller
from screen import Screen
from fps import FPS
from tas import TAS
from emulator import Emulator
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = 'Dumps NES header information')
parser.add_argument('pathna... | 35.301587 | 94 | 0.571043 |
import argparse
import pygame
import sys
from nes import Controller
from screen import Screen
from fps import FPS
from tas import TAS
from emulator import Emulator
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = 'Dumps NES header information')
parser.add_argument('pathna... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
20454a0fbb1ea04507f12ffef3b7da1960cf9ea3 | 1,317 | py | Python | lambda_cron/cli/command/aws_lambda.py | MediaMath/lambda-cron | 2545e9fdeced7ebeaba2f98d02891cc6db7546e2 | [
"Apache-2.0"
] | 22 | 2017-10-27T11:37:58.000Z | 2021-11-09T09:35:37.000Z | lambda_cron/cli/command/aws_lambda.py | MediaMath/lambda-cron | 2545e9fdeced7ebeaba2f98d02891cc6db7546e2 | [
"Apache-2.0"
] | 1 | 2018-03-21T18:31:01.000Z | 2018-03-21T18:31:01.000Z | lambda_cron/cli/command/aws_lambda.py | MediaMath/lambda-cron | 2545e9fdeced7ebeaba2f98d02891cc6db7546e2 | [
"Apache-2.0"
] | 3 | 2017-10-27T16:49:42.000Z | 2018-11-03T04:14:10.000Z | # Copyright (C) 2016 MediaMath <http://www.mediamath.com>
#
# 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 ... | 38.735294 | 145 | 0.675778 | # Copyright (C) 2016 MediaMath <http://www.mediamath.com>
#
# 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 ... | 0 | 0 | 0 | 635 | 0 | 0 | 0 | -9 | 90 |
f42c02c0c9b6c0a562b01ec9dc5934ca6fed0f1a | 4,602 | py | Python | geoportal/geoportailv3_geoportal/views/casipo.py | Geoportail-Luxembourg/geoportailv3 | a3797a426e263683cdebe371753e655604789474 | [
"MIT"
] | 17 | 2015-01-14T08:40:22.000Z | 2021-05-08T04:39:50.000Z | geoportal/geoportailv3_geoportal/views/casipo.py | Geoportail-Luxembourg/geoportailv3 | a3797a426e263683cdebe371753e655604789474 | [
"MIT"
] | 1,477 | 2015-01-05T09:58:41.000Z | 2022-03-18T11:07:09.000Z | geoportal/geoportailv3_geoportal/views/casipo.py | Geoportail-Luxembourg/geoportailv3 | a3797a426e263683cdebe371753e655604789474 | [
"MIT"
] | 14 | 2015-07-24T07:33:13.000Z | 2021-03-02T13:51:48.000Z | # -*- coding: UTF-8 -*-
from pyramid.i18n import TranslationStringFactory
import logging
_ = TranslationStringFactory("geoportailv3_geoportal-server")
log = logging.getLogger(__name__)
| 37.112903 | 215 | 0.590613 | # -*- coding: UTF-8 -*-
from pyramid.i18n import get_localizer, TranslationStringFactory
from pyramid.view import view_config
from pyramid.response import Response
from c2cgeoportal_commons.models import DBSessions, DBSession
import logging
import owncloud
import shutil
import os
import smtplib
import urllib.request
f... | 3 | 748 | 0 | 3,338 | 0 | 0 | 0 | 41 | 287 |
cf51cf919c2dc41e8d41e4fd269be21fec666712 | 718 | py | Python | agent/lm_agent/exceptions.py | omnivector-solutions/license-manager | 9eb1e4569d692aef83a2388096e7413bc010be61 | [
"MIT"
] | 2 | 2020-11-15T22:54:39.000Z | 2022-02-15T07:58:55.000Z | agent/lm_agent/exceptions.py | omnivector-solutions/license-manager | 9eb1e4569d692aef83a2388096e7413bc010be61 | [
"MIT"
] | 2 | 2022-02-18T19:36:45.000Z | 2022-03-16T23:07:44.000Z | agent/lm_agent/exceptions.py | omnivector-solutions/license-manager | 9eb1e4569d692aef83a2388096e7413bc010be61 | [
"MIT"
] | null | null | null | """
Custom exceptions for the License Manager Agent.
"""
| 23.933333 | 71 | 0.764624 | """
Custom exceptions for the License Manager Agent.
"""
from buzz import Buzz
class LicenseManagerAuthTokenError(Buzz):
"""Exception for backend connection issues."""
class LicenseManagerBackendConnectionError(Buzz):
"""Exception for backend connection issues."""
class LicenseManagerBackendVersionError(... | 0 | 0 | 0 | 494 | 0 | 0 | 0 | 0 | 161 |
322a0b56205aca331aa6de77b96b5abea4e23791 | 486 | py | Python | codes_/0209_Minimum_Size_Subarray_Sum.py | SaitoTsutomu/leetcode | 4656d66ab721a5c7bc59890db9a2331c6823b2bf | [
"MIT"
] | null | null | null | codes_/0209_Minimum_Size_Subarray_Sum.py | SaitoTsutomu/leetcode | 4656d66ab721a5c7bc59890db9a2331c6823b2bf | [
"MIT"
] | null | null | null | codes_/0209_Minimum_Size_Subarray_Sum.py | SaitoTsutomu/leetcode | 4656d66ab721a5c7bc59890db9a2331c6823b2bf | [
"MIT"
] | null | null | null | # %% [209. Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)
| 37.384615 | 95 | 0.442387 | # %% [209. Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)
class Solution:
def minSubArrayLen(self, s: int, nums: List[int]) -> int:
p1, p2, sm, mn = 0, -1, 0, -1
while sm >= s or p2 < len(nums) - 1:
if sm < s:
sm += nums[(p2 := p2 + 1... | 0 | 0 | 0 | 368 | 0 | 0 | 0 | 0 | 22 |
a984bcf3192606be4e00f7ce2c78e708bba3758c | 8,858 | py | Python | tools/model_test.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | tools/model_test.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | tools/model_test.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
if __name__ == '__main__':
main()
| 38.017167 | 113 | 0.687175 | import argparse
import datetime
import glob
import os
from pathlib import Path
from test import repeat_eval_ckpt
import tqdm
import torch
import torch.distributed as dist
import torch.nn as nn
from tensorboardX import SummaryWriter
from pcdet.config import cfg, cfg_from_list, cfg_from_yaml_file, log_config_to_file
fr... | 0 | 0 | 0 | 0 | 0 | 8,181 | 0 | 174 | 424 |
78f829f3996b17988d65cadef8296a5ba880a14e | 18,198 | py | Python | upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py | TinkerEdgeR-Android/external_parameter-framework | 108db75a59dbea562ac4bcaf8c6cc862c4919af0 | [
"BSD-3-Clause"
] | null | null | null | upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py | TinkerEdgeR-Android/external_parameter-framework | 108db75a59dbea562ac4bcaf8c6cc862c4919af0 | [
"BSD-3-Clause"
] | null | null | null | upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py | TinkerEdgeR-Android/external_parameter-framework | 108db75a59dbea562ac4bcaf8c6cc862c4919af0 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | 60.66 | 138 | 0.477415 | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | 0 | 0 | 0 | 16,429 | 0 | 0 | 0 | 20 | 89 |
4a3369cabd1ff491008878d6ff102afb077304b4 | 5,180 | py | Python | predict_gender.py | chenjianxiong/coding_contest_2018 | 69687b73d4448a6cadf6130f462e9bdca2f20bc9 | [
"MIT"
] | null | null | null | predict_gender.py | chenjianxiong/coding_contest_2018 | 69687b73d4448a6cadf6130f462e9bdca2f20bc9 | [
"MIT"
] | null | null | null | predict_gender.py | chenjianxiong/coding_contest_2018 | 69687b73d4448a6cadf6130f462e9bdca2f20bc9 | [
"MIT"
] | null | null | null | import numpy as np
if __name__ == "__main__":
# We're using 70% of the data for training
TRAIN_SPLIT = 0.8
GENDER_MALE = 1
GENDER_FEMALE = 0
alpha = 0.54
X_train = None
Y_train = None
X_validation = None
Y_validation = None
X_test = None
Y_test = None
Best_theta... | 25.771144 | 93 | 0.547876 | import sys
import math
import numpy as np
def features(name):
name = name.lower()
return {
'first-letter': name[0], # First letter
'first2-letters': name[0:2], # First 2 letters
'first3-letters': name[0:3], # First 3 letters
'last-letter': name[-1],
'last2-letters': name... | 0 | 0 | 0 | 0 | 0 | 3,491 | 0 | -21 | 347 |
e4bee58bfdb19c78f18c0a8361e244a7c7f041cb | 898 | py | Python | app/migrations/0002_auto_20210215_2026.py | fossabot/stream_vod_indexer | 58bff60cc4adb1b8e5966134d2e560e59464d196 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20210215_2026.py | fossabot/stream_vod_indexer | 58bff60cc4adb1b8e5966134d2e560e59464d196 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20210215_2026.py | fossabot/stream_vod_indexer | 58bff60cc4adb1b8e5966134d2e560e59464d196 | [
"MIT"
] | 1 | 2021-02-18T14:25:39.000Z | 2021-02-18T14:25:39.000Z | # Generated by Django 3.1.6 on 2021-02-15 14:56
| 26.411765 | 63 | 0.570156 | # Generated by Django 3.1.6 on 2021-02-15 14:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='gamestorage',
name='game_webpage_link',
... | 0 | 0 | 0 | 784 | 0 | 0 | 0 | 19 | 46 |
00e99788eef7360e5057d06d1769c244b69763ef | 10,949 | py | Python | lolesport_parser/dataclasses/game_details_v5.py | DrArtemi/riot-api | a68bf94061a3c63e511418669097499c3e2c055d | [
"MIT"
] | null | null | null | lolesport_parser/dataclasses/game_details_v5.py | DrArtemi/riot-api | a68bf94061a3c63e511418669097499c3e2c055d | [
"MIT"
] | null | null | null | lolesport_parser/dataclasses/game_details_v5.py | DrArtemi/riot-api | a68bf94061a3c63e511418669097499c3e2c055d | [
"MIT"
] | null | null | null | """
This file has been auto-generated by pydantic.
TODO: Maybe some fields should be renamed or the architecture should be changed a bit
"""
from __future__ import annotations
| 32.489614 | 96 | 0.728286 | """
This file has been auto-generated by pydantic.
TODO: Maybe some fields should be renamed or the architecture should be changed a bit
"""
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel, Field
class Challenges(BaseModel):
field_12AssistStreakCount: Optiona... | 0 | 0 | 0 | 10,314 | 0 | 0 | 0 | 28 | 414 |
047b922e0222aa34f6c78018cdd19f790e7e76f5 | 3,263 | py | Python | Optimizer.py | FGDBTKD/Linguistically-Regularized-LSTM-for-Sentiment-Classification | 29c1ebd4b59574bb5e66590893c5da55c47ca6b5 | [
"MIT"
] | 14 | 2018-08-16T02:40:42.000Z | 2021-08-03T11:52:28.000Z | Optimizer.py | FGDBTKD/Linguistically-Regularized-LSTM-for-Sentiment-Classification | 29c1ebd4b59574bb5e66590893c5da55c47ca6b5 | [
"MIT"
] | 3 | 2018-09-01T08:55:18.000Z | 2020-04-17T02:03:00.000Z | Optimizer.py | FGDBTKD/Linguistically-Regularized-LSTM-for-Sentiment-Classification | 29c1ebd4b59574bb5e66590893c5da55c47ca6b5 | [
"MIT"
] | 8 | 2018-09-01T03:33:05.000Z | 2021-01-27T06:04:27.000Z |
OptimizerList = {'SGD': SGD, 'ADAGRAD': ADAGRAD, 'ADADELTA': ADADELTA}
| 42.934211 | 97 | 0.583206 | import numpy as np
import logging
class ADADELTA(object):
def __init__(self, params, lr=1, lr_word_vector=0.1, lr_decay=0.95, epsilon=1e-6):
logging.info('Optimizer ADADELTA lr %f lr_decay %f epsilon %f' % (lr, lr_decay, epsilon))
self.lr = lr
self.lr_word_vector = lr_word_vector
se... | 0 | 0 | 0 | 3,088 | 0 | 0 | 0 | -10 | 113 |
88acba4e7609f52d44bc071b4f9a53e54c8c5aae | 1,225 | py | Python | watson-conversation-python-slackbot/bot/driver.py | relyt0925/kube-samples | 48254c80826808bbb4193a6956c7de0e1a707008 | [
"Apache-2.0"
] | null | null | null | watson-conversation-python-slackbot/bot/driver.py | relyt0925/kube-samples | 48254c80826808bbb4193a6956c7de0e1a707008 | [
"Apache-2.0"
] | null | null | null | watson-conversation-python-slackbot/bot/driver.py | relyt0925/kube-samples | 48254c80826808bbb4193a6956c7de0e1a707008 | [
"Apache-2.0"
] | null | null | null | import ConfigParser
import datetime
import threading
import time
from slackclient import SlackClient
from responses import bot
Config = ConfigParser.ConfigParser()
Config.read("credentials.ini")
token = Config.get('Slack_Creds', 'token')
print "token: " + token
sc = SlackClient(token)
robot = bot(sc, token)
print "... | 26.630435 | 79 | 0.613061 | import ConfigParser
import datetime
import threading
import time
from slackclient import SlackClient
from responses import bot
Config = ConfigParser.ConfigParser()
Config.read("credentials.ini")
token = Config.get('Slack_Creds', 'token')
print "token: " + token
sc = SlackClient(token)
robot = bot(sc, token)
print "... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9e27346691061707fec955b28eeb371d35a4d2d | 15,523 | py | Python | pynetbox/core/response.py | louis-oui/pynetbox | 4d2c7496ec0560e193f648fca67aae1b6c85bce2 | [
"Apache-2.0"
] | null | null | null | pynetbox/core/response.py | louis-oui/pynetbox | 4d2c7496ec0560e193f648fca67aae1b6c85bce2 | [
"Apache-2.0"
] | null | null | null | pynetbox/core/response.py | louis-oui/pynetbox | 4d2c7496ec0560e193f648fca67aae1b6c85bce2 | [
"Apache-2.0"
] | null | null | null | """
(c) 2017 DigitalOcean
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, software
distribut... | 32.339583 | 78 | 0.52419 | """
(c) 2017 DigitalOcean
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, software
distribut... | 0 | 0 | 0 | 13,551 | 0 | 126 | 0 | 48 | 135 |
aa45a19c41356a15e780119763c8e777f62bcc6a | 1,161 | py | Python | Information search/IS - 2. Indexing/docreader.py | Shemplo/Study-courses | d719cfbddf9358b0f3505e747586d0cc575dd832 | [
"Apache-2.0"
] | 1 | 2019-03-27T18:42:12.000Z | 2019-03-27T18:42:12.000Z | Information search/IS - 2. Indexing/docreader.py | Shemplo/Study-courses | d719cfbddf9358b0f3505e747586d0cc575dd832 | [
"Apache-2.0"
] | 3 | 2018-10-19T07:04:03.000Z | 2021-12-14T21:15:10.000Z | Information search/IS - 2. Indexing/docreader.py | Shemplo/Study-courses | d719cfbddf9358b0f3505e747586d0cc575dd832 | [
"Apache-2.0"
] | 3 | 2019-03-21T05:16:21.000Z | 2021-12-21T11:54:30.000Z | #!/usr/bin/env python
import argparse
import document_pb2
import struct
import gzip
import sys
if __name__ == '__main__':
reader = DocumentStreamReader(parse_command_line().files)
for doc in reader:
print "%s\t%d bytes" % (doc.url, len(doc.text))
| 28.317073 | 89 | 0.577089 | #!/usr/bin/env python
import argparse
import document_pb2
import struct
import gzip
import sys
class DocumentStreamReader:
def __init__(self, paths):
self.paths = paths
def open_single(self, path):
return gzip.open(path, 'rb') if path.endswith('.gz') else open(path, 'rb')
def __iter__(se... | 0 | 0 | 0 | 643 | 0 | 205 | 0 | 0 | 46 |
b81bcbbebeafe80edcb9b654a8607f21f50b6e6c | 13,581 | py | Python | frameworks/helloworld/tests/test_secrets.py | akshitjain/dcos-commons_edited | 371675b07971afc1604800b0fa6b6ce11ae3a705 | [
"Apache-2.0"
] | null | null | null | frameworks/helloworld/tests/test_secrets.py | akshitjain/dcos-commons_edited | 371675b07971afc1604800b0fa6b6ce11ae3a705 | [
"Apache-2.0"
] | null | null | null | frameworks/helloworld/tests/test_secrets.py | akshitjain/dcos-commons_edited | 371675b07971afc1604800b0fa6b6ce11ae3a705 | [
"Apache-2.0"
] | null | null | null |
NUM_HELLO = 2
NUM_WORLD = 3
secret_content_default = "hello-world-secret-data"
secret_content_alternative = "hello-world-secret-data-alternative"
secret_options = {
"service": {
"spec_file": "examples/secrets.yml"
},
"hello": {
"count": NUM_HELLO,
"secret1"... | 35.928571 | 113 | 0.71519 | import pytest
from shakedown import *
import sdk_cmd as cmd
import sdk_install as install
import sdk_plan as plan
import sdk_tasks as tasks
import sdk_marathon as marathon
import time
import json
from tests.config import (
PACKAGE_NAME
)
NUM_HELLO = 2
NUM_WORLD = 3
secret_content_default = "hello-world-secret-d... | 0 | 9,999 | 0 | 0 | 0 | 2,018 | 0 | 22 | 475 |
78fae72f384b91868f4f205ab3c67b076ca00abb | 1,481 | py | Python | pre_commit_hooks/convert_beginning_helper.py | toddnguyen47/pre-commit-hooks | ce500b759db3627ac88598dd183bcac473b4f1bb | [
"MIT"
] | null | null | null | pre_commit_hooks/convert_beginning_helper.py | toddnguyen47/pre-commit-hooks | ce500b759db3627ac88598dd183bcac473b4f1bb | [
"MIT"
] | null | null | null | pre_commit_hooks/convert_beginning_helper.py | toddnguyen47/pre-commit-hooks | ce500b759db3627ac88598dd183bcac473b4f1bb | [
"MIT"
] | null | null | null | """Helper functions for converting beginning whitesspace characters"""
import argparse
from collections import deque
from typing import Callable, List
def add_tab_size_option(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
"""Add the `--tab-size` option"""
parser.add_argument(
"--tab-siz... | 28.480769 | 101 | 0.678596 | """Helper functions for converting beginning whitesspace characters"""
import argparse
from collections import deque
from typing import Callable, List
def add_tab_size_option(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
"""Add the `--tab-size` option"""
parser.add_argument(
"--tab-siz... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
203e3d9089902e24a0a0a006d3ce997493ff8bc6 | 16,783 | py | Python | src/buildstream/_protos/build/bazel/remote/asset/v1/remote_asset_pb2_grpc.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | src/buildstream/_protos/build/bazel/remote/asset/v1/remote_asset_pb2_grpc.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | src/buildstream/_protos/build/bazel/remote/asset/v1/remote_asset_pb2_grpc.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
# This class is part of an EXPERIMENTAL API.
# This class is part of an EXPERIMENTAL API.
| 50.857576 | 148 | 0.718227 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from buildstream._protos.build.bazel.remote.asset.v1 import remote_asset_pb2 as build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2
class FetchS... | 0 | 3,010 | 0 | 11,063 | 0 | 2,120 | 0 | 115 | 227 |
54c92cb6f666cfd61232245deafe4d692362e0d7 | 4,278 | py | Python | src/fully-connected-network/gradient-descent/model.py | aligholamee/UD730 | 936ef8ae4a0a285de6b19919f351a956c72e4cc8 | [
"MIT"
] | 2 | 2018-02-07T21:31:09.000Z | 2018-02-08T06:34:38.000Z | src/fully-connected-network/gradient-descent/model.py | aligholamee/UD730 | 936ef8ae4a0a285de6b19919f351a956c72e4cc8 | [
"MIT"
] | null | null | null | src/fully-connected-network/gradient-descent/model.py | aligholamee/UD730 | 936ef8ae4a0a285de6b19919f351a956c72e4cc8 | [
"MIT"
] | 2 | 2020-04-07T06:39:26.000Z | 2021-02-03T09:59:38.000Z | # ========================================
# [] File Name : model.py
#
# [] Creation Date : January 2018
#
# [] Created By : Ali Gholami (aligholami7596@gmail.com)
# ========================================
"""
Training and Validation on notMNIST Dataset
Fully connected network implementation with tensorflow
"... | 31.455882 | 109 | 0.683263 | # ========================================
# [] File Name : model.py
#
# [] Creation Date : January 2018
#
# [] Created By : Ali Gholami (aligholami7596@gmail.com)
# ========================================
"""
Training and Validation on notMNIST Dataset
Fully connected network implementation with tensorflow
"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ff7531e0abdb0ef22687c2a2b673f88b060ca02 | 2,388 | py | Python | grove/tests/circuit_primitives/test_swap.py | mkeshita/grove | dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3 | [
"Apache-2.0"
] | 229 | 2017-01-10T03:11:54.000Z | 2018-11-26T10:57:49.000Z | grove/tests/circuit_primitives/test_swap.py | mkeshita/grove | dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3 | [
"Apache-2.0"
] | 123 | 2017-01-10T21:06:51.000Z | 2018-11-27T19:38:22.000Z | grove/tests/circuit_primitives/test_swap.py | mkeshita/grove | dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3 | [
"Apache-2.0"
] | 95 | 2017-01-10T03:03:45.000Z | 2018-11-28T00:42:28.000Z | """
Tests on the swap test in the circuit_primitives module
"""
import numpy as np
import pytest
from unittest.mock import patch
from pyquil import Program
from pyquil.gates import CSWAP, H
from grove.circuit_primitives.swap import (swap_circuit_generator, run_swap_test, RegisterSizeMismatch)
def test_swap_circuit_ge... | 30.615385 | 72 | 0.595059 | """
Tests on the swap test in the circuit_primitives module
"""
import numpy as np
import pytest
from unittest.mock import patch
from pyquil import Program
from pyquil.gates import CSWAP, H
from grove.circuit_primitives.swap import (swap_circuit_generator,
run_swap_test,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 0 |
5382b7f814bf0d8ce5cb66f429170d006417a64d | 7,291 | py | Python | neural_style_transfer.py | CarlFredriksson/neural_style_transfer | 1dd640c78a9fc5f25a4c4f5fd474cc54992ee3b5 | [
"MIT"
] | null | null | null | neural_style_transfer.py | CarlFredriksson/neural_style_transfer | 1dd640c78a9fc5f25a4c4f5fd474cc54992ee3b5 | [
"MIT"
] | null | null | null | neural_style_transfer.py | CarlFredriksson/neural_style_transfer | 1dd640c78a9fc5f25a4c4f5fd474cc54992ee3b5 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.applications import VGG19
from tensorflow.keras.layers import MaxPooling2D
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Settings
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 37.973958 | 127 | 0.642436 | import os
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.applications import VGG19
from tensorflow.keras.layers import MaxPooling2D
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Settings
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
004b00f5d71ab4c3568ca60038dc9509d5e81656 | 9,891 | py | Python | train_nerf.py | AnimatedRNG/nerf-jax | c940bcfbb986623691aff7a4e28bf8273ea70147 | [
"Apache-2.0"
] | 5 | 2020-10-22T07:27:15.000Z | 2022-02-25T02:54:39.000Z | train_nerf.py | AnimatedRNG/nerf-jax | c940bcfbb986623691aff7a4e28bf8273ea70147 | [
"Apache-2.0"
] | 11 | 2021-01-27T01:52:38.000Z | 2021-02-03T06:35:34.000Z | train_nerf.py | AnimatedRNG/nerf-jax | c940bcfbb986623691aff7a4e28bf8273ea70147 | [
"Apache-2.0"
] | 2 | 2020-12-15T14:44:07.000Z | 2021-01-27T03:39:01.000Z | #!/usr/bin/env python3
from collections import namedtuple
from jax.tree_util import register_pytree_node
Losses = namedtuple("Losses", ["coarse_loss", "fine_loss"])
register_pytree_node(Losses, lambda xs: (tuple(xs), None), lambda _, xs: Losses(*xs))
if __name__ == "__main__":
main()
| 32.323529 | 88 | 0.632696 | #!/usr/bin/env python3
import argparse
import functools
from pathlib import Path
from datetime import datetime
from collections import namedtuple
import numpy as np
import yaml
from box import Box
import jax
from jax import jit, vmap, pmap, grad, value_and_grad
import jax.numpy as jnp
from jax.tree_util import regist... | 0 | 1,867 | 0 | 0 | 0 | 6,959 | 0 | 125 | 641 |
0fbd0c29ffc03075b101be02d82f3c616c84a5ed | 152 | py | Python | Udemy/GeekUniversity/secao_4/ex16_converso_polegada_p_centimetro.py | SandboxGTASA/Python-1 | bbb5f8bdf7d5110528e457b2a9ebdb2d67e40805 | [
"MIT"
] | null | null | null | Udemy/GeekUniversity/secao_4/ex16_converso_polegada_p_centimetro.py | SandboxGTASA/Python-1 | bbb5f8bdf7d5110528e457b2a9ebdb2d67e40805 | [
"MIT"
] | null | null | null | Udemy/GeekUniversity/secao_4/ex16_converso_polegada_p_centimetro.py | SandboxGTASA/Python-1 | bbb5f8bdf7d5110528e457b2a9ebdb2d67e40805 | [
"MIT"
] | null | null | null | # Convertendo polegadas em centimetros
polegadas = float(input('Entre com o tamanho em polegadas: '))
centimetros = polegadas * 2.54
print(centimetros) | 30.4 | 62 | 0.776316 | # Convertendo polegadas em centimetros
polegadas = float(input('Entre com o tamanho em polegadas: '))
centimetros = polegadas * 2.54
print(centimetros) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
248d3ffb18d87c23c825d18f3cf219a8e26cd866 | 179 | py | Python | payjp/util.py | payjp/payjp-python | 994b16addd8327781eb936eca60d1abe7f7c7819 | [
"MIT"
] | 15 | 2015-09-13T14:40:48.000Z | 2021-04-29T15:21:13.000Z | payjp/util.py | payjp/payjp-python | 994b16addd8327781eb936eca60d1abe7f7c7819 | [
"MIT"
] | 9 | 2015-09-07T07:57:20.000Z | 2020-12-14T07:11:59.000Z | payjp/util.py | payjp/payjp-python | 994b16addd8327781eb936eca60d1abe7f7c7819 | [
"MIT"
] | 10 | 2015-09-07T07:56:09.000Z | 2020-05-22T12:43:21.000Z | # coding: utf-8
| 17.9 | 64 | 0.620112 | # coding: utf-8
import sys
def utf8(value):
if sys.version_info < (3, 0) and isinstance(value, unicode):
return value.encode('utf-8')
else:
return value
| 0 | 0 | 0 | 0 | 0 | 128 | 0 | -11 | 46 |
6bb791e549adf13891b287887a7403545ed07d97 | 17,713 | py | Python | examples/pretraining/swav/main_swav.py | caglasozen/wilds | db2ff095304891244962509459ee48e2fc5fd5e6 | [
"MIT"
] | null | null | null | examples/pretraining/swav/main_swav.py | caglasozen/wilds | db2ff095304891244962509459ee48e2fc5fd5e6 | [
"MIT"
] | null | null | null | examples/pretraining/swav/main_swav.py | caglasozen/wilds | db2ff095304891244962509459ee48e2fc5fd5e6 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# This file has been modified from the original repository's version in the following ways:
# 1. The model loading logic u... | 40.533181 | 164 | 0.614351 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# This file has been modified from the original repository's version in the following ways:
# 1. The model loading logic u... | 0 | 802 | 0 | 0 | 0 | 9,095 | 0 | 233 | 457 |
0ed6edb1cfba4fa32c570eb33da74bbda6c23148 | 10,300 | py | Python | bokeh-app/mainold.py | nyc-public-schools/bokeh | bad0334b43ad9df295efa980d7c2a2f704888732 | [
"BSD-3-Clause"
] | null | null | null | bokeh-app/mainold.py | nyc-public-schools/bokeh | bad0334b43ad9df295efa980d7c2a2f704888732 | [
"BSD-3-Clause"
] | null | null | null | bokeh-app/mainold.py | nyc-public-schools/bokeh | bad0334b43ad9df295efa980d7c2a2f704888732 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[7]:
import pandas as pd
from os.path import dirname, join
from bokeh.io import show, output_file, show, save, curdoc
from bokeh.plotting import show
from bokeh.layouts import column, row
from bokeh.models import TextInput, Div, RadioGroup
#colors for each borough
colors=[... | 31.987578 | 224 | 0.618155 | #!/usr/bin/env python
# coding: utf-8
# In[7]:
import pandas as pd
import numpy as np
from os.path import dirname, join
from bokeh.io import show, output_notebook,output_file, show, save, curdoc, output_notebook, export_png
from bokeh.plotting import figure, output_file, show,save
from bokeh.models.widgets import P... | 0 | 0 | 0 | 0 | 0 | 7,652 | 0 | 336 | 211 |
35b186f995d1aac5ce56c24edf771e8630572c33 | 2,183 | py | Python | tools/deploy/ops/BBoxTransform.py | qingswu/Detectron2-CenterNet | 40b80d1a6aa85c7352d5088f44225d64c242cf83 | [
"Apache-2.0"
] | 5 | 2020-07-01T07:55:45.000Z | 2022-03-05T04:03:09.000Z | tools/deploy/ops/BBoxTransform.py | qingswu/Detectron2-CenterNet | 40b80d1a6aa85c7352d5088f44225d64c242cf83 | [
"Apache-2.0"
] | 2 | 2020-12-08T12:40:43.000Z | 2021-09-08T02:15:21.000Z | tools/deploy/ops/BBoxTransform.py | qingswu/Detectron2-CenterNet | 40b80d1a6aa85c7352d5088f44225d64c242cf83 | [
"Apache-2.0"
] | 2 | 2021-01-17T14:51:09.000Z | 2021-03-23T02:07:35.000Z | import torch
import torch.nn
from detectron2.export.tensorrt import TensorRTModel
from detectron2.utils.logger import setup_logger
from ops import export_onnx, get_inputs
if __name__ == '__main__':
logger = setup_logger()
logger.info("example: BBoxTransform")
m = BBoxTransform()
data = get_inputs(... | 31.185714 | 106 | 0.619789 | import torch
import torch.nn
from detectron2.export.tensorrt import TensorRTModel
from detectron2.utils.logger import setup_logger
from ops import export_onnx, get_inputs, SimpleTracer
class BBoxTransform(SimpleTracer):
def __init__(self):
super(BBoxTransform, self).__init__()
self.cuda()
... | 0 | 0 | 0 | 987 | 0 | 0 | 0 | 14 | 23 |
5b755f777f1ac2efb82d36a71ca1cacf64bd869b | 446 | py | Python | setup.py | dsvensson/subsevenzip-python | 078c3876e5fd1ffd84e57ae992a142d247a5832f | [
"0BSD"
] | 3 | 2015-01-05T14:09:25.000Z | 2018-03-21T19:33:15.000Z | setup.py | dsvensson/subsevenzip-python | 078c3876e5fd1ffd84e57ae992a142d247a5832f | [
"0BSD"
] | null | null | null | setup.py | dsvensson/subsevenzip-python | 078c3876e5fd1ffd84e57ae992a142d247a5832f | [
"0BSD"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="subsevenzip",
version="0.1",
description="7-Zip decompressor",
author="Daniel Svensson",
author_email="dsvensson@gmail.com",
license="ISC",
packages=find_packages(),
test_suite="nose.collector",
setup_requires=[
"cover... | 21.238095 | 53 | 0.605381 | from setuptools import setup, find_packages
setup(
name="subsevenzip",
version="0.1",
description="7-Zip decompressor",
author="Daniel Svensson",
author_email="dsvensson@gmail.com",
license="ISC",
packages=find_packages(),
test_suite="nose.collector",
setup_requires=[
"cover... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4c5e81f71bbec9487f5339b12bc91e1a50a3d76 | 11,459 | py | Python | grr/endtoend_tests/base.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | null | null | null | grr/endtoend_tests/base.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | null | null | null | grr/endtoend_tests/base.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Base module for end to end tests that run flows on clients."""
from grr.lib import aff4
from grr.lib import client_index
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib.rdfvalues import client as rdf_client
def GetClientTestTargets(client_ids=None,
... | 31.480769 | 80 | 0.68444 | #!/usr/bin/env python
"""Base module for end to end tests that run flows on clients."""
import re
import time
import traceback
import unittest
from grr.lib import aff4
from grr.lib import client_index
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import flow_utils
from grr.lib import r... | 0 | 0 | 0 | 8,725 | 0 | 318 | 0 | 34 | 498 |
5d38c82f8b5b5aab3e6e5cd285d57442d2cff181 | 13,803 | py | Python | src/gluonts/model/predictor.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 2,648 | 2019-06-03T17:18:27.000Z | 2022-03-31T08:29:22.000Z | src/gluonts/model/predictor.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 1,220 | 2019-06-04T09:00:14.000Z | 2022-03-31T10:45:43.000Z | src/gluonts/model/predictor.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 595 | 2019-06-04T01:04:31.000Z | 2022-03-30T10:40:26.000Z | # 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 located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 32.942721 | 102 | 0.606897 | # 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 located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 0 | 2,591 | 0 | 8,642 | 0 | 149 | 0 | 191 | 487 |
ab2c952692c66b0a5c9210538c5e5f17b73574c5 | 14,213 | py | Python | c7n/actions/securityhub.py | edonkor1/cloud-custodian | 6f54735acd071b6fc6a0cca851d36e1a1fa46aa0 | [
"Apache-2.0"
] | null | null | null | c7n/actions/securityhub.py | edonkor1/cloud-custodian | 6f54735acd071b6fc6a0cca851d36e1a1fa46aa0 | [
"Apache-2.0"
] | null | null | null | c7n/actions/securityhub.py | edonkor1/cloud-custodian | 6f54735acd071b6fc6a0cca851d36e1a1fa46aa0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Capital One Services, LLC
#
# 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... | 36.821244 | 110 | 0.576585 | # Copyright 2018 Capital One Services, LLC
#
# 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... | 0 | 340 | 0 | 10,138 | 0 | 149 | 0 | 76 | 269 |
c072119317e8f50050b11b6d6e6ffec573282f73 | 640 | py | Python | daemon/core/gui/graph/tags.py | b00ga/core | e0842197e389f3f14c73dc5db6cc26f78e665f62 | [
"BSD-2-Clause"
] | null | null | null | daemon/core/gui/graph/tags.py | b00ga/core | e0842197e389f3f14c73dc5db6cc26f78e665f62 | [
"BSD-2-Clause"
] | null | null | null | daemon/core/gui/graph/tags.py | b00ga/core | e0842197e389f3f14c73dc5db6cc26f78e665f62 | [
"BSD-2-Clause"
] | null | null | null | ANNOTATION = "annotation"
GRIDLINE = "gridline"
SHAPE = "shape"
SHAPE_TEXT = "shapetext"
EDGE = "edge"
LINK_LABEL = "linklabel"
WIRELESS_EDGE = "wireless"
ANTENNA = "antenna"
NODE_LABEL = "nodename"
NODE = "node"
WALLPAPER = "wallpaper"
SELECTION = "selectednodes"
MARKER = "marker"
ORGANIZE_TAGS = [
WALLPAPER,
... | 15.609756 | 27 | 0.640625 | ANNOTATION = "annotation"
GRIDLINE = "gridline"
SHAPE = "shape"
SHAPE_TEXT = "shapetext"
EDGE = "edge"
LINK_LABEL = "linklabel"
WIRELESS_EDGE = "wireless"
ANTENNA = "antenna"
NODE_LABEL = "nodename"
NODE = "node"
WALLPAPER = "wallpaper"
SELECTION = "selectednodes"
MARKER = "marker"
ORGANIZE_TAGS = [
WALLPAPER,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
24804bfc195e51973e66a3f559e01d09536750e9 | 17,099 | py | Python | custom_components/sun2/sensor.py | Nag94/HomeAssistantConfig | d5f806e05be8d92bf487c58322d20cd9b08c6b98 | [
"Unlicense"
] | 97 | 2019-06-19T19:06:53.000Z | 2022-03-30T06:58:06.000Z | custom_components/sun2/sensor.py | Nag94/HomeAssistantConfig | d5f806e05be8d92bf487c58322d20cd9b08c6b98 | [
"Unlicense"
] | 42 | 2019-06-19T20:20:45.000Z | 2022-03-31T13:02:35.000Z | custom_components/sun2/sensor.py | Nag94/HomeAssistantConfig | d5f806e05be8d92bf487c58322d20cd9b08c6b98 | [
"Unlicense"
] | 20 | 2020-04-18T19:28:47.000Z | 2022-03-06T18:23:09.000Z | """Sun2 Sensor."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_ELEVATION, CONF_LATITUDE, CONF_LONGITUDE, CONF_MONITORED_CONDITIONS, CONF_TIME_ZONE)
from homeassistant.helpers import config_vali... | 33.926587 | 87 | 0.62606 | """Sun2 Sensor."""
from datetime import datetime, time, timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_ELEVATION,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_MONITORED_CONDITIONS,
CONF_TIME_ZONE,
DEVI... | 4 | 1,528 | 1,507 | 10,336 | 0 | 393 | 0 | 356 | 431 |
a1eadad05f7982e2c83e9588ec9bbf91d80cb087 | 780 | py | Python | backend/applications/models/abstract/allable.py | simonfong6/applications | dea9e324f33b3647ab8e1fcf01f67b37e20e37a9 | [
"MIT"
] | null | null | null | backend/applications/models/abstract/allable.py | simonfong6/applications | dea9e324f33b3647ab8e1fcf01f67b37e20e37a9 | [
"MIT"
] | null | null | null | backend/applications/models/abstract/allable.py | simonfong6/applications | dea9e324f33b3647ab8e1fcf01f67b37e20e37a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Allable
"""
if __name__ == '__main__':
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-a', '--arg1',
help="An argument.",
type=str,
default='default')
args = parse... | 17.727273 | 50 | 0.580769 | #!/usr/bin/env python3
"""
Allable
"""
from applications.database.table import Table
from .base import Base
from .buildable import Buildable
from .jsonable import Jsonable
class Allable(
Buildable,
Jsonable
):
@classmethod
def all(cls, json=False):
items = cls.table.get_all()
objs =... | 0 | 196 | 0 | 24 | 0 | 3 | 0 | 45 | 162 |
a554c06e0f65bba35d7853d913b3a09e1943fe3a | 8,166 | py | Python | tests/test_views.py | gradel/aldryn-forms | a53e751078e810436504a175101f3216649d21cd | [
"BSD-3-Clause"
] | 24 | 2019-03-31T17:27:37.000Z | 2021-12-14T22:38:10.000Z | tests/test_views.py | gradel/aldryn-forms | a53e751078e810436504a175101f3216649d21cd | [
"BSD-3-Clause"
] | 126 | 2015-01-21T19:39:42.000Z | 2019-01-09T06:50:45.000Z | tests/test_views.py | gradel/aldryn-forms | a53e751078e810436504a175101f3216649d21cd | [
"BSD-3-Clause"
] | 44 | 2015-08-25T08:19:45.000Z | 2019-01-03T12:34:18.000Z | from distutils.version import LooseVersion
from django import VERSION as DJANGO_VERSION
import cms
# These means "less than or equal"
DJANGO_111 = DJANGO_VERSION[:2] >= (1, 11)
CMS_3_6 = LooseVersion(cms.__version__) < LooseVersion('4.0')
| 28.354167 | 104 | 0.563189 | import sys
from distutils.version import LooseVersion
from unittest import skipIf, skipUnless
from django import VERSION as DJANGO_VERSION
from django.urls import clear_url_caches
import cms
from cms.api import add_plugin, create_page
from cms.appresolver import clear_app_resolvers
from cms.test_utils.testcases impor... | 0 | 1,971 | 0 | 5,695 | 0 | 0 | 0 | 101 | 155 |
4988e3e2f37fae2c39d045aac6365b9829ae00a4 | 478 | py | Python | deepl/main.py | bitplus/deepl-cli | da7c76f1ea20977275d009552c1c02f756cbf32b | [
"MIT"
] | 56 | 2020-10-30T15:05:32.000Z | 2022-03-27T21:16:58.000Z | deepl/main.py | bitplus/deepl-cli | da7c76f1ea20977275d009552c1c02f756cbf32b | [
"MIT"
] | 38 | 2020-07-13T06:22:35.000Z | 2022-03-31T20:16:28.000Z | deepl/main.py | bitplus/deepl-cli | da7c76f1ea20977275d009552c1c02f756cbf32b | [
"MIT"
] | 10 | 2020-07-28T18:40:22.000Z | 2022-03-17T11:07:17.000Z | #!/usr/bin/env python3
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
| 20.782609 | 64 | 0.604603 | #!/usr/bin/env python3
import sys
from . import deepl
def main() -> None:
t = deepl.DeepLCLI()
t.chk_cmdargs()
t.fr_lang, t.to_lang = sys.argv[1].split(':')
script = sys.stdin.read()
print('Translating...', end='', file=sys.stderr, flush=True)
result = t.translate(script)
print('\033[1K\0... | 0 | 0 | 0 | 0 | 0 | 303 | 0 | -13 | 68 |
9447782acc0cd1ca418445929d22ee41dc741757 | 3,101 | py | Python | babyrobot/src/speech_features/src/speech_feature_server.py | babyrobot-eu/core-modules | 7e8c006c40153fb649208c9a78fc71aa70243f69 | [
"MIT"
] | 1 | 2019-02-07T15:32:06.000Z | 2019-02-07T15:32:06.000Z | babyrobot/src/speech_features/src/speech_feature_server.py | babyrobot-eu/core-modules | 7e8c006c40153fb649208c9a78fc71aa70243f69 | [
"MIT"
] | 9 | 2020-01-28T22:09:41.000Z | 2022-03-11T23:39:17.000Z | babyrobot/src/speech_features/src/speech_feature_server.py | babyrobot-eu/core-modules | 7e8c006c40153fb649208c9a78fc71aa70243f69 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import csv
import os
import rospy
import uuid
from babyrobot.lib import utils as br_utils
from babyrobot.speech_features import config as sf_config
from babyrobot_msgs.msg import SpeechFeatures, Feature
from babyrobot_msgs.srv import SpeechFeatureExtraction
from babyrobot_msgs.srv import SpeechFe... | 32.302083 | 76 | 0.656885 | #!/usr/bin/env python
import csv
import os
import rospy
import uuid
from babyrobot.lib import utils as br_utils
from babyrobot.speech_features import config as sf_config
from babyrobot_msgs.msg import SpeechFeatures, Feature
from babyrobot_msgs.srv import SpeechFeatureExtraction
from babyrobot_msgs.srv import SpeechFe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0193adfbe712d27ed14b6903b2a69b42e44904be | 473 | py | Python | 2015/task_2/first.py | romanthekat/advent_of_code | d9005d9824ab7aadd6bc93fd88421f6fdc95520e | [
"Apache-2.0"
] | null | null | null | 2015/task_2/first.py | romanthekat/advent_of_code | d9005d9824ab7aadd6bc93fd88421f6fdc95520e | [
"Apache-2.0"
] | 5 | 2016-07-03T19:07:55.000Z | 2019-12-10T19:24:25.000Z | 2015/task_2/first.py | EvilKhaosKat/advent_of_code | d9005d9824ab7aadd6bc93fd88421f6fdc95520e | [
"Apache-2.0"
] | null | null | null |
total = 0
with open("input.txt") as f:
total = sum(calculate_paper(gift) for gift in f.readlines())
print(total)
| 19.708333 | 66 | 0.575053 | def get_smallest_area(l, w, h):
sizes = [l, w, h]
sizes.remove(max(sizes))
return sizes[0] * sizes[1]
def calculate_paper(gift):
l, w, h = map(int, gift.split("x"))
return get_surface_area(h, l, w) + get_smallest_area(l, w, h)
def get_surface_area(l, w, h):
return 2 * l * w... | 0 | 0 | 0 | 0 | 0 | 269 | 0 | 0 | 73 |
f7a2819ac7ec77e96ae6a88ef722bf74ac99b857 | 17,937 | py | Python | avro_json_serializer/test/test_avro_json_serializer.py | rushton/python-avro-json-serializer | 52549a0d5958b08b0fca3e419eaefc3e0c6ec99c | [
"Apache-2.0"
] | 126 | 2015-02-26T20:20:04.000Z | 2022-03-25T19:36:22.000Z | avro_json_serializer/test/test_avro_json_serializer.py | rushton/python-avro-json-serializer | 52549a0d5958b08b0fca3e419eaefc3e0c6ec99c | [
"Apache-2.0"
] | 15 | 2016-06-01T17:26:58.000Z | 2022-03-17T20:40:37.000Z | avro_json_serializer/test/test_avro_json_serializer.py | rushton/python-avro-json-serializer | 52549a0d5958b08b0fca3e419eaefc3e0c6ec99c | [
"Apache-2.0"
] | 39 | 2015-01-20T22:12:05.000Z | 2022-02-18T03:23:41.000Z | # -*- coding: utf-8 -*-
# (c) [2014] LinkedIn Corp. 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... | 34.560694 | 233 | 0.53543 | # -*- coding: utf-8 -*-
# (c) [2014] LinkedIn Corp. 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 app... | 12 | 0 | 0 | 17,082 | 0 | 0 | 0 | 98 | 139 |
37d5a92d4d65aceb39da6abee706d1d900f41616 | 74 | py | Python | src/vve_cli/__init__.py | buckw6eat/vve_cli | 0efd238818ac7f620c4707542aa815110777c69a | [
"MIT"
] | null | null | null | src/vve_cli/__init__.py | buckw6eat/vve_cli | 0efd238818ac7f620c4707542aa815110777c69a | [
"MIT"
] | null | null | null | src/vve_cli/__init__.py | buckw6eat/vve_cli | 0efd238818ac7f620c4707542aa815110777c69a | [
"MIT"
] | null | null | null | from vve_cli.main import run
__version__ = "0.0.1"
__all__ = ["run"]
| 14.8 | 29 | 0.648649 | from vve_cli.main import run
__version__ = "0.0.1"
__all__ = ["run"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3ec7091ec5c1783e0cf99f2f40d55b372d54f92b | 134 | py | Python | graph_db/driver/null/__init__.py | josegomezr/graph_db | 1ef286c9afdd4fd18559cccee9456dbc72ba7a8d | [
"Apache-2.0"
] | 4 | 2015-11-19T01:22:19.000Z | 2020-09-05T03:03:24.000Z | graph_db/driver/null/__init__.py | josegomezr/graph_db | 1ef286c9afdd4fd18559cccee9456dbc72ba7a8d | [
"Apache-2.0"
] | 1 | 2016-03-10T01:11:03.000Z | 2016-03-10T01:11:03.000Z | graph_db/driver/null/__init__.py | josegomezr/graph_db | 1ef286c9afdd4fd18559cccee9456dbc72ba7a8d | [
"Apache-2.0"
] | 1 | 2016-03-08T00:03:18.000Z | 2016-03-08T00:03:18.000Z | from . import driver
from ... import exceptions
def Factory(settings):
"""@todo docstring"""
return driver.DBDriver(settings) | 22.333333 | 36 | 0.708955 | from . import driver
from ... import exceptions
def Factory(settings):
"""@todo docstring"""
return driver.DBDriver(settings) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ac7b5a001174a156fb9a33cfe506c862fca047e | 18,781 | py | Python | cpp_faster_fifo/cpp_lib/googletest/googletest-1.10.0/googletest/test/gtest_xml_output_unittest.py | leikinman/faster-fifo | a8d472247640de592c3b332cc0e3068be50f083b | [
"MIT"
] | 72 | 2020-04-09T01:43:31.000Z | 2022-03-24T17:08:31.000Z | cpp_faster_fifo/cpp_lib/googletest/googletest-1.10.0/googletest/test/gtest_xml_output_unittest.py | leikinman/faster-fifo | a8d472247640de592c3b332cc0e3068be50f083b | [
"MIT"
] | 26 | 2020-04-09T02:33:14.000Z | 2022-03-31T11:41:21.000Z | cpp_faster_fifo/cpp_lib/googletest/googletest-1.10.0/googletest/test/gtest_xml_output_unittest.py | leikinman/faster-fifo | a8d472247640de592c3b332cc0e3068be50f083b | [
"MIT"
] | 13 | 2020-04-08T04:10:45.000Z | 2022-02-08T07:10:38.000Z | #!/usr/bin/env python
#
# Copyright 2006, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 48.15641 | 225 | 0.694159 | #!/usr/bin/env python
#
# Copyright 2006, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 0 | 0 | 0 | 6,665 | 0 | 0 | 0 | -15 | 134 |
b9e3aa32da7570f3bf7048bb5bf62a38902e8fb3 | 7,796 | py | Python | 3_MNIST/4_5_fc_layers_relu_lrdeclay.py | ray-g/TensorFlow-Examples | 9f0360f0d7f30ffc36e34ea42606da3300e26df2 | [
"MIT"
] | null | null | null | 3_MNIST/4_5_fc_layers_relu_lrdeclay.py | ray-g/TensorFlow-Examples | 9f0360f0d7f30ffc36e34ea42606da3300e26df2 | [
"MIT"
] | null | null | null | 3_MNIST/4_5_fc_layers_relu_lrdeclay.py | ray-g/TensorFlow-Examples | 9f0360f0d7f30ffc36e34ea42606da3300e26df2 | [
"MIT"
] | null | null | null | import os
import inspect
import math
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
tf.set_random_seed(0)
# Calculate LOG_DIR according to current file
CUR_FILE = inspect.getfile(inspect.currentframe())
LOG_DIR = os.path.join(
os.path.dirname(os.path.abspat... | 40.604167 | 155 | 0.557081 | import os
import inspect
import shutil
import math
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
tf.set_random_seed(0)
# Calculate LOG_DIR according to current file
CUR_FILE = inspect.getfile(inspect.currentframe())
LOG_DIR = os.path.jo... | 70 | 0 | 0 | 0 | 0 | 1,104 | 0 | -11 | 117 |
0a194f9bd131b7ce2b90308f5d00bdcf14b64528 | 147 | py | Python | textract-pipeline/node_modules/aws-cdk/lib/init-templates/app/python/app.template.py | musa-b/amazon-textract-serverless-large-scale-document-processing | eb628684bc661c9a1fdde4d9d5032b5b3632eece | [
"Apache-2.0"
] | null | null | null | textract-pipeline/node_modules/aws-cdk/lib/init-templates/app/python/app.template.py | musa-b/amazon-textract-serverless-large-scale-document-processing | eb628684bc661c9a1fdde4d9d5032b5b3632eece | [
"Apache-2.0"
] | null | null | null | textract-pipeline/node_modules/aws-cdk/lib/init-templates/app/python/app.template.py | musa-b/amazon-textract-serverless-large-scale-document-processing | eb628684bc661c9a1fdde4d9d5032b5b3632eece | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from aws_cdk import cdk
from %name%.%name% import _stack, PyStack
app = cdk.App()
PyStack(app, "%name%-cdk-1")
app.run()
| 12.25 | 39 | 0.680272 | #!/usr/bin/env python3
from aws_cdk import cdk
from %name%.%name%_stack import PyStack
app = cdk.App()
PyStack(app, "%name%-cdk-1")
app.run()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 0 |
97e99c470df1390f7aea25ce8ca02429083c1569 | 2,097 | py | Python | my_app/io/cts_parser.py | gedoensmanagement/Transkribus_spell_checker | 1413f1de137e786a4f078e6806b2e856120e78ea | [
"MIT"
] | null | null | null | my_app/io/cts_parser.py | gedoensmanagement/Transkribus_spell_checker | 1413f1de137e786a4f078e6806b2e856120e78ea | [
"MIT"
] | null | null | null | my_app/io/cts_parser.py | gedoensmanagement/Transkribus_spell_checker | 1413f1de137e786a4f078e6806b2e856120e78ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
A collection of functions that can extract additional data fields from
the work and passage fields of a Cts object. Which additional fields
are possible depends on the namespace. The "parse_cts" function recognizes
the namespace and decides which function to use for the extraction.
... | 29.535211 | 85 | 0.570815 | # -*- coding: utf-8 -*-
"""
A collection of functions that can extract additional data fields from
the work and passage fields of a Cts object. Which additional fields
are possible depends on the namespace. The "parse_cts" function recognizes
the namespace and decides which function to use for the extraction.
... | 0 | 0 | 0 | 0 | 0 | 190 | 0 | 0 | 54 |
f12ba53f4df48091653b5508515d7229865bd54b | 3,647 | py | Python | handlers/drive_handler.py | google/b-con | 365ba51cef6fbdd05ceb410ce6fad3e542a65cf4 | [
"Apache-2.0"
] | 4 | 2020-08-27T07:00:09.000Z | 2021-10-21T00:43:36.000Z | handlers/drive_handler.py | google/b-con | 365ba51cef6fbdd05ceb410ce6fad3e542a65cf4 | [
"Apache-2.0"
] | null | null | null | handlers/drive_handler.py | google/b-con | 365ba51cef6fbdd05ceb410ce6fad3e542a65cf4 | [
"Apache-2.0"
] | 2 | 2020-09-15T04:17:28.000Z | 2020-09-15T04:23:27.000Z | # Copyright 2020 Google LLC
#
# 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, ... | 31.439655 | 97 | 0.717302 | # Copyright 2020 Google LLC
#
# 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, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 46 |
117de2060310920f81abc8439d94be701d21ee15 | 335 | py | Python | Testes/type_set.py | Renanrbsc/PadawanPython | 6dc06a502d59127d0f180847e19b40c581baddd0 | [
"MIT"
] | null | null | null | Testes/type_set.py | Renanrbsc/PadawanPython | 6dc06a502d59127d0f180847e19b40c581baddd0 | [
"MIT"
] | null | null | null | Testes/type_set.py | Renanrbsc/PadawanPython | 6dc06a502d59127d0f180847e19b40c581baddd0 | [
"MIT"
] | null | null | null | import random
# Efetua 1000 testes:
for _ in range(1000):
# Gera um conjunto de 10 nmeros inteiros entre 0 e 9:
a = set(random.randint(0, 9) for __ in range(10))
# Verifica se o conjunto igual sua respectiva lista sortida:
if list(a) != sorted(a):
# Se for diferente, exibe o conjunto:
... | 25.769231 | 68 | 0.644776 | import random
# Efetua 1000 testes:
for _ in range(1000):
# Gera um conjunto de 10 números inteiros entre 0 e 9:
a = set(random.randint(0, 9) for __ in range(10))
# Verifica se o conjunto é igual à sua respectiva lista sortida:
if list(a) != sorted(a):
# Se for diferente, exibe o conjunto:
... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |