hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7576830c24073e35f6787146ce5bb39c2a8f446 | 1,705 | py | Python | core/gabor.py | guilhermealvess/emotions | a65df8f44a9ff4c25421e4b5bf8dc5d918dbd38c | [
"MIT"
] | null | null | null | core/gabor.py | guilhermealvess/emotions | a65df8f44a9ff4c25421e4b5bf8dc5d918dbd38c | [
"MIT"
] | null | null | null | core/gabor.py | guilhermealvess/emotions | a65df8f44a9ff4c25421e4b5bf8dc5d918dbd38c | [
"MIT"
] | 1 | 2019-01-12T13:17:31.000Z | 2019-01-12T13:17:31.000Z |
import numpy as np
from skimage.filters import gabor_kernel
import cv2
class KernelParams:
def __init__(self, wavelength, orientation):
self.wavelength = wavelength
self.orientation = orientation
def __hash__(self):
return hash((self.wavelength, self.orientation))
def __eq__(se... | 34.1 | 72 | 0.590029 |
import numpy as np
from skimage.filters import gabor_kernel
import cv2
class KernelParams:
def __init__(self, wavelength, orientation):
self.wavelength = wavelength
self.orientation = orientation
def __hash__(self):
return hash((self.wavelength, self.orientation))
def __eq__(se... | true | true |
f757696a93617909af6d6d4e4a9a90d31ce34fb4 | 795 | py | Python | kivy_ios/recipes/pyasn1-modules/__init__.py | lbryio/kivy-ios | 7bcd073d97bdd13663a759592d37fadbfbb71ca2 | [
"MIT"
] | 1 | 2019-10-03T12:42:38.000Z | 2019-10-03T12:42:38.000Z | kivy_ios/recipes/pyasn1-modules/__init__.py | lbryio/kivy-ios | 7bcd073d97bdd13663a759592d37fadbfbb71ca2 | [
"MIT"
] | null | null | null | kivy_ios/recipes/pyasn1-modules/__init__.py | lbryio/kivy-ios | 7bcd073d97bdd13663a759592d37fadbfbb71ca2 | [
"MIT"
] | null | null | null | from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pyasn1ModulesRecipe(PythonRecipe):
version = "0.2.1"
url = "https://pypi.python.org/packages/source/p/pyasn1-modules/pyasn1-modules-{version}.tar.gz"
depends = ["python", "pyasn1"]
def install(self):
... | 37.857143 | 100 | 0.675472 | from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pyasn1ModulesRecipe(PythonRecipe):
version = "0.2.1"
url = "https://pypi.python.org/packages/source/p/pyasn1-modules/pyasn1-modules-{version}.tar.gz"
depends = ["python", "pyasn1"]
def install(self):
... | true | true |
f75769940b77c7998fb82d62cd7f453197182b16 | 1,432 | py | Python | 3. Generate TV scripts/helper.py | mihir135/deep_learning_nanodegree | 018bf9228d72a8c0580eb82070223cf5225ffd4a | [
"MIT"
] | null | null | null | 3. Generate TV scripts/helper.py | mihir135/deep_learning_nanodegree | 018bf9228d72a8c0580eb82070223cf5225ffd4a | [
"MIT"
] | null | null | null | 3. Generate TV scripts/helper.py | mihir135/deep_learning_nanodegree | 018bf9228d72a8c0580eb82070223cf5225ffd4a | [
"MIT"
] | 1 | 2022-02-07T10:24:22.000Z | 2022-02-07T10:24:22.000Z | import os
import pickle
import torch
SPECIAL_WORDS = {'PADDING': '<PAD>'}
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data(dataset_path, token_lookup, creat... | 25.122807 | 95 | 0.671089 | import os
import pickle
import torch
SPECIAL_WORDS = {'PADDING': '<PAD>'}
def load_data(path):
input_file = os.path.join(path)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data(dataset_path, token_lookup, create_lookup_tables):
text = load_data(data... | true | true |
f75769c47022def6b8ed5be6d0727e31cfb9f55a | 1,606 | py | Python | setup.py | gaqzi/django-emoji | e9cef5ed9baa00da8ee79a5cfb51aacde462bdff | [
"MIT"
] | 78 | 2015-02-10T15:22:38.000Z | 2022-01-08T09:02:08.000Z | setup.py | skorokithakis/django-emoji | 901810b1ad34cc4e2215079bd96b496e1d69dc84 | [
"MIT"
] | 17 | 2015-04-26T14:07:15.000Z | 2021-07-21T10:32:01.000Z | setup.py | skorokithakis/django-emoji | 901810b1ad34cc4e2215079bd96b496e1d69dc84 | [
"MIT"
] | 19 | 2015-02-14T00:42:38.000Z | 2021-01-23T18:26:01.000Z | # encoding: utf-8
import os
from setuptools import setup, find_packages
readme_file = os.path.join(os.path.dirname(__file__), 'README.rst')
README = None
try:
f = open(readme_file, encoding='utf-8')
except TypeError:
f = open(readme_file)
README = f.read()
f.close()
os.chdir(os.path.normpath(os.path.join(os... | 29.740741 | 78 | 0.617684 |
import os
from setuptools import setup, find_packages
readme_file = os.path.join(os.path.dirname(__file__), 'README.rst')
README = None
try:
f = open(readme_file, encoding='utf-8')
except TypeError:
f = open(readme_file)
README = f.read()
f.close()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__f... | true | true |
f75769cd90b2fa3673c26636d22ab94fd49c3ce1 | 3,877 | py | Python | sources_from_mxshop/MxShop-django/apps/users/migrations/0001_initial.py | yangtao4389/similal_taobao | 90a71c55bbbaffa9776e8460d0752374a674e0ad | [
"Apache-2.0"
] | 1 | 2019-03-05T02:22:56.000Z | 2019-03-05T02:22:56.000Z | apps/users/migrations/0001_initial.py | linrong/FruitSupermarket | c69e5a2590ab4e6bcdad7a52b68d8ebcfecb3ad9 | [
"MIT"
] | 16 | 2020-06-05T20:13:57.000Z | 2022-03-11T23:44:03.000Z | apps/users/migrations/0001_initial.py | linrong/FruitSupermarket | c69e5a2590ab4e6bcdad7a52b68d8ebcfecb3ad9 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-13 11:39
import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_u... | 62.532258 | 329 | 0.637864 |
import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operatio... | true | true |
f7576a2bd8ab0b077a9f85626f16d6a3e209f41f | 12,921 | py | Python | sdk/python/pulumi_google_native/compute/v1/get_machine_image.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/compute/v1/get_machine_image.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/compute/v1/get_machine_image.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 48.575188 | 648 | 0.698862 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetMachineImageResult',
'AwaitableGetMachineImageResult',
'get_machine_image',
'get_machine_image_output',
]
@pulum... | true | true |
f7576ab0f3e6e338a73b8d881082ee260d0c3dda | 2,710 | py | Python | setup.py | martingu11/endas | e58be74e844efa14cbd86aba5e76dbc44fe690de | [
"MIT"
] | 1 | 2020-05-13T13:14:09.000Z | 2020-05-13T13:14:09.000Z | setup.py | martingu11/endas | e58be74e844efa14cbd86aba5e76dbc44fe690de | [
"MIT"
] | 16 | 2020-07-13T14:51:01.000Z | 2020-07-14T08:59:16.000Z | setup.py | martingu11/endas | e58be74e844efa14cbd86aba5e76dbc44fe690de | [
"MIT"
] | 1 | 2020-03-18T10:37:45.000Z | 2020-03-18T10:37:45.000Z | import sys
import os.path
from setuptools import setup, Extension, find_packages
if sys.version_info[:2] < (3, 6):
raise RuntimeError("Python >= 3.6 required.")
CYTHON_REBUILD = False
CYTHON_ANNOTATE = True
RTD_BUILD = 'READTHEDOCS' in os.environ
# Extra arguments to setup.py install/build/build_ext
# This is ... | 33.875 | 109 | 0.682657 | import sys
import os.path
from setuptools import setup, Extension, find_packages
if sys.version_info[:2] < (3, 6):
raise RuntimeError("Python >= 3.6 required.")
CYTHON_REBUILD = False
CYTHON_ANNOTATE = True
RTD_BUILD = 'READTHEDOCS' in os.environ
if "--cython-rebuild" in sys.argv:
sys.argv.remove("--c... | true | true |
f7576e5cb936178d327d879eca622cd5d87b764d | 15,957 | py | Python | zhaquirks/xiaomi/__init__.py | grea09/zha-device-handlers | 6b06af789bd8a97c42a24bd05c370ecfadd6f363 | [
"Apache-2.0"
] | null | null | null | zhaquirks/xiaomi/__init__.py | grea09/zha-device-handlers | 6b06af789bd8a97c42a24bd05c370ecfadd6f363 | [
"Apache-2.0"
] | null | null | null | zhaquirks/xiaomi/__init__.py | grea09/zha-device-handlers | 6b06af789bd8a97c42a24bd05c370ecfadd6f363 | [
"Apache-2.0"
] | null | null | null | """Xiaomi common components for custom device handlers."""
import asyncio
import binascii
import logging
from zigpy import types as t
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import AnalogInput, Basic, PowerConfiguration
from zigpy.zcl.clusters.homeautomation import Electric... | 34.68913 | 112 | 0.628188 | import asyncio
import binascii
import logging
from zigpy import types as t
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import AnalogInput, Basic, PowerConfiguration
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.measurement import (
... | true | true |
f7576f18849f9b35b7457c4ef227f79ab971a3c6 | 1,056 | py | Python | iqmon/primitives/__init__.py | joshwalawender/IQMon | d6b7df9f489b94a197e4faeb53785f3f30d248df | [
"BSD-2-Clause"
] | 9 | 2017-08-04T04:02:52.000Z | 2021-03-15T23:01:04.000Z | iqmon/primitives/__init__.py | joshwalawender/IQMon | d6b7df9f489b94a197e4faeb53785f3f30d248df | [
"BSD-2-Clause"
] | 9 | 2022-01-10T03:04:44.000Z | 2022-01-10T03:04:46.000Z | iqmon/primitives/__init__.py | joshwalawender/IQMon | d6b7df9f489b94a197e4faeb53785f3f30d248df | [
"BSD-2-Clause"
] | 5 | 2015-07-01T00:46:21.000Z | 2018-11-19T11:05:24.000Z | ##-----------------------------------------------------------------------------
## Primitive: Template
##-----------------------------------------------------------------------------
# class Template(BasePrimitive):
# """
# """
# def __init__(self, action, context):
# BasePrimitive.__init__(self, ac... | 31.058824 | 79 | 0.47822 | he parameters that depend on this
# operation.
# """
| true | true |
f7576fcf692a7e88a5785f536ee99368ee8f3c6d | 19,252 | py | Python | MalmoEnv/malmoenv/core.py | HumanCompatibleAI/malmo | 147dad058c00574e57205833159decc91c8adfd1 | [
"MIT"
] | null | null | null | MalmoEnv/malmoenv/core.py | HumanCompatibleAI/malmo | 147dad058c00574e57205833159decc91c8adfd1 | [
"MIT"
] | null | null | null | MalmoEnv/malmoenv/core.py | HumanCompatibleAI/malmo | 147dad058c00574e57205833159decc91c8adfd1 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------------
# Copyright (c) 2018 Microsoft Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software ... | 39.613169 | 116 | 0.561448 |
from lxml import etree
import struct
import socket
import time
import random
import numpy as np
from malmoenv import comms
from malmoenv.commands import CommandParser
import uuid
import gym.spaces
from malmoenv.comms import retry
from malmoenv.version import malmo_version
class StringActionSpace(gy... | true | true |
f75770208934e81937789e433291a1afcd2541f0 | 748 | py | Python | station.py | mrpjevans/retroradio | a18e8da33787db6b9641e7fb3e274055dffeabf6 | [
"MIT"
] | null | null | null | station.py | mrpjevans/retroradio | a18e8da33787db6b9641e7fb3e274055dffeabf6 | [
"MIT"
] | null | null | null | station.py | mrpjevans/retroradio | a18e8da33787db6b9641e7fb3e274055dffeabf6 | [
"MIT"
] | null | null | null | import time
class Station:
duration = 100
file = ""
launch_time = 0
special = False
special_active = False
name = ""
def __init__(self, playlist_item):
self.file = playlist_item['file']
self.duration = playlist_item['duration']
self.special = playlist_item['special'] if 'special' in playlist... | 27.703704 | 84 | 0.685829 | import time
class Station:
duration = 100
file = ""
launch_time = 0
special = False
special_active = False
name = ""
def __init__(self, playlist_item):
self.file = playlist_item['file']
self.duration = playlist_item['duration']
self.special = playlist_item['special'] if 'special' in playlist... | true | true |
f75770e26743a2b591900fcb9c2ce8e1d65a4d3d | 62,964 | py | Python | openmc/filter.py | ThompsonJ314/openmc | 173c85c2cbb1784e49edf51d2d379a0f981de4e3 | [
"MIT"
] | null | null | null | openmc/filter.py | ThompsonJ314/openmc | 173c85c2cbb1784e49edf51d2d379a0f981de4e3 | [
"MIT"
] | null | null | null | openmc/filter.py | ThompsonJ314/openmc | 173c85c2cbb1784e49edf51d2d379a0f981de4e3 | [
"MIT"
] | null | null | null | from abc import ABCMeta
from collections import OrderedDict
from collections.abc import Iterable
import hashlib
from itertools import product
from numbers import Real, Integral
from xml.etree import ElementTree as ET
import numpy as np
import pandas as pd
import openmc
import openmc.checkvalue as cv
from .cell import... | 33.156398 | 81 | 0.59345 | from abc import ABCMeta
from collections import OrderedDict
from collections.abc import Iterable
import hashlib
from itertools import product
from numbers import Real, Integral
from xml.etree import ElementTree as ET
import numpy as np
import pandas as pd
import openmc
import openmc.checkvalue as cv
from .cell import... | true | true |
f75771ad57a066252876ecec99fdc88f0cd48092 | 565 | py | Python | ABC/m-solutions2020/B.py | yu9824/AtCoder | 50a209059c005efadc1c912e443ec41365381c16 | [
"MIT"
] | null | null | null | ABC/m-solutions2020/B.py | yu9824/AtCoder | 50a209059c005efadc1c912e443ec41365381c16 | [
"MIT"
] | null | null | null | ABC/m-solutions2020/B.py | yu9824/AtCoder | 50a209059c005efadc1c912e443ec41365381c16 | [
"MIT"
] | null | null | null | # list(map(int, input().split()))
# int(input())
from itertools import combinations_with_replacement
import copy
def main(lst, K):
original = copy.copy(lst)
# 要するにC>B>Aになればおけ.
comb = combinations_with_replacement([0, 1, 2], K)
for c in comb:
lst = copy.copy(original)
for i in c:
... | 24.565217 | 54 | 0.539823 |
from itertools import combinations_with_replacement
import copy
def main(lst, K):
original = copy.copy(lst)
comb = combinations_with_replacement([0, 1, 2], K)
for c in comb:
lst = copy.copy(original)
for i in c:
lst[i] *= 2
if lst[0] < lst[1] and lst[1] < lst[... | true | true |
f75773bb44a2cf3c93a4afdd6d1bb83176747012 | 59,213 | py | Python | raiden/api/python.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 2,101 | 2016-06-01T11:31:49.000Z | 2022-03-27T20:13:19.000Z | raiden/api/python.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 5,291 | 2016-06-01T18:14:04.000Z | 2022-03-31T11:19:09.000Z | raiden/api/python.py | tirkarthi/raiden | dbd03ddda039332b54ec0c02d81cbe1100bc8028 | [
"MIT"
] | 484 | 2016-06-01T18:21:06.000Z | 2022-03-22T10:29:45.000Z | import gevent
import opentracing
import structlog
from eth_utils import is_binary_address
from raiden import waiting
from raiden.api.exceptions import ChannelNotFound, NonexistingChannel
from raiden.constants import BLOCK_ID_PENDING, NULL_ADDRESS_BYTES, UINT64_MAX, UINT256_MAX
from raiden.exceptions import (
Alrea... | 41.006233 | 99 | 0.668586 | import gevent
import opentracing
import structlog
from eth_utils import is_binary_address
from raiden import waiting
from raiden.api.exceptions import ChannelNotFound, NonexistingChannel
from raiden.constants import BLOCK_ID_PENDING, NULL_ADDRESS_BYTES, UINT64_MAX, UINT256_MAX
from raiden.exceptions import (
Alrea... | true | true |
f75773e3b74f75da43a02185504fb8ebdf951419 | 285 | py | Python | Day 1/tdd/loan_calculator.py | JoshuaOndieki/joshua-ondieki-bootcamp-17 | e2f0f2b8100da28b5db1db6292bef7040d2b9263 | [
"MIT"
] | null | null | null | Day 1/tdd/loan_calculator.py | JoshuaOndieki/joshua-ondieki-bootcamp-17 | e2f0f2b8100da28b5db1db6292bef7040d2b9263 | [
"MIT"
] | null | null | null | Day 1/tdd/loan_calculator.py | JoshuaOndieki/joshua-ondieki-bootcamp-17 | e2f0f2b8100da28b5db1db6292bef7040d2b9263 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
def loan_calculator(amount, rate, time):
if amount<0:
return "Invalid amount!"
if rate>100:
return "Invalid rate!"
if time>12:
return "Invalid Number of months!"
return amount + (amount*(rate/100)*time)
| 21.923077 | 44 | 0.621053 |
def loan_calculator(amount, rate, time):
if amount<0:
return "Invalid amount!"
if rate>100:
return "Invalid rate!"
if time>12:
return "Invalid Number of months!"
return amount + (amount*(rate/100)*time)
| true | true |
f757743953c25b714d2cb14fcbd050444e106554 | 1,744 | py | Python | modules/dependencies/filters.py | Multi-Agent-io/feecc-analytics-backend | 052d41a81b48f87f7ff33438c059b3087a45f5f3 | [
"Apache-2.0"
] | null | null | null | modules/dependencies/filters.py | Multi-Agent-io/feecc-analytics-backend | 052d41a81b48f87f7ff33438c059b3087a45f5f3 | [
"Apache-2.0"
] | 1 | 2021-12-03T11:17:59.000Z | 2021-12-03T11:17:59.000Z | modules/dependencies/filters.py | Multi-Agent-io/feecc-analytics-backend | 052d41a81b48f87f7ff33438c059b3087a45f5f3 | [
"Apache-2.0"
] | 1 | 2022-03-23T14:10:43.000Z | 2022-03-23T14:10:43.000Z | import datetime
import typing as tp
from pydantic import Field
from modules.routers.tcd.models import ProtocolStatus
from modules.routers.passports.models import UnitStatus
from ..types import Filter
async def parse_passports_filter(
status: tp.Optional[UnitStatus] = None,
name: tp.Optional[str] = None,
... | 28.590164 | 106 | 0.631881 | import datetime
import typing as tp
from pydantic import Field
from modules.routers.tcd.models import ProtocolStatus
from modules.routers.passports.models import UnitStatus
from ..types import Filter
async def parse_passports_filter(
status: tp.Optional[UnitStatus] = None,
name: tp.Optional[str] = None,
... | true | true |
f757745ba7cf2fa500f03102d7ca2b0c932c27bc | 8,873 | py | Python | youtube_dl/extractor/drtv.py | MOODesign/Youtube-videos-Download | 730c0d12a06f349907481570f1f2890251f7a181 | [
"Unlicense"
] | 24 | 2017-03-17T10:27:12.000Z | 2022-02-16T05:55:50.000Z | youtube_dl/extractor/drtv.py | MOODesign/Youtube-videos-Download | 730c0d12a06f349907481570f1f2890251f7a181 | [
"Unlicense"
] | 7 | 2017-07-26T08:15:27.000Z | 2018-09-20T12:56:53.000Z | youtube_dl/extractor/drtv.py | MOODesign/Youtube-videos-Download | 730c0d12a06f349907481570f1f2890251f7a181 | [
"Unlicense"
] | 3 | 2019-08-28T18:38:26.000Z | 2021-04-27T13:43:30.000Z | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
mimetype2ext,
parse_iso8601,
remove_end,
update_url_query,
)
class DRTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.d... | 38.578261 | 118 | 0.486983 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
mimetype2ext,
parse_iso8601,
remove_end,
update_url_query,
)
class DRTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/(?:tv/se|nyhe... | true | true |
f757749960019b5b061432b6d50d6e0ebbe41e28 | 2,331 | py | Python | src/util/input.py | cisagov/gophish-tools | 95b00306fc8385c8efc974ad8cb2851e0222f1bb | [
"CC0-1.0"
] | 28 | 2020-07-01T15:22:09.000Z | 2022-03-16T04:57:39.000Z | src/util/input.py | cisagov/gophish-tools | 95b00306fc8385c8efc974ad8cb2851e0222f1bb | [
"CC0-1.0"
] | 47 | 2020-06-14T01:18:54.000Z | 2022-03-28T18:41:17.000Z | src/util/input.py | cisagov/gophish-tools | 95b00306fc8385c8efc974ad8cb2851e0222f1bb | [
"CC0-1.0"
] | 4 | 2020-06-11T18:25:39.000Z | 2021-09-28T19:29:17.000Z | """Functions related to user input."""
# Standard Python Libraries
from datetime import datetime
import logging
# Third-Party Libraries
from prompt_toolkit import prompt
from prompt_toolkit.completion import WordCompleter
import pytz
# cisagov Libraries
from util.validate import BlankInputValidator, BooleanValidator... | 28.426829 | 108 | 0.63106 |
from datetime import datetime
import logging
from prompt_toolkit import prompt
from prompt_toolkit.completion import WordCompleter
import pytz
from util.validate import BlankInputValidator, BooleanValidator
logger = logging.getLogger(__name__)
def yes_no_prompt(message):
return prompt(
"{}?(yes/no)... | true | true |
f75775cf7c5e69e95c29c843feb2569e0a09ed32 | 7,315 | py | Python | opencda/core/plan/spline.py | xiaxin2000/OpenCDA-Documents | 1ad4b368d4287dae8b282bac1665816a496d57c6 | [
"MIT"
] | 1 | 2021-12-17T10:45:33.000Z | 2021-12-17T10:45:33.000Z | opencda/core/plan/spline.py | xiaxin2000/OpenCDA-Documents | 1ad4b368d4287dae8b282bac1665816a496d57c6 | [
"MIT"
] | null | null | null | opencda/core/plan/spline.py | xiaxin2000/OpenCDA-Documents | 1ad4b368d4287dae8b282bac1665816a496d57c6 | [
"MIT"
] | 1 | 2021-10-01T19:41:52.000Z | 2021-10-01T19:41:52.000Z | """
Cubic spline planner
Author: Atsushi Sakai(@Atsushi_twi)
"""
import math
import numpy as np
import bisect
class Spline:
"""
Cubic Spline class for calculte curvature (Author: Atsushi Sakai(@Atsushi_twi)).
Parameters
-x : float
The x coordinate.
-y : float
The y coordinate.
... | 24.54698 | 110 | 0.496924 | import math
import numpy as np
import bisect
class Spline:
def __init__(self, x, y):
self.b, self.c, self.d, self.w = [], [], [], []
self.x = x
self.y = y
self.nx = len(x)
h = np.diff(x)
self.a = [iy for iy in y]
A = self.__calc_A(h)... | true | true |
f75775e29a7f023998533d0de20b94e8e1fde6b1 | 3,012 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/integration_runtime_ssis_properties_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/integration_runtime_ssis_properties_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2020-03-06T05:57:16.000Z | 2020-03-06T05:57:16.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/integration_runtime_ssis_properties_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"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 ... | 50.2 | 189 | 0.713479 |
from msrest.serialization import Model
class IntegrationRuntimeSsisProperties(Model):
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'catalog_info': {'key': 'catalogInfo', 'type': 'IntegrationRuntimeSsisCatalogInfo'},
'license_type': {'key': 'licen... | true | true |
f7577693d0c9555983c2501dc7d9ddf1df544a25 | 1,084 | py | Python | diventi/ebooks/migrations/0123_auto_20201010_2345.py | flavoi/diven | 3173ca3ca3fbedc191b8eab3639a6bceb3c442c4 | [
"Apache-2.0"
] | 2 | 2019-06-27T16:00:17.000Z | 2020-08-14T07:46:05.000Z | diventi/ebooks/migrations/0123_auto_20201010_2345.py | flavoi/diven | 3173ca3ca3fbedc191b8eab3639a6bceb3c442c4 | [
"Apache-2.0"
] | 26 | 2020-02-15T22:39:35.000Z | 2022-02-19T21:09:01.000Z | diventi/ebooks/migrations/0123_auto_20201010_2345.py | flavoi/diven | 3173ca3ca3fbedc191b8eab3639a6bceb3c442c4 | [
"Apache-2.0"
] | 1 | 2021-11-12T22:30:15.000Z | 2021-11-12T22:30:15.000Z | # Generated by Django 2.2.16 on 2020-10-10 21:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ebooks', '0122_auto_20201005_2212'),
]
operations = [
migrations.AlterField(
model_name='book',
name='logo_backgrou... | 57.052632 | 741 | 0.624539 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ebooks', '0122_auto_20201005_2212'),
]
operations = [
migrations.AlterField(
model_name='book',
name='logo_background',
field=models.CharField(choices=... | true | true |
f75777aeba8153853338bef87650ce7df9f8b575 | 3,744 | py | Python | isi_sdk_8_1_1/isi_sdk_8_1_1/models/namespace_objects.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/namespace_objects.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/namespace_objects.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_1_1.models.namespa... | 26.553191 | 84 | 0.569979 |
import pprint
import re
import six
from isi_sdk_8_1_1.models.namespace_object import NamespaceObject
class NamespaceObjects(object):
swagger_types = {
'children': 'list[NamespaceObject]',
'resume': 'str'
}
attribute_map = {
'children': 'children',
'resume': 'res... | true | true |
f757791132a4d70fb5bcf9473e6ab74a0abe701d | 12,741 | py | Python | muted/tools/builder.py | st093186/mute-master | 9247e422e543d9ee96d4df9133bed2cbed62ddd0 | [
"MIT"
] | null | null | null | muted/tools/builder.py | st093186/mute-master | 9247e422e543d9ee96d4df9133bed2cbed62ddd0 | [
"MIT"
] | null | null | null | muted/tools/builder.py | st093186/mute-master | 9247e422e543d9ee96d4df9133bed2cbed62ddd0 | [
"MIT"
] | null | null | null |
from __future__ import annotations
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Tuple
from pathlib import Path
import json
import uuid
from random import randint
class Entity:
@staticmethod
def eid() -> str:
return uuid.uuid4().hex
class See... | 27.050955 | 77 | 0.460168 |
from __future__ import annotations
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Tuple
from pathlib import Path
import json
import uuid
from random import randint
class Entity:
@staticmethod
def eid() -> str:
return uuid.uuid4().hex
class See... | true | true |
f7577930b0857adc7797700574bb3687d7b2ef5f | 1,609 | py | Python | desafios/desafio68.py | JonasAraujoP/Python | 4ce6d330af4d078ff8658c82b3f3fbf2c41722d5 | [
"MIT"
] | null | null | null | desafios/desafio68.py | JonasAraujoP/Python | 4ce6d330af4d078ff8658c82b3f3fbf2c41722d5 | [
"MIT"
] | null | null | null | desafios/desafio68.py | JonasAraujoP/Python | 4ce6d330af4d078ff8658c82b3f3fbf2c41722d5 | [
"MIT"
] | null | null | null | from random import randint
print('\033[33m=-=\033[m'*12)
print('JOGO DO PAR OU ÍMPAR')
n = 0
total = 0
derrota = False
resultado = ''
vitoria = 0
while derrota == False:
print('\033[33m=-=\033[m'*12)
n = int(input('Digite um número: '))
jogador = ' '
while jogador not in 'PI':
jogador = str(inpu... | 38.309524 | 108 | 0.571162 | from random import randint
print('\033[33m=-=\033[m'*12)
print('JOGO DO PAR OU ÍMPAR')
n = 0
total = 0
derrota = False
resultado = ''
vitoria = 0
while derrota == False:
print('\033[33m=-=\033[m'*12)
n = int(input('Digite um número: '))
jogador = ' '
while jogador not in 'PI':
jogador = str(inpu... | true | true |
f75779e7519e2daefe5a8d086424ec9d3c7e4594 | 3,093 | py | Python | SmartAnno/umls/UMLSFinder.py | jianlins/SmartAnno | e0925c45853967683aa2955588437bd120fe39c3 | [
"Apache-2.0"
] | null | null | null | SmartAnno/umls/UMLSFinder.py | jianlins/SmartAnno | e0925c45853967683aa2955588437bd120fe39c3 | [
"Apache-2.0"
] | null | null | null | SmartAnno/umls/UMLSFinder.py | jianlins/SmartAnno | e0925c45853967683aa2955588437bd120fe39c3 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import json
import string
from collections import Set, OrderedDict
from SmartAnno.umls.Authentication import *
class UMLSFinder:
version = "current"
uri = "https://uts-ws.nlm.nih.gov"
content_endpoint = "/rest/search/" + version
AuthClient = None
translator ... | 39.151899 | 110 | 0.52053 | from __future__ import print_function
import json
import string
from collections import Set, OrderedDict
from SmartAnno.umls.Authentication import *
class UMLSFinder:
version = "current"
uri = "https://uts-ws.nlm.nih.gov"
content_endpoint = "/rest/search/" + version
AuthClient = None
translator ... | true | true |
f7577a7f9d7776a9e0bd927d89e5f84349f26b36 | 244 | py | Python | django_tenants/admin.py | buraketmen/django-tenants | 39bc6f9de7dff05eed5c2b062809493ef6f77571 | [
"MIT"
] | 514 | 2015-06-12T00:31:32.000Z | 2020-06-08T17:49:23.000Z | django_tenants/admin.py | tiagocapelli/django-tenants | 44b0bf78a5ccabcb28c4fa4ef0465aadc3125d1c | [
"MIT"
] | 363 | 2015-06-12T07:04:04.000Z | 2020-06-09T17:10:17.000Z | django_tenants/admin.py | tiagocapelli/django-tenants | 44b0bf78a5ccabcb28c4fa4ef0465aadc3125d1c | [
"MIT"
] | 159 | 2015-06-12T13:09:15.000Z | 2020-06-04T00:48:35.000Z | class TenantAdminMixin:
"""
Mixin for Tenant model:
It disables save and delete buttons when not in current or public tenant (preventing Exceptions).
"""
change_form_template = 'admin/django_tenants/tenant/change_form.html'
| 34.857143 | 101 | 0.737705 | class TenantAdminMixin:
change_form_template = 'admin/django_tenants/tenant/change_form.html'
| true | true |
f7577b9c061ac312e73eb10c9f1175cac0466757 | 1,650 | py | Python | src/log-analytics/setup.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/log-analytics/setup.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/log-analytics/setup.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 34.375 | 94 | 0.6 |
from codecs import open
from setuptools import setup, find_packages
VERSION = "0.2.2"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
... | true | true |
f7577db7882224a6c644028df541b18cf3d1b193 | 2,156 | py | Python | tests/h/services/group_scope_test.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | tests/h/services/group_scope_test.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | tests/h/services/group_scope_test.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from h.services.group_scope import group_scope_factory, GroupScopeService
class TestFetchByScope(object):
def test_it_returns_empty_list_if_origin_not_parseable(
self, svc, scope_util, document_uri
):
scope_util.p... | 29.534247 | 88 | 0.707792 |
from __future__ import unicode_literals
import pytest
from h.services.group_scope import group_scope_factory, GroupScopeService
class TestFetchByScope(object):
def test_it_returns_empty_list_if_origin_not_parseable(
self, svc, scope_util, document_uri
):
scope_util.parse_origin.return_valu... | true | true |
f7577dded470faf3326a4276e56ecef8cb81bcf9 | 1,255 | py | Python | code/fs/img.py | zhangsucheng/Python-pracive | e95fd3298abb3f23804d126c3e5f973d97d37cfe | [
"MIT"
] | null | null | null | code/fs/img.py | zhangsucheng/Python-pracive | e95fd3298abb3f23804d126c3e5f973d97d37cfe | [
"MIT"
] | null | null | null | code/fs/img.py | zhangsucheng/Python-pracive | e95fd3298abb3f23804d126c3e5f973d97d37cfe | [
"MIT"
] | null | null | null | from PIL import Image, ImageDraw, ImageFont, ImageFilter
import random
image = Image.open("../../res/images/man.jpg")
w, h = image.size
image.thumbnail((w // 2, h // 2))
image.save("../res/images/thumbMan.jpg", 'jpeg')
image2 = image.filter(ImageFilter.BLUR)
image2.save("../res/images/blurImage.jpg", 'jpeg')
# 随机字母... | 24.607843 | 84 | 0.622311 | from PIL import Image, ImageDraw, ImageFont, ImageFilter
import random
image = Image.open("../../res/images/man.jpg")
w, h = image.size
image.thumbnail((w // 2, h // 2))
image.save("../res/images/thumbMan.jpg", 'jpeg')
image2 = image.filter(ImageFilter.BLUR)
image2.save("../res/images/blurImage.jpg", 'jpeg')
def r... | true | true |
f7577deb3e7b0db8479f94f57dd46c27ad3ca1b2 | 463 | py | Python | docs/doc-generator.py | zxdawn/erc-uptrop | 58111cb80285a0f959ef140c7177195e823b5289 | [
"MIT"
] | 3 | 2020-10-09T07:13:40.000Z | 2022-02-15T13:14:36.000Z | docs/doc-generator.py | zxdawn/erc-uptrop | 58111cb80285a0f959ef140c7177195e823b5289 | [
"MIT"
] | 4 | 2020-07-04T18:56:25.000Z | 2022-02-14T13:14:47.000Z | docs/doc-generator.py | zxdawn/erc-uptrop | 58111cb80285a0f959ef140c7177195e823b5289 | [
"MIT"
] | 3 | 2020-10-09T07:17:16.000Z | 2022-01-09T09:36:46.000Z | import os
for module_name in os.listdir("../uptrop"):
if module_name.endswith(".py"):
doc_name = module_name.split('.')[0]
with open("source/" + doc_name + ".rst", 'w') as this_doc:
this_doc.write("="*len(doc_name) + "\n")
this_doc.write(doc_name + "\n")
this_doc... | 33.071429 | 66 | 0.546436 | import os
for module_name in os.listdir("../uptrop"):
if module_name.endswith(".py"):
doc_name = module_name.split('.')[0]
with open("source/" + doc_name + ".rst", 'w') as this_doc:
this_doc.write("="*len(doc_name) + "\n")
this_doc.write(doc_name + "\n")
this_doc... | true | true |
f7577ea431cb8a118d37ce601c081ed7a137425b | 5,295 | py | Python | polyglotdb/io/parsers/partitur.py | msonderegger/PolyglotDB | 583fd8ec14c2e34807b45b9f15fa19cffa130bfa | [
"MIT"
] | null | null | null | polyglotdb/io/parsers/partitur.py | msonderegger/PolyglotDB | 583fd8ec14c2e34807b45b9f15fa19cffa130bfa | [
"MIT"
] | null | null | null | polyglotdb/io/parsers/partitur.py | msonderegger/PolyglotDB | 583fd8ec14c2e34807b45b9f15fa19cffa130bfa | [
"MIT"
] | null | null | null | import re
import os
from polyglotdb.io.parsers.base import BaseParser # , PGAnnotation, PGAnnotationType, DiscourseData
from .speaker import FilenameSpeakerParser
from .speaker import DirectorySpeakerParser
from .base import DiscourseData
class PartiturParser(BaseParser):
_extensions = ['.par,2']
def __in... | 28.467742 | 100 | 0.550519 | import re
import os
from polyglotdb.io.parsers.base import BaseParser
from .speaker import FilenameSpeakerParser
from .speaker import DirectorySpeakerParser
from .base import DiscourseData
class PartiturParser(BaseParser):
_extensions = ['.par,2']
def __init__(self, annotation_tiers, hierarchy,
... | true | true |
f7577eb038e91b5ee0cfe66b36e3415b8708ac64 | 3,311 | py | Python | neutron/objects/agent.py | cloudbase/neutron | 50f31386cf6976225e5f0cdba81cdadec2a30872 | [
"Apache-2.0"
] | 1 | 2017-09-10T09:57:35.000Z | 2017-09-10T09:57:35.000Z | neutron/objects/agent.py | cloudbase/neutron | 50f31386cf6976225e5f0cdba81cdadec2a30872 | [
"Apache-2.0"
] | null | null | null | neutron/objects/agent.py | cloudbase/neutron | 50f31386cf6976225e5f0cdba81cdadec2a30872 | [
"Apache-2.0"
] | 1 | 2015-05-05T14:41:11.000Z | 2015-05-05T14:41:11.000Z | # Copyright (c) 2016 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 la... | 40.378049 | 78 | 0.67019 |
from oslo_serialization import jsonutils
from oslo_versionedobjects import base as obj_base
from oslo_versionedobjects import fields as obj_fields
from neutron.agent.common import utils
from neutron.db.models import agent as agent_model
from neutron.objects import base
@obj_base.VersionedObjectRegistry... | true | true |
f7577fdb41b0675f4891086c656242907cb8d88f | 6,693 | py | Python | azurelinuxagent/common/utils/cryptutil.py | ddiss/WALinuxAgent | 9c9893ebdec8a43bb15d84f309ff5b564436c408 | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/common/utils/cryptutil.py | ddiss/WALinuxAgent | 9c9893ebdec8a43bb15d84f309ff5b564436c408 | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/common/utils/cryptutil.py | ddiss/WALinuxAgent | 9c9893ebdec8a43bb15d84f309ff5b564436c408 | [
"Apache-2.0"
] | null | null | null | # Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft 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 b... | 41.571429 | 135 | 0.609144 |
import base64
import errno
import struct
import os.path
import subprocess
from azurelinuxagent.common.future import ustr, bytebuffer
from azurelinuxagent.common.exception import CryptError
import azurelinuxagent.common.logger as logger
import azurelinuxagent.common.utils.shellutil as shellutil
DE... | true | true |
f7578094ed3e452423b36e4060c2d1e5e3ee95aa | 1,531 | py | Python | examples/rrt_star/rrt_star_3d.py | Taylor-Liu/rrt-algorithms | 54be136b71d63f8e3ff37afadf267da49080100b | [
"MIT"
] | null | null | null | examples/rrt_star/rrt_star_3d.py | Taylor-Liu/rrt-algorithms | 54be136b71d63f8e3ff37afadf267da49080100b | [
"MIT"
] | null | null | null | examples/rrt_star/rrt_star_3d.py | Taylor-Liu/rrt-algorithms | 54be136b71d63f8e3ff37afadf267da49080100b | [
"MIT"
] | null | null | null | # This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
"/../../")
import numpy as np
from src.rrt.rrt_star import RRTStar
from src.search_space.search_s... | 34.795455 | 109 | 0.685173 |
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
"/../../")
import numpy as np
from src.rrt.rrt_star import RRTStar
from src.search_space.search_space import SearchSpace
from src.utilities.plotting import Plot
X_dimensions = np.array([(0, 100), (0, 100), (0, 100)]) ... | true | true |
f75780a925bf1eb0c17b22cc0d961234876f3dae | 3,844 | py | Python | src/pkg/caendr/caendr/services/cloud/lifesciences.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 3 | 2022-02-09T07:04:37.000Z | 2022-03-11T02:46:35.000Z | src/pkg/caendr/caendr/services/cloud/lifesciences.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 4 | 2022-01-28T22:28:08.000Z | 2022-02-11T21:47:15.000Z | src/pkg/caendr/caendr/services/cloud/lifesciences.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 1 | 2022-01-11T03:39:02.000Z | 2022-01-11T03:39:02.000Z | import os
from logzero import logger
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
from caendr.models.datastore import PipelineOperation, DatabaseOperation, NemascanMapping, IndelPrimer
from caendr.models.error import PipelineRunError
from caendr.services.cloud.datast... | 34.945455 | 113 | 0.742976 | import os
from logzero import logger
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
from caendr.models.datastore import PipelineOperation, DatabaseOperation, NemascanMapping, IndelPrimer
from caendr.models.error import PipelineRunError
from caendr.services.cloud.datast... | true | true |
f7578228f3ad6379b2554f01f299e99ccb278c03 | 598 | py | Python | tutorials/W3D1_RealNeurons/solutions/W3D1_Tutorial2_Solution_bb194a8f.py | NinelK/course-content | 317b4cf153a89afbddbd194e7fbb15c91588b3c5 | [
"CC-BY-4.0"
] | 26 | 2020-07-01T20:38:44.000Z | 2021-06-20T06:37:27.000Z | tutorials/W3D1_RealNeurons/solutions/W3D1_Tutorial2_Solution_bb194a8f.py | Andy-Dufrein/course-content | 977f4ddaaa4f33746672930ae01d5ea592dbbba0 | [
"CC-BY-4.0"
] | 3 | 2020-06-23T03:46:36.000Z | 2020-07-07T05:26:01.000Z | tutorials/W3D1_RealNeurons/solutions/W3D1_Tutorial2_Solution_bb194a8f.py | Andy-Dufrein/course-content | 977f4ddaaa4f33746672930ae01d5ea592dbbba0 | [
"CC-BY-4.0"
] | 16 | 2020-07-06T06:48:02.000Z | 2021-07-30T08:18:52.000Z |
"""
Discussion: This has got to do with which part of the input current distribution
is transferred to the spiking activity.
Intuitive understanding is difficult but this relationship arises due to non-linearities
in the neuron F-I curve. When F-I curve is linear, output correlation is independent
of the mean and... | 42.714286 | 89 | 0.779264 | true | true | |
f7578414dc14bad6e8dadf343973e5e34d74f443 | 1,227 | py | Python | zspider/spiders/news.py | Zephor5/zspider | 49178415137d67d7c88f2904bcb204df32082204 | [
"MIT"
] | 12 | 2015-12-23T10:13:31.000Z | 2021-04-25T17:12:39.000Z | zspider/spiders/news.py | Zephor5/zspider | 49178415137d67d7c88f2904bcb204df32082204 | [
"MIT"
] | 1 | 2022-03-02T14:53:18.000Z | 2022-03-02T14:53:18.000Z | zspider/spiders/news.py | Zephor5/zspider | 49178415137d67d7c88f2904bcb204df32082204 | [
"MIT"
] | 1 | 2017-09-18T08:51:51.000Z | 2017-09-18T08:51:51.000Z | # coding=utf-8
import logging
from scrapy import FormRequest
from scrapy import Request
from zspider.basespider import BaseSpider
__author__ = "zephor"
logger = logging.getLogger(__name__)
class NewsSpider(BaseSpider):
name = "news"
def __init__(self, *args, **kwargs):
super(NewsSpider, self).__... | 29.926829 | 81 | 0.607172 |
import logging
from scrapy import FormRequest
from scrapy import Request
from zspider.basespider import BaseSpider
__author__ = "zephor"
logger = logging.getLogger(__name__)
class NewsSpider(BaseSpider):
name = "news"
def __init__(self, *args, **kwargs):
super(NewsSpider, self).__init__(*args, ... | true | true |
f7578441293369161246239d37346131c24a2500 | 667 | py | Python | matchzoo/layers/NonMasking.py | ChangQF/MatchZoo | 991bdbad1e5166870fd4051646d7834a337d0709 | [
"Apache-2.0"
] | 71 | 2018-04-18T05:17:54.000Z | 2021-08-06T07:54:25.000Z | matchzoo/layers/NonMasking.py | ChangQF/MatchZoo | 991bdbad1e5166870fd4051646d7834a337d0709 | [
"Apache-2.0"
] | 6 | 2018-10-16T08:33:19.000Z | 2020-11-10T07:44:04.000Z | tools/layers/NonMasking.py | whatc0de/CFN-maste | ec3d1f5c8ee2c50eeaac96eca28f349fd9b92403 | [
"MIT"
] | 16 | 2018-08-03T09:44:56.000Z | 2020-08-25T14:02:42.000Z | from keras.layers import Input
from keras import backend as K
from keras.engine.topology import Layer
import numpy as np
class NonMasking(Layer):
def __init__(self, **kwargs):
self.supports_masking = True
super(NonMasking, self).__init__(**kwargs)
def build(self, input_shape):
input_sh... | 25.653846 | 51 | 0.688156 | from keras.layers import Input
from keras import backend as K
from keras.engine.topology import Layer
import numpy as np
class NonMasking(Layer):
def __init__(self, **kwargs):
self.supports_masking = True
super(NonMasking, self).__init__(**kwargs)
def build(self, input_shape):
input_sh... | true | true |
f75784815d57f3f2fa0a27df0a2c52fea3579f24 | 49,988 | py | Python | gaia.py | vorticityxyz/Gaia-api | 04e2a9ee2448830df72156aecf432eda0c6eb504 | [
"MIT"
] | null | null | null | gaia.py | vorticityxyz/Gaia-api | 04e2a9ee2448830df72156aecf432eda0c6eb504 | [
"MIT"
] | null | null | null | gaia.py | vorticityxyz/Gaia-api | 04e2a9ee2448830df72156aecf432eda0c6eb504 | [
"MIT"
] | null | null | null | # Description:
#
# WARNING!!! This file is a critical component of Vorticity Gaia API for seismic imaging
# PLEASE DO NOT MODIFY
#
# (C) Vorticity Inc. Mountain View, CA 2021
# Licence: MIT
import numpy as np
import grpc
import time
import os
import sys
import gaia_pb2
import gaia_pb2_grpc
import dispatch_pb2
import d... | 36.946046 | 161 | 0.636813 |
import numpy as np
import grpc
import time
import os
import sys
import gaia_pb2
import gaia_pb2_grpc
import dispatch_pb2
import dispatch_pb2_grpc
import validate
import tokens
import codes
CHUNK_SIZE = 1024 * 1024
IN_FILE = "_gaia_input.npz"
EL_IN_FILE = "_egaia_input.npz"
RTM_FILE = "_gaia_rtm.npz"
EL_RTM... | true | true |
f7578576588ffa5421aa8f2d033686a2d13fe10d | 804 | py | Python | ethereum_stats/process.py | carlesperezj/ethereum-analysis-tool | cad790ddab71b545d4d760f731d87a7130521e5e | [
"MIT"
] | null | null | null | ethereum_stats/process.py | carlesperezj/ethereum-analysis-tool | cad790ddab71b545d4d760f731d87a7130521e5e | [
"MIT"
] | 1 | 2018-07-02T08:40:10.000Z | 2018-07-02T08:40:10.000Z | ethereum_stats/process.py | carlesperezj/ethereum-analysis-tool | cad790ddab71b545d4d760f731d87a7130521e5e | [
"MIT"
] | 1 | 2018-07-27T14:50:43.000Z | 2018-07-27T14:50:43.000Z | from geth import LoggingMixin
from geth.process import BaseGethProcess, DevGethProcess
class RinkebyGethProcess(BaseGethProcess):
def __init__(self, geth_kwargs=None):
if geth_kwargs is None:
geth_kwargs = {}
if 'network_id' in geth_kwargs:
raise ValueError(
... | 24.363636 | 87 | 0.685323 | from geth import LoggingMixin
from geth.process import BaseGethProcess, DevGethProcess
class RinkebyGethProcess(BaseGethProcess):
def __init__(self, geth_kwargs=None):
if geth_kwargs is None:
geth_kwargs = {}
if 'network_id' in geth_kwargs:
raise ValueError(
... | true | true |
f757885955e41b8150fc01309000a6792d46e4a7 | 1,535 | py | Python | quotations/models.py | billdavisjr/wbd_fsd_project4 | 8f89879626378049dbe02a34e98531d1775e643d | [
"BSD-Source-Code"
] | null | null | null | quotations/models.py | billdavisjr/wbd_fsd_project4 | 8f89879626378049dbe02a34e98531d1775e643d | [
"BSD-Source-Code"
] | null | null | null | quotations/models.py | billdavisjr/wbd_fsd_project4 | 8f89879626378049dbe02a34e98531d1775e643d | [
"BSD-Source-Code"
] | null | null | null | from django.db import models
# Create your models here.
class Category(models.Model):
class Meta:
verbose_name_plural = 'Categories'
name = models.CharField(max_length=254)
display_name = models.CharField(max_length=254)
# note: did not add null=True and blank=True params to these
# as ... | 30.7 | 73 | 0.674919 | from django.db import models
class Category(models.Model):
class Meta:
verbose_name_plural = 'Categories'
name = models.CharField(max_length=254)
display_name = models.CharField(max_length=254)
objects = models.Manager()
def __str__(self):
return self.display_n... | true | true |
f7578971640f54fe252ba404d6023a8e7739f41a | 5,318 | py | Python | Geometry/HGCalCommonData/python/testHGCalV17XML_cfi.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | Geometry/HGCalCommonData/python/testHGCalV17XML_cfi.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | Geometry/HGCalCommonData/python/testHGCalV17XML_cfi.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v2/cmsexte... | 59.752809 | 82 | 0.723392 | import FWCore.ParameterSet.Config as cms
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v2/cmsexte... | true | true |
f7578ba764e0162148b7ef5e7848088f964745e0 | 1,432 | py | Python | run.py | Chasesc/codeinterview-sandbox | 132bc02fe087b112f9e03267a7bc7a68ea96eb8a | [
"Apache-2.0"
] | 24 | 2020-06-01T18:01:08.000Z | 2022-01-21T09:43:12.000Z | run.py | Chasesc/codeinterview-sandbox | 132bc02fe087b112f9e03267a7bc7a68ea96eb8a | [
"Apache-2.0"
] | null | null | null | run.py | Chasesc/codeinterview-sandbox | 132bc02fe087b112f9e03267a7bc7a68ea96eb8a | [
"Apache-2.0"
] | 7 | 2020-06-02T12:05:21.000Z | 2021-03-18T16:03:44.000Z | import logging
from celery.app import Celery
from celery import shared_task
from sandbox import settings, Sandbox, UnsupportedLanguage, TimeoutError, MemoryLimitExceeded
from sandbox.settings import LANG_CONFIG
logging.basicConfig(filename='worker.log',
level=logging.DEBUG,
fo... | 28.078431 | 93 | 0.61243 | import logging
from celery.app import Celery
from celery import shared_task
from sandbox import settings, Sandbox, UnsupportedLanguage, TimeoutError, MemoryLimitExceeded
from sandbox.settings import LANG_CONFIG
logging.basicConfig(filename='worker.log',
level=logging.DEBUG,
fo... | true | true |
f7578bc7406d32d42f02bfe448bf224dc0f049e3 | 2,662 | py | Python | tensorflow/python/kernel_tests/dense_update_ops_no_tsan_test.py | jylinman/tensorflow | 5248d111c3aeaf9f560cd77bff0f183f38e31e0b | [
"Apache-2.0"
] | 73 | 2017-01-05T09:06:08.000Z | 2021-11-06T14:00:50.000Z | tensorflow/python/kernel_tests/dense_update_ops_no_tsan_test.py | jylinman/tensorflow | 5248d111c3aeaf9f560cd77bff0f183f38e31e0b | [
"Apache-2.0"
] | 8 | 2017-04-10T10:36:20.000Z | 2021-02-07T01:02:32.000Z | tensorflow/python/kernel_tests/dense_update_ops_no_tsan_test.py | jylinman/tensorflow | 5248d111c3aeaf9f560cd77bff0f183f38e31e0b | [
"Apache-2.0"
] | 151 | 2016-11-10T09:01:15.000Z | 2022-01-18T08:13:49.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.128205 | 80 | 0.643501 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class AssignOpTest(tf.test.TestCase):
def testParallelUpdateWithoutLocking(self):
with self.test_session() as sess:
ones_t = tf.... | true | true |
f7578c2b6b304498679f715dd5d077b5b6ca529a | 29,997 | py | Python | flink-python/pyflink/fn_execution/operations.py | klDen/flink | a2c737891afde0c63c1a453b1ee164b80b6a702c | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/fn_execution/operations.py | klDen/flink | a2c737891afde0c63c1a453b1ee164b80b6a702c | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/fn_execution/operations.py | klDen/flink | a2c737891afde0c63c1a453b1ee164b80b6a702c | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 44.048458 | 100 | 0.663333 | w.append(True)
bounded_range_window_nums += 1
else:
self.is_bounded_range_window.append(False)
def generate_func(self, serialized_fn):
user_defined_funcs = []
self.window_indexes = []
self.mapper = []
for udf in serialized_fn.udfs:
... | true | true |
f7578c877b5d49e70e6b5e82fbbc3f5c52128365 | 2,358 | py | Python | make/jobserver/client.py | mithro/python-make-jobserver | f65d9d2f37822992b00a0e51897207a3f48d681b | [
"Apache-2.0"
] | null | null | null | make/jobserver/client.py | mithro/python-make-jobserver | f65d9d2f37822992b00a0e51897207a3f48d681b | [
"Apache-2.0"
] | null | null | null | make/jobserver/client.py | mithro/python-make-jobserver | f65d9d2f37822992b00a0e51897207a3f48d681b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Simple client for the make jobserver."""
import signal
from . import utils
try:
InterruptedError = InterruptedError
except NameError:
class InterruptedError(BaseException):
pass
class JobServerClient:
def __init__(self, make_flags=None):
self.tokens = []
... | 27.418605 | 75 | 0.57676 |
import signal
from . import utils
try:
InterruptedError = InterruptedError
except NameError:
class InterruptedError(BaseException):
pass
class JobServerClient:
def __init__(self, make_flags=None):
self.tokens = []
job_rd_fd, job_wr_fd = utils.fds_for_jobserver(make_flags)
... | true | true |
f7578cb83bd4d3f070bbc082e6e843273f7d77cc | 3,845 | py | Python | planetoid_dgi_benchmark.py | ggoh29/Simplicial-neural-network-benchmark | 9a12bcd054251790d85e3971f5473dcffaa5664b | [
"MIT"
] | 1 | 2022-02-04T23:06:52.000Z | 2022-02-04T23:06:52.000Z | planetoid_dgi_benchmark.py | ggoh29/Simplicial-neural-network-benchmark | 9a12bcd054251790d85e3971f5473dcffaa5664b | [
"MIT"
] | null | null | null | planetoid_dgi_benchmark.py | ggoh29/Simplicial-neural-network-benchmark | 9a12bcd054251790d85e3971f5473dcffaa5664b | [
"MIT"
] | 1 | 2022-02-04T23:07:09.000Z | 2022-02-04T23:07:09.000Z | from Planetoid.PlanetoidDataset import PlanetoidSCDataset
from models import planetoid_GCN, planetoid_GAT, planetoid_SCN, planetoid_SCConv, planetoid_SAN, planetoid_SAT
import torch.nn as nn
import torch
from Planetoid.DGI import DGI
from Planetoid.logreg import LogReg
from constants import DEVICE
2708, 79
dataset = '... | 28.065693 | 110 | 0.620286 | from Planetoid.PlanetoidDataset import PlanetoidSCDataset
from models import planetoid_GCN, planetoid_GAT, planetoid_SCN, planetoid_SCConv, planetoid_SAN, planetoid_SAT
import torch.nn as nn
import torch
from Planetoid.DGI import DGI
from Planetoid.logreg import LogReg
from constants import DEVICE
2708, 79
dataset = '... | true | true |
f7578d8657b41cea602dd5b3ea6653c8f286a509 | 449 | py | Python | matplotlib-3.4.3/matplotlib-3.4.3/examples/mplot3d/lines3d.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | 1 | 2021-11-13T17:21:44.000Z | 2021-11-13T17:21:44.000Z | matplotlib-3.4.3/matplotlib-3.4.3/examples/mplot3d/lines3d.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | null | null | null | matplotlib-3.4.3/matplotlib-3.4.3/examples/mplot3d/lines3d.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | null | null | null | """
================
Parametric Curve
================
This example demonstrates plotting a parametric curve in 3D.
"""
import numpy as np
import matplotlib.pyplot as plt
ax = plt.figure().add_subplot(projection='3d')
# Prepare arrays x, y, z
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 1... | 17.269231 | 60 | 0.610245 |
import numpy as np
import matplotlib.pyplot as plt
ax = plt.figure().add_subplot(projection='3d')
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
ax.plot(x, y, z, label='parametric curve')
ax.legend()
plt.show()
| true | true |
f7578dce3f97d742fef9a620e29c5eabe81153ac | 36,907 | py | Python | swagger_to/elm_client.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | swagger_to/elm_client.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | swagger_to/elm_client.py | koji8y/swagger-to | 8c9201a71220b183aa55b10d61ec322008633f58 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Generate code for an Elm client."""
# pylint: disable=too-many-lines
from typing import Optional, MutableMapping, List, Dict, TextIO, Any # pylint: disable=unused-import
import collections
import swagger_to
import swagger_to.intermediate
INDENT = ' ' * 4
class Typedef:
"""Represent a... | 35.901751 | 120 | 0.635381 |
from typing import Optional, MutableMapping, List, Dict, TextIO, Any
import collections
import swagger_to
import swagger_to.intermediate
INDENT = ' ' * 4
class Typedef:
def __init__(self) -> None:
self.description = ''
self.identifier = ''
def __str__(self) -> str:
return '{}(... | true | true |
f7578dd2b85828c539c786c7047d7d31a7251bec | 41,854 | py | Python | management/status_checks.py | ContainerizeUS/mailinabox | 5b135738b4d6bde2977d5900a77855294e2a7ae0 | [
"CC0-1.0"
] | 1 | 2015-12-07T08:55:25.000Z | 2015-12-07T08:55:25.000Z | management/status_checks.py | ContainerizeUS/mailinabox | 5b135738b4d6bde2977d5900a77855294e2a7ae0 | [
"CC0-1.0"
] | null | null | null | management/status_checks.py | ContainerizeUS/mailinabox | 5b135738b4d6bde2977d5900a77855294e2a7ae0 | [
"CC0-1.0"
] | 1 | 2018-11-25T18:50:16.000Z | 2018-11-25T18:50:16.000Z | #!/usr/bin/python3
#
# Checks that the upstream DNS has been set correctly and that
# SSL certificates have been signed, etc., and if not tells the user
# what to do next.
import sys, os, os.path, re, subprocess, datetime, multiprocessing.pool
import dns.reversename, dns.resolver
import dateutil.parser, dateutil.tz
i... | 44.525532 | 192 | 0.717924 |
import sys, os, os.path, re, subprocess, datetime, multiprocessing.pool
import dns.reversename, dns.resolver
import dateutil.parser, dateutil.tz
import idna
import psutil
from dns_update import get_dns_zones, build_tlsa_record, get_custom_dns_config, get_secondary_dns, get_custom_dns_record
from web_update impo... | true | true |
f7578ec4d3733ad6bea760f2ca67ceac04288a12 | 3,046 | py | Python | aydin/it/demo/n2s/nn/2D_generic.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/it/demo/n2s/nn/2D_generic.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/it/demo/n2s/nn/2D_generic.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | # flake8: noqa
import os
import time
import numpy
import numpy as np
from skimage.data import camera
from skimage.metrics import peak_signal_noise_ratio as psnr
from skimage.metrics import structural_similarity as ssim
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import... | 31.081633 | 87 | 0.687131 |
import os
import time
import numpy
import numpy as np
from skimage.data import camera
from skimage.metrics import peak_signal_noise_ratio as psnr
from skimage.metrics import structural_similarity as ssim
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import newyork, poll... | true | true |
f757903bd63ba0ca4c5b1d40b1c591e37c3e2fcf | 10,726 | py | Python | main.py | maxkunes/Blender-To-DayZ | beae1c3f50588c134eadf38909060bd7cfd6017d | [
"MIT"
] | 4 | 2020-09-24T18:21:46.000Z | 2021-08-13T14:18:51.000Z | main.py | maxkunes/Blender-To-DayZ | beae1c3f50588c134eadf38909060bd7cfd6017d | [
"MIT"
] | null | null | null | main.py | maxkunes/Blender-To-DayZ | beae1c3f50588c134eadf38909060bd7cfd6017d | [
"MIT"
] | 2 | 2020-09-24T12:24:49.000Z | 2022-02-01T10:50:38.000Z | import bpy
import bmesh
from inspect import getmembers
from pprint import pprint
class SetupOperator(bpy.types.Operator):
bl_idname = "blendertodayz.setup"
bl_label = "Reset Scene"
def remove_object(self, obj):
if isinstance(obj, bpy.types.Collection):
for child_col in obj.children:
... | 29.794444 | 180 | 0.558922 | import bpy
import bmesh
from inspect import getmembers
from pprint import pprint
class SetupOperator(bpy.types.Operator):
bl_idname = "blendertodayz.setup"
bl_label = "Reset Scene"
def remove_object(self, obj):
if isinstance(obj, bpy.types.Collection):
for child_col in obj.children:
... | true | true |
f75790bc09453573fcc96ae0a88023ca1245f578 | 2,556 | py | Python | layer_list_to_darknet.py | xhuohai/kendryte-model-compiler | b6ef72b5db83a3b421046150ff3e77843c2be5bb | [
"Apache-2.0"
] | null | null | null | layer_list_to_darknet.py | xhuohai/kendryte-model-compiler | b6ef72b5db83a3b421046150ff3e77843c2be5bb | [
"Apache-2.0"
] | null | null | null | layer_list_to_darknet.py | xhuohai/kendryte-model-compiler | b6ef72b5db83a3b421046150ff3e77843c2be5bb | [
"Apache-2.0"
] | null | null | null | '''
* Copyright 2018 Canaan 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... | 37.588235 | 89 | 0.621674 |
import tensor_list_to_layer_list
import numpy
def gen_config_file(layers):
ret = []
for layer in layers:
assert (isinstance(layer, tensor_list_to_layer_list.LayerBase))
ret.append('[' + layer.name + ']')
for k, v in layer.config.items():
ret.append(str(k) + '=' + str(v))
... | true | true |
f757917778e4bee917cc0d37b98df50928f63970 | 422 | py | Python | Numeric Patterns/numericpattern101.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | null | null | null | Numeric Patterns/numericpattern101.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 471 | 2022-01-15T07:07:18.000Z | 2022-02-28T16:01:42.000Z | Numeric Patterns/numericpattern101.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 2 | 2022-01-17T09:43:16.000Z | 2022-01-29T15:15:47.000Z |
def pattern(n):
count = n
for i in range(n):
for j in range(n - i - 1):
print(' ', end='')
for k in range(2 * i + 1):
print(count, end='')
count = count - 1
print()
print("Enter the number of rows: ")
n = int(input())
patt... | 14.066667 | 35 | 0.445498 |
def pattern(n):
count = n
for i in range(n):
for j in range(n - i - 1):
print(' ', end='')
for k in range(2 * i + 1):
print(count, end='')
count = count - 1
print()
print("Enter the number of rows: ")
n = int(input())
patt... | true | true |
f75791fad16120b7ce692ddbeeb1db89b7abd54c | 40,295 | py | Python | python/pyspark/sql/types.py | irgb/spark | ec8973d1245d4a99edeb7365d7f4b0063ac31ddf | [
"Apache-2.0",
"MIT"
] | 1 | 2015-07-17T14:30:08.000Z | 2015-07-17T14:30:08.000Z | python/pyspark/sql/types.py | newscred/spark | 257236c3e17906098f801cbc2059e7a9054e8cab | [
"Apache-2.0",
"MIT"
] | 1 | 2021-06-23T21:23:30.000Z | 2021-06-23T21:23:30.000Z | python/pyspark/sql/types.py | newscred/spark | 257236c3e17906098f801cbc2059e7a9054e8cab | [
"Apache-2.0",
"MIT"
] | 1 | 2020-07-23T14:03:42.000Z | 2020-07-23T14:03:42.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 31.603922 | 100 | 0.60943 |
import sys
import decimal
import time
import datetime
import calendar
import json
import re
from array import array
if sys.version >= "3":
long = int
unicode = str
from py4j.protocol import register_input_converter
from py4j.java_gateway import JavaClass
__all__ = [
"DataType", "NullType... | true | true |
f7579247e769863a785fed95c9e367f880c7fa20 | 14,850 | py | Python | analysis/main.py | arrismo/tripods-testing | 4ab9a7059df84cfd1f8984960900a3cf80b5c13c | [
"ECL-2.0"
] | null | null | null | analysis/main.py | arrismo/tripods-testing | 4ab9a7059df84cfd1f8984960900a3cf80b5c13c | [
"ECL-2.0"
] | null | null | null | analysis/main.py | arrismo/tripods-testing | 4ab9a7059df84cfd1f8984960900a3cf80b5c13c | [
"ECL-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
#Import Statements
import pandas as pd
import numpy as np
import nltk
import spacy
import courseToBOK
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')
nltk.download('averaged_perceptron_tagger')
import re
from re import *
from nltk.util import ngrams
from nltk.corpus... | 44.196429 | 219 | 0.711785 |
import pandas as pd
import numpy as np
import nltk
import spacy
import courseToBOK
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')
nltk.download('averaged_perceptron_tagger')
import re
from re import *
from nltk.util import ngrams
from nltk.corpus import stopwords
import gower
import mat... | true | true |
f757937d8b67e054895b249a7095c9820b7c8fd3 | 4,021 | py | Python | problems/test_compare_text_read.py | gregdferrell/algo | 974ae25b028d49bcb7ded6655a7e11dcf6aa221d | [
"MIT"
] | null | null | null | problems/test_compare_text_read.py | gregdferrell/algo | 974ae25b028d49bcb7ded6655a7e11dcf6aa221d | [
"MIT"
] | null | null | null | problems/test_compare_text_read.py | gregdferrell/algo | 974ae25b028d49bcb7ded6655a7e11dcf6aa221d | [
"MIT"
] | null | null | null | from .compare_text_read import compare_text, get_all_possible_mappings
def test_get_all_possible_mappings_1():
orig = [1, 2, 3, 5]
alt = [0, 1, 2, 3, 4, 5, 4, 3, 2]
result = get_all_possible_mappings(orig, alt)
assert len(result) == 4
assert len(result[0]) == 1
assert 1 in result[0]
assert len(result[1]) == 2... | 24.077844 | 70 | 0.613529 | from .compare_text_read import compare_text, get_all_possible_mappings
def test_get_all_possible_mappings_1():
orig = [1, 2, 3, 5]
alt = [0, 1, 2, 3, 4, 5, 4, 3, 2]
result = get_all_possible_mappings(orig, alt)
assert len(result) == 4
assert len(result[0]) == 1
assert 1 in result[0]
assert len(result[1]) == 2... | true | true |
f75794941e9a5106486e25d94a7619948a47cbb4 | 3,448 | py | Python | tests/suite/test_transport_server_status.py | snebel29/kubernetes-ingress | a31cd87288fa102ef9f094da7ecd371e9b36c680 | [
"Apache-2.0"
] | 1 | 2022-03-02T19:05:19.000Z | 2022-03-02T19:05:19.000Z | tests/suite/test_transport_server_status.py | snebel29/kubernetes-ingress | a31cd87288fa102ef9f094da7ecd371e9b36c680 | [
"Apache-2.0"
] | 228 | 2021-02-06T17:28:21.000Z | 2022-03-31T02:08:34.000Z | tests/suite/test_transport_server_status.py | snebel29/kubernetes-ingress | a31cd87288fa102ef9f094da7ecd371e9b36c680 | [
"Apache-2.0"
] | 1 | 2021-08-10T10:54:04.000Z | 2021-08-10T10:54:04.000Z | import pytest
from suite.resources_utils import wait_before_test
from suite.custom_resources_utils import (
read_ts,
patch_ts,
)
from settings import TEST_DATA
@pytest.mark.ts
@pytest.mark.parametrize(
"crd_ingress_controller, transport_server_setup",
[
(
{
"type":... | 30.785714 | 89 | 0.583817 | import pytest
from suite.resources_utils import wait_before_test
from suite.custom_resources_utils import (
read_ts,
patch_ts,
)
from settings import TEST_DATA
@pytest.mark.ts
@pytest.mark.parametrize(
"crd_ingress_controller, transport_server_setup",
[
(
{
"type":... | true | true |
f75794ba73d51f5a23821507da1fd9eb10a7707e | 637 | py | Python | app/utils.py | pyghassen/discount-codes-generator-job | c314acc9d578ad4f8ba5bf962a7e1169c9b97a31 | [
"MIT"
] | null | null | null | app/utils.py | pyghassen/discount-codes-generator-job | c314acc9d578ad4f8ba5bf962a7e1169c9b97a31 | [
"MIT"
] | null | null | null | app/utils.py | pyghassen/discount-codes-generator-job | c314acc9d578ad4f8ba5bf962a7e1169c9b97a31 | [
"MIT"
] | null | null | null | import random
import string
def generate_codes(number_of_codes: int, code_length: int):
"""Generates X number of random codes based on the provided length.
Pramas:
-------
number_of_codes (int): The number of the random codes that shall be
created which should be unique also.
... | 31.85 | 89 | 0.6719 | import random
import string
def generate_codes(number_of_codes: int, code_length: int):
codes = set()
choices = string.ascii_uppercase + string.digits
while len(codes) < number_of_codes:
code = ''.join(random.SystemRandom().choice(choices) for _ in range(code_length))
codes.add(code)
r... | true | true |
f757955a469acb1f229032ce9cab3a2e5dbb1622 | 3,987 | py | Python | src/comtris.py | 837477/COMTRIS_AI | 2cb49a9a9c5de785d6b1a864abf8d5eeb6db3302 | [
"MIT"
] | 2 | 2021-01-18T11:27:15.000Z | 2021-01-26T15:49:50.000Z | src/comtris.py | 837477/COMTRIS_AI | 2cb49a9a9c5de785d6b1a864abf8d5eeb6db3302 | [
"MIT"
] | null | null | null | src/comtris.py | 837477/COMTRIS_AI | 2cb49a9a9c5de785d6b1a864abf8d5eeb6db3302 | [
"MIT"
] | 1 | 2021-01-18T11:05:37.000Z | 2021-01-18T11:05:37.000Z | import os
import torch
import torch.nn as nn
import numpy as np
from pymongo import MongoClient
class Net(nn.Module):
def __init__(self, D_in, D_out):
super(Net,self).__init__()
self.layer_1 = nn.Linear(D_in, D_out*2)
self.layer_out = nn.Linear(D_out*2, D_out)
self.relu = nn.ReLU()... | 32.680328 | 110 | 0.520943 | import os
import torch
import torch.nn as nn
import numpy as np
from pymongo import MongoClient
class Net(nn.Module):
def __init__(self, D_in, D_out):
super(Net,self).__init__()
self.layer_1 = nn.Linear(D_in, D_out*2)
self.layer_out = nn.Linear(D_out*2, D_out)
self.relu = nn.ReLU()... | true | true |
f75795a1973b5b08811b277aebf2722348e9f637 | 1,327 | py | Python | controllers/sponsors.py | bkahlerventer/web2congress | 30463ef05a64b95f9ec8a5575e1f45a99986b607 | [
"BSD-3-Clause"
] | 3 | 2016-12-29T23:02:35.000Z | 2021-07-01T01:10:12.000Z | controllers/sponsors.py | reingart/web2conf | a5e01d9fc2c25b271db7cee528faef58a46e7106 | [
"BSD-3-Clause"
] | null | null | null | controllers/sponsors.py | reingart/web2conf | a5e01d9fc2c25b271db7cee528faef58a46e7106 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf8
# try something like
def index():
rows = db((db.sponsor.text!="")&(db.sponsor.active==True)&(db.sponsor.level!=SPONSOR_LEVELS[-3])).select()
if rows:
return dict(sponsors_detail=rows)
else:
return plugin_flatpage()
def prospectus(): return plugin_flatpage()
@auth.requires_lo... | 31.595238 | 110 | 0.635268 |
def index():
rows = db((db.sponsor.text!="")&(db.sponsor.active==True)&(db.sponsor.level!=SPONSOR_LEVELS[-3])).select()
if rows:
return dict(sponsors_detail=rows)
else:
return plugin_flatpage()
def prospectus(): return plugin_flatpage()
@auth.requires_login()
def sign_up():
if reques... | true | true |
f757975469f58bda98c08b074c994dd6756c92eb | 3,643 | py | Python | python/benchmark_plotter/latexify.py | tum-db/partitioned-filters | 56c20102715a442cbec9ecb732d41de15b31c828 | [
"MIT"
] | 5 | 2021-08-16T17:48:45.000Z | 2022-03-10T22:53:54.000Z | python/benchmark_plotter/latexify.py | tum-db/partitioned-filters | 56c20102715a442cbec9ecb732d41de15b31c828 | [
"MIT"
] | null | null | null | python/benchmark_plotter/latexify.py | tum-db/partitioned-filters | 56c20102715a442cbec9ecb732d41de15b31c828 | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator, FuncFormatter
import numpy as np
def latexify(fig_width=None, fig_height=None, columns=1):
"""Set up matplotlib's RC params for LaTeX plotting.
Call this before plotting a figure.
Parameters
----------
... | 33.422018 | 119 | 0.622015 | import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator, FuncFormatter
import numpy as np
def latexify(fig_width=None, fig_height=None, columns=1):
assert (columns in [1, 2])
if fig_width is None:
fig_width = 3.39 if columns == 1 else 6.9
... | true | true |
f75797ba33f67aed0eb393930a7ffe6ad18554a5 | 17,544 | py | Python | capstone/config/settings/settings_base.py | ChefAndy/capstone | bac7c44518312c5b64462ea92ecbabdcb5d29bb6 | [
"MIT"
] | null | null | null | capstone/config/settings/settings_base.py | ChefAndy/capstone | bac7c44518312c5b64462ea92ecbabdcb5d29bb6 | [
"MIT"
] | 3 | 2018-11-29T17:48:45.000Z | 2019-10-22T19:00:39.000Z | capstone/config/settings/settings_base.py | ChefAndy/capstone | bac7c44518312c5b64462ea92ecbabdcb5d29bb6 | [
"MIT"
] | null | null | null | import os
import sys
from copy import deepcopy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
SERVICES_DIR = os.path.join(os.path.dirname(BASE_DIR), 'services')
ALLOWED_HOSTS = ['localhost', '127.0.0.1',... | 29.485714 | 158 | 0.649681 | import os
import sys
from copy import deepcopy
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
SERVICES_DIR = os.path.join(os.path.dirname(BASE_DIR), 'services')
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]', '.test']
ADMINS = [('Caselaw Access Project', 'info@case.law... | true | true |
f757989afe2770c5ee2356aae8e676b16fe687c5 | 11,694 | py | Python | gnes/base/__init__.py | awesome-archive/gnes | 21311f05747303d0acdc303f2ade830ef971f47d | [
"Apache-2.0"
] | null | null | null | gnes/base/__init__.py | awesome-archive/gnes | 21311f05747303d0acdc303f2ade830ef971f47d | [
"Apache-2.0"
] | null | null | null | gnes/base/__init__.py | awesome-archive/gnes | 21311f05747303d0acdc303f2ade830ef971f47d | [
"Apache-2.0"
] | null | null | null | # Tencent is pleased to support the open source community by making GNES available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company. 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... | 34.093294 | 118 | 0.595006 |
import inspect
import os
import pickle
import tempfile
import uuid
from functools import wraps
from typing import Dict, Any, Union, TextIO, TypeVar, Type
import ruamel.yaml.constructor
from ..helper import set_logger, profiling, yaml, parse_arg, touch_dir, FileLock
__all__ = ['TrainableBase']
T = ... | true | true |
f75799301b3763b5158c4600bfcffeaf50334491 | 294 | py | Python | aging/environment_processing/__init__.py | Deep-Learning-and-Aging/Scalars-based-models-and-XWAS-pipeline | f6913ce4ec1f6aed358ba27fdf575257f712c132 | [
"MIT"
] | null | null | null | aging/environment_processing/__init__.py | Deep-Learning-and-Aging/Scalars-based-models-and-XWAS-pipeline | f6913ce4ec1f6aed358ba27fdf575257f712c132 | [
"MIT"
] | null | null | null | aging/environment_processing/__init__.py | Deep-Learning-and-Aging/Scalars-based-models-and-XWAS-pipeline | f6913ce4ec1f6aed358ba27fdf575257f712c132 | [
"MIT"
] | null | null | null | from . import base_processing
from . import FamilyHistory
from . import HealthAndMedicalHistory
from . import LifestyleAndEnvironment
from . import PsychosocialFactors
from . import SocioDemographics
"""
Pre-processing classes.
Load and select features for each dataset in the UK biobank.
"""
| 24.5 | 60 | 0.812925 | from . import base_processing
from . import FamilyHistory
from . import HealthAndMedicalHistory
from . import LifestyleAndEnvironment
from . import PsychosocialFactors
from . import SocioDemographics
| true | true |
f7579b5e4054a61be981378a4fb47307586da147 | 7,060 | py | Python | experiments/net/mynn.py | parneetk/PyTorch-Style-Transfer | f38ec4b1cd57cee4304787b054a6e6c9ce3b00ff | [
"MIT"
] | null | null | null | experiments/net/mynn.py | parneetk/PyTorch-Style-Transfer | f38ec4b1cd57cee4304787b054a6e6c9ce3b00ff | [
"MIT"
] | null | null | null | experiments/net/mynn.py | parneetk/PyTorch-Style-Transfer | f38ec4b1cd57cee4304787b054a6e6c9ce3b00ff | [
"MIT"
] | 1 | 2020-10-29T01:29:41.000Z | 2020-10-29T01:29:41.000Z | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang
## ECE Department, Rutgers University
## Email: zhang.hang@rutgers.edu
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this sou... | 34.607843 | 92 | 0.697875 | gram
class InstanceNormalization(nn.Module):
def __init__(self, dim, eps=1e-5):
super(InstanceNormalization, self).__init__()
self.weight = nn.Parameter(torch.FloatTensor(dim))
self.bias = nn.Parameter(torch.FloatTensor(dim))
self.eps = eps
self._reset_parameters()
def _reset_parameters(self):
self.w... | true | true |
f7579b873dbc1e427ca16d7cae333ca1140807ce | 593 | py | Python | config/config.py | deecamp2019-group20/CNN_PokerNet | 751576cb941be57c8a37656feaff14b414c3dcb2 | [
"MIT"
] | 1 | 2019-12-12T09:01:49.000Z | 2019-12-12T09:01:49.000Z | config/config.py | deecamp2019-group20/CNN_PokerNet | 751576cb941be57c8a37656feaff14b414c3dcb2 | [
"MIT"
] | 1 | 2019-11-25T13:43:45.000Z | 2019-11-25T13:43:45.000Z | config/config.py | deecamp2019-group20/CNN_PokerNet | 751576cb941be57c8a37656feaff14b414c3dcb2 | [
"MIT"
] | 1 | 2020-03-15T06:20:04.000Z | 2020-03-15T06:20:04.000Z | config = {
'device': 'cuda:0',
'seed': 42,
# config for logging
'logging': {
'log_file': 'run.log',
'fmt': '%(asctime)s: %(message)s',
'level': 'INFO',
},
# config to load and save network
'net': {
'saved_net_path': None,
'net_path': 'models/resnet.p... | 19.129032 | 42 | 0.46543 | config = {
'device': 'cuda:0',
'seed': 42,
'logging': {
'log_file': 'run.log',
'fmt': '%(asctime)s: %(message)s',
'level': 'INFO',
},
'net': {
'saved_net_path': None,
'net_path': 'models/resnet.py',
'saved_params_path': None
},
... | true | true |
f7579d4cf152d88c256c0a445d3e96f8543944c3 | 5,384 | py | Python | scripts/evaluation/ec_summary.py | Mangul-Lab-USC/benchmarking_error_correction | a18d22b49f0f28424cc3be8cda53e768866d451e | [
"MIT"
] | 7 | 2020-04-09T13:13:54.000Z | 2022-01-04T04:29:59.000Z | scripts/evaluation/ec_summary.py | Mangul-Lab-USC/benchmarking_error_correction | a18d22b49f0f28424cc3be8cda53e768866d451e | [
"MIT"
] | null | null | null | scripts/evaluation/ec_summary.py | Mangul-Lab-USC/benchmarking_error_correction | a18d22b49f0f28424cc3be8cda53e768866d451e | [
"MIT"
] | 4 | 2020-04-15T13:10:35.000Z | 2020-08-06T16:31:00.000Z | #####################################################################################
# Compression Summary for Error Correction Benchmarking
# zar-lab ucla
# 5/17/18
# supervisor: Serghei Mangul
# author: Keith Mitchell
"""
Functions Contained
check_existence: checks if the filename supplied has already ... | 49.851852 | 131 | 0.565379 | true | true | |
f7579d88cf4a4a19273d618b95131ee00894bb57 | 1,090 | py | Python | PyPDFForm/middleware/constants.py | XinyuLiu5566/PyPDFForm | bfc4a8046b2cfd94b41fd593fa7044b869467a8a | [
"MIT"
] | 9 | 2020-10-31T00:55:25.000Z | 2022-01-26T01:35:48.000Z | PyPDFForm/middleware/constants.py | XinyuLiu5566/PyPDFForm | bfc4a8046b2cfd94b41fd593fa7044b869467a8a | [
"MIT"
] | 135 | 2020-10-30T00:09:36.000Z | 2022-02-11T02:03:57.000Z | PyPDFForm/middleware/constants.py | XinyuLiu5566/PyPDFForm | bfc4a8046b2cfd94b41fd593fa7044b869467a8a | [
"MIT"
] | 3 | 2021-04-16T07:41:27.000Z | 2021-12-08T22:57:27.000Z | # -*- coding: utf-8 -*-
"""Contains constants for middleware layer."""
from typing import Tuple, Union
class Text:
"""Contains constants for text parameters."""
@property
def global_font(self) -> str:
"""Used for setting global font for text."""
return "Helvetica"
@property
def... | 23.191489 | 72 | 0.607339 |
from typing import Tuple, Union
class Text:
@property
def global_font(self) -> str:
return "Helvetica"
@property
def global_font_size(self) -> Union[float, int]:
return 12
@property
def global_font_color(
self,
) -> Tuple[Union[float, int], Union[float, int],... | true | true |
f7579e3dc7485e922b4ccc26fda0155e05448183 | 11,674 | py | Python | train.py | dennisbappert/sod-using-vit | 24ed0692d8eb09adf2f74e69a132f267a4137b68 | [
"Apache-2.0"
] | 89 | 2021-03-17T01:32:38.000Z | 2022-03-25T08:38:54.000Z | train.py | dennisbappert/sod-using-vit | 24ed0692d8eb09adf2f74e69a132f267a4137b68 | [
"Apache-2.0"
] | 12 | 2021-03-19T10:47:03.000Z | 2022-03-24T04:45:50.000Z | train.py | dennisbappert/sod-using-vit | 24ed0692d8eb09adf2f74e69a132f267a4137b68 | [
"Apache-2.0"
] | 13 | 2021-03-18T18:40:32.000Z | 2022-03-11T16:43:52.000Z | import datetime
import os
import random
import time
import warnings
import hydra
import torch
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
from torch.cuda.amp import autocast, GradScaler
from torch.nn import functional as F
from torch.utils.data import DataLoader, WeightedRandomSampl... | 41.692857 | 120 | 0.649392 | import datetime
import os
import random
import time
import warnings
import hydra
import torch
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
from torch.cuda.amp import autocast, GradScaler
from torch.nn import functional as F
from torch.utils.data import DataLoader, WeightedRandomSampl... | true | true |
f7579f581f9dec7d898c2c0a292c7a4c573dfb16 | 1,046 | py | Python | kubernetes_asyncio/test/test_v1beta1_non_resource_rule.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | 1 | 2021-01-13T09:28:57.000Z | 2021-01-13T09:28:57.000Z | kubernetes_asyncio/test/test_v1beta1_non_resource_rule.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1beta1_non_resource_rule.py | hubo1016/kubernetes_asyncio | d57e9e9be11f6789e1ce8d5b161acb64d29acf35 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... | 25.512195 | 119 | 0.737094 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.models.v1beta1_non_resource_rule import V1beta1NonResourceRule
from kubernetes_asyncio.client.rest import ApiException
class TestV1beta1NonResourceRule(unittest.TestCase):
def setUp(self... | true | true |
f757a053fef4dde8257b5fd5ec2389f29a8667d9 | 670 | py | Python | mirage/projectstartup/__init__.py | fossabot/django-mirage | 814b3f2486af31f9dca42ef4bb0215655fe0aea6 | [
"Apache-2.0"
] | 4 | 2019-05-16T09:26:21.000Z | 2022-02-14T06:21:40.000Z | mirage/projectstartup/__init__.py | fossabot/django-mirage | 814b3f2486af31f9dca42ef4bb0215655fe0aea6 | [
"Apache-2.0"
] | 77 | 2019-05-10T22:24:54.000Z | 2021-07-02T03:11:01.000Z | mirage/projectstartup/__init__.py | fossabot/django-mirage | 814b3f2486af31f9dca42ef4bb0215655fe0aea6 | [
"Apache-2.0"
] | 1 | 2018-12-08T09:57:54.000Z | 2018-12-08T09:57:54.000Z | # -*- coding: utf-8 -*-
"""
Copyright 2017-2018 Shota Shimazu.
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 appl... | 35.263158 | 75 | 0.746269 |
from .angular_app_create import NgStartupWorkFlow
| true | true |
f757a0da335d1541b5996e8f6beaad6fb040c3ea | 2,241 | py | Python | tests/test_forms.py | christianmlong/dhmn | cce45f3b99e8f32bc4961f8119c859039d2c0755 | [
"BSD-3-Clause"
] | null | null | null | tests/test_forms.py | christianmlong/dhmn | cce45f3b99e8f32bc4961f8119c859039d2c0755 | [
"BSD-3-Clause"
] | null | null | null | tests/test_forms.py | christianmlong/dhmn | cce45f3b99e8f32bc4961f8119c859039d2c0755 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from dhmn_demo.public.forms import LoginForm
from dhmn_demo.user.forms import RegisterForm
from .factories import UserFactory
class TestRegisterForm:
def test_validate_user_already_registered(self, user):
# Enters username that is already registered
form = Re... | 36.145161 | 74 | 0.682285 |
import pytest
from dhmn_demo.public.forms import LoginForm
from dhmn_demo.user.forms import RegisterForm
from .factories import UserFactory
class TestRegisterForm:
def test_validate_user_already_registered(self, user):
form = RegisterForm(username=user.username, email='foo@bar.com',
... | true | true |
f757a1906d4f821266ea73eb9527eb2ad8102948 | 236 | py | Python | utils/db_api/mongo.py | YoshlikMedia/DTM-Moderator-bot | e6cbf10fdc7844cd3b33d642f8c15ccfe2817b40 | [
"MIT"
] | null | null | null | utils/db_api/mongo.py | YoshlikMedia/DTM-Moderator-bot | e6cbf10fdc7844cd3b33d642f8c15ccfe2817b40 | [
"MIT"
] | null | null | null | utils/db_api/mongo.py | YoshlikMedia/DTM-Moderator-bot | e6cbf10fdc7844cd3b33d642f8c15ccfe2817b40 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from data.config import IP
client = MongoClient(IP)
storage = MemoryStorage()
database = client['DTM-Moderator']
user_db = database['users']
| 23.6 | 60 | 0.800847 | from pymongo import MongoClient
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from data.config import IP
client = MongoClient(IP)
storage = MemoryStorage()
database = client['DTM-Moderator']
user_db = database['users']
| true | true |
f757a191caa69452b1670baf90bf6872d6e05eaf | 342 | py | Python | locale/pot/api/core/_autosummary/pyvista-PolyData-is_all_triangles-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 4 | 2020-08-07T08:19:19.000Z | 2020-12-04T09:51:11.000Z | locale/pot/api/core/_autosummary/pyvista-PolyData-is_all_triangles-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 19 | 2020-08-06T00:24:30.000Z | 2022-03-30T19:22:24.000Z | locale/pot/api/core/_autosummary/pyvista-PolyData-is_all_triangles-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 1 | 2021-03-09T07:50:40.000Z | 2021-03-09T07:50:40.000Z | # Show a mesh from :func:`pyvista.Plane` is not composed of all
# triangles.
#
import pyvista
plane = pyvista.Plane()
plane.is_all_triangles
# Expected:
## False <CallableBool>
#
# Show that the mesh from :func:`pyvista.Sphere` contains only
# triangles.
#
sphere = pyvista.Sphere()
sphere.is_all_triangles
# Expected:
#... | 20.117647 | 63 | 0.74269 |
import pyvista
plane = pyvista.Plane()
plane.is_all_triangles
Sphere()
sphere.is_all_triangles
| true | true |
f757a1aa0d85fe52965ea5febe0d8af809a7986b | 499 | py | Python | django_select2/models.py | softwaydev/django-select2 | 2f6f08a806708ecdceee906419bc1c2afdf2cc01 | [
"Apache-2.0"
] | null | null | null | django_select2/models.py | softwaydev/django-select2 | 2f6f08a806708ecdceee906419bc1c2afdf2cc01 | [
"Apache-2.0"
] | null | null | null | django_select2/models.py | softwaydev/django-select2 | 2f6f08a806708ecdceee906419bc1c2afdf2cc01 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import force_text
from six import python_2_unicode_compatible
@python_2_unicode_compatible
class KeyMap(models.Model):
key = models.CharField(max_length=40, unique=True)
val... | 29.352941 | 62 | 0.753507 |
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import force_text
from six import python_2_unicode_compatible
@python_2_unicode_compatible
class KeyMap(models.Model):
key = models.CharField(max_length=40, unique=True)
value = models.CharField(... | true | true |
f757a2352f9e417f523598cafbaaacdc4a27af5b | 6,571 | py | Python | emotion_cn.py | redtreeai/easy_text_emotion | df6e0f35ac49d041c9029514b9a42b274a63dbe6 | [
"MIT"
] | 31 | 2019-05-16T01:30:55.000Z | 2022-02-18T02:37:42.000Z | emotion_cn.py | Chen-rainy/easy_text_emotion | df6e0f35ac49d041c9029514b9a42b274a63dbe6 | [
"MIT"
] | null | null | null | emotion_cn.py | Chen-rainy/easy_text_emotion | df6e0f35ac49d041c9029514b9a42b274a63dbe6 | [
"MIT"
] | 6 | 2020-03-06T12:14:24.000Z | 2022-01-12T07:46:22.000Z | # -*- coding: utf-8 -*-
# @Time : 19-3-28 上午10:14
# @Author : Redtree
# @File : emotion_cn.py
# @Desc :
import load_dict
all_list = load_dict.getAllList()
import jieba
import random
#文本情感分析算法
def cutSentence(input): #结巴分词
seg_list = jieba.cut(input) # 默认是精确模式
segwordList = (",".join(seg_list))
s... | 33.871134 | 135 | 0.570842 |
import load_dict
all_list = load_dict.getAllList()
import jieba
import random
def cutSentence(input):
seg_list = jieba.cut(input)
segwordList = (",".join(seg_list))
ssp = segwordList.split(',')
return ssp
def reduceFunc(reduceTimes):
addY=(10/reduceTimes)/10
return addY
def le... | true | true |
f757a239a242cff322db2e8a18fd08b09134904a | 479 | py | Python | total_connect_client/info.py | DanielDidWhat/total-connect-client | 4baab6855380521833fc4bedc11a3cb870ba90c9 | [
"MIT"
] | null | null | null | total_connect_client/info.py | DanielDidWhat/total-connect-client | 4baab6855380521833fc4bedc11a3cb870ba90c9 | [
"MIT"
] | null | null | null | total_connect_client/info.py | DanielDidWhat/total-connect-client | 4baab6855380521833fc4bedc11a3cb870ba90c9 | [
"MIT"
] | null | null | null | """Test your system from the command line."""
import getpass
import logging
import sys
from client import TotalConnectClient
logging.basicConfig(filename="test.log", level=logging.DEBUG)
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("usage: python3 test.py username [password]\n")
sys.exit(1)
USERNAME ... | 19.16 | 61 | 0.707724 |
import getpass
import logging
import sys
from client import TotalConnectClient
logging.basicConfig(filename="test.log", level=logging.DEBUG)
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("usage: python3 test.py username [password]\n")
sys.exit(1)
USERNAME = sys.argv[1]
if len(sys.argv) == 2:
PASSW... | true | true |
f757a30330fca66f05b214fd75fc0f2078270266 | 392 | py | Python | homes_to_let/factories/letting_feature_factory.py | Xtuden-com/django-property | 6656d469a5d06c103a34c2e68b9f1754413fb3ba | [
"MIT"
] | null | null | null | homes_to_let/factories/letting_feature_factory.py | Xtuden-com/django-property | 6656d469a5d06c103a34c2e68b9f1754413fb3ba | [
"MIT"
] | null | null | null | homes_to_let/factories/letting_feature_factory.py | Xtuden-com/django-property | 6656d469a5d06c103a34c2e68b9f1754413fb3ba | [
"MIT"
] | null | null | null | from faker import Factory
from homes_to_let.models import LettingFeature
from homes_to_let.factories.letting_factory import LettingFactory
import factory
fake = Factory.create('en_GB')
class LettingFeatureFactory(factory.DjangoModelFactory):
class Meta:
model = LettingFeature
property = factory.S... | 21.777778 | 65 | 0.778061 | from faker import Factory
from homes_to_let.models import LettingFeature
from homes_to_let.factories.letting_factory import LettingFactory
import factory
fake = Factory.create('en_GB')
class LettingFeatureFactory(factory.DjangoModelFactory):
class Meta:
model = LettingFeature
property = factory.S... | true | true |
f757a303ae3bf493825a1827aedb4a1008b13b93 | 9,249 | py | Python | custom_components/kia_uvo/HyundaiBlueLinkAPIUSA.py | cdnninja/kia_uvo | 7f45ef359bb1e69d45009cf7adf55473dbc86233 | [
"MIT"
] | null | null | null | custom_components/kia_uvo/HyundaiBlueLinkAPIUSA.py | cdnninja/kia_uvo | 7f45ef359bb1e69d45009cf7adf55473dbc86233 | [
"MIT"
] | 19 | 2021-10-31T19:22:33.000Z | 2021-11-20T08:11:29.000Z | custom_components/kia_uvo/HyundaiBlueLinkAPIUSA.py | cdnninja/kia_uvo | 7f45ef359bb1e69d45009cf7adf55473dbc86233 | [
"MIT"
] | null | null | null | import logging
import time
from datetime import timedelta, datetime
import json
import push_receiver
import random
import requests
from urllib.parse import parse_qs, urlparse
import uuid
import time
import curlify
from .const import (
DOMAIN,
BRANDS,
BRAND_HYUNDAI,
BRAND_KIA,
DATE_FORMAT,
VEHI... | 34.3829 | 144 | 0.596389 | import logging
import time
from datetime import timedelta, datetime
import json
import push_receiver
import random
import requests
from urllib.parse import parse_qs, urlparse
import uuid
import time
import curlify
from .const import (
DOMAIN,
BRANDS,
BRAND_HYUNDAI,
BRAND_KIA,
DATE_FORMAT,
VEHI... | true | true |
f757a341a5594a9f384193aecd874c98f5ebe54b | 1,164 | py | Python | benchexec/tools/ufo.py | SvenUmbricht/benchexec | ac2c3d71f6b390cea4b5da73d7c9013c6f5eb61a | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | 137 | 2016-01-12T08:00:43.000Z | 2022-03-28T20:05:22.000Z | benchexec/tools/ufo.py | SvenUmbricht/benchexec | ac2c3d71f6b390cea4b5da73d7c9013c6f5eb61a | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | 505 | 2015-12-15T09:57:34.000Z | 2022-03-19T13:15:07.000Z | benchexec/tools/ufo.py | SvenUmbricht/benchexec | ac2c3d71f6b390cea4b5da73d7c9013c6f5eb61a | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | 164 | 2015-12-17T20:17:29.000Z | 2022-03-18T02:53:28.000Z | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.util as util
import benchexec.tools.template
class Tool(benchexec.tools... | 31.459459 | 80 | 0.612543 |
import benchexec.util as util
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool):
def executable(self):
return util.find_executable("ufo.sh")
def name(self):
return "Ufo"
def determine_result(self, returncode, returnsignal, output, isTimeout):
ou... | true | true |
f757a3966da9ef17e7b9b24cd3a0a4918a658924 | 5,252 | py | Python | deeppavlov/models/feb/feb_common.py | antorionus/DeepPavlov_FEB | 10159f07434865092d1a72fde2e8244de436db67 | [
"Apache-2.0"
] | null | null | null | deeppavlov/models/feb/feb_common.py | antorionus/DeepPavlov_FEB | 10159f07434865092d1a72fde2e8244de436db67 | [
"Apache-2.0"
] | null | null | null | deeppavlov/models/feb/feb_common.py | antorionus/DeepPavlov_FEB | 10159f07434865092d1a72fde2e8244de436db67 | [
"Apache-2.0"
] | null | null | null |
from enum import Enum
from overrides import overrides
from deeppavlov.core.common.registry import register
from deeppavlov.core.models.component import Component
from deeppavlov.core.common.log import get_logger
from .feb_objects import *
from question2wikidata.questions import pretty_json
from time import time
... | 33.452229 | 126 | 0.577113 |
from enum import Enum
from overrides import overrides
from deeppavlov.core.common.registry import register
from deeppavlov.core.models.component import Component
from deeppavlov.core.common.log import get_logger
from .feb_objects import *
from question2wikidata.questions import pretty_json
from time import time
... | true | true |
f757a5558b61a279acfafe66c0cfced81ec08790 | 9,513 | py | Python | lib/prody/atomic/atom.py | npabon/ProDy | 390322d9b7688809f91656bc1cadfdb66cd0a9b3 | [
"NCSA"
] | null | null | null | lib/prody/atomic/atom.py | npabon/ProDy | 390322d9b7688809f91656bc1cadfdb66cd0a9b3 | [
"NCSA"
] | null | null | null | lib/prody/atomic/atom.py | npabon/ProDy | 390322d9b7688809f91656bc1cadfdb66cd0a9b3 | [
"NCSA"
] | 1 | 2018-12-13T12:15:09.000Z | 2018-12-13T12:15:09.000Z | # -*- coding: utf-8 -*-
# ProDy: A Python Package for Protein Dynamics Analysis
#
# Copyright (C) 2010-2012 Ahmet Bakan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 32.247458 | 79 | 0.5729 |
__author__ = 'Ahmet Bakan'
__copyright__ = 'Copyright (C) 2010-2012 Ahmet Bakan'
import numpy as np
from . import flags
from .fields import ATOMIC_FIELDS, READONLY
from .fields import wrapGetMethod, wrapSetMethod
from .pointer import AtomPointer
from .bond import Bond
__all__ = ['Atom']
class At... | true | true |
f757a5562b15115e4a32597548cf200d50e6de5a | 2,033 | py | Python | gunicorn.py | Skydipper/gee-tiles | 24aa87141fbcb068ca171b8471287cb19324290b | [
"MIT"
] | 1 | 2020-09-28T12:23:25.000Z | 2020-09-28T12:23:25.000Z | gunicorn.py | Skydipper/gee-tiles | 24aa87141fbcb068ca171b8471287cb19324290b | [
"MIT"
] | 6 | 2019-08-28T17:17:25.000Z | 2021-10-13T07:19:14.000Z | gunicorn.py | Skydipper/gee-tiles | 24aa87141fbcb068ca171b8471287cb19324290b | [
"MIT"
] | 5 | 2019-11-15T10:37:56.000Z | 2021-07-15T08:07:27.000Z | import os
import multiprocessing
bind = '0.0.0.0:5700'
backlog = 2048
worker_class = 'gevent'
workers = 1
threads = 1
worker_connections = 1000
timeout = 30
keepalive = 2
max_requests = 1000
max_requests_jitter = 50
spew = False
daemon = False
pidfile = None
umask = 666
user = os.getenv('USER')
group = os.getenv('U... | 25.098765 | 81 | 0.65273 | import os
import multiprocessing
bind = '0.0.0.0:5700'
backlog = 2048
worker_class = 'gevent'
workers = 1
threads = 1
worker_connections = 1000
timeout = 30
keepalive = 2
max_requests = 1000
max_requests_jitter = 50
spew = False
daemon = False
pidfile = None
umask = 666
user = os.getenv('USER')
group = os.getenv('U... | true | true |
f757a57ad18e3b8e8b80e3061f1d6babb8a3e7c3 | 3,089 | py | Python | nova/tests/virt/xenapi/test_vm_utils.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 2 | 2015-11-05T04:52:34.000Z | 2016-03-07T03:00:06.000Z | nova/tests/virt/xenapi/test_vm_utils.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/xenapi/test_vm_utils.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 1 | 2020-07-24T07:32:11.000Z | 2020-07-24T07:32:11.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | 35.102273 | 78 | 0.62674 |
import contextlib
import fixtures
import mox
from nova import test
from nova import utils
from nova.virt.xenapi import vm_utils
@contextlib.contextmanager
def contextified(result):
yield result
def _fake_noop(*args, **kwargs):
return
class GenerateConfigDriveTestCase(test.TestCase):
... | true | true |
f757a72ff093cf2b95c25c2549dbef869a75c1c4 | 50,596 | py | Python | src/gretel_synthetics/batch.py | em3ndez/gretel-synthetics | 7d9f433a741469860c6ec3aadf76da02036671c4 | [
"Apache-2.0"
] | null | null | null | src/gretel_synthetics/batch.py | em3ndez/gretel-synthetics | 7d9f433a741469860c6ec3aadf76da02036671c4 | [
"Apache-2.0"
] | null | null | null | src/gretel_synthetics/batch.py | em3ndez/gretel-synthetics | 7d9f433a741469860c6ec3aadf76da02036671c4 | [
"Apache-2.0"
] | null | null | null | """
This module allows automatic splitting of a DataFrame
into smaller DataFrames (by clusters of columns) and doing
model training and text generation on each sub-DF independently.
Then we can concat each sub-DF back into one final synthetic dataset.
For example usage, please see our Jupyter Notebook.
"""
import abc... | 37.202941 | 120 | 0.624753 | import abc
import glob
import gzip
import io
import json
import logging
import shutil
import tempfile
import threading
import time
from copy import deepcopy
from dataclasses import dataclass, field
from itertools import zip_longest
from math import ceil
from pathlib import Path
from typing import Callable, Dict
from t... | true | true |
f757a741a962a8e0318085e9876009b15c7c4a47 | 3,612 | py | Python | src/ui/ui_wallet_dlg_options1.py | hatchpay/hatch-masternode-tool | 4775ee3a1297a2ff0b80c35b362a5f1ddffbe4e4 | [
"MIT"
] | null | null | null | src/ui/ui_wallet_dlg_options1.py | hatchpay/hatch-masternode-tool | 4775ee3a1297a2ff0b80c35b362a5f1ddffbe4e4 | [
"MIT"
] | null | null | null | src/ui/ui_wallet_dlg_options1.py | hatchpay/hatch-masternode-tool | 4775ee3a1297a2ff0b80c35b362a5f1ddffbe4e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/blogin/PycharmProjects/HMT-git/src/ui/ui_wallet_dlg_options1.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_WdgOptions1(... | 48.810811 | 125 | 0.741141 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_WdgOptions1(object):
def setupUi(self, WdgOptions1):
WdgOptions1.setObjectName("WdgOptions1")
WdgOptions1.resize(243, 76)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
... | true | true |
f757a9512cab8bee6891b736750c699e606150d2 | 54 | py | Python | pathfinding/__init__.py | Tinggaard/pathfinding | 90497208f5f761a64e099b42159157de45176b4a | [
"MIT"
] | null | null | null | pathfinding/__init__.py | Tinggaard/pathfinding | 90497208f5f761a64e099b42159157de45176b4a | [
"MIT"
] | null | null | null | pathfinding/__init__.py | Tinggaard/pathfinding | 90497208f5f761a64e099b42159157de45176b4a | [
"MIT"
] | null | null | null | from .main import cli
from .scheme import Node, Graph
| 18 | 31 | 0.777778 | from .main import cli
from .scheme import Node, Graph
| true | true |
f757aa0f32dff09811623a0a7fd8e0af09950e69 | 2,788 | py | Python | share/qt/extract_strings_qt.py | mulecore/mulecoin | e52131742938ae433463f32680837981a5cedc0f | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | mulecore/mulecoin | e52131742938ae433463f32680837981a5cedc0f | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | mulecore/mulecoin | e52131742938ae433463f32680837981a5cedc0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012-2016 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Extract _("...") strings for translation and conver... | 30.637363 | 107 | 0.645624 |
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import operator
import os
import sys
OUT_CPP="qt/mulecoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
messages = []
msgid = []
msgstr = []
in_msgid = False
in_msgstr = False
for line in te... | true | true |
f757aa0fa2985a4e092af245f87304582b35dc98 | 3,344 | py | Python | aim/sdk/adapters/hugging_face.py | YodaEmbedding/aim | 8d8ad91dde5df2c5c0e5054072df5f7c4f8fdf79 | [
"Apache-2.0"
] | null | null | null | aim/sdk/adapters/hugging_face.py | YodaEmbedding/aim | 8d8ad91dde5df2c5c0e5054072df5f7c4f8fdf79 | [
"Apache-2.0"
] | null | null | null | aim/sdk/adapters/hugging_face.py | YodaEmbedding/aim | 8d8ad91dde5df2c5c0e5054072df5f7c4f8fdf79 | [
"Apache-2.0"
] | null | null | null | from logging import getLogger
from typing import Any, Dict, Optional
from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT
from aim.sdk.num_utils import is_number
from aim.sdk.run import Run
try:
from transformers.trainer_callback import TrainerCallback
except ImportError:
raise RuntimeError(
... | 33.44 | 87 | 0.601376 | from logging import getLogger
from typing import Any, Dict, Optional
from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT
from aim.sdk.num_utils import is_number
from aim.sdk.run import Run
try:
from transformers.trainer_callback import TrainerCallback
except ImportError:
raise RuntimeError(
... | true | true |
f757aa4a4a0c2453621260cdcbf21747c99b830a | 4,087 | py | Python | onlinepayments/sdk/merchant/productgroups/get_product_groups_params.py | wl-online-payments-direct/sdk-python3 | 99fca127334520cde4ffa3a34cbea3b3a0d3fbff | [
"Apache-2.0"
] | null | null | null | onlinepayments/sdk/merchant/productgroups/get_product_groups_params.py | wl-online-payments-direct/sdk-python3 | 99fca127334520cde4ffa3a34cbea3b3a0d3fbff | [
"Apache-2.0"
] | null | null | null | onlinepayments/sdk/merchant/productgroups/get_product_groups_params.py | wl-online-payments-direct/sdk-python3 | 99fca127334520cde4ffa3a34cbea3b3a0d3fbff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This class was auto-generated.
#
from onlinepayments.sdk.param_request import ParamRequest
from onlinepayments.sdk.request_param import RequestParam
class GetProductGroupsParams(ParamRequest):
"""
Query parameters for Get product groups
"""
__country_code = None
__cur... | 30.051471 | 200 | 0.630536 |
from onlinepayments.sdk.param_request import ParamRequest
from onlinepayments.sdk.request_param import RequestParam
class GetProductGroupsParams(ParamRequest):
__country_code = None
__currency_code = None
__locale = None
__amount = None
__is_recurring = None
__hide = None
@property
... | true | true |
f757ab7ac7eaf0bc2718a5e23b9281337f87e474 | 8,629 | py | Python | AdvenPyGameMain.py | LegoAvatar04/AdvenPyGame | b6ec873d8d652515fab5f8fb5301ca473c019d72 | [
"Apache-2.0"
] | null | null | null | AdvenPyGameMain.py | LegoAvatar04/AdvenPyGame | b6ec873d8d652515fab5f8fb5301ca473c019d72 | [
"Apache-2.0"
] | null | null | null | AdvenPyGameMain.py | LegoAvatar04/AdvenPyGame | b6ec873d8d652515fab5f8fb5301ca473c019d72 | [
"Apache-2.0"
] | null | null | null | import pygame
import os
pygame.init()
clock = pygame.time.Clock()
class Player():
walkRight = [pygame.image.load(os.path.join('SideScrollSprites', 'R1.png')),
pygame.image.load(os.path.join('SideScrollSprites', 'R2.png')),
pygame.image.load(os.path.join('SideScrollSprites', 'R3... | 39.764977 | 90 | 0.549658 | import pygame
import os
pygame.init()
clock = pygame.time.Clock()
class Player():
walkRight = [pygame.image.load(os.path.join('SideScrollSprites', 'R1.png')),
pygame.image.load(os.path.join('SideScrollSprites', 'R2.png')),
pygame.image.load(os.path.join('SideScrollSprites', 'R3... | true | true |
f757aba18e6a622f9f7405933cd49b9a824760b3 | 10,474 | py | Python | scripts/missionTests/missionTest_radar.py | MertGunducMA/iq_gnc | 6ec760c3213036bff6fca85ae60f6f1dee31afa9 | [
"MIT"
] | null | null | null | scripts/missionTests/missionTest_radar.py | MertGunducMA/iq_gnc | 6ec760c3213036bff6fca85ae60f6f1dee31afa9 | [
"MIT"
] | null | null | null | scripts/missionTests/missionTest_radar.py | MertGunducMA/iq_gnc | 6ec760c3213036bff6fca85ae60f6f1dee31afa9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---- Dronekit Imports ---------------
from __future__ import print_function
from dronekit import connect, VehicleMode, LocationGlobalRelative, LocationGlobal, Command
import time
import math
from pymavlink import mavutil
#----- Radar Imports ----------------
from signa... | 32.937107 | 195 | 0.659347 |
from __future__ import print_function
from dronekit import connect, VehicleMode, LocationGlobalRelative, LocationGlobal, Command
import time
import math
from pymavlink import mavutil
from signal import signal, SIGINT
from srp.utilities import Sleep
from srp.common.transport import SRP_TCPClient
from srp.client ... | true | true |
f757abc75ac83f62d04ed0b45416c4267f8a2d00 | 10,175 | py | Python | functions/source/KubeManifest/lambda_function.py | shrumit/quickstart-amazon-eks | e76baa0f2808c95aa8c208f7abcc7144cfc2c889 | [
"Apache-2.0"
] | null | null | null | functions/source/KubeManifest/lambda_function.py | shrumit/quickstart-amazon-eks | e76baa0f2808c95aa8c208f7abcc7144cfc2c889 | [
"Apache-2.0"
] | null | null | null | functions/source/KubeManifest/lambda_function.py | shrumit/quickstart-amazon-eks | e76baa0f2808c95aa8c208f7abcc7144cfc2c889 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import boto3
import subprocess
import shlex
import os
import re
from ruamel import yaml
from datetime import date, datetime
from crhelper import CfnResource
from time import sleep
logger = logging.getLogger(__name__)
helper = CfnResource(json_logging=True, log_level='DEBUG')
try:
s3_cli... | 33.692053 | 112 | 0.602555 | import json
import logging
import boto3
import subprocess
import shlex
import os
import re
from ruamel import yaml
from datetime import date, datetime
from crhelper import CfnResource
from time import sleep
logger = logging.getLogger(__name__)
helper = CfnResource(json_logging=True, log_level='DEBUG')
try:
s3_cli... | true | true |
f757ae02fb619b91e6c3bf7db6415c373cc63b3b | 1,778 | py | Python | core/urls.py | AliBigdeli/Django-CustomUser-DRF-App | 06904b2eb0df255caff318bc32845f6064e917c4 | [
"MIT"
] | 3 | 2021-12-07T21:49:06.000Z | 2021-12-25T10:16:52.000Z | core/urls.py | AliBigdeli/Django-CustomUser-DRF-App | 06904b2eb0df255caff318bc32845f6064e917c4 | [
"MIT"
] | null | null | null | core/urls.py | AliBigdeli/Django-CustomUser-DRF-App | 06904b2eb0df255caff318bc32845f6064e917c4 | [
"MIT"
] | null | null | null | """core URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 36.285714 | 96 | 0.708661 | from django.contrib import admin
from django.urls import path, include
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
openapi.Info(
title="CustomUser Django API",
default_version='v1',
description="A Bas... | true | true |
f757af4a1555618fb8d4c52c1d84a3f06c05405a | 8,059 | py | Python | api/tests/opentrons/protocol_api/test_accessor_fn.py | theosanderson/opentrons | df9f41d3dc56bd03ff0ef4e804d1224221272ddf | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocol_api/test_accessor_fn.py | theosanderson/opentrons | df9f41d3dc56bd03ff0ef4e804d1224221272ddf | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocol_api/test_accessor_fn.py | theosanderson/opentrons | df9f41d3dc56bd03ff0ef4e804d1224221272ddf | [
"Apache-2.0"
] | null | null | null | from opentrons.protocol_api import labware
from opentrons.types import Point, Location
minimalLabwareDef = {
"metadata": {
"displayName": "minimal labware"
},
"cornerOffsetFromSlot": {
"x": 10,
"y": 10,
"z": 5
},
"parameters": {
"isTiprack": False,
},
... | 32.760163 | 78 | 0.562601 | from opentrons.protocol_api import labware
from opentrons.types import Point, Location
minimalLabwareDef = {
"metadata": {
"displayName": "minimal labware"
},
"cornerOffsetFromSlot": {
"x": 10,
"y": 10,
"z": 5
},
"parameters": {
"isTiprack": False,
},
... | true | true |
f757b03cda90cac503e7391c444d893a25a4ee06 | 14,145 | py | Python | PaddleNLP/examples/text_generation/vae-seq2seq/model.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | 6 | 2021-06-08T13:19:35.000Z | 2021-06-24T15:08:54.000Z | examples/text_generation/vae-seq2seq/model.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | 1 | 2021-11-22T08:11:08.000Z | 2021-11-22T08:11:08.000Z | examples/text_generation/vae-seq2seq/model.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | 1 | 2021-04-28T09:01:37.000Z | 2021-04-28T09:01:37.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | 34.839901 | 87 | 0.602969 |
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import paddle.nn.initializer as I
class CrossEntropyWithKL(nn.Layer):
def __init__(self, base_kl_weight, anneal_r):
super(CrossEntropyWithKL, self).__init__()
self.kl_weight = base_kl_weight
... | true | true |
f757b09602a7d1cf60d3b787d7cf315f69ffa882 | 1,292 | py | Python | commands/ipython.py | gaohongsong/flask-demo | a2afd1b64cad1bb08bada6f327abc7396db0a6df | [
"MIT"
] | 12 | 2017-12-24T13:58:17.000Z | 2021-04-06T16:21:00.000Z | commands/ipython.py | gaohongsong/flask-demo | a2afd1b64cad1bb08bada6f327abc7396db0a6df | [
"MIT"
] | null | null | null | commands/ipython.py | gaohongsong/flask-demo | a2afd1b64cad1bb08bada6f327abc7396db0a6df | [
"MIT"
] | 1 | 2021-10-17T14:45:44.000Z | 2021-10-17T14:45:44.000Z | import code
import sys
import click
from flask import json
from flask.cli import with_appcontext
@click.command()
@with_appcontext
def command():
"""Runs a shell in the app context.
Runs an interactive Python shell in the context of a given
Flask application. The application will populate the default
... | 27.489362 | 71 | 0.677245 | import code
import sys
import click
from flask import json
from flask.cli import with_appcontext
@click.command()
@with_appcontext
def command():
from flask.globals import _app_ctx_stack
app = _app_ctx_stack.top.app
banner1 = '''Python %s on %s
App: %s%s
Instance: %s
Db: %s''' % (
sys.version,
... | true | true |
f757b20faf3b748a44cad2e69d069e148534f7e6 | 1,188 | py | Python | docs/podstawy/elotek/toto29.py | damiankarol7/python101 | 1978a9402a8fb0f20c4ca7bd542cb8d7d4501b9b | [
"MIT"
] | 44 | 2015-02-11T19:10:37.000Z | 2021-11-11T09:45:43.000Z | docs/podstawy/elotek/toto29.py | damiankarol7/python101 | 1978a9402a8fb0f20c4ca7bd542cb8d7d4501b9b | [
"MIT"
] | 9 | 2015-02-06T21:26:25.000Z | 2022-03-31T10:44:22.000Z | docs/podstawy/elotek/toto29.py | damiankarol7/python101 | 1978a9402a8fb0f20c4ca7bd542cb8d7d4501b9b | [
"MIT"
] | 172 | 2015-06-13T07:16:24.000Z | 2022-03-30T20:41:11.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
try:
ileliczb = int(input("Podaj ilość typowanych liczb: "))
maksliczba = int(input("Podaj maksymalną losowaną liczbę: "))
if ileliczb > maksliczba:
print("Błędne dane!")
exit()
except ValueError:
print("Błędne dane!")
ex... | 24.244898 | 65 | 0.554714 |
import random
try:
ileliczb = int(input("Podaj ilość typowanych liczb: "))
maksliczba = int(input("Podaj maksymalną losowaną liczbę: "))
if ileliczb > maksliczba:
print("Błędne dane!")
exit()
except ValueError:
print("Błędne dane!")
exit()
liczby = []
i = 0
while i < ileliczb:
... | true | true |
f757b3483b80e7237d5e60f01b7794765915bae2 | 6,922 | py | Python | galaxy_merge_edits/grad_cam.py | Kathryn-Downey/DeepMergeDomainAdaptation | 334331ce8871cda80590cd9ec671941a82fa859c | [
"BSD-2-Clause"
] | 1 | 2021-04-06T00:09:35.000Z | 2021-04-06T00:09:35.000Z | galaxy_merge_edits/grad_cam.py | Kathryn-Downey/DeepMergeDomainAdaptation | 334331ce8871cda80590cd9ec671941a82fa859c | [
"BSD-2-Clause"
] | null | null | null | galaxy_merge_edits/grad_cam.py | Kathryn-Downey/DeepMergeDomainAdaptation | 334331ce8871cda80590cd9ec671941a82fa859c | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
#
# Author: Kazuto Nakashima
# URL: http://kazuto1011.github.io
# Created: 2017-05-26
from collections import Sequence
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from tqdm import tqdm
class _BaseWrapper(object):
def __... | 31.607306 | 97 | 0.628431 |
from collections import Sequence
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from tqdm import tqdm
class _BaseWrapper(object):
def __init__(self, model):
super(_BaseWrapper, self).__init__()
self.device = next(model.parameters()).device
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.