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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f743bf3cf1c3b3279077dc629f36cb922dcb86c8 | 568 | py | Python | bot/replies/feeling.py | shivakumarb3/vardhamanbot | e7ee9b75270e6da59bd4f7b5b597fc118133e0a6 | [
"MIT"
] | 9 | 2018-12-14T04:45:02.000Z | 2020-12-20T13:43:56.000Z | bot/replies/feeling.py | shivakumarb3/vardhamanbot | e7ee9b75270e6da59bd4f7b5b597fc118133e0a6 | [
"MIT"
] | 19 | 2018-12-14T10:38:36.000Z | 2019-01-18T10:05:34.000Z | bot/replies/feeling.py | shivakumarb3/vardhamanbot | e7ee9b75270e6da59bd4f7b5b597fc118133e0a6 | [
"MIT"
] | 10 | 2018-12-12T10:33:19.000Z | 2020-06-03T07:53:55.000Z | import random
def reply(activity, bot, data):
responses = [
"I’m fine as always, thank you. Yourself?",
"I'm great!, thanks for asking. Wbu?",
"I'm good! and you?",
"Pretty well, how about you?",
"I'm alright! what about you?",
"Theek hoon, Shukriya poochne ke liye.... | 35.5 | 62 | 0.591549 | import random
def reply(activity, bot, data):
responses = [
"I’m fine as always, thank you. Yourself?",
"I'm great!, thanks for asking. Wbu?",
"I'm good! and you?",
"Pretty well, how about you?",
"I'm alright! what about you?",
"Theek hoon, Shukriya poochne ke liye.... | true | true |
f743c1dba40ff57fb22768ff60b6b51330ff38cb | 381 | py | Python | bleson/providers/linux/constants.py | ddunmire/python-bleson | bf6f4230b0e8b3377c54ee3b52213098cc52c2a8 | [
"MIT"
] | 103 | 2017-09-29T09:13:40.000Z | 2022-02-25T08:03:32.000Z | bleson/providers/linux/constants.py | ddunmire/python-bleson | bf6f4230b0e8b3377c54ee3b52213098cc52c2a8 | [
"MIT"
] | 57 | 2017-11-06T04:48:16.000Z | 2021-05-24T11:02:22.000Z | bleson/providers/linux/constants.py | ddunmire/python-bleson | bf6f4230b0e8b3377c54ee3b52213098cc52c2a8 | [
"MIT"
] | 30 | 2017-11-24T21:15:49.000Z | 2022-02-20T10:38:09.000Z |
HCIPY_HCI_CMD_STRUCT_HEADER = "<BHB"
HCIPY_HCI_FILTER_STRUCT = "<LLLH"
# Vol 4 part 4.5
HCI_COMMAND_PKT = 0x01
HCI_ACLDATA_PKT = 0x02
HCI_EVENT_PKT = 0x04
# HCI ioctl Commands:
HCIDEVUP = 0x400448c9 # 201
HCIDEVDOWN = 0x400448ca # 202
HCIGETDEVINFO = -2147202861 #0x800448d3L # _IOR(ord('H'), 211, 4)
# HCI Sta... | 17.318182 | 66 | 0.745407 |
HCIPY_HCI_CMD_STRUCT_HEADER = "<BHB"
HCIPY_HCI_FILTER_STRUCT = "<LLLH"
HCI_COMMAND_PKT = 0x01
HCI_ACLDATA_PKT = 0x02
HCI_EVENT_PKT = 0x04
HCIDEVUP = 0x400448c9
HCIDEVDOWN = 0x400448ca
HCIGETDEVINFO = -2147202861 HCI_OE_USER_ENDED_CONNECTION = 0x13
| true | true |
f743c48685476f65a04d7c286ff52814593a5ac8 | 787 | py | Python | tests/test/python3/all/linker_namespace.py | exasol/script-languages | c5fc636a4ce18310d96d8dc5c019da7d033dc6f1 | [
"MIT"
] | 6 | 2019-01-09T11:55:15.000Z | 2021-06-25T19:52:42.000Z | tests/test/python3/all/linker_namespace.py | exasol/script-languages | c5fc636a4ce18310d96d8dc5c019da7d033dc6f1 | [
"MIT"
] | 65 | 2018-12-12T08:40:38.000Z | 2022-02-28T09:19:45.000Z | tests/test/python3/all/linker_namespace.py | exasol/script-languages | c5fc636a4ce18310d96d8dc5c019da7d033dc6f1 | [
"MIT"
] | 9 | 2018-11-23T08:59:09.000Z | 2020-02-04T12:56:35.000Z | #!/usr/bin/env python2.7
import os
import sys
sys.path.append(os.path.realpath(__file__ + '/../../../../lib'))
sys.path.append(os.path.realpath(__file__ + '/../../../linker-namespace-sanity'))
import udf
import linker_namespace_base_test
'''
This test verifies that certain libraries are not part of the global link... | 28.107143 | 104 | 0.715375 |
import os
import sys
sys.path.append(os.path.realpath(__file__ + '/../../../../lib'))
sys.path.append(os.path.realpath(__file__ + '/../../../linker-namespace-sanity'))
import udf
import linker_namespace_base_test
class LinkerNamespaceTest(linker_namespace_base_test.LinkerNamespaceBaseTest):
def test_linker_n... | true | true |
f743c4d7a45ee13dfb9229666a9a7ce9001074af | 1,370 | py | Python | rplugin/python3/denite/source/lsp/workspace_symbols.py | tk-shirasaka/denite-utils | e8a1f7e92022cdfc322135ecec499ee7efcd024c | [
"MIT"
] | 1 | 2021-09-01T00:14:51.000Z | 2021-09-01T00:14:51.000Z | rplugin/python3/denite/source/lsp/workspace_symbols.py | tk-shirasaka/denite-utils | e8a1f7e92022cdfc322135ecec499ee7efcd024c | [
"MIT"
] | null | null | null | rplugin/python3/denite/source/lsp/workspace_symbols.py | tk-shirasaka/denite-utils | e8a1f7e92022cdfc322135ecec499ee7efcd024c | [
"MIT"
] | null | null | null | # ============================================================================
# FILE: lsp/workspace_symbols.py
# AUTHOR: Takahiro Shirasaka <tk.shirasaka@gmail.com>
# License: MIT license
# ============================================================================
import os
import sys
sys.path.insert(1, os.path.di... | 37.027027 | 107 | 0.483212 |
import os
import sys
sys.path.insert(1, os.path.dirname(os.path.dirname(__file__)))
from utils import AsyncSource
from denite.util import relpath
class Source(AsyncSource):
def __init__(self, vim):
super().__init__(vim)
self.name = 'lsp/workspace_symbols'
self.kind = 'file'
... | true | true |
f743c52470ac0c11c55bcab33aff238e2044f498 | 7,820 | py | Python | notion_client/api_endpoints.py | echo724/notion-sdk-py | d6560b4d77414542f67fda477ca7cee258ec65ff | [
"MIT"
] | null | null | null | notion_client/api_endpoints.py | echo724/notion-sdk-py | d6560b4d77414542f67fda477ca7cee258ec65ff | [
"MIT"
] | null | null | null | notion_client/api_endpoints.py | echo724/notion-sdk-py | d6560b4d77414542f67fda477ca7cee258ec65ff | [
"MIT"
] | null | null | null | """Notion API endpoints."""
from typing import TYPE_CHECKING, Any
from notion_client.helpers import pick
from notion_client.typing import SyncAsync
if TYPE_CHECKING:
from notion_client.client import BaseClient
class Endpoint:
def __init__(self, parent: "BaseClient") -> None:
self.parent = parent
... | 36.542056 | 89 | 0.592199 |
from typing import TYPE_CHECKING, Any
from notion_client.helpers import pick
from notion_client.typing import SyncAsync
if TYPE_CHECKING:
from notion_client.client import BaseClient
class Endpoint:
def __init__(self, parent: "BaseClient") -> None:
self.parent = parent
class BlocksChildrenEndpoint... | true | true |
f743c5d52a061b338bf9da2ac087fb833c7f4ad9 | 583 | py | Python | backend/jenkins_tasks/migrations/0005_auto_20200822_1452.py | itimor/one-ops | f1111735de252012752dfabe11598e9690c89257 | [
"MIT"
] | null | null | null | backend/jenkins_tasks/migrations/0005_auto_20200822_1452.py | itimor/one-ops | f1111735de252012752dfabe11598e9690c89257 | [
"MIT"
] | 6 | 2021-03-19T10:20:05.000Z | 2021-09-22T19:30:21.000Z | backend/jenkins_tasks/migrations/0005_auto_20200822_1452.py | itimor/one-ops | f1111735de252012752dfabe11598e9690c89257 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-08-22 06:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jenkins_tasks', '0004_auto_20200822_1439'),
]
operations = [
migrations.AlterField(
model_name='tasklog',
name='code... | 24.291667 | 71 | 0.588336 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jenkins_tasks', '0004_auto_20200822_1439'),
]
operations = [
migrations.AlterField(
model_name='tasklog',
name='code',
field=models.CharField(max_lengt... | true | true |
f743c6edb46f16981a15989759923a2a169a7b13 | 1,849 | py | Python | AlbotOnline/Tests/SnakeTest.py | Albot-Online/Albot-Python-Library | 75f31b72b76d302aad46c31446f332a4f7119ae0 | [
"MIT"
] | 2 | 2018-09-27T19:38:21.000Z | 2019-02-20T16:41:57.000Z | AlbotOnline/Tests/SnakeTest.py | Albot-Online/Albot-Python-Library | 75f31b72b76d302aad46c31446f332a4f7119ae0 | [
"MIT"
] | null | null | null | AlbotOnline/Tests/SnakeTest.py | Albot-Online/Albot-Python-Library | 75f31b72b76d302aad46c31446f332a4f7119ae0 | [
"MIT"
] | null | null | null | from AlbotOnline.Snake import SnakeGame
import AlbotOnline.JsonProtocol as Prot
import random as rand
game = SnakeGame.SnakeGame(Port=int(input("Port:"))) #Connects you to the Client
maxDepth = 2
def stateToScore(state):
if(state == Prot.STATES.ongoing):
return 0.5
if(state == Prot.STATES.... | 28.446154 | 81 | 0.56463 | from AlbotOnline.Snake import SnakeGame
import AlbotOnline.JsonProtocol as Prot
import random as rand
game = SnakeGame.SnakeGame(Port=int(input("Port:")))
maxDepth = 2
def stateToScore(state):
if(state == Prot.STATES.ongoing):
return 0.5
if(state == Prot.STATES.draw):
return 0.25
... | true | true |
f743c7991cb44c6f6467933b33d3984bd59235b1 | 15,148 | py | Python | blender/arm/live_patch.py | t3du/armory | 76c3a7be84790821902430e170c29d6be274732d | [
"Zlib"
] | null | null | null | blender/arm/live_patch.py | t3du/armory | 76c3a7be84790821902430e170c29d6be274732d | [
"Zlib"
] | null | null | null | blender/arm/live_patch.py | t3du/armory | 76c3a7be84790821902430e170c29d6be274732d | [
"Zlib"
] | null | null | null | import os
import shutil
from typing import Any, Type
import bpy
import arm.assets
from arm.exporter import ArmoryExporter
import arm.log as log
from arm.logicnode.arm_nodes import ArmLogicTreeNode
import arm.make as make
import arm.make_state as state
import arm.node_utils
import arm.utils
if arm.is_reload(__name__)... | 38.446701 | 159 | 0.632031 | import os
import shutil
from typing import Any, Type
import bpy
import arm.assets
from arm.exporter import ArmoryExporter
import arm.log as log
from arm.logicnode.arm_nodes import ArmLogicTreeNode
import arm.make as make
import arm.make_state as state
import arm.node_utils
import arm.utils
if arm.is_reload(__name__)... | true | true |
f743c87dd8886152f8ca73fc399f82c2e6710902 | 1,090 | py | Python | camera.py | fanzhe98/FaceRecoCamera | 3a5b5018e26e07a98036ca12e79d263e23e154f8 | [
"MIT"
] | null | null | null | camera.py | fanzhe98/FaceRecoCamera | 3a5b5018e26e07a98036ca12e79d263e23e154f8 | [
"MIT"
] | null | null | null | camera.py | fanzhe98/FaceRecoCamera | 3a5b5018e26e07a98036ca12e79d263e23e154f8 | [
"MIT"
] | 1 | 2018-10-20T02:09:45.000Z | 2018-10-20T02:09:45.000Z | import cv2
class VideoCamera(object):
def __init__(self):
# Using OpenCV to capture from device 0. If you have trouble capturing
# from a webcam, comment the line below out and use a video file
# instead.
# self.video = cv2.VideoCapture(0)
self.image = None
self.cach... | 32.058824 | 79 | 0.563303 | import cv2
class VideoCamera(object):
def __init__(self):
self.image = None
self.cache = None
def __del__(self):
self.video.release()
def get_frame(self):
try:
self.image = cv2.imread("stati... | true | true |
f743c9e467b5999b9cafd399b3612f7c76b10ee2 | 1,736 | py | Python | test/api/test_collector.py | choonho/plugin-google-cloud-compute-inven-collector | 40b16a634b676e9969efc31d8ac7dd2302309389 | [
"Apache-2.0"
] | 3 | 2020-06-22T01:48:12.000Z | 2020-08-07T07:20:18.000Z | test/api/test_collector.py | choonho/plugin-google-cloud-compute-inven-collector | 40b16a634b676e9969efc31d8ac7dd2302309389 | [
"Apache-2.0"
] | 3 | 2021-12-10T03:51:28.000Z | 2022-01-14T08:00:55.000Z | test/api/test_collector.py | choonho/plugin-google-cloud-compute-inven-collector | 40b16a634b676e9969efc31d8ac7dd2302309389 | [
"Apache-2.0"
] | 3 | 2021-11-30T02:25:39.000Z | 2021-12-02T09:51:16.000Z | import os
import unittest
import json
from spaceone.core.unittest.runner import RichTestRunner
from spaceone.tester import TestCase, print_json
GOOGLE_APPLICATION_CREDENTIALS_PATH = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', None)
if GOOGLE_APPLICATION_CREDENTIALS_PATH is None:
print("""
##########... | 28.933333 | 107 | 0.586982 | import os
import unittest
import json
from spaceone.core.unittest.runner import RichTestRunner
from spaceone.tester import TestCase, print_json
GOOGLE_APPLICATION_CREDENTIALS_PATH = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', None)
if GOOGLE_APPLICATION_CREDENTIALS_PATH is None:
print("""
##########... | true | true |
f743cb1ac4350154c138fa83359940211cd54c69 | 3,841 | py | Python | geetools/tools/date.py | bworstell/gee_tools | 4123395cf5bad39f20613afb37d041186d9516fe | [
"MIT"
] | 4 | 2019-01-21T04:51:21.000Z | 2021-12-01T15:05:32.000Z | geetools/tools/date.py | bworstell/gee_tools | 4123395cf5bad39f20613afb37d041186d9516fe | [
"MIT"
] | 8 | 2020-03-24T16:44:12.000Z | 2022-03-11T23:39:32.000Z | geetools/tools/date.py | bworstell/gee_tools | 4123395cf5bad39f20613afb37d041186d9516fe | [
"MIT"
] | 2 | 2020-04-18T16:44:40.000Z | 2021-03-31T02:11:26.000Z | # coding=utf-8
""" Module holding tools for ee.Date """
import ee
if not ee.data._initialized:
ee.Initialize()
from datetime import datetime, timedelta
EE_EPOCH = datetime(1970, 1, 1, 0, 0, 0)
def to_datetime(date):
""" convert a `ee.Date` into a `datetime` object """
formatted = date.format('yyyy,MM,dd... | 33.692982 | 77 | 0.646186 |
import ee
if not ee.data._initialized:
ee.Initialize()
from datetime import datetime, timedelta
EE_EPOCH = datetime(1970, 1, 1, 0, 0, 0)
def to_datetime(date):
formatted = date.format('yyyy,MM,dd,HH,mm,ss').getInfo()
args = formatted.split(',')
intargs = [int(arg) for arg in args]
return dateti... | true | true |
f743cca647725ba7d2ad7c698990476c583a8ec3 | 1,181 | py | Python | rllib/evaluation/__init__.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 4 | 2019-10-18T17:44:58.000Z | 2021-04-14T14:37:21.000Z | rllib/evaluation/__init__.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 4 | 2019-03-04T13:03:24.000Z | 2019-06-06T11:25:07.000Z | rllib/evaluation/__init__.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 2 | 2017-10-31T23:20:07.000Z | 2019-11-13T20:16:03.000Z | from ray.rllib.evaluation.episode import MultiAgentEpisode
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.evaluation.policy_evaluator import PolicyEvaluator
from ray.rllib.evaluation.interface import EvaluatorInterface
from ray.rllib.evaluation.policy_graph import PolicyGraph
from ray.rlli... | 36.90625 | 74 | 0.809483 | from ray.rllib.evaluation.episode import MultiAgentEpisode
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.evaluation.policy_evaluator import PolicyEvaluator
from ray.rllib.evaluation.interface import EvaluatorInterface
from ray.rllib.evaluation.policy_graph import PolicyGraph
from ray.rlli... | true | true |
f743cd7ab751308bc4d4f35c10d79417a2eea563 | 49 | py | Python | enthought/pyface/image_button.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/pyface/image_button.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/pyface/image_button.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from pyface.image_button import *
| 16.333333 | 33 | 0.795918 |
from pyface.image_button import *
| true | true |
f743ce199c37ff66bbdbf19855d4826f0cd8709c | 1,749 | py | Python | tex2incbin.py | NCDyson/FCHucker | 9e38eed77a8b78bf78fc0654c440d64042c5493f | [
"Unlicense"
] | 3 | 2020-07-19T05:38:56.000Z | 2020-10-12T16:55:47.000Z | tex2incbin.py | NCDyson/FCHucker | 9e38eed77a8b78bf78fc0654c440d64042c5493f | [
"Unlicense"
] | null | null | null | tex2incbin.py | NCDyson/FCHucker | 9e38eed77a8b78bf78fc0654c440d64042c5493f | [
"Unlicense"
] | 1 | 2020-10-23T11:45:07.000Z | 2020-10-23T11:45:07.000Z | import sys
import os
from PIL import Image
import struct
def writeu8(val, outf):
outf.write(struct.pack("B", val))
if __name__ == "__main__":
#print("ARGV: {}".format(sys.argv))
if len(sys.argv) < 2:
print("{}: Expected input file".format(sys.argv[0]))
exit
inName = sys.ar... | 32.388889 | 81 | 0.526587 | import sys
import os
from PIL import Image
import struct
def writeu8(val, outf):
outf.write(struct.pack("B", val))
if __name__ == "__main__":
if len(sys.argv) < 2:
print("{}: Expected input file".format(sys.argv[0]))
exit
inName = sys.argv[1]
fSize = os.path.getsize(i... | true | true |
f743cfffe4054ee9c34c80aec60d8926294dc25a | 607 | py | Python | 04_vnc_instance/config.py | Eudaemonal/AWS | d87144dbc13fcaab57e360f271cc7c55f66f4c3b | [
"MIT"
] | null | null | null | 04_vnc_instance/config.py | Eudaemonal/AWS | d87144dbc13fcaab57e360f271cc7c55f66f4c3b | [
"MIT"
] | null | null | null | 04_vnc_instance/config.py | Eudaemonal/AWS | d87144dbc13fcaab57e360f271cc7c55f66f4c3b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
import json
class Config:
def __init__(self, filename):
self.filename = filename
self.data = dict()
# read config file, return true when success
def success(self):
try:
with open(self.filename) as f:
self.data = json.load(f)... | 19.580645 | 48 | 0.556837 |
import os
import json
class Config:
def __init__(self, filename):
self.filename = filename
self.data = dict()
def success(self):
try:
with open(self.filename) as f:
self.data = json.load(f)
except IOError:
print("Read Config faile... | true | true |
f743d09c286971fd3f609017f18c6c3cbf5d59d1 | 77 | py | Python | signals/signals/libs/decorators.py | gonzaloamadio/django-signals2 | 809d1c0b627f5ec68e7bc4f73fdc7de7e7545706 | [
"MIT"
] | 1 | 2018-10-23T00:54:07.000Z | 2018-10-23T00:54:07.000Z | signals/signals/libs/decorators.py | gonzaloamadio/django-signals2 | 809d1c0b627f5ec68e7bc4f73fdc7de7e7545706 | [
"MIT"
] | null | null | null | signals/signals/libs/decorators.py | gonzaloamadio/django-signals2 | 809d1c0b627f5ec68e7bc4f73fdc7de7e7545706 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Put in here all of some of your custom decorators
| 19.25 | 51 | 0.649351 | true | true | |
f743d22745170ed9e176bbfd0a948a9e6433bd4f | 148,599 | py | Python | google/ads/google_ads/v6/proto/common/metrics_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v6/proto/common/metrics_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/common/metrics_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v6/proto/common/metrics.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobu... | 68.039835 | 13,041 | 0.780443 |
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 = _symbol_database.Default()
from google.ads.google_ads.v6.proto.enums import intera... | true | true |
f743d28ed67ee7c9011c2684856709b200f237b5 | 2,187 | py | Python | open_spiel/python/algorithms/double_oracle_test.py | mcx/open_spiel | 062cbfc07621343e7d77209cb421ba690328142b | [
"Apache-2.0"
] | null | null | null | open_spiel/python/algorithms/double_oracle_test.py | mcx/open_spiel | 062cbfc07621343e7d77209cb421ba690328142b | [
"Apache-2.0"
] | null | null | null | open_spiel/python/algorithms/double_oracle_test.py | mcx/open_spiel | 062cbfc07621343e7d77209cb421ba690328142b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 37.067797 | 79 | 0.745313 |
from absl.testing import absltest
import numpy as np
from open_spiel.python.algorithms import double_oracle
import pyspiel
class DoubleOracleTest(absltest.TestCase):
def test_rock_paper_scissors(self):
game = pyspiel.load_matrix_game("matrix_rps")
solver = double_oracle.DoubleOracleSolver(g... | true | true |
f743d4503946bae4b23f15f2c8e2f5eb94fe8d7a | 4,356 | py | Python | circle/install_cmake.py | blowekamp/scikit-ci-addons | ddb252ba5979e318a7fd68188f88c6b0d841ebb6 | [
"Apache-2.0"
] | 5 | 2017-12-28T21:58:57.000Z | 2021-11-05T10:23:14.000Z | circle/install_cmake.py | blowekamp/scikit-ci-addons | ddb252ba5979e318a7fd68188f88c6b0d841ebb6 | [
"Apache-2.0"
] | 85 | 2016-10-11T19:55:15.000Z | 2022-02-12T06:18:17.000Z | circle/install_cmake.py | blowekamp/scikit-ci-addons | ddb252ba5979e318a7fd68188f88c6b0d841ebb6 | [
"Apache-2.0"
] | 8 | 2017-04-09T21:58:25.000Z | 2020-11-06T08:34:08.000Z |
"""
Usage::
import install_cmake
install_cmake.install()
"""
import os
import subprocess
import sys
import textwrap
from subprocess import CalledProcessError, check_output
DEFAULT_CMAKE_VERSION = "3.5.0"
def _log(*args):
script_name = os.path.basename(__file__)
print("[circle:%s] " % script_name... | 31.114286 | 116 | 0.610193 |
import os
import subprocess
import sys
import textwrap
from subprocess import CalledProcessError, check_output
DEFAULT_CMAKE_VERSION = "3.5.0"
def _log(*args):
script_name = os.path.basename(__file__)
print("[circle:%s] " % script_name + " ".join(args))
sys.stdout.flush()
def _check_executables_avai... | true | true |
f743d490d9ed8405b6d77548e525f56d6fe1f3d9 | 19,960 | py | Python | iroha/iroha.py | i1i1/iroha-python | 4d10eb0fb64bb033c950a8b6a63c6fae25fe4373 | [
"Apache-2.0"
] | null | null | null | iroha/iroha.py | i1i1/iroha-python | 4d10eb0fb64bb033c950a8b6a63c6fae25fe4373 | [
"Apache-2.0"
] | null | null | null | iroha/iroha.py | i1i1/iroha-python | 4d10eb0fb64bb033c950a8b6a63c6fae25fe4373 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
from . import ed25519 as ed25519_sha3
import nacl.signing as ed25519_sha2
import hashlib
import binascii
import grpc
import time
import re
import os
from . import commands_pb2
from . import endpoint_p... | 40.817996 | 112 | 0.659369 |
from . import ed25519 as ed25519_sha3
import nacl.signing as ed25519_sha2
import hashlib
import binascii
import grpc
import time
import re
import os
from . import commands_pb2
from . import endpoint_pb2
from . import endpoint_pb2_grpc
from . import primitive_pb2
from . import queries_pb2
from . import transactio... | true | true |
f743d4a113d8c5d326e9064f024c2ed97d5e27c7 | 6,731 | py | Python | tests/examples/minlplib/kall_circlesrectangles_c1r12.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/kall_circlesrectangles_c1r12.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/kall_circlesrectangles_c1r12.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # NLP written by GAMS Convert at 04/21/18 13:52:27
#
# Equation counts
# Total E G L N X C B
# 52 40 0 12 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 37.814607 | 82 | 0.625019 |
from pyomo.environ import *
model = m = ConcreteModel()
m.x1 = Var(within=Reals,bounds=(0.25,32),initialize=0.25)
m.x2 = Var(within=Reals,bounds=(0,8),initialize=0)
m.x3 = Var(within=Reals,bounds=(0,4),initialize=0)
m.x4 = Var(within=Reals,bounds=(0,8.94427190999916),initialize=0)
m.x5 = Var(within=... | true | true |
f743d55d923f36c61363f009c0ec571f8db659df | 7,920 | py | Python | aiida_jutools/structure/util.py | PhilippRue/aiida-jutools | 66070e7077cb454bcfd70dd3327b335499556a16 | [
"MIT"
] | 5 | 2020-12-11T13:32:09.000Z | 2022-01-19T08:36:40.000Z | aiida_jutools/structure/util.py | PhilippRue/aiida-jutools | 66070e7077cb454bcfd70dd3327b335499556a16 | [
"MIT"
] | 7 | 2021-01-28T10:24:13.000Z | 2021-08-18T13:42:47.000Z | aiida_jutools/structure/util.py | PhilippRue/aiida-jutools | 66070e7077cb454bcfd70dd3327b335499556a16 | [
"MIT"
] | 5 | 2020-12-07T17:13:38.000Z | 2021-11-25T09:58:48.000Z | # -*- coding: utf-8 -*-
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the aiida-jutools package. ... | 52.450331 | 118 | 0.632197 | true | true | |
f743d6d085d69d413c65613edb308de42703d809 | 3,406 | py | Python | frameMetadata/sentinel/create_met_json.py | aria-jpl/ariamh | c600d95dd6d5e04c55cb31c9c2b3aa2d02e01456 | [
"Apache-2.0"
] | 4 | 2019-11-19T03:35:35.000Z | 2020-12-07T18:43:11.000Z | frameMetadata/sentinel/create_met_json.py | dbekaert/ariamh | f0abf4d22ec133e3eca31eea362896652463255a | [
"Apache-2.0"
] | 3 | 2019-06-05T03:35:55.000Z | 2020-04-09T14:16:08.000Z | frameMetadata/sentinel/create_met_json.py | aria-jpl/ariamh | c600d95dd6d5e04c55cb31c9c2b3aa2d02e01456 | [
"Apache-2.0"
] | 6 | 2019-08-23T22:53:11.000Z | 2021-11-06T15:15:30.000Z | #!/usr/bin/env python
from builtins import map
import os, sys, json, re
from lxml.etree import parse
def create_met_json(xml_file, json_file, mis_char):
"""Write product metadata json."""
with open(xml_file) as f:
doc = parse(f)
coords = doc.xpath("//*[local-name() = 'coordinates']")[0].text ... | 44.815789 | 134 | 0.600117 |
from builtins import map
import os, sys, json, re
from lxml.etree import parse
def create_met_json(xml_file, json_file, mis_char):
with open(xml_file) as f:
doc = parse(f)
coords = doc.xpath("//*[local-name() = 'coordinates']")[0].text
bbox = []
for coord in coords.split():
l... | true | true |
f743d861b7ad54c227f4a85cbb7e807f6cd85387 | 393 | py | Python | codezone/asgi.py | AngeloZan/CodeZone | a9ed4e3d3c5b69e9f385fa2108059db1565022a0 | [
"MIT"
] | null | null | null | codezone/asgi.py | AngeloZan/CodeZone | a9ed4e3d3c5b69e9f385fa2108059db1565022a0 | [
"MIT"
] | null | null | null | codezone/asgi.py | AngeloZan/CodeZone | a9ed4e3d3c5b69e9f385fa2108059db1565022a0 | [
"MIT"
] | null | null | null | """
ASGI config for codezone project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'codezone.settings')
application = get_asgi_application()
| true | true |
f743d87540f7fd64157a808db156c9f62a042d9c | 3,695 | py | Python | tools/infer_table.py | nan-wang/PaddleOCR | 31b06a2fd19f877a09acaf658387bd919c289b8e | [
"Apache-2.0"
] | 20,401 | 2020-05-08T10:56:13.000Z | 2022-03-31T23:34:38.000Z | tools/infer_table.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,988 | 2020-05-10T08:19:41.000Z | 2022-03-31T17:57:11.000Z | tools/infer_table.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,479 | 2020-05-08T11:12:13.000Z | 2022-03-31T11:55:28.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.212963 | 76 | 0.659811 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import os
import sys
import json
__dir__ = os.path.dirname(os.path.abspath(__file__))
sys.path.append(__dir__)
sys.path.append(os.path.abspath(os.path.join(__dir__, '..')))
o... | true | true |
f743d88a50fb5e769b1199bcc12c397f22dfef5f | 107 | py | Python | main.py | shriekdj/newResume-web | c873ee830a3ba9d9c92528f0a9740931769635f3 | [
"MIT"
] | null | null | null | main.py | shriekdj/newResume-web | c873ee830a3ba9d9c92528f0a9740931769635f3 | [
"MIT"
] | null | null | null | main.py | shriekdj/newResume-web | c873ee830a3ba9d9c92528f0a9740931769635f3 | [
"MIT"
] | null | null | null | import markdown
markdown.markdownFromFile(
input="resume.md",
output="index.html",
encoding="utf8"
) | 15.285714 | 26 | 0.728972 | import markdown
markdown.markdownFromFile(
input="resume.md",
output="index.html",
encoding="utf8"
) | true | true |
f743d98d23afc9733dea5845e04d5420cf757503 | 6,828 | py | Python | idaes/generic_models/unit_models/feed_flash.py | dangunter/idaes-pse | 8f63b4ad8000af8a3eb0316a5f61c32e206925d0 | [
"RSA-MD"
] | null | null | null | idaes/generic_models/unit_models/feed_flash.py | dangunter/idaes-pse | 8f63b4ad8000af8a3eb0316a5f61c32e206925d0 | [
"RSA-MD"
] | null | null | null | idaes/generic_models/unit_models/feed_flash.py | dangunter/idaes-pse | 8f63b4ad8000af8a3eb0316a5f61c32e206925d0 | [
"RSA-MD"
] | null | null | null | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 40.402367 | 81 | 0.646163 | true | true | |
f743d9d840e6627016490fc65754c5f5d7de03ef | 814 | py | Python | foodfitnessProject/foodfitnessProject/urls.py | cs-fullstack-2019-spring/django-authentication-cw-EnrickaM | fba82c084ab5e0ed1938526ba4523b02f30aa3ce | [
"Apache-2.0"
] | null | null | null | foodfitnessProject/foodfitnessProject/urls.py | cs-fullstack-2019-spring/django-authentication-cw-EnrickaM | fba82c084ab5e0ed1938526ba4523b02f30aa3ce | [
"Apache-2.0"
] | null | null | null | foodfitnessProject/foodfitnessProject/urls.py | cs-fullstack-2019-spring/django-authentication-cw-EnrickaM | fba82c084ab5e0ed1938526ba4523b02f30aa3ce | [
"Apache-2.0"
] | null | null | null | """foodfitnessProject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 35.391304 | 77 | 0.711302 | from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('foodfitnessApp.urls')),
]
| true | true |
f743da64b19681230498883440ecabbacbadd28e | 89,287 | py | Python | localstack/utils/cloudformation/template_deployer.py | PedroPini/localstack | 4e15f778a1a4b4beebd0e25646277f6ae04a28ea | [
"Apache-2.0"
] | null | null | null | localstack/utils/cloudformation/template_deployer.py | PedroPini/localstack | 4e15f778a1a4b4beebd0e25646277f6ae04a28ea | [
"Apache-2.0"
] | null | null | null | localstack/utils/cloudformation/template_deployer.py | PedroPini/localstack | 4e15f778a1a4b4beebd0e25646277f6ae04a28ea | [
"Apache-2.0"
] | null | null | null | import base64
import json
import logging
import re
import traceback
from typing import Optional
from urllib.parse import urlparse
from moto.cloudformation import parsing
from moto.core import CloudFormationModel as MotoCloudFormationModel
from moto.ec2.utils import generate_route_id
from six import iteritems
from loc... | 39.298856 | 120 | 0.611847 | import base64
import json
import logging
import re
import traceback
from typing import Optional
from urllib.parse import urlparse
from moto.cloudformation import parsing
from moto.core import CloudFormationModel as MotoCloudFormationModel
from moto.ec2.utils import generate_route_id
from six import iteritems
from loc... | true | true |
f743dac46b24c62e70ab2b0ccf07dc0bdbe3e6e5 | 7,331 | py | Python | pypiprivate/storage.py | rpatterson/pypiprivate | 762d12207f7dd5b03dd8feb9658702e1bc5d27a2 | [
"MIT"
] | null | null | null | pypiprivate/storage.py | rpatterson/pypiprivate | 762d12207f7dd5b03dd8feb9658702e1bc5d27a2 | [
"MIT"
] | null | null | null | pypiprivate/storage.py | rpatterson/pypiprivate | 762d12207f7dd5b03dd8feb9658702e1bc5d27a2 | [
"MIT"
] | null | null | null | import os
import errno
import shutil
import mimetypes
import logging
import boto3
from botocore.exceptions import ClientError
logger = logging.getLogger(__name__)
class StorageException(Exception):
pass
class PathNotFound(StorageException):
pass
class Storage(object):
def join_path(self, *args):
... | 33.78341 | 104 | 0.596508 | import os
import errno
import shutil
import mimetypes
import logging
import boto3
from botocore.exceptions import ClientError
logger = logging.getLogger(__name__)
class StorageException(Exception):
pass
class PathNotFound(StorageException):
pass
class Storage(object):
def join_path(self, *args):
... | true | true |
f743db8654210c1e99048861339bb66abb55934f | 2,448 | py | Python | aliyun-python-sdk-eci/aliyunsdkeci/request/v20180808/DescribeContainerGroupMetricRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-eci/aliyunsdkeci/request/v20180808/DescribeContainerGroupMetricRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-eci/aliyunsdkeci/request/v20180808/DescribeContainerGroupMetricRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34 | 87 | 0.771242 |
from aliyunsdkcore.request import RpcRequest
class DescribeContainerGroupMetricRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Eci', '2018-08-08', 'DescribeContainerGroupMetric','eci')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
... | true | true |
f743dd1533365cffd345d7d20e4b9a39695c05d4 | 593 | py | Python | ogr2osm/__init__.py | roelderickx/ogr2pbf | 7ac99488d8daa9452e2a41e40bf2554dc720166d | [
"MIT"
] | null | null | null | ogr2osm/__init__.py | roelderickx/ogr2pbf | 7ac99488d8daa9452e2a41e40bf2554dc720166d | [
"MIT"
] | null | null | null | ogr2osm/__init__.py | roelderickx/ogr2pbf | 7ac99488d8daa9452e2a41e40bf2554dc720166d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Copyright (c) 2012-2021 Roel Derickx, Paul Norman <penorman@mac.com>,
Sebastiaan Couwenberg <sebastic@xs4all.nl>, The University of Vermont
<andrew.guertin@uvm.edu>, github contributors
Released under the MIT license, as given in the file LICENSE, which must
accompany any distribution of t... | 32.944444 | 72 | 0.806071 |
from .translation_base_class import TranslationBase
from .datawriter_base_class import DataWriterBase
from .osm_datawriter import OsmDataWriter
from .pbf_datawriter import PbfDataWriter
from .ogr_datasource import OgrDatasource
from .osm_data import OsmData
| true | true |
f743dd63d7afb75da9d36de6074b771fcf824a99 | 5,049 | py | Python | src/a2c.py | allisonchen23/Pensieve-PPO2 | c4add70d3e1e28a6d2e90f2571ca53d1d35647e1 | [
"BSD-2-Clause"
] | 1 | 2021-12-17T14:16:38.000Z | 2021-12-17T14:16:38.000Z | src/a2c.py | allisonchen23/Pensieve-PPO2 | c4add70d3e1e28a6d2e90f2571ca53d1d35647e1 | [
"BSD-2-Clause"
] | null | null | null | src/a2c.py | allisonchen23/Pensieve-PPO2 | c4add70d3e1e28a6d2e90f2571ca53d1d35647e1 | [
"BSD-2-Clause"
] | 1 | 2021-05-08T19:09:17.000Z | 2021-05-08T19:09:17.000Z | import tflearn
import math
import numpy as np
import tensorflow as tf
import os
import time
os.environ['CUDA_VISIBLE_DEVICES'] = '2'
FEATURE_NUM = 128
EPS = 1e-4
GAMMA = 0.99
class Network():
def CreateNetwork(self, inputs):
with tf.variable_scope('actor'):
split_0 = tflearn.fully_connected(
... | 36.854015 | 96 | 0.597148 | import tflearn
import math
import numpy as np
import tensorflow as tf
import os
import time
os.environ['CUDA_VISIBLE_DEVICES'] = '2'
FEATURE_NUM = 128
EPS = 1e-4
GAMMA = 0.99
class Network():
def CreateNetwork(self, inputs):
with tf.variable_scope('actor'):
split_0 = tflearn.fully_connected(
... | true | true |
f743dda9f24b43285ac4f38d2a8673a93d2f65cd | 1,376 | py | Python | analysis/mixed/plot_churn.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 66 | 2021-07-05T21:55:27.000Z | 2022-03-20T20:44:38.000Z | analysis/mixed/plot_churn.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 8 | 2021-07-18T09:00:12.000Z | 2022-03-15T17:44:11.000Z | analysis/mixed/plot_churn.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 6 | 2021-07-11T12:25:05.000Z | 2022-01-04T21:14:50.000Z | import psycopg2
import toml
import matplotlib.pyplot as plt
import numpy as np
from lib import node_time, node_uptime
config = toml.load("./db.toml")['psql']
conn = psycopg2.connect(
host=config['host'],
port=config['port'],
database=config['database'],
user=config['user'],
password=config['passwor... | 28.666667 | 99 | 0.72093 | import psycopg2
import toml
import matplotlib.pyplot as plt
import numpy as np
from lib import node_time, node_uptime
config = toml.load("./db.toml")['psql']
conn = psycopg2.connect(
host=config['host'],
port=config['port'],
database=config['database'],
user=config['user'],
password=config['passwor... | true | true |
f743de2e9eae59137567b98378d451cd987ea375 | 422 | py | Python | leetcode/343.py | windniw/just-for-fun | 54e5c2be145f3848811bfd127f6a89545e921570 | [
"Apache-2.0"
] | 1 | 2019-08-28T23:15:25.000Z | 2019-08-28T23:15:25.000Z | leetcode/343.py | windniw/just-for-fun | 54e5c2be145f3848811bfd127f6a89545e921570 | [
"Apache-2.0"
] | null | null | null | leetcode/343.py | windniw/just-for-fun | 54e5c2be145f3848811bfd127f6a89545e921570 | [
"Apache-2.0"
] | null | null | null | """
link: https://leetcode.com/problems/integer-break
problem: 将n拆分成若干个整数之和,求这堆整数的最大积,2 <= n <= 58
solution: DP。dp[i] 为 n==i 时的最优解,遍历所有组合可能即可
"""
class Solution:
def integerBreak(self, n: int) -> int:
dp = [1 for _ in range(n + 1)]
for i in range(2, n + 1):
for j in range(1, i // 2 ... | 22.210526 | 73 | 0.523697 |
class Solution:
def integerBreak(self, n: int) -> int:
dp = [1 for _ in range(n + 1)]
for i in range(2, n + 1):
for j in range(1, i // 2 + 1):
dp[i] = max(dp[i], max(dp[j], j) * max(dp[i - j], i - j))
return dp[n]
| true | true |
f743de4b238b8041d1b00ae001310dad81c6600b | 1,537 | py | Python | module2-sql-for-analysis/insert_titantic.py | bendevera/DS-Unit-3-Sprint-2-SQL-and-Databases | 24290da3bdbfaaadfa87c23f6f4196e2220360ab | [
"MIT"
] | null | null | null | module2-sql-for-analysis/insert_titantic.py | bendevera/DS-Unit-3-Sprint-2-SQL-and-Databases | 24290da3bdbfaaadfa87c23f6f4196e2220360ab | [
"MIT"
] | null | null | null | module2-sql-for-analysis/insert_titantic.py | bendevera/DS-Unit-3-Sprint-2-SQL-and-Databases | 24290da3bdbfaaadfa87c23f6f4196e2220360ab | [
"MIT"
] | null | null | null | import pandas as pd
import psycopg2
import os
from dotenv import load_dotenv
load_dotenv()
# read in our data
df = pd.read_csv('./titanic.csv')
print(f"DF shape: {df.shape}")
# create connection to db we want to move the data to
conn = psycopg2.connect(
host=os.getenv('DB_HOST'),
dbname=os.getenv('DB_USER')... | 24.790323 | 127 | 0.672739 | import pandas as pd
import psycopg2
import os
from dotenv import load_dotenv
load_dotenv()
df = pd.read_csv('./titanic.csv')
print(f"DF shape: {df.shape}")
conn = psycopg2.connect(
host=os.getenv('DB_HOST'),
dbname=os.getenv('DB_USER'),
user=os.getenv('DB_USER'),
password=os.getenv('DB_PASSWORD'... | true | true |
f743de7c1fadef4fbce8ffeb9b5ceec416292293 | 6,688 | py | Python | dbreak/parser.py | jrhege/dbreak | 095638b4716d036a02dd0761010555da4973bd73 | [
"MIT"
] | null | null | null | dbreak/parser.py | jrhege/dbreak | 095638b4716d036a02dd0761010555da4973bd73 | [
"MIT"
] | null | null | null | dbreak/parser.py | jrhege/dbreak | 095638b4716d036a02dd0761010555da4973bd73 | [
"MIT"
] | null | null | null | """ Functions for parsing database and shell commands """
import shlex
from typing import Tuple, Callable, List, Dict, Generator
from .constants import SHELL_COMMAND_INDICATOR
from .exc import WrongNumberOfArgumentsError, UnknownCommandError
def parse(command_string: str, shell_command_lookup: Dict[str, dict]) -> ... | 33.44 | 112 | 0.71576 |
import shlex
from typing import Tuple, Callable, List, Dict, Generator
from .constants import SHELL_COMMAND_INDICATOR
from .exc import WrongNumberOfArgumentsError, UnknownCommandError
def parse(command_string: str, shell_command_lookup: Dict[str, dict]) -> Tuple[Callable, List]:
# is a command that shoul... | true | true |
f743de91631d02bcf59603c495413750ccc8e642 | 4,115 | py | Python | azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.567308 | 144 | 0.629648 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class UsageOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize ... | true | true |
f743dea2c02ecd9c7538784ae52c4aeafa5d398c | 685 | py | Python | app/core/migrations/0003_ingredient.py | dluetkewiesmann/recipe-app-api | 3c37cc548c89dc3d82ffced8c0a91591251d58f9 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | dluetkewiesmann/recipe-app-api | 3c37cc548c89dc3d82ffced8c0a91591251d58f9 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | dluetkewiesmann/recipe-app-api | 3c37cc548c89dc3d82ffced8c0a91591251d58f9 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2019-11-12 14:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
n... | 28.541667 | 118 | 0.617518 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingredient',
fields=[
... | true | true |
f743df1dc064d0853229a108b0534dc35d63e473 | 4,871 | py | Python | Assignment/network/util.py | MC-DeltaT/DSA-Practicals | 5c77cac1cfee5d756b84722e563813c153486770 | [
"MIT"
] | null | null | null | Assignment/network/util.py | MC-DeltaT/DSA-Practicals | 5c77cac1cfee5d756b84722e563813c153486770 | [
"MIT"
] | null | null | null | Assignment/network/util.py | MC-DeltaT/DSA-Practicals | 5c77cac1cfee5d756b84722e563813c153486770 | [
"MIT"
] | null | null | null | from .network import Person, Post, SocialNetwork
from dsa import Array, mergesort, Set
from typing import List
__all__ = [
"people_by_popularity",
"posts_by_popularity",
"read_event_file",
"read_network_file"
]
# Creates a network from a network file.
def read_network_file(file_path: str, **network... | 38.968 | 90 | 0.554712 | from .network import Person, Post, SocialNetwork
from dsa import Array, mergesort, Set
from typing import List
__all__ = [
"people_by_popularity",
"posts_by_popularity",
"read_event_file",
"read_network_file"
]
def read_network_file(file_path: str, **network_args) -> SocialNetwork:
with open(f... | true | true |
f743dfbdcebffe5851c03fc64e71e2c94a23a05c | 1,912 | py | Python | src/opnsense/scripts/dhcp/get_leases.py | kekek2/core | 5398eb513e9851188dae31a86e0332bef4b000ba | [
"BSD-2-Clause"
] | null | null | null | src/opnsense/scripts/dhcp/get_leases.py | kekek2/core | 5398eb513e9851188dae31a86e0332bef4b000ba | [
"BSD-2-Clause"
] | null | null | null | src/opnsense/scripts/dhcp/get_leases.py | kekek2/core | 5398eb513e9851188dae31a86e0332bef4b000ba | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python2.7
"""
Copyright (c) 2017 Ad Schellevis
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright not... | 39.833333 | 116 | 0.710774 |
import sys
sys.path.insert(0, "/usr/local/opnsense/site-python")
import watchers.dhcpd
import params
import time
import ujson
app_params = {'inactive': '0'}
params.update_params(app_params)
result = list()
dhcpdleases = watchers.dhcpd.DHCPDLease()
for lease in dhcpdleases.watch():
if 'ends' not in lease or leas... | true | true |
f743e1097ea2ea0fccdbfb58384892d390cc382c | 611 | py | Python | tests/inventory/test_management_commands.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | tests/inventory/test_management_commands.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | tests/inventory/test_management_commands.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | from io import StringIO
from django.core.management import call_command
from django.test import TestCase
class InventoryManagementCommandsTest(TestCase):
def test_cleanup_inventory_history(self):
out = StringIO()
call_command('cleanup_inventory_history', stdout=out)
result = out.getvalue()... | 33.944444 | 67 | 0.716858 | from io import StringIO
from django.core.management import call_command
from django.test import TestCase
class InventoryManagementCommandsTest(TestCase):
def test_cleanup_inventory_history(self):
out = StringIO()
call_command('cleanup_inventory_history', stdout=out)
result = out.getvalue()... | true | true |
f743e192e809acee3ec988ab3e1e6c940cc60565 | 2,435 | py | Python | prettyqt/utils/debugging.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 7 | 2019-05-01T01:34:36.000Z | 2022-03-08T02:24:14.000Z | prettyqt/utils/debugging.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 141 | 2019-04-16T11:22:01.000Z | 2021-04-14T15:12:36.000Z | prettyqt/utils/debugging.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 5 | 2019-04-17T11:48:19.000Z | 2021-11-21T10:30:19.000Z | """Module containing helper functions."""
from __future__ import annotations
import collections
import logging
import sys
import traceback
from prettyqt import qt, widgets
from prettyqt.qt import QtCore
logger = logging.getLogger(__name__)
LOG_MAP = {
QtCore.QtMsgType.QtInfoMsg: 20,
QtCore.QtMsgType.QtWar... | 27.988506 | 83 | 0.629158 |
from __future__ import annotations
import collections
import logging
import sys
import traceback
from prettyqt import qt, widgets
from prettyqt.qt import QtCore
logger = logging.getLogger(__name__)
LOG_MAP = {
QtCore.QtMsgType.QtInfoMsg: 20,
QtCore.QtMsgType.QtWarningMsg: 30,
QtCore.QtMsgType.QtCritic... | true | true |
f743e1e31a284b18df206e70807cf402bf156acd | 2,792 | py | Python | tunas/basic_specs.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | tunas/basic_specs.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | tunas/basic_specs.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.022222 | 79 | 0.755014 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from typing import Any, NamedTuple, Sequence
from tunas import schema
from tunas import schema_io
OP_TAG = 'op_indices'
FILTERS_TAG = 'filters_indices'
@schema_io.regist... | true | true |
f743e310e018fd9b0afa84642ad53615a7f4735b | 4,945 | py | Python | kubernetes/client/models/networking_v1beta1_http_ingress_path.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/client/models/networking_v1beta1_http_ingress_path.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/networking_v1beta1_http_ingress_path.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.698718 | 407 | 0.60728 |
from pprint import pformat
from six import iteritems
import re
class NetworkingV1beta1HTTPIngressPath(object):
swagger_types = {
'backend': 'NetworkingV1beta1IngressBackend',
'path': 'str'
}
attribute_map = {
'backend': 'backend',
'path': 'path'
}
def __init... | true | true |
f743e4e164728376816904d9b7164d236213efc6 | 10,187 | py | Python | dvmvs/pairnet/run-testing.py | hashi0203/deep-video-mvs | b3943a9249d522dca3e6cd603e427f611cc7bad5 | [
"MIT"
] | 1 | 2022-01-10T07:51:41.000Z | 2022-01-10T07:51:41.000Z | dvmvs/pairnet/run-testing.py | MorchelPeng/deep-video-mvs | fa14288f149c5af7b2a49092f729f5c4f44517ba | [
"MIT"
] | null | null | null | dvmvs/pairnet/run-testing.py | MorchelPeng/deep-video-mvs | fa14288f149c5af7b2a49092f729f5c4f44517ba | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import torch
from path import Path
from tqdm import tqdm
from dvmvs.config import Config
from dvmvs.dataset_loader import PreprocessImage, load_image
from dvmvs.pairnet.model import FeatureExtractor, FeatureShrinker, CostVolumeEncoder, CostVolumeDecoder
from dvmvs.utils import cost_volume... | 51.71066 | 138 | 0.559439 | import cv2
import numpy as np
import torch
from path import Path
from tqdm import tqdm
from dvmvs.config import Config
from dvmvs.dataset_loader import PreprocessImage, load_image
from dvmvs.pairnet.model import FeatureExtractor, FeatureShrinker, CostVolumeEncoder, CostVolumeDecoder
from dvmvs.utils import cost_volume... | true | true |
f743e4fe4df93af10a22e3829c23a1ba45f5a8bb | 1,111 | py | Python | template/python3-flask/index.py | AFCYBER-DREAM/piperci-noop-faas | de00ce7b4c73bc2170d637b83737646daaa0ffef | [
"MIT"
] | null | null | null | template/python3-flask/index.py | AFCYBER-DREAM/piperci-noop-faas | de00ce7b4c73bc2170d637b83737646daaa0ffef | [
"MIT"
] | 2 | 2019-06-04T20:41:30.000Z | 2019-06-10T17:44:58.000Z | template/python3-flask/index.py | AFCYBER-DREAM/piperci-noop-faas | de00ce7b4c73bc2170d637b83737646daaa0ffef | [
"MIT"
] | 2 | 2019-06-04T20:37:00.000Z | 2019-06-10T17:53:41.000Z | # Copyright (c) Alex Ellis 2017. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
from flask import Flask, request, jsonify
from function import handler
#from gevent.wsgi import WSGIServer
from gevent.pywsgi import WSGIServer
app = Flask(__name... | 31.742857 | 100 | 0.710171 |
from flask import Flask, request, jsonify
from function import handler
from gevent.pywsgi import WSGIServer
app = Flask(__name__)
@app.before_request
def fix_transfer_encoding():
transfer_encoding = request.headers.get("Transfer-Encoding", None)
if transfer_encoding == u"chunked":
request.enviro... | true | true |
f743ea6742ea4efa1dfedc482a398fffcd6e6afb | 3,977 | py | Python | src/interface_py/h2o4gpu/util/import_data.py | cclauss/h2o4gpu | 1bb161694ce67500383b7b3a542b349aa13ed7fe | [
"Apache-2.0"
] | 1 | 2019-02-12T06:03:19.000Z | 2019-02-12T06:03:19.000Z | src/interface_py/h2o4gpu/util/import_data.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | null | null | null | src/interface_py/h2o4gpu/util/import_data.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | null | null | null | #- * - encoding : utf - 8 - * -
"""
:copyright: 2017-2018 H2O.ai, Inc.
:license: Apache License Version 2.0 (see LICENSE for details)
"""
def import_data(data_path,
use_pandas=False,
intercept=True,
valid_fraction=0.2,
classification=True):
"""Impo... | 34.284483 | 80 | 0.589138 |
def import_data(data_path,
use_pandas=False,
intercept=True,
valid_fraction=0.2,
classification=True):
use_pandas = use_pandas
data_file = data_path
if use_pandas:
print("Reading Data with Pandas")
import pandas as p... | true | true |
f743eada3d2f93bae146bd4f45915c8bab6271c2 | 1,110 | py | Python | integration/for-loop/test.py | xbabka01/retdec-regression-tests | 1ac40cca5165740364e6f7fb72b20820eac9bc7c | [
"MIT"
] | 8 | 2017-12-14T14:25:17.000Z | 2019-03-09T03:29:12.000Z | integration/for-loop/test.py | xbabka01/retdec-regression-tests | 1ac40cca5165740364e6f7fb72b20820eac9bc7c | [
"MIT"
] | 10 | 2019-06-14T09:12:55.000Z | 2021-10-01T12:15:43.000Z | integration/for-loop/test.py | xbabka01/retdec-regression-tests | 1ac40cca5165740364e6f7fb72b20820eac9bc7c | [
"MIT"
] | 8 | 2019-05-10T14:59:48.000Z | 2022-03-07T16:34:23.000Z | from regression_tests import *
class TestBase(Test):
def test_c_contains_for_or_while_loop(self):
assert self.out_c.contains(r'(for|while) \(')
def test_c_contains_no_gotos(self):
assert not self.out_c.contains(r'goto .*;')
def test_c_contains_all_strings(self):
assert self.out_c.... | 28.461538 | 63 | 0.677477 | from regression_tests import *
class TestBase(Test):
def test_c_contains_for_or_while_loop(self):
assert self.out_c.contains(r'(for|while) \(')
def test_c_contains_no_gotos(self):
assert not self.out_c.contains(r'goto .*;')
def test_c_contains_all_strings(self):
assert self.out_c.... | true | true |
f743eb7f05becce16f3310b6508667d3340f1331 | 568 | py | Python | submissions/two-sum-iv-input-is-a-bst/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | submissions/two-sum-iv-input-is-a-bst/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | 1 | 2022-03-04T20:24:32.000Z | 2022-03-04T20:31:58.000Z | submissions/two-sum-iv-input-is-a-bst/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | from typing import Optional
class Solution:
def search(self, node: Optional[TreeNode], target: int):
if target - node.val in self.set and target - node.val != node.val:
self.flag = True
return
self.set.add(node.val)
if node.left:
self.search(node.left, t... | 28.4 | 75 | 0.577465 | from typing import Optional
class Solution:
def search(self, node: Optional[TreeNode], target: int):
if target - node.val in self.set and target - node.val != node.val:
self.flag = True
return
self.set.add(node.val)
if node.left:
self.search(node.left, t... | true | true |
f743eb8866775fb823b1d4ef6b779609406d5f22 | 15,158 | py | Python | datafaucet/resources.py | SylarCS/datalabframework | 273d91aa04ffb1e86c3a9ca7d58722cfd98537ae | [
"MIT"
] | 1 | 2019-10-31T08:38:47.000Z | 2019-10-31T08:38:47.000Z | datafaucet/resources.py | SylarCS/datalabframework | 273d91aa04ffb1e86c3a9ca7d58722cfd98537ae | [
"MIT"
] | null | null | null | datafaucet/resources.py | SylarCS/datalabframework | 273d91aa04ffb1e86c3a9ca7d58722cfd98537ae | [
"MIT"
] | 3 | 2019-06-25T09:26:40.000Z | 2019-07-16T10:00:03.000Z | import os
import re
import ctypes
import zlib
import functools
from urllib.parse import urlparse
from collections import namedtuple
from copy import deepcopy
from datafaucet import metadata
from datafaucet.paths import rootdir
from datafaucet._utils import merge, to_ordered_dict
from datafaucet.yaml import YamlDict
... | 28.122449 | 110 | 0.558187 | import os
import re
import ctypes
import zlib
import functools
from urllib.parse import urlparse
from collections import namedtuple
from copy import deepcopy
from datafaucet import metadata
from datafaucet.paths import rootdir
from datafaucet._utils import merge, to_ordered_dict
from datafaucet.yaml import YamlDict
... | true | true |
f743eb9be927df859170b363e210f2f952055731 | 135 | py | Python | app/helpers/exceptions.py | ONSdigital/sdx-receipt-rrm | b281cca78b56632765b1f4ec8bd9db54134f948e | [
"MIT"
] | null | null | null | app/helpers/exceptions.py | ONSdigital/sdx-receipt-rrm | b281cca78b56632765b1f4ec8bd9db54134f948e | [
"MIT"
] | 69 | 2016-12-22T15:16:20.000Z | 2021-03-19T23:58:24.000Z | app/helpers/exceptions.py | ONSdigital/sdx-receipt-rrm | b281cca78b56632765b1f4ec8bd9db54134f948e | [
"MIT"
] | 1 | 2021-04-11T07:51:27.000Z | 2021-04-11T07:51:27.000Z | class DecryptError(Exception):
"""
Can't even decrypt the message. May be corrupt or keys may be out of step.
"""
pass
| 22.5 | 78 | 0.644444 | class DecryptError(Exception):
pass
| true | true |
f743ebde7ba670f106aed4652389f35a17f9b962 | 3,685 | py | Python | fonts/blade3d_agp_8x8.py | ccccmagicboy/st7735_mpy | b15f1bde69fbe6e0eb4931c57e71c136d8e7f024 | [
"MIT"
] | 6 | 2020-07-11T16:59:19.000Z | 2021-07-16T19:32:49.000Z | ports/esp32/user_modules/st7735_mpy/fonts/blade3d_agp_8x8.py | d4niele/micropython | a1f7b37d392bf46b28045ce215ae899fda8d8c38 | [
"MIT"
] | 1 | 2020-04-14T03:14:45.000Z | 2020-04-14T03:14:45.000Z | fonts/blade3d_agp_8x8.py | ccccmagicboy/st7735_mpy | b15f1bde69fbe6e0eb4931c57e71c136d8e7f024 | [
"MIT"
] | null | null | null | """converted from ..\fonts\BLADE3D_AGP__8x8.bin """
WIDTH = 8
HEIGHT = 8
FIRST = 0x20
LAST = 0x7f
_FONT =\
b'\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\
b'\x6c\x6c\x6c\x00\x00\x00\x00\x00'\
b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\
b'\x18\x7e\xc0\x7c\x06\xfc\x18\x00'\
b'\x00\xc6\xcc\x18\x30\x66\x... | 35.095238 | 51 | 0.675984 | WIDTH = 8
HEIGHT = 8
FIRST = 0x20
LAST = 0x7f
_FONT =\
b'\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\
b'\x6c\x6c\x6c\x00\x00\x00\x00\x00'\
b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\
b'\x18\x7e\xc0\x7c\x06\xfc\x18\x00'\
b'\x00\xc6\xcc\x18\x30\x66\xc6\x00'\
b'\x38\x6c\x38\x76\xdc\xcc\x76\x00'\
b'\x30... | true | true |
f743ebf8a7c113ccf62c26e24a4a05e7d5479fbc | 8,127 | py | Python | day_15.py | itwasscience/AdventOfCode-2021 | 45867c902f737ed22291826b7ce8dcf8c932e8af | [
"MIT"
] | null | null | null | day_15.py | itwasscience/AdventOfCode-2021 | 45867c902f737ed22291826b7ce8dcf8c932e8af | [
"MIT"
] | null | null | null | day_15.py | itwasscience/AdventOfCode-2021 | 45867c902f737ed22291826b7ce8dcf8c932e8af | [
"MIT"
] | null | null | null | from __future__ import annotations
import itertools
from dataclasses import dataclass
from typing import List, Optional
import heapq
import time
import cProfile
@dataclass
class Edge:
"""Not to be used directly - does not validate nodes build inverse relationships. Use the node methods."""
source: Node
... | 30.901141 | 110 | 0.556909 | from __future__ import annotations
import itertools
from dataclasses import dataclass
from typing import List, Optional
import heapq
import time
import cProfile
@dataclass
class Edge:
source: Node
target: Node
cost: int
def __init__(self, source: Node, target: Node, cost: int):
self.source ... | true | true |
f743ec34613bfe2b164e61c9a333bac534401870 | 291 | py | Python | precalibrate.py | architsakhadeo/gadpu | 67b8290c686ebb81d73c83a20208951f3e5b84f2 | [
"MIT"
] | null | null | null | precalibrate.py | architsakhadeo/gadpu | 67b8290c686ebb81d73c83a20208951f3e5b84f2 | [
"MIT"
] | null | null | null | precalibrate.py | architsakhadeo/gadpu | 67b8290c686ebb81d73c83a20208951f3e5b84f2 | [
"MIT"
] | null | null | null | import spam
import glob
def precalibrater():
uvfits_files = glob.glob('*.UVFITS')
#flag_files = glob.glob('*.FLAGS*')
for i in range(0,len(uvfits_files)):
#if source_name in uvfits_files[i]:
#print source_name
spam.pre_calibrate_targets(uvfits_files[i])
| 26.454545 | 51 | 0.666667 | import spam
import glob
def precalibrater():
uvfits_files = glob.glob('*.UVFITS')
for i in range(0,len(uvfits_files)):
spam.pre_calibrate_targets(uvfits_files[i])
| true | true |
f743ec6944bd157c31f23f598835ee76dd5d8e3d | 1,561 | py | Python | torch/ao/quantization/fx/backend_config/native.py | ljhOfGithub/pytorch | c568f7b16f2a98d72ff5b7c6c6161b67b2c27514 | [
"Intel"
] | 1 | 2022-01-02T09:02:47.000Z | 2022-01-02T09:02:47.000Z | torch/ao/quantization/fx/backend_config/native.py | ljhOfGithub/pytorch | c568f7b16f2a98d72ff5b7c6c6161b67b2c27514 | [
"Intel"
] | null | null | null | torch/ao/quantization/fx/backend_config/native.py | ljhOfGithub/pytorch | c568f7b16f2a98d72ff5b7c6c6161b67b2c27514 | [
"Intel"
] | null | null | null | import torch
from .observation_type import ObservationType
import torch.nn.qat as nnqat
def get_native_backend_config_dict():
""" Get backend for PyTorch Native backend_config_dict (fbgemm/qnnpack)
"""
# dtype configs
# weighted op int8 config
# activation: quint8, weight: qint8, bias: float
w... | 34.688889 | 95 | 0.65663 | import torch
from .observation_type import ObservationType
import torch.nn.qat as nnqat
def get_native_backend_config_dict():
weighted_op_int8_dtype_config = {
"input_dtype": torch.quint8,
"weight_dtype": torch.qint8,
"bias_dtype": torch.float,
... | true | true |
f743ec8b800f40005830b94542ba451ce2ed9dff | 5,073 | py | Python | source/meta_compare/language_modeling/sls_language_modeling.py | geez0219/ARC | f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | [
"Apache-2.0"
] | 1 | 2021-10-11T07:28:36.000Z | 2021-10-11T07:28:36.000Z | source/meta_compare/language_modeling/sls_language_modeling.py | geez0219/ARC | f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | [
"Apache-2.0"
] | null | null | null | source/meta_compare/language_modeling/sls_language_modeling.py | geez0219/ARC | f2176f0d442d4a2d6028f0770b1efc1a9ae982b8 | [
"Apache-2.0"
] | 2 | 2021-06-15T21:07:53.000Z | 2021-06-17T02:41:46.000Z | import os
import fastestimator as fe
import numpy as np
import sls
import torch
import torch.nn as nn
import wget
from fastestimator.op.numpyop import NumpyOp
from fastestimator.op.tensorop import TensorOp
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.op.tensorop.model import ModelOp, Upda... | 37.858209 | 115 | 0.637887 | import os
import fastestimator as fe
import numpy as np
import sls
import torch
import torch.nn as nn
import wget
from fastestimator.op.numpyop import NumpyOp
from fastestimator.op.tensorop import TensorOp
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.op.tensorop.model import ModelOp, Upda... | true | true |
f743ed839d336665e4e5dedd743333ebcb94fb26 | 547 | py | Python | Chapter07/code/chapter7_01.py | sTone3/Tkinter-GUI-Application-Development-Cookbook | 6c42edaa66c30d13e1903f3a3a66f609f20783d9 | [
"MIT"
] | 43 | 2018-05-09T23:29:07.000Z | 2022-03-05T02:03:32.000Z | Chapter07/code/chapter7_01.py | wenxuefeng3930/Tkinter-GUI-Application-Development-Cookbook | 6e22bc472e07a9aaa017ef66bfd32644578a873a | [
"MIT"
] | null | null | null | Chapter07/code/chapter7_01.py | wenxuefeng3930/Tkinter-GUI-Application-Development-Cookbook | 6e22bc472e07a9aaa017ef66bfd32644578a873a | [
"MIT"
] | 40 | 2018-06-18T14:44:13.000Z | 2022-03-12T09:11:50.000Z | import tkinter as tk
class App(tk.Tk):
def __init__(self):
super().__init__()
self.title("Basic canvas")
self.canvas = tk.Canvas(self, bg="white")
self.label = tk.Label(self)
self.canvas.bind("<Motion>", self.mouse_motion)
self.canvas.pack()
self.label.pac... | 22.791667 | 55 | 0.566728 | import tkinter as tk
class App(tk.Tk):
def __init__(self):
super().__init__()
self.title("Basic canvas")
self.canvas = tk.Canvas(self, bg="white")
self.label = tk.Label(self)
self.canvas.bind("<Motion>", self.mouse_motion)
self.canvas.pack()
self.label.pac... | true | true |
f743ee719fa0cff5d1b3164a68b8b6e1510b6601 | 532 | py | Python | visualize_normal_score_transfers.py | longyearxuk/sokrg | 001fcf8275eb158765de4e99e0d442b1712aa061 | [
"BSD-3-Clause"
] | 2 | 2021-07-20T22:59:24.000Z | 2021-07-20T23:02:58.000Z | visualize_normal_score_transfers.py | longyearxuk/sokrg | 001fcf8275eb158765de4e99e0d442b1712aa061 | [
"BSD-3-Clause"
] | null | null | null | visualize_normal_score_transfers.py | longyearxuk/sokrg | 001fcf8275eb158765de4e99e0d442b1712aa061 | [
"BSD-3-Clause"
] | 1 | 2021-07-20T23:58:53.000Z | 2021-07-20T23:58:53.000Z | import pandas as pd
import matplotlib.pyplot as plt
from numpy.random import randn
from krg_utils import transform_normal_scores
r = randn(10000)
slip_sc = pd.read_csv('slip_nscore_transform_table.csv')
slip = transform_normal_scores(r, slip_sc)
avg_slip = slip_sc['x'].sum() / len(slip_sc['x'])
avg_score = slip_sc['... | 28 | 60 | 0.736842 | import pandas as pd
import matplotlib.pyplot as plt
from numpy.random import randn
from krg_utils import transform_normal_scores
r = randn(10000)
slip_sc = pd.read_csv('slip_nscore_transform_table.csv')
slip = transform_normal_scores(r, slip_sc)
avg_slip = slip_sc['x'].sum() / len(slip_sc['x'])
avg_score = slip_sc['... | true | true |
f743ef1f6c6a7987bbec9b57f3aab00ae11ba480 | 112 | py | Python | nslocalizer.py | kolyadenko/nslocalizer | 70fab1f5bc6f0ebfe7f7e394dc1739ea50cde29a | [
"BSD-3-Clause"
] | 172 | 2016-09-03T22:27:37.000Z | 2022-03-09T03:35:49.000Z | nslocalizer.py | kolyadenko/nslocalizer | 70fab1f5bc6f0ebfe7f7e394dc1739ea50cde29a | [
"BSD-3-Clause"
] | 7 | 2016-12-19T12:22:50.000Z | 2019-05-03T06:38:46.000Z | nslocalizer.py | kolyadenko/nslocalizer | 70fab1f5bc6f0ebfe7f7e394dc1739ea50cde29a | [
"BSD-3-Clause"
] | 11 | 2016-09-04T14:04:13.000Z | 2021-05-21T12:05:16.000Z | #!/usr/bin/python
import nslocalizer
def main():
nslocalizer.main()
if __name__ == "__main__":
main() | 12.444444 | 26 | 0.651786 |
import nslocalizer
def main():
nslocalizer.main()
if __name__ == "__main__":
main() | true | true |
f743ef71b85244d6fd02236f433756354210556c | 127 | py | Python | extensions/skull.py | Kev-in123/joshgone | b6ca22b273222d2ff5a2325e2b192d1acfcd69de | [
"MIT"
] | null | null | null | extensions/skull.py | Kev-in123/joshgone | b6ca22b273222d2ff5a2325e2b192d1acfcd69de | [
"MIT"
] | null | null | null | extensions/skull.py | Kev-in123/joshgone | b6ca22b273222d2ff5a2325e2b192d1acfcd69de | [
"MIT"
] | null | null | null | def setup(B):
@B.listen()
async def on_message(M):"💀"in M.content and await M.channel.send("http://tenor.com/view/10107813")
| 31.75 | 99 | 0.700787 | def setup(B):
@B.listen()
async def on_message(M):"💀"in M.content and await M.channel.send("http://tenor.com/view/10107813")
| true | true |
f743efc3476efbcae634623449478378dc76f3e4 | 1,092 | py | Python | src/visualization/visualize.py | rajayalamanchili/image_caption_generator | 0d1b8a3262b3dcf9329c4685d9f4026bdf7274db | [
"MIT"
] | null | null | null | src/visualization/visualize.py | rajayalamanchili/image_caption_generator | 0d1b8a3262b3dcf9329c4685d9f4026bdf7274db | [
"MIT"
] | null | null | null | src/visualization/visualize.py | rajayalamanchili/image_caption_generator | 0d1b8a3262b3dcf9329c4685d9f4026bdf7274db | [
"MIT"
] | null | null | null | from src.data.datasets import FlickrDataset
from src.config import config
import matplotlib.pyplot as plt
import torch
from PIL import Image
def display_img_FlickrDataset(dataset, index=0, predicted_caption=None):
image = Image.open(dataset.images_directory / dataset.image_ids[index])
caption_txt = "\n".... | 36.4 | 89 | 0.709707 | from src.data.datasets import FlickrDataset
from src.config import config
import matplotlib.pyplot as plt
import torch
from PIL import Image
def display_img_FlickrDataset(dataset, index=0, predicted_caption=None):
image = Image.open(dataset.images_directory / dataset.image_ids[index])
caption_txt = "\n".... | true | true |
f743f075b71f34c008fe9a24eeb0107af283da24 | 809 | py | Python | castor_krfe/matrices.py | maremita/CASTOR_KRFE | 2cc01d202640a580f9923ab6ff262f0ba1e1ec0c | [
"MIT"
] | null | null | null | castor_krfe/matrices.py | maremita/CASTOR_KRFE | 2cc01d202640a580f9923ab6ff262f0ba1e1ec0c | [
"MIT"
] | null | null | null | castor_krfe/matrices.py | maremita/CASTOR_KRFE | 2cc01d202640a580f9923ab6ff262f0ba1e1ec0c | [
"MIT"
] | null | null | null | def generateMatrice(data, K_mer, k):
# Variables
X = []
# Generate K-mer dictionnary
X_dict = {}
for i, e in enumerate(K_mer): X_dict[e] = 0;
# Generates X (matrix attributes)
for d in data:
x = []
x_dict = X_dict.copy()
# Count K-mer occurences (with overlaping)
for i in range(0, len(d[1]) - k + 1... | 20.74359 | 64 | 0.637824 | def generateMatrice(data, K_mer, k):
X = []
X_dict = {}
for i, e in enumerate(K_mer): X_dict[e] = 0;
for d in data:
x = []
x_dict = X_dict.copy()
for i in range(0, len(d[1]) - k + 1, 1):
try: x_dict[d[1][i:i + k]] = x_dict[d[1][i:i + k]] + 1;
except: pass
for value in x_dict:
... | true | true |
f743f0e8f0a1c554a5b2c15a4b60ad0bc05f0839 | 794 | py | Python | saic/urls.py | szaydel/gitpaste | be5319072d92491d2b4788b710e9849b169b359c | [
"BSD-3-Clause"
] | 36 | 2015-01-06T07:25:00.000Z | 2019-08-23T23:06:20.000Z | saic/urls.py | szaydel/gitpaste | be5319072d92491d2b4788b710e9849b169b359c | [
"BSD-3-Clause"
] | 2 | 2015-02-27T19:10:18.000Z | 2015-04-21T15:30:24.000Z | saic/urls.py | szaydel/gitpaste | be5319072d92491d2b4788b710e9849b169b359c | [
"BSD-3-Clause"
] | 15 | 2015-01-05T16:34:11.000Z | 2022-01-20T02:30:45.000Z | from django.conf.urls.defaults import patterns, include, url
from django.views.generic import RedirectView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^admin... | 39.7 | 76 | 0.68262 | from django.conf.urls.defaults import patterns, include, url
from django.views.generic import RedirectView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^admin... | true | true |
f743f14689ca029221392241e522940e12a3c2f7 | 1,053 | py | Python | car/carApp/views.py | cs-fullstack-2019-spring/django-validation-cw-PorcheWooten | 73bf72d06228fb80b1014a6097859a773d63971a | [
"Apache-2.0"
] | null | null | null | car/carApp/views.py | cs-fullstack-2019-spring/django-validation-cw-PorcheWooten | 73bf72d06228fb80b1014a6097859a773d63971a | [
"Apache-2.0"
] | null | null | null | car/carApp/views.py | cs-fullstack-2019-spring/django-validation-cw-PorcheWooten | 73bf72d06228fb80b1014a6097859a773d63971a | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from .forms import CarForm
from .models import NewCar
# Creates form
def index(request):
form = CarForm() #asign model and form to a variable
NewCarModel = NewCar.objects.all()
if request.method == "POST":
form = CarForm(reque... | 33.967742 | 85 | 0.640076 | from django.shortcuts import render
from django.http import HttpResponse
from .forms import CarForm
from .models import NewCar
def index(request):
form = CarForm()
NewCarModel = NewCar.objects.all()
if request.method == "POST":
form = CarForm(request.POST)
if (form.is_valid()):
NewCar... | true | true |
f743f177896fd853243fed58d5a6c3bb24ed2b0d | 2,018 | py | Python | python/sparkts/models/EWMA.py | WeiwenRen/spark-timeseries | f50592901a169c2ade4593dd6035372b121b20ca | [
"Apache-2.0"
] | null | null | null | python/sparkts/models/EWMA.py | WeiwenRen/spark-timeseries | f50592901a169c2ade4593dd6035372b121b20ca | [
"Apache-2.0"
] | null | null | null | python/sparkts/models/EWMA.py | WeiwenRen/spark-timeseries | f50592901a169c2ade4593dd6035372b121b20ca | [
"Apache-2.0"
] | null | null | null | from pyspark.mllib.common import _java2py, _py2java
from pyspark.mllib.linalg import Vectors
from _model import PyModel
"""
Fits an Exponentially Weight Moving Average model (EWMA) (aka. Simple Exponential Smoothing) to
a time series. The model is defined as S_t = (1 - a) * X_t + a * S_{t - 1}, where a is the
smooth... | 36.690909 | 98 | 0.687314 | from pyspark.mllib.common import _java2py, _py2java
from pyspark.mllib.linalg import Vectors
from _model import PyModel
def fit_model(ts, sc=None):
assert sc != None, "Missing SparkContext"
jvm = sc._jvm
jmodel = jvm.com.cloudera.sparkts.models.EWMA.fitModel(
_py2java(sc, Vectors.dense(ts))
... | true | true |
f743f195bed591fd665e7870f1c56ee6721f92b1 | 1,467 | py | Python | Notes/Python/Turtle/rouse.py | lzz42/Notes | 24d66d415a7687e36157cb09337746ccd1f88667 | [
"MIT"
] | 2 | 2020-06-19T08:34:38.000Z | 2021-02-09T09:15:17.000Z | Notes/Python/Turtle/rouse.py | zlzcn/Notes | 24d66d415a7687e36157cb09337746ccd1f88667 | [
"MIT"
] | 1 | 2020-07-17T08:40:26.000Z | 2020-07-28T01:53:39.000Z | Notes/Python/Turtle/rouse.py | lzz42/Notes | 24d66d415a7687e36157cb09337746ccd1f88667 | [
"MIT"
] | null | null | null | import time
from turtle import *
setup(800, 800, 0, 0)
speed(0)
penup()
seth(90)
fd(340)
seth(0)
pendown()
speed(2)
begin_fill()
fillcolor('red')
circle(50, 30)
for i in range(10):
fd(1)
left(10)
circle(40, 40)
for i in range(6):
fd(1)
left(3)
circle(80, 40)
for i in range(20):
fd(0.5)
le... | 9.16875 | 21 | 0.632584 | import time
from turtle import *
setup(800, 800, 0, 0)
speed(0)
penup()
seth(90)
fd(340)
seth(0)
pendown()
speed(2)
begin_fill()
fillcolor('red')
circle(50, 30)
for i in range(10):
fd(1)
left(10)
circle(40, 40)
for i in range(6):
fd(1)
left(3)
circle(80, 40)
for i in range(20):
fd(0.5)
le... | true | true |
f743f3b155c1821c26a1e4aa6149357af74c6186 | 3,309 | py | Python | raiden/utils/ethereum_clients.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 2,101 | 2016-06-01T11:31:49.000Z | 2022-03-27T20:13:19.000Z | raiden/utils/ethereum_clients.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 5,291 | 2016-06-01T18:14:04.000Z | 2022-03-31T11:19:09.000Z | raiden/utils/ethereum_clients.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 484 | 2016-06-01T18:21:06.000Z | 2022-03-22T10:29:45.000Z | import re
from enum import Enum
from typing import Union
from packaging.version import LegacyVersion, Version, parse as parse_version
from raiden.constants import (
HIGHEST_SUPPORTED_GETH_VERSION,
HIGHEST_SUPPORTED_PARITY_VERSION,
LOWEST_SUPPORTED_GETH_VERSION,
LOWEST_SUPPORTED_PARITY_VERSION,
Eth... | 37.602273 | 90 | 0.723481 | import re
from enum import Enum
from typing import Union
from packaging.version import LegacyVersion, Version, parse as parse_version
from raiden.constants import (
HIGHEST_SUPPORTED_GETH_VERSION,
HIGHEST_SUPPORTED_PARITY_VERSION,
LOWEST_SUPPORTED_GETH_VERSION,
LOWEST_SUPPORTED_PARITY_VERSION,
Eth... | true | true |
f743f64f1e79a63cd28daf9d42addba429c20e0d | 16,858 | py | Python | sphinx/writers/manpage.py | Symaxion/sphinx | f4f7936b5c3671153c2646387c8258b1c4e25e3c | [
"BSD-2-Clause"
] | 1 | 2019-09-02T00:37:29.000Z | 2019-09-02T00:37:29.000Z | sphinx/writers/manpage.py | JoeyCluett/sphinx | ff5031c96e90027510ad2d0251972e12da46402c | [
"BSD-2-Clause"
] | 1 | 2019-02-06T06:05:57.000Z | 2019-02-06T06:05:57.000Z | sphinx/writers/manpage.py | JoeyCluett/sphinx | ff5031c96e90027510ad2d0251972e12da46402c | [
"BSD-2-Clause"
] | 1 | 2019-09-02T00:41:05.000Z | 2019-09-02T00:41:05.000Z | """
sphinx.writers.manpage
~~~~~~~~~~~~~~~~~~~~~~
Manual page writer, extended for Sphinx custom nodes.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import warnings
from typing import Iterable, cast
from docutils import nodes
from d... | 31.807547 | 94 | 0.586309 |
import warnings
from typing import Iterable, cast
from docutils import nodes
from docutils.writers.manpage import (
Writer,
Translator as BaseTranslator
)
from sphinx import addnodes
from sphinx.builders import Builder
from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.locale import admoniti... | true | true |
f743f68cf2c570e36b92020f0c0567e9d150d902 | 3,223 | py | Python | malcolm/core/future.py | dls-controls/github-publish-test | 25f6ce1af28eff9930f65e4f2c9fb0474e0b570c | [
"Apache-2.0"
] | null | null | null | malcolm/core/future.py | dls-controls/github-publish-test | 25f6ce1af28eff9930f65e4f2c9fb0474e0b570c | [
"Apache-2.0"
] | null | null | null | malcolm/core/future.py | dls-controls/github-publish-test | 25f6ce1af28eff9930f65e4f2c9fb0474e0b570c | [
"Apache-2.0"
] | null | null | null | # Possible future states (for internal use).
RUNNING = 'RUNNING'
# Task has set the return or exception and this future is filled
FINISHED = 'FINISHED'
_FUTURE_STATES = [
RUNNING,
FINISHED
]
class Error(Exception):
"""Base class for all future-related exceptions."""
# TODO: for review - user-defined... | 28.522124 | 80 | 0.623643 |
RUNNING = 'RUNNING'
FINISHED = 'FINISHED'
_FUTURE_STATES = [
RUNNING,
FINISHED
]
class Error(Exception):
pass
class TimeoutError(Error):
pass
class RemoteError(Error):
pass
class Future(object):
def __init__(self, task):
self._task = task
self._state = RUNNING
... | true | true |
f743f6b648a548a6066befe0a2a0c781dc771aa6 | 12,510 | py | Python | sdk/python/pulumi_azure_native/resources/v20160701/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/resources/v20160701/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/resources/v20160701/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 32.409326 | 149 | 0.611031 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = [
'DeploymentPropertiesArgs',
'IdentityArgs',
'ParametersLinkArgs',
'PlanArgs',
'SkuArgs',
'TemplateLinkArgs',
]... | true | true |
f743f75b7fc4464b108f190c7bac1bfe60753f4a | 3,517 | py | Python | service.py | konichar/parsig.service | 712454f5f49b5b2ed89e67c1b26c47a4ee895d49 | [
"MIT"
] | 1 | 2021-07-15T22:10:07.000Z | 2021-07-15T22:10:07.000Z | service.py | konichar/parsig.service | 712454f5f49b5b2ed89e67c1b26c47a4ee895d49 | [
"MIT"
] | 10 | 2021-08-04T03:09:31.000Z | 2022-02-27T13:07:18.000Z | service.py | konichar/parsig.service | 712454f5f49b5b2ed89e67c1b26c47a4ee895d49 | [
"MIT"
] | null | null | null | import requests
import os
from dotenv import load_dotenv
from pprint import pprint
load_dotenv()
URL = os.getenv("URL")
TOKEN = os.getenv("TOKEN")
headers={"Authorization": f"Bearer {TOKEN}",
"Content-Type": "application/json",
"Accept": "application/vnd.heroku+json; version=3"}
class HerokuClient:
... | 27.053846 | 98 | 0.535399 | import requests
import os
from dotenv import load_dotenv
from pprint import pprint
load_dotenv()
URL = os.getenv("URL")
TOKEN = os.getenv("TOKEN")
headers={"Authorization": f"Bearer {TOKEN}",
"Content-Type": "application/json",
"Accept": "application/vnd.heroku+json; version=3"}
class HerokuClient:
... | true | true |
f743f7f25519e406357d18d3da56c07e59b2ae7e | 2,008 | py | Python | back/scales/views.py | EDario333/idia | 21cab7057f924c58ec098c27effcee1a8f0dc94e | [
"BSD-3-Clause"
] | null | null | null | back/scales/views.py | EDario333/idia | 21cab7057f924c58ec098c27effcee1a8f0dc94e | [
"BSD-3-Clause"
] | 5 | 2021-03-11T05:33:41.000Z | 2022-02-27T10:21:50.000Z | back/scales/views.py | EDario333/idia | 21cab7057f924c58ec098c27effcee1a8f0dc94e | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render
from django.http.response import JsonResponse
from rest_framework.parsers import JSONParser
from rest_framework import status
from .models import Scale
from .serializers import ScaleSerializer
from rest_framework.decorators import api_view
APP_NAME="Scale"
@api_view(['GET', 'PO... | 33.466667 | 133 | 0.748008 | from django.shortcuts import render
from django.http.response import JsonResponse
from rest_framework.parsers import JSONParser
from rest_framework import status
from .models import Scale
from .serializers import ScaleSerializer
from rest_framework.decorators import api_view
APP_NAME="Scale"
@api_view(['GET', 'PO... | true | true |
f743f7fe70772a1049eac2fb5890e16cbe5d80a3 | 627 | py | Python | app_APPium_test/src/Add_Member.py | XuXuClassMate/My_Test_PyProject | 5822455af47f5855d1db4c388c2c973c440a4d3f | [
"Apache-2.0"
] | null | null | null | app_APPium_test/src/Add_Member.py | XuXuClassMate/My_Test_PyProject | 5822455af47f5855d1db4c388c2c973c440a4d3f | [
"Apache-2.0"
] | null | null | null | app_APPium_test/src/Add_Member.py | XuXuClassMate/My_Test_PyProject | 5822455af47f5855d1db4c388c2c973c440a4d3f | [
"Apache-2.0"
] | null | null | null | from appium.webdriver.common.mobileby import MobileBy
from app_APPium_test.src.BasePage import BasePage
from app_APPium_test.src.Manual_add import Manual_add
class Add_Member(BasePage):
def go_to_Manual_add(self):
# self.driver.find_element(MobileBy.XPATH, '//*[@text="手动输入添加"]').click()
self.clic... | 36.882353 | 99 | 0.692185 | from appium.webdriver.common.mobileby import MobileBy
from app_APPium_test.src.BasePage import BasePage
from app_APPium_test.src.Manual_add import Manual_add
class Add_Member(BasePage):
def go_to_Manual_add(self):
self.click(MobileBy.XPATH, '//*[@text="手动输入添加"]')
return Manual_add(self.d... | true | true |
f743f8408433c36abf8cf6d3638cda6ac0252a0c | 858 | py | Python | setup.py | supunkamburugamuva/xblock-tagging | 9ade4ab9ebd61f901b93cd3a3eaf358d318f70f1 | [
"MIT"
] | null | null | null | setup.py | supunkamburugamuva/xblock-tagging | 9ade4ab9ebd61f901b93cd3a3eaf358d318f70f1 | [
"MIT"
] | null | null | null | setup.py | supunkamburugamuva/xblock-tagging | 9ade4ab9ebd61f901b93cd3a3eaf358d318f70f1 | [
"MIT"
] | null | null | null | """Setup for Office Mix XBlock."""
import os
from setuptools import setup
def package_data(pkg, roots):
"""Generic function to find package_data.
All of the files under each of the `roots` will be declared as package
data for package `pkg`.
"""
data = []
for root in roots:
for dirnam... | 22 | 79 | 0.586247 |
import os
from setuptools import setup
def package_data(pkg, roots):
data = []
for root in roots:
for dirname, _, files in os.walk(os.path.join(pkg, root)):
for fname in files:
data.append(os.path.relpath(os.path.join(dirname, fname), pkg))
return {pkg: data}
setup(
... | true | true |
f743f88cbabbab105ae575d6a389ab7c840fa308 | 8,712 | py | Python | dashdir/parse-csv.py | fhmjones/ocgy-dv-fjversion | 176a47d28daabc93821f37decb38fff320491885 | [
"MIT"
] | null | null | null | dashdir/parse-csv.py | fhmjones/ocgy-dv-fjversion | 176a47d28daabc93821f37decb38fff320491885 | [
"MIT"
] | null | null | null | dashdir/parse-csv.py | fhmjones/ocgy-dv-fjversion | 176a47d28daabc93821f37decb38fff320491885 | [
"MIT"
] | null | null | null | # any work with the data file
# make a nicer csv to pull from
import pandas as pd
import gsw
# all of the parameters from the full data: 'Longitude [degrees_east]', 'Latitude [degrees_north]',
# 'PRESSURE [dbar]', 'DEPTH [m]', 'CTDTMP [deg C]', 'CTDSAL', 'SALINITY_D_CONC_BOTTLE', 'SALINITY_D_CONC_PUMP',
# 'SALINITY_D... | 40.333333 | 127 | 0.684343 |
import pandas as pd
import gsw
def average_data(cruise_data):
cruise_data = cruise_data.groupby(['Latitude', 'Longitude', 'Station', 'Depth'], as_index=False).mean()
return cruise_data
def remove_empty_data(cruise_data):
grouped_data = cruise_data.groupby(['Latitude', 'Longitude', 'Stati... | true | true |
f743f90b68c18ad7f630db71b8bc94642e5ebeb1 | 3,729 | py | Python | dask_jobqueue/tests/test_sge.py | swertz/dask-jobqueue | 4980e746e9be15e5fe6736b6c496b8faea737fd7 | [
"BSD-3-Clause"
] | 180 | 2018-03-01T22:25:43.000Z | 2022-03-30T10:13:33.000Z | dask_jobqueue/tests/test_sge.py | swertz/dask-jobqueue | 4980e746e9be15e5fe6736b6c496b8faea737fd7 | [
"BSD-3-Clause"
] | 509 | 2018-03-01T22:11:14.000Z | 2022-03-30T18:14:20.000Z | dask_jobqueue/tests/test_sge.py | swertz/dask-jobqueue | 4980e746e9be15e5fe6736b6c496b8faea737fd7 | [
"BSD-3-Clause"
] | 116 | 2018-03-01T23:37:25.000Z | 2022-02-25T15:55:59.000Z | from time import sleep, time
import pytest
from distributed import Client
from dask_jobqueue import SGECluster
import dask
from dask.utils import format_bytes, parse_bytes
from . import QUEUE_WAIT
@pytest.mark.env("sge")
def test_basic(loop):
with SGECluster(
walltime="00:02:00", cores=8, processes=4, ... | 28.465649 | 75 | 0.524537 | from time import sleep, time
import pytest
from distributed import Client
from dask_jobqueue import SGECluster
import dask
from dask.utils import format_bytes, parse_bytes
from . import QUEUE_WAIT
@pytest.mark.env("sge")
def test_basic(loop):
with SGECluster(
walltime="00:02:00", cores=8, processes=4, ... | true | true |
f743fbc3ba9bf7cb26a1788ab1a098a483a5dc5e | 453 | py | Python | week_2/tests/lab6_p1.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | 2 | 2020-11-20T07:43:40.000Z | 2021-05-14T14:40:41.000Z | week_2/tests/lab6_p1.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | null | null | null | week_2/tests/lab6_p1.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | 2 | 2020-06-18T20:35:40.000Z | 2020-09-27T02:54:31.000Z | test = {
'name': '6.1',
'suites': [
{
'cases': [
{
'code': r"""
>>> # It looks like you did not follow the format
>>> # given in the problem. Maybe there's a typo?
>>> 'new_letter' in vars()
True
"""
},
{
'code':... | 18.875 | 59 | 0.324503 | test = {
'name': '6.1',
'suites': [
{
'cases': [
{
'code': r"""
>>> # It looks like you did not follow the format
>>> # given in the problem. Maybe there's a typo?
>>> 'new_letter' in vars()
True
"""
},
{
'code':... | true | true |
f743fc5827ce78ccd6f913ca0d2fbacc832ed479 | 1,189 | py | Python | PlaystoreScraper/display_apps.py | avinashkranjan/PraticalPythonProjects | 12c1f7cedae57a843ceb6aba68cca48df505f341 | [
"MIT"
] | 930 | 2020-09-05T22:07:28.000Z | 2022-03-30T07:56:18.000Z | PlaystoreScraper/display_apps.py | maheshdbabar9340/Amazing-Python-Scripts | e2272048cbe49b4bda5072bbdd8479739bb6c18d | [
"MIT"
] | 893 | 2020-09-04T07:57:24.000Z | 2022-02-08T02:12:26.000Z | PlaystoreScraper/display_apps.py | maheshdbabar9340/Amazing-Python-Scripts | e2272048cbe49b4bda5072bbdd8479739bb6c18d | [
"MIT"
] | 497 | 2020-09-05T08:16:24.000Z | 2022-03-31T00:55:57.000Z | import sqlite3
import os
def sql_connection():
"""
Establishes a connection to the SQL file database
:return connection object:
"""
path = os.path.abspath('PlaystoreDatabase.db')
con = sqlite3.connect(path)
return con
def sql_fetcher(con):
"""
Fetches all the with the given quer... | 22.865385 | 77 | 0.560976 | import sqlite3
import os
def sql_connection():
path = os.path.abspath('PlaystoreDatabase.db')
con = sqlite3.connect(path)
return con
def sql_fetcher(con):
query = input("\nEnter query to search: r/")
count = 0
cur = con.cursor()
cur.execute('SELECT * FROM apps')
rows = cur.fetchall... | true | true |
f743fcef5b2cfd38d06a7364ff4f6352cfc60405 | 3,396 | py | Python | src/plot.py | agtoever/twixtbot-ui | 366d7bef33fdbaa260ea8b3330fa9ab29ad05f03 | [
"MIT"
] | null | null | null | src/plot.py | agtoever/twixtbot-ui | 366d7bef33fdbaa260ea8b3330fa9ab29ad05f03 | [
"MIT"
] | 2 | 2021-11-10T20:13:45.000Z | 2022-01-12T07:38:04.000Z | src/plot.py | agtoever/twixtbot-ui | 366d7bef33fdbaa260ea8b3330fa9ab29ad05f03 | [
"MIT"
] | null | null | null |
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.pyplot as plt
import numpy as np
import constants as ct
class ThreeBarPlot():
def __init__(self, canvas, bar_color):
self.bar_color = bar_color
self.prepare(canvas)
def update(self, values=None, xmax=None):
... | 31.738318 | 79 | 0.547409 |
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.pyplot as plt
import numpy as np
import constants as ct
class ThreeBarPlot():
def __init__(self, canvas, bar_color):
self.bar_color = bar_color
self.prepare(canvas)
def update(self, values=None, xmax=None):
... | true | true |
f743fd35eb754aa25f51c4f441d78d0ec74afaf7 | 76 | py | Python | eegp/paradigms/__init__.py | TanTingyi/eegp | 26b5e6958ebe15732f5a266f64987164f7644746 | [
"MIT"
] | 10 | 2021-04-23T07:25:45.000Z | 2022-03-17T13:10:31.000Z | eegp/paradigms/__init__.py | TanTingyi/eegp | 26b5e6958ebe15732f5a266f64987164f7644746 | [
"MIT"
] | null | null | null | eegp/paradigms/__init__.py | TanTingyi/eegp | 26b5e6958ebe15732f5a266f64987164f7644746 | [
"MIT"
] | 3 | 2021-04-23T07:36:34.000Z | 2021-04-23T08:52:13.000Z | from .delaymatch import LetterDelayMatch
from .physionet import PhysioNetMI
| 25.333333 | 40 | 0.868421 | from .delaymatch import LetterDelayMatch
from .physionet import PhysioNetMI
| true | true |
f743fd4aab41716900ee63a6f68f8af1b6a32303 | 1,567 | py | Python | hooks/obsolete_messages.py | mondeja/pre-commit-po-hooks | 6c96941357699b283c46528d34821631e1aff324 | [
"BSD-3-Clause"
] | null | null | null | hooks/obsolete_messages.py | mondeja/pre-commit-po-hooks | 6c96941357699b283c46528d34821631e1aff324 | [
"BSD-3-Clause"
] | 2 | 2021-08-25T04:56:36.000Z | 2022-02-25T16:47:39.000Z | hooks/obsolete_messages.py | mondeja/pre-commit-po-hooks | 6c96941357699b283c46528d34821631e1aff324 | [
"BSD-3-Clause"
] | null | null | null | """Checks for obsolete messages in PO files.
Returns an error code if a PO file has an obsolete message.
"""
import argparse
import sys
def check_obsolete_messages(filenames, quiet=False):
"""Warns about all obsolete messages found in a set of PO files.
Parameters
----------
filenames : list
... | 27.017241 | 87 | 0.634333 |
import argparse
import sys
def check_obsolete_messages(filenames, quiet=False):
exitcode = 0
for filename in filenames:
with open(filename) as f:
content_lines = f.readlines()
_inside_obsolete_message = False
for i, line in enumerate(content_lines):
if not _in... | true | true |
f743fde3bdaeb602acd0eec644877fe9b09f93c7 | 6,109 | py | Python | HLTriggerOffline/HeavyFlavor/python/heavyFlavorValidationHarvestingSequence_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | HLTriggerOffline/HeavyFlavor/python/heavyFlavorValidationHarvestingSequence_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | HLTriggerOffline/HeavyFlavor/python/heavyFlavorValidationHarvestingSequence_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvesting_cfi import *
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
baseFolderPath = 'HLT/BPH/HLT/'
hfv1 = heavyFlavorValidationHarvesting.clone(
MyDQMrootFolder = cms.untracked.string(baseFolderPath + 'HLT_DoubleMu4_3_Bs_v')
)
hfv2 = heavyFlavor... | 36.363095 | 108 | 0.790146 | from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvesting_cfi import *
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
baseFolderPath = 'HLT/BPH/HLT/'
hfv1 = heavyFlavorValidationHarvesting.clone(
MyDQMrootFolder = cms.untracked.string(baseFolderPath + 'HLT_DoubleMu4_3_Bs_v')
)
hfv2 = heavyFlavor... | true | true |
f743fe0f5d383fefb27261a22b64df7f8debdb2b | 1,273 | py | Python | migrations/versions/0122_add_service_letter_contact.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0122_add_service_letter_contact.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0122_add_service_letter_contact.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """
Revision ID: 0122_add_service_letter_contact
Revises: 0121_nullable_logos
Create Date: 2017-09-21 12:16:02.975120
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0122_add_service_letter_contact"
down_revision = "0121_nullable_logos"
def upgrade():
o... | 28.288889 | 79 | 0.6685 | import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0122_add_service_letter_contact"
down_revision = "0121_nullable_logos"
def upgrade():
op.create_table(
"service_letter_contacts",
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
... | true | true |
f743fe6f24223a9a9e81d0c22882707489dc0509 | 4,871 | py | Python | net-listeners-callout.py | mattsta/netmatt | ed7a1eab963ea883fcfa04be477a0cd942f3bd49 | [
"Apache-2.0"
] | 13 | 2018-07-27T13:29:43.000Z | 2022-01-25T20:13:59.000Z | net-listeners-callout.py | mattsta/netmatt | ed7a1eab963ea883fcfa04be477a0cd942f3bd49 | [
"Apache-2.0"
] | 1 | 2019-12-27T02:39:49.000Z | 2020-01-01T23:30:41.000Z | net-listeners-callout.py | mattsta/netmatt | ed7a1eab963ea883fcfa04be477a0cd942f3bd49 | [
"Apache-2.0"
] | 1 | 2018-07-30T09:31:48.000Z | 2018-07-30T09:31:48.000Z | #!/usr/bin/env python3
""" Output a colorized list of listening addresses with owners.
This tool parses the output of ``netstat`` directly to obtain the list
of IPv4 and IPv6 addresses listening on tcp, tcp6, udp, and udp6 ports
also with pids of processes responsible for the listening.
The downside here is to obtai... | 30.254658 | 99 | 0.602956 |
import subprocess
import re
NETSTAT_LISTENING = "/bin/netstat --numeric-hosts --listening --program --tcp --udp --inet --inet6"
TERMINAL_WIDTH = "/usr/bin/tput cols"
class Color:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
BOLD = '\... | true | true |
f743ffe627ae5dad5b7cc10007cb65ccfe4b398f | 12,203 | py | Python | TME 8. DDPG/utils.py | hanouticelina/reinforcement-learning | c7c6765486ea9546bbd8ce75e6032a408a1410cf | [
"MIT"
] | null | null | null | TME 8. DDPG/utils.py | hanouticelina/reinforcement-learning | c7c6765486ea9546bbd8ce75e6032a408a1410cf | [
"MIT"
] | null | null | null | TME 8. DDPG/utils.py | hanouticelina/reinforcement-learning | c7c6765486ea9546bbd8ce75e6032a408a1410cf | [
"MIT"
] | null | null | null | import time
import subprocess
from collections import namedtuple,defaultdict
import logging
import json
import os
import yaml
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
import threading
import numpy as np
import gym
from collections import deque
import random
import... | 29.618932 | 145 | 0.569368 | import time
import subprocess
from collections import namedtuple,defaultdict
import logging
import json
import os
import yaml
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
import threading
import numpy as np
import gym
from collections import deque
import random
import... | true | true |
f7440061a23efdf1c5d45440cf22c95f008a0622 | 3,265 | py | Python | main.py | dhrubokarmaker/RoeBot | fbd86c6c2e5930b0ec41be1b6001ad182cb8e49c | [
"Apache-2.0"
] | 1 | 2022-01-05T09:47:50.000Z | 2022-01-05T09:47:50.000Z | main.py | dhrubokarmaker/RoeBot | fbd86c6c2e5930b0ec41be1b6001ad182cb8e49c | [
"Apache-2.0"
] | null | null | null | main.py | dhrubokarmaker/RoeBot | fbd86c6c2e5930b0ec41be1b6001ad182cb8e49c | [
"Apache-2.0"
] | null | null | null | import nltk
from nltk.stem.lancaster import LancasterStemmer
from nltk.tokenize import word_tokenize
from tensorflow.python.ops.gen_array_ops import expand_dims_eager_fallback
stemmer = LancasterStemmer()
import numpy
import tflearn
import random
import json
import tensorflow as tf
import pickle
import discord
impor... | 24.365672 | 74 | 0.626953 | import nltk
from nltk.stem.lancaster import LancasterStemmer
from nltk.tokenize import word_tokenize
from tensorflow.python.ops.gen_array_ops import expand_dims_eager_fallback
stemmer = LancasterStemmer()
import numpy
import tflearn
import random
import json
import tensorflow as tf
import pickle
import discord
impor... | true | true |
f74400c4f761134229c03bc81040d70b3db85d3d | 7,011 | py | Python | scripts/build_tables.py | mkrowell/phd | 6e139e64e11e29cb5a651c97740ec2972b02e663 | [
"FTL",
"RSA-MD"
] | null | null | null | scripts/build_tables.py | mkrowell/phd | 6e139e64e11e29cb5a651c97740ec2972b02e663 | [
"FTL",
"RSA-MD"
] | null | null | null | scripts/build_tables.py | mkrowell/phd | 6e139e64e11e29cb5a651c97740ec2972b02e663 | [
"FTL",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""
.. script::
:language: Python Version 3.7.4
:platform: Windows 10
:synopsis: build basic tables in Postgres
.. moduleauthor:: Maura Rowell <mkrowell@uw.edu>
"""
# ------------------------------------------------------------------------------
# IMPORTS
# -------------------------... | 36.139175 | 91 | 0.591784 |
from os.path import abspath, dirname, join
import sys
import yaml
sys.path.append(abspath("."))
import src.database
import src.clean
city = "seattle"
srid = 32610
year = "2017"
months = ["07"]
parameters_file = abspath(join(dirname(__file__), "..", "src", "settings.yaml"))
with open(parameters_file, "r") ... | true | true |
f744010c9ac25670924f5fb659d6c0084744f363 | 802 | py | Python | uav/src/main/python/pyspookystuff/uav/actions.py | fahadsiddiqui/spookystuff | e01b73dbb54d6dffb4bdb20c56b47300b5362412 | [
"Apache-2.0"
] | null | null | null | uav/src/main/python/pyspookystuff/uav/actions.py | fahadsiddiqui/spookystuff | e01b73dbb54d6dffb4bdb20c56b47300b5362412 | [
"Apache-2.0"
] | null | null | null | uav/src/main/python/pyspookystuff/uav/actions.py | fahadsiddiqui/spookystuff | e01b73dbb54d6dffb4bdb20c56b47300b5362412 | [
"Apache-2.0"
] | null | null | null | import json
'''
crash course on APM & PX4 flight modes:
APM:
Stabilize
Alt Hold
Loiter
RTL (Return-to-Launch)
Auto
Additional flight modes:
Acro
AutoTune
Brake
Circle
Drift
Guided (and Guided_NoGPS)
Land
PosHold
Sport
Throw
Follow Me
Simple and Super Simple
Avoid_ADSB for ADS-B based avoidance of manned aircraft. Shou... | 13.827586 | 112 | 0.689526 | import json
class DummyPyAction(object):
def __init__(self, a):
self.a = a
def dummy(self, b, c):
print("DEBUG", self.a, b, c)
merged = int(self.a) * int(b) * int(c)
return json.dumps(merged)
| true | true |
f744029281ca32e3ac63123e6ab8e91be38a212f | 7,474 | py | Python | pyramid/scripts/pshell.py | danielpronych/pyramid-doxygen | ad95a8c151c2c4e029e03aed2feda2993380f36f | [
"BSD-2-Clause"
] | null | null | null | pyramid/scripts/pshell.py | danielpronych/pyramid-doxygen | ad95a8c151c2c4e029e03aed2feda2993380f36f | [
"BSD-2-Clause"
] | null | null | null | pyramid/scripts/pshell.py | danielpronych/pyramid-doxygen | ad95a8c151c2c4e029e03aed2feda2993380f36f | [
"BSD-2-Clause"
] | null | null | null | from code import interact
import optparse
import sys
import textwrap
from pyramid.compat import configparser
from pyramid.util import DottedNameResolver
from pyramid.paster import bootstrap
from pyramid.paster import setup_logging
from pyramid.scripts.common import parse_vars
def main(argv=sys.argv, quiet=False):
... | 33.972727 | 78 | 0.581349 | from code import interact
import optparse
import sys
import textwrap
from pyramid.compat import configparser
from pyramid.util import DottedNameResolver
from pyramid.paster import bootstrap
from pyramid.paster import setup_logging
from pyramid.scripts.common import parse_vars
def main(argv=sys.argv, quiet=False):
... | true | true |
f7440327c927057e1260ce1552096f6ff11e124d | 3,305 | py | Python | python-heart/examples/record.py | joegle/hrv-biofeedback | 08152889798d41bd9246c4550174377bf3eaa8f1 | [
"MIT"
] | 20 | 2015-03-21T03:42:59.000Z | 2021-05-14T12:49:52.000Z | python-heart/examples/record.py | joegle/hrv-biofeedback | 08152889798d41bd9246c4550174377bf3eaa8f1 | [
"MIT"
] | 2 | 2015-12-15T22:48:28.000Z | 2015-12-15T22:49:41.000Z | python-heart/examples/record.py | joegle/hrv-biofeedback | 08152889798d41bd9246c4550174377bf3eaa8f1 | [
"MIT"
] | 4 | 2016-09-06T19:09:22.000Z | 2017-11-23T14:13:24.000Z | #!/usr/bin/env python2
from __future__ import print_function
import heart
import datetime
import time
import sys
import numpy as np
import argparse
import os
import stat
class recorder(heart.Heart_Monitor):
"""Command line tool that records the Arduino heart beat data into timestamped file"""
def __init__(sel... | 33.72449 | 121 | 0.605749 |
from __future__ import print_function
import heart
import datetime
import time
import sys
import numpy as np
import argparse
import os
import stat
class recorder(heart.Heart_Monitor):
def __init__(self, args):
heart.Heart_Monitor.__init__(self,args.source)
now = datetime.datetime.now()
... | true | true |
f744038e441d8de29484d6afab6db0b2e042531c | 2,948 | py | Python | nmtlab/trainers/hvd_utils.py | jasonleeinf/nmtlab | 122b70cc226d9ce17ad106a3bd3a5318bd3b359f | [
"MIT"
] | 27 | 2018-07-31T05:25:05.000Z | 2021-09-28T11:26:55.000Z | nmtlab/trainers/hvd_utils.py | jasonleeinf/nmtlab | 122b70cc226d9ce17ad106a3bd3a5318bd3b359f | [
"MIT"
] | null | null | null | nmtlab/trainers/hvd_utils.py | jasonleeinf/nmtlab | 122b70cc226d9ce17ad106a3bd3a5318bd3b359f | [
"MIT"
] | 9 | 2018-09-20T19:44:53.000Z | 2020-12-09T09:51:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import torch
import horovod.torch as hvd
def broadcast_optimizer_state(optimizer, root_rank):
"""
This function is copied from the new... | 37.316456 | 79 | 0.626187 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import torch
import horovod.torch as hvd
def broadcast_optimizer_state(optimizer, root_rank):
if isinstance(optimizer, torch.optim.LBFGS):
raise Va... | true | true |
f744042cb96ca78ad45d4cc1da5b94131ac97075 | 500 | py | Python | nexus/tests/unit/test_rmg_simulation.py | eugeneswalker/qmcpack | 352ff27f163bb92e0c232c48bec8ae7951ed9d8c | [
"NCSA"
] | null | null | null | nexus/tests/unit/test_rmg_simulation.py | eugeneswalker/qmcpack | 352ff27f163bb92e0c232c48bec8ae7951ed9d8c | [
"NCSA"
] | 11 | 2020-05-09T20:57:21.000Z | 2020-06-10T00:00:17.000Z | nexus/tests/unit/test_rmg_simulation.py | williamfgc/qmcpack | 732b473841e7823a21ab55ff397eed059f0f2e96 | [
"NCSA"
] | null | null | null |
import testing
from testing import divert_nexus,restore_nexus,clear_all_sims
from testing import failed,FailedTest
from testing import value_eq,object_eq,text_eq
def test_import():
from rmg import Rmg,generate_rmg
#end def test_import
def test_minimal_init():
from machines import job
from rmg import ... | 17.857143 | 61 | 0.734 |
import testing
from testing import divert_nexus,restore_nexus,clear_all_sims
from testing import failed,FailedTest
from testing import value_eq,object_eq,text_eq
def test_import():
from rmg import Rmg,generate_rmg
def test_minimal_init():
from machines import job
from rmg import Rmg,generate_rmg
... | true | true |
f744050b8975b59dea94fd60746c564138e69aa6 | 114 | py | Python | guet/commands/help/__init__.py | AbhishekMashetty/pairprogrammingmasetty | 0528d4999b472ec6d94058193275a505eaf2c762 | [
"Apache-2.0"
] | 13 | 2018-12-21T22:47:28.000Z | 2021-12-17T14:27:35.000Z | guet/commands/help/__init__.py | chiptopher/guet | 1099ee623311ba1d052237612efc9b06b7ff68bb | [
"Apache-2.0"
] | 63 | 2018-08-30T11:19:12.000Z | 2021-05-13T12:11:08.000Z | guet/commands/help/__init__.py | chiptopher/guet | 1099ee623311ba1d052237612efc9b06b7ff68bb | [
"Apache-2.0"
] | 7 | 2019-05-21T13:52:37.000Z | 2022-01-30T22:57:21.000Z | from ._help import HelpCommandFactory
from ._unknown import UnknownCommandFactory
from ._usage import UsageAction
| 28.5 | 43 | 0.868421 | from ._help import HelpCommandFactory
from ._unknown import UnknownCommandFactory
from ._usage import UsageAction
| true | true |
f744057ad254ebe8f26e0e6e4f5884e900a13078 | 5,218 | py | Python | examples/keyword_spotting/model/mfcc.py | YuehChuan/nnom | 68af27a0631244f2bb78cd4e4f2da916f122991a | [
"Apache-2.0"
] | 1 | 2019-11-01T06:24:19.000Z | 2019-11-01T06:24:19.000Z | examples/keyword_spotting/model/mfcc.py | YuehChuan/nnom | 68af27a0631244f2bb78cd4e4f2da916f122991a | [
"Apache-2.0"
] | null | null | null | examples/keyword_spotting/model/mfcc.py | YuehChuan/nnom | 68af27a0631244f2bb78cd4e4f2da916f122991a | [
"Apache-2.0"
] | null | null | null |
from python_speech_features import mfcc
import scipy.io.wavfile as wav
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import os
import random
def load_noise(path='dat/_background_noise_/'):
noise = []
files = os.listdir(path)
for f in files:
filename = f
if (... | 38.367647 | 208 | 0.578766 |
from python_speech_features import mfcc
import scipy.io.wavfile as wav
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import os
import random
def load_noise(path='dat/_background_noise_/'):
noise = []
files = os.listdir(path)
for f in files:
filename = f
if (... | true | true |
f74405878ce3add626ba02ce13c185d44a6932fa | 467 | py | Python | venv/Scripts/easy_install-script.py | alharethaltalib/Eye-blink-wink-detector | 52af36897f0c9041fc76581fa7e3e35464a28805 | [
"MIT"
] | null | null | null | venv/Scripts/easy_install-script.py | alharethaltalib/Eye-blink-wink-detector | 52af36897f0c9041fc76581fa7e3e35464a28805 | [
"MIT"
] | null | null | null | venv/Scripts/easy_install-script.py | alharethaltalib/Eye-blink-wink-detector | 52af36897f0c9041fc76581fa7e3e35464a28805 | [
"MIT"
] | null | null | null | #!C:\Users\HARETH\Desktop\eye-blink-detection-demo-master\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'... | 35.923077 | 83 | 0.700214 |
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==40.8.0', 'console_scripts', 'easy_install')()
)
| true | true |
f744071d47a3337089a7b8a446be9f50274e514f | 115 | py | Python | snacks/admin.py | rubakanaan/django_x | 30ee23808234282048e1ff7c9cfc5d0f5cc1a5ec | [
"MIT"
] | null | null | null | snacks/admin.py | rubakanaan/django_x | 30ee23808234282048e1ff7c9cfc5d0f5cc1a5ec | [
"MIT"
] | null | null | null | snacks/admin.py | rubakanaan/django_x | 30ee23808234282048e1ff7c9cfc5d0f5cc1a5ec | [
"MIT"
] | 1 | 2021-12-17T20:14:48.000Z | 2021-12-17T20:14:48.000Z | from django.contrib import admin
from .models import Snack
# Register your models here.
admin.site.register(Snack) | 23 | 32 | 0.808696 | from django.contrib import admin
from .models import Snack
admin.site.register(Snack) | true | true |
f74408cfbf666468e6eda97bf72449b8330e7df3 | 18,939 | py | Python | pyqaserver/picketfence_module.py | brjdenis/qaserver | 93a4c3272cf38199e7ef67d1285a9ffacef46883 | [
"MIT"
] | 11 | 2019-12-02T04:27:48.000Z | 2020-06-10T09:18:11.000Z | pyqaserver/picketfence_module.py | brjdenis/pyqaserver | 93a4c3272cf38199e7ef67d1285a9ffacef46883 | [
"MIT"
] | 13 | 2020-10-19T16:38:56.000Z | 2021-05-04T19:44:01.000Z | pyqaserver/picketfence_module.py | brjdenis/qaserver | 93a4c3272cf38199e7ef67d1285a9ffacef46883 | [
"MIT"
] | 2 | 2020-01-13T17:00:41.000Z | 2020-01-28T21:32:58.000Z | import sys
import os
import tempfile
from multiprocessing import Pool
import datetime
import numpy as np
import matplotlib.style
import matplotlib
matplotlib.use('Agg')
from matplotlib.figure import Figure
from mpl_toolkits.axes_grid1 import make_axes_locatable
# To revert back to matplotlib 1.0 style
matplotlib.style... | 44.77305 | 143 | 0.656951 | import sys
import os
import tempfile
from multiprocessing import Pool
import datetime
import numpy as np
import matplotlib.style
import matplotlib
matplotlib.use('Agg')
from matplotlib.figure import Figure
from mpl_toolkits.axes_grid1 import make_axes_locatable
matplotlib.style.use('classic')
from pylinac.core.profi... | true | true |
f744090058ceb4bf61c624eb32e221ad701f2131 | 13,793 | py | Python | venv/Lib/site-packages/sqlalchemy/testing/exclusions.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sqlalchemy/testing/exclusions.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sqlalchemy/testing/exclusions.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | 1 | 2021-06-20T19:28:37.000Z | 2021-06-20T19:28:37.000Z | # testing/exclusions.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import contextlib
import operator
import re
import sys
from . i... | 29.598712 | 80 | 0.559849 |
import contextlib
import operator
import re
import sys
from . import config
from .. import util
from ..util import decorator
from ..util.compat import inspect_getfullargspec
def skip_if(predicate, reason=None):
rule = compound()
pred = _as_predicate(predicate, reason)
rule.skips.a... | true | true |
f744090750ed9c09a25bbda052441c5495e6bede | 8,837 | py | Python | mysql/toolkit/components/operations/clone.py | sfneal/mysql-toolkit | 6964f718f4b72eb30f2259adfcfaf3090526c53d | [
"MIT"
] | 4 | 2019-10-07T13:40:29.000Z | 2020-12-29T10:34:07.000Z | mysql/toolkit/components/operations/clone.py | sfneal/mysql-toolkit | 6964f718f4b72eb30f2259adfcfaf3090526c53d | [
"MIT"
] | 1 | 2018-10-08T13:57:57.000Z | 2018-10-08T13:57:57.000Z | mysql/toolkit/components/operations/clone.py | sfneal/mysql-toolkit | 6964f718f4b72eb30f2259adfcfaf3090526c53d | [
"MIT"
] | 2 | 2018-12-18T09:32:32.000Z | 2019-07-27T11:09:14.000Z | from looptools import Timer
from tqdm import tqdm
from mysql.toolkit.utils import wrap
# TODO: Organize methods into database and table classes
# TODO: Fix issue where primary and foreign keys are not being copied
# TODO: New functionality to allow for dumping to file
class CloneData:
def get_database_rows(self, ... | 41.488263 | 116 | 0.637999 | from looptools import Timer
from tqdm import tqdm
from mysql.toolkit.utils import wrap
class CloneData:
def get_database_rows(self, tables=None, database=None):
source = database if database else self.database
tables = tables if tables else self.tables
commands = self... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.