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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f774a7e3766df4c239f21c30ee834e396ec0fe19 | 1,092 | py | Python | google/ads/googleads/v8/errors/types/adx_error.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 285 | 2018-10-05T16:47:58.000Z | 2022-03-31T00:58:39.000Z | google/ads/googleads/v8/errors/types/adx_error.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 425 | 2018-09-10T13:32:41.000Z | 2022-03-31T14:50:05.000Z | google/ads/googleads/v8/errors/types/adx_error.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 369 | 2018-11-28T07:01:00.000Z | 2022-03-28T09:53:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 29.513514 | 74 | 0.711538 | import proto
__protobuf__ = proto.module(
package="google.ads.googleads.v8.errors",
marshal="google.ads.googleads.v8",
manifest={"AdxErrorEnum",},
)
class AdxErrorEnum(proto.Message):
class AdxError(proto.Enum):
UNSPECIFIED = 0
UNKNOWN = 1
UNSUPPORTED_FEATURE = 2
__all__ ... | true | true |
f774a7f979a02a331a748f216b62059e086bf367 | 4,472 | py | Python | src/bandersnatch/delete.py | lepaperwan/bandersnatch | 251127a3b979f0e845b619a5bbd507db85a13f01 | [
"AFL-3.0"
] | 1 | 2021-04-14T05:41:33.000Z | 2021-04-14T05:41:33.000Z | src/bandersnatch/delete.py | lepaperwan/bandersnatch | 251127a3b979f0e845b619a5bbd507db85a13f01 | [
"AFL-3.0"
] | 16 | 2020-12-18T22:46:36.000Z | 2022-03-02T18:06:15.000Z | src/bandersnatch/delete.py | jiegec/bandersnatch | cc50bfecfd8b8912c35227aa8124c385ca1239ab | [
"AFL-3.0"
] | 1 | 2021-04-14T05:41:27.000Z | 2021-04-14T05:41:27.000Z | #!/usr/bin/env python3
import asyncio
import concurrent.futures
import logging
from argparse import Namespace
from configparser import ConfigParser
from json import JSONDecodeError, load
from pathlib import Path
from typing import Awaitable, List
from urllib.parse import urlparse
from packaging.utils import canonical... | 37.266667 | 88 | 0.661673 |
import asyncio
import concurrent.futures
import logging
from argparse import Namespace
from configparser import ConfigParser
from json import JSONDecodeError, load
from pathlib import Path
from typing import Awaitable, List
from urllib.parse import urlparse
from packaging.utils import canonicalize_name
from .master ... | true | true |
f774a84cc2369846ccfcbaeeee03fcafe5bde29a | 63 | py | Python | src/izi/apps/checkout/__init__.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | src/izi/apps/checkout/__init__.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | src/izi/apps/checkout/__init__.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | default_app_config = 'izi.apps.checkout.config.CheckoutConfig'
| 31.5 | 62 | 0.84127 | default_app_config = 'izi.apps.checkout.config.CheckoutConfig'
| true | true |
f774a8e4fd55d24e672af4764602e3813cb26802 | 82 | py | Python | ABC/118/a.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/118/a.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/118/a.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | A, B = map(int, input().split())
if B%A == 0:
print(A + B)
else:
print(B - A) | 13.666667 | 32 | 0.5 | A, B = map(int, input().split())
if B%A == 0:
print(A + B)
else:
print(B - A) | true | true |
f774a92add21aa7b9e1ab824de870f71f161cbae | 2,620 | py | Python | sdk/python/pulumi_azure_nextgen/eventgrid/v20180915preview/list_topic_shared_access_keys.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/eventgrid/v20180915preview/list_topic_shared_access_keys.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/eventgrid/v20180915preview/list_topic_shared_access_keys.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 33.589744 | 169 | 0.669084 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'ListTopicSharedAccessKeysResult',
'AwaitableListTopicSharedAccessKeysResult',
'list_topic_shared_access_keys',
]
@pulumi.output_type
class ListTo... | true | true |
f774aaf92ffb27374cac7ee0ae49a0139b81f31d | 1,427 | py | Python | cio/backends/locmem/backend.py | andreif/content-io | e9d0a394a8abd346d3a90e092d82cd5487c19907 | [
"BSD-3-Clause"
] | null | null | null | cio/backends/locmem/backend.py | andreif/content-io | e9d0a394a8abd346d3a90e092d82cd5487c19907 | [
"BSD-3-Clause"
] | null | null | null | cio/backends/locmem/backend.py | andreif/content-io | e9d0a394a8abd346d3a90e092d82cd5487c19907 | [
"BSD-3-Clause"
] | null | null | null | from ..base import CacheBackend
class LocMemCacheBackend(CacheBackend):
scheme = 'locmem'
def __init__(self, **config):
super(LocMemCacheBackend, self).__init__(**config)
self._cache = {}
self.calls = 0
self.hits = 0
self.misses = 0
self.sets = 0
def clea... | 23.393443 | 58 | 0.501752 | from ..base import CacheBackend
class LocMemCacheBackend(CacheBackend):
scheme = 'locmem'
def __init__(self, **config):
super(LocMemCacheBackend, self).__init__(**config)
self._cache = {}
self.calls = 0
self.hits = 0
self.misses = 0
self.sets = 0
def clea... | true | true |
f774ab337ba508d84bf40bdb0d1c93c5ae107ac5 | 20,014 | py | Python | models/enc_PTRUNK.py | kimhyeji/Mem2Seq | 6e6b7eacb4ae2e26517980c45046b0c519c918b7 | [
"MIT"
] | null | null | null | models/enc_PTRUNK.py | kimhyeji/Mem2Seq | 6e6b7eacb4ae2e26517980c45046b0c519c918b7 | [
"MIT"
] | null | null | null | models/enc_PTRUNK.py | kimhyeji/Mem2Seq | 6e6b7eacb4ae2e26517980c45046b0c519c918b7 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from utils.masked_cross_entropy import *
from utils.config import *
import random
import numpy as np
import datetime
from utils.measures import wer,moses_multi_bleu
from tqdm import tqdm
from s... | 46.115207 | 210 | 0.594434 | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from utils.masked_cross_entropy import *
from utils.config import *
import random
import numpy as np
import datetime
from utils.measures import wer,moses_multi_bleu
from tqdm import tqdm
from s... | true | true |
f774acbe575bff3c75429abb686519d23bd08bff | 202 | py | Python | oldplugins/join.py | sonicrules1234/sonicbot | 07a22d08bf86ed33dc715a800957aee3b45f3dde | [
"BSD-3-Clause"
] | 1 | 2019-06-27T08:45:23.000Z | 2019-06-27T08:45:23.000Z | oldplugins/join.py | sonicrules1234/sonicbot | 07a22d08bf86ed33dc715a800957aee3b45f3dde | [
"BSD-3-Clause"
] | null | null | null | oldplugins/join.py | sonicrules1234/sonicbot | 07a22d08bf86ed33dc715a800957aee3b45f3dde | [
"BSD-3-Clause"
] | null | null | null | arguments = ["self", "info", "args"]
minlevel = 4
helpstring = "join <channel>"
def main(connection, info, args):
"""Makes sonicbot join a channel"""
connection.rawsend("JOIN %s\n" % (args[1]))
| 28.857143 | 47 | 0.638614 | arguments = ["self", "info", "args"]
minlevel = 4
helpstring = "join <channel>"
def main(connection, info, args):
connection.rawsend("JOIN %s\n" % (args[1]))
| true | true |
f774ae0f977fa98afa186fde034fc7a8bb80acaf | 3,563 | py | Python | temboo/core/Library/Zendesk/Users/ShowUser.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Zendesk/Users/ShowUser.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Zendesk/Users/ShowUser.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# ShowUser
# Returns information about given user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ... | 36.357143 | 145 | 0.668538 |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ShowUser(Choreography):
def __init__(self, temboo_session):
super(ShowUser, self)._... | true | true |
f774ae5c6fbaf3fa820f563d6977d1115f779f80 | 1,490 | py | Python | .history/my_classes/basic/for_loop_20210430204443.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/basic/for_loop_20210430204443.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/basic/for_loop_20210430204443.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | i = 0 # This is an example of the while loop
while i < 5:
print(i)
i += 1
i = None # 0
# 1
# 2
# 3
# 4
for i in range(5): # This example uses the iterable object 'range'
print(i) # 0
# 1
# 2
# 3
... | 15.520833 | 67 | 0.296644 | i = 0 while i < 5:
print(i)
i += 1
i = None
for i in range(5): print(i)
for i in [1, 2, 3, 4]:
print(i)
for c in 'hello':
prin... | true | true |
f774af2169cccf0ab0f1af93ba1d68262f035211 | 4,138 | py | Python | tests/components/test_logger.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 2 | 2020-08-29T07:24:56.000Z | 2020-10-27T21:47:35.000Z | tests/components/test_logger.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:25:50.000Z | 2022-03-11T23:27:53.000Z | tests/components/test_logger.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2018-09-14T07:34:09.000Z | 2018-09-29T12:57:10.000Z | """The tests for the Logger component."""
from collections import namedtuple
import logging
import unittest
from homeassistant.setup import setup_component
from homeassistant.components import logger
from tests.common import get_test_home_assistant
RECORD = namedtuple('record', ('name', 'levelno'))
NO_DEFAULT_CONFI... | 32.077519 | 69 | 0.652006 | from collections import namedtuple
import logging
import unittest
from homeassistant.setup import setup_component
from homeassistant.components import logger
from tests.common import get_test_home_assistant
RECORD = namedtuple('record', ('name', 'levelno'))
NO_DEFAULT_CONFIG = {'logger': {}}
NO_LOGS_CONFIG = {'logg... | true | true |
f774af2cb8c2d772dd6a0093826da491712f1108 | 2,885 | py | Python | vision/ssd/predictor.py | m0r13/pytorch-ssd | c92dc5228f8e12df907f0e6f06646e9a2ec94a73 | [
"MIT"
] | null | null | null | vision/ssd/predictor.py | m0r13/pytorch-ssd | c92dc5228f8e12df907f0e6f06646e9a2ec94a73 | [
"MIT"
] | null | null | null | vision/ssd/predictor.py | m0r13/pytorch-ssd | c92dc5228f8e12df907f0e6f06646e9a2ec94a73 | [
"MIT"
] | 1 | 2021-07-24T17:11:15.000Z | 2021-07-24T17:11:15.000Z | import torch
from ..utils import box_utils
from .data_preprocessing import PredictionTransform
from ..utils.misc import Timer
class Predictor:
def __init__(self, net, size, mean=0.0, std=1.0, nms_method=None,
iou_threshold=0.45, filter_threshold=0.01, candidate_size=200, sigma=0.5, device=None):... | 40.633803 | 104 | 0.578163 | import torch
from ..utils import box_utils
from .data_preprocessing import PredictionTransform
from ..utils.misc import Timer
class Predictor:
def __init__(self, net, size, mean=0.0, std=1.0, nms_method=None,
iou_threshold=0.45, filter_threshold=0.01, candidate_size=200, sigma=0.5, device=None):... | true | true |
f774af9f4b0d627d76f9184bc2845b6854f6a38b | 6,067 | py | Python | var/spack/repos/builtin/packages/py-protobuf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-protobuf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-protobuf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyProtobuf(PythonPackage):
"""Protocol buffers are Google's language-neutral, plat... | 63.863158 | 116 | 0.76265 |
from spack.package import *
class PyProtobuf(PythonPackage):
homepage = 'https://developers.google.com/protocol-buffers/'
pypi = 'protobuf/protobuf-3.11.0.tar.gz'
variant('cpp', default=False,
description='Enable the cpp implementation')
version('3.20.1', sha256='adc31566d027f45efe3f4... | true | true |
f774afb20338826cafb77e85d384871aba1284d3 | 20,382 | py | Python | swift/common/middleware/proxy_logging.py | fvennetier/swift | 127bf9707c383ac737fce9f243bcc8f6655910df | [
"Apache-2.0"
] | null | null | null | swift/common/middleware/proxy_logging.py | fvennetier/swift | 127bf9707c383ac737fce9f243bcc8f6655910df | [
"Apache-2.0"
] | null | null | null | swift/common/middleware/proxy_logging.py | fvennetier/swift | 127bf9707c383ac737fce9f243bcc8f6655910df | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2011 OpenStack Foundation
#
# 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 agree... | 45.09292 | 79 | 0.59057 |
import os
import time
from swift.common.middleware.catch_errors import enforce_byte_count
from swift.common.swob import Request
from swift.common.utils import (get_logger, get_remote_client,
config_true_value, reiterate,
InputProxy, list_from_csv, get_p... | true | true |
f774b2641db1494b081860f9748f081decc65b14 | 808 | py | Python | tsl/nn/base/dense.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | 4 | 2022-03-21T09:16:33.000Z | 2022-03-30T12:24:30.000Z | tsl/nn/base/dense.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | null | null | null | tsl/nn/base/dense.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | null | null | null | from torch import nn
from tsl.nn.utils import utils
class Dense(nn.Module):
r"""
A simple fully-connected layer.
Args:
input_size (int): Size of the input.
output_size (int): Size of the output.
activation (str, optional): Activation function.
dropout (float, optional): D... | 29.925926 | 92 | 0.623762 | from torch import nn
from tsl.nn.utils import utils
class Dense(nn.Module):
def __init__(self, input_size, output_size, activation='linear', dropout=0., bias=True):
super(Dense, self).__init__()
self.layer = nn.Sequential(
nn.Linear(input_size, output_size, bias=bias),
uti... | true | true |
f774b2b443912b1aecf8323177884f5a3913072f | 361 | py | Python | app/recipe/urls.py | ganeshpc/recipe-app-api | d5ca97b8bc5af8b833bc832685c313c38258684f | [
"MIT"
] | null | null | null | app/recipe/urls.py | ganeshpc/recipe-app-api | d5ca97b8bc5af8b833bc832685c313c38258684f | [
"MIT"
] | null | null | null | app/recipe/urls.py | ganeshpc/recipe-app-api | d5ca97b8bc5af8b833bc832685c313c38258684f | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from recipe import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredinets', views.IngredientViewSet)
router.register('recipes', views.RecipeViewSet)
app_name = 'recipe'
urlpatterns ... | 21.235294 | 55 | 0.775623 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from recipe import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredinets', views.IngredientViewSet)
router.register('recipes', views.RecipeViewSet)
app_name = 'recipe'
urlpatterns ... | true | true |
f774b33bc67692b8887bdfe8c89ea4d25ac063bc | 252 | py | Python | scripts/cpmel_test/__init__.py | cpcgskill/CPMel | 850980d52cf958fac2c4fb66322bbbed181bd75f | [
"Apache-2.0"
] | null | null | null | scripts/cpmel_test/__init__.py | cpcgskill/CPMel | 850980d52cf958fac2c4fb66322bbbed181bd75f | [
"Apache-2.0"
] | null | null | null | scripts/cpmel_test/__init__.py | cpcgskill/CPMel | 850980d52cf958fac2c4fb66322bbbed181bd75f | [
"Apache-2.0"
] | null | null | null | # -*-coding:utf-8 -*-
u"""
:创建时间: 2022/3/17 23:09
:作者: 苍之幻灵
:我的主页: https://cpcgskill.com
:QQ: 2921251087
:爱发电: https://afdian.net/@Phantom_of_the_Cang
:aboutcg: https://www.aboutcg.org/teacher/54335
:bilibili: https://space.bilibili.com/351598127
"""
| 21 | 47 | 0.698413 | true | true | |
f774b3532180baf645ec96e5f21c85a37d3025b7 | 1,411 | py | Python | tests/unit_tests/logic/environment/test_weatherUPBAscom.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 16 | 2020-01-11T22:32:26.000Z | 2022-03-31T15:18:14.000Z | tests/unit_tests/logic/environment/test_weatherUPBAscom.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 196 | 2020-01-16T13:56:01.000Z | 2022-03-29T02:06:51.000Z | tests/unit_tests/logic/environment/test_weatherUPBAscom.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 6 | 2019-12-01T19:39:33.000Z | 2021-05-27T13:14:20.000Z | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | 23.915254 | 71 | 0.54713 | import pytest
import platform
from PyQt5.QtCore import QThreadPool, QObject, pyqtSignal
from logic.environment.weatherUPBAscom import WeatherUPBAscom
from base.driverDataClass import Signals
if not platform.system() == 'Windows':
pytest.skip("skipping windows-only tests", allow_module_level=True)
@pytest.fixtu... | true | true |
f774b450942932a724636afd42c7ee7faaa4d3db | 3,898 | py | Python | CartPole_DQN2015_tf140/network.py | sjk0709/Cartpole-DQN-pytorch041 | 439e5be4bd7b44dd923c46f24e62b46b7dadfba4 | [
"MIT"
] | null | null | null | CartPole_DQN2015_tf140/network.py | sjk0709/Cartpole-DQN-pytorch041 | 439e5be4bd7b44dd923c46f24e62b46b7dadfba4 | [
"MIT"
] | null | null | null | CartPole_DQN2015_tf140/network.py | sjk0709/Cartpole-DQN-pytorch041 | 439e5be4bd7b44dd923c46f24e62b46b7dadfba4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import gym
from gym.envs.registration import register
import sys, os
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import random as pr
class DQN:
def __init__(self, session, input_size, output_... | 43.311111 | 125 | 0.58825 |
import gym
from gym.envs.registration import register
import sys, os
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import random as pr
class DQN:
def __init__(self, session, input_size, output_size, name="policy"):
self.sess = session
self.input_si... | true | true |
f774b50925fc9ea1caffe55cca4dc598401eaadc | 2,981 | py | Python | scons/scons-local-1.2.0.d20090919/SCons/Tool/as.py | cclauss/pivy | 55de2ba4dd32f62ce2d4e33ca28459cf3ea5167a | [
"ISC"
] | 29 | 2019-12-28T10:37:16.000Z | 2022-02-09T10:48:04.000Z | scons/scons-local-1.2.0.d20090919/SCons/Tool/as.py | cclauss/pivy | 55de2ba4dd32f62ce2d4e33ca28459cf3ea5167a | [
"ISC"
] | 29 | 2019-12-26T13:46:11.000Z | 2022-03-29T18:14:33.000Z | scons/scons-local-1.2.0.d20090919/SCons/Tool/as.py | cclauss/pivy | 55de2ba4dd32f62ce2d4e33ca28459cf3ea5167a | [
"ISC"
] | 17 | 2019-12-29T11:49:32.000Z | 2022-02-23T00:28:18.000Z | """SCons.Tool.as
Tool-specific initialization for as, the generic Posix assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The S... | 37.734177 | 100 | 0.732976 |
__revision__ = "src/engine/SCons/Tool/as.py 4369 2009/09/19 15:58:29 scons"
import SCons.Defaults
import SCons.Tool
import SCons.Util
assemblers = ['as']
ASSuffixes = ['.s', '.asm', '.ASM']
ASPPSuffixes = ['.spp', '.SPP', '.sx']
if SCons.Util.case_sensitive_suffixes('.s', '.S'):
ASPPSuffixes.extend(['.S'])
els... | true | true |
f774b6d9ec63b37d7f31b1a8fd9dabee268d2f00 | 6,796 | py | Python | tests/profile/test_views.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | tests/profile/test_views.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | tests/profile/test_views.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | import pytest
from collections import OrderedDict
from test_plus import APITestCase
from tests.profile.factories import ProfileFactory, IndicatorCategoryFactory, IndicatorSubcategoryFactory, ProfileIndicatorFactory
from tests.datasets.factories import DatasetFactory, IndicatorFactory, IndicatorDataFactory, GroupFacto... | 47.859155 | 176 | 0.646557 | import pytest
from collections import OrderedDict
from test_plus import APITestCase
from tests.profile.factories import ProfileFactory, IndicatorCategoryFactory, IndicatorSubcategoryFactory, ProfileIndicatorFactory
from tests.datasets.factories import DatasetFactory, IndicatorFactory, IndicatorDataFactory, GroupFacto... | true | true |
f774b7d78f42235a5842881b65872ecccabdd7ac | 5,254 | py | Python | tests/test_hy2py.py | peeley/hy | 03404e45bda2aca9aa6040e8c9fa5da5bfa598ef | [
"MIT"
] | null | null | null | tests/test_hy2py.py | peeley/hy | 03404e45bda2aca9aa6040e8c9fa5da5bfa598ef | [
"MIT"
] | null | null | null | tests/test_hy2py.py | peeley/hy | 03404e45bda2aca9aa6040e8c9fa5da5bfa598ef | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
# Copyright 2019 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import math, itertools
from hy import mangle
from hy._compat import PY36
import hy.importer
def test_direct_import():
import tests.resources.pydemo
as... | 40.415385 | 1,469 | 0.668443 |
import math, itertools
from hy import mangle
from hy._compat import PY36
import hy.importer
def test_direct_import():
import tests.resources.pydemo
assert_stuff(tests.resources.pydemo)
def test_hy2py_import(tmpdir):
import subprocess
python_code = subprocess.check_output(
["hy2py", "tests/r... | true | true |
f774b989513adcea164d142d6bbb763d3bc81dc1 | 2,102 | py | Python | python/example_code/greengrass/connector-sns-usage.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 12 | 2020-07-28T01:20:15.000Z | 2021-12-10T10:52:49.000Z | python/example_code/greengrass/connector-sns-usage.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 5 | 2021-12-14T20:57:10.000Z | 2022-01-04T16:48:51.000Z | python/example_code/greengrass/connector-sns-usage.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 5 | 2020-08-29T14:01:38.000Z | 2021-11-18T07:11:49.000Z | # Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license"... | 35.627119 | 89 | 0.72883 | import greengrasssdk
import time
import json
iot_client = greengrasssdk.client('iot-data')
send_topic = 'sns/message'
def create_request_with_all_fields():
return {
"request": {
"message": "Message from SNS Connector Test"
},
"id" : "req_123"
}
def publish_... | false | true |
f774b9e12e1ccf624da2a7f7540b50f3004cd946 | 76,229 | py | Python | qutip/qobj.py | goerz-forks/qutip | 759759e85f61e3619b37253a6f981f71abc442d6 | [
"BSD-3-Clause"
] | 1 | 2019-07-19T02:17:12.000Z | 2019-07-19T02:17:12.000Z | qutip/qobj.py | wyy97git/qutip | 759759e85f61e3619b37253a6f981f71abc442d6 | [
"BSD-3-Clause"
] | null | null | null | qutip/qobj.py | wyy97git/qutip | 759759e85f61e3619b37253a6f981f71abc442d6 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | 31.63029 | 94 | 0.533485 |
__all__ = ['Qobj', 'qobj_list_evaluate', 'ptrace', 'dag', 'isequal',
'issuper', 'isoper', 'isoperket', 'isoperbra', 'isket', 'isbra',
'isherm', 'shape', 'dims']
import warnings
import types
try:
import builtins
except:
import __builtin__ as builtins
from numpy import (arccos, arccosh, ... | true | true |
f774b9e5eb724b7a0a517e2c0fc67f380d24f5a5 | 31,798 | py | Python | wagtail/wagtailadmin/views/pages.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailadmin/views/pages.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailadmin/views/pages.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | 1 | 2019-02-04T13:57:39.000Z | 2019-02-04T13:57:39.000Z | from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import ValidationError, PermissionDenied
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from dja... | 38.449819 | 161 | 0.665576 | from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import ValidationError, PermissionDenied
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from dja... | true | true |
f774bb1ea3476c63af0423b2f820c3f1e2f3cc90 | 3,690 | py | Python | vqt/cli.py | 4k4xs4pH1r3/vivisect | dea425eed796176309a3be46936eb682598271aa | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-12-23T19:23:17.000Z | 2020-12-23T19:23:17.000Z | vqt/cli.py | 4k4xs4pH1r3/vivisect | dea425eed796176309a3be46936eb682598271aa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vqt/cli.py | 4k4xs4pH1r3/vivisect | dea425eed796176309a3be46936eb682598271aa | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-12-23T19:23:58.000Z | 2020-12-23T19:23:58.000Z | import os
from PyQt4 import QtCore, QtGui
import envi.cli as e_cli
import envi.qt.memory as e_q_memory
import envi.qt.memcanvas as e_q_memcanvas
#from envi.threads import firethread
import vqt.colors as vq_colors
import vqt.hotkeys as vq_hotkeys
#import vqt.shortcut as vq_shortcut
from vqt.basics import *
from vqt.... | 29.52 | 95 | 0.638211 | import os
from PyQt4 import QtCore, QtGui
import envi.cli as e_cli
import envi.qt.memory as e_q_memory
import envi.qt.memcanvas as e_q_memcanvas
import vqt.colors as vq_colors
import vqt.hotkeys as vq_hotkeys
from vqt.basics import *
from vqt.main import idlethread,workthread
class VQInput(vq_hotkeys.HotKeyMixin, ... | true | true |
f774bbc5e3d2e95533d7a595b3751c41c21b312e | 760 | py | Python | site-packages/visual_common/site_settings.py | lebarsfa/vpython-wx | 38df062e5532b79f632f4f2a1abae86754c264a9 | [
"BSL-1.0"
] | 68 | 2015-01-17T05:41:58.000Z | 2021-04-24T08:35:24.000Z | site-packages/visual_common/site_settings.py | lebarsfa/vpython-wx | 38df062e5532b79f632f4f2a1abae86754c264a9 | [
"BSL-1.0"
] | 16 | 2015-01-02T19:36:06.000Z | 2018-09-09T21:01:25.000Z | site-packages/visual_common/site_settings.py | lebarsfa/vpython-wx | 38df062e5532b79f632f4f2a1abae86754c264a9 | [
"BSL-1.0"
] | 37 | 2015-02-04T04:23:00.000Z | 2020-06-07T03:24:41.000Z | # This file may be modified by the user (or site administrator, in a
# multi-user environment) to change settings or modify VPython to work
# around local configuration issues.
## Disabling shaders may be necessary on some systems where Visual fails
## to detect that the video hardware or drivers are incapable of... | 40 | 77 | 0.760526 | true | true | |
f774bc527ab3f2062647e9ebbfd7228f8b360cd0 | 4,512 | py | Python | src/conda_tools/cache/package.py | groutr/conda-tools | f421fd324f306a713c0cb1a3845306758ff981f4 | [
"BSD-3-Clause"
] | 11 | 2016-07-07T00:27:01.000Z | 2019-12-02T08:47:16.000Z | src/conda_tools/cache/package.py | groutr/conda-tools | f421fd324f306a713c0cb1a3845306758ff981f4 | [
"BSD-3-Clause"
] | 8 | 2016-07-15T14:59:27.000Z | 2019-07-03T18:05:34.000Z | src/conda_tools/cache/package.py | groutr/conda-tools | f421fd324f306a713c0cb1a3845306758ff981f4 | [
"BSD-3-Clause"
] | 2 | 2016-07-13T22:24:51.000Z | 2016-11-16T18:03:46.000Z | from os.path import join, exists, isdir
import json
from functools import lru_cache
import pathlib
import typing
from sys import intern
from . import lazyproperty
from . import _types
from .exceptions import InvalidCachePackage
import tarfile
class PackagePool(object):
"""
Common pool for sharing PackageIn... | 26.857143 | 105 | 0.564938 | from os.path import join, exists, isdir
import json
from functools import lru_cache
import pathlib
import typing
from sys import intern
from . import lazyproperty
from . import _types
from .exceptions import InvalidCachePackage
import tarfile
class PackagePool(object):
def __init__(self):
self._pool = ... | true | true |
f774bca7961fb48597b4c3d35c60470eaf5292e7 | 178 | py | Python | Server/accounts/validators.py | DrM0h4MM4d/api-uploader | a21832b9cccde7784db55052bf10381425794b12 | [
"MIT"
] | null | null | null | Server/accounts/validators.py | DrM0h4MM4d/api-uploader | a21832b9cccde7784db55052bf10381425794b12 | [
"MIT"
] | null | null | null | Server/accounts/validators.py | DrM0h4MM4d/api-uploader | a21832b9cccde7784db55052bf10381425794b12 | [
"MIT"
] | null | null | null | from django.core.exceptions import ValidationError
import re
def validate_password(value):
if not re.match(r'', value):
raise ValidationError("Password must be ...") | 29.666667 | 53 | 0.730337 | from django.core.exceptions import ValidationError
import re
def validate_password(value):
if not re.match(r'', value):
raise ValidationError("Password must be ...") | true | true |
f774bcb9445ad3251cc805367391d701b86b97d5 | 1,267 | py | Python | sktime/classification/interval_based/tests/test_drcif.py | biologioholic/sktime | 9d0391a04b11d22bd783b452f01aa5b4529b41a2 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T02:45:39.000Z | 2021-12-22T02:45:39.000Z | sktime/classification/interval_based/tests/test_drcif.py | biologioholic/sktime | 9d0391a04b11d22bd783b452f01aa5b4529b41a2 | [
"BSD-3-Clause"
] | null | null | null | sktime/classification/interval_based/tests/test_drcif.py | biologioholic/sktime | 9d0391a04b11d22bd783b452f01aa5b4529b41a2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""DrCIF test code."""
import numpy as np
from sklearn.metrics import accuracy_score
from sktime.classification.interval_based import DrCIF
from sktime.datasets import load_unit_test
def test_drcif_train_estimate():
"""Test of DrCIF on unit test data."""
# load unit test data
X_tr... | 26.395833 | 65 | 0.67719 | import numpy as np
from sklearn.metrics import accuracy_score
from sktime.classification.interval_based import DrCIF
from sktime.datasets import load_unit_test
def test_drcif_train_estimate():
X_train, y_train = load_unit_test(split="train")
drcif = DrCIF(
n_estimators=2,
n_intervals... | true | true |
f774bd0ff7fb2d8245d67181f63570d69415aa37 | 629 | py | Python | example/manage.py | Anton-vBR/django-leaflet-point | b27c126c12f46acf2598db9738187d9f0a4bcb4e | [
"MIT"
] | 1 | 2019-04-22T10:53:45.000Z | 2019-04-22T10:53:45.000Z | example/manage.py | Anton-vBR/django-leaflet-point | b27c126c12f46acf2598db9738187d9f0a4bcb4e | [
"MIT"
] | 9 | 2019-12-04T22:42:37.000Z | 2022-02-10T07:19:20.000Z | example/manage.py | Anton-vBR/django-leaflet-point | b27c126c12f46acf2598db9738187d9f0a4bcb4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mushrooms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mushrooms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f774bd5ebc169c3c84720c67e399e6f9779561bd | 960 | py | Python | demodocusfw/tests/config/mode_crawler_multi1_w_screenshots.py | dchud/demodocus | e37040af521bc56a61fea6327fae111268b81497 | [
"Apache-2.0"
] | 7 | 2020-11-17T15:02:32.000Z | 2022-02-18T23:53:23.000Z | demodocusfw/tests/config/mode_crawler_multi1_w_screenshots.py | dchud/demodocus | e37040af521bc56a61fea6327fae111268b81497 | [
"Apache-2.0"
] | 20 | 2020-11-02T13:40:40.000Z | 2020-11-30T14:09:01.000Z | demodocusfw/tests/config/mode_crawler_multi1_w_screenshots.py | dchud/demodocus | e37040af521bc56a61fea6327fae111268b81497 | [
"Apache-2.0"
] | 4 | 2020-11-02T18:48:24.000Z | 2020-11-20T18:31:29.000Z | """
Software License Agreement (Apache 2.0)
Copyright (c) 2020, The MITRE Corporation.
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-... | 30.967742 | 74 | 0.785417 |
from .mode_test import *
MULTI = True
NUM_THREADS = 1
SCREENSHOTS = True
| true | true |
f774bf36375197d9c7fbad5e553333a49692ed3f | 1,891 | py | Python | jsonform/form.py | Pix-00/jsonform | d62543474d96b258606ec38dd427693232daeda3 | [
"Apache-2.0"
] | null | null | null | jsonform/form.py | Pix-00/jsonform | d62543474d96b258606ec38dd427693232daeda3 | [
"Apache-2.0"
] | null | null | null | jsonform/form.py | Pix-00/jsonform | d62543474d96b258606ec38dd427693232daeda3 | [
"Apache-2.0"
] | null | null | null | import enum
from abc import ABC, abstractmethod
from .errors import FieldError, FormError
from .fields import UnboundField
LAMBDA = lambda:0
class JsonForm(ABC):
def __init__(self, data: dict = None):
self.fields = list()
for name, obj in self.__class__.__dict__.items():
if not isinst... | 30.5 | 79 | 0.541512 | import enum
from abc import ABC, abstractmethod
from .errors import FieldError, FormError
from .fields import UnboundField
LAMBDA = lambda:0
class JsonForm(ABC):
def __init__(self, data: dict = None):
self.fields = list()
for name, obj in self.__class__.__dict__.items():
if not isinst... | true | true |
f774bf40378458494a5f06d914ba444d0017e4c0 | 2,666 | py | Python | imgreco/ocr/common.py | Prurite/ArknightsAutoHelper | 91488a806a5f7063d943e698c85287d36ddd5086 | [
"MIT"
] | 2 | 2019-09-20T11:48:26.000Z | 2019-12-08T09:33:48.000Z | imgreco/ocr/common.py | dantmnf/ArknightsAutoHelper | d5bbe58ec69edfd15ef3881efc943701c1543c6f | [
"MIT"
] | null | null | null | imgreco/ocr/common.py | dantmnf/ArknightsAutoHelper | d5bbe58ec69edfd15ef3881efc943701c1543c6f | [
"MIT"
] | null | null | null | import copy
def mult_in(needles, haystack):
for needle in needles:
if needle in haystack:
return True
return False
class OcrHint:
SINGLE_LINE = 'single_line'
SPARSE = 'sparse'
class Rect:
def __init__(self, x, y, w=0, h=0, *, right=None, bottom=None):
self.x = x
... | 26.66 | 96 | 0.595649 | import copy
def mult_in(needles, haystack):
for needle in needles:
if needle in haystack:
return True
return False
class OcrHint:
SINGLE_LINE = 'single_line'
SPARSE = 'sparse'
class Rect:
def __init__(self, x, y, w=0, h=0, *, right=None, bottom=None):
self.x = x
... | true | true |
f774bf4603bbc28a90ff841dadbfd02d531b0da9 | 7,588 | py | Python | numba_dppy/dpnp_glue/dpnp_array_creations_impl.py | sasmirnov/numba-dppy | 6ec41a5adab3034ddcfba2df312117afd6e2327b | [
"Apache-2.0"
] | null | null | null | numba_dppy/dpnp_glue/dpnp_array_creations_impl.py | sasmirnov/numba-dppy | 6ec41a5adab3034ddcfba2df312117afd6e2327b | [
"Apache-2.0"
] | null | null | null | numba_dppy/dpnp_glue/dpnp_array_creations_impl.py | sasmirnov/numba-dppy | 6ec41a5adab3034ddcfba2df312117afd6e2327b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 29.756863 | 104 | 0.699657 |
import numba_dppy.dpnp_glue.dpnpimpl as dpnp_ext
from numba import types
from numba.core.typing import signature
from . import stubs
import numba_dppy.dpnp_glue as dpnp_lowering
from numba.core.extending import overload, register_jitable
import numpy as np
from numba_dppy import dpctl_functions
import numba_dppy
@re... | true | true |
f774bf496516d1d334bcf82dfeb77db1022df2de | 577 | py | Python | analysis/migrations/0008_auto_20200604_1538.py | khushbuupatel/API-using-Django-Rest-Framework | 062fd77e0ce9bff3862faaea02194019c89e7a99 | [
"MIT"
] | null | null | null | analysis/migrations/0008_auto_20200604_1538.py | khushbuupatel/API-using-Django-Rest-Framework | 062fd77e0ce9bff3862faaea02194019c89e7a99 | [
"MIT"
] | null | null | null | analysis/migrations/0008_auto_20200604_1538.py | khushbuupatel/API-using-Django-Rest-Framework | 062fd77e0ce9bff3862faaea02194019c89e7a99 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2020-06-04 10:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analysis', '0007_product_date_w'),
]
operations = [
migrations.AlterField(
model_name='product',
name='date_w',
... | 24.041667 | 108 | 0.585789 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analysis', '0007_product_date_w'),
]
operations = [
migrations.AlterField(
model_name='product',
name='date_w',
field=models.DateField(),
),
... | true | true |
f774c0d9a3558eec30944e84f9a80522769bebf3 | 644 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/WGL/ARB/robustness_application_isolation.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/WGL/ARB/robustness_application_isolation.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/WGL/ARB/robustness_application_isolation.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
imp... | 40.25 | 136 | 0.805901 | from OpenGL import platform as _p, arrays
from OpenGL.raw.WGL import _types as _cs
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'WGL_ARB_robustness_application_isolation'
def _f( function ):
return _p.crea... | true | true |
f774c111b3e7c06cc1bc69aa54df0b531e34ee71 | 529 | py | Python | 0000 hihoOnce/170 Word Construction/main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | 0000 hihoOnce/170 Word Construction/main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | 0000 hihoOnce/170 Word Construction/main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | from __future__ import print_function
_ = raw_input()
words = [set(w) for w in raw_input().split()]
result = 0
def search(words, layer=0):
global result
if len(words) + layer <= result:
# simple cut
return
if layer > result:
result = layer
def isConflict(word1, word2):
... | 18.241379 | 70 | 0.601134 | from __future__ import print_function
_ = raw_input()
words = [set(w) for w in raw_input().split()]
result = 0
def search(words, layer=0):
global result
if len(words) + layer <= result:
return
if layer > result:
result = layer
def isConflict(word1, word2):
return a... | true | true |
f774c1eb583619f72d23766d6534a67933673d58 | 26,669 | py | Python | tensorflow/python/ops/ragged/ragged_math_ops.py | computerwala/tensorflow | 97164413d009aa6506f269eff7fb78411419146d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/ragged/ragged_math_ops.py | computerwala/tensorflow | 97164413d009aa6506f269eff7fb78411419146d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/ragged/ragged_math_ops.py | computerwala/tensorflow | 97164413d009aa6506f269eff7fb78411419146d | [
"Apache-2.0"
] | null | null | null | # 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... | 45.125212 | 86 | 0.651993 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_util
from tensorflow.python.ops import array_ops
fr... | true | true |
f774c2233b9eb69a83b58c597ddb2eed30e59313 | 6,437 | py | Python | pyne/transmute/origen22.py | makoziol0/pyne | 660b1bdd608d9b227d6a432737303f7e82af4a25 | [
"MIT"
] | 1 | 2019-10-10T14:14:11.000Z | 2019-10-10T14:14:11.000Z | pyne/transmute/origen22.py | makoziol0/pyne | 660b1bdd608d9b227d6a432737303f7e82af4a25 | [
"MIT"
] | 58 | 2019-01-07T16:13:26.000Z | 2019-05-09T15:56:26.000Z | pyne/transmute/origen22.py | makoziol0/pyne | 660b1bdd608d9b227d6a432737303f7e82af4a25 | [
"MIT"
] | null | null | null | """This module implements an ORIGEN v2.2 transmutation solver.
"""
from __future__ import print_function, division
import os
import subprocess
import tempfile
from collections import Mapping
from warnings import warn
from pyne.utils import QAWarning
import numpy as np
from pyne import data
from pyne import rxname
fr... | 36.782857 | 90 | 0.596862 | from __future__ import print_function, division
import os
import subprocess
import tempfile
from collections import Mapping
from warnings import warn
from pyne.utils import QAWarning
import numpy as np
from pyne import data
from pyne import rxname
from pyne import nucname
from pyne import nuc_data
from pyne import o... | true | true |
f774c27df962b05b6facd7e77f0fbb874d7e8000 | 139 | py | Python | 2021-10-19/open_csv.py | haritavemulakonda/study-python | b0589ae60eb7ad1ff1a0629bc4680ca8e6baca15 | [
"MIT"
] | null | null | null | 2021-10-19/open_csv.py | haritavemulakonda/study-python | b0589ae60eb7ad1ff1a0629bc4680ca8e6baca15 | [
"MIT"
] | null | null | null | 2021-10-19/open_csv.py | haritavemulakonda/study-python | b0589ae60eb7ad1ff1a0629bc4680ca8e6baca15 | [
"MIT"
] | null | null | null | import urllib.request
with urllib.request.urlopen("https://www.google.com/") as response:
html = response.read()
print(html)
| 23.166667 | 68 | 0.683453 | import urllib.request
with urllib.request.urlopen("https://www.google.com/") as response:
html = response.read()
print(html)
| true | true |
f774c3d2bc913a5067c9f38fc3cae50e2f9a834c | 1,417 | py | Python | ex7/computeCentroids.py | SkyAndCloud/Coursera-AndrewNG-ML-Python | 586edffdcc3e0811ac186a00b78897b0a75a07d0 | [
"MIT"
] | 3 | 2017-10-22T13:18:03.000Z | 2017-10-26T11:46:20.000Z | ex7/computeCentroids.py | SkyAndCloud/Coursera-AndrewNG-ML-Python | 586edffdcc3e0811ac186a00b78897b0a75a07d0 | [
"MIT"
] | null | null | null | ex7/computeCentroids.py | SkyAndCloud/Coursera-AndrewNG-ML-Python | 586edffdcc3e0811ac186a00b78897b0a75a07d0 | [
"MIT"
] | 1 | 2018-10-16T01:50:45.000Z | 2018-10-16T01:50:45.000Z | import numpy as np
def computeCentroids(X, idx, K):
"""returns the new centroids by
computing the means of the data points assigned to each centroid. It is
given a dataset X where each row is a single data point, a vector
idx of centroid assignments (i.e. each entry in range [1..K]) for each
examp... | 33.738095 | 78 | 0.580805 | import numpy as np
def computeCentroids(X, idx, K):
m, n = X.shape
centroids = np.zeros((K, X.shape[1]))
idx_count = np.bincount(idx)
for k in xrange(K):
if k < len(idx_count):
centroids[k] = np.sum(X[idx == k,:], axis=0) / float(idx_count[k])
return centroids
| true | true |
f774c42d7c1437f73a041c826f5f65e31d2f4b26 | 11,705 | py | Python | samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py | NoTuxNoBux/openapi-generator | 6f37409d2be846d542e37ea496ac0c807a7c7cf5 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py | NoTuxNoBux/openapi-generator | 6f37409d2be846d542e37ea496ac0c807a7c7cf5 | [
"Apache-2.0"
] | 1 | 2022-03-31T06:33:56.000Z | 2022-03-31T06:33:56.000Z | samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py | tan9/openapi-generator | 7ac90ed98f987284af14a57f492175d28e2eb13d | [
"Apache-2.0"
] | null | null | null | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... | 43.351852 | 174 | 0.56446 |
import re import sys
from petstore_api.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenAp... | true | true |
f774c6e8b6d7fe60b2cde452e2a3bb10dd1c6f7f | 12,807 | py | Python | adafruit_bme280/advanced.py | jposada202020/Adafruit_CircuitPython_BME280 | ccb982df8523c78a95b6aa83d0c717c4704b5dc9 | [
"Unlicense",
"MIT-0",
"MIT"
] | 1 | 2022-01-29T03:16:57.000Z | 2022-01-29T03:16:57.000Z | adafruit_bme280/advanced.py | jposada202020/Adafruit_CircuitPython_BME280 | ccb982df8523c78a95b6aa83d0c717c4704b5dc9 | [
"Unlicense",
"MIT-0",
"MIT"
] | 15 | 2021-09-22T08:36:08.000Z | 2022-01-26T08:51:42.000Z | circuitPython/examples/internet-data-display/lib/adafruit/adafruit_bme280/advanced.py | BRTSG-FOSS/pico-bteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_bme280.advanced`
=========================================================================================
CircuitPython driver from BME280 Temperature, Humidity and Barometric
Pressure sensor
* Author(s): l... | 32.097744 | 102 | 0.663387 |
from micropython import const
from adafruit_bme280.basic import Adafruit_BME280
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BME280.git"
_BME280_ADDRESS = const(0x77)
_BME280_CHIPID = const(0x60)
_BME280_REGISTER_CHIPID = const(0xD0)
_BME280_REGISTER_DIG_T1 = const(0x8... | true | true |
f774c72756657a3c7c7697ede87a4b30c686c502 | 1,272 | py | Python | var/spack/repos/builtin/packages/relax/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/relax/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/relax/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Relax(CMakePackage):
"""A set of Reflex libraries for the most common used general data ty... | 31.8 | 91 | 0.644654 |
from spack import *
class Relax(CMakePackage):
homepage = "https://twiki.cern.ch/twiki/bin/view/LCG/RELAX"
url = "http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources/RELAX-1.tar.gz"
tags = ['hep']
version('root6')
depends_on('clhep')
depends_on('gsl')
depends_on('... | true | true |
f774c766397876a1b36b7cf3fcaf3c5dafe8d7a8 | 4,613 | py | Python | docs/main.py | gkno/seqan | f6258bcb33cc9760b8c5ef99f58781224b725554 | [
"BSD-3-Clause"
] | 1 | 2017-10-24T20:37:58.000Z | 2017-10-24T20:37:58.000Z | docs/main.py | gkno/seqan | f6258bcb33cc9760b8c5ef99f58781224b725554 | [
"BSD-3-Clause"
] | null | null | null | docs/main.py | gkno/seqan | f6258bcb33cc9760b8c5ef99f58781224b725554 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# import dddoc
# import dddoc_html
# import sys
# import os
#
# # Command line: main.py <inpath> [ <module> ]*
#
# if len(sys.argv) < 2: inpath = "../../projects/library"
# else: inpath = sys.argv[1]
#
# print("Welcome to Dot.Dot.Doc")
#
# buildfull = (len(sys.argv) < 3)
# indexonly = not bui... | 28.83125 | 99 | 0.57403 |
import optparse
import os
import sys
import dddoc
import dddoc_html
HEADER = """
----------------------------------------------------------------------
Dot.Dot.Doc documentation generator.
----------------------------------------------------------------------
""".strip()
CMD_HELP = """
Usage: %s <base path> [ <... | false | true |
f774c7a30c389a94803292ef3cbb80c5c8edca55 | 2,619 | py | Python | sinks/plot/plot.py | waterloo-rocketry/omnibus | 5a80f926c6ea52f6a15b152783753b840827ebcb | [
"MIT"
] | 2 | 2021-05-31T01:46:43.000Z | 2021-07-17T19:46:16.000Z | sinks/plot/plot.py | waterloo-rocketry/omnibus | 5a80f926c6ea52f6a15b152783753b840827ebcb | [
"MIT"
] | 17 | 2021-04-10T04:28:44.000Z | 2021-12-23T23:05:00.000Z | sinks/plot/plot.py | waterloo-rocketry/omnibus | 5a80f926c6ea52f6a15b152783753b840827ebcb | [
"MIT"
] | 4 | 2021-05-28T22:52:17.000Z | 2021-12-02T02:22:48.000Z | import signal
import time
import numpy as np
from pyqtgraph.Qt import QtCore
import pyqtgraph as pg
import config
from pyqtgraph.graphicsItems.LabelItem import LabelItem
from pyqtgraph.graphicsItems.TextItem import TextItem
class Plotter:
"""
Displays a grid of plots in a window
"""
def __init__(se... | 30.453488 | 99 | 0.612447 | import signal
import time
import numpy as np
from pyqtgraph.Qt import QtCore
import pyqtgraph as pg
import config
from pyqtgraph.graphicsItems.LabelItem import LabelItem
from pyqtgraph.graphicsItems.TextItem import TextItem
class Plotter:
def __init__(self, series, callback):
self.series = series
... | true | true |
f774c7c52c7d4597e433e62c5237421dc53adaee | 497 | py | Python | build/turtlebot3_msgs/catkin_generated/pkg.develspace.context.pc.py | BaltimoreBolts/game-design | 296566f74e57ca73384c92ec8032613190bc30bd | [
"MIT"
] | 1 | 2021-01-28T00:11:13.000Z | 2021-01-28T00:11:13.000Z | build/turtlebot3_msgs/catkin_generated/pkg.develspace.context.pc.py | BaltimoreBolts/game-design | 296566f74e57ca73384c92ec8032613190bc30bd | [
"MIT"
] | null | null | null | build/turtlebot3_msgs/catkin_generated/pkg.develspace.context.pc.py | BaltimoreBolts/game-design | 296566f74e57ca73384c92ec8032613190bc30bd | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/tyler/Github/game-design/devel/include".split(';') if "/home/tyler/Github/game-design/devel/include" != "" else []
PROJECT_CATKIN_DEPENDS = "std_msgs;message_runtime".replace(';', ' ')
PKG_CONFIG... | 55.222222 | 155 | 0.744467 | CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/tyler/Github/game-design/devel/include".split(';') if "/home/tyler/Github/game-design/devel/include" != "" else []
PROJECT_CATKIN_DEPENDS = "std_msgs;message_runtime".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [... | true | true |
f774c7e40e69409964c08be7f9cca7663aa232e4 | 7,834 | py | Python | contrib/bitrpc/bitrpc.py | lacoin2020/lacoin | e0bd0cc3e4062f20c93516f5abb1dbfdc7b64589 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | lacoin2020/lacoin | e0bd0cc3e4062f20c93516f5abb1dbfdc7b64589 | [
"MIT"
] | 1 | 2020-06-28T22:41:01.000Z | 2020-06-28T22:41:01.000Z | contrib/bitrpc/bitrpc.py | lacoin2020/lacoin | e0bd0cc3e4062f20c93516f5abb1dbfdc7b64589 | [
"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:2992")
else:
access = Ser... | 24.104615 | 79 | 0.668113 | from jsonrpc import ServiceProxy
import sys
import string
rpcuser = ""
rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:2992")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:2992")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":
try:
path = raw_input("Enter dest... | false | true |
f774c87e14d9816dc2709a3243e7d17758df2fc4 | 7,915 | py | Python | modules/sfp_snov.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | modules/sfp_snov.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | modules/sfp_snov.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_snov
# Purpose: Spiderfoot plugin to search Snov.IO API for emails
# associated to target domain
#
# Author: Krishnasis Mandal <krishnasis@hotmail.com>
#
# Created: 1... | 34.867841 | 115 | 0.548326 |
import json
import urllib.error
import urllib.parse
import urllib.request
from spiderfoot import SpiderFootEvent, SpiderFootHelpers, SpiderFootPlugin
class sfp_snov(SpiderFootPlugin):
meta = {
'name': "Snov",
'summary': "Gather available email IDs from identified domains",
'flags': ["ap... | true | true |
f774c8c5efc31ef2a39b97f85d9bee8e84103b18 | 150 | py | Python | Views/__init__.py | HaroldHaldemann/ChessTournament | 91f3745f56b59b4b02301400df784cbe529d72e1 | [
"Apache-2.0"
] | null | null | null | Views/__init__.py | HaroldHaldemann/ChessTournament | 91f3745f56b59b4b02301400df784cbe529d72e1 | [
"Apache-2.0"
] | null | null | null | Views/__init__.py | HaroldHaldemann/ChessTournament | 91f3745f56b59b4b02301400df784cbe529d72e1 | [
"Apache-2.0"
] | null | null | null | from .menus_view import MenuView
from .players_view import PlayerView
from .tournaments_view import TournamentView
from .rounds_view import RoundView
| 30 | 44 | 0.866667 | from .menus_view import MenuView
from .players_view import PlayerView
from .tournaments_view import TournamentView
from .rounds_view import RoundView
| true | true |
f774ca8397ae3fee67db89caf14d7feaf02ca852 | 14,052 | py | Python | pimodel.py | YaxinCui/TorchSSL | 5603d16dfcb62e558c298f999a613f6f9d2c49de | [
"MIT"
] | null | null | null | pimodel.py | YaxinCui/TorchSSL | 5603d16dfcb62e558c298f999a613f6f9d2c49de | [
"MIT"
] | null | null | null | pimodel.py | YaxinCui/TorchSSL | 5603d16dfcb62e558c298f999a613f6f9d2c49de | [
"MIT"
] | null | null | null | # import needed library
import os
import logging
import random
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.multiprocessing as mp
from utils import net_builder, get_logger, count_parame... | 42.581818 | 149 | 0.603829 | import os
import logging
import random
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.multiprocessing as mp
from utils import net_builder, get_logger, count_parameters, over_write_args_fr... | true | true |
f774ca8d4bf203439a209d101d70c5a9b35c06ae | 4,408 | py | Python | processwrapper.py | waydan/embedded-micro-benchmark | acbf14f77391a4130a75590575187af70bd15183 | [
"MIT"
] | null | null | null | processwrapper.py | waydan/embedded-micro-benchmark | acbf14f77391a4130a75590575187af70bd15183 | [
"MIT"
] | null | null | null | processwrapper.py | waydan/embedded-micro-benchmark | acbf14f77391a4130a75590575187af70bd15183 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 21 14:43:51 2020
@author: w6733
"""
from subprocess import Popen, PIPE
from threading import Thread
from queue import Queue, Empty
import shlex
import re
from time import time#, sleep
def strip_newline(string):
nl_match = re.compile(r'(?P<str>^.*)[/r/n]*$')
retur... | 30.4 | 84 | 0.507486 | from subprocess import Popen, PIPE
from threading import Thread
from queue import Queue, Empty
import shlex
import re
from time import time
def strip_newline(string):
nl_match = re.compile(r'(?P<str>^.*)[/r/n]*$')
return nl_match.match(string)['str']
def file_reader(file, buffer):
for line in iter(fi... | true | true |
f774cae22fcc9dd2fad772beb3c4416185f0fe94 | 546 | py | Python | iscc_registry/__init__.py | titusz/iscc-registry | def03f420e671ec470070bb09b6a78099f7827da | [
"MIT"
] | 3 | 2020-07-06T16:01:54.000Z | 2020-08-06T11:03:25.000Z | iscc_registry/__init__.py | titusz/iscc-registry | def03f420e671ec470070bb09b6a78099f7827da | [
"MIT"
] | null | null | null | iscc_registry/__init__.py | titusz/iscc-registry | def03f420e671ec470070bb09b6a78099f7827da | [
"MIT"
] | null | null | null | from os.path import join
from pydantic import BaseSettings
import appdirs
APP_NAME = "iscc-registry"
APP_DIR = appdirs.user_data_dir(appname=APP_NAME)
ENV_PATH = join(APP_DIR, ".env")
__version__ = "0.1.0"
# Ledger-ID Ethereum
LEDGER_ID_ETH = 0b01000000 .to_bytes(1, "big")
class Settings(BaseSettings):
ipfs_a... | 21.84 | 54 | 0.716117 | from os.path import join
from pydantic import BaseSettings
import appdirs
APP_NAME = "iscc-registry"
APP_DIR = appdirs.user_data_dir(appname=APP_NAME)
ENV_PATH = join(APP_DIR, ".env")
__version__ = "0.1.0"
LEDGER_ID_ETH = 0b01000000 .to_bytes(1, "big")
class Settings(BaseSettings):
ipfs_address: str = "/ip4/1... | true | true |
f774cc2c6e6a981c5e0704e179681a9d369ed111 | 3,715 | py | Python | bitbots_motion/bitbots_dynamic_kick/scripts/dummy_client.py | MosHumanoid/bitbots_thmos_meta | f45ccc362dc689b69027be5b0d000d2a08580de4 | [
"MIT"
] | null | null | null | bitbots_motion/bitbots_dynamic_kick/scripts/dummy_client.py | MosHumanoid/bitbots_thmos_meta | f45ccc362dc689b69027be5b0d000d2a08580de4 | [
"MIT"
] | null | null | null | bitbots_motion/bitbots_dynamic_kick/scripts/dummy_client.py | MosHumanoid/bitbots_thmos_meta | f45ccc362dc689b69027be5b0d000d2a08580de4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import actionlib
import argparse
import math
import os
import random
import rospy
import sys
from time import sleep
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Vector3, Quaternion
from bitbots_msgs.msg import KickGoal, KickAction, KickFeedback
from visualization_msgs... | 32.025862 | 107 | 0.659758 |
import actionlib
import argparse
import math
import os
import random
import rospy
import sys
from time import sleep
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Vector3, Quaternion
from bitbots_msgs.msg import KickGoal, KickAction, KickFeedback
from visualization_msgs.msg import Marker
fro... | true | true |
f774cd24427d73cea99996ae10615660854b248c | 14,343 | py | Python | topo/tests/unit/testplot.py | ioam/topographica | 1e097e2df9938a6ce9f48cefbf25672cbbf9a4db | [
"BSD-3-Clause"
] | 40 | 2015-02-05T14:53:10.000Z | 2020-10-12T06:26:23.000Z | topo/tests/unit/testplot.py | ioam/topographica | 1e097e2df9938a6ce9f48cefbf25672cbbf9a4db | [
"BSD-3-Clause"
] | 95 | 2015-01-01T16:14:20.000Z | 2022-02-11T22:50:27.000Z | topo/tests/unit/testplot.py | ioam/topographica | 1e097e2df9938a6ce9f48cefbf25672cbbf9a4db | [
"BSD-3-Clause"
] | 22 | 2015-05-03T10:24:17.000Z | 2019-11-15T06:34:31.000Z | """
Test for the Plot class.
"""
import unittest
from topo.base.sheet import *
#from testsheetview import ImageGenerator
SHOW_PLOTS = False
### JC: My new imports
from topo.plotting.plot import make_template_plot
import numpy as np
import param
from holoviews.core import BoundingBox, NdMapping
from holoviews.inte... | 38.453083 | 111 | 0.592066 |
import unittest
from topo.base.sheet import *
SHOW_PLOTS = False
from topo.plotting.plot import make_template_plot
import numpy as np
import param
from holoviews.core import BoundingBox, NdMapping
from holoviews.interface.collector import AttrDict
from holoviews import Image
def matrix_hsv_to_rgb(hMapArray,sMap... | true | true |
f774ce292c19faf2237428758d20af4a95bf3578 | 13,448 | py | Python | anti_alignment/algo/graph_construction/search_tree.py | workprinond/Anti-Alignment | 12783fcc7f3c208007bf15d750a3659fd92506f0 | [
"Apache-2.0"
] | null | null | null | anti_alignment/algo/graph_construction/search_tree.py | workprinond/Anti-Alignment | 12783fcc7f3c208007bf15d750a3659fd92506f0 | [
"Apache-2.0"
] | null | null | null | anti_alignment/algo/graph_construction/search_tree.py | workprinond/Anti-Alignment | 12783fcc7f3c208007bf15d750a3659fd92506f0 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import networkx as nx
class SearchTree:
def __init__(self,net,i_m, f_m):
self.net = net
self.i_m = i_m
self.f_m = f_m
def compute_incidence_matrix(self,net):
"""
We compute the incidence matrix of a Petri Net. It provides us with the firing requirem... | 56.033333 | 164 | 0.64017 | import numpy as np
import networkx as nx
class SearchTree:
def __init__(self,net,i_m, f_m):
self.net = net
self.i_m = i_m
self.f_m = f_m
def compute_incidence_matrix(self,net):
incidence_matrix=np.zeros((len(self.net.places), len(self.net.transitions)))
transitions=li... | true | true |
f774ce83ae930026803ecf49c5536348ad8b1563 | 4,092 | py | Python | tests/workflow/concurrent/test_plan_node_status.py | ErinCompaan/tamr-toolbox | b28d7f8b981a8068a1230ec33ebfa890060b20de | [
"Apache-2.0"
] | 6 | 2021-02-09T22:27:55.000Z | 2022-01-14T18:15:17.000Z | tests/workflow/concurrent/test_plan_node_status.py | ErinCompaan/tamr-toolbox | b28d7f8b981a8068a1230ec33ebfa890060b20de | [
"Apache-2.0"
] | 34 | 2021-02-09T22:23:33.000Z | 2022-03-31T16:22:51.000Z | tests/workflow/concurrent/test_plan_node_status.py | ErinCompaan/tamr-toolbox | b28d7f8b981a8068a1230ec33ebfa890060b20de | [
"Apache-2.0"
] | 12 | 2021-02-09T21:17:10.000Z | 2022-02-09T16:35:39.000Z | """Tests for updating PlanNodeStatus"""
import time
from tamr_unify_client.operation import Operation
from tamr_toolbox.workflow.concurrent import PlanNodeStatus, PlanNode
from tamr_toolbox.utils.testing import mock_api
from tamr_toolbox import utils
from tests._common import get_toolbox_root_dir
CONFIG = utils.conf... | 41.755102 | 99 | 0.737048 | import time
from tamr_unify_client.operation import Operation
from tamr_toolbox.workflow.concurrent import PlanNodeStatus, PlanNode
from tamr_toolbox.utils.testing import mock_api
from tamr_toolbox import utils
from tests._common import get_toolbox_root_dir
CONFIG = utils.config.from_yaml(
get_toolbox_root_dir()... | true | true |
f774cef770f4cbacdb0df6a29b9c9c23d5c806cb | 16,005 | py | Python | sdk/python/pulumi_azure/trafficmanager/endpoint.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/trafficmanager/endpoint.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/trafficmanager/endpoint.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"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 typing import Union
from .. import utilities, tables
class Endpoi... | 54.811644 | 358 | 0.67354 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Endpoint(pulumi.CustomResource):
custom_headers: pulumi.Output[list]
endpoint_location: pulumi.Output[str]
endpoint_monitor_status: pulumi.Output[str]
endpoint_status: pulumi... | true | true |
f774cf77a88fcffec788861e99e9d16cab11ca10 | 709 | py | Python | h/notification/views.py | noscripter/h | a7a4095a46683ea08dae62335bbcd53f7ab313e2 | [
"MIT"
] | null | null | null | h/notification/views.py | noscripter/h | a7a4095a46683ea08dae62335bbcd53f7ab313e2 | [
"MIT"
] | null | null | null | h/notification/views.py | noscripter/h | a7a4095a46683ea08dae62335bbcd53f7ab313e2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pyramid.view import view_config
from h.notification.models import Subscriptions
@view_config(route_name='unsubscribe',
renderer='h:templates/unsubscribe.html.jinja2')
def unsubscribe(request):
token = request.matchdict['token']
payload = request.registry.notification... | 25.321429 | 72 | 0.681241 | from pyramid.view import view_config
from h.notification.models import Subscriptions
@view_config(route_name='unsubscribe',
renderer='h:templates/unsubscribe.html.jinja2')
def unsubscribe(request):
token = request.matchdict['token']
payload = request.registry.notification_serializer.loads(token)... | true | true |
f774cf86bc05b17458e7fea364166c842b70e241 | 6,024 | py | Python | phypidaq/groveADCConfig.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | phypidaq/groveADCConfig.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | phypidaq/groveADCConfig.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import numpy as np, time, sys
import smbus2
# code of driver class included below
# import relevant pieces from adafruit
class groveADCConfig(object):
'''grove ADC configuration and in... | 25.965517 | 101 | 0.578353 | from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import numpy as np, time, sys
import smbus2
class groveADCConfig(object):
def __init__(self, confdict = None):
if confdict==None: confdict={}
if 'ADCChannels' in confdict:
self.ADCChannels = co... | true | true |
f774d0182ece55eac98fed0700ebad3818a7aa83 | 3,118 | py | Python | adb/windows/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/sslproxy.py | llaske/sugarizer-deployment-tool-desktop | 34df1a56b68b15b6771671f87ab66586d60c514a | [
"Apache-2.0"
] | 1 | 2019-01-17T19:03:17.000Z | 2019-01-17T19:03:17.000Z | adb/MACOS/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/sslproxy.py | llaske/sugarizer-deployment-tool-desktop | 34df1a56b68b15b6771671f87ab66586d60c514a | [
"Apache-2.0"
] | 2 | 2017-09-08T20:26:05.000Z | 2017-09-08T20:29:07.000Z | adb/windows/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/sslproxy.py | llaske/sugarizer-deployment-tool-desktop | 34df1a56b68b15b6771671f87ab66586d60c514a | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.644444 | 80 | 0.719371 |
"""Extends BaseHTTPRequestHandler with SSL certificate generation."""
import logging
import socket
import certutils
def _SetUpUsingDummyCert(handler):
"""Sets up connection providing the certificate to the client.
This method handles Server Name Indication (SNI) using dummy certs.
Args:
handler: an in... | false | true |
f774d05d2844e2080a688a58b1b24fc01724e986 | 957 | py | Python | blender/arm/logicnode/logic/LN_merge.py | niacdoial/armory | 3f9b633fbf772017c576a3f77695a6c28d9956e1 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/logic/LN_merge.py | niacdoial/armory | 3f9b633fbf772017c576a3f77695a6c28d9956e1 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/logic/LN_merge.py | niacdoial/armory | 3f9b633fbf772017c576a3f77695a6c28d9956e1 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class MergeNode(ArmLogicTreeNode):
"""Activates the output when any connected input is activated.
@option New: Add a new input socket.
@option X Button: Remove the lowermost input socket."""
bl_idname = 'LNMergeNode'
bl_label = 'Merge'
arm_section = 'flow'... | 33 | 85 | 0.652038 | from arm.logicnode.arm_nodes import *
class MergeNode(ArmLogicTreeNode):
bl_idname = 'LNMergeNode'
bl_label = 'Merge'
arm_section = 'flow'
arm_version = 1
def __init__(self):
super(MergeNode, self).__init__()
array_nodes[str(id(self))] = self
def init(self, context):
s... | true | true |
f774d0cb012e3e9c45e079023807954ef5d07ddf | 4,308 | py | Python | archived_projects_(dead)/declare_pyside/qmlside/qmlside.py | likianta/declare-qtquick | 93c2ce49d841ccdeb0272085c5f731139927f0d7 | [
"MIT"
] | 3 | 2021-11-02T03:45:27.000Z | 2022-03-27T05:33:36.000Z | declare_pyside/qmlside/qmlside.py | Likianta/pyml | b0005b36aa94958a7d3e306a9df65fea46669d18 | [
"MIT"
] | null | null | null | declare_pyside/qmlside/qmlside.py | Likianta/pyml | b0005b36aa94958a7d3e306a9df65fea46669d18 | [
"MIT"
] | null | null | null | from secrets import token_hex
from textwrap import dedent
from PySide6.QtCore import QObject
from PySide6.QtQml import QQmlComponent
from lk_logger import lk
from .. import path_model
from ..pyside import app
from ..pyside import pyside
from ..typehint.qmlside import *
def setup():
def register_qmlside(obj: TQO... | 30.553191 | 80 | 0.564067 | from secrets import token_hex
from textwrap import dedent
from PySide6.QtCore import QObject
from PySide6.QtQml import QQmlComponent
from lk_logger import lk
from .. import path_model
from ..pyside import app
from ..pyside import pyside
from ..typehint.qmlside import *
def setup():
def register_qmlside(obj: TQO... | true | true |
f774d21076249cca3948a36241617874a7258c1a | 351 | py | Python | bubblebox/bubblebox.py | audunsh/bubblebox | 61b11c8b0f1c44da81eba4b36a9e786554ac9e0c | [
"MIT"
] | null | null | null | bubblebox/bubblebox.py | audunsh/bubblebox | 61b11c8b0f1c44da81eba4b36a9e786554ac9e0c | [
"MIT"
] | null | null | null | bubblebox/bubblebox.py | audunsh/bubblebox | 61b11c8b0f1c44da81eba4b36a9e786554ac9e0c | [
"MIT"
] | null | null | null | # Bubblebox
# Author: Audun Skau Hansen 2022
import bubblebox.mdbox
import bubblebox.binding_models
import bubblebox.ising
import bubblebox.lattice_models
from bubblebox.mdbox import mdbox, box
from bubblebox.binding_models import bindingbox
from bubblebox.ising import isingbox
from bubblebox.lattice_models import ... | 21.9375 | 47 | 0.846154 |
import bubblebox.mdbox
import bubblebox.binding_models
import bubblebox.ising
import bubblebox.lattice_models
from bubblebox.mdbox import mdbox, box
from bubblebox.binding_models import bindingbox
from bubblebox.ising import isingbox
from bubblebox.lattice_models import latticebox
import numpy as np | true | true |
f774d2cb73653cce5290685e09d255267114feec | 2,162 | py | Python | towards_gan_benchmarks/lib/flags.py | kiss2u/google-research | 2cd66234656f9e2f4218ed90a2d8aa9cf3139093 | [
"Apache-2.0"
] | 7 | 2020-03-15T12:14:07.000Z | 2021-12-01T07:01:09.000Z | towards_gan_benchmarks/lib/flags.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | towards_gan_benchmarks/lib/flags.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.794118 | 80 | 0.683626 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import base64
import json
import absl.flags
absl.flags.DEFINE_string("nn_flags", None, "Flags dict as b64-encoded JSON")
class Flags(dict):
__getattr__ = dict.get
__setattr__ = dict.__setitem__
__delat... | true | true |
f774d2fc5c69532b24aac7fda0f0c4e0431d2aac | 57,053 | py | Python | demo_data.py | adh/appshell | 94901df8045336e3217eb2fd5eae77cb7c639340 | [
"MIT"
] | 3 | 2015-08-21T22:22:52.000Z | 2018-07-14T03:32:51.000Z | demo_data.py | adh/appshell | 94901df8045336e3217eb2fd5eae77cb7c639340 | [
"MIT"
] | null | null | null | demo_data.py | adh/appshell | 94901df8045336e3217eb2fd5eae77cb7c639340 | [
"MIT"
] | 1 | 2015-08-21T22:22:57.000Z | 2015-08-21T22:22:57.000Z | l = [
{
"name": "Karyn Hewitt",
"email": "malesuada@Sedneque.org",
"created": "2014-05-01T12:46:02-07:00",
"company": "Scelerisque Scelerisque Corporation",
"address": "1355 Semper. Av.",
"city": "Oostkerke",
"gps": "4.43078, -70.00362",
"iban": "AD2767222199357116156730"
},
{
"name": "Amelia Hayes... | 28.483774 | 68 | 0.618074 | l = [
{
"name": "Karyn Hewitt",
"email": "malesuada@Sedneque.org",
"created": "2014-05-01T12:46:02-07:00",
"company": "Scelerisque Scelerisque Corporation",
"address": "1355 Semper. Av.",
"city": "Oostkerke",
"gps": "4.43078, -70.00362",
"iban": "AD2767222199357116156730"
},
{
"name": "Amelia Hayes... | true | true |
f774d39ecc6b721c8bc4adfe5546959219ef4b68 | 5,071 | py | Python | explorer/tests/api_faucet.py | jtimon/elements-explorer | 397089593e860c4bdceb3a1222687a9120db0022 | [
"MIT"
] | 9 | 2018-01-25T16:32:18.000Z | 2018-10-10T18:47:33.000Z | explorer/tests/api_faucet.py | jtimon/elements-explorer | 397089593e860c4bdceb3a1222687a9120db0022 | [
"MIT"
] | 2 | 2018-03-13T20:50:33.000Z | 2018-03-13T21:01:22.000Z | explorer/tests/api_faucet.py | jtimon/elements-explorer | 397089593e860c4bdceb3a1222687a9120db0022 | [
"MIT"
] | 2 | 2018-02-20T17:50:18.000Z | 2018-02-26T07:29:15.000Z | #!/usr/bin/env python
# Copyright (c) 2018-2018 The Elements Explorer developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
if __name__ != '__main__':
raise ImportError(u"%s may only be run as a script" % __file__)
prin... | 34.496599 | 136 | 0.550582 |
if __name__ != '__main__':
raise ImportError(u"%s may only be run as a script" % __file__)
print('Running %s' % (__file__))
from explorer.resources.faucet import FaucetInfoResource, FreeCoinsResource
from explorer.test_tools.test_prototypes import RepeatPerAvailableChainTest
class FaucetTest(RepeatPerAvailab... | true | true |
f774d3c617317e56a770cd96c94ea60d3649df59 | 8,593 | py | Python | viewformer/evaluate/evaluate_transformer_multictx_allimg.py | jkulhanek/viewformer | 9ad2c5a2f7abe4b7ff490ced0132bf3d2f07e29c | [
"MIT"
] | 87 | 2022-03-22T02:03:17.000Z | 2022-03-31T01:45:52.000Z | viewformer/evaluate/evaluate_transformer_multictx_allimg.py | jkulhanek/viewformer | 9ad2c5a2f7abe4b7ff490ced0132bf3d2f07e29c | [
"MIT"
] | null | null | null | viewformer/evaluate/evaluate_transformer_multictx_allimg.py | jkulhanek/viewformer | 9ad2c5a2f7abe4b7ff490ced0132bf3d2f07e29c | [
"MIT"
] | 5 | 2022-03-22T10:39:34.000Z | 2022-03-28T02:05:28.000Z | from aparse import click, ConditionalType
import os
import tqdm
import json
import numpy as np
from PIL import Image
from typing import Optional
from typing import List
from viewformer.utils.tensorflow import load_model
from viewformer.data.loaders import get_loaders
import tensorflow as tf
from viewformer.evaluate.eva... | 50.251462 | 172 | 0.659723 | from aparse import click, ConditionalType
import os
import tqdm
import json
import numpy as np
from PIL import Image
from typing import Optional
from typing import List
from viewformer.utils.tensorflow import load_model
from viewformer.data.loaders import get_loaders
import tensorflow as tf
from viewformer.evaluate.eva... | true | true |
f774d57ec3b5d5f343f52fe28f7a56bcdb9f177c | 1,226 | py | Python | test_gen_ascii.py | extremepayne/py-generate-ascii | e670e8dfc088b4640846ceebcbc2355181512693 | [
"MIT"
] | 1 | 2020-06-28T17:08:01.000Z | 2020-06-28T17:08:01.000Z | test_gen_ascii.py | extremepayne/py-generate-ascii | e670e8dfc088b4640846ceebcbc2355181512693 | [
"MIT"
] | 8 | 2019-04-16T01:57:31.000Z | 2019-04-25T20:04:46.000Z | test_gen_ascii.py | extremepayne/py-generate-ascii | e670e8dfc088b4640846ceebcbc2355181512693 | [
"MIT"
] | null | null | null | import platform
from PIL import Image
import constants
import gen_ascii
CHARS = gen_ascii.get_char_set(
constants.CHAR_DARKNESS_TEXT_ONLY, constants.MAX_VAL
)
more = gen_ascii.get_char_set(
constants.CHAR_DARKNESS_NON_TEXT, constants.MAX_VAL
)
i = 0
for smaller_list in CHARS:
for character in more[i]:
... | 24.039216 | 66 | 0.654976 | import platform
from PIL import Image
import constants
import gen_ascii
CHARS = gen_ascii.get_char_set(
constants.CHAR_DARKNESS_TEXT_ONLY, constants.MAX_VAL
)
more = gen_ascii.get_char_set(
constants.CHAR_DARKNESS_NON_TEXT, constants.MAX_VAL
)
i = 0
for smaller_list in CHARS:
for character in more[i]:
... | true | true |
f774d6e99b716c059135b4ee1c09994c363fb975 | 12,116 | py | Python | boneless/arch/mc.py | whitequark/Boneless-CPU | bdf1eefccc86f4c4b23ad69172b4a441a29c29cf | [
"Apache-2.0",
"0BSD"
] | 86 | 2018-12-24T03:47:53.000Z | 2021-10-04T22:53:05.000Z | boneless/arch/mc.py | whitequark/Boneless-CPU | bdf1eefccc86f4c4b23ad69172b4a441a29c29cf | [
"Apache-2.0",
"0BSD"
] | 9 | 2018-12-25T06:56:42.000Z | 2020-04-13T02:12:33.000Z | boneless/arch/mc.py | whitequark/Boneless-CPU | bdf1eefccc86f4c4b23ad69172b4a441a29c29cf | [
"Apache-2.0",
"0BSD"
] | 6 | 2018-12-25T05:59:32.000Z | 2021-05-02T07:41:47.000Z | import abc
import re
import textwrap
from parse import parse
from string import Formatter
__all__ = ["UnresolvedRef", "Label", "Operand", "Instr"]
class UnresolvedRef(Exception):
pass
class Label:
__slots__ = ["name"]
def __init__(self, name):
self.name = name
def __repr__(self):
... | 38.585987 | 99 | 0.545147 | import abc
import re
import textwrap
from parse import parse
from string import Formatter
__all__ = ["UnresolvedRef", "Label", "Operand", "Instr"]
class UnresolvedRef(Exception):
pass
class Label:
__slots__ = ["name"]
def __init__(self, name):
self.name = name
def __repr__(self):
... | true | true |
f774d74b78c63fca445b6f9b7c9e811500cde2d5 | 10,713 | py | Python | fastpitch/transformer_jit.py | kdorichev/text2speech | 082ed9c222fa346f6c5ad6375477807df44ed45a | [
"Apache-2.0"
] | 3 | 2020-07-08T21:25:18.000Z | 2021-10-04T05:44:38.000Z | fastpitch/transformer_jit.py | kdorichev/text2speech | 082ed9c222fa346f6c5ad6375477807df44ed45a | [
"Apache-2.0"
] | 2 | 2020-05-22T18:06:46.000Z | 2020-07-06T08:22:40.000Z | fastpitch/transformer_jit.py | kdorichev/text2speech | 082ed9c222fa346f6c5ad6375477807df44ed45a | [
"Apache-2.0"
] | null | null | null | # Adapted from
# https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/FastPitch
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | 34.782468 | 94 | 0.604406 |
from typing import List, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from common.utils import mask_from_lens
from common.text.symbols import pad_idx, symbols
class NoOp(nn.Module):
def forward(self, x):
return x
class PositionalEmbedding(nn.Module):
def __init__(s... | true | true |
f774d761a3ebd76635bf14ce17f92b532085e29a | 387 | py | Python | src/ControlTasks/test_control_task.py | CornellDataScience/self-driving-car | 449044840abdeed9f547a16cd192950e23ba189c | [
"MIT"
] | 3 | 2021-09-29T21:15:25.000Z | 2021-11-11T20:57:07.000Z | src/ControlTasks/test_control_task.py | CornellDataScience/self-driving-car | 449044840abdeed9f547a16cd192950e23ba189c | [
"MIT"
] | 44 | 2021-09-28T05:38:43.000Z | 2022-03-31T21:29:48.000Z | src/ControlTasks/test_control_task.py | CornellDataScience/self-driving-car | 449044840abdeed9f547a16cd192950e23ba189c | [
"MIT"
] | null | null | null | # not to use sys and use python packages
from .control_task_base import ControlTaskBase
""" This test control task demonstrates how to set and read info from the SFR"""
class TestControlTask(ControlTaskBase):
def __init__(self):
pass
def default(self):
self.sfr.set("test", True)
def ex... | 21.5 | 80 | 0.666667 |
from .control_task_base import ControlTaskBase
class TestControlTask(ControlTaskBase):
def __init__(self):
pass
def default(self):
self.sfr.set("test", True)
def execute(self):
res = self.sfr.get("test")
print(res)
| true | true |
f774d8304d9502ae1462ab7095a7353bf933018a | 989 | py | Python | api/app/v2/views/user.py | Chell0/store-manager-api | 2951005544d009df93d67258406f0387d41adeac | [
"MIT"
] | 1 | 2022-01-06T09:29:46.000Z | 2022-01-06T09:29:46.000Z | api/app/v2/views/user.py | Chell0/store-manager-api | 2951005544d009df93d67258406f0387d41adeac | [
"MIT"
] | null | null | null | api/app/v2/views/user.py | Chell0/store-manager-api | 2951005544d009df93d67258406f0387d41adeac | [
"MIT"
] | null | null | null | import psycopg2
from flask_restful import Resource, reqparse
from api.app.v2.models.user import UserModel
class UserRegistration(Resource):
"""User registration class."""
parser = reqparse.RequestParser()
parser.add_argument('name',
type=str,
required=True,
help="Name cannot be... | 22.477273 | 67 | 0.610718 | import psycopg2
from flask_restful import Resource, reqparse
from api.app.v2.models.user import UserModel
class UserRegistration(Resource):
parser = reqparse.RequestParser()
parser.add_argument('name',
type=str,
required=True,
help="Name cannot be blank!"
)
parser.add_argum... | true | true |
f774d96e63b2d8f693f109fd80215c68aa5eff9c | 487 | py | Python | copulae/errors.py | Wittgensteen/copulae | 5db0cecb5b577d520f06b2b4a3d03aa0e08b633a | [
"MIT"
] | null | null | null | copulae/errors.py | Wittgensteen/copulae | 5db0cecb5b577d520f06b2b4a3d03aa0e08b633a | [
"MIT"
] | 1 | 2020-03-10T23:05:50.000Z | 2020-03-10T23:05:50.000Z | copulae/errors.py | Wittgensteen/copulae | 5db0cecb5b577d520f06b2b4a3d03aa0e08b633a | [
"MIT"
] | null | null | null | import inspect
class NotApplicableError(Exception):
"""Raised when a method of a class instance is called but when such class should not call the method"""
def __init__(self, *args):
if len(args) == 0:
stack = inspect.stack()[1]
_class = stack.frame.f_locals['self'].__class__.... | 32.466667 | 107 | 0.632444 | import inspect
class NotApplicableError(Exception):
def __init__(self, *args):
if len(args) == 0:
stack = inspect.stack()[1]
_class = stack.frame.f_locals['self'].__class__.__name__
_method = stack.function
args = [f"'{_method}' is not defined for {_class}"... | true | true |
f774d96fcddf7c44948ed5a1f2643514554fefd7 | 130,350 | py | Python | great_expectations/expectations/metrics/map_metric_provider.py | a-chumagin/great_expectations | 969dacbd4e0fce74ce515e5f1dcd0918785bcd21 | [
"Apache-2.0"
] | null | null | null | great_expectations/expectations/metrics/map_metric_provider.py | a-chumagin/great_expectations | 969dacbd4e0fce74ce515e5f1dcd0918785bcd21 | [
"Apache-2.0"
] | null | null | null | great_expectations/expectations/metrics/map_metric_provider.py | a-chumagin/great_expectations | 969dacbd4e0fce74ce515e5f1dcd0918785bcd21 | [
"Apache-2.0"
] | null | null | null | import logging
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Type, Union
import numpy as np
import great_expectations.exceptions as ge_exceptions
from great_expectations.core import ExpectationConfiguration
from great_expectations.core.util import convert_to_json_serializable
fro... | 39.214801 | 148 | 0.606759 | import logging
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Type, Union
import numpy as np
import great_expectations.exceptions as ge_exceptions
from great_expectations.core import ExpectationConfiguration
from great_expectations.core.util import convert_to_json_serializable
fro... | true | true |
f774da22de7011eb69526f117d89742c41cee316 | 1,617 | py | Python | promissory_note/use_cases.py | flaviogf/promissory_note | 6250515c1688a450e325b8fa0d22be62c8aad43f | [
"MIT"
] | 1 | 2019-10-08T20:12:52.000Z | 2019-10-08T20:12:52.000Z | promissory_note/use_cases.py | flaviogf/promissory_note | 6250515c1688a450e325b8fa0d22be62c8aad43f | [
"MIT"
] | 1 | 2019-05-04T23:58:24.000Z | 2019-05-07T11:23:10.000Z | promissory_note/use_cases.py | flaviogf/promissory_note | 6250515c1688a450e325b8fa0d22be62c8aad43f | [
"MIT"
] | null | null | null | from promissory_note.entities import Beneficiary, Emitter, PromissoryNote
from promissory_note.value_objects import Name, Cpf, Email
class IssuePromissoryNote:
def __init__(self, image_generation_service, email_promissory_note_issued):
self._image_generation_service = image_generation_service
self... | 49 | 98 | 0.573284 | from promissory_note.entities import Beneficiary, Emitter, PromissoryNote
from promissory_note.value_objects import Name, Cpf, Email
class IssuePromissoryNote:
def __init__(self, image_generation_service, email_promissory_note_issued):
self._image_generation_service = image_generation_service
self... | true | true |
f774dbfdc1cc5c17535bc6238d876072ca90ba0a | 6,441 | py | Python | demo/create_training_data.py | viveksjoseph/keras-english-resume-parser-and-analyzer | 0272e459350a66868e233856e3574fcbeef7c26b | [
"MIT"
] | null | null | null | demo/create_training_data.py | viveksjoseph/keras-english-resume-parser-and-analyzer | 0272e459350a66868e233856e3574fcbeef7c26b | [
"MIT"
] | null | null | null | demo/create_training_data.py | viveksjoseph/keras-english-resume-parser-and-analyzer | 0272e459350a66868e233856e3574fcbeef7c26b | [
"MIT"
] | null | null | null | import os
import sys
from tkinter import *
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from keras_en_parser_and_analyzer.library.dl_based_parser import line_types, line_labels
from keras_en_parser_and_analyzer.library.utility.io_utils import read_pdf_and_docx
class AnnotatorGui(Frame):
def __... | 39.759259 | 132 | 0.648657 | import os
import sys
from tkinter import *
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from keras_en_parser_and_analyzer.library.dl_based_parser import line_types, line_labels
from keras_en_parser_and_analyzer.library.utility.io_utils import read_pdf_and_docx
class AnnotatorGui(Frame):
def __... | true | true |
f774dc1aaf52a6eab5804e77b4f58512fd392ee0 | 130 | py | Python | env/lib/python3.8/site-packages/plotly/io/orca.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/io/orca.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/io/orca.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | from ._orca import (
ensure_server,
shutdown_server,
validate_executable,
reset_status,
config,
status,
)
| 14.444444 | 24 | 0.661538 | from ._orca import (
ensure_server,
shutdown_server,
validate_executable,
reset_status,
config,
status,
)
| true | true |
f774dc3b582d120a6fec658099f760acb391d947 | 7,042 | py | Python | api/post/tests.py | HVLLO/FaceMash | 014354a593dc6f6a4313490535682a6902c28129 | [
"MIT"
] | null | null | null | api/post/tests.py | HVLLO/FaceMash | 014354a593dc6f6a4313490535682a6902c28129 | [
"MIT"
] | 7 | 2020-02-11T23:32:22.000Z | 2022-03-11T23:37:06.000Z | api/post/tests.py | HVLLO/FaceMash | 014354a593dc6f6a4313490535682a6902c28129 | [
"MIT"
] | null | null | null | import json
from django.test import Client
from django.urls import reverse
from django.test.client import RequestFactory
from rest_framework import status
from rest_framework.test import APITestCase
from api.account.models import User
from api.like.models import Like
from .REST_API.serializers import PostSerializer
... | 38.906077 | 104 | 0.600824 | import json
from django.test import Client
from django.urls import reverse
from django.test.client import RequestFactory
from rest_framework import status
from rest_framework.test import APITestCase
from api.account.models import User
from api.like.models import Like
from .REST_API.serializers import PostSerializer
... | true | true |
f774dc6689ce61a084b70977638d1cfd1fea8772 | 415 | py | Python | src/advance_stuff/how_global_var_work/global_var.py | paramraghavan/beginners-py-learn | 120db42b3ad304915d5be172f4ebc555ef2cb405 | [
"MIT"
] | null | null | null | src/advance_stuff/how_global_var_work/global_var.py | paramraghavan/beginners-py-learn | 120db42b3ad304915d5be172f4ebc555ef2cb405 | [
"MIT"
] | null | null | null | src/advance_stuff/how_global_var_work/global_var.py | paramraghavan/beginners-py-learn | 120db42b3ad304915d5be172f4ebc555ef2cb405 | [
"MIT"
] | null | null | null | '''
Variables that are created outside of a function (as in all of the examples above) are known as global variables.
Global variables can be used by everyone, both inside of functions and outside.
'''
import global_var_one
print(f'global_var_one.x: {global_var_one.x}')
'''
update the global variable
'''
global_v... | 23.055556 | 113 | 0.761446 |
import global_var_one
print(f'global_var_one.x: {global_var_one.x}')
global_var_one.x = f'{global_var_one.x}updated'
print(f'global_var_one.x updated: {global_var_one.x}') | true | true |
f774dc68eeda14a195dc24d8209e1e0b8d1ebf9c | 33,071 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 52.577107 | 247 | 0.674912 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f774dc9582f6e27d24ee1a403b9583833d1e647a | 740 | py | Python | ztag/template_http.py | justinbastress/ztag | 137b754dfe22b7d6e0945ae33def372ec67d092b | [
"Apache-2.0"
] | 107 | 2015-10-13T16:03:21.000Z | 2021-11-08T10:53:07.000Z | ztag/template_http.py | justinbastress/ztag | 137b754dfe22b7d6e0945ae33def372ec67d092b | [
"Apache-2.0"
] | 73 | 2015-10-14T17:27:10.000Z | 2018-10-01T14:32:44.000Z | ztag/template_http.py | justinbastress/ztag | 137b754dfe22b7d6e0945ae33def372ec67d092b | [
"Apache-2.0"
] | 36 | 2015-10-14T17:13:20.000Z | 2021-10-05T19:41:10.000Z | from ztag.annotation import *
class NetGearSmartSwitch(Annotation):
protocol = protocols.HTTP
subprotocol = protocols.HTTP.GET
port = None
tests = {
"netgear_smart_switch":{
"global_metadata":{
"manufacturer":Manufacturer.NETGEAR,
"device_type":Type.SWITCH,
... | 26.428571 | 68 | 0.598649 | from ztag.annotation import *
class NetGearSmartSwitch(Annotation):
protocol = protocols.HTTP
subprotocol = protocols.HTTP.GET
port = None
tests = {
"netgear_smart_switch":{
"global_metadata":{
"manufacturer":Manufacturer.NETGEAR,
"device_type":Type.SWITCH,
... | true | true |
f774dea5a990d58302f83bf54b7dd6b4b3e1977a | 13,418 | py | Python | me4storage/commands/configure.py | mjrasobarnett/me4storage | 8c876e9a4182aaad440c533f18dab29d9a0fb36d | [
"MIT"
] | null | null | null | me4storage/commands/configure.py | mjrasobarnett/me4storage | 8c876e9a4182aaad440c533f18dab29d9a0fb36d | [
"MIT"
] | 2 | 2021-06-21T13:34:32.000Z | 2021-06-21T13:34:36.000Z | me4storage/commands/configure.py | mjrasobarnett/python-me4storage | 8c876e9a4182aaad440c533f18dab29d9a0fb36d | [
"MIT"
] | null | null | null | import logging
import colorama
from colorama import Fore, Style
from terminaltables import SingleTable
from pprint import pformat
import datetime
import re
from me4storage.api.session import Session
from me4storage.common.exceptions import ApiError
from me4storage.common.nsca import CheckResult
import me4storage.commo... | 35.781333 | 175 | 0.607095 | import logging
import colorama
from colorama import Fore, Style
from terminaltables import SingleTable
from pprint import pformat
import datetime
import re
from me4storage.api.session import Session
from me4storage.common.exceptions import ApiError
from me4storage.common.nsca import CheckResult
import me4storage.commo... | true | true |
f774df044137a6b7953cb183fd6432746cba3c8e | 2,700 | py | Python | src/cifar10/data_utils.py | ankdesh/enas | 95fa07744440c0ae79f7f7a108ef08ee5099fdca | [
"Apache-2.0"
] | null | null | null | src/cifar10/data_utils.py | ankdesh/enas | 95fa07744440c0ae79f7f7a108ef08ee5099fdca | [
"Apache-2.0"
] | null | null | null | src/cifar10/data_utils.py | ankdesh/enas | 95fa07744440c0ae79f7f7a108ef08ee5099fdca | [
"Apache-2.0"
] | null | null | null | import os
import sys
import cPickle as pickle
import numpy as np
import tensorflow as tf
def _read_data(data_path, train_files):
"""Reads CIFAR-10 format data. Always returns NHWC format.
Returns:
images: np tensor of size [N, H, W, C]
labels: np tensor of size [N]
"""
images, labels = [], []
# Loa... | 30.337079 | 77 | 0.655926 | import os
import sys
import cPickle as pickle
import numpy as np
import tensorflow as tf
def _read_data(data_path, train_files):
"""Reads CIFAR-10 format data. Always returns NHWC format.
Returns:
images: np tensor of size [N, H, W, C]
labels: np tensor of size [N]
"""
images, labels = [], []
mni... | false | true |
f774dffc0d86bfec80b401e61c178e8a2038d3cb | 5,205 | py | Python | pytd/tests/test_query_engine.py | Juh10/pytd | f90b8ea5f023794dd0c6bcd503111daf3b6d817a | [
"Apache-2.0"
] | 16 | 2019-04-24T01:59:14.000Z | 2022-01-03T01:53:44.000Z | pytd/tests/test_query_engine.py | Juh10/pytd | f90b8ea5f023794dd0c6bcd503111daf3b6d817a | [
"Apache-2.0"
] | 65 | 2019-04-22T06:17:51.000Z | 2021-02-10T14:57:57.000Z | pytd/tests/test_query_engine.py | Juh10/pytd | f90b8ea5f023794dd0c6bcd503111daf3b6d817a | [
"Apache-2.0"
] | 10 | 2019-04-28T09:39:40.000Z | 2022-02-15T12:39:10.000Z | import unittest
from unittest.mock import MagicMock, patch
import prestodb
import tdclient
from pytd import __version__
from pytd.query_engine import HiveQueryEngine, PrestoQueryEngine
class QueryEngineEndpointSchemeTestCase(unittest.TestCase):
def test_presto_endpoint(self):
presto = PrestoQueryEngine(... | 34.932886 | 88 | 0.645725 | import unittest
from unittest.mock import MagicMock, patch
import prestodb
import tdclient
from pytd import __version__
from pytd.query_engine import HiveQueryEngine, PrestoQueryEngine
class QueryEngineEndpointSchemeTestCase(unittest.TestCase):
def test_presto_endpoint(self):
presto = PrestoQueryEngine(... | true | true |
f774e0dd3c7eba8dc87aef7243124d63024a5714 | 22,852 | py | Python | src/natcap/invest/fisheries/fisheries.py | tomsaleeba/invest | 0af7ade80715394c5df0d39503011fac962d1749 | [
"BSD-3-Clause"
] | null | null | null | src/natcap/invest/fisheries/fisheries.py | tomsaleeba/invest | 0af7ade80715394c5df0d39503011fac962d1749 | [
"BSD-3-Clause"
] | 1 | 2021-12-08T19:49:56.000Z | 2021-12-11T01:59:55.000Z | src/natcap/invest/fisheries/fisheries.py | emlys/invest | 5b0391fd456df5a6afd2fdfbaed542a090f58f17 | [
"BSD-3-Clause"
] | null | null | null | """Fisheries."""
import logging
import csv
import os
from osgeo import gdal
from . import fisheries_io as io
from . import fisheries_model as model
from .. import utils
from .. import validation
LOGGER = logging.getLogger(__name__)
LABEL = 'Fisheries'
ARGS_SPEC = {
"model_name": "Fisheries",
"module": __nam... | 43.861804 | 80 | 0.59229 | import logging
import csv
import os
from osgeo import gdal
from . import fisheries_io as io
from . import fisheries_model as model
from .. import utils
from .. import validation
LOGGER = logging.getLogger(__name__)
LABEL = 'Fisheries'
ARGS_SPEC = {
"model_name": "Fisheries",
"module": __name__,
"usergui... | true | true |
f774e1eb0452e2f14329e0a60161983239e1e40e | 4,138 | py | Python | tests/transformer/test_subscript.py | zopefoundation/RestrictedPython | 9195d291f4855131c9c5ca633b80372a43a3da90 | [
"ZPL-2.1"
] | 236 | 2015-01-03T17:14:53.000Z | 2022-03-01T15:52:46.000Z | tests/transformer/test_subscript.py | zopefoundation/RestrictedPython | 9195d291f4855131c9c5ca633b80372a43a3da90 | [
"ZPL-2.1"
] | 149 | 2016-10-24T06:56:44.000Z | 2022-02-24T08:09:10.000Z | tests/transformer/test_subscript.py | zopefoundation/RestrictedPython | 9195d291f4855131c9c5ca633b80372a43a3da90 | [
"ZPL-2.1"
] | 30 | 2015-04-03T05:38:13.000Z | 2021-11-10T05:13:38.000Z | from tests.helper import restricted_exec
SIMPLE_SUBSCRIPTS = """
def simple_subscript(a):
return a['b']
"""
def test_read_simple_subscript(mocker):
value = None
_getitem_ = mocker.stub()
_getitem_.side_effect = lambda ob, index: (ob, index)
glb = {'_getitem_': _getitem_}
restricted_exec(SIMP... | 23.117318 | 102 | 0.662156 | from tests.helper import restricted_exec
SIMPLE_SUBSCRIPTS = """
def simple_subscript(a):
return a['b']
"""
def test_read_simple_subscript(mocker):
value = None
_getitem_ = mocker.stub()
_getitem_.side_effect = lambda ob, index: (ob, index)
glb = {'_getitem_': _getitem_}
restricted_exec(SIMP... | true | true |
f774e1faa37907518acadee5f2b65f0c9ac90c55 | 5,082 | py | Python | library/dss_get_credentials.py | dataiku/dataiku-ansible-modules | 73f85bd1df5d66ce6421e5893657c86895c2ba49 | [
"ECL-2.0",
"Apache-2.0"
] | 8 | 2019-03-22T14:54:43.000Z | 2021-09-28T17:11:49.000Z | library/dss_get_credentials.py | dataiku/dataiku-ansible-modules | 73f85bd1df5d66ce6421e5893657c86895c2ba49 | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2020-01-08T10:16:04.000Z | 2021-11-22T17:49:54.000Z | library/dss_get_credentials.py | dataiku/dataiku-ansible-modules | 73f85bd1df5d66ce6421e5893657c86895c2ba49 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2019-04-02T10:34:28.000Z | 2020-09-16T18:58:37.000Z | #!/usr/bin/env python2
from __future__ import absolute_import
import copy
import imp
import json
import logging
import os
import subprocess
import traceback
import six.moves.configparser
from ansible.module_utils.basic import AnsibleModule
ANSIBLE_METADATA = {"metadata_version": "1.1", "status": ["preview"], "suppo... | 30.25 | 127 | 0.583825 |
from __future__ import absolute_import
import copy
import imp
import json
import logging
import os
import subprocess
import traceback
import six.moves.configparser
from ansible.module_utils.basic import AnsibleModule
ANSIBLE_METADATA = {"metadata_version": "1.1", "status": ["preview"], "supported_by": "dataiku-ansi... | true | true |
f774e224d05c6e73e60ab164e83637fede1272ce | 681 | py | Python | emails/migrations/0006_auto_20190803_2304.py | Tookmund/hackerforce | d757910db1631e26e489a10a99fa67cd74292c4e | [
"Apache-2.0"
] | 11 | 2019-11-11T23:27:21.000Z | 2021-07-19T16:41:44.000Z | emails/migrations/0006_auto_20190803_2304.py | Tookmund/hackerforce | d757910db1631e26e489a10a99fa67cd74292c4e | [
"Apache-2.0"
] | 11 | 2019-12-24T17:10:05.000Z | 2021-06-09T18:22:59.000Z | emails/migrations/0006_auto_20190803_2304.py | hackumass/hackerforce | dfb6ac1304a7db21853765de9da795e8e9ef20bf | [
"Apache-2.0"
] | 7 | 2019-11-21T03:32:06.000Z | 2021-07-18T15:30:29.000Z | # Generated by Django 2.2.3 on 2019-08-03 23:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('emails', '0005_auto_20190802_0145'),
]
operations = [
migrations.AddField(
model_name='email',
name='internal_title'... | 27.24 | 115 | 0.604993 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('emails', '0005_auto_20190802_0145'),
]
operations = [
migrations.AddField(
model_name='email',
name='internal_title',
field=models.CharField(default='',... | true | true |
f774e252d39534de27064ab3499136d359f6a63f | 28,718 | py | Python | crabpy/gateway/capakey.py | OnroerendErfgoed/crabpy | 218607957fbb9293a3054ae0613f7c2e3e44f697 | [
"MIT"
] | 4 | 2015-01-04T19:22:47.000Z | 2018-10-17T20:09:01.000Z | crabpy/gateway/capakey.py | OnroerendErfgoed/crabpy | 218607957fbb9293a3054ae0613f7c2e3e44f697 | [
"MIT"
] | 123 | 2015-02-22T22:25:45.000Z | 2022-03-01T17:58:06.000Z | crabpy/gateway/capakey.py | OnroerendErfgoed/crabpy | 218607957fbb9293a3054ae0613f7c2e3e44f697 | [
"MIT"
] | 2 | 2017-06-06T09:29:29.000Z | 2017-09-15T11:44:23.000Z | # -*- coding: utf-8 -*-
'''
This module contains an opionated gateway for the capakey webservice.
.. versionadded:: 0.2.0
'''
from __future__ import unicode_literals
import six
import json
import logging
log = logging.getLogger(__name__)
from crabpy.gateway.exception import (
GatewayRuntimeException,
Gatew... | 30.357294 | 119 | 0.543178 |
from __future__ import unicode_literals
import six
import json
import logging
log = logging.getLogger(__name__)
from crabpy.gateway.exception import (
GatewayRuntimeException,
GatewayResourceNotFoundException
)
from dogpile.cache import make_region
import requests
def capakey_rest_gateway_request(url, h... | true | true |
f774e3cb6ab4da20f9f6a4d28609f0a8598f3e27 | 1,070 | py | Python | modules/transformations/redshift/lib/destination/__init__.py | huq-industries/carto-spatial-extension | ddd7448995932535c2e1533309f4b4141c61af4b | [
"BSD-3-Clause"
] | 68 | 2019-10-21T04:05:04.000Z | 2021-02-04T08:27:36.000Z | modules/transformations/redshift/lib/destination/__init__.py | huq-industries/carto-spatial-extension | ddd7448995932535c2e1533309f4b4141c61af4b | [
"BSD-3-Clause"
] | 165 | 2021-02-12T06:44:26.000Z | 2022-03-07T09:07:42.000Z | modules/transformations/redshift/lib/destination/__init__.py | huq-industries/carto-spatial-extension | ddd7448995932535c2e1533309f4b4141c61af4b | [
"BSD-3-Clause"
] | 25 | 2019-10-23T16:30:00.000Z | 2021-02-04T15:48:31.000Z | # Copyright (c) 2014, Morgan Herlocker (JavaScript implementation)
# Copyright (c) 2021, CARTO
from helper import length_to_radians
from math import radians, asin, cos, sin, atan2, degrees
from ..helper import PRECISION
import geojson
def destination(geom, distance, bearing, units):
# Check if geom is a point
... | 28.918919 | 88 | 0.66729 |
from helper import length_to_radians
from math import radians, asin, cos, sin, atan2, degrees
from ..helper import PRECISION
import geojson
def destination(geom, distance, bearing, units):
if geom is None:
raise Exception('geom is required')
if geom.type != 'Point':
raise Exception('geom... | true | true |
f774e625ae39daeeb196153a0a42a073f62a87ee | 7,214 | py | Python | tests/histogram_tests.py | megagonlabs/teddy | ee0103307f89c975e08b10a3a2b60f177c41e932 | [
"Apache-2.0"
] | 15 | 2020-01-13T07:39:27.000Z | 2021-04-01T01:38:44.000Z | tests/histogram_tests.py | megagonlabs/teddy | ee0103307f89c975e08b10a3a2b60f177c41e932 | [
"Apache-2.0"
] | null | null | null | tests/histogram_tests.py | megagonlabs/teddy | ee0103307f89c975e08b10a3a2b60f177c41e932 | [
"Apache-2.0"
] | 5 | 2020-01-16T05:28:42.000Z | 2020-07-12T21:56:39.000Z | import unittest
from collections import Counter
from libs.review_db import ReviewDB
from libs.nlp_length_functions import NLPLengths
from libs.histogram_comparisons import HistogramComparison
class HistogramTests(unittest.TestCase):
def test_density_estimator(self):
db = ReviewDB('tests/test_data/')
... | 55.492308 | 128 | 0.707236 | import unittest
from collections import Counter
from libs.review_db import ReviewDB
from libs.nlp_length_functions import NLPLengths
from libs.histogram_comparisons import HistogramComparison
class HistogramTests(unittest.TestCase):
def test_density_estimator(self):
db = ReviewDB('tests/test_data/')
... | true | true |
f774e6fe67254a6da8565760693d63b388b26ee6 | 905 | py | Python | wechat/createUser.py | luoyefeiwu/learn_python | e888537c538309d2600a302c0c6e92456dd785c0 | [
"Apache-2.0"
] | null | null | null | wechat/createUser.py | luoyefeiwu/learn_python | e888537c538309d2600a302c0c6e92456dd785c0 | [
"Apache-2.0"
] | null | null | null | wechat/createUser.py | luoyefeiwu/learn_python | e888537c538309d2600a302c0c6e92456dd785c0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# 创建人员
import requests
import json
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
'Content-Type': 'application/json; charset=UTF-8'
}
data = {
"userid": "fenxiaohui",
"name": "冯晓辉",
... | 26.617647 | 142 | 0.590055 | import requests
import json
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
'Content-Type': 'application/json; charset=UTF-8'
}
data = {
"userid": "fenxiaohui",
"name": "冯晓辉",
"alias": "jackzhang"... | true | true |
f774e74048177384751c422e6c5b28e382a094e8 | 61,287 | py | Python | lib/ravello_sdk.py | ryran/python-sdk | 0c6dad1f08f62a34916528cf55a6d08767529d3b | [
"Apache-2.0"
] | null | null | null | lib/ravello_sdk.py | ryran/python-sdk | 0c6dad1f08f62a34916528cf55a6d08767529d3b | [
"Apache-2.0"
] | null | null | null | lib/ravello_sdk.py | ryran/python-sdk | 0c6dad1f08f62a34916528cf55a6d08767529d3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-2014 Ravello Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 43.312367 | 321 | 0.631733 | from __future__ import absolute_import, print_function
import sys
import base64
import socket
import logging
import time
import json
import random
import requests
import urllib
try:
from urllib import parse as urlparse
except ImportError:
import urlparse
pyver = sys.version_info[:2]
if pyver not in [(2, 6), ... | true | true |
f774e76c0ccd68faa1662acfd683dfeb6e3882c4 | 19,903 | py | Python | topi/python/topi/mali/conv2d.py | optima2005/incubator-tvm | 545f6ea3fede7a99f0a1b2c6933875550214a46d | [
"Apache-2.0"
] | 3 | 2020-03-12T10:25:51.000Z | 2020-08-05T05:36:23.000Z | topi/python/topi/mali/conv2d.py | optima2005/incubator-tvm | 545f6ea3fede7a99f0a1b2c6933875550214a46d | [
"Apache-2.0"
] | null | null | null | topi/python/topi/mali/conv2d.py | optima2005/incubator-tvm | 545f6ea3fede7a99f0a1b2c6933875550214a46d | [
"Apache-2.0"
] | 1 | 2018-10-19T18:11:41.000Z | 2018-10-19T18:11:41.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.341463 | 100 | 0.598804 | import tvm
from tvm import relay
from tvm import autotvm
from tvm.autotvm.task.space import get_factors
from ..util import traverse_inline, get_const_int, get_const_tuple
from .. import nn
from ..nn.winograd_util import winograd_transform_matrices
from ..arm_cpu.conv2d_spatial_pack import conv2d_spatial_pack_nchw
@... | true | true |
f774e773cb527c9f5fe54b03c0a82fd87512508f | 2,060 | py | Python | homeassistant/components/abode/alarm_control_panel.py | tecknicaltom/home-assistant | 5c50fa34056ba2cd0c91c06cbb6a9c894b4be92e | [
"Apache-2.0"
] | 3 | 2019-10-15T16:55:31.000Z | 2020-02-18T21:10:31.000Z | homeassistant/components/abode/alarm_control_panel.py | tecknicaltom/home-assistant | 5c50fa34056ba2cd0c91c06cbb6a9c894b4be92e | [
"Apache-2.0"
] | 2 | 2021-02-08T20:37:03.000Z | 2021-09-08T01:23:59.000Z | homeassistant/components/abode/alarm_control_panel.py | tecknicaltom/home-assistant | 5c50fa34056ba2cd0c91c06cbb6a9c894b4be92e | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Support for Abode Security System alarm control panels."""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
ATTR_ATTRIBUTION,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED,
)
from . import AbodeDevice
from .const im... | 27.105263 | 86 | 0.662621 | import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
ATTR_ATTRIBUTION,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED,
)
from . import AbodeDevice
from .const import ATTRIBUTION, DOMAIN
_LOGGER = logging.getLogger(__name__... | true | true |
f774e8a8caf6b29eaf2c68653d37d2d137a358be | 805 | py | Python | setup.py | Brightmd/hoursofoperation | 958794a7264e9852059832e2e8d632ed48293490 | [
"MIT"
] | null | null | null | setup.py | Brightmd/hoursofoperation | 958794a7264e9852059832e2e8d632ed48293490 | [
"MIT"
] | 3 | 2018-09-10T23:27:47.000Z | 2021-03-25T21:48:15.000Z | setup.py | Brightmd/hoursofoperation | 958794a7264e9852059832e2e8d632ed48293490 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
__version__ = '0.1.12'
config = dict(
name='hoursofoperation',
packages=find_packages('.', include=['hoursofoperation', 'hoursofoperation.*']),
version=__version__,
description = 'Utilities for loading and doing calculations with a partner\'s hours of oper... | 23 | 117 | 0.593789 | from setuptools import setup, find_packages
__version__ = '0.1.12'
config = dict(
name='hoursofoperation',
packages=find_packages('.', include=['hoursofoperation', 'hoursofoperation.*']),
version=__version__,
description = 'Utilities for loading and doing calculations with a partner\'s hours of oper... | true | true |
f774eaeb845080ea462e467ace450ff813b6a89d | 17,466 | py | Python | state_enforcer.py | dufkan/state_enforcer | db070f1d91630a9791b51c8569c51ac0d8460abf | [
"MIT"
] | null | null | null | state_enforcer.py | dufkan/state_enforcer | db070f1d91630a9791b51c8569c51ac0d8460abf | [
"MIT"
] | null | null | null | state_enforcer.py | dufkan/state_enforcer | db070f1d91630a9791b51c8569c51ac0d8460abf | [
"MIT"
] | null | null | null | from graphviz import Digraph
from graphviz import Graph
import yaml
import sys
VERSION = '2019.12.09'
YAML_TAG_CONFIGURATION = 'config'
YAML_TAG_CONFIGURATION_COLORING = 'coloring'
YAML_TAG_STATES_SPECIAL = 'states_special'
YAML_TAG_STATES_TRANSITIONS = 'states_transitions'
YAML_TAG_SECONDARY_STATE_CHECK = 'secondary... | 41.29078 | 171 | 0.573743 | from graphviz import Digraph
from graphviz import Graph
import yaml
import sys
VERSION = '2019.12.09'
YAML_TAG_CONFIGURATION = 'config'
YAML_TAG_CONFIGURATION_COLORING = 'coloring'
YAML_TAG_STATES_SPECIAL = 'states_special'
YAML_TAG_STATES_TRANSITIONS = 'states_transitions'
YAML_TAG_SECONDARY_STATE_CHECK = 'secondary... | true | true |
f774eb8b9aa61cca651b6ad198cb3053323a8748 | 864 | py | Python | migrations/versions/0c18ff62b414_.py | CsarChvz/SkyTools | 1a451bf905946054c55849f4fc9291df0627e213 | [
"MIT"
] | null | null | null | migrations/versions/0c18ff62b414_.py | CsarChvz/SkyTools | 1a451bf905946054c55849f4fc9291df0627e213 | [
"MIT"
] | null | null | null | migrations/versions/0c18ff62b414_.py | CsarChvz/SkyTools | 1a451bf905946054c55849f4fc9291df0627e213 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 0c18ff62b414
Revises: ad7d196d91e9
Create Date: 2021-07-12 14:07:02.060217
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0c18ff62b414'
down_revision = 'ad7d196d91e9'
branch_labels = None
depends_on = None
def upgrade():
# ... | 24.685714 | 65 | 0.677083 | from alembic import op
import sqlalchemy as sa
revision = '0c18ff62b414'
down_revision = 'ad7d196d91e9'
branch_labels = None
depends_on = None
def upgrade():
op.drop_table('activity')
def downgrade():
op.create_table('activity',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column(... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.