hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70c321544f9877f102645bed6748a44c12c94c1 | 8,019 | py | Python | pyshapelets/lts_smaller_shap_dicts.py | GillesVandewiele/pyShapelets | d7e91150c17bf0f5fed55dc36d0c4d2d447e80c9 | [
"MIT"
] | 16 | 2017-07-12T12:24:21.000Z | 2021-01-23T14:11:24.000Z | pyshapelets/lts_smaller_shap_dicts.py | GillesVandewiele/pyShapelets | d7e91150c17bf0f5fed55dc36d0c4d2d447e80c9 | [
"MIT"
] | 13 | 2017-07-09T08:06:41.000Z | 2017-09-21T14:16:04.000Z | pyshapelets/lts_smaller_shap_dicts.py | GillesVandewiele/pyShapelets | d7e91150c17bf0f5fed55dc36d0c4d2d447e80c9 | [
"MIT"
] | 4 | 2017-12-07T16:47:22.000Z | 2019-11-08T20:42:40.000Z | import time
from collections import Counter, defaultdict
import warnings; warnings.filterwarnings('ignore')
import glob
import re
import ast
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from algorithms import ShapeletTransformer
from extractors.extractor import MultiGeneticExtractor
from dat... | 38.73913 | 127 | 0.654695 | import time
from collections import Counter, defaultdict
import warnings; warnings.filterwarnings('ignore')
import glob
import re
import ast
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from algorithms import ShapeletTransformer
from extractors.extractor import MultiGeneticExtractor
from dat... | true | true |
f70c3267c713a80d0e3f5d9f83fe64fcabba8b3f | 3,941 | py | Python | python/317_shortest_distance_from_all_buildings.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 17 | 2016-03-01T22:40:53.000Z | 2021-04-19T02:15:03.000Z | python/317_shortest_distance_from_all_buildings.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | null | null | null | python/317_shortest_distance_from_all_buildings.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 3 | 2019-03-07T03:48:43.000Z | 2020-04-05T01:11:36.000Z |
class SolutionTLE:
def shortestDistance(self, grid: List[List[int]]) -> int:
buildings = []
rows, cols = len(grid), len(grid[0])
for row in range(rows):
for col in range(cols):
if grid[row][col] == 1:
buildings.append((row, col))
def... | 36.831776 | 85 | 0.511038 |
class SolutionTLE:
def shortestDistance(self, grid: List[List[int]]) -> int:
buildings = []
rows, cols = len(grid), len(grid[0])
for row in range(rows):
for col in range(cols):
if grid[row][col] == 1:
buildings.append((row, col))
def... | true | true |
f70c343abe32b3e4f1f802f02e6469b2c98b9f06 | 1,170 | py | Python | hearthstone/training/pytorch/worker/distributed/remote_agent.py | JDBumgardner/stone_ground_hearth_battles | 9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f | [
"Apache-2.0"
] | 20 | 2020-08-01T03:14:57.000Z | 2021-12-19T11:47:50.000Z | hearthstone/training/pytorch/worker/distributed/remote_agent.py | JDBumgardner/stone_ground_hearth_battles | 9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f | [
"Apache-2.0"
] | 48 | 2020-08-01T03:06:43.000Z | 2022-02-27T10:03:47.000Z | hearthstone/training/pytorch/worker/distributed/remote_agent.py | JDBumgardner/stone_ground_hearth_battles | 9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f | [
"Apache-2.0"
] | 3 | 2020-06-28T01:23:37.000Z | 2021-11-11T23:09:36.000Z | from torch.distributed.rpc import RRef
from hearthstone.simulator.agent import AnnotatingAgent, Annotation, DiscoverChoiceAction, StandardAction, \
RearrangeCardsAction, HeroChoiceAction
class RemoteAgent(AnnotatingAgent):
def __init__(self, remote_agent: RRef):
self.remote_agent = remote_agent
... | 46.8 | 109 | 0.769231 | from torch.distributed.rpc import RRef
from hearthstone.simulator.agent import AnnotatingAgent, Annotation, DiscoverChoiceAction, StandardAction, \
RearrangeCardsAction, HeroChoiceAction
class RemoteAgent(AnnotatingAgent):
def __init__(self, remote_agent: RRef):
self.remote_agent = remote_agent
... | true | true |
f70c34cd3bb99fa7462ca40b5ee544919ee9b2e1 | 279 | py | Python | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_30/ar_/test_artificial_1024_RelativeDifference_MovingMedian_30__100.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_30/ar_/test_artificial_1024_RelativeDifference_MovingMedian_30__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_30/ar_/test_artificial_1024_RelativeDifference_MovingMedian_30__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 0); | 39.857143 | 179 | 0.74552 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 0); | true | true |
f70c34e56b4dd10253f14bf6d684816904c53872 | 168,083 | py | Python | src/sage/modular/abvar/abvar.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/modular/abvar/abvar.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/modular/abvar/abvar.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | """
Base class for modular abelian varieties
AUTHORS:
- William Stein (2007-03)
TESTS::
sage: A = J0(33)
sage: D = A.decomposition(); D
[
Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33),
Simple abelian subvariety 11a(3,33) of dimension 1 of J0(33),
Simple abelian subvariety 33a(... | 35.460549 | 253 | 0.556243 |
from sage.categories.all import ModularAbelianVarieties
from sage.structure.sequence import Sequence, Sequence_generic
from sage.structure.parent_base import ParentWithBase
from morphism import HeckeOperator, Morphism, DegeneracyMap
from torsion_subgroup import RationalTorsionSub... | true | true |
f70c35c3bf5d9fb9d99edee5fbf24e31338a5077 | 16,625 | py | Python | test/run-spec-test.py | losfair/wasm3 | 7a47041e3af6f69f5e2b469aa9dab301d5878f50 | [
"MIT"
] | null | null | null | test/run-spec-test.py | losfair/wasm3 | 7a47041e3af6f69f5e2b469aa9dab301d5878f50 | [
"MIT"
] | null | null | null | test/run-spec-test.py | losfair/wasm3 | 7a47041e3af6f69f5e2b469aa9dab301d5878f50 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec ../build-custom/wasm3
# ./run-spec-test.py --engine... | 29.529307 | 111 | 0.546045 |
import argparse
import os, sys, glob, time
import subprocess
import json
import re
import struct
import math
import pathlib
scriptDir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(os.path.join(scriptDir, '..', 'extra'))
from testutils import *
from pprint import pprint
parser = argparse.Argume... | true | true |
f70c35edfcb73c5024264ba6523c1067d54f29ec | 2,147 | py | Python | src/python/tests/appengine/handlers/testcase_detail/delete_test.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 1 | 2021-12-20T14:48:42.000Z | 2021-12-20T14:48:42.000Z | src/python/tests/appengine/handlers/testcase_detail/delete_test.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 2 | 2021-09-28T05:36:03.000Z | 2021-12-13T20:48:34.000Z | src/python/tests/appengine/handlers/testcase_detail/delete_test.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 1 | 2021-11-06T06:22:00.000Z | 2021-11-06T06:22:00.000Z | # Copyright 2019 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.573529 | 74 | 0.706567 | import flask
import unittest
import webtest
from datastore import data_types
from handlers.testcase_detail import delete
from libs import form
from tests.test_libs import helpers as test_helpers
from tests.test_libs import test_utils
@test_utils.with_cloud_emulators('datastore')
class HandlerTest(unittest.TestCase):... | true | true |
f70c37294d6f69da394b7f0744c44c5134a50d0e | 767 | py | Python | lektor/types/fake.py | yagebu/lektor | a31d8e57a5b2f4b090072527269c26a65202c736 | [
"BSD-3-Clause"
] | 4,104 | 2015-11-16T18:37:51.000Z | 2022-03-28T14:28:24.000Z | lektor/types/fake.py | yagebu/lektor | a31d8e57a5b2f4b090072527269c26a65202c736 | [
"BSD-3-Clause"
] | 854 | 2015-12-05T12:19:02.000Z | 2022-03-31T16:47:27.000Z | lektor/types/fake.py | yagebu/lektor | a31d8e57a5b2f4b090072527269c26a65202c736 | [
"BSD-3-Clause"
] | 442 | 2015-11-21T10:18:02.000Z | 2022-03-29T19:55:17.000Z | from lektor.constants import PRIMARY_ALT
from lektor.i18n import get_i18n_block
from lektor.types.base import Type
class FakeType(Type):
def value_from_raw(self, raw):
return None
def to_json(self, pad, record=None, alt=PRIMARY_ALT):
rv = Type.to_json(self, pad, record, alt)
rv["is_fa... | 21.914286 | 68 | 0.670143 | from lektor.constants import PRIMARY_ALT
from lektor.i18n import get_i18n_block
from lektor.types.base import Type
class FakeType(Type):
def value_from_raw(self, raw):
return None
def to_json(self, pad, record=None, alt=PRIMARY_ALT):
rv = Type.to_json(self, pad, record, alt)
rv["is_fa... | true | true |
f70c37c40d7c1c21c618b91fdf97259c369995d3 | 3,246 | py | Python | trafficlights/trafficlight.py | jean-charles-gibier/TrafficLights | a513e28c3c7349abefb39553ec46d3487af60a3d | [
"CC0-1.0"
] | null | null | null | trafficlights/trafficlight.py | jean-charles-gibier/TrafficLights | a513e28c3c7349abefb39553ec46d3487af60a3d | [
"CC0-1.0"
] | null | null | null | trafficlights/trafficlight.py | jean-charles-gibier/TrafficLights | a513e28c3c7349abefb39553ec46d3487af60a3d | [
"CC0-1.0"
] | null | null | null | """Module implémentant des classes en relations avec le menu."""
from typing import Callable, Dict, List, Tuple, AnyStr
class Trafficlight:
"""Modélise un feu de circulation présentant un état lumineux donné.
wrarn : la couleur affectée par défaut n'est pas validée par l'init
autrement dit on pe... | 37.744186 | 93 | 0.558534 |
from typing import Callable, Dict, List, Tuple, AnyStr
class Trafficlight:
def __init__(self, name: str = "None", current: str = "rouge") -> None:
self._name: str = name
self._current: str = current
self._triggers: Dict = {}
def add(self, trigger: AnyStr, source: AnyStr, ... | true | true |
f70c38682f59465a9fb9eb7311497596f5bc838a | 1,201 | py | Python | operators/clip.py | ngiambla/nnflex | 7c8bf46218ea70c6dad1efedf9e2069e41c4c3fa | [
"MIT"
] | null | null | null | operators/clip.py | ngiambla/nnflex | 7c8bf46218ea70c6dad1efedf9e2069e41c4c3fa | [
"MIT"
] | null | null | null | operators/clip.py | ngiambla/nnflex | 7c8bf46218ea70c6dad1efedf9e2069e41c4c3fa | [
"MIT"
] | null | null | null | ''' clip.py:
Implement's the clip ONNX node as a flexnode (for use with any accelerator)
'''
import uuid
import numpy as np
from operators.flexnode import FlexNode
from core.defines import Operator
from core.messaging import Message
class Clip(FlexNode):
def __init__(self, onnx_node, inputs, outputs):
... | 24.02 | 87 | 0.636969 | import uuid
import numpy as np
from operators.flexnode import FlexNode
from core.defines import Operator
from core.messaging import Message
class Clip(FlexNode):
def __init__(self, onnx_node, inputs, outputs):
FlexNode.__init__(self, onnx_node, inputs, outputs)
self._min = -3.402823466e+38
... | true | true |
f70c3872a89eb986046522f1dedbedb36f6db349 | 22,020 | py | Python | django/db/backends/sqlite3/base.py | krallin/django | c94db53eaa9b344f9227fa4dff2b1a5e9c7dce9d | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/sqlite3/base.py | krallin/django | c94db53eaa9b344f9227fa4dff2b1a5e9c7dce9d | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/sqlite3/base.py | krallin/django | c94db53eaa9b344f9227fa4dff2b1a5e9c7dce9d | [
"BSD-3-Clause"
] | null | null | null | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.db import utils
from django.db.backends import *
from django.db.backends.sqlite3.clien... | 42.264875 | 120 | 0.655767 | from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.db import utils
from django.db.backends import *
from django.db.backends.sqlite3.client import DatabaseClient
from django.db.backends.sqlite3.creation import DatabaseCreation
from django.db.backends.sqlite3.in... | true | true |
f70c38f2abdfbf52893c3f87e11b6b3559539623 | 817 | py | Python | Desafio069 - Cadastro de Pessoas.py | tmoura1981/Python_Exercicios | c873e2758dfd9058d2c2d83b5b38b522c6264029 | [
"MIT"
] | 1 | 2021-11-25T11:19:59.000Z | 2021-11-25T11:19:59.000Z | Desafio069 - Cadastro de Pessoas.py | tmoura1981/Python_Exercicios | c873e2758dfd9058d2c2d83b5b38b522c6264029 | [
"MIT"
] | null | null | null | Desafio069 - Cadastro de Pessoas.py | tmoura1981/Python_Exercicios | c873e2758dfd9058d2c2d83b5b38b522c6264029 | [
"MIT"
] | null | null | null | titulo = 'Cadastro de Pessoas'
print(titulo.center(50, '='))
print('')
idade = total = homens = mulheres = 0
sexo = ''
while True:
idade = int(input('Idade: '))
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
while sexo not in 'MF':
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
res... | 31.423077 | 69 | 0.549572 | titulo = 'Cadastro de Pessoas'
print(titulo.center(50, '='))
print('')
idade = total = homens = mulheres = 0
sexo = ''
while True:
idade = int(input('Idade: '))
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
while sexo not in 'MF':
sexo = input('Sexo: [M] ou [F]? ').upper().strip()[0]
res... | true | true |
f70c39a91009422b412e87c735b11f70e09938c7 | 743 | py | Python | paths.py | Leather128/Pygame-Pong | 33f6d76049c24edb56532314e1b29f4536269733 | [
"Apache-2.0"
] | null | null | null | paths.py | Leather128/Pygame-Pong | 33f6d76049c24edb56532314e1b29f4536269733 | [
"Apache-2.0"
] | null | null | null | paths.py | Leather128/Pygame-Pong | 33f6d76049c24edb56532314e1b29f4536269733 | [
"Apache-2.0"
] | null | null | null | import os
# Finds path of any file in the assets folder #
def findPath(folders, file, extension):
# Checks if it's an array (or other type of list idk, basically this should do the job) #
if(isinstance(folders, list)):
# Default folder path, being nothing #
folderPath = ""
# Loops thro... | 41.277778 | 115 | 0.631225 | import os
def findPath(folders, file, extension):
if(isinstance(folders, list)):
# Default folder path, being nothing #
folderPath = ""
# Loops through all the folders #
for x in folders:
# Joins them together #
folderPath = os.path.join(folderPath, x)
... | true | true |
f70c3a0de9e404646df16597de37a8fc1a1bd4bf | 3,818 | py | Python | setup.py | jimfulton/python-bigquery-sqlalchemy | 0443d7267a9330cba095193b4f9635574c8f7b05 | [
"MIT"
] | null | null | null | setup.py | jimfulton/python-bigquery-sqlalchemy | 0443d7267a9330cba095193b4f9635574c8f7b05 | [
"MIT"
] | null | null | null | setup.py | jimfulton/python-bigquery-sqlalchemy | 0443d7267a9330cba095193b4f9635574c8f7b05 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017 The sqlalchemy-bigquery Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# ... | 37.80198 | 82 | 0.688318 |
import io
import itertools
import os
import re
from setuptools import setup
name = "sqlalchemy-bigquery"
description = "SQLAlchemy dialect for BigQuery"
release_status = "Development Status :: 5 - Production/Stable"
package_root = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(package_root, "sql... | true | true |
f70c3a66baf4cad25be1fb1673d7a08bb0a51d03 | 11,737 | py | Python | TUI/Inst/APOGEE/ShutterWdgSet.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/Inst/APOGEE/ShutterWdgSet.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/Inst/APOGEE/ShutterWdgSet.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""APOGEE cold shutter control and status
History:
2011-08-30 ROwen
2011-09-01 ROwen Added support for cancelling commands.
2012-11-14 ROwen Stop using Checkbutton indicatoron=False; it is no longer supported on MacOS X.
2015-11-03 ROwen Replace "== None" with "is None" and "!= None" wit... | 32.693593 | 108 | 0.583113 | import Tkinter
import RO.Constants
import RO.Wdg
import RO.TkUtil
import RO.StringUtil
import TUI.Models
import TUI.Base.Wdg
from . import BaseDeviceWdg
class ShutterWdgSet(object):
_ShutterCat = "shutter"
_NumLEDs = 4
def __init__(self, gridder, statusBar, colSpan=3, helpURL=None):
self.statusBar ... | true | true |
f70c3b84214c735184f59a3de3b8b210a112ae56 | 2,142 | py | Python | nnutil2/layers/segment.py | aroig/nnutil2 | 1fc77df351d4eee1166688e25a94287a5cfa27c4 | [
"BSD-3-Clause"
] | null | null | null | nnutil2/layers/segment.py | aroig/nnutil2 | 1fc77df351d4eee1166688e25a94287a5cfa27c4 | [
"BSD-3-Clause"
] | 3 | 2020-11-13T18:33:29.000Z | 2021-08-25T15:55:57.000Z | nnutil2/layers/segment.py | aroig/nnutil2 | 1fc77df351d4eee1166688e25a94287a5cfa27c4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# nnutil2 - Tensorflow utilities for training neural networks
# Copyright (c) 2019, Abdó Roig-Maranges <abdo.roig@gmail.com>
#
# This file is part of 'nnutil2'.
#
# This file may be modified and distributed under the terms of the 3-clause BSD
# license. See the LICENSE fi... | 27.113924 | 79 | 0.618581 |
from typing import List
import tensorflow as tf
from ..util import kwargs_for
from .layer import Layer
class Segment(Layer):
def __init__(self, layers: List[Layer] = [], activation=None, **kwargs):
super(Segment, self).__init__(**kwargs)
self._segment_layers = layers
self._segment_activ... | true | true |
f70c3bc48d5319be629fe2d74c0f6f5b9d4ad98a | 1,556 | py | Python | setup.py | KarstenSchulz/twodolib | b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8 | [
"ISC"
] | 10 | 2015-09-24T02:23:24.000Z | 2020-03-08T09:21:20.000Z | setup.py | KarstenSchulz/twodolib | b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8 | [
"ISC"
] | 7 | 2015-09-15T15:45:00.000Z | 2020-08-21T07:04:44.000Z | setup.py | KarstenSchulz/twodolib | b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8 | [
"ISC"
] | 2 | 2017-07-03T14:15:50.000Z | 2019-08-30T13:58:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup script for twodolib."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.re... | 28.290909 | 72 | 0.621465 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', '')
test_requirements = ['tox', ]
setup(
n... | true | true |
f70c3bf1f81136316a9893d94d4bb86d634c3446 | 13,790 | py | Python | old_version_python/window.py | eweca-d/DysonSphereProgramCalculator | 935e3f15aeba7b10f716bee54d98b36d6fca771c | [
"MIT"
] | 32 | 2021-02-07T04:35:52.000Z | 2021-12-14T07:02:27.000Z | old_version_python/window.py | ladeca-d/DysonSphereProgramCalculator | 935e3f15aeba7b10f716bee54d98b36d6fca771c | [
"MIT"
] | null | null | null | old_version_python/window.py | ladeca-d/DysonSphereProgramCalculator | 935e3f15aeba7b10f716bee54d98b36d6fca771c | [
"MIT"
] | 11 | 2021-02-08T11:14:17.000Z | 2021-12-17T10:13:54.000Z | from PySide2.QtWidgets import QPushButton, QMainWindow, QLabel, QLineEdit, QGroupBox
from math import ceil
import source
class MainWindow(QMainWindow):
def __init__(self, screen_width, screen_height):
self.screen_width = screen_width
self.screen_height = screen_height
self.screen_ratio = s... | 48.385965 | 126 | 0.626613 | from PySide2.QtWidgets import QPushButton, QMainWindow, QLabel, QLineEdit, QGroupBox
from math import ceil
import source
class MainWindow(QMainWindow):
def __init__(self, screen_width, screen_height):
self.screen_width = screen_width
self.screen_height = screen_height
self.screen_ratio = s... | true | true |
f70c3cfc48871815483645f3e9d8c0ea781f9872 | 1,352 | py | Python | saleor/graphql/product/types/digital_contents.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 2 | 2021-01-31T00:28:42.000Z | 2021-01-31T12:30:46.000Z | saleor/graphql/product/types/digital_contents.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 19 | 2022-02-21T04:34:12.000Z | 2022-03-28T04:55:08.000Z | saleor/graphql/product/types/digital_contents.py | shannenye/saleor | f6a2d35fd8ae8d614edd952cd5c58adb82e56ab2 | [
"CC-BY-4.0"
] | 3 | 2021-02-22T16:37:18.000Z | 2021-02-22T18:56:28.000Z | import graphene
from graphene import relay
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...core.scalars import UUID
from ...meta.types import ObjectWithMetadata
class DigitalContentUrl(CountableDjangoObjectType):
url = graphene.String(description="URL for digital c... | 28.166667 | 69 | 0.656805 | import graphene
from graphene import relay
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...core.scalars import UUID
from ...meta.types import ObjectWithMetadata
class DigitalContentUrl(CountableDjangoObjectType):
url = graphene.String(description="URL for digital c... | true | true |
f70c3d27090122cbd9fceb2fd2fbf70a2213269b | 15,418 | py | Python | python/yb/download_and_extract_archive.py | deepld/yugabyte-db | 3a4464deef220f5bbc58cce22ad6bfa8c57c98a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/yb/download_and_extract_archive.py | deepld/yugabyte-db | 3a4464deef220f5bbc58cce22ad6bfa8c57c98a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/yb/download_and_extract_archive.py | deepld/yugabyte-db | 3a4464deef220f5bbc58cce22ad6bfa8c57c98a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) YugaByte, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 40.046753 | 99 | 0.644247 |
# even installed.
import os
import sys
import re
import logging
import socket
import random
import atexit
import subprocess
import argparse
import tempfile
import time
import getpass
import platform
import fcntl
import errno
g_verbose = False
EXPECTED_ARCHIVE_EXTENSION = '.tar.gz'
CHECKSUM_EXTENSION = '.sha256'
... | true | true |
f70c3dfba447061d7e08725b7b0184cabf89a717 | 162 | py | Python | python-port/speedclue/cards.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | 1 | 2017-10-20T14:24:06.000Z | 2017-10-20T14:24:06.000Z | python-port/speedclue/cards.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | null | null | null | python-port/speedclue/cards.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | null | null | null | CARDS = (
(('Gr', 'Mu', 'Pe', 'Pl', 'Sc', 'Wh')),
(('Ca', 'Kn', 'Pi', 'Re', 'Ro', 'Wr')),
(('Ba', 'Bi', 'Co', 'Di', 'Ha', 'Ki', 'Li', 'Lo', 'St')),
)
| 27 | 61 | 0.290123 | CARDS = (
(('Gr', 'Mu', 'Pe', 'Pl', 'Sc', 'Wh')),
(('Ca', 'Kn', 'Pi', 'Re', 'Ro', 'Wr')),
(('Ba', 'Bi', 'Co', 'Di', 'Ha', 'Ki', 'Li', 'Lo', 'St')),
)
| true | true |
f70c3e29979e263ef86f35ed84b4216ab4557a46 | 933 | py | Python | emcee/__init__.py | eteq/emcee | b410abe67936fb816c38470b3043532d2e2e6d0b | [
"MIT"
] | 14 | 2020-07-20T07:09:50.000Z | 2022-03-11T03:26:13.000Z | emcee/__init__.py | eteq/emcee | b410abe67936fb816c38470b3043532d2e2e6d0b | [
"MIT"
] | 38 | 2020-05-21T19:03:45.000Z | 2022-01-17T03:44:25.000Z | emcee/__init__.py | eteq/emcee | b410abe67936fb816c38470b3043532d2e2e6d0b | [
"MIT"
] | 8 | 2020-06-01T14:23:07.000Z | 2022-01-28T19:05:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
from .sampler import *
from .mh import *
from .ensemble import *
from .ptsampler import *
from . import utils
from . import autocorr
__version__ = "2.1.0"
def t... | 24.552632 | 69 | 0.542337 |
from __future__ import (division, print_function, absolute_import,
unicode_literals)
from .sampler import *
from .mh import *
from .ensemble import *
from .ptsampler import *
from . import utils
from . import autocorr
__version__ = "2.1.0"
def test():
from inspect import getmembers, ism... | true | true |
f70c3ec3e56c2cdd2299164142b1f0f2606d10e9 | 3,763 | py | Python | byceps/services/seating/area_service.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 23 | 2015-08-03T23:28:54.000Z | 2018-12-12T20:11:45.000Z | byceps/services/seating/area_service.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 1 | 2018-09-30T18:18:24.000Z | 2018-09-30T18:18:24.000Z | byceps/services/seating/area_service.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 9 | 2015-08-06T16:41:36.000Z | 2018-09-25T11:17:31.000Z | """
byceps.services.seating.area_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from typing import Optional
from sqlalchemy import select
from sqlalchemy.sql import Select
from ...d... | 27.874074 | 80 | 0.675791 |
from __future__ import annotations
from typing import Optional
from sqlalchemy import select
from sqlalchemy.sql import Select
from ...database import db, paginate, Pagination
from ...typing import PartyID
from ..ticketing.dbmodels.ticket import Ticket as DbTicket
from .dbmodels.area import Area as DbArea
from .db... | true | true |
f70c3f84510bef0cd92d2e436087e79ae700c7a7 | 1,617 | py | Python | docs/cornell CS class/lesson 10. Algorithm Design/demos/test_helpers.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 10. Algorithm Design/demos/test_helpers.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 10. Algorithm Design/demos/test_helpers.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
Unit test for multiple modules
This module illustrates what a proper unit test should look like.
Each function being tested has its own test procedure.
It also has a segment of "script code" that invokes the test
procedure when this module is run as an script.
Author: Walker M. White
Date: February 14, 2019
""... | 23.779412 | 65 | 0.682127 | import introcs import helpers
def test_first_name():
print('Testing first_name')
result = helpers.first_name('Walker White')
introcs.assert_equals('Walker',result)
result = helpers.first_name('Walker White')
introcs.assert_equals('Walker',result)
def test_last_nam... | true | true |
f70c3fb1ca6b1d6c60f6960e42fcf6161e4fb84e | 5,473 | py | Python | cnn_bin_to_csv_converter/cnn_bin_file_to_csv_converter.py | Riteshbansal/BigDataTextSummarization | 463ebc7d70d4829f4d92c33d2180eb3ae6031c71 | [
"BSD-3-Clause"
] | 1 | 2018-12-06T17:41:36.000Z | 2018-12-06T17:41:36.000Z | cnn_bin_to_csv_converter/cnn_bin_file_to_csv_converter.py | Riteshbansal/BigDataTextSummarization | 463ebc7d70d4829f4d92c33d2180eb3ae6031c71 | [
"BSD-3-Clause"
] | null | null | null | cnn_bin_to_csv_converter/cnn_bin_file_to_csv_converter.py | Riteshbansal/BigDataTextSummarization | 463ebc7d70d4829f4d92c33d2180eb3ae6031c71 | [
"BSD-3-Clause"
] | 2 | 2018-11-09T15:20:24.000Z | 2018-11-21T06:34:01.000Z | import glob, struct, random, csv
from tensorflow.core.example import example_pb2
# <s> and </s> are used in the data files to segment the abstracts into sentences. They don't receive vocab ids.
SENTENCE_START = '<s>'
SENTENCE_END = '</s>'
PAD_TOKEN = '[PAD]' # This has a vocab id, which is used to pad the encoder in... | 45.231405 | 195 | 0.655582 | import glob, struct, random, csv
from tensorflow.core.example import example_pb2
SENTENCE_START = '<s>'
SENTENCE_END = '</s>'
PAD_TOKEN = '[PAD]' # This has a vocab id, which is used to pad the encoder input, decoder input and target sequence
UNKNOWN_TOKEN = '[UNK]' # This has a vocab id, which is used to represent... | false | true |
f70c3ff4abf853d2e0f73c630cdcf9d40b4f5ab7 | 983 | py | Python | Assets/GameSparks/Editor/post_process.py | dgeisert/MiniJam72AdventureDeath | 8cb7eea2111984f6f63486c54dadb7950adf9ff3 | [
"Unlicense"
] | null | null | null | Assets/GameSparks/Editor/post_process.py | dgeisert/MiniJam72AdventureDeath | 8cb7eea2111984f6f63486c54dadb7950adf9ff3 | [
"Unlicense"
] | null | null | null | Assets/GameSparks/Editor/post_process.py | dgeisert/MiniJam72AdventureDeath | 8cb7eea2111984f6f63486c54dadb7950adf9ff3 | [
"Unlicense"
] | null | null | null | import os
import re
from sys import argv
from mod_pbxproj import XcodeProject
path = argv[1]
print path
project = XcodeProject.Load(path +'/Unity-iPhone.xcodeproj/project.pbxproj')
project.add_file_if_doesnt_exist('System/Library/Frameworks/Security.framework', tree='SDKROOT')
project.add_file_if_doesnt_exist('usr/l... | 27.305556 | 96 | 0.720244 | import os
import re
from sys import argv
from mod_pbxproj import XcodeProject
path = argv[1]
print path
project = XcodeProject.Load(path +'/Unity-iPhone.xcodeproj/project.pbxproj')
project.add_file_if_doesnt_exist('System/Library/Frameworks/Security.framework', tree='SDKROOT')
project.add_file_if_doesnt_exist('usr/l... | false | true |
f70c4348b188e43d79cf8b756f4fb1b4466cb021 | 2,025 | py | Python | indy-tests/utils/utils.py | NgoAnhKhoi/indy-testcase | 1f85d2b7e77a5bb9637379286d7f7f142c2c626e | [
"MIT"
] | null | null | null | indy-tests/utils/utils.py | NgoAnhKhoi/indy-testcase | 1f85d2b7e77a5bb9637379286d7f7f142c2c626e | [
"MIT"
] | null | null | null | indy-tests/utils/utils.py | NgoAnhKhoi/indy-testcase | 1f85d2b7e77a5bb9637379286d7f7f142c2c626e | [
"MIT"
] | null | null | null | '''
Created on Nov 9, 2017
@author: khoi.ngo
'''
def generate_random_string(prefix="", suffix="", size=20):
"""
Generate random string .
:param prefix: (optional) Prefix of a string.
:param suffix: (optional) Suffix of a string.
:param length: (optional) Max length of a string (include prefix an... | 25.961538 | 109 | 0.620247 |
def generate_random_string(prefix="", suffix="", size=20):
import random
import string
left_size = size - len(prefix) - len(suffix)
random_str = ""
if left_size > 0:
random_str = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(left_size))
else:
prin... | true | true |
f70c43bdfff63a45fb5bec5cb16598d64f9c9443 | 2,990 | py | Python | Alexa.py | Rashid7520/alexa | 7b5ed9df32222ce1c402f230ade22c7a69b33677 | [
"Apache-2.0"
] | 1 | 2022-02-28T17:03:13.000Z | 2022-02-28T17:03:13.000Z | Alexa.py | Rashid7520/alexa | 7b5ed9df32222ce1c402f230ade22c7a69b33677 | [
"Apache-2.0"
] | null | null | null | Alexa.py | Rashid7520/alexa | 7b5ed9df32222ce1c402f230ade22c7a69b33677 | [
"Apache-2.0"
] | null | null | null | import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
import webbrowser
import os
#import pyaudio
listenner = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty("voices")
engine.setProperty('voice', voices[1].id)
def talk(text):... | 27.181818 | 100 | 0.576254 | import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
import webbrowser
import os
listenner = sr.Recognizer()
engine = pyttsx3.init()
voices = engine.getProperty("voices")
engine.setProperty('voice', voices[1].id)
def talk(text):
engine.sa... | true | true |
f70c43e5dc3ab182467438f8d6eb12b710ec1190 | 615 | py | Python | backend/restaurants/migrations/0007_restaurantlocation_owner.py | mahmoud-batman/resturants-club | 095bf9b9b5d82a86d6e610517770f1223bb1ef59 | [
"MIT"
] | null | null | null | backend/restaurants/migrations/0007_restaurantlocation_owner.py | mahmoud-batman/resturants-club | 095bf9b9b5d82a86d6e610517770f1223bb1ef59 | [
"MIT"
] | null | null | null | backend/restaurants/migrations/0007_restaurantlocation_owner.py | mahmoud-batman/resturants-club | 095bf9b9b5d82a86d6e610517770f1223bb1ef59 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-27 18:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('restaurants', '0006_auto... | 27.954545 | 133 | 0.686179 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('restaurants', '0006_auto_20200927_0920'),
]
operations = [
... | true | true |
f70c44b187ccf305b57f7409d5e44844eb21cf70 | 629 | py | Python | test_bdmodels/testmigs/migrations/0001_initial.py | Matific/broken-down-models | abc665917928102052069ed07f6f396b5a603373 | [
"MIT"
] | 4 | 2021-08-18T14:34:17.000Z | 2021-11-23T12:55:05.000Z | test_bdmodels/testmigs/migrations/0001_initial.py | Matific/broken-down-models | abc665917928102052069ed07f6f396b5a603373 | [
"MIT"
] | 13 | 2021-08-18T10:17:58.000Z | 2022-02-13T15:11:21.000Z | test_bdmodels/testmigs/migrations/0001_initial.py | Matific/broken-down-models | abc665917928102052069ed07f6f396b5a603373 | [
"MIT"
] | 1 | 2021-09-09T16:08:04.000Z | 2021-09-09T16:08:04.000Z | # Generated by Django 2.2.23 on 2021-07-07 13:18
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BigModel',
fields=[
('id', models.AutoFiel... | 25.16 | 76 | 0.54213 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BigModel',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
... | true | true |
f70c4510e1c769c5ddba6263ecda35d921c80b8e | 4,335 | py | Python | lightly/openapi_generated/swagger_client/models/job_status_data_result.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 1,515 | 2020-10-05T13:04:17.000Z | 2022-03-31T16:14:55.000Z | lightly/openapi_generated/swagger_client/models/job_status_data_result.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 628 | 2020-10-14T11:38:51.000Z | 2022-03-31T14:40:54.000Z | lightly/openapi_generated/swagger_client/models/job_status_data_result.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 108 | 2020-10-17T08:31:06.000Z | 2022-03-20T16:44:22.000Z | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version: 1.0.0
Contact: support@lightly... | 28.708609 | 220 | 0.582699 |
import pprint
import re
import six
from lightly.openapi_generated.swagger_client.configuration import Configuration
class JobStatusDataResult(object):
swagger_types = {
'type': 'JobResultType',
'data': 'GeneralJobResult'
}
attribute_map = {
'type': 'type',
'data': '... | true | true |
f70c45334caae225348d1f4da8df8a9711e75ae9 | 349 | py | Python | Flask/apps/main/errors.py | bkjml/online-bus-tickting-system | 8b3728238417532b34b90e2af98d445b10c1c3be | [
"MIT"
] | null | null | null | Flask/apps/main/errors.py | bkjml/online-bus-tickting-system | 8b3728238417532b34b90e2af98d445b10c1c3be | [
"MIT"
] | null | null | null | Flask/apps/main/errors.py | bkjml/online-bus-tickting-system | 8b3728238417532b34b90e2af98d445b10c1c3be | [
"MIT"
] | null | null | null | from flask import render_template
from .import main
@main.app_errorhandler(404) #if error handlers used instead app_errorhandler the instnace is available only for errors originate in blueprint
def page_not_found(e):
return render_template(''), 404
@main.app_errorhandler(500)
def internal_server_error(e):
re... | 34.9 | 142 | 0.796562 | from flask import render_template
from .import main
@main.app_errorhandler(404) def page_not_found(e):
return render_template(''), 404
@main.app_errorhandler(500)
def internal_server_error(e):
return render_template(''), 500 | true | true |
f70c45d1c780fe80cae7e22e7cf26e9752f6ec9c | 341 | py | Python | lib/setup.py | quartictech/orinoco | d0f2dec19a687f5140ae5d1b61975be617065690 | [
"BSD-3-Clause"
] | null | null | null | lib/setup.py | quartictech/orinoco | d0f2dec19a687f5140ae5d1b61975be617065690 | [
"BSD-3-Clause"
] | null | null | null | lib/setup.py | quartictech/orinoco | d0f2dec19a687f5140ae5d1b61975be617065690 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
setup(name='orinoco',
version='0.1',
description='Sweet data integration',
author='Quartic Technologies',
author_email='alex@quartic.io',
license='MIT',
packages=['orinoco'],
install_requires=[
'aiohttp',
'pyformance'
],
... | 22.733333 | 43 | 0.592375 | from setuptools import setup
setup(name='orinoco',
version='0.1',
description='Sweet data integration',
author='Quartic Technologies',
author_email='alex@quartic.io',
license='MIT',
packages=['orinoco'],
install_requires=[
'aiohttp',
'pyformance'
],
... | true | true |
f70c4887921a9859df7647540889e198cf25bbcd | 3,362 | py | Python | src/utils/output_inference_images.py | stasys-hub/Collembola_AI | 373266d5edde0ad04d898de82c2a1eac89961e30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T12:49:12.000Z | 2022-03-31T12:49:12.000Z | src/utils/output_inference_images.py | stasys-hub/Collembola_AI | 373266d5edde0ad04d898de82c2a1eac89961e30 | [
"BSD-3-Clause"
] | null | null | null | src/utils/output_inference_images.py | stasys-hub/Collembola_AI | 373266d5edde0ad04d898de82c2a1eac89961e30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Project title: CollembolAI
Authors: Stephan Weißbach, Stanislav Sys, Clément Schneider
Original repository: https://github.com/stasys-hub/Collembola_AI.git
Module title: output_inference_images
.py
Purpose: draws bounding boxes from annotation on pictures.... | 39.552941 | 172 | 0.629982 |
from PIL import Image, ImageFont, ImageDraw
import os
from utils.cocoutils import coco2df
def draw_coco_bbox(
coco,
out_dir,
coco_dir,
eval_mode=False,
prefix="annotated",
line_width=10,
fontsize=80,
fontYshift=-70,
):
with open(
os.path.join(os.path.dirname(os.path.re... | true | true |
f70c488c62af1145be4b18caddcaa7a6a066aabc | 60 | py | Python | tutorials/unittests/python/src/evenodd_finder.py | nithyarajendiran/softwaretesting | 0fdaaca51804529acf5578e59b2afb0119524dbd | [
"MIT"
] | 13 | 2016-02-08T04:32:22.000Z | 2021-11-15T16:19:10.000Z | tutorials/unittests/python/src/evenodd_finder.py | nithyarajendiran/softwaretesting | 0fdaaca51804529acf5578e59b2afb0119524dbd | [
"MIT"
] | 3 | 2016-04-18T19:04:27.000Z | 2017-01-21T19:07:01.000Z | tutorials/unittests/python/src/evenodd_finder.py | nithyarajendiran/softwaretesting | 0fdaaca51804529acf5578e59b2afb0119524dbd | [
"MIT"
] | 67 | 2015-07-27T23:44:47.000Z | 2022-02-20T14:38:49.000Z | def is_even(n):
if n%2 is 0:
return True
return False
| 12 | 15 | 0.65 | def is_even(n):
if n%2 is 0:
return True
return False
| true | true |
f70c48d4ef5485c7e9a680e396b7437268194f99 | 924 | bzl | Python | third_party/llvm/workspace.bzl | Jonathan-Atrey/tensorflow | 7b508870c2d19dc9772745aa55d953517fcb406d | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | Jonathan-Atrey/tensorflow | 7b508870c2d19dc9772745aa55d953517fcb406d | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | Jonathan-Atrey/tensorflow | 7b508870c2d19dc9772745aa55d953517fcb406d | [
"Apache-2.0"
] | null | null | null | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "5020e104a1349a0ae6532b007b48c68b8f64c049"
LLVM_SHA256 = "3113dbc5f7b3e6405375eedfe95e220268bcc4818c8d8453a23ef00f82d4b172"
tf_http_archive(
... | 42 | 149 | 0.676407 |
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
LLVM_COMMIT = "5020e104a1349a0ae6532b007b48c68b8f64c049"
LLVM_SHA256 = "3113dbc5f7b3e6405375eedfe95e220268bcc4818c8d8453a23ef00f82d4b172"
tf_http_archive(
name = name,
sha256 = LLVM_SHA256,
strip_prefix = "llvm-proj... | true | true |
f70c49fdef97e4475c713c043941d0fc73f98979 | 638 | py | Python | example/tests/orders/test_orders_signals.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 222 | 2020-02-03T16:58:56.000Z | 2022-03-30T16:35:35.000Z | example/tests/orders/test_orders_signals.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 16 | 2020-03-17T12:38:27.000Z | 2022-03-16T13:14:55.000Z | example/tests/orders/test_orders_signals.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 23 | 2020-08-28T04:46:33.000Z | 2022-01-12T21:57:39.000Z | import pytest
from salesman.orders.models import Order
from salesman.orders.signals import status_changed
_signal_called = False
def on_status_changed(sender, order, new_status, old_status, **kwargs):
global _signal_called
_signal_called = True
@pytest.mark.django_db
def test_order_changed_signal(rf):
... | 29 | 84 | 0.789969 | import pytest
from salesman.orders.models import Order
from salesman.orders.signals import status_changed
_signal_called = False
def on_status_changed(sender, order, new_status, old_status, **kwargs):
global _signal_called
_signal_called = True
@pytest.mark.django_db
def test_order_changed_signal(rf):
... | true | true |
f70c4b0fbc3e1bc9072c62f3aaa47973f8478299 | 37 | py | Python | archive/model/__init__.py | winstonwzhang/osumapper | e773b45650f8a013de48ff169a93ea1745c6f931 | [
"Apache-2.0"
] | null | null | null | archive/model/__init__.py | winstonwzhang/osumapper | e773b45650f8a013de48ff169a93ea1745c6f931 | [
"Apache-2.0"
] | null | null | null | archive/model/__init__.py | winstonwzhang/osumapper | e773b45650f8a013de48ff169a93ea1745c6f931 | [
"Apache-2.0"
] | null | null | null |
import sys
sys.path.append('model/') | 12.333333 | 25 | 0.72973 |
import sys
sys.path.append('model/') | true | true |
f70c4c0aca8a0ff7a8de0e6c05ec2770c0771307 | 555 | py | Python | pyvo/vomas/utils/file_utils.py | lmichel/pyvo | 8296bee2e799843909805fb6ae528a9b23776e8d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | pyvo/vomas/utils/file_utils.py | lmichel/pyvo | 8296bee2e799843909805fb6ae528a9b23776e8d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | pyvo/vomas/utils/file_utils.py | lmichel/pyvo | 8296bee2e799843909805fb6ae528a9b23776e8d | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | '''
Created on Feb 26, 2021
@author: laurentmichel
'''
import os
class FileUtils(object):
file_path = os.path.dirname(os.path.realpath(__file__))
@staticmethod
def get_datadir():
return os.path.realpath(os.path.join(FileUtils.file_path, "../client/tests/", "data"))
@staticmethod
def... | 25.227273 | 94 | 0.643243 | import os
class FileUtils(object):
file_path = os.path.dirname(os.path.realpath(__file__))
@staticmethod
def get_datadir():
return os.path.realpath(os.path.join(FileUtils.file_path, "../client/tests/", "data"))
@staticmethod
def get_projectdir():
return os.path.realpath(os.pa... | true | true |
f70c4cd98e14e53f4160fd2649739493408ee4e7 | 5,578 | py | Python | train.py | briancylui/ALOCC-CVPR2018 | 78b6a1e8f3fcde8a46a88294926074a65ff0726a | [
"MIT"
] | 208 | 2018-03-16T11:48:59.000Z | 2022-03-22T14:34:06.000Z | train.py | briancylui/ALOCC-CVPR2018 | 78b6a1e8f3fcde8a46a88294926074a65ff0726a | [
"MIT"
] | 24 | 2018-05-10T09:07:08.000Z | 2022-02-15T10:03:46.000Z | train.py | briancylui/ALOCC-CVPR2018 | 78b6a1e8f3fcde8a46a88294926074a65ff0726a | [
"MIT"
] | 80 | 2018-03-21T08:16:18.000Z | 2022-03-13T12:52:29.000Z | import os
import numpy as np
from models import ALOCC_Model
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 40, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.002, "Learning rate of for adam [0.0002]")
flags.DEFINE_fl... | 44.269841 | 131 | 0.609896 | import os
import numpy as np
from models import ALOCC_Model
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 40, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.002, "Learning rate of for adam [0.0002]")
flags.DEFINE_fl... | true | true |
f70c4d3b5c86a34651890132efccc338f4586820 | 918 | py | Python | pipeline/pipeline_import_paths.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 118 | 2020-11-04T16:48:12.000Z | 2022-03-28T13:15:37.000Z | pipeline/pipeline_import_paths.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 23 | 2020-10-19T09:01:37.000Z | 2022-03-25T09:12:31.000Z | pipeline/pipeline_import_paths.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 29 | 2020-11-25T05:28:32.000Z | 2022-03-23T07:20:23.000Z | # Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import sys
import os.path as path
# when developing, prefer local kapture to the one installed on the system
HERE_PATH = path.abspath(path.normpath(path.dirname(__file__)))
KATURE_LOCALIZATION_REPO_PATH = path.normpath(path.join(HERE_PATH, '../'))
# che... | 43.714286 | 93 | 0.781046 |
import sys
import os.path as path
HERE_PATH = path.abspath(path.normpath(path.dirname(__file__)))
KATURE_LOCALIZATION_REPO_PATH = path.normpath(path.join(HERE_PATH, '../'))
if path.isdir(path.join(KATURE_LOCALIZATION_REPO_PATH, 'kapture_localization')):
sys.path.insert(0, KATURE_LOCALIZATION_REPO_PATH)
| true | true |
f70c505c88c54964fea3593bedb0769499834a3c | 257 | py | Python | examples/exclude_defaults_none.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 118 | 2020-05-24T20:22:27.000Z | 2022-03-23T23:04:50.000Z | examples/exclude_defaults_none.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 89 | 2021-02-26T14:22:41.000Z | 2022-03-30T22:17:06.000Z | examples/exclude_defaults_none.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 13 | 2020-12-24T22:43:50.000Z | 2022-03-13T15:03:44.000Z | from dataclasses import dataclass
from apischema import serialize
@dataclass
class Foo:
bar: int = 0
baz: str | None = None
assert serialize(Foo, Foo(), exclude_defaults=True) == {}
assert serialize(Foo, Foo(), exclude_none=True) == {"bar": 0}
| 18.357143 | 61 | 0.692607 | from dataclasses import dataclass
from apischema import serialize
@dataclass
class Foo:
bar: int = 0
baz: str | None = None
assert serialize(Foo, Foo(), exclude_defaults=True) == {}
assert serialize(Foo, Foo(), exclude_none=True) == {"bar": 0}
| true | true |
f70c51db8a5f81dccf5c9556e871a85a69eb8c42 | 2,267 | py | Python | Code/Molweni/MolweniConfig.py | Aopolin-Lv/NLP_MRC | 62507e1fa0d024e2c6ca3cab37f94a015c071cf9 | [
"Apache-2.0"
] | null | null | null | Code/Molweni/MolweniConfig.py | Aopolin-Lv/NLP_MRC | 62507e1fa0d024e2c6ca3cab37f94a015c071cf9 | [
"Apache-2.0"
] | null | null | null | Code/Molweni/MolweniConfig.py | Aopolin-Lv/NLP_MRC | 62507e1fa0d024e2c6ca3cab37f94a015c071cf9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
@Time: 2020/11/14 2:15 下午
@Author: Aopolin
@File: MolweniConfig.py
@Contact: aopolin.ii@gmail.com
@Description:
"""
class Config(object):
def __init__(self):
self.SQUAD_DIR = "../../Dataset/squad2.0"
self.MOLWENI_DIR = "../../Dataset/Molweni"
... | 31.929577 | 128 | 0.602117 |
class Config(object):
def __init__(self):
self.SQUAD_DIR = "../../Dataset/squad2.0"
self.MOLWENI_DIR = "../../Dataset/Molweni"
self.model_type = "bert" self.model_name_or_path = "bert-base-uncased"
self.output_dir = "/tmp/debug_squad/" self.data_dir = ""
... | true | true |
f70c531988d553f61ca2d9e8c0976401be0015f1 | 8,831 | py | Python | google/cloud/aiplatform_v1/types/dataset.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/dataset.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/dataset.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 37.261603 | 110 | 0.649417 | import proto
from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
from google.cloud.aiplatform_v1.types import io
from google.protobuf import struct_pb2 from google.protobuf import timestamp_pb2
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1",
manifest={
... | true | true |
f70c53fffb048f9fbd54384d990e79e47914bdb4 | 590 | py | Python | pyformlang/regular_expression/__init__.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | pyformlang/regular_expression/__init__.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | 1 | 2020-07-22T11:40:30.000Z | 2020-07-22T11:40:30.000Z | pyformlang/regular_expression/__init__.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | """
:mod:`pyformlang.regular_expression`
====================================
This module deals with regular expression.
By default, this module does not use the standard way to write regular
expressions. Please read the documentation of Regex for more information.
Available Classes
-----------------
Regex
A re... | 22.692308 | 73 | 0.720339 |
from .regex import Regex
from .regex_objects import MisformedRegexError
from .python_regex import PythonRegex
__all__ = ["Regex", "PythonRegex", "MisformedRegexError"]
| true | true |
f70c54a7ba4a717f4018e33e0949863ac4c6ac3f | 1,947 | py | Python | setup.py | mzy2240/openSE | b6ab59b49efe46ac60e7e993a6096d8a69e3219b | [
"Apache-2.0"
] | null | null | null | setup.py | mzy2240/openSE | b6ab59b49efe46ac60e7e993a6096d8a69e3219b | [
"Apache-2.0"
] | null | null | null | setup.py | mzy2240/openSE | b6ab59b49efe46ac60e7e993a6096d8a69e3219b | [
"Apache-2.0"
] | null | null | null | from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
# note: all settings are in settings.ini; edit there, not here
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
... | 40.5625 | 102 | 0.666667 | from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
cfg_keys = 'version description keywords author author_email'.... | true | true |
f70c54ace8d3b1e3d7e5d360387aff531bf3b870 | 4,368 | py | Python | src/tagging/train.py | grahamwhiteuk/neutralizing-bias | a6ef764046fcc68ac0daa612c160ec23a79d3e73 | [
"MIT"
] | 169 | 2019-11-20T05:20:05.000Z | 2022-03-25T11:56:26.000Z | src/tagging/train.py | grahamwhiteuk/neutralizing-bias | a6ef764046fcc68ac0daa612c160ec23a79d3e73 | [
"MIT"
] | 10 | 2020-02-10T21:41:10.000Z | 2022-02-05T10:37:52.000Z | src/tagging/train.py | grahamwhiteuk/neutralizing-bias | a6ef764046fcc68ac0daa612c160ec23a79d3e73 | [
"MIT"
] | 44 | 2019-11-26T11:54:45.000Z | 2022-03-03T23:16:04.000Z | # -*- coding: utf-8 -*-
"""
train bert
python tagging/train.py --train ../../data/v6/corpus.wordbiased.tag.train --test ../../data/v6/corpus.wordbiased.tag.test --working_dir TEST --train_batch_size 3 --test_batch_size 10 --hidden_size 32 --debug_skip
"""
from pytorch_pretrained_bert.tokenization import BertTokenize... | 31.883212 | 213 | 0.690247 | from pytorch_pretrained_bert.tokenization import BertTokenizer
from pytorch_pretrained_bert.optimization import BertAdam
from collections import defaultdict
from torch.utils.data import TensorDataset, DataLoader, RandomSampler
from tqdm import tqdm
import torch
import torch.nn as nn
import pickle
import sys
import os
... | true | true |
f70c558e8e110dc473b09a410155f7b271c28ec7 | 480 | py | Python | Pupil3dDetectorOSC/SetROI.py | SummerSigh/VrEyeToolbox | 8e7c21e4a5ee95db9aea4b1bce0a3966156b9e5c | [
"MIT"
] | 9 | 2022-03-17T02:00:45.000Z | 2022-03-21T00:20:46.000Z | Pupil3dDetectorOSC/SetROI.py | SummerSigh/VrEyeToolbox | 8e7c21e4a5ee95db9aea4b1bce0a3966156b9e5c | [
"MIT"
] | null | null | null | Pupil3dDetectorOSC/SetROI.py | SummerSigh/VrEyeToolbox | 8e7c21e4a5ee95db9aea4b1bce0a3966156b9e5c | [
"MIT"
] | null | null | null | from re import X
from tkinter import Y
import cv2
cap = cv2.VideoCapture("demo2.mp4")
ret, img = cap.read()
roibb = cv2.selectROI("image", img, fromCenter=False, showCrosshair=True)
print('X', roibb[0])
print('Y', roibb[1])
print('Width', roibb[2])
print('Height', roibb[3])
with open('roi.cfg', 'w+') as rf:
rf.w... | 22.857143 | 73 | 0.625 | from re import X
from tkinter import Y
import cv2
cap = cv2.VideoCapture("demo2.mp4")
ret, img = cap.read()
roibb = cv2.selectROI("image", img, fromCenter=False, showCrosshair=True)
print('X', roibb[0])
print('Y', roibb[1])
print('Width', roibb[2])
print('Height', roibb[3])
with open('roi.cfg', 'w+') as rf:
rf.w... | true | true |
f70c5661944cec2cc6f4ba9452219086980e1ea2 | 655 | py | Python | venv/Lib/site-packages/nipype/interfaces/dipy/registration.py | richung99/digitizePlots | 6b408c820660a415a289726e3223e8f558d3e18b | [
"MIT"
] | 585 | 2015-01-12T16:06:47.000Z | 2022-03-26T14:51:08.000Z | nipype/interfaces/dipy/registration.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 2,329 | 2015-01-01T09:56:41.000Z | 2022-03-30T14:24:49.000Z | nipype/interfaces/dipy/registration.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 487 | 2015-01-20T01:04:52.000Z | 2022-03-21T21:22:47.000Z | from distutils.version import LooseVersion
from ... import logging
from .base import HAVE_DIPY, dipy_version, dipy_to_nipype_interface, get_dipy_workflows
IFLOGGER = logging.getLogger("nipype.interface")
if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion("0.15"):
from dipy.workflows import align
... | 29.772727 | 87 | 0.717557 | from distutils.version import LooseVersion
from ... import logging
from .base import HAVE_DIPY, dipy_version, dipy_to_nipype_interface, get_dipy_workflows
IFLOGGER = logging.getLogger("nipype.interface")
if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion("0.15"):
from dipy.workflows import align
... | true | true |
f70c56dae054122f2ba8494eb90f9965b9b545a2 | 203 | py | Python | approaches/__init__.py | JetBrains-Research/docs-fine-tuning | a56e1f1e4183432994a40ac796a36095a747e052 | [
"MIT"
] | null | null | null | approaches/__init__.py | JetBrains-Research/docs-fine-tuning | a56e1f1e4183432994a40ac796a36095a747e052 | [
"MIT"
] | null | null | null | approaches/__init__.py | JetBrains-Research/docs-fine-tuning | a56e1f1e4183432994a40ac796a36095a747e052 | [
"MIT"
] | null | null | null | from approaches.abstract_approach import AbstractApproach
from approaches.simple import SimpleApproach
from approaches.tfidf import TfIdfApproach
from approaches.intersection import IntersectionApproach
| 40.6 | 57 | 0.901478 | from approaches.abstract_approach import AbstractApproach
from approaches.simple import SimpleApproach
from approaches.tfidf import TfIdfApproach
from approaches.intersection import IntersectionApproach
| true | true |
f70c56e55155862a4b331fc2e4813966d327374e | 6,619 | py | Python | sagemaker-dash/tutorials/app15.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 13 | 2021-05-23T15:47:24.000Z | 2022-03-24T16:22:14.000Z | sagemaker-dash/tutorials/app15.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 4 | 2021-11-16T20:44:55.000Z | 2022-01-13T19:13:38.000Z | sagemaker-dash/tutorials/app15.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 11 | 2021-01-31T06:18:10.000Z | 2021-11-21T00:02:05.000Z | import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.express as px
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
df = pd.read_csv('https://plotly.github.io/data... | 35.395722 | 78 | 0.500227 | import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.express as px
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
df = pd.read_csv('https://plotly.github.io/data... | true | true |
f70c5741e0bdc69a1654286b32fcf96209f03e6b | 3,111 | py | Python | tests/semver/test_parse_constraint.py | henryiii/poetry-core | c0d7e52f49b12092ba6829ecb02db7701cbff019 | [
"MIT"
] | null | null | null | tests/semver/test_parse_constraint.py | henryiii/poetry-core | c0d7e52f49b12092ba6829ecb02db7701cbff019 | [
"MIT"
] | null | null | null | tests/semver/test_parse_constraint.py | henryiii/poetry-core | c0d7e52f49b12092ba6829ecb02db7701cbff019 | [
"MIT"
] | 1 | 2021-04-08T03:26:23.000Z | 2021-04-08T03:26:23.000Z | import pytest
from poetry.core.semver import Version
from poetry.core.semver import VersionRange
from poetry.core.semver import VersionUnion
from poetry.core.semver import parse_constraint
@pytest.mark.parametrize(
"constraint,version",
[
("~=3.8", VersionRange(min=Version(3, 8), max=Version(4, 0), i... | 34.186813 | 88 | 0.491803 | import pytest
from poetry.core.semver import Version
from poetry.core.semver import VersionRange
from poetry.core.semver import VersionUnion
from poetry.core.semver import parse_constraint
@pytest.mark.parametrize(
"constraint,version",
[
("~=3.8", VersionRange(min=Version(3, 8), max=Version(4, 0), i... | true | true |
f70c577d5a00a0cb8f77a0f4b89135a1f7157793 | 206 | py | Python | PyMOTW/source/itertools/itertools_repeat_map.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/itertools/itertools_repeat_map.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/itertools/itertools_repeat_map.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
"""Using repeat() and map()
"""
#end_pymotw_header
from itertools import *
for i in map(lambda x, y: (x, y, x * y), repeat(2), range(5)):
print('{:d} * {:d} = {:d}'.format(*i))
| 20.6 | 62 | 0.572816 |
from itertools import *
for i in map(lambda x, y: (x, y, x * y), repeat(2), range(5)):
print('{:d} * {:d} = {:d}'.format(*i))
| true | true |
f70c5874fbd5bf53254b675479e8a23d62b45722 | 8,237 | py | Python | Projects/Sugarscape/Model.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | 16 | 2019-01-10T18:54:13.000Z | 2022-01-28T20:07:20.000Z | Projects/Sugarscape/Model.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | null | null | null | Projects/Sugarscape/Model.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | 15 | 2019-01-24T17:11:20.000Z | 2021-12-11T01:53:57.000Z | import numpy as np
import pandas as pd
from scipy.stats.mstats import gmean
import random
import math
from randomdict import RandomDict
# from chest import *
import shelve
from Patch import *
from AgentBranch import *
import gc
from memory_profiler import memory_usage
#Model.py
class Model():
def __init__(self, gu... | 42.901042 | 119 | 0.552264 | import numpy as np
import pandas as pd
from scipy.stats.mstats import gmean
import random
import math
from randomdict import RandomDict
import shelve
from Patch import *
from AgentBranch import *
import gc
from memory_profiler import memory_usage
class Model():
def __init__(self, gui, num_agents, mutate, genetic, ... | true | true |
f70c58be42fabc014fde7ab38fe60f065cf15661 | 1,583 | py | Python | fixture/create_identity_docs.py | bancone/test | b3ffd796e19ab9e7c2317ce0397717e6102f7cca | [
"Apache-2.0"
] | null | null | null | fixture/create_identity_docs.py | bancone/test | b3ffd796e19ab9e7c2317ce0397717e6102f7cca | [
"Apache-2.0"
] | null | null | null | fixture/create_identity_docs.py | bancone/test | b3ffd796e19ab9e7c2317ce0397717e6102f7cca | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import time
import os
class CreateID:
def __init__(self, rpapp):
self.rpapp = rpapp
def create_docs(self):
driver = self.rpapp.driver
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='ti'])[1]/following::button[6]").click(... | 45.228571 | 117 | 0.600758 | import time
import os
class CreateID:
def __init__(self, rpapp):
self.rpapp = rpapp
def create_docs(self):
driver = self.rpapp.driver
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='ti'])[1]/following::button[6]").click()
drive... | true | true |
f70c591798e6640713a38f3ccae3131033c4b307 | 1,306 | py | Python | moto/sts/models.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | moto/sts/models.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | moto/sts/models.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | import datetime
from moto.core import BaseBackend
from moto.core.utils import iso_8601_datetime
class Token(object):
def __init__(self, duration, name=None, policy=None):
now = datetime.datetime.now()
self.expiration = now + datetime.timedelta(seconds=duration)
self.name = name
sel... | 28.391304 | 83 | 0.687596 | import datetime
from moto.core import BaseBackend
from moto.core.utils import iso_8601_datetime
class Token(object):
def __init__(self, duration, name=None, policy=None):
now = datetime.datetime.now()
self.expiration = now + datetime.timedelta(seconds=duration)
self.name = name
sel... | true | true |
f70c5a773ec2f015b3f6306d3b67fdd6fc5001a1 | 123 | py | Python | Curso de Cisco/Actividades/Funcion con dos parametro.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Funcion con dos parametro.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/Funcion con dos parametro.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | def holaTodos(nombre1, nombre2):
print("Hola,", nombre2)
print("Hola,", nombre1)
holaTodos("Sebastián", "Felipe") | 24.6 | 33 | 0.666667 | def holaTodos(nombre1, nombre2):
print("Hola,", nombre2)
print("Hola,", nombre1)
holaTodos("Sebastián", "Felipe") | false | true |
f70c5ab8d21eb367285ecde00b1cc823ba363c25 | 41,663 | py | Python | utils/gen_onnx_mlir.py | eashdown/onnx-mlir | 2662d5530a01ddb11056ae7958118e82487a9eb8 | [
"Apache-2.0"
] | null | null | null | utils/gen_onnx_mlir.py | eashdown/onnx-mlir | 2662d5530a01ddb11056ae7958118e82487a9eb8 | [
"Apache-2.0"
] | null | null | null | utils/gen_onnx_mlir.py | eashdown/onnx-mlir | 2662d5530a01ddb11056ae7958118e82487a9eb8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict, OrderedDict
from io import StringIO
import io
import os
import sys
import datetime
import argparse
import nump... | 34.15 | 105 | 0.595612 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict, OrderedDict
from io import StringIO
import io
import os
import sys
import datetime
import argparse
import numpy as np
from onnx im... | true | true |
f70c5bac57d302bc5a45ac3b4b947aa42b326dfb | 5,320 | py | Python | tests/components/smartthings/test_sensor.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | tests/components/smartthings/test_sensor.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | tests/components/smartthings/test_sensor.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """
Test for the SmartThings sensors platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import ATTRIBUTES, CAPABILITIES, Attribute, Capability
from homeassistant.components.sensor import DEVICE_CLASSES, DOMAIN as ... | 42.56 | 88 | 0.738346 | from pysmartthings import ATTRIBUTES, CAPABILITIES, Attribute, Capability
from homeassistant.components.sensor import DEVICE_CLASSES, DOMAIN as SENSOR_DOMAIN
from homeassistant.components.smartthings import sensor
from homeassistant.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE
from homeassista... | true | true |
f70c5e0ef140c99c7cfd6c015d53084e18fd2d1c | 2,676 | py | Python | pvoutput.py | houthacker/solar | fd7b3d36ce27a8287eee4a5cd7a2c383d1bb4379 | [
"MIT"
] | 6 | 2017-12-02T00:31:11.000Z | 2020-04-16T18:48:37.000Z | pvoutput.py | semonet/solar | fd7b3d36ce27a8287eee4a5cd7a2c383d1bb4379 | [
"MIT"
] | null | null | null | pvoutput.py | semonet/solar | fd7b3d36ce27a8287eee4a5cd7a2c383d1bb4379 | [
"MIT"
] | 2 | 2019-04-11T08:46:46.000Z | 2020-09-14T18:57:51.000Z | #!/usr/bin/env python3
# pvoutput.py
#
# Simple library for uploading data to PVOutput.
import urllib.request
import urllib.parse
import urllib.error
import logging
import sys
logger = logging.getLogger(__name__)
class System:
"""Provides methods for direct uploading to PVOutput for set system."""
def ... | 31.116279 | 80 | 0.628176 |
import urllib.request
import urllib.parse
import urllib.error
import logging
import sys
logger = logging.getLogger(__name__)
class System:
def __init__(self, api_key, system_id):
self.api_key = api_key
self.system_id = system_id
def add_output(self, data):
url = "http://pvo... | true | true |
f70c5e1a08b6c30cd22ab82097aa427cc601e770 | 758 | py | Python | weddingPlanner/urls.py | mithran77/online-wedding-planner | 9212d163de5ec75c30f33e1733a3d863049f1a59 | [
"BSD-2-Clause"
] | null | null | null | weddingPlanner/urls.py | mithran77/online-wedding-planner | 9212d163de5ec75c30f33e1733a3d863049f1a59 | [
"BSD-2-Clause"
] | 4 | 2020-02-11T21:37:44.000Z | 2021-06-10T17:26:16.000Z | weddingPlanner/urls.py | mithran77/online-wedding-planner | 9212d163de5ec75c30f33e1733a3d863049f1a59 | [
"BSD-2-Clause"
] | null | null | null | from django.conf.urls import include, url # pragma: no cover
from django.contrib import admin # pragma: no cover
from weddingServices import views as ws_views # pragma: no cover
from django.contrib.auth import views as auth_views # pragma: no cover
urlpatterns = [ # pragma: no cover
# Examples:
# url(r'^$', '... | 42.111111 | 99 | 0.693931 | from django.conf.urls import include, url from django.contrib import admin from weddingServices import views as ws_views from django.contrib.auth import views as auth_views
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^login/$', auth_views.login, {'template_name': 'weddingService... | true | true |
f70c5e61b4dd32058f4477ae50c3d199891c6439 | 19,730 | py | Python | modules/s3db/tour.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | 1 | 2015-01-24T04:31:51.000Z | 2015-01-24T04:31:51.000Z | modules/s3db/tour.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | modules/s3db/tour.py | nck0405/ChennaiEden | a2381e1b557927fe211ca6329ba64f85dd743fd1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Guided Tour Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software w... | 42.15812 | 93 | 0.456918 |
__all__ = ("S3GuidedTourModel",
"tour_rheader",
"tour_builder",
)
from gluon import *
from gluon.storage import Storage
from ..s3 import *
class S3GuidedTourModel(S3Model):
names = ("tour_config",
"tour_details",
"tour_user",
)
def m... | true | true |
f70c5edb71a501cc0a19546d7d5381683b20c5ec | 5,403 | py | Python | rasa/core/channels/rest.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | null | null | null | rasa/core/channels/rest.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | null | null | null | rasa/core/channels/rest.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | 1 | 2022-02-22T12:35:19.000Z | 2022-02-22T12:35:19.000Z | import asyncio
import inspect
import json
import logging
from asyncio import Queue, CancelledError
from sanic import Blueprint, response
from sanic.request import Request
from sanic.response import HTTPResponse, ResponseStream
from typing import Text, Dict, Any, Optional, Callable, Awaitable, NoReturn, Union
import ra... | 33.351852 | 86 | 0.581529 | import asyncio
import inspect
import json
import logging
from asyncio import Queue, CancelledError
from sanic import Blueprint, response
from sanic.request import Request
from sanic.response import HTTPResponse, ResponseStream
from typing import Text, Dict, Any, Optional, Callable, Awaitable, NoReturn, Union
import ra... | true | true |
f70c5fcd09a063102113a02480cf3a39f1d26fcb | 7,804 | py | Python | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/pickle/ChemkinPickler.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 31 | 2018-11-21T01:49:06.000Z | 2022-03-30T03:41:43.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/pickle/ChemkinPickler.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 123 | 2019-03-12T22:27:29.000Z | 2022-03-29T17:00:04.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/pickle/ChemkinPickler.py | sundials-codes/PelePhysics | 5624f83a04f43aa95288be9d8a7bb372a4adefe6 | [
"BSD-3-Clause-LBNL"
] | 32 | 2018-11-05T11:51:59.000Z | 2022-03-29T13:09:32.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~... | 25.92691 | 82 | 0.481164 |
from weaver.mills.LineMill import LineMill
class ChemkinPickler(LineMill):
names = ["chemkin"]
def _renderDocument(self, mechanism, options=None):
self.pickleElementSection(mechanism)
self.pickleSpeciesSection(mechanism)
self.pickleThermoSection(mechanism)
self.pickleReacti... | true | true |
f70c60815fe4aa5aa2583779ef34546134b65f1c | 4,527 | py | Python | main.py | Mattstacey321/ulauncher-vscodium-recent | 19d0ddbcfbc384ae85c878f2f2683df57fb040f4 | [
"MIT"
] | null | null | null | main.py | Mattstacey321/ulauncher-vscodium-recent | 19d0ddbcfbc384ae85c878f2f2683df57fb040f4 | [
"MIT"
] | null | null | null | main.py | Mattstacey321/ulauncher-vscodium-recent | 19d0ddbcfbc384ae85c878f2f2683df57fb040f4 | [
"MIT"
] | null | null | null | import os
import os.path
import json
import pathlib
from types import prepare_class
from ulauncher.api.client.Extension import Extension
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import (
KeywordQueryEvent,
ItemEnterEvent,
PreferencesEvent,
PreferencesUpdateEvent,
... | 30.587838 | 121 | 0.737133 | import os
import os.path
import json
import pathlib
from types import prepare_class
from ulauncher.api.client.Extension import Extension
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import (
KeywordQueryEvent,
ItemEnterEvent,
PreferencesEvent,
PreferencesUpdateEvent,
... | true | true |
f70c60bcf9f085a2a93faecbc3574b70bb4fe4af | 1,457 | py | Python | tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py | AnthonyQuantum/open_model_zoo | 7d235755e2d17f6186b11243a169966e4f05385a | [
"Apache-2.0"
] | 4 | 2021-04-21T02:38:04.000Z | 2021-10-13T12:15:33.000Z | tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py | AnthonyQuantum/open_model_zoo | 7d235755e2d17f6186b11243a169966e4f05385a | [
"Apache-2.0"
] | 6 | 2020-11-13T19:02:47.000Z | 2022-03-12T00:43:24.000Z | tools/accuracy_checker/accuracy_checker/postprocessor/translate_3d_poses.py | AnthonyQuantum/open_model_zoo | 7d235755e2d17f6186b11243a169966e4f05385a | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | 40.472222 | 102 | 0.739876 |
from ..representation import PoseEstimation3dAnnotation, PoseEstimation3dPrediction
from .postprocessor import Postprocessor
class Translate3dPoses(Postprocessor):
__provider__ = 'translate_3d_poses'
annotation_types = (PoseEstimation3dAnnotation,)
prediction_types = (PoseEstimation3dPrediction,)
de... | true | true |
f70c60debfd9c884bf61bf9fe74a7c883dea56e0 | 1,078 | py | Python | get_similar_words_triples.py | t2hk/scdv_glove_elasticsearch | 41cd336decf1e14e77439caaa26f64edf28ce42b | [
"Apache-2.0"
] | 2 | 2020-01-07T15:44:04.000Z | 2020-02-28T08:03:15.000Z | get_similar_words_triples.py | t2hk/scdv_glove_elasticsearch | 41cd336decf1e14e77439caaa26f64edf28ce42b | [
"Apache-2.0"
] | null | null | null | get_similar_words_triples.py | t2hk/scdv_glove_elasticsearch | 41cd336decf1e14e77439caaa26f64edf28ce42b | [
"Apache-2.0"
] | null | null | null | from gensim.models import KeyedVectors
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.font_manager as fm
import pandas as pd
glove_vector_file = "vectors.txt"
gensim_glove_vector_file = "gensim_glove_vectors.txt"
top_k = 10
words_triple_file = 'similarity_words.ttl'
# G... | 27.641026 | 89 | 0.748609 | from gensim.models import KeyedVectors
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.font_manager as fm
import pandas as pd
glove_vector_file = "vectors.txt"
gensim_glove_vector_file = "gensim_glove_vectors.txt"
top_k = 10
words_triple_file = 'similarity_words.ttl'
vec... | true | true |
f70c614d16242661bb9c6d13d42fa1394aa4231b | 17,585 | py | Python | extra/osmprovider.py | bebora/LeafRoute | c80ed77789c73f0173c986c5482de4f2503f7cc1 | [
"BSD-2-Clause"
] | 3 | 2019-05-26T12:32:20.000Z | 2019-10-07T11:29:28.000Z | extra/osmprovider.py | bebora/LeafRoute | c80ed77789c73f0173c986c5482de4f2503f7cc1 | [
"BSD-2-Clause"
] | null | null | null | extra/osmprovider.py | bebora/LeafRoute | c80ed77789c73f0173c986c5482de4f2503f7cc1 | [
"BSD-2-Clause"
] | 6 | 2019-06-20T10:41:43.000Z | 2019-10-10T00:17:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Leonardo Arcari @leonardoarcari"
from networkx.relabel import convert_node_labels_to_integers
import networkx as nx
from pathlib import Path
from osgeo import ogr
from osgeo import osr
from math import cos, sin, asin, sqrt, radians
import random
## Modules
... | 32.20696 | 219 | 0.557805 | __author__ = "Leonardo Arcari @leonardoarcari"
from networkx.relabel import convert_node_labels_to_integers
import networkx as nx
from pathlib import Path
from osgeo import ogr
from osgeo import osr
from math import cos, sin, asin, sqrt, radians
import random
from math import radians, cos, sin, asin, sqrt
import arg... | true | true |
f70c628036311a35fe236d5b94ccde4248cfc56c | 269 | py | Python | 1-moderate/robo-and-robitta/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 21 | 2015-02-09T18:41:15.000Z | 2021-07-31T02:43:28.000Z | 1-moderate/robo-and-robitta/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | null | null | null | 1-moderate/robo-and-robitta/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 37 | 2015-01-06T06:20:17.000Z | 2021-06-21T18:22:13.000Z | import re
import sys
def walk(m, n, x, y):
c = 0
while n > y:
c, m, n, x, y = c + m, n - 1, m, n - y, x
return c + x
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
print(walk(*map(int, re.findall(r'\d+', test))))
| 17.933333 | 56 | 0.505576 | import re
import sys
def walk(m, n, x, y):
c = 0
while n > y:
c, m, n, x, y = c + m, n - 1, m, n - y, x
return c + x
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
print(walk(*map(int, re.findall(r'\d+', test))))
| true | true |
f70c62a3ac4a06f3848d9bf75d7cfce91bf451dc | 3,889 | py | Python | Python/Module/JoyStick.py | Hajime-Saitou/Games | f7ec0807855481cd1c6b135cd7c6d0f3898d3c59 | [
"MIT"
] | 1 | 2021-02-27T17:58:14.000Z | 2021-02-27T17:58:14.000Z | Python/Module/JoyStick.py | Hajime-Saitou/Games | f7ec0807855481cd1c6b135cd7c6d0f3898d3c59 | [
"MIT"
] | null | null | null | Python/Module/JoyStick.py | Hajime-Saitou/Games | f7ec0807855481cd1c6b135cd7c6d0f3898d3c59 | [
"MIT"
] | null | null | null | # JoyStick
#
# Copyright (c) 2021 Hajime Saito
#
# Released under the MIT license.
# see https://opensource.org/licenses/MIT
import pygame
from pygame.locals import *
import Repeater
JOY_MAX_TRIGGER = 16
JOY_NOINPUT = 0
JOY_UP = 0x1 << JOY_MAX_TRIGGER
JOY_RIGHT = 0x2 << JOY_MAX_TRIGGER
JOY_DOWN = 0x4 <<... | 24.770701 | 66 | 0.701723 | import pygame
from pygame.locals import *
import Repeater
JOY_MAX_TRIGGER = 16
JOY_NOINPUT = 0
JOY_UP = 0x1 << JOY_MAX_TRIGGER
JOY_RIGHT = 0x2 << JOY_MAX_TRIGGER
JOY_DOWN = 0x4 << JOY_MAX_TRIGGER
JOY_LEFT = 0x8 << JOY_MAX_TRIGGER
JOY_TRIGGER1 = 0x1 << 0
JOY_TRIGGER2 = 0x1 << 1
JOY_TRIGGER3 = 0x1... | true | true |
f70c62fba7c4424468351fa0d5cf2e162e2be301 | 1,399 | py | Python | auth_api/views.py | sodascourse/note-storage | 2e7decf968c6939b30ca52573e1a33d12ce32e0e | [
"Apache-2.0"
] | null | null | null | auth_api/views.py | sodascourse/note-storage | 2e7decf968c6939b30ca52573e1a33d12ce32e0e | [
"Apache-2.0"
] | null | null | null | auth_api/views.py | sodascourse/note-storage | 2e7decf968c6939b30ca52573e1a33d12ce32e0e | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.generics import CreateAPIView
User = get_user_model()
class SignupSerializer(serializers.Serializer):
error_message = "'{value}' is a registered {field}. Contact admin if you forgets password."
username... | 33.309524 | 95 | 0.706219 | from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.generics import CreateAPIView
User = get_user_model()
class SignupSerializer(serializers.Serializer):
error_message = "'{value}' is a registered {field}. Contact admin if you forgets password."
username... | true | true |
f70c64f401fdeb5c96c28f7172af6fe7f9010dbf | 49,435 | py | Python | qiskit/pulse/schedule.py | SooluThomas/qiskit-terra | 25b47af83f14afb3441d7b2c1bd31bda93e3549d | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/schedule.py | SooluThomas/qiskit-terra | 25b47af83f14afb3441d7b2c1bd31bda93e3549d | [
"Apache-2.0"
] | null | null | null | qiskit/pulse/schedule.py | SooluThomas/qiskit-terra | 25b47af83f14afb3441d7b2c1bd31bda93e3549d | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 42.07234 | 100 | 0.588834 |
import abc
import copy
import itertools
import multiprocessing as mp
import sys
import warnings
from collections import defaultdict
from typing import List, Tuple, Iterable, Union, Dict, Callable, Set, Optional, Any
import numpy as np
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.parameterexpre... | true | true |
f70c650c83c204939534be015e5d5136526af01e | 38,121 | py | Python | microsetta_admin/server.py | microsetta/microsetta-admin | 1ba6787c0315a74d50cafd722dbbe044d507c07f | [
"BSD-3-Clause"
] | null | null | null | microsetta_admin/server.py | microsetta/microsetta-admin | 1ba6787c0315a74d50cafd722dbbe044d507c07f | [
"BSD-3-Clause"
] | null | null | null | microsetta_admin/server.py | microsetta/microsetta-admin | 1ba6787c0315a74d50cafd722dbbe044d507c07f | [
"BSD-3-Clause"
] | null | null | null | import jwt
from flask import render_template, Flask, request, session, send_file
import secrets
from datetime import datetime
import io
from jwt import PyJWTError
from werkzeug.exceptions import BadRequest
from werkzeug.utils import redirect
import pandas as pd
from microsetta_admin import metadata_util, upload_util
... | 38.780264 | 98 | 0.574906 | import jwt
from flask import render_template, Flask, request, session, send_file
import secrets
from datetime import datetime
import io
from jwt import PyJWTError
from werkzeug.exceptions import BadRequest
from werkzeug.utils import redirect
import pandas as pd
from microsetta_admin import metadata_util, upload_util
... | true | true |
f70c651bfec18a770fd048a9281fc8526c3a4a28 | 53,701 | py | Python | htools/core.py | hdmamin/htools | 620c6add29561b77c10d793e4be7beeb28b32bab | [
"MIT"
] | 1 | 2019-12-14T15:24:38.000Z | 2019-12-14T15:24:38.000Z | htools/core.py | hdmamin/htools | 620c6add29561b77c10d793e4be7beeb28b32bab | [
"MIT"
] | null | null | null | htools/core.py | hdmamin/htools | 620c6add29561b77c10d793e4be7beeb28b32bab | [
"MIT"
] | 1 | 2020-03-30T17:26:39.000Z | 2020-03-30T17:26:39.000Z | from bz2 import BZ2File
from collections import Counter, Sequence, Iterable, \
Mapping
from functools import partial
import gc
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email import encoders
from inspect import signature, getattr_... | 31.964881 | 79 | 0.625798 | from bz2 import BZ2File
from collections import Counter, Sequence, Iterable, \
Mapping
from functools import partial
import gc
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email import encoders
from inspect import signature, getattr_... | true | true |
f70c651ffebe47bce3c52d330166eb8fc9ad41b9 | 475 | py | Python | frameworks/tensorflow/print_tensor_in_ckpt.py | JasonWayne/deep-learning-snippets | 7c64e065752fcbb902494d757a41140f42facf05 | [
"MIT"
] | null | null | null | frameworks/tensorflow/print_tensor_in_ckpt.py | JasonWayne/deep-learning-snippets | 7c64e065752fcbb902494d757a41140f42facf05 | [
"MIT"
] | null | null | null | frameworks/tensorflow/print_tensor_in_ckpt.py | JasonWayne/deep-learning-snippets | 7c64e065752fcbb902494d757a41140f42facf05 | [
"MIT"
] | null | null | null | '''
common usage:
1. put this script in ckpt folder
2. python print_tensor_in_ckpt.py > tensors.txt
'''
# ref: https://stackoverflow.com/questions/38218174/how-do-i-find-the-variable-names-and-values-that-are-saved-in-a-checkpoint
import tensorflow as tf
from tensorflow.python.tools.inspect_checkpoint import print... | 36.538462 | 126 | 0.8 | import tensorflow as tf
from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
latest_ckp = tf.train.latest_checkpoint('./')
print_tensors_in_checkpoint_file(latest_ckp, all_tensors=True, tensor_name='')
| true | true |
f70c657b24f5e01e4e11443197e6a739d6dc1295 | 90,707 | py | Python | test/functional/p2p-segwit.py | chanchoi829/favcoin | 8f836036faae2e3575ef05a22c450e88b120a5fa | [
"MIT"
] | null | null | null | test/functional/p2p-segwit.py | chanchoi829/favcoin | 8f836036faae2e3575ef05a22c450e88b120a5fa | [
"MIT"
] | null | null | null | test/functional/p2p-segwit.py | chanchoi829/favcoin | 8f836036faae2e3575ef05a22c450e88b120a5fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_fram... | 46.302705 | 150 | 0.658615 |
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, get_witness_script, WITNESS_COMMITMENT_HEADER
from test... | true | true |
f70c6638a3a13cbe074afeaa5a903fcedc67e553 | 7,114 | py | Python | notion_tqdm/std.py | shunyooo/notion-tqdm | 78c05eeea9427deaed63709740c4b9329fb1b7e7 | [
"MIT"
] | 52 | 2020-11-26T09:07:27.000Z | 2022-03-22T21:14:49.000Z | notion_tqdm/std.py | shunyooo/notion-tqdm | 78c05eeea9427deaed63709740c4b9329fb1b7e7 | [
"MIT"
] | 1 | 2021-05-25T18:35:18.000Z | 2021-05-25T18:35:18.000Z | notion_tqdm/std.py | shunyooo/notion-tqdm | 78c05eeea9427deaed63709740c4b9329fb1b7e7 | [
"MIT"
] | 3 | 2021-02-20T09:36:36.000Z | 2022-01-11T17:36:20.000Z | import inspect
import json
import logging
import threading
from datetime import datetime, timezone
from time import time
import pytz
import requests
from notion.block import TextBlock
from notion.client import NotionClient
from notion.collection import NotionDate
from tqdm import tqdm
from tzlocal import get_localzone... | 34.201923 | 199 | 0.608237 | import inspect
import json
import logging
import threading
from datetime import datetime, timezone
from time import time
import pytz
import requests
from notion.block import TextBlock
from notion.client import NotionClient
from notion.collection import NotionDate
from tqdm import tqdm
from tzlocal import get_localzone... | true | true |
f70c665447c79ac8275fcc74e677d12bb8275fcf | 299 | py | Python | cleanup_repo.py | cweb-project/cweb-project | 53e4b77018996533a8bae8e79c30abf62e81ea5a | [
"MIT"
] | 2 | 2018-11-06T12:43:29.000Z | 2019-01-09T15:23:18.000Z | cleanup_repo.py | cweb-project/cweb-project | 53e4b77018996533a8bae8e79c30abf62e81ea5a | [
"MIT"
] | 1 | 2018-11-06T20:37:57.000Z | 2018-11-13T17:13:11.000Z | cleanup_repo.py | cweb-project/cweb-project | 53e4b77018996533a8bae8e79c30abf62e81ea5a | [
"MIT"
] | 3 | 2019-01-15T17:35:26.000Z | 2020-03-01T18:53:03.000Z | import shutil
import sys
import os
for (root,dirs,files) in os.walk(os.path.abspath('.'),topdown=True):
for d in dirs:
path = os.path.join(root,d)
if '__pycache__' in path:
shutil.rmtree(path)
for f in files:
path = os.path.join(root,f)
if '.DS_Store' in path:
os.remove(path)
| 18.6875 | 69 | 0.665552 | import shutil
import sys
import os
for (root,dirs,files) in os.walk(os.path.abspath('.'),topdown=True):
for d in dirs:
path = os.path.join(root,d)
if '__pycache__' in path:
shutil.rmtree(path)
for f in files:
path = os.path.join(root,f)
if '.DS_Store' in path:
os.remove(path)
| true | true |
f70c669144c2a6b334af8258d02f848255428606 | 2,915 | py | Python | libragram/objects/messageEntities.py | kensoi/libragram | a0119244dceb09edca36b23c95f3e97a28ddae9a | [
"Apache-2.0"
] | null | null | null | libragram/objects/messageEntities.py | kensoi/libragram | a0119244dceb09edca36b23c95f3e97a28ddae9a | [
"Apache-2.0"
] | null | null | null | libragram/objects/messageEntities.py | kensoi/libragram | a0119244dceb09edca36b23c95f3e97a28ddae9a | [
"Apache-2.0"
] | null | null | null | class messageEntity:
isBotMention = False
start: int
end: int
def __repr__(self):
return "<class 'messageEntity' ({})>".format(type(self))
class formatEntity(messageEntity):
pass
class mention(messageEntity): #(@username)
text: str
user: str
def __init__(self, text, user = N... | 19.433333 | 77 | 0.590395 | class messageEntity:
isBotMention = False
start: int
end: int
def __repr__(self):
return "<class 'messageEntity' ({})>".format(type(self))
class formatEntity(messageEntity):
pass
class mention(messageEntity): text: str
user: str
def __init__(self, text, user = None, botname:... | true | true |
f70c67dc63f485a17c66eca2fd849f64dc0f0e72 | 1,185 | py | Python | keystoneclient/tests/v3/test_domains.py | citrix-openstack-build/python-keystoneclient | e170955d6de5cbf521d54105bdefaf606ccdb356 | [
"Apache-1.1"
] | 1 | 2015-02-26T03:24:30.000Z | 2015-02-26T03:24:30.000Z | keystoneclient/tests/v3/test_domains.py | NeCTAR-RC/python-keystoneclient | dca1d4259d44a0d282396a18c895de834580fe66 | [
"Apache-1.1"
] | null | null | null | keystoneclient/tests/v3/test_domains.py | NeCTAR-RC/python-keystoneclient | dca1d4259d44a0d282396a18c895de834580fe66 | [
"Apache-1.1"
] | 1 | 2019-03-08T07:21:48.000Z | 2019-03-08T07:21:48.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | 34.852941 | 78 | 0.69789 |
import uuid
from keystoneclient.tests.v3 import utils
from keystoneclient.v3 import domains
class DomainTests(utils.TestCase, utils.CrudTests):
def setUp(self):
super(DomainTests, self).setUp()
self.key = 'domain'
self.collection_key = 'domains'
self.model = domains.Domain
... | true | true |
f70c687e1484c9313c581a5b09bc28790ea9805d | 2,435 | py | Python | setup.py | asmeurer/markdown-it-py | ee34305cc8b590c7390b0ac4149d0d22104cf908 | [
"MIT"
] | null | null | null | setup.py | asmeurer/markdown-it-py | ee34305cc8b590c7390b0ac4149d0d22104cf908 | [
"MIT"
] | null | null | null | setup.py | asmeurer/markdown-it-py | ee34305cc8b590c7390b0ac4149d0d22104cf908 | [
"MIT"
] | null | null | null | # from importlib import import_module
from os import path
import re
from setuptools import find_packages, setup
def get_version():
text = open(path.join(path.dirname(__file__), "markdown_it", "__init__.py")).read()
match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text)
return mat... | 33.819444 | 87 | 0.571253 | from os import path
import re
from setuptools import find_packages, setup
def get_version():
text = open(path.join(path.dirname(__file__), "markdown_it", "__init__.py")).read()
match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text)
return match.group(1)
setup(
name="markdow... | true | true |
f70c6ba3ffd63063082dff1b3d2ca2ae52c325fe | 1,000 | py | Python | app/http/controllers/BlogController.py | kerlinlopes/kerlin-blog-backend | f77f07a60d554b6ab28cd926e27d7acc66a4ec6b | [
"MIT"
] | null | null | null | app/http/controllers/BlogController.py | kerlinlopes/kerlin-blog-backend | f77f07a60d554b6ab28cd926e27d7acc66a4ec6b | [
"MIT"
] | null | null | null | app/http/controllers/BlogController.py | kerlinlopes/kerlin-blog-backend | f77f07a60d554b6ab28cd926e27d7acc66a4ec6b | [
"MIT"
] | 1 | 2021-12-06T23:03:46.000Z | 2021-12-06T23:03:46.000Z | """ A BlogController Module """
from masonite.controllers import Controller
from masonite.request import Request
from app.Blog import Blog
class BlogController(Controller):
def __init__(self, request: Request):
self.request = request
def show(self):
id = self.request.param("id")
retur... | 28.571429 | 67 | 0.601 |
from masonite.controllers import Controller
from masonite.request import Request
from app.Blog import Blog
class BlogController(Controller):
def __init__(self, request: Request):
self.request = request
def show(self):
id = self.request.param("id")
return Blog.find(id)
def index(s... | true | true |
f70c6bdd656e55c1af0d5793d4d9788da45852c8 | 19,704 | py | Python | ramp-database/ramp_database/model/event.py | symerio/ramp-board | 977b27ffdd648eccc5c992926870319bfef544b6 | [
"BSD-3-Clause"
] | 13 | 2019-02-16T22:30:11.000Z | 2021-01-11T10:13:47.000Z | ramp-database/ramp_database/model/event.py | symerio/ramp-board | 977b27ffdd648eccc5c992926870319bfef544b6 | [
"BSD-3-Clause"
] | 427 | 2018-11-22T22:01:47.000Z | 2022-03-15T17:35:57.000Z | ramp-database/ramp_database/model/event.py | symerio/ramp-board | 977b27ffdd648eccc5c992926870319bfef544b6 | [
"BSD-3-Clause"
] | 18 | 2018-11-22T16:22:18.000Z | 2021-12-07T14:42:41.000Z | import uuid
import datetime
from sqlalchemy import Float
from sqlalchemy import Column
from sqlalchemy import String
from sqlalchemy import Integer
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import backref... | 34.568421 | 88 | 0.661541 | import uuid
import datetime
from sqlalchemy import Float
from sqlalchemy import Column
from sqlalchemy import String
from sqlalchemy import Integer
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import backref... | true | true |
f70c6c4e1ef4c0a61876b8d442053117c763928f | 3,809 | py | Python | api/management/commands/import-translated-strings.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 11 | 2018-06-11T06:05:12.000Z | 2022-03-25T09:31:44.000Z | api/management/commands/import-translated-strings.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 498 | 2017-11-07T21:20:13.000Z | 2022-03-31T14:37:18.000Z | api/management/commands/import-translated-strings.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 6 | 2018-04-11T13:29:50.000Z | 2020-07-16T16:52:11.000Z | import os
import csv
from django.core.management.base import BaseCommand
from django.db import transaction
from api.models import Action, Country, DisasterType, SituationReportType
from api.logger import logger
class Command(BaseCommand):
help = 'Import translated strings from a CSV. Either use the --table and --... | 42.322222 | 109 | 0.476503 | import os
import csv
from django.core.management.base import BaseCommand
from django.db import transaction
from api.models import Action, Country, DisasterType, SituationReportType
from api.logger import logger
class Command(BaseCommand):
help = 'Import translated strings from a CSV. Either use the --table and --... | true | true |
f70c6ce47b25347b86e85cda31ba0052a32de4eb | 417 | py | Python | robot/components/shooter.py | frc1418/robotpy-slides | 88cad003ce8c8936ebbd749946e2b1014024426d | [
"MIT"
] | null | null | null | robot/components/shooter.py | frc1418/robotpy-slides | 88cad003ce8c8936ebbd749946e2b1014024426d | [
"MIT"
] | null | null | null | robot/components/shooter.py | frc1418/robotpy-slides | 88cad003ce8c8936ebbd749946e2b1014024426d | [
"MIT"
] | 1 | 2018-12-07T17:10:57.000Z | 2018-12-07T17:10:57.000Z | from ctre import WPI_TalonSRX
class Shooter:
motor: WPI_TalonSRX
def __init__(self):
self.ref_velocity = 0
def enable(self):
self.ref_velocity = 1
def disable(self):
self.ref_velocity = 0
def ready(self):
return self.motor.getQuadratureVelocity() > 4500
def e... | 20.85 | 81 | 0.666667 | from ctre import WPI_TalonSRX
class Shooter:
motor: WPI_TalonSRX
def __init__(self):
self.ref_velocity = 0
def enable(self):
self.ref_velocity = 1
def disable(self):
self.ref_velocity = 0
def ready(self):
return self.motor.getQuadratureVelocity() > 4500
def e... | true | true |
f70c6d412a98b13eb64ed6bf8a3330b33bfa02ed | 10,891 | py | Python | fasterRCNNtrain/loss_and_gen.py | TangZhenchaoTZC/Keras-mask-detection | 325679d06a12a90b2552ed7d447298a23e3b9d57 | [
"MIT"
] | 3 | 2020-05-26T15:13:06.000Z | 2020-05-27T02:57:27.000Z | fasterRCNNtrain/loss_and_gen.py | TangZhenchaoTZC/Keras-mask-detection | 325679d06a12a90b2552ed7d447298a23e3b9d57 | [
"MIT"
] | null | null | null | fasterRCNNtrain/loss_and_gen.py | TangZhenchaoTZC/Keras-mask-detection | 325679d06a12a90b2552ed7d447298a23e3b9d57 | [
"MIT"
] | null | null | null | """fasterRCNN训练的损失函数与数据生成器"""
from keras.applications.imagenet_utils import preprocess_input
from keras import backend as K
import keras
import tensorflow as tf
import numpy as np
from random import shuffle
import random
from PIL import Image
from keras.objectives import categorical_crossentropy
from matplotlib.colors ... | 37.044218 | 110 | 0.570104 | from keras.applications.imagenet_utils import preprocess_input
from keras import backend as K
import keras
import tensorflow as tf
import numpy as np
from random import shuffle
import random
from PIL import Image
from keras.objectives import categorical_crossentropy
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
... | true | true |
f70c6da1e309192d26af697878f3e74a962a2a3a | 582 | py | Python | setup.py | mballance/bmk | 8a7b0fa7f4d05fce186cfbd07af71e78fb83c912 | [
"Apache-2.0"
] | 2 | 2021-12-14T23:49:13.000Z | 2022-01-13T17:44:29.000Z | setup.py | mballance/bmk | 8a7b0fa7f4d05fce186cfbd07af71e78fb83c912 | [
"Apache-2.0"
] | null | null | null | setup.py | mballance/bmk | 8a7b0fa7f4d05fce186cfbd07af71e78fb83c912 | [
"Apache-2.0"
] | null | null | null |
import os
from setuptools import setup
#data_files = []
#directories = glob.glob('src/share')
setup(
name = "bmk",
packages=['bmk'],
package_dir = {'' : 'src'},
package_data = {'bmk' : ['share/*']},
author = "Matthew Ballance",
author_email = "matt.ballance@gmail.com",
description = ("Provides a core c... | 21.555556 | 76 | 0.634021 |
import os
from setuptools import setup
setup(
name = "bmk",
packages=['bmk'],
package_dir = {'' : 'src'},
package_data = {'bmk' : ['share/*']},
author = "Matthew Ballance",
author_email = "matt.ballance@gmail.com",
description = ("Provides a core classes for use by memory-oriented BFMs"),
license = "... | true | true |
f70c6e7d656ca8d754306a3a4bd70f95bb91c35e | 20,203 | py | Python | tests/handlers/test_presence.py | Cadair/synapse | 466866a1d9dd1fcf82348a36c0532cb0c6614767 | [
"Apache-2.0"
] | 1 | 2019-09-14T03:24:03.000Z | 2019-09-14T03:24:03.000Z | tests/handlers/test_presence.py | Cadair/synapse | 466866a1d9dd1fcf82348a36c0532cb0c6614767 | [
"Apache-2.0"
] | 4 | 2020-03-04T23:47:05.000Z | 2021-12-09T21:41:44.000Z | tests/handlers/test_presence.py | Cadair/synapse | 466866a1d9dd1fcf82348a36c0532cb0c6614767 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.832759 | 88 | 0.641093 |
from mock import Mock, call
from signedjson.key import generate_signing_key
from synapse.api.constants import EventTypes, Membership, PresenceState
from synapse.events import room_version_to_event_format
from synapse.events.builder import EventBuilder
from synapse.handlers.presence import (
FEDERATION_PING_INTE... | true | true |
f70c6f0cdd25513b9e91b30b7f68b3fe31ad9b82 | 24,984 | py | Python | openhtf/util/conf.py | ahaberlach/openhtf | 5b63f12830a1020d32eeccc63f1759d4031345fc | [
"Apache-2.0"
] | null | null | null | openhtf/util/conf.py | ahaberlach/openhtf | 5b63f12830a1020d32eeccc63f1759d4031345fc | [
"Apache-2.0"
] | null | null | null | openhtf/util/conf.py | ahaberlach/openhtf | 5b63f12830a1020d32eeccc63f1759d4031345fc | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | 40.957377 | 91 | 0.716459 |
import argparse
import functools
import inspect
import logging
import sys
import threading
import yaml
import mutablerecords
from . import argv
from . import threads
ARG_PARSER = argv.ModuleParser()
ARG_PARSER.add_argument(
'--config-file', type=argparse.FileType('r'),
help='File from which to load conf... | true | true |
f70c70402685a251ab60ed5ed7c57c8666f13411 | 3,449 | py | Python | examples/AdafruitDHT.py | pudding0430/Adafruit_Python_DHT | cde7fc8f64554fc5915e975580323c1e6dd2ae5b | [
"MIT"
] | null | null | null | examples/AdafruitDHT.py | pudding0430/Adafruit_Python_DHT | cde7fc8f64554fc5915e975580323c1e6dd2ae5b | [
"MIT"
] | null | null | null | examples/AdafruitDHT.py | pudding0430/Adafruit_Python_DHT | cde7fc8f64554fc5915e975580323c1e6dd2ae5b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 40.576471 | 112 | 0.726008 |
import sys
import time
import Adafruit_DHT
import httplib, urllib
import json
deviceId = "DpQUAGQx"
deviceKey = "FSe2y0pELSD4qjzq"
def post_to_mcs(payload):
headers = {"Content-type": "application/json", "deviceKey": deviceKey}
not_connected = 1
while (not_connected):
try:
conn = httplib.HTTPConnection("ap... | false | true |
f70c71864f7ad76dc086116e24ff7f441070652a | 218 | py | Python | tests/models.py | wearespindle/django-form-utils | fd371a23a08dfecfae4f2c0724cd643abcc80dad | [
"BSD-3-Clause"
] | null | null | null | tests/models.py | wearespindle/django-form-utils | fd371a23a08dfecfae4f2c0724cd643abcc80dad | [
"BSD-3-Clause"
] | null | null | null | tests/models.py | wearespindle/django-form-utils | fd371a23a08dfecfae4f2c0724cd643abcc80dad | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
class Person(models.Model):
age = models.IntegerField()
name = models.CharField(max_length=100)
class Document(models.Model):
myfile = models.FileField(upload_to="uploads")
| 19.818182 | 50 | 0.733945 | from django.db import models
class Person(models.Model):
age = models.IntegerField()
name = models.CharField(max_length=100)
class Document(models.Model):
myfile = models.FileField(upload_to="uploads")
| true | true |
f70c71c7542da78519981b7abb3df189758ddcd1 | 2,555 | py | Python | Simulation/macd_signal_line.py | SEPHIRONOVA/TradingDataAnalyzer | 314cb5bc5f5327ceb16d0ce4e283694eb3f16e99 | [
"MIT"
] | null | null | null | Simulation/macd_signal_line.py | SEPHIRONOVA/TradingDataAnalyzer | 314cb5bc5f5327ceb16d0ce4e283694eb3f16e99 | [
"MIT"
] | null | null | null | Simulation/macd_signal_line.py | SEPHIRONOVA/TradingDataAnalyzer | 314cb5bc5f5327ceb16d0ce4e283694eb3f16e99 | [
"MIT"
] | null | null | null | from Simulation.calculation_status import CalculationStatus
from Simulation.sign_function import SignFunction
from Simulation.mcad import Mcad
from Simulation.market_snapshot import MarketSnapshot
from Simulation.stock_snapshot_helper import StockSnapshotHelper
from Simulation.visualization_data import VisualizationDat... | 31.158537 | 118 | 0.78317 | from Simulation.calculation_status import CalculationStatus
from Simulation.sign_function import SignFunction
from Simulation.mcad import Mcad
from Simulation.market_snapshot import MarketSnapshot
from Simulation.stock_snapshot_helper import StockSnapshotHelper
from Simulation.visualization_data import VisualizationDat... | true | true |
f70c7296b40140065feebfd9c748b2d158481e4a | 3,542 | py | Python | configs/recognition/tsm_custom/tsm_r50_1x1x8_100e_customdataset_fight_rgb.py | ZJU-lishuang/mmaction2 | dc46505319968eff0123eb5abb811969042377c5 | [
"Apache-2.0"
] | 2 | 2021-12-07T09:09:10.000Z | 2022-01-26T01:52:07.000Z | configs/recognition/tsm_custom/tsm_r50_1x1x8_100e_customdataset_fight_rgb.py | ZJU-lishuang/mmaction2 | dc46505319968eff0123eb5abb811969042377c5 | [
"Apache-2.0"
] | null | null | null | configs/recognition/tsm_custom/tsm_r50_1x1x8_100e_customdataset_fight_rgb.py | ZJU-lishuang/mmaction2 | dc46505319968eff0123eb5abb811969042377c5 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/models/tsm_r50.py', '../../_base_/schedules/sgd_tsm_100e.py',
'../../_base_/default_runtime.py'
]
# model settings
model = dict(backbone=dict(pretrained='weight/resnet50-19c8e357.pth'),cls_head=dict(num_classes=2))
log_config = dict(
interval=1,
hooks=[
dict(type='TextL... | 32.796296 | 99 | 0.657256 | _base_ = [
'../../_base_/models/tsm_r50.py', '../../_base_/schedules/sgd_tsm_100e.py',
'../../_base_/default_runtime.py'
]
model = dict(backbone=dict(pretrained='weight/resnet50-19c8e357.pth'),cls_head=dict(num_classes=2))
log_config = dict(
interval=1,
hooks=[
dict(type='TextLoggerHook'),
... | true | true |
f70c72ccc07d7ac3423857be8b2839f7788df7dd | 3,998 | py | Python | models/intro/vertical.py | caelanhadley/NNFSIP | da048af5ded549db7464b206b255104900b40ab8 | [
"MIT"
] | null | null | null | models/intro/vertical.py | caelanhadley/NNFSIP | da048af5ded549db7464b206b255104900b40ab8 | [
"MIT"
] | null | null | null | models/intro/vertical.py | caelanhadley/NNFSIP | da048af5ded549db7464b206b255104900b40ab8 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import nnfs
from nnfs.datasets import vertical_data
nnfs.init()
X, y = vertical_data(samples=100, classes=3)
plt.scatter(X[:, 0], X[:, 1], c=y, s=40, cmap='brg')
plt.show()
import numpy as np
import nnfs
import matplotlib.pyplot as plt
nnfs.init()
class Layer_Dense:
def __init_... | 35.070175 | 75 | 0.688844 | import matplotlib.pyplot as plt
import nnfs
from nnfs.datasets import vertical_data
nnfs.init()
X, y = vertical_data(samples=100, classes=3)
plt.scatter(X[:, 0], X[:, 1], c=y, s=40, cmap='brg')
plt.show()
import numpy as np
import nnfs
import matplotlib.pyplot as plt
nnfs.init()
class Layer_Dense:
def __init_... | true | true |
f70c7348c73dc5db09b2f4dab2f4a6cba757570c | 1,427 | py | Python | ldb/console.py | UnTenseUnJury/LbelDB.py | 1a326c372ece83dc62bf5a72f4e0f22a131f1f12 | [
"Unlicense"
] | 10 | 2020-08-24T03:43:45.000Z | 2020-10-12T05:13:55.000Z | ldb/console.py | UnTenseUnJury/LbelDB.py | 1a326c372ece83dc62bf5a72f4e0f22a131f1f12 | [
"Unlicense"
] | null | null | null | ldb/console.py | UnTenseUnJury/LbelDB.py | 1a326c372ece83dc62bf5a72f4e0f22a131f1f12 | [
"Unlicense"
] | 3 | 2020-08-24T12:20:10.000Z | 2021-03-07T04:51:41.000Z | import ldb
# console based do not edit
while True:
cmd = str(input("LDB > "))
cmd = cmd.split(" ")
if cmd[0].lower() == "exit":
break
elif cmd[0].lower() == "init":
ldb.init()
elif cmd[0].lower() == "create":
ldb.create(list(cmd[1:]))
elif cmd[0].lower() == "view":
... | 31.021739 | 67 | 0.512964 | import ldb
while True:
cmd = str(input("LDB > "))
cmd = cmd.split(" ")
if cmd[0].lower() == "exit":
break
elif cmd[0].lower() == "init":
ldb.init()
elif cmd[0].lower() == "create":
ldb.create(list(cmd[1:]))
elif cmd[0].lower() == "view":
ldb.view()
elif cmd[... | true | true |
f70c739c58e9ad732cfb1c2ec6a32a42c0f46699 | 25,377 | py | Python | jax/experimental/jax2tf/tests/primitives_test.py | tudorcebere/jax | dcaa28c624ef3402529786a5aa6dd3891f8779b0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-04-01T06:42:49.000Z | 2021-04-01T06:42:49.000Z | jax/experimental/jax2tf/tests/primitives_test.py | jhkang/jax | b1d0f87648f73b06091ea3929a52b5d572391088 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/jax2tf/tests/primitives_test.py | jhkang/jax | b1d0f87648f73b06091ea3929a52b5d572391088 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 44.287958 | 99 | 0.675021 |
import unittest
from absl.testing import absltest
from absl.testing import parameterized
from functools import partial
import jax
from jax import dtypes
from jax import lax
from jax import numpy as jnp
from jax import test_util as jtu
from jax.config import config
from jax.experimental import jax2tf
from jax.experi... | true | true |
f70c7544d6c9e8095e95d0629b94384bc1cbe35b | 14,176 | py | Python | tensorflow/python/eager/ops_test.py | sorhus/tensorflow | 99de1826646c8d354259187fc9c2330b794c1ac4 | [
"Apache-2.0"
] | 8 | 2019-08-29T06:16:53.000Z | 2021-08-21T21:19:10.000Z | tensorflow/python/eager/ops_test.py | sorhus/tensorflow | 99de1826646c8d354259187fc9c2330b794c1ac4 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/ops_test.py | sorhus/tensorflow | 99de1826646c8d354259187fc9c2330b794c1ac4 | [
"Apache-2.0"
] | 7 | 2019-05-31T02:57:03.000Z | 2020-08-09T20:15:25.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.109948 | 80 | 0.657308 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.eager import context
from tensorflow.python.eager import execute
from tensorflow.python.eager import test
from tensorfl... | true | true |
f70c7574cc07577b99f8a4f4fe68633e07e3f8f5 | 5,126 | py | Python | docs/conf.py | Addepar/dataflake.fakeldap | 6ef1b3b9b8d7198a132b7dcce83d5a855db9a577 | [
"ZPL-2.1"
] | null | null | null | docs/conf.py | Addepar/dataflake.fakeldap | 6ef1b3b9b8d7198a132b7dcce83d5a855db9a577 | [
"ZPL-2.1"
] | 6 | 2017-12-12T00:52:22.000Z | 2018-02-08T15:47:42.000Z | docs/conf.py | Addepar/dataflake.fakeldap | 6ef1b3b9b8d7198a132b7dcce83d5a855db9a577 | [
"ZPL-2.1"
] | 1 | 2020-05-13T11:29:59.000Z | 2020-05-13T11:29:59.000Z | # -*- coding: utf-8 -*-
#
# dataflake.fakeldap documentation build configuration file, created by
# sphinx-quickstart on Sat May 27 10:35:35 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... | 31.066667 | 79 | 0.690012 |
import datetime
import os
import sys
parent = os.path.dirname(os.path.dirname(__file__))
parent_dir = os.path.abspath(parent)
with open(os.path.join(parent_dir, 'version.txt'), 'r') as version_file:
pkg_version = version_file.read().strip()
extensions = []
source_suffix = '.rst'
master_doc = 'index'
proje... | true | true |
f70c7786464b6515cb46daab41e11d2e6ccad74d | 1,468 | py | Python | MusicP_Kit/Librosa1.py | alexissoto1/AudioNerd.py | 107b7eb8a141994798eb10075e8591491ca9b471 | [
"MIT"
] | null | null | null | MusicP_Kit/Librosa1.py | alexissoto1/AudioNerd.py | 107b7eb8a141994798eb10075e8591491ca9b471 | [
"MIT"
] | null | null | null | MusicP_Kit/Librosa1.py | alexissoto1/AudioNerd.py | 107b7eb8a141994798eb10075e8591491ca9b471 | [
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 15 10:14:35 2018
@author: alexissoto
"""
'''
Music Production Kit
'''
import librosa as lb
song = "Fantasia_Impromptu.m4a" #Input file
def TempoChange():
y, sr = lb.load(song, duration = 30)
tempo, beat_frames = lb.beat.beat_trac... | 19.064935 | 80 | 0.629428 |
import librosa as lb
song = "Fantasia_Impromptu.m4a"
def TempoChange():
y, sr = lb.load(song, duration = 30)
tempo, beat_frames = lb.beat.beat_track(y = y, sr = sr)
stretch = lb.effects.time_stretch(y, 2.0) lb.output.write_wav('Double fast.wav', stretch, sr = sr)
def Harmonics():
... | true | true |
f70c77dce55c5afe74d3faf888bccf4b6e67116c | 6,274 | py | Python | A2C/utils.py | CommanderCero/RL_Algorithms | fd8172e0075247b682a1dca752306147fa2ed3ba | [
"Apache-2.0"
] | 1 | 2021-10-06T14:45:41.000Z | 2021-10-06T14:45:41.000Z | A2C/utils.py | CommanderCero/RL_Algorithms | fd8172e0075247b682a1dca752306147fa2ed3ba | [
"Apache-2.0"
] | null | null | null | A2C/utils.py | CommanderCero/RL_Algorithms | fd8172e0075247b682a1dca752306147fa2ed3ba | [
"Apache-2.0"
] | null | null | null | import scipy.signal as signal
import torch
import torch.nn as nn
import numpy as np
import models
import gym
import wandb
def create_feedforward(sizes, activation=nn.ReLU):
layers = []
for i in range(len(sizes) - 1):
layers.append(nn.Linear(sizes[i], sizes[i+1]))
if i < len(sizes) - 2:
... | 36.265896 | 104 | 0.603762 | import scipy.signal as signal
import torch
import torch.nn as nn
import numpy as np
import models
import gym
import wandb
def create_feedforward(sizes, activation=nn.ReLU):
layers = []
for i in range(len(sizes) - 1):
layers.append(nn.Linear(sizes[i], sizes[i+1]))
if i < len(sizes) - 2:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.