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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71da88383379817259c926e3dd530d8bc03e35e | 1,211 | py | Python | setup.py | kleinesfilmroellchen/fancytables | 9bf63fa27662c8b5f1df9f4af7d3747108a72bf2 | [
"Apache-2.0"
] | 1 | 2019-07-28T18:50:13.000Z | 2019-07-28T18:50:13.000Z | setup.py | kleinesfilmroellchen/fancytables | 9bf63fa27662c8b5f1df9f4af7d3747108a72bf2 | [
"Apache-2.0"
] | null | null | null | setup.py | kleinesfilmroellchen/fancytables | 9bf63fa27662c8b5f1df9f4af7d3747108a72bf2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from setuptools import setup, find_packages
from fancytables import __version__
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="fancytables",
version=__version__,
author="kleinesfilmröllchen",
description="Fancy table formatting that builds on pret... | 36.69697 | 71 | 0.669694 |
from setuptools import setup, find_packages
from fancytables import __version__
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="fancytables",
version=__version__,
author="kleinesfilmröllchen",
description="Fancy table formatting that builds on prettytable",
long_des... | true | true |
f71da8f6228385b82094f40fddf9fda8725396bb | 222 | py | Python | src/python/squarepattern.py | helara/a-patterns | 42c6fb713371fae8c6c38a2a17c04915e9fef8b3 | [
"MIT"
] | 9 | 2020-10-02T03:40:07.000Z | 2021-10-17T11:55:01.000Z | src/python/squarepattern.py | helara/a-patterns | 42c6fb713371fae8c6c38a2a17c04915e9fef8b3 | [
"MIT"
] | 62 | 2020-10-02T03:02:20.000Z | 2021-10-12T09:14:18.000Z | src/python/squarepattern.py | helara/a-patterns | 42c6fb713371fae8c6c38a2a17c04915e9fef8b3 | [
"MIT"
] | 58 | 2020-10-02T03:19:24.000Z | 2021-10-12T07:28:14.000Z |
def square_pattern(n):
for i in range(n):
for j in range(n):
print("*",end=" ")
print()
square_pattern(5)
'''
python3 squarepattern.py
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
''' | 12.333333 | 34 | 0.414414 |
def square_pattern(n):
for i in range(n):
for j in range(n):
print("*",end=" ")
print()
square_pattern(5)
| true | true |
f71da97d64c3b539f23c5f8231fda32b53eaeed1 | 3,994 | py | Python | hapi_demo.py | hbatta/client-python | 1c1d32fce9e84bc1a4938ae7adc30cef8d682aa4 | [
"BSD-3-Clause"
] | null | null | null | hapi_demo.py | hbatta/client-python | 1c1d32fce9e84bc1a4938ae7adc30cef8d682aa4 | [
"BSD-3-Clause"
] | null | null | null | hapi_demo.py | hbatta/client-python | 1c1d32fce9e84bc1a4938ae7adc30cef8d682aa4 | [
"BSD-3-Clause"
] | null | null | null | # Basic demo of hapiclient. Install package using
# pip install hapiclient --upgrade
# from command line.
# Note:
# In IPython, enter
# %matplotlib qt
# on command line to open plots in new window. Enter
# %matplotlib inline
# to revert.
# For more extensive demos and examples, see
# https://colab.research.g... | 29.80597 | 87 | 0.605658 |
def main():
demos = [omniweb, sscweb, cdaweb, cassini, lisird]
for demo in demos:
try:
demo()
except Exception as e:
print("\033[0;31mError:\033[0m " + str(e))
def omniweb():
from hapiclient import hapi
from hapiplot import hapiplot
... | true | true |
f71da982f16665ea81e00e48c0b297a273d3faab | 1,269 | py | Python | jina/types/request/mixin.py | slettner/jina | 4140961c62359e3acd540a6d88931665c6313824 | [
"Apache-2.0"
] | null | null | null | jina/types/request/mixin.py | slettner/jina | 4140961c62359e3acd540a6d88931665c6313824 | [
"Apache-2.0"
] | null | null | null | jina/types/request/mixin.py | slettner/jina | 4140961c62359e3acd540a6d88931665c6313824 | [
"Apache-2.0"
] | null | null | null | from ..arrays import DocumentArray
from ...proto import jina_pb2
class DocsPropertyMixin:
"""Mixin class of docs property."""
@property
def docs(self) -> 'DocumentArray':
"""Get the :class: `DocumentArray` with sequence `body.docs` as content.
:return: requested :class: `DocumentArray`
... | 24.403846 | 80 | 0.616233 | from ..arrays import DocumentArray
from ...proto import jina_pb2
class DocsPropertyMixin:
@property
def docs(self) -> 'DocumentArray':
self.is_used = True
return DocumentArray(self.body.docs)
class GroundtruthPropertyMixin:
@property
def groundtruths(self) -> 'DocumentArray':
... | true | true |
f71daa30288191894bea8d2352348972b7d9dab7 | 1,139 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/setup.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 3 | 2018-03-20T22:36:32.000Z | 2021-07-15T02:36:51.000Z | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/setup.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFormData/setup.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 1 | 2019-07-20T12:20:03.000Z | 2019-07-20T12:20:03.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 27.780488 | 76 | 0.634767 |
from setuptools import setup, find_packages
NAME = "autorestswaggerbatformdataservice"
VERSION = "1.0.0"
REQUIRES = ["msrest>=0.2.0"]
setup(
name=NAME,
version=VERSION,
description="AutoRestSwaggerBATFormDataService",
author_email="",
url="",
keywords=["Swagger", "AutoRestS... | true | true |
f71daab921001a2e7c9422eb3c8b3b95ef64ffa7 | 5,243 | py | Python | ps3000aExamples/ps3000aBlockMSOExample.py | joe-jordan/picosdk-python-wrappers | 76f393b500200de168b4f2b74b74aad74d89fd92 | [
"ISC"
] | null | null | null | ps3000aExamples/ps3000aBlockMSOExample.py | joe-jordan/picosdk-python-wrappers | 76f393b500200de168b4f2b74b74aad74d89fd92 | [
"ISC"
] | null | null | null | ps3000aExamples/ps3000aBlockMSOExample.py | joe-jordan/picosdk-python-wrappers | 76f393b500200de168b4f2b74b74aad74d89fd92 | [
"ISC"
] | null | null | null | #
# Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms.
#
# PS3000A BLOCK MODE MSO EXAMPLE
# This example opens a 3000a driver device, sets up one digital port and a trigger to collect a block of data.
# This data is then split into the indivual digital channels and plotted as the binary value against ... | 34.493421 | 203 | 0.764639 |
import ctypes
from picosdk.ps3000a import ps3000a as ps
from picosdk.functions import splitMSODataPort0, assert_pico_ok
import numpy as np
import matplotlib.pyplot as plt
import time
from array import *
status = {}
chandle = ctypes.c_int16()
status["openunit"] = ps.ps3000aOpenUnit(ctypes.byref(chandle), None... | true | true |
f71dab8a82af3d313e92b214f7c9f4a85f08258e | 2,721 | py | Python | wavetorch/io.py | Kshitiz-Bansal/wavetorch | 7958e512ceda7dfa8d2228d0961157dac4362b58 | [
"MIT"
] | 470 | 2019-04-30T00:49:21.000Z | 2022-03-20T08:31:59.000Z | wavetorch/io.py | geofiber/wavetorch | 927ad02dc9db83f72b8df1d91418a6681e60fd56 | [
"MIT"
] | 8 | 2019-04-30T01:06:36.000Z | 2021-07-18T06:24:56.000Z | wavetorch/io.py | geofiber/wavetorch | 927ad02dc9db83f72b8df1d91418a6681e60fd56 | [
"MIT"
] | 76 | 2019-04-30T09:40:39.000Z | 2022-03-08T18:38:13.000Z | import copy
import os
import torch
from . import geom
from .cell import WaveCell
from .probe import WaveIntensityProbe
from .rnn import WaveRNN
from .source import WaveSource
from .utils import set_dtype
def save_model(model,
name,
savedir='./study/',
history=None,
history_geom_state=None,
... | 30.920455 | 99 | 0.720691 | import copy
import os
import torch
from . import geom
from .cell import WaveCell
from .probe import WaveIntensityProbe
from .rnn import WaveRNN
from .source import WaveSource
from .utils import set_dtype
def save_model(model,
name,
savedir='./study/',
history=None,
history_geom_state=None,
... | true | true |
f71dadd500ddc556382c08754efe696aea4fc7e4 | 565 | py | Python | modules/pastebin.py | f0ur0ne/vicky | f4ede29480a14bd10e72066a57dc5bd2139deab9 | [
"MIT"
] | 1 | 2020-05-19T03:42:49.000Z | 2020-05-19T03:42:49.000Z | modules/pastebin.py | f0ur0ne/vicky | f4ede29480a14bd10e72066a57dc5bd2139deab9 | [
"MIT"
] | null | null | null | modules/pastebin.py | f0ur0ne/vicky | f4ede29480a14bd10e72066a57dc5bd2139deab9 | [
"MIT"
] | null | null | null | import requests
dev_key = "redacted"
username = "redacted"
password = "redacted"
header = {"Content-Type": "application/json; charset=utf8"}
privatepaste = 1 #limits for this are confusing http://192.184.83.59/SPG%20All/pastebin.com/faq.html#11a
def pastebin(pastedata):
params = {"api_option": "paste", "api_user_key... | 43.461538 | 200 | 0.739823 | import requests
dev_key = "redacted"
username = "redacted"
password = "redacted"
header = {"Content-Type": "application/json; charset=utf8"}
privatepaste = 1 f pastebin(pastedata):
params = {"api_option": "paste", "api_user_key": "", "api_paste_private": privatepaste, "api_dev_key": dev_key, "api_paste_expire_date": ... | true | true |
f71daedf5d358af52f6cde39e1fc0f8bde6f2e51 | 5,466 | py | Python | saleor/product/utils/__init__.py | dnordio/saleor | 323963748e6a2702265ec6635b930a234abde4f5 | [
"BSD-3-Clause"
] | 1 | 2019-05-02T17:24:05.000Z | 2019-05-02T17:24:05.000Z | saleor/product/utils/__init__.py | valentine217/saleor | 323963748e6a2702265ec6635b930a234abde4f5 | [
"BSD-3-Clause"
] | null | null | null | saleor/product/utils/__init__.py | valentine217/saleor | 323963748e6a2702265ec6635b930a234abde4f5 | [
"BSD-3-Clause"
] | 1 | 2019-05-23T07:30:50.000Z | 2019-05-23T07:30:50.000Z | from urllib.parse import urlencode
from django.conf import settings
from django.db.models import F
from ...checkout.utils import (
get_checkout_from_request, get_or_create_checkout_from_request)
from ...core.utils import get_paginator_items
from ...core.utils.filters import get_now_sorted_by
from ...core.utils.ta... | 35.493506 | 79 | 0.742042 | from urllib.parse import urlencode
from django.conf import settings
from django.db.models import F
from ...checkout.utils import (
get_checkout_from_request, get_or_create_checkout_from_request)
from ...core.utils import get_paginator_items
from ...core.utils.filters import get_now_sorted_by
from ...core.utils.ta... | true | true |
f71db06cb92d25ecf2ddda7df1fc07ed62c5f692 | 7,559 | py | Python | tests/unit/test_indicator_node.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 1 | 2021-07-09T14:49:08.000Z | 2021-07-09T14:49:08.000Z | tests/unit/test_indicator_node.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_indicator_node.py | philtrade/gQuant | 08b2a82a257c234b92f097b925f25cab16fd0926 | [
"Apache-2.0"
] | 1 | 2021-03-22T19:54:38.000Z | 2021-03-22T19:54:38.000Z | '''
Technical Indicator Node Unit Tests
To run unittests:
# Using standard library unittest
python -m unittest -v
python -m unittest tests/unit/test_indicator_node.py -v
or
python -m unittest discover <test_directory>
python -m unittest discover -s <directory> -p 'test_*.py'
# Using pytest
# "conda install pytest... | 36.341346 | 79 | 0.546765 | import warnings
import unittest
import cudf
import gquant.cuindicator as gi
from gquant.plugin_nodes.transform.indicatorNode import IndicatorNode
from gquant.dataframe_flow.task import Task
from .utils import make_orderer
import numpy as np
import copy
ordered, compare = make_orderer()
unittest.defaultTestLoader.sortT... | true | true |
f71db0b1d9066233cc40f717f39f446dad22cf25 | 219 | py | Python | test.py | bobbysoon/Taxi3 | 48e01ed063152c834b0e3f43eef9494c7d56b02b | [
"Unlicense"
] | null | null | null | test.py | bobbysoon/Taxi3 | 48e01ed063152c834b0e3f43eef9494c7d56b02b | [
"Unlicense"
] | 1 | 2019-11-13T13:52:12.000Z | 2020-01-31T02:21:25.000Z | test.py | bobbysoon/Taxi3 | 48e01ed063152c834b0e3f43eef9494c7d56b02b | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
from Demo import Demo
from Swarm import Swarm
from Taxi import Taxi
swarm= Swarm(count=24)
demo= Demo(swarm)
while demo.is_open:
demo.draw(Taxi(swarm))
if not demo.paused:
swarm.move(demo.step)
| 15.642857 | 23 | 0.744292 |
from Demo import Demo
from Swarm import Swarm
from Taxi import Taxi
swarm= Swarm(count=24)
demo= Demo(swarm)
while demo.is_open:
demo.draw(Taxi(swarm))
if not demo.paused:
swarm.move(demo.step)
| true | true |
f71db1164a4a62b58d179f38b09f4c707a5ebaf0 | 107 | py | Python | ckanext-hdx_service_checker/ckanext/hdx_service_checker/tests/test_plugin.py | alexandru-m-g/hdx-ckan | 647f1f23f0505fa195601245b758edcaf4d25985 | [
"Apache-2.0"
] | 1 | 2020-03-07T02:47:15.000Z | 2020-03-07T02:47:15.000Z | ckanext-hdx_service_checker/ckanext/hdx_service_checker/tests/test_plugin.py | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | null | null | null | ckanext-hdx_service_checker/ckanext/hdx_service_checker/tests/test_plugin.py | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | null | null | null | """Tests for plugin.py."""
import ckanext.hdx_service_checker.plugin as plugin
def test_plugin():
pass | 21.4 | 51 | 0.747664 | import ckanext.hdx_service_checker.plugin as plugin
def test_plugin():
pass | true | true |
f71db16a0f56dddf2f635176ae6a0cb63823d0dc | 1,370 | py | Python | src/gwauth/mailer/templates.py | gravitationalwavedc/gwcloud_auth | 83d2a4928aaf86884e0bfc0fff938106a7fcd132 | [
"MIT"
] | null | null | null | src/gwauth/mailer/templates.py | gravitationalwavedc/gwcloud_auth | 83d2a4928aaf86884e0bfc0fff938106a7fcd132 | [
"MIT"
] | 25 | 2020-06-01T05:18:30.000Z | 2022-02-28T03:29:48.000Z | src/gwauth/mailer/templates.py | gravitationalwavedc/gwcloud_auth | 83d2a4928aaf86884e0bfc0fff938106a7fcd132 | [
"MIT"
] | null | null | null | """
Distributed under the MIT License. See LICENSE.txt for more info.
"""
# Templates for different emails
VERIFY_EMAIL_ADDRESS = dict()
VERIFY_EMAIL_ADDRESS['subject'] = '[GW Cloud] Please verify your email address'
VERIFY_EMAIL_ADDRESS['message'] = '<p>Dear {{first_name}} {{last_name}}: </p>' \
... | 68.5 | 118 | 0.476642 |
VERIFY_EMAIL_ADDRESS = dict()
VERIFY_EMAIL_ADDRESS['subject'] = '[GW Cloud] Please verify your email address'
VERIFY_EMAIL_ADDRESS['message'] = '<p>Dear {{first_name}} {{last_name}}: </p>' \
'<p>We have received a new account request with our GW Cloud system from this ' \
... | true | true |
f71db23eb8f046faa45c2b20bfa0b74fca05cf1b | 5,071 | py | Python | scipy/fft/tests/test_real_transforms.py | avivajpeyi/scipy | dbfe06e6618232b26c241cbe8861e2ea1489b535 | [
"BSD-3-Clause"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | scipy/fft/tests/test_real_transforms.py | avivajpeyi/scipy | dbfe06e6618232b26c241cbe8861e2ea1489b535 | [
"BSD-3-Clause"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | scipy/fft/tests/test_real_transforms.py | avivajpeyi/scipy | dbfe06e6618232b26c241cbe8861e2ea1489b535 | [
"BSD-3-Clause"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z |
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
import pytest
from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn
import scipy.fft as fft
from scipy import fftpack
# scipy.fft wraps the fftpack versions but with normalized inverse transforms.
# So, the forward transf... | 34.972414 | 78 | 0.559259 |
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
import pytest
from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn
import scipy.fft as fft
from scipy import fftpack
@pytest.mark.parametrize("forward, backward", [(dct, idct), (dst, idst)])
@pytest.mark.parametrize... | true | true |
f71db30154f5a7f8493945b56142710aef1d8b07 | 401 | py | Python | spotter/spotter_proj/asgi.py | gulpinhenry/spotter | 2a3f828f2e09dc4835861e2be489f537a197b19a | [
"MIT"
] | 1 | 2022-02-05T23:04:04.000Z | 2022-02-05T23:04:04.000Z | spotter/spotter_proj/asgi.py | gulpinhenry/spotter | 2a3f828f2e09dc4835861e2be489f537a197b19a | [
"MIT"
] | null | null | null | spotter/spotter_proj/asgi.py | gulpinhenry/spotter | 2a3f828f2e09dc4835861e2be489f537a197b19a | [
"MIT"
] | 1 | 2022-02-06T23:16:16.000Z | 2022-02-06T23:16:16.000Z | """
ASGI config for spotter_proj project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'spotter_proj.settings')
application = get_asgi_application()
| true | true |
f71db3b46c1a74a09b80fe88cca4e193ac811a77 | 783 | py | Python | starling_sim/basemodel/agent/spatial_agent.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | 19 | 2021-02-16T12:32:22.000Z | 2022-01-06T11:16:44.000Z | starling_sim/basemodel/agent/spatial_agent.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | 20 | 2021-01-13T20:58:07.000Z | 2022-03-21T15:53:07.000Z | starling_sim/basemodel/agent/spatial_agent.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | null | null | null | from starling_sim.basemodel.agent.agent import Agent
class SpatialAgent(Agent):
"""
Class describing a spatial agent, with a position and origin in the simulation environment.
"""
SCHEMA = {
"properties": {
"origin": {
"type": ["number", "string"],
... | 25.258065 | 95 | 0.56705 | from starling_sim.basemodel.agent.agent import Agent
class SpatialAgent(Agent):
SCHEMA = {
"properties": {
"origin": {
"type": ["number", "string"],
"title": "Origin position",
"description": "origin position id (inferred from geometry)",
... | true | true |
f71db3fb67e6c69828ce6a77378bfdcbb73779fb | 1,235 | py | Python | src/dsloader/kronecker.py | willshiao/brgan | 99d1627176a59811bf9032ef1f99d6e7261095fb | [
"MIT"
] | 1 | 2021-10-03T15:58:48.000Z | 2021-10-03T15:58:48.000Z | src/dsloader/kronecker.py | willshiao/brgan | 99d1627176a59811bf9032ef1f99d6e7261095fb | [
"MIT"
] | null | null | null | src/dsloader/kronecker.py | willshiao/brgan | 99d1627176a59811bf9032ef1f99d6e7261095fb | [
"MIT"
] | null | null | null | import networkx as nx
import numpy as np
import torch
from torch.utils.data import Dataset
from dsloader.util import kron_graph, random_binary, make_fractional
class KroneckerDataset (Dataset):
def __init__(self, kron_iter=4, seed_size=4, fixed_seed=None, num_graphs=1, perms_per_graph=256, progress_bar=False):
... | 30.875 | 121 | 0.630769 | import networkx as nx
import numpy as np
import torch
from torch.utils.data import Dataset
from dsloader.util import kron_graph, random_binary, make_fractional
class KroneckerDataset (Dataset):
def __init__(self, kron_iter=4, seed_size=4, fixed_seed=None, num_graphs=1, perms_per_graph=256, progress_bar=False):
... | true | true |
f71db4024d86975fa3fe5c0de9ee417e25b9a19b | 2,132 | py | Python | examples/assignment3/MH.py | koriavinash1/pgm | 89e11b61f7141a75d8991ff4ea229ef66d7a4a0c | [
"MIT"
] | 4 | 2020-02-25T06:14:16.000Z | 2020-12-07T11:08:18.000Z | examples/assignment3/MH.py | koriavinash1/pgm | 89e11b61f7141a75d8991ff4ea229ef66d7a4a0c | [
"MIT"
] | 2 | 2020-03-24T05:37:44.000Z | 2020-04-02T04:48:57.000Z | examples/assignment3/MH.py | koriavinash1/pgm | 89e11b61f7141a75d8991ff4ea229ef66d7a4a0c | [
"MIT"
] | 2 | 2020-03-23T16:07:04.000Z | 2020-04-02T04:48:50.000Z | import sys
import numpy as np
sys.path.append('../..')
from pgm.inference.MetropolisHastings import MH
from matplotlib import pyplot as plt
def Gamma(theta, k = 1):
def G(k):
if k <= 0: return 1
elif k == 0.5: return np.pi **0.5
return k*G(k-1)
def distribution(x):
x = np.abs(x)... | 27.688312 | 136 | 0.626173 | import sys
import numpy as np
sys.path.append('../..')
from pgm.inference.MetropolisHastings import MH
from matplotlib import pyplot as plt
def Gamma(theta, k = 1):
def G(k):
if k <= 0: return 1
elif k == 0.5: return np.pi **0.5
return k*G(k-1)
def distribution(x):
x = np.abs(x)... | true | true |
f71db4e455ac4c2288344181a36e874628a54146 | 1,959 | py | Python | projects/20130381/3rd/impassion_community/impassionuser/views.py | sisobus/WebStudio2019 | 2f659a84647110bcf975525905722931fa7055b3 | [
"MIT"
] | 14 | 2019-03-06T10:32:40.000Z | 2021-11-18T01:44:28.000Z | projects/20130381/3rd/impassion_community/impassionuser/views.py | sisobus/WebStudio2019 | 2f659a84647110bcf975525905722931fa7055b3 | [
"MIT"
] | 35 | 2019-03-13T07:04:02.000Z | 2019-10-08T06:26:45.000Z | projects/20130381/3rd/impassion_community/impassionuser/views.py | sisobus/WebStudio2019 | 2f659a84647110bcf975525905722931fa7055b3 | [
"MIT"
] | 22 | 2019-03-11T11:00:24.000Z | 2019-09-14T06:53:30.000Z | from django.shortcuts import render, redirect
from .models import Impassionuser
from django.http import HttpResponse
from django.contrib.auth.hashers import make_password, check_password
from .forms import LoginForm
# Create your views here.
def home(request):
return render(request, 'home.html')
def about_us(requ... | 30.138462 | 89 | 0.640123 | from django.shortcuts import render, redirect
from .models import Impassionuser
from django.http import HttpResponse
from django.contrib.auth.hashers import make_password, check_password
from .forms import LoginForm
def home(request):
return render(request, 'home.html')
def about_us(request):
return render(r... | true | true |
f71db52a6273627b9fdb578a9b437983757a0692 | 8,369 | py | Python | src/sagemaker_tensorflow_container/training.py | Freakawho/sagemaker-tensorflow-training-toolkit-master | f37c7d85600beb5461788db8c471b66c25beff8f | [
"Apache-2.0"
] | 156 | 2018-07-10T13:37:16.000Z | 2020-06-04T13:40:17.000Z | src/sagemaker_tensorflow_container/training.py | Freakawho/sagemaker-tensorflow-training-toolkit-master | f37c7d85600beb5461788db8c471b66c25beff8f | [
"Apache-2.0"
] | 166 | 2018-07-09T09:03:26.000Z | 2020-06-10T23:27:52.000Z | src/sagemaker_tensorflow_container/training.py | Freakawho/sagemaker-tensorflow-training-toolkit-master | f37c7d85600beb5461788db8c471b66c25beff8f | [
"Apache-2.0"
] | 129 | 2018-07-04T20:00:29.000Z | 2020-06-10T02:47:54.000Z | # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License'). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' fil... | 36.229437 | 118 | 0.674394 |
from __future__ import absolute_import
import json
import logging
import multiprocessing
import os
import subprocess
import time
from sagemaker_training import entry_point, environment, mapping, runner
import tensorflow as tf
from sagemaker_tensorflow_container import s3_utils
logger = logging.getLogger... | true | true |
f71db54c69c8e0384954c6e22ac6249f1eba58c2 | 2,422 | py | Python | lsql/judge/forms.py | iburgoa13/lsql | d60007c915162c6c5c12168f6e2eebdcb9d10989 | [
"MIT"
] | null | null | null | lsql/judge/forms.py | iburgoa13/lsql | d60007c915162c6c5c12168f6e2eebdcb9d10989 | [
"MIT"
] | null | null | null | lsql/judge/forms.py | iburgoa13/lsql | d60007c915162c6c5c12168f6e2eebdcb9d10989 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright Enrique Martín <emartinm@ucm.es> 2020
Forms used in LSQL
"""
from datetime import date
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
class FunctionProblemAdminForm(forms.ModelForm):
"""Custo... | 40.366667 | 107 | 0.645747 |
from datetime import date
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
class FunctionProblemAdminForm(forms.ModelForm):
calls = forms.CharField(label='List of function calls to test (one per line)',
... | true | true |
f71db6c703c175874f5cd66e3998079a192b818c | 581 | py | Python | src/python/120Triangle.py | witimlfl/leetcode-exercise | 9449c41fa03b996a37923f1dede0933753691282 | [
"MIT"
] | null | null | null | src/python/120Triangle.py | witimlfl/leetcode-exercise | 9449c41fa03b996a37923f1dede0933753691282 | [
"MIT"
] | null | null | null | src/python/120Triangle.py | witimlfl/leetcode-exercise | 9449c41fa03b996a37923f1dede0933753691282 | [
"MIT"
] | null | null | null | def minimumTotal(triangle):
if not triangle: return 0
res = triangle[-1]
for i in range(len(triangle) -2, -1, -1):
for j in range(len(triangle[i])):
res[j] = min(res[j], res[j+1]) + triangle[i][j]
return res[0]
def minimumTotal1(triangle):
if not triangle:
return 0
... | 27.666667 | 71 | 0.555938 | def minimumTotal(triangle):
if not triangle: return 0
res = triangle[-1]
for i in range(len(triangle) -2, -1, -1):
for j in range(len(triangle[i])):
res[j] = min(res[j], res[j+1]) + triangle[i][j]
return res[0]
def minimumTotal1(triangle):
if not triangle:
return 0
... | true | true |
f71db8071548b827f1a29f3a5b9fb958d481c189 | 545 | py | Python | samples-python/datalayer.provider/setup.py | bracoe/ctrlx-automation-sdk | 6b2e61e146c557488125baf941e4d64c6fa6d0fb | [
"MIT"
] | 16 | 2021-08-23T13:07:12.000Z | 2022-02-21T13:29:21.000Z | samples-python/datalayer.provider/setup.py | bracoe/ctrlx-automation-sdk | 6b2e61e146c557488125baf941e4d64c6fa6d0fb | [
"MIT"
] | null | null | null | samples-python/datalayer.provider/setup.py | bracoe/ctrlx-automation-sdk | 6b2e61e146c557488125baf941e4d64c6fa6d0fb | [
"MIT"
] | 10 | 2021-09-29T09:58:33.000Z | 2022-01-13T07:20:00.000Z | from setuptools import setup
setup(
name='sdk-py-datalayer-provider',
version='2.0.0',
description='This sample shows how to provide data to ctrlX Data Layer',
author='SDK Team',
install_requires = ['ctrlx-datalayer', 'ctrlx_fbs'],
packages=['app', 'sample.schema'],
# https://stackoverf... | 36.333333 | 90 | 0.684404 | from setuptools import setup
setup(
name='sdk-py-datalayer-provider',
version='2.0.0',
description='This sample shows how to provide data to ctrlX Data Layer',
author='SDK Team',
install_requires = ['ctrlx-datalayer', 'ctrlx_fbs'],
packages=['app', 'sample.schema'],
package_data={'... | true | true |
f71db83273809f77def4132e79fc25e819d9175d | 5,586 | py | Python | examples/decoding/plot_decoding_csp_eeg.py | TanayGahlot/mne-python | 857aa97c201451b82931c5eba50642975afc423d | [
"BSD-3-Clause"
] | null | null | null | examples/decoding/plot_decoding_csp_eeg.py | TanayGahlot/mne-python | 857aa97c201451b82931c5eba50642975afc423d | [
"BSD-3-Clause"
] | null | null | null | examples/decoding/plot_decoding_csp_eeg.py | TanayGahlot/mne-python | 857aa97c201451b82931c5eba50642975afc423d | [
"BSD-3-Clause"
] | null | null | null | """
===========================================================================
Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)
===========================================================================
Decoding of motor imagery applied to EEG data decomposed using CSP.
Here the classifier... | 36.509804 | 79 | 0.672037 |
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from mne import Epochs, pick_types
from mne.io import concatenate_raws
from mne.io.edf import read_raw_edf
from mne.datasets import eegbci
from mne.event import find_events
from mne.decoding import CSP
from mne.layouts import read_layout
| true | true |
f71dba22e36d7a5ff9ad3ce5dd64f729807fab5f | 9,895 | py | Python | lib/python3.8/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_devprof_device_profile_fortianalyzer.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_devprof_device_profile_fortianalyzer.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_devprof_device_profile_fortianalyzer.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 32.336601 | 112 | 0.543103 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fmgr_devprof_device_profile_fortianalyzer
sho... | true | true |
f71dba64825ff9d2aecf0ac1d5279cb56a1da34d | 14,532 | py | Python | src/lstm/lstm_wp.py | kafkasl/contextualLSTM | a4421d592c3960c79842b0f23de162e61fcab3dd | [
"Apache-2.0"
] | 31 | 2017-08-21T11:39:30.000Z | 2020-09-02T03:55:54.000Z | src/lstm/lstm_wp.py | kafkasl/contextualLSTM | a4421d592c3960c79842b0f23de162e61fcab3dd | [
"Apache-2.0"
] | 2 | 2018-03-27T08:57:04.000Z | 2018-05-14T09:39:11.000Z | src/lstm/lstm_wp.py | kafkasl/contextualLSTM | a4421d592c3960c79842b0f23de162e61fcab3dd | [
"Apache-2.0"
] | 9 | 2017-07-02T15:17:43.000Z | 2020-05-30T08:11:36.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.273585 | 114 | 0.628475 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
sys.path.insert(0, "../src/")
import inspect
import time
import numpy as np
import tensorflow as tf
import reader_wp as reader
flags = tf.flags
logging = tf.logging
flags.DEFINE_s... | true | true |
f71dbae64f29e199ef282e3693547b0b41233811 | 2,952 | py | Python | pensetup.py | fazildgr8/virtual_pen_MNIST | 69055980ee0f0005766e62e3a1ca4e2a0259157c | [
"MIT"
] | 2 | 2020-07-03T23:52:45.000Z | 2021-03-10T07:49:08.000Z | pensetup.py | fazildgr8/virtual_pen_MNIST | 69055980ee0f0005766e62e3a1ca4e2a0259157c | [
"MIT"
] | null | null | null | pensetup.py | fazildgr8/virtual_pen_MNIST | 69055980ee0f0005766e62e3a1ca4e2a0259157c | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import time
# A required callback method that goes into the trackbar function.
def nothing(x):
pass
# Initializing the webcam feed.
cap = cv2.VideoCapture(0)
cap.set(3, 1280)
cap.set(4, 720)
# Create a window named trackbars.
cv2.namedWindow("Trackbars")
# Now c... | 32.8 | 74 | 0.647019 | import cv2
import numpy as np
import time
def nothing(x):
pass
cap = cv2.VideoCapture(0)
cap.set(3, 1280)
cap.set(4, 720)
cv2.namedWindow("Trackbars")
cv2.createTrackbar("L - H", "Trackbars", 0, 179, nothing)
cv2.createTrackbar("L - S", "Trackbars", 0, 255, nothing)
cv2.createTrackbar(... | true | true |
f71dbbae930412e85855a613c4fed7593eeb6d4f | 344 | py | Python | Task1F.py | reib2/Lab-3-Flood-Warning | 9f86b4b8a7fa9508ddaa0e9754d64ff6c4e38f66 | [
"MIT"
] | null | null | null | Task1F.py | reib2/Lab-3-Flood-Warning | 9f86b4b8a7fa9508ddaa0e9754d64ff6c4e38f66 | [
"MIT"
] | null | null | null | Task1F.py | reib2/Lab-3-Flood-Warning | 9f86b4b8a7fa9508ddaa0e9754d64ff6c4e38f66 | [
"MIT"
] | 1 | 2022-02-01T23:24:15.000Z | 2022-02-01T23:24:15.000Z |
from floodsystem import datafetcher
from floodsystem.station import MonitoringStation, inconsistent_typical_range_stations
from floodsystem.stationdata import build_station_list
stations = build_station_list() #builds list of stations
inconsistent_stations = inconsistent_typical_range_stations(stations)
print (in... | 24.571429 | 86 | 0.866279 |
from floodsystem import datafetcher
from floodsystem.station import MonitoringStation, inconsistent_typical_range_stations
from floodsystem.stationdata import build_station_list
stations = build_station_list()
inconsistent_stations = inconsistent_typical_range_stations(stations)
print (inconsistent_stations)
| true | true |
f71dbbef82f1b7c0963a75022302469ae15db6e7 | 11,435 | py | Python | book/_build/jupyter_execute/notebooks/high_energy_protons.py | AvijeetPrasad/laputas-blog | 27d969e341b1d264ef4fe3a334c775ce631ba2f1 | [
"BSD-3-Clause"
] | null | null | null | book/_build/jupyter_execute/notebooks/high_energy_protons.py | AvijeetPrasad/laputas-blog | 27d969e341b1d264ef4fe3a334c775ce631ba2f1 | [
"BSD-3-Clause"
] | null | null | null | book/_build/jupyter_execute/notebooks/high_energy_protons.py | AvijeetPrasad/laputas-blog | 27d969e341b1d264ef4fe3a334c775ce631ba2f1 | [
"BSD-3-Clause"
] | null | null | null | <a href="https://colab.research.google.com/github/AvijeetPrasad/laputas/blob/main/notebooks/high_energy_protons.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# High energy protons
## Summary
Protons have a rest mass equivalent to an energy of ar... | 39.843206 | 777 | 0.696895 | <a href="https://colab.research.google.com/github/AvijeetPrasad/laputas/blob/main/notebooks/high_energy_protons.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
have a rest mass equivalent to an energy of around 938 MeV. As the proton is accelerat... | false | true |
f71dbcac2d479aab6a392d579c8e4f997407c26f | 685 | py | Python | apis/alembic/versions/eab8d977bfb9_add_exception_in_trace_result.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 4 | 2021-07-15T15:59:01.000Z | 2022-02-24T02:58:52.000Z | apis/alembic/versions/eab8d977bfb9_add_exception_in_trace_result.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 4 | 2020-06-12T04:05:46.000Z | 2021-11-09T03:53:13.000Z | apis/alembic/versions/eab8d977bfb9_add_exception_in_trace_result.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 2 | 2020-09-29T05:39:28.000Z | 2021-11-26T09:52:17.000Z | """add_exception_in_trace_result
Revision ID: eab8d977bfb9
Revises: 06302deefc58
Create Date: 2021-08-26 02:10:55.283203
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'eab8d977bfb9'
down_revision = '06302deefc58'
branch_labels = None
depends_on = None
def u... | 23.62069 | 85 | 0.706569 | from alembic import op
import sqlalchemy as sa
revision = 'eab8d977bfb9'
down_revision = '06302deefc58'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f71dbd8e28eb5668c8b490e266f103d12edcb364 | 788 | py | Python | cursoemvideo/desafios/Desafio071.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | cursoemvideo/desafios/Desafio071.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | cursoemvideo/desafios/Desafio071.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | '''
Exercício Python 071: Crie um programa que simule o funcionamento de um caixa
eletrônico. No início, pergunte ao usuário qual será o valor a ser sacado
(número inteiro) e o programa vai informar quantas cédulas de cada valor
serão entregues.
'''
print('=' * 30)
print('{:^30}'.format('BANCO CEV'))
print('=' * 30)
... | 23.176471 | 77 | 0.559645 |
print('=' * 30)
print('{:^30}'.format('BANCO CEV'))
print('=' * 30)
saque = int(input('Que valor você quer sacar? R$ '))
total = saque
ced = 50
totalCed = 0
while True:
if total >= ced:
total -= ced
totalCed += 1
else:
if totalCed > 0:
print('Total de {} cédulas de R$ {}'.... | true | true |
f71dbe0266711d6c70cc1edf4795530136c40f52 | 4,922 | py | Python | Lib/test/test_hexoct.py | jasonadu/Python-2.5 | 93e24b88564de120b1296165b5c55975fdcb8a3c | [
"PSF-2.0"
] | 49 | 2015-03-10T17:34:19.000Z | 2021-11-10T22:23:18.000Z | Lib/test/test_hexoct.py | jasonadu/Python-2.5 | 93e24b88564de120b1296165b5c55975fdcb8a3c | [
"PSF-2.0"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/test/test_hexoct.py | jasonadu/Python-2.5 | 93e24b88564de120b1296165b5c55975fdcb8a3c | [
"PSF-2.0"
] | 32 | 2015-02-06T12:10:32.000Z | 2019-06-18T03:21:36.000Z | """Test correct treatment of hex/oct constants.
This is complex because of changes due to PEP 237.
"""
import sys
platform_long_is_32_bits = sys.maxint == 2147483647
import unittest
from test import test_support
import warnings
warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
... | 42.068376 | 80 | 0.656847 | """Test correct treatment of hex/oct constants.
This is complex because of changes due to PEP 237.
"""
import sys
platform_long_is_32_bits = sys.maxint == 2147483647
import unittest
from test import test_support
import warnings
warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
... | false | true |
f71dbea28c6bb0f66e8170b73a2d179586fc3668 | 8,203 | py | Python | sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import logging
import os
from typing import TYPE_CHECKING
from ..._constants import EnvironmentVariables
from ..._internal import get_default_authority, normalize_autho... | 55.802721 | 120 | 0.737413 |
import logging
import os
from typing import TYPE_CHECKING
from ..._constants import EnvironmentVariables
from ..._internal import get_default_authority, normalize_authority
from .azure_cli import AzureCliCredential
from .azure_powershell import AzurePowerShellCredential
from .chained import ChainedTokenCredential
... | true | true |
f71dbeb61268f52210ee67c77b92ed7020b4b55f | 1,515 | py | Python | neodroidagent/utilities/exploration/sampling/random_process/ornstein_uhlenbeck.py | gitter-badger/agent | 3f53eaa7ebdee3ab423c7b58785d584fe1a6ae11 | [
"Apache-2.0"
] | 8 | 2017-09-13T08:28:44.000Z | 2022-01-21T15:59:19.000Z | neodroidagent/utilities/exploration/sampling/random_process/ornstein_uhlenbeck.py | gitter-badger/agent | 3f53eaa7ebdee3ab423c7b58785d584fe1a6ae11 | [
"Apache-2.0"
] | 4 | 2019-03-22T13:49:16.000Z | 2019-03-25T13:49:39.000Z | neodroidagent/utilities/exploration/sampling/random_process/ornstein_uhlenbeck.py | gitter-badger/agent | 3f53eaa7ebdee3ab423c7b58785d584fe1a6ae11 | [
"Apache-2.0"
] | 3 | 2017-09-13T08:31:38.000Z | 2021-11-09T11:22:27.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .annealed_guassian import AnnealedGaussianProcess
__author__ = "Christian Heider Nielsen"
# Based on http://math.stackexchange.com/questions/1287634/implementing-ornstein-uhlenbeck-in-matlab
import numpy
__all__ = ["OrnsteinUhlenbeckProcess"]
class OrnsteinUhlenb... | 25.25 | 100 | 0.580858 |
from .annealed_guassian import AnnealedGaussianProcess
__author__ = "Christian Heider Nielsen"
import numpy
__all__ = ["OrnsteinUhlenbeckProcess"]
class OrnsteinUhlenbeckProcess(AnnealedGaussianProcess):
def __init__(
self,
*,
theta: float = 0.15,
mean: float = 0.0,
s... | true | true |
f71dbec8bab51add607111fbfb0eae639d16b61c | 3,039 | py | Python | Common/DataModel/Testing/Python/TestGetBounds.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 2 | 2021-07-07T22:53:19.000Z | 2021-07-31T19:29:35.000Z | Common/DataModel/Testing/Python/TestGetBounds.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 2 | 2020-11-18T16:50:34.000Z | 2022-01-21T13:31:47.000Z | Common/DataModel/Testing/Python/TestGetBounds.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 5 | 2020-10-02T10:14:35.000Z | 2022-03-10T07:50:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
import sys
# Test speed of compute bounds in vtkPolyData, vtkPoints, and
# vtkBoundingBox.
# Control model size
res = 500
timer = vtk.vtkTimerLog()
# Uncomment if you want to use as a little interactive program
#if len(sys.argv) >= 2 :
# res = int(sys.argv... | 26.198276 | 70 | 0.726226 |
import vtk
import sys
res = 500
timer = vtk.vtkTimerLog()
plane = vtk.vtkPlaneSource()
plane.SetResolution(res,res)
edges = vtk.vtkFeatureEdges()
edges.SetInputConnection(plane.GetOutputPort())
edges.BoundaryEdgesOn()
edges.ManifoldEdgesOff()
edges.NonManifoldEdgesOff()
edges.FeatureEdgesOff()
t1 = ... | true | true |
f71dc033893fb25f5c43d5040820941c39dbf11b | 1,244 | py | Python | labs/9/zstudentDAO.py | G00364778/52957_dataRepresentation | de5127573a5b717aa67105c3dbe5e1d98f601fca | [
"MIT"
] | null | null | null | labs/9/zstudentDAO.py | G00364778/52957_dataRepresentation | de5127573a5b717aa67105c3dbe5e1d98f601fca | [
"MIT"
] | null | null | null | labs/9/zstudentDAO.py | G00364778/52957_dataRepresentation | de5127573a5b717aa67105c3dbe5e1d98f601fca | [
"MIT"
] | null | null | null | import mysql.connector
class StudentDAO:
db=""
def __init__(self):
self.db = mysql.connector.connect(
host="localhost",
user="root",
password="root",
#user="datarep", # this is the user name on my mac
#passwd="password" # for my mac
database="datarep"
)
def create(self, values):
... | 24.392157 | 60 | 0.62701 | import mysql.connector
class StudentDAO:
db=""
def __init__(self):
self.db = mysql.connector.connect(
host="localhost",
user="root",
password="root",
te(self, values):
cursor = self.db.cursor()
sql="insert into student (name, age) values (%s,%s)"
cursor.execute(sql, values)
sel... | true | true |
f71dc07b7ca849d8293362b0077e6b64d15f8c1f | 4,544 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py | MalcolmScoffable/openapi-generator | 73605a0c0e0c825286c95123c63678ba75b44d5c | [
"Apache-2.0"
] | 4 | 2020-07-24T07:02:57.000Z | 2022-01-08T17:37:38.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py | MalcolmScoffable/openapi-generator | 73605a0c0e0c825286c95123c63678ba75b44d5c | [
"Apache-2.0"
] | 1 | 2020-05-13T10:37:01.000Z | 2020-05-14T16:30:33.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py | MalcolmScoffable/openapi-generator | 73605a0c0e0c825286c95123c63678ba75b44d5c | [
"Apache-2.0"
] | 2 | 2020-04-24T15:18:41.000Z | 2021-12-07T09:39:40.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 33.910448 | 174 | 0.610915 |
from __future__ import absolute_import
import re
import sys
import six
import nulltype
from petstore_api.model_utils import (
ModelComposed,
ModelNormal,
ModelSimple,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
class File(ModelN... | true | true |
f71dc0aed8b56c5bb977a643acc0af8621adeeeb | 1,551 | py | Python | chain_of_logic_advanced.py | rdmunden/logic_chain | c065525c0fff2ec655f7c7c1921881745f1ddd70 | [
"MIT"
] | null | null | null | chain_of_logic_advanced.py | rdmunden/logic_chain | c065525c0fff2ec655f7c7c1921881745f1ddd70 | [
"MIT"
] | null | null | null | chain_of_logic_advanced.py | rdmunden/logic_chain | c065525c0fff2ec655f7c7c1921881745f1ddd70 | [
"MIT"
] | null | null | null | """ generate random strings of logic
v2 - randomly adds 'not' before values
TODO: 1. add random parentheses, 2. add expressions like 'i==1' or 'print()' for values
TODO: Make it more explicit as to which True or False value it is evaluating to.
The cycle:
1. Start with a True
a. keep doing 'and Tru... | 29.264151 | 98 | 0.563507 | import random
def r2():
return random.randint(0, 1)
def r7():
return random.randint(0,6)
tv = true_values = ["'a'", "'b'", "'c'", "'d'", "'e'", "'f'", "'g'"]
fv = false_values = ["''", 0, (), [], {}, set(), None]
lv = logic_values = ['and', 'or']
nv = ['', 'not ']
vals = [tv, fv]
n = 5
cont = ''
while ... | true | true |
f71dc2088bad114f2855b10d70c2b7953a80f393 | 1,954 | py | Python | templatetags/distance_filters.py | redditnfl/draft-cards | 63779107a731ad741c8cf02b98a4b3d74cdcc3ac | [
"Apache-2.0",
"0BSD"
] | null | null | null | templatetags/distance_filters.py | redditnfl/draft-cards | 63779107a731ad741c8cf02b98a4b3d74cdcc3ac | [
"Apache-2.0",
"0BSD"
] | 10 | 2020-06-05T20:27:08.000Z | 2022-02-10T10:47:58.000Z | templatetags/distance_filters.py | redditnfl/draft-cards | 63779107a731ad741c8cf02b98a4b3d74cdcc3ac | [
"Apache-2.0",
"0BSD"
] | 1 | 2021-06-06T01:11:32.000Z | 2021-06-06T01:11:32.000Z | """
>>> set(filter(lambda t: t not in ('AFC', 'NFC'), nflteams.fullinfo.keys())) - set(team_locations.keys())
set()
>>> set(filter(lambda t: t not in ('AFC', 'NFC'), nflteams.fullinfo.keys())) == set(team_locations.keys())
True
"""
import geopy.distance
from django import template
from redditnfl.nfltools import nflteam... | 27.914286 | 159 | 0.631525 | import geopy.distance
from django import template
from redditnfl.nfltools import nflteams, sites
register = template.Library()
team_locations = {team['short']: sites.by_team(team['short'])[1][3] for team in filter(lambda t: t['short'] not in ('AFC', 'NFC'), nflteams.fullinfo.values())}
def distance(a, b):
return... | true | true |
f71dc2fc6add5b655d07736e36d9fcba57b81fe9 | 2,253 | py | Python | Tavan/kemija_SMyth.py | vedgar/ip | 5ed0773eea4243077f5defb77fb1839661308c83 | [
"Unlicense"
] | 5 | 2017-03-15T11:34:55.000Z | 2021-03-10T13:05:02.000Z | Tavan/kemija_SMyth.py | vedgar/ip | 5ed0773eea4243077f5defb77fb1839661308c83 | [
"Unlicense"
] | null | null | null | Tavan/kemija_SMyth.py | vedgar/ip | 5ed0773eea4243077f5defb77fb1839661308c83 | [
"Unlicense"
] | 14 | 2017-01-11T19:11:01.000Z | 2021-05-09T18:42:19.000Z | from pj import *
class KF(enum.Enum):
OTV, ZATV = '()'
class ATOM(Token):
def Mr(self, **atomi):
return pogledaj(atomi,self)
class BROJ(Token):
def vrijednost(self,**_):
return int(self.sadržaj)
class N(Token):
literal='n'
def vrijednost(self, **a... | 27.814815 | 65 | 0.541056 | from pj import *
class KF(enum.Enum):
OTV, ZATV = '()'
class ATOM(Token):
def Mr(self, **atomi):
return pogledaj(atomi,self)
class BROJ(Token):
def vrijednost(self,**_):
return int(self.sadržaj)
class N(Token):
literal='n'
def vrijednost(self, **a... | true | true |
f71dc35d8468a735ae390aa81a65c092ec43ba1e | 8,263 | py | Python | custom/icds_reports/utils/aggregation_helpers/monolith/awc_location.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | custom/icds_reports/utils/aggregation_helpers/monolith/awc_location.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | custom/icds_reports/utils/aggregation_helpers/monolith/awc_location.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
from six.moves import map
from corehq.apps.userreports.models import StaticDataSourceConfiguration, get_datasource_config
from corehq.apps.userreports.util import get_table_name
from custom.icds_reports.const import AWC_LOCATION_TABLE_ID, ... | 40.11165 | 109 | 0.588527 | from __future__ import absolute_import
from __future__ import unicode_literals
from six.moves import map
from corehq.apps.userreports.models import StaticDataSourceConfiguration, get_datasource_config
from corehq.apps.userreports.util import get_table_name
from custom.icds_reports.const import AWC_LOCATION_TABLE_ID, ... | true | true |
f71dc4758ddd251e1c752ee55a5decd14ff8c7c2 | 37 | py | Python | Extra/lamda.py | tanvinaminul/Python | dcd9ba615d4f841c0732e3bf0443f14865d95993 | [
"MIT"
] | null | null | null | Extra/lamda.py | tanvinaminul/Python | dcd9ba615d4f841c0732e3bf0443f14865d95993 | [
"MIT"
] | 1 | 2019-12-18T09:38:42.000Z | 2019-12-18T09:38:42.000Z | Extra/lamda.py | tanvinaminul/Python | dcd9ba615d4f841c0732e3bf0443f14865d95993 | [
"MIT"
] | null | null | null | sum= lambda a,b: a+b
print(sum(5,6))
| 12.333333 | 20 | 0.621622 | sum= lambda a,b: a+b
print(sum(5,6))
| true | true |
f71dc4cf4a2ee89c783f91b8af82794cd3767b90 | 50 | py | Python | app/schemas/__init__.py | i-gulyaev/receipt-bot | 262bc64c305443e23183eb65c337097f03db6c90 | [
"MIT"
] | null | null | null | app/schemas/__init__.py | i-gulyaev/receipt-bot | 262bc64c305443e23183eb65c337097f03db6c90 | [
"MIT"
] | null | null | null | app/schemas/__init__.py | i-gulyaev/receipt-bot | 262bc64c305443e23183eb65c337097f03db6c90 | [
"MIT"
] | null | null | null | from .receipt import Receipt, ReceiptItem # noqa
| 25 | 49 | 0.78 | from .receipt import Receipt, ReceiptItem
| true | true |
f71dc58fb506be3ca346fa50bd945777190d999f | 650 | py | Python | label_traincatset.py | diegulio/Breed_Recognition-to-Buscomiperro | 040ee45b9b5c355c3ec2c7413cd89a623024ad4e | [
"MIT"
] | null | null | null | label_traincatset.py | diegulio/Breed_Recognition-to-Buscomiperro | 040ee45b9b5c355c3ec2c7413cd89a623024ad4e | [
"MIT"
] | null | null | null | label_traincatset.py | diegulio/Breed_Recognition-to-Buscomiperro | 040ee45b9b5c355c3ec2c7413cd89a623024ad4e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""label_TrainCatSet.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1vDyBZ7Ql-8qQ3l7EWJB9TfnwGy66qGGn
"""
import pandas as pd
import os
import numpy as np
# Enlisto los nombres de las imagenes
imagenes = os.listdir('/con... | 23.214286 | 88 | 0.74 |
import pandas as pd
import os
import numpy as np
imagenes = os.listdir('/content/drive/MyDrive/Colab Data/Proyecto buscomiperro/gatos')
imagenes[:5]
def extract_ext(id):
return os.path.splitext(id)[0]
labels = list(map(extract_ext, imagenes))
df = pd.DataFrame()
df['id'] = labels
df['breed'] = 'gato'
df.to... | true | true |
f71dc67f643b30e6caced22a11e2cae608407e4e | 4,219 | py | Python | chainer/functions/activation/leaky_relu.py | higumachan/chainer | c9209a1099c9a2a5ecab2b28e1b008b19effa724 | [
"MIT"
] | null | null | null | chainer/functions/activation/leaky_relu.py | higumachan/chainer | c9209a1099c9a2a5ecab2b28e1b008b19effa724 | [
"MIT"
] | 2 | 2019-05-14T15:45:01.000Z | 2019-05-15T07:12:49.000Z | chainer/functions/activation/leaky_relu.py | higumachan/chainer | c9209a1099c9a2a5ecab2b28e1b008b19effa724 | [
"MIT"
] | null | null | null | from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function_node
from chainer.utils import type_check
_kern = None
def _get_kern():
global _kern
if _kern is None:
_kern = cuda.elementwise(
'T cond, T x, T slope', 'T y',
'y = cond >= 0 ?... | 26.872611 | 78 | 0.526428 | from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function_node
from chainer.utils import type_check
_kern = None
def _get_kern():
global _kern
if _kern is None:
_kern = cuda.elementwise(
'T cond, T x, T slope', 'T y',
'y = cond >= 0 ?... | true | true |
f71dc72de773fc61570b336f8a2d569a4007f69b | 6,784 | py | Python | robo/fmin/bayesian_optimization.py | lebrice/RoBO | 0cb58a1622d3a540f7714b239f0cedf048b6fd9f | [
"BSD-3-Clause"
] | null | null | null | robo/fmin/bayesian_optimization.py | lebrice/RoBO | 0cb58a1622d3a540f7714b239f0cedf048b6fd9f | [
"BSD-3-Clause"
] | null | null | null | robo/fmin/bayesian_optimization.py | lebrice/RoBO | 0cb58a1622d3a540f7714b239f0cedf048b6fd9f | [
"BSD-3-Clause"
] | null | null | null | import logging
import george
import numpy as np
import inspect
from pybnn import BaseModel
from pybnn.dngo import DNGO
from robo.priors.default_priors import DefaultPrior
from robo.models.base_model import BaseModel as BaseModel_
from robo.models.wrapper_bohamiann import WrapperBohamiann
from robo.models.gaussian_pro... | 38.11236 | 112 | 0.654039 | import logging
import george
import numpy as np
import inspect
from pybnn import BaseModel
from pybnn.dngo import DNGO
from robo.priors.default_priors import DefaultPrior
from robo.models.base_model import BaseModel as BaseModel_
from robo.models.wrapper_bohamiann import WrapperBohamiann
from robo.models.gaussian_pro... | true | true |
f71dc8aeb93f7835f2caaf5b59252fc6ba16d798 | 135 | py | Python | tests/fixtures/unused_import_comment_6.py | cdce8p/python-typing-update | 2ad78b9ce4b5e3d8e8ff5dd35474c8e214d69983 | [
"MIT"
] | 5 | 2021-03-17T16:12:09.000Z | 2021-09-12T22:19:51.000Z | tests/fixtures/unused_import_comment_6.py | cdce8p/python-typing-update | 2ad78b9ce4b5e3d8e8ff5dd35474c8e214d69983 | [
"MIT"
] | 10 | 2021-03-23T18:14:24.000Z | 2022-03-28T03:05:18.000Z | tests/fixtures/unused_import_comment_6.py | cdce8p/python-typing-update | 2ad78b9ce4b5e3d8e8ff5dd35474c8e214d69983 | [
"MIT"
] | 2 | 2021-03-20T08:47:52.000Z | 2021-06-07T04:02:02.000Z | """Test unused import retention."""
from logging import DEBUG # unused-import
from typing import Any, List
var1: List[str]
var2: Any
| 19.285714 | 42 | 0.740741 | from logging import DEBUG
from typing import Any, List
var1: List[str]
var2: Any
| true | true |
f71dc8f1ad707249189bd1d16a568bd6a4c983c1 | 1,981 | py | Python | src/fetch/playstore.py | adityabharti/fawkes | c1b298ea1f4b96c208e12448ddefe44259bc2316 | [
"MIT"
] | null | null | null | src/fetch/playstore.py | adityabharti/fawkes | c1b298ea1f4b96c208e12448ddefe44259bc2316 | [
"MIT"
] | null | null | null | src/fetch/playstore.py | adityabharti/fawkes | c1b298ea1f4b96c208e12448ddefe44259bc2316 | [
"MIT"
] | null | null | null | import requests
import json
import sys
import os
from pprint import pprint
# This is so that below import works
sys.path.append(os.path.realpath("."))
import src.utils.utils as utils
import src.constants as constants
def fetch(review_channel):
# Since searchman allows us to have limited credits, we iterate over... | 34.754386 | 120 | 0.612317 | import requests
import json
import sys
import os
from pprint import pprint
sys.path.append(os.path.realpath("."))
import src.utils.utils as utils
import src.constants as constants
def fetch(review_channel):
searchman_api_key_index = 0
params = {
"appId": review_channel.app_id,
"ap... | true | true |
f71dc914c70852e586f370a1875963cd13b5c4b7 | 393 | py | Python | project_plantware/warehouse/migrations/0009_auto_20200629_2114.py | naiem2525/plantware | 5d72989780ff39b59949dde649052d9d01729c86 | [
"bzip2-1.0.6"
] | null | null | null | project_plantware/warehouse/migrations/0009_auto_20200629_2114.py | naiem2525/plantware | 5d72989780ff39b59949dde649052d9d01729c86 | [
"bzip2-1.0.6"
] | null | null | null | project_plantware/warehouse/migrations/0009_auto_20200629_2114.py | naiem2525/plantware | 5d72989780ff39b59949dde649052d9d01729c86 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-29 15:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('warehouse', '0008_auto_20200629_2114'),
]
operations = [
migrations.AlterField(
model_name='order',
name='date_order... | 20.684211 | 50 | 0.605598 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('warehouse', '0008_auto_20200629_2114'),
]
operations = [
migrations.AlterField(
model_name='order',
name='date_ordered',
field=models.DateTimeField(nul... | true | true |
f71dc9e972b6d43146a206b01bacba1306097b59 | 81,265 | py | Python | discord/http.py | Icebluewolf/pycord | 91572a1440aecf0eb91b2249d960a9eba3f4ebec | [
"MIT"
] | null | null | null | discord/http.py | Icebluewolf/pycord | 91572a1440aecf0eb91b2249d960a9eba3f4ebec | [
"MIT"
] | null | null | null | discord/http.py | Icebluewolf/pycord | 91572a1440aecf0eb91b2249d960a9eba3f4ebec | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development
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 limit... | 32.821082 | 120 | 0.559897 |
from __future__ import annotations
import asyncio
import logging
import sys
import weakref
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Coroutine,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
Union,
)
from urllib.parse import quote as _uriqu... | true | true |
f71dc9f71695063532e9550c8b6ba76b48535559 | 698 | py | Python | alshamelah_api/apps/categories/migrations/0003_auto_20200622_1614.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | alshamelah_api/apps/categories/migrations/0003_auto_20200622_1614.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | alshamelah_api/apps/categories/migrations/0003_auto_20200622_1614.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-22 16:14
import apps.categories.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0002_auto_20200616_1853'),
]
operations = [
migrations.AddField(
model_name='categor... | 27.92 | 114 | 0.636103 |
import apps.categories.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0002_auto_20200616_1853'),
]
operations = [
migrations.AddField(
model_name='category',
name='image',
field... | true | true |
f71dca35de7fa623ae7ad9dcf06fb60056718130 | 181 | py | Python | Baekjoon/Python/1110.py | KHJcode/Algorithm-study | fa08d3c752fcb3557fd45fb394157926afc0de4a | [
"MIT"
] | 2 | 2020-05-23T01:55:38.000Z | 2020-07-07T15:59:00.000Z | Baekjoon/Python/1110.py | KHJcode/Algorithm-study | fa08d3c752fcb3557fd45fb394157926afc0de4a | [
"MIT"
] | null | null | null | Baekjoon/Python/1110.py | KHJcode/Algorithm-study | fa08d3c752fcb3557fd45fb394157926afc0de4a | [
"MIT"
] | null | null | null | n = int(input())
count = 1
_n = int(str(n % 10) + str((n // 10 + n % 10) % 10))
while _n != n:
count += 1
_n = int(str(_n % 10) + str((_n // 10 + _n % 10) % 10))
print(count)
| 18.1 | 57 | 0.475138 | n = int(input())
count = 1
_n = int(str(n % 10) + str((n // 10 + n % 10) % 10))
while _n != n:
count += 1
_n = int(str(_n % 10) + str((_n // 10 + _n % 10) % 10))
print(count)
| true | true |
f71dca38621e636c85ed737b16d0993b1b7ba0a7 | 1,592 | py | Python | session_server/servers/application.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | 1 | 2019-03-27T07:46:15.000Z | 2019-03-27T07:46:15.000Z | session_server/servers/application.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | null | null | null | session_server/servers/application.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | null | null | null | import json
from geventwebsocket import WebSocketApplication
from controllers.controller import Controller
from services.browserquest import BrowserQuestImpl
class BrowserQuestApplication(WebSocketApplication):
browserquest = BrowserQuestImpl()
def __init__(self, *args, **kwargs):
super(BrowserQuestAp... | 37.023256 | 82 | 0.670854 | import json
from geventwebsocket import WebSocketApplication
from controllers.controller import Controller
from services.browserquest import BrowserQuestImpl
class BrowserQuestApplication(WebSocketApplication):
browserquest = BrowserQuestImpl()
def __init__(self, *args, **kwargs):
super(BrowserQuestAp... | false | true |
f71dca3afc1566dc07ee04e455859bef0fa42f69 | 1,796 | py | Python | lwar_aws.py | mallarme/ArtWithDataCodes | bbda69f81385404fe838fdacb8730940b9318460 | [
"CC0-1.0"
] | 1 | 2021-06-24T22:18:27.000Z | 2021-06-24T22:18:27.000Z | lwar_aws.py | mallarme/ArtWithDataCodes | bbda69f81385404fe838fdacb8730940b9318460 | [
"CC0-1.0"
] | null | null | null | lwar_aws.py | mallarme/ArtWithDataCodes | bbda69f81385404fe838fdacb8730940b9318460 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# lwar_aws.py
#
# Copyright 2013 Leandro <Leandro@leandrowar>
# Fontes:
# http://aws.amazon.com/articles/Amazon-S3/3998
# http://boto.s3.amazonaws.com/s3_tut.html
#Imports
import boto.s3
from boto.s3.connection import S3Connection #para estabelecer a conexão
import s... | 27.630769 | 125 | 0.729399 |
import boto.s3
from boto.s3.connection import S3Connection
import sys
nection('aws access key','aws secret key')
print 'Conexao AWS estabelecida'
except:
print 'Erro na conexão AWS'
try:
bucket = conn.create_bucket('mi4i.files')
print
print 'Bucket mi4i.files criado com sucesso'
except:
print
p... | false | true |
f71dccac86bbe48329c6774ca48a06fd949d57f9 | 800 | py | Python | T1/code/visualizar_reta.py | andersonmanhaes/ml_mestrado | d737d80e07d9392895e4455e49a33b8700080cf1 | [
"MIT"
] | null | null | null | T1/code/visualizar_reta.py | andersonmanhaes/ml_mestrado | d737d80e07d9392895e4455e49a33b8700080cf1 | [
"MIT"
] | null | null | null | T1/code/visualizar_reta.py | andersonmanhaes/ml_mestrado | d737d80e07d9392895e4455e49a33b8700080cf1 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def plot(filepath, theta):
path = os.getcwd() + filepath
dataset = pd.read_csv(path, header=None)
X = dataset.iloc[:, 0:-1].values
y = dataset.iloc[:, -1:].values
t = np.arange(0, 25, 1)
plt.scatter(X, y, color=... | 27.586207 | 81 | 0.635 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def plot(filepath, theta):
path = os.getcwd() + filepath
dataset = pd.read_csv(path, header=None)
X = dataset.iloc[:, 0:-1].values
y = dataset.iloc[:, -1:].values
t = np.arange(0, 25, 1)
plt.scatter(X, y, color=... | true | true |
f71dce4d66492238ecef8f12ab4e49ea5128a5b0 | 42 | py | Python | app.py | abdala9512/gpt2-multip-app | fb827137dacfc065f8787592f699b056d50dac81 | [
"MIT"
] | null | null | null | app.py | abdala9512/gpt2-multip-app | fb827137dacfc065f8787592f699b056d50dac81 | [
"MIT"
] | null | null | null | app.py | abdala9512/gpt2-multip-app | fb827137dacfc065f8787592f699b056d50dac81 | [
"MIT"
] | null | null | null | import streamlit as st
st.title("GPT2 ") | 10.5 | 22 | 0.714286 | import streamlit as st
st.title("GPT2 ") | true | true |
f71dcf4492576871fadaaed3c2a40b7423af2970 | 2,393 | py | Python | txstatsd/stats/uniformsample.py | drawks/txstatsd | da674d7a86e0e5ec40eaa53fe81310ef19d1ed9e | [
"MIT"
] | null | null | null | txstatsd/stats/uniformsample.py | drawks/txstatsd | da674d7a86e0e5ec40eaa53fe81310ef19d1ed9e | [
"MIT"
] | 1 | 2020-07-10T23:35:49.000Z | 2020-07-10T23:35:49.000Z | txstatsd/stats/uniformsample.py | drawks/txstatsd | da674d7a86e0e5ec40eaa53fe81310ef19d1ed9e | [
"MIT"
] | 1 | 2020-07-13T05:31:58.000Z | 2020-07-13T05:31:58.000Z | # Copyright (C) 2011-2012 Canonical Services Ltd
#
# 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, ... | 35.716418 | 76 | 0.674885 |
import random
import sys
class UniformSample(object):
def __init__(self, reservoir_size):
self._values = [0 for i in range(reservoir_size)]
self._count = 0
self.clear()
self.maxint = getattr(sys, 'maxint', sys.maxsize)
def clear(self):
self._value... | true | true |
f71dcf5945851eb64bb226ac287f229197ca66fc | 1,067 | py | Python | setup.py | sayaHub/track-web | c7695978392a11e5fdbca15d2cafd493a5e7c2e9 | [
"CC0-1.0"
] | null | null | null | setup.py | sayaHub/track-web | c7695978392a11e5fdbca15d2cafd493a5e7c2e9 | [
"CC0-1.0"
] | null | null | null | setup.py | sayaHub/track-web | c7695978392a11e5fdbca15d2cafd493a5e7c2e9 | [
"CC0-1.0"
] | null | null | null | import setuptools
setuptools.setup(
name='track-web',
version='0.0.1',
long_description='',
author='GSA 18F, CDS-SNC',
author_email='pulse@cio.gov, cds-snc@tbs-sct.gc.ca',
url='https://github.com/cds-snc/track-web',
include_package_data=True,
packages=[
'track',
],
class... | 24.813953 | 56 | 0.497657 | import setuptools
setuptools.setup(
name='track-web',
version='0.0.1',
long_description='',
author='GSA 18F, CDS-SNC',
author_email='pulse@cio.gov, cds-snc@tbs-sct.gc.ca',
url='https://github.com/cds-snc/track-web',
include_package_data=True,
packages=[
'track',
],
class... | true | true |
f71dcf7616818d83e932104ad923982909610c0a | 8,300 | py | Python | simbad/rotsearch/phaser_rotation_search.py | hlasimpk/SIMBAD | 684de027f25fe63e8d973e494b0adf74db08cd89 | [
"BSD-3-Clause"
] | null | null | null | simbad/rotsearch/phaser_rotation_search.py | hlasimpk/SIMBAD | 684de027f25fe63e8d973e494b0adf74db08cd89 | [
"BSD-3-Clause"
] | null | null | null | simbad/rotsearch/phaser_rotation_search.py | hlasimpk/SIMBAD | 684de027f25fe63e8d973e494b0adf74db08cd89 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env ccp4-python
"""Module to run phaser rotation search on a model"""
__author__ = "Adam Simpkin"
__date__ = "12 April 2018"
__version__ = "1.0"
import os
from phaser import InputMR_DAT, runMR_DAT, InputMR_FRF, runMR_FRF
class Phaser(object):
"""Class to run PHASER
Attributes
----------
... | 30.514706 | 120 | 0.577952 |
__author__ = "Adam Simpkin"
__date__ = "12 April 2018"
__version__ = "1.0"
import os
from phaser import InputMR_DAT, runMR_DAT, InputMR_FRF, runMR_FRF
class Phaser(object):
def __init__(self, hklin, f, i, logfile, nmol, pdbin, sigf, sigi, solvent, timeout, work_dir, hires, eid):
self._f = None
... | true | true |
f71dcf8a96a9d2305374385e55f241406bbc3021 | 16,043 | py | Python | main_imp_visda.py | eyov7/CV_LTH_Pre-training-LLNL | bb18ba2093328aeb4e5ab3929f2749264ef3c981 | [
"MIT"
] | 47 | 2020-12-15T03:40:50.000Z | 2022-03-30T03:38:29.000Z | main_imp_visda.py | eyov7/CV_LTH_Pre-training-LLNL | bb18ba2093328aeb4e5ab3929f2749264ef3c981 | [
"MIT"
] | null | null | null | main_imp_visda.py | eyov7/CV_LTH_Pre-training-LLNL | bb18ba2093328aeb4e5ab3929f2749264ef3c981 | [
"MIT"
] | 10 | 2021-03-17T01:28:57.000Z | 2022-02-24T20:23:57.000Z | import argparse
import os
import random
import shutil
import time
import warnings
import copy
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
... | 36.627854 | 111 | 0.59808 | import argparse
import os
import random
import shutil
import time
import warnings
import copy
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
... | true | true |
f71dd03a0673407f061dc6e0310f017e116e67c7 | 22,135 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.476744 | 232 | 0.680416 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f71dd3ed81987c22b8b1889c1956daf31f9b46b1 | 275 | py | Python | electrum_blk/plugins/labels/cmdline.py | nedcloud-blackchain/electrum-blk | bf1992ecac9fffcc52e229e249da400b8751324e | [
"MIT"
] | 2 | 2022-03-09T18:21:02.000Z | 2022-03-13T13:27:07.000Z | electrum_blk/plugins/labels/cmdline.py | nedcloud-blackchain/electrum-blk | bf1992ecac9fffcc52e229e249da400b8751324e | [
"MIT"
] | null | null | null | electrum_blk/plugins/labels/cmdline.py | nedcloud-blackchain/electrum-blk | bf1992ecac9fffcc52e229e249da400b8751324e | [
"MIT"
] | 1 | 2022-02-21T07:38:29.000Z | 2022-02-21T07:38:29.000Z | from .labels import LabelsPlugin
from electrum_blk.plugin import hook
class Plugin(LabelsPlugin):
@hook
def load_wallet(self, wallet, window):
self.start_wallet(wallet)
def on_pulled(self, wallet):
self.logger.info('labels pulled from server')
| 22.916667 | 53 | 0.716364 | from .labels import LabelsPlugin
from electrum_blk.plugin import hook
class Plugin(LabelsPlugin):
@hook
def load_wallet(self, wallet, window):
self.start_wallet(wallet)
def on_pulled(self, wallet):
self.logger.info('labels pulled from server')
| true | true |
f71dd4587a751d52ef0eae8febb345a0a7c738b5 | 2,851 | py | Python | test/test_series_actors_data.py | h3llrais3r/tvdbapi-v2-client | 1210df9dd5869ccc5b63149b1b80630310a14f40 | [
"MIT"
] | 2 | 2021-01-24T07:45:22.000Z | 2021-11-15T11:29:25.000Z | test/test_series_actors_data.py | h3llrais3r/tvdb_api_v2 | 1210df9dd5869ccc5b63149b1b80630310a14f40 | [
"MIT"
] | null | null | null | test/test_series_actors_data.py | h3llrais3r/tvdb_api_v2 | 1210df9dd5869ccc5b63149b1b80630310a14f40 | [
"MIT"
] | 1 | 2020-05-07T10:16:15.000Z | 2020-05-07T10:16:15.000Z | # coding: utf-8
"""
TheTVDB API v2
API v3 targets v2 functionality with a few minor additions. The API is accessible via https://api.thetvdb.com and provides the following REST endpoints in JSON format. How to use this API documentation ---------------- You may browse the API routes without authentication... | 69.536585 | 2,040 | 0.730972 |
from __future__ import absolute_import
import unittest
import tvdb_api
from tvdb_api.models.series_actors_data import SeriesActorsData
from tvdb_api.rest import ApiException
class TestSeriesActorsData(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testSer... | true | true |
f71dd4f671262d90856ccf1d5b3556ce316e02a9 | 4,928 | py | Python | eda.py | Lim-Guowei/RUL | e23e97a373df73abc2fde14ce070dcb5230a79c2 | [
"MIT"
] | null | null | null | eda.py | Lim-Guowei/RUL | e23e97a373df73abc2fde14ce070dcb5230a79c2 | [
"MIT"
] | null | null | null | eda.py | Lim-Guowei/RUL | e23e97a373df73abc2fde14ce070dcb5230a79c2 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from dataloader import dataloader
import seaborn as sns
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
pd.set_option('display.float_format', '{:.6f}'.format)
def countNullPercent(... | 37.618321 | 185 | 0.654424 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from dataloader import dataloader
import seaborn as sns
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
pd.set_option('display.float_format', '{:.6f}'.format)
def countNullPercent(... | true | true |
f71dd531b8bf168b0db051cb85560196dc6c3184 | 749 | py | Python | jakso_ml/training_data/rotator.py | JaksoSoftware/jakso-ml | 5720ea557ca2fcf9ae16e329c198acd8e31258c4 | [
"MIT"
] | null | null | null | jakso_ml/training_data/rotator.py | JaksoSoftware/jakso-ml | 5720ea557ca2fcf9ae16e329c198acd8e31258c4 | [
"MIT"
] | 3 | 2020-09-25T18:40:52.000Z | 2021-08-25T14:44:30.000Z | jakso_ml/training_data/rotator.py | JaksoSoftware/jakso-ml | 5720ea557ca2fcf9ae16e329c198acd8e31258c4 | [
"MIT"
] | null | null | null | import random, copy
import cv2 as cv
from .augmenter import Augmenter
class Rotator(Augmenter):
'''
Augmenter that rotates the SampleImages randomly based on
the min_angle and max_angle parameters.
'''
def __init__(
self,
min_angle,
max_angle,
**kwargs
):
super().__init__(**kwargs)
... | 23.40625 | 73 | 0.706275 | import random, copy
import cv2 as cv
from .augmenter import Augmenter
class Rotator(Augmenter):
def __init__(
self,
min_angle,
max_angle,
**kwargs
):
super().__init__(**kwargs)
self.min_angle = min_angle
self.max_angle = max_angle
def augment(self, sample):
im_h, im_w, _ = samp... | true | true |
f71dd53fcf4343cdc5ff6b6b84e0462547c02cfd | 3,842 | py | Python | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_dump/Opengauss_Function_Tools_gs_dump_Case0043.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_dump/Opengauss_Function_Tools_gs_dump_Case0043.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_dump/Opengauss_Function_Tools_gs_dump_Case0043.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 35.247706 | 84 | 0.560906 |
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
LOG = Logger()
class Tools(unittest.TestCase):
def setUp(self):
LOG.info('-----Opengauss_Function_Tools_gs_dump_Case0043start-----')
self.dbu... | true | true |
f71dd542810c26c05012c9e34bb38d5dd0fcedfb | 1,639 | py | Python | pytopojson/bbox.py | fferrin/pytopojson | 5128136c9502f4e29330b6cc7e524641bff5f95e | [
"0BSD"
] | 11 | 2019-11-15T23:22:52.000Z | 2022-01-22T20:46:30.000Z | pytopojson/bbox.py | fferrin/topojson | 7f90e497d2b54798f51480181c81c330770cb401 | [
"0BSD"
] | 8 | 2019-11-08T03:03:29.000Z | 2022-02-28T09:52:09.000Z | pytopojson/bbox.py | fferrin/topojson | 7f90e497d2b54798f51480181c81c330770cb401 | [
"0BSD"
] | 2 | 2020-07-09T06:45:31.000Z | 2021-03-22T13:38:35.000Z | import math
from pytopojson import transform
class BBox(object):
def __init__(self):
self.transform = transform.Transform()
self.x_0 = math.inf
self.y_0 = self.x_0
self.x_1 = -self.x_0
self.y_1 = -self.x_0
self.t = None
def __call__(self, topology, *args, **kw... | 27.779661 | 64 | 0.456986 | import math
from pytopojson import transform
class BBox(object):
def __init__(self):
self.transform = transform.Transform()
self.x_0 = math.inf
self.y_0 = self.x_0
self.x_1 = -self.x_0
self.y_1 = -self.x_0
self.t = None
def __call__(self, topology, *args, **kw... | true | true |
f71dd7ce45e25814001cfdf02ef0e387adca4efa | 3,542 | py | Python | Tools/fastlane-templates.py | fredyshox/AppVideoFramer | 0e43f2828d2e3737451a0cf1ec81e6840796ac30 | [
"MIT"
] | 12 | 2020-08-18T16:47:35.000Z | 2021-07-26T20:05:30.000Z | Tools/fastlane-templates.py | fredyshox/ScreenFramer | 0e43f2828d2e3737451a0cf1ec81e6840796ac30 | [
"MIT"
] | 5 | 2020-08-18T13:50:39.000Z | 2020-08-31T12:41:34.000Z | Tools/fastlane-templates.py | fredyshox/AppVideoFramer | 0e43f2828d2e3737451a0cf1ec81e6840796ac30 | [
"MIT"
] | 1 | 2021-05-30T23:28:04.000Z | 2021-05-30T23:28:04.000Z | #!/usr/bin/env python3
#
# Retrieve templates from fastlane/frameit
#
import sys
import os
from os import path
from shutil import copyfile
from tempfile import gettempdir
import re
import json
import cv2
import numpy as np
from common import sanitize_color, sanitize_device_name, sanitize_device_key, apply_default_co... | 35.069307 | 137 | 0.647374 |
import sys
import os
from os import path
from shutil import copyfile
from tempfile import gettempdir
import re
import json
import cv2
import numpy as np
from common import sanitize_color, sanitize_device_name, sanitize_device_key, apply_default_color
FRAMEIT_URL = "https://github.com/fastlane/frameit-frames/arc... | true | true |
f71dd880479fc3a2e03b6a863aeaab5e3797cfb7 | 3,752 | py | Python | function/python/brightics/function/transform/sql/functions.py | data-weirdo/studio | 48852c4f097f773ce3d408b59f79fda2e2d60470 | [
"Apache-2.0"
] | 1 | 2020-02-08T10:56:29.000Z | 2020-02-08T10:56:29.000Z | function/python/brightics/function/transform/sql/functions.py | data-weirdo/studio | 48852c4f097f773ce3d408b59f79fda2e2d60470 | [
"Apache-2.0"
] | null | null | null | function/python/brightics/function/transform/sql/functions.py | data-weirdo/studio | 48852c4f097f773ce3d408b59f79fda2e2d60470 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 Samsung SDS
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 ... | 24.847682 | 100 | 0.647122 |
import dateutil.parser
import numpy as np
from .serializer import _serialize
from .serializer import _deserialize
import re
def e():
return np.math.e
def pi():
return np.math.pi
log = lambda _: np.math.log(_) if _ is not None else np.math.nan
ln = lambda _: np.math.log(_)
log10 = lambda _: np.math.lo... | true | true |
f71dd987760395589e47df40ff7fd75a85d357db | 1,193 | py | Python | google/ads/googleads/v4/enums/types/conversion_action_status.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/enums/types/conversion_action_status.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/enums/types/conversion_action_status.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 27.744186 | 74 | 0.706622 |
import proto
__protobuf__ = proto.module(
package="google.ads.googleads.v4.enums",
marshal="google.ads.googleads.v4",
manifest={"ConversionActionStatusEnum",},
)
class ConversionActionStatusEnum(proto.Message):
class ConversionActionStatus(proto.Enum):
UNSPECIFIED = 0
... | true | true |
f71ddabf07aa34298f199ac2facae47343cbce6a | 345 | py | Python | build_pipeline/helper/deploy_package/prod.py | jakob-bagterp/timer-for-python | a48b60c8782bbf6d368d6ca2be249054c3b66c21 | [
"MIT"
] | 2 | 2022-03-22T11:14:37.000Z | 2022-03-24T14:27:13.000Z | build_pipeline/helper/deploy_package/prod.py | jakob-bagterp/timer-for-python | a48b60c8782bbf6d368d6ca2be249054c3b66c21 | [
"MIT"
] | null | null | null | build_pipeline/helper/deploy_package/prod.py | jakob-bagterp/timer-for-python | a48b60c8782bbf6d368d6ca2be249054c3b66c21 | [
"MIT"
] | null | null | null | import subprocess
from config.directory import temp_builds
from .. import directory, output_release_file_checksum
def deploy_to_pypi() -> None:
directory.working.set_as_project_base_path()
subprocess.call(f"twine upload {temp_builds()}/*".split())
if __name__ == "__main__":
output_release_file_checksu... | 21.5625 | 62 | 0.75942 | import subprocess
from config.directory import temp_builds
from .. import directory, output_release_file_checksum
def deploy_to_pypi() -> None:
directory.working.set_as_project_base_path()
subprocess.call(f"twine upload {temp_builds()}/*".split())
if __name__ == "__main__":
output_release_file_checksu... | true | true |
f71ddae2c09cec47581d29a64a4e332b9bc0aebc | 2,584 | py | Python | tensorboard/context_test.py | karthikv2k/tensorboard | b39f7bbe6e85e543703e7901914ae51ab4cd51a6 | [
"Apache-2.0"
] | null | null | null | tensorboard/context_test.py | karthikv2k/tensorboard | b39f7bbe6e85e543703e7901914ae51ab4cd51a6 | [
"Apache-2.0"
] | null | null | null | tensorboard/context_test.py | karthikv2k/tensorboard | b39f7bbe6e85e543703e7901914ae51ab4cd51a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38 | 80 | 0.676471 |
import ipaddress
from tensorboard import auth as auth_lib
from tensorboard import context
from tensorboard import test as tb_test
REMOTE_IP = ipaddress.ip_address("192.168.0.1")
X_FORWARDED_FOR_IPS = (ipaddress.ip_address("2001:db8::"), REMOTE_IP)
class RequestContextTest(tb_test.TestCase):
def t... | true | true |
f71ddae2ee593ca6c94ea0a73bcdf57cb6e92fad | 10,955 | py | Python | docs/source/conf.py | florianeinfalt/nodegraph | fa117f069bd618d5aa98dfc62f3ce88acc5c77b2 | [
"Apache-2.0"
] | 1 | 2018-07-10T09:29:04.000Z | 2018-07-10T09:29:04.000Z | docs/source/conf.py | florianeinfalt/nodegraph | fa117f069bd618d5aa98dfc62f3ce88acc5c77b2 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | florianeinfalt/nodegraph | fa117f069bd618d5aa98dfc62f3ce88acc5c77b2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# nodegraph documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 9 15:53:41 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | 28.089744 | 80 | 0.695938 |
import os
import sys
import sphinx_rtd_theme
import nodegraph
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.todo'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc... | true | true |
f71ddbd8e3d55f90309e11e110629a667ccd0405 | 2,563 | py | Python | src/compas_rhino/artists/frameartist.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas_rhino/artists/frameartist.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas_rhino/artists/frameartist.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_rhino
from compas.artists import PrimitiveArtist
from .artist import RhinoArtist
class FrameArtist(RhinoArtist, PrimitiveArtist):
"""Artist for drawing frames.
Parameters
----------... | 35.597222 | 93 | 0.612563 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_rhino
from compas.artists import PrimitiveArtist
from .artist import RhinoArtist
class FrameArtist(RhinoArtist, PrimitiveArtist):
def __init__(self, frame, layer=None, scale=1.0, **kwargs):... | true | true |
f71ddc0e02a6d23f3d920561d4cf0c1eb6183b58 | 512 | py | Python | satchmo/apps/shipping/fields.py | jtslade/satchmo-svn | a9d791342ac6c5712de55c26ea4780057e27d452 | [
"BSD-3-Clause"
] | 1 | 2016-05-09T08:15:33.000Z | 2016-05-09T08:15:33.000Z | satchmo/apps/shipping/fields.py | jtslade/satchmo-svn | a9d791342ac6c5712de55c26ea4780057e27d452 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/shipping/fields.py | jtslade/satchmo-svn | a9d791342ac6c5712de55c26ea4780057e27d452 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from livesettings import config_value_safe
def shipping_choices():
try:
return config_choice_values('SHIPPING','MODULES')
except SettingNotSet:
return ()
class ShippingChoiceCharField(models.CharField):
def __init__(self, choices="__DYNAMIC__", *args,... | 28.444444 | 70 | 0.65625 | from django.db import models
from livesettings import config_value_safe
def shipping_choices():
try:
return config_choice_values('SHIPPING','MODULES')
except SettingNotSet:
return ()
class ShippingChoiceCharField(models.CharField):
def __init__(self, choices="__DYNAMIC__", *args,... | true | true |
f71ddc2bacfa536b1875d263aee5e37ce9195687 | 513 | py | Python | setup.py | IamGianluca/algorithms_collection | 59fd2052ecdcb687a61bcdf71d571624adc7b6a2 | [
"MIT"
] | 1 | 2019-09-11T03:22:55.000Z | 2019-09-11T03:22:55.000Z | setup.py | IamGianluca/algorithms | 59fd2052ecdcb687a61bcdf71d571624adc7b6a2 | [
"MIT"
] | null | null | null | setup.py | IamGianluca/algorithms | 59fd2052ecdcb687a61bcdf71d571624adc7b6a2 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='ml',
version='0.0.1',... | 30.176471 | 103 | 0.74269 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='ml',
version='0.0.1',
description='Collection of Computer Scienc... | true | true |
f71ddc7950645157e3e41984310acbbb20ea68f5 | 211 | py | Python | 3_1_default_param.py | TechOpsX/python-function | 801009a34e1e82d683d81dcab8c824d6b476ac78 | [
"Apache-2.0"
] | null | null | null | 3_1_default_param.py | TechOpsX/python-function | 801009a34e1e82d683d81dcab8c824d6b476ac78 | [
"Apache-2.0"
] | null | null | null | 3_1_default_param.py | TechOpsX/python-function | 801009a34e1e82d683d81dcab8c824d6b476ac78 | [
"Apache-2.0"
] | null | null | null | def default_param_func(a, b=1):
"""
默认参数必须在参数后面,如default_param_func(a=1, b)是错误的
"""
return a + b
if __name__ == '__main__':
print(default_param_func(1))
print(default_param_func(1, 2))
| 19.181818 | 47 | 0.64455 | def default_param_func(a, b=1):
return a + b
if __name__ == '__main__':
print(default_param_func(1))
print(default_param_func(1, 2))
| true | true |
f71de02ccb3a1c60d7dca33608c48ee41bdab885 | 6,802 | py | Python | UnitTest/lib/googletest/test/googletest-list-tests-unittest.py | SFCMM/LBM | 99bf39e177cb0af94d4073ee9f9aef2e52ba7851 | [
"BSD-3-Clause"
] | 8 | 2020-09-29T06:12:44.000Z | 2021-11-15T08:02:14.000Z | UnitTest/lib/googletest/test/googletest-list-tests-unittest.py | SFCMM/LBM | 99bf39e177cb0af94d4073ee9f9aef2e52ba7851 | [
"BSD-3-Clause"
] | 2 | 2020-10-14T21:49:46.000Z | 2020-10-21T17:12:37.000Z | UnitTest/lib/googletest/test/googletest-list-tests-unittest.py | SFCMM/LBM | 99bf39e177cb0af94d4073ee9f9aef2e52ba7851 | [
"BSD-3-Clause"
] | 2 | 2020-10-14T20:19:11.000Z | 2021-11-15T08:02:14.000Z | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 32.859903 | 85 | 0.650103 |
import re
import gtest_test_utils
LIST_TESTS_FLAG = 'gtest_list_tests'
EXE_PATH = gtest_test_utils.GetTestExecutablePath('googletest-list-tests-unittest_')
EXPECTED_OUTPUT_NO_FILTER_RE = re.compile(r"""FooDeathTest\.
Test1
Foo\.
Bar1
Bar2
DISABLED_Bar3
Abc\.
Xyz
Def
... | true | true |
f71de04a638f2ef61da4c6446ecc8a7c3dc8fac9 | 20,164 | py | Python | qtgui/adapter.py | Petr-By/qtpyvis | 0b9a151ee6b9a56b486c2bece9c1f03414629efc | [
"MIT"
] | 3 | 2017-10-04T14:51:26.000Z | 2017-10-22T09:35:50.000Z | qtgui/adapter.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | 13 | 2017-09-05T12:56:11.000Z | 2017-11-22T10:38:27.000Z | qtgui/adapter.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | 2 | 2017-09-24T21:39:42.000Z | 2017-10-04T15:29:54.000Z | """This module provides different adapter classes that allow
for a smoother combination of Qt and the Deep Learning ToolBox.
"""
# standard imports
from typing import Iterator, Iterable, Any, Callable
import logging
# Qt imports
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeyEvent
from PyQt5.QtWidgets impor... | 34.586621 | 79 | 0.598592 |
from typing import Iterator, Iterable, Any, Callable
import logging
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeyEvent
from PyQt5.QtWidgets import QComboBox, QListWidget, QListWidgetItem
from .utils import qtName, protect, QDebug
LOG = logging.getLogger(__name__)
class ItemAdapter(QDebug):
_it... | true | true |
f71de07e71e77d9a9f6bff724a046d4846818c02 | 335 | py | Python | exercise040.py | AlissonRaphael/python_exercises | 3f1185c4f2fff24c9fa2ffd6b60f90599044c985 | [
"MIT"
] | null | null | null | exercise040.py | AlissonRaphael/python_exercises | 3f1185c4f2fff24c9fa2ffd6b60f90599044c985 | [
"MIT"
] | null | null | null | exercise040.py | AlissonRaphael/python_exercises | 3f1185c4f2fff24c9fa2ffd6b60f90599044c985 | [
"MIT"
] | null | null | null | nota1 = float(input('Digite a primeira nota: '))
nota2 = float(input('Digite a segunda nota: '))
media = (nota1+nota2)/2
if media >= 7:
print('Aprovado! Com média {:.2f}'.format(media))
elif media >= 5 and media < 7:
print('Recuperação! Com média {:.2f}'.format(media))
else:
print('Reprovado! Com média {:.2f}'.... | 27.916667 | 54 | 0.656716 | nota1 = float(input('Digite a primeira nota: '))
nota2 = float(input('Digite a segunda nota: '))
media = (nota1+nota2)/2
if media >= 7:
print('Aprovado! Com média {:.2f}'.format(media))
elif media >= 5 and media < 7:
print('Recuperação! Com média {:.2f}'.format(media))
else:
print('Reprovado! Com média {:.2f}'.... | true | true |
f71de104313a62da31007f789cf4632dbe18de9f | 2,592 | py | Python | bookscrape/crawl/exporters.py | clemfromspace/pybook | ed16c24a3d1caeab07b5111812c8eb07ba598b8a | [
"WTFPL"
] | 12 | 2018-01-20T06:17:46.000Z | 2022-02-01T02:04:07.000Z | bookscrape/crawl/exporters.py | clemfromspace/pybook | ed16c24a3d1caeab07b5111812c8eb07ba598b8a | [
"WTFPL"
] | 6 | 2021-03-18T20:40:35.000Z | 2022-03-11T23:26:11.000Z | bookscrape/crawl/exporters.py | clemfromspace/pybook | ed16c24a3d1caeab07b5111812c8eb07ba598b8a | [
"WTFPL"
] | 1 | 2020-06-02T18:16:12.000Z | 2020-06-02T18:16:12.000Z | """This module contains the exporters for the ``pybook`` package"""
import os
from operator import itemgetter
from scrapy.exporters import BaseItemExporter
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Image, PageBreak
from reportlab.lib.units import inch
from bookscra... | 27.574468 | 78 | 0.576389 |
import os
from operator import itemgetter
from scrapy.exporters import BaseItemExporter
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Image, PageBreak
from reportlab.lib.units import inch
from bookscrape.exceptions import BookScrapeException
from bookscrape.loggers imp... | true | true |
f71de157a79c0a64ecb3c949cd0249af54a78055 | 975 | py | Python | lib/surface/compute/disks/list.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/disks/list.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/disks/list.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | 2 | 2020-11-04T03:08:21.000Z | 2020-11-05T08:14:41.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 31.451613 | 74 | 0.761026 |
from googlecloudsdk.api_lib.compute import base_classes
class List(base_classes.ZonalLister):
@property
def service(self):
return self.compute.disks
@property
def resource_type(self):
return 'disks'
List.detailed_help = base_classes.GetZonalListerHelp('disks')
| true | true |
f71de17ca6b42fb38fd37ba479f167cdd9b0ea24 | 491 | py | Python | src/utils/plot.py | FedericoBottoni/household-poverty-classifier | 7357cc6a6c08e9cf76cdd79a04cce32a5982fa85 | [
"MIT"
] | null | null | null | src/utils/plot.py | FedericoBottoni/household-poverty-classifier | 7357cc6a6c08e9cf76cdd79a04cce32a5982fa85 | [
"MIT"
] | null | null | null | src/utils/plot.py | FedericoBottoni/household-poverty-classifier | 7357cc6a6c08e9cf76cdd79a04cce32a5982fa85 | [
"MIT"
] | null | null | null | #import numpy as np
#import pandas as pd
#import seaborn as sns
#import matplotlib
#%matplotlib inline
def plot_history(network_history, n_epochs):
print('Plot is not implemented yet')
#matplotlib.use('agg')
#import matplotlib.pyplot as plt
#df = pd.DataFrame(dict(time=np.arange(n_epochs), value=[netwo... | 37.769231 | 132 | 0.723014 |
def plot_history(network_history, n_epochs):
print('Plot is not implemented yet')
| true | true |
f71de1c85888c25420aa564e28401bc39d740e2c | 2,650 | py | Python | easy_db/util.py | kpence/easy_db | fbe4c22a79336ec08980221405aca5c65bf02caf | [
"MIT"
] | null | null | null | easy_db/util.py | kpence/easy_db | fbe4c22a79336ec08980221405aca5c65bf02caf | [
"MIT"
] | null | null | null | easy_db/util.py | kpence/easy_db | fbe4c22a79336ec08980221405aca5c65bf02caf | [
"MIT"
] | null | null | null | '''
Utility functions for easy_db.
'''
import os
import sqlite3, pyodbc
from typing import List, Dict, Any
def check_if_file_is_sqlite(filename: str) -> bool:
'''
Check if file is a sqlite database.
See: https://stackoverflow.com/questions/12932607/how-to-check-if-a-sqlite3-database-exists-in-python
... | 33.974359 | 122 | 0.619623 | import os
import sqlite3, pyodbc
from typing import List, Dict, Any
def check_if_file_is_sqlite(filename: str) -> bool:
if not os.path.isfile(filename):
return False
if os.path.getsize(filename) < 100:
return False
with open(filename, 'rb') as possible_db_file:
header = possib... | true | true |
f71de2d3873a87c6a6788a7e0c239ea5018a0dee | 63 | py | Python | tests/__init__.py | andrewm4894/am4894pd | 7397abe0e1a0c1dee049c63c6d987eb62cf01e31 | [
"MIT"
] | null | null | null | tests/__init__.py | andrewm4894/am4894pd | 7397abe0e1a0c1dee049c63c6d987eb62cf01e31 | [
"MIT"
] | 215 | 2019-11-24T09:41:01.000Z | 2022-03-31T15:26:02.000Z | tests/__init__.py | andrewm4894/am4894pd | 7397abe0e1a0c1dee049c63c6d987eb62cf01e31 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Unit test package for am4894pd."""
| 15.75 | 37 | 0.571429 | true | true | |
f71de2d79d4e6a915befd82063e26f672dc6f81a | 2,056 | py | Python | autovideo/augmentation/color/UniformColorQuantizationToNBits_primitive.py | wanghaisheng/autovideo | ca6c05e522f6ea8cb2043a60195769f3906a3a19 | [
"MIT"
] | 4 | 2021-11-01T15:33:03.000Z | 2022-02-10T10:37:56.000Z | autovideo/augmentation/color/UniformColorQuantizationToNBits_primitive.py | wanghaisheng/autovideo | ca6c05e522f6ea8cb2043a60195769f3906a3a19 | [
"MIT"
] | 2 | 2021-11-08T05:09:00.000Z | 2022-03-08T20:42:02.000Z | autovideo/augmentation/color/UniformColorQuantizationToNBits_primitive.py | wanghaisheng/autovideo | ca6c05e522f6ea8cb2043a60195769f3906a3a19 | [
"MIT"
] | 2 | 2022-02-28T10:03:14.000Z | 2022-03-23T09:00:06.000Z | '''
Copyright 2021 D3M Team
Copyright (c) 2021 DATA Lab at Texas A&M University
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 ap... | 34.266667 | 100 | 0.754377 |
from d3m import container
from d3m.metadata import hyperparams
import imgaug.augmenters as iaa
import typing
from autovideo.utils import construct_primitive_metadata
from autovideo.base.augmentation_base import AugmentationPrimitiveBase
__all__ = ('UniformColorQuantizationToNBitsPrimitive',)
Inputs = container.DataF... | true | true |
f71de36f31d52da0ff58916c32eb7b71a25b256b | 1,805 | py | Python | remote_works/checkout/views/delivery.py | tetyanaloskutova/saleor | b3bb51e9c0c4c2febf4aa1e2a7d893e77c331e89 | [
"BSD-3-Clause"
] | 7 | 2019-05-17T14:27:13.000Z | 2021-12-17T22:52:40.000Z | remote_works/checkout/views/delivery.py | tetyanaloskutova/saleor | b3bb51e9c0c4c2febf4aa1e2a7d893e77c331e89 | [
"BSD-3-Clause"
] | 9 | 2019-04-13T09:24:28.000Z | 2019-09-09T15:35:05.000Z | remote_works/checkout/views/delivery.py | tetyanaloskutova/remote-works | b3bb51e9c0c4c2febf4aa1e2a7d893e77c331e89 | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import redirect
from django.template.response import TemplateResponse
from ..utils import (
get_cart_data_for_checkout, get_taxes_for_cart,
update_delivery_address_in_anonymous_cart, update_delivery_address_in_cart)
def anonymous_user_delivery_address_view(request, cart):
"""Display... | 36.836735 | 79 | 0.735734 | from django.shortcuts import redirect
from django.template.response import TemplateResponse
from ..utils import (
get_cart_data_for_checkout, get_taxes_for_cart,
update_delivery_address_in_anonymous_cart, update_delivery_address_in_cart)
def anonymous_user_delivery_address_view(request, cart):
user_form,... | true | true |
f71de438177d496f549f66bef245160a2ec87256 | 5,619 | py | Python | utils/performMatch.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | 3 | 2021-02-28T12:00:26.000Z | 2021-03-14T03:00:42.000Z | utils/performMatch.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | null | null | null | utils/performMatch.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | null | null | null | import random
import secrets
from collections import deque
from typing import Deque, Dict, Optional
from config.constants import (CALLBACK_ACTIVE_NO, CALLBACK_ACTIVE_YES,
CALLBACK_CAMPUS_KAZAN, CALLBACK_CAMPUS_MOSCOW,
USER_DATA_V1_AUTHORIZED,
... | 36.019231 | 121 | 0.596903 | import random
import secrets
from collections import deque
from typing import Deque, Dict, Optional
from config.constants import (CALLBACK_ACTIVE_NO, CALLBACK_ACTIVE_YES,
CALLBACK_CAMPUS_KAZAN, CALLBACK_CAMPUS_MOSCOW,
USER_DATA_V1_AUTHORIZED,
... | true | true |
f71de50fee8f2c059e569bd9f0e30902c82d985b | 1,598 | py | Python | portfolio/tests.py | tiagocordeiro/mulhergorila-website | 2ea6232415a152e51324c2b3b4f337039e88d710 | [
"MIT"
] | null | null | null | portfolio/tests.py | tiagocordeiro/mulhergorila-website | 2ea6232415a152e51324c2b3b4f337039e88d710 | [
"MIT"
] | 309 | 2019-03-04T04:49:16.000Z | 2022-03-18T16:11:38.000Z | portfolio/tests.py | vitorpvcampos/mulhergorila-website | 906b68f6e34b7bcb9811b451ee923ccf73e6eb5b | [
"MIT"
] | 2 | 2020-08-28T17:31:43.000Z | 2020-08-28T18:33:15.000Z | from django.test import RequestFactory, TestCase, Client
from .models import Project, Category
from .views import portfolio, portfolio_detail
class PortfolioViewTests(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()
self.client ... | 36.318182 | 87 | 0.667084 | from django.test import RequestFactory, TestCase, Client
from .models import Project, Category
from .views import portfolio, portfolio_detail
class PortfolioViewTests(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.client = Client()
self.category_sample... | true | true |
f71de58ddbe3fce5ab2f8b4b930eedcc41b00c52 | 2,122 | py | Python | Application/modules/modbus/scanner/uid.py | gennaromellone/smod3 | 98e370aad65067862c93b55415cc00db2f24f330 | [
"Apache-2.0"
] | 1 | 2022-02-28T09:16:19.000Z | 2022-02-28T09:16:19.000Z | Application/modules/modbus/scanner/uid.py | gennaromellone/smod3 | 98e370aad65067862c93b55415cc00db2f24f330 | [
"Apache-2.0"
] | null | null | null | Application/modules/modbus/scanner/uid.py | gennaromellone/smod3 | 98e370aad65067862c93b55415cc00db2f24f330 | [
"Apache-2.0"
] | null | null | null | import os
import threading
from System.Core.Global import *
from System.Core.Colors import *
from System.Core.Modbus import *
import ipcalc
class Module:
info = {
'Name': 'Brute Force UID',
'Author': ['@enddo'],
'Description': ("Brute Force UID"),
}
options = {
'RHOSTS' :['' ,True ,'The target a... | 30.314286 | 151 | 0.615928 | import os
import threading
from System.Core.Global import *
from System.Core.Colors import *
from System.Core.Modbus import *
import ipcalc
class Module:
info = {
'Name': 'Brute Force UID',
'Author': ['@enddo'],
'Description': ("Brute Force UID"),
}
options = {
'RHOSTS' :['' ,True ,'The target a... | true | true |
f71de830c973483fd3dea6a6825236f67aadd8ee | 12,401 | py | Python | tests/test_cli.py | grassking100/optuna | 3075a1cf6648b3a8f061f904177734a08bb3a3c3 | [
"MIT"
] | null | null | null | tests/test_cli.py | grassking100/optuna | 3075a1cf6648b3a8f061f904177734a08bb3a3c3 | [
"MIT"
] | null | null | null | tests/test_cli.py | grassking100/optuna | 3075a1cf6648b3a8f061f904177734a08bb3a3c3 | [
"MIT"
] | null | null | null | import re
import subprocess
from subprocess import CalledProcessError
import tempfile
import pytest
import optuna
from optuna.cli import _Studies
from optuna.exceptions import CLIUsageError
from optuna.storages.base import DEFAULT_STUDY_NAME_PREFIX
from optuna.storages import RDBStorage
from optuna.testing.storage im... | 32.634211 | 98 | 0.625917 | import re
import subprocess
from subprocess import CalledProcessError
import tempfile
import pytest
import optuna
from optuna.cli import _Studies
from optuna.exceptions import CLIUsageError
from optuna.storages.base import DEFAULT_STUDY_NAME_PREFIX
from optuna.storages import RDBStorage
from optuna.testing.storage im... | true | true |
f71de8677f972f2c21bacb4a237b9b624aa913e9 | 9,889 | py | Python | docs/conf.py | cclauss/ThreatPrep | b1881be239e7b86d86acc70a207989d459bd9d79 | [
"MIT"
] | 50 | 2016-08-05T03:33:00.000Z | 2022-02-16T13:52:15.000Z | docs/conf.py | cclauss/ThreatPrep | b1881be239e7b86d86acc70a207989d459bd9d79 | [
"MIT"
] | null | null | null | docs/conf.py | cclauss/ThreatPrep | b1881be239e7b86d86acc70a207989d459bd9d79 | [
"MIT"
] | 14 | 2017-06-26T02:54:43.000Z | 2021-11-17T07:38:52.000Z | # -*- coding: utf-8 -*-
#
# threat_prep documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 15 11:37:04 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | 29 | 80 | 0.705329 |
import sphinx_rtd_theme
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'ThreatPrep'
copyright = u'2016, Alex McCormack'
author = u'Alex McCormack'
# |version| and |release|, also used in various other places through... | true | true |
f71dea523dad478e9fc4cb8ac07d9b39f159e61e | 73,462 | py | Python | test/integration/component/test_accounts.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/component/test_accounts.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/component/test_accounts.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.968444 | 88 | 0.449225 |
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import (random_gen,
cleanup_resources)
from marvin.lib.base import (Domain,
Account,
ServiceOffering,
Virt... | true | true |
f71ded7209537b4f3b656163107b6d7a91292890 | 4,399 | py | Python | git/refs/reference.py | ifwe/GitPython | 2752f7068fb6fc160f63eabec3964263171593e3 | [
"BSD-3-Clause"
] | null | null | null | git/refs/reference.py | ifwe/GitPython | 2752f7068fb6fc160f63eabec3964263171593e3 | [
"BSD-3-Clause"
] | null | null | null | git/refs/reference.py | ifwe/GitPython | 2752f7068fb6fc160f63eabec3964263171593e3 | [
"BSD-3-Clause"
] | null | null | null | from symbolic import SymbolicReference
from git.util import (
LazyMixin,
Iterable,
)
from gitdb.util import (
isfile,
hex_to_bin
)
__all__ = ["Reference"]
#{ Utilities
def require_remote_ref_path(func):
"""A decorator raising a TypeError if we are not a valid remote, based on the path"""
d... | 34.367188 | 101 | 0.625369 | from symbolic import SymbolicReference
from git.util import (
LazyMixin,
Iterable,
)
from gitdb.util import (
isfile,
hex_to_bin
)
__all__ = ["Reference"]
def require_remote_ref_path(func):
def wrapper(self, *args):
if not self.is_remote():
raise ValueError("ref path does ... | true | true |
f71deef83c9778cff0948c2c78a2a0544ca4476f | 6,517 | py | Python | autoencoder_program_synthesis/model_utils/modules.py | sander102907/autoencoder_program_synthesis | 752954f9ef268908553189a1c3323bad15b39f04 | [
"Apache-2.0"
] | 4 | 2021-08-14T17:38:37.000Z | 2022-02-03T20:47:54.000Z | autoencoder_program_synthesis/model_utils/modules.py | sander102907/autoencoder_program_synthesis | 752954f9ef268908553189a1c3323bad15b39f04 | [
"Apache-2.0"
] | 2 | 2021-04-28T10:41:30.000Z | 2022-02-02T14:30:58.000Z | autoencoder_program_synthesis/model_utils/modules.py | sander102907/autoencoder_program_synthesis | 752954f9ef268908553189a1c3323bad15b39f04 | [
"Apache-2.0"
] | 1 | 2021-08-14T17:38:39.000Z | 2021-08-14T17:38:39.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class AddGate(nn.Module):
"""
Add gate similar to LSTM add gate: :math: `y = σ(W_mul * inp + b_mul) * tanh(W_add * inp + b_add)`
Outputs information that can be added to some state
where the network learns: if and how much ... | 31.946078 | 150 | 0.622833 | import torch
import torch.nn as nn
import torch.nn.functional as F
class AddGate(nn.Module):
def __init__(self, dim):
super().__init__()
self.W_mul = nn.Linear(dim, dim, bias=True)
self.W_add = nn.Linear(dim, dim, bias=True)
self.sigmoid = nn.Sigmoid()
def forward(self, inp... | true | true |
f71def27dfce1001fd68a9493b3a1cf29ffe8982 | 13,148 | py | Python | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/subscription.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/subscription.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/subscription.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 52.174603 | 730 | 0.668239 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['Subscription']
class Subscription(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[... | true | true |
f71defd528de6547eb1596d3cd76b72ff5dc824b | 1,262 | py | Python | EKMRC/src/test_gnn.py | yyHaker/EKMRC-is-your-need | 483e2d9d822907ef36a39333933fd939dac1cea0 | [
"Apache-2.0"
] | 4 | 2020-09-21T01:50:21.000Z | 2021-03-23T10:19:09.000Z | EKMRC/src/test_gnn.py | yyHaker/EKMRC-is-your-need | 483e2d9d822907ef36a39333933fd939dac1cea0 | [
"Apache-2.0"
] | null | null | null | EKMRC/src/test_gnn.py | yyHaker/EKMRC-is-your-need | 483e2d9d822907ef36a39333933fd939dac1cea0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : test_gnn.py
@Author : yyhaker
@Contact : 572176750@qq.com
@Time : 2020/04/22 15:19:24
'''
# here put the import lib
import torch
from torch_geometric.data import Data
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
edge... | 24.745098 | 76 | 0.588748 |
import torch
from torch_geometric.data import Data
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
edge_index = torch.tensor([[0, 2],
[2, 0],
[3, 2],
[2, 3]], dtype=torch.long)
x = torch.tensor([[-1], [0], [1]],... | true | true |
f71df01b8099b2c1ebabc7c547e4cedc327ddd71 | 1,835 | py | Python | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/ModifyDeviceCaptureRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/ModifyDeviceCaptureRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/ModifyDeviceCaptureRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.767857 | 76 | 0.749319 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvs.endpoint import endpoint_data
class ModifyDeviceCaptureRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'vs', '2018-12-12', 'ModifyDeviceCapture','vs')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
f71df0441d2b046fea41993a5a9dd7faa1f1b11c | 2,639 | py | Python | examples/ex_graph.py | MicrohexHQ/src | c079873c182067002b6a7a5564094ea0a4fe0aef | [
"BSD-3-Clause"
] | 2 | 2019-07-08T11:58:27.000Z | 2019-07-08T13:23:57.000Z | examples/ex_graph.py | Bia10/src | 15b9ab2535222e492cd21b8528c27f763fb799d6 | [
"BSD-3-Clause"
] | null | null | null | examples/ex_graph.py | Bia10/src | 15b9ab2535222e492cd21b8528c27f763fb799d6 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
# -----------------------------------------------------------------------
# This is an example illustrating how to use the user graphing functionality
# in Python
# (c) Hex-Rays
#
from idaapi import *
class GraphCloser(action_handler_t):
def __init__(self, graph):
acti... | 29 | 109 | 0.610837 | from __future__ import print_function
from idaapi import *
class GraphCloser(action_handler_t):
def __init__(self, graph):
action_handler_t.__init__(self)
self.graph = graph
def activate(self, ctx):
self.graph.Close()
def update(self, ctx):
return AST_ENABLE_ALWAYS
... | true | true |
f71df0d4285088125c53c87edad42557c8ce5e8c | 542 | py | Python | alembic/versions/2016111514_add_primary_key_to_worker__54725ffc62f3.py | millerjohnp/codalab-worksheets | d6fc37864e7a8966380fc9d73865b10e434d6678 | [
"Apache-2.0"
] | 1 | 2021-01-02T03:33:58.000Z | 2021-01-02T03:33:58.000Z | alembic/versions/2016111514_add_primary_key_to_worker__54725ffc62f3.py | millerjohnp/codalab-worksheets | d6fc37864e7a8966380fc9d73865b10e434d6678 | [
"Apache-2.0"
] | null | null | null | alembic/versions/2016111514_add_primary_key_to_worker__54725ffc62f3.py | millerjohnp/codalab-worksheets | d6fc37864e7a8966380fc9d73865b10e434d6678 | [
"Apache-2.0"
] | 1 | 2020-03-13T08:16:17.000Z | 2020-03-13T08:16:17.000Z | """Add primary key to worker_dependency
Revision ID: 54725ffc62f3
Revises: 730e212b938
Create Date: 2016-11-15 14:02:41.621934
"""
# revision identifiers, used by Alembic.
revision = '54725ffc62f3'
down_revision = '730e212b938'
from alembic import op
def upgrade():
# Cannot add primary key with auto-increment... | 22.583333 | 96 | 0.745387 |
revision = '54725ffc62f3'
down_revision = '730e212b938'
from alembic import op
def upgrade():
op.execute("ALTER TABLE `worker_dependency` ADD `id` INT PRIMARY KEY AUTO_INCREMENT FIRST;")
def downgrade():
op.drop_column('worker_dependency', 'id')
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.