hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f38976fa6e0ab2996dfc2b18e03c21f6b0e7cb | 444 | py | Python | marco/portal/base/templatetags/portal.py | Ecotrust/marco-portal2 | 13bb1b444c7605e1de3c88313d36abc1f463d1f5 | [
"0BSD"
] | 4 | 2016-09-24T00:57:45.000Z | 2019-07-28T23:35:15.000Z | marco/portal/base/templatetags/portal.py | MidAtlanticPortal/marco-portal2 | b47e7bfa171e98a6cf499b2d411fc743caae91c2 | [
"0BSD"
] | 146 | 2016-09-27T23:16:52.000Z | 2022-03-09T16:55:32.000Z | marco/portal/base/templatetags/portal.py | Ecotrust/marco-portal2 | 13bb1b444c7605e1de3c88313d36abc1f463d1f5 | [
"0BSD"
] | 1 | 2019-07-03T23:42:05.000Z | 2019-07-03T23:42:05.000Z | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
import re
register = template.Library()
@register.simple_tag(takes_context=True)
def active(context, pattern_or_urlname):
try:
pattern = '^' + reverse(pattern_or_urlname)
except NoReverseMatch:
pattern = p... | 26.117647 | 60 | 0.716216 | from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
import re
register = template.Library()
@register.simple_tag(takes_context=True)
def active(context, pattern_or_urlname):
try:
pattern = '^' + reverse(pattern_or_urlname)
except NoReverseMatch:
pattern = p... | true | true |
f7f38a4fd8ffa5362e5944544ff5424f460b53aa | 109 | py | Python | exercicios-turtle/.history/clown_20210623230000.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | 1 | 2021-11-28T18:49:21.000Z | 2021-11-28T18:49:21.000Z | exercicios-turtle/.history/clown_20210623230000.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | exercicios-turtle/.history/clown_20210623230000.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | import turtle
tortuguita= turtle.Turtle()
tortuguita.dot(30,"black")
tortuguita.forward(10)
turtle.done() | 12.111111 | 27 | 0.761468 | import turtle
tortuguita= turtle.Turtle()
tortuguita.dot(30,"black")
tortuguita.forward(10)
turtle.done() | true | true |
f7f38c2e7264bbdab536a0ef12f9d56b6f82c6d4 | 309 | py | Python | pauls_qiskit_addons/__init__.py | nonhermitian/qiskit_addons | 6b74be53536ece55e3ace08dcdf458dee0dcd48e | [
"Apache-2.0"
] | null | null | null | pauls_qiskit_addons/__init__.py | nonhermitian/qiskit_addons | 6b74be53536ece55e3ace08dcdf458dee0dcd48e | [
"Apache-2.0"
] | null | null | null | pauls_qiskit_addons/__init__.py | nonhermitian/qiskit_addons | 6b74be53536ece55e3ace08dcdf458dee0dcd48e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
from pauls_qiskit_addons.version import version as __version__
from pauls_qiskit_addons.backends.abstract_backend import AbstractBackend
| 34.333333 | 77 | 0.796117 |
from pauls_qiskit_addons.version import version as __version__
from pauls_qiskit_addons.backends.abstract_backend import AbstractBackend
| true | true |
f7f38fc44083be78fd30ae4910aeb458446ca923 | 3,113 | py | Python | app/models.py | johnstat101/my-blogsite | c89eb7edfa55b24c1ffa9fe8789171b9b50d71bf | [
"Unlicense"
] | null | null | null | app/models.py | johnstat101/my-blogsite | c89eb7edfa55b24c1ffa9fe8789171b9b50d71bf | [
"Unlicense"
] | null | null | null | app/models.py | johnstat101/my-blogsite | c89eb7edfa55b24c1ffa9fe8789171b9b50d71bf | [
"Unlicense"
] | null | null | null | from . import db,login_manager
from flask_login import UserMixin
from werkzeug.security import generate_password_hash,check_password_hash
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(user_id)
class User (UserMixin,db.Model):
__tablename__ = 'users'
... | 29.647619 | 72 | 0.671057 | from . import db,login_manager
from flask_login import UserMixin
from werkzeug.security import generate_password_hash,check_password_hash
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(user_id)
class User (UserMixin,db.Model):
__tablename__ = 'users'
... | true | true |
f7f390d53806bd633192bf1abee143e6e2bd05d4 | 431 | py | Python | env/lib/python3.8/site-packages/plotly/validators/heatmapgl/_xsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/heatmapgl/_xsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/heatmapgl/_xsrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class XsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="xsrc", parent_name="heatmapgl", **kwargs):
super(XsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_typ... | 33.153846 | 78 | 0.645012 | import _plotly_utils.basevalidators
class XsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="xsrc", parent_name="heatmapgl", **kwargs):
super(XsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_typ... | true | true |
f7f3933c57f039797f1072b9220c43c5941dbd69 | 5,305 | py | Python | setup.py | SmithSamuelM/didery | 8181cd2dd2aa711d0b559acdc8ba1c7e2e8ba2fb | [
"Apache-2.0"
] | null | null | null | setup.py | SmithSamuelM/didery | 8181cd2dd2aa711d0b559acdc8ba1c7e2e8ba2fb | [
"Apache-2.0"
] | null | null | null | setup.py | SmithSamuelM/didery | 8181cd2dd2aa711d0b559acdc8ba1c7e2e8ba2fb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Basic setup file to enable pip install
See:
https://pythonhosted.org/setuptools/
https://bitbucket.org/pypa/setuptools
$ python setup.py register sdist upload
More secure to use twine to upload
$ pip3 install twine
$ python3 setup.py sdist
$ twine upload d... | 31.577381 | 115 | 0.615457 |
from __future__ import generator_stop
import sys
import io
import os
import re
v = sys.version_info
if v < (3, 5):
msg = "FAIL: Requires Python 3.6 or later, but setup.py was run using {}.{}.{}"
print(msg.format(v.major, v.minor, v.micro))
print("NOTE: Installation failed. Run setup.py using python3")... | true | true |
f7f39384b4ede44bd932baf4b88b0d0365830b5f | 6,962 | py | Python | python/oneflow/nn/optimizer/optimizer.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/optimizer.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/optimizer.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 39.11236 | 148 | 0.620224 | import collections
import warnings
from copy import deepcopy
from typing import Any, Callable, Dict, Union
from oneflow.framework.tensor import Tensor
from oneflow.nn.parameter import Parameter
from oneflow.nn.utils.clip_grad import clip_grad_norm_
class ParamGroup(object):
def __init__(
self, parameters... | true | true |
f7f393a21321e050f7a1afb6a5ce10e5c4c076be | 4,816 | py | Python | aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/AddTraficMatchRuleToTrafficMarkingPolicyRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/AddTraficMatchRuleToTrafficMarkingPolicyRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/AddTraficMatchRuleToTrafficMarkingPolicyRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 52.347826 | 160 | 0.75789 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkcbn.endpoint import endpoint_data
class AddTraficMatchRuleToTrafficMarkingPolicyRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Cbn', '2017-09-12', 'AddTraficMatchRuleToTrafficMarkingPolicy')
self.set_method('POST'... | true | true |
f7f394090d3abe509058627be4480129f79ff534 | 7,983 | py | Python | old/pt/conf.py | xueron/phalcon-docs | 5cf2c5a4fe8d2415b1f5bfcc8201f9224c9ab4c2 | [
"BSD-3-Clause"
] | null | null | null | old/pt/conf.py | xueron/phalcon-docs | 5cf2c5a4fe8d2415b1f5bfcc8201f9224c9ab4c2 | [
"BSD-3-Clause"
] | null | null | null | old/pt/conf.py | xueron/phalcon-docs | 5cf2c5a4fe8d2415b1f5bfcc8201f9224c9ab4c2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Phalcon PHP Framework Documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 10 12:27:41 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | 32.717213 | 176 | 0.719278 |
import sys, os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'Phalcon'
copyright = '2017, Phalcon Team and contributors'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The s... | true | true |
f7f3946542bffe06b6256e2d172506de406c91f9 | 2,185 | py | Python | s3_run.py | graykode/s3-latency | 65bd9349e6b360e59f4953b7dc4d71f5f1d5909f | [
"MIT"
] | 1 | 2020-06-17T09:37:39.000Z | 2020-06-17T09:37:39.000Z | s3_run.py | graykode/s3-latency | 65bd9349e6b360e59f4953b7dc4d71f5f1d5909f | [
"MIT"
] | null | null | null | s3_run.py | graykode/s3-latency | 65bd9349e6b360e59f4953b7dc4d71f5f1d5909f | [
"MIT"
] | 1 | 2019-04-28T22:24:09.000Z | 2019-04-28T22:24:09.000Z | import boto3
import botocore
import time
regions = ['us-east-2', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-south-1',
'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1', 'ca-central-1',
'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', 'sa-east-1',
]
def put(s3, ... | 33.106061 | 95 | 0.591304 | import boto3
import botocore
import time
regions = ['us-east-2', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-south-1',
'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1', 'ca-central-1',
'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', 'sa-east-1',
]
def put(s3, ... | true | true |
f7f394c582851096b79df28236870d9403dfae48 | 5,318 | py | Python | test/functional/disconnect_ban.py | BitcoinBridgeOffical/Bitcoin-Bridge | d800625c9b4b6fe1ddc0f0615a854e43463b82ad | [
"MIT"
] | 1 | 2018-01-13T18:02:47.000Z | 2018-01-13T18:02:47.000Z | test/functional/disconnect_ban.py | BitcoinBridgeOffical/Bitcoin-Bridge | d800625c9b4b6fe1ddc0f0615a854e43463b82ad | [
"MIT"
] | null | null | null | test/functional/disconnect_ban.py | BitcoinBridgeOffical/Bitcoin-Bridge | d800625c9b4b6fe1ddc0f0615a854e43463b82ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node disconnect and ban behavior"""
import time
from test_framework.test_framework import Bitcoin... | 49.240741 | 153 | 0.664912 |
import time
from test_framework.test_framework import BitcoinBridgeTestFramework
from test_framework.util import (
assert_equal,
assert_raises_jsonrpc,
connect_nodes_bi,
wait_until,
)
class DisconnectBanTest(BitcoinBridgeTestFramework):
def set_test_params(self):
self.num_nodes = 2
... | true | true |
f7f3959b3f20878683d0015597513b420a349bee | 40,739 | py | Python | saleor/saleor/graphql/shop/tests/test_shop.py | nguyentrung194/e-com | e1fbf6259ba832040b9cf0ec6a7adf1b43a8539a | [
"BSD-3-Clause"
] | null | null | null | saleor/saleor/graphql/shop/tests/test_shop.py | nguyentrung194/e-com | e1fbf6259ba832040b9cf0ec6a7adf1b43a8539a | [
"BSD-3-Clause"
] | 1 | 2022-01-06T19:01:21.000Z | 2022-01-06T19:01:21.000Z | saleor/saleor/graphql/shop/tests/test_shop.py | nguyentrung194/e-com | e1fbf6259ba832040b9cf0ec6a7adf1b43a8539a | [
"BSD-3-Clause"
] | null | null | null | from unittest.mock import ANY
import graphene
import pytest
from django_countries import countries
from .... import __version__
from ....account.models import Address
from ....core.error_codes import ShopErrorCode
from ....core.permissions import get_permissions_codename
from ....shipping import PostalCodeRuleInclusi... | 30.470456 | 88 | 0.666192 | from unittest.mock import ANY
import graphene
import pytest
from django_countries import countries
from .... import __version__
from ....account.models import Address
from ....core.error_codes import ShopErrorCode
from ....core.permissions import get_permissions_codename
from ....shipping import PostalCodeRuleInclusi... | true | true |
f7f3965817bcf3301bcabe480b9e139ca2271541 | 366 | py | Python | nomadgram/notifications/migrations/0005_auto_20181222_1723.py | majaeseong/nomadgram | bea95def96ddc5126567026ec294196dc49862c7 | [
"MIT"
] | null | null | null | nomadgram/notifications/migrations/0005_auto_20181222_1723.py | majaeseong/nomadgram | bea95def96ddc5126567026ec294196dc49862c7 | [
"MIT"
] | 7 | 2020-09-06T07:11:02.000Z | 2022-02-26T14:41:08.000Z | nomadgram/notifications/migrations/0005_auto_20181222_1723.py | majaeseong/nomadgram | bea95def96ddc5126567026ec294196dc49862c7 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.9 on 2018-12-22 08:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('notifications', '0004_notification_comment'),
]
operations = [
migrations.AlterModelOptions(
name='notification',
options={'... | 20.333333 | 55 | 0.60929 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('notifications', '0004_notification_comment'),
]
operations = [
migrations.AlterModelOptions(
name='notification',
options={'ordering': ['-created_at']},
),
]
| true | true |
f7f3968aff6eb4018adff8937684e569cd74250f | 17,566 | py | Python | glance/cmd/cache_manage.py | Steap/glance | 4ee7799aa7f6a7172e361392ebb8d3da03e0bf7f | [
"Apache-2.0"
] | 309 | 2015-01-01T17:49:09.000Z | 2022-03-29T14:56:31.000Z | glance/cmd/cache_manage.py | Steap/glance | 4ee7799aa7f6a7172e361392ebb8d3da03e0bf7f | [
"Apache-2.0"
] | 8 | 2015-11-04T21:53:48.000Z | 2020-12-15T05:36:35.000Z | glance/cmd/cache_manage.py | Steap/glance | 4ee7799aa7f6a7172e361392ebb8d3da03e0bf7f | [
"Apache-2.0"
] | 409 | 2015-01-01T11:28:26.000Z | 2022-03-29T14:56:41.000Z | #!/usr/bin/env python
# Copyright 2018 RedHat 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
#
# ... | 33.206049 | 78 | 0.592793 |
import argparse
import collections
import datetime
import functools
import os
import sys
import time
import uuid
from oslo_utils import encodeutils
import prettytable
from six.moves import input
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
... | true | true |
f7f396ea8a546291a676f40e8c3d5914d88d14e2 | 64 | py | Python | stubs/javascript.py | adamlwgriffiths/vue.py | f4256454256ddfe54a8be6dea493d3fc915ef1a2 | [
"MIT"
] | 274 | 2018-07-07T00:57:17.000Z | 2022-03-22T23:49:53.000Z | stubs/javascript.py | adamlwgriffiths/vue.py | f4256454256ddfe54a8be6dea493d3fc915ef1a2 | [
"MIT"
] | 25 | 2018-11-24T17:19:44.000Z | 2022-03-23T22:30:18.000Z | stubs/javascript.py | adamlwgriffiths/vue.py | f4256454256ddfe54a8be6dea493d3fc915ef1a2 | [
"MIT"
] | 18 | 2019-07-04T07:18:18.000Z | 2022-03-22T23:49:55.000Z | """stub to avoid import errors"""
def this():
return None
| 10.666667 | 33 | 0.625 |
def this():
return None
| true | true |
f7f3985c8612345f1eada32a348a23c67649a83d | 150 | py | Python | pointer-network/const.py | shinoyuki222/torch-light | 4799805d9bcae82a9f12a574dcf9fdd838c92ee9 | [
"MIT"
] | 310 | 2018-11-02T10:12:33.000Z | 2022-03-30T02:59:51.000Z | pointer-network/const.py | shinoyuki222/torch-light | 4799805d9bcae82a9f12a574dcf9fdd838c92ee9 | [
"MIT"
] | 14 | 2018-11-08T10:09:46.000Z | 2021-07-30T08:54:33.000Z | pointer-network/const.py | shinoyuki222/torch-light | 4799805d9bcae82a9f12a574dcf9fdd838c92ee9 | [
"MIT"
] | 152 | 2018-11-02T13:00:49.000Z | 2022-03-28T12:45:08.000Z | DATAPATH = "data"
PAD = 0
UNK = 1
BOS = 2
EOS = 3
WORD = {
PAD: '<pad>',
UNK: '<unk>',
BOS: '<s>',
EOS: '</s>'
}
INIT_RANGE = 0.02
| 9.375 | 17 | 0.433333 | DATAPATH = "data"
PAD = 0
UNK = 1
BOS = 2
EOS = 3
WORD = {
PAD: '<pad>',
UNK: '<unk>',
BOS: '<s>',
EOS: '</s>'
}
INIT_RANGE = 0.02
| true | true |
f7f3989199c1e19a6bbbf9dcb3cf0d37b0927522 | 3,439 | py | Python | examples/caching/run.py | svenaoki/zenml | b94dff83f0e7c8ab29e99d6b42a0c906a3512b63 | [
"Apache-2.0"
] | 565 | 2021-08-14T14:00:32.000Z | 2022-03-31T12:58:08.000Z | examples/caching/run.py | svenaoki/zenml | b94dff83f0e7c8ab29e99d6b42a0c906a3512b63 | [
"Apache-2.0"
] | 159 | 2021-08-16T08:27:10.000Z | 2022-03-31T14:07:30.000Z | examples/caching/run.py | svenaoki/zenml | b94dff83f0e7c8ab29e99d6b42a0c906a3512b63 | [
"Apache-2.0"
] | 64 | 2021-08-31T02:33:01.000Z | 2022-03-31T12:58:12.000Z | # Copyright (c) ZenML GmbH 2021. 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-2.0
#
# Unless required by applic... | 25.857143 | 80 | 0.689445 |
import numpy as np
import tensorflow as tf
from zenml.pipelines import pipeline
from zenml.steps import BaseStepConfig, Output, step
class TrainerConfig(BaseStepConfig):
epochs: int = 1
gamma: float = 0.7
lr: float = 0.001
@step
def importer_mnist() -> Output(
X_train=np.ndarray, y_... | true | true |
f7f398eecfdc5d8d033aa2ad27fd525a4db88431 | 4,378 | py | Python | backend/settings.py | MECKEM-COV-19/backend | c0686f32f98b3acd5dc028d8a054089694654a07 | [
"MIT"
] | null | null | null | backend/settings.py | MECKEM-COV-19/backend | c0686f32f98b3acd5dc028d8a054089694654a07 | [
"MIT"
] | 4 | 2020-03-22T12:27:45.000Z | 2021-06-10T22:44:00.000Z | backend/settings.py | MECKEM-COV-19/backend | c0686f32f98b3acd5dc028d8a054089694654a07 | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 2.2.11.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
f... | 26.059524 | 114 | 0.672225 |
import os
from _datetime import timedelta
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '=n-@8hl8+zq0sya20tl05eoe#0va5dj@#leko1y4!k88g+pffd'
DEBUG = True
ALLOWED_HOSTS = [ 'localhost', '127.0.0.1', 'meckemcov19-backend.eba-m4bbpxub.eu-central-1.elasticbeanstalk.com' ]
... | true | true |
f7f399dc8d0e1eab8552e82af1e0ba9c854f391c | 19,455 | py | Python | lib/geometric_matching_multi_gpu.py | apoorvanand/Deep-Virtual-Try-On | 56d536d46913afb8504ad3336697f2adf7dc965c | [
"MIT"
] | 22 | 2020-09-27T22:14:01.000Z | 2022-03-30T21:09:17.000Z | lib/geometric_matching_multi_gpu.py | apoorvanand/Deep-Virtual-Try-On | 56d536d46913afb8504ad3336697f2adf7dc965c | [
"MIT"
] | 5 | 2021-04-09T16:22:03.000Z | 2021-12-29T08:29:16.000Z | lib/geometric_matching_multi_gpu.py | apoorvanand/Deep-Virtual-Try-On | 56d536d46913afb8504ad3336697f2adf7dc965c | [
"MIT"
] | 15 | 2020-07-21T09:11:03.000Z | 2022-02-05T12:48:29.000Z | import torch
import torch.nn as nn
from torch.nn import init
from torchvision import models
import os
import torch.nn.functional as F
import numpy as np
import sys
sys.path.append('..')
def weights_init_normal(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
init.normal_(m.weight.... | 42.201735 | 151 | 0.609663 | import torch
import torch.nn as nn
from torch.nn import init
from torchvision import models
import os
import torch.nn.functional as F
import numpy as np
import sys
sys.path.append('..')
def weights_init_normal(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
init.normal_(m.weight.... | true | true |
f7f39a195a0c48f2a11cd302ef453e7a3ff5a869 | 737 | py | Python | tracking/settings.py | mjschultz/django-tracking2 | 19679bd16b94e1cc4c9d5bd1abcc01e55dcac49c | [
"BSD-2-Clause"
] | null | null | null | tracking/settings.py | mjschultz/django-tracking2 | 19679bd16b94e1cc4c9d5bd1abcc01e55dcac49c | [
"BSD-2-Clause"
] | null | null | null | tracking/settings.py | mjschultz/django-tracking2 | 19679bd16b94e1cc4c9d5bd1abcc01e55dcac49c | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
TRACK_AJAX_REQUESTS = getattr(settings, 'TRACK_AJAX_REQUESTS', False)
TRACK_ANONYMOUS_USERS = getattr(settings, 'TRACK_ANONYMOUS_USERS', True)
TRACK_PAGEVIEWS = getattr(settings, 'TRACK_PAGEVIEWS', False)
TRACK_IGNORE_URLS = getattr(settings, 'TRACK_IGNORE_URLS', (
r'^(favicon\.i... | 35.095238 | 78 | 0.793758 | from django.conf import settings
TRACK_AJAX_REQUESTS = getattr(settings, 'TRACK_AJAX_REQUESTS', False)
TRACK_ANONYMOUS_USERS = getattr(settings, 'TRACK_ANONYMOUS_USERS', True)
TRACK_PAGEVIEWS = getattr(settings, 'TRACK_PAGEVIEWS', False)
TRACK_IGNORE_URLS = getattr(settings, 'TRACK_IGNORE_URLS', (
r'^(favicon\.i... | true | true |
f7f39bc5483da6e11f2b0ec25a0274862b19d16c | 6,490 | py | Python | python/dgl/runtime/degree_bucketing.py | mori97/dgl | 646d1ab186b3280b99267e106da6b0b8ad12a8ba | [
"Apache-2.0"
] | 1 | 2019-01-28T06:36:05.000Z | 2019-01-28T06:36:05.000Z | python/dgl/runtime/degree_bucketing.py | tbmihailov/dgl | ed1948b5555106dee133cef91ed9ecfd3bd4310d | [
"Apache-2.0"
] | null | null | null | python/dgl/runtime/degree_bucketing.py | tbmihailov/dgl | ed1948b5555106dee133cef91ed9ecfd3bd4310d | [
"Apache-2.0"
] | null | null | null | """Module for degree bucketing schedulers."""
from __future__ import absolute_import
from .._ffi.function import _init_api
from ..base import is_all
from .. import backend as F
from ..udf import NodeBatch
from .. import utils
from . import ir
from .ir import var
def gen_degree_bucketing_schedule(
graph,
... | 33.626943 | 79 | 0.65624 | from __future__ import absolute_import
from .._ffi.function import _init_api
from ..base import is_all
from .. import backend as F
from ..udf import NodeBatch
from .. import utils
from . import ir
from .ir import var
def gen_degree_bucketing_schedule(
graph,
reduce_udf,
message_ids,
d... | true | true |
f7f39c687d74219c7bbe17d8dc167b9114b5ebcf | 2,461 | py | Python | utils.py | JJUNGYUN/tensorflow-fast-style-transfer | faf8608399b14de008edf533169b2cf25c811dbc | [
"Apache-2.0"
] | null | null | null | utils.py | JJUNGYUN/tensorflow-fast-style-transfer | faf8608399b14de008edf533169b2cf25c811dbc | [
"Apache-2.0"
] | null | null | null | utils.py | JJUNGYUN/tensorflow-fast-style-transfer | faf8608399b14de008edf533169b2cf25c811dbc | [
"Apache-2.0"
] | null | null | null | import numpy as np
import PIL.Image
import os
import scipy
from matplotlib.pyplot import imread, imsave
from skimage.transform import resize
"""Helper-functions to load MSCOCO DB"""
# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py
def get_img(src, img_size=False):
img = imr... | 34.180556 | 102 | 0.69037 | import numpy as np
import PIL.Image
import os
import scipy
from matplotlib.pyplot import imread, imsave
from skimage.transform import resize
def get_img(src, img_size=False):
img = imread(src)
if not (len(img.shape) == 3 and img.shape[2] == 3):
img = np.dstack((img,img,img))
if img_size != False:
... | true | true |
f7f39cf6b9e9202cf9a62bd75c6982b877d8a1d5 | 572 | py | Python | asylumwatch/asylum_registrations/models.py | PieterBlomme/asylumwatch | 798252ec1d71e9fac65965cbc08ebd3a0634a77c | [
"MIT"
] | null | null | null | asylumwatch/asylum_registrations/models.py | PieterBlomme/asylumwatch | 798252ec1d71e9fac65965cbc08ebd3a0634a77c | [
"MIT"
] | null | null | null | asylumwatch/asylum_registrations/models.py | PieterBlomme/asylumwatch | 798252ec1d71e9fac65965cbc08ebd3a0634a77c | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class AsylumRegistration(models.Model):
destination_country = models.CharField(max_length=200)
pub_date = models.DateField('date published')
source_country = models.CharField(max_length=200)
number_of_requests = models.IntegerField(default=0)
... | 44 | 74 | 0.795455 | from django.db import models
class AsylumRegistration(models.Model):
destination_country = models.CharField(max_length=200)
pub_date = models.DateField('date published')
source_country = models.CharField(max_length=200)
number_of_requests = models.IntegerField(default=0)
refugee_status_approved = ... | true | true |
f7f39d1d86000824a5ba9ba6b92658175915bce2 | 530 | py | Python | kubespawner/__init__.py | ondave/kubespawner | 351540ef1610e76eaf9b0176825e1249706c5a8c | [
"BSD-3-Clause"
] | null | null | null | kubespawner/__init__.py | ondave/kubespawner | 351540ef1610e76eaf9b0176825e1249706c5a8c | [
"BSD-3-Clause"
] | null | null | null | kubespawner/__init__.py | ondave/kubespawner | 351540ef1610e76eaf9b0176825e1249706c5a8c | [
"BSD-3-Clause"
] | null | null | null | """
JupyterHub Spawner to spawn user notebooks on a Kubernetes cluster.
After installation, you can enable it by adding::
c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner'
in your `jupyterhub_config.py` file.
"""
# We export KubeSpawner specifically here. This simplifies import for users.
# Users can simply... | 31.176471 | 76 | 0.784906 |
from .spawner import KubeSpawner
__version__ = '3.0.2.dev'
__all__ = ["KubeSpawner"]
| true | true |
f7f39dac0ba2c43349807825d1202d67b3083381 | 13,066 | py | Python | hc/accounts/views.py | Lemmah/healthchecks-clone | 7341ca89757950868c0d24debd7618349f25b094 | [
"BSD-3-Clause"
] | null | null | null | hc/accounts/views.py | Lemmah/healthchecks-clone | 7341ca89757950868c0d24debd7618349f25b094 | [
"BSD-3-Clause"
] | null | null | null | hc/accounts/views.py | Lemmah/healthchecks-clone | 7341ca89757950868c0d24debd7618349f25b094 | [
"BSD-3-Clause"
] | 1 | 2021-05-21T19:50:52.000Z | 2021-05-21T19:50:52.000Z | from datetime import timedelta as td
import uuid
import re
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.contrib.auth import authenticate
from django.contrib.auth.decorators impo... | 30.888889 | 79 | 0.614113 | from datetime import timedelta as td
import uuid
import re
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.contrib.auth import authenticate
from django.contrib.auth.decorators impo... | true | true |
f7f39ea3b47bab5f289dfd77543e0d2c9e9c394e | 560 | py | Python | basic-concepts/1a-number-conversion.py | AlienCoders/learning-python | 255dc32400b79db83382e707c96df029cfe30b24 | [
"MIT"
] | 19 | 2019-08-30T06:51:52.000Z | 2022-03-11T18:44:29.000Z | basic-concepts/1a-number-conversion.py | AlienCoders/learning-python | 255dc32400b79db83382e707c96df029cfe30b24 | [
"MIT"
] | 9 | 2020-02-14T09:21:20.000Z | 2022-03-08T09:38:09.000Z | basic-concepts/1a-number-conversion.py | sumanchary86/learning-python | 99ae9c31d62a07d1363b67f22f93173730346d76 | [
"MIT"
] | 12 | 2020-07-20T18:49:45.000Z | 2021-12-18T11:20:03.000Z | #!/usr/bin/python
# This tutorial will cover the concept of numeric type conversion in Python3.x
# Int
positive_int = 55
# Float
negative_float = -2.9987654
# Complex
complex_num = 1j
# convert from int to float:
positive_float = float(positive_int)
# convert from float to int:
negative_int = int(negative_flo... | 18.666667 | 78 | 0.760714 |
positive_int = 55
negative_float = -2.9987654
complex_num = 1j
positive_float = float(positive_int)
negative_int = int(negative_float)
complex_from_int = complex(positive_int)
print(positive_float)
print(negative_int)
print(complex_from_int)
print(type(positive_float))
print(type(negative_in... | true | true |
f7f39fd094749ab17bca8624f927db6889a50fcc | 6,894 | py | Python | tests/schema.py | lynshi/CCF | a651fb542eab3f53431bf791d6d31c81d0d6ee51 | [
"Apache-2.0"
] | null | null | null | tests/schema.py | lynshi/CCF | a651fb542eab3f53431bf791d6d31c81d0d6ee51 | [
"Apache-2.0"
] | null | null | null | tests/schema.py | lynshi/CCF | a651fb542eab3f53431bf791d6d31c81d0d6ee51 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import json
import http
import infra.network
import infra.proc
import infra.e2e_args
import infra.checker
import openapi_spec_validator
from packaging import version
from infra.runner import ConcurrentRunner
i... | 31.19457 | 162 | 0.576298 |
import os
import json
import http
import infra.network
import infra.proc
import infra.e2e_args
import infra.checker
import openapi_spec_validator
from packaging import version
from infra.runner import ConcurrentRunner
import nobuiltins
import e2e_tutorial
import e2e_operations
from loguru import logger as LOG
def ... | true | true |
f7f3a0cca56557e6df4214f16b8d37d2b0e24869 | 113 | py | Python | extra_generic_fields/apps.py | kacchan822/django-extra-generic-fields | 513aadd902efbd0a0004232397d5ccea4794b3c9 | [
"MIT"
] | null | null | null | extra_generic_fields/apps.py | kacchan822/django-extra-generic-fields | 513aadd902efbd0a0004232397d5ccea4794b3c9 | [
"MIT"
] | null | null | null | extra_generic_fields/apps.py | kacchan822/django-extra-generic-fields | 513aadd902efbd0a0004232397d5ccea4794b3c9 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ExtraGenericFieldsConfig(AppConfig):
name = 'extra_generic_fields'
| 18.833333 | 42 | 0.80531 | from django.apps import AppConfig
class ExtraGenericFieldsConfig(AppConfig):
name = 'extra_generic_fields'
| true | true |
f7f3a100bcae359f8f1b304e70dca88ec90727a5 | 2,421 | py | Python | scphylo/commands/caller/_5mutect2.py | faridrashidi/scphylo-tools | 4574e2c015da58e59caa38e3b3e49b398c1379c1 | [
"BSD-3-Clause"
] | null | null | null | scphylo/commands/caller/_5mutect2.py | faridrashidi/scphylo-tools | 4574e2c015da58e59caa38e3b3e49b398c1379c1 | [
"BSD-3-Clause"
] | null | null | null | scphylo/commands/caller/_5mutect2.py | faridrashidi/scphylo-tools | 4574e2c015da58e59caa38e3b3e49b398c1379c1 | [
"BSD-3-Clause"
] | null | null | null | import subprocess
import click
import scphylo as scp
from scphylo.ul._servers import cmd, write_cmds_get_main
@click.command(short_help="Run MuTect2.")
@click.argument(
"outdir",
required=True,
type=click.Path(
exists=True, file_okay=False, dir_okay=True, readable=True, resolve_path=True
),
... | 23.278846 | 85 | 0.542751 | import subprocess
import click
import scphylo as scp
from scphylo.ul._servers import cmd, write_cmds_get_main
@click.command(short_help="Run MuTect2.")
@click.argument(
"outdir",
required=True,
type=click.Path(
exists=True, file_okay=False, dir_okay=True, readable=True, resolve_path=True
),
... | true | true |
f7f3a21d7f79be811415114b339f113ef3304381 | 6,531 | py | Python | tests/h/conftest.py | discodavey/h | 7bff8478b3a5b936de82ac9fcd89b355f4afd3aa | [
"MIT"
] | null | null | null | tests/h/conftest.py | discodavey/h | 7bff8478b3a5b936de82ac9fcd89b355f4afd3aa | [
"MIT"
] | 5 | 2017-12-26T14:22:20.000Z | 2018-04-02T02:56:38.000Z | tests/h/conftest.py | SenseTW/h | dae2dfa8ab064ddb696e5657d48459114b2642d2 | [
"MIT"
] | 1 | 2021-03-12T09:45:04.000Z | 2021-03-12T09:45:04.000Z | # -*- coding: utf-8 -*-
# pylint: disable=no-self-use
"""
The `conftest` module is automatically loaded by py.test and serves as a place
to put fixture functions that are useful application-wide.
"""
import functools
import os
import deform
import mock
import pytest
import click.testing
import sqlalchemy
from pyrami... | 25.611765 | 89 | 0.698209 |
import functools
import os
import deform
import mock
import pytest
import click.testing
import sqlalchemy
from pyramid import testing
from pyramid.request import apply_request_extensions
from sqlalchemy.orm import sessionmaker
from webob.multidict import MultiDict
from h import db
from h import form
from h.settin... | true | true |
f7f3a236fb741726bafa1583a259a69c2c88eeb6 | 230,937 | py | Python | oletools/olevba.py | kirk-sayre-work/oletools | 49473dabe752a59e5a061a10dcee485e231c54e8 | [
"BSD-2-Clause"
] | 3 | 2019-05-22T16:21:17.000Z | 2020-03-15T03:28:06.000Z | oletools/olevba.py | kirk-sayre-work/oletools | 49473dabe752a59e5a061a10dcee485e231c54e8 | [
"BSD-2-Clause"
] | null | null | null | oletools/olevba.py | kirk-sayre-work/oletools | 49473dabe752a59e5a061a10dcee485e231c54e8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
olevba.py
olevba is a script to parse OLE and OpenXML files such as MS Office documents
(e.g. Word, Excel), to extract VBA Macro code in clear text, deobfuscate
and analyze malicious macros.
XLM/Excel 4 Macros are also supported in Excel and SLK files.
Supported formats:
- Word 97-2003 (... | 50.018843 | 337 | 0.611491 |
from __future__ import print_function
----------------------------------
import traceback
import sys
import os
import logging
import struct
from io import BytesIO, StringIO
import math
import zipfile
import re
import argparse
import binasci... | true | true |
f7f3a3aadd57160698ff94651e334ea8a93916f5 | 503 | py | Python | angular_flask/models/Category.py | saqib-nadeem/sample_python_scripts | 35054816b262a3860ab9db383ab5d9e11ac0ce87 | [
"MIT"
] | null | null | null | angular_flask/models/Category.py | saqib-nadeem/sample_python_scripts | 35054816b262a3860ab9db383ab5d9e11ac0ce87 | [
"MIT"
] | null | null | null | angular_flask/models/Category.py | saqib-nadeem/sample_python_scripts | 35054816b262a3860ab9db383ab5d9e11ac0ce87 | [
"MIT"
] | null | null | null | import datetime
from flask.ext.mongoengine import MongoEngine
from mongoengine import *
from angular_flask import app
from angular_flask.models.Store import Store
db = MongoEngine(app)
class Category(db.Document):
name = StringField(max_length=200, required=True)
description = StringField(max_length=1000, ... | 22.863636 | 76 | 0.763419 | import datetime
from flask.ext.mongoengine import MongoEngine
from mongoengine import *
from angular_flask import app
from angular_flask.models.Store import Store
db = MongoEngine(app)
class Category(db.Document):
name = StringField(max_length=200, required=True)
description = StringField(max_length=1000, ... | true | true |
f7f3a48e923430b4d09890e7fc9810f16cd89669 | 3,404 | py | Python | day-13/part-1/degemer.py | badouralix/adventofcode-2018 | 543ce39d4eeb7d9d695459ffadca001a8c56386d | [
"MIT"
] | 31 | 2018-12-01T00:43:40.000Z | 2020-05-30T05:18:59.000Z | day-13/part-1/degemer.py | badouralix/adventofcode-2018 | 543ce39d4eeb7d9d695459ffadca001a8c56386d | [
"MIT"
] | 14 | 2018-12-01T12:14:26.000Z | 2021-05-07T22:41:47.000Z | day-13/part-1/degemer.py | badouralix/adventofcode-2018 | 543ce39d4eeb7d9d695459ffadca001a8c56386d | [
"MIT"
] | 10 | 2018-12-01T23:38:34.000Z | 2020-12-28T13:36:10.000Z | from tool.runners.python import SubmissionPy
import numpy as np
class DegemerSubmission(SubmissionPy):
def run(self, s):
# :param s: input in string format
# :return: solution flag
# Your code goes here
s = s.splitlines()
# 0 nothing, 1 horizontal, 2 vertical, 3 /, 4 \, 5 ... | 33.70297 | 82 | 0.341363 | from tool.runners.python import SubmissionPy
import numpy as np
class DegemerSubmission(SubmissionPy):
def run(self, s):
s = s.splitlines()
store = np.zeros((len(s), len(s[0])), dtype=np.int)
carts = []
for i, line in enumerate(s):
... | true | true |
f7f3a4da5291923745f97d58454ab2dabb24ca5d | 2,946 | py | Python | lyricwikia/lyricwikia.py | Swat712/lyricwikia | cdff57d5c1ea6b19aa7d4a2e2ddda68ea09bb07e | [
"MIT"
] | 41 | 2016-08-07T21:22:44.000Z | 2022-03-08T17:45:36.000Z | lyricwikia/lyricwikia.py | Swat712/lyricwikia | cdff57d5c1ea6b19aa7d4a2e2ddda68ea09bb07e | [
"MIT"
] | 9 | 2016-12-09T15:40:38.000Z | 2020-10-08T10:59:14.000Z | lyricwikia/lyricwikia.py | Swat712/lyricwikia | cdff57d5c1ea6b19aa7d4a2e2ddda68ea09bb07e | [
"MIT"
] | 16 | 2016-12-09T22:57:07.000Z | 2020-05-14T05:21:16.000Z | from six.moves.urllib.parse import quote as _quote
from bs4 import BeautifulSoup as _BeautifulSoup
import requests as _requests
__BASE_URL__ = 'https://lyrics.wikia.com'
class LyricsNotFound(Exception):
__module__ = Exception.__module__
def __init__(self, message=None):
super(LyricsNotFound, self)._... | 29.168317 | 79 | 0.645621 | from six.moves.urllib.parse import quote as _quote
from bs4 import BeautifulSoup as _BeautifulSoup
import requests as _requests
__BASE_URL__ = 'https://lyrics.wikia.com'
class LyricsNotFound(Exception):
__module__ = Exception.__module__
def __init__(self, message=None):
super(LyricsNotFound, self)._... | true | true |
f7f3a57a3aeb99443c465ef196e7d8abaa3654ae | 439 | py | Python | packages/python/plotly/plotly/validators/layout/slider/_activebgcolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/slider/_activebgcolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/slider/_activebgcolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ActivebgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="activebgcolor", parent_name="layout.slider", **kwargs
):
super(ActivebgcolorValidator, self).__init__(
plotly_name=plotly_name,
... | 31.357143 | 80 | 0.669704 | import _plotly_utils.basevalidators
class ActivebgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="activebgcolor", parent_name="layout.slider", **kwargs
):
super(ActivebgcolorValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
f7f3a61ec9bf1e66ce913870e8a72abaf137213c | 1,490 | py | Python | samples/generated_samples/pubsub_v1_generated_publisher_list_topic_snapshots_sync.py | acocuzzo/python-pubsub | fcb67dd0d8fff5a583ebe0a3a08d0219601df8e9 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/pubsub_v1_generated_publisher_list_topic_snapshots_sync.py | acocuzzo/python-pubsub | fcb67dd0d8fff5a583ebe0a3a08d0219601df8e9 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/pubsub_v1_generated_publisher_list_topic_snapshots_sync.py | acocuzzo/python-pubsub | fcb67dd0d8fff5a583ebe0a3a08d0219601df8e9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.702128 | 85 | 0.757718 |
from google import pubsub_v1
def sample_list_topic_snapshots():
client = pubsub_v1.PublisherClient()
request = pubsub_v1.ListTopicSnapshotsRequest(
topic="topic_value",
)
page_result = client.list_topic_snapshots(request=request)
for respons... | true | true |
f7f3a6a1b00b18774a76bd7a1fec15ca19ded9c2 | 2,443 | py | Python | azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.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 ... | 46.09434 | 163 | 0.659844 |
from msrest.serialization import Model
class ServerUpdateParameters(Model):
_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
'administrator_login_password': {'key': 'properties.administra... | true | true |
f7f3a7079be204d8f9bb273d6e64d07a57c0e1f7 | 3,880 | py | Python | mdd/transforms/transforms.py | orobix/mdd-domain-adaptation | 345af1db29f11071526423973ea8a886c824c1b9 | [
"MIT"
] | 16 | 2021-01-14T02:37:56.000Z | 2021-05-16T10:20:07.000Z | mdd/transforms/transforms.py | orobix/mdd-domain-adaptation | 345af1db29f11071526423973ea8a886c824c1b9 | [
"MIT"
] | null | null | null | mdd/transforms/transforms.py | orobix/mdd-domain-adaptation | 345af1db29f11071526423973ea8a886c824c1b9 | [
"MIT"
] | null | null | null | import numbers
from typing import List, Tuple
import albumentations
import numpy
from albumentations.augmentations import functional as F
def _check_size(size):
if isinstance(size, numbers.Number):
size = (int(size), int(size))
elif isinstance(size, (tuple, list)) and len(size) == 1:
size = (... | 32.333333 | 94 | 0.649485 | import numbers
from typing import List, Tuple
import albumentations
import numpy
from albumentations.augmentations import functional as F
def _check_size(size):
if isinstance(size, numbers.Number):
size = (int(size), int(size))
elif isinstance(size, (tuple, list)) and len(size) == 1:
size = (... | true | true |
f7f3a9ce636de1d5f7888c7fc5e41b2085e6af45 | 597 | py | Python | mini-programs/summing-list-elements.py | fhansmann/coding-local | 6cb8e8fb8ad7ac619dfdd068cfd70559b04e4b6a | [
"MIT"
] | null | null | null | mini-programs/summing-list-elements.py | fhansmann/coding-local | 6cb8e8fb8ad7ac619dfdd068cfd70559b04e4b6a | [
"MIT"
] | null | null | null | mini-programs/summing-list-elements.py | fhansmann/coding-local | 6cb8e8fb8ad7ac619dfdd068cfd70559b04e4b6a | [
"MIT"
] | null | null | null | ethernet_devices = [1, [7], [2], [8374163], [84302738]]
usb_devices = [1, [7], [1], [2314567], [0]]
# The long way
all_devices = [
ethernet_devices[0] + usb_devices[0],
ethernet_devices[1] + usb_devices[1],
ethernet_devices[2] + usb_devices[2],
ethernet_devices[3] + usb_devices[3],
ethernet_devices[4] + ... | 27.136364 | 70 | 0.706868 | ethernet_devices = [1, [7], [2], [8374163], [84302738]]
usb_devices = [1, [7], [1], [2314567], [0]]
all_devices = [
ethernet_devices[0] + usb_devices[0],
ethernet_devices[1] + usb_devices[1],
ethernet_devices[2] + usb_devices[2],
ethernet_devices[3] + usb_devices[3],
ethernet_devices[4] + usb_devices[4]... | false | true |
f7f3a9d373015498c02801b4065f870f95127afc | 14,992 | py | Python | test/test_da.py | vfdev-5/POT | e757b75976ece1e6e53e655852b9f8863e7b6f5a | [
"MIT"
] | 2 | 2019-06-18T14:22:11.000Z | 2019-07-01T08:43:43.000Z | test/test_da.py | vfdev-5/POT | e757b75976ece1e6e53e655852b9f8863e7b6f5a | [
"MIT"
] | null | null | null | test/test_da.py | vfdev-5/POT | e757b75976ece1e6e53e655852b9f8863e7b6f5a | [
"MIT"
] | 1 | 2020-01-09T07:32:17.000Z | 2020-01-09T07:32:17.000Z | """Tests for module da on Domain Adaptation """
# Author: Remi Flamary <remi.flamary@unice.fr>
#
# License: MIT License
import numpy as np
from numpy.testing.utils import assert_allclose, assert_equal
import ot
from ot.datasets import make_data_classif
from ot.utils import unif
def test_sinkhorn_lpl1_transport_cla... | 30.784394 | 78 | 0.660285 |
import numpy as np
from numpy.testing.utils import assert_allclose, assert_equal
import ot
from ot.datasets import make_data_classif
from ot.utils import unif
def test_sinkhorn_lpl1_transport_class():
ns = 150
nt = 200
Xs, ys = make_data_classif('3gauss', ns)
Xt, yt = make_data_classif('3gauss... | true | true |
f7f3aa14dec3d1446bea62f513cadea2f4d547ce | 2,624 | py | Python | tf1.6/tensorflow_tutorial.py | sgeos/tensorflow_playground | c4c10b74b1eebb63f0bf8de7a9a976c11f025618 | [
"CC0-1.0"
] | null | null | null | tf1.6/tensorflow_tutorial.py | sgeos/tensorflow_playground | c4c10b74b1eebb63f0bf8de7a9a976c11f025618 | [
"CC0-1.0"
] | null | null | null | tf1.6/tensorflow_tutorial.py | sgeos/tensorflow_playground | c4c10b74b1eebb63f0bf8de7a9a976c11f025618 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# Reference
# https://www.tensorflow.org/get_started/get_started
def repl( expression, globals=None, locals=None ):
for expression in expression.splitlines():
expression = expression.strip()
if expression:
print(f">>> {expression}")
eval(compile(expression + "\n", "<strin... | 40.369231 | 161 | 0.654726 |
def repl( expression, globals=None, locals=None ):
for expression in expression.splitlines():
expression = expression.strip()
if expression:
print(f">>> {expression}")
eval(compile(expression + "\n", "<string>", "single"), globals, locals)
else:
print("")
code = """
import tensor... | true | true |
f7f3aaa833ce341c93a367bdeff9d661ac393da2 | 12,451 | py | Python | nailgun/nailgun/api/v1/handlers/orchestrator.py | dnikishov/fuel-web | 152c2072cf585fc61d7e157ccf9a7ea1d0377daa | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/api/v1/handlers/orchestrator.py | dnikishov/fuel-web | 152c2072cf585fc61d7e157ccf9a7ea1d0377daa | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/api/v1/handlers/orchestrator.py | dnikishov/fuel-web | 152c2072cf585fc61d7e157ccf9a7ea1d0377daa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | 33.742547 | 79 | 0.672797 |
import traceback
import six
import web
from nailgun.api.v1.handlers.base import BaseHandler
from nailgun.api.v1.handlers.base import content
from nailgun.api.v1.validators.cluster import ProvisionSelectedNodesValidator
from nailgun.api.v1.validators.graph import GraphVisualizationValidator
from nailgu... | true | true |
f7f3aaaafce990bd4361c22570f5af6a31088698 | 1,446 | py | Python | checkov/kubernetes/checks/resource/k8s/NginxIngressCVE202125742Lua.py | nmrad-91/checkov | ce8ace76fd5bec6ba95697163a03d18b2611a9f7 | [
"Apache-2.0"
] | null | null | null | checkov/kubernetes/checks/resource/k8s/NginxIngressCVE202125742Lua.py | nmrad-91/checkov | ce8ace76fd5bec6ba95697163a03d18b2611a9f7 | [
"Apache-2.0"
] | null | null | null | checkov/kubernetes/checks/resource/k8s/NginxIngressCVE202125742Lua.py | nmrad-91/checkov | ce8ace76fd5bec6ba95697163a03d18b2611a9f7 | [
"Apache-2.0"
] | null | null | null | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
from checkov.common.util.type_forcers import force_list
import re
class NginxIngressCVE202125742Lua(BaseK8Check):
def __init__(self):
name = "Prevent NGINX Ingre... | 42.529412 | 111 | 0.654219 | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
from checkov.common.util.type_forcers import force_list
import re
class NginxIngressCVE202125742Lua(BaseK8Check):
def __init__(self):
name = "Prevent NGINX Ingre... | true | true |
f7f3aacdff038f84e4a1470c513ea18a04b6f288 | 4,300 | py | Python | examples/cluster/plot_adjusted_for_chance_measures.py | DeuroIO/Deuro-scikit-learn | 9dd09a19593d1224077fe0d1a754aed936269528 | [
"MIT"
] | 5 | 2018-07-04T22:13:54.000Z | 2018-07-04T22:21:29.000Z | examples/cluster/plot_adjusted_for_chance_measures.py | DeuroIO/Deuro-scikit-learn | 9dd09a19593d1224077fe0d1a754aed936269528 | [
"MIT"
] | 11 | 2019-11-02T17:24:17.000Z | 2019-11-02T17:33:17.000Z | examples/cluster/plot_adjusted_for_chance_measures.py | DeuroIO/Deuro-scikit-learn | 9dd09a19593d1224077fe0d1a754aed936269528 | [
"MIT"
] | 4 | 2019-07-18T10:43:53.000Z | 2020-06-19T12:54:39.000Z | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... | 34.95935 | 79 | 0.705581 | print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from time import time
from sklearn import metrics
def uniform_labelings_scores(score_func, n_samples, n_clusters_range,
fixed_n_classes=None, n_runs=5, seed=42):
random_labels = np.random.RandomState(seed).randint
... | true | true |
f7f3ac2b1bc335690dbcd8f7175ad3d7f2c28614 | 22,339 | py | Python | roles/openshift_master_facts/filter_plugins/openshift_master.py | Ravichandramanupati/openshift | 1720af442f0b02359ce4cc70d32adca15d9d26ab | [
"Apache-2.0"
] | 1 | 2017-11-01T05:46:27.000Z | 2017-11-01T05:46:27.000Z | roles/openshift_master_facts/filter_plugins/openshift_master.py | gloria-sentinella/openshift-ansible | e03493f33073965ddf8c49256df80143059a2a51 | [
"Apache-2.0"
] | 3 | 2016-12-01T23:01:36.000Z | 2016-12-02T00:16:48.000Z | roles/openshift_master_facts/filter_plugins/openshift_master.py | gloria-sentinella/openshift-ansible | e03493f33073965ddf8c49256df80143059a2a51 | [
"Apache-2.0"
] | 1 | 2018-01-30T05:44:59.000Z | 2018-01-30T05:44:59.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in openshift-master
'''
import copy
import sys
from ansible import errors
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.plugins.filter.core import to_bool as ansible_bool
# ansible.compat.six goes away with Ansible 2.4
try:
... | 39.678508 | 120 | 0.58897 |
import copy
import sys
from ansible import errors
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.plugins.filter.core import to_bool as ansible_bool
try:
from ansible.compat.six import string_types, u
except ImportError:
from ansible.module_utils.six import string_types, u
import yaml
... | true | true |
f7f3ae0deca6ef2573679f9ac75aa22410503a98 | 442 | py | Python | blog/forms.py | yadra/pet-blog | 62ca97091f927f5c4e87afb8e300302f97195518 | [
"MIT"
] | null | null | null | blog/forms.py | yadra/pet-blog | 62ca97091f927f5c4e87afb8e300302f97195518 | [
"MIT"
] | 4 | 2020-06-05T23:52:40.000Z | 2021-06-10T19:11:54.000Z | blog/forms.py | yadra/test-blog | 62ca97091f927f5c4e87afb8e300302f97195518 | [
"MIT"
] | null | null | null | from django import forms
from .models import Comment
class EmailPostForm(forms.Form):
name = forms.CharField(max_length=25)
email = forms.EmailField()
to = forms.EmailField()
comments = forms.CharField(required=False, widget=forms.Textarea)
class CommentForm(forms.ModelForm):
class Meta:
... | 22.1 | 69 | 0.690045 | from django import forms
from .models import Comment
class EmailPostForm(forms.Form):
name = forms.CharField(max_length=25)
email = forms.EmailField()
to = forms.EmailField()
comments = forms.CharField(required=False, widget=forms.Textarea)
class CommentForm(forms.ModelForm):
class Meta:
... | true | true |
f7f3aee7b1ea6144560fd9def761d568ac8fd408 | 42,804 | py | Python | selfdrive/car/honda/values.py | zer0onetwothree/openpilot | b8c7502d7e0e626e84bee95f3c3cd04a45a02f9f | [
"MIT"
] | null | null | null | selfdrive/car/honda/values.py | zer0onetwothree/openpilot | b8c7502d7e0e626e84bee95f3c3cd04a45a02f9f | [
"MIT"
] | null | null | null | selfdrive/car/honda/values.py | zer0onetwothree/openpilot | b8c7502d7e0e626e84bee95f3c3cd04a45a02f9f | [
"MIT"
] | null | null | null | # flake8: noqa
from cereal import car
from selfdrive.car import dbc_dict
Ecu = car.CarParams.Ecu
VisualAlert = car.CarControl.HUDControl.VisualAlert
# Car button codes
class CruiseButtons:
RES_ACCEL = 4
DECEL_SET = 3
CANCEL = 2
MAIN = 1
# See dbc files for info on values"
VISUAL_HUD = {
VisualAlert.none: ... | 42.718563 | 856 | 0.575086 |
from cereal import car
from selfdrive.car import dbc_dict
Ecu = car.CarParams.Ecu
VisualAlert = car.CarControl.HUDControl.VisualAlert
class CruiseButtons:
RES_ACCEL = 4
DECEL_SET = 3
CANCEL = 2
MAIN = 1
VISUAL_HUD = {
VisualAlert.none: 0,
VisualAlert.fcw: 1,
VisualAlert.steerRequired: 1,
VisualAl... | true | true |
f7f3b03c5d856c8cbda28e03210c545792bfaea2 | 2,541 | py | Python | networks/encoder.py | TropComplique/bicycle-gan | 4bc8f4cdbe138e23c8a02c408cfb8e2ff7dfe6ab | [
"MIT"
] | 4 | 2019-07-03T06:49:46.000Z | 2020-10-03T12:17:41.000Z | networks/encoder.py | TropComplique/bicycle-gan | 4bc8f4cdbe138e23c8a02c408cfb8e2ff7dfe6ab | [
"MIT"
] | null | null | null | networks/encoder.py | TropComplique/bicycle-gan | 4bc8f4cdbe138e23c8a02c408cfb8e2ff7dfe6ab | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class ResNetEncoder(nn.Module):
def __init__(self, in_channels, out_dimension, depth=48, num_blocks=5):
"""
Arguments:
in_channels: an integer.
out_channels: an integer.
depth: an integer.
num_blocks: an integer, n... | 30.614458 | 87 | 0.573003 | import torch
import torch.nn as nn
class ResNetEncoder(nn.Module):
def __init__(self, in_channels, out_dimension, depth=48, num_blocks=5):
super(ResNetEncoder, self).__init__()
layers = [
nn.Conv2d(in_channels, depth, kernel_size=4, stride=2, padding=1),
nn.LeakyReLU(0.2,... | true | true |
f7f3b069ac9453e06095e4da6b3648da09f640b7 | 35 | py | Python | tools/Polygraphy/polygraphy/util/__init__.py | borisfom/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | [
"Apache-2.0"
] | 1 | 2022-03-05T08:46:19.000Z | 2022-03-05T08:46:19.000Z | tools/Polygraphy/polygraphy/util/__init__.py | maxpark/TensorRT | 46253b644142a1d9632ba463422abfc5dcefc371 | [
"Apache-2.0"
] | null | null | null | tools/Polygraphy/polygraphy/util/__init__.py | maxpark/TensorRT | 46253b644142a1d9632ba463422abfc5dcefc371 | [
"Apache-2.0"
] | 1 | 2022-03-19T16:03:30.000Z | 2022-03-19T16:03:30.000Z | from polygraphy.util.util import *
| 17.5 | 34 | 0.8 | from polygraphy.util.util import *
| true | true |
f7f3b09386c969edf9c8e32c5479dd0aa3e9ed0b | 638 | py | Python | Wheel_Tracker/chiprunner.py | denchief515/Wheel_Runner | cd59413575c11caeaeb5949ce129b05be2e0ba14 | [
"MIT"
] | null | null | null | Wheel_Tracker/chiprunner.py | denchief515/Wheel_Runner | cd59413575c11caeaeb5949ce129b05be2e0ba14 | [
"MIT"
] | null | null | null | Wheel_Tracker/chiprunner.py | denchief515/Wheel_Runner | cd59413575c11caeaeb5949ce129b05be2e0ba14 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
import urllib2
import time
from time import gmtime, strftime
sw_in = 8
count = 0
GPIO.setmode(GPIO.BOARD)
GPIO.setup(sw_in,GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(sw_in,GPIO.FALLING)
GPIO.setwarnings(False)
print("Chip Runner activated")
print(strftime("%Y-%m-%d %H:%M:%S", gm... | 23.62963 | 75 | 0.710031 | import RPi.GPIO as GPIO
import urllib2
import time
from time import gmtime, strftime
sw_in = 8
count = 0
GPIO.setmode(GPIO.BOARD)
GPIO.setup(sw_in,GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(sw_in,GPIO.FALLING)
GPIO.setwarnings(False)
print("Chip Runner activated")
print(strftime("%Y-%m-%d %H:%M:%S", gm... | false | true |
f7f3b0efd482f8fca62b1704077f276dc13d631f | 9,019 | py | Python | Torch/Nets/decoder_utils.py | Rintarooo/MDVRP_MHA | f196f1c99c3e4efa1ab6d75f4af77685afe4d191 | [
"MIT"
] | 7 | 2021-05-17T09:48:21.000Z | 2022-03-16T07:37:08.000Z | Torch/Nets/decoder_utils.py | Rintarooo/MDVRP_MHA | f196f1c99c3e4efa1ab6d75f4af77685afe4d191 | [
"MIT"
] | null | null | null | Torch/Nets/decoder_utils.py | Rintarooo/MDVRP_MHA | f196f1c99c3e4efa1ab6d75f4af77685afe4d191 | [
"MIT"
] | 1 | 2021-05-08T09:16:07.000Z | 2021-05-08T09:16:07.000Z | import torch
import torch.nn as nn
class Env():
def __init__(self, x, node_embeddings):
super().__init__()
"""depot_xy: (batch, n_depot, 2)
customer_xy: (batch, n_customer, 2)
--> xy: (batch, n_node, 2); Coordinates of depot + customer nodes
n_node= n_depot + n_customer
demand: (batch, n_customer)
... | 43.15311 | 147 | 0.700965 | import torch
import torch.nn as nn
class Env():
def __init__(self, x, node_embeddings):
super().__init__()
self.device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
self.demand = x['demand']
self.xy = torch.cat([x['depot_xy'], x['customer_xy']], 1)
self.car_start_node, self.D = x['car_sta... | true | true |
f7f3b17f3666687d57ed22f35fddaad6d78eb104 | 25,552 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 44.438261 | 144 | 0.66034 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from .. import models
class RouteFiltersOperations(object):
models = models
... | true | true |
f7f3b2c5b5cff3fb004e5da69bfaafc6d42fc9fe | 2,058 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/pos_profile/test_pos_profile.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/pos_profile/test_pos_profile.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/pos_profile/test_pos_profile.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.stock.get_item_details import get_pos_profile
from erpnext.accounts.doctype.sales_invoice.pos import get_ite... | 37.418182 | 124 | 0.723518 |
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.stock.get_item_details import get_pos_profile
from erpnext.accounts.doctype.sales_invoice.pos import get_items_list, get_customers_list
class TestPOSProfile(unittest.TestCase):
def test_pos_profile(self):
make_pos_profile()
po... | true | true |
f7f3b2c7348f3e26e504a099255639d9e37566c3 | 3,153 | py | Python | utils/misc/misc.py | piyueh/SEM-Exercises | d25e6c1bc609022189952d97488828113cfb2206 | [
"MIT"
] | null | null | null | utils/misc/misc.py | piyueh/SEM-Exercises | d25e6c1bc609022189952d97488828113cfb2206 | [
"MIT"
] | null | null | null | utils/misc/misc.py | piyueh/SEM-Exercises | d25e6c1bc609022189952d97488828113cfb2206 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Pi-Yueh Chuang <pychuang@gwu.edu>
#
# Distributed under terms of the MIT license.
"""Some misc functions"""
import numpy
import numbers
import functools
# TODO: replace assertion with if ... raise
def factorial(n):
"""Naive i... | 24.826772 | 77 | 0.607041 |
import numpy
import numbers
import functools
def factorial(n):
if not isinstance(n, (int, numpy.int_)):
raise ValueError(
"n is not an integer: {0}, {1}".format(n, type(n)))
if n == 0:
return 1
else:
return functools.reduce(lambda x, y: x * y, range(1, n+1)... | true | true |
f7f3b3283f53253ab42c98841c5073db5fdeba6f | 1,027 | py | Python | src/lib/WhileStmtNode.py | Amtoniusz/latte | 52498a8b37fd9b0d9fa6e559855f38bc4e0cad9e | [
"MIT"
] | null | null | null | src/lib/WhileStmtNode.py | Amtoniusz/latte | 52498a8b37fd9b0d9fa6e559855f38bc4e0cad9e | [
"MIT"
] | null | null | null | src/lib/WhileStmtNode.py | Amtoniusz/latte | 52498a8b37fd9b0d9fa6e559855f38bc4e0cad9e | [
"MIT"
] | null | null | null | from lib.compileException import compileException
class WhileStmtNode():
def __init__(self, stmt_type=None, expr=None, block=None, line=None ):
self.stmt_type = stmt_type
self.expr = expr
self.block = block
self.line = line
self.return_type = None
def checkType(self, s)... | 29.342857 | 109 | 0.587147 | from lib.compileException import compileException
class WhileStmtNode():
def __init__(self, stmt_type=None, expr=None, block=None, line=None ):
self.stmt_type = stmt_type
self.expr = expr
self.block = block
self.line = line
self.return_type = None
def checkType(self, s)... | true | true |
f7f3b34bfc03085fe4bb99d58ac8686725b5129a | 419 | py | Python | app/documents/migrations/0006_usersubscription_start_date.py | roxtrom13/real-back | b56537665f0d3d65e857e6c30c8710dbbbef9c9b | [
"MIT"
] | null | null | null | app/documents/migrations/0006_usersubscription_start_date.py | roxtrom13/real-back | b56537665f0d3d65e857e6c30c8710dbbbef9c9b | [
"MIT"
] | null | null | null | app/documents/migrations/0006_usersubscription_start_date.py | roxtrom13/real-back | b56537665f0d3d65e857e6c30c8710dbbbef9c9b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-20 23:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0005_auto_20201020_2338'),
]
operations = [
migrations.AddField(
model_name='usersubscription',
name='s... | 22.052632 | 69 | 0.622912 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0005_auto_20201020_2338'),
]
operations = [
migrations.AddField(
model_name='usersubscription',
name='start_date',
field=models.DateTimeFi... | true | true |
f7f3b42d88bbdacfb205a7905b11a32efe32a343 | 1,565 | py | Python | XGB.py | ztultrebor/Kaggle-Santander_Challenge | af5132f986089553a2192183f53ed3b0ec2bcf1b | [
"MIT"
] | 1 | 2019-05-17T19:20:01.000Z | 2019-05-17T19:20:01.000Z | XGB.py | ztultrebor/Kaggle-Santander-Challenge | af5132f986089553a2192183f53ed3b0ec2bcf1b | [
"MIT"
] | null | null | null | XGB.py | ztultrebor/Kaggle-Santander-Challenge | af5132f986089553a2192183f53ed3b0ec2bcf1b | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from GridSearch import GridSearch
import numpy as np
import pandas as pd
import scipy
from xgboost import XGBClassifier
from sklearn.cross_validation import train_test_split
from sklearn.metrics import roc_auc_score
#===================================prep data=======... | 32.604167 | 79 | 0.480511 |
from GridSearch import GridSearch
import numpy as np
import pandas as pd
import scipy
from xgboost import XGBClassifier
from sklearn.cross_validation import train_test_split
from sklearn.metrics import roc_auc_score
np.random.seed(42)
target_col = 'TARGET'
id_col = 'ID'
X_train = pd.read_csv('./Level1Data/Xtra... | true | true |
f7f3b45ce56830886dae0e11aed76fedd45e5292 | 21,719 | py | Python | grr/client/grr_response_client/client_actions/file_finder_utils/globbing_test.py | Onager/grr | 646196bbfb332e4cb546b6d0fe1c09b57c675f7d | [
"Apache-2.0"
] | null | null | null | grr/client/grr_response_client/client_actions/file_finder_utils/globbing_test.py | Onager/grr | 646196bbfb332e4cb546b6d0fe1c09b57c675f7d | [
"Apache-2.0"
] | 1 | 2018-05-08T21:15:51.000Z | 2018-05-08T21:15:51.000Z | grr/client/grr_response_client/client_actions/file_finder_utils/globbing_test.py | Onager/grr | 646196bbfb332e4cb546b6d0fe1c09b57c675f7d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import shutil
import unittest
from grr_response_client.client_actions.file_finder_utils import globbing
from grr.lib import flags
from grr.test_lib import test_lib
# TODO(hanuszczak): Consider refactoring these tests with `pyfakefs`.
class DirHierarchyTestMixin(object):
def setUp(... | 28.206494 | 76 | 0.597864 |
import os
import shutil
import unittest
from grr_response_client.client_actions.file_finder_utils import globbing
from grr.lib import flags
from grr.test_lib import test_lib
class DirHierarchyTestMixin(object):
def setUp(self):
super(DirHierarchyTestMixin, self).setUp()
self.tempdir = test_lib.TempDirP... | true | true |
f7f3b47d5e1c8ec45536ea893a9b6b9dda52ed49 | 754 | py | Python | temperaturafahrenheit.py | MatheusSouza70/Exerc-cios-Python | f8878a0c9d62e49db61dcbce0ee10a161e12a894 | [
"MIT"
] | 1 | 2022-03-14T01:35:09.000Z | 2022-03-14T01:35:09.000Z | temperaturafahrenheit.py | MatheusSouza70/Exerc-cios-Python | f8878a0c9d62e49db61dcbce0ee10a161e12a894 | [
"MIT"
] | null | null | null | temperaturafahrenheit.py | MatheusSouza70/Exerc-cios-Python | f8878a0c9d62e49db61dcbce0ee10a161e12a894 | [
"MIT"
] | null | null | null | check = float(input("Informe um número para converter a temperatura: 1- Celsius para Fahrenheit, 2- Celsius para Kelvin, 3- Fahrenheit para Celsius, 4- Fahrenheit para Kelvin, 5- Kelvin para Celsius, 6- Kelvin para Fahrenheit: "))
temperatura = float(input("Informe o valor a ser convertido: "))
resultado = float
if ... | 34.272727 | 231 | 0.659151 | check = float(input("Informe um número para converter a temperatura: 1- Celsius para Fahrenheit, 2- Celsius para Kelvin, 3- Fahrenheit para Celsius, 4- Fahrenheit para Kelvin, 5- Kelvin para Celsius, 6- Kelvin para Fahrenheit: "))
temperatura = float(input("Informe o valor a ser convertido: "))
resultado = float
if ... | true | true |
f7f3b488542f46d59147d240cef774ef34d05063 | 6,614 | py | Python | bf.py | 1ced/pybf | 011425a80d77f3077d5a607d73d476ff733d8446 | [
"MIT"
] | 1 | 2018-02-01T15:45:29.000Z | 2018-02-01T15:45:29.000Z | bf.py | 1ced/pybf | 011425a80d77f3077d5a607d73d476ff733d8446 | [
"MIT"
] | null | null | null | bf.py | 1ced/pybf | 011425a80d77f3077d5a607d73d476ff733d8446 | [
"MIT"
] | null | null | null |
class bf_core:
def __init__(self):
self.instructions = []
self.ops = {'>':self.inc_dp, '<':self.dec_dp, '+':self.inc_reg, '-':self.dec_reg, '.':self.reg_print, ',':self.reg_store, '[':self.loop_enter, ']':self.loop_end}
self.dp = 0
self.pc = 0
self.reg = [0]
self.maxreg = len(self.reg)
se... | 26.350598 | 164 | 0.461597 |
class bf_core:
def __init__(self):
self.instructions = []
self.ops = {'>':self.inc_dp, '<':self.dec_dp, '+':self.inc_reg, '-':self.dec_reg, '.':self.reg_print, ',':self.reg_store, '[':self.loop_enter, ']':self.loop_end}
self.dp = 0
self.pc = 0
self.reg = [0]
self.maxreg = len(self.reg)
se... | false | true |
f7f3b63910b5361bd8e6bb2b5385408bfbb54cd2 | 1,472 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GenerateDeviceNameListURLRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GenerateDeviceNameListURLRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GenerateDeviceNameListURLRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.736842 | 78 | 0.775136 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkiot.endpoint import endpoint_data
class GenerateDeviceNameListURLRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'GenerateDeviceNameListURL')
self.set_method('POST')
if hasattr(self, "endpoint... | true | true |
f7f3b646e3d5139eb2c346ceede6a232bd35ba76 | 9,615 | py | Python | merge_pieces.py | CatherineH/python-sewing | 01873f6341c7ce8e26d4e61aab9d52a586d667f6 | [
"MIT"
] | 6 | 2019-12-25T20:16:33.000Z | 2021-11-03T22:21:51.000Z | merge_pieces.py | CatherineH/python-sewing | 01873f6341c7ce8e26d4e61aab9d52a586d667f6 | [
"MIT"
] | null | null | null | merge_pieces.py | CatherineH/python-sewing | 01873f6341c7ce8e26d4e61aab9d52a586d667f6 | [
"MIT"
] | null | null | null | from svgpathtools import svg2paths, Path, Line
from svgwrite import Drawing, rgb
import argparse
from math import atan, asin, sin, cos, pi
from numpy import argmin
from utils import calc_overall_bbox
parser = argparse.ArgumentParser(
description='Generate a merged piece from two pieces by stretching the pattern pi... | 46.449275 | 104 | 0.594904 | from svgpathtools import svg2paths, Path, Line
from svgwrite import Drawing, rgb
import argparse
from math import atan, asin, sin, cos, pi
from numpy import argmin
from utils import calc_overall_bbox
parser = argparse.ArgumentParser(
description='Generate a merged piece from two pieces by stretching the pattern pi... | true | true |
f7f3b6fcff7cb52dac3d34e5349eda1515fc79ae | 83,106 | py | Python | viewports/camera.py | furminator/Furminator-MCPE-Tool | 4fe247351503781db2012815c1e40e881d9e1bba | [
"0BSD"
] | null | null | null | viewports/camera.py | furminator/Furminator-MCPE-Tool | 4fe247351503781db2012815c1e40e881d9e1bba | [
"0BSD"
] | null | null | null | viewports/camera.py | furminator/Furminator-MCPE-Tool | 4fe247351503781db2012815c1e40e881d9e1bba | [
"0BSD"
] | null | null | null | # -*- coding: utf_8 -*-
# The above line is necessary, unless we want problems with encodings...
import sys
from compass import CompassOverlay
from raycaster import TooFarException
import raycaster
import keys
import pygame
import math
import copy
import numpy
from config import config
import frustum
import logging
im... | 39.182461 | 251 | 0.557854 |
import sys
from compass import CompassOverlay
from raycaster import TooFarException
import raycaster
import keys
import pygame
import math
import copy
import numpy
from config import config
import frustum
import logging
import glutils
import mceutils
import itertools
import pymclevel
from math import isnan
from dat... | true | true |
f7f3b7ffd7304d7b9139e30893b6a94cfe945480 | 6,550 | py | Python | sdk/core/azure-mgmt-core/tests/test_policies.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-12-10T03:17:51.000Z | 2020-12-10T03:17:51.000Z | sdk/core/azure-mgmt-core/tests/test_policies.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/core/azure-mgmt-core/tests/test_policies.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-07-05T21:13:37.000Z | 2020-07-05T21:13:37.000Z | #--------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to ... | 39.69697 | 98 | 0.616183 |
import json
import time
try:
from unittest import mock
except ImportError:
import mock
import pytest
import requests
import httpretty
from azure.core.pipeline import Pipeline
from azure.core.pipeline.transport import (
HttpRequest,
RequestsTransport,
)
from azure.mgmt.core.p... | true | true |
f7f3b861fce63799bfae760f2dbf9a98215812bf | 10,478 | py | Python | python_modules/dagster/dagster_tests/core_tests/definitions_tests/test_handle.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | 1 | 2019-07-15T17:34:04.000Z | 2019-07-15T17:34:04.000Z | python_modules/dagster/dagster_tests/core_tests/definitions_tests/test_handle.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/definitions_tests/test_handle.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | import imp
import importlib
import os
import types
import pytest
from dagster import (
DagsterInvariantViolationError,
ExecutionTargetHandle,
PipelineDefinition,
RepositoryDefinition,
check,
lambda_solid,
pipeline,
)
from dagster.core.definitions import LoaderEntrypoint
from dagster.core.d... | 35.639456 | 100 | 0.752911 | import imp
import importlib
import os
import types
import pytest
from dagster import (
DagsterInvariantViolationError,
ExecutionTargetHandle,
PipelineDefinition,
RepositoryDefinition,
check,
lambda_solid,
pipeline,
)
from dagster.core.definitions import LoaderEntrypoint
from dagster.core.d... | true | true |
f7f3ba6efd34055c281e7b68a30d5885a38cb970 | 2,041 | py | Python | models/recall/ncf/evaluate.py | ziyoujiyi/PaddleRec | bcddcf46e5cd8d4e6b2c5ee8d0d5521e292a2a81 | [
"Apache-2.0"
] | 2,739 | 2020-04-28T05:12:48.000Z | 2022-03-31T16:01:49.000Z | models/recall/ncf/evaluate.py | jiangcongxu/PaddleRec | 9a107c56af2d1ee282975bcc8edb1ad5fb7e7973 | [
"Apache-2.0"
] | 205 | 2020-05-14T13:29:14.000Z | 2022-03-31T13:01:50.000Z | models/recall/ncf/evaluate.py | jiangcongxu/PaddleRec | 9a107c56af2d1ee282975bcc8edb1ad5fb7e7973 | [
"Apache-2.0"
] | 545 | 2020-05-14T13:19:13.000Z | 2022-03-24T07:53:05.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 29.57971 | 74 | 0.652131 |
import numpy as np
import sklearn
import math
filename = './result.txt'
f = open(filename, "r")
lines = f.readlines()
f.close()
result = []
for line in lines:
if "prediction" in str(line):
result.append(line)
result = result[:-1]
pair = []
for line in result:
line = line.strip().split(","... | true | true |
f7f3bbfe7376f171fe54dc3781959d1e5fd732ce | 6,857 | py | Python | mmdeploy/codebase/mmcls/deploy/classification_model.py | Kayce001/mmdeploy | 59470fef0b28e0b760c72269e0696bbdf57db7f1 | [
"Apache-2.0"
] | 1 | 2022-03-08T12:22:34.000Z | 2022-03-08T12:22:34.000Z | mmdeploy/codebase/mmcls/deploy/classification_model.py | Kayce001/mmdeploy | 59470fef0b28e0b760c72269e0696bbdf57db7f1 | [
"Apache-2.0"
] | null | null | null | mmdeploy/codebase/mmcls/deploy/classification_model.py | Kayce001/mmdeploy | 59470fef0b28e0b760c72269e0696bbdf57db7f1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from typing import List, Sequence, Union
import mmcv
import numpy as np
import torch
from mmcls.datasets import DATASETS
from mmcls.models.classifiers.base import BaseClassifier
from mmcv.utils import Registry
from mmdeploy.codebase.base import BaseBackendModel
from mmd... | 33.778325 | 79 | 0.617763 |
from typing import List, Sequence, Union
import mmcv
import numpy as np
import torch
from mmcls.datasets import DATASETS
from mmcls.models.classifiers.base import BaseClassifier
from mmcv.utils import Registry
from mmdeploy.codebase.base import BaseBackendModel
from mmdeploy.utils import (Backend, get_backend, get_c... | true | true |
f7f3bc31701fc54ea3a0a1bc6918faf435fdbc43 | 1,684 | py | Python | s1_algotools.py | parafeu/USMB-Public | 0073ea97eecd148f3212c67fc2564ee01dfe061e | [
"MIT"
] | null | null | null | s1_algotools.py | parafeu/USMB-Public | 0073ea97eecd148f3212c67fc2564ee01dfe061e | [
"MIT"
] | null | null | null | s1_algotools.py | parafeu/USMB-Public | 0073ea97eecd148f3212c67fc2564ee01dfe061e | [
"MIT"
] | null | null | null | def average_above_zero(tab):
"""
brief: computes the average of the lists
Args:
tab: a list of numeric values, expects at least one positive values
Return:
the computed average
Raises:
ValueError if no positive value is found
"""
if not(isinstance(tab, list)):
... | 25.134328 | 75 | 0.61639 | def average_above_zero(tab):
if not(isinstance(tab, list)):
raise ValueError('Expected a list as input')
average=-99
valSum=0.0
nPositiveValues=0
for val in tab:
if val > 0:
valSum+=float(val)
nPositiveValues+=1
if nPositiveValues <= 0:
raise Va... | true | true |
f7f3bc408866f4c3aa3fc727622abaded05b49fa | 7,130 | py | Python | scripts/build/build/targets.py | Mu-L/connectedhomeip | 563e0e353ff06061c84a14699908865715457856 | [
"Apache-2.0"
] | 3,495 | 2020-07-01T18:09:38.000Z | 2022-03-31T07:08:15.000Z | scripts/build/build/targets.py | Mu-L/connectedhomeip | 563e0e353ff06061c84a14699908865715457856 | [
"Apache-2.0"
] | 11,929 | 2020-07-01T18:23:58.000Z | 2022-03-31T23:58:37.000Z | scripts/build/build/targets.py | Mu-L/connectedhomeip | 563e0e353ff06061c84a14699908865715457856 | [
"Apache-2.0"
] | 832 | 2020-07-01T18:33:16.000Z | 2022-03-31T07:41:55.000Z | # Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 39.392265 | 134 | 0.715288 |
import os
from builders.android import AndroidBoard, AndroidApp, AndroidBuilder
from builders.efr32 import Efr32Builder, Efr32App, Efr32Board
from builders.esp32 import Esp32Builder, Esp32Board, Esp32App
from builders.host import HostBuilder, HostApp, HostBoard
from builders.nrf import NrfApp, NrfBoard, ... | true | true |
f7f3bc8559ccac4d00610abecb49e2598c5dbd7a | 3,084 | py | Python | tests/test_tasks.py | annettekurian/python-taiga | 5d5897fe3be01f06d434d649bc7dd7dc76fe28a1 | [
"MIT"
] | null | null | null | tests/test_tasks.py | annettekurian/python-taiga | 5d5897fe3be01f06d434d649bc7dd7dc76fe28a1 | [
"MIT"
] | 1 | 2018-05-27T11:37:47.000Z | 2018-05-27T11:41:49.000Z | tests/test_tasks.py | annettekurian/python-taiga | 5d5897fe3be01f06d434d649bc7dd7dc76fe28a1 | [
"MIT"
] | null | null | null | import unittest
import six
from mock import patch
from tests.tools import MockResponse, create_mock_json
from taiga.exceptions import TaigaException
from taiga.models import Task, Tasks
from taiga.requestmaker import RequestMaker
if six.PY2:
import_open = '__builtin__.open'
else:
import_open = 'builtins.open... | 36.282353 | 76 | 0.644617 | import unittest
import six
from mock import patch
from tests.tools import MockResponse, create_mock_json
from taiga.exceptions import TaigaException
from taiga.models import Task, Tasks
from taiga.requestmaker import RequestMaker
if six.PY2:
import_open = '__builtin__.open'
else:
import_open = 'builtins.open... | true | true |
f7f3bc8a04d35bd1514192602a898918d84f95fc | 118 | py | Python | check.py | ortegamarinavitancol/OOP-58003 | e4b5ab6b35e738c2f5ca9f21c668887a4a43261b | [
"Apache-2.0"
] | null | null | null | check.py | ortegamarinavitancol/OOP-58003 | e4b5ab6b35e738c2f5ca9f21c668887a4a43261b | [
"Apache-2.0"
] | null | null | null | check.py | ortegamarinavitancol/OOP-58003 | e4b5ab6b35e738c2f5ca9f21c668887a4a43261b | [
"Apache-2.0"
] | null | null | null | import pyodbc
msa_drivers = [x for x in pyodbc.drivers() if 'access']
print(f'MS-ACCESS Drivers: {msa_drivers}')
| 23.6 | 56 | 0.70339 | import pyodbc
msa_drivers = [x for x in pyodbc.drivers() if 'access']
print(f'MS-ACCESS Drivers: {msa_drivers}')
| true | true |
f7f3bd234f46c57f2902c73e9820ed589d7d3dc8 | 8,897 | py | Python | tsai/models/MINIROCKET.py | tcapelle/tsai | 36a2f704abf174515c55115832f08ea2d9753e14 | [
"Apache-2.0"
] | null | null | null | tsai/models/MINIROCKET.py | tcapelle/tsai | 36a2f704abf174515c55115832f08ea2d9753e14 | [
"Apache-2.0"
] | null | null | null | tsai/models/MINIROCKET.py | tcapelle/tsai | 36a2f704abf174515c55115832f08ea2d9753e14 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/111b_models.MINIROCKET.ipynb (unless otherwise specified).
__all__ = ['MiniRocketClassifier', 'load_minirocket', 'MiniRocketRegressor', 'load_minirocket',
'MiniRocketVotingClassifier', 'get_minirocket_preds', 'MiniRocketVotingRegressor']
# Cell
import sklearn... | 49.703911 | 150 | 0.639541 |
__all__ = ['MiniRocketClassifier', 'load_minirocket', 'MiniRocketRegressor', 'load_minirocket',
'MiniRocketVotingClassifier', 'get_minirocket_preds', 'MiniRocketVotingRegressor']
import sklearn
from sklearn.metrics import make_scorer
from sklearn.linear_model import RidgeCV, RidgeClassifierCV
from sklear... | true | true |
f7f3bd7bc64f47fc392a3eb225a52422ba8d7766 | 2,583 | py | Python | tests/unit/test_scikitlearn.py | learsi1911/GAMA_pygmo_v4 | 459807db352dd1c9f9c1e0e322f8c1e9b5abbca0 | [
"Apache-2.0"
] | 49 | 2018-10-22T06:05:29.000Z | 2021-09-07T20:12:36.000Z | tests/unit/test_scikitlearn.py | learsi1911/GAMA_pygmo_v4 | 459807db352dd1c9f9c1e0e322f8c1e9b5abbca0 | [
"Apache-2.0"
] | 102 | 2018-10-02T12:00:47.000Z | 2021-02-24T14:35:30.000Z | tests/unit/test_scikitlearn.py | learsi1911/GAMA_pygmo_v4 | 459807db352dd1c9f9c1e0e322f8c1e9b5abbca0 | [
"Apache-2.0"
] | 11 | 2021-06-04T11:56:19.000Z | 2022-03-21T20:21:15.000Z | import pandas as pd
from sklearn.datasets import load_iris
from gama.genetic_programming.compilers.scikitlearn import (
evaluate_individual,
compile_individual,
evaluate_pipeline,
)
from gama.utilities.metrics import Metric, scoring_to_metric
def test_evaluate_individual(SS_BNB):
import datetime
... | 33.986842 | 86 | 0.72048 | import pandas as pd
from sklearn.datasets import load_iris
from gama.genetic_programming.compilers.scikitlearn import (
evaluate_individual,
compile_individual,
evaluate_pipeline,
)
from gama.utilities.metrics import Metric, scoring_to_metric
def test_evaluate_individual(SS_BNB):
import datetime
... | true | true |
f7f3bd9b36edf4516301cb5d5662e2c345e63664 | 24,728 | py | Python | tests/tests.py | ekohl/pycares | f718c3b79b5acfaf1e7e29170ecf3cb83e9956c5 | [
"MIT"
] | 1 | 2021-02-28T15:51:38.000Z | 2021-02-28T15:51:38.000Z | tests/tests.py | ekohl/pycares | f718c3b79b5acfaf1e7e29170ecf3cb83e9956c5 | [
"MIT"
] | null | null | null | tests/tests.py | ekohl/pycares | f718c3b79b5acfaf1e7e29170ecf3cb83e9956c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import ipaddress
import os
import select
import socket
import sys
import unittest
import pycares
FIXTURES_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), 'fixtures'))
class DNSTest(unittest.TestCase):
def setUp(self):
self.channel = pycares.Channel(timeout=5.0, tr... | 43.230769 | 464 | 0.641014 |
import ipaddress
import os
import select
import socket
import sys
import unittest
import pycares
FIXTURES_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), 'fixtures'))
class DNSTest(unittest.TestCase):
def setUp(self):
self.channel = pycares.Channel(timeout=5.0, tries=1)
def tearD... | true | true |
f7f3bdfbb6db7522bcca88faaa1d4817f66f6309 | 2,323 | py | Python | src/terminal/screen.py | gvb84/term-emu | ef38abb0d45f0368666112642114a24ad2bb15ad | [
"BSD-3-Clause"
] | 5 | 2019-04-17T19:17:59.000Z | 2021-02-17T08:36:28.000Z | src/terminal/screen.py | gvb84/term-emu | ef38abb0d45f0368666112642114a24ad2bb15ad | [
"BSD-3-Clause"
] | null | null | null | src/terminal/screen.py | gvb84/term-emu | ef38abb0d45f0368666112642114a24ad2bb15ad | [
"BSD-3-Clause"
] | 6 | 2018-12-16T23:38:52.000Z | 2021-07-02T10:56:17.000Z | import array
from . import rendition
class Screen:
def __init__(self, rows, cols):
self.reset(rows, cols)
def reset(self, rows, cols):
self.cols = cols
self.rows = rows
self.cells = []
self.gfx = []
self.empty_line = array.array("u", u" "*cols)
self.empty_gfx = array.array("I", [0]*cols)
for i i... | 32.263889 | 113 | 0.663366 | import array
from . import rendition
class Screen:
def __init__(self, rows, cols):
self.reset(rows, cols)
def reset(self, rows, cols):
self.cols = cols
self.rows = rows
self.cells = []
self.gfx = []
self.empty_line = array.array("u", u" "*cols)
self.empty_gfx = array.array("I", [0]*cols)
for i i... | true | true |
f7f3be34032d441b53ccb341f8ddb4fff0a81a3d | 1,201 | py | Python | algorithms/middleCharacter.py | CAMIRO/PythonBasicAlgorithms | bc4878bb4447df394a0df4e280192c712d900da9 | [
"MIT"
] | null | null | null | algorithms/middleCharacter.py | CAMIRO/PythonBasicAlgorithms | bc4878bb4447df394a0df4e280192c712d900da9 | [
"MIT"
] | null | null | null | algorithms/middleCharacter.py | CAMIRO/PythonBasicAlgorithms | bc4878bb4447df394a0df4e280192c712d900da9 | [
"MIT"
] | null | null | null | # Get the Middle Character:
# You are going to be given a word. Your job is to return the middle character of the word.
# If the word's length is odd, return the middle character.
# If the word's length is even, return the middle 2 characters.
#Examples:
# Kata.getMiddle("test") should return "es"
# Kata.getMiddle("t... | 31.605263 | 92 | 0.666112 |
# If the word's length is even, return the middle 2 characters.
def get_middle(s):
is_even = False
if len(s) % 2 == 0:
is_even = True
# Calculating the middle position and middle charater(s)
middle_position = (0 + len(s)) // 2
middle_charater = s[middle_position]
middle_cha... | true | true |
f7f3be36e5e7b7a849d2f19a86d81d1da40ef925 | 2,256 | py | Python | theapplication/forms.py | uncommonhacks/reg | 0906bc293899eae6e2b3637a99761703444175af | [
"MIT"
] | null | null | null | theapplication/forms.py | uncommonhacks/reg | 0906bc293899eae6e2b3637a99761703444175af | [
"MIT"
] | 23 | 2018-09-06T14:26:37.000Z | 2020-06-05T19:10:38.000Z | theapplication/forms.py | uncommonhacks/reg | 0906bc293899eae6e2b3637a99761703444175af | [
"MIT"
] | null | null | null | from django import forms
from .models import Application, Confirmation
class ApplicationForm(forms.ModelForm):
first_name = forms.CharField(max_length=100, label="First Name")
last_name = forms.CharField(
max_length=100, label="Last Name", initial="", required=False
)
resume = forms.FileField(... | 31.333333 | 93 | 0.555408 | from django import forms
from .models import Application, Confirmation
class ApplicationForm(forms.ModelForm):
first_name = forms.CharField(max_length=100, label="First Name")
last_name = forms.CharField(
max_length=100, label="Last Name", initial="", required=False
)
resume = forms.FileField(... | true | true |
f7f3c06afaa477d5537fc405ae8709b13efb6079 | 2,248 | py | Python | setup.py | PlasmaFAIR/fortls | 80fdaa537838b56ead2b11ebd7559537e0a2c5c7 | [
"MIT"
] | null | null | null | setup.py | PlasmaFAIR/fortls | 80fdaa537838b56ead2b11ebd7559537e0a2c5c7 | [
"MIT"
] | null | null | null | setup.py | PlasmaFAIR/fortls | 80fdaa537838b56ead2b11ebd7559537e0a2c5c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Builds the Fortran Language Server - dev
"""
import pathlib
from setuptools import find_packages, setup
from fortls import __version__
# The directory containing this file
HERE = pathlib.Path(__file__).resolve().parent
# The text of the README file is used as a description
README = (HERE /... | 34.584615 | 90 | 0.650356 |
import pathlib
from setuptools import find_packages, setup
from fortls import __version__
HERE = pathlib.Path(__file__).resolve().parent
README = (HERE / "README.md").read_text()
NAME = "fortls"
setup(
name=NAME,
version=__version__,
url="https://github.com/gnikit/fortran-language-server",
aut... | true | true |
f7f3c123e81f7b48d6e01bd893cbd946448c5788 | 5,992 | py | Python | meow/webs/router.py | aachurin/meow.webs | b3acb92234ba64f40bc7a7947ca2216544ae116a | [
"MIT"
] | null | null | null | meow/webs/router.py | aachurin/meow.webs | b3acb92234ba64f40bc7a7947ca2216544ae116a | [
"MIT"
] | null | null | null | meow/webs/router.py | aachurin/meow.webs | b3acb92234ba64f40bc7a7947ca2216544ae116a | [
"MIT"
] | null | null | null | import inspect
import re
import uuid
import typing
import werkzeug
import types
from werkzeug.routing import Map, Rule
from urllib.parse import urlparse
from .utils import import_string
from . import exceptions
Handler = typing.Union[str, typing.Callable[..., typing.Any]]
class Route:
name: str
def __init_... | 34.436782 | 88 | 0.554239 | import inspect
import re
import uuid
import typing
import werkzeug
import types
from werkzeug.routing import Map, Rule
from urllib.parse import urlparse
from .utils import import_string
from . import exceptions
Handler = typing.Union[str, typing.Callable[..., typing.Any]]
class Route:
name: str
def __init_... | true | true |
f7f3c1c674a240f7307123be97a057c4ef401586 | 4,032 | py | Python | demo/app.py | Pandinosaurus/doctr | 3d645ce7d3d4fe36aa53537d4e4f92507f6cd422 | [
"Apache-2.0"
] | 2 | 2021-12-17T03:36:56.000Z | 2022-01-31T06:21:55.000Z | demo/app.py | Pandinosaurus/doctr | 3d645ce7d3d4fe36aa53537d4e4f92507f6cd422 | [
"Apache-2.0"
] | 1 | 2022-02-10T19:50:56.000Z | 2022-02-10T19:50:56.000Z | demo/app.py | Pandinosaurus/doctr | 3d645ce7d3d4fe36aa53537d4e4f92507f6cd422 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021-2022, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import os
import matplotlib.pyplot as plt
import streamlit as st
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import cv2
i... | 35.368421 | 103 | 0.621528 |
import os
import matplotlib.pyplot as plt
import streamlit as st
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import cv2
import tensorflow as tf
gpu_devices = tf.config.experimental.list_physical_devices('GPU')
if any(gpu_devices):
tf.config.experimental.set_memory_growth(gpu_devices[0], True)
from doctr.io i... | true | true |
f7f3c1e9dfd0b5d9c7dad89e7bfd4d0af8294ef4 | 1,005 | py | Python | backend/sellers/factories.py | waterunder/dashboard | 3790537ce29f83d631e0c14c12fff77515759e5b | [
"MIT"
] | null | null | null | backend/sellers/factories.py | waterunder/dashboard | 3790537ce29f83d631e0c14c12fff77515759e5b | [
"MIT"
] | 75 | 2020-08-17T15:22:42.000Z | 2021-12-09T09:11:37.000Z | backend/sellers/factories.py | waterunder/dashboard | 3790537ce29f83d631e0c14c12fff77515759e5b | [
"MIT"
] | null | null | null | from random import choice
import factory
from django.contrib.auth import get_user_model
from sellers.models import Seller
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = get_user_model()
first_name = factory.Faker('first_name')
last_name = factory.Faker('last_name')
... | 28.714286 | 55 | 0.695522 | from random import choice
import factory
from django.contrib.auth import get_user_model
from sellers.models import Seller
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = get_user_model()
first_name = factory.Faker('first_name')
last_name = factory.Faker('last_name')
... | true | true |
f7f3c315716f6b4599ddf8a4aac0157173a40754 | 387 | py | Python | authlib/jose/rfc7516/__init__.py | YPCrumble/authlib | 782a0fced780849418dc2a869528d10387e24b65 | [
"BSD-3-Clause"
] | 1 | 2021-06-30T09:11:40.000Z | 2021-06-30T09:11:40.000Z | authlib/jose/rfc7516/__init__.py | YPCrumble/authlib | 782a0fced780849418dc2a869528d10387e24b65 | [
"BSD-3-Clause"
] | 10 | 2020-09-30T05:41:05.000Z | 2021-11-03T08:55:31.000Z | authlib/jose/rfc7516/__init__.py | YPCrumble/authlib | 782a0fced780849418dc2a869528d10387e24b65 | [
"BSD-3-Clause"
] | 2 | 2021-05-24T20:34:12.000Z | 2022-03-26T07:46:17.000Z | """
authlib.jose.rfc7516
~~~~~~~~~~~~~~~~~~~~~
This module represents a direct implementation of
JSON Web Encryption (JWE).
https://tools.ietf.org/html/rfc7516
"""
from .jwe import JsonWebEncryption
from .models import JWEAlgorithm, JWEEncAlgorithm, JWEZipAlgorithm
__all__ = [
'JsonWebEncry... | 20.368421 | 66 | 0.679587 |
from .jwe import JsonWebEncryption
from .models import JWEAlgorithm, JWEEncAlgorithm, JWEZipAlgorithm
__all__ = [
'JsonWebEncryption',
'JWEAlgorithm', 'JWEEncAlgorithm', 'JWEZipAlgorithm'
]
| true | true |
f7f3c4fda7e2f137835a368bfc317de8bc7a9cee | 170 | py | Python | suma.py | financieras/coder | aecf02d6828d3a0c4d1c2b7cd935ed42545031b8 | [
"MIT"
] | null | null | null | suma.py | financieras/coder | aecf02d6828d3a0c4d1c2b7cd935ed42545031b8 | [
"MIT"
] | null | null | null | suma.py | financieras/coder | aecf02d6828d3a0c4d1c2b7cd935ed42545031b8 | [
"MIT"
] | null | null | null | import sys
nombre = sys.argv[0]
valor1 = sys.argv[1]
valor2 = sys.argv[2]
# para ejecutar tecleamos en la terminal:
# python3 suma.py 2 3
print(int(valor1) + int(valor2)) | 24.285714 | 41 | 0.717647 | import sys
nombre = sys.argv[0]
valor1 = sys.argv[1]
valor2 = sys.argv[2]
print(int(valor1) + int(valor2)) | true | true |
f7f3c51e1d76795362979db58ffe977b9d1f6306 | 10,296 | py | Python | clipper-parm/clipper_admin/clipper_admin/deployers/python.py | mukkachaitanya/parity-models | 9f336a67798934d29592aca471dff6ad047473f6 | [
"Apache-2.0"
] | 32 | 2019-09-11T16:49:58.000Z | 2022-01-26T15:40:40.000Z | clipper-parm/clipper_admin/clipper_admin/deployers/python.py | mukkachaitanya/parity-models | 9f336a67798934d29592aca471dff6ad047473f6 | [
"Apache-2.0"
] | 5 | 2019-11-10T16:13:40.000Z | 2022-01-13T01:31:51.000Z | clipper-parm/clipper_admin/clipper_admin/deployers/python.py | mukkachaitanya/parity-models | 9f336a67798934d29592aca471dff6ad047473f6 | [
"Apache-2.0"
] | 9 | 2019-09-03T14:05:26.000Z | 2021-12-22T07:17:27.000Z | from __future__ import print_function, with_statement, absolute_import
import sys
import logging
import os
import posixpath
import shutil
from ..version import __version__
from ..exceptions import ClipperException
from .deployer_utils import save_python_function
logger = logging.getLogger(__name__)
def create_endp... | 48.11215 | 96 | 0.657828 | from __future__ import print_function, with_statement, absolute_import
import sys
import logging
import os
import posixpath
import shutil
from ..version import __version__
from ..exceptions import ClipperException
from .deployer_utils import save_python_function
logger = logging.getLogger(__name__)
def create_endp... | true | true |
f7f3c9afbc832eaecd8a888f3c5677b2ba9d8a9b | 744 | py | Python | craynn/subnetworks/column_nets.py | maxim-borisyak/craynn | fceabd33f5969033fb3605f894778c42c42f3e08 | [
"MIT"
] | null | null | null | craynn/subnetworks/column_nets.py | maxim-borisyak/craynn | fceabd33f5969033fb3605f894778c42c42f3e08 | [
"MIT"
] | null | null | null | craynn/subnetworks/column_nets.py | maxim-borisyak/craynn | fceabd33f5969033fb3605f894778c42c42f3e08 | [
"MIT"
] | null | null | null | from ..layers import *
__all__ = [
'column_module', 'column'
]
def _column_module(incoming, ops, factor_pool_op=channel_factor_pool(2), merge_op=elementwise_mean()):
return merge_op([
op(factor_pool_op(incoming))
for op in ops
])
column_module = lambda ops, factor_pool_op=channel_factor_pool(2), merge_... | 33.818182 | 169 | 0.767473 | from ..layers import *
__all__ = [
'column_module', 'column'
]
def _column_module(incoming, ops, factor_pool_op=channel_factor_pool(2), merge_op=elementwise_mean()):
return merge_op([
op(factor_pool_op(incoming))
for op in ops
])
column_module = lambda ops, factor_pool_op=channel_factor_pool(2), merge_... | true | true |
f7f3c9e805a683fb46959bde6a22615f682c5974 | 2,873 | py | Python | test/test_transform.py | sthagen/martinmcbride-generativepy | 0467f2c5d91c71f797304efcb763761fbd0f9162 | [
"MIT"
] | null | null | null | test/test_transform.py | sthagen/martinmcbride-generativepy | 0467f2c5d91c71f797304efcb763761fbd0f9162 | [
"MIT"
] | null | null | null | test/test_transform.py | sthagen/martinmcbride-generativepy | 0467f2c5d91c71f797304efcb763761fbd0f9162 | [
"MIT"
] | null | null | null | import unittest
import cairo
from generativepy.geometry import Transform
class TestTransform(unittest.TestCase):
def test_scale(self):
surface = cairo.ImageSurface(cairo.FORMAT_RGB24, 100, 200)
ctx = cairo.Context(surface)
with Transform(ctx).scale(2, 3):
self.assertEqual([2, ... | 39.902778 | 97 | 0.573964 | import unittest
import cairo
from generativepy.geometry import Transform
class TestTransform(unittest.TestCase):
def test_scale(self):
surface = cairo.ImageSurface(cairo.FORMAT_RGB24, 100, 200)
ctx = cairo.Context(surface)
with Transform(ctx).scale(2, 3):
self.assertEqual([2, ... | true | true |
f7f3cb4be54c13afff59c89da0f12480789914db | 21 | py | Python | portfolio/Python/scrapy/tal/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/tal/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/tal/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | ACCOUNT_NAME = 'Tal'
| 10.5 | 20 | 0.714286 | ACCOUNT_NAME = 'Tal'
| true | true |
f7f3cbfd79e72c5910d522c84cbed629b5a39039 | 3,050 | py | Python | _data/augments/soul.py | Eurydia/pso2ngs-augment-planner | 096e0d1d5d0b96b9720abe41ca76649df3264ca2 | [
"MIT"
] | null | null | null | _data/augments/soul.py | Eurydia/pso2ngs-augment-planner | 096e0d1d5d0b96b9720abe41ca76649df3264ca2 | [
"MIT"
] | null | null | null | _data/augments/soul.py | Eurydia/pso2ngs-augment-planner | 096e0d1d5d0b96b9720abe41ca76649df3264ca2 | [
"MIT"
] | null | null | null | from typing import List
from ._augment import Augment
from ._augment_groups import AugmentGroups
from effect import *
from effect import EffectTypes as ET
from util import many_effs_with_same_many_amounts
GROUP = AugmentGroups.SOUL
CONFLICT = (GROUP,)
augments: List[Augment] = []
# ---------------------------------... | 26.293103 | 87 | 0.397049 | from typing import List
from ._augment import Augment
from ._augment_groups import AugmentGroups
from effect import *
from effect import EffectTypes as ET
from util import many_effs_with_same_many_amounts
GROUP = AugmentGroups.SOUL
CONFLICT = (GROUP,)
augments: List[Augment] = []
augments.extend(
Augment.from_... | true | true |
f7f3cc066e10995e3a83e32e11d741374a4b0268 | 16,996 | py | Python | ticketsplease/ticketsplease/modules/saml/ADFSpoof.py | secureworks/whiskeysamlandfriends | 9334d0959aef64c06a716a5ed2e4f5582ab44a26 | [
"Apache-2.0"
] | 30 | 2021-11-10T16:28:34.000Z | 2022-03-03T19:46:21.000Z | ticketsplease/ticketsplease/modules/saml/ADFSpoof.py | secureworks/whiskeysamlandfriends | 9334d0959aef64c06a716a5ed2e4f5582ab44a26 | [
"Apache-2.0"
] | null | null | null | ticketsplease/ticketsplease/modules/saml/ADFSpoof.py | secureworks/whiskeysamlandfriends | 9334d0959aef64c06a716a5ed2e4f5582ab44a26 | [
"Apache-2.0"
] | 4 | 2021-11-11T19:29:11.000Z | 2021-11-15T15:56:57.000Z | # Copyright 2021 FireEye
#
# 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... | 55.907895 | 3,268 | 0.709285 |
import re
import struct
import random
import string
import base64
import logging
from lxml import etree
from signxml import XMLSigner
from datetime import datetime, timedelta
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, hmac
fro... | true | true |
f7f3ccb0fb35efa2e03b25f56292cf0116f49a4f | 13,102 | py | Python | electrum/plugins/trustedcoin/qt.py | ProjectMerge/electrum-merge | 9a77ca74fec434ccdc862aeb82093f90e96cb550 | [
"MIT"
] | null | null | null | electrum/plugins/trustedcoin/qt.py | ProjectMerge/electrum-merge | 9a77ca74fec434ccdc862aeb82093f90e96cb550 | [
"MIT"
] | null | null | null | electrum/plugins/trustedcoin/qt.py | ProjectMerge/electrum-merge | 9a77ca74fec434ccdc862aeb82093f90e96cb550 | [
"MIT"
] | 1 | 2020-12-18T17:13:10.000Z | 2020-12-18T17:13:10.000Z | #!/usr/bin/env python
#
# Electrum - Lightweight Merge Client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without l... | 40.689441 | 236 | 0.625706 |
from functools import partial
import threading
import sys
import os
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import (QTextEdit, QVBoxLayout, QLabel, QGridLayout, QHBoxLayout,
QRadioButton, QCheckBox, QLineEdi... | true | true |
f7f3ccd8067db124035ca6cba4dca3bd678afe35 | 3,097 | py | Python | rl_examples/approximate_td.py | apuranik1/rl-examples | af807bd9311e056e8690ee4bc5abbc63a91381e9 | [
"MIT"
] | null | null | null | rl_examples/approximate_td.py | apuranik1/rl-examples | af807bd9311e056e8690ee4bc5abbc63a91381e9 | [
"MIT"
] | null | null | null | rl_examples/approximate_td.py | apuranik1/rl-examples | af807bd9311e056e8690ee4bc5abbc63a91381e9 | [
"MIT"
] | null | null | null | from typing import Deque, Tuple
from collections import deque
import numpy as np
from .psfa import PSFAAgent, PSFAEnvironment, TState, TAction
from .approximation import TrainableEstimator, Featurizer
class ApproximationTDNAgent(PSFAAgent[TState, TAction]):
"""A bootstrapping agent using n-step SARSA"""
de... | 39.705128 | 87 | 0.648046 | from typing import Deque, Tuple
from collections import deque
import numpy as np
from .psfa import PSFAAgent, PSFAEnvironment, TState, TAction
from .approximation import TrainableEstimator, Featurizer
class ApproximationTDNAgent(PSFAAgent[TState, TAction]):
def __init__(
self,
env: PSFAEnvironm... | true | true |
f7f3ccd81b07a0d320645f886926b6edbbf771e4 | 514 | py | Python | airbyte-integrations/connectors/source-twilio/source_twilio/auth.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 6,215 | 2020-09-21T13:45:56.000Z | 2022-03-31T21:21:45.000Z | airbyte-integrations/connectors/source-twilio/source_twilio/auth.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 8,448 | 2020-09-21T00:43:50.000Z | 2022-03-31T23:56:06.000Z | airbyte-integrations/connectors/source-twilio/source_twilio/auth.py | OTRI-Unipd/OTRI-airbyte | 50eeeb773f75246e86c6e167b0cd7d2dda6efe0d | [
"MIT"
] | 1,251 | 2020-09-20T05:48:47.000Z | 2022-03-31T10:41:29.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import base64
from typing import Tuple
from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator
class HttpBasicAuthenticator(TokenAuthenticator):
def __init__(self, auth: Tuple[str, str], auth_method: str = "Basic", **kwargs):
auth... | 32.125 | 84 | 0.72179 |
import base64
from typing import Tuple
from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator
class HttpBasicAuthenticator(TokenAuthenticator):
def __init__(self, auth: Tuple[str, str], auth_method: str = "Basic", **kwargs):
auth_string = f"{auth[0]}:{auth[1]}".encode("utf8")
b6... | true | true |
f7f3cec3632a7a80afd3b01db0e6cff1496f253b | 1,968 | py | Python | checks/check_perspective_transform.py | dukebw/imgaug | eba6eef5808704926edce97de39af23cab18cb7f | [
"MIT"
] | null | null | null | checks/check_perspective_transform.py | dukebw/imgaug | eba6eef5808704926edce97de39af23cab18cb7f | [
"MIT"
] | null | null | null | checks/check_perspective_transform.py | dukebw/imgaug | eba6eef5808704926edce97de39af23cab18cb7f | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.data.quokka(size=0.5)
kps = [
ia.KeypointsOnImage(
[
ia.Keypoint(x=245, y=203),
ia.Keypoint(x=365, y=195),
... | 30.276923 | 82 | 0.54624 | from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.data.quokka(size=0.5)
kps = [
ia.KeypointsOnImage(
[
ia.Keypoint(x=245, y=203),
ia.Keypoint(x=365, y=195),
... | true | true |
f7f3cee8ab988538c1a20259a6e9102f31b17e83 | 21,373 | py | Python | upnp_inspector/devices.py | coherence-project/UPnP-Inspector | 636893cdc42d074b55045fc389222fdc28348620 | [
"MIT"
] | 42 | 2015-02-17T13:51:29.000Z | 2021-08-23T09:56:58.000Z | upnp_inspector/devices.py | coherence-project/UPnP-Inspector | 636893cdc42d074b55045fc389222fdc28348620 | [
"MIT"
] | 5 | 2015-06-17T00:02:55.000Z | 2018-02-18T09:38:10.000Z | upnp_inspector/devices.py | coherence-project/UPnP-Inspector | 636893cdc42d074b55045fc389222fdc28348620 | [
"MIT"
] | 14 | 2015-02-12T21:31:55.000Z | 2019-12-05T05:35:16.000Z | # -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2009 - Frank Scholz <coherence@beebits.net>
# Copyright 2014 - Hartmut Goebel <h.goebel@crazy-compilers.com>
import time
import pygtk
pygtk.require("2.0")
import gtk
from twisted.internet import re... | 41.744141 | 124 | 0.528564 |
import time
import pygtk
pygtk.require("2.0")
import gtk
from twisted.internet import reactor
from coherence.base import Coherence
from coherence.upnp.core.utils import means_true
from coherence import log
from ._resources import _geticon
TYPE_COLUMN = 0
NAME_COLUMN = 1
UDN_COLUMN = 2
ICON_COLUMN = 3
OBJ... | false | true |
f7f3cf93bb85becd454a77bed907b02edd6cbd5c | 2,499 | py | Python | userbot/modules/ocr.py | jefa2231/jefanyastore | d66cc8d85a4b6a177905ba3b22cc10e9ea02607b | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/ocr.py | jefa2231/jefanyastore | d66cc8d85a4b6a177905ba3b22cc10e9ea02607b | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/ocr.py | jefa2231/jefanyastore | d66cc8d85a4b6a177905ba3b22cc10e9ea02607b | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
from telethon import events
import os
import requests
import logging
from userbot import bot, OCR_SPACE_API_KEY, CMD_HEL... | 34.708333 | 99 | 0.659064 |
from telethon import events
import os
import requests
import logging
from userbot import bot, OCR_SPACE_API_KEY, CMD_HELP, TEMP_DOWNLOAD_DIRECTORY
from userbot.events import register
async def ocr_space_file(
filename, overlay=False, api_key=OCR_SPACE_API_KEY, language="eng"
):
payload = {
"isOv... | true | true |
f7f3d031aa2a48c48cb2e54de6f495bb2f8f94e0 | 4,128 | py | Python | froi/gui/component/clusterstatsdialog.py | zhouguangfu/FreeROI | 0605c2a0fe2457e3703a4a7548299fc2c1e9aca0 | [
"BSD-3-Clause"
] | null | null | null | froi/gui/component/clusterstatsdialog.py | zhouguangfu/FreeROI | 0605c2a0fe2457e3703a4a7548299fc2c1e9aca0 | [
"BSD-3-Clause"
] | null | null | null | froi/gui/component/clusterstatsdialog.py | zhouguangfu/FreeROI | 0605c2a0fe2457e3703a4a7548299fc2c1e9aca0 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from froi.io import csv
class ClusterStatsDialog(QDialog):
"""A dialog for reporting cluster stats."""
def __init__(self, cluster_info, paren... | 36.530973 | 73 | 0.61749 |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from froi.io import csv
class ClusterStatsDialog(QDialog):
def __init__(self, cluster_info, parent=None):
super(ClusterStatsDialog, self).__init__(parent)
self._cluster_info = cluster_info
self.setWindowModality(Qt.NonModal)
... | true | true |
f7f3d1cc0bcaf0855bcc3733b5b790d0f5ab37c6 | 15,745 | py | Python | python/ccxt/async_support/__init__.py | inuitwallet/ccxt | 0533982cfe5a28d16eb0c12d12aa722cd4d9f841 | [
"MIT"
] | null | null | null | python/ccxt/async_support/__init__.py | inuitwallet/ccxt | 0533982cfe5a28d16eb0c12d12aa722cd4d9f841 | [
"MIT"
] | null | null | null | python/ccxt/async_support/__init__.py | inuitwallet/ccxt | 0533982cfe5a28d16eb0c12d12aa722cd4d9f841 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""CCXT: CryptoCurrency eXchange Trading Library (Async)"""
# -----------------------------------------------------------------------------
__version__ = '1.32.64'
# -----------------------------------------------------------------------------
from ccxt.async_support.base.exchange import Ex... | 50.790323 | 86 | 0.557574 |
__version__ = '1.32.64'
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.decimal_to_precision import decimal_to_precision
from ccxt.base.decimal_to_precision import TRUNCATE
from ccxt.base.decimal_to_precision import ROUND
from ccxt.base.d... | true | true |
f7f3d36dcda8df9b31be28c1918c0750cf89e48f | 4,916 | py | Python | cbow/cbow/trainer.py | sudarshan85/nlpbook | 41e59d706fb31f5185a0133789639ccffbddb41f | [
"Apache-2.0"
] | null | null | null | cbow/cbow/trainer.py | sudarshan85/nlpbook | 41e59d706fb31f5185a0133789639ccffbddb41f | [
"Apache-2.0"
] | null | null | null | cbow/cbow/trainer.py | sudarshan85/nlpbook | 41e59d706fb31f5185a0133789639ccffbddb41f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import csv
import datetime
from argparse import Namespace
from pathlib import Path
from ignite.engine import Events, create_supervised_trainer, create_supervised_evaluator
from ignite.metrics import RunningAverage
from ignite.handlers import EarlyStopping, ModelCheckpoint, Timer
from ignite.cont... | 39.645161 | 104 | 0.740643 |
import csv
import datetime
from argparse import Namespace
from pathlib import Path
from ignite.engine import Events, create_supervised_trainer, create_supervised_evaluator
from ignite.metrics import RunningAverage
from ignite.handlers import EarlyStopping, ModelCheckpoint, Timer
from ignite.contrib.handlers import P... | true | true |
f7f3d3cfd0e9b9e7bd91643e6e6b4f3125b28030 | 5,503 | py | Python | dizzy/probe/tcp.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T10:11:43.000Z | 2020-11-19T10:11:43.000Z | dizzy/probe/tcp.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | null | null | null | dizzy/probe/tcp.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T10:12:18.000Z | 2020-11-19T10:12:18.000Z | # tcp.py
#
# Copyright 2017 Daniel Mende <mail@c0decafe.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# ... | 45.479339 | 108 | 0.6004 |
from . import ProbeParseException, ProbeException
from dizzy.log import print_dizzy, VERBOSE_1, DEBUG
from dizzy.tools import check_root
from socket import inet_aton, inet_pton, AF_INET, AF_INET6, socket, SOCK_STREAM, SOL_SOCKET, SO_BROADCAST, \
SO_REUSEADDR, SHUT_RDWR
from binascii im... | true | true |
f7f3d412c81c4c6d540c965bb32ac2162516fe07 | 5,120 | py | Python | posthog/api/test/test_property_definition.py | FarazPatankar/posthog | dddf2644376d0fd6836ed96c139f6a825c74202f | [
"MIT"
] | 1 | 2020-07-20T17:32:05.000Z | 2020-07-20T17:32:05.000Z | posthog/api/test/test_property_definition.py | FarazPatankar/posthog | dddf2644376d0fd6836ed96c139f6a825c74202f | [
"MIT"
] | null | null | null | posthog/api/test/test_property_definition.py | FarazPatankar/posthog | dddf2644376d0fd6836ed96c139f6a825c74202f | [
"MIT"
] | null | null | null | import random
from typing import Dict
from rest_framework import status
from posthog.demo import create_demo_team
from posthog.models import Organization, PropertyDefinition, Team
from posthog.tasks.calculate_event_property_usage import calculate_event_property_usage_for_team
from posthog.test.base import APIBaseTest... | 50.693069 | 118 | 0.680664 | import random
from typing import Dict
from rest_framework import status
from posthog.demo import create_demo_team
from posthog.models import Organization, PropertyDefinition, Team
from posthog.tasks.calculate_event_property_usage import calculate_event_property_usage_for_team
from posthog.test.base import APIBaseTest... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.