hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c479e5971d949fcf67c534f48a3d16b3e4c4a28 | 2,063 | py | Python | zfused_maya/zfused_maya/core/color.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | 2 | 2019-02-22T03:33:26.000Z | 2019-02-23T03:29:26.000Z | zfused_maya/zfused_maya/core/color.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | zfused_maya/zfused_maya/core/color.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# --author-- lanhua.zhou
import os
import json
import logging
__all__ = ["get_component_color_data", "LetterColor"]
DIRNAME = os.path.dirname(__file__)
MENU_DIRNAME = os.path.dirname(os.path.dirname(DIRNAME))
COMPONENT_COLOR_FILE = "{}/conf/componentcolor.json".format(MENU_DIRNAME)
logger = logging.ge... | 25.158537 | 73 | 0.492002 |
import os
import json
import logging
__all__ = ["get_component_color_data", "LetterColor"]
DIRNAME = os.path.dirname(__file__)
MENU_DIRNAME = os.path.dirname(os.path.dirname(DIRNAME))
COMPONENT_COLOR_FILE = "{}/conf/componentcolor.json".format(MENU_DIRNAME)
logger = logging.getLogger(__name__)
def get_component_c... | true | true |
1c479e9907ca8ed897efe7210ee012940850571b | 181 | py | Python | DJANGO PROJECT/Configurator/ConfigWebApp/forms.py | BobbyElmes/Fusion-Configurator-Source-Code | 08e6c14789a2e8d073b312422ce893ee463369f5 | [
"MIT"
] | null | null | null | DJANGO PROJECT/Configurator/ConfigWebApp/forms.py | BobbyElmes/Fusion-Configurator-Source-Code | 08e6c14789a2e8d073b312422ce893ee463369f5 | [
"MIT"
] | null | null | null | DJANGO PROJECT/Configurator/ConfigWebApp/forms.py | BobbyElmes/Fusion-Configurator-Source-Code | 08e6c14789a2e8d073b312422ce893ee463369f5 | [
"MIT"
] | null | null | null | from django import forms
class Register(forms.Form):
username = forms.CharField(label='username', max_length=35)
password = forms.CharField(label='password', max_length=35) | 36.2 | 63 | 0.756906 | from django import forms
class Register(forms.Form):
username = forms.CharField(label='username', max_length=35)
password = forms.CharField(label='password', max_length=35) | true | true |
1c479fcc08d0b2f40c0963da403abaa4ff01ae81 | 4,853 | py | Python | qa/rpc-tests/httpbasics.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | 1 | 2022-03-19T16:50:57.000Z | 2022-03-19T16:50:57.000Z | qa/rpc-tests/httpbasics.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | null | null | null | qa/rpc-tests/httpbasics.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test rpc http basics
#
from test_framework.test_framework import BitcoinTestFramework
from test_fram... | 42.570175 | 108 | 0.632186 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = False
def se... | true | true |
1c47a0df09096f9bfb11acb7116db2b3e4c3ba4a | 1,076 | py | Python | api/views.py | masoodmomin/django-react-todoapp | 06fb4f7603bba726e6b0b13cf7dfc5e0aa068f0c | [
"MIT"
] | 1 | 2020-12-06T12:32:23.000Z | 2020-12-06T12:32:23.000Z | api/views.py | masoodmomin/django-react-todoapp | 06fb4f7603bba726e6b0b13cf7dfc5e0aa068f0c | [
"MIT"
] | null | null | null | api/views.py | masoodmomin/django-react-todoapp | 06fb4f7603bba726e6b0b13cf7dfc5e0aa068f0c | [
"MIT"
] | null | null | null | from django.http import request
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import TodoSerializer
from .models import Todo
from django.http import JsonResponse
@api_view(['GET'])
def all(request):
todo = Todo.obje... | 29.081081 | 66 | 0.727695 | from django.http import request
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import TodoSerializer
from .models import Todo
from django.http import JsonResponse
@api_view(['GET'])
def all(request):
todo = Todo.obje... | true | true |
1c47a10742a03a90e69f50b632ec06af813dc613 | 18,268 | py | Python | core/controllers/suggestion.py | ReshuKumari/oppia | cb89b633275b3d0b2d02e0d22e0c472d8b8da0e1 | [
"Apache-2.0"
] | null | null | null | core/controllers/suggestion.py | ReshuKumari/oppia | cb89b633275b3d0b2d02e0d22e0c472d8b8da0e1 | [
"Apache-2.0"
] | null | null | null | core/controllers/suggestion.py | ReshuKumari/oppia | cb89b633275b3d0b2d02e0d22e0c472d8b8da0e1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2018 The Oppia 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 requi... | 39.117773 | 80 | 0.661047 |
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
from constants import constants
from core.controllers import acl_decorators
from core.controllers import base
from core.domain import fs_services
from core.domain import html_cleaner
from core.domain import ... | true | true |
1c47a212af9aebe31a9460335ed92e68251a9076 | 3,160 | py | Python | Exec/testing/Viscous-Vortex/check.py | darylbond/cerberus | a1b99f6b50ba6876d4705f26e6be98ed6e1c5c6a | [
"MIT"
] | 5 | 2021-05-10T01:21:52.000Z | 2022-03-10T17:26:41.000Z | Exec/testing/Viscous-Vortex/check.py | darylbond/cerberus | a1b99f6b50ba6876d4705f26e6be98ed6e1c5c6a | [
"MIT"
] | 3 | 2021-05-26T01:12:12.000Z | 2021-12-14T00:34:06.000Z | Exec/testing/Viscous-Vortex/check.py | darylbond/cerberus | a1b99f6b50ba6876d4705f26e6be98ed6e1c5c6a | [
"MIT"
] | 3 | 2021-05-11T02:45:27.000Z | 2021-09-06T12:08:23.000Z |
import sys
cmd_folder = "../../../vis"
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
from get_boxlib import ReadBoxLib, get_files
import numpy as np
import pylab as plt
import matplotlib.ticker as ticker
def check():
#=====================================================================... | 27.241379 | 92 | 0.472468 |
import sys
cmd_folder = "../../../vis"
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
from get_boxlib import ReadBoxLib, get_files
import numpy as np
import pylab as plt
import matplotlib.ticker as ticker
def check():
files = get_files('.', include=['plt'], exclude=[... | true | true |
1c47a21bcb817eb9aae5fdc55c17b7fec9d7bcef | 1,310 | py | Python | auger_cli/commands/experiment_sessions.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | 1 | 2019-04-17T12:40:58.000Z | 2019-04-17T12:40:58.000Z | auger_cli/commands/experiment_sessions.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | 25 | 2019-03-06T08:20:04.000Z | 2019-07-07T06:00:20.000Z | auger_cli/commands/experiment_sessions.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
from auger_cli.cli_client import pass_client
from auger_cli.formatter import (
print_list,
print_record,
print_table
)
from auger_cli.api import experiment_sessions
@click.group(
'experiment_sessions',
invoke_without_command=True,
short_help='Manage Auge... | 24.716981 | 117 | 0.714504 |
import click
from auger_cli.cli_client import pass_client
from auger_cli.formatter import (
print_list,
print_record,
print_table
)
from auger_cli.api import experiment_sessions
@click.group(
'experiment_sessions',
invoke_without_command=True,
short_help='Manage Auger project experiment se... | true | true |
1c47a2331be5ca842b9b76d50b82dda69ffca458 | 5,055 | py | Python | test/functional/test_framework/netutil.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/test_framework/netutil.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/test_framework/netutil.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Knotcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Linux network utilities.
Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-1... | 32.197452 | 111 | 0.600198 |
import sys
import socket
import fcntl
import struct
import array
import os
from binascii import unhexlify, hexlify
STATE_LISTEN = '0A'
def get_socket_inodes(pid):
base = '/proc/%i/fd' % pid
inodes = []
for item in os.listdir(base):
target = os.readlink(os.path.join(base, item))
... | true | true |
1c47a240eda919b8a1cb429d2d0afedc165532f8 | 263 | py | Python | Statistics/randomNum.py | ssm29njit/calculator601SheethalJedidiah | 2812fbabcf5249eeee8a2f34edd6152cfa2d175e | [
"MIT"
] | 1 | 2020-11-08T05:11:27.000Z | 2020-11-08T05:11:27.000Z | Statistics/randomNum.py | ssm29njit/calculator601SheethalJedidiah | 2812fbabcf5249eeee8a2f34edd6152cfa2d175e | [
"MIT"
] | null | null | null | Statistics/randomNum.py | ssm29njit/calculator601SheethalJedidiah | 2812fbabcf5249eeee8a2f34edd6152cfa2d175e | [
"MIT"
] | 1 | 2020-12-09T15:37:51.000Z | 2020-12-09T15:37:51.000Z | from random import random
def getRandomNum(data,sample_size):
random_values = random.sample(data, k=sample_size-1)
return random_values
#def getSample(data, sample_size):
# random_values = random.sample(data, k=sample_size)
# return random_values | 26.3 | 56 | 0.760456 | from random import random
def getRandomNum(data,sample_size):
random_values = random.sample(data, k=sample_size-1)
return random_values
| true | true |
1c47a26a1e9d995623a6018575abb2f888b8d25f | 11,579 | py | Python | tests/learning/test_rumelhart_semantic_network.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | tests/learning/test_rumelhart_semantic_network.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | tests/learning/test_rumelhart_semantic_network.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | import pytest
import psyneulink as pnl
import psyneulink.core.components.functions.transferfunctions
def validate_learning_mechs(sys):
def get_learning_mech(name):
return next(lm for lm in sys.learning_mechanisms if lm.name == name)
REP_IN_to_REP_HIDDEN_LM = get_learning_mech('LearningMechanism for ... | 62.589189 | 143 | 0.586925 | import pytest
import psyneulink as pnl
import psyneulink.core.components.functions.transferfunctions
def validate_learning_mechs(sys):
def get_learning_mech(name):
return next(lm for lm in sys.learning_mechanisms if lm.name == name)
REP_IN_to_REP_HIDDEN_LM = get_learning_mech('LearningMechanism for ... | true | true |
1c47a3c567eca3d2d1212e401d44eb434aeea753 | 124 | py | Python | blog/blog/api/urls.py | akiracadet/django-rest-sandbox | d5eb8667328b20b85b41b814e1071aad4627fac3 | [
"MIT"
] | null | null | null | blog/blog/api/urls.py | akiracadet/django-rest-sandbox | d5eb8667328b20b85b41b814e1071aad4627fac3 | [
"MIT"
] | 4 | 2021-04-08T19:39:29.000Z | 2021-09-22T19:33:36.000Z | blog/blog/api/urls.py | akiracadet/django-rest-sandbox | d5eb8667328b20b85b41b814e1071aad4627fac3 | [
"MIT"
] | null | null | null | from django.urls import include
from django.urls import path
urlpatterns = [
path('posts/', include('posts.urls')),
]
| 15.5 | 42 | 0.701613 | from django.urls import include
from django.urls import path
urlpatterns = [
path('posts/', include('posts.urls')),
]
| true | true |
1c47a4d77aa127fc90e8639b68a267f11d0041c2 | 403 | py | Python | bookshop_proj/asgi.py | ravenda900/bookshop-django | d66308a75c69854d55f8093aa8d35d4940cb5689 | [
"MIT"
] | null | null | null | bookshop_proj/asgi.py | ravenda900/bookshop-django | d66308a75c69854d55f8093aa8d35d4940cb5689 | [
"MIT"
] | null | null | null | bookshop_proj/asgi.py | ravenda900/bookshop-django | d66308a75c69854d55f8093aa8d35d4940cb5689 | [
"MIT"
] | null | null | null | """
ASGI config for bookshop_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/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookshop_proj.settings')
application = get_asgi_application()
| true | true |
1c47a53589ababd0727d0971d389fb95baaeab43 | 4,168 | py | Python | research/minigo/evaluation.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/minigo/evaluation.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/minigo/evaluation.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 35.02521 | 80 | 0.669626 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import go
import sgf_wrapper
from gtp_wrapper import MCTSPlayer
def play_match(params, black_net, white_net, games, readouts,
sgf_dir, verbosity):
blac... | true | true |
1c47a5a2c3724fb74c6a56157c990c41856f9b53 | 401 | py | Python | tweepy/error.py | skoczen/tweepy | 3b4bbabe1ecafee40d9d5942fbd59c4056c8997c | [
"MIT"
] | 24 | 2015-11-12T06:33:24.000Z | 2019-04-16T11:11:13.000Z | tweepy/error.py | skoczen/tweepy | 3b4bbabe1ecafee40d9d5942fbd59c4056c8997c | [
"MIT"
] | 3 | 2015-11-12T22:16:22.000Z | 2021-08-09T07:00:27.000Z | tweepy/error.py | skoczen/tweepy | 3b4bbabe1ecafee40d9d5942fbd59c4056c8997c | [
"MIT"
] | 7 | 2015-11-12T20:09:56.000Z | 2020-12-16T17:59:02.000Z | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import six
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None):
self.reason = six.text_type(reason)
self.response = response
Exc... | 20.05 | 46 | 0.693267 |
from __future__ import print_function
import six
class TweepError(Exception):
def __init__(self, reason, response=None):
self.reason = six.text_type(reason)
self.response = response
Exception.__init__(self, reason)
def __str__(self):
return self.reason
| true | true |
1c47a9283d75ce997bacf6c8e784da408d98f090 | 164 | py | Python | python/kyu-6/detect-pangram/test_detect_pangram.py | ledwindra/codewars | 0552669a69e801cfe5f9a3696a4d98be63a96951 | [
"WTFPL"
] | 1 | 2020-11-13T16:55:04.000Z | 2020-11-13T16:55:04.000Z | python/kyu-6/detect-pangram/test_detect_pangram.py | ledwindra/codewars | 0552669a69e801cfe5f9a3696a4d98be63a96951 | [
"WTFPL"
] | 1 | 2020-01-28T15:48:17.000Z | 2020-01-28T15:48:17.000Z | python/kyu-6/detect-pangram/test_detect_pangram.py | ledwindra/codewars | 0552669a69e801cfe5f9a3696a4d98be63a96951 | [
"WTFPL"
] | null | null | null | from detect_pangram import is_pangram
class TestPangram:
def test_0(self):
assert is_pangram('The quick, brown fox jumps over the lazy dog!') == True | 23.428571 | 82 | 0.719512 | from detect_pangram import is_pangram
class TestPangram:
def test_0(self):
assert is_pangram('The quick, brown fox jumps over the lazy dog!') == True | true | true |
1c47a928f0a5aff8aff873bfd002dda97fcd6bb1 | 15,931 | py | Python | notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py | ornlneutronimaging/notebooks | d219cdc9ec103fd8bb45891b984f45d3d6facecd | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py | ornlneutronimaging/notebooks | d219cdc9ec103fd8bb45891b984f45d3d6facecd | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py | ornlneutronimaging/notebooks | d219cdc9ec103fd8bb45891b984f45d3d6facecd | [
"BSD-3-Clause"
] | null | null | null | from IPython.core.display import HTML
from IPython.core.display import display
import os
import copy
from qtpy.QtWidgets import QMainWindow, QFileDialog
from qtpy import QtGui
from collections import OrderedDict
from __code import load_ui
from .initialization import Initializer
from .event_handler import MetadataTable... | 37.751185 | 102 | 0.612203 | from IPython.core.display import HTML
from IPython.core.display import display
import os
import copy
from qtpy.QtWidgets import QMainWindow, QFileDialog
from qtpy import QtGui
from collections import OrderedDict
from __code import load_ui
from .initialization import Initializer
from .event_handler import MetadataTable... | true | true |
1c47a9ba768369e5fcda639a537396d54a754795 | 142 | py | Python | mysite/users/apps.py | saademad200/SE_Visualri | f01e22a5e47a44eb9219199027b68d1bd0bb4bca | [
"BSL-1.0"
] | null | null | null | mysite/users/apps.py | saademad200/SE_Visualri | f01e22a5e47a44eb9219199027b68d1bd0bb4bca | [
"BSL-1.0"
] | null | null | null | mysite/users/apps.py | saademad200/SE_Visualri | f01e22a5e47a44eb9219199027b68d1bd0bb4bca | [
"BSL-1.0"
] | null | null | null | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
import users.signals
| 17.75 | 34 | 0.65493 | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
import users.signals
| true | true |
1c47aaec11d06eff56c121c77fb592d8b28a697b | 13,676 | py | Python | tornado/autoreload.py | DengJackNo1/tornado | 895a4fa69817c24fbf6ada6c5fb07351c6e91cd5 | [
"Apache-2.0"
] | 640 | 2018-09-12T03:14:13.000Z | 2022-03-30T04:38:09.000Z | tornado/autoreload.py | DengJackNo1/tornado | 895a4fa69817c24fbf6ada6c5fb07351c6e91cd5 | [
"Apache-2.0"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | tornado/autoreload.py | DengJackNo1/tornado | 895a4fa69817c24fbf6ada6c5fb07351c6e91cd5 | [
"Apache-2.0"
] | 230 | 2018-09-13T02:40:49.000Z | 2022-03-29T11:53:58.000Z | #
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 37.468493 | 88 | 0.674101 |
import os
import sys
# original.
#
# Conversely, when run as path/to/file.py, the directory containing
# file.py gets added to the path, which can cause confusion as imports
# may become relative in spite of the future import.
#
# We address the former problem by reconstructing the original comm... | true | true |
1c47ab394fb23448ceb4c13702c16990ae7535cf | 649 | py | Python | Ex056.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | Ex056.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | Ex056.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | m = int()
q = int()
ma = int()
mm = int()
me = float()
nma = str()
a = int(input('Digite quantas pessoas tem o Grupo: '))
for c in range(0, a):
n = str(input('Digite o nome: '))
i = int(input('Digite a idade: '))
s = int(input('Digite o sexo:\n[1] para masculino\n[2]para feminino\n'))
m = m + i
q = ... | 28.217391 | 118 | 0.534669 | m = int()
q = int()
ma = int()
mm = int()
me = float()
nma = str()
a = int(input('Digite quantas pessoas tem o Grupo: '))
for c in range(0, a):
n = str(input('Digite o nome: '))
i = int(input('Digite a idade: '))
s = int(input('Digite o sexo:\n[1] para masculino\n[2]para feminino\n'))
m = m + i
q = ... | true | true |
1c47ac62262bb7d3b7efc480a2952496dfd81d53 | 571 | py | Python | core/da/sqlitedriver.py | ramkj/xman | 8ab14b0754e0ef3c44c27259c0df7c10697d3502 | [
"Apache-2.0"
] | null | null | null | core/da/sqlitedriver.py | ramkj/xman | 8ab14b0754e0ef3c44c27259c0df7c10697d3502 | [
"Apache-2.0"
] | null | null | null | core/da/sqlitedriver.py | ramkj/xman | 8ab14b0754e0ef3c44c27259c0df7c10697d3502 | [
"Apache-2.0"
] | null | null | null | import sqlite3
class SQLiteDriver:
def __init__(self, dbname: str ):
self.config = dbname
def __enter__(self) -> 'cursor':
self.connection = sqlite3.connect(self.config)
assert self.connection is not None, 'failed getting connection from DB'
self.connection.execute( 'PRAGMA f... | 30.052632 | 79 | 0.654991 | import sqlite3
class SQLiteDriver:
def __init__(self, dbname: str ):
self.config = dbname
def __enter__(self) -> 'cursor':
self.connection = sqlite3.connect(self.config)
assert self.connection is not None, 'failed getting connection from DB'
self.connection.execute( 'PRAGMA f... | true | true |
1c47ac976cbf51fb5ea1439ce4c43e00aa534a40 | 1,027 | py | Python | salt/runners/mine.py | bruce-one/salt | 0715f6c29a8e19c3cf7a67ad41aff84801c9f5ae | [
"Apache-2.0"
] | 1 | 2016-04-20T08:18:07.000Z | 2016-04-20T08:18:07.000Z | salt/runners/mine.py | quantonganh/salt | 8f1df678573153970c08b33978fe185d9ed1b71c | [
"Apache-2.0"
] | null | null | null | salt/runners/mine.py | quantonganh/salt | 8f1df678573153970c08b33978fe185d9ed1b71c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A runner to access data from the salt mine
'''
# Import python libs
import os
# Import salt libs
import salt.payload
import salt.utils.minions
import salt.utils
def get(tgt, fun, tgt_type='glob'):
'''
Gathers the data from the specified minions' mine, pass in the target,
funct... | 23.883721 | 74 | 0.558909 |
import os
import salt.payload
import salt.utils.minions
import salt.utils
def get(tgt, fun, tgt_type='glob'):
ret = {}
serial = salt.payload.Serial(__opts__)
checker = salt.utils.minions.CkMinions(__opts__)
minions = checker.check_minions(
tgt,
tgt_type)
for minion in m... | true | true |
1c47ade190e28d7400249b8c5dab37fe86d3fefc | 1,489 | py | Python | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/FunctionTrigonometric/Tanh.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/FunctionTrigonometric/Tanh.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/FunctionTrigonometric/Tanh.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | import math
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato, Tipo
from Instrucciones.Excepcion import Excepcion
class Tanh(Instruccion):
def __init__(self, valor, strGram, linea, columna):
Instruccion.__init__(self,Tipo(Tipo_Dato.DOUBLE... | 55.148148 | 335 | 0.697112 | import math
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato, Tipo
from Instrucciones.Excepcion import Excepcion
class Tanh(Instruccion):
def __init__(self, valor, strGram, linea, columna):
Instruccion.__init__(self,Tipo(Tipo_Dato.DOUBLE... | true | true |
1c47ae46f17c882072873a49257d173aa670600d | 6,395 | py | Python | examples/benchmarks/json/errors.py | eerimoq/textparser | cc4a85f8b7e6d6be83f5072f45af4a7baf6c35df | [
"MIT"
] | 23 | 2018-09-01T14:39:07.000Z | 2021-11-08T11:52:43.000Z | examples/benchmarks/json/errors.py | risingdeveloper007/TextParser | c0f7b0268f86b77f4eb8366016987140792faff8 | [
"MIT"
] | 1 | 2020-07-06T13:19:25.000Z | 2020-08-01T08:16:34.000Z | examples/benchmarks/json/errors.py | risingdeveloper007/TextParser | c0f7b0268f86b77f4eb8366016987140792faff8 | [
"MIT"
] | 6 | 2019-05-01T21:31:03.000Z | 2021-08-24T11:57:21.000Z | #!/usr/bin/env python
"""Parse error comparsion for a few JSON parsers.
Example execution:
$ env PYTHONPATH=. python3 examples/benchmarks/json/errors.py
-----------------------------------------------------------------
Input string between BEGIN and END:
BEGIN
END
textparser: "Invalid syntax at line 1, column 1: ... | 25.682731 | 283 | 0.602033 |
from __future__ import print_function
from parsers import textparser_json
from parsers import lark_json
from parsers import pyparsing_json
from parsers import funcparserlib_json
from parsers import parsimonious_json
from parsers import textx_json
try:
from parsers import parsita_json
except:
class parsita... | true | true |
1c47af64e57d9e011aed97ff68c6f130de74836b | 1,067 | py | Python | setup.py | timmypidashev/poilet | 40535f9d22f1722de130458e9e487a945abd653f | [
"MIT"
] | null | null | null | setup.py | timmypidashev/poilet | 40535f9d22f1722de130458e9e487a945abd653f | [
"MIT"
] | null | null | null | setup.py | timmypidashev/poilet | 40535f9d22f1722de130458e9e487a945abd653f | [
"MIT"
] | null | null | null | import re
from setuptools import setup
# README will be shown on PyPi
with open('README.md') as file:
readme = file.read()
# Track version number
with open('poilet/__init__.py') as file:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', file.read(), re.MULTILINE)
setup(
name='poilet',
au... | 30.485714 | 93 | 0.645736 | import re
from setuptools import setup
with open('README.md') as file:
readme = file.read()
with open('poilet/__init__.py') as file:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', file.read(), re.MULTILINE)
setup(
name='poilet',
author='timmypidashev',
url='https://github.com/ti... | true | true |
1c47affeae4e58845137235341df557f0710b03f | 50,416 | py | Python | mypy/main.py | noudald/mypy | ecdd4b2e81945d998eb1e1116fb901ff7b63a703 | [
"PSF-2.0"
] | null | null | null | mypy/main.py | noudald/mypy | ecdd4b2e81945d998eb1e1116fb901ff7b63a703 | [
"PSF-2.0"
] | null | null | null | mypy/main.py | noudald/mypy | ecdd4b2e81945d998eb1e1116fb901ff7b63a703 | [
"PSF-2.0"
] | null | null | null | """Mypy type checker command line tool."""
import argparse
import ast
import configparser
import os
import re
import subprocess
import sys
import time
from typing import Any, Dict, List, Mapping, Optional, Tuple, Callable
from mypy import build
from mypy import defaults
from mypy import experiments
from mypy import ... | 45.708069 | 99 | 0.623433 |
import argparse
import ast
import configparser
import os
import re
import subprocess
import sys
import time
from typing import Any, Dict, List, Mapping, Optional, Tuple, Callable
from mypy import build
from mypy import defaults
from mypy import experiments
from mypy import util
from mypy.build import BuildResult
fro... | true | true |
1c47b20f4f8dc841c057a6f528ecd4be3beca08f | 10,390 | py | Python | wbb/modules/misc.py | TAMILVIP007/WilliamButcherBot | e7a02edcd57ec62c7f80c601484e92e257e1d5bf | [
"MIT"
] | 1 | 2021-06-30T07:09:45.000Z | 2021-06-30T07:09:45.000Z | wbb/modules/misc.py | fakeenemy01/GroupBot | e7a02edcd57ec62c7f80c601484e92e257e1d5bf | [
"MIT"
] | null | null | null | wbb/modules/misc.py | fakeenemy01/GroupBot | e7a02edcd57ec62c7f80c601484e92e257e1d5bf | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 TheHamkerCat
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, publish, ... | 33.516129 | 145 | 0.64052 | import secrets
import string
import aiohttp
from cryptography.fernet import Fernet
from pyrogram import filters
from wbb import FERNET_ENCRYPTION_KEY, app, arq
from wbb.core.decorators.errors import capture_err
from wbb.utils import random_line
from wbb.utils.fetch import fetch
from wbb.utils.json_prettify import jso... | true | true |
1c47b21893ab3220005fe7fa5a3318ed874a4750 | 592 | py | Python | python/tests/test_merge_sort.py | YahyaOmari/data-structures-and-algorithms | 86c1bc892ef3b62238555548f460065ac24c5ce3 | [
"MIT"
] | null | null | null | python/tests/test_merge_sort.py | YahyaOmari/data-structures-and-algorithms | 86c1bc892ef3b62238555548f460065ac24c5ce3 | [
"MIT"
] | 1 | 2021-05-04T21:33:34.000Z | 2021-05-04T21:33:34.000Z | python/tests/test_merge_sort.py | YahyaOmari/data-structures-and-algorithms | 86c1bc892ef3b62238555548f460065ac24c5ce3 | [
"MIT"
] | null | null | null | import pytest
from challenges.merge_sort.merge_sort import merge_sort
def test_merge_sort():
actual = merge_sort([5,2,6,0])
excpected = [0, 2, 5, 6]
assert excpected == actual
def test_merge_sort2():
actual = merge_sort([20,18,12,8,5,-2])
excpected = [-2, 5, 8, 12, 18, 20]
assert excpected == ... | 26.909091 | 55 | 0.636824 | import pytest
from challenges.merge_sort.merge_sort import merge_sort
def test_merge_sort():
actual = merge_sort([5,2,6,0])
excpected = [0, 2, 5, 6]
assert excpected == actual
def test_merge_sort2():
actual = merge_sort([20,18,12,8,5,-2])
excpected = [-2, 5, 8, 12, 18, 20]
assert excpected == ... | true | true |
1c47b32f4ca4a9f1fa63baf4c55c2e109438b7d7 | 3,730 | py | Python | pychron/dashboard/process_value.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/dashboard/process_value.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/dashboard/process_value.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | 32.434783 | 90 | 0.531635 |
from __future__ import absolute_import
import time
from traits.api import HasTraits, Str, Either, Property, Float, Int, Bool, List, Enum
from traitsui.api import (
View,
VGroup,
HGroup,
UItem,
ListEditor,
InstanceEditor,
Readonly,
)
from pychron.core.helpers.datetime_too... | true | true |
1c47b4039bfa2cc4e0a27db2b332508a8ada0804 | 1,964 | py | Python | facelib/InsightFace/models/data/data_pipe.py | ffletcherr/FaceLib | fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63 | [
"MIT"
] | null | null | null | facelib/InsightFace/models/data/data_pipe.py | ffletcherr/FaceLib | fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63 | [
"MIT"
] | null | null | null | facelib/InsightFace/models/data/data_pipe.py | ffletcherr/FaceLib | fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63 | [
"MIT"
] | null | null | null | from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms as trans
from torchvision.datasets import ImageFolder
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import numpy as np
def de_preprocess(tensor):
return tensor * 0.5 + 0.5
def get_train_dataset... | 34.45614 | 97 | 0.679735 | from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms as trans
from torchvision.datasets import ImageFolder
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import numpy as np
def de_preprocess(tensor):
return tensor * 0.5 + 0.5
def get_train_dataset... | true | true |
1c47b4fbe727de9a582c4425c5640a77c610d033 | 588 | py | Python | Challenge 1/script.py | kutyel/tuenti-challenge-6 | 63b4f1843cc55c0d409dd610a3b297c276b63a83 | [
"MIT"
] | 1 | 2016-06-27T18:28:37.000Z | 2016-06-27T18:28:37.000Z | Challenge 1/script.py | kutyel/tuenti-challenge-6 | 63b4f1843cc55c0d409dd610a3b297c276b63a83 | [
"MIT"
] | null | null | null | Challenge 1/script.py | kutyel/tuenti-challenge-6 | 63b4f1843cc55c0d409dd610a3b297c276b63a83 | [
"MIT"
] | null | null | null | from __future__ import print_function
with open('output.txt', 'w') as output:
with open('submitInput.txt', 'r') as input_:
cases = int(input_.readline())
lines = input_.readlines()
for test, line in enumerate(lines):
result = 0
people = int(line)
... | 28 | 72 | 0.472789 | from __future__ import print_function
with open('output.txt', 'w') as output:
with open('submitInput.txt', 'r') as input_:
cases = int(input_.readline())
lines = input_.readlines()
for test, line in enumerate(lines):
result = 0
people = int(line)
... | true | true |
1c47b4fd441724e07fa4f7a33443a0d5dca4808b | 1,228 | py | Python | zclassifiershiftedae/prepare_data.py | VAShibaev/text_style_transfer | 42a4a653d7c47b5f04fe8c2b043f70a28b924e1f | [
"Apache-2.0"
] | 38 | 2019-09-05T16:39:19.000Z | 2022-03-07T18:04:06.000Z | zclassifiershiftedae/prepare_data.py | VAShibaev/text_style_transfer | 42a4a653d7c47b5f04fe8c2b043f70a28b924e1f | [
"Apache-2.0"
] | 1 | 2020-12-08T05:12:29.000Z | 2020-12-08T05:12:29.000Z | zclassifiershiftedae/prepare_data.py | VAShibaev/text_style_transfer | 42a4a653d7c47b5f04fe8c2b043f70a28b924e1f | [
"Apache-2.0"
] | 5 | 2019-10-21T22:46:05.000Z | 2020-10-20T02:28:45.000Z | # -*- coding: utf-8 -*-
# It's a code from
# Toward Controlled Generation of Text, ICML2017
# Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, Eric Xing
# https://github.com/asyml/texar/tree/master/examples/text_style_transfer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may n... | 27.909091 | 74 | 0.694625 |
# Toward Controlled Generation of Text, ICML2017
# Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, Eric Xing
# https://github.com/asyml/texar/tree/master/examples/text_style_transfer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | true | true |
1c47b6c5780ab8f0347dbfcc2cf7a16e0039e94d | 450 | py | Python | _app/posts/serializers.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | _app/posts/serializers.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | _app/posts/serializers.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Post
from comments.serializers import CommentSerializer
#from django.conf import settings
# Serializers define the API representation.
class PostSerializer(serializers.HyperlinkedModelSerializer):
#comments = CommentSerializer(many=True, read_only=Tru... | 25 | 61 | 0.735556 | from rest_framework import serializers
from .models import Post
from comments.serializers import CommentSerializer
class PostSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Post
fields = ('id',"author" ,'content', "comments","url")
| true | true |
1c47b7a20cbcab7a8a56ae19a8d8c0cabb9a422d | 577 | py | Python | Class Work/composing-methods-more/burger_toppings.py | Pondorasti/SPD-2.3 | 42728c1f2dfc371fb6bdf1ba008c5d41266f2fa8 | [
"MIT"
] | null | null | null | Class Work/composing-methods-more/burger_toppings.py | Pondorasti/SPD-2.3 | 42728c1f2dfc371fb6bdf1ba008c5d41266f2fa8 | [
"MIT"
] | null | null | null | Class Work/composing-methods-more/burger_toppings.py | Pondorasti/SPD-2.3 | 42728c1f2dfc371fb6bdf1ba008c5d41266f2fa8 | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Split temporary variable
patty = 70 # [gr]
pickle = 20 # [gr]
tomatoes = 25 # [gr]
lettuce = 15 # [gr]
buns = 95 # [gr]
ny_burger_weight = (2 * patty + 4 * pickle + 3 *
tomatoes + 2 * lettuce + 2 * buns)
print("NY Burger Weight", ny_burger_weight)
kimchi = 30 # [gr]
may... | 27.47619 | 78 | 0.59792 |
patty = 70
pickle = 20
tomatoes = 25
lettuce = 15
buns = 95
ny_burger_weight = (2 * patty + 4 * pickle + 3 *
tomatoes + 2 * lettuce + 2 * buns)
print("NY Burger Weight", ny_burger_weight)
kimchi = 30
mayo = 5
golden_fried_onion = 20
seoul_kimchi_burger_weight = (2 * patty + 4 *... | true | true |
1c47b7b8a1f8b36aa064bd1292aa46d379b22d4a | 67 | py | Python | ApplicationServer/descriptors/__init__.py | paltmey/scias | 9006b85ad5a0084d7501413649e0679ba8adbe63 | [
"MIT"
] | null | null | null | ApplicationServer/descriptors/__init__.py | paltmey/scias | 9006b85ad5a0084d7501413649e0679ba8adbe63 | [
"MIT"
] | null | null | null | ApplicationServer/descriptors/__init__.py | paltmey/scias | 9006b85ad5a0084d7501413649e0679ba8adbe63 | [
"MIT"
] | null | null | null | from calculateDescriptors_cython import calculateDescriptors_cython | 67 | 67 | 0.955224 | from calculateDescriptors_cython import calculateDescriptors_cython | true | true |
1c47b8b7abc09b5031051f41169039d786791bfa | 10,082 | py | Python | configs/vrd/VRD_SgDet_heth_area_gnn_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/vrd/VRD_SgDet_heth_area_gnn_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/vrd/VRD_SgDet_heth_area_gnn_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # dataset settings
dataset_type = 'VrdDataset'
data_root = 'data/vrd/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
dict(type='Resize'... | 36.930403 | 115 | 0.587681 |
dataset_type = 'VrdDataset'
data_root = 'data/vrd/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
dict(type='Resize', img_scale=(1333, ... | true | true |
1c47b9e4144242f50539d655abe8afb3386e443d | 1,209 | py | Python | examples/MERAOpt.py | vnechaev/QGOpt | 697f02d89df67a576cd6953ffdd2db62970727da | [
"Apache-2.0"
] | null | null | null | examples/MERAOpt.py | vnechaev/QGOpt | 697f02d89df67a576cd6953ffdd2db62970727da | [
"Apache-2.0"
] | null | null | null | examples/MERAOpt.py | vnechaev/QGOpt | 697f02d89df67a576cd6953ffdd2db62970727da | [
"Apache-2.0"
] | null | null | null | import QGOpt.manifolds as m
from tensorflow.python.keras.optimizer_v2 import optimizer_v2 as opt
import tensorflow as tf
def adj(A):
"""Correct adjoint
Args:
A: tf.tensor of shape (..., n, m)
Returns:
tf tensor of shape (..., m, n), adjoint matrix"""
return tf.math.conj(tf.linalg.matr... | 25.723404 | 79 | 0.623656 | import QGOpt.manifolds as m
from tensorflow.python.keras.optimizer_v2 import optimizer_v2 as opt
import tensorflow as tf
def adj(A):
return tf.math.conj(tf.linalg.matrix_transpose(A))
class MERAOpt(opt.OptimizerV2):
def __init__(self,
name="Fast"):
super(MERAOpt, self).__init__(n... | true | true |
1c47b9f5723d75dc27d382fcc620139929908569 | 5,099 | py | Python | sdk/AsposeEmailCloudSdk/models/object_exist.py | aspose-email-cloud/aspose-email-cloud-python | c5c13839cbbbfa5b6617bd1aedf3cf30cd664227 | [
"MIT"
] | 1 | 2020-02-26T13:19:06.000Z | 2020-02-26T13:19:06.000Z | sdk/AsposeEmailCloudSdk/models/object_exist.py | aspose-email-cloud/aspose-email-cloud-python | c5c13839cbbbfa5b6617bd1aedf3cf30cd664227 | [
"MIT"
] | null | null | null | sdk/AsposeEmailCloudSdk/models/object_exist.py | aspose-email-cloud/aspose-email-cloud-python | c5c13839cbbbfa5b6617bd1aedf3cf30cd664227 | [
"MIT"
] | null | null | null | # coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="ObjectExist.py">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining... | 32.069182 | 81 | 0.576388 |
import pprint
import re
import six
from typing import List, Set, Dict, Tuple, Optional
from datetime import datetime
class ObjectExist(object):
swagger_types = {
'exists': 'bool',
'is_folder': 'bool'
}
attribute_map = {
'exists': 'exists',
'is_fo... | true | true |
1c47ba7cf688f8310a64c27916a4b31c58e71077 | 178 | py | Python | PythonDocs/src/002.py | Bean-jun/LearnGuide | 30a8567b222d18b15d3e9027a435b5bfe640a046 | [
"MIT"
] | 1 | 2022-02-23T13:42:01.000Z | 2022-02-23T13:42:01.000Z | PythonDocs/src/002.py | Bean-jun/LearnGuide | 30a8567b222d18b15d3e9027a435b5bfe640a046 | [
"MIT"
] | null | null | null | PythonDocs/src/002.py | Bean-jun/LearnGuide | 30a8567b222d18b15d3e9027a435b5bfe640a046 | [
"MIT"
] | null | null | null | # 单个变量赋值
name = "小明"
print(name)
# 多变量赋统一值
tom_age = jerry_age = 10
print(f"tom的年龄为{tom_age}, jerry的年龄为{jerry_age}")
# 多个变量赋不同值
name, age = "小明", 23
print(f"{name}的年龄是{age}岁")
| 14.833333 | 48 | 0.679775 |
name = "小明"
print(name)
tom_age = jerry_age = 10
print(f"tom的年龄为{tom_age}, jerry的年龄为{jerry_age}")
name, age = "小明", 23
print(f"{name}的年龄是{age}岁")
| true | true |
1c47bc9b26db9cf25c8c537f793dfeaff97f5c14 | 4,813 | py | Python | homeassistant/components/ecobee/sensor.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | 2 | 2017-06-18T15:09:59.000Z | 2017-06-18T15:11:09.000Z | homeassistant/components/ecobee/sensor.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ecobee/sensor.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | """Support for Ecobee sensors."""
from pyecobee.const import ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers.entity import Entity
from .const import DOMAIN, ECOBEE_MODEL_TO_NAME,... | 35.651852 | 88 | 0.5909 | from pyecobee.const import ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers.entity import Entity
from .const import DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER, _LOGGER
SENSOR_TYP... | true | true |
1c47bca4679357156bbce5a4240e93b0d106e17f | 1,959 | py | Python | pycontracts/forward_solidity.py | rpip/contracts | a2d831e1ac4a728bc7342f8d2856bdeb79c37cc4 | [
"MIT"
] | null | null | null | pycontracts/forward_solidity.py | rpip/contracts | a2d831e1ac4a728bc7342f8d2856bdeb79c37cc4 | [
"MIT"
] | null | null | null | pycontracts/forward_solidity.py | rpip/contracts | a2d831e1ac4a728bc7342f8d2856bdeb79c37cc4 | [
"MIT"
] | 4 | 2019-02-01T13:46:47.000Z | 2020-01-17T00:46:44.000Z | from web3 import Web3
from pycontracts import contracts
from pycontracts.forward import Forward, CallReverted
class ForwardSolidity(Forward):
def __init__(self, contract, owner = None):
self.contract = contract
super().__init__(contract.address)
self._owner = owner
@staticmethod
de... | 32.114754 | 85 | 0.600306 | from web3 import Web3
from pycontracts import contracts
from pycontracts.forward import Forward, CallReverted
class ForwardSolidity(Forward):
def __init__(self, contract, owner = None):
self.contract = contract
super().__init__(contract.address)
self._owner = owner
@staticmethod
de... | true | true |
1c47bcf3b91293c8818a278695ef22bba118cc44 | 605 | py | Python | setup.py | lmijovic/pylhe | afd270044a5c37fec409daa1be45e67ac5fe9c82 | [
"Apache-2.0"
] | 1 | 2020-05-18T17:25:58.000Z | 2020-05-18T17:25:58.000Z | setup.py | 8me/pylhe | a165fba7f9cda1d3f28ae679e41571d52534dc9d | [
"Apache-2.0"
] | null | null | null | setup.py | 8me/pylhe | a165fba7f9cda1d3f28ae679e41571d52534dc9d | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
extras_require = {
"test": [
"pytest",
"pytest-cov>=2.5.1",
"scikit-hep-testdata>=0.3.1",
"pydocstyle",
"check-manifest",
"flake8",
],
}
extras_require["lint"] = sorted(set(["pyflakes", "black;python_version>='3.6'"]))
extras_require[... | 26.304348 | 81 | 0.618182 | from setuptools import setup
extras_require = {
"test": [
"pytest",
"pytest-cov>=2.5.1",
"scikit-hep-testdata>=0.3.1",
"pydocstyle",
"check-manifest",
"flake8",
],
}
extras_require["lint"] = sorted(set(["pyflakes", "black;python_version>='3.6'"]))
extras_require[... | true | true |
1c47bd99ea1abbad60f1ccb8e2ccf3f9e0e37943 | 7,863 | py | Python | tests/vhdl/test_decoder.py | jvanstraten/vhdmmio | f166b07074a9159311a01af88497df91c19e09d1 | [
"Apache-2.0"
] | 4 | 2019-07-01T14:41:38.000Z | 2021-11-28T12:54:49.000Z | tests/vhdl/test_decoder.py | jvanstraten/vhdmmio | f166b07074a9159311a01af88497df91c19e09d1 | [
"Apache-2.0"
] | 4 | 2019-08-23T15:05:24.000Z | 2020-12-16T10:02:20.000Z | tests/vhdl/test_decoder.py | jvanstraten/vhdmmio | f166b07074a9159311a01af88497df91c19e09d1 | [
"Apache-2.0"
] | 1 | 2021-07-16T13:41:21.000Z | 2021-07-16T13:41:21.000Z | """Unit tests for the VHDL address decoder generator."""
from unittest import TestCase
from vhdmmio.vhdl.address_decoder import AddressDecoder
from vhdmmio.core.address import MaskedAddress
from vhdmmio.template import TemplateEngine
class TestVhdlDecoder(TestCase):
"""Unit tests for the VHDL address decoder gene... | 32.626556 | 88 | 0.452499 |
from unittest import TestCase
from vhdmmio.vhdl.address_decoder import AddressDecoder
from vhdmmio.core.address import MaskedAddress
from vhdmmio.template import TemplateEngine
class TestVhdlDecoder(TestCase):
maxDiff = None
def _test_decoder(self, addresses, match=None,
optimize=False... | true | true |
1c47bd9fc2b2b2f8e378fb299617e772a61d05cc | 704 | py | Python | 0x0F-python-object_relational_mapping/4-cities_by_state.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | 1 | 2019-05-21T09:34:41.000Z | 2019-05-21T09:34:41.000Z | 0x0F-python-object_relational_mapping/4-cities_by_state.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/4-cities_by_state.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''
Lists all states from a given database with given name
protect against sql injection
'''
import MySQLdb
from sys import argv
if __name__ == "__main__":
connection = MySQLdb.connect(host="localhost", port=3306, charset="utf8",
user=argv[1], passwd=argv[... | 30.608696 | 77 | 0.599432 |
import MySQLdb
from sys import argv
if __name__ == "__main__":
connection = MySQLdb.connect(host="localhost", port=3306, charset="utf8",
user=argv[1], passwd=argv[2], db=argv[3])
cursor = connection.cursor()
cursor.execute("SELECT cities.id, cities.name, states.name"
... | true | true |
1c47be45651c7c68c942bf5b7c7f590e320b1cd0 | 49,438 | py | Python | homeassistant/components/google_assistant/trait.py | unverbraucht/core | 312af53935a1bffd58b3b35e82e31292a6ec22ad | [
"Apache-2.0"
] | 2 | 2019-11-20T20:56:59.000Z | 2021-01-03T08:52:18.000Z | homeassistant/components/google_assistant/trait.py | shownor/core | b50281a9173e7fb4a37b3f813ca92876088eaac3 | [
"Apache-2.0"
] | 5 | 2020-04-26T10:50:01.000Z | 2021-03-16T21:19:46.000Z | homeassistant/components/google_assistant/trait.py | winterscar/core | 5a55d508791aae65f16396691d014c73fb2095f0 | [
"Apache-2.0"
] | 1 | 2021-04-18T19:36:34.000Z | 2021-04-18T19:36:34.000Z | """Implement the Google Smart Home traits."""
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
from homeassi... | 33.792208 | 88 | 0.594806 | import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
from homeassistant.components.climate import const as clima... | true | true |
1c47be6838a559b898608b686a690144038060ab | 811 | py | Python | mysite/mysite/urls.py | xinkaiwang/robotJump | 622e97451f450b755aecbd60e15b2cd47d875f47 | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | xinkaiwang/robotJump | 622e97451f450b755aecbd60e15b2cd47d875f47 | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | xinkaiwang/robotJump | 622e97451f450b755aecbd60e15b2cd47d875f47 | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 35.26087 | 79 | 0.696671 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('buckets.urls')),
]
| true | true |
1c47be6c708b01f8c5d2442695b7f5df61fef530 | 1,547 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/clock/test_clock_run_stopwatch_laps.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 3 | 2016-08-17T08:52:51.000Z | 2020-03-29T04:56:45.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/clock/test_clock_run_stopwatch_laps.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/functional/clock/test_clock_run_stopwatch_laps.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 1 | 2021-11-18T21:21:19.000Z | 2021-11-18T21:21:19.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.clock.app import Clock
import time
class TestClockRunStopWatch(Ga... | 30.94 | 95 | 0.701357 |
from gaiatest import GaiaTestCase
from gaiatest.apps.clock.app import Clock
import time
class TestClockRunStopWatch(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_click_run_stopwatch_laps(self):
s... | true | true |
1c47be9cac33d18c0c0a8c405deb236cf91a9e3f | 14,282 | py | Python | test/functional/p2p_unrequested_blocks.py | Quirky-Turt-Crypto/Quirky-Turt-Coin | 2fce9fe4f3be715a8ad3269ed9cefb4e5b6fad59 | [
"MIT"
] | null | null | null | test/functional/p2p_unrequested_blocks.py | Quirky-Turt-Crypto/Quirky-Turt-Coin | 2fce9fe4f3be715a8ad3269ed9cefb4e5b6fad59 | [
"MIT"
] | null | null | null | test/functional/p2p_unrequested_blocks.py | Quirky-Turt-Crypto/Quirky-Turt-Coin | 2fce9fe4f3be715a8ad3269ed9cefb4e5b6fad59 | [
"MIT"
] | 1 | 2021-05-16T16:09:23.000Z | 2021-05-16T16:09:23.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Setup: two nodes, node0+node1, not connected to each other. Nod... | 44.080247 | 113 | 0.676096 |
from test_framework.mininode import *
from test_framework.test_framework import quirkyturtTestFramework
from test_framework.util import *
import time
from test_framework.blocktools import create_block, create_coinbase, create_transaction
class AcceptBlockTest(quirkyturtTestFramework):
def add_options(self, pa... | true | true |
1c47beb831ed519d0ec874e7fd8ab065c7a7379d | 6,290 | py | Python | patent_example/patent_example.py | RobKraft/dedupe-examples | bf02a805f8d1a0581b07c1eb81503c769b9541f1 | [
"MIT"
] | null | null | null | patent_example/patent_example.py | RobKraft/dedupe-examples | bf02a805f8d1a0581b07c1eb81503c769b9541f1 | [
"MIT"
] | null | null | null | patent_example/patent_example.py | RobKraft/dedupe-examples | bf02a805f8d1a0581b07c1eb81503c769b9541f1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This code demonstrates how to use dedupe to disambiguate patent
authors and demonstrates the Set and LatLong data types.
"""
import os
import csv
import logging
import optparse
import dedupe
def readData(filename, set_delim='**'):
"""
Remap columns for the foll... | 31.767677 | 97 | 0.583466 |
import os
import csv
import logging
import optparse
import dedupe
def readData(filename, set_delim='**'):
data_d = {}
with open(filename) as f:
reader = csv.DictReader(f)
for idx, row in enumerate(reader):
row = dict((k, v.lower()) for k, v in row.items())
if row['... | true | true |
1c47c26b2239aaaa497597e10ff585638018c10a | 446 | py | Python | oo/teste_carro.py | vladimirvinicius/pythonbirds | 2c0c6bfcda6fbeaffc36f6f04ccd94ab704e0b1a | [
"MIT"
] | 1 | 2020-10-04T03:29:20.000Z | 2020-10-04T03:29:20.000Z | oo/teste_carro.py | JosemarBrito/pythonbirds | eaa80f98bd4365b1146556b5f144dbab03fbf9bb | [
"MIT"
] | null | null | null | oo/teste_carro.py | JosemarBrito/pythonbirds | eaa80f98bd4365b1146556b5f144dbab03fbf9bb | [
"MIT"
] | null | null | null | from unittest import TestCase
from oo.carro import Motor
class CarroTestCase(TestCase):
def teste_velocidade_inicial(self):
motor = Motor()
self.assertEqual(0, motor.velocidade)
def teste_acelerar(self):
motor = Motor()
motor.acelerar()
self.assertEqual(1, motor.veloc... | 23.473684 | 45 | 0.650224 | from unittest import TestCase
from oo.carro import Motor
class CarroTestCase(TestCase):
def teste_velocidade_inicial(self):
motor = Motor()
self.assertEqual(0, motor.velocidade)
def teste_acelerar(self):
motor = Motor()
motor.acelerar()
self.assertEqual(1, motor.veloc... | true | true |
1c47c3ee33915e701135e1412bec7e390f756847 | 2,676 | py | Python | gamma_cloudinary/config.py | barakaVictor/django-gamma-cloudinary | 598af46844ca7b2de3cc832cb0d8dd3f9742e625 | [
"BSD-3-Clause"
] | 1 | 2022-03-13T13:44:19.000Z | 2022-03-13T13:44:19.000Z | gamma_cloudinary/config.py | barakaVictor/django-gamma-cloudinary | 598af46844ca7b2de3cc832cb0d8dd3f9742e625 | [
"BSD-3-Clause"
] | 4 | 2021-09-22T11:44:24.000Z | 2022-01-13T11:06:54.000Z | gamma_cloudinary/config.py | barakaVictor/django-gamma-cloudinary | 598af46844ca7b2de3cc832cb0d8dd3f9742e625 | [
"BSD-3-Clause"
] | null | null | null | import os
import cloudinary
from operator import itemgetter
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
#Execute setup code for cloudinary configuration
def setup_cloudinary():
if settings.configured:
try:
#check for the existence of CLOUDINARY_STORA... | 58.173913 | 142 | 0.664051 | import os
import cloudinary
from operator import itemgetter
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def setup_cloudinary():
if settings.configured:
try:
cloudinary_settings = getattr(settings, 'CLOUDINARY_STORAGE')
... | true | true |
1c47c4f4f4455be041aae5c83a2d2cfc01c700b7 | 1,554 | py | Python | pytest_curl_report/plugin.py | t2y/pytest-curl-report | 8690d8e6b78ad578af07ffad592556119304dac8 | [
"Apache-2.0"
] | null | null | null | pytest_curl_report/plugin.py | t2y/pytest-curl-report | 8690d8e6b78ad578af07ffad592556119304dac8 | [
"Apache-2.0"
] | null | null | null | pytest_curl_report/plugin.py | t2y/pytest-curl-report | 8690d8e6b78ad578af07ffad592556119304dac8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from .curl import Curl
from .utils import get_inspect_functions
PLUGIN_NAMESPACE = 'curl_report'
def pytest_addoption(parser):
group = parser.getgroup('curlreport', 'curl report')
group.addoption(
'--no-curl-report', dest='no_curl_report',
action='store... | 31.08 | 77 | 0.651866 |
import pytest
from .curl import Curl
from .utils import get_inspect_functions
PLUGIN_NAMESPACE = 'curl_report'
def pytest_addoption(parser):
group = parser.getgroup('curlreport', 'curl report')
group.addoption(
'--no-curl-report', dest='no_curl_report',
action='store_true', default=False,
... | true | true |
1c47c521e31ebadae1e4b554a33840207018eda8 | 336 | py | Python | quilljs_example/example/models.py | muke5hy/django-quill | 16250b9c9418907123c8b40ddc66523af5d4e4d4 | [
"BSD-3-Clause"
] | 11 | 2019-02-20T08:58:43.000Z | 2021-01-03T16:41:07.000Z | quilljs_example/example/models.py | muke5hy/django-quill | 16250b9c9418907123c8b40ddc66523af5d4e4d4 | [
"BSD-3-Clause"
] | null | null | null | quilljs_example/example/models.py | muke5hy/django-quill | 16250b9c9418907123c8b40ddc66523af5d4e4d4 | [
"BSD-3-Clause"
] | 3 | 2019-10-08T18:04:01.000Z | 2020-11-02T12:15:03.000Z | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from quilljs.fields import RichTextField
@python_2_unicode_compatible
class ExampleModel(models.Model):
editor = RichTextField()
editor2 = RichTextField(config='basic')
def __str__(self):
return 'This is j... | 24 | 61 | 0.77381 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from quilljs.fields import RichTextField
@python_2_unicode_compatible
class ExampleModel(models.Model):
editor = RichTextField()
editor2 = RichTextField(config='basic')
def __str__(self):
return 'This is j... | true | true |
1c47c5651fa334d977285c340e3c9f7fa5d3f735 | 2,263 | py | Python | setup.py | RobertDeRose/python-robin-srv | dcb3b8a0dff71f2b63695fdab48b322998328fc2 | [
"BSD-2-Clause"
] | null | null | null | setup.py | RobertDeRose/python-robin-srv | dcb3b8a0dff71f2b63695fdab48b322998328fc2 | [
"BSD-2-Clause"
] | null | null | null | setup.py | RobertDeRose/python-robin-srv | dcb3b8a0dff71f2b63695fdab48b322998328fc2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | 30.581081 | 98 | 0.606717 |
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def read(*names, *... | true | true |
1c47c5ded622153fdda38f1bf3179dad8b91b2a3 | 2,653 | py | Python | tests/test_build.py | martinruenz/pytorch3d | 7f1e63aed1252ba8145d4a66ce2272331d60cdae | [
"BSD-3-Clause"
] | 3 | 2022-03-09T08:12:54.000Z | 2022-03-10T01:57:03.000Z | tests/test_build.py | martinruenz/pytorch3d | 7f1e63aed1252ba8145d4a66ce2272331d60cdae | [
"BSD-3-Clause"
] | null | null | null | tests/test_build.py | martinruenz/pytorch3d | 7f1e63aed1252ba8145d4a66ce2272331d60cdae | [
"BSD-3-Clause"
] | 1 | 2020-09-15T06:01:18.000Z | 2020-09-15T06:01:18.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import os
import unittest
from collections import Counter
from pathlib import Path
# This file groups together tests which look at the code without running it.
# When running the tests inside conda's build, the code is not available.
in_conda_bui... | 36.342466 | 84 | 0.560498 |
import os
import unittest
from collections import Counter
from pathlib import Path
in_conda_build = os.environ.get("CONDA_BUILD_STATE", "") == "TEST"
class TestBuild(unittest.TestCase):
@unittest.skipIf(in_conda_build, "In conda build")
def test_name_clash(self):
# For setup.py, all translation u... | true | true |
1c47c5f47a3efdc6396fd4dbe3e492f94d567901 | 8,567 | py | Python | pytorch_toolkit/face_recognition/dump_features.py | xzry6/openvino_training_extensions | b8b17bbcc352633b0f0d3a99d6179a9ec616e426 | [
"Apache-2.0"
] | 158 | 2019-03-01T15:47:39.000Z | 2022-02-10T15:10:48.000Z | dump_features.py | sacchinbhg/face_recognition.pytorch | 05cb9b30e8220445fcb27988926d88f330091c12 | [
"Apache-2.0"
] | 6 | 2020-03-08T22:58:13.000Z | 2022-03-12T00:15:14.000Z | dump_features.py | sacchinbhg/face_recognition.pytorch | 05cb9b30e8220445fcb27988926d88f330091c12 | [
"Apache-2.0"
] | 23 | 2019-03-02T09:18:19.000Z | 2021-11-06T22:01:56.000Z | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 44.159794 | 155 | 0.65834 |
import sys
import argparse
import os
import os.path as osp
from tqdm import tqdm
import numpy as np
import glog as log
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import transforms as t
from scripts.matio import save_mat
from model.common import models_backbo... | true | true |
1c47c6a57ba1e3e281016c90e86575d8ae9b3a68 | 11,286 | py | Python | fpga/lib/eth/tb/test_axis_gmii_tx.py | totuwei/corundum | e983ad519fb4523d0ffca32f5e436195bcfc945c | [
"BSD-2-Clause-FreeBSD"
] | 1,121 | 2015-05-26T14:41:44.000Z | 2022-03-31T07:17:48.000Z | tb/test_axis_gmii_tx.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 98 | 2016-02-12T21:15:45.000Z | 2022-03-31T03:13:00.000Z | tb/test_axis_gmii_tx.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 368 | 2015-05-05T20:49:01.000Z | 2022-03-31T09:43:53.000Z | #!/usr/bin/env python
"""
Copyright (c) 2015-2018 Alex Forencich
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,... | 32.153846 | 91 | 0.601985 |
from myhdl import *
import os
import axis_ep
import eth_ep
import gmii_ep
module = 'axis_gmii_tx'
testbench = 'test_%s' % module
srcs = []
srcs.append("../rtl/%s.v" % module)
srcs.append("../rtl/lfsr.v")
srcs.append("%s.v" % testbench)
src = ' '.join(srcs)
build_cmd = "iverilog -o %s.vvp %s" % (testbench, src)
... | true | true |
1c47c743603061855d979f37a27b7acaf2a74e4b | 7,496 | py | Python | python-modules/twisted/twisted/internet/ssl.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 267 | 2015-03-22T15:23:48.000Z | 2022-03-05T21:57:34.000Z | python-modules/twisted/twisted/internet/ssl.py | rockyzhang/zhangyanhit-python-for-android-mips | 799dd5ca16f72135f2eab71e144a68842e2aaee0 | [
"Apache-2.0"
] | 133 | 2015-03-21T15:13:43.000Z | 2021-12-11T23:37:58.000Z | python-modules/twisted/twisted/internet/ssl.py | rockyzhang/zhangyanhit-python-for-android-mips | 799dd5ca16f72135f2eab71e144a68842e2aaee0 | [
"Apache-2.0"
] | 119 | 2015-04-28T16:07:10.000Z | 2022-03-18T03:49:48.000Z | # -*- test-case-name: twisted.test.test_ssl -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
SSL transport. Requires PyOpenSSL (http://pyopenssl.sf.net).
SSL connections require a ContextFactory so they can create SSL contexts.
End users should only use the ContextFactory cla... | 32.034188 | 102 | 0.689301 |
plementsOnly, implementedBy
from twisted.internet import tcp, interfaces, base, address
class ContextFactory:
isClient = 0
def getContext(self):
raise NotImplementedError
class DefaultOpenSSLContextFactory(ContextFactory):
_context = None
def __init__(self, privateKeyFi... | true | true |
1c47c7b7ad1cb5f4dbaadc84f69896248dc1ef93 | 1,850 | py | Python | wikum-env3/lib/python3.7/site-packages/mwparserfromhell/nodes/text.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | 8 | 2021-04-29T16:49:45.000Z | 2021-08-09T18:56:35.000Z | wikum-env3/lib/python3.7/site-packages/mwparserfromhell/nodes/text.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | null | null | null | wikum-env3/lib/python3.7/site-packages/mwparserfromhell/nodes/text.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | 2 | 2020-08-03T13:02:06.000Z | 2020-11-04T03:15:44.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2019 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... | 34.259259 | 79 | 0.718378 |
from __future__ import unicode_literals
from . import Node
from ..compat import str
__all__ = ["Text"]
class Text(Node):
def __init__(self, value):
super(Text, self).__init__()
self.value = value
def __unicode__(self):
return self.value
def __strip__(self,... | true | true |
1c47c8b56a82daffb467121923485a7868336d49 | 981 | py | Python | ratelimit/rule.py | abersheeran/asgi-ratelimit | 504de6dca1eb99762114a0886d502679a608799e | [
"Apache-2.0"
] | 136 | 2020-06-08T10:38:19.000Z | 2022-03-24T14:45:51.000Z | ratelimit/rule.py | abersheeran/asgi-ratelimit | 504de6dca1eb99762114a0886d502679a608799e | [
"Apache-2.0"
] | 38 | 2020-07-12T15:35:15.000Z | 2022-03-25T03:27:45.000Z | ratelimit/rule.py | abersheeran/asgi-ratelimit | 504de6dca1eb99762114a0886d502679a608799e | [
"Apache-2.0"
] | 15 | 2021-01-19T13:48:37.000Z | 2022-03-18T02:34:52.000Z | from dataclasses import dataclass
from typing import Dict, Optional, Tuple
@dataclass
class Rule:
group: str = "default"
second: Optional[int] = None
minute: Optional[int] = None
hour: Optional[int] = None
day: Optional[int] = None
month: Optional[int] = None
block_time: Optional[int] = ... | 24.525 | 87 | 0.566769 | from dataclasses import dataclass
from typing import Dict, Optional, Tuple
@dataclass
class Rule:
group: str = "default"
second: Optional[int] = None
minute: Optional[int] = None
hour: Optional[int] = None
day: Optional[int] = None
month: Optional[int] = None
block_time: Optional[int] = ... | true | true |
1c47c90a7ae040e58e2550f867ee1a2872a42dce | 32,446 | py | Python | cirq/sim/simulator.py | zchen088/Cirq | 8cf782554adbafed724987de3067de7ca565fa0c | [
"Apache-2.0"
] | 1 | 2019-12-18T17:42:14.000Z | 2019-12-18T17:42:14.000Z | cirq/sim/simulator.py | zchen088/Cirq | 8cf782554adbafed724987de3067de7ca565fa0c | [
"Apache-2.0"
] | null | null | null | cirq/sim/simulator.py | zchen088/Cirq | 8cf782554adbafed724987de3067de7ca565fa0c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.355721 | 98 | 0.654719 |
from typing import (
Any,
Dict,
Iterator,
List,
Sequence,
Tuple,
Union,
Optional,
TYPE_CHECKING,
Set,
cast,
Callable,
TypeVar,
Generic,
)
import abc
import collections
import numpy as np
from cirq import circuits, ops, protocols, study, value, wo... | true | true |
1c47cab40dab1478d28390903e21858b737bfe1a | 1,859 | py | Python | tools/site_compare/commands/scrape.py | rwatson/chromium-capsicum | b03da8e897f897c6ad2cda03ceda217b760fd528 | [
"BSD-3-Clause"
] | 11 | 2015-03-20T04:08:08.000Z | 2021-11-15T15:51:36.000Z | tools/site_compare/commands/scrape.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | null | null | null | tools/site_compare/commands/scrape.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | 1 | 2020-04-13T05:45:10.000Z | 2020-04-13T05:45:10.000Z | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Command for scraping images from a URL or list of URLs.
Prerequisites:
1. The command_line package from tools/site_compar... | 29.983871 | 85 | 0.720818 |
import command_line
from drivers import windowing
from utils import browser_iterate
def CreateCommand(cmdline):
cmd = cmdline.AddCommand(
["scrape"],
"Scrapes an image from a URL or series of URLs.",
None,
ExecuteScrape)
browser_iterate.SetupIterationCommandLine(cmd)
cmd.AddArgument(
... | true | true |
1c47cad05b01e57c60e8dd11e39f42258a462d95 | 2,910 | py | Python | examples/orbslam_mono_kitti.py | frasermcghan/ORB_SLAM3-PythonBindings | a4fca4dbfbd70f31490e593f6c9e54c570827524 | [
"BSD-2-Clause",
"MIT"
] | 3 | 2021-11-12T06:11:19.000Z | 2022-03-17T04:24:25.000Z | examples/orbslam_mono_kitti.py | frasermcghan/ORB_SLAM3-PythonBindings | a4fca4dbfbd70f31490e593f6c9e54c570827524 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | examples/orbslam_mono_kitti.py | frasermcghan/ORB_SLAM3-PythonBindings | a4fca4dbfbd70f31490e593f6c9e54c570827524 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2021-11-12T06:11:23.000Z | 2021-11-12T06:11:23.000Z | #!/usr/bin/env python3
import sys
import os.path
import orbslam3
import time
import cv2
def main(vocab_path, settings_path, sequence_path):
image_filenames, timestamps = load_images(sequence_path)
num_images = len(image_filenames)
slam = orbslam3.System(vocab_path, settings_path, orbslam3.Sensor.MONOCUL... | 27.980769 | 99 | 0.56323 |
import sys
import os.path
import orbslam3
import time
import cv2
def main(vocab_path, settings_path, sequence_path):
image_filenames, timestamps = load_images(sequence_path)
num_images = len(image_filenames)
slam = orbslam3.System(vocab_path, settings_path, orbslam3.Sensor.MONOCULAR)
slam.set_use_v... | true | true |
1c47cae1d8d4dc028de321451ca5cca46d806629 | 2,498 | py | Python | utils/nodes_key_pair_updator/NodesKeyPairUpdator.py | dawidsielski/medical-data-share | e462ffcfe0650b4fed2bb113c331a2a7438a8509 | [
"MIT"
] | null | null | null | utils/nodes_key_pair_updator/NodesKeyPairUpdator.py | dawidsielski/medical-data-share | e462ffcfe0650b4fed2bb113c331a2a7438a8509 | [
"MIT"
] | null | null | null | utils/nodes_key_pair_updator/NodesKeyPairUpdator.py | dawidsielski/medical-data-share | e462ffcfe0650b4fed2bb113c331a2a7438a8509 | [
"MIT"
] | null | null | null | import os
import requests
import logging
from logging.handlers import TimedRotatingFileHandler
from urllib.parse import urljoin
from configparser import ConfigParser
from data_share import DataShare
from data_share.KeyGeneration import KeyGeneration
from nodes_available.NodesChecker import NodesChecker
from utils.req... | 33.756757 | 118 | 0.700961 | import os
import requests
import logging
from logging.handlers import TimedRotatingFileHandler
from urllib.parse import urljoin
from configparser import ConfigParser
from data_share import DataShare
from data_share.KeyGeneration import KeyGeneration
from nodes_available.NodesChecker import NodesChecker
from utils.req... | true | true |
1c47cc9cf70b865d84b86c603de769862667adeb | 1,701 | py | Python | pioneer/temp/mujoco_test.py | xdralex/pioneer | 1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607 | [
"MIT"
] | 2 | 2020-07-29T07:49:06.000Z | 2021-04-13T20:57:45.000Z | pioneer/temp/mujoco_test.py | xdralex/pioneer | 1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607 | [
"MIT"
] | null | null | null | pioneer/temp/mujoco_test.py | xdralex/pioneer | 1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607 | [
"MIT"
] | 2 | 2020-07-25T11:45:54.000Z | 2021-01-11T07:12:07.000Z | import mujoco_py
import numpy as np
from gym import spaces
model = mujoco_py.load_model_from_path('pioneer/envs/assets/pioneer2.xml')
sim = mujoco_py.MjSim(model)
print(f'timestep: {model.opt.timestep}')
bounds = model.jnt_range.copy().astype(np.float32)
low, high = bounds.T
position_space = spaces.Box(low=low, high... | 21 | 78 | 0.661376 | import mujoco_py
import numpy as np
from gym import spaces
model = mujoco_py.load_model_from_path('pioneer/envs/assets/pioneer2.xml')
sim = mujoco_py.MjSim(model)
print(f'timestep: {model.opt.timestep}')
bounds = model.jnt_range.copy().astype(np.float32)
low, high = bounds.T
position_space = spaces.Box(low=low, high... | true | true |
1c47cd19af43c4d1becad7a2ad917dd2ed58f098 | 10,620 | py | Python | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/DescribeScalingGroupsRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/DescribeScalingGroupsRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/DescribeScalingGroupsRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.4 | 80 | 0.789642 |
from aliyunsdkcore.request import RpcRequest
class DescribeScalingGroupsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Ess', '2014-08-28', 'DescribeScalingGroups','ess')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_Re... | true | true |
1c47cf10532163a7f13c7f50d06cffe8e0a01ccb | 580 | py | Python | chapter_4_MorphologicalAnalysis/30.0.py | takumi34/nlp_100 | b02e926627006c1004c611d249928de5ef22b60e | [
"BSD-3-Clause"
] | null | null | null | chapter_4_MorphologicalAnalysis/30.0.py | takumi34/nlp_100 | b02e926627006c1004c611d249928de5ef22b60e | [
"BSD-3-Clause"
] | null | null | null | chapter_4_MorphologicalAnalysis/30.0.py | takumi34/nlp_100 | b02e926627006c1004c611d249928de5ef22b60e | [
"BSD-3-Clause"
] | null | null | null | #夏目漱石『吾輩は猫である」を形態素解析し、その結果を保存する
#以後はこの解析データを使って問題を解く
from natto import MeCab
import os
import csv
fp = open("neko.txt","r", encoding="utf-8") #ファイルは<http://www.cl.ecei.tohoku.ac.jp/nlp100/>のもの
doc = fp.read()
nm = MeCab()
nm = MeCab("-Ochasen") #茶筅形式に出力フォーマットを変更
list_keitaiso = [i.split() for i in nm.parse(doc).s... | 22.307692 | 94 | 0.684483 |
from natto import MeCab
import os
import csv
fp = open("neko.txt","r", encoding="utf-8")
doc = fp.read()
nm = MeCab()
nm = MeCab("-Ochasen")
list_keitaiso = [i.split() for i in nm.parse(doc).splitlines()]
fp2= open('neko.txt.mecab', 'ab')
with open('neko.txt.mecab','a') as fp2:
writer = csv.writer((f... | false | true |
1c47d132a6791395267f3791dfb59ca1076cee0c | 360 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | # 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.
# ---------------------------------------------------------------------... | 45 | 76 | 0.444444 |
from .v2018_06_01.models import *
| true | true |
1c47d191e4ced18e1fb9d2ca1bfe78d40d28d1ae | 2,572 | py | Python | tests/Modules/Indexer/test_DIALS_indexer.py | xia2/xia2 | 18554e9b4d442e7c23a0c4ce93f51b491f77d4b7 | [
"BSD-3-Clause"
] | 10 | 2015-10-30T06:36:55.000Z | 2021-12-10T20:06:22.000Z | tests/Modules/Indexer/test_DIALS_indexer.py | xia2/xia2 | 18554e9b4d442e7c23a0c4ce93f51b491f77d4b7 | [
"BSD-3-Clause"
] | 528 | 2015-11-24T08:20:12.000Z | 2022-03-21T21:47:29.000Z | tests/Modules/Indexer/test_DIALS_indexer.py | xia2/xia2 | 18554e9b4d442e7c23a0c4ce93f51b491f77d4b7 | [
"BSD-3-Clause"
] | 14 | 2016-03-15T22:07:03.000Z | 2020-12-14T07:13:35.000Z | from unittest import mock
import os
import pytest
import sys
from dxtbx.model import ExperimentList
from xia2.Handlers.Phil import PhilIndex
from xia2.Modules.Indexer.DialsIndexer import DialsIndexer
from xia2.Schema.XCrystal import XCrystal
from xia2.Schema.XWavelength import XWavelength
from xia2.Schema.XSweep impo... | 34.293333 | 83 | 0.728616 | from unittest import mock
import os
import pytest
import sys
from dxtbx.model import ExperimentList
from xia2.Handlers.Phil import PhilIndex
from xia2.Modules.Indexer.DialsIndexer import DialsIndexer
from xia2.Schema.XCrystal import XCrystal
from xia2.Schema.XWavelength import XWavelength
from xia2.Schema.XSweep impo... | true | true |
1c47d2457497fd988ef9644f3fcee1f778042ce5 | 1,002 | py | Python | mayan/apps/common/tests/runner.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 2,743 | 2017-12-18T07:12:30.000Z | 2022-03-27T17:21:25.000Z | mayan/apps/common/tests/runner.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 15 | 2017-12-18T14:58:07.000Z | 2021-03-01T20:05:05.000Z | mayan/apps/common/tests/runner.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 257 | 2017-12-18T03:12:58.000Z | 2022-03-25T08:59:10.000Z | from __future__ import unicode_literals
from django import apps
from django.test.runner import DiscoverRunner
class MayanTestRunner(DiscoverRunner):
@classmethod
def add_arguments(cls, parser):
DiscoverRunner.add_arguments(parser)
parser.add_argument(
'--mayan-apps', action='store... | 31.3125 | 75 | 0.610778 | from __future__ import unicode_literals
from django import apps
from django.test.runner import DiscoverRunner
class MayanTestRunner(DiscoverRunner):
@classmethod
def add_arguments(cls, parser):
DiscoverRunner.add_arguments(parser)
parser.add_argument(
'--mayan-apps', action='store... | true | true |
1c47d318a097cab72248e74942e5b67d49d708de | 2,197 | py | Python | admin/gen-parameter-document.py | mmadsen/axelrod-ct | 90ea4319dd571546888c4d2a50255514e7d7fb94 | [
"Apache-2.0"
] | 5 | 2015-05-03T08:49:11.000Z | 2022-03-23T11:44:00.000Z | admin/gen-parameter-document.py | mmadsen/axelrod-ct | 90ea4319dd571546888c4d2a50255514e7d7fb94 | [
"Apache-2.0"
] | null | null | null | admin/gen-parameter-document.py | mmadsen/axelrod-ct | 90ea4319dd571546888c4d2a50255514e7d7fb94 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
"""
Generates a parameter document (to STDOUT) for a given configuration file. Allows a choice of
LaTeX and Markdo... | 28.166667 | 119 | 0.682294 |
"""
Generates a parameter document (to STDOUT) for a given configuration file. Allows a choice of
LaTeX and Markdown (Pandoc) formats.
"""
import logging as log
import argparse
import madsenlab.axelrod.utils as utils
def setup():
global args
parser = argparse.ArgumentParser()
parser.add_argu... | false | true |
1c47d4df07c1c10285d70b8e964f1a6a01f4327e | 6,932 | py | Python | kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py | Zac-hills/d3m-primitives | 1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d | [
"Apache-2.0"
] | 1 | 2020-05-22T14:00:09.000Z | 2020-05-22T14:00:09.000Z | kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py | Zac-hills/d3m-primitives | 1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d | [
"Apache-2.0"
] | 18 | 2020-07-20T07:00:45.000Z | 2022-03-12T00:37:57.000Z | kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py | Zac-hills/d3m-primitives | 1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d | [
"Apache-2.0"
] | 6 | 2020-06-03T20:13:24.000Z | 2021-12-06T18:21:32.000Z | import os.path
from typing import Sequence, Optional, Dict
import numpy as np
import pandas as pd
from nk_sent2vec import Sent2Vec as _Sent2Vec
from d3m import container, utils
from d3m.primitive_interfaces.transformer import TransformerPrimitiveBase
from d3m.primitive_interfaces.base import CallResult
from d3m.contai... | 37.879781 | 130 | 0.604443 | import os.path
from typing import Sequence, Optional, Dict
import numpy as np
import pandas as pd
from nk_sent2vec import Sent2Vec as _Sent2Vec
from d3m import container, utils
from d3m.primitive_interfaces.transformer import TransformerPrimitiveBase
from d3m.primitive_interfaces.base import CallResult
from d3m.contai... | true | true |
1c47d526b70baa1b7149d593ed8aec9074118df1 | 1,016 | py | Python | setup.py | PrabhuLoganathan/pro.developers.PySelFame-6 | 3ee45e672f84965f0b8b3ccf7f8daf0c7d871261 | [
"BSD-3-Clause"
] | null | null | null | setup.py | PrabhuLoganathan/pro.developers.PySelFame-6 | 3ee45e672f84965f0b8b3ccf7f8daf0c7d871261 | [
"BSD-3-Clause"
] | null | null | null | setup.py | PrabhuLoganathan/pro.developers.PySelFame-6 | 3ee45e672f84965f0b8b3ccf7f8daf0c7d871261 | [
"BSD-3-Clause"
] | null | null | null |
from setuptools import setup
setup(
name='knitter',
version='1.0.2',
author='Henry Wang',
author_email='skymatrix@126.com',
maintainer='Henry Wang',
maintainer_email='skymatrix@126.com',
url='https://github.com/hw712/Knitter',
description='A Web Automation Test Framework Ba... | 22.577778 | 101 | 0.626969 |
from setuptools import setup
setup(
name='knitter',
version='1.0.2',
author='Henry Wang',
author_email='skymatrix@126.com',
maintainer='Henry Wang',
maintainer_email='skymatrix@126.com',
url='https://github.com/hw712/Knitter',
description='A Web Automation Test Framework Ba... | true | true |
1c47d61e29b517b660c0f0ee0e55960b22da7061 | 202 | py | Python | mywebsite/users/tests/test_models.py | NyntoFive/mywebsite | 07af16c564f8a7c77763187cc4cd8742c91c6534 | [
"MIT"
] | null | null | null | mywebsite/users/tests/test_models.py | NyntoFive/mywebsite | 07af16c564f8a7c77763187cc4cd8742c91c6534 | [
"MIT"
] | null | null | null | mywebsite/users/tests/test_models.py | NyntoFive/mywebsite | 07af16c564f8a7c77763187cc4cd8742c91c6534 | [
"MIT"
] | null | null | null | import pytest
from mywebsite.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 20.2 | 64 | 0.772277 | import pytest
from mywebsite.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| true | true |
1c47d67efdc69d1364d3f7859468a66ce98d53af | 6,336 | py | Python | tests/integration/test_es.py | roguesupport/localstack | 087abb05fcb360297431ad8e5790c8014e0a80d7 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_es.py | roguesupport/localstack | 087abb05fcb360297431ad8e5790c8014e0a80d7 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_es.py | roguesupport/localstack | 087abb05fcb360297431ad8e5790c8014e0a80d7 | [
"Apache-2.0"
] | null | null | null | import logging
import threading
import botocore.exceptions
import pytest
from localstack import config
from localstack.constants import ELASTICSEARCH_DEFAULT_VERSION, OPENSEARCH_DEFAULT_VERSION
from localstack.services.install import install_elasticsearch, install_opensearch
from localstack.utils.common import safe_r... | 40.877419 | 103 | 0.72601 | import logging
import threading
import botocore.exceptions
import pytest
from localstack import config
from localstack.constants import ELASTICSEARCH_DEFAULT_VERSION, OPENSEARCH_DEFAULT_VERSION
from localstack.services.install import install_elasticsearch, install_opensearch
from localstack.utils.common import safe_r... | true | true |
1c47d7142612605ef5ca8a8c2d042e3d2166f135 | 5,609 | py | Python | aio_pika/robust_channel.py | askabelin/aio-pika | 38fd5897c556dd41624b8571b061f486e8e7508e | [
"Apache-2.0"
] | null | null | null | aio_pika/robust_channel.py | askabelin/aio-pika | 38fd5897c556dd41624b8571b061f486e8e7508e | [
"Apache-2.0"
] | null | null | null | aio_pika/robust_channel.py | askabelin/aio-pika | 38fd5897c556dd41624b8571b061f486e8e7508e | [
"Apache-2.0"
] | null | null | null | import asyncio
from typing import Callable, Any, Generator, Union
from logging import getLogger
from aio_pika.tools import create_future
from .compat import Awaitable
from .exchange import Exchange, ExchangeType
from .message import IncomingMessage
from .queue import Queue
from .common import BaseChannel, FutureStore... | 33.189349 | 112 | 0.63826 | import asyncio
from typing import Callable, Any, Generator, Union
from logging import getLogger
from aio_pika.tools import create_future
from .compat import Awaitable
from .exchange import Exchange, ExchangeType
from .message import IncomingMessage
from .queue import Queue
from .common import BaseChannel, FutureStore... | true | true |
1c47d7c374e86f2955d404bda2c09808e815f342 | 4,040 | py | Python | recipes/b2/portable/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | recipes/b2/portable/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/b2/portable/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class B2Conan(ConanFile):
name = "b2"
homepage = "https://www.bfgroup.xyz/b2/"
description = "B2 makes it easy to build C++ projects, everywhere."
topics = ("b2", "ins... | 41.22449 | 119 | 0.602723 | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class B2Conan(ConanFile):
name = "b2"
homepage = "https://www.bfgroup.xyz/b2/"
description = "B2 makes it easy to build C++ projects, everywhere."
topics = ("b2", "ins... | true | true |
1c47d83c488b457f490f24ffef2a609a22042fe3 | 2,173 | py | Python | tests/importer/onnx/basic/test_gemm.py | louareg/nncase | 0125654eb57b7ff753fe9c396c84b264c01f34d3 | [
"Apache-2.0"
] | null | null | null | tests/importer/onnx/basic/test_gemm.py | louareg/nncase | 0125654eb57b7ff753fe9c396c84b264c01f34d3 | [
"Apache-2.0"
] | null | null | null | tests/importer/onnx/basic/test_gemm.py | louareg/nncase | 0125654eb57b7ff753fe9c396c84b264c01f34d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2021 Canaan Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 32.432836 | 100 | 0.655315 |
import pytest
import onnx
from onnx import helper
from onnx import AttributeProto, TensorProto, GraphProto
import numpy as np
from onnx_test_runner import OnnxTestRunner
def _make_module():
input_A = helper.make_tensor_value_info('A', TensorProto.FLOAT, [112, 224])
input_B = helper.make_tensor("... | true | true |
1c47d8bd9f5b530094b55d25e5a8c3f6233d8908 | 140 | py | Python | src/pyggui/defaults/structures/__init__.py | 15minutOdmora/python-pyggui | 6675aeecfc7c47dac54a475dfb87d9e6b641041c | [
"MIT"
] | null | null | null | src/pyggui/defaults/structures/__init__.py | 15minutOdmora/python-pyggui | 6675aeecfc7c47dac54a475dfb87d9e6b641041c | [
"MIT"
] | null | null | null | src/pyggui/defaults/structures/__init__.py | 15minutOdmora/python-pyggui | 6675aeecfc7c47dac54a475dfb87d9e6b641041c | [
"MIT"
] | null | null | null | from pathlib import Path
# Define path constant at import time
PATH = Path(__file__).parent # Parent will fetch this files parent package
| 28 | 75 | 0.785714 | from pathlib import Path
PATH = Path(__file__).parent
| true | true |
1c47dad798962eed2a8ddb76b9b3510f811c3e95 | 1,682 | py | Python | sensors/tfmini_ros/scripts/ros_tfmini_laser_scanner.py | mascaaj/rosdonkeycar | 2e98b837d9ad3a7dd73a3083f0866476501a73e7 | [
"MIT"
] | null | null | null | sensors/tfmini_ros/scripts/ros_tfmini_laser_scanner.py | mascaaj/rosdonkeycar | 2e98b837d9ad3a7dd73a3083f0866476501a73e7 | [
"MIT"
] | null | null | null | sensors/tfmini_ros/scripts/ros_tfmini_laser_scanner.py | mascaaj/rosdonkeycar | 2e98b837d9ad3a7dd73a3083f0866476501a73e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
from tfmini_servo_scanner import *
import math
SERVO_GPIO = 18
SRV_ANGLE_MIN = math.radians(-85)
SRV_ANGLE_MAX = math.radians(85)
SRV_DUTY_ANGLE_MIN = 2350
SRV_DUTY_ANGLE_MAX = 700
SRV_TIME_MIN_MAX = 0.7
LASER_ANGLE_SAM... | 30.035714 | 121 | 0.648038 |
import rospy
from sensor_msgs.msg import LaserScan
from tfmini_servo_scanner import *
import math
SERVO_GPIO = 18
SRV_ANGLE_MIN = math.radians(-85)
SRV_ANGLE_MAX = math.radians(85)
SRV_DUTY_ANGLE_MIN = 2350
SRV_DUTY_ANGLE_MAX = 700
SRV_TIME_MIN_MAX = 0.7
LASER_ANGLE_SAMPLES = 50
def tfmin... | true | true |
1c47dbc173fc346ee1f5f5043ff56d7fb45daca5 | 633 | py | Python | backend/manage.py | crowdbotics-apps/apptest-33096 | ab08576d017c0ba776394073ffaeeac46d72b8d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/apptest-33096 | ab08576d017c0ba776394073ffaeeac46d72b8d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/apptest-33096 | ab08576d017c0ba776394073ffaeeac46d72b8d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apptest_33096.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ... | 28.772727 | 77 | 0.685624 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apptest_33096.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "... | true | true |
1c47dbeb5a981b28bb4113e5889393e507765b42 | 8,223 | py | Python | discord/ext/flags/_command.py | CircuitsBots/Flag-Parsing | e5e997ef4a4642d15066df1ee9b62de05e2c2bc2 | [
"MIT"
] | 3 | 2021-03-16T20:54:37.000Z | 2021-11-11T11:01:20.000Z | discord/ext/flags/_command.py | CircuitsBots/Flag-Parsing | e5e997ef4a4642d15066df1ee9b62de05e2c2bc2 | [
"MIT"
] | null | null | null | discord/ext/flags/_command.py | CircuitsBots/Flag-Parsing | e5e997ef4a4642d15066df1ee9b62de05e2c2bc2 | [
"MIT"
] | 2 | 2021-09-17T04:24:57.000Z | 2022-02-05T17:11:25.000Z | import shlex
from collections import namedtuple
import argparse
import sys
import discord
from discord.ext import commands
from discord.ext.commands import converter
from . import _parser
__all__ = ["add_flag", "command", "group", "FlagCommand", "FlagGroup"]
argument = namedtuple("argument", "args kwargs")
def c... | 37.377273 | 109 | 0.538246 | import shlex
from collections import namedtuple
import argparse
import sys
import discord
from discord.ext import commands
from discord.ext.commands import converter
from . import _parser
__all__ = ["add_flag", "command", "group", "FlagCommand", "FlagGroup"]
argument = namedtuple("argument", "args kwargs")
def c... | true | true |
1c47dc256aaf34a46737b9baba2f30bbed33feaf | 2,184 | py | Python | nuagevsdsim/simentities/nusimsapegressqosprofile.py | pdellaert/vspk-sim | 459a84366a9bdde82d74aca18ea866e3d55d62ee | [
"BSD-3-Clause"
] | null | null | null | nuagevsdsim/simentities/nusimsapegressqosprofile.py | pdellaert/vspk-sim | 459a84366a9bdde82d74aca18ea866e3d55d62ee | [
"BSD-3-Clause"
] | null | null | null | nuagevsdsim/simentities/nusimsapegressqosprofile.py | pdellaert/vspk-sim | 459a84366a9bdde82d74aca18ea866e3d55d62ee | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# BSD 3-Clause License
#
# Copyright (c) 2017, Nokia
# 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 no... | 39.709091 | 80 | 0.755952 |
from vspk import v5_0 as vsdk
from nuagevsdsim.simentities.nusimresource import NUSimResource
class NUSimSAPEgressQoSProfile(NUSimResource):
__vspk_class__ = vsdk.NUSAPEgressQoSProfile
__unique_fields__ = ['externalID']
__mandatory_fields__ = []
__default_fields__ = {
... | true | true |
1c47dc6133a02215bada1a3fbda451034cee9f3a | 2,563 | py | Python | python_module/SuperGLU/Services/DataTransforms/TableTransformService.py | GeneralizedLearningUtilities/SuperGLU | 1c373d1358431fb96dd70b324b26a14fc8ed1fcb | [
"MIT"
] | 8 | 2015-07-13T23:07:20.000Z | 2020-11-13T21:09:55.000Z | python_module/SuperGLU/Services/DataTransforms/TableTransformService.py | GeneralizedLearningUtilities/SuperGLU | 1c373d1358431fb96dd70b324b26a14fc8ed1fcb | [
"MIT"
] | 7 | 2016-01-13T12:13:56.000Z | 2021-12-14T21:12:28.000Z | python_module/SuperGLU/Services/DataTransforms/TableTransformService.py | GeneralizedLearningUtilities/SuperGLU | 1c373d1358431fb96dd70b324b26a14fc8ed1fcb | [
"MIT"
] | 6 | 2015-09-23T17:53:32.000Z | 2020-04-30T07:27:01.000Z | """
This service converts one table into another table,
by changing the headings (e.g., add, remove, re-sort),
and possibly adding calculated fields to the table.
"""
from SuperGLU.Core.MessagingGateway import BaseService
from SuperGLU.Services.DataTransforms.TableTransforms import TableTransformer
class TableTransfor... | 34.173333 | 88 | 0.65002 | """
This service converts one table into another table,
by changing the headings (e.g., add, remove, re-sort),
and possibly adding calculated fields to the table.
"""
from SuperGLU.Core.MessagingGateway import BaseService
from SuperGLU.Services.DataTransforms.TableTransforms import TableTransformer
class TableTransfor... | false | true |
1c47dccf6915887e22c7722e4d7c64ee109f4851 | 10,838 | py | Python | CTFd/views.py | ws4/TopCTFd | 3b1e25df1318e86ff163a0b546f6e9b7f8305a5a | [
"Apache-2.0"
] | 1 | 2019-06-25T09:24:29.000Z | 2019-06-25T09:24:29.000Z | CTFd/views.py | ws4/TopCTFd | 3b1e25df1318e86ff163a0b546f6e9b7f8305a5a | [
"Apache-2.0"
] | null | null | null | CTFd/views.py | ws4/TopCTFd | 3b1e25df1318e86ff163a0b546f6e9b7f8305a5a | [
"Apache-2.0"
] | null | null | null | import os
import re
from flask import current_app as app, render_template, request, redirect, abort, jsonify, url_for, session, Blueprint, Response, send_file
from flask.helpers import safe_join
from jinja2.exceptions import TemplateNotFound
from passlib.hash import bcrypt_sha256
from CTFd.models import db, Teams, So... | 40.140741 | 153 | 0.605462 | import os
import re
from flask import current_app as app, render_template, request, redirect, abort, jsonify, url_for, session, Blueprint, Response, send_file
from flask.helpers import safe_join
from jinja2.exceptions import TemplateNotFound
from passlib.hash import bcrypt_sha256
from CTFd.models import db, Teams, So... | true | true |
1c47ddab6db9862eac3c601311b8498882a12edb | 1,209 | py | Python | test.py | yyht/OpenAttack | 637e81a9c60874ec35f923d7c62687cbd6ee3633 | [
"MIT"
] | null | null | null | test.py | yyht/OpenAttack | 637e81a9c60874ec35f923d7c62687cbd6ee3633 | [
"MIT"
] | null | null | null | test.py | yyht/OpenAttack | 637e81a9c60874ec35f923d7c62687cbd6ee3633 | [
"MIT"
] | 1 | 2020-09-01T11:14:42.000Z | 2020-09-01T11:14:42.000Z | import OpenAttack
dataset = OpenAttack.loadDataset("SST")[0][:5]
clsf = OpenAttack.loadVictim("BiLSTM.SST")
rules = OpenAttack.attackers.SEAAttacker.get_rules(clsf, dataset)
triggers = OpenAttack.attackers.UATAttacker.get_triggers(clsf, dataset, word2id=clsf.config["word2id"], embedding=clsf.config["embedding"])
att... | 36.636364 | 139 | 0.74359 | import OpenAttack
dataset = OpenAttack.loadDataset("SST")[0][:5]
clsf = OpenAttack.loadVictim("BiLSTM.SST")
rules = OpenAttack.attackers.SEAAttacker.get_rules(clsf, dataset)
triggers = OpenAttack.attackers.UATAttacker.get_triggers(clsf, dataset, word2id=clsf.config["word2id"], embedding=clsf.config["embedding"])
att... | true | true |
1c47ded1a344d1cd51b13949d45a9106e2b325a5 | 1,220 | py | Python | algos/rl/ppo_ray_random.py | XiaoSanchez/autophase | 3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb | [
"BSD-3-Clause"
] | 14 | 2020-04-03T12:41:50.000Z | 2022-02-04T00:05:01.000Z | algos/rl/ppo_ray_random.py | XiaoSanchez/autophase | 3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb | [
"BSD-3-Clause"
] | 2 | 2020-03-02T04:32:58.000Z | 2021-09-15T20:02:25.000Z | algos/rl/ppo_ray_random.py | XiaoSanchez/autophase | 3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb | [
"BSD-3-Clause"
] | 8 | 2020-03-02T10:30:36.000Z | 2021-08-03T02:29:38.000Z | import ray
import ray.tune as tune
from ray.rllib.agents import ppo
from gym_hls.envs.hls_env import HLSEnv
from gym_hls.envs.hls_multi_env import HLSMultiEnv
ray.init()
env_configs = {}
from gym_hls.envs.random_bm import get_random
num_pgms = 1000
bms = get_random(N=num_pgms)
for i, bm in enumerate(bms):
pgm, file... | 27.727273 | 61 | 0.568852 | import ray
import ray.tune as tune
from ray.rllib.agents import ppo
from gym_hls.envs.hls_env import HLSEnv
from gym_hls.envs.hls_multi_env import HLSMultiEnv
ray.init()
env_configs = {}
from gym_hls.envs.random_bm import get_random
num_pgms = 1000
bms = get_random(N=num_pgms)
for i, bm in enumerate(bms):
pgm, file... | true | true |
1c47df1a360b94aa764852cc2aa26849ae5db656 | 178 | py | Python | src/users/admin.py | chiliseed/hub | 83f29fbdd12e2260397e18e635f508459fa4990e | [
"Apache-2.0"
] | null | null | null | src/users/admin.py | chiliseed/hub | 83f29fbdd12e2260397e18e635f508459fa4990e | [
"Apache-2.0"
] | 4 | 2021-04-08T20:10:15.000Z | 2021-06-10T20:18:17.000Z | src/users/admin.py | chiliseed/hub | 83f29fbdd12e2260397e18e635f508459fa4990e | [
"Apache-2.0"
] | null | null | null | """Django admin ui for users."""
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
admin.site.register(User, UserAdmin)
| 22.25 | 47 | 0.786517 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
admin.site.register(User, UserAdmin)
| true | true |
1c47e205f85d9c9e839f341b0ccf620d6cab46cc | 421 | py | Python | Ejemplos/ejemplo13/src/main2.py | ampotty/uip-pc3 | 8362680226df6629791e7a4c6cdf1b738eadc5de | [
"MIT"
] | 10 | 2015-10-27T18:29:06.000Z | 2019-04-03T04:05:31.000Z | Ejemplos/ejemplo13/src/main2.py | abdelgmartinezl/uip-pc3 | 8362680226df6629791e7a4c6cdf1b738eadc5de | [
"MIT"
] | 5 | 2015-10-13T01:12:51.000Z | 2016-10-08T18:01:17.000Z | Ejemplos/ejemplo13/src/main2.py | ampotty/uip-pc3 | 8362680226df6629791e7a4c6cdf1b738eadc5de | [
"MIT"
] | 25 | 2015-09-19T00:40:17.000Z | 2018-02-08T02:54:55.000Z | total = 0
cont1 = 0
while True:
nota = int(input("Calificacion (negativo para salir): "))
if nota < 0:
break
cont1 += 1
total = total + nota
if cont1 != 0:
promedio = total / cont1
else:
promedio = 0
if promedio >= 91:
print("Saca A",promedio)
elif promedio >= 81:
print("Saca B",... | 21.05 | 61 | 0.605701 | total = 0
cont1 = 0
while True:
nota = int(input("Calificacion (negativo para salir): "))
if nota < 0:
break
cont1 += 1
total = total + nota
if cont1 != 0:
promedio = total / cont1
else:
promedio = 0
if promedio >= 91:
print("Saca A",promedio)
elif promedio >= 81:
print("Saca B",... | true | true |
1c47e2bbbb869849f0c26e0f9ceb36f00f7e3eca | 671 | py | Python | manage.py | Lioncat2002/confession_site | 3b1d209b06cb1eac4b43f5c59cb70d2cfb49d25c | [
"MIT"
] | null | null | null | manage.py | Lioncat2002/confession_site | 3b1d209b06cb1eac4b43f5c59cb70d2cfb49d25c | [
"MIT"
] | null | null | null | manage.py | Lioncat2002/confession_site | 3b1d209b06cb1eac4b43f5c59cb70d2cfb49d25c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'confession_site.settings')
try:
from django.core.management import execute_from_command_line
exc... | 29.173913 | 79 | 0.682563 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'confession_site.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and... | true | true |
1c47e4640389cb25f44fd436d0754a0c9ecffe9f | 33,651 | py | Python | trax/rl/actor_critic.py | YannickWehr/trax | 67dda3b236339a7f6de803a3f84a9e92d0f0442c | [
"Apache-2.0"
] | null | null | null | trax/rl/actor_critic.py | YannickWehr/trax | 67dda3b236339a7f6de803a3f84a9e92d0f0442c | [
"Apache-2.0"
] | null | null | null | trax/rl/actor_critic.py | YannickWehr/trax | 67dda3b236339a7f6de803a3f84a9e92d0f0442c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.238971 | 109 | 0.673799 |
import functools
import os
import gym
import numpy as np
import tensorflow as tf
from trax import data
from trax import fastmath
from trax import layers as tl
from trax import shapes
from trax import supervised
from trax.fastmath import numpy as jnp
from trax.rl import advantages as rl_advantages
fro... | true | true |
1c47e51dc09808eb307a0a839a939f5466b84977 | 576 | py | Python | centralized/cbs/EdgeConstraint.py | mengwei1/multi_agent_path_planning | 079a4af80c074e571a802af4506d416db5c6946a | [
"MIT"
] | null | null | null | centralized/cbs/EdgeConstraint.py | mengwei1/multi_agent_path_planning | 079a4af80c074e571a802af4506d416db5c6946a | [
"MIT"
] | null | null | null | centralized/cbs/EdgeConstraint.py | mengwei1/multi_agent_path_planning | 079a4af80c074e571a802af4506d416db5c6946a | [
"MIT"
] | null | null | null | class EdgeConstraint(object):
def __init__(self, time, location_1, location_2):
self.time = time
self.location_1 = location_1
self.location_2 = location_2
def __eq__(self, other):
return self.time == other.time and self.location_1 == other.location_1 \
and self.locat... | 36 | 98 | 0.631944 | class EdgeConstraint(object):
def __init__(self, time, location_1, location_2):
self.time = time
self.location_1 = location_1
self.location_2 = location_2
def __eq__(self, other):
return self.time == other.time and self.location_1 == other.location_1 \
and self.locat... | true | true |
1c47e54c14f7d0bfeffe7567306b5ecd63f6ed02 | 473 | py | Python | old/markup_dude.py | karuvally/markup_dude | 2307a3e35ed0b899aa5c2256d4bedece09de8299 | [
"MIT"
] | 1 | 2021-04-04T08:59:17.000Z | 2021-04-04T08:59:17.000Z | old/markup_dude.py | karuvally/markup_dude | 2307a3e35ed0b899aa5c2256d4bedece09de8299 | [
"MIT"
] | null | null | null | old/markup_dude.py | karuvally/markup_dude | 2307a3e35ed0b899aa5c2256d4bedece09de8299 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Convert Markdown to HTML, made for https://karuvally.github.io
# Import required libraries
import argparse
# Parse markdown
def parse_md(md_file):
# The main function
def main():
pass
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = "Convert M... | 17.518519 | 64 | 0.64482 |
import argparse
def parse_md(md_file):
def main():
pass
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = "Convert Markdown to HTML"
)
parser.add_argument(
"INPUT",
type = str,
help = "Markdown document for conversion"
)
mai... | false | true |
1c47e7970da9d61be8311b50ed64ed5185e5dfd2 | 4,712 | py | Python | tests/test_albumentations_pytorch.py | brandongk-ubco/autoalbument | 1735ea4376694c2179ac62ce7d100a10b26f2558 | [
"MIT"
] | 135 | 2020-11-03T15:48:30.000Z | 2022-03-16T10:52:57.000Z | tests/test_albumentations_pytorch.py | brandongk-ubco/autoalbument | 1735ea4376694c2179ac62ce7d100a10b26f2558 | [
"MIT"
] | 31 | 2020-11-04T10:20:56.000Z | 2022-03-24T13:46:07.000Z | tests/test_albumentations_pytorch.py | brandongk-ubco/autoalbument | 1735ea4376694c2179ac62ce7d100a10b26f2558 | [
"MIT"
] | 16 | 2020-11-16T08:33:48.000Z | 2022-03-17T18:34:24.000Z | import albumentations.augmentations.functional as F
import pytest
import torch
from torch.autograd import gradcheck
import autoalbument.albumentations_pytorch.functional as PF
from tests.utils import assert_batches_match
class Base:
def scalar_to_tensor(self, arg, requires_grad=False, dtype=torch.float32):
... | 28.215569 | 105 | 0.66702 | import albumentations.augmentations.functional as F
import pytest
import torch
from torch.autograd import gradcheck
import autoalbument.albumentations_pytorch.functional as PF
from tests.utils import assert_batches_match
class Base:
def scalar_to_tensor(self, arg, requires_grad=False, dtype=torch.float32):
... | true | true |
1c47e7ea31e47aede41afd960aa65ae5de620bf1 | 1,379 | py | Python | notifications/migrations/0001_initial.py | ABERT-NOLA/App-Instagram | f1394a96baa8e19a5b4b8b1c96917b9da5f3fe43 | [
"MIT"
] | 1 | 2020-11-17T09:00:59.000Z | 2020-11-17T09:00:59.000Z | notifications/migrations/0001_initial.py | kahenya-anita/Insta-Clone | 4894e959c17170505e73aee6dc497aeb29d55a71 | [
"MIT"
] | null | null | null | notifications/migrations/0001_initial.py | kahenya-anita/Insta-Clone | 4894e959c17170505e73aee6dc497aeb29d55a71 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-15 12:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('post', '0001_initial'),
migrations.swappable_dependency(setting... | 43.09375 | 154 | 0.643945 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('post', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
1c47e85f18698ee4a933fa7ead51a9efaadf9d71 | 6,007 | py | Python | views.py | penzance/student_locations | 44618a237a9061dbc9d705810ad88d255781f44d | [
"MIT"
] | 1 | 2015-06-12T13:48:42.000Z | 2015-06-12T13:48:42.000Z | views.py | penzance/student_locations | 44618a237a9061dbc9d705810ad88d255781f44d | [
"MIT"
] | null | null | null | views.py | penzance/student_locations | 44618a237a9061dbc9d705810ad88d255781f44d | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, render_to_response
from django.views.decorators.http import require_http_methods
from ims_lti_py.tool_config import ToolConfig
from django.conf import settings
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.... | 37.080247 | 167 | 0.715832 | from django.shortcuts import render, redirect, render_to_response
from django.views.decorators.http import require_http_methods
from ims_lti_py.tool_config import ToolConfig
from django.conf import settings
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.... | true | true |
1c47e8a94158577824e18e7417db7b1bfc6b3d7a | 3,111 | py | Python | sigeco/settings.py | edusantana/sigeco | 5e9e612e2721b170d770b73a36df4b92c94bed6f | [
"MIT"
] | null | null | null | sigeco/settings.py | edusantana/sigeco | 5e9e612e2721b170d770b73a36df4b92c94bed6f | [
"MIT"
] | null | null | null | sigeco/settings.py | edusantana/sigeco | 5e9e612e2721b170d770b73a36df4b92c94bed6f | [
"MIT"
] | null | null | null | """
Django settings for sigeco project.
Generated by 'django-admin startproject' using Django 2.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
# ... | 25.292683 | 91 | 0.693346 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '9l%mu66ff)sre+8$(j%&3%(3an+i+-di$o(v^wk0)y)!i92jit'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c47e8b8f9a966f714a9afcbcc891fafd92fb95b | 1,232 | py | Python | tests/models.py | viralogic/py-queryable | 12034ee04eaa176676df84cb49665c6a9f741f01 | [
"MIT"
] | null | null | null | tests/models.py | viralogic/py-queryable | 12034ee04eaa176676df84cb49665c6a9f741f01 | [
"MIT"
] | 1 | 2018-10-04T22:13:18.000Z | 2018-10-18T04:01:59.000Z | tests/models.py | viralogic/py-queryable | 12034ee04eaa176676df84cb49665c6a9f741f01 | [
"MIT"
] | null | null | null | from py_queryable import Model
from py_queryable import Column, PrimaryKey, ForeignKey
class StubModel(Model):
__table_name__ = u'test_table'
test_int_column = Column(int, 'int_column')
class StubModel2(Model):
__table_name__ = u'test_table'
test_int_column = Column(int)
class StubPrimary(Model):
... | 25.142857 | 67 | 0.722403 | from py_queryable import Model
from py_queryable import Column, PrimaryKey, ForeignKey
class StubModel(Model):
__table_name__ = u'test_table'
test_int_column = Column(int, 'int_column')
class StubModel2(Model):
__table_name__ = u'test_table'
test_int_column = Column(int)
class StubPrimary(Model):
... | true | true |
1c47e91ab2f55e136165d27492cfb7b3e29d06ea | 2,056 | py | Python | scripts/_helpers.py | fneum/core-tso-data | 480b1ea7524adc5d5425165668989fc9dd412e90 | [
"MIT"
] | null | null | null | scripts/_helpers.py | fneum/core-tso-data | 480b1ea7524adc5d5425165668989fc9dd412e90 | [
"MIT"
] | 1 | 2022-02-07T14:41:52.000Z | 2022-02-07T14:41:52.000Z | scripts/_helpers.py | fneum/core-tso-data | 480b1ea7524adc5d5425165668989fc9dd412e90 | [
"MIT"
] | 4 | 2022-01-12T17:09:16.000Z | 2022-02-07T14:36:21.000Z | # from https://github.com/PyPSA/pypsa-eur/blob/master/scripts/_helpers.py
import pypsa
from pathlib import Path
def mock_snakemake(rulename, **wildcards):
"""
This function is expected to be executed from the 'scripts'-directory of '
the snakemake project. It returns a snakemake.script.Snakemake object,
... | 30.686567 | 89 | 0.646401 |
import pypsa
from pathlib import Path
def mock_snakemake(rulename, **wildcards):
import snakemake as sm
import os
from pypsa.descriptors import Dict
from snakemake.script import Snakemake
script_dir = Path(__file__).parent.resolve()
assert (
Path.cwd().resolve() == script_dir
),... | true | true |
1c47e955191e482356b4dccd864bc429173b5548 | 4,999 | py | Python | frontend/app/export.py | emsch/femida | 48de931c5d563e7fd354e6593a702f2397fd566f | [
"Apache-2.0"
] | null | null | null | frontend/app/export.py | emsch/femida | 48de931c5d563e7fd354e6593a702f2397fd566f | [
"Apache-2.0"
] | 52 | 2018-09-16T13:08:09.000Z | 2020-06-07T09:30:27.000Z | frontend/app/export.py | emsch/femida | 48de931c5d563e7fd354e6593a702f2397fd566f | [
"Apache-2.0"
] | 10 | 2018-09-26T20:06:41.000Z | 2020-06-16T17:35:59.000Z | #!/usr/bin/env python3
import datetime
import json
import xlsxwriter
from io import BytesIO
from flask import (
Blueprint,
send_file
)
from bson import json_util
from collections import Counter
mod_export = Blueprint('export', __name__)
from database import mongo # noqa
pdfs = mongo.db.pdfs
answers = mongo... | 32.888158 | 96 | 0.561312 |
import datetime
import json
import xlsxwriter
from io import BytesIO
from flask import (
Blueprint,
send_file
)
from bson import json_util
from collections import Counter
mod_export = Blueprint('export', __name__)
from database import mongo
pdfs = mongo.db.pdfs
answers = mongo.db.answers
class Col:
... | true | true |
1c47ea8507d115500d6e829758a110c6bab5ce7d | 4,322 | py | Python | anima/env/fusion/render_merger.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 101 | 2015-02-08T22:20:11.000Z | 2022-03-21T18:56:42.000Z | anima/env/fusion/render_merger.py | Khosiyat/anima | f631c08400547f49ac5f1feeb730f22c255eb771 | [
"MIT"
] | 23 | 2016-11-30T08:33:21.000Z | 2021-01-26T12:11:12.000Z | anima/env/fusion/render_merger.py | Khosiyat/anima | f631c08400547f49ac5f1feeb730f22c255eb771 | [
"MIT"
] | 27 | 2015-01-03T06:49:45.000Z | 2021-12-28T03:30:54.000Z | # -*- coding: utf-8 -*-
"""Merges sliced renders in to one big plate
"""
try:
# for Fusion 6 and 7
import PeyeonScript as bmf
except ImportError:
# for Fusion 8+
import BlackmagicFusion as bmf
from anima.env.fusion.utils import NodeUtils
class RenderMerger(object):
"""A tool to merge sliced rend... | 30.013889 | 93 | 0.519435 |
try:
import PeyeonScript as bmf
except ImportError:
import BlackmagicFusion as bmf
from anima.env.fusion.utils import NodeUtils
class RenderMerger(object):
def __init__(self, path="", slices_in_x=5, slices_in_y=5, plate_width=0, plate_height=0):
self.fusion = bmf.scriptapp("Fusion")
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.