hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7903ad4d5e4d2f4f2f298c54c4105aad64c96d1c | 1,378 | py | Python | examples/Legend.py | hishizuka/pyqtgraph | 4820625d93ffb41f324431d0d29b395cf91f339e | [
"MIT"
] | 2,762 | 2015-01-02T14:34:10.000Z | 2022-03-30T14:06:07.000Z | examples/Legend.py | hishizuka/pyqtgraph | 4820625d93ffb41f324431d0d29b395cf91f339e | [
"MIT"
] | 1,901 | 2015-01-12T03:20:30.000Z | 2022-03-31T16:33:36.000Z | examples/Legend.py | hishizuka/pyqtgraph | 4820625d93ffb41f324431d0d29b395cf91f339e | [
"MIT"
] | 1,038 | 2015-01-01T04:05:49.000Z | 2022-03-31T11:57:51.000Z | # -*- coding: utf-8 -*-
"""
Demonstrates basic use of LegendItem
"""
import initExample ## Add path to library (just for examples; you do not need this)
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
win = pg.plot()
win.setWindowTitle('pyqtgraph example: BarGraphItem')
# # option1:... | 31.318182 | 126 | 0.646589 |
import initExample
import numpy as np
win = pg.plot()
win.setWindowTitle('pyqtgraph example: BarGraphItem')
width=0.3, brush='b', pen='w', name='bar')
win.addItem(bg1)
c1 = win.plot([np.random.randint(0,8) for i in range(10)], pen='r', symbol='t', symbolPen='r', symbolBrush='g', name='curve1')
c2 = win.plot([2,1,... | true | true |
7903ad83a3c9266683e5189ab1c26a2199f34333 | 1,389 | py | Python | setup.py | timgates42/pyramid_pages | 545b1ecb2e5dee5742135ba2a689b9635dd4efa1 | [
"MIT"
] | 9 | 2015-12-20T04:23:31.000Z | 2020-11-13T06:23:47.000Z | setup.py | timgates42/pyramid_pages | 545b1ecb2e5dee5742135ba2a689b9635dd4efa1 | [
"MIT"
] | 21 | 2015-06-01T14:15:38.000Z | 2015-09-14T15:15:30.000Z | setup.py | timgates42/pyramid_pages | 545b1ecb2e5dee5742135ba2a689b9635dd4efa1 | [
"MIT"
] | 2 | 2017-04-10T18:39:17.000Z | 2020-04-01T11:31:37.000Z | import os
from setuptools import find_packages, setup
this = os.path.dirname(os.path.realpath(__file__))
def read(name):
with open(os.path.join(this, name)) as f:
return f.read()
setup(
name='pyramid_pages',
version='0.0.5',
url='http://github.com/uralbash/pyramid_pages/',
author='Svint... | 30.866667 | 75 | 0.62491 | import os
from setuptools import find_packages, setup
this = os.path.dirname(os.path.realpath(__file__))
def read(name):
with open(os.path.join(this, name)) as f:
return f.read()
setup(
name='pyramid_pages',
version='0.0.5',
url='http://github.com/uralbash/pyramid_pages/',
author='Svint... | true | true |
7903ae47b010a89c02ae6eaa38fc3169ff383f96 | 46 | py | Python | pilot/__init__.py | WuraLab/wuralab.github.io | 9da7bb4312f30e864a87b456528192a139aafecc | [
"MIT"
] | null | null | null | pilot/__init__.py | WuraLab/wuralab.github.io | 9da7bb4312f30e864a87b456528192a139aafecc | [
"MIT"
] | null | null | null | pilot/__init__.py | WuraLab/wuralab.github.io | 9da7bb4312f30e864a87b456528192a139aafecc | [
"MIT"
] | null | null | null | from user import User
__all__ =[
"User"
] | 9.2 | 21 | 0.630435 | from user import User
__all__ =[
"User"
] | true | true |
7903aec9261beaa0e04cd5547dff04f42ead45ee | 457 | py | Python | frequently/urls.py | bitlabstudio/django-frequently | 93c76af62325afd1f09487dd1bb527fdd238ec8e | [
"MIT"
] | 5 | 2016-12-08T21:40:54.000Z | 2020-04-08T07:05:22.000Z | frequently/urls.py | bitlabstudio/django-frequently | 93c76af62325afd1f09487dd1bb527fdd238ec8e | [
"MIT"
] | null | null | null | frequently/urls.py | bitlabstudio/django-frequently | 93c76af62325afd1f09487dd1bb527fdd238ec8e | [
"MIT"
] | 1 | 2019-11-29T13:35:05.000Z | 2019-11-29T13:35:05.000Z | """URLs for the ``django-frequently`` application."""
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$',
views.EntryCategoryListView.as_view(),
name='frequently_list'),
url(r'^your-question/$',
views.EntryCreateView.as_view(),
name='frequently_sub... | 22.85 | 53 | 0.625821 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$',
views.EntryCategoryListView.as_view(),
name='frequently_list'),
url(r'^your-question/$',
views.EntryCreateView.as_view(),
name='frequently_submit_question'),
url(r'^(?P<slug>[a-z-0-9]+)/$',
... | true | true |
7903af6f4b451614c6d96b416f5faf95bbe378e2 | 3,051 | py | Python | controlm_py/models/error_list.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | 2 | 2020-03-20T18:24:23.000Z | 2021-03-05T22:05:04.000Z | controlm_py/models/error_list.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | null | null | null | controlm_py/models/error_list.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | 1 | 2021-05-27T15:54:37.000Z | 2021-05-27T15:54:37.000Z | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.220
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ErrorList(... | 27.486486 | 80 | 0.550967 |
import pprint
import re
import six
class ErrorList(object):
swagger_types = {
'errors': 'list[ErrorData]'
}
attribute_map = {
'errors': 'errors'
}
def __init__(self, errors=None):
self._errors = None
self.discriminator = None
if errors is not None:
... | true | true |
7903af900a11fbfd57e6ba7f79d4ea4d8ce692e5 | 470 | py | Python | nettests/monitor.py | Laighno/evt | 90b94e831aebb62c6ad19ce59c9089e9f51cfd77 | [
"MIT"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | nettests/monitor.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | nettests/monitor.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | import docker
if __name__ == '__main__':
client = docker.from_env()
i = -1
name = 'evtd_'
while(True):
try:
i += 1
container = client.containers.get('{}{}'.format(name,i))
print(container.logs(tail=1))
# container.stop()
# container.re... | 26.111111 | 68 | 0.485106 | import docker
if __name__ == '__main__':
client = docker.from_env()
i = -1
name = 'evtd_'
while(True):
try:
i += 1
container = client.containers.get('{}{}'.format(name,i))
print(container.logs(tail=1))
except doc... | true | true |
7903afb6d39cba1be067942cce430c5a52065615 | 1,583 | py | Python | tests/clickhouse/query_dsl/test_time_range.py | fpacifici/snuba | cf732b71383c948f9387fbe64e9404ca71f8e9c5 | [
"Apache-2.0"
] | null | null | null | tests/clickhouse/query_dsl/test_time_range.py | fpacifici/snuba | cf732b71383c948f9387fbe64e9404ca71f8e9c5 | [
"Apache-2.0"
] | null | null | null | tests/clickhouse/query_dsl/test_time_range.py | fpacifici/snuba | cf732b71383c948f9387fbe64e9404ca71f8e9c5 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from snuba.clickhouse.query_dsl.accessors import get_time_range
from snuba.datasets.factory import get_dataset
from snuba.datasets.plans.translator.query import identity_translate
from snuba.query.parser import parse_query
from snuba.query.processors.timeseries_processor import TimeSeries... | 35.977273 | 87 | 0.660771 | from datetime import datetime
from snuba.clickhouse.query_dsl.accessors import get_time_range
from snuba.datasets.factory import get_dataset
from snuba.datasets.plans.translator.query import identity_translate
from snuba.query.parser import parse_query
from snuba.query.processors.timeseries_processor import TimeSeries... | true | true |
7903b1b4bc3be9b2149443518cf0e1fadc48806d | 17,589 | py | Python | kotlin-website.py | Tradehunt/kotlin-web-site | 5c2f88fb72130071746bde2c375acbb4182858c0 | [
"Apache-2.0"
] | 1,289 | 2015-01-17T23:02:12.000Z | 2022-03-31T07:05:05.000Z | kotlin-website.py | Tradehunt/kotlin-web-site | 5c2f88fb72130071746bde2c375acbb4182858c0 | [
"Apache-2.0"
] | 1,230 | 2015-01-04T08:16:08.000Z | 2022-03-25T00:00:42.000Z | kotlin-website.py | Tradehunt/kotlin-web-site | 5c2f88fb72130071746bde2c375acbb4182858c0 | [
"Apache-2.0"
] | 3,395 | 2015-01-02T20:45:03.000Z | 2022-03-30T21:01:15.000Z | import copy
import datetime
import glob
import json
import os
import sys
import threading
from os import path
from urllib.parse import urlparse, urljoin, ParseResult
import xmltodict
import yaml
from bs4 import BeautifulSoup
from flask import Flask, render_template, Response, send_from_directory, request
from flask.vi... | 32.096715 | 114 | 0.648815 | import copy
import datetime
import glob
import json
import os
import sys
import threading
from os import path
from urllib.parse import urlparse, urljoin, ParseResult
import xmltodict
import yaml
from bs4 import BeautifulSoup
from flask import Flask, render_template, Response, send_from_directory, request
from flask.vi... | true | true |
7903b2cc28f548b837773d028e06bc2268565a94 | 24,145 | py | Python | .venv/Lib/site-packages/rich/pretty.py | jefferdo/gpt-3-client | 7acbc5f518fe3fcb55d0bdcbf93fc87b103b1148 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/rich/pretty.py | jefferdo/gpt-3-client | 7acbc5f518fe3fcb55d0bdcbf93fc87b103b1148 | [
"MIT"
] | 76 | 2020-07-31T05:33:39.000Z | 2022-03-28T05:04:17.000Z | rich/pretty.py | shyovn/rich | a05a5a1c2f95f25db70ac3657e99f0bab652e2cd | [
"MIT"
] | null | null | null | import builtins
import os
import sys
from array import array
from collections import Counter, defaultdict, deque
from dataclasses import dataclass, fields, is_dataclass
from itertools import islice
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
... | 34.741007 | 134 | 0.566163 | import builtins
import os
import sys
from array import array
from collections import Counter, defaultdict, deque
from dataclasses import dataclass, fields, is_dataclass
from itertools import islice
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
... | true | true |
7903b3457356b7d719cf8cfe5244c130b277cf39 | 626 | py | Python | kappa/lattice/ammonia.py | ajkerr0/kappa | 7a74582596f96b6a9a1488df5a4777c7b723c919 | [
"MIT"
] | 6 | 2016-05-30T19:56:54.000Z | 2021-01-21T19:42:24.000Z | kappa/lattice/ammonia.py | ajkerr0/kappa | 7a74582596f96b6a9a1488df5a4777c7b723c919 | [
"MIT"
] | 92 | 2016-05-26T19:50:51.000Z | 2019-01-08T22:15:09.000Z | kappa/lattice/ammonia.py | ajkerr0/kappa | 7a74582596f96b6a9a1488df5a4777c7b723c919 | [
"MIT"
] | 4 | 2016-05-28T22:07:25.000Z | 2021-02-26T00:12:51.000Z | # -*- coding: utf-8 -*-
"""
@author: alex
"""
import numpy as np
def main():
"""Main program execution."""
n,h1,h2,h3 = generate_ammonia_sites()
nList = [[1,2,3],[0],[0],[0]]
return [n,h1,h2,h3], nList
def generate_ammonia_sites():
"""Generate the locations for the atoms in the amm... | 17.885714 | 70 | 0.484026 |
import numpy as np
def main():
n,h1,h2,h3 = generate_ammonia_sites()
nList = [[1,2,3],[0],[0],[0]]
return [n,h1,h2,h3], nList
def generate_ammonia_sites():
x,y = np.array([1.,0.,0.]), np.array([0.,1.,0.])
a = 1.40
n = np.array([0.,0.,0.])
h1 = n + a... | true | true |
7903b37082debbd494ccf88252b5603b2a386f2c | 2,994 | py | Python | vendor/packages/click/tests/test_testing.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | 2 | 2019-06-06T06:56:09.000Z | 2019-06-19T06:13:33.000Z | vendor/packages/click/tests/test_testing.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/click/tests/test_testing.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | import pytest
import click
from click.testing import CliRunner
from click._compat import PY2
# Use the most reasonable io that users would use for the python version.
if PY2:
from cStringIO import StringIO as ReasonableBytesIO
else:
from io import BytesIO as ReasonableBytesIO
def test_runner():
@click.... | 25.810345 | 76 | 0.637609 | import pytest
import click
from click.testing import CliRunner
from click._compat import PY2
if PY2:
from cStringIO import StringIO as ReasonableBytesIO
else:
from io import BytesIO as ReasonableBytesIO
def test_runner():
@click.command()
def test():
i = click.get_binary_stream('stdin')
... | true | true |
7903b3c6c1a37be6b9eaf4ac608b56c9e2678754 | 10,126 | py | Python | tests/unit/test_private.py | Cattes/coinbasepro-python | 0a9c9ba2188f6bfa08a842a666ab12fe1cc02276 | [
"MIT"
] | null | null | null | tests/unit/test_private.py | Cattes/coinbasepro-python | 0a9c9ba2188f6bfa08a842a666ab12fe1cc02276 | [
"MIT"
] | null | null | null | tests/unit/test_private.py | Cattes/coinbasepro-python | 0a9c9ba2188f6bfa08a842a666ab12fe1cc02276 | [
"MIT"
] | null | null | null | from itertools import islice
from tests.unit.utils import Teardown
import inspect
import pytest
import time
import cbpro.messenger
import cbpro.public
import cbpro.private
class TestPrivateClient(object):
def test_private_attr(self, private_client):
assert isinstance(private_client, cbpro.public.PublicC... | 35.038062 | 75 | 0.693067 | from itertools import islice
from tests.unit.utils import Teardown
import inspect
import pytest
import time
import cbpro.messenger
import cbpro.public
import cbpro.private
class TestPrivateClient(object):
def test_private_attr(self, private_client):
assert isinstance(private_client, cbpro.public.PublicC... | true | true |
7903b51a1ee8b4016a4a7003dbe0d29a14d08635 | 918 | py | Python | credentials_test.py | paulmunyao/Password-Locker | 918aa30ecadc1ea09cd09b2945e57e0f3ac67b7e | [
"Unlicense"
] | null | null | null | credentials_test.py | paulmunyao/Password-Locker | 918aa30ecadc1ea09cd09b2945e57e0f3ac67b7e | [
"Unlicense"
] | null | null | null | credentials_test.py | paulmunyao/Password-Locker | 918aa30ecadc1ea09cd09b2945e57e0f3ac67b7e | [
"Unlicense"
] | null | null | null | from credentials import credentials
import unittest
import pyperclip
class TestUser(unittest.TestCase):
'''
Test that defines test cases for the User class
Args:
unitest.Testcase: Testcase that helps in creating test cases for class User.
'''
def setUp(self):
'''
Set up me... | 26.228571 | 84 | 0.62963 | from credentials import credentials
import unittest
import pyperclip
class TestUser(unittest.TestCase):
def setUp(self):
self.new_user = credentials("Paul", "123")
def test__init__(self):
self.assertEqual(self.new_user.user_name, "Paul")
self.assertEqual(self.new_user.password, "123... | true | true |
7903b526f8e93b915a778b6c9b1353a988055576 | 1,084 | py | Python | aria/parser/__init__.py | enricorusso/incubator-ariatosca | 3748b1962697712bde29c9de781d867c6c5ffad1 | [
"Apache-2.0"
] | 1 | 2018-10-13T06:32:10.000Z | 2018-10-13T06:32:10.000Z | aria/parser/__init__.py | enricorusso/incubator-ariatosca | 3748b1962697712bde29c9de781d867c6c5ffad1 | [
"Apache-2.0"
] | null | null | null | aria/parser/__init__.py | enricorusso/incubator-ariatosca | 3748b1962697712bde29c9de781d867c6c5ffad1 | [
"Apache-2.0"
] | 1 | 2020-06-16T15:13:06.000Z | 2020-06-16T15:13:06.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 30.971429 | 74 | 0.74262 |
from .specification import implements_specification, iter_specifications
MODULES = (
'consumption',
'loading',
'modeling',
'presentation',
'reading',
'validation')
__all__ = (
'MODULES',
'implements_specification',
'iter_specifications')
| true | true |
7903b593ae23f1e169e9267b4afb8f03f0da3218 | 3,158 | py | Python | pvfactors/report.py | tcapelle/pvfactors | 1aaf6cdd3066a3a68d93db4ad7abcf10e97b5620 | [
"BSD-3-Clause"
] | null | null | null | pvfactors/report.py | tcapelle/pvfactors | 1aaf6cdd3066a3a68d93db4ad7abcf10e97b5620 | [
"BSD-3-Clause"
] | null | null | null | pvfactors/report.py | tcapelle/pvfactors | 1aaf6cdd3066a3a68d93db4ad7abcf10e97b5620 | [
"BSD-3-Clause"
] | null | null | null | """Module containing examples of report builder functions and classes."""
from collections import OrderedDict
import numpy as np
def example_fn_build_report(report, pvarray):
"""Example function that builds a report when used in the
:py:class:`~pvfactors.engine.PVEngine` with full mode simulations.
Here ... | 32.895833 | 79 | 0.622863 |
from collections import OrderedDict
import numpy as np
def example_fn_build_report(report, pvarray):
if report is None:
list_keys = ['qinc_front', 'qinc_back', 'iso_front', 'iso_back']
report = OrderedDict({key: [] for key in list_keys})
if pvarray is not None:
pvrow = pvarr... | true | true |
7903b5960f7b65c5eae95333461a9ee1d4fd86e9 | 8,242 | py | Python | CarlaDriving/server/lane_detection/utils.py | eamorgado/Car-Self-driving-Simulator | 498d54a30c665b38ae6e120d8ae8311e77ad61f2 | [
"BSD-3-Clause"
] | 1 | 2021-01-25T02:08:55.000Z | 2021-01-25T02:08:55.000Z | CarlaDriving/server/lane_detection/utils.py | eamorgado/Car-Self-driving-Simulator | 498d54a30c665b38ae6e120d8ae8311e77ad61f2 | [
"BSD-3-Clause"
] | null | null | null | CarlaDriving/server/lane_detection/utils.py | eamorgado/Car-Self-driving-Simulator | 498d54a30c665b38ae6e120d8ae8311e77ad61f2 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import cv2 as cv
import math
from server.cv_utils import *
def filterGaussian(img,size=(5,5),stdv=0):
"""Summary of filterGaussian
This will apply a noise reduction filter, we will use s 5x5 Gaussian filter to smooth
the image to lower the sensitivity to noise. (The smaller the size... | 36.149123 | 152 | 0.665372 | import numpy as np
import cv2 as cv
import math
from server.cv_utils import *
def filterGaussian(img,size=(5,5),stdv=0):
if not isCV(img):
raise ValueError("Image not in np.array format")
if not isinstance(size,tuple):
raise ValueError('filterGaussian: Size for Gaussian filter not tuple')
... | true | true |
7903b5d9d0dabfd8434bcbad2f0fc8d602ebdb81 | 179 | py | Python | h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_select_column_name.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_select_column_name.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_select_column_name.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | df['A']
# A
# ---------
# -0.613035
# -1.265520
# 0.763851
# -1.248425
# 2.105805
# 1.763502
# -0.781973
# 1.400853
# -0.746025
# -1.120648
#
# [100 rows x 1 column] | 11.1875 | 23 | 0.497207 | df['A']
| true | true |
7903b6540a65f0d4a3d52b31ef4ff55f2ef730ce | 13,457 | py | Python | awx_collection/plugins/modules/tower_job_template.py | mlyahmed/awx2 | a474762e81b90752dbac39dcefed3224ad65df1f | [
"Apache-2.0"
] | null | null | null | awx_collection/plugins/modules/tower_job_template.py | mlyahmed/awx2 | a474762e81b90752dbac39dcefed3224ad65df1f | [
"Apache-2.0"
] | null | null | null | awx_collection/plugins/modules/tower_job_template.py | mlyahmed/awx2 | a474762e81b90752dbac39dcefed3224ad65df1f | [
"Apache-2.0"
] | 1 | 2021-02-07T21:08:44.000Z | 2021-02-07T21:08:44.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | 32.348558 | 149 | 0.623021 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: tower_job_template
author: "Wayne Witzel III (@wwitze... | true | true |
7903b71f344fdae0aaa535b9d1dc6746718b0d4e | 6,074 | py | Python | models/fdconv1d_lstm/train.py | rovo98/model-unkown-dfa-diagnosis-based-on-running-logs | f80c838dea6a8313165fbf10d64d5dc935cc036c | [
"Apache-2.0"
] | null | null | null | models/fdconv1d_lstm/train.py | rovo98/model-unkown-dfa-diagnosis-based-on-running-logs | f80c838dea6a8313165fbf10d64d5dc935cc036c | [
"Apache-2.0"
] | 4 | 2020-04-30T07:57:42.000Z | 2020-09-27T06:52:00.000Z | models/fdconv1d_lstm/train.py | rovo98/model-unkown-dfa-diagnosis-based-on-running-logs | f80c838dea6a8313165fbf10d64d5dc935cc036c | [
"Apache-2.0"
] | null | null | null | # author rovo98
import os
import tensorflow as tf
from tensorflow.keras.utils import plot_model
from tensorflow.keras.callbacks import EarlyStopping
from model_data_input import load_processed_dataset
from models.fdconv1d_lstm.model import build_fdconv1d_lstm
from models.utils.misc import running_timer
from models.u... | 43.697842 | 114 | 0.689167 |
import os
import tensorflow as tf
from tensorflow.keras.utils import plot_model
from tensorflow.keras.callbacks import EarlyStopping
from model_data_input import load_processed_dataset
from models.fdconv1d_lstm.model import build_fdconv1d_lstm
from models.utils.misc import running_timer
from models.utils.misc impor... | true | true |
7903b7a6bfd5a38a00aa106b422ceee6f3169781 | 89,814 | py | Python | vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 2 | 2018-02-01T06:30:24.000Z | 2018-04-12T15:39:56.000Z | vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 7 | 2020-03-24T15:50:06.000Z | 2021-06-08T19:57:39.000Z | vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 1 | 2018-09-19T05:55:27.000Z | 2018-09-19T05:55:27.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/vision_v1p1beta1/proto/image_annotator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descript... | 42.973206 | 9,043 | 0.743392 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | true | true |
7903b7b89b3b30b8208076289a71ea4edac78442 | 1,316 | py | Python | setup.py | nprapps/copydoc | e1ab09b287beb0439748c319cf165cbc06c66624 | [
"MIT"
] | 13 | 2016-03-31T20:22:24.000Z | 2021-11-08T10:26:02.000Z | setup.py | nprapps/copydoc | e1ab09b287beb0439748c319cf165cbc06c66624 | [
"MIT"
] | 12 | 2016-04-04T21:36:37.000Z | 2018-06-11T21:46:42.000Z | setup.py | nprapps/copydoc | e1ab09b287beb0439748c319cf165cbc06c66624 | [
"MIT"
] | 5 | 2016-11-25T21:19:50.000Z | 2021-08-10T20:06:19.000Z | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='copydoc',
version='1.0.9',
author='NPR Visuals',
author_email='nprapps@npr.org',
... | 27.416667 | 73 | 0.584347 | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='copydoc',
version='1.0.9',
author='NPR Visuals',
author_email='nprapps@npr.org',
... | true | true |
7903b7f25ce3bde17056fc18aecf3c4a13848ab1 | 2,370 | py | Python | src/aioros/param_manager.py | mgrrx/aioros | 9bd750020d0d5fb466891346f61b6f083cbb8f05 | [
"Apache-2.0"
] | 8 | 2020-08-27T17:16:59.000Z | 2022-02-02T13:39:41.000Z | src/aioros/param_manager.py | mgrrx/aioros | 9bd750020d0d5fb466891346f61b6f083cbb8f05 | [
"Apache-2.0"
] | 3 | 2022-02-09T19:18:12.000Z | 2022-03-08T21:12:00.000Z | src/aioros/param_manager.py | mgrrx/aioros | 9bd750020d0d5fb466891346f61b6f083cbb8f05 | [
"Apache-2.0"
] | null | null | null | from asyncio import AbstractEventLoop
from asyncio import iscoroutinefunction
from collections import defaultdict
from typing import Any
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import NamedTuple
from typing import Set
from typing import Tuple
from .api.master_api_... | 27.55814 | 76 | 0.613924 | from asyncio import AbstractEventLoop
from asyncio import iscoroutinefunction
from collections import defaultdict
from typing import Any
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import NamedTuple
from typing import Set
from typing import Tuple
from .api.master_api_... | true | true |
7903bac5b20dfc446bbb6cdb13db604f3fb24884 | 7,024 | py | Python | third-party/language/generator.py | mousedoc/Prism | d7cb2e541894a9a190606e18661b79514aef6d33 | [
"CC0-1.0"
] | null | null | null | third-party/language/generator.py | mousedoc/Prism | d7cb2e541894a9a190606e18661b79514aef6d33 | [
"CC0-1.0"
] | 1 | 2018-05-19T06:52:45.000Z | 2018-05-19T06:52:45.000Z | third-party/language/generator.py | mousedoc/Prism | d7cb2e541894a9a190606e18661b79514aef6d33 | [
"CC0-1.0"
] | null | null | null | import xlrd
import os
import sys
import copy
import json
import codecs
from collections import OrderedDict
# Constant Values
PARENT_NAME_ROW = 0
PARENT_NAME_COL = 0
COLUMN_NAMES_ROW = 1
DATA_STARTING_ROW = 2
ROOT_NAME = '*root'
ID_COLUMN_NAME = 'id'
PARENT_COLUMN_NAME = '*parent'
IGNORE_WILDCARD = '_'
REQUIRE_VERSION ... | 30.017094 | 117 | 0.589408 | import xlrd
import os
import sys
import copy
import json
import codecs
from collections import OrderedDict
PARENT_NAME_ROW = 0
PARENT_NAME_COL = 0
COLUMN_NAMES_ROW = 1
DATA_STARTING_ROW = 2
ROOT_NAME = '*root'
ID_COLUMN_NAME = 'id'
PARENT_COLUMN_NAME = '*parent'
IGNORE_WILDCARD = '_'
REQUIRE_VERSION = (3, 5)
EXCEL_PA... | true | true |
7903bb00451b5531a51de1222aa17b9837016a32 | 19,453 | py | Python | test/functional/test_framework/test_framework.py | YayatEl/ideacoin | a85e2f217e2ae04f2f12d80d709e4bc689a0103c | [
"MIT"
] | 1 | 2017-08-21T09:30:30.000Z | 2017-08-21T09:30:30.000Z | test/functional/test_framework/test_framework.py | YayatEl/ideacoin | a85e2f217e2ae04f2f12d80d709e4bc689a0103c | [
"MIT"
] | null | null | null | test/functional/test_framework/test_framework.py | YayatEl/ideacoin | a85e2f217e2ae04f2f12d80d709e4bc689a0103c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from collections import deque
from enum import Enum
import logging
impo... | 41.389362 | 310 | 0.611114 |
from collections import deque
from enum import Enum
import logging
import optparse
import os
import pdb
import shutil
import sys
import tempfile
import time
import traceback
from .authproxy import JSONRPCException
from . import coverage
from .test_node import TestNode
from .util import (
MAX_NODES,
PortSe... | true | true |
7903bb9042f99d0b5e4cb0907b46c9f0cc7a98e2 | 5,746 | py | Python | gridworld_hallways/make_grid_mdp.py | andrewmw94/gandalf_2020_experiments | bc671d5c33f16f3388b661623a8663835e62d74c | [
"MIT"
] | null | null | null | gridworld_hallways/make_grid_mdp.py | andrewmw94/gandalf_2020_experiments | bc671d5c33f16f3388b661623a8663835e62d74c | [
"MIT"
] | null | null | null | gridworld_hallways/make_grid_mdp.py | andrewmw94/gandalf_2020_experiments | bc671d5c33f16f3388b661623a8663835e62d74c | [
"MIT"
] | null | null | null | # MIT License
# Copyright (c) 2020 Andrew Wells
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | 32.647727 | 185 | 0.540724 |
print_LTL_game = True
obstacle_cells = [[3,0], [3,1], [3,3], [3,4], [3,5], [3,6], [3,7], [3,8], [5,2], [5,3], [5,4], [5,5], [5,6], [5,7], [5,8], [5,9], [7,0], [7,1], [7,3], [7,4], [7,5], [7,6], [7,7], [7,8]]
num_rows = 10
num_cols = 10
probN = 0.69
probE = 0.1
probW = 0.1
probB = 0.01
probS = ... | true | true |
7903bc29f8b2ffc3d00958b1e270a12c5e6daea1 | 1,951 | py | Python | examples.py | Reveal-Energy-Services/orchid-python-api | 21ed6058009f6b8793050a934238d2858a7fa0c9 | [
"Apache-2.0"
] | null | null | null | examples.py | Reveal-Energy-Services/orchid-python-api | 21ed6058009f6b8793050a934238d2858a7fa0c9 | [
"Apache-2.0"
] | 28 | 2020-08-14T14:08:43.000Z | 2022-02-07T14:11:38.000Z | examples.py | Reveal-Energy-Services/orchid-python-api | 21ed6058009f6b8793050a934238d2858a7fa0c9 | [
"Apache-2.0"
] | 1 | 2021-12-01T21:20:07.000Z | 2021-12-01T21:20:07.000Z | #
# This file is part of Orchid and related technologies.
#
# Copyright (c) 2017-2021 Reveal Energy Services. All Rights Reserved.
#
# LEGAL NOTICE:
# Orchid contains trade secrets and otherwise confidential information
# owned by Reveal Energy Services. Access to and use of this information is
# strictly limited and... | 36.811321 | 87 | 0.678626 |
# except under appropriate precautions to maintain the confidentiality hereof,
# and may not be used in any way not expressly authorized by the Company.
#
import pathlib
def _stem_names():
example_stems = ['completion_analysis', 'plot_time_series', 'plot_trajectories',
'plot_treat... | true | true |
7903bccfa7e81d8f324f520fdfa7701cddc8a79b | 479 | py | Python | nlu/components/embeddings/sentence_bert/BertSentenceEmbedding.py | milyiyo/nlu | d209ed11c6a84639c268f08435552248391c5573 | [
"Apache-2.0"
] | 480 | 2020-08-24T02:36:40.000Z | 2022-03-30T08:09:43.000Z | nlu/components/embeddings/sentence_bert/BertSentenceEmbedding.py | milyiyo/nlu | d209ed11c6a84639c268f08435552248391c5573 | [
"Apache-2.0"
] | 28 | 2020-09-26T18:55:43.000Z | 2022-03-26T01:05:45.000Z | nlu/components/embeddings/sentence_bert/BertSentenceEmbedding.py | milyiyo/nlu | d209ed11c6a84639c268f08435552248391c5573 | [
"Apache-2.0"
] | 76 | 2020-09-25T22:55:12.000Z | 2022-03-17T20:25:52.000Z | from sparknlp.annotator import *
class BertSentence:
@staticmethod
def get_default_model():
return BertSentenceEmbeddings.pretrained() \
.setInputCols("sentence") \
.setOutputCol("sentence_embeddings")
@staticmethod
def get_pretrained_model(name, language, bucket=None):
... | 25.210526 | 72 | 0.686848 | from sparknlp.annotator import *
class BertSentence:
@staticmethod
def get_default_model():
return BertSentenceEmbeddings.pretrained() \
.setInputCols("sentence") \
.setOutputCol("sentence_embeddings")
@staticmethod
def get_pretrained_model(name, language, bucket=None):
... | true | true |
7903bed3fb4151a3c8f3f57d8f2eb3e36e26bf1e | 13,834 | py | Python | tests/h/activity/bucketing_test.py | y3g0r/h | a057144956fe25e669aeba5d0f0eb38f9dc09566 | [
"BSD-2-Clause"
] | null | null | null | tests/h/activity/bucketing_test.py | y3g0r/h | a057144956fe25e669aeba5d0f0eb38f9dc09566 | [
"BSD-2-Clause"
] | null | null | null | tests/h/activity/bucketing_test.py | y3g0r/h | a057144956fe25e669aeba5d0f0eb38f9dc09566 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from unittest.mock import Mock
import pytest
from h.activity import bucketing
from tests.common import factories
UTCNOW = datetime.datetime(year=1970, month=2, day=21, hour=19, minute=30)
FIVE_MINS_AGO = UTCNOW - datetime.timedelta(minutes=5)
YESTERDAY = UTCNOW - datetime.ti... | 34.671679 | 88 | 0.630331 |
import datetime
from unittest.mock import Mock
import pytest
from h.activity import bucketing
from tests.common import factories
UTCNOW = datetime.datetime(year=1970, month=2, day=21, hour=19, minute=30)
FIVE_MINS_AGO = UTCNOW - datetime.timedelta(minutes=5)
YESTERDAY = UTCNOW - datetime.timedelta(days=1)
THIRD_M... | true | true |
7903bfa7c4c3f4d03ee77c8660e180b2e796228e | 1,136 | py | Python | CS-383_Cloud-Computing_2020-Spring/association-rule-mining/attempt2.py | CraftingGamerTom/wsu-computer-science | aa40fc95a84ac95535284048f6f572def1375f7d | [
"MIT"
] | null | null | null | CS-383_Cloud-Computing_2020-Spring/association-rule-mining/attempt2.py | CraftingGamerTom/wsu-computer-science | aa40fc95a84ac95535284048f6f572def1375f7d | [
"MIT"
] | null | null | null | CS-383_Cloud-Computing_2020-Spring/association-rule-mining/attempt2.py | CraftingGamerTom/wsu-computer-science | aa40fc95a84ac95535284048f6f572def1375f7d | [
"MIT"
] | null | null | null | # ----------------------------------------------------------------
# ---------- ASSOCIATION RULE MINING : NOTEABLE ATTEMPT 2 ---------
# ----------------------------------------------------------------
# ------------------ DAILY DATASET --------------------
association_rules = apriori(dailyRankedCrimes.values, min_s... | 37.866667 | 142 | 0.634683 |
association_rules = apriori(dailyRankedCrimes.values, min_support=0.02, min_confidence=0.95, min_lift=3, min_length=4, use_colnames = True)
association_results = list(association_rules)
print(len(association_results))
association_rules = apriori(yearlyRankedCrimes.values, min_support=0.02, min_confidence=0.... | true | true |
7903c03f0f3f65b772e643c060f92266b40db3fb | 3,090 | py | Python | app/recipe_app/tests/test_ingredients_api.py | oyekanmiayo/recipe-app-api | cc7cab599e8fab164acbb9958784b2cce4aced09 | [
"MIT"
] | null | null | null | app/recipe_app/tests/test_ingredients_api.py | oyekanmiayo/recipe-app-api | cc7cab599e8fab164acbb9958784b2cce4aced09 | [
"MIT"
] | null | null | null | app/recipe_app/tests/test_ingredients_api.py | oyekanmiayo/recipe-app-api | cc7cab599e8fab164acbb9958784b2cce4aced09 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe_app.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe_app... | 29.428571 | 76 | 0.667961 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe_app.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe_app... | true | true |
7903c0da71807c70134ec55f471896dec576ea31 | 6,346 | py | Python | users-api/routes.py | pwegrzyn/wegpat-gmail.com | 3fce9d0bc32c1d6be94cd664eb13a69255975fd0 | [
"MIT"
] | null | null | null | users-api/routes.py | pwegrzyn/wegpat-gmail.com | 3fce9d0bc32c1d6be94cd664eb13a69255975fd0 | [
"MIT"
] | 5 | 2021-09-02T12:22:08.000Z | 2022-03-02T09:15:20.000Z | users-api/routes.py | pwegrzyn/wegpat-gmail.com | 3fce9d0bc32c1d6be94cd664eb13a69255975fd0 | [
"MIT"
] | null | null | null | from flask import jsonify, request
from flask_restx import Resource, reqparse, fields, marshal_with
import requests
import redis
import os
import logging
import time
import datetime
import json
from app import api, db
from models import User
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
user_fi... | 34.302703 | 102 | 0.615663 | from flask import jsonify, request
from flask_restx import Resource, reqparse, fields, marshal_with
import requests
import redis
import os
import logging
import time
import datetime
import json
from app import api, db
from models import User
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
user_fi... | true | true |
7903c1c3dfad8328cf22af691edd0e774639b5f7 | 4,860 | py | Python | pypy/objspace/std/test/test_iterobject.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | pypy/objspace/std/test/test_iterobject.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | pypy/objspace/std/test/test_iterobject.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 30 | 2018-08-20T03:16:34.000Z | 2022-01-12T17:39:22.000Z | from pypy.objspace.std.iterobject import W_SeqIterObject
from pypy.interpreter.error import OperationError
class TestW_IterObject:
def body3(self, w_iter):
w = self.space.wrap
assert self.space.eq_w(self.space.next(w_iter), w(5))
assert self.space.eq_w(self.space.next(w_iter), w(3))
... | 31.153846 | 82 | 0.571193 | from pypy.objspace.std.iterobject import W_SeqIterObject
from pypy.interpreter.error import OperationError
class TestW_IterObject:
def body3(self, w_iter):
w = self.space.wrap
assert self.space.eq_w(self.space.next(w_iter), w(5))
assert self.space.eq_w(self.space.next(w_iter), w(3))
... | true | true |
7903c21a6228db7f3d68950da6c9441484d5fd1f | 1,109 | py | Python | python/NanoVG/__init__.py | mariotaku/nanovg | 57ebea95f90a98ad72e6cf188785c0c4f857933c | [
"Zlib"
] | 28 | 2021-05-06T03:21:57.000Z | 2022-03-31T18:28:52.000Z | python/NanoVG/__init__.py | mariotaku/nanovg | 57ebea95f90a98ad72e6cf188785c0c4f857933c | [
"Zlib"
] | null | null | null | python/NanoVG/__init__.py | mariotaku/nanovg | 57ebea95f90a98ad72e6cf188785c0c4f857933c | [
"Zlib"
] | 6 | 2021-08-29T04:18:09.000Z | 2022-02-10T13:52:21.000Z | from NanoVG.defs import *
from NanoVG.library import *
from NanoVG.api import *
__author__ = 'vaiorabbit'
__version__ = '1.1.0'
__license__ = 'zlib'
# Python-NanoVG : A Python bindings of NanoVG
# Copyright (c) 2017-2018 vaiorabbit
#
# This software is provided 'as-is', without any express or implied
# warranty. In ... | 36.966667 | 80 | 0.744815 | from NanoVG.defs import *
from NanoVG.library import *
from NanoVG.api import *
__author__ = 'vaiorabbit'
__version__ = '1.1.0'
__license__ = 'zlib'
| true | true |
7903c499261b86a4d0af4d39596ae363f1bf4d6c | 6,942 | py | Python | MxShop/extra_apps/DjangoUeditor/widgets.py | youshuad/django-vue-shop | dbede2301b10cb95ef30d0bbbbd594b240071fc1 | [
"MIT"
] | 66 | 2019-05-13T11:45:14.000Z | 2020-11-02T11:58:52.000Z | MxShop/extra_apps/DjangoUeditor/widgets.py | youshuad/django-vue-shop | dbede2301b10cb95ef30d0bbbbd594b240071fc1 | [
"MIT"
] | 11 | 2020-12-21T05:21:33.000Z | 2021-08-29T07:44:23.000Z | DjangoUeditor/widgets.py | jeeyshe/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 20 | 2019-12-30T06:23:17.000Z | 2020-10-06T01:48:58.000Z | # coding:utf-8
from django import forms
from django.conf import settings
from django.contrib.admin.widgets import AdminTextareaWidget
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.http import urlencode
from . import settings as USettings
from .comman... | 39.220339 | 168 | 0.610631 |
from django import forms
from django.conf import settings
from django.contrib.admin.widgets import AdminTextareaWidget
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.http import urlencode
from . import settings as USettings
from .commands import *
fr... | true | true |
7903c61fd5f344cf014597410b78efd5e28345c5 | 516 | py | Python | FirstChild/src/states/ground_save.py | KrystopherWeeton/RLBot | a77d408208f17f1b3678e8b92b8525e460e80dfa | [
"MIT"
] | null | null | null | FirstChild/src/states/ground_save.py | KrystopherWeeton/RLBot | a77d408208f17f1b3678e8b92b8525e460e80dfa | [
"MIT"
] | 2 | 2021-06-08T22:07:03.000Z | 2021-09-08T02:22:44.000Z | FirstChild/src/states/ground_save.py | KrystopherWeeton/RLBot | a77d408208f17f1b3678e8b92b8525e460e80dfa | [
"MIT"
] | null | null | null | from rlbot.utils.structures.game_data_struct import Physics, GameTickPacket, PlayerInfo
from rlbot.agents.base_agent import SimpleControllerState, BaseAgent
from states.state import State
from util.packet import ParsedPacket
class GroundSave(State):
def score(self, parsed_packet: ParsedPacket, packet: GameTickPa... | 39.692308 | 121 | 0.792636 | from rlbot.utils.structures.game_data_struct import Physics, GameTickPacket, PlayerInfo
from rlbot.agents.base_agent import SimpleControllerState, BaseAgent
from states.state import State
from util.packet import ParsedPacket
class GroundSave(State):
def score(self, parsed_packet: ParsedPacket, packet: GameTickPa... | true | true |
7903c69f4a242244a521410241942fab32da7f37 | 9,481 | py | Python | libsig/FZZ_unique_ring_signature.py | vs-uulm/libsig_pets | 7eda22ea87faa6f949a154f9d6fd0f3814294bbf | [
"MIT"
] | null | null | null | libsig/FZZ_unique_ring_signature.py | vs-uulm/libsig_pets | 7eda22ea87faa6f949a154f9d6fd0f3814294bbf | [
"MIT"
] | null | null | null | libsig/FZZ_unique_ring_signature.py | vs-uulm/libsig_pets | 7eda22ea87faa6f949a154f9d6fd0f3814294bbf | [
"MIT"
] | null | null | null | """
This file implements the signature scheme from "Unique Ring Signatures: A Practical
Construction" by Matthew Franklin and Haibin Zhang
"""
import sys
import math
from random import randint
import hashlib
from libsig.AbstractRingSignatureScheme import AbstractRingSignatureScheme
#from AbstractRingSignatureScheme im... | 30.194268 | 144 | 0.528214 |
import sys
import math
from random import randint
import hashlib
from libsig.AbstractRingSignatureScheme import AbstractRingSignatureScheme
def find_divisors(x):
divisors = [ i for i in range(1,x+1) if x % i == 0]
return divisors
def find_generator(p):
testGen = randint(1,p)
li... | true | true |
7903c6c9ed2da0586724572b26fb2a47f98dcd26 | 434 | py | Python | backend/device/test_defs.py | open-home-iot/hint | b674f83ee61d7cc653acec15b92b98618f8e23b5 | [
"MIT"
] | null | null | null | backend/device/test_defs.py | open-home-iot/hint | b674f83ee61d7cc653acec15b92b98618f8e23b5 | [
"MIT"
] | 3 | 2020-12-28T23:31:47.000Z | 2021-04-18T09:30:43.000Z | backend/device/test_defs.py | megacorpincorporated/hint | 136700c743a647cc9bf35548a7baeaac238e3b1f | [
"MIT"
] | null | null | null | HUME_UUID = "9cb37270-69f5-4dc0-9fd5-7183da5ffc19"
DEVICE_UUID_1 = "e2bf93b6-9b5d-4944-a863-611b6b6600e7"
DEVICE_UUID_2 = "e2bf93b6-9b5d-4944-a863-611b6b6600e1"
DEVICE_UUID_3 = "e2bf93b6-9b5d-4944-a863-611b6b6600e2"
BASIC_LED_CAPS = {
'uuid': DEVICE_UUID_1,
'name': 'Basic LED',
'category': 1,
'type': 1... | 24.111111 | 54 | 0.589862 | HUME_UUID = "9cb37270-69f5-4dc0-9fd5-7183da5ffc19"
DEVICE_UUID_1 = "e2bf93b6-9b5d-4944-a863-611b6b6600e7"
DEVICE_UUID_2 = "e2bf93b6-9b5d-4944-a863-611b6b6600e1"
DEVICE_UUID_3 = "e2bf93b6-9b5d-4944-a863-611b6b6600e2"
BASIC_LED_CAPS = {
'uuid': DEVICE_UUID_1,
'name': 'Basic LED',
'category': 1,
'type': 1... | true | true |
7903c76982c4c65c01d45654cddbfe1feb0ed4a6 | 43,384 | py | Python | evaluations/evaluation-python-code/python/06_licma_analysis_results/evaluation_of_licma_results.py | stg-tud/python-crypto-misuses-study-results | be38da80990b699d26dfbd52ac85d5c790f079be | [
"CC-BY-4.0"
] | 1 | 2021-12-29T12:58:09.000Z | 2021-12-29T12:58:09.000Z | evaluations/evaluation-python-code/python/06_licma_analysis_results/evaluation_of_licma_results.py | stg-tud/python-crypto-misuses-study-results | be38da80990b699d26dfbd52ac85d5c790f079be | [
"CC-BY-4.0"
] | null | null | null | evaluations/evaluation-python-code/python/06_licma_analysis_results/evaluation_of_licma_results.py | stg-tud/python-crypto-misuses-study-results | be38da80990b699d26dfbd52ac85d5c790f079be | [
"CC-BY-4.0"
] | 1 | 2021-09-14T13:23:30.000Z | 2021-09-14T13:23:30.000Z | import csv
from collections import defaultdict
import re
line = "=================================================="
counter_lib_hit_total_wd = set()
counter_lib_hit_warning_wd = set()
counter_lib_hit_critical_wd = set()
counter_lib_rule_total_wd = defaultdict(int)
counter_lib_rule_warning_wd = defaultdict(int)
coun... | 46.4 | 228 | 0.653213 | import csv
from collections import defaultdict
import re
line = "=================================================="
counter_lib_hit_total_wd = set()
counter_lib_hit_warning_wd = set()
counter_lib_hit_critical_wd = set()
counter_lib_rule_total_wd = defaultdict(int)
counter_lib_rule_warning_wd = defaultdict(int)
coun... | true | true |
7903c9aa486e83599e115ccf91ffbb25e516c6fd | 5,488 | py | Python | plugins/otp/otp.py | hosom/jarvis | 2eadb3b2d07672af296e7e7c7fe2d6be9db9557f | [
"BSD-3-Clause"
] | 1 | 2018-03-08T20:39:51.000Z | 2018-03-08T20:39:51.000Z | plugins/otp/otp.py | hosom/jarvis | 2eadb3b2d07672af296e7e7c7fe2d6be9db9557f | [
"BSD-3-Clause"
] | null | null | null | plugins/otp/otp.py | hosom/jarvis | 2eadb3b2d07672af296e7e7c7fe2d6be9db9557f | [
"BSD-3-Clause"
] | 1 | 2018-11-02T01:53:52.000Z | 2018-11-02T01:53:52.000Z | import datetime
import threading
import contextlib
import pyotp
import qrcode
from errbot import BotPlugin, botcmd, arg_botcmd, cmdfilter
# OTP expires every hour
_OTP_EXPIRE = datetime.timedelta(hours=1)
_BASE_TIME = datetime.datetime(year=datetime.MINYEAR, month=1, day=1)
class otp(BotPlugin):
'''
... | 30.831461 | 92 | 0.676749 | import datetime
import threading
import contextlib
import pyotp
import qrcode
from errbot import BotPlugin, botcmd, arg_botcmd, cmdfilter
_OTP_EXPIRE = datetime.timedelta(hours=1)
_BASE_TIME = datetime.datetime(year=datetime.MINYEAR, month=1, day=1)
class otp(BotPlugin):
lock = threading.Lock()
... | true | true |
7903cb1355b2a599e9572c69f2232806e2320dac | 1,170 | py | Python | Murphi/ModularMurphi/GenModStateFunc.py | icsa-caps/HieraGen | 4026c1718878d2ef69dd13d3e6e10cab69174fda | [
"MIT"
] | 6 | 2020-07-07T15:45:13.000Z | 2021-08-29T06:44:29.000Z | Murphi/ModularMurphi/GenModStateFunc.py | icsa-caps/HieraGen | 4026c1718878d2ef69dd13d3e6e10cab69174fda | [
"MIT"
] | null | null | null | Murphi/ModularMurphi/GenModStateFunc.py | icsa-caps/HieraGen | 4026c1718878d2ef69dd13d3e6e10cab69174fda | [
"MIT"
] | null | null | null | from typing import List, Dict
from DataObjects.ClassCluster import Cluster
from Murphi.ModularMurphi.MurphiTokens import MurphiTokens
from Murphi.ModularMurphi.TemplateClass import TemplateHandler
from DataObjects.ClassMachine import Machine
class GenModStateFunc(MurphiTokens, TemplateHandler):
def __init__(se... | 39 | 104 | 0.660684 | from typing import List, Dict
from DataObjects.ClassCluster import Cluster
from Murphi.ModularMurphi.MurphiTokens import MurphiTokens
from Murphi.ModularMurphi.TemplateClass import TemplateHandler
from DataObjects.ClassMachine import Machine
class GenModStateFunc(MurphiTokens, TemplateHandler):
def __init__(se... | true | true |
7903cb2ed5f224ec5ea81319fd74bde714681376 | 3,322 | py | Python | server/main/urls.py | somtirtharoy/edd | b69c42d6d3f383347054f2df76d4e577642b2021 | [
"BSD-3-Clause-LBNL"
] | 13 | 2016-11-15T07:33:40.000Z | 2021-09-22T12:19:13.000Z | server/main/urls.py | somtirtharoy/edd | b69c42d6d3f383347054f2df76d4e577642b2021 | [
"BSD-3-Clause-LBNL"
] | 40 | 2017-04-04T15:20:14.000Z | 2022-03-31T04:34:37.000Z | server/main/urls.py | somtirtharoy/edd | b69c42d6d3f383347054f2df76d4e577642b2021 | [
"BSD-3-Clause-LBNL"
] | 10 | 2017-09-21T07:27:01.000Z | 2022-03-10T17:02:19.000Z | from django.contrib.auth.decorators import login_required
from django.urls import include, path
from . import views
app_name = "main"
# These are the URL endpoints nested under a link to a specific Study, for use with include() in
# the two URL paths for study below. Because this list is included twice, there sho... | 40.512195 | 96 | 0.614088 | from django.contrib.auth.decorators import login_required
from django.urls import include, path
from . import views
app_name = "main"
study_url_patterns = [
path("", login_required(views.StudyDetailView.as_view()), name="detail"),
path(
"overview/", login_required(views.StudyOverviewView.as_view(... | true | true |
7903cc60c6a57a64d4cb67b5b5352e148b0204f1 | 8,766 | py | Python | aiida/repository/backend/abstract.py | azadoks/aiida-core | b806b7fef8fc79090deccfe2019b77cb922e0581 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | aiida/repository/backend/abstract.py | azadoks/aiida-core | b806b7fef8fc79090deccfe2019b77cb922e0581 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | aiida/repository/backend/abstract.py | azadoks/aiida-core | b806b7fef8fc79090deccfe2019b77cb922e0581 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-12-27T17:34:52.000Z | 2019-12-27T17:34:52.000Z | # -*- coding: utf-8 -*-
"""Class that defines the abstract interface for an object repository.
The scope of this class is intentionally very narrow. Any backend implementation should merely provide the methods to
store binary blobs, or "objects", and return a string-based key that unique identifies the object that was... | 44.497462 | 120 | 0.682523 |
import abc
import contextlib
import hashlib
import io
import pathlib
from typing import BinaryIO, Iterable, Iterator, List, Optional, Tuple, Union
from aiida.common.hashing import chunked_file_hash
__all__ = ('AbstractRepositoryBackend',)
class AbstractRepositoryBackend(metaclass=abc.ABCMeta):
@property
@... | true | true |
7903ccfa871f29fa09227f2f965adb2e5fea3146 | 288 | py | Python | camel_space.py | brennanbrown/code-challenges | e7d0f9547ead58ee58f1365f5ea35743525a9a82 | [
"BSD-2-Clause"
] | 1 | 2021-06-14T07:36:41.000Z | 2021-06-14T07:36:41.000Z | camel_space.py | brennanbrown/code-challenges | e7d0f9547ead58ee58f1365f5ea35743525a9a82 | [
"BSD-2-Clause"
] | null | null | null | camel_space.py | brennanbrown/code-challenges | e7d0f9547ead58ee58f1365f5ea35743525a9a82 | [
"BSD-2-Clause"
] | null | null | null | import re
def camel_space(string):
string = re.sub(r'(?<!^)(?=[A-Z])', ' ', string)
return string
Test.assert_equals(solution("helloWorld"), "hello World")
Test.assert_equals(solution("camelCase"), "camel Case")
Test.assert_equals(solution("breakCamelCase"), "break Camel Case") | 32 | 66 | 0.697917 | import re
def camel_space(string):
string = re.sub(r'(?<!^)(?=[A-Z])', ' ', string)
return string
Test.assert_equals(solution("helloWorld"), "hello World")
Test.assert_equals(solution("camelCase"), "camel Case")
Test.assert_equals(solution("breakCamelCase"), "break Camel Case") | true | true |
7903cdf449b5f4a3d2dfbe161bb74bd3196fd594 | 686 | py | Python | cotk/scripts/import_local_resources.py | kepei1106/cotk | 29b25b9469468dfd6d2aba433c2b935831351de7 | [
"Apache-2.0"
] | null | null | null | cotk/scripts/import_local_resources.py | kepei1106/cotk | 29b25b9469468dfd6d2aba433c2b935831351de7 | [
"Apache-2.0"
] | null | null | null | cotk/scripts/import_local_resources.py | kepei1106/cotk | 29b25b9469468dfd6d2aba433c2b935831351de7 | [
"Apache-2.0"
] | 1 | 2019-03-21T05:34:24.000Z | 2019-03-21T05:34:24.000Z | '''
A command library help user upload their results to dashboard.
'''
#!/usr/bin/env python
import json
import argparse
from .._utils import file_utils
from . import main
def import_local_resources(args):
'''Entrance of importing local resources'''
parser = argparse.ArgumentParser(prog="cotk import", \
... | 34.3 | 82 | 0.749271 |
import json
import argparse
from .._utils import file_utils
from . import main
def import_local_resources(args):
parser = argparse.ArgumentParser(prog="cotk import", \
description="Import local resources")
parser.add_argument("file_id", type=str, help="Name of resource")
parser.add_argument("file_path",... | true | true |
7903ce3f4c7aaca57bba6a8d2056f05cd3727fde | 602 | py | Python | main/algoSitemap.py | algorithms-gad/algoBook | 6a4fb34ae0028feab97707843d9c8ebfeb7386cc | [
"Apache-2.0"
] | 5 | 2019-06-20T06:59:41.000Z | 2022-02-08T21:21:32.000Z | main/algoSitemap.py | algorithms-gad/algoBook | 6a4fb34ae0028feab97707843d9c8ebfeb7386cc | [
"Apache-2.0"
] | null | null | null | main/algoSitemap.py | algorithms-gad/algoBook | 6a4fb34ae0028feab97707843d9c8ebfeb7386cc | [
"Apache-2.0"
] | null | null | null | from django.contrib.sitemaps import Sitemap
from main.models import Algo, Code
class AlgoSitemap(Sitemap):
changefreq = "daily"
priority = 1
def items(self):
return Algo.objects.all()
def lastmod(self, obj):
return obj.created_at
def location(self, obj):
return "/" + obj.... | 20.066667 | 54 | 0.626246 | from django.contrib.sitemaps import Sitemap
from main.models import Algo, Code
class AlgoSitemap(Sitemap):
changefreq = "daily"
priority = 1
def items(self):
return Algo.objects.all()
def lastmod(self, obj):
return obj.created_at
def location(self, obj):
return "/" + obj.... | true | true |
7903cf83bf486a7b16e3a98be063096227b14f80 | 3,174 | py | Python | flask_kits/sms/__init__.py | by46/flask-kits | 51edfd426fcb8db326d3cc3d7a5b07830d555163 | [
"MIT"
] | 1 | 2018-05-22T16:27:58.000Z | 2018-05-22T16:27:58.000Z | flask_kits/sms/__init__.py | by46/flask-kits | 51edfd426fcb8db326d3cc3d7a5b07830d555163 | [
"MIT"
] | null | null | null | flask_kits/sms/__init__.py | by46/flask-kits | 51edfd426fcb8db326d3cc3d7a5b07830d555163 | [
"MIT"
] | null | null | null | # -:- coding:utf8 -:-
import base64
import hmac
import json
import sys
import time
import urllib
import uuid
from hashlib import sha1
import requests
from flask import current_app
from werkzeug.local import LocalProxy
DEFAULT_URL = 'https://sms.aliyuncs.com'
SMS = LocalProxy(lambda: current_app.exten... | 33.0625 | 114 | 0.600504 |
import base64
import hmac
import json
import sys
import time
import urllib
import uuid
from hashlib import sha1
import requests
from flask import current_app
from werkzeug.local import LocalProxy
DEFAULT_URL = 'https://sms.aliyuncs.com'
SMS = LocalProxy(lambda: current_app.extensions['kits_sms'])
... | false | true |
7903d1cc8c0485bc5d203c5d86fad6f1c5124ba0 | 6,528 | py | Python | pysnmp/EdgeSwitch-IPV6-TUNNEL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/EdgeSwitch-IPV6-TUNNEL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/EdgeSwitch-IPV6-TUNNEL-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 EdgeSwitch-IPV6-TUNNEL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EdgeSwitch-IPV6-TUNNEL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:56:15 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version ... | 123.169811 | 896 | 0.780331 |
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuild... | true | true |
7903d207889a055df85c2d7142d6f97f376cde22 | 6,715 | py | Python | src/dispatch/task/service.py | WouldYouKindly/dispatch | c3e8467fe36e0bd78f45a3d3292ea36384981468 | [
"Apache-2.0"
] | null | null | null | src/dispatch/task/service.py | WouldYouKindly/dispatch | c3e8467fe36e0bd78f45a3d3292ea36384981468 | [
"Apache-2.0"
] | null | null | null | src/dispatch/task/service.py | WouldYouKindly/dispatch | c3e8467fe36e0bd78f45a3d3292ea36384981468 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from typing import List, Optional
from sqlalchemy import or_
from dispatch.plugin import service as plugin_service
from dispatch.event import service as event_service
from dispatch.incident import flows as incident_flows
from dispatch.incident.flows import incident_service
fro... | 34.613402 | 108 | 0.656739 | from datetime import datetime, timedelta
from typing import List, Optional
from sqlalchemy import or_
from dispatch.plugin import service as plugin_service
from dispatch.event import service as event_service
from dispatch.incident import flows as incident_flows
from dispatch.incident.flows import incident_service
fro... | true | true |
7903d2e5a875e3db7b257dc024278b89822207f9 | 1,110 | py | Python | Section 5 - Programming Logic/Guess game v7 - while - data validation.py | gitjot/python-for-lccs | a8a4ae8847abbc33361f80183c06d57b20523382 | [
"CC0-1.0"
] | 10 | 2020-02-14T14:28:15.000Z | 2022-02-02T18:44:11.000Z | Section 5 - Programming Logic/Guess game v7 - while - data validation.py | gitjot/python-for-lccs | a8a4ae8847abbc33361f80183c06d57b20523382 | [
"CC0-1.0"
] | null | null | null | Section 5 - Programming Logic/Guess game v7 - while - data validation.py | gitjot/python-for-lccs | a8a4ae8847abbc33361f80183c06d57b20523382 | [
"CC0-1.0"
] | 8 | 2020-03-25T09:27:42.000Z | 2021-11-03T15:24:38.000Z |
# Date: May 2018
# Author: Joe English, PDST
# eMail: computerscience@pdst.ie
# Name: Guessing Game v7
# Purpose: A program to demonstrate data validation
# Description: This is the exact same as version 6 except the input is validated
# Guess Game v7 - while - go again? - data validation
import random
nu... | 25.227273 | 81 | 0.609009 |
import random
number = random.randint(1, 10)
keepGoing = True
while keepGoing:
guess = input("Enter a number between 1 and 10: ")
while not guess.isdigit():
guess = input("Enter a number between 1 and 10: ")
guess = int(guess)
if guess == number:
... | true | true |
7903d31164da5343c80ba220d6f56a5d7ca0b66f | 359 | py | Python | tests/test_otter.py | tadashi0713/circleci-demo-pytorch-api | bd699a44f2a1551d2661ce57f6268183109d7293 | [
"MIT"
] | 1 | 2022-03-29T02:48:51.000Z | 2022-03-29T02:48:51.000Z | tests/test_otter.py | tadashi0713/circleci-demo-pytorch-api | bd699a44f2a1551d2661ce57f6268183109d7293 | [
"MIT"
] | null | null | null | tests/test_otter.py | tadashi0713/circleci-demo-pytorch-api | bd699a44f2a1551d2661ce57f6268183109d7293 | [
"MIT"
] | null | null | null | from io import BytesIO
import pytest
from app import app
def test_otter():
with open('./images/otter.jpeg', 'rb') as img:
img_string = BytesIO(img.read())
response = app.test_client().post('/predict', data={'file': (img_string, 'otter.jpeg')},
content_type="multipart/form-data")
assert ... | 32.636364 | 90 | 0.657382 | from io import BytesIO
import pytest
from app import app
def test_otter():
with open('./images/otter.jpeg', 'rb') as img:
img_string = BytesIO(img.read())
response = app.test_client().post('/predict', data={'file': (img_string, 'otter.jpeg')},
content_type="multipart/form-data")
assert ... | true | true |
7903d3538ab24610fe9b15c3423ade1811aed996 | 8,207 | py | Python | ax/models/tests/test_torch_model_utils.py | trsvchn/Ax | 0b430641c6b33920757dd09ae4318ea487fb4136 | [
"MIT"
] | 1,803 | 2019-05-01T16:04:15.000Z | 2022-03-31T16:01:29.000Z | ax/models/tests/test_torch_model_utils.py | trsvchn/Ax | 0b430641c6b33920757dd09ae4318ea487fb4136 | [
"MIT"
] | 810 | 2019-05-01T07:17:47.000Z | 2022-03-31T23:58:46.000Z | ax/models/tests/test_torch_model_utils.py | trsvchn/Ax | 0b430641c6b33920757dd09ae4318ea487fb4136 | [
"MIT"
] | 220 | 2019-05-01T05:37:22.000Z | 2022-03-29T04:30:45.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from ax.exceptions.model import ModelError
from ax.models.torch.utils import (
_gen... | 46.367232 | 88 | 0.680151 |
import numpy as np
import torch
from ax.exceptions.model import ModelError
from ax.models.torch.utils import (
_generate_sobol_points,
is_noiseless,
normalize_indices,
subset_model,
tensor_callable_to_array_callable,
)
from ax.utils.common.testutils import TestCase
from botorch.models import H... | true | true |
7903d357942e987d78a3a6e95112c062d3570e3c | 382 | py | Python | setup.py | djf604/django-alexa | e40ef82e38b918670fec13e51c88e6913bc79bab | [
"MIT"
] | 1 | 2019-01-16T01:38:47.000Z | 2019-01-16T01:38:47.000Z | setup.py | djf604/django-alexa | e40ef82e38b918670fec13e51c88e6913bc79bab | [
"MIT"
] | null | null | null | setup.py | djf604/django-alexa | e40ef82e38b918670fec13e51c88e6913bc79bab | [
"MIT"
] | null | null | null | from setuptools import setup
from os import path
from sys import version_info
def open_file(fname):
return open(path.join(path.dirname(__file__), fname))
setup_requires = ['pbr']
setup(
license='MIT',
setup_requires=setup_requires,
pbr=True,
auto_version="PBR",
install_requires=open(path.joi... | 21.222222 | 93 | 0.727749 | from setuptools import setup
from os import path
from sys import version_info
def open_file(fname):
return open(path.join(path.dirname(__file__), fname))
setup_requires = ['pbr']
setup(
license='MIT',
setup_requires=setup_requires,
pbr=True,
auto_version="PBR",
install_requires=open(path.joi... | true | true |
7903d522171e2ea817d00017c65dacf4c45fc8c1 | 260 | py | Python | server_src/modules/handlers/ITM_Core.py | uwdata/termite-data-server | 1085571407c627bdbbd21c352e793fed65d09599 | [
"BSD-3-Clause"
] | 97 | 2015-01-17T09:41:57.000Z | 2022-03-15T11:39:03.000Z | server_src/modules/handlers/ITM_Core.py | afcarl/termite-data-server | 1085571407c627bdbbd21c352e793fed65d09599 | [
"BSD-3-Clause"
] | 12 | 2015-02-01T02:59:56.000Z | 2021-06-09T02:31:34.000Z | server_src/modules/handlers/ITM_Core.py | afcarl/termite-data-server | 1085571407c627bdbbd21c352e793fed65d09599 | [
"BSD-3-Clause"
] | 35 | 2015-01-25T04:48:37.000Z | 2021-01-29T20:32:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from handlers.Home_Core import Home_Core
class ITM_Core(Home_Core):
def __init__(self, request, response, itm_db):
super(ITM_Core, self).__init__(request, response)
self.itmDB = itm_db
self.db = itm_db.db
| 23.636364 | 51 | 0.723077 |
from handlers.Home_Core import Home_Core
class ITM_Core(Home_Core):
def __init__(self, request, response, itm_db):
super(ITM_Core, self).__init__(request, response)
self.itmDB = itm_db
self.db = itm_db.db
| true | true |
7903d59fc5bc3510f7505509ddac1494a90a9278 | 1,171 | py | Python | pi/button/button.py | kylemcdonald/bsp | e33c71f5924bef61a15e2b87230ac27b8f8261aa | [
"MIT"
] | 1 | 2021-02-01T18:57:31.000Z | 2021-02-01T18:57:31.000Z | pi/button/button.py | kylemcdonald/bsp | e33c71f5924bef61a15e2b87230ac27b8f8261aa | [
"MIT"
] | 2 | 2021-08-10T01:38:49.000Z | 2021-10-21T17:15:25.000Z | pi/button/button.py | kylemcdonald/bsp | e33c71f5924bef61a15e2b87230ac27b8f8261aa | [
"MIT"
] | 2 | 2021-02-04T19:21:09.000Z | 2022-01-19T08:45:33.000Z | #!/usr/bin/python3
import time
import datetime
from gpiozero import InputDevice, LED
import subprocess
import requests
# RPI enumeration is:
# pin 5 & 6 are used for the button (3 & ground)
# pin 7 & 9 are used for the LED (4 & ground)
button_pin = 3
led_pin = 4
button = InputDevice(button_pin, pull_up=True)
last_ac... | 25.456522 | 63 | 0.668659 |
import time
import datetime
from gpiozero import InputDevice, LED
import subprocess
import requests
button_pin = 3
led_pin = 4
button = InputDevice(button_pin, pull_up=True)
last_active = False
last_press = None
led = LED(led_pin)
led.on()
def button_hold(now, seconds):
if seconds > 3:
print('butto... | true | true |
7903d77c2ec02e149f42e2fa3afdfb22fecea4e9 | 2,652 | py | Python | var/spack/repos/builtin/packages/r-vgam/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-vgam/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-vgam/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RVgam(RPackage):
"""Vector Generalized Linear and Additive Models.
An impleme... | 58.933333 | 95 | 0.761312 |
from spack.package import *
class RVgam(RPackage):
cran = "VGAM"
version('1.1-6', sha256='446a61bac5dd4794e05d20c2f3901eec54afac52c6e23ce2787c5575170dd417')
version('1.1-5', sha256='30190b150f3e5478137d288a45f575b2654ad7c29254b0a1fe5c954ee010a1bb')
version('1.1-1', sha256='de192bd65a7e881872800... | true | true |
7903d8542166e8b1d4864abf4a34d51d2976d9e8 | 1,911 | py | Python | satsearch/main.py | lishrimp/sat-search | d81e4774a41990b73b55db4b1e05b21062dd957c | [
"MIT"
] | null | null | null | satsearch/main.py | lishrimp/sat-search | d81e4774a41990b73b55db4b1e05b21062dd957c | [
"MIT"
] | null | null | null | satsearch/main.py | lishrimp/sat-search | d81e4774a41990b73b55db4b1e05b21062dd957c | [
"MIT"
] | null | null | null | import os
import sys
import json
from .version import __version__
from satsearch import Search
from satstac import Items
from satsearch.parser import SatUtilsParser
import satsearch.config as config
def main(items=None, printmd=None, printcal=False, found=False,
save=None, download=None, requestor_pays=Fals... | 27.3 | 113 | 0.628467 | import os
import sys
import json
from .version import __version__
from satsearch import Search
from satstac import Items
from satsearch.parser import SatUtilsParser
import satsearch.config as config
def main(items=None, printmd=None, printcal=False, found=False,
save=None, download=None, requestor_pays=Fals... | true | true |
7903d86f9167b1a2db5b5df76fddc53ac94b1163 | 2,621 | py | Python | torchtext/datasets/amazonreviewpolarity.py | abhinavarora/text | 69f67f3a775f3d3c6f85cfaa4ac3819500b90696 | [
"BSD-3-Clause"
] | 1 | 2022-01-03T17:30:57.000Z | 2022-01-03T17:30:57.000Z | torchtext/datasets/amazonreviewpolarity.py | abhinavarora/text | 69f67f3a775f3d3c6f85cfaa4ac3819500b90696 | [
"BSD-3-Clause"
] | null | null | null | torchtext/datasets/amazonreviewpolarity.py | abhinavarora/text | 69f67f3a775f3d3c6f85cfaa4ac3819500b90696 | [
"BSD-3-Clause"
] | null | null | null | import os
from typing import Union, Tuple
from torchtext._internal.module_utils import is_module_available
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_create_dataset_directory,
)
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, GDriveReader, Iter... | 34.486842 | 119 | 0.720336 | import os
from typing import Union, Tuple
from torchtext._internal.module_utils import is_module_available
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_create_dataset_directory,
)
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, GDriveReader, Iter... | true | true |
7903db7f786e0b67215a9f80a621d24138b89d66 | 3,654 | py | Python | release/src-rt-6.x.4708/router/samba-3.5.8/source4/heimdal/lib/wind/gen-errorlist.py | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 4 | 2017-05-17T11:27:04.000Z | 2020-05-24T07:23:26.000Z | release/src-rt-6.x.4708/router/samba-3.5.8/source4/heimdal/lib/wind/gen-errorlist.py | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 1 | 2018-08-21T03:43:09.000Z | 2018-08-21T03:43:09.000Z | release/src-rt-6.x.4708/router/samba-3.5.8/source4/heimdal/lib/wind/gen-errorlist.py | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 5 | 2017-10-11T08:09:11.000Z | 2020-10-14T04:10:13.000Z | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id: gen-errorlist.py,v 1.1.1.1 2011/06/10 09:34:43 andrew Exp $
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or withou... | 30.198347 | 77 | 0.682813 |
import re
import string
import sys
import generate
import rfc3454
import rfc4518
import stringprep
if len(sys.argv) != 3:
print "usage: %s rfc3454.txt out-dir" % sys.argv[0]
sys.exit(1)
tables = rfc3454.read(sys.argv[1])
t2 = rfc4518.read()
for x in t2.iterkeys():
tab... | false | true |
7903dc1e9eef7d71c41cb8050cc9282a9a2001fe | 5,677 | py | Python | lib/oldlibcode/Utils/parser.py | kbasecollaborations/MotifFinderalgoMFMD | f1019ecca0d4b4a5d22a902d9a88d7ad45e5c1cb | [
"MIT"
] | 2 | 2019-07-19T04:33:45.000Z | 2019-07-20T05:53:28.000Z | lib/oldlibcode/Utils/parser.py | man4ish/MotifFinderalgoMFMD | f1019ecca0d4b4a5d22a902d9a88d7ad45e5c1cb | [
"MIT"
] | null | null | null | lib/oldlibcode/Utils/parser.py | man4ish/MotifFinderalgoMFMD | f1019ecca0d4b4a5d22a902d9a88d7ad45e5c1cb | [
"MIT"
] | 1 | 2021-03-13T15:13:28.000Z | 2021-03-13T15:13:28.000Z | import sys
import os
import json
import re
import numpy as np
import pandas as pd
from ... | 35.93038 | 199 | 0.42223 | import sys
import os
import json
import re
import numpy as np
import pandas as pd
from ... | true | true |
7903dc5a753e7ee581edb2da4a0070a95ba83b12 | 4,185 | py | Python | userbot/plugins/carbonRGB (2).py | Fregiant16/fregiantuserbot | 6cb23022a1dfa66551c5ded1928d9fded16e0684 | [
"MIT"
] | 1 | 2020-04-14T15:19:47.000Z | 2020-04-14T15:19:47.000Z | userbot/plugins/carbonRGB (2).py | Fregiant16/fregiantuserbot | 6cb23022a1dfa66551c5ded1928d9fded16e0684 | [
"MIT"
] | null | null | null | userbot/plugins/carbonRGB (2).py | Fregiant16/fregiantuserbot | 6cb23022a1dfa66551c5ded1928d9fded16e0684 | [
"MIT"
] | 2 | 2020-12-01T02:27:27.000Z | 2022-02-16T08:32:11.000Z | """Carbon Scraper Plugin for Userbot. //text in creative way.
usage: .karb //as a reply to any text message
Thanks to @r4v4n4 for vars,,, Random RGB feature by @PhycoNinja13b"""
from selenium.webdriver.support.ui import Select
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
fr... | 20.615764 | 235 | 0.590203 |
from selenium.webdriver.support.ui import Select
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from telethon import events
from urllib.parse import quote_plus
from urllib.error import HTTPError
from time import sleep
import asyncio
import os
import random
from userbot.u... | true | true |
7903decd15439d23e92ffb110feae9237124ae6a | 329 | py | Python | models/model_NN.py | daniloorozco/ufc-predictions | 0dbf91936587bc9acfea15151ab6845c77483124 | [
"Apache-2.0"
] | null | null | null | models/model_NN.py | daniloorozco/ufc-predictions | 0dbf91936587bc9acfea15151ab6845c77483124 | [
"Apache-2.0"
] | null | null | null | models/model_NN.py | daniloorozco/ufc-predictions | 0dbf91936587bc9acfea15151ab6845c77483124 | [
"Apache-2.0"
] | null | null | null | #Neural Networks
#MLP classifier is optimal algorithm for classifications
from sklearn.neural_network import MLPClassifier
clf = MLPClassifier(solver='lbfgs', alpha=1e-5, hidden_layer_sizes=(5, 2), random_state=1)
clf.fit(X_train_clean, y_train)
clf.predict(X_test_clean)
scoreN = clf.score(X_test_clean, y_test)
prin... | 29.909091 | 90 | 0.808511 |
from sklearn.neural_network import MLPClassifier
clf = MLPClassifier(solver='lbfgs', alpha=1e-5, hidden_layer_sizes=(5, 2), random_state=1)
clf.fit(X_train_clean, y_train)
clf.predict(X_test_clean)
scoreN = clf.score(X_test_clean, y_test)
print(scoreN) | true | true |
7903df2ce15833bf9882d5da630640c63ef493b1 | 702 | py | Python | RLBotPack/BotimusPrime/maneuvers/strikes/aerial_shot.py | RLMarvin/RLBotPack | c88c4111bf67d324b471ad87ad962e7bc8c2a202 | [
"MIT"
] | null | null | null | RLBotPack/BotimusPrime/maneuvers/strikes/aerial_shot.py | RLMarvin/RLBotPack | c88c4111bf67d324b471ad87ad962e7bc8c2a202 | [
"MIT"
] | null | null | null | RLBotPack/BotimusPrime/maneuvers/strikes/aerial_shot.py | RLMarvin/RLBotPack | c88c4111bf67d324b471ad87ad962e7bc8c2a202 | [
"MIT"
] | null | null | null | from maneuvers.kit import *
from maneuvers.strikes.aerial_strike import AerialStrike
class AerialShot(AerialStrike):
def intercept_predicate(self, car: Car, ball: Ball):
return ball.position[2] > 500
def configure(self, intercept: AerialIntercept):
ball = intercept.ball
... | 35.1 | 77 | 0.682336 | from maneuvers.kit import *
from maneuvers.strikes.aerial_strike import AerialStrike
class AerialShot(AerialStrike):
def intercept_predicate(self, car: Car, ball: Ball):
return ball.position[2] > 500
def configure(self, intercept: AerialIntercept):
ball = intercept.ball
... | true | true |
7903dfbb5a2487eacc59276f7318af20b665ff86 | 4,824 | py | Python | tools/perf/benchmarks/dromaeo.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | tools/perf/benchmarks/dromaeo.py | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | tools/perf/benchmarks/dromaeo.py | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from metrics import power
from telemetry import test
from telemetry.core import util
from telemetry.page import page_measurement
from telemetr... | 31.122581 | 74 | 0.732172 |
import os
from metrics import power
from telemetry import test
from telemetry.core import util
from telemetry.page import page_measurement
from telemetry.page import page_set
class _DromaeoMeasurement(page_measurement.PageMeasurement):
def __init__(self):
super(_DromaeoMeasurement, self).__init__()
sel... | false | true |
7903dff9bf2d0705e4e789c3b4cd1f9a8ae62555 | 642 | py | Python | data/config/color.py | ajbowler/mlb-led-scoreboard | f6678649253f5491ccdbcd4703372a0ab739f1de | [
"MIT"
] | 35 | 2018-01-28T02:40:08.000Z | 2018-02-26T21:09:48.000Z | data/config/color.py | ajbowler/mlb-led-scoreboard | f6678649253f5491ccdbcd4703372a0ab739f1de | [
"MIT"
] | 53 | 2018-01-28T15:01:32.000Z | 2018-02-26T22:22:51.000Z | data/config/color.py | ajbowler/mlb-led-scoreboard | f6678649253f5491ccdbcd4703372a0ab739f1de | [
"MIT"
] | 10 | 2018-01-28T18:35:29.000Z | 2018-02-20T11:53:07.000Z | try:
from rgbmatrix import graphics
except ImportError:
from RGBMatrixEmulator import graphics
class Color:
def __init__(self, color_json):
self.json = color_json
def color(self, keypath):
return self.__find_at_keypath(keypath)
def graphics_color(self, keypath):
color = s... | 24.692308 | 65 | 0.61215 | try:
from rgbmatrix import graphics
except ImportError:
from RGBMatrixEmulator import graphics
class Color:
def __init__(self, color_json):
self.json = color_json
def color(self, keypath):
return self.__find_at_keypath(keypath)
def graphics_color(self, keypath):
color = s... | true | true |
7903e09bc5c002e243a2a7cb960564378bb4e47c | 14,107 | py | Python | RESSPyLab/uvc_model.py | ioannis-vm/RESSPyLab | 306fc24d5f8ece8f2f2de274b56b80ba2019f605 | [
"MIT"
] | 7 | 2019-10-15T09:16:41.000Z | 2021-09-24T11:28:45.000Z | RESSPyLab/uvc_model.py | ioannis-vm/RESSPyLab | 306fc24d5f8ece8f2f2de274b56b80ba2019f605 | [
"MIT"
] | 3 | 2020-10-22T14:27:22.000Z | 2021-11-15T17:46:49.000Z | RESSPyLab/uvc_model.py | ioannis-vm/RESSPyLab | 306fc24d5f8ece8f2f2de274b56b80ba2019f605 | [
"MIT"
] | 6 | 2019-07-22T05:47:10.000Z | 2021-10-24T02:06:26.000Z | """@package vc_updated
Functions to implement the updated Voce-Chaboche material model and measure its error.
"""
import numpy as np
import pandas as pd
from numdifftools import nd_algopy as nda
def uvc_return_mapping(x_sol, data, tol=1.0e-8, maximum_iterations=1000):
""" Implements the time integration of the up... | 38.755495 | 119 | 0.641455 | import numpy as np
import pandas as pd
from numdifftools import nd_algopy as nda
def uvc_return_mapping(x_sol, data, tol=1.0e-8, maximum_iterations=1000):
if len(x_sol) < 8:
raise RuntimeError("No backstresses or using original V-C params.")
n_param_per_back = 2
n_basic_param = 6
E = x_... | true | true |
7903e11ab9fec1633c9080aadf7a929866e2d98e | 1,667 | py | Python | Models/Encoders/ID_Encoder.py | YuGong123/ID-disentanglement-Pytorch | 1b110f653a1945ea498b21cd6ed7d7e4fee0f74b | [
"MIT"
] | 45 | 2021-03-24T09:18:46.000Z | 2022-03-15T16:45:13.000Z | Models/Encoders/ID_Encoder.py | YuGong123/ID-disentanglement-Pytorch | 1b110f653a1945ea498b21cd6ed7d7e4fee0f74b | [
"MIT"
] | 1 | 2022-01-17T14:10:35.000Z | 2022-01-17T14:10:35.000Z | Models/Encoders/ID_Encoder.py | YuGong123/ID-disentanglement-Pytorch | 1b110f653a1945ea498b21cd6ed7d7e4fee0f74b | [
"MIT"
] | 9 | 2021-03-31T08:11:38.000Z | 2022-01-15T10:07:48.000Z | import torch
from facenet_pytorch import MTCNN, InceptionResnetV1
from torchvision import transforms
from Configs import Global_Config
IMAGE_SIZE = 220
mtcnn = MTCNN(
image_size=IMAGE_SIZE, margin=0, min_face_size=20,
thresholds=[0.6, 0.7, 0.7], factor=0.709, post_process=True,
device=Global_Config.device
... | 38.767442 | 102 | 0.673065 | import torch
from facenet_pytorch import MTCNN, InceptionResnetV1
from torchvision import transforms
from Configs import Global_Config
IMAGE_SIZE = 220
mtcnn = MTCNN(
image_size=IMAGE_SIZE, margin=0, min_face_size=20,
thresholds=[0.6, 0.7, 0.7], factor=0.709, post_process=True,
device=Global_Config.device
... | true | true |
7903e1b04695df81077c2c0893327902d34a6f6f | 5,010 | py | Python | TD/double_q_learning.py | hadleyhzy34/reinforcement_learning | 14371756c2ff8225dc800d146452b7956875410c | [
"MIT"
] | null | null | null | TD/double_q_learning.py | hadleyhzy34/reinforcement_learning | 14371756c2ff8225dc800d146452b7956875410c | [
"MIT"
] | null | null | null | TD/double_q_learning.py | hadleyhzy34/reinforcement_learning | 14371756c2ff8225dc800d146452b7956875410c | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import gym
import random
# hyper parameters
# test 1
# alpha = 0.5
# gamma = 0.95
# epsilon = 0.1
epsilon = 0.1
alpha = 0.1
gamma = 0.1
def update_sarsa_table(sarsa, state, action, reward, next_state, next_action, alpha, gamma):
'''
update sarsa state-action... | 31.910828 | 122 | 0.645709 | import numpy as np
import matplotlib.pyplot as plt
import gym
import random
epsilon = 0.1
alpha = 0.1
gamma = 0.1
def update_sarsa_table(sarsa, state, action, reward, next_state, next_action, alpha, gamma):
next_max = sarsa[next_state,next_action]
sarsa[state,action] = sarsa[state,action] + alpha... | true | true |
7903e3ec3e23fe818c6c939e0dc1de03ae3eef94 | 1,727 | py | Python | tasks.py | brainfukk/fiuread | 7414ec9f580b8bdc78e3ce63bb6ebf1ac7cdc4f8 | [
"Apache-2.0"
] | null | null | null | tasks.py | brainfukk/fiuread | 7414ec9f580b8bdc78e3ce63bb6ebf1ac7cdc4f8 | [
"Apache-2.0"
] | null | null | null | tasks.py | brainfukk/fiuread | 7414ec9f580b8bdc78e3ce63bb6ebf1ac7cdc4f8 | [
"Apache-2.0"
] | null | null | null | import invoke
from pathlib import Path
PACKAGE = "src"
REQUIRED_COVERAGE = 90
BASE_DIR = Path(__file__).resolve().parent
@invoke.task(name="format")
def format_(arg):
autoflake = "autoflake -i --recursive --remove-all-unused-imports --remove-duplicate-keys --remove-unused-variables"
arg.run(f"{autoflake} {... | 26.569231 | 120 | 0.62652 | import invoke
from pathlib import Path
PACKAGE = "src"
REQUIRED_COVERAGE = 90
BASE_DIR = Path(__file__).resolve().parent
@invoke.task(name="format")
def format_(arg):
autoflake = "autoflake -i --recursive --remove-all-unused-imports --remove-duplicate-keys --remove-unused-variables"
arg.run(f"{autoflake} {... | true | true |
7903e5d7ac19c9a0922ba869ee3c7668486d2480 | 2,507 | py | Python | django-vue/djangoAPI/api/urls.py | BeautifulBeer/Youflix | 751dcf257ce36b7ac597eaabcf4e67ab237f1eff | [
"Apache-2.0"
] | 3 | 2021-09-05T14:25:29.000Z | 2021-12-13T05:06:24.000Z | django-vue/djangoAPI/api/urls.py | BeautifulBeer/Youflix | 751dcf257ce36b7ac597eaabcf4e67ab237f1eff | [
"Apache-2.0"
] | 11 | 2020-06-06T00:51:00.000Z | 2022-02-26T20:43:16.000Z | django-vue/djangoAPI/api/urls.py | BeautifulBeer/Youflix | 751dcf257ce36b7ac597eaabcf4e67ab237f1eff | [
"Apache-2.0"
] | 3 | 2019-11-28T03:19:42.000Z | 2019-12-04T06:22:33.000Z | from django.conf.urls import url
from api.views import movie_views
from api.views import auth_views
from api.views import rating_views
from api.views import recommend_views
from api.views import collabo_test
from api.views import content_based
from api.algorithms import kmeansClustering
urlpatterns = [
# user 접근 U... | 49.156863 | 102 | 0.735142 | from django.conf.urls import url
from api.views import movie_views
from api.views import auth_views
from api.views import rating_views
from api.views import recommend_views
from api.views import collabo_test
from api.views import content_based
from api.algorithms import kmeansClustering
urlpatterns = [
url(r'... | true | true |
7903e5fc5527bf8e7e55c056bd8cef87c1bc7e04 | 6,476 | py | Python | plugins/modules/oci_network_ip_sec_connection_device_status_facts.py | A7rMtWE57x/oci-ansible-collection | 80548243a085cd53fd5dddaa8135b5cb43612c66 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_ip_sec_connection_device_status_facts.py | A7rMtWE57x/oci-ansible-collection | 80548243a085cd53fd5dddaa8135b5cb43612c66 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_ip_sec_connection_device_status_facts.py | A7rMtWE57x/oci-ansible-collection | 80548243a085cd53fd5dddaa8135b5cb43612c66 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017, 2020 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 33.905759 | 150 | 0.637431 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_network_ip_sec_connection_device_status_facts
short_description: Fetches... | true | true |
7903e63cced7635c71fde7de7353f2137a297424 | 1,516 | py | Python | tests/benchmark/milvus_benchmark/metrics/models/metric.py | NotRyan/milvus | 1bd3205dbf84ee7734e9849d1e3be30ded1aa619 | [
"Apache-2.0"
] | null | null | null | tests/benchmark/milvus_benchmark/metrics/models/metric.py | NotRyan/milvus | 1bd3205dbf84ee7734e9849d1e3be30ded1aa619 | [
"Apache-2.0"
] | null | null | null | tests/benchmark/milvus_benchmark/metrics/models/metric.py | NotRyan/milvus | 1bd3205dbf84ee7734e9849d1e3be30ded1aa619 | [
"Apache-2.0"
] | null | null | null | import time
import datetime
import json
import hashlib
from .env import Env
from .server import Server
from .hardware import Hardware
class Metric(object):
def __init__(self):
# format of report data
self._version = '0.1'
self._type = 'metric'
self.run_id = None
self.mode =... | 27.071429 | 73 | 0.600923 | import time
import datetime
import json
import hashlib
from .env import Env
from .server import Server
from .hardware import Hardware
class Metric(object):
def __init__(self):
self._version = '0.1'
self._type = 'metric'
self.run_id = None
self.mode = None
self.serv... | true | true |
7903e67a14415b573a7cb2ac7c96a447d8fc00f9 | 6,757 | py | Python | example/gluon/tree_lstm/main.py | viper7882/mxnet_win32 | 8b05c0cf83026147efd70a21abb3ac25ca6099f1 | [
"Apache-2.0"
] | 7 | 2017-08-04T07:10:22.000Z | 2020-07-02T13:01:28.000Z | example/gluon/tree_lstm/main.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | null | null | null | example/gluon/tree_lstm/main.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 11 | 2018-02-27T15:32:09.000Z | 2021-04-21T08:48:17.000Z | # This example is inspired by https://github.com/dasguptar/treelstm.pytorch
import argparse, cPickle, math, os, random
import logging
logging.basicConfig(level=logging.INFO)
import numpy as np
from tqdm import tqdm
import mxnet as mx
from mxnet import gluon
from mxnet.gluon import nn
from mxnet import autograd as ag
... | 39.284884 | 112 | 0.636969 |
import argparse, cPickle, math, os, random
import logging
logging.basicConfig(level=logging.INFO)
import numpy as np
from tqdm import tqdm
import mxnet as mx
from mxnet import gluon
from mxnet.gluon import nn
from mxnet import autograd as ag
from tree_lstm import SimilarityTreeLSTM
from dataset import Vocab, SICKDat... | true | true |
7903e7a52cbd85ee4be424abff335c43fb6de6c5 | 2,657 | py | Python | tensorflow_probability/python/internal/test_combinations_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 3,670 | 2018-02-14T03:29:40.000Z | 2022-03-30T01:19:52.000Z | tensorflow_probability/python/internal/test_combinations_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,395 | 2018-02-24T02:28:49.000Z | 2022-03-31T16:12:06.000Z | tensorflow_probability/python/internal/test_combinations_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,135 | 2018-02-14T01:51:10.000Z | 2022-03-28T02:24:11.000Z | # Copyright 2019 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 26.838384 | 80 | 0.579601 |
from collections import OrderedDict
from tensorflow_probability.python.internal import test_combinations
from tensorflow_probability.python.internal import test_util
class TestingCombinationsTest(test_util.TestCase):
def test_combine(self):
self.assertEqual([{
"a": 1,
"b": 2
... | true | true |
7903e7f157b9f443705e4011e434c2ed6a5dbe99 | 2,685 | py | Python | DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 2 | 2020-01-27T15:21:37.000Z | 2020-05-11T11:13:18.000Z | DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 8 | 2020-03-20T23:18:36.000Z | 2020-05-27T11:00:06.000Z | DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2019-03-09T13:06:43.000Z | 2020-07-03T00:47:30.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("DQM")
# message logger
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('cout'),
cout = cms.untracked.PSet(threshold = cms.untracked.string('... | 39.485294 | 106 | 0.664804 | import FWCore.ParameterSet.Config as cms
process = cms.Process("DQM")
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('cout'),
cout = cms.untracked.PSet(threshold = cms.untracked.string('WARNING'))
... | true | true |
7903e806d922d6b01e49d831aa4186dddf3a4e15 | 132,055 | py | Python | netpyne/metadata/metadata.py | naiduv/netpyne | 6ecfe1b7223d3e40615274bfec9d53e7d03b534a | [
"MIT"
] | 1 | 2021-04-21T16:48:17.000Z | 2021-04-21T16:48:17.000Z | netpyne/metadata/metadata.py | bikramkhastgir/netpyne | 20d2dfdecf303c779d6ab97e6ef579835798beb1 | [
"MIT"
] | 1 | 2021-05-04T00:42:12.000Z | 2021-05-04T00:42:12.000Z | netpyne/metadata/metadata.py | bikramkhastgir/netpyne | 20d2dfdecf303c779d6ab97e6ef579835798beb1 | [
"MIT"
] | null | null | null | """
Module containing NetPyNE metadata
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
metadata = {
# ---------------------------------------... | 53.659082 | 467 | 0.323153 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
metadata = {
"netParams": {
"label": "Network Parameters",
"suggestions": "... | true | true |
7903e85f0a981e9fe819f9e5b2d7c9a01b6174c5 | 6,314 | py | Python | rdmo/projects/views/project_create.py | cbittner/rdmo | 1d6885ad2a69f6d24c9fca6446536e0c06de5486 | [
"Apache-2.0"
] | null | null | null | rdmo/projects/views/project_create.py | cbittner/rdmo | 1d6885ad2a69f6d24c9fca6446536e0c06de5486 | [
"Apache-2.0"
] | null | null | null | rdmo/projects/views/project_create.py | cbittner/rdmo | 1d6885ad2a69f6d24c9fca6446536e0c06de5486 | [
"Apache-2.0"
] | null | null | null | import logging
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ValidationError
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse_lazy
from django.utils... | 39.217391 | 103 | 0.625436 | import logging
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ValidationError
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse_lazy
from django.utils... | true | true |
7903ea7c18d842ba9d8b382e763d6d9a217b2eab | 1,604 | py | Python | rootcp/models.py | EugeneNdiaye/rootCP | a9777d0f4871dbd1bc0afd680889c0a3e73ec7d0 | [
"BSD-3-Clause"
] | 1 | 2022-01-08T15:30:25.000Z | 2022-01-08T15:30:25.000Z | rootcp/models.py | EugeneNdiaye/rootCP | a9777d0f4871dbd1bc0afd680889c0a3e73ec7d0 | [
"BSD-3-Clause"
] | null | null | null | rootcp/models.py | EugeneNdiaye/rootCP | a9777d0f4871dbd1bc0afd680889c0a3e73ec7d0 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
class ridge:
""" Ridge estimator.
"""
def __init__(self, lmd=0.1):
self.lmd = lmd
self.hat = None
self.hatn = None
def fit(self, X, y):
if self.hat is None:
G = X.T.dot(X) + self.lmd * np.eye(X.shape[1])
self.hat = np.linal... | 20.831169 | 59 | 0.483791 | import numpy as np
class ridge:
def __init__(self, lmd=0.1):
self.lmd = lmd
self.hat = None
self.hatn = None
def fit(self, X, y):
if self.hat is None:
G = X.T.dot(X) + self.lmd * np.eye(X.shape[1])
self.hat = np.linalg.solve(G, X.T)
if self.... | true | true |
7903eb73c3f6b1512edfad4b6b076a4433ccc540 | 347 | py | Python | pools/eventlet.py | JohnStarich/python-pool-performance | 5a8428ca95240932e0b1b0d7064bf8020e0b1f2e | [
"MIT"
] | 32 | 2016-08-05T20:54:57.000Z | 2021-11-16T19:28:12.000Z | pools/eventlet.py | ktosiu/python-pool-performance | 5a8428ca95240932e0b1b0d7064bf8020e0b1f2e | [
"MIT"
] | 1 | 2018-10-26T10:43:16.000Z | 2018-10-31T07:37:20.000Z | pools/eventlet.py | ktosiu/python-pool-performance | 5a8428ca95240932e0b1b0d7064bf8020e0b1f2e | [
"MIT"
] | 7 | 2017-03-18T21:27:53.000Z | 2022-02-11T01:40:48.000Z | from pools import PoolTest
import eventlet
class EventletPool(PoolTest):
def init_pool(self, worker_count):
return eventlet.GreenPool(worker_count)
def map(self, work_func, inputs):
return self.pool.imap(work_func, inputs)
def init_network_resource(self):
return eventlet.import_p... | 24.785714 | 58 | 0.731988 | from pools import PoolTest
import eventlet
class EventletPool(PoolTest):
def init_pool(self, worker_count):
return eventlet.GreenPool(worker_count)
def map(self, work_func, inputs):
return self.pool.imap(work_func, inputs)
def init_network_resource(self):
return eventlet.import_p... | true | true |
7903ec9c043049b9e677a2917e22d25071fe1f34 | 3,227 | py | Python | tracportalopt/project/notification.py | isabella232/TracPortalPlugin | 985581b16aad360cfc78d6b901c93fb922f7bc30 | [
"MIT"
] | 2 | 2015-01-19T05:53:30.000Z | 2016-01-08T10:30:02.000Z | tracportalopt/project/notification.py | iij/TracPortalPlugin | 985581b16aad360cfc78d6b901c93fb922f7bc30 | [
"MIT"
] | 1 | 2022-01-20T12:47:18.000Z | 2022-01-20T12:47:18.000Z | tracportalopt/project/notification.py | isabella232/TracPortalPlugin | 985581b16aad360cfc78d6b901c93fb922f7bc30 | [
"MIT"
] | 3 | 2016-12-08T02:25:36.000Z | 2022-01-20T12:10:58.000Z | #! -*- coding: utf-8 -*-
#
# (C) 2013 Internet Initiative Japan Inc.
# All rights reserved.
#
# Created on 2013/05/15
# @author: yosinobu@iij.ad.jp
"""Notify project owner with email when the project created successfully."""
from pkg_resources import resource_filename
from trac.config import Option, ListOption
from tra... | 37.523256 | 115 | 0.654478 |
from pkg_resources import resource_filename
from trac.config import Option, ListOption
from trac.core import Component, implements
from trac.notification import Notify, NotifyEmail
from trac.web.chrome import ITemplateProvider
from tracportal.i18n import _
from tracportal.project.api import IProjectCreationInte... | true | true |
7903edee44cb421c689de087d74c9b211ef7a7d7 | 1,022 | py | Python | pdip/configuration/services/config_service.py | ahmetcagriakca/pdip | c4c16d5666a740154cabdc6762cd44d98b7bdde8 | [
"MIT"
] | 2 | 2021-12-09T21:07:46.000Z | 2021-12-11T22:18:01.000Z | pdip/configuration/services/config_service.py | PythonDataIntegrator/pdip | c4c16d5666a740154cabdc6762cd44d98b7bdde8 | [
"MIT"
] | null | null | null | pdip/configuration/services/config_service.py | PythonDataIntegrator/pdip | c4c16d5666a740154cabdc6762cd44d98b7bdde8 | [
"MIT"
] | 3 | 2021-11-15T00:47:00.000Z | 2021-12-17T11:35:45.000Z | from functools import lru_cache
from injector import inject
from .config_parameter_base import ConfigParameterBase
from ...data.repository import RepositoryProvider
from ...dependency import IScoped
from ...exceptions import RequiredClassException
class ConfigService(IScoped):
@inject
def __init__(self,
... | 34.066667 | 98 | 0.715264 | from functools import lru_cache
from injector import inject
from .config_parameter_base import ConfigParameterBase
from ...data.repository import RepositoryProvider
from ...dependency import IScoped
from ...exceptions import RequiredClassException
class ConfigService(IScoped):
@inject
def __init__(self,
... | true | true |
7903ee13b1c151cbfba658ffd4ecad5f8b2eb45f | 13,689 | py | Python | ably/rest/auth.py | jvinet/ably-python | 0d75a7af347bf7c1a8d73739f58fa41ed4eaae23 | [
"Apache-2.0"
] | 22 | 2015-04-29T13:33:46.000Z | 2022-01-10T17:51:10.000Z | ably/rest/auth.py | jvinet/ably-python | 0d75a7af347bf7c1a8d73739f58fa41ed4eaae23 | [
"Apache-2.0"
] | 193 | 2015-04-07T22:47:17.000Z | 2022-03-28T14:52:56.000Z | ably/rest/auth.py | jvinet/ably-python | 0d75a7af347bf7c1a8d73739f58fa41ed4eaae23 | [
"Apache-2.0"
] | 21 | 2015-04-14T13:26:31.000Z | 2021-10-02T15:30:54.000Z | import base64
from datetime import timedelta
import logging
import time
import uuid
import warnings
import httpx
from ably.types.capability import Capability
from ably.types.tokendetails import TokenDetails
from ably.types.tokenrequest import TokenRequest
from ably.util.exceptions import AblyException, IncompatibleCli... | 38.025 | 106 | 0.633867 | import base64
from datetime import timedelta
import logging
import time
import uuid
import warnings
import httpx
from ably.types.capability import Capability
from ably.types.tokendetails import TokenDetails
from ably.types.tokenrequest import TokenRequest
from ably.util.exceptions import AblyException, IncompatibleCli... | true | true |
7903ee1aea86984f986bb719451fe4c7292c3a42 | 407 | py | Python | tests/tests_instance.py | Antash696/VRP | 386b84adbe34be37aabc1e638515ce722849a952 | [
"MIT"
] | 33 | 2017-10-18T01:18:27.000Z | 2021-10-04T14:17:52.000Z | tests/tests_instance.py | dj-boy/VRP | 386b84adbe34be37aabc1e638515ce722849a952 | [
"MIT"
] | 1 | 2020-12-21T01:59:21.000Z | 2020-12-21T01:59:21.000Z | tests/tests_instance.py | dj-boy/VRP | 386b84adbe34be37aabc1e638515ce722849a952 | [
"MIT"
] | 19 | 2017-06-26T15:02:00.000Z | 2022-03-31T08:44:20.000Z | import unittest
from code import instance as i
from code import datamapping as dm
class TestProblemInstance(unittest.TestCase):
def setUp(self):
raw_data = dm.Importer()
raw_data.import_data("./tests/cvrp1.test")
data = dm.DataMapper(raw_data)
self.problem = i.ProblemInstance(dat... | 19.380952 | 50 | 0.668305 | import unittest
from code import instance as i
from code import datamapping as dm
class TestProblemInstance(unittest.TestCase):
def setUp(self):
raw_data = dm.Importer()
raw_data.import_data("./tests/cvrp1.test")
data = dm.DataMapper(raw_data)
self.problem = i.ProblemInstance(dat... | true | true |
7903eef5a8bc5a4a589813ab0d1164bef047564a | 1,037 | py | Python | py_lex.py | Spico197/PythonCompilerPrinciplesExp | cb06dd7ee50ed7755c18b0684c8b7aa169396e3d | [
"MIT"
] | 3 | 2020-12-05T07:39:44.000Z | 2021-12-06T05:58:49.000Z | py_lex.py | Spico197/PythonCompilerPrinciplesExp | cb06dd7ee50ed7755c18b0684c8b7aa169396e3d | [
"MIT"
] | null | null | null | py_lex.py | Spico197/PythonCompilerPrinciplesExp | cb06dd7ee50ed7755c18b0684c8b7aa169396e3d | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#coding=utf-8
import ply.lex as lex
# LEX for parsing Python
# Tokens
tokens=('VARIABLE','NUMBER', 'IF', 'ELIF', 'ELSE', 'WHILE', 'FOR', 'PRINT', 'INC', 'LEN', 'GDIV', 'BREAK', 'LET')
literals=['=','+','-','*','(',')','{','}','<','>', ';', ',', '[', ']']
#Define of tokens
def t... | 14.013514 | 114 | 0.479267 |
import ply.lex as lex
tokens=('VARIABLE','NUMBER', 'IF', 'ELIF', 'ELSE', 'WHILE', 'FOR', 'PRINT', 'INC', 'LEN', 'GDIV', 'BREAK', 'LET')
literals=['=','+','-','*','(',')','{','}','<','>', ';', ',', '[', ']']
def t_NUMBER(t):
return t
def t_PRINT(t):
return t
def t_IF(t):
return t
... | true | true |
7903ef0ebf9c38b92d82860265860d491077bbd5 | 783 | py | Python | ADT/aclhistory-edit.py | UKHomeOffice/dq-ssm_ingest | 35aafd637e6d7e75e1d558d275b7d0518bfc6c47 | [
"MIT"
] | 1 | 2018-02-14T10:15:34.000Z | 2018-02-14T10:15:34.000Z | ADT/aclhistory-edit.py | UKHomeOffice/dq-ssm_ingest | 35aafd637e6d7e75e1d558d275b7d0518bfc6c47 | [
"MIT"
] | 2 | 2018-07-17T07:01:43.000Z | 2018-11-22T16:33:33.000Z | ADT/aclhistory-edit.py | UKHomeOffice/dq-ssm_ingest | 35aafd637e6d7e75e1d558d275b7d0518bfc6c47 | [
"MIT"
] | 2 | 2018-02-15T11:48:58.000Z | 2021-04-11T09:24:21.000Z | #!/usr/bin/python
import gdbm
import sys
import os
db_filename = "aclhistory.db"
example_filename = "HOMEOFFICEROLL3_20180521.CSV"
example_status = "D"
if len(sys.argv) != 3:
scriptname = os.path.basename(str(sys.argv[0]))
print "usage:", scriptname, "<FILENAME>", "<STATUS>"
print "\t Pass in the filename and sta... | 27 | 90 | 0.702427 |
import gdbm
import sys
import os
db_filename = "aclhistory.db"
example_filename = "HOMEOFFICEROLL3_20180521.CSV"
example_status = "D"
if len(sys.argv) != 3:
scriptname = os.path.basename(str(sys.argv[0]))
print "usage:", scriptname, "<FILENAME>", "<STATUS>"
print "\t Pass in the filename and status to be set in ... | false | true |
7903efa0fc0b65d208a01c204b5663cc740a760d | 3,564 | py | Python | test/functional/test_framework/blocktools.py | Supernode-SUNO/SUNO | 6b34a154671597b6e072eeecf336d2d3d38ee6bb | [
"MIT"
] | null | null | null | test/functional/test_framework/blocktools.py | Supernode-SUNO/SUNO | 6b34a154671597b6e072eeecf336d2d3d38ee6bb | [
"MIT"
] | null | null | null | test/functional/test_framework/blocktools.py | Supernode-SUNO/SUNO | 6b34a154671597b6e072eeecf336d2d3d38ee6bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from test_framework.mininode import *
from test... | 33 | 83 | 0.695567 |
from test_framework.mininode import *
from test_framework.script import CScript, OP_TRUE, OP_CHECKSIG
def create_block(hashprev, coinbase, nTime=None):
block = CBlock()
if nTime is None:
import time
block.nTime = int(time.time()+600)
else:
block.nTime = nTime
block.hashPr... | true | true |
7903f0276fa1659f3ba798ab62438fe906bbb1be | 5,189 | py | Python | src/orders/models.py | hellojerry/pizzatime | 1ddb4667c30b97d1ca832420ba53723c1aa787f1 | [
"MIT"
] | 1 | 2016-08-24T00:29:11.000Z | 2016-08-24T00:29:11.000Z | src/orders/models.py | hellojerry/pizzatime | 1ddb4667c30b97d1ca832420ba53723c1aa787f1 | [
"MIT"
] | null | null | null | src/orders/models.py | hellojerry/pizzatime | 1ddb4667c30b97d1ca832420ba53723c1aa787f1 | [
"MIT"
] | null | null | null | from django.db import models
import string, random, datetime
from profiles.models import UserProfile, Location, Surcharges, User
from decimal import *
from menu.models import Product, Entree, Pizza, PizzaTopping, Side
from localflavor.us.models import PhoneNumberField, USStateField, USZipCodeField
#modify this to che... | 38.437037 | 129 | 0.664097 | from django.db import models
import string, random, datetime
from profiles.models import UserProfile, Location, Surcharges, User
from decimal import *
from menu.models import Product, Entree, Pizza, PizzaTopping, Side
from localflavor.us.models import PhoneNumberField, USStateField, USZipCodeField
def make_conf(len... | true | true |
7903f0e8cbf52ac530b12e8b6192b08a3c4a90f1 | 82,016 | py | Python | test/integration/component/test_stopped_vm.py | ksowmya/cloudstack-1 | f8f779158da056be7da669884ae4ddd109cec044 | [
"Apache-2.0"
] | 1 | 2020-03-27T22:21:20.000Z | 2020-03-27T22:21:20.000Z | test/integration/component/test_stopped_vm.py | ksowmya/cloudstack-1 | f8f779158da056be7da669884ae4ddd109cec044 | [
"Apache-2.0"
] | null | null | null | test/integration/component/test_stopped_vm.py | ksowmya/cloudstack-1 | f8f779158da056be7da669884ae4ddd109cec044 | [
"Apache-2.0"
] | 1 | 2019-12-26T07:16:06.000Z | 2019-12-26T07:16:06.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.317884 | 120 | 0.452668 |
import marvin
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.remoteSSHClient import remoteSSHClient
from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common impor... | true | true |
7903f14c63028b965ddddec618df99f3f887854f | 682 | py | Python | Postgress-example/peewee-orm-test.py | Raul-Flores/ORM-example | ff289f74f858514cebefe7070c3688ad773a0e2a | [
"MIT"
] | null | null | null | Postgress-example/peewee-orm-test.py | Raul-Flores/ORM-example | ff289f74f858514cebefe7070c3688ad773a0e2a | [
"MIT"
] | null | null | null | Postgress-example/peewee-orm-test.py | Raul-Flores/ORM-example | ff289f74f858514cebefe7070c3688ad773a0e2a | [
"MIT"
] | null | null | null | from peewee import *
import psycopg2
import datetime
db = PostgresqlDatabase("prueba", host="localhost", port=5432, user="postgres", password="P@ssw0rd")
class BaseModel(Model):
class Meta:
database = db
class User(BaseModel):
Username = CharField(unique = True)
email = CharField(unique = True)
... | 26.230769 | 100 | 0.670088 | from peewee import *
import psycopg2
import datetime
db = PostgresqlDatabase("prueba", host="localhost", port=5432, user="postgres", password="P@ssw0rd")
class BaseModel(Model):
class Meta:
database = db
class User(BaseModel):
Username = CharField(unique = True)
email = CharField(unique = True)
... | true | true |
7903f253e8075b929b3aebfdfe7655f7bad4b7f8 | 1,900 | py | Python | swig_muesli/muesli/da/setup_da.py | NinaHerrmann/muesli2py | 632bb67433c6f67eaa48dc431d51914e0fde8f22 | [
"MIT"
] | null | null | null | swig_muesli/muesli/da/setup_da.py | NinaHerrmann/muesli2py | 632bb67433c6f67eaa48dc431d51914e0fde8f22 | [
"MIT"
] | null | null | null | swig_muesli/muesli/da/setup_da.py | NinaHerrmann/muesli2py | 632bb67433c6f67eaa48dc431d51914e0fde8f22 | [
"MIT"
] | 1 | 2021-11-05T11:20:39.000Z | 2021-11-05T11:20:39.000Z | import os
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from Cython.Distutils import build_ext
import numpy as np
from os.path import join as pjoin
from setup_cuda import cuda_setup
mpi_compile_args = os.popen("mpic++ --showme:compile").read().strip().split(' ')
mpi_link_ar... | 33.333333 | 80 | 0.587895 | import os
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from Cython.Distutils import build_ext
import numpy as np
from os.path import join as pjoin
from setup_cuda import cuda_setup
mpi_compile_args = os.popen("mpic++ --showme:compile").read().strip().split(' ')
mpi_link_ar... | true | true |
7903f2d420c11f5c52ca3c107b61adfa92f927b4 | 482 | py | Python | main8.py | BraffordHunter/E01a-Control-Structues | 32d3ba66169e2ff1f24d7d4b23c135022637aadb | [
"MIT"
] | null | null | null | main8.py | BraffordHunter/E01a-Control-Structues | 32d3ba66169e2ff1f24d7d4b23c135022637aadb | [
"MIT"
] | null | null | null | main8.py | BraffordHunter/E01a-Control-Structues | 32d3ba66169e2ff1f24d7d4b23c135022637aadb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import utils
utils.check_version((3,7)) # make sure we are running at least Python 3.7
utils.clear() # clear the screen
print('Greetings!')
color = ''
while (color != 'red'):color = input("What is my favorite color? ")
while (color != 'red'):
color = color.l... | 25.368421 | 82 | 0.558091 |
import utils
utils.check_version((3,7))
utils.clear()
print('Greetings!')
color = ''
while (color != 'red'):color = input("What is my favorite color? ")
while (color != 'red'):
color = color.lower().strip()
if (color == 'red'):
print('Correct!')
elif (color == '... | true | true |
7903f412d8067347ae393df508dd0039c1b1cec1 | 1,962 | py | Python | scripts/objects_to_tags.py | scumatteo/rtabmap_ros | 74abc0e46d9f3977cda386b6fd505b49c4fe5fff | [
"BSD-3-Clause"
] | 657 | 2015-01-29T10:50:57.000Z | 2022-03-31T08:55:39.000Z | scripts/objects_to_tags.py | scumatteo/rtabmap_ros | 74abc0e46d9f3977cda386b6fd505b49c4fe5fff | [
"BSD-3-Clause"
] | 714 | 2015-01-09T08:43:16.000Z | 2022-03-30T04:04:00.000Z | scripts/objects_to_tags.py | scumatteo/rtabmap_ros | 74abc0e46d9f3977cda386b6fd505b49c4fe5fff | [
"BSD-3-Clause"
] | 524 | 2015-02-04T15:23:22.000Z | 2022-03-30T17:03:06.000Z | #!/usr/bin/env python
import rospy
from apriltag_ros.msg import AprilTagDetectionArray
from apriltag_ros.msg import AprilTagDetection
from find_object_2d.msg import ObjectsStamped
import tf
import geometry_msgs.msg
objFramePrefix_ = "object"
distanceMax_ = 0.0
def callback(data):
global objFramePrefix_
global... | 41.744681 | 133 | 0.646789 |
import rospy
from apriltag_ros.msg import AprilTagDetectionArray
from apriltag_ros.msg import AprilTagDetection
from find_object_2d.msg import ObjectsStamped
import tf
import geometry_msgs.msg
objFramePrefix_ = "object"
distanceMax_ = 0.0
def callback(data):
global objFramePrefix_
global distanceMax_
if ... | true | true |
7903f5a22c3ec8d92ce95ff2f09cfe391dcc61f8 | 6,399 | py | Python | common-python/oc_provisioning/oc_provision_wrappers/database/v11g/oracle_rdbms_clone.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 28 | 2016-11-07T14:03:25.000Z | 2022-02-01T08:46:52.000Z | common-python/oc_provisioning/oc_provision_wrappers/database/v11g/oracle_rdbms_clone.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 3 | 2016-11-09T13:23:03.000Z | 2018-04-05T15:49:22.000Z | common-python/oc_provisioning/oc_provision_wrappers/database/v11g/oracle_rdbms_clone.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 13 | 2016-10-27T17:59:38.000Z | 2022-02-18T04:38:38.000Z | # The MIT License (MIT)
#
# Copyright (c) 2016 Oracle
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 42.946309 | 153 | 0.643694 |
__author__ = "Michael Shanley (Oracle A-Team)"
__copyright__ = "Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved."
__version__ = "1.0.0.0"
from oc_provision_wrappers import commerce_setup_helper
import os
import time
import logging
logger = logging.getLogger(__name__)
json... | true | true |
7903f880b576c98e61ab228f6f1a8866e40b7802 | 1,335 | py | Python | tests/changes/expanders/test_commands.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 443 | 2015-01-03T16:28:39.000Z | 2021-04-26T16:39:46.000Z | tests/changes/expanders/test_commands.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 12 | 2015-07-30T19:07:16.000Z | 2016-11-07T23:11:21.000Z | tests/changes/expanders/test_commands.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 47 | 2015-01-09T10:04:00.000Z | 2020-11-18T17:58:19.000Z | from __future__ import absolute_import
import pytest
from changes.expanders.commands import CommandsExpander
from changes.testutils import TestCase
class CommandsExpanderTest(TestCase):
def setUp(self):
super(CommandsExpanderTest, self).setUp()
self.project = self.create_project()
def get_e... | 31.785714 | 56 | 0.626966 | from __future__ import absolute_import
import pytest
from changes.expanders.commands import CommandsExpander
from changes.testutils import TestCase
class CommandsExpanderTest(TestCase):
def setUp(self):
super(CommandsExpanderTest, self).setUp()
self.project = self.create_project()
def get_e... | true | true |
7903f921b48d453a32ec92b9ee4383a94eb38785 | 8,861 | py | Python | akshare/stock/zh_stock_a_sina.py | x109airfighter/akshare | 5f9600fdba11c933c144e47d551129ec42cb56c5 | [
"MIT"
] | 1 | 2020-05-31T14:50:35.000Z | 2020-05-31T14:50:35.000Z | akshare/stock/zh_stock_a_sina.py | fellowfun/akshare | 06b553d0a56f54a0e8f8a2031c374366a8b25e91 | [
"MIT"
] | null | null | null | akshare/stock/zh_stock_a_sina.py | fellowfun/akshare | 06b553d0a56f54a0e8f8a2031c374366a8b25e91 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2019/10/30 11:28
Desc: 新浪财经-A股-实时行情数据和历史行情数据(包含前复权和后复权因子)
"""
import re
import demjson
import execjs
import pandas as pd
import requests
from tqdm import tqdm
from akshare.stock.cons import (zh_sina_a_stock_payload,
zh_sina_a_stock... | 44.979695 | 107 | 0.586616 |
import re
import demjson
import execjs
import pandas as pd
import requests
from tqdm import tqdm
from akshare.stock.cons import (zh_sina_a_stock_payload,
zh_sina_a_stock_url,
zh_sina_a_stock_count_url,
zh_sina_a_stock_hi... | true | true |
7903f9d911ea7281080096d18fbd810021aa2ca6 | 3,796 | py | Python | recohut/models/ccpm.py | sparsh-ai/recohut | 4121f665761ffe38c9b6337eaa9293b26bee2376 | [
"Apache-2.0"
] | null | null | null | recohut/models/ccpm.py | sparsh-ai/recohut | 4121f665761ffe38c9b6337eaa9293b26bee2376 | [
"Apache-2.0"
] | 1 | 2022-01-12T05:40:57.000Z | 2022-01-12T05:40:57.000Z | recohut/models/ccpm.py | RecoHut-Projects/recohut | 4121f665761ffe38c9b6337eaa9293b26bee2376 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/models/models.ccpm.ipynb (unless otherwise specified).
__all__ = ['CCPM']
# Cell
import torch
from torch import nn
from .layers.embedding import EmbeddingLayer
from .layers.common import KMaxPooling
from .bases.ctr import CTRModel
# Internal Cell
def get_activation(a... | 40.382979 | 102 | 0.58667 |
__all__ = ['CCPM']
import torch
from torch import nn
from .layers.embedding import EmbeddingLayer
from .layers.common import KMaxPooling
from .bases.ctr import CTRModel
def get_activation(activation):
if isinstance(activation, str):
if activation.lower() == "relu":
return nn.ReLU()
... | true | true |
7903f9f6cf7c12b33ef38fa38569087a4f42e65e | 4,409 | py | Python | Pytorch/ActorCritic/agent_and_model.py | FitMachineLearning/FitML | a60f49fce1799ca4b11b48307441325b6272719a | [
"MIT"
] | 171 | 2017-11-07T09:59:20.000Z | 2022-03-29T13:59:18.000Z | Pytorch/ActorCritic/agent_and_model.py | FitMachineLearning/FitML | a60f49fce1799ca4b11b48307441325b6272719a | [
"MIT"
] | 1 | 2017-12-24T20:08:18.000Z | 2018-01-31T22:26:49.000Z | Pytorch/ActorCritic/agent_and_model.py | FitMachineLearning/FitML | a60f49fce1799ca4b11b48307441325b6272719a | [
"MIT"
] | 44 | 2017-11-07T12:08:05.000Z | 2022-01-04T15:53:12.000Z | ## DQN Tutorial
## Implementation from https://github.com/FitMachineLearning
import torch
import gym
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from dataclasses import dataclass
from typing import Any
from random import random
@dataclass
class sa... | 34.992063 | 99 | 0.608528 | al as F
import torch.optim as optim
import numpy as np
from dataclasses import dataclass
from typing import Any
from random import random
@dataclass
class sars:
state: Any
action: Any
reward: float
next_state: Any
done: bool
qval: float
advantage: float = 0.0
class DQNAg... | true | true |
7903fb03c190715ca6439f348e3c6613fbaab8c1 | 1,714 | py | Python | Lib/site-packages/django/contrib/messages/storage/session.py | ashutoshsuman99/Web-Blog-D19 | a01a0ccc40e8823110c01ebe4f43d9351df57295 | [
"bzip2-1.0.6"
] | 123 | 2015-01-15T06:56:45.000Z | 2022-03-19T22:18:55.000Z | Lib/site-packages/django/contrib/messages/storage/session.py | ashutoshsuman99/Web-Blog-D19 | a01a0ccc40e8823110c01ebe4f43d9351df57295 | [
"bzip2-1.0.6"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | Lib/site-packages/django/contrib/messages/storage/session.py | ashutoshsuman99/Web-Blog-D19 | a01a0ccc40e8823110c01ebe4f43d9351df57295 | [
"bzip2-1.0.6"
] | 120 | 2016-08-18T14:53:03.000Z | 2020-06-16T13:27:20.000Z | import json
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import (
MessageDecoder, MessageEncoder,
)
from django.utils import six
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
... | 34.979592 | 90 | 0.65811 | import json
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import (
MessageDecoder, MessageEncoder,
)
from django.utils import six
class SessionStorage(BaseStorage):
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
... | true | true |
7903fb5373e14a37b633e0a4aaccefc50a37fcdd | 591 | py | Python | sfdoc/publish/migrations/0032_docset.py | SFDO-Tooling/sfdoc | 6bc7277cbc6e01c03581a7217a2c33fbfa91a537 | [
"BSD-3-Clause"
] | 5 | 2019-08-01T18:53:00.000Z | 2022-02-07T16:16:09.000Z | sfdoc/publish/migrations/0032_docset.py | SFDO-Tooling/sfdoc | 6bc7277cbc6e01c03581a7217a2c33fbfa91a537 | [
"BSD-3-Clause"
] | 144 | 2019-04-25T21:40:44.000Z | 2022-03-28T20:43:31.000Z | sfdoc/publish/migrations/0032_docset.py | SalesforceFoundation/sfdoc | 6bc7277cbc6e01c03581a7217a2c33fbfa91a537 | [
"BSD-3-Clause"
] | 1 | 2019-03-28T05:06:06.000Z | 2019-03-28T05:06:06.000Z | # Generated by Django 2.2.1 on 2019-07-06 21:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publish', '0031_bundle_description'),
]
operations = [
migrations.CreateModel(
name='Docset',
fields=[
... | 26.863636 | 114 | 0.57868 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publish', '0031_bundle_description'),
]
operations = [
migrations.CreateModel(
name='Docset',
fields=[
('id', models.AutoField(auto_created=True, p... | true | true |
7903fb54012d2c5ce80e5a6f76f319ac3b640c93 | 2,845 | py | Python | wxcloudrun/common/tabledrawer.py | vandyzhou/wxcloudrun-django | 454f9c1ab827543f2635a549ca7e251ed35d9305 | [
"MIT"
] | null | null | null | wxcloudrun/common/tabledrawer.py | vandyzhou/wxcloudrun-django | 454f9c1ab827543f2635a549ca7e251ed35d9305 | [
"MIT"
] | null | null | null | wxcloudrun/common/tabledrawer.py | vandyzhou/wxcloudrun-django | 454f9c1ab827543f2635a549ca7e251ed35d9305 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2022/2/9 12:09 下午
# @Author: zhoumengjie
# @File : tabledrawer.py
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties
def draw_table(columns_head:[], cell_vals=[]):
# 设置字体及负数
plt... | 26.588785 | 92 | 0.557118 |
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties
def draw_table(columns_head:[], cell_vals=[]):
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
fig, ax = plt.subplots(figsi... | true | true |
7903fc686ea9db90d55b8295e8e2299266fe40b7 | 635 | py | Python | Python3-Basics/Chapter11_Exception02_Warning.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-Basics/Chapter11_Exception02_Warning.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-Basics/Chapter11_Exception02_Warning.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import warnings
# warnings.filterwarnings("ignore") # 抑制告警,并指定采取的措施
warnings.warn("# This is a test warning 111.")
print("Hello One")
warnings.filterwarnings("ignore", category=DeprecationWarning) # 抑制特定类型的警告
warnings.warn("# This is a test warning 222.", DeprecationWarning) # 被抑制
... | 30.238095 | 78 | 0.707087 |
import warnings
# This is a test warning 111.")
print("Hello One")
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.warn("# This is a test warning 222.", DeprecationWarning)
warnings.warn("# Something else.")
print("Hello Two")
warnings.filterwarnings("error")
warnings.warn("# ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.