hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c181c970ae46703abaa2e80a472fc88eb65485f | 4,072 | py | Python | emailsignup/views.py | megatron0000/ces22-xadrez-web | 10032f81952e1f816925f5af9c27f235dfbf360c | [
"MIT"
] | null | null | null | emailsignup/views.py | megatron0000/ces22-xadrez-web | 10032f81952e1f816925f5af9c27f235dfbf360c | [
"MIT"
] | 8 | 2020-02-11T22:28:16.000Z | 2021-06-10T20:16:42.000Z | emailsignup/views.py | megatron0000/ces22-xadrez-web | 10032f81952e1f816925f5af9c27f235dfbf360c | [
"MIT"
] | null | null | null | """
Attribution: Simple is Better Than Complex
"""
from django.contrib.auth import login
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.auth.models import User
from django.contrib.sites.shortcuts import get_current_site
from django.shortcuts import render, redirect
from django.urls ... | 36.357143 | 95 | 0.681483 |
from django.contrib.auth import login
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.auth.models import User
from django.contrib.sites.shortcuts import get_current_site
from django.shortcuts import render, redirect
from django.urls import reverse
from django.utils.encoding import fo... | true | true |
1c181d100a8eee84a6755f35b08ee3a41dca9b60 | 1,072 | py | Python | app/api/v1/models/vote_models.py | BILLthebuilder/meetup-query | 0c2ab5b3d8c9b97518e047f2e6030eea49916371 | [
"MIT"
] | null | null | null | app/api/v1/models/vote_models.py | BILLthebuilder/meetup-query | 0c2ab5b3d8c9b97518e047f2e6030eea49916371 | [
"MIT"
] | 2 | 2019-01-09T08:19:47.000Z | 2019-01-15T03:42:32.000Z | app/api/v1/models/vote_models.py | BILLthebuilder/meetup-query | 0c2ab5b3d8c9b97518e047f2e6030eea49916371 | [
"MIT"
] | null | null | null | import datetime
VOTES = []
class Votes():
"""Map vote models and data relations"""
def __init__(self):
self.vote_records = VOTES
def find_vote(self, id):
response = None
for item in self.vote_records:
if item['meetup_id'] == id:
response = item
... | 22.808511 | 50 | 0.497201 | import datetime
VOTES = []
class Votes():
def __init__(self):
self.vote_records = VOTES
def find_vote(self, id):
response = None
for item in self.vote_records:
if item['meetup_id'] == id:
response = item
return response
def save(self, id, vo... | true | true |
1c181e93b2f04299593e4d64a4b937fc7ecb308a | 3,338 | py | Python | Chat/forms.py | IvanSapega/ChatPlatform | 5e8a0058431e7c5d8c21aa23ad73110811eb38b2 | [
"Apache-2.0"
] | null | null | null | Chat/forms.py | IvanSapega/ChatPlatform | 5e8a0058431e7c5d8c21aa23ad73110811eb38b2 | [
"Apache-2.0"
] | null | null | null | Chat/forms.py | IvanSapega/ChatPlatform | 5e8a0058431e7c5d8c21aa23ad73110811eb38b2 | [
"Apache-2.0"
] | 2 | 2019-08-19T02:35:32.000Z | 2019-08-22T19:55:13.000Z | from django import forms
import hashlib
from .models import User, Chat, AvailableUser, Message
from django.contrib.auth.forms import UserCreationForm
from django.core.exceptions import ValidationError
from django.shortcuts import redirect
class RegistrationForm(UserCreationForm):
email = forms.EmailField... | 43.921053 | 112 | 0.63571 | from django import forms
import hashlib
from .models import User, Chat, AvailableUser, Message
from django.contrib.auth.forms import UserCreationForm
from django.core.exceptions import ValidationError
from django.shortcuts import redirect
class RegistrationForm(UserCreationForm):
email = forms.EmailField... | true | true |
1c181ed40f4e355ab05f237add3d47676af8cf09 | 11,155 | py | Python | backend/env/lib/python3.8/site-packages/zmq/tests/test_future.py | lubitelpospat/CFM-source | 4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03 | [
"MIT"
] | 2 | 2021-03-04T16:57:06.000Z | 2021-08-11T01:42:29.000Z | backend/env/lib/python3.8/site-packages/zmq/tests/test_future.py | lubitelpospat/CFM-source | 4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03 | [
"MIT"
] | 1 | 2020-10-24T15:04:11.000Z | 2020-10-24T15:04:11.000Z | backend/env/lib/python3.8/site-packages/zmq/tests/test_future.py | lubitelpospat/CFM-source | 4e6af33ee68c6f2f05b6952b64a6b3f0591d5b03 | [
"MIT"
] | 1 | 2016-10-20T11:54:20.000Z | 2016-10-20T11:54:20.000Z | # coding: utf-8
# Copyright (c) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from datetime import timedelta
import os
import json
import sys
import pytest
gen = pytest.importorskip('tornado.gen')
import zmq
from zmq.eventloop import future
from tornado.ioloop import IOLoop
from zmq.uti... | 31.511299 | 82 | 0.527028 |
from datetime import timedelta
import os
import json
import sys
import pytest
gen = pytest.importorskip('tornado.gen')
import zmq
from zmq.eventloop import future
from tornado.ioloop import IOLoop
from zmq.utils.strtypes import u
from zmq.tests import BaseZMQTestCase
class TestFutureSocket(BaseZMQTestCase):
Co... | true | true |
1c181ef48fa3030d2469fe53946cd18db79b0bd0 | 187 | py | Python | data_collection/gazette/spiders/sc_orleans.py | Jefersonalves/diario-oficial | 9a4bdfe2e31414c993d88831a67160c49a5ee657 | [
"MIT"
] | 3 | 2021-08-18T17:50:31.000Z | 2021-11-12T23:36:33.000Z | data_collection/gazette/spiders/sc_orleans.py | Jefersonalves/diario-oficial | 9a4bdfe2e31414c993d88831a67160c49a5ee657 | [
"MIT"
] | 4 | 2021-02-10T02:36:48.000Z | 2022-03-02T14:55:34.000Z | data_collection/gazette/spiders/sc_orleans.py | Jefersonalves/diario-oficial | 9a4bdfe2e31414c993d88831a67160c49a5ee657 | [
"MIT"
] | null | null | null | from gazette.spiders.base import FecamGazetteSpider
class ScOrleansSpider(FecamGazetteSpider):
name = "sc_orleans"
FECAM_QUERY = "cod_entidade:179"
TERRITORY_ID = "4211702"
| 23.375 | 51 | 0.764706 | from gazette.spiders.base import FecamGazetteSpider
class ScOrleansSpider(FecamGazetteSpider):
name = "sc_orleans"
FECAM_QUERY = "cod_entidade:179"
TERRITORY_ID = "4211702"
| true | true |
1c181f5f6e42ab0de113ed8f12051ea5c0583cce | 21,308 | py | Python | manim_engine/once_useful_constructs/light.py | nmamano/sanim | b4b8603bfb86678f7448364135292cde7b02d719 | [
"MIT"
] | 1 | 2021-07-05T08:59:57.000Z | 2021-07-05T08:59:57.000Z | manim_engine/once_useful_constructs/light.py | nmamano/sanim | b4b8603bfb86678f7448364135292cde7b02d719 | [
"MIT"
] | null | null | null | manim_engine/once_useful_constructs/light.py | nmamano/sanim | b4b8603bfb86678f7448364135292cde7b02d719 | [
"MIT"
] | null | null | null | from manim_engine.constants import *
from manim_engine.mobject.geometry import AnnularSector
from manim_engine.mobject.geometry import Annulus
from manim_engine.mobject.mobject import Mobject
from manim_engine.mobject.svg.svg_mobject import SVGMobject
from manim_engine.mobject.types.vectorized_mobject import VMobject
f... | 35.161716 | 92 | 0.628496 | from manim_engine.constants import *
from manim_engine.mobject.geometry import AnnularSector
from manim_engine.mobject.geometry import Annulus
from manim_engine.mobject.mobject import Mobject
from manim_engine.mobject.svg.svg_mobject import SVGMobject
from manim_engine.mobject.types.vectorized_mobject import VMobject
f... | true | true |
1c181fc8814e6345908a3751ec8a2997cdcaf7e8 | 1,146 | py | Python | Capitulo_10/exercise10_1/exercise10_1.py | thiagosouzalink/my_codes-exercices-book-curso_intensivo_de_python | 841aa855a7450ad3d0ba65393ba0b6debcd6a770 | [
"MIT"
] | null | null | null | Capitulo_10/exercise10_1/exercise10_1.py | thiagosouzalink/my_codes-exercices-book-curso_intensivo_de_python | 841aa855a7450ad3d0ba65393ba0b6debcd6a770 | [
"MIT"
] | null | null | null | Capitulo_10/exercise10_1/exercise10_1.py | thiagosouzalink/my_codes-exercices-book-curso_intensivo_de_python | 841aa855a7450ad3d0ba65393ba0b6debcd6a770 | [
"MIT"
] | null | null | null | """
10.1 – Aprendendo Python: Abra um arquivo em branco em seu editor de texto e
escreva algumas linhas que sintetizem o que você aprendeu sobre Python até
agora. Comece cada linha com a expressão Em Python podemos.... Salve o
arquivo como learning_python.txt no mesmo diretório em que estão seus
exercícios deste capítu... | 40.928571 | 85 | 0.748691 |
filename = 'learning_python.txt'
with open(filename, encoding='UTF-8') as file_object:
lines = file_object.readlines()
for line in lines:
print(line.strip()) | true | true |
1c181fda3dadcce0ec26cbc0468891166a6b9457 | 3,075 | py | Python | eudract/main.py | PaulinCharliquart/eudract-py | 32744a591c252bb47b202b99cd86d0e1fb6e6ecb | [
"MIT"
] | 3 | 2021-06-01T10:57:26.000Z | 2021-10-20T21:53:43.000Z | eudract/main.py | PaulinCharliquart/eudract-py | 32744a591c252bb47b202b99cd86d0e1fb6e6ecb | [
"MIT"
] | null | null | null | eudract/main.py | PaulinCharliquart/eudract-py | 32744a591c252bb47b202b99cd86d0e1fb6e6ecb | [
"MIT"
] | 1 | 2021-04-12T12:00:38.000Z | 2021-04-12T12:00:38.000Z | import requests
import re
from urllib.parse import urljoin
from eudract.utils import json_handler
class Eudract:
def __init__(self):
self._BASE_URL = "https://www.clinicaltrialsregister.eu/"
self._SEARCH = urljoin(self._BASE_URL, "/ctr-search/search")
self._DOWNLOAD = urljoin(self._BASE_U... | 41.554054 | 114 | 0.481626 | import requests
import re
from urllib.parse import urljoin
from eudract.utils import json_handler
class Eudract:
def __init__(self):
self._BASE_URL = "https://www.clinicaltrialsregister.eu/"
self._SEARCH = urljoin(self._BASE_URL, "/ctr-search/search")
self._DOWNLOAD = urljoin(self._BASE_U... | true | true |
1c1821a021c5e63b53821e21c169aefb3b1a9790 | 38,184 | py | Python | src/hedera_proto/schedulable_transaction_body_pb2.py | HbarStudio/hedera-protobufs-python | f8a503d2c4c5b7c441ddf48607f7ee563b3f931a | [
"Apache-2.0"
] | null | null | null | src/hedera_proto/schedulable_transaction_body_pb2.py | HbarStudio/hedera-protobufs-python | f8a503d2c4c5b7c441ddf48607f7ee563b3f931a | [
"Apache-2.0"
] | null | null | null | src/hedera_proto/schedulable_transaction_body_pb2.py | HbarStudio/hedera-protobufs-python | f8a503d2c4c5b7c441ddf48607f7ee563b3f931a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: schedulable_transaction_body.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflectio... | 77.452333 | 4,358 | 0.82875 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
import system_delete_pb2 as system__delete__pb2
import syste... | true | true |
1c1821eea38452e1e478e0f15e4e4d2069dc271c | 1,426 | py | Python | Tweet_functions.py | conradstorz/RiverBot | 45580fc91488d2ed938d65753da78037f56218f8 | [
"Apache-2.0"
] | null | null | null | Tweet_functions.py | conradstorz/RiverBot | 45580fc91488d2ed938d65753da78037f56218f8 | [
"Apache-2.0"
] | null | null | null | Tweet_functions.py | conradstorz/RiverBot | 45580fc91488d2ed938d65753da78037f56218f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provide routines to Tweet strings to Twitter.
TODO
Create OOP implementation. example: obj/my_account methods: tweet,init,status(last tweet and time of tweet)
"""
from loguru import logger
from twython import Twython, TwythonError
PupDB_MRTkey = 'Most_Recent_Tw... | 27.960784 | 112 | 0.674614 |
from loguru import logger
from twython import Twython, TwythonError
PupDB_MRTkey = 'Most_Recent_Tweet'
@logger.catch
def store_tweet(credentials_hash, tweet):
@logger.catch
def send_tweet(tweet, TWITTER_CREDENTIALS):
a, b, c, d = TWITTER_CREDENTIALS
twitter_access = Twython(a, b, c, d)
tr... | true | true |
1c182295f9b636d3e9c92cdde1b5507638afd423 | 2,281 | py | Python | PreprocessData/all_class_files/Corporation.py | wkid-neu/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | 3 | 2021-11-06T12:29:05.000Z | 2022-03-22T12:48:55.000Z | PreprocessData/all_class_files/Corporation.py | DylanNEU/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | null | null | null | PreprocessData/all_class_files/Corporation.py | DylanNEU/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | 1 | 2021-11-06T12:29:12.000Z | 2021-11-06T12:29:12.000Z | from PreprocessData.all_class_files.Organization import Organization
import global_data
class Corporation(Organization):
def __init__(self, additionalType=None, alternateName=None, description=None, disambiguatingDescription=None, identifier=None, image=None, mainEntityOfPage=None, name=None, potentialAction... | 87.730769 | 901 | 0.758439 | from PreprocessData.all_class_files.Organization import Organization
import global_data
class Corporation(Organization):
def __init__(self, additionalType=None, alternateName=None, description=None, disambiguatingDescription=None, identifier=None, image=None, mainEntityOfPage=None, name=None, potentialAction... | true | true |
1c1822d796fa74b8a168f4f53e1b21c13663b7ae | 568 | py | Python | sdk/python/pulumi_google_native/workflows/__init__.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/workflows/__init__.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/workflows/__init__.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # 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! ***
from .. import _utilities
import typing
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_google_native.workflows.v1 as __v1
... | 31.555556 | 80 | 0.75 |
from .. import _utilities
import typing
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_google_native.workflows.v1 as __v1
v1 = __v1
import pulumi_google_native.workflows.v1beta as __v1beta
v1beta = __v1beta
else:
v1 = _utilities.lazy_import('pulumi_google_native.workflows.v1'... | true | true |
1c1824cd693d59e2f1b630209b67958405989aef | 5,336 | py | Python | plugins/helpers/download_REMS_s3.py | jsleslie/Mars_REMS_Airflow_Pipeline | 9b18f40bf21ed23baa9ea2cddfe13f9bc4932c48 | [
"Apache-2.0"
] | null | null | null | plugins/helpers/download_REMS_s3.py | jsleslie/Mars_REMS_Airflow_Pipeline | 9b18f40bf21ed23baa9ea2cddfe13f9bc4932c48 | [
"Apache-2.0"
] | 1 | 2022-01-10T22:22:06.000Z | 2022-01-10T22:22:06.000Z | plugins/helpers/download_REMS_s3.py | jsleslie/Mars_REMS_Airflow_Pipeline | 9b18f40bf21ed23baa9ea2cddfe13f9bc4932c48 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import bs4
import requests
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
# -------------------------------------------------------------------------------
# INPUTS
# output directory
outdir = "tmp"
# rename join for creating urls/paths with single backslashes
def join(*args):
... | 30.318182 | 81 | 0.543478 | import logging
import os
import bs4
import requests
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
outdir = "tmp"
def join(*args):
return "/".join(args)
baseurl = "https://atmos.nmsu.edu/PDS/data/mslrem_1001/"
dataurl = join(baseurl, "DATA")
env_cols = [
"TIMESTAMP",
"LMST",
"LTST",
... | true | true |
1c1825b65a638cbe5882ef8a409bb71d64582778 | 2,974 | py | Python | src/myauth/models.py | xistadi/BookStore | 878c27e0c53ac0434d3866e4a27ffb0e460e4363 | [
"Apache-2.0"
] | null | null | null | src/myauth/models.py | xistadi/BookStore | 878c27e0c53ac0434d3866e4a27ffb0e460e4363 | [
"Apache-2.0"
] | null | null | null | src/myauth/models.py | xistadi/BookStore | 878c27e0c53ac0434d3866e4a27ffb0e460e4363 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import Group
User = get_user_model()
class Profile(models.Model):
user = models.OneToOneField(
User,
on_d... | 22.70229 | 74 | 0.604573 | from django.db import models
from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import Group
User = get_user_model()
class Profile(models.Model):
user = models.OneToOneField(
User,
on_d... | true | true |
1c1825bfbd520f285af8f7e5e84cc02805c1fbbe | 12,833 | py | Python | rl-python/environment.py | AdrKacz/IA-Negotiation | d5f9544d2212919b9f5feb5429db4aeacb06add3 | [
"MIT"
] | 2 | 2021-10-31T01:57:18.000Z | 2022-01-21T09:53:44.000Z | rl-python/environment.py | AdrKacz/IA-Negotiation | d5f9544d2212919b9f5feb5429db4aeacb06add3 | [
"MIT"
] | null | null | null | rl-python/environment.py | AdrKacz/IA-Negotiation | d5f9544d2212919b9f5feb5429db4aeacb06add3 | [
"MIT"
] | null | null | null | from agent import Buyer, Seller
from copy import deepcopy
from math import exp
import matplotlib.pyplot as plt
class Environment():
def __init__(self):
# Training Information
self.num_cycles = int(5e1)
self.num_episodes = int(1e2)
self.num_episodes_testing = int(1e3)
# Com... | 43.64966 | 186 | 0.595886 | from agent import Buyer, Seller
from copy import deepcopy
from math import exp
import matplotlib.pyplot as plt
class Environment():
def __init__(self):
self.num_cycles = int(5e1)
self.num_episodes = int(1e2)
self.num_episodes_testing = int(1e3)
self.price_space_siz... | true | true |
1c18263add79cfb1dcae371ecad93b1a2af55b97 | 9,787 | py | Python | pyamg/gallery/elasticity.py | nschloe/pyamg | 005a71754015f050ac3d39241365cbfa4998c374 | [
"MIT"
] | null | null | null | pyamg/gallery/elasticity.py | nschloe/pyamg | 005a71754015f050ac3d39241365cbfa4998c374 | [
"MIT"
] | null | null | null | pyamg/gallery/elasticity.py | nschloe/pyamg | 005a71754015f050ac3d39241365cbfa4998c374 | [
"MIT"
] | 2 | 2022-01-03T00:20:22.000Z | 2022-03-01T12:02:54.000Z | """Constructs linear elasticity problems for first-order elements in 2D and 3D."""
# pylint: disable=redefined-builtin
import numpy as np
import scipy.linalg as sla
from scipy import sparse
def linear_elasticity(grid, spacing=None, E=1e5, nu=0.3, format=None):
"""Linear elasticity problem with Q1 finite elements... | 27.962857 | 87 | 0.493512 |
import numpy as np
import scipy.linalg as sla
from scipy import sparse
def linear_elasticity(grid, spacing=None, E=1e5, nu=0.3, format=None):
if len(grid) == 2:
return q12d(grid, spacing=spacing, E=E, nu=nu, format=format)
raise NotImplementedError('No support for grid={grid}')
def q12d(grid, spac... | true | true |
1c182687628a1073cdef2983dc15d5353e73aa5b | 1,111 | py | Python | pbgpp/BGP/Update/PathAttributes/TrafficEngineering.py | antoine-blin/pbgp-parser | 592e26a9066e64cc11ec4812c050fcf5eeab2c3f | [
"Apache-2.0"
] | 73 | 2016-10-27T10:12:42.000Z | 2020-10-08T09:17:40.000Z | pbgpp/BGP/Update/PathAttributes/TrafficEngineering.py | antoine-blin/pbgp-parser | 592e26a9066e64cc11ec4812c050fcf5eeab2c3f | [
"Apache-2.0"
] | 26 | 2016-10-29T12:26:27.000Z | 2020-10-26T09:27:43.000Z | pbgpp/BGP/Update/PathAttributes/TrafficEngineering.py | antoine-blin/pbgp-parser | 592e26a9066e64cc11ec4812c050fcf5eeab2c3f | [
"Apache-2.0"
] | 18 | 2016-10-27T10:12:20.000Z | 2020-07-27T09:11:07.000Z | #
# This file is part of PCAP BGP Parser (pbgpp)
#
# Copyright 2016-2017 DE-CIX Management GmbH
# Author: Tobias Hannaske <tobias.hannaske@de-cix.net>
#
# 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 Lic... | 32.676471 | 74 | 0.748875 |
from pbgpp.BGP.Statics import BGPStatics
from pbgpp.BGP.Update.PathAttribute import BGPPathAttribute
class PathAttributeTrafficEngineering(BGPPathAttribute):
def __init__(self, payload):
BGPPathAttribute.__init__(self, payload)
self.type = BGPStatics.UPDATE_ATTRIBUTE_TRAFFIC_ENGINEERING
... | true | true |
1c18271ac22216f6fa87af956c84253147c864cc | 2,179 | py | Python | src/fhir_types/FHIR_CatalogEntry_RelatedEntry.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | 2 | 2022-02-03T00:51:30.000Z | 2022-02-03T18:42:43.000Z | src/fhir_types/FHIR_CatalogEntry_RelatedEntry.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | null | null | null | src/fhir_types/FHIR_CatalogEntry_RelatedEntry.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | null | null | null | from typing import Any, List, Literal, TypedDict
from .FHIR_Element import FHIR_Element
from .FHIR_Reference import FHIR_Reference
from .FHIR_string import FHIR_string
# Catalog entries are wrappers that contextualize items included in a catalog.
FHIR_CatalogEntry_RelatedEntry = TypedDict(
"FHIR_CatalogEntry_Rela... | 83.807692 | 836 | 0.767324 | from typing import Any, List, Literal, TypedDict
from .FHIR_Element import FHIR_Element
from .FHIR_Reference import FHIR_Reference
from .FHIR_string import FHIR_string
FHIR_CatalogEntry_RelatedEntry = TypedDict(
"FHIR_CatalogEntry_RelatedEntry",
{
"id": FHIR_string,
"extension"... | true | true |
1c182731c78e6d7221e33759da81b70b0c7016f5 | 145,058 | py | Python | python/mxnet/ndarray/ndarray.py | daveliepmann/incubator-mxnet | 0d7794730ad0272e52a62d1101ccbe9fcf1aafcb | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/ndarray.py | daveliepmann/incubator-mxnet | 0d7794730ad0272e52a62d1101ccbe9fcf1aafcb | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/ndarray.py | daveliepmann/incubator-mxnet | 0d7794730ad0272e52a62d1101ccbe9fcf1aafcb | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.971429 | 151 | 0.563133 |
from __future__ import absolute_import
from __future__ import division
try:
from __builtin__ import slice as py_slice
except ImportError:
from builtins import slice as py_slice
from array import array as native_array
import ctypes
import warnings
import operator
from functools import reduce import numpy as n... | true | true |
1c1828268873fc514cd4b22cf6b69195c32e5cc9 | 60,206 | py | Python | torchvision/transforms/transforms.py | sasha-scale/vision | 2ab08289cfaca8c006ade977deeefa53cc231890 | [
"BSD-3-Clause"
] | 1 | 2020-10-23T13:13:48.000Z | 2020-10-23T13:13:48.000Z | torchvision/transforms/transforms.py | sasha-scale/vision | 2ab08289cfaca8c006ade977deeefa53cc231890 | [
"BSD-3-Clause"
] | null | null | null | torchvision/transforms/transforms.py | sasha-scale/vision | 2ab08289cfaca8c006ade977deeefa53cc231890 | [
"BSD-3-Clause"
] | null | null | null | import math
import numbers
import random
import warnings
from collections.abc import Sequence
from typing import Tuple, List, Optional
import torch
from PIL import Image
from torch import Tensor
try:
import accimage
except ImportError:
accimage = None
from . import functional as F
__all__ = ["Compose", "To... | 40.137333 | 119 | 0.609225 | import math
import numbers
import random
import warnings
from collections.abc import Sequence
from typing import Tuple, List, Optional
import torch
from PIL import Image
from torch import Tensor
try:
import accimage
except ImportError:
accimage = None
from . import functional as F
__all__ = ["Compose", "To... | true | true |
1c182a4b0151b3fce8b8b5e68c9036ea83347a42 | 3,131 | py | Python | DjangoProject/rutvik2611_django/rutvik2611_django/settings.py | rutvik2611/hw | 69a725cbfa2d9bd996029cc7b2a2f7d07978941a | [
"MIT"
] | null | null | null | DjangoProject/rutvik2611_django/rutvik2611_django/settings.py | rutvik2611/hw | 69a725cbfa2d9bd996029cc7b2a2f7d07978941a | [
"MIT"
] | null | null | null | DjangoProject/rutvik2611_django/rutvik2611_django/settings.py | rutvik2611/hw | 69a725cbfa2d9bd996029cc7b2a2f7d07978941a | [
"MIT"
] | null | null | null | """
Django settings for rutvik2611_django project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impo... | 25.663934 | 91 | 0.699457 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '#vtik0uek4oiy)%t#0t2swv93rd0gsr0$e4q6&q+jb9l#_mbku'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
1c182af72adc7ce876f2ac93b5120767dd2c3998 | 1,258 | py | Python | neighborhood/urls.py | apwao/neighborhood | b71028fb0e312a57776b8485c7bf8e43b8f6c5d5 | [
"Unlicense",
"MIT"
] | null | null | null | neighborhood/urls.py | apwao/neighborhood | b71028fb0e312a57776b8485c7bf8e43b8f6c5d5 | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T22:06:38.000Z | 2021-09-08T01:07:31.000Z | neighborhood/urls.py | apwao/neighborhood | b71028fb0e312a57776b8485c7bf8e43b8f6c5d5 | [
"Unlicense",
"MIT"
] | null | null | null | """neighborhood URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | 37 | 80 | 0.718601 | from django.conf.urls import url,include
from django.contrib import admin
from django.contrib.auth import views
from rest_framework.authtoken.views import obtain_auth_token
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^acco... | true | true |
1c182afe5cf48f26f97dc57cd1b3b2dfb2b89909 | 4,798 | py | Python | tests/conftest.py | getslash/gossip | 05a06289bd82cda57bf0c9a29a33819a522afe17 | [
"BSD-3-Clause"
] | 23 | 2016-03-07T09:28:23.000Z | 2021-06-16T12:47:22.000Z | tests/conftest.py | getslash/gossip | 05a06289bd82cda57bf0c9a29a33819a522afe17 | [
"BSD-3-Clause"
] | 31 | 2016-04-06T08:45:19.000Z | 2020-01-27T12:00:45.000Z | tests/conftest.py | getslash/gossip | 05a06289bd82cda57bf0c9a29a33819a522afe17 | [
"BSD-3-Clause"
] | 5 | 2016-05-22T15:24:29.000Z | 2019-08-18T10:58:15.000Z | import itertools
from uuid import uuid4
import logbook
import gossip
import gossip.hooks
import pytest
hook_id = itertools.count()
@pytest.fixture(autouse=True, scope='session')
def setup_logging():
logbook.StderrHandler().push_application()
logbook.Flags(errors='raise').push_application()
@pytest.fixture(... | 21.612613 | 90 | 0.626719 | import itertools
from uuid import uuid4
import logbook
import gossip
import gossip.hooks
import pytest
hook_id = itertools.count()
@pytest.fixture(autouse=True, scope='session')
def setup_logging():
logbook.StderrHandler().push_application()
logbook.Flags(errors='raise').push_application()
@pytest.fixture(... | true | true |
1c182b357c6359df2f3804ee49f7d6bb0734ecc4 | 10,428 | py | Python | lib/Crypto/SelfTest/Hash/common.py | schlenk/pycryptodome | 80d6becc5c203d5663776d6814253fe87d4e044d | [
"Unlicense"
] | null | null | null | lib/Crypto/SelfTest/Hash/common.py | schlenk/pycryptodome | 80d6becc5c203d5663776d6814253fe87d4e044d | [
"Unlicense"
] | null | null | null | lib/Crypto/SelfTest/Hash/common.py | schlenk/pycryptodome | 80d6becc5c203d5663776d6814253fe87d4e044d | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | 34.302632 | 109 | 0.611239 |
import sys
import unittest
import binascii
import Crypto.Hash
from Crypto.Util.py3compat import b, tobytes
from Crypto.Util.strxor import strxor_c
class HashDigestSizeSelfTest(unittest.TestCase):
def __init__(self, hashmod, description, expected, extra_params):
unittest.TestCase.__init__(self)
s... | true | true |
1c182bbc793449922d544578fed2156036c294fb | 285 | py | Python | setup.py | will-i-amv/stock-analysis | 6c91936fe54bc3c5ad971c09e9f4af4f4419b3a7 | [
"MIT"
] | null | null | null | setup.py | will-i-amv/stock-analysis | 6c91936fe54bc3c5ad971c09e9f4af4f4419b3a7 | [
"MIT"
] | null | null | null | setup.py | will-i-amv/stock-analysis | 6c91936fe54bc3c5ad971c09e9f4af4f4419b3a7 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='stock_analysis',
version='0.2',
description='Classes for technical analysis of stocks.',
author='William Vera',
license='MIT',
url='https://github.com/will-i-amv/stock-analysis',
packages=['stock_analysis'],
)
| 23.75 | 60 | 0.677193 | from distutils.core import setup
setup(
name='stock_analysis',
version='0.2',
description='Classes for technical analysis of stocks.',
author='William Vera',
license='MIT',
url='https://github.com/will-i-amv/stock-analysis',
packages=['stock_analysis'],
)
| true | true |
1c182c14807eef033f85aa026582227f3d1090e7 | 1,564 | py | Python | zipfelchappe/emails.py | feinheit/zipfelchappe | 1bbe56c910d2f33a047f8215ed432aac2988b70e | [
"BSD-3-Clause"
] | 25 | 2015-05-17T22:13:37.000Z | 2021-05-31T17:17:57.000Z | zipfelchappe/emails.py | feinheit/zipfelchappe | 1bbe56c910d2f33a047f8215ed432aac2988b70e | [
"BSD-3-Clause"
] | 16 | 2015-03-12T09:19:27.000Z | 2020-11-23T08:41:37.000Z | zipfelchappe/emails.py | feinheit/zipfelchappe | 1bbe56c910d2f33a047f8215ed432aac2988b70e | [
"BSD-3-Clause"
] | 5 | 2015-04-27T15:17:53.000Z | 2020-08-11T10:38:40.000Z | from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.template import Context, Template
from django.template.loader import render_to_string
from .models import MailTemplate
def render_mail(template, context):
""" helper to ... | 36.372093 | 79 | 0.702046 | from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.template import Context, Template
from django.template.loader import render_to_string
from .models import MailTemplate
def render_mail(template, context):
subject = rend... | true | true |
1c182cb590a00afa8c4e5e1d827a003f6f7467de | 652 | py | Python | tools/xstore/cli/root.py | dingfeng/galaxykube | f5ea5cf40c957358e2bc5b14eabc9dea2ec93ad2 | [
"Apache-2.0"
] | 29 | 2021-10-16T06:01:53.000Z | 2022-03-31T02:37:30.000Z | tools/xstore/cli/root.py | dingfeng/galaxykube | f5ea5cf40c957358e2bc5b14eabc9dea2ec93ad2 | [
"Apache-2.0"
] | null | null | null | tools/xstore/cli/root.py | dingfeng/galaxykube | f5ea5cf40c957358e2bc5b14eabc9dea2ec93ad2 | [
"Apache-2.0"
] | 11 | 2021-10-18T02:26:32.000Z | 2022-01-11T12:06:03.000Z | # Copyright 2021 Alibaba Group Holding 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 agr... | 31.047619 | 74 | 0.756135 |
import click
@click.group()
def root_group():
pass
| true | true |
1c182d5aae80335cbf4f5b39522e6396ea7eaa70 | 1,835 | py | Python | TDMS/Preprocess.py | GW-Wang-thu/ORB-based-displacement-monitoring-system | 6dfc12487dbc27af5eb5a0ef72aa3958891c192e | [
"MIT"
] | 1 | 2022-03-01T14:48:24.000Z | 2022-03-01T14:48:24.000Z | TDMS/Preprocess.py | GW-Wang-thu/ORB-based-displacement-monitoring-system | 6dfc12487dbc27af5eb5a0ef72aa3958891c192e | [
"MIT"
] | 1 | 2021-03-03T02:34:07.000Z | 2021-03-05T03:28:25.000Z | TDMS/Preprocess.py | GW-Wang-thu/ORB-based-displacement-monitoring-system | 6dfc12487dbc27af5eb5a0ef72aa3958891c192e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import torch
from utils import VDSR, RealSR
class Processor:
def __init__(self, imsize=(3072, 2048)):
self.imsize = imsize
def denoise(self, img, method="Gaussian", ksize=3):
if method == "Gaussian":
out_img = cv2.GaussianBlur(img, ksize... | 32.192982 | 79 | 0.505722 | import cv2
import numpy as np
import torch
from utils import VDSR, RealSR
class Processor:
def __init__(self, imsize=(3072, 2048)):
self.imsize = imsize
def denoise(self, img, method="Gaussian", ksize=3):
if method == "Gaussian":
out_img = cv2.GaussianBlur(img, ksize... | true | true |
1c182e467085dc21d26484f786404b61e82d6de6 | 1,273 | py | Python | poetry/utils/pip.py | charlax/poetry | 931cf120c80d1400cd5b9933db7cf078ab3718f4 | [
"MIT"
] | null | null | null | poetry/utils/pip.py | charlax/poetry | 931cf120c80d1400cd5b9933db7cf078ab3718f4 | [
"MIT"
] | null | null | null | poetry/utils/pip.py | charlax/poetry | 931cf120c80d1400cd5b9933db7cf078ab3718f4 | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Union
from poetry.exceptions import PoetryException
from poetry.utils.env import Env
from poetry.utils.env import ephemeral_environment
def pip_install(
path: Union[Path, str],
environment: Env,
editable: bool = False,
deps: bool = False,
upgrade: bool ... | 24.960784 | 88 | 0.631579 | from pathlib import Path
from typing import Union
from poetry.exceptions import PoetryException
from poetry.utils.env import Env
from poetry.utils.env import ephemeral_environment
def pip_install(
path: Union[Path, str],
environment: Env,
editable: bool = False,
deps: bool = False,
upgrade: bool ... | true | true |
1c182f07b91b98cb9694a0644ba929c1814a9937 | 765 | py | Python | hackerrank/interview/sock_merchant.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | hackerrank/interview/sock_merchant.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | hackerrank/interview/sock_merchant.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | 1 | 2018-11-21T05:14:07.000Z | 2018-11-21T05:14:07.000Z | '''
Author: ZHAO Zinan
Created: 01/18/2019
https://www.hackerrank.com/challenges/sock-merchant/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=warmup
'''
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the sockMerchant func... | 21.25 | 149 | 0.64183 |
import math
import os
import random
import re
import sys
def sockMerchant(n, ar):
result = 0
import collections
cnt = collections.Counter(ar)
for key, item in cnt.items():
result += item//2
return result
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'],... | true | true |
1c182f5e70b4140fbbc092be8050ac4f83fadf35 | 522 | py | Python | promgen/migrations/0025_shard_url.py | kfdm/promgen | 2fdff588fbee7cc74fdffec35f18c64e8ec420e6 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | promgen/migrations/0025_shard_url.py | kfdm/promgen | 2fdff588fbee7cc74fdffec35f18c64e8ec420e6 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | promgen/migrations/0025_shard_url.py | kfdm/promgen | 2fdff588fbee7cc74fdffec35f18c64e8ec420e6 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-02 00:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('promgen', '0024_auto_20170220_0324'),
]
operations = [
migrations.AddField(... | 23.727273 | 91 | 0.62069 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('promgen', '0024_auto_20170220_0324'),
]
operations = [
migrations.AddField(
model_name='shard',
name='url',
fiel... | true | true |
1c182f842192504dbaa60e46085c25810b0a97fb | 5,754 | py | Python | tests/manage/cluster/nodes/test_az_failure.py | gklein/ocs-ci-docs | 5db413e48f3d5a7f34ed230751c50731561d8868 | [
"MIT"
] | null | null | null | tests/manage/cluster/nodes/test_az_failure.py | gklein/ocs-ci-docs | 5db413e48f3d5a7f34ed230751c50731561d8868 | [
"MIT"
] | null | null | null | tests/manage/cluster/nodes/test_az_failure.py | gklein/ocs-ci-docs | 5db413e48f3d5a7f34ed230751c50731561d8868 | [
"MIT"
] | null | null | null | import logging
import random
import pytest
from ocs_ci.framework.pytest_customization.marks import aws_platform_required
from ocs_ci.framework.testlib import ManageTest, tier4, bugzilla
from ocs_ci.ocs.exceptions import CommandFailed
from tests import sanity_helpers
logger = logging.getLogger(__name__)
@tier4
@pyt... | 36.884615 | 96 | 0.676573 | import logging
import random
import pytest
from ocs_ci.framework.pytest_customization.marks import aws_platform_required
from ocs_ci.framework.testlib import ManageTest, tier4, bugzilla
from ocs_ci.ocs.exceptions import CommandFailed
from tests import sanity_helpers
logger = logging.getLogger(__name__)
@tier4
@pyt... | true | true |
1c182fb13c76722b0496df0a600b2677e4dd4b0f | 4,930 | py | Python | gros/api_server/standardization_module.py | GRB-ResearchLab/GROS | d6096d49ac5f1ebc843fb157b3fa17027a1aca64 | [
"Apache-2.0"
] | 13 | 2019-12-11T03:54:38.000Z | 2019-12-13T05:54:01.000Z | gros/api_server/standardization_module.py | GRB-ResearchLab/GROS | d6096d49ac5f1ebc843fb157b3fa17027a1aca64 | [
"Apache-2.0"
] | null | null | null | gros/api_server/standardization_module.py | GRB-ResearchLab/GROS | d6096d49ac5f1ebc843fb157b3fa17027a1aca64 | [
"Apache-2.0"
] | 1 | 2019-12-12T02:58:42.000Z | 2019-12-12T02:58:42.000Z | import os
import mmcv
all_dir_lsit = []
# 搜索代码中所有的函数名以及类名
def _search_function_class(script):
func_list, class_list = [], []
for line in script:
lstrip = line.lstrip()
if lstrip.startswith('if __name__ == "__main__"'):
break
if lstrip.startswith('def '):
args... | 32.866667 | 108 | 0.575862 | import os
import mmcv
all_dir_lsit = []
def _search_function_class(script):
func_list, class_list = [], []
for line in script:
lstrip = line.lstrip()
if lstrip.startswith('if __name__ == "__main__"'):
break
if lstrip.startswith('def '):
args = lstrip.split('(... | true | true |
1c182fe8e345267f6e0cbd0ae129eea678766f9b | 692 | py | Python | src/configupdater/__init__.py | pyscaffold/configupdater | 3f80d4c943fb7c23d5b320e03e2953eeb38dd0d3 | [
"MIT"
] | 44 | 2018-06-18T11:16:04.000Z | 2022-03-03T22:17:36.000Z | src/configupdater/__init__.py | pyscaffold/configupdater | 3f80d4c943fb7c23d5b320e03e2953eeb38dd0d3 | [
"MIT"
] | 71 | 2018-08-03T13:16:52.000Z | 2022-02-24T16:17:32.000Z | src/configupdater/__init__.py | pyscaffold/configupdater | 3f80d4c943fb7c23d5b320e03e2953eeb38dd0d3 | [
"MIT"
] | 7 | 2019-01-03T10:02:40.000Z | 2021-05-15T11:02:50.000Z | import sys
if sys.version_info[:2] >= (3, 8): # pragma: no cover
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
from importlib.metadata import PackageNotFoundError, version
else: # pragma: no cover
from importlib_metadata import PackageNotFoundError, version
try:
#... | 32.952381 | 85 | 0.735549 | import sys
if sys.version_info[:2] >= (3, 8): from importlib.metadata import PackageNotFoundError, version
else: from importlib_metadata import PackageNotFoundError, version
try:
dist_name = "ConfigUpdater"
__version__ = version(dist_name)
except PackageNotFoundError: __version__ = "unk... | true | true |
1c182ffd9d3378b4641c64c64d95b5903013cd08 | 724 | py | Python | tests/unit/modules/test_sensors.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 3 | 2015-08-30T04:23:47.000Z | 2018-07-15T00:35:23.000Z | tests/unit/modules/test_sensors.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 4 | 2016-05-10T22:05:34.000Z | 2016-05-20T18:10:13.000Z | tests/unit/modules/test_sensors.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2019-12-17T13:37:16.000Z | 2019-12-17T13:37:16.000Z | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import salt.modules.sensors as sensors
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class SensorTestCase(TestCase, LoaderModuleMockMixin):
"""
Test ... | 26.814815 | 84 | 0.651934 |
import salt.modules.sensors as sensors
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class SensorTestCase(TestCase, LoaderModuleMockMixin):
def setup_loader_modules(self):
return {sensors: {}}
def test_... | true | true |
1c1830061ddb4efec2cad7dc9b56475b7e673777 | 94,130 | py | Python | scripts/dts/edtlib.py | tomaszkob89/sdk-zephyr | a9423cbce69a5df78140a2cf3ba11aa56d395cfc | [
"Apache-2.0"
] | 1 | 2020-03-12T13:18:08.000Z | 2020-03-12T13:18:08.000Z | scripts/dts/edtlib.py | tomaszkob89/sdk-zephyr | a9423cbce69a5df78140a2cf3ba11aa56d395cfc | [
"Apache-2.0"
] | 4 | 2022-03-10T10:11:21.000Z | 2022-03-21T11:41:17.000Z | scripts/dts/edtlib.py | tomaszkob89/sdk-zephyr | a9423cbce69a5df78140a2cf3ba11aa56d395cfc | [
"Apache-2.0"
] | 4 | 2019-11-26T16:15:55.000Z | 2022-01-19T08:47:50.000Z | # Copyright (c) 2019 Nordic Semiconductor ASA
# Copyright (c) 2019 Linaro Limited
# SPDX-License-Identifier: BSD-3-Clause
# Tip: You can view just the documentation with 'pydoc3 edtlib'
"""
Library for working with devicetrees at a higher level compared to dtlib. Like
dtlib, this library presents a tree of devicetree... | 35.614832 | 103 | 0.603729 |
# functions look like attributes, which is less awkward in clients, and makes
# it easy to switch back and forth between variables and functions.
#
# - Think about the data type of the thing you're exposing. Exposing something
#
# - Add documentation for any new APIs you add.
#
# The convention here is that d... | true | true |
1c183095826a029e53cd93425eadb74a4e557485 | 14,046 | py | Python | sdk/boost_1_30_0/libs/python/pyste/src/GCCXMLParser.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | 2 | 2020-01-30T12:51:49.000Z | 2020-08-31T08:36:49.000Z | sdk/boost_1_30_0/libs/python/pyste/src/GCCXMLParser.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | sdk/boost_1_30_0/libs/python/pyste/src/GCCXMLParser.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | from declarations import *
from elementtree.ElementTree import ElementTree
from xml.parsers.expat import ExpatError
from copy import deepcopy
class InvalidXMLError(Exception): pass
class ParserError(Exception): pass
class InvalidContextError(ParserError): pass
class GCCXMLParser(object):
'Parse ... | 34.767327 | 86 | 0.555461 | from declarations import *
from elementtree.ElementTree import ElementTree
from xml.parsers.expat import ExpatError
from copy import deepcopy
class InvalidXMLError(Exception): pass
class ParserError(Exception): pass
class InvalidContextError(ParserError): pass
class GCCXMLParser(object):
'Parse ... | false | true |
1c1830e85b99fcf4b619a01bf3e98726c486a2dc | 396 | py | Python | main.py | tmattoneill/flask_project_template | 90c75f6769b0b09d608997ca62c598675cc7a3b4 | [
"MIT"
] | null | null | null | main.py | tmattoneill/flask_project_template | 90c75f6769b0b09d608997ca62c598675cc7a3b4 | [
"MIT"
] | 1 | 2021-06-02T00:01:17.000Z | 2021-06-02T00:01:17.000Z | main.py | tmattoneill/flask_project_template | 90c75f6769b0b09d608997ca62c598675cc7a3b4 | [
"MIT"
] | null | null | null | import os
from app import create_app
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
print("Running FLASK_APP: {}".format(os.getenv('FLASK_APP') or __file__))
@app.shell_context_processor
def make_shell_context():
return None
if __name__ == '__main__':
app.run(debug=True,
use_debugger=... | 22 | 73 | 0.689394 | import os
from app import create_app
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
print("Running FLASK_APP: {}".format(os.getenv('FLASK_APP') or __file__))
@app.shell_context_processor
def make_shell_context():
return None
if __name__ == '__main__':
app.run(debug=True,
use_debugger=... | true | true |
1c1830ecf801521e7a098ca421cd107c5e99d04e | 2,386 | py | Python | demoV3/build/lib/controller/demo.py | jimmydong/YEPY2 | bb626c7fbf0e2835959e2b8b8be989180331857c | [
"MIT"
] | null | null | null | demoV3/build/lib/controller/demo.py | jimmydong/YEPY2 | bb626c7fbf0e2835959e2b8b8be989180331857c | [
"MIT"
] | null | null | null | demoV3/build/lib/controller/demo.py | jimmydong/YEPY2 | bb626c7fbf0e2835959e2b8b8be989180331857c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
这是一个子模块的Demo
每一个Blueprint相当于一个controller
开发指导:
1,修改或添加route规则(如果需要的话)
2,开发处理逻辑(建议按照“add your code here”)
3,修改config.py,将controller名字加入到blueprints列表中
"""
from flask import Blueprint, render_template, abort, request, current_app, make_response
from . import *
import bucket
import config
... | 32.684932 | 88 | 0.458927 | from flask import Blueprint, render_template, abort, request, current_app, make_response
from . import *
import bucket
import config
import os
import time
controller = os.path.basename(__file__).split('.',1)[0]
blueprint = Blueprint(controller, __name__, url_prefix='/%s' % controller)
@blueprint.route('/', defaults={... | true | true |
1c1831f3c9f23655a71d1d3cebee40272c180d90 | 4,240 | py | Python | src/qfadd_distribution.py | Luger-Lab/Q-FADD | 5407178513837fd1804397bba0708e6300c21626 | [
"MIT"
] | 1 | 2021-03-18T08:39:50.000Z | 2021-03-18T08:39:50.000Z | src/qfadd_distribution.py | Luger-Lab/Q-FADD | 5407178513837fd1804397bba0708e6300c21626 | [
"MIT"
] | null | null | null | src/qfadd_distribution.py | Luger-Lab/Q-FADD | 5407178513837fd1804397bba0708e6300c21626 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import argparse
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
from scipy.stats import t
#define p-value function
def ttest(avg1,sem1,n1,avg2,sem2,n2):
sed = np.sqrt(np.power(sem1,2) + np.power(sem2,2))
t_stat = np.divide(np.subtract(avg1,avg2)... | 38.198198 | 197 | 0.634434 |
import numpy as np
import argparse
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
from scipy.stats import t
def ttest(avg1,sem1,n1,avg2,sem2,n2):
sed = np.sqrt(np.power(sem1,2) + np.power(sem2,2))
t_stat = np.divide(np.subtract(avg1,avg2),sed)
df = n1+n2 - 2
p = (1.0 - t.cdf(n... | true | true |
1c1831fa4a3752a1ac8343bc8d224a09d61bcede | 12,816 | py | Python | gclient_eval.py | zeph1912/milkomeda_depot_tools | 1d45988608a461456f98a417b424a2a7c638ade2 | [
"BSD-3-Clause"
] | null | null | null | gclient_eval.py | zeph1912/milkomeda_depot_tools | 1d45988608a461456f98a417b424a2a7c638ade2 | [
"BSD-3-Clause"
] | null | null | null | gclient_eval.py | zeph1912/milkomeda_depot_tools | 1d45988608a461456f98a417b424a2a7c638ade2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import collections
from third_party import schema
# See https://github.com/keleshev/schema for docs how to configure schema.
_GCLIENT_DEPS_SCHE... | 37.694118 | 80 | 0.633583 |
import ast
import collections
from third_party import schema
_GCLIENT_DEPS_SCHEMA = {
schema.Optional(basestring): schema.Or(
None,
basestring,
{
'url': basestring,
schema.Optional('condition'): basestring,
... | true | true |
1c1832f893aa29e7af8c884831976850a47528f1 | 1,339 | py | Python | tests/test_parser_spf.py | MozaicWorks/DMARCReporting | 3d2a4b79ea55f9631bc661c2c3cf9acb4dc36e52 | [
"MIT"
] | 3 | 2021-11-09T12:47:36.000Z | 2022-01-03T13:25:41.000Z | tests/test_parser_spf.py | MozaicWorks/DMARCReporting | 3d2a4b79ea55f9631bc661c2c3cf9acb4dc36e52 | [
"MIT"
] | 8 | 2021-11-09T13:38:14.000Z | 2022-02-07T16:34:06.000Z | tests/test_parser_spf.py | MozaicWorks/DMARCReporting | 3d2a4b79ea55f9631bc661c2c3cf9acb4dc36e52 | [
"MIT"
] | null | null | null | import io
import pytest
from .context import DMARCReporting # noqa F401
from DMARCReporting.parser import DMARCRuaParser
@pytest.fixture
def not_authenticated():
return io.StringIO(
"""
<feedback>
<record>
<row>
<source_ip>201.81.220.40</source_ip>
... | 26.78 | 111 | 0.501867 | import io
import pytest
from .context import DMARCReporting from DMARCReporting.parser import DMARCRuaParser
@pytest.fixture
def not_authenticated():
return io.StringIO(
"""
<feedback>
<record>
<row>
<source_ip>201.81.220.40</source_ip>
... | true | true |
1c183494ca7b8373053f9fb8e384bce67aefc885 | 3,310 | py | Python | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_multi_out_stateless.py | AnomalyInc/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | 2 | 2017-04-27T11:04:27.000Z | 2019-02-07T21:03:32.000Z | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_multi_out_stateless.py | StreamPy/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | null | null | null | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_multi_out_stateless.py | StreamPy/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | null | null | null | """This module contains examples of stream_func where f_type
is 'element' and stream_func has a list of multiple input streams,
a single output stream, and the operation is stateless. These
examples must have a LIST of input streams and not a single
input stream.
The functions on static Python data structures are of t... | 29.035088 | 77 | 0.651964 | """This module contains examples of stream_func where f_type
is 'element' and stream_func has a list of multiple input streams,
a single output stream, and the operation is stateless. These
examples must have a LIST of input streams and not a single
input stream.
The functions on static Python data structures are of t... | false | true |
1c1836c27aa80297be8f48b2ff58360ea3fdd565 | 939 | py | Python | NeighborlyAPI/deleteAdvertisement/__init__.py | saidulislam/cloud-developer-microsoft-azure | d7b1cff3960088f54b5ce7d2a9256f861ccf23c8 | [
"Apache-2.0"
] | null | null | null | NeighborlyAPI/deleteAdvertisement/__init__.py | saidulislam/cloud-developer-microsoft-azure | d7b1cff3960088f54b5ce7d2a9256f861ccf23c8 | [
"Apache-2.0"
] | null | null | null | NeighborlyAPI/deleteAdvertisement/__init__.py | saidulislam/cloud-developer-microsoft-azure | d7b1cff3960088f54b5ce7d2a9256f861ccf23c8 | [
"Apache-2.0"
] | null | null | null | import logging
import azure.functions as func
import pymongo
import os
from bson.objectid import ObjectId
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger deleteAdvertisement function processed a request.')
id = req.params.get('id')
if id:
... | 31.3 | 90 | 0.616613 | import logging
import azure.functions as func
import pymongo
import os
from bson.objectid import ObjectId
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger deleteAdvertisement function processed a request.')
id = req.params.get('id')
if id:
... | true | true |
1c1836dbe70c6dae959326097f31126eb8aa6981 | 9,918 | py | Python | tests/test_config.py | dj-khandelwal/lux | 9ade6dde756e55a1f281a82f8091b71ee051f8af | [
"Apache-2.0"
] | null | null | null | tests/test_config.py | dj-khandelwal/lux | 9ade6dde756e55a1f281a82f8091b71ee051f8af | [
"Apache-2.0"
] | null | null | null | tests/test_config.py | dj-khandelwal/lux | 9ade6dde756e55a1f281a82f8091b71ee051f8af | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 The Lux Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 32.201299 | 130 | 0.680682 |
from .context import lux
import pytest
import pandas as pd
import time
from lux.vis.VisList import VisList
import lux
def register_new_action(validator: bool = True):
df = pd.read_csv("lux/data/car.csv")
def random_categorical(ldf):
intent = [lux.Clause("?", data_type="nominal")]
vlist = Vis... | true | true |
1c18376b4f7556b69a7851dafe2dbf4e4f04d3a1 | 3,655 | py | Python | spkwifi.py | utitankaspk/SPKClient | 8ac6fd9648d8d67a520bb50e39784c854d828524 | [
"Apache-2.0"
] | 1 | 2016-12-24T03:07:24.000Z | 2016-12-24T03:07:24.000Z | spkwifi.py | spkdevelop/SPKClient | 8ac6fd9648d8d67a520bb50e39784c854d828524 | [
"Apache-2.0"
] | null | null | null | spkwifi.py | spkdevelop/SPKClient | 8ac6fd9648d8d67a520bb50e39784c854d828524 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015 Daniel Fernández (daniel@spkautomatizacion.com), Saúl Pilatowsky (saul@spkautomatizacion.com)
#
# 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 ... | 29.24 | 111 | 0.631737 | import wifi
import os
import socket
import fcntl
import struct
import subprocess
from wifi.exceptions import InterfaceError
default_network_file ="""\
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
"""
WLAN = "wlan0"
extra_name = "-False"
INTERFACES_FILE = "/etc/network/interfaces... | true | true |
1c1837cfac56861bef56b6c927cf7467ee964b82 | 17,964 | py | Python | tools/SDKTool/src/ui/tree/scene_tree/scene_node.py | Passer-D/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 1,210 | 2020-08-18T07:57:36.000Z | 2022-03-31T15:06:05.000Z | tools/SDKTool/src/ui/tree/scene_tree/scene_node.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 37 | 2020-08-24T02:48:38.000Z | 2022-01-30T06:41:52.000Z | tools/SDKTool/src/ui/tree/scene_tree/scene_node.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 275 | 2020-08-18T08:35:16.000Z | 2022-03-31T15:06:07.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... | 37.347193 | 114 | 0.607827 |
import logging
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QTreeWidgetItem, QComboBox
from PyQt5 import QtGui
from ....common.define import ITEM_TYPE_ELEMENT, ITEM_TYPE_TEMPLATE, ITEM_TYPE_ELEMENTS, SCENE_HIDDEN_KEYS, \
ITEM_TYPE_REFER_TASK, ITEM_TYPE_ELEMENT_NAME, DISABLE_EDIT_KEYS, DEFAULT_TEMPLATE... | true | true |
1c1837e228df49de1112c5f993f4f3c8ca526dba | 1,038 | py | Python | favsync/extractors/imgur.py | winters-frost/favsync | 48f370d415835e8b74f26489a60d0e072ff501b3 | [
"MIT"
] | null | null | null | favsync/extractors/imgur.py | winters-frost/favsync | 48f370d415835e8b74f26489a60d0e072ff501b3 | [
"MIT"
] | null | null | null | favsync/extractors/imgur.py | winters-frost/favsync | 48f370d415835e8b74f26489a60d0e072ff501b3 | [
"MIT"
] | null | null | null | from imgurpython import ImgurClient
from urllib.parse import urlparse
# TODO find a better place for these...
client_id = "d54ebc2a8a76634"
client_secret = "fdc101dc5cd3e60b190e41e293be991b170f7022"
client = ImgurClient(client_id, client_secret)
def get_media_from_post(post):
url_path = urlparse(post.url).path
... | 28.054054 | 80 | 0.675337 | from imgurpython import ImgurClient
from urllib.parse import urlparse
client_id = "d54ebc2a8a76634"
client_secret = "fdc101dc5cd3e60b190e41e293be991b170f7022"
client = ImgurClient(client_id, client_secret)
def get_media_from_post(post):
url_path = urlparse(post.url).path
link_type = url_path.split("/")... | true | true |
1c183a8c2b74aab3539607f845f89df28af19df1 | 15,991 | py | Python | python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # Copyright (c) 2018 PaddlePaddle 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 app... | 42.642667 | 80 | 0.572447 |
from __future__ import print_function
import unittest
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.dygraph.nn import Embedding
import paddle.fluid.framework as framework
from paddle.fluid.optimizer import SGDOptimizer
from paddle.fluid.dygraph.base import to_variable
f... | true | true |
1c183a9f3a8c01010d27f62ab50be13099525c88 | 1,527 | py | Python | datashader/tests/benchmarks/test_extend_line.py | philippjfr/datashader | eb9218cb810297aea2ae1030349cef6a6f3ab3cb | [
"BSD-3-Clause"
] | 1 | 2021-01-31T22:13:14.000Z | 2021-01-31T22:13:14.000Z | datashader/tests/benchmarks/test_extend_line.py | philippjfr/datashader | eb9218cb810297aea2ae1030349cef6a6f3ab3cb | [
"BSD-3-Clause"
] | null | null | null | datashader/tests/benchmarks/test_extend_line.py | philippjfr/datashader | eb9218cb810297aea2ae1030349cef6a6f3ab3cb | [
"BSD-3-Clause"
] | 1 | 2019-05-13T16:10:22.000Z | 2019-05-13T16:10:22.000Z | import pytest
import numpy as np
from datashader.glyphs import _build_draw_line, _build_extend_line, _build_map_onto_pixel
from datashader.utils import ngjit
@pytest.fixture
def extend_line():
@ngjit
def append(i, x, y, agg):
agg[y, x] += 1
mapper = ngjit(lambda x: x)
map_onto_pixel = _buil... | 29.365385 | 89 | 0.64702 | import pytest
import numpy as np
from datashader.glyphs import _build_draw_line, _build_extend_line, _build_map_onto_pixel
from datashader.utils import ngjit
@pytest.fixture
def extend_line():
@ngjit
def append(i, x, y, agg):
agg[y, x] += 1
mapper = ngjit(lambda x: x)
map_onto_pixel = _buil... | true | true |
1c183b4d8c038dc002dd68e4d2fb1a414188b0cd | 11,860 | py | Python | Computer-Vision-Fundamentals/color_model_plot.py | diegoinacio/computer-vision-notebooks | a86c63ab7d4e3cf0397d9962dd09e06151d9ad69 | [
"MIT"
] | 81 | 2020-02-17T22:02:49.000Z | 2022-03-21T16:28:23.000Z | Computer-Vision-Fundamentals/color_model_plot.py | romuloallc/computer-vision-notebooks | 89040e9aaa5a3382173d10efcce11068d5a82d71 | [
"MIT"
] | 10 | 2020-09-03T19:39:12.000Z | 2021-06-22T12:26:02.000Z | Computer-Vision-Fundamentals/color_model_plot.py | romuloallc/computer-vision-notebooks | 89040e9aaa5a3382173d10efcce11068d5a82d71 | [
"MIT"
] | 22 | 2020-05-13T05:56:26.000Z | 2022-02-25T04:20:19.000Z | import numpy as np
from plotly import __version__, tools
from plotly.offline import init_notebook_mode, iplot
from plotly.graph_objs import *
init_notebook_mode(connected=True)
# ! Identity Base
iBASE = np.array([
[0, 1, 0, 1, 0, 1, 0, 1],
[0, 0, 1, 1, 0, 0, 1, 1],
[0, 0, 0, 0, 1, 1, 1, 1]
])
base_pairs ... | 29.211823 | 113 | 0.443592 | import numpy as np
from plotly import __version__, tools
from plotly.offline import init_notebook_mode, iplot
from plotly.graph_objs import *
init_notebook_mode(connected=True)
iBASE = np.array([
[0, 1, 0, 1, 0, 1, 0, 1],
[0, 0, 1, 1, 0, 0, 1, 1],
[0, 0, 0, 0, 1, 1, 1, 1]
])
base_pairs = [
(0, 1), (1... | true | true |
1c183bb70392e0e8c7e7c7c94c5ecc514e48a191 | 595 | py | Python | test/test_dolfin.py | SNachar/meshio | faafd6826457116dd24d299b118f49d6cdf1e4c3 | [
"MIT"
] | 1 | 2018-07-03T14:46:12.000Z | 2018-07-03T14:46:12.000Z | test/test_dolfin.py | SNachar/meshio | faafd6826457116dd24d299b118f49d6cdf1e4c3 | [
"MIT"
] | null | null | null | test/test_dolfin.py | SNachar/meshio | faafd6826457116dd24d299b118f49d6cdf1e4c3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
import numpy
import pytest
import meshio
import helpers
@pytest.mark.parametrize(
"mesh",
[
helpers.tri_mesh,
helpers.tet_mesh,
helpers.add_cell_data(helpers.tri_mesh, 1, dtype=float),
helpers.add_cell_data(helpers.tri_mesh, 1, dtype=numpy.int32),
... | 19.833333 | 84 | 0.67395 | import numpy
import pytest
import meshio
import helpers
@pytest.mark.parametrize(
"mesh",
[
helpers.tri_mesh,
helpers.tet_mesh,
helpers.add_cell_data(helpers.tri_mesh, 1, dtype=float),
helpers.add_cell_data(helpers.tri_mesh, 1, dtype=numpy.int32),
],
)
def test_io(mesh):
... | true | true |
1c183c6a33413724740541df38daec3f0abf4fdc | 110 | py | Python | support/layer/nms.py | xmacex/easy-faster-rcnn.pytorch | 2c30c6d4ea57402c813294a499181b6ad710f858 | [
"MIT"
] | 174 | 2018-09-04T06:03:23.000Z | 2022-03-22T07:24:14.000Z | support/layer/nms.py | xmacex/easy-faster-rcnn.pytorch | 2c30c6d4ea57402c813294a499181b6ad710f858 | [
"MIT"
] | 32 | 2018-11-29T11:20:23.000Z | 2022-03-01T05:19:17.000Z | support/layer/nms.py | xmacex/easy-faster-rcnn.pytorch | 2c30c6d4ea57402c813294a499181b6ad710f858 | [
"MIT"
] | 76 | 2018-11-08T05:47:59.000Z | 2022-03-22T07:22:12.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from support import _C
nms = _C.nms
| 18.333333 | 71 | 0.736364 |
from support import _C
nms = _C.nms
| true | true |
1c183c83b0d17a1f1463b2d4d08b9ea525fb3774 | 18,496 | py | Python | src/gcf/geni/util/cred_util.py | ahelsing/geni-tools | 0799f715ad88a1a11b069e8208f012abef23cbd8 | [
"MIT"
] | 3 | 2015-05-05T13:03:27.000Z | 2021-11-17T11:16:38.000Z | src/gcf/geni/util/cred_util.py | ahelsing/geni-tools | 0799f715ad88a1a11b069e8208f012abef23cbd8 | [
"MIT"
] | null | null | null | src/gcf/geni/util/cred_util.py | ahelsing/geni-tools | 0799f715ad88a1a11b069e8208f012abef23cbd8 | [
"MIT"
] | null | null | null | #----------------------------------------------------------------------
# Copyright (c) 2010-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | 46.707071 | 250 | 0.645707 | '''
Credential creation and verification utilities.
'''
from __future__ import absolute_import
import os
import logging
import xmlrpclib
import sys
import datetime
import dateutil
from ...sfa.trust import credential as cred
from ...sfa.trust import gid
from ...sfa.trust import rights
from ...sfa.util.xrn import hrn_... | false | true |
1c183d16c03678d0aa33d4199609b80dcae6a35c | 6,922 | py | Python | salt/cache/mysql_cache.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 2 | 2015-08-21T01:05:03.000Z | 2015-09-02T07:30:45.000Z | salt/cache/mysql_cache.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 9 | 2021-03-31T20:25:25.000Z | 2021-07-04T05:33:46.000Z | salt/cache/mysql_cache.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 1 | 2020-06-02T14:15:24.000Z | 2020-06-02T14:15:24.000Z | """
Minion data cache plugin for MySQL database.
.. versionadded:: 2018.3.0
It is up to the system administrator to set up and configure the MySQL
infrastructure. All is needed for this plugin is a working MySQL server.
The module requires the `salt_cache` database to exists but creates its own
table if needed. The ... | 27.468254 | 88 | 0.642155 |
import logging
import time
from salt.exceptions import SaltCacheError
try:
import MySQLdb
import MySQLdb.cursors
import MySQLdb.converters
from MySQLdb.connections import OperationalError
except ImportError:
try:
import pymysql
pymysql.install_as_MySQLdb()
imp... | true | true |
1c183d465b249f881dad39838428410634a50b8e | 6,468 | py | Python | test/operations/PredictTest.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | test/operations/PredictTest.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | test/operations/PredictTest.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import unittest
from softwareprocess.operations.predict import Predict
class PredictTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_constructor(self):
input_dict = {'body': 'BetelGeuse', 'date':... | 43.12 | 94 | 0.524892 | from __future__ import absolute_import
import unittest
from softwareprocess.operations.predict import Predict
class PredictTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_constructor(self):
input_dict = {'body': 'BetelGeuse', 'date':... | true | true |
1c183d77ec7b506f847769e3b8be0e691f5dd989 | 7,341 | py | Python | core/storage/improvements/gae_models_test.py | h-ARTS/oppia | 82188c8cad6cc7bbb3ad5f2195d280268e1c2b74 | [
"Apache-2.0"
] | null | null | null | core/storage/improvements/gae_models_test.py | h-ARTS/oppia | 82188c8cad6cc7bbb3ad5f2195d280268e1c2b74 | [
"Apache-2.0"
] | null | null | null | core/storage/improvements/gae_models_test.py | h-ARTS/oppia | 82188c8cad6cc7bbb3ad5f2195d280268e1c2b74 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2020 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 39.256684 | 79 | 0.684375 |
from __future__ import absolute_import from __future__ import unicode_literals
from core.platform import models
from core.tests import test_utils
base_models, improvements_models = models.Registry.import_models(
[models.NAMES.base_model, models.NAMES.improvements])
def _always_returns(value):
return lam... | true | true |
1c183ec6e4a29ec9f970e6265d16ea4282c42012 | 10,471 | py | Python | accelbyte_py_sdk/api/iam/models/accountcommon_user_linked_platform.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/iam/models/accountcommon_user_linked_platform.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/iam/models/accountcommon_user_linked_platform.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# justice-iam-service (5.10.1)
# pylint: disable=dup... | 37.938406 | 214 | 0.592016 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from ....core import Model
class AccountcommonUserLinkedPlatform(Model):
linked_at: str namespace: str ... | true | true |
1c183ed59b336109a49a0922b64281a7538c142b | 22,385 | py | Python | Products/CMFDefault/browser/content/folder.py | zopefoundation/Products.CMFDefault | a176d9aac5a7e04725dbd0f7b76c6ac357062139 | [
"ZPL-2.1"
] | null | null | null | Products/CMFDefault/browser/content/folder.py | zopefoundation/Products.CMFDefault | a176d9aac5a7e04725dbd0f7b76c6ac357062139 | [
"ZPL-2.1"
] | 5 | 2017-07-13T00:51:25.000Z | 2021-02-04T15:08:39.000Z | Products/CMFDefault/browser/content/folder.py | zopefoundation/Products.CMFDefault | a176d9aac5a7e04725dbd0f7b76c6ac357062139 | [
"ZPL-2.1"
] | 3 | 2017-07-08T03:22:35.000Z | 2018-05-20T06:42:03.000Z | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 37.061258 | 79 | 0.582533 |
import urllib
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.component import getUtility
from zope.formlib import form
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabulary... | true | true |
1c183f9e860f33eaca2381e34fdd3ae9c3e91877 | 2,570 | py | Python | tract_querier/tests/test_scripts.py | MrBurnst/tract_querier | cd582efca1cccff2617199f64b382fc9b156f5d7 | [
"BSD-3-Clause"
] | 1 | 2021-06-17T08:20:24.000Z | 2021-06-17T08:20:24.000Z | tract_querier/tests/test_scripts.py | MrBurnst/tract_querier | cd582efca1cccff2617199f64b382fc9b156f5d7 | [
"BSD-3-Clause"
] | null | null | null | tract_querier/tests/test_scripts.py | MrBurnst/tract_querier | cd582efca1cccff2617199f64b382fc9b156f5d7 | [
"BSD-3-Clause"
] | null | null | null | from nose.tools import assert_equal, assert_greater, assert_in, assert_is_not_none, assert_true
import os
from os import path
import re
import subprocess
import sys
from tract_querier.tests import datasets
PACKAGE_ROOT_DIR = path.dirname(path.dirname(path.dirname(__file__)))
TRACT_QUERIER_SCRIPT = path.join(
P... | 31.341463 | 96 | 0.694942 | from nose.tools import assert_equal, assert_greater, assert_in, assert_is_not_none, assert_true
import os
from os import path
import re
import subprocess
import sys
from tract_querier.tests import datasets
PACKAGE_ROOT_DIR = path.dirname(path.dirname(path.dirname(__file__)))
TRACT_QUERIER_SCRIPT = path.join(
P... | true | true |
1c183faf91a437b1e69d1219aa89ef3a3fcc0f86 | 58,862 | py | Python | theano/compile/profiling.py | jdehotin/Theano | 0477d6356e4c5ceb5c3c03585e59d2e85abfcd02 | [
"BSD-3-Clause"
] | null | null | null | theano/compile/profiling.py | jdehotin/Theano | 0477d6356e4c5ceb5c3c03585e59d2e85abfcd02 | [
"BSD-3-Clause"
] | null | null | null | theano/compile/profiling.py | jdehotin/Theano | 0477d6356e4c5ceb5c3c03585e59d2e85abfcd02 | [
"BSD-3-Clause"
] | null | null | null | """
ProfileStats object for runtime and memory profiling.
"""
#
# TODO: add tip to use specify_shape (is specify_shape even in library doc?)
# TODO: ensure field width for string fields makes columns line up
# TODO: what to do about 'diff summary'? (ask Fred?)
#
from __future__ import absolute_import, print_function, ... | 40.261286 | 112 | 0.500357 | from __future__ import absolute_import, print_function, division
__authors__ = "James Bergstra"
__reviewer__ = "Razvan Pascanu"
__copyright__ = "(c) 2011, Universite de Montreal"
__license__ = "3-clause BSD License"
__contact__ = "theano-dev <theano-dev@googlegroups.com>"
__docformat__ = "restructuredtext en"
import... | true | true |
1c183fcea2d007ed39b768aba0d77e5cf44c92f1 | 9,255 | py | Python | scripts/irods/test/test_iput.py | rpatil524/irods | 0d992aaedca24afffc95735fd7c5e9f37b4648bc | [
"BSD-3-Clause"
] | 1 | 2020-05-31T17:00:37.000Z | 2020-05-31T17:00:37.000Z | scripts/irods/test/test_iput.py | rpatil524/irods | 0d992aaedca24afffc95735fd7c5e9f37b4648bc | [
"BSD-3-Clause"
] | null | null | null | scripts/irods/test/test_iput.py | rpatil524/irods | 0d992aaedca24afffc95735fd7c5e9f37b4648bc | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import os
import sys
import tempfile
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
from . import session
from .. import test
from .. import lib
rodsadmins = [('otherrods', 'rods')]
rodsusers = [('alice', 'apass')]
class Test_Iput(sess... | 44.927184 | 141 | 0.677796 | from __future__ import print_function
import os
import sys
import tempfile
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
from . import session
from .. import test
from .. import lib
rodsadmins = [('otherrods', 'rods')]
rodsusers = [('alice', 'apass')]
class Test_Iput(sess... | true | true |
1c183fd860319885ddece376461a69573f5ceed3 | 1,514 | py | Python | playwright/download.py | dgozman/playwright-python | 05e48f6a23f988bfbf68431ebee8eabe3e8d7bd7 | [
"Apache-2.0"
] | null | null | null | playwright/download.py | dgozman/playwright-python | 05e48f6a23f988bfbf68431ebee8eabe3e8d7bd7 | [
"Apache-2.0"
] | null | null | null | playwright/download.py | dgozman/playwright-python | 05e48f6a23f988bfbf68431ebee8eabe3e8d7bd7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 32.212766 | 75 | 0.700132 |
from pathlib import Path
from typing import Dict, Optional, Union
from playwright.connection import ChannelOwner
class Download(ChannelOwner):
def __init__(
self, parent: ChannelOwner, type: str, guid: str, initializer: Dict
) -> None:
super().__init__(parent, type, guid, initializer)
@... | true | true |
1c1840c6a98b26685458f40927223db535096efb | 5,746 | py | Python | python_modules/dagster/dagster/__init__.py | pseudoPixels/dagster | ac78bdbec54754d35f51d706fc5b0bacfe49f2bf | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/__init__.py | pseudoPixels/dagster | ac78bdbec54754d35f51d706fc5b0bacfe49f2bf | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/__init__.py | pseudoPixels/dagster | ac78bdbec54754d35f51d706fc5b0bacfe49f2bf | [
"Apache-2.0"
] | null | null | null | from dagster.core.definitions import (
CompositeSolidDefinition,
ConfigMapping,
ConfigMappingContext,
DependencyDefinition,
EventMetadataEntry,
ExecutionTargetHandle,
ExecutorDefinition,
ExpectationResult,
Failure,
FirstPartitionSelector,
InputDefinition,
InputMapping,
... | 25.091703 | 86 | 0.731639 | from dagster.core.definitions import (
CompositeSolidDefinition,
ConfigMapping,
ConfigMappingContext,
DependencyDefinition,
EventMetadataEntry,
ExecutionTargetHandle,
ExecutorDefinition,
ExpectationResult,
Failure,
FirstPartitionSelector,
InputDefinition,
InputMapping,
... | true | true |
1c1840d3ce3efc2f37f176ba83fa77111c61a751 | 731 | py | Python | notes/code/scrape/buzzfeed.py | JaredMlekush/msds692 | a0b9058334851ffbc19338ef8e65ff355fdaf1b8 | [
"MIT"
] | 1 | 2021-10-10T15:10:37.000Z | 2021-10-10T15:10:37.000Z | notes/code/scrape/buzzfeed.py | JaredMlekush/msds692 | a0b9058334851ffbc19338ef8e65ff355fdaf1b8 | [
"MIT"
] | null | null | null | notes/code/scrape/buzzfeed.py | JaredMlekush/msds692 | a0b9058334851ffbc19338ef8e65ff355fdaf1b8 | [
"MIT"
] | 1 | 2021-01-12T19:30:31.000Z | 2021-01-12T19:30:31.000Z | import requests
from bs4 import BeautifulSoup
from collections import defaultdict
def parseBF():
response = requests.get("https://www.buzzfeed.com/")
soup = BeautifulSoup(response.text, "html.parser")
topics = defaultdict(set)
for link in soup.findAll(lambda tag: tag.name=='a' and 'data-bfa' in tag.at... | 30.458333 | 84 | 0.630643 | import requests
from bs4 import BeautifulSoup
from collections import defaultdict
def parseBF():
response = requests.get("https://www.buzzfeed.com/")
soup = BeautifulSoup(response.text, "html.parser")
topics = defaultdict(set)
for link in soup.findAll(lambda tag: tag.name=='a' and 'data-bfa' in tag.at... | true | true |
1c1840e48328e57f9b8df4e36377cc68d56793ec | 9,833 | py | Python | train_flexible_shifts.py | ruijieren98/SfmLearner-Pytorch | 893743f33c31a687a6bb4a447af01f9abf47b85f | [
"MIT"
] | 39 | 2020-01-17T18:33:42.000Z | 2021-11-14T02:36:32.000Z | train_flexible_shifts.py | ruijieren98/SfmLearner-Pytorch | 893743f33c31a687a6bb4a447af01f9abf47b85f | [
"MIT"
] | 7 | 2020-01-10T14:52:44.000Z | 2021-03-15T18:55:35.000Z | train_flexible_shifts.py | ruijieren98/SfmLearner-Pytorch | 893743f33c31a687a6bb4a447af01f9abf47b85f | [
"MIT"
] | 10 | 2020-03-01T11:35:50.000Z | 2022-01-18T10:54:04.000Z | import time
import csv
import numpy as np
import torch
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import custom_transforms
import models
from utils import save_checkpoint,save_path_formatter
from logger import TermLogger, AverageMeter
from iterto... | 39.971545 | 146 | 0.659412 | import time
import csv
import numpy as np
import torch
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import custom_transforms
import models
from utils import save_checkpoint,save_path_formatter
from logger import TermLogger, AverageMeter
from iterto... | true | true |
1c1841aa4f1a629e2f5057f48e69106129c43496 | 908 | py | Python | Mundo 3/ex116/sistema.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | Mundo 3/ex116/sistema.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | Mundo 3/ex116/sistema.py | adonaifariasdev/cursoemvideo-python3 | 1fd35e45b24c52013fa3bc98e723971db8e6b7d1 | [
"MIT"
] | null | null | null | from ex116.lib.interface import *
from ex116.lib.arquivo import *
from time import sleep
cabeçalho('CRIAR UM AQUIVO TXT')
nome = str(input('Digite o nome do arquivo para abrir ou para cria-lo: '))
arq = nome + '.txt'
if not arquivoExiste(arq):
criaArquivo(arq)
else:
print(f'O arquivo ({arq}) já existe!')
... | 27.515152 | 93 | 0.623348 | from ex116.lib.interface import *
from ex116.lib.arquivo import *
from time import sleep
cabeçalho('CRIAR UM AQUIVO TXT')
nome = str(input('Digite o nome do arquivo para abrir ou para cria-lo: '))
arq = nome + '.txt'
if not arquivoExiste(arq):
criaArquivo(arq)
else:
print(f'O arquivo ({arq}) já existe!')
... | true | true |
1c1841d71e3e1a3436d37094964f34388ebce1ad | 5,940 | py | Python | examples/models/initializer.py | johntzwei/wilds | cb373f729826fbdd737664f06bb91b92c6bf5395 | [
"MIT"
] | null | null | null | examples/models/initializer.py | johntzwei/wilds | cb373f729826fbdd737664f06bb91b92c6bf5395 | [
"MIT"
] | null | null | null | examples/models/initializer.py | johntzwei/wilds | cb373f729826fbdd737664f06bb91b92c6bf5395 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torchvision
from models.bert.bert import BertClassifier, BertFeaturizer
from models.bert.roberta import RobertaClassifier, RobertaFeaturizer
from models.bert.distilbert import DistilBertClassifier, DistilBertFeaturizer
from models.resnet_multispectral import ResNet18
from models.layers impo... | 43.676471 | 127 | 0.656229 | import torch.nn as nn
import torchvision
from models.bert.bert import BertClassifier, BertFeaturizer
from models.bert.roberta import RobertaClassifier, RobertaFeaturizer
from models.bert.distilbert import DistilBertClassifier, DistilBertFeaturizer
from models.resnet_multispectral import ResNet18
from models.layers impo... | true | true |
1c1842998f2580a4204af28607a77326073a7606 | 5,697 | py | Python | sdk/python/pulumi_azure_native/network/v20210201/get_service_endpoint_policy_definition.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20210201/get_service_endpoint_policy_definition.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20210201/get_service_endpoint_policy_definition.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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, overload
from ... import _utilities
__... | 38.755102 | 177 | 0.669826 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = [
'GetServiceEndpointPolicyDefinitionResult',
'AwaitableGetServiceEndpointPolicyDefinitionResult',
'get_service_endpoint_policy_definition',
]
@pul... | true | true |
1c1842bdde242eb9488e9788caab7683b68deb22 | 836 | py | Python | easy/image-smoother.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | easy/image-smoother.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | easy/image-smoother.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | class Solution:
def imageSmoother(self, M):
"""
:type M: List[List[int]]
:rtype: List[List[int]]
"""
"""
[2 ,3 ,4],
[5 ,6 ,7],
[8 ,9 ,10]
[11 ,12 ,13]
[14 ,15 ,16]
"""
pos = [(0, 1), (1, 0), (0, -1), (-1, ... | 26.967742 | 84 | 0.301435 | class Solution:
def imageSmoother(self, M):
pos = [(0, 1), (1, 0), (0, -1), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
h = len(M)
w = len(M[0])
rM = [ [0]*w for i in [0]*h]
for i in range(h):
for j in range(w):
con = []
... | true | true |
1c184383c1b2389be2f283483b9f54a100caa9fa | 1,848 | py | Python | ubb/fop/2015.Seminar.09/repository/Repository.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | ubb/fop/2015.Seminar.09/repository/Repository.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | 6 | 2020-03-04T20:52:39.000Z | 2022-03-31T00:33:07.000Z | ubb/fop/2015.Seminar.09/repository/Repository.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | from repository.RepositoryException import RepositoryException
class Repository:
"""
Repository for storing IDObject instances
"""
def __init__(self):
self._objects = []
def store(self, obj):
if self.find(obj.getId()) != None:
raise RepositoryException("Element having i... | 31.322034 | 105 | 0.607143 | from repository.RepositoryException import RepositoryException
class Repository:
def __init__(self):
self._objects = []
def store(self, obj):
if self.find(obj.getId()) != None:
raise RepositoryException("Element having id=" + str(obj.getId()) + " already stored!")
self._obj... | true | true |
1c18452bd7226387054bc9b770a538caf2e26bb8 | 252 | py | Python | output/models/nist_data/list_pkg/hex_binary/schema_instance/nistschema_sv_iv_list_hex_binary_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/hex_binary/schema_instance/nistschema_sv_iv_list_hex_binary_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/hex_binary/schema_instance/nistschema_sv_iv_list_hex_binary_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.hex_binary.schema_instance.nistschema_sv_iv_list_hex_binary_length_4_xsd.nistschema_sv_iv_list_hex_binary_length_4 import NistschemaSvIvListHexBinaryLength4
__all__ = [
"NistschemaSvIvListHexBinaryLength4",
]
| 42 | 194 | 0.892857 | from output.models.nist_data.list_pkg.hex_binary.schema_instance.nistschema_sv_iv_list_hex_binary_length_4_xsd.nistschema_sv_iv_list_hex_binary_length_4 import NistschemaSvIvListHexBinaryLength4
__all__ = [
"NistschemaSvIvListHexBinaryLength4",
]
| true | true |
1c1846865626c53a44080a8e52c7dcfd435fc9f0 | 494 | py | Python | ex076.py | felipesch92/PythonExercicios | 73edcbde6beaabcfc86af3dd6e58473f1eecabd3 | [
"MIT"
] | null | null | null | ex076.py | felipesch92/PythonExercicios | 73edcbde6beaabcfc86af3dd6e58473f1eecabd3 | [
"MIT"
] | null | null | null | ex076.py | felipesch92/PythonExercicios | 73edcbde6beaabcfc86af3dd6e58473f1eecabd3 | [
"MIT"
] | null | null | null | # Crie um programa que tenha uma tupla única com nomes de produtos e
# seus respectivos preços, na sequência. No final, mostre uma
# listagem de preços, organizando os dados em forma tabular.
produtos = ('Lápis', 1.5, 'Borracha', 0.5, 'Caderno', 8.0,
'Estojo', 15, 'Caneta', 2.5, 'Mochila', 35.00)
print('-'*... | 35.285714 | 68 | 0.611336 | produtos = ('Lápis', 1.5, 'Borracha', 0.5, 'Caderno', 8.0,
'Estojo', 15, 'Caneta', 2.5, 'Mochila', 35.00)
print('-'*20)
print('Listagem de preços')
print('-'*20)
for x, p in enumerate(produtos):
if x % 2 == 0:
print(f'{p:.<20}', end='')
else:
print(f'R$ {p:>5.2f}')
| true | true |
1c18481d6d130329caad17ba17d83e91b9d507ed | 4,104 | py | Python | bindings/python/ensmallen/datasets/networkrepository/webuk2002all.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/networkrepository/webuk2002all.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/networkrepository/webuk2002all.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph web-uk-2002-all.
The graph is automatically retrieved from the NetworkRepository repository.
References
---------------------
Please cite the following if you use the data:
```bib
@inproceedings{nr,
title = {The Network Data Repository with I... | 31.813953 | 121 | 0.646442 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def WebUk2002All(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/networkreposi... | true | true |
1c18488abd93dfc3eaf05d8e2ef678ad434bb244 | 3,733 | py | Python | Lib/site-packages/pygments/lexers/oberon.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | Lib/site-packages/pygments/lexers/oberon.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | Lib/site-packages/pygments/lexers/oberon.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.oberon
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Oberon family languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygmen... | 35.216981 | 89 | 0.445754 |
import re
from pygments.lexer import RegexLexer, include, words
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Number, Punctuation
__all__ = ['ComponentPascalLexer']
class ComponentPascalLexer(RegexLexer):
name = 'Component Pascal'
aliases = ['componentpascal', 'cp']
f... | true | true |
1c1848cce0c231b69d6d755553ab1a4d6640339b | 30,766 | py | Python | tests/snapshots/snap_bme280_test.py | cmur2/python-bm280 | 672ff9732613e34b364c6bf03e3227947e0169af | [
"MIT"
] | 9 | 2016-09-02T18:11:46.000Z | 2021-07-02T11:17:14.000Z | tests/snapshots/snap_bme280_test.py | cmur2/python-bm280 | 672ff9732613e34b364c6bf03e3227947e0169af | [
"MIT"
] | 7 | 2018-11-25T18:55:10.000Z | 2020-06-15T18:40:48.000Z | tests/snapshots/snap_bme280_test.py | cmur2/python-bm280 | 672ff9732613e34b364c6bf03e3227947e0169af | [
"MIT"
] | 5 | 2018-11-25T09:58:21.000Z | 2021-12-30T16:19:15.000Z | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['TestBme280::test_chip_id 1'] = [
(
'w',
118,
136
),
(
'r',
118,
0
),
(
... | 10.077301 | 48 | 0.131119 | from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['TestBme280::test_chip_id 1'] = [
(
'w',
118,
136
),
(
'r',
118,
0
),
(
'w',
118,
137
),
(
'r',
... | true | true |
1c1849f58ceb2d04f8332496192b1ff3895ca10f | 349 | py | Python | pomodoroCLI/classes/JsonHandler.py | JanssensKobe/pomodoroCLI | e62a59e31db8d96db1b6786f3101fc3b516ccc10 | [
"MIT"
] | 1 | 2022-01-15T03:39:07.000Z | 2022-01-15T03:39:07.000Z | pomodoroCLI/classes/JsonHandler.py | JanssensKobe/pomodoroCLI | e62a59e31db8d96db1b6786f3101fc3b516ccc10 | [
"MIT"
] | null | null | null | pomodoroCLI/classes/JsonHandler.py | JanssensKobe/pomodoroCLI | e62a59e31db8d96db1b6786f3101fc3b516ccc10 | [
"MIT"
] | null | null | null | import json
class JsonHandler:
def __init__(self, path):
self.path = path
def jsonReader(self):
with open(self.path, "r") as jsonFile:
data = json.load(jsonFile)
return data
def overwriteJson(self, data):
with open(self.path, "w") as jsonFile:
... | 23.266667 | 46 | 0.578797 | import json
class JsonHandler:
def __init__(self, path):
self.path = path
def jsonReader(self):
with open(self.path, "r") as jsonFile:
data = json.load(jsonFile)
return data
def overwriteJson(self, data):
with open(self.path, "w") as jsonFile:
... | true | true |
1c184b66f256e59649c85fb7b97d38c69119842d | 185 | py | Python | me_group/me_group/doctype/api_log/api_log.py | Eng-Mohanad-Alkrunz/me_group | 8311f034a79c1b75c03a4b6be0b1a726b07a9d95 | [
"MIT"
] | null | null | null | me_group/me_group/doctype/api_log/api_log.py | Eng-Mohanad-Alkrunz/me_group | 8311f034a79c1b75c03a4b6be0b1a726b07a9d95 | [
"MIT"
] | null | null | null | me_group/me_group/doctype/api_log/api_log.py | Eng-Mohanad-Alkrunz/me_group | 8311f034a79c1b75c03a4b6be0b1a726b07a9d95 | [
"MIT"
] | null | null | null | # Copyright (c) 2022, test and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class ApiLog(Document):
pass
| 20.555556 | 49 | 0.783784 |
from frappe.model.document import Document
class ApiLog(Document):
pass
| true | true |
1c184b98f9d522fd0e327d9cc52e59300c5e6b2d | 4,993 | py | Python | omaha_server/crash/utils.py | IldarShukubaev/omaha-server | a2de53c5189eba4f426c638d0c017b7a48ce88bb | [
"Apache-2.0"
] | null | null | null | omaha_server/crash/utils.py | IldarShukubaev/omaha-server | a2de53c5189eba4f426c638d0c017b7a48ce88bb | [
"Apache-2.0"
] | null | null | null | omaha_server/crash/utils.py | IldarShukubaev/omaha-server | a2de53c5189eba4f426c638d0c017b7a48ce88bb | [
"Apache-2.0"
] | null | null | null | # coding: utf8
"""
This software is licensed under the Apache 2 license, quoted below.
Copyright 2014 Crystalnix 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/... | 31.802548 | 102 | 0.671941 |
from builtins import str
import os
import re
from django.conf import settings
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist, ValidationError
from clom import clom
from celery import signature
from crash.settings import MINIDUMP_STACKWALK_PATH, SYMBOLS_PATH
from crash.stacktrace_to... | true | true |
1c184c40a99db6772353364d9b905b7cc29f22f8 | 2,021 | py | Python | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/user.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/user.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/user.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import (
ModelNormal,
cached_property,
... | 28.069444 | 108 | 0.650173 |
from datadog_api_client.v2.model_utils import (
ModelNormal,
cached_property,
)
def lazy_import():
from datadog_api_client.v2.model.user_attributes import UserAttributes
from datadog_api_client.v2.model.user_response_relationships import UserResponseRelationships
from datadog_api_client.v2.model... | true | true |
1c184d86be48741b8e040251d1791e354c2abda8 | 1,262 | py | Python | python/game/pt.py | summyer/common-source | 47331c4b8c035cb21c2b90a693b7005cad7b268b | [
"MIT"
] | null | null | null | python/game/pt.py | summyer/common-source | 47331c4b8c035cb21c2b90a693b7005cad7b268b | [
"MIT"
] | null | null | null | python/game/pt.py | summyer/common-source | 47331c4b8c035cb21c2b90a693b7005cad7b268b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 19:13:02 2018
@author: Administrator
"""
background_image_filename = 'sushiplate.jpg'
import pygame
from pygame.locals import *
from sys import exit
SCREEN_SIZE = (640, 480)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE, RESIZABLE, 32)
background ... | 25.24 | 72 | 0.655309 |
background_image_filename = 'sushiplate.jpg'
import pygame
from pygame.locals import *
from sys import exit
SCREEN_SIZE = (640, 480)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE, RESIZABLE, 32)
background = pygame.image.load(background_image_filename).convert()
font = pygame.font.SysFont("arial"... | true | true |
1c184d8a36463b2a61015121d7a32a4e33f7a728 | 3,765 | py | Python | middleware/src/run.py | JorritvandenBerg/milestone-dapp | 9d1c774c853c0a2c4a2341529ad7efd39c09382d | [
"MIT"
] | 5 | 2018-02-28T19:08:49.000Z | 2018-07-26T22:03:49.000Z | middleware/src/run.py | JorritvandenBerg/milestone-dapp | 9d1c774c853c0a2c4a2341529ad7efd39c09382d | [
"MIT"
] | null | null | null | middleware/src/run.py | JorritvandenBerg/milestone-dapp | 9d1c774c853c0a2c4a2341529ad7efd39c09382d | [
"MIT"
] | 1 | 2021-10-01T16:35:10.000Z | 2021-10-01T16:35:10.000Z | """
Example of running a NEO node and receiving notifications when events
of a specific smart contract happen.
Events include Runtime.Notify, Runtime.Log, Storage.*, Execution.Success
and several more.
More documentation is coming soon.
"""
import os
import threading
import json
from redis import Redis
from time import... | 32.456897 | 87 | 0.66826 | import os
import threading
import json
from redis import Redis
from time import sleep
from logzero import logger
from twisted.internet import reactor, task
from neo.Network.NodeLeader import NodeLeader
from neo.Core.Blockchain import Blockchain
from neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain import Lev... | true | true |
1c184da34c70cecbefaa598e5535d10942daf015 | 3,316 | py | Python | test/e2e/batcher/test_batcher.py | Teasoap12/kfserving | 23588f536ec68c65564ce44b230244c3aaa01ddf | [
"Apache-2.0"
] | 6 | 2022-02-15T21:54:19.000Z | 2022-02-16T21:18:54.000Z | test/e2e/batcher/test_batcher.py | cliveseldon/kfserving | 37af39054499caf9145664a48981740ca4ce14f5 | [
"Apache-2.0"
] | 1 | 2021-12-06T17:02:54.000Z | 2021-12-06T17:02:54.000Z | test/e2e/batcher/test_batcher.py | cliveseldon/kfserving | 37af39054499caf9145664a48981740ca4ce14f5 | [
"Apache-2.0"
] | 2 | 2021-12-16T10:32:07.000Z | 2022-02-28T17:08:52.000Z | # Copyright 2020 kubeflow.org.
#
# 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,... | 41.974684 | 120 | 0.643546 |
import os
from kubernetes import client
from kfserving import KFServingClient
from kfserving import constants
from kfserving import V1beta1PredictorSpec
from kfserving import V1beta1Batcher
from kfserving import V1beta1TorchServeSpec
from kfserving import V1beta1InferenceServiceSpec
from kfserving import V1beta1Infer... | true | true |
1c184f9e98410823616f3845fe71683d58c57674 | 28,032 | py | Python | calico/felix/test/test_config.py | ozdanborne/felix | 5eff313e6498b3a7d775aa16cb09fd4578331701 | [
"Apache-2.0"
] | 6 | 2016-10-18T04:04:25.000Z | 2016-10-18T04:06:49.000Z | calico/felix/test/test_config.py | ozdanborne/felix | 5eff313e6498b3a7d775aa16cb09fd4578331701 | [
"Apache-2.0"
] | 1 | 2021-06-01T21:45:37.000Z | 2021-06-01T21:45:37.000Z | calico/felix/test/test_config.py | ozdanborne/felix | 5eff313e6498b3a7d775aa16cb09fd4578331701 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 40.982456 | 105 | 0.594321 |
import logging
import re
import mock
import socket
import sys
from contextlib import nested
from calico.felix.config import Config, ConfigException
from calico.felix.test.base import load_config
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
log = logging.getLogger(__name__)... | true | true |
1c18500581807e5815975739840a1337a497a0d2 | 622 | py | Python | apps/videos/serializers.py | LauZyHou/CET6Cat | 2de787b49b21cc05d50bd3a6d79b235c347acd6c | [
"MIT"
] | 10 | 2019-10-09T12:12:16.000Z | 2021-12-14T03:06:01.000Z | apps/videos/serializers.py | LauZyHou/CET6Cat | 2de787b49b21cc05d50bd3a6d79b235c347acd6c | [
"MIT"
] | 2 | 2019-02-17T04:45:52.000Z | 2019-03-01T01:34:59.000Z | apps/videos/serializers.py | LauZyHou/CET6Cat | 2de787b49b21cc05d50bd3a6d79b235c347acd6c | [
"MIT"
] | 4 | 2020-01-18T13:48:31.000Z | 2020-07-17T23:32:07.000Z | from rest_framework import serializers
from videos.models import Video
class VideoSerializer(serializers.ModelSerializer):
"""
视频list用这个Serializer
[这个Serializer现在有两个View用,一个是普通视频list,一个是首页热门视频list.
这两个View在前端都没有地方可以展示hot_value,所以这里没返回(和别的资源不太一样)]
"""
# 不带视频详细内容content
class Meta:
... | 23.923077 | 87 | 0.684887 | from rest_framework import serializers
from videos.models import Video
class VideoSerializer(serializers.ModelSerializer):
class Meta:
model = Video
fields = ("id", "name", "thumb", "category", "add_time")
class VideoDetailSerializer(serializers.ModelSerializer):
class Meta:
m... | true | true |
1c1851fc793aefebe435873c479bc9ec0dfcb13b | 19,173 | py | Python | numpy/core/tests/test_deprecations.py | Juanlu001/numpy | 1e494f1e283340d545b1c7c15dded04a4aaae939 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_deprecations.py | Juanlu001/numpy | 1e494f1e283340d545b1c7c15dded04a4aaae939 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_deprecations.py | Juanlu001/numpy | 1e494f1e283340d545b1c7c15dded04a4aaae939 | [
"BSD-3-Clause"
] | null | null | null | """
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import warnings
import numpy as np
from numpy.testing import (
r... | 40.449367 | 91 | 0.630522 | from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, assert_raises, assert_warns, assert_no_warnings,
assert_array_equal, assert_, dec)
try:
import pytz
_has_pytz = ... | true | true |
1c1852025de6d12e10f8a9b36ff5240189c045af | 450 | py | Python | _posts/code/docopt/use_argparse.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/docopt/use_argparse.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/docopt/use_argparse.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("input", help="The input text file", type=str)
parser.add_argument("output", help="The input text file", type=str)
parser.add_argument("-s", "--size", help="Integer window size", default=10, type=int)
args =... | 20.454545 | 89 | 0.657778 | import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("input", help="The input text file", type=str)
parser.add_argument("output", help="The input text file", type=str)
parser.add_argument("-s", "--size", help="Integer window size", default=10, type=int)
args =... | true | true |
1c18529db32f39742f63fa0aac166759fab3da95 | 4,411 | py | Python | bigml/api_handlers/correlationhandler.py | bikramkharal/python-1 | 106c5cfbae94ef8e3a13fb8fa9899f7f03a5d192 | [
"Apache-2.0"
] | 1 | 2021-07-08T07:45:23.000Z | 2021-07-08T07:45:23.000Z | bigml/api_handlers/correlationhandler.py | sxfmol/python-1 | d3de9617c91909b9923e80a1401f12c77114d0aa | [
"Apache-2.0"
] | null | null | null | bigml/api_handlers/correlationhandler.py | sxfmol/python-1 | d3de9617c91909b9923e80a1401f12c77114d0aa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2015-2020 BigML
#
# 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 ... | 36.758333 | 78 | 0.6511 |
try:
import simplejson as json
except ImportError:
import json
from bigml.api_handlers.resourcehandler import ResourceHandlerMixin
from bigml.api_handlers.resourcehandler import check_resource_type, \
get_correlation_id, get_resource_type, \
get_dataset_id, check_resource
from bigml.constants import... | true | true |
1c1852f6002441aa453532937eb6eb539d153840 | 468 | py | Python | jasmin_api/jasmin_api/wsgi.py | LucasTeodoro/jasmin-api | fa7e8a3b4a7250828a00df9f84ea906fa8e03404 | [
"Apache-2.0"
] | null | null | null | jasmin_api/jasmin_api/wsgi.py | LucasTeodoro/jasmin-api | fa7e8a3b4a7250828a00df9f84ea906fa8e03404 | [
"Apache-2.0"
] | null | null | null | jasmin_api/jasmin_api/wsgi.py | LucasTeodoro/jasmin-api | fa7e8a3b4a7250828a00df9f84ea906fa8e03404 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for jasmin_api 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from dotenv import load_dotenv, f... | 24.631579 | 78 | 0.797009 |
import os
from django.core.wsgi import get_wsgi_application
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jasmin_api.settings")
application = get_wsgi_application()
| true | true |
1c18531151314e060d240ebb2e5317e29a7c4c4b | 36,788 | py | Python | glance_store/_drivers/s3.py | sokovnich/glance_store | 088a07e602825ae482ebf747cddc94d1996f04e6 | [
"Apache-2.0"
] | null | null | null | glance_store/_drivers/s3.py | sokovnich/glance_store | 088a07e602825ae482ebf747cddc94d1996f04e6 | [
"Apache-2.0"
] | 4 | 2021-05-20T12:09:08.000Z | 2021-06-07T13:25:26.000Z | glance_store/_drivers/s3.py | sokovnich/glance_store | 088a07e602825ae482ebf747cddc94d1996f04e6 | [
"Apache-2.0"
] | 1 | 2021-08-02T05:44:04.000Z | 2021-08-02T05:44:04.000Z | # Copyright 2010 OpenStack Foundation
# 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 requ... | 39.472103 | 79 | 0.586115 |
import logging
import math
import re
from boto3 import session as boto_session
from botocore import client as boto_client
from botocore import exceptions as boto_exceptions
from botocore import utils as boto_utils
import eventlet
from oslo_config import cfg
from oslo_utils import encodeutils
from oslo_utils import u... | true | true |
1c18536ae3e653e9bbc59481dedc8391433fd5d2 | 7,110 | py | Python | browser/browser.py | digomes87/15-minute-apps | 6e288846769a7432fb2813a42b759d9c9842de58 | [
"MIT"
] | 3 | 2019-01-13T02:50:33.000Z | 2019-01-13T11:10:09.000Z | browser/browser.py | digomes87/15-minute-apps | 6e288846769a7432fb2813a42b759d9c9842de58 | [
"MIT"
] | null | null | null | browser/browser.py | digomes87/15-minute-apps | 6e288846769a7432fb2813a42b759d9c9842de58 | [
"MIT"
] | 1 | 2021-07-16T08:37:44.000Z | 2021-07-16T08:37:44.000Z | from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtPrintSupport import *
import os
import sys
class AboutDialog(QDialog):
def __init__(self, *args, **kwargs):
super(AboutDialog, self).__init__(*args, **kwargs)
QB... | 35.024631 | 118 | 0.630802 | from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtPrintSupport import *
import os
import sys
class AboutDialog(QDialog):
def __init__(self, *args, **kwargs):
super(AboutDialog, self).__init__(*args, **kwargs)
QB... | true | true |
1c1853e71a579a945bfdb30ee6ad6d4e65e9d764 | 8,291 | py | Python | salt/modules/bridge.py | kstaken/salt | 3321d57cf4d085bc6cbe269dbd01afd04fc6ff2a | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:56.000Z | 2021-03-08T18:59:46.000Z | salt/modules/bridge.py | ageron/salt | 72a0a89011e55ce7c875e948b5f0e97e70328153 | [
"Apache-2.0"
] | null | null | null | salt/modules/bridge.py | ageron/salt | 72a0a89011e55ce7c875e948b5f0e97e70328153 | [
"Apache-2.0"
] | 1 | 2020-03-07T07:04:55.000Z | 2020-03-07T07:04:55.000Z | '''
Module for gathering and managing bridging informations
'''
import sys
import re
import salt.utils
def __virtual__():
'''
Confirm this module is supported by the OS and the system has
required tools
'''
supported_os = {
'Linux': 'brctl',
'NetBSD': 'brconfig'
}
cur_os =... | 22.84022 | 80 | 0.560125 |
import sys
import re
import salt.utils
def __virtual__():
supported_os = {
'Linux': 'brctl',
'NetBSD': 'brconfig'
}
cur_os = __grains__['kernel']
for _os in supported_os:
if cur_os == _os and salt.utils.which(supported_os[cur_os]):
return 'bridge'
return False
... | true | true |
1c1855d857f00ee072ed26353e98ca0ffd76f194 | 6,203 | py | Python | pyxel/editor/music_editor.py | TerunobuInaba/smash_brothers | db7c59a012c617f3036e07d38d3d44706addae73 | [
"MIT"
] | 10,074 | 2018-06-24T13:08:57.000Z | 2022-03-31T20:54:31.000Z | pyxel/editor/music_editor.py | epassaro/pyxel | 8bcb6f04eb184876d7807b89b34057ca0897b392 | [
"MIT"
] | 369 | 2018-06-28T12:50:52.000Z | 2022-03-28T18:21:54.000Z | pyxel/editor/music_editor.py | epassaro/pyxel | 8bcb6f04eb184876d7807b89b34057ca0897b392 | [
"MIT"
] | 848 | 2018-07-29T16:31:13.000Z | 2022-03-31T03:20:44.000Z | import pyxel
from pyxel.ui import ImageButton, ImageToggleButton, NumberPicker
from .constants import (
EDITOR_IMAGE_X,
EDITOR_IMAGE_Y,
MAX_MUSIC_LENGTH,
TEXT_LABEL_COLOR,
)
from .editor import Editor
from .field_cursor import FieldCursor
from .music_field import MusicField
from .sound_selector import ... | 29.398104 | 84 | 0.59971 | import pyxel
from pyxel.ui import ImageButton, ImageToggleButton, NumberPicker
from .constants import (
EDITOR_IMAGE_X,
EDITOR_IMAGE_Y,
MAX_MUSIC_LENGTH,
TEXT_LABEL_COLOR,
)
from .editor import Editor
from .field_cursor import FieldCursor
from .music_field import MusicField
from .sound_selector import ... | true | true |
1c1856aa150d8a949116e472c569cb6ef46528a2 | 726 | py | Python | pyartifactory/models/auth.py | uschi2000/python-artifactory | 5a3b27b914bebb3074b11824eb8ccaed38043601 | [
"MIT"
] | 35 | 2019-07-19T13:19:06.000Z | 2022-03-28T09:58:11.000Z | pyartifactory/models/auth.py | uschi2000/python-artifactory | 5a3b27b914bebb3074b11824eb8ccaed38043601 | [
"MIT"
] | 55 | 2019-04-12T11:44:52.000Z | 2022-02-14T13:07:33.000Z | pyartifactory/models/auth.py | uschi2000/python-artifactory | 5a3b27b914bebb3074b11824eb8ccaed38043601 | [
"MIT"
] | 26 | 2019-04-11T15:58:14.000Z | 2022-03-28T09:58:15.000Z | """
Definition of all autho models.
"""
from typing import Tuple, Optional
from pydantic import BaseModel, SecretStr
class AuthModel(BaseModel):
"""Models an auth response."""
url: str
auth: Tuple[str, SecretStr]
verify: bool = True
cert: Optional[str] = None
api_version: in... | 18.15 | 42 | 0.632231 |
from typing import Tuple, Optional
from pydantic import BaseModel, SecretStr
class AuthModel(BaseModel):
url: str
auth: Tuple[str, SecretStr]
verify: bool = True
cert: Optional[str] = None
api_version: int = 1
class ApiKeyModel(BaseModel):
apiKey: SecretStr
class Pa... | true | true |
1c1858c9d7689d319d6538a4fb00959e350c8bac | 110,817 | py | Python | roles/lib_openshift/library/oc_adm_router.py | umohnani8/openshift-ansible | eac3c3e93c127c3fca341e340368986447fc1d4c | [
"Apache-2.0"
] | null | null | null | roles/lib_openshift/library/oc_adm_router.py | umohnani8/openshift-ansible | eac3c3e93c127c3fca341e340368986447fc1d4c | [
"Apache-2.0"
] | null | null | null | roles/lib_openshift/library/oc_adm_router.py | umohnani8/openshift-ansible | eac3c3e93c127c3fca341e340368986447fc1d4c | [
"Apache-2.0"
] | 1 | 2018-08-16T00:33:07.000Z | 2018-08-16T00:33:07.000Z | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | 34.276833 | 141 | 0.558958 |
from __future__ import print_function
import atexit
import copy
import fcntl
import json
import time
import os
import re
import shutil
import subprocess
import tempfile
try:
import ruamel.yaml as yaml
except ImportError:
import yaml
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
... | true | true |
1c1858ebbae51ef418559aa5a5ec58f77f126058 | 3,460 | py | Python | opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/batcher.py | LetzNico/opentelemetry-python | b565d6b643f175faee3f57ef81c8b7edbf50ec41 | [
"Apache-2.0"
] | null | null | null | opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/batcher.py | LetzNico/opentelemetry-python | b565d6b643f175faee3f57ef81c8b7edbf50ec41 | [
"Apache-2.0"
] | null | null | null | opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/batcher.py | LetzNico/opentelemetry-python | b565d6b643f175faee3f57ef81c8b7edbf50ec41 | [
"Apache-2.0"
] | null | null | null | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.204301 | 109 | 0.676301 |
from typing import Sequence
from opentelemetry.sdk.metrics.export import MetricRecord
from opentelemetry.sdk.util import get_dict_as_key
class Batcher:
def __init__(self, stateful: bool):
self._batch_map = {}
self.stateful = stateful
def checkpoint_set(self)... | true | true |
1c1859622e674271f162681ccfcb54379b484f58 | 178 | py | Python | src/tests/inspect/test_to_schema_name.py | olirice/sqla_ext | 954d0afd33f89be9cc8d8908627678860828910c | [
"MIT"
] | null | null | null | src/tests/inspect/test_to_schema_name.py | olirice/sqla_ext | 954d0afd33f89be9cc8d8908627678860828910c | [
"MIT"
] | null | null | null | src/tests/inspect/test_to_schema_name.py | olirice/sqla_ext | 954d0afd33f89be9cc8d8908627678860828910c | [
"MIT"
] | null | null | null | from sqlalchemy import Table
from sqla_ext.inspect import to_schema_name
def test_to_schema_name(core_table: Table) -> None:
assert to_schema_name(core_table) == "public"
| 22.25 | 51 | 0.792135 | from sqlalchemy import Table
from sqla_ext.inspect import to_schema_name
def test_to_schema_name(core_table: Table) -> None:
assert to_schema_name(core_table) == "public"
| true | true |
1c185a357e6661f88c75535c7f0ef9028d4806e6 | 137 | py | Python | introduction/model_answer/python/06_code_festival_2015.py | AAAR-Salmon/procon | d65865e7c7d98f7194f93610b4f06df8fff3332c | [
"MIT"
] | null | null | null | introduction/model_answer/python/06_code_festival_2015.py | AAAR-Salmon/procon | d65865e7c7d98f7194f93610b4f06df8fff3332c | [
"MIT"
] | null | null | null | introduction/model_answer/python/06_code_festival_2015.py | AAAR-Salmon/procon | d65865e7c7d98f7194f93610b4f06df8fff3332c | [
"MIT"
] | null | null | null | S=input()
# Pythonでは文字列の一部に代入することができません
# 変更したい箇所の前後と変更後の文字列を結合して実現します
# S[-1]はSの最後の文字を表し、S[:-1]はSの最後の文字よりも前の部分を表します
print(S[:-1] + '5')
| 22.833333 | 45 | 0.759124 | S=input()
print(S[:-1] + '5')
| true | true |
1c185b13e777bdef7886ec7645486da1099f03e6 | 1,024 | py | Python | test.py | eXpire163/LaserPi | c637444ab88fb56b5864b0fb38eae8b50d2ae2b1 | [
"MIT"
] | null | null | null | test.py | eXpire163/LaserPi | c637444ab88fb56b5864b0fb38eae8b50d2ae2b1 | [
"MIT"
] | null | null | null | test.py | eXpire163/LaserPi | c637444ab88fb56b5864b0fb38eae8b50d2ae2b1 | [
"MIT"
] | null | null | null | ''' testing python functions without dependencies '''
import time
from _Getch import getch
while True:
KEY_PRESSED = ord(getch.getkey())
if KEY_PRESSED != 45: # if input (if input = '-')
pass
elif KEY_PRESSED == 27: # ESC
exit()
elif KEY_PRESSED == 80: # Down arrow:
print "hi... | 26.25641 | 58 | 0.571289 | ''' testing python functions without dependencies '''
import time
from _Getch import getch
while True:
KEY_PRESSED = ord(getch.getkey())
if KEY_PRESSED != 45: pass
elif KEY_PRESSED == 27: exit()
elif KEY_PRESSED == 80: print "hit down"
elif KEY_PRESSED == 72: pri... | false | true |
1c185b5cddd1aebda66b43fc954b2af0cec5a5f3 | 6,709 | py | Python | academics/SparkML/Assignment03.py | sudhu26/data-science-portfolio | 88f7a350cbd9245e4f92ff1829e49c5d378c609d | [
"MIT"
] | null | null | null | academics/SparkML/Assignment03.py | sudhu26/data-science-portfolio | 88f7a350cbd9245e4f92ff1829e49c5d378c609d | [
"MIT"
] | null | null | null | academics/SparkML/Assignment03.py | sudhu26/data-science-portfolio | 88f7a350cbd9245e4f92ff1829e49c5d378c609d | [
"MIT"
] | 1 | 2021-03-26T11:47:37.000Z | 2021-03-26T11:47:37.000Z | # imports and tools
from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType
import pyspark.sql.functions as f
from pyspark.ml.feature import CountVectorizer
import re
import os
import numpy as np
import operator
import matplotlib.pyplot as plt
# create SparkContext object
spark = SparkSession... | 29.04329 | 196 | 0.631093 | from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType
import pyspark.sql.functions as f
from pyspark.ml.feature import CountVectorizer
import re
import os
import numpy as np
import operator
import matplotlib.pyplot as plt
spark = SparkSession.builder.appName("Assignment_03").getOrCreate()
s... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.