hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7024d3b025f432ada7fbb9c7ac3ca1994b5c05e | 8,915 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/payment_sips/models/payment.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/payment_sips/models/payment.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/payment_sips/models/payment.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Copyright 2015 Eezee-It
import json
import logging
from hashlib import sha256
import urlparse
from odoo import models, fields, api
from odoo.tools.float_utils import float_compare
from odoo.tools.translate import _
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.ad... | 39.799107 | 122 | 0.598654 |
import json
import logging
from hashlib import sha256
import urlparse
from odoo import models, fields, api
from odoo.tools.float_utils import float_compare
from odoo.tools.translate import _
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.addons.payment_sips.controllers.main impor... | true | true |
f7024e3194e8a4fab4ea64262a0690eef773048b | 10,727 | py | Python | tensorflow_probability/python/distributions/generalized_pareto_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/generalized_pareto_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/generalized_pareto_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.149635 | 80 | 0.690873 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import hypothesis as hp
import hypothesis.strategies as hps
import numpy as np
from scipy import stats as sp_stats
import tensorflow.compat.v2 as tf
import tensorflow_probability as... | true | true |
f7024e4804728c23068aca067b592692e83ed126 | 551 | py | Python | src/py/fun/vect3dotfun.py | butiran/butiran.github.io | bf99f55819a140190e5bda8f9675109ef607eb9d | [
"MIT"
] | null | null | null | src/py/fun/vect3dotfun.py | butiran/butiran.github.io | bf99f55819a140190e5bda8f9675109ef607eb9d | [
"MIT"
] | 2 | 2020-08-08T13:57:20.000Z | 2020-08-08T14:18:05.000Z | src/py/fun/vect3dotfun.py | butiran/butiran.github.io | bf99f55819a140190e5bda8f9675109ef607eb9d | [
"MIT"
] | 1 | 2020-08-08T13:54:23.000Z | 2020-08-08T13:54:23.000Z | #
# vect3dotfun.py
# Dot product of two 3-d vectors using function in Python 3.7
#
# Sparisoma Viridi | https://github.com/dudung
#
# 20210110
# 2001 Start creating this example.
# 2002 Test it and ok.
#
# Define dot function with two arguments
def dot(a, b):
p = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
return p
... | 19.678571 | 61 | 0.607985 |
def dot(a, b):
p = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
return p
r1 = [1, 2, 3]
r2 = [2, 2, 9]
p = dot(r1, r2)
print("r1 = ", r1, sep="");
print("r2 = ", r2, sep="");
print("p = r1 \xb7 r2 = ", p, sep="");
| true | true |
f7024e6e79ada62ffe1b48f5784bcfb79e415eb6 | 555 | py | Python | lambda_handlers/types.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | lambda_handlers/types.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | lambda_handlers/types.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Union, Optional
from dataclasses import asdict, dataclass
Headers = Optional[Dict[str, Union[str, bool, int]]]
@dataclass
class APIGatewayProxyResult:
"""
Key names are expected and given by AWS APIGateway specifications and must not be changed
"""
statusCode: int
bo... | 27.75 | 93 | 0.695495 | from typing import Any, Dict, Union, Optional
from dataclasses import asdict, dataclass
Headers = Optional[Dict[str, Union[str, bool, int]]]
@dataclass
class APIGatewayProxyResult:
statusCode: int
body: Union[str, Dict[str, Any]]
headers: Headers = None
multiValueHeaders: Headers = None
isBase64E... | true | true |
f7024f1af12ba2367ded56c8c7aef9e10ce2d174 | 206 | py | Python | app/model/response.py | Djaler/VkGraph | 473ad3703c16b7842b3834e062aecaa8057b00cc | [
"MIT"
] | 7 | 2017-03-22T13:41:52.000Z | 2021-01-16T14:13:44.000Z | app/model/response.py | Djaler/VkGraph | 473ad3703c16b7842b3834e062aecaa8057b00cc | [
"MIT"
] | 7 | 2019-10-30T18:44:47.000Z | 2020-08-18T20:19:41.000Z | app/model/response.py | Djaler/VkGraph | 473ad3703c16b7842b3834e062aecaa8057b00cc | [
"MIT"
] | 5 | 2017-06-16T10:34:59.000Z | 2021-12-02T20:37:07.000Z | class Status:
OK = "OK"
ERROR = "ERROR"
class Response(dict):
def __init__(self, status, data):
super().__init__()
self["status"] = status
self["data"] = data
| 17.166667 | 37 | 0.524272 | class Status:
OK = "OK"
ERROR = "ERROR"
class Response(dict):
def __init__(self, status, data):
super().__init__()
self["status"] = status
self["data"] = data
| true | true |
f7024fc117459b9452cffefdc8a339808e80919d | 903 | py | Python | py/worldfiles.py | Andreto/ga-utsikt | 0efb5b8fe3589ed7ccd39a8a665c2674ecd3ea7e | [
"MIT"
] | null | null | null | py/worldfiles.py | Andreto/ga-utsikt | 0efb5b8fe3589ed7ccd39a8a665c2674ecd3ea7e | [
"MIT"
] | null | null | null | py/worldfiles.py | Andreto/ga-utsikt | 0efb5b8fe3589ed7ccd39a8a665c2674ecd3ea7e | [
"MIT"
] | null | null | null | # Copyright (c) 2022 Andreas Törnkvist | MIT License
import math
class worldfile:
def __init__(self, filename):
wFile = open(filename)
w = wFile.readlines()
w = [line.rstrip() for line in w]
self.A = float(w[0])
self.D = float(w[1])
self.B = float(w[2])
sel... | 25.083333 | 56 | 0.487265 |
import math
class worldfile:
def __init__(self, filename):
wFile = open(filename)
w = wFile.readlines()
w = [line.rstrip() for line in w]
self.A = float(w[0])
self.D = float(w[1])
self.B = float(w[2])
self.E = float(w[3])
self.C = float(w[4])
... | true | true |
f7024fe456a0913f82cedffaff816db8b405cfa5 | 22,648 | py | Python | python/tvm/relay/_parser.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/_parser.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/_parser.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | 1 | 2019-12-03T13:53:44.000Z | 2019-12-03T13:53:44.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.40413 | 100 | 0.616478 |
from __future__ import absolute_import
import sys
from ast import literal_eval
from collections import deque
import tvm
from . import module
from .base import Span, SourceName
from . import expr
from . import ty
from . import op
PYTHON_VERSION = sys.version_info.major
try:
from .grammar.py3.R... | true | true |
f702504392500d06ef6b36b82fbef26e508af87f | 2,310 | py | Python | twistit/_errorhandling.py | pydron/twistit | 23ac43b830083fd32c400fcdfa5300e302769c74 | [
"MIT"
] | 1 | 2016-04-08T00:35:54.000Z | 2016-04-08T00:35:54.000Z | twistit/_errorhandling.py | pydron/twistit | 23ac43b830083fd32c400fcdfa5300e302769c74 | [
"MIT"
] | null | null | null | twistit/_errorhandling.py | pydron/twistit | 23ac43b830083fd32c400fcdfa5300e302769c74 | [
"MIT"
] | null | null | null | # Copyright (C) 2015 Stefan C. Mueller
import functools
from twisted.internet import defer
def on_error_close(logger):
"""
Decorator for callback methods that implement `IProtocol`.
Any uncaught exception is logged and the connection is closed
forcefully.
Usage::
import logger
... | 35.538462 | 82 | 0.636364 |
import functools
from twisted.internet import defer
def on_error_close(logger):
def make_wrapper(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
d = defer.maybeDeferred(func, self, *args, **kwargs)
def on_error(err):
... | true | true |
f7025167168843760aa99b53b10d6a7a0fc912e1 | 2,035 | py | Python | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | 33.916667 | 77 | 0.696314 |
class Key(object):
@classmethod
def from_path(cls, *args, **kwds):
raise NotImplementedError("Paths are not currently supported")
def __init__(self, encoded=None, obj=None):
self.name = None
if obj:
self.id = obj.id
self.kind = obj.kind(... | true | true |
f7025258811b22755058146106a8a59727a8d6a1 | 14,181 | py | Python | lib/geomet/wkt.py | davasqueza/eriskco_conector_CloudSQL | 99304b5eed06e9bba3646535a82d7fc98b0838b7 | [
"Apache-2.0"
] | null | null | null | lib/geomet/wkt.py | davasqueza/eriskco_conector_CloudSQL | 99304b5eed06e9bba3646535a82d7fc98b0838b7 | [
"Apache-2.0"
] | null | null | null | lib/geomet/wkt.py | davasqueza/eriskco_conector_CloudSQL | 99304b5eed06e9bba3646535a82d7fc98b0838b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Lars Butler & individual contributors
#
# 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 applicab... | 28.192843 | 79 | 0.586348 |
import tokenize
try:
import StringIO
except ImportError:
import io
StringIO = io
INVALID_WKT_FMT = 'Invalid WKT: `%s`'
def dump(obj, dest_file):
dest_file.write(dumps(obj))
def load(source_file):
return loads(source_file.read())
def dumps(obj, decimals=16):
geom_type = obj[... | true | true |
f7025441717dc4c50f233a3d069a8ca08670a3c6 | 16,281 | py | Python | gw_app/nas_managers/mod_mikrotik.py | Fa67/djing | 6e84640d7294be9f2f17f73e796713e93e43bb68 | [
"Unlicense"
] | 1 | 2020-12-05T01:55:56.000Z | 2020-12-05T01:55:56.000Z | gw_app/nas_managers/mod_mikrotik.py | Fa67/djing | 6e84640d7294be9f2f17f73e796713e93e43bb68 | [
"Unlicense"
] | null | null | null | gw_app/nas_managers/mod_mikrotik.py | Fa67/djing | 6e84640d7294be9f2f17f73e796713e93e43bb68 | [
"Unlicense"
] | 2 | 2020-03-07T12:00:17.000Z | 2020-12-05T01:56:01.000Z | import binascii
import re
import socket
from abc import ABCMeta
from hashlib import md5
from ipaddress import ip_network, _BaseNetwork
from typing import Iterable, Optional, Tuple, Generator, Dict, Iterator
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from djing.lib.decorato... | 33.989562 | 78 | 0.504146 | import binascii
import re
import socket
from abc import ABCMeta
from hashlib import md5
from ipaddress import ip_network, _BaseNetwork
from typing import Iterable, Optional, Tuple, Generator, Dict, Iterator
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from djing.lib.decorato... | true | true |
f702572d7b68352d734ef7b7cf7598a239ad2912 | 4,653 | py | Python | fabfile/deploy/__init__.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 8 | 2015-06-02T15:34:44.000Z | 2019-03-21T12:27:30.000Z | fabfile/deploy/__init__.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 761 | 2015-01-07T05:13:08.000Z | 2022-02-10T10:23:37.000Z | fabfile/deploy/__init__.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 12 | 2015-01-28T20:09:36.000Z | 2018-03-20T13:32:11.000Z | # coding: utf-8
"""
Fabric task for deploying project on servers(production, staging, development)
"""
import os
import sys
from contextlib import contextmanager
from fabric.contrib import django
from fabric.api import local, run, lcd, cd
from fabric.tasks import Task
from fab_settings import env
sys.path.append(... | 28.722222 | 103 | 0.617451 |
import os
import sys
from contextlib import contextmanager
from fabric.contrib import django
from fabric.api import local, run, lcd, cd
from fabric.tasks import Task
from fab_settings import env
sys.path.append(os.path.dirname(__file__) + '/../../mysite/')
django.settings_module('mysite.settings')
STAGING_BRANCH... | true | true |
f702586dfe5335199a783f1e4b598a01710c8e47 | 1,134 | py | Python | isi_sdk_8_1_0/test/test_license_license_tier_entitlements_exceeded_alert.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/test/test_license_license_tier_entitlements_exceeded_alert.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/test/test_license_license_tier_entitlements_exceeded_alert.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... | 27.658537 | 147 | 0.765432 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from isi_sdk_8_1_0.models.license_license_tier_entitlements_exceeded_alert import LicenseLicenseTierEntitlementsExceededAlert
from isi_sdk_8_1_0.rest import ApiException
class TestLicenseLicenseTierEntitlementsExceededAlert(unittest.T... | true | true |
f70258bb2c2a7d4122360a14a2ed82fa7d31690f | 1,316 | py | Python | tests/unit-tests/test_confluence_metadata.py | tonybaloney/sphinx-confluencebuilder | fd71fb5d5038b80fa3623dd673c198959dfbab03 | [
"BSD-2-Clause"
] | 1 | 2019-03-09T22:02:52.000Z | 2019-03-09T22:02:52.000Z | tests/unit-tests/test_confluence_metadata.py | tonybaloney/sphinx-confluencebuilder | fd71fb5d5038b80fa3623dd673c198959dfbab03 | [
"BSD-2-Clause"
] | 17 | 2019-03-09T21:34:20.000Z | 2019-03-15T08:42:43.000Z | tests/unit-tests/test_confluence_metadata.py | tonybaloney/sphinx-confluencebuilder | fd71fb5d5038b80fa3623dd673c198959dfbab03 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2020-2022 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
import os
class TestConfluenceMetadata(ConfluenceTestCase):
@classmethod... | 32.097561 | 80 | 0.668693 |
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
import os
class TestConfluenceMetadata(ConfluenceTestCase):
@classmethod
def setUpClass(cls):
super(TestConfluenceMetadata, cls).setUpClass()
cls.dataset = os.path.join(cls.datasets, 'metadata')
... | true | true |
f70258c7ffe9e101969941678261484178a2e372 | 2,270 | py | Python | testes/prototipo/gamePythonWS/server/server.py | wykke/duck-bomb | e1f8dd3352fd49b48b0d7f99fe72c7c2c65fb59a | [
"MIT"
] | 2 | 2020-03-09T17:45:09.000Z | 2020-03-09T19:16:51.000Z | testes/prototipo/gamePythonWS/server/server.py | wykke/duck-bomb | e1f8dd3352fd49b48b0d7f99fe72c7c2c65fb59a | [
"MIT"
] | 7 | 2020-04-07T13:46:23.000Z | 2020-07-06T23:41:43.000Z | testes/prototipo/gamePythonWS/server/server.py | wykke/duck-bomb | e1f8dd3352fd49b48b0d7f99fe72c7c2c65fb59a | [
"MIT"
] | null | null | null | import asyncio
import websockets
import time
import threading
players = 0
class Player:
def __init__(self, id, x = 0, y = 0, speed = 5):
self.id = id
self.x = x
self.y = y
self.dirX = 0
self.dirY = 0
self.speed = speed
print("Player criado com sucesso!")... | 26.091954 | 106 | 0.54978 | import asyncio
import websockets
import time
import threading
players = 0
class Player:
def __init__(self, id, x = 0, y = 0, speed = 5):
self.id = id
self.x = x
self.y = y
self.dirX = 0
self.dirY = 0
self.speed = speed
print("Player criado com sucesso!")... | true | true |
f70258fcc3cd5eb7d5734b4a7f21593d187343a6 | 55 | py | Python | eats/tests/behave/features/app/__init__.py | Etiqa/eats | 8c8e2da93d0014f6fbb208185712c5526dba1174 | [
"BSD-2-Clause"
] | null | null | null | eats/tests/behave/features/app/__init__.py | Etiqa/eats | 8c8e2da93d0014f6fbb208185712c5526dba1174 | [
"BSD-2-Clause"
] | 5 | 2021-03-18T21:34:44.000Z | 2022-03-11T23:35:23.000Z | eats/tests/behave/features/app/__init__.py | Etiqa/eats | 8c8e2da93d0014f6fbb208185712c5526dba1174 | [
"BSD-2-Clause"
] | null | null | null | __author__ = 'pulphix'
from app import TestApplication | 18.333333 | 31 | 0.818182 | __author__ = 'pulphix'
from app import TestApplication | true | true |
f70259449ecc1b15c11b417e7c81cc8cc9ba3771 | 422 | py | Python | easy_thumbnails_admin/admin.py | Apkawa/easy-thumbnails-admin | 9d7a38f215cdac53a663b00f1d4ff3a3c2a54eb4 | [
"MIT"
] | null | null | null | easy_thumbnails_admin/admin.py | Apkawa/easy-thumbnails-admin | 9d7a38f215cdac53a663b00f1d4ff3a3c2a54eb4 | [
"MIT"
] | null | null | null | easy_thumbnails_admin/admin.py | Apkawa/easy-thumbnails-admin | 9d7a38f215cdac53a663b00f1d4ff3a3c2a54eb4 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from django.contrib import admin
from .models import ThumbnailOption
from django.contrib.admin.widgets import AdminFileWidget
@admin.register(ThumbnailOption)
class ThumbnailOptionAdmin(admin.ModelAdmin):
fields = ['source', 'alias', 'options']
class Thu... | 20.095238 | 56 | 0.751185 |
from __future__ import unicode_literals
from django.contrib import admin
from .models import ThumbnailOption
from django.contrib.admin.widgets import AdminFileWidget
@admin.register(ThumbnailOption)
class ThumbnailOptionAdmin(admin.ModelAdmin):
fields = ['source', 'alias', 'options']
class ThumbnailOptionMix... | true | true |
f7025a2139b9ed3d7c6a408c7c308ae18dcece8f | 1,177 | py | Python | tests/signaltest.py | zibous/ha-miscale2 | 39486415208ea1c54620c0ed91d68b4167a93c4e | [
"MIT"
] | 25 | 2020-12-14T05:21:08.000Z | 2022-03-28T21:08:06.000Z | tests/signaltest.py | zibous/ha-miscale2 | 39486415208ea1c54620c0ed91d68b4167a93c4e | [
"MIT"
] | null | null | null | tests/signaltest.py | zibous/ha-miscale2 | 39486415208ea1c54620c0ed91d68b4167a93c4e | [
"MIT"
] | 2 | 2021-04-18T12:29:23.000Z | 2021-07-27T15:09:09.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.append("..")
try:
import os
import signal
import time
from conf import *
from lib import logger
from lib import mqtt
except Exception as e:
print(f"Import error: {str(e)} line {sys.exc_info()[-1].tb_lineno}, check requi... | 23.078431 | 104 | 0.646559 |
import sys
sys.path.append("..")
try:
import os
import signal
import time
from conf import *
from lib import logger
from lib import mqtt
except Exception as e:
print(f"Import error: {str(e)} line {sys.exc_info()[-1].tb_lineno}, check requirements.txt")
sys.exit(1)
log = logger.... | true | true |
f7025a95efb3508f4614d10c34abe2268a9570db | 1,043 | py | Python | database/sec.py | chung-ejy/longshot | c9ff1a6586546b496ed6ba2f0b43ff9cd68fa15d | [
"MIT"
] | null | null | null | database/sec.py | chung-ejy/longshot | c9ff1a6586546b496ed6ba2f0b43ff9cd68fa15d | [
"MIT"
] | null | null | null | database/sec.py | chung-ejy/longshot | c9ff1a6586546b496ed6ba2f0b43ff9cd68fa15d | [
"MIT"
] | 1 | 2021-08-05T02:12:51.000Z | 2021-08-05T02:12:51.000Z | from database.adatabase import ADatabase
import pandas as pd
class SEC(ADatabase):
def __init__(self):
super().__init__("sec")
def retrieve_num_data(self,adsh):
try:
db = self.client[self.name]
table = db["nums"]
data = table.find({"adsh":adsh},{"_id":0}... | 31.606061 | 75 | 0.5465 | from database.adatabase import ADatabase
import pandas as pd
class SEC(ADatabase):
def __init__(self):
super().__init__("sec")
def retrieve_num_data(self,adsh):
try:
db = self.client[self.name]
table = db["nums"]
data = table.find({"adsh":adsh},{"_id":0}... | true | true |
f7025aa46119097ebc8650ad1c02f9485349b539 | 605 | py | Python | supermario/supermario 1105(2)/start_state.py | Kimmiryeong/2DGP_GameProject | ad3fb197aab27227fc92fd404b2c310f8d0827ca | [
"MIT"
] | null | null | null | supermario/supermario 1105(2)/start_state.py | Kimmiryeong/2DGP_GameProject | ad3fb197aab27227fc92fd404b2c310f8d0827ca | [
"MIT"
] | null | null | null | supermario/supermario 1105(2)/start_state.py | Kimmiryeong/2DGP_GameProject | ad3fb197aab27227fc92fd404b2c310f8d0827ca | [
"MIT"
] | null | null | null | import game_framework
from pico2d import *
import title_state
name = "StartState"
image = None
logo_time = 0.0
def enter():
global image
image = load_image('kpu_credit.png')
def exit():
global image
del(image)
def update():
global logo_time
if (logo_time > 1.0):
logo_time = 0.8
... | 11.634615 | 48 | 0.634711 | import game_framework
from pico2d import *
import title_state
name = "StartState"
image = None
logo_time = 0.0
def enter():
global image
image = load_image('kpu_credit.png')
def exit():
global image
del(image)
def update():
global logo_time
if (logo_time > 1.0):
logo_time = 0.8
... | true | true |
f7025b188f8b1f8584c33840874bfd12437bb343 | 489 | py | Python | Apuntes/Preprocess/Missing Data.py | Aaronga19/MachineLearning-A-Z | e8e27f0a31ac3e3c05d4029e6e5e14ac8a911153 | [
"MIT"
] | null | null | null | Apuntes/Preprocess/Missing Data.py | Aaronga19/MachineLearning-A-Z | e8e27f0a31ac3e3c05d4029e6e5e14ac8a911153 | [
"MIT"
] | null | null | null | Apuntes/Preprocess/Missing Data.py | Aaronga19/MachineLearning-A-Z | e8e27f0a31ac3e3c05d4029e6e5e14ac8a911153 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 20:30:46 2020
@author: Aaronga
"""
# Datos faltantes
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv("Data.csv")
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Tratamiento de los NaN
from sklearn.preproc... | 22.227273 | 66 | 0.687117 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv("Data.csv")
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values="NaN", strategy="mean", axis = 0)
imputer = imputer.fit(X[:, 1:3])
X[:, ... | true | true |
f7025b360586c29b40347acb0683ce9ba02e33c8 | 5,930 | py | Python | test/sql/test_case_statement.py | Thhhza/sqlalchemy | f2b267043e17b2b769dc2a5b8139f6be2a3d4e84 | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | test/sql/test_case_statement.py | Thhhza/sqlalchemy | f2b267043e17b2b769dc2a5b8139f6be2a3d4e84 | [
"MIT"
] | null | null | null | test/sql/test_case_statement.py | Thhhza/sqlalchemy | f2b267043e17b2b769dc2a5b8139f6be2a3d4e84 | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z | from sqlalchemy.testing import assert_raises, eq_
from sqlalchemy.testing import fixtures, AssertsCompiledSQL
from sqlalchemy import (
testing, exc, case, select, literal_column, text, and_, Integer, cast,
String, Column, Table, MetaData)
from sqlalchemy.sql import table, column
info_table = None
class CaseT... | 31.375661 | 78 | 0.417707 | from sqlalchemy.testing import assert_raises, eq_
from sqlalchemy.testing import fixtures, AssertsCompiledSQL
from sqlalchemy import (
testing, exc, case, select, literal_column, text, and_, Integer, cast,
String, Column, Table, MetaData)
from sqlalchemy.sql import table, column
info_table = None
class CaseT... | true | true |
f7025b8b75bfdaa2c9f531221732fb0a9450c662 | 6,087 | py | Python | sdks/python/apache_beam/runners/interactive/user_pipeline_tracker_test.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/runners/interactive/user_pipeline_tracker_test.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/runners/interactive/user_pipeline_tracker_test.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 29.264423 | 85 | 0.730738 |
import unittest
import apache_beam as beam
from apache_beam.runners.interactive.user_pipeline_tracker import UserPipelineTracker
class UserPipelineTrackerTest(unittest.TestCase):
def test_getting_unknown_pid_returns_none(self):
ut = UserPipelineTracker()
p = beam.Pipeline()
self.asse... | true | true |
f7025c78c757691bec4e0501ffe984904b95dd4a | 619 | py | Python | Python/PYHTON/Variaveis/DSA - Variaveis.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | Python/PYHTON/Variaveis/DSA - Variaveis.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | Python/PYHTON/Variaveis/DSA - Variaveis.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | # VARIAVEIS
# ATRIBUINDO VALOR A UMA VARIAVEL
var_teste = 1
print(var_teste)
print(type(var_teste))
#DECLARAÇÂO MULTIPLA
pessoa1, pessoa2, pessoa3 = 'Jose', 'Joao','Maria'
print(pessoa1)
print(pessoa2)
print(pessoa3)
# VARIAVEL COM ATRIBUIÇÃO
pessoa1=pessoa2=pessoa3 = 'Jose'
print(pessoa1)
print(pessoa2)
print(pesso... | 19.967742 | 50 | 0.74475 |
var_teste = 1
print(var_teste)
print(type(var_teste))
pessoa1, pessoa2, pessoa3 = 'Jose', 'Joao','Maria'
print(pessoa1)
print(pessoa2)
print(pessoa3)
pessoa1=pessoa2=pessoa3 = 'Jose'
print(pessoa1)
print(pessoa2)
print(pessoa3)
idade = 32
idade1 = 28
print('SOMA',idade + idade1)
print('SUBTRAÇÃO',idade - idad... | true | true |
f7025d49566233267aee5f1e01b03afd40276ac2 | 8,674 | py | Python | rrd/view/screen.py | schemacs/falcon-dashboard | 4d2b387a3e9f12994a54e5d2bcf8acd723710fd6 | [
"Apache-2.0"
] | 1 | 2016-06-04T13:23:43.000Z | 2016-06-04T13:23:43.000Z | rrd/view/screen.py | smokeman/dashboard | 35dbee7bc06d294a32ecba18a62395e320dcfb8a | [
"Apache-2.0"
] | null | null | null | rrd/view/screen.py | smokeman/dashboard | 35dbee7bc06d294a32ecba18a62395e320dcfb8a | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8 -*-
import json
import copy
import requests
import json
from flask import render_template, abort, request, url_for, redirect, g
import time
import datetime
from rrd import app
from rrd.model.screen import DashboardScreen
from rrd.model.graph import DashboardGraph
from rrd import consts
from rrd.utils... | 32.00738 | 114 | 0.61056 |
import json
import copy
import requests
import json
from flask import render_template, abort, request, url_for, redirect, g
import time
import datetime
from rrd import app
from rrd.model.screen import DashboardScreen
from rrd.model.graph import DashboardGraph
from rrd import consts
from rrd.utils.graph_urls import ge... | true | true |
f7025d79335469b2af7d433c0a5238418c81123d | 2,973 | py | Python | ogbg-code/model/asap.py | anonyma2020/dagnn | 3191b2cc4f923d523ece3962c96a0e3dd54f1a0b | [
"MIT"
] | 38 | 2021-01-24T13:33:31.000Z | 2022-03-29T02:24:32.000Z | ogbg-code/model/asap.py | anonyma2020/dagnn | 3191b2cc4f923d523ece3962c96a0e3dd54f1a0b | [
"MIT"
] | 3 | 2021-03-10T08:00:58.000Z | 2021-11-02T08:29:02.000Z | ogbg-code/model/asap.py | anonyma2020/dagnn | 3191b2cc4f923d523ece3962c96a0e3dd54f1a0b | [
"MIT"
] | 9 | 2021-02-20T14:39:34.000Z | 2022-03-17T01:51:03.000Z | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import (ASAPooling,
GraphConv, global_mean_pool,
JumpingKnowledge)
class ASAP(torch.nn.Module):
def __init__(self, num_vocab, max_seq_len, node_encoder, ... | 36.256098 | 125 | 0.590649 | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import (ASAPooling,
GraphConv, global_mean_pool,
JumpingKnowledge)
class ASAP(torch.nn.Module):
def __init__(self, num_vocab, max_seq_len, node_encoder, ... | true | true |
f7025e482326addd111e4b18afa939b10069bdad | 1,745 | py | Python | catkin_ws/src/dagu_car/src/wheels_cmd_switch_node.py | OSLL/Dickietown-Software | fcbca82cae9a8076c30c6a21c93b729bb8c01eca | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/dagu_car/src/wheels_cmd_switch_node.py | OSLL/Dickietown-Software | fcbca82cae9a8076c30c6a21c93b729bb8c01eca | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/dagu_car/src/wheels_cmd_switch_node.py | OSLL/Dickietown-Software | fcbca82cae9a8076c30c6a21c93b729bb8c01eca | [
"CC-BY-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
from duckietown_msgs.msg import WheelsCmdStamped, FSMState
class WheelsCmdSwitchNode(object):
def __init__(self):
self.node_name = rospy.get_name()
rospy.loginfo("[%s] Initializing " %(self.node_name))
# Read parameters
self.mappings = rospy.get_para... | 39.659091 | 128 | 0.694556 |
import rospy
from duckietown_msgs.msg import WheelsCmdStamped, FSMState
class WheelsCmdSwitchNode(object):
def __init__(self):
self.node_name = rospy.get_name()
rospy.loginfo("[%s] Initializing " %(self.node_name))
self.mappings = rospy.get_param("~mappings")
source_topic_di... | true | true |
f70260b8d341e2802090c4507199d8c9a2de5f03 | 2,788 | py | Python | alipay/aop/api/domain/AlipayTradeSettleReceivablesQueryModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2022-03-07T06:11:10.000Z | 2022-03-07T06:11:10.000Z | alipay/aop/api/domain/AlipayTradeSettleReceivablesQueryModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayTradeSettleReceivablesQueryModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2021-10-05T03:01:09.000Z | 2021-10-05T03:01:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.SettleEntity import SettleEntity
class AlipayTradeSettleReceivablesQueryModel(object):
def __init__(self):
self._biz_product = None
self._extend_params = None... | 30.977778 | 79 | 0.625897 |
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.SettleEntity import SettleEntity
class AlipayTradeSettleReceivablesQueryModel(object):
def __init__(self):
self._biz_product = None
self._extend_params = None
self._merchant_info = None
... | true | true |
f70261b694fca9802548a912f945ff89a5035eca | 2,782 | py | Python | src/state.py | xeust/Method-Draw | a8b264e37fdc3a3a8b629178d62ecb6c8008760b | [
"MIT"
] | 7 | 2021-07-25T23:38:31.000Z | 2021-12-04T23:11:57.000Z | src/state.py | xeust/Method-Draw | a8b264e37fdc3a3a8b629178d62ecb6c8008760b | [
"MIT"
] | null | null | null | src/state.py | xeust/Method-Draw | a8b264e37fdc3a3a8b629178d62ecb6c8008760b | [
"MIT"
] | 5 | 2021-08-11T12:02:10.000Z | 2022-02-24T04:41:09.000Z | import os
from deta import Deta
from datetime import date, datetime
from fastapi import HTTPException
import urllib
import base64
deta = Deta()
base = deta.Base("drawings")
drive = deta.Drive("drawings")
def get_all(db, query):
blob_gen = db.fetch(query)
blobs = []
for stored_blob in blob_gen:
... | 27.82 | 127 | 0.62509 | import os
from deta import Deta
from datetime import date, datetime
from fastapi import HTTPException
import urllib
import base64
deta = Deta()
base = deta.Base("drawings")
drive = deta.Drive("drawings")
def get_all(db, query):
blob_gen = db.fetch(query)
blobs = []
for stored_blob in blob_gen:
... | true | true |
f70262ad5923fa3e4e49cdaa62ec5bb20a7a390f | 6,835 | py | Python | qiskit/providers/aer/library/save_amplitudes.py | ArunRamachandran25/qiskit-aer | 0ece80f11d61193f74b639b3efb82253fedeaef1 | [
"Apache-2.0"
] | 1 | 2021-02-25T16:56:19.000Z | 2021-02-25T16:56:19.000Z | qiskit/providers/aer/library/save_amplitudes.py | ArunRamachandran25/qiskit-aer | 0ece80f11d61193f74b639b3efb82253fedeaef1 | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/library/save_amplitudes.py | ArunRamachandran25/qiskit-aer | 0ece80f11d61193f74b639b3efb82253fedeaef1 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# 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 derivat... | 41.932515 | 84 | 0.593416 |
from qiskit.circuit import QuantumCircuit
from qiskit.extensions.exceptions import ExtensionError
from .save_data import SaveSingleData, SaveAverageData, default_qubits
class SaveAmplitudes(SaveSingleData):
def __init__(self,
key,
num_qubits,
params,
... | true | true |
f70262f115d0752c354fd0cc11d76806f336021b | 897 | py | Python | share/qt/clean_mac_info_plist.py | skipper229/afrcoin1 | f1ff2ce1f86e21097a3ee80011b36217ad1941c3 | [
"MIT"
] | null | null | null | share/qt/clean_mac_info_plist.py | skipper229/afrcoin1 | f1ff2ce1f86e21097a3ee80011b36217ad1941c3 | [
"MIT"
] | null | null | null | share/qt/clean_mac_info_plist.py | skipper229/afrcoin1 | f1ff2ce1f86e21097a3ee80011b36217ad1941c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Africoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
in... | 29.9 | 109 | 0.725753 |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "Africoin-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replac... | false | true |
f702639b0a5a2b1ee290b9721b4444d46a26ff08 | 17,303 | py | Python | python/generate_python_ctypes.py | arves100/allegro5 | 6187893e4ece9258136d864bf4b99cb9371d56c5 | [
"BSD-3-Clause"
] | 1 | 2020-02-19T10:56:38.000Z | 2020-02-19T10:56:38.000Z | python/generate_python_ctypes.py | arves100/allegro5 | 6187893e4ece9258136d864bf4b99cb9371d56c5 | [
"BSD-3-Clause"
] | null | null | null | python/generate_python_ctypes.py | arves100/allegro5 | 6187893e4ece9258136d864bf4b99cb9371d56c5 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T18:02:27.000Z | 2019-04-15T18:02:27.000Z | #!/usr/bin/env python
import sys
import re
import optparse
from ctypes import *
"""
This script will use the prototypes from "checkdocs.py -s" to concoct
a 1:1 Python wrapper for Allegro.
"""
class _AL_UTF8String:
pass
class Allegro:
def __init__(self):
self.types = {}
self.functions = {}
... | 32.042593 | 78 | 0.46385 |
import sys
import re
import optparse
from ctypes import *
class _AL_UTF8String:
pass
class Allegro:
def __init__(self):
self.types = {}
self.functions = {}
self.constants = {}
def add_struct(self, name):
x = type(name, (Structure, ), {})
self.types[name] = x
... | true | true |
f70265c426e2f1f8f9b431c4f8ec20ae69355199 | 3,292 | py | Python | one_barangay/scripts/google_cloud_storage.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | null | null | null | one_barangay/scripts/google_cloud_storage.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | 96 | 2021-08-28T12:37:02.000Z | 2022-03-23T04:25:12.000Z | one_barangay/scripts/google_cloud_storage.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | null | null | null | """File for Google Cloud Storage."""
import logging
import os
import urllib.parse
from pathlib import Path
import aiohttp
from aiofile import AIOFile
from gcloud.aio.storage import Storage
from google.cloud import storage
from one_barangay.local_settings import logger
async def async_upload_to_bucket(
filepath:... | 29.392857 | 94 | 0.670109 | import logging
import os
import urllib.parse
from pathlib import Path
import aiohttp
from aiofile import AIOFile
from gcloud.aio.storage import Storage
from google.cloud import storage
from one_barangay.local_settings import logger
async def async_upload_to_bucket(
filepath: str,
file_obj,
gcs_path: str... | true | true |
f70265d6f013c90b4be07e53a84444ab11712fa3 | 6,805 | py | Python | exps/LFNA/basic-same.py | xgmiao/AutoDL-Projects | 0dbbc286c9f56136291590136fffd513af881c36 | [
"MIT"
] | 1 | 2021-05-11T00:41:15.000Z | 2021-05-11T00:41:15.000Z | exps/LFNA/basic-same.py | xgmiao/AutoDL-Projects | 0dbbc286c9f56136291590136fffd513af881c36 | [
"MIT"
] | null | null | null | exps/LFNA/basic-same.py | xgmiao/AutoDL-Projects | 0dbbc286c9f56136291590136fffd513af881c36 | [
"MIT"
] | null | null | null | #####################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.04 #
#####################################################
# python exps/LFNA/basic-same.py --srange 1-999 --env_version v1 --hidden_dim 16
# python exps/LFNA/basic-same.py --srange 1-999 --env_version v2 --hidden_dim... | 33.688119 | 87 | 0.580309 | t(),
"model": model,
"index": idx,
"timestamp": env_info["{:}-timestamp".format(idx)],
},
save_path,
logger,
)
logger.log("")
per_timestamp_time.update(time.time() - start_time)
start_time = time.time()
... | true | true |
f70266abe169cc4c264c3fbf69d349d04e550aaa | 1,206 | py | Python | 056_Merge_Intervals.py | adwardlee/leetcode_solutions | f386869161181e153e29165d8fff06492bb192f3 | [
"MIT"
] | null | null | null | 056_Merge_Intervals.py | adwardlee/leetcode_solutions | f386869161181e153e29165d8fff06492bb192f3 | [
"MIT"
] | null | null | null | 056_Merge_Intervals.py | adwardlee/leetcode_solutions | f386869161181e153e29165d8fff06492bb192f3 | [
"MIT"
] | null | null | null | '''
Given a collection of intervals, merge all overlapping intervals.
Example 1:
Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]
Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
Example 2:
Input: intervals = [[1,4],[4,5]]
Output: [[1,5]]
Explanation: Interv... | 29.414634 | 123 | 0.556385 | class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
intervals = sorted(intervals, key = lambda x: x[0])
output = []
i = 0
if len(intervals) <= 1:
return intervals
while i < len(intervals) - 1:
tmp = intervals[i]
... | true | true |
f70266d5dff1d3d7c3f7c40adb716334cf21a6f6 | 426 | py | Python | src/periodic_tasks_api/views.py | VladimirDominion/periodic_tasks_utils | c2f58fd5e6c154c17d95bd9e616f53fcf10a078d | [
"MIT"
] | null | null | null | src/periodic_tasks_api/views.py | VladimirDominion/periodic_tasks_utils | c2f58fd5e6c154c17d95bd9e616f53fcf10a078d | [
"MIT"
] | null | null | null | src/periodic_tasks_api/views.py | VladimirDominion/periodic_tasks_utils | c2f58fd5e6c154c17d95bd9e616f53fcf10a078d | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from periodic_tasks_api.models import CustomExtendedPeriodicTask
from periodic_tasks_api.serializers import PeriodicTaskSerializer
from periodic_tasks_api.filters import PeriodicTaskFilterSet
class PeriodicTaskView(viewsets.ModelViewSet):
queryset = CustomExtendedPeriodicTask.... | 35.5 | 65 | 0.86385 | from rest_framework import viewsets
from periodic_tasks_api.models import CustomExtendedPeriodicTask
from periodic_tasks_api.serializers import PeriodicTaskSerializer
from periodic_tasks_api.filters import PeriodicTaskFilterSet
class PeriodicTaskView(viewsets.ModelViewSet):
queryset = CustomExtendedPeriodicTask.... | true | true |
f70268226852644181840ef9f194176c95f6c74e | 11,075 | py | Python | network/switch.py | energieip/sol200-simulator | 8e8aca9e25c972fd0d8d6cdfe06cbd7895ce90ac | [
"Apache-2.0"
] | null | null | null | network/switch.py | energieip/sol200-simulator | 8e8aca9e25c972fd0d8d6cdfe06cbd7895ce90ac | [
"Apache-2.0"
] | null | null | null | network/switch.py | energieip/sol200-simulator | 8e8aca9e25c972fd0d8d6cdfe06cbd7895ce90ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# coding: utf-8
from network.group import Group
import paho.mqtt.client as mqtt
from threading import Thread
import time
from log import logger
import paho.mqtt.subscribe as subscribe
import json
import random
import string
class Switch(Thread):
def __init__(self, broker_ip):
Thread._... | 39.695341 | 140 | 0.591332 |
from network.group import Group
import paho.mqtt.client as mqtt
from threading import Thread
import time
from log import logger
import paho.mqtt.subscribe as subscribe
import json
import random
import string
class Switch(Thread):
def __init__(self, broker_ip):
Thread.__init__(self)
self.broker... | true | true |
f7026834a7a7d7b060fd2eab47981312a89bbc7e | 4,063 | py | Python | setup.py | mpbelhorn/OctoPrint-BedLevelVisualizer | 77622c65a06a8eb3a12e9fad0281386334dc8314 | [
"MIT"
] | null | null | null | setup.py | mpbelhorn/OctoPrint-BedLevelVisualizer | 77622c65a06a8eb3a12e9fad0281386334dc8314 | [
"MIT"
] | null | null | null | setup.py | mpbelhorn/OctoPrint-BedLevelVisualizer | 77622c65a06a8eb3a12e9fad0281386334dc8314 | [
"MIT"
] | null | null | null | # coding=utf-8
########################################################################################################################
### Do not forget to adjust the following variables to your own plugin.
# The plugin's identifier, has to be unique
plugin_identifier = "bedlevelvisualizer"
# The plugin's python pa... | 42.768421 | 140 | 0.707113 | true | true | |
f702692290f1f965b54b54b17c0a5c2fc4387772 | 1,398 | py | Python | tests/cases/py_client/parameter_name_conflict/client.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | tests/cases/py_client/parameter_name_conflict/client.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | tests/cases/py_client/parameter_name_conflict/client.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Automatically generated file by swagger_to. DO NOT EDIT OR APPEND ANYTHING!
"""Implements the client for test."""
# pylint: skip-file
# pydocstyle: add-ignore=D105,D107,D401
import contextlib
import json
from typing import Any, BinaryIO, Dict, List, MutableMapping, Optional
import requests
i... | 24.964286 | 95 | 0.615165 |
import contextlib
import json
from typing import Any, BinaryIO, Dict, List, MutableMapping, Optional
import requests
import requests.auth
class RemoteCaller:
def __init__(self, url_prefix: str, auth: Optional[requests.auth.AuthBase] = None) -> None:
self.url_prefix = url_prefix
self.auth =... | true | true |
f702695464c85f76c6dbad36b5d94f9cc2ae757a | 52,412 | py | Python | caret_analyze/infra/lttng/records_provider_lttng.py | tier4/CARET_analyze | 96f29eaaf1ff961f6410df38d938d421272f99f3 | [
"Apache-2.0"
] | null | null | null | caret_analyze/infra/lttng/records_provider_lttng.py | tier4/CARET_analyze | 96f29eaaf1ff961f6410df38d938d421272f99f3 | [
"Apache-2.0"
] | 12 | 2021-10-08T04:43:17.000Z | 2022-03-22T10:42:53.000Z | caret_analyze/infra/lttng/records_provider_lttng.py | tier4/CARET_analyze | 96f29eaaf1ff961f6410df38d938d421272f99f3 | [
"Apache-2.0"
] | 4 | 2021-12-14T05:47:14.000Z | 2022-03-16T11:26:59.000Z | # Copyright 2021 Research Institute of Systems Planning, 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 applica... | 35.128686 | 98 | 0.63869 |
from functools import cached_property
from logging import getLogger
from typing import Dict, List, Optional, Sequence, Tuple, Union
from caret_analyze.value_objects.message_context import MessageContext, MessageContextType
from .lttng import Lttng
from .value_objects import PublisherValueLttng, Subscrip... | true | true |
f7026a0eac2c1ee044ec2734f8fee2a9493d727c | 2,977 | py | Python | hexahue_map.py | kusuwada/hexahue | 1c41a51fb40dbbfe24cf2c4d394808f932be6bb5 | [
"MIT"
] | null | null | null | hexahue_map.py | kusuwada/hexahue | 1c41a51fb40dbbfe24cf2c4d394808f932be6bb5 | [
"MIT"
] | null | null | null | hexahue_map.py | kusuwada/hexahue | 1c41a51fb40dbbfe24cf2c4d394808f932be6bb5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import yaml
class HexahueMap():
def __init__(self, space_color):
pink = (255, 0, 255)
red = (255, 0, 0)
green = (0, 255, 0)
yellow = (255, 255, 0)
blue = (0, 0, 255)
sky = (0, 255, 255)
white = (255, 255, 255)
gray = (128, 128, 128)
blac... | 45.106061 | 67 | 0.59523 |
import yaml
class HexahueMap():
def __init__(self, space_color):
pink = (255, 0, 255)
red = (255, 0, 0)
green = (0, 255, 0)
yellow = (255, 255, 0)
blue = (0, 0, 255)
sky = (0, 255, 255)
white = (255, 255, 255)
gray = (128, 128, 128)
black = (0, 0, 0)
self.hmap = {}
self.hm... | true | true |
f7026a4ae9f688521225dfaaa410970f7fe1bab1 | 90 | py | Python | lesson_tasks/lesson6/num1.7.py | NikaEgorova/goiteens-python3-egorova | 809059abf3464cbe4f0f116e52ce53534a0ca5ba | [
"MIT"
] | null | null | null | lesson_tasks/lesson6/num1.7.py | NikaEgorova/goiteens-python3-egorova | 809059abf3464cbe4f0f116e52ce53534a0ca5ba | [
"MIT"
] | null | null | null | lesson_tasks/lesson6/num1.7.py | NikaEgorova/goiteens-python3-egorova | 809059abf3464cbe4f0f116e52ce53534a0ca5ba | [
"MIT"
] | null | null | null | # 7 завдання
for n in range(1, 101):
print(n, "Я не буду їсти палички Бобо на уроці")
| 22.5 | 52 | 0.655556 |
for n in range(1, 101):
print(n, "Я не буду їсти палички Бобо на уроці")
| true | true |
f7026b9e1ac955c01abf85c34e1a1742cdc43c1d | 6,915 | py | Python | SoftLayer/managers/ordering.py | corneil/softlayer-python | bbaf562fb76536c5cc652e356729723f38f48b66 | [
"MIT"
] | 1 | 2019-11-06T13:54:07.000Z | 2019-11-06T13:54:07.000Z | SoftLayer/managers/ordering.py | underscorephil/softlayer-python | 567540a328d5258e55594466127cd22b9a04a2ea | [
"MIT"
] | null | null | null | SoftLayer/managers/ordering.py | underscorephil/softlayer-python | 567540a328d5258e55594466127cd22b9a04a2ea | [
"MIT"
] | 1 | 2020-07-07T12:18:26.000Z | 2020-07-07T12:18:26.000Z | """
SoftLayer.ordering
~~~~~~~~~~~~~~~~~~
Ordering Manager
:license: MIT, see LICENSE for more details.
"""
class OrderingManager(object):
"""Manages hardware devices.
:param SoftLayer.API.Client client: an API client instance
"""
def __init__(self, client):
self.client = cl... | 34.232673 | 79 | 0.599566 |
class OrderingManager(object):
def __init__(self, client):
self.client = client
def get_packages_of_type(self, package_types, mask=None):
package_service = self.client['Product_Package']
_filter = {
'type': {
'keyName': {
'operation': ... | true | true |
f7026cd4a1731d33e95675f39f860e7e24cf332d | 433 | py | Python | BOJ/review/boj_14501.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/review/boj_14501.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/review/boj_14501.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # BOJ 14501
import sys
si = sys.stdin.readline
t = [0] * 17
dp = [0] * 17
n = int(si())
for i in range(1, n + 1):
m, o = map(int, si().split())
t[i] = m
dp[i] = o
def solve(n):
ans = 0
for i in range(n, 0, -1):
if i + t[i] > n + 1:
dp[i] = dp[i + 1]
else:
... | 15.464286 | 56 | 0.418014 |
import sys
si = sys.stdin.readline
t = [0] * 17
dp = [0] * 17
n = int(si())
for i in range(1, n + 1):
m, o = map(int, si().split())
t[i] = m
dp[i] = o
def solve(n):
ans = 0
for i in range(n, 0, -1):
if i + t[i] > n + 1:
dp[i] = dp[i + 1]
else:
dp[i] = m... | true | true |
f7026cf1cb17c940ba14868190ef89a631252ceb | 1,663 | py | Python | data/base_dataset.py | jaxondl/Recycle-GAN | d107d97e964d9d3921f36fe3c7837886f0f82eda | [
"MIT"
] | null | null | null | data/base_dataset.py | jaxondl/Recycle-GAN | d107d97e964d9d3921f36fe3c7837886f0f82eda | [
"MIT"
] | null | null | null | data/base_dataset.py | jaxondl/Recycle-GAN | d107d97e964d9d3921f36fe3c7837886f0f82eda | [
"MIT"
] | null | null | null | import torch.utils.data as data
from PIL import Image
import torchvision.transforms as transforms
from torchvision.transforms import InterpolationMode
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
def initiali... | 35.382979 | 82 | 0.669874 | import torch.utils.data as data
from PIL import Image
import torchvision.transforms as transforms
from torchvision.transforms import InterpolationMode
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
def initiali... | true | true |
f7026dc30b9cca1f621e1e1f41f734e3e544092c | 203 | py | Python | tenx/apps.py | bpotvin-bccrc/colossus | fa5ca7ce4cfe794c7d2167acb868aa9167988941 | [
"MIT"
] | 2 | 2018-10-03T16:05:14.000Z | 2019-03-08T23:01:29.000Z | tenx/apps.py | bpotvin-bccrc/colossus | fa5ca7ce4cfe794c7d2167acb868aa9167988941 | [
"MIT"
] | 3 | 2019-05-09T22:48:22.000Z | 2020-06-05T18:52:05.000Z | tenx/apps.py | bpotvin-bccrc/colossus | fa5ca7ce4cfe794c7d2167acb868aa9167988941 | [
"MIT"
] | 4 | 2018-08-16T22:25:10.000Z | 2021-02-19T16:10:15.000Z | """
Created Oct 19, 2017
@author: Spencer Vatrt-Watts (github.com/Spenca)
"""
from __future__ import unicode_literals
from django.apps import AppConfig
class TenxConfig(AppConfig):
name = 'tenx' | 15.615385 | 48 | 0.743842 |
from __future__ import unicode_literals
from django.apps import AppConfig
class TenxConfig(AppConfig):
name = 'tenx' | true | true |
f7026deba14677cec6bc3070ab5690249babe22c | 5,966 | py | Python | affine_cipher.py | premnagdeo/Cryptography | 061b6557dd94d88ce9c669af8d6a6a414a834adc | [
"MIT"
] | 1 | 2020-08-07T18:35:45.000Z | 2020-08-07T18:35:45.000Z | affine_cipher.py | premnagdeo/Cryptography | 061b6557dd94d88ce9c669af8d6a6a414a834adc | [
"MIT"
] | null | null | null | affine_cipher.py | premnagdeo/Cryptography | 061b6557dd94d88ce9c669af8d6a6a414a834adc | [
"MIT"
] | null | null | null | import pyperclip
import math
class Affine_Cipher:
def __init__(self):
self.SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?.'
def check_key(self, key):
keyA = key // len(self.SYMBOLS)
keyB = key % len(self.SYMBOLS)
# Weak Key Checks
if keyA... | 32.075269 | 138 | 0.483741 | import pyperclip
import math
class Affine_Cipher:
def __init__(self):
self.SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?.'
def check_key(self, key):
keyA = key // len(self.SYMBOLS)
keyB = key % len(self.SYMBOLS)
if keyA == 1:
... | true | true |
f7026ec04664ba501e52f493107ef3d5daa3443c | 711 | py | Python | fantasyStocks/stocks/migrations/0004_auto_20151129_1625.py | ddsnowboard/FantasyStocks | ebf4cee0fdf3b66b803e0456363c470ddc700027 | [
"Apache-2.0"
] | null | null | null | fantasyStocks/stocks/migrations/0004_auto_20151129_1625.py | ddsnowboard/FantasyStocks | ebf4cee0fdf3b66b803e0456363c470ddc700027 | [
"Apache-2.0"
] | 51 | 2015-05-20T13:57:19.000Z | 2018-07-28T03:48:15.000Z | fantasyStocks/stocks/migrations/0004_auto_20151129_1625.py | ddsnowboard/FantasyStocks | ebf4cee0fdf3b66b803e0456363c470ddc700027 | [
"Apache-2.0"
] | 1 | 2016-08-07T13:41:22.000Z | 2016-08-07T13:41:22.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('stocks', '0003_auto_20151129_1623'),
]
operations = [
migrations.Alter... | 26.333333 | 110 | 0.623066 |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('stocks', '0003_auto_20151129_1623'),
]
operations = [
migrations.AlterField(
mode... | true | true |
f7026f66e04017736f515e9d6a921a954d009622 | 4,450 | py | Python | 05-Image-Descriptors/solution.py | brenov/ip-usp | 06f9f16229a4587e38a3ae89fbe3394d5f1572fd | [
"MIT"
] | null | null | null | 05-Image-Descriptors/solution.py | brenov/ip-usp | 06f9f16229a4587e38a3ae89fbe3394d5f1572fd | [
"MIT"
] | null | null | null | 05-Image-Descriptors/solution.py | brenov/ip-usp | 06f9f16229a4587e38a3ae89fbe3394d5f1572fd | [
"MIT"
] | null | null | null | # Name: Breno Maurício de Freitas Viana
# NUSP: 11920060
# Course Code: SCC5830
# Year/Semester: 2021/1
# Assignment 5: Image Descriptors
import math
import numpy as np
import imageio
from scipy import ndimage
np.seterr(divide='ignore', invalid='ignore')
LEVELS = 256
# ----- (1) Read Parameters
# Get the locatio... | 21.813725 | 80 | 0.596629 |
import math
import numpy as np
import imageio
from scipy import ndimage
np.seterr(divide='ignore', invalid='ignore')
LEVELS = 256
f = input().rstrip()
g = input().rstrip()
b = int(input())
f = imageio.imread(f)
g = imageio.imread(g)
def luminance(img):
N, M, _ = img.shape
out = np.empty(i... | true | true |
f7026fc2576bb460e599b24469ce8955bf0fcf3f | 2,929 | py | Python | tests/unit_tests/test_trunk_lock.py | miguelangel-nubla/teslajsonpy | b916ee5922c8df46414a14d5a6ee7e0a73b0af66 | [
"Apache-2.0"
] | null | null | null | tests/unit_tests/test_trunk_lock.py | miguelangel-nubla/teslajsonpy | b916ee5922c8df46414a14d5a6ee7e0a73b0af66 | [
"Apache-2.0"
] | null | null | null | tests/unit_tests/test_trunk_lock.py | miguelangel-nubla/teslajsonpy | b916ee5922c8df46414a14d5a6ee7e0a73b0af66 | [
"Apache-2.0"
] | null | null | null | """Test trunk lock."""
import pytest
from tests.tesla_mock import TeslaMock
from teslajsonpy.controller import Controller
from teslajsonpy.trunk import TrunkLock
def test_has_battery(monkeypatch):
"""Test has_battery()."""
_mock = TeslaMock(monkeypatch)
_controller = Controller(None)
_data = _moc... | 22.705426 | 52 | 0.697166 |
import pytest
from tests.tesla_mock import TeslaMock
from teslajsonpy.controller import Controller
from teslajsonpy.trunk import TrunkLock
def test_has_battery(monkeypatch):
_mock = TeslaMock(monkeypatch)
_controller = Controller(None)
_data = _mock.data_request_vehicle()
_lock = TrunkLock(_data,... | true | true |
f70270dafa2d30a1ab08fdf17d8d43b8162686e1 | 782 | py | Python | create_exe.py | hharzer/ytmusic-lib-tracker | b3564f802d0faa912b950bc64e5c84c944049a77 | [
"MIT"
] | 12 | 2020-07-21T21:32:48.000Z | 2022-02-11T01:54:20.000Z | create_exe.py | hharzer/ytmusic-lib-tracker | b3564f802d0faa912b950bc64e5c84c944049a77 | [
"MIT"
] | 11 | 2020-07-20T22:45:31.000Z | 2021-05-14T22:27:32.000Z | create_exe.py | hharzer/ytmusic-lib-tracker | b3564f802d0faa912b950bc64e5c84c944049a77 | [
"MIT"
] | 1 | 2022-02-17T23:51:38.000Z | 2022-02-17T23:51:38.000Z | import sys
from cx_Freeze import setup, Executable
setup(
name='YtMusic-Lib-Tracker',
url='https://github.com/czifumasa/ytmusic-lib-tracker',
author='Łukasz Lenart',
author_email='lukasz.lenart912@gmail.com',
version='0.1',
license='MIT',
description='Useful tools for youtube music. Exporti... | 39.1 | 134 | 0.668798 | import sys
from cx_Freeze import setup, Executable
setup(
name='YtMusic-Lib-Tracker',
url='https://github.com/czifumasa/ytmusic-lib-tracker',
author='Łukasz Lenart',
author_email='lukasz.lenart912@gmail.com',
version='0.1',
license='MIT',
description='Useful tools for youtube music. Exporti... | true | true |
f70271401af5bd2a93e5ae724aa2698ff1a032ff | 5,666 | py | Python | examples/python/TRSensors.py | mtrail/alphabot2-pi-zero | 49693208b85c8b5edcce07574bdc770c7fe0e06e | [
"MIT"
] | 1 | 2022-03-12T12:32:35.000Z | 2022-03-12T12:32:35.000Z | examples/python/TRSensors.py | mtrail/alphabot2-pi-zero | 49693208b85c8b5edcce07574bdc770c7fe0e06e | [
"MIT"
] | null | null | null | examples/python/TRSensors.py | mtrail/alphabot2-pi-zero | 49693208b85c8b5edcce07574bdc770c7fe0e06e | [
"MIT"
] | 1 | 2022-02-23T13:57:43.000Z | 2022-02-23T13:57:43.000Z | #!/usr/bin/python
# -*- coding:utf-8 -*-
import RPi.GPIO as GPIO
import time
CS = 5
Clock = 25
Address = 24
DataOut = 23
Button = 7
class TRSensor(object):
def __init__(self,numSensors = 5):
self.numSensors = numSensors
self.calibratedMin = [0] * self.numSensors
self.calibratedMax = [1023] * self.numSensors
... | 29.206186 | 74 | 0.680374 |
import RPi.GPIO as GPIO
import time
CS = 5
Clock = 25
Address = 24
DataOut = 23
Button = 7
class TRSensor(object):
def __init__(self,numSensors = 5):
self.numSensors = numSensors
self.calibratedMin = [0] * self.numSensors
self.calibratedMax = [1023] * self.numSensors
self.last_value = 0
GPIO.setmode(GPIO... | true | true |
f70271444a8a7d243bda48a6efd9534b633a6c2b | 1,169 | py | Python | server/openapi_server/controllers/text_date_annotation_controller.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | null | null | null | server/openapi_server/controllers/text_date_annotation_controller.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | 19 | 2021-07-29T03:14:38.000Z | 2022-03-01T06:03:14.000Z | server/openapi_server/controllers/text_date_annotation_controller.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | null | null | null | import connexion
from openapi_server.annotator.phi_types import PhiType
from openapi_server.get_annotations import get_annotations
from openapi_server.models.error import Error # noqa: E501
from openapi_server.models.text_date_annotation_request import \
TextDateAnnotationRequest # noqa: E501
from openapi_server.... | 35.424242 | 70 | 0.707442 | import connexion
from openapi_server.annotator.phi_types import PhiType
from openapi_server.get_annotations import get_annotations
from openapi_server.models.error import Error
from openapi_server.models.text_date_annotation_request import \
TextDateAnnotationRequest
from openapi_server.models.text_date_annotat... | true | true |
f70271e79292187bbb0f242299047f649983977f | 2,753 | py | Python | ATX/ATX/atx/adbkit/openstf/tkinput.py | cxMax/Python-practise-sample | 23fa9b2bec785b19555cb2ffef359d03a8765af4 | [
"MIT"
] | 16 | 2016-12-15T02:07:46.000Z | 2021-12-27T11:41:08.000Z | ATX/ATX/atx/adbkit/openstf/tkinput.py | cxMax/Python-practise-sample | 23fa9b2bec785b19555cb2ffef359d03a8765af4 | [
"MIT"
] | 1 | 2017-08-17T08:43:49.000Z | 2017-08-17T08:43:49.000Z | ATX/ATX/atx/adbkit/openstf/tkinput.py | cxMax/Python-practise-sample | 23fa9b2bec785b19555cb2ffef359d03a8765af4 | [
"MIT"
] | 6 | 2016-11-19T09:53:13.000Z | 2021-12-27T11:42:03.000Z | #-*- encoding: utf-8 -*-
import sys
import Tkinter as tk
import service
import keycode
if sys.platform == 'win32':
from ctypes import wintypes, byref, windll
import win32con
def handle_hotkey(root, callback):
msg = wintypes.MSG()
if windll.user32.GetMessageA(byref(msg), None, 0, 0) != 0:... | 27.53 | 102 | 0.550672 |
import sys
import Tkinter as tk
import service
import keycode
if sys.platform == 'win32':
from ctypes import wintypes, byref, windll
import win32con
def handle_hotkey(root, callback):
msg = wintypes.MSG()
if windll.user32.GetMessageA(byref(msg), None, 0, 0) != 0:
if msg.mess... | false | true |
f702724a2087738470998243ccd012825927600c | 1,370 | py | Python | fcos_core/solver/build.py | CityU-AIM-Group/SFPolypDA | 3902577cf9549a65be7ba89e2c11a7115158b531 | [
"BSD-2-Clause"
] | 5 | 2021-12-17T10:55:54.000Z | 2022-03-03T16:09:23.000Z | fcos_core/solver/build.py | CityU-AIM-Group/SFPolypDA | 3902577cf9549a65be7ba89e2c11a7115158b531 | [
"BSD-2-Clause"
] | null | null | null | fcos_core/solver/build.py | CityU-AIM-Group/SFPolypDA | 3902577cf9549a65be7ba89e2c11a7115158b531 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import logging
from .lr_scheduler import WarmupMultiStepLR
def make_optimizer(cfg, model):
logger = logging.getLogger("fcos_core.trainer")
params = []
for key, value in model.named_parameters():
if not value.requi... | 34.25 | 79 | 0.652555 |
import torch
import logging
from .lr_scheduler import WarmupMultiStepLR
def make_optimizer(cfg, model):
logger = logging.getLogger("fcos_core.trainer")
params = []
for key, value in model.named_parameters():
if not value.requires_grad:
continue
lr = cfg.SOLVER.BASE_LR
... | true | true |
f702725052b1f21007cb4ab5b3c83889e16ebbf8 | 3,172 | py | Python | src/processrunner/kitchenpatch.py | arobb/python-process-runner | e5265a052f501f533f6d0c8bbe3d70ab120b679f | [
"MIT"
] | 3 | 2019-07-16T17:32:29.000Z | 2021-11-08T05:00:26.000Z | src/processrunner/kitchenpatch.py | arobb/python-process-runner | e5265a052f501f533f6d0c8bbe3d70ab120b679f | [
"MIT"
] | null | null | null | src/processrunner/kitchenpatch.py | arobb/python-process-runner | e5265a052f501f533f6d0c8bbe3d70ab120b679f | [
"MIT"
] | 2 | 2017-07-06T23:59:12.000Z | 2019-07-16T17:32:32.000Z | # -*- coding: utf-8 -*-
"""Patched version of PyPi Kitchen's Python 3 getwriter function. Removes
extraneous newlines."""
import codecs
from kitchen.text.converters import to_bytes
def getwriter(encoding):
"""Return a :class:`codecs.StreamWriter` that resists tracing back.
:arg encoding: Encoding to use for... | 40.151899 | 78 | 0.651009 |
import codecs
from kitchen.text.converters import to_bytes
def getwriter(encoding):
class _StreamWriter(codecs.StreamWriter):
# This is not the actual class that gets used but a replacement for
# the actual class.
# :C0111: We're implementing an API from the stdlib. Just po... | true | true |
f702735ba5948c9492dc6dfb2c9ece987a5886b2 | 1,041 | py | Python | tests/parser/bug.02.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/bug.02.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/bug.02.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
colored(2,g) :- not diff_col(2,g).
colored(2,y) :- not diff_col(2,y).
colored(3,g) :- not diff_col(3,g).
colored(3,y) :- not diff_col(3,y).
diff_col(2,g) :- colored(2,y).
diff_col(3,g) :- colored(3,y).
diff_col(2,y) :- colored(2,g).
diff_col(3,y) :- colored(3,g).
no_stable :- colored(2,2), color... | 31.545455 | 56 | 0.62536 | input = """
colored(2,g) :- not diff_col(2,g).
colored(2,y) :- not diff_col(2,y).
colored(3,g) :- not diff_col(3,g).
colored(3,y) :- not diff_col(3,y).
diff_col(2,g) :- colored(2,y).
diff_col(3,g) :- colored(3,y).
diff_col(2,y) :- colored(2,g).
diff_col(3,y) :- colored(3,g).
no_stable :- colored(2,2), color... | true | true |
f70273a4f204930ac82371643af949cac1c6a644 | 3,534 | py | Python | src/rpdk/core/boto_helpers.py | wbingli/cloudformation-cli | 75a39cb7f73596f01ce04c85967dea74fe5a893d | [
"Apache-2.0"
] | 200 | 2019-12-02T03:33:37.000Z | 2022-03-31T21:50:23.000Z | src/rpdk/core/boto_helpers.py | wbingli/cloudformation-cli | 75a39cb7f73596f01ce04c85967dea74fe5a893d | [
"Apache-2.0"
] | 353 | 2019-11-26T20:20:56.000Z | 2022-03-31T00:53:05.000Z | src/rpdk/core/boto_helpers.py | wbingli/cloudformation-cli | 75a39cb7f73596f01ce04c85967dea74fe5a893d | [
"Apache-2.0"
] | 110 | 2019-11-26T21:58:16.000Z | 2022-03-26T19:02:11.000Z | import logging
from datetime import datetime
import botocore.loaders
import botocore.regions
from boto3 import Session as Boto3Session
from botocore.exceptions import ClientError
from .exceptions import CLIMisconfiguredError, DownstreamError
LOG = logging.getLogger(__name__)
BOTO_CRED_KEYS = ("aws_access_key_id", "... | 36.43299 | 88 | 0.665818 | import logging
from datetime import datetime
import botocore.loaders
import botocore.regions
from boto3 import Session as Boto3Session
from botocore.exceptions import ClientError
from .exceptions import CLIMisconfiguredError, DownstreamError
LOG = logging.getLogger(__name__)
BOTO_CRED_KEYS = ("aws_access_key_id", "... | true | true |
f702747b82118bbd64d8fc67a01e1f638cbb45dd | 26,042 | py | Python | src/transformersX/models/cutoffbert/modeling_cutoffbert.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | 2 | 2021-08-06T05:43:55.000Z | 2022-03-17T22:31:21.000Z | src/transformersX/models/cutoffbert/modeling_cutoffbert.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | src/transformersX/models/cutoffbert/modeling_cutoffbert.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 44.9 | 213 | 0.672183 |
import math
import os
import warnings
import numpy as np
from dataclasses import dataclass
from typing import Optional, Tuple
import torch
import torch.utils.checkpoint
import torch.nn.functional as F
from packaging import version
from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntro... | true | true |
f702751fc715aa75b5c77b637dfcf7dfc73f80cd | 3,001 | py | Python | litex/build/lattice/bit_to_svf.py | osterwood/litex | db20cb172dc982c5879aa8080ec7aa18de181cc5 | [
"ADSL"
] | 1,501 | 2016-04-19T18:16:21.000Z | 2022-03-31T17:46:31.000Z | litex/build/lattice/bit_to_svf.py | gregdavill/litex | 230ba5f7baff2d6fe98fbb7eecabb48aaea250e4 | [
"ADSL"
] | 1,135 | 2016-04-19T05:49:14.000Z | 2022-03-31T15:21:19.000Z | litex/build/lattice/bit_to_svf.py | gregdavill/litex | 230ba5f7baff2d6fe98fbb7eecabb48aaea250e4 | [
"ADSL"
] | 357 | 2016-04-19T05:00:24.000Z | 2022-03-31T11:28:32.000Z | #!/usr/bin/env python3
# Very basic bitstream to SVF converter
# This file is Copyright (c) 2018 David Shah <dave@ds0.me>
import sys
import textwrap
max_row_size = 100000
def bitreverse(x):
y = 0
for i in range(8):
if (x >> (7 - i)) & 1 == 1:
y |= (1 << i)
return y
def bit_to_svf(bi... | 27.53211 | 123 | 0.518494 |
import sys
import textwrap
max_row_size = 100000
def bitreverse(x):
y = 0
for i in range(8):
if (x >> (7 - i)) & 1 == 1:
y |= (1 << i)
return y
def bit_to_svf(bit, svf):
with open(bit, 'rb') as bitf:
bs = bitf.read()
idcode_cmd = bytes([0xE2, 0x00, 0x... | true | true |
f70276533f7c7bf28726c716428f2eabdcc63884 | 2,911 | py | Python | action-coffee.py | smileinnovation/coffeesnips | e2517eea83fe06008c6cc65cb351ca043b0d8a75 | [
"MIT"
] | 1 | 2019-03-21T14:44:13.000Z | 2019-03-21T14:44:13.000Z | action-coffee.py | smileinnovation/coffeesnips | e2517eea83fe06008c6cc65cb351ca043b0d8a75 | [
"MIT"
] | null | null | null | action-coffee.py | smileinnovation/coffeesnips | e2517eea83fe06008c6cc65cb351ca043b0d8a75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*-: coding utf-8 -*-
import ConfigParser
from coffeehack.coffeehack import CoffeeHack
from hermes_python.hermes import Hermes
import io
import Queue
CONFIGURATION_ENCODING_FORMAT = "utf-8"
CONFIG_INI = "config.ini"
MQTT_IP_ADDR = "localhost"
MQTT_PORT = 1883
MQTT_ADDR = "{}:{}".format(MQTT_... | 30.968085 | 126 | 0.680866 |
import ConfigParser
from coffeehack.coffeehack import CoffeeHack
from hermes_python.hermes import Hermes
import io
import Queue
CONFIGURATION_ENCODING_FORMAT = "utf-8"
CONFIG_INI = "config.ini"
MQTT_IP_ADDR = "localhost"
MQTT_PORT = 1883
MQTT_ADDR = "{}:{}".format(MQTT_IP_ADDR, str(MQTT_PORT))
class SnipsConfigPa... | false | true |
f70276f578d1b11d4f5d6137301b7fbdd736abd7 | 7,416 | py | Python | lib/babel/babel/messages/mofile.py | AniX/webapp-improved | a6bd7d4a98642ce0f708e7d53c66f70f168d02f6 | [
"Apache-2.0"
] | 15 | 2015-01-18T17:30:31.000Z | 2019-10-25T17:14:41.000Z | lib/babel/babel/messages/mofile.py | AniX/webapp-improved | a6bd7d4a98642ce0f708e7d53c66f70f168d02f6 | [
"Apache-2.0"
] | 1 | 2015-09-30T03:15:36.000Z | 2015-09-30T03:15:36.000Z | lib/babel/babel/messages/mofile.py | AniX/webapp-improved | a6bd7d4a98642ce0f708e7d53c66f70f168d02f6 | [
"Apache-2.0"
] | 2 | 2015-06-17T23:01:13.000Z | 2015-07-08T23:10:19.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | 34.333333 | 79 | 0.569444 |
"""Writing of files in the ``gettext`` MO (machine object) format.
:since: version 0.9
:see: `The Format of MO Files
<http://www.gnu.org/software/gettext/manual/gettext.html#MO-Files>`_
"""
import array
import struct
from babel.messages.catalog import Catalog, Message
__all__ = ['read_mo', 'writ... | false | true |
f702781d328a68fc3d131624d2296b76500bf539 | 2,425 | py | Python | lib/spack/spack/container/images.py | cjy7117/spack | 3582115d2af3ebd8156d742883c049e5b864eb2d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-09-02T11:55:57.000Z | 2020-09-02T11:55:57.000Z | lib/spack/spack/container/images.py | cjy7117/spack | 3582115d2af3ebd8156d742883c049e5b864eb2d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-03-23T17:08:14.000Z | 2021-04-01T17:18:22.000Z | lib/spack/spack/container/images.py | cjy7117/spack | 3582115d2af3ebd8156d742883c049e5b864eb2d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-01-10T18:54:54.000Z | 2021-07-03T22:57:16.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Manages the details on the images used in the build and the run stage."""
import json
import os.path
#: Global variable... | 32.77027 | 78 | 0.655258 |
import json
import os.path
_data = None
def data():
global _data
if not _data:
json_dir = os.path.abspath(os.path.dirname(__file__))
json_file = os.path.join(json_dir, 'images.json')
with open(json_file) as f:
_data = json.load(f)
return _data
def build_info(ima... | true | true |
f702783a2b2ea74ee55856da85cc7e661ba018dd | 1,648 | py | Python | misc/pythontools/processors/VolumeExtractChannel.py | grassofsky/modules | fe51de837fed6887228f2d3f8a455d5f4602d786 | [
"BSD-2-Clause"
] | 6 | 2019-01-31T09:38:31.000Z | 2021-05-23T18:39:13.000Z | misc/pythontools/processors/VolumeExtractChannel.py | grassofsky/modules | fe51de837fed6887228f2d3f8a455d5f4602d786 | [
"BSD-2-Clause"
] | 65 | 2019-01-28T20:17:35.000Z | 2022-02-25T08:08:03.000Z | misc/pythontools/processors/VolumeExtractChannel.py | grassofsky/modules | fe51de837fed6887228f2d3f8a455d5f4602d786 | [
"BSD-2-Clause"
] | 7 | 2019-09-15T20:06:03.000Z | 2021-11-23T14:59:37.000Z | # Name: VolumeExtractChannel
import inviwopy as ivw
import numpy as np
class VolumeExtractChannel(ivw.Processor):
def __init__(self, id, name):
ivw.Processor.__init__(self, id, name)
self.inport = ivw.data.VolumeInport("inport")
self.addInport(self.inport, owner=False)
self.outpor... | 33.632653 | 84 | 0.663835 |
import inviwopy as ivw
import numpy as np
class VolumeExtractChannel(ivw.Processor):
def __init__(self, id, name):
ivw.Processor.__init__(self, id, name)
self.inport = ivw.data.VolumeInport("inport")
self.addInport(self.inport, owner=False)
self.outport = ivw.data.VolumeOutport("o... | true | true |
f7027871d8f121fbe03c77a55263ef697ac25229 | 853 | py | Python | devscripts/PREAMBLE.py | dish59742/dulwich | d7f1331cba0ca959e8b701265b0c1547191a4726 | [
"Apache-2.0"
] | 624 | 2018-01-25T02:40:53.000Z | 2022-02-02T12:38:55.000Z | devscripts/PREAMBLE.py | dish59742/dulwich | d7f1331cba0ca959e8b701265b0c1547191a4726 | [
"Apache-2.0"
] | 358 | 2015-01-06T11:36:42.000Z | 2022-03-20T01:09:47.000Z | devscripts/PREAMBLE.py | dish59742/dulwich | d7f1331cba0ca959e8b701265b0c1547191a4726 | [
"Apache-2.0"
] | 166 | 2015-01-09T21:10:40.000Z | 2022-03-15T08:20:35.000Z | # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and/or
# modify it under the terms of either of these two licenses.
#
# Unless required by applica... | 50.176471 | 79 | 0.764361 | true | true | |
f7027877a6531c952b6a1d6afa0ea1d9608db0c1 | 879 | py | Python | twisted/web2/auth/basic.py | twonds/twisted | d6e270a465d371c3bed01bf369af497b77eb9f1e | [
"Unlicense",
"MIT"
] | 1 | 2021-01-27T19:11:21.000Z | 2021-01-27T19:11:21.000Z | twisted/web2/auth/basic.py | twonds/twisted | d6e270a465d371c3bed01bf369af497b77eb9f1e | [
"Unlicense",
"MIT"
] | null | null | null | twisted/web2/auth/basic.py | twonds/twisted | d6e270a465d371c3bed01bf369af497b77eb9f1e | [
"Unlicense",
"MIT"
] | 3 | 2017-01-04T01:24:15.000Z | 2020-06-18T16:14:56.000Z | # -*- test-case-name: twisted.web2.test.test_httpauth -*-
from twisted.cred import credentials, error
from twisted.web2.auth.interfaces import ICredentialFactory
from zope.interface import implements
class BasicCredentialFactory(object):
"""
Credential Factory for HTTP Basic Authentication
"""
imple... | 25.852941 | 59 | 0.641638 |
from twisted.cred import credentials, error
from twisted.web2.auth.interfaces import ICredentialFactory
from zope.interface import implements
class BasicCredentialFactory(object):
implements(ICredentialFactory)
scheme = 'basic'
def __init__(self, realm):
self.realm = realm
def getChallen... | true | true |
f70278cea4e7162ad9cc5b7f21e6718f080b1563 | 15,383 | py | Python | couchbase/management/buckets.py | kulabh/couchbase-python-client | eb52c53302dfa563e289f04af518d40b3921767b | [
"Apache-2.0"
] | null | null | null | couchbase/management/buckets.py | kulabh/couchbase-python-client | eb52c53302dfa563e289f04af518d40b3921767b | [
"Apache-2.0"
] | null | null | null | couchbase/management/buckets.py | kulabh/couchbase-python-client | eb52c53302dfa563e289f04af518d40b3921767b | [
"Apache-2.0"
] | null | null | null | from couchbase.management.admin import Admin
from couchbase_core.mapper import BijectiveMapping, \
StringEnum, Identity, Timedelta, Bijection, StringEnumLoose
from ..options import OptionBlockTimeOut, forward_args
from couchbase.management.generic import GenericManager
from typing import *
from couchbase_core impor... | 37.157005 | 213 | 0.595528 | from couchbase.management.admin import Admin
from couchbase_core.mapper import BijectiveMapping, \
StringEnum, Identity, Timedelta, Bijection, StringEnumLoose
from ..options import OptionBlockTimeOut, forward_args
from couchbase.management.generic import GenericManager
from typing import *
from couchbase_core impor... | true | true |
f70279cf9a6103ce7baf015e8ef13fb314e9824c | 5,629 | py | Python | core/eolearn/core/eotask.py | dreampedia20/eo-learn | f4994a1d6e910ba5d6ad877726ac2367048a44a1 | [
"MIT"
] | 1 | 2019-04-08T02:26:40.000Z | 2019-04-08T02:26:40.000Z | core/eolearn/core/eotask.py | dreampedia20/eo-learn | f4994a1d6e910ba5d6ad877726ac2367048a44a1 | [
"MIT"
] | 1 | 2019-11-27T09:44:40.000Z | 2019-11-27T09:44:40.000Z | core/eolearn/core/eotask.py | dreampedia20/eo-learn | f4994a1d6e910ba5d6ad877726ac2367048a44a1 | [
"MIT"
] | 1 | 2019-01-30T09:08:23.000Z | 2019-01-30T09:08:23.000Z | """
This module implements the core class hierarchy for implementing EO tasks. An EO task is any class the inherits
from the abstract EOTask class. Each EO task has to implement the execute method; invoking __call__ on a EO task
instance invokes the execute method. EO tasks are meant primarily to operate on EO patches ... | 39.363636 | 119 | 0.696927 |
import sys
import logging
import datetime
import inspect
from collections import OrderedDict
from abc import ABC, abstractmethod
import attr
from .utilities import FeatureParser
LOGGER = logging.getLogger(__name__)
class EOTask(ABC):
def __new__(cls, *args, **kwargs):
self = super().__new__(cls)
... | true | true |
f7027ac26fa896bc6deaf3d010bd7334ab987560 | 1,875 | py | Python | src/kol/request/RespondToTradeRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 19 | 2015-02-16T08:30:49.000Z | 2020-05-01T06:06:33.000Z | src/kol/request/RespondToTradeRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 5 | 2015-01-13T23:01:54.000Z | 2016-11-30T15:23:43.000Z | src/kol/request/RespondToTradeRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 19 | 2015-05-28T09:36:19.000Z | 2022-03-15T23:19:29.000Z | from kol.request.GenericRequest import GenericRequest
from kol.manager import PatternManager
import kol.Error as Error
from kol.util import Report
class RespondToTradeRequest(GenericRequest):
def __init__(self, session, tradeid, items=None, meat=0, message=""):
super(RespondToTradeRequest, self).__sup... | 50.675676 | 134 | 0.679467 | from kol.request.GenericRequest import GenericRequest
from kol.manager import PatternManager
import kol.Error as Error
from kol.util import Report
class RespondToTradeRequest(GenericRequest):
def __init__(self, session, tradeid, items=None, meat=0, message=""):
super(RespondToTradeRequest, self).__sup... | true | true |
f7027b3f06db28c8a66a60541055054a89ae5668 | 6,821 | py | Python | env/lib/python3.8/site-packages/plotly/graph_objs/volume/_caps.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/volume/_caps.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/volume/_caps.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Caps(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "volume"
_path_str = "volume.caps"
_valid_props = {"x", "y", "z"}
# x
# -
@propert... | 32.174528 | 82 | 0.511215 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Caps(_BaseTraceHierarchyType):
_parent_path_str = "volume"
_path_str = "volume.caps"
_valid_props = {"x", "y", "z"}
@property
def x(self):
return self["x"]
... | true | true |
f7027bdbfcc7842b76bfb89ba52eca7263568712 | 1,768 | py | Python | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeCdnDeletedDomainsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeCdnDeletedDomainsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeCdnDeletedDomainsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.36 | 78 | 0.765271 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkcdn.endpoint import endpoint_data
class DescribeCdnDeletedDomainsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Cdn', '2018-05-10', 'DescribeCdnDeletedDomains')
self.set_method('POST')
if hasattr(self, "endpoint... | true | true |
f7027c1d5e1f120d923085fee565d27c599bc152 | 3,672 | py | Python | redash/query_runner/hive_ds.py | solutionrooms/testredash | 8decda0b55defd24fa627b24e7c5fcd377062617 | [
"BSD-2-Clause"
] | null | null | null | redash/query_runner/hive_ds.py | solutionrooms/testredash | 8decda0b55defd24fa627b24e7c5fcd377062617 | [
"BSD-2-Clause"
] | null | null | null | redash/query_runner/hive_ds.py | solutionrooms/testredash | 8decda0b55defd24fa627b24e7c5fcd377062617 | [
"BSD-2-Clause"
] | 1 | 2021-06-03T00:34:29.000Z | 2021-06-03T00:34:29.000Z | import json
import logging
import sys
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from pyhive import hive
enabled = True
except ImportError, e:
enabled = False
COLUMN_NAME = 0
COLUMN_TYPE = 1
types_map = {
'BIGINT': TYPE_INTEGER,
... | 27.609023 | 152 | 0.536492 | import json
import logging
import sys
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from pyhive import hive
enabled = True
except ImportError, e:
enabled = False
COLUMN_NAME = 0
COLUMN_TYPE = 1
types_map = {
'BIGINT': TYPE_INTEGER,
... | false | true |
f7027cc40744bece58196657f7f41d0dc93f9bce | 346 | py | Python | week1/1.05 classes/step09 buffer.py | TheNovel/stepik-python-fundamentals-and-application | 4bf6838cfdb2323da2d8d52cfe393d61a4bb70cc | [
"MIT"
] | null | null | null | week1/1.05 classes/step09 buffer.py | TheNovel/stepik-python-fundamentals-and-application | 4bf6838cfdb2323da2d8d52cfe393d61a4bb70cc | [
"MIT"
] | null | null | null | week1/1.05 classes/step09 buffer.py | TheNovel/stepik-python-fundamentals-and-application | 4bf6838cfdb2323da2d8d52cfe393d61a4bb70cc | [
"MIT"
] | null | null | null | class Buffer:
def __init__(self):
self.lst = list()
def add(self, *a):
for value in a:
self.lst.append(value)
while len(self.lst) >= 5:
s = 0
for i in range(5):
s += self.lst.pop(0)
print(s)
def get_current_part(self)... | 20.352941 | 36 | 0.465318 | class Buffer:
def __init__(self):
self.lst = list()
def add(self, *a):
for value in a:
self.lst.append(value)
while len(self.lst) >= 5:
s = 0
for i in range(5):
s += self.lst.pop(0)
print(s)
def get_current_part(self)... | true | true |
f7027d1166fe593295d878cd3bf04e354cc16d40 | 2,262 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/GeometryObject.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/GeometryObject.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/GeometryObject.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class GeometryObject(APIObject, IDisposable):
""" The common base class for all geometric primitives. """
def Dispose(self):
""" Dispose(self: APIObject,A_0: bool) """
pass
def Equals(self, obj):
"""
Equals(self: GeometryObject,obj: object) -> bool
Determines... | 22.39604 | 221 | 0.598585 | class GeometryObject(APIObject, IDisposable):
def Dispose(self):
pass
def Equals(self, obj):
pass
def GetHashCode(self):
pass
def ReleaseManagedResources(self, *args):
pass
def ReleaseUnmanagedResources(self, *args):
pass
def __enter... | true | true |
f7027dcd4d2737c0d58aa41af45dd91d95328e07 | 1,607 | py | Python | handson2_q_qi.py | blacktanktop/techcircle_openai_handson | 54ae9de6c488cbbff9bda1be11fd0ecd1e681049 | [
"MIT"
] | 1 | 2021-09-15T09:49:49.000Z | 2021-09-15T09:49:49.000Z | handson2_q_qi.py | blacktanktop/techcircle_openai_handson | 54ae9de6c488cbbff9bda1be11fd0ecd1e681049 | [
"MIT"
] | null | null | null | handson2_q_qi.py | blacktanktop/techcircle_openai_handson | 54ae9de6c488cbbff9bda1be11fd0ecd1e681049 | [
"MIT"
] | null | null | null | import os
import math
import argparse
import gym
from agents.q_agent import Q, Agent, Trainer
RECORD_PATH = os.path.join(os.path.dirname(__file__), "./upload")
def main(episodes, render, monitor):
env = gym.make("CartPole-v0")
q = Q(
env.action_space.n,
env.observation_space,
bin... | 29.218182 | 117 | 0.634723 | import os
import math
import argparse
import gym
from agents.q_agent import Q, Agent, Trainer
RECORD_PATH = os.path.join(os.path.dirname(__file__), "./upload")
def main(episodes, render, monitor):
env = gym.make("CartPole-v0")
q = Q(
env.action_space.n,
env.observation_space,
bin... | true | true |
f7027dff8780b6911154978d2292dd01768881d2 | 6,554 | py | Python | data_related/data_augmentation/signal_augment.py | dertilo/speech-recognition | 32dfd0a05480ecb3a4ea3eb9e28628da976e7065 | [
"MIT"
] | 1 | 2020-06-30T20:48:04.000Z | 2020-06-30T20:48:04.000Z | data_related/data_augmentation/signal_augment.py | dertilo/speech-recognition | 32dfd0a05480ecb3a4ea3eb9e28628da976e7065 | [
"MIT"
] | null | null | null | data_related/data_augmentation/signal_augment.py | dertilo/speech-recognition | 32dfd0a05480ecb3a4ea3eb9e28628da976e7065 | [
"MIT"
] | null | null | null | import os
import subprocess
import numpy as np
from tqdm import tqdm
from typing import Dict
MAX_FREQ = 7999
def to_str(v):
if isinstance(v, tuple):
s = " ".join(str(x) for x in v)
elif isinstance(v, float) or isinstance(v, int):
s = str(v)
else:
assert False
return s
def ... | 34.677249 | 188 | 0.663412 | import os
import subprocess
import numpy as np
from tqdm import tqdm
from typing import Dict
MAX_FREQ = 7999
def to_str(v):
if isinstance(v, tuple):
s = " ".join(str(x) for x in v)
elif isinstance(v, float) or isinstance(v, int):
s = str(v)
else:
assert False
return s
def ... | true | true |
f702808448a1116245a85dccb72d2041a69ba522 | 1,552 | py | Python | appengine/swarming/swarming_bot/logging_utils_test.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/swarming/swarming_bot/logging_utils_test.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/swarming/swarming_bot/logging_utils_test.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | 1 | 2021-12-06T03:37:36.000Z | 2021-12-06T03:37:36.000Z | #!/usr/bin/env python
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import logging
import os
import sys
import tempfile
import shutil
import unittest
import re
# Import this first before manipulatin... | 28.218182 | 78 | 0.706186 |
import logging
import os
import sys
import tempfile
import shutil
import unittest
import re
import logging_utils
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR)
import test_env
test_env.setup_test_env()
from depot_tools import auto_stub
_LOG_HEADER = r'^%s... | true | true |
f70281b724d555ee8d8ebda46c531d9ccbec388d | 615 | py | Python | frontends/pytorch/test/acap_regression/test_jit_add2.py | marbre/mlir-npcomp | 30adf9e6b0c1e94db38050a9e143f20a5a461d17 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/test/acap_regression/test_jit_add2.py | marbre/mlir-npcomp | 30adf9e6b0c1e94db38050a9e143f20a5a461d17 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/test/acap_regression/test_jit_add2.py | marbre/mlir-npcomp | 30adf9e6b0c1e94db38050a9e143f20a5a461d17 | [
"Apache-2.0"
] | null | null | null | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See frontends/pytorch/LICENSE for license information.
import torch
import npcomp.frontends.pytorch as torch_mlir
import npcomp.frontends.pytorch.test as test
# RUN: %PYTHON %s | FileCheck %s
dev = torch_mlir.mlir_device()
t0 = torch.randn((4,4... | 21.964286 | 56 | 0.691057 |
import torch
import npcomp.frontends.pytorch as torch_mlir
import npcomp.frontends.pytorch.test as test
dev = torch_mlir.mlir_device()
t0 = torch.randn((4,4), device=dev)
t1 = torch.randn((4,4), device=dev)
t2 = t0 + t1
t0_cpu = t0.to('cpu')
t1_cpu = t1.to('cpu')
t2_cpu = t2.to('cpu')
print (t0_cpu, " +\n"... | true | true |
f7028206768d52c2f42babdea8234119adef0637 | 2,800 | py | Python | tests/st/ops/gpu/test_tanh_grad_grad_op.py | GuoSuiming/mindspore | 48afc4cfa53d970c0b20eedfb46e039db2a133d5 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/ops/gpu/test_tanh_grad_grad_op.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/ops/gpu/test_tanh_grad_grad_op.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.55814 | 78 | 0.706429 |
import numpy as np
import pytest
import mindspore.context as context
import mindspore.nn as nn
from mindspore import Tensor
from mindspore.ops.operations import _grad_ops as G
from mindspore.ops import composite as C
context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
class NetTanhGrad(n... | true | true |
f702829a908f8235e9093bc97a9d0edce1997f1f | 379 | py | Python | pokemon/permissions.py | pessman/pokemon_utils | cbe06ebe323cb38a35846274d812bdbe8d0ae8ca | [
"MIT"
] | 1 | 2019-03-11T04:12:50.000Z | 2019-03-11T04:12:50.000Z | pokemon/permissions.py | pessman/pokemon_utils | cbe06ebe323cb38a35846274d812bdbe8d0ae8ca | [
"MIT"
] | null | null | null | pokemon/permissions.py | pessman/pokemon_utils | cbe06ebe323cb38a35846274d812bdbe8d0ae8ca | [
"MIT"
] | 2 | 2019-03-13T03:17:29.000Z | 2019-04-04T20:06:50.000Z | from rest_framework.permissions import SAFE_METHODS, BasePermission
class IsAdminOrReadOnly(BasePermission):
"""
The request is authenticated as an Admin user or is Read Only
"""
def has_permission(self, request, view):
return bool(
request.method in SAFE_METHODS or
re... | 25.266667 | 67 | 0.662269 | from rest_framework.permissions import SAFE_METHODS, BasePermission
class IsAdminOrReadOnly(BasePermission):
def has_permission(self, request, view):
return bool(
request.method in SAFE_METHODS or
request.user and
request.user.is_staff
)
| true | true |
f702830899c6877f2ce2b468190877e2a231b279 | 1,153 | py | Python | stubborn.py | CrossRef/unreliable | 874b58c0a0b4519bd679b8ad44d029427571653e | [
"MIT"
] | null | null | null | stubborn.py | CrossRef/unreliable | 874b58c0a0b4519bd679b8ad44d029427571653e | [
"MIT"
] | null | null | null | stubborn.py | CrossRef/unreliable | 874b58c0a0b4519bd679b8ad44d029427571653e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import io
import sys
from urllib.request import urlopen
import urllib.error
import time
import datetime
from retrying import retry
URL = "http://unreliable.labs.crossref.org/error"
ONE_SECOND=1000
ONE_HOUR=((ONE_SECOND*60)*60)
ONE_DAY=(ONE_HOUR*24)
@retry(wait_exponential_mul... | 23.06 | 86 | 0.635733 |
import argparse
import io
import sys
from urllib.request import urlopen
import urllib.error
import time
import datetime
from retrying import retry
URL = "http://unreliable.labs.crossref.org/error"
ONE_SECOND=1000
ONE_HOUR=((ONE_SECOND*60)*60)
ONE_DAY=(ONE_HOUR*24)
@retry(wait_exponential_multiplier=1000,wait_expo... | true | true |
f70283cd26941725dea8584beb879d0997ec7bae | 3,775 | py | Python | lianxi/day08.py | guling116/python | a33f57b6c4e52b87ad32e0a8ba3742f4a7168669 | [
"Apache-2.0"
] | null | null | null | lianxi/day08.py | guling116/python | a33f57b6c4e52b87ad32e0a8ba3742f4a7168669 | [
"Apache-2.0"
] | null | null | null | lianxi/day08.py | guling116/python | a33f57b6c4e52b87ad32e0a8ba3742f4a7168669 | [
"Apache-2.0"
] | null | null | null | # url="http://www.baidu.com/?page=/wd=xiaopangzi"
'''
url1="www.baidu.com/?page="
url2="wd=xiaopangzi"
while(1):
for i in range(1,100):
print(url1,i,url2)
i=i+1
break
for i in range(100):
part1=www.baidu.com/?page=
res = part1 +
'''
'''
A1=[1,1,1,1,1,2,2,2,2,2,3]
a1=[]
for i i... | 16.629956 | 121 | 0.526093 |
'''
url1="www.baidu.com/?page="
url2="wd=xiaopangzi"
while(1):
for i in range(1,100):
print(url1,i,url2)
i=i+1
break
for i in range(100):
part1=www.baidu.com/?page=
res = part1 +
'''
'''
A1=[1,1,1,1,1,2,2,2,2,2,3]
a1=[]
for i in A1:
if i not in a1:
a1.append(i)
pr... | false | true |
f702841d0fb9dd541a4a2ee7271135da879a7cdc | 988 | py | Python | isi_sdk_8_2_1/test/test_auth_id_ntoken_privilege_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_1/test/test_auth_id_ntoken_privilege_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_1/test/test_auth_id_ntoken_privilege_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 8
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_1
from i... | 24.097561 | 110 | 0.730769 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_1
from isi_sdk_8_2_1.models.auth_id_ntoken_privilege_item import AuthIdNtokenPrivilegeItem
from isi_sdk_8_2_1.rest import ApiException
class TestAuthIdNtokenPrivilegeItem(unittest.TestCase):
def setUp(self):
pass
def t... | true | true |
f702853d97d6b0edd707b18d0e9385339233e089 | 97,990 | py | Python | databricks/koalas/frame.py | abishekganesh72/koalas | 40c2e209384d078ee75d08c7681d2e6a276ab834 | [
"Apache-2.0"
] | null | null | null | databricks/koalas/frame.py | abishekganesh72/koalas | 40c2e209384d078ee75d08c7681d2e6a276ab834 | [
"Apache-2.0"
] | null | null | null | databricks/koalas/frame.py | abishekganesh72/koalas | 40c2e209384d078ee75d08c7681d2e6a276ab834 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2019 Databricks, 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 agreed to i... | 36.824502 | 100 | 0.535493 |
import re
import warnings
from functools import partial, reduce
from typing import Any, Optional, List, Tuple, Union
import numpy as np
import pandas as pd
from pandas.api.types import is_datetime64_dtype, is_datetime64tz_dtype, is_list_like, \
is_dict_like
from pyspark import sql as spark
from pys... | true | true |
f70285bf0c127bd9449019b899b0766290314975 | 11,080 | py | Python | CodeGenerator.py | vdominguez1993/PlantUMLCodeGenerator | 61bf3f4f11962c041f1d7ee5cdc3889b473d278b | [
"Apache-2.0"
] | null | null | null | CodeGenerator.py | vdominguez1993/PlantUMLCodeGenerator | 61bf3f4f11962c041f1d7ee5cdc3889b473d278b | [
"Apache-2.0"
] | null | null | null | CodeGenerator.py | vdominguez1993/PlantUMLCodeGenerator | 61bf3f4f11962c041f1d7ee5cdc3889b473d278b | [
"Apache-2.0"
] | null | null | null | import argparse, subprocess, os, re
from jinja2 import Environment, FileSystemLoader
def GetBaseName(full_path):
return os.path.basename(full_path)
class PlantUMLCodeGeneration():
class StateType():
def __init__(self):
self.entry = None
self.during = None
self.exit... | 43.28125 | 117 | 0.568231 | import argparse, subprocess, os, re
from jinja2 import Environment, FileSystemLoader
def GetBaseName(full_path):
return os.path.basename(full_path)
class PlantUMLCodeGeneration():
class StateType():
def __init__(self):
self.entry = None
self.during = None
self.exit... | true | true |
f70288269e894757296237fedfbe8a7b9a17cae6 | 889 | py | Python | doc/examples/transform/plot_pyramid.py | paalge/scikit-image | f3c4b88b0610242b033449fd38c1118475f96a73 | [
"BSD-3-Clause"
] | null | null | null | doc/examples/transform/plot_pyramid.py | paalge/scikit-image | f3c4b88b0610242b033449fd38c1118475f96a73 | [
"BSD-3-Clause"
] | 2 | 2016-01-08T18:30:49.000Z | 2016-07-21T07:55:29.000Z | doc/examples/transform/plot_pyramid.py | paalge/scikit-image | f3c4b88b0610242b033449fd38c1118475f96a73 | [
"BSD-3-Clause"
] | 2 | 2017-05-09T13:33:37.000Z | 2018-12-23T10:57:18.000Z | """
====================
Build image pyramids
====================
The ``pyramid_gaussian`` function takes an image and yields successive images
shrunk by a constant scale factor. Image pyramids are often used, e.g., to
implement algorithms for denoising, texture discrimination, and scale-
invariant detection.
"""
im... | 24.694444 | 77 | 0.704162 | import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage.transform import pyramid_gaussian
image = data.astronaut()
rows, cols, dim = image.shape
pyramid = tuple(pyramid_gaussian(image, downscale=2))
composite_image = np.zeros((rows, cols + cols / 2, 3), dtype=np.double)
composite_i... | true | true |
f70289491eddd352d457d19b402af7a9836267ff | 4,623 | py | Python | thrift/lib/py3/test/interactions/interaction_test.py | sakibguy/fbthrift | 8123a9192519072e119ac9817c6b59a35b98b81c | [
"Apache-2.0"
] | 2,112 | 2015-01-02T11:34:27.000Z | 2022-03-31T16:30:42.000Z | thrift/lib/py3/test/interactions/interaction_test.py | sakibguy/fbthrift | 8123a9192519072e119ac9817c6b59a35b98b81c | [
"Apache-2.0"
] | 372 | 2015-01-05T10:40:09.000Z | 2022-03-31T20:45:11.000Z | thrift/lib/py3/test/interactions/interaction_test.py | sakibguy/fbthrift | 8123a9192519072e119ac9817c6b59a35b98b81c | [
"Apache-2.0"
] | 582 | 2015-01-03T01:51:56.000Z | 2022-03-31T02:01:09.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... | 35.837209 | 74 | 0.589011 |
import asyncio
import unittest
from blank_interaction.services import BlankServiceInterface
from interaction.clients import Calculator
from interaction.types import Point
from thrift.py3.client import get_client, ClientType
from .run_interaction import run_interaction
class InteractionTest(unittest.Te... | true | true |
f702895d53bfab5f192f3b620f6222bfa4a5bb35 | 18,264 | py | Python | server.py | jonasswa/Guess-My-Search | 2b36183a66bf55b163fc647117ee1b9c8f9cd543 | [
"MIT"
] | 1 | 2017-12-18T14:00:53.000Z | 2017-12-18T14:00:53.000Z | server.py | soldox/Guess-My-Search | 2b36183a66bf55b163fc647117ee1b9c8f9cd543 | [
"MIT"
] | null | null | null | server.py | soldox/Guess-My-Search | 2b36183a66bf55b163fc647117ee1b9c8f9cd543 | [
"MIT"
] | null | null | null | from flask_socketio import SocketIO
from flask import Flask, make_response, request, session
from flask import render_template, session, url_for, redirect
from threading import RLock
from threading import Thread
from utilslib import list_to_HTML_table
from time import sleep
from ClientStorage import Clients, User
fr... | 36.166337 | 143 | 0.636498 | from flask_socketio import SocketIO
from flask import Flask, make_response, request, session
from flask import render_template, session, url_for, redirect
from threading import RLock
from threading import Thread
from utilslib import list_to_HTML_table
from time import sleep
from ClientStorage import Clients, User
fr... | true | true |
f7028a63f253b20a569bb4743e35afa609f63526 | 6,332 | py | Python | deeplabv3/datahandler.py | RajArPatra/Improvement-semantic-segmentation-using-clustring-and-class-voating | 1e4b5fa5ccc462d88a68f3c88c8af31fa3f14b8b | [
"MIT"
] | null | null | null | deeplabv3/datahandler.py | RajArPatra/Improvement-semantic-segmentation-using-clustring-and-class-voating | 1e4b5fa5ccc462d88a68f3c88c8af31fa3f14b8b | [
"MIT"
] | null | null | null | deeplabv3/datahandler.py | RajArPatra/Improvement-semantic-segmentation-using-clustring-and-class-voating | 1e4b5fa5ccc462d88a68f3c88c8af31fa3f14b8b | [
"MIT"
] | 3 | 2020-04-19T06:46:25.000Z | 2020-04-24T07:48:15.000Z | from torch.utils.data import Dataset, DataLoader
import glob
import os
import numpy as np
import cv2
import torch
from torchvision import transforms, utils
from skimage.transform import resize
class SegDataset(Dataset):
"""Segmentation Dataset"""
def __init__(self, root_dir, imageFolder, maskFolder, transfor... | 39.08642 | 162 | 0.58844 | from torch.utils.data import Dataset, DataLoader
import glob
import os
import numpy as np
import cv2
import torch
from torchvision import transforms, utils
from skimage.transform import resize
class SegDataset(Dataset):
def __init__(self, root_dir, imageFolder, maskFolder, transform=None, seed=None, fraction=Non... | true | true |
f7028b5259524a51a3a82357b0d2679eaf4c8043 | 4,277 | py | Python | tests/utils/test_polydata_utils.py | UCL/scikit-surgeryvtk | 7d88da36b509158a5385e15fb11f69923fa13fa5 | [
"BSD-3-Clause"
] | 9 | 2020-05-29T12:03:12.000Z | 2021-06-17T07:14:16.000Z | tests/utils/test_polydata_utils.py | NMontanaBrown/scikit-surgeryvtk | 85921775b72f40cdf4ee606ab83531758b0345bb | [
"BSD-3-Clause"
] | 164 | 2020-05-20T07:57:47.000Z | 2021-12-08T09:43:26.000Z | tests/utils/test_polydata_utils.py | SciKit-Surgery/scikit-surgeryvtk | 75a2cb15f976348b844fea165bddf187efa722f0 | [
"BSD-3-Clause"
] | 2 | 2020-10-16T13:50:34.000Z | 2021-11-05T13:08:08.000Z | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import pytest
import vtk
import numpy as np
import sksurgeryvtk.utils.polydata_utils as pdu
import sksurgeryvtk.models.vtk_surface_model as vbs
def test_overlapping_bounds():
radius_0=10.0
radius_1=7.0
centre_1=5.0
radius_2=4.0
centre_2=15.0
rad... | 34.216 | 105 | 0.715455 |
import pytest
import vtk
import numpy as np
import sksurgeryvtk.utils.polydata_utils as pdu
import sksurgeryvtk.models.vtk_surface_model as vbs
def test_overlapping_bounds():
radius_0=10.0
radius_1=7.0
centre_1=5.0
radius_2=4.0
centre_2=15.0
radius_3=4.0
centre_3=0.0
sphere_0 = vtk.... | true | true |
f7028bb4aee8f166e5448402b874d8240dfcf7c0 | 3,540 | py | Python | main.py | wellbs32/random-password-generator | 65b75113cd84250b06892e48ebcc21bc54a5bdb5 | [
"MIT"
] | null | null | null | main.py | wellbs32/random-password-generator | 65b75113cd84250b06892e48ebcc21bc54a5bdb5 | [
"MIT"
] | null | null | null | main.py | wellbs32/random-password-generator | 65b75113cd84250b06892e48ebcc21bc54a5bdb5 | [
"MIT"
] | null | null | null | import string
import random
# --- Defining Variables ---
LOWER_ALPHABET = list(string.ascii_lowercase)
DIGITS = list(string.digits)
UPPER_ALPHABET = list(string.ascii_uppercase)
SYMBOLS = list(string.punctuation)
SYMBOLS_DELETE = ['"', "'", "(", ")", ",", ".", ":", ";", "[", "]", "|", "`", "{", "}"]
for x in SYMBOLS... | 29.5 | 175 | 0.549718 | import string
import random
LOWER_ALPHABET = list(string.ascii_lowercase)
DIGITS = list(string.digits)
UPPER_ALPHABET = list(string.ascii_uppercase)
SYMBOLS = list(string.punctuation)
SYMBOLS_DELETE = ['"', "'", "(", ")", ",", ".", ":", ";", "[", "]", "|", "`", "{", "}"]
for x in SYMBOLS_DELETE:
SYMBOLS.remove(x)... | true | true |
f7028bdad6f952543bfd61915c943c74a46738f4 | 7,307 | py | Python | examples/gilded_rose.py | Glinrens-corner/ruleta | e49f5701170d97366a47378229ade449ed729402 | [
"MIT"
] | null | null | null | examples/gilded_rose.py | Glinrens-corner/ruleta | e49f5701170d97366a47378229ade449ed729402 | [
"MIT"
] | null | null | null | examples/gilded_rose.py | Glinrens-corner/ruleta | e49f5701170d97366a47378229ade449ed729402 | [
"MIT"
] | null | null | null | """
An implementation for the gilded rose kata as I understand it.
https://github.com/NotMyself/GildedRose
"""
from collections import namedtuple
import unittest as ut
from ruleta import Rule, ActionSet
from ruleta.combinators import ALSO
import re
ItemRecord = namedtuple("ItemRecord",["name", "quality", "quality... | 34.961722 | 226 | 0.690023 | """
An implementation for the gilded rose kata as I understand it.
https://github.com/NotMyself/GildedRose
"""
from collections import namedtuple
import unittest as ut
from ruleta import Rule, ActionSet
from ruleta.combinators import ALSO
import re
ItemRecord = namedtuple("ItemRecord",["name", "quality", "quality... | false | true |
f7028c6e33cf3e1d7a434c522068735baf06981a | 7,316 | py | Python | melange/drivers/aws/aws_driver.py | Rydra/melange | 5de67dd4eab506353ea05f30df6d250997e3c97f | [
"MIT"
] | 7 | 2017-11-22T15:52:46.000Z | 2022-01-17T23:01:24.000Z | melange/drivers/aws/aws_driver.py | Rydra/melange | 5de67dd4eab506353ea05f30df6d250997e3c97f | [
"MIT"
] | 1 | 2017-11-30T16:13:52.000Z | 2019-02-12T14:51:54.000Z | melange/drivers/aws/aws_driver.py | Rydra/melange | 5de67dd4eab506353ea05f30df6d250997e3c97f | [
"MIT"
] | 3 | 2017-11-15T16:34:20.000Z | 2022-01-24T11:05:54.000Z | # type: ignore
import json
import uuid
from json import JSONDecodeError
from typing import Tuple, Dict, List
import boto3
from melange.drivers.interfaces import Queue, Topic, MessagingDriver, Message
class AWSDriver(MessagingDriver):
def __init__(self, **kwargs):
super().__init__()
self.max_num... | 32.954955 | 118 | 0.562876 |
import json
import uuid
from json import JSONDecodeError
from typing import Tuple, Dict, List
import boto3
from melange.drivers.interfaces import Queue, Topic, MessagingDriver, Message
class AWSDriver(MessagingDriver):
def __init__(self, **kwargs):
super().__init__()
self.max_number_of_message... | true | true |
f7028c9a3da8e2b02799a577a83179212a411809 | 3,411 | py | Python | imsnpars/nparser/graph/builder.py | zentrum-lexikographie/IMSnPars | 8d19aa1fc76b0277c861cec774ad81f62cd4e244 | [
"Apache-2.0"
] | 2 | 2020-09-28T09:30:22.000Z | 2020-11-28T13:36:13.000Z | imsnpars/nparser/graph/builder.py | zentrum-lexikographie/IMSnPars | 8d19aa1fc76b0277c861cec774ad81f62cd4e244 | [
"Apache-2.0"
] | 1 | 2020-08-13T14:11:45.000Z | 2020-08-13T14:11:45.000Z | imsnpars/nparser/graph/builder.py | zentrum-lexikographie/IMSnPars | 8d19aa1fc76b0277c861cec774ad81f62cd4e244 | [
"Apache-2.0"
] | 1 | 2020-11-28T14:32:56.000Z | 2020-11-28T14:32:56.000Z | '''
Created on 23.08.2017
@author: falensaa
'''
import logging
import sys
import imsnpars.nparser.features
import imsnpars.nparser.network
import imsnpars.nparser.graph.features as gfeatures
from imsnpars.nparser.graph import task, decoder
from imsnpars.nparser.graph.mst import cle
from imsnpars.nparser.labels impor... | 37.076087 | 124 | 0.619173 |
import logging
import sys
import imsnpars.nparser.features
import imsnpars.nparser.network
import imsnpars.nparser.graph.features as gfeatures
from imsnpars.nparser.graph import task, decoder
from imsnpars.nparser.graph.mst import cle
from imsnpars.nparser.labels import task as ltask
def buildMSTDecoder(opts, featBu... | true | true |
f7028cc13315d37bcb502995874600452971aa1d | 6,903 | py | Python | kubernetes/client/models/v1beta1_event_list.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | 1 | 2022-02-07T21:57:20.000Z | 2022-02-07T21:57:20.000Z | kubernetes/client/models/v1beta1_event_list.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | 1 | 2022-03-01T03:37:57.000Z | 2022-03-01T03:37:57.000Z | kubernetes/client/models/v1beta1_event_list.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.22
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 33.509709 | 312 | 0.623932 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1beta1EventList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[V1beta1Event]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
... | true | true |
f7028d4fe063a3a562eecc15b66515f81b9f692f | 5,130 | py | Python | bout.py | vishalbelsare/bout | 4731566d2cc2e3cd6f2c4f9cef615a39a66d4516 | [
"MIT"
] | null | null | null | bout.py | vishalbelsare/bout | 4731566d2cc2e3cd6f2c4f9cef615a39a66d4516 | [
"MIT"
] | null | null | null | bout.py | vishalbelsare/bout | 4731566d2cc2e3cd6f2c4f9cef615a39a66d4516 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Bout (read bank-out) extracts transactions from pdf bank statements.
_ _
(_) (_)
(_) _ _ _ _ _ _ _ _ _ (_) _ _
(_)(_)(_)(_)_ _ (_)(_)(_) _ (_) (_)(_)(_)(... | 31.666667 | 114 | 0.554386 |
import io
import logging
import click
import csv
from collections import namedtuple
from datetime import datetime
logger = logging.getLogger("bout")
profiles = {}
Transaction = namedtuple("Transaction",
["id", "date", "payee", "memo", "amount"])
InvalidTransaction = namedtuple("InvalidTran... | true | true |
f7028e106fb1937ccea8ec628aca73fc739aadb5 | 1,355 | py | Python | colorizer.py | official71/ezmemo | 46348885053372efd62fc3ab1c3b39e31681e053 | [
"MIT"
] | null | null | null | colorizer.py | official71/ezmemo | 46348885053372efd62fc3ab1c3b39e31681e053 | [
"MIT"
] | 11 | 2018-03-29T23:52:38.000Z | 2018-04-26T17:44:43.000Z | colorizer.py | official71/ezmemo | 46348885053372efd62fc3ab1c3b39e31681e053 | [
"MIT"
] | null | null | null | from colored import *
import staticconf
"""
You might find the colored documentation very useful:
https://pypi.python.org/pypi/colored
"""
ENABLE_COLORIZER = staticconf.read_string('enable_colorizer', default='false').lower() == 'true'
def colorizer_enabled(function):
"""do not colorize if it's not enabled"""
... | 22.583333 | 96 | 0.678229 | from colored import *
import staticconf
ENABLE_COLORIZER = staticconf.read_string('enable_colorizer', default='false').lower() == 'true'
def colorizer_enabled(function):
def wrapper(*args):
if ENABLE_COLORIZER:
return function(*args)
elif args:
return args[0]
else... | true | true |
f7028f059677a83cf6bbecfd7df23260f585b48f | 785 | py | Python | sdk/media/azure-mgmt-media/azure/mgmt/media/aio/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/media/azure-mgmt-media/azure/mgmt/media/aio/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/media/azure-mgmt-media/azure/mgmt/media/aio/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.0625 | 114 | 0.636943 |
from ._azure_media_services import AzureMediaServices
__all__ = ['AzureMediaServices']
from ._patch import patch_sdk
patch_sdk()
| true | true |
f7028f58d5d64339a8ee0336fccba8b58dc44b75 | 33,617 | py | Python | tests/unit/participants/test_views.py | dubesar/EvalAI | a38fbc8ff8c58f26fb2e61ef67e13055fb0c1f29 | [
"BSD-3-Clause"
] | 1 | 2019-11-08T05:23:11.000Z | 2019-11-08T05:23:11.000Z | tests/unit/participants/test_views.py | dubesar/EvalAI | a38fbc8ff8c58f26fb2e61ef67e13055fb0c1f29 | [
"BSD-3-Clause"
] | 2 | 2019-07-19T04:17:48.000Z | 2019-07-19T06:26:31.000Z | tests/unit/participants/test_views.py | Sanji515/EvalAI | 888806063b0d6423fd35754e3c37aad02c2b05f7 | [
"BSD-3-Clause"
] | 1 | 2020-02-15T11:34:13.000Z | 2020-02-15T11:34:13.000Z | from datetime import timedelta
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.models import User
from django.utils import timezone
from allauth.account.models import EmailAddress
from rest_framework import status
from rest_framework.test import APITestCase, APIClient
from challenges.model... | 39.089535 | 148 | 0.614124 | from datetime import timedelta
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.models import User
from django.utils import timezone
from allauth.account.models import EmailAddress
from rest_framework import status
from rest_framework.test import APITestCase, APIClient
from challenges.model... | true | true |
f7029017ccc2630634311f5e276c0e3fb26d7895 | 6,132 | py | Python | main.py | Ansaku/TempEmail-Bot | 680e6456e9a9caa19df6e8cc3d6b2cb3ff998ff4 | [
"Apache-2.0"
] | null | null | null | main.py | Ansaku/TempEmail-Bot | 680e6456e9a9caa19df6e8cc3d6b2cb3ff998ff4 | [
"Apache-2.0"
] | null | null | null | main.py | Ansaku/TempEmail-Bot | 680e6456e9a9caa19df6e8cc3d6b2cb3ff998ff4 | [
"Apache-2.0"
] | 1 | 2022-03-23T23:36:29.000Z | 2022-03-23T23:36:29.000Z | # copyright 2022 @Ansaku
# Telegram @AnkiSatya
# Instagram @satya_ask
import telebot
import requests
from telebot.types import InlineKeyboardButton
# Fillout Here The BotToken it gets from botfather further queries @AnkiSatya 0n telegram
bot = telebot.TeleBot('**********************')
while True:
try:
... | 66.652174 | 876 | 0.551696 |
import telebot
import requests
from telebot.types import InlineKeyboardButton
bot = telebot.TeleBot('**********************')
while True:
try:
keyboard = telebot.types.ReplyKeyboardMarkup(resize_keyboard=True)
keyboard.add(InlineKeyboardButton(text='Buat email'))
keyboard.a... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.