hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c06cd4c339286a3cdca4b70196787f1897e5ade | 16,305 | py | Python | chronometry/estimate/Estimator.py | idin/chronometry | e022a1d06d8e8be990483130bc314a189de2f149 | [
"MIT"
] | null | null | null | chronometry/estimate/Estimator.py | idin/chronometry | e022a1d06d8e8be990483130bc314a189de2f149 | [
"MIT"
] | null | null | null | chronometry/estimate/Estimator.py | idin/chronometry | e022a1d06d8e8be990483130bc314a189de2f149 | [
"MIT"
] | null | null | null |
from slytherin.hash import hash_object
from slytherin.functions import get_function_arguments
from ravenclaw.preprocessing import Polynomial, Normalizer
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestClassifier
from pandas import DataFrame, concat
from random import randint... | 30.998099 | 117 | 0.719227 |
from slytherin.hash import hash_object
from slytherin.functions import get_function_arguments
from ravenclaw.preprocessing import Polynomial, Normalizer
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestClassifier
from pandas import DataFrame, concat
from random import randint... | true | true |
1c06cd5618df7069eea04a7368e6e2e23644eb1d | 13,348 | py | Python | unit/detectors/hough_circle.py | thejoeejoee/unit-brno-2018 | 94b704cf09f1b29c3f6e620bd751682a0e744c44 | [
"MIT"
] | 3 | 2018-04-08T17:29:21.000Z | 2018-06-19T14:51:00.000Z | unit/detectors/hough_circle.py | thejoeejoee/unit-brno-2018 | 94b704cf09f1b29c3f6e620bd751682a0e744c44 | [
"MIT"
] | null | null | null | unit/detectors/hough_circle.py | thejoeejoee/unit-brno-2018 | 94b704cf09f1b29c3f6e620bd751682a0e744c44 | [
"MIT"
] | null | null | null | # coding=utf-8
import logging
from collections import defaultdict, namedtuple
from math import pi
from typing import DefaultDict, Dict, Iterable, Tuple, Set, Callable
import numpy as np
from matplotlib import pyplot as plt
Circle = namedtuple('Circle', 'x y radius')
class HoughCircleDetector(object):
"""
Wi... | 35.88172 | 115 | 0.504645 | import logging
from collections import defaultdict, namedtuple
from math import pi
from typing import DefaultDict, Dict, Iterable, Tuple, Set, Callable
import numpy as np
from matplotlib import pyplot as plt
Circle = namedtuple('Circle', 'x y radius')
class HoughCircleDetector(object):
GRADIENT_THRESHOLD = 40
... | true | true |
1c06d04ef5ae6ca607f53610b5c61cf01e1f7262 | 5,493 | py | Python | tests/test_formatted_text.py | tcrensink/python-prompt-toolkit | bc200c4a58d2a3059f8a4606e95ecdd731f4e1cd | [
"BSD-3-Clause"
] | null | null | null | tests/test_formatted_text.py | tcrensink/python-prompt-toolkit | bc200c4a58d2a3059f8a4606e95ecdd731f4e1cd | [
"BSD-3-Clause"
] | null | null | null | tests/test_formatted_text.py | tcrensink/python-prompt-toolkit | bc200c4a58d2a3059f8a4606e95ecdd731f4e1cd | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from prompt_toolkit_dev.formatted_text import (
ANSI,
HTML,
FormattedText,
PygmentsTokens,
Template,
merge_formatted_text,
to_formatted_text,
)
from prompt_toolkit_dev.formatted_text.utils import split_lines
def test_basic_html():
html = HTML('<... | 24.198238 | 100 | 0.510468 | from __future__ import unicode_literals
from prompt_toolkit_dev.formatted_text import (
ANSI,
HTML,
FormattedText,
PygmentsTokens,
Template,
merge_formatted_text,
to_formatted_text,
)
from prompt_toolkit_dev.formatted_text.utils import split_lines
def test_basic_html():
html = HTML('<... | true | true |
1c06d071432a8957617c5994a5abbecec6908ddb | 547 | py | Python | test/test_bridge.py | pandaxtc/cclib | 24f508625468a338cfcbf5eb26f0e0e4bd617b21 | [
"BSD-3-Clause"
] | 3 | 2018-05-30T18:14:35.000Z | 2018-11-06T21:22:07.000Z | test/test_bridge.py | pandaxtc/cclib | 24f508625468a338cfcbf5eb26f0e0e4bd617b21 | [
"BSD-3-Clause"
] | null | null | null | test/test_bridge.py | pandaxtc/cclib | 24f508625468a338cfcbf5eb26f0e0e4bd617b21 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Run bridge unit tests for cclib."""
import sys
import unittest
sys.path.insert(1, "bridge")
if sys.version_info[0] =... | 22.791667 | 78 | 0.69287 |
import sys
import unittest
sys.path.insert(1, "bridge")
if sys.version_info[0] == 3 and sys.version_info[1] >= 4:
from .bridge.testbiopython import *
from .bridge.testopenbabel import *
if sys.version_info[0] == 2:
from .bridge.testpyquante import *
if __name__ == "__main__":
unittest.main()
| true | true |
1c06d0d05563224f3e913dc7e950da505c9aa621 | 15,472 | py | Python | wc_kb/eukaryote_schema.py | lzy7071/wc_kb | 1642567cb2a439d1e74a8638882f84b90f8c0333 | [
"MIT"
] | null | null | null | wc_kb/eukaryote_schema.py | lzy7071/wc_kb | 1642567cb2a439d1e74a8638882f84b90f8c0333 | [
"MIT"
] | null | null | null | wc_kb/eukaryote_schema.py | lzy7071/wc_kb | 1642567cb2a439d1e74a8638882f84b90f8c0333 | [
"MIT"
] | null | null | null | """ Schema to represent a knowledge base to build models of eukaryotes
:Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
:Date: 2018-09-10
:Copyright: 2018, Karr Lab
:License: MIT
"""
from wc_utils.util import chem
import enum
import obj_model
from wc_kb import core
#####################
#####################
# Enumer... | 35.004525 | 108 | 0.568382 |
from wc_utils.util import chem
import enum
import obj_model
from wc_kb import core
class RegulatoryElementType(enum.Enum):
promoter = 1
promoter_flanking_region = 2
enhancer = 3
CTCF_binding_site = 4
TF_binding_site = 5
open_chromatin_region = 6
class ActivityLevel(enum.Enum):
active =... | true | true |
1c06d211d54922c802a79e1b37cc5f0698d192e5 | 562 | py | Python | console-version/tests/game/test_game_manager.py | Razique/the-lost-planet | 8503f66aa860c819185599b406fba5a3cd0b2248 | [
"Apache-2.0"
] | null | null | null | console-version/tests/game/test_game_manager.py | Razique/the-lost-planet | 8503f66aa860c819185599b406fba5a3cd0b2248 | [
"Apache-2.0"
] | null | null | null | console-version/tests/game/test_game_manager.py | Razique/the-lost-planet | 8503f66aa860c819185599b406fba5a3cd0b2248 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from game import game_manager
class TestUtils(TestCase):
def test_init(self):
self.test_utils = game_manager.Utils()
self.assertFalse(self.test_utils.message)
self.assertEqual(self.test_utils.prompt("test_value", test=True), 0)
self.assertFalse(self.te... | 33.058824 | 148 | 0.72242 | from unittest import TestCase
from game import game_manager
class TestUtils(TestCase):
def test_init(self):
self.test_utils = game_manager.Utils()
self.assertFalse(self.test_utils.message)
self.assertEqual(self.test_utils.prompt("test_value", test=True), 0)
self.assertFalse(self.te... | true | true |
1c06d2515d2658296633ee92c99a33d260a931e5 | 3,251 | py | Python | alipay/aop/api/domain/AlipayUserSafeboxRecordSaveModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayUserSafeboxRecordSaveModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayUserSafeboxRecordSaveModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserSafeboxRecordSaveModel(object):
def __init__(self):
self._content = None
self._key_version = None
self._scene_code = None
self._title = None
self... | 28.025862 | 73 | 0.568748 | import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserSafeboxRecordSaveModel(object):
def __init__(self):
self._content = None
self._key_version = None
self._scene_code = None
self._title = None
self._unique_id = None
self._user_id = Non... | true | true |
1c06d3c6aeb7b0caf22c08b6f0c795f86b26d3d4 | 893 | py | Python | module/utilities.py | cryzereye/monke_bot | bc01e7bb0175b23243657cc2a4a446fc14dc2505 | [
"MIT"
] | null | null | null | module/utilities.py | cryzereye/monke_bot | bc01e7bb0175b23243657cc2a4a446fc14dc2505 | [
"MIT"
] | null | null | null | module/utilities.py | cryzereye/monke_bot | bc01e7bb0175b23243657cc2a4a446fc14dc2505 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
import json
if not os.path.exists('logs'):
os.makedirs('logs')
# general functions
def loadJsonFile(filename, mode):
if os.path.exists(filename):
f = open(filename, mode, encoding="utf8")
return json.load(f)
return FileExistsError
def logger(message... | 27.90625 | 72 | 0.615901 | from datetime import datetime
import os
import json
if not os.path.exists('logs'):
os.makedirs('logs')
def loadJsonFile(filename, mode):
if os.path.exists(filename):
f = open(filename, mode, encoding="utf8")
return json.load(f)
return FileExistsError
def logger(message):
now = datetim... | true | true |
1c06d3ea5d4ff841d1c9c1b80e0699ec2e846b84 | 756 | py | Python | coding-challenges/code-eval/FirstNon-RepeatedCharacter.py | masharp/algorithms-n-structures | b043a792986519298679d001c82733fdbfd3e7b9 | [
"MIT"
] | 1 | 2016-05-28T17:26:27.000Z | 2016-05-28T17:26:27.000Z | coding-challenges/code-eval/FirstNon-RepeatedCharacter.py | masharp/useful-algorithms | b043a792986519298679d001c82733fdbfd3e7b9 | [
"MIT"
] | null | null | null | coding-challenges/code-eval/FirstNon-RepeatedCharacter.py | masharp/useful-algorithms | b043a792986519298679d001c82733fdbfd3e7b9 | [
"MIT"
] | null | null | null | """
My solution to CodeEval's First Non-Repeated Character Algorithm Challange (Moderate)
https://www.codeeval.com/open_challenges/12/
michael@softwareontheshore.com
"""
import sys
import collections
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
test = test.strip()
## count ... | 27 | 85 | 0.625661 | """
My solution to CodeEval's First Non-Repeated Character Algorithm Challange (Moderate)
https://www.codeeval.com/open_challenges/12/
michael@softwareontheshore.com
"""
import sys
import collections
with open(sys.argv[1], 'r') as test_cases:
for test in test_cases:
test = test.strip()
## count ... | false | true |
1c06d42685682a1fe37db46dcb5f05efd2f3bf25 | 18,148 | py | Python | appengine/findit/handlers/flake/detection/flake_detection_utils.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 1 | 2020-11-11T06:25:13.000Z | 2020-11-11T06:25:13.000Z | appengine/findit/handlers/flake/detection/flake_detection_utils.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/handlers/flake/detection/flake_detection_utils.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 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.
"""Util functions for flake detection handlers."""
from collections import defaultdict
import logging
from google.appengine.ext import ndb
from gae_libs im... | 35.936634 | 115 | 0.708838 |
from collections import defaultdict
import logging
from google.appengine.ext import ndb
from gae_libs import dashboard_util
from libs import time_util
from libs import analysis_status
from model import entity_util
from model.flake.analysis.master_flake_analysis import MasterFlakeAnalysis
from model.flake.detection.f... | true | true |
1c06d4b2baa97083ea694c9d5b327d192fc0a658 | 369 | py | Python | sensorimotor/cli/sensorimotor.py | lastmeta/sensorimotor | 93a7fb1080d5e835ae28242750e61174869b04fc | [
"Apache-2.0"
] | 2 | 2020-10-02T11:08:37.000Z | 2020-10-05T03:31:50.000Z | sensorimotor/cli/sensorimotor.py | lastmeta/sensorimotor | 93a7fb1080d5e835ae28242750e61174869b04fc | [
"Apache-2.0"
] | null | null | null | sensorimotor/cli/sensorimotor.py | lastmeta/sensorimotor | 93a7fb1080d5e835ae28242750e61174869b04fc | [
"Apache-2.0"
] | 1 | 2020-10-02T11:49:07.000Z | 2020-10-02T11:49:07.000Z | # use click
# specify environment and agent
# tell it to explore
# once it is done, you can inspect it's mind
# you can reset it's location in env
# you can tell it to move to new location
def demo():
''' demo mode is highly limited, made for demo '''
from sensorimotor.lib import MetaEnvironment
MetaEnvir... | 21.705882 | 54 | 0.696477 | # you can reset it's location in env
def demo():
from sensorimotor.lib import MetaEnvironment
MetaEnvironment()
if __name__ == '__main__':
demo()
| true | true |
1c06d53b32db75fda30df94816bbd07baafa5436 | 698 | py | Python | nanpy/mock/mockstepper.py | jarajanos/nanpy | e1928afb3dfe6e8d78c3bc4247257d32eed7f170 | [
"MIT"
] | 178 | 2015-01-03T11:56:49.000Z | 2021-12-23T14:47:55.000Z | nanpy/mock/mockstepper.py | Whonymous/nanpy | c19fb8673880e8648cc87a47bafdeeebcd56b155 | [
"MIT"
] | 88 | 2015-01-23T09:06:43.000Z | 2021-12-26T19:58:51.000Z | nanpy/mock/mockstepper.py | Whonymous/nanpy | c19fb8673880e8648cc87a47bafdeeebcd56b155 | [
"MIT"
] | 77 | 2015-02-18T17:26:11.000Z | 2021-09-28T02:47:25.000Z | import logging
from nanpy.mock.mockobject import MockObject
log = logging.getLogger(__name__)
class MockStepper(MockObject):
firmware_id = "Stepper"
def factory(self, params):
d = dict(
revsteps=int(params[0]),
pin1=int(params[1]),
pin2=int(params[2]),
... | 23.266667 | 63 | 0.54298 | import logging
from nanpy.mock.mockobject import MockObject
log = logging.getLogger(__name__)
class MockStepper(MockObject):
firmware_id = "Stepper"
def factory(self, params):
d = dict(
revsteps=int(params[0]),
pin1=int(params[1]),
pin2=int(params[2]),
... | true | true |
1c06d68e9edc3480235b15fa4c36471a2c30ec0c | 25,392 | py | Python | selfdrive/controls/controlsd.py | otaku/openpilot | 09283f4d6af839756e7ff49035d0b2251859aebe | [
"MIT"
] | 1 | 2021-04-10T09:14:43.000Z | 2021-04-10T09:14:43.000Z | selfdrive/controls/controlsd.py | otaku/openpilot | 09283f4d6af839756e7ff49035d0b2251859aebe | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | otaku/openpilot | 09283f4d6af839756e7ff49035d0b2251859aebe | [
"MIT"
] | 1 | 2021-04-10T09:14:45.000Z | 2021-04-10T09:14:45.000Z | #!/usr/bin/env python3
import os
import gc
import capnp
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblocking
import cereal.messaging as ... | 40.433121 | 194 | 0.716367 | import os
import gc
import capnp
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblocking
import cereal.messaging as messaging
from selfdriv... | true | true |
1c06d82c334ac1290e8ddf8e82498e088a0d8703 | 3,420 | py | Python | src/mqtt/user_pubs.py | Fede-VR73/mp32_generic | 168bb91f8c30b024b1b749ace58db3d5c41a4de9 | [
"MIT"
] | null | null | null | src/mqtt/user_pubs.py | Fede-VR73/mp32_generic | 168bb91f8c30b024b1b749ace58db3d5c41a4de9 | [
"MIT"
] | null | null | null | src/mqtt/user_pubs.py | Fede-VR73/mp32_generic | 168bb91f8c30b024b1b749ace58db3d5c41a4de9 | [
"MIT"
] | 2 | 2020-11-03T08:54:28.000Z | 2021-05-27T13:28:17.000Z | ################################################################################
# filename: user_pub.py
# date: 29. Oct. 2020
# username: winkste
# name: Stephan Wink
# description: This module defines a user publication class to encapsulate the
# publication handling.
#
##################################... | 39.310345 | 92 | 0.360526 |
import src.utils.trace as T
publish_cb = None
def set_mqtt_publish_cb(pubs_cb):
global publish_cb
publish_cb = pubs_cb
class UserPubs:
topic = ''
payload = ''
def __init__(self, topic, device, channel = 'std', skill_entity=None):
... | true | true |
1c06d882efdb47de10ae1ffb7651d74e642a60ea | 7,461 | py | Python | Applications/pyLODE-2.8.3/pylode/common.py | ngonimombeshora/documentation | 6df314271140466746b75a0b9912d1580cdd2688 | [
"MIT"
] | null | null | null | Applications/pyLODE-2.8.3/pylode/common.py | ngonimombeshora/documentation | 6df314271140466746b75a0b9912d1580cdd2688 | [
"MIT"
] | null | null | null | Applications/pyLODE-2.8.3/pylode/common.py | ngonimombeshora/documentation | 6df314271140466746b75a0b9912d1580cdd2688 | [
"MIT"
] | 1 | 2022-03-06T15:56:55.000Z | 2022-03-06T15:56:55.000Z | from os import path
import requests
from rdflib import util, Graph
VERSION = "2.8.3"
APP_DIR = path.dirname(path.realpath(__file__))
TEMPLATES_DIR = path.join(path.dirname(path.realpath(__file__)), "templates")
STYLE_DIR = path.join(path.dirname(path.realpath(__file__)), "style")
RDF_FILE_EXTENSIONS = [".rdf", ".owl",... | 38.859375 | 204 | 0.589197 | from os import path
import requests
from rdflib import util, Graph
VERSION = "2.8.3"
APP_DIR = path.dirname(path.realpath(__file__))
TEMPLATES_DIR = path.join(path.dirname(path.realpath(__file__)), "templates")
STYLE_DIR = path.join(path.dirname(path.realpath(__file__)), "style")
RDF_FILE_EXTENSIONS = [".rdf", ".owl",... | true | true |
1c06da2976c0b9d100b23d941e754d06c51ce085 | 11,882 | py | Python | analysis/analyze_the_data/cpg_questions/control_methylation/control_vectors_qc.py | jamorrison/wgms_kit_comparison | f0da12f368f91b6ab8b94aaef60574cf5ca09bcf | [
"MIT"
] | null | null | null | analysis/analyze_the_data/cpg_questions/control_methylation/control_vectors_qc.py | jamorrison/wgms_kit_comparison | f0da12f368f91b6ab8b94aaef60574cf5ca09bcf | [
"MIT"
] | null | null | null | analysis/analyze_the_data/cpg_questions/control_methylation/control_vectors_qc.py | jamorrison/wgms_kit_comparison | f0da12f368f91b6ab8b94aaef60574cf5ca09bcf | [
"MIT"
] | null | null | null | """Create plots to show methylation for mitochondrial and control vector DNA."""
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import os
# Colors to use for each sample
COLOR = {
10: '#D81B60', # Ftube{A,B}kapaBC
9: '#D81B60', # Ftube{A,B}kapaBCrep2
8: '#1E8... | 34.34104 | 91 | 0.607726 | import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import os
COLOR = {
10: '#D81B60', # Ftube{A,B}kapaBC
9: '#D81B60', # Ftube{A,B}kapaBCrep2
8: '#1E88E5', # Ftube{A,B}neb
7: '#1E88E5', # Ftube{A,B}nebRep2
6: '#A0522D', # Ftube{A,B}pbat
5: '#004D40... | true | true |
1c06da2e639c69cec910abb3df9cf42fee6bf9d4 | 615 | py | Python | images/python_analysis/src/venv/lib/python3.7/site-packages/elasticsearch/helpers/errors.py | Jael24/TB_ElasticStack | f9aad11eda69045140a90f28739b558bf077d877 | [
"MIT"
] | 2 | 2021-05-01T05:40:55.000Z | 2021-06-25T13:34:46.000Z | images/python_analysis/src/venv/lib/python3.7/site-packages/elasticsearch/helpers/errors.py | Jael24/TB_ElasticStack | f9aad11eda69045140a90f28739b558bf077d877 | [
"MIT"
] | 2 | 2021-02-22T14:55:01.000Z | 2021-03-23T12:42:33.000Z | images/python_analysis/src/venv/lib/python3.7/site-packages/elasticsearch/helpers/errors.py | Jael24/TB_ElasticStack | f9aad11eda69045140a90f28739b558bf077d877 | [
"MIT"
] | 1 | 2021-03-23T12:24:52.000Z | 2021-03-23T12:24:52.000Z | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
from ..exceptions import ElasticsearchException
class BulkIndexError(ElasticsearchException):
@property
def... | 32.368421 | 75 | 0.723577 |
from ..exceptions import ElasticsearchException
class BulkIndexError(ElasticsearchException):
@property
def errors(self):
return self.args[1]
class ScanError(ElasticsearchException):
def __init__(self, scroll_id, *args, **kwargs):
super(ScanError, self).__init__(*args, **kwargs)
... | true | true |
1c06da67ee040cb39539a0ba91109de6cc82c06d | 3,920 | py | Python | stat_stuff.py | jesseerdmann/audiobonsai | ec1edcdbadc6b2aff3b743b5c42515f4d5638830 | [
"Apache-2.0"
] | null | null | null | stat_stuff.py | jesseerdmann/audiobonsai | ec1edcdbadc6b2aff3b743b5c42515f4d5638830 | [
"Apache-2.0"
] | null | null | null | stat_stuff.py | jesseerdmann/audiobonsai | ec1edcdbadc6b2aff3b743b5c42515f4d5638830 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from ab_util import create_connection
from datetime import datetime, timedelta
from math import floor
if __name__ == '__main__':
db_conn = create_connection()
today_date = datetime.now() # - timedelta(days=6)
today_name = today_date.strftime("%Y%m%d")
weekago_date = datetime.now()... | 54.444444 | 123 | 0.713265 | import pandas as pd
from ab_util import create_connection
from datetime import datetime, timedelta
from math import floor
if __name__ == '__main__':
db_conn = create_connection()
today_date = datetime.now() today_name = today_date.strftime("%Y%m%d")
weekago_date = datetime.now() - timedelta(days=7)
... | true | true |
1c06dadd2887c3586c79af99f49bf2dac068eb2b | 1,165 | py | Python | Analysis Scripts/cdf.py | droubo/meta-level-analysis-of-anomaly-detectors | a64671365b6c98ad14fc82f3430d3082b0455a6c | [
"MIT"
] | null | null | null | Analysis Scripts/cdf.py | droubo/meta-level-analysis-of-anomaly-detectors | a64671365b6c98ad14fc82f3430d3082b0455a6c | [
"MIT"
] | null | null | null | Analysis Scripts/cdf.py | droubo/meta-level-analysis-of-anomaly-detectors | a64671365b6c98ad14fc82f3430d3082b0455a6c | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv("AUC_SCORES.csv", delimiter=";")
datasets = data['DATASETS'].tolist()
print(datasets)
n = len(data)
scores = []
for i in range(n):
scores.append(data.loc[i:i].to_numpy()[0][1:])
for i in range(len(datasets)):
print(datase... | 21.981132 | 88 | 0.630043 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv("AUC_SCORES.csv", delimiter=";")
datasets = data['DATASETS'].tolist()
print(datasets)
n = len(data)
scores = []
for i in range(n):
scores.append(data.loc[i:i].to_numpy()[0][1:])
for i in range(len(datasets)):
print(datase... | true | true |
1c06dc5b21fcee8f8c4f144a9abb7e383b5d13ea | 3,709 | py | Python | jacket/api/compute/openstack/compute/schemas/aggregates.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/api/compute/openstack/compute/schemas/aggregates.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/api/compute/openstack/compute/schemas/aggregates.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 28.098485 | 79 | 0.574818 |
import copy
from jacket.api.compute.validation import parameter_types
availability_zone = {'oneOf': [parameter_types.name, {'type': 'null'}]}
availability_zone_with_leading_trailing_spaces = {
'oneOf': [parameter_types.name_with_leading_trailing_spaces,
{'type': 'null'}]
}
create = {
'type': ... | true | true |
1c06dc7c63684e3f62d0f3ef8ef6200bbb336bb4 | 1,350 | py | Python | docs/conf.py | SanDisk-Open-Source/desmod | 0f4156872c7f669aaa490072e996e0c4ce8afba6 | [
"MIT"
] | 36 | 2016-07-20T15:57:45.000Z | 2020-12-09T03:41:17.000Z | docs/conf.py | SanDisk-Open-Source/desmod | 0f4156872c7f669aaa490072e996e0c4ce8afba6 | [
"MIT"
] | 9 | 2016-10-05T16:27:32.000Z | 2020-11-11T23:08:54.000Z | docs/conf.py | SanDisk-Open-Source/desmod | 0f4156872c7f669aaa490072e996e0c4ce8afba6 | [
"MIT"
] | 14 | 2016-07-20T15:14:50.000Z | 2020-10-30T18:05:19.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools_scm import get_version
# flake8: noqa
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.graphviz',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
]
autodoc_memb... | 24.107143 | 81 | 0.664444 |
from setuptools_scm import get_version
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.graphviz',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
]
autodoc_member_order = 'bysource'
templates_path = ['_templates']
source_s... | true | true |
1c06dfc5d8aa9d65b9f88f254d7dc16efa284d66 | 7,453 | py | Python | birdcam.py | fehlfarbe/birdhouse | 611471f92650b3eb901a2f5ecc4765a06d74e998 | [
"MIT"
] | null | null | null | birdcam.py | fehlfarbe/birdhouse | 611471f92650b3eb901a2f5ecc4765a06d74e998 | [
"MIT"
] | null | null | null | birdcam.py | fehlfarbe/birdhouse | 611471f92650b3eb901a2f5ecc4765a06d74e998 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import re
import time
from dataclasses import dataclass
from datetime import datetime, timezone
from threading import Lock, Thread, Event
from typing import Tuple, Optional
import logging
from bmp280 import BMP280
import numpy as np
import cv2
try:
from smbus2 import SMBus
except I... | 37.079602 | 194 | 0.583658 | import os
import re
import time
from dataclasses import dataclass
from datetime import datetime, timezone
from threading import Lock, Thread, Event
from typing import Tuple, Optional
import logging
from bmp280 import BMP280
import numpy as np
import cv2
try:
from smbus2 import SMBus
except ImportError:
from sm... | true | true |
1c06e03be5d1ce103595e7d2ba8242362c379208 | 4,636 | py | Python | venv/lib/python3.7/site-packages/telegram/inline/inlinequeryresultmpeg4gif.py | dan-santos/BixosBot | 71cec3f77d6a9894fd45f6e9077f96317c97c2f1 | [
"MIT"
] | 1 | 2020-10-19T12:23:51.000Z | 2020-10-19T12:23:51.000Z | venv/lib/python3.7/site-packages/telegram/inline/inlinequeryresultmpeg4gif.py | dasiusp/BixosBot | 4037c7d8a9a1670196a17985b16525845b1d05f0 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/telegram/inline/inlinequeryresultmpeg4gif.py | dasiusp/BixosBot | 4037c7d8a9a1670196a17985b16525845b1d05f0 | [
"MIT"
] | 2 | 2020-03-11T23:59:22.000Z | 2020-03-12T00:08:17.000Z | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2020
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | 47.306122 | 99 | 0.666091 |
from telegram import InlineQueryResult
from telegram.utils.helpers import DEFAULT_NONE
class InlineQueryResultMpeg4Gif(InlineQueryResult):
def __init__(self,
id,
mpeg4_url,
thumb_url,
mpeg4_width=None,
mpeg4_height=None,
... | true | true |
1c06e0a4e9f595fd4e5379175f8d1395a0d1d6de | 870 | py | Python | lib/oeqa/runtime/cases/dotnet.py | karthago1/meta-mono | 3f19158ea085857ce9848da7b036f305679701e2 | [
"MIT"
] | null | null | null | lib/oeqa/runtime/cases/dotnet.py | karthago1/meta-mono | 3f19158ea085857ce9848da7b036f305679701e2 | [
"MIT"
] | null | null | null | lib/oeqa/runtime/cases/dotnet.py | karthago1/meta-mono | 3f19158ea085857ce9848da7b036f305679701e2 | [
"MIT"
] | null | null | null | import os
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.oetest import oeRuntimeTest, skipModule
class DotnetCompileTest(OERuntimeTestCase):
@OETestDepends(['ssh.SSHTest.test_ssh'])
def test... | 39.545455 | 84 | 0.725287 | import os
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.oetest import oeRuntimeTest, skipModule
class DotnetCompileTest(OERuntimeTestCase):
@OETestDepends(['ssh.SSHTest.test_ssh'])
def test... | true | true |
1c06e0ce0e90fc4cca2053c7963f79609cf87e45 | 876 | py | Python | tests/dobbi_test.py | iaramer/dobbi | 8057d38cc7e9af7b10a0a8dc648a9953151ed774 | [
"Apache-2.0"
] | 23 | 2021-11-07T11:03:14.000Z | 2022-03-18T15:29:26.000Z | tests/dobbi_test.py | iaramer/dobbi | 8057d38cc7e9af7b10a0a8dc648a9953151ed774 | [
"Apache-2.0"
] | null | null | null | tests/dobbi_test.py | iaramer/dobbi | 8057d38cc7e9af7b10a0a8dc648a9953151ed774 | [
"Apache-2.0"
] | null | null | null | import dobbi
def test_batch_execute_emoticons():
string = ':) :D :)'
dobbi_result = dobbi.collect() \
.emoticon() \
.batch_execute([string, string])
actual = {'emoticon': {'TOKEN_EMOTICON_HAPPY_FACE_OR_SMILEY': 4,
'TOKEN_EMOTICON_LAUGHING_OR_BIG_GRIN_OR_LAUGH_WIT... | 29.2 | 120 | 0.6621 | import dobbi
def test_batch_execute_emoticons():
string = ':) :D :)'
dobbi_result = dobbi.collect() \
.emoticon() \
.batch_execute([string, string])
actual = {'emoticon': {'TOKEN_EMOTICON_HAPPY_FACE_OR_SMILEY': 4,
'TOKEN_EMOTICON_LAUGHING_OR_BIG_GRIN_OR_LAUGH_WIT... | true | true |
1c06e0d05ea2191d12aca45cfdf0ae0e7d17d257 | 3,090 | py | Python | mayan/apps/acls/classes.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/acls/classes.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 7 | 2020-06-06T00:01:04.000Z | 2022-01-13T01:47:17.000Z | mayan/apps/acls/classes.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals, absolute_import
import itertools
import logging
from django.apps import apps
from django.utils.encoding import force_text
logger = logging.getLogger(__name__)
class ModelPermission(object):
_functions = {}
_inheritances = {}
_registry = {}
@classmethod
... | 28.878505 | 141 | 0.633333 | from __future__ import unicode_literals, absolute_import
import itertools
import logging
from django.apps import apps
from django.utils.encoding import force_text
logger = logging.getLogger(__name__)
class ModelPermission(object):
_functions = {}
_inheritances = {}
_registry = {}
@classmethod
... | true | true |
1c06e0fe21a690f83e405bc21456479fb8d4a3d5 | 3,414 | py | Python | tests/core/p2p-proto/test_peer_node_data_validator_api.py | stringray55/trinity | d14ad79bfb679d7a8430f5a73605c2c57e542fb0 | [
"MIT"
] | 2 | 2020-01-30T21:51:00.000Z | 2020-07-22T14:51:05.000Z | tests/core/p2p-proto/test_peer_node_data_validator_api.py | stringray55/trinity | d14ad79bfb679d7a8430f5a73605c2c57e542fb0 | [
"MIT"
] | null | null | null | tests/core/p2p-proto/test_peer_node_data_validator_api.py | stringray55/trinity | d14ad79bfb679d7a8430f5a73605c2c57e542fb0 | [
"MIT"
] | 1 | 2021-01-17T19:22:13.000Z | 2021-01-17T19:22:13.000Z | import asyncio
import os
import random
import pytest
from eth_utils import (
keccak,
)
from tests.core.peer_helpers import (
get_directly_linked_peers,
)
@pytest.fixture
async def eth_peer_and_remote(request, event_loop):
peer, remote = await get_directly_linked_peers(
request,
event_lo... | 26.061069 | 100 | 0.697715 | import asyncio
import os
import random
import pytest
from eth_utils import (
keccak,
)
from tests.core.peer_helpers import (
get_directly_linked_peers,
)
@pytest.fixture
async def eth_peer_and_remote(request, event_loop):
peer, remote = await get_directly_linked_peers(
request,
event_lo... | true | true |
1c06e194542c60437cd058a2a01c450e26a1f562 | 2,841 | py | Python | raw/res/d.py | ssndhu01/password-keeper | 79bed4157538a6997b7fb578ea66151535c482dc | [
"MIT"
] | null | null | null | raw/res/d.py | ssndhu01/password-keeper | 79bed4157538a6997b7fb578ea66151535c482dc | [
"MIT"
] | null | null | null | raw/res/d.py | ssndhu01/password-keeper | 79bed4157538a6997b7fb578ea66151535c482dc | [
"MIT"
] | null | null | null |
# made with love by Aekansh Dixit (https://github.com/aekanshd/)
# Please credit me in all your future updates, that's all - you're free to use this code commercially, too.
# (c) Aekansh Dixit, 2018 provided under The MIT License (https://opensource.org/licenses/MIT)
# This file is used to access the data - read an... | 28.41 | 107 | 0.581485 |
import f
import ap
import al
data_path = "bin/d.txt"
def works():
return True
def countAccounts():
try:
with open(data_path, "r", encoding='utf-8') as datafile:
contents = datafile.read()
if contents == "":
f.Log("No accounts found on startup", "countAccoun... | true | true |
1c06e1acce2aa21d3aea4f49ba008b5096aa09b1 | 6,967 | py | Python | software/glasgow/applet/vga_output/__init__.py | bgamari/Glasgow | 3cfc95f1a8fc7b15d9f8165e6c11edc0848b7214 | [
"Apache-2.0",
"0BSD"
] | 6 | 2020-01-09T10:05:00.000Z | 2021-03-10T07:07:15.000Z | software/glasgow/applet/vga_output/__init__.py | miek/Glasgow | 3aafe4879545035b8b968357b4c09da7ffa15347 | [
"Apache-2.0",
"0BSD"
] | null | null | null | software/glasgow/applet/vga_output/__init__.py | miek/Glasgow | 3aafe4879545035b8b968357b4c09da7ffa15347 | [
"Apache-2.0",
"0BSD"
] | 1 | 2020-12-28T11:42:24.000Z | 2020-12-28T11:42:24.000Z | import logging
from migen import *
from .. import *
from ...gateware.pads import *
from ...gateware.pll import *
class VGAOutput(Module):
def __init__(self, pads):
self.hs = Signal()
self.vs = Signal()
self.r = Signal()
self.g = Signal()
self.b = Signal()
###
... | 36.668421 | 99 | 0.530501 | import logging
from migen import *
from .. import *
from ...gateware.pads import *
from ...gateware.pll import *
class VGAOutput(Module):
def __init__(self, pads):
self.hs = Signal()
self.vs = Signal()
self.r = Signal()
self.g = Signal()
self.b = Signal()
... | true | true |
1c06e1e6dd4949d10383ca67410e41a45690aa78 | 361 | py | Python | src/examples/arg_types.py | winkidney/cmdtree | 8558be856f4c3044cf13d2d07a86b69877bb6491 | [
"MIT"
] | 63 | 2016-07-29T10:55:20.000Z | 2021-06-28T09:11:48.000Z | src/examples/arg_types.py | winkidney/cmdtree | 8558be856f4c3044cf13d2d07a86b69877bb6491 | [
"MIT"
] | 3 | 2016-09-22T08:42:18.000Z | 2016-12-10T12:02:01.000Z | src/examples/arg_types.py | winkidney/cmdtree | 8558be856f4c3044cf13d2d07a86b69877bb6491 | [
"MIT"
] | 3 | 2016-07-30T23:53:29.000Z | 2016-08-30T11:03:39.000Z | from cmdtree import command, argument, INT, entry, Choices
@command("run")
@argument("host", type=Choices(("host1", "host2", "host3")))
@argument("port", type=INT)
def run_docker(host, port):
print(
"docker daemon api runs on {ip}:{port}".format(
ip=host,
port=port,
)
)... | 21.235294 | 60 | 0.581717 | from cmdtree import command, argument, INT, entry, Choices
@command("run")
@argument("host", type=Choices(("host1", "host2", "host3")))
@argument("port", type=INT)
def run_docker(host, port):
print(
"docker daemon api runs on {ip}:{port}".format(
ip=host,
port=port,
)
)... | true | true |
1c06e1ee9d8611c83b570eb24756c3b20617b811 | 3,433 | py | Python | ngx_upstream_sentinel/__init__.py | rodrigopmatias/ngx_upstream_sentinel | 9926efbebb00259da2312528aa278108ab3b7fa5 | [
"MIT"
] | null | null | null | ngx_upstream_sentinel/__init__.py | rodrigopmatias/ngx_upstream_sentinel | 9926efbebb00259da2312528aa278108ab3b7fa5 | [
"MIT"
] | null | null | null | ngx_upstream_sentinel/__init__.py | rodrigopmatias/ngx_upstream_sentinel | 9926efbebb00259da2312528aa278108ab3b7fa5 | [
"MIT"
] | null | null | null | from multiprocessing import Pool
from requests import request
import os
import json
import time
from subprocess import call
DEFAULT_CONFIG = {
'sleep': 0.25,
'name': 'myName',
'nginx_file': None,
'counts': {
'to_down': 1,
'to_up': 3
},
'targets': []
}
def watch(target):
'... | 24.521429 | 81 | 0.55753 | from multiprocessing import Pool
from requests import request
import os
import json
import time
from subprocess import call
DEFAULT_CONFIG = {
'sleep': 0.25,
'name': 'myName',
'nginx_file': None,
'counts': {
'to_down': 1,
'to_up': 3
},
'targets': []
}
def watch(target):
r... | true | true |
1c06e295aceeb3cb9a0c173f8a7c3048f3dc9440 | 3,323 | py | Python | common/config.py | WaffleHacks/wafflebot | e18b7e8b7ceed97f942673a4e90f7196c2542ce0 | [
"MIT"
] | 2 | 2021-04-24T05:52:40.000Z | 2021-06-25T23:24:08.000Z | common/config.py | WaffleHacks/wafflebot | e18b7e8b7ceed97f942673a4e90f7196c2542ce0 | [
"MIT"
] | 6 | 2021-06-13T01:50:50.000Z | 2021-09-05T17:30:49.000Z | common/config.py | WaffleHacks/wafflebot | e18b7e8b7ceed97f942673a4e90f7196c2542ce0 | [
"MIT"
] | null | null | null | import aioredis
from enum import Enum
from typing import List, Optional
NOT_CONNECTED = RuntimeError(
"connect() must be called before interacting with configuration"
)
class Value(Enum):
Role = "role"
TextChannel = "text_channel"
class ConfigKey(Enum):
ManagementRole = "management_role"
PanelA... | 27.46281 | 87 | 0.573578 | import aioredis
from enum import Enum
from typing import List, Optional
NOT_CONNECTED = RuntimeError(
"connect() must be called before interacting with configuration"
)
class Value(Enum):
Role = "role"
TextChannel = "text_channel"
class ConfigKey(Enum):
ManagementRole = "management_role"
PanelA... | true | true |
1c06e39611d2f921583c325070dd1d6353f874b3 | 3,058 | py | Python | azext_iot/common/_azure.py | yang-hai-feng/azure-iot-cli-extension | d4057086b421fd7dfbbfd7230a33f8b832883d8c | [
"MIT"
] | 1 | 2021-06-09T22:38:32.000Z | 2021-06-09T22:38:32.000Z | azext_iot/common/_azure.py | yang-hai-feng/azure-iot-cli-extension | d4057086b421fd7dfbbfd7230a33f8b832883d8c | [
"MIT"
] | null | null | null | azext_iot/common/_azure.py | yang-hai-feng/azure-iot-cli-extension | d4057086b421fd7dfbbfd7230a33f8b832883d8c | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | 36.404762 | 94 | 0.631131 |
from knack.util import CLIError
from azext_iot.common.utility import validate_key_value_pairs
from azext_iot.common.auth import get_aad_token
IOT_SERVICE_CS_TEMPLATE = "HostName={};SharedAccessKeyName={};SharedAccessKey={}"
def _parse_connection_string(cs, validate=None, cstring_type="entity"):
decomposed = va... | true | true |
1c06e404faf5743ddb57d95eb33500a9d8981103 | 9,343 | py | Python | rouge/rouge_scorer.py | MarvinTheParanoid/EmailSum | 0f5bfa25d0a9029edd6c39a85fbc91f96bf471ac | [
"MIT"
] | 28 | 2021-08-02T01:23:43.000Z | 2022-02-22T06:17:41.000Z | rouge/rouge_scorer.py | MarvinTheParanoid/EmailSum | 0f5bfa25d0a9029edd6c39a85fbc91f96bf471ac | [
"MIT"
] | null | null | null | rouge/rouge_scorer.py | MarvinTheParanoid/EmailSum | 0f5bfa25d0a9029edd6c39a85fbc91f96bf471ac | [
"MIT"
] | 2 | 2021-08-02T04:27:51.000Z | 2021-12-01T22:49:12.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.564189 | 79 | 0.689286 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import re
import nltk
nltk.download('punkt', download_dir='./nltk_data')
nltk.data.path.append('./nltk_data')
from nltk import sent_tokenize
from nltk.stem import porter
import six
from si... | true | true |
1c06e4ac79113d93d74177f232111ccc57300f5d | 948 | py | Python | stack/stack/spiders/stack_crawler.py | Rohan-cod/SoQues | 4f5eb99bff4bb85ec1ed977f66ed338c57655ee2 | [
"MIT"
] | null | null | null | stack/stack/spiders/stack_crawler.py | Rohan-cod/SoQues | 4f5eb99bff4bb85ec1ed977f66ed338c57655ee2 | [
"MIT"
] | 11 | 2021-08-10T13:22:41.000Z | 2022-03-16T17:32:26.000Z | stack/stack/spiders/stack_crawler.py | Rohan-cod/SoQues | 4f5eb99bff4bb85ec1ed977f66ed338c57655ee2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from stack.items import StackItem
class StackCrawlerSpider(CrawlSpider):
name = 'stack_crawler'
allowed_domains = ['stackoverflow.com']
start_urls = [
... | 30.580645 | 71 | 0.621308 | import scrapy
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from stack.items import StackItem
class StackCrawlerSpider(CrawlSpider):
name = 'stack_crawler'
allowed_domains = ['stackoverflow.com']
start_urls = [
'https://stackoverflow.... | true | true |
1c06e540839ffca455679c286289cb1e82abe1df | 372 | py | Python | yt_dlp/WS_Extractor/rtbf.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | yt_dlp/WS_Extractor/rtbf.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | yt_dlp/WS_Extractor/rtbf.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | # encoding: utf-8
from ..extractor.rtbf import (
RTBFIE as OldRtbfIE
)
class RtbfIE(OldRtbfIE):
def _real_extract(self, url):
result = super(RtbfIE, self)._real_extract(url)
# 加入高低排序
if result.get('formats', None):
for i, format in enumerate(result['formats']):
... | 23.25 | 58 | 0.599462 |
from ..extractor.rtbf import (
RTBFIE as OldRtbfIE
)
class RtbfIE(OldRtbfIE):
def _real_extract(self, url):
result = super(RtbfIE, self)._real_extract(url)
if result.get('formats', None):
for i, format in enumerate(result['formats']):
format['preference'] =... | true | true |
1c06e559b4fdee83ec5f6569236caacb8437ed5c | 477 | py | Python | sources/Chapter5/beverage.py | sungminna/CodingTestBook | 0ebf60ec573cc3e2c0b0807bed27353da5527429 | [
"MIT"
] | null | null | null | sources/Chapter5/beverage.py | sungminna/CodingTestBook | 0ebf60ec573cc3e2c0b0807bed27353da5527429 | [
"MIT"
] | null | null | null | sources/Chapter5/beverage.py | sungminna/CodingTestBook | 0ebf60ec573cc3e2c0b0807bed27353da5527429 | [
"MIT"
] | null | null | null | n, m = map(int, input().split())
graph = []
for i in range(n):
graph.append(list(map(int, input().split())))
def dfs(x, y):
if x<=-1 or x>=n or y<=-1 or y>=m:
return False
if graph[x][y] == 0:
graph[x][y] = 1
dfs(x-1, y)
dfs(x+1, y)
dfs(x, y-1)
dfs(x, y+1)
... | 19.08 | 49 | 0.469602 | n, m = map(int, input().split())
graph = []
for i in range(n):
graph.append(list(map(int, input().split())))
def dfs(x, y):
if x<=-1 or x>=n or y<=-1 or y>=m:
return False
if graph[x][y] == 0:
graph[x][y] = 1
dfs(x-1, y)
dfs(x+1, y)
dfs(x, y-1)
dfs(x, y+1)
... | true | true |
1c06e5d1632847b1c52cd42c50beb7a91adba452 | 2,661 | py | Python | base_backend/validators.py | Simouche/django-base-backend | 220dc6ae7945f539a28c381e9635a3c190f31e51 | [
"MIT"
] | 4 | 2020-12-14T14:56:52.000Z | 2021-02-08T13:38:36.000Z | build/lib/base_backend/validators.py | Simouche/django-base-backend | 220dc6ae7945f539a28c381e9635a3c190f31e51 | [
"MIT"
] | null | null | null | build/lib/base_backend/validators.py | Simouche/django-base-backend | 220dc6ae7945f539a28c381e9635a3c190f31e51 | [
"MIT"
] | null | null | null | from django.core.validators import RegexValidator
from django.utils.translation import gettext_lazy as _
"""
Algerian phone numbers validator.
"""
phone_validator = RegexValidator('^\\+?[0-9]{,12}$', _('The phone number you entered is not valid '
'it must be of th... | 52.176471 | 119 | 0.471627 | from django.core.validators import RegexValidator
from django.utils.translation import gettext_lazy as _
phone_validator = RegexValidator('^\\+?[0-9]{,12}$', _('The phone number you entered is not valid '
'it must be of the international format.'
... | true | true |
1c06e7a0edbd2fed400d9ebcdf1008708ce43f0a | 1,195 | py | Python | farmer/ncc/augmentation/aug_utils.py | aiorhiroki/farmer.tf2 | 5d78f4b47b753ab2d595829c17fef7c6061235b5 | [
"Apache-2.0"
] | 10 | 2019-04-04T07:32:47.000Z | 2021-01-07T00:40:50.000Z | farmer/ncc/augmentation/aug_utils.py | aiorhiroki/farmer | cf3bb93173efbf4a34b782be9faf40c707152ab8 | [
"Apache-2.0"
] | 59 | 2019-04-18T05:44:31.000Z | 2021-05-02T10:33:02.000Z | farmer/ncc/augmentation/aug_utils.py | aiorhiroki/farmer.tf2 | 5d78f4b47b753ab2d595829c17fef7c6061235b5 | [
"Apache-2.0"
] | 4 | 2020-01-23T14:01:43.000Z | 2021-02-11T04:16:14.000Z | import albumentations
def get_aug(augmentation_dict):
transforms = list()
for aug_command, aug_param in augmentation_dict.items():
if aug_command.startswith("OneOf"):
augs = get_aug(aug_param)
augmentation = albumentations.OneOf(augs, aug_param['p'])
transforms.appe... | 35.147059 | 72 | 0.492887 | import albumentations
def get_aug(augmentation_dict):
transforms = list()
for aug_command, aug_param in augmentation_dict.items():
if aug_command.startswith("OneOf"):
augs = get_aug(aug_param)
augmentation = albumentations.OneOf(augs, aug_param['p'])
transforms.appe... | true | true |
1c06e7c2aaf76a3ccd75a085e2becdb06390973f | 19,048 | py | Python | deepchem/feat/graph_features.py | patrickphatnguyen/deepchem | f310f0a8d9eeb804f5e04974edff10ba62efab63 | [
"MIT"
] | null | null | null | deepchem/feat/graph_features.py | patrickphatnguyen/deepchem | f310f0a8d9eeb804f5e04974edff10ba62efab63 | [
"MIT"
] | null | null | null | deepchem/feat/graph_features.py | patrickphatnguyen/deepchem | f310f0a8d9eeb804f5e04974edff10ba62efab63 | [
"MIT"
] | null | null | null | import numpy as np
from rdkit import Chem
import deepchem as dc
from deepchem.feat import Featurizer
from deepchem.feat.atomic_coordinates import ComplexNeighborListFragmentAtomicCoordinates
from deepchem.feat.mol_graphs import ConvMol, WeaveMol
from deepchem.data import DiskDataset
import multiprocessing
import loggi... | 32.841379 | 89 | 0.640592 | import numpy as np
from rdkit import Chem
import deepchem as dc
from deepchem.feat import Featurizer
from deepchem.feat.atomic_coordinates import ComplexNeighborListFragmentAtomicCoordinates
from deepchem.feat.mol_graphs import ConvMol, WeaveMol
from deepchem.data import DiskDataset
import multiprocessing
import loggi... | true | true |
1c06e813fc6f4f5f5450f1ca887bd1cdd972247f | 1,576 | py | Python | examples/test/test_wrapped_encrypted_examples.py | texastony/aws-dynamodb-encryption-python | b40745d24ef06fbd7467434558e8be563318e88b | [
"Apache-2.0"
] | 57 | 2018-08-23T00:32:37.000Z | 2022-03-24T20:59:01.000Z | examples/test/test_wrapped_encrypted_examples.py | texastony/aws-dynamodb-encryption-python | b40745d24ef06fbd7467434558e8be563318e88b | [
"Apache-2.0"
] | 91 | 2018-08-06T17:32:28.000Z | 2022-03-31T10:23:02.000Z | examples/test/test_wrapped_encrypted_examples.py | josecorella/aws-dynamodb-encryption-python | 0e0d6639f835c02e0fd30cc0efc38d9c35d228e9 | [
"Apache-2.0"
] | 38 | 2018-10-17T12:02:37.000Z | 2022-02-13T02:53:14.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 46.352941 | 107 | 0.814086 | import pytest
from dynamodb_encryption_sdk_examples import wrapped_rsa_encrypted_table, wrapped_symmetric_encrypted_table
from dynamodb_encryption_sdk.delegated_keys.jce import JceNameLocalDelegatedKey
from .examples_test_utils import ddb_table_name
pytestmark = [pytest.mark.examples]
def test_wrapped_rsa_encrypt... | true | true |
1c06e8bdd7ec00b2dee266c97a065d03ba097202 | 32,042 | py | Python | ib_insync/client.py | ViraniAJ/ib_insync | ff08d47840c88b158831918379a5337c0d531cb5 | [
"BSD-2-Clause"
] | 1 | 2020-05-19T02:44:23.000Z | 2020-05-19T02:44:23.000Z | ib_insync/client.py | ajmal017/ib_insync | 83e6e9aff4716bd3bb1b30816fb3ad21e23ec8fd | [
"BSD-2-Clause"
] | null | null | null | ib_insync/client.py | ajmal017/ib_insync | 83e6e9aff4716bd3bb1b30816fb3ad21e23ec8fd | [
"BSD-2-Clause"
] | null | null | null | """Socket client for communicating with Interactive Brokers."""
import asyncio
import io
import logging
import struct
import time
from collections import deque
from typing import List
from eventkit import Event
from .connection import Connection
from .contract import Contract
from .decoder import Decoder
from .objec... | 33.135471 | 79 | 0.57718 |
import asyncio
import io
import logging
import struct
import time
from collections import deque
from typing import List
from eventkit import Event
from .connection import Connection
from .contract import Contract
from .decoder import Decoder
from .objects import ConnectionStats
from .util import UNSET_DOUBLE, UNSET_... | true | true |
1c06e8e11069be1310592220fac70ed2f3cd899b | 19,977 | py | Python | pipelines/DADA2/dada2nephele.py | philipmac/nephele2 | 50acba6b7bb00da6209c75e26c8c040ffacbaa1e | [
"CC0-1.0"
] | 1 | 2021-02-26T23:00:10.000Z | 2021-02-26T23:00:10.000Z | pipelines/DADA2/dada2nephele.py | philipmac/nephele2 | 50acba6b7bb00da6209c75e26c8c040ffacbaa1e | [
"CC0-1.0"
] | 1 | 2020-11-16T01:55:06.000Z | 2020-11-16T01:55:06.000Z | pipelines/DADA2/dada2nephele.py | philipmac/nephele2 | 50acba6b7bb00da6209c75e26c8c040ffacbaa1e | [
"CC0-1.0"
] | 2 | 2021-08-12T13:59:49.000Z | 2022-01-19T17:16:26.000Z | #!/usr/bin/env python3
import traceback
import argparse
import os
import gc
import re
import warnings
from collections import defaultdict
import rpy2.rinterface
from rpy2.robjects.vectors import IntVector
from rpy2.robjects.packages import importr
import rpy2.robjects as robjects
from biom.cli.table_summarizer import s... | 47.004706 | 184 | 0.627972 | import traceback
import argparse
import os
import gc
import re
import warnings
from collections import defaultdict
import rpy2.rinterface
from rpy2.robjects.vectors import IntVector
from rpy2.robjects.packages import importr
import rpy2.robjects as robjects
from biom.cli.table_summarizer import summarize_table
from bio... | true | true |
1c06e9e4674339c7ac330249f55282244ff9653b | 4,717 | py | Python | userbot/plugins/_inlinebot.py | Flokiviking/FridayUserbot | 66884e872d5b0c0eff01c0e5d8a9a705fa506da8 | [
"MIT"
] | 2 | 2020-08-30T12:39:39.000Z | 2020-09-02T05:05:25.000Z | userbot/plugins/_inlinebot.py | Flokiviking/FridayUserbot | 66884e872d5b0c0eff01c0e5d8a9a705fa506da8 | [
"MIT"
] | null | null | null | userbot/plugins/_inlinebot.py | Flokiviking/FridayUserbot | 66884e872d5b0c0eff01c0e5d8a9a705fa506da8 | [
"MIT"
] | null | null | null | from math import ceil
import asyncio
import json
import random
import re
from telethon import events, errors, custom
from userbot import CMD_LIST
import io
if Var.TG_BOT_USER_NAME_BF_HER is not None and tgbot is not None:
@tgbot.on(events.InlineQuery) # pylint:disable=E0602
async def inline_handler(event):
... | 40.663793 | 131 | 0.597414 | from math import ceil
import asyncio
import json
import random
import re
from telethon import events, errors, custom
from userbot import CMD_LIST
import io
if Var.TG_BOT_USER_NAME_BF_HER is not None and tgbot is not None:
@tgbot.on(events.InlineQuery) async def inline_handler(event):
builder = event.b... | true | true |
1c06ea2fe6fe8920bf238b1e5fbd8e6e62c97fe5 | 7,024 | py | Python | utils/vgg_mfcn.py | lihaod/Deep_inpainting_localization | f9841168f2e289347838e7de8e7206cba4516081 | [
"MIT"
] | 21 | 2020-04-10T06:14:33.000Z | 2022-02-03T11:02:42.000Z | utils/vgg_mfcn.py | lihaod/Deep_inpainting_localization | f9841168f2e289347838e7de8e7206cba4516081 | [
"MIT"
] | 6 | 2020-04-13T03:44:17.000Z | 2022-03-03T02:49:36.000Z | utils/vgg_mfcn.py | lihaod/Deep_inpainting_localization | f9841168f2e289347838e7de8e7206cba4516081 | [
"MIT"
] | 4 | 2020-10-28T15:11:03.000Z | 2021-07-30T13:29:14.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import collections
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.layers.python.layers imp... | 47.782313 | 171 | 0.670985 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import collections
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.layers.python.layers imp... | true | true |
1c06eb8201fbcb3345e71c18fad56be7f640e1d8 | 2,967 | py | Python | ariadne_jwt/decorators.py | aredcomet/ariadne-jwt | d1725d92a0aa9554e680b9da89b7f90413966ecb | [
"MIT"
] | 1 | 2022-02-02T11:36:32.000Z | 2022-02-02T11:36:32.000Z | ariadne_jwt/decorators.py | aredcomet/ariadne-jwt | d1725d92a0aa9554e680b9da89b7f90413966ecb | [
"MIT"
] | null | null | null | ariadne_jwt/decorators.py | aredcomet/ariadne-jwt | d1725d92a0aa9554e680b9da89b7f90413966ecb | [
"MIT"
] | null | null | null | from functools import wraps
import six
from django.contrib.auth import authenticate, get_user_model
try:
from django.utils.translation import ugettext as _
except ImportError:
from django.utils.translation import gettext as _
from graphql import GraphQLResolveInfo
from promise import Promise, is_thenable
fr... | 27.728972 | 78 | 0.645096 | from functools import wraps
import six
from django.contrib.auth import authenticate, get_user_model
try:
from django.utils.translation import ugettext as _
except ImportError:
from django.utils.translation import gettext as _
from graphql import GraphQLResolveInfo
from promise import Promise, is_thenable
fr... | true | true |
1c06ebd238d4c755e2f32aa5b4e9638433f169f7 | 5,969 | py | Python | contrib/devtools/check-rpc-mappings.py | wolfoxonly/dake | 81b684a132561b838a37489d025e82b6408ced18 | [
"MIT"
] | 1 | 2019-09-03T07:02:30.000Z | 2019-09-03T07:02:30.000Z | contrib/devtools/check-rpc-mappings.py | wolfoxonly/dake | 81b684a132561b838a37489d025e82b6408ced18 | [
"MIT"
] | 1 | 2018-06-12T05:18:32.000Z | 2018-06-12T05:18:32.000Z | contrib/devtools/check-rpc-mappings.py | wolfoxonly/dake | 81b684a132561b838a37489d025e82b6408ced18 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The DakeCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Check RPC argument consistency."""
from collections import defaultdict
import os
import re
import sys
# S... | 37.540881 | 157 | 0.581672 |
from collections import defaultdict
import os
import re
import sys
SOURCES = [
"src/rpc/server.cpp",
"src/rpc/blockchain.cpp",
"src/rpc/mining.cpp",
"src/rpc/misc.cpp",
"src/rpc/net.cpp",
"src/rpc/rawtransaction.cpp",
"src/wallet/rpcwallet.cpp",
]
SOURCE_CLIENT = 'src/rpc/client.cpp'
IGNOR... | true | true |
1c06ed303f9a86d65ff7a7ef9715a7f806f1ac2c | 1,720 | py | Python | edward2/tensorflow/layers/normalization_test.py | acyrl/edward2 | 466da9a9f655b1da1f7d89c6e6512a44d00de090 | [
"Apache-2.0"
] | null | null | null | edward2/tensorflow/layers/normalization_test.py | acyrl/edward2 | 466da9a9f655b1da1f7d89c6e6512a44d00de090 | [
"Apache-2.0"
] | null | null | null | edward2/tensorflow/layers/normalization_test.py | acyrl/edward2 | 466da9a9f655b1da1f7d89c6e6512a44d00de090 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Edward2 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... | 32.45283 | 74 | 0.723256 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import edward2 as ed
import numpy as np
import tensorflow.compat.v2 as tf
class NormalizationTest(tf.test.TestCase):
def testActNorm(self):
np.random.seed(83243)
batch_size = 25
length = 15
... | true | true |
1c06ed3a253288c09c23d733f3aef24150716437 | 497 | py | Python | tests/unit/db/conftest.py | firebolt-db/firebolt-python-sdk | 35154a5ce070e71138d8573ce4c97891e212a939 | [
"Apache-2.0"
] | 4 | 2022-01-29T19:21:52.000Z | 2022-03-25T20:48:14.000Z | tests/unit/db/conftest.py | firebolt-db/firebolt-python-sdk | 35154a5ce070e71138d8573ce4c97891e212a939 | [
"Apache-2.0"
] | 92 | 2021-11-19T18:15:15.000Z | 2022-03-30T11:52:06.000Z | tests/unit/db/conftest.py | firebolt-db/firebolt-python-sdk | 35154a5ce070e71138d8573ce4c97891e212a939 | [
"Apache-2.0"
] | 6 | 2021-11-22T22:04:20.000Z | 2022-02-18T15:30:23.000Z | from pytest import fixture
from firebolt.common.settings import Settings
from firebolt.db import Connection, Cursor, connect
@fixture
def connection(settings: Settings, db_name: str) -> Connection:
with connect(
engine_url=settings.server,
database=db_name,
username="u",
password=... | 22.590909 | 63 | 0.698189 | from pytest import fixture
from firebolt.common.settings import Settings
from firebolt.db import Connection, Cursor, connect
@fixture
def connection(settings: Settings, db_name: str) -> Connection:
with connect(
engine_url=settings.server,
database=db_name,
username="u",
password=... | true | true |
1c06ed725da7edd9ca69362c355f6b76388a014b | 6,685 | py | Python | hata/env.py | catzoo/hata | 49a55f4e02f4f8b5f3adcebc51952b612b4acb73 | [
"0BSD"
] | 173 | 2019-06-14T20:25:00.000Z | 2022-03-21T19:36:10.000Z | hata/env.py | catzoo/hata | 49a55f4e02f4f8b5f3adcebc51952b612b4acb73 | [
"0BSD"
] | 52 | 2020-01-03T17:05:14.000Z | 2022-03-31T11:39:50.000Z | hata/env.py | catzoo/hata | 49a55f4e02f4f8b5f3adcebc51952b612b4acb73 | [
"0BSD"
] | 47 | 2019-11-09T08:46:45.000Z | 2022-03-31T14:33:34.000Z | """
Before loading hata, it checks for related environmental variables, which are:
HATA_BACKEND_ONLY : `bool` = `False`
Whether `hata.discord` should not be imported as well.
HATA_ALLOW_DEAD_EVENTS : `bool` = `False`
Whether events of non cached entities should be handled. Affects the following events right ... | 32.139423 | 119 | 0.685714 | """
Before loading hata, it checks for related environmental variables, which are:
HATA_BACKEND_ONLY : `bool` = `False`
Whether `hata.discord` should not be imported as well.
HATA_ALLOW_DEAD_EVENTS : `bool` = `False`
Whether events of non cached entities should be handled. Affects the following events right ... | false | true |
1c06ed91925945cc8a64590165e1507df8df8117 | 998 | py | Python | push_chatdata_api/chatdata.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | 1 | 2020-09-01T10:37:51.000Z | 2020-09-01T10:37:51.000Z | push_chatdata_api/chatdata.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | null | null | null | push_chatdata_api/chatdata.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | null | null | null | #!flask/bin/python
import pandas as pd
from sqlalchemy import create_engine
from flask import Flask, jsonify
from flask import request,Response
import requests
import json
app = Flask(__name__)
@app.route('/push_chatdata', methods=['POST'])
def push_chatdata():
try:
info_list=request.form["chat"]
... | 33.266667 | 137 | 0.640281 | import pandas as pd
from sqlalchemy import create_engine
from flask import Flask, jsonify
from flask import request,Response
import requests
import json
app = Flask(__name__)
@app.route('/push_chatdata', methods=['POST'])
def push_chatdata():
try:
info_list=request.form["chat"]
info_list=j... | true | true |
1c06eeeaf9e75e1f5d1191b2dec4efef565f2b79 | 462 | py | Python | server/opendp_project/urls_cypress.py | mikephelan/opendp-ux | 80c65da0ed17adc01c69b05dbc9cbf3a5973a016 | [
"MIT"
] | 6 | 2021-05-25T18:50:58.000Z | 2022-03-23T19:52:15.000Z | server/opendp_project/urls_cypress.py | mikephelan/opendp-ux | 80c65da0ed17adc01c69b05dbc9cbf3a5973a016 | [
"MIT"
] | 298 | 2021-05-19T17:34:09.000Z | 2022-03-29T18:45:22.000Z | server/opendp_project/urls_cypress.py | opendp/dpcreator | 6ba3c58ecdcd81ca1f4533a14ce7604eccf6a646 | [
"MIT"
] | 2 | 2020-10-16T22:03:24.000Z | 2020-11-15T22:45:19.000Z | """
!DANGER!: These urlpatterns should only be used in test.
Please read server/opendp_project/settings/cypress_settings for an explanation
"""
from django.urls import path, include
from opendp_project.urls import urlpatterns
from opendp_apps.cypress_utils.check_setup import are_cypress_settings_in_place
if are_cypre... | 35.538462 | 87 | 0.78355 | from django.urls import path, include
from opendp_project.urls import urlpatterns
from opendp_apps.cypress_utils.check_setup import are_cypress_settings_in_place
if are_cypress_settings_in_place:
urlpatterns = [path('cypress-tests/', include('opendp_apps.cypress_utils.urls'))] \
+ urlpatterns
| true | true |
1c06ef20eafd55728377c9fabbf6483cf1d45b23 | 833 | py | Python | leaves/migrations/0025_auto_20170727_1542.py | Aayush-N/LeaveManagement | 7fd520b4978de1c8a389a012b5f3293c8488b7b5 | [
"MIT"
] | null | null | null | leaves/migrations/0025_auto_20170727_1542.py | Aayush-N/LeaveManagement | 7fd520b4978de1c8a389a012b5f3293c8488b7b5 | [
"MIT"
] | null | null | null | leaves/migrations/0025_auto_20170727_1542.py | Aayush-N/LeaveManagement | 7fd520b4978de1c8a389a012b5f3293c8488b7b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-27 10:12
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leaves', '0024_auto_20170721_1954'),
]
operations = [
migra... | 26.03125 | 71 | 0.593037 | from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leaves', '0024_auto_20170721_1954'),
]
operations = [
migrations.AddField(
model_name='leavetaken',
name='ap... | true | true |
1c06f02254c17753613c7370960f0f086ea5fa3b | 594 | py | Python | models/lti.py | debbieyuster/RunestoneServer | 8ccf8381d5b59c40830778e663dc41fa38984e98 | [
"MIT"
] | 1 | 2021-10-01T07:42:09.000Z | 2021-10-01T07:42:09.000Z | models/lti.py | debbieyuster/RunestoneServer | 8ccf8381d5b59c40830778e663dc41fa38984e98 | [
"MIT"
] | 1 | 2018-10-03T13:37:28.000Z | 2018-10-03T13:37:28.000Z | models/lti.py | debbieyuster/RunestoneServer | 8ccf8381d5b59c40830778e663dc41fa38984e98 | [
"MIT"
] | 1 | 2021-04-26T02:10:40.000Z | 2021-04-26T02:10:40.000Z | db.define_table(
"lti_keys",
Field("consumer"),
Field("secret"),
Field("application"),
migrate=table_migrate_prefix + "lti_keys.table",
)
# To generate keys, one choice is to invoke `import secrets; hex(secrets.randbits(256))[2:]`; this creates a `256-bit hexadecimal <https://www.oauth.com/oauth2-s... | 34.941176 | 272 | 0.700337 | db.define_table(
"lti_keys",
Field("consumer"),
Field("secret"),
Field("application"),
migrate=table_migrate_prefix + "lti_keys.table",
)
db.define_table(
"course_lti_map",
Field("lti_id", "integer"),
Field("course_id", "integer"),
migrate=table_migrate_prefix + "course_lti_map",
)... | true | true |
1c06f17bf2a4de14519c42df94452e7a24551ed3 | 4,651 | py | Python | sdk/python/pulumi_azure_native/resources/v20190701/get_resource_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/resources/v20190701/get_resource_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/resources/v20190701/get_resource_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 32.753521 | 156 | 0.633627 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetResourceGroupResult',
'AwaitableGetResourceGroupResult',
'get_resource_group',
]
@pulumi.output_type
class GetResourceG... | true | true |
1c06f1e85bd9e1855593c4df28ceacf1acfa5194 | 2,973 | py | Python | src/programy/storage/stores/nosql/mongo/dao/processor.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/storage/stores/nosql/mongo/dao/processor.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/storage/stores/nosql/mongo/dao/processor.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | """
Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... | 33.784091 | 120 | 0.679448 | from programy.storage.stores.utils import DAOUtils
class Processor(object):
def __init__(self, classname):
self.id = None
self.classname = classname
def to_document(self):
document = {"classname": self.classname}
if self.id is not None:
document['_id'] = self.id
... | true | true |
1c06f27ef5a87653c543ea62ff01e0e6be809014 | 1,027 | py | Python | Py exercises/My code/CSS exercises/02_3.py | arvindkarir/python-pandas-code | fb3b68f07f0438cd0ef6d7ad669ce78650d884a8 | [
"MIT"
] | null | null | null | Py exercises/My code/CSS exercises/02_3.py | arvindkarir/python-pandas-code | fb3b68f07f0438cd0ef6d7ad669ce78650d884a8 | [
"MIT"
] | null | null | null | Py exercises/My code/CSS exercises/02_3.py | arvindkarir/python-pandas-code | fb3b68f07f0438cd0ef6d7ad669ce78650d884a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 7 14:22:31 2017
@author: User
"""
from collections import defaultdict
class someGraph:
def __init__(self):
self.graph = defaultdict(list)
def addPath(self, u, v):
self.graph[u].append(v)
def showPath(self, u):
return... | 20.959184 | 46 | 0.497566 | from collections import defaultdict
class someGraph:
def __init__(self):
self.graph = defaultdict(list)
def addPath(self, u, v):
self.graph[u].append(v)
def showPath(self, u):
return (self.graph[u])
def chkPath(self, src, dest):
for key, value in self.gra... | true | true |
1c06f2cb143ed6023914558b513e0196087a8c3b | 541 | py | Python | examples/advanced/pingpong.py | chrismurf/simulus | b49ccd0659bb5f4114c6d354c74287796de7f15d | [
"MIT"
] | 2 | 2020-05-23T08:45:11.000Z | 2021-08-14T03:36:54.000Z | examples/advanced/pingpong.py | chrismurf/simulus | b49ccd0659bb5f4114c6d354c74287796de7f15d | [
"MIT"
] | 6 | 2020-03-24T17:25:00.000Z | 2021-12-13T20:05:22.000Z | examples/advanced/pingpong.py | chrismurf/simulus | b49ccd0659bb5f4114c6d354c74287796de7f15d | [
"MIT"
] | 2 | 2020-01-30T16:48:27.000Z | 2021-08-14T03:36:59.000Z | import simulus
def p(sim, mbox, mbname):
while True:
msg = mbox.recv(isall=False)
print("%g: '%s' rcvd msg '%s'" % (sim.now, sim.name, msg))
sim.sync().send(sim, mbname, 'pong' if msg=='ping' else 'ping')
sim1 = simulus.simulator('sim1')
mb1 = sim1.mailbox('mb1', 1)
sim1.process(p,... | 25.761905 | 71 | 0.615527 | import simulus
def p(sim, mbox, mbname):
while True:
msg = mbox.recv(isall=False)
print("%g: '%s' rcvd msg '%s'" % (sim.now, sim.name, msg))
sim.sync().send(sim, mbname, 'pong' if msg=='ping' else 'ping')
sim1 = simulus.simulator('sim1')
mb1 = sim1.mailbox('mb1', 1)
sim1.process(p,... | true | true |
1c06f30624536109293383687d88bdbcf7fe176d | 3,149 | py | Python | xlsxwriter/test/comparison/test_chart_pattern08.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_pattern08.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_pattern08.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | 25.601626 | 79 | 0.443315 |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
def setUp(self):
self.set_filename('chart_pattern08.xlsx')
def test_create_file(self):
workbook = Workbook(self.got_filename)
worksheet = work... | true | true |
1c06f35c134bb8f04af791608353a2df5c15719b | 1,239 | py | Python | hw_asr/base/base_model.py | alexdrydew/asr_project_template | f65a4662bb2e75aff5ca62361109192e3c324324 | [
"MIT"
] | 5 | 2021-12-14T00:11:58.000Z | 2022-01-25T07:07:24.000Z | hw_asr/base/base_model.py | alexdrydew/asr_project_template | f65a4662bb2e75aff5ca62361109192e3c324324 | [
"MIT"
] | 1 | 2021-10-10T21:38:51.000Z | 2021-10-11T21:36:48.000Z | hw_asr/base/base_model.py | alexdrydew/asr_project_template | f65a4662bb2e75aff5ca62361109192e3c324324 | [
"MIT"
] | 11 | 2021-10-05T14:02:26.000Z | 2021-11-25T22:02:56.000Z | from abc import abstractmethod
from typing import Union
import numpy as np
import torch.nn as nn
from torch import Tensor
class BaseModel(nn.Module):
"""
Base class for all models
"""
def __init__(self, n_feats, n_class, *args, **kwargs):
super().__init__()
@abstractmethod
def forwa... | 29.5 | 98 | 0.635997 | from abc import abstractmethod
from typing import Union
import numpy as np
import torch.nn as nn
from torch import Tensor
class BaseModel(nn.Module):
def __init__(self, n_feats, n_class, *args, **kwargs):
super().__init__()
@abstractmethod
def forward(self, *args, **kwargs) -> Union[Tensor, dic... | true | true |
1c06f3fe2456c04b980986f147d65fe3ef1af5c6 | 2,723 | py | Python | conans/client/cmd/test.py | ytimenkov/conan | 89eb275b9696b308aaaa1fbfaa0f8cdab284a764 | [
"MIT"
] | null | null | null | conans/client/cmd/test.py | ytimenkov/conan | 89eb275b9696b308aaaa1fbfaa0f8cdab284a764 | [
"MIT"
] | null | null | null | conans/client/cmd/test.py | ytimenkov/conan | 89eb275b9696b308aaaa1fbfaa0f8cdab284a764 | [
"MIT"
] | null | null | null | import hashlib
import os
import tempfile
from conans.util.files import rmdir
from conans.util.env_reader import get_env
class PackageTester(object):
def __init__(self, manager, user_io):
self._manager = manager
self._user_io = user_io
def install_build_and_test(self, conanfile_abs_path, ref... | 45.383333 | 107 | 0.600073 | import hashlib
import os
import tempfile
from conans.util.files import rmdir
from conans.util.env_reader import get_env
class PackageTester(object):
def __init__(self, manager, user_io):
self._manager = manager
self._user_io = user_io
def install_build_and_test(self, conanfile_abs_path, ref... | true | true |
1c06f413702569e9ce9111ab4236433672b705cd | 10,062 | py | Python | skyportal/handlers/api/color_mag.py | steveschulze/skyportal | 47e334d71e34e82ff41bd0e32326e4107741e8e6 | [
"BSD-3-Clause"
] | 1 | 2021-01-20T05:58:16.000Z | 2021-01-20T05:58:16.000Z | skyportal/handlers/api/color_mag.py | steveschulze/skyportal | 47e334d71e34e82ff41bd0e32326e4107741e8e6 | [
"BSD-3-Clause"
] | 151 | 2020-10-15T23:49:47.000Z | 2022-03-12T08:42:46.000Z | skyportal/handlers/api/color_mag.py | kmshin1397/skyportal | 8f6bec6de89ea774d8d88f0ef24e9d10f3fce151 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from baselayer.app.access import auth_or_token
from ..base import BaseHandler
from ...models import (
Obj,
Annotation,
)
def normalize_key(str):
# convert the string to lowercase and remove underscores
return str.lower().replace('_', '')
def get_color_mag(annotations, **kwargs):
... | 36.992647 | 85 | 0.553866 | import numpy as np
from baselayer.app.access import auth_or_token
from ..base import BaseHandler
from ...models import (
Obj,
Annotation,
)
def normalize_key(str):
return str.lower().replace('_', '')
def get_color_mag(annotations, **kwargs):
inputs = {k: v for k, v in kwargs.items() if... | true | true |
1c06f469aee9ede43a5b37396bd15efea0c82917 | 4,097 | py | Python | vnpy/trader/constant.py | jubal/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | [
"MIT"
] | 1 | 2022-01-02T13:48:28.000Z | 2022-01-02T13:48:28.000Z | vnpy/trader/constant.py | jubal/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | [
"MIT"
] | null | null | null | vnpy/trader/constant.py | jubal/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | [
"MIT"
] | null | null | null | """
General constant enums used in the trading platform.
"""
from enum import Enum
class Direction(Enum):
"""
Direction of order/trade/position.
"""
LONG = "多"
SHORT = "空"
NET = "净"
class Offset(Enum):
"""
Offset of order/trade.
"""
NONE = ""
OPEN = "开"
CLOSE = "平"
... | 25.134969 | 71 | 0.520625 |
from enum import Enum
class Direction(Enum):
LONG = "多"
SHORT = "空"
NET = "净"
class Offset(Enum):
NONE = ""
OPEN = "开"
CLOSE = "平"
CLOSETODAY = "平今"
CLOSEYESTERDAY = "平昨"
class Status(Enum):
SUBMITTING = "提交中"
NOTTRADED = "未成交"
PARTTRADED = "部分成交"
ALLTRADED = "全部成交... | true | true |
1c06f4f3ec2b232e197e107db6ed0b32fa5c6435 | 172 | py | Python | app/main/views.py | mikechumba/vybe-repo | cc99ce0aa1e4369c16c80b9cc133f37b61ba31d6 | [
"MIT"
] | 1 | 2019-12-13T12:20:40.000Z | 2019-12-13T12:20:40.000Z | app/main/views.py | mikechumba/vybe-repo | cc99ce0aa1e4369c16c80b9cc133f37b61ba31d6 | [
"MIT"
] | 6 | 2021-02-08T20:34:04.000Z | 2022-03-11T23:56:28.000Z | app/main/views.py | mikechumba/vybe-repo | cc99ce0aa1e4369c16c80b9cc133f37b61ba31d6 | [
"MIT"
] | 1 | 2019-08-06T13:45:21.000Z | 2019-08-06T13:45:21.000Z | from flask import render_template, request, redirect, url_for,abort
from . import main
from .. import db
@main.route('/')
def index():
return '<h1> Hello World </h1>'
| 21.5 | 67 | 0.697674 | from flask import render_template, request, redirect, url_for,abort
from . import main
from .. import db
@main.route('/')
def index():
return '<h1> Hello World </h1>'
| true | true |
1c06f592f1b085cf94b958e1363dad510e28ad0c | 120,127 | py | Python | scipy/stats/morestats.py | Corallus-Caninus/scipy | c734dacd61c5962a86ab3cc4bf2891fc94b720a6 | [
"BSD-3-Clause"
] | 1 | 2020-10-26T03:07:00.000Z | 2020-10-26T03:07:00.000Z | scipy/stats/morestats.py | Corallus-Caninus/scipy | c734dacd61c5962a86ab3cc4bf2891fc94b720a6 | [
"BSD-3-Clause"
] | 5 | 2020-09-01T01:19:07.000Z | 2021-10-11T01:06:05.000Z | scipy/stats/morestats.py | Corallus-Caninus/scipy | c734dacd61c5962a86ab3cc4bf2891fc94b720a6 | [
"BSD-3-Clause"
] | 1 | 2018-04-21T11:45:55.000Z | 2018-04-21T11:45:55.000Z | import math
import warnings
from collections import namedtuple
import numpy as np
from numpy import (isscalar, r_, log, around, unique, asarray,
zeros, arange, sort, amin, amax, any, atleast_1d,
sqrt, ceil, floor, array, compress,
pi, exp, ravel, count_nonzero, ... | 34.578872 | 103 | 0.604943 | import math
import warnings
from collections import namedtuple
import numpy as np
from numpy import (isscalar, r_, log, around, unique, asarray,
zeros, arange, sort, amin, amax, any, atleast_1d,
sqrt, ceil, floor, array, compress,
pi, exp, ravel, count_nonzero, ... | true | true |
1c06f5d5942bba6b98b2e62b16fe2231136f9171 | 1,397 | py | Python | src/fonduer/parser/preprocessors/html_doc_preprocessor.py | kaikun213/fonduer | 79434aaed22c730ea043fe0909e88e0e39a4b8e5 | [
"MIT"
] | null | null | null | src/fonduer/parser/preprocessors/html_doc_preprocessor.py | kaikun213/fonduer | 79434aaed22c730ea043fe0909e88e0e39a4b8e5 | [
"MIT"
] | null | null | null | src/fonduer/parser/preprocessors/html_doc_preprocessor.py | kaikun213/fonduer | 79434aaed22c730ea043fe0909e88e0e39a4b8e5 | [
"MIT"
] | null | null | null | import codecs
import os
from typing import Iterator
from bs4 import BeautifulSoup
from fonduer.parser.models import Document
from fonduer.parser.preprocessors.doc_preprocessor import DocPreprocessor
class HTMLDocPreprocessor(DocPreprocessor):
"""A ``Document`` generator for HTML files."""
def _parse_file(s... | 35.820513 | 86 | 0.616321 | import codecs
import os
from typing import Iterator
from bs4 import BeautifulSoup
from fonduer.parser.models import Document
from fonduer.parser.preprocessors.doc_preprocessor import DocPreprocessor
class HTMLDocPreprocessor(DocPreprocessor):
def _parse_file(self, fp: str, file_name: str) -> Iterator[Document]... | true | true |
1c06f669aa216134bc575a7543a0003baa370aad | 235 | py | Python | boleto_bancario/boleto_bancario/doctype/configurar_plataforma_gerencianet/test_configurar_plataforma_gerencianet.py | guidupas/erpnext-boleto-bancario | f2c442d28f5d69bebf8e31494876820aab8aaee1 | [
"MIT"
] | null | null | null | boleto_bancario/boleto_bancario/doctype/configurar_plataforma_gerencianet/test_configurar_plataforma_gerencianet.py | guidupas/erpnext-boleto-bancario | f2c442d28f5d69bebf8e31494876820aab8aaee1 | [
"MIT"
] | null | null | null | boleto_bancario/boleto_bancario/doctype/configurar_plataforma_gerencianet/test_configurar_plataforma_gerencianet.py | guidupas/erpnext-boleto-bancario | f2c442d28f5d69bebf8e31494876820aab8aaee1 | [
"MIT"
] | 1 | 2022-01-30T11:10:51.000Z | 2022-01-30T11:10:51.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Inova Techy and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestConfigurarPlataformaGerencianet(unittest.TestCase):
pass
| 21.363636 | 61 | 0.782979 | from __future__ import unicode_literals
import unittest
class TestConfigurarPlataformaGerencianet(unittest.TestCase):
pass
| true | true |
1c06f68406b9bd5dd1f47d02c71cf7b28755e8b2 | 187 | py | Python | anyutils/extensions/monitor/setup.py | fjboy/any-utils | 30b3a91c22e6eb93a64a130db6c0a6ca0802343c | [
"MIT"
] | null | null | null | anyutils/extensions/monitor/setup.py | fjboy/any-utils | 30b3a91c22e6eb93a64a130db6c0a6ca0802343c | [
"MIT"
] | null | null | null | anyutils/extensions/monitor/setup.py | fjboy/any-utils | 30b3a91c22e6eb93a64a130db6c0a6ca0802343c | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(name='monitor',
version='0.1',
description='Simple monitor Utilities',
author='zbw',
packages=find_packages())
| 20.777778 | 45 | 0.673797 | from setuptools import setup, find_packages
setup(name='monitor',
version='0.1',
description='Simple monitor Utilities',
author='zbw',
packages=find_packages())
| true | true |
1c06f6ce432d62bb8953c30803f105bb2029b659 | 17,530 | py | Python | doc/conf.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 1 | 2021-07-15T18:11:51.000Z | 2021-07-15T18:11:51.000Z | doc/conf.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | null | null | null | doc/conf.py | johnskopis/salt | 86adb6b0fe40230b8be4c74229e897a7a08f81a6 | [
"Apache-2.0"
] | 1 | 2020-04-10T20:18:40.000Z | 2020-04-10T20:18:40.000Z | # -*- coding: utf-8 -*-
# pylint: disable=C0103,W0622
'''
Sphinx documentation for Salt
'''
import sys
import os
import re
import types
import time
from sphinx.directives import TocTree
class Mock(object):
'''
Mock out specified imports.
This allows autodoc to do its thing without having oodles of req'd... | 30.700525 | 147 | 0.64826 | import sys
import os
import re
import types
import time
from sphinx.directives import TocTree
class Mock(object):
def __init__(self, mapping=None, *args, **kwargs): self.__mapping = mapping or {}
__all__ = []
def __call__(self, *args, **kwargs):
return Mock(mapp... | true | true |
1c06f73c025b4cc29bb93a9165cc87da89f860de | 198 | py | Python | 399 Orderly Queue/orderly_queue.py | JawadAsifBD/leetcode | 15c3bd0363f2a0bf2956fec38c095a955ca6c000 | [
"MIT"
] | null | null | null | 399 Orderly Queue/orderly_queue.py | JawadAsifBD/leetcode | 15c3bd0363f2a0bf2956fec38c095a955ca6c000 | [
"MIT"
] | null | null | null | 399 Orderly Queue/orderly_queue.py | JawadAsifBD/leetcode | 15c3bd0363f2a0bf2956fec38c095a955ca6c000 | [
"MIT"
] | null | null | null | class Solution:
def orderlyQueue(self, s: str, k: int) -> str:
if k == 1:
return min(s[i:] + s[:i] for i in range(len(s)))
else:
return ''.join(sorted(s)) | 33 | 60 | 0.484848 | class Solution:
def orderlyQueue(self, s: str, k: int) -> str:
if k == 1:
return min(s[i:] + s[:i] for i in range(len(s)))
else:
return ''.join(sorted(s)) | true | true |
1c06f7b867943c4fe5576b0efbc40dc4c716684e | 27,944 | py | Python | test/test_config_base.py | raman325/apprise | 784e073eea64d2ee37cc52e7a2391bce35b05720 | [
"MIT"
] | null | null | null | test/test_config_base.py | raman325/apprise | 784e073eea64d2ee37cc52e7a2391bce35b05720 | [
"MIT"
] | null | null | null | test/test_config_base.py | raman325/apprise | 784e073eea64d2ee37cc52e7a2391bce35b05720 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in th... | 29.199582 | 79 | 0.679037 |
import six
import pytest
from apprise.AppriseAsset import AppriseAsset
from apprise.config.ConfigBase import ConfigBase
from apprise import ConfigFormat
from apprise import plugins
import yaml
import logging
logging.disable(logging.CRITICAL)
def test_config_base():
with pytest.raises(TypeError):
Co... | true | true |
1c06f894b3d707fff89512a05256bebd2389ece5 | 8,683 | py | Python | anime_downloader/config.py | Alsira/anime-downloader | d82b4cfd5c7c6c358d0d8ffd36ce2d5c4a285595 | [
"Unlicense"
] | 1,077 | 2020-10-17T15:43:17.000Z | 2022-03-31T15:24:29.000Z | anime_downloader/config.py | Alsira/anime-downloader | d82b4cfd5c7c6c358d0d8ffd36ce2d5c4a285595 | [
"Unlicense"
] | 509 | 2018-06-01T13:07:56.000Z | 2020-10-17T13:34:39.000Z | anime_downloader/config.py | Alsira/anime-downloader | d82b4cfd5c7c6c358d0d8ffd36ce2d5c4a285595 | [
"Unlicense"
] | 255 | 2018-05-27T03:52:11.000Z | 2020-10-12T17:27:38.000Z | import click
import os
import errno
import json
from anime_downloader import util
APP_NAME = 'anime downloader'
APP_DIR = click.get_app_dir(APP_NAME)
DEFAULT_CONFIG = {
'dl': {
'url': False,
'player': None,
'skip_download': False,
'download_dir': '.',
'quality': '1080p',
... | 28.283388 | 138 | 0.442474 | import click
import os
import errno
import json
from anime_downloader import util
APP_NAME = 'anime downloader'
APP_DIR = click.get_app_dir(APP_NAME)
DEFAULT_CONFIG = {
'dl': {
'url': False,
'player': None,
'skip_download': False,
'download_dir': '.',
'quality': '1080p',
... | true | true |
1c06f99ccd4b5ed747270f26755f4a12128ac9fd | 351 | py | Python | gmsh-4.2.2/demos/api/onelab_data.py | Poofee/fastFEM | 14eb626df973e2123604041451912c867ab7188c | [
"MIT"
] | 4 | 2019-05-06T09:35:08.000Z | 2021-05-14T16:26:45.000Z | onelab/share/doc/gmsh/demos/api/onelab_data.py | Christophe-Foyer/pyFEA | 344996d6b075ee4b2214283f0af8159d86d154fd | [
"MIT"
] | null | null | null | onelab/share/doc/gmsh/demos/api/onelab_data.py | Christophe-Foyer/pyFEA | 344996d6b075ee4b2214283f0af8159d86d154fd | [
"MIT"
] | 1 | 2020-12-15T13:47:23.000Z | 2020-12-15T13:47:23.000Z | import gmsh
import sys
if len(sys.argv) < 2:
print "Usage: " + sys.argv[0] + " file [options]"
exit(0)
gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 1)
gmsh.open(sys.argv[1])
# attempts to run a client selected when opening the file (e.g. a .pro file)
gmsh.onelab.run();
json = gmsh.onelab.get... | 17.55 | 76 | 0.678063 | import gmsh
import sys
if len(sys.argv) < 2:
print "Usage: " + sys.argv[0] + " file [options]"
exit(0)
gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 1)
gmsh.open(sys.argv[1])
gmsh.onelab.run();
json = gmsh.onelab.get()
print json
gmsh.finalize()
| false | true |
1c06fbc477ec03ed4c83246f70391f7760bfcc49 | 5,400 | py | Python | docs/source/conf.py | kalloc/mythril | eeee4d7c459189d278ac82a38c5fb778ddd58cdc | [
"MIT"
] | 1,887 | 2018-01-07T10:16:08.000Z | 2022-03-31T16:07:26.000Z | docs/source/conf.py | strawberrylady99/mythril | 727d5f3049333f71ccd90a95ca8fe13368aa9c15 | [
"MIT"
] | 746 | 2018-01-09T07:14:01.000Z | 2022-03-31T08:12:44.000Z | docs/source/conf.py | strawberrylady99/mythril | 727d5f3049333f71ccd90a95ca8fe13368aa9c15 | [
"MIT"
] | 431 | 2018-01-08T07:47:59.000Z | 2022-03-31T13:00:51.000Z | # -*- 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/master/config
# -- Path setup ------------------------------------------------------------... | 29.508197 | 86 | 0.646481 |
import os
import sys
sys.path.insert(0, os.path.abspath("../../"))
project = "Mythril"
copyright = "2019, ConsenSys Diligence"
author = "ConsenSys Dilligence"
version = ""
from mythril.__version__ import __version__ as VERSION
release = VERSION
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.cover... | true | true |
1c06fc8ce70b1505ee4105ce589b4e43bbdfe2d1 | 27,688 | py | Python | models/timeseries/fb_prophet_parallel.py | pragnesh-ai/driverlessai-recipes | 97371a2d2cd853cdeeb15037f462af96d81a7c0b | [
"Apache-2.0"
] | null | null | null | models/timeseries/fb_prophet_parallel.py | pragnesh-ai/driverlessai-recipes | 97371a2d2cd853cdeeb15037f462af96d81a7c0b | [
"Apache-2.0"
] | null | null | null | models/timeseries/fb_prophet_parallel.py | pragnesh-ai/driverlessai-recipes | 97371a2d2cd853cdeeb15037f462af96d81a7c0b | [
"Apache-2.0"
] | null | null | null | """Prophet by Facebook for TimeSeries with an example of parameter mutation."""
import importlib
import datatable as dt
import numpy as np
from h2oaicore.models import CustomTimeSeriesModel
from h2oaicore.systemutils import make_experiment_logger, loggerinfo, loggerwarning, loggerdebug
from h2oaicore.systemutils import... | 41.263785 | 131 | 0.603799 | import importlib
import datatable as dt
import numpy as np
from h2oaicore.models import CustomTimeSeriesModel
from h2oaicore.systemutils import make_experiment_logger, loggerinfo, loggerwarning, loggerdebug
from h2oaicore.systemutils import (
small_job_pool, save_obj, load_obj, user_dir, remove, config
)
from h2oai... | true | true |
1c06fe13878a62f921236793960f5a94997ac1c7 | 4,657 | py | Python | test/command_line/test_find_spots_server_client.py | JBlaschke/dials | 83fbc79864411b67933bd9708bc2d5f7d8f0859b | [
"BSD-3-Clause"
] | null | null | null | test/command_line/test_find_spots_server_client.py | JBlaschke/dials | 83fbc79864411b67933bd9708bc2d5f7d8f0859b | [
"BSD-3-Clause"
] | null | null | null | test/command_line/test_find_spots_server_client.py | JBlaschke/dials | 83fbc79864411b67933bd9708bc2d5f7d8f0859b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import multiprocessing
import socket
import sys
import time
import timeit
from xml.dom import minidom
import procrunner
import pytest
def start_server(server_command, working_directory):
procrunner.run(server_command, working_directory=working_dir... | 32.795775 | 104 | 0.646339 | from __future__ import absolute_import, division, print_function
import multiprocessing
import socket
import sys
import time
import timeit
from xml.dom import minidom
import procrunner
import pytest
def start_server(server_command, working_directory):
procrunner.run(server_command, working_directory=working_dir... | true | true |
1c06ff0e1c1034613fc9d820a7241bdd311b9e3f | 688 | py | Python | google/cloud/bigquery/reservation_v1/services/reservation_service/__init__.py | shollyman/python-bigquery-reservation | f65f8c2d3f1e7a259f2a474e7b6895a27a25c22a | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/reservation_v1/services/reservation_service/__init__.py | shollyman/python-bigquery-reservation | f65f8c2d3f1e7a259f2a474e7b6895a27a25c22a | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/reservation_v1/services/reservation_service/__init__.py | shollyman/python-bigquery-reservation | f65f8c2d3f1e7a259f2a474e7b6895a27a25c22a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 32.761905 | 74 | 0.75436 |
from .client import ReservationServiceClient
__all__ = ("ReservationServiceClient",)
| true | true |
1c0700419959c4cbe9337bd5b822c78ea3c260ad | 1,777 | py | Python | ietf/group/features.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/group/features.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/group/features.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | class GroupFeatures(object):
"""Configuration of group pages and processes to have this collected
in one place rather than scattered over the group page views."""
has_milestones = False
has_chartering_process = False
has_documents = False # i.e. drafts/RFCs
has_dependencies = False # Do depende... | 37.808511 | 83 | 0.638717 | class GroupFeatures(object):
has_milestones = False
has_chartering_process = False
has_documents = False has_dependencies = False has_materials = False
has_reviews = False
has_default_jabber = False
customize_workflow = False
about_page = "ietf.group.views.group_about"
default_t... | true | true |
1c070050746db6001229a77dfab8c164b0076d68 | 12,355 | py | Python | NVMeshSDK/Consts.py | excelero-sdk/NVMeshSDK | cf5ef211f98cb1894993c0c5442c5568bcc09c48 | [
"MIT"
] | null | null | null | NVMeshSDK/Consts.py | excelero-sdk/NVMeshSDK | cf5ef211f98cb1894993c0c5442c5568bcc09c48 | [
"MIT"
] | null | null | null | NVMeshSDK/Consts.py | excelero-sdk/NVMeshSDK | cf5ef211f98cb1894993c0c5442c5568bcc09c48 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from builtins import object
import logging
import os
from future.utils import with_metaclass
class IterableEnumMeta(type):
def __getattr__(cls, key):
return cls.__dict__[key]
def __setattr__(cls, key, value):
raise TypeError('Cannot rename const attribute {0}.{1}'.format... | 24.909274 | 105 | 0.691704 | from builtins import object
import logging
import os
from future.utils import with_metaclass
class IterableEnumMeta(type):
def __getattr__(cls, key):
return cls.__dict__[key]
def __setattr__(cls, key, value):
raise TypeError('Cannot rename const attribute {0}.{1}'.format(cls.__name__, key))
... | true | true |
1c07009d57fe9e17cfbf08c961475acd0bce5532 | 2,499 | py | Python | lib/delayable/tests.py | muffinresearch/solitude | 6cb37f591956111b54e5c4098602be21c8f4b438 | [
"BSD-3-Clause"
] | null | null | null | lib/delayable/tests.py | muffinresearch/solitude | 6cb37f591956111b54e5c4098602be21c8f4b438 | [
"BSD-3-Clause"
] | null | null | null | lib/delayable/tests.py | muffinresearch/solitude | 6cb37f591956111b54e5c4098602be21c8f4b438 | [
"BSD-3-Clause"
] | null | null | null | import json
import mock
from nose.tools import eq_
from models import Delayable
from solitude.base import APITest
from lib.delayable.tasks import delayable
class TestDelay(APITest):
def setUp(self):
self.delay = Delayable.objects.create()
self.result_url = '/delay/result/%s/' % self.delay.uuid
... | 29.75 | 77 | 0.60104 | import json
import mock
from nose.tools import eq_
from models import Delayable
from solitude.base import APITest
from lib.delayable.tasks import delayable
class TestDelay(APITest):
def setUp(self):
self.delay = Delayable.objects.create()
self.result_url = '/delay/result/%s/' % self.delay.uuid
... | true | true |
1c0700fa23f7d689b48fb57ace1c16da730a92f7 | 1,038 | py | Python | pyqtgraph/opengl/items/GLBarGraphItem.py | secantsquared/pyqtgraph | 3ef7f5b91639543e43bcd66a84290fb9bc18fc5c | [
"MIT"
] | null | null | null | pyqtgraph/opengl/items/GLBarGraphItem.py | secantsquared/pyqtgraph | 3ef7f5b91639543e43bcd66a84290fb9bc18fc5c | [
"MIT"
] | null | null | null | pyqtgraph/opengl/items/GLBarGraphItem.py | secantsquared/pyqtgraph | 3ef7f5b91639543e43bcd66a84290fb9bc18fc5c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .GLMeshItem import GLMeshItem
from ..MeshData import MeshData
import numpy as np
class GLBarGraphItem(GLMeshItem):
def __init__(self, pos, size):
"""
pos is (...,3) array of the bar positions (the corner of each bar)
size is (...,3) array of the sizes of each ba... | 37.071429 | 81 | 0.537572 | from .GLMeshItem import GLMeshItem
from ..MeshData import MeshData
import numpy as np
class GLBarGraphItem(GLMeshItem):
def __init__(self, pos, size):
nCubes = np.prod(pos.shape[:-1])
cubeVerts = np.mgrid[0:2,0:2,0:2].reshape(3,8).transpose().reshape(1,8,3)
cubeFaces = np.array([
... | true | true |
1c0700fe5d6f1f0f0e20fbea630941dc14183a03 | 10,252 | py | Python | envs/2048/engine_2048.py | Rhushabh1/Mini-AI-Games | a9478c1e8bb93ffecdc247b0cf3ba7e3416ff095 | [
"MIT"
] | null | null | null | envs/2048/engine_2048.py | Rhushabh1/Mini-AI-Games | a9478c1e8bb93ffecdc247b0cf3ba7e3416ff095 | [
"MIT"
] | null | null | null | envs/2048/engine_2048.py | Rhushabh1/Mini-AI-Games | a9478c1e8bb93ffecdc247b0cf3ba7e3416ff095 | [
"MIT"
] | null | null | null | import pygame
import random
import numpy as np
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 900
GRID_SIZE = 20
# fontcolor, bgcolor
white = '#ffffff'
BgColor = '#cccccc'
colors = {
1: ['#b3adad', '#b3adad'],
2: ['#776e64', '#eee4da'],
4: ['#776e64', '#ede0c8'],
8: ['#f9f6f2', '#f2b179'],
16: ['#f9f6f2', '#f59563'... | 27.55914 | 114 | 0.626219 | import pygame
import random
import numpy as np
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 900
GRID_SIZE = 20
white = '#ffffff'
BgColor = '#cccccc'
colors = {
1: ['#b3adad', '#b3adad'],
2: ['#776e64', '#eee4da'],
4: ['#776e64', '#ede0c8'],
8: ['#f9f6f2', '#f2b179'],
16: ['#f9f6f2', '#f59563'],
32: ['#f9f6f2', ... | true | true |
1c07015a43ccf3a7c2e2c35bb523fd82f39b03c3 | 3,386 | py | Python | crema/models/chord.py | migperfer/crema | 0aabbfa4dd67bdc86ff628203795060942c45aac | [
"BSD-2-Clause"
] | null | null | null | crema/models/chord.py | migperfer/crema | 0aabbfa4dd67bdc86ff628203795060942c45aac | [
"BSD-2-Clause"
] | null | null | null | crema/models/chord.py | migperfer/crema | 0aabbfa4dd67bdc86ff628203795060942c45aac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''CREMA Chord model'''
import numpy as np
from scipy.stats import gmean
from librosa import time_to_frames
import mir_eval
from .base import CremaModel
SEMITONE_TO_SCALE_DEGREE = ['1', 'b2', '2', 'b3', '3',
'4', 'b5', '5', 'b6', '6', 'b7', '7']
class ChordModel(C... | 31.351852 | 85 | 0.515062 |
import numpy as np
from scipy.stats import gmean
from librosa import time_to_frames
import mir_eval
from .base import CremaModel
SEMITONE_TO_SCALE_DEGREE = ['1', 'b2', '2', 'b3', '3',
'4', 'b5', '5', 'b6', '6', 'b7', '7']
class ChordModel(CremaModel):
def __init__(self):
s... | true | true |
1c0701dde896694bef859d50600dc7f509837a87 | 609 | py | Python | src/scenarios/mvcinnerloop/test.py | BruceForstall/performance | 47524b9060aa7cb13205fa281a6be6e2d404995c | [
"MIT"
] | 547 | 2018-11-06T21:14:57.000Z | 2022-03-31T21:14:57.000Z | src/scenarios/mvcinnerloop/test.py | BruceForstall/performance | 47524b9060aa7cb13205fa281a6be6e2d404995c | [
"MIT"
] | 1,572 | 2018-11-06T21:30:31.000Z | 2022-03-31T23:31:25.000Z | src/scenarios/mvcinnerloop/test.py | BruceForstall/performance | 47524b9060aa7cb13205fa281a6be6e2d404995c | [
"MIT"
] | 196 | 2018-11-06T20:58:21.000Z | 2022-03-29T21:04:21.000Z | '''
C# Console app
'''
from shared.runner import TestTraits, Runner
import os
EXENAME = 'mvcinnerloop'
if __name__ == "__main__":
traits = TestTraits(exename=EXENAME,
startupmetric='InnerLoop',
guiapp='false',
innerloopcommandargs='-c "from ... | 32.052632 | 152 | 0.512315 | from shared.runner import TestTraits, Runner
import os
EXENAME = 'mvcinnerloop'
if __name__ == "__main__":
traits = TestTraits(exename=EXENAME,
startupmetric='InnerLoop',
guiapp='false',
innerloopcommandargs='-c "from shutil import copyfile;... | true | true |
1c0702516e7e67bf763e5311bef8266f1aa9f75d | 928 | py | Python | isi_sdk_8_1_0/test/test_settings_access_time.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/test/test_settings_access_time.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/test/test_settings_access_time.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... | 22.634146 | 94 | 0.713362 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from isi_sdk_8_1_0.models.settings_access_time import SettingsAccessTime from isi_sdk_8_1_0.rest import ApiException
class TestSettingsAccessTime(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pa... | true | true |
1c0702e80d5124e0ff49e80d01e7118494d51f9b | 421 | py | Python | options.py | eebop/syslang | c93661746f106b44b7fc681e3b4c52241c5927dc | [
"MIT"
] | null | null | null | options.py | eebop/syslang | c93661746f106b44b7fc681e3b4c52241c5927dc | [
"MIT"
] | null | null | null | options.py | eebop/syslang | c93661746f106b44b7fc681e3b4c52241c5927dc | [
"MIT"
] | null | null | null | def run(argv):
operations = []
op = True
while op:
if argv == []:
break
op = _grab_option(argv[0])
if op == False:
break
operations.append(op)
del argv[0]
if not argv == []:
return operations, argv[0], argv[1:]
else:
re... | 19.136364 | 44 | 0.494062 | def run(argv):
operations = []
op = True
while op:
if argv == []:
break
op = _grab_option(argv[0])
if op == False:
break
operations.append(op)
del argv[0]
if not argv == []:
return operations, argv[0], argv[1:]
else:
re... | true | true |
1c0702eeaa59c33c9d7d80a716c0264053b80f8b | 4,774 | py | Python | inference_video_parallel.py | LegendaryDaim/arXiv2020-RIFE | 8b1c0679a1d088117ab854b537ec631450658b70 | [
"MIT"
] | 1 | 2021-08-01T22:07:47.000Z | 2021-08-01T22:07:47.000Z | inference_video_parallel.py | LegendaryDaim/arXiv2020-RIFE | 8b1c0679a1d088117ab854b537ec631450658b70 | [
"MIT"
] | null | null | null | inference_video_parallel.py | LegendaryDaim/arXiv2020-RIFE | 8b1c0679a1d088117ab854b537ec631450658b70 | [
"MIT"
] | 2 | 2021-10-01T05:18:12.000Z | 2022-03-28T14:03:36.000Z | import os
import cv2
import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.nn import functional as F
import warnings
import _thread
import skvideo.io
from queue import Queue, Empty
warnings.filterwarnings("ignore")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
if tor... | 34.846715 | 147 | 0.630917 | import os
import cv2
import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.nn import functional as F
import warnings
import _thread
import skvideo.io
from queue import Queue, Empty
warnings.filterwarnings("ignore")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
if tor... | true | true |
1c07034dc5505cc8cabb93466077b45aeb24dd22 | 1,682 | py | Python | cmlkit/representation/composed.py | sirmarcel/cmlk | e099bf3e255b60675e8e1b3ad29db750dbd6faf3 | [
"MIT"
] | 24 | 2018-06-22T17:31:20.000Z | 2022-03-29T14:52:49.000Z | cmlkit/representation/composed.py | sirmarcel/cmlk | e099bf3e255b60675e8e1b3ad29db750dbd6faf3 | [
"MIT"
] | 8 | 2019-06-06T14:51:57.000Z | 2021-06-30T19:43:13.000Z | cmlkit/representation/composed.py | sirmarcel/cmlk | e099bf3e255b60675e8e1b3ad29db750dbd6faf3 | [
"MIT"
] | 5 | 2018-07-30T18:53:08.000Z | 2022-02-10T09:12:15.000Z | import numpy as np
from cmlkit import classes
from cmlkit import from_config
from .representation import Representation
from .data import GlobalRepresentation, AtomicRepresentation
class Composed(Representation):
"""A representation composed of other representations; results are concatenated"""
kind = "com... | 32.346154 | 122 | 0.631391 | import numpy as np
from cmlkit import classes
from cmlkit import from_config
from .representation import Representation
from .data import GlobalRepresentation, AtomicRepresentation
class Composed(Representation):
kind = "composed"
def __init__(self, *reps, context={}):
super().__init__(context=con... | true | true |
1c07048130096c0753004c02a35076cf5de128e4 | 14,032 | py | Python | src/yolo3/model.py | JJavier98/TFG-Bebop-YOLO | d56e307862c853fbea8bc1b0a634a0e65d7ba95c | [
"MIT"
] | null | null | null | src/yolo3/model.py | JJavier98/TFG-Bebop-YOLO | d56e307862c853fbea8bc1b0a634a0e65d7ba95c | [
"MIT"
] | null | null | null | src/yolo3/model.py | JJavier98/TFG-Bebop-YOLO | d56e307862c853fbea8bc1b0a634a0e65d7ba95c | [
"MIT"
] | null | null | null | """YOLO_v3 Model Defined in Keras."""
from functools import wraps
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.normalization import Batc... | 37.72043 | 104 | 0.626924 |
from functools import wraps
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.normalization import BatchNormalization
from keras.models impor... | true | true |
1c0705251b69a6bb8239193835eaffe554574de4 | 1,192 | py | Python | tasks/migrations/0002_auto__add_field_task_is_finished.py | ajpocus/eyeball | f589ea6068e056b5fc86567b3038eaf3139e7ce1 | [
"BSD-3-Clause"
] | 1 | 2017-01-30T21:43:10.000Z | 2017-01-30T21:43:10.000Z | tasks/migrations/0002_auto__add_field_task_is_finished.py | ajpocus/eyeball | f589ea6068e056b5fc86567b3038eaf3139e7ce1 | [
"BSD-3-Clause"
] | null | null | null | tasks/migrations/0002_auto__add_field_task_is_finished.py | ajpocus/eyeball | f589ea6068e056b5fc86567b3038eaf3139e7ce1 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Task.is_finished'
db.add_column('tasks_task', 'is_finished', self.gf('django.db.models.fie... | 36.121212 | 150 | 0.606544 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('tasks_task', 'is_finished', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=Fals... | true | true |
1c0705616d780d517a01f5018ee97160439661e2 | 1,161 | py | Python | backend/home/migrations/0002_customtext_homepage.py | crowdbotics-apps/car-30414 | b06c655ba821408cde5630278ab13502686bcd7e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0002_customtext_homepage.py | crowdbotics-apps/car-30414 | b06c655ba821408cde5630278ab13502686bcd7e | [
"FTL",
"AML",
"RSA-MD"
] | 5 | 2021-09-26T15:15:20.000Z | 2022-01-09T17:46:54.000Z | backend/home/migrations/0002_customtext_homepage.py | crowdbotics-apps/car-30414 | b06c655ba821408cde5630278ab13502686bcd7e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.24 on 2021-09-09 08:23
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("home", "0001_load_initial_data"),
]
operations = [
migrations.CreateModel(
name="CustomText",
f... | 25.23913 | 60 | 0.38329 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("home", "0001_load_initial_data"),
]
operations = [
migrations.CreateModel(
name="CustomText",
fields=[
(
"id... | true | true |
1c0705f9dc7467253ffd8e4fbf5062bdcaca3ac9 | 1,984 | py | Python | auth-api/src/auth_api/models/membership.py | pksumesh/sbc-auth | 3c501c8b48f89623726728681002aa385418883a | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/models/membership.py | pksumesh/sbc-auth | 3c501c8b48f89623726728681002aa385418883a | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/models/membership.py | pksumesh/sbc-auth | 3c501c8b48f89623726728681002aa385418883a | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 39.68 | 114 | 0.737903 |
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy.orm import relationship
from .base_model import BaseModel
from .membership_type import MembershipType
class Membership(BaseModel):
__tablename__ = 'membership'
id = Column(Integer, primary_key=True)
user_id = Column(ForeignKey('user.i... | true | true |
1c07061705dc1ef8bb2c13fe5446fc7322b5aa83 | 6,423 | py | Python | build/X86_MESI_Two_Level/python/m5/internal/param_Directory_Controller.py | hoho20000000/gem5-fy | b59f6feed22896d6752331652c4d8a41a4ca4435 | [
"BSD-3-Clause"
] | null | null | null | build/X86_MESI_Two_Level/python/m5/internal/param_Directory_Controller.py | hoho20000000/gem5-fy | b59f6feed22896d6752331652c4d8a41a4ca4435 | [
"BSD-3-Clause"
] | 1 | 2020-08-20T05:53:30.000Z | 2020-08-20T05:53:30.000Z | build/X86_MESI_Two_Level/python/m5/internal/param_Directory_Controller.py | hoho20000000/gem5-fy | b59f6feed22896d6752331652c4d8a41a4ca4435 | [
"BSD-3-Clause"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | 42.536424 | 200 | 0.760392 |
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_param_Directory_Controller')).lstrip('.')
try:
return importlib.impo... | true | true |
1c07061f7e0d4aab6b4abee48e2c62c346c28296 | 481 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/pg-10.8-3-primel.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/pg-10.8-3-primel.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/pg-10.8-3-primel.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def is_primel_1(n):
if n < 2:
return False
prime = True
for x in range(2, n):
if n % x == 0:
print(n, "is divisible by", x)
prime = False
return prime
while True:
number = int(input("Please enter a number (enter 0 to exit): "))
prime = is_primel_1(number... | 22.904762 | 68 | 0.54262 | def is_primel_1(n):
if n < 2:
return False
prime = True
for x in range(2, n):
if n % x == 0:
print(n, "is divisible by", x)
prime = False
return prime
while True:
number = int(input("Please enter a number (enter 0 to exit): "))
prime = is_primel_1(number... | true | true |
1c070638357add13cd61890fb7a327bcd77dd882 | 4,174 | py | Python | g2base/remoteObjects/pubsubs/pubsub_redis.py | naojsoft/g2cam | 4f01cdccae7978d5c16af59a90ff7459ed6c2997 | [
"BSD-3-Clause"
] | null | null | null | g2base/remoteObjects/pubsubs/pubsub_redis.py | naojsoft/g2cam | 4f01cdccae7978d5c16af59a90ff7459ed6c2997 | [
"BSD-3-Clause"
] | null | null | null | g2base/remoteObjects/pubsubs/pubsub_redis.py | naojsoft/g2cam | 4f01cdccae7978d5c16af59a90ff7459ed6c2997 | [
"BSD-3-Clause"
] | null | null | null | #
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
In order to run this pubsub transport, you need to have the python
'redis-py' module installed. AND you need to be running a Redis server.
"""
import threading
import time
import redis
from g2base impo... | 27.460526 | 75 | 0.583134 | import threading
import time
import redis
from g2base import Callback
from g2base.remoteObjects import ro_packer
class BufferedRedis(redis.Redis):
def __init__(self, *args, **kwargs):
super(BufferedRedis, self).__init__(*args, **kwargs)
self.flush_interval = 0.001
self.flush_size = 10... | true | true |
1c0706d464126e1abdc5de81215ffe07cfd46c2e | 714 | py | Python | stop-hdb.py | pykello/hdb | 9de25d09febbcf4f54b7a62ddad9062d690d5a0a | [
"BSD-2-Clause"
] | null | null | null | stop-hdb.py | pykello/hdb | 9de25d09febbcf4f54b7a62ddad9062d690d5a0a | [
"BSD-2-Clause"
] | null | null | null | stop-hdb.py | pykello/hdb | 9de25d09febbcf4f54b7a62ddad9062d690d5a0a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from hdb import client
import argparse
import sys
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='HDB stop script')
parser.add_argument('port', action='store', type=int)
args = parser.parse_args()
port = args.port
response = client.request(('loc... | 28.56 | 74 | 0.565826 |
from hdb import client
import argparse
import sys
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='HDB stop script')
parser.add_argument('port', action='store', type=int)
args = parser.parse_args()
port = args.port
response = client.request(('localhost', port), {"code... | false | true |
1c0707380e7b693f009fc348eb728aa78ee3a80e | 1,913 | py | Python | megengine_release/layers/basic/norm.py | megvii-research/ICD | a97e0ecd9b69dbc0e3c2b8168c1d72ea79c6641b | [
"Apache-2.0"
] | 32 | 2021-11-09T11:19:21.000Z | 2022-03-21T17:37:32.000Z | megengine_release/layers/basic/norm.py | megvii-research/ICD | a97e0ecd9b69dbc0e3c2b8168c1d72ea79c6641b | [
"Apache-2.0"
] | 3 | 2022-02-28T08:51:13.000Z | 2022-03-30T09:16:41.000Z | megengine_release/layers/basic/norm.py | megvii-research/ICD | a97e0ecd9b69dbc0e3c2b8168c1d72ea79c6641b | [
"Apache-2.0"
] | 4 | 2021-11-11T11:59:05.000Z | 2022-03-30T03:26:41.000Z | # -*- coding: utf-8 -*-
# Codes contributed by Facebook: Copyright 2019 - present, Facebook, 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... | 36.788462 | 88 | 0.650288 | from functools import partial
import megengine.module as M
from megengine.module.normalization import GroupNorm, InstanceNorm, LayerNorm
def get_norm(norm):
if norm is None:
return None
norm = {
"BN": M.BatchNorm2d,
"SyncBN": M.SyncBatchNorm,
"FrozenBN": partial(M.BatchNorm2d,... | true | true |
1c0707709706eb4e472ee3d881e5759b244b1332 | 1,423 | py | Python | vcst/ui/library.py | crdavis12/vcst | a826fb33251e774247a9a99e308479dcfa51ccc5 | [
"MIT"
] | 4 | 2021-02-15T22:30:11.000Z | 2021-02-16T13:46:57.000Z | vcst/ui/library.py | crdavis12/vcst | a826fb33251e774247a9a99e308479dcfa51ccc5 | [
"MIT"
] | null | null | null | vcst/ui/library.py | crdavis12/vcst | a826fb33251e774247a9a99e308479dcfa51ccc5 | [
"MIT"
] | 1 | 2021-08-13T19:57:56.000Z | 2021-08-13T19:57:56.000Z | import logging
from vunit.ui.library import Library
from ..test.bench import CocoTestBench
from ..utils.mod_utils import import_mod
LOGGER = logging.getLogger(__name__)
class VCSTLibrary(Library):
def add_cocotb_testbench(self, design_unit, cocotb_module):
"""
"""
test_bench = CocoTe... | 30.276596 | 98 | 0.653549 | import logging
from vunit.ui.library import Library
from ..test.bench import CocoTestBench
from ..utils.mod_utils import import_mod
LOGGER = logging.getLogger(__name__)
class VCSTLibrary(Library):
def add_cocotb_testbench(self, design_unit, cocotb_module):
test_bench = CocoTestBench(design_unit, coc... | true | true |
1c0708123a55719bedadea968f5358cfa68bae25 | 1,027 | py | Python | kubernetes/test/test_v1beta1_pod_security_policy.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_pod_security_policy.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_pod_security_policy.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | 1 | 2018-07-19T16:37:20.000Z | 2018-07-19T16:37:20.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | 22.822222 | 105 | 0.727361 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1beta1_pod_security_policy import V1beta1PodSecurityPolicy
class TestV1beta1PodSecurityPolicy(unittest.TestCase):
def setUp(self... | true | true |
1c070829dee6d314c59a8946bb3e20f8a38407c6 | 325 | py | Python | lib/python/treadmill/cron/run/__init__.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 133 | 2016-09-15T13:36:12.000Z | 2021-01-18T06:29:13.000Z | lib/python/treadmill/cron/run/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 108 | 2016-12-28T23:41:27.000Z | 2020-03-05T21:20:37.000Z | lib/python/treadmill/cron/run/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 69 | 2016-09-23T20:38:58.000Z | 2020-11-11T02:31:21.000Z | """Cron execution modules.
The modules under this package do the actual cron execution.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from treadmill import cron
CRON_EXEC_MODULE = '{}.run'.format(cron.CRON_MOD... | 23.214286 | 60 | 0.818462 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from treadmill import cron
CRON_EXEC_MODULE = '{}.run'.format(cron.CRON_MODULE)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.