hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4030e385e2e10be1ee444a3a75529c03c39c75 | 182 | py | Python | om.metaL.py | ponyatov/om | e972b566537dd168e506a3a42f2fb10c5f697c17 | [
"MIT"
] | null | null | null | om.metaL.py | ponyatov/om | e972b566537dd168e506a3a42f2fb10c5f697c17 | [
"MIT"
] | null | null | null | om.metaL.py | ponyatov/om | e972b566537dd168e506a3a42f2fb10c5f697c17 | [
"MIT"
] | null | null | null | ## @file
## @brief meta: Object Memory (Smalltalk-like)
from metaL import *
p = Project(
title='''Object Memory (Smalltalk-like)''',
about='''''') \
| Rust()
p.sync()
| 15.166667 | 47 | 0.576923 |
from metaL import *
p = Project(
title='''Object Memory (Smalltalk-like)''',
about='''''') \
| Rust()
p.sync()
| true | true |
1c4030fea59d53e9d76e40551c3902b116fe92cb | 212 | py | Python | hard-gists/1943426/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/1943426/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/1943426/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | from django.template.loader import add_to_builtins
add_to_builtins('django.contrib.staticfiles.templatetags.staticfiles')
add_to_builtins('django.templatetags.i18n')
add_to_builtins('django.templatetags.future')
| 42.4 | 70 | 0.863208 | from django.template.loader import add_to_builtins
add_to_builtins('django.contrib.staticfiles.templatetags.staticfiles')
add_to_builtins('django.templatetags.i18n')
add_to_builtins('django.templatetags.future')
| true | true |
1c4031fbd2d9af86d329c35827ec5a14f555759a | 5,152 | py | Python | beer/harvester/harvester.py | petrus-hanks/flax-blockchain | 6e180dc84ca24c757555c9947f44bd724b1af3eb | [
"Apache-2.0"
] | null | null | null | beer/harvester/harvester.py | petrus-hanks/flax-blockchain | 6e180dc84ca24c757555c9947f44bd724b1af3eb | [
"Apache-2.0"
] | null | null | null | beer/harvester/harvester.py | petrus-hanks/flax-blockchain | 6e180dc84ca24c757555c9947f44bd724b1af3eb | [
"Apache-2.0"
] | null | null | null | import asyncio
import concurrent
import logging
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple
from blspy import G1Element
import beer.server.ws_connection as ws # lgtm [py/import-and-import-from]
from beer.consensus.con... | 35.287671 | 108 | 0.650427 | import asyncio
import concurrent
import logging
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple
from blspy import G1Element
import beer.server.ws_connection as ws from beer.consensus.constants import ConsensusConstants
fr... | true | true |
1c403211e74cfa993b839c5d9ed606a973736e18 | 57,718 | py | Python | test/functional/feature_block.py | TransFastCore/pivx533 | b2168d6c2b447c9bf9c7175ffdfc8342b2861179 | [
"MIT"
] | 15 | 2019-08-28T13:34:30.000Z | 2021-12-15T22:01:08.000Z | test/functional/feature_block.py | TransFastCore/pivx533 | b2168d6c2b447c9bf9c7175ffdfc8342b2861179 | [
"MIT"
] | 9 | 2019-07-17T22:42:46.000Z | 2022-03-02T12:41:27.000Z | test/functional/feature_block.py | TransFastCore/pivx533 | b2168d6c2b447c9bf9c7175ffdfc8342b2861179 | [
"MIT"
] | 13 | 2019-06-30T22:44:30.000Z | 2022-02-19T16:07:54.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2021 The Bitcoin Core developers
# Copyright (c) 2020-2021 The TrumpCoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing."""
import copy
import struct... | 45.662975 | 161 | 0.574535 |
import copy
import struct
import time
from test_framework.blocktools import create_block, create_coinbase, create_transaction, get_legacy_sigopcount_block
from test_framework.key import CECKey
from test_framework.messages import (
CBlock,
COIN,
COutPoint,
CTransaction,
CTxIn,
CTxOut,
MAX_B... | true | true |
1c403246a49c98f7fe3edc9d3278aaa3b9b09ed4 | 5,973 | py | Python | sdks/python/apache_beam/testing/test_utils.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/testing/test_utils.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/testing/test_utils.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 29.865 | 78 | 0.729784 |
from __future__ import absolute_import
import hashlib
import imp
import os
import shutil
import tempfile
from builtins import object
from mock import Mock
from mock import patch
from apache_beam.io.filesystems import FileSystems
from apache_beam.utils import retry
DEFAULT_HASHING_ALG = 'sha1'
class TempDir(obj... | true | true |
1c4032ade22a1b70e4e3c0cd00453e5ed6e4717d | 596 | py | Python | test/animatedledstrip/test_animation_info.py | AnimatedLEDStrip/client-python | 0502b1b70faf6ce9b9ff7b53ee4740372fccb4c3 | [
"MIT"
] | null | null | null | test/animatedledstrip/test_animation_info.py | AnimatedLEDStrip/client-python | 0502b1b70faf6ce9b9ff7b53ee4740372fccb4c3 | [
"MIT"
] | null | null | null | test/animatedledstrip/test_animation_info.py | AnimatedLEDStrip/client-python | 0502b1b70faf6ce9b9ff7b53ee4740372fccb4c3 | [
"MIT"
] | null | null | null | from animatedledstrip import AnimationInfo
def test_constructor():
info = AnimationInfo()
assert info.name == ''
assert info.abbr == ''
assert info.description == ''
assert info.run_count_default == 0
assert info.minimum_colors == 0
assert info.unlimited_colors is False
assert info.di... | 28.380952 | 42 | 0.671141 | from animatedledstrip import AnimationInfo
def test_constructor():
info = AnimationInfo()
assert info.name == ''
assert info.abbr == ''
assert info.description == ''
assert info.run_count_default == 0
assert info.minimum_colors == 0
assert info.unlimited_colors is False
assert info.di... | true | true |
1c4034ad05f99a26315901a18c8f402d5fa64c10 | 10,357 | py | Python | tools/manifest/item.py | kosta111121/wpt | a9e454c8001472320dc3f049f6180427256a44dc | [
"BSD-3-Clause"
] | 1 | 2019-12-16T19:31:40.000Z | 2019-12-16T19:31:40.000Z | tools/manifest/item.py | kosta111121/wpt | a9e454c8001472320dc3f049f6180427256a44dc | [
"BSD-3-Clause"
] | null | null | null | tools/manifest/item.py | kosta111121/wpt | a9e454c8001472320dc3f049f6180427256a44dc | [
"BSD-3-Clause"
] | null | null | null | from copy import copy
from inspect import isabstract
from six import iteritems, with_metaclass
from six.moves.urllib.parse import urljoin, urlparse
from abc import ABCMeta, abstractproperty
from .utils import to_os_path
MYPY = False
if MYPY:
# MYPY is set to True when run under Mypy.
from typing import Option... | 27.991892 | 117 | 0.552283 | from copy import copy
from inspect import isabstract
from six import iteritems, with_metaclass
from six.moves.urllib.parse import urljoin, urlparse
from abc import ABCMeta, abstractproperty
from .utils import to_os_path
MYPY = False
if MYPY:
from typing import Optional
from typing import Text
from typ... | true | true |
1c40351ffa2ec866a11e9370d900bba8e95acb5e | 4,998 | py | Python | tdvt/tdvt/tabquery.py | tabBhargav/connector-plugin-sdk | 3a78d519c502260c6aa37654215dc0e8b6b93931 | [
"MIT"
] | 80 | 2018-10-26T15:08:25.000Z | 2022-03-29T04:44:53.000Z | tdvt/tdvt/tabquery.py | tabBhargav/connector-plugin-sdk | 3a78d519c502260c6aa37654215dc0e8b6b93931 | [
"MIT"
] | 531 | 2018-10-26T14:17:10.000Z | 2022-03-31T23:24:29.000Z | tdvt/tdvt/tabquery.py | tabBhargav/connector-plugin-sdk | 3a78d519c502260c6aa37654215dc0e8b6b93931 | [
"MIT"
] | 85 | 2018-11-28T23:37:27.000Z | 2022-03-31T21:01:27.000Z | import configparser
import os
import sys
from .resources import *
from .tabquery_path import TabQueryPath
tab_cli_exe = ''
def configure_tabquery_path():
"""Setup the tabquery path from ini settings."""
global tab_cli_exe
if os.environ.get('TABQUERY_CLI_PATH'):
tab_cli_exe = os.environ.get('TABQ... | 39.046875 | 151 | 0.690876 | import configparser
import os
import sys
from .resources import *
from .tabquery_path import TabQueryPath
tab_cli_exe = ''
def configure_tabquery_path():
global tab_cli_exe
if os.environ.get('TABQUERY_CLI_PATH'):
tab_cli_exe = os.environ.get('TABQUERY_CLI_PATH')
logging.info(
"Ta... | true | true |
1c4036521e3762da652af83b989980f4698545e6 | 160 | py | Python | _setup.py | reverendbedford/scikit-fem | bc57d968e56e6b89a99e35eac26ef7bc81b7a46a | [
"BSD-3-Clause"
] | 238 | 2018-01-28T11:11:55.000Z | 2022-03-31T15:13:52.000Z | _setup.py | reverendbedford/scikit-fem | bc57d968e56e6b89a99e35eac26ef7bc81b7a46a | [
"BSD-3-Clause"
] | 559 | 2018-04-13T09:06:49.000Z | 2022-03-22T12:59:25.000Z | _setup.py | reverendbedford/scikit-fem | bc57d968e56e6b89a99e35eac26ef7bc81b7a46a | [
"BSD-3-Clause"
] | 50 | 2018-04-13T07:02:28.000Z | 2022-03-24T18:01:22.000Z | from setuptools import setup
setup(
name='scikit-fem',
version='0.1.0.dev0',
install_requires=['numpy', 'scipy', 'matplotlib', 'meshio>=4.0.4'],
)
| 20 | 71 | 0.6375 | from setuptools import setup
setup(
name='scikit-fem',
version='0.1.0.dev0',
install_requires=['numpy', 'scipy', 'matplotlib', 'meshio>=4.0.4'],
)
| true | true |
1c4038d7593ed0769c4d455116cc1ffe6c117b27 | 614 | py | Python | catalog/forms.py | choia/django-library-tutorial | a44fd078b6188bed095b7246316b3bc6ff696dd1 | [
"MIT"
] | null | null | null | catalog/forms.py | choia/django-library-tutorial | a44fd078b6188bed095b7246316b3bc6ff696dd1 | [
"MIT"
] | null | null | null | catalog/forms.py | choia/django-library-tutorial | a44fd078b6188bed095b7246316b3bc6ff696dd1 | [
"MIT"
] | null | null | null | from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from datetime import date, timedelta
from django import forms
class RenewBookForm(forms.Form):
renewal_date = forms.DateField(help_text="Enter a date between today and 4 weeks (default 3).")
def clean_renewal... | 32.315789 | 96 | 0.760586 | from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from datetime import date, timedelta
from django import forms
class RenewBookForm(forms.Form):
renewal_date = forms.DateField(help_text="Enter a date between today and 4 weeks (default 3).")
def clean_renewal... | true | true |
1c4038f05efa89ab152a2e6b15a13fa3a2742bfb | 66,095 | py | Python | oscar/lib/python2.7/site-packages/whoosh/searching.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/whoosh/searching.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/whoosh/searching.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions a... | 39.960701 | 83 | 0.60696 |
from __future__ import division
import copy
import weakref
from math import ceil
from whoosh import classify, highlight, query, scoring
from whoosh.compat import iteritems, itervalues, iterkeys, xrange
from whoosh.idsets import DocIdSet, BitSet
from whoosh.reading import TermNotFound
from whoosh.util.ca... | true | true |
1c40391a980152fa9fcf2a8aea56d280ba128f52 | 1,813 | py | Python | jenni/utils.py | synamedia-jenni/Jenni | 44a25453d3f7dc08ca22f75b4d817dfa5c141904 | [
"Apache-2.0"
] | 2 | 2021-05-11T15:47:52.000Z | 2021-06-24T21:55:04.000Z | jenni/utils.py | synamedia-jenni/Jenni | 44a25453d3f7dc08ca22f75b4d817dfa5c141904 | [
"Apache-2.0"
] | 2 | 2021-05-19T07:24:41.000Z | 2021-06-24T21:54:19.000Z | jenni/utils.py | synamedia-jenni/Jenni | 44a25453d3f7dc08ca22f75b4d817dfa5c141904 | [
"Apache-2.0"
] | 1 | 2021-05-14T10:37:53.000Z | 2021-05-14T10:37:53.000Z | from html import escape
from typing import List
from textwrap import dedent
def bool2groovy(b: bool) -> str:
return "true" if b else "false"
def groovy_string_list(l: List[str]) -> str:
if l:
return ", ".join([quote1or3xs(s) for s in l])
else:
return ""
def tidy_text(s: str) -> str:
... | 22.6625 | 73 | 0.529509 | from html import escape
from typing import List
from textwrap import dedent
def bool2groovy(b: bool) -> str:
return "true" if b else "false"
def groovy_string_list(l: List[str]) -> str:
if l:
return ", ".join([quote1or3xs(s) for s in l])
else:
return ""
def tidy_text(s: str) -> str:
... | true | true |
1c403949edbafeb3dc3e1894d723f59918cf2de8 | 3,210 | py | Python | main.py | JDKdevStudio/GraficadorFunciones | e8505b47f80fbd189b1825537cdd115859b980d4 | [
"CC0-1.0"
] | null | null | null | main.py | JDKdevStudio/GraficadorFunciones | e8505b47f80fbd189b1825537cdd115859b980d4 | [
"CC0-1.0"
] | null | null | null | main.py | JDKdevStudio/GraficadorFunciones | e8505b47f80fbd189b1825537cdd115859b980d4 | [
"CC0-1.0"
] | null | null | null | # Importar librerías
import tkinter
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib import style
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
from tkinter import messagebox
... | 27.672414 | 105 | 0.626791 | import tkinter
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib import style
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
from tkinter import messagebox
from math import *
... | true | true |
1c403be0633980d1b0fb1e4f024a208cb83a7afa | 86 | py | Python | src/ShapeTemplate/Field.py | DaDudek/Tetris | b3848132fd315e883e714e1882ec4bfd38b890e1 | [
"MIT"
] | 2 | 2022-01-16T20:44:08.000Z | 2022-01-18T13:41:32.000Z | src/ShapeTemplate/Field.py | DaDudek/Tetris | b3848132fd315e883e714e1882ec4bfd38b890e1 | [
"MIT"
] | null | null | null | src/ShapeTemplate/Field.py | DaDudek/Tetris | b3848132fd315e883e714e1882ec4bfd38b890e1 | [
"MIT"
] | null | null | null | class Field:
def __init__(self, isFill: bool):
self.isFill: bool = isFill
| 21.5 | 37 | 0.639535 | class Field:
def __init__(self, isFill: bool):
self.isFill: bool = isFill
| true | true |
1c403c61d6391010474c94d303ed009feb41ce0f | 1,575 | py | Python | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/test/test_context.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/test/test_context.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 1 | 2020-03-06T04:49:42.000Z | 2020-03-06T04:49:42.000Z | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/test/test_context.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.context}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import SynchronousTestCase
from twisted.python import context
class ContextTest(SynchronousTestCase):
"... | 30.288462 | 81 | 0.620317 |
from __future__ import division, absolute_import
from twisted.trial.unittest import SynchronousTestCase
from twisted.python import context
class ContextTest(SynchronousTestCase):
def test_notPresentIfNotSet(self):
self.assertEqual(context.get("x"), None)
def test_setByCall(self):
... | true | true |
1c403df1f61deb78c19aa7ef3027eb475fa15a29 | 6,187 | py | Python | telemetry/telemetry/internal/platform/tracing_agent/cpu_tracing_agent_unittest.py | tdresser/catapult-csm | 8f69b07e80198c1af0d5bd368d8ad8ced968884a | [
"BSD-3-Clause"
] | 4 | 2017-12-29T03:17:40.000Z | 2021-07-04T03:28:11.000Z | telemetry/telemetry/internal/platform/tracing_agent/cpu_tracing_agent_unittest.py | tdresser/catapult-csm | 8f69b07e80198c1af0d5bd368d8ad8ced968884a | [
"BSD-3-Clause"
] | 1 | 2021-08-13T18:39:43.000Z | 2021-08-13T18:39:43.000Z | telemetry/telemetry/internal/platform/tracing_agent/cpu_tracing_agent_unittest.py | tdresser/catapult-csm | 8f69b07e80198c1af0d5bd368d8ad8ced968884a | [
"BSD-3-Clause"
] | 6 | 2017-12-05T07:15:08.000Z | 2021-07-04T03:28:13.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import time
import unittest
from telemetry import decorators
from telemetry.internal.platform.tracing_agent import cpu_tracing_agent
from telemetr... | 38.66875 | 78 | 0.737353 | import sys
import time
import unittest
from telemetry import decorators
from telemetry.internal.platform.tracing_agent import cpu_tracing_agent
from telemetry.internal.platform import tracing_agent
from telemetry.internal.platform import linux_platform_backend
from telemetry.internal.platform import mac_platform_backe... | true | true |
1c403e410b2f69d84e79c61035f85fe8687ac95e | 2,162 | py | Python | models/user.py | Leaniz/gordologo | fcd8b8a3bfea1fb6e597dfd1701884ddd07db107 | [
"MIT"
] | 1 | 2021-08-03T20:06:42.000Z | 2021-08-03T20:06:42.000Z | models/user.py | Leaniz/gordologo | fcd8b8a3bfea1fb6e597dfd1701884ddd07db107 | [
"MIT"
] | null | null | null | models/user.py | Leaniz/gordologo | fcd8b8a3bfea1fb6e597dfd1701884ddd07db107 | [
"MIT"
] | null | null | null | from elasticsearch import Elasticsearch
class UserModel:
elast = Elasticsearch('localhost', port=9200)
elast_idx = "gordologo-users"
def __init__(self, _id, username, email, password_hash):
self.id = _id
self.username = username
self.email = email
self.password_hash = pass... | 27.717949 | 64 | 0.440796 | from elasticsearch import Elasticsearch
class UserModel:
elast = Elasticsearch('localhost', port=9200)
elast_idx = "gordologo-users"
def __init__(self, _id, username, email, password_hash):
self.id = _id
self.username = username
self.email = email
self.password_hash = pass... | true | true |
1c403e61eae75de53b3c4cc91917228410ca239f | 552 | py | Python | rldb/db/paper__dqn2013/algo__dqn2013/__init__.py | seungjaeryanlee/sotarl | 8c471c4666d6210c68f3cb468e439a2b168c785d | [
"MIT"
] | 45 | 2019-05-13T17:39:33.000Z | 2022-03-07T23:44:13.000Z | rldb/db/paper__dqn2013/algo__dqn2013/__init__.py | seungjaeryanlee/sotarl | 8c471c4666d6210c68f3cb468e439a2b168c785d | [
"MIT"
] | 2 | 2019-03-29T01:41:59.000Z | 2019-07-02T02:48:31.000Z | rldb/db/paper__dqn2013/algo__dqn2013/__init__.py | seungjaeryanlee/sotarl | 8c471c4666d6210c68f3cb468e439a2b168c785d | [
"MIT"
] | 2 | 2020-04-07T20:57:30.000Z | 2020-07-08T12:55:15.000Z | """
DQN2013 scores from DQN2013 paper.
7 entries
------------------------------------------------------------------------
7 unique entries
"""
from .entries import entries
# Specify ALGORITHM
algo = {
# ALGORITHM
"algo-title": "Deep Q-Network (2013)",
"algo-nickname": "DQN2013",
"algo-source-title... | 20.444444 | 74 | 0.576087 | from .entries import entries
algo = {
"algo-title": "Deep Q-Network (2013)",
"algo-nickname": "DQN2013",
"algo-source-title": "Playing Atari with Deep Reinforcement Learning",
"algo-frames": 10 * 1000 * 1000, }
entries = [{**entry, **algo} for entry in entries]
assert len(entries) == 7
| true | true |
1c403ee9a8c848544a66cf3a4bc06b9e8cb3cbcb | 3,568 | py | Python | cinder/volume/drivers/huawei/huawei_utils.py | whitepages/cinder | bd70ce6f4dd58ba904a7c941700cdce54e5a705e | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/huawei/huawei_utils.py | whitepages/cinder | bd70ce6f4dd58ba904a7c941700cdce54e5a705e | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:29.000Z | 2021-03-21T11:38:29.000Z | cinder/volume/drivers/huawei/huawei_utils.py | isabella232/cinder | bd70ce6f4dd58ba904a7c941700cdce54e5a705e | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:47.000Z | 2021-03-21T11:37:47.000Z | # Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#
# ... | 29.245902 | 78 | 0.681614 |
import base64
import json
import six
import time
import uuid
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_utils import units
from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder.volume.drivers.huawei import constants
LOG = logging.getLog... | true | true |
1c40402432cf3ee52f098bce63ed42d524eccb02 | 1,175 | py | Python | products/pubsub/helpers/python/provider_subscription.py | btorresgil/magic-modules | f1a5e5ac9f921c3122466d153d3b99ad45e24a4f | [
"Apache-2.0"
] | 1 | 2019-10-23T06:16:05.000Z | 2019-10-23T06:16:05.000Z | products/pubsub/helpers/python/provider_subscription.py | btorresgil/magic-modules | f1a5e5ac9f921c3122466d153d3b99ad45e24a4f | [
"Apache-2.0"
] | 65 | 2019-06-30T00:26:56.000Z | 2019-12-04T05:23:56.000Z | products/pubsub/helpers/python/provider_subscription.py | btorresgil/magic-modules | f1a5e5ac9f921c3122466d153d3b99ad45e24a4f | [
"Apache-2.0"
] | 5 | 2019-03-12T02:11:18.000Z | 2019-10-23T06:16:08.000Z | # Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 37.903226 | 92 | 0.662128 |
def decode_request(response, module):
if 'name' in response:
response['name'] = response['name'].split('/')[-1]
if 'topic' in response:
response['topic'] = response['topic'].split('/')[-1]
return response
def encode_request(request, module):
request['topic'] = '/'.join(['projects', ... | true | true |
1c40419f0bf533355ac9e1b0ad221b90295e7c6b | 46,268 | py | Python | zerver/tests/test_realm.py | sa2c/zulip | a00d911ed1071e6a8bbaa17d8df9e96115973588 | [
"Apache-2.0"
] | 1 | 2021-05-15T00:44:42.000Z | 2021-05-15T00:44:42.000Z | zerver/tests/test_realm.py | sa2c/zulip | a00d911ed1071e6a8bbaa17d8df9e96115973588 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_realm.py | sa2c/zulip | a00d911ed1071e6a8bbaa17d8df9e96115973588 | [
"Apache-2.0"
] | null | null | null | import datetime
import re
from typing import Any, Dict, List, Mapping, Union
from unittest import mock
import orjson
from django.conf import settings
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.actions import (
do_add_deactivated_redirect,
do_change_plan_type,
do... | 43.731569 | 100 | 0.671285 | import datetime
import re
from typing import Any, Dict, List, Mapping, Union
from unittest import mock
import orjson
from django.conf import settings
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.actions import (
do_add_deactivated_redirect,
do_change_plan_type,
do... | true | true |
1c40421ca57f259b646740244643e36fd23b79df | 2,420 | py | Python | predico/predicates.py | pauleveritt/predico | 2bbf88a7775d31907d2229a32a89490172acd988 | [
"Apache-2.0"
] | null | null | null | predico/predicates.py | pauleveritt/predico | 2bbf88a7775d31907d2229a32a89490172acd988 | [
"Apache-2.0"
] | null | null | null | predico/predicates.py | pauleveritt/predico | 2bbf88a7775d31907d2229a32a89490172acd988 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Type, Any, Optional
from predico.services.request.base_request import Request
from predico.services.resource.base_resource import Resource
@dataclass
class Predicate:
value: Any
key: str
rank: int = 10
def __str__(self):
value = getattr(se... | 24.2 | 66 | 0.655372 | from dataclasses import dataclass
from typing import Type, Any, Optional
from predico.services.request.base_request import Request
from predico.services.resource.base_resource import Resource
@dataclass
class Predicate:
value: Any
key: str
rank: int = 10
def __str__(self):
value = getattr(se... | true | true |
1c404227fdcac709e21234d010f4c8fb5da52912 | 5,015 | py | Python | api.py | YAJATapps/Messenger-API | 815ab70bdfcb74d37f1c967b2a083beda17965b0 | [
"Apache-2.0"
] | null | null | null | api.py | YAJATapps/Messenger-API | 815ab70bdfcb74d37f1c967b2a083beda17965b0 | [
"Apache-2.0"
] | null | null | null | api.py | YAJATapps/Messenger-API | 815ab70bdfcb74d37f1c967b2a083beda17965b0 | [
"Apache-2.0"
] | null | null | null | import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import hashlib
from mangum import Mangum
import mysql.connector
import time
app = FastAPI()
origins = [
"https://messenger.yajatkumar.com",
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow_ori... | 22.795455 | 112 | 0.635892 | import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import hashlib
from mangum import Mangum
import mysql.connector
import time
app = FastAPI()
origins = [
"https://messenger.yajatkumar.com",
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow_ori... | true | true |
1c404242f0b6bd6bdb19467bcc2784e17f1dafc5 | 228 | py | Python | backend/apps/contact/admin.py | skiv23/portfolio | 3c1a7b0cf0fb67148ce4b0491132e3a01375c9b0 | [
"MIT"
] | null | null | null | backend/apps/contact/admin.py | skiv23/portfolio | 3c1a7b0cf0fb67148ce4b0491132e3a01375c9b0 | [
"MIT"
] | null | null | null | backend/apps/contact/admin.py | skiv23/portfolio | 3c1a7b0cf0fb67148ce4b0491132e3a01375c9b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.contrib import admin
from . import models
admin.site.register(models.Title)
admin.site.register(models.Contact)
admin.site.register(models.ContactMeEntry)
admin.site.register(models.Photo)
| 20.727273 | 42 | 0.776316 | from django.contrib import admin
from . import models
admin.site.register(models.Title)
admin.site.register(models.Contact)
admin.site.register(models.ContactMeEntry)
admin.site.register(models.Photo)
| true | true |
1c40427349091ac0fefe2bc8521d70b844ce44a4 | 2,339 | py | Python | outdated-unused/OldImageProcessing.py | KhangOP/PaladinsAssistantBot | 9b705dc688610ba52909f0b0e152d8684006c6a6 | [
"MIT"
] | null | null | null | outdated-unused/OldImageProcessing.py | KhangOP/PaladinsAssistantBot | 9b705dc688610ba52909f0b0e152d8684006c6a6 | [
"MIT"
] | null | null | null | outdated-unused/OldImageProcessing.py | KhangOP/PaladinsAssistantBot | 9b705dc688610ba52909f0b0e152d8684006c6a6 | [
"MIT"
] | null | null | null |
"""
# Creates a image desks
async def create_deck_image2(player_name, champ_name, deck):
image_size_x = 256
image_size_y = 196
# Main image
# deck_image = Image.new('RGB', (image_size_x * 5, image_size_x * 2), color=color)
# Champ icon image
champ_url = await get_champ_image(champ_name)
r... | 37.126984 | 111 | 0.662676 | true | true | |
1c4042fed14fd9b63c76fd881336abf66138e572 | 9,544 | py | Python | scikit-learn-weighted_kde/sklearn/feature_selection/from_model.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | scikit-learn-weighted_kde/sklearn/feature_selection/from_model.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | scikit-learn-weighted_kde/sklearn/feature_selection/from_model.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | # Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena
# License: BSD 3 clause
import numpy as np
from .base import SelectorMixin
from ..base import TransformerMixin, BaseEstimator, clone
from ..externals import six
from ..utils import safe_mask, check_array, deprecated
from ..utils.validation import chec... | 36.849421 | 79 | 0.620914 |
import numpy as np
from .base import SelectorMixin
from ..base import TransformerMixin, BaseEstimator, clone
from ..externals import six
from ..utils import safe_mask, check_array, deprecated
from ..utils.validation import check_is_fitted
from ..exceptions import NotFittedError
def _get_feature_importances(estimat... | true | true |
1c404332924554e60f631695c9e565921d0c6fc1 | 3,116 | py | Python | Amazon-Alexa-Reviews-feedback-prediction/code.py | Sufi737/ga-learner-dsmp-repo | a71c9bf138d5d9ba1ff4f37238d5e152cbf4380c | [
"MIT"
] | 2 | 2020-06-16T16:54:37.000Z | 2021-07-08T13:16:59.000Z | Amazon-Alexa-Reviews-feedback-prediction/code.py | Sufi737/ga-learner-dsmp-repo | a71c9bf138d5d9ba1ff4f37238d5e152cbf4380c | [
"MIT"
] | null | null | null | Amazon-Alexa-Reviews-feedback-prediction/code.py | Sufi737/ga-learner-dsmp-repo | a71c9bf138d5d9ba1ff4f37238d5e152cbf4380c | [
"MIT"
] | null | null | null | # --------------
# import packages
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
# Load the dataset
df = pd.read_csv(path, sep ="\t")
print(type(df['date']))
# Converting date attribute from string to datetime.date dataty... | 20.912752 | 101 | 0.720475 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
df = pd.read_csv(path, sep ="\t")
print(type(df['date']))
df['date'] = pd.to_datetime(df['date'])
df['length'] = df['verified_reviews'].apply(lambda x: len(x))
plt.figure... | true | true |
1c4043c02674893a7b35774dafdb1e1cced67274 | 1,864 | py | Python | dasladen/log.py | pagotti/dasladen | 75bb384a2048619bd8fe5dd4588cb438dc02e589 | [
"MIT"
] | 2 | 2020-06-01T09:34:45.000Z | 2021-03-16T15:42:30.000Z | dasladen/log.py | pagotti/dasladen | 75bb384a2048619bd8fe5dd4588cb438dc02e589 | [
"MIT"
] | 2 | 2021-04-20T16:45:46.000Z | 2021-07-02T15:48:46.000Z | dasladen/log.py | pagotti/dasladen | 75bb384a2048619bd8fe5dd4588cb438dc02e589 | [
"MIT"
] | 2 | 2020-04-17T23:28:30.000Z | 2020-06-01T09:37:56.000Z | """
Log Module
Features:
- Log to file
- Log to console
"""
import time
import logging
from . import compat
class FileHandler(object):
def __init__(self):
self.file = None
def open(self, key):
self.file = compat.open('log/{}.log'.format(key), 'a', 0)
def write(self, data):
se... | 18.64 | 65 | 0.614807 |
import time
import logging
from . import compat
class FileHandler(object):
def __init__(self):
self.file = None
def open(self, key):
self.file = compat.open('log/{}.log'.format(key), 'a', 0)
def write(self, data):
self.file.write(u"{} {}\n".format(get_time(), data))
def cl... | true | true |
1c4043df8db9292235261a8d7600bc65b6fee9d9 | 268 | py | Python | 1st Year - CS/Python - Language/Lab 15 - 28th May/swap1stlast.py | rahularepaka/CSLab | 6d223b8814ad04a5821cbe63bf059f5726ff22ce | [
"MIT"
] | null | null | null | 1st Year - CS/Python - Language/Lab 15 - 28th May/swap1stlast.py | rahularepaka/CSLab | 6d223b8814ad04a5821cbe63bf059f5726ff22ce | [
"MIT"
] | null | null | null | 1st Year - CS/Python - Language/Lab 15 - 28th May/swap1stlast.py | rahularepaka/CSLab | 6d223b8814ad04a5821cbe63bf059f5726ff22ce | [
"MIT"
] | null | null | null | import math
n = int(input())
length = (math.log10(n)) + 1
last = n%10
n_str = str(n)
first = int(n_str[0])
temp = first
first = last
last = temp
n_last = n%10
n_last = n/10
n_last = int(n_last)
n_last_str = str(n_last)
print(str(first)+n_last_str[1:]+str(last)) | 12.761905 | 42 | 0.652985 | import math
n = int(input())
length = (math.log10(n)) + 1
last = n%10
n_str = str(n)
first = int(n_str[0])
temp = first
first = last
last = temp
n_last = n%10
n_last = n/10
n_last = int(n_last)
n_last_str = str(n_last)
print(str(first)+n_last_str[1:]+str(last)) | true | true |
1c4044d2b136624b7d29bcf8552335ac76d0db28 | 353 | py | Python | wagtail/wagtailembeds/apps.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailembeds/apps.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailembeds/apps.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from django.apps import AppConfig
from .finders import get_finders
class WagtailEmbedsAppConfig(AppConfig):
name = 'wagtail.wagtailembeds'
label = 'wagtailembeds'
verbose_name = "Wagtail embeds"
def ready(self):
# Check configuration ... | 22.0625 | 56 | 0.739377 | from __future__ import absolute_import, unicode_literals
from django.apps import AppConfig
from .finders import get_finders
class WagtailEmbedsAppConfig(AppConfig):
name = 'wagtail.wagtailembeds'
label = 'wagtailembeds'
verbose_name = "Wagtail embeds"
def ready(self):
get_finders()
| true | true |
1c4045a0c7e598cc9b3628a0f6c725ceda8892bb | 676 | py | Python | meteors.py | VaultHack/Codename-GAME- | 86faefb872298dc71494110bdc22ebb3f31a0350 | [
"Apache-2.0"
] | 3 | 2018-03-21T18:27:40.000Z | 2018-03-29T06:25:50.000Z | meteors.py | VaultHack/Codename-GAME- | 86faefb872298dc71494110bdc22ebb3f31a0350 | [
"Apache-2.0"
] | null | null | null | meteors.py | VaultHack/Codename-GAME- | 86faefb872298dc71494110bdc22ebb3f31a0350 | [
"Apache-2.0"
] | 2 | 2018-03-21T18:27:55.000Z | 2018-03-29T06:25:37.000Z | import pygame, random
from pygame.sprite import Sprite
class Meteors(Sprite):
def __init__(self, game_settings, screen):
super().__init__()
self.screen = screen
self.game_settings = game_settings
#
self.image = pygame.image.load("images/meteor1.png")
self.rect = self.image.get_rect()
self.screen_re... | 23.310345 | 54 | 0.701183 | import pygame, random
from pygame.sprite import Sprite
class Meteors(Sprite):
def __init__(self, game_settings, screen):
super().__init__()
self.screen = screen
self.game_settings = game_settings
self.image = pygame.image.load("images/meteor1.png")
self.rect = self.image.get_rect()
self.screen_rect ... | true | true |
1c404714760ad68eec15387c4f7353a92c6813b3 | 3,593 | py | Python | test/pathod/test_language_actions.py | dolfly/mitmproxy | 4604c25c6055a37e5f25a238d2a089759bd5d98a | [
"MIT"
] | null | null | null | test/pathod/test_language_actions.py | dolfly/mitmproxy | 4604c25c6055a37e5f25a238d2a089759bd5d98a | [
"MIT"
] | null | null | null | test/pathod/test_language_actions.py | dolfly/mitmproxy | 4604c25c6055a37e5f25a238d2a089759bd5d98a | [
"MIT"
] | null | null | null | import cStringIO
from pathod.language import actions
from pathod import language
def parse_request(s):
return language.parse_pathoc(s).next()
def test_unique_name():
assert not actions.PauseAt(0, "f").unique_name
assert actions.DisconnectAt(0).unique_name
class TestDisconnects:
def test_parse_pa... | 26.419118 | 66 | 0.561091 | import cStringIO
from pathod.language import actions
from pathod import language
def parse_request(s):
return language.parse_pathoc(s).next()
def test_unique_name():
assert not actions.PauseAt(0, "f").unique_name
assert actions.DisconnectAt(0).unique_name
class TestDisconnects:
def test_parse_pa... | true | true |
1c4047fca52bbc1922c2ef1b4056844b19f0cf9c | 402 | py | Python | Projects/urls.py | Shreya549/Project-Generator-Backend | f77b945dd9a84bde0aecb8755a5157a5cf4fec4f | [
"MIT"
] | null | null | null | Projects/urls.py | Shreya549/Project-Generator-Backend | f77b945dd9a84bde0aecb8755a5157a5cf4fec4f | [
"MIT"
] | null | null | null | Projects/urls.py | Shreya549/Project-Generator-Backend | f77b945dd9a84bde0aecb8755a5157a5cf4fec4f | [
"MIT"
] | 1 | 2022-02-22T17:20:13.000Z | 2022-02-22T17:20:13.000Z | from django.urls import path, include
from rest_framework.routers import SimpleRouter
from .views import (
ProjectViewSet,
ViewProjectViewSet,
MyProjectsViewSet,
)
router = SimpleRouter()
router.register('new', ProjectViewSet, basename="new")
router.register('view', ViewProjectViewSet, basename="view")
r... | 23.647059 | 60 | 0.771144 | from django.urls import path, include
from rest_framework.routers import SimpleRouter
from .views import (
ProjectViewSet,
ViewProjectViewSet,
MyProjectsViewSet,
)
router = SimpleRouter()
router.register('new', ProjectViewSet, basename="new")
router.register('view', ViewProjectViewSet, basename="view")
r... | true | true |
1c404828cc0e3e521538877140a9b2e03c49c434 | 7,270 | py | Python | cogs/twittercog.py | nluedtke/brochat-bot | 9a9a3e89fbcd35a791b1842d73f3aa0e2c3f985d | [
"MIT"
] | 18 | 2017-08-23T17:26:30.000Z | 2021-04-04T03:05:04.000Z | cogs/twittercog.py | nluedtke/brochat-bot | 9a9a3e89fbcd35a791b1842d73f3aa0e2c3f985d | [
"MIT"
] | 36 | 2017-08-21T14:23:43.000Z | 2020-06-29T14:11:57.000Z | cogs/twittercog.py | nluedtke/brochat-bot | 9a9a3e89fbcd35a791b1842d73f3aa0e2c3f985d | [
"MIT"
] | 5 | 2017-08-24T04:05:41.000Z | 2021-08-13T09:44:36.000Z | import asyncio
from datetime import datetime
from random import randint, shuffle
import common
from cogs.duelcog import item_chance_roll
from discord.ext import commands
from twython import TwythonError
class Twitter(commands.Cog):
""" Twitter Fetchers"""
def __init__(self, bot):
self.bot = bot
... | 33.657407 | 80 | 0.550894 | import asyncio
from datetime import datetime
from random import randint, shuffle
import common
from cogs.duelcog import item_chance_roll
from discord.ext import commands
from twython import TwythonError
class Twitter(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="tru... | true | true |
1c4048e58ed6a692da19af14e93f886adc543c8c | 4,683 | py | Python | openpeerpower/components/fritzbox_netmonitor/sensor.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | openpeerpower/components/fritzbox_netmonitor/sensor.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | openpeerpower/components/fritzbox_netmonitor/sensor.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Support for monitoring an AVM Fritz!Box router."""
from datetime import timedelta
import logging
from fritzconnection.core.exceptions import FritzConnectionException
from fritzconnection.lib.fritzstatus import FritzStatus
from requests.exceptions import RequestException
import voluptuous as vol
from openpeerpower.... | 35.477273 | 79 | 0.704036 | from datetime import timedelta
import logging
from fritzconnection.core.exceptions import FritzConnectionException
from fritzconnection.lib.fritzstatus import FritzStatus
from requests.exceptions import RequestException
import voluptuous as vol
from openpeerpower.components.sensor import PLATFORM_SCHEMA, SensorEntity... | true | true |
1c404903e53fc5a58dce23929d40cd330cab97d2 | 8,596 | py | Python | tensorflow/contrib/learn/python/learn/metric_spec.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 65 | 2016-09-26T01:30:40.000Z | 2021-08-11T17:00:41.000Z | tensorflow/contrib/learn/python/learn/metric_spec.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 5 | 2017-02-21T08:37:52.000Z | 2017-03-29T05:46:05.000Z | tensorflow/contrib/learn/python/learn/metric_spec.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 11 | 2017-09-10T16:22:21.000Z | 2021-08-09T09:24:50.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.035398 | 80 | 0.648557 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.platform import tf_logging as logging
class MetricSpec(object):
def __init__(self,
metric_fn,
prediction_key=None,
label_key=None,
... | true | true |
1c404b4e8623172045b89333c0e18f6f6df29823 | 7,991 | py | Python | tests/attributes/test_datetime.py | yaal-coop/sheraf | 774e3781bc6ff2e16c6cc39f268d475b5e64fcea | [
"MIT"
] | 1 | 2020-03-18T09:54:52.000Z | 2020-03-18T09:54:52.000Z | tests/attributes/test_datetime.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | null | null | null | tests/attributes/test_datetime.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | null | null | null | import datetime
import libfaketime
import pytest
import pytz
import sheraf
import tests
def test_datetime_timestamp(sheraf_connection):
class Model(tests.UUIDAutoModel):
date = sheraf.DateTimeAttribute()
m = Model.create()
assert m.date is None
m = Model.read(m.id)
test_date = datetime.... | 30.268939 | 117 | 0.636341 | import datetime
import libfaketime
import pytest
import pytz
import sheraf
import tests
def test_datetime_timestamp(sheraf_connection):
class Model(tests.UUIDAutoModel):
date = sheraf.DateTimeAttribute()
m = Model.create()
assert m.date is None
m = Model.read(m.id)
test_date = datetime.... | true | true |
1c404bbb89804ba8726d68feddaa3e1754470abe | 12,814 | py | Python | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_householder.py | chrism0dwk/probability | ab260f15cae94c6802c2f2769fb448ad213b79cd | [
"Apache-2.0"
] | 2 | 2020-02-21T06:30:00.000Z | 2021-08-08T19:29:15.000Z | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_householder.py | chrism0dwk/probability | ab260f15cae94c6802c2f2769fb448ad213b79cd | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_householder.py | chrism0dwk/probability | ab260f15cae94c6802c2f2769fb448ad213b79cd | [
"Apache-2.0"
] | 1 | 2020-05-31T13:08:33.000Z | 2020-05-31T13:08:33.000Z | # Copyright 2020 The TensorFlow Probability Authors. All Rights Reserved.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# THIS FILE IS AUTO-GENERATED BY `gen_linear_operators.py`.
# DO NOT MODIFY DIRECTLY.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... | 41.603896 | 99 | 0.699938 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_probability.python.internal.backend.numpy import errors
from tensorflow_probability.python.internal.backend.numpy import ops
from tensorflow_probability.python.internal.backend.numpy import nu... | true | true |
1c404c22e8d3ea4700a7f2e9200aa33937f5295d | 479 | py | Python | compsocsite/polls/migrations/0057_item_item_description.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | 8 | 2017-03-07T19:46:51.000Z | 2021-06-01T01:41:37.000Z | compsocsite/polls/migrations/0057_item_item_description.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | null | null | null | compsocsite/polls/migrations/0057_item_item_description.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | 9 | 2016-06-09T03:36:20.000Z | 2019-09-11T20:56:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-25 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0056_auto_20160722_1606'),
]
operations = [
migrations.AddField(
... | 22.809524 | 75 | 0.626305 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0056_auto_20160722_1606'),
]
operations = [
migrations.AddField(
model_name='item',
name='item_description',
... | true | true |
1c404c92f557fecce42c589d4825172437f2ff78 | 3,228 | py | Python | lib/setupDeployment.py | cmusatyalab/PyEdgeSim | edc13488d66ec9582543e5f116c6611ef7b65d9d | [
"Apache-2.0"
] | null | null | null | lib/setupDeployment.py | cmusatyalab/PyEdgeSim | edc13488d66ec9582543e5f116c6611ef7b65d9d | [
"Apache-2.0"
] | null | null | null | lib/setupDeployment.py | cmusatyalab/PyEdgeSim | edc13488d66ec9582543e5f116c6611ef7b65d9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import pprint
import json
import shutil
sys.path.append("./lib")
from pyutils import *
from config import *
from simlogging import mconsole,configureLogging
from advantedgeapilib import *
from setupBuildEnv import setMEEPPATH
cnf = initConfig()
api = AdvantEDGEApi()
def ma... | 35.472527 | 131 | 0.625465 |
import sys
import os
import pprint
import json
import shutil
sys.path.append("./lib")
from pyutils import *
from config import *
from simlogging import mconsole,configureLogging
from advantedgeapilib import *
from setupBuildEnv import setMEEPPATH
cnf = initConfig()
api = AdvantEDGEApi()
def main():
configureLog... | true | true |
1c404e29b56c9d3befa180e62b8cbeb33576e541 | 23,687 | py | Python | certbot/reverter.py | cybersimon/certbot | 174e59486338b8f3e17300ef9937a3182e733ac7 | [
"Apache-2.0"
] | null | null | null | certbot/reverter.py | cybersimon/certbot | 174e59486338b8f3e17300ef9937a3182e733ac7 | [
"Apache-2.0"
] | null | null | null | certbot/reverter.py | cybersimon/certbot | 174e59486338b8f3e17300ef9937a3182e733ac7 | [
"Apache-2.0"
] | null | null | null | """Reverter class saves configuration checkpoints and allows for recovery."""
import csv
import glob
import logging
import os
import shutil
import time
import traceback
import zope.component
from certbot import constants
from certbot import errors
from certbot import interfaces
from certbot import util
from certbot... | 40.352641 | 97 | 0.615612 | import csv
import glob
import logging
import os
import shutil
import time
import traceback
import zope.component
from certbot import constants
from certbot import errors
from certbot import interfaces
from certbot import util
from certbot.display import util as display_util
logger = logging.getLogger(__name__)
... | true | true |
1c404edecd0b785e89bb58d20b2579dc0a826c04 | 5,675 | py | Python | airflow/providers/apache/hive/transfers/mssql_to_hive.py | khilawar4/airflow | 5f3f65b82517f615f31f0c8a7f8ac0facb325235 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-01-29T20:33:56.000Z | 2021-08-06T17:35:16.000Z | airflow/providers/apache/hive/transfers/mssql_to_hive.py | khilawar4/airflow | 5f3f65b82517f615f31f0c8a7f8ac0facb325235 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | airflow/providers/apache/hive/transfers/mssql_to_hive.py | khilawar4/airflow | 5f3f65b82517f615f31f0c8a7f8ac0facb325235 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-04-14T11:15:17.000Z | 2021-12-15T16:58:24.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... | 39.964789 | 106 | 0.656916 |
from collections import OrderedDict
from tempfile import NamedTemporaryFile
from typing import Dict, Optional
import pymssql
import unicodecsv as csv
from airflow.models import BaseOperator
from airflow.providers.apache.hive.hooks.hive import HiveCliHook
from airflow.providers.microsoft.mssql.hooks.mssql import MsSq... | true | true |
1c404ef125034a509e7cc02ad5734de3ad8881d4 | 596 | py | Python | nnaps/tests/test_mesa_compress.py | vosjo/nnaps | bc4aac715b511c5df897ef24fb953ad7265927ea | [
"MIT"
] | 4 | 2020-09-24T12:55:58.000Z | 2021-05-19T14:46:10.000Z | nnaps/tests/test_mesa_compress.py | vosjo/nnaps | bc4aac715b511c5df897ef24fb953ad7265927ea | [
"MIT"
] | 4 | 2021-06-02T09:28:35.000Z | 2021-06-04T08:32:24.000Z | nnaps/tests/test_mesa_compress.py | vosjo/nnaps | bc4aac715b511c5df897ef24fb953ad7265927ea | [
"MIT"
] | 3 | 2020-10-05T13:18:27.000Z | 2021-06-02T09:29:11.000Z | import pytest
import numpy as np
from nnaps.mesa.compress_mesa import read_mesa_output
from pathlib import Path
base_path = Path(__file__).parent
class TestReadMesaOutput:
def test_read_mesa_output_new_format(self):
filename = base_path / 'test_data/history_mesa_v15140.data'
model = read_mesa... | 28.380952 | 69 | 0.704698 | import pytest
import numpy as np
from nnaps.mesa.compress_mesa import read_mesa_output
from pathlib import Path
base_path = Path(__file__).parent
class TestReadMesaOutput:
def test_read_mesa_output_new_format(self):
filename = base_path / 'test_data/history_mesa_v15140.data'
model = read_mesa... | true | true |
1c404f65d738535acb8ea84bc81dd3184b2d119e | 5,991 | py | Python | spider_scripts_20201122/download_picture.py | uvioresistant/python_tool_scripts | 4f61aaaf7955a18401091e3bd04321e588344de3 | [
"Apache-2.0"
] | null | null | null | spider_scripts_20201122/download_picture.py | uvioresistant/python_tool_scripts | 4f61aaaf7955a18401091e3bd04321e588344de3 | [
"Apache-2.0"
] | null | null | null | spider_scripts_20201122/download_picture.py | uvioresistant/python_tool_scripts | 4f61aaaf7955a18401091e3bd04321e588344de3 | [
"Apache-2.0"
] | null | null | null | import os
import requests
from time import time, sleep
from multiprocessing.pool import ThreadPool
# 发请求,写入jpg到本地
def url_response(url):
path, url = url
r = requests.get(url, stream=True)
with open(path, 'wb') as f:
for ch in r:
f.write(ch)
start = time()
if __name__ == '__main__':
... | 157.657895 | 5,246 | 0.780003 | import os
import requests
from time import time, sleep
from multiprocessing.pool import ThreadPool
def url_response(url):
path, url = url
r = requests.get(url, stream=True)
with open(path, 'wb') as f:
for ch in r:
f.write(ch)
start = time()
if __name__ == '__main__':
path = []
... | true | true |
1c404fa40746e8ead0655123648395b5752349ff | 4,363 | py | Python | examples/faster-rcnn/generate_anchors.py | rohitbhio/neon | 4fb5ff6a4b622facfb07b28da94b992159aac8cc | [
"Apache-2.0"
] | 1 | 2020-12-30T10:13:41.000Z | 2020-12-30T10:13:41.000Z | examples/faster-rcnn/generate_anchors.py | rohitbhio/neon | 4fb5ff6a4b622facfb07b28da94b992159aac8cc | [
"Apache-2.0"
] | null | null | null | examples/faster-rcnn/generate_anchors.py | rohitbhio/neon | 4fb5ff6a4b622facfb07b28da94b992159aac8cc | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
from __future__ import division
from __future__ import p... | 30.089655 | 91 | 0.556727 | from __future__ import division
from __future__ import print_function
from builtins import range
import numpy as np
#
# >> load output/rpn_cachedir/faster_rcnn_VOC2007_ZF_stage1_rpn/anchors.mat
# >> anchors
#
# anchors =
#
# -83 -39 100 56
# -175 -87 192 104
# -359 -183 376 ... | true | true |
1c4050cf536e965eec609a12a6ad864299e1cdae | 597 | py | Python | datacube/index/__init__.py | agdc-research-trial/gdf | 82ed29c263eaf65f5c1fbb4e9207c99e9700b85c | [
"Apache-2.0"
] | 1 | 2015-06-01T01:31:44.000Z | 2015-06-01T01:31:44.000Z | datacube/index/__init__.py | agdc-research-trial/gdf | 82ed29c263eaf65f5c1fbb4e9207c99e9700b85c | [
"Apache-2.0"
] | null | null | null | datacube/index/__init__.py | agdc-research-trial/gdf | 82ed29c263eaf65f5c1fbb4e9207c99e9700b85c | [
"Apache-2.0"
] | null | null | null | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
"""
Modules for interfacing with the index/database.
"""
from ._api import index_connect
from .fields import UnknownFieldError
from .exceptions... | 25.956522 | 92 | 0.760469 |
from ._api import index_connect
from .fields import UnknownFieldError
from .exceptions import DuplicateRecordError, MissingRecordError, IndexSetupError
from datacube.index.abstract import AbstractIndex as Index
__all__ = [
'index_connect',
'Index',
'DuplicateRecordError',
'IndexSetupError',
'Miss... | true | true |
1c405150879a0f0714a98304287b9c17bdd4928d | 3,872 | py | Python | Python/design-circular-queue.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | 9 | 2019-06-30T07:15:18.000Z | 2022-02-10T20:13:40.000Z | Python/design-circular-queue.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | null | null | null | Python/design-circular-queue.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | 9 | 2019-01-16T22:16:49.000Z | 2022-02-06T17:33:41.000Z | # Time: O(1)
# Space: O(k)
# Design your implementation of the circular queue.
# The circular queue is a linear data structure in which
# the operations are performed based on FIFO (First In First Out)
# principle and the last position is connected back to
# the first position to make a circle. It is also called ‘Rin... | 34.571429 | 105 | 0.647211 |
class MyCircularQueue(object):
def __init__(self, k):
self.__start = 0
self.__size = 0
self.__buffer = [0] * k
def enQueue(self, value):
if self.isFull():
return False
self.__buffer[(self.__start+self.__size) % len(self.__buffer)] = value
self.__si... | true | true |
1c40516d6c979e49fd898f56797b8adbeeec9eb8 | 31 | py | Python | models/main.py | feamster/internet_video | 53a88778155e50dfdfe581d4041c64bd411a0701 | [
"MIT"
] | null | null | null | models/main.py | feamster/internet_video | 53a88778155e50dfdfe581d4041c64bd411a0701 | [
"MIT"
] | null | null | null | models/main.py | feamster/internet_video | 53a88778155e50dfdfe581d4041c64bd411a0701 | [
"MIT"
] | 1 | 2022-03-08T10:04:02.000Z | 2022-03-08T10:04:02.000Z | import os
import pandas as pd
| 7.75 | 19 | 0.774194 | import os
import pandas as pd
| true | true |
1c40523fc1f2c8fbb02985f67c895b5f8b7c6506 | 7,397 | py | Python | ci_scripts/chinese_samplecode_processor.py | zhangting2020/FluidDoc | 1a08e8aedce1e44829ae652f6c588adf61f2c2f6 | [
"Apache-2.0"
] | null | null | null | ci_scripts/chinese_samplecode_processor.py | zhangting2020/FluidDoc | 1a08e8aedce1e44829ae652f6c588adf61f2c2f6 | [
"Apache-2.0"
] | null | null | null | ci_scripts/chinese_samplecode_processor.py | zhangting2020/FluidDoc | 1a08e8aedce1e44829ae652f6c588adf61f2c2f6 | [
"Apache-2.0"
] | 1 | 2020-11-25T11:42:24.000Z | 2020-11-25T11:42:24.000Z | import math
import os
import pickle
import shutil
import subprocess
import multiprocessing
import sys
def remove_desc_code(srcls, filename):
if filename == 'fluid_cn/one_hot_cn.rst':
srcls.pop(13)
srcls.pop(28)
srcls.pop(44)
if filename == 'layers_cn/one_hot_cn.rst':
srcls.pop(... | 31.476596 | 75 | 0.55536 | import math
import os
import pickle
import shutil
import subprocess
import multiprocessing
import sys
def remove_desc_code(srcls, filename):
if filename == 'fluid_cn/one_hot_cn.rst':
srcls.pop(13)
srcls.pop(28)
srcls.pop(44)
if filename == 'layers_cn/one_hot_cn.rst':
srcls.pop(... | true | true |
1c405262bdb1dd0e3eeb6b00bc43174e6c73608a | 4,358 | py | Python | photologue/templatetags/photologue_tags.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 364 | 2015-01-03T00:06:55.000Z | 2019-03-10T20:00:11.000Z | photologue/templatetags/photologue_tags.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 79 | 2015-01-03T03:35:36.000Z | 2019-03-13T20:05:55.000Z | photologue/templatetags/photologue_tags.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 135 | 2015-01-09T01:36:11.000Z | 2019-03-12T02:54:59.000Z | import random
from django import template
from ..models import Gallery, Photo
register = template.Library()
@register.inclusion_tag('photologue/tags/next_in_gallery.html')
def next_in_gallery(photo, gallery):
return {'photo': photo.get_next_in_gallery(gallery)}
@register.inclusion_tag('photologue/tags/prev_i... | 33.015152 | 119 | 0.61129 | import random
from django import template
from ..models import Gallery, Photo
register = template.Library()
@register.inclusion_tag('photologue/tags/next_in_gallery.html')
def next_in_gallery(photo, gallery):
return {'photo': photo.get_next_in_gallery(gallery)}
@register.inclusion_tag('photologue/tags/prev_i... | true | true |
1c40528b610cb5e8d43e5244e7310c3a82c04fe2 | 6,169 | py | Python | examples/lm1b/unit_test/sampled_softmax_utest.py | yangkevin2/count-sketch | 164f1aaef662935043cb628421c6185b5ea6c654 | [
"Apache-2.0"
] | 109 | 2017-12-14T10:52:19.000Z | 2022-03-26T21:22:10.000Z | lm/unit_test/sampled_softmax_utest.py | JoPfeiff/PyTorch_GBW_LM | 74f180ff1cecd54f6810d139d9b816aa97abd84a | [
"Apache-2.0"
] | 15 | 2017-12-10T16:14:10.000Z | 2021-12-30T07:20:48.000Z | lm/unit_test/sampled_softmax_utest.py | JoPfeiff/PyTorch_GBW_LM | 74f180ff1cecd54f6810d139d9b816aa97abd84a | [
"Apache-2.0"
] | 19 | 2018-01-05T05:09:51.000Z | 2021-07-21T03:44:16.000Z | import unittest
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
import model
from log_uniform import LogUniformSampler
def EXPECT_NEAR(x, y, epsilon):
return np.all(abs(x - y) <= epsilon)
class ComputeSampledLogitsTest(unittest.TestCase):
def _GenerateTestData(self, num... | 41.126667 | 121 | 0.702869 | import unittest
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
import model
from log_uniform import LogUniformSampler
def EXPECT_NEAR(x, y, epsilon):
return np.all(abs(x - y) <= epsilon)
class ComputeSampledLogitsTest(unittest.TestCase):
def _GenerateTestData(self, num... | true | true |
1c405311e59e59e3362a45d3645408633424900f | 5,077 | py | Python | ipython_odoo/tracer.py | voronind/ipython-odoo | 48fcc7232beb9f7459ec1f0d7e0cf9cc41f85475 | [
"MIT"
] | null | null | null | ipython_odoo/tracer.py | voronind/ipython-odoo | 48fcc7232beb9f7459ec1f0d7e0cf9cc41f85475 | [
"MIT"
] | null | null | null | ipython_odoo/tracer.py | voronind/ipython-odoo | 48fcc7232beb9f7459ec1f0d7e0cf9cc41f85475 | [
"MIT"
] | null | null | null | import inspect
import logging
import re
import sys
from contextlib import contextmanager
from functools import wraps
from odoo.models import BaseModel
from .hierarchy import recordset_models
from functools import reduce
INTEREST_METHODS = {
'sale.order': {
'_prepare',
'search',
},
'all':... | 23.835681 | 103 | 0.572385 | import inspect
import logging
import re
import sys
from contextlib import contextmanager
from functools import wraps
from odoo.models import BaseModel
from .hierarchy import recordset_models
from functools import reduce
INTEREST_METHODS = {
'sale.order': {
'_prepare',
'search',
},
'all':... | true | true |
1c4054afc1bb7fe4eaab14ed54d92e4a4cfc8153 | 412 | py | Python | Model/Opportunity.py | AIESECMX/Vtiger_Automatization | 9edf486af70ff5e353c1ad19ffceba03ef44006c | [
"MIT"
] | null | null | null | Model/Opportunity.py | AIESECMX/Vtiger_Automatization | 9edf486af70ff5e353c1ad19ffceba03ef44006c | [
"MIT"
] | null | null | null | Model/Opportunity.py | AIESECMX/Vtiger_Automatization | 9edf486af70ff5e353c1ad19ffceba03ef44006c | [
"MIT"
] | null | null | null |
class Opportunity:
def __init__(self,expaid,title,url,programme,start_date,end_date,appsClosed,created,updated,status,lc,enabler):
self.id = expaid
self.title = title
self.url = url
self.programme = programme
self.start_date=start_date
self.end_date=end_date
self.appsClosed=appsClosed
self.created=... | 20.6 | 113 | 0.764563 |
class Opportunity:
def __init__(self,expaid,title,url,programme,start_date,end_date,appsClosed,created,updated,status,lc,enabler):
self.id = expaid
self.title = title
self.url = url
self.programme = programme
self.start_date=start_date
self.end_date=end_date
self.appsClosed=appsClosed
self.created=... | true | true |
1c4054c3a375c8595621946893894ac18fada8eb | 6,327 | py | Python | model/vaccination_preference_diagrams/model_phasediagram_numax_I0_1.py | lubo93/vaccination | 4ddaf44455e72e9fc80cee03a6021f3ee754adfe | [
"MIT"
] | null | null | null | model/vaccination_preference_diagrams/model_phasediagram_numax_I0_1.py | lubo93/vaccination | 4ddaf44455e72e9fc80cee03a6021f3ee754adfe | [
"MIT"
] | null | null | null | model/vaccination_preference_diagrams/model_phasediagram_numax_I0_1.py | lubo93/vaccination | 4ddaf44455e72e9fc80cee03a6021f3ee754adfe | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from lib.simulation import epidemic_model
from matplotlib import rcParams, colors
from matplotlib.colors import LinearSegmentedColormap
# customized settings
params = { # 'backend': 'ps',
'font.family': 'serif',
'font... | 33.654255 | 92 | 0.607871 | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from lib.simulation import epidemic_model
from matplotlib import rcParams, colors
from matplotlib.colors import LinearSegmentedColormap
params = { 'font.family': 'serif',
'font.serif': 'Latin Modern Roman',
'font.... | true | true |
1c40556aaae46f312fe9acfff59f8c7132fd844b | 8,588 | py | Python | edx_rest_framework_extensions/auth/jwt/authentication.py | openedx/edx-drf-extensions | f923f48da8a639f8037d917264057e456785a0e7 | [
"Apache-2.0"
] | null | null | null | edx_rest_framework_extensions/auth/jwt/authentication.py | openedx/edx-drf-extensions | f923f48da8a639f8037d917264057e456785a0e7 | [
"Apache-2.0"
] | 1 | 2022-02-11T14:47:15.000Z | 2022-02-11T14:47:15.000Z | edx_rest_framework_extensions/auth/jwt/authentication.py | openedx/edx-drf-extensions | f923f48da8a639f8037d917264057e456785a0e7 | [
"Apache-2.0"
] | null | null | null | """ JWT Authentication class. """
import logging
import jwt
from django.contrib.auth import get_user_model
from django.middleware.csrf import CsrfViewMiddleware
from edx_django_utils.monitoring import set_custom_attribute
from rest_framework import exceptions
from rest_framework_jwt.authentication import JSONWebToken... | 43.593909 | 175 | 0.62599 |
import logging
import jwt
from django.contrib.auth import get_user_model
from django.middleware.csrf import CsrfViewMiddleware
from edx_django_utils.monitoring import set_custom_attribute
from rest_framework import exceptions
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from edx_rest_fram... | true | true |
1c40578685ce22c8ce85a3699e7def9a9fb0953a | 2,733 | py | Python | adwords_python3_examples_10.1.0/v201802/campaign_management/graduate_trial.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201802/campaign_management/graduate_trial.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201802/campaign_management/graduate_trial.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 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.1625 | 81 | 0.72704 |
import uuid
from googleads import adwords
TRIAL_ID = 'INSERT_TRIAL_ID_HERE'
def main(client, trial_id):
trial_service = client.GetService('TrialService', version='v201802')
budget_service = client.GetService('BudgetService', version='v201802')
budget = {
'name': 'Budget #%d' % uuid.uuid4()... | true | true |
1c4059486f0d38f447f040822c0a5cba9f9c481d | 1,884 | py | Python | mmtbx/command_line/refine_anomalous_substructure.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/refine_anomalous_substructure.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/refine_anomalous_substructure.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null |
from __future__ import division
from libtbx.utils import Sorry
import sys
def run(args, out=sys.stdout):
from mmtbx.refinement import anomalous_scatterer_groups
import mmtbx.command_line
master_phil = mmtbx.command_line.generate_master_phil_with_inputs(
phil_string="""
map_type = *anom_residual llg
.type ... | 29.904762 | 77 | 0.771762 |
from __future__ import division
from libtbx.utils import Sorry
import sys
def run(args, out=sys.stdout):
from mmtbx.refinement import anomalous_scatterer_groups
import mmtbx.command_line
master_phil = mmtbx.command_line.generate_master_phil_with_inputs(
phil_string="""
map_type = *anom_residual llg
.type ... | true | true |
1c405a2a11e8a5b9f6437e88edb582ea0632bc95 | 9,623 | py | Python | yapf/yapflib/file_resources.py | spaceone/yapf | 633744e62187b296e2f53b97defec4ac2eb9d5a6 | [
"Apache-2.0"
] | 13,769 | 2015-03-19T20:58:55.000Z | 2022-03-31T15:03:38.000Z | yapf/yapflib/file_resources.py | spaceone/yapf | 633744e62187b296e2f53b97defec4ac2eb9d5a6 | [
"Apache-2.0"
] | 973 | 2015-03-24T22:25:15.000Z | 2022-03-23T15:40:15.000Z | yapf/yapflib/file_resources.py | spaceone/yapf | 633744e62187b296e2f53b97defec4ac2eb9d5a6 | [
"Apache-2.0"
] | 1,141 | 2015-03-25T03:05:22.000Z | 2022-03-29T11:06:37.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.731293 | 87 | 0.67401 |
import fnmatch
import os
import re
from lib2to3.pgen2 import tokenize
from yapf.yapflib import errors
from yapf.yapflib import py3compat
from yapf.yapflib import style
CR = '\r'
LF = '\n'
CRLF = '\r\n'
def _GetExcludePatternsFromYapfIgnore(filename):
ignore_patterns = []
if os.path.isfile(filename) and os.acc... | true | true |
1c405a837b1eef2fd63d9d70b2f5f4c28f1ff4c1 | 417 | py | Python | django_and_bootstrap/wsgi.py | hosseinkianmehr/solar-site | 6e7995e70442efded3e7bde7cd776fa74dd74372 | [
"MIT"
] | 3 | 2021-01-19T20:12:09.000Z | 2021-11-18T10:06:45.000Z | django_and_bootstrap/wsgi.py | hosseinkianmehr/solar-site | 6e7995e70442efded3e7bde7cd776fa74dd74372 | [
"MIT"
] | null | null | null | django_and_bootstrap/wsgi.py | hosseinkianmehr/solar-site | 6e7995e70442efded3e7bde7cd776fa74dd74372 | [
"MIT"
] | null | null | null | """
WSGI config for django_and_bootstrap project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_and_bootstrap.settings')
application = get_wsgi_application()
| true | true |
1c405ac6d1316e911344504e1aea921c0e05b929 | 31,666 | py | Python | dashboard/internet_nl_dashboard/scanners/scan_internet_nl_per_account.py | platforminternetstandaarden/dashboard-internet.nl | 8b8129c67703a8ae51b441046ff5a90cf72bf537 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/scanners/scan_internet_nl_per_account.py | platforminternetstandaarden/dashboard-internet.nl | 8b8129c67703a8ae51b441046ff5a90cf72bf537 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/scanners/scan_internet_nl_per_account.py | platforminternetstandaarden/dashboard-internet.nl | 8b8129c67703a8ae51b441046ff5a90cf72bf537 | [
"Apache-2.0"
] | 1 | 2019-03-18T16:24:12.000Z | 2019-03-18T16:24:12.000Z | # SPDX-License-Identifier: Apache-2.0
import logging
from copy import copy
from datetime import datetime, timedelta
from typing import Dict, List, Union
import pytz
from actstream import action
from celery import Task, chain, group
from constance import config
from django.db import transaction
from django.db.models im... | 43.141689 | 120 | 0.703752 | import logging
from copy import copy
from datetime import datetime, timedelta
from typing import Dict, List, Union
import pytz
from actstream import action
from celery import Task, chain, group
from constance import config
from django.db import transaction
from django.db.models import Q
from django.utils import timezo... | true | true |
1c405b033cae8c0cc0e16b1317fb1fa4ee564a69 | 689 | py | Python | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="e2e_dialog",
version="0.0.1",
author="Yam",
author_email="haoshaochun@gmail.com",
description="Humanly Deeplearning NLP.",
long_description=long_description,
long_description_conte... | 25.518519 | 57 | 0.642961 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="e2e_dialog",
version="0.0.1",
author="Yam",
author_email="haoshaochun@gmail.com",
description="Humanly Deeplearning NLP.",
long_description=long_description,
long_description_conte... | true | true |
1c405c4d284bb882ab972c77fa28c815d4f98c5e | 7,476 | py | Python | lib/surface/container/images/delete.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/container/images/delete.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/container/images/delete.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2016 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... | 35.942308 | 80 | 0.687935 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from containerregistry.client import docker_name
from containerregistry.client.v2_2 import docker_session
from googlecloudsdk.api_lib.container.images import util
from googlecloudsdk.calliope import base
fro... | true | true |
1c405cd20bb551e5550c516adf161146b5589e2a | 2,439 | py | Python | day05_solve_puzzle1.py | olsgaard/adventofcode2019 | 1e14fd38f472cde894cbbbd7eebdd6545cd4c4ee | [
"MIT"
] | 1 | 2019-12-05T20:08:07.000Z | 2019-12-05T20:08:07.000Z | day05_solve_puzzle1.py | olsgaard/adventofcode2019 | 1e14fd38f472cde894cbbbd7eebdd6545cd4c4ee | [
"MIT"
] | null | null | null | day05_solve_puzzle1.py | olsgaard/adventofcode2019 | 1e14fd38f472cde894cbbbd7eebdd6545cd4c4ee | [
"MIT"
] | null | null | null | """
The TEST diagnostic program will run on your existing Intcode computer after a few modifications:
First, you'll need to add two new instructions:
Opcode 3 takes a single integer as input and saves it to the position given by its only parameter. For example, the instruction 3,50 would take an input value and store... | 29.743902 | 186 | 0.684297 |
def parse_opcode(opcode: int):
opcode = str(opcode).rjust(5, "0")
A,B,C = [int(i) for i in opcode[:-2]]
opcode = int(opcode[-2:])
return A,B,C, opcode
def parse_parameter(intcode, idx, mode=0):
if mode == 0:
return intcode[intcode[idx]]
elif mode == 1:
return intcode[idx]
def execute_intcode(intcode: list... | true | true |
1c405d02adb8a1818347e2c4406ab9da198e1886 | 3,666 | py | Python | actrneuro/iccm2012_preofficial_ACT-R_7/evaluate.py | Sn0wfir3/cogmods | b7a5867e2daa160148872f97a855baab1f645d39 | [
"MIT"
] | null | null | null | actrneuro/iccm2012_preofficial_ACT-R_7/evaluate.py | Sn0wfir3/cogmods | b7a5867e2daa160148872f97a855baab1f645d39 | [
"MIT"
] | 11 | 2020-05-04T09:05:29.000Z | 2021-04-08T13:22:34.000Z | actrneuro/iccm2012_preofficial_ACT-R_7/evaluate.py | Sn0wfir3/cogmods | b7a5867e2daa160148872f97a855baab1f645d39 | [
"MIT"
] | 12 | 2020-05-02T09:36:14.000Z | 2021-06-22T08:10:45.000Z | import numpy as np
import os
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib
def evaluate( output_path="./plots", filename="actr7"):
bold_table = np.zeros([13, 60])
bold_table_divider = np.zeros([13, 60])
boldfiles = [x[0] for x in os.walk("./log/bolds")]
inslen = 0
... | 21.438596 | 134 | 0.525914 | import numpy as np
import os
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib
def evaluate( output_path="./plots", filename="actr7"):
bold_table = np.zeros([13, 60])
bold_table_divider = np.zeros([13, 60])
boldfiles = [x[0] for x in os.walk("./log/bolds")]
inslen = 0
... | true | true |
1c405d6fd314843ead1df39e26c6ac5d095fc3b8 | 3,966 | py | Python | app/recipe/tests/test_tags_api.py | Ilyazv/recipe-app-api | da20425abaecb9581e78ae797bb6ce48c507c2c0 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Ilyazv/recipe-app-api | da20425abaecb9581e78ae797bb6ce48c507c2c0 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Ilyazv/recipe-app-api | da20425abaecb9581e78ae797bb6ce48c507c2c0 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class ... | 31.228346 | 71 | 0.630106 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class ... | true | true |
1c405fe0d996c7638acfe501be963e40135d26c4 | 23,498 | py | Python | MainWindow.py | Ling-fengZhang/lab_gui | 5d79298a9099bfa5f879568d40bcf68ef4604f3d | [
"MIT"
] | 1 | 2021-08-16T19:39:18.000Z | 2021-08-16T19:39:18.000Z | MainWindow.py | Ling-fengZhang/lab_gui | 5d79298a9099bfa5f879568d40bcf68ef4604f3d | [
"MIT"
] | null | null | null | MainWindow.py | Ling-fengZhang/lab_gui | 5d79298a9099bfa5f879568d40bcf68ef4604f3d | [
"MIT"
] | null | null | null | from Model.Instruments.Camera.Chameleon import Chameleon
from Utilities.Helper import settings, Helper
from Utilities.IO import IOHelper
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Widget.CoreWidget.PlotMainWindowWidget import PlotMainWindow
from Widget.CoreWidget.ImgQueueWi... | 44.503788 | 136 | 0.658013 | from Model.Instruments.Camera.Chameleon import Chameleon
from Utilities.Helper import settings, Helper
from Utilities.IO import IOHelper
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Widget.CoreWidget.PlotMainWindowWidget import PlotMainWindow
from Widget.CoreWidget.ImgQueueWi... | true | true |
1c4060f0a6d704828e53c904008845a0871b50ac | 6,079 | py | Python | tutorials/mnist_dpsgd_tutorial_eager.py | amad-person/privacy | aaf4c252a0bbfa41670ddefd3798bdf2066c0e21 | [
"Apache-2.0"
] | 2,327 | 2020-03-01T09:47:34.000Z | 2021-11-25T12:38:42.000Z | tutorials/mnist_dpsgd_tutorial_eager.py | amad-person/privacy | aaf4c252a0bbfa41670ddefd3798bdf2066c0e21 | [
"Apache-2.0"
] | 209 | 2020-03-01T17:14:12.000Z | 2021-11-08T20:35:42.000Z | tutorials/mnist_dpsgd_tutorial_eager.py | amad-person/privacy | aaf4c252a0bbfa41670ddefd3798bdf2066c0e21 | [
"Apache-2.0"
] | 686 | 2020-03-03T17:24:51.000Z | 2021-11-25T23:39:12.000Z | # Copyright 2019, The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 40.798658 | 115 | 0.696661 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp
from tensorflow_privacy.privacy.anal... | true | true |
1c40610ba9273b3df0d4a1f6df9941104ff0555d | 6,780 | py | Python | src/python/pants/backend/python/tasks/python_binary_create.py | jakubbujny/pants | e7fe73eaa3bc196d6d976e9f362bf60b69da17b3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/python_binary_create.py | jakubbujny/pants | e7fe73eaa3bc196d6d976e9f362bf60b69da17b3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/python_binary_create.py | jakubbujny/pants | e7fe73eaa3bc196d6d976e9f362bf60b69da17b3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from pex.interpreter import PythonInterpreter
from pex.pex_builder import PEXB... | 44.900662 | 101 | 0.720944 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from pex.interpreter import PythonInterpreter
from pex.pex_builder import PEXBuilder
from pex.pex_info import PexInfo
from pants.backend.python.subsystems.python_native_code import PythonNativeCode
from pants.backend.python... | true | true |
1c406220f0981138b791aac6bfbd92089b0d15aa | 76 | py | Python | mtsg/__init__.py | stjude/mutspec | 59a4ccc0fcda9b041637e27d7e9f6a2135581e31 | [
"MIT"
] | 1 | 2020-12-24T19:51:35.000Z | 2020-12-24T19:51:35.000Z | mtsg/__init__.py | stjude/mtsg | 59a4ccc0fcda9b041637e27d7e9f6a2135581e31 | [
"MIT"
] | null | null | null | mtsg/__init__.py | stjude/mtsg | 59a4ccc0fcda9b041637e27d7e9f6a2135581e31 | [
"MIT"
] | 1 | 2021-02-08T14:28:24.000Z | 2021-02-08T14:28:24.000Z | from .genome_build import GenomeBuild as GenomeBuild
__version__ = "3.1.0"
| 19 | 52 | 0.789474 | from .genome_build import GenomeBuild as GenomeBuild
__version__ = "3.1.0"
| true | true |
1c40623005bf0cd4c86b7de7ff9c9b56aaf1cbb6 | 5,001 | py | Python | core/src/autogluon/core/searcher/bayesopt/datatypes/config_ext.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 4,462 | 2019-12-09T17:41:07.000Z | 2022-03-31T22:00:41.000Z | core/src/autogluon/core/searcher/bayesopt/datatypes/config_ext.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 1,408 | 2019-12-09T17:48:59.000Z | 2022-03-31T20:24:12.000Z | core/src/autogluon/core/searcher/bayesopt/datatypes/config_ext.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 623 | 2019-12-10T02:04:18.000Z | 2022-03-20T17:11:01.000Z | from typing import Tuple, Union
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
import copy
from .hp_ranges_cs import HyperparameterRanges_CS
RESOURCE_ATTR_PREFIX = 'RESOURCE_ATTR_'
class ExtendedConfiguration(object):
"""
This class facilitates handling extended configs, which consist of... | 39.070313 | 81 | 0.672665 | from typing import Tuple, Union
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
import copy
from .hp_ranges_cs import HyperparameterRanges_CS
RESOURCE_ATTR_PREFIX = 'RESOURCE_ATTR_'
class ExtendedConfiguration(object):
def __init__(
self, hp_ranges: HyperparameterRanges_CS, resour... | true | true |
1c4062b42c83812279f930cff97ab9f5922f6af2 | 809 | py | Python | poky-dunfell/scripts/pybootchartgui/pybootchartgui.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 14 | 2021-11-04T07:47:37.000Z | 2022-03-21T10:10:30.000Z | poky-dunfell/scripts/pybootchartgui/pybootchartgui.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | poky-dunfell/scripts/pybootchartgui/pybootchartgui.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #!/usr/bin/env python3
#
# This file is part of pybootchartgui.
# pybootchartgui is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | 33.708333 | 73 | 0.755253 |
import sys
from pybootchartgui.main import main
if __name__ == '__main__':
sys.exit(main())
| true | true |
1c4063669d8d3250519bf6dd530e291c32f9f070 | 993 | py | Python | vframe_faceless/settings/faceless_cfg.py | vframeio/vframe_faceless_plugin | 12ee7e136ac48c40df6a66db3712c497f5061d1d | [
"MIT"
] | null | null | null | vframe_faceless/settings/faceless_cfg.py | vframeio/vframe_faceless_plugin | 12ee7e136ac48c40df6a66db3712c497f5061d1d | [
"MIT"
] | null | null | null | vframe_faceless/settings/faceless_cfg.py | vframeio/vframe_faceless_plugin | 12ee7e136ac48c40df6a66db3712c497f5061d1d | [
"MIT"
] | null | null | null | #############################################################################
#
# VFRAME
# MIT License
# Copyright (c) 2020 Adam Harvey and VFRAME
# https://vframe.io
#
#############################################################################
import os
from os.path import join
from pathlib import Path
import log... | 26.131579 | 79 | 0.387714 |
import os
from os.path import join
from pathlib import Path
import logging
from dotenv import load_dotenv
LOG = logging.getLogger('vframe')
SELF_CWD = os.path.dirname(os.path.realpath(__file__))
DIR_PROJECT_ROOT = str(Path(SELF_CWD).parent)
fp_env = join(DIR_PROJECT_ROOT, '.env')
if Path(fp_env).is_file():
loa... | true | true |
1c40636e6ad40fbe551ddf88c53868ca689268cd | 4,982 | py | Python | python-package/mlbox/model/supervised/regression/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | python-package/mlbox/model/supervised/regression/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | python-package/mlbox/model/supervised/regression/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Author: Axel ARONIO DE ROMBLAY <axelderomblay@gmail.com>
# License: BSD 3 clause
import numpy as np
import pandas as pd
from sklearn.linear_model import Lasso
from sklearn.ensemble import RandomForestRegressor
import warnings
class Reg_feature_selector():
"""
Selects useful features.
S... | 30.378049 | 81 | 0.578081 |
import numpy as np
import pandas as pd
from sklearn.linear_model import Lasso
from sklearn.ensemble import RandomForestRegressor
import warnings
class Reg_feature_selector():
def __init__(self, strategy='l1', threshold=0.3):
self.strategy = strategy
self.threshold = threshold
self.__fit... | true | true |
1c40638402afd5e56d358484d132ec6b575a38de | 17,502 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/idlelib/MultiCall.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/idlelib/MultiCall.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/idlelib/MultiCall.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall r... | 41.671429 | 81 | 0.589361 |
import sys
import re
import tkinter
MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3;
MC_ACTIVATE=4; MC_CIRCULATE=5; MC_COLORMAP=6; MC_CONFIGURE=7;
MC_DEACTIVATE=8; MC_DESTROY=9; MC_ENTER=10; MC_EXPOSE=11; MC_FOCUSIN=12;
MC_FOCUSOUT=13; MC_GRAVITY=14; MC_LEAVE=15; MC_MAP=16; MC_MOTION=17;
MC_MOUSE... | true | true |
1c4063d3b13a98ff09dc44014e9e75c826ea8dc7 | 10,871 | py | Python | tests/v1/client/test.py | Motmom/komtet-kassa-python-sdk | 56bc49f1148aaae4702abf7e978250ab98b57f47 | [
"MIT"
] | null | null | null | tests/v1/client/test.py | Motmom/komtet-kassa-python-sdk | 56bc49f1148aaae4702abf7e978250ab98b57f47 | [
"MIT"
] | null | null | null | tests/v1/client/test.py | Motmom/komtet-kassa-python-sdk | 56bc49f1148aaae4702abf7e978250ab98b57f47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from decimal import Decimal
from unittest import TestCase
from komtet_kassa_sdk.v1 import (Client, EmployeeType, Task, TaskInfo)
from ...helpers.mock import ResponseMock, ResponseListMock
from mock import patch
class TestClient(TestCase):
def setUp(self):
self.client = Client('sho... | 40.262963 | 92 | 0.458835 | from decimal import Decimal
from unittest import TestCase
from komtet_kassa_sdk.v1 import (Client, EmployeeType, Task, TaskInfo)
from ...helpers.mock import ResponseMock, ResponseListMock
from mock import patch
class TestClient(TestCase):
def setUp(self):
self.client = Client('shop-id', 'secret-key')
... | true | true |
1c406589588a96bfb0f30855c900c12a8e8768ae | 860 | py | Python | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | # Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Author(s): Amir Safdarian <a... | 66.153846 | 108 | 0.711628 | from domain_messages.ControlState.ControlState_Power_Setpoint import ControlStatePowerSetpointMessage | true | true |
1c4066b9c3a023a45235f50ef54de81eefaf6e3c | 288 | py | Python | apps.py | audacious-software/Passive-Data-Kit-Codebook | 84533014f6f3aaa6b7cdb1bcf095633c65c94d01 | [
"Apache-2.0"
] | null | null | null | apps.py | audacious-software/Passive-Data-Kit-Codebook | 84533014f6f3aaa6b7cdb1bcf095633c65c94d01 | [
"Apache-2.0"
] | null | null | null | apps.py | audacious-software/Passive-Data-Kit-Codebook | 84533014f6f3aaa6b7cdb1bcf095633c65c94d01 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class PassiveDataKitCodebookConfig(AppConfig):
name = 'passive_data_kit_codebook'
verbose_name = 'Passive Data Kit: Codebook'
default_auto_field = 'django.db.models.AutoField'
| 28.8 | 53 | 0.767361 | from __future__ import unicode_literals
from django.apps import AppConfig
class PassiveDataKitCodebookConfig(AppConfig):
name = 'passive_data_kit_codebook'
verbose_name = 'Passive Data Kit: Codebook'
default_auto_field = 'django.db.models.AutoField'
| true | true |
1c4068bf10d2d520e30f6471fcec8d75bacda1dc | 2,900 | py | Python | persistent_settings.py | ryanvolz/discord_bot_utils | 4895fa351f6495bda3dd9aab7561984874b8a3d3 | [
"BSD-3-Clause"
] | null | null | null | persistent_settings.py | ryanvolz/discord_bot_utils | 4895fa351f6495bda3dd9aab7561984874b8a3d3 | [
"BSD-3-Clause"
] | null | null | null | persistent_settings.py | ryanvolz/discord_bot_utils | 4895fa351f6495bda3dd9aab7561984874b8a3d3 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2020 Ryan Volz
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
#
# The full license is in the LICENSE file, distributed with this software.
#
# SPDX-License-Identifier: BSD-3-Clause
# -----... | 31.868132 | 82 | 0.594828 | import os
import pathlib
import ruamel.yaml
__all__ = ("yaml", "DiscordIDSettings")
yaml = ruamel.yaml.YAML(typ="safe")
yaml.default_flow_style = False
def load_persistent_settings(path):
settings = {}
if path.exists():
with open(path, "r") as f:
persistent = yaml.load(f)
if per... | true | true |
1c406957c4699002c219b6c7a34acd93600c681c | 28,082 | py | Python | bridgedb/strings.py | isislovecruft/bridgedb | 5ca53926d4bf32fe2cdd2ae3f2dba9e7a6f91b4e | [
"BSD-3-Clause-Clear"
] | 4 | 2016-04-18T06:30:54.000Z | 2019-07-17T14:02:45.000Z | bridgedb/strings.py | isislovecruft/bridgedb | 5ca53926d4bf32fe2cdd2ae3f2dba9e7a6f91b4e | [
"BSD-3-Clause-Clear"
] | null | null | null | bridgedb/strings.py | isislovecruft/bridgedb | 5ca53926d4bf32fe2cdd2ae3f2dba9e7a6f91b4e | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 ; test-case-name: bridgedb.test.test_strings ; -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# :copyright: (c) 2007-2017, The Tor Project, Inc.
# (c) 2013-2017, Isis Lovecruft
# (... | 49.614841 | 90 | 0.817143 |
from __future__ import unicode_literals
# 1) We don't use Python2.6, and
# honestly, all of Python2) should die.
from collections import OrderedDict
def _(text):
return text
# TRANSLATORS: Please do not translate the word "TYPE".
EMAIL_MISC_TEXT = {
0: _("""\
[This is an automated message; ple... | true | true |
1c40697e10a1872eee7320fa943aea76e01aa80d | 7,643 | py | Python | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
try:
from pygame.transform import flip, rotate
import pygame
except ImportError:
logger.error('cannot import pygame (is it installed?)')
raise
... | 29.855469 | 80 | 0.593223 | import logging
logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
try:
from pygame.transform import flip, rotate
import pygame
except ImportError:
logger.error('cannot import pygame (is it installed?)')
raise
... | true | true |
1c406a7714bf55168d96649919c5b080acdc4ae3 | 831 | py | Python | kubernetes/test/test_batch_api.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/test/test_batch_api.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_batch_api.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 18.466667 | 105 | 0.683514 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.apis.batch_api import BatchApi
class TestBatchApi(unittest.TestCase):
def setUp(self):
self.api = kubernetes.client.apis.batch_a... | true | true |
1c406c26c41e6e23b2dd752576e0d4831ac43142 | 3,211 | py | Python | mysite/settings.py | ItisMamun/pyshop | 6b101b26ab4ccec558076951c094c96bc29a5f48 | [
"Apache-2.0"
] | null | null | null | mysite/settings.py | ItisMamun/pyshop | 6b101b26ab4ccec558076951c094c96bc29a5f48 | [
"Apache-2.0"
] | null | null | null | mysite/settings.py | ItisMamun/pyshop | 6b101b26ab4ccec558076951c094c96bc29a5f48 | [
"Apache-2.0"
] | null | null | null | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 3.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# ... | 25.688 | 91 | 0.696979 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'b#s*_o(3t3ai_k(c5po@h7a=nj5#vjkd3u7ckhnx@)mi=8fn67'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
1c406c5b1a022519d85a101436d9324921b83015 | 985 | py | Python | users/views.py | Kowies/ToDo-web-app | 30c0555fbe73464f36fc88c5d9a1d16ac309f327 | [
"MIT"
] | null | null | null | users/views.py | Kowies/ToDo-web-app | 30c0555fbe73464f36fc88c5d9a1d16ac309f327 | [
"MIT"
] | 4 | 2021-03-19T01:07:13.000Z | 2022-02-10T13:23:35.000Z | users/views.py | Kowies/ToDo-web-app | 30c0555fbe73464f36fc88c5d9a1d16ac309f327 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.forms import UserCreationForm
def index(request):
return HttpResponseRedirect(reverse('users:login'))
def logout_... | 29.848485 | 73 | 0.698477 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.forms import UserCreationForm
def index(request):
return HttpResponseRedirect(reverse('users:login'))
def logout_... | true | true |
1c406cd8fdb1878cf53168c030b0169aa8a44417 | 117,677 | py | Python | tk_ui/admin_program.py | SuperH-0630/HGSSystem | 4bd0b18cec810df4915fea9473adbea6faea4fe2 | [
"MIT"
] | null | null | null | tk_ui/admin_program.py | SuperH-0630/HGSSystem | 4bd0b18cec810df4915fea9473adbea6faea4fe2 | [
"MIT"
] | null | null | null | tk_ui/admin_program.py | SuperH-0630/HGSSystem | 4bd0b18cec810df4915fea9473adbea6faea4fe2 | [
"MIT"
] | null | null | null | import abc
import datetime
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfilename
from math import ceil
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.axes import Axes
import numpy as np
from ... | 38.318789 | 120 | 0.591483 | import abc
import datetime
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfilename
from math import ceil
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.axes import Axes
import numpy as np
from ... | true | true |
1c406cf931317f3609f36abd4dfd161f4fc847ba | 639 | py | Python | skimage/_shared/tests/test_utils.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:36.000Z | 2020-04-03T17:29:07.000Z | skimage/_shared/tests/test_utils.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | skimage/_shared/tests/test_utils.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 3 | 2019-12-31T23:21:40.000Z | 2020-04-03T17:29:08.000Z | from skimage._shared.utils import (copy_func, assert_nD)
import numpy.testing as npt
import numpy as np
from skimage._shared import testing
def test_assert_nD():
z = np.random.random(200**2).reshape((200, 200))
x = z[10:30, 30:10]
with testing.raises(ValueError):
assert_nD(x, 2)
def test_copyfun... | 20.612903 | 56 | 0.666667 | from skimage._shared.utils import (copy_func, assert_nD)
import numpy.testing as npt
import numpy as np
from skimage._shared import testing
def test_assert_nD():
z = np.random.random(200**2).reshape((200, 200))
x = z[10:30, 30:10]
with testing.raises(ValueError):
assert_nD(x, 2)
def test_copyfun... | true | true |
1c406d0a96895fcda9da1357f0051cc734c05025 | 333 | py | Python | users/forms.py | dragonrathony/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | 1 | 2020-06-17T13:45:54.000Z | 2020-06-17T13:45:54.000Z | users/forms.py | Honey4251996/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | 11 | 2021-03-19T07:55:39.000Z | 2022-03-12T00:34:55.000Z | users/forms.py | Honey4251996/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | null | null | null | from django import forms
class ProfileForm(forms.Form):
email = forms.CharField(max_length=100)
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100)
profile_image = forms.ImageField()
user_name = forms.CharField(max_length=100)
zip_code = forms.CharField(max... | 30.272727 | 48 | 0.750751 | from django import forms
class ProfileForm(forms.Form):
email = forms.CharField(max_length=100)
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100)
profile_image = forms.ImageField()
user_name = forms.CharField(max_length=100)
zip_code = forms.CharField(max... | true | true |
1c406d4a1cdf5e6d65955028d98693bacd126ff5 | 873 | py | Python | tools/validate-yaml.py | larsks/wh-test-repo | 8c6d38db4229073d64de7536fe0edb005f053647 | [
"Apache-2.0"
] | 44 | 2015-01-03T10:07:39.000Z | 2021-07-22T05:35:04.000Z | tools/validate-yaml.py | larsks/wh-test-repo | 8c6d38db4229073d64de7536fe0edb005f053647 | [
"Apache-2.0"
] | 10 | 2015-02-10T04:55:44.000Z | 2016-04-28T15:08:16.000Z | tools/validate-yaml.py | larsks/wh-test-repo | 8c6d38db4229073d64de7536fe0edb005f053647 | [
"Apache-2.0"
] | 31 | 2015-01-05T05:38:58.000Z | 2019-11-08T16:05:02.000Z | #!/usr/bin/python
import sys
import argparse
import yaml
import logging
def parse_args():
p = argparse.ArgumentParser()
p.add_argument('--verbose', '-v',
action='store_const',
const='INFO',
dest='loglevel')
p.add_argument('input', nargs='*')
p.... | 22.384615 | 52 | 0.532646 |
import sys
import argparse
import yaml
import logging
def parse_args():
p = argparse.ArgumentParser()
p.add_argument('--verbose', '-v',
action='store_const',
const='INFO',
dest='loglevel')
p.add_argument('input', nargs='*')
p.set_defaults(logle... | true | true |
1c406dcbf96d4f7d8fec9c9c3fac3b11057f2d2c | 552 | py | Python | dashboard/internet_nl_dashboard/logic/account.py | bslavin/Internet.nl-dashboard | 5fd6d8fe8edb5f181727ddd1729697d9fc586c29 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/logic/account.py | bslavin/Internet.nl-dashboard | 5fd6d8fe8edb5f181727ddd1729697d9fc586c29 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/logic/account.py | bslavin/Internet.nl-dashboard | 5fd6d8fe8edb5f181727ddd1729697d9fc586c29 | [
"Apache-2.0"
] | null | null | null | import logging
from dashboard.internet_nl_dashboard.logic import operation_response
log = logging.getLogger(__package__)
def save_report_settings(account, report_settings):
account.report_settings = report_settings.get('filters', {})
account.save()
return operation_response(success=True, message="setti... | 26.285714 | 71 | 0.762681 | import logging
from dashboard.internet_nl_dashboard.logic import operation_response
log = logging.getLogger(__package__)
def save_report_settings(account, report_settings):
account.report_settings = report_settings.get('filters', {})
account.save()
return operation_response(success=True, message="setti... | true | true |
1c406e877ea7a560462b026bd111e0a32e55ae7f | 683 | py | Python | model/process_selfie_data.py | imdeepmind/AgeGenderNetwork | 845a8b8f15aa9ce1ae6ff55f8f3ca9213d490323 | [
"MIT"
] | 1 | 2019-10-14T15:18:05.000Z | 2019-10-14T15:18:05.000Z | model/process_selfie_data.py | imdeepmind/AgeGenderNetwork | 845a8b8f15aa9ce1ae6ff55f8f3ca9213d490323 | [
"MIT"
] | null | null | null | model/process_selfie_data.py | imdeepmind/AgeGenderNetwork | 845a8b8f15aa9ce1ae6ff55f8f3ca9213d490323 | [
"MIT"
] | null | null | null | ## IMPORTING THE DEPENDENCIES
import pandas as pd
import numpy as np
selfie_data = './dataset/unprocessed/Selfie-dataset/selfie_dataset.txt'
file = open(selfie_data, 'r')
selfie_file = file.read()
selfie_file_lines = selfie_file.split('\n')
un_selfie_data = []
for selfie in selfie_file_lines:
temp = selfie.split... | 27.32 | 117 | 0.708638 | import pandas as pd
import numpy as np
selfie_data = './dataset/unprocessed/Selfie-dataset/selfie_dataset.txt'
file = open(selfie_data, 'r')
selfie_file = file.read()
selfie_file_lines = selfie_file.split('\n')
un_selfie_data = []
for selfie in selfie_file_lines:
temp = selfie.split(' ')
if len(temp) > 3:
... | true | true |
1c406ead37561eefa4f97040eed189818c389e87 | 12,958 | py | Python | pymodbus/register_read_message.py | CS536-Modbus-QUIC/pymodbus | 337d090f04922c9440913927593f26cd9388b141 | [
"BSD-3-Clause"
] | 1,125 | 2017-05-11T06:11:36.000Z | 2022-03-31T02:59:45.000Z | pymodbus/register_read_message.py | Fannxy/pymodbus | c5772b35ae3f29d1947f3ab453d8d00df846459f | [
"BSD-3-Clause"
] | 575 | 2017-05-12T02:46:55.000Z | 2022-03-31T16:00:33.000Z | pymodbus/register_read_message.py | Fannxy/pymodbus | c5772b35ae3f29d1947f3ab453d8d00df846459f | [
"BSD-3-Clause"
] | 516 | 2017-05-19T14:06:06.000Z | 2022-03-31T06:10:13.000Z | '''
Register Reading Request/Response
---------------------------------
'''
import struct
from pymodbus.pdu import ModbusRequest
from pymodbus.pdu import ModbusResponse
from pymodbus.pdu import ModbusExceptions as merror
from pymodbus.compat import int2byte, byte2int
class ReadRegistersRequestBase(ModbusRequest):
... | 35.994444 | 81 | 0.643927 | import struct
from pymodbus.pdu import ModbusRequest
from pymodbus.pdu import ModbusResponse
from pymodbus.pdu import ModbusExceptions as merror
from pymodbus.compat import int2byte, byte2int
class ReadRegistersRequestBase(ModbusRequest):
_rtu_frame_size = 8
def __init__(self, address, count, **kwargs):
... | true | true |
1c406f0f0c0ad9459cb2bf63128af200f42bf7f9 | 3,480 | py | Python | vilbert/datasets/__init__.py | ThierryDeruyttere/vilbert-Talk2car | 6476b16970cfd0d88e09beb9a57cc5c39b7acb3f | [
"MIT"
] | null | null | null | vilbert/datasets/__init__.py | ThierryDeruyttere/vilbert-Talk2car | 6476b16970cfd0d88e09beb9a57cc5c39b7acb3f | [
"MIT"
] | null | null | null | vilbert/datasets/__init__.py | ThierryDeruyttere/vilbert-Talk2car | 6476b16970cfd0d88e09beb9a57cc5c39b7acb3f | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .concept_cap_dataset import (
ConceptCapLoaderTrain,
ConceptCapLoaderVal,
ConceptCapLoaderRetrieval,
)
from .foil_dataset impo... | 35.510204 | 94 | 0.786207 |
from .concept_cap_dataset import (
ConceptCapLoaderTrain,
ConceptCapLoaderVal,
ConceptCapLoaderRetrieval,
)
from .foil_dataset import FoilClassificationDataset
from .vqa_dataset import VQAClassificationDataset
from .vqa_mc_dataset import VQAMultipleChoiceDataset
from .nlvr2_dataset import NLVR2Dataset
fro... | true | true |
1c406f6be4a4ca2aa5169e352c87433ba660e116 | 676 | py | Python | zksync/config/logger_config.py | zksync-sdk/schnorr-musig-sdk-python | e853b1fc54fcff1c896a6aaac44b0c72dd393a01 | [
"MIT"
] | 1 | 2021-05-19T10:05:37.000Z | 2021-05-19T10:05:37.000Z | zksync/config/logger_config.py | zksync-sdk/schnorr-musig-sdk-python | e853b1fc54fcff1c896a6aaac44b0c72dd393a01 | [
"MIT"
] | 2 | 2021-03-10T12:38:40.000Z | 2021-05-21T10:28:11.000Z | zksync/config/logger_config.py | zksync-sdk/schnorr-musig-sdk-python | e853b1fc54fcff1c896a6aaac44b0c72dd393a01 | [
"MIT"
] | 1 | 2021-05-19T10:05:38.000Z | 2021-05-19T10:05:38.000Z | import yaml
import importlib.resources as pkg_resources
class LoggerConfig:
@staticmethod
def console(verbosity: int = 0) -> dict:
stream = pkg_resources.open_binary('zksync.config', 'console.yaml')
config = yaml.load(stream, Loader=yaml.FullLoader)
config['loggers']['zksync']['level'] = LoggerConfig.... | 33.8 | 74 | 0.692308 | import yaml
import importlib.resources as pkg_resources
class LoggerConfig:
@staticmethod
def console(verbosity: int = 0) -> dict:
stream = pkg_resources.open_binary('zksync.config', 'console.yaml')
config = yaml.load(stream, Loader=yaml.FullLoader)
config['loggers']['zksync']['level'] = LoggerConfig.... | true | true |
1c4070163b75d709b4de010864facb377cc8db96 | 875 | py | Python | app/my_blueprint/models.py | katherinejackson/embedded-time-series-study | 353ee2c6743d45df15951ddf13f87257948b9400 | [
"MIT"
] | null | null | null | app/my_blueprint/models.py | katherinejackson/embedded-time-series-study | 353ee2c6743d45df15951ddf13f87257948b9400 | [
"MIT"
] | null | null | null | app/my_blueprint/models.py | katherinejackson/embedded-time-series-study | 353ee2c6743d45df15951ddf13f87257948b9400 | [
"MIT"
] | null | null | null | def create(db):
class timemap(db.Model):
__tablename__ = "timemapV01"
ID = db.Column(db.Integer, primary_key=True, autoincrement=True)
participantID = db.Column(db.Integer, db.ForeignKey('participant.participantID'))
answeredOn = db.Column(db.DateTime, nullable=False, default=db.func... | 41.666667 | 89 | 0.64 | def create(db):
class timemap(db.Model):
__tablename__ = "timemapV01"
ID = db.Column(db.Integer, primary_key=True, autoincrement=True)
participantID = db.Column(db.Integer, db.ForeignKey('participant.participantID'))
answeredOn = db.Column(db.DateTime, nullable=False, default=db.func... | true | true |
1c40708cbda6e90df51ff794b98e99f4ef7798d5 | 4,583 | py | Python | gui/qt/contact_list.py | handsomegui/electrum | 5e8c710c71318c9a7c275e0d9444322313ad36b2 | [
"MIT"
] | 2 | 2018-08-14T17:34:23.000Z | 2018-08-28T06:47:33.000Z | gui/qt/contact_list.py | handsomegui/electrum | 5e8c710c71318c9a7c275e0d9444322313ad36b2 | [
"MIT"
] | null | null | null | gui/qt/contact_list.py | handsomegui/electrum | 5e8c710c71318c9a7c275e0d9444322313ad36b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | 43.647619 | 119 | 0.676631 | import webbrowser
from electroncash.i18n import _
import electroncash.web as web
from electroncash.address import Address
from electroncash.plugins import run_hook
from electroncash.util import FileImportFailed
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import (
QAbstractItemView, QF... | true | true |
1c407144dc5b30a3c147d792ef3b1d5e7cb38638 | 8,415 | py | Python | docs/examples/Metrics.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | docs/examples/Metrics.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | docs/examples/Metrics.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
Metrics Example
===============
This example is going to look at metrics, and how they can be used to assess algorithm performance.
"""
# %%
# Building a Simple Simulation and Tracker
# ----------------------------------------
# For simplicity, we are going to quickly build a... | 38.424658 | 99 | 0.746643 |
import datetime
import numpy as np
import matplotlib.pyplot as plt
from stonesoup.dataassociator.neighbour import GNNWith2DAssignment
from stonesoup.deleter.error import CovarianceBasedDeleter
from stonesoup.hypothesiser.distance import DistanceHypothesiser
from stonesoup.initiator.simple import MultiMeasurementIni... | true | true |
1c40714fabd2d717595b36f1580b9b068d5c55e6 | 947 | py | Python | adapters/heiman/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | adapters/heiman/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | adapters/heiman/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | from adapters.contact_adapter import ContactAdapter
from adapters.generic.smoke_sensor import SmokeSensorAdapter
from adapters.generic.water_leak_sensor import WaterLeakSensorAdapter
from adapters.heiman.HS1CAE import HS1CAE
from adapters.heiman.HS1WLE import HS1WLE
from adapters.heiman.HS2SK import HS2SK
heiman_adap... | 47.35 | 90 | 0.691658 | from adapters.contact_adapter import ContactAdapter
from adapters.generic.smoke_sensor import SmokeSensorAdapter
from adapters.generic.water_leak_sensor import WaterLeakSensorAdapter
from adapters.heiman.HS1CAE import HS1CAE
from adapters.heiman.HS1WLE import HS1WLE
from adapters.heiman.HS2SK import HS2SK
heiman_adap... | true | true |
1c4072ac7511fa7966efacb5742ad5215651220c | 601 | py | Python | mathgenerator/funcs/compareFractionsFunc.py | anshitabaid/mathgenerator | d95dd5e29c76561b35d5d18ab249d237d7a927e2 | [
"MIT"
] | null | null | null | mathgenerator/funcs/compareFractionsFunc.py | anshitabaid/mathgenerator | d95dd5e29c76561b35d5d18ab249d237d7a927e2 | [
"MIT"
] | null | null | null | mathgenerator/funcs/compareFractionsFunc.py | anshitabaid/mathgenerator | d95dd5e29c76561b35d5d18ab249d237d7a927e2 | [
"MIT"
] | null | null | null | from .__init__ import *
def compareFractionsFunc(maxVal=10):
a = random.randint(1, maxVal)
b = random.randint(1, maxVal)
c = random.randint(1, maxVal)
d = random.randint(1, maxVal)
while (a == b):
b = random.randint(1, maxVal)
while (c == d):
d = random.randint(1, maxVal)
... | 22.259259 | 84 | 0.560732 | from .__init__ import *
def compareFractionsFunc(maxVal=10):
a = random.randint(1, maxVal)
b = random.randint(1, maxVal)
c = random.randint(1, maxVal)
d = random.randint(1, maxVal)
while (a == b):
b = random.randint(1, maxVal)
while (c == d):
d = random.randint(1, maxVal)
... | true | true |
1c407324ce288a1acf26a863eb26d2ce2206c673 | 25,089 | py | Python | lib/sqlalchemy/util/_collections.py | vishvananda/sqlalchemy | 762f41502384f8fcdc07b4c492738e32d4071160 | [
"MIT"
] | 8 | 2017-07-18T18:35:10.000Z | 2022-02-01T19:52:57.000Z | lib/sqlalchemy/util/_collections.py | RetailArchitects/sqlalchemy | 399a5c96b2fd0e0f2f0cdda7766b31e37454eb2e | [
"MIT"
] | null | null | null | lib/sqlalchemy/util/_collections.py | RetailArchitects/sqlalchemy | 399a5c96b2fd0e0f2f0cdda7766b31e37454eb2e | [
"MIT"
] | 6 | 2017-07-26T08:51:10.000Z | 2021-03-04T10:16:37.000Z | # util/_collections.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Collection classes and helpers."""
import sys
import itertools
import weakref... | 27.692053 | 97 | 0.599466 |
import sys
import itertools
import weakref
import operator
from langhelpers import symbol
from compat import time_func, threading
EMPTY_SET = frozenset()
class NamedTuple(tuple):
def __new__(cls, vals, labels=None):
t = tuple.__new__(cls, vals)
if labels:
t.__dict__.update(zip(labe... | true | true |
1c40732d6dfeb4b553373661f07fac7e1d87c994 | 681 | py | Python | report/bombing.py | Yagg/gran | 37cf8abab765224427fb06535c5211d824ade711 | [
"MIT"
] | null | null | null | report/bombing.py | Yagg/gran | 37cf8abab765224427fb06535c5211d824ade711 | [
"MIT"
] | null | null | null | report/bombing.py | Yagg/gran | 37cf8abab765224427fb06535c5211d824ade711 | [
"MIT"
] | null | null | null | # -*- coding: utf_8 -*-
__author__ = 'Yagg'
class Bombing:
def __init__(self, attackerName, defenderName, planetNum, planetName, population, industry, production, capitals,
materials, colonists, attackStrength, status):
self.attackerName = attackerName
self.defenderName = defenderN... | 34.05 | 117 | 0.662261 | __author__ = 'Yagg'
class Bombing:
def __init__(self, attackerName, defenderName, planetNum, planetName, population, industry, production, capitals,
materials, colonists, attackStrength, status):
self.attackerName = attackerName
self.defenderName = defenderName
self.planetN... | true | true |
1c407462bbdaa26d432e1590a93ca57d9afdd86b | 1,938 | py | Python | libs/functional.py | fan84sunny/2021-training-courses | b1327d572563b3928e740d92d2cf202315096093 | [
"MIT"
] | null | null | null | libs/functional.py | fan84sunny/2021-training-courses | b1327d572563b3928e740d92d2cf202315096093 | [
"MIT"
] | null | null | null | libs/functional.py | fan84sunny/2021-training-courses | b1327d572563b3928e740d92d2cf202315096093 | [
"MIT"
] | null | null | null | from typing import List, Union, Tuple
import numpy as np
class Variable:
def __init__(self, value=None):
self.value = value
self.grad = None
class Polynomial:
def __init__(self, a: List = None):
self.a = np.array(a)
def __call__(self, x: Union[float, int]) -> Variable:
... | 28.925373 | 114 | 0.567595 | from typing import List, Union, Tuple
import numpy as np
class Variable:
def __init__(self, value=None):
self.value = value
self.grad = None
class Polynomial:
def __init__(self, a: List = None):
self.a = np.array(a)
def __call__(self, x: Union[float, int]) -> Variable:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.