hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790bc46c1ca684242c3375cd3c7dd7464b95ae8e | 1,901 | py | Python | tiktok_bot/models/comment.py | reliefs/tiktok_bot | 30404c0cd9ae1d52eb5b8818fbf282af1f68ee7a | [
"MIT"
] | 118 | 2019-10-22T07:56:34.000Z | 2022-03-30T11:33:25.000Z | tiktok_bot/models/comment.py | reliefs/tiktok_bot | 30404c0cd9ae1d52eb5b8818fbf282af1f68ee7a | [
"MIT"
] | 14 | 2019-10-27T00:06:29.000Z | 2020-12-30T09:10:43.000Z | tiktok_bot/models/comment.py | reliefs/tiktok_bot | 30404c0cd9ae1d52eb5b8818fbf282af1f68ee7a | [
"MIT"
] | 40 | 2019-10-27T15:46:58.000Z | 2022-03-15T00:21:47.000Z | from typing import List, Optional
from pydantic import BaseModel
from typing_extensions import Literal
from .request import BaseResponseData, CountOffsetParams, ListRequestParams, ListResponseData
from .tag import Tag
from .user import CommonUserDetails
class Comment(BaseModel):
# The ID of the post
aweme_i... | 22.630952 | 93 | 0.696476 | from typing import List, Optional
from pydantic import BaseModel
from typing_extensions import Literal
from .request import BaseResponseData, CountOffsetParams, ListRequestParams, ListResponseData
from .tag import Tag
from .user import CommonUserDetails
class Comment(BaseModel):
aweme_id: str
cid... | true | true |
790bc527f550caf6d6c3c54aa154d04198b28640 | 2,339 | py | Python | src/playthrough-bot/models/alembic/env.py | Rain288/playthrough-bot | 9ddefa336bf59cf8ab4a1de83ff4c4777195619b | [
"MIT"
] | 1 | 2019-02-02T03:58:05.000Z | 2019-02-02T03:58:05.000Z | src/playthrough-bot/models/alembic/env.py | Rain288/playthrough-bot | 9ddefa336bf59cf8ab4a1de83ff4c4777195619b | [
"MIT"
] | 1 | 2019-02-02T03:58:05.000Z | 2019-02-10T14:51:05.000Z | src/playthrough-bot/models/alembic/env.py | evangelos-ch/playthrough-bot | 9ddefa336bf59cf8ab4a1de83ff4c4777195619b | [
"MIT"
] | null | null | null | # pylint: disable=no-member
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from playthrough-bot.models import ModelBase, get_engine
# this is the Alembic Config object, which provides
# access to the values within the .ini file... | 26.885057 | 80 | 0.70714 |
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from playthrough-bot.models import ModelBase, get_engine
config = context.config
config.set_main_option("sqlalchemy.url", str(get_engine().url))
fileConfig(config.config_fil... | false | true |
790bc552861a63a0b44e136084ced7fa30eddacf | 120 | py | Python | Regex/Capturing & Non-Capturing Groups.py | rafaelgreca/hackerrank-solutions | 2be6c8fdd9b7f2ab3a678e7dcdc27e730edfaef3 | [
"MIT"
] | 2 | 2020-05-28T07:15:00.000Z | 2020-07-21T08:34:06.000Z | Regex/Capturing & Non-Capturing Groups.py | rafaelgreca/hackerrank-solutions | 2be6c8fdd9b7f2ab3a678e7dcdc27e730edfaef3 | [
"MIT"
] | null | null | null | Regex/Capturing & Non-Capturing Groups.py | rafaelgreca/hackerrank-solutions | 2be6c8fdd9b7f2ab3a678e7dcdc27e730edfaef3 | [
"MIT"
] | null | null | null | Regex_Pattern = r'(ok){3,}' # Do not delete 'r'.
import re
print(str(bool(re.search(Regex_Pattern, input()))).lower()) | 24 | 59 | 0.666667 | Regex_Pattern = r'(ok){3,}'
import re
print(str(bool(re.search(Regex_Pattern, input()))).lower()) | true | true |
790bc55d23e266c9aec44d33c5233dd226e9045f | 746 | py | Python | botblox_config/data_manager/erase.py | ararobotique/botblox-manager-software | 64c5c893601ea62a7ac414023455e8c2da04816d | [
"MIT"
] | 6 | 2021-04-18T21:30:17.000Z | 2022-01-13T06:37:43.000Z | botblox_config/data_manager/erase.py | ararobotique/botblox-manager-software | 64c5c893601ea62a7ac414023455e8c2da04816d | [
"MIT"
] | 36 | 2020-12-16T12:29:24.000Z | 2021-09-18T14:52:25.000Z | botblox_config/data_manager/erase.py | ararobotique/botblox-manager-software | 64c5c893601ea62a7ac414023455e8c2da04816d | [
"MIT"
] | 2 | 2021-04-08T20:27:48.000Z | 2021-08-30T17:32:28.000Z | from argparse import Action, Namespace
from typing import (List)
from .switch_config import SwitchConfigCLI
from ..switch import SwitchChip
class EraseConfigCLI(SwitchConfigCLI):
"""
The "erase" action that removes all stored items from the EEPROM memory.
"""
def __init__(self, subparsers: Action, sw... | 28.692308 | 76 | 0.670241 | from argparse import Action, Namespace
from typing import (List)
from .switch_config import SwitchConfigCLI
from ..switch import SwitchChip
class EraseConfigCLI(SwitchConfigCLI):
def __init__(self, subparsers: Action, switch: SwitchChip) -> None:
super().__init__(subparsers, switch)
self._subpar... | true | true |
790bc6fa7673a8d96d10c13fc38f867949e749dc | 2,324 | py | Python | ucscsdk/mometa/adaptor/AdaptorEthCompQueueProfile.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | null | null | null | ucscsdk/mometa/adaptor/AdaptorEthCompQueueProfile.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | null | null | null | ucscsdk/mometa/adaptor/AdaptorEthCompQueueProfile.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for AdaptorEthCompQueueProfile ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class AdaptorEthCompQueueProfileConsts():
pass
class AdaptorEthCompQueueProfil... | 49.446809 | 283 | 0.669105 |
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class AdaptorEthCompQueueProfileConsts():
pass
class AdaptorEthCompQueueProfile(ManagedObject):
consts = AdaptorEthCompQueueProfileConsts()
naming_props = set([])
... | true | true |
790bc74afceb54e8f3e9d007005e22897ef55221 | 6,404 | py | Python | mycroft/skills/common_query_skill.py | assistent-cat/mycroft-core | 6f8bae6ba136c9dd66ca47aaadd75e214d006190 | [
"Apache-2.0"
] | 2 | 2021-04-05T22:28:37.000Z | 2021-06-16T00:24:41.000Z | mycroft/skills/common_query_skill.py | assistent-cat/mycroft-core | 6f8bae6ba136c9dd66ca47aaadd75e214d006190 | [
"Apache-2.0"
] | 4 | 2021-06-08T20:55:12.000Z | 2022-03-12T00:15:06.000Z | mycroft/skills/common_query_skill.py | assistent-cat/mycroft-core | 6f8bae6ba136c9dd66ca47aaadd75e214d006190 | [
"Apache-2.0"
] | 2 | 2020-09-28T01:38:34.000Z | 2020-12-03T03:14:32.000Z | # Copyright 2018 Mycroft AI 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 writin... | 39.288344 | 78 | 0.626327 |
from enum import IntEnum
from abc import ABC, abstractmethod
from .mycroft_skill import MycroftSkill
class CQSMatchLevel(IntEnum):
EXACT = 1
CATEGORY = 2
GENERAL = 3
CQSVisualMatchLevel = IntEnum('CQSVisualMatchLevel',
[e.name for e in CQSMatchLevel])
... | true | true |
790bc912b9632f19ea762af1efef5229f787d170 | 27,416 | py | Python | evaluate_3dpw_mine.py | akashsengupta1997/GraphCMR | 0b8b05be4f711995ba50e414effbde98b6b11c5b | [
"BSD-3-Clause"
] | null | null | null | evaluate_3dpw_mine.py | akashsengupta1997/GraphCMR | 0b8b05be4f711995ba50e414effbde98b6b11c5b | [
"BSD-3-Clause"
] | null | null | null | evaluate_3dpw_mine.py | akashsengupta1997/GraphCMR | 0b8b05be4f711995ba50e414effbde98b6b11c5b | [
"BSD-3-Clause"
] | null | null | null | import os
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import argparse
import cv2
import config
from utils import Mesh
from models import CMR
from models.smpl_from_lib import SMPL
from utils.pose_ut... | 52.824663 | 125 | 0.633353 | import os
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import argparse
import cv2
import config
from utils import Mesh
from models import CMR
from models.smpl_from_lib import SMPL
from utils.pose_ut... | true | true |
790bc953207ced07f54191f143f08a64efb6f56a | 1,017 | py | Python | my_site/users/admin.py | pshortt/my_site | b8b22e3138642e1509e4e476c678ac09615fecd8 | [
"MIT"
] | null | null | null | my_site/users/admin.py | pshortt/my_site | b8b22e3138642e1509e4e476c678ac09615fecd8 | [
"MIT"
] | 14 | 2022-01-21T05:22:47.000Z | 2022-03-31T05:29:24.000Z | my_site/users/admin.py | pshortt/my_site | b8b22e3138642e1509e4e476c678ac09615fecd8 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from my_site.users.forms import UserAdminChangeForm, UserAdminCreationForm
User = get_user_model()
@admin.register(User)
class Us... | 29.057143 | 74 | 0.564405 | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from my_site.users.forms import UserAdminChangeForm, UserAdminCreationForm
User = get_user_model()
@admin.register(User)
class Us... | true | true |
790bc9c086190b6638eddd623ad4c7185a055404 | 5,264 | py | Python | SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py | Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 427 | 2018-05-29T14:21:02.000Z | 2022-03-16T03:17:54.000Z | SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py | PolideaPlayground/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 25 | 2018-07-23T08:34:15.000Z | 2021-11-05T07:13:36.000Z | SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py | PolideaPlayground/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 52 | 2018-07-19T19:57:32.000Z | 2022-03-11T16:05:38.000Z | """
Use lldb Python API to verify that expression evaluation for property references uses the correct getters and setters
"""
from __future__ import print_function
import os
import time
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldb... | 37.6 | 117 | 0.671922 |
from __future__ import print_function
import os
import time
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ObjCPropertyTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... | true | true |
790bca0d1f46d46e28ef4406eb3ecb240b0e1c9e | 1,581 | py | Python | torchvision/extension.py | jamt9000/vision | 598b61d93357139cec558af6eff38a77ac60cabc | [
"BSD-3-Clause"
] | 3 | 2019-11-03T01:31:37.000Z | 2020-01-08T10:48:31.000Z | torchvision/extension.py | JXQJ/vision | b6f28ec1a8c5fdb8d01cc61946e8f87dddcfa830 | [
"BSD-3-Clause"
] | 1 | 2019-03-02T06:43:20.000Z | 2019-03-02T06:43:20.000Z | torchvision/extension.py | JXQJ/vision | b6f28ec1a8c5fdb8d01cc61946e8f87dddcfa830 | [
"BSD-3-Clause"
] | 1 | 2020-09-11T20:54:56.000Z | 2020-09-11T20:54:56.000Z | _HAS_OPS = False
def _register_extensions():
import os
import imp
import torch
# load the custom_op_library and register the custom ops
lib_dir = os.path.dirname(__file__)
_, path, _ = imp.find_module("_C", [lib_dir])
torch.ops.load_library(path)
try:
_register_extensions()
_HAS... | 31 | 115 | 0.619861 | _HAS_OPS = False
def _register_extensions():
import os
import imp
import torch
lib_dir = os.path.dirname(__file__)
_, path, _ = imp.find_module("_C", [lib_dir])
torch.ops.load_library(path)
try:
_register_extensions()
_HAS_OPS = True
except (ImportError, OSError):
pass
de... | true | true |
790bcb6e4ae0780250906478faa2909be47baeec | 846 | py | Python | tests/events_test.py | jjinno/pygerduty | 9624b7616a91ccfbaaff2a51bd19da9406c718b4 | [
"MIT"
] | 144 | 2015-01-30T08:49:52.000Z | 2022-02-02T15:06:05.000Z | tests/events_test.py | cugini-dbx/pygerduty | 1982aa4ccb33eb10b98b695056517f7bc5f4dff6 | [
"MIT"
] | 56 | 2015-01-02T20:50:42.000Z | 2020-06-23T18:30:22.000Z | tests/events_test.py | cugini-dbx/pygerduty | 1982aa4ccb33eb10b98b695056517f7bc5f4dff6 | [
"MIT"
] | 67 | 2015-01-13T02:34:42.000Z | 2021-04-19T22:34:08.000Z | import httpretty
import json
import textwrap
import pygerduty.events
from pygerduty.events import INTEGRATION_API_URL
from pygerduty.common import Requester
@httpretty.activate
def test_create_event():
body = textwrap.dedent("""
{
"status": "success",
"message": "Event processed",
"incident_key... | 22.263158 | 67 | 0.665485 | import httpretty
import json
import textwrap
import pygerduty.events
from pygerduty.events import INTEGRATION_API_URL
from pygerduty.common import Requester
@httpretty.activate
def test_create_event():
body = textwrap.dedent("""
{
"status": "success",
"message": "Event processed",
"incident_key... | true | true |
790bcbff1747cdc62f9caf9c4546926661711a3f | 1,209 | py | Python | reversing/pyast64++.rev/solver/solve.py | SECCON/SECCON2021_online_CTF | 628008ae2d150723352aed2c95abff41501c51f2 | [
"Apache-2.0"
] | 7 | 2022-02-07T10:15:22.000Z | 2022-02-10T07:13:07.000Z | reversing/pyast64++.rev/solver/solve.py | SECCON/SECCON2021_online_CTF | 628008ae2d150723352aed2c95abff41501c51f2 | [
"Apache-2.0"
] | null | null | null | reversing/pyast64++.rev/solver/solve.py | SECCON/SECCON2021_online_CTF | 628008ae2d150723352aed2c95abff41501c51f2 | [
"Apache-2.0"
] | null | null | null | cipher = [75, 203, 190, 126, 184, 169, 27, 74, 35, 83, 113, 65, 207, 193, 27, 137, 37, 98, 0, 68, 219, 113, 21, 180, 223, 135, 5, 129, 189, 200, 245, 100, 117, 62, 192, 101, 239, 92, 182, 136, 159, 235, 166, 90, 74, 133, 83, 78, 6, 225, 101, 103, 82, 78, 144, 205, 130, 238, 175, 245, 172, 62, 157, 176]
key = b"SECCON20... | 31 | 303 | 0.507858 | cipher = [75, 203, 190, 126, 184, 169, 27, 74, 35, 83, 113, 65, 207, 193, 27, 137, 37, 98, 0, 68, 219, 113, 21, 180, 223, 135, 5, 129, 189, 200, 245, 100, 117, 62, 192, 101, 239, 92, 182, 136, 159, 235, 166, 90, 74, 133, 83, 78, 6, 225, 101, 103, 82, 78, 144, 205, 130, 238, 175, 245, 172, 62, 157, 176]
key = b"SECCON20... | true | true |
790bcc558648dd4cdf9c42ece65a3798865e4af5 | 7,943 | py | Python | docs/conf.py | aryamccarthy/ANES | 29c56f8c46fd4e8b6725f329cb609f4f14a8acb0 | [
"MIT"
] | 1 | 2017-04-18T22:46:02.000Z | 2017-04-18T22:46:02.000Z | docs/conf.py | aryamccarthy/ANES | 29c56f8c46fd4e8b6725f329cb609f4f14a8acb0 | [
"MIT"
] | 1 | 2017-07-17T20:28:24.000Z | 2017-07-17T20:28:24.000Z | docs/conf.py | aryamccarthy/ANES | 29c56f8c46fd4e8b6725f329cb609f4f14a8acb0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Political Dynamics documentation build configuration file, created by
# sphinx-quickstart.
#
# 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
# autogenerated file.
#
# All configuration va... | 32.420408 | 127 | 0.709178 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Political Dynamics'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1... | true | true |
790bce87491729f0ceb8329d462bd82770f80bc5 | 496 | py | Python | renzongxian/0001/0001.py | saurabh896/python-1 | f8d3aedf4c0fe6e24dfa3269ea7e642c9f7dd9b7 | [
"MIT"
] | 3,976 | 2015-01-01T15:49:39.000Z | 2022-03-31T03:47:56.000Z | renzongxian/0001/0001.py | dwh65416396/python | 1a7e3edd1cd3422cc0eaa55471a0b42e004a9a1a | [
"MIT"
] | 97 | 2015-01-11T02:59:46.000Z | 2022-03-16T14:01:56.000Z | renzongxian/0001/0001.py | dwh65416396/python | 1a7e3edd1cd3422cc0eaa55471a0b42e004a9a1a | [
"MIT"
] | 3,533 | 2015-01-01T06:19:30.000Z | 2022-03-28T13:14:54.000Z | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-11-30
# Python 3.4
"""
第 0001 题:做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码
(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?
"""
import uuid
def generate_key():
key_list = []
for i in range(200):
uuid_key = uuid.... | 19.076923 | 68 | 0.663306 |
import uuid
def generate_key():
key_list = []
for i in range(200):
uuid_key = uuid.uuid3(uuid.NAMESPACE_DNS, str(uuid.uuid1()))
key_list.append(str(uuid_key).replace('-', ''))
return key_list
if __name__ == '__main__':
print(generate_key())
| true | true |
790bd025072163898d8e1fd15588848834a0eba2 | 1,626 | py | Python | doc/gen_javadoc.py | ChillingVan/LocalHtmlSearchBox | 722f05b4efc660a8f8a6b81767493eb7a25c4d99 | [
"Apache-2.0"
] | 1 | 2019-07-13T02:33:45.000Z | 2019-07-13T02:33:45.000Z | doc/gen_javadoc.py | dxjia/LocalHtmlSearchBox | 722f05b4efc660a8f8a6b81767493eb7a25c4d99 | [
"Apache-2.0"
] | null | null | null | doc/gen_javadoc.py | dxjia/LocalHtmlSearchBox | 722f05b4efc660a8f8a6b81767493eb7a25c4d99 | [
"Apache-2.0"
] | 1 | 2019-07-13T02:33:46.000Z | 2019-07-13T02:33:46.000Z | import os
import sys
import gen_database as gendb
import json
from shutil import copyfile
def run_cmd(cmd):
cmd_pipe = os.popen(cmd)
cmd_print = cmd_pipe.read()
print(cmd_print)
if __name__ == '__main__':
print("")
root_read_dir = sys.argv[1]
if root_read_dir[-1] != r"/" or r... | 36.133333 | 141 | 0.642681 | import os
import sys
import gen_database as gendb
import json
from shutil import copyfile
def run_cmd(cmd):
cmd_pipe = os.popen(cmd)
cmd_print = cmd_pipe.read()
print(cmd_print)
if __name__ == '__main__':
print("")
root_read_dir = sys.argv[1]
if root_read_dir[-1] != r"/" or r... | true | true |
790bd2032cd33f2ce921af7205594a5110c8e4cb | 6,952 | py | Python | node_modules/nuclide/pkg/nuclide-clang-rpc/python/outline.py | kevingatera/kgatewebapp | f0dbc50b7af2736e1f6c6f96f0a26fc7ff69db20 | [
"Unlicense"
] | 1 | 2017-08-19T08:13:28.000Z | 2017-08-19T08:13:28.000Z | node_modules/nuclide/pkg/nuclide-clang-rpc/python/outline.py | kevingatera/kgatewebapp | f0dbc50b7af2736e1f6c6f96f0a26fc7ff69db20 | [
"Unlicense"
] | null | null | null | node_modules/nuclide/pkg/nuclide-clang-rpc/python/outline.py | kevingatera/kgatewebapp | f0dbc50b7af2736e1f6c6f96f0a26fc7ff69db20 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree.
from __future__ import print_function
from clang.cindex import Cursor, CursorKind, TokenKind
from utils i... | 31.035714 | 92 | 0.621116 |
from __future__ import print_function
from clang.cindex import Cursor, CursorKind, TokenKind
from utils import range_dict_relative
import ctypes
import itertools
import re
FUNCTION_KINDS = set([
'FUNCTION_DECL',
'FUNCTION_TEMPLATE',
'CXX_METHOD',
'CONSTRUCTOR',
'DESTRUCTOR',
'OBJC_IN... | true | true |
790bd4359eb7e0a3ca1113f4a548318acb5650c8 | 1,263 | py | Python | tests/test_set_random_seed.py | iblamedom/kuenstliche-intelligenz | 382ba611cb5f2ac108243d535be1d457023cc50c | [
"MIT"
] | 3 | 2020-08-28T21:55:42.000Z | 2022-03-28T10:29:19.000Z | tests/test_set_random_seed.py | xduan7/dl-project-template | 733ecdcfcb561aa1b39854b1b3632c0fda07f841 | [
"MIT"
] | 1 | 2022-02-27T17:06:21.000Z | 2022-02-27T17:06:21.000Z | tests/test_set_random_seed.py | xduan7/dl-project-template | 733ecdcfcb561aa1b39854b1b3632c0fda07f841 | [
"MIT"
] | null | null | null | import random
import unittest
from typing import Tuple
import torch
import numpy as np
from src.utilities import set_random_seed
_RANDOM_SEED: int = random.randint(0, 100)
_TEST_ARRAY_SIZE: Tuple[int, int] = (2, 2)
_TEST_TENSOR_SIZE: Tuple[int, int] = (2, 2)
def _set_random_seed():
set_random_seed(
ra... | 24.764706 | 72 | 0.684086 | import random
import unittest
from typing import Tuple
import torch
import numpy as np
from src.utilities import set_random_seed
_RANDOM_SEED: int = random.randint(0, 100)
_TEST_ARRAY_SIZE: Tuple[int, int] = (2, 2)
_TEST_TENSOR_SIZE: Tuple[int, int] = (2, 2)
def _set_random_seed():
set_random_seed(
ra... | true | true |
790bd481fc247599756784d878b515a933d57c7c | 416 | py | Python | Book/api/permissions.py | imran110219/Book_Review_App | 48655da14420af64a2b5460f1f635cd61ae30779 | [
"MIT"
] | 2 | 2019-05-24T21:08:54.000Z | 2021-12-29T11:29:45.000Z | Book/api/permissions.py | imran110219/Book_Review_App | 48655da14420af64a2b5460f1f635cd61ae30779 | [
"MIT"
] | 8 | 2019-04-17T05:46:40.000Z | 2022-03-11T23:17:20.000Z | Book/api/permissions.py | imran110219/Book_Review_App | 48655da14420af64a2b5460f1f635cd61ae30779 | [
"MIT"
] | 2 | 2018-02-04T10:16:40.000Z | 2019-06-24T19:43:01.000Z | from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsOwnerOrReadOnly(BasePermission):
message = 'You must be the owner of this object.'
def has_object_permission(self, request, view, obj):
# member = Membership.objects.get(user=user.request)
# member.is_active
if... | 37.818182 | 67 | 0.706731 | from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsOwnerOrReadOnly(BasePermission):
message = 'You must be the owner of this object.'
def has_object_permission(self, request, view, obj):
if request.method in SAFE_METHODS:
return True
retur... | true | true |
790bd48c4149fb209bc53ba278f357aee07eb98d | 23,669 | py | Python | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | csssuf/pulumi-kubernetes | 8d007166d0e8968fcabaeecd0cee13f9c08d97f1 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | csssuf/pulumi-kubernetes | 8d007166d0e8968fcabaeecd0cee13f9c08d97f1 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | csssuf/pulumi-kubernetes | 8d007166d0e8968fcabaeecd0cee13f9c08d97f1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ... import me... | 68.014368 | 415 | 0.713634 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ... import meta as _meta
__all__ = ['CSIStorageCapacityArgs', 'CSIStorageCapacity']
@pulumi.input_type
class CSIStorageCapacityArgs:
def __init__(__self__, *... | true | true |
790bd5447db6bb621163c59dcbf310f1773cbef7 | 9,605 | py | Python | sdk/python/pulumi_azure_native/datafactory/private_endpoint_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/private_endpoint_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/private_endpoint_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 43.659091 | 297 | 0.669755 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['PrivateEndpointConnectionArgs', 'PrivateEndpointConnection']
@pulumi.input_type
class PrivateEndpointConnectio... | true | true |
790bd583b0ced0d04970656e1a3968478d4e8aff | 6,596 | py | Python | federatedml/feature/feature_scale/standard_scale.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 3 | 2019-10-18T02:22:05.000Z | 2019-10-18T02:22:42.000Z | federatedml/feature/feature_scale/standard_scale.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 14 | 2020-01-28T23:02:45.000Z | 2022-02-10T00:22:08.000Z | federatedml/feature/feature_scale/standard_scale.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 2 | 2019-09-05T02:32:05.000Z | 2019-09-17T10:30:48.000Z | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.05618 | 126 | 0.595512 |
import functools
import numpy as np
from arch.api.proto.feature_scale_meta_pb2 import ScaleMeta
from arch.api.proto.feature_scale_param_pb2 import ScaleParam
from arch.api.proto.feature_scale_param_pb2 import ColumnScaleParam
from arch.api.utils import log_utils
from federatedml.feature.feature_scale.... | true | true |
790bd7a07442994e0ce4b5b0c893be3b7b309cb5 | 2,171 | py | Python | file/py/result_mashara.py | piscalpratama/KMSV2 | 7677d26c83236c25007f375a7157989e1322e9f9 | [
"MIT"
] | null | null | null | file/py/result_mashara.py | piscalpratama/KMSV2 | 7677d26c83236c25007f375a7157989e1322e9f9 | [
"MIT"
] | null | null | null | file/py/result_mashara.py | piscalpratama/KMSV2 | 7677d26c83236c25007f375a7157989e1322e9f9 | [
"MIT"
] | null | null | null | import sys
import json
import scrapapps
import scrapping
from textrank import TextRankSentences
import preprocessing
import summ
import textrankkeyword
import bss4
url = sys.argv[1]
# url = request.POST.get('web_link', None)
#web_link = scrapapps.scrap_data(url)
web_link = scrapping.scrap_data(url)
#Get Title
judul... | 19.558559 | 60 | 0.722248 | import sys
import json
import scrapapps
import scrapping
from textrank import TextRankSentences
import preprocessing
import summ
import textrankkeyword
import bss4
url = sys.argv[1]
web_link = scrapping.scrap_data(url)
judul = scrapping.get_title(url)
raw_text = str(web_link)
lower = preprocessing.text_lowerc... | true | true |
790bd80c1f90e56a600eccb4cc68bcd75db2dae5 | 6,839 | py | Python | src/datadog_api_client/v2/model/security_filter_exclusion_filter.py | rchenzheng/datadog-api-client-python | 2e86ac098c6f0c7fdd90ed218224587c0f8eafef | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v2/model/security_filter_exclusion_filter.py | rchenzheng/datadog-api-client-python | 2e86ac098c6f0c7fdd90ed218224587c0f8eafef | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v2/model/security_filter_exclusion_filter.py | rchenzheng/datadog-api-client-python | 2e86ac098c6f0c7fdd90ed218224587c0f8eafef | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
from datadog_api_client.v2.model_uti... | 39.994152 | 114 | 0.583126 |
import re
import sys
from datadog_api_client.v2.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_i... | true | true |
790bd8399ffdc82443bb930b63332f494e70a964 | 19,287 | py | Python | linkedin_api/linkedin.py | cicizh/linkedin-api | 1609ec705c95d5e05c0622db154be6dbac1eecb4 | [
"MIT"
] | null | null | null | linkedin_api/linkedin.py | cicizh/linkedin-api | 1609ec705c95d5e05c0622db154be6dbac1eecb4 | [
"MIT"
] | null | null | null | linkedin_api/linkedin.py | cicizh/linkedin-api | 1609ec705c95d5e05c0622db154be6dbac1eecb4 | [
"MIT"
] | 1 | 2019-09-04T16:09:15.000Z | 2019-09-04T16:09:15.000Z | """
Provides linkedin api-related code
"""
import random
import logging
from time import sleep
import json
from linkedin_api.utils.helpers import get_id_from_urn
from linkedin_api.client import Client
logger = logging.getLogger(__name__)
class Linkedin(object):
"""
Class for accessing Linkedin API.
"""... | 34.379679 | 258 | 0.575932 | import random
import logging
from time import sleep
import json
from linkedin_api.utils.helpers import get_id_from_urn
from linkedin_api.client import Client
logger = logging.getLogger(__name__)
class Linkedin(object):
_MAX_UPDATE_COUNT = 100
_MAX_SEARCH_COUNT = 49
_MAX_REPEATED_REQUESTS = (
... | true | true |
790bd849eabb113e5268e23dadba301216d44dda | 24 | py | Python | views/stations/__init__.py | atzorvas/droughtmeteo | 265282ea5a333dd303747df6b13155789dfc938e | [
"MIT"
] | null | null | null | views/stations/__init__.py | atzorvas/droughtmeteo | 265282ea5a333dd303747df6b13155789dfc938e | [
"MIT"
] | null | null | null | views/stations/__init__.py | atzorvas/droughtmeteo | 265282ea5a333dd303747df6b13155789dfc938e | [
"MIT"
] | null | null | null | __author__ = 'atzorvas'
| 12 | 23 | 0.75 | __author__ = 'atzorvas'
| true | true |
790bd893e8c7366add01d0ac757b05d1c2bdbefa | 159 | py | Python | python/testData/refactoring/makeFunctionTopLevel/localFunctionSimple.after.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/makeFunctionTopLevel/localFunctionSimple.after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/makeFunctionTopLevel/localFunctionSimple.after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | global_var = 'spam'
def enclosing(p1, p2):
x = 42
local(p1, x, 'foo')
def local(p1, x, p):
def nested():
print(p, x)
print(p1, p) | 11.357143 | 23 | 0.503145 | global_var = 'spam'
def enclosing(p1, p2):
x = 42
local(p1, x, 'foo')
def local(p1, x, p):
def nested():
print(p, x)
print(p1, p) | true | true |
790bd8d07d28713b742fcfa0ad6e9fe885cbc3fd | 4,051 | py | Python | data/modules/graphic/two_D/player_gui/health.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | data/modules/graphic/two_D/player_gui/health.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | data/modules/graphic/two_D/player_gui/health.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | import pygame
from .gui_abstract_object import GuiAbstractObject
class Health(GuiAbstractObject):
def __init__(self, x, y, player, screen):
super().__init__()
self.player = player
self.position = (x, y, 400, 40)
self.rects_pos = {
'main': ((), ()),
'black_h... | 52.61039 | 122 | 0.59294 | import pygame
from .gui_abstract_object import GuiAbstractObject
class Health(GuiAbstractObject):
def __init__(self, x, y, player, screen):
super().__init__()
self.player = player
self.position = (x, y, 400, 40)
self.rects_pos = {
'main': ((), ()),
'black_h... | true | true |
790bd96b30fe676462081306a479a799d322e3be | 1,192 | py | Python | app/api/v1/models/bucketlist.py | johnseremba/bucket-list | 079b8bd0c775240aec8b417731643b27a3bb3cc7 | [
"MIT"
] | 1 | 2017-07-18T18:03:28.000Z | 2017-07-18T18:03:28.000Z | app/api/v1/models/bucketlist.py | SerryJohns/bucket-list | 079b8bd0c775240aec8b417731643b27a3bb3cc7 | [
"MIT"
] | 7 | 2017-07-18T10:16:44.000Z | 2019-10-18T17:02:56.000Z | app/api/v1/models/bucketlist.py | johnseremba/bucket-list | 079b8bd0c775240aec8b417731643b27a3bb3cc7 | [
"MIT"
] | 1 | 2017-06-29T08:03:36.000Z | 2017-06-29T08:03:36.000Z | import datetime
from app import db
class BucketList(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(100), unique=True)
description = db.Column(db.Text, nullable=True)
interests = db.Column(db.String(120), nullable=True)
date_created = db.Colum... | 38.451613 | 88 | 0.703859 | import datetime
from app import db
class BucketList(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(100), unique=True)
description = db.Column(db.Text, nullable=True)
interests = db.Column(db.String(120), nullable=True)
date_created = db.Colum... | true | true |
790bd993fa52900079da534f0eddbaf962ef1c89 | 16,037 | py | Python | desktop/libs/metadata/src/metadata/optimizer_api.py | maulikjs/hue | 59ac879b55bb6fb26ecb4e85f4c70836fc21173f | [
"Apache-2.0"
] | 1 | 2020-05-17T06:40:33.000Z | 2020-05-17T06:40:33.000Z | desktop/libs/metadata/src/metadata/optimizer_api.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 4 | 2021-03-11T04:02:00.000Z | 2022-03-27T08:31:56.000Z | desktop/libs/metadata/src/metadata/optimizer_api.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1 | 2017-11-09T09:31:28.000Z | 2017-11-09T09:31:28.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 31.506876 | 211 | 0.685477 |
import base64
import json
import logging
import struct
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.decorators.http import require_POST
from desktop.lib.django_util import JsonResponse
from desktop.lib.i18n import force_unicode
from desktop.mode... | false | true |
790bd9b739afc6a41dfca6fa5848442a73392a1a | 3,761 | py | Python | icepyx/tests/test_visualization.py | nsidc/icepyx | 7f387073a0d6c9e9f5fba90ba10dd2ad4ff04c8b | [
"BSD-3-Clause"
] | 113 | 2019-11-19T17:17:11.000Z | 2022-03-28T13:52:42.000Z | icepyx/tests/test_visualization.py | nsidc/icepyx | 7f387073a0d6c9e9f5fba90ba10dd2ad4ff04c8b | [
"BSD-3-Clause"
] | 211 | 2020-01-08T20:18:19.000Z | 2022-03-31T19:53:39.000Z | icepyx/tests/test_visualization.py | nsidc/icepyx | 7f387073a0d6c9e9f5fba90ba10dd2ad4ff04c8b | [
"BSD-3-Clause"
] | 90 | 2019-12-28T01:29:25.000Z | 2022-03-25T22:27:56.000Z | import pytest
from icepyx.core.visualization import Visualize
import icepyx.core.visualization as vis
@pytest.mark.parametrize(
"n, exp",
[
(
1,
[
"ATL06_20200702014158_01020810_004_01.h5",
"ATL06_20200703011618_01170810_004_01.h5",
... | 34.504587 | 87 | 0.576442 | import pytest
from icepyx.core.visualization import Visualize
import icepyx.core.visualization as vis
@pytest.mark.parametrize(
"n, exp",
[
(
1,
[
"ATL06_20200702014158_01020810_004_01.h5",
"ATL06_20200703011618_01170810_004_01.h5",
... | true | true |
790bdc2b49eb80e85b1daeec29291b189a50693c | 15,985 | py | Python | lite/examples/model_personalization/converter/tfltransfer/model_correctness_test.py | non778/examples | d1eed1a6a987b0ebbb0341925a480dc3e60489ee | [
"Apache-2.0"
] | 3 | 2020-09-15T13:00:51.000Z | 2020-10-07T17:43:51.000Z | lite/examples/model_personalization/converter/tfltransfer/model_correctness_test.py | non778/examples | d1eed1a6a987b0ebbb0341925a480dc3e60489ee | [
"Apache-2.0"
] | 7 | 2020-11-13T19:02:15.000Z | 2022-03-12T00:43:42.000Z | lite/examples/model_personalization/converter/tfltransfer/model_correctness_test.py | non778/examples | d1eed1a6a987b0ebbb0341925a480dc3e60489ee | [
"Apache-2.0"
] | 8 | 2021-05-01T04:50:58.000Z | 2021-05-01T07:57:04.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.059524 | 103 | 0.714983 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import unittest
import numpy as np
import tensorflow as tf
from tensorflow.compat import v1 as tfv1
from tfltransfer import bases
from tfltransfer import optimizers
fr... | true | true |
790bdc3ea34a2bbf34251dec2df58f723df4e0a4 | 35,323 | py | Python | flair/models/tars_model.py | marleneDebatin/flair | 4d17509f358158f66d43e85db1b6990523b0b095 | [
"MIT"
] | 1 | 2022-02-06T04:04:27.000Z | 2022-02-06T04:04:27.000Z | flair/models/tars_model.py | marleneDebatin/flair | 4d17509f358158f66d43e85db1b6990523b0b095 | [
"MIT"
] | null | null | null | flair/models/tars_model.py | marleneDebatin/flair | 4d17509f358158f66d43e85db1b6990523b0b095 | [
"MIT"
] | null | null | null | import logging
from collections import OrderedDict
from pathlib import Path
from typing import List, Optional, Set, Tuple, Union
import numpy as np
import torch
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.preprocessing import minmax_scale
from tqdm import tqdm
import flair
from flair.data impo... | 40.6947 | 119 | 0.621436 | import logging
from collections import OrderedDict
from pathlib import Path
from typing import List, Optional, Set, Tuple, Union
import numpy as np
import torch
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.preprocessing import minmax_scale
from tqdm import tqdm
import flair
from flair.data impo... | true | true |
790bddf374f1b0f87510fa0b5072d6a169218040 | 508 | py | Python | satchmo/apps/payment/modules/cod/urls.py | pyarun/satchmo | 78fc9a923aada312924c1476e4653ee6527c11ef | [
"BSD-3-Clause"
] | 16 | 2015-03-06T14:42:27.000Z | 2019-12-23T21:37:01.000Z | satchmo/apps/payment/modules/cod/urls.py | pyarun/satchmo | 78fc9a923aada312924c1476e4653ee6527c11ef | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/payment/modules/cod/urls.py | pyarun/satchmo | 78fc9a923aada312924c1476e4653ee6527c11ef | [
"BSD-3-Clause"
] | 8 | 2015-01-28T16:02:37.000Z | 2022-03-03T21:29:40.000Z | from django.conf.urls.defaults import patterns
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
ssl = get_satchmo_setting('SSL', default_value=False)
urlpatterns = patterns('',
(r'^$', 'payment.modules.cod.views.pay_ship_info', {'SSL':ssl}, 'COD_satchmo_checkout-step2'),
(r'^confirm/$', '... | 46.181818 | 106 | 0.732283 | from django.conf.urls.defaults import patterns
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
ssl = get_satchmo_setting('SSL', default_value=False)
urlpatterns = patterns('',
(r'^$', 'payment.modules.cod.views.pay_ship_info', {'SSL':ssl}, 'COD_satchmo_checkout-step2'),
(r'^confirm/$', '... | true | true |
790bde4c8f915dec0c95f3c3f81e6ec9e79321d8 | 25,965 | py | Python | python/Lib/test/test_compileall.py | jasam/ciclo_vida_datos_scraping | 3f7cffc944a0a0752a502dc7868cf43c4144f16c | [
"MIT"
] | null | null | null | python/Lib/test/test_compileall.py | jasam/ciclo_vida_datos_scraping | 3f7cffc944a0a0752a502dc7868cf43c4144f16c | [
"MIT"
] | null | null | null | python/Lib/test/test_compileall.py | jasam/ciclo_vida_datos_scraping | 3f7cffc944a0a0752a502dc7868cf43c4144f16c | [
"MIT"
] | null | null | null | import sys
import compileall
import importlib.util
import test.test_importlib.util
import os
import pathlib
import py_compile
import shutil
import struct
import tempfile
import time
import unittest
import io
from unittest import mock, skipUnless
try:
from concurrent.futures import ProcessPoolExecut... | 43.419732 | 87 | 0.611708 | import sys
import compileall
import importlib.util
import test.test_importlib.util
import os
import pathlib
import py_compile
import shutil
import struct
import tempfile
import time
import unittest
import io
from unittest import mock, skipUnless
try:
from concurrent.futures import ProcessPoolExecut... | true | true |
790bde71f32ef92a78d6f1c5ef6f9b6e506297fb | 1,166 | py | Python | ml/Graph/pieChart2.py | Shivams9/pythoncodecamp | e6cd27f4704a407ee360414a8c9236b254117a59 | [
"MIT"
] | 6 | 2021-08-04T08:15:22.000Z | 2022-02-02T11:15:56.000Z | ML/Graph/pieChart2.py | Maurya232Abhishek/Python-repository-for-basics | 3dcec5c529a0847df07c9dcc1424675754ce6376 | [
"MIT"
] | 14 | 2021-08-02T06:28:00.000Z | 2022-03-25T10:44:15.000Z | ML/Graph/pieChart2.py | Maurya232Abhishek/Python-repository-for-basics | 3dcec5c529a0847df07c9dcc1424675754ce6376 | [
"MIT"
] | 6 | 2021-07-16T04:56:41.000Z | 2022-02-16T04:40:06.000Z | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def f(x):
return 1-x
data=pd.read_csv("test.csv")
print(data)
roll=data["Rollno"]
t1 =data["t1"]
t2 = data["t2"]
print(roll,t1,t2)
plt.pie(t1,labels=roll,autopct="%1.2f%%")
plt.title("Marks in test1")
plt.show()
plt.pie(t2,labels=roll,autopct="... | 20.821429 | 104 | 0.596913 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def f(x):
return 1-x
data=pd.read_csv("test.csv")
print(data)
roll=data["Rollno"]
t1 =data["t1"]
t2 = data["t2"]
print(roll,t1,t2)
plt.pie(t1,labels=roll,autopct="%1.2f%%")
plt.title("Marks in test1")
plt.show()
plt.pie(t2,labels=roll,autopct="... | true | true |
790bdeca139be6e684caea747631d810625a0bf6 | 25,834 | py | Python | magenta/models/score2perf/score2perf.py | flyingleafe/magenta | 2eb641e8f48c52e78d6b44fcbe9a7d168f787616 | [
"Apache-2.0"
] | null | null | null | magenta/models/score2perf/score2perf.py | flyingleafe/magenta | 2eb641e8f48c52e78d6b44fcbe9a7d168f787616 | [
"Apache-2.0"
] | null | null | null | magenta/models/score2perf/score2perf.py | flyingleafe/magenta | 2eb641e8f48c52e78d6b44fcbe9a7d168f787616 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Magenta 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 ... | 33.594278 | 89 | 0.70384 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import itertools
from magenta.models.score2perf import datagen_beam
from magenta.models.score2perf import modalities
from magenta.models.score2perf import music_encoders
from no... | true | true |
790bdef2fee711a5826e4d0648860796c9a44151 | 1,302 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/subnet_association.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/subnet_association.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/subnet_association.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.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 ... | 31.756098 | 77 | 0.596774 |
from msrest.serialization import Model
class SubnetAssociation(Model):
_validation = {
'id': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'},
}
def __init__(self,... | true | true |
790be1d5689871179d2d10998e06a2ab2217b9a2 | 684 | py | Python | 00_DataPreprocessing/data_preprocessing_template.py | sreecodeslayer/udemy-machine-learning | 11fb166358a29993ed352fb204ab79e04bd9c05e | [
"MIT"
] | null | null | null | 00_DataPreprocessing/data_preprocessing_template.py | sreecodeslayer/udemy-machine-learning | 11fb166358a29993ed352fb204ab79e04bd9c05e | [
"MIT"
] | null | null | null | 00_DataPreprocessing/data_preprocessing_template.py | sreecodeslayer/udemy-machine-learning | 11fb166358a29993ed352fb204ab79e04bd9c05e | [
"MIT"
] | null | null | null | # Data Preprocessing Template
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Splitting the dataset into the Training set and Test set
from sklear... | 29.73913 | 92 | 0.773392 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
... | true | true |
790be4aed0c2212da622c520d11a1ff8026b2e72 | 563 | py | Python | ex100 sorteio e soma.py | joaoschweikart/python_projects | a30361551ec71ac3bef6d38e4b6ffc7bad21f1cc | [
"MIT"
] | null | null | null | ex100 sorteio e soma.py | joaoschweikart/python_projects | a30361551ec71ac3bef6d38e4b6ffc7bad21f1cc | [
"MIT"
] | null | null | null | ex100 sorteio e soma.py | joaoschweikart/python_projects | a30361551ec71ac3bef6d38e4b6ffc7bad21f1cc | [
"MIT"
] | null | null | null | from time import sleep
from random import randint
numeros = []
def sorteio():
c = 0
while True:
n = randint(0, 20)
numeros.append(n)
c = c+1
if c == 5:
break
print('=-'*20)
print('SORTEANDO OS 5 VALORES DA LISTA:', end=' ')
for n in numeros:
slee... | 17.060606 | 59 | 0.50444 | from time import sleep
from random import randint
numeros = []
def sorteio():
c = 0
while True:
n = randint(0, 20)
numeros.append(n)
c = c+1
if c == 5:
break
print('=-'*20)
print('SORTEANDO OS 5 VALORES DA LISTA:', end=' ')
for n in numeros:
slee... | true | true |
790be57a235f32004113fc9be553d302c4d5fdd5 | 564 | py | Python | roster/migrations/0022_auto_20181206_1148.py | ankanb240/otis-web | 45eda65b419705c65c02b15872a137969d53d8e9 | [
"MIT"
] | 15 | 2021-08-28T18:18:37.000Z | 2022-03-13T07:48:15.000Z | roster/migrations/0022_auto_20181206_1148.py | ankanb240/otis-web | 45eda65b419705c65c02b15872a137969d53d8e9 | [
"MIT"
] | 65 | 2021-08-20T02:37:27.000Z | 2022-02-07T17:19:23.000Z | roster/migrations/0022_auto_20181206_1148.py | ankanb240/otis-web | 45eda65b419705c65c02b15872a137969d53d8e9 | [
"MIT"
] | 31 | 2020-01-09T02:35:29.000Z | 2022-03-13T07:48:18.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-12-06 16:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('roster', '0021_auto_20180825_1843'),
]
operations = [
migrations.AlterField... | 26.857143 | 164 | 0.597518 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('roster', '0021_auto_20180825_1843'),
]
operations = [
migrations.AlterField(
model_name='student',
name='track',
... | true | true |
790be5b201bc1b61342d9239a85b912577a4564c | 22,936 | py | Python | traci_pedestrian_crossing/movexy_ped.py | KarlRong/Safe-RL-for-Driving | 67484911ca8ad9f1476e96043c379c01cd5ced8c | [
"Apache-2.0"
] | null | null | null | traci_pedestrian_crossing/movexy_ped.py | KarlRong/Safe-RL-for-Driving | 67484911ca8ad9f1476e96043c379c01cd5ced8c | [
"Apache-2.0"
] | null | null | null | traci_pedestrian_crossing/movexy_ped.py | KarlRong/Safe-RL-for-Driving | 67484911ca8ad9f1476e96043c379c01cd5ced8c | [
"Apache-2.0"
] | null | null | null | # the TestEnv environment is used to simply simulate the network
from flow.envs import TestEnv
# the Experiment class is used for running simulations
from flow.core.experiment import Experiment
# the base network class
from flow.networks import Network
from flow.envs.base import Env
# all other imports are standard
... | 37.053312 | 125 | 0.588158 |
from flow.envs import TestEnv
from flow.core.experiment import Experiment
from flow.networks import Network
from flow.envs.base import Env
from flow.core.params import VehicleParams, SumoCarFollowingParams, SumoLaneChangeParams
from flow.controllers import IDMController
from flow.core.params import InFlows
from ... | true | true |
790be614a340f7ba78a86e453628b9bbc3592651 | 2,805 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.652174 | 118 | 0.647772 |
from msrest.serialization import Model
class UpdateHistoryProperty(Model):
_validation = {
'update': {'readonly': True},
'immutability_period_since_creation_in_days': {'readonly': True},
'timestamp': {'readonly': True},
'object_identifier': {'readonly': True},
'... | true | true |
790be61c348d5993e377955e149fd1abe0c7fda9 | 1,592 | bzl | Python | sqldelight.bzl | ThomasCJY/sqldelight_bazel_rules | 07171e39d5340861123368607e6118de9f2b140e | [
"Apache-2.0"
] | null | null | null | sqldelight.bzl | ThomasCJY/sqldelight_bazel_rules | 07171e39d5340861123368607e6118de9f2b140e | [
"Apache-2.0"
] | null | null | null | sqldelight.bzl | ThomasCJY/sqldelight_bazel_rules | 07171e39d5340861123368607e6118de9f2b140e | [
"Apache-2.0"
] | null | null | null | """provides an sqldelight compiler"""
def _sqldelight_codegen_impl(ctx):
srcjar = ctx.outputs.srcjar
args = ctx.actions.args()
args.add("-o", srcjar)
if not ctx.attr.module_name or not ctx.attr.package_name:
fail("Non-legacy SQLDelightc requires both module_name and package_name set.")
ar... | 30.615385 | 87 | 0.606156 |
def _sqldelight_codegen_impl(ctx):
srcjar = ctx.outputs.srcjar
args = ctx.actions.args()
args.add("-o", srcjar)
if not ctx.attr.module_name or not ctx.attr.package_name:
fail("Non-legacy SQLDelightc requires both module_name and package_name set.")
args.add("--module_name", ctx.attr.modul... | true | true |
790be68617a1d612e24c1bf1fb4470a66869f5bf | 1,917 | py | Python | dataPrepare.py | asterberova/unet | 7cac389f9176a59f8f2d136be0751631361dcaf8 | [
"MIT"
] | null | null | null | dataPrepare.py | asterberova/unet | 7cac389f9176a59f8f2d136be0751631361dcaf8 | [
"MIT"
] | null | null | null | dataPrepare.py | asterberova/unet | 7cac389f9176a59f8f2d136be0751631361dcaf8 | [
"MIT"
] | null | null | null | from data import *
# data augmentation
#In deep learning tasks, a lot of data is need to train DNN model, when the dataset is not big enough, data augmentation should be applied.
#keras.preprocessing.image.ImageDataGenerator is a data generator, which can feed the DNN with data like : (data,label), it can also do dat... | 42.6 | 239 | 0.70579 | from data import *
data_gen_args = dict(rotation_range=0.2,
width_shift_range=0.05,
height_shift_range=0.05,
shear_range=0.05,
zoom_range=0.05,
horizontal_flip=True,
fill_mode='nearest')
my... | true | true |
790be6df526f235235b1c80f97047dec72f18cc7 | 915 | py | Python | tests/test_stormtrack/test_core/test_features/data/circle_on_globe_clat-00_rad-800_delta-1.0_pyproj.py | ruestefa/stormtrack | e9378f013c406d387ea944c97e5adc68df864dee | [
"MIT"
] | null | null | null | tests/test_stormtrack/test_core/test_features/data/circle_on_globe_clat-00_rad-800_delta-1.0_pyproj.py | ruestefa/stormtrack | e9378f013c406d387ea944c97e5adc68df864dee | [
"MIT"
] | 2 | 2021-01-06T17:37:42.000Z | 2021-02-05T18:40:52.000Z | tests/test_stormtrack/test_core/test_features/data/circle_on_globe_clat-00_rad-800_delta-1.0_pyproj.py | ruestefa/stormtrack | e9378f013c406d387ea944c97e5adc68df864dee | [
"MIT"
] | null | null | null | import numpy as np
# fmt: off
clon, clat = 0.0, 0.0
rad_km = 800.0
area_km2 = np.pi*rad_km**2
nlat, nlon = 17, 17
lat1d = np.linspace(-8.0, 8.0, nlat)
lon1d = np.linspace(-8.0, 8.0, nlon)
lat2d, lon2d = np.meshgrid(lat1d, lon1d)
_, X = 0, 1
mask = np.array([
[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],
[_,_,_,_,_,X,X,X,X,X... | 26.911765 | 40 | 0.504918 | import numpy as np
clon, clat = 0.0, 0.0
rad_km = 800.0
area_km2 = np.pi*rad_km**2
nlat, nlon = 17, 17
lat1d = np.linspace(-8.0, 8.0, nlat)
lon1d = np.linspace(-8.0, 8.0, nlon)
lat2d, lon2d = np.meshgrid(lat1d, lon1d)
_, X = 0, 1
mask = np.array([
[_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_],
[_,_,_,_,_,X,X,X,X,X,X,X,_,_,_... | true | true |
790be748b1fd7585742d5a6611ef913bb380cf05 | 8,267 | py | Python | wagtail/wagtailadmin/tests/test_rich_text.py | Girbons/wagtail | 8a055addad739ff73f6e84ba553b28389122299f | [
"BSD-3-Clause"
] | 1 | 2019-11-06T10:51:42.000Z | 2019-11-06T10:51:42.000Z | wagtail/wagtailadmin/tests/test_rich_text.py | Girbons/wagtail | 8a055addad739ff73f6e84ba553b28389122299f | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailadmin/tests/test_rich_text.py | Girbons/wagtail | 8a055addad739ff73f6e84ba553b28389122299f | [
"BSD-3-Clause"
] | 2 | 2017-08-08T01:39:02.000Z | 2018-05-06T06:16:10.000Z | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from wagtail.tests.testapp.models import SingleEventPage
from wagtail.tests.testapp.rich_text import C... | 36.90625 | 117 | 0.697835 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from wagtail.tests.testapp.models import SingleEventPage
from wagtail.tests.testapp.rich_text import C... | true | true |
790be92e1e25a0d3e40d9053ddaae04fab3592ef | 2,359 | py | Python | virtual_env/lib/python3.5/site-packages/google/auth/_service_account_info.py | straydag/To_Due_Backend | ac91f5ebabe8e4f2b6db7faa5ccbd30ebdb4e3f6 | [
"MIT"
] | 3 | 2020-10-12T15:47:01.000Z | 2022-01-14T19:51:26.000Z | virtual_env/lib/python3.5/site-packages/google/auth/_service_account_info.py | straydag/To_Due_Backend | ac91f5ebabe8e4f2b6db7faa5ccbd30ebdb4e3f6 | [
"MIT"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | virtual_env/lib/python3.5/site-packages/google/auth/_service_account_info.py | straydag/To_Due_Backend | ac91f5ebabe8e4f2b6db7faa5ccbd30ebdb4e3f6 | [
"MIT"
] | 2 | 2019-11-13T05:27:48.000Z | 2020-01-21T06:35:19.000Z | # Copyright 2016 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.453333 | 78 | 0.680797 |
import io
import json
import six
from google.auth import crypt
def from_dict(data, require=None):
keys_needed = set(require if require is not None else [])
missing = keys_needed.difference(six.iterkeys(data))
if missing:
raise ValueError(
"Service account info was no... | true | true |
790be99f361b330bc9299b73af97971e2e715eb6 | 33,313 | py | Python | electrum_vestx/plugins/revealer/qt.py | anonymouszar/electrum-vestx | ca1dd0fc9ca8fc547d9def1934018b1a4acd7ecb | [
"MIT"
] | 1 | 2021-04-30T10:50:54.000Z | 2021-04-30T10:50:54.000Z | electrum_vestx/plugins/revealer/qt.py | anonymouszar/electrum-vestx | ca1dd0fc9ca8fc547d9def1934018b1a4acd7ecb | [
"MIT"
] | 2 | 2021-06-01T23:47:48.000Z | 2021-11-15T17:48:49.000Z | electrum_vestx/plugins/revealer/qt.py | anonymouszar/electrum-vestx | ca1dd0fc9ca8fc547d9def1934018b1a4acd7ecb | [
"MIT"
] | 2 | 2019-07-04T02:49:33.000Z | 2021-11-24T09:27:47.000Z | '''
Revealer
Do you have something to hide?
Secret backup plug-in for the electrum wallet.
Tiago Romagnani Silveira, 2017
'''
import os
import random
import traceback
from decimal import Decimal
from functools import partial
import sys
import qrcode
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtCore impo... | 43.717848 | 159 | 0.584877 |
import os
import random
import traceback
from decimal import Decimal
from functools import partial
import sys
import qrcode
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtCore import Qt, QRectF, QRect, QSizeF, QUrl, QPoint, QSize
from PyQt5.QtGui import (QPixmap, QImage, QBitmap, QPainter, QFontDatabase, QPen... | true | true |
790bea5cfa99570e690f18ab6edf2a2b4ec861fe | 11,546 | py | Python | gru.py | KingPixil/gram-rnn | b109e653d6b2657955931ee28553a61ac05271b0 | [
"MIT"
] | 4 | 2017-03-11T02:25:34.000Z | 2017-08-01T17:19:08.000Z | gru.py | KingPixil/text-rnn | b109e653d6b2657955931ee28553a61ac05271b0 | [
"MIT"
] | null | null | null | gru.py | KingPixil/text-rnn | b109e653d6b2657955931ee28553a61ac05271b0 | [
"MIT"
] | null | null | null | import numpy as np
import pickle
def unique(seq):
seen = set()
seen_add = seen.add
return [x for x in seq if not (x in seen or seen_add(x))]
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def softmax(x, temperature=1.0):
exp_x = np.exp(x / temperature)
return exp_x / np.sum(exp_x)
class TextRNN... | 31.807163 | 150 | 0.529188 | import numpy as np
import pickle
def unique(seq):
seen = set()
seen_add = seen.add
return [x for x in seq if not (x in seen or seen_add(x))]
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def softmax(x, temperature=1.0):
exp_x = np.exp(x / temperature)
return exp_x / np.sum(exp_x)
class TextRNN... | false | true |
790beba750f1c9ac459c484fc1795a670c0a4bda | 154 | py | Python | tests/urls.py | sflems/django-rest-friendship | c096372e65b1282859ccfb0db2b7d1058631ffa0 | [
"ISC"
] | 1 | 2022-01-26T05:46:21.000Z | 2022-01-26T05:46:21.000Z | tests/urls.py | sflems/django-rest-friendship | c096372e65b1282859ccfb0db2b7d1058631ffa0 | [
"ISC"
] | null | null | null | tests/urls.py | sflems/django-rest-friendship | c096372e65b1282859ccfb0db2b7d1058631ffa0 | [
"ISC"
] | null | null | null | from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_friendship'), namespace='rest_friendship')),
]
| 25.666667 | 96 | 0.720779 | from django.urls import path, include
urlpatterns = [
path('', include(('rest_friendship.urls', 'rest_friendship'), namespace='rest_friendship')),
]
| true | true |
790beca3a983ecb26cd665db044e84e01f5e1d86 | 4,024 | py | Python | hotelrooms/hotelrooms/settings.py | atombrella/hotel-room-reservation | 5dade1e95bb27e2847d03c03c4d00e707a50438e | [
"MIT"
] | null | null | null | hotelrooms/hotelrooms/settings.py | atombrella/hotel-room-reservation | 5dade1e95bb27e2847d03c03c4d00e707a50438e | [
"MIT"
] | 3 | 2021-06-04T23:18:26.000Z | 2021-09-22T19:07:30.000Z | hotelrooms/hotelrooms/settings.py | atombrella/hotel-room-reservation | 5dade1e95bb27e2847d03c03c4d00e707a50438e | [
"MIT"
] | null | null | null | """
Django settings for hotelrooms project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os... | 27.751724 | 91 | 0.65333 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '^b7=e99!2(t7csio=(lospr6ebgbp-2(*n^il4vt8dotctorm*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentt... | true | true |
790bed39f912fbb80665860e34afb05d378a6e59 | 1,787 | py | Python | Chapter11/webapp/blog/models.py | jayakumardhananjayan/pythonwebtut | a7547473fec5b90a91aea5395131e6eff245b495 | [
"MIT"
] | 135 | 2018-10-31T11:52:35.000Z | 2022-03-23T12:23:04.000Z | Chapter11/webapp/blog/models.py | jayakumardhananjayan/pythonwebtut | a7547473fec5b90a91aea5395131e6eff245b495 | [
"MIT"
] | 6 | 2019-03-21T02:04:43.000Z | 2022-03-22T11:07:25.000Z | Chapter11/webapp/blog/models.py | jayakumardhananjayan/pythonwebtut | a7547473fec5b90a91aea5395131e6eff245b495 | [
"MIT"
] | 109 | 2018-10-30T22:26:23.000Z | 2022-03-24T14:53:13.000Z | import datetime
from .. import db
tags = db.Table(
'post_tags',
db.Column('post_id', db.Integer, db.ForeignKey('post.id')),
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id'))
)
class Post(db.Model):
id = db.Column(db.Integer(), primary_key=True)
title = db.Column(db.String(255), nullable=Fa... | 30.810345 | 94 | 0.641858 | import datetime
from .. import db
tags = db.Table(
'post_tags',
db.Column('post_id', db.Integer, db.ForeignKey('post.id')),
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id'))
)
class Post(db.Model):
id = db.Column(db.Integer(), primary_key=True)
title = db.Column(db.String(255), nullable=Fa... | true | true |
790bed5fe2f8f36d830032650767d577aea42711 | 6,303 | py | Python | pcapng/flags.py | Boolean263/python-pcapng | 447c375456fc107376fd7f884f791d48a89f1f16 | [
"Apache-2.0"
] | null | null | null | pcapng/flags.py | Boolean263/python-pcapng | 447c375456fc107376fd7f884f791d48a89f1f16 | [
"Apache-2.0"
] | null | null | null | pcapng/flags.py | Boolean263/python-pcapng | 447c375456fc107376fd7f884f791d48a89f1f16 | [
"Apache-2.0"
] | null | null | null | """
Module to wrap an integer in bitwise flag/field accessors.
"""
from collections import OrderedDict
from pcapng.ngsix import namedtuple, Iterable
class FlagBase(object):
"""\
Base class for flag types to be used in a Flags object.
Handles the bitwise math so subclasses don't have to worry about it.
... | 30.746341 | 185 | 0.5802 |
from collections import OrderedDict
from pcapng.ngsix import namedtuple, Iterable
class FlagBase(object):
__slots__ = [
'owner',
'offset',
'size',
'extra',
'mask',
]
def __init__(self, owner, offset, size, extra=None):
if size < 1:
... | true | true |
790bed8d7cc85d9dfc7095934007a4938b817029 | 16,031 | py | Python | tfx/orchestration/kubeflow/kubeflow_dag_runner.py | TimoKerr/tfx | 10d13d57eeac21514fed73118cb43464dada67f1 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/kubeflow_dag_runner.py | TimoKerr/tfx | 10d13d57eeac21514fed73118cb43464dada67f1 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/kubeflow_dag_runner.py | TimoKerr/tfx | 10d13d57eeac21514fed73118cb43464dada67f1 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... | 40.895408 | 136 | 0.748487 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
from typing import Callable, Dict, List, Optional, Text, Type, cast
from absl import logging
from kfp import compiler
from kfp import dsl
from kfp import gcp
from kubernetes i... | true | true |
790bedc36125b8b607589b033654f44942369dca | 3,220 | py | Python | multi_camera_multi_person_tracking/utils/network_wrappers.py | 565353780/open-vino | 362c11ca90026c0e1c21bb1f76f9dbfd339bdc05 | [
"MIT"
] | null | null | null | multi_camera_multi_person_tracking/utils/network_wrappers.py | 565353780/open-vino | 362c11ca90026c0e1c21bb1f76f9dbfd339bdc05 | [
"MIT"
] | null | null | null | multi_camera_multi_person_tracking/utils/network_wrappers.py | 565353780/open-vino | 362c11ca90026c0e1c21bb1f76f9dbfd339bdc05 | [
"MIT"
] | null | null | null | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | 38.333333 | 94 | 0.590373 |
from utils.ie_tools import load_ie_model
class Detector:
def __init__(self, model_path, conf=.6, device='CPU', ext_path='', max_num_frames=1):
self.net = load_ie_model(model_path, device, None, ext_path, num_reqs=max_num_frames)
self.confidence = conf
self.expand_ratio = (1., 1.... | true | true |
790bedfbdd1631e4090932e4cdaa29302ea59268 | 792 | py | Python | test_taster5.py | pythononwheels/opentoni | 666a014a956670ff6ec55a97b9a26bd3412353ad | [
"MIT"
] | null | null | null | test_taster5.py | pythononwheels/opentoni | 666a014a956670ff6ec55a97b9a26bd3412353ad | [
"MIT"
] | null | null | null | test_taster5.py | pythononwheels/opentoni | 666a014a956670ff6ec55a97b9a26bd3412353ad | [
"MIT"
] | null | null | null | import RPi.GPIO as gpio
import time
from subprocess import Popen, PIPE, call
pin =38
gpio.setmode(gpio.BOARD)
gpio.setup(pin, gpio.IN, pull_up_down = gpio.PUD_UP)
PRESSED = 0
prev_state = 1
pressed_time = 0.1
skip_song_mode = False
try:
while True:
cur_state = gpio.input(pin)
if cur_state == PRESSED:
... | 24.75 | 53 | 0.60101 | import RPi.GPIO as gpio
import time
from subprocess import Popen, PIPE, call
pin =38
gpio.setmode(gpio.BOARD)
gpio.setup(pin, gpio.IN, pull_up_down = gpio.PUD_UP)
PRESSED = 0
prev_state = 1
pressed_time = 0.1
skip_song_mode = False
try:
while True:
cur_state = gpio.input(pin)
if cur_state == PRESSED:
... | false | true |
790bee28635e8713588b60b8549f757d44bc9039 | 3,545 | py | Python | mlreflect/curve_fitter/minimizer.py | schreiber-lab/mlreflect | 88a80ccac48461cc8934a46041726b70e469c6b8 | [
"MIT"
] | null | null | null | mlreflect/curve_fitter/minimizer.py | schreiber-lab/mlreflect | 88a80ccac48461cc8934a46041726b70e469c6b8 | [
"MIT"
] | null | null | null | mlreflect/curve_fitter/minimizer.py | schreiber-lab/mlreflect | 88a80ccac48461cc8934a46041726b70e469c6b8 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.optimize import curve_fit
from ..data_generation import interp_reflectivity, ReflectivityGenerator
def q_shift_variants(q_values_prediction, q_values_input, corrected_reflectivity, n_variants, scale=0.001):
"""Create ``n_variants`` interpolated reflectivity curve variants with rando... | 49.929577 | 120 | 0.725811 | import numpy as np
from scipy.optimize import curve_fit
from ..data_generation import interp_reflectivity, ReflectivityGenerator
def q_shift_variants(q_values_prediction, q_values_input, corrected_reflectivity, n_variants, scale=0.001):
shift = np.random.normal(loc=0, size=n_variants, scale=scale).reshape(n_vari... | true | true |
790bef11f686d55ca3e87f1884de366413f7cf15 | 5,296 | py | Python | vbridge/utils/entityset_helpers.py | sibyl-dev/VBridge | 5c4c49dad7cc1ad4e734dfac24b934088fc75bc6 | [
"MIT"
] | 5 | 2021-10-30T02:18:31.000Z | 2021-12-01T18:13:09.000Z | vbridge/utils/entityset_helpers.py | sibyl-dev/VBridge | 5c4c49dad7cc1ad4e734dfac24b934088fc75bc6 | [
"MIT"
] | null | null | null | vbridge/utils/entityset_helpers.py | sibyl-dev/VBridge | 5c4c49dad7cc1ad4e734dfac24b934088fc75bc6 | [
"MIT"
] | 1 | 2022-03-11T12:50:33.000Z | 2022-03-11T12:50:33.000Z | def remove_nan_entries(df, key_columns, verbose=True):
n_row = len(df)
for column in key_columns:
df = df[df[column] == df[column]]
if verbose:
print("Prune ({}/{}) rows.".format(n_row - len(df), n_row))
return df
def parse_relationship_path(relationship_path):
# TODO: get the rela... | 41.375 | 99 | 0.643882 | def remove_nan_entries(df, key_columns, verbose=True):
n_row = len(df)
for column in key_columns:
df = df[df[column] == df[column]]
if verbose:
print("Prune ({}/{}) rows.".format(n_row - len(df), n_row))
return df
def parse_relationship_path(relationship_path):
relationship = ... | true | true |
790bef5ee5ccf4aa4c38c98c4471cf856d2ee6f3 | 3,000 | py | Python | Fusion/fillet_polygon.py | HeNeos/autodesk_scripts | b0cf77915bc48eb3b27dc3739115d8f20a5ba434 | [
"MIT"
] | null | null | null | Fusion/fillet_polygon.py | HeNeos/autodesk_scripts | b0cf77915bc48eb3b27dc3739115d8f20a5ba434 | [
"MIT"
] | null | null | null | Fusion/fillet_polygon.py | HeNeos/autodesk_scripts | b0cf77915bc48eb3b27dc3739115d8f20a5ba434 | [
"MIT"
] | null | null | null | #Author-HeNeos
#Description-Many triangles, I love triangles
import adsk.core, adsk.fusion, adsk.cam, traceback
import math
def get_points(n, angle, r):
ans = [[0.0, 0.0]]*n
for i in range(0, n):
ans[i] = [r*math.cos(angle + 2*i*math.pi/n), r*math.sin(angle + 2*i*math.pi/n)]
return ans
def run(c... | 35.714286 | 155 | 0.595 |
import adsk.core, adsk.fusion, adsk.cam, traceback
import math
def get_points(n, angle, r):
ans = [[0.0, 0.0]]*n
for i in range(0, n):
ans[i] = [r*math.cos(angle + 2*i*math.pi/n), r*math.sin(angle + 2*i*math.pi/n)]
return ans
def run(context):
try:
app = adsk.core.Application.get()... | true | true |
790bf08c8ddb1dfe491a43d811f87a660dedd594 | 5,103 | py | Python | src/ggrc/rbac/permissions_provider.py | sriharshakappala/ggrc-core | 7561ce27cd987d73468a44df5b6e2b7425f050ef | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-04-21T12:21:17.000Z | 2019-04-21T12:21:17.000Z | src/ggrc/rbac/permissions_provider.py | sriharshakappala/ggrc-core | 7561ce27cd987d73468a44df5b6e2b7425f050ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/rbac/permissions_provider.py | sriharshakappala/ggrc-core | 7561ce27cd987d73468a44df5b6e2b7425f050ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
from collections import namedtuple
from flask import session
from flask.ext.lo... | 37.8 | 79 | 0.737997 |
from collections import namedtuple
from flask import session
from flask.ext.login import current_user
from .user_permissions import UserPermissions
from ggrc.models import get_model
Permission = namedtuple('Permission', 'action resource_type context_id')
_contributing_resource_types = {}
def get_contributing... | true | true |
790bf17b6cb4944d81b66c46ddad1c11e994815f | 2,411 | py | Python | Python/Development/T-Bot_Tracking/getHSVThresh.py | garethnisbet/T-BOTS | 70e211191cc6c713084836bff89241e811667378 | [
"Apache-2.0"
] | 20 | 2018-07-16T21:34:35.000Z | 2022-01-07T02:33:10.000Z | Python/Development/T-Bot_Tracking/getHSVThresh.py | garethnisbet/T-BOTS | 70e211191cc6c713084836bff89241e811667378 | [
"Apache-2.0"
] | 5 | 2018-07-02T23:00:36.000Z | 2020-01-23T17:38:32.000Z | Python/Development/T-Bot_Tracking/getHSVThresh.py | garethnisbet/T-BOTS | 70e211191cc6c713084836bff89241e811667378 | [
"Apache-2.0"
] | 10 | 2018-05-15T10:38:40.000Z | 2021-06-03T07:07:21.000Z | #!/usr/bin/env python
import cv2
import numpy as np
# from scipy import ndimage
maskgridL = np.meshgrid(np.r_[0:359],np.r_[0:130])
maskgridR = np.meshgrid(np.r_[0:359],np.r_[639-130:639])
# key value
# cam.set(3 , 640) # width
# cam.set(4 , 480) # height
# cam.set(10, 120) # brightness min... | 33.027397 | 93 | 0.62754 |
import cv2
import numpy as np
maskgridL = np.meshgrid(np.r_[0:359],np.r_[0:130])
maskgridR = np.meshgrid(np.r_[0:359],np.r_[639-130:639])
s = []
for i in ["MIN", "MAX"]:
for j in range_filter:
v = cv2.getTrackbarPos("%s_%s" % (j, i), "Thresholds")
values.append(v)
return val... | true | true |
790bf25816a42104ab54d4f5d28003777a230e67 | 2,271 | py | Python | hathor/p2p/states/base.py | mbnunes/hathor-core | e5e0d4a627341e2a37ee46db5c9354ddb7f8dfb8 | [
"Apache-2.0"
] | 51 | 2019-12-28T03:33:27.000Z | 2022-03-10T14:03:03.000Z | hathor/p2p/states/base.py | mbnunes/hathor-core | e5e0d4a627341e2a37ee46db5c9354ddb7f8dfb8 | [
"Apache-2.0"
] | 316 | 2019-09-10T09:20:05.000Z | 2022-03-31T20:18:56.000Z | hathor/p2p/states/base.py | jansegre/hathor-core | 22b3de6be2518e7a0797edbf0e4f6eb1cf28d6fd | [
"Apache-2.0"
] | 19 | 2020-01-04T00:13:18.000Z | 2022-02-08T21:18:46.000Z | # Copyright 2021 Hathor Labs
#
# 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, s... | 33.397059 | 93 | 0.69749 |
from typing import TYPE_CHECKING, Callable, Dict, Optional
from structlog import get_logger
from hathor.p2p.messages import ProtocolMessages
if TYPE_CHECKING:
from hathor.p2p.protocol import HathorProtocol
logger = get_logger()
class BaseState:
protocol: 'HathorProtocol'
cmd_map: Dict[... | true | true |
790bf273115a1868208ab15d6177efe0aaf9a02d | 239 | py | Python | frontend-failure-model/frontend_failure.py | prl-tokyo/MAPE-validators | fd553c81fe45bd122ab339c286067c876d928d16 | [
"MIT"
] | null | null | null | frontend-failure-model/frontend_failure.py | prl-tokyo/MAPE-validators | fd553c81fe45bd122ab339c286067c876d928d16 | [
"MIT"
] | null | null | null | frontend-failure-model/frontend_failure.py | prl-tokyo/MAPE-validators | fd553c81fe45bd122ab339c286067c876d928d16 | [
"MIT"
] | null | null | null | """
A validator for a frontend failure model. The model contains all
the failing web frontends and their status, as well as the virtual
machines they run on.
"""
from vuluptuous import Schema
schema = Schema({
'web_frontends_failures'
})
| 21.727273 | 66 | 0.769874 | from vuluptuous import Schema
schema = Schema({
'web_frontends_failures'
})
| true | true |
790bf2c2ea1c72fa7902d6f10d78459299fecd85 | 146 | py | Python | 1080.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | 1 | 2020-10-01T13:10:41.000Z | 2020-10-01T13:10:41.000Z | 1080.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | null | null | null | 1080.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | 7 | 2020-10-01T13:03:22.000Z | 2020-10-02T16:10:25.000Z | vet = []
i = 1
while(i <= 100):
valor = int(input())
vet.append(valor)
i = i + 1
print(max(vet))
print(vet.index(max(vet)) + 1)
| 9.733333 | 30 | 0.513699 | vet = []
i = 1
while(i <= 100):
valor = int(input())
vet.append(valor)
i = i + 1
print(max(vet))
print(vet.index(max(vet)) + 1)
| true | true |
790bf2cca1fa97e62bd819107a1e197a21f1aa97 | 4,428 | py | Python | test/functional/rpc_signrawtransaction.py | anandsinha095/JDCOIN | f77d87e7ba2b3d34d8b7425d33cdd1cf8a09f821 | [
"MIT"
] | null | null | null | test/functional/rpc_signrawtransaction.py | anandsinha095/JDCOIN | f77d87e7ba2b3d34d8b7425d33cdd1cf8a09f821 | [
"MIT"
] | null | null | null | test/functional/rpc_signrawtransaction.py | anandsinha095/JDCOIN | f77d87e7ba2b3d34d8b7425d33cdd1cf8a09f821 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction signing using the signrawtransaction RPC."""
from test_framework.test_framework impor... | 42.171429 | 118 | 0.676603 |
from test_framework.test_framework import JdcoinTestFramework
from test_framework.util import *
class SignRawTransactionsTest(JdcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def successful_signing_test(self):
privKeys = ['cUeKHd5o... | true | true |
790bf35d0bfdda69d1fb1a8ffe7ed80edc56e1c5 | 735 | py | Python | class3/exercise2/exercise2.py | papri-entropy/nornir-course | 122c5ecce19cca6c17a1eec0066be7c6b58e6eb5 | [
"MIT"
] | 1 | 2020-06-23T06:36:43.000Z | 2020-06-23T06:36:43.000Z | class3/exercise2/exercise2.py | papri-entropy/nornir-course | 122c5ecce19cca6c17a1eec0066be7c6b58e6eb5 | [
"MIT"
] | null | null | null | class3/exercise2/exercise2.py | papri-entropy/nornir-course | 122c5ecce19cca6c17a1eec0066be7c6b58e6eb5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# import general use modules
import os
from pprint import pprint as pp
# import nornir specifics
from nornir import InitNornir
from nornir.plugins.functions.text import print_result
from nornir.core.filter import F
nr = InitNornir()
hosts = nr.inventory.hosts
arista1_filter = nr.filter(name="ari... | 21.617647 | 55 | 0.794558 |
import os
from pprint import pprint as pp
from nornir import InitNornir
from nornir.plugins.functions.text import print_result
from nornir.core.filter import F
nr = InitNornir()
hosts = nr.inventory.hosts
arista1_filter = nr.filter(name="arista1")
arista1 = arista1_filter.inventory.hosts
print(arista1)
wan_filt... | true | true |
790bf39686d8013c41bd21c7540eeadc3bc8e96b | 6,718 | py | Python | socketio/server.py | jykim16/gevent-socketio | 429424c5e738d442e509031e998c091c8b20a766 | [
"BSD-3-Clause"
] | 1 | 2018-12-11T23:06:06.000Z | 2018-12-11T23:06:06.000Z | socketio/server.py | jykim16/gevent-socketio | 429424c5e738d442e509031e998c091c8b20a766 | [
"BSD-3-Clause"
] | null | null | null | socketio/server.py | jykim16/gevent-socketio | 429424c5e738d442e509031e998c091c8b20a766 | [
"BSD-3-Clause"
] | 2 | 2018-09-06T20:57:45.000Z | 2018-09-06T21:18:31.000Z | import sys
import traceback
from socket import error
from gevent.pywsgi import WSGIServer
from socketio.handler import SocketIOHandler
from socketio.policyserver import FlashPolicyServer
from socketio.virtsocket import Socket
from geventwebsocket.handler import WebSocketHandler
__all__ = ['SocketIOServer']
class ... | 35.172775 | 78 | 0.601221 | import sys
import traceback
from socket import error
from gevent.pywsgi import WSGIServer
from socketio.handler import SocketIOHandler
from socketio.policyserver import FlashPolicyServer
from socketio.virtsocket import Socket
from geventwebsocket.handler import WebSocketHandler
__all__ = ['SocketIOServer']
class ... | true | true |
790bf42b4d5ef992d9d2d26dacefc8fde9a6b75d | 2,194 | py | Python | eahub/base/admin.py | rtcharity/eahub.org | 0abb235e9b99f3d35cf69c3d630aeea9496d9220 | [
"MIT"
] | 36 | 2019-02-22T23:07:14.000Z | 2022-02-10T13:24:27.000Z | eahub/base/admin.py | rtcharity/eahub.org | 0abb235e9b99f3d35cf69c3d630aeea9496d9220 | [
"MIT"
] | 717 | 2019-02-21T22:07:55.000Z | 2022-02-26T15:17:49.000Z | eahub/base/admin.py | rtcharity/eahub.org | 0abb235e9b99f3d35cf69c3d630aeea9496d9220 | [
"MIT"
] | 19 | 2019-04-14T14:37:56.000Z | 2022-02-14T22:05:16.000Z | from typing import Optional
import django_admin_relation_links
from adminutils import options
from authtools import admin as authtools_admin
from django.contrib import admin
from enumfields.admin import EnumFieldListFilter
from rangefilter.filter import DateRangeFilter
from solo.admin import SingletonModelAdmin
from ... | 26.433735 | 80 | 0.667274 | from typing import Optional
import django_admin_relation_links
from adminutils import options
from authtools import admin as authtools_admin
from django.contrib import admin
from enumfields.admin import EnumFieldListFilter
from rangefilter.filter import DateRangeFilter
from solo.admin import SingletonModelAdmin
from ... | true | true |
790bf477aba7e1ba5dca6e8b97e71ea572c0bdbf | 2,880 | py | Python | tests/test_adders.py | fgarci03/pylectronics | bfcbb60e2aa64bc0a97d43abe69c5a5c0dfa43f2 | [
"MIT"
] | 45 | 2021-08-30T03:21:58.000Z | 2021-10-31T01:18:00.000Z | tests/test_adders.py | thequux/pylectronics | 7d806afb59e5172ae710a13eb370ac64afa77a6d | [
"MIT"
] | 4 | 2021-08-30T02:23:41.000Z | 2021-10-07T02:35:44.000Z | tests/test_adders.py | fgarci03/pylectronics | bfcbb60e2aa64bc0a97d43abe69c5a5c0dfa43f2 | [
"MIT"
] | 2 | 2021-08-30T14:22:55.000Z | 2021-09-01T17:48:10.000Z | from unittest import TestCase
from src.adders import HalfAdder, FullAdder, FourBitFullAdder
from tests.utils import decimal_to_boolean_list
class HalfAdderTests(TestCase):
TRUTH_TABLE = (
# A B S Cout
((False, False), (False, False)),
((False, True), (True, False)),
... | 35.121951 | 118 | 0.557292 | from unittest import TestCase
from src.adders import HalfAdder, FullAdder, FourBitFullAdder
from tests.utils import decimal_to_boolean_list
class HalfAdderTests(TestCase):
TRUTH_TABLE = (
((False, False), (False, False)),
((False, True), (True, False)),
((True, False), (True, Fa... | true | true |
790bf5338d4310ce89ee5d358060e44a01884d20 | 142,260 | py | Python | release/stubs/Autodesk/Civil/Settings.py | paoloemilioserra/ironpython-stubs | 49d92db7f28f25ccd3654c5f6ae83daa0c401fa1 | [
"MIT"
] | null | null | null | release/stubs/Autodesk/Civil/Settings.py | paoloemilioserra/ironpython-stubs | 49d92db7f28f25ccd3654c5f6ae83daa0c401fa1 | [
"MIT"
] | null | null | null | release/stubs/Autodesk/Civil/Settings.py | paoloemilioserra/ironpython-stubs | 49d92db7f28f25ccd3654c5f6ae83daa0c401fa1 | [
"MIT"
] | null | null | null | # encoding: utf-8
# module Autodesk.Civil.Settings calls itself Settings
# from AeccDbMgd, Version=13.3.854.0, Culture=neutral, PublicKeyToken=null, AeccPressurePipesMgd, Version=13.3.854.0, Culture=neutral, PublicKeyToken=null
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class Abbrev... | 32.170963 | 1,533 | 0.679776 |
class AbbreviationAlignmentEnhancedType(Enum):
""" enum AbbreviationAlignmentEnhancedType, values: AlignmentBeginningPoint (402706556), AlignmentEndPoint (402706557), CompoundSpiralLargeRadiusAtBeginning (402706566), CompoundSpiralLargeRadiusAtEnd (402706567), CompoundSpiralSmallRadiusAtBeginning (4027... | false | true |
790bf59a165f1925a9da1f25fa5a2e9a0d530556 | 25,330 | py | Python | coupled_channel/cutils.py | AleksiNummelin/coupled_channel | 0e96e54400bb853b8c42cfc55b968a476114dcef | [
"MIT"
] | 2 | 2020-11-16T10:46:33.000Z | 2020-11-16T10:46:35.000Z | coupled_channel/cutils.py | AleksiNummelin/coupled_channel | 0e96e54400bb853b8c42cfc55b968a476114dcef | [
"MIT"
] | null | null | null | coupled_channel/cutils.py | AleksiNummelin/coupled_channel | 0e96e54400bb853b8c42cfc55b968a476114dcef | [
"MIT"
] | null | null | null | #from numba import jit
import numpy as np
#from joblib import Parallel, delayed, parallel_backend
#from joblib import load, dump
#import tempfile
#import shutil
#import os
#
#import sys
#sys.path.append('pyunicorn_timeseries')
#from pyunicorn_timeseries.surrogates import Surrogates
def set_model_constants(xx=50.E3,nx=... | 46.994434 | 538 | 0.557521 |
import numpy as np
def set_model_constants(xx=50.E3,nx=100,va=10.,tmax=60*360*24*3600.,avep=24*3600.,dt=3600.,period=3600*24*360*1,B=2.,T0=273.15+6,dT=2.,Cs=1.E-3,Cp=1030.,ra=1.5,ro=1030.,ri=900.,Cpo=4.E3,Cpi=2.9E3,H=200.,vo=0.2,Hb=1.E3,Li=3.3E6,Tf=273.15-1.8,SW0=50.,SW_anom=100.,emissivity=0.99,Da=1.E6,Do=5... | true | true |
790bf5f84234ec065a5d0d52c9aaa59b1d07ab77 | 2,728 | py | Python | Module_02_Building_Your_Own_Custom_Object_Detector/2.10_Re-Training_and_Running_your_Classifier/hard_negative_mine.py | CactusJackFX/PyImageSearch_Guru | 01f5bce644b58848db029f72656002e21545bb10 | [
"Apache-2.0"
] | 2 | 2020-02-12T12:17:01.000Z | 2021-01-07T02:31:18.000Z | Module_02_Building_Your_Own_Custom_Object_Detector/2.10_Re-Training_and_Running_your_Classifier/hard_negative_mine.py | CactusJackFX/PyImageSearch_Guru | 01f5bce644b58848db029f72656002e21545bb10 | [
"Apache-2.0"
] | 1 | 2020-03-22T06:33:10.000Z | 2020-03-22T06:33:10.000Z | Module_02_Building_Your_Own_Custom_Object_Detector/2.9_Hard-Negative_Mining/hard_negative_mine.py | CactusJackFX/PyImageSearch_Guru | 01f5bce644b58848db029f72656002e21545bb10 | [
"Apache-2.0"
] | 3 | 2020-02-18T05:24:13.000Z | 2020-09-21T06:58:58.000Z | # USAGE
# python hard_negative_mine.py --conf conf/cars.json
# import the necessary packages
from __future__ import print_function
from pyimagesearch.object_detection import ObjectDetector
from pyimagesearch.descriptors import HOG
from pyimagesearch.utils import dataset
from pyimagesearch.utils import Conf
from imutil... | 37.369863 | 96 | 0.752933 |
from __future__ import print_function
from pyimagesearch.object_detection import ObjectDetector
from pyimagesearch.descriptors import HOG
from pyimagesearch.utils import dataset
from pyimagesearch.utils import Conf
from imutils import paths
import numpy as np
import progressbar
import argparse
import pickle
import ... | true | true |
790bf6088d55d4f16f4c829e953b087d0a1c8eb4 | 1,422 | py | Python | macaw/macaw.py | dcchambers/macaw | d16ea2d8021323d3be65d5449e06e61e7f527355 | [
"MIT"
] | null | null | null | macaw/macaw.py | dcchambers/macaw | d16ea2d8021323d3be65d5449e06e61e7f527355 | [
"MIT"
] | 1 | 2021-04-16T18:37:46.000Z | 2021-04-16T18:37:46.000Z | macaw/macaw.py | dcchambers/macaw | d16ea2d8021323d3be65d5449e06e61e7f527355 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Macaw
#
# Testing file open and string concatenation.
import random
import pkgutil
def main():
# This dictionary of words is for testing only and should *not* be considered secure.
# Courtesy of https://gist.github.com/deekayen/4148741
#f = open('dictionary.txt')
f = pkgutil... | 30.913043 | 93 | 0.466245 |
import random
import pkgutil
def main():
f = pkgutil.get_data("macaw","dictionary.txt").decode("utf8")
wordList = f.split()
password = generatePassword(wordList)
speakPassword(password)
def speakPassword(str):
print(r"""
,,,___
,' _ \__... | true | true |
790bf61367d85b79bae4b153328b229b10721b38 | 1,495 | py | Python | tensorflow/contrib/losses/__init__.py | xincao79/tensorflow | 7fa0cf39f854d5fdaaa19ad6425dfed02f5fea64 | [
"Apache-2.0"
] | 384 | 2017-02-21T18:38:04.000Z | 2022-02-22T07:30:25.000Z | tensorflow/contrib/losses/__init__.py | xincao79/tensorflow | 7fa0cf39f854d5fdaaa19ad6425dfed02f5fea64 | [
"Apache-2.0"
] | 15 | 2017-03-01T20:18:43.000Z | 2020-05-07T10:33:51.000Z | tensorflow/contrib/losses/__init__.py | xincao79/tensorflow | 7fa0cf39f854d5fdaaa19ad6425dfed02f5fea64 | [
"Apache-2.0"
] | 81 | 2017-02-21T19:31:19.000Z | 2022-02-22T07:30:24.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.145833 | 80 | 0.720401 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.losses.python.losses import *
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
'absolute_difference',
'add_loss',
'hin... | true | true |
790bf63ebd6b665702445bddb88c8a1278a17112 | 172 | py | Python | bookr/reviews/utils.py | rodrigobmedeiros/Bookr | bc8313226b020755c16f5ea2574f8716bd3774fd | [
"MIT"
] | null | null | null | bookr/reviews/utils.py | rodrigobmedeiros/Bookr | bc8313226b020755c16f5ea2574f8716bd3774fd | [
"MIT"
] | null | null | null | bookr/reviews/utils.py | rodrigobmedeiros/Bookr | bc8313226b020755c16f5ea2574f8716bd3774fd | [
"MIT"
] | null | null | null | def average_rating(rating_list):
if not rating_list:
# if rating_list is empty return 0
return 0
return round(sum(rating_list) / len(rating_list)) | 24.571429 | 53 | 0.680233 | def average_rating(rating_list):
if not rating_list:
return 0
return round(sum(rating_list) / len(rating_list)) | true | true |
790bf65c4b6713bbef82dca5b557e23041d8c9ce | 3,408 | py | Python | python/benchmark/function/test_cumprod.py | isabella232/nnabla | 82a3c6fed382f889d1a4a429c696bb8cedf6ce79 | [
"Apache-2.0"
] | 1 | 2019-05-31T14:00:58.000Z | 2019-05-31T14:00:58.000Z | python/benchmark/function/test_cumprod.py | Pandinosaurus/nnabla | 62a21db4afc15c52ce43f3f5b87e5fa4181b2deb | [
"Apache-2.0"
] | null | null | null | python/benchmark/function/test_cumprod.py | Pandinosaurus/nnabla | 62a21db4afc15c52ce43f3f5b87e5fa4181b2deb | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 29.634783 | 83 | 0.601232 |
import pytest
import numpy as np
import nnabla.functions as F
from function_benchmark import FunctionBenchmark, Inspec
class Case:
def __init__(self, shape, axis, rtol=1e-6):
self.shape = shape
self.axis = axis
self.rtol = rtol
def __repr__(self):
... | true | true |
790bf68e6bb4b60e25c139472fb6878dd263f693 | 5,938 | py | Python | test_autofit/mapper/test_take_attributes.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | null | null | null | test_autofit/mapper/test_take_attributes.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | null | null | null | test_autofit/mapper/test_take_attributes.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | null | null | null | import pytest
import autofit as af
from autofit.mock import mock as m
@pytest.fixture(
name="target_gaussian"
)
def make_target_gaussian():
return af.PriorModel(
m.Gaussian
)
@pytest.fixture(
name="prior"
)
def make_prior():
return af.UniformPrior()
@pytest.fixtu... | 20.335616 | 60 | 0.616201 | import pytest
import autofit as af
from autofit.mock import mock as m
@pytest.fixture(
name="target_gaussian"
)
def make_target_gaussian():
return af.PriorModel(
m.Gaussian
)
@pytest.fixture(
name="prior"
)
def make_prior():
return af.UniformPrior()
@pytest.fixtu... | true | true |
790bf6bb1e0f9e05694d9b6a3d0724b15d046a61 | 890 | py | Python | sfm2latex/dictionary/Image.py | redmer/sfm2latex | 6d57eadf7af10058ade3999efec6c590295027b2 | [
"MIT"
] | null | null | null | sfm2latex/dictionary/Image.py | redmer/sfm2latex | 6d57eadf7af10058ade3999efec6c590295027b2 | [
"MIT"
] | null | null | null | sfm2latex/dictionary/Image.py | redmer/sfm2latex | 6d57eadf7af10058ade3999efec6c590295027b2 | [
"MIT"
] | null | null | null | from ..utils import sortkey, capitalize_first
FIGURE_TEX_TEMPLATE = r'\hwgraphic{{{path}}}{{{headword}}}{{{attribution}}}'
# change to {filename} if you want to specify full paths.
FIGURE_PATH_TEMPLATE = r'figures/ill-{filename}'
class Image(object):
type = 'img'
def sk(self):
return sortkey(self.hw... | 27.8125 | 76 | 0.622472 | from ..utils import sortkey, capitalize_first
FIGURE_TEX_TEMPLATE = r'\hwgraphic{{{path}}}{{{headword}}}{{{attribution}}}'
FIGURE_PATH_TEMPLATE = r'figures/ill-{filename}'
class Image(object):
type = 'img'
def sk(self):
return sortkey(self.hw)
def __init__(self, hw='', img_src='', img_attrib='... | true | true |
790bf764810a2b414f0c97895b25464e4c42d581 | 12,706 | py | Python | sympy/vector/tests/test_coordsysrect.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | sympy/vector/tests/test_coordsysrect.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 7 | 2017-05-01T14:15:32.000Z | 2017-09-06T20:44:24.000Z | sympy/vector/tests/test_coordsysrect.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 1 | 2020-10-02T04:21:11.000Z | 2020-10-02T04:21:11.000Z | from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.scalar import BaseScalar
from sympy import sin, cos, pi, ImmutableMatrix as Matrix, \
symbols, simplify, zeros, expand
from sympy.vector.functions import express
from sympy.vector.point import Point
from sympy.vector.vector import Vector
fro... | 43.071186 | 91 | 0.488745 | from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.scalar import BaseScalar
from sympy import sin, cos, pi, ImmutableMatrix as Matrix, \
symbols, simplify, zeros, expand
from sympy.vector.functions import express
from sympy.vector.point import Point
from sympy.vector.vector import Vector
fro... | true | true |
790bf88266f11d454e343bd766de7cb931a386ae | 132,204 | py | Python | tb_rest_client/api/api_pe/entity_group_controller_api.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 30 | 2020-06-19T06:42:50.000Z | 2021-08-23T21:16:36.000Z | tb_rest_client/api/api_pe/entity_group_controller_api.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 25 | 2021-08-30T01:17:27.000Z | 2022-03-16T14:10:14.000Z | tb_rest_client/api/api_pe/entity_group_controller_api.py | samson0v/python_tb_rest_client | 08ff7898740f7cec2170e85d5c3c89e222e967f7 | [
"Apache-2.0"
] | 23 | 2020-07-06T13:41:54.000Z | 2021-08-23T21:04:50.000Z | # coding: utf-8
"""
ThingsBoard REST API
ThingsBoard Professional Edition IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.3.3PAAS-RC1
Contact: info@thingsboard.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_impo... | 56.113752 | 911 | 0.670978 |
from __future__ import absolute_import
import re
import six
from tb_rest_client.api_client import ApiClient
class EntityGroupControllerApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def add_e... | true | true |
790bf8ceade6039bbd651fce1960c04f9c51c63e | 28,394 | py | Python | tensorflow/python/keras/_impl/keras/applications/mobilenet.py | qinchangping/tensorflow | f7f7036d1cdc5716aff976fae0ea4d1b9a931b56 | [
"Apache-2.0"
] | 24 | 2018-02-01T15:49:22.000Z | 2021-01-11T16:31:18.000Z | tensorflow/python/keras/_impl/keras/applications/mobilenet.py | qinchangping/tensorflow | f7f7036d1cdc5716aff976fae0ea4d1b9a931b56 | [
"Apache-2.0"
] | 2 | 2018-09-09T07:29:07.000Z | 2019-03-11T07:14:45.000Z | tensorflow/python/keras/_impl/keras/applications/mobilenet.py | qinchangping/tensorflow | f7f7036d1cdc5716aff976fae0ea4d1b9a931b56 | [
"Apache-2.0"
] | 4 | 2018-10-29T18:43:22.000Z | 2020-09-28T07:19:52.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.451095 | 95 | 0.650736 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.keras._impl.keras import backend as K
from tensorflow.python.keras._impl.keras import constraints
from tensorflow.python.keras._impl.keras import initializers
f... | true | true |
790bf9fe8a42b67994f7345b2484de5970a9982c | 615 | py | Python | exercise_brokencounts_solution.py | annezola/gdi-python | a806f0eca2eb17e5a975cce8d0b1d90490dd455e | [
"MIT"
] | null | null | null | exercise_brokencounts_solution.py | annezola/gdi-python | a806f0eca2eb17e5a975cce8d0b1d90490dd455e | [
"MIT"
] | null | null | null | exercise_brokencounts_solution.py | annezola/gdi-python | a806f0eca2eb17e5a975cce8d0b1d90490dd455e | [
"MIT"
] | 1 | 2022-01-04T15:26:40.000Z | 2022-01-04T15:26:40.000Z | # Fix the code so that there's no error!
def count_evens(start, end):
"""Returns the number of even numbers between start and end."""
counter = start
num_evens = 0
while counter <= end:
if counter % 2 == 0:
num_evens += 1
counter += 1
return num_evens
def count_multiples(start, end, divisor):
... | 25.625 | 73 | 0.666667 |
def count_evens(start, end):
counter = start
num_evens = 0
while counter <= end:
if counter % 2 == 0:
num_evens += 1
counter += 1
return num_evens
def count_multiples(start, end, divisor):
counter = start
num_multiples = 0
while counter <= end:
if counter % divisor == 0:
num_mul... | true | true |
790bf9ff34ff4483a6201d656573973b10b16f63 | 56,109 | py | Python | seqio/dataset_providers_test.py | shism2/seqio | a2de55ee4fc17b02324d0bdae18295cd4d0df4be | [
"Apache-2.0"
] | 1 | 2022-03-11T20:05:56.000Z | 2022-03-11T20:05:56.000Z | seqio/dataset_providers_test.py | 00mjk/seqio | 63f96f1d29f7721af67d79c0265d7f937170ee20 | [
"Apache-2.0"
] | null | null | null | seqio/dataset_providers_test.py | 00mjk/seqio | 63f96f1d29f7721af67d79c0265d7f937170ee20 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The SeqIO 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 wr... | 38.483539 | 107 | 0.647989 |
import copy
import functools
import os
import shutil
from typing import Any, Callable, Mapping, Optional, Sequence
from absl.testing import absltest
from absl.testing import parameterized
from seqio import dataset_providers
from seqio import feature_converters
from seqio import metrics as metrics_lib
f... | true | true |
790bfa5dcb72761c01a9ba47699f9d2ad6b32755 | 5,875 | py | Python | 2018/10_TheStarsAlign/aoc_10.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | 1 | 2021-01-03T23:09:28.000Z | 2021-01-03T23:09:28.000Z | 2018/10_TheStarsAlign/aoc_10.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | 6 | 2020-12-26T21:02:42.000Z | 2020-12-26T21:02:52.000Z | 2018/10_TheStarsAlign/aoc_10.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | null | null | null | # ======================================================================
# The Stars Align
# Advent of Code 2018 Day 10 -- Eric Wastl -- https://adventofcode.com
#
# Python implementation by Dr. Dean Earl Wright III
# ======================================================================
# ==========================... | 35.179641 | 91 | 0.372936 |
import argparse
import sys
import lights
def parse_command_line():
desc = 'The Stars Align - Day 10 of Advent of Code 2018'
sample = 'sample: python aoc_10.py input.txt'
parser = argparse.ArgumentParser(description=desc,
epilog=sample)
... | true | true |
790bfb3c72491d430ec86eaa31bd44bfeec55858 | 12,525 | py | Python | homeassistant/components/media_player/kodi.py | sbidoul/home-assistant | 75adb7ff46e64e510c206d2b1f141253bbc4997a | [
"MIT"
] | null | null | null | homeassistant/components/media_player/kodi.py | sbidoul/home-assistant | 75adb7ff46e64e510c206d2b1f141253bbc4997a | [
"MIT"
] | null | null | null | homeassistant/components/media_player/kodi.py | sbidoul/home-assistant | 75adb7ff46e64e510c206d2b1f141253bbc4997a | [
"MIT"
] | 2 | 2018-10-22T17:05:47.000Z | 2021-09-22T10:52:31.000Z | """
Support for interfacing with the XBMC/Kodi JSON-RPC API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.kodi/
"""
import asyncio
import logging
import urllib
import aiohttp
import voluptuous as vol
from homeassistant.components.media_p... | 33.4 | 78 | 0.621876 | import asyncio
import logging
import urllib
import aiohttp
import voluptuous as vol
from homeassistant.components.media_player import (
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK, SUPPORT_SEEK,
SUPPORT_PLAY_MEDIA, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, SUPPORT_STOP,
SUPPORT_TURN_OFF, SUPP... | true | true |
790bfb8d190d1cf2f4627a5bc380f5f90b282636 | 4,526 | py | Python | sepc/exp/freeanchor/sepc_freeanchor.py | jshilong/SEPC | 26624fdb66968f87500313fd99b7a1aa8ed61a8f | [
"Apache-2.0"
] | 337 | 2020-04-23T16:13:56.000Z | 2022-03-29T02:20:27.000Z | sepc/exp/freeanchor/sepc_freeanchor.py | jshilong/SEPC | 26624fdb66968f87500313fd99b7a1aa8ed61a8f | [
"Apache-2.0"
] | 24 | 2020-04-25T13:29:47.000Z | 2021-04-23T08:04:19.000Z | sepc/exp/freeanchor/sepc_freeanchor.py | jshilong/SEPC | 26624fdb66968f87500313fd99b7a1aa8ed61a8f | [
"Apache-2.0"
] | 58 | 2020-04-25T11:52:09.000Z | 2021-09-01T15:30:48.000Z | # model settings
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_gr... | 35.359375 | 75 | 0.53977 |
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
... | true | true |
790bfb9d722715703a84bf5209777fd1bbae58ba | 1,301 | py | Python | Apis/App/api.py | andrew962/Python | 4398da94e0f465c92bd560989ea61c324423782b | [
"MIT"
] | 1 | 2019-04-27T19:11:11.000Z | 2019-04-27T19:11:11.000Z | Apis/App/api.py | andrew962/Python | 4398da94e0f465c92bd560989ea61c324423782b | [
"MIT"
] | null | null | null | Apis/App/api.py | andrew962/Python | 4398da94e0f465c92bd560989ea61c324423782b | [
"MIT"
] | null | null | null | import pyowm
owm = pyowm.OWM('ce688b67bbf90c2a0236d4eb23d8c7bd') # You MUST provide a valid API key
# Will it be sunny tomorrow at this time in Milan (Italy) ?
#forecast = owm.daily_forecast('panama')
tomorrow = pyowm.timeutils.tomorrow()
#forecast.will_be_sunny_at(tomorrow) # Always True in Italy, right? ;-)
# S... | 29.568182 | 87 | 0.703305 | import pyowm
owm = pyowm.OWM('ce688b67bbf90c2a0236d4eb23d8c7bd')
tomorrow = pyowm.timeutils.tomorrow()
ace('ayangue')
w = observation.get_weather()
rete=w.get_reference_time(timeformat='date')
refe=w.get_reference_time('iso')
estatus=w.get_status()
time=w.get_sunset_time('iso')
wind=(w.get_wind()['speed'])
wind... | true | true |
790bfbd44f16d901a0167e10b3b6d1ce6c96d9dd | 239 | py | Python | behaviors/youbot_behavior_simple_test/setup.py | FlexBE/youbot_behaviors | 6f7a0330d6a9e883fc0a3dff22f44422e2379274 | [
"BSD-3-Clause"
] | 6 | 2015-11-17T15:59:38.000Z | 2019-12-04T02:24:30.000Z | behaviors/youbot_behavior_simple_test/setup.py | FlexBE/youbot_behaviors | 6f7a0330d6a9e883fc0a3dff22f44422e2379274 | [
"BSD-3-Clause"
] | null | null | null | behaviors/youbot_behavior_simple_test/setup.py | FlexBE/youbot_behaviors | 6f7a0330d6a9e883fc0a3dff22f44422e2379274 | [
"BSD-3-Clause"
] | 2 | 2018-05-09T13:01:30.000Z | 2022-03-30T10:16:15.000Z | #!/usr/bin/env python
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages = ['youbot_behavior_simple_test'],
package_dir = {'': 'src'}
)
setup(**d) | 21.727273 | 60 | 0.748954 |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages = ['youbot_behavior_simple_test'],
package_dir = {'': 'src'}
)
setup(**d) | true | true |
790bfbf2fb99fe349874ed1aa55887a5ca95e7c6 | 357 | py | Python | uw_sdbmyuw/dao.py | uw-it-aca/uw-restclients-sdbmyuw | 70932a09b47530100e104b1921b72bff822c03c1 | [
"Apache-2.0"
] | null | null | null | uw_sdbmyuw/dao.py | uw-it-aca/uw-restclients-sdbmyuw | 70932a09b47530100e104b1921b72bff822c03c1 | [
"Apache-2.0"
] | 8 | 2017-11-08T00:18:44.000Z | 2021-06-01T17:14:30.000Z | uw_sdbmyuw/dao.py | uw-it-aca/uw-restclients-sdbmyuw | 70932a09b47530100e104b1921b72bff822c03c1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import os
from os.path import abspath, dirname
from restclients_core.dao import DAO
class Sdbmyuw_DAO(DAO):
def service_name(self):
return 'sdbmyuw'
def service_mock_paths(self):
return [abspath(os.path.jo... | 23.8 | 70 | 0.731092 |
import os
from os.path import abspath, dirname
from restclients_core.dao import DAO
class Sdbmyuw_DAO(DAO):
def service_name(self):
return 'sdbmyuw'
def service_mock_paths(self):
return [abspath(os.path.join(dirname(__file__), "resources"))]
| true | true |
790bfcf51a7b404e975bf5b7d7f7e1f8ac744c16 | 2,104 | py | Python | mewarpx/examples/thermionic_diode.py | ModernElectron/WarpX | 563813bc125a01a1a54267a3d4bb3ba77bcc68a3 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-06-23T23:38:50.000Z | 2021-06-23T23:38:50.000Z | mewarpx/examples/thermionic_diode.py | ModernElectron/WarpX | 563813bc125a01a1a54267a3d4bb3ba77bcc68a3 | [
"BSD-3-Clause-LBNL"
] | 106 | 2021-06-08T23:57:54.000Z | 2022-03-08T00:36:46.000Z | mewarpx/examples/thermionic_diode.py | ModernElectron/WarpX | 563813bc125a01a1a54267a3d4bb3ba77bcc68a3 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-06-21T18:50:43.000Z | 2021-06-21T18:50:43.000Z | import argparse
import sys
import numpy as np
from mewarpx.utils_store import util as mwxutil
mwxutil.init_libwarpx(ndim=2, rz=False)
from mewarpx.mwxrun import mwxrun
from mewarpx.setups_store import diode_setup
def run_simulation(V_bias, steps, save_current):
####################################
# Diod... | 28.821918 | 78 | 0.551806 | import argparse
import sys
import numpy as np
from mewarpx.utils_store import util as mwxutil
mwxutil.init_libwarpx(ndim=2, rz=False)
from mewarpx.mwxrun import mwxrun
from mewarpx.setups_store import diode_setup
def run_simulation(V_bias, steps, save_current):
| true | true |
790bfda2727dc109030b122bbd79807846d3f166 | 7,817 | py | Python | tests/validation/tests.py | pavanv/django-tastypie | b4ffc642aa56d25d3c577ccae0a03c820b71c4bc | [
"BSD-3-Clause"
] | 1,570 | 2015-02-03T10:19:33.000Z | 2022-03-29T10:34:18.000Z | tests/validation/tests.py | pavanv/django-tastypie | b4ffc642aa56d25d3c577ccae0a03c820b71c4bc | [
"BSD-3-Clause"
] | 587 | 2015-02-06T13:59:23.000Z | 2022-03-09T22:56:30.000Z | tests/validation/tests.py | pavanv/django-tastypie | b4ffc642aa56d25d3c577ccae0a03c820b71c4bc | [
"BSD-3-Clause"
] | 492 | 2015-02-07T06:18:36.000Z | 2022-03-29T19:06:44.000Z | import json
from django.test.utils import override_settings
from tastypie.exceptions import NotFound
from basic.models import Note
from testcases import TestCaseWithFixture
from django.test.testcases import SimpleTestCase
@override_settings(ROOT_URLCONF='validation.api.urls')
class FilteringErrorsTestCase(TestCaseW... | 38.131707 | 120 | 0.567609 | import json
from django.test.utils import override_settings
from tastypie.exceptions import NotFound
from basic.models import Note
from testcases import TestCaseWithFixture
from django.test.testcases import SimpleTestCase
@override_settings(ROOT_URLCONF='validation.api.urls')
class FilteringErrorsTestCase(TestCaseW... | true | true |
790bfdd125a54aeb226d078c352496de6419c71c | 9,413 | py | Python | managesf/tests/test_resources_storyboard.py | enovance/managesf | 5f6bc6857ebbffb929a063ccc3ab94317fa3784a | [
"Apache-2.0"
] | null | null | null | managesf/tests/test_resources_storyboard.py | enovance/managesf | 5f6bc6857ebbffb929a063ccc3ab94317fa3784a | [
"Apache-2.0"
] | null | null | null | managesf/tests/test_resources_storyboard.py | enovance/managesf | 5f6bc6857ebbffb929a063ccc3ab94317fa3784a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, 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 applica... | 39.220833 | 75 | 0.564432 |
from unittest import TestCase
from mock import patch, call, Mock
from contextlib import nested
from managesf.tests import dummy_conf
from managesf.model.yamlbkd.resources.storyboard import StoryboardOps
class StoryboardOpsTest(TestCase):
def test_is_activated(self):
conf = dummy_conf()
... | true | true |
790bfde1ab6b6b3d18bbab24e581e7b4bc432cbb | 2,652 | py | Python | plugins/QuoteGrabs/__init__.py | jlu5/Limnoria | 0e1e37a5a2bd5b717e11320b20773644b44502dd | [
"BSD-3-Clause"
] | 1 | 2021-11-11T04:48:33.000Z | 2021-11-11T04:48:33.000Z | plugins/QuoteGrabs/__init__.py | jlu5/Limnoria | 0e1e37a5a2bd5b717e11320b20773644b44502dd | [
"BSD-3-Clause"
] | 4 | 2017-10-23T15:16:40.000Z | 2018-05-27T10:19:52.000Z | plugins/QuoteGrabs/__init__.py | jlu5/Limnoria | 0e1e37a5a2bd5b717e11320b20773644b44502dd | [
"BSD-3-Clause"
] | 1 | 2021-11-11T04:48:23.000Z | 2021-11-11T04:48:23.000Z | ###
# Copyright (c) 2004, Daniel DiPaolo
# 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 must retain the above copyright notice,
# this list of condition... | 40.8 | 79 | 0.768854 |
import supybot
import supybot.world as world
__version__ = "%%VERSION%%"
# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.authors.strike
# This is a dictionary mapping supybot.Author instances to lists of
# contributions.
__contributors__ = {}
... | true | true |
790bfe23c955a12e0756d09e044c0180b61ef9ba | 20,785 | py | Python | ckan/lib/dictization/model_save.py | NP-compete/ckan | 3bbbe028e43a25ea2179c35e50ed4b67c404b135 | [
"Apache-2.0"
] | 1 | 2019-11-03T11:35:38.000Z | 2019-11-03T11:35:38.000Z | ckan/lib/dictization/model_save.py | NP-compete/ckan | 3bbbe028e43a25ea2179c35e50ed4b67c404b135 | [
"Apache-2.0"
] | null | null | null | ckan/lib/dictization/model_save.py | NP-compete/ckan | 3bbbe028e43a25ea2179c35e50ed4b67c404b135 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import datetime
import uuid
import logging
from sqlalchemy.orm import class_mapper
from six import string_types
import ckan.lib.dictization as d
import ckan.lib.helpers as h
import ckan.authz as authz
log = logging.getLogger(__name__)
def resource_dict_save(res_dict, context):
model = context... | 33.578352 | 92 | 0.637864 |
import datetime
import uuid
import logging
from sqlalchemy.orm import class_mapper
from six import string_types
import ckan.lib.dictization as d
import ckan.lib.helpers as h
import ckan.authz as authz
log = logging.getLogger(__name__)
def resource_dict_save(res_dict, context):
model = context["model"]
ses... | true | true |
790bfe7b6701239a7a166a21c31872ee524d7bd3 | 910 | py | Python | api/admin.py | emeth-/the-foot-globalhack5 | c2d999a75e53aaf7a20c0b34d7057bf2ea64f69e | [
"MIT"
] | null | null | null | api/admin.py | emeth-/the-foot-globalhack5 | c2d999a75e53aaf7a20c0b34d7057bf2ea64f69e | [
"MIT"
] | null | null | null | api/admin.py | emeth-/the-foot-globalhack5 | c2d999a75e53aaf7a20c0b34d7057bf2ea64f69e | [
"MIT"
] | null | null | null | from django.contrib import admin
from api.models import Citation
class CitationAdmin(admin.ModelAdmin):
list_display = ('id', 'citation_number', 'citation_date', 'first_name', 'last_name', 'date_of_birth', 'defendant_address', 'defendant_city', 'defendant_state', 'drivers_license_number', 'court_date', 'court_loca... | 60.666667 | 238 | 0.762637 | from django.contrib import admin
from api.models import Citation
class CitationAdmin(admin.ModelAdmin):
list_display = ('id', 'citation_number', 'citation_date', 'first_name', 'last_name', 'date_of_birth', 'defendant_address', 'defendant_city', 'defendant_state', 'drivers_license_number', 'court_date', 'court_loca... | true | true |
790bfe9e637a97c25700c02b7d5832d6e5fb589f | 131 | py | Python | src/pythonFEA/templates/__init__.py | honzatomek/pythonFEA | c851c20800a06cc2084ef53dfd2ab67e7dfbc3b7 | [
"MIT"
] | null | null | null | src/pythonFEA/templates/__init__.py | honzatomek/pythonFEA | c851c20800a06cc2084ef53dfd2ab67e7dfbc3b7 | [
"MIT"
] | null | null | null | src/pythonFEA/templates/__init__.py | honzatomek/pythonFEA | c851c20800a06cc2084ef53dfd2ab67e7dfbc3b7 | [
"MIT"
] | null | null | null | # print('Reading templates/__init__.py')
from .errors import *
import logging
logging.debug('Reading src/templates/__init__.py')
| 18.714286 | 50 | 0.770992 |
from .errors import *
import logging
logging.debug('Reading src/templates/__init__.py')
| true | true |
790bfebe2eb785aaa8b60e4994304b971a0f8eaa | 2,846 | py | Python | train.py | blufzzz/MeshCNN | 54221ddaef20c2886dca17d4edaf76f8cf040af0 | [
"MIT"
] | null | null | null | train.py | blufzzz/MeshCNN | 54221ddaef20c2886dca17d4edaf76f8cf040af0 | [
"MIT"
] | null | null | null | train.py | blufzzz/MeshCNN | 54221ddaef20c2886dca17d4edaf76f8cf040af0 | [
"MIT"
] | null | null | null | import time
from options.train_options import TrainOptions
from data import DataLoader
from models import create_model
from util.writer import Writer
from test import run_test
if __name__ == '__main__':
opt = TrainOptions().parse()
# opt.serial_batches = True # no shuffle
print('Creating DataLoader...')
... | 34.289157 | 83 | 0.576599 | import time
from options.train_options import TrainOptions
from data import DataLoader
from models import create_model
from util.writer import Writer
from test import run_test
if __name__ == '__main__':
opt = TrainOptions().parse()
Creating DataLoader...')
dataset = DataLoader(opt)
print('DataLoader cr... | true | true |
790bff7a824582a5bd81e5ba50fd57cd8d353b74 | 803 | py | Python | app/__init__.py | hazzillrodriguez/flask-user-management | 1c9e9707f9302a908b8cc5cb324abe89f4db7bc9 | [
"MIT"
] | 1 | 2021-11-30T05:33:19.000Z | 2021-11-30T05:33:19.000Z | app/__init__.py | hazzillrodriguez/flask-user-management | 1c9e9707f9302a908b8cc5cb324abe89f4db7bc9 | [
"MIT"
] | null | null | null | app/__init__.py | hazzillrodriguez/flask-user-management | 1c9e9707f9302a908b8cc5cb324abe89f4db7bc9 | [
"MIT"
] | 1 | 2021-09-27T11:24:52.000Z | 2021-09-27T11:24:52.000Z | from flask import Flask, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_bcrypt import Bcrypt
from flask_mail import Mail
app = Flask(__name__)
# Configuration
app.config.from_object('config.DevelopmentConfig')
db = SQLAlchemy... | 28.678571 | 60 | 0.809465 | from flask import Flask, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_bcrypt import Bcrypt
from flask_mail import Mail
app = Flask(__name__)
app.config.from_object('config.DevelopmentConfig')
db = SQLAlchemy(app)
login_man... | true | true |
790bfff162b54b4b284aab426678a810628d87f2 | 14,194 | py | Python | solaris/tile/vector_tile.py | motokimura/solaris | e3a18522ee41aad3da37ae88ba159efabf76a180 | [
"Apache-2.0"
] | 60 | 2020-07-29T23:31:18.000Z | 2022-03-20T02:02:47.000Z | 3-SatShipAI/solaris/tile/vector_tile.py | Z-Zheng/SpaceNet_SAR_Buildings_Solutions | 6a9c3962d987d985384d0d41a187f5fbfadac82c | [
"Apache-2.0"
] | 9 | 2021-01-15T08:57:15.000Z | 2021-11-04T04:27:41.000Z | 3-SatShipAI/solaris/tile/vector_tile.py | Z-Zheng/SpaceNet_SAR_Buildings_Solutions | 6a9c3962d987d985384d0d41a187f5fbfadac82c | [
"Apache-2.0"
] | 16 | 2020-07-30T12:56:03.000Z | 2021-08-13T16:55:05.000Z | import os
import numpy as np
from shapely.geometry import box, Polygon
import geopandas as gpd
from ..utils.core import _check_gdf_load, _check_crs
from ..utils.tile import save_empty_geojson
from ..utils.geo import gdf_get_projection_unit, split_multi_geometries
from ..utils.geo import reproject_geometry
from tqdm imp... | 44.080745 | 83 | 0.594688 | import os
import numpy as np
from shapely.geometry import box, Polygon
import geopandas as gpd
from ..utils.core import _check_gdf_load, _check_crs
from ..utils.tile import save_empty_geojson
from ..utils.geo import gdf_get_projection_unit, split_multi_geometries
from ..utils.geo import reproject_geometry
from tqdm imp... | true | true |
790c00350f25bef8955e5ddf884e6c7a046a9a32 | 1,171 | py | Python | display/plugins/Shutdown.py | rGunti/Yuki-Chan-Music-Player | d83ecc6d7fe2250725797386c670797847363f6e | [
"MIT"
] | null | null | null | display/plugins/Shutdown.py | rGunti/Yuki-Chan-Music-Player | d83ecc6d7fe2250725797386c670797847363f6e | [
"MIT"
] | null | null | null | display/plugins/Shutdown.py | rGunti/Yuki-Chan-Music-Player | d83ecc6d7fe2250725797386c670797847363f6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
SHUTDOWN.PY
Shutdown Plugin
(C) 2015, rGunti
"""
import dot3k.lcd as lcd
import dot3k.backlight as backlight
import time, datetime, copy, math, psutil
import sys
import os
from dot3k.menu import Menu, MenuOption
class Shutdown(MenuOption):
def __init__(self):
self.last = self.millis... | 20.189655 | 41 | 0.672075 |
import dot3k.lcd as lcd
import dot3k.backlight as backlight
import time, datetime, copy, math, psutil
import sys
import os
from dot3k.menu import Menu, MenuOption
class Shutdown(MenuOption):
def __init__(self):
self.last = self.millis()
MenuOption.__init__(self)
def redraw(self, menu):
lcd.clear()
lcd.set... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.