hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72660bfc1f52e8bce65d7defe6754157512b67a | 3,196 | py | Python | grr/server/grr_response_server/databases/mem.py | billstackpole/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2019-03-28T07:09:41.000Z | 2019-03-28T07:09:41.000Z | grr/server/grr_response_server/databases/mem.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/databases/mem.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2018-08-30T14:50:24.000Z | 2018-08-30T14:50:24.000Z | #!/usr/bin/env python
"""An in memory database implementation used for testing."""
import sys
import threading
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import utils
from grr_response_server import db
from grr_response_server.databases import mem_blobs
from grr_response_server.databases i... | 31.643564 | 76 | 0.708385 |
import sys
import threading
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import utils
from grr_response_server import db
from grr_response_server.databases import mem_blobs
from grr_response_server.databases import mem_clients
from grr_response_server.databases import mem_cronjobs
from grr_... | true | true |
f726618245de60741ddd3c6b158e46d436440d0d | 751 | py | Python | example1.py | djinn/python-duckduckgo | e4bb5729cdf8c1e086226760af01e2c0c7dbb500 | [
"BSD-3-Clause"
] | 2 | 2015-02-19T10:41:31.000Z | 2021-11-12T11:42:48.000Z | example1.py | djinn/python-duckduckgo | e4bb5729cdf8c1e086226760af01e2c0c7dbb500 | [
"BSD-3-Clause"
] | null | null | null | example1.py | djinn/python-duckduckgo | e4bb5729cdf8c1e086226760af01e2c0c7dbb500 | [
"BSD-3-Clause"
] | null | null | null | from duckduckgo import query, Topic
from sys import argv
visited = []
def build_web_tree(qr, depth=0):
print ' '* depth * 4 + qr
ds = query(qr)
if depth == 2:
return
if ds.error_code != 0:
return
visited.append(qr)
if ds.related == []:
return
else:
for r ... | 25.896552 | 80 | 0.50466 | from duckduckgo import query, Topic
from sys import argv
visited = []
def build_web_tree(qr, depth=0):
print ' '* depth * 4 + qr
ds = query(qr)
if depth == 2:
return
if ds.error_code != 0:
return
visited.append(qr)
if ds.related == []:
return
else:
for r ... | false | true |
f726620976060383077043d92b478dbeab78b397 | 571 | py | Python | migrations/versions/51387d8fda8d_add_default_value_to_is_invited.py | sicness9/BugHub | 2af45b0840757f7826927d4fefc0e626fef136e1 | [
"FTL"
] | null | null | null | migrations/versions/51387d8fda8d_add_default_value_to_is_invited.py | sicness9/BugHub | 2af45b0840757f7826927d4fefc0e626fef136e1 | [
"FTL"
] | null | null | null | migrations/versions/51387d8fda8d_add_default_value_to_is_invited.py | sicness9/BugHub | 2af45b0840757f7826927d4fefc0e626fef136e1 | [
"FTL"
] | null | null | null | """add default value to is_invited
Revision ID: 51387d8fda8d
Revises: 6779bebb64e6
Create Date: 2021-12-21 18:19:50.864781
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '51387d8fda8d'
down_revision = '6779bebb64e6'
branch_labels = None
depends_on = None
def... | 19.689655 | 65 | 0.691769 | from alembic import op
import sqlalchemy as sa
revision = '51387d8fda8d'
down_revision = '6779bebb64e6'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f7266308ffe97be95f1df1a47115c73c0ac247a1 | 6,815 | py | Python | main.py | drkostas/COSC525-Project2 | a33c786621e6047b0a586c7c3a3b5b85cb51fd6d | [
"Apache-2.0"
] | null | null | null | main.py | drkostas/COSC525-Project2 | a33c786621e6047b0a586c7c3a3b5b85cb51fd6d | [
"Apache-2.0"
] | null | null | null | main.py | drkostas/COSC525-Project2 | a33c786621e6047b0a586c7c3a3b5b85cb51fd6d | [
"Apache-2.0"
] | null | null | null | import traceback
import argparse
import numpy as np
from src import NeuralNetwork, generateExample, getTensorExample
from typing import *
def get_args() -> argparse.Namespace:
"""Set-up the argument parser
Returns:
argparse.Namespace:
"""
parser = argparse.ArgumentParser(
description=... | 42.329193 | 101 | 0.612032 | import traceback
import argparse
import numpy as np
from src import NeuralNetwork, generateExample, getTensorExample
from typing import *
def get_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description='Project 2 for the Deep Learning class (COSC 525). '
'Involves t... | true | true |
f72665b02611c25f6224783cfd40d4362312e741 | 62,701 | py | Python | tests/job_metadata.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | tests/job_metadata.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | tests/job_metadata.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | 3 | 2019-10-24T11:40:06.000Z | 2022-02-24T07:34:00.000Z | """
job_metadata api data import unit tests.
Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
- ... | 49.023456 | 120 | 0.54409 |
import json
from flask import url_for
from _fixtures import *
from _helpers import job_metadata_importer
import dirbs.metadata as metadata
def test_classification_json_api(flask_app, db_conn, api_version):
extra_metadata = {'matched_imei_counts':
{'compound_dimension': 0,
... | true | true |
f726669c4c59c770ca27ddaf00f3eafdc8ca9522 | 3,606 | py | Python | mocks/mock.py | pandora-auth-ros-pkg/dashboard | 0e66c47d1987e1dfdc91dcd4f876791673938158 | [
"MIT"
] | 1 | 2016-04-01T02:37:05.000Z | 2016-04-01T02:37:05.000Z | mocks/mock.py | pandora-auth-ros-pkg/dashboard | 0e66c47d1987e1dfdc91dcd4f876791673938158 | [
"MIT"
] | null | null | null | mocks/mock.py | pandora-auth-ros-pkg/dashboard | 0e66c47d1987e1dfdc91dcd4f876791673938158 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from time import sleep
import random
import sys
import rospy
from rospy import Publisher, init_node
from sensor_msgs.msg import Range
from pandora_data_fusion_msgs.msg import VictimProbabilities
from pandora_sensor_msgs.msg import BatteryMsg, Co2Msg, Temper... | 28.848 | 70 | 0.642818 |
from __future__ import print_function
from time import sleep
import random
import sys
import rospy
from rospy import Publisher, init_node
from sensor_msgs.msg import Range
from pandora_data_fusion_msgs.msg import VictimProbabilities
from pandora_sensor_msgs.msg import BatteryMsg, Co2Msg, Temperature
from pandora_se... | true | true |
f72666c6d7fa28865bf0cc1af0a8928f8b710444 | 674 | py | Python | src/gufo/err/failfast/always.py | gufolabs/gufo_err | d3996f355b38a3efe1fa3ecae578846ffebd7790 | [
"BSD-3-Clause"
] | null | null | null | src/gufo/err/failfast/always.py | gufolabs/gufo_err | d3996f355b38a3efe1fa3ecae578846ffebd7790 | [
"BSD-3-Clause"
] | null | null | null | src/gufo/err/failfast/always.py | gufolabs/gufo_err | d3996f355b38a3efe1fa3ecae578846ffebd7790 | [
"BSD-3-Clause"
] | null | null | null | # ---------------------------------------------------------------------
# Gufo Err: AlwaysFailFast
# ---------------------------------------------------------------------
# Copyright (C) 2022, Gufo Labs
# ---------------------------------------------------------------------
# Python modules
from typing import Type
fro... | 24.962963 | 71 | 0.449555 |
from typing import Type
from types import TracebackType
from ..abc.failfast import BaseFailFast
class AlwaysFailFast(BaseFailFast):
def must_die(
self,
t: Type[BaseException],
v: BaseException,
tb: TracebackType,
) -> bool:
return True
| true | true |
f726670921d44f21aa09f17d795a742ee0c1fa0c | 8,397 | py | Python | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | test/bitfinex_test.py | laisee/bitfinex | 6a3e7cd412f186eca0039602d32c65938a392747 | [
"MIT"
] | null | null | null | import unittest
import mock
import requests
import httpretty
import settings
from bitfinex.client import Client, TradeClient
API_KEY = settings.API_KEY
API_SECRET = settings.API_SECRET
class BitfinexTest(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_should_have_server(self):... | 37.995475 | 400 | 0.609265 | import unittest
import mock
import requests
import httpretty
import settings
from bitfinex.client import Client, TradeClient
API_KEY = settings.API_KEY
API_SECRET = settings.API_SECRET
class BitfinexTest(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_should_have_server(self):... | true | true |
f726671fe689fac6b9c56332427272898befdccc | 388 | py | Python | api/v10/urls.py | huylb314/sample-django | 5c53e05ccd62abc075e4a9942681ab845d5be2e0 | [
"MIT"
] | null | null | null | api/v10/urls.py | huylb314/sample-django | 5c53e05ccd62abc075e4a9942681ab845d5be2e0 | [
"MIT"
] | null | null | null | api/v10/urls.py | huylb314/sample-django | 5c53e05ccd62abc075e4a9942681ab845d5be2e0 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
from django.views.decorators.csrf import csrf_exempt
#GET charts?userid=0&clientid=1
#GET charts?userid=0&clientid=1&chartid=2
#DELETE charts?userid=0&clientid=1&chartid=2
#POST charts?userid=0&clientid=1&chartid=2
#POST charts?userid=0&clientid=1
url... | 27.714286 | 53 | 0.744845 | from django.conf.urls import url
from . import views
from django.views.decorators.csrf import csrf_exempt
urlpatterns = [
url(r'^charts$', csrf_exempt(views.doTheMagic)),
]
| true | true |
f7266798c32cdc9f7db93d85cd1ba7543a2f7525 | 4,011 | py | Python | users/views.py | mayronH/desafio-frexco | 636b0d5ef11cb663cb46c022eed69fe8fcee49e3 | [
"MIT"
] | null | null | null | users/views.py | mayronH/desafio-frexco | 636b0d5ef11cb663cb46c022eed69fe8fcee49e3 | [
"MIT"
] | null | null | null | users/views.py | mayronH/desafio-frexco | 636b0d5ef11cb663cb46c022eed69fe8fcee49e3 | [
"MIT"
] | null | null | null | import csv
import xlsxwriter
import io
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext
from users.models import Cu... | 29.065217 | 102 | 0.612565 | import csv
import xlsxwriter
import io
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext
from users.models import Cu... | true | true |
f72667a1d24d7941c968cd6a40963f081df72e57 | 2,540 | py | Python | tests/unit/kubernetes/test_Ssh.py | owasp-sbot/OSBot-K8s | 74403194481215abb24ca82714bd23ea51b33dfd | [
"Apache-2.0"
] | null | null | null | tests/unit/kubernetes/test_Ssh.py | owasp-sbot/OSBot-K8s | 74403194481215abb24ca82714bd23ea51b33dfd | [
"Apache-2.0"
] | null | null | null | tests/unit/kubernetes/test_Ssh.py | owasp-sbot/OSBot-K8s | 74403194481215abb24ca82714bd23ea51b33dfd | [
"Apache-2.0"
] | null | null | null | import os
from unittest import TestCase
import pytest
from dotenv import load_dotenv
from pytest import skip
from osbot_utils.utils.Files import file_not_exists
from osbot_k8s.kubernetes.Ssh import Ssh
@pytest.mark.skip('needs live server') # todo add to test setup the creation of pods and nodes we can S... | 35.277778 | 136 | 0.606693 | import os
from unittest import TestCase
import pytest
from dotenv import load_dotenv
from pytest import skip
from osbot_utils.utils.Files import file_not_exists
from osbot_k8s.kubernetes.Ssh import Ssh
@pytest.mark.skip('needs live server')
class test_Ssh(TestCase):
def setUp(self) -> None:
... | true | true |
f72667ffda4b29a371dcff42c53030225f8f2e83 | 331 | py | Python | app/main/forms.py | DevWaweru/Watchlist | e9671c61fc543668b82fd1422fad0f6483640cca | [
"MIT"
] | null | null | null | app/main/forms.py | DevWaweru/Watchlist | e9671c61fc543668b82fd1422fad0f6483640cca | [
"MIT"
] | null | null | null | app/main/forms.py | DevWaweru/Watchlist | e9671c61fc543668b82fd1422fad0f6483640cca | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class ReviewForm(FlaskForm):
title = StringField('Review Title', validators=[Required()])
review = TextAreaField('Movie review',validators=[Required()])
submit = SubmitField('Su... | 36.777778 | 66 | 0.770393 | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class ReviewForm(FlaskForm):
title = StringField('Review Title', validators=[Required()])
review = TextAreaField('Movie review',validators=[Required()])
submit = SubmitField('Su... | true | true |
f72668f9f0f1bcd1855b3e06f521866410ab3bc5 | 23,269 | py | Python | InvenTree/company/models.py | inmys/InvenTree | a0d1622926ba9a13839adfe64a8fe21c073692f2 | [
"MIT"
] | null | null | null | InvenTree/company/models.py | inmys/InvenTree | a0d1622926ba9a13839adfe64a8fe21c073692f2 | [
"MIT"
] | null | null | null | InvenTree/company/models.py | inmys/InvenTree | a0d1622926ba9a13839adfe64a8fe21c073692f2 | [
"MIT"
] | null | null | null | """
Company database model definitions
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MinValueValidator
from django.core.exceptions import ValidationError
from django.db import models
from djang... | 32.408078 | 194 | 0.628089 |
from __future__ import unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MinValueValidator
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Sum, Q, UniqueConstraint
from django.apps impo... | true | true |
f7266b0a144bf41133781daf4df6f25ffb28d3a9 | 463 | py | Python | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_table_dark_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_table_dark_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_table_dark_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/jedi/shared_frn_all_table_dark_01.iff"
result.attribute_t... | 27.235294 | 84 | 0.736501 | true | true | |
f7266b31a38ebc7a5721d50d8c4e8bcd245cd5d2 | 292 | py | Python | tests/urls.py | pkeeper/pdf-crawler-test | 7f8b9ca135fae7301f7902ada3669cf82726c4e0 | [
"MIT"
] | null | null | null | tests/urls.py | pkeeper/pdf-crawler-test | 7f8b9ca135fae7301f7902ada3669cf82726c4e0 | [
"MIT"
] | null | null | null | tests/urls.py | pkeeper/pdf-crawler-test | 7f8b9ca135fae7301f7902ada3669cf82726c4e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from pdf_crawler_test.urls import urlpatterns as pdf_crawler_test_urls
urlpatterns = [
url(r'^', include(pdf_crawler_test_urls, namespace='pdf_crawler_test')),
]
| 26.545455 | 76 | 0.777397 |
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from pdf_crawler_test.urls import urlpatterns as pdf_crawler_test_urls
urlpatterns = [
url(r'^', include(pdf_crawler_test_urls, namespace='pdf_crawler_test')),
]
| true | true |
f7266dca016862413492651e6ea69b794172bb4d | 1,926 | py | Python | src/ksl.py | adnan007d/scraping-jobs-for-alex | 393c2f703d939cdf5944faa59863336070b611f3 | [
"MIT"
] | null | null | null | src/ksl.py | adnan007d/scraping-jobs-for-alex | 393c2f703d939cdf5944faa59863336070b611f3 | [
"MIT"
] | null | null | null | src/ksl.py | adnan007d/scraping-jobs-for-alex | 393c2f703d939cdf5944faa59863336070b611f3 | [
"MIT"
] | null | null | null | import time
import json
import requests
import urllib3
from random import randint
from bs4 import BeautifulSoup
from threading import Thread
urllib3.disable_warnings()
BASE_URL = "https://jobs.ksl.com/search/posted/last-7-days"
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/... | 26.027027 | 141 | 0.648494 | import time
import json
import requests
import urllib3
from random import randint
from bs4 import BeautifulSoup
from threading import Thread
urllib3.disable_warnings()
BASE_URL = "https://jobs.ksl.com/search/posted/last-7-days"
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/... | true | true |
f7266f67638e9576f4b43d525e963cfc0fa2a7b5 | 536 | py | Python | sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/__init__.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/__init__.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate/aio/__init__.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.727273 | 94 | 0.561567 |
from ._device_update import DeviceUpdate
__all__ = ['DeviceUpdate']
| true | true |
f726701582b7fe85721853e639a19adb9c7fe1fe | 7,883 | py | Python | test/functional/rpc_users.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 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 multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 38.082126 | 129 | 0.614994 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
get_datadir_path,
str_to_b64str,
)
import os
import http.client
import urllib.parse
import subprocess
from random import SystemRandom
import string
import configparser
import sys
class HTTP... | true | true |
f7267055d2c097c704fe63ba2a7aa2a991fa61d0 | 6,510 | py | Python | touchdown/tests/test_aws_iam_server_certificate.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 14 | 2015-01-05T18:18:04.000Z | 2022-02-07T19:35:12.000Z | touchdown/tests/test_aws_iam_server_certificate.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 106 | 2015-01-06T00:17:13.000Z | 2019-09-07T00:35:32.000Z | touchdown/tests/test_aws_iam_server_certificate.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 5 | 2015-01-30T10:18:24.000Z | 2022-02-07T19:35:13.000Z | # Copyright 2015 Isotoma Limited
#
# 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... | 43.986486 | 87 | 0.650691 |
from touchdown.core import errors
from touchdown.tests.aws import StubberTestCase
from touchdown.tests.stubs.aws import ServerCertificateStubber
class TestCreateServerCertificate(StubberTestCase):
def test_create_server_certificate(self):
goal = self.create_goal("apply")
with open(S... | true | true |
f7267151612dbfc56f3defd079b3c1b033ab0459 | 2,573 | py | Python | task/models.py | Redhead95/taskful_api | 2b28a7f6ecaeb1c77d3fd3bea9ae5922667b1044 | [
"MIT"
] | null | null | null | task/models.py | Redhead95/taskful_api | 2b28a7f6ecaeb1c77d3fd3bea9ae5922667b1044 | [
"MIT"
] | null | null | null | task/models.py | Redhead95/taskful_api | 2b28a7f6ecaeb1c77d3fd3bea9ae5922667b1044 | [
"MIT"
] | null | null | null | import os
import uuid
from django.db import models
from django.utils.deconstruct import deconstructible
NOT_COMPLETE = 'NC'
COMPLETE = 'C'
TASK_STATUS_CHOICES = [
(NOT_COMPLETE, 'Not Complete'),
(COMPLETE, 'Complete'),
]
@deconstructible
class GenerateAttachmentFilePath(object):
def __init__(self):
... | 38.402985 | 134 | 0.733385 | import os
import uuid
from django.db import models
from django.utils.deconstruct import deconstructible
NOT_COMPLETE = 'NC'
COMPLETE = 'C'
TASK_STATUS_CHOICES = [
(NOT_COMPLETE, 'Not Complete'),
(COMPLETE, 'Complete'),
]
@deconstructible
class GenerateAttachmentFilePath(object):
def __init__(self):
... | true | true |
f72671733725c0c68f0d949630bf8d7a44e4778a | 14,483 | py | Python | shadowsocks/udprelay.py | whayne1103/shadowsocks | d5196497f7b0445d355c05dffa5c6a3e12b1d79b | [
"Apache-2.0"
] | 13 | 2019-09-22T06:34:18.000Z | 2021-07-17T06:19:39.000Z | shadowsocks/udprelay.py | whayne1103/shadowsocks | d5196497f7b0445d355c05dffa5c6a3e12b1d79b | [
"Apache-2.0"
] | 3 | 2020-02-10T03:23:08.000Z | 2020-06-06T10:02:36.000Z | shadowsocks/udprelay.py | whayne1103/shadowsocks | d5196497f7b0445d355c05dffa5c6a3e12b1d79b | [
"Apache-2.0"
] | 22 | 2015-08-23T00:44:46.000Z | 2020-03-16T08:33:13.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | 39.571038 | 79 | 0.538908 |
from __future__ import absolute_import, division, print_function, \
with_statement
import socket
import logging
import struct
import errno
import random
from shadowsocks import cryptor, eventloop, lru_cache, common, shell
from shadowsocks.common import ... | true | true |
f72671937db542e223720da043ede8cedbc9e9b9 | 15,617 | py | Python | frigate/events.py | gpete/frigate | e6594c6d98fc18e05df29e66924039cd53a67dd8 | [
"MIT"
] | null | null | null | frigate/events.py | gpete/frigate | e6594c6d98fc18e05df29e66924039cd53a67dd8 | [
"MIT"
] | null | null | null | frigate/events.py | gpete/frigate | e6594c6d98fc18e05df29e66924039cd53a67dd8 | [
"MIT"
] | null | null | null | import datetime
import json
import logging
import os
import queue
import subprocess as sp
import threading
import time
from collections import defaultdict
from pathlib import Path
import psutil
import shutil
from frigate.config import FrigateConfig
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
from friga... | 37.90534 | 129 | 0.539284 | import datetime
import json
import logging
import os
import queue
import subprocess as sp
import threading
import time
from collections import defaultdict
from pathlib import Path
import psutil
import shutil
from frigate.config import FrigateConfig
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
from friga... | true | true |
f726743c2af55562de0a399b95ee66d6a3d5ea4c | 900 | py | Python | WebSpider/threads.py | bianQ/similarweb | 3df31af1267a285d0bc6adf720409ceb43eb56cb | [
"MIT"
] | null | null | null | WebSpider/threads.py | bianQ/similarweb | 3df31af1267a285d0bc6adf720409ceb43eb56cb | [
"MIT"
] | null | null | null | WebSpider/threads.py | bianQ/similarweb | 3df31af1267a285d0bc6adf720409ceb43eb56cb | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: Alan
@time: 2021/05/18
"""
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import traceback
class MultiThread(ThreadPoolExecutor):
def __init__(self, max_workers=None, thread_name_prefix=''):
super().__init__(max_worker... | 26.470588 | 70 | 0.628889 |
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import traceback
class MultiThread(ThreadPoolExecutor):
def __init__(self, max_workers=None, thread_name_prefix=''):
super().__init__(max_workers, thread_name_prefix)
def thread_log(self, worker):
try:
resul... | true | true |
f7267621fdc306ffafe3ecda31e41278dccdb8f2 | 2,478 | py | Python | tests/test_metadata_get.py | iris-edu-int/datacite | 4a3aa5b9bb156cee616848cc7c8d929ad76fa3cc | [
"BSD-3-Clause"
] | null | null | null | tests/test_metadata_get.py | iris-edu-int/datacite | 4a3aa5b9bb156cee616848cc7c8d929ad76fa3cc | [
"BSD-3-Clause"
] | null | null | null | tests/test_metadata_get.py | iris-edu-int/datacite | 4a3aa5b9bb156cee616848cc7c8d929ad76fa3cc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of DataCite.
#
# Copyright (C) 2015, 2016 CERN.
#
# DataCite is free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
"""Tests for /metadata GET."""
from __future__ import absolute_import... | 22.125 | 73 | 0.633172 |
from __future__ import absolute_import, print_function
import pytest
import responses
from helpers import APIURL, get_client
from datacite.errors import DataCiteForbiddenError, DataCiteGoneError, \
DataCiteNotFoundError, DataCiteServerError, DataCiteUnauthorizedError
@responses.activate
def test_meta... | true | true |
f72676b4fc76edae6f6177c02163528b28ab531e | 7,484 | py | Python | app/states/load.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | 1 | 2020-09-23T21:40:16.000Z | 2020-09-23T21:40:16.000Z | app/states/load.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | null | null | null | app/states/load.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | 3 | 2020-07-11T19:18:12.000Z | 2021-08-14T17:43:06.000Z | import json
import os
import boto3
import yaml
from lib.dynamodb import accounts_table, requirements_table, user_table, config_table
from lib.lambda_decorator.decorator import states_decorator
client_s3 = boto3.client('s3')
user_bucket = os.getenv('USER_BUCKET')
account_bucket = os.getenv('ACCOUNT_BUCKET')
requirem... | 36.686275 | 126 | 0.704436 | import json
import os
import boto3
import yaml
from lib.dynamodb import accounts_table, requirements_table, user_table, config_table
from lib.lambda_decorator.decorator import states_decorator
client_s3 = boto3.client('s3')
user_bucket = os.getenv('USER_BUCKET')
account_bucket = os.getenv('ACCOUNT_BUCKET')
requirem... | true | true |
f72676d4da3438923201ee65422d31a01243108f | 25,485 | py | Python | pytext/trainers/trainer.py | suo/pytext | 400c80b4c040de12028970a85ce0af864931e0f4 | [
"BSD-3-Clause"
] | null | null | null | pytext/trainers/trainer.py | suo/pytext | 400c80b4c040de12028970a85ce0af864931e0f4 | [
"BSD-3-Clause"
] | null | null | null | pytext/trainers/trainer.py | suo/pytext | 400c80b4c040de12028970a85ce0af864931e0f4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
import time
from contextlib import ExitStack as contextlib_ExitStack
from typing import Any, Iterable, List, Optional, Tuple
import torch
from pytext.common.constants import BatchContext, Stage
from pytext.c... | 41.371753 | 95 | 0.626368 |
import itertools
import time
from contextlib import ExitStack as contextlib_ExitStack
from typing import Any, Iterable, List, Optional, Tuple
import torch
from pytext.common.constants import BatchContext, Stage
from pytext.config import PyTextConfig
from pytext.config.component import (
Component,
Component... | true | true |
f7267815389b318d6a8e4cfe05c3808d59d955a5 | 6,214 | py | Python | fairseq/criterions/masked_adlm.py | a1600012888/fairseq | dbd2cd08fc396f919d2e737513095fcb966896c0 | [
"MIT"
] | null | null | null | fairseq/criterions/masked_adlm.py | a1600012888/fairseq | dbd2cd08fc396f919d2e737513095fcb966896c0 | [
"MIT"
] | null | null | null | fairseq/criterions/masked_adlm.py | a1600012888/fairseq | dbd2cd08fc396f919d2e737513095fcb966896c0 | [
"MIT"
] | 1 | 2020-04-01T03:31:00.000Z | 2020-04-01T03:31:00.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn.functional as F
from fairseq import metrics, utils
from fairseq.criterions import FairseqCriterion,... | 37.660606 | 100 | 0.60251 |
import math
import torch
import torch.nn.functional as F
from fairseq import metrics, utils
from fairseq.criterions import FairseqCriterion, register_criterion
@register_criterion('masked_adlm')
class MaskedAdLmLoss(FairseqCriterion):
def __init__(self, args, task):
super(MaskedAdLmLoss, self).__... | true | true |
f726783468013df7d862175c11e8671b1275bee8 | 1,929 | py | Python | campy/cameras/emu.py | Wolfffff/campy | 988e02fea70c1a14221ad3a9c350afa52cc9bcf5 | [
"MIT"
] | null | null | null | campy/cameras/emu.py | Wolfffff/campy | 988e02fea70c1a14221ad3a9c350afa52cc9bcf5 | [
"MIT"
] | null | null | null | campy/cameras/emu.py | Wolfffff/campy | 988e02fea70c1a14221ad3a9c350afa52cc9bcf5 | [
"MIT"
] | 1 | 2021-09-02T20:01:25.000Z | 2021-09-02T20:01:25.000Z | """
"""
from campy.cameras import unicam
import os
import time
import logging
import sys
import numpy as np
from collections import deque
import csv
import imageio
def LoadSystem(params):
return params["cameraMake"]
def GetDeviceList(system):
return system
def LoadDevice(cam_params):
return cam_p... | 18.028037 | 85 | 0.718507 |
from campy.cameras import unicam
import os
import time
import logging
import sys
import numpy as np
from collections import deque
import csv
import imageio
def LoadSystem(params):
return params["cameraMake"]
def GetDeviceList(system):
return system
def LoadDevice(cam_params):
return cam_params["de... | true | true |
f72678c8ed7735a73d4972ede696b84b944d05d8 | 5,881 | py | Python | src/odm_report_shot_coverage/models/reconstruction.py | terra-submersa/opensfm-camera-coverage | a9ad2bff799a5d0d07d7900fc7d1bf10bc489632 | [
"CNRI-Python"
] | null | null | null | src/odm_report_shot_coverage/models/reconstruction.py | terra-submersa/opensfm-camera-coverage | a9ad2bff799a5d0d07d7900fc7d1bf10bc489632 | [
"CNRI-Python"
] | null | null | null | src/odm_report_shot_coverage/models/reconstruction.py | terra-submersa/opensfm-camera-coverage | a9ad2bff799a5d0d07d7900fc7d1bf10bc489632 | [
"CNRI-Python"
] | null | null | null | import json
import logging
import geojson
import numpy as np
from tqdm import tqdm
from scipy import stats
from odm_report_shot_coverage.models.camera import Camera, json_parse_camera
from odm_report_shot_coverage.models.shot import Shot, shot_boundaries_from_points, Boundaries
from odm_report_shot_coverage.models.wa... | 38.94702 | 102 | 0.660602 | import json
import logging
import geojson
import numpy as np
from tqdm import tqdm
from scipy import stats
from odm_report_shot_coverage.models.camera import Camera, json_parse_camera
from odm_report_shot_coverage.models.shot import Shot, shot_boundaries_from_points, Boundaries
from odm_report_shot_coverage.models.wa... | true | true |
f72678e2fc3806ded2ce42f11e552a9f29cbd3ae | 3,757 | py | Python | demo.py | SeongSuKim95/ReID-Baseline-swin | f30db86eb2690c20c4fbb0189eb52b57358705df | [
"MIT"
] | null | null | null | demo.py | SeongSuKim95/ReID-Baseline-swin | f30db86eb2690c20c4fbb0189eb52b57358705df | [
"MIT"
] | null | null | null | demo.py | SeongSuKim95/ReID-Baseline-swin | f30db86eb2690c20c4fbb0189eb52b57358705df | [
"MIT"
] | 1 | 2022-03-18T19:09:47.000Z | 2022-03-18T19:09:47.000Z | import argparse
import scipy.io
import torch
import numpy as np
import os
from torchvision import datasets
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
#######################################################################
# Evaluate
parser = argparse.ArgumentParser(description='Demo')
parse... | 33.846847 | 116 | 0.625233 | import argparse
import scipy.io
import torch
import numpy as np
import os
from torchvision import datasets
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
| true | true |
f72678eeeaa3ab01da38b3b2d287901a2acbed5a | 512 | py | Python | week_2/tests/lab8_p2.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | 2 | 2020-11-20T07:43:40.000Z | 2021-05-14T14:40:41.000Z | week_2/tests/lab8_p2.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | null | null | null | week_2/tests/lab8_p2.py | brown-ccv/workshop-python-2020 | e522527a077f68c4a0b11da9eb615a9f57d21b6d | [
"MIT"
] | 2 | 2020-06-18T20:35:40.000Z | 2020-09-27T02:54:31.000Z | test = {
'name': '8.2',
'suites': [
{
'cases': [
{
'code': r"""
>>> # It looks like one of your variables is not named
>>> # correctly. Maybe there's a typo?
>>> 'avg_flt' in vars()
True
"""
},
{
'code': r"""
... | 20.48 | 69 | 0.363281 | test = {
'name': '8.2',
'suites': [
{
'cases': [
{
'code': r"""
>>> # It looks like one of your variables is not named
>>> # correctly. Maybe there's a typo?
>>> 'avg_flt' in vars()
True
"""
},
{
'code': r"""
... | true | true |
f726790477f564ff202bf60ffff1010f2a6df250 | 3,687 | py | Python | rlkit/envs/point_robot.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 381 | 2019-03-19T22:55:14.000Z | 2022-03-26T18:56:17.000Z | rlkit/envs/point_robot.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 27 | 2019-04-30T04:04:51.000Z | 2022-03-03T18:20:11.000Z | rlkit/envs/point_robot.py | erinaldi/MetaRL | 6dfb8d2e63a1802ca7ef9c28f6ab1a758d07f871 | [
"MIT"
] | 107 | 2019-03-22T06:09:24.000Z | 2022-01-30T13:34:38.000Z | import numpy as np
from gym import spaces
from gym import Env
from . import register_env
@register_env('point-robot')
class PointEnv(Env):
"""
point robot on a 2-D plane with position control
tasks (aka goals) are positions on the plane
- tasks sampled from unit square
- reward is L2 distance
... | 29.97561 | 102 | 0.55872 | import numpy as np
from gym import spaces
from gym import Env
from . import register_env
@register_env('point-robot')
class PointEnv(Env):
def __init__(self, randomize_tasks=False, n_tasks=2):
if randomize_tasks:
np.random.seed(1337)
goals = [[np.random.uniform(-1., 1.), np.rand... | true | true |
f726796f43413d696b184ac1361a1c85145f966b | 217 | py | Python | vispy/gloo/gl/ext.py | mssurajkaiga/vispy-experiments | 0f3a19e0f4ac46608da792cbd36ebe59b036bce7 | [
"BSD-3-Clause"
] | 1 | 2017-06-12T16:24:11.000Z | 2017-06-12T16:24:11.000Z | vispy/gloo/gl/ext.py | mssurajkaiga/vispy-experiments | 0f3a19e0f4ac46608da792cbd36ebe59b036bce7 | [
"BSD-3-Clause"
] | null | null | null | vispy/gloo/gl/ext.py | mssurajkaiga/vispy-experiments | 0f3a19e0f4ac46608da792cbd36ebe59b036bce7 | [
"BSD-3-Clause"
] | null | null | null | """ Namespace for functions and constants corresponding to
OpenGL ES 2.0 extensions.
"""
from __future__ import division
from ._constants_ext import * # noqa
# Filled with functions when vispy.gloo.gl is imported
| 21.7 | 58 | 0.774194 |
from __future__ import division
from ._constants_ext import *
| true | true |
f72679f63807e54ba5c5c8c8ffd1b689e7012f08 | 297 | py | Python | lab/logger/destinations/__init__.py | gear/lab | ad1c5838acbcc98abb5d5d93d5c7a6c2b74bdfa2 | [
"MIT"
] | null | null | null | lab/logger/destinations/__init__.py | gear/lab | ad1c5838acbcc98abb5d5d93d5c7a6c2b74bdfa2 | [
"MIT"
] | null | null | null | lab/logger/destinations/__init__.py | gear/lab | ad1c5838acbcc98abb5d5d93d5c7a6c2b74bdfa2 | [
"MIT"
] | null | null | null | from typing import List, Union, Tuple
from lab.logger.colors import StyleCode
class Destination:
def log(self, parts: List[Union[str, Tuple[str, StyleCode]]], *,
is_new_line=True):
raise NotImplementedError()
def new_line(self):
raise NotImplementedError()
| 22.846154 | 68 | 0.680135 | from typing import List, Union, Tuple
from lab.logger.colors import StyleCode
class Destination:
def log(self, parts: List[Union[str, Tuple[str, StyleCode]]], *,
is_new_line=True):
raise NotImplementedError()
def new_line(self):
raise NotImplementedError()
| true | true |
f7267a892bdf070ee3c7619d0af334682563f6a0 | 3,432 | py | Python | simulation_3.py | ballcarsen/Networks_3_Forwarding | af211612a097db15a1605311c5c537e8bd279b12 | [
"Apache-2.0"
] | null | null | null | simulation_3.py | ballcarsen/Networks_3_Forwarding | af211612a097db15a1605311c5c537e8bd279b12 | [
"Apache-2.0"
] | null | null | null | simulation_3.py | ballcarsen/Networks_3_Forwarding | af211612a097db15a1605311c5c537e8bd279b12 | [
"Apache-2.0"
] | null | null | null | '''
Created on Oct 12, 2016
@author: mwittie
'''
import network_3
import link_3
import threading
from time import sleep
##configuration parameters
router_queue_size = 0 # 0 means unlimited
simulation_time = 1 # give the network sufficient time to transfer all packets before quitting
if __name__ == '__main__':
... | 32.377358 | 110 | 0.708333 | import network_3
import link_3
import threading
from time import sleep
simulation_time = 1
if __name__ == '__main__':
routing_dict = {'router_a': {"1" : 0, "2": 1}, 'router_d': {"3" : 0, "4": 1}}
object_L = []
host_1 = network_3.Host(1)
object_L.append(host_1)
host_2 = network_3.Host... | true | true |
f7267aece711cefa0549e3630c2589663f50d1e2 | 847 | py | Python | credentials.py | vishnusudheendran/Disney-Fastpass-Bot | 0a1a95c0b8782701634c7e914235e789d0fa9c06 | [
"MIT"
] | 1 | 2019-03-05T13:34:06.000Z | 2019-03-05T13:34:06.000Z | credentials.py | vishnusudheendran/Disney-Fastpass-Bot | 0a1a95c0b8782701634c7e914235e789d0fa9c06 | [
"MIT"
] | null | null | null | credentials.py | vishnusudheendran/Disney-Fastpass-Bot | 0a1a95c0b8782701634c7e914235e789d0fa9c06 | [
"MIT"
] | null | null | null | """
This file contains the email and password for MyDisneyExperience and the guests in your party
Below, add your email and password in the parentheses that you use to login into mydisneyexperience.com
"""
email = ""
password = ""
"""
guests = ["guest-00000000-0000-0000-0000-000000000000-unselected", "guest-000... | 26.46875 | 153 | 0.753247 | """
This file contains the email and password for MyDisneyExperience and the guests in your party
Below, add your email and password in the parentheses that you use to login into mydisneyexperience.com
"""
email = ""
password = ""
"""
guests = ["guest-00000000-0000-0000-0000-000000000000-unselected", "guest-000... | false | true |
f7267bf3fd0336a906e4c44012962c01fabd366c | 799 | py | Python | Hackerrank_codes/arithmetic_operators.py | Vyshnavmt94/HackerRankTasks | 634c71ccf0bea7585498bcd7d63e34d0334b4678 | [
"MIT"
] | null | null | null | Hackerrank_codes/arithmetic_operators.py | Vyshnavmt94/HackerRankTasks | 634c71ccf0bea7585498bcd7d63e34d0334b4678 | [
"MIT"
] | null | null | null | Hackerrank_codes/arithmetic_operators.py | Vyshnavmt94/HackerRankTasks | 634c71ccf0bea7585498bcd7d63e34d0334b4678 | [
"MIT"
] | null | null | null | """
Task
The provided code stub reads two integers from STDIN, and . Add code to print three lines where:
The first line contains the sum of the two numbers.
The second line contains the difference of the two numbers (first - second).
The third line contains the product of the two numbers.
Example
Print the followi... | 13.775862 | 97 | 0.677096 |
def check(n):
if n>=1 and n<=10**10:
return True
if __name__ == '__main__':
a = int(input())
b = int(input())
if check(a) and check(b):
print(a+b)
print(a-b)
print(a*b) | true | true |
f7267c622825114ec43fa387fd5603751837e983 | 3,783 | py | Python | allure-pytest/test/acceptance/status/base_teardown_status_test.py | ammarnajjar/allure-python | 975aaf94d75428330c07976c1cdfc364b9a3cafa | [
"Apache-2.0"
] | 5 | 2018-02-12T11:40:38.000Z | 2018-06-10T20:29:00.000Z | allure-pytest/test/acceptance/status/base_teardown_status_test.py | ammarnajjar/allure-python | 975aaf94d75428330c07976c1cdfc364b9a3cafa | [
"Apache-2.0"
] | null | null | null | allure-pytest/test/acceptance/status/base_teardown_status_test.py | ammarnajjar/allure-python | 975aaf94d75428330c07976c1cdfc364b9a3cafa | [
"Apache-2.0"
] | 1 | 2020-01-25T03:54:39.000Z | 2020-01-25T03:54:39.000Z | from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status
from allure_commons_test.result import has_status_details
from allure_commons_test.result import with_message_contains
from allure_commons_test.result import with_trace_contains
from ... | 49.12987 | 118 | 0.487708 | from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status
from allure_commons_test.result import has_status_details
from allure_commons_test.result import with_message_contains
from allure_commons_test.result import with_trace_contains
from ... | true | true |
f7267ca31364e2c221d467bdf1be6ce69d403ea2 | 5,588 | py | Python | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/builtins.py | nawien-sharma/keyczar | c55563bbd70f4b6fefc7444e296aab9894475f9a | [
"Apache-2.0"
] | 30 | 2015-01-29T14:06:05.000Z | 2022-01-10T07:47:29.000Z | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/builtins.py | nawien-sharma/keyczar | c55563bbd70f4b6fefc7444e296aab9894475f9a | [
"Apache-2.0"
] | 1 | 2017-02-20T20:57:48.000Z | 2018-12-19T23:44:38.000Z | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/builtins.py | nawien-sharma/keyczar | c55563bbd70f4b6fefc7444e296aab9894475f9a | [
"Apache-2.0"
] | 15 | 2015-04-23T02:38:36.000Z | 2021-03-01T20:09:39.000Z | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | 29.723404 | 89 | 0.658912 |
__doc__ = """
Compatibility idioms for __builtin__ names
This module adds names to the __builtin__ module for things that we want
to use in SCons but which don't show up until later Python versions than
the earliest ones we support.
This module checks for the following __builtin__ names:
... | false | true |
f7267d5166a3b5c62a2fa38a85120010bbb91685 | 264 | py | Python | backend/authentication/admin.py | rajc1729/django-nextjs-realtime | 4d551f544729cc71a02878ad198dab665840987a | [
"MIT"
] | null | null | null | backend/authentication/admin.py | rajc1729/django-nextjs-realtime | 4d551f544729cc71a02878ad198dab665840987a | [
"MIT"
] | null | null | null | backend/authentication/admin.py | rajc1729/django-nextjs-realtime | 4d551f544729cc71a02878ad198dab665840987a | [
"MIT"
] | null | null | null | from django.contrib import admin
from authentication.models import CustomUser
# Register your models here.
class CustomUserAdmin(admin.ModelAdmin):
list_display = ['username','first_name','last_name','email']
admin.site.register(CustomUser, CustomUserAdmin) | 29.333333 | 64 | 0.799242 | from django.contrib import admin
from authentication.models import CustomUser
class CustomUserAdmin(admin.ModelAdmin):
list_display = ['username','first_name','last_name','email']
admin.site.register(CustomUser, CustomUserAdmin) | true | true |
f7267f0cc12c13e4532cd65a56c9b3d01c13894f | 14,738 | py | Python | selfdrive/locationd/locationd.py | sejongjoa/openpilot_083 | ff8277b6b51241af6b9ba37dcf55dcb6bfcc9d18 | [
"MIT"
] | 20 | 2020-12-04T12:20:57.000Z | 2022-03-31T00:40:15.000Z | selfdrive/locationd/locationd.py | wangyueguo/- | 301500dff6bd53e64257898cac939b24f56befac | [
"MIT"
] | 6 | 2020-03-06T18:13:55.000Z | 2020-07-20T05:10:20.000Z | selfdrive/locationd/locationd.py | wangyueguo/- | 301500dff6bd53e64257898cac939b24f56befac | [
"MIT"
] | 35 | 2021-03-18T23:28:11.000Z | 2021-06-24T17:36:22.000Z | #!/usr/bin/env python3
import json
import numpy as np
import sympy as sp
import cereal.messaging as messaging
from cereal import log
from common.params import Params
import common.transformations.coordinates as coord
from common.transformations.orientation import ecef_euler_from_ned, \
... | 41.988604 | 132 | 0.70688 |
import json
import numpy as np
import sympy as sp
import cereal.messaging as messaging
from cereal import log
from common.params import Params
import common.transformations.coordinates as coord
from common.transformations.orientation import ecef_euler_from_ned, \
euler_fr... | true | true |
f7267fe4a54f406a59df97aff7b19b741d435024 | 3,773 | py | Python | OpenStack.py | minidfx/Cloud-Python- | c9e4741c4c4f7de77f439e2786cca7f03f70cad9 | [
"MIT"
] | null | null | null | OpenStack.py | minidfx/Cloud-Python- | c9e4741c4c4f7de77f439e2786cca7f03f70cad9 | [
"MIT"
] | null | null | null | OpenStack.py | minidfx/Cloud-Python- | c9e4741c4c4f7de77f439e2786cca7f03f70cad9 | [
"MIT"
] | null | null | null | # Getting started with OpenStack using libcloud
# http://developer.openstack.org/firstapp-libcloud/getting_started.html
from libcloud.compute.ssh import *
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from Cloud import Cloud
from settings import *
# noinspection PyPep8N... | 35.59434 | 95 | 0.602703 |
from libcloud.compute.ssh import *
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from Cloud import Cloud
from settings import *
class OpenStack(Cloud):
def __init__(self):
super().__init__()
openstack = get_driver(Provider.OPENSTACK)
self.... | true | true |
f726800b4ff9c7c04844b758f410a70599a4f3f6 | 967 | py | Python | mergeforms/from cms10/test_wordTemplate.py | mbronstein/ssa412 | 32de4e44f16cf2044788428da2a3bab271ebcb9a | [
"MIT"
] | null | null | null | mergeforms/from cms10/test_wordTemplate.py | mbronstein/ssa412 | 32de4e44f16cf2044788428da2a3bab271ebcb9a | [
"MIT"
] | null | null | null | mergeforms/from cms10/test_wordTemplate.py | mbronstein/ssa412 | 32de4e44f16cf2044788428da2a3bab271ebcb9a | [
"MIT"
] | null | null | null | from unittest import TestCase, skip
import os
from docxtpl import DocxTemplate
class TestDocxTemplate(TestCase):
def setUp(self):
self.APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
self.FIXTURE_DIR = os.path.join(os.path.dirname(self.APP_DIR), 'fixtures')
self.FO... | 34.535714 | 84 | 0.679421 | from unittest import TestCase, skip
import os
from docxtpl import DocxTemplate
class TestDocxTemplate(TestCase):
def setUp(self):
self.APP_DIR = os.path.abspath(os.path.dirname(__file__))
self.FIXTURE_DIR = os.path.join(os.path.dirname(self.APP_DIR), 'fixtures')
self.FORM_DIR = os.path... | true | true |
f726812fa813373e14802dbfe2defbcd7a440e6d | 4,637 | py | Python | apps/permissions.py | Github-shipchain/transmission | 867971cdc366ccfd6ef632f39652633c269e7969 | [
"Apache-2.0"
] | 1 | 2019-12-15T13:44:29.000Z | 2019-12-15T13:44:29.000Z | apps/permissions.py | Github-shipchain/transmission | 867971cdc366ccfd6ef632f39652633c269e7969 | [
"Apache-2.0"
] | null | null | null | apps/permissions.py | Github-shipchain/transmission | 867971cdc366ccfd6ef632f39652633c269e7969 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 ShipChain, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... | 35.669231 | 116 | 0.723528 |
from django.db.models import Q
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import permissions, status
from shipchain_common.authentication import get_jwt_from_request
from apps.shipments.models import Shipment, PermissionLink
PROFILES_WALLET_URL = f'{s... | true | true |
f7268157ef2a0bd8d69f9adfb748756be3029bea | 5,766 | py | Python | pgoapi/protos/pogoprotos/networking/requests/messages/get_asset_digest_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 14 | 2017-03-28T16:32:24.000Z | 2021-03-13T23:03:57.000Z | pgoapi/protos/pogoprotos/networking/requests/messages/get_asset_digest_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 8 | 2017-03-01T07:56:09.000Z | 2017-08-15T07:37:12.000Z | pgoapi/protos/pogoprotos/networking/requests/messages/get_asset_digest_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 15 | 2017-02-24T01:30:23.000Z | 2021-06-27T08:46:43.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/get_asset_digest_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as ... | 47.262295 | 613 | 0.772112 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f726815c9d9c875e611e685946fa5bb15c9a3094 | 13,843 | py | Python | 3dversion/g_model.py | ginobilinie/medSynthesis | fee24e955313b4032855901327a7485390866e91 | [
"MIT"
] | 77 | 2017-03-24T11:51:05.000Z | 2022-02-17T00:14:52.000Z | 3dversion/g_model.py | liu123-t/medSynthesis | 7373f2974356bf1a944ed25183273c3e132d63af | [
"MIT"
] | 19 | 2018-02-03T15:55:49.000Z | 2021-11-16T10:27:22.000Z | 3dversion/g_model.py | liu123-t/medSynthesis | 7373f2974356bf1a944ed25183273c3e132d63af | [
"MIT"
] | 27 | 2017-03-18T09:17:09.000Z | 2021-06-05T02:59:22.000Z | from __future__ import division
import os
import time
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
from utils import *
from loss_functions import *
from scipy.misc import imsave
class MR2CT(object):
def __init__(self, sess, batch_size=10, depth_MR=32, height_MR=32,... | 53.242308 | 200 | 0.60955 | from __future__ import division
import os
import time
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
from utils import *
from loss_functions import *
from scipy.misc import imsave
class MR2CT(object):
def __init__(self, sess, batch_size=10, depth_MR=32, height_MR=32,... | false | true |
f726822728d9822a12dc779ca59f2edd95742b2b | 812 | py | Python | vendimaenv/lib/python2.7/site-packages/funcy/py2.py | soru13/vendimia | ebcf85473855e6f990b1a49574ac669fdd4d443e | [
"MIT"
] | null | null | null | vendimaenv/lib/python2.7/site-packages/funcy/py2.py | soru13/vendimia | ebcf85473855e6f990b1a49574ac669fdd4d443e | [
"MIT"
] | 5 | 2020-02-11T23:26:24.000Z | 2022-01-13T00:39:54.000Z | vendimaenv/lib/python2.7/site-packages/funcy/py2.py | soru13/vendimia | ebcf85473855e6f990b1a49574ac669fdd4d443e | [
"MIT"
] | null | null | null | import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .debug import *
from .primitives import *
# Setup __all__
modu... | 23.882353 | 87 | 0.64532 | import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .debug import *
from .primitives import *
modules = ('calc', ... | true | true |
f726841a3369bd4d21c176bdb301ddb10b209714 | 160 | py | Python | scenarios/api_key_delete/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 12 | 2015-04-12T06:18:33.000Z | 2021-03-03T23:54:19.000Z | scenarios/api_key_delete/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 1 | 2021-11-24T20:10:19.000Z | 2021-11-24T20:10:19.000Z | scenarios/api_key_delete/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 14 | 2015-03-23T17:52:06.000Z | 2021-11-24T11:04:15.000Z | import balanced
balanced.configure('ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY')
key = balanced.APIKey.fetch('/api_keys/AK3DQGzROuoRYulKXMQdHBxX')
key.delete() | 26.666667 | 65 | 0.83125 | import balanced
balanced.configure('ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY')
key = balanced.APIKey.fetch('/api_keys/AK3DQGzROuoRYulKXMQdHBxX')
key.delete() | true | true |
f726841edd23cffe106d88311ba375ae4ca2b996 | 7,722 | py | Python | cornac/models/hft/recom_hft.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | null | null | null | cornac/models/hft/recom_hft.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | null | null | null | cornac/models/hft/recom_hft.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | 1 | 2020-03-19T13:58:33.000Z | 2020-03-19T13:58:33.000Z | # Copyright 2018 The Cornac 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 applicable ... | 38.41791 | 119 | 0.642191 |
import numpy as np
from ..recommender import Recommender
from ...exception import ScoreException
class HFT(Recommender):
def __init__(self, name='HFT', k=10, max_iter=50, grad_iter=50,
lambda_text=0.1, l2_reg=0.001, vocab_size=8000,
init_params=None, trainable=T... | true | true |
f726847a942ebeed78eb3cd894dacd72c3644eb4 | 101 | py | Python | main.py | marcacohen/mynewsfeed.io | b1debfab02c5dd6d618acd798792c906a4bb4c47 | [
"Apache-2.0"
] | 1 | 2020-11-10T16:07:24.000Z | 2020-11-10T16:07:24.000Z | main.py | marcacohen/mynewsfeed.io | b1debfab02c5dd6d618acd798792c906a4bb4c47 | [
"Apache-2.0"
] | null | null | null | main.py | marcacohen/mynewsfeed.io | b1debfab02c5dd6d618acd798792c906a4bb4c47 | [
"Apache-2.0"
] | null | null | null | from web import app
app.run(host='0.0.0.0',port=8080, use_reloader=True, debug=True, threaded=True)
| 25.25 | 79 | 0.742574 | from web import app
app.run(host='0.0.0.0',port=8080, use_reloader=True, debug=True, threaded=True)
| true | true |
f726861fe715da3c897ba6b113c2784dd07089b9 | 572 | py | Python | planutils/settings.py | AI-Planning/planning-utils | 2ab7015cfe52505c7972ed9e7066bdd3c769153f | [
"MIT"
] | 1 | 2020-04-18T15:30:58.000Z | 2020-04-18T15:30:58.000Z | planutils/settings.py | AI-Planning/planning-utils | 2ab7015cfe52505c7972ed9e7066bdd3c769153f | [
"MIT"
] | 3 | 2020-04-21T17:09:06.000Z | 2020-04-28T15:50:07.000Z | planutils/settings.py | AI-Planning/planning-utils | 2ab7015cfe52505c7972ed9e7066bdd3c769153f | [
"MIT"
] | null | null | null |
import json, os
from planutils import manifest_converter
# This should eventually be changed once the prefix is customizable
PLANUTILS_PREFIX = os.path.join(os.path.expanduser('~'), '.planutils')
SETTINGS_FILE = os.path.join(PLANUTILS_PREFIX, 'settings.json')
PAAS_SERVER = 'http://45.113.232.43:5001'
PAAS_SERVER_L... | 24.869565 | 70 | 0.713287 |
import json, os
from planutils import manifest_converter
PLANUTILS_PREFIX = os.path.join(os.path.expanduser('~'), '.planutils')
SETTINGS_FILE = os.path.join(PLANUTILS_PREFIX, 'settings.json')
PAAS_SERVER = 'http://45.113.232.43:5001'
PAAS_SERVER_LIMIT = 100
def load():
with open(SETTINGS_FILE, 'r') as f:
... | true | true |
f726862b7ddae2271ecd69d2a01c433b3d758f10 | 2,349 | py | Python | tools/mo/unit_tests/mo/load/loader_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/load/loader_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/load/loader_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from openvino.tools.mo.load.tf.loader import graph_or_sub_graph_has_nhwc_ops
from unit_tests.utils.graph import build_graph, result, regular_op, const, connect_front
class TFLoaderTest(unittest.Test... | 34.544118 | 117 | 0.613027 |
import unittest
import numpy as np
from openvino.tools.mo.load.tf.loader import graph_or_sub_graph_has_nhwc_ops
from unit_tests.utils.graph import build_graph, result, regular_op, const, connect_front
class TFLoaderTest(unittest.TestCase):
@staticmethod
def build_conv_graph():
nodes = {
... | true | true |
f726869b16a3c31ae1abced42c8498b5f9a71273 | 390 | py | Python | shorty/wsgi.py | alazaro/shorty | 2a75c2f1351b3ada20c551159f8f22b04284ead1 | [
"MIT"
] | null | null | null | shorty/wsgi.py | alazaro/shorty | 2a75c2f1351b3ada20c551159f8f22b04284ead1 | [
"MIT"
] | 1 | 2021-06-10T19:02:19.000Z | 2021-06-10T19:02:19.000Z | shorty/wsgi.py | alazaro/shorty | 2a75c2f1351b3ada20c551159f8f22b04284ead1 | [
"MIT"
] | null | null | null | """
WSGI config for shorty project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 22.941176 | 78 | 0.784615 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shorty.settings")
application = get_wsgi_application()
| true | true |
f72686bfb1c06e1c972ddd0550910b6f66064e90 | 1,361 | py | Python | other/password_generator.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 12 | 2020-02-11T22:18:10.000Z | 2021-06-23T02:56:07.000Z | other/password_generator.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 1 | 2019-09-26T08:03:36.000Z | 2019-09-26T08:03:36.000Z | other/password_generator.py | Pratiyush27/Python | be48a876c7746611099974e572ea82691a7cbb20 | [
"MIT"
] | 18 | 2020-02-09T13:00:11.000Z | 2021-03-11T08:47:36.000Z | """Password generator allows you to generate a random password of length N."""
from random import choice
from string import ascii_letters, digits, punctuation
def password_generator(length=8):
"""
>>> len(password_generator())
8
>>> len(password_generator(length=16))
16
>>> len(password_genera... | 26.173077 | 84 | 0.68626 | from random import choice
from string import ascii_letters, digits, punctuation
def password_generator(length=8):
chars = tuple(ascii_letters) + tuple(digits) + tuple(punctuation)
return "".join(choice(chars) for x in range(length))
def alternative_password_generator(ctbi, i):
pass
def ... | true | true |
f726874106f79a0d94063c9a43eae7fc697a4f84 | 2,283 | py | Python | mindware/components/feature_engineering/transformations/rescaler/quantile_transformer.py | jhj0411jhj/soln-ml | 002ec06bf139b14bc059e0f0438501b31d9ed16a | [
"MIT"
] | 27 | 2021-07-19T09:03:34.000Z | 2022-03-31T06:19:23.000Z | mindware/components/feature_engineering/transformations/rescaler/quantile_transformer.py | jhj0411jhj/soln-ml | 002ec06bf139b14bc059e0f0438501b31d9ed16a | [
"MIT"
] | 4 | 2021-07-15T12:17:10.000Z | 2022-01-26T17:16:58.000Z | mindware/components/feature_engineering/transformations/rescaler/quantile_transformer.py | jhj0411jhj/soln-ml | 002ec06bf139b14bc059e0f0438501b31d9ed16a | [
"MIT"
] | 17 | 2020-05-12T20:24:50.000Z | 2021-07-11T03:31:38.000Z | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter, \
CategoricalHyperparameter
from mindware.components.feature_engineering.transformations.base_transformer import *
class QuantileTransformation(Transformer):
type = 5
def _... | 40.767857 | 109 | 0.65922 | from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter, \
CategoricalHyperparameter
from mindware.components.feature_engineering.transformations.base_transformer import *
class QuantileTransformation(Transformer):
type = 5
def _... | true | true |
f726877422782de259695a0ce16eb5bc2f697d80 | 360 | py | Python | resource_path.py | UAlbanyArchives/EADMachine-2.0 | 18e155f76374b295c287d32c6e54ef8ecabe29d2 | [
"MIT"
] | 5 | 2016-01-25T15:27:12.000Z | 2021-08-17T22:31:48.000Z | source/GUI/resource_path.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | null | null | null | source/GUI/resource_path.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | null | null | null | import os
import sys
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
retur... | 30 | 76 | 0.691667 | import os
import sys
def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path) | true | true |
f72687e80bced94fac9dfc6fc885ba3a3a16f55e | 1,067 | py | Python | plugins/threatstack/icon_threatstack/actions/get_rule/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/threatstack/icon_threatstack/actions/get_rule/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/threatstack/icon_threatstack/actions/get_rule/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import insightconnect_plugin_runtime
from .schema import GetRuleInput, GetRuleOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.helper import clean
from threatstack.errors import ThreatStackAPIError, ThreatStackClientError, APIRateLimitError
from insightconnect_plugin_runtime.e... | 38.107143 | 103 | 0.730084 | import insightconnect_plugin_runtime
from .schema import GetRuleInput, GetRuleOutput, Input, Output, Component
from insightconnect_plugin_runtime.helper import clean
from threatstack.errors import ThreatStackAPIError, ThreatStackClientError, APIRateLimitError
from insightconnect_plugin_runtime.exceptions import Plugi... | true | true |
f72688f4329669467a3225780b13734675bc50e3 | 383 | py | Python | geonames/exceptions.py | flyingdice/geonames-sqlite | acf51d9af723d46815c43509ce22712ce910a61e | [
"Apache-2.0"
] | null | null | null | geonames/exceptions.py | flyingdice/geonames-sqlite | acf51d9af723d46815c43509ce22712ce910a61e | [
"Apache-2.0"
] | null | null | null | geonames/exceptions.py | flyingdice/geonames-sqlite | acf51d9af723d46815c43509ce22712ce910a61e | [
"Apache-2.0"
] | null | null | null | """
geonames/exceptions
~~~~~~~~~~~~~~~~~~~
"""
from . import base
def ignore_foreign_key_constraint(db, options, record: base.T, exception: Exception) -> bool:
return 'FOREIGN KEY constraint failed' in str(exception)
def ignore_unique_key_constraint(db, options, record: base.T, exception: Exception) ->... | 27.357143 | 93 | 0.697128 | from . import base
def ignore_foreign_key_constraint(db, options, record: base.T, exception: Exception) -> bool:
return 'FOREIGN KEY constraint failed' in str(exception)
def ignore_unique_key_constraint(db, options, record: base.T, exception: Exception) -> bool:
return 'UNIQUE constraint failed' in str(exce... | true | true |
f7268900a2f97b94ecc6e2a71419685ab31bc7d7 | 131,714 | py | Python | rpython/rlib/parsing/pypackrat.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rlib/parsing/pypackrat.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rlib/parsing/pypackrat.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null |
from rpython.rlib.parsing.tree import Nonterminal, Symbol
from rpython.rlib.parsing.makepackrat import PackratParser, BacktrackException, Status
class Parser(object):
def NAME(self):
return self._NAME().result
def _NAME(self):
_key = self._pos
_status = self._dict_NAME.get(_key, None)... | 42.014035 | 93 | 0.466374 |
from rpython.rlib.parsing.tree import Nonterminal, Symbol
from rpython.rlib.parsing.makepackrat import PackratParser, BacktrackException, Status
class Parser(object):
def NAME(self):
return self._NAME().result
def _NAME(self):
_key = self._pos
_status = self._dict_NAME.get(_key, None)... | true | true |
f7268b17e5afdf9edaac16ec22aa1865bf00ab9e | 6,337 | py | Python | RecoTracker/ConversionSeedGenerators/python/PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | RecoTracker/ConversionSeedGenerators/python/PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 26 | 2018-10-30T12:47:58.000Z | 2022-03-29T08:39:00.000Z | RecoTracker/ConversionSeedGenerators/python/PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi.py | p2l1pfp/cmssw | 9bda22bf33ecf18dd19a3af2b3a8cbdb1de556a9 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
from RecoTracker.TkSeedGenerator.SeedGeneratorFromRegionHitsEDProducer_cfi import seedGeneratorFromRegionHitsEDProducer
CommonClusterCheckPSet = seedGeneratorFromRegionHitsEDProducer.ClusterCheckPSet
photonConvTrajSeedFromSingleLeg = cms.EDProducer("PhotonConversionTraject... | 70.411111 | 153 | 0.453369 | import FWCore.ParameterSet.Config as cms
from RecoTracker.TkSeedGenerator.SeedGeneratorFromRegionHitsEDProducer_cfi import seedGeneratorFromRegionHitsEDProducer
CommonClusterCheckPSet = seedGeneratorFromRegionHitsEDProducer.ClusterCheckPSet
photonConvTrajSeedFromSingleLeg = cms.EDProducer("PhotonConversionTraject... | true | true |
f7268b2e949d82a8bd564b36aff123357d5bc3a1 | 9,689 | py | Python | client_server_test/NEWGUI.py | hades208002/mdp-project | c242a8d00412cc3772d298986977f6acc47002ee | [
"MIT"
] | null | null | null | client_server_test/NEWGUI.py | hades208002/mdp-project | c242a8d00412cc3772d298986977f6acc47002ee | [
"MIT"
] | null | null | null | client_server_test/NEWGUI.py | hades208002/mdp-project | c242a8d00412cc3772d298986977f6acc47002ee | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
import tkinter.filedialog as fd
import pandas as pd
from LocalModelCommunication import LocalModelCommunication
from APP import APP
class GUI(object):
def __init__(self):
# overall
self.tabControl = None
self.tab_step1 = None
self.tab_step2 = None
self.tab_step3... | 31.254839 | 100 | 0.716999 | from tkinter import *
from tkinter import ttk
import tkinter.filedialog as fd
import pandas as pd
from LocalModelCommunication import LocalModelCommunication
from APP import APP
class GUI(object):
def __init__(self):
self.tabControl = None
self.tab_step1 = None
self.tab_step2 = None
self.tab_step3 = None
... | true | true |
f7268c06513bb9fa62c71a99d8cdf748c117880d | 14,879 | py | Python | cifar_cnn_three_conv.py | sidneyp/bidirectional | d3d1dbb727e5a25b4980646f1eb500245072f079 | [
"BSD-3-Clause"
] | 8 | 2018-05-22T10:02:51.000Z | 2022-01-11T03:02:51.000Z | cifar_cnn_three_conv.py | sidneyp/bidirectional | d3d1dbb727e5a25b4980646f1eb500245072f079 | [
"BSD-3-Clause"
] | null | null | null | cifar_cnn_three_conv.py | sidneyp/bidirectional | d3d1dbb727e5a25b4980646f1eb500245072f079 | [
"BSD-3-Clause"
] | 2 | 2021-01-07T19:39:19.000Z | 2021-11-14T09:06:35.000Z | import tensorflow as tf
import keras
from keras.datasets import cifar10
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
import sys
import csv
import utils_csv
import utils_tf as utils
from cleverhans.utils_tf import model_train, model_eval
from cleverhans.attacks impo... | 43.00289 | 178 | 0.699308 | import tensorflow as tf
import keras
from keras.datasets import cifar10
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
import sys
import csv
import utils_csv
import utils_tf as utils
from cleverhans.utils_tf import model_train, model_eval
from cleverhans.attacks impo... | true | true |
f7268d97ecd869e307e958def5462cfcc567d433 | 13,947 | py | Python | discum/guild/guild.py | DJJ05/Discord-S.C.U.M | 498c2aebb71cef331b1c47a8bb6ffe65e88d2a34 | [
"MIT"
] | 1 | 2022-01-02T13:39:38.000Z | 2022-01-02T13:39:38.000Z | discum/guild/guild.py | DJJ05/Discord-S.C.U.M | 498c2aebb71cef331b1c47a8bb6ffe65e88d2a34 | [
"MIT"
] | null | null | null | discum/guild/guild.py | DJJ05/Discord-S.C.U.M | 498c2aebb71cef331b1c47a8bb6ffe65e88d2a34 | [
"MIT"
] | 2 | 2022-02-17T13:04:55.000Z | 2022-02-28T00:48:00.000Z | from ..RESTapiwrap import Wrapper
from ..utils.permissions import PERMS, Permissions
from ..utils.contextproperties import ContextProperties
import time
import base64
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
class Guild(object):
__slots__ = ['discord', 's', 'log']
def __in... | 44.990323 | 226 | 0.723095 | from ..RESTapiwrap import Wrapper
from ..utils.permissions import PERMS, Permissions
from ..utils.contextproperties import ContextProperties
import time
import base64
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
class Guild(object):
__slots__ = ['discord', 's', 'log']
def __in... | true | true |
f7268dac2e06e129091c886ee83609a1a78deda9 | 2,558 | py | Python | sharpy/combat/terran/micro_liberators.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | sharpy/combat/terran/micro_liberators.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | sharpy/combat/terran/micro_liberators.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | from typing import Dict, Optional
from sc2.ids.ability_id import AbilityId
from sharpy.combat import Action, MoveType, MicroStep
from sc2.ids.unit_typeid import UnitTypeId
from sc2.unit import Unit
from sc2.position import Point2
class MicroLiberators(MicroStep):
def __init__(self, group_distance: float = -5):
... | 38.757576 | 111 | 0.635262 | from typing import Dict, Optional
from sc2.ids.ability_id import AbilityId
from sharpy.combat import Action, MoveType, MicroStep
from sc2.ids.unit_typeid import UnitTypeId
from sc2.unit import Unit
from sc2.position import Point2
class MicroLiberators(MicroStep):
def __init__(self, group_distance: float = -5):
... | true | true |
f7268dd4e5fbd94440e9ab3dc5fe73f4c538070d | 6,616 | py | Python | bindings/python/ensmallen_graph/datasets/string/proteusmirabilis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/proteusmirabilis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/proteusmirabilis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Proteus mirabilis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02-0... | 35.005291 | 223 | 0.700574 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def ProteusMirabilis(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
retur... | true | true |
f7268f4b4bb9d783f2b2aaad61a415d7093b910f | 65 | py | Python | tools/__init__.py | mchonan1996/safetyculture-sdk-python | 9737b8716698844dc09316baed0d50fc55c6ea8b | [
"Apache-2.0"
] | 22 | 2017-03-03T05:16:46.000Z | 2021-12-28T20:39:02.000Z | tools/__init__.py | mchonan1996/safetyculture-sdk-python | 9737b8716698844dc09316baed0d50fc55c6ea8b | [
"Apache-2.0"
] | 12 | 2017-02-28T06:29:07.000Z | 2021-03-25T21:42:14.000Z | tools/__init__.py | mchonan1996/safetyculture-sdk-python | 9737b8716698844dc09316baed0d50fc55c6ea8b | [
"Apache-2.0"
] | 15 | 2017-02-23T00:49:18.000Z | 2021-12-28T20:39:20.000Z | from .exporter import csvExporter
from .exporter import exporter
| 21.666667 | 33 | 0.846154 | from .exporter import csvExporter
from .exporter import exporter
| true | true |
f7268fd09962820734816832c033e7525fcd9ab8 | 432 | py | Python | website/util/time.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | website/util/time.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | website/util/time.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import time
from datetime import datetime
def get_timestamp():
return int(time.time())
def throttle_period_expired(timestamp, throttle):
if not timestamp:
return True
elif isinstance(timestamp, datetime):
return (datetime.utc... | 24 | 73 | 0.699074 |
from __future__ import absolute_import
import time
from datetime import datetime
def get_timestamp():
return int(time.time())
def throttle_period_expired(timestamp, throttle):
if not timestamp:
return True
elif isinstance(timestamp, datetime):
return (datetime.utcnow() - timestamp).tota... | true | true |
f726902376e280ba863a7c19c43b900218daf48a | 4,130 | py | Python | alipay/aop/api/request/AlipayMarketingCampaignPromotionactivityCustomerReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayMarketingCampaignPromotionactivityCustomerReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayMarketingCampaignPromotionactivityCustomerReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingCampaignPromotionactivityCustomerReceiveModel import AlipayMarketingCampaignPromotionactivityCustomerReceiveModel
cla... | 28.482759 | 155 | 0.658111 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingCampaignPromotionactivityCustomerReceiveModel import AlipayMarketingCampaignPromotionactivityCustomerReceiveModel
class AlipayMarketingCampaignPromotionactivityC... | true | true |
f7269048fed394fc95bcb70e5e4e1c5ecb768bd1 | 2,752 | py | Python | py_pdf_term/analysis/_analysis/occurrences/term.py | kumachan-mis/pdf-slides-term | cf3319e4de723bd9424d23141803342d3c649103 | [
"MIT"
] | 1 | 2021-01-08T16:05:30.000Z | 2021-01-08T16:05:30.000Z | py_pdf_term/analysis/_analysis/occurrences/term.py | kumachan-mis/py-slides-term | 1e9337b97ae8968950489e728fc7aeeeb7eb1f4b | [
"MIT"
] | 21 | 2021-01-03T13:50:59.000Z | 2021-06-17T00:27:49.000Z | py_pdf_term/analysis/_analysis/occurrences/term.py | kumachan-mis/pdf-slides-term | cf3319e4de723bd9424d23141803342d3c649103 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Set, Dict
from ..runner import AnalysisRunner
from py_pdf_term.candidates import DomainCandidateTermList
from py_pdf_term._common.data import Term
@dataclass(frozen=True)
class DomainTermOccurrence:
domain: str
# unique domain name
term_freq: Dict[str,... | 37.189189 | 87 | 0.68968 | from dataclasses import dataclass
from typing import Set, Dict
from ..runner import AnalysisRunner
from py_pdf_term.candidates import DomainCandidateTermList
from py_pdf_term._common.data import Term
@dataclass(frozen=True)
class DomainTermOccurrence:
domain: str
term_freq: Dict[str, int]
... | true | true |
f72690a7b3248a10457383f38300fee9412153dd | 124,514 | py | Python | Compiler/types.py | lemonviv/Pivot-SPDZ | f3db87d8849e5f9fa39f321d85feec83107ee405 | [
"BSD-2-Clause"
] | null | null | null | Compiler/types.py | lemonviv/Pivot-SPDZ | f3db87d8849e5f9fa39f321d85feec83107ee405 | [
"BSD-2-Clause"
] | null | null | null | Compiler/types.py | lemonviv/Pivot-SPDZ | f3db87d8849e5f9fa39f321d85feec83107ee405 | [
"BSD-2-Clause"
] | null | null | null | from Compiler.program import Tape
from Compiler.exceptions import *
from Compiler.instructions import *
from Compiler.instructions_base import *
from .floatingpoint import two_power
from . import comparison, floatingpoint
import math
from . import util
import operator
from functools import reduce
class ClientMessageT... | 32.792731 | 202 | 0.561166 | from Compiler.program import Tape
from Compiler.exceptions import *
from Compiler.instructions import *
from Compiler.instructions_base import *
from .floatingpoint import two_power
from . import comparison, floatingpoint
import math
from . import util
import operator
from functools import reduce
class ClientMessageT... | true | true |
f72692b82fed413b8a80f995369aec1ebc838715 | 668 | py | Python | onlineassessmentsystem/blog/migrations/0001_initial.py | nevilparmar11/SDP_Online_Assessment_System | 012a1ec7dfca2973a5e03b0f970394cfa674b61e | [
"MIT"
] | 2 | 2021-05-22T15:44:19.000Z | 2021-05-22T17:59:58.000Z | onlineassessmentsystem/blog/migrations/0001_initial.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | 7 | 2021-01-18T06:06:38.000Z | 2021-03-03T15:09:17.000Z | onlineassessmentsystem/blog/migrations/0001_initial.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | 2 | 2021-03-05T12:28:28.000Z | 2021-05-24T16:10:07.000Z | # Generated by Django 3.1.5 on 2021-01-09 16:06
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('blogId', models.AutoField... | 27.833333 | 103 | 0.58982 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('blogId', models.AutoField(primary_key=True, serialize=False)),
... | true | true |
f72693b15cffa1a04a5fc7222fdd4715cbead461 | 716 | py | Python | tests/test_mag_orms.py | nestauk/ai_research | 19fd193b098dc68706b945e959fad29c4bfed781 | [
"MIT"
] | 3 | 2020-02-24T19:25:39.000Z | 2021-06-29T10:38:29.000Z | tests/test_mag_orms.py | nestauk/ai_research | 19fd193b098dc68706b945e959fad29c4bfed781 | [
"MIT"
] | 19 | 2020-02-24T07:48:52.000Z | 2020-12-21T10:50:14.000Z | tests/test_mag_orms.py | nestauk/ai_research | 19fd193b098dc68706b945e959fad29c4bfed781 | [
"MIT"
] | null | null | null | import pytest
import unittest
import os
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from ai_research.mag.mag_orm import Base
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class TestMag(unittest.TestCase):
"""Check that the MAG ORM works as expected"""
... | 22.375 | 56 | 0.710894 | import pytest
import unittest
import os
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from ai_research.mag.mag_orm import Base
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class TestMag(unittest.TestCase):
engine = create_engine(os.getenv("test_postgresdb... | true | true |
f72693b16d34b944f5bb4a1349f76575267e7ffa | 1,136 | py | Python | examples/hacker_news/hacker_news/resources/s3_notebook_io_manager.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/hacker_news/hacker_news/resources/s3_notebook_io_manager.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/hacker_news/hacker_news/resources/s3_notebook_io_manager.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from dagstermill.io_managers import OutputNotebookIOManager
from dagster import io_manager
from .fixed_s3_pickle_io_manager import s3_client
class S3OutputNotebookIOManager(OutputNotebookIOManager):
"""Defines an IOManager that will store dagstermill output notebooks on s3"""
def _get_key(self, context) ->... | 37.866667 | 82 | 0.727113 | from dagstermill.io_managers import OutputNotebookIOManager
from dagster import io_manager
from .fixed_s3_pickle_io_manager import s3_client
class S3OutputNotebookIOManager(OutputNotebookIOManager):
def _get_key(self, context) -> str:
return "notebooks/" + "_".join(context.get_run_scoped_output_identif... | true | true |
f72695448dd7c1288748bbad417bedf5678eb8a3 | 3,495 | py | Python | src/wpusher/vdesk.py | brenttaylor/WindowPusher | d6ecb9aa1ad69e954cba5632ee56fd6f6c1f8c06 | [
"BSD-3-Clause"
] | null | null | null | src/wpusher/vdesk.py | brenttaylor/WindowPusher | d6ecb9aa1ad69e954cba5632ee56fd6f6c1f8c06 | [
"BSD-3-Clause"
] | null | null | null | src/wpusher/vdesk.py | brenttaylor/WindowPusher | d6ecb9aa1ad69e954cba5632ee56fd6f6c1f8c06 | [
"BSD-3-Clause"
] | null | null | null | import user32
import win32con
import ctypes
import collections
class VirtualDesktopException(Exception):
pass
class NoForegroundWindow(VirtualDesktopException):
pass
class VirtualDesktop(object):
def __init__(self):
self.window = []
self.removed_windows = []
def remove_foreground_... | 29.871795 | 99 | 0.654649 | import user32
import win32con
import ctypes
import collections
class VirtualDesktopException(Exception):
pass
class NoForegroundWindow(VirtualDesktopException):
pass
class VirtualDesktop(object):
def __init__(self):
self.window = []
self.removed_windows = []
def remove_foreground_... | true | true |
f7269554e70b05b444508f2c600f6f0487716659 | 2,187 | py | Python | src/jobhunt_prod/scrape/multiprocess_simply.py | smiller20/CareerCentral | 455df0910dff1a1883fd56365a7a4feeb7726b22 | [
"MIT"
] | null | null | null | src/jobhunt_prod/scrape/multiprocess_simply.py | smiller20/CareerCentral | 455df0910dff1a1883fd56365a7a4feeb7726b22 | [
"MIT"
] | null | null | null | src/jobhunt_prod/scrape/multiprocess_simply.py | smiller20/CareerCentral | 455df0910dff1a1883fd56365a7a4feeb7726b22 | [
"MIT"
] | 1 | 2020-12-04T22:57:24.000Z | 2020-12-04T22:57:24.000Z | """
simply hired using multi process design
scrape through 11 pages of simply using a multi processing for each I/O (4x faster)
"""
from requests import get
from bs4 import BeautifulSoup
from threading import Thread
import multiprocessing
from os import getpid
import psutil
def get_simply(url, role ):
alldata={}
... | 33.646154 | 120 | 0.621856 |
from requests import get
from bs4 import BeautifulSoup
from threading import Thread
import multiprocessing
from os import getpid
import psutil
def get_simply(url, role ):
alldata={}
response = get(url, headers={'User-Agent': 'Mozilla/5.0'})
try:
soup = BeautifulSoup(response.text, 'html.parser')
... | true | true |
f7269559f7d7eaf9efb701f4e1ac759e3c36654f | 502 | py | Python | aardvark/__about__.py | mbaciu-gpsw/aardvark | c2a0797bf3769ba819dcbacd4a80f4e9764d035e | [
"Apache-2.0"
] | null | null | null | aardvark/__about__.py | mbaciu-gpsw/aardvark | c2a0797bf3769ba819dcbacd4a80f4e9764d035e | [
"Apache-2.0"
] | 10 | 2019-07-23T09:03:02.000Z | 2019-10-15T14:53:14.000Z | aardvark/__about__.py | mbaciu-gpsw/aardvark | c2a0797bf3769ba819dcbacd4a80f4e9764d035e | [
"Apache-2.0"
] | 1 | 2022-01-11T13:06:32.000Z | 2022-01-11T13:06:32.000Z | __all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "aardvark"
__summary__ = ("Multi-Account AWS IAM Access Advisor API")
__uri__ = "https://github.com/Netflix-Skunkworks/aardvark"
__version__ = "0.2.1"
__author__ = "Patri... | 29.529412 | 71 | 0.7251 | __all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "aardvark"
__summary__ = ("Multi-Account AWS IAM Access Advisor API")
__uri__ = "https://github.com/Netflix-Skunkworks/aardvark"
__version__ = "0.2.1"
__author__ = "Patri... | true | true |
f726956703146c7de18a5d8a95ca243d34616547 | 12,727 | py | Python | pydmd/hankeldmd.py | kathryn-garside/PyDMD-fork | 0158c4144019f0899ce34ec44286b0f700c56b38 | [
"MIT"
] | null | null | null | pydmd/hankeldmd.py | kathryn-garside/PyDMD-fork | 0158c4144019f0899ce34ec44286b0f700c56b38 | [
"MIT"
] | null | null | null | pydmd/hankeldmd.py | kathryn-garside/PyDMD-fork | 0158c4144019f0899ce34ec44286b0f700c56b38 | [
"MIT"
] | null | null | null | """
Derived module from dmdbase.py for hankel dmd.
Reference:
- H. Arbabi, I. Mezic, Ergodic theory, dynamic mode decomposition, and
computation of spectral properties of the Koopman operator. SIAM Journal on
Applied Dynamical Systems, 2017, 16.4: 2096-2126.
"""
from copy import copy
import numpy as np
from .dmdbase... | 36.997093 | 79 | 0.613735 | from copy import copy
import numpy as np
from .dmdbase import DMDBase
from .dmd import DMD
class HankelDMD(DMDBase):
def __init__(
self,
svd_rank=0,
tlsq_rank=0,
exact=False,
opt=False,
rescale_mode=None,
forward_backward=False,
d=1,
sorte... | true | true |
f72695c880ab96368ab83d470e012d516b14bf5a | 1,438 | py | Python | pfrl/policies/softmax_policy.py | tkelestemur/pfrl | 388855fb30313185d43ae0d0f4b694be647a5c43 | [
"MIT"
] | null | null | null | pfrl/policies/softmax_policy.py | tkelestemur/pfrl | 388855fb30313185d43ae0d0f4b694be647a5c43 | [
"MIT"
] | 1 | 2021-05-14T20:53:26.000Z | 2021-05-20T15:58:32.000Z | pfrl/policies/softmax_policy.py | tkelestemur/pfrl | 388855fb30313185d43ae0d0f4b694be647a5c43 | [
"MIT"
] | 1 | 2021-06-09T03:17:34.000Z | 2021-06-09T03:17:34.000Z | import torch
from torch import nn
from torch.distributions import Categorical
class SoftmaxCategoricalHead(nn.Module):
def forward(self, logits):
return torch.distributions.Categorical(logits=logits)
# class MultiSoftmaxCategoricalHead(nn.Module):
# def forward(self, logits):
# return Indepe... | 29.958333 | 85 | 0.665508 | import torch
from torch import nn
from torch.distributions import Categorical
class SoftmaxCategoricalHead(nn.Module):
def forward(self, logits):
return torch.distributions.Categorical(logits=logits)
class MultiCategorical():
def __init__(self, dims=None, logits=None):
self.dims = dims
... | true | true |
f72695ed24f4c5a0ae1409ac5bdd45ac4dd38389 | 27,191 | py | Python | .qt_for_python/rcc/application.py | RodrooMtz/app_escritorio | e918f086d2b3a0a9749c8afb20e11845773cd117 | [
"MIT"
] | null | null | null | .qt_for_python/rcc/application.py | RodrooMtz/app_escritorio | e918f086d2b3a0a9749c8afb20e11845773cd117 | [
"MIT"
] | null | null | null | .qt_for_python/rcc/application.py | RodrooMtz/app_escritorio | e918f086d2b3a0a9749c8afb20e11845773cd117 | [
"MIT"
] | null | null | null | # Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.0.4
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x08\x19\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00 \x00\x00\x00 \x08\... | 44.648604 | 96 | 0.710603 |
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x08\x19\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\
\x00\x00\x00\x04gAMA\x00\x00\xd6\xd8\xd4OX2\
\x00\x00\x00\x19tEXtSoftware\
\x00Adobe ImageRead\
yq\xc9e<\x00\x00\x07\xabIDATX\xc3\xad\
W[P\x93g\... | true | true |
f72696fc0cf591521dd786bc37d9a5424a0b4f8b | 298 | py | Python | tests/test_singleton_container.py | ClanPlay/Python_IoC | fad7a3053a7a2193474caa5918508307cfd7b79a | [
"MIT"
] | 4 | 2019-02-20T19:44:32.000Z | 2019-02-22T13:32:25.000Z | tests/test_singleton_container.py | ClanPlay-Market/clanplay_Python_IoC | fad7a3053a7a2193474caa5918508307cfd7b79a | [
"MIT"
] | 1 | 2019-02-20T14:48:04.000Z | 2019-02-20T14:48:23.000Z | tests/test_singleton_container.py | ClanPlay/Python_IoC | fad7a3053a7a2193474caa5918508307cfd7b79a | [
"MIT"
] | null | null | null | from flying_ioc import IocManager
class TSingleton1:
def __init__(self):
pass
def test_singleton_container():
ioc = IocManager(stats=True)
ioc.set_class(name='singleton1', cls=TSingleton1, singleton=True)
assert ioc.singleton1 is ioc.singleton1
ioc.print_stats()
| 17.529412 | 69 | 0.721477 | from flying_ioc import IocManager
class TSingleton1:
def __init__(self):
pass
def test_singleton_container():
ioc = IocManager(stats=True)
ioc.set_class(name='singleton1', cls=TSingleton1, singleton=True)
assert ioc.singleton1 is ioc.singleton1
ioc.print_stats()
| true | true |
f72698682f1d9db8336712cdc43ed2619483c604 | 1,583 | py | Python | 61dust.py | krikor-s/homework | 63c6711fe0ea64f5d3087673ac931dd0503be546 | [
"MIT"
] | null | null | null | 61dust.py | krikor-s/homework | 63c6711fe0ea64f5d3087673ac931dd0503be546 | [
"MIT"
] | null | null | null | 61dust.py | krikor-s/homework | 63c6711fe0ea64f5d3087673ac931dd0503be546 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 61dust.py
import argparse
from fileinput import filename
import mcb185 as mcb
# Write a program that finds and masks low entropy sequence
# Use argparse for the following parameters
# sequence file
# window size
# entropy threshold
# lowercase or N-based masking
# The program should o... | 28.267857 | 87 | 0.713834 |
import argparse
from fileinput import filename
import mcb185 as mcb
parser = argparse.ArgumentParser(description='Outputs of masked low entropy sequence.')
parser.add_argument('--fasta', required=True, type=str,
metavar='<str>', help='required FASTA file')
parser.add_argument('--wins', required=True, t... | true | true |
f726986d83879eef6d553b88636ef538361fe2f9 | 14,545 | py | Python | qa/rpc-tests/dip4-coinbasemerkleroots.py | Wildfire-new/Wildfire-MN-POW | 0434339c79fa8525408b8edd1ff003be4f367e1c | [
"MIT"
] | 1 | 2021-01-22T17:22:27.000Z | 2021-01-22T17:22:27.000Z | qa/rpc-tests/dip4-coinbasemerkleroots.py | Wildfire-new/Wildfire-MN-POW | 0434339c79fa8525408b8edd1ff003be4f367e1c | [
"MIT"
] | 4 | 2020-12-01T01:38:47.000Z | 2021-01-21T19:19:57.000Z | qa/rpc-tests/dip4-coinbasemerkleroots.py | Wildfire-new/Wildfire-MN-POW | 0434339c79fa8525408b8edd1ff003be4f367e1c | [
"MIT"
] | 1 | 2021-08-25T06:44:01.000Z | 2021-08-25T06:44:01.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from collections import namedtuple
from test_framework.mininode import *
from test_framework.test_framework ... | 48.645485 | 169 | 0.691097 |
from collections import namedtuple
from test_framework.mininode import *
from test_framework.test_framework import WildfireTestFramework
from test_framework.util import *
from time import *
class TestNode(SingleNodeConnCB):
def __init__(self):
SingleNodeConnCB.__init__(self)
self.last_mnlistd... | true | true |
f72698df2982562089d403ee92680cbf783ca0e2 | 31,875 | py | Python | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/typeinfo.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 46 | 2017-09-07T14:59:22.000Z | 2020-10-31T20:34:12.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/typeinfo.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/typeinfo.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 317 | 2017-06-20T19:57:17.000Z | 2020-09-16T10:28:30.000Z | # XXX Should convert from STDMETHOD to COMMETHOD.
# generated by 'xml2py'
# flags '..\tools\windows.xml -m comtypes -m comtypes.automation -w -r .*TypeLibEx -r .*TypeLib -o typeinfo.py'
# then hacked manually
import os
import sys
import weakref
from ctypes import *
from ctypes.wintypes import ULONG
from comtypes impo... | 34.874179 | 134 | 0.637427 |
import os
import sys
import weakref
from ctypes import *
from ctypes.wintypes import ULONG
from comtypes import STDMETHOD
from comtypes import COMMETHOD
from comtypes import _GUID, GUID
from comtypes.automation import BSTR
from comtypes.automation import DISPID
from comtypes.automation import DISPPARAMS
from com... | true | true |
f72698ecbc016f7724c2386a1d6649e19cd6da72 | 5,206 | py | Python | manimlib/animation/growing.py | SidewayOutput/Basic-Manim | 4dea4b00daa7b6f66ed7b26659045f67609d83b6 | [
"MIT"
] | null | null | null | manimlib/animation/growing.py | SidewayOutput/Basic-Manim | 4dea4b00daa7b6f66ed7b26659045f67609d83b6 | [
"MIT"
] | null | null | null | manimlib/animation/growing.py | SidewayOutput/Basic-Manim | 4dea4b00daa7b6f66ed7b26659045f67609d83b6 | [
"MIT"
] | null | null | null | from manimlib.animation.transform import Transform
from manimlib.basic.basic_function import to_expand_lists, to_get_point
from manimlib.constants import PI
from manimlib.utils.config_ops import generate_args, merge_config_kwargs
class GrowFromPoint(Transform):
def __init__(self, mobject, mobject_or_point="get_ce... | 32.135802 | 84 | 0.664426 | from manimlib.animation.transform import Transform
from manimlib.basic.basic_function import to_expand_lists, to_get_point
from manimlib.constants import PI
from manimlib.utils.config_ops import generate_args, merge_config_kwargs
class GrowFromPoint(Transform):
def __init__(self, mobject, mobject_or_point="get_ce... | true | true |
f726991caedc24166bb6ed9a085571aa0555465e | 4,333 | py | Python | sdks/python/appcenter_sdk/models/InternalHockeyAppCutoverStatusResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/InternalHockeyAppCutoverStatusResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/InternalHockeyAppCutoverStatusResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class InternalHockey... | 29.080537 | 95 | 0.587122 |
import pprint
import re
import six
class InternalHockeyAppCutoverStatusResponse(object):
not_requested = "not_requested"
requested = "requested"
in_progress = "in_progress"
completed = "completed"
swagger_types = {
'id': 'string',
'status': 'string'
}
attribute_map ... | true | true |
f7269945af61fa78d01b7ddd1fc00faa4eb56f7f | 8,120 | py | Python | utils/swift_build_support/swift_build_support/targets.py | DougGregor/swift | 16b686989c12bb1acf9d1a490c1f301d71428f47 | [
"Apache-2.0"
] | 11 | 2016-01-26T22:56:55.000Z | 2022-03-28T05:57:56.000Z | utils/swift_build_support/swift_build_support/targets.py | danielgalasko/swift | e2501ad9f9e53a7156148d6da5c7796e487723f8 | [
"Apache-2.0"
] | 2 | 2019-04-11T21:36:21.000Z | 2021-04-14T06:09:10.000Z | utils/swift_build_support/swift_build_support/targets.py | DougGregor/swift | 16b686989c12bb1acf9d1a490c1f301d71428f47 | [
"Apache-2.0"
] | 1 | 2016-08-24T17:30:38.000Z | 2016-08-24T17:30:38.000Z | # swift_build_support/targets.py - Build target helpers -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for lic... | 34.261603 | 79 | 0.607759 |
import os
import platform
class Platform(object):
def __init__(self, name, archs, sdk_name=None):
self.name = name
self.targets = [Target(self, arch) for arch in archs]
self.sdk_name = name.upper() if sdk_name is None else sdk_name
fo... | true | true |
f7269969627b886f2d9ff179c1f78a4abf30f3d0 | 1,426 | py | Python | Python/DataStructures/Trie.py | AndrewMcShane/DevMakingSource | fe58fa093e0ce2d2748cb3826d27be6b0ac34149 | [
"MIT"
] | 3 | 2021-03-22T14:13:56.000Z | 2022-03-01T03:06:22.000Z | Python/DataStructures/Trie.py | AndrewMcShane/DevMakingSource | fe58fa093e0ce2d2748cb3826d27be6b0ac34149 | [
"MIT"
] | null | null | null | Python/DataStructures/Trie.py | AndrewMcShane/DevMakingSource | fe58fa093e0ce2d2748cb3826d27be6b0ac34149 | [
"MIT"
] | null | null | null | class TrieNode:
def __init__(self):
self.children = {}
self.isWord = False
class Trie:
def __init__(self):
self.root = TrieNode()
def put(self, word):
current = self.root
for i in range(0, len(word)):
child = word[i]
tmp = None
... | 26.90566 | 80 | 0.497896 | class TrieNode:
def __init__(self):
self.children = {}
self.isWord = False
class Trie:
def __init__(self):
self.root = TrieNode()
def put(self, word):
current = self.root
for i in range(0, len(word)):
child = word[i]
tmp = None
... | true | true |
f72699b30c150ef217cd9689772840359f84dd62 | 8,999 | py | Python | sunpy/coordinates/wcs_utils.py | LaudateCorpus1/sunpy | f7bdf22e5229a577c5851c1e05502f0d68b4b369 | [
"BSD-2-Clause"
] | 628 | 2015-01-14T17:34:10.000Z | 2022-03-29T06:07:50.000Z | sunpy/coordinates/wcs_utils.py | wtbarnes/sunpy | f7bdf22e5229a577c5851c1e05502f0d68b4b369 | [
"BSD-2-Clause"
] | 3,983 | 2015-01-03T11:16:21.000Z | 2022-03-31T16:55:38.000Z | sunpy/coordinates/wcs_utils.py | wtbarnes/sunpy | f7bdf22e5229a577c5851c1e05502f0d68b4b369 | [
"BSD-2-Clause"
] | 582 | 2015-01-14T10:09:24.000Z | 2022-03-29T06:07:12.000Z | import numpy as np
import astropy.units as u
import astropy.wcs.utils
from astropy.coordinates import (
ITRS,
BaseCoordinateFrame,
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
)
from astropy.wcs import WCS
from sunpy import log
from .frames import (
BaseCoordinateFrame,
Heli... | 33.830827 | 88 | 0.628737 | import numpy as np
import astropy.units as u
import astropy.wcs.utils
from astropy.coordinates import (
ITRS,
BaseCoordinateFrame,
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
)
from astropy.wcs import WCS
from sunpy import log
from .frames import (
BaseCoordinateFrame,
Heli... | true | true |
f7269aeac3ba7da133f1493f4f5259f6dcf883c0 | 26,097 | py | Python | WfaUWTSCore/src/core/configurator.py | Wi-FiTestSuite/Wi-FiTestSuite10.0.0beta | 06fe5ec068cf24e3b202f7eb76ddc2b0249eb112 | [
"0BSD"
] | 12 | 2016-07-11T19:21:14.000Z | 2022-02-18T09:25:14.000Z | WfaUWTSCore/src/core/configurator.py | Wi-FiTestSuite/Wi-FiTestSuite10.0.0beta | 06fe5ec068cf24e3b202f7eb76ddc2b0249eb112 | [
"0BSD"
] | 3 | 2021-01-06T19:16:31.000Z | 2022-02-25T02:19:37.000Z | WfaUWTSCore/src/core/configurator.py | Wi-FiTestSuite/Wi-FiTestSuite10.0.0beta | 06fe5ec068cf24e3b202f7eb76ddc2b0249eb112 | [
"0BSD"
] | 9 | 2016-10-19T11:46:22.000Z | 2022-02-22T11:30:51.000Z | ###############################################################################
#
# Copyright (c) 2016 Wi-Fi Alliance
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appea... | 58.252232 | 388 | 0.619573 | d_type = v_cmd_data['command'].get('command_type').lower()
for tbd in testbed_device_list:
true_dev_name = tbd_name.replace('wfa_control_agent_', '').lower()
if tbd_name.endswith('_sta') and tbd.dev_type == "STA":
true_sta_name = true_dev... | false | true |
f7269bbfbe9e6440da662f049b38c023e316d1dd | 17,900 | py | Python | backend/main.py | Plane-walker/fabric-draw | 7a3b4baef4d59a47c046e68d1fc5f20aeddd4c11 | [
"MIT"
] | 1 | 2021-09-01T06:31:26.000Z | 2021-09-01T06:31:26.000Z | backend/main.py | Plane-walker/fabric-draw | 7a3b4baef4d59a47c046e68d1fc5f20aeddd4c11 | [
"MIT"
] | 20 | 2021-09-22T13:04:07.000Z | 2021-10-11T12:27:12.000Z | backend/main.py | Plane-walker/fabric-draw | 7a3b4baef4d59a47c046e68d1fc5f20aeddd4c11 | [
"MIT"
] | null | null | null | import paramiko
import time
import io
import os
import stat
from yaml_generator import CAYamlGenerator, OrderYamlGenerator, PeerYamlGenerator, ConfigTXYamlGenerator
def sftp_get_r(sftp_client, remote_path, local_path):
try:
sftp_client.stat(remote_path)
except IOError:
return
if not os.pat... | 52.339181 | 232 | 0.632458 | import paramiko
import time
import io
import os
import stat
from yaml_generator import CAYamlGenerator, OrderYamlGenerator, PeerYamlGenerator, ConfigTXYamlGenerator
def sftp_get_r(sftp_client, remote_path, local_path):
try:
sftp_client.stat(remote_path)
except IOError:
return
if not os.pat... | true | true |
f7269dbe969bf3a3bdd44ac8ab46929aa9601789 | 2,670 | py | Python | import_metadata.py | arru/plex-utilities | b5ea04c090f1fdc008ae39239c1b03b435036acb | [
"BSD-3-Clause"
] | 1 | 2020-12-26T14:45:53.000Z | 2020-12-26T14:45:53.000Z | import_metadata.py | arru/plex-utilities | b5ea04c090f1fdc008ae39239c1b03b435036acb | [
"BSD-3-Clause"
] | null | null | null | import_metadata.py | arru/plex-utilities | b5ea04c090f1fdc008ae39239c1b03b435036acb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/python3
# https://python-plexapi.readthedocs.io/en/latest/modules/media.html
# https://github.com/liamks/libpytunes/blob/master/README.md
from os import path
import ImportUtils
CONFIGURATION = ImportUtils.get_configuration()
class FakePlexTrack:
originalTitle = ""
userRating = 0.0
year... | 30.689655 | 84 | 0.696629 |
from os import path
import ImportUtils
CONFIGURATION = ImportUtils.get_configuration()
class FakePlexTrack:
originalTitle = ""
userRating = 0.0
year = None
addedAt = ImportUtils.CURRENT_DATE
index = 0
lastViewedAt = None
title = ""
titleSort = None
viewCount = 0
def __in... | true | true |
f7269e3d1d7c351c9df854a7024d0200b141ab6d | 5,084 | py | Python | sdk/python/pulumi_azure_nextgen/authorization/latest/get_management_lock_at_resource_level.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/authorization/latest/get_management_lock_at_resource_level.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/authorization/latest/get_management_lock_at_resource_level.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.107692 | 283 | 0.648308 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetManagementLockAtResourceLevelResult',
'AwaitableGetManagementLockAtResourceLevelResult',
'get_management_lock_at_resou... | true | true |
f7269ea2093e6b0c5b7f64bb94961bc815827e61 | 6,713 | py | Python | misc/webdriver-w3c-tests/client/driver.py | zhuyongyong/crosswalk-test-suite | 24f3f8cfa663a365b0a22685d5bd096a637f72db | [
"BSD-3-Clause"
] | null | null | null | misc/webdriver-w3c-tests/client/driver.py | zhuyongyong/crosswalk-test-suite | 24f3f8cfa663a365b0a22685d5bd096a637f72db | [
"BSD-3-Clause"
] | null | null | null | misc/webdriver-w3c-tests/client/driver.py | zhuyongyong/crosswalk-test-suite | 24f3f8cfa663a365b0a22685d5bd096a637f72db | [
"BSD-3-Clause"
] | null | null | null | """Entry point for WebDriver."""
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
"""Controls a web browser."""
def __init__(self, host, required, desired, mode='strict'):
args = {'desiredCapabilities': desired}
... | 33.565 | 80 | 0.58558 |
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
def __init__(self, host, required, desired, mode='strict'):
args = {'desiredCapabilities': desired}
if required:
args['requiredCapabilities'] = required
... | true | true |
f7269ecfb8cc07dc1f1a6af43bc49083c18df9d2 | 938 | py | Python | mobilecoind/clients/python/lib/setup.py | mccobr/mobilecoin | cd7753a0aed838097b456d230151fb34e8cff034 | [
"Apache-2.0"
] | 140 | 2020-04-15T17:51:12.000Z | 2020-10-02T19:51:57.000Z | mobilecoind/clients/python/lib/setup.py | mccobr/mobilecoin | cd7753a0aed838097b456d230151fb34e8cff034 | [
"Apache-2.0"
] | 292 | 2020-10-22T00:34:35.000Z | 2022-03-29T09:29:14.000Z | mobilecoind/clients/python/lib/setup.py | mccobr/mobilecoin | cd7753a0aed838097b456d230151fb34e8cff034 | [
"Apache-2.0"
] | 32 | 2020-04-15T18:17:07.000Z | 2020-10-19T23:25:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mobilecoin",
version="0.3.3",
author="MobileCoin",
author_email="support@mobilecoin.com",
description="Python bindings for the MobileCoin da... | 31.266667 | 104 | 0.670576 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mobilecoin",
version="0.3.3",
author="MobileCoin",
author_email="support@mobilecoin.com",
description="Python bindings for the MobileCoin daemon API.",
long_description=long_descrip... | true | true |
f7269f404c1a317ded575623966d09871ec4b217 | 9,554 | py | Python | samsungtvws/remote.py | chemelli74/samsung-tv-ws-api | bffbdd1796c95d5147117a5fc6583a803c310cd4 | [
"MIT"
] | null | null | null | samsungtvws/remote.py | chemelli74/samsung-tv-ws-api | bffbdd1796c95d5147117a5fc6583a803c310cd4 | [
"MIT"
] | null | null | null | samsungtvws/remote.py | chemelli74/samsung-tv-ws-api | bffbdd1796c95d5147117a5fc6583a803c310cd4 | [
"MIT"
] | null | null | null | """
SamsungTVWS - Samsung Smart TV WS API wrapper
Copyright (C) 2019 Xchwarze
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your op... | 34.366906 | 121 | 0.57578 | import base64
import json
import logging
import time
import ssl
import websocket
import requests
from . import exceptions
from . import shortcuts
_LOGGING = logging.getLogger(__name__)
class SamsungTVWS:
_URL_FORMAT = 'ws://{host}:{port}/api/v2/channels/samsung.remote.control?name={name}'
_SSL_URL_FORMAT = '... | true | true |
f726a064dd1bdc39f3586c546ec4b50d380b3919 | 2,492 | py | Python | tests/components/spc/test_init.py | tuxbox/home-assistant | df74272ba6311d527fd07198929c80a45d9fed15 | [
"Apache-2.0"
] | 1 | 2019-12-26T15:06:02.000Z | 2019-12-26T15:06:02.000Z | tests/components/spc/test_init.py | tuxbox/home-assistant | df74272ba6311d527fd07198929c80a45d9fed15 | [
"Apache-2.0"
] | null | null | null | tests/components/spc/test_init.py | tuxbox/home-assistant | df74272ba6311d527fd07198929c80a45d9fed15 | [
"Apache-2.0"
] | null | null | null | """Tests for Vanderbilt SPC component."""
from unittest.mock import patch, PropertyMock, Mock
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.spc import DATA_API
from homeassistant.const import STATE_ALARM_ARMED_AWAY, STATE_ALARM_DISARMED
from tests.common import mock_coro
as... | 34.136986 | 85 | 0.702648 | from unittest.mock import patch, PropertyMock, Mock
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.spc import DATA_API
from homeassistant.const import STATE_ALARM_ARMED_AWAY, STATE_ALARM_DISARMED
from tests.common import mock_coro
async def test_valid_device_config(hass, mon... | true | true |
f726a0e6a992cdb370f4db8314ec60bd087084f1 | 13,279 | py | Python | game-simulation/ctf01d-assistent.py | freehackquest/fhq-jury-ad | c839eefe98e5a6ccec6b182417f13929ebfe733a | [
"MIT"
] | 12 | 2018-09-28T10:57:10.000Z | 2020-03-30T15:53:05.000Z | game-simulation/ctf01d-assistent.py | freehackquest/fhq-jury-ad | c839eefe98e5a6ccec6b182417f13929ebfe733a | [
"MIT"
] | 32 | 2018-09-28T14:10:51.000Z | 2020-08-31T08:54:21.000Z | game-simulation/ctf01d-assistent.py | freehackquest/fhq-jury-ad | c839eefe98e5a6ccec6b182417f13929ebfe733a | [
"MIT"
] | 3 | 2018-09-28T14:21:41.000Z | 2019-11-02T14:14:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import docker
import sys
import os
import time
import datetime
# https://docker-py.readthedocs.io/en/latest/
client = docker.from_env()
progname = sys.argv[0]
# TODO read from data/config.yml
teams = [
{
"name": "team1",
"ip_prefix": "10.10.11"
... | 31.318396 | 115 | 0.568416 |
import docker
import sys
import os
import time
import datetime
client = docker.from_env()
progname = sys.argv[0]
teams = [
{
"name": "team1",
"ip_prefix": "10.10.11"
}, {
"name": "team2",
"ip_prefix": "10.10.12"
}, {
"name": "team3",
"ip_prefix": "10... | true | true |
f726a156e670ac369a860bc003d31ce52ead8fb6 | 9,807 | py | Python | sickbeard/lib/subliminal/services/itasa.py | Branlala/docker-sickbeardfr | 3ac85092dc4cc8a4171fb3c83e9682162245e13e | [
"MIT"
] | null | null | null | sickbeard/lib/subliminal/services/itasa.py | Branlala/docker-sickbeardfr | 3ac85092dc4cc8a4171fb3c83e9682162245e13e | [
"MIT"
] | null | null | null | sickbeard/lib/subliminal/services/itasa.py | Branlala/docker-sickbeardfr | 3ac85092dc4cc8a4171fb3c83e9682162245e13e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012 Mr_Orange <mr_orange@hotmail.it>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of the Lice... | 45.402778 | 154 | 0.593862 |
from . import ServiceBase
from ..exceptions import DownloadFailedError, ServiceError
from ..cache import cachedmethod
from ..language import language_set, Language
from ..subtitles import get_subtitle_path, ResultSubtitle, EXTENSIONS
from ..utils import get_keywords
from ..videos import Episode
from bs... | true | true |
f726a158af6f84e4cbe621f9839c0a52a862440f | 478 | py | Python | Data Science With Python/06-importing-data-in-python-(part-2)/1-importing-data-from-the-internet/parsing-html-with-beautifulsoup.py | aimanahmedmoin1997/DataCamp | c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d | [
"MIT"
] | 3 | 2019-05-12T04:49:24.000Z | 2020-05-06T00:40:28.000Z | Data Science With Python/06-importing-data-in-python-(part-2)/1-importing-data-from-the-internet/parsing-html-with-beautifulsoup.py | aimanahmedmoin1997/DataCamp | c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d | [
"MIT"
] | null | null | null | Data Science With Python/06-importing-data-in-python-(part-2)/1-importing-data-from-the-internet/parsing-html-with-beautifulsoup.py | aimanahmedmoin1997/DataCamp | c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d | [
"MIT"
] | 7 | 2018-11-06T17:43:31.000Z | 2020-11-07T21:08:16.000Z | # Import packages
import requests
from bs4 import BeautifulSoup
# Specify url: url
url = 'https://www.python.org/~guido/'
# Package the request, send the request and catch the response: r
r = requests.get(url)
# Extracts the response as html: html_doc
html_doc = r.text
# Create a BeautifulSoup object from the HTML:... | 21.727273 | 65 | 0.76569 |
import requests
from bs4 import BeautifulSoup
url = 'https://www.python.org/~guido/'
r = requests.get(url)
html_doc = r.text
soup = BeautifulSoup(html_doc)
pretty_soup = soup.prettify()
print(pretty_soup)
| true | true |
f726a169158c8afc5ef59a42f7606019f51270fd | 7,006 | py | Python | experiments/vitchyr/goal_distribution/representation_learning/exps_20_08_14/exp1_oracle_pygame_latent_reward_1ob.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/goal_distribution/representation_learning/exps_20_08_14/exp1_oracle_pygame_latent_reward_1ob.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/goal_distribution/representation_learning/exps_20_08_14/exp1_oracle_pygame_latent_reward_1ob.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import rlkit.misc.hyperparameter as hyp
from multiworld.envs.pygame import PickAndPlaceEnv
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.sets.rl_launcher import disco_experiment
if __name__ == "__main__":
variant = dict(
env_class=PickAndPlaceEnv,
env_kwargs=dict(
... | 32.137615 | 148 | 0.529403 | import rlkit.misc.hyperparameter as hyp
from multiworld.envs.pygame import PickAndPlaceEnv
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.sets.rl_launcher import disco_experiment
if __name__ == "__main__":
variant = dict(
env_class=PickAndPlaceEnv,
env_kwargs=dict(
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.