hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f779430bd907a116a9e767cdcab2206d37af2f18 | 5,790 | py | Python | local_ledger/local_ledger.py | Artemkaaas/steward-tools | 929155dfa7f779e4d7c9dbe39595301011e3cd5d | [
"Apache-2.0"
] | null | null | null | local_ledger/local_ledger.py | Artemkaaas/steward-tools | 929155dfa7f779e4d7c9dbe39595301011e3cd5d | [
"Apache-2.0"
] | null | null | null | local_ledger/local_ledger.py | Artemkaaas/steward-tools | 929155dfa7f779e4d7c9dbe39595301011e3cd5d | [
"Apache-2.0"
] | null | null | null | # Author: Ryan West (ryan.west@sovrin.org)
import json
import rocksdb
import os
from indy import ledger, pool, wallet
from transaction import Transaction
class TxnDoesNotExistException(Exception):
pass
class InvalidLedgerResponseException(Exception):
pass
# TODO: add option to download specific set of txn... | 36.1875 | 79 | 0.608981 | import json
import rocksdb
import os
from indy import ledger, pool, wallet
from transaction import Transaction
class TxnDoesNotExistException(Exception):
pass
class InvalidLedgerResponseException(Exception):
pass
class LocalLedger():
def __init__(self, filename, poolname, walletname, key, did):
... | true | true |
f77944a677b2f169a4e8b03dfbaec2ae106bb75d | 25,644 | py | Python | reproduction/Summarization/Baseline/tools/Encoder.py | KuNyaa/fastNLP | 22f9b87c54a4eebec7352c7ff772cd24685c7186 | [
"Apache-2.0"
] | 1 | 2019-10-05T06:02:44.000Z | 2019-10-05T06:02:44.000Z | reproduction/Summarization/Baseline/tools/Encoder.py | awesomemachinelearning/fastNLP | 945b30bb6174751130744231aa26119bf9bb2601 | [
"Apache-2.0"
] | 1 | 2019-12-09T06:34:44.000Z | 2019-12-09T06:34:44.000Z | reproduction/Summarization/Baseline/tools/Encoder.py | awesomemachinelearning/fastNLP | 945b30bb6174751130744231aa26119bf9bb2601 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
import torch.nn.init as init
import data
from tools.logger import *
from transf... | 45.629893 | 165 | 0.631844 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
import torch.nn.init as init
import data
from tools.logger import *
from transf... | true | true |
f77944c41716b82d8fd4459e58166228a00ab96b | 795 | py | Python | prof/admin.py | nikhil-nk/IITG-Faculty-Portal | 6d89b97cf44f7eb7c7778c79b3a3d9fda8d8fb0d | [
"MIT"
] | null | null | null | prof/admin.py | nikhil-nk/IITG-Faculty-Portal | 6d89b97cf44f7eb7c7778c79b3a3d9fda8d8fb0d | [
"MIT"
] | null | null | null | prof/admin.py | nikhil-nk/IITG-Faculty-Portal | 6d89b97cf44f7eb7c7778c79b3a3d9fda8d8fb0d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .models import professor,department,education,award_fellowships,award_achievement,experience,project,publication_books,publication_conferences,publication_journals,publication_thesis,student_completed,student_ongoing
from django.contrib import admin
... | 41.842105 | 221 | 0.866667 | from __future__ import unicode_literals
from .models import professor,department,education,award_fellowships,award_achievement,experience,project,publication_books,publication_conferences,publication_journals,publication_thesis,student_completed,student_ongoing
from django.contrib import admin
admin.site.register(prof... | true | true |
f77946174b0db99dd094828974e819cbb9b3c646 | 282 | py | Python | leetcode_python/src/algorithms/tree/maximum_depth.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | leetcode_python/src/algorithms/tree/maximum_depth.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | leetcode_python/src/algorithms/tree/maximum_depth.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | from leetcode_python.src.algorithms.tree.node import Node
class MaximumDepth:
def max_depth(self, root: Node):
if not root:
return 0
left = self.max_depth(root.left)
right = self.max_depth(root.right)
return max(left, right) + 1
| 20.142857 | 57 | 0.631206 | from leetcode_python.src.algorithms.tree.node import Node
class MaximumDepth:
def max_depth(self, root: Node):
if not root:
return 0
left = self.max_depth(root.left)
right = self.max_depth(root.right)
return max(left, right) + 1
| true | true |
f7794647028c4d3cd151e4c7a4028207d3cc86ab | 6,063 | py | Python | pt/ctx.py | dogada/PyT | a2543176be3c34e231365a974f7724cf0b6684aa | [
"BSD-2-Clause"
] | 6 | 2016-07-22T07:37:18.000Z | 2022-02-08T01:41:29.000Z | pt/ctx.py | dogada/PyT | a2543176be3c34e231365a974f7724cf0b6684aa | [
"BSD-2-Clause"
] | null | null | null | pt/ctx.py | dogada/PyT | a2543176be3c34e231365a974f7724cf0b6684aa | [
"BSD-2-Clause"
] | null | null | null | """
Runtime functionaly (uses template context).
"""
from cgi import escape as xml_escape
class Undefined(object):
"""Undefined object."""
def __nonzero__(self):
return False
def __unicode__(self):
raise Exception("UNDEFINED")
UNDEFINED = Undefined()
Undefined = None
def Var(name, defaul... | 36.305389 | 109 | 0.606795 |
from cgi import escape as xml_escape
class Undefined(object):
def __nonzero__(self):
return False
def __unicode__(self):
raise Exception("UNDEFINED")
UNDEFINED = Undefined()
Undefined = None
def Var(name, default=UNDEFINED, format=None, escape="xml"): tokens = name.split('.')
if len(... | true | true |
f77946fdd34d05aacd11ec4625dd602368086ee6 | 10,541 | py | Python | research/slim/nets/nasnet/pnasnet.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 82,518 | 2016-02-05T12:07:23.000Z | 2022-03-31T23:09:47.000Z | research/slim/nets/nasnet/pnasnet.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 9,021 | 2016-03-08T01:02:05.000Z | 2022-03-31T08:06:35.000Z | research/slim/nets/nasnet/pnasnet.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 54,341 | 2016-02-06T17:19:55.000Z | 2022-03-31T10:27:44.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.116197 | 80 | 0.67707 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import tensorflow.compat.v1 as tf
import tf_slim as slim
from tensorflow.contrib import training as contrib_training
from nets.nasnet import nasnet
from nets.nasnet import nasnet_utils
arg_scope ... | true | true |
f779483d725a62cf7293cc7be96848b5f078966b | 3,797 | py | Python | vspreview/models/outputs.py | cid-chan/vapoursynth-preview | 04325964c530eac1eb41a07cc45beb77d31713d5 | [
"Apache-2.0"
] | 2 | 2021-10-03T08:54:21.000Z | 2022-01-18T22:46:59.000Z | vspreview/models/outputs.py | cid-chan/vapoursynth-preview | 04325964c530eac1eb41a07cc45beb77d31713d5 | [
"Apache-2.0"
] | null | null | null | vspreview/models/outputs.py | cid-chan/vapoursynth-preview | 04325964c530eac1eb41a07cc45beb77d31713d5 | [
"Apache-2.0"
] | 2 | 2021-08-05T03:23:19.000Z | 2021-08-25T12:39:14.000Z | from __future__ import annotations
from collections import OrderedDict
import logging
from typing import Any, cast, Iterator, List, Mapping, Optional
from PyQt5 import Qt
import vapoursynth as vs
from vspreview.core import Output, QYAMLObjectSingleton, QYAMLObject
from vspreview.utils import de... | 31.122951 | 93 | 0.590203 | from __future__ import annotations
from collections import OrderedDict
import logging
from typing import Any, cast, Iterator, List, Mapping, Optional
from PyQt5 import Qt
import vapoursynth as vs
from vspreview.core import Output, QYAMLObjectSingleton, QYAMLObject
from vspreview.utils import de... | true | true |
f77949e1fe9d8db7d9767a0c50c910b125a30c35 | 4,383 | py | Python | src/test/resources/api_tests.py | miaguicam7/lambda-crud-dynamodb | 5673a0bf160474000dbef746facfabc50edd1d32 | [
"MIT-0"
] | null | null | null | src/test/resources/api_tests.py | miaguicam7/lambda-crud-dynamodb | 5673a0bf160474000dbef746facfabc50edd1d32 | [
"MIT-0"
] | null | null | null | src/test/resources/api_tests.py | miaguicam7/lambda-crud-dynamodb | 5673a0bf160474000dbef746facfabc50edd1d32 | [
"MIT-0"
] | null | null | null | ##
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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 ... | 29.816327 | 87 | 0.668036 |
import sys
import requests
import inspect
import json
from random import randint
data = dict()
BASE_URL = 'http://localhost:3000/orders'
NUM_ORDERS = int(23)
def test_create_table():
print('TEST: CREATE TABLE')
r = requests.post('http://localhost:3000/_create_orders_table')
try:
response = r.text
prin... | true | true |
f7794bf171cb43ac99c485e83089e1f4d75c7dab | 2,433 | py | Python | tools/install_venv.py | JioCloudVPC/compute-ec2-api-vagrant | 9e7cf7b566f86aee4a0c73316533e1c410d1a897 | [
"Apache-2.0"
] | null | null | null | tools/install_venv.py | JioCloudVPC/compute-ec2-api-vagrant | 9e7cf7b566f86aee4a0c73316533e1c410d1a897 | [
"Apache-2.0"
] | null | null | null | tools/install_venv.py | JioCloudVPC/compute-ec2-api-vagrant | 9e7cf7b566f86aee4a0c73316533e1c410d1a897 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2... | 32.44 | 79 | 0.709823 |
import os
import sys
import install_venv_common as install_venv
def print_help(venv, root):
help = """
EC2 development environment setup is complete.
EC2 development uses virtualenv to track and manage Python dependencies
while in development and testing.
To activate the EC2 virtualenv for th... | false | true |
f7794ca19c158ff6eb8350b12bdaafa51a332a35 | 2,086 | py | Python | voithos/lib/util/qemu_img.py | ruthrosals/voithos | 5c4eb5d351a4a7fc9b1cca584686eab951b683e2 | [
"Apache-2.0"
] | null | null | null | voithos/lib/util/qemu_img.py | ruthrosals/voithos | 5c4eb5d351a4a7fc9b1cca584686eab951b683e2 | [
"Apache-2.0"
] | null | null | null | voithos/lib/util/qemu_img.py | ruthrosals/voithos | 5c4eb5d351a4a7fc9b1cca584686eab951b683e2 | [
"Apache-2.0"
] | null | null | null | """ qemu-img library: Manages conversions of vDisk types and mapping them to raw devices """
from pathlib import Path
from voithos.lib.system import shell, assert_path_exists
def convert(input_format, output_format, input_path, output_path):
""" Execute qemu-img inside a container that mounts input_path and outp... | 41.72 | 96 | 0.681687 | from pathlib import Path
from voithos.lib.system import shell, assert_path_exists
def convert(input_format, output_format, input_path, output_path):
path_in = Path(input_path)
input_abspath = path_in.absolute().__str__()
assert_path_exists(input_abspath)
internal_input_path = f"/input/{path_in.na... | true | true |
f7794df4bf3cfd61204e958ff4a5429dab32383b | 15,709 | py | Python | learners/weight_sparsification/learner.py | WenjayDu/PocketFlow | 19ed4858b2fc914541032f74239ca08c0074c237 | [
"Apache-2.0"
] | null | null | null | learners/weight_sparsification/learner.py | WenjayDu/PocketFlow | 19ed4858b2fc914541032f74239ca08c0074c237 | [
"Apache-2.0"
] | null | null | null | learners/weight_sparsification/learner.py | WenjayDu/PocketFlow | 19ed4858b2fc914541032f74239ca08c0074c237 | [
"Apache-2.0"
] | null | null | null | # Tencent is pleased to support the open source community by making PocketFlow available.
#
# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 42.342318 | 100 | 0.692215 |
import os
from timeit import default_timer as timer
import numpy as np
import tensorflow as tf
from learners.abstract_learner import AbstractLearner
from learners.distillation_helper import DistillationHelper
from learners.weight_sparsification.pr_optimizer import PROptimizer
from learners.weight_sparsification.utils... | true | true |
f7794e54a3af718e746d1ebddaa554ba84f83463 | 2,136 | py | Python | wsgi.py | rstojnic/arxiv-browse | 8847fb8bcd79cc2b162fd3de16db8fba1a1df020 | [
"MIT"
] | 61 | 2019-01-10T21:15:00.000Z | 2022-02-21T13:22:22.000Z | wsgi.py | rstojnic/arxiv-browse | 8847fb8bcd79cc2b162fd3de16db8fba1a1df020 | [
"MIT"
] | 91 | 2019-01-14T21:12:06.000Z | 2022-03-09T19:52:59.000Z | wsgi.py | rstojnic/arxiv-browse | 8847fb8bcd79cc2b162fd3de16db8fba1a1df020 | [
"MIT"
] | 38 | 2019-01-10T22:01:30.000Z | 2022-03-10T23:07:00.000Z | """Web Server Gateway Interface (WSGI) entry-point."""
import os
from browse.factory import create_web_app
# We need someplace to keep the flask app around between requests.
# Double underscores excludes this from * imports.
__flask_app__ = None
def application(environ, start_response):
"""WSGI application, cal... | 39.555556 | 70 | 0.725655 | import os
from browse.factory import create_web_app
__flask_app__ = None
def application(environ, start_response):
for key, value in environ.items():
if type(value) is str:
os.environ[key] = value
# stackoverflow: "In Python there is no such thing as abso... | true | true |
f7794e63a5d05bf5110d86151b945f9bb8eca746 | 1,033 | py | Python | web_copy/log_demo.py | wenjunyang/toast | 7d30c86d8c9c254f8b7a78e2efce528604c6c57d | [
"Apache-2.0"
] | null | null | null | web_copy/log_demo.py | wenjunyang/toast | 7d30c86d8c9c254f8b7a78e2efce528604c6c57d | [
"Apache-2.0"
] | null | null | null | web_copy/log_demo.py | wenjunyang/toast | 7d30c86d8c9c254f8b7a78e2efce528604c6c57d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
# -*-coding:utf-8-*-
import logging
log = None
def init_log(log_name):
# 日志输出格式
fmt = '%(asctime)s - %(filename)s:%(lineno)s - %(levelname)s - %(name)s - %(message)s'
formatter = logging.Formatter(fmt)
# 创建一个handler,用于输出到控制台
console_handler = logging.StreamHandler()
consol... | 19.865385 | 90 | 0.638916 |
import logging
log = None
def init_log(log_name):
fmt = '%(asctime)s - %(filename)s:%(lineno)s - %(levelname)s - %(name)s - %(message)s'
formatter = logging.Formatter(fmt)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG)
console_handler.setFormatter(forma... | false | true |
f7794f75af54c027a1e0a8412b629ffcd7874ff9 | 75,654 | py | Python | gsum/models.py | ckoerber/gsum | 4174bd622e7a1b829baa1cf1d0857a70cec27537 | [
"MIT"
] | 7 | 2019-04-25T02:28:51.000Z | 2022-01-27T22:15:31.000Z | gsum/models.py | jordan-melendez/gsum | a9647d60eb5ef971caad88f97df8f1e9cc5286c2 | [
"MIT"
] | 2 | 2021-07-29T20:12:10.000Z | 2021-08-10T07:25:26.000Z | gsum/models.py | jordan-melendez/gsum | a9647d60eb5ef971caad88f97df8f1e9cc5286c2 | [
"MIT"
] | 2 | 2019-07-01T07:56:22.000Z | 2021-11-10T15:36:25.000Z | from __future__ import division
import docrep
from .helpers import coefficients, hpd, mahalanobis, geometric_sum
import numpy as np
from numpy.linalg import solve, cholesky
import scipy as sp
from scipy.linalg import cho_solve, solve_triangular, inv, eigh
from scipy.special import loggamma
import scipy.stats as st
from... | 41.183451 | 119 | 0.591429 | from __future__ import division
import docrep
from .helpers import coefficients, hpd, mahalanobis, geometric_sum
import numpy as np
from numpy.linalg import solve, cholesky
import scipy as sp
from scipy.linalg import cho_solve, solve_triangular, inv, eigh
from scipy.special import loggamma
import scipy.stats as st
from... | true | true |
f7795037c21edf418fff42dd8e12ac7719500bb2 | 14,926 | py | Python | ltiauthenticator/lti13/constants.py | regisb/ltiauthenticator | c32307f7baf8a9a50863faf806983e1dd00ef6c4 | [
"BSD-3-Clause"
] | 1 | 2017-12-18T23:55:18.000Z | 2017-12-18T23:55:18.000Z | ltiauthenticator/lti13/constants.py | regisb/ltiauthenticator | c32307f7baf8a9a50863faf806983e1dd00ef6c4 | [
"BSD-3-Clause"
] | null | null | null | ltiauthenticator/lti13/constants.py | regisb/ltiauthenticator | c32307f7baf8a9a50863faf806983e1dd00ef6c4 | [
"BSD-3-Clause"
] | null | null | null | # LTI 1.3
# Initial authentication request arguments
# https://www.imsglobal.org/spec/security/v1p0/#step-1-third-party-initiated-login
LTI13_LOGIN_REQUEST_ARGS = [
"iss",
"login_hint",
"target_link_uri",
]
# Initial authentication request arguments
# https://www.imsglobal.org/spec/security/v1p0/#step-2-au... | 49.260726 | 111 | 0.677141 | LTI13_LOGIN_REQUEST_ARGS = [
"iss",
"login_hint",
"target_link_uri",
]
LTI13_AUTH_REQUEST_ARGS = [
"client_id",
"login_hint",
"lti_message_hint",
"nonce",
"prompt",
"redirect_uri",
"response_mode",
"response_type",
"scope",
"state",
]
LTI13_GENERAL_REQUIRED_CLAIMS =... | true | true |
f7795175a1bdf77621cf3b3abbc4d5b7c03a332b | 1,550 | py | Python | tests/nn/rnn_cell_test.py | TylerYep/edutorch | 6a4a425cbfd7fcdcd851b010816d29c3b5bae8bd | [
"MIT"
] | 3 | 2021-06-14T01:17:31.000Z | 2022-01-20T09:34:32.000Z | tests/nn/rnn_cell_test.py | TylerYep/edutorch | 6a4a425cbfd7fcdcd851b010816d29c3b5bae8bd | [
"MIT"
] | null | null | null | tests/nn/rnn_cell_test.py | TylerYep/edutorch | 6a4a425cbfd7fcdcd851b010816d29c3b5bae8bd | [
"MIT"
] | null | null | null | import numpy as np
from edutorch.nn import RNNCell
from tests.gradient_check import estimate_gradients
def test_rnn_cell_forward() -> None:
N, D, H = 3, 10, 4
x = np.linspace(-0.4, 0.7, num=N * D).reshape(N, D)
model = RNNCell(
prev_h=np.linspace(-0.2, 0.5, num=N * H).reshape(N, H),
Wx=n... | 28.703704 | 71 | 0.596774 | import numpy as np
from edutorch.nn import RNNCell
from tests.gradient_check import estimate_gradients
def test_rnn_cell_forward() -> None:
N, D, H = 3, 10, 4
x = np.linspace(-0.4, 0.7, num=N * D).reshape(N, D)
model = RNNCell(
prev_h=np.linspace(-0.2, 0.5, num=N * H).reshape(N, H),
Wx=n... | true | true |
f779517e5f7b681e4cbcaa9f8a1836bdfcf4a0d2 | 7,838 | py | Python | contrib/bitrpc/bitrpc.py | teamjojo/Makecoin | 339410765257d7e5899b0b08a87c4148cf25e075 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | teamjojo/Makecoin | 339410765257d7e5899b0b08a87c4148cf25e075 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | teamjojo/Makecoin | 339410765257d7e5899b0b08a87c4148cf25e075 | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:2332")
else:
access = Ser... | 24.116923 | 79 | 0.668283 | from jsonrpc import ServiceProxy
import sys
import string
rpcuser = ""
rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:2332")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:2332")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":
try:
path = raw_input("Enter dest... | false | true |
f779524a8782c4205778d0677148c3558fee22ed | 384 | py | Python | mainFastApi.py | aimanh22/microservices-key-concepts | 5889dbc903e5199636598d396af0e79ddf6242ca | [
"CC0-1.0"
] | 3 | 2022-02-08T02:05:19.000Z | 2022-02-09T14:15:59.000Z | mainFastApi.py | noahgift/microservices-key-concepts | d222624d988e55a8933ffe47913c98f4eb927285 | [
"CC0-1.0"
] | 1 | 2022-02-09T18:48:51.000Z | 2022-02-09T18:48:51.000Z | mainFastApi.py | aimanh22/microservices-key-concepts | 5889dbc903e5199636598d396af0e79ddf6242ca | [
"CC0-1.0"
] | 8 | 2022-02-07T19:02:38.000Z | 2022-02-09T19:04:17.000Z | from fastapi import FastAPI
import uvicorn
from logic import add
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello"}
@app.get("/add/{num1}/{num2}")
async def adder(num1: int, num2: int):
"""Add two numbers together"""
total = add(num1,num2)
return {"total": total}
if __name_... | 20.210526 | 47 | 0.638021 | from fastapi import FastAPI
import uvicorn
from logic import add
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello"}
@app.get("/add/{num1}/{num2}")
async def adder(num1: int, num2: int):
total = add(num1,num2)
return {"total": total}
if __name__ == '__main__':
uvicorn.run(ap... | true | true |
f77952c324e67ddadb5a5a54222fbaf82a8bd9e3 | 162 | py | Python | DataBaseModels/model_base.py | ZhuTou409/oa-flask | c66f0fc4a4f541fd18dc7b08d0313788856a6dfe | [
"MIT"
] | null | null | null | DataBaseModels/model_base.py | ZhuTou409/oa-flask | c66f0fc4a4f541fd18dc7b08d0313788856a6dfe | [
"MIT"
] | null | null | null | DataBaseModels/model_base.py | ZhuTou409/oa-flask | c66f0fc4a4f541fd18dc7b08d0313788856a6dfe | [
"MIT"
] | null | null | null |
class ModelBase:
def __init__(self):
pass
def InitByMainKey(self, MainKeyObj):
pass
def InsertAllInfoToForm(self):
pass
| 11.571429 | 40 | 0.598765 |
class ModelBase:
def __init__(self):
pass
def InitByMainKey(self, MainKeyObj):
pass
def InsertAllInfoToForm(self):
pass
| true | true |
f7795308dd9ebc955e91060306b1d138ada938af | 1,304 | py | Python | display.py | Chappie733/GravitationSimulator | 9949659543203926db0713cdaad2a5b521163c2b | [
"MIT"
] | null | null | null | display.py | Chappie733/GravitationSimulator | 9949659543203926db0713cdaad2a5b521163c2b | [
"MIT"
] | null | null | null | display.py | Chappie733/GravitationSimulator | 9949659543203926db0713cdaad2a5b521163c2b | [
"MIT"
] | null | null | null | import pygame
class Display():
def __init__(self, w=800, h=600) -> None:
self.w, self.h = w, h
self.fullscreen = False
self.brightness = 255
self.brightness_mask = pygame.Surface((w,h), pygame.SRCALPHA)
self.brightness_mask.fill((0,0,0,0))
def create(self, c... | 38.352941 | 99 | 0.630368 | import pygame
class Display():
def __init__(self, w=800, h=600) -> None:
self.w, self.h = w, h
self.fullscreen = False
self.brightness = 255
self.brightness_mask = pygame.Surface((w,h), pygame.SRCALPHA)
self.brightness_mask.fill((0,0,0,0))
def create(self, c... | true | true |
f77953abd45e206193deb8e5007e50d699aee37d | 2,189 | py | Python | tests/test_utils.py | maxthemillion/timeseers | 3dafb96a08fda6025127ef2c67d0536735d3b48e | [
"MIT"
] | 233 | 2020-05-13T14:57:56.000Z | 2022-03-28T20:12:58.000Z | tests/test_utils.py | maxthemillion/timeseers | 3dafb96a08fda6025127ef2c67d0536735d3b48e | [
"MIT"
] | 25 | 2020-04-12T11:51:43.000Z | 2022-02-15T20:28:35.000Z | tests/test_utils.py | maxthemillion/timeseers | 3dafb96a08fda6025127ef2c67d0536735d3b48e | [
"MIT"
] | 30 | 2020-05-20T12:14:07.000Z | 2022-03-28T01:00:53.000Z | import numpy as np
from hypothesis import given
from hypothesis import strategies as st
from hypothesis.extra.numpy import arrays, array_shapes
from hypothesis.extra.pandas import data_frames, column, series, range_indexes
from timeseers.utils import MinMaxScaler
@given(
arrays(
np.float,
shape=a... | 29.986301 | 98 | 0.66286 | import numpy as np
from hypothesis import given
from hypothesis import strategies as st
from hypothesis.extra.numpy import arrays, array_shapes
from hypothesis.extra.pandas import data_frames, column, series, range_indexes
from timeseers.utils import MinMaxScaler
@given(
arrays(
np.float,
shape=a... | true | true |
f77953b1ea805bf3f96eafc18b8de6e05fcea0eb | 4,910 | py | Python | setup.py | jab416171/jishaku | 31dd6e473dc9101ec15b8b92568bc339e836d994 | [
"MIT"
] | 1 | 2021-09-11T09:24:33.000Z | 2021-09-11T09:24:33.000Z | setup.py | jab416171/jishaku | 31dd6e473dc9101ec15b8b92568bc339e836d994 | [
"MIT"
] | null | null | null | setup.py | jab416171/jishaku | 31dd6e473dc9101ec15b8b92568bc339e836d994 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2021 Devon (Gorialis) R
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 limita... | 33.862069 | 133 | 0.642974 |
import os
import pathlib
import re
import subprocess
from setuptools import setup
ROOT = pathlib.Path(__file__).parent
with open(ROOT / 'jishaku' / 'meta.py', 'r', encoding='utf-8') as f:
VERSION_MATCH = re.search(r'VersionInfo\(major=(\d+), minor=(\d+), micro=(\d+), .+\)', f.read(), re.MULTILINE)
if not ... | true | true |
f77953bebc5aeaa2c5bbcbeebb584d54f42d5aa8 | 1,868 | py | Python | applications/1d/Order2Linear/setplot.py | claridge/implicit_solvers | d68bea026f6a3f8a9190a18689aea96166db65ff | [
"BSD-2-Clause"
] | 1 | 2017-04-29T00:16:18.000Z | 2017-04-29T00:16:18.000Z | applications/1d/Order4Linear/setplot.py | claridge/implicit_solvers | d68bea026f6a3f8a9190a18689aea96166db65ff | [
"BSD-2-Clause"
] | null | null | null | applications/1d/Order4Linear/setplot.py | claridge/implicit_solvers | d68bea026f6a3f8a9190a18689aea96166db65ff | [
"BSD-2-Clause"
] | null | null | null |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
def setplot(plotdata):
#--------------------------
"""
Specify what is to b... | 33.357143 | 74 | 0.618844 |
def setplot(plotdata):
plotdata.clearfigures()
plotfigure = plotdata.new_plotfigure(name='q[0]', figno=1)
plotaxes = plotfigure.new_plotaxes()
plotaxes.title = 'Solution'
plotaxes.xlimits = 'auto'
plotaxes.ylimits = [0.0, 1.0]
plotitem = plotaxes.new_plotitem(plot_typ... | true | true |
f77953d55b9d93c45e585d949dd054e4593ac6ef | 13,350 | py | Python | backtrader/backtrader/indicators/directionalmove.py | harshabakku/live-back-testing-trader | 1fd69c7598dc15bea740f160eed886f396bcba2c | [
"MIT"
] | 1 | 2021-07-14T22:04:08.000Z | 2021-07-14T22:04:08.000Z | backtrader/backtrader/indicators/directionalmove.py | ajmal017/LiveBackTestingTrader | 8b4f5804c0aa6046128f6706582f9cde78a0519a | [
"MIT"
] | null | null | null | backtrader/backtrader/indicators/directionalmove.py | ajmal017/LiveBackTestingTrader | 8b4f5804c0aa6046128f6706582f9cde78a0519a | [
"MIT"
] | 3 | 2021-03-07T16:29:40.000Z | 2022-03-17T21:42:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015, 2016, 2017 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... | 34.765625 | 79 | 0.642022 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import Indicator, And, If, MovAv, ATR
class UpMove(Indicator):
lines = ('upmove',)
def __init__(self):
self.lines.upmove = self.data - self.data(-1)
super(UpMove, self).__init_... | true | true |
f77953e79ad45ba3d8942c33fd4754a7b825fd8c | 858 | py | Python | pyocni/adapters/__init__.py | MarouenMechtri/CNG-Manager | 9535b721e7b832d72fd7bba6d2a29e76a0d4bdb7 | [
"Apache-2.0"
] | 1 | 2015-02-28T21:26:07.000Z | 2015-02-28T21:26:07.000Z | pyocni/adapters/__init__.py | MarouenMechtri/CNG-Manager | 9535b721e7b832d72fd7bba6d2a29e76a0d4bdb7 | [
"Apache-2.0"
] | null | null | null | pyocni/adapters/__init__.py | MarouenMechtri/CNG-Manager | 9535b721e7b832d72fd7bba6d2a29e76a0d4bdb7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010-2012 Institut Mines-Telecom
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 35.75 | 75 | 0.762238 | true | true | |
f77954b42320e8a012919c672b386b5ed698d673 | 11,456 | py | Python | packages/python/plotly/plotly/validators/parcoords/line/_colorbar.py | eisenlohr/plotly.py | 3b0e3df45036cf48f772b13bcc10ce347964aefc | [
"MIT"
] | 1 | 2021-12-11T07:01:40.000Z | 2021-12-11T07:01:40.000Z | packages/python/plotly/plotly/validators/parcoords/line/_colorbar.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/parcoords/line/_colorbar.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | 1 | 2021-11-29T22:55:05.000Z | 2021-11-29T22:55:05.000Z | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="parcoords.line", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | 47.53527 | 87 | 0.526711 | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="parcoords.line", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | true | true |
f77955544653f0acbc1dbfd9e203af6356c4d276 | 444 | py | Python | homeassistant/components/dynalite/const.py | CoMPaTech/home-assistant | f975654ae7fa03dbec42b49835c08db414d0c738 | [
"Apache-2.0"
] | 4 | 2016-12-23T10:36:36.000Z | 2021-04-22T12:38:16.000Z | homeassistant/components/dynalite/const.py | CoMPaTech/home-assistant | f975654ae7fa03dbec42b49835c08db414d0c738 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/components/dynalite/const.py | CoMPaTech/home-assistant | f975654ae7fa03dbec42b49835c08db414d0c738 | [
"Apache-2.0"
] | 1 | 2020-02-24T16:17:42.000Z | 2020-02-24T16:17:42.000Z | """Constants for the Dynalite component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "dynalite"
CONF_ACTIVE = "active"
CONF_ALL = "ALL"
CONF_AREA = "area"
CONF_AUTO_DISCOVER = "autodiscover"
CONF_BRIDGES = "bridges"
CONF_CHANNEL = "channel"
CONF_DEFAULT = "default"
CONF_FADE = "fade"
CONF_HOST ... | 20.181818 | 43 | 0.747748 | import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "dynalite"
CONF_ACTIVE = "active"
CONF_ALL = "ALL"
CONF_AREA = "area"
CONF_AUTO_DISCOVER = "autodiscover"
CONF_BRIDGES = "bridges"
CONF_CHANNEL = "channel"
CONF_DEFAULT = "default"
CONF_FADE = "fade"
CONF_HOST = "host"
CONF_NAME = "name"
CONF_POLLTIMER =... | true | true |
f7795593963d43077b4734f0287c3e3296d14fb7 | 4,647 | py | Python | sdk/python/pulumi_azure/compute/image.py | stack72/pulumi-azure | 18245b4e74abbd3f768f9eda67adb1df609ff32e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/compute/image.py | stack72/pulumi-azure | 18245b4e74abbd3f768f9eda67adb1df609ff32e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/compute/image.py | stack72/pulumi-azure | 18245b4e74abbd3f768f9eda67adb1df609ff32e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Image(pulumi.CustomResource):
... | 41.123894 | 230 | 0.678717 |
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Image(pulumi.CustomResource):
data_disks: pulumi.Output[list]
location: pulumi.Output[str]
name: pulumi.Output[str]
os_disk: pulumi.Output[dict]
resource_group_name: pulumi.Output[str]
source... | true | true |
f77955e942abfe3f0b5e0f47067f4b4d6192d171 | 8,914 | py | Python | tests/unit/test__retry.py | shkumagai/python-ndb | b27725e788e0fe18819f1f543657610d598aa9fb | [
"Apache-2.0"
] | 137 | 2019-02-27T05:10:16.000Z | 2022-03-09T06:38:36.000Z | tests/unit/test__retry.py | shkumagai/python-ndb | b27725e788e0fe18819f1f543657610d598aa9fb | [
"Apache-2.0"
] | 500 | 2019-02-21T18:33:51.000Z | 2022-03-30T11:21:10.000Z | tests/unit/test__retry.py | shkumagai/python-ndb | b27725e788e0fe18819f1f543657610d598aa9fb | [
"Apache-2.0"
] | 66 | 2019-02-21T14:29:42.000Z | 2021-11-29T14:18:07.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.893536 | 79 | 0.686336 |
import itertools
try:
from unittest import mock
except ImportError: import mock
import pytest
from google.api_core import exceptions as core_exceptions
from google.cloud.ndb import _retry
from google.cloud.ndb import tasklets
from . import utils
def mock_sleep(seconds):
future = tasklets.Future()
... | true | true |
f779568a8ac37deb2c9bc8c8022a315c824baba2 | 5,650 | py | Python | payments/views.py | aibon/django-stripe-payments | 1be6e5884fffc7e7c80729a5b82c1bad5b6743a8 | [
"MIT"
] | null | null | null | payments/views.py | aibon/django-stripe-payments | 1be6e5884fffc7e7c80729a5b82c1bad5b6743a8 | [
"MIT"
] | null | null | null | payments/views.py | aibon/django-stripe-payments | 1be6e5884fffc7e7c80729a5b82c1bad5b6743a8 | [
"MIT"
] | null | null | null | import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.encoding import smart_str... | 30.213904 | 86 | 0.662301 | import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.encoding import smart_str... | true | true |
f77956e5e11ad8f26aa81655d3bbc21588d26317 | 3,172 | py | Python | tests/test_iam/test_iam_server_certificates.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | null | null | null | tests/test_iam/test_iam_server_certificates.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | null | null | null | tests/test_iam/test_iam_server_certificates.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | null | null | null | import boto3
import pytest
import sure # noqa
from botocore.exceptions import ClientError
from datetime import datetime
from moto import mock_iam
from moto.core import ACCOUNT_ID
@mock_iam
def test_get_all_server_certs():
conn = boto3.client("iam", region_name="us-east-1")
conn.upload_server_certificate(
... | 31.405941 | 76 | 0.707755 | import boto3
import pytest
import sure
from botocore.exceptions import ClientError
from datetime import datetime
from moto import mock_iam
from moto.core import ACCOUNT_ID
@mock_iam
def test_get_all_server_certs():
conn = boto3.client("iam", region_name="us-east-1")
conn.upload_server_certificate(
... | true | true |
f77957208fbe06832d9a43fb4b676edc0749476a | 5,558 | py | Python | ibis/backends/impala/tests/test_pandas_interop.py | arielrossanigo/ibis | 18e967cac961285b05d8df560f40148bac1a2571 | [
"Apache-2.0"
] | 1 | 2021-07-14T12:27:34.000Z | 2021-07-14T12:27:34.000Z | ibis/backends/impala/tests/test_pandas_interop.py | arielrossanigo/ibis | 18e967cac961285b05d8df560f40148bac1a2571 | [
"Apache-2.0"
] | 1 | 2021-03-25T14:07:29.000Z | 2021-03-25T14:07:29.000Z | ibis/backends/impala/tests/test_pandas_interop.py | arielrossanigo/ibis | 18e967cac961285b05d8df560f40148bac1a2571 | [
"Apache-2.0"
] | 1 | 2017-11-30T13:32:23.000Z | 2017-11-30T13:32:23.000Z | import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.schema as sch
from ibis.backends.impala.pandas_interop import DataFrameWriter # noqa: E402
pytestmark = pytest.mark.impala
@pytest.fixture
def exhaustive_df():
return p... | 28.357143 | 77 | 0.475891 | import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.schema as sch
from ibis.backends.impala.pandas_interop import DataFrameWriter
pytestmark = pytest.mark.impala
@pytest.fixture
def exhaustive_df():
return pd.DataFrame(
... | true | true |
f7795722a069ea04d0505844ea22c27c56d07a47 | 2,103 | py | Python | water/db.py | grahamhoyes/water | 66ba49e739edd4a3d81f9ba2c15360c9d1b6cb98 | [
"MIT"
] | 1 | 2019-08-08T10:06:45.000Z | 2019-08-08T10:06:45.000Z | water/db.py | sintel-dev/water | 77b9b40a1089984a12fd47783545c329661fe07a | [
"MIT"
] | 4 | 2018-11-28T18:42:47.000Z | 2019-08-08T17:14:21.000Z | water/db.py | sintel-dev/water | 77b9b40a1089984a12fd47783545c329661fe07a | [
"MIT"
] | 3 | 2019-08-08T10:06:42.000Z | 2020-02-21T17:38:52.000Z | # -*- coding: utf-8 -*-
import getpass
import json
import logging
from datetime import datetime
from pymongo import MongoClient
from water.utils import remove_dots, restore_dots
LOGGER = logging.getLogger(__name__)
class MongoDB(object):
def __init__(self, database=None, config=None, **kwargs):
if co... | 26.620253 | 82 | 0.605801 |
import getpass
import json
import logging
from datetime import datetime
from pymongo import MongoClient
from water.utils import remove_dots, restore_dots
LOGGER = logging.getLogger(__name__)
class MongoDB(object):
def __init__(self, database=None, config=None, **kwargs):
if config:
with o... | true | true |
f77958b2d3f26d38a4b3a8953ec1c7f53e44414f | 1,101 | py | Python | app_book/serializer.py | visoon0012/plover.cloud | 04542628758d969085eb6172928165fddb5d2677 | [
"Apache-2.0"
] | 1 | 2018-05-15T08:34:14.000Z | 2018-05-15T08:34:14.000Z | app_book/serializer.py | visoon0012/plover.cloud | 04542628758d969085eb6172928165fddb5d2677 | [
"Apache-2.0"
] | 7 | 2020-06-05T18:09:20.000Z | 2022-03-11T23:20:49.000Z | app_book/serializer.py | visoon0012/plover.cloud | 04542628758d969085eb6172928165fddb5d2677 | [
"Apache-2.0"
] | null | null | null | from rest_framework import serializers
from app_book.models import Novel, NovelFork, NovelChapter
class NovelSerializer(serializers.ModelSerializer):
forks = serializers.SerializerMethodField()
new = serializers.SerializerMethodField()
class Meta:
model = Novel
fields = ('id', 'title', '... | 30.583333 | 162 | 0.683924 | from rest_framework import serializers
from app_book.models import Novel, NovelFork, NovelChapter
class NovelSerializer(serializers.ModelSerializer):
forks = serializers.SerializerMethodField()
new = serializers.SerializerMethodField()
class Meta:
model = Novel
fields = ('id', 'title', '... | true | true |
f77958c6c0cd56ba86b5de803faef23fda792304 | 366 | py | Python | git.py | PvrpleBlvck/Python_Learning_Journey | fcc57a21addf267677e61bfb8ccd05b63b085558 | [
"MIT"
] | 1 | 2021-12-08T18:54:42.000Z | 2021-12-08T18:54:42.000Z | git.py | PvrpleBlvck/Escuela | fcc57a21addf267677e61bfb8ccd05b63b085558 | [
"MIT"
] | 7 | 2021-12-09T15:52:44.000Z | 2022-01-02T05:57:52.000Z | git.py | PvrpleBlvck/Escuela | fcc57a21addf267677e61bfb8ccd05b63b085558 | [
"MIT"
] | null | null | null | Pull requests
Git init
Git pull *clone or download URL*
Git status
#For Git to track that file, the add command is given. If you know the exact name of the file, you can specify that simply type the following command:
Git add .
Git commit -m “changes made”
Git status
Git remote add origin *URL*
Git remote -v
Git pu... | 21.529412 | 150 | 0.756831 | Pull requests
Git init
Git pull *clone or download URL*
Git status
Git add .
Git commit -m “changes made”
Git status
Git remote add origin *URL*
Git remote -v
Git push -u origin master
Git push -u origin master
| false | true |
f7795a0db7fbb2966717923ad5854ed8183887b9 | 2,046 | py | Python | pyfr/backends/opencl/clblast.py | YuWangTAMU/PyFR | 99ff5fe1ec1ff0dcefcf6222488c990c6839aac3 | [
"BSD-3-Clause"
] | null | null | null | pyfr/backends/opencl/clblast.py | YuWangTAMU/PyFR | 99ff5fe1ec1ff0dcefcf6222488c990c6839aac3 | [
"BSD-3-Clause"
] | null | null | null | pyfr/backends/opencl/clblast.py | YuWangTAMU/PyFR | 99ff5fe1ec1ff0dcefcf6222488c990c6839aac3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from ctypes import POINTER, c_int, c_double, c_float, c_size_t, c_void_p
import numpy as np
from pyfr.backends.base import ComputeKernel
from pyfr.ctypesutil import LibWrapper
# Possible CLBlast exception types
CLBlastError = type('CLBlastError', (Exception,), {})
class CLBlastWrappers(Li... | 29.652174 | 78 | 0.616325 |
from ctypes import POINTER, c_int, c_double, c_float, c_size_t, c_void_p
import numpy as np
from pyfr.backends.base import ComputeKernel
from pyfr.ctypesutil import LibWrapper
CLBlastError = type('CLBlastError', (Exception,), {})
class CLBlastWrappers(LibWrapper):
_libname = 'clblast'
_statuses = {
... | true | true |
f7795a37382fceab1a65b17d3ab5dc34e7149504 | 1,275 | py | Python | pipeline/oldblsTask.py | exoplanetvetting/DAVE | aea19a30d987b214fb4c0cf01aa733f127c411b9 | [
"MIT"
] | 7 | 2019-05-07T02:01:51.000Z | 2022-03-16T08:09:39.000Z | pipeline/oldblsTask.py | barentsen/dave | 45ba97b7b535ad26dd555c33c963c6224a9af23c | [
"MIT"
] | 18 | 2015-12-09T22:18:59.000Z | 2017-04-26T13:11:44.000Z | pipeline/oldblsTask.py | barentsen/dave | 45ba97b7b535ad26dd555c33c963c6224a9af23c | [
"MIT"
] | 5 | 2017-03-08T11:42:53.000Z | 2020-05-07T00:10:37.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 30 16:10:56 2016
@author: fergal
$Id$
$URL$
"""
__version__ = "$Id$"
__URL__ = "$URL$"
import matplotlib.pyplot as mp
import numpy as np
"""
This is the task to run the fortran bls code. It's not used
in the normal pipeline, but I keep it here in case we ever need
... | 22.368421 | 74 | 0.658824 |
__version__ = "$Id$"
__URL__ = "$URL$"
import matplotlib.pyplot as mp
import numpy as np
import dave.blsCode.bls_ktwo as bls
@task.task
def blsTask(clip):
time_days = clip['serve.time']
flux_norm = clip['detrend.flux_frac']
flags = clip['detrend.flags']
minPeriod = clip['config.blsMinPeriod']
... | true | true |
f7795a7b4cddd5c268fe015674bdbceff7ecb4fb | 836 | py | Python | testcoin_miner.py | WhiteMatrix/TestCoin | 0864ac02073c6766329e3d312d1dba78391248a9 | [
"Apache-2.0"
] | null | null | null | testcoin_miner.py | WhiteMatrix/TestCoin | 0864ac02073c6766329e3d312d1dba78391248a9 | [
"Apache-2.0"
] | 1 | 2021-02-11T18:34:33.000Z | 2021-02-11T18:34:33.000Z | testcoin_miner.py | WhiteMatrix/TestCoin | 0864ac02073c6766329e3d312d1dba78391248a9 | [
"Apache-2.0"
] | null | null | null | import hashlib
# Prepare the transaction
sender = "0xAlice"
receiver = "0xBob"
amount = "10"
transaction = sender + ";" + receiver + ";" + amount + ";"
print("Transaction text: " + transaction)
salt = 0
# Loop over all salts and check if the condition is met
while True:
salt = salt+1
print("T... | 23.222222 | 63 | 0.583732 | import hashlib
sender = "0xAlice"
receiver = "0xBob"
amount = "10"
transaction = sender + ";" + receiver + ";" + amount + ";"
print("Transaction text: " + transaction)
salt = 0
while True:
salt = salt+1
print("Trying salt " + str(salt))
block = transaction + str(salt)
print("Cre... | true | true |
f7795c299c7f937207489a95e3ae300654abd98a | 498 | py | Python | Lesson05/Better Hash Functions.py | dmitry-izmerov/Udacity-Intro-to-computer-science | 534d75d3f0f39e5c28cd0e3789222ad2a4b37a8a | [
"MIT"
] | null | null | null | Lesson05/Better Hash Functions.py | dmitry-izmerov/Udacity-Intro-to-computer-science | 534d75d3f0f39e5c28cd0e3789222ad2a4b37a8a | [
"MIT"
] | null | null | null | Lesson05/Better Hash Functions.py | dmitry-izmerov/Udacity-Intro-to-computer-science | 534d75d3f0f39e5c28cd0e3789222ad2a4b37a8a | [
"MIT"
] | null | null | null | __author__ = 'demi'
# Define a function, hash_string,
# that takes as inputs a keyword
# (string) and a number of buckets,
# and returns a number representing
# the bucket for that keyword.
def hash_string(keyword,buckets):
res = 0
for c in keyword:
res += ord(c)
return res % buckets
print(hash... | 16.064516 | 35 | 0.640562 | __author__ = 'demi'
def hash_string(keyword,buckets):
res = 0
for c in keyword:
res += ord(c)
return res % buckets
print(hash_string('a', 12))
print(hash_string('b', 12))
print(hash_string('a', 13))
print(hash_string('au', 12))
print(hash_string('udacity', 12))
| true | true |
f7795c42aeca1bdae0a36096267504654448a92d | 482 | py | Python | category/migrations/0002_auto_20180606_1705.py | CharlieForApps/xpense1 | 210bba4f8a5dc9d38b37defca74968eaa4b36a0c | [
"BSD-2-Clause"
] | null | null | null | category/migrations/0002_auto_20180606_1705.py | CharlieForApps/xpense1 | 210bba4f8a5dc9d38b37defca74968eaa4b36a0c | [
"BSD-2-Clause"
] | null | null | null | category/migrations/0002_auto_20180606_1705.py | CharlieForApps/xpense1 | 210bba4f8a5dc9d38b37defca74968eaa4b36a0c | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-06-06 09:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('category', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 22.952381 | 88 | 0.620332 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('category', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='category',
name='cattype',
field... | true | true |
f7795d6b67d4a221d8baa35d780d6c8dc4f3219e | 1,431 | py | Python | demo/classification/mushroom/run_demo_mushroom.py | DavyMorgan/xlearn | e03f08ab22779ce13d9b08ac895ef5ba18fb16ef | [
"Apache-2.0"
] | 3,144 | 2017-11-06T08:48:13.000Z | 2022-03-20T00:35:50.000Z | demo/classification/mushroom/run_demo_mushroom.py | DavyMorgan/xlearn | e03f08ab22779ce13d9b08ac895ef5ba18fb16ef | [
"Apache-2.0"
] | 325 | 2017-11-18T12:59:39.000Z | 2022-02-24T07:19:03.000Z | demo/classification/mushroom/run_demo_mushroom.py | DavyMorgan/xlearn | e03f08ab22779ce13d9b08ac895ef5ba18fb16ef | [
"Apache-2.0"
] | 612 | 2017-11-09T14:19:17.000Z | 2022-01-24T10:17:49.000Z | # Copyright (c) 2018 by contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 34.071429 | 74 | 0.726066 |
import xlearn as xl
linear_model = xl.create_linear() linear_model.setTrain("./agaricus_train.txt") linear_model.setValidate("./agaricus_test.txt")
param = {'task':'binary', 'lr':0.2,
'lambda':0.002, 'metric':'acc',
'opt':'sgd'}
linear_model.fit(param, './model.out')
linear_model.setTest("./... | true | true |
f7795e138e2730dd2dd93f10ccf018ec1235a476 | 2,369 | py | Python | shop_app/redis/redis_lock.py | syz247179876/e_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 7 | 2021-04-10T13:20:56.000Z | 2022-03-29T15:00:29.000Z | shop_app/redis/redis_lock.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 9 | 2021-05-11T03:53:31.000Z | 2022-03-12T00:58:03.000Z | shop_app/redis/redis_lock.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 2 | 2020-11-24T08:59:22.000Z | 2020-11-24T14:10:59.000Z | # -*- coding: utf-8 -*-
# @Time : 2020/11/9 下午9:00
# @Author : 司云中
# @File : redis_lock.py
# @Software: Pycharm
import uuid
import math
import time
from threading import Thread
import redis
from redis import WatchError
def acquire_lock_with_timeout(conn, lock_name, acquire_timeout=3, lock_timeout=3, **kwargs):
... | 23.455446 | 95 | 0.57577 |
import uuid
import math
import time
from threading import Thread
import redis
from redis import WatchError
def acquire_lock_with_timeout(conn, lock_name, acquire_timeout=3, lock_timeout=3, **kwargs):
identifier = str(uuid.uuid4())
lock_name = f'redis-lock:{lock_name}'
lock_timeout = int(math.ceil(lock... | true | true |
f7795ebb97621078318a50d8f28d0a9f62feb5ac | 2,993 | py | Python | examples/ad_manager/v201805/report_service/run_delivery_report.py | beamc83/python-googleads | 6039d08e2d85850a46a70f24359d362ffde2f7ed | [
"Apache-2.0"
] | 2 | 2019-07-11T13:01:56.000Z | 2019-07-11T13:01:58.000Z | examples/ad_manager/v201805/report_service/run_delivery_report.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201805/report_service/run_delivery_report.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | 1 | 2020-07-19T14:24:05.000Z | 2020-07-19T14:24:05.000Z | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 33.629213 | 78 | 0.697294 |
"""Runs a report similar to the "Orders report" on the Ad Manager website.
Includes additional attributes and can filter to include just one order.
"""
from datetime import datetime
from datetime import timedelta
import tempfile
from googleads import ad_manager
from googleads import errors
ORDER_ID = 'INSERT_ORDER... | false | true |
f7795ee004f988bdf6fadff57b0b98ef530da4a8 | 47,883 | py | Python | tensorflow/python/eager/backprop.py | abhiram-krishnan/tensorflow | 76069c136cd5042ee8021a7dc15ef591244e5a73 | [
"Apache-2.0"
] | 1 | 2021-05-07T07:27:58.000Z | 2021-05-07T07:27:58.000Z | tensorflow/python/eager/backprop.py | abhiram-krishnan/tensorflow | 76069c136cd5042ee8021a7dc15ef591244e5a73 | [
"Apache-2.0"
] | 4 | 2018-09-04T23:40:36.000Z | 2019-01-30T20:06:11.000Z | tensorflow/python/eager/backprop.py | abhiram-krishnan/tensorflow | 76069c136cd5042ee8021a7dc15ef591244e5a73 | [
"Apache-2.0"
] | 1 | 2019-09-20T15:51:16.000Z | 2019-09-20T15:51:16.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.385258 | 97 | 0.679176 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import operator
import sys
import six
from tensorflow.python import pywrap_tfe
from tensorflow.python import _pywrap_utils
from tensorflow.python.eager import backprop_util
from tensorflow.... | true | true |
f779605bf8a0b39496f231fe979a0dc071613b64 | 1,478 | py | Python | examples/invitation_project/urls.py | mentionllc/django-invitation | af2adf734bb354ae1aadc4dd85b8fb98c6bcd14e | [
"BSD-3-Clause"
] | 2 | 2016-08-24T02:23:12.000Z | 2018-08-09T16:57:41.000Z | examples/invitation_project/urls.py | mentionllc/django-invitation | af2adf734bb354ae1aadc4dd85b8fb98c6bcd14e | [
"BSD-3-Clause"
] | 1 | 2019-10-04T13:17:52.000Z | 2019-10-04T13:17:52.000Z | examples/invitation_project/urls.py | mentionllc/django-invitation | af2adf734bb354ae1aadc4dd85b8fb98c6bcd14e | [
"BSD-3-Clause"
] | 4 | 2018-01-16T04:39:21.000Z | 2021-05-17T17:11:28.000Z | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from registration.forms import RegistrationFormTermsOfService
from invitation.views import register
admin.autodiscover()
# Change URLs given the INVITE_MODE setting, useful for tests
if getattr(settings, 'INVITE... | 41.055556 | 106 | 0.481732 | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from registration.forms import RegistrationFormTermsOfService
from invitation.views import register
admin.autodiscover()
if getattr(settings, 'INVITE_MODE', False):
urlpatterns = patterns('',
url(r'^... | true | true |
f779607df5b7366de7fe30bd47494df411dcadf9 | 26,244 | py | Python | nodestored.py | ewindisch/nodestored | 463aaef1485df4b564a167f4c6184be71f63b72e | [
"Apache-2.0"
] | 1 | 2019-01-10T05:48:03.000Z | 2019-01-10T05:48:03.000Z | nodestored.py | ewindisch/nodestored | 463aaef1485df4b564a167f4c6184be71f63b72e | [
"Apache-2.0"
] | null | null | null | nodestored.py | ewindisch/nodestored | 463aaef1485df4b564a167f4c6184be71f63b72e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.6
# nodestored.py - block storage access API
# renamed from gt-xm-storage.py
# refactored from gt-xm-reimage0.py
# refactored from original gt-xm-reimage0 shell script
#
# Copyright (C) 2006-2011 Eric Windisch
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... | 28.619411 | 80 | 0.550678 | import sys
import subprocess
import shutil
import os
import signal
import stat
import time
try:
import simplejson as json
except ImportError:
import json
import urllib2
import ftplib
import mimetypes
import bz2
import tarfile
import random
import base64
from twisted.python.filepath import FilePath
import Co... | true | true |
f77961785f5b1f80dfc71324a90abd168bc58a19 | 842 | py | Python | Algos/subsets.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Algos/subsets.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Algos/subsets.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | s = [1, 2, 3]
class SetOps(object):
def __init__(self, s):
self.set = s
def subsets(self):
n = len(self.set)
# each set has 0 to 2^(n - 1) subsets (total of 2^n)
for i in range(pow(2, n)):
subset = []
# this bit masks each of n bits to find which eleme... | 22.756757 | 70 | 0.495249 | s = [1, 2, 3]
class SetOps(object):
def __init__(self, s):
self.set = s
def subsets(self):
n = len(self.set)
for i in range(pow(2, n)):
subset = []
for j in range(n):
if i & (1 << j) > 0:
subs... | false | true |
f77961d2965243e61dfa151adfaaff363f625e62 | 3,223 | py | Python | Dassl/dassl/data/datasets/dg/digits_dg.py | xch-liu/geom-tex-dg | 59a93684ae13e7d962908e9971fcbfba66d90b80 | [
"MIT"
] | 1 | 2021-12-30T08:37:53.000Z | 2021-12-30T08:37:53.000Z | Dassl/dassl/data/datasets/dg/digits_dg.py | xch-liu/geom-tex-dg | 59a93684ae13e7d962908e9971fcbfba66d90b80 | [
"MIT"
] | null | null | null | Dassl/dassl/data/datasets/dg/digits_dg.py | xch-liu/geom-tex-dg | 59a93684ae13e7d962908e9971fcbfba66d90b80 | [
"MIT"
] | null | null | null | import glob
import os.path as osp
from dassl.utils import listdir_nohidden
from ..build import DATASET_REGISTRY
from ..base_dataset import Datum, DatasetBase
@DATASET_REGISTRY.register()
class DigitsDG(DatasetBase):
"""Digits-DG.
It contains 4 digit datasets:
- MNIST: hand-written digits.
-... | 33.226804 | 81 | 0.599442 | import glob
import os.path as osp
from dassl.utils import listdir_nohidden
from ..build import DATASET_REGISTRY
from ..base_dataset import Datum, DatasetBase
@DATASET_REGISTRY.register()
class DigitsDG(DatasetBase):
dataset_dir = 'digits_dg'
domains = ['mnist', 'mnist_m', 'svhn', 'syn']
data_url = 'http... | true | true |
f779629ccb146781f5141bd086a2b3fe4b2aa26b | 504 | py | Python | Ex4.py | Ma-Min-Min/coding-sprint | f2bdc7e8315ac5b1926574e5bb634fd1959b4080 | [
"MIT"
] | null | null | null | Ex4.py | Ma-Min-Min/coding-sprint | f2bdc7e8315ac5b1926574e5bb634fd1959b4080 | [
"MIT"
] | null | null | null | Ex4.py | Ma-Min-Min/coding-sprint | f2bdc7e8315ac5b1926574e5bb634fd1959b4080 | [
"MIT"
] | null | null | null | cars = 100
space_in_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_car
average_passengers_per_car = passengers / cars_driven
print("There are", cars, "cars available")
print("There are only", drivers, "drivers available")
print("T... | 36 | 72 | 0.771825 | cars = 100
space_in_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_car
average_passengers_per_car = passengers / cars_driven
print("There are", cars, "cars available")
print("There are only", drivers, "drivers available")
print("T... | true | true |
f77963c1a9336ce94dd29f8b6263684e8b084e12 | 1,437 | py | Python | RiskAssessment.py | VisExcell/riskmodels | 012bbfd563482ba09585cd042b1f9465253ab1f4 | [
"MIT"
] | 2 | 2019-11-04T20:57:11.000Z | 2021-04-08T08:05:45.000Z | RiskAssessment.py | VisExcell/riskmodels | 012bbfd563482ba09585cd042b1f9465253ab1f4 | [
"MIT"
] | null | null | null | RiskAssessment.py | VisExcell/riskmodels | 012bbfd563482ba09585cd042b1f9465253ab1f4 | [
"MIT"
] | 2 | 2020-09-22T17:05:04.000Z | 2021-02-05T17:12:28.000Z | import datetime
import numpy as np
"""
Class to define a 'RiskAssessment' from FHIR.
Currently only produces JSON.
{
"date": date assesment was made in ISO format yyyy-mm-dd,
"results": {
"five_year_abs": Five year Absolute Risk for this patient as decimal
"five_year_ave"... | 35.04878 | 88 | 0.599861 | import datetime
import numpy as np
class BasicRiskAssessment:
def __init__(self):
self.resourceType = "RiskAssessment"
self.date = datetime.date.today().isoformat()
self.fiveyearABS = np.float64(-1)
self.fiveyearAVE = np.float64(-1)
self.lifetimeABS = np.float64(-1)... | true | true |
f77963c5a8393f108a9fab9d05d78a223d8db093 | 1,175 | py | Python | django_day05/article/views.py | maoxuelin083/Django-Study | 6eb332a97c898b11e6d1c1faf80dbb14f4f835c6 | [
"Apache-2.0"
] | null | null | null | django_day05/article/views.py | maoxuelin083/Django-Study | 6eb332a97c898b11e6d1c1faf80dbb14f4f835c6 | [
"Apache-2.0"
] | null | null | null | django_day05/article/views.py | maoxuelin083/Django-Study | 6eb332a97c898b11e6d1c1faf80dbb14f4f835c6 | [
"Apache-2.0"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
from article.models import Article, Categroy, Tag
from frontuser.models import User, UserExtendsion
def index(request):
user = User(name="小红")
user.save()
category = Categroy(name='中国古典文学')
category.sav... | 29.375 | 74 | 0.68766 | from django.http import HttpResponse
from django.shortcuts import render
from article.models import Article, Categroy, Tag
from frontuser.models import User, UserExtendsion
def index(request):
user = User(name="小红")
user.save()
category = Categroy(name='中国古典文学')
category.save()
return HttpRespons... | true | true |
f779654659a1277929cef4c24cd6bfe82c2f1cab | 7,378 | py | Python | src/build/fuchsia/device_target_test.py | Chilledheart/naiveproxy | 9d28da89b325a90d33add830f4202c8b17c7c3e3 | [
"BSD-3-Clause"
] | null | null | null | src/build/fuchsia/device_target_test.py | Chilledheart/naiveproxy | 9d28da89b325a90d33add830f4202c8b17c7c3e3 | [
"BSD-3-Clause"
] | null | null | null | src/build/fuchsia/device_target_test.py | Chilledheart/naiveproxy | 9d28da89b325a90d33add830f4202c8b17c7c3e3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env vpython3
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests scenarios with number of devices and invalid devices"""
import subprocess
import unittest
import unittest.mock as mock
from a... | 49.186667 | 79 | 0.707238 | import subprocess
import unittest
import unittest.mock as mock
from argparse import Namespace
from device_target import DeviceTarget
from target import Target, FuchsiaTargetException
class TestDiscoverDeviceTarget(unittest.TestCase):
def setUp(self):
self.args = Namespace(out_dir='out/fuchsia',
... | true | true |
f77965b9d504e810a2f75ebbb283dd6e56360176 | 2,268 | py | Python | doppel/PackageAPI.py | bburns632/doppel-cli | e0c708f565db0f558bca6f2fbe28a41d45121344 | [
"BSD-3-Clause"
] | null | null | null | doppel/PackageAPI.py | bburns632/doppel-cli | e0c708f565db0f558bca6f2fbe28a41d45121344 | [
"BSD-3-Clause"
] | null | null | null | doppel/PackageAPI.py | bburns632/doppel-cli | e0c708f565db0f558bca6f2fbe28a41d45121344 | [
"BSD-3-Clause"
] | null | null | null | import json
def _log_info(msg):
print(msg)
class PackageAPI():
"""Package API class
This class is used to hold the interface of a given package
being analyzed by doppel. It's comparison operators enable comparison
between interfaces and its standard JSON format allows this comparison
to hap... | 27.658537 | 97 | 0.643739 | import json
def _log_info(msg):
print(msg)
class PackageAPI():
def __init__(self, pkg_dict: dict):
self._validate_pkg(pkg_dict)
self.pkg_dict = pkg_dict
@classmethod
def from_json(cls, filename: str):
_log_info("Creating package from {}".format(filename))
... | true | true |
f77966b25ada42e4395371f01deda1071d607dfe | 672 | py | Python | congregation/config/config.py | CCD-HRI/congregation | a552856b03a64a4295792184107c4e529ca3f4ae | [
"MIT"
] | 3 | 2020-10-05T16:30:15.000Z | 2021-01-22T13:38:02.000Z | congregation/config/config.py | CCD-HRI/congregation | a552856b03a64a4295792184107c4e529ca3f4ae | [
"MIT"
] | null | null | null | congregation/config/config.py | CCD-HRI/congregation | a552856b03a64a4295792184107c4e529ca3f4ae | [
"MIT"
] | 1 | 2021-02-19T12:40:57.000Z | 2021-02-19T12:40:57.000Z | from congregation.config.network import NetworkConfig
from congregation.config.codegen import CodeGenConfig, JiffConfig
class Config:
def __init__(self):
self.system_configs = {}
def add_config(self, cfg: [NetworkConfig, CodeGenConfig, JiffConfig]):
self.system_configs[cfg.cfg_key] = cfg
... | 24.888889 | 74 | 0.681548 | from congregation.config.network import NetworkConfig
from congregation.config.codegen import CodeGenConfig, JiffConfig
class Config:
def __init__(self):
self.system_configs = {}
def add_config(self, cfg: [NetworkConfig, CodeGenConfig, JiffConfig]):
self.system_configs[cfg.cfg_key] = cfg
... | true | true |
f77967169a6106946dcea22241c3670d9be77597 | 2,165 | py | Python | test/test_get_status_from_s3_path.py | oslokommune/dataplatform-status-api | f19845697d1a2c2592a3fa18bade2b70014c3aa1 | [
"MIT"
] | null | null | null | test/test_get_status_from_s3_path.py | oslokommune/dataplatform-status-api | f19845697d1a2c2592a3fa18bade2b70014c3aa1 | [
"MIT"
] | null | null | null | test/test_get_status_from_s3_path.py | oslokommune/dataplatform-status-api | f19845697d1a2c2592a3fa18bade2b70014c3aa1 | [
"MIT"
] | null | null | null | import json
from status.get_status_from_s3_path import handler
from status.StatusData import StatusData
import test.test_data as test_data
# s3path: echo -n "my/path/to/file (2020).xlsx" | base64
event = {
"headers": {"Authorization": f"bearer {test_data.bearer_token_with_access}"},
"pathParameters": {"s3_pat... | 36.083333 | 84 | 0.630485 | import json
from status.get_status_from_s3_path import handler
from status.StatusData import StatusData
import test.test_data as test_data
event = {
"headers": {"Authorization": f"bearer {test_data.bearer_token_with_access}"},
"pathParameters": {"s3_path": "bXkvcGF0aC90by9maWxlICgyMDIwKS54bHN4"},
}
empty_cont... | true | true |
f7796a989bdd258bec7902dd5290b418ab45666b | 1,645 | py | Python | continual_learning/scenarios/utils.py | jaryP/ContinualAI | 7d9b7614066d219ebd72049692da23ad6ec132b0 | [
"MIT"
] | null | null | null | continual_learning/scenarios/utils.py | jaryP/ContinualAI | 7d9b7614066d219ebd72049692da23ad6ec132b0 | [
"MIT"
] | null | null | null | continual_learning/scenarios/utils.py | jaryP/ContinualAI | 7d9b7614066d219ebd72049692da23ad6ec132b0 | [
"MIT"
] | null | null | null | from typing import Sequence, Union
import numpy as np
from scipy.ndimage.interpolation import rotate as np_rotate
from PIL.Image import Image
from torch import Tensor, tensor
from torchvision.transforms.functional import rotate
class ImageRotation(object):
def __init__(self, degree):
self.degree = degree... | 33.571429 | 73 | 0.612766 | from typing import Sequence, Union
import numpy as np
from scipy.ndimage.interpolation import rotate as np_rotate
from PIL.Image import Image
from torch import Tensor, tensor
from torchvision.transforms.functional import rotate
class ImageRotation(object):
def __init__(self, degree):
self.degree = degree... | true | true |
f7796bb743782ffd2ec63015e8d40b90ea9560e4 | 6,223 | py | Python | emukit/quadrature/acquisitions/squared_correlation.py | alexgessner/emukit | 355e26bb30edd772a81af2a1267c569d7f446d42 | [
"Apache-2.0"
] | 6 | 2019-06-02T21:23:27.000Z | 2020-02-17T09:46:30.000Z | emukit/quadrature/acquisitions/squared_correlation.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 4 | 2019-05-17T13:30:21.000Z | 2019-06-21T13:49:19.000Z | emukit/quadrature/acquisitions/squared_correlation.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 1 | 2020-01-12T19:50:44.000Z | 2020-01-12T19:50:44.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from scipy.linalg import lapack
from typing import Tuple
from ...core.acquisition import Acquisition
from ...quadrature.methods import VanillaBayesianQuadrature
class SquaredCorrelatio... | 43.215278 | 119 | 0.675719 |
import numpy as np
from scipy.linalg import lapack
from typing import Tuple
from ...core.acquisition import Acquisition
from ...quadrature.methods import VanillaBayesianQuadrature
class SquaredCorrelation(Acquisition):
def __init__(self, model: VanillaBayesianQuadrature):
self.model = model
def h... | true | true |
f7796cf5158f92be2f67962678102d3951f4bf5e | 13,450 | py | Python | main/rssgen.py | 2502302255/al789 | 20828306da7a301f4b287ec9c72eb2eae9273188 | [
"MIT"
] | 28 | 2017-10-26T12:01:35.000Z | 2021-01-01T09:32:46.000Z | main/rssgen.py | 2502302255/al789 | 20828306da7a301f4b287ec9c72eb2eae9273188 | [
"MIT"
] | 1 | 2018-02-04T03:33:48.000Z | 2018-05-08T22:30:01.000Z | main/rssgen.py | 2502302255/al789 | 20828306da7a301f4b287ec9c72eb2eae9273188 | [
"MIT"
] | 1 | 2018-12-02T07:47:34.000Z | 2018-12-02T07:47:34.000Z | # -*- coding: utf-8 -*-
__author__ = 'Shinobu Jamella Hoshino, https://github.com/Boneflame/gpipe43'
import urlfetch_ps, urllib_ps, Entdecker
from remove_control_characters import remove_control_characters
import chardet
import random
import re
import urlparse
import threading
import time
from lxml import etree
from l... | 50.56391 | 187 | 0.578736 | __author__ = 'Shinobu Jamella Hoshino, https://github.com/Boneflame/gpipe43'
import urlfetch_ps, urllib_ps, Entdecker
from remove_control_characters import remove_control_characters
import chardet
import random
import re
import urlparse
import threading
import time
from lxml import etree
from lxml.etree import CDATA
f... | true | true |
f7796d1e7aebc4a53a37a85733c476df23a660ff | 1,933 | py | Python | examples/dfp/v201403/company_service/create_companies.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201403/company_service/create_companies.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201403/company_service/create_companies.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 29.287879 | 78 | 0.699431 |
__author__ = ('Nicholas Chen',
'Joseph DiLallo')
import uuid
from googleads import dfp
def main(client):
company_service = client.GetService('CompanyService', version='v201403')
companies = [
{
'name': 'Advertiser #%s' % uuid.uuid4(),
'type': 'ADVERTISER'
},
... | true | true |
f7796d504792adb029bb1a71bd46be4ade4af258 | 1,128 | py | Python | blog/tests.py | LeonardA-L/plog | 2cb479f01b7e8ad117669e57b5d3d612d330b9dd | [
"Apache-2.0"
] | null | null | null | blog/tests.py | LeonardA-L/plog | 2cb479f01b7e8ad117669e57b5d3d612d330b9dd | [
"Apache-2.0"
] | null | null | null | blog/tests.py | LeonardA-L/plog | 2cb479f01b7e8ad117669e57b5d3d612d330b9dd | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from datetime import datetime, timedelta
from django.utils.dateparse import parse_date
from blog.models import Article
from blog.tools import *
# Create your tests here.
class ArticleTests(TestCase):
def test_future_article_will_be_public(self):
p = Article(title='test', content='... | 34.181818 | 120 | 0.748227 | from django.test import TestCase
from datetime import datetime, timedelta
from django.utils.dateparse import parse_date
from blog.models import Article
from blog.tools import *
class ArticleTests(TestCase):
def test_future_article_will_be_public(self):
p = Article(title='test', content='test', draft=False, date =... | true | true |
f7796de16c3ece39ec7904411c6e5f51535ec3a4 | 21,464 | py | Python | empower/apps/pollers/ns3_m5p_model.py | EstefaniaCC/empower-runtime-old-LTE-WiFi | 445bd29d36a58d031ed6cca8721ad0e3c94bfdd1 | [
"Apache-2.0"
] | null | null | null | empower/apps/pollers/ns3_m5p_model.py | EstefaniaCC/empower-runtime-old-LTE-WiFi | 445bd29d36a58d031ed6cca8721ad0e3c94bfdd1 | [
"Apache-2.0"
] | null | null | null | empower/apps/pollers/ns3_m5p_model.py | EstefaniaCC/empower-runtime-old-LTE-WiFi | 445bd29d36a58d031ed6cca8721ad0e3c94bfdd1 | [
"Apache-2.0"
] | 1 | 2021-06-15T12:35:00.000Z | 2021-06-15T12:35:00.000Z | #!/usr/bin/env python3
from copy import copy
class SimulatorM5PModel:
def __init__(self, last_mcs, last_length, cur_mcs, statistics):
self.max_length_th = dict()
self.candidates = []
self._last_mcs = last_mcs
self._last_length = last_length
self._cur_mcs = cur_mcs
self._statistics = statistics
self.s... | 30.44539 | 155 | 0.700568 | from copy import copy
class SimulatorM5PModel:
def __init__(self, last_mcs, last_length, cur_mcs, statistics):
self.max_length_th = dict()
self.candidates = []
self._last_mcs = last_mcs
self._last_length = last_length
self._cur_mcs = cur_mcs
self._statistics = statistics
self.success_tx_global_channe... | true | true |
f779702366a1802098a92429dd20a39066abeafa | 282 | py | Python | linked_list_unit_test_remove_dups.py | basusaptarshi89/data_structure_with_python | 76eb9c34767e4a3acb178ec079ff3cf082f2a119 | [
"MIT"
] | null | null | null | linked_list_unit_test_remove_dups.py | basusaptarshi89/data_structure_with_python | 76eb9c34767e4a3acb178ec079ff3cf082f2a119 | [
"MIT"
] | null | null | null | linked_list_unit_test_remove_dups.py | basusaptarshi89/data_structure_with_python | 76eb9c34767e4a3acb178ec079ff3cf082f2a119 | [
"MIT"
] | null | null | null | import linked_list
llist = linked_list.LinkedList()
llist.add(10)
llist.add(10)
llist.add(11)
llist.add(12)
llist.add(13)
llist.add(13)
llist.add(13)
llist.add(14)
llist.add(14)
print(f'List: {llist}')
llist.remove_duplicate()
print('Removed duplicates')
print(f'List: {llist}')
| 14.842105 | 32 | 0.730496 | import linked_list
llist = linked_list.LinkedList()
llist.add(10)
llist.add(10)
llist.add(11)
llist.add(12)
llist.add(13)
llist.add(13)
llist.add(13)
llist.add(14)
llist.add(14)
print(f'List: {llist}')
llist.remove_duplicate()
print('Removed duplicates')
print(f'List: {llist}')
| true | true |
f77970d43370933ade2ee3b396b13347e898f55a | 814 | py | Python | TeamX/TeamXapp/migrations/0057_auto_20190715_1130.py | rootfinlay/SageTeamX | cf4cde3360c8cccb8a727ba64d66345805d7a0ed | [
"Unlicense"
] | null | null | null | TeamX/TeamXapp/migrations/0057_auto_20190715_1130.py | rootfinlay/SageTeamX | cf4cde3360c8cccb8a727ba64d66345805d7a0ed | [
"Unlicense"
] | null | null | null | TeamX/TeamXapp/migrations/0057_auto_20190715_1130.py | rootfinlay/SageTeamX | cf4cde3360c8cccb8a727ba64d66345805d7a0ed | [
"Unlicense"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-15 10:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('TeamXapp', '0056_auto_20190715_1130'),
]
operations = [
migrations.AlterField(
model_name='allm... | 32.56 | 158 | 0.658477 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('TeamXapp', '0056_auto_20190715_1130'),
]
operations = [
migrations.AlterField(
model_name='allmembers',
name='scrum_team_name',
... | true | true |
f7797138e11e66d0436ec17b9627f7d382cdcb5a | 114 | py | Python | code_file_examples/delete_keys_starting_with_foo.py | guillemlc/hiera-bulk-edit | 1fe8f1124e7a65738060c63cb7cf1d2901df070c | [
"MIT"
] | 5 | 2016-09-07T07:17:45.000Z | 2021-03-15T15:45:42.000Z | code_file_examples/delete_keys_starting_with_foo.py | guillemlc/hiera-bulk-edit | 1fe8f1124e7a65738060c63cb7cf1d2901df070c | [
"MIT"
] | 1 | 2017-08-15T06:44:43.000Z | 2017-08-15T06:44:43.000Z | code_file_examples/delete_keys_starting_with_foo.py | guillemlc/hiera-bulk-edit | 1fe8f1124e7a65738060c63cb7cf1d2901df070c | [
"MIT"
] | 4 | 2017-05-16T14:19:14.000Z | 2020-06-10T09:43:09.000Z | # Delete all keys that start with 'foo'.
for k in hiera.keys():
if k.startswith('foo'):
hiera.pop(k)
| 19 | 40 | 0.605263 |
for k in hiera.keys():
if k.startswith('foo'):
hiera.pop(k)
| true | true |
f779734b07db7a13d079f104af8fa4f3034ba40c | 1,630 | py | Python | 106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal/solution02.py | Eroica-cpp/LeetCode | 07276bd11558f3d0e32bec768b09e886de145f9e | [
"CC-BY-3.0",
"MIT"
] | 7 | 2015-05-05T22:21:30.000Z | 2021-03-13T04:04:15.000Z | 106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal/solution02.py | Eroica-cpp/LeetCode | 07276bd11558f3d0e32bec768b09e886de145f9e | [
"CC-BY-3.0",
"MIT"
] | null | null | null | 106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal/solution02.py | Eroica-cpp/LeetCode | 07276bd11558f3d0e32bec768b09e886de145f9e | [
"CC-BY-3.0",
"MIT"
] | 2 | 2018-12-26T08:13:25.000Z | 2020-07-18T20:18:24.000Z | #!/usr/bin/python
"""
==============================================================================
Author: Tao Li (taoli@ucsd.edu)
Date: Jun 23, 2015
Question: 106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal
Link: https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-... | 34.680851 | 99 | 0.534969 |
class Solution:
def buildTree(self, inorder, postorder):
size = len(inorder)
return self.construct(inorder, postorder, 0, size-1, 0, size-1)
def construct(self, inorder, postorder, s1, e1, s2, e2):
if s1 > e1 or s2 > e2:
return
root = TreeNode(postorde... | true | true |
f7797453405ffff66ffa47fba89f3dcdaf948952 | 6,174 | py | Python | neurokit2/complexity/optim_complexity_k.py | BelleJohn/neuropsychology-NeuroKit | d01111b9b82364d28da01c002e6cbfc45d9493d9 | [
"MIT"
] | 1 | 2022-03-05T06:15:02.000Z | 2022-03-05T06:15:02.000Z | neurokit2/complexity/optim_complexity_k.py | BelleJohn/neuropsychology-NeuroKit | d01111b9b82364d28da01c002e6cbfc45d9493d9 | [
"MIT"
] | null | null | null | neurokit2/complexity/optim_complexity_k.py | BelleJohn/neuropsychology-NeuroKit | d01111b9b82364d28da01c002e6cbfc45d9493d9 | [
"MIT"
] | null | null | null | from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from ..misc import NeuroKitWarning, find_plateau
def complexity_k(signal, k_max="max", show=False):
"""Automated selection of the optimal k_max parameter for Higuchi Fractal Dimension (HFD).
The optimal kmax is... | 35.895349 | 124 | 0.598963 | from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from ..misc import NeuroKitWarning, find_plateau
def complexity_k(signal, k_max="max", show=False):
if isinstance(k_max, str): k_max = int(np.floor(len(signal) / 2))
if isinstance(k_ma... | true | true |
f7797458dad18a14a1b54098e0b503e28f3451ae | 9,865 | py | Python | kinto/core/events.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | kinto/core/events.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | kinto/core/events.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | import logging
import warnings
from collections import OrderedDict
import transaction
from pyramid.events import NewRequest
import pyramid.tweens
from enum import Enum
from kinto.core.utils import strip_uri_prefix
logger = logging.getLogger(__name__)
class ACTIONS(Enum):
CREATE = "create"
DELETE = "delete... | 33.104027 | 103 | 0.668018 | import logging
import warnings
from collections import OrderedDict
import transaction
from pyramid.events import NewRequest
import pyramid.tweens
from enum import Enum
from kinto.core.utils import strip_uri_prefix
logger = logging.getLogger(__name__)
class ACTIONS(Enum):
CREATE = "create"
DELETE = "delete... | true | true |
f77974ac35e474365eb9dfc9386434bb7f292b02 | 465 | py | Python | packages/python/plotly/plotly/validators/mesh3d/_hovertemplate.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/mesh3d/_hovertemplate.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/mesh3d/_hovertemplate.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class HovertemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="hovertemplate", parent_name="mesh3d", **kwargs):
super(HovertemplateValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | 35.769231 | 84 | 0.673118 | import _plotly_utils.basevalidators
class HovertemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="hovertemplate", parent_name="mesh3d", **kwargs):
super(HovertemplateValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | true | true |
f779784b3a9d96e8112fe0719f31315935cc785c | 1,287 | py | Python | scripts/convert_model.py | c3sr/go-pytorch | 0d1f6edbc6e48f0f68055274af0997e2ff9b0ce1 | [
"Apache-2.0"
] | 14 | 2018-11-26T18:33:27.000Z | 2021-12-17T11:14:33.000Z | scripts/convert_model.py | c3sr/go-pytorch | 0d1f6edbc6e48f0f68055274af0997e2ff9b0ce1 | [
"Apache-2.0"
] | 7 | 2019-04-02T16:46:01.000Z | 2020-06-10T02:02:33.000Z | scripts/convert_model.py | c3sr/go-pytorch | 0d1f6edbc6e48f0f68055274af0997e2ff9b0ce1 | [
"Apache-2.0"
] | 3 | 2019-07-16T16:47:07.000Z | 2021-12-29T07:47:59.000Z | import pretrainedmodels as pm
import torch
# models giving an error
errored_model_name = ['fbresnet152', 'bninception', 'inceptionv4', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
# collect all (model, pretrained) tuples
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_... | 40.21875 | 128 | 0.749029 | import pretrainedmodels as pm
import torch
errored_model_name = ['fbresnet152', 'bninception', 'inceptionv4', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_settings[model_name]:
if pretrained in ['imagenet', 'imagenet+5k... | true | true |
f77978c23c7c0b9fe11a1de991f2ff23eb864074 | 12,843 | py | Python | examples/nw/db/models.py | valhuber/LogicBank | 0df8790395fe260778e910badcc15fba49c23e96 | [
"BSD-3-Clause"
] | 39 | 2020-10-14T02:23:59.000Z | 2022-02-11T14:08:46.000Z | examples/nw/db/models.py | valhuber/LogicBank | 0df8790395fe260778e910badcc15fba49c23e96 | [
"BSD-3-Clause"
] | 7 | 2020-10-14T23:59:49.000Z | 2022-03-16T16:25:43.000Z | examples/nw/db/models.py | valhuber/LogicBank | 0df8790395fe260778e910badcc15fba49c23e96 | [
"BSD-3-Clause"
] | 7 | 2020-10-17T02:59:51.000Z | 2022-03-26T08:56:46.000Z | # coding: utf-8
"""
WARNING: used in logic, but FAB uses version in basic_web_app/app
The primary copy is here -- copy changes to basic_web_app/app.
on relationships...
* declare them in the parent (not child), eg, for Order:
* OrderDetailList = relationship("OrderDetail", backref="OrderHeader", cascade_backref... | 33.358442 | 127 | 0.687923 |
from logic_bank import logic_bank
from sqlalchemy import Boolean, Column, DECIMAL, DateTime, Float, ForeignKey, Integer, LargeBinary, String, \
UniqueConstraint, select, func
from sqlalchemy.orm import relationship, column_property
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.testing ... | true | true |
f77978e419106e84023931bc73937d51295b87f8 | 1,231 | py | Python | dkr-py310/docker-student-portal-310/course_files/python_for_excel_users/basic_operations/spreadsheet_functions.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/python_for_excel_users/basic_operations/spreadsheet_functions.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/python_for_excel_users/basic_operations/spreadsheet_functions.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | import os
import pandas as pd
from openpyxl import load_workbook
data_dir = "."
template = 'chartme_template.xlsx'
new_wkbk = 'chartme_data_added.xlsx'
tab_name = 'data'
ROWS_AXIS = 0
COLS_AXIS = 1
def normalize(series):
"""Accepts a column (a pandas.Series object) and returns a normalized
version. Op... | 22.381818 | 80 | 0.649878 | import os
import pandas as pd
from openpyxl import load_workbook
data_dir = "."
template = 'chartme_template.xlsx'
new_wkbk = 'chartme_data_added.xlsx'
tab_name = 'data'
ROWS_AXIS = 0
COLS_AXIS = 1
def normalize(series):
mean = series.mean()
sdev = series.std(ddof = 0) normalized = (series - mean) / sde... | true | true |
f7797903a399cb77e605227eb6fefcce481d6205 | 1,127 | py | Python | src/encapzulate/scripts/make_batches_dummy_data.py | galenvincent/encapZulate-1 | ed2d749befa64cb9e04aefb0cedee322a2614da2 | [
"MIT"
] | 3 | 2021-12-09T05:08:12.000Z | 2021-12-12T13:55:06.000Z | src/encapzulate/scripts/make_batches_dummy_data.py | galenvincent/encapZulate-1 | ed2d749befa64cb9e04aefb0cedee322a2614da2 | [
"MIT"
] | null | null | null | src/encapzulate/scripts/make_batches_dummy_data.py | galenvincent/encapZulate-1 | ed2d749befa64cb9e04aefb0cedee322a2614da2 | [
"MIT"
] | 1 | 2022-03-31T18:35:48.000Z | 2022-03-31T18:35:48.000Z | from pathlib import Path
import numpy as np
import pandas as pd
if "ihome" in str(Path.home()):
path_photoz = Path.home() / "photoz"
# path_photoz = Path("/bgfs") / "jnewman" / "bid13" / "photoZ"
elif "/Users/andrews" in str(Path.home()):
path_photoz = Path.home() / "projects" / "photoz"
path_pasquet2019... | 30.459459 | 84 | 0.694765 | from pathlib import Path
import numpy as np
import pandas as pd
if "ihome" in str(Path.home()):
path_photoz = Path.home() / "photoz"
elif "/Users/andrews" in str(Path.home()):
path_photoz = Path.home() / "projects" / "photoz"
path_pasquet2019 = path_photoz / "data" / "pasquet2019"
path_out = path_pasquet... | true | true |
f7797a8c8234cf234ab2a50f437b64bb1f3aef12 | 2,129 | py | Python | build_all/windows/release_device_client/setup.py | Sahithkallakunta/azure-iot-sdk-python | 40f8c790aa243cec68bb615380da0b72e6d408a6 | [
"MIT"
] | 1 | 2021-11-12T10:18:09.000Z | 2021-11-12T10:18:09.000Z | build_all/windows/release_device_client/setup.py | ma3u/azure-iot-sdk-python | 3e81e493135a2deaa9734764d02ece91889e797c | [
"MIT"
] | null | null | null | build_all/windows/release_device_client/setup.py | ma3u/azure-iot-sdk-python | 3e81e493135a2deaa9734764d02ece91889e797c | [
"MIT"
] | 1 | 2019-04-11T15:56:50.000Z | 2019-04-11T15:56:50.000Z | from setuptools import setup, Distribution
import sys
import os
class PlatformError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BinaryDistribution(Distribution):
def is_pure(self):
return False
#Get relative path to re... | 33.793651 | 101 | 0.673086 | from setuptools import setup, Distribution
import sys
import os
class PlatformError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class BinaryDistribution(Distribution):
def is_pure(self):
return False
file_dir = os.path.dirna... | true | true |
f7797ab35d7f9dd4d233a691d41b2528b2f475aa | 4,217 | py | Python | setup.py | bitranox/lib_registry | cffcdd6d41dc16b4fe9c58295d3208dc8efda870 | [
"MIT"
] | 1 | 2021-01-17T22:56:04.000Z | 2021-01-17T22:56:04.000Z | setup.py | bitranox/lib_registry | cffcdd6d41dc16b4fe9c58295d3208dc8efda870 | [
"MIT"
] | 2 | 2019-04-14T10:24:45.000Z | 2020-07-14T06:52:01.000Z | setup.py | bitranox/lib_registry | cffcdd6d41dc16b4fe9c58295d3208dc8efda870 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import codecs
import os
import pathlib
from typing import Any, List, Dict
from setuptools import setup # type: ignore
from setuptools import find_packages
def is_travis_deploy() -> bool:
if os.getenv("DEPLOY_SDIST", "") or os.getenv("DEPLOY_WHEEL", ""):
return is_tagged_commit()
... | 33.736 | 106 | 0.705715 |
import codecs
import os
import pathlib
from typing import Any, List, Dict
from setuptools import setup from setuptools import find_packages
def is_travis_deploy() -> bool:
if os.getenv("DEPLOY_SDIST", "") or os.getenv("DEPLOY_WHEEL", ""):
return is_tagged_commit()
else:
return False
def i... | true | true |
f7797b4c166df98dcfe6bf126d4376921f4d6089 | 1,696 | py | Python | homeassistant/components/surepetcare/entity.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 5 | 2020-10-08T12:59:44.000Z | 2021-12-28T06:46:25.000Z | homeassistant/components/surepetcare/entity.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 75 | 2020-08-05T07:22:42.000Z | 2022-03-23T21:54:57.000Z | homeassistant/components/surepetcare/entity.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 2 | 2020-09-09T05:01:51.000Z | 2020-09-09T05:46:12.000Z | """Entity for Surepetcare."""
from __future__ import annotations
from abc import abstractmethod
from surepy.entities import SurepyEntity
from homeassistant.core import callback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import SurePetcareDataCoordinator
from .const import DOMAIN
... | 31.407407 | 86 | 0.676887 | from __future__ import annotations
from abc import abstractmethod
from surepy.entities import SurepyEntity
from homeassistant.core import callback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import SurePetcareDataCoordinator
from .const import DOMAIN
class SurePetcareEntity(Coord... | true | true |
f7797b61845ff4c6164d11771976b62b025d6d7b | 8,459 | py | Python | flopz/arch/ia32/instructions.py | LuDubies/flopz | 3e11f44af40a105b886d0f44d6de505203e72ae2 | [
"Apache-2.0"
] | null | null | null | flopz/arch/ia32/instructions.py | LuDubies/flopz | 3e11f44af40a105b886d0f44d6de505203e72ae2 | [
"Apache-2.0"
] | null | null | null | flopz/arch/ia32/instructions.py | LuDubies/flopz | 3e11f44af40a105b886d0f44d6de505203e72ae2 | [
"Apache-2.0"
] | null | null | null | from bitstring import BitArray
from flopz.arch.instruction import Instruction
from flopz.arch.ia32.registers import IA32_Register
from flopz.arch.ia32.ia32_generic_arch import ProcessorMode
"""
Prefixes and Fields that make up IA-32 instructions
"""
# REX
class REX:
def __init__(self, w=0, r=0, x=0, b=0):
... | 32.786822 | 137 | 0.59286 | from bitstring import BitArray
from flopz.arch.instruction import Instruction
from flopz.arch.ia32.registers import IA32_Register
from flopz.arch.ia32.ia32_generic_arch import ProcessorMode
class REX:
def __init__(self, w=0, r=0, x=0, b=0):
if not all([0<=v<=1 for v in [w, r, x, b]]):
rai... | true | true |
f7797bd0e45ee86ac2fe5336d8c4e86198e334d2 | 3,881 | py | Python | docs/tutorials/pose/demo_simple_pose.py | Wondersui/gluon-cv | eeada0652f450a998b88a897f090a4aadadea14c | [
"Apache-2.0"
] | 62 | 2019-05-22T14:57:27.000Z | 2021-06-18T21:39:16.000Z | docs/tutorials/pose/demo_simple_pose.py | At1a8/gluon-cv | a990c2f148efccd3f7dc0cc0ccd81c03a0f91dd5 | [
"Apache-2.0"
] | 5 | 2019-07-15T11:26:43.000Z | 2020-07-17T18:51:01.000Z | docs/tutorials/pose/demo_simple_pose.py | At1a8/gluon-cv | a990c2f148efccd3f7dc0cc0ccd81c03a0f91dd5 | [
"Apache-2.0"
] | 11 | 2019-06-20T01:48:30.000Z | 2021-04-14T09:46:44.000Z | """1. Predict with pre-trained Simple Pose Estimation models
==========================================
This article shows how to play with pre-trained Simple Pose models with only a few
lines of code.
First let's import some necessary libraries:
"""
from matplotlib import pyplot as plt
from gluoncv import model_zoo... | 40.427083 | 89 | 0.64571 |
from matplotlib import pyplot as plt
from gluoncv import model_zoo, data, utils
from gluoncv.data.transforms.pose import detector_to_simple_pose, heatmap_to_coord
# dataset. We pick the one using ResNet-18 V1b as the base model. By specifying
# ``pretrained=True``, it will automatically download the model from the mo... | true | true |
f7797c30fc02b4154f074679ba78a27f26219acc | 5,934 | py | Python | tests/scripts/thread-cert/test_common.py | doublemis1/openthread | 2bb72299d3d91109247001116a1e15a3bbbf8f68 | [
"BSD-3-Clause"
] | 1 | 2022-03-18T11:20:13.000Z | 2022-03-18T11:20:13.000Z | tests/scripts/thread-cert/test_common.py | doublemis1/openthread | 2bb72299d3d91109247001116a1e15a3bbbf8f68 | [
"BSD-3-Clause"
] | 3 | 2017-03-30T22:36:13.000Z | 2020-05-29T15:04:28.000Z | tests/scripts/thread-cert/test_common.py | doublemis1/openthread | 2bb72299d3d91109247001116a1e15a3bbbf8f68 | [
"BSD-3-Clause"
] | 1 | 2016-07-05T14:44:21.000Z | 2016-07-05T14:44:21.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 32.075676 | 99 | 0.708628 | import random
import struct
import unittest
import ipaddress
import common
def any_eui64():
return bytearray([random.getrandbits(8) for _ in range(8)])
def any_rloc16_int():
return random.getrandbits(16)
def any_rloc16_bytearray():
return bytearray([random.getrandbits(8) for _ in range(2)])
def any... | true | true |
f7797c3fe5293cdbf73c99bb88b6232ab3d7e190 | 30,572 | py | Python | Sensor.py | limingwu8/PdM | 739b4b118f1c81fae704b15a9aa84d1f8c7b0196 | [
"MIT"
] | 28 | 2018-04-19T04:04:26.000Z | 2021-12-22T15:45:16.000Z | Sensor.py | junayed/Predictive-Maintenance | 739b4b118f1c81fae704b15a9aa84d1f8c7b0196 | [
"MIT"
] | 1 | 2021-09-14T10:45:19.000Z | 2021-09-14T10:45:19.000Z | Sensor.py | junayed/Predictive-Maintenance | 739b4b118f1c81fae704b15a9aa84d1f8c7b0196 | [
"MIT"
] | 21 | 2018-11-19T14:11:24.000Z | 2021-12-24T10:38:32.000Z | import matplotlib
# matplotlib.use('Agg')
from pandas import DataFrame
from pandas import Series
from pandas import concat
from pandas import read_csv
from pandas import datetime
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import MinMaxScaler
from keras.models import Se... | 45.15805 | 179 | 0.596984 | import matplotlib
from pandas import DataFrame
from pandas import Series
from pandas import concat
from pandas import read_csv
from pandas import datetime
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential,load_model
from... | true | true |
f7797d74039ac73b7bf864f3dbabfe008084ff09 | 9,966 | py | Python | fpga_topwrap/ipconnect.py | antmicro/topwrap | e9b2d41c0d7ce197b099ca06c67597c48b243e56 | [
"Apache-2.0"
] | 1 | 2021-12-08T06:26:54.000Z | 2021-12-08T06:26:54.000Z | fpga_topwrap/ipconnect.py | antmicro/topwrap | e9b2d41c0d7ce197b099ca06c67597c48b243e56 | [
"Apache-2.0"
] | null | null | null | fpga_topwrap/ipconnect.py | antmicro/topwrap | e9b2d41c0d7ce197b099ca06c67597c48b243e56 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021 Antmicro
# SPDX-License-Identifier: Apache-2.0
from os import path
from logging import warning, info, error
from nmigen import Elaboratable, Module, Signal, Instance, Fragment
from nmigen.hdl.ast import Const
from nmigen.build import Platform
from nmigen.back import verilog
from .ipwrapper import I... | 40.348178 | 80 | 0.588802 | from os import path
from logging import warning, info, error
from nmigen import Elaboratable, Module, Signal, Instance, Fragment
from nmigen.hdl.ast import Const
from nmigen.build import Platform
from nmigen.back import verilog
from .ipwrapper import IPWrapper
from .nm_helper import port_direction_to_prefix
from .fuse_... | true | true |
f7797ea8112962e4e5efc5238ac29ba9a0f2f57c | 13,422 | py | Python | utils/jobstats/jobstats.py | LynnKirby/swift | 11a8be196751f8f7c194bea83b5f4f8e6a7d5360 | [
"Apache-2.0"
] | 5 | 2019-12-03T13:50:04.000Z | 2021-11-14T12:59:48.000Z | utils/jobstats/jobstats.py | LynnKirby/swift | 11a8be196751f8f7c194bea83b5f4f8e6a7d5360 | [
"Apache-2.0"
] | null | null | null | utils/jobstats/jobstats.py | LynnKirby/swift | 11a8be196751f8f7c194bea83b5f4f8e6a7d5360 | [
"Apache-2.0"
] | 3 | 2017-08-28T13:45:21.000Z | 2018-06-28T10:53:37.000Z | #!/usr/bin/python
#
# ==-- jobstats - support for reading the contents of stats dirs --==#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/... | 36.177898 | 79 | 0.540158 |
import datetime
import itertools
import json
import os
import random
import re
class JobData(object):
def __init__(self, jobkind, jobid, module, jobargs):
self.jobkind = jobkind
self.jobid = jobid
self.module = module
self.jobargs = jobargs
(self.input, self.triple, self.... | true | true |
f7797fd14bd03456c5111a930898592e12a5ae87 | 48,619 | py | Python | tools/dom/scripts/htmldartgenerator.py | zhesha/sdk | 80f68a9f4c2af9cb3eef5e5a571b8f516fe319d3 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T03:26:26.000Z | 2021-04-12T03:26:26.000Z | tools/dom/scripts/htmldartgenerator.py | zhesha/sdk | 80f68a9f4c2af9cb3eef5e5a571b8f516fe319d3 | [
"BSD-3-Clause"
] | null | null | null | tools/dom/scripts/htmldartgenerator.py | zhesha/sdk | 80f68a9f4c2af9cb3eef5e5a571b8f516fe319d3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""This module provides shared functionality for the system to generate
dart:html APIs fr... | 46.128083 | 124 | 0.580925 | """This module provides shared functionality for the system to generate
dart:html APIs from the IDL database."""
import emitter
from generator import AnalyzeOperation, ConstantOutputOrder, \
DartDomNameOfAttribute, FindMatchingAttribute, IsPureInterface, \
TypeOrNothing, ConvertToFuture, GetCallbackInfo
from c... | false | true |
f779802d828090d3046ed64664d5559901ef1b12 | 5,462 | py | Python | hail/python/hailtop/hailctl/dataproc/describe.py | ovenfoot/hail | 425e779c0bde619bcf96838c09cc834de3c182fd | [
"MIT"
] | null | null | null | hail/python/hailtop/hailctl/dataproc/describe.py | ovenfoot/hail | 425e779c0bde619bcf96838c09cc834de3c182fd | [
"MIT"
] | 1 | 2020-10-22T07:57:56.000Z | 2020-10-22T07:57:56.000Z | hail/python/hailtop/hailctl/dataproc/describe.py | ovenfoot/hail | 425e779c0bde619bcf96838c09cc834de3c182fd | [
"MIT"
] | null | null | null | import json
from os import path
from zlib import decompress, MAX_WBITS
from subprocess import check_output
from statistics import median, mean, stdev
from collections import OrderedDict
SECTION_SEPARATOR = '-' * 40
IDENT = ' ' * 4
def parse_schema(s):
def parse_type(s, end_delimiter, element_type):
keys ... | 32.903614 | 120 | 0.543391 | import json
from os import path
from zlib import decompress, MAX_WBITS
from subprocess import check_output
from statistics import median, mean, stdev
from collections import OrderedDict
SECTION_SEPARATOR = '-' * 40
IDENT = ' ' * 4
def parse_schema(s):
def parse_type(s, end_delimiter, element_type):
keys ... | true | true |
f77980e03fa226a68302b3d379b202318f120f64 | 5,375 | py | Python | xfl2svg/color_effect.py | PluieElectrique/xfl2svg | 62e983fdbeea7d39d06f01c12b88fab0e97a619d | [
"MIT"
] | null | null | null | xfl2svg/color_effect.py | PluieElectrique/xfl2svg | 62e983fdbeea7d39d06f01c12b88fab0e97a619d | [
"MIT"
] | null | null | null | xfl2svg/color_effect.py | PluieElectrique/xfl2svg | 62e983fdbeea7d39d06f01c12b88fab0e97a619d | [
"MIT"
] | null | null | null | """Convert XFL color effects to SVG."""
from dataclasses import dataclass
import re
import xml.etree.ElementTree as ET
import warnings
HEX_COLOR = re.compile(r"#[A-Za-z0-9]{6}")
@dataclass(frozen=True)
class ColorEffect:
multiplier: tuple = (1, 1, 1, 1)
offset: tuple = (0, 0, 0, 0)
@classmethod
de... | 33.179012 | 80 | 0.487442 |
from dataclasses import dataclass
import re
import xml.etree.ElementTree as ET
import warnings
HEX_COLOR = re.compile(r"#[A-Za-z0-9]{6}")
@dataclass(frozen=True)
class ColorEffect:
multiplier: tuple = (1, 1, 1, 1)
offset: tuple = (0, 0, 0, 0)
@classmethod
def from_xfl(cls, element):
attrib... | true | true |
f779814518f15886799673d367254a6c9b8e9492 | 5,925 | py | Python | proxyunwebsense.py | kyokuheki/proxyunwebsense | cd4b9e845ecd671b2a7df07de194a111ddf25840 | [
"Apache-2.0"
] | null | null | null | proxyunwebsense.py | kyokuheki/proxyunwebsense | cd4b9e845ecd671b2a7df07de194a111ddf25840 | [
"Apache-2.0"
] | null | null | null | proxyunwebsense.py | kyokuheki/proxyunwebsense | cd4b9e845ecd671b2a7df07de194a111ddf25840 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import logging
import urllib.parse
import argparse
import requests
import lxml.html
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s %(name)s: %(funcName)s(%(lineno)d): %(message)s")
# logging.basicConfig(level=logging.DEBUG, f... | 34.051724 | 150 | 0.607764 |
import os
import logging
import urllib.parse
import argparse
import requests
import lxml.html
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s %(name)s: %(funcName)s(%(lineno)d): %(message)s")
logger = logging.getLogger("proxyunwebsence")
proxies = {}
DEFAULT_HEADERS = {
'User-A... | true | true |
f77981b92519d4101078de494e2731d94987dd07 | 245 | py | Python | src/scikit_hep_repo_review/__init__.py | henryiii/scikit-hep-review | 8601dd49d3d478170d31646a6b16b05caeba3891 | [
"BSD-3-Clause"
] | null | null | null | src/scikit_hep_repo_review/__init__.py | henryiii/scikit-hep-review | 8601dd49d3d478170d31646a6b16b05caeba3891 | [
"BSD-3-Clause"
] | 1 | 2022-03-23T02:26:41.000Z | 2022-03-23T02:26:41.000Z | src/scikit_hep_repo_review/__init__.py | henryiii/scikit-hep-repo-review | 8601dd49d3d478170d31646a6b16b05caeba3891 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2022 Henry Schreiner. All rights reserved.
scikit-hep-repo-review: Review repos for compliance to the Scikit-HEP developer guidelines
"""
from __future__ import annotations
__version__ = "0.3.0"
__all__ = ("__version__",)
| 18.846154 | 90 | 0.75102 |
from __future__ import annotations
__version__ = "0.3.0"
__all__ = ("__version__",)
| true | true |
f779827825fb070a34494b46fb10de6057936de6 | 10,931 | py | Python | Israel/Entregable5/entregable5.py | speed676/algoritmia_2018-2019 | db7c233420cc13c3d089f4aaeebf3cc1f6e2dfa2 | [
"MIT"
] | null | null | null | Israel/Entregable5/entregable5.py | speed676/algoritmia_2018-2019 | db7c233420cc13c3d089f4aaeebf3cc1f6e2dfa2 | [
"MIT"
] | null | null | null | Israel/Entregable5/entregable5.py | speed676/algoritmia_2018-2019 | db7c233420cc13c3d089f4aaeebf3cc1f6e2dfa2 | [
"MIT"
] | null | null | null | #####################################################################################################
# entregable5.py
#
# Version 1.2: corregido bug:
# - La imagen resultante no se guardaba como gif.
# Version 1.1: corregidos dos bugs:
# - Ahora el programa también funciona si el método get de la clase tkin... | 37.563574 | 123 | 0.544872 |
import sys
import tkinter
from copy import deepcopy
from typing import *
MatrixGrayImage = List[List[int]]
class PixelColor:
def __init__(self, r: int, g: int, b: int):
self.r, self.g, self.b = r, g, b
MatrixColorImage = List[List[PixelColor]]
class GrayImage:
def __init__(self, m: MatrixGrayIma... | true | true |
f7798287c989a3a56260f7f44f30c78c97313869 | 20,160 | py | Python | tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py | SKewLinez/tensorflow | 77d8c333405a080c57850c45531dbbf077b2bd0e | [
"Apache-2.0"
] | 1 | 2021-08-03T19:12:04.000Z | 2021-08-03T19:12:04.000Z | tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py | SKewLinez/tensorflow | 77d8c333405a080c57850c45531dbbf077b2bd0e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py | SKewLinez/tensorflow | 77d8c333405a080c57850c45531dbbf077b2bd0e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.607073 | 80 | 0.673661 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
from absl.testing import parameterized
import numpy as np
from tensorflow.python.data.experimental.ops import batching
from tensorflow.python.data.kernel_tests import checkpoint_test_base
from ten... | true | true |
f7798320e8aaf77190d78ef983905e2c44d566a3 | 127 | py | Python | libshipkore/__init__.py | ShipKore/libshipkore | e009b614952c32f9c23669ccf6e8ae7a9a58b1c6 | [
"MIT"
] | 6 | 2021-02-06T05:50:33.000Z | 2022-02-11T15:21:09.000Z | libshipkore/__init__.py | ShipKore/libshipkore | e009b614952c32f9c23669ccf6e8ae7a9a58b1c6 | [
"MIT"
] | 1 | 2021-02-11T15:58:33.000Z | 2021-02-11T16:01:18.000Z | libshipkore/__init__.py | ShipKore/libshipkore | e009b614952c32f9c23669ccf6e8ae7a9a58b1c6 | [
"MIT"
] | null | null | null | """Top-level package for libshipkore."""
__author__ = """Innerkore"""
__email__ = 'admin@innerkore.com'
__version__ = '0.2.2'
| 21.166667 | 40 | 0.692913 |
__author__ = """Innerkore"""
__email__ = 'admin@innerkore.com'
__version__ = '0.2.2'
| true | true |
f77983346a68e166f50727523f254d878dc10eb4 | 11,559 | py | Python | __init__.py | snisssen/fkl-skill | 7ca969d2d37449597e77fde66a7ebaf1aef7d436 | [
"MIT"
] | null | null | null | __init__.py | snisssen/fkl-skill | 7ca969d2d37449597e77fde66a7ebaf1aef7d436 | [
"MIT"
] | null | null | null | __init__.py | snisssen/fkl-skill | 7ca969d2d37449597e77fde66a7ebaf1aef7d436 | [
"MIT"
] | null | null | null | from importlib.metadata import requires
from wsgiref.validate import validator
from pkg_resources import safe_extra
from mycroft import MycroftSkill, intent_handler
from adapt.intent import IntentBuilder
from mycroft.util.format import join_list
from os.path import dirname, join
from lingua_franca.parse import fuzzy_m... | 36.695238 | 95 | 0.548144 | from importlib.metadata import requires
from wsgiref.validate import validator
from pkg_resources import safe_extra
from mycroft import MycroftSkill, intent_handler
from adapt.intent import IntentBuilder
from mycroft.util.format import join_list
from os.path import dirname, join
from lingua_franca.parse import fuzzy_m... | true | true |
f7798399e367e72f3e4cce59162f489da0244826 | 3,623 | py | Python | tests/cases/core/tests/paginator.py | murphyke/avocado | 62824bb2673d4cac81a15fee45fad60a8fe7622b | [
"BSD-2-Clause"
] | null | null | null | tests/cases/core/tests/paginator.py | murphyke/avocado | 62824bb2673d4cac81a15fee45fad60a8fe7622b | [
"BSD-2-Clause"
] | null | null | null | tests/cases/core/tests/paginator.py | murphyke/avocado | 62824bb2673d4cac81a15fee45fad60a8fe7622b | [
"BSD-2-Clause"
] | null | null | null | from django.test import TestCase
from avocado.core.paginator import BufferedPaginator
class BufferedPaginatorTestCase(TestCase):
def test_base(self):
kwargs = {
'count': 100,
'offset': 0,
'buf_size': 10,
'object_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
... | 33.546296 | 79 | 0.555617 | from django.test import TestCase
from avocado.core.paginator import BufferedPaginator
class BufferedPaginatorTestCase(TestCase):
def test_base(self):
kwargs = {
'count': 100,
'offset': 0,
'buf_size': 10,
'object_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
... | true | true |
f77985b623357c257f75cf72d5318d5d30a78e9c | 19,021 | py | Python | cfgov/cfgov/urls.py | adrukh/cfgov-refresh | 2209b1e9c74e3a2db74c97603d54274722ad8cec | [
"CC0-1.0"
] | null | null | null | cfgov/cfgov/urls.py | adrukh/cfgov-refresh | 2209b1e9c74e3a2db74c97603d54274722ad8cec | [
"CC0-1.0"
] | null | null | null | cfgov/cfgov/urls.py | adrukh/cfgov-refresh | 2209b1e9c74e3a2db74c97603d54274722ad8cec | [
"CC0-1.0"
] | null | null | null | from functools import partial
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.http import Http404, HttpResponse
from django.shortcuts import render
from... | 37.665347 | 119 | 0.620314 | from functools import partial
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.http import Http404, HttpResponse
from django.shortcuts import render
from... | true | true |
f779865901c4d7443bfcd40a415eb4b749e7a357 | 6,905 | py | Python | tests/test_simple.py | thorwhalen/oldpy2store | d3ba4e6241b0fb7f6100bd238371a46af5fd288e | [
"Apache-2.0"
] | 1 | 2022-01-19T13:15:03.000Z | 2022-01-19T13:15:03.000Z | tests/test_simple.py | thorwhalen/oldpy2store | d3ba4e6241b0fb7f6100bd238371a46af5fd288e | [
"Apache-2.0"
] | null | null | null | tests/test_simple.py | thorwhalen/oldpy2store | d3ba4e6241b0fb7f6100bd238371a46af5fd288e | [
"Apache-2.0"
] | null | null | null | import pytest
import os
import shutil
from tempfile import gettempdir
from oldpy2store.errors import OverWritesNotAllowedError, DeletionsNotAllowed
from oldpy2store.test.util import get_s3_test_access_info_from_env_vars
# from collections.abc import MutableMapping
# from oldpy2store.base import AbstractObjStore
# imp... | 30.152838 | 106 | 0.632295 | import pytest
import os
import shutil
from tempfile import gettempdir
from oldpy2store.errors import OverWritesNotAllowedError, DeletionsNotAllowed
from oldpy2store.test.util import get_s3_test_access_info_from_env_vars
def _delete_keys_from_store(store, keys_to_delete):
for k in keys_to_delete:
if k in... | true | true |
f7798868b50982b2d6c22d71f6a2436b5cc5fe2b | 16,791 | py | Python | tests/test_queryable.py | viralogic/py-queryable | 12034ee04eaa176676df84cb49665c6a9f741f01 | [
"MIT"
] | null | null | null | tests/test_queryable.py | viralogic/py-queryable | 12034ee04eaa176676df84cb49665c6a9f741f01 | [
"MIT"
] | 1 | 2018-10-04T22:13:18.000Z | 2018-10-18T04:01:59.000Z | tests/test_queryable.py | viralogic/py-queryable | 12034ee04eaa176676df84cb49665c6a9f741f01 | [
"MIT"
] | null | null | null | import os
from unittest import TestCase
from . import _sqlite_db_path
from py_queryable import expressions
from py_queryable.expressions import operators
from .models import Student
from py_queryable.db_providers import SqliteDbConnection
from py_linq.exceptions import NoElementsError, MoreThanOneMatchingElement, NoMat... | 38.335616 | 93 | 0.622179 | import os
from unittest import TestCase
from . import _sqlite_db_path
from py_queryable import expressions
from py_queryable.expressions import operators
from .models import Student
from py_queryable.db_providers import SqliteDbConnection
from py_linq.exceptions import NoElementsError, MoreThanOneMatchingElement, NoMat... | true | true |
f77988714785ba10f9db59f7f6e8dc5171527934 | 5,590 | py | Python | automon/integrations/vds/client.py | TheShellLand/automonisaur | b5f304a44449b8664c93d8a8a3c3cf2d73aa0ce9 | [
"MIT"
] | 2 | 2021-09-15T18:35:44.000Z | 2022-01-18T05:36:54.000Z | automon/integrations/vds/client.py | TheShellLand/automonisaur | b5f304a44449b8664c93d8a8a3c3cf2d73aa0ce9 | [
"MIT"
] | 16 | 2021-08-29T22:51:53.000Z | 2022-03-09T16:08:19.000Z | automon/integrations/vds/client.py | TheShellLand/automonisaur | b5f304a44449b8664c93d8a8a3c3cf2d73aa0ce9 | [
"MIT"
] | null | null | null | import re
import os
import json
import base64
import urllib3
import requests
from .config import VdsConfig
from queue import Queue
from automon.log import Logging
# disable insecure ssl warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class VdsLdapClient(object):
"""Not implemented... | 34.720497 | 113 | 0.612522 | import re
import os
import json
import base64
import urllib3
import requests
from .config import VdsConfig
from queue import Queue
from automon.log import Logging
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class VdsLdapClient(object):
pass
class VdsRestClient(object):
def __init... | true | true |
f77988809645d4eec3e549cb7dfbd687b927c0b1 | 1,010 | py | Python | tutorials/Controls4Docs/ControlBoundingSlider.py | sunj1/my_pyforms | d92c37cbddb3ff34fe1ace3874e0116c09e7c0cf | [
"MIT"
] | null | null | null | tutorials/Controls4Docs/ControlBoundingSlider.py | sunj1/my_pyforms | d92c37cbddb3ff34fe1ace3874e0116c09e7c0cf | [
"MIT"
] | null | null | null | tutorials/Controls4Docs/ControlBoundingSlider.py | sunj1/my_pyforms | d92c37cbddb3ff34fe1ace3874e0116c09e7c0cf | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "0.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
from __init__ import *
class SimpleExample... | 28.055556 | 114 | 0.446535 |
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "0.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
from __init__ import *
class SimpleExample(BaseWidget):
def __init__(self):
s... | true | true |
f77988e22ebc8f282c373b091a1dcb481df3406a | 14,582 | py | Python | python/tvm/relay/build_module.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/build_module.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/build_module.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | # 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.990676 | 90 | 0.638184 | import warnings
import numpy as np
from tvm.ir import IRModule
from tvm.tir import expr as tvm_expr
from .. import nd as _nd, autotvm
from ..target import Target
from ..contrib import graph_runtime as _graph_rt
from . import _build_module
from . import ty as _ty
from . import expr as _expr
from . import function as _... | true | true |
f77989c44548acc3c6262c1a41255874d36d11f6 | 2,358 | py | Python | celeryTasks/apiTasks/caffe_classify.py | aroranipun04/CloudCV-Old | c17f5be8a221532c77d413b6afc6bd0be5e4f788 | [
"MIT"
] | 11 | 2016-02-29T21:12:58.000Z | 2016-07-06T22:29:22.000Z | celeryTasks/apiTasks/caffe_classify.py | aroranipun04/CloudCV-Old | c17f5be8a221532c77d413b6afc6bd0be5e4f788 | [
"MIT"
] | 9 | 2015-06-12T22:37:41.000Z | 2016-02-09T21:47:21.000Z | celeryTasks/apiTasks/caffe_classify.py | aroranipun04/CloudCV-Old | c17f5be8a221532c77d413b6afc6bd0be5e4f788 | [
"MIT"
] | 16 | 2016-02-23T03:22:02.000Z | 2016-07-09T18:46:34.000Z | """
This file is copied from app.executable master branch
It is required by the tasks.py file.
While editing please make sure:
1) Not to import unnecessary modules.
2) Import only within the function where it is necessary.
3) Any new import will require you to install it in the worker container.
(See Docker/CPUWork... | 32.75 | 109 | 0.653944 |
def caffe_classify_image(single_image):
import operator
import numpy as np
import scipy.io as sio
import caffe
import os
matWNID = sio.loadmat(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'WNID.mat'))
WNID_cells = matWNID['wordsortWNID']
CAFFE_DIR = os.path.normpath(os.p... | true | true |
f7798b213813bc84797c382e9b70a2c375bab73c | 37,235 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 43.549708 | 211 | 0.668994 | from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import Pipelin... | true | true |
f7798b4de40cc635936bd1009a43059340e3c911 | 2,606 | py | Python | pingxiaobao/province.py | SunicYosen/spider | 18ed13229ca58f420c311333a9ff3d8581a962d3 | [
"MIT"
] | 1 | 2020-10-23T02:53:07.000Z | 2020-10-23T02:53:07.000Z | pingxiaobao/province.py | SunicYosen/spider | 18ed13229ca58f420c311333a9ff3d8581a962d3 | [
"MIT"
] | null | null | null | pingxiaobao/province.py | SunicYosen/spider | 18ed13229ca58f420c311333a9ff3d8581a962d3 | [
"MIT"
] | null | null | null | """
Province Class
"""
import time
from city import City
from device_type import DeviceType
from device_scene import DeviceScene
class Province:
def __init__(self):
self.province_name = ''
self.province_cities = []
self.province_point = 0
self.province_screens = 0
... | 49.169811 | 138 | 0.682272 | import time
from city import City
from device_type import DeviceType
from device_scene import DeviceScene
class Province:
def __init__(self):
self.province_name = ''
self.province_cities = []
self.province_point = 0
self.province_screens = 0
self.total_type_points... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.