hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c146c3356a28c376e29290d0eff4e421e491ebe | 2,011 | py | Python | app/alpaca/alpacaCryptoDaily.py | kyoungd/material-stock-finder | 021c5cf09f642b04bc9e136fb95915bda19508cd | [
"MIT"
] | null | null | null | app/alpaca/alpacaCryptoDaily.py | kyoungd/material-stock-finder | 021c5cf09f642b04bc9e136fb95915bda19508cd | [
"MIT"
] | null | null | null | app/alpaca/alpacaCryptoDaily.py | kyoungd/material-stock-finder | 021c5cf09f642b04bc9e136fb95915bda19508cd | [
"MIT"
] | 1 | 2022-03-26T06:50:59.000Z | 2022-03-26T06:50:59.000Z | from threading import Thread
import logging
from dbase import MarketDataDb, SynchronizeMarketData
from util import AlpacaAccess, RedisTimeFrame
from .alpacaDally import AlpacaDaily
from .alpacaHistorical import AlpacaHistorical
from util import RedisTimeFrame
class AlpacaCrypto(AlpacaDaily):
def __init__(self, s... | 38.673077 | 96 | 0.66186 | from threading import Thread
import logging
from dbase import MarketDataDb, SynchronizeMarketData
from util import AlpacaAccess, RedisTimeFrame
from .alpacaDally import AlpacaDaily
from .alpacaHistorical import AlpacaHistorical
from util import RedisTimeFrame
class AlpacaCrypto(AlpacaDaily):
def __init__(self, s... | true | true |
1c146cab6eb2f5087cd5ca27e063128a8f3d8b9b | 880 | py | Python | setup.py | mikemonteith-livi/wagtail-nhsuk-frontend | a51512a40e29a649d373274f7a44530954b11e93 | [
"MIT"
] | null | null | null | setup.py | mikemonteith-livi/wagtail-nhsuk-frontend | a51512a40e29a649d373274f7a44530954b11e93 | [
"MIT"
] | null | null | null | setup.py | mikemonteith-livi/wagtail-nhsuk-frontend | a51512a40e29a649d373274f7a44530954b11e93 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
INSTALL_REQUIRES = [
'Wagtail>=2.0',
]
TESTING_REQUIRES = [
"beautifulsoup4==4.8.2",
"Django>=3.1,<3.2",
"pytest==4.3.0",
"pytest-django==3.4.7",
"pytest-pythonpath==0.7.3",
]
LINT... | 23.783784 | 78 | 0.677273 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
INSTALL_REQUIRES = [
'Wagtail>=2.0',
]
TESTING_REQUIRES = [
"beautifulsoup4==4.8.2",
"Django>=3.1,<3.2",
"pytest==4.3.0",
"pytest-django==3.4.7",
"pytest-pythonpath==0.7.3",
]
LINT... | true | true |
1c146d45e347818f3e4ca82dc496615d4823152b | 3,260 | py | Python | inventoryanalytics/forecasting/holt_winters.py | gwr3n/inventoryanalytics | dd2a49386441bd51287d08ee73059cac7748c898 | [
"MIT"
] | 7 | 2018-06-17T02:45:33.000Z | 2021-06-11T09:13:06.000Z | inventoryanalytics/forecasting/holt_winters.py | gwr3n/inventoryanalytics | dd2a49386441bd51287d08ee73059cac7748c898 | [
"MIT"
] | 1 | 2021-02-07T03:33:22.000Z | 2021-06-02T21:11:59.000Z | inventoryanalytics/forecasting/holt_winters.py | gwr3n/inventoryanalytics | dd2a49386441bd51287d08ee73059cac7748c898 | [
"MIT"
] | 7 | 2018-07-14T19:45:43.000Z | 2021-10-12T09:45:04.000Z | import numpy as np, pandas as pd
import matplotlib.pyplot as plt, pylab as py
from statsmodels.tsa.api import ExponentialSmoothing
#from statsmodels.tsa.statespace.exponential_smoothing import ExponentialSmoothing
def sample_seasonal_random_walk(realisations, m):
np.random.seed(1234)
errors = np.random.normal(... | 44.657534 | 125 | 0.695399 | import numpy as np, pandas as pd
import matplotlib.pyplot as plt, pylab as py
from statsmodels.tsa.api import ExponentialSmoothing
def sample_seasonal_random_walk(realisations, m):
np.random.seed(1234)
errors = np.random.normal(0, 1, realisations)
Xt = errors[:m]
for t in range(m,realisations):
... | true | true |
1c146dc83d4e6bfa7d2595b3907679b19801336e | 379 | py | Python | runscripts/advance_time_python.py | tjwixtrom/verification | 00b42da31502a06388f826c3de359d07997496dc | [
"BSD-3-Clause"
] | 2 | 2019-08-05T13:44:18.000Z | 2022-02-16T14:06:54.000Z | runscripts/advance_time_python.py | tjwixtrom/wrf-scripts | 00b42da31502a06388f826c3de359d07997496dc | [
"BSD-3-Clause"
] | 3 | 2018-07-25T16:33:09.000Z | 2018-08-23T14:57:08.000Z | runscripts/advance_time_python.py | tjwixtrom/wrf-scripts | 00b42da31502a06388f826c3de359d07997496dc | [
"BSD-3-Clause"
] | null | null | null | #!/home/twixtrom/miniconda3/envs/research/bin/python
# Python script for advancing time by an arbitrary number of days
from datetime import datetime, timedelta
import sys
indate = sys.argv[1]
ndays = sys.argv[2]
nhours = sys.argv[3]
date1 = datetime.strptime(indate, '%Y%m%d%H')
date2 = date1 + timedelta(days=int(nd... | 25.266667 | 65 | 0.736148 |
from datetime import datetime, timedelta
import sys
indate = sys.argv[1]
ndays = sys.argv[2]
nhours = sys.argv[3]
date1 = datetime.strptime(indate, '%Y%m%d%H')
date2 = date1 + timedelta(days=int(ndays), hours=int(nhours))
print(date2.strftime('%Y%m%d%H'))
| true | true |
1c146e041e78277a91b9c4e266f0ccba88b96a50 | 255 | py | Python | manage.py | oneyanshi/the-compendium | a4bd7e2d3897bd4a69e742c8b41af6190bd6a53a | [
"MIT"
] | null | null | null | manage.py | oneyanshi/the-compendium | a4bd7e2d3897bd4a69e742c8b41af6190bd6a53a | [
"MIT"
] | null | null | null | manage.py | oneyanshi/the-compendium | a4bd7e2d3897bd4a69e742c8b41af6190bd6a53a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "capstone.settings.dev")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.181818 | 76 | 0.772549 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "capstone.settings.dev")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c146f3306d0615506138a528f78036753716e0d | 13,764 | py | Python | arviz/data/io_numpyro.py | FabioRosado/arviz | 6b958cc5abeb0cc3a1186f4a3dbeeaba73b899ee | [
"Apache-2.0"
] | 1 | 2021-07-10T19:08:49.000Z | 2021-07-10T19:08:49.000Z | arviz/data/io_numpyro.py | FabioRosado/arviz | 6b958cc5abeb0cc3a1186f4a3dbeeaba73b899ee | [
"Apache-2.0"
] | null | null | null | arviz/data/io_numpyro.py | FabioRosado/arviz | 6b958cc5abeb0cc3a1186f4a3dbeeaba73b899ee | [
"Apache-2.0"
] | null | null | null | """NumPyro-specific conversion code."""
import logging
from typing import Callable, Optional
import numpy as np
from .. import utils
from ..rcparams import rcParams
from .base import dict_to_dataset, requires
from .inference_data import InferenceData
_log = logging.getLogger(__name__)
class NumPyroConverter:
"... | 36.509284 | 99 | 0.600044 | import logging
from typing import Callable, Optional
import numpy as np
from .. import utils
from ..rcparams import rcParams
from .base import dict_to_dataset, requires
from .inference_data import InferenceData
_log = logging.getLogger(__name__)
class NumPyroConverter:
model = None nchains = None ... | true | true |
1c147065c4e6229475b31633ed33d3e3927b2793 | 7,310 | py | Python | dash/_utils.py | tmpacifitech/dash | d0d8adbbc10f8c5cca16b0e6ab9b6c8e8d07994a | [
"MIT"
] | 17,143 | 2015-07-14T17:19:05.000Z | 2022-03-31T10:03:39.000Z | dash/_utils.py | sthagen/dash | b3918ff798a51462687ff36e9e56c079c9f463cb | [
"MIT"
] | 1,630 | 2015-11-17T22:15:41.000Z | 2022-03-31T09:15:07.000Z | dash/_utils.py | sthagen/dash | b3918ff798a51462687ff36e9e56c079c9f463cb | [
"MIT"
] | 1,970 | 2015-07-12T07:05:14.000Z | 2022-03-30T19:58:09.000Z | # -*- coding: utf-8 -*-
import shlex
import sys
import uuid
import hashlib
import collections
import subprocess
import logging
import io
import json
from functools import wraps
from . import exceptions
logger = logging.getLogger()
def to_json(value):
# pylint: disable=import-outside-toplevel
from plotly.io.j... | 29.24 | 87 | 0.574829 | import shlex
import sys
import uuid
import hashlib
import collections
import subprocess
import logging
import io
import json
from functools import wraps
from . import exceptions
logger = logging.getLogger()
def to_json(value):
from plotly.io.json import to_json_plotly
return to_json_plotly(value)
def ... | true | true |
1c14710895148d33eb615273606c7dc2a46fb718 | 154 | py | Python | recipes/templatetags/user_filters.py | ilyukevich/foodgram-project | 458b01d6696687ff6476a8da343da3590699558f | [
"MIT"
] | null | null | null | recipes/templatetags/user_filters.py | ilyukevich/foodgram-project | 458b01d6696687ff6476a8da343da3590699558f | [
"MIT"
] | null | null | null | recipes/templatetags/user_filters.py | ilyukevich/foodgram-project | 458b01d6696687ff6476a8da343da3590699558f | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
@register.filter
def add_class(field, css):
return field.as_widget(attrs={"class": css})
| 17.111111 | 48 | 0.74026 | from django import template
register = template.Library()
@register.filter
def add_class(field, css):
return field.as_widget(attrs={"class": css})
| true | true |
1c147183f3e148c88eef2ee0da8e95350ab888de | 798 | py | Python | test/xslt/test_text.py | zepheira/amara | d3ffe07d6e2266b34d72b012a82d572c8edbf1e7 | [
"Apache-2.0"
] | 6 | 2015-01-30T03:50:36.000Z | 2022-03-20T16:09:58.000Z | test/xslt/test_text.py | zepheira/amara | d3ffe07d6e2266b34d72b012a82d572c8edbf1e7 | [
"Apache-2.0"
] | 2 | 2015-02-04T17:18:47.000Z | 2019-09-27T23:39:52.000Z | test/xslt/test_text.py | zepheira/amara | d3ffe07d6e2266b34d72b012a82d572c8edbf1e7 | [
"Apache-2.0"
] | 6 | 2015-02-04T16:16:18.000Z | 2019-10-30T20:07:48.000Z | ########################################################################
# test/xslt/test_text.py
from xslt_support import _run_html
def test_text_1():
"""<xsl:text> with disable-output-escaping='yes'"""
_run_html(
source_xml = """<noescape>dummy</noescape>""",
transform_xml = """<?xml version... | 25.741935 | 85 | 0.570175 |
from xslt_support import _run_html
def test_text_1():
_run_html(
source_xml = """<noescape>dummy</noescape>""",
transform_xml = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<x... | true | true |
1c14747b2a777458653f0fe13115aaec76b21d6e | 2,520 | py | Python | syntropy_sdk/models/vpp_callable_object.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | 1 | 2020-12-17T17:30:12.000Z | 2020-12-17T17:30:12.000Z | syntropy_sdk/models/vpp_callable_object.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | null | null | null | syntropy_sdk/models/vpp_callable_object.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
syntropy-controller
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
imp... | 28.965517 | 119 | 0.546429 |
import pprint
import re
import six
class VppCallableObject(object):
swagger_types = {}
attribute_map = {}
def __init__(self): self.discriminator = None
def to_dict(self):
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, a... | true | true |
1c1474cb5c926d68d9a37160ce790f26bed36a9a | 1,033 | py | Python | client/client_actions/__init__.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 1 | 2015-06-24T09:07:20.000Z | 2015-06-24T09:07:20.000Z | client/client_actions/__init__.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 3 | 2020-09-11T12:54:50.000Z | 2020-09-11T12:55:01.000Z | client/client_actions/__init__.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""A module to load all client plugins."""
# pylint: disable=unused-import,g-bad-import-order
import platform
import logging
# These imports populate the Action registry
from grr.lib import rdfvalue
from grr.lib import rdfvalues
from grr.client import actions
from grr.client.client_actions imp... | 31.30303 | 54 | 0.808325 |
import platform
import logging
from grr.lib import rdfvalue
from grr.lib import rdfvalues
from grr.client import actions
from grr.client.client_actions import admin
from grr.client.client_actions import enrol
from grr.client.client_actions import file_fingerprint
from grr.client.client_actions import grr_rekall
fro... | true | true |
1c14755d86b5589200c5681aeb6ea28cced48f17 | 2,980 | py | Python | utils/genkeypair.py | darkwyrm/mensago-utils | f8fd77ac895a5acd800eaacca90b0753cbaaf2cb | [
"MIT"
] | null | null | null | utils/genkeypair.py | darkwyrm/mensago-utils | f8fd77ac895a5acd800eaacca90b0753cbaaf2cb | [
"MIT"
] | null | null | null | utils/genkeypair.py | darkwyrm/mensago-utils | f8fd77ac895a5acd800eaacca90b0753cbaaf2cb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# genkeypair - a quick-and-dirty utility to create ed25519 signing key pairs and curve25519
# encryption key pairs
# Released under the terms of the MIT license
# ©2019-2020 Jon Yoder <jon@yoder.cloud>
import base64
import hashlib
import json
from os import path
import sys
import nacl.signin... | 31.368421 | 91 | 0.702349 |
import base64
import hashlib
import json
from os import path
import sys
import nacl.signing
import nacl.public
import nacl.secret
import nacl.utils
def generate_encpair(filename):
keypair = nacl.public.PrivateKey.generate()
hasher=hashlib.blake2b(digest_size=32)
hasher.update(keypair.public_key.encode())
pub... | true | true |
1c1475edf986327b87edb27f1da3bb5edb3c60e4 | 77,951 | py | Python | tests/components/light/test_init.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | null | null | null | tests/components/light/test_init.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 25 | 2021-10-02T10:01:14.000Z | 2022-03-31T06:11:49.000Z | tests/components/light/test_init.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 1 | 2021-12-10T10:33:28.000Z | 2021-12-10T10:33:28.000Z | """The tests for the Light component."""
from unittest.mock import MagicMock, mock_open, patch
import pytest
import voluptuous as vol
from homeassistant import core
from homeassistant.components import light
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_PLATFORM,
ENTITY_MATCH_ALL,
SERVICE_TOG... | 33.628559 | 119 | 0.624995 | from unittest.mock import MagicMock, mock_open, patch
import pytest
import voluptuous as vol
from homeassistant import core
from homeassistant.components import light
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_PLATFORM,
ENTITY_MATCH_ALL,
SERVICE_TOGGLE,
SERVICE_TURN_OFF,
SERVICE_TU... | true | true |
1c14760d19dbd44cd0aff87ab083bc3643a6fbbe | 7,490 | py | Python | papermill/execute.py | Pandinosaurus/papermill | 2d26912065575e955595e711fee3f4c415e8ea81 | [
"BSD-3-Clause"
] | 1 | 2021-12-03T23:00:57.000Z | 2021-12-03T23:00:57.000Z | papermill/execute.py | Pandinosaurus/papermill | 2d26912065575e955595e711fee3f4c415e8ea81 | [
"BSD-3-Clause"
] | null | null | null | papermill/execute.py | Pandinosaurus/papermill | 2d26912065575e955595e711fee3f4c415e8ea81 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import nbformat
from .log import logger
from .exceptions import PapermillExecutionError
from .iorw import load_notebook_node, write_ipynb, get_pretty_path, local_file_io_cwd
from .engines import papermill_engines
from .utils import chdir
from .parameterize import parameterize_noteb... | 33.587444 | 98 | 0.647797 |
import copy
import nbformat
from .log import logger
from .exceptions import PapermillExecutionError
from .iorw import load_notebook_node, write_ipynb, get_pretty_path, local_file_io_cwd
from .engines import papermill_engines
from .utils import chdir
from .parameterize import parameterize_notebook, parameterize_path, ... | true | true |
1c1476ee56378bc3dc901596963485ea074cf4ec | 5,167 | py | Python | components/collector/tests/source_collectors/api_source_collectors/test_jenkins_test_report.py | Gamer1120/quality-time | f3a0d6f75cd6055d78995d37feae72bc3e837e4b | [
"Apache-2.0"
] | 1 | 2021-02-22T07:53:36.000Z | 2021-02-22T07:53:36.000Z | components/collector/tests/source_collectors/api_source_collectors/test_jenkins_test_report.py | Gamer1120/quality-time | f3a0d6f75cd6055d78995d37feae72bc3e837e4b | [
"Apache-2.0"
] | 338 | 2020-10-29T04:28:09.000Z | 2022-02-22T04:09:33.000Z | components/collector/tests/source_collectors/api_source_collectors/test_jenkins_test_report.py | dicksnel/quality-time | 4c04f8852aa97175f2bca2b5c5391b3e09b657af | [
"Apache-2.0"
] | 1 | 2022-01-06T04:07:03.000Z | 2022-01-06T04:07:03.000Z | """Unit tests for the Jenkins test report source."""
from datetime import datetime
from tests.source_collectors.source_collector_test_case import SourceCollectorTestCase
from collector_utilities.functions import days_ago
class JenkinsTestReportTest(SourceCollectorTestCase):
"""Unit tests for the Jenkins test r... | 55.55914 | 115 | 0.623186 |
from datetime import datetime
from tests.source_collectors.source_collector_test_case import SourceCollectorTestCase
from collector_utilities.functions import days_ago
class JenkinsTestReportTest(SourceCollectorTestCase):
def setUp(self):
super().setUp()
self.sources = dict(source_id=dict(type... | true | true |
1c14779b9a5477f9f5f9e59a4068ff9cc3a64e8a | 3,744 | py | Python | demos/scripts/geometry_matrix_benchmark.py | ZedThree/tokamesh | 6671cd5a7e9b11ae7f81dee3dfcb85662145b35f | [
"MIT"
] | null | null | null | demos/scripts/geometry_matrix_benchmark.py | ZedThree/tokamesh | 6671cd5a7e9b11ae7f81dee3dfcb85662145b35f | [
"MIT"
] | null | null | null | demos/scripts/geometry_matrix_benchmark.py | ZedThree/tokamesh | 6671cd5a7e9b11ae7f81dee3dfcb85662145b35f | [
"MIT"
] | null | null | null |
from numpy import linspace, array, zeros, sqrt, sinc
from scipy.sparse import csc_matrix
from numpy.random import multivariate_normal
from scipy.integrate import simps
import matplotlib.pyplot as plt
from tokamesh.construction import equilateral_mesh
from tokamesh import TriangularMesh
from tokamesh.geometry import C... | 34.036364 | 132 | 0.750267 |
from numpy import linspace, array, zeros, sqrt, sinc
from scipy.sparse import csc_matrix
from numpy.random import multivariate_normal
from scipy.integrate import simps
import matplotlib.pyplot as plt
from tokamesh.construction import equilateral_mesh
from tokamesh import TriangularMesh
from tokamesh.geometry import C... | true | true |
1c1477ca2f40e9d6f402f52235d43bc06a19ac25 | 620 | py | Python | setup.py | directrix1/directrix_pkg | 7a6077a4f2223a90978b3bebb87a9350383ea469 | [
"MIT"
] | null | null | null | setup.py | directrix1/directrix_pkg | 7a6077a4f2223a90978b3bebb87a9350383ea469 | [
"MIT"
] | null | null | null | setup.py | directrix1/directrix_pkg | 7a6077a4f2223a90978b3bebb87a9350383ea469 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="directrix_pkg",
version="0.0.1",
author="Edward Flick",
author_email="directrix1@gmail.com",
description="A small example package",
long_description=long_description,
long_descript... | 28.181818 | 54 | 0.670968 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="directrix_pkg",
version="0.0.1",
author="Edward Flick",
author_email="directrix1@gmail.com",
description="A small example package",
long_description=long_description,
long_descript... | true | true |
1c1478357edfcabf490b52a942029757409a6f7a | 289 | py | Python | case_studies/__main__.py | adbarwell/DottyGenerator | 380281f3d7333db4f5fde52f25a4c32e471536b3 | [
"MIT"
] | null | null | null | case_studies/__main__.py | adbarwell/DottyGenerator | 380281f3d7333db4f5fde52f25a4c32e471536b3 | [
"MIT"
] | null | null | null | case_studies/__main__.py | adbarwell/DottyGenerator | 380281f3d7333db4f5fde52f25a4c32e471536b3 | [
"MIT"
] | 1 | 2021-06-29T10:33:43.000Z | 2021-06-29T10:33:43.000Z | import unittest
import sys
from case_studies.generate import generate_case_study
if __name__ == "__main__" :
if sys.argv[1] == 'BankMicroservice':
generate_case_study("BankMicroservice")
elif sys.argv[1] == 'TwoBuyerNegotiate':
generate_case_study("TwoBuyerNegotiate")
| 20.642857 | 53 | 0.747405 | import unittest
import sys
from case_studies.generate import generate_case_study
if __name__ == "__main__" :
if sys.argv[1] == 'BankMicroservice':
generate_case_study("BankMicroservice")
elif sys.argv[1] == 'TwoBuyerNegotiate':
generate_case_study("TwoBuyerNegotiate")
| true | true |
1c147865c966898935ed29530af52f54b6566cba | 1,199 | py | Python | .github/check_version.py | nanotech-empa/aiida-nanotech-empa | 4aeb5133c5c1367a09f195e9283333aa2d49e269 | [
"MIT"
] | null | null | null | .github/check_version.py | nanotech-empa/aiida-nanotech-empa | 4aeb5133c5c1367a09f195e9283333aa2d49e269 | [
"MIT"
] | 10 | 2020-09-05T11:04:34.000Z | 2022-02-01T11:14:36.000Z | .github/check_version.py | nanotech-empa/aiida-nanotech-empa | 4aeb5133c5c1367a09f195e9283333aa2d49e269 | [
"MIT"
] | null | null | null | """Check that version numbers match.
Check version number in setup.json and aiida_nanotech_empa/__init__.py and make sure
they match.
"""
from __future__ import absolute_import
from __future__ import print_function
import os
import json
import sys
this_path = os.path.split(os.path.realpath(__file__))[0]
# Get conten... | 32.405405 | 84 | 0.718932 | from __future__ import absolute_import
from __future__ import print_function
import os
import json
import sys
this_path = os.path.split(os.path.realpath(__file__))[0]
setup_fname = 'setup.json'
setup_path = os.path.join(this_path, os.pardir, setup_fname)
with open(setup_path, encoding="utf8") as f:
setup_content ... | true | true |
1c14787aa44a7b9c9d94cb821a9605ff6d1d8e6c | 3,077 | py | Python | njuptNet.py | Len-Jon/NjuptCmcc | 2a1725beb864ca8c766cb77d7aa1a946048d52e8 | [
"MIT"
] | 26 | 2020-11-28T03:31:54.000Z | 2022-01-11T12:31:07.000Z | njuptNet.py | Len-Jon/NjuptCmcc | 2a1725beb864ca8c766cb77d7aa1a946048d52e8 | [
"MIT"
] | 1 | 2020-11-28T14:41:55.000Z | 2020-11-29T08:26:07.000Z | njuptNet.py | Len-Jon/NjuptCmcc | 2a1725beb864ca8c766cb77d7aa1a946048d52e8 | [
"MIT"
] | 3 | 2020-11-29T09:21:36.000Z | 2021-06-06T07:19:36.000Z | import re
from urllib.parse import parse_qs, urlsplit
import requests
def getURL():
try:
response = requests.get("http://6.6.6.6/", timeout=3)
if response.url == "http://6.6.6.6/":
content = response.text
url = re.search("location.href=\\\"(http://.*)\\\"", content)
... | 29.586538 | 135 | 0.537212 | import re
from urllib.parse import parse_qs, urlsplit
import requests
def getURL():
try:
response = requests.get("http://6.6.6.6/", timeout=3)
if response.url == "http://6.6.6.6/":
content = response.text
url = re.search("location.href=\\\"(http://.*)\\\"", content)
... | true | true |
1c1478cd98596f1caa0939cd04dab3fb06838e84 | 3,602 | py | Python | backend/appapi/views/card_views.py | OpenPaymentNetwork/FerlySite | d4be3700343e82b992555600843305881632e17d | [
"MIT"
] | null | null | null | backend/appapi/views/card_views.py | OpenPaymentNetwork/FerlySite | d4be3700343e82b992555600843305881632e17d | [
"MIT"
] | null | null | null | backend/appapi/views/card_views.py | OpenPaymentNetwork/FerlySite | d4be3700343e82b992555600843305881632e17d | [
"MIT"
] | null | null | null | from backend.appapi.schemas import card_views_schemas as schemas
from backend.appapi.utils import get_device
from backend.database.serialize import serialize_card_request
from backend.database.models import CardRequest
from backend.appapi.utils import get_wc_token
from backend.wccontact import wc_contact
from pyramid.v... | 41.402299 | 111 | 0.681566 | from backend.appapi.schemas import card_views_schemas as schemas
from backend.appapi.utils import get_device
from backend.database.serialize import serialize_card_request
from backend.database.models import CardRequest
from backend.appapi.utils import get_wc_token
from backend.wccontact import wc_contact
from pyramid.v... | true | true |
1c14791b096e013de1c12b72089f17300c6f7fd0 | 917 | py | Python | synapse/rest/key/v2/__init__.py | iot-factory/synapse | d3ac8fd87d85bd40d40b475d7a6f12f74ea0ddb0 | [
"Apache-2.0"
] | null | null | null | synapse/rest/key/v2/__init__.py | iot-factory/synapse | d3ac8fd87d85bd40d40b475d7a6f12f74ea0ddb0 | [
"Apache-2.0"
] | null | null | null | synapse/rest/key/v2/__init__.py | iot-factory/synapse | d3ac8fd87d85bd40d40b475d7a6f12f74ea0ddb0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 35.269231 | 74 | 0.745911 |
from twisted.web.resource import Resource
from .local_key_resource import LocalKey
from .remote_key_resource import RemoteKey
class KeyApiV2Resource(Resource):
def __init__(self, hs):
Resource.__init__(self)
self.putChild("server", LocalKey(hs))
self.putChild("query", RemoteKey(hs))
| true | true |
1c147baac2fdf95b7e58b7917e3297725b82feb0 | 963 | py | Python | nextgensbl/users2/admin.py | mainglis/adminpanel | f8accd3f0f17651ea2496a0b3476882e2b18d2a9 | [
"BSD-3-Clause"
] | null | null | null | nextgensbl/users2/admin.py | mainglis/adminpanel | f8accd3f0f17651ea2496a0b3476882e2b18d2a9 | [
"BSD-3-Clause"
] | null | null | null | nextgensbl/users2/admin.py | mainglis/adminpanel | f8accd3f0f17651ea2496a0b3476882e2b18d2a9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# from __future__ import absolute_import, unicode_literals
#
# from django import forms
# from django.contrib import admin
# from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
# from django.contrib.auth.forms import UserChangeForm, UserCreationForm
#
# from .models import User
#
#
... | 28.323529 | 80 | 0.694704 | true | true | |
1c147be73af73259835187939c5cc212dc041c3a | 12,949 | py | Python | st2actions/st2actions/notifier/notifier.py | ekhavana/st2 | 2b47b0e317a2dfd7d92d63ec6dcf706493148890 | [
"Apache-2.0"
] | null | null | null | st2actions/st2actions/notifier/notifier.py | ekhavana/st2 | 2b47b0e317a2dfd7d92d63ec6dcf706493148890 | [
"Apache-2.0"
] | null | null | null | st2actions/st2actions/notifier/notifier.py | ekhavana/st2 | 2b47b0e317a2dfd7d92d63ec6dcf706493148890 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | 45.118467 | 99 | 0.659974 |
from datetime import datetime
import json
from kombu import Connection
from oslo_config import cfg
from st2common import log as logging
from st2common.constants.action import LIVEACTION_STATUS_SUCCEEDED
from st2common.constants.action import LIVEACTION_FAILED_STATES
from st2common.constants.action import LIVEACTION_... | true | true |
1c147ccfe46e46ccdd9f38daaba9263711c000ce | 494 | py | Python | NoteBooks/Curso de Python/Dojo/Ejercicios Integradores/Extract Text from pdf/extract.py | Alejandro-sin/Learning_Notebooks | 161d6bed4c7b1d171b45f61c0cc6fa91e9894aad | [
"MIT"
] | 1 | 2021-02-26T13:12:22.000Z | 2021-02-26T13:12:22.000Z | NoteBooks/Curso de Python/Dojo/Ejercicios Integradores/Extract Text from pdf/extract.py | Alejandro-sin/Learning_Notebooks | 161d6bed4c7b1d171b45f61c0cc6fa91e9894aad | [
"MIT"
] | null | null | null | NoteBooks/Curso de Python/Dojo/Ejercicios Integradores/Extract Text from pdf/extract.py | Alejandro-sin/Learning_Notebooks | 161d6bed4c7b1d171b45f61c0cc6fa91e9894aad | [
"MIT"
] | null | null | null | from PyPDF2 import PdfFileReader, PdfFileWriter
path ='QA.pdf'
pdf = PdfFileReader(path)
with open('QA.txt', 'w') as f:
for page_num in range(pdf.numPages):
print('Page: {0}'.format(page_num))
pageObj = pdf.getPage(page_num)
try:
txt = pageObj.extractText()
... | 27.444444 | 52 | 0.524291 | from PyPDF2 import PdfFileReader, PdfFileWriter
path ='QA.pdf'
pdf = PdfFileReader(path)
with open('QA.txt', 'w') as f:
for page_num in range(pdf.numPages):
print('Page: {0}'.format(page_num))
pageObj = pdf.getPage(page_num)
try:
txt = pageObj.extractText()
... | true | true |
1c147ce2d5216c18a13a87a0a21401208b0f5662 | 537,052 | py | Python | pysnmp-with-texts/CPQHSV-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CPQHSV-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CPQHSV-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CPQHSV-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CPQHSV-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:27:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | 213.709511 | 10,406 | 0.764146 | OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.impo... | true | true |
1c147db3ef61d935726b104e011ebb0df478230f | 8,227 | py | Python | octavia_tempest_plugin/tests/scenario/v2/test_l7rule.py | NeCTAR-RC/octavia-tempest-plugin | 5506c00b8d8972e6223499dd5a5da4c85c1ff836 | [
"Apache-2.0"
] | null | null | null | octavia_tempest_plugin/tests/scenario/v2/test_l7rule.py | NeCTAR-RC/octavia-tempest-plugin | 5506c00b8d8972e6223499dd5a5da4c85c1ff836 | [
"Apache-2.0"
] | null | null | null | octavia_tempest_plugin/tests/scenario/v2/test_l7rule.py | NeCTAR-RC/octavia-tempest-plugin | 5506c00b8d8972e6223499dd5a5da4c85c1ff836 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 GoDaddy
#
# 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 ... | 40.131707 | 78 | 0.635712 |
from uuid import UUID
from dateutil import parser
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from octavia_tempest_plugin.common import constants as const
from octavia_tempest_plugin.tests import test_base
from octavia_tempest_plugin.tests import wait... | true | true |
1c147e8fc680bf97e30d68f26d11e9a7e314d115 | 4,590 | py | Python | conans/client/generators/cmake_find_package.py | e-i-n-s/conan | af8d48000ea6f968f4605660e86cc6e985a71b04 | [
"MIT"
] | null | null | null | conans/client/generators/cmake_find_package.py | e-i-n-s/conan | af8d48000ea6f968f4605660e86cc6e985a71b04 | [
"MIT"
] | null | null | null | conans/client/generators/cmake_find_package.py | e-i-n-s/conan | af8d48000ea6f968f4605660e86cc6e985a71b04 | [
"MIT"
] | null | null | null | from conans.client.generators.cmake import DepsCppCmake
from conans.client.generators.cmake_find_package_common import target_template, CMakeFindPackageCommonMacros
from conans.client.generators.cmake_multi import extend
from conans.model import Generator
find_package_header = """
include(FindPackageHandleStandardArgs... | 44.134615 | 139 | 0.653377 | from conans.client.generators.cmake import DepsCppCmake
from conans.client.generators.cmake_find_package_common import target_template, CMakeFindPackageCommonMacros
from conans.client.generators.cmake_multi import extend
from conans.model import Generator
find_package_header = """
include(FindPackageHandleStandardArgs... | true | true |
1c147f84352a719e8b0c749109d14a6f509960ea | 989 | py | Python | app/app.py | mkschulze/flask-grakn | 64f47cc4ed9b78b41393a6c2509cebccec3e41c1 | [
"MIT"
] | 1 | 2020-08-23T16:45:46.000Z | 2020-08-23T16:45:46.000Z | app/app.py | mkschulze/flask-grakn | 64f47cc4ed9b78b41393a6c2509cebccec3e41c1 | [
"MIT"
] | null | null | null | app/app.py | mkschulze/flask-grakn | 64f47cc4ed9b78b41393a6c2509cebccec3e41c1 | [
"MIT"
] | null | null | null |
from grakn.client import GraknClient
from flask import Flask
from config import BaseConfig
def create_app():
# Create Flask server app
server = Flask(__name__)
server.config.from_object(BaseConfig)
connect_grakn(server)
register_blueprints(server)
return server
def connect_grakn(server):... | 27.472222 | 101 | 0.668352 |
from grakn.client import GraknClient
from flask import Flask
from config import BaseConfig
def create_app():
server = Flask(__name__)
server.config.from_object(BaseConfig)
connect_grakn(server)
register_blueprints(server)
return server
def connect_grakn(server):
with GraknClient(uri=... | true | true |
1c14811e0beec87e1b9ffc7e571da0f2ecd6a530 | 1,723 | py | Python | setup.py | LiamFlahive/tweepy | bedf722a1699cd5d51d2c54f70a175f233105e6c | [
"MIT"
] | null | null | null | setup.py | LiamFlahive/tweepy | bedf722a1699cd5d51d2c54f70a175f233105e6c | [
"MIT"
] | null | null | null | setup.py | LiamFlahive/tweepy | bedf722a1699cd5d51d2c54f70a175f233105e6c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#from distutils.core import setup
import re, uuid
from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
VERSIONFILE = "tweepy/__init__.py"
ver_file = o... | 35.163265 | 79 | 0.626814 | import re, uuid
from setuptools import setup, find_packages
try: from pip._internal.req import parse_requirements
except ImportError: from pip.req import parse_requirements
VERSIONFILE = "tweepy/__init__.py"
ver_file = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(V... | true | true |
1c14816e7dbe520321df3816c5294ff6fc7e6705 | 4,339 | py | Python | setup.py | jfrancis71/pytorch-lightning-bolts | 8a4cf8f61644c28d6df54ccffe3a52d6f5fce5a6 | [
"Apache-2.0"
] | null | null | null | setup.py | jfrancis71/pytorch-lightning-bolts | 8a4cf8f61644c28d6df54ccffe3a52d6f5fce5a6 | [
"Apache-2.0"
] | null | null | null | setup.py | jfrancis71/pytorch-lightning-bolts | 8a4cf8f61644c28d6df54ccffe3a52d6f5fce5a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
# Always prefer setuptools over distutils
from setuptools import find_packages, setup
try:
import builtins
except ImportError:
import __builtin__ as builtins
# https://packaging.python.org/guides/single-sourcing-package-version/
# http://blog.ionelmc.ro/2014/05/25/python-pack... | 39.09009 | 120 | 0.687255 |
import os
from setuptools import find_packages, setup
try:
import builtins
except ImportError:
import __builtin__ as builtins
PATH_ROOT = os.path.dirname(__file__)
builtins.__LIGHTNING_BOLT_SETUP__: bool = True
import pl_bolts
def load_requirements(path_dir=PATH_ROOT, file_name='requirements.txt', comm... | true | true |
1c1481cbab86b16cca585fc55e35c15161f7c874 | 6,645 | py | Python | in_syslog_bench/visualize/plot_pandas_Usage.py | calyptia/calyptia-fluentd-benchmark-aws-environment | 3900ec856d0b12d32676fab99a3e759e1229866b | [
"MIT"
] | null | null | null | in_syslog_bench/visualize/plot_pandas_Usage.py | calyptia/calyptia-fluentd-benchmark-aws-environment | 3900ec856d0b12d32676fab99a3e759e1229866b | [
"MIT"
] | 1 | 2022-02-07T07:59:11.000Z | 2022-02-07T07:59:11.000Z | in_syslog_bench/visualize/plot_pandas_Usage.py | calyptia/calyptia-fluentd-benchmark-aws-environment | 3900ec856d0b12d32676fab99a3e759e1229866b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import argparse
from ansible.parsing.dataloader import DataLoader
from ansible.inventory.manager import InventoryManager
parser = argparse.ArgumentParser(description='Visualize data as ... | 36.916667 | 116 | 0.659443 |
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import argparse
from ansible.parsing.dataloader import DataLoader
from ansible.inventory.manager import InventoryManager
parser = argparse.ArgumentParser(description='Visualize data as plot')
parser.add_argum... | true | true |
1c1481f90fa2664e34832f63a982f8c766c26ce2 | 3,850 | py | Python | tests/api/test_organization_relation.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/api/test_organization_relation.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/api/test_organization_relation.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | def test_read(client, seeder, utils):
user_id, admin_unit_id = seeder.setup_api_access()
(
other_user_id,
other_admin_unit_id,
relation_id,
) = seeder.create_any_admin_unit_relation(admin_unit_id)
url = utils.get_url(
"api_v1_organization_relation",
id=relation_i... | 30.555556 | 82 | 0.699221 | def test_read(client, seeder, utils):
user_id, admin_unit_id = seeder.setup_api_access()
(
other_user_id,
other_admin_unit_id,
relation_id,
) = seeder.create_any_admin_unit_relation(admin_unit_id)
url = utils.get_url(
"api_v1_organization_relation",
id=relation_i... | true | true |
1c14830e70e4b923121d2b771bdad8c2e74030a1 | 5,575 | py | Python | ch7-1.py | GoogleCloudPlatform/gce-oreilly | c5d847da354101a390ef68b7e7382d8b4d628e3f | [
"Apache-2.0"
] | 10 | 2015-01-10T15:19:29.000Z | 2021-08-19T00:09:55.000Z | ch7-1.py | GoogleCloudPlatform/gce-oreilly | c5d847da354101a390ef68b7e7382d8b4d628e3f | [
"Apache-2.0"
] | null | null | null | ch7-1.py | GoogleCloudPlatform/gce-oreilly | c5d847da354101a390ef68b7e7382d8b4d628e3f | [
"Apache-2.0"
] | 15 | 2015-10-06T00:31:07.000Z | 2021-10-09T17:07:51.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014 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 applicabl... | 31.145251 | 97 | 0.686099 |
"""Start an instance with a startup script.
Usage:
$ python ch7-1.py
You can also get help on all the command-line flags the program understands
by running:
$ python ch7-1.py --help
"""
import argparse
import httplib2
import os
import sys
from apiclient import discovery
from oauth2client import file
from oaut... | false | true |
1c1483d1dcab15b595534d5c228596ea3caf235b | 52,215 | py | Python | neutron/tests/unit/db/firewall/test_db_firewall.py | ksshanam/neutron-dvr | c0854ea0d1023ab42e1ef861f9b6ff480e985ac5 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/db/firewall/test_db_firewall.py | ksshanam/neutron-dvr | c0854ea0d1023ab42e1ef861f9b6ff480e985ac5 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/db/firewall/test_db_firewall.py | ksshanam/neutron-dvr | c0854ea0d1023ab42e1ef861f9b6ff480e985ac5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Big Switch Networks, 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 ... | 49.539848 | 79 | 0.526573 |
import contextlib
import logging
import mock
import webob.exc
from neutron.api import extensions as api_ext
from neutron.common import config
from neutron import context
from neutron.db.firewall import firewall_db as fdb
import neutron.extensions
from neutron.extensions import firewall
from neutron import manager
fr... | true | true |
1c14842008dd81a0aa15a1dd48c56e181960babb | 700 | py | Python | scripts/database/create_tables.py | patrickjchap/Static-Bug-Detectors-ASE-Artifact | 9104a6c9d8105725d3f2351893ff3f4022b02faa | [
"BSD-3-Clause"
] | 1 | 2022-01-07T09:32:48.000Z | 2022-01-07T09:32:48.000Z | scripts/database/create_tables.py | patrickjchap/Static-Bug-Detectors-ASE-Artifact | 9104a6c9d8105725d3f2351893ff3f4022b02faa | [
"BSD-3-Clause"
] | null | null | null | scripts/database/create_tables.py | patrickjchap/Static-Bug-Detectors-ASE-Artifact | 9104a6c9d8105725d3f2351893ff3f4022b02faa | [
"BSD-3-Clause"
] | 1 | 2021-11-19T00:33:30.000Z | 2021-11-19T00:33:30.000Z | import re
import sys
import pymysql.cursors
from db_utils import DatabaseConnection
def main():
db_name = sys.argv[1]
db = DatabaseConnection('root', 'password')
# Create and select DB
db.create_db(db_name)
db.select_database(db_name)
# Create auxillary data tables
db.create_clover_tab... | 21.875 | 47 | 0.707143 | import re
import sys
import pymysql.cursors
from db_utils import DatabaseConnection
def main():
db_name = sys.argv[1]
db = DatabaseConnection('root', 'password')
db.create_db(db_name)
db.select_database(db_name)
db.create_clover_table('covered_lines')
db.create_github_table('diff')... | true | true |
1c148487b4ce0aab5e897cb76657e0d78f0e9952 | 5,960 | py | Python | deploy/gen_analysis_tool_wxi.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | deploy/gen_analysis_tool_wxi.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | deploy/gen_analysis_tool_wxi.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | import sys
import os
import json
from xml.etree import ElementTree
from gen_dir_wxi import CommentedTreeBuilder, add_wix_to_path
def _adjacent_file(file_name):
import os.path
return os.path.join(os.path.dirname(os.path.abspath(__file__)), file_name)
def pretty_print_xml(xml_filename):
imp... | 52.280702 | 210 | 0.657215 | import sys
import os
import json
from xml.etree import ElementTree
from gen_dir_wxi import CommentedTreeBuilder, add_wix_to_path
def _adjacent_file(file_name):
import os.path
return os.path.join(os.path.dirname(os.path.abspath(__file__)), file_name)
def pretty_print_xml(xml_filename):
imp... | false | true |
1c148496721e085ebdf5e16f7643889d0bb6bbcc | 1,289 | py | Python | src/spaceone/notification/model/protocol_model.py | xellos00/notification | e091c1eaeaf54d2669ac204c027aacddabad382a | [
"Apache-2.0"
] | null | null | null | src/spaceone/notification/model/protocol_model.py | xellos00/notification | e091c1eaeaf54d2669ac204c027aacddabad382a | [
"Apache-2.0"
] | null | null | null | src/spaceone/notification/model/protocol_model.py | xellos00/notification | e091c1eaeaf54d2669ac204c027aacddabad382a | [
"Apache-2.0"
] | null | null | null | from mongoengine import *
from spaceone.core.model.mongo_model import MongoModel
class PluginInfo(EmbeddedDocument):
plugin_id = StringField(max_length=40)
version = StringField(max_length=255)
options = DictField(default=None)
metadata = DictField(default=None)
class Protocol(MongoModel):
proto... | 29.976744 | 100 | 0.616757 | from mongoengine import *
from spaceone.core.model.mongo_model import MongoModel
class PluginInfo(EmbeddedDocument):
plugin_id = StringField(max_length=40)
version = StringField(max_length=255)
options = DictField(default=None)
metadata = DictField(default=None)
class Protocol(MongoModel):
proto... | true | true |
1c1484d14b61e1d9ef656cd885d5a1c4e93833c0 | 247 | py | Python | manage.py | koatse/ilikethem | 962374ff8179a533dba3b00422d11bb819d8acde | [
"MIT"
] | null | null | null | manage.py | koatse/ilikethem | 962374ff8179a533dba3b00422d11bb819d8acde | [
"MIT"
] | null | null | null | manage.py | koatse/ilikethem | 962374ff8179a533dba3b00422d11bb819d8acde | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rein.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.454545 | 68 | 0.769231 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rein.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c14851e4f4be7edb684990cf89599ec69c6791e | 1,629 | py | Python | tests/test_issues/output/issue_260/issue_260c.py | hsolbrig/biolinkml | e93cfd547800beec897dd3d03c277b3b1eabe78a | [
"CC0-1.0"
] | null | null | null | tests/test_issues/output/issue_260/issue_260c.py | hsolbrig/biolinkml | e93cfd547800beec897dd3d03c277b3b1eabe78a | [
"CC0-1.0"
] | null | null | null | tests/test_issues/output/issue_260/issue_260c.py | hsolbrig/biolinkml | e93cfd547800beec897dd3d03c277b3b1eabe78a | [
"CC0-1.0"
] | null | null | null | # Auto generated from issue_260c.yaml by pythongen.py version: 0.4.0
# Generation date: 2020-10-01 22:58
# Schema: issue_260c
#
# id: http://example.org/tests/issue_260c
# description: Another small file to be imported
# license:
import dataclasses
import sys
from typing import Optional, List, Union, Dict, ClassVar, A... | 29.618182 | 91 | 0.788214 |
import dataclasses
import sys
from typing import Optional, List, Union, Dict, ClassVar, Any
from dataclasses import dataclass
from biolinkml.utils.slot import Slot
from biolinkml.utils.metamodelcore import empty_list, empty_dict, bnode
from biolinkml.utils.yamlutils import YAMLRoot, extended_str, extended_float, exten... | true | true |
1c14856c86dd87d1971182c5053ae19f3047660f | 2,863 | py | Python | assignment2/deeplearning/coco_utils.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment2/deeplearning/coco_utils.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment2/deeplearning/coco_utils.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | import os, json
import numpy as np
import h5py
BASE_DIR = 'deeplearning/datasets/coco_captioning'
def load_coco_data(base_dir=BASE_DIR,
max_train=None,
pca_features=True):
data = {}
caption_file = os.path.join(base_dir, 'coco2014_captions.h5')
with h5py.File(caption_f... | 33.682353 | 78 | 0.625917 | import os, json
import numpy as np
import h5py
BASE_DIR = 'deeplearning/datasets/coco_captioning'
def load_coco_data(base_dir=BASE_DIR,
max_train=None,
pca_features=True):
data = {}
caption_file = os.path.join(base_dir, 'coco2014_captions.h5')
with h5py.File(caption_f... | true | true |
1c1485845d6b623d4a47b82b164995ce787cedd5 | 63,458 | py | Python | lib/galaxy_test/base/populators.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 2 | 2017-03-28T12:11:41.000Z | 2017-04-22T02:58:25.000Z | lib/galaxy_test/base/populators.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2017-08-22T08:03:31.000Z | 2017-08-22T08:03:31.000Z | lib/galaxy_test/base/populators.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2019-01-16T22:21:54.000Z | 2019-01-16T22:21:54.000Z | import contextlib
import json
import os
import random
import string
import time
import unittest
from collections import namedtuple
from functools import wraps
from operator import itemgetter
try:
from nose.tools import nottest
except ImportError:
def nottest(x):
return x
import requests
import yaml
fro... | 40.290794 | 239 | 0.645372 | import contextlib
import json
import os
import random
import string
import time
import unittest
from collections import namedtuple
from functools import wraps
from operator import itemgetter
try:
from nose.tools import nottest
except ImportError:
def nottest(x):
return x
import requests
import yaml
fro... | true | true |
1c1485c0cda352991fdfb61780e00ee1c7e1309a | 1,926 | py | Python | tensorflow/contrib/keras/python/keras/__init__.py | wanglxi1/tensorflow | b7acb6abe0d88c674e8d149ae744b4c994434da6 | [
"Apache-2.0"
] | 4 | 2019-04-14T13:33:17.000Z | 2021-09-22T02:33:29.000Z | tensorflow/contrib/keras/python/keras/__init__.py | LaiPeter/tensorflow | 08ed32dbb9e8f67eec9efce3807b5bdb3933eb2f | [
"Apache-2.0"
] | 1 | 2021-02-02T23:00:07.000Z | 2021-02-02T23:00:07.000Z | tensorflow/contrib/keras/python/keras/__init__.py | LaiPeter/tensorflow | 08ed32dbb9e8f67eec9efce3807b5bdb3933eb2f | [
"Apache-2.0"
] | 2 | 2017-07-16T13:54:08.000Z | 2018-05-21T09:02:34.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 46.97561 | 80 | 0.791277 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.keras.python.keras import activations
from tensorflow.contrib.keras.python.keras import applications
from tensorflow.contrib.keras.python.keras import backend
from tensorflow.contrib.ker... | true | true |
1c1485f14850a3d912bbbb1ab6376bd43cb1a427 | 434 | py | Python | src/olympia/accounts/templatetags/jinja_helpers.py | dante381/addons-server | 9702860a19ecca1cb4e4998f37bc43c1b2dd3aa7 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/accounts/templatetags/jinja_helpers.py | dante381/addons-server | 9702860a19ecca1cb4e4998f37bc43c1b2dd3aa7 | [
"BSD-3-Clause"
] | 727 | 2020-07-17T05:31:03.000Z | 2022-03-31T20:29:41.000Z | src/olympia/accounts/templatetags/jinja_helpers.py | dante381/addons-server | 9702860a19ecca1cb4e4998f37bc43c1b2dd3aa7 | [
"BSD-3-Clause"
] | null | null | null | from urllib.parse import quote_plus
from django_jinja import library
import jinja2
from olympia.accounts.utils import path_with_query
from olympia.amo.templatetags.jinja_helpers import drf_url
@library.global_function
@jinja2.pass_context
def login_link(context):
next_path = path_with_query(context['request'])
... | 27.125 | 58 | 0.806452 | from urllib.parse import quote_plus
from django_jinja import library
import jinja2
from olympia.accounts.utils import path_with_query
from olympia.amo.templatetags.jinja_helpers import drf_url
@library.global_function
@jinja2.pass_context
def login_link(context):
next_path = path_with_query(context['request'])
... | true | true |
1c14864217dcb969899d13c47659a585b3a64030 | 7,943 | py | Python | tests/test_autoscaling/test_launch_configurations.py | adtsys-cloud/moto-aws-mock | 666cb97c508fc4e8a8bb52e70e4fb43b49af6812 | [
"Apache-2.0"
] | null | null | null | tests/test_autoscaling/test_launch_configurations.py | adtsys-cloud/moto-aws-mock | 666cb97c508fc4e8a8bb52e70e4fb43b49af6812 | [
"Apache-2.0"
] | null | null | null | tests/test_autoscaling/test_launch_configurations.py | adtsys-cloud/moto-aws-mock | 666cb97c508fc4e8a8bb52e70e4fb43b49af6812 | [
"Apache-2.0"
] | 1 | 2019-08-14T14:14:14.000Z | 2019-08-14T14:14:14.000Z | from __future__ import unicode_literals
import boto
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
import sure # noqa
from moto import mock_autoscaling_deprecated
from tests.helpers import requires_boto_gte
@mock_autoscali... | 35.302222 | 84 | 0.742289 | from __future__ import unicode_literals
import boto
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
import sure
from moto import mock_autoscaling_deprecated
from tests.helpers import requires_boto_gte
@mock_autoscaling_depr... | true | true |
1c14869f2e205b875e38c7f853e366cbc1abb97a | 4,934 | py | Python | GM2AUTOSAR_MM/MT_post__Distributable.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | GM2AUTOSAR_MM/MT_post__Distributable.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | GM2AUTOSAR_MM/MT_post__Distributable.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | """
__MT_post__Distributable.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: levi
Modified: Sun Aug 9 23:46:05 2015
________________________________________________________________________________
"""
from ASGNode import *
from A... | 42.534483 | 746 | 0.619173 | from ASGNode import *
from ATOM3Type import *
from ATOM3Text import *
from ATOM3String import *
from graph_MT_post__Distributable import *
class MT_post__Distributable(ASGNode, ATOM3Type):
def __init__(self, parent = None):
ASGNode.__init__(self)
ATOM3Type.__init__(self)
self.superTypes = ['MT_p... | true | true |
1c1486dbd3038cd9b2184ab4865594ebce909975 | 550 | py | Python | coding_night_live/management/commands/createsuperuserauto.py | gaybro8777/coding-night-live | b10aeefbcb35fa388a18cb983638ed5983c1874b | [
"MIT"
] | null | null | null | coding_night_live/management/commands/createsuperuserauto.py | gaybro8777/coding-night-live | b10aeefbcb35fa388a18cb983638ed5983c1874b | [
"MIT"
] | null | null | null | coding_night_live/management/commands/createsuperuserauto.py | gaybro8777/coding-night-live | b10aeefbcb35fa388a18cb983638ed5983c1874b | [
"MIT"
] | 1 | 2021-02-24T20:50:43.000Z | 2021-02-24T20:50:43.000Z | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
class Command(BaseCommand):
def handle(self, *args, **options):
password = get_random_string()
print('Generated root password: %s' % (password,))
... | 28.947368 | 58 | 0.645455 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
class Command(BaseCommand):
def handle(self, *args, **options):
password = get_random_string()
print('Generated root password: %s' % (password,))
... | true | true |
1c1487314b56f044c0e679c858b50707a07fdfb8 | 1,093 | py | Python | Topic 3/train.py | Rabbit1010/TensorFlow2.0-Tutorial | 902d9dd55fc87c2bb0a3335002d668b49f9ab3ab | [
"MIT"
] | 1 | 2019-10-02T12:32:24.000Z | 2019-10-02T12:32:24.000Z | Topic 3/train.py | Rabbit1010/TensorFlow2.0-Tutorial | 902d9dd55fc87c2bb0a3335002d668b49f9ab3ab | [
"MIT"
] | null | null | null | Topic 3/train.py | Rabbit1010/TensorFlow2.0-Tutorial | 902d9dd55fc87c2bb0a3335002d668b49f9ab3ab | [
"MIT"
] | 2 | 2019-10-24T04:09:44.000Z | 2020-04-06T23:50:18.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 15:33:24 2019
@author: Wei-Hsiang, Shen
"""
import tensorflow as tf
from model import AOI_model
from generate_data import Get_AOI_DS
if __name__ == '__main__':
print("Version: ", tf.__version__)
print("GPU is", "available" if tf.test.is_gpu_available() else ... | 29.540541 | 108 | 0.6871 |
import tensorflow as tf
from model import AOI_model
from generate_data import Get_AOI_DS
if __name__ == '__main__':
print("Version: ", tf.__version__)
print("GPU is", "available" if tf.test.is_gpu_available() else "NOT AVAILABLE")
BATCH_SIZE = 32
EPOCH = 50
train_ds, val_ds, data_size = Get... | true | true |
1c1487eb353716fa408c265c014451a8e5e85506 | 1,795 | py | Python | bot.py | pkpkp-pk/animeinteraction | c1d3badff92ff094d6f150396ed9b6b6224b9762 | [
"MIT"
] | null | null | null | bot.py | pkpkp-pk/animeinteraction | c1d3badff92ff094d6f150396ed9b6b6224b9762 | [
"MIT"
] | null | null | null | bot.py | pkpkp-pk/animeinteraction | c1d3badff92ff094d6f150396ed9b6b6224b9762 | [
"MIT"
] | null | null | null | import random
import telebot
import output_format
import anime_parser.anime
import search
TOKEN = '1455138895:AAH8gK7va5O0tRPIVaJT3a5d5RCLbodbBlQ' #Replace *TOKEN* to your telegram bot token. Example: 123456789:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(func=lambda message... | 33.240741 | 155 | 0.689694 | import random
import telebot
import output_format
import anime_parser.anime
import search
TOKEN = '1455138895:AAH8gK7va5O0tRPIVaJT3a5d5RCLbodbBlQ'
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(func=lambda message: True)
def get_text_messages(message):
chat_id = message.chat.id
user_id = message.from_u... | true | true |
1c1489c28df394aad1f769f54d27b2262f897631 | 1,380 | py | Python | python/tink/signature/_public_key_sign.py | fax001/tink | 9f30c97cb84b10bbba6978bc9c12c86478024050 | [
"Apache-2.0"
] | 1 | 2022-03-15T03:21:44.000Z | 2022-03-15T03:21:44.000Z | python/tink/signature/_public_key_sign.py | fax001/tink | 9f30c97cb84b10bbba6978bc9c12c86478024050 | [
"Apache-2.0"
] | 1 | 2022-03-02T13:25:38.000Z | 2022-03-02T13:25:38.000Z | python/tink/signature/_public_key_sign.py | fax001/tink | 9f30c97cb84b10bbba6978bc9c12c86478024050 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# 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, ... | 33.658537 | 78 | 0.747826 |
import abc
class PublicKeySign(metaclass=abc.ABCMeta):
@abc.abstractmethod
def sign(self, data: bytes) -> bytes:
raise NotImplementedError()
| true | true |
1c148ab28f680a5efe2dafea45cb30df30228753 | 14,329 | py | Python | qiskit/circuit/instruction.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/instruction.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/instruction.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | 1 | 2020-07-13T17:56:46.000Z | 2020-07-13T17:56:46.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 36.647059 | 93 | 0.617 |
import warnings
import copy
from itertools import zip_longest
import numpy
from qiskit.circuit.exceptions import CircuitError
from qiskit.circuit.quantumregister import QuantumRegister
from qiskit.circuit.classicalregister import ClassicalRegister
from qiskit.qobj.qasm_qobj import QasmQobjInstruction
from qiskit.ci... | true | true |
1c148ae2a78efc13b03aa07be6eb671ba86638b0 | 12,093 | py | Python | sahara/plugins/cdh/plugin_utils.py | esikachev/scenario | 40a59114c7bac44fea510767a3c07d73649f4caf | [
"Apache-2.0"
] | null | null | null | sahara/plugins/cdh/plugin_utils.py | esikachev/scenario | 40a59114c7bac44fea510767a3c07d73649f4caf | [
"Apache-2.0"
] | null | null | null | sahara/plugins/cdh/plugin_utils.py | esikachev/scenario | 40a59114c7bac44fea510767a3c07d73649f4caf | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 38.635783 | 76 | 0.597453 |
import os
import telnetlib
from oslo_log import log as logging
from oslo_utils import timeutils
from sahara.conductor import resource as res
from sahara import context
from sahara.i18n import _
from sahara.i18n import _LI
from sahara.plugins.cdh import commands as cmd
from sahara.plugins import exceptions as ex
from... | true | true |
1c148b5a859fca76d16314a802a14cac5215c694 | 4,143 | py | Python | botc/commands/abilities/tb/protect.py | Xinverse/BOTC-Bot | 1932c649c81a5a1eab735d7abdee0761c2853940 | [
"MIT"
] | 1 | 2020-06-21T17:20:17.000Z | 2020-06-21T17:20:17.000Z | botc/commands/abilities/tb/protect.py | BlueLenz/Blood-on-the-Clocktower-Storyteller-Discord-Bot | 1932c649c81a5a1eab735d7abdee0761c2853940 | [
"MIT"
] | 1 | 2020-07-07T03:47:44.000Z | 2020-07-07T03:47:44.000Z | botc/commands/abilities/tb/protect.py | BlueLenz/Blood-on-the-Clocktower-Storyteller-Discord-Bot | 1932c649c81a5a1eab735d7abdee0761c2853940 | [
"MIT"
] | 1 | 2022-02-18T00:42:19.000Z | 2022-02-18T00:42:19.000Z | """Protect command"""
import botutils
import discord
import traceback
import json
from discord.ext import commands
from botc import check_if_is_player, check_if_is_night, check_if_dm, RoleCannotUseCommand, \
check_if_player_really_alive, check_if_can_protect, PlayerParser, AbilityForbidden, \
NotAPlayer, BOTCU... | 39.457143 | 121 | 0.636737 |
import botutils
import discord
import traceback
import json
from discord.ext import commands
from botc import check_if_is_player, check_if_is_night, check_if_dm, RoleCannotUseCommand, \
check_if_player_really_alive, check_if_can_protect, PlayerParser, AbilityForbidden, \
NotAPlayer, BOTCUtils, AliveOnlyCommand... | true | true |
1c148c304d2f0dbdedb225ba61c1e03da4f2168b | 1,268 | py | Python | Run_this_file.py | NathanKhadaroo/GEOG5995 | dd53310b1af9df497a7096320188876374d934d0 | [
"MIT"
] | null | null | null | Run_this_file.py | NathanKhadaroo/GEOG5995 | dd53310b1af9df497a7096320188876374d934d0 | [
"MIT"
] | null | null | null | Run_this_file.py | NathanKhadaroo/GEOG5995 | dd53310b1af9df497a7096320188876374d934d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 13:41:15 2019
@author: msra2nk3
"""
#This function asks for inputs and tests to make sure they are positive integers,
#if they are not it will print a message and ask again until the input is correct
def safe_input(question):
x = input(question)
while n... | 26.978723 | 84 | 0.695584 |
def safe_input(question):
x = input(question)
while not (x.isdigit()) or (float(x) == 0):
print("This must be a positive integer!")
x = input(question)
return x
a = safe_input("How many sheep should there be?" )
b = safe_input("For how many iterations should the model run?")... | true | true |
1c148c4abecca062d6cb1b3c36a0a7475dd3da7c | 37,711 | py | Python | code/bib/cluster/tests/test_k_means.py | ribes96/TFG | b38ac01da641e40551c1b3fefc1dc3ebd1b8b0a9 | [
"MIT"
] | null | null | null | code/bib/cluster/tests/test_k_means.py | ribes96/TFG | b38ac01da641e40551c1b3fefc1dc3ebd1b8b0a9 | [
"MIT"
] | null | null | null | code/bib/cluster/tests/test_k_means.py | ribes96/TFG | b38ac01da641e40551c1b3fefc1dc3ebd1b8b0a9 | [
"MIT"
] | null | null | null | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | 38.519918 | 79 | 0.663043 | import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import assert_almost_equal
... | true | true |
1c148d7f764a7f20b230d50ecda78187496eebb0 | 1,565 | py | Python | ghb/close_prs.py | keith/ghb | 6a0cd2e05588959f7d988b38ec910a13783b6e2d | [
"MIT"
] | 26 | 2015-11-19T03:45:43.000Z | 2021-12-13T13:34:23.000Z | ghb/close_prs.py | keith/ghb | 6a0cd2e05588959f7d988b38ec910a13783b6e2d | [
"MIT"
] | 3 | 2017-02-04T00:36:18.000Z | 2020-03-01T20:19:04.000Z | ghb/close_prs.py | keith/ghb | 6a0cd2e05588959f7d988b38ec910a13783b6e2d | [
"MIT"
] | null | null | null | #
# Bulk close pull requests matching some criteria. This is especially useful
# for cleaning up old automated pull requests and can also be used with ghb
# delete-branches
#
# Usage: ghb close-prs author base
#
import argparse
import json
import sys
from typing import Set
import requests
from .helpers import credent... | 29.528302 | 79 | 0.62492 | import argparse
import json
import sys
from typing import Set
import requests
from .helpers import credentials
def _get_open_prs(
user: str, password: str, repo: str, author: str, base: str
) -> Set[str]:
params = {"state": "open", "per_page": "100", "base": base}
url = f"https://api.github.com/repos/{r... | true | true |
1c148dbe185bf60763e416175cfb63f16e9ae5a0 | 3,156 | py | Python | gui/kivy/uix/dialogs/fx_dialog.py | brakmic/electrum-actinium | 57a4de72f9b7704160729774fdc934f435e3aac1 | [
"MIT"
] | 1 | 2019-02-21T19:11:30.000Z | 2019-02-21T19:11:30.000Z | gui/kivy/uix/dialogs/fx_dialog.py | Actinium-project/electrum-actinium | 663b23223df7cf1c8ed44ac0bfccb5e46537ea0d | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/fx_dialog.py | Actinium-project/electrum-actinium | 663b23223df7cf1c8ed44ac0bfccb5e46537ea0d | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
Builder.load_string('''
<FxDialog@Popup>
id: popup
title: 'Fiat Currency'
size_hint: 0.8, 0.8
pos_hint: {'top':0.9}
BoxLayout:
orientation: 'vertical'
... | 28.690909 | 118 | 0.546895 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
Builder.load_string('''
<FxDialog@Popup>
id: popup
title: 'Fiat Currency'
size_hint: 0.8, 0.8
pos_hint: {'top':0.9}
BoxLayout:
orientation: 'vertical'
... | true | true |
1c148ec59f88013c0ff44844332793f59c1541e6 | 702 | py | Python | celery/task/rest.py | winhamwr/celery | 249a270301ddb9b025cf8d00400bb442df9cae62 | [
"BSD-3-Clause"
] | 1 | 2017-12-26T06:29:37.000Z | 2017-12-26T06:29:37.000Z | celery/task/rest.py | winhamwr/celery | 249a270301ddb9b025cf8d00400bb442df9cae62 | [
"BSD-3-Clause"
] | null | null | null | celery/task/rest.py | winhamwr/celery | 249a270301ddb9b025cf8d00400bb442df9cae62 | [
"BSD-3-Clause"
] | null | null | null | from celery.task.http import (InvalidResponseError, RemoteExecuteError,
UnknownStatusError)
from celery.task.http import URL
from celery.task.http import HttpDispatch as RESTProxy
from celery.task.http import HttpDispatchTask as RESTProxyTask
import warnings
warnings.warn(DeprecationWarni... | 35.1 | 76 | 0.773504 | from celery.task.http import (InvalidResponseError, RemoteExecuteError,
UnknownStatusError)
from celery.task.http import URL
from celery.task.http import HttpDispatch as RESTProxy
from celery.task.http import HttpDispatchTask as RESTProxyTask
import warnings
warnings.warn(DeprecationWarni... | true | true |
1c148eef53826c44e404727e83631274606ae595 | 982 | py | Python | find_forks_with_new_stuff.py | kdomanski/tools | 343db462f899ffab6c353a5e9897132350eb878f | [
"MIT"
] | null | null | null | find_forks_with_new_stuff.py | kdomanski/tools | 343db462f899ffab6c353a5e9897132350eb878f | [
"MIT"
] | null | null | null | find_forks_with_new_stuff.py | kdomanski/tools | 343db462f899ffab6c353a5e9897132350eb878f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from github import Github
import os
import sys
if not 'GITHUB_TOKEN' in os.environ.keys():
print("you must provide a Github token in the GITHUB_TOKEN environmental variable")
exit(1)
if len(sys.argv) < 2:
print("you must provide a git repo slug in the first argument")
exit(1)
... | 29.757576 | 91 | 0.698574 |
from github import Github
import os
import sys
if not 'GITHUB_TOKEN' in os.environ.keys():
print("you must provide a Github token in the GITHUB_TOKEN environmental variable")
exit(1)
if len(sys.argv) < 2:
print("you must provide a git repo slug in the first argument")
exit(1)
g = Github(os.environ['... | true | true |
1c148f167292ed4c295ffd38c41ab501370eb011 | 3,435 | py | Python | jhu/delphi_jhu/geo.py | qx-teo/covidcast-indicators | 6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a | [
"MIT"
] | null | null | null | jhu/delphi_jhu/geo.py | qx-teo/covidcast-indicators | 6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a | [
"MIT"
] | 5 | 2021-08-18T17:33:13.000Z | 2021-08-19T15:09:22.000Z | jhu/delphi_jhu/geo.py | qx-teo/covidcast-indicators | 6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Functions for translating between geocodes."""
import pandas as pd
from delphi_utils import GeoMapper
VALID_GEO_RES = ("county", "state", "msa", "hrr", "hhs", "nation")
INCIDENCE_BASE = 100000
def geo_map(df: pd.DataFrame, geo_res: str, sensor: str):
"""
Map and aggregate a DataFra... | 41.385542 | 96 | 0.673945 | import pandas as pd
from delphi_utils import GeoMapper
VALID_GEO_RES = ("county", "state", "msa", "hrr", "hhs", "nation")
INCIDENCE_BASE = 100000
def geo_map(df: pd.DataFrame, geo_res: str, sensor: str):
df = df.copy()
if geo_res not in VALID_GEO_RES:
raise ValueError(f"geo_res must be one of {VALID_... | true | true |
1c148f55d8e966ca75adeec0ee04240f1617143e | 992 | py | Python | validation/run_single_q0.py | gradhep/pyhf | 5b27f6357b5228ec610639a37c0e80d278d9abff | [
"Apache-2.0"
] | null | null | null | validation/run_single_q0.py | gradhep/pyhf | 5b27f6357b5228ec610639a37c0e80d278d9abff | [
"Apache-2.0"
] | null | null | null | validation/run_single_q0.py | gradhep/pyhf | 5b27f6357b5228ec610639a37c0e80d278d9abff | [
"Apache-2.0"
] | null | null | null | if __name__ == "__main__":
import ROOT
import sys
import json
infile = sys.argv[1]
infile = ROOT.TFile.Open(infile)
workspace = infile.Get("combined")
data = workspace.data("obsData")
sbModel = workspace.obj("ModelConfig")
poi = sbModel.GetParametersOfInterest().first()
poi.se... | 26.810811 | 88 | 0.657258 | if __name__ == "__main__":
import ROOT
import sys
import json
infile = sys.argv[1]
infile = ROOT.TFile.Open(infile)
workspace = infile.Get("combined")
data = workspace.data("obsData")
sbModel = workspace.obj("ModelConfig")
poi = sbModel.GetParametersOfInterest().first()
poi.se... | true | true |
1c148f64fbd315cb5a8587dfac669319503d84fb | 4,794 | py | Python | src/galaxy_crawler/crawl.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | 2 | 2019-12-24T10:45:37.000Z | 2022-03-04T00:47:14.000Z | src/galaxy_crawler/crawl.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | 2 | 2019-10-31T17:42:36.000Z | 2020-03-24T18:20:41.000Z | src/galaxy_crawler/crawl.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | null | null | null | from logging import getLogger
from queue import Queue
from threading import Thread
from time import sleep
from typing import TYPE_CHECKING
import requests
from galaxy_crawler.queries import QueryOrder, QueryBuilder
from galaxy_crawler.queries.v1 import Paginator
if TYPE_CHECKING:
from galaxy_crawler.constants im... | 31.12987 | 86 | 0.541093 | from logging import getLogger
from queue import Queue
from threading import Thread
from time import sleep
from typing import TYPE_CHECKING
import requests
from galaxy_crawler.queries import QueryOrder, QueryBuilder
from galaxy_crawler.queries.v1 import Paginator
if TYPE_CHECKING:
from galaxy_crawler.constants im... | true | true |
1c1490b9fa3cff2f45338941585446f24afeb066 | 2,455 | py | Python | tests/light_test.py | metbosch/script.kodi.http.ambilight | c513e24fe6211423bce5254dc16838fbee72bad6 | [
"WTFPL"
] | 172 | 2016-06-17T08:14:00.000Z | 2021-11-28T01:19:30.000Z | tests/light_test.py | metbosch/script.kodi.http.ambilight | c513e24fe6211423bce5254dc16838fbee72bad6 | [
"WTFPL"
] | 119 | 2016-06-14T17:09:02.000Z | 2021-12-27T22:08:41.000Z | tests/light_test.py | metbosch/script.kodi.http.ambilight | c513e24fe6211423bce5254dc16838fbee72bad6 | [
"WTFPL"
] | 73 | 2016-06-15T08:58:06.000Z | 2021-06-18T07:44:21.000Z | import lights
import requests_mock
BRIDGE_IP = '127.0.0.1'
USERNAME = 'fake'
LIGHTS = {u'1': {u'name': u'fake',
u'state': {u'alert': u'none',
u'bri': 254,
u'hue': 17738,
u'on': True,
u'sat'... | 29.939024 | 77 | 0.562525 | import lights
import requests_mock
BRIDGE_IP = '127.0.0.1'
USERNAME = 'fake'
LIGHTS = {u'1': {u'name': u'fake',
u'state': {u'alert': u'none',
u'bri': 254,
u'hue': 17738,
u'on': True,
u'sat'... | true | true |
1c1490c41354a2a0d93e6f32b16453e01acf1c3c | 422 | py | Python | 4-list-array/exercise2.py | German-Programmers/python-Course | d6bf45ec25fec7974714c8610cfbb04dad8dbcf2 | [
"MIT"
] | 1 | 2020-05-13T21:33:27.000Z | 2020-05-13T21:33:27.000Z | 4-list-array/exercise2.py | German-Programmers/python-Course | d6bf45ec25fec7974714c8610cfbb04dad8dbcf2 | [
"MIT"
] | null | null | null | 4-list-array/exercise2.py | German-Programmers/python-Course | d6bf45ec25fec7974714c8610cfbb04dad8dbcf2 | [
"MIT"
] | 1 | 2020-05-13T21:45:25.000Z | 2020-05-13T21:45:25.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 6 18:19:19 2020
@author: ahmad
"""
x = [4, 5, -2, 3, 5]
#x.reverse()
for i in range(len(x) - 1, -1, -1 ):
print(x[i])
# write a code to order x desc
print("//////////////////")
for f in range(0, len(x)):
min = x[0]
for i in x:
... | 14.551724 | 36 | 0.438389 |
x = [4, 5, -2, 3, 5]
for i in range(len(x) - 1, -1, -1 ):
print(x[i])
print("//////////////////")
for f in range(0, len(x)):
min = x[0]
for i in x:
if (min < i):
min = i
print(min)
x.remove(min)
| true | true |
1c1490f093bb0556834c50b5c9641ac0f26dfdcd | 9,874 | py | Python | api/migrations/versions/1349a2c924f4_.py | cclauss/Baobab | e7aad3a63237be5f16e6441b89b3cc708ec19acd | [
"Apache-2.0"
] | 52 | 2019-01-10T16:04:26.000Z | 2022-02-10T00:55:59.000Z | api/migrations/versions/1349a2c924f4_.py | cclauss/Baobab | e7aad3a63237be5f16e6441b89b3cc708ec19acd | [
"Apache-2.0"
] | 535 | 2019-01-08T21:24:01.000Z | 2022-02-27T15:24:06.000Z | api/migrations/versions/1349a2c924f4_.py | cclauss/Baobab | e7aad3a63237be5f16e6441b89b3cc708ec19acd | [
"Apache-2.0"
] | 36 | 2019-01-10T16:09:15.000Z | 2021-06-28T21:02:47.000Z | """empty message
Revision ID: 1349a2c924f4
Revises: 8a1468838847
Create Date: 2019-03-26 15:24:11.894634
"""
# revision identifiers, used by Alembic.
revision = '1349a2c924f4'
down_revision = '8a1468838847'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
def upgrade():
... | 34.524476 | 124 | 0.391331 |
revision = '1349a2c924f4'
down_revision = '8a1468838847'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
def upgrade():
review_form_table = table(
'review_form',
column('id', sa.Integer()),
column('application_form_id', sa.Integer()),
c... | true | true |
1c1490f832e389c42b34f87eb7b08a78e4fd2999 | 59,563 | py | Python | src/Stele/processing/processing_hsg/ccd_collection/high_sideband_ccd.py | SherwinGroup/Stele | 9bb7da0b406a801975e21c9f7ce05d369ae661e5 | [
"MIT"
] | null | null | null | src/Stele/processing/processing_hsg/ccd_collection/high_sideband_ccd.py | SherwinGroup/Stele | 9bb7da0b406a801975e21c9f7ce05d369ae661e5 | [
"MIT"
] | null | null | null | src/Stele/processing/processing_hsg/ccd_collection/high_sideband_ccd.py | SherwinGroup/Stele | 9bb7da0b406a801975e21c9f7ce05d369ae661e5 | [
"MIT"
] | null | null | null | import os
import errno
import copy
import json
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from .ccd import CCD
from Stele.processing.processing_hsg.helper_functions import gauss
from .helper_functions import calc_laser_frequencies
np.set_printoptions(linewidth=500)
class ... | 43.540205 | 79 | 0.530178 | import os
import errno
import copy
import json
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from .ccd import CCD
from Stele.processing.processing_hsg.helper_functions import gauss
from .helper_functions import calc_laser_frequencies
np.set_printoptions(linewidth=500)
class ... | true | true |
1c1492395168761a6089187bd97f87deaef04545 | 382 | py | Python | sandbox/mpi/test01_send.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2021-12-12T13:26:06.000Z | 2022-03-03T16:14:53.000Z | sandbox/mpi/test01_send.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 5 | 2019-03-01T07:08:46.000Z | 2019-04-28T07:32:42.000Z | sandbox/mpi/test01_send.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2017-12-13T13:13:52.000Z | 2019-03-13T20:08:15.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test mpi4py
# exc: mpiexec.openmpi -n 6 ./test01_send.py
import mpi4py.MPI as mpi
comm = mpi.COMM_WORLD
rank = comm.rank
if rank==1:
v = 1000
print("[%d]" % rank, " j'envoie", v)
comm.send(v, dest = 5)
elif rank==5:
v = comm.recv(source=1)
prin... | 16.608696 | 46 | 0.560209 |
import mpi4py.MPI as mpi
comm = mpi.COMM_WORLD
rank = comm.rank
if rank==1:
v = 1000
print("[%d]" % rank, " j'envoie", v)
comm.send(v, dest = 5)
elif rank==5:
v = comm.recv(source=1)
print("[%d]" % rank, " recu!", v)
print("[%d]" % rank, " end.")
| true | true |
1c1492f18db3e8b7b24ce0a14e2f6404c2d1751a | 2,198 | py | Python | django_cloud_deploy/django_cloud_deploy.py | wangxf123456/django-cloud-deploy | 82c4d5094c44a59226a294bd585dce67cec877c5 | [
"Apache-2.0"
] | 1 | 2019-02-12T21:41:18.000Z | 2019-02-12T21:41:18.000Z | django_cloud_deploy/django_cloud_deploy.py | DalavanCloud/django-cloud-deploy | ba81fc9698c57c0e23faccf25ad4480e3e416643 | [
"Apache-2.0"
] | null | null | null | django_cloud_deploy/django_cloud_deploy.py | DalavanCloud/django-cloud-deploy | ba81fc9698c57c0e23faccf25ad4480e3e416643 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.957746 | 78 | 0.692448 |
import argparse
import sys
import warnings
import django_cloud_deploy.crash_handling
from django_cloud_deploy.cli import new
from django_cloud_deploy.cli import update
def _update(args):
try:
update.main(args)
except Exception as e:
django_cloud_deploy.crash_handling.handle_crash(
... | true | true |
1c14939ba8759d8e3eddbb8391eb3f8b3294ca26 | 538 | py | Python | tests/scripts/test_topics.py | dhodovsk/leapp | bcd6580a19dabd132b3da8bcf2ed61fa8864ef18 | [
"Apache-2.0"
] | 29 | 2019-05-29T05:34:52.000Z | 2022-03-14T19:09:34.000Z | tests/scripts/test_topics.py | dhodovsk/leapp | bcd6580a19dabd132b3da8bcf2ed61fa8864ef18 | [
"Apache-2.0"
] | 373 | 2018-11-21T11:41:49.000Z | 2022-03-31T11:40:56.000Z | tests/scripts/test_topics.py | dhodovsk/leapp | bcd6580a19dabd132b3da8bcf2ed61fa8864ef18 | [
"Apache-2.0"
] | 27 | 2018-11-26T17:14:15.000Z | 2022-03-10T13:30:50.000Z | import pytest
from leapp.exceptions import InvalidTopicDefinitionError
from leapp.topics import Topic, ErrorTopic, get_topics
import leapp.topics
class UnitTestTopic(Topic):
name = "test-topic"
def test_topic():
assert getattr(leapp.topics, 'UnitTestTopic') is UnitTestTopic
def test_get_topics():
top... | 22.416667 | 66 | 0.749071 | import pytest
from leapp.exceptions import InvalidTopicDefinitionError
from leapp.topics import Topic, ErrorTopic, get_topics
import leapp.topics
class UnitTestTopic(Topic):
name = "test-topic"
def test_topic():
assert getattr(leapp.topics, 'UnitTestTopic') is UnitTestTopic
def test_get_topics():
top... | true | true |
1c1494aae7b62f90b70f730d1f399e35d3d396e5 | 6,661 | py | Python | emulator/option.py | Thachj-Thw/emulator | ee8c64d63c0c8de3d4832c88f86ada5b6eba0404 | [
"MIT"
] | null | null | null | emulator/option.py | Thachj-Thw/emulator | ee8c64d63c0c8de3d4832c88f86ada5b6eba0404 | [
"MIT"
] | null | null | null | emulator/option.py | Thachj-Thw/emulator | ee8c64d63c0c8de3d4832c88f86ada5b6eba0404 | [
"MIT"
] | null | null | null | from typing import Union
class EmulatorOptions:
"""
options:
- resolution: width, height, DPI
- cpu: 1|2|3|4
- memory: M256|M521|M768|M1024|M1536|M2048|M3078|M4096|M6144
- manufacturer: samsung, asus, ...
- model: SM-G970N, ASUS_Z00DUO, ...
- number: phone number
- imei: auto
-... | 28.224576 | 91 | 0.604113 | from typing import Union
class EmulatorOptions:
M256 = 256
M521 = 521
M768 = 768
M1024 = 1024
M1536 = 1536
M2048 = 2048
M3072 = 3072
M4096 = 4096
M6144 = 6144
MEMORY_OPTIONS = [M256, M521, M768, M1024, M1536, M2048, M3072, M4096, M6144]
def __init__(self) -> None:
... | true | true |
1c14955cbb3a4ea40da84ca70ebcdc04e77a9101 | 19,041 | py | Python | tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py | urlocal12/tensorflow | 3f70de82668c0e61ecedf1bc458ab8b6d5f9b1f0 | [
"Apache-2.0"
] | 4 | 2020-04-19T11:30:20.000Z | 2020-07-02T07:13:15.000Z | tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py | urlocal12/tensorflow | 3f70de82668c0e61ecedf1bc458ab8b6d5f9b1f0 | [
"Apache-2.0"
] | 1 | 2022-02-10T01:29:17.000Z | 2022-02-10T01:29:17.000Z | tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py | urlocal12/tensorflow | 3f70de82668c0e61ecedf1bc458ab8b6d5f9b1f0 | [
"Apache-2.0"
] | 1 | 2020-09-27T03:08:17.000Z | 2020-09-27T03:08:17.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.981941 | 107 | 0.723912 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import collective_all_reduce_strategy
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.python.distribute import mirrored_strategy
from ten... | true | true |
1c1495cddef0c6ca5e1acfe2b9d5266143ed249a | 4,639 | py | Python | utils/hdf5_tools.py | ThomasMullen/NPP | b3ef0bac451841a60edcb60340d2af36ec395f90 | [
"MIT"
] | null | null | null | utils/hdf5_tools.py | ThomasMullen/NPP | b3ef0bac451841a60edcb60340d2af36ec395f90 | [
"MIT"
] | null | null | null | utils/hdf5_tools.py | ThomasMullen/NPP | b3ef0bac451841a60edcb60340d2af36ec395f90 | [
"MIT"
] | null | null | null | import os
import h5py
import mat73
import numpy as np
"""
View HDF5 data structure
------------------------
"""
def traverse_datasets(hdf_file):
"""
Peak into matlab file and print the Key, Shape, Data type.
:param hdf_file:
:return:
"""
def h5py_dataset_iterator(g, prefix=''):
"""
... | 32.900709 | 113 | 0.668894 | import os
import h5py
import mat73
import numpy as np
def traverse_datasets(hdf_file):
def h5py_dataset_iterator(g, prefix=''):
for key in g.keys():
item = g[key]
path = f'{prefix}/{key}'
if isinstance(item, h5py.Dataset): yield path, item
... | true | true |
1c149603a0dabc9c224afa53c8cca7183fa45d86 | 6,878 | py | Python | tools/php2jinja.py | gravityrail/phply | 4781432f12aa8495e9f996d0d8528da5b1271617 | [
"BSD-3-Clause"
] | 202 | 2016-11-19T00:09:12.000Z | 2022-03-31T15:16:39.000Z | tools/php2jinja.py | gravityrail/phply | 4781432f12aa8495e9f996d0d8528da5b1271617 | [
"BSD-3-Clause"
] | 43 | 2016-11-07T21:21:05.000Z | 2021-03-08T09:16:56.000Z | tools/php2jinja.py | gravityrail/phply | 4781432f12aa8495e9f996d0d8528da5b1271617 | [
"BSD-3-Clause"
] | 47 | 2016-11-17T08:29:27.000Z | 2022-02-21T10:14:06.000Z | #!/usr/bin/env python
# php2jinja.py - Converts PHP to Jinja2 templates (experimental)
# Usage: php2jinja.py < input.php > output.html
import sys
sys.path.append('..')
from phply.phplex import lexer
from phply.phpparse import make_parser
from phply.phpast import *
input = sys.stdin
output = sys.stdout
op_map = {
... | 35.822917 | 93 | 0.501163 |
import sys
sys.path.append('..')
from phply.phplex import lexer
from phply.phpparse import make_parser
from phply.phpast import *
input = sys.stdin
output = sys.stdout
op_map = {
'&&': 'and',
'||': 'or',
'!': 'not',
'!==': '!=',
'===': '==',
'.': '~',
}
def unparse(nodes):
result... | true | true |
1c14963dd18987712245a7db5fc92c626bbd5513 | 252 | py | Python | src/python/WMCore/WMBS/Oracle/Files/DeleteParentCheck.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WMBS/Oracle/Files/DeleteParentCheck.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WMBS/Oracle/Files/DeleteParentCheck.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_DeleteParentCheck_
Oracle implementation of DeleteParentCheck
"""
from WMCore.WMBS.MySQL.Files.DeleteParentCheck import DeleteParentCheck as MySQLDeleteParentCheck
class DeleteParentCheck(MySQLDeleteParentCheck):
pass
| 21 | 97 | 0.829365 |
from WMCore.WMBS.MySQL.Files.DeleteParentCheck import DeleteParentCheck as MySQLDeleteParentCheck
class DeleteParentCheck(MySQLDeleteParentCheck):
pass
| true | true |
1c1496e77990e57e4a29ef80d0df2c3a22945261 | 4,364 | py | Python | Tools/c-analyzer/c_parser/datafiles.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | 1 | 2020-10-25T16:33:22.000Z | 2020-10-25T16:33:22.000Z | Tools/c-analyzer/c_parser/datafiles.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | Tools/c-analyzer/c_parser/datafiles.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | import os.path
import c_common.tables as _tables
import c_parser.info as _info
BASE_COLUMNS = [
'filename',
'funcname',
'name',
'kind',
]
END_COLUMNS = {
'parsed': 'data',
'decls': 'declaration',
}
def _get_columns(group, extra=None):
return BASE_COLUMNS + list(extra ... | 28.900662 | 76 | 0.570807 | import os.path
import c_common.tables as _tables
import c_parser.info as _info
BASE_COLUMNS = [
'filename',
'funcname',
'name',
'kind',
]
END_COLUMNS = {
'parsed': 'data',
'decls': 'declaration',
}
def _get_columns(group, extra=None):
return BASE_COLUMNS + list(extra ... | true | true |
1c1496f2281d582a5504022c870d20c57b322bc9 | 88,236 | py | Python | osf/models/mixins.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | osf/models/mixins.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | osf/models/mixins.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | import pytz
import markupsafe
import logging
from django.apps import apps
from django.contrib.auth.models import Group, AnonymousUser
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models, transaction
from django.utils import timezone
from django.utils.functional import ca... | 38.649146 | 147 | 0.628451 | import pytz
import markupsafe
import logging
from django.apps import apps
from django.contrib.auth.models import Group, AnonymousUser
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models, transaction
from django.utils import timezone
from django.utils.functional import ca... | true | true |
1c149784c11182d4d1d3bae078584d2d35935698 | 21,791 | py | Python | purity_fb/purity_fb_1dot9/apis/object_store_access_keys_api.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot9/apis/object_store_access_keys_api.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot9/apis/object_store_access_keys_api.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.9 Python SDK
Pure Storage FlashBlade REST 1.9 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.9
Contact: i... | 44.653689 | 204 | 0.594649 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class ObjectStoreAccessKeysApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
1c1497edae98f46d997fd7a1d3fa1b6c66b2df44 | 833 | py | Python | simulators/morse_ros/morse_ros/scenarios/pr2_open_space.py | sphanit/CoHAN_Navigation | 3751d1631e223dc7ad214d29d4310cc571761a7e | [
"BSD-3-Clause"
] | null | null | null | simulators/morse_ros/morse_ros/scenarios/pr2_open_space.py | sphanit/CoHAN_Navigation | 3751d1631e223dc7ad214d29d4310cc571761a7e | [
"BSD-3-Clause"
] | null | null | null | simulators/morse_ros/morse_ros/scenarios/pr2_open_space.py | sphanit/CoHAN_Navigation | 3751d1631e223dc7ad214d29d4310cc571761a7e | [
"BSD-3-Clause"
] | null | null | null | # Author: Phani Teja Singamaneni
import sys
from morse.builder import *
# add clock
clock = Clock()
clock.add_interface("ros", topic="clock")
# pr2 robot with laser (scan) and odometry (odom) sensors, and actuators
# for armature (joint_trajectory_contorller) and wheels (cmd_vel) to the scene
pr2 = NavPR2(with_keyb... | 26.03125 | 78 | 0.758703 |
import sys
from morse.builder import *
clock = Clock()
clock.add_interface("ros", topic="clock")
pr2 = NavPR2(with_keyboard=True, show_laser=False, laser_z=0.05)
pr2.add_interface("ros")
pr2.append(clock)
ground_truth = Odometry()
pr2.append(ground_truth)
ground_truth.add_interface("ros", topic="base_pose_ground_t... | true | true |
1c1498af6172d72e3cf3f342b1d92fccd768650c | 4,277 | py | Python | eze/plugins/reporters/bom_formatted.py | RiverSafeUK/eze-cli | ad1cce9edd2be28e1681b7c7379ac79f94d32bd3 | [
"MIT"
] | 4 | 2021-07-26T18:44:11.000Z | 2021-12-07T19:59:57.000Z | eze/plugins/reporters/bom_formatted.py | RiverSafeUK/eze-cli | ad1cce9edd2be28e1681b7c7379ac79f94d32bd3 | [
"MIT"
] | 23 | 2021-07-26T16:56:59.000Z | 2022-03-11T15:21:25.000Z | eze/plugins/reporters/bom_formatted.py | RiverSafeUK/eze-cli | ad1cce9edd2be28e1681b7c7379ac79f94d32bd3 | [
"MIT"
] | 3 | 2021-11-11T15:29:21.000Z | 2021-11-30T10:32:17.000Z | """Bill of Materials reporter class implementation"""
import shlex
from pydash import py_
from eze.core.reporter import ReporterMeta
from eze.utils.cli import extract_cmd_version, run_cli_command
from eze.utils.io import create_tempfile_path, write_json
from eze.utils.log import log, log_debug, log_error
class BomF... | 39.971963 | 141 | 0.626374 | import shlex
from pydash import py_
from eze.core.reporter import ReporterMeta
from eze.utils.cli import extract_cmd_version, run_cli_command
from eze.utils.io import create_tempfile_path, write_json
from eze.utils.log import log, log_debug, log_error
class BomFormattedReporter(ReporterMeta):
REPORTER_NAME: st... | true | true |
1c149933a7b2febb7d3b8ec472e310992dfee4b6 | 350 | py | Python | PARTE 1/semana_8/lista_remove_repetidos.py | bruno-ba/USP-Introducao-a-Ciencia-da-Computacao-com-Python | 16ea90dbf581c9f6e1c7844d818ffc9d37babcd5 | [
"MIT"
] | null | null | null | PARTE 1/semana_8/lista_remove_repetidos.py | bruno-ba/USP-Introducao-a-Ciencia-da-Computacao-com-Python | 16ea90dbf581c9f6e1c7844d818ffc9d37babcd5 | [
"MIT"
] | null | null | null | PARTE 1/semana_8/lista_remove_repetidos.py | bruno-ba/USP-Introducao-a-Ciencia-da-Computacao-com-Python | 16ea90dbf581c9f6e1c7844d818ffc9d37babcd5 | [
"MIT"
] | null | null | null | def remove_repetidos(lista: list) -> list:
lista_cache = []
for elemento in lista:
if elemento not in lista_cache:
lista_cache.append(elemento)
return sorted(lista_cache)
if __name__ == '__main__':
lista = [2, 4, 2, 2, 3, 3, 1]
print(remove_repetidos(lista))
print(remove_r... | 25 | 47 | 0.622857 | def remove_repetidos(lista: list) -> list:
lista_cache = []
for elemento in lista:
if elemento not in lista_cache:
lista_cache.append(elemento)
return sorted(lista_cache)
if __name__ == '__main__':
lista = [2, 4, 2, 2, 3, 3, 1]
print(remove_repetidos(lista))
print(remove_r... | true | true |
1c1499b5bf16b03f51c853732f47c1300d54c7a6 | 1,721 | py | Python | shop_proj/urls.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | null | null | null | shop_proj/urls.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 8 | 2020-02-12T00:52:56.000Z | 2022-03-11T23:23:20.000Z | shop_proj/urls.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 1 | 2018-02-22T11:15:48.000Z | 2018-02-22T11:15:48.000Z | """shop_proj URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 38.244444 | 132 | 0.723417 | from django.conf.urls import url, include
from django.contrib import admin
from accounts import views as accounts_views
from core import views as core_views
from products import views as product_views
from cart import views as cart_views
from checkout import views as checkout_views
from orders import views as orders_vi... | true | true |
1c1499fd76691ab37d102fc9586367aeae3ab630 | 2,694 | py | Python | nilearn/reporting/tests/test_html_report.py | ryanhammonds/nilearn | f33cd4e4685d9050e5bba0a8ece1b0b0f0ad1be2 | [
"BSD-2-Clause"
] | 3 | 2019-11-07T08:50:32.000Z | 2020-01-13T22:06:17.000Z | nilearn/reporting/tests/test_html_report.py | ryanhammonds/nilearn | f33cd4e4685d9050e5bba0a8ece1b0b0f0ad1be2 | [
"BSD-2-Clause"
] | null | null | null | nilearn/reporting/tests/test_html_report.py | ryanhammonds/nilearn | f33cd4e4685d9050e5bba0a8ece1b0b0f0ad1be2 | [
"BSD-2-Clause"
] | 1 | 2017-08-26T08:19:29.000Z | 2017-08-26T08:19:29.000Z | import pytest
import numpy as np
from nibabel import Nifti1Image
from nilearn import input_data
from numpy.testing import assert_warns
# Note: html output by nilearn view_* functions
# should validate as html5 using https://validator.w3.org/nu/ with no
# warnings
def _check_html(html_view):
""" Check the presen... | 26.15534 | 72 | 0.662955 | import pytest
import numpy as np
from nibabel import Nifti1Image
from nilearn import input_data
from numpy.testing import assert_warns
def _check_html(html_view):
assert "Parameters" in str(html_view)
assert "data:image/svg+xml;base64," in str(html_view)
def test_3d_reports():
data = np.zeros((9, ... | true | true |
1c149a1126d26f8bdb76fcf868b9f25819b043f5 | 6,552 | py | Python | sherpa-seq-testing/docs/conf.py | LarsHH/reproducible-hyperparameter-optimization-jcgs-2019 | 5feffcfc9da4533f11acf09f1f850c3e7dd7b21a | [
"MIT"
] | 1 | 2021-08-12T12:54:45.000Z | 2021-08-12T12:54:45.000Z | sherpa-seq-testing/docs/conf.py | LarsHH/reproducible-hyperparameter-optimization-jcgs-2019 | 5feffcfc9da4533f11acf09f1f850c3e7dd7b21a | [
"MIT"
] | null | null | null | sherpa-seq-testing/docs/conf.py | LarsHH/reproducible-hyperparameter-optimization-jcgs-2019 | 5feffcfc9da4533f11acf09f1f850c3e7dd7b21a | [
"MIT"
] | null | null | null | """
SHERPA is a Python library for hyperparameter tuning of machine learning models.
Copyright (C) 2018 Lars Hertel, Peter Sadowski, and Julian Collado.
This file is part of SHERPA.
SHERPA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the... | 31.960976 | 80 | 0.666056 |
import os
import sys
from sphinx.apidoc import main
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../'))
project = 'SHERPA'
copyright = '2018, Lars Hertel, Peter Sadowski, and Julian Collado'
author = 'Lars Hertel, Peter Sadowski, and Julian Collado'
version = ''
release = ''
ex... | true | true |
1c149aa50d995dee276aa256371fef8c62b24ea4 | 426 | py | Python | desafio010.py | douglasoliveira96/Desafios_python | 1ebe6d84b1ce887d908c0a44a06875c618e7a85b | [
"MIT"
] | null | null | null | desafio010.py | douglasoliveira96/Desafios_python | 1ebe6d84b1ce887d908c0a44a06875c618e7a85b | [
"MIT"
] | null | null | null | desafio010.py | douglasoliveira96/Desafios_python | 1ebe6d84b1ce887d908c0a44a06875c618e7a85b | [
"MIT"
] | null | null | null | #Crie um programa que leia quanto dinheiro uma pessoa tem na carteira
#e mostre quantos dólares, euro e bitcoin ela pode comprar
#(considerando as cotações do dia 13/10/2021).
real = float(input('Digite quanto de dinheiro você tem na carteira: R$ '))
dolar = real/5.53
euro = real/6.40
bitcoin = real/305047.81
print('Co... | 47.333333 | 114 | 0.71831 | real = float(input('Digite quanto de dinheiro você tem na carteira: R$ '))
dolar = real/5.53
euro = real/6.40
bitcoin = real/305047.81
print('Com R${:.2f} você consegue comprar US${:.2f} ou €{:.2f} ou BTC {:.6f}.'.format(real, dolar, euro, bitcoin))
| true | true |
1c149b9ad64d24059617ad570d225d4e9483fe91 | 397 | py | Python | LectioEx/migrations/0004_badge_image.py | danielrhj123/LectioBadges | b266f1fe65f53e6f41fa53ee15cce0235fc26f1b | [
"Apache-2.0"
] | null | null | null | LectioEx/migrations/0004_badge_image.py | danielrhj123/LectioBadges | b266f1fe65f53e6f41fa53ee15cce0235fc26f1b | [
"Apache-2.0"
] | null | null | null | LectioEx/migrations/0004_badge_image.py | danielrhj123/LectioBadges | b266f1fe65f53e6f41fa53ee15cce0235fc26f1b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2018-09-26 08:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('LectioEx', '0003_badge_upload_date'),
]
operations = [
migrations.AddField(
model_name='badge',
name='image',
... | 20.894737 | 67 | 0.599496 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('LectioEx', '0003_badge_upload_date'),
]
operations = [
migrations.AddField(
model_name='badge',
name='image',
field=models.ImageField(null=True, upload_... | true | true |
1c149c0a5c9097ca8bb685d56744500dd340e4f3 | 663 | py | Python | Dataset/Leetcode/train/70/653.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/70/653.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/70/653.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution(object):
def XXX(self, n):
"""
:type n: int
:rtype: int
核心思想:
采用动态规划
dp[i]表示爬到第i个阶梯所有需要的方法数
题目分析(只考虑一步达到的情况):
因为每次只能爬一个或者两个台阶
当处于i-1时则爬一阶可以从i-1爬到i
当处于i-2时则爬两阶可以... | 22.862069 | 47 | 0.39819 | class Solution(object):
def XXX(self, n):
dp = [0 for i in range(n+1)]
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
dp[i] = dp[i-1] + dp[i-2]
return dp[-1]
if __name__ == '__main__':
s = Solution()
print(s.XXX(4))
| true | true |
1c149cf17e8b4db0d8c6a95fbdd8cd813e60e0e2 | 12,282 | py | Python | cryptoapis/model/list_transactions_by_block_hash_ri_recipients.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | cryptoapis/model/list_transactions_by_block_hash_ri_recipients.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | cryptoapis/model/list_transactions_by_block_hash_ri_recipients.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 45.657993 | 484 | 0.588911 |
import re import sys
from cryptoapis.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiM... | true | true |
1c149cf5484699148debaf5750dbe056859c8e39 | 924 | py | Python | .history/ClassFiles/DataStructures/Dictionary_20210101154118.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DataStructures/Dictionary_20210101154118.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DataStructures/Dictionary_20210101154118.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | ''' Dictionary
A dictionary is a collection of key value pairs.
The values can be changed (mutable)
The values have unique keys.
Using the constructor method # 29
Built-in dictionary Methods
Method Description
get() Returns the value of a specific key.
Update() Inserts a s... | 25.666667 | 77 | 0.651515 | ''' Dictionary
A dictionary is a collection of key value pairs.
The values can be changed (mutable)
The values have unique keys.
Using the constructor method # 29
Built-in dictionary Methods
Method Description
get() Returns the value of a specific key.
Update() Inserts a s... | false | true |
1c149d29a7745f031a1154471e9db302472c16b0 | 9,971 | py | Python | asyncstdlib/asynctools.py | gitter-badger/asyncstdlib | d758d43dd8290106574ffa9a84b15bac98a8ac2d | [
"MIT"
] | null | null | null | asyncstdlib/asynctools.py | gitter-badger/asyncstdlib | d758d43dd8290106574ffa9a84b15bac98a8ac2d | [
"MIT"
] | null | null | null | asyncstdlib/asynctools.py | gitter-badger/asyncstdlib | d758d43dd8290106574ffa9a84b15bac98a8ac2d | [
"MIT"
] | null | null | null | from typing import (
Union,
AsyncIterator,
TypeVar,
AsyncGenerator,
Iterable,
Awaitable,
AsyncIterable,
Callable,
Any,
overload,
)
import sys
if sys.version_info[:2] >= (3, 8):
from typing import AsyncContextManager
else:
from typing_extensions import AsyncContextManager... | 30.492355 | 87 | 0.642363 | from typing import (
Union,
AsyncIterator,
TypeVar,
AsyncGenerator,
Iterable,
Awaitable,
AsyncIterable,
Callable,
Any,
overload,
)
import sys
if sys.version_info[:2] >= (3, 8):
from typing import AsyncContextManager
else:
from typing_extensions import AsyncContextManager... | true | true |
1c149d65f8439ca1dc3a8dc9fe0757cb58c1e2f3 | 30,302 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/operations/_azure_firewalls_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/operations/_azure_firewalls_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/operations/_azure_firewalls_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.351792 | 197 | 0.662333 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
1c149e9d734f5a10346ade353c98da40ea93c74c | 784 | py | Python | examples/manual.py | chrismeyers/pleasehold | 7643aea72fd9c052ee5a2de46a39a29a97786627 | [
"MIT"
] | null | null | null | examples/manual.py | chrismeyers/pleasehold | 7643aea72fd9c052ee5a2de46a39a29a97786627 | [
"MIT"
] | 2 | 2019-02-17T02:27:13.000Z | 2019-02-18T03:44:46.000Z | examples/manual.py | chrismeyers/pleasehold | 7643aea72fd9c052ee5a2de46a39a29a97786627 | [
"MIT"
] | null | null | null | import time
import pleasehold
if __name__ == '__main__':
print('before')
before = time.time()
holding = pleasehold.hold('starting', 'complete')
transfer = pleasehold.transfer(holding)
holding.start()
time.sleep(2)
holding.push('1')
holding.push('2')
holding.push('3')
holding.p... | 21.189189 | 53 | 0.618622 | import time
import pleasehold
if __name__ == '__main__':
print('before')
before = time.time()
holding = pleasehold.hold('starting', 'complete')
transfer = pleasehold.transfer(holding)
holding.start()
time.sleep(2)
holding.push('1')
holding.push('2')
holding.push('3')
holding.p... | true | true |
1c149f1a7ebae6850d56ceecba4f981ace7ae70a | 18,413 | py | Python | rlgraph/components/policies/policy.py | samialabed/rlgraph | f5fa632a385e67295a2939f54cbaa4c47a007728 | [
"Apache-2.0"
] | null | null | null | rlgraph/components/policies/policy.py | samialabed/rlgraph | f5fa632a385e67295a2939f54cbaa4c47a007728 | [
"Apache-2.0"
] | null | null | null | rlgraph/components/policies/policy.py | samialabed/rlgraph | f5fa632a385e67295a2939f54cbaa4c47a007728 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018/2019 The RLgraph authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 46.61519 | 120 | 0.6799 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from rlgraph import get_backend
from rlgraph.utils.rlgraph_errors import RLGraphError
from rlgraph.spaces import IntBox, FloatBox
from rlgraph.components.component import Component
from rlg... | true | true |
1c149fb7ad9897b57ed1bac7bbd85f62a605eb60 | 608 | py | Python | pirates/world/DistributedLocatableObject.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | pirates/world/DistributedLocatableObject.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | pirates/world/DistributedLocatableObject.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | # File: D (Python 2.4)
from direct.distributed.DistributedObject import DistributedObject
from pirates.piratesbase import PLocalizer
from pirates.piratesgui import PiratesGuiGlobals
class DistributedLocatableObject(DistributedObject):
def __init__(self, cr):
DistributedObject.__init__(self, cr)
... | 28.952381 | 75 | 0.743421 |
from direct.distributed.DistributedObject import DistributedObject
from pirates.piratesbase import PLocalizer
from pirates.piratesgui import PiratesGuiGlobals
class DistributedLocatableObject(DistributedObject):
def __init__(self, cr):
DistributedObject.__init__(self, cr)
def locationChange... | true | true |
1c14a038aa9a175b164165d28717597a0d85c386 | 565 | py | Python | doc/_source/codes/domain_D1Q3_visualization.py | bgraille/pylbm | fd4419933e05b85be364232fddedfcb4f7275e1f | [
"BSD-3-Clause"
] | 106 | 2016-09-13T07:19:17.000Z | 2022-03-19T13:41:55.000Z | doc/_source/codes/domain_D1Q3_visualization.py | gouarin/pylbm | fd4419933e05b85be364232fddedfcb4f7275e1f | [
"BSD-3-Clause"
] | 53 | 2017-09-18T04:51:19.000Z | 2022-01-19T21:36:23.000Z | doc/_source/codes/domain_D1Q3_visualization.py | gouarin/pylbm | fd4419933e05b85be364232fddedfcb4f7275e1f | [
"BSD-3-Clause"
] | 33 | 2016-06-17T13:21:17.000Z | 2021-11-11T16:57:46.000Z | # Authors:
# Loic Gouarin <loic.gouarin@polytechnique.edu>
# Benjamin Graille <benjamin.graille@math.u-psud.fr>
#
# License: BSD 3 clause
"""
Visualization options for the domain
"""
from six.moves import range
import pylbm
dico = {
'box': {'x': [0, 1], 'label': [0, 1]},
'space_step': 0.1,
'schemes... | 26.904762 | 68 | 0.697345 |
from six.moves import range
import pylbm
dico = {
'box': {'x': [0, 1], 'label': [0, 1]},
'space_step': 0.1,
'schemes': [{'velocities': list(range(3))}],
}
dom = pylbm.Domain(dico)
dom.visualize(view_in=False, view_out=True, view_bound=True)
dom.visualize(view_bound=True, view_distance=True)
dom.visualize(v... | true | true |
1c14a0b5874ef46dc0811724b5ad8a7c51488a1a | 3,147 | py | Python | src/olympia/addons/management/commands/approve_addons.py | makyen/Mozilla-addons-server | 555d9f31cc4b00799466f16c8809edd5f1858ab8 | [
"BSD-3-Clause"
] | 1 | 2020-12-03T10:02:15.000Z | 2020-12-03T10:02:15.000Z | src/olympia/addons/management/commands/approve_addons.py | makyen/Mozilla-addons-server | 555d9f31cc4b00799466f16c8809edd5f1858ab8 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/management/commands/approve_addons.py | makyen/Mozilla-addons-server | 555d9f31cc4b00799466f16c8809edd5f1858ab8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
import olympia.core.logger
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.utils import chunked
from olympia.editors.helpers import ReviewHelper
log = olympia.core.logger.getLogger('z.addons')
... | 37.023529 | 79 | 0.632666 | from django.core.management.base import BaseCommand, CommandError
import olympia.core.logger
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.utils import chunked
from olympia.editors.helpers import ReviewHelper
log = olympia.core.logger.getLogger('z.addons')
class Command(BaseComman... | true | true |
1c14a4436c9b2aabcf22305bf499e9c94b701c1e | 3,755 | py | Python | exp-1/data_gen.py | rohitmusti/SQuAD-Context-Merging | d055a1565b87399b1d611385097495431f5e250a | [
"MIT"
] | null | null | null | exp-1/data_gen.py | rohitmusti/SQuAD-Context-Merging | d055a1565b87399b1d611385097495431f5e250a | [
"MIT"
] | null | null | null | exp-1/data_gen.py | rohitmusti/SQuAD-Context-Merging | d055a1565b87399b1d611385097495431f5e250a | [
"MIT"
] | null | null | null | """
tldr: modifies the squad data to fit the requirements of my experiment 2 (topic contexts)
author: @rohitmusti
"""
import ujson as json
from tqdm import tqdm
from toolkit import save, quick_clean, get_logger
from random import randrange
from args import get_exp1_data_gen_args
def toy_transformer(in_file, train_fil... | 40.815217 | 118 | 0.581092 | import ujson as json
from tqdm import tqdm
from toolkit import save, quick_clean, get_logger
from random import randrange
from args import get_exp1_data_gen_args
def toy_transformer(in_file, train_file, dev_file, test_file, train_topic_num, dev_topic_num, test_topic_num, logger):
new_data = {}
new_data['experi... | true | true |
1c14a4bd8db4d0547074579bd3b439be0a9cf96b | 969 | py | Python | Django Rest Class Based Concrete API View/DRF_classbasedconcreateview/urls.py | abhisheksahu92/Django-Rest-Framework | 45ddafb93ed1f2e232d2f537f144bf79cb30bf3d | [
"MIT"
] | null | null | null | Django Rest Class Based Concrete API View/DRF_classbasedconcreateview/urls.py | abhisheksahu92/Django-Rest-Framework | 45ddafb93ed1f2e232d2f537f144bf79cb30bf3d | [
"MIT"
] | null | null | null | Django Rest Class Based Concrete API View/DRF_classbasedconcreateview/urls.py | abhisheksahu92/Django-Rest-Framework | 45ddafb93ed1f2e232d2f537f144bf79cb30bf3d | [
"MIT"
] | null | null | null | """DRF_classbasedconcreateview URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name... | 38.76 | 84 | 0.72033 | from django.contrib import admin
from django.urls import path
from Person.views import PersonView,PersonDetailsView
urlpatterns = [
path('admin/', admin.site.urls),
path('api/person/', PersonView.as_view(),name='person'),
path('api/person/<int:pk>/',PersonDetailsView.as_view() ,name='person-details'),
]
| true | true |
1c14a4e62685424bf735b354fcec412cd58118e7 | 1,672 | py | Python | CTFd/users.py | atti1a/CTFd | 6c5c63d667a17aec159c8e26ea53dccfbc4d0fa3 | [
"Apache-2.0"
] | 501 | 2019-11-22T07:19:06.000Z | 2022-03-28T07:16:40.000Z | CTFd/users.py | atti1a/CTFd | 6c5c63d667a17aec159c8e26ea53dccfbc4d0fa3 | [
"Apache-2.0"
] | 58 | 2019-12-02T13:59:15.000Z | 2022-02-26T01:53:52.000Z | CTFd/users.py | atti1a/CTFd | 6c5c63d667a17aec159c8e26ea53dccfbc4d0fa3 | [
"Apache-2.0"
] | 128 | 2019-12-02T11:15:58.000Z | 2022-03-27T08:25:59.000Z | from flask import request, render_template, Blueprint
from CTFd.models import Users
from CTFd.utils.decorators import authed_only
from CTFd.utils import config
from CTFd.utils.user import get_current_user
from CTFd.utils.decorators.visibility import (
check_account_visibility,
check_score_visibility,
)
users ... | 26.539683 | 88 | 0.699163 | from flask import request, render_template, Blueprint
from CTFd.models import Users
from CTFd.utils.decorators import authed_only
from CTFd.utils import config
from CTFd.utils.user import get_current_user
from CTFd.utils.decorators.visibility import (
check_account_visibility,
check_score_visibility,
)
users ... | true | true |
1c14a69def16c3f346fd4d1d5b86948d0a5a6732 | 10,656 | py | Python | pyinjective/proto/ibc/core/channel/v1/genesis_pb2.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 10 | 2021-09-07T08:03:52.000Z | 2022-03-08T08:39:30.000Z | pyinjective/proto/ibc/core/channel/v1/genesis_pb2.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 39 | 2021-08-19T20:09:35.000Z | 2022-03-22T19:51:59.000Z | pyinjective/proto/ibc/core/channel/v1/genesis_pb2.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 5 | 2021-11-02T16:23:48.000Z | 2022-01-20T22:30:05.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ibc/core/channel/v1/genesis.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection... | 54.646154 | 1,431 | 0.775244 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2
fr... | true | true |
1c14a76659e2137b5eeb9905a4e9fe9f053f3483 | 3,515 | py | Python | app/apptoml.py | Psychokiller1888/snipsWebAdmin | 74fe9d092df5a685e260ff919d4b9d9067267550 | [
"MIT"
] | 1 | 2019-05-31T15:23:59.000Z | 2019-05-31T15:23:59.000Z | app/apptoml.py | Psychokiller1888/snipsWebAdmin | 74fe9d092df5a685e260ff919d4b9d9067267550 | [
"MIT"
] | null | null | null | app/apptoml.py | Psychokiller1888/snipsWebAdmin | 74fe9d092df5a685e260ff919d4b9d9067267550 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
### **************************************************************************** ###
#
# Project: Snips Web Admin
# Created Date: Tuesday, May 29th 2018, 6:12:46 pm
# Author: Greg
# -----
# Last Modified: Fri Jun 15 2018
# Modified ... | 33.160377 | 84 | 0.608535 | from __future__ import unicode_literals
import toml
from collections import OrderedDict
import logging
logger = logging.getLogger('snipsWebAdmin-toml')
class tomlDB():
def __init__(self, file=None):
self.data = {}
self.file = file
if self.file:
self.data = tom... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.