hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79066daedd611efcd4250452e2493c5793c201b7 | 4,199 | py | Python | jhunt/qt/main.py | jeremiedecock/jhunt | d5b189a72c6eb0f152508eeedb9541f28f907937 | [
"MIT"
] | null | null | null | jhunt/qt/main.py | jeremiedecock/jhunt | d5b189a72c6eb0f152508eeedb9541f28f907937 | [
"MIT"
] | null | null | null | jhunt/qt/main.py | jeremiedecock/jhunt | d5b189a72c6eb0f152508eeedb9541f28f907937 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from dve.io.table import TableDataBase
from jhunt.qt.widgets.mainwindow import MainWindow
import datetime
from PyQt5.QtWidgets import QApplication
APPLICATION_NAME = "JHunt"
def main():
adverts_file_name = ".jhunt_adverts"
adverts_data_schema = [... | 57.520548 | 201 | 0.526554 |
import sys
from dve.io.table import TableDataBase
from jhunt.qt.widgets.mainwindow import MainWindow
import datetime
from PyQt5.QtWidgets import QApplication
APPLICATION_NAME = "JHunt"
def main():
adverts_file_name = ".jhunt_adverts"
adverts_data_schema = [
{"header": "Date", "defa... | true | true |
79066e7dd47e2b519bc4867cd9c1c11f8de00430 | 4,468 | py | Python | hooks/commit-msg.py | wotsen/learning_platform_server | 38b3483ae5496927acec53c179a78f86f403e2d3 | [
"MIT"
] | null | null | null | hooks/commit-msg.py | wotsen/learning_platform_server | 38b3483ae5496927acec53c179a78f86f403e2d3 | [
"MIT"
] | null | null | null | hooks/commit-msg.py | wotsen/learning_platform_server | 38b3483ae5496927acec53c179a78f86f403e2d3 | [
"MIT"
] | 1 | 2020-02-16T09:57:01.000Z | 2020-02-16T09:57:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/1/28 14:07
# @Author : ywl
# @Email : astralrovers@outlook.com
# @File : commit-msg.py.py
import os
import sys
import re
import json
crc_list = (
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129... | 33.096296 | 98 | 0.597359 |
import os
import sys
import re
import json
crc_list = (
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3... | true | true |
79066e8a12ef024ead477fe9eba93cf2181701e0 | 17,919 | py | Python | pjproject_android/tests/cdash/builder.py | WachterJud/qaul.net_legacy | 9c2be0a38ad6e90fadc0d1150340e37d220997ae | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 4 | 2019-11-11T08:16:08.000Z | 2020-08-25T03:08:44.000Z | pjproject_android/tests/cdash/builder.py | WachterJud/qaul.net_legacy | 9c2be0a38ad6e90fadc0d1150340e37d220997ae | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-02-20T06:58:16.000Z | 2020-02-20T07:08:07.000Z | my_softphone/pjproject-2.9/tests/cdash/builder.py | sashkaseltsov1/reposCpp | 3ff5ce2a14a368a36b1758099ce4f3e8c4cdf11d | [
"Unlicense"
] | 5 | 2019-07-02T02:03:24.000Z | 2022-03-30T09:58:52.000Z | #
# builder.py - PJSIP test scenarios builder
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
... | 35.695219 | 100 | 0.53686 |
import ccdash
import os
import platform
import re
import subprocess
import sys
import time
class Operation:
"""\
The Operation class describes the individual ccdash operation to be
performed.
"""
UPDATE = "update"
CONFIGURE = "configure"
BUILD = "b... | false | true |
79066f0e2be157515e702c9b507e1dcd97481d92 | 15,329 | py | Python | tensorflow_probability/python/distributions/zipf_test.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 1 | 2020-07-12T22:40:42.000Z | 2020-07-12T22:40:42.000Z | tensorflow_probability/python/distributions/zipf_test.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 2 | 2019-08-01T18:31:41.000Z | 2019-08-01T19:42:15.000Z | tensorflow_probability/python/distributions/zipf_test.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 1 | 2020-04-17T18:01:47.000Z | 2020-04-17T18:01:47.000Z | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.584726 | 115 | 0.666058 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import stats
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import test_case
from tensorflow_probability.p... | true | true |
79066f15425046ee9018415f5aaf5407552e7a17 | 749 | py | Python | services/backend/migrations/versions/f6d196dc5629_.py | YA-androidapp/vuejs-flask-docker | de0fe6bbee7c80fe7de4a91c70767494289aa448 | [
"MIT"
] | 16 | 2020-05-03T19:58:58.000Z | 2021-08-23T19:37:13.000Z | services/backend/migrations/versions/f6d196dc5629_.py | YA-androidapp/vuejs-flask-docker | de0fe6bbee7c80fe7de4a91c70767494289aa448 | [
"MIT"
] | 3 | 2021-09-01T20:34:17.000Z | 2022-02-27T18:09:27.000Z | services/backend/migrations/versions/f6d196dc5629_.py | YA-androidapp/vuejs-flask-docker | de0fe6bbee7c80fe7de4a91c70767494289aa448 | [
"MIT"
] | 13 | 2020-05-03T22:00:30.000Z | 2021-06-20T02:44:20.000Z | """empty message
Revision ID: f6d196dc5629
Revises: fd5076041bff
Create Date: 2019-04-06 22:25:32.133764
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f6d196dc5629'
down_revision = 'fd5076041bff'
branch_labels = None
depends_on = None
def upgrade():
# ... | 24.16129 | 75 | 0.688919 | from alembic import op
import sqlalchemy as sa
revision = 'f6d196dc5629'
down_revision = 'fd5076041bff'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
79066fc2a841fa7bdb3b73ee9a5121a5360e3603 | 2,576 | py | Python | tests/test_client.py | goodeggs/dbt-rpc-client | 48843f67d72ed732aa4cb7d70c436fad25bf23d6 | [
"MIT"
] | 2 | 2020-03-07T11:19:03.000Z | 2021-07-20T16:18:31.000Z | tests/test_client.py | goodeggs/dbt-rpc-client | 48843f67d72ed732aa4cb7d70c436fad25bf23d6 | [
"MIT"
] | 2 | 2020-01-03T18:33:49.000Z | 2020-05-07T10:21:01.000Z | tests/test_client.py | goodeggs/dbt-rpc-client | 48843f67d72ed732aa4cb7d70c436fad25bf23d6 | [
"MIT"
] | 1 | 2020-11-23T23:14:21.000Z | 2020-11-23T23:14:21.000Z | import pytest
import responses
def test_url(client):
assert client.url == "http://0.0.0.0:8580/jsonrpc"
@pytest.mark.parametrize('method', ['status', 'poll', 'kill', 'cli_args'])
def test_default_request(client, method):
expected = {
"jsonrpc": client.jsonrpc_version,
"method": method,
... | 32.607595 | 86 | 0.527562 | import pytest
import responses
def test_url(client):
assert client.url == "http://0.0.0.0:8580/jsonrpc"
@pytest.mark.parametrize('method', ['status', 'poll', 'kill', 'cli_args'])
def test_default_request(client, method):
expected = {
"jsonrpc": client.jsonrpc_version,
"method": method,
... | true | true |
790670acb878af0d0ba02cbf021cbb8fcaffcb96 | 2,512 | py | Python | examples/crate.py | einarf/ModernGL | e4a7f53289043a0ac06130c67edc75b878484a0e | [
"MIT"
] | 1 | 2019-10-18T03:23:16.000Z | 2019-10-18T03:23:16.000Z | examples/crate.py | einarf/ModernGL | e4a7f53289043a0ac06130c67edc75b878484a0e | [
"MIT"
] | null | null | null | examples/crate.py | einarf/ModernGL | e4a7f53289043a0ac06130c67edc75b878484a0e | [
"MIT"
] | null | null | null | import os
import moderngl
import numpy as np
from objloader import Obj
from PIL import Image
from pyrr import Matrix44
import data
from window import Example, run_example
class CrateExample(Example):
title = "Crate"
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.prog = self.... | 27.604396 | 111 | 0.513137 | import os
import moderngl
import numpy as np
from objloader import Obj
from PIL import Image
from pyrr import Matrix44
import data
from window import Example, run_example
class CrateExample(Example):
title = "Crate"
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.prog = self.... | true | true |
7906710d6af97d58759f8acac35239116f393087 | 243 | py | Python | tagger/calculate_tagger.py | buoyancy99/glove | aa0e6eaaaafb47fc3a5d4eb693c8f24e90b8f402 | [
"MIT"
] | 2 | 2019-06-10T18:16:14.000Z | 2020-03-27T19:10:40.000Z | tagger/calculate_tagger.py | buoyancy99/glove | aa0e6eaaaafb47fc3a5d4eb693c8f24e90b8f402 | [
"MIT"
] | null | null | null | tagger/calculate_tagger.py | buoyancy99/glove | aa0e6eaaaafb47fc3a5d4eb693c8f24e90b8f402 | [
"MIT"
] | 3 | 2019-02-27T23:07:58.000Z | 2020-02-11T06:00:33.000Z | """Author: Brandon Trabucco
Calculate the part of speech tagger using the brown corpus.
"""
import glove.configuration
import glove.tagger
config = glove.configuration.TaggerConfiguration(
tagger_dir="./")
glove.tagger.dump(config)
| 15.1875 | 59 | 0.761317 |
import glove.configuration
import glove.tagger
config = glove.configuration.TaggerConfiguration(
tagger_dir="./")
glove.tagger.dump(config)
| true | true |
790671d115575aa5ed8617405544c36d6f9865d2 | 478 | py | Python | pynzb/lxml_nzb.py | DavidM42/pynzb | cfb7f4f88b928f00bae637be655c592a2493c2e1 | [
"BSD-3-Clause"
] | null | null | null | pynzb/lxml_nzb.py | DavidM42/pynzb | cfb7f4f88b928f00bae637be655c592a2493c2e1 | [
"BSD-3-Clause"
] | null | null | null | pynzb/lxml_nzb.py | DavidM42/pynzb | cfb7f4f88b928f00bae637be655c592a2493c2e1 | [
"BSD-3-Clause"
] | null | null | null | from pynzb.base import BaseETreeNZBParser, NZBFile, NZBSegment
try:
from lxml import etree
except ImportError:
raise ImportError("You must have lxml installed before you can use the " +
"lxml NZB parser.")
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
c... | 29.875 | 78 | 0.732218 | from pynzb.base import BaseETreeNZBParser, NZBFile, NZBSegment
try:
from lxml import etree
except ImportError:
raise ImportError("You must have lxml installed before you can use the " +
"lxml NZB parser.")
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
c... | true | true |
790671d2bc8c19473d0c70d4a838f7a209b6d26d | 590 | py | Python | phd_courses/theoretical_low_energy_astroparticle/figures/make_all_figures.py | jacopok/notes | 805ebe1be49bbd14c6b46b24055f9fc7d1cd2586 | [
"Apache-2.0"
] | 6 | 2019-10-10T13:10:57.000Z | 2022-01-13T14:52:50.000Z | phd_courses/theoretical_high_energy_astroparticle/figures/make_all_figures.py | jacopok/notes | 805ebe1be49bbd14c6b46b24055f9fc7d1cd2586 | [
"Apache-2.0"
] | null | null | null | phd_courses/theoretical_high_energy_astroparticle/figures/make_all_figures.py | jacopok/notes | 805ebe1be49bbd14c6b46b24055f9fc7d1cd2586 | [
"Apache-2.0"
] | 3 | 2019-10-03T16:20:19.000Z | 2021-08-06T16:11:07.000Z | from tqdm import tqdm
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
rc('text.latex', preamble=r'''\usepackage{amsmath}
\usepackage{physics}
\usepackage{siunitx}
''')
rc('figure', dpi=150)
def plot_and_save(plotting_func):
plo... | 26.818182 | 108 | 0.69661 | from tqdm import tqdm
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
rc('text.latex', preamble=r'''\usepackage{amsmath}
\usepackage{physics}
\usepackage{siunitx}
''')
rc('figure', dpi=150)
def plot_and_save(plotting_func):
plo... | true | true |
790671ddc269e09bd844f0beb38916b50bed5073 | 41,319 | py | Python | pycryptobot.py | treggit/pycryptobot | 47ed7f260d19fd1ec7e607e0654ebb768a3f035c | [
"Apache-2.0"
] | null | null | null | pycryptobot.py | treggit/pycryptobot | 47ed7f260d19fd1ec7e607e0654ebb768a3f035c | [
"Apache-2.0"
] | null | null | null | pycryptobot.py | treggit/pycryptobot | 47ed7f260d19fd1ec7e607e0654ebb768a3f035c | [
"Apache-2.0"
] | null | null | null | """Python Crypto Bot consuming Coinbase Pro or Binance APIs"""
import functools
import os
import sched
import sys
import time
import pandas as pd
from datetime import datetime
from models.PyCryptoBot import PyCryptoBot, truncate as _truncate
from models.AppState import AppState
from models.Trading import TechnicalAnal... | 51.137376 | 202 | 0.504417 |
import functools
import os
import sched
import sys
import time
import pandas as pd
from datetime import datetime
from models.PyCryptoBot import PyCryptoBot, truncate as _truncate
from models.AppState import AppState
from models.Trading import TechnicalAnalysis
from models.TradingAccount import TradingAccount
from mode... | true | true |
79067294fd51c172579948486cb84fd93fd219a3 | 2,472 | py | Python | WolfEyes/Utils/TypeChecker.py | TBIproject/WolfEye | adaa604ed07dcef81162f59fe4f6fb5f2e9b6f09 | [
"BSD-3-Clause"
] | 2 | 2015-12-14T15:20:44.000Z | 2016-11-17T07:54:10.000Z | WolfEyes/Utils/TypeChecker.py | TBIproject/WolfEyes | adaa604ed07dcef81162f59fe4f6fb5f2e9b6f09 | [
"BSD-3-Clause"
] | null | null | null | WolfEyes/Utils/TypeChecker.py | TBIproject/WolfEyes | adaa604ed07dcef81162f59fe4f6fb5f2e9b6f09 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
WOLFEYES'S FRAMEWORK
Python 3 / OpenCV 3
This file describes some TypeCheking decorators.
Might be useless, but allows for almost very precise type checking,
especially on keyworded args, which might help.
"""
# 'kargs' get the arguments and passes the decorator
def args(*types, **ktypes)... | 33.405405 | 132 | 0.588592 |
def args(*types, **ktypes):
def decorator(func):
def modified(*args, **kargs):
position = 1
for arg, T in zip(args, types):
if not isinstance(arg, T):
raise TypeError("Positional arg (%... | true | true |
790672b510ce3c4c7c76a9f1a7a9fd7deb79ce39 | 12,346 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam_user.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2019-04-16T21:23:15.000Z | 2019-04-16T21:23:15.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam_user.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/iam_user.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module:... | 37.987692 | 126 | 0.640936 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: iam_user
short_description: Manage AWS IAM users
description:
- Manage AWS IAM users
version_added: "2.5"
author: Josh Souza, @joshsouza
optio... | true | true |
7906734319e39a54e78ce0361f0f7d13a787c3d4 | 12,188 | py | Python | testing/agent_test.py | jkondic/overcooked_ai | a8d5fb1f9c16c410c47ea4b639ddc20a64276e86 | [
"MIT"
] | 302 | 2019-08-15T17:00:41.000Z | 2022-03-31T07:07:22.000Z | testing/agent_test.py | jkondic/overcooked_ai | a8d5fb1f9c16c410c47ea4b639ddc20a64276e86 | [
"MIT"
] | 55 | 2019-08-15T00:53:50.000Z | 2022-02-01T16:05:45.000Z | testing/agent_test.py | jkondic/overcooked_ai | a8d5fb1f9c16c410c47ea4b639ddc20a64276e86 | [
"MIT"
] | 60 | 2019-09-30T11:43:04.000Z | 2022-03-29T21:59:39.000Z | import unittest
import numpy as np
from overcooked_ai_py.agents.agent import AgentPair, FixedPlanAgent, GreedyHumanModel, RandomAgent, SampleAgent
from overcooked_ai_py.mdp.actions import Direction, Action
from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld, OvercookedState, PlayerState, ObjectState
fr... | 45.992453 | 139 | 0.6138 | import unittest
import numpy as np
from overcooked_ai_py.agents.agent import AgentPair, FixedPlanAgent, GreedyHumanModel, RandomAgent, SampleAgent
from overcooked_ai_py.mdp.actions import Direction, Action
from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld, OvercookedState, PlayerState, ObjectState
fr... | true | true |
790673c5f5f5d80b053cc251929fc8e0806e5951 | 14,103 | py | Python | tests/system/python/e2e/test_e2e_notification_service_with_plugins.py | doug-dianomic/fledge | cab620d1f31e6dca8e31ca8e483adaad7ce94834 | [
"Apache-2.0"
] | null | null | null | tests/system/python/e2e/test_e2e_notification_service_with_plugins.py | doug-dianomic/fledge | cab620d1f31e6dca8e31ca8e483adaad7ce94834 | [
"Apache-2.0"
] | null | null | null | tests/system/python/e2e/test_e2e_notification_service_with_plugins.py | doug-dianomic/fledge | cab620d1f31e6dca8e31ca8e483adaad7ce94834 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge.readthedocs.io/
# FLEDGE_END
""" Test end to end flow with:
Notification service with
Threshold in-built rule plugin
notify-python35 delivery channel plugin
"""
import os
import time
import subprocess
import http.client
import json
f... | 41.973214 | 119 | 0.657307 |
import os
import time
import subprocess
import http.client
import json
from threading import Event
import urllib.parse
import pytest
__author__ = "Ashish Jabble"
__copyright__ = "Copyright (c) 2019 Dianomic Systems"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"
SERVICE = "notification"
SERVICE_NAME ... | true | true |
7906749671c5df5c56f040275e25cf58665e7525 | 833 | py | Python | tests/utils.py | dkomisar/conda-concourse-ci | 0d8515089884d4559fa4b7df448b6311664a0d45 | [
"BSD-3-Clause"
] | 12 | 2016-12-06T03:18:41.000Z | 2020-04-01T16:12:20.000Z | tests/utils.py | dkomisar/conda-concourse-ci | 0d8515089884d4559fa4b7df448b6311664a0d45 | [
"BSD-3-Clause"
] | 82 | 2016-11-16T14:53:49.000Z | 2021-09-09T15:40:12.000Z | tests/utils.py | dkomisar/conda-concourse-ci | 0d8515089884d4559fa4b7df448b6311664a0d45 | [
"BSD-3-Clause"
] | 28 | 2016-11-16T03:29:55.000Z | 2021-09-15T17:23:51.000Z | import os
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
test_config_dir = os.path.join(test_data_dir, 'config-test')
graph_data_dir = os.path.join(test_data_dir, 'graph_data')
default_worker = {"platform": 'linux',
'arch': '64',
'label': 'linux',
... | 33.32 | 63 | 0.552221 | import os
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
test_config_dir = os.path.join(test_data_dir, 'config-test')
graph_data_dir = os.path.join(test_data_dir, 'graph_data')
default_worker = {"platform": 'linux',
'arch': '64',
'label': 'linux',
... | true | true |
790674bca8d9e8074241bdbbd9ab9878eeeeffce | 2,751 | py | Python | rova/rova.py | synoniem/rova | 6b94b56748608866308afdfae0399039cb0fdb0f | [
"MIT"
] | null | null | null | rova/rova.py | synoniem/rova | 6b94b56748608866308afdfae0399039cb0fdb0f | [
"MIT"
] | null | null | null | rova/rova.py | synoniem/rova | 6b94b56748608866308afdfae0399039cb0fdb0f | [
"MIT"
] | null | null | null | """
Wrapper to get ROVA calendar from Rova's API
Acces to this ROVA API has been simplified since version 0.2.1 of this wrapper
Just use https://www.rova.nl/api/waste-calendar/upcoming?postalcode=1000AA&houseNumber=1&addition=&take=5
with a existing combination of postalcode, housenumber, housenumber addition
Be aware... | 31.261364 | 105 | 0.608142 |
from datetime import datetime
import random
import requests
__title__ = "rova"
__version__ = "0.3.0"
__author__ = "Gido Hakvoort and synoniem <synoniem@hotmail.com>"
__license__ = "MIT"
class Rova:
def __init__(self, zip_code, house_number, house_addition=""):
self.zip_code = zip_code.replace(' ', '')... | true | true |
7906767174c2238844344663057dc570f09adb70 | 1,660 | py | Python | get_data/get_last_price.py | lte2000/cwfx | dc8daee44cea4b7c0286a7676e4a2829744fee64 | [
"MIT"
] | null | null | null | get_data/get_last_price.py | lte2000/cwfx | dc8daee44cea4b7c0286a7676e4a2829744fee64 | [
"MIT"
] | null | null | null | get_data/get_last_price.py | lte2000/cwfx | dc8daee44cea4b7c0286a7676e4a2829744fee64 | [
"MIT"
] | null | null | null | # coding: utf-8
from pytdx.hq import TdxHq_API
from pytdx.params import TDXParams
import pandas as pd
import numpy as np
import re
import csv
import io
import time
import traceback
if __name__ == '__main__':
with io.open(r'..\all_other_data\symbol.txt', 'r', encoding='utf-8') as f:
symbol = [s.strip() fo... | 28.62069 | 113 | 0.586747 |
from pytdx.hq import TdxHq_API
from pytdx.params import TDXParams
import pandas as pd
import numpy as np
import re
import csv
import io
import time
import traceback
if __name__ == '__main__':
with io.open(r'..\all_other_data\symbol.txt', 'r', encoding='utf-8') as f:
symbol = [s.strip() for s in f.readli... | false | true |
7906769bda7c8153d00596b0636a37bfdf58136a | 1,851 | py | Python | src/pytorch-template/old/models/baseline_3D_single.py | kaderghal/ADNI_Data_processing | 454462d3913d77e3bc4de2b9725b456301c7b351 | [
"MIT"
] | 5 | 2021-01-07T10:11:57.000Z | 2022-01-16T04:57:51.000Z | src/pytorch-template/old/models/baseline_3D_single.py | kaderghal/ADNI_Data_processing | 454462d3913d77e3bc4de2b9725b456301c7b351 | [
"MIT"
] | null | null | null | src/pytorch-template/old/models/baseline_3D_single.py | kaderghal/ADNI_Data_processing | 454462d3913d77e3bc4de2b9725b456301c7b351 | [
"MIT"
] | 1 | 2021-08-05T07:34:16.000Z | 2021-08-05T07:34:16.000Z | import os
import sys
import errno
import random
import pickle
import numpy as np
import torch
import torchvision
import torch.nn.functional as F
from torch.utils.data.dataset import Dataset
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import BatchSampler
from torchvision.datasets imp... | 27.626866 | 79 | 0.562939 | import os
import sys
import errno
import random
import pickle
import numpy as np
import torch
import torchvision
import torch.nn.functional as F
from torch.utils.data.dataset import Dataset
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import BatchSampler
from torchvision.datasets imp... | true | true |
790676f6e483d94edfb45d6ee9cb0c992f85cf7e | 364 | py | Python | service/scripts/create_superuser.py | jellyocean/django-project-starter | 73a7f01dd22a2cd4f2b9f041e93d9f9da785736f | [
"MIT"
] | null | null | null | service/scripts/create_superuser.py | jellyocean/django-project-starter | 73a7f01dd22a2cd4f2b9f041e93d9f9da785736f | [
"MIT"
] | null | null | null | service/scripts/create_superuser.py | jellyocean/django-project-starter | 73a7f01dd22a2cd4f2b9f041e93d9f9da785736f | [
"MIT"
] | 1 | 2020-12-16T16:21:12.000Z | 2020-12-16T16:21:12.000Z | from django.contrib.auth import get_user_model
User = get_user_model()
superuser_username = 'admin'
superuser_email = 'superuser@admin.test'
superuser_password = 'admin_test'
try:
User.objects.get(username=superuser_username)
except User.DoesNotExist:
User.objects.create_superuser(
superuser_username... | 24.266667 | 63 | 0.785714 | from django.contrib.auth import get_user_model
User = get_user_model()
superuser_username = 'admin'
superuser_email = 'superuser@admin.test'
superuser_password = 'admin_test'
try:
User.objects.get(username=superuser_username)
except User.DoesNotExist:
User.objects.create_superuser(
superuser_username... | true | true |
7906776168799cb2302e84c58cbeeb52ff286d68 | 251 | py | Python | core/__init__.py | shijieqin/flatfish | 2db30ede58493da3b6970518422f6fce53cbc5fb | [
"Apache-2.0"
] | 7 | 2018-11-14T11:18:15.000Z | 2020-02-24T05:59:08.000Z | core/__init__.py | shijieqin/flatfish | 2db30ede58493da3b6970518422f6fce53cbc5fb | [
"Apache-2.0"
] | 7 | 2019-05-19T11:17:57.000Z | 2021-06-10T21:14:45.000Z | core/__init__.py | shijieqin/flatfish | 2db30ede58493da3b6970518422f6fce53cbc5fb | [
"Apache-2.0"
] | 1 | 2018-11-14T11:18:45.000Z | 2018-11-14T11:18:45.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@version: v1.0
@author: Shijie Qin
@license: Apache Licence
@contact: qsj4work@gmail.com
@site: https://shijieqin.github.io
@software: PyCharm
@file: __init__.py.py
@time: 2018/11/8 3:13 PM
"""
| 17.928571 | 35 | 0.669323 | true | true | |
790677733159ec098d7e4053e1c3c79a29c123ad | 20,058 | py | Python | espnet/bin/asr_train.py | Advanjef/espnet | 47f51a77906c4c44d0da23da04e68676e4b931ab | [
"Apache-2.0"
] | 4 | 2021-06-18T01:57:08.000Z | 2021-12-23T05:26:02.000Z | espnet/bin/asr_train.py | Advanjef/espnet | 47f51a77906c4c44d0da23da04e68676e4b931ab | [
"Apache-2.0"
] | null | null | null | espnet/bin/asr_train.py | Advanjef/espnet | 47f51a77906c4c44d0da23da04e68676e4b931ab | [
"Apache-2.0"
] | 1 | 2021-07-19T07:35:46.000Z | 2021-07-19T07:35:46.000Z | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2017 Tomoki Hayashi (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Automatic speech recognition model training script."""
import logging
import os
import random
import subprocess
import sys
from distutils.version import LooseVe... | 31.438871 | 88 | 0.577376 |
import logging
import os
import random
import subprocess
import sys
from distutils.version import LooseVersion
import configargparse
import numpy as np
import torch
from espnet.utils.cli_utils import strtobool
from espnet.utils.training.batchfy import BATCH_COUNT_CHOICES
is_torch_1_2_plus = LooseVersion(torc... | true | true |
790677a74eaad2595faf06747accff6c5405ae03 | 23 | py | Python | rl/action.py | nickswalker/counterpoint-reinforcement-learning | 1d0481bd2c9976533175339e411a41f4eb1650aa | [
"MIT"
] | 1 | 2016-12-09T18:29:30.000Z | 2016-12-09T18:29:30.000Z | rl/action.py | nickswalker/counterpoint-reinforcement-learning | 1d0481bd2c9976533175339e411a41f4eb1650aa | [
"MIT"
] | null | null | null | rl/action.py | nickswalker/counterpoint-reinforcement-learning | 1d0481bd2c9976533175339e411a41f4eb1650aa | [
"MIT"
] | null | null | null | class Action():
()
| 7.666667 | 15 | 0.478261 | class Action():
()
| true | true |
790677bc6463dfcc7132724f898a5d50b3702bae | 13,300 | py | Python | addon.py | jonjomckay/plugin.audio.bbcsounds | c4d9b3296a7ad3f2f7648bfea4a849ff65fd481b | [
"MIT"
] | 7 | 2020-05-31T13:13:38.000Z | 2021-09-07T12:06:42.000Z | addon.py | jonjomckay/plugin.audio.bbcsounds | c4d9b3296a7ad3f2f7648bfea4a849ff65fd481b | [
"MIT"
] | 6 | 2020-04-12T21:11:45.000Z | 2021-02-17T20:58:57.000Z | addon.py | jonjomckay/plugin.audio.bbcsounds | c4d9b3296a7ad3f2f7648bfea4a849ff65fd481b | [
"MIT"
] | 1 | 2020-09-28T15:05:24.000Z | 2020-09-28T15:05:24.000Z | import datetime
import json
import os
import sys
import urllib
import urlparse
from collections import OrderedDict
from time import mktime
import dateutil.parser
import feedparser
import requests
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
from bs4 import BeautifulSoup
stations = {
'p00fzl68': ... | 44.781145 | 144 | 0.656917 | import datetime
import json
import os
import sys
import urllib
import urlparse
from collections import OrderedDict
from time import mktime
import dateutil.parser
import feedparser
import requests
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
from bs4 import BeautifulSoup
stations = {
'p00fzl68': ... | true | true |
790677da85f3962f3021eb3ed6ec45da968b32e4 | 9,211 | py | Python | components/aws/sagemaker/tests/unit_tests/tests/test_ground_truth.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | null | null | null | components/aws/sagemaker/tests/unit_tests/tests/test_ground_truth.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | null | null | null | components/aws/sagemaker/tests/unit_tests/tests/test_ground_truth.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | null | null | null | import unittest
from unittest.mock import patch, call, Mock, MagicMock, mock_open
from botocore.exceptions import ClientError
from ground_truth.src import ground_truth
from common import _utils
required_args = [
'--region', 'us-west-2',
'--role', 'arn:aws:iam::123456789012:user/Development/product_1234/*',
'-... | 51.747191 | 205 | 0.594072 | import unittest
from unittest.mock import patch, call, Mock, MagicMock, mock_open
from botocore.exceptions import ClientError
from ground_truth.src import ground_truth
from common import _utils
required_args = [
'--region', 'us-west-2',
'--role', 'arn:aws:iam::123456789012:user/Development/product_1234/*',
'-... | true | true |
7906784fec245ebf3d7cee120ef91221bb8f933f | 7,076 | py | Python | blueapps/contrib/bk_commands/management/commands/startweixin.py | xianmao/bk-sops | 2bc89a81f332122ef215adb9b7dc82641f35eb70 | [
"Apache-2.0"
] | null | null | null | blueapps/contrib/bk_commands/management/commands/startweixin.py | xianmao/bk-sops | 2bc89a81f332122ef215adb9b7dc82641f35eb70 | [
"Apache-2.0"
] | null | null | null | blueapps/contrib/bk_commands/management/commands/startweixin.py | xianmao/bk-sops | 2bc89a81f332122ef215adb9b7dc82641f35eb70 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import io
import json
import os
import sys
import shutil
from os import path
import django
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.conf import settings
import blueapps
PY_VER = sys.version
class Command(Tem... | 39.093923 | 95 | 0.535048 |
import io
import json
import os
import sys
import shutil
from os import path
import django
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.conf import settings
import blueapps
PY_VER = sys.version
class Command(TemplateCommand):
help... | true | true |
790678ac92e434d7078e43c30e6ed24239787f76 | 12,552 | py | Python | examples/getting_started/plot_getting_started.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 116 | 2019-07-12T14:33:43.000Z | 2022-03-29T01:10:00.000Z | examples/getting_started/plot_getting_started.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 424 | 2019-07-15T13:29:34.000Z | 2022-03-30T13:30:45.000Z | examples/getting_started/plot_getting_started.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 60 | 2019-08-26T11:59:07.000Z | 2022-03-24T20:05:38.000Z | """
Getting started tutorial
========================
In this introductory example, you will see how to use the :code:`spikeinterface` to perform a full electrophysiology analysis.
We will first create some simulated data, and we will then perform some pre-processing, run a couple of spike sorting
algorithms, inspect ... | 44.669039 | 126 | 0.654557 |
import matplotlib.pyplot as plt
| true | true |
7906797e7c32060d28729d82d76b97fda2ac04e6 | 1,430 | py | Python | osf_tests/management_commands/test_move_egap_regs_to_provider.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 11 | 2018-12-11T16:39:40.000Z | 2022-02-26T09:51:32.000Z | osf_tests/management_commands/test_move_egap_regs_to_provider.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 52 | 2018-04-13T05:03:21.000Z | 2022-03-22T02:56:19.000Z | osf_tests/management_commands/test_move_egap_regs_to_provider.py | tsukaeru/RDM-osf.io | 2dc3e539322b6110e51772f8bd25ebdeb8e12d0e | [
"Apache-2.0"
] | 16 | 2018-07-09T01:44:51.000Z | 2021-06-30T01:57:16.000Z | # encoding: utf-8
import pytest
from osf_tests.factories import (
RegistrationFactory,
RegistrationProviderFactory
)
from osf.models import (
RegistrationSchema,
)
from osf.management.commands.move_egap_regs_to_provider import (
main as move_egap_regs
)
from django.conf import settings
@pytest.mar... | 26.481481 | 94 | 0.718881 |
import pytest
from osf_tests.factories import (
RegistrationFactory,
RegistrationProviderFactory
)
from osf.models import (
RegistrationSchema,
)
from osf.management.commands.move_egap_regs_to_provider import (
main as move_egap_regs
)
from django.conf import settings
@pytest.mark.django_db
class... | true | true |
79067a6c907d66d1d68d24f6c136f39728d2235b | 878 | py | Python | nova_powervm/virt/powervm/volume/gpfs.py | openstack/nova-powervm | 376d9493e2a10313068508daf9054d7ecf6d121f | [
"Apache-2.0"
] | 24 | 2015-10-18T02:55:20.000Z | 2021-11-17T11:43:51.000Z | nova_powervm/virt/powervm/volume/gpfs.py | openstack/nova-powervm | 376d9493e2a10313068508daf9054d7ecf6d121f | [
"Apache-2.0"
] | null | null | null | nova_powervm/virt/powervm/volume/gpfs.py | openstack/nova-powervm | 376d9493e2a10313068508daf9054d7ecf6d121f | [
"Apache-2.0"
] | 12 | 2015-10-26T17:38:05.000Z | 2021-07-21T12:45:19.000Z | # Copyright 2017 IBM Corp.
#
# 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 a... | 35.12 | 78 | 0.730068 |
from nova_powervm.virt.powervm.volume import fileio
class GPFSVolumeAdapter(fileio.FileIOVolumeAdapter):
def _get_path(self):
return self.connection_info.get("data")['device_path']
| true | true |
79067ca4aa4dfdf1c6aeaac791d4bd5fcdd3188e | 1,707 | py | Python | firebot/modules/bash.py | vikas04599/Fire-X | 527d57c29785f36e1b07aa739f3ac7c969cc916c | [
"MIT"
] | 20 | 2021-08-16T18:49:49.000Z | 2022-02-23T08:35:57.000Z | firebot/modules/bash.py | elizamusic/Fire-X | 1ec6ba73b3033ad03e7859fcf6917fc6aff89efc | [
"MIT"
] | null | null | null | firebot/modules/bash.py | elizamusic/Fire-X | 1ec6ba73b3033ad03e7859fcf6917fc6aff89efc | [
"MIT"
] | 93 | 2021-08-16T19:16:20.000Z | 2022-03-31T02:02:06.000Z | import asyncio
import io
import time
from firebot import CMD_HELP
from firebot.utils import edit_or_reply, fire_on_cmd, sudo_cmd
@fire.on(fire_on_cmd(pattern="bash ?(.*)"))
@fire.on(sudo_cmd(pattern="bash ?(.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
PROCESS_RUN_TIME = 100
... | 29.947368 | 118 | 0.596368 | import asyncio
import io
import time
from firebot import CMD_HELP
from firebot.utils import edit_or_reply, fire_on_cmd, sudo_cmd
@fire.on(fire_on_cmd(pattern="bash ?(.*)"))
@fire.on(sudo_cmd(pattern="bash ?(.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
PROCESS_RUN_TIME = 100
... | true | true |
79067cbce81efd04c8395cb3c3418bb2680872bb | 2,472 | py | Python | benchutils/transformers.py | qiyunzhu/taxa-assign-benchmarking | df0fbe6a84f20ac2e2febbbb21bd686ec90e84e3 | [
"MIT"
] | null | null | null | benchutils/transformers.py | qiyunzhu/taxa-assign-benchmarking | df0fbe6a84f20ac2e2febbbb21bd686ec90e84e3 | [
"MIT"
] | null | null | null | benchutils/transformers.py | qiyunzhu/taxa-assign-benchmarking | df0fbe6a84f20ac2e2febbbb21bd686ec90e84e3 | [
"MIT"
] | null | null | null | import pandas as pd
kraken_rank_dictionary = {
'P': 'phylum',
'C': 'class',
'O': 'order',
'F': 'family',
'G': 'genus',
'S': 'species'
}
greengenes_rank_dict = {
'k__': 'kingdom',
'p__': 'phylum',
'c__': 'class',
'o__': 'order',
'f__': 'family',
'g__': 'genus',
's__'... | 33.863014 | 78 | 0.642799 | import pandas as pd
kraken_rank_dictionary = {
'P': 'phylum',
'C': 'class',
'O': 'order',
'F': 'family',
'G': 'genus',
'S': 'species'
}
greengenes_rank_dict = {
'k__': 'kingdom',
'p__': 'phylum',
'c__': 'class',
'o__': 'order',
'f__': 'family',
'g__': 'genus',
's__'... | true | true |
79067d4cb9698a68a9594018b1385a9783a309dc | 1,850 | py | Python | ooobuild/dyn/ucb/content_event.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/ucb/content_event.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/ucb/content_event.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 34.259259 | 109 | 0.672973 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME, UNO_NONE
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
import uno
def _get_class():
orig_init = None
ordered_keys = ('Source', 'Action', 'Content', 'Id')
def i... | true | true |
79067d5bf2ddbe70b607765307b0df5ef3ff6b90 | 883 | py | Python | src/discolight/writers/annotation/widthheightcsv.py | denzel-datature/discolight | 7c8309d3f883263b2e4cae0b289f17be1d1c07ea | [
"MIT"
] | 27 | 2020-07-23T08:09:25.000Z | 2022-03-01T08:24:43.000Z | src/discolight/writers/annotation/widthheightcsv.py | denzel-datature/discolight | 7c8309d3f883263b2e4cae0b289f17be1d1c07ea | [
"MIT"
] | 7 | 2020-08-05T07:26:55.000Z | 2020-12-31T04:20:40.000Z | src/discolight/writers/annotation/widthheightcsv.py | denzel-datature/discolight | 7c8309d3f883263b2e4cae0b289f17be1d1c07ea | [
"MIT"
] | 6 | 2020-07-27T04:30:01.000Z | 2020-08-13T02:39:25.000Z | """A CSV annotation writer that writes the bbox in x, y, w, h format."""
from .types import CSVAnnotationWriter
class WidthHeightCSV(CSVAnnotationWriter):
"""Writes annotations to a CSV file in the following format.
image_name, x_min, y_min, width, height, label
"""
def get_csv_fieldnames(self):
... | 33.961538 | 75 | 0.629672 | from .types import CSVAnnotationWriter
class WidthHeightCSV(CSVAnnotationWriter):
def get_csv_fieldnames(self):
return ["image_name", "x_min", "y_min", "width", "height", "label"]
def get_csv_row(self, image_name, _image, annotation):
return {
"image_name": image_name,
... | true | true |
79067eb7a3522d267d15a67f9850fe61c835b4db | 27,430 | py | Python | nodes/axis.py | MarcoStb1993/axis_camera | cd08406cdb519488743bf6c69f79a62dbbb536e3 | [
"BSD-3-Clause"
] | 2 | 2017-09-30T14:41:37.000Z | 2018-05-29T19:33:10.000Z | nodes/axis.py | MarcoStb1993/axis_camera | cd08406cdb519488743bf6c69f79a62dbbb536e3 | [
"BSD-3-Clause"
] | null | null | null | nodes/axis.py | MarcoStb1993/axis_camera | cd08406cdb519488743bf6c69f79a62dbbb536e3 | [
"BSD-3-Clause"
] | 1 | 2020-02-11T13:05:31.000Z | 2020-02-11T13:05:31.000Z | #!/usr/bin/env python
"""
Axis camera video driver. Inspired by:
https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/axis_camera/axis.py
Communication with the camera is done using the Axis VAPIX API described at
http://www.axis.com/global/en/support/developer-support/vapix
.. note::
This is a ma... | 42.135177 | 120 | 0.653737 |
import math
import re
import rospy
from sensor_msgs.msg import CompressedImage, CameraInfo
import camera_info_manager
import dynamic_reconfigure.server
from diagnostic_updater import Updater, DiagnosedPublisher, TimeStampStatusParam, FrequencyStatusParam, \
FunctionDiagnosticTask, DiagnosticStatusWrapper
from ... | true | true |
7906804406841c9c693d6ca560d89d823c30373a | 7,839 | py | Python | Source/chrome/tools/cygprofile/patch_orderfile.py | yury-s/v8-inspector | 0ab4779e0909d387f243f41ca2621237cdb0c7fe | [
"BSD-3-Clause"
] | 20 | 2015-08-26T06:46:00.000Z | 2019-02-27T09:05:58.000Z | Source/chrome/tools/cygprofile/patch_orderfile.py | yury-s/v8-inspector | 0ab4779e0909d387f243f41ca2621237cdb0c7fe | [
"BSD-3-Clause"
] | null | null | null | Source/chrome/tools/cygprofile/patch_orderfile.py | yury-s/v8-inspector | 0ab4779e0909d387f243f41ca2621237cdb0c7fe | [
"BSD-3-Clause"
] | 2 | 2015-08-26T05:49:35.000Z | 2020-02-03T20:22:43.000Z | #!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Patch an orderfile.
Starting with a list of symbols in a binary and an orderfile (ordered list of
symbols), matches the symbols in the ... | 32.936975 | 80 | 0.710677 |
"""Patch an orderfile.
Starting with a list of symbols in a binary and an orderfile (ordered list of
symbols), matches the symbols in the orderfile and augments each symbol with the
symbols residing at the same address (due to having identical code).
Note: It is possible to have.
- Several symbols mapping to the... | false | true |
79068056893486e239fb28a73ce3d85e4ad8c97c | 8,075 | py | Python | demo/demo.py | ishanic/MeshRCNN-keypoints | fdc2c81ce57313207478ab9ff1699614addc5993 | [
"BSD-3-Clause"
] | 1 | 2021-06-25T17:23:02.000Z | 2021-06-25T17:23:02.000Z | demo/demo.py | ishanic/MeshRCNN-keypoints | fdc2c81ce57313207478ab9ff1699614addc5993 | [
"BSD-3-Clause"
] | null | null | null | demo/demo.py | ishanic/MeshRCNN-keypoints | fdc2c81ce57313207478ab9ff1699614addc5993 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import logging
import multiprocessing as mp
import numpy as np
import os
import torch
from detectron2.config import get_cfg
from detectron2.data import MetadataCatalog
from detectron2.da... | 34.95671 | 100 | 0.593065 |
import argparse
import logging
import multiprocessing as mp
import numpy as np
import os
import torch
from detectron2.config import get_cfg
from detectron2.data import MetadataCatalog
from detectron2.data.detection_utils import read_image
from detectron2.engine.defaults import DefaultPredictor
from detectron2.utils.... | true | true |
790680e88fd7043345c7250db1e6c362532e484f | 1,817 | py | Python | BEGIN/DAY_04/04.1-day-4-2-exercise-solution.py | thakopian/100-DAYS-OF-PYTHON-PROJECT | 81615e3f42a259bdda00e0129c9a0890b07e9282 | [
"MIT"
] | null | null | null | BEGIN/DAY_04/04.1-day-4-2-exercise-solution.py | thakopian/100-DAYS-OF-PYTHON-PROJECT | 81615e3f42a259bdda00e0129c9a0890b07e9282 | [
"MIT"
] | 4 | 2021-01-17T07:57:33.000Z | 2021-02-06T07:16:00.000Z | BEGIN/DAY_04/04.1-day-4-2-exercise-solution.py | thakopian/100-DAYS-OF-PYTHON-PROJECT | 81615e3f42a259bdda00e0129c9a0890b07e9282 | [
"MIT"
] | null | null | null | # https://repl.it/@thakopian/day-4-2-exercise#main.py
# write a program which will select a random name from a list of names
# name selected will pay for everyone's bill
# cannot use choice() function
# inputs for the names - Angela, Ben, Jenny, Michael, Chloe
# import modules
import random
# set varialbles for in... | 41.295455 | 176 | 0.760044 | annot use choice() function
# inputs for the names - Angela, Ben, Jenny, Michael, Chloe
# import modules
import random
# set varialbles for input and another to modify the input to divide strings by comma
names_string = input("Give me everybody's names, separated by a comma. ")
names = names_string.split(", ")
pr... | true | true |
7906810ca3e53172179e0508842ca7cdc2d85ad2 | 4,110 | py | Python | pyyolo/utils.py | isarandi/pyyolo | 0f26210fd72f7ce973b34d51b6a38b5dd0f57115 | [
"Apache-2.0"
] | null | null | null | pyyolo/utils.py | isarandi/pyyolo | 0f26210fd72f7ce973b34d51b6a38b5dd0f57115 | [
"Apache-2.0"
] | null | null | null | pyyolo/utils.py | isarandi/pyyolo | 0f26210fd72f7ce973b34d51b6a38b5dd0f57115 | [
"Apache-2.0"
] | null | null | null | """
File name: utils
Author: rameshpr
Date: 11/5/18
"""
import numpy as np
from ctypes import *
from typing import List, Tuple
import cv2
from pyyolo.darknet import c_array, IMAGE, METADATA, predict_image, get_network_boxes, \
do_nms_obj, do_nms_sort, free_image, free_detections, ndarray_image
import ... | 29.148936 | 130 | 0.652798 |
import numpy as np
from ctypes import *
from typing import List, Tuple
import cv2
from pyyolo.darknet import c_array, IMAGE, METADATA, predict_image, get_network_boxes, \
do_nms_obj, do_nms_sort, free_image, free_detections, ndarray_image
import pyyolo.darknet
from pyyolo.yolo_data import BBox, YoloData
def loa... | true | true |
790682d1bb4627a5c0a8dbb0c149452c906adf07 | 16,991 | py | Python | tests/test_nibbles.py | knovichikhin/pyiso8583 | 99c9ccdd75f399328b79248532f28080cb97b33a | [
"MIT"
] | 17 | 2020-09-10T08:24:58.000Z | 2022-03-08T01:33:32.000Z | tests/test_nibbles.py | knovichikhin/pyiso8583 | 99c9ccdd75f399328b79248532f28080cb97b33a | [
"MIT"
] | 13 | 2020-11-21T01:46:14.000Z | 2022-02-14T06:20:32.000Z | tests/test_nibbles.py | knovichikhin/pyiso8583 | 99c9ccdd75f399328b79248532f28080cb97b33a | [
"MIT"
] | 7 | 2020-10-09T20:25:56.000Z | 2022-02-18T13:54:34.000Z | """Test length measured in half bytes (nibbles). Nibbles were added in v2.1"""
import copy
import iso8583
import iso8583.specs
import pytest
# fmt: off
@pytest.mark.parametrize(
["data_enc", "len_enc", "len_type", "max_len", "len_count", "result", "result_f2_len"],
[
("ascii", "ascii", 2, 8, "bytes"... | 35.397917 | 98 | 0.571126 |
import copy
import iso8583
import iso8583.specs
import pytest
@pytest.mark.parametrize(
["data_enc", "len_enc", "len_type", "max_len", "len_count", "result", "result_f2_len"],
[
("ascii", "ascii", 2, 8, "bytes", b"02004000000000000000041234", b"04"),
("ascii", "ascii", 2, 8, "nibbles", b"... | true | true |
790683767e43ace504142e8a04e6684fbbaceb56 | 2,558 | py | Python | pymatch/utils/KFold.py | raharth/PyMatch | 93cf10fd9ca0fa104b0f2a30e613f75fd0561b92 | [
"MIT"
] | 10 | 2021-07-06T17:26:17.000Z | 2022-01-11T13:02:20.000Z | pymatch/utils/KFold.py | raharth/PyMatch | 93cf10fd9ca0fa104b0f2a30e613f75fd0561b92 | [
"MIT"
] | 105 | 2020-10-02T13:01:17.000Z | 2021-07-27T19:06:38.000Z | pymatch/utils/KFold.py | raharth/PyMatch | 93cf10fd9ca0fa104b0f2a30e613f75fd0561b92 | [
"MIT"
] | null | null | null | import torch
class KFold:
def __init__(self, dataset, n_fold=10, batch_size=32, num_workers=0, pin_memory=False):
self.fold = 0
self.batch_size = batch_size
self.num_workers = num_workers
self.pin_memory = pin_memory
self.dataset = dataset
self.n_fold = n_fold
... | 39.353846 | 158 | 0.555903 | import torch
class KFold:
def __init__(self, dataset, n_fold=10, batch_size=32, num_workers=0, pin_memory=False):
self.fold = 0
self.batch_size = batch_size
self.num_workers = num_workers
self.pin_memory = pin_memory
self.dataset = dataset
self.n_fold = n_fold
... | true | true |
79068379f7a8d34470e9e01eae7af8d8fed90bba | 12,886 | py | Python | sdks/python/client/openapi_client/model/fc_volume_source.py | Siebjee/argo-workflows | 1a3b87bdf8edba02ba5e5aed20f3942be1d6f46c | [
"Apache-2.0"
] | null | null | null | sdks/python/client/openapi_client/model/fc_volume_source.py | Siebjee/argo-workflows | 1a3b87bdf8edba02ba5e5aed20f3942be1d6f46c | [
"Apache-2.0"
] | 3 | 2022-03-22T11:49:02.000Z | 2022-03-24T14:13:59.000Z | sdks/python/client/openapi_client/model/fc_volume_source.py | Siebjee/argo-workflows | 1a3b87bdf8edba02ba5e5aed20f3942be1d6f46c | [
"Apache-2.0"
] | null | null | null | """
Argo Server API
You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from ... | 47.375 | 228 | 0.579621 |
import re
import sys
from openapi_client.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
fro... | true | true |
7906841bba77c73ef7765d83bc5c66a34245f795 | 9,735 | py | Python | manim/animation/transform_matching_parts.py | aburousan/manim | c11b649e9aed34976844e6a131fb12e2a30c7bc8 | [
"MIT"
] | null | null | null | manim/animation/transform_matching_parts.py | aburousan/manim | c11b649e9aed34976844e6a131fb12e2a30c7bc8 | [
"MIT"
] | null | null | null | manim/animation/transform_matching_parts.py | aburousan/manim | c11b649e9aed34976844e6a131fb12e2a30c7bc8 | [
"MIT"
] | null | null | null | """Animations that try to transform Mobjects while keeping track of identical parts."""
__all__ = ["TransformMatchingShapes", "TransformMatchingTex"]
from typing import TYPE_CHECKING, List, Optional
import numpy as np
from .._config import config
from ..mobject.mobject import Group, Mobject
from ..mobject.opengl_mo... | 34.521277 | 87 | 0.642732 |
__all__ = ["TransformMatchingShapes", "TransformMatchingTex"]
from typing import TYPE_CHECKING, List, Optional
import numpy as np
from .._config import config
from ..mobject.mobject import Group, Mobject
from ..mobject.opengl_mobject import OpenGLGroup, OpenGLMobject
from ..mobject.types.opengl_vectorized_mobject i... | true | true |
7906842aa04794cd3c211bb571d43e53d2015736 | 1,936 | py | Python | object_database/service_manager/ServiceBase.py | braxtonmckee/nativepython | 5c64e91eb959fcd1c2c42655b40c7cceb3436f1d | [
"Apache-2.0"
] | 7 | 2018-08-07T15:41:54.000Z | 2019-02-19T12:47:57.000Z | object_database/service_manager/ServiceBase.py | braxtonmckee/nativepython | 5c64e91eb959fcd1c2c42655b40c7cceb3436f1d | [
"Apache-2.0"
] | 38 | 2018-10-17T13:37:46.000Z | 2019-04-11T20:50:14.000Z | object_database/service_manager/ServiceBase.py | braxtonmckee/nativepython | 5c64e91eb959fcd1c2c42655b40c7cceb3436f1d | [
"Apache-2.0"
] | 4 | 2019-02-11T17:44:55.000Z | 2019-03-20T07:38:18.000Z | # Copyright 2018 Braxton Mckee
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 32.813559 | 106 | 0.710744 |
import object_database
class ServiceRuntimeConfig:
def __init__(self, serviceTemporaryStorageRoot, authToken, ownIpAddress):
self.serviceTemporaryStorageRoot = serviceTemporaryStorageRoot
self.authToken = authToken
self.ownIpAddress = ownIpAddress
class ServiceBase:
co... | true | true |
790684e667fe1f5a1bffb218997b9ba8a49a28d3 | 1,192 | py | Python | dec06/test.py | einarssons/adventofcode2020 | f5c6251b4eacf14e3947bfaaa27f3fac624ea923 | [
"MIT"
] | null | null | null | dec06/test.py | einarssons/adventofcode2020 | f5c6251b4eacf14e3947bfaaa27f3fac624ea923 | [
"MIT"
] | null | null | null | dec06/test.py | einarssons/adventofcode2020 | f5c6251b4eacf14e3947bfaaa27f3fac624ea923 | [
"MIT"
] | null | null | null | import unittest
from collections import namedtuple
import m
sample = """\
ab
ac
b
b\
"""
TestCase = namedtuple("TestCase", ["text", "output"])
class TestDec6(unittest.TestCase):
def test_get_groups(self):
cases = [
TestCase(sample, [['ab', 'ac'], ['b', 'b']]),
]
for c in c... | 22.074074 | 57 | 0.519295 | import unittest
from collections import namedtuple
import m
sample = """\
ab
ac
b
b\
"""
TestCase = namedtuple("TestCase", ["text", "output"])
class TestDec6(unittest.TestCase):
def test_get_groups(self):
cases = [
TestCase(sample, [['ab', 'ac'], ['b', 'b']]),
]
for c in c... | true | true |
790685577165263740d7cb840e9c16824b5f5b8b | 824 | py | Python | demo_flask.py | archfool/nlp | 8281053a60fd0ef0fae0a2a0649c8814adad6df5 | [
"MIT"
] | 1 | 2019-06-05T05:44:53.000Z | 2019-06-05T05:44:53.000Z | demo_flask.py | archfool/nlp | 8281053a60fd0ef0fae0a2a0649c8814adad6df5 | [
"MIT"
] | null | null | null | demo_flask.py | archfool/nlp | 8281053a60fd0ef0fae0a2a0649c8814adad6df5 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect
from flask import render_template
app = Flask(__name__)
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
return render_template('hello.html', name=name)
from flask import Flask,request,render_template,redirect
# 绑定访问地址127.0.0.1... | 24.235294 | 65 | 0.654126 | from flask import Flask, render_template, request, redirect
from flask import render_template
app = Flask(__name__)
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
return render_template('hello.html', name=name)
from flask import Flask,request,render_template,redirect
@app.route("/use... | true | true |
790686288c54c7a0b265237e5541e7a2ebfc4a51 | 133,495 | py | Python | lib/sqlalchemy/orm/query.py | slafs/sqlalchemy | 156f473de00024688404d73aea305cd4fc452638 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/query.py | slafs/sqlalchemy | 156f473de00024688404d73aea305cd4fc452638 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/query.py | slafs/sqlalchemy | 156f473de00024688404d73aea305cd4fc452638 | [
"MIT"
] | null | null | null | # orm/query.py
# Copyright (C) 2005-2014 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
"""The Query class and support.
Defines the :class:`.Query` class, the central
constru... | 36.305412 | 84 | 0.594135 |
from itertools import chain
from . import (
attributes, interfaces, object_mapper, persistence,
exc as orm_exc, loading
)
from .base import _entity_descriptor, _is_aliased_class, \
_is_mapped_class, _orm_columns, _generative
from .path_registry import PathRegistry
from .util import (
AliasedCla... | true | true |
790687207d832c9cf0b4e380a80ecbf4c3d09d9f | 519 | py | Python | src/web/drapo/templatetags/timezones.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | 10 | 2017-04-15T05:00:17.000Z | 2019-08-27T21:08:48.000Z | src/web/drapo/templatetags/timezones.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | 2 | 2017-10-06T12:35:59.000Z | 2018-12-03T07:17:12.000Z | src/web/drapo/templatetags/timezones.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | 4 | 2017-03-08T21:17:21.000Z | 2019-05-10T16:22:58.000Z | from django.template import Library
from django.utils import timezone
import datetime
register = Library()
@register.filter
def utcoffset(value):
# Yeap, it's strange, but tags are so ugly.. So I defined not use value, but get current timezone from utils
tz = timezone.get_current_timezone()
utc_offset = ... | 28.833333 | 112 | 0.695568 | from django.template import Library
from django.utils import timezone
import datetime
register = Library()
@register.filter
def utcoffset(value):
tz = timezone.get_current_timezone()
utc_offset = datetime.datetime.now(tz).utcoffset()
minutes = (utc_offset.days * 24 * 60) + (utc_offset.seconds / 60)... | true | true |
790688e4e6852f24cdcc9753889463eb777daea2 | 948 | py | Python | fancytimers/tests/sanity.py | LiteralGenie/FancyTimers | ce6e0080b6e1450d096efe8bfd6c9c2bfd2f76b9 | [
"MIT"
] | null | null | null | fancytimers/tests/sanity.py | LiteralGenie/FancyTimers | ce6e0080b6e1450d096efe8bfd6c9c2bfd2f76b9 | [
"MIT"
] | null | null | null | fancytimers/tests/sanity.py | LiteralGenie/FancyTimers | ce6e0080b6e1450d096efe8bfd6c9c2bfd2f76b9 | [
"MIT"
] | null | null | null | from classes.fixed_scheduler import FixedScheduler
from classes.concretes.sql_mixin import SqlMixin
from sqlalchemy import Column, create_engine, Table
from sqlalchemy.types import Float
from sqlalchemy.orm import registry, Session
import attr
registry = registry()
@registry.mapped
@attr.s(auto_attribs=True)
class M... | 26.333333 | 67 | 0.704641 | from classes.fixed_scheduler import FixedScheduler
from classes.concretes.sql_mixin import SqlMixin
from sqlalchemy import Column, create_engine, Table
from sqlalchemy.types import Float
from sqlalchemy.orm import registry, Session
import attr
registry = registry()
@registry.mapped
@attr.s(auto_attribs=True)
class M... | true | true |
790688ebb94366590d04b95d2613fbe1c13105f9 | 4,479 | py | Python | GestureVolume/venv/lib/python3.8/site-packages/mediapipe/framework/formats/annotation/rasterization_pb2.py | mesquita97/HandTalks | cd035dd39ef0acba9e24516bcea9ed7833fde141 | [
"MIT"
] | null | null | null | GestureVolume/venv/lib/python3.8/site-packages/mediapipe/framework/formats/annotation/rasterization_pb2.py | mesquita97/HandTalks | cd035dd39ef0acba9e24516bcea9ed7833fde141 | [
"MIT"
] | null | null | null | GestureVolume/venv/lib/python3.8/site-packages/mediapipe/framework/formats/annotation/rasterization_pb2.py | mesquita97/HandTalks | cd035dd39ef0acba9e24516bcea9ed7833fde141 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/framework/formats/annotation/rasterization.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 35.547619 | 405 | 0.763563 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
79068ac053d28692f742e9bed9487b114e1dbb87 | 31,953 | py | Python | RayTracingMazeEnem.py | FinFetChannel/PytracingMaze | 6ccb444c76ede7e48ac09a74d550f32884c7c74b | [
"MIT"
] | 9 | 2021-05-01T11:37:05.000Z | 2022-01-14T13:27:28.000Z | RayTracingMazeEnem.py | FinFetChannel/pytracingMaze | 6ccb444c76ede7e48ac09a74d550f32884c7c74b | [
"MIT"
] | null | null | null | RayTracingMazeEnem.py | FinFetChannel/pytracingMaze | 6ccb444c76ede7e48ac09a74d550f32884c7c74b | [
"MIT"
] | 1 | 2021-05-07T03:11:51.000Z | 2021-05-07T03:11:51.000Z | import numpy as np
import pygame as pg
from numba import njit
def main():
size = np.random.randint(20,60) # size of the map
posx, posy, posz = 1.5, np.random.uniform(1, size -1), 0.5
rot, rot_v = (np.pi/4, 0)
lx, ly, lz = (size*20, size*30, 1000)
mr, mg, mb, maph, mapr, exitx, exity,... | 47.337778 | 192 | 0.393234 | import numpy as np
import pygame as pg
from numba import njit
def main():
size = np.random.randint(20,60)
posx, posy, posz = 1.5, np.random.uniform(1, size -1), 0.5
rot, rot_v = (np.pi/4, 0)
lx, ly, lz = (size*20, size*30, 1000)
mr, mg, mb, maph, mapr, exitx, exity, mapt, maps = maze... | true | true |
79068c75f08cb626f4e4651e913afac333b92e6a | 87,820 | py | Python | lib/sqlalchemy/dialects/sqlite/base.py | josteinl/sqlalchemy | 9e7c068d669b209713da62da5748579f92d98129 | [
"MIT"
] | null | null | null | lib/sqlalchemy/dialects/sqlite/base.py | josteinl/sqlalchemy | 9e7c068d669b209713da62da5748579f92d98129 | [
"MIT"
] | null | null | null | lib/sqlalchemy/dialects/sqlite/base.py | josteinl/sqlalchemy | 9e7c068d669b209713da62da5748579f92d98129 | [
"MIT"
] | null | null | null | # sqlite/base.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: sqlite
:name: SQLite
:full_support: 3.21, 3.28+
:norma... | 34.656669 | 110 | 0.599601 |
import datetime
import numbers
import re
from .json import JSON
from .json import JSONIndexType
from .json import JSONPathType
from ... import exc
from ... import schema as sa_schema
from ... import sql
from ... import types as sqltypes
from ... import util
from ...engine import default
from ...engine import p... | true | true |
79068c8456a602991ace5e08f967eb9e53479cee | 509 | py | Python | rafry/raytracer/beam.py | oasys-kit/rafry | f1d83eb7f22cccccfd1babcaaaf64285c0e97aa0 | [
"MIT"
] | null | null | null | rafry/raytracer/beam.py | oasys-kit/rafry | f1d83eb7f22cccccfd1babcaaaf64285c0e97aa0 | [
"MIT"
] | null | null | null | rafry/raytracer/beam.py | oasys-kit/rafry | f1d83eb7f22cccccfd1babcaaaf64285c0e97aa0 | [
"MIT"
] | null | null | null |
class Beam(object):
def __init__(self):
super().__init__()
def get_number_of_rays(self):
raise NotImplementedError("method is abstract")
def get_rays(self):
raise NotImplementedError("method is abstract")
def get_ray(self, ray_index):
raise NotImplementedError("metho... | 23.136364 | 55 | 0.675835 |
class Beam(object):
def __init__(self):
super().__init__()
def get_number_of_rays(self):
raise NotImplementedError("method is abstract")
def get_rays(self):
raise NotImplementedError("method is abstract")
def get_ray(self, ray_index):
raise NotImplementedError("metho... | true | true |
79068cd9b4bc3d41f600987c9187b7dffd3031e7 | 12,477 | py | Python | pxr/usd/bin/usddiff/usddiff.py | dalgos-adsk/USD | 65320d266057ae0a68626217f54a0298ac092799 | [
"AML"
] | 18 | 2017-10-28T22:37:48.000Z | 2022-01-26T12:00:24.000Z | pxr/usd/bin/usddiff/usddiff.py | piscees/USD | 65320d266057ae0a68626217f54a0298ac092799 | [
"AML"
] | null | null | null | pxr/usd/bin/usddiff/usddiff.py | piscees/USD | 65320d266057ae0a68626217f54a0298ac092799 | [
"AML"
] | 3 | 2019-12-03T16:46:14.000Z | 2021-08-23T14:56:21.000Z | #!/pxrpythonsubst
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 38.869159 | 84 | 0.612647 |
import difflib, os, sys
from subprocess import call
import platform
isWindows = (platform.system() == 'Windows')
NO_DIFF_FOUND_EXIT_CODE = 0
DIFF_FOUND_EXIT_CODE = 1
ERROR_EXIT_CODE = 2
def _exit(msg, exitCode):
if msg is not None:
sys.stderr.write(msg + "\n")
sys.exit(exitCod... | false | true |
79068d0ac794773135d67c8a1ee07008a27d37f7 | 4,277 | py | Python | tests/unit/models/test_table_source.py | duddlf23/amundsendatabuilder | 3e281373bfa8989c7a489dcf5b8c67a9f1ac38f1 | [
"Apache-2.0"
] | null | null | null | tests/unit/models/test_table_source.py | duddlf23/amundsendatabuilder | 3e281373bfa8989c7a489dcf5b8c67a9f1ac38f1 | [
"Apache-2.0"
] | null | null | null | tests/unit/models/test_table_source.py | duddlf23/amundsendatabuilder | 3e281373bfa8989c7a489dcf5b8c67a9f1ac38f1 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import ANY
from databuilder.models.graph_serializable import (
RELATION_END_KEY, RELATION_END_LABEL, RELATION_REVERSE_TYPE, RELATION_START_KEY, RELATION_START_LABEL,
RELATION_TYPE,
)
from... | 43.20202 | 118 | 0.679448 |
import unittest
from unittest.mock import ANY
from databuilder.models.graph_serializable import (
RELATION_END_KEY, RELATION_END_LABEL, RELATION_REVERSE_TYPE, RELATION_START_KEY, RELATION_START_LABEL,
RELATION_TYPE,
)
from databuilder.models.table_source import TableSource
from databuilder.serializers impor... | true | true |
79068d8ba921fb7381c1dec471a296e0346d4f52 | 15,592 | py | Python | train_and_eval/trainer.py | alibalapour/HATNet | 9dc4a2203bf51c1d834e20500153402968bcf54e | [
"MIT"
] | 25 | 2020-07-26T12:26:26.000Z | 2022-01-24T11:06:28.000Z | train_and_eval/trainer.py | alibalapour/HATNet | 9dc4a2203bf51c1d834e20500153402968bcf54e | [
"MIT"
] | 1 | 2021-11-29T09:54:17.000Z | 2022-01-08T13:40:40.000Z | train_and_eval/trainer.py | sacmehta/HATNet | c4e50746f68140068bae75a6b07525046255d0b5 | [
"MIT"
] | 9 | 2020-11-18T18:38:21.000Z | 2021-12-11T01:31:50.000Z | # ============================================
__author__ = "Sachin Mehta and Ximing Lu"
__maintainer__ = "Sachin Mehta and Ximing Lu"
# ============================================
import torch
from utilities.print_utilities import *
import os
from utilities.lr_scheduler import get_lr_scheduler
from metrics.metric_ut... | 41.248677 | 140 | 0.602745 |
__author__ = "Sachin Mehta and Ximing Lu"
__maintainer__ = "Sachin Mehta and Ximing Lu"
import torch
from utilities.print_utilities import *
import os
from utilities.lr_scheduler import get_lr_scheduler
from metrics.metric_utils import accuracy
from metrics.statistics import Statistics
import gc
from utilities.utils... | true | true |
79068dabb025f7f64f6fb8acd5f138bc5ff5dda3 | 2,364 | py | Python | robopose/evaluation/meters/utils.py | lesteve/robopose | 536e5317c891bf6bb2b8cbdda294533b3f111e09 | [
"MIT"
] | 43 | 2021-04-19T13:57:00.000Z | 2022-03-30T02:43:29.000Z | robopose/evaluation/meters/utils.py | lesteve/robopose | 536e5317c891bf6bb2b8cbdda294533b3f111e09 | [
"MIT"
] | 1 | 2021-07-07T04:46:57.000Z | 2021-07-09T04:48:34.000Z | robopose/evaluation/meters/utils.py | lesteve/robopose | 536e5317c891bf6bb2b8cbdda294533b3f111e09 | [
"MIT"
] | 6 | 2021-05-10T16:14:08.000Z | 2022-01-13T23:01:34.000Z | import numpy as np
import pandas as pd
from collections import OrderedDict
def one_to_one_matching(pred_infos, gt_infos,
keys=('scene_id', 'view_id'),
allow_pred_missing=False):
keys = list(keys)
pred_infos['pred_id'] = np.arange(len(pred_infos))
gt_infos['g... | 36.369231 | 75 | 0.630711 | import numpy as np
import pandas as pd
from collections import OrderedDict
def one_to_one_matching(pred_infos, gt_infos,
keys=('scene_id', 'view_id'),
allow_pred_missing=False):
keys = list(keys)
pred_infos['pred_id'] = np.arange(len(pred_infos))
gt_infos['g... | true | true |
79068e9728629a1c3b2e86b809aeda3955c65ac2 | 2,178 | py | Python | test_corebio/test_table_io.py | javicorvi/weblogo_edited | c44f2a4be40318571a8991bcbe4d5cb83e327719 | [
"MIT"
] | null | null | null | test_corebio/test_table_io.py | javicorvi/weblogo_edited | c44f2a4be40318571a8991bcbe4d5cb83e327719 | [
"MIT"
] | null | null | null | test_corebio/test_table_io.py | javicorvi/weblogo_edited | c44f2a4be40318571a8991bcbe4d5cb83e327719 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2005 Gavin E. Crooks <gec@threeplusone.com>
#
# This software is distributed under the MIT Open Source License.
# <http://www.opensource.org/licenses/mit-license.html>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and ass... | 33.507692 | 80 | 0.71258 |
import unittest
from corebio import *
from corebio._py3k import StringIO
from corebio.seq import *
from corebio.seq_io import *
from test_corebio import *
class test_table_io(unittest.TestCase):
def test_read(self):
f = StringIO(table_io.example)
seqs = table_io.read(f)... | true | true |
79069073bbd1fec00e8ae8096e7d0fda9c0b6a11 | 6,933 | py | Python | tests/tape/interfaces/test_qnode_jax.py | PritishSehzpaul/pennylane | 93ff1b2deeaf620db90ec91448fde64709a9fd9f | [
"Apache-2.0"
] | 1 | 2021-02-18T02:14:27.000Z | 2021-02-18T02:14:27.000Z | tests/tape/interfaces/test_qnode_jax.py | PritishSehzpaul/pennylane | 93ff1b2deeaf620db90ec91448fde64709a9fd9f | [
"Apache-2.0"
] | null | null | null | tests/tape/interfaces/test_qnode_jax.py | PritishSehzpaul/pennylane | 93ff1b2deeaf620db90ec91448fde64709a9fd9f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicabl... | 33.985294 | 97 | 0.617337 |
import pytest
jax = pytest.importorskip("jax")
jnp = pytest.importorskip("jax.numpy")
import numpy as np
import pennylane as qml
from pennylane.tape import JacobianTape, qnode, QNode, QubitParamShiftTape
def test_qnode_intergration():
dev = qml.device("default.mixed", wires=2)
@qml.qnode(d... | true | true |
7906918058514df117adb2ce11269cef6aba4a6d | 3,594 | py | Python | bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py | guisuanzi/rt-thread | d8fe7772ddb9550891487f51ad6161218391f5d4 | [
"Apache-2.0"
] | 4 | 2019-08-25T14:15:33.000Z | 2020-09-28T13:42:40.000Z | bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py | LoveCeline/rt-thread | 538923d34ea9a36f8b967467c60f36c02abaf387 | [
"Apache-2.0"
] | 2 | 2018-12-11T08:31:42.000Z | 2020-06-11T06:31:58.000Z | bsp/stm32/stm32f103-fire-arbitrary/rtconfig.py | LoveCeline/rt-thread | 538923d34ea9a36f8b967467c60f36c02abaf387 | [
"Apache-2.0"
] | 3 | 2019-11-10T23:04:21.000Z | 2020-03-07T20:45:16.000Z | import os
# toolchains options
ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK... | 27.435115 | 152 | 0.571508 | import os
ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'C:\Users\XXYYZZ'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armc... | true | true |
7906926887ccd244b0431457ba90d0dd5740add8 | 6,179 | py | Python | docs/source/conf.py | agaszmurlo/bdg-sequila | ccc65fab604a068784115277d13c692a4ca46a15 | [
"Apache-2.0"
] | 1 | 2020-06-11T12:27:45.000Z | 2020-06-11T12:27:45.000Z | docs/source/conf.py | agaszmurlo/bdg-sequila | ccc65fab604a068784115277d13c692a4ca46a15 | [
"Apache-2.0"
] | 2 | 2022-03-06T09:35:38.000Z | 2022-03-07T09:01:05.000Z | docs/source/conf.py | mikolajroszak/bdg-sequila | ccc65fab604a068784115277d13c692a4ca46a15 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 29.146226 | 87 | 0.653666 |
project = u'bdg-sequila'
copyright = u'2019, biodatageeks.org'
author = u'biodatageeks.org'
version = u'|version|'
release = u'|version|'
project_name = u'bdg-sequila'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinxcontrib.github_ribbon',
'sphinxcontri... | true | true |
790693ae018bc2b2c882ccede257bf8d888a969c | 3,299 | py | Python | py12306/log/order_log.py | juinjonn/py12306 | 47555694e03b30aaa174080c18a0222092b8c22a | [
"Apache-2.0"
] | 12,397 | 2019-01-08T02:02:22.000Z | 2022-03-31T06:47:06.000Z | py12306/log/order_log.py | xawi2000/py12306 | 0316e52e90a21aca7aeef0042a1aa1d6fba2ee2c | [
"Apache-2.0"
] | 384 | 2019-01-08T09:09:52.000Z | 2022-01-24T06:53:40.000Z | py12306/log/order_log.py | jiangjunlu/12306 | 6ae91fa07f2c1655f63e62353dd4472c27ce838a | [
"Apache-2.0"
] | 3,397 | 2019-01-08T05:43:10.000Z | 2022-03-22T10:14:38.000Z | from py12306.log.base import BaseLog
from py12306.helpers.func import *
@singleton
class OrderLog(BaseLog):
# 这里如果不声明,会出现重复打印,目前不知道什么原因
logs = []
thread_logs = {}
quick_log = []
MESSAGE_REQUEST_INIT_DC_PAGE_FAIL = '请求初始化订单页面失败'
MESSAGE_SUBMIT_ORDER_REQUEST_FAIL = '提交订单失败,错误原因 {} \n'
MESS... | 45.191781 | 109 | 0.614429 | from py12306.log.base import BaseLog
from py12306.helpers.func import *
@singleton
class OrderLog(BaseLog):
logs = []
thread_logs = {}
quick_log = []
MESSAGE_REQUEST_INIT_DC_PAGE_FAIL = '请求初始化订单页面失败'
MESSAGE_SUBMIT_ORDER_REQUEST_FAIL = '提交订单失败,错误原因 {} \n'
MESSAGE_SUBMIT_ORDER_REQUEST_SU... | true | true |
79069488a3ed7b05b315f80f4b0008e0fd3b95ea | 2,429 | py | Python | src/m2_sounds.py | schochla/06-IntroductionToRobots-201930 | 3053a23062f2cb9714057777a3a93dfa3f7473f7 | [
"MIT"
] | null | null | null | src/m2_sounds.py | schochla/06-IntroductionToRobots-201930 | 3053a23062f2cb9714057777a3a93dfa3f7473f7 | [
"MIT"
] | null | null | null | src/m2_sounds.py | schochla/06-IntroductionToRobots-201930 | 3053a23062f2cb9714057777a3a93dfa3f7473f7 | [
"MIT"
] | null | null | null | """
An opportunity to explore how to make an EV3 Robot make sounds.
Authors: Dave Fisher, David Mutchler, Vibha Alangar,
their colleagues, and Leo Schoch-Spana.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
import simple_rosebotics as rb
# ----------------------------------------------------------------... | 46.711538 | 86 | 0.46727 |
import simple_rosebotics as rb
# SOUND system.
# ------------------------------------------------------------------------------
def main():
tone_player = rb.ToneMaker()
tone_player.play_tone_sequence([(392, 350, 100), (392, 350, 100), (392, 350, 100),
(311.1, 250, 100), (466.2, 25, 100)... | true | true |
7906949b6bf55fc6345aadfa45e65a63b4744f5c | 1,494 | py | Python | users/models.py | MaryzangelaBessa/ElRoyale | 4788ec912fde95230b52d481c27577b020678a02 | [
"MIT"
] | 2 | 2019-09-19T13:28:07.000Z | 2019-09-19T19:00:20.000Z | users/models.py | MaryzangelaBessa/ElRoyale | 4788ec912fde95230b52d481c27577b020678a02 | [
"MIT"
] | 4 | 2021-03-19T01:53:26.000Z | 2021-06-10T18:59:34.000Z | users/models.py | MaryzangelaBessa/ElRoyale | 4788ec912fde95230b52d481c27577b020678a02 | [
"MIT"
] | 1 | 2019-11-01T01:37:45.000Z | 2019-11-01T01:37:45.000Z | from uuid import uuid4
from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager,
PermissionsMixin)
from django.core.validators import EmailValidator
from django.db import models
class UserManager(BaseUserManager):
def create_user(self, name, email, passwo... | 28.730769 | 100 | 0.657965 | from uuid import uuid4
from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager,
PermissionsMixin)
from django.core.validators import EmailValidator
from django.db import models
class UserManager(BaseUserManager):
def create_user(self, name, email, passwo... | true | true |
790694aac8eb16f528a4059bc11ab5e98ba4289d | 1,919 | py | Python | Code/PreProcessing/Regex/annotation_crawling.py | avsharma96/Named-Entity-Recognition | 5dfdbbc0b4181a40b1981ad7ff01ed2600c0221d | [
"MIT"
] | null | null | null | Code/PreProcessing/Regex/annotation_crawling.py | avsharma96/Named-Entity-Recognition | 5dfdbbc0b4181a40b1981ad7ff01ed2600c0221d | [
"MIT"
] | null | null | null | Code/PreProcessing/Regex/annotation_crawling.py | avsharma96/Named-Entity-Recognition | 5dfdbbc0b4181a40b1981ad7ff01ed2600c0221d | [
"MIT"
] | null | null | null | """
The code below crawls the annotations of the MADE 1.0 Train Data and stores them
as Corpus ID, Annotation ID, Type, Length, Offset, Text in the
CSV_Annotations.csv file.
Input Files:
All xml files in the annotations folder in the made_train_data folder
Output Files:
CSV_Annotati... | 34.890909 | 143 | 0.600313 |
import os
import xml.etree.ElementTree as ET
import csv
final =list()
final.append(["Content ID", "Annotation ID", "Type", "Length", "Offset", "Text"])
path ="C:\\Project_NLP_Final\\Project Dataset\\made_train_data\\annotations\\"
dirListing = os.listdir(path)
for item in dirListing:
tree = ET.parse(path + '... | true | true |
790694b980290a435bbc6d1016665683115086c8 | 7,651 | py | Python | plugins/rapid7_intsights/icon_rapid7_intsights/util/api.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | plugins/rapid7_intsights/icon_rapid7_intsights/util/api.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | plugins/rapid7_intsights/icon_rapid7_intsights/util/api.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | import json
import time
from dataclasses import dataclass
from logging import Logger
import requests
from insightconnect_plugin_runtime.exceptions import PluginException
from insightconnect_plugin_runtime.helper import clean
from requests.auth import HTTPBasicAuth
@dataclass
class AlertParams:
alert_type: [str]
... | 39.642487 | 120 | 0.606065 | import json
import time
from dataclasses import dataclass
from logging import Logger
import requests
from insightconnect_plugin_runtime.exceptions import PluginException
from insightconnect_plugin_runtime.helper import clean
from requests.auth import HTTPBasicAuth
@dataclass
class AlertParams:
alert_type: [str]
... | true | true |
790694eccfba29d3848b4013a9df93dfe29c7ce6 | 478 | py | Python | pokus1/urls.py | zvolsky/example_translation | 37a8e71df6bdc12dda96b9e84b5c1bb7a16087dc | [
"MIT"
] | null | null | null | pokus1/urls.py | zvolsky/example_translation | 37a8e71df6bdc12dda96b9e84b5c1bb7a16087dc | [
"MIT"
] | null | null | null | pokus1/urls.py | zvolsky/example_translation | 37a8e71df6bdc12dda96b9e84b5c1bb7a16087dc | [
"MIT"
] | null | null | null | from django.urls import path
from django.views.i18n import JavaScriptCatalog
from .views import HelloWorldView
app_name = 'pokus1' # make possible use {% url 'pokus1:..' %}
# however this is maybe deprecated; you can achieve same in include(), see project level urls.py
urlpatterns = [
path('jsi18n/pokus1/', Ja... | 34.142857 | 131 | 0.730126 | from django.urls import path
from django.views.i18n import JavaScriptCatalog
from .views import HelloWorldView
app_name = 'pokus1'
urlpatterns = [
path('jsi18n/pokus1/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
path('', HelloWorldView.as_view(), name='hello')
]
| true | true |
79069520ba8499a61f76c4f589920c516a30c1db | 5,288 | py | Python | utils/utils.py | suhasgupta791/mids-w251-final-project | aa1ef80685c6d9b5fc8a444e438078150cc0d96c | [
"Apache-2.0"
] | null | null | null | utils/utils.py | suhasgupta791/mids-w251-final-project | aa1ef80685c6d9b5fc8a444e438078150cc0d96c | [
"Apache-2.0"
] | null | null | null | utils/utils.py | suhasgupta791/mids-w251-final-project | aa1ef80685c6d9b5fc8a444e438078150cc0d96c | [
"Apache-2.0"
] | 1 | 2020-02-14T01:10:43.000Z | 2020-02-14T01:10:43.000Z | #!/usr/bin/env python
# coding: utf-8
import random
import numpy as np
import sys, os
import pandas as pd
import torch
from torchsummary import summary
from torchtext import data
import torch.nn as nn
import torch.utils.data
from torch.utils.data import Dataset, TensorDataset,DataLoader, RandomSampler
from torch.util... | 45.982609 | 118 | 0.703101 |
import random
import numpy as np
import sys, os
import pandas as pd
import torch
from torchsummary import summary
from torchtext import data
import torch.nn as nn
import torch.utils.data
from torch.utils.data import Dataset, TensorDataset,DataLoader, RandomSampler
from torch.utils.tensorboard import SummaryWriter
i... | true | true |
790695b2230e378c5f81c23793b761a3a832279d | 10,523 | py | Python | python/papaya_i2chttpinst.py | papaya-iot/papaya-examples | ff52997170fbf8975b0b027169fb047762f2b94d | [
"BSD-3-Clause"
] | 1 | 2022-02-21T16:08:55.000Z | 2022-02-21T16:08:55.000Z | python/papaya_i2chttpinst.py | papaya-iot/papaya-examples | ff52997170fbf8975b0b027169fb047762f2b94d | [
"BSD-3-Clause"
] | null | null | null | python/papaya_i2chttpinst.py | papaya-iot/papaya-examples | ff52997170fbf8975b0b027169fb047762f2b94d | [
"BSD-3-Clause"
] | 2 | 2021-07-16T23:27:58.000Z | 2022-01-10T12:30:27.000Z | """
Copyright (C) 2020 Piek Solutions LLC
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 notice, this list of conditions and the following disclaimer.
... | 33.512739 | 756 | 0.566949 |
import requests
import binascii
from codecs import getencoder
import time
def enforce_hex(addr):
if type(addr) == int and addr < 256:
return hex(addr).lstrip('0x')
elif type(addr) == str:
return addr.lstrip('0x')
else:
raise ValueError('addr must be hex string or int ... | true | true |
790696471fbebd66373d6da188317cd690d56dce | 662 | py | Python | pucadmin/schools/migrations/0006_alter_school_courses_offered.py | JobDoesburg/PUC-admin | ab61478cbf1cb0ddb57661a7508e70b23642810b | [
"MIT"
] | null | null | null | pucadmin/schools/migrations/0006_alter_school_courses_offered.py | JobDoesburg/PUC-admin | ab61478cbf1cb0ddb57661a7508e70b23642810b | [
"MIT"
] | null | null | null | pucadmin/schools/migrations/0006_alter_school_courses_offered.py | JobDoesburg/PUC-admin | ab61478cbf1cb0ddb57661a7508e70b23642810b | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-11-29 19:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("organisations", "0004_auto_20210718_1147"),
("schools", "0005_alter_school_courses_offered"),
]
operations = [
migrations.AlterField... | 25.461538 | 57 | 0.563444 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("organisations", "0004_auto_20210718_1147"),
("schools", "0005_alter_school_courses_offered"),
]
operations = [
migrations.AlterField(
model_name="school",
... | true | true |
790698c6e82d67533cbc201fa4f1d367a1d8c25f | 1,495 | py | Python | setup.py | greyside/django-floppyforms | 4116f4dbfef631fa79c5b475444a111237939d40 | [
"BSD-3-Clause"
] | 1 | 2020-10-05T21:51:21.000Z | 2020-10-05T21:51:21.000Z | setup.py | greyside/django-floppyforms | 4116f4dbfef631fa79c5b475444a111237939d40 | [
"BSD-3-Clause"
] | null | null | null | setup.py | greyside/django-floppyforms | 4116f4dbfef631fa79c5b475444a111237939d40 | [
"BSD-3-Clause"
] | 1 | 2020-10-05T21:51:27.000Z | 2020-10-05T21:51:27.000Z | # -*- coding: utf-8 -*-
import codecs
import re
from os import path
from distutils.core import setup
from setuptools import find_packages
def read(*parts):
return codecs.open(path.join(path.dirname(__file__), *parts),
encoding='utf-8').read()
def find_version(*file_paths):
version_fil... | 31.145833 | 68 | 0.628094 |
import codecs
import re
from os import path
from distutils.core import setup
from setuptools import find_packages
def read(*parts):
return codecs.open(path.join(path.dirname(__file__), *parts),
encoding='utf-8').read()
def find_version(*file_paths):
version_file = read(*file_paths)
... | true | true |
79069ace969f4177408f757c77d45f495281853c | 2,282 | py | Python | convertmask/utils/mask2json_script.py | wwdok/mask2json | 403c6b3df677185d5951239d13187b55bda6465a | [
"Apache-2.0"
] | 27 | 2020-06-11T01:47:57.000Z | 2022-03-18T01:47:59.000Z | convertmask/utils/mask2json_script.py | wwdok/mask2json | 403c6b3df677185d5951239d13187b55bda6465a | [
"Apache-2.0"
] | 14 | 2020-06-11T01:50:41.000Z | 2022-03-18T13:11:04.000Z | convertmask/utils/mask2json_script.py | wwdok/mask2json | 403c6b3df677185d5951239d13187b55bda6465a | [
"Apache-2.0"
] | 5 | 2020-10-21T01:51:59.000Z | 2022-02-28T08:27:32.000Z | '''
lanhuage: python
Descripttion:
version: beta
Author: xiaoshuyui
Date: 2020-07-10 10:33:39
LastEditors: xiaoshuyui
LastEditTime: 2021-01-05 10:21:49
'''
import glob
import os
from tqdm import tqdm
from convertmask.utils.methods import getMultiShapes
from convertmask.utils.methods.logger import logger
def getJs... | 31.694444 | 82 | 0.620508 |
import glob
import os
from tqdm import tqdm
from convertmask.utils.methods import getMultiShapes
from convertmask.utils.methods.logger import logger
def getJsons(imgPath, maskPath, savePath, yamlPath=''):
logger.info("currently, only *.jpg supported")
if os.path.isfile(imgPath):
getMultiShapes.get... | true | true |
79069b575b0203071f15c22e0efcb3861cada834 | 40,919 | py | Python | scripts/linters/js_ts_linter_test.py | EishaMazhar/oppia | ab4f3cf20764b27f567798e4b1184471aaf7f73b | [
"Apache-2.0"
] | 1 | 2020-10-11T07:56:09.000Z | 2020-10-11T07:56:09.000Z | scripts/linters/js_ts_linter_test.py | gitter-badger/oppia | 7d8e659264582d7ce74bc6c139e597b82bca0e04 | [
"Apache-2.0"
] | 1 | 2020-05-27T06:08:17.000Z | 2020-05-27T06:08:17.000Z | scripts/linters/js_ts_linter_test.py | gitter-badger/oppia | 7d8e659264582d7ce74bc6c139e597b82bca0e04 | [
"Apache-2.0"
] | 1 | 2020-11-05T12:26:10.000Z | 2020-11-05T12:26:10.000Z | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | 48.482227 | 95 | 0.641951 |
from __future__ import absolute_import
from __future__ import unicode_literals
import multiprocessing
import os
import shutil
import subprocess
import sys
from core.tests import test_utils
from . import js_ts_linter
from . import pre_commit_linter
from .. import common
CURR_DIR = os.path.abspat... | true | true |
79069c6a94506c5d4f3560444aefaf40cd08111d | 428 | py | Python | monero_glue/messages/LiskTransactionType.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 20 | 2018-04-05T22:06:10.000Z | 2021-09-18T10:43:44.000Z | monero_glue/messages/LiskTransactionType.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | null | null | null | monero_glue/messages/LiskTransactionType.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 5 | 2018-08-06T15:06:04.000Z | 2021-07-16T01:58:43.000Z | # Automatically generated by pb2py
# fmt: off
if False:
from typing_extensions import Literal
Transfer = 0 # type: Literal[0]
RegisterSecondPassphrase = 1 # type: Literal[1]
RegisterDelegate = 2 # type: Literal[2]
CastVotes = 3 # type: Literal[3]
RegisterMultisignatureAccount = 4 # type: Literal[4]
CreateDapp... | 30.571429 | 53 | 0.721963 |
if False:
from typing_extensions import Literal
Transfer = 0
RegisterSecondPassphrase = 1
RegisterDelegate = 2
CastVotes = 3
RegisterMultisignatureAccount = 4
CreateDapp = 5
TransferIntoDapp = 6
TransferOutOfDapp = 7
| true | true |
79069cd57bb0e7deabdb4b8fcba5ce272e3fa6da | 21,548 | py | Python | c8ylp/cli/core.py | SoftwareAG/cumulocity-remote-access-local-proxy | 5314b80365c82626a17561acc4f57d209c757b80 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-03-19T12:40:29.000Z | 2021-12-23T11:08:43.000Z | c8ylp/cli/core.py | SoftwareAG/cumulocity-remote-access-local-proxy | 5314b80365c82626a17561acc4f57d209c757b80 | [
"ECL-2.0",
"Apache-2.0"
] | 30 | 2021-04-09T07:53:50.000Z | 2022-03-31T20:20:41.000Z | c8ylp/cli/core.py | SoftwareAG/cumulocity-remote-access-local-proxy | 5314b80365c82626a17561acc4f57d209c757b80 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2021-03-11T14:16:27.000Z | 2021-12-22T11:47:19.000Z | #
# Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
#
# SPDX-License-Identifier: Apache-2.0
#
# 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.apach... | 30.094972 | 118 | 0.622424 |
import dataclasses
import logging
import os
import pathlib
import signal
import threading
import time
import sys
from enum import IntEnum
from logging.handlers import RotatingFileHandler
from typing import Any, Dict, NoReturn, Optional
import click
from ..timer import CommandTimer
from ..banner impo... | true | true |
79069d5d2c833b9a9cc91dab4c3f8fd6bba40a22 | 913 | py | Python | setup.py | geoffjukes/nameko-couchbase | 113a1ab7b72fd049d56e927dcaa6755885c17546 | [
"Apache-2.0"
] | null | null | null | setup.py | geoffjukes/nameko-couchbase | 113a1ab7b72fd049d56e927dcaa6755885c17546 | [
"Apache-2.0"
] | null | null | null | setup.py | geoffjukes/nameko-couchbase | 113a1ab7b72fd049d56e927dcaa6755885c17546 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='nameko-couchbase',
version='0.1.5',
description='Nameko dependency for Couchbase',
url='https://github.com/geoffjukes/nameko-couchbase',
author='Geoff Jukes',
license="Apach... | 33.814815 | 71 | 0.638554 | from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='nameko-couchbase',
version='0.1.5',
description='Nameko dependency for Couchbase',
url='https://github.com/geoffjukes/nameko-couchbase',
author='Geoff Jukes',
license="Apach... | true | true |
79069d65d07e3095beb924880e1da9c6b68f5513 | 1,006 | py | Python | babyshop_app/babyshop/urls.py | MET-DEV/Django-E-Commerce | 9a1a50fe56a888946eec28caeb2c735a60065f19 | [
"MIT"
] | null | null | null | babyshop_app/babyshop/urls.py | MET-DEV/Django-E-Commerce | 9a1a50fe56a888946eec28caeb2c735a60065f19 | [
"MIT"
] | null | null | null | babyshop_app/babyshop/urls.py | MET-DEV/Django-E-Commerce | 9a1a50fe56a888946eec28caeb2c735a60065f19 | [
"MIT"
] | null | null | null | """babyshop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/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')
Class-base... | 37.259259 | 77 | 0.724652 | from django.urls import path, include
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('products.urls')),
path('users/',include('users.urls')),
]+static(... | true | true |
79069d7a7e92d22d0979b30d01150684f877a556 | 2,489 | py | Python | scripts/csv2html/csv2html.py | sjkelly/openlane | 0fec8c8fb2382d3d487127face5109ec7d2baa51 | [
"Apache-2.0"
] | 2 | 2021-09-23T01:55:01.000Z | 2022-03-10T04:06:44.000Z | scripts/csv2html/csv2html.py | sjkelly/openlane | 0fec8c8fb2382d3d487127face5109ec7d2baa51 | [
"Apache-2.0"
] | 1 | 2021-02-10T10:32:45.000Z | 2021-02-11T03:56:36.000Z | scripts/csv2html/csv2html.py | sjkelly/openlane | 0fec8c8fb2382d3d487127face5109ec7d2baa51 | [
"Apache-2.0"
] | 2 | 2021-09-23T01:55:04.000Z | 2022-01-30T10:01:33.000Z | # Copyright 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 32.75 | 117 | 0.723584 |
import csv
import os
import argparse
import pathlib
import pandas as pd
from jinja2 import Environment, PackageLoader, select_autoescape
parser = argparse.ArgumentParser(
description='Takes an input csv report from the run_designs.py script and creates an html summary for it')
parser.add_argument('-... | true | true |
79069d949da4560a5e300cd95474e25a8e5db399 | 3,930 | py | Python | nuts.py | samrobbins85/CMHSS-Coursework | 88affe95ff410d6b9533403e0f866687d5a79432 | [
"MIT"
] | 2 | 2021-04-12T08:26:13.000Z | 2021-07-13T15:26:58.000Z | nuts.py | samrobbins85/CMHSS-Coursework | 88affe95ff410d6b9533403e0f866687d5a79432 | [
"MIT"
] | 9 | 2019-11-07T13:24:16.000Z | 2022-01-24T09:41:51.000Z | nuts.py | samrobbins85/CMHSS-Coursework | 88affe95ff410d6b9533403e0f866687d5a79432 | [
"MIT"
] | 3 | 2020-02-26T12:09:54.000Z | 2021-05-06T15:45:49.000Z | """
nuts_finder
-----------
You give it a point, it tells you all the EU NUTS regions
"""
import geojson
import requests
import re
from io import BytesIO
from zipfile import ZipFile
from shapely import geometry
from functools import lru_cache
import logging
YEAR_REGEX = "NUTS ([0-9]+)"
SCALE_REGEX = "1:([0-9]+) Milli... | 36.055046 | 97 | 0.637913 | import geojson
import requests
import re
from io import BytesIO
from zipfile import ZipFile
from shapely import geometry
from functools import lru_cache
import logging
YEAR_REGEX = "NUTS ([0-9]+)"
SCALE_REGEX = "1:([0-9]+) Million"
TOP_URL = "https://ec.europa.eu/eurostat/cache/" "GISCO/distribution/v2/nuts/download"
... | true | true |
79069e13b6dc710ab9ad1ff91f884709c8529f0a | 1,635 | py | Python | contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py | nickbaum/st2 | 21c01c7c8c0f511ee75e3b2a3a03502472281058 | [
"Apache-2.0"
] | 1 | 2020-11-09T21:05:33.000Z | 2020-11-09T21:05:33.000Z | contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py | ellerbrock/st2 | b3a0d9f82053c1fd5adb616dc8331bad427cd11f | [
"Apache-2.0"
] | 3 | 2021-03-26T00:29:52.000Z | 2021-03-26T00:34:45.000Z | contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py | ellerbrock/st2 | b3a0d9f82053c1fd5adb616dc8331bad427cd11f | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | 31.442308 | 74 | 0.752905 |
from __future__ import absolute_import
import uuid
from st2common import log as logging
from st2common.runners.base import get_metadata as get_runner_metadata
from winrm_runner.winrm_base import WinRmBaseRunner
__all__ = [
'WinRmPsCommandRunner',
'get_runner',
'get_metadata'
]
LOG = loggin... | true | true |
79069f2ad045a3a35831b27298ef5aa566ab2c4c | 5,772 | py | Python | src/image-gallery/azext_image_gallery/custom.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/image-gallery/azext_image_gallery/custom.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/image-gallery/azext_image_gallery/custom.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 49.333333 | 129 | 0.675676 |
from knack.log import get_logger
from azure.cli.core.profiles import ResourceType
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.azclierror import RequiredArgumentMissingError
from azure.cli.core.util import sdk_no_wait
from ._client_factory import _compute_clie... | true | true |
79069f6a16a159b300b61a629f67a60cee85474b | 174 | py | Python | codegen/generator/__init__.py | fangyi-zhou/TypeScript-Multiparty-Sessions | 216ae5806fc9d901086e8e773ef241fc9848c544 | [
"MIT"
] | 4 | 2020-09-09T12:40:17.000Z | 2021-12-05T21:43:49.000Z | codegen/generator/__init__.py | fangyi-zhou/TypeScript-Multiparty-Sessions | 216ae5806fc9d901086e8e773ef241fc9848c544 | [
"MIT"
] | 19 | 2020-03-31T08:11:47.000Z | 2022-02-27T11:13:47.000Z | codegen/generator/__init__.py | fangyi-zhou/TypeScript-Multiparty-Sessions | 216ae5806fc9d901086e8e773ef241fc9848c544 | [
"MIT"
] | 2 | 2020-04-15T14:45:12.000Z | 2021-01-13T13:54:15.000Z | from codegen.generator.browser import BrowserCodegenStrategy
from codegen.generator.code_generator import CodeGenerator
from codegen.generator.node import NodeCodegenStrategy | 58 | 60 | 0.902299 | from codegen.generator.browser import BrowserCodegenStrategy
from codegen.generator.code_generator import CodeGenerator
from codegen.generator.node import NodeCodegenStrategy | true | true |
7906a102057891ed5023dad9d193ef47a1fcff1d | 1,528 | py | Python | flowtron_logger.py | hit-thusz-RookieCJ/flowtron | 3822bd0ed3226b001dd4ec1653809449f889b520 | [
"Apache-2.0"
] | null | null | null | flowtron_logger.py | hit-thusz-RookieCJ/flowtron | 3822bd0ed3226b001dd4ec1653809449f889b520 | [
"Apache-2.0"
] | null | null | null | flowtron_logger.py | hit-thusz-RookieCJ/flowtron | 3822bd0ed3226b001dd4ec1653809449f889b520 | [
"Apache-2.0"
] | null | null | null | import random
import torch
from torch.utils.tensorboard import SummaryWriter
from flowtron_plotting_utils import plot_alignment_to_numpy
from flowtron_plotting_utils import plot_gate_outputs_to_numpy
class FlowtronLogger(SummaryWriter):
def __init__(self, logdir):
super(FlowtronLogger, self).__init__(logd... | 39.179487 | 76 | 0.630236 | import random
import torch
from torch.utils.tensorboard import SummaryWriter
from flowtron_plotting_utils import plot_alignment_to_numpy
from flowtron_plotting_utils import plot_gate_outputs_to_numpy
class FlowtronLogger(SummaryWriter):
def __init__(self, logdir):
super(FlowtronLogger, self).__init__(logd... | true | true |
7906a196647f476d08db56808d5d95dd375d5933 | 18,575 | py | Python | pypureclient/flashblade/FB_2_3/api/link_aggregation_groups_api.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flashblade/FB_2_3/api/link_aggregation_groups_api.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flashblade/FB_2_3/api/link_aggregation_groups_api.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashBlade REST API
A lightweight client for FlashBlade REST API 2.3, developed by Pure Storage, Inc. (http://www.purestorage.com/).
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import... | 44.544365 | 449 | 0.638331 |
from __future__ import absolute_import
import re
import six
from typing import List, Optional
from .. import models
class LinkAggregationGroupsApi(object):
def __init__(self, api_client):
self.api_client = api_client
def api23_link_aggregation_groups_delete_with_http_info(
self,
... | true | true |
7906a1af0aa434a1018f229e752f0645fd08511f | 5,281 | py | Python | SK_Clustering_WIP.py | NatalieBarbosa/hida-datathon-ufz | 6c3272e07696993523fd97e61c38b981852248f4 | [
"MIT"
] | null | null | null | SK_Clustering_WIP.py | NatalieBarbosa/hida-datathon-ufz | 6c3272e07696993523fd97e61c38b981852248f4 | [
"MIT"
] | null | null | null | SK_Clustering_WIP.py | NatalieBarbosa/hida-datathon-ufz | 6c3272e07696993523fd97e61c38b981852248f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path as osp
#import netCDF4
#from netcdf_helpers.reader import say_hello, get_time_series_from_location
#from plot.plot import plot_time_series_for_locations
#from sklearn.model_selection import train_test_split
#from sklearn.preprocessing import MinMaxScaler
import numpy as np
... | 46.734513 | 167 | 0.709903 |
import os.path as osp
import numpy as np
import xarray as xr
import pandas as pd
import matplotlib.pyplot as plt
import mglearn
directory = "/Users/houben/phd/hackathons/hida_datathon/data/MyChallengePaleo"
filename_temp_data_r1 = "T2m_R1_ym_1stMill.nc"
filename_temp_data_r2 = "T2m_R2_ym_1stMill.n... | false | true |
7906a1fe76d3a37bcac2d9bcc255d1e9cc8a2724 | 4,064 | py | Python | garage/datastore.py | gurumitts/garage-butler | f136d78f17b55c91acda0ad4e1b7afeda28769eb | [
"Apache-2.0"
] | 11 | 2016-08-17T05:46:34.000Z | 2021-12-02T12:09:13.000Z | garage/datastore.py | gurumitts/garage-butler | f136d78f17b55c91acda0ad4e1b7afeda28769eb | [
"Apache-2.0"
] | null | null | null | garage/datastore.py | gurumitts/garage-butler | f136d78f17b55c91acda0ad4e1b7afeda28769eb | [
"Apache-2.0"
] | null | null | null | import sqlite3
import logging
DOOR_OPENED = 'door opened'
DOOR_CLOSED = 'door closed'
class DataStore:
def __init__(self, setup=False):
self.connection = sqlite3.connect('db/app.sqlite3.db')
self.connection.row_factory = sqlite3.Row
if setup:
self.setup()
def record_doo... | 33.866667 | 112 | 0.546752 | import sqlite3
import logging
DOOR_OPENED = 'door opened'
DOOR_CLOSED = 'door closed'
class DataStore:
def __init__(self, setup=False):
self.connection = sqlite3.connect('db/app.sqlite3.db')
self.connection.row_factory = sqlite3.Row
if setup:
self.setup()
def record_doo... | true | true |
7906a23f9520296d25e3b4189a8b8cd4d982db33 | 2,212 | py | Python | vb2py/test/testdotnet.py | ceprio/xl_vb2py | 899fec0301140fd8bd313e8c80b3fa839b3f5ee4 | [
"BSD-3-Clause"
] | null | null | null | vb2py/test/testdotnet.py | ceprio/xl_vb2py | 899fec0301140fd8bd313e8c80b3fa839b3f5ee4 | [
"BSD-3-Clause"
] | null | null | null | vb2py/test/testdotnet.py | ceprio/xl_vb2py | 899fec0301140fd8bd313e8c80b3fa839b3f5ee4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: latin-1 -*-
#
# Turn off logging in extensions (too loud!)
from vb2py.test.testframework import *
import vb2py.extensions
import vb2py.utils
vb2py.extensions.disableLogging()
from vb2py.vbparser import buildParseTree, VBParserError
#
# Set some config options which are appropriate for testing
import vb... | 16.757576 | 67 | 0.623418 |
from vb2py.test.testframework import *
import vb2py.extensions
import vb2py.utils
vb2py.extensions.disableLogging()
from vb2py.vbparser import buildParseTree, VBParserError
import vb2py.config
Config = vb2py.config.VB2PYConfig()
Config.setLocalOveride("General", "ReportPartialConversion", "No")
tests = []
... | true | true |
7906a248511b8ead8f4b3cfe1b4c732077b4a6a1 | 77 | py | Python | debug.py | HeqetLabs/pipeline | 325169eead2b08a08e9960fce6a9e8a94e69c298 | [
"Apache-2.0"
] | null | null | null | debug.py | HeqetLabs/pipeline | 325169eead2b08a08e9960fce6a9e8a94e69c298 | [
"Apache-2.0"
] | null | null | null | debug.py | HeqetLabs/pipeline | 325169eead2b08a08e9960fce6a9e8a94e69c298 | [
"Apache-2.0"
] | null | null | null | from pipeline import app
if __name__ == "__main__":
app.run(debug=True)
| 15.4 | 26 | 0.701299 | from pipeline import app
if __name__ == "__main__":
app.run(debug=True)
| true | true |
7906a2ba0f788ea34abb0c4d0389afc879b650b4 | 1,451 | py | Python | explorind_project/explorind_project/urls.py | Reinaldowijaya/explorind | f174b505b857c8ad56848bc29cc11724894df567 | [
"MIT"
] | 1 | 2018-11-03T23:55:52.000Z | 2018-11-03T23:55:52.000Z | explorind_project/explorind_project/urls.py | Reinaldowijaya/explorind | f174b505b857c8ad56848bc29cc11724894df567 | [
"MIT"
] | null | null | null | explorind_project/explorind_project/urls.py | Reinaldowijaya/explorind | f174b505b857c8ad56848bc29cc11724894df567 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
import settings.base
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'profiles.views.index', name='index'),
url(r'^accou... | 40.305556 | 73 | 0.669194 | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
import settings.base
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'profiles.views.index', name='index'),
url(r'^accounts/', include('allauth.urls')),
... | true | true |
7906a3221aa5e6d21e6628ad09562743a9ac31aa | 259 | py | Python | shipments/shipments/doctype/port_of_loading/port_of_loading.py | umar567/shipment-repo | b6f5830310ae5c9bd45bef252effa489534517bb | [
"MIT"
] | null | null | null | shipments/shipments/doctype/port_of_loading/port_of_loading.py | umar567/shipment-repo | b6f5830310ae5c9bd45bef252effa489534517bb | [
"MIT"
] | null | null | null | shipments/shipments/doctype/port_of_loading/port_of_loading.py | umar567/shipment-repo | b6f5830310ae5c9bd45bef252effa489534517bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Havenir and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PortOfLoading(Document):
pass
| 23.545455 | 49 | 0.776062 |
from __future__ import unicode_literals
from frappe.model.document import Document
class PortOfLoading(Document):
pass
| true | true |
7906a37308a4dce48e3db627baa57958812a5d2f | 89 | py | Python | output/models/saxon_data/all/all001_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/saxon_data/all/all001_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/saxon_data/all/all001_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.saxon_data.all.all001_xsd.all001 import Doc
__all__ = [
"Doc",
]
| 14.833333 | 62 | 0.719101 | from output.models.saxon_data.all.all001_xsd.all001 import Doc
__all__ = [
"Doc",
]
| true | true |
7906a41e203cdf69a82c8aa7b1b5529e404046cf | 652 | py | Python | cereal/messaging_arne/demo.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 85 | 2019-06-14T17:51:31.000Z | 2022-02-09T22:18:20.000Z | cereal/messaging_arne/demo.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 4 | 2018-12-08T19:02:06.000Z | 2019-09-01T13:54:26.000Z | cereal/messaging_arne/demo.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 73 | 2018-12-03T19:34:42.000Z | 2020-07-27T05:10:23.000Z | import time
from messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
MSGS = 1e5
if __name__ == "__main__":
c = Context()
sub_sock = SubSocket()
pub_sock = PubSocket()
sub_sock.connect(c, "controlsState")
pub_sock.connect(c, "controlsState")
poll... | 21.032258 | 113 | 0.642638 | import time
from messaging_pyx import Context, Poller, SubSocket, PubSocket
MSGS = 1e5
if __name__ == "__main__":
c = Context()
sub_sock = SubSocket()
pub_sock = PubSocket()
sub_sock.connect(c, "controlsState")
pub_sock.connect(c, "controlsState")
poller = Poller()
poller.registerSocket(sub_sock)
... | true | true |
7906a4c57fc6f2068b03b13b4ea23881acebec75 | 85 | py | Python | src/config.py | exthrempty/vkbottle-bot-template | 491e1bd142371eca42ece8085cc3f8657f091ad3 | [
"MIT"
] | 4 | 2021-11-02T18:21:37.000Z | 2021-11-27T08:59:23.000Z | src/config.py | exthrempty/vkbottle-bot-template | 491e1bd142371eca42ece8085cc3f8657f091ad3 | [
"MIT"
] | null | null | null | src/config.py | exthrempty/vkbottle-bot-template | 491e1bd142371eca42ece8085cc3f8657f091ad3 | [
"MIT"
] | 1 | 2021-11-02T18:24:44.000Z | 2021-11-02T18:24:44.000Z | from envparse import env
env.read_envfile(".env")
BOT_TOKEN = env.str("BOT_TOKEN") | 14.166667 | 32 | 0.741176 | from envparse import env
env.read_envfile(".env")
BOT_TOKEN = env.str("BOT_TOKEN") | true | true |
7906a52cd4fe6b29e321fd090c89f09a8e79b0a2 | 1,150 | py | Python | python/Django/django1/urls.py | ShiroDevC/portfolio | f31ce2bc4a5a2725d4de40a22997dca2b361d367 | [
"MIT"
] | null | null | null | python/Django/django1/urls.py | ShiroDevC/portfolio | f31ce2bc4a5a2725d4de40a22997dca2b361d367 | [
"MIT"
] | null | null | null | python/Django/django1/urls.py | ShiroDevC/portfolio | f31ce2bc4a5a2725d4de40a22997dca2b361d367 | [
"MIT"
] | null | null | null | """django1 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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')
Class-based... | 38.333333 | 82 | 0.721739 | from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('blog/', include('blog.urls')),
path('polls/', include('polls.urls')),
path('portfolio', include('portfolio.urls')),
path('admin/', adm... | true | true |
7906a5878687fea08eea316d9302d9a2b35677ae | 470 | py | Python | casepy/eulerRuO2/nNoh512x1/chars.py | will-iam/Variant | 5b6732134fd51cf6c2b90b51b7976be0693ba28d | [
"MIT"
] | 8 | 2017-05-04T07:50:02.000Z | 2019-05-17T02:27:20.000Z | casepy/eulerRuO2/nNoh512x1/chars.py | will-iam/Variant | 5b6732134fd51cf6c2b90b51b7976be0693ba28d | [
"MIT"
] | null | null | null | casepy/eulerRuO2/nNoh512x1/chars.py | will-iam/Variant | 5b6732134fd51cf6c2b90b51b7976be0693ba28d | [
"MIT"
] | null | null | null | import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '../../../'))
import script.rio as io
import script.initial_condition.noh1D as noh1D
# Domain properties
lx = 1.0
ly = 1.0
Nx = 512
Ny = 1
# Scheme execution options
T = 0.6
CFL = 0.5
gamma = 5./3.
BClayer = 1
quantityList = ['rho', 'rhou_x', 'rhou_y', '... | 18.8 | 83 | 0.680851 | import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '../../../'))
import script.rio as io
import script.initial_condition.noh1D as noh1D
lx = 1.0
ly = 1.0
Nx = 512
Ny = 1
T = 0.6
CFL = 0.5
gamma = 5./3.
BClayer = 1
quantityList = ['rho', 'rhou_x', 'rhou_y', 'rhoE']
def buildme(quantityDict, coords_to_u... | true | true |
7906a5a7369970e020fbb91590c06bea93d2fdfc | 1,897 | py | Python | examples/views/ephemeral.py | NextChai/discord.py | 1bb8ea97db38594cd2f1bbc727b81e0bba81efc3 | [
"MIT"
] | 8 | 2021-08-28T03:10:57.000Z | 2021-10-31T07:49:18.000Z | examples/views/ephemeral.py | NextChai/discord.py | 1bb8ea97db38594cd2f1bbc727b81e0bba81efc3 | [
"MIT"
] | null | null | null | examples/views/ephemeral.py | NextChai/discord.py | 1bb8ea97db38594cd2f1bbc727b81e0bba81efc3 | [
"MIT"
] | 1 | 2021-09-30T13:49:45.000Z | 2021-09-30T13:49:45.000Z | from discord.ext import commands
import discord
class EphemeralCounterBot(commands.Bot):
def __init__(self):
super().__init__()
async def on_ready(self):
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
# Define a simple View that gives us a counter button
clas... | 39.520833 | 89 | 0.702688 | from discord.ext import commands
import discord
class EphemeralCounterBot(commands.Bot):
def __init__(self):
super().__init__()
async def on_ready(self):
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
class Counter(discord.ui.View):
... | true | true |
7906a670a76b8501c8a9810318daa888510802ec | 1,799 | py | Python | examples/example-5.py | abarreal/coopy | af2c42ab20e534d7790d7f591d39ea9e6c727c35 | [
"MIT"
] | null | null | null | examples/example-5.py | abarreal/coopy | af2c42ab20e534d7790d7f591d39ea9e6c727c35 | [
"MIT"
] | null | null | null | examples/example-5.py | abarreal/coopy | af2c42ab20e534d7790d7f591d39ea9e6c727c35 | [
"MIT"
] | null | null | null | #
# This example is again a graph coloring problem. In this case, however,
# a stronger object oriented approach is adopted to show how Coopy is
# indeed compatible with such practices.
#
import coopy
import random
class Node:
def __init__(self):
self._color = coopy.symbolic_int('c')
self._neighb... | 28.109375 | 74 | 0.617009 |
import coopy
import random
class Node:
def __init__(self):
self._color = coopy.symbolic_int('c')
self._neighbors = set()
@property
def color(self):
return self._color
@property
def has_valid_connections(self):
return coopy.all([self.color != n.color for n in... | true | true |
7906a6f5f47fab50ffebdffe61744dcd8129dab9 | 771 | py | Python | tests/test_expiration.py | vera1118/async_lru | e292b73e2a655dd5fb9a42a17a6170c66efb52a8 | [
"MIT"
] | null | null | null | tests/test_expiration.py | vera1118/async_lru | e292b73e2a655dd5fb9a42a17a6170c66efb52a8 | [
"MIT"
] | null | null | null | tests/test_expiration.py | vera1118/async_lru | e292b73e2a655dd5fb9a42a17a6170c66efb52a8 | [
"MIT"
] | null | null | null | import asyncio
import time
import pytest
from async_lru import alru_cache
pytestmark = pytest.mark.asyncio
async def test_expiration(check_lru, loop):
@alru_cache(maxsize=4, expiration_time=2, loop=loop)
async def coro(val):
return val
inputs = [1, 2, 3]
coros = [coro(v) for v in inputs]
... | 23.363636 | 66 | 0.658885 | import asyncio
import time
import pytest
from async_lru import alru_cache
pytestmark = pytest.mark.asyncio
async def test_expiration(check_lru, loop):
@alru_cache(maxsize=4, expiration_time=2, loop=loop)
async def coro(val):
return val
inputs = [1, 2, 3]
coros = [coro(v) for v in inputs]
... | true | true |
7906a6fde0ca63bcd157e24f3181b2fae1b27ca5 | 5,245 | py | Python | spark_fhir_schemas/stu3/complex_types/testreport_teardown.py | icanbwell/SparkFhirSchemas | 8c828313c39850b65f8676e67f526ee92b7d624e | [
"Apache-2.0"
] | 2 | 2020-10-31T23:25:01.000Z | 2021-06-09T14:12:42.000Z | spark_fhir_schemas/stu3/complex_types/testreport_teardown.py | icanbwell/SparkFhirSchemas | 8c828313c39850b65f8676e67f526ee92b7d624e | [
"Apache-2.0"
] | null | null | null | spark_fhir_schemas/stu3/complex_types/testreport_teardown.py | icanbwell/SparkFhirSchemas | 8c828313c39850b65f8676e67f526ee92b7d624e | [
"Apache-2.0"
] | null | null | null | from typing import Union, List, Optional
from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType
# This file is auto-generated by generate_schema so do not edit manually
# noinspection PyPep8Naming
class TestReport_TeardownSchema:
"""
A summary of information based on the resul... | 42.642276 | 96 | 0.563203 | from typing import Union, List, Optional
from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType
class TestReport_TeardownSchema:
@staticmethod
def get_schema(
max_nesting_depth: Optional[int] = 6,
nesting_depth: int = 0,
nesting_list: List[str] ... | true | true |
7906a7b370537741e3d8794e81c7da71067d6607 | 75,859 | py | Python | python/ccxt/base/exchange.py | newdime/ccxt | baf9302b7bb760f0779b38521acd69d5fce78806 | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | newdime/ccxt | baf9302b7bb760f0779b38521acd69d5fce78806 | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | newdime/ccxt | baf9302b7bb760f0779b38521acd69d5fce78806 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Base exchange class"""
# -----------------------------------------------------------------------------
__version__ = '1.18.575'
# -----------------------------------------------------------------------------
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkE... | 40.56631 | 299 | 0.595025 |
__version__ = '1.18.575'
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkError
from ccxt.base.errors import NotSupported
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import DDoSProtection
from ccxt.base.errors import RequestTimeout
from ccxt.base.errors i... | true | true |
7906a8c3f5fdac8427b4722b6aa4f5168db10968 | 9,411 | py | Python | climatespider/climatespider/spiders/AO_wugspider.py | burnman108/climateSpider | 434ba25b6a30fe6d07231b7758cbc64d8243bf4c | [
"Apache-2.0"
] | null | null | null | climatespider/climatespider/spiders/AO_wugspider.py | burnman108/climateSpider | 434ba25b6a30fe6d07231b7758cbc64d8243bf4c | [
"Apache-2.0"
] | null | null | null | climatespider/climatespider/spiders/AO_wugspider.py | burnman108/climateSpider | 434ba25b6a30fe6d07231b7758cbc64d8243bf4c | [
"Apache-2.0"
] | null | null | null | #-*- coding: utf-8 -*-
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from climatespider.items import ClimatespiderItem
from scrapy.selector import Selector
from dateutil.parser import parse
import re
import datetime
from scrapy.exceptions import CloseSpider
def getyester... | 66.274648 | 140 | 0.568165 |
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from climatespider.items import ClimatespiderItem
from scrapy.selector import Selector
from dateutil.parser import parse
import re
import datetime
from scrapy.exceptions import CloseSpider
def getyesterdaty():
today_date... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.