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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73b17d7a70bc3173587b91403758bdf09bcb35b | 236 | py | Python | Session3-Conditional-Statements-part2/02_weekend_or_work_day.py | elenaborisova/Crack-the-Code | d0b505ebad878d5228d98c934779ed9b28f6c034 | [
"MIT"
] | null | null | null | Session3-Conditional-Statements-part2/02_weekend_or_work_day.py | elenaborisova/Crack-the-Code | d0b505ebad878d5228d98c934779ed9b28f6c034 | [
"MIT"
] | null | null | null | Session3-Conditional-Statements-part2/02_weekend_or_work_day.py | elenaborisova/Crack-the-Code | d0b505ebad878d5228d98c934779ed9b28f6c034 | [
"MIT"
] | 1 | 2021-05-31T14:47:53.000Z | 2021-05-31T14:47:53.000Z | day = input()
if day == "Monday" or day == "Tuesday" or day == "Wednesday" or day == "Thursday" or day == "Friday":
print("Work day")
elif day == "Saturday" or day == "Sunday":
print("Weekend")
else:
print("Error")
| 26.222222 | 102 | 0.563559 | day = input()
if day == "Monday" or day == "Tuesday" or day == "Wednesday" or day == "Thursday" or day == "Friday":
print("Work day")
elif day == "Saturday" or day == "Sunday":
print("Weekend")
else:
print("Error")
| true | true |
f73b1866e507c7db610e0f505647e42453e96a22 | 20,672 | py | Python | nbdt/utils.py | lisadunlap/explainable-nbdt | e045bfd0b55b21fd87c9a233b73a0ca77672efff | [
"MIT"
] | 1 | 2021-08-28T20:17:50.000Z | 2021-08-28T20:17:50.000Z | nbdt/utils.py | lisadunlap/explainable-nbdt | e045bfd0b55b21fd87c9a233b73a0ca77672efff | [
"MIT"
] | null | null | null | nbdt/utils.py | lisadunlap/explainable-nbdt | e045bfd0b55b21fd87c9a233b73a0ca77672efff | [
"MIT"
] | null | null | null | '''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math
import numpy as np
from numpy import linalg as LA
im... | 35.5189 | 127 | 0.629015 | import os
import sys
import time
import math
import numpy as np
from numpy import linalg as LA
import torch
import torch.nn as nn
import torch.nn.init as init
import torchvision.transforms as transforms
from gensim.models import Word2Vec
from pathlib import Path
METHODS = ('prune', 'wordnet', 'random', 'image', 'in... | true | true |
f73b18b3bd5549421d5a7af3c2033291279afaa8 | 399 | py | Python | backend/dan3103_1_1/wsgi.py | crowdbotics-apps/dan3103-1-1 | c0adeab7e87fe0260ba69f4ac3ee144ee4b313d1 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/dan3103_1_1/wsgi.py | crowdbotics-apps/dan3103-1-1 | c0adeab7e87fe0260ba69f4ac3ee144ee4b313d1 | [
"FTL",
"AML",
"RSA-MD"
] | 28 | 2021-07-25T14:51:20.000Z | 2022-01-16T13:10:18.000Z | backend/dan3103_1_1/wsgi.py | crowdbotics-apps/dan3103-1-1 | c0adeab7e87fe0260ba69f4ac3ee144ee4b313d1 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for dan3103_1_1 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dan3103_1_1.settings')
application = get_wsgi_application()
| true | true |
f73b1ab635b1b697f3160cf1c7294e15be8c4af9 | 937 | py | Python | python/helpers/pydev/pydev_tests_python/resources/_debugger_case_unhandled_exceptions.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/helpers/pydev/pydev_tests_python/resources/_debugger_case_unhandled_exceptions.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/helpers/pydev/pydev_tests_python/resources/_debugger_case_unhandled_exceptions.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | import threading, atexit, sys
try:
from thread import start_new_thread
except:
from _thread import start_new_thread
def _atexit():
print('TEST SUCEEDED')
sys.stderr.write('TEST SUCEEDED\n')
sys.stderr.flush()
sys.stdout.flush()
# Register the TEST SUCEEDED msg to the exit of the process... | 19.520833 | 84 | 0.715048 | import threading, atexit, sys
try:
from thread import start_new_thread
except:
from _thread import start_new_thread
def _atexit():
print('TEST SUCEEDED')
sys.stderr.write('TEST SUCEEDED\n')
sys.stderr.flush()
sys.stdout.flush()
atexit.register(_atexit)
def thread_func(n):
raise E... | true | true |
f73b1adda646a564d017692a2c08b6df7032046b | 89 | py | Python | weconnect_cli/__main__.py | tillsteinbach/WeConnect-cli | 28b841ac1bedd76db7e81ae7a15e2310165a6061 | [
"MIT"
] | 25 | 2021-06-02T21:16:15.000Z | 2022-03-17T06:55:45.000Z | weconnect_cli/__main__.py | tillsteinbach/WeConnect-cli | 28b841ac1bedd76db7e81ae7a15e2310165a6061 | [
"MIT"
] | 40 | 2021-06-09T19:49:56.000Z | 2022-03-23T15:03:19.000Z | weconnect_cli/__main__.py | tillsteinbach/WeConnect-cli | 28b841ac1bedd76db7e81ae7a15e2310165a6061 | [
"MIT"
] | 1 | 2022-01-20T08:31:02.000Z | 2022-01-20T08:31:02.000Z | from weconnect_cli.weconnect_cli_base import main
if __name__ == '__main__':
main()
| 17.8 | 49 | 0.752809 | from weconnect_cli.weconnect_cli_base import main
if __name__ == '__main__':
main()
| true | true |
f73b1b6c3c56793177639affa6e8e0a5a0c4266e | 339 | py | Python | ex1.py | eruffaldi/pypnunum | a9d98ad8d5bdc77c75c131e67a4577c8a8107097 | [
"Apache-2.0"
] | 1 | 2017-12-01T23:33:12.000Z | 2017-12-01T23:33:12.000Z | ex1.py | eruffaldi/pypnunum | a9d98ad8d5bdc77c75c131e67a4577c8a8107097 | [
"Apache-2.0"
] | null | null | null | ex1.py | eruffaldi/pypnunum | a9d98ad8d5bdc77c75c131e67a4577c8a8107097 | [
"Apache-2.0"
] | 1 | 2018-02-01T14:30:27.000Z | 2018-02-01T14:30:27.000Z | # from Slide 21 "Divide by 0" slide
# The SORN has 10 presence bits set to represent the half-open interval (–1, 2]. Begin by taking the reciprocal, which is lossless and preserves the contiguity of the unums in the result.
from punum import *
a = Alphabet.p2()
x = Pbound((-a.one()).next(),a.one().next().next())
p... | 37.666667 | 188 | 0.696165 |
from punum import *
a = Alphabet.p2()
x = Pbound((-a.one()).next(),a.one().next().next())
print (x)
print (~x) | true | true |
f73b1b6d8a7c8a23a3b96b2886505bd7595dcd5b | 1,634 | py | Python | list_painting.py | EtlamGit/PySlicer | 4f2015ca995377d34dd176045396dcf51bc78a2a | [
"MIT"
] | 1 | 2021-02-16T16:27:54.000Z | 2021-02-16T16:27:54.000Z | list_painting.py | EtlamGit/PySlicer | 4f2015ca995377d34dd176045396dcf51bc78a2a | [
"MIT"
] | null | null | null | list_painting.py | EtlamGit/PySlicer | 4f2015ca995377d34dd176045396dcf51bc78a2a | [
"MIT"
] | null | null | null | # copyright 2019 Mojang (Microsoft Corporation), Python translation by EtlamGit
from gridSprite import gridSprite
def painting(path, x, y, w, h):
return gridSprite('assets/minecraft/textures/painting/' + path + ".png", x, y, w, h, 0, 0, 16, 16)
painting_input = 'assets/minecraft/textures/painting/paintings_kri... | 40.85 | 102 | 0.47858 |
from gridSprite import gridSprite
def painting(path, x, y, w, h):
return gridSprite('assets/minecraft/textures/painting/' + path + ".png", x, y, w, h, 0, 0, 16, 16)
painting_input = 'assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png'
painting_list = {
painting("back", 15,... | true | true |
f73b1b70433a231ed61600e509068803f6852beb | 2,591 | py | Python | readSample.py | DiegoCao/GraphSage | 55d9e41695a17e0de5fac091c35b19d43a82888d | [
"MIT"
] | null | null | null | readSample.py | DiegoCao/GraphSage | 55d9e41695a17e0de5fac091c35b19d43a82888d | [
"MIT"
] | null | null | null | readSample.py | DiegoCao/GraphSage | 55d9e41695a17e0de5fac091c35b19d43a82888d | [
"MIT"
] | null | null | null | import json as json
import numpy as np
import networkx as nx
from networkx.readwrite import json_graph
# with open('./example_data/toy-ppi-feats.npy') as load_f:
def t1():
with open('./example_data/toy-ppi-G.json') as f:
data = json.load(f)
for i in data:
print(i)
print(data['directed'])
... | 22.929204 | 98 | 0.52335 | import json as json
import numpy as np
import networkx as nx
from networkx.readwrite import json_graph
def t1():
with open('./example_data/toy-ppi-G.json') as f:
data = json.load(f)
for i in data:
print(i)
print(data['directed'])
print(data['graph'])
print(data['multigraph'])
... | true | true |
f73b1dac7b0f21573292a25ba3fc727d67fbe221 | 1,084 | py | Python | c7n/resources/directconnect.py | ticketmaster/cloud-custodian | 0da3866f70f858895af228cc08706d0909a2a324 | [
"Apache-2.0"
] | null | null | null | c7n/resources/directconnect.py | ticketmaster/cloud-custodian | 0da3866f70f858895af228cc08706d0909a2a324 | [
"Apache-2.0"
] | 4 | 2017-02-02T17:08:23.000Z | 2017-05-25T19:33:19.000Z | c7n/resources/directconnect.py | ticketmaster/cloud-custodian | 0da3866f70f858895af228cc08706d0909a2a324 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 36.133333 | 82 | 0.750923 |
from __future__ import absolute_import, division, print_function, unicode_literals
from c7n.manager import resources
from c7n.query import QueryResourceManager
@resources.register('directconnect')
class DirectConnect(QueryResourceManager):
class resource_type(object):
service = 'directconne... | true | true |
f73b1e259bec1d20d80014c7ec153ef4e694f241 | 4,730 | py | Python | tensorflow_federated/tools/development/setup.py | VonRosenchild/federated | ad3986f8587a0f1dd0c6ce738db1fef436cb826f | [
"Apache-2.0"
] | 1 | 2019-10-10T06:19:52.000Z | 2019-10-10T06:19:52.000Z | tensorflow_federated/tools/development/setup.py | wangcaihua/federated | c8c7fe84d20f6c16a2a9f290a05179b5422257b6 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/tools/development/setup.py | wangcaihua/federated | c8c7fe84d20f6c16a2a9f290a05179b5422257b6 | [
"Apache-2.0"
] | 2 | 2019-10-10T06:19:41.000Z | 2021-01-28T03:06:55.000Z | # Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 38.770492 | 80 | 0.72685 |
import sys
import setuptools
DOCLINES = __doc__.split('\n')
project_name = 'tensorflow_federated'
if '--project_name' in sys.argv:
project_name_idx = sys.argv.index('--project_name')
project_name = sys.argv[project_name_idx + 1]
sys.argv.remove('--project_name')
sys.argv.pop(project_name_idx)... | true | true |
f73b1fd0dff6c5078536096345d9bbb124ff8787 | 106 | py | Python | ml_api/standardizer/apps.py | codeamazone/ml_api | c93a4165341ac8fc60e35072d3874fa7c5808004 | [
"MIT"
] | null | null | null | ml_api/standardizer/apps.py | codeamazone/ml_api | c93a4165341ac8fc60e35072d3874fa7c5808004 | [
"MIT"
] | null | null | null | ml_api/standardizer/apps.py | codeamazone/ml_api | c93a4165341ac8fc60e35072d3874fa7c5808004 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class StandardizerConfig(AppConfig):
name = 'ml_api.standardizer'
| 17.666667 | 36 | 0.783019 | from django.apps import AppConfig
class StandardizerConfig(AppConfig):
name = 'ml_api.standardizer'
| true | true |
f73b200ee856d7a7b7583f69a1d86b9fdab46ec6 | 649 | py | Python | dbl/__init__.py | TAG-Epic/DBL-Python-Library | c81af619fafc3a065e4d0bcfcf12c198e784308c | [
"MIT"
] | null | null | null | dbl/__init__.py | TAG-Epic/DBL-Python-Library | c81af619fafc3a065e4d0bcfcf12c198e784308c | [
"MIT"
] | null | null | null | dbl/__init__.py | TAG-Epic/DBL-Python-Library | c81af619fafc3a065e4d0bcfcf12c198e784308c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
DBL Python API Wrapper
~~~~~~~~~~~~~~~~~~~~~~
A basic wrapper for the top.gg API.
:copyright: (c) 2020 Assanali Mukhanov & top.gg
:license: MIT, see LICENSE for more details.
"""
__title__ = 'dblpy'
__author__ = 'Francis Taylor'
__license__ = 'MIT'
__copyright__ = 'Copyright 2020 Assanali ... | 24.961538 | 95 | 0.705701 |
__title__ = 'dblpy'
__author__ = 'Francis Taylor'
__license__ = 'MIT'
__copyright__ = 'Copyright 2020 Assanali Mukhanov'
__version__ = '0.3.4'
from collections import namedtuple
from .client import DBLClient
from .errors import *
from .http import HTTPClient
VersionInfo = namedtuple('VersionInfo', 'major minor mi... | true | true |
f73b208a223485b598b88acf029f28f42be6cdf5 | 591 | py | Python | life/users/api/serializers/lsg.py | coronasafe/life_backend | 00eacfdc5cd544dc136fb306340fb0d56afa78ff | [
"MIT"
] | 1 | 2021-05-15T20:40:00.000Z | 2021-05-15T20:40:00.000Z | life/users/api/serializers/lsg.py | coronasafe/life_backend | 00eacfdc5cd544dc136fb306340fb0d56afa78ff | [
"MIT"
] | null | null | null | life/users/api/serializers/lsg.py | coronasafe/life_backend | 00eacfdc5cd544dc136fb306340fb0d56afa78ff | [
"MIT"
] | 2 | 2021-05-08T01:45:42.000Z | 2021-05-17T02:00:10.000Z | from rest_framework import serializers
from life.users.models import District, LocalBody, State, Ward
class StateSerializer(serializers.ModelSerializer):
class Meta:
model = State
fields = "__all__"
class DistrictSerializer(serializers.ModelSerializer):
class Meta:
model = District
... | 21.107143 | 62 | 0.693739 | from rest_framework import serializers
from life.users.models import District, LocalBody, State, Ward
class StateSerializer(serializers.ModelSerializer):
class Meta:
model = State
fields = "__all__"
class DistrictSerializer(serializers.ModelSerializer):
class Meta:
model = District
... | true | true |
f73b21df9146bd2a60817565790da9653cc85c65 | 2,579 | py | Python | corehq/form_processor/tasks.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | corehq/form_processor/tasks.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | corehq/form_processor/tasks.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | import time
from datetime import timedelta
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from corehq.form_processor.reprocess import reprocess_unfinished_stub
from corehq.util.celery_utils import no_result_task
from corehq.util.decorators import serial_tas... | 42.278689 | 97 | 0.759209 | import time
from datetime import timedelta
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from corehq.form_processor.reprocess import reprocess_unfinished_stub
from corehq.util.celery_utils import no_result_task
from corehq.util.decorators import serial_tas... | true | true |
f73b225668494337de64ccf00db5a6f15f513153 | 12,630 | py | Python | tests/test_dipdup/test_index.py | dipdup-net/dipdup-py | 1f42e3788d8eec1021e5002837471ce31dafe6ee | [
"MIT"
] | 39 | 2021-04-13T10:53:27.000Z | 2022-02-11T00:53:44.000Z | tests/test_dipdup/test_index.py | dipdup-net/dipdup-py | 1f42e3788d8eec1021e5002837471ce31dafe6ee | [
"MIT"
] | 113 | 2021-06-01T18:16:42.000Z | 2022-03-28T06:12:58.000Z | tests/test_dipdup/test_index.py | dipdup-net/dipdup-py | 1f42e3788d8eec1021e5002837471ce31dafe6ee | [
"MIT"
] | 16 | 2021-05-26T07:04:40.000Z | 2022-03-29T06:50:25.000Z | import datetime
from unittest import IsolatedAsyncioTestCase
from unittest.mock import AsyncMock
from dipdup.config import ContractConfig
from dipdup.config import OperationHandlerConfig
from dipdup.config import OperationHandlerTransactionPatternConfig
from dipdup.config import OperationIndexConfig
from dipdup.config... | 40.480769 | 139 | 0.584086 | import datetime
from unittest import IsolatedAsyncioTestCase
from unittest.mock import AsyncMock
from dipdup.config import ContractConfig
from dipdup.config import OperationHandlerConfig
from dipdup.config import OperationHandlerTransactionPatternConfig
from dipdup.config import OperationIndexConfig
from dipdup.config... | true | true |
f73b232e3b8f1bb1960d37d81ff29c6e8ec2c696 | 2,551 | py | Python | chebpy/core/exceptions.py | janniklasrose/chebpy | f69ca920e7c672e4a37e53a7d32f580c536f3462 | [
"BSD-3-Clause"
] | 90 | 2016-09-02T23:00:13.000Z | 2022-02-08T15:20:21.000Z | chebpy/core/exceptions.py | janniklasrose/chebpy | f69ca920e7c672e4a37e53a7d32f580c536f3462 | [
"BSD-3-Clause"
] | 55 | 2016-11-16T06:18:51.000Z | 2022-03-25T14:25:17.000Z | chebpy/core/exceptions.py | janniklasrose/chebpy | f69ca920e7c672e4a37e53a7d32f580c536f3462 | [
"BSD-3-Clause"
] | 22 | 2016-08-30T01:28:22.000Z | 2022-01-10T11:13:06.000Z | from abc import ABC, abstractmethod
class ChebpyBaseException(Exception, ABC):
def __init__(self, *args):
if args:
self.message = args[0]
else:
self.message = self.default_message
def __str__(self):
return self.message
@property
@abstractmethod
def... | 22.377193 | 82 | 0.593101 | from abc import ABC, abstractmethod
class ChebpyBaseException(Exception, ABC):
def __init__(self, *args):
if args:
self.message = args[0]
else:
self.message = self.default_message
def __str__(self):
return self.message
@property
@abstractmethod
def... | true | true |
f73b2407866493cd9a430a65f59ed27e4347d3a9 | 3,252 | py | Python | ScheduledDeliveryWebApplication/app/models/address_model.py | leitao-bcc/MovileNext3_Backend_LucasLeitao | 15bdd8a96711a2e305078cd2f152b86374dbe276 | [
"Unlicense"
] | null | null | null | ScheduledDeliveryWebApplication/app/models/address_model.py | leitao-bcc/MovileNext3_Backend_LucasLeitao | 15bdd8a96711a2e305078cd2f152b86374dbe276 | [
"Unlicense"
] | null | null | null | ScheduledDeliveryWebApplication/app/models/address_model.py | leitao-bcc/MovileNext3_Backend_LucasLeitao | 15bdd8a96711a2e305078cd2f152b86374dbe276 | [
"Unlicense"
] | null | null | null | from app.models.base_model import BaseModel, db
from app.validators.cep_validator import is_valid_cep
from app.validators.coordinates_validator import is_valid_latitude, \
is_valid_longitude
from app.validators.none_or_empty_validator import is_none_or_empty
from app.validators.string_format_validator import is_flo... | 36.954545 | 76 | 0.654982 | from app.models.base_model import BaseModel, db
from app.validators.cep_validator import is_valid_cep
from app.validators.coordinates_validator import is_valid_latitude, \
is_valid_longitude
from app.validators.none_or_empty_validator import is_none_or_empty
from app.validators.string_format_validator import is_flo... | true | true |
f73b24f5f48434cd6014034a47134e9c3fe120b7 | 3,781 | py | Python | contrib/macdeploy/custom_dsstore.py | byeonggoon/blockteam1-1 | 59e7890bb3d6c1091355c8e91898fdb7199a3328 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | byeonggoon/blockteam1-1 | 59e7890bb3d6c1091355c8e91898fdb7199a3328 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | byeonggoon/blockteam1-1 | 59e7890bb3d6c1091355c8e91898fdb7199a3328 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.983607 | 1,817 | 0.72785 |
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': b'{{30... | true | true |
f73b27fbb4c48b340935f0983840b3a389f98432 | 1,619 | py | Python | src/uefi/BaseTools/Source/Python/Ecc/FileProfile.py | kkennett/oscore.dev | 59e786f12f9af969211c95a9d2863b1767528341 | [
"BSD-3-Clause"
] | null | null | null | src/uefi/BaseTools/Source/Python/Ecc/FileProfile.py | kkennett/oscore.dev | 59e786f12f9af969211c95a9d2863b1767528341 | [
"BSD-3-Clause"
] | null | null | null | src/uefi/BaseTools/Source/Python/Ecc/FileProfile.py | kkennett/oscore.dev | 59e786f12f9af969211c95a9d2863b1767528341 | [
"BSD-3-Clause"
] | null | null | null | ## @file
# fragments of source file
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may ... | 27.913793 | 85 | 0.692403 |
from __future__ import absolute_import
import re
import Common.LongFilePathOs as os
from Ecc.ParserWarning import Warning
from Common.LongFilePathSupport import OpenLongFilePath as open
CommentList = []
PPDirectiveList = []
PredicateExpressionList = []
FunctionDefinitionList = []
VariableDeclarationList = []... | true | true |
f73b2857b7b40bf899f8c58f6e44ffa98b4400cf | 1,755 | py | Python | burger_war_dev/scripts/transform_enemy_pose.py | Gantetsu-robocon/burger_war_dev | e74e966dfc1d7a27c372cd794364625311ea5ec2 | [
"BSD-3-Clause"
] | null | null | null | burger_war_dev/scripts/transform_enemy_pose.py | Gantetsu-robocon/burger_war_dev | e74e966dfc1d7a27c372cd794364625311ea5ec2 | [
"BSD-3-Clause"
] | null | null | null | burger_war_dev/scripts/transform_enemy_pose.py | Gantetsu-robocon/burger_war_dev | e74e966dfc1d7a27c372cd794364625311ea5ec2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#TF enemy position from ralative_pos topic
#Add time losed enemy to color_flag
import rospy
import tf2_ros
import tf_conversions
import tf
import math
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import TransformStamped
from geometry_msgs.msg import ... | 27.421875 | 92 | 0.65812 |
import rospy
import tf2_ros
import tf_conversions
import tf
import math
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import TransformStamped
from geometry_msgs.msg import Quaternion
class TransformEnemy():
def __init__(self):
self.rate = rospy.get_param("~rate", 1)
... | true | true |
f73b289ccdf3c5960f72cc446fc16b93de1fbde3 | 72,219 | py | Python | Tools/ProxyStubGenerator/CppParser.py | mallikarjuna54/Thunder | 9c91ff5fab29cd29c136daa3a5bfa6da068e328a | [
"Apache-2.0"
] | null | null | null | Tools/ProxyStubGenerator/CppParser.py | mallikarjuna54/Thunder | 9c91ff5fab29cd29c136daa3a5bfa6da068e328a | [
"Apache-2.0"
] | null | null | null | Tools/ProxyStubGenerator/CppParser.py | mallikarjuna54/Thunder | 9c91ff5fab29cd29c136daa3a5bfa6da068e328a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# If not stated otherwise in this file or this component's license file the
# following copyright and licenses apply:
#
# Copyright 2020 Metrological
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | 36.566582 | 153 | 0.491837 |
# following copyright and licenses apply:
#
# Copyright 2020 Metrological
#
# 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... | true | true |
f73b28f6dd711dd6fec6459c15e78ad8339e0ec2 | 484 | py | Python | setup.py | lexibank/castroyi | 460c025941e54ba31103d1baadb9f3320db441a0 | [
"CC-BY-4.0"
] | null | null | null | setup.py | lexibank/castroyi | 460c025941e54ba31103d1baadb9f3320db441a0 | [
"CC-BY-4.0"
] | 4 | 2019-11-26T12:39:18.000Z | 2021-07-21T08:22:57.000Z | setup.py | lexibank/castroyi | 460c025941e54ba31103d1baadb9f3320db441a0 | [
"CC-BY-4.0"
] | null | null | null | from setuptools import setup
import json
with open("metadata.json", encoding="utf-8") as fp:
metadata = json.load(fp)
setup(
name="lexibank_castroyi",
description=metadata["title"],
license=metadata.get("license", ""),
url=metadata.get("url", ""),
py_modules=["lexibank_castroyi"],
includ... | 24.2 | 78 | 0.68595 | from setuptools import setup
import json
with open("metadata.json", encoding="utf-8") as fp:
metadata = json.load(fp)
setup(
name="lexibank_castroyi",
description=metadata["title"],
license=metadata.get("license", ""),
url=metadata.get("url", ""),
py_modules=["lexibank_castroyi"],
includ... | true | true |
f73b29639e420ead86b5724271504549b95b0b75 | 2,245 | py | Python | demo_wheel.py | mawillcockson/barcode-wheel | c0f8f6f281f013fd05c450d152d2d66b564b3a4a | [
"MIT"
] | null | null | null | demo_wheel.py | mawillcockson/barcode-wheel | c0f8f6f281f013fd05c450d152d2d66b564b3a4a | [
"MIT"
] | null | null | null | demo_wheel.py | mawillcockson/barcode-wheel | c0f8f6f281f013fd05c450d152d2d66b564b3a4a | [
"MIT"
] | 1 | 2019-04-29T21:13:35.000Z | 2019-04-29T21:13:35.000Z | """Demonstrates how an application might use the barcode_wheel library"""
import sys
import barcode_wheel
import svgwrite
import pathlib
import logging
import tempfile
import csv
from time import sleep
demo_contents = (
"""
22001,Money Order (Principal),
22101,Money Order (Fee),
10502,Club Card Savings,
12345678901,T... | 25.224719 | 106 | 0.635635 | import sys
import barcode_wheel
import svgwrite
import pathlib
import logging
import tempfile
import csv
from time import sleep
demo_contents = (
"""
22001,Money Order (Principal),
22101,Money Order (Fee),
10502,Club Card Savings,
12345678901,Test Product (Name Here),./4094485-random-picture.gif
9,Mardi Gras,
"""
)
... | true | true |
f73b29cdc2364a1c4311d41511f41374a4bc8393 | 3,420 | py | Python | lightautoml/pipelines/ml/whitebox_ml_pipe.py | alexeytomashyov/LightAutoML | 41e8e10d430344dbdb5e39dd48342653ee31988c | [
"Apache-2.0"
] | null | null | null | lightautoml/pipelines/ml/whitebox_ml_pipe.py | alexeytomashyov/LightAutoML | 41e8e10d430344dbdb5e39dd48342653ee31988c | [
"Apache-2.0"
] | null | null | null | lightautoml/pipelines/ml/whitebox_ml_pipe.py | alexeytomashyov/LightAutoML | 41e8e10d430344dbdb5e39dd48342653ee31988c | [
"Apache-2.0"
] | null | null | null | """Whitebox MLPipeline."""
import warnings
from typing import Union, Tuple, cast
from .base import MLPipeline
from ..features.wb_pipeline import WBFeatures
from ..selection.base import EmptySelector
from ...dataset.np_pd_dataset import NumpyDataset, PandasDataset
from ...ml_algo.tuning.base import ParamsTuner
from ..... | 33.861386 | 113 | 0.664035 |
import warnings
from typing import Union, Tuple, cast
from .base import MLPipeline
from ..features.wb_pipeline import WBFeatures
from ..selection.base import EmptySelector
from ...dataset.np_pd_dataset import NumpyDataset, PandasDataset
from ...ml_algo.tuning.base import ParamsTuner
from ...ml_algo.whitebox import Wb... | true | true |
f73b2a60ec4908a6430d99181f8a20820fb1d123 | 4,692 | py | Python | pajbot/modules/clr_overlay/emotecombo.py | JoachimFlottorp/pajbot | 4fb88c403dedb20d95be80e38da72be1ed064901 | [
"MIT"
] | 128 | 2015-12-28T01:02:30.000Z | 2019-05-24T21:20:50.000Z | pajbot/modules/clr_overlay/emotecombo.py | JoachimFlottorp/pajbot | 4fb88c403dedb20d95be80e38da72be1ed064901 | [
"MIT"
] | 277 | 2015-05-03T18:48:57.000Z | 2019-05-23T17:41:28.000Z | pajbot/modules/clr_overlay/emotecombo.py | JoachimFlottorp/pajbot | 4fb88c403dedb20d95be80e38da72be1ed064901 | [
"MIT"
] | 96 | 2015-08-07T18:49:50.000Z | 2019-05-20T19:49:27.000Z | from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Optional, Set
import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.emote import Emote, EmoteInstance, EmoteInstanceCountMap
from pajbot.modules import BaseModule
from pajbot.modules.base import ModuleSetti... | 32.811189 | 115 | 0.625959 | from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Optional, Set
import logging
from pajbot.managers.handler import HandlerManager
from pajbot.models.emote import Emote, EmoteInstance, EmoteInstanceCountMap
from pajbot.modules import BaseModule
from pajbot.modules.base import ModuleSetti... | true | true |
f73b2c32fe94d65086455725c53011f0661e61b3 | 2,852 | py | Python | Movie_Exp.py | Coop37/Movies_Example | 83a9c097e5e26e9d094c6bac49467d1695da53c6 | [
"MIT"
] | null | null | null | Movie_Exp.py | Coop37/Movies_Example | 83a9c097e5e26e9d094c6bac49467d1695da53c6 | [
"MIT"
] | null | null | null | Movie_Exp.py | Coop37/Movies_Example | 83a9c097e5e26e9d094c6bac49467d1695da53c6 | [
"MIT"
] | 1 | 2020-10-27T08:34:40.000Z | 2020-10-27T08:34:40.000Z | import os
from py2neo import Graph
import ast
from json import dumps
from flask import Flask, render_template, g, Response, request
from neo4j import GraphDatabase, basic_auth
app = Flask(__name__)
app.debug = True
# The password must be changed to your NEO4J password.
driver = GraphDatabase.driver('bolt://localhost'... | 33.162791 | 254 | 0.605189 | import os
from py2neo import Graph
import ast
from json import dumps
from flask import Flask, render_template, g, Response, request
from neo4j import GraphDatabase, basic_auth
app = Flask(__name__)
app.debug = True
driver = GraphDatabase.driver('bolt://localhost',auth=basic_auth("neo4j", '6669'))
hold = '?'
def get_... | true | true |
f73b2c8d2590059b4bd26b86989a83e72697d2f9 | 6,983 | py | Python | metaphor/looker/extractor.py | MetaphorData/connectors | e195f58ee0660b278bd72d16173937fae279eef2 | [
"Apache-2.0"
] | 5 | 2021-08-24T17:46:48.000Z | 2022-01-21T03:42:31.000Z | metaphor/looker/extractor.py | MetaphorData/connectors | e195f58ee0660b278bd72d16173937fae279eef2 | [
"Apache-2.0"
] | 142 | 2021-09-02T22:16:54.000Z | 2022-03-31T15:23:34.000Z | metaphor/looker/extractor.py | MetaphorData/connectors | dd0e2092f791196dd9becce7da28923a4875370d | [
"Apache-2.0"
] | null | null | null | import os
from typing import Dict, Iterable, List, Sequence, Set, Tuple
try:
import looker_sdk
from looker_sdk.sdk.api31.methods import Looker31SDK
from looker_sdk.sdk.api31.models import DashboardElement
except ImportError:
print("Please install metaphor[looker] extra\n")
raise
from metaphor.mode... | 35.810256 | 98 | 0.608621 | import os
from typing import Dict, Iterable, List, Sequence, Set, Tuple
try:
import looker_sdk
from looker_sdk.sdk.api31.methods import Looker31SDK
from looker_sdk.sdk.api31.models import DashboardElement
except ImportError:
print("Please install metaphor[looker] extra\n")
raise
from metaphor.mode... | true | true |
f73b2d0db43898ad6371e679c14ffbb86cb40210 | 2,100 | py | Python | find-subnets.py | hmcts/cnp-module-postgres | 7e8ce4feb3f1c1e586fd989b411eed93d7fb2bfd | [
"MIT"
] | 1 | 2019-10-02T12:50:50.000Z | 2019-10-02T12:50:50.000Z | find-subnets.py | hmcts/cnp-module-postgres | 7e8ce4feb3f1c1e586fd989b411eed93d7fb2bfd | [
"MIT"
] | 5 | 2019-05-01T16:41:13.000Z | 2021-11-12T13:50:14.000Z | find-subnets.py | hmcts/cnp-module-postgres | 7e8ce4feb3f1c1e586fd989b411eed93d7fb2bfd | [
"MIT"
] | 1 | 2021-04-10T22:50:13.000Z | 2021-04-10T22:50:13.000Z | #!/usr/bin/env python3
import sys
import json
import urllib.request
def find_subnet_rules(env, product, subnets):
all_subnets = get_all_subnets(env, product, subnets)
rule_names = [x['rule_name'] for x in all_subnets]
subnet_ids = [x['subnet_id'] for x in all_subnets]
result = {}
result['subnet... | 31.818182 | 109 | 0.682381 |
import sys
import json
import urllib.request
def find_subnet_rules(env, product, subnets):
all_subnets = get_all_subnets(env, product, subnets)
rule_names = [x['rule_name'] for x in all_subnets]
subnet_ids = [x['subnet_id'] for x in all_subnets]
result = {}
result['subnets'] = ';'.join(subnet_... | true | true |
f73b2d3deca443423c813c97d673a48963ca6f65 | 1,930 | py | Python | 1-99/50-59/50.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | 1-99/50-59/50.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | 1-99/50-59/50.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | """
Implement pow(x, n), which calculates x raised to the power n (x^n).
Example 1:
Input: 2.00000, 10, Output: 1024.00000
Example 2:
Input: 2.10000, 3, Output: 9.26100
Example 3:
Input: 2.00000, -2, Output: 0.25000, Explanation: 2-2 = 1/22 = 1/4 = 0.25
Note:
-100.0 < x < 100.0, n is a 32-bit signed integer, wi... | 36.415094 | 118 | 0.668394 |
def my_pow(x, n):
if n < 0:
x = 1/x
sign = -1 if (x < 0 and n % 2) else 1
res, last_power = 1, 0
for pow_2, bit in enumerate(reversed(bin(abs(n))[2:])):
power = abs(x) if not pow_2 else last_power * last_power
last_power = power
if bit == '1':
res *= power
... | true | true |
f73b2d57a08288cc1814ce291790dce1ed64cd3b | 37,605 | py | Python | keystone/tests/protection/v3/test_users.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | null | null | null | keystone/tests/protection/v3/test_users.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | keystone/tests/protection/v3/test_users.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 37.122409 | 79 | 0.60585 |
import uuid
from oslo_serialization import jsonutils
from six.moves import http_client
from keystone.common.policies import user as up
from keystone.common import provider_api
import keystone.conf
from keystone.tests.common import auth as common_auth
from keystone.tests import unit
from keystone.tests.uni... | true | true |
f73b2d639d0e65b873732c9f73125c0faa298413 | 1,867 | py | Python | hooks/post_gen_project.py | Everyday-Future/cookiecutter-devops | 316948eed75c95ac5768a1bf1d504807069aaa6a | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | Everyday-Future/cookiecutter-devops | 316948eed75c95ac5768a1bf1d504807069aaa6a | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | Everyday-Future/cookiecutter-devops | 316948eed75c95ac5768a1bf1d504807069aaa6a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import stat
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
if __name__ == '__main__':
if 'no' in '{{ cookiecutter.command_line_interface|lower }}':
cli_file = os.path.join('{{ cook... | 38.102041 | 87 | 0.637386 |
import os
import stat
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
if __name__ == '__main__':
if 'no' in '{{ cookiecutter.command_line_interface|lower }}':
cli_file = os.path.join('{{ cookiecutter.project_slug... | true | true |
f73b2fa14400f6635610f8c0917767fe75628726 | 14,043 | py | Python | bin/workshop_check.py | mesfind/2018-06-07-Ethiopia | fcd1cff277a84e03b449df6674a966c862f83682 | [
"CC-BY-4.0"
] | null | null | null | bin/workshop_check.py | mesfind/2018-06-07-Ethiopia | fcd1cff277a84e03b449df6674a966c862f83682 | [
"CC-BY-4.0"
] | null | null | null | bin/workshop_check.py | mesfind/2018-06-07-Ethiopia | fcd1cff277a84e03b449df6674a966c862f83682 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
'''Check that a workshop's index.html metadata is valid. See the
docstrings on the checking functions for a summary of the checks.
'''
from __future__ import print_function
import sys
import os
import re
from datetime import date
from util import Reporter, split_metadata, load_yaml, check_unwan... | 33.356295 | 152 | 0.553087 |
from __future__ import print_function
import sys
import os
import re
from datetime import date
from util import Reporter, split_metadata, load_yaml, check_unwanted_files
EMAIL_PATTERN = r'[^@]+@[^@]+\.[^@]+'
HUMANTIME_PATTERN = r'((0?[1-9]|1[0-2]):[0-5]\d(am|pm)(-|to)(0?[1-9]|1[0-2]):[0-5]\d(am|pm))|((0?\d|1\d|2[0... | true | true |
f73b3026a7a9b6177f3c548ce4ad20c13608b6b1 | 19,450 | py | Python | aredis/pool.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | null | null | null | aredis/pool.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | null | null | null | aredis/pool.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import asyncio
import os
import warnings
import time
import random
import threading
from itertools import chain
from urllib.parse import (parse_qs,
unquote,
urlparse)
from aredis.connection import (RedisSSLContext,
... | 38.822355 | 119 | 0.611774 |
import asyncio
import os
import warnings
import time
import random
import threading
from itertools import chain
from urllib.parse import (parse_qs,
unquote,
urlparse)
from aredis.connection import (RedisSSLContext,
Connection,
... | true | true |
f73b31234e443bebd1fd34ce1f18d098d1497847 | 4,100 | py | Python | apps/utils/CodeConstant.py | Chise1/my_audit_monitor | e302c339be4083cc03349096142bcff85b6947e5 | [
"BSD-3-Clause"
] | null | null | null | apps/utils/CodeConstant.py | Chise1/my_audit_monitor | e302c339be4083cc03349096142bcff85b6947e5 | [
"BSD-3-Clause"
] | null | null | null | apps/utils/CodeConstant.py | Chise1/my_audit_monitor | e302c339be4083cc03349096142bcff85b6947e5 | [
"BSD-3-Clause"
] | null | null | null | class CodeConstant():
SYSTEM_ERROR = "系统错误,请与管理员联系"
REQUEST_FAILUE = "请求失败"
FILE_UPLOAD_FAILUE = "文件上传失败"
FILE_DELETE_FAILUE = "文件删除失败"
CODE_000 = "000" # 接口提交成功
CODE_001 = "001" # 接口非法请求错误
CODE_002 = "002" # 接口传递参数错误
CODE_003 = "003" # 接口异常
# 接口返回码信息 ** /
REQUEST_SUCCESS = "... | 26.11465 | 76 | 0.682927 | class CodeConstant():
SYSTEM_ERROR = "系统错误,请与管理员联系"
REQUEST_FAILUE = "请求失败"
FILE_UPLOAD_FAILUE = "文件上传失败"
FILE_DELETE_FAILUE = "文件删除失败"
CODE_000 = "000"
CODE_001 = "001"
CODE_002 = "002"
CODE_003 = "003"
REQUEST_SUCCESS = "000"
REQUEST_FAIL = "001"
COMMON_ILI... | true | true |
f73b315ad6d4a2584d59e7f836b3669d55a2e359 | 3,938 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | 25.082803 | 93 | 0.599543 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = '''
---
module: azure_rm_resourcegroup_facts
version_added: "2.1"
... | true | true |
f73b3191fdb4783e101b49dac92aa8396e043e85 | 1,811 | py | Python | Conteudo das Aulas/125/125.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | Conteudo das Aulas/125/125.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | Conteudo das Aulas/125/125.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | print("Propriedades e Descritores")
input()
print("Propriedades - Permitem gerenciar a criação")
print("e manipulação de atributos de uma da classe")
print("Semelhante aos métodos __getattr__, __setattr")
print("e __getattribute__ porem menos genéricos")
input()
print("Exemplo")
class Pessoa(object):
def __init_... | 24.146667 | 82 | 0.673661 | print("Propriedades e Descritores")
input()
print("Propriedades - Permitem gerenciar a criação")
print("e manipulação de atributos de uma da classe")
print("Semelhante aos métodos __getattr__, __setattr")
print("e __getattribute__ porem menos genéricos")
input()
print("Exemplo")
class Pessoa(object):
def __init_... | true | true |
f73b32cf54ce18fc20be898f47d908c0b8ec30cf | 46,846 | py | Python | demisto_sdk/commands/create_artifacts/content_artifacts_creator.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | 42 | 2019-11-07T13:02:00.000Z | 2022-03-29T03:39:04.000Z | demisto_sdk/commands/create_artifacts/content_artifacts_creator.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | 1,437 | 2019-11-07T13:02:25.000Z | 2022-03-31T12:48:11.000Z | demisto_sdk/commands/create_artifacts/content_artifacts_creator.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | 46 | 2019-12-09T21:44:30.000Z | 2022-03-24T17:36:45.000Z | # -*- coding: utf-8 -*-
import logging
import os
import re
import sys
import time
from concurrent.futures import as_completed
from contextlib import contextmanager
from shutil import make_archive, rmtree
from typing import Callable, Dict, List, Optional, Union
from packaging.version import parse
from pebble import Pro... | 43.822264 | 120 | 0.668104 |
import logging
import os
import re
import sys
import time
from concurrent.futures import as_completed
from contextlib import contextmanager
from shutil import make_archive, rmtree
from typing import Callable, Dict, List, Optional, Union
from packaging.version import parse
from pebble import ProcessFuture, ProcessPool... | true | true |
f73b330a985a8bdc79189580261efb90f9641523 | 5,932 | py | Python | GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py | m-sedghi/cmssw | 859df8affee372c53be79cdd2d8a5ff001eae841 | [
"Apache-2.0"
] | 1 | 2020-05-27T10:52:33.000Z | 2020-05-27T10:52:33.000Z | GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py | m-sedghi/cmssw | 859df8affee372c53be79cdd2d8a5ff001eae841 | [
"Apache-2.0"
] | 28 | 2019-08-15T15:21:11.000Z | 2021-12-29T14:13:18.000Z | GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py | m-sedghi/cmssw | 859df8affee372c53be79cdd2d8a5ff001eae841 | [
"Apache-2.0"
] | 1 | 2020-08-18T10:29:49.000Z | 2020-08-18T10:29:49.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
#process.load("SimGeneral.HepPDTESSource.pdt_cfi")
process.load("GeneratorInterface.TauolaInterface.TauSpinner_cfi")
process.Rando... | 51.137931 | 128 | 0.506237 | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
process.load("GeneratorInterface.TauolaInterface.TauSpinner_cfi")
process.RandomNumberGeneratorService = cms.Service("RandomNumbe... | true | true |
f73b332d755a2f2fcc48d09b720995c5b19dfcb0 | 418 | py | Python | Python/Django/Django/LoginAndRegistration/LoginAndRegistration/wsgi.py | JosephAMumford/CodingDojo | 505be74d18d7a8f41c4b3576ca050b97f840f0a3 | [
"MIT"
] | 2 | 2018-08-18T15:14:45.000Z | 2019-10-16T16:14:13.000Z | Python/Django/Django/LoginAndRegistration/LoginAndRegistration/wsgi.py | JosephAMumford/CodingDojo | 505be74d18d7a8f41c4b3576ca050b97f840f0a3 | [
"MIT"
] | null | null | null | Python/Django/Django/LoginAndRegistration/LoginAndRegistration/wsgi.py | JosephAMumford/CodingDojo | 505be74d18d7a8f41c4b3576ca050b97f840f0a3 | [
"MIT"
] | 6 | 2018-05-05T18:13:05.000Z | 2021-05-20T11:32:48.000Z | """
WSGI config for LoginAndRegistration project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault... | 24.588235 | 80 | 0.799043 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "LoginAndRegistration.settings")
application = get_wsgi_application()
| true | true |
f73b34484115fb55197b499b75b4fa1ae445e834 | 2,116 | py | Python | examples/gloo-arrows.py | antoineMoPa/glumpy | 901df7eb37cd728c2fe7e54920392b700b46c0ac | [
"BSD-3-Clause"
] | 1,074 | 2015-01-02T07:52:35.000Z | 2022-03-28T08:58:55.000Z | examples/gloo-arrows.py | antoineMoPa/glumpy | 901df7eb37cd728c2fe7e54920392b700b46c0ac | [
"BSD-3-Clause"
] | 273 | 2015-01-02T19:49:30.000Z | 2021-12-15T11:02:53.000Z | examples/gloo-arrows.py | antoineMoPa/glumpy | 901df7eb37cd728c2fe7e54920392b700b46c0ac | [
"BSD-3-Clause"
] | 206 | 2015-01-01T10:51:53.000Z | 2022-03-07T13:52:13.000Z | # -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import numpy as np
from glumpy import app, gl, glo... | 33.587302 | 79 | 0.531191 |
import numpy as np
from glumpy import app, gl, gloo
from glumpy.transforms import Position, OrthographicProjection, PanZoom
window = app.Window(width=2*512, height=512, color=(1,1,1,1))
@window.event
def on_draw(dt):
window.clear()
program.draw(gl.GL_POINTS)
program['orientation'][-1] += np.pi/1024.... | true | true |
f73b3458510b6cdb2408061f0f271242b3ba5102 | 6,605 | py | Python | nibabies/cli/run.py | effigies/nibabies | 3572d71d7a4fb1796973e54f2af77d00758c99e1 | [
"Apache-2.0"
] | 1 | 2022-02-09T18:42:56.000Z | 2022-02-09T18:42:56.000Z | nibabies/cli/run.py | effigies/nibabies | 3572d71d7a4fb1796973e54f2af77d00758c99e1 | [
"Apache-2.0"
] | null | null | null | nibabies/cli/run.py | effigies/nibabies | 3572d71d7a4fb1796973e54f2af77d00758c99e1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""NiBabies runner."""
from .. import config
def main():
"""Entry point."""
from os import EX_SOFTWARE
from pathlib import Path
import sys
import gc
from multiprocessing import Process, Manager
from .parser import parse_args
from ..utils.bi... | 37.528409 | 96 | 0.626646 |
from .. import config
def main():
from os import EX_SOFTWARE
from pathlib import Path
import sys
import gc
from multiprocessing import Process, Manager
from .parser import parse_args
from ..utils.bids import write_derivative_description, write_bidsignore
parse_args()
... | true | true |
f73b34adb34923d2309fafc833d7321b5a0b02dc | 8,441 | py | Python | photutils/aperture/mask.py | fdeugenio/photutils | 33c8b15cbbda85dc11c86a73217422dcb61398b7 | [
"BSD-3-Clause"
] | null | null | null | photutils/aperture/mask.py | fdeugenio/photutils | 33c8b15cbbda85dc11c86a73217422dcb61398b7 | [
"BSD-3-Clause"
] | null | null | null | photutils/aperture/mask.py | fdeugenio/photutils | 33c8b15cbbda85dc11c86a73217422dcb61398b7 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import astropy.units as u
__all__ = ['ApertureMask']
class ApertureMask:
"""
Class for an aperture mask.
Parameters
----------
data : array_like
A 2D array representing the fractional overlap of an apert... | 33.764 | 88 | 0.573392 |
import numpy as np
import astropy.units as u
__all__ = ['ApertureMask']
class ApertureMask:
def __init__(self, data, bbox):
self.data = np.asanyarray(data)
if self.data.shape != bbox.shape:
raise ValueError('mask data and bounding box must have the same '
... | true | true |
f73b34da37fb2b8765527e7e8be2ce104a3916e3 | 8,702 | py | Python | main.py | Jarred-Sumner/im2smpl | cb3a09ee99815939e9f7d55479920a32703be9ce | [
"MIT",
"Unlicense"
] | 64 | 2019-11-30T09:15:21.000Z | 2022-03-15T21:19:24.000Z | main.py | Jarred-Sumner/im2smpl | cb3a09ee99815939e9f7d55479920a32703be9ce | [
"MIT",
"Unlicense"
] | 3 | 2020-01-15T08:47:38.000Z | 2021-11-08T11:35:54.000Z | main.py | Jarred-Sumner/im2smpl | cb3a09ee99815939e9f7d55479920a32703be9ce | [
"MIT",
"Unlicense"
] | 18 | 2019-12-07T23:31:01.000Z | 2022-03-04T05:44:41.000Z | # Software License Agreement (BSD License)
#
# Copyright (c) 2019, Zerong Zheng (zzr18@mails.tsinghua.edu.cn)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code mus... | 42.44878 | 97 | 0.666858 |
from __future__ import print_function, absolute_import, division
import os
import numpy as np
import cv2 as cv
import argparse
import random
import string
import shutil
from subprocess import call
import pynvml
import time
pynvml.nvmlInit()
def parse_args():
parser = argparse.Argumen... | true | true |
f73b35030acd31c1f8f91e7064a382eb64e75577 | 2,676 | py | Python | tests/collaborative_tests.py | mostafa-mahmoud/HyPRec | f18318f179dd9f9af7cf01a11f13f0aefb42b3bb | [
"Apache-2.0"
] | 5 | 2017-07-17T12:55:45.000Z | 2020-07-20T09:13:10.000Z | tests/collaborative_tests.py | mostafa-mahmoud/HyPRec | f18318f179dd9f9af7cf01a11f13f0aefb42b3bb | [
"Apache-2.0"
] | 1 | 2019-05-02T20:59:53.000Z | 2019-05-02T20:59:53.000Z | tests/collaborative_tests.py | mostafa-mahmoud/HyPRec | f18318f179dd9f9af7cf01a11f13f0aefb42b3bb | [
"Apache-2.0"
] | 5 | 2017-07-30T10:50:07.000Z | 2019-08-30T20:02:47.000Z | #!/usr/bin/env python
import numpy
import unittest
from lib.abstract_recommender import AbstractRecommender
from lib.collaborative_filtering import CollaborativeFiltering
from lib.evaluator import Evaluator
from util.data_parser import DataParser
from util.model_initializer import ModelInitializer
class TestcaseBase(... | 46.947368 | 93 | 0.690957 |
import numpy
import unittest
from lib.abstract_recommender import AbstractRecommender
from lib.collaborative_filtering import CollaborativeFiltering
from lib.evaluator import Evaluator
from util.data_parser import DataParser
from util.model_initializer import ModelInitializer
class TestcaseBase(unittest.TestCase):
... | true | true |
f73b366b012fea66ac00ee79b22b61b0d63bffa5 | 541 | py | Python | Courses/Udacity/CS101/Lesson_4_Problem_Set_(Optional)/01-Word_Count/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2019-02-13T12:02:26.000Z | 2019-02-13T12:02:26.000Z | Courses/Udacity/CS101/Lesson_4_Problem_Set_(Optional)/01-Word_Count/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2018-08-13T15:58:33.000Z | 2018-08-13T15:58:33.000Z | Courses/Udacity/CS101/Lesson_4_Problem_Set_(Optional)/01-Word_Count/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 2 | 2017-08-10T20:01:29.000Z | 2021-07-01T08:39:13.000Z | # Write a procedure, count_words, which takes as input a string
# and returns the number of words in the string. You may consider words
# as strings of characters separated by spaces.
def count_words():
passage =("The number of orderings of the 52 cards in a deck of cards "
"is so great that if every one of the almo... | 33.8125 | 73 | 0.744917 |
def count_words():
passage =("The number of orderings of the 52 cards in a deck of cards "
"is so great that if every one of the almost 7 billion people alive "
"today dealt one ordering of the cards per second, it would take "
"2.5 * 10**40 times the age of the universe to order the cards in every "
"possible wa... | false | true |
f73b375d70bfbf2e5d11847c4bf26e1158c3e175 | 3,697 | py | Python | scripts/ingestors/ctre_bridge.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | scripts/ingestors/ctre_bridge.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | scripts/ingestors/ctre_bridge.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | """
Need something to ingest the CTRE provided bridge data
RSAI4
RLRI4
Run from RUN_1MIN
"""
from __future__ import print_function
import datetime
import sys
from io import BytesIO
import ftplib
import subprocess
import pytz
import pyiem.util as util
from pyiem.observation import Observation
def main():
""... | 29.34127 | 75 | 0.548553 | from __future__ import print_function
import datetime
import sys
from io import BytesIO
import ftplib
import subprocess
import pytz
import pyiem.util as util
from pyiem.observation import Observation
def main():
now = datetime.datetime.now()
if now.minute % 4 != 0 and len(sys.argv) < 2:
return
... | true | true |
f73b38066a1eb96becaeb2e3f13ef9ed2f171e6d | 4,711 | py | Python | pandapipes/test/io/test_file_io.py | dcronbach/pandapipes | 312fef81ddd0fb3eb23ec1c5bbc2848d568faa52 | [
"BSD-3-Clause"
] | null | null | null | pandapipes/test/io/test_file_io.py | dcronbach/pandapipes | 312fef81ddd0fb3eb23ec1c5bbc2848d568faa52 | [
"BSD-3-Clause"
] | null | null | null | pandapipes/test/io/test_file_io.py | dcronbach/pandapipes | 312fef81ddd0fb3eb23ec1c5bbc2848d568faa52 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
import os
import pandapipes
import pytest
from pandapower.test.toolbox import tempdir... | 37.388889 | 100 | 0.610486 |
import os
import pandapipes
import pytest
from pandapower.test.toolbox import tempdir
from pandas.testing import assert_frame_equal
def load_net():
net = pandapipes.create_empty_network("test_net", fluid="lgas")
j1 = pandapipes.create_junction(net, pn_bar=1.05, tfluid_k=293.15,
... | true | true |
f73b38a2ff5478dc0036b0e5ba52e688a0952586 | 115 | py | Python | setup.py | chappers/formdown | 7481bd69923f5907fe36d9620b4395ddb804fc4a | [
"MIT"
] | 1 | 2017-08-20T22:00:22.000Z | 2017-08-20T22:00:22.000Z | setup.py | chappers/formdown | 7481bd69923f5907fe36d9620b4395ddb804fc4a | [
"MIT"
] | null | null | null | setup.py | chappers/formdown | 7481bd69923f5907fe36d9620b4395ddb804fc4a | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(name='formdown',
version='1.0',
py_modules=['formdown'],
) | 23 | 32 | 0.626087 | from distutils.core import setup
setup(name='formdown',
version='1.0',
py_modules=['formdown'],
) | true | true |
f73b38b52110264b786ff98662d19e9c25afa09e | 429 | py | Python | API_testes/scripts/putting_data.py | tavares-douglas/S206_testes | 49bce4e12d58296250a5af68efe87d9a25e86bad | [
"MIT"
] | null | null | null | API_testes/scripts/putting_data.py | tavares-douglas/S206_testes | 49bce4e12d58296250a5af68efe87d9a25e86bad | [
"MIT"
] | null | null | null | API_testes/scripts/putting_data.py | tavares-douglas/S206_testes | 49bce4e12d58296250a5af68efe87d9a25e86bad | [
"MIT"
] | null | null | null | import requests
def put_data():
headers = {
'Accept': '*/*',
'User-Agent': 'request',
}
data = {
"id":1,
"title":"A test title",
"body":"A test description",
"userId":1,
}
post_id = 1
url = "https://jsonplaceholder.typicode.com/posts/"
respo... | 22.578947 | 75 | 0.545455 | import requests
def put_data():
headers = {
'Accept': '*/*',
'User-Agent': 'request',
}
data = {
"id":1,
"title":"A test title",
"body":"A test description",
"userId":1,
}
post_id = 1
url = "https://jsonplaceholder.typicode.com/posts/"
respo... | true | true |
f73b39d8786487f9bb8a01448117efe761f6f2a9 | 17,027 | py | Python | ciftify/utils.py | helloTC/ciftify | ca6b83c8d40cd384de54269d7c62281552b91e21 | [
"MIT"
] | 84 | 2016-09-19T16:34:37.000Z | 2022-03-31T05:47:05.000Z | ciftify/utils.py | helloTC/ciftify | ca6b83c8d40cd384de54269d7c62281552b91e21 | [
"MIT"
] | 108 | 2016-09-11T15:18:31.000Z | 2022-03-06T07:03:12.000Z | ciftify/utils.py | helloTC/ciftify | ca6b83c8d40cd384de54269d7c62281552b91e21 | [
"MIT"
] | 296 | 2016-09-15T17:18:26.000Z | 2022-01-17T18:16:11.000Z | #!/usr/bin/env python3
"""
A collection of utilities for the epitome pipeline. Mostly for getting
subject numbers/names, checking paths, gathering information, etc.
"""
import os
import sys
import copy
import datetime
import subprocess
import tempfile
import shutil
import logging
import math
import yaml
import ciftif... | 34.891393 | 95 | 0.611499 |
import os
import sys
import copy
import datetime
import subprocess
import tempfile
import shutil
import logging
import math
import yaml
import ciftify
logger = logging.getLogger(__name__)
def get_subj(path, user_filter=None):
subjects = []
if not os.path.exists(path):
return subjects
... | true | true |
f73b3bc4526a1302b638546a18fade37c3f8a0d5 | 7,204 | py | Python | plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py | lil-cain/holland | 67c787e4e0ab45c65ac9b7f6267cce9b76fc6c29 | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py | lil-cain/holland | 67c787e4e0ab45c65ac9b7f6267cce9b76fc6c29 | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py | lil-cain/holland | 67c787e4e0ab45c65ac9b7f6267cce9b76fc6c29 | [
"BSD-3-Clause"
] | null | null | null | """
holland.mysql.xtrabackup
~~~~~~~~~~~~~~~~~~~~~~~
Xtrabackup backup strategy plugin
"""
import sys
import logging
from os.path import join
from holland.core.backup import BackupError
from holland.core.util.path import directory_size
from holland.lib.compression import open_stream
from holland.backup.xtrabackup.mys... | 38.940541 | 126 | 0.567601 | """
holland.mysql.xtrabackup
~~~~~~~~~~~~~~~~~~~~~~~
Xtrabackup backup strategy plugin
"""
import sys
import logging
from os.path import join
from holland.core.backup import BackupError
from holland.core.util.path import directory_size
from holland.lib.compression import open_stream
from holland.backup.xtrabackup.mys... | false | true |
f73b3bf8742aec4a5fa706282b69adaa982fe8a4 | 2,433 | py | Python | tests/parsers/winfirewall.py | rgayon/plaso | 5f1d0f2da19a28a00ab62c276162483e79a42efb | [
"Apache-2.0"
] | 1 | 2020-12-04T10:26:34.000Z | 2020-12-04T10:26:34.000Z | tests/parsers/winfirewall.py | dvntaudio/plaso | 6debdabbce3619b3210efa2a2cbc91242c02d4e3 | [
"Apache-2.0"
] | null | null | null | tests/parsers/winfirewall.py | dvntaudio/plaso | 6debdabbce3619b3210efa2a2cbc91242c02d4e3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Windows firewall log parser."""
from __future__ import unicode_literals
import unittest
from plaso.parsers import winfirewall
from tests.parsers import test_lib
class WinFirewallParserTest(test_lib.ParserTestCase):
"""Tests for the Windows firewall... | 30.037037 | 78 | 0.704891 |
from __future__ import unicode_literals
import unittest
from plaso.parsers import winfirewall
from tests.parsers import test_lib
class WinFirewallParserTest(test_lib.ParserTestCase):
def testParse(self):
parser = winfirewall.WinFirewallParser()
storage_writer = self._ParseFile(['firewall.log'], parse... | true | true |
f73b3e10fe23095d94d6bb5a0219edef3d24254b | 6,046 | py | Python | thenewboston_node/business_logic/tests/test_memory_blockchain/test_partial_blockchain.py | fonar/thenewboston-node | e8b574b32b3f0ff6d19a764105558ba1f3b31bc2 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/tests/test_memory_blockchain/test_partial_blockchain.py | fonar/thenewboston-node | e8b574b32b3f0ff6d19a764105558ba1f3b31bc2 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/tests/test_memory_blockchain/test_partial_blockchain.py | fonar/thenewboston-node | e8b574b32b3f0ff6d19a764105558ba1f3b31bc2 | [
"MIT"
] | null | null | null | from datetime import datetime
from thenewboston_node.business_logic.blockchain.memory_blockchain import MemoryBlockchain
from thenewboston_node.business_logic.models import (
BlockchainStateMessage, CoinTransferSignedChangeRequest, PrimaryValidatorSchedule
)
from thenewboston_node.business_logic.models.account_sta... | 48.368 | 111 | 0.761164 | from datetime import datetime
from thenewboston_node.business_logic.blockchain.memory_blockchain import MemoryBlockchain
from thenewboston_node.business_logic.models import (
BlockchainStateMessage, CoinTransferSignedChangeRequest, PrimaryValidatorSchedule
)
from thenewboston_node.business_logic.models.account_sta... | true | true |
f73b3ea9a7dd613af4760157de8e5ba50e49db44 | 402 | py | Python | courses/migrations/0026_course_last_taught.py | Isaacli0520/msnmatch | 228c6d546e16bd54dc8c7e0803f0f8c408cb0219 | [
"MIT"
] | null | null | null | courses/migrations/0026_course_last_taught.py | Isaacli0520/msnmatch | 228c6d546e16bd54dc8c7e0803f0f8c408cb0219 | [
"MIT"
] | 18 | 2020-03-11T18:57:27.000Z | 2022-02-26T11:14:38.000Z | courses/migrations/0026_course_last_taught.py | Isaacli0520/msnmatch | 228c6d546e16bd54dc8c7e0803f0f8c408cb0219 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-08-29 21:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0025_courseuser_section'),
]
operations = [
migrations.AddField(
model_name='course',
name='last_taught',... | 21.157895 | 63 | 0.60199 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0025_courseuser_section'),
]
operations = [
migrations.AddField(
model_name='course',
name='last_taught',
field=models.CharField(default='',... | true | true |
f73b3f6f5fa09fc7ce1ff4de711ca83ebc8dceb2 | 1,220 | py | Python | djangocms_youtube/views.py | katlings/djangocms-youtube | 662566b15e68b57e3af5a825829bb5b99b0e91e5 | [
"BSD-3-Clause"
] | 42 | 2015-08-25T08:21:32.000Z | 2022-01-25T21:13:44.000Z | djangocms_youtube/views.py | katlings/djangocms-youtube | 662566b15e68b57e3af5a825829bb5b99b0e91e5 | [
"BSD-3-Clause"
] | 12 | 2016-01-20T15:25:45.000Z | 2018-06-21T11:38:54.000Z | djangocms_youtube/views.py | katlings/djangocms-youtube | 662566b15e68b57e3af5a825829bb5b99b0e91e5 | [
"BSD-3-Clause"
] | 25 | 2015-08-24T13:23:50.000Z | 2021-12-16T01:09:59.000Z | from django.contrib.sitemaps.views import x_robots_tag
from django.contrib.sites.shortcuts import get_current_site
from django.template.response import TemplateResponse
from .video_sitemap import VideoElement
@x_robots_tag
def video_sitemap(request, sitemaps,
template_name='djangocms_youtube/sitema... | 30.5 | 79 | 0.606557 | from django.contrib.sitemaps.views import x_robots_tag
from django.contrib.sites.shortcuts import get_current_site
from django.template.response import TemplateResponse
from .video_sitemap import VideoElement
@x_robots_tag
def video_sitemap(request, sitemaps,
template_name='djangocms_youtube/sitema... | true | true |
f73b3f81e1d6df883b47edd8ccfb0d53dd5a0962 | 6,406 | py | Python | tool.py | YaoJusheng/blog_photos | 77d85598f2c296fe845170628280f6d8b8324472 | [
"Apache-2.0"
] | null | null | null | tool.py | YaoJusheng/blog_photos | 77d85598f2c296fe845170628280f6d8b8324472 | [
"Apache-2.0"
] | null | null | null | tool.py | YaoJusheng/blog_photos | 77d85598f2c296fe845170628280f6d8b8324472 | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/python3
# -*- coding: utf-8 -*-
from PIL import Image
import os
import sys
import json
from datetime import datetime
from ImageProcess import Graphics
# 定义压缩比,数值越大,压缩越小
SIZE_normal = 1.0
SIZE_small = 1.5
SIZE_more_small = 2.0
SIZE_more_small_small = 3.0
def make_directory(directory):
"""创建目录"""
o... | 25.726908 | 78 | 0.547924 |
from PIL import Image
import os
import sys
import json
from datetime import datetime
from ImageProcess import Graphics
SIZE_normal = 1.0
SIZE_small = 1.5
SIZE_more_small = 2.0
SIZE_more_small_small = 3.0
def make_directory(directory):
os.makedirs(directory)
def directory_exists(directory):
if os.path.ex... | true | true |
f73b3fed9de3eefd4ba51684c70c0f9b43344685 | 5,702 | py | Python | ethereum_parser.py | TheCharlatan/blockchain-parser | 34d4c85ffee0e39978e5dea1f50cfd995a83a321 | [
"MIT"
] | null | null | null | ethereum_parser.py | TheCharlatan/blockchain-parser | 34d4c85ffee0e39978e5dea1f50cfd995a83a321 | [
"MIT"
] | null | null | null | ethereum_parser.py | TheCharlatan/blockchain-parser | 34d4c85ffee0e39978e5dea1f50cfd995a83a321 | [
"MIT"
] | null | null | null | import threading
from typing import NamedTuple
import zmq
from database import BLOCKCHAIN, DATATYPE, Database
from ethereum_blockchain_iterator import (
ParseEthereumBlockBodies,
ParseEthereumBlockHeaders,
)
from parser import DataExtractor
from pathlib import Path
ERC20_TRANSFER_METHOD_ID = bytes.fromhex("a9... | 36.088608 | 107 | 0.63469 | import threading
from typing import NamedTuple
import zmq
from database import BLOCKCHAIN, DATATYPE, Database
from ethereum_blockchain_iterator import (
ParseEthereumBlockBodies,
ParseEthereumBlockHeaders,
)
from parser import DataExtractor
from pathlib import Path
ERC20_TRANSFER_METHOD_ID = bytes.fromhex("a9... | true | true |
f73b402cabae49c31df20d71d6b05fb65aeb8bf0 | 7,184 | py | Python | scripts/compare_speed_with_pytorch.py | LiuHaolan/models | 1639b3039237c3997c51ff87f0b6113bb2e8d236 | [
"Apache-2.0"
] | 43 | 2021-06-03T09:07:08.000Z | 2022-03-31T15:21:48.000Z | scripts/compare_speed_with_pytorch.py | LiuHaolan/models | 1639b3039237c3997c51ff87f0b6113bb2e8d236 | [
"Apache-2.0"
] | 64 | 2021-05-31T10:34:06.000Z | 2022-01-17T03:44:58.000Z | scripts/compare_speed_with_pytorch.py | LiuHaolan/models | 1639b3039237c3997c51ff87f0b6113bb2e8d236 | [
"Apache-2.0"
] | 37 | 2021-07-04T03:13:18.000Z | 2022-03-25T07:30:47.000Z | import numpy as np
import time
import tempfile
import os
import importlib.util
import argparse
from typing import Sequence
import subprocess
import re
import oneflow as flow
import oneflow._oneflow_internal as oneflow_internal
DEFAULT_TIMES = 20
gpu_memory_used_by_oneflow = 0
def import_file(path):
spec = im... | 30.312236 | 379 | 0.605651 | import numpy as np
import time
import tempfile
import os
import importlib.util
import argparse
from typing import Sequence
import subprocess
import re
import oneflow as flow
import oneflow._oneflow_internal as oneflow_internal
DEFAULT_TIMES = 20
gpu_memory_used_by_oneflow = 0
def import_file(path):
spec = im... | true | true |
f73b411094168bf3eff7b282b64c4c9ae1401d29 | 242 | py | Python | python/testData/inspections/ImplementAbstractProperty1.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/ImplementAbstractProperty1.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/ImplementAbstractProperty1.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from abc import ABC, abstractproperty
class Base(ABC):
@abstract
@property
def some_method(self):
pass
class <weak_warning descr="Class Sub must implement all abstract methods">S<caret>ub</weak_warning>(Base):
pass | 20.166667 | 106 | 0.706612 | from abc import ABC, abstractproperty
class Base(ABC):
@abstract
@property
def some_method(self):
pass
class <weak_warning descr="Class Sub must implement all abstract methods">S<caret>ub</weak_warning>(Base):
pass | false | true |
f73b41134fa2ad59b6f89c5c8c24a732c2c22fdc | 444 | py | Python | dictol/base.py | ksasi/DICTOL_python | d2ea3f2a2fdb07c76e63d75e11edf9c8b11d9e69 | [
"MIT"
] | 62 | 2017-02-17T13:30:45.000Z | 2022-03-14T04:04:17.000Z | dictol/base.py | ksasi/DICTOL_python | d2ea3f2a2fdb07c76e63d75e11edf9c8b11d9e69 | [
"MIT"
] | 7 | 2019-03-03T00:47:28.000Z | 2022-03-21T09:37:12.000Z | dictol/base.py | ksasi/DICTOL_python | d2ea3f2a2fdb07c76e63d75e11edf9c8b11d9e69 | [
"MIT"
] | 31 | 2017-07-27T01:36:48.000Z | 2022-03-31T09:08:50.000Z | from __future__ import print_function
import numpy as np
class BaseModel(object):
"""
base dictionary learning model for classification
"""
# def __init__(self)
def predict(self, data):
raise NotImplementedError
def evaluate(self, data, label):
pred = self.predict(data)
... | 22.2 | 54 | 0.628378 | from __future__ import print_function
import numpy as np
class BaseModel(object):
def predict(self, data):
raise NotImplementedError
def evaluate(self, data, label):
pred = self.predict(data)
acc = np.sum(pred == label)/float(len(label))
print('accuracy = {:.2f} %'.forma... | true | true |
f73b4114abe493c623045d4db9002ec8b758e179 | 362 | py | Python | src/mailing_list/management/commands/create_email_recipients.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/mailing_list/management/commands/create_email_recipients.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/mailing_list/management/commands/create_email_recipients.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | from django.core.management.base import BaseCommand
from user.models import User
from mailing_list.models import EmailRecipient
class Command(BaseCommand):
def handle(self, *args, **options):
for user in User.objects.filter(emailrecipient__isnull=True, email__isnull=False):
EmailRecipient.obj... | 30.166667 | 90 | 0.765193 | from django.core.management.base import BaseCommand
from user.models import User
from mailing_list.models import EmailRecipient
class Command(BaseCommand):
def handle(self, *args, **options):
for user in User.objects.filter(emailrecipient__isnull=True, email__isnull=False):
EmailRecipient.obj... | true | true |
f73b42c9eac942cc2b14af35f4cf34df15fc74c4 | 3,070 | py | Python | src/livecli/cache.py | NghiemTrung/livecli | 6a21b1b144b045963b6d1db8d4d8dc8471b62737 | [
"BSD-2-Clause"
] | 1 | 2019-12-04T11:54:52.000Z | 2019-12-04T11:54:52.000Z | src/livecli/cache.py | NghiemTrung/livecli | 6a21b1b144b045963b6d1db8d4d8dc8471b62737 | [
"BSD-2-Clause"
] | null | null | null | src/livecli/cache.py | NghiemTrung/livecli | 6a21b1b144b045963b6d1db8d4d8dc8471b62737 | [
"BSD-2-Clause"
] | null | null | null | import json
import os
import shutil
import tempfile
from time import time
from .compat import is_win32
try:
import xbmc
import xbmcvfs
is_kodi = True
except ImportError:
is_kodi = False
if is_win32 and not is_kodi:
xdg_cache = os.environ.get("APPDATA",
os.path.expan... | 26.465517 | 104 | 0.56873 | import json
import os
import shutil
import tempfile
from time import time
from .compat import is_win32
try:
import xbmc
import xbmcvfs
is_kodi = True
except ImportError:
is_kodi = False
if is_win32 and not is_kodi:
xdg_cache = os.environ.get("APPDATA",
os.path.expan... | true | true |
f73b4384882e3c3e76ca54a7bef8e31c44db8bd4 | 586 | py | Python | simpleticket/urls.py | jalvinronnie/SU-Portal | 7c881cd13e32eaccc1095095324b7ff084fbf403 | [
"MIT"
] | null | null | null | simpleticket/urls.py | jalvinronnie/SU-Portal | 7c881cd13e32eaccc1095095324b7ff084fbf403 | [
"MIT"
] | 1 | 2020-06-05T22:09:04.000Z | 2020-06-05T22:09:04.000Z | simpleticket/urls.py | jalvinronnie/SU-Portal | 7c881cd13e32eaccc1095095324b7ff084fbf403 | [
"MIT"
] | 1 | 2019-07-28T08:59:26.000Z | 2019-07-28T08:59:26.000Z | from django.urls import path
from simpleticket import views
urlpatterns = [
path('', views.view_all),
path('view/<int:ticket_id>/', views.view),
path('new/', views.create),
path('submit_ticket/', views.submit_ticket),
path('update/<int:ticket_id>/', views.update),
path('update_ticket/<int:tick... | 34.470588 | 67 | 0.687713 | from django.urls import path
from simpleticket import views
urlpatterns = [
path('', views.view_all),
path('view/<int:ticket_id>/', views.view),
path('new/', views.create),
path('submit_ticket/', views.submit_ticket),
path('update/<int:ticket_id>/', views.update),
path('update_ticket/<int:tick... | true | true |
f73b455a7ce132aa0f3b300ddb962738610ca1f9 | 14,157 | py | Python | vulnerabilities/tests/test_api.py | keshav-space/vulnerablecode | 8ccb2026c084c42d075c629fe182feaa22c07830 | [
"Apache-2.0"
] | null | null | null | vulnerabilities/tests/test_api.py | keshav-space/vulnerablecode | 8ccb2026c084c42d075c629fe182feaa22c07830 | [
"Apache-2.0"
] | null | null | null | vulnerabilities/tests/test_api.py | keshav-space/vulnerablecode | 8ccb2026c084c42d075c629fe182feaa22c07830 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in comp... | 41.034783 | 132 | 0.594335 |
import os
from collections import OrderedDict
from random import choices
from unittest.mock import MagicMock
from urllib.parse import quote
from django.test import TestCase
from django.test.client import RequestFactory
from rest_framework.test import APIClient
from rest_framework.test import API... | true | true |
f73b45ab3dcd1386e68fd473096beef00d83178e | 801 | py | Python | Codes/gracekoo/401_binary-watch.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 256 | 2017-10-25T13:02:15.000Z | 2022-02-25T13:47:59.000Z | Codes/gracekoo/401_binary-watch.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 56 | 2017-10-27T01:34:20.000Z | 2022-03-01T00:20:55.000Z | Codes/gracekoo/401_binary-watch.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 83 | 2017-10-25T12:51:53.000Z | 2022-02-15T08:27:03.000Z | # -*- coding: utf-8 -*-
# @Time: 2020/4/20 12:38
# @Author: GraceKoo
# @File: 401_binary-watch.py
# @Desc:https://leetcode-cn.com/problems/binary-watch/
from typing import List
class Solution:
def readBinaryWatch(self, num: int) -> List[str]:
def count_binary_1(i):
return bin(i).count("1")
... | 27.62069 | 63 | 0.533084 |
from typing import List
class Solution:
def readBinaryWatch(self, num: int) -> List[str]:
def count_binary_1(i):
return bin(i).count("1")
dict_binary = {i: count_binary_1(i) for i in range(60)}
res = []
for h in range(12):
for m in range(60):
... | true | true |
f73b45f07187cda26b47f1f1bb05b9510b5120ea | 25,069 | py | Python | tags/commands.py | zephyrkul/phen-cogs | 656cbab522ed085d70850da1a066c170cbbe92ed | [
"MIT"
] | null | null | null | tags/commands.py | zephyrkul/phen-cogs | 656cbab522ed085d70850da1a066c170cbbe92ed | [
"MIT"
] | null | null | null | tags/commands.py | zephyrkul/phen-cogs | 656cbab522ed085d70850da1a066c170cbbe92ed | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-2021 phenom4n4n
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 36.704246 | 142 | 0.610475 |
import asyncio
import logging
import re
import time
import types
from typing import Dict, List, Optional, Set, Union
from urllib.parse import quote_plus
import bs4
import discord
import TagScriptEngine as tse
from redbot.core import commands
from redbot.core.config import Config
from redbot.core.utils import AsyncIte... | true | true |
f73b4603424ab56c8da38e2187352b7ea67f7ba4 | 1,087 | py | Python | invenio_app_ils/ill/serializers/custom_fields.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 41 | 2018-09-04T13:00:46.000Z | 2022-03-24T20:45:56.000Z | invenio_app_ils/ill/serializers/custom_fields.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 720 | 2017-03-10T08:02:41.000Z | 2022-01-14T15:36:37.000Z | invenio_app_ils/ill/serializers/custom_fields.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 54 | 2017-03-09T16:05:29.000Z | 2022-03-17T08:34:51.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Loan custom serializer functions."""
from invenio_circulation.proxies import current_circulation
from invenio_... | 32.939394 | 76 | 0.689052 |
from invenio_circulation.proxies import current_circulation
from invenio_pidstore.errors import PIDDeletedError, PIDDoesNotExistError
from invenio_app_ils.records.jsonresolvers.api import pick
def field_loan(metadata):
loan_pid = metadata.get("patron_loan", {}).get("pid")
if not loan_pid:
ret... | true | true |
f73b4671798894fdb3235d53eb60a03b2707502f | 23,875 | py | Python | tests/integration/test_keeper_back_to_back/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 15,577 | 2019-09-23T11:57:53.000Z | 2022-03-31T18:21:48.000Z | tests/integration/test_keeper_back_to_back/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 16,476 | 2019-09-23T11:47:00.000Z | 2022-03-31T23:06:01.000Z | tests/integration/test_keeper_back_to_back/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 3,633 | 2019-09-23T12:18:28.000Z | 2022-03-31T15:55:48.000Z | import pytest
from helpers.cluster import ClickHouseCluster
import random
import string
import os
import time
from multiprocessing.dummy import Pool
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', main_configs=['configs/enable_keeper.xml'], with_zookeeper=True, use_keeper=False)
from kazoo.cl... | 36.562021 | 156 | 0.633257 | import pytest
from helpers.cluster import ClickHouseCluster
import random
import string
import os
import time
from multiprocessing.dummy import Pool
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', main_configs=['configs/enable_keeper.xml'], with_zookeeper=True, use_keeper=False)
from kazoo.cl... | true | true |
f73b46b26aa68b33f42d16333517bedecfca15eb | 2,222 | py | Python | growth/cells/cells.py | sebastianbernasek/growth | 6d1cace75b19ad8b6130d0940584c24dd26bbe91 | [
"MIT"
] | 1 | 2022-03-01T14:48:14.000Z | 2022-03-01T14:48:14.000Z | growth/cells/cells.py | sbernasek/growth | 6d1cace75b19ad8b6130d0940584c24dd26bbe91 | [
"MIT"
] | null | null | null | growth/cells/cells.py | sbernasek/growth | 6d1cace75b19ad8b6130d0940584c24dd26bbe91 | [
"MIT"
] | null | null | null | from os.path import join
import numpy as np
from functools import reduce
from operator import add
class Cell:
def __init__(self, xy=None, chromosomes=None, lineage=''):
# set generation
self.lineage = lineage
# set chromosomes
if chromosomes is None:
chromosomes = np... | 25.837209 | 79 | 0.60486 | from os.path import join
import numpy as np
from functools import reduce
from operator import add
class Cell:
def __init__(self, xy=None, chromosomes=None, lineage=''):
self.lineage = lineage
if chromosomes is None:
chromosomes = np.array([0, 1])
self.chrom... | true | true |
f73b47001626570e7f6ff47c0c386a4ef1d7d657 | 392 | py | Python | recursion/tail/power_of_two.py | MelkiyHondavod/computations | 5ccb28c2021270e25c23ae9836979ae63febc66a | [
"Apache-2.0"
] | null | null | null | recursion/tail/power_of_two.py | MelkiyHondavod/computations | 5ccb28c2021270e25c23ae9836979ae63febc66a | [
"Apache-2.0"
] | null | null | null | recursion/tail/power_of_two.py | MelkiyHondavod/computations | 5ccb28c2021270e25c23ae9836979ae63febc66a | [
"Apache-2.0"
] | 4 | 2020-12-16T18:12:02.000Z | 2021-06-05T08:45:26.000Z | #Дано натуральное число N. Выведите слово YES, если число N является точной степенью двойки, или слово NO в противном случае.
#Операцией возведения в степень пользоваться нельзя!
# Оформите в виде обычной и хвостовой рекурсии
# Вариант с хвостовой рекурсией преобразуйте в цикл while
def is_power_of_two(N):
r... | 28 | 126 | 0.75 |
def is_power_of_two(N):
return 'YES'
def is_power_of_two_tail(N, n):
return 'YES'
| true | true |
f73b4774199c20095648e24e622c1ae1a33199bc | 5,614 | py | Python | google/ads/google_ads/v2/proto/services/shopping_performance_view_service_pb2.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v2/proto/services/shopping_performance_view_service_pb2.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v2/proto/services/shopping_performance_view_service_pb2.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v2/proto/services/shopping_performance_view_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from go... | 51.504587 | 1,045 | 0.82508 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f73b4856009641882adbb56e61af6046f93e30fe | 4,033 | py | Python | evaluation/Traditional/eval_metrics/rouge/rouge.py | Guaguago/CommonGen | 0a81b4edb8cd111571eba817eb994420f1070c48 | [
"MIT"
] | 100 | 2020-01-30T08:14:25.000Z | 2022-03-30T08:59:33.000Z | evaluation/Traditional/eval_metrics/rouge/rouge.py | Guaguago/CommonGen | 0a81b4edb8cd111571eba817eb994420f1070c48 | [
"MIT"
] | 4 | 2021-06-08T22:34:33.000Z | 2022-03-12T00:50:13.000Z | evaluation/Traditional/eval_metrics/rouge/rouge.py | Guaguago/CommonGen | 0a81b4edb8cd111571eba817eb994420f1070c48 | [
"MIT"
] | 15 | 2020-04-13T22:56:27.000Z | 2022-03-10T02:44:26.000Z | #!/usr/bin/env python
#
# File Name : rouge.py
#
# Description : Computes ROUGE-L metric as described by Lin and Hovey (2004)
#
# Creation Date : 2015-01-07 06:03
# Author : Ramakrishna Vedantam <vrama91@vt.edu>
import numpy as np
import pdb
def my_lcs(string, sub):
"""
Calculates longest common subsequence ... | 34.767241 | 123 | 0.604513 |
import numpy as np
import pdb
def my_lcs(string, sub):
if(len(string)< len(sub)):
sub, string = string, sub
lengths = [[0 for i in range(0,len(sub)+1)] for j in range(0,len(string)+1)]
for j in range(1,len(sub)+1):
for i in range(1,len(string)+1):
if(string[i-1] == su... | true | true |
f73b486dbb5003f07d093a2a0505b70af55d1f5c | 432 | py | Python | data/gunicorn.conf.py | Fenthick/sla_dashboard_webapp | fe7409b916f2c0504dd8fd097a2f6c5ba5f77b60 | [
"Apache-2.0"
] | null | null | null | data/gunicorn.conf.py | Fenthick/sla_dashboard_webapp | fe7409b916f2c0504dd8fd097a2f6c5ba5f77b60 | [
"Apache-2.0"
] | null | null | null | data/gunicorn.conf.py | Fenthick/sla_dashboard_webapp | fe7409b916f2c0504dd8fd097a2f6c5ba5f77b60 | [
"Apache-2.0"
] | null | null | null | # For more settings, see: https://docs.gunicorn.org/en/stable/settings.html
import multiprocessing
wsgi_app = "main:run()"
workers = 1
worker_connections = 100
bind = ":8050"
timeout = 30
# Worker is changed to prevent worker timeouts
# See: https://github.com/benoitc/gunicorn/issues/1801#issuecomment-585886471
worke... | 30.857143 | 91 | 0.761574 |
import multiprocessing
wsgi_app = "main:run()"
workers = 1
worker_connections = 100
bind = ":8050"
timeout = 30
d"
threads = 2 * multiprocessing.cpu_count() + 1
| true | true |
f73b48a4775565b9308c93076603d2d095dda06f | 1,050 | py | Python | doc/tutorials/examples/gateways/appengine/demo/simplejson/tests/test_unicode.py | elmordo/Py3AMF | ac12211459d6e11de3fb4f03a43bc0e688c6c1f6 | [
"MIT"
] | 87 | 2015-01-25T14:54:00.000Z | 2021-11-16T13:12:40.000Z | doc/tutorials/examples/gateways/appengine/demo/simplejson/tests/test_unicode.py | thijstriemstra/pyamf | d13915dfc68d06eb69ffc3e4e2a23257383568cc | [
"MIT"
] | 36 | 2015-01-05T01:24:59.000Z | 2021-09-15T20:40:33.000Z | doc/tutorials/examples/gateways/appengine/demo/simplejson/tests/test_unicode.py | thijstriemstra/pyamf | d13915dfc68d06eb69ffc3e4e2a23257383568cc | [
"MIT"
] | 37 | 2015-01-04T03:31:28.000Z | 2022-01-20T04:38:49.000Z | import simplejson as S
def test_encoding1():
encoder = S.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = encoder.encode(s)
assert ju == js
def test_encoding2():
u = u'\N{GREEK SMALL LETTER... | 28.378378 | 69 | 0.58381 | import simplejson as S
def test_encoding1():
encoder = S.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = encoder.encode(s)
assert ju == js
def test_encoding2():
u = u'\N{GREEK SMALL LETTER... | true | true |
f73b48aee603d440f4c06e828cbd0f393ff152ca | 10,179 | py | Python | custom_components/emporia_vue/__init__.py | nkm8/ha-emporia-vue | e21924e9edf19206c481f9cc4098388bce896122 | [
"MIT"
] | null | null | null | custom_components/emporia_vue/__init__.py | nkm8/ha-emporia-vue | e21924e9edf19206c481f9cc4098388bce896122 | [
"MIT"
] | null | null | null | custom_components/emporia_vue/__init__.py | nkm8/ha-emporia-vue | e21924e9edf19206c481f9cc4098388bce896122 | [
"MIT"
] | null | null | null | """The Emporia Vue integration."""
import asyncio
from datetime import datetime, timedelta
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
import logging
from pyemvue import PyEmVue
from pyemvue.device import VueDeviceChannel
from pyemvue.enums import Scale
import voluptuous a... | 37.840149 | 108 | 0.558896 | import asyncio
from datetime import datetime, timedelta
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
import logging
from pyemvue import PyEmVue
from pyemvue.device import VueDeviceChannel
from pyemvue.enums import Scale
import voluptuous as vol
from homeassistant.config_en... | true | true |
f73b4969d19bb8629ca74db252d01808d03ce2f3 | 838 | py | Python | tests/system/verbs/catkin_init/test_init.py | lucasw/catkin_tools | 0918ea5865014053bd5786b629001d70e02a314c | [
"Apache-2.0"
] | 1 | 2020-07-26T12:55:29.000Z | 2020-07-26T12:55:29.000Z | tests/system/verbs/catkin_init/test_init.py | lucasw/catkin_tools | 0918ea5865014053bd5786b629001d70e02a314c | [
"Apache-2.0"
] | null | null | null | tests/system/verbs/catkin_init/test_init.py | lucasw/catkin_tools | 0918ea5865014053bd5786b629001d70e02a314c | [
"Apache-2.0"
] | null | null | null | import os
from ....utils import catkin_success
from ....utils import in_temporary_directory
from ....utils import redirected_stdio
from ....workspace_assertions import assert_no_warnings
from ....workspace_assertions import assert_warning_message
from ....workspace_assertions import assert_workspace_initialized
@in_... | 31.037037 | 73 | 0.747017 | import os
from ....utils import catkin_success
from ....utils import in_temporary_directory
from ....utils import redirected_stdio
from ....workspace_assertions import assert_no_warnings
from ....workspace_assertions import assert_warning_message
from ....workspace_assertions import assert_workspace_initialized
@in_... | true | true |
f73b4b3e6edad5363e7eb09c70bb78ae1f39dea3 | 149,485 | py | Python | src/azure-cli/azure/cli/command_modules/acs/custom.py | avoidik/azure-cli | 93a50bb7beb93834978e57141dd07572b98809ac | [
"MIT"
] | 1 | 2021-09-07T18:53:01.000Z | 2021-09-07T18:53:01.000Z | src/azure-cli/azure/cli/command_modules/acs/custom.py | andyliuliming/azure-cli | fd1c96077c8dd57b168439b6280009d84d40c7f5 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/acs/custom.py | andyliuliming/azure-cli | fd1c96077c8dd57b168439b6280009d84d40c7f5 | [
"MIT"
] | 1 | 2020-11-12T01:49:27.000Z | 2020-11-12T01:49:27.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.202601 | 222 | 0.658347 |
from __future__ import print_function
import binascii
import datetime
import errno
import json
import os
import os.path
import platform
import random
import re
import ssl
import stat
import string
import subprocess
import sys
import tempfile
import threading
import time
import uuid
import webbrowser
from six.moves... | true | true |
f73b4b54ccb5ccc4dfa18a8a22dfa8a4d5a1fa3e | 1,971 | py | Python | selfdrive/debug/cycle_alerts.py | tobylinjs/openpilot | 6c525691e9943cb88096b1d94c1c29cc4b22369f | [
"MIT"
] | null | null | null | selfdrive/debug/cycle_alerts.py | tobylinjs/openpilot | 6c525691e9943cb88096b1d94c1c29cc4b22369f | [
"MIT"
] | null | null | null | selfdrive/debug/cycle_alerts.py | tobylinjs/openpilot | 6c525691e9943cb88096b1d94c1c29cc4b22369f | [
"MIT"
] | 2 | 2020-11-30T23:10:07.000Z | 2020-12-01T15:53:03.000Z | #!/usr/bin/env python3
# flake8: noqa
# pylint: skip-file
# type: ignore
import time
import cereal.messaging as messaging
from selfdrive.car.honda.interface import CarInterface
from selfdrive.controls.lib.events import ET, EVENTS, Events
from selfdrive.controls.lib.alertmanager import AlertManager
def cycle_alerts(... | 28.565217 | 90 | 0.68899 |
import time
import cereal.messaging as messaging
from selfdrive.car.honda.interface import CarInterface
from selfdrive.controls.lib.events import ET, EVENTS, Events
from selfdrive.controls.lib.alertmanager import AlertManager
def cycle_alerts(duration=200, is_metric=False):
alerts = list(EVENTS.keys())
prin... | true | true |
f73b4b9a37043f259e772fd116cf096efcbdb51e | 3,374 | py | Python | detectron2/modeling/proposal_generator/rrpn.py | dnandha/grraspn | 0a660d3f73487ea2f8caabf791809de283e8b806 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/proposal_generator/rrpn.py | dnandha/grraspn | 0a660d3f73487ea2f8caabf791809de283e8b806 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/proposal_generator/rrpn.py | dnandha/grraspn | 0a660d3f73487ea2f8caabf791809de283e8b806 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from typing import Dict
import torch
from detectron2.layers import ShapeSpec
from ..box_regression import Box2BoxTransformRotated
from .build import PROPOSAL_GENERATOR_REGISTRY
from .rpn import RPN
from .rrpn_outputs import RRPNOutp... | 37.910112 | 96 | 0.630113 |
import logging
from typing import Dict
import torch
from detectron2.layers import ShapeSpec
from ..box_regression import Box2BoxTransformRotated
from .build import PROPOSAL_GENERATOR_REGISTRY
from .rpn import RPN
from .rrpn_outputs import RRPNOutputs, find_top_rrpn_proposals
logger = logging.getLogger(__name__)
@... | true | true |
f73b4ba632336be8c5be6b4dd6a69eee2a3f8f66 | 5,307 | py | Python | dcbench/common/modeling.py | data-centric-ai/dcbench | 831ab2359d686739d0b0c7a589974ce08448e58d | [
"Apache-2.0"
] | 40 | 2021-11-06T00:16:20.000Z | 2022-03-17T11:45:00.000Z | dcbench/common/modeling.py | data-centric-ai/dcbench | 831ab2359d686739d0b0c7a589974ce08448e58d | [
"Apache-2.0"
] | 1 | 2022-01-01T14:40:19.000Z | 2022-01-04T05:25:04.000Z | dcbench/common/modeling.py | data-centric-ai/dcbench | 831ab2359d686739d0b0c7a589974ce08448e58d | [
"Apache-2.0"
] | 5 | 2021-11-17T17:15:41.000Z | 2021-12-31T06:45:13.000Z | from abc import abstractmethod
import PIL
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.hub import load_state_dict_from_url
from torchvision.models import DenseNet as _DenseNet
from torchvision.models import ResNet as _ResNet
from torchvision.m... | 31.035088 | 88 | 0.618805 | from abc import abstractmethod
import PIL
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.hub import load_state_dict_from_url
from torchvision.models import DenseNet as _DenseNet
from torchvision.models import ResNet as _ResNet
from torchvision.m... | true | true |
f73b4bb06333f21f4b607945e4cbb10da1175c58 | 6,389 | py | Python | autossl/server/incapsula.py | rootheory/AutoSSL | d0f28653f68dbc5455f5027c1f35e2978275b3ec | [
"MIT"
] | null | null | null | autossl/server/incapsula.py | rootheory/AutoSSL | d0f28653f68dbc5455f5027c1f35e2978275b3ec | [
"MIT"
] | null | null | null | autossl/server/incapsula.py | rootheory/AutoSSL | d0f28653f68dbc5455f5027c1f35e2978275b3ec | [
"MIT"
] | null | null | null | import base64
import datetime
import json
import logging
import time
import requests
from .. import exception, ssl
from . import base
logger = logging.getLogger(__name__)
class IncapsulaSite(base.Server):
BASE_URL = "https://my.incapsula.com:443"
def __init__(self, api_key, api_id, site_id, crt_name, **k... | 42.593333 | 118 | 0.631085 | import base64
import datetime
import json
import logging
import time
import requests
from .. import exception, ssl
from . import base
logger = logging.getLogger(__name__)
class IncapsulaSite(base.Server):
BASE_URL = "https://my.incapsula.com:443"
def __init__(self, api_key, api_id, site_id, crt_name, **k... | true | true |
f73b4ca6b926417368bedf7c1e713ad258349646 | 16,911 | py | Python | SpiceyPy/support_types.py | johnnycakes79/SpiceyPy | 7b63a1555df0adb7926cf5a6cfff14746a9dc4c1 | [
"MIT"
] | null | null | null | SpiceyPy/support_types.py | johnnycakes79/SpiceyPy | 7b63a1555df0adb7926cf5a6cfff14746a9dc4c1 | [
"MIT"
] | null | null | null | SpiceyPy/support_types.py | johnnycakes79/SpiceyPy | 7b63a1555df0adb7926cf5a6cfff14746a9dc4c1 | [
"MIT"
] | null | null | null | # Collection of supporting functions for wrapper functions
__author__ = 'AndrewAnnex'
from ctypes import c_char_p, c_bool, c_int, c_double, c_char, c_void_p, sizeof, \
POINTER, pointer, Array, create_string_buffer, create_unicode_buffer, cast, Structure, \
CFUNCTYPE, string_at
import numpy
from numpy import ct... | 28.091362 | 240 | 0.600911 |
__author__ = 'AndrewAnnex'
from ctypes import c_char_p, c_bool, c_int, c_double, c_char, c_void_p, sizeof, \
POINTER, pointer, Array, create_string_buffer, create_unicode_buffer, cast, Structure, \
CFUNCTYPE, string_at
import numpy
from numpy import ctypeslib as numpc
import six
errorformat = """
===========... | true | true |
f73b4d3ca2fe5333ca7d75c1015f0972eed3cc83 | 1,993 | py | Python | NewClassifier.py | Youssefares/IMDB-sentiment-analysis | 18e6037c15c2011aa49b6118fb1182de548ff9ba | [
"MIT"
] | null | null | null | NewClassifier.py | Youssefares/IMDB-sentiment-analysis | 18e6037c15c2011aa49b6118fb1182de548ff9ba | [
"MIT"
] | null | null | null | NewClassifier.py | Youssefares/IMDB-sentiment-analysis | 18e6037c15c2011aa49b6118fb1182de548ff9ba | [
"MIT"
] | null | null | null | from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, BaggingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
f... | 30.661538 | 90 | 0.696939 | from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, BaggingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
f... | true | true |
f73b4ee6ffa382f136f373d379b64ccf08de3d1e | 22,210 | py | Python | python/ccxt/async_support/gateio.py | Bhanditz/ccxt | 5b38d79a315ca9ce70cc7c659033caa831c27fc6 | [
"MIT"
] | 1 | 2020-12-28T05:10:32.000Z | 2020-12-28T05:10:32.000Z | python/ccxt/async_support/gateio.py | Bhanditz/ccxt | 5b38d79a315ca9ce70cc7c659033caa831c27fc6 | [
"MIT"
] | null | null | null | python/ccxt/async_support/gateio.py | Bhanditz/ccxt | 5b38d79a315ca9ce70cc7c659033caa831c27fc6 | [
"MIT"
] | 2 | 2019-03-31T00:03:07.000Z | 2019-04-08T21:27:44.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 38.35924 | 126 | 0.509005 |
rt.base.exchange import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidAddress
from ccxt.... | true | true |
f73b4f1ffaf332c07660ce22f9e71bf93045384a | 632 | py | Python | www/apps/profiles/admin/job.py | un33k/outsourcefactor | c48dbd11b74ba5fb72b85f05c431a16287f62507 | [
"MIT"
] | 2 | 2018-12-23T04:14:32.000Z | 2018-12-23T15:02:08.000Z | www/apps/profiles/admin/job.py | un33k/outsourcefactor | c48dbd11b74ba5fb72b85f05c431a16287f62507 | [
"MIT"
] | null | null | null | www/apps/profiles/admin/job.py | un33k/outsourcefactor | c48dbd11b74ba5fb72b85f05c431a16287f62507 | [
"MIT"
] | 1 | 2019-11-17T19:53:07.000Z | 2019-11-17T19:53:07.000Z | from django.contrib import admin
class JobPostAdmin(admin.ModelAdmin):
list_display = (
'id',
'user',
'title',
'slug',
'employment_option',
'wage_salary',
'start_date',
'bookmarked',
'bookmarked',
... | 19.75 | 37 | 0.427215 | from django.contrib import admin
class JobPostAdmin(admin.ModelAdmin):
list_display = (
'id',
'user',
'title',
'slug',
'employment_option',
'wage_salary',
'start_date',
'bookmarked',
'bookmarked',
... | true | true |
f73b4f408bc99bcd38ca01772eb08e3c31efec72 | 2,915 | py | Python | memote/experimental/growth.py | matthiaskoenig/memote | 7c14cd304523dda83eaf4835ee007243e8673f85 | [
"Apache-2.0"
] | null | null | null | memote/experimental/growth.py | matthiaskoenig/memote | 7c14cd304523dda83eaf4835ee007243e8673f85 | [
"Apache-2.0"
] | null | null | null | memote/experimental/growth.py | matthiaskoenig/memote | 7c14cd304523dda83eaf4835ee007243e8673f85 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | 32.752809 | 98 | 0.630189 |
from __future__ import absolute_import
import logging
from pandas import DataFrame
from memote.experimental.experiment import Experiment
__all__ = ("GrowthExperiment",)
LOGGER = logging.getLogger(__name__)
class GrowthExperiment(Experiment):
SCHEMA = "growth.json"
def __init__(self, *... | true | true |
f73b50821cf4fcc5259c856d808d3de247a21219 | 1,321 | py | Python | platon_env/utils/key/keytool.py | shinnng/platon-env | c1adba15a53ea2757fc94904c12b606a9d220b76 | [
"MIT"
] | null | null | null | platon_env/utils/key/keytool.py | shinnng/platon-env | c1adba15a53ea2757fc94904c12b606a9d220b76 | [
"MIT"
] | null | null | null | platon_env/utils/key/keytool.py | shinnng/platon-env | c1adba15a53ea2757fc94904c12b606a9d220b76 | [
"MIT"
] | null | null | null | import os
import sys
from platon_keys import keys
from platon_utils.curried import keccak, text_if_str, to_bytes
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def gen_node_keypair(extra_entropy=''):
extra_key_bytes = text_if_str(to_bytes, extra_entropy)
key_bytes = keccak(os.urandom(32) + extra_key_... | 32.219512 | 94 | 0.692657 | import os
import sys
from platon_keys import keys
from platon_utils.curried import keccak, text_if_str, to_bytes
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def gen_node_keypair(extra_entropy=''):
extra_key_bytes = text_if_str(to_bytes, extra_entropy)
key_bytes = keccak(os.urandom(32) + extra_key_... | true | true |
f73b50b00c8b1f0c9fd9f703afa444be20424b30 | 999 | py | Python | examples/data.py | LilJohny/CourseProject | 8c16a44516a7de4086bb124eac9ebc6f9d3b606a | [
"MIT"
] | null | null | null | examples/data.py | LilJohny/CourseProject | 8c16a44516a7de4086bb124eac9ebc6f9d3b606a | [
"MIT"
] | 7 | 2020-04-04T07:37:09.000Z | 2022-03-11T23:42:09.000Z | examples/data.py | LilJohny/Shorty | 8c16a44516a7de4086bb124eac9ebc6f9d3b606a | [
"MIT"
] | null | null | null | import os
import nltk
import wget
def download_data():
try:
nltk.data.find("tokenizers/punkt")
except LookupError:
nltk.download("punkt")
try:
nltk.data.find("corpora/stopwords")
except LookupError:
nltk.download("stopwords")
if "data" not in os.listdir(os.getcwd()... | 35.678571 | 117 | 0.670671 | import os
import nltk
import wget
def download_data():
try:
nltk.data.find("tokenizers/punkt")
except LookupError:
nltk.download("punkt")
try:
nltk.data.find("corpora/stopwords")
except LookupError:
nltk.download("stopwords")
if "data" not in os.listdir(os.getcwd()... | true | true |
f73b51ab5aa95f3f229d561ec32e95014e446968 | 4,489 | py | Python | build/PureCloudPlatformClientV2/models/bu_average_speed_of_answer.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/bu_average_speed_of_answer.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/bu_average_speed_of_answer.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 28.592357 | 88 | 0.580085 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class BuAverageSpeedOfAnswer(object):
def __init__(self):
self.swagger_types = {
'include': 'bool',
'seconds': 'int'
}
self.attribute_map = ... | true | true |
f73b51db43b0ca9bcac7c235f6d853779c88c6b8 | 885 | py | Python | resources/lib/common.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 22 | 2015-02-04T19:58:02.000Z | 2021-07-29T05:25:08.000Z | resources/lib/common.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 14 | 2015-01-07T00:08:28.000Z | 2019-10-24T00:27:48.000Z | resources/lib/common.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 15 | 2015-02-26T15:01:04.000Z | 2020-12-02T09:14:44.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Artem Glebov
import sys
import transmissionrpc
__settings__ = sys.modules[ "__main__" ].__settings__
def get_settings():
params = {
'address': __settings__.getSetting('rpc_host'),
'port': __settings__.getSetting('rpc_port'),
'user': __settings_... | 28.548387 | 79 | 0.670056 |
import sys
import transmissionrpc
__settings__ = sys.modules[ "__main__" ].__settings__
def get_settings():
params = {
'address': __settings__.getSetting('rpc_host'),
'port': __settings__.getSetting('rpc_port'),
'user': __settings__.getSetting('rpc_user'),
'password': __settings... | true | true |
f73b53714d4d12cfa40e796ff768275de8fa15d4 | 1,516 | py | Python | heron/instance/tests/python/utils/log_unittest.py | takeratta/heron | 7b7c38594186f009741c62d379364b9b45d82b61 | [
"Apache-2.0"
] | 1 | 2021-06-29T07:00:10.000Z | 2021-06-29T07:00:10.000Z | heron/instance/tests/python/utils/log_unittest.py | kalimfaria/heron | d59bd016b826006e2af22c7a6452342f5e7d637c | [
"Apache-2.0"
] | null | null | null | heron/instance/tests/python/utils/log_unittest.py | kalimfaria/heron | d59bd016b826006e2af22c7a6452342f5e7d637c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2016 Twitter. 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... | 31.583333 | 74 | 0.730211 |
import unittest
from mock import patch, Mock, call
from io import StringIO
from heron.common.src.python.utils import proc
class LogTest(unittest.TestCase):
def setUp(self):
pass
def test_stream_process_stdout(self):
ret = StringIO(u'hello\nworld\n')
log_fn = Mock()
with patch("... | true | true |
f73b569fb6f11e4627e4e8c4c171d62600f128c0 | 3,606 | py | Python | Examples/run_protocol_testing.py | nshelch/NCams | a2027a739337df8b620b2454cf83bb2516db8a00 | [
"MIT"
] | null | null | null | Examples/run_protocol_testing.py | nshelch/NCams | a2027a739337df8b620b2454cf83bb2516db8a00 | [
"MIT"
] | null | null | null | Examples/run_protocol_testing.py | nshelch/NCams | a2027a739337df8b620b2454cf83bb2516db8a00 | [
"MIT"
] | null | null | null | """
NCams Toolbox
Copyright 2019-2020 Charles M Greenspon, Anton Sobinov
https://github.com/CMGreenspon/NCams
"""
import os
import time
import math
import pylab
import ncams
BASE_DIR = os.path.join('C:\\', 'FLIR_cameras', 'PublicExample')
def main():
cdatetime = '2019.12.19_10.38.38';
camera_config_dir = o... | 42.423529 | 104 | 0.660843 | import os
import time
import math
import pylab
import ncams
BASE_DIR = os.path.join('C:\\', 'FLIR_cameras', 'PublicExample')
def main():
cdatetime = '2019.12.19_10.38.38';
camera_config_dir = os.path.join(BASE_DIR, 'camconf_'+cdatetime)
camera_config = ncams.yaml_to_config(os.path.join(camera_config_di... | true | true |
f73b56a3f41cd7c137338ddf12bd233fed94d049 | 1,130 | py | Python | tests/storage/cases/test_KT1DkY42MwUA1eC9jHNU2MVHqcLqhLvvbxaW.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2021-05-20T16:52:08.000Z | 2021-05-20T16:52:08.000Z | tests/storage/cases/test_KT1DkY42MwUA1eC9jHNU2MVHqcLqhLvvbxaW.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/storage/cases/test_KT1DkY42MwUA1eC9jHNU2MVHqcLqhLvvbxaW.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1DkY42MwUA1eC9jHNU2MVHqcLqhLvvbxaW(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
cls.... | 40.357143 | 112 | 0.748673 | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1DkY42MwUA1eC9jHNU2MVHqcLqhLvvbxaW(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
cls.... | true | true |
f73b57a230b5efc551fa33033f4049348ad3ba48 | 174 | py | Python | server/user.py | cprochnow28/cornHacks2019 | a6b707aa2b80c949ddeb68034e006b2a9c4b7faf | [
"MIT"
] | null | null | null | server/user.py | cprochnow28/cornHacks2019 | a6b707aa2b80c949ddeb68034e006b2a9c4b7faf | [
"MIT"
] | 1 | 2021-06-01T23:23:27.000Z | 2021-06-01T23:23:27.000Z | server/user.py | cprochnow28/cornHacks2019 | a6b707aa2b80c949ddeb68034e006b2a9c4b7faf | [
"MIT"
] | null | null | null | class User():
def __init__(self, id, username, password):
self.id = id
self.username = username
self.password = password
self.rooms = []
| 21.75 | 47 | 0.568966 | class User():
def __init__(self, id, username, password):
self.id = id
self.username = username
self.password = password
self.rooms = []
| true | true |
f73b58455b1e82b17ef668ac999b3ff19c03f343 | 1,288 | py | Python | DATA_SORT/3cities/SCAM_CLMINIT_60days_withclearsky/outputcesmscam_FLNSC_CLM5_CLM5F_001.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/SCAM_CLMINIT_60days_withclearsky/outputcesmscam_FLNSC_CLM5_CLM5F_001.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/SCAM_CLMINIT_60days_withclearsky/outputcesmscam_FLNSC_CLM5_CLM5F_001.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_CLM5_CLM5F_01.001... | 30.666667 | 106 | 0.706522 | import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_CLM5_CLM5F_01.001... | true | true |
f73b58b1b56f2779b977ddbb3e54942f7b71a453 | 534 | py | Python | parsec/commands/histories/delete_dataset_collection.py | abretaud/parsec | 8ebcafac34b5d6df45de4cecc882b129bb604170 | [
"Apache-2.0"
] | null | null | null | parsec/commands/histories/delete_dataset_collection.py | abretaud/parsec | 8ebcafac34b5d6df45de4cecc882b129bb604170 | [
"Apache-2.0"
] | null | null | null | parsec/commands/histories/delete_dataset_collection.py | abretaud/parsec | 8ebcafac34b5d6df45de4cecc882b129bb604170 | [
"Apache-2.0"
] | null | null | null | import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, dict_output, _arg_split
@click.command('delete_dataset_collection')
@click.argument("history_id", type=str)
@click.argument("dataset_collection_id", type=str)
@pass_context
@custom_exception
@dict_output
def ... | 25.428571 | 88 | 0.799625 | import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, dict_output, _arg_split
@click.command('delete_dataset_collection')
@click.argument("history_id", type=str)
@click.argument("dataset_collection_id", type=str)
@pass_context
@custom_exception
@dict_output
def ... | true | true |
f73b5aacf2a5d4bf0de1663870b4a219a87d4232 | 4,265 | py | Python | python_excel.py | mmmaaaggg/fund_evaluation | 124b9873658d3f9bcd126819c8d7738989b1b011 | [
"MIT"
] | null | null | null | python_excel.py | mmmaaaggg/fund_evaluation | 124b9873658d3f9bcd126819c8d7738989b1b011 | [
"MIT"
] | null | null | null | python_excel.py | mmmaaaggg/fund_evaluation | 124b9873658d3f9bcd126819c8d7738989b1b011 | [
"MIT"
] | 1 | 2019-05-14T01:48:54.000Z | 2019-05-14T01:48:54.000Z | import xlwt
# 创建excel工作表
workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet('sheet1')
# 设置表头
worksheet.write(0, 0, label='产品名称') # product_name
worksheet.write(0, 1, label='产品规模(万)') # volume
worksheet.write(0, 2, label='基金成立日期') # setup_date
worksheet.write(0, 3, label='所投资管计划/信托计划名称') # ... | 29.413793 | 66 | 0.472216 | import xlwt
workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet('sheet1')
worksheet.write(0, 0, label='产品名称')
worksheet.write(0, 1, label='产品规模(万)')
worksheet.write(0, 2, label='基金成立日期')
worksheet.write(0, 3, label='所投资管计划/信托计划名称')
worksheet.write(0, 4, label='子基金所投规模(万)')
worksheet... | true | true |
f73b5b866ffbb95b8ea5bb63ec08368120ffb5cb | 6,400 | py | Python | contrib/DomainAdaptation/train.py | DaoDaoer/PaddleSeg | 7fe2e41de0f192494b8f2088ee500bb55d17708e | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-06-12T05:14:37.000Z | 2021-12-20T12:31:32.000Z | contrib/DomainAdaptation/train.py | DaoDaoer/PaddleSeg | 7fe2e41de0f192494b8f2088ee500bb55d17708e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | contrib/DomainAdaptation/train.py | DaoDaoer/PaddleSeg | 7fe2e41de0f192494b8f2088ee500bb55d17708e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 31.683168 | 103 | 0.61 |
import random
import argparse
import numpy as np
import paddle
from paddleseg.utils import logger, get_sys_env
import utils
from cvlibs import Config
from script.train import Trainer
from datasets import CityDataset, GTA5Dataset, SYNTHIADataset
def parse_args():
parser = argparse.ArgumentParser(de... | true | true |
f73b5bdd9a518c6bca8d2650aebf8ff0e3ae1b69 | 270 | py | Python | ABC/186/b_ans.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/186/b_ans.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/186/b_ans.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | import numpy as np
def main():
# input
H, W = map(int, input().split())
Ass = [[*map(int, input().split())] for _ in range(H)]
# compute
Ass = np.array(Ass)
# output
print(np.sum(Ass - np.min(Ass)))
if __name__ == '__main__':
main()
| 15.882353 | 58 | 0.537037 | import numpy as np
def main():
H, W = map(int, input().split())
Ass = [[*map(int, input().split())] for _ in range(H)]
Ass = np.array(Ass)
print(np.sum(Ass - np.min(Ass)))
if __name__ == '__main__':
main()
| true | true |
f73b5bf2af9066b425c3ca2403a9dd39d0dc81aa | 22,549 | py | Python | tripleo_workflows/tests/actions/test_deployment.py | bcrochet/tripleo-workflows | 3ac8aa6a47ef005358c98c987ddb17c31fd1d1a4 | [
"Apache-2.0"
] | null | null | null | tripleo_workflows/tests/actions/test_deployment.py | bcrochet/tripleo-workflows | 3ac8aa6a47ef005358c98c987ddb17c31fd1d1a4 | [
"Apache-2.0"
] | null | null | null | tripleo_workflows/tests/actions/test_deployment.py | bcrochet/tripleo-workflows | 3ac8aa6a47ef005358c98c987ddb17c31fd1d1a4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 43.784466 | 79 | 0.625571 |
import mock
import tempfile
import yaml
from heatclient import exc as heat_exc
from mistral_lib import actions
from swiftclient import exceptions as swiftexceptions
from tripleo_workflows.actions import deployment
from tripleo_workflows import constants
from tripleo_workflows.tests import base
class O... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.