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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f6ca7f769297460c60ae8c98713da330f62f80 | 14,992 | py | Python | benchs/bench_all_ivf/parse_bench_all_ivf.py | Sugoshnr/faiss | 48ae55348a58624337e0b5125fb865142d2b9e19 | [
"MIT"
] | 1 | 2021-07-31T06:53:56.000Z | 2021-07-31T06:53:56.000Z | benchs/bench_all_ivf/parse_bench_all_ivf.py | Sugoshnr/faiss | 48ae55348a58624337e0b5125fb865142d2b9e19 | [
"MIT"
] | null | null | null | benchs/bench_all_ivf/parse_bench_all_ivf.py | Sugoshnr/faiss | 48ae55348a58624337e0b5125fb865142d2b9e19 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import numpy as np
from collections import defaultdict
from matplotlib import pyplot
import re
from argparse import Namespace
fro... | 29.924152 | 85 | 0.521545 |
import os
import numpy as np
from collections import defaultdict
from matplotlib import pyplot
import re
from argparse import Namespace
from faiss.contrib.factory_tools import get_code_size as unitsize
def dbsize_from_name(dbname):
sufs = {
'1B': 10**9,
'100M': 10**8,
'10M': 10**7,
... | true | true |
08f6cb5f894844568b7faef5d3d7fed911762eb0 | 507 | py | Python | script/formulas.py | manz/a816 | 2338ebf87039d6a4a4db8014c48c1d0d2488ceca | [
"MIT"
] | 2 | 2018-06-11T23:37:02.000Z | 2018-09-06T04:02:19.000Z | script/formulas.py | manz/a816 | 2338ebf87039d6a4a4db8014c48c1d0d2488ceca | [
"MIT"
] | 8 | 2015-10-30T11:20:45.000Z | 2021-11-21T12:59:33.000Z | script/formulas.py | manz/a816 | 2338ebf87039d6a4a4db8014c48c1d0d2488ceca | [
"MIT"
] | 1 | 2021-03-29T03:21:54.000Z | 2021-03-29T03:21:54.000Z | import struct
from typing import Callable
from a816.cpu.cpu_65c816 import rom_to_snes, RomType
def base_relative_16bits_pointer_formula(base: int) -> Callable[[bytes], int]:
return lambda v: int(v[0]) + int(v[1] << 8) + base
def long_low_rom_pointer(base: int) -> Callable[[int], bytes]:
def inner_func(point... | 31.6875 | 78 | 0.708087 | import struct
from typing import Callable
from a816.cpu.cpu_65c816 import rom_to_snes, RomType
def base_relative_16bits_pointer_formula(base: int) -> Callable[[bytes], int]:
return lambda v: int(v[0]) + int(v[1] << 8) + base
def long_low_rom_pointer(base: int) -> Callable[[int], bytes]:
def inner_func(point... | true | true |
08f6cbeacfa5bcdce286afeab8972f07252a2e82 | 910 | py | Python | unit_tests/tests_model.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 31 | 2015-01-30T20:09:48.000Z | 2021-08-13T12:57:49.000Z | unit_tests/tests_model.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 80 | 2015-01-30T19:08:40.000Z | 2019-11-02T20:15:56.000Z | unit_tests/tests_model.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 10 | 2015-09-18T01:52:23.000Z | 2019-07-14T08:22:06.000Z | import unittest2 as unittest
import numpy as np
from vsm.corpus.util.corpusbuilders import random_corpus
from vsm.model.base import BaseModel
class TestBaseModel(unittest.TestCase):
def setUp(self):
self.c = random_corpus(1000, 50, 6, 100)
self.m = BaseModel(self.c, 'context')
def test_Bas... | 27.575758 | 66 | 0.657143 | import unittest2 as unittest
import numpy as np
from vsm.corpus.util.corpusbuilders import random_corpus
from vsm.model.base import BaseModel
class TestBaseModel(unittest.TestCase):
def setUp(self):
self.c = random_corpus(1000, 50, 6, 100)
self.m = BaseModel(self.c, 'context')
def test_Bas... | true | true |
08f6cc2ea14fbfdc81b7f1151b3ff11ad551dfba | 6,229 | py | Python | venv/Lib/site-packages/xero_python/payrollau/__init__.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 77 | 2020-02-16T03:50:18.000Z | 2022-03-11T03:53:26.000Z | venv/Lib/site-packages/xero_python/payrollau/__init__.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 50 | 2020-04-06T10:15:52.000Z | 2022-03-29T21:27:50.000Z | venv/Lib/site-packages/xero_python/payrollau/__init__.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 27 | 2020-06-04T11:16:17.000Z | 2022-03-19T06:27:36.000Z | # coding: utf-8
# flake8: noqa
"""
Xero Payroll AU API
This is the Xero Payroll API for orgs in Australia region. # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
# import apis into sdk package
from xero_python.payrollau.api.payroll_au_api import PayrollAuApi
... | 51.908333 | 92 | 0.880398 |
from xero_python.payrollau.api.payroll_au_api import PayrollAuApi
from xero_python.payrollau.models.api_exception import APIException
from xero_python.payrollau.models.account import Account
from xero_python.payrollau.models.account_type import AccountType
from xero_python.payrollau.models.allowance_type import A... | true | true |
08f6cc7cb1972bf768343e169d58067ffedb476f | 4,131 | py | Python | utils/analytics.py | JamesXChang/label_tool | f62470a2bf677a2dd1d18054baf2d651d69c83a9 | [
"Apache-2.0"
] | null | null | null | utils/analytics.py | JamesXChang/label_tool | f62470a2bf677a2dd1d18054baf2d651d69c83a9 | [
"Apache-2.0"
] | 4 | 2021-06-02T02:33:35.000Z | 2022-03-12T00:42:39.000Z | utils/analytics.py | JamesXChang/label_tool | f62470a2bf677a2dd1d18054baf2d651d69c83a9 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import io
import requests
import calendar
import threading
from datetime import datetime
from mixpanel import Mixpanel, MixpanelException
from copy import deepcopy
from operator import itemgetter
from uuid import uuid4
from .misc import get_app_version, parse_config, convert_string_to_hash
fr... | 37.899083 | 106 | 0.619221 | import logging
import os
import io
import requests
import calendar
import threading
from datetime import datetime
from mixpanel import Mixpanel, MixpanelException
from copy import deepcopy
from operator import itemgetter
from uuid import uuid4
from .misc import get_app_version, parse_config, convert_string_to_hash
fr... | true | true |
08f6cd1d51923f0f772a126e2bb97b8fe0bd4972 | 4,091 | py | Python | web/settings.py | SlashGil/entorno-mental | 3ebabe3e0083aefaff42f84d02f22ae89774070b | [
"MIT"
] | null | null | null | web/settings.py | SlashGil/entorno-mental | 3ebabe3e0083aefaff42f84d02f22ae89774070b | [
"MIT"
] | null | null | null | web/settings.py | SlashGil/entorno-mental | 3ebabe3e0083aefaff42f84d02f22ae89774070b | [
"MIT"
] | null | null | null | """
Django settings for web project.
Generated by 'django-admin startproject' using Django 2.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
import... | 25.409938 | 91 | 0.700318 |
import os
import django_heroku
import dj_database_url
from decouple import config
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '3$!e5*ggej1g%8n!d77u^5jk$qy&_p_6r_gc2+mdu(2v1-&c%@'
DEBUG = True
ALLOWED_HOSTS = ['entorno-mental.herokuapp.com','localhost']
# Application defin... | true | true |
08f6cda805f11aff8accb6be6c4212956c983d19 | 18,009 | py | Python | pydatajson/helpers.py | datosgobar/pydatajson | f26e3d5928ce9d455485e03fa63a8d8741588b7a | [
"MIT"
] | 13 | 2017-05-17T13:33:43.000Z | 2021-08-10T18:42:59.000Z | pydatajson/helpers.py | datosgobar/pydatajson | f26e3d5928ce9d455485e03fa63a8d8741588b7a | [
"MIT"
] | 296 | 2016-11-29T14:01:09.000Z | 2020-10-27T22:42:26.000Z | pydatajson/helpers.py | datosgobar/pydatajson | f26e3d5928ce9d455485e03fa63a8d8741588b7a | [
"MIT"
] | 11 | 2017-07-06T17:02:31.000Z | 2021-07-19T14:46:51.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Métodos auxiliares"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import json
import logging
import os
import re
import tempfile
from contextlib import contextmanager
from datetime import datetime... | 31.987567 | 79 | 0.63024 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import json
import logging
import os
import re
import tempfile
from contextlib import contextmanager
from datetime import datetime
from openpyxl import load_workbook
from six import string_types, iter... | true | true |
08f6cdc286ccff6b76e69074c102d1e5ea519e2f | 772 | py | Python | src/kafka_wrapper/consumer.py | amritha-devadiga/aaib4-inference | 963d1847b1946fed6afbccb58f3f13c8588ae447 | [
"MIT"
] | null | null | null | src/kafka_wrapper/consumer.py | amritha-devadiga/aaib4-inference | 963d1847b1946fed6afbccb58f3f13c8588ae447 | [
"MIT"
] | null | null | null | src/kafka_wrapper/consumer.py | amritha-devadiga/aaib4-inference | 963d1847b1946fed6afbccb58f3f13c8588ae447 | [
"MIT"
] | null | null | null | from kafka import KafkaConsumer
from anuvaad_auditor.loghandler import log_info, log_exception
from utilities import MODULE_CONTEXT
import config
import json
def get_consumer(topics):
try:
consumer = KafkaConsumer(
bootstrap_servers=list(str(config.bootstrap_server).split(",")),
va... | 38.6 | 107 | 0.707254 | from kafka import KafkaConsumer
from anuvaad_auditor.loghandler import log_info, log_exception
from utilities import MODULE_CONTEXT
import config
import json
def get_consumer(topics):
try:
consumer = KafkaConsumer(
bootstrap_servers=list(str(config.bootstrap_server).split(",")),
va... | true | true |
08f6cf44df9107e63ebc9b80cbc47d23730b60c7 | 11,896 | py | Python | spyne/server/twisted/msgpack.py | florath/spyne-1 | 88d7b9b9020d5067b80927a30e229c3c5d64af85 | [
"BSD-3-Clause"
] | null | null | null | spyne/server/twisted/msgpack.py | florath/spyne-1 | 88d7b9b9020d5067b80927a30e229c3c5d64af85 | [
"BSD-3-Clause"
] | null | null | null | spyne/server/twisted/msgpack.py | florath/spyne-1 | 88d7b9b9020d5067b80927a30e229c3c5d64af85 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf8
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version... | 32.06469 | 80 | 0.635424 |
from __future__ import absolute_import
import logging
logger = logging.getLogger(__name__)
import msgpack
from time import time
from hashlib import md5
from collections import deque, OrderedDict
from itertools import chain
from twisted.internet import reactor
from twisted.internet.task import deferLater
from twist... | true | true |
08f6cf5f302204f7b68c62b9c4d4e29828c6c2ac | 1,852 | py | Python | test_glimpse_sensor.py | bentrevett/recurrent-attention-model | c07ec97b105c785f6e170a2ba1b3bc7c96e9a920 | [
"MIT"
] | 6 | 2020-07-10T14:33:01.000Z | 2021-06-10T14:42:45.000Z | test_glimpse_sensor.py | bentrevett/recurrent-attention-model | c07ec97b105c785f6e170a2ba1b3bc7c96e9a920 | [
"MIT"
] | 1 | 2020-10-29T13:11:50.000Z | 2020-10-29T13:11:50.000Z | test_glimpse_sensor.py | bentrevett/recurrent-attention-model | c07ec97b105c785f6e170a2ba1b3bc7c96e9a920 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import matplotlib.pyplot as plt
import os
import data_loader
from modules.glimpse_sensor import GlimpseSensor
def save_images(images, labels, name):
assert len(images) == len(labels) == 5
# get rid of channel dimension of 1, if exists
images = images.squeeze()
# Crea... | 25.369863 | 83 | 0.683045 | import torch
import numpy as np
import matplotlib.pyplot as plt
import os
import data_loader
from modules.glimpse_sensor import GlimpseSensor
def save_images(images, labels, name):
assert len(images) == len(labels) == 5
images = images.squeeze()
fig, axes = plt.subplots(1, 5)
plt.subplots_a... | true | true |
08f6cf636b9987f063e7fbda2117293e6019faa0 | 3,481 | py | Python | face_project_test.py | paarthbir77/face-detection | 5797f996783abda936bb4756657b4adc86f8d1cc | [
"MIT"
] | null | null | null | face_project_test.py | paarthbir77/face-detection | 5797f996783abda936bb4756657b4adc86f8d1cc | [
"MIT"
] | null | null | null | face_project_test.py | paarthbir77/face-detection | 5797f996783abda936bb4756657b4adc86f8d1cc | [
"MIT"
] | null | null | null | # Import packages
import os
import cv2
import numpy as np
import tensorflow as tf
import sys
# This is needed since the notebook is stored in the object_detection folder.
sys.path.append("..")
# Import utilites
from utils import label_map_util
from utils import visualization_utils as vis_util
# Name of the directory... | 33.796117 | 122 | 0.753519 | import os
import cv2
import numpy as np
import tensorflow as tf
import sys
sys.path.append("..")
from utils import label_map_util
from utils import visualization_utils as vis_util
MODEL_NAME = 'inference_graph'
# Grab path to current working directory
CWD_PATH = os.getcwd()
# Path to frozen detection graph .pb fil... | true | true |
08f6d02b8a48f358777755df4106cb7f01bd51ea | 11,199 | py | Python | pyqtgraph/widgets/ScatterPlotWidget.py | sneakers-the-rat/pyqtgraph | 65ef2a5a60a1a08d0106e819110528b2ca3499a3 | [
"MIT"
] | 150 | 2018-03-27T16:45:37.000Z | 2022-03-30T03:47:56.000Z | pyqtgraph/widgets/ScatterPlotWidget.py | sneakers-the-rat/pyqtgraph | 65ef2a5a60a1a08d0106e819110528b2ca3499a3 | [
"MIT"
] | 34 | 2018-09-28T00:01:59.000Z | 2022-03-21T15:40:02.000Z | pyqtgraph/widgets/ScatterPlotWidget.py | sneakers-the-rat/pyqtgraph | 65ef2a5a60a1a08d0106e819110528b2ca3499a3 | [
"MIT"
] | 40 | 2018-04-06T19:42:21.000Z | 2022-01-11T00:34:17.000Z | from ..Qt import QtGui, QtCore
from .PlotWidget import PlotWidget
from .DataFilterWidget import DataFilterParameter
from .ColorMapWidget import ColorMapParameter
from .. import parametertree as ptree
from .. import functions as fn
from .. import getConfigOption
from ..graphicsItems.TextItem import TextItem
import numpy... | 39.020906 | 122 | 0.588088 | from ..Qt import QtGui, QtCore
from .PlotWidget import PlotWidget
from .DataFilterWidget import DataFilterParameter
from .ColorMapWidget import ColorMapParameter
from .. import parametertree as ptree
from .. import functions as fn
from .. import getConfigOption
from ..graphicsItems.TextItem import TextItem
import numpy... | true | true |
08f6d21aeeefce06dbc57013d4aefaafe5d6d1c6 | 335 | py | Python | rpc/bridge_interface.py | dev-alberto/fitz_python | f53d3809938cdeb1905727ddb21be358e3bd5338 | [
"Apache-2.0"
] | null | null | null | rpc/bridge_interface.py | dev-alberto/fitz_python | f53d3809938cdeb1905727ddb21be358e3bd5338 | [
"Apache-2.0"
] | null | null | null | rpc/bridge_interface.py | dev-alberto/fitz_python | f53d3809938cdeb1905727ddb21be358e3bd5338 | [
"Apache-2.0"
] | 1 | 2022-03-18T17:40:18.000Z | 2022-03-18T17:40:18.000Z | from abc import ABCMeta, abstractmethod
class IBridge(metaclass=ABCMeta):
@abstractmethod
def instantiate(self, instance):
pass
@abstractmethod
def backfill(self, exchange, symbol, period, data):
pass
@abstractmethod
def live_update(self, exchange, symbol, period, data)... | 20.9375 | 59 | 0.665672 | from abc import ABCMeta, abstractmethod
class IBridge(metaclass=ABCMeta):
@abstractmethod
def instantiate(self, instance):
pass
@abstractmethod
def backfill(self, exchange, symbol, period, data):
pass
@abstractmethod
def live_update(self, exchange, symbol, period, data)... | true | true |
08f6d2a839834941017555cfcd5960613cba749a | 452 | py | Python | flexget/_version.py | sachk/Flexget | 106d59360661665ad135a8dd1c874ce84a538201 | [
"MIT"
] | null | null | null | flexget/_version.py | sachk/Flexget | 106d59360661665ad135a8dd1c874ce84a538201 | [
"MIT"
] | null | null | null | flexget/_version.py | sachk/Flexget | 106d59360661665ad135a8dd1c874ce84a538201 | [
"MIT"
] | null | null | null | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | 41.090909 | 114 | 0.785398 | __version__ = '3.1.88.dev'
| true | true |
08f6d41f5cbd0a5ce7c391aade0c5d229854405f | 8,720 | py | Python | test_ws/devel/lib/python2.7/dist-packages/test/srv/_skin_set_bone_orientation.py | ruslanjabari/factory_sim | f768bd170a9dea61a87d17ca9222ecf50b9369e7 | [
"MIT"
] | null | null | null | test_ws/devel/lib/python2.7/dist-packages/test/srv/_skin_set_bone_orientation.py | ruslanjabari/factory_sim | f768bd170a9dea61a87d17ca9222ecf50b9369e7 | [
"MIT"
] | null | null | null | test_ws/devel/lib/python2.7/dist-packages/test/srv/_skin_set_bone_orientation.py | ruslanjabari/factory_sim | f768bd170a9dea61a87d17ca9222ecf50b9369e7 | [
"MIT"
] | 1 | 2020-09-12T21:30:32.000Z | 2020-09-12T21:30:32.000Z | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from test/skin_set_bone_orientationRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
class skin_set_bone_orientationRequest(genpy.Message):... | 35.303644 | 146 | 0.67844 | import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
class skin_set_bone_orientationRequest(genpy.Message):
_md5sum = "a6867b70ac9d0b31fe274f3b1674e6a4"
_type = "test/skin_set_bone_orientationRequest"
_has_header = False _full_text = """int32 ... | true | true |
08f6d61c324e14495838754fb3156de52030b3c3 | 406 | py | Python | category_job_evaluation_tests/aexp/fibonacci_recursion.py | Anshul-GH/upwork_projects | 600c2ccf79e5ed5cf962f1ae05c59f18ad411f63 | [
"MIT"
] | 2 | 2020-07-23T19:32:58.000Z | 2020-10-24T20:54:09.000Z | category_job_evaluation_tests/aexp/fibonacci_recursion.py | Anshul-GH/upwork_projects | 600c2ccf79e5ed5cf962f1ae05c59f18ad411f63 | [
"MIT"
] | null | null | null | category_job_evaluation_tests/aexp/fibonacci_recursion.py | Anshul-GH/upwork_projects | 600c2ccf79e5ed5cf962f1ae05c59f18ad411f63 | [
"MIT"
] | 1 | 2021-07-11T14:41:04.000Z | 2021-07-11T14:41:04.000Z | # Fibonacci code with recursion
# function to print nth Fibonacci number
def Fibonacci(n):
if n == 1 or n == 2:
return (n-1)
else:
return Fibonacci(n-1) + Fibonacci(n-2)
# main
if __name__ == "__main__":
n = int(input("Enter the range: "))
if n <= 0:
print("Please enter a posit... | 23.882353 | 48 | 0.573892 |
def Fibonacci(n):
if n == 1 or n == 2:
return (n-1)
else:
return Fibonacci(n-1) + Fibonacci(n-2)
if __name__ == "__main__":
n = int(input("Enter the range: "))
if n <= 0:
print("Please enter a positive integer")
else:
for i in range(1,n+1):
print(Fibonac... | true | true |
08f6d65b1f49c5c095409e18170b472aa01cced3 | 7,882 | py | Python | torchvision/io/image.py | Gaurav7888/vision | a227a2026ef57fce08c1a73bad61bbabc3a52bfd | [
"BSD-3-Clause"
] | null | null | null | torchvision/io/image.py | Gaurav7888/vision | a227a2026ef57fce08c1a73bad61bbabc3a52bfd | [
"BSD-3-Clause"
] | 46 | 2020-10-20T09:52:53.000Z | 2021-08-15T09:29:27.000Z | torchvision/io/image.py | Gaurav7888/vision | a227a2026ef57fce08c1a73bad61bbabc3a52bfd | [
"BSD-3-Clause"
] | 2 | 2021-06-29T14:30:51.000Z | 2021-06-29T14:32:21.000Z | import torch
from enum import Enum
from .._register_extension import _get_extension_path
try:
lib_path = _get_extension_path('image')
torch.ops.load_library(lib_path)
except (ImportError, OSError):
pass
class ImageReadMode(Enum):
"""
Support for various modes while reading images.
Use ``Im... | 35.1875 | 101 | 0.662015 | import torch
from enum import Enum
from .._register_extension import _get_extension_path
try:
lib_path = _get_extension_path('image')
torch.ops.load_library(lib_path)
except (ImportError, OSError):
pass
class ImageReadMode(Enum):
UNCHANGED = 0
GRAY = 1
GRAY_ALPHA = 2
RGB = 3
RGB_ALP... | true | true |
08f6d6e1a931962a7fe15198aa9230680e3062f1 | 522 | py | Python | PyPerspective/errors.py | TunayAdaKaracan/PyPerspective | fee31da2f86d890f2676d429d7fc3194f2164213 | [
"MIT"
] | null | null | null | PyPerspective/errors.py | TunayAdaKaracan/PyPerspective | fee31da2f86d890f2676d429d7fc3194f2164213 | [
"MIT"
] | 1 | 2021-10-12T00:29:50.000Z | 2021-10-12T00:29:50.000Z | PyPerspective/errors.py | TunayAdaKaracan/PyPerspective | fee31da2f86d890f2676d429d7fc3194f2164213 | [
"MIT"
] | null | null | null | class InvalidAuthKey(Exception):
pass
class DefaultStoreTypeError(Exception):
pass
class LangsTypeError(Exception):
pass
class TestsTypeError(Exception):
pass
class TextTypeError(Exception):
pass
class SubAttributesTypeError(Exception):
pass
class NotValidTest(Exception):
pass
class A... | 16.3125 | 46 | 0.733716 | class InvalidAuthKey(Exception):
pass
class DefaultStoreTypeError(Exception):
pass
class LangsTypeError(Exception):
pass
class TestsTypeError(Exception):
pass
class TextTypeError(Exception):
pass
class SubAttributesTypeError(Exception):
pass
class NotValidTest(Exception):
pass
class A... | true | true |
08f6d759d25e3879b5f9ca28e23527ba3c793c7f | 13,284 | py | Python | homeassistant/components/logbook/queries.py | csgitmeup/core | 9ab8929c102a041dc5d3b0103e49e475a18f1538 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/logbook/queries.py | csgitmeup/core | 9ab8929c102a041dc5d3b0103e49e475a18f1538 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/logbook/queries.py | csgitmeup/core | 9ab8929c102a041dc5d3b0103e49e475a18f1538 | [
"Apache-2.0"
] | null | null | null | """Queries for logbook."""
from __future__ import annotations
from collections.abc import Iterable
from datetime import datetime as dt
from typing import Any
import sqlalchemy
from sqlalchemy import lambda_stmt, select, union_all
from sqlalchemy.orm import aliased
from sqlalchemy.sql.expression import literal
from sq... | 35.329787 | 101 | 0.673743 | from __future__ import annotations
from collections.abc import Iterable
from datetime import datetime as dt
from typing import Any
import sqlalchemy
from sqlalchemy import lambda_stmt, select, union_all
from sqlalchemy.orm import aliased
from sqlalchemy.sql.expression import literal
from sqlalchemy.sql.lambdas import... | true | true |
08f6d8cf050f6ae51d711f50815bf92ce3d83654 | 676 | py | Python | test_one.py | mathemusician/ocr_pytorch | 07e56f4d240ca76d5cb447c912fef573a0869577 | [
"MIT"
] | 5 | 2021-08-23T10:25:48.000Z | 2022-01-22T23:03:39.000Z | test_one.py | mathemusician/ocr_pytorch | 07e56f4d240ca76d5cb447c912fef573a0869577 | [
"MIT"
] | null | null | null | test_one.py | mathemusician/ocr_pytorch | 07e56f4d240ca76d5cb447c912fef573a0869577 | [
"MIT"
] | 2 | 2021-09-04T11:07:50.000Z | 2021-12-12T06:13:21.000Z | import os
from ocr import ocr
import time
import shutil
import numpy as np
from PIL import Image
from glob import glob
import cv2
def single_pic_proc(image_file):
image = np.array(Image.open(image_file).convert("RGB"))
result, image_framed = ocr(image)
return result, image_framed
def dis(image):
cv2... | 21.125 | 64 | 0.66716 | import os
from ocr import ocr
import time
import shutil
import numpy as np
from PIL import Image
from glob import glob
import cv2
def single_pic_proc(image_file):
image = np.array(Image.open(image_file).convert("RGB"))
result, image_framed = ocr(image)
return result, image_framed
def dis(image):
cv2... | true | true |
08f6dab2b0b74014154815783382ba38ca882002 | 19,779 | py | Python | python/ccxt/cex.py | KaceyBolman/ccxt | d34a0651b209ac77453f05c4ce31883f0cd2d6b8 | [
"MIT"
] | 1 | 2018-07-06T08:14:13.000Z | 2018-07-06T08:14:13.000Z | python/ccxt/cex.py | LeapM/ccxt | aeb07fc86991ce38a218c1199c6ae3bb5cfdf228 | [
"MIT"
] | null | null | null | python/ccxt/cex.py | LeapM/ccxt | aeb07fc86991ce38a218c1199c6ae3bb5cfdf228 | [
"MIT"
] | 2 | 2019-03-14T15:17:46.000Z | 2019-09-08T19:26:04.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 38.183398 | 327 | 0.47783 |
from ccxt.base.exchange import Exchange
try:
basestring except NameError:
basestring = str import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NullResponse
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import NotSupported
class cex (Exchange)... | true | true |
08f6de03c9ec8cb45bb1795404f0a2c04416e653 | 1,246 | py | Python | scripts/algorithms/state_space.py | ExesiosPB/libm | 09c2638d895a4ba69e0d7f4f0e353f27d4b7911f | [
"MIT"
] | null | null | null | scripts/algorithms/state_space.py | ExesiosPB/libm | 09c2638d895a4ba69e0d7f4f0e353f27d4b7911f | [
"MIT"
] | null | null | null | scripts/algorithms/state_space.py | ExesiosPB/libm | 09c2638d895a4ba69e0d7f4f0e353f27d4b7911f | [
"MIT"
] | null | null | null | # import csv
# import os
# import rpy2.robjects as robjects
#
#
# class StateSpaceModel(object):
#
# def __init__(self, data_in, num_prediction_periods):
# if not all(isinstance(x, float) for x in data_in):
# raise ValueError('Time series must be all float values')
#
# self.__history = d... | 29.666667 | 79 | 0.55297 | # source('predict')
# ''')
| true | true |
08f6ded1a4b92b56d22840ce8de08faf19580d8d | 4,683 | py | Python | apps/PoolBasedTripletMDS/algs/UncertaintySampling/myAlg.py | erinzm/NEXT-chemistry | d6ca0a80640937b36f9cafb5ead371e7a8677734 | [
"Apache-2.0"
] | 155 | 2015-11-01T17:48:41.000Z | 2022-02-06T21:37:41.000Z | apps/PoolBasedTripletMDS/algs/UncertaintySampling/myAlg.py | erinzm/NEXT-chemistry | d6ca0a80640937b36f9cafb5ead371e7a8677734 | [
"Apache-2.0"
] | 193 | 2015-09-29T21:40:31.000Z | 2020-04-21T15:09:13.000Z | apps/PoolBasedTripletMDS/algs/UncertaintySampling/myAlg.py | erinzm/NEXT-chemistry | d6ca0a80640937b36f9cafb5ead371e7a8677734 | [
"Apache-2.0"
] | 54 | 2015-09-30T15:51:05.000Z | 2022-02-13T05:26:20.000Z | """
UncertaintySampling app of the Online Learning Library for Next.Discovery
author: Kevin Jamieson, kevin.g.jamieson@gmail.com
last updated: 1/17/2015
"""
import numpy
import numpy as np
import numpy.random
import random
import next.utils as utils
from apps.PoolBasedTripletMDS.algs.UncertaintySampling import utilsMDS... | 34.688889 | 109 | 0.695921 | import numpy
import numpy as np
import numpy.random
import random
import next.utils as utils
from apps.PoolBasedTripletMDS.algs.UncertaintySampling import utilsMDS
import time
class MyAlg:
def initExp(self,butler,n,d,failure_probability):
X = numpy.random.randn(n,d)
butler.algorithms.set(key='n',value=n)
... | true | true |
08f6e34eb576d4fb663cb60cd23844b93b06d91d | 413 | py | Python | main/migrations/0003_pdfaudio_audio_file.py | VijyantVerma/pdf-to-audio | 2eb925be77c4ee079b27a180521fa7fc460b8e5f | [
"MIT"
] | 1 | 2020-10-14T22:50:01.000Z | 2020-10-14T22:50:01.000Z | main/migrations/0003_pdfaudio_audio_file.py | VijyantVerma/pdf-to-audio | 2eb925be77c4ee079b27a180521fa7fc460b8e5f | [
"MIT"
] | null | null | null | main/migrations/0003_pdfaudio_audio_file.py | VijyantVerma/pdf-to-audio | 2eb925be77c4ee079b27a180521fa7fc460b8e5f | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-20 18:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_auto_20201020_2339'),
]
operations = [
migrations.AddField(
model_name='pdfaudio',
name='audio_file',
... | 21.736842 | 76 | 0.605327 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_auto_20201020_2339'),
]
operations = [
migrations.AddField(
model_name='pdfaudio',
name='audio_file',
field=models.FileField(blank=True, nu... | true | true |
08f6e3a95ae716bc63cbe11b66e7b2ee316e28c9 | 418 | py | Python | ex101a.py | emerfelippini/Curso_em_video-Aulas_Python | 5b1d78b259732bb9bbad27cd30ce91bba77c5ef0 | [
"MIT"
] | null | null | null | ex101a.py | emerfelippini/Curso_em_video-Aulas_Python | 5b1d78b259732bb9bbad27cd30ce91bba77c5ef0 | [
"MIT"
] | null | null | null | ex101a.py | emerfelippini/Curso_em_video-Aulas_Python | 5b1d78b259732bb9bbad27cd30ce91bba77c5ef0 | [
"MIT"
] | null | null | null | def voto(ano):
from datetime import datetime
ano_atual = datetime.today().year
if (ano_atual - ano) < 16:
return 'negado'
elif 16 <= (ano_atual - ano ) < 18 or (ano_atual - ano) > 65:
return 'opcional'
elif 18 <= (ano_atual - ano ) <= 65:
return 'obrigatório'
ano = int(inpu... | 32.153846 | 65 | 0.602871 | def voto(ano):
from datetime import datetime
ano_atual = datetime.today().year
if (ano_atual - ano) < 16:
return 'negado'
elif 16 <= (ano_atual - ano ) < 18 or (ano_atual - ano) > 65:
return 'opcional'
elif 18 <= (ano_atual - ano ) <= 65:
return 'obrigatório'
ano = int(inpu... | true | true |
08f6e3d6a390e65377072011ab2f325cbd02de33 | 5,736 | py | Python | ec2api/tests/functional/api/test_instances_ebs.py | JioCloudVPC/compute-ec2-api-vagrant | 9e7cf7b566f86aee4a0c73316533e1c410d1a897 | [
"Apache-2.0"
] | null | null | null | ec2api/tests/functional/api/test_instances_ebs.py | JioCloudVPC/compute-ec2-api-vagrant | 9e7cf7b566f86aee4a0c73316533e1c410d1a897 | [
"Apache-2.0"
] | null | null | null | ec2api/tests/functional/api/test_instances_ebs.py | JioCloudVPC/compute-ec2-api-vagrant | 9e7cf7b566f86aee4a0c73316533e1c410d1a897 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 46.634146 | 78 | 0.656206 |
from oslo_log import log
from ec2api.tests.functional import base
from ec2api.tests.functional import config
CONF = config.CONF
LOG = log.getLogger(__name__)
class InstanceWithEBSTest(base.EC2TestCase):
@classmethod
@base.safe_setup
def setUpClass(cls):
super(InstanceWithEBSTest, cls).setUpClas... | true | true |
08f6e3f71aaac91ae78d8a7def2b1a12d150c143 | 2,138 | py | Python | align/utils/logging.py | mabrains/ALIGN-public | 9a6c14310de13df369a8340f465911b629f15a3f | [
"BSD-3-Clause"
] | 119 | 2019-05-14T18:44:34.000Z | 2022-03-17T01:01:02.000Z | align/utils/logging.py | mabrains/ALIGN-public | 9a6c14310de13df369a8340f465911b629f15a3f | [
"BSD-3-Clause"
] | 717 | 2019-04-03T15:36:35.000Z | 2022-03-31T21:56:47.000Z | align/utils/logging.py | mabrains/ALIGN-public | 9a6c14310de13df369a8340f465911b629f15a3f | [
"BSD-3-Clause"
] | 34 | 2019-04-01T21:21:27.000Z | 2022-03-21T09:46:57.000Z | import logging.config
import pathlib
import configparser
def configure_logging():
cfg = configparser.ConfigParser()
cfg.read(pathlib.Path(__file__).parent.parent / 'config' / 'logging.ini')
logfile = pathlib.Path(cfg['handler_fileHandler']['args'].split("'")[1])
logfile.parent.mkdir(exist_ok=True)
... | 40.339623 | 118 | 0.710477 | import logging.config
import pathlib
import configparser
def configure_logging():
cfg = configparser.ConfigParser()
cfg.read(pathlib.Path(__file__).parent.parent / 'config' / 'logging.ini')
logfile = pathlib.Path(cfg['handler_fileHandler']['args'].split("'")[1])
logfile.parent.mkdir(exist_ok=True)
... | true | true |
08f6e4488ff0d11ef8c55337587baa4022734b62 | 8,825 | py | Python | data.py | KimDaeUng/few-shot-learning | 7068e088a8ae558fe050e8ee46c0c18953a147fd | [
"Apache-2.0"
] | 45 | 2021-01-31T09:52:38.000Z | 2022-03-30T03:50:04.000Z | data.py | KimDaeUng/few-shot-learning | 7068e088a8ae558fe050e8ee46c0c18953a147fd | [
"Apache-2.0"
] | 3 | 2019-08-13T08:54:11.000Z | 2020-04-30T15:35:35.000Z | data.py | KimDaeUng/few-shot-learning | 7068e088a8ae558fe050e8ee46c0c18953a147fd | [
"Apache-2.0"
] | 15 | 2021-02-21T07:33:02.000Z | 2022-03-26T06:14:51.000Z | import configparser
import os
import re
import string
import pickle
import copy
import random
import numpy as np
import torch
from torch.utils.data import DataLoader
from fastNLP import Vocabulary
from dataset import Dataset
from dataloader import TrainDataLoader
from utils import padding, batch_padding
... | 38.876652 | 139 | 0.627535 | import configparser
import os
import re
import string
import pickle
import copy
import random
import numpy as np
import torch
from torch.utils.data import DataLoader
from fastNLP import Vocabulary
from dataset import Dataset
from dataloader import TrainDataLoader
from utils import padding, batch_padding
... | true | true |
08f6e48e9e826b19aeef1886262cd3a91ed27cd5 | 783 | py | Python | BinaryTree.py | sidhu177/pythonprog | a75285e9e4d3cd6f1257b9a79dc39e49c68a695d | [
"MIT"
] | 2 | 2019-05-01T04:32:07.000Z | 2019-05-04T02:22:16.000Z | BinaryTree.py | sidhu177/pythonprog | a75285e9e4d3cd6f1257b9a79dc39e49c68a695d | [
"MIT"
] | null | null | null | BinaryTree.py | sidhu177/pythonprog | a75285e9e4d3cd6f1257b9a79dc39e49c68a695d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 27 21:42:09 2018
Taken from Data Structures and Algorithms using Python text book...
"""
class BinaryTree(Tree):
def left(self,p):
raise NotImplementedError('must be implemented by subclass')
def right(self,p):
raise NotImplementedError('must be i... | 27.964286 | 68 | 0.570881 |
class BinaryTree(Tree):
def left(self,p):
raise NotImplementedError('must be implemented by subclass')
def right(self,p):
raise NotImplementedError('must be implemented by subclass')
def siblings(self,p):
parent = self.parent(p)
if parent is None:
return None
... | true | true |
08f6e4c1fdd9e43f8ad05fe820d54461138b0eb5 | 94,250 | py | Python | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 38.281885 | 139 | 0.654674 |
from azure.core.exceptions import HttpResponseError
import msrest.serialization
class AccessKeys(msrest.serialization.Model):
_validation = {
'primary_connection_string': {'readonly': True},
'secondary_connection_string': {'readonly': True},
'alias_primary_connection_string': {'readonly'... | true | true |
08f6e53ed10c106bc56bc30beca81c8df4ad9bc2 | 2,015 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Linked Lists/Inserting a Node into a Sorted Doubly Linked List/insert_doubly_linked_list.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Linked Lists/Inserting a Node into a Sorted Doubly Linked List/insert_doubly_linked_list.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Linked Lists/Inserting a Node into a Sorted Doubly Linked List/insert_doubly_linked_list.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
class DoublyLinkedListNode:
def __init__(self, node_data):
self.data = node_data
self.next = None
self.prev = None
class DoublyLinkedList:
def __init__(self):
self.head = None
self.tail = None
... | 19.563107 | 51 | 0.567246 |
import math
import os
import random
import re
import sys
class DoublyLinkedListNode:
def __init__(self, node_data):
self.data = node_data
self.next = None
self.prev = None
class DoublyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def insert_nod... | true | true |
08f6e58ca80070d4aa5a15298056a9d230f6a2c1 | 1,793 | py | Python | bio_embeddings/embed/prottrans_bert_bfd_embedder.py | kvetab/bio_embeddings | 97309f73c964861f6e4e3d4510f4b5711d3b6b32 | [
"MIT"
] | 219 | 2020-01-19T16:39:09.000Z | 2022-03-21T16:02:04.000Z | bio_embeddings/embed/prottrans_bert_bfd_embedder.py | kvetab/bio_embeddings | 97309f73c964861f6e4e3d4510f4b5711d3b6b32 | [
"MIT"
] | 175 | 2019-12-05T13:27:14.000Z | 2022-03-30T16:58:32.000Z | bio_embeddings/embed/prottrans_bert_bfd_embedder.py | kvetab/bio_embeddings | 97309f73c964861f6e4e3d4510f4b5711d3b6b32 | [
"MIT"
] | 33 | 2019-12-16T09:59:44.000Z | 2022-03-05T06:35:16.000Z | import logging
from pathlib import Path
from transformers import BertModel, BertTokenizer
from bio_embeddings.embed.prottrans_base_embedder import ProtTransBertBaseEmbedder
logger = logging.getLogger(__name__)
class ProtTransBertBFDEmbedder(ProtTransBertBaseEmbedder):
"""ProtTrans-Bert-BFD Embedder (ProtBert-B... | 33.830189 | 87 | 0.688232 | import logging
from pathlib import Path
from transformers import BertModel, BertTokenizer
from bio_embeddings.embed.prottrans_base_embedder import ProtTransBertBaseEmbedder
logger = logging.getLogger(__name__)
class ProtTransBertBFDEmbedder(ProtTransBertBaseEmbedder):
_model: BertModel
name = "prottrans_b... | true | true |
08f6e6643b3ac94148dd1020561c3e5bb0d1a6b5 | 479 | py | Python | python/example/_29_sequencemacher.py | donarts/sourcecode | 8fe85663a3f2f4a0561bab5950178afefbe82e9a | [
"MIT"
] | null | null | null | python/example/_29_sequencemacher.py | donarts/sourcecode | 8fe85663a3f2f4a0561bab5950178afefbe82e9a | [
"MIT"
] | null | null | null | python/example/_29_sequencemacher.py | donarts/sourcecode | 8fe85663a3f2f4a0561bab5950178afefbe82e9a | [
"MIT"
] | null | null | null | from difflib import SequenceMatcher
str1="abcde"
str2=" abce"
s = SequenceMatcher(None, str1, str2)
print(s.get_matching_blocks())
for mb in s.get_matching_blocks():
print(mb, str1[mb.a:mb.a+mb.size])
print(mb, str2[mb.b:mb.b+mb.size])
'''
[Match(a=0, b=1, size=3), Match(a=4, b=4, size=1), Match(a=5, b=5, size=0)]
... | 25.210526 | 75 | 0.645094 | from difflib import SequenceMatcher
str1="abcde"
str2=" abce"
s = SequenceMatcher(None, str1, str2)
print(s.get_matching_blocks())
for mb in s.get_matching_blocks():
print(mb, str1[mb.a:mb.a+mb.size])
print(mb, str2[mb.b:mb.b+mb.size])
| true | true |
08f6e68e5cf2a151ffd4d67e3656da95e07a5357 | 1,361 | py | Python | SIM/cvbridge_build_ws/build/opencv_tests/catkin_generated/generate_cached_setup.py | dlfdn9392/autonomous_driving_car_project | dc07a9e949be4bbb37c8726357ee596f74eec3da | [
"MIT"
] | 3 | 2022-02-12T08:51:37.000Z | 2022-03-21T04:30:08.000Z | SIM/cvbridge_build_ws/build/opencv_tests/catkin_generated/generate_cached_setup.py | dlfdn9392/autonomous_driving_car_project | dc07a9e949be4bbb37c8726357ee596f74eec3da | [
"MIT"
] | null | null | null | SIM/cvbridge_build_ws/build/opencv_tests/catkin_generated/generate_cached_setup.py | dlfdn9392/autonomous_driving_car_project | dc07a9e949be4bbb37c8726357ee596f74eec3da | [
"MIT"
] | 2 | 2021-10-09T08:26:19.000Z | 2022-03-09T12:44:00.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, ... | 43.903226 | 111 | 0.741367 | from __future__ import print_function
import os
import stat
import sys
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.join('/opt/ros/melodic/share/catkin/cmake', '..', 'python'))
try:
from catkin.environment_cache import generate_env... | true | true |
08f6e6cb47111dc1cf4bdfafc84227caadc8db44 | 13,756 | py | Python | solutionbox/structured_data/mltoolbox/_structured_data/prediction/predict.py | jaeglee0416/pydatalab | ef1842571127708d494a05ee247b17bc28e33b63 | [
"Apache-2.0"
] | null | null | null | solutionbox/structured_data/mltoolbox/_structured_data/prediction/predict.py | jaeglee0416/pydatalab | ef1842571127708d494a05ee247b17bc28e33b63 | [
"Apache-2.0"
] | null | null | null | solutionbox/structured_data/mltoolbox/_structured_data/prediction/predict.py | jaeglee0416/pydatalab | ef1842571127708d494a05ee247b17bc28e33b63 | [
"Apache-2.0"
] | 1 | 2020-10-24T02:28:55.000Z | 2020-10-24T02:28:55.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.133995 | 98 | 0.62271 |
import argparse
import datetime
import os
import sys
import apache_beam as beam
def parse_arguments(argv):
parser = argparse.ArgumentParser(
description='Runs Prediction inside a beam or Dataflow job.')
parser.add_argument('--project-id',
help='The project to which the job will be... | true | true |
08f6e78d7d95065c5e690ccccd65b110498791cc | 5,524 | py | Python | flask_monitoringdashboard/controllers/requests.py | timgates42/Flask-MonitoringDashboard | 0404b05b9a8f1917796e0f314a77a53a754a0b15 | [
"MIT"
] | 3 | 2020-07-17T05:37:41.000Z | 2021-09-06T19:46:15.000Z | flask_monitoringdashboard/controllers/requests.py | timgates42/Flask-MonitoringDashboard | 0404b05b9a8f1917796e0f314a77a53a754a0b15 | [
"MIT"
] | null | null | null | flask_monitoringdashboard/controllers/requests.py | timgates42/Flask-MonitoringDashboard | 0404b05b9a8f1917796e0f314a77a53a754a0b15 | [
"MIT"
] | 1 | 2020-11-21T01:25:51.000Z | 2020-11-21T01:25:51.000Z | import datetime
import numpy
from flask_monitoringdashboard.core.timezone import to_utc_datetime, to_local_datetime
from flask_monitoringdashboard.database.count_group import count_requests_per_day, get_value
from flask_monitoringdashboard.database.endpoint import get_endpoints, get_num_requests
from flask_monitorin... | 38.901408 | 119 | 0.713613 | import datetime
import numpy
from flask_monitoringdashboard.core.timezone import to_utc_datetime, to_local_datetime
from flask_monitoringdashboard.database.count_group import count_requests_per_day, get_value
from flask_monitoringdashboard.database.endpoint import get_endpoints, get_num_requests
from flask_monitorin... | true | true |
08f6e7d52b175745c91743f37d69ac5a1ee8179b | 1,473 | py | Python | test/extract_topic.py | a625687551/jieba_faster | 6376b4f0602d9d15367111e4d31e1087c91d31fc | [
"MIT"
] | null | null | null | test/extract_topic.py | a625687551/jieba_faster | 6376b4f0602d9d15367111e4d31e1087c91d31fc | [
"MIT"
] | null | null | null | test/extract_topic.py | a625687551/jieba_faster | 6376b4f0602d9d15367111e4d31e1087c91d31fc | [
"MIT"
] | 1 | 2020-03-05T08:10:15.000Z | 2020-03-05T08:10:15.000Z | import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv) < 2:
print("usage: extract_topic.py... | 23.015625 | 70 | 0.68296 | import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv) < 2:
print("usage: extract_topic.py... | true | true |
08f6e7fde7c6e4fc94e04fd89ee336d69cd99097 | 619 | py | Python | spacy/lang/en/lemmatizer/_lemma_rules.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | 5 | 2019-04-19T06:27:29.000Z | 2019-12-02T13:30:47.000Z | spacy/lang/en/lemmatizer/_lemma_rules.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | null | null | null | spacy/lang/en/lemmatizer/_lemma_rules.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | 2 | 2019-04-19T06:27:18.000Z | 2019-10-04T12:39:15.000Z | # coding: utf8
from __future__ import unicode_literals
ADJECTIVE_RULES = [
["er", ""],
["est", ""],
["er", "e"],
["est", "e"]
]
NOUN_RULES = [
["s", ""],
["ses", "s"],
["ves", "f"],
["xes", "x"],
["zes", "z"],
["ches", "ch"],
["shes", "sh"],
["men"... | 14.068182 | 40 | 0.282714 | from __future__ import unicode_literals
ADJECTIVE_RULES = [
["er", ""],
["est", ""],
["er", "e"],
["est", "e"]
]
NOUN_RULES = [
["s", ""],
["ses", "s"],
["ves", "f"],
["xes", "x"],
["zes", "z"],
["ches", "ch"],
["shes", "sh"],
["men", "man"],
[... | true | true |
08f6e8098b730dd8ba28d421f350294537d25111 | 1,622 | py | Python | quiz/gcp/datastore.py | sebalesca/trivia | 219dc9517b2c288c2e1d1fa72c497fbf05332fde | [
"MIT"
] | null | null | null | quiz/gcp/datastore.py | sebalesca/trivia | 219dc9517b2c288c2e1d1fa72c497fbf05332fde | [
"MIT"
] | null | null | null | quiz/gcp/datastore.py | sebalesca/trivia | 219dc9517b2c288c2e1d1fa72c497fbf05332fde | [
"MIT"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.803922 | 74 | 0.729963 | import os
project_id = os.getenv('GCLOUD_PROJECT')
from flask import current_app
from google.cloud import datastore
datastore_client = datastore.Client(project_id)
def list_entities(quiz='gcp', redact=True):
query = datastore_client.query(kind='Question')
query.add_filter('quiz', '=', quiz)
results =lis... | true | true |
08f6e81b4616e2bf946e49fefc6ec2eb7c919751 | 7,367 | py | Python | datasketch/lshensemble_partition.py | sergiiz/datasketch | 52f7d6ab575e7a3bf72417301170f141e3e66fe2 | [
"MIT"
] | 1,771 | 2015-04-07T18:06:02.000Z | 2022-03-31T17:45:24.000Z | datasketch/lshensemble_partition.py | sergiiz/datasketch | 52f7d6ab575e7a3bf72417301170f141e3e66fe2 | [
"MIT"
] | 159 | 2015-08-15T09:47:58.000Z | 2022-03-22T12:55:21.000Z | datasketch/lshensemble_partition.py | sergiiz/datasketch | 52f7d6ab575e7a3bf72417301170f141e3e66fe2 | [
"MIT"
] | 278 | 2015-04-08T13:50:27.000Z | 2022-03-02T13:00:33.000Z | """
This module is for creating optimal partition intervals for LSH Ensemble:
[l1, u1], [l2, u2], ...
with all boundaries inclusive, using set size distribution.
"""
from collections import Counter
import numpy as np
def _compute_nfp_uniform(l, u, cum_counts, sizes):
"""Computes the expected number of fals... | 37.586735 | 81 | 0.631057 |
from collections import Counter
import numpy as np
def _compute_nfp_uniform(l, u, cum_counts, sizes):
if l > u:
raise ValueError("l must be less or equal to u")
if l == 0:
n = cum_counts[u]
else:
n = cum_counts[u]-cum_counts[l-1]
return n * float(sizes[u] - sizes[l]) / float(2... | true | true |
08f6ea3f471475a54472a3aa600b0fa7f0a2d95e | 40,018 | py | Python | nemo/collections/asr/models/rnnt_models.py | 23jura23/NeMo | 6815146775432852feee1bc28ed1a7a2fc94010d | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | nemo/collections/asr/models/rnnt_models.py | 23jura23/NeMo | 6815146775432852feee1bc28ed1a7a2fc94010d | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | nemo/collections/asr/models/rnnt_models.py | 23jura23/NeMo | 6815146775432852feee1bc28ed1a7a2fc94010d | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 44.267699 | 120 | 0.637263 |
import copy
import json
import os
import tempfile
from math import ceil
from typing import Dict, List, Optional, Union
import torch
from omegaconf import DictConfig, OmegaConf, open_dict
from pytorch_lightning import Trainer
from torch.utils.data import ChainDataset
from tqdm.auto import tqdm
from nemo.collections.a... | true | true |
08f6ea6419033622eb18877b11475b627865727f | 1,107 | py | Python | setup.py | actini/pyexecutor | c494821db0fea84a7c4a1a331c38b786fe193768 | [
"MIT"
] | null | null | null | setup.py | actini/pyexecutor | c494821db0fea84a7c4a1a331c38b786fe193768 | [
"MIT"
] | null | null | null | setup.py | actini/pyexecutor | c494821db0fea84a7c4a1a331c38b786fe193768 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pyexecutor",
version="1.0.9",
author="WANG ZIJIAN",
author_email="actini@outlook.com",
description=
"""
A light-weight module to run shell / commander commands and get output w... | 33.545455 | 133 | 0.631436 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pyexecutor",
version="1.0.9",
author="WANG ZIJIAN",
author_email="actini@outlook.com",
description=
"""
A light-weight module to run shell / commander commands and get output w... | true | true |
08f6ea6edd419883f946f2a637e72eadd1e5ead1 | 365 | py | Python | usr.bin.supl-proxy.py | Eierkopp/supl-hack | fc4dd92e71bd505af22782d670c2fce16370e414 | [
"MIT"
] | 1 | 2022-01-23T09:14:43.000Z | 2022-01-23T09:14:43.000Z | usr.bin.supl-proxy.py | Eierkopp/supl-hack | fc4dd92e71bd505af22782d670c2fce16370e414 | [
"MIT"
] | null | null | null | usr.bin.supl-proxy.py | Eierkopp/supl-hack | fc4dd92e71bd505af22782d670c2fce16370e414 | [
"MIT"
] | null | null | null | # Last Modified: Sun Feb 6 10:28:32 2022
abi <abi/3.0>,
include <tunables/global>
/usr/bin/supl-proxy.py flags=(complain) {
include <abstractions/base>
include <abstractions/python>
include <abstractions/user-tmp>
network inet dgram,
network inet stream,
/etc/hosts r,
/usr/bin/python3.9 ix,
/usr/bi... | 18.25 | 41 | 0.690411 | abi <abi/3.0>,
include <tunables/global>
/usr/bin/supl-proxy.py flags=(complain) {
include <abstractions/base>
include <abstractions/python>
include <abstractions/user-tmp>
network inet dgram,
network inet stream,
/etc/hosts r,
/usr/bin/python3.9 ix,
/usr/bin/supl-proxy.py r,
owner /tmp/cache/ r,
... | false | true |
08f6eadbc804d8f233e752fa54bd0669ebb2bc41 | 4,998 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 51 | 311 | 0.690476 |
from .sub_resource_py3 import SubResource
class InboundNatRule(SubResource):
_validation = {
'backend_ip_configuration': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type'... | true | true |
08f6ebc93ac202e50f9705773d6b2a8d22335dbb | 4,935 | py | Python | docs/conf.py | P6rguVyrst/FPLExporter | c3e5ff8eec101304ee61b275ec5c4c2c8a7e5b3a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | P6rguVyrst/FPLExporter | c3e5ff8eec101304ee61b275ec5c4c2c8a7e5b3a | [
"Apache-2.0"
] | 1 | 2021-11-15T17:48:56.000Z | 2021-11-15T17:48:56.000Z | docs/conf.py | P6rguVyrst/FPLExporter | c3e5ff8eec101304ee61b275ec5c4c2c8a7e5b3a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fpl_exporter documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... | 30.462963 | 86 | 0.679838 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
import fpl_exporter
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = u"FPL Exporter"
copyright = u"2019, Toomas Ormisson"
author = u"Toomas Ormisson"
... | true | true |
08f6ec959bf56e86ef0b2764b637ef60a8f530d9 | 5,664 | py | Python | setup.py | ned2/dvc | 666e203bbba3a36e2b6c2a6a4015718c36e77374 | [
"Apache-2.0"
] | null | null | null | setup.py | ned2/dvc | 666e203bbba3a36e2b6c2a6a4015718c36e77374 | [
"Apache-2.0"
] | null | null | null | setup.py | ned2/dvc | 666e203bbba3a36e2b6c2a6a4015718c36e77374 | [
"Apache-2.0"
] | null | null | null | import importlib.util
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.build_py import build_py as _build_py
# Prevents pkg_resources import in entry point script,
# see https://github.com/ninjaaron/fast-entry_points.
# This saves about 200 ms on startup time for non-wheel inst... | 31.820225 | 79 | 0.636653 | import importlib.util
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.build_py import build_py as _build_py
try:
import fastentrypoints except ImportError:
pass
pkg_dir = os.path.dirname(os.path.abspath(__file__))
version_path = os.path.join(pkg_dir, "dvc", "versio... | true | true |
08f6ece66df185ee576d620ab47710f9c477fef8 | 884 | py | Python | utils/copyark2hdf5.py | ishine/AudioCaption | d121cba8247b96aeed9ff77d2fff073f93e0a63f | [
"MIT"
] | 76 | 2019-02-27T02:11:08.000Z | 2021-11-25T05:49:45.000Z | utils/copyark2hdf5.py | ishine/AudioCaption | d121cba8247b96aeed9ff77d2fff073f93e0a63f | [
"MIT"
] | 1 | 2021-04-01T08:30:06.000Z | 2021-04-09T07:25:35.000Z | utils/copyark2hdf5.py | ishine/AudioCaption | d121cba8247b96aeed9ff77d2fff073f93e0a63f | [
"MIT"
] | 8 | 2019-02-27T09:09:23.000Z | 2021-12-13T12:07:32.000Z | import sys
import argparse
from pathlib import Path
import h5py
sys.path.append(str(Path.cwd()))
import utils.kaldi_io as kaldi_io
def main(copy_stream, write_hdf5):
write_scp = write_hdf5.split(".")[0] + ".scp"
with h5py.File(write_hdf5, "w") as feature_store, open(write_scp, "w") as key_store:
for k... | 32.740741 | 127 | 0.702489 | import sys
import argparse
from pathlib import Path
import h5py
sys.path.append(str(Path.cwd()))
import utils.kaldi_io as kaldi_io
def main(copy_stream, write_hdf5):
write_scp = write_hdf5.split(".")[0] + ".scp"
with h5py.File(write_hdf5, "w") as feature_store, open(write_scp, "w") as key_store:
for k... | true | true |
08f6ed4516aa946bea2c7fe257e4fd4022f4a5fc | 20,266 | py | Python | skimage/measure/_regionprops.py | jhemmelg/scikit-image | f7a0ee8ea4aed49e68a8351ad2d3c1d616805539 | [
"BSD-3-Clause"
] | 2 | 2021-02-24T02:13:03.000Z | 2021-05-06T13:43:35.000Z | skimage/measure/_regionprops.py | siraferradans/scikit-image-temp | db3b97aec1824d8f49116b8918ff95639af441d4 | [
"BSD-3-Clause"
] | 3 | 2021-03-19T14:27:58.000Z | 2022-03-12T00:42:39.000Z | skimage/measure/_regionprops.py | siraferradans/scikit-image-temp | db3b97aec1824d8f49116b8918ff95639af441d4 | [
"BSD-3-Clause"
] | 1 | 2017-07-24T18:11:30.000Z | 2017-07-24T18:11:30.000Z | # coding: utf-8
from __future__ import division
from math import sqrt, atan2, pi as PI
import numpy as np
from scipy import ndimage as ndi
from ._label import label
from . import _moments
from functools import wraps
__all__ = ['regionprops', 'perimeter']
STREL_4 = np.array([[0, 1, 0],
[1, 1, 1... | 32.373802 | 79 | 0.59997 | from __future__ import division
from math import sqrt, atan2, pi as PI
import numpy as np
from scipy import ndimage as ndi
from ._label import label
from . import _moments
from functools import wraps
__all__ = ['regionprops', 'perimeter']
STREL_4 = np.array([[0, 1, 0],
[1, 1, 1],
... | true | true |
08f6ee42807e0912a6372c27dbe02e258001c909 | 23,854 | py | Python | tests/objects/test_stringobject.py | ruby-compiler-survey/topaz | bf4a56adbe03ae9ab4984729c733fcbc64a164c4 | [
"BSD-3-Clause"
] | 241 | 2015-01-02T18:49:09.000Z | 2022-03-15T15:08:45.000Z | tests/objects/test_stringobject.py | ruby-compiler-survey/topaz | bf4a56adbe03ae9ab4984729c733fcbc64a164c4 | [
"BSD-3-Clause"
] | 16 | 2015-05-04T21:31:08.000Z | 2020-06-04T22:49:36.000Z | tests/objects/test_stringobject.py | ruby-compiler-survey/topaz | bf4a56adbe03ae9ab4984729c733fcbc64a164c4 | [
"BSD-3-Clause"
] | 24 | 2015-02-15T05:35:11.000Z | 2022-03-22T13:29:04.000Z | from rpython.rlib.rbigint import rbigint
from ..base import BaseTopazTest
import pytest
class TestStringObject(BaseTopazTest):
def test_new(self, space):
w_res = space.execute("return String.new('abc')")
assert space.str_w(w_res) == "abc"
w_res = space.execute("return String.new")
... | 38.412238 | 95 | 0.548042 | from rpython.rlib.rbigint import rbigint
from ..base import BaseTopazTest
import pytest
class TestStringObject(BaseTopazTest):
def test_new(self, space):
w_res = space.execute("return String.new('abc')")
assert space.str_w(w_res) == "abc"
w_res = space.execute("return String.new")
... | true | true |
08f6ee956902e7ef02dd623772d59eb4ec30b4d9 | 5,535 | py | Python | ecostake/types/blockchain_format/proof_of_space.py | Ecostake-Network/ecostake-blockchain | 8ea8bb9743c7caccb2f8c670853d93ee12d00c86 | [
"Apache-2.0"
] | 2 | 2022-03-29T23:36:29.000Z | 2022-03-30T04:18:42.000Z | ecostake/types/blockchain_format/proof_of_space.py | Ecostake-Network/ecostake-blockchain | 8ea8bb9743c7caccb2f8c670853d93ee12d00c86 | [
"Apache-2.0"
] | 11 | 2022-03-31T06:30:52.000Z | 2022-03-31T17:02:45.000Z | ecostake/types/blockchain_format/proof_of_space.py | Ecostake-Network/ecostake-blockchain | 8ea8bb9743c7caccb2f8c670853d93ee12d00c86 | [
"Apache-2.0"
] | null | null | null | import copy
import logging
from dataclasses import dataclass
from typing import Optional
from bitstring import BitArray
from blspy import AugSchemeMPL, G1Element, PrivateKey
from chiapos import Verifier
from ecostake.consensus.coinbase import create_puzzlehash_for_pk
from ecostake.consensus.constants import Consensus... | 38.172414 | 120 | 0.7028 | import copy
import logging
from dataclasses import dataclass
from typing import Optional
from bitstring import BitArray
from blspy import AugSchemeMPL, G1Element, PrivateKey
from chiapos import Verifier
from ecostake.consensus.coinbase import create_puzzlehash_for_pk
from ecostake.consensus.constants import Consensus... | true | true |
08f6ef4ebca5271899348538c04c848579772fdd | 151 | py | Python | src/lib/centipede/Crawler/Fs/Image/__init__.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 3 | 2018-05-28T20:56:19.000Z | 2018-06-02T15:58:10.000Z | src/lib/centipede/Crawler/Fs/Image/__init__.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 2 | 2018-07-01T07:45:38.000Z | 2018-07-11T03:15:35.000Z | src/lib/centipede/Crawler/Fs/Image/__init__.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 3 | 2018-07-10T14:51:13.000Z | 2022-03-17T00:39:58.000Z | from .Image import Image
from .Oiio import Oiio, OiioReadFileError
from .Exr import Exr
from .Dpx import Dpx
from .Jpg import Jpg
from .Png import Png
| 21.571429 | 41 | 0.788079 | from .Image import Image
from .Oiio import Oiio, OiioReadFileError
from .Exr import Exr
from .Dpx import Dpx
from .Jpg import Jpg
from .Png import Png
| true | true |
08f6ef83ab3aebc5e4236056840f83c59c64e9c7 | 11,462 | py | Python | tests/test_cli.py | YouQam/geoextent | e4375cbfe78d349ae21e469a97d024741e538aa8 | [
"MIT"
] | null | null | null | tests/test_cli.py | YouQam/geoextent | e4375cbfe78d349ae21e469a97d024741e538aa8 | [
"MIT"
] | 1 | 2019-08-19T07:07:19.000Z | 2019-08-19T07:07:19.000Z | tests/test_cli.py | YouQam/geoextent | e4375cbfe78d349ae21e469a97d024741e538aa8 | [
"MIT"
] | null | null | null | import os # used to get the location of the testdata
import pytest
def test_helptext_direct(script_runner):
ret = script_runner.run('geoextent', '--help')
assert ret.success, "process should return success"
assert ret.stderr == '', "stderr should be empty"
assert "geoextent [-h]" in ret.stdo... | 52.820276 | 182 | 0.708428 | import os import pytest
def test_helptext_direct(script_runner):
ret = script_runner.run('geoextent', '--help')
assert ret.success, "process should return success"
assert ret.stderr == '', "stderr should be empty"
assert "geoextent [-h]" in ret.stdout, "usage instructions are printed to cons... | true | true |
08f6f00c4863b243a6053c47acb2b1cb3976e5d1 | 792 | py | Python | bountytools_server/plugins/digitalocean/digitalocean.py | Ajst0077/bounty_tools | 2e03aed5474b2646005c6ef2aeba25922a11f717 | [
"MIT"
] | 50 | 2017-04-20T13:40:14.000Z | 2021-08-05T02:33:52.000Z | bountytools_server/plugins/digitalocean/digitalocean.py | Ajst0077/bounty_tools | 2e03aed5474b2646005c6ef2aeba25922a11f717 | [
"MIT"
] | 68 | 2017-01-03T02:14:45.000Z | 2021-06-01T21:50:27.000Z | bountytools_server/plugins/digitalocean/digitalocean.py | Ajst0077/bounty_tools | 2e03aed5474b2646005c6ef2aeba25922a11f717 | [
"MIT"
] | 12 | 2017-05-07T15:30:04.000Z | 2020-10-17T18:14:13.000Z | """
API endpoints created for controlling DigitalOcean tasks
"""
import digitalocean
from flask import Blueprint, request
# DO Library docs: https://github.com/koalalorenzo/python-digitalocean
doconnector = Blueprint('doconnector', __name__)
@doconnector.route('/droplets/list', methods=['GET'])
def droplets_list():... | 23.294118 | 81 | 0.705808 | import digitalocean
from flask import Blueprint, request
doconnector = Blueprint('doconnector', __name__)
@doconnector.route('/droplets/list', methods=['GET'])
def droplets_list():
@doconnector.route('/droplets/create', methods=['POST'])
def droplets_create():
@doconnector.route('/droplets/destroy/<droplet_id>'... | true | true |
08f6f03f6e799c60d95e4ee42cb1f596dd18b792 | 274 | py | Python | webapp/checker.py | grahovsky/python-edu | 15dad408d8f226b69362b073c30af5cf4079094a | [
"Unlicense"
] | null | null | null | webapp/checker.py | grahovsky/python-edu | 15dad408d8f226b69362b073c30af5cf4079094a | [
"Unlicense"
] | null | null | null | webapp/checker.py | grahovsky/python-edu | 15dad408d8f226b69362b073c30af5cf4079094a | [
"Unlicense"
] | null | null | null | from flask import session
from functools import wraps
def check_logged_in(func):
@wraps(func)
def wrapper(*args, **kwargs):
if 'logged_in' in session:
return func(*args, **kwargs)
return 'You are NOT logged in.'
return wrapper | 21.076923 | 40 | 0.631387 | from flask import session
from functools import wraps
def check_logged_in(func):
@wraps(func)
def wrapper(*args, **kwargs):
if 'logged_in' in session:
return func(*args, **kwargs)
return 'You are NOT logged in.'
return wrapper | true | true |
08f6f051d3f08b6a000335ffa4e63b8a91dc00f3 | 20,665 | py | Python | coderunner/views.py | AyushSenapati/CodeRunner | 4bd289cc730218bc012691eb24f203ee51cdfff4 | [
"MIT"
] | 4 | 2018-10-03T23:07:33.000Z | 2021-05-12T10:42:45.000Z | coderunner/views.py | AyushSenapati/CodeRunner | 4bd289cc730218bc012691eb24f203ee51cdfff4 | [
"MIT"
] | null | null | null | coderunner/views.py | AyushSenapati/CodeRunner | 4bd289cc730218bc012691eb24f203ee51cdfff4 | [
"MIT"
] | null | null | null | import os
from django.contrib.sites.shortcuts import get_current_site
from django.shortcuts import render, get_object_or_404, HttpResponse, redirect
from django.template.loader import render_to_string
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_deco... | 34.10066 | 79 | 0.617276 | import os
from django.contrib.sites.shortcuts import get_current_site
from django.shortcuts import render, get_object_or_404, HttpResponse, redirect
from django.template.loader import render_to_string
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_deco... | true | true |
08f6f2003c0bb09d59642c152c4ea11aefec46f5 | 26,187 | py | Python | python/ray/rllib/evaluation/sampler.py | FlyClover/ray | 51dae23d5c8e81449bf381427fcb246c821a0196 | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/evaluation/sampler.py | FlyClover/ray | 51dae23d5c8e81449bf381427fcb246c821a0196 | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/evaluation/sampler.py | FlyClover/ray | 51dae23d5c8e81449bf381427fcb246c821a0196 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict, namedtuple
import logging
import numpy as np
import six.moves.queue as queue
import threading
import time
from ray.rllib.evaluation.episode import MultiAgentEpisode, _flatt... | 40.225806 | 79 | 0.599878 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict, namedtuple
import logging
import numpy as np
import six.moves.queue as queue
import threading
import time
from ray.rllib.evaluation.episode import MultiAgentEpisode, _flatt... | true | true |
08f6f2b1bc9cb9ca6b4bc4a14bf23476d0ae3ca4 | 233 | py | Python | build/lib/tests/test_snakemake.py | liliblu/autocluster | 95180aaaa42927bfd7fadedb11fb5e577851e387 | [
"BSD-3-Clause"
] | 20 | 2020-01-16T01:57:34.000Z | 2021-12-09T01:51:47.000Z | build/lib/tests/test_snakemake.py | liliblu/autocluster | 95180aaaa42927bfd7fadedb11fb5e577851e387 | [
"BSD-3-Clause"
] | 2 | 2021-02-03T16:29:09.000Z | 2021-02-05T15:07:44.000Z | build/lib/tests/test_snakemake.py | liliblu/autocluster | 95180aaaa42927bfd7fadedb11fb5e577851e387 | [
"BSD-3-Clause"
] | 1 | 2020-02-21T20:43:18.000Z | 2020-02-21T20:43:18.000Z | import subprocess
def test_run_snakemake_all():
# subprocess.run(
# ['touch', 'test_input.txt']
# )
subprocess.run(
['snakemake', '-s', 'hypercluster.smk', '--config', 'input_data_files=test_input']
) | 25.888889 | 90 | 0.609442 | import subprocess
def test_run_snakemake_all():
subprocess.run(
['snakemake', '-s', 'hypercluster.smk', '--config', 'input_data_files=test_input']
) | true | true |
08f6f309de03e41fe8ec5fa232a8fa3e5f034f0b | 2,733 | py | Python | test/test_domain/test_aged_brie.py | cifpfbmoll/ollivanders-in-a-docker-pau13-loop | 0f9f2589b567c57bd56a8a4161de3043d5639a8b | [
"MIT"
] | null | null | null | test/test_domain/test_aged_brie.py | cifpfbmoll/ollivanders-in-a-docker-pau13-loop | 0f9f2589b567c57bd56a8a4161de3043d5639a8b | [
"MIT"
] | null | null | null | test/test_domain/test_aged_brie.py | cifpfbmoll/ollivanders-in-a-docker-pau13-loop | 0f9f2589b567c57bd56a8a4161de3043d5639a8b | [
"MIT"
] | null | null | null | from domain.aged_brie import AgedBrie
import pytest
def test_conjured_properties():
aged_brie_item = AgedBrie("AgedBrie", 15, 10)
assert aged_brie_item.get_name() == "AgedBrie"
assert aged_brie_item.get_sell_in() == 15
assert aged_brie_item.get_quality() == 10
assert (
aged_brie_item.__st... | 22.040323 | 95 | 0.695207 | from domain.aged_brie import AgedBrie
import pytest
def test_conjured_properties():
aged_brie_item = AgedBrie("AgedBrie", 15, 10)
assert aged_brie_item.get_name() == "AgedBrie"
assert aged_brie_item.get_sell_in() == 15
assert aged_brie_item.get_quality() == 10
assert (
aged_brie_item.__st... | true | true |
08f6f34eab10f845fbe3dd5608279c759ab40343 | 1,473 | py | Python | timing.py | nadhirxz/athan-parser | 3ebb99d27e592e87e098dfb8582f328a8d0e0bc2 | [
"MIT"
] | 1 | 2022-01-09T23:48:18.000Z | 2022-01-09T23:48:18.000Z | timing.py | nadhirxz/athan-parser | 3ebb99d27e592e87e098dfb8582f328a8d0e0bc2 | [
"MIT"
] | null | null | null | timing.py | nadhirxz/athan-parser | 3ebb99d27e592e87e098dfb8582f328a8d0e0bc2 | [
"MIT"
] | null | null | null | import re
from pathlib import Path
from tqdm import tqdm
import os
print('\nParsing Timing')
places = ['alger', 'adrar', 'djelfa']
for dir in os.listdir('./pages'):
if (re.match(r'\d{4}', dir)):
for place in places:
Path(f'./output/{dir}/{place}/timing').mkdir(parents=True, exist_ok=True)
for i in tqdm(r... | 39.810811 | 188 | 0.498982 | import re
from pathlib import Path
from tqdm import tqdm
import os
print('\nParsing Timing')
places = ['alger', 'adrar', 'djelfa']
for dir in os.listdir('./pages'):
if (re.match(r'\d{4}', dir)):
for place in places:
Path(f'./output/{dir}/{place}/timing').mkdir(parents=True, exist_ok=True)
for i in tqdm(r... | true | true |
08f6f4693e2443ba38f756efbe87873085f62ab0 | 2,461 | py | Python | python/Gaffer/BlockedConnection.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/Gaffer/BlockedConnection.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/Gaffer/BlockedConnection.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 37.287879 | 77 | 0.683462 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
import Gaffer
class BlockedConnection() :
def __init__( self, connectionOrConnections ) :
if isinstance( connectionOrConnections, Gaffer.Connection ) :
self.__connections = [ connectionOrConnections ]
else :
self.__connections =... | true | true |
08f6f4f450fbfa2663c2f2edb218101df438d082 | 1,514 | py | Python | eve_sqlalchemy/tests/config/resourceconfig/inheritance.py | Alan01252/eve-sqlalchemy | b974a4639d7fa665b649b3d0c457e72de30ec484 | [
"BSD-3-Clause"
] | 2 | 2020-08-15T05:23:12.000Z | 2020-08-15T05:23:20.000Z | eve_sqlalchemy/tests/config/resourceconfig/inheritance.py | Alan01252/eve-sqlalchemy | b974a4639d7fa665b649b3d0c457e72de30ec484 | [
"BSD-3-Clause"
] | null | null | null | eve_sqlalchemy/tests/config/resourceconfig/inheritance.py | Alan01252/eve-sqlalchemy | b974a4639d7fa665b649b3d0c457e72de30ec484 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from eve_sqlalchemy.config import ResourceConfig
from . import ResourceConfigTestCase
from .. import BaseM... | 28.566038 | 73 | 0.686922 | from __future__ import unicode_literals
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from eve_sqlalchemy.config import ResourceConfig
from . import ResourceConfigTestCase
from .. import BaseModel
Base = declarative... | true | true |
08f6f52ea3a3be755a12567ec0e751b60db9de72 | 4,322 | py | Python | tests/sparkml/test_decision_tree_regressor.py | szha/onnxmltools | b04d05bda625cbc006955ce0a220277739a95825 | [
"MIT"
] | 3 | 2019-02-27T21:03:43.000Z | 2020-04-07T22:16:50.000Z | tests/sparkml/test_decision_tree_regressor.py | szha/onnxmltools | b04d05bda625cbc006955ce0a220277739a95825 | [
"MIT"
] | null | null | null | tests/sparkml/test_decision_tree_regressor.py | szha/onnxmltools | b04d05bda625cbc006955ce0a220277739a95825 | [
"MIT"
] | 2 | 2020-10-01T09:24:55.000Z | 2021-04-17T13:57:31.000Z | import sys
import inspect
import unittest
from distutils.version import StrictVersion
import onnx
import pandas
import numpy
from pyspark.ml.linalg import Vectors, SparseVector, VectorUDT
from pyspark.ml.regression import DecisionTreeRegressor
from pyspark.ml import Pipeline
from onnxmltools import conver... | 50.847059 | 120 | 0.671911 | import sys
import inspect
import unittest
from distutils.version import StrictVersion
import onnx
import pandas
import numpy
from pyspark.ml.linalg import Vectors, SparseVector, VectorUDT
from pyspark.ml.regression import DecisionTreeRegressor
from pyspark.ml import Pipeline
from onnxmltools import conver... | true | true |
08f6f5a622baa392251c26731b69d7db6416d7ac | 2,632 | py | Python | scripts/bayesian_LC_gpapprox.py | sidmohite/kNe-inference | 5642d7f4dc954cb36d76c3729d1f719ff04db0d9 | [
"MIT"
] | null | null | null | scripts/bayesian_LC_gpapprox.py | sidmohite/kNe-inference | 5642d7f4dc954cb36d76c3729d1f719ff04db0d9 | [
"MIT"
] | 3 | 2020-08-17T19:48:22.000Z | 2020-08-24T13:21:50.000Z | scripts/bayesian_LC_gpapprox.py | sidmohite/kNe-inference | 5642d7f4dc954cb36d76c3729d1f719ff04db0d9 | [
"MIT"
] | null | null | null | import numpy as np
import astropy as ap
from astropy import units as u
from astropy import constants as c
import matplotlib.pyplot as plt
import bayesian_LC as blc
from approxposterior import approx, gpUtils, likelihood as lh, utility as ut
import emcee
import corner
def prior_sample(n):
return np.array([[np.rando... | 39.283582 | 139 | 0.722264 | import numpy as np
import astropy as ap
from astropy import units as u
from astropy import constants as c
import matplotlib.pyplot as plt
import bayesian_LC as blc
from approxposterior import approx, gpUtils, likelihood as lh, utility as ut
import emcee
import corner
def prior_sample(n):
return np.array([[np.rando... | true | true |
08f6f5eae50e911db145362d2618aec6a08a0eb5 | 13,294 | py | Python | salt/states/selinux.py | velom/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | 1 | 2021-04-05T19:46:35.000Z | 2021-04-05T19:46:35.000Z | salt/states/selinux.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | salt/states/selinux.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Management of SELinux rules
===========================
If SELinux is available for the running system, the mode can be managed and
booleans can be set.
.. code-block:: yaml
enforcing:
selinux.mode
samba_create_home_dirs:
selinux.boolean:
- value: True
... | 34.801047 | 103 | 0.563036 |
def __virtual__():
return 'selinux' if 'selinux.getenforce' in __salt__ else False
def _refine_mode(mode):
mode = str(mode).lower()
if any([mode.startswith('e'),
mode == '1',
mode == 'on']):
return 'Enforcing'
if any([mode.startswith('p'),
mode == '0',
... | true | true |
08f6f6b6b18886794dd3803f003b72efd849ac9a | 12,661 | py | Python | jconfigure/tests/test_include_yaml.py | norwoodj/jconfigure | 75b1388ca0d31c1e2516db268525efcc6aa681ca | [
"MIT"
] | 2 | 2018-07-08T05:12:20.000Z | 2019-03-28T00:57:43.000Z | jconfigure/tests/test_include_yaml.py | norwoodj/jconfigure | 75b1388ca0d31c1e2516db268525efcc6aa681ca | [
"MIT"
] | 4 | 2019-01-22T16:33:14.000Z | 2021-06-02T00:59:17.000Z | jconfigure/tests/test_include_yaml.py | norwoodj/jconfigure | 75b1388ca0d31c1e2516db268525efcc6aa681ca | [
"MIT"
] | 1 | 2019-01-22T16:30:29.000Z | 2019-01-22T16:30:29.000Z | #!/usr/bin/env python
import datetime
import json
import unittest
import yaml
from dateutil.parser import parse
from unittest.mock import patch
from ..utils import get_parser_for_file
from ..exceptions import TagConstructionException, UnsupportedNodeTypeException
from .test_utils import get_full_test_file_path
class... | 39.07716 | 130 | 0.644973 | import datetime
import json
import unittest
import yaml
from dateutil.parser import parse
from unittest.mock import patch
from ..utils import get_parser_for_file
from ..exceptions import TagConstructionException, UnsupportedNodeTypeException
from .test_utils import get_full_test_file_path
class TestIncludeYaml(unitt... | true | true |
08f6f6c24f1019c93c15367a784aa93891ce86fa | 3,716 | py | Python | basic/string1.py | gustavofcma/google-python-exercises | 327fd0fbcc07c3a2a52d649f1e2284ffb9ae65d3 | [
"Apache-2.0"
] | null | null | null | basic/string1.py | gustavofcma/google-python-exercises | 327fd0fbcc07c3a2a52d649f1e2284ffb9ae65d3 | [
"Apache-2.0"
] | null | null | null | basic/string1.py | gustavofcma/google-python-exercises | 327fd0fbcc07c3a2a52d649f1e2284ffb9ae65d3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | 31.760684 | 80 | 0.653391 |
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already set up
# to call the functions with a few different inputs,
# printing 'OK' when each function is correct.
# The starter code for each function includes a 'return'
# which... | true | true |
08f6f6ef8ceb97339c1af0419c534e32d8b83cd4 | 914 | py | Python | valon_mahdollisuudet/control_car/control_car.py | otaniemen-lukio/projects | eb73d9055747dc39aa2607af6f29aee02175d371 | [
"MIT"
] | 1 | 2020-03-11T07:50:10.000Z | 2020-03-11T07:50:10.000Z | valon_mahdollisuudet/control_car/control_car.py | otaniemen-lukio/projects | eb73d9055747dc39aa2607af6f29aee02175d371 | [
"MIT"
] | null | null | null | valon_mahdollisuudet/control_car/control_car.py | otaniemen-lukio/projects | eb73d9055747dc39aa2607af6f29aee02175d371 | [
"MIT"
] | 1 | 2019-06-10T05:36:10.000Z | 2019-06-10T05:36:10.000Z | from drv8835 import DRV8835
import control_servos
import input_handling
import time
CAR = DRV8835()
CAR.stop()
SPEED = 60
TURNING_SPEED = 30
def drive_forward():
CAR.forward(SPEED, SPEED)
def drive_backward():
CAR.backward(SPEED, SPEED)
# TODO: miten kääntyy sujuvasti vasemmalle/oikealle
def dri... | 19.041667 | 51 | 0.652079 | from drv8835 import DRV8835
import control_servos
import input_handling
import time
CAR = DRV8835()
CAR.stop()
SPEED = 60
TURNING_SPEED = 30
def drive_forward():
CAR.forward(SPEED, SPEED)
def drive_backward():
CAR.backward(SPEED, SPEED)
def drive_left():
CAR.forward(TURNING_SPEED, SPEED)
de... | true | true |
08f6f7c14c381d88c962d276060eba2fd015e06a | 5,088 | py | Python | automation_scripts/polynomial_constraints_mload.py | patrickbiel01/Cairo_Verifier | c174b5d5bc906cb64c832534ffac74268bd9b308 | [
"Apache-2.0"
] | 6 | 2021-12-22T15:40:15.000Z | 2022-02-07T22:53:37.000Z | automation_scripts/polynomial_constraints_mload.py | patrickbiel01/Cairo_Verifier | c174b5d5bc906cb64c832534ffac74268bd9b308 | [
"Apache-2.0"
] | 1 | 2022-02-09T03:02:27.000Z | 2022-02-09T03:02:27.000Z | automation_scripts/polynomial_constraints_mload.py | patrickbiel01/Cairo_Verifier | c174b5d5bc906cb64c832534ffac74268bd9b308 | [
"Apache-2.0"
] | 1 | 2021-09-09T18:56:23.000Z | 2021-09-09T18:56:23.000Z | # Script to help automation of converting a cpu/layoutX/CpuConstraintPoly.sol contract to Rust
# Parses out "mload(0xDEADBEEF)" (Solidity EVM Assembley Command) from the file and replaces it with the proper Rust equivalent
# Note: replace file_name.txt appropriately
# file_name.txt should contain Solidity Assembly fro... | 36.604317 | 127 | 0.659002 |
f = open("file_name.txt", "r")
text = f.read()
parsedNum = ""
startParsing = False
i = 5
mloadStartIdx = -1
while i < len(text):
if text[i] == ')' and startParsing:
addr = int(parsedNum, 0)
newText = ""
if addr == 0 :
newText += "ctx[map::MM_PERIODIC_COLUMN__PEDERSEN__POINTS__X].clone()"
elif addr =... | true | true |
08f6f89fdaffd888ebb0cb188188f17f34da138d | 1,063 | py | Python | listing_6-5.py | PrinceChou/Play-Python-with-Alisa | 808ab2744a99c548de4633b5707af27112bcdccf | [
"Apache-2.0"
] | null | null | null | listing_6-5.py | PrinceChou/Play-Python-with-Alisa | 808ab2744a99c548de4633b5707af27112bcdccf | [
"Apache-2.0"
] | null | null | null | listing_6-5.py | PrinceChou/Play-Python-with-Alisa | 808ab2744a99c548de4633b5707af27112bcdccf | [
"Apache-2.0"
] | null | null | null | # Listing_6-5.py
# Copyright Warren & Carter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Number Guess game using EasyGui
import random, easygui
secret = random.randint(1, 99) # Picks a secret number
guess = 0
... | 33.21875 | 89 | 0.647225 |
import random, easygui
secret = random.randint(1, 99) guess = 0
tries = 0
easygui.msgbox("""AHOY! I'm the Dread Pirate Roberts, and I have a secret!
It is a number from 1 to 99. I'll give you 6 tries.""")
while guess != secret and tries < 6:
guess = easygui.integerbox("What's yer guess, matey?") #... | true | true |
08f6f8a2c5a28803cf89bb83b261db8d138ae881 | 202 | py | Python | shopping_mall/shopping_mall/apps/areas/urls.py | zhangwei-python/Super_shopping_mall | 2a2e233289c1548123b1575eb54548ee5320d73b | [
"MIT"
] | null | null | null | shopping_mall/shopping_mall/apps/areas/urls.py | zhangwei-python/Super_shopping_mall | 2a2e233289c1548123b1575eb54548ee5320d73b | [
"MIT"
] | 9 | 2021-01-06T20:09:46.000Z | 2022-02-27T09:57:27.000Z | shopping_mall/shopping_mall/apps/areas/urls.py | zhangwei-python/Super_shopping_mall | 2a2e233289c1548123b1575eb54548ee5320d73b | [
"MIT"
] | null | null | null | from django.urls import re_path
from areas import views
urlpatterns=[
re_path(r'^areas/$',views.ProvinceAreasView.as_view()),
re_path(r'^areas/(?P<pk>[1-9]\d+)',views.SubAreasView.as_view())
] | 25.25 | 68 | 0.707921 | from django.urls import re_path
from areas import views
urlpatterns=[
re_path(r'^areas/$',views.ProvinceAreasView.as_view()),
re_path(r'^areas/(?P<pk>[1-9]\d+)',views.SubAreasView.as_view())
] | true | true |
08f6f8d27654fca6cdc59a03a03520776db6621e | 4,395 | py | Python | setup.py | diegosucaria/forseti-security | e4ffb1bb229d7abe13212d4162270f88c5923cfd | [
"Apache-2.0"
] | null | null | null | setup.py | diegosucaria/forseti-security | e4ffb1bb229d7abe13212d4162270f88c5923cfd | [
"Apache-2.0"
] | null | null | null | setup.py | diegosucaria/forseti-security | e4ffb1bb229d7abe13212d4162270f88c5923cfd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 27.816456 | 79 | 0.661661 |
import os
import sys
from install.util import build_protos
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install
import google.cloud.forseti
FORSETI_VERSION = google.cloud.forseti.__version__
NAMESPACE_PACKAGES = [
'google',
'google.cloud'
]
REQU... | true | true |
08f6f917b0ab6fc9198bb596c327db576abb7543 | 94 | py | Python | application/main.py | AbyssWatcher-17/DataBaseManagementSystem_Project | b5ad88fef75941e3659f8fd701b7c39aad638b43 | [
"MIT"
] | null | null | null | application/main.py | AbyssWatcher-17/DataBaseManagementSystem_Project | b5ad88fef75941e3659f8fd701b7c39aad638b43 | [
"MIT"
] | null | null | null | application/main.py | AbyssWatcher-17/DataBaseManagementSystem_Project | b5ad88fef75941e3659f8fd701b7c39aad638b43 | [
"MIT"
] | null | null | null | from mainApp import MainApp
if __name__ == "__main__":
app = MainApp()
app.mainloop() | 18.8 | 27 | 0.670213 | from mainApp import MainApp
if __name__ == "__main__":
app = MainApp()
app.mainloop() | true | true |
08f6f98dbc4ce11a714769457f25f066e629029c | 2,717 | py | Python | odoo-13.0/venv/lib/python3.8/site-packages/stdnum/ar/cbu.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/venv/lib/python3.8/site-packages/stdnum/ar/cbu.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | 2 | 2021-06-22T01:34:18.000Z | 2021-06-22T01:40:28.000Z | odoo-13.0/venv/lib/python3.8/site-packages/stdnum/ar/cbu.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # cbu.py - functions for handling Argentinian CBU numbers
# coding: utf-8
#
# Copyright (C) 2016 Luciano Rossi
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of th... | 31.593023 | 76 | 0.710342 |
from stdnum.exceptions import *
from stdnum.util import clean, isdigits
def compact(number):
return clean(number, ' -').strip()
def calc_check_digit(number):
weights = (3, 1, 7, 9)
check = sum(int(n) * weights[i % 4]
for i, n in enumerate(reversed(number)))
return str((10 - check) ... | true | true |
08f6f9fc205d7a8f46516f256ab79f29403073b7 | 3,225 | py | Python | tests/test_writer.py | sqazi/litex-rowhammer-tester | a2350b8066ab4304c49351bddbb72950d0535094 | [
"Apache-2.0"
] | 1 | 2021-05-26T09:25:17.000Z | 2021-05-26T09:25:17.000Z | tests/test_writer.py | sqazi/litex-rowhammer-tester | a2350b8066ab4304c49351bddbb72950d0535094 | [
"Apache-2.0"
] | null | null | null | tests/test_writer.py | sqazi/litex-rowhammer-tester | a2350b8066ab4304c49351bddbb72950d0535094 | [
"Apache-2.0"
] | null | null | null | import unittest
from migen import *
from litedram.common import LiteDRAMNativePort
from rowhammer_tester.gateware.bist import Writer, PatternMemory
class TestWriter(unittest.TestCase):
def test_pattern_1(self):
class DUT(Module):
def __init__(self):
self.dram_port = LiteDRAMNat... | 34.308511 | 99 | 0.550388 | import unittest
from migen import *
from litedram.common import LiteDRAMNativePort
from rowhammer_tester.gateware.bist import Writer, PatternMemory
class TestWriter(unittest.TestCase):
def test_pattern_1(self):
class DUT(Module):
def __init__(self):
self.dram_port = LiteDRAMNat... | true | true |
08f6faac681ecffa3968073ebda90718ee8066e8 | 1,500 | py | Python | examples/quickstart_legacy_rest.py | skunkie/python-ilorest-library | 3904c539e8ec8973c98bcbff5fb6a659d095c41f | [
"Apache-2.0"
] | null | null | null | examples/quickstart_legacy_rest.py | skunkie/python-ilorest-library | 3904c539e8ec8973c98bcbff5fb6a659d095c41f | [
"Apache-2.0"
] | null | null | null | examples/quickstart_legacy_rest.py | skunkie/python-ilorest-library | 3904c539e8ec8973c98bcbff5fb6a659d095c41f | [
"Apache-2.0"
] | null | null | null | ###
# Copyright 2019 Hewlett Packard Enterprise, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 30.612245 | 81 | 0.733333 |
import sys
import redfish
SYSTEM_URL = "https://10.0.0.100"
LOGIN_ACCOUNT = "admin"
LOGIN_PASSWORD = "password"
REST_OBJ = redfish.LegacyRestClient(base_url=SYSTEM_URL, username=LOGIN_ACCOUNT,\
password=LOGIN_PASSWORD)
REST_OBJ.login(auth="session")
RESPONSE = REST_OBJ.get("/r... | true | true |
08f6fb53238e1584db93327d455d3cd30b672500 | 36,496 | py | Python | chapter6.py | eliben/pykaleidoscope | 977d234e7bffb01e3dc91f6dd862bb03ada1063b | [
"Unlicense"
] | 291 | 2015-02-09T00:15:50.000Z | 2022-03-24T05:13:14.000Z | chapter6.py | eliben/pykaleidoscope | 977d234e7bffb01e3dc91f6dd862bb03ada1063b | [
"Unlicense"
] | 2 | 2016-11-19T04:25:35.000Z | 2020-02-04T14:49:49.000Z | chapter6.py | eliben/pykaleidoscope | 977d234e7bffb01e3dc91f6dd862bb03ada1063b | [
"Unlicense"
] | 41 | 2015-02-09T13:48:24.000Z | 2021-08-17T04:43:22.000Z | # Chapter 6 - Extending the language: User-defined Operators
from collections import namedtuple
from ctypes import CFUNCTYPE, c_double
from enum import Enum
import llvmlite.ir as ir
import llvmlite.binding as llvm
# Each token is a tuple of kind and value. kind is one of the enumeration values
# in TokenKind. value... | 36.242304 | 80 | 0.591654 |
from collections import namedtuple
from ctypes import CFUNCTYPE, c_double
from enum import Enum
import llvmlite.ir as ir
import llvmlite.binding as llvm
class TokenKind(Enum):
EOF = -1
DEF = -2
EXTERN = -3
IDENTIFIER = -4
NUMBER = -5
OPERATOR = -6
IF = -7
THEN = -8
ELSE = -9
... | true | true |
08f6fbe2a87af578cb378bc5e9058f5fbd9c21b3 | 1,325 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/region_AD.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_AD.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_AD.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. AD metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AD = PhoneMetadata(id='AD', country_code=376, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[16]\\d{5,8}|[37-9]\\d{5}', possible... | 94.642857 | 139 | 0.691321 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AD = PhoneMetadata(id='AD', country_code=376, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[16]\\d{5,8}|[37-9]\\d{5}', possible_length=(6, 8, 9)),
fixed_line=PhoneNumberDesc(national_... | true | true |
08f6fc449330d838ff61bb84f11a203df327f605 | 16,707 | py | Python | dom_average.py | jenna-h/dominion-data | c55ca165e5bff899443dfb3f73379775beadf53e | [
"MIT"
] | null | null | null | dom_average.py | jenna-h/dominion-data | c55ca165e5bff899443dfb3f73379775beadf53e | [
"MIT"
] | null | null | null | dom_average.py | jenna-h/dominion-data | c55ca165e5bff899443dfb3f73379775beadf53e | [
"MIT"
] | null | null | null | from PIL import Image
import numpy
import os
import requests
import shutil
IM_WIDTH, IM_HEIGHT = 309, 496
HORIZ_IM_WIDTH, HORIZ_IM_HEIGHT = 473, 290
ALL_CARDS_STRING = '''Black Market Promo 10
Church Promo 10
Dismantle Promo 10
Envoy Promo 10
Sauna Promo 5
Avanto Promo 5
Walled Village Promo 10
Governor Promo 10
Capta... | 24.714497 | 113 | 0.785479 | from PIL import Image
import numpy
import os
import requests
import shutil
IM_WIDTH, IM_HEIGHT = 309, 496
HORIZ_IM_WIDTH, HORIZ_IM_HEIGHT = 473, 290
ALL_CARDS_STRING = '''Black Market Promo 10
Church Promo 10
Dismantle Promo 10
Envoy Promo 10
Sauna Promo 5
Avanto Promo 5
Walled Village Promo 10
Governor Promo 10
Capta... | true | true |
08f6ff65b559730fab45ff00eb08c30b85e9615a | 2,785 | py | Python | tests/test_transformation/test_log_transformer.py | SunnyxBd/feature_engine | e40457ce8b4baa1e146976bf1af1bbdf6eae1305 | [
"BSD-3-Clause"
] | 1 | 2020-10-22T21:49:38.000Z | 2020-10-22T21:49:38.000Z | tests/test_transformation/test_log_transformer.py | SunnyxBd/feature_engine | e40457ce8b4baa1e146976bf1af1bbdf6eae1305 | [
"BSD-3-Clause"
] | 3 | 2020-10-27T16:27:49.000Z | 2020-11-13T13:22:08.000Z | tests/test_transformation/test_log_transformer.py | SunnyxBd/feature_engine | e40457ce8b4baa1e146976bf1af1bbdf6eae1305 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import pytest
from sklearn.exceptions import NotFittedError
from feature_engine.transformation import LogTransformer
def test_log_base_e_plus_automatically_find_variables(df_vartypes):
# test case 1: log base e, automatically select variables
transformer = LogTransformer(base="e", variab... | 32.011494 | 77 | 0.71167 | import pandas as pd
import pytest
from sklearn.exceptions import NotFittedError
from feature_engine.transformation import LogTransformer
def test_log_base_e_plus_automatically_find_variables(df_vartypes):
transformer = LogTransformer(base="e", variables=None)
X = transformer.fit_transform(df_vartypes)
... | true | true |
08f6ff69efb643e3e52f231a3715ec5032ec459d | 2,044 | py | Python | tricircleclient/osc.py | electrocucaracha/python-tricircleclient | 27bfddea9d3d13670b4aae40698b88751633132f | [
"Apache-2.0"
] | null | null | null | tricircleclient/osc.py | electrocucaracha/python-tricircleclient | 27bfddea9d3d13670b4aae40698b88751633132f | [
"Apache-2.0"
] | null | null | null | tricircleclient/osc.py | electrocucaracha/python-tricircleclient | 27bfddea9d3d13670b4aae40698b88751633132f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 32.967742 | 69 | 0.717221 |
from osc_lib import utils
DEFAULT_MULTIREGION_NETWORKING_API_VERSION = '1'
API_NAME = 'multiregion_networking'
API_VERSION_OPTION = 'os_multiregion_networking_api_version'
API_VERSIONS = {
'1': 'tricircleclient.v1.client.Client',
}
def make_client(instance):
plugin_client = utils.get_client_class(
... | true | true |
08f7004b45446f558f6d0f016eecb4febe4ace28 | 6,397 | py | Python | SFS.py | evodify/population-genetic-analyses | 5295f9d68736ac02fc5f3ece43dadd5bf4e98e6f | [
"MIT"
] | 3 | 2018-01-31T09:57:10.000Z | 2021-02-03T18:34:01.000Z | SFS.py | evodify/population-genetic-analyses | 5295f9d68736ac02fc5f3ece43dadd5bf4e98e6f | [
"MIT"
] | null | null | null | SFS.py | evodify/population-genetic-analyses | 5295f9d68736ac02fc5f3ece43dadd5bf4e98e6f | [
"MIT"
] | 1 | 2019-09-02T06:13:29.000Z | 2019-09-02T06:13:29.000Z | #! /usr/bin/env python
'''
This script reconstructs the site frequency spectrum for a given set of samples.
input.file:
#CHROM xPOS sample1 sample2 sample3 sample4 sample5 sample6 sample7 sample8 sample9 sample10 sample11 sample12 sample13 sample14 sample15 sample16 sample17 sample18 sample19 sample20 sample21 sample... | 31.985 | 355 | 0.6539 | '''
This script reconstructs the site frequency spectrum for a given set of samples.
input.file:
#CHROM xPOS sample1 sample2 sample3 sample4 sample5 sample6 sample7 sample8 sample9 sample10 sample11 sample12 sample13 sample14 sample15 sample16 sample17 sample18 sample19 sample20 sample21 sample22
scaffold_1 585 C C C... | false | true |
08f7015d2835dcc1e926fd4acbcfff51249816e9 | 1,186 | py | Python | app/main/views.py | josphat-otieno/news-app | e6ff307230bd2cab787489fca4850004cd9bdbd0 | [
"MIT"
] | null | null | null | app/main/views.py | josphat-otieno/news-app | e6ff307230bd2cab787489fca4850004cd9bdbd0 | [
"MIT"
] | null | null | null | app/main/views.py | josphat-otieno/news-app | e6ff307230bd2cab787489fca4850004cd9bdbd0 | [
"MIT"
] | 1 | 2022-02-28T22:33:33.000Z | 2022-02-28T22:33:33.000Z | from flask import render_template,request, redirect, url_for
from . import main
from ..requests import get_articles, get_news_sources,get_top_headlines, get_news_category
@main.route('/')
def index():
'''
view root function that returns the idex page and its data
'''
title="Welcome to your favorite new... | 34.882353 | 120 | 0.729342 | from flask import render_template,request, redirect, url_for
from . import main
from ..requests import get_articles, get_news_sources,get_top_headlines, get_news_category
@main.route('/')
def index():
title="Welcome to your favorite news app"
message='Read your favorite news here'
news_sources=get_news_sou... | true | true |
08f70209179fb1f25f6c686b3aa9927ae4871797 | 569 | py | Python | channels_project/chat/migrations/0002_auto_20211019_1440.py | zLianK/django-channels-chat | bbc0fb224f736f0a7ded6a4950481c15ee2e24aa | [
"MIT"
] | 1 | 2021-12-08T22:33:20.000Z | 2021-12-08T22:33:20.000Z | channels_project/chat/migrations/0002_auto_20211019_1440.py | zLianK/django-channels-chat | bbc0fb224f736f0a7ded6a4950481c15ee2e24aa | [
"MIT"
] | null | null | null | channels_project/chat/migrations/0002_auto_20211019_1440.py | zLianK/django-channels-chat | bbc0fb224f736f0a7ded6a4950481c15ee2e24aa | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-19 17:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chat', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='chatgroup',
name='last_change_1',
... | 23.708333 | 62 | 0.585237 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chat', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='chatgroup',
name='last_change_1',
field=models.DateTimeField(blank=True, nul... | true | true |
08f702732543d36c7494fb18b68187dd53101ba4 | 1,762 | py | Python | examples/nats-sub/__main__.py | ckim0419/python-nats | f700843a90fa5994adb61f9da0cd832e4ed86617 | [
"Apache-2.0"
] | null | null | null | examples/nats-sub/__main__.py | ckim0419/python-nats | f700843a90fa5994adb61f9da0cd832e4ed86617 | [
"Apache-2.0"
] | null | null | null | examples/nats-sub/__main__.py | ckim0419/python-nats | f700843a90fa5994adb61f9da0cd832e4ed86617 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2018 The NATS 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 or agreed to in writi... | 28.885246 | 74 | 0.685585 |
import argparse, sys
import tornado.ioloop
import tornado.gen
import time
from nats.io.client import Client as NATS
def show_usage():
print("nats-sub SUBJECT [-s SERVER] [-q QUEUE]")
def show_usage_and_die():
show_usage()
sys.exit(1)
@tornado.gen.coroutine
def main():
parser = argparse.ArgumentParser... | true | true |
08f702ab84cc9a834598c37ae3881115c979e62e | 32,062 | py | Python | Bio/SCOP/__init__.py | emedgene/biopython | 4e359e2aa9255aa8b420ad512d3c4cbe15c07a35 | [
"BSD-3-Clause"
] | 2 | 2019-11-21T02:34:52.000Z | 2021-02-14T07:47:43.000Z | Bio/SCOP/__init__.py | EngineerKhan/biopython | 4e359e2aa9255aa8b420ad512d3c4cbe15c07a35 | [
"BSD-3-Clause"
] | null | null | null | Bio/SCOP/__init__.py | EngineerKhan/biopython | 4e359e2aa9255aa8b420ad512d3c4cbe15c07a35 | [
"BSD-3-Clause"
] | 1 | 2021-02-14T07:47:46.000Z | 2021-02-14T07:47:46.000Z | # Copyright 2001 by Gavin E. Crooks. All rights reserved.
# Modifications Copyright 2004/2005 James Casbon. All rights Reserved.
# Modifications Copyright 2010 Jeffrey Finkelstein. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that ... | 35.664071 | 103 | 0.561412 |
from __future__ import print_function
import os
import re
from . import Des
from . import Cla
from . import Hie
from . import Residues
from Bio import SeqIO
from Bio.Seq import Seq
nodeCodeDict = {'cl': 'class', 'cf': 'fold', 'sf': 'superfamily',
'fa': 'family', 'dm': 'protein', 'sp': 'species', ... | true | true |
08f70603375e75bfcc7c50d200521b1fa1962c33 | 103 | py | Python | Day3/calculate price's with loop.py | ColdTears619/My100DaysOfCode | aa33d721a0fa71b2e2c5ebf5b22594f40e443f68 | [
"MIT"
] | 1 | 2021-12-25T16:18:42.000Z | 2021-12-25T16:18:42.000Z | Day3/calculate price's with loop.py | ColdTears619/My100DaysOfCode | aa33d721a0fa71b2e2c5ebf5b22594f40e443f68 | [
"MIT"
] | null | null | null | Day3/calculate price's with loop.py | ColdTears619/My100DaysOfCode | aa33d721a0fa71b2e2c5ebf5b22594f40e443f68 | [
"MIT"
] | null | null | null | price = [10,20,30]
sum = 0
for i in price:
sum = sum + i
print(f"total price in shop is : {sum}")
| 14.714286 | 40 | 0.582524 | price = [10,20,30]
sum = 0
for i in price:
sum = sum + i
print(f"total price in shop is : {sum}")
| true | true |
08f7081e4e132b89fe75e8a0fa5b7e1d2ff5153e | 186 | py | Python | Machine Learning Summer School 2019 (Moscow, Russia)/tutorials/kernels/probability_testing/support/__init__.py | xuedong/rlss2019 | d7468c2fcf269d8afd6fb0f44993aa9797867944 | [
"MIT"
] | null | null | null | Machine Learning Summer School 2019 (Moscow, Russia)/tutorials/kernels/probability_testing/support/__init__.py | xuedong/rlss2019 | d7468c2fcf269d8afd6fb0f44993aa9797867944 | [
"MIT"
] | null | null | null | Machine Learning Summer School 2019 (Moscow, Russia)/tutorials/kernels/probability_testing/support/__init__.py | xuedong/rlss2019 | d7468c2fcf269d8afd6fb0f44993aa9797867944 | [
"MIT"
] | null | null | null | # flake8: noqa
import sys
assert sys.version_info >= (3, 6)
from .kernels import LazyKernel
from .mmd import mmd2_u_stat_variance
from .utils import as_tensors, maybe_squeeze, pil_grid
| 23.25 | 54 | 0.795699 | import sys
assert sys.version_info >= (3, 6)
from .kernels import LazyKernel
from .mmd import mmd2_u_stat_variance
from .utils import as_tensors, maybe_squeeze, pil_grid
| true | true |
08f708e448e360bca7fe4f434302f704033037a6 | 3,900 | py | Python | BRL/edge_matrix/fileLoader.py | kidrabit/Data-Visualization-Lab-RND | baa19ee4e9f3422a052794e50791495632290b36 | [
"Apache-2.0"
] | 1 | 2022-01-18T01:53:34.000Z | 2022-01-18T01:53:34.000Z | BRL/edge_matrix/fileLoader.py | kidrabit/Data-Visualization-Lab-RND | baa19ee4e9f3422a052794e50791495632290b36 | [
"Apache-2.0"
] | null | null | null | BRL/edge_matrix/fileLoader.py | kidrabit/Data-Visualization-Lab-RND | baa19ee4e9f3422a052794e50791495632290b36 | [
"Apache-2.0"
] | null | null | null | class FileLoader:
def __init__(self):
self.dataFileName = "./static/1.input"
self.lineLen = [115, 30, 20, 20]
self.matrials = []
self.splitTexts = []
self.splitTexts.append("! No. type I J K\n") # type 1 and 2
#self.splitTexts.append("! No. type I J ... | 28.888889 | 125 | 0.608205 | class FileLoader:
def __init__(self):
self.dataFileName = "./static/1.input"
self.lineLen = [115, 30, 20, 20]
self.matrials = []
self.splitTexts = []
self.splitTexts.append("! No. type I J K\n") self.splitTexts.append(" 0.5 0.5 50 100 \n"... | true | true |
08f70944e3a6401dddea4abf0f963c6722df1aff | 1,418 | py | Python | test/functional/sample_ta/Splunk_TA_mytest_kvstore/bin/splunk_ta_mytest_kvstore_rh_inputs_okta_kv_2.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | test/functional/sample_ta/Splunk_TA_mytest_kvstore/bin/splunk_ta_mytest_kvstore_rh_inputs_okta_kv_2.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | test/functional/sample_ta/Splunk_TA_mytest_kvstore/bin/splunk_ta_mytest_kvstore_rh_inputs_okta_kv_2.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null |
import splunk_ta_mytest_kvstore_import_declare
from splunktaucclib.rest_handler.endpoint import (
field,
validator,
RestModel,
DataInputModel,
)
from splunktaucclib.rest_handler import admin_external, util
from splunktaucclib.rest_handler.admin_external import AdminExternalHandler
util.remove_http_pr... | 18.906667 | 75 | 0.612835 |
import splunk_ta_mytest_kvstore_import_declare
from splunktaucclib.rest_handler.endpoint import (
field,
validator,
RestModel,
DataInputModel,
)
from splunktaucclib.rest_handler import admin_external, util
from splunktaucclib.rest_handler.admin_external import AdminExternalHandler
util.remove_http_pr... | true | true |
08f709982f55cbbaffc7ebc159279a898adbb002 | 2,329 | py | Python | HM-DenseED/utils/mcs_data_upload.py | zabaras/bayesmultiscale | c2f7d36e8ff08a28e5da0809029143a9dd0e2777 | [
"MIT"
] | null | null | null | HM-DenseED/utils/mcs_data_upload.py | zabaras/bayesmultiscale | c2f7d36e8ff08a28e5da0809029143a9dd0e2777 | [
"MIT"
] | null | null | null | HM-DenseED/utils/mcs_data_upload.py | zabaras/bayesmultiscale | c2f7d36e8ff08a28e5da0809029143a9dd0e2777 | [
"MIT"
] | 1 | 2021-09-20T16:25:43.000Z | 2021-09-20T16:25:43.000Z | import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import scipy.io as io
import sys
import h5py
from args import args, device
class Dataset(torch.utils.data.Dataset):
def __len__(self):
return args.nmcs
def __getitem__(self, idx):
... | 37.564516 | 124 | 0.620867 | import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import scipy.io as io
import sys
import h5py
from args import args, device
class Dataset(torch.utils.data.Dataset):
def __len__(self):
return args.nmcs
def __getitem__(self, idx):
... | true | true |
08f709ff177bb6cd6877a8a117ca6c034659e716 | 25,462 | py | Python | qa/rpc-tests/fundrawtransaction-hd.py | brexocoin/brexocoin | 3e23592e49baff77efb934f0d955b5b144d0a520 | [
"MIT"
] | null | null | null | qa/rpc-tests/fundrawtransaction-hd.py | brexocoin/brexocoin | 3e23592e49baff77efb934f0d955b5b144d0a520 | [
"MIT"
] | null | null | null | qa/rpc-tests/fundrawtransaction-hd.py | brexocoin/brexocoin | 3e23592e49baff77efb934f0d955b5b144d0a520 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... | 40.674121 | 214 | 0.558676 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class RawTransactionsTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 4
def setup_network(self, split=False):
self... | true | true |
08f70abfe8c04ddc77c8562ac0038607fab620a5 | 1,448 | py | Python | consumers/faust_project/medicare/models.py | cfloressuazo/science-streaming | ef38624743128c0d1ff9b8c199f9c748678aa48a | [
"MIT"
] | null | null | null | consumers/faust_project/medicare/models.py | cfloressuazo/science-streaming | ef38624743128c0d1ff9b8c199f9c748678aa48a | [
"MIT"
] | null | null | null | consumers/faust_project/medicare/models.py | cfloressuazo/science-streaming | ef38624743128c0d1ff9b8c199f9c748678aa48a | [
"MIT"
] | null | null | null | import faust
from dataclasses_avroschema import AvroModel
class MedicareKeyModel(faust.Record, serializer='avro_medicare_key'):
npi: int
class MedicareValueModel(faust.Record, serializer='avro_medicare_value'):
npi: int
nppes_provider_last_org_name: str
nppes_provider_first_name: str
nppes_prov... | 28.96 | 93 | 0.77279 | import faust
from dataclasses_avroschema import AvroModel
class MedicareKeyModel(faust.Record, serializer='avro_medicare_key'):
npi: int
class MedicareValueModel(faust.Record, serializer='avro_medicare_value'):
npi: int
nppes_provider_last_org_name: str
nppes_provider_first_name: str
nppes_prov... | true | true |
08f70b4d64570c32f03b9151ccc5082d2b6e1c8a | 542 | py | Python | examples/api/level_names.py | nekitdev/gd.py | b9d5e29c09f953f54b9b648fb677e987d9a8e103 | [
"MIT"
] | 58 | 2020-09-30T16:51:22.000Z | 2022-02-13T17:27:48.000Z | examples/api/level_names.py | NeKitDS/gd.py | b9d5e29c09f953f54b9b648fb677e987d9a8e103 | [
"MIT"
] | 30 | 2019-07-29T12:03:41.000Z | 2020-09-15T17:01:37.000Z | examples/api/level_names.py | NeKitDS/gd.py | b9d5e29c09f953f54b9b648fb677e987d9a8e103 | [
"MIT"
] | 20 | 2019-12-06T03:16:57.000Z | 2020-09-16T17:45:27.000Z | import gd
database = gd.api.save.load() # load local database (save)
levels = database.get_created_levels() # get created levels
# align indexes using the largest one
index_align = len(str(len(levels)))
# align names using the longest one
name_align = max((len(level.name) for level in levels), default=0)
for inde... | 33.875 | 82 | 0.688192 | import gd
database = gd.api.save.load()
levels = database.get_created_levels()
index_align = len(str(len(levels)))
name_align = max((len(level.name) for level in levels), default=0)
for index, level in enumerate(levels): print(f"{index:<{index_align}} | {level.name:>{name_align}} | ID: {level.id}")
| true | true |
08f70c48fe9535d6c7b2cd6011b466e348029776 | 7,618 | py | Python | angr/analyses/cfg/cfg_utils.py | delia0204/angr | 0fd71a73d36b8a6e441634d21bad947c7e5a7def | [
"BSD-2-Clause"
] | 1 | 2021-05-25T21:23:38.000Z | 2021-05-25T21:23:38.000Z | angr/analyses/cfg/cfg_utils.py | sch3m4/angr | 654350ff4bafdb7df25f2992ba1de00b15282fc0 | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/cfg/cfg_utils.py | sch3m4/angr | 654350ff4bafdb7df25f2992ba1de00b15282fc0 | [
"BSD-2-Clause"
] | 1 | 2019-08-07T01:42:01.000Z | 2019-08-07T01:42:01.000Z |
from collections import defaultdict
import networkx
class SCCPlaceholder(object):
__slots__ = ['scc_id']
def __init__(self, scc_id):
self.scc_id = scc_id
def __eq__(self, other):
return isinstance(other, SCCPlaceholder) and other.scc_id == self.scc_id
def __hash__(self):
r... | 35.765258 | 118 | 0.623917 |
from collections import defaultdict
import networkx
class SCCPlaceholder(object):
__slots__ = ['scc_id']
def __init__(self, scc_id):
self.scc_id = scc_id
def __eq__(self, other):
return isinstance(other, SCCPlaceholder) and other.scc_id == self.scc_id
def __hash__(self):
r... | true | true |
08f710941a3dd4f170ae124758e9ed63ff0fb19a | 4,364 | py | Python | minimax.py | LatvianPython/tic-tac-toe | 75cac6887e4a157a32ec189eb70faebaf0f437b4 | [
"MIT"
] | null | null | null | minimax.py | LatvianPython/tic-tac-toe | 75cac6887e4a157a32ec189eb70faebaf0f437b4 | [
"MIT"
] | null | null | null | minimax.py | LatvianPython/tic-tac-toe | 75cac6887e4a157a32ec189eb70faebaf0f437b4 | [
"MIT"
] | null | null | null | import random
import sys
class TicTacToe:
player_x = 1
player_o = 0
def __init__(self, ai_only=False):
self.current_game_state = 0
self.transposition_table = {}
self.current_player_move = self.player_x
self.ai_only = ai_only
self.mini_max(self.current_game_state, 0... | 31.623188 | 116 | 0.5967 | import random
import sys
class TicTacToe:
player_x = 1
player_o = 0
def __init__(self, ai_only=False):
self.current_game_state = 0
self.transposition_table = {}
self.current_player_move = self.player_x
self.ai_only = ai_only
self.mini_max(self.current_game_state, 0... | true | true |
08f712263841635e2d02b48e5d3812b16eb724e9 | 5,437 | py | Python | fkie_node_manager_daemon/src/fkie_node_manager_daemon/server.py | arpg/multimaster_fkie | fa7eb29c9f3fc8b5dff883ab55bfbc8d696dcad1 | [
"BSD-3-Clause"
] | null | null | null | fkie_node_manager_daemon/src/fkie_node_manager_daemon/server.py | arpg/multimaster_fkie | fa7eb29c9f3fc8b5dff883ab55bfbc8d696dcad1 | [
"BSD-3-Clause"
] | null | null | null | fkie_node_manager_daemon/src/fkie_node_manager_daemon/server.py | arpg/multimaster_fkie | fa7eb29c9f3fc8b5dff883ab55bfbc8d696dcad1 | [
"BSD-3-Clause"
] | null | null | null | # Software License Agreement (BSD License)
#
# Copyright (c) 2018, Fraunhofer FKIE/CMS, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mu... | 46.470085 | 96 | 0.743609 |
from __future__ import division, absolute_import, print_function, unicode_literals
from concurrent import futures
import grpc
import rospy
import time
from fkie_multimaster_msgs.srv import LoadLaunch, LoadLaunchResponse
import fkie_multimaster_msgs.grpc.file_pb2_grpc as fgrpc
import fkie_multimaster_msgs.grpc.launch... | true | true |
08f71310f3357fefeafd276f7d57e4ab693c84b5 | 1,966 | py | Python | py/tests/unit/with_runtime_sparkling/test_drf.py | kmullapudi-11/sparkling-water | 9b43bc82b0fc6f1be7c23ed7f65cd42c14e5887e | [
"Apache-2.0"
] | null | null | null | py/tests/unit/with_runtime_sparkling/test_drf.py | kmullapudi-11/sparkling-water | 9b43bc82b0fc6f1be7c23ed7f65cd42c14e5887e | [
"Apache-2.0"
] | null | null | null | py/tests/unit/with_runtime_sparkling/test_drf.py | kmullapudi-11/sparkling-water | 9b43bc82b0fc6f1be7c23ed7f65cd42c14e5887e | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 38.54902 | 94 | 0.736012 |
import os
from pyspark.ml import Pipeline, PipelineModel
from pyspark.mllib.linalg import *
from pyspark.mllib.linalg import *
from pyspark.sql.types import *
from pyspark.sql.types import *
from pysparkling.ml import H2ODRF
from tests.unit.with_runtime_sparkling.algo_test_utils import *
def testParamsPassedByConst... | true | true |
08f7132e3f69a513c134f3d254ed6695a1cb1f90 | 8,006 | py | Python | vision/nodes/template_tracker.py | dan-git/outdoor_bot | 81bf75e26449f8e4b6a38f4049ca4d4cda7b8c04 | [
"BSD-2-Clause"
] | null | null | null | vision/nodes/template_tracker.py | dan-git/outdoor_bot | 81bf75e26449f8e4b6a38f4049ca4d4cda7b8c04 | [
"BSD-2-Clause"
] | null | null | null | vision/nodes/template_tracker.py | dan-git/outdoor_bot | 81bf75e26449f8e4b6a38f4049ca4d4cda7b8c04 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
""" template_tracker.py - Version 1.0 2012-02-28
Based on the C++ FastMatchTemplate code by Tristen Georgiou:
http://opencv.willowgarage.com/wiki/FastMatchTemplate
"""
import roslib; roslib.load_manifest('rbx1_vision')
import rospy
from ros2opencv2 import ROS2OpenCV2
from sensor_msgs.... | 38.676329 | 161 | 0.565701 |
""" template_tracker.py - Version 1.0 2012-02-28
Based on the C++ FastMatchTemplate code by Tristen Georgiou:
http://opencv.willowgarage.com/wiki/FastMatchTemplate
"""
import roslib; roslib.load_manifest('rbx1_vision')
import rospy
from ros2opencv2 import ROS2OpenCV2
from sensor_msgs.msg import Image, ... | false | true |
08f71384fcdcb18ce662466093c166cf8979dc11 | 14,155 | py | Python | salt/modules/rabbitmq.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/modules/rabbitmq.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/modules/rabbitmq.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Module to provide RabbitMQ compatibility to Salt.
Todo: A lot, need to add cluster support, logging, and minion configuration
data.
'''
# Import salt libs
import salt.utils
# Import python libs
import logging
import random
import string
log = logging.getLogger(__name__)
def __virtual__(... | 22.867528 | 83 | 0.598304 |
import salt.utils
import logging
import random
import string
log = logging.getLogger(__name__)
def __virtual__():
return salt.utils.which('rabbitmqctl') is not None
def _format_response(response, msg):
if isinstance(response, dict):
if response['retcode'] != 0:
msg = 'Error'
e... | true | true |
08f7138ab6fa564a39f2b6cd87e3dbd4d7ce32e0 | 5,726 | py | Python | docs/conf.py | LF2L/OPEN | 4ed3f79be0b128ce623e48758d48eae30c4e7686 | [
"Apache-2.0"
] | 41 | 2020-07-10T17:58:03.000Z | 2022-03-31T02:21:52.000Z | docs/conf.py | LF2L/OPEN | 4ed3f79be0b128ce623e48758d48eae30c4e7686 | [
"Apache-2.0"
] | 2 | 2020-01-06T11:18:32.000Z | 2020-01-06T11:18:33.000Z | docs/conf.py | LF2L/OPEN | 4ed3f79be0b128ce623e48758d48eae30c4e7686 | [
"Apache-2.0"
] | 15 | 2020-05-14T01:56:16.000Z | 2022-02-15T12:15:14.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 ------------------------------------------------------------... | 30.784946 | 164 | 0.654384 |
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
project = u'OPEN'
copyright = u'2019, Thomas Morstyn, Avinash Vijay, Katherine Collet, Filiberto Fele, Matthew Deakin, Sivapriya Mothilal Bhagavathy, Scot Wheeler, Malcolm McCulloch'
author = u'Thomas Morstyn, Avinash Vijay, Katherine Collet, Filibert... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.