hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fbbe4d7825e1ffaab8a2bb0ef632c92d7b5af3 | 58,990 | py | Python | neural-navigation-with-lstm/MARCO/nltk/parser/chunk.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | 14 | 2016-04-03T19:25:13.000Z | 2022-01-05T07:03:07.000Z | neural-navigation-with-lstm/MARCO/nltk/parser/chunk.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | null | null | null | neural-navigation-with-lstm/MARCO/nltk/parser/chunk.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | 5 | 2018-06-21T12:58:58.000Z | 2020-02-15T05:33:39.000Z | # Natural Language Toolkit: A Chunk Parser
#
# Copyright (C) 2001 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: chunk.py,v 1.1.1.2 2004/09/29 21:58:22 adastra Exp $
"""
Classes and interfaces for identifying non-overl... | 40.965278 | 83 | 0.616969 |
"""
Classes and interfaces for identifying non-overlapping linguistic
groups (such as base noun phrases) in unrestricted text. This task is
called X{chunk parsing} or X{chunking}, and the identified groups are
called X{chunks}. The chunked text is represented using a shallow
tree called a "chunk structure." ... | false | true |
f7fbbf62f2943cc79ec76501fd55c8862927df08 | 511 | py | Python | Python/Collections.OrderedDict.py | WinrichSy/HackerRank-Solutions | ed928de50cbbbdf0aee471630f6c04f9a0f69a1f | [
"Apache-2.0"
] | null | null | null | Python/Collections.OrderedDict.py | WinrichSy/HackerRank-Solutions | ed928de50cbbbdf0aee471630f6c04f9a0f69a1f | [
"Apache-2.0"
] | null | null | null | Python/Collections.OrderedDict.py | WinrichSy/HackerRank-Solutions | ed928de50cbbbdf0aee471630f6c04f9a0f69a1f | [
"Apache-2.0"
] | null | null | null | #Collections.OrderedDict()
#https://www.hackerrank.com/challenges/py-collections-ordereddict/problem
from collections import OrderedDict
items = int(input())
ordered_dict = OrderedDict()
for i in range(items):
item_price = input().split()
item = ' '.join(item_price[0:-1])
price = int(item_price[-1])
i... | 26.894737 | 73 | 0.675147 |
from collections import OrderedDict
items = int(input())
ordered_dict = OrderedDict()
for i in range(items):
item_price = input().split()
item = ' '.join(item_price[0:-1])
price = int(item_price[-1])
if item not in ordered_dict.keys():
ordered_dict[item] = price
else:
ordered_dic... | true | true |
f7fbbfc00c62087ff680b4e49b6e3bdf810186d5 | 6,625 | py | Python | ck/repo/module/user/module.py | santosh653/ck | f09b836df48598aff4db241b52c37899a73eb569 | [
"BSD-3-Clause"
] | 37 | 2015-02-04T16:03:33.000Z | 2021-01-03T13:24:29.000Z | ck/repo/module/user/module.py | santosh653/ck | f09b836df48598aff4db241b52c37899a73eb569 | [
"BSD-3-Clause"
] | 3 | 2018-10-25T13:03:05.000Z | 2018-11-13T05:14:57.000Z | ck/repo/module/user/module.py | santosh653/ck | f09b836df48598aff4db241b52c37899a73eb569 | [
"BSD-3-Clause"
] | 4 | 2017-11-21T01:39:41.000Z | 2020-08-09T19:22:43.000Z | #
# Collective Knowledge (web-based user auth)
#
#
#
#
# Developer:
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck=None # Will be updated by CK (initialized CK kernel)
# Local settings
########################################################... | 25 | 82 | 0.497358 |
cfg={}
work={}
ck=None
| true | true |
f7fbc09d21dc9d20beb5a5fc6a3538c481e012c2 | 1,580 | py | Python | frappe/setup_logging.py | pawaranand/phr_frappe | d997ae7d6fbade4b2c4a2491603d988876dfd67e | [
"MIT"
] | 1 | 2022-03-05T16:02:39.000Z | 2022-03-05T16:02:39.000Z | frappe/setup_logging.py | pawaranand/phr_frappe | d997ae7d6fbade4b2c4a2491603d988876dfd67e | [
"MIT"
] | 1 | 2015-07-11T20:52:38.000Z | 2019-12-06T15:00:58.000Z | frappe/setup_logging.py | pawaranand/phr_frappe | d997ae7d6fbade4b2c4a2491603d988876dfd67e | [
"MIT"
] | 2 | 2015-09-05T05:30:23.000Z | 2018-03-21T19:45:10.000Z | import frappe
import logging
import logging.config
import os
import json
from pprint import pformat
class ContextFilter(logging.Filter):
"""
This is a filter which injects request information (if available) into the log.
"""
def filter(self, record):
record.form_dict = pformat(getattr(frappe.local, 'form_dict',... | 24.307692 | 108 | 0.633544 | import frappe
import logging
import logging.config
import os
import json
from pprint import pformat
class ContextFilter(logging.Filter):
def filter(self, record):
record.form_dict = pformat(getattr(frappe.local, 'form_dict', None))
record.site = getattr(frappe.local, 'site', None)
record.tb = frappe.utils.get_... | true | true |
f7fbc0c8571bb84f8156dfaed15a35423276590d | 5,459 | py | Python | mitmproxy/addons/cut.py | dotnes/mitmproxy | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f | [
"MIT"
] | 1 | 2017-12-27T09:05:23.000Z | 2017-12-27T09:05:23.000Z | mitmproxy/addons/cut.py | dotnes/mitmproxy | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f | [
"MIT"
] | null | null | null | mitmproxy/addons/cut.py | dotnes/mitmproxy | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f | [
"MIT"
] | null | null | null | import io
import csv
import typing
from mitmproxy import command
from mitmproxy import exceptions
from mitmproxy import flow
from mitmproxy import ctx
from mitmproxy import certs
from mitmproxy.utils import strutils
import mitmproxy.types
import pyperclip
def headername(spec: str):
if not (spec.startswith("heade... | 37.390411 | 94 | 0.535446 | import io
import csv
import typing
from mitmproxy import command
from mitmproxy import exceptions
from mitmproxy import flow
from mitmproxy import ctx
from mitmproxy import certs
from mitmproxy.utils import strutils
import mitmproxy.types
import pyperclip
def headername(spec: str):
if not (spec.startswith("heade... | true | true |
f7fbc1b08bdb0f523b71727d92cf25327e2fc11a | 936 | py | Python | kubernetes_asyncio/test/test_v1_scale_spec.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_scale_spec.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_scale_spec.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 23.4 | 124 | 0.71688 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.models.v1_scale_spec import V1ScaleSpec
from kubernetes_asyncio.client.rest import ApiException
class TestV1ScaleSpec(unittest.TestCase):
def setUp(self):
pass
def tearDown(... | true | true |
f7fbc2dd55385ce727b6db9a0cf7aa762a44f47c | 3,579 | py | Python | var/spack/repos/builtin/packages/roctracer-dev/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/roctracer-dev/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/roctracer-dev/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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 import *
class RoctracerDev(CMakePackage):
"""ROC-tracer library: Runtimes Generic Callback/Activity API... | 48.364865 | 123 | 0.655211 |
from spack import *
class RoctracerDev(CMakePackage):
homepage = "https://github.com/ROCm-Developer-Tools/roctracer"
git = "https://github.com/ROCm-Developer-Tools/roctracer.git"
url = "https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.3.0.tar.gz"
maintainers = ['sreko... | true | true |
f7fbc5228971a5c65f10bb5e37b1f626858d1332 | 3,871 | py | Python | analysis/video.py | MorrisHuang-skipper/Serial-MD | 48356dc88cdc47a832fa02bc61a03d8583bb4a79 | [
"MIT"
] | null | null | null | analysis/video.py | MorrisHuang-skipper/Serial-MD | 48356dc88cdc47a832fa02bc61a03d8583bb4a79 | [
"MIT"
] | null | null | null | analysis/video.py | MorrisHuang-skipper/Serial-MD | 48356dc88cdc47a832fa02bc61a03d8583bb4a79 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from pylab import cm
import math
from mpl_toolkits.mplot3d import Axes3D
import os
import sys
import matplotlib.gridspec as gridspec
mpl.rcParams['font.family'] = 'STIXGeneral'
plt.rcParams['xtick.labelsize'] = 16
plt.rcParams['ytick.labelsize... | 32.258333 | 106 | 0.58667 | import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from pylab import cm
import math
from mpl_toolkits.mplot3d import Axes3D
import os
import sys
import matplotlib.gridspec as gridspec
mpl.rcParams['font.family'] = 'STIXGeneral'
plt.rcParams['xtick.labelsize'] = 16
plt.rcParams['ytick.labelsize... | true | true |
f7fbc648a9b7bedcd218e285211ce2787a1458ef | 1,210 | py | Python | docker/server_setup.py | maxpark/dive | 5dce25822d9b53d96ff0c2c8fb02265e4b43911e | [
"Apache-2.0"
] | 28 | 2021-02-15T13:46:58.000Z | 2022-03-27T14:20:37.000Z | docker/server_setup.py | maxpark/dive | 5dce25822d9b53d96ff0c2c8fb02265e4b43911e | [
"Apache-2.0"
] | 506 | 2021-02-12T22:33:10.000Z | 2022-03-30T17:46:36.000Z | docker/server_setup.py | maxpark/dive | 5dce25822d9b53d96ff0c2c8fb02265e4b43911e | [
"Apache-2.0"
] | 14 | 2021-02-21T10:18:48.000Z | 2022-02-23T15:32:40.000Z | import os
import cherrypy
from girder.exceptions import ValidationException
from girder.models.assetstore import Assetstore
from girder.models.setting import Setting
from girder.models.user import User
cherrypy.config["database"]["uri"] = os.getenv("GIRDER_MONGO_URI")
ADMIN_USER = os.getenv("GIRDER_ADMIN_USER", "adm... | 24.2 | 82 | 0.649587 | import os
import cherrypy
from girder.exceptions import ValidationException
from girder.models.assetstore import Assetstore
from girder.models.setting import Setting
from girder.models.user import User
cherrypy.config["database"]["uri"] = os.getenv("GIRDER_MONGO_URI")
ADMIN_USER = os.getenv("GIRDER_ADMIN_USER", "adm... | true | true |
f7fbc72dfaa2722fa757ff4575e23e08699ce449 | 9,147 | py | Python | fas2ipa/groups.py | markobrien1/fas2ipa | df8696b4a25f29f4de0f093c12806c5b1b45db16 | [
"MIT"
] | 1 | 2020-09-22T17:13:39.000Z | 2020-09-22T17:13:39.000Z | fas2ipa/groups.py | markobrien1/fas2ipa | df8696b4a25f29f4de0f093c12806c5b1b45db16 | [
"MIT"
] | 18 | 2020-02-25T11:38:47.000Z | 2021-03-19T18:12:44.000Z | fas2ipa/groups.py | markobrien1/fas2ipa | df8696b4a25f29f4de0f093c12806c5b1b45db16 | [
"MIT"
] | 7 | 2020-02-24T15:11:52.000Z | 2021-03-30T14:34:00.000Z | import click
import progressbar
import python_freeipa
from collections import defaultdict
from typing import Any, Dict, List
from .status import Status, print_status
from .utils import ObjectManager
class Groups(ObjectManager):
def __init__(self, *args, agreements, **kwargs):
super().__init__(*args, **kw... | 39.769565 | 99 | 0.539521 | import click
import progressbar
import python_freeipa
from collections import defaultdict
from typing import Any, Dict, List
from .status import Status, print_status
from .utils import ObjectManager
class Groups(ObjectManager):
def __init__(self, *args, agreements, **kwargs):
super().__init__(*args, **kw... | true | true |
f7fbc7a9eba15a1c42b2f4cbc34f30de2a9613c5 | 53 | py | Python | cacreader/swig-4.0.2/Examples/test-suite/python/global_ns_arg_runme.py | kyletanyag/LL-Smartcard | 02abea9de5a13f8bae4d7832ab34cb7f0d9514c9 | [
"BSD-3-Clause"
] | 1,031 | 2015-01-02T14:08:47.000Z | 2022-03-29T02:25:27.000Z | cacreader/swig-4.0.2/Examples/test-suite/python/global_ns_arg_runme.py | kyletanyag/LL-Smartcard | 02abea9de5a13f8bae4d7832ab34cb7f0d9514c9 | [
"BSD-3-Clause"
] | 240 | 2015-01-11T04:27:19.000Z | 2022-03-30T00:35:57.000Z | cacreader/swig-4.0.2/Examples/test-suite/python/global_ns_arg_runme.py | kyletanyag/LL-Smartcard | 02abea9de5a13f8bae4d7832ab34cb7f0d9514c9 | [
"BSD-3-Clause"
] | 224 | 2015-01-05T06:13:54.000Z | 2022-02-25T14:39:51.000Z | from global_ns_arg import *
a = foo(1)
b = bar_fn()
| 10.6 | 27 | 0.660377 | from global_ns_arg import *
a = foo(1)
b = bar_fn()
| true | true |
f7fbc8b13652297abf6e73d85bc19be2333ab0b8 | 4,238 | py | Python | src/common/utils.py | DmitryBurnaev/podcast | 48c7c60e2a46378f36635dc58222e5e7682f977f | [
"MIT"
] | 1 | 2020-09-05T10:37:55.000Z | 2020-09-05T10:37:55.000Z | src/common/utils.py | DmitryBurnaev/podcast | 48c7c60e2a46378f36635dc58222e5e7682f977f | [
"MIT"
] | null | null | null | src/common/utils.py | DmitryBurnaev/podcast | 48c7c60e2a46378f36635dc58222e5e7682f977f | [
"MIT"
] | null | null | null | import logging
import logging.config
import aiohttp
from aiohttp import web
import settings
from common.excpetions import SendRequestError
def get_logger(name: str = None):
""" Getting configured logger """
logging.config.dictConfig(settings.LOGGING)
return logging.getLogger(name or "app")
def redirec... | 35.024793 | 100 | 0.651958 | import logging
import logging.config
import aiohttp
from aiohttp import web
import settings
from common.excpetions import SendRequestError
def get_logger(name: str = None):
logging.config.dictConfig(settings.LOGGING)
return logging.getLogger(name or "app")
def redirect(
request, router_name: str, *, p... | true | true |
f7fbc8f88b244ccead27235fc29111b1a56ae99a | 4,164 | py | Python | src/afancontrol/fans.py | X0rg/afancontrol | 91fd8b3bf1fa759651b991ffc5e0ae551e6e4907 | [
"MIT"
] | 1 | 2021-07-28T21:16:43.000Z | 2021-07-28T21:16:43.000Z | src/afancontrol/fans.py | X0rg/afancontrol | 91fd8b3bf1fa759651b991ffc5e0ae551e6e4907 | [
"MIT"
] | null | null | null | src/afancontrol/fans.py | X0rg/afancontrol | 91fd8b3bf1fa759651b991ffc5e0ae551e6e4907 | [
"MIT"
] | null | null | null | from contextlib import ExitStack
from typing import Mapping, MutableSet, Optional
from afancontrol.config import FanName
from afancontrol.logger import logger
from afancontrol.pwmfan import PWMFanNorm, PWMValueNorm
from afancontrol.report import Report
class Fans:
def __init__(self, fans: Mapping[FanName, PWMFan... | 34.991597 | 88 | 0.571085 | from contextlib import ExitStack
from typing import Mapping, MutableSet, Optional
from afancontrol.config import FanName
from afancontrol.logger import logger
from afancontrol.pwmfan import PWMFanNorm, PWMValueNorm
from afancontrol.report import Report
class Fans:
def __init__(self, fans: Mapping[FanName, PWMFan... | true | true |
f7fbc9150969f438fbd8f4e7994322f560e87fe5 | 9,894 | py | Python | tests/fixtures/test_signup.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 6 | 2017-06-09T03:38:53.000Z | 2021-12-22T02:42:15.000Z | tests/fixtures/test_signup.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 47 | 2016-08-02T05:21:31.000Z | 2022-03-28T01:14:17.000Z | tests/fixtures/test_signup.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 7 | 2016-09-13T13:07:18.000Z | 2021-02-17T10:16:21.000Z | import json
import pytest
import mock
import copy
from app.models import db, Agency, AgencyDomain
from app.api.services import user_claims_service
from nose.tools import assert_equal
test_seller = {
'name': 'matt',
'email_address': 'email+s@company.com',
'user_type': 'seller',
'abn': '123456'
}
gov_a... | 31.509554 | 118 | 0.624419 | import json
import pytest
import mock
import copy
from app.models import db, Agency, AgencyDomain
from app.api.services import user_claims_service
from nose.tools import assert_equal
test_seller = {
'name': 'matt',
'email_address': 'email+s@company.com',
'user_type': 'seller',
'abn': '123456'
}
gov_a... | true | true |
f7fbc96245e2f0ea302afae850c53c5b30f0d66a | 166 | py | Python | src/ralph/lib/transitions/apps.py | andrzej-jankowski/ralph | 68ec18a66b8fe47ddf1c082c3ce2d82b2cd430dc | [
"Apache-2.0"
] | null | null | null | src/ralph/lib/transitions/apps.py | andrzej-jankowski/ralph | 68ec18a66b8fe47ddf1c082c3ce2d82b2cd430dc | [
"Apache-2.0"
] | null | null | null | src/ralph/lib/transitions/apps.py | andrzej-jankowski/ralph | 68ec18a66b8fe47ddf1c082c3ce2d82b2cd430dc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class TransitionAppConfig(AppConfig):
name = 'ralph.lib.transitions'
verbose_name = 'Transitions'
| 20.75 | 37 | 0.710843 |
from django.apps import AppConfig
class TransitionAppConfig(AppConfig):
name = 'ralph.lib.transitions'
verbose_name = 'Transitions'
| true | true |
f7fbca6c2148ac0fc50fbec1cae5c9a0710cdce0 | 493 | py | Python | hazelcast/protocol/codec/map_clear_codec.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 98 | 2015-12-08T14:26:27.000Z | 2022-03-23T17:44:11.000Z | hazelcast/protocol/codec/map_clear_codec.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 396 | 2016-02-23T11:07:55.000Z | 2022-03-31T14:26:34.000Z | hazelcast/protocol/codec/map_clear_codec.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 62 | 2015-12-09T11:20:53.000Z | 2022-01-28T01:30:54.000Z | from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
# hex: 0x012D00
_REQUEST_MESSAGE_TYPE = 77056
# hex: 0x012D01
_RESPONSE_MESSAGE_TYPE = 77057
_REQUEST_INITIAL_FRAME_SIZE = REQUEST_HEADER_SIZE
def encode_reque... | 30.8125 | 105 | 0.8357 | from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
_REQUEST_MESSAGE_TYPE = 77056
_RESPONSE_MESSAGE_TYPE = 77057
_REQUEST_INITIAL_FRAME_SIZE = REQUEST_HEADER_SIZE
def encode_request(name):
buf = create_ini... | true | true |
f7fbcacf21058ebd2add82f562467cc65c7e70fa | 668 | py | Python | core/models.py | danielqiang/CombineSearch | d24b49c4ef0cc0bf4470383f293a6d625765f3d2 | [
"MIT"
] | null | null | null | core/models.py | danielqiang/CombineSearch | d24b49c4ef0cc0bf4470383f293a6d625765f3d2 | [
"MIT"
] | null | null | null | core/models.py | danielqiang/CombineSearch | d24b49c4ef0cc0bf4470383f293a6d625765f3d2 | [
"MIT"
] | 1 | 2020-03-20T20:41:30.000Z | 2020-03-20T20:41:30.000Z | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=30)
def __str__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length=20)
def __str__(self):
return self.name
class Journal(models.Model):
title = mo... | 23.857143 | 64 | 0.715569 | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=30)
def __str__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length=20)
def __str__(self):
return self.name
class Journal(models.Model):
title = mo... | true | true |
f7fbcaf2144a99a1427daa079bab87f73f035547 | 2,099 | py | Python | 002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/proesch/colorCube/colorCube.py | lhl/vrdev | fc1a9af2b51d159c99c8779349ef3392a70ed9ed | [
"Apache-2.0"
] | 12 | 2015-12-02T02:36:36.000Z | 2020-09-20T17:14:24.000Z | 002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/proesch/colorCube/colorCube.py | lhl/vrdev | fc1a9af2b51d159c99c8779349ef3392a70ed9ed | [
"Apache-2.0"
] | null | null | null | 002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/proesch/colorCube/colorCube.py | lhl/vrdev | fc1a9af2b51d159c99c8779349ef3392a70ed9ed | [
"Apache-2.0"
] | 8 | 2016-11-02T11:17:04.000Z | 2021-10-21T07:42:19.000Z | #!/usr/bin/python
# rotating color cube
# Copyright (C) 2007 "Peter Roesch" <Peter.Roesch@fh-augsburg.de>
#
# This code is licensed under the PyOpenGL License.
# Details are given in the file license.txt included in this distribution.
import sys
try:
from OpenGL.GLUT import *
from OpenGL.GL import *
from OpenG... | 28.364865 | 74 | 0.685565 |
import sys
try:
from OpenGL.GLUT import *
from OpenGL.GL import *
from OpenGL.GLU import *
except:
print ''' Error: PyOpenGL not installed properly '''
sys.exit( )
import array
vertices = array.array('f', [ -1,-1,1, -1,1,1, 1,1,1, 1,-1,1,\
-1,-1,-1, -1,1,-1, 1,1,-1, 1,-1,-1 ] )
colors = array.arr... | false | true |
f7fbccd65eb14ab564d2f902ca145e5f22769a61 | 294 | py | Python | sympy/integrals/tests/test_lineintegrals.py | sn6uv/sympy | 5b149c2f72847e4785c65358b09d99b29f101dd5 | [
"BSD-3-Clause"
] | 2 | 2015-05-11T12:26:38.000Z | 2016-08-19T00:11:03.000Z | sympy/integrals/tests/test_lineintegrals.py | goodok/sympy | de84ed2139125a755ea7b6ba91d945d9fbbe5ed9 | [
"BSD-3-Clause"
] | 1 | 2016-06-13T01:29:51.000Z | 2016-06-14T00:38:27.000Z | sympy/integrals/tests/test_lineintegrals.py | goodok/sympy | de84ed2139125a755ea7b6ba91d945d9fbbe5ed9 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T09:07:27.000Z | 2022-03-21T09:07:27.000Z | from sympy import (symbols, integrate, Integral, diff, sin, cos, pi, E, ln,
sympify, Curve, line_integrate, sqrt)
s, t, x, y, z = symbols('s,t,x,y,z')
def test_lineintegral():
c = Curve([E**t + 1, E**t - 1], (t, 0, ln(2)))
assert line_integrate(x + y, c, [x, y]) == 3*sqrt(2)
| 32.666667 | 75 | 0.57483 | from sympy import (symbols, integrate, Integral, diff, sin, cos, pi, E, ln,
sympify, Curve, line_integrate, sqrt)
s, t, x, y, z = symbols('s,t,x,y,z')
def test_lineintegral():
c = Curve([E**t + 1, E**t - 1], (t, 0, ln(2)))
assert line_integrate(x + y, c, [x, y]) == 3*sqrt(2)
| true | true |
f7fbcd2dab63894d0039ebaed84bcaa13266d9e1 | 7,042 | py | Python | src/transformers/models/deberta_v2/configuration_deberta_v2.py | kct22aws/transformers | 04cddaf402591e9f5bdb5f116a111d829a0ce4f4 | [
"Apache-2.0"
] | 31 | 2022-02-02T13:13:41.000Z | 2022-03-29T08:37:20.000Z | src/transformers/models/deberta_v2/configuration_deberta_v2.py | guang7400613/transformers | 28e091430eea9e0d40839e56fd0d57aec262f5f9 | [
"Apache-2.0"
] | 2 | 2022-03-14T10:13:16.000Z | 2022-03-14T11:50:27.000Z | src/transformers/models/deberta_v2/configuration_deberta_v2.py | guang7400613/transformers | 28e091430eea9e0d40839e56fd0d57aec262f5f9 | [
"Apache-2.0"
] | 2 | 2022-03-21T04:32:39.000Z | 2022-03-22T01:02:49.000Z | # coding=utf-8
# Copyright 2020, Microsoft and the HuggingFace Inc. team.
#
# 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 require... | 51.028986 | 125 | 0.690571 |
from ...configuration_utils import PretrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json",
"microsoft/deberta-v... | true | true |
f7fbcdcafadd48f6c9d1e843eefee400b2e44500 | 411 | py | Python | utility_belt/__init__.py | ajsilveira/utility_belt | b593400bdbe1bcda89117615175045f6eefda74a | [
"MIT"
] | null | null | null | utility_belt/__init__.py | ajsilveira/utility_belt | b593400bdbe1bcda89117615175045f6eefda74a | [
"MIT"
] | null | null | null | utility_belt/__init__.py | ajsilveira/utility_belt | b593400bdbe1bcda89117615175045f6eefda74a | [
"MIT"
] | null | null | null | """
utility_belt
A set of tools for my work
"""
# Make Python 2 and 3 imports work the same
# Safe to remove with Python 3-only code
from __future__ import absolute_import
# Add imports here
from .utility_belt import *
# Handle versioneer
from ._version import get_versions
versions = get_versions()
__version__ = ver... | 21.631579 | 46 | 0.778589 |
from __future__ import absolute_import
from .utility_belt import *
from ._version import get_versions
versions = get_versions()
__version__ = versions['version']
__git_revision__ = versions['full-revisionid']
del get_versions, versions
| true | true |
f7fbce9552f151899983ca30fa2163e5439036cc | 16,110 | py | Python | intel/k8s.py | hanyin-intel/CPU-Manager-for-Kubernetes | c9848d62f0d9c1d7a3de0745ea172df9a4ccaf7b | [
"Apache-2.0"
] | 152 | 2018-05-24T02:19:41.000Z | 2022-03-23T08:39:11.000Z | intel/k8s.py | hanyin-intel/CPU-Manager-for-Kubernetes | c9848d62f0d9c1d7a3de0745ea172df9a4ccaf7b | [
"Apache-2.0"
] | 64 | 2018-05-30T13:09:40.000Z | 2021-12-29T14:00:25.000Z | intel/k8s.py | isabella232/CPU-Manager-for-Kubernetes | b92d994fedc734898f9852bb65fcd4cd2be55384 | [
"Apache-2.0"
] | 78 | 2018-05-22T13:26:54.000Z | 2022-02-20T22:33:07.000Z | # Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 30.56926 | 79 | 0.566046 |
import logging
from intel import util
from kubernetes import client as k8sclient, config as k8sconfig
from kubernetes.client import V1Namespace, V1DeleteOptions
VERSION_NAME = "v1.9.0"
CONTAINER_VOLUME_MOUNTS = {
"init": {
"volumeMounts": [
{
"mountPath": "/hos... | true | true |
f7fbcf3f077ecc368c9cd1e42d6381cbf2728225 | 2,505 | py | Python | tests/store/artifact/test_dbfs_artifact_repo_delegation.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 10,351 | 2018-07-31T02:52:49.000Z | 2022-03-31T23:33:13.000Z | tests/store/artifact/test_dbfs_artifact_repo_delegation.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 3,733 | 2018-07-31T01:38:51.000Z | 2022-03-31T23:56:25.000Z | tests/store/artifact/test_dbfs_artifact_repo_delegation.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 2,596 | 2018-07-31T06:38:39.000Z | 2022-03-31T23:56:32.000Z | import os
import pytest
from unittest import mock
from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
from mlflow.store.artifact.local_artifact_repo import LocalArtifactRepository
from mlflow.store.artifact.dbfs_artifact_repo import DbfsRestArtifactRepository
from mlflow.store.artifa... | 44.732143 | 90 | 0.786427 | import os
import pytest
from unittest import mock
from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
from mlflow.store.artifact.local_artifact_repo import LocalArtifactRepository
from mlflow.store.artifact.dbfs_artifact_repo import DbfsRestArtifactRepository
from mlflow.store.artifa... | true | true |
f7fbd05bd7299fa0aaeb5b1d3712e2cf9cef053e | 2,472 | py | Python | python/seldon_deploy_sdk/models/capability.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 6 | 2021-02-18T14:37:54.000Z | 2022-01-13T13:27:43.000Z | python/seldon_deploy_sdk/models/capability.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 14 | 2021-01-04T16:32:03.000Z | 2021-12-13T17:53:59.000Z | python/seldon_deploy_sdk/models/capability.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 7 | 2021-03-17T09:05:55.000Z | 2022-01-05T10:39:56.000Z | # coding: utf-8
"""
Seldon Deploy API
API to interact and manage the lifecycle of your machine learning models deployed through Seldon Deploy. # noqa: E501
OpenAPI spec version: v1alpha1
Contact: hello@seldon.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint... | 28.090909 | 122 | 0.55623 |
import pprint
import re
import six
class Capability(object):
swagger_types = {
}
attribute_map = {
}
def __init__(self):
self.discriminator = None
def to_dict(self):
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(... | true | true |
f7fbd071cb019beda3409456c1d66e1b9eeacdd4 | 2,249 | py | Python | day-32-automated-email/main.py | jskolnicki/100-Days-of-Python | 146af2b73914a525121f1c91737abd4857dc2f89 | [
"CNRI-Python"
] | null | null | null | day-32-automated-email/main.py | jskolnicki/100-Days-of-Python | 146af2b73914a525121f1c91737abd4857dc2f89 | [
"CNRI-Python"
] | null | null | null | day-32-automated-email/main.py | jskolnicki/100-Days-of-Python | 146af2b73914a525121f1c91737abd4857dc2f89 | [
"CNRI-Python"
] | null | null | null | ##################### Extra Hard Starting Project ######################
from email import message
from re import template
import pandas as pd
import os
import datetime
import random
import smtplib
from csv import reader
os.chdir(os.path.dirname(__file__))
my_email = "jareds.automated.email@gmail.com"
password = "ab... | 38.775862 | 180 | 0.586483 | connection.starttls()
connection.login(user=my_email, password=password)
connection.sendmail(from_addr=my_email,
to_addrs=row[2],
msg= f'Subject:Happy Birthday!\n\n{em... | true | true |
f7fbd073906bc9f5fcfc8f06b63d0dfb6db3baaa | 8,418 | py | Python | verifiable_mpc/ac20/compressed_pivot.py | marcusmjh/verifiable_mpc | 8f9b734c28e98057cb3928870cb504ab045c3a83 | [
"MIT"
] | null | null | null | verifiable_mpc/ac20/compressed_pivot.py | marcusmjh/verifiable_mpc | 8f9b734c28e98057cb3928870cb504ab045c3a83 | [
"MIT"
] | null | null | null | verifiable_mpc/ac20/compressed_pivot.py | marcusmjh/verifiable_mpc | 8f9b734c28e98057cb3928870cb504ab045c3a83 | [
"MIT"
] | null | null | null | """ Implementation of https://eprint.iacr.org/2020/152
``Compressed Σ-Protocol Theory and Practical Application
to Plug & Play Secure Algorithmics''
Protocols:
* Compressed Σ-protocol Π_c for relation R, page 15, protocol 5
"""
import os
import sys
import logging
from random import SystemRandom
project_... | 33.807229 | 95 | 0.614517 |
import os
import sys
import logging
from random import SystemRandom
project_root = sys.path.append(os.path.abspath(".."))
if project_root not in sys.path:
sys.path.insert(0, project_root)
import verifiable_mpc.ac20.pivot as pivot
from sec_groups.fingroups import EllipticCurveElement
prng = System... | true | true |
f7fbd0f6b49a9995ee4760d8ee58541fa28e487c | 720 | py | Python | config.py | hackersandslackers/flask-blueprint-tutorial | a082799815d7e19c6d7e8b3c85e109bbd32ca713 | [
"MIT"
] | 315 | 2020-02-18T10:41:38.000Z | 2022-03-24T04:01:07.000Z | config.py | Diego-MP/flask-blueprint-tutorial | a082799815d7e19c6d7e8b3c85e109bbd32ca713 | [
"MIT"
] | 138 | 2020-05-07T10:11:57.000Z | 2022-03-31T10:04:15.000Z | config.py | Diego-MP/flask-blueprint-tutorial | a082799815d7e19c6d7e8b3c85e109bbd32ca713 | [
"MIT"
] | 47 | 2020-02-18T22:29:54.000Z | 2022-03-09T05:58:41.000Z | """Class-based Flask app configuration."""
from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv(path.join(basedir, ".env"))
class Config:
"""Configuration from environment variables."""
SECRET_KEY = environ.get("SECRET_KEY")
FLASK_ENV = ... | 22.5 | 54 | 0.694444 | from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv(path.join(basedir, ".env"))
class Config:
SECRET_KEY = environ.get("SECRET_KEY")
FLASK_ENV = environ.get("FLASK_ENV")
FLASK_APP = "wsgi.py"
LESS_BIN = environ.get("LESS_BIN")... | true | true |
f7fbd1e9b6412b7b6ae78cddd74c9f47b792fa4e | 127 | py | Python | traffic/core/logging.py | xabbu137/traffic | c82e859700a226ffaf04d7d782800e24fa4fc290 | [
"MIT"
] | 1 | 2020-01-30T08:21:07.000Z | 2020-01-30T08:21:07.000Z | traffic/core/logging.py | xabbu137/traffic | c82e859700a226ffaf04d7d782800e24fa4fc290 | [
"MIT"
] | null | null | null | traffic/core/logging.py | xabbu137/traffic | c82e859700a226ffaf04d7d782800e24fa4fc290 | [
"MIT"
] | 1 | 2020-03-13T00:31:03.000Z | 2020-03-13T00:31:03.000Z | import logging
def loglevel(mode: str) -> None:
logger = logging.getLogger()
logger.setLevel(getattr(logging, mode))
| 18.142857 | 43 | 0.700787 | import logging
def loglevel(mode: str) -> None:
logger = logging.getLogger()
logger.setLevel(getattr(logging, mode))
| true | true |
f7fbd28978c17fad6f5e3ae95968055986a7a08b | 2,068 | py | Python | dfirtrack_config/tests/filter_forms/test_filter_forms.py | thomas-kropeit/dfirtrack | b1e0e659af7bc8085cfe2d269ddc651f9f4ba585 | [
"Apache-2.0"
] | null | null | null | dfirtrack_config/tests/filter_forms/test_filter_forms.py | thomas-kropeit/dfirtrack | b1e0e659af7bc8085cfe2d269ddc651f9f4ba585 | [
"Apache-2.0"
] | 6 | 2022-03-16T12:30:51.000Z | 2022-03-28T01:34:45.000Z | dfirtrack_config/tests/filter_forms/test_filter_forms.py | thomas-kropeit/dfirtrack | b1e0e659af7bc8085cfe2d269ddc651f9f4ba585 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from dfirtrack_config.filter_forms import AssignmentFilterForm
class AssignmentFilterFormTestCase(TestCase):
"""assignment filter form tests"""
def test_case_form_label(self):
"""test form label"""
# get object
form = AssignmentFilterForm()
#... | 27.573333 | 77 | 0.621857 | from django.test import TestCase
from dfirtrack_config.filter_forms import AssignmentFilterForm
class AssignmentFilterFormTestCase(TestCase):
def test_case_form_label(self):
form = AssignmentFilterForm()
self.assertEqual(form.fields['case'].label, 'Filter for case')
def t... | true | true |
f7fbd3776ed1e1f6443976d5b489ca6a36d0f901 | 321 | py | Python | test/benchmark/api_v2_0/__init__.py | nucklehead/RackHD | c21876e1138c19caeeaf5ef2e2a6c0236e780896 | [
"Apache-2.0"
] | null | null | null | test/benchmark/api_v2_0/__init__.py | nucklehead/RackHD | c21876e1138c19caeeaf5ef2e2a6c0236e780896 | [
"Apache-2.0"
] | null | null | null | test/benchmark/api_v2_0/__init__.py | nucklehead/RackHD | c21876e1138c19caeeaf5ef2e2a6c0236e780896 | [
"Apache-2.0"
] | null | null | null | from poller_tests import BenchmarkPollerTests
from discovery_tests import BenchmarkDiscoveryTests
from bootstrap_tests import BenchmarkBootstrapTests
benchmark_poller_tests = [
'benchmark.poller'
]
benchmark_discovery_tests = [
'benchmark.discovery'
]
benchmark_bootstrap_tests = [
'benchmark.bootstrap'
]... | 20.0625 | 51 | 0.813084 | from poller_tests import BenchmarkPollerTests
from discovery_tests import BenchmarkDiscoveryTests
from bootstrap_tests import BenchmarkBootstrapTests
benchmark_poller_tests = [
'benchmark.poller'
]
benchmark_discovery_tests = [
'benchmark.discovery'
]
benchmark_bootstrap_tests = [
'benchmark.bootstrap'
]... | true | true |
f7fbd39c2503053d6e0e62a5d448563647642992 | 9,116 | py | Python | tests/test_auth.py | anlcnydn/graceful | d4678cb6349a5c843a5e58002fc80140821609e4 | [
"BSD-3-Clause"
] | 83 | 2015-06-18T18:08:50.000Z | 2021-05-21T06:12:46.000Z | tests/test_auth.py | anlcnydn/graceful | d4678cb6349a5c843a5e58002fc80140821609e4 | [
"BSD-3-Clause"
] | 59 | 2015-07-02T12:28:50.000Z | 2019-01-21T18:32:47.000Z | tests/test_auth.py | anlcnydn/graceful | d4678cb6349a5c843a5e58002fc80140821609e4 | [
"BSD-3-Clause"
] | 14 | 2015-08-26T22:43:47.000Z | 2020-04-17T11:00:37.000Z | # -*- coding: utf-8 -*-
import base64
import pytest
import hashlib
from falcon.testing import TestBase
from falcon import API
from falcon import status_codes
from graceful.resources.base import BaseResource
from graceful import authentication
from graceful import authorization
@authorization.authentication_required... | 29.501618 | 78 | 0.65204 |
import base64
import pytest
import hashlib
from falcon.testing import TestBase
from falcon import API
from falcon import status_codes
from graceful.resources.base import BaseResource
from graceful import authentication
from graceful import authorization
@authorization.authentication_required
class ExampleResource(... | true | true |
f7fbd472d8bcfc731ae2f04f592f284801beae5f | 411 | py | Python | test/face_eye_detection.py | jeffskinnerbox/people-counter | f4381ee82df11f30d98673d0bba403c3350a8463 | [
"Unlicense",
"MIT"
] | 64 | 2017-10-19T11:46:14.000Z | 2021-11-10T03:40:38.000Z | test/face_eye_detection.py | mathewspjacob/people-counter | f4381ee82df11f30d98673d0bba403c3350a8463 | [
"Unlicense",
"MIT"
] | 1 | 2020-05-14T07:56:48.000Z | 2020-05-14T07:56:48.000Z | test/face_eye_detection.py | jeffskinnerbox/people-counter | f4381ee82df11f30d98673d0bba403c3350a8463 | [
"Unlicense",
"MIT"
] | 27 | 2018-03-12T15:50:12.000Z | 2021-03-29T16:32:53.000Z | #!/usr/bin/python3
#
# Maintainer: jeffskinnerbox@yahoo.com / www.jeffskinnerbox.me
# Version: 0.3.0
#
# Haar Cascade Object Detection Face & Eye OpenCV Python Tutorial - https://pythonprogramming.net/haar-cascade-face-eye-detection-python-opencv-tutorial/
# Creating your own Haar Cascade OpenCV Python Tutori... | 31.615385 | 153 | 0.768856 | true | true | |
f7fbd5747006c092c841e0ff277182958285676a | 21,374 | py | Python | One-GORD/Ours-o/model.py | zju-vipa/One-GORD | 9f3846949d9d7de5b21caaad1f8696f4ce257b55 | [
"Apache-2.0"
] | 3 | 2020-12-23T08:54:00.000Z | 2021-04-12T08:39:12.000Z | One-GORD/Ours-o/model.py | HymEric/One-GORD | a63ecaf2b9538789ca0e761d55608a28d7194c4d | [
"Apache-2.0"
] | null | null | null | One-GORD/Ours-o/model.py | HymEric/One-GORD | a63ecaf2b9538789ca0e761d55608a28d7194c4d | [
"Apache-2.0"
] | 2 | 2021-01-03T06:26:31.000Z | 2021-04-12T08:39:15.000Z | import os, sys
import time
import re
import numpy as np
import tensorflow as tf
import sys
sys.path.append('../')
import lib.models as lib
from lib.models import params_with_name
from lib.models.save_images import save_images
from lib.models.distributions import Bernoulli, Gaussian, Product
from lib.mode... | 59.207756 | 398 | 0.649434 | import os, sys
import time
import re
import numpy as np
import tensorflow as tf
import sys
sys.path.append('../')
import lib.models as lib
from lib.models import params_with_name
from lib.models.save_images import save_images
from lib.models.distributions import Bernoulli, Gaussian, Product
from lib.mode... | true | true |
f7fbd5bd1cef121fc4393bb804be64d14bfbae49 | 1,963 | py | Python | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/RenewClientTokenRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/RenewClientTokenRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/RenewClientTokenRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.438596 | 75 | 0.76108 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkhbr.endpoint import endpoint_data
class RenewClientTokenRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'hbr', '2017-09-08', 'RenewClientToken','hbr')
self.set_protocol_type('https')
self.set_method('POST')
if ... | true | true |
f7fbd67754e0880e81c219bdc08f1400c9178289 | 13,271 | py | Python | lib/spack/spack/cmd/uninstall.py | NERSC/spack | cf8de02e7387727f02ff5d695405fca8b4cad400 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | lib/spack/spack/cmd/uninstall.py | NERSC/spack | cf8de02e7387727f02ff5d695405fca8b4cad400 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | lib/spack/spack/cmd/uninstall.py | NERSC/spack | cf8de02e7387727f02ff5d695405fca8b4cad400 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.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 __future__ import print_function
import itertools
import sys
from llnl.util import tty
from llnl.util.tty.colify im... | 35.201592 | 85 | 0.638686 |
from __future__ import print_function
import itertools
import sys
from llnl.util import tty
from llnl.util.tty.colify import colify
import spack.cmd
import spack.cmd.common.arguments as arguments
import spack.environment as ev
import spack.error
import spack.package
import spack.repo
import spack.store
from spa... | true | true |
f7fbd84bd7dc834c667a2f4c61326629d1896354 | 2,687 | py | Python | setup.py | legaultmarc/geneparse | 5a844df77ded5adc765a086a8d346fce6ba01f3d | [
"MIT"
] | 4 | 2018-11-09T11:10:24.000Z | 2021-07-23T22:17:58.000Z | setup.py | legaultmarc/geneparse | 5a844df77ded5adc765a086a8d346fce6ba01f3d | [
"MIT"
] | 5 | 2017-05-02T15:28:01.000Z | 2018-04-16T18:29:15.000Z | setup.py | legaultmarc/geneparse | 5a844df77ded5adc765a086a8d346fce6ba01f3d | [
"MIT"
] | 1 | 2017-05-12T17:58:32.000Z | 2017-05-12T17:58:32.000Z | #!/usr/bin/env python
# How to build source distribution
# - python setup.py sdist --format bztar
# - python setup.py sdist --format gztar
# - python setup.py sdist --format zip
# - python setup.py bdist_wheel
import os
import sys
from setuptools import setup, find_packages
MAJOR = 0
MINOR = 8
MICRO = 1
V... | 30.885057 | 75 | 0.560849 |
import os
import sys
from setuptools import setup, find_packages
MAJOR = 0
MINOR = 8
MICRO = 1
VERSION = "{0}.{1}.{2}".format(MAJOR, MINOR, MICRO)
def check_python_version():
python_major, python_minor = sys.version_info[:2]
if python_major != 3 or python_minor < 4:
sys.stderr.write("gene... | true | true |
f7fbd980831ccec066261d37e528035e5f2d7c7a | 12,278 | py | Python | open-hackathon-client/src/client/config_sample.py | overbest/open-hackathon | 62e085fbe603bcb00ca56d2b96cfc43bf44c710b | [
"MIT"
] | null | null | null | open-hackathon-client/src/client/config_sample.py | overbest/open-hackathon | 62e085fbe603bcb00ca56d2b96cfc43bf44c710b | [
"MIT"
] | null | null | null | open-hackathon-client/src/client/config_sample.py | overbest/open-hackathon | 62e085fbe603bcb00ca56d2b96cfc43bf44c710b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... | 42.93007 | 174 | 0.476136 |
HOSTNAME = "http://localhost"
ackathon"
HACKATHON_API_ENDPOINT = "http://localhost:15000"
GITHUB_CLIENT_ID = "b44f3d47bdeb26b9c4e6"
GITHUB_CLIENT_SECRET = "98de14161c4b2ed3ea7a19787d62cda73b8e292c"
QQ_CLIENT_ID = "101200890"
QQ_CLIENT_SECRET = "88ad67bd4521c4cc47136854781cb9b... | true | true |
f7fbda38fbc7b3f196dad37b9ad073f1cfcd3845 | 9,350 | py | Python | cqlengine/tests/statements/test_assignment_clauses.py | dokai/cqlengine | a080aff3a73351d37126b14eef606061b445aa37 | [
"BSD-3-Clause"
] | null | null | null | cqlengine/tests/statements/test_assignment_clauses.py | dokai/cqlengine | a080aff3a73351d37126b14eef606061b445aa37 | [
"BSD-3-Clause"
] | null | null | null | cqlengine/tests/statements/test_assignment_clauses.py | dokai/cqlengine | a080aff3a73351d37126b14eef606061b445aa37 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
from cqlengine.statements import AssignmentClause, SetUpdateClause, ListUpdateClause, MapUpdateClause, MapDeleteClause, FieldDeleteClause, CounterUpdateClause
class AssignmentClauseTests(TestCase):
def test_rendering(self):
pass
def test_insert_tuple(self):
ac =... | 28.506098 | 158 | 0.563316 | from unittest import TestCase
from cqlengine.statements import AssignmentClause, SetUpdateClause, ListUpdateClause, MapUpdateClause, MapDeleteClause, FieldDeleteClause, CounterUpdateClause
class AssignmentClauseTests(TestCase):
def test_rendering(self):
pass
def test_insert_tuple(self):
ac =... | true | true |
f7fbda7490aea884559b813a79978c1c6ea5a0cb | 2,092 | py | Python | CNN/utils/activations.py | shafzhr/SimpleConvNet | 89b669a59099743f0e115526cbc156aa22f453c3 | [
"MIT"
] | 2 | 2020-06-29T16:40:59.000Z | 2020-11-12T18:24:01.000Z | CNN/utils/activations.py | shafzhr/SimpleConvNet | 89b669a59099743f0e115526cbc156aa22f453c3 | [
"MIT"
] | 1 | 2021-02-24T16:28:15.000Z | 2021-02-24T16:28:15.000Z | CNN/utils/activations.py | shafzhr/SimpleConvNet | 89b669a59099743f0e115526cbc156aa22f453c3 | [
"MIT"
] | null | null | null | import numpy as np
import abc
class Activation(metaclass=abc.ABCMeta):
"""
Activation abstract class
"""
@abc.abstractmethod
def apply(self, x, is_training):
"""
Applying the activation function over `x`
"""
pass
@abc.abstractmethod
def backprop(self, dA_p... | 24.904762 | 112 | 0.585564 | import numpy as np
import abc
class Activation(metaclass=abc.ABCMeta):
@abc.abstractmethod
def apply(self, x, is_training):
pass
@abc.abstractmethod
def backprop(self, dA_prev):
pass
class ReLU(Activation):
def __init__(self):
self.X = None
def apply(self, x, is_t... | true | true |
f7fbda9b7a677ee3832e4b52f14ded305adcce8d | 62,448 | py | Python | addon_common/common/updater_core.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | 1 | 2021-08-04T07:02:57.000Z | 2021-08-04T07:02:57.000Z | addon_common/common/updater_core.py | Varelshen/retopoflow | 5e9fd7ff65e7a5a64bf3078c78fb71cc270fdb71 | [
"OML"
] | null | null | null | addon_common/common/updater_core.py | Varelshen/retopoflow | 5e9fd7ff65e7a5a64bf3078c78fb71cc270fdb71 | [
"OML"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 37.260143 | 123 | 0.573725 | self._engine = GithubEngine()
self._user = None
self._repo = None
self._website = None
self._current_version = None
self._subfolder_path = None
self._tags = []
self._tag_latest = None
self._tag_names = []
self._latest_release = None
... | true | true |
f7fbdb885279ab0c23eadba10893de95e20c379e | 11,746 | py | Python | wpcmd/base.py | zrong/wpcmd | f755bedba8cd44af62f59cf6d9d8bace46245e92 | [
"BSD-3-Clause"
] | 17 | 2015-11-22T04:28:59.000Z | 2020-02-15T11:29:39.000Z | wpcmd/base.py | zrong/wpcmd | f755bedba8cd44af62f59cf6d9d8bace46245e92 | [
"BSD-3-Clause"
] | 1 | 2019-04-02T04:07:41.000Z | 2019-04-02T08:26:05.000Z | wpcmd/base.py | zrong/wpcmd | f755bedba8cd44af62f59cf6d9d8bace46245e92 | [
"BSD-3-Clause"
] | 8 | 2015-11-21T02:04:45.000Z | 2019-10-06T12:27:09.000Z | #########################################
# base.py
#
# Author zrong(zengrong.net)
# Creation 2014-12-04
# Modification 2015-11-22
#########################################
import os
import re
import platform
import shutil
from xmlrpc.client import Fault
from string import Template
from datetime import (datetime, time... | 32.269231 | 82 | 0.548187 | lf, key):
return None
def __getattr__(self, name):
return self.ini[name]
def get(self, section, option):
return self.ini.get(section, option, raw=True, fallback=None)
def get_site(self, option):
return self.get(self.__site_section, option)
def get_user(self):
... | true | true |
f7fbdd0928e0dd0fb1e4cd34a710e45de480bda2 | 2,604 | py | Python | allennlp/tests/data/dataset_readers/semantic_parsing/atis_test.py | threefoldo/allennlp | 983db284cb46fd18c898dd3b0e04eed6cb932768 | [
"Apache-2.0"
] | null | null | null | allennlp/tests/data/dataset_readers/semantic_parsing/atis_test.py | threefoldo/allennlp | 983db284cb46fd18c898dd3b0e04eed6cb932768 | [
"Apache-2.0"
] | null | null | null | allennlp/tests/data/dataset_readers/semantic_parsing/atis_test.py | threefoldo/allennlp | 983db284cb46fd18c898dd3b0e04eed6cb932768 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=no-self-use,invalid-name
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers import AtisDatasetReader
from allennlp.common.testing import AllenNlpTestCase
from allennlp.semparse.worlds import AtisWorld
class TestAtisReader(AllenNlpTestCase):
def test_atis_read_f... | 49.132075 | 109 | 0.544547 |
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers import AtisDatasetReader
from allennlp.common.testing import AllenNlpTestCase
from allennlp.semparse.worlds import AtisWorld
class TestAtisReader(AllenNlpTestCase):
def test_atis_read_from_file(self):
data_path = AllenN... | true | true |
f7fbde329e3743fcc1be07306b336fa20800b168 | 809 | py | Python | src/project/utils/xmodels.py | tgrx/obliviscor | 31f9a4476892460c931b9a8fc5403c3afcc47607 | [
"Apache-2.0"
] | null | null | null | src/project/utils/xmodels.py | tgrx/obliviscor | 31f9a4476892460c931b9a8fc5403c3afcc47607 | [
"Apache-2.0"
] | 20 | 2020-04-16T23:45:50.000Z | 2020-05-05T14:22:03.000Z | src/project/utils/xmodels.py | tgrx/obliviscor | 31f9a4476892460c931b9a8fc5403c3afcc47607 | [
"Apache-2.0"
] | null | null | null | from functools import singledispatch
from typing import Text
import django
from django.db.models.base import ModelBase
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
from django.db.models.fields.related_descriptors import ManyToManyDescriptor
from django.db.models.query_utils import... | 22.472222 | 82 | 0.765142 | from functools import singledispatch
from typing import Text
import django
from django.db.models.base import ModelBase
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
from django.db.models.fields.related_descriptors import ManyToManyDescriptor
from django.db.models.query_utils import... | true | true |
f7fbdf22581f47bc1202559017c47381d8bda634 | 394 | py | Python | scripts/jenkins_win32.py | mbits-os/JiraDesktop | eb9b66b9c11b2fba1079f03a6f90aea425ce6138 | [
"MIT"
] | null | null | null | scripts/jenkins_win32.py | mbits-os/JiraDesktop | eb9b66b9c11b2fba1079f03a6f90aea425ce6138 | [
"MIT"
] | null | null | null | scripts/jenkins_win32.py | mbits-os/JiraDesktop | eb9b66b9c11b2fba1079f03a6f90aea425ce6138 | [
"MIT"
] | null | null | null | import sys, os, glob, zipfile
ROOT = 'apps/Tasks/Release/'
FILES = [
'tasks.exe',
'locale/Tasks.*'
]
def paths():
for FILE in FILES:
for name in glob.iglob(os.path.join(ROOT, FILE)):
yield (name, os.path.join('bin', os.path.relpath(name, ROOT)))
with zipfile.ZipFile(sys.argv[1], 'w') as zip:
... | 21.888889 | 66 | 0.626904 | import sys, os, glob, zipfile
ROOT = 'apps/Tasks/Release/'
FILES = [
'tasks.exe',
'locale/Tasks.*'
]
def paths():
for FILE in FILES:
for name in glob.iglob(os.path.join(ROOT, FILE)):
yield (name, os.path.join('bin', os.path.relpath(name, ROOT)))
with zipfile.ZipFile(sys.argv[1], 'w') as zip:
... | true | true |
f7fbdfa1d83c3367452e2b32485d78c99766b1f7 | 1,812 | py | Python | test/image_sampler_test.py | Enigmatisms/NeRF | 870abd83c9679e0735284a1641ffc0d13f0cf1d4 | [
"Apache-2.0"
] | 1 | 2022-03-26T16:56:41.000Z | 2022-03-26T16:56:41.000Z | test/image_sampler_test.py | Enigmatisms/NeRF | 870abd83c9679e0735284a1641ffc0d13f0cf1d4 | [
"Apache-2.0"
] | null | null | null | test/image_sampler_test.py | Enigmatisms/NeRF | 870abd83c9679e0735284a1641ffc0d13f0cf1d4 | [
"Apache-2.0"
] | null | null | null | #-*-coding:utf-8-*-
"""
@author Enigmatisms @date 2022.3.23
Last testing module for image sampler
"""
import torch
import numpy as np
from time import time
from nerf_helper import imageSampling
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from instances import BLENDER_FOV, Rs, ts
fr... | 38.553191 | 119 | 0.666115 |
import torch
import numpy as np
from time import time
from nerf_helper import imageSampling
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from instances import BLENDER_FOV, Rs, ts
from torchvision import transforms
import sys
sys.path.append("..")
from py.utils import fov2Focal
from py.data... | true | true |
f7fbe0513fe16af12b96d800b2b62c560b4bcd2d | 509 | py | Python | setup.py | what-digital/aldryn-simple-glossary | af0e9bd56f55a0773ac528dccd2393182c3b3c53 | [
"MIT"
] | null | null | null | setup.py | what-digital/aldryn-simple-glossary | af0e9bd56f55a0773ac528dccd2393182c3b3c53 | [
"MIT"
] | null | null | null | setup.py | what-digital/aldryn-simple-glossary | af0e9bd56f55a0773ac528dccd2393182c3b3c53 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from aldryn_simple_glossary import __version__
REQUIREMENTS = [
'Django>=1.7',
'djangocms-text-ckeditor',
]
setup(
name='aldryn-simple-glossary',
version=__version__,
description=open('README.rst').read(),
author='Divio AG'... | 20.36 | 46 | 0.691552 |
from setuptools import setup, find_packages
from aldryn_simple_glossary import __version__
REQUIREMENTS = [
'Django>=1.7',
'djangocms-text-ckeditor',
]
setup(
name='aldryn-simple-glossary',
version=__version__,
description=open('README.rst').read(),
author='Divio AG',
author_email='inf... | true | true |
f7fbe09243f22bf796b7740f20cc26f56e877667 | 5,055 | py | Python | markote/onenote_html_mapper.py | Frederick-S/one-mark | b2a85dce82f56fc0d08df7519178b4a7e4f89b70 | [
"MIT"
] | 8 | 2018-07-12T02:33:04.000Z | 2020-11-12T20:28:49.000Z | markote/onenote_html_mapper.py | Frederick-S/one-mark | b2a85dce82f56fc0d08df7519178b4a7e4f89b70 | [
"MIT"
] | 353 | 2018-05-21T03:34:36.000Z | 2022-03-28T21:06:43.000Z | markote/onenote_html_mapper.py | Frederick-S/one-mark | b2a85dce82f56fc0d08df7519178b4a7e4f89b70 | [
"MIT"
] | 2 | 2019-08-04T23:39:09.000Z | 2020-04-14T12:22:20.000Z | import io
import uuid
from PIL import Image
from pyquery import PyQuery
from markote.oauth import oauth
from markote.resource import Resource
from markote.util import convert_svg_to_png
class OneNoteHtmlMapper(object):
"""
Converts standard html to OneNote supported html.
"""
def __init__(self, docume... | 32.403846 | 79 | 0.58912 | import io
import uuid
from PIL import Image
from pyquery import PyQuery
from markote.oauth import oauth
from markote.resource import Resource
from markote.util import convert_svg_to_png
class OneNoteHtmlMapper(object):
def __init__(self, document):
self.document = document
self.resources = []
... | true | true |
f7fbe2c78a9888a6d2b82ad7266d559f4c9c00ba | 10,485 | py | Python | dace/fpga_testing.py | jdahm/dace | d4f32d97cd1fafd9ad8e52ca7ad5283461c64e78 | [
"BSD-3-Clause"
] | 227 | 2019-03-15T23:39:06.000Z | 2022-03-30T07:49:08.000Z | dace/fpga_testing.py | jdahm/dace | d4f32d97cd1fafd9ad8e52ca7ad5283461c64e78 | [
"BSD-3-Clause"
] | 834 | 2019-07-31T22:49:31.000Z | 2022-03-28T14:01:32.000Z | dace/fpga_testing.py | jdahm/dace | d4f32d97cd1fafd9ad8e52ca7ad5283461c64e78 | [
"BSD-3-Clause"
] | 64 | 2019-03-19T05:40:37.000Z | 2022-03-11T15:02:42.000Z | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
from datetime import datetime
import importlib.util
import inspect
import os
import multiprocessing as mp
from pathlib import Path
import pytest
import re
import subprocess as sp
from typing import Callable, Iterable, Optional, Tuple, Union
fr... | 38.127273 | 112 | 0.539628 |
from datetime import datetime
import importlib.util
import inspect
import os
import multiprocessing as mp
from pathlib import Path
import pytest
import re
import subprocess as sp
from typing import Callable, Iterable, Optional, Tuple, Union
from dace import SDFG
from dace.config import Config, temporary_config
TEST_... | true | true |
f7fbe2dd98394448bba6ae61ada6dc2211884eec | 7,972 | py | Python | assignments/tutorialSpaceInvaders/tutorialSpaceInvaders.py | noelleclement/pythoncourse | 37d6b26aaf7c8d4537f13fd1b92bfa2d5e4d5128 | [
"MIT"
] | null | null | null | assignments/tutorialSpaceInvaders/tutorialSpaceInvaders.py | noelleclement/pythoncourse | 37d6b26aaf7c8d4537f13fd1b92bfa2d5e4d5128 | [
"MIT"
] | null | null | null | assignments/tutorialSpaceInvaders/tutorialSpaceInvaders.py | noelleclement/pythoncourse | 37d6b26aaf7c8d4537f13fd1b92bfa2d5e4d5128 | [
"MIT"
] | null | null | null | import pyglet
from pyglet.window import key, FPSDisplay
import numpy as np
def preload_image(image):
img = pyglet.image.load('resources/sprites/'+image)
return img
class GameWindow(pyglet.window.Window):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_lo... | 45.039548 | 234 | 0.622303 | import pyglet
from pyglet.window import key, FPSDisplay
import numpy as np
def preload_image(image):
img = pyglet.image.load('resources/sprites/'+image)
return img
class GameWindow(pyglet.window.Window):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_lo... | true | true |
f7fbe2e15e3f55c65d5589bf082424b9e93dbe23 | 13,708 | py | Python | homeassistant/components/emulated_hue/hue_api.py | robin13/home-assistant | 4976569e304c23975d34ec88e2dfb94e84ab1f1c | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | homeassistant/components/emulated_hue/hue_api.py | robin13/home-assistant | 4976569e304c23975d34ec88e2dfb94e84ab1f1c | [
"Apache-2.0"
] | 6 | 2021-02-08T20:25:50.000Z | 2022-03-11T23:27:53.000Z | homeassistant/components/emulated_hue/hue_api.py | robin13/home-assistant | 4976569e304c23975d34ec88e2dfb94e84ab1f1c | [
"Apache-2.0"
] | 3 | 2018-09-14T07:34:09.000Z | 2018-09-29T12:57:10.000Z | """Provides a Hue API to control Home Assistant."""
import asyncio
import logging
from aiohttp import web
from homeassistant import core
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_SET,
SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, STATE_ON, STATE_OFF,
HT... | 35.329897 | 79 | 0.618471 | import asyncio
import logging
from aiohttp import web
from homeassistant import core
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_SET,
SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, STATE_ON, STATE_OFF,
HTTP_BAD_REQUEST, HTTP_NOT_FOUND, ATTR_SUPPORTED_FEATU... | true | true |
f7fbe2f0a69c1aae8f05d0d0cc30c8c7142db7e2 | 965 | py | Python | tests/core/test_synonyms.py | IgorZyktin/MediaStorageSystem | df8d260581cb806eb54f320d63aa674c6175c17e | [
"MIT"
] | 2 | 2021-03-06T16:07:30.000Z | 2021-03-17T10:27:25.000Z | tests/core/test_synonyms.py | IgorZyktin/MediaStorageSystem | df8d260581cb806eb54f320d63aa674c6175c17e | [
"MIT"
] | null | null | null | tests/core/test_synonyms.py | IgorZyktin/MediaStorageSystem | df8d260581cb806eb54f320d63aa674c6175c17e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests.
"""
import operator
from functools import partial, reduce
from mss.core.class_synonyms import Synonyms
def test_synonyms_creation(synonyms):
assert str(synonyms) == 'Synonyms<2 groups>'
def test_synonyms_iteration(synonyms):
assert list(synonyms) == [frozenset({'b', 'a'})... | 25.394737 | 56 | 0.553368 |
import operator
from functools import partial, reduce
from mss.core.class_synonyms import Synonyms
def test_synonyms_creation(synonyms):
assert str(synonyms) == 'Synonyms<2 groups>'
def test_synonyms_iteration(synonyms):
assert list(synonyms) == [frozenset({'b', 'a'}),
froze... | true | true |
f7fbe35fc05575866e02a6b7537f1be5c906cc69 | 14,642 | py | Python | src/train_cf.py | mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge | 7e1bb94bb2fc535972a351f543be4f0ad8475275 | [
"MIT"
] | null | null | null | src/train_cf.py | mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge | 7e1bb94bb2fc535972a351f543be4f0ad8475275 | [
"MIT"
] | null | null | null | src/train_cf.py | mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge | 7e1bb94bb2fc535972a351f543be4f0ad8475275 | [
"MIT"
] | null | null | null | """
this script trains an LSTM model on one of the data files in the data folder of
this repository. the input file can be changed to another file from the data folder
by changing its name in line 46.
it is recommended to run this script on GPU, as recurrent networks are quite
computationally intensive.
Author: Niek ... | 41.361582 | 120 | 0.588922 |
from __future__ import print_function, division
import copy
import csv
import os
import time
from datetime import datetime
from itertools import izip
import numpy as np
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
from keras.layers import Input, BatchNormalization, LeakyReLU, Dropout... | true | true |
f7fbe627150d8e8a0f60ccd57ac8c6f63ee82bee | 15,817 | py | Python | MayaIntegration/PAIO.py | MontyThibault/Force-Sensor-Integration | 9f949439ea0c1116c00af89735c034cda423ae7e | [
"MIT"
] | null | null | null | MayaIntegration/PAIO.py | MontyThibault/Force-Sensor-Integration | 9f949439ea0c1116c00af89735c034cda423ae7e | [
"MIT"
] | null | null | null | MayaIntegration/PAIO.py | MontyThibault/Force-Sensor-Integration | 9f949439ea0c1116c00af89735c034cda423ae7e | [
"MIT"
] | null | null | null | from ctypes import *
import unittest
class Singleton(object):
"""Ensures only one instance of subtypes exist at a time."""
_instance = None
def __new__(class_, *args, **kwargs):
if not isinstance(class_._instance, class_):
class_._instance = object.__new__(class_, *args, **kwargs)
return class_._instance
... | 45.979651 | 124 | 0.52981 | from ctypes import *
import unittest
class Singleton(object):
_instance = None
def __new__(class_, *args, **kwargs):
if not isinstance(class_._instance, class_):
class_._instance = object.__new__(class_, *args, **kwargs)
return class_._instance
class AIO(Singleton):
_raw = cdll.LoadLibrary('CAIO.dll')
... | true | true |
f7fbe6a159e62b037f1ac3d3c3112fb41bc6e8c5 | 2,395 | py | Python | Dataload/dataload_SST_binary.py | TTdeveloping/text_classification | b8e5ae22de6441479151efcd79a8d4899a1b1fd5 | [
"Apache-2.0"
] | 3 | 2019-04-13T08:29:09.000Z | 2021-11-11T02:55:24.000Z | Dataload/dataload_SST_binary.py | TTdeveloping/text_classification | b8e5ae22de6441479151efcd79a8d4899a1b1fd5 | [
"Apache-2.0"
] | null | null | null | Dataload/dataload_SST_binary.py | TTdeveloping/text_classification | b8e5ae22de6441479151efcd79a8d4899a1b1fd5 | [
"Apache-2.0"
] | null | null | null | import random
import sys
from Dataload.Instance import Instance
class DataLoader():
def __init__(self, path, shuffle, config):
"""
:param path:
:param shuffle:
:param config:
:return:
"""
print("Loading data:......")
self.data_list = []
self.ma... | 30.705128 | 84 | 0.508977 | import random
import sys
from Dataload.Instance import Instance
class DataLoader():
def __init__(self, path, shuffle, config):
print("Loading data:......")
self.data_list = []
self.max_count = config.max_count
self.path = path
self.shuffle = shuffle
def dataload(self):
... | true | true |
f7fbe8a4d328c05c5e4599deeee2b1ff3d5f0605 | 461 | py | Python | tcutils/pkgs/syn_ack_test/syn_server.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | 1 | 2017-06-13T04:42:34.000Z | 2017-06-13T04:42:34.000Z | tcutils/pkgs/syn_ack_test/syn_server.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | null | null | null | tcutils/pkgs/syn_ack_test/syn_server.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
from scapy.all import *
from time import sleep
import sys
ip_remote = sys.argv[1]
ip_local = sys.argv[2]
os.system(
'iptables -A OUTPUT -p tcp --tcp-flags RST RST -s %s -j DROP' %
ip_local)
server = conf.L3socket(filter='host %s' % ip_remote)
ip=IP(dst=ip_remote)
SYN = se... | 20.954545 | 88 | 0.665944 |
from scapy.all import *
from time import sleep
import sys
ip_remote = sys.argv[1]
ip_local = sys.argv[2]
os.system(
'iptables -A OUTPUT -p tcp --tcp-flags RST RST -s %s -j DROP' %
ip_local)
server = conf.L3socket(filter='host %s' % ip_remote)
ip=IP(dst=ip_remote)
SYN = server.recv()
sleep(182)... | false | true |
f7fbe93ae2eb83e5f74d3936c436a08e047b8741 | 3,944 | py | Python | runner/datacker_runner/tests/test_runner.py | tsptoni/datacker | e2989aa9103121e5fd35a38ca061d03e298a43b9 | [
"BSD-3-Clause"
] | 4 | 2021-01-26T21:45:28.000Z | 2021-02-02T11:45:15.000Z | runner/datacker_runner/tests/test_runner.py | tsptoni/datacker | e2989aa9103121e5fd35a38ca061d03e298a43b9 | [
"BSD-3-Clause"
] | 1 | 2021-02-02T11:16:32.000Z | 2021-02-02T11:16:32.000Z | runner/datacker_runner/tests/test_runner.py | tsptoni/datacker | e2989aa9103121e5fd35a38ca061d03e298a43b9 | [
"BSD-3-Clause"
] | 1 | 2021-02-02T10:37:29.000Z | 2021-02-02T10:37:29.000Z | import sys
import io
import unittest
from unittest.mock import patch, mock_open
from pathlib import Path
from ..run import get_config, get_parameters, run
class TestGetConfig(unittest.TestCase):
def test_get_config_defaults(self):
environment = {}
expected = {
"NOTEBOOK_NAME": "main",... | 36.183486 | 78 | 0.559331 | import sys
import io
import unittest
from unittest.mock import patch, mock_open
from pathlib import Path
from ..run import get_config, get_parameters, run
class TestGetConfig(unittest.TestCase):
def test_get_config_defaults(self):
environment = {}
expected = {
"NOTEBOOK_NAME": "main",... | true | true |
f7fbe99146e8b5da4bec7e1aa27780397afc4434 | 5,397 | py | Python | test/end_2_end/test_multiple_events_in_tracker_different_events.py | ryomahan/read-tracardi-api | d0a012fb097ca81daf046b314000301eb54bfad8 | [
"MIT"
] | 3 | 2021-11-27T18:03:31.000Z | 2022-02-06T21:47:59.000Z | test/end_2_end/test_multiple_events_in_tracker_different_events.py | ryomahan/read-tracardi-api | d0a012fb097ca81daf046b314000301eb54bfad8 | [
"MIT"
] | 13 | 2021-11-03T18:15:06.000Z | 2022-03-27T22:28:38.000Z | test/end_2_end/test_multiple_events_in_tracker_different_events.py | ryomahan/read-tracardi-api | d0a012fb097ca81daf046b314000301eb54bfad8 | [
"MIT"
] | 8 | 2021-11-16T04:07:41.000Z | 2022-03-14T14:51:34.000Z | from uuid import uuid4
from tracardi.process_engine.action.v1.flow.start.start_action import StartAction
from tracardi.process_engine.action.v1.increase_views_action import IncreaseViewsAction
from tracardi.domain.flow import Flow
from tracardi.process_engine.action.v1.end_action import EndAction
from tracardi.proces... | 38.276596 | 104 | 0.519918 | from uuid import uuid4
from tracardi.process_engine.action.v1.flow.start.start_action import StartAction
from tracardi.process_engine.action.v1.increase_views_action import IncreaseViewsAction
from tracardi.domain.flow import Flow
from tracardi.process_engine.action.v1.end_action import EndAction
from tracardi.proces... | true | true |
f7fbe9a3708b617da4237bfbe9e18984e7a255e8 | 445 | py | Python | mmdeploy/apis/openvino/__init__.py | Kayce001/mmdeploy | 59470fef0b28e0b760c72269e0696bbdf57db7f1 | [
"Apache-2.0"
] | 1 | 2022-03-08T12:22:34.000Z | 2022-03-08T12:22:34.000Z | mmdeploy/apis/openvino/__init__.py | Kayce001/mmdeploy | 59470fef0b28e0b760c72269e0696bbdf57db7f1 | [
"Apache-2.0"
] | null | null | null | mmdeploy/apis/openvino/__init__.py | Kayce001/mmdeploy | 59470fef0b28e0b760c72269e0696bbdf57db7f1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from mmdeploy.backend.openvino import is_available
__all__ = ['is_available']
if is_available():
from mmdeploy.backend.openvino.onnx2openvino import (get_output_model_file,
onnx2openvino)
from .utils impor... | 34.230769 | 79 | 0.665169 |
from mmdeploy.backend.openvino import is_available
__all__ = ['is_available']
if is_available():
from mmdeploy.backend.openvino.onnx2openvino import (get_output_model_file,
onnx2openvino)
from .utils import get_input_info_from_cfg
__all__ += [
... | true | true |
f7fbe9e61649859d1ef656fa555216e15edb3f9f | 57 | py | Python | simp_py_examples/m5stack/ex029_jpg.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | simp_py_examples/m5stack/ex029_jpg.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | simp_py_examples/m5stack/ex029_jpg.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null |
from simp_py import tft
tft.tft.image(0,0,'kyoco.jpg')
| 11.4 | 30 | 0.719298 |
from simp_py import tft
tft.tft.image(0,0,'kyoco.jpg')
| true | true |
f7fbea52e6bc74951f2e6a5fcfdd21016b8c96fb | 942 | py | Python | test/test_update_schedule_response.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | test/test_update_schedule_response.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | test/test_update_schedule_response.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | 1 | 2020-11-07T11:27:13.000Z | 2020-11-07T11:27:13.000Z | # coding: utf-8
"""
OpsGenie REST API
OpsGenie OpenAPI Specification # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import opsgenie_swagger
from opsgenie_swagger.models.upda... | 22.97561 | 105 | 0.726115 |
from __future__ import absolute_import
import unittest
import opsgenie_swagger
from opsgenie_swagger.models.update_schedule_response import UpdateScheduleResponse
from opsgenie_swagger.rest import ApiException
class TestUpdateScheduleResponse(unittest.TestCase):
def setUp(self):
pass
def tea... | true | true |
f7fbead5fe0e61025c73eb9af7f67c2cb20b3107 | 867 | py | Python | scripts/web_cleaner.py | mgarrettm/graphlet-counting | edbd61d5d3399d901c15f9ccc51016828b6cc4d3 | [
"MIT"
] | null | null | null | scripts/web_cleaner.py | mgarrettm/graphlet-counting | edbd61d5d3399d901c15f9ccc51016828b6cc4d3 | [
"MIT"
] | null | null | null | scripts/web_cleaner.py | mgarrettm/graphlet-counting | edbd61d5d3399d901c15f9ccc51016828b6cc4d3 | [
"MIT"
] | null | null | null | import sys
edges = {}
seen = {}
offsets = {}
max_vertex = 0
s = open(sys.argv[2], "w+")
with open(sys.argv[1]) as f:
for line in f:
arr = line.split("\t")
u = int(arr[0])
v = int(arr[1])
seen[u] = True
seen[v] = True
if u not in edges:
edges[u] = {}
... | 23.432432 | 84 | 0.468281 | import sys
edges = {}
seen = {}
offsets = {}
max_vertex = 0
s = open(sys.argv[2], "w+")
with open(sys.argv[1]) as f:
for line in f:
arr = line.split("\t")
u = int(arr[0])
v = int(arr[1])
seen[u] = True
seen[v] = True
if u not in edges:
edges[u] = {}
... | true | true |
f7fbeae393b51337883694aefe65ee83138499c4 | 2,280 | py | Python | convert_vg_images.py | robotics-upo/og-sgg | 106c56919428ce927a1cae494932c00a5f58c37d | [
"MIT"
] | null | null | null | convert_vg_images.py | robotics-upo/og-sgg | 106c56919428ce927a1cae494932c00a5f58c37d | [
"MIT"
] | null | null | null | convert_vg_images.py | robotics-upo/og-sgg | 106c56919428ce927a1cae494932c00a5f58c37d | [
"MIT"
] | null | null | null | import tensorflow as tf
#import tensorflow_hub as hub
import numpy as np
#import cv2
import zipfile
import json
import lzma
import os
import telenet.dataset_data as tn_data
from telenet.utils import load_image_for_vrd_yolo, mdl_yolo, parse_yolo_results
from telenet.config import get as tn_config
from tqdm import tqdm
... | 34.029851 | 112 | 0.732018 | import tensorflow as tf
import numpy as np
import zipfile
import json
import lzma
import os
import telenet.dataset_data as tn_data
from telenet.utils import load_image_for_vrd_yolo, mdl_yolo, parse_yolo_results
from telenet.config import get as tn_config
from tqdm import tqdm
VG_PATH = tn_config('paths.vg')
imgcnvd... | true | true |
f7fbebe3442090849c044d81cc48620b11f473b9 | 1,627 | py | Python | dali/lagrange1d.py | dlouk/DALI | d2de8841123aaf7178b7e5f82908302345dfa586 | [
"BSD-3-Clause"
] | 1 | 2021-11-13T15:22:44.000Z | 2021-11-13T15:22:44.000Z | dali/lagrange1d.py | dlouk/DALI | d2de8841123aaf7178b7e5f82908302345dfa586 | [
"BSD-3-Clause"
] | null | null | null | dali/lagrange1d.py | dlouk/DALI | d2de8841123aaf7178b7e5f82908302345dfa586 | [
"BSD-3-Clause"
] | 1 | 2022-01-29T00:33:06.000Z | 2022-01-29T00:33:06.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 12 21:09:10 2018
@author: Dimitris Loukrezis
Univariate Lagrange and hierarchical polynomials.
"""
import numpy as np
class Lagrange1d:
"""Univariate Lagrange nodal basis polynomial"""
def __init__(self, current_knot, knots):
self.current_knot = curren... | 33.895833 | 77 | 0.688998 |
import numpy as np
class Lagrange1d:
def __init__(self, current_knot, knots):
self.current_knot = current_knot
self.knots = np.array(knots)
self.other_knots = np.setdiff1d(knots, current_knot)
self.denoms_prod = (self.current_knot - self.other_knots).prod()
def eval... | true | true |
f7fbed4e144dd563190b35303ecb4106f7ef4b94 | 23,422 | py | Python | train_emosup.py | swidi/poemo-generation | 3a349ac3a6fc3e82b24410013bced60a24c2d8bf | [
"MIT"
] | 15 | 2020-10-18T08:52:19.000Z | 2022-03-22T10:25:26.000Z | train_emosup.py | swidi/poemo-generation | 3a349ac3a6fc3e82b24410013bced60a24c2d8bf | [
"MIT"
] | 9 | 2021-02-08T16:40:45.000Z | 2021-11-29T09:30:14.000Z | train_emosup.py | swidi/poemo-generation | 3a349ac3a6fc3e82b24410013bced60a24c2d8bf | [
"MIT"
] | 4 | 2020-10-29T08:12:20.000Z | 2022-01-01T11:10:37.000Z | # Copyright 2019 The Texar 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 applicable ... | 36.145062 | 117 | 0.587567 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import importlib
import numpy as np
import tensorflow as tf
import texar as tx
from data_utils import model_utils, processor, utils
flags = tf.flags
FLAGS = flags.FLAGS
flags.D... | true | true |
f7fbee4ccc9422d35bd6f57d12073fe1989f3c2e | 32,393 | py | Python | qiskit/algorithms/minimum_eigen_solvers/vqe.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"Apache-2.0"
] | 1 | 2022-03-10T03:07:30.000Z | 2022-03-10T03:07:30.000Z | qiskit/algorithms/minimum_eigen_solvers/vqe.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"Apache-2.0"
] | null | null | null | qiskit/algorithms/minimum_eigen_solvers/vqe.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"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... | 40.592732 | 102 | 0.649245 |
from typing import Optional, List, Callable, Union, Dict, Tuple
import logging
import warnings
from time import time
import numpy as np
from qiskit.circuit import QuantumCircuit, Parameter
from qiskit.circuit.library import RealAmplitudes
from qiskit.providers import BaseBackend
from qiskit.providers impo... | true | true |
f7fbef0f15e368ac2e21ea80661d64ecef173c7f | 1,599 | py | Python | cvxpy/problems/param_prob.py | rpradal/cvxpy | 222ae345d2df67040346267f55369d8433d2e50f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/problems/param_prob.py | rpradal/cvxpy | 222ae345d2df67040346267f55369d8433d2e50f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/problems/param_prob.py | rpradal/cvxpy | 222ae345d2df67040346267f55369d8433d2e50f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Steven Diamond, 2017 Akshay Agrawal
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... | 35.533333 | 78 | 0.702314 | import abc
class ParamProb:
__metaclass__ = abc.ABCMeta
@abc.abstractproperty
def is_mixed_integer(self) -> bool:
raise NotImplementedError()
@abc.abstractproperty
def apply_parameters(self, id_to_param_value=None, zero_offset=False,
keep_zeros=False):
ra... | true | true |
f7fbf093307f47a893fa7863d53d2b6cc57e8a86 | 2,627 | py | Python | girder_larger_image/create_tiff.py | cj-abcs/larger_image | 6f7af6382c2b4ca7379bdb11c0d130d04e9524af | [
"Apache-2.0"
] | 1 | 2020-12-17T18:22:08.000Z | 2020-12-17T18:22:08.000Z | girder_larger_image/create_tiff.py | abcsFrederick/larger_image | 6f7af6382c2b4ca7379bdb11c0d130d04e9524af | [
"Apache-2.0"
] | 1 | 2019-09-11T17:52:12.000Z | 2019-09-11T17:52:12.000Z | girder_larger_image/create_tiff.py | cj-abcs/larger_image | 6f7af6382c2b4ca7379bdb11c0d130d04e9524af | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# Girder, large_image plugin framework and tests adapted from Kitware Inc.
# source and documentation by the Imaging and Visualization Group, Advanced
# Biomedical Computational Science, Frederick National Laborato... | 32.8375 | 79 | 0.606776 | true | true | |
f7fbf0ff1f7bdc600f9d34c1be2f349301a80f22 | 1,016 | py | Python | py/py_0083_path_sum_four_ways.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0083_path_sum_four_ways.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0083_path_sum_four_ways.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | # Solution of;
# Project Euler Problem 82: Path sum: four ways
# https://projecteuler.net/problem=83
#
# NOTE: This problem is a significantly more challenging version of Problem 81.
# In the 5 by 5 matrix below, the minimal path sum from the top left to the
# bottom right, by moving left, right, up, and down,
# is ... | 29.882353 | 79 | 0.633858 |
import timed
def dummy(n):
pass
if __name__ == '__main__':
n = 1000
i = 10000
prob_id = 83
timed.caller(dummy, n, i, prob_id)
| true | true |
f7fbf1dd797b49d4d282a5cd229eb70fb2a5a9f8 | 2,843 | py | Python | drop-boxes/register-wf-individualizedproteome/register-individualizedproteome-dropbox.py | qbicsoftware/etl-scripts | e1cea11b5f55fb218e7d4c8d49bdd3c5fe6c62c6 | [
"MIT"
] | 2 | 2018-04-20T15:48:02.000Z | 2021-11-30T17:39:28.000Z | drop-boxes/register-wf-individualizedproteome/register-individualizedproteome-dropbox.py | qbicsoftware/etl-scripts | e1cea11b5f55fb218e7d4c8d49bdd3c5fe6c62c6 | [
"MIT"
] | 41 | 2017-07-19T11:17:26.000Z | 2021-09-28T12:10:49.000Z | drop-boxes/register-wf-individualizedproteome/register-individualizedproteome-dropbox.py | qbicsoftware/etl-scripts | e1cea11b5f55fb218e7d4c8d49bdd3c5fe6c62c6 | [
"MIT"
] | 2 | 2017-04-27T10:32:33.000Z | 2018-02-20T09:26:12.000Z | '''
Note:
print statements go to: ~openbis/servers/datastore_server/log/startup_log.txt
'''
import sys
sys.path.append('/home-link/qeana10/bin/')
import re
import os
import time
import datetime
import shutil
import subprocess
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
from org.apach... | 35.5375 | 110 | 0.689061 | '''
Note:
print statements go to: ~openbis/servers/datastore_server/log/startup_log.txt
'''
import sys
sys.path.append('/home-link/qeana10/bin/')
import re
import os
import time
import datetime
import shutil
import subprocess
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
from org.apach... | false | true |
f7fbf298d5b64ba1cefa46a4a5d2823c2fa8cf17 | 417 | py | Python | configs/_base_/models/hrnet/hrnet-w18.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 1 | 2022-03-15T07:36:04.000Z | 2022-03-15T07:36:04.000Z | configs/_base_/models/hrnet/hrnet-w18.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | null | null | null | configs/_base_/models/hrnet/hrnet-w18.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 1 | 2022-03-25T08:40:07.000Z | 2022-03-25T08:40:07.000Z | # model settings
model = dict(
type='ImageClassifier',
backbone=dict(type='HRNet', arch='w18'),
neck=[
dict(type='HRFuseScales', in_channels=(18, 36, 72, 144)),
dict(type='GlobalAveragePooling'),
],
head=dict(
type='LinearClsHead',
in_channels=2048,
num_classe... | 26.0625 | 65 | 0.582734 |
model = dict(
type='ImageClassifier',
backbone=dict(type='HRNet', arch='w18'),
neck=[
dict(type='HRFuseScales', in_channels=(18, 36, 72, 144)),
dict(type='GlobalAveragePooling'),
],
head=dict(
type='LinearClsHead',
in_channels=2048,
num_classes=1000,
... | true | true |
f7fbf2d9bef66db0c629235703060bf818cc2326 | 8,142 | py | Python | rules/check_section_names.py | deptofdefense/SalSA | 7ef771398e3d59597bade95d0a23540de0842e2a | [
"MIT"
] | 84 | 2018-01-07T19:43:45.000Z | 2021-12-23T14:17:44.000Z | rules/check_section_names.py | deptofdefense/SalSA | 7ef771398e3d59597bade95d0a23540de0842e2a | [
"MIT"
] | 7 | 2018-04-02T20:24:28.000Z | 2019-06-07T21:48:04.000Z | rules/check_section_names.py | deptofdefense/SalSA | 7ef771398e3d59597bade95d0a23540de0842e2a | [
"MIT"
] | 18 | 2017-12-26T19:44:46.000Z | 2021-09-13T12:21:02.000Z | """
check sction names for common packers/uncommon names
"""
# list of common packer section names
packers = {
'.aspack': 'Aspack packer',
'.adata': 'Aspack packer/Armadillo packer',
'ASPack': 'Aspack packer',
'.ASPack': 'ASPAck Protector',
'.boom': 'The Boomerang List Builder (config+exe xored with a single... | 38.40566 | 125 | 0.652174 |
packers = {
'.aspack': 'Aspack packer',
'.adata': 'Aspack packer/Armadillo packer',
'ASPack': 'Aspack packer',
'.ASPack': 'ASPAck Protector',
'.boom': 'The Boomerang List Builder (config+exe xored with a single byte key 0x77)',
'.ccg': 'CCG Packer (Chinese Packer)',
'.charmve': 'Added by the PIN tool',
... | true | true |
f7fbf3e0539de519d4dd1b4bb1d7b37b825d2dd1 | 16,363 | py | Python | python/ccxt/braziliex.py | KaceyBolman/ccxt | d34a0651b209ac77453f05c4ce31883f0cd2d6b8 | [
"MIT"
] | 1 | 2018-07-06T08:14:13.000Z | 2018-07-06T08:14:13.000Z | python/ccxt/braziliex.py | LeapM/ccxt | aeb07fc86991ce38a218c1199c6ae3bb5cfdf228 | [
"MIT"
] | null | null | null | python/ccxt/braziliex.py | LeapM/ccxt | aeb07fc86991ce38a218c1199c6ae3bb5cfdf228 | [
"MIT"
] | 2 | 2019-03-14T15:17:46.000Z | 2019-09-08T19:26:04.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ... | 36.688341 | 126 | 0.478885 |
ge import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InvalidOrder
class braziliex (Exchange):
def describe(self):
return self.deep_extend(super(braziliex, self).describe(), {
'... | true | true |
f7fbf44db0fbb7cca4e38afe57fb7a389fcd8330 | 9,358 | py | Python | src/Algorithms/PPO.py | fightZero/fightZero | 84c2f76c7dda31837d002e47cd74936044251079 | [
"MIT"
] | 1 | 2021-12-13T14:05:05.000Z | 2021-12-13T14:05:05.000Z | src/Algorithms/PPO.py | FightZero/FightZero | 84c2f76c7dda31837d002e47cd74936044251079 | [
"MIT"
] | null | null | null | src/Algorithms/PPO.py | FightZero/FightZero | 84c2f76c7dda31837d002e47cd74936044251079 | [
"MIT"
] | null | null | null | # an implementation of PPO algorithm
# reference to: https://github.com/nikhilbarhate99/PPO-PyTorch
import torch
import torch.nn as nn
from torch.optim import Adam, RMSprop
from torch.distributions import Categorical
from torch.utils.tensorboard.writer import SummaryWriter
from torch.utils.data import BatchSampler, Ran... | 37.88664 | 115 | 0.596495 |
import torch
import torch.nn as nn
from torch.optim import Adam, RMSprop
from torch.distributions import Categorical
from torch.utils.tensorboard.writer import SummaryWriter
from torch.utils.data import BatchSampler, RandomSampler
from typing import Tuple
class ActorCritic(nn.Module):
def __init__(self, state_d... | true | true |
f7fbf451f7ab0b316753c8ad61a542b73cbff82d | 14,904 | py | Python | processing_provider/Rast_fillRasterwithPatches.py | geodourados/lftools | 4b9d703513bd3d49ac7952014575bf95492a2d90 | [
"MIT"
] | 1 | 2022-03-28T22:18:09.000Z | 2022-03-28T22:18:09.000Z | processing_provider/Rast_fillRasterwithPatches.py | geodourados/lftools | 4b9d703513bd3d49ac7952014575bf95492a2d90 | [
"MIT"
] | null | null | null | processing_provider/Rast_fillRasterwithPatches.py | geodourados/lftools | 4b9d703513bd3d49ac7952014575bf95492a2d90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
fillRasterwithPatches.py
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Gene... | 41.51532 | 135 | 0.541063 |
__author__ = 'Leandro França'
__date__ = '2020-09-01'
__copyright__ = '(C) 2020, Leandro França'
from PyQt5.QtCore import QCoreApplication, QVariant
from qgis.core import (QgsProcessing,
QgsFeatureSink,
QgsWkbTypes,
QgsFields,
... | true | true |
f7fbf45acb2ddec84cefcc472333d7218aec52d7 | 4,101 | py | Python | examples/sprite_bullets.py | jgrigonis/arcade | 9b624da7da52e3909f6e82c552446b90249041f1 | [
"MIT"
] | 1 | 2021-05-23T20:30:46.000Z | 2021-05-23T20:30:46.000Z | examples/sprite_bullets.py | jgrigonis/arcade | 9b624da7da52e3909f6e82c552446b90249041f1 | [
"MIT"
] | null | null | null | examples/sprite_bullets.py | jgrigonis/arcade | 9b624da7da52e3909f6e82c552446b90249041f1 | [
"MIT"
] | null | null | null | """
Sprite Bullets
Simple program to show basic sprite usage.
Artwork from http://kenney.nl
"""
import random
import arcade
SPRITE_SCALING = 0.5
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
BULLET_SPEED = 5
class Bullet(arcade.Sprite):
def update(self):
self.center_y += BULLET_SPEED
class MyAppWindow(arc... | 27.709459 | 81 | 0.592295 | import random
import arcade
SPRITE_SCALING = 0.5
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
BULLET_SPEED = 5
class Bullet(arcade.Sprite):
def update(self):
self.center_y += BULLET_SPEED
class MyAppWindow(arcade.Window):
def __init__(self):
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, "Sprit... | true | true |
f7fbf4646ad2c439ae2469d60113cbf6f253c938 | 353 | py | Python | Chapter_6/3.py | sai29/Python-John-Zelle-book | b6c54120cfc4742fa651a051b39fc94bf221543d | [
"MIT"
] | 14 | 2015-01-20T15:02:13.000Z | 2020-05-20T08:05:37.000Z | Chapter_6/3.py | sai29/Python-John-Zelle-book | b6c54120cfc4742fa651a051b39fc94bf221543d | [
"MIT"
] | 1 | 2016-11-10T16:45:21.000Z | 2017-04-17T03:36:46.000Z | Chapter_6/3.py | sai29/Python-John-Zelle-book | b6c54120cfc4742fa651a051b39fc94bf221543d | [
"MIT"
] | 11 | 2015-01-06T18:46:15.000Z | 2020-04-02T03:45:53.000Z |
def sphereArea(radius):
area = 4 * 3.14 * (radius * radius)
return area
def sphereVolume(radius):
vol = (4 / 3) * (3.14 * (radius * radius))
return vol
def main():
rad = float(raw_input("Enter the value of the radius"))
area1 = sphereArea(rad)
volume = sphereVolume(rad)
print "The area is", area1
print "T... | 16.045455 | 56 | 0.654391 |
def sphereArea(radius):
area = 4 * 3.14 * (radius * radius)
return area
def sphereVolume(radius):
vol = (4 / 3) * (3.14 * (radius * radius))
return vol
def main():
rad = float(raw_input("Enter the value of the radius"))
area1 = sphereArea(rad)
volume = sphereVolume(rad)
print "The area is", area1
print "T... | false | true |
f7fbf537fa4a15e63fc1e463b4d6a8cdb7f53b03 | 3,380 | py | Python | revscoring/languages/tests/test_estonian.py | mariushoch/revscoring | 5ecd54d31c4088b6f142c0ef54116cc5bdce0ff2 | [
"MIT"
] | null | null | null | revscoring/languages/tests/test_estonian.py | mariushoch/revscoring | 5ecd54d31c4088b6f142c0ef54116cc5bdce0ff2 | [
"MIT"
] | null | null | null | revscoring/languages/tests/test_estonian.py | mariushoch/revscoring | 5ecd54d31c4088b6f142c0ef54116cc5bdce0ff2 | [
"MIT"
] | null | null | null | import pickle
from .. import estonian
from ...datasources import revision_oriented
from ...dependencies import solve
from .util import compare_extraction
BAD = [
"butt", "butthole",
"crap",
"cock",
"fag", "faggot", "phaggot", "faggg",
"fuck", "fucking", "fucker",
"homo", "homod", "homokas", "... | 27.258065 | 84 | 0.593195 | import pickle
from .. import estonian
from ...datasources import revision_oriented
from ...dependencies import solve
from .util import compare_extraction
BAD = [
"butt", "butthole",
"crap",
"cock",
"fag", "faggot", "phaggot", "faggg",
"fuck", "fucking", "fucker",
"homo", "homod", "homokas", "... | true | true |
f7fbf5c782016ffdc3a2611a220b499a8311f833 | 225 | py | Python | lifepo4weredPyController/helpers/SetHelper.py | fredericklussier/myLifepo4weredPy | a31479a50b630fd94105020159fd269a329de2bd | [
"MIT"
] | null | null | null | lifepo4weredPyController/helpers/SetHelper.py | fredericklussier/myLifepo4weredPy | a31479a50b630fd94105020159fd269a329de2bd | [
"MIT"
] | null | null | null | lifepo4weredPyController/helpers/SetHelper.py | fredericklussier/myLifepo4weredPy | a31479a50b630fd94105020159fd269a329de2bd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
def areSame(dict, dictToCompare):
if len(dict) != len(dictToCompare):
return False
else:
return (set() == (set(dict.items()) - set(dictToCompare.items())))
| 22.5 | 74 | 0.586667 |
def areSame(dict, dictToCompare):
if len(dict) != len(dictToCompare):
return False
else:
return (set() == (set(dict.items()) - set(dictToCompare.items())))
| true | true |
f7fbf5febaadcdf8549d6bccd8d324dfbc2150a5 | 4,951 | py | Python | sdk/python/pulumi_aws_native/customerprofiles/get_integration.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/customerprofiles/get_integration.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/customerprofiles/get_integration.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 37.793893 | 134 | 0.677641 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'GetIntegrationResult',
'AwaitableGetIntegrationResult',
'get_integration',
'get_integration_output',
]
@pulumi.outpu... | true | true |
f7fbf6f7dd6fbdb6d7896e22e918b16db8e7adef | 1,255 | py | Python | src/basic_classification/basic.py | asaladino/tf-playground | c188d29077334038b2ae3afefed950f1ebb94477 | [
"MIT"
] | null | null | null | src/basic_classification/basic.py | asaladino/tf-playground | c188d29077334038b2ae3afefed950f1ebb94477 | [
"MIT"
] | null | null | null | src/basic_classification/basic.py | asaladino/tf-playground | c188d29077334038b2ae3afefed950f1ebb94477 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
# TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
from basic_classification.helper import prediction_for_one_image
fashion_mnist = keras.datasets.fashion_mnist
# Load the data
(train_images, train_labels), (test_images, tes... | 35.857143 | 93 | 0.759363 | from __future__ import absolute_import, division, print_function
import tensorflow as tf
from tensorflow import keras
from basic_classification.helper import prediction_for_one_image
fashion_mnist = keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
cl... | true | true |
f7fbf76eba006d0a341e5e20f2bcdbdcb5a4ddde | 4,004 | py | Python | retrieve_news_data.py | aarshpatel/RecapMyDay | 7e6e148104ac425747123131a0dd4993d4220545 | [
"MIT"
] | null | null | null | retrieve_news_data.py | aarshpatel/RecapMyDay | 7e6e148104ac425747123131a0dd4993d4220545 | [
"MIT"
] | null | null | null | retrieve_news_data.py | aarshpatel/RecapMyDay | 7e6e148104ac425747123131a0dd4993d4220545 | [
"MIT"
] | null | null | null | import aylien_news_api
from aylien_news_api.rest import ApiException
import time
import pickle
from utils import *
import json
params = {
'language': ['en'],
'source_locations_country': ['US'],
'published_at_start': 'NOW-1DAYS',
'published_at_end': 'NOW',
'categories_taxonomy': 'iab-qag',
'sort... | 29.659259 | 125 | 0.68032 | import aylien_news_api
from aylien_news_api.rest import ApiException
import time
import pickle
from utils import *
import json
params = {
'language': ['en'],
'source_locations_country': ['US'],
'published_at_start': 'NOW-1DAYS',
'published_at_end': 'NOW',
'categories_taxonomy': 'iab-qag',
'sort... | false | true |
f7fbf85d06c907ff650c79d8d3f87dab917a39b8 | 5,964 | py | Python | train.py | free-city-of-ulm/Hashbrowns | 586e665b94a2d2221009f2602a10cc862a362895 | [
"MIT"
] | null | null | null | train.py | free-city-of-ulm/Hashbrowns | 586e665b94a2d2221009f2602a10cc862a362895 | [
"MIT"
] | null | null | null | train.py | free-city-of-ulm/Hashbrowns | 586e665b94a2d2221009f2602a10cc862a362895 | [
"MIT"
] | null | null | null | #!/bin/env python
from __future__ import print_function
import numpy as np
import tensorflow as tf
import argparse
import time
import os
from six.moves import cPickle
from rnn.utils import TextLoader
from rnn.model import Model
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--data_dir',... | 52.315789 | 147 | 0.611167 |
from __future__ import print_function
import numpy as np
import tensorflow as tf
import argparse
import time
import os
from six.moves import cPickle
from rnn.utils import TextLoader
from rnn.model import Model
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--data_dir', type=str, defaul... | true | true |
f7fbf897b66372ba08a4e061fd84692a3927efff | 2,831 | py | Python | hypernets/dispatchers/grpc/proto/predict_pb2_grpc.py | qigj/Hypernets | 534150e682f09df11ac3363e6aa7cd5e4a294c1d | [
"Apache-2.0"
] | 1 | 2020-11-06T07:52:14.000Z | 2020-11-06T07:52:14.000Z | hypernets/dispatchers/grpc/proto/predict_pb2_grpc.py | frankbaul/Hypernets | 534150e682f09df11ac3363e6aa7cd5e4a294c1d | [
"Apache-2.0"
] | null | null | null | hypernets/dispatchers/grpc/proto/predict_pb2_grpc.py | frankbaul/Hypernets | 534150e682f09df11ac3363e6aa7cd5e4a294c1d | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from hypernets.dispatchers.grpc.proto import predict_pb2 as hypernets_dot_dispatchers_dot_grpc_dot_proto_dot_predict__pb2
class PredictServiceStub(object):
... | 42.893939 | 136 | 0.7213 |
import grpc
from hypernets.dispatchers.grpc.proto import predict_pb2 as hypernets_dot_dispatchers_dot_grpc_dot_proto_dot_predict__pb2
class PredictServiceStub(object):
def __init__(self, channel):
self.predict = channel.unary_unary(
'/hypernets.dispatchers.proto.PredictService/predict',... | true | true |
f7fbf96348c87d410ce9ecef02e1e3092f5c23d9 | 2,916 | py | Python | tests/utilities/test_command_runner.py | cmontesano/xappt | 66f83fe53006dfd9c33b9d583dc1f0afcd2a8d26 | [
"MIT"
] | 2 | 2020-11-27T14:52:04.000Z | 2022-03-08T18:33:14.000Z | tests/utilities/test_command_runner.py | cmontesano/xappt | 66f83fe53006dfd9c33b9d583dc1f0afcd2a8d26 | [
"MIT"
] | 11 | 2021-07-04T00:37:45.000Z | 2021-10-04T17:07:56.000Z | tests/utilities/test_command_runner.py | cmontesano/xappt | 66f83fe53006dfd9c33b9d583dc1f0afcd2a8d26 | [
"MIT"
] | null | null | null | import os
import re
import unittest
from xappt.utilities import CommandRunner
from xappt.utilities import temporary_path
class TestCommandRunner(unittest.TestCase):
def test_basic_command(self):
with temporary_path() as tmp:
cmd = CommandRunner(cwd=tmp)
if os.name == "nt":
... | 38.368421 | 76 | 0.564129 | import os
import re
import unittest
from xappt.utilities import CommandRunner
from xappt.utilities import temporary_path
class TestCommandRunner(unittest.TestCase):
def test_basic_command(self):
with temporary_path() as tmp:
cmd = CommandRunner(cwd=tmp)
if os.name == "nt":
... | true | true |
f7fbfa42fc9f6923adfc89509e8e26b4247e7489 | 4,367 | py | Python | test/test_download_espa_order.py | cgaustin/bulk-downloader | 7c8bd16240ca65ac909e13638a7dc7afb4c0c3de | [
"Unlicense"
] | null | null | null | test/test_download_espa_order.py | cgaustin/bulk-downloader | 7c8bd16240ca65ac909e13638a7dc7afb4c0c3de | [
"Unlicense"
] | null | null | null | test/test_download_espa_order.py | cgaustin/bulk-downloader | 7c8bd16240ca65ac909e13638a7dc7afb4c0c3de | [
"Unlicense"
] | null | null | null | import os
import re
import unittest
from mock import patch
import download_espa_order as deo
import urllib
import requests
import requests_mock
class TestDownloadEspaOrder(unittest.TestCase):
def test_get_version(self):
ver = deo.get_version()
self.assertTrue(re.match("[0-9]{1}.[0-9]{1,2}.[0-9]{1... | 38.646018 | 146 | 0.640485 | import os
import re
import unittest
from mock import patch
import download_espa_order as deo
import urllib
import requests
import requests_mock
class TestDownloadEspaOrder(unittest.TestCase):
def test_get_version(self):
ver = deo.get_version()
self.assertTrue(re.match("[0-9]{1}.[0-9]{1,2}.[0-9]{1... | true | true |
f7fbfaf1e833620b5f09f7ca98374722712475f1 | 47,007 | py | Python | src/twisted/mail/test/test_pop3.py | clokep/twisted | 79a26b0aa4b1b81b46cc64d203644b35e455e46b | [
"Unlicense",
"MIT"
] | null | null | null | src/twisted/mail/test/test_pop3.py | clokep/twisted | 79a26b0aa4b1b81b46cc64d203644b35e455e46b | [
"Unlicense",
"MIT"
] | null | null | null | src/twisted/mail/test/test_pop3.py | clokep/twisted | 79a26b0aa4b1b81b46cc64d203644b35e455e46b | [
"Unlicense",
"MIT"
] | 1 | 2021-12-13T10:46:13.000Z | 2021-12-13T10:46:13.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Ltwisted.mail.pop3} module.
"""
import hmac
import base64
import itertools
from hashlib import md5
from collections import OrderedDict
from io import BytesIO
from zope.interface import implementer
from twisted import cred
f... | 28.080645 | 79 | 0.583381 |
import hmac
import base64
import itertools
from hashlib import md5
from collections import OrderedDict
from io import BytesIO
from zope.interface import implementer
from twisted import cred
from twisted import internet
from twisted import mail
from twisted.internet import defer
from twisted.mail import pop3
fro... | true | true |
f7fbfb511166364af3d606200d30680cfd63cfc2 | 675 | py | Python | nova/network/quantum/__init__.py | armaan/nova | 22859fccb95502efcb73ecf2bd827c45c0886bd3 | [
"Apache-2.0"
] | 1 | 2021-11-08T10:11:44.000Z | 2021-11-08T10:11:44.000Z | nova/network/quantum/__init__.py | armaan/nova | 22859fccb95502efcb73ecf2bd827c45c0886bd3 | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | nova/network/quantum/__init__.py | armaan/nova | 22859fccb95502efcb73ecf2bd827c45c0886bd3 | [
"Apache-2.0"
] | 2 | 2019-06-12T00:52:15.000Z | 2020-07-24T10:35:29.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks
# 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... | 39.705882 | 78 | 0.731852 | true | true | |
f7fbfccc6f21e4a7f82e7690279110bd1d673d81 | 3,462 | py | Python | codes/utils/logger.py | kingsj0405/Explorable-Super-Resolution | 6582477ec1e2b0c6f4bd781552ac880fabdb4496 | [
"Apache-2.0"
] | 54 | 2020-06-16T07:44:19.000Z | 2022-03-01T06:23:38.000Z | codes/utils/logger.py | kingsj0405/Explorable-Super-Resolution | 6582477ec1e2b0c6f4bd781552ac880fabdb4496 | [
"Apache-2.0"
] | 6 | 2020-07-01T08:59:24.000Z | 2021-02-22T19:58:23.000Z | codes/utils/logger.py | kingsj0405/Explorable-Super-Resolution | 6582477ec1e2b0c6f4bd781552ac880fabdb4496 | [
"Apache-2.0"
] | 11 | 2020-06-16T21:28:00.000Z | 2022-01-06T12:28:58.000Z | import os
import sys
from utils.util import get_timestamp
# print to file and std_out simultaneously
class PrintLogger(object):
def __init__(self, log_path):
self.terminal = sys.stdout
self.log = open(os.path.join(log_path, 'print_log.txt'), 'a')
def write(self, message):
self.termina... | 42.219512 | 176 | 0.554015 | import os
import sys
from utils.util import get_timestamp
class PrintLogger(object):
def __init__(self, log_path):
self.terminal = sys.stdout
self.log = open(os.path.join(log_path, 'print_log.txt'), 'a')
def write(self, message):
self.terminal.write(message)
self.log.write(me... | true | true |
f7fbfd64a6f56e1f41ed05c6bb641e2db24f156a | 7,108 | py | Python | var/spack/repos/builtin/packages/hip-rocclr/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/hip-rocclr/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/hip-rocclr/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 HipRocclr(CMakePackage):
"""Hip-ROCclr is a virtual device interface that compute... | 51.883212 | 123 | 0.68444 |
from spack.package import *
class HipRocclr(CMakePackage):
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr"
git = "https://github.com/ROCm-Developer-Tools/ROCclr.git"
maintainers = ['srekolam', 'arjun-raj-kuppala']
def url_for_version(self, version):
if versio... | true | true |
f7fbfde5f32671eeca378684439614939666ff7c | 6,849 | py | Python | python/smqtk/representation/key_value/__init__.py | cdeepakroy/SMQTK | ef5cec7399e9766f95ff06fe122471a51fc4b2d8 | [
"BSD-3-Clause"
] | null | null | null | python/smqtk/representation/key_value/__init__.py | cdeepakroy/SMQTK | ef5cec7399e9766f95ff06fe122471a51fc4b2d8 | [
"BSD-3-Clause"
] | null | null | null | python/smqtk/representation/key_value/__init__.py | cdeepakroy/SMQTK | ef5cec7399e9766f95ff06fe122471a51fc4b2d8 | [
"BSD-3-Clause"
] | null | null | null | """
Data abstraction interface for general key-value storage.
"""
import abc
import collections
import os
from smqtk.exceptions import ReadOnlyError
from smqtk.representation import SmqtkRepresentation
from smqtk.utils.plugin import Pluggable
NO_DEFAULT_VALUE = type("KeyValueStoreNoDefaultValueType", (object,), {})(... | 32.004673 | 80 | 0.64681 | import abc
import collections
import os
from smqtk.exceptions import ReadOnlyError
from smqtk.representation import SmqtkRepresentation
from smqtk.utils.plugin import Pluggable
NO_DEFAULT_VALUE = type("KeyValueStoreNoDefaultValueType", (object,), {})()
class KeyValueStore (SmqtkRepresentation, Pluggable):
... | true | true |
f7fc002869dcb55f0f4ad40430039ad2d1a1ba1e | 2,180 | py | Python | tests/run_basic_tests.py | ThibHlln/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | null | null | null | tests/run_basic_tests.py | ThibHlln/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | 2 | 2021-12-03T10:49:42.000Z | 2022-03-26T11:24:00.000Z | tests/run_basic_tests.py | unifhy-org/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | null | null | null | import unittest
import doctest
from tests.test_model import BasicTestModel
from tests.test_space import (
TestLatLonGridAPI, TestGridComparison
)
from tests.test_time import (
TestTimeDomainAPI, TestTimeDomainComparison
)
from tests.test_utils.test_clock import TestClock
import unifhy
class TestModelSameTime... | 31.594203 | 82 | 0.759174 | import unittest
import doctest
from tests.test_model import BasicTestModel
from tests.test_space import (
TestLatLonGridAPI, TestGridComparison
)
from tests.test_time import (
TestTimeDomainAPI, TestTimeDomainComparison
)
from tests.test_utils.test_clock import TestClock
import unifhy
class TestModelSameTime... | true | true |
f7fc003ccfc18d1cf5992acacf7a94974efb90c7 | 2,479 | py | Python | examples/ad_manager/v201905/activity_group_service/create_activity_groups.py | ale180192/googleads-python-lib | 783a2d40a49956fb16ed73280708f6f9e322aa09 | [
"Apache-2.0"
] | 1 | 2019-09-30T06:36:07.000Z | 2019-09-30T06:36:07.000Z | examples/ad_manager/v201905/activity_group_service/create_activity_groups.py | ale180192/googleads-python-lib | 783a2d40a49956fb16ed73280708f6f9e322aa09 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201905/activity_group_service/create_activity_groups.py | ale180192/googleads-python-lib | 783a2d40a49956fb16ed73280708f6f9e322aa09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 34.430556 | 78 | 0.734167 |
import uuid
from googleads import ad_manager
ADVERTISER_COMPANY_ID = 'INSERT_ADVERTISER_COMPANY_ID_HERE'
def main(client, advertiser_company_id):
activity_group_service = client.GetService('ActivityGroupService',
version='v201905')
short_te... | true | true |
f7fc00cad765d312ab428e5d68895bb8a38dd4bc | 2,702 | py | Python | scons/scons-local-2.3.3/SCons/Tool/latex.py | pedrishi/pdb2pqr_pypka | 74f64948658d021a8bfc8fd78936ce4186ffc88e | [
"BSD-3-Clause"
] | null | null | null | scons/scons-local-2.3.3/SCons/Tool/latex.py | pedrishi/pdb2pqr_pypka | 74f64948658d021a8bfc8fd78936ce4186ffc88e | [
"BSD-3-Clause"
] | null | null | null | scons/scons-local-2.3.3/SCons/Tool/latex.py | pedrishi/pdb2pqr_pypka | 74f64948658d021a8bfc8fd78936ce4186ffc88e | [
"BSD-3-Clause"
] | null | null | null | """SCons.Tool.latex
Tool-specific initialization for LaTeX.
Generates .dvi files from .latex or .ltx files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#... | 33.358025 | 101 | 0.746484 |
__revision__ = "src/engine/SCons/Tool/latex.py 2014/08/24 12:12:31 garyo"
import SCons.Action
import SCons.Defaults
import SCons.Scanner.LaTeX
import SCons.Util
import SCons.Tool
import SCons.Tool.tex
def LaTeXAuxFunction(target = None, source= None, env=None):
result = SCons.Tool.tex.Int... | true | true |
f7fc01ffda0a4346bc1fd593b9c49641adc3b38c | 159 | py | Python | python/testData/quickdoc/ParamDescriptionEpytext.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/quickdoc/ParamDescriptionEpytext.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/quickdoc/ParamDescriptionEpytext.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def fu<the_ref>nc(param1, param2):
"""
@param param1: param1 description
@param param2: param2 description
@return: return description
""" | 22.714286 | 37 | 0.660377 | def fu<the_ref>nc(param1, param2):
"""
@param param1: param1 description
@param param2: param2 description
@return: return description
""" | false | true |
f7fc02aace6b8758a9c0c84593adbea465bf3abc | 25,325 | py | Python | scripts/sct_compute_hausdorff_distance.py | valosekj/spinalcordtoolbox | 266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09 | [
"MIT"
] | 1 | 2020-05-17T00:39:47.000Z | 2020-05-17T00:39:47.000Z | scripts/sct_compute_hausdorff_distance.py | valosekj/spinalcordtoolbox | 266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09 | [
"MIT"
] | null | null | null | scripts/sct_compute_hausdorff_distance.py | valosekj/spinalcordtoolbox | 266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Thinning with the Zhang-Suen algorithm (1984) --> code taken from https://github.com/linbojin/Skeletonization-by-Zhang-Suen-Thinning-Algorithm
# Computation of the distances between two skeleton
# ---------------------------------------------------------------------------------------
# Copyri... | 44.664903 | 191 | 0.519013 |
4, P5, P6, P7, P8, P9 = n = self.get_neighbours(x, y, image_thinned)
if (2 <= sum(n) <= 6 and # Condition 1: 2<= N(P1) <= 6
P2 * P4 * P6 == 0 and # Condition 3
P4 * P6 * P8 == 0 and # Condition 4
self.transitio... | true | true |
f7fc04972085df58b6a79a56d269a65b319308c8 | 1,962 | py | Python | pypy/translator/backendopt/finalizer.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/translator/backendopt/finalizer.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/translator/backendopt/finalizer.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null |
from pypy.translator.backendopt import graphanalyze
from pypy.rpython.lltypesystem import lltype
class FinalizerError(Exception):
""" __del__ marked as lightweight finalizer, but the analyzer did
not agree
"""
class FinalizerAnalyzer(graphanalyze.BoolGraphAnalyzer):
""" Analyzer that determines wheth... | 41.744681 | 74 | 0.639144 |
from pypy.translator.backendopt import graphanalyze
from pypy.rpython.lltypesystem import lltype
class FinalizerError(Exception):
class FinalizerAnalyzer(graphanalyze.BoolGraphAnalyzer):
ok_operations = ['ptr_nonzero', 'ptr_eq', 'ptr_ne', 'free', 'same_as',
'direct_ptradd', 'force_cast', 'tr... | true | true |
f7fc04a584104a02421e2372f31da54c51ab2304 | 5,333 | py | Python | text_utils/segmenter/state.py | numb3r3/text_utils | 5ec4d0f28117c30a65e516381b4f182aa6add663 | [
"Apache-2.0"
] | 4 | 2020-02-22T08:13:41.000Z | 2021-06-18T06:52:30.000Z | text_utils/segmenter/state.py | numb3r3/text_utils | 5ec4d0f28117c30a65e516381b4f182aa6add663 | [
"Apache-2.0"
] | null | null | null | text_utils/segmenter/state.py | numb3r3/text_utils | 5ec4d0f28117c30a65e516381b4f182aa6add663 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from .sign import SPLIT_SIGN, SOFTEN_SPLIT_SIGN
from .context import Context
from ..utils import is_chinese
class ContextState(object):
def execute(self, context):
pass
class CharCheckContextState(ContextState):
def execute(self, context):
global CONTEXT_STATE_MANAGER
... | 37.034722 | 86 | 0.651791 |
from .sign import SPLIT_SIGN, SOFTEN_SPLIT_SIGN
from .context import Context
from ..utils import is_chinese
class ContextState(object):
def execute(self, context):
pass
class CharCheckContextState(ContextState):
def execute(self, context):
global CONTEXT_STATE_MANAGER
current_c... | true | true |
f7fc050606a7847918cef647e3efe9ceab83e11e | 619 | py | Python | site/brooks/migrations/__init__.py | ivco19/dashboard | f4f6ff6002295556007220660224c5d2ab4f0c06 | [
"BSD-3-Clause"
] | 4 | 2020-03-31T21:35:59.000Z | 2020-10-13T00:44:53.000Z | site/brooks/migrations/__init__.py | ivco19/dashboard | f4f6ff6002295556007220660224c5d2ab4f0c06 | [
"BSD-3-Clause"
] | 8 | 2020-03-21T18:19:17.000Z | 2020-04-29T18:04:54.000Z | site/brooks/migrations/__init__.py | ivco19/dashboard | f4f6ff6002295556007220660224c5d2ab4f0c06 | [
"BSD-3-Clause"
] | 1 | 2020-04-18T15:58:07.000Z | 2020-04-18T15:58:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Arcovid-19 Brooks.
# Copyright (c) 2020, Juan B Cabral, Vanessa Daza, Diego García Lambas,
# Marcelo Lares, Nadia Luczywo, Dante Paz, Rodrigo Quiroga,
# Bruno Sanchez, Federico Stasyszyn.
# License: BSD-3-Claus... | 32.578947 | 79 | 0.484653 | true | true | |
f7fc05070cb07528f70cc3e3289796e7da95ca69 | 1,094 | py | Python | FrequencyAnalysis.py | adeloucas/GSoC-Akkadian | 65dc1ccc215ef353533c4d3f361910e489b89346 | [
"MIT"
] | 5 | 2018-04-25T00:00:24.000Z | 2020-07-16T08:06:54.000Z | FrequencyAnalysis.py | adeloucas/GSoC-Akkadian | 65dc1ccc215ef353533c4d3f361910e489b89346 | [
"MIT"
] | 44 | 2018-06-08T18:43:13.000Z | 2019-07-29T18:42:12.000Z | FrequencyAnalysis.py | adeloucas/GSoC-Akkadian | 65dc1ccc215ef353533c4d3f361910e489b89346 | [
"MIT"
] | null | null | null | from collections import Counter
from Importer.file_importer import FileImport
from Importer.cdli_corpus import CDLICorpus
from ATFConverter.tokenizer import Tokenizer
from ATFConverter.atf_converter import ATFConverter
fi = FileImport('texts/Akkadian.txt')
fi.read_file()
cc = CDLICorpus()
cc.parse_file(fi.file_lines)... | 37.724138 | 74 | 0.606033 | from collections import Counter
from Importer.file_importer import FileImport
from Importer.cdli_corpus import CDLICorpus
from ATFConverter.tokenizer import Tokenizer
from ATFConverter.atf_converter import ATFConverter
fi = FileImport('texts/Akkadian.txt')
fi.read_file()
cc = CDLICorpus()
cc.parse_file(fi.file_lines)... | true | true |
f7fc05141269060be2d12868ee0e12989775825b | 2,075 | py | Python | tests/test_articles.py | JECINTA534521/News-Highligts-project | 00634f8eb0fc972d28f1ec911b83fbdea838ebd5 | [
"Unlicense"
] | null | null | null | tests/test_articles.py | JECINTA534521/News-Highligts-project | 00634f8eb0fc972d28f1ec911b83fbdea838ebd5 | [
"Unlicense"
] | null | null | null | tests/test_articles.py | JECINTA534521/News-Highligts-project | 00634f8eb0fc972d28f1ec911b83fbdea838ebd5 | [
"Unlicense"
] | null | null | null | import unittest
from app.models import Articles
class ArticleTest(unittest.TestCase):
'''
Test class to test behaviours of the Article class
Args:
unittest.TestCase : Test case class that helps create test cases
'''
def setUp(self):
'''
Set up method to run before each tes... | 44.148936 | 382 | 0.701205 | import unittest
from app.models import Articles
class ArticleTest(unittest.TestCase):
'''
Test class to test behaviours of the Article class
Args:
unittest.TestCase : Test case class that helps create test cases
'''
def setUp(self):
'''
Set up method to run before each tes... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.