hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f06d4174d27922fae5380c3e4f0166131aa2fa | 3,076 | py | Python | web/scrapy/crawler/crawler/settings.py | hyelansgithub/fastcampus-programming | a3e15a0ac30249f85df6939562997b514d9fba90 | [
"MIT"
] | null | null | null | web/scrapy/crawler/crawler/settings.py | hyelansgithub/fastcampus-programming | a3e15a0ac30249f85df6939562997b514d9fba90 | [
"MIT"
] | null | null | null | web/scrapy/crawler/crawler/settings.py | hyelansgithub/fastcampus-programming | a3e15a0ac30249f85df6939562997b514d9fba90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for crawler project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/topic... | 33.802198 | 102 | 0.775358 |
BOT_NAME = 'crawler'
SPIDER_MODULES = ['crawler.spiders']
NEWSPIDER_MODULE = 'crawler.spiders'
ROBOTSTXT_OBEY = False
Configure item pipelines
See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
'crawler.pipelines.CrawlerPipeline': 300,
}
| false | true |
08f06d793f0e75057274e423600d400b20b1c6a1 | 5,803 | py | Python | tests/test_george_compat.py | tronsgaard/tinygp | 11e9c869fd2a62d7c0292db3b6fa9eab46e296e5 | [
"MIT"
] | null | null | null | tests/test_george_compat.py | tronsgaard/tinygp | 11e9c869fd2a62d7c0292db3b6fa9eab46e296e5 | [
"MIT"
] | null | null | null | tests/test_george_compat.py | tronsgaard/tinygp | 11e9c869fd2a62d7c0292db3b6fa9eab46e296e5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# mypy: ignore-errors
import numpy as np
import pytest
from tinygp import GaussianProcess, kernels
george = pytest.importorskip("george")
from jax.config import config
config.update("jax_enable_x64", True)
@pytest.fixture
def random():
return np.random.default_rng(1058390)
@pytest.f... | 28.586207 | 78 | 0.63674 |
import numpy as np
import pytest
from tinygp import GaussianProcess, kernels
george = pytest.importorskip("george")
from jax.config import config
config.update("jax_enable_x64", True)
@pytest.fixture
def random():
return np.random.default_rng(1058390)
@pytest.fixture(
scope="module",
params=["Const... | true | true |
08f06e9230ed7ba01701d2e9b81373b83a9a9aa6 | 6,577 | py | Python | necrobot/user/userlib.py | Khold6458/necrobot | 0bf9397eba43c6f7e8df77451f772b8de835cd1b | [
"MIT"
] | null | null | null | necrobot/user/userlib.py | Khold6458/necrobot | 0bf9397eba43c6f7e8df77451f772b8de835cd1b | [
"MIT"
] | 1 | 2018-10-08T22:05:30.000Z | 2018-10-08T22:05:30.000Z | necrobot/user/userlib.py | Khold6458/necrobot | 0bf9397eba43c6f7e8df77451f772b8de835cd1b | [
"MIT"
] | null | null | null | """
Module for the NecroUser library.
NecroUser represents a bot user, and is in correspondence with data stored in a row of the `users` table of
the database. This module is responsible for checking out users from the database and storing a library, indexed
by user ID, of checked out users.
"""
import necrobot.excep... | 33.902062 | 118 | 0.662764 |
import necrobot.exception
from necrobot.user.necrouser import NecroUser
from necrobot.user.userprefs import UserPrefs
from necrobot.util import console
from necrobot.util import server
from necrobot.user import userdb
user_library_by_uid = {}
user_library_by_did = {}
async def get_user(
discord_id: int = None,
... | true | true |
08f06eae513c6ff164c5d82ff46f2f5febba04d5 | 9,593 | py | Python | src/models/imagenet/resnet34_flat_ori.py | joeyseash/PruneTrain | 5adb367eb90b7e1e38251f8e3a8e7eb65b167aa0 | [
"Apache-2.0"
] | 1 | 2021-10-03T00:57:32.000Z | 2021-10-03T00:57:32.000Z | src/models/imagenet/resnet34_flat_ori.py | VictorSuciu/prunetrain | ef84a88ef8a34f8e79de783ffdb9d3b82545dc3b | [
"Apache-2.0"
] | null | null | null | src/models/imagenet/resnet34_flat_ori.py | VictorSuciu/prunetrain | ef84a88ef8a34f8e79de783ffdb9d3b82545dc3b | [
"Apache-2.0"
] | null | null | null | """ Flattened ResNet34 for ImageNet
"""
import torch.nn as nn
import math
__all__ = ['resnet34_flat']
lass ResNet34(nn.Module):
# This should be redefined by the channel count
def __init__(self, num_classes=1000):
super(ResNet34, self).__init__()
self.conv1 = nn.Conv2d(3, 64, kernel_size=7,... | 32.629252 | 89 | 0.529136 | """ Flattened ResNet34 for ImageNet
"""
import torch.nn as nn
import math
__all__ = ['resnet34_flat']
lass ResNet34(nn.Module):
def __init__(self, num_classes=1000):
super(ResNet34, self).__init__()
self.conv1 = nn.Conv2d(3, 64, kernel_size=7, padding=3, bias=False, stride=2)
self.b... | false | true |
08f06f39347d1c71b3717acd5489028aa0259a5a | 1,460 | py | Python | tests/test_lookup.py | tkem/mopidy-dleyna | 7fb628e959e59537e550398c15c64ee6d373c506 | [
"Apache-2.0"
] | 17 | 2015-04-13T11:14:36.000Z | 2021-12-01T18:27:26.000Z | tests/test_lookup.py | tkem/mopidy-dleyna | 7fb628e959e59537e550398c15c64ee6d373c506 | [
"Apache-2.0"
] | 73 | 2015-04-07T17:01:01.000Z | 2021-03-07T06:41:17.000Z | tests/test_lookup.py | tkem/mopidy-dleyna | 7fb628e959e59537e550398c15c64ee6d373c506 | [
"Apache-2.0"
] | 9 | 2015-09-30T17:44:05.000Z | 2021-12-14T17:43:14.000Z | from unittest import mock
import pytest
from mopidy import models
from mopidy_dleyna.util import Future
@pytest.fixture
def container():
return {
"DisplayName": "Album #1",
"Type": "container",
"TypeEx": "container.album.musicAlbum",
"URI": "dleyna://media/1",
}
@pytest.fix... | 26.545455 | 75 | 0.584932 | from unittest import mock
import pytest
from mopidy import models
from mopidy_dleyna.util import Future
@pytest.fixture
def container():
return {
"DisplayName": "Album #1",
"Type": "container",
"TypeEx": "container.album.musicAlbum",
"URI": "dleyna://media/1",
}
@pytest.fix... | true | true |
08f06f64844b420beaf1e8a4d75da8f4f57d0ecb | 23,748 | py | Python | elastalert/loaders.py | jweiwu/elastalert | ca6c638baa5a57a8c93c03119aab05855e268cc3 | [
"Apache-2.0"
] | null | null | null | elastalert/loaders.py | jweiwu/elastalert | ca6c638baa5a57a8c93c03119aab05855e268cc3 | [
"Apache-2.0"
] | null | null | null | elastalert/loaders.py | jweiwu/elastalert | ca6c638baa5a57a8c93c03119aab05855e268cc3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import datetime
import hashlib
import logging
import os
import sys
import jsonschema
import yaml
import yaml.scanner
from staticconf.loader import yaml_loader
from . import alerts
from . import enhancements
from . import ruletypes
from .opsgenie import OpsGenieAlerter
from .util im... | 42.789189 | 130 | 0.602577 | import copy
import datetime
import hashlib
import logging
import os
import sys
import jsonschema
import yaml
import yaml.scanner
from staticconf.loader import yaml_loader
from . import alerts
from . import enhancements
from . import ruletypes
from .opsgenie import OpsGenieAlerter
from .util import dt_to_ts
from .util... | true | true |
08f0718d1cf0bd244317a4595fbdcf72d951de52 | 455 | py | Python | zinnia_blog_example/mysite/wsgi.py | 17-1-SKKU-OSS/116A | ef840eba40e62da1014685931c17d49372152a08 | [
"CC-BY-3.0"
] | null | null | null | zinnia_blog_example/mysite/wsgi.py | 17-1-SKKU-OSS/116A | ef840eba40e62da1014685931c17d49372152a08 | [
"CC-BY-3.0"
] | 9 | 2017-05-09T02:00:31.000Z | 2017-06-12T11:08:26.000Z | zinnia_blog_example/mysite/wsgi.py | 17-1-SKKU-OSS/116A | ef840eba40e62da1014685931c17d49372152a08 | [
"CC-BY-3.0"
] | null | null | null | """
WSGI config for mysite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
import sys
sys.path.append("/home/khs/project/project/mysite/")
from django.core.wsgi... | 22.75 | 78 | 0.78022 |
import os
import sys
sys.path.append("/home/khs/project/project/mysite/")
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
application = get_wsgi_application()
| true | true |
08f0723ef4cfff74a4fd7fb3c2641f8692bc2584 | 2,384 | py | Python | jinjiang/free_rank_parser.py | lanmaoxinqing/python-qidian-recommend | 5f03d5cbd18b144502513b8441e698e8fb1f8089 | [
"MIT"
] | 2 | 2018-08-14T08:34:35.000Z | 2022-03-18T09:22:18.000Z | jinjiang/free_rank_parser.py | lanmaoxinqing/python-qidian-recommend | 5f03d5cbd18b144502513b8441e698e8fb1f8089 | [
"MIT"
] | null | null | null | jinjiang/free_rank_parser.py | lanmaoxinqing/python-qidian-recommend | 5f03d5cbd18b144502513b8441e698e8fb1f8089 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# !/usr/bin/python3
from pyquery import PyQuery as pq
import aiohttp
try:
from .model import *
except:
from model import *
def parse():
db.create_tables([FreeRank])
path = 'http://www.jjwxc.net/topten.php?orderstr=1&timeid='
page = 41
loop = asyncio.get_event_l... | 34.550725 | 119 | 0.545721 |
from pyquery import PyQuery as pq
import aiohttp
try:
from .model import *
except:
from model import *
def parse():
db.create_tables([FreeRank])
path = 'http://www.jjwxc.net/topten.php?orderstr=1&timeid='
page = 41
loop = asyncio.get_event_loop()
for i in range(1, page + 1):
... | true | true |
08f072a962809a520b489592a7df180ee1f37bfc | 3,122 | py | Python | hordak/views/accounts.py | kbhalerao/django-hordak | 26acf1cc1f4159739d6b0b7479577f23f8c59e37 | [
"MIT"
] | null | null | null | hordak/views/accounts.py | kbhalerao/django-hordak | 26acf1cc1f4159739d6b0b7479577f23f8c59e37 | [
"MIT"
] | null | null | null | hordak/views/accounts.py | kbhalerao/django-hordak | 26acf1cc1f4159739d6b0b7479577f23f8c59e37 | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls.base import reverse_lazy
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.list import ListView
from tradeCore.hordak.models import Account, Leg
from... | 30.607843 | 150 | 0.669122 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls.base import reverse_lazy
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.list import ListView
from tradeCore.hordak.models import Account, Leg
from... | true | true |
08f0735a154b17184f498569928d391480175b85 | 43,243 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_policy_assignments_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_policy_assignments_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_policy_assignments_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.788024 | 332 | 0.680827 | import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azu... | true | true |
08f073877f3807aa5d7326eb5a65af70feecc989 | 2,806 | py | Python | src/vuabl/parsing/build_layout.py | CncealDVRflectN/vuabl | 1c1f3270d4ad4b730ec9558b65b2f6ea84a5bd50 | [
"MIT"
] | null | null | null | src/vuabl/parsing/build_layout.py | CncealDVRflectN/vuabl | 1c1f3270d4ad4b730ec9558b65b2f6ea84a5bd50 | [
"MIT"
] | null | null | null | src/vuabl/parsing/build_layout.py | CncealDVRflectN/vuabl | 1c1f3270d4ad4b730ec9558b65b2f6ea84a5bd50 | [
"MIT"
] | null | null | null | from vuabl.data.asset_data import AssetData
from vuabl.data.build_layout import BuildLayout
from vuabl.utils.layout_reader import LayoutReader
import vuabl.parsing.parameters as pparams
import vuabl.parsing.summary as psummary
import vuabl.parsing.group as pgroup
def parse_build_layout(reader: LayoutReader) -> Build... | 36.441558 | 121 | 0.661083 | from vuabl.data.asset_data import AssetData
from vuabl.data.build_layout import BuildLayout
from vuabl.utils.layout_reader import LayoutReader
import vuabl.parsing.parameters as pparams
import vuabl.parsing.summary as psummary
import vuabl.parsing.group as pgroup
def parse_build_layout(reader: LayoutReader) -> Build... | true | true |
08f073d70800f8edd9e2a978c8cad70eabbe7a8f | 1,407 | py | Python | models/projectiles.py | fegarciad/CursesGame | 6f5aad1478c36e1e5ebb2056761a6e24a34514a6 | [
"MIT"
] | null | null | null | models/projectiles.py | fegarciad/CursesGame | 6f5aad1478c36e1e5ebb2056761a6e24a34514a6 | [
"MIT"
] | null | null | null | models/projectiles.py | fegarciad/CursesGame | 6f5aad1478c36e1e5ebb2056761a6e24a34514a6 | [
"MIT"
] | null | null | null | """Projectile classes"""
class Projectile:
"""Projectile super class"""
def __init__(self, init_row: int, init_col: int, direction: int, max_yx: tuple[int, int]) -> None:
self.row = init_row
self.col = init_col
self.direction = direction
self.damage = 1
self.counter = ... | 31.266667 | 102 | 0.518124 |
class Projectile:
def __init__(self, init_row: int, init_col: int, direction: int, max_yx: tuple[int, int]) -> None:
self.row = init_row
self.col = init_col
self.direction = direction
self.damage = 1
self.counter = 0
self.speed = 50
self.max_yx = max_yx
... | true | true |
08f07437dabcafe967ada2a6307648ab065f0bd8 | 523,256 | py | Python | python/phonenumbers/geodata/data7.py | timgates42/python-phonenumbers | 98895826729a234acc1e27ce8e280fe7e54754ab | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/geodata/data7.py | timgates42/python-phonenumbers | 98895826729a234acc1e27ce8e280fe7e54754ab | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/geodata/data7.py | timgates42/python-phonenumbers | 98895826729a234acc1e27ce8e280fe7e54754ab | [
"Apache-2.0"
] | 1 | 2020-12-14T11:39:53.000Z | 2020-12-14T11:39:53.000Z | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2020 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 52.205527 | 139 | 0.554373 | from ..util import u
data = {
'55543321':{'en': 'Erechim - RS', 'pt': 'Erechim - RS'},
'55543322':{'en': 'Quinze de Novembro - RS', 'pt': 'Quinze de Novembro - RS'},
'55543323':{'en': 'Nova Alvorada - RS', 'pt': 'Nova Alvorada - RS'},
'55543324':{'en': u('Ibirub\u00e1 - RS'), 'pt': u('Ibirub\u00e1 - RS')},
'5554... | true | true |
08f0753e9e438d48e583bcd1edfac2671885ef79 | 1,296 | py | Python | ch15-dynamic-programming/cut_rod_no_comments.py | mousseinov/CSc220-Algorithms | 3f74e528f65b8086cececc5698f8a79ef4783f1b | [
"MIT"
] | null | null | null | ch15-dynamic-programming/cut_rod_no_comments.py | mousseinov/CSc220-Algorithms | 3f74e528f65b8086cececc5698f8a79ef4783f1b | [
"MIT"
] | null | null | null | ch15-dynamic-programming/cut_rod_no_comments.py | mousseinov/CSc220-Algorithms | 3f74e528f65b8086cececc5698f8a79ef4783f1b | [
"MIT"
] | null | null | null | """
CSc220: Implementation of the Rod Cutting Problem.
"""
def cut_rod(prices, length):
memo = [float("-inf") for _ in range(length+1)]
memo[0] = 0
save_solution = [0 for _ in range(length+1)]
for l in range(1,length+1):
for cut in range(1,l+1):
if memo[l-cut] + prices[cut] > memo... | 21.6 | 70 | 0.628086 |
def cut_rod(prices, length):
memo = [float("-inf") for _ in range(length+1)]
memo[0] = 0
save_solution = [0 for _ in range(length+1)]
for l in range(1,length+1):
for cut in range(1,l+1):
if memo[l-cut] + prices[cut] > memo[l]:
memo[l] = memo[l-cut] + prices[cut]
... | true | true |
08f076477c9a7906f6d00aa368708e63f6ab91c9 | 7,930 | py | Python | aroma/features.py | gitter-badger/aroma-1 | e8e4169fa158572278f786769951831ef45a4a2f | [
"Apache-2.0"
] | null | null | null | aroma/features.py | gitter-badger/aroma-1 | e8e4169fa158572278f786769951831ef45a4a2f | [
"Apache-2.0"
] | null | null | null | aroma/features.py | gitter-badger/aroma-1 | e8e4169fa158572278f786769951831ef45a4a2f | [
"Apache-2.0"
] | null | null | null | """Functions to calculate ICA-AROMA features for component classification."""
import logging
import os
import nibabel as nib
import numpy as np
from nilearn import image, masking
from . import utils
LGR = logging.getLogger(__name__)
def feature_time_series(mel_mix, mc):
"""Extract maximum motion parameter corr... | 33.744681 | 78 | 0.644641 | import logging
import os
import nibabel as nib
import numpy as np
from nilearn import image, masking
from . import utils
LGR = logging.getLogger(__name__)
def feature_time_series(mel_mix, mc):
if isinstance(mc, str):
rp6 = utils.load_motpars(mc, source="auto")
else:
rp6 = mc
assert (rp6... | true | true |
08f076f147294d019567648c6b899e51b541872b | 1,293 | py | Python | setup.py | sirosen/darpy | b88685652be7ba8f63a66a4c475cdc7f16090603 | [
"Apache-2.0"
] | null | null | null | setup.py | sirosen/darpy | b88685652be7ba8f63a66a4c475cdc7f16090603 | [
"Apache-2.0"
] | null | null | null | setup.py | sirosen/darpy | b88685652be7ba8f63a66a4c475cdc7f16090603 | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
with open('README.rst', 'r') as f:
readme_text = f.read()
# single source of truth for package version
version_ns = {}
with open(os.path.join("darpy", "version.py")) as f:
exec(f.read(), version_ns)
version = version_ns['__version__']
setup(
name='dar... | 32.325 | 70 | 0.634957 | import os
from setuptools import setup, find_packages
with open('README.rst', 'r') as f:
readme_text = f.read()
version_ns = {}
with open(os.path.join("darpy", "version.py")) as f:
exec(f.read(), version_ns)
version = version_ns['__version__']
setup(
name='darpy',
version=version,
packages=find_... | true | true |
08f077bbfd832016ff947eeb45f8ef187b84b0c8 | 2,885 | py | Python | run.py | Medkabenen/Weed-Calculator | 7426706a392b02a745ae2605ae685475c5a6f33a | [
"MIT"
] | null | null | null | run.py | Medkabenen/Weed-Calculator | 7426706a392b02a745ae2605ae685475c5a6f33a | [
"MIT"
] | null | null | null | run.py | Medkabenen/Weed-Calculator | 7426706a392b02a745ae2605ae685475c5a6f33a | [
"MIT"
] | 6 | 2020-01-07T20:20:57.000Z | 2020-02-03T14:24:47.000Z | # Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Imports from this application
from app import app, server
from pages import index, predictions
# Navbar... | 36.987179 | 129 | 0.630503 | import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app, server
from pages import index, predictions
navbar = dbc.NavbarSimple(
brand='Potency Calculator',
brand_href='... | true | true |
08f078c87ff6832bc4694e071bdd4f61db38c8b3 | 3,109 | py | Python | src/dataloaders/cifar10.py | jackonelli/ensemble_distr_distillation | 1abfb0d3b546b4e232e0ad05e1717bfe5489d6f8 | [
"MIT"
] | 3 | 2021-02-07T11:07:26.000Z | 2022-01-19T16:38:24.000Z | src/dataloaders/cifar10.py | jackonelli/ensemble_distr_distillation | 1abfb0d3b546b4e232e0ad05e1717bfe5489d6f8 | [
"MIT"
] | null | null | null | src/dataloaders/cifar10.py | jackonelli/ensemble_distr_distillation | 1abfb0d3b546b4e232e0ad05e1717bfe5489d6f8 | [
"MIT"
] | 2 | 2021-02-01T07:34:29.000Z | 2021-02-16T04:38:22.000Z | """Data loader for CIFAR data"""
import logging
import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
class Cifar10Data:
"""CIFAR data wrapper
Create instance like this:
trainloader = torch.utils.data.DataLoader... | 31.09 | 110 | 0.522676 | import logging
import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
class Cifar10Data:
def __init__(self, ind=None, train=True, augmentation=False, torch_data=True, root="./data"):
self._log = logging.getLogge... | true | true |
08f078d4d8614eb3505f2291dce29816af885032 | 8,783 | py | Python | form_designer/migrations/0008_add_field_FormDefinition_body_html.py | Forever-Young/django-form-designer | 04e91d6421684567a490998ef0470745a361ab7a | [
"BSD-3-Clause"
] | 1 | 2016-04-12T05:59:45.000Z | 2016-04-12T05:59:45.000Z | form_designer/migrations/0008_add_field_FormDefinition_body_html.py | Forever-Young/django-form-designer | 04e91d6421684567a490998ef0470745a361ab7a | [
"BSD-3-Clause"
] | null | null | null | form_designer/migrations/0008_add_field_FormDefinition_body_html.py | Forever-Young/django-form-designer | 04e91d6421684567a490998ef0470745a361ab7a | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'FormDefinition.body_html'
db.add_column('form_designer_formdefinition', 'body_html', self.... | 79.845455 | 156 | 0.575316 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('form_designer_formdefinition', 'body_html', self.gf('django.db.models.fields.BooleanField')(default=False), k... | true | true |
08f07966613ad0b41266ce4cfb9fb9adeb654f4a | 1,249 | py | Python | test/test_hos_logs_param.py | eirerocks/samsara-python-eu | e0f1bd8f42d083fc713f910b74123d3bc7408538 | [
"Apache-2.0"
] | 1 | 2019-09-17T14:11:52.000Z | 2019-09-17T14:11:52.000Z | test/test_hos_logs_param.py | eirerocks/samsara-python-eu | e0f1bd8f42d083fc713f910b74123d3bc7408538 | [
"Apache-2.0"
] | null | null | null | test/test_hos_logs_param.py | eirerocks/samsara-python-eu | e0f1bd8f42d083fc713f910b74123d3bc7408538 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Samsara API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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 Lice... | 23.566038 | 76 | 0.704564 |
from __future__ import absolute_import
import os
import sys
import unittest
import samsara
from samsara.rest import ApiException
from samsara.models.hos_logs_param import HosLogsParam
class TestHosLogsParam(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testH... | true | true |
08f079b5f8cfdd17ea8ae75348a2cd2729eb378a | 2,612 | py | Python | caffe2/python/operator_test/flexible_top_k_test.py | shigengtian/caffe2 | e19489d6acd17fea8ca98cd8e4b5b680e23a93c5 | [
"Apache-2.0"
] | 1 | 2018-03-26T13:25:03.000Z | 2018-03-26T13:25:03.000Z | caffe2/python/operator_test/flexible_top_k_test.py | shigengtian/caffe2 | e19489d6acd17fea8ca98cd8e4b5b680e23a93c5 | [
"Apache-2.0"
] | null | null | null | caffe2/python/operator_test/flexible_top_k_test.py | shigengtian/caffe2 | e19489d6acd17fea8ca98cd8e4b5b680e23a93c5 | [
"Apache-2.0"
] | 1 | 2018-12-20T09:14:48.000Z | 2018-12-20T09:14:48.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import OrderedDict
import numpy as np
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
clas... | 34.826667 | 79 | 0.554364 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import OrderedDict
import numpy as np
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
clas... | true | true |
08f079ca8b05e9ca374158ba179f0916b046a07c | 2,484 | py | Python | hw7_release/.env/bin/explode.py | YuanSun-au/CS131 | 2f0e4896beb80926636bdf2fb57a119ae77ff45a | [
"MIT"
] | null | null | null | hw7_release/.env/bin/explode.py | YuanSun-au/CS131 | 2f0e4896beb80926636bdf2fb57a119ae77ff45a | [
"MIT"
] | null | null | null | hw7_release/.env/bin/explode.py | YuanSun-au/CS131 | 2f0e4896beb80926636bdf2fb57a119ae77ff45a | [
"MIT"
] | 1 | 2020-08-05T00:08:23.000Z | 2020-08-05T00:08:23.000Z | #!/home/shawn/Documents/CS131/CS131/hw7_release/.env/bin/python3
#
# The Python Imaging Library
# $Id$
#
# split an animation into a number of frame files
#
from __future__ import print_function
from PIL import Image
import os
import sys
class Interval(object):
def __init__(self, interval="0"):
self.s... | 21.982301 | 75 | 0.541063 |
from __future__ import print_function
from PIL import Image
import os
import sys
class Interval(object):
def __init__(self, interval="0"):
self.setinterval(interval)
def setinterval(self, interval):
self.hilo = []
for s in interval.split(","):
if not s.strip():
... | true | true |
08f07a1e74d969480a02c1431e9427657d4b3635 | 595 | py | Python | setup.py | caseta/espn-api | 00cb73fbf95a9df874ef82f8b3b33ed01447a29a | [
"MIT"
] | 187 | 2020-04-05T18:42:46.000Z | 2022-03-24T20:52:17.000Z | setup.py | caseta/espn-api | 00cb73fbf95a9df874ef82f8b3b33ed01447a29a | [
"MIT"
] | 130 | 2020-03-22T22:47:34.000Z | 2022-02-28T16:44:00.000Z | setup.py | caseta/espn-api | 00cb73fbf95a9df874ef82f8b3b33ed01447a29a | [
"MIT"
] | 83 | 2020-04-14T22:02:47.000Z | 2022-03-19T19:57:12.000Z | from setuptools import setup, find_packages
setup(
name='espn_api',
packages=find_packages(),
version='0.19.0',
author='Christian Wendt',
description='ESPN API',
install_requires=['requests>=2.0.0,<3.0.0'],
setup_requires=['nose>=1.0'],
test_suite='nose.collector',
tests_... | 28.333333 | 57 | 0.606723 | from setuptools import setup, find_packages
setup(
name='espn_api',
packages=find_packages(),
version='0.19.0',
author='Christian Wendt',
description='ESPN API',
install_requires=['requests>=2.0.0,<3.0.0'],
setup_requires=['nose>=1.0'],
test_suite='nose.collector',
tests_... | true | true |
08f07a710268e83a1464754849723ecb35b540f5 | 481 | py | Python | folio/migrations/0013_auto_20200219_2045.py | Kenneth-joseph/Myport | ad9d6fbb58b2e6ea83d0abc28f524395d90cff28 | [
"Unlicense"
] | null | null | null | folio/migrations/0013_auto_20200219_2045.py | Kenneth-joseph/Myport | ad9d6fbb58b2e6ea83d0abc28f524395d90cff28 | [
"Unlicense"
] | 4 | 2020-06-06T00:43:02.000Z | 2021-09-08T01:40:19.000Z | folio/migrations/0013_auto_20200219_2045.py | Kenneth-joseph/Myport | ad9d6fbb58b2e6ea83d0abc28f524395d90cff28 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2020-02-19 17:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('folio', '0012_auto_20200219_1632'),
]
operations = [
migrations.AlterField(
... | 22.904762 | 78 | 0.623701 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('folio', '0012_auto_20200219_1632'),
]
operations = [
migrations.AlterField(
model_name='project',
name='project_pic',
... | true | true |
08f07b32d88dcf8a29713924cc8bf93bbaf14ee9 | 4,654 | py | Python | test/unittests/test_operators.py | sobolevn/cosmic-ray | 0d5ba9c773299385195f6c32e5bf4de55d3494a6 | [
"MIT"
] | null | null | null | test/unittests/test_operators.py | sobolevn/cosmic-ray | 0d5ba9c773299385195f6c32e5bf4de55d3494a6 | [
"MIT"
] | null | null | null | test/unittests/test_operators.py | sobolevn/cosmic-ray | 0d5ba9c773299385195f6c32e5bf4de55d3494a6 | [
"MIT"
] | null | null | null | """Tests for the various mutation operators.
"""
import ast
import copy
import pytest
from cosmic_ray.operators.comparison_operator_replacement import \
(ReplaceComparisonOperator_Gt_Lt,
ReplaceComparisonOperator_Is_IsNot,
ReplaceComparisonOperator_Gt_Eq)
from cosmic_ray.operators.unary_operator_replacem... | 34.992481 | 77 | 0.700902 | import ast
import copy
import pytest
from cosmic_ray.operators.comparison_operator_replacement import \
(ReplaceComparisonOperator_Gt_Lt,
ReplaceComparisonOperator_Is_IsNot,
ReplaceComparisonOperator_Gt_Eq)
from cosmic_ray.operators.unary_operator_replacement import \
(ReplaceUnaryOperator_Delete_Not... | true | true |
08f07c072e790b840486726f52a01c79aa3b327a | 268 | py | Python | src/GridCal/Engine/Replacements/__init__.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 284 | 2016-01-31T03:20:44.000Z | 2022-03-17T21:16:52.000Z | src/GridCal/Engine/Replacements/__init__.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 94 | 2016-01-14T13:37:40.000Z | 2022-03-28T03:13:56.000Z | src/GridCal/Engine/Replacements/__init__.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 84 | 2016-03-29T10:43:04.000Z | 2022-02-22T16:26:55.000Z | try:
import mpi4py
from GridCal.Engine.Replacements.mpiserve import *
except ImportError:
pass
from GridCal.Engine.Replacements.poap_controller import *
from GridCal.Engine.Replacements.strategy import *
from GridCal.Engine.Replacements.tcpserve import *
| 26.8 | 57 | 0.802239 | try:
import mpi4py
from GridCal.Engine.Replacements.mpiserve import *
except ImportError:
pass
from GridCal.Engine.Replacements.poap_controller import *
from GridCal.Engine.Replacements.strategy import *
from GridCal.Engine.Replacements.tcpserve import *
| true | true |
08f07e05a1c7e2eecf6ddf1ab2e6877928a8de83 | 664 | py | Python | solution/binary_search/2776/main.py | jungyoonoh/baekjoon-1 | 2b4437a4b5e06244fa47fae6c7b7be0157d0f94f | [
"MIT"
] | 2,236 | 2019-08-05T00:36:59.000Z | 2022-03-31T16:03:53.000Z | solution/binary_search/2776/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 225 | 2020-12-17T10:20:45.000Z | 2022-01-05T17:44:16.000Z | solution/binary_search/2776/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 602 | 2019-08-05T00:46:25.000Z | 2022-03-31T13:38:23.000Z | # Authored by : gusdn3477
# Co-authored by : -
# Link : http://boj.kr/93afacc450454aedbd2b0d6667914846
import sys
def input():
return sys.stdin.readline().rstrip()
def binary_search(t):
start, end = 0, len(arr)-1
while start <= end:
mid = (start + end) // 2
if arr[mid] == t:
re... | 22.896552 | 55 | 0.534639 | import sys
def input():
return sys.stdin.readline().rstrip()
def binary_search(t):
start, end = 0, len(arr)-1
while start <= end:
mid = (start + end) // 2
if arr[mid] == t:
return 1
elif arr[mid] > t:
end = mid - 1
else:
start = mid + 1
... | true | true |
08f07e364a37fafc5810d3202b401365c4060a98 | 10,832 | py | Python | code/python/OverviewReportBuilder/v1/fds/sdk/OverviewReportBuilder/model/meta.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/OverviewReportBuilder/v1/fds/sdk/OverviewReportBuilder/model/meta.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/OverviewReportBuilder/v1/fds/sdk/OverviewReportBuilder/model/meta.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
FactSet Overview Report Builder API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F40... | 42.984127 | 124 | 0.571178 |
import re import sys
from fds.sdk.OverviewReportBuilder.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed... | true | true |
08f07e3e65f9e85ad68ce60db95385d1c3935b26 | 2,481 | py | Python | calamari_ocr/ocr/training/warmstart.py | zhangjiulong/calamari | ecd29d46f807a3ad406f0a65bdc3283e358c3585 | [
"Apache-2.0"
] | 1 | 2021-03-24T09:32:56.000Z | 2021-03-24T09:32:56.000Z | calamari_ocr/ocr/training/warmstart.py | zhangjiulong/calamari | ecd29d46f807a3ad406f0a65bdc3283e358c3585 | [
"Apache-2.0"
] | null | null | null | calamari_ocr/ocr/training/warmstart.py | zhangjiulong/calamari | ecd29d46f807a3ad406f0a65bdc3283e358c3585 | [
"Apache-2.0"
] | null | null | null | from typing import List
import numpy as np
from tfaip.base.trainer.warmstart.warmstarter import Warmstarter
class WarmstarterWithCodecAdaption(Warmstarter):
def __init__(self, params, codec_changes):
super(WarmstarterWithCodecAdaption, self).__init__(params)
self.codec_changes = codec_changes
... | 48.647059 | 120 | 0.638452 | from typing import List
import numpy as np
from tfaip.base.trainer.warmstart.warmstarter import Warmstarter
class WarmstarterWithCodecAdaption(Warmstarter):
def __init__(self, params, codec_changes):
super(WarmstarterWithCodecAdaption, self).__init__(params)
self.codec_changes = codec_changes
... | true | true |
08f07e470a1b24ca0cbd4493ee71ff6c977deb37 | 10,584 | py | Python | testing/test_printermanager.py | barak/CUPS-Cloud-Print | 76b3175e452b56cbcdbf50ac453a4654bbb2bb26 | [
"AML"
] | 1 | 2018-03-04T16:14:34.000Z | 2018-03-04T16:14:34.000Z | testing/test_printermanager.py | barak/CUPS-Cloud-Print | 76b3175e452b56cbcdbf50ac453a4654bbb2bb26 | [
"AML"
] | null | null | null | testing/test_printermanager.py | barak/CUPS-Cloud-Print | 76b3175e452b56cbcdbf50ac453a4654bbb2bb26 | [
"AML"
] | 1 | 2019-04-28T21:39:33.000Z | 2019-04-28T21:39:33.000Z | # CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2011 Simon Cadman
#
# 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 the License, or
# (at y... | 37.399293 | 112 | 0.713719 | import cups
import urllib
import logging
import sys
sys.path.insert(0, ".")
from printer import Printer
from printermanager import PrinterManager
from mockrequestor import MockRequestor
from ccputils import Utils
global requestors, printerManagerInstance
def setup_function(function):
global requestors
r... | true | true |
08f07e5523ef8f6247f465e9ba3f8cb316596ad8 | 102 | py | Python | backend/routing/arduino_controller/clean_port.py | Drag007/Patrulkvant | cd964d1ed3b6e91b6250175c66d112c8deeabfbe | [
"Unlicense"
] | null | null | null | backend/routing/arduino_controller/clean_port.py | Drag007/Patrulkvant | cd964d1ed3b6e91b6250175c66d112c8deeabfbe | [
"Unlicense"
] | null | null | null | backend/routing/arduino_controller/clean_port.py | Drag007/Patrulkvant | cd964d1ed3b6e91b6250175c66d112c8deeabfbe | [
"Unlicense"
] | null | null | null | import serial
def clean_serial(arduino: serial.Serial):
arduino.write('clean')
return
| 14.571429 | 42 | 0.676471 | import serial
def clean_serial(arduino: serial.Serial):
arduino.write('clean')
return
| true | true |
08f07f72313140420843ab9447d78af0c83d869c | 7,823 | py | Python | perfkitbenchmarker/providers/aws/util.py | justinuang/PerfKitBenchmarker | 0730a7a6ebcd9447c7667ff6a3902c203d85fadb | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/providers/aws/util.py | justinuang/PerfKitBenchmarker | 0730a7a6ebcd9447c7667ff6a3902c203d85fadb | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/providers/aws/util.py | justinuang/PerfKitBenchmarker | 0730a7a6ebcd9447c7667ff6a3902c203d85fadb | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.558594 | 86 | 0.70983 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import re
import string
from perfkitbenchmarker import context
from perfkitbenchmarker import errors
from perfkitbenchmarker import flags
from perfkitbenchmarker import vm_uti... | true | true |
08f07f7ce2a8324b4c9a6a47d34f0b94c32a1b42 | 3,258 | py | Python | Toolkits/Discovery/meta/searx/searx/engines/flickr_noapi.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | Toolkits/Discovery/meta/searx/searx/engines/flickr_noapi.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | Toolkits/Discovery/meta/searx/searx/engines/flickr_noapi.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | #!/usr/bin/env python
"""
Flickr (Images)
@website https://www.flickr.com
@provide-api yes (https://secure.flickr.com/services/api/flickr.photos.search.html)
@using-api no
@results HTML
@stable no
@parse url, title, thumbnail, img_src
"""
from json import loads
from time import time
imp... | 27.610169 | 102 | 0.57612 |
from json import loads
from time import time
import re
from searx.engines import logger
from searx.url_utils import urlencode
logger = logger.getChild('flickr-noapi')
categories = ['images']
url = 'https://www.flickr.com/'
search_url = url + 'search?{query}&page={page}'
time_range_url = '&min_upload_date={start}&... | true | true |
08f08017dd1da46b594d1850f41cefb1625849b9 | 6,648 | py | Python | python/onos/configmodel/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 9 | 2021-03-24T10:40:05.000Z | 2022-01-22T08:55:25.000Z | python/onos/configmodel/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 23 | 2020-11-26T01:29:48.000Z | 2022-03-01T00:33:34.000Z | python/onos/configmodel/__init__.py | tomikazi/onos-api | fb349a6f26c8453707101aa27712bf16630191d6 | [
"Apache-2.0"
] | 29 | 2020-11-25T17:25:45.000Z | 2022-03-30T05:54:15.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/configmodel/registry.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict, List
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
class GetStateMode(betterproto.E... | 31.358491 | 94 | 0.666516 | from dataclasses import dataclass
from typing import Dict, List
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
class GetStateMode(betterproto.Enum):
NONE = 0
OP_STATE = 1
EXPLICIT_RO_PATHS = 2
EXPLICIT_RO_PATHS_EXPAND_WILDCARDS = 3
@dataclass(eq=False, rep... | true | true |
08f0815ad05e34d9b518e8d606ab3f0d760efadb | 23,215 | py | Python | one_fm/api/mobile/roster.py | askmetoo/One-FM | c93ed63695a3e62ee8129bd9adf563116b749030 | [
"MIT"
] | null | null | null | one_fm/api/mobile/roster.py | askmetoo/One-FM | c93ed63695a3e62ee8129bd9adf563116b749030 | [
"MIT"
] | null | null | null | one_fm/api/mobile/roster.py | askmetoo/One-FM | c93ed63695a3e62ee8129bd9adf563116b749030 | [
"MIT"
] | null | null | null | import frappe
from frappe import _
from frappe.utils import getdate, cint, cstr, random_string, now_datetime
from frappe.client import get_list
import pandas as pd
import json, base64, ast, itertools, datetime
from frappe.client import attach_file
from one_fm.one_fm.page.roster.roster import get_post_view as _ge... | 38.691667 | 233 | 0.704501 | import frappe
from frappe import _
from frappe.utils import getdate, cint, cstr, random_string, now_datetime
from frappe.client import get_list
import pandas as pd
import json, base64, ast, itertools, datetime
from frappe.client import attach_file
from one_fm.one_fm.page.roster.roster import get_post_view as _ge... | true | true |
08f08224dfb0af67c569a6d9f35b56f9dab763dc | 5,019 | py | Python | elevator.py | CaizhiXu/python-elevator-challenge | 75837c5864dea7453138292300e8636988b6cb22 | [
"MIT"
] | null | null | null | elevator.py | CaizhiXu/python-elevator-challenge | 75837c5864dea7453138292300e8636988b6cb22 | [
"MIT"
] | null | null | null | elevator.py | CaizhiXu/python-elevator-challenge | 75837c5864dea7453138292300e8636988b6cb22 | [
"MIT"
] | null | null | null | UP = 1
DOWN = 2
FLOOR_COUNT = 6
class ElevatorLogic(object):
"""
An incorrect implementation. Can you make it pass all the tests?
Fix the methods below to implement the correct logic for elevators.
The tests are integrated into `README.md`. To run the tests:
$ python -m doctest -v README.md
To ... | 43.643478 | 106 | 0.653317 | UP = 1
DOWN = 2
FLOOR_COUNT = 6
class ElevatorLogic(object):
def __init__(self):
self.callbacks = None
self.direction = 0
self.called_floors_up = set()
self.called_floors_down = set()
self.selected_floors = set()
def on_called(self, floor, direction):
c... | true | true |
08f0822fd1c08d208b418a1d528c9acf5fba7a7f | 1,366 | py | Python | var/spack/repos/builtin/packages/r-rfast/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-rfast/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-rfast/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RRfast(RPackage):
"""A Collection of Efficient and Extremely Fast R Functions.
... | 44.064516 | 95 | 0.712299 |
from spack.package import *
class RRfast(RPackage):
cran = "Rfast"
version('2.0.6', sha256='34694b5c67ce8fcbdc90aac2ac80a74d4b66515f383e6301aea7c020009ebe7f')
version('2.0.4', sha256='959907e36e24620c07ec282b203b40214f4914f4928c07ee6491043c27af31d9')
depends_on('r@3.5.0:', type=('build', 'run'))
... | true | true |
08f0829a1763ffd9bb294ed051e9ba4ba9f37981 | 2,282 | py | Python | wyslijdaty.py | JakubKoralewski/dni-w-txt-do-google-calendar-api | 26752edbc94482f0ed40554e11f226f7f442727b | [
"MIT"
] | null | null | null | wyslijdaty.py | JakubKoralewski/dni-w-txt-do-google-calendar-api | 26752edbc94482f0ed40554e11f226f7f442727b | [
"MIT"
] | null | null | null | wyslijdaty.py | JakubKoralewski/dni-w-txt-do-google-calendar-api | 26752edbc94482f0ed40554e11f226f7f442727b | [
"MIT"
] | null | null | null | """Dodaje daty z pliku zdobadzdaty.py do kalendarza Google"""
from __future__ import print_function
import datetime
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
# zdobadz variable daty ze zdobadzdaty.py
from zdobadzdaty import daty
# If modifying t... | 28.525 | 83 | 0.588957 | from __future__ import print_function
import datetime
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from zdobadzdaty import daty
SCOPES = 'https://www.googleapis.com/auth/calendar'
def jakiMiesiac(miesiac):
if not isinstance(miesiac, str):
... | true | true |
08f08364ee7ef794f324b5a50e4923d1fad4764a | 2,208 | py | Python | setup.py | amicitas/f90nml | 72e53ce369c33cf31436f15cdb5e317a43c146ae | [
"Apache-2.0"
] | null | null | null | setup.py | amicitas/f90nml | 72e53ce369c33cf31436f15cdb5e317a43c146ae | [
"Apache-2.0"
] | null | null | null | setup.py | amicitas/f90nml | 72e53ce369c33cf31436f15cdb5e317a43c146ae | [
"Apache-2.0"
] | null | null | null | """Installation script for f90nml.
Additional configuration settings are in ``setup.cfg``.
:copyright: Copyright 2014 Marshall Ward, see AUTHORS for details.
:license: Apache License, Version 2.0, see LICENSE for details.
"""
import os
import sys
try:
from setuptools import setup
from setuptools import Comma... | 27.259259 | 69 | 0.664402 | import os
import sys
try:
from setuptools import setup
from setuptools import Command
except ImportError:
from distutils.core import setup
from distutils.core import Command
import tests.test_f90nml
project_name = 'f90nml'
project_version = __import__(project_name).__version__
project_readme_fname = ... | true | true |
08f0837540babfd38ad9b897e3527e07cb326037 | 1,163 | py | Python | nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2019-01-25T18:20:51.000Z | 2019-07-30T20:51:51.000Z | nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2018-01-25T19:48:17.000Z | 2019-01-25T18:20:52.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import Tensor2Vector
def test_Tensor2Vector_inputs():
input_map = dict(args=dict(argstr='%s',
),
debug=dict(argstr='-debug',
position=1,
),
environ=dict(nohash=True,
usedefault=T... | 24.744681 | 67 | 0.641445 | from __future__ import unicode_literals
from ..preprocess import Tensor2Vector
def test_Tensor2Vector_inputs():
input_map = dict(args=dict(argstr='%s',
),
debug=dict(argstr='-debug',
position=1,
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | true | true |
08f08375def8790a38e3461b91f4c03067b097ce | 9,003 | py | Python | CybORG/CybORG/Shared/Actions/ConcreteActions/ExploitAction.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 18 | 2021-08-20T15:07:55.000Z | 2022-03-11T12:05:15.000Z | CybORG/CybORG/Shared/Actions/ConcreteActions/ExploitAction.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 7 | 2021-11-09T06:46:58.000Z | 2022-03-31T12:35:06.000Z | CybORG/CybORG/Shared/Actions/ConcreteActions/ExploitAction.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 13 | 2021-08-17T00:26:31.000Z | 2022-03-29T20:06:45.000Z | ## The following code contains work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105.
## Additionally, we waive copyright and related rights in the utilized code worldwide through the CC0 1.0 Universal public domain dedication.
"""
Pertaining to actions that establi... | 45.241206 | 141 | 0.598023 | from ipaddress import IPv4Address
from random import random
from typing import List, Tuple, Optional
from abc import abstractmethod
from CybORG.Shared import Observation
from CybORG.Shared.Actions.ConcreteActions.ConcreteAction import ConcreteAction
from CybORG.Shared.Actions.MSFActionsFolder.MSFAction import lo
from ... | true | true |
08f083852619c87c3219b03a84cdbd1c0b3233d0 | 15,916 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_compute_management_client_enums.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 37.895238 | 102 | 0.709977 |
from enum import Enum, EnumMeta
from six import with_metaclass
class _CaseInsensitiveEnumMeta(EnumMeta):
def __getitem__(self, name):
return super().__getitem__(name.upper())
def __getattr__(cls, name):
try:
return cls._member_map_[name.upper()]
except KeyError:
... | true | true |
08f083a6d809b8fb570bc8fd03b494d9021a24fc | 948 | py | Python | pydk/_rounding.py | mvinyard/python-developer-kit | 0f92baef747a052c03e209126a8ed5ce65977aa8 | [
"MIT"
] | null | null | null | pydk/_rounding.py | mvinyard/python-developer-kit | 0f92baef747a052c03e209126a8ed5ce65977aa8 | [
"MIT"
] | null | null | null | pydk/_rounding.py | mvinyard/python-developer-kit | 0f92baef747a052c03e209126a8ed5ce65977aa8 | [
"MIT"
] | null | null | null | import numpy as np
def _ceil(x, precision=0):
"""
Round to the nearest lower bound within the given precision.
Parameters:
-----------
x
array or value
type: numpy.ndarray or int or float
precision
positions left (negative) or right (positive) of the decimal point to round.
... | 19.346939 | 80 | 0.619198 | import numpy as np
def _ceil(x, precision=0):
return np.true_divide(np.ceil(x * 10**precision), 10**precision)
def _floor(x, precision=0):
return np.true_divide(np.floor(x * 10**precision), 10**precision)
| true | true |
08f084b4349fb72d9d7afaa9d7fbafa558463e1d | 987 | py | Python | bugzoo/client/dockerm.py | chubbymaggie/BugZoo | a6b56fcc27831ce9987f9edf58b37151dbb21a8a | [
"MIT"
] | null | null | null | bugzoo/client/dockerm.py | chubbymaggie/BugZoo | a6b56fcc27831ce9987f9edf58b37151dbb21a8a | [
"MIT"
] | null | null | null | bugzoo/client/dockerm.py | chubbymaggie/BugZoo | a6b56fcc27831ce9987f9edf58b37151dbb21a8a | [
"MIT"
] | null | null | null | __all__ = ['DockerManager']
import logging
from .api import APIClient
logger = logging.getLogger(__name__) # type: logging.Logger
class DockerManager(object):
"""
Provides access to the underlying Docker server used by a BugZoo server.
"""
def __init__(self, api: APIClient) -> None:
self._... | 28.2 | 76 | 0.594732 | __all__ = ['DockerManager']
import logging
from .api import APIClient
logger = logging.getLogger(__name__)
class DockerManager(object):
def __init__(self, api: APIClient) -> None:
self.__api = api
def delete_image(self, name: str) -> None:
logger.info("deleting Docker image: %s", name)
... | true | true |
08f0851920562592a7a1ece64185bd9e4be50665 | 934 | py | Python | setup.py | irustandi/spinningup | 8fccff6b69bc4f47e81f33a8fd14a97ff0646641 | [
"MIT"
] | null | null | null | setup.py | irustandi/spinningup | 8fccff6b69bc4f47e81f33a8fd14a97ff0646641 | [
"MIT"
] | null | null | null | setup.py | irustandi/spinningup | 8fccff6b69bc4f47e81f33a8fd14a97ff0646641 | [
"MIT"
] | null | null | null | from os.path import join, dirname, realpath
from setuptools import setup
import sys
assert sys.version_info.major == 3 and sys.version_info.minor >= 6, \
"The Spinning Up repo is designed to work with Python 3.6 and greater." \
+ "Please install it before proceeding."
with open(join("spinup", "version.py")) a... | 25.944444 | 77 | 0.585653 | from os.path import join, dirname, realpath
from setuptools import setup
import sys
assert sys.version_info.major == 3 and sys.version_info.minor >= 6, \
"The Spinning Up repo is designed to work with Python 3.6 and greater." \
+ "Please install it before proceeding."
with open(join("spinup", "version.py")) a... | true | true |
08f08535ccf064f87d705fe5cd5d66323be5955c | 4,184 | py | Python | pirates/effects/ExplosionCloud.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/effects/ExplosionCloud.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/effects/ExplosionCloud.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from PooledEffect import PooledEffect
from EffectController import EffectController
import random
class ExplosionClou... | 49.223529 | 220 | 0.700287 | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from PooledEffect import PooledEffect
from EffectController import EffectController
import random
class ExplosionClou... | true | true |
08f085e20a98e371c6abbb9f739319f8084a65d1 | 250 | py | Python | dglgo/dglgo/model/edge_encoder/__init__.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 1 | 2022-02-23T01:35:37.000Z | 2022-02-23T01:35:37.000Z | dglgo/dglgo/model/edge_encoder/__init__.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | null | null | null | dglgo/dglgo/model/edge_encoder/__init__.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | null | null | null | from ...utils.factory import EdgeModelFactory
from .ele import ElementWiseProductPredictor
from .bilinear import BilinearPredictor
EdgeModelFactory.register("ele")(ElementWiseProductPredictor)
EdgeModelFactory.register("bilinear")(BilinearPredictor) | 41.666667 | 61 | 0.864 | from ...utils.factory import EdgeModelFactory
from .ele import ElementWiseProductPredictor
from .bilinear import BilinearPredictor
EdgeModelFactory.register("ele")(ElementWiseProductPredictor)
EdgeModelFactory.register("bilinear")(BilinearPredictor) | true | true |
08f08612bb12934ce83686994a83626771b41f37 | 1,422 | py | Python | bloodsword/domain/factories.py | uliang/BloodSword | fc7e173ce56989c48009ec86d834072f9f2e70ac | [
"BSD-2-Clause"
] | null | null | null | bloodsword/domain/factories.py | uliang/BloodSword | fc7e173ce56989c48009ec86d834072f9f2e70ac | [
"BSD-2-Clause"
] | null | null | null | bloodsword/domain/factories.py | uliang/BloodSword | fc7e173ce56989c48009ec86d834072f9f2e70ac | [
"BSD-2-Clause"
] | null | null | null | from dataclasses import dataclass, field
from abc import ABC, abstractmethod
from typing import Optional
from .aggregates import Character
@dataclass
class CharacterFactory(ABC):
"""
Subclass this abstract class to provide implementation for creating
behavior objects for each particular character type.
... | 27.882353 | 78 | 0.655415 | from dataclasses import dataclass, field
from abc import ABC, abstractmethod
from typing import Optional
from .aggregates import Character
@dataclass
class CharacterFactory(ABC):
_character: Optional[Character] = field(init=False, default=None)
@abstractmethod
def _initialize(self) -> None:
@abstrac... | true | true |
08f0864a6417d280dc411d56063be14f5db7e947 | 5,637 | py | Python | operators/clavis_to_s3_operator.py | airflow-plugins/clavis_plugin | 36dee45003c84a4bea7e5530329db3f774c6e001 | [
"Apache-2.0"
] | null | null | null | operators/clavis_to_s3_operator.py | airflow-plugins/clavis_plugin | 36dee45003c84a4bea7e5530329db3f774c6e001 | [
"Apache-2.0"
] | null | null | null | operators/clavis_to_s3_operator.py | airflow-plugins/clavis_plugin | 36dee45003c84a4bea7e5530329db3f774c6e001 | [
"Apache-2.0"
] | 1 | 2021-03-24T11:22:26.000Z | 2021-03-24T11:22:26.000Z | import json
from airflow.utils.decorators import apply_defaults
from airflow.models import BaseOperator
from airflow.hooks.S3_hook import S3Hook
from clavis_plugin.hooks.clavis_hook import ClavisHook
class ClavisToS3Operator(BaseOperator):
"""
Clavis to S3 Operator
:param clavis_conn_id: The Ai... | 42.383459 | 79 | 0.505056 | import json
from airflow.utils.decorators import apply_defaults
from airflow.models import BaseOperator
from airflow.hooks.S3_hook import S3Hook
from clavis_plugin.hooks.clavis_hook import ClavisHook
class ClavisToS3Operator(BaseOperator):
template_fields = ['payload',
's3_key']
@ap... | true | true |
08f086c936dbdf580c48e44c5f3206f19f8bcc80 | 635 | py | Python | backend/manage.py | crowdbotics-apps/snap-tube-33379 | 96462256b110a25b7922ae85d30b20acd01215f5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/snap-tube-33379 | 96462256b110a25b7922ae85d30b20acd01215f5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/snap-tube-33379 | 96462256b110a25b7922ae85d30b20acd01215f5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snap_tube_33379.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... | 28.863636 | 79 | 0.686614 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snap_tube_33379.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and ... | true | true |
08f08764f11a9e4417571a1eb086fe4bc4aef589 | 1,546 | py | Python | VOClabelcolormap.py | VictorAtPL/Pascal-VOC12_Class-segmentation_Tensorflow-2.0.0 | ec79e4347874550601f5c9f75b42f099d10b5a95 | [
"MIT"
] | 1 | 2020-11-07T07:12:15.000Z | 2020-11-07T07:12:15.000Z | VOClabelcolormap.py | VictorAtPL/Pascal-VOC12_Class-segmentation_Tensorflow-2.0.0 | ec79e4347874550601f5c9f75b42f099d10b5a95 | [
"MIT"
] | 1 | 2020-09-25T19:51:13.000Z | 2020-09-25T19:51:13.000Z | VOClabelcolormap.py | VictorAtPL/Pascal-VOC12_Class-segmentation_Tensorflow-2.0.0 | ec79e4347874550601f5c9f75b42f099d10b5a95 | [
"MIT"
] | 1 | 2020-11-07T08:57:46.000Z | 2020-11-07T08:57:46.000Z | """
Python implementation of the color map function for the PASCAL VOC data set.
Official Matlab version can be found in the PASCAL VOC devkit
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/index.html#devkit
"""
import numpy as np
from skimage.io import imshow
import matplotlib.pyplot as plt
def color_map(N=256, n... | 33.608696 | 230 | 0.596378 | import numpy as np
from skimage.io import imshow
import matplotlib.pyplot as plt
def color_map(N=256, normalized=False):
def bitget(byteval, idx):
return ((byteval & (1 << idx)) != 0)
dtype = 'float32' if normalized else 'uint8'
cmap = np.zeros((N, 3), dtype=dtype)
for i in range(N):
... | true | true |
08f0877fa8e0f9ac8db333e857c0505a2ae09876 | 6,825 | py | Python | tests/test_utils.py | carsonmckee/bayesglm | 443c65c1763fb287e7a0ad1fa516ebf92557f0b3 | [
"MIT"
] | null | null | null | tests/test_utils.py | carsonmckee/bayesglm | 443c65c1763fb287e7a0ad1fa516ebf92557f0b3 | [
"MIT"
] | null | null | null | tests/test_utils.py | carsonmckee/bayesglm | 443c65c1763fb287e7a0ad1fa516ebf92557f0b3 | [
"MIT"
] | null | null | null | import unittest
import sys
sys.path.append('/Users/carsonmckee/Dev/bayesglm_2/bayesglm')
import utils
import pandas
class TestModelMatrix(unittest.TestCase):
def setUp(self):
self.data = pandas.DataFrame(data=[[1,"A",3,4,5], [6,"B",8,9,10], [11,"C",13,14,15]],
columns=... | 46.746575 | 109 | 0.627106 | import unittest
import sys
sys.path.append('/Users/carsonmckee/Dev/bayesglm_2/bayesglm')
import utils
import pandas
class TestModelMatrix(unittest.TestCase):
def setUp(self):
self.data = pandas.DataFrame(data=[[1,"A",3,4,5], [6,"B",8,9,10], [11,"C",13,14,15]],
columns=... | true | true |
08f087a4e5134cc634155282561afc218bfc43b9 | 858 | py | Python | testWrt/lib/log.py | lynxis/testWrt | 072ba9236f6a392d924d838454beb60504b3e554 | [
"BSD-3-Clause"
] | 2 | 2019-05-24T23:27:16.000Z | 2019-05-25T08:10:31.000Z | testWrt/lib/log.py | lynxis/testWrt | 072ba9236f6a392d924d838454beb60504b3e554 | [
"BSD-3-Clause"
] | 1 | 2022-03-29T21:52:54.000Z | 2022-03-29T21:52:54.000Z | testWrt/lib/log.py | lynxis/testWrt | 072ba9236f6a392d924d838454beb60504b3e554 | [
"BSD-3-Clause"
] | 1 | 2016-05-15T03:36:55.000Z | 2016-05-15T03:36:55.000Z | from pprint import pformat
import re
from testWrt.utils.syslog_receiver import SyslogServer
class OpenWrtLog(object):
def log_array(self, caller, array):
for line in array:
self.log("%s: %s" % (caller, line.strip('\n')))
def log_file(self, filename):
self.log_array(filename, self... | 29.586207 | 76 | 0.602564 | from pprint import pformat
import re
from testWrt.utils.syslog_receiver import SyslogServer
class OpenWrtLog(object):
def log_array(self, caller, array):
for line in array:
self.log("%s: %s" % (caller, line.strip('\n')))
def log_file(self, filename):
self.log_array(filename, self... | true | true |
08f08959e07da6ccba2999b690a99d64617c0033 | 76,501 | py | Python | OttBands5minFixedOtt/jessetkdata/dnafiles/ETH-USDT 2021-10-08 2021-11-12.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 38 | 2021-09-18T15:33:28.000Z | 2022-02-21T17:29:08.000Z | OttBands5minFixedOtt/jessetkdata/dnafiles/ETH-USDT 2021-10-08 2021-11-12.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 4 | 2022-01-02T14:46:12.000Z | 2022-02-16T18:39:41.000Z | OttBands5minFixedOtt/jessetkdata/dnafiles/ETH-USDT 2021-10-08 2021-11-12.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 11 | 2021-10-19T06:21:43.000Z | 2022-02-21T17:29:10.000Z | dnas = [
['R:inl', 66, 15, 15.11, 40, 5, -2.01, {'ott_len': 30, 'ott_percent': 174, 'ott_bw': 142, 'tps_qty_index': 111, 'max_risk': 58}],
['\\7gAL', 77, 9, 10.56, 66, 3, -0.91, {'ott_len': 32, 'ott_percent': 170, 'ott_bw': 140, 'tps_qty_index': 40, 'max_risk': 38}],
['eVswv', 63, 19, 11.55, 100, 4, 5.34, {'ott_len': 3... | 128.573109 | 131 | 0.58611 | dnas = [
['R:inl', 66, 15, 15.11, 40, 5, -2.01, {'ott_len': 30, 'ott_percent': 174, 'ott_bw': 142, 'tps_qty_index': 111, 'max_risk': 58}],
['\\7gAL', 77, 9, 10.56, 66, 3, -0.91, {'ott_len': 32, 'ott_percent': 170, 'ott_bw': 140, 'tps_qty_index': 40, 'max_risk': 38}],
['eVswv', 63, 19, 11.55, 100, 4, 5.34, {'ott_len': 3... | true | true |
08f08986951a902a331011b272ada03c89845c7d | 13,375 | py | Python | salt/states/boto_cloudtrail.py | ronnix/salt | 00ffa294ad5842786e9da9cb4fc70955f53299fa | [
"Apache-2.0"
] | null | null | null | salt/states/boto_cloudtrail.py | ronnix/salt | 00ffa294ad5842786e9da9cb4fc70955f53299fa | [
"Apache-2.0"
] | null | null | null | salt/states/boto_cloudtrail.py | ronnix/salt | 00ffa294ad5842786e9da9cb4fc70955f53299fa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage CloudTrail Objects
=================
.. versionadded:: 2016.3.0
Create and destroy CloudTrail objects. Be aware that this interacts with Amazon's services,
and so may incur charges.
This module uses ``boto3``, which can be installed via package, or pip.
This module accepts explici... | 36.345109 | 97 | 0.584822 |
from __future__ import absolute_import
import logging
import os
import os.path
import salt.utils
log = logging.getLogger(__name__)
def __virtual__():
return 'boto_cloudtrail' if 'boto_cloudtrail.exists' in __salt__ else False
def present(name, Name,
S3BucketName, S3KeyPrefix=None,
SnsTo... | true | true |
08f089c0caa402ca0f8ee424418ae9a511be4b54 | 7,938 | py | Python | docs/conf.py | liamwazherealso/twitter-sentiment-analysis | 25eea4ef45e5cefe62b56002eb756beb11361de1 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | liamwazherealso/twitter-sentiment-analysis | 25eea4ef45e5cefe62b56002eb756beb11361de1 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | liamwazherealso/twitter-sentiment-analysis | 25eea4ef45e5cefe62b56002eb756beb11361de1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# twitter-sentiment-analysis documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configur... | 32.4 | 88 | 0.710632 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'twitter-sentiment-analysis'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version... | true | true |
08f08a105b7755d3f558b60e9d16ed657d81d9b1 | 634 | py | Python | threads.py | JackCharles/Python-Code | 53ec5ad2392b7bb7b121a0adb468dceb44a5e792 | [
"Apache-2.0"
] | null | null | null | threads.py | JackCharles/Python-Code | 53ec5ad2392b7bb7b121a0adb468dceb44a5e792 | [
"Apache-2.0"
] | null | null | null | threads.py | JackCharles/Python-Code | 53ec5ad2392b7bb7b121a0adb468dceb44a5e792 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import threading
import queue
class MyThread(threading.Thread):
def __init__(self, queue):
threading.Thread.__init__(self)
self._queue = queue
def run(self):
item = self._queue.get_nowait()
print("%d ,I am thread %s" % (item, self.getName()))
de... | 19.212121 | 61 | 0.556782 | import threading
import queue
class MyThread(threading.Thread):
def __init__(self, queue):
threading.Thread.__init__(self)
self._queue = queue
def run(self):
item = self._queue.get_nowait()
print("%d ,I am thread %s" % (item, self.getName()))
def main():
q... | true | true |
08f08b27a86f167684c1169796e252368ac5e826 | 15 | py | Python | ed/l/python/examples/prj/prj/__init__.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | null | null | null | ed/l/python/examples/prj/prj/__init__.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | null | null | null | ed/l/python/examples/prj/prj/__init__.py | cn007b/stash | bae604d3056f09b9b6c6b3e0282f02c829801f5c | [
"MIT"
] | 1 | 2021-11-26T05:40:08.000Z | 2021-11-26T05:40:08.000Z | # init project
| 7.5 | 14 | 0.733333 | true | true | |
08f08b96207f8a4e5e7654dd85ce32716525fd7d | 140 | py | Python | titan/react_state_pkg/selectitemeffect/resources.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | titan/react_state_pkg/selectitemeffect/resources.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | titan/react_state_pkg/selectitemeffect/resources.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from titan.react_pkg.component import Component
@dataclass
class SelectItemEffect(Component):
pass
| 15.555556 | 47 | 0.821429 | from dataclasses import dataclass
from titan.react_pkg.component import Component
@dataclass
class SelectItemEffect(Component):
pass
| true | true |
08f08d0a2f7eacc91053ac7bf7810ffa42bdd559 | 1,332 | py | Python | openstack_dashboard/dashboards/admin/block_storage/views.py | ankur-gupta91/block_storage | 938548a3d4507dc56c1c26b442767eb41aa2e610 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/admin/block_storage/views.py | ankur-gupta91/block_storage | 938548a3d4507dc56c1c26b442767eb41aa2e610 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/admin/block_storage/views.py | ankur-gupta91/block_storage | 938548a3d4507dc56c1c26b442767eb41aa2e610 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 37 | 75 | 0.731231 |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.admin.block_storage \
import tabs as block_storage_tabs
class IndexView(tabs.TabbedTableView):
tab_group_class = block_... | true | true |
08f08e1bb64fb676c53b82556a647155efb71d0f | 5,908 | py | Python | homeassistant/components/updater/__init__.py | joopert/home-assistant | a3f6fbb3774004b15c397c0556f98c5f7a59cb22 | [
"Apache-2.0"
] | 3 | 2020-10-23T14:39:11.000Z | 2021-02-17T14:40:17.000Z | homeassistant/components/updater/__init__.py | joopert/home-assistant | a3f6fbb3774004b15c397c0556f98c5f7a59cb22 | [
"Apache-2.0"
] | 3 | 2021-02-08T20:54:46.000Z | 2021-09-08T02:30:04.000Z | homeassistant/components/updater/__init__.py | joopert/home-assistant | a3f6fbb3774004b15c397c0556f98c5f7a59cb22 | [
"Apache-2.0"
] | 4 | 2020-05-30T08:19:47.000Z | 2021-05-14T11:39:19.000Z | """Support to check for available updates."""
import asyncio
from datetime import timedelta
# pylint: disable=import-error
from distutils.version import StrictVersion
import json
import logging
import uuid
import aiohttp
import async_timeout
from distro import linux_distribution
import voluptuous as vol
from homeass... | 32.108696 | 88 | 0.68585 | import asyncio
from datetime import timedelta
from distutils.version import StrictVersion
import json
import logging
import uuid
import aiohttp
import async_timeout
from distro import linux_distribution
import voluptuous as vol
from homeassistant.const import __version__ as current_version
from homeassistant.helpers... | true | true |
08f08e8d79ad9e02b4ebf885c98104cf0c4359f5 | 2,659 | py | Python | scrapy/selector/unified.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 41,267 | 2015-01-01T07:39:25.000Z | 2022-03-31T20:09:40.000Z | scrapy/selector/unified.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 4,420 | 2015-01-02T09:35:38.000Z | 2022-03-31T22:53:32.000Z | scrapy/selector/unified.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 11,080 | 2015-01-01T18:11:30.000Z | 2022-03-31T15:33:19.000Z | """
XPath selectors based on lxml
"""
from parsel import Selector as _ParselSelector
from scrapy.utils.trackref import object_ref
from scrapy.utils.python import to_bytes
from scrapy.http import HtmlResponse, XmlResponse
__all__ = ['Selector', 'SelectorList']
def _st(response, st):
if st is None:
retur... | 32.036145 | 81 | 0.655886 |
from parsel import Selector as _ParselSelector
from scrapy.utils.trackref import object_ref
from scrapy.utils.python import to_bytes
from scrapy.http import HtmlResponse, XmlResponse
__all__ = ['Selector', 'SelectorList']
def _st(response, st):
if st is None:
return 'xml' if isinstance(response, XmlRes... | true | true |
08f08f913c9bbd6475dcc72fc4b237a246b25f87 | 854 | py | Python | test/ext/mypy/plugin_files/as_declarative.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | 1 | 2020-07-21T16:06:40.000Z | 2020-07-21T16:06:40.000Z | test/ext/mypy/plugin_files/as_declarative.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | 4 | 2020-04-23T19:00:28.000Z | 2021-09-28T18:14:58.000Z | test/ext/mypy/plugin_files/as_declarative.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | 1 | 2022-02-28T20:16:29.000Z | 2022-02-28T20:16:29.000Z | from typing import List
from typing import Optional
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative import as_declarative
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import ForeignKey
@... | 19.860465 | 53 | 0.722482 | from typing import List
from typing import Optional
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative import as_declarative
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import ForeignKey
@... | true | true |
08f0908394267680c748f04178b484d35752088f | 222 | py | Python | case/array.py | xierensong/learnPython | 33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455 | [
"MIT"
] | null | null | null | case/array.py | xierensong/learnPython | 33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455 | [
"MIT"
] | null | null | null | case/array.py | xierensong/learnPython | 33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455 | [
"MIT"
] | 1 | 2018-10-11T08:20:44.000Z | 2018-10-11T08:20:44.000Z | # coding=utf-8
import numpy as np
a_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print('a list', a_list)
a_array = np.array(a_list)
print('a array', a_array)
a_new_list = a_array.tolist()
print('a new list', a_new_list) | 14.8 | 42 | 0.630631 |
import numpy as np
a_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print('a list', a_list)
a_array = np.array(a_list)
print('a array', a_array)
a_new_list = a_array.tolist()
print('a new list', a_new_list) | true | true |
08f09150c2433117f2f4d8d2532d7c104f1b9c88 | 10,924 | py | Python | gr-gsm/python/qa_decryption.py | ossiemarks/hackrf-gsm | fc3d690354e3bed8b7f8b2f70c3eaf0ecb74d88c | [
"MIT"
] | 6 | 2021-12-19T07:16:38.000Z | 2022-03-19T17:50:51.000Z | gr-gsm/python/qa_decryption.py | mapennell/hackrf-gsm | fc3d690354e3bed8b7f8b2f70c3eaf0ecb74d88c | [
"MIT"
] | null | null | null | gr-gsm/python/qa_decryption.py | mapennell/hackrf-gsm | fc3d690354e3bed8b7f8b2f70c3eaf0ecb74d88c | [
"MIT"
] | 5 | 2019-09-05T05:49:35.000Z | 2021-07-10T20:42:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @file
# @author Piotr Krysik <ptrkrysik@gmail.com>
# @section LICENSE
#
# Gr-gsm 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, or (at your o... | 53.812808 | 163 | 0.758971 |
from gnuradio import gr, gr_unittest, blocks
import grgsm
import pmt
class qa_decryption (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_a51 (self):
framenumbers_input = [1259192, 1259218, 1259244, 1259270]
... | true | true |
08f0915befaa4ac8d0b3a693ef75d40e5e94c58b | 2,916 | py | Python | Stress/SIGI_Fase_1_HSM/TurnadorRepresentacion.py | VictorAdad/sigi-api-adad | 412511b04b420a82cf6ae5338e401b181faae022 | [
"CC0-1.0"
] | null | null | null | Stress/SIGI_Fase_1_HSM/TurnadorRepresentacion.py | VictorAdad/sigi-api-adad | 412511b04b420a82cf6ae5338e401b181faae022 | [
"CC0-1.0"
] | null | null | null | Stress/SIGI_Fase_1_HSM/TurnadorRepresentacion.py | VictorAdad/sigi-api-adad | 412511b04b420a82cf6ae5338e401b181faae022 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from locust import HttpLocust, TaskSet, task
from requests_toolbelt import MultipartEncoder
from random import randrange
import requests
import mysql.connector
from mysql.connector import errorcode
import variables
import time
url = variables.url
nombres = variabl... | 30.061856 | 233 | 0.700274 |
from locust import HttpLocust, TaskSet, task
from requests_toolbelt import MultipartEncoder
from random import randrange
import requests
import mysql.connector
from mysql.connector import errorcode
import variables
import time
url = variables.url
nombres = variables.nombres
paternos = variables.paternos
mate... | false | true |
08f092f9781d5cd88609c9bbf4b6e9fcccc4e95e | 14,406 | py | Python | ive.py | plus2047/overiva | 9339a7dbb484d4ba8c3f84a9b111c51e77055bfa | [
"MIT"
] | 31 | 2019-05-27T02:48:55.000Z | 2022-01-06T09:24:31.000Z | ive.py | plus2047/overiva | 9339a7dbb484d4ba8c3f84a9b111c51e77055bfa | [
"MIT"
] | 1 | 2020-10-24T16:10:04.000Z | 2020-10-24T16:10:04.000Z | ive.py | plus2047/overiva | 9339a7dbb484d4ba8c3f84a9b111c51e77055bfa | [
"MIT"
] | 13 | 2019-05-27T02:15:52.000Z | 2022-01-06T14:26:23.000Z | # Copyright (c) 2019 Robin Scheibler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dis... | 33.58042 | 150 | 0.614536 | import os
import numpy as np
from pyroomacoustics.bss import projection_back
def ogive(
X,
n_iter=4000,
step_size=0.1,
tol=1e-3,
update="demix",
proj_back=True,
W0=None,
model="laplace",
init_eig=False,
return_filters=False,
callback=None,
):
n_frames, n_freq, n_chan... | true | true |
08f09367ba69ad614f60f2969329ccee624d0cab | 75 | py | Python | pgm/binarycheck.py | Dharani-18/CODEKATA | c9c39a0579d2ee7fd8790d240f50e087708b8050 | [
"Apache-2.0"
] | null | null | null | pgm/binarycheck.py | Dharani-18/CODEKATA | c9c39a0579d2ee7fd8790d240f50e087708b8050 | [
"Apache-2.0"
] | null | null | null | pgm/binarycheck.py | Dharani-18/CODEKATA | c9c39a0579d2ee7fd8790d240f50e087708b8050 | [
"Apache-2.0"
] | 2 | 2019-05-24T05:26:31.000Z | 2019-07-18T06:18:48.000Z | a=set(input())
s={'0','1'}
if a==s:
print("yes")
else:
print("no")
| 10.714286 | 16 | 0.466667 | a=set(input())
s={'0','1'}
if a==s:
print("yes")
else:
print("no")
| true | true |
08f09399df0f736577ea11204f22e48a1483ac99 | 1,492 | py | Python | test/test_optimizer.py | damian5710/bisweb | 13f31058824a4fe480e5cff940f6757be52f759c | [
"Apache-2.0"
] | 66 | 2018-04-28T22:09:00.000Z | 2022-03-07T00:28:14.000Z | test/test_optimizer.py | damian5710/bisweb | 13f31058824a4fe480e5cff940f6757be52f759c | [
"Apache-2.0"
] | 28 | 2018-08-17T13:57:46.000Z | 2021-11-24T13:20:35.000Z | test/test_optimizer.py | damian5710/bisweb | 13f31058824a4fe480e5cff940f6757be52f759c | [
"Apache-2.0"
] | 24 | 2018-05-09T20:14:00.000Z | 2022-03-21T12:54:22.000Z | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... | 31.083333 | 163 | 0.703753 |
import os
import sys
import unittest
my_path=os.path.dirname(os.path.realpath(__file__));
sys.path.insert(0,os.path.abspath(my_path+'/../'));
import biswebpython.core.bis_baseutils as bis_baseutils;
libbiswasm=bis_baseutils.getDynamicLibraryWrapper();
class TestEigen(unittest.TestCase):
def test_optimizer(se... | true | true |
08f0949c3813df1f3cd778ce3c9247d800c54096 | 4,006 | py | Python | baselines/rainbow/experiments/atari/model.py | YYD888/deeprl-baselines | 773eaede741f5db9c52046e3016f06dff41d0d8f | [
"MIT"
] | 39 | 2018-01-02T08:00:19.000Z | 2022-02-10T16:43:53.000Z | baselines/rainbow/experiments/atari/model.py | YYD888/deeprl-baselines | 773eaede741f5db9c52046e3016f06dff41d0d8f | [
"MIT"
] | 3 | 2018-04-20T17:39:14.000Z | 2018-10-25T09:45:39.000Z | baselines/rainbow/experiments/atari/model.py | YYD888/deeprl-baselines | 773eaede741f5db9c52046e3016f06dff41d0d8f | [
"MIT"
] | 7 | 2018-03-29T00:17:09.000Z | 2019-08-19T09:56:02.000Z | import tensorflow as tf
import tensorflow.contrib.layers as layers
def layer_norm_fn(x, relu=True):
x = layers.layer_norm(x, scale=True, center=True)
if relu:
x = tf.nn.relu(x)
return x
def model(img_in, num_actions, scope, reuse=False, layer_norm=False, distributed=False, atoms=51):
"""As d... | 51.358974 | 117 | 0.662007 | import tensorflow as tf
import tensorflow.contrib.layers as layers
def layer_norm_fn(x, relu=True):
x = layers.layer_norm(x, scale=True, center=True)
if relu:
x = tf.nn.relu(x)
return x
def model(img_in, num_actions, scope, reuse=False, layer_norm=False, distributed=False, atoms=51):
print("... | true | true |
08f094a0172e81d6280cfa47dc7ff2752714d9ae | 9,264 | py | Python | fbssdc/bpy.py | Eijebong/binjs-ref | 52ba3ec9e9e2c439febc6a25f5f7952bd35dc539 | [
"MIT"
] | 391 | 2017-12-18T12:33:29.000Z | 2022-03-09T10:11:57.000Z | fbssdc/bpy.py | Eijebong/binjs-ref | 52ba3ec9e9e2c439febc6a25f5f7952bd35dc539 | [
"MIT"
] | 297 | 2018-02-04T13:31:14.000Z | 2021-01-03T21:06:50.000Z | fbssdc/bpy.py | Eijebong/binjs-ref | 52ba3ec9e9e2c439febc6a25f5f7952bd35dc539 | [
"MIT"
] | 31 | 2018-02-12T16:57:50.000Z | 2020-12-26T16:28:53.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import format
import idl
import opt
import os
import strings
import subprocess
import tempfile
import tycheck
import t... | 41.542601 | 165 | 0.667638 |
import format
import idl
import opt
import os
import strings
import subprocess
import tempfile
import tycheck
import types
import argparse
import json
import sys
import shutil
def encode_dir(dict_file, binjs_encode, in_path, out_path, skip_errors=True, copy_source=True):
types = idl.parse_es6_idl()
ty_script = ... | true | true |
08f094a48094dc886d8a7dbdb581f0ca8f433ddd | 12,886 | py | Python | tests/fixtures_loan_token.py | KenMan79/Sovryn-smart-contracts | 966de713c97c8f81809cd3eebdbae2aff4978bfd | [
"Apache-2.0"
] | 1 | 2021-10-19T00:43:12.000Z | 2021-10-19T00:43:12.000Z | tests/fixtures_loan_token.py | KenMan79/Sovryn-smart-contracts | 966de713c97c8f81809cd3eebdbae2aff4978bfd | [
"Apache-2.0"
] | null | null | null | tests/fixtures_loan_token.py | KenMan79/Sovryn-smart-contracts | 966de713c97c8f81809cd3eebdbae2aff4978bfd | [
"Apache-2.0"
] | null | null | null | import pytest
from brownie import Contract, Wei, network
from brownie.network.contract import InterfaceContainer
from brownie.network.state import _add_contract, _remove_contract
import shared
# returns a loan token with underlying token SUSD
@pytest.fixture(scope="module", autouse=True)
def loanToken(LoanToken, Loa... | 41.567742 | 145 | 0.684386 | import pytest
from brownie import Contract, Wei, network
from brownie.network.contract import InterfaceContainer
from brownie.network.state import _add_contract, _remove_contract
import shared
@pytest.fixture(scope="module", autouse=True)
def loanToken(LoanToken, LoanTokenLogicTest, LoanTokenSettingsLowerAdmin, SUSD, ... | true | true |
08f09534c140dcdf962eadea72dc939d16bc4ed8 | 3,908 | py | Python | mars/tensor/reduction/all.py | wjsi/mars | a69fb19edfe748d4393b90ff2c4941a76c084596 | [
"Apache-2.0"
] | null | null | null | mars/tensor/reduction/all.py | wjsi/mars | a69fb19edfe748d4393b90ff2c4941a76c084596 | [
"Apache-2.0"
] | null | null | null | mars/tensor/reduction/all.py | wjsi/mars | a69fb19edfe748d4393b90ff2c4941a76c084596 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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-... | 33.689655 | 88 | 0.655834 |
import numpy as np
from ... import opcodes as OperandDef
from ..datasource import tensor as astensor
from .core import TensorReduction, TensorReductionMixin
class TensorAll(TensorReduction, TensorReductionMixin):
_op_type_ = OperandDef.ALL
_func_name = "all"
def __init__(self, axis=None, keepdims=None,... | true | true |
08f095967330d429ecebfd0a664833a97e63b467 | 291 | py | Python | tests/test_combinations_phone.py | exterkamps/Python-Data-Structures | 8594ed934edeaded4866999932384d12fb4519c3 | [
"Apache-2.0"
] | 3 | 2018-10-15T17:38:29.000Z | 2021-03-24T02:55:46.000Z | tests/test_combinations_phone.py | exterkamp/Python-Data-Structures | 8594ed934edeaded4866999932384d12fb4519c3 | [
"Apache-2.0"
] | null | null | null | tests/test_combinations_phone.py | exterkamp/Python-Data-Structures | 8594ed934edeaded4866999932384d12fb4519c3 | [
"Apache-2.0"
] | null | null | null | import unittest
from algorithms.string.combinations import combinations_of_phone_input
class TestCombinationsPhone(unittest.TestCase):
def test_phone_combo_simple(self):
self.assertEqual(['da', 'db', 'dc', 'ea', 'eb', 'ec', 'fa', 'fb', 'fc'], combinations_of_phone_input('32')) | 41.571429 | 115 | 0.731959 | import unittest
from algorithms.string.combinations import combinations_of_phone_input
class TestCombinationsPhone(unittest.TestCase):
def test_phone_combo_simple(self):
self.assertEqual(['da', 'db', 'dc', 'ea', 'eb', 'ec', 'fa', 'fb', 'fc'], combinations_of_phone_input('32')) | true | true |
08f09625d2eb8a6f63134a8c387e5574b40321f4 | 653 | py | Python | pytest_cases/tests/pytest_extension/fixtures/fixture_plus_and_others/test_fixture_unpacking.py | AnesBenmerzoug/python-pytest-cases | 8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5 | [
"BSD-3-Clause"
] | null | null | null | pytest_cases/tests/pytest_extension/fixtures/fixture_plus_and_others/test_fixture_unpacking.py | AnesBenmerzoug/python-pytest-cases | 8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5 | [
"BSD-3-Clause"
] | null | null | null | pytest_cases/tests/pytest_extension/fixtures/fixture_plus_and_others/test_fixture_unpacking.py | AnesBenmerzoug/python-pytest-cases | 8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Sylvain MARIE <sylvain.marie@se.com>
# + All contributors to <https://github.com/smarie/python-pytest-cases>
#
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
import pytest
from pytest_cases import unpack_fixture, pytest_fixture_plus
@pytest_fixture_plu... | 26.12 | 92 | 0.67075 | import pytest
from pytest_cases import unpack_fixture, pytest_fixture_plus
@pytest_fixture_plus
@pytest.mark.parametrize("o", ['hello', 'world'])
def c(o):
return o, o[0]
a, b = unpack_fixture("a,b", c)
def test_function(a, b):
assert a[0] == b
def test_synthesis(module_results_dct):
assert list(mod... | true | true |
08f09795aa35a9ec5515fc4b2b2e7d75fceb94d8 | 14,014 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/lambda_policy.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/lambda_policy.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/lambda_policy.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# Copyright (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
... | 32.06865 | 133 | 0.662694 |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: lambda_policy
short_description: Creates, updates or deletes AWS Lambda policy statements.
description:
- This module allows the management of ... | true | true |
08f097a71654e39f17b7298ec1ca6718f2e79386 | 86,877 | py | Python | modules/rna_manual_reference.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | 1 | 2018-06-18T09:46:10.000Z | 2018-06-18T09:46:10.000Z | modules/rna_manual_reference.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | null | null | null | modules/rna_manual_reference.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | null | null | null | # Do not edit this file. This file is auto genereated from rna_manual_reference_updater.py
import bpy
url_manual_prefix = "https://docs.blender.org/manual/en/dev/"
language = ""
if bpy.context.user_preferences.system.use_international_fonts:
language = bpy.context.user_preferences.system.language
if language... | 103.795699 | 186 | 0.791567 |
import bpy
url_manual_prefix = "https://docs.blender.org/manual/en/dev/"
language = ""
if bpy.context.user_preferences.system.use_international_fonts:
language = bpy.context.user_preferences.system.language
if language == 'DEFAULT':
import os
language = os.getenv('LANG', '').split('.')[0]
LA... | true | true |
08f097c88a6d35d87ba813886d3ca26857b4d2d0 | 18,617 | py | Python | mmocr/models/textdet/modules/proposal_local_graph.py | yCobanoglu/mmocr | 3d2a91955efe134a0a33ca00d0d45632813b6b46 | [
"Apache-2.0"
] | null | null | null | mmocr/models/textdet/modules/proposal_local_graph.py | yCobanoglu/mmocr | 3d2a91955efe134a0a33ca00d0d45632813b6b46 | [
"Apache-2.0"
] | null | null | null | mmocr/models/textdet/modules/proposal_local_graph.py | yCobanoglu/mmocr | 3d2a91955efe134a0a33ca00d0d45632813b6b46 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
import torch
try:
from lanms import merge_quadrangle_n9 as la_nms
except:
pass
from mmcv.ops import RoIAlignRotated
from mmocr.models.textdet.postprocess.wrapper import fill_hole
from .utils import (euclidean_distance_matrix, feature_embedding,
normalize_adjace... | 44.645084 | 79 | 0.602084 | import cv2
import numpy as np
import torch
try:
from lanms import merge_quadrangle_n9 as la_nms
except:
pass
from mmcv.ops import RoIAlignRotated
from mmocr.models.textdet.postprocess.wrapper import fill_hole
from .utils import (euclidean_distance_matrix, feature_embedding,
normalize_adjace... | true | true |
08f097d8d2be86a4c7d3a0a85bf35a4b5bc8e3df | 2,114 | py | Python | samples/calculator/viewmodels/calculator.py | jannesh/tkmvvm | 339251d1af7abe18bd98628cf0e4efea5594189d | [
"MIT"
] | null | null | null | samples/calculator/viewmodels/calculator.py | jannesh/tkmvvm | 339251d1af7abe18bd98628cf0e4efea5594189d | [
"MIT"
] | null | null | null | samples/calculator/viewmodels/calculator.py | jannesh/tkmvvm | 339251d1af7abe18bd98628cf0e4efea5594189d | [
"MIT"
] | null | null | null | from context import tkmvvm
from typing import Union
class CalculatorViewModel(tkmvvm.viewmodel.ViewModel):
_entry = ""
_computation = ""
def __init__(self, model: Union[None, tkmvvm.model.Model]):
super(CalculatorViewModel, self).__init__(model)
@property
def entry(self):
... | 22.252632 | 86 | 0.525071 | from context import tkmvvm
from typing import Union
class CalculatorViewModel(tkmvvm.viewmodel.ViewModel):
_entry = ""
_computation = ""
def __init__(self, model: Union[None, tkmvvm.model.Model]):
super(CalculatorViewModel, self).__init__(model)
@property
def entry(self):
... | true | true |
08f0980f3c875cf9e69b0ce598b114b9a03d6d9b | 5,412 | py | Python | ros/src/twist_controller/dbw_node.py | adwaitverulkar/CarND-Capstone | adb107b3767c65720cbcaa0ec08a3b5df3dc3731 | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | adwaitverulkar/CarND-Capstone | adb107b3767c65720cbcaa0ec08a3b5df3dc3731 | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | adwaitverulkar/CarND-Capstone | adb107b3767c65720cbcaa0ec08a3b5df3dc3731 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
'''
You can build this node only after you have built (or partially built) th... | 42.614173 | 101 | 0.623245 |
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
class DBWNode(object):
def __init__(self):
rospy.init_node('dbw_node')
vehicl... | true | true |
08f099506ba26c390bd628dab5d7773336db0edc | 107 | py | Python | App/__init__.py | ethanmjansen/Article_Classifier | a10447642d7e3357da2ff731a981a50440a8f234 | [
"MIT"
] | null | null | null | App/__init__.py | ethanmjansen/Article_Classifier | a10447642d7e3357da2ff731a981a50440a8f234 | [
"MIT"
] | null | null | null | App/__init__.py | ethanmjansen/Article_Classifier | a10447642d7e3357da2ff731a981a50440a8f234 | [
"MIT"
] | null | null | null | """Entry point for Article Classifier Flask application."""
from .app import create_app
APP = create_app() | 26.75 | 59 | 0.766355 | from .app import create_app
APP = create_app() | true | true |
08f099b5091861b4a33c540ad51b3f97d008981b | 6,490 | py | Python | flexget/plugins/input/betaseries_list.py | fotile96/Flexget | 0f7f805a43e25e27fce195b91228f911bf4c6b1e | [
"MIT"
] | null | null | null | flexget/plugins/input/betaseries_list.py | fotile96/Flexget | 0f7f805a43e25e27fce195b91228f911bf4c6b1e | [
"MIT"
] | null | null | null | flexget/plugins/input/betaseries_list.py | fotile96/Flexget | 0f7f805a43e25e27fce195b91228f911bf4c6b1e | [
"MIT"
] | null | null | null | """Input plugin for www.betaseries.com"""
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from hashlib import md5
import logging
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event... | 32.288557 | 118 | 0.609399 | from __future__ import unicode_literals, division, absolute_import
from builtins import *
from hashlib import md5
import logging
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils import requests
from flexget.utils.cached_input import cached
log = logging.g... | true | true |
08f09bdefe598bae62ba3f300e52dba6f60a9003 | 699 | py | Python | unobase/email_tracking/urls.py | unomena/unobase | 175e768afa1608f9f34d1e5a053763ad27db0f7e | [
"BSD-3-Clause"
] | null | null | null | unobase/email_tracking/urls.py | unomena/unobase | 175e768afa1608f9f34d1e5a053763ad27db0f7e | [
"BSD-3-Clause"
] | null | null | null | unobase/email_tracking/urls.py | unomena/unobase | 175e768afa1608f9f34d1e5a053763ad27db0f7e | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'michael'
from django.conf.urls.defaults import patterns, url
from unobase.email_tracking import views
urlpatterns = patterns('',
# Blog
# url(r'^(?P<slug>[\w-]+)/$',
# views.BlogDetail.as_view(paginate_by=6, template_name='blog/blog_detail.html'),
# name='blog_detail'),
url(r... | 31.772727 | 101 | 0.65093 | __author__ = 'michael'
from django.conf.urls.defaults import patterns, url
from unobase.email_tracking import views
urlpatterns = patterns('',
url(r'^list/$',
views.OutboundEmailList.as_view(template_name='email_tracking/outbound_email_list.html',
paginate_by... | true | true |
08f09c1f08d2e26a5eb6aa6db46074cd207a6695 | 4,508 | py | Python | fetchai/ledger/api/bootstrap.py | DavidMinarsch/ledger-api-py | 83bcae0bbe140b05e9413f4a5240b4a9b1cd6dc3 | [
"Apache-2.0"
] | null | null | null | fetchai/ledger/api/bootstrap.py | DavidMinarsch/ledger-api-py | 83bcae0bbe140b05e9413f4a5240b4a9b1cd6dc3 | [
"Apache-2.0"
] | null | null | null | fetchai/ledger/api/bootstrap.py | DavidMinarsch/ledger-api-py | 83bcae0bbe140b05e9413f4a5240b4a9b1cd6dc3 | [
"Apache-2.0"
] | null | null | null | # ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# 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
#
# htt... | 37.256198 | 104 | 0.660603 |
import requests
import semver
from fetchai.ledger import __version__, IncompatibleLedgerVersion
class NetworkUnavailableError(Exception):
pass
def list_servers(active=True):
params = {'active': 1} if active else {}
servers_response = requests.get('https://bootstrap.fetch.ai/networks/', params=params)
... | true | true |
08f09d96657640afa5a430ddcc7222551176d0fc | 10,356 | py | Python | Experiment_1/helloworld.py | pick56/DL-Experiments | 3375b0c1121d5e14255f08a5160aa0c1554bea44 | [
"Apache-2.0"
] | null | null | null | Experiment_1/helloworld.py | pick56/DL-Experiments | 3375b0c1121d5e14255f08a5160aa0c1554bea44 | [
"Apache-2.0"
] | null | null | null | Experiment_1/helloworld.py | pick56/DL-Experiments | 3375b0c1121d5e14255f08a5160aa0c1554bea44 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import gzip
import os
import sys
import time
import numpy
from six.moves import urllib
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflo... | 40.932806 | 140 | 0.674199 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import gzip
import os
import sys
import time
import numpy
from six.moves import urllib
from six.moves import xrange import tensorflow as tf
SOURCE_URL = 'http://yann.lecun.com/exdb/mnist/'
WO... | true | true |
08f09e4d2c287cedcb8d9fb75e1c6915c598a148 | 3,766 | py | Python | qiskit/algorithms/optimizers/__init__.py | prathameshbhole/qiskit-terra | c0e2bc53636459c8b4205a66b50883f83c219ac4 | [
"Apache-2.0"
] | 1 | 2021-09-08T05:49:26.000Z | 2021-09-08T05:49:26.000Z | qiskit/algorithms/optimizers/__init__.py | prathameshbhole/qiskit-terra | c0e2bc53636459c8b4205a66b50883f83c219ac4 | [
"Apache-2.0"
] | null | null | null | qiskit/algorithms/optimizers/__init__.py | prathameshbhole/qiskit-terra | c0e2bc53636459c8b4205a66b50883f83c219ac4 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 23.835443 | 97 | 0.709241 |
from .adam_amsgrad import ADAM
from .aqgd import AQGD
from .bobyqa import BOBYQA
from .cg import CG
from .cobyla import COBYLA
from .gsls import GSLS
from .gradient_descent import GradientDescent
from .imfil import IMFIL
from .l_bfgs_b import L_BFGS_B
from .nelder_mead import NELDER_MEAD
from .nft import NFT
from .nl... | true | true |
08f09e68e42e6a4e0255bc3709457fafa7f40793 | 4,426 | py | Python | src/motiondsl/motiondsl.py | mfrigerio17/kgprim | 398f63be86e8ca465e2b58481ea0446f55a1cf62 | [
"BSD-3-Clause"
] | null | null | null | src/motiondsl/motiondsl.py | mfrigerio17/kgprim | 398f63be86e8ca465e2b58481ea0446f55a1cf62 | [
"BSD-3-Clause"
] | null | null | null | src/motiondsl/motiondsl.py | mfrigerio17/kgprim | 398f63be86e8ca465e2b58481ea0446f55a1cf62 | [
"BSD-3-Clause"
] | null | null | null | '''
The actual implementation of the MotionDSL, using textX.
The module-level member `dsl` is the default instance of the `MotionDSL` class.
Normally, you will only need this preallocated instance to load a document in
the MotionDSL format.
For example:
import os, sys
import motiondsl.motiondsl as motdsl
... | 33.029851 | 120 | 0.647311 |
import sympy as sp
import os
import textx
import kgprim.core as primitives
from kgprim.values import Variable
from kgprim.values import Parameter
from kgprim.values import Constant
from kgprim.values import MyPI
from kgprim.values import Expression
from kgprim.motions import Axis
from kgprim.motions import MotionStep
... | true | true |
08f09f8097c3f235966a23759403f21e29c21db1 | 3,650 | py | Python | openpype/hosts/nuke/plugins/publish/validate_write_legacy.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/hosts/nuke/plugins/publish/validate_write_legacy.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/hosts/nuke/plugins/publish/validate_write_legacy.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | import os
import toml
import nuke
from avalon import api
import pyblish.api
import openpype.api
from openpype.hosts.nuke.api.lib import get_avalon_knob_data
class ValidateWriteLegacy(pyblish.api.InstancePlugin):
"""Validate legacy write nodes."""
order = pyblish.api.ValidatorOrder
optional = True
f... | 33.486239 | 75 | 0.587671 | import os
import toml
import nuke
from avalon import api
import pyblish.api
import openpype.api
from openpype.hosts.nuke.api.lib import get_avalon_knob_data
class ValidateWriteLegacy(pyblish.api.InstancePlugin):
order = pyblish.api.ValidatorOrder
optional = True
families = ["write"]
label = "Valida... | true | true |
08f09fa6bc925f2af14507edf7273856f5836700 | 251 | py | Python | audit_inspection/audit_inspection/doctype/check_list/check_list.py | sharpec/checklist-erpnext | fcdab8b32519007b101f0f4e48002904667efa9d | [
"MIT"
] | null | null | null | audit_inspection/audit_inspection/doctype/check_list/check_list.py | sharpec/checklist-erpnext | fcdab8b32519007b101f0f4e48002904667efa9d | [
"MIT"
] | null | null | null | audit_inspection/audit_inspection/doctype/check_list/check_list.py | sharpec/checklist-erpnext | fcdab8b32519007b101f0f4e48002904667efa9d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Texol and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CheckList(Document):
pass
| 22.818182 | 49 | 0.776892 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CheckList(Document):
pass
| true | true |
08f09febd0efe37fd424ec25428fd4e93b3b3fd4 | 5,489 | py | Python | 0000_ripps/utils.py | chenhaox/wrs | c16ce81d07da962119bd7edac6165b6df0d5b53a | [
"MIT"
] | null | null | null | 0000_ripps/utils.py | chenhaox/wrs | c16ce81d07da962119bd7edac6165b6df0d5b53a | [
"MIT"
] | null | null | null | 0000_ripps/utils.py | chenhaox/wrs | c16ce81d07da962119bd7edac6165b6df0d5b53a | [
"MIT"
] | null | null | null | import os
import nptyping
import numpy as np
import basis.robot_math as rm
import modeling.collision_model as cm
class Base(cm.CollisionModel):
def __init__(self, file):
super().__init__(initor=file, expand_radius=.009)
self._hole_pos_list = []
self._pos_z0 = .037
self._pos_x0 = .... | 33.469512 | 111 | 0.560394 | import os
import nptyping
import numpy as np
import basis.robot_math as rm
import modeling.collision_model as cm
class Base(cm.CollisionModel):
def __init__(self, file):
super().__init__(initor=file, expand_radius=.009)
self._hole_pos_list = []
self._pos_z0 = .037
self._pos_x0 = .... | true | true |
08f0a11bd3f6056842e54f1d2b293065ab45ec4a | 4,607 | py | Python | vessel_scoring/logistic_model.py | GlobalFishingWatch/vessel-scoring | 6bdd224f5090a0dfa55f285a3958131d5fc78d34 | [
"Apache-2.0"
] | 14 | 2017-01-18T08:08:37.000Z | 2021-12-22T03:48:15.000Z | vessel_scoring/logistic_model.py | GlobalFishingWatch/vessel-scoring | 6bdd224f5090a0dfa55f285a3958131d5fc78d34 | [
"Apache-2.0"
] | 55 | 2016-05-03T13:54:32.000Z | 2020-10-20T01:24:00.000Z | vessel_scoring/logistic_model.py | GlobalFishingWatch/vessel-scoring | 6bdd224f5090a0dfa55f285a3958131d5fc78d34 | [
"Apache-2.0"
] | 9 | 2016-05-23T22:42:39.000Z | 2021-03-30T07:18:21.000Z | import numpy as np
from sklearn.linear_model import LogisticRegression
from vessel_scoring.utils import get_polynomial_cols, zigmoid
import vessel_scoring.base_model
import vessel_scoring.colspec
def make_features(base_cols, order, cross):
n_base_cols = len(base_cols)
cols = []
for total_order in range(1, ... | 35.438462 | 78 | 0.610593 | import numpy as np
from sklearn.linear_model import LogisticRegression
from vessel_scoring.utils import get_polynomial_cols, zigmoid
import vessel_scoring.base_model
import vessel_scoring.colspec
def make_features(base_cols, order, cross):
n_base_cols = len(base_cols)
cols = []
for total_order in range(1, ... | true | true |
08f0a1410367ce18b27ea787ad165d176c6ed140 | 719 | py | Python | add-two-numbers/solution.py | kevin-de-granta/LeetCodeKevin | a93e93674a0148672b35e33f19df843bb51c6caa | [
"Apache-2.0"
] | 1 | 2017-07-24T03:26:11.000Z | 2017-07-24T03:26:11.000Z | add-two-numbers/solution.py | kevin-de-granta/LeetCodeKevin | a93e93674a0148672b35e33f19df843bb51c6caa | [
"Apache-2.0"
] | null | null | null | add-two-numbers/solution.py | kevin-de-granta/LeetCodeKevin | a93e93674a0148672b35e33f19df843bb51c6caa | [
"Apache-2.0"
] | null | null | null | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
from link import ListNode
class Solution(object):
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNod... | 25.678571 | 54 | 0.479833 |
from link import ListNode
class Solution(object):
def addTwoNumbers(self, l1, l2):
[n1, n2] = [l1, l2]
[sumVal, carry] = [0, 0]
[res, tail] = [None, None]
while True:
[sumVal, carry] = [n1.x + n2.x + carry, 0]
if sumval >= 10:
[sumVal, carry]... | true | true |
08f0a2aa8240d8c4707fdee3464be67651ab8265 | 470 | py | Python | nlplingo/tasks/common/binary/base.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | 3 | 2020-10-22T13:28:00.000Z | 2022-03-24T19:57:22.000Z | nlplingo/tasks/common/binary/base.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | null | null | null | nlplingo/tasks/common/binary/base.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | 1 | 2020-10-22T13:29:51.000Z | 2020-10-22T13:29:51.000Z | from nlplingo.tasks.common.datapoint import Datapoint
class BinaryDatapoint(Datapoint):
def __init__(self, arg0, arg1, event_domain, label_str):
"""
:type arg0: UnaryDatapoint
:type arg1: UnaryDatapoint
"""
super(BinaryDatapoint, self).__init__()
self.arg0 = arg0
... | 27.647059 | 60 | 0.625532 | from nlplingo.tasks.common.datapoint import Datapoint
class BinaryDatapoint(Datapoint):
def __init__(self, arg0, arg1, event_domain, label_str):
super(BinaryDatapoint, self).__init__()
self.arg0 = arg0
self.arg1 = arg1
self.event_domain = event_domain
self.label_str = label... | true | true |
08f0a2b2d640e29e9ec454b15475f4b0b13134d7 | 1,450 | py | Python | var/spack/repos/builtin/packages/py-numexpr/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-numexpr/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-numexpr/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyNumexpr(PythonPackage):
"""Fast numerical expression evaluator for NumPy"""
... | 51.785714 | 95 | 0.757931 |
from spack.package import *
class PyNumexpr(PythonPackage):
homepage = "https://github.com/pydata/numexpr"
url = "https://github.com/pydata/numexpr/archive/v2.7.0.tar.gz"
version('2.7.3', sha256='00d6b1518605afe0ed10417e0ff07123e5d531c02496c6eed7dd4b9923238e1e')
version('2.7.2', sha256='7d1b37... | true | true |
08f0a4b26caea418b2bce448849b40f034790ec4 | 3,215 | py | Python | spellbook/MagicWordConfig.py | Benjamin8693/Toontown-Magic-Word-Manager | 430e544ddbca06045105aa87f816edd90195a635 | [
"MIT"
] | 2 | 2020-06-17T00:15:59.000Z | 2020-06-17T03:36:21.000Z | spellbook/MagicWordConfig.py | Benjamin8693/Toontown-Magic-Word-Manager | 430e544ddbca06045105aa87f816edd90195a635 | [
"MIT"
] | 1 | 2021-02-05T22:37:42.000Z | 2021-04-16T16:34:09.000Z | spellbook/MagicWordConfig.py | Benjamin8693/Toontown-Magic-Word-Manager | 430e544ddbca06045105aa87f816edd90195a635 | [
"MIT"
] | 1 | 2021-02-07T01:01:06.000Z | 2021-02-07T01:01:06.000Z | ##################################################
# The Toontown Offline Magic Word Manager
##################################################
# Author: Benjamin Frisby
# Copyright: Copyright 2020, Toontown Offline
# Credits: Benjamin Frisby, John Cote, Ruby Lord, Frank, Nick, Little Cat, Ooowoo
# License: MIT
# Versi... | 36.954023 | 133 | 0.654743 |
OUTGOING_CHAT_MESSAGE_NAME = 'magicWord'
CLICKED_NAMETAG_MESSAGE_NAME = 'clickedNametag'
FOCUS_OUT_MESSAGE_NAME = 'focusOut'
PREFIX_DEFAULT = '~'
PREFIX_ALLOWED = ['~', '?', '/', '<', ':', ';']
if config.GetBool('exec-chat', False):
PREFIX_ALLOWED.append('>')
WIZARD_DEFAULT = 'Magic Minnie'
MAGIC_WORD_SUCCESS_P... | true | true |
08f0a5fd1049d38851a819c0b564aaa8bfeac9bd | 5,610 | py | Python | plugins/spotlightshortcuts.py | renesugar/mac_apt | 1152805f3a0ed7cc2536896e16cc4a1612dd90b8 | [
"MIT"
] | null | null | null | plugins/spotlightshortcuts.py | renesugar/mac_apt | 1152805f3a0ed7cc2536896e16cc4a1612dd90b8 | [
"MIT"
] | null | null | null | plugins/spotlightshortcuts.py | renesugar/mac_apt | 1152805f3a0ed7cc2536896e16cc4a1612dd90b8 | [
"MIT"
] | null | null | null | '''
Copyright (c) 2017 Yogesh Khatri
This file is part of mac_apt (macOS Artifact Parsing Tool).
Usage or distribution of this software/code is subject to the
terms of the MIT License.
'''
import os
import biplist
import sys
import logging
import struct
from biplist import *
from plugins.helpers.ma... | 45.609756 | 281 | 0.670053 |
import os
import biplist
import sys
import logging
import struct
from biplist import *
from plugins.helpers.macinfo import *
from plugins.helpers.writer import *
__Plugin_Name = "SPOTLIGHTSHORTCUTS"
__Plugin_Friendly_Name = "Spotlight shortcuts"
__Plugin_Version = "1.0"
__Plugin_Description = "Gets user typed data i... | true | true |
08f0a891fc17b97fffc821adf8a50da95e975fc1 | 7,943 | py | Python | fury/tests/test_utils.py | kakashihatakae/fury | a187110c7b738cd1f2bc18066fbc30d23d1403de | [
"BSD-3-Clause"
] | null | null | null | fury/tests/test_utils.py | kakashihatakae/fury | a187110c7b738cd1f2bc18066fbc30d23d1403de | [
"BSD-3-Clause"
] | null | null | null | fury/tests/test_utils.py | kakashihatakae/fury | a187110c7b738cd1f2bc18066fbc30d23d1403de | [
"BSD-3-Clause"
] | null | null | null | import sys
import numpy as np
import numpy.testing as npt
from fury.utils import (map_coordinates_3d_4d,
vtk_matrix_to_numpy,
numpy_to_vtk_matrix,
get_grid_cells_position,
rotate, vtk)
from fury import actor, window, utils
... | 31.027344 | 77 | 0.556339 | import sys
import numpy as np
import numpy.testing as npt
from fury.utils import (map_coordinates_3d_4d,
vtk_matrix_to_numpy,
numpy_to_vtk_matrix,
get_grid_cells_position,
rotate, vtk)
from fury import actor, window, utils
... | true | true |
08f0a894364283b4fae5bc8f680868041620df97 | 3,210 | py | Python | pythonException(Hindi)/ng_exceptions/translate.py | RahulRj09/python | b0cd1c39a252386526433f8b6f825e3f33786c52 | [
"MIT"
] | null | null | null | pythonException(Hindi)/ng_exceptions/translate.py | RahulRj09/python | b0cd1c39a252386526433f8b6f825e3f33786c52 | [
"MIT"
] | null | null | null | pythonException(Hindi)/ng_exceptions/translate.py | RahulRj09/python | b0cd1c39a252386526433f8b6f825e3f33786c52 | [
"MIT"
] | null | null | null |
import json
import colorama
from colorama import Fore, Back, Style
colorama.init()
import json
f = open("/ng_exceptions/ng_exceptions/errors.json","r")
s = f.read()
errors = json.loads(s)
def trans_function(word):
i = 0
while True:
if str(errors["values"][i]["from"]) in word:
error = str(errors["values"][i]... | 16.984127 | 114 | 0.616822 |
import json
import colorama
from colorama import Fore, Back, Style
colorama.init()
import json
f = open("/ng_exceptions/ng_exceptions/errors.json","r")
s = f.read()
errors = json.loads(s)
def trans_function(word):
i = 0
while True:
if str(errors["values"][i]["from"]) in word:
error = str(errors["values"][i]... | true | true |
08f0a8a4a006f329466567924dc470b5e504ef1e | 2,939 | py | Python | tests_functional/test_golang_rebase.py | locriandev/doozer | 375eafccc15aadfd18dc50061eccb9a917d31b0b | [
"Apache-2.0"
] | 16 | 2018-11-06T16:49:03.000Z | 2021-11-07T19:48:49.000Z | tests_functional/test_golang_rebase.py | locriandev/doozer | 375eafccc15aadfd18dc50061eccb9a917d31b0b | [
"Apache-2.0"
] | 479 | 2018-11-15T15:37:49.000Z | 2022-03-31T08:39:44.000Z | tests_functional/test_golang_rebase.py | locriandev/doozer | 375eafccc15aadfd18dc50061eccb9a917d31b0b | [
"Apache-2.0"
] | 38 | 2018-11-07T14:33:15.000Z | 2021-12-13T13:59:12.000Z | #!/usr/bin/env python3
import unittest
from dockerfile_parse import DockerfileParser
from tests_functional import DoozerRunnerTestCase
class TestGoLangRebase(DoozerRunnerTestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def setUp(self):
super().setUp()
... | 44.530303 | 270 | 0.703641 |
import unittest
from dockerfile_parse import DockerfileParser
from tests_functional import DoozerRunnerTestCase
class TestGoLangRebase(DoozerRunnerTestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def setUp(self):
super().setUp()
def tearDown(self):
... | true | true |
08f0a98513d5e27612808d9ee200140650c7f0a6 | 1,885 | py | Python | src/the_tale/the_tale/game/cards/tests/test_sharp_artifact.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/game/cards/tests/test_sharp_artifact.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/game/cards/tests/test_sharp_artifact.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import smart_imports
smart_imports.all()
class SharpRandomArtifactTests(helpers.CardsTestMixin, utils_testcase.TestCase):
CARD = types.CARD.SHARP_RANDOM_ARTIFACT
def setUp(self):
super(SharpRandomArtifactTests, self).setUp()
game_logic.create_test_map()
self.account_1 = self.accou... | 38.469388 | 174 | 0.739523 |
import smart_imports
smart_imports.all()
class SharpRandomArtifactTests(helpers.CardsTestMixin, utils_testcase.TestCase):
CARD = types.CARD.SHARP_RANDOM_ARTIFACT
def setUp(self):
super(SharpRandomArtifactTests, self).setUp()
game_logic.create_test_map()
self.account_1 = self.accou... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.