hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
794258f632c9efcfe981265f1e6c3bb9478a5291 | 913 | py | Python | core/mobile_devices/tasks.py | jcaguirre89/django-mobile-app | ca3a178603ba80d846d97bf7b1f8b0cfe259ea53 | [
"MIT"
] | 64 | 2017-10-06T21:56:22.000Z | 2022-03-26T07:35:44.000Z | core/mobile_devices/tasks.py | jcaguirre89/django-mobile-app | ca3a178603ba80d846d97bf7b1f8b0cfe259ea53 | [
"MIT"
] | 5 | 2018-02-16T12:17:35.000Z | 2019-03-28T12:35:54.000Z | core/mobile_devices/tasks.py | jcaguirre89/django-mobile-app | ca3a178603ba80d846d97bf7b1f8b0cfe259ea53 | [
"MIT"
] | 13 | 2017-12-20T21:51:05.000Z | 2021-02-02T18:03:34.000Z | import boto3
import logging
from django.conf import settings
from celery import shared_task
@shared_task
def register_device_on_sns(device):
"""
Registers your device on AWS SNS and attaches the ARN endpoint on the device object.
The ARN endpoint is used when publishing push notifications.
:param devi... | 33.814815 | 114 | 0.714129 |
79425c0a7e0ac0fbc71bf38112a35bf8c87242ae | 10,377 | py | Python | src/local/butler/py_unittest.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/local/butler/py_unittest.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/local/butler/py_unittest.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.735016 | 80 | 0.722078 |
79425ccfd1f75058d331c5d59c095c8d537889f4 | 3,801 | py | Python | blinker-rel-0.8/tests/test_saferef.py | xinnjie/reading_source_code | a0c7965c33849608f1e9eeb6e175cc7a2866006c | [
"MIT"
] | null | null | null | blinker-rel-0.8/tests/test_saferef.py | xinnjie/reading_source_code | a0c7965c33849608f1e9eeb6e175cc7a2866006c | [
"MIT"
] | null | null | null | blinker-rel-0.8/tests/test_saferef.py | xinnjie/reading_source_code | a0c7965c33849608f1e9eeb6e175cc7a2866006c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# extracted from Louie, http://pylouie.org/
# updated for Python 3
#
# Copyright (c) 2006 Patrick K. O'Brien, Mike C. Fletcher,
# Matthew R. Scott
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | 31.675 | 76 | 0.637201 |
79425dd3a6b516ee7f77df48a7408fa785f6bb50 | 220 | py | Python | script/data_handler/DummyDataset.py | demetoir/MLtools | 8c42fcd4cc71728333d9c116ade639fe57d50d37 | [
"MIT"
] | null | null | null | script/data_handler/DummyDataset.py | demetoir/MLtools | 8c42fcd4cc71728333d9c116ade639fe57d50d37 | [
"MIT"
] | null | null | null | script/data_handler/DummyDataset.py | demetoir/MLtools | 8c42fcd4cc71728333d9c116ade639fe57d50d37 | [
"MIT"
] | null | null | null | from script.data_handler.Base.BaseDataset import BaseDataset
class DummyDataset(BaseDataset):
def load(self, path):
pass
def save(self):
pass
def transform(self):
pass
| 16.923077 | 61 | 0.618182 |
79425eaee4e0a674b6eac56fe055f75ab788686d | 5,835 | py | Python | src/data/dataClean.py | ReubenGitHub/MachineLearning-Vehicle-Emissions | 5a6d5366d15cb918de5464c48e0067efceda4149 | [
"Apache-2.0"
] | null | null | null | src/data/dataClean.py | ReubenGitHub/MachineLearning-Vehicle-Emissions | 5a6d5366d15cb918de5464c48e0067efceda4149 | [
"Apache-2.0"
] | null | null | null | src/data/dataClean.py | ReubenGitHub/MachineLearning-Vehicle-Emissions | 5a6d5366d15cb918de5464c48e0067efceda4149 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Reuben Owen-Williams
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law o... | 45.232558 | 186 | 0.696315 |
7942606e49d3a33460e5c37e3f853860b425dc88 | 2,335 | py | Python | library/regenerate_shadow.py | ashithwilson/deepslate | 13e1ce8e5cdcf2df8932387f98fdec55d39345d7 | [
"Unlicense",
"MIT"
] | null | null | null | library/regenerate_shadow.py | ashithwilson/deepslate | 13e1ce8e5cdcf2df8932387f98fdec55d39345d7 | [
"Unlicense",
"MIT"
] | null | null | null | library/regenerate_shadow.py | ashithwilson/deepslate | 13e1ce8e5cdcf2df8932387f98fdec55d39345d7 | [
"Unlicense",
"MIT"
] | null | null | null | #To regenerate missing shadow file enteries: this will re-add missing shadow entries with default values.(customer need to reset the password for the missing emails) Use it only as a final resort
#warning: This will re-add missing sahdow enteries with deafult value.
import os,argparse
import subprocess
from os.path imp... | 35.378788 | 195 | 0.626552 |
7942607698102324d3ff9f7d60cbdcf8ff5560f3 | 1,339 | py | Python | python/rest-client-samples/ocr/ocr_vat_invoice.py | 798000648/ais-sdk | 6831d8fa02143b856481706998a0eb9278da2ccd | [
"Apache-2.0"
] | 1 | 2020-06-06T08:52:47.000Z | 2020-06-06T08:52:47.000Z | python/rest-client-samples/ocr/ocr_vat_invoice.py | 798000648/ais-sdk | 6831d8fa02143b856481706998a0eb9278da2ccd | [
"Apache-2.0"
] | null | null | null | python/rest-client-samples/ocr/ocr_vat_invoice.py | 798000648/ais-sdk | 6831d8fa02143b856481706998a0eb9278da2ccd | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
import urllib2
import json
import ssl
from urllib2 import HTTPError, URLError
#
# access ocr vat invoice
#
def ocr_vat_invoice(token, url):
_url = 'https://ais.cn-north-1.myhuaweicloud.com/v1.0/ocr/vat-invoice'
_data = {
"image":"",
"url":url,
"side":"front"
}
... | 25.75 | 87 | 0.606423 |
794260790bcff798aa15a387de233b603d7cf358 | 3,213 | py | Python | Sprites-Full/Animales/movAnimales.py | alejoso76/Computaci-n-gr-fica | 474a498a328b8951aa0bfa1db2d0d1f3d8cc914b | [
"MIT"
] | null | null | null | Sprites-Full/Animales/movAnimales.py | alejoso76/Computaci-n-gr-fica | 474a498a328b8951aa0bfa1db2d0d1f3d8cc914b | [
"MIT"
] | null | null | null | Sprites-Full/Animales/movAnimales.py | alejoso76/Computaci-n-gr-fica | 474a498a328b8951aa0bfa1db2d0d1f3d8cc914b | [
"MIT"
] | null | null | null | import pygame
import math
ANCHO=640
ALTO=480
def mostrarPos():
pos=pygame.mouse.get_pos()
return pos
if __name__ == '__main__':
pygame.init()
pantalla=pygame.display.set_mode([ANCHO, ALTO]) #Crea la ventana
#Carga la imagen a una variable
fondo=pygame.image.load('animals.png')
infoFondo=f... | 23.625 | 83 | 0.472144 |
794260f71d0968c9aabe4a8ae7e4642663d07bba | 1,172 | py | Python | 04-spark/MaxTemperatures.py | raphaeldeaquino/pos-ia-bd | 112ee6c685cce1234ee732682fad9bd8733c3b29 | [
"Apache-2.0"
] | null | null | null | 04-spark/MaxTemperatures.py | raphaeldeaquino/pos-ia-bd | 112ee6c685cce1234ee732682fad9bd8733c3b29 | [
"Apache-2.0"
] | null | null | null | 04-spark/MaxTemperatures.py | raphaeldeaquino/pos-ia-bd | 112ee6c685cce1234ee732682fad9bd8733c3b29 | [
"Apache-2.0"
] | null | null | null | import findspark
findspark.init()
from pyspark.sql import SparkSession
def parse_line(line):
fields = line.split(',')
station_id = fields[0]
entry_type = fields[2]
temperature = float(fields[3]) * 0.1 * (9.0 / 5.0) + 32.0
return station_id, entry_type, temperature
# Find the maximum temperature... | 27.904762 | 65 | 0.659556 |
794261002360745a1a7384904c6f9efdc2e74445 | 2,267 | py | Python | config/urls.py | Sinha-Ujjawal/django-starter | 042a50c917fa9123dd899cf6aafaf916e23e4521 | [
"MIT"
] | null | null | null | config/urls.py | Sinha-Ujjawal/django-starter | 042a50c917fa9123dd899cf6aafaf916e23e4521 | [
"MIT"
] | null | null | null | config/urls.py | Sinha-Ujjawal/django-starter | 042a50c917fa9123dd899cf6aafaf916e23e4521 | [
"MIT"
] | null | null | null | """your_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 31.054795 | 82 | 0.692545 |
794261ecea91ffdd00c1a5198786b24922fea59b | 4,176 | py | Python | venidium/types/spend_bundle.py | Venidium-Network/venidium-blockchain | 600af545018e2cc03c808315239d57c74cffd57d | [
"Apache-2.0"
] | 7 | 2021-06-29T22:23:55.000Z | 2022-02-09T04:32:46.000Z | venidium/types/spend_bundle.py | Venidium-Network/venidium-blockchain | 600af545018e2cc03c808315239d57c74cffd57d | [
"Apache-2.0"
] | 2 | 2021-09-13T03:23:59.000Z | 2022-01-12T20:20:27.000Z | venidium/types/spend_bundle.py | Venidium-Network/venidium-blockchain | 600af545018e2cc03c808315239d57c74cffd57d | [
"Apache-2.0"
] | null | null | null | import dataclasses
import warnings
from dataclasses import dataclass
from typing import List
from blspy import AugSchemeMPL, G2Element
from venidium.consensus.default_constants import DEFAULT_CONSTANTS
from venidium.types.blockchain_format.coin import Coin
from venidium.types.blockchain_format.sized_bytes import byt... | 37.963636 | 115 | 0.688218 |
7942626d8c83fb226f9701569741c2ca19a8f0dc | 666 | py | Python | manage.py | cebanauskes/ida_images | 708eb44274b28d53f9b0422fbf3711d85ac62a6b | [
"MIT"
] | null | null | null | manage.py | cebanauskes/ida_images | 708eb44274b28d53f9b0422fbf3711d85ac62a6b | [
"MIT"
] | null | null | null | manage.py | cebanauskes/ida_images | 708eb44274b28d53f9b0422fbf3711d85ac62a6b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ida_images.settings')
try:
from django.core.management import execute_from_command_line
except I... | 28.956522 | 74 | 0.68018 |
7942634272079fc9638d55a79f254b5e7ffb0c86 | 14,972 | py | Python | djangae/db/backends/appengine/indexing.py | martinogden/djangae | 22610a636556c98a68200ebbeb6f1f57da42d617 | [
"BSD-3-Clause"
] | null | null | null | djangae/db/backends/appengine/indexing.py | martinogden/djangae | 22610a636556c98a68200ebbeb6f1f57da42d617 | [
"BSD-3-Clause"
] | null | null | null | djangae/db/backends/appengine/indexing.py | martinogden/djangae | 22610a636556c98a68200ebbeb6f1f57da42d617 | [
"BSD-3-Clause"
] | null | null | null | import logging
import yaml
import os
import datetime
import re
from djangae.sandbox import allow_mode_write
from django.conf import settings
_special_indexes = {}
_last_loaded_time = None
MAX_COLUMNS_PER_SPECIAL_INDEX = getattr(settings, "DJANGAE_MAX_COLUMNS_PER_SPECIAL_INDEX", 3)
CHARACTERS_PER_COLUMN = [31, 44, 54... | 32.689956 | 148 | 0.661435 |
7942635ae16530fe848af3ddbf212ce93ea61086 | 853 | py | Python | quickstartup/qs_pages/models.py | shahabaz/quickstartup | e351138580d3b332aa309d5d98d562a1ebef5c2c | [
"MIT"
] | 13 | 2015-06-10T03:29:15.000Z | 2021-10-01T22:06:48.000Z | quickstartup/qs_pages/models.py | shahabaz/quickstartup | e351138580d3b332aa309d5d98d562a1ebef5c2c | [
"MIT"
] | 47 | 2015-06-10T03:26:18.000Z | 2021-09-22T17:35:24.000Z | quickstartup/qs_pages/models.py | shahabaz/quickstartup | e351138580d3b332aa309d5d98d562a1ebef5c2c | [
"MIT"
] | 3 | 2015-07-07T23:55:39.000Z | 2020-04-18T10:34:53.000Z | from django.db import models
from django.template import loader
from django.utils.translation import gettext_lazy as _
class Page(models.Model):
slug = models.SlugField(max_length=255, blank=True, unique=True, db_index=True,
help_text=_("URL Path. Example: about for /about/"))
temp... | 30.464286 | 115 | 0.675264 |
7942637a79580286b2f7d45b6ad6cab483ba70f3 | 674 | py | Python | retinaface/pre_trained_models.py | LiveFly/retinaface | 939ae81bbf4ae9333fa14743962dcf99d8db1840 | [
"MIT"
] | 1 | 2020-11-05T11:20:16.000Z | 2020-11-05T11:20:16.000Z | retinaface/pre_trained_models.py | LiveFly/retinaface | 939ae81bbf4ae9333fa14743962dcf99d8db1840 | [
"MIT"
] | null | null | null | retinaface/pre_trained_models.py | LiveFly/retinaface | 939ae81bbf4ae9333fa14743962dcf99d8db1840 | [
"MIT"
] | null | null | null | from collections import namedtuple
from torch.utils import model_zoo
from retinaface.predict_single import Model
model = namedtuple("model", ["url", "model"])
models = {
"resnet50_2020-07-20": model(
url="https://github.com/ternaus/retinaface/releases/download/0.01/retinaface_resnet50_2020-07-20-f168fae... | 28.083333 | 134 | 0.722552 |
794263b863b93679c3d1a78a91ae69bbc5fad4b9 | 1,874 | py | Python | caproto/tests/test_create_many_channels.py | mattclarke/caproto | 4c3912cfde270f90f75f8c8ee5868e9da1a5095a | [
"BSD-3-Clause"
] | 4 | 2017-02-06T17:46:50.000Z | 2017-04-28T18:08:23.000Z | caproto/tests/test_create_many_channels.py | mattclarke/caproto | 4c3912cfde270f90f75f8c8ee5868e9da1a5095a | [
"BSD-3-Clause"
] | 65 | 2017-02-11T17:23:23.000Z | 2018-03-14T00:03:11.000Z | caproto/tests/test_create_many_channels.py | mattclarke/caproto | 4c3912cfde270f90f75f8c8ee5868e9da1a5095a | [
"BSD-3-Clause"
] | 2 | 2017-02-11T04:21:55.000Z | 2017-03-08T18:47:23.000Z | import logging
import pytest
import curio
import caproto as ca
from .conftest import default_setup_module as setup_module # noqa
from .conftest import default_teardown_module as teardown_module # noqa
from . import conftest
@pytest.mark.parametrize('backend', ['curio', 'trio'])
def test_create_many_channels(ioc, b... | 35.358491 | 76 | 0.645678 |
794263de5d51313dcc44eb9c8469f00dbf079907 | 4,242 | py | Python | src/emotion/utils/file_reading.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | null | null | null | src/emotion/utils/file_reading.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | 2 | 2021-07-28T10:38:03.000Z | 2021-07-31T10:37:09.000Z | src/emotion/utils/file_reading.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | null | null | null | __author__ = "Maximilian Wegge"
import random, json, copy
class Data:
"""The Data object stores the unaltered data from a file
and performs preprocessing steps such as splitting into
subsets and converting the annotations' format.
"""
def __init__(
self,
filename: str,
ro... | 36.568966 | 91 | 0.537011 |
794264835aaf13d9ef67f64a411711bd736edc8e | 5,065 | py | Python | broqer/op/filter_.py | semiversus/python-broqer | 131a78b4e475c4134bc32e035b833c8b162cdff2 | [
"MIT"
] | 74 | 2018-04-13T11:29:16.000Z | 2021-05-08T17:55:13.000Z | broqer/op/filter_.py | semiversus/python-broqer | 131a78b4e475c4134bc32e035b833c8b162cdff2 | [
"MIT"
] | 36 | 2018-06-13T04:00:12.000Z | 2022-03-01T12:13:38.000Z | broqer/op/filter_.py | semiversus/python-broqer | 131a78b4e475c4134bc32e035b833c8b162cdff2 | [
"MIT"
] | 6 | 2019-04-17T17:33:11.000Z | 2021-05-08T17:55:32.000Z | """
Filters values based on a ``predicate`` function
Usage:
>>> from broqer import Value, op, Sink
>>> s = Value()
>>> filtered_publisher = s | op.Filter(lambda v:v>0)
>>> _disposable = filtered_publisher.subscribe(Sink(print))
>>> s.emit(1)
1
>>> s.emit(-1)
>>> s.emit(0)
>>> _disposable.dispose()
Also possible wi... | 28.455056 | 79 | 0.630405 |
7942649ac9d35aaa97e88de5fd8c110df328853b | 1,565 | py | Python | core-site/other-pages/blog-posts/0-projects/calendar-this-solution/calendar-this/solution/app/forms.py | Web-Dev-Collaborative/Web-Dev-Hub | 16ad7cfbeb97b31c8510605033b91d75b63e527e | [
"MIT"
] | null | null | null | core-site/other-pages/blog-posts/0-projects/calendar-this-solution/calendar-this/solution/app/forms.py | Web-Dev-Collaborative/Web-Dev-Hub | 16ad7cfbeb97b31c8510605033b91d75b63e527e | [
"MIT"
] | null | null | null | core-site/other-pages/blog-posts/0-projects/calendar-this-solution/calendar-this/solution/app/forms.py | Web-Dev-Collaborative/Web-Dev-Hub | 16ad7cfbeb97b31c8510605033b91d75b63e527e | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from flask_wtf import FlaskForm
from wtforms.fields import (
BooleanField, DateField, StringField, SubmitField, TextAreaField, TimeField
)
from wtforms.widgets.html5 import DateInput, TimeInput
from wtforms.validators import DataRequired, ValidationError
def next_block(del... | 36.395349 | 79 | 0.664537 |
79426548ebb9e0ea87ddacefe3c8bcc87ddadd63 | 12,426 | py | Python | src/config/fabric-ansible/ansible-playbooks/filter_plugins/ztp_filters.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/fabric-ansible/ansible-playbooks/filter_plugins/ztp_filters.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/fabric-ansible/ansible-playbooks/filter_plugins/ztp_filters.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 1 | 2020-12-18T18:22:53.000Z | 2020-12-18T18:22:53.000Z | #!/usr/bin/python
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
# This file contains code to gather IPAM config from the fabric management
# virtual network
#
from builtins import object
import logging
import time
from cfgm_common.exceptions import NoIdError
from netaddr import IPNetwork
from ... | 40.875 | 79 | 0.580235 |
794265ab97d7e3b84a214322bf4f6d471b577fca | 1,972 | py | Python | docs/conf.py | robarnold/bastille | 38bb7faabf7f69051a9c088c17189c60769b07d7 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | robarnold/bastille | 38bb7faabf7f69051a9c088c17189c60769b07d7 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | robarnold/bastille | 38bb7faabf7f69051a9c088c17189c60769b07d7 | [
"BSD-3-Clause"
] | null | null | null | import os
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
html_theme = 'default'
else:
html_theme = 'sphinx_rtd_theme'
# -- Project information -----------------------------------------------------
project = 'Bastille'
copyright = '2018-2021, Christer Edwards'
author = 'Christer Edwards'
# The sh... | 24.65 | 144 | 0.564909 |
79426813e38fee68b9399a293ff47b1c3e4c1f56 | 6,712 | py | Python | sqlserver_ado/ado_consts.py | BangC/django-mssql | 998c7a0c94f2906bc79f6cf8b74a5a53420f3714 | [
"MIT"
] | null | null | null | sqlserver_ado/ado_consts.py | BangC/django-mssql | 998c7a0c94f2906bc79f6cf8b74a5a53420f3714 | [
"MIT"
] | null | null | null | sqlserver_ado/ado_consts.py | BangC/django-mssql | 998c7a0c94f2906bc79f6cf8b74a5a53420f3714 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# ADO enumerated constants documented on MSDN:
# http://msdn.microsoft.com/en-us/library/ms678353(VS.85).aspx
# IsolationLevelEnum
adXactUnspecified = -1
adXactBrowse = 0x100
adXactChaos = 0x10
adXactCursorStability = 0x1000
adXactIsolated = 0x1000... | 30.930876 | 72 | 0.601162 |
794268b1de1fd7e835c35f815b48bbc86df1aedc | 16,337 | py | Python | pymavlink-2.3.8/generator/mavgen_wlua.py | NicEscobar/InertialNavigation | 85dffed6cf5c4063a097c3c9305f4ec92ce53623 | [
"MIT"
] | 10 | 2021-03-15T03:58:06.000Z | 2021-12-30T15:33:38.000Z | pymavlink-2.3.8/generator/mavgen_wlua.py | NicEscobar/InertialNavigation | 85dffed6cf5c4063a097c3c9305f4ec92ce53623 | [
"MIT"
] | 4 | 2021-05-03T16:58:53.000Z | 2021-12-21T21:01:02.000Z | pymavlink-2.3.8/generator/mavgen_wlua.py | NicEscobar/InertialNavigation | 85dffed6cf5c4063a097c3c9305f4ec92ce53623 | [
"MIT"
] | 9 | 2021-04-28T15:26:34.000Z | 2021-12-21T20:41:30.000Z | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a Wireshark LUA dissector
Copyright Holger Steinhaus 2012
Released under GNU GPL version 3 or later
Instructions for use:
1. python -m pymavlink.tools.mavgen --lang=WLua mymavlink.xml -o ~/.wireshark/plugins/mymavlink.lua
2. convert binary stre... | 32.543825 | 139 | 0.565587 |
794269026da92ff690a3e57a3e3ff56b30943a3c | 4,070 | py | Python | bot.py | peterkagey/OEISbot | b2b5abe82f74aa331d7cc9fd6a7531617136a5c5 | [
"MIT"
] | null | null | null | bot.py | peterkagey/OEISbot | b2b5abe82f74aa331d7cc9fd6a7531617136a5c5 | [
"MIT"
] | null | null | null | bot.py | peterkagey/OEISbot | b2b5abe82f74aa331d7cc9fd6a7531617136a5c5 | [
"MIT"
] | null | null | null | from __future__ import print_function
import praw
import re
import urllib.request
import json
from praw.models import MoreComments
import sys
test = False
if len(sys.argv) > 1 and sys.argv[1] == "test":
test=True
print("TEST MODE")
class FoundOne(BaseException):
pass
def read_url(url):
with urllib.r... | 29.708029 | 93 | 0.58059 |
79426a5401f8ed89449902b829e52830c67edc03 | 1,206 | py | Python | setup.py | kozakHolota/pytest-html-reporter | 29aea2297a1613d3d2be1cfe54500473add8bd01 | [
"MIT"
] | null | null | null | setup.py | kozakHolota/pytest-html-reporter | 29aea2297a1613d3d2be1cfe54500473add8bd01 | [
"MIT"
] | null | null | null | setup.py | kozakHolota/pytest-html-reporter | 29aea2297a1613d3d2be1cfe54500473add8bd01 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup, find_packages
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding="utf-8").read()
setup(
name="pytest-html-reporter",
version="0.2.9",
... | 28.714286 | 75 | 0.640133 |
79426aba52983da561bfc17d3be6a7224fdd7fd8 | 14,231 | py | Python | artifacts/old_dataset_versions/minimal_commits_v02/pennylane/pennylane#481_B/before/_qubit_device.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | 3 | 2021-11-08T11:46:42.000Z | 2021-12-27T10:13:38.000Z | artifacts/old_dataset_versions/minimal_commits/pennylane/pennylane#481/before/_qubit_device.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | 2 | 2021-11-09T14:57:09.000Z | 2022-01-12T12:35:58.000Z | artifacts/old_dataset_versions/original_commits_v02/pennylane/pennylane#481_B/before/_qubit_device.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | null | null | null | # Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 36.963636 | 104 | 0.651676 |
79426bd58c427c8e4f0fd50831915065d3dfb32e | 18,336 | py | Python | discovery-provider/src/eth_indexing/event_scanner.py | atticwip/audius-protocol | 9758e849fae01508fa1d27675741228b11533e6e | [
"Apache-2.0"
] | 4 | 2021-12-24T14:16:05.000Z | 2022-01-13T22:41:33.000Z | discovery-provider/src/eth_indexing/event_scanner.py | SNOmad1/audius-protocol | 3d5fc2bf688265eb529060f1f3234ef2b95ed231 | [
"Apache-2.0"
] | null | null | null | discovery-provider/src/eth_indexing/event_scanner.py | SNOmad1/audius-protocol | 3d5fc2bf688265eb529060f1f3234ef2b95ed231 | [
"Apache-2.0"
] | null | null | null | import datetime
import time
import logging
from typing import Tuple, Iterable, Union, Type, TypedDict, Any
from sqlalchemy import or_
from web3 import Web3
from web3.contract import Contract, ContractEvent
from web3.exceptions import BlockNotFound
from web3.types import BlockIdentifier
# Currently this method is not ... | 40.476821 | 176 | 0.660013 |
79426c4fbdda41af4238f10987aa941ddb5f7585 | 3,846 | py | Python | src/virtual_io_server/volume_group/ModifyVolumeGroup.py | Niraj-Shah-1/HmcRestClient-1.0 | 529002588cd9bf5313f1c8ed2948ab96e648d45c | [
"Apache-2.0"
] | 21 | 2015-04-23T06:26:20.000Z | 2022-03-23T16:16:32.000Z | src/virtual_io_server/volume_group/ModifyVolumeGroup.py | Niraj-Shah-1/HmcRestClient-1.0 | 529002588cd9bf5313f1c8ed2948ab96e648d45c | [
"Apache-2.0"
] | 7 | 2015-06-17T15:13:15.000Z | 2020-09-18T00:47:04.000Z | src/virtual_io_server/volume_group/ModifyVolumeGroup.py | Niraj-Shah-1/HmcRestClient-1.0 | 529002588cd9bf5313f1c8ed2948ab96e648d45c | [
"Apache-2.0"
] | 13 | 2015-06-17T09:48:20.000Z | 2021-03-15T12:09:22.000Z | # Copyright 2015, 2016 IBM Corp.
#
# 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 require... | 41.804348 | 115 | 0.674207 |
79426daf099d673a1f5a3cc3e136325015387acb | 1,500 | py | Python | app/recipe/serializers.py | theonlysam/recipe-app-api | bb840796dc9b5a9760fd6e2c29e2ae3a0a26e92e | [
"MIT"
] | null | null | null | app/recipe/serializers.py | theonlysam/recipe-app-api | bb840796dc9b5a9760fd6e2c29e2ae3a0a26e92e | [
"MIT"
] | null | null | null | app/recipe/serializers.py | theonlysam/recipe-app-api | bb840796dc9b5a9760fd6e2c29e2ae3a0a26e92e | [
"MIT"
] | null | null | null | from rest_framework import serializers
from core.models import Tag, Ingredient, Recipe
class TagSerializer(serializers.ModelSerializer):
"""
Serializer for tag objects
"""
class Meta:
model = Tag
fields = ('id', 'name')
read_only_fields = ('id',)
class IngredientSerializer(s... | 23.4375 | 65 | 0.623333 |
79426e030fd5a5dc8b650b319715cdd0ee9e46fc | 4,835 | py | Python | chatterbot/logic/logic_adapter.py | ingeniousambivert/chatbot | fb1d9659df6c1b6eddd8ee9349f5a65a0530db2a | [
"BSD-3-Clause"
] | null | null | null | chatterbot/logic/logic_adapter.py | ingeniousambivert/chatbot | fb1d9659df6c1b6eddd8ee9349f5a65a0530db2a | [
"BSD-3-Clause"
] | null | null | null | chatterbot/logic/logic_adapter.py | ingeniousambivert/chatbot | fb1d9659df6c1b6eddd8ee9349f5a65a0530db2a | [
"BSD-3-Clause"
] | null | null | null | from chatterbot.adapters import Adapter
from chatterbot.storage import StorageAdapter
from chatterbot.search import IndexedTextSearch
from chatterbot.conversation import Statement
class LogicAdapter(Adapter):
"""
This is an abstract class that represents the interface
that all logic adapters shou... | 36.08209 | 102 | 0.651706 |
79426e0bbe7e4fc0ed0f4a115ae78da0882a3752 | 25,924 | py | Python | MappingGlobalCarbon/gfw_forestlearn/fl_regression.py | forc-db/GROA | a316bd6c70d02a8904a19fc554747acfadbae0c1 | [
"CC-BY-4.0"
] | 20 | 2020-09-27T07:37:19.000Z | 2022-02-19T13:26:47.000Z | MappingGlobalCarbon/gfw_forestlearn/fl_regression.py | forc-db/GROA | a316bd6c70d02a8904a19fc554747acfadbae0c1 | [
"CC-BY-4.0"
] | 2 | 2020-09-18T11:08:37.000Z | 2021-03-25T11:16:22.000Z | MappingGlobalCarbon/gfw_forestlearn/fl_regression.py | forc-db/GROA | a316bd6c70d02a8904a19fc554747acfadbae0c1 | [
"CC-BY-4.0"
] | 9 | 2020-11-12T01:49:16.000Z | 2022-02-22T00:54:02.000Z | import subprocess
import gdal
import pandas as pd
import numpy as np
import glob
import rasterio
import os
import datetime
import csv
import random
from math import sqrt
import pickle
import math
import datetime
import warnings
from shutil import copyfile
import csv
import sys
import math
import shutil
from sklearn.mo... | 41.611557 | 160 | 0.627951 |
79426e7e57840738d65686499b55b8e7f573e7e6 | 1,573 | py | Python | src-django/api/migrations/0026_auto_20180313_2240.py | m-socha/sana.protocol_builder | 7b054bbab5ed981bd7bbc357e9657024f3e380e7 | [
"BSD-3-Clause"
] | 6 | 2015-06-05T22:41:10.000Z | 2017-09-06T07:08:09.000Z | src-django/api/migrations/0026_auto_20180313_2240.py | SanaMobile/sana.protocol_builder | e7e784797bf7b3a3060329f033fca5f411ebcc97 | [
"BSD-3-Clause"
] | 406 | 2015-01-11T05:50:07.000Z | 2018-01-05T23:01:04.000Z | src-django/api/migrations/0026_auto_20180313_2240.py | m-socha/sana.protocol_builder | 7b054bbab5ed981bd7bbc357e9657024f3e380e7 | [
"BSD-3-Clause"
] | 9 | 2015-10-12T23:39:31.000Z | 2018-07-11T20:59:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2018-03-13 22:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('api', '0025_merge'),
]
operations = [
... | 36.581395 | 146 | 0.599491 |
79426ef5e49711f4547366c45ab2ad709983f8d1 | 2,687 | py | Python | workflow/plot_all_cartels.py | calltri/journal-citation-cartels | 2c7967eccb4783f136f8da47d417a0fe9e625c2a | [
"BSD-2-Clause"
] | null | null | null | workflow/plot_all_cartels.py | calltri/journal-citation-cartels | 2c7967eccb4783f136f8da47d417a0fe9e625c2a | [
"BSD-2-Clause"
] | null | null | null | workflow/plot_all_cartels.py | calltri/journal-citation-cartels | 2c7967eccb4783f136f8da47d417a0fe9e625c2a | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import pandas as pd
import utils
from scipy import sparse
import matplotlib.pyplot as plt
import seaborn as sns
import sys
import matplotlib.colors as colors
from matplotlib import cm
import os
sys.path.append(os.path.abspath(os.path.join("libs/cidre")))
from cidre import cidre, filters, draw
def l... | 31.244186 | 169 | 0.633048 |
7942721871d37e7572cda011766f4c262ee7123f | 2,077 | py | Python | resources/fred/evaluator.py | zeroshot-ts/zeroshot-ts | 177039565c3729dec0c25e8830c366c069b32ead | [
"Apache-2.0"
] | null | null | null | resources/fred/evaluator.py | zeroshot-ts/zeroshot-ts | 177039565c3729dec0c25e8830c366c069b32ead | [
"Apache-2.0"
] | null | null | null | resources/fred/evaluator.py | zeroshot-ts/zeroshot-ts | 177039565c3729dec0c25e8830c366c069b32ead | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from collections import OrderedDict
from dataclasses import dataclass
import numpy as np
from common.evaluator import Evaluator, EvaluationResult
from common.metrics import smape_2
from common.timeseries import TimeseriesBundle
from common.utils import round_half_up
from resources.... | 37.763636 | 110 | 0.690419 |
79427296b2f1b12c30bfc7fd806b65648fe061d2 | 22,792 | py | Python | src/genie/libs/parser/iosxe/show_lldp.py | ngrundler/genieparser | a78dfde72042744d4ea559f87cb014821d9a305a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/show_lldp.py | ngrundler/genieparser | a78dfde72042744d4ea559f87cb014821d9a305a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/show_lldp.py | ngrundler/genieparser | a78dfde72042744d4ea559f87cb014821d9a305a | [
"Apache-2.0"
] | null | null | null | """show_lldp.py
supported commands:
* show lldp
* show lldp entry *
* show lldp entry [<WORD>]
* show lldp interface [<WORD>]
* show lldp neighbors detail
* show lldp traffic
"""
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Sche... | 36.063291 | 117 | 0.478282 |
794273ed9dcb4fbaa257e3b10cd126bda79258d9 | 935 | py | Python | datastructure/practice/c7/c_7_37.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | datastructure/practice/c7/c_7_37.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | datastructure/practice/c7/c_7_37.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | import unittest
from datastructure.links.PositionList import PositionList
def has_sum_equals(position_list, V):
if position_list.is_empty():
return None
sum_dict = {}
current = position_list.first()
while current is not None:
if current.element() in sum_dict:
return sum_d... | 26.714286 | 67 | 0.673797 |
794275121810a83919f3894fcb094ff16cfdf2e1 | 1,074 | bzl | Python | nisaba/scripts/brahmic/constant.bzl | google-research/nisaba | 41cfe4390b421ecfb26b351a6b36d85dfb7ba153 | [
"Apache-2.0"
] | 16 | 2020-12-03T22:45:18.000Z | 2022-01-21T07:28:35.000Z | nisaba/scripts/brahmic/constant.bzl | google-research/nisaba | 41cfe4390b421ecfb26b351a6b36d85dfb7ba153 | [
"Apache-2.0"
] | 9 | 2021-02-19T19:50:21.000Z | 2021-09-01T21:06:26.000Z | nisaba/scripts/brahmic/constant.bzl | google-research/nisaba | 41cfe4390b421ecfb26b351a6b36d85dfb7ba153 | [
"Apache-2.0"
] | 2 | 2021-11-05T14:49:41.000Z | 2022-01-29T18:27:54.000Z | # Copyright 2021 Nisaba 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 writi... | 22.851064 | 74 | 0.648045 |
794275be32255d7dc0de4facc367bd4115a900ed | 3,074 | py | Python | recipes/Python/578203_pygmail_can_send_mail/recipe-578203.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/578203_pygmail_can_send_mail/recipe-578203.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/578203_pygmail_can_send_mail/recipe-578203.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 9 20:57:29 2012
@author: garrett
@email: cloudform511@gmail.com
original pygmail from:
https://github.com/vinod85/pygmail/blob/master/pygmail.py
"""
import imaplib, smtplib
import re
from email.mime.text import MIMEText
class pygmail(object):
IMAP_SERVER=... | 29.84466 | 85 | 0.614509 |
79427603c2774214d29eb900cd10e1c722b9f4fd | 1,627 | py | Python | mli/server.py | m-pilia/mli | 2e351cd98dbc9e689e252b823bb2ba63ac028716 | [
"MIT"
] | 1 | 2020-04-14T13:05:42.000Z | 2020-04-14T13:05:42.000Z | mli/server.py | m-pilia/mli | 2e351cd98dbc9e689e252b823bb2ba63ac028716 | [
"MIT"
] | 1 | 2020-04-14T19:08:22.000Z | 2020-04-14T19:08:22.000Z | mli/server.py | m-pilia/mli | 2e351cd98dbc9e689e252b823bb2ba63ac028716 | [
"MIT"
] | null | null | null | import json
import logging
import socket
import sys
import threading
import matlab.engine
from .mlsession import MLSession
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
class _ML_JSON_Encoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, matlab.engine.Futur... | 29.581818 | 88 | 0.617087 |
794276ed9c52c42667f5f048710c55d9de9dfd0a | 3,789 | py | Python | src/app/tests/mailchimp/tests_mailchimp_http.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 151 | 2020-04-21T09:58:57.000Z | 2021-09-12T09:01:21.000Z | src/app/tests/mailchimp/tests_mailchimp_http.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 163 | 2020-05-29T20:52:00.000Z | 2021-09-11T12:44:56.000Z | src/app/tests/mailchimp/tests_mailchimp_http.py | boochamoocha/education-backend | c6ffb0c00bc066c8f1e0a8c0ffe4d0215c7c416a | [
"MIT"
] | 39 | 2020-04-21T12:28:16.000Z | 2021-09-12T15:33:47.000Z | import pytest
from app.integrations.mailchimp.exceptions import MailchimpNotFound, MailchimpWrongResponse
pytestmark = [pytest.mark.django_db]
def test_get_ok(mailchimp):
mailchimp.http_mock.get('https://us05.api.mailchimp.com/3.0/test/endpoint', json={'ok': True})
assert mailchimp.http.get('test/endpoint'... | 31.840336 | 117 | 0.705199 |
79427742646a548f413048bbcf24e1c596ca5f84 | 2,108 | py | Python | vision/body_analysis/ultraface/demo.py | mbencer/models | fb8271d5d5d9b90dbb1eb5e8e40f8f580fb248b3 | [
"MIT"
] | 1 | 2021-01-22T03:24:38.000Z | 2021-01-22T03:24:38.000Z | vision/body_analysis/ultraface/demo.py | mbencer/models | fb8271d5d5d9b90dbb1eb5e8e40f8f580fb248b3 | [
"MIT"
] | null | null | null | vision/body_analysis/ultraface/demo.py | mbencer/models | fb8271d5d5d9b90dbb1eb5e8e40f8f580fb248b3 | [
"MIT"
] | null | null | null | import cv2
import onnxruntime as ort
import argparse
import numpy as np
from dependencies.box_utils import predict
# ------------------------------------------------------------------------------------------------------------------------------------------------
# Face detection using UltraFace-320 onnx model
face_dete... | 35.133333 | 146 | 0.588235 |
79427a245390294b40e56cd6f9de84794f6ef58f | 2,645 | py | Python | gpytorch/settings.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/settings.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/settings.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | class _feature_flag(object):
_state = False
@classmethod
def on(cls):
return cls._state
@classmethod
def _set_state(cls, state):
cls._state = state
def __init__(self, state=True):
self.prev = self.__class__.on()
self.state = state
def __enter__(self):
... | 26.188119 | 101 | 0.691871 |
79427a54d575585bb232ccdef6691b5c7ca36eca | 27,055 | py | Python | sphinx_toolbox/more_autodoc/regex.py | domdfcoding/sphinx-toolbox | fe5a35d6b4fce617514c4c243ad94fb8bd86b0bf | [
"MIT"
] | 1 | 2020-09-27T15:37:27.000Z | 2020-09-27T15:37:27.000Z | sphinx_toolbox/more_autodoc/regex.py | domdfcoding/sphinx-toolbox | fe5a35d6b4fce617514c4c243ad94fb8bd86b0bf | [
"MIT"
] | 4 | 2020-08-25T19:01:19.000Z | 2020-12-11T16:58:07.000Z | sphinx_toolbox/more_autodoc/regex.py | domdfcoding/sphinx-toolbox | fe5a35d6b4fce617514c4c243ad94fb8bd86b0bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# regex.py
r"""
Specialized Documenter for regular expression variables, similar to :rst:dir:`autodata`.
.. versionadded:: 1.2.0
.. extensions:: sphinx_toolbox.more_autodoc.regex
Usage
-------
.. rst:directive:: autoregex
Directive to automatically document a regular expression variable.
... | 30.884703 | 124 | 0.69854 |
79427a885417c92efe763249ac490326d737d769 | 1,027 | py | Python | 14_exception/08_except_info.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 14_exception/08_except_info.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 14_exception/08_except_info.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | #! /root/anaconda3/bin/python
"""
标准库模块sys中的函数exc_info以获取异常的相关信息
异常的类型: <class 'ZeroDivisionError'>
异常的错误信息:division by zero
异常调用堆栈的跟踪信息:<traceback object at 0x7f689cbf5180>
提取Traceback对象中包含的信息,调用标准库traceback中的函数extract_tb()
[<FrameSummary file ./08_except_info.py, line 11 in f2>, <FrameSummary file ./08_except_in... | 19.377358 | 111 | 0.638754 |
79427b041f818bbdb52d9c92f760eaed786e95fd | 4,763 | py | Python | protoc_gen_swagger/options/annotations_pb2.py | universe-proton/protoc-gen-swagger | b572618d0aadcef63224bf85ebba05270b573a53 | [
"Apache-2.0"
] | 5 | 2018-01-29T12:55:41.000Z | 2020-05-27T09:10:33.000Z | protoc_gen_swagger/options/annotations_pb2.py | universe-proton/protoc-gen-swagger | b572618d0aadcef63224bf85ebba05270b573a53 | [
"Apache-2.0"
] | null | null | null | protoc_gen_swagger/options/annotations_pb2.py | universe-proton/protoc-gen-swagger | b572618d0aadcef63224bf85ebba05270b573a53 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protoc-gen-swagger/options/annotations.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.proto... | 59.5375 | 828 | 0.847995 |
79427b2c2339273f0918226289626cde98784e6c | 22,822 | py | Python | test_data/samples/sqlalchemy_base_output.py | jgberry/ssort | 65c4b0a1f2e9e93e65855967f9a438046b24d9e1 | [
"MIT"
] | null | null | null | test_data/samples/sqlalchemy_base_output.py | jgberry/ssort | 65c4b0a1f2e9e93e65855967f9a438046b24d9e1 | [
"MIT"
] | null | null | null | test_data/samples/sqlalchemy_base_output.py | jgberry/ssort | 65c4b0a1f2e9e93e65855967f9a438046b24d9e1 | [
"MIT"
] | null | null | null | # Taken from SQLAlchemy
# sql/base.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
#
# Permission is hereby granted, free of charge, to any person ... | 32.696275 | 78 | 0.62225 |
79427b8aa41aad4eba456c91c479ab0a9aae64dd | 858 | py | Python | tests/test_add_contact.py | leanor13/python_training | 0e933a35f0829ee5775158049d5d252fdc54a054 | [
"Apache-2.0"
] | null | null | null | tests/test_add_contact.py | leanor13/python_training | 0e933a35f0829ee5775158049d5d252fdc54a054 | [
"Apache-2.0"
] | null | null | null | tests/test_add_contact.py | leanor13/python_training | 0e933a35f0829ee5775158049d5d252fdc54a054 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
import re
def test_contact_creation(app, db, json_contacts, check_ui):
contact = json_contacts
old_contacts = db.get_contact_list()
app.contact.create(contact)
new_contacts = db.get_contact_list()
old_contacts.append(contact)
assert sor... | 39 | 107 | 0.681818 |
79427c369f7da1ddfbe00ae2bcb867cb1ee93881 | 3,406 | py | Python | env/Lib/site-packages/plotly/graph_objs/histogram2d/_marker.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | packages/python/plotly/plotly/graph_objs/histogram2d/_marker.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | 14 | 2021-10-20T23:33:47.000Z | 2021-12-21T04:50:37.000Z | packages/python/plotly/plotly/graph_objs/histogram2d/_marker.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | 1 | 2021-11-29T22:55:05.000Z | 2021-11-29T22:55:05.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram2d"
_path_str = "histogram2d.marker"
_valid_props = {"color", "colorsrc"}
# co... | 26.2 | 82 | 0.521726 |
79427c81f654f0c7776ef35323f6a43d8019d898 | 8,869 | py | Python | code/test/02_processing_bootstrapping.py | data-intelligence-for-health-lab/delirium_prediction | a0a25819ef6c98e32563b4e3b986c1a26fc30ed7 | [
"MIT"
] | null | null | null | code/test/02_processing_bootstrapping.py | data-intelligence-for-health-lab/delirium_prediction | a0a25819ef6c98e32563b4e3b986c1a26fc30ed7 | [
"MIT"
] | null | null | null | code/test/02_processing_bootstrapping.py | data-intelligence-for-health-lab/delirium_prediction | a0a25819ef6c98e32563b4e3b986c1a26fc30ed7 | [
"MIT"
] | null | null | null |
# --- loading libraries -------------------------------------------------------
import numpy as np
import pandas as pd
import pickle
import tensorflow as tf
import random
from sklearn.metrics import confusion_matrix, f1_score, precision_score, recall_score, roc_auc_score, auc, precision_recall_curve
import sys
# ----... | 42.233333 | 138 | 0.526553 |
79427d4aa9d24eb5fc484fd7a5de05e891fc7c88 | 3,787 | py | Python | code/node2vec.py | CLAIRE-COVID-T4/covid-data | ccdf1397b945b63e95768a7b91f0a7bad6e5085d | [
"CC-BY-4.0"
] | 4 | 2020-05-17T21:29:19.000Z | 2021-08-09T00:59:29.000Z | code/node2vec.py | CLAIRE-COVID-T4/covid-data | ccdf1397b945b63e95768a7b91f0a7bad6e5085d | [
"CC-BY-4.0"
] | null | null | null | code/node2vec.py | CLAIRE-COVID-T4/covid-data | ccdf1397b945b63e95768a7b91f0a7bad6e5085d | [
"CC-BY-4.0"
] | null | null | null | """ Taken from https://github.com/aditya-grover/node2vec and adapted to run on Python 3+"""
import numpy as np
import networkx as nx
import random
class Graph():
def __init__(self, nx_G, is_directed, p, q):
self.G = nx_G
self.is_directed = is_directed
self.p = p
self.q = q
def node2vec_walk(self, walk_leng... | 25.246667 | 120 | 0.670452 |
79427dca3c20f750423b33788aec901c8cdb3529 | 1,582 | py | Python | extraPackages/Pillow-6.0.0/Tests/bench_cffi_access.py | dolboBobo/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 130 | 2018-02-03T10:25:54.000Z | 2022-03-25T22:27:22.000Z | extraPackages/Pillow-6.0.0/Tests/bench_cffi_access.py | doc22940/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 9 | 2018-12-14T07:31:42.000Z | 2020-12-09T20:29:28.000Z | extraPackages/Pillow-6.0.0/Tests/bench_cffi_access.py | doc22940/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | from .helper import unittest, PillowTestCase, hopper
# Not running this test by default. No DOS against Travis CI.
from PIL import PyAccess
import time
def iterate_get(size, access):
(w, h) = size
for x in range(w):
for y in range(h):
access[(x, y)]
def iterate_set(size, access):
... | 26.813559 | 73 | 0.565107 |
79427e0cfea1bb9873fbcd6a20700f01493fe03f | 1,289 | py | Python | utils/others.py | MSwML/ML-guided-material-synthesis | 8c0ae4a4f6403bcc6833e959f549ab11c9874fe6 | [
"MIT"
] | 2 | 2020-11-10T01:45:28.000Z | 2021-05-30T03:32:26.000Z | utils/others.py | MSwML/ML-guided-material-synthesis | 8c0ae4a4f6403bcc6833e959f549ab11c9874fe6 | [
"MIT"
] | null | null | null | utils/others.py | MSwML/ML-guided-material-synthesis | 8c0ae4a4f6403bcc6833e959f549ab11c9874fe6 | [
"MIT"
] | 1 | 2021-01-23T04:34:50.000Z | 2021-01-23T04:34:50.000Z | import shap
import numpy as np
import pandas as pd
from utils import data_handler
def extract_feature_importance(model,X,title):
print('Feature importance...')
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X)
shap.summary_plot(shap_values, feature_names=X.columns, pl... | 28.644444 | 78 | 0.694337 |
79427e37762155d108c16efd1ee009b67587edcb | 9,814 | py | Python | test/color/test_rgb.py | connorlee77/kornia | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-10-21T05:13:51.000Z | 2021-10-21T05:13:51.000Z | test/color/test_rgb.py | connorlee77/kornia | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-03-12T01:08:10.000Z | 2022-03-12T01:08:10.000Z | test/color/test_rgb.py | connorlee77/kornia | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-02-09T02:19:32.000Z | 2021-02-09T02:19:32.000Z | import kornia
import kornia.testing as utils # test utils
from test.common import device
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
import pytest
class TestRgbToRgba:
def test_smoke(self, device):
data = torch.rand(3, 4, 4).to(device)
assert korni... | 31.863636 | 83 | 0.3602 |
79427fb72b17238219878925957b3b6e0e4ff7bb | 4,160 | py | Python | tests/unitary/GaugeController/test_gauges_weights.py | AqualisDAO/curve-dao-contracts | beec73a068da8ed01c0f710939dc5adb776d565b | [
"MIT"
] | 217 | 2020-06-24T14:01:21.000Z | 2022-03-29T08:35:24.000Z | tests/unitary/GaugeController/test_gauges_weights.py | AqualisDAO/curve-dao-contracts | beec73a068da8ed01c0f710939dc5adb776d565b | [
"MIT"
] | 25 | 2020-06-24T09:39:02.000Z | 2022-03-22T17:03:00.000Z | tests/unitary/GaugeController/test_gauges_weights.py | AqualisDAO/curve-dao-contracts | beec73a068da8ed01c0f710939dc5adb776d565b | [
"MIT"
] | 110 | 2020-07-10T22:45:49.000Z | 2022-03-29T02:51:08.000Z | import brownie
WEEK = 7 * 86400
YEAR = 365 * 86400
TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18]
GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17]
def test_add_gauges(accounts, gauge_controller, three_gauges):
gauge_controller.add_gauge(three_gauges[0], 0, {"from": accounts[0]})
gauge_controller.add_gaug... | 37.477477 | 95 | 0.722837 |
79427fbda58bff26e958303467032bf18314f192 | 1,335 | py | Python | test/test_v1_volume_mount.py | pearsontechnology/k8sv1 | f9df106a4f2492d35af63b6bb2b1da4ed2b84579 | [
"Apache-2.0"
] | 1 | 2016-08-10T15:06:53.000Z | 2016-08-10T15:06:53.000Z | test/test_v1_volume_mount.py | pearsontechnology/k8sv1 | f9df106a4f2492d35af63b6bb2b1da4ed2b84579 | [
"Apache-2.0"
] | null | null | null | test/test_v1_volume_mount.py | pearsontechnology/k8sv1 | f9df106a4f2492d35af63b6bb2b1da4ed2b84579 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use ... | 25.188679 | 104 | 0.713109 |
79427fc696a65dc7442e39342261a3f5df774cae | 672 | py | Python | bindings/python/button-example.py | ali-hdvr/libsurvive | 576fdbac0f9f18f7c90bb65503dbd8508a52af00 | [
"MIT"
] | 377 | 2016-12-03T06:44:50.000Z | 2020-02-09T21:48:46.000Z | bindings/python/button-example.py | ali-hdvr/libsurvive | 576fdbac0f9f18f7c90bb65503dbd8508a52af00 | [
"MIT"
] | 87 | 2016-12-05T04:07:18.000Z | 2020-02-04T15:10:16.000Z | bindings/python/button-example.py | ali-hdvr/libsurvive | 576fdbac0f9f18f7c90bb65503dbd8508a52af00 | [
"MIT"
] | 62 | 2016-12-03T06:38:02.000Z | 2020-02-04T19:21:14.000Z | import sys
import pysurvive
ctx = pysurvive.init(sys.argv)
if ctx is None: # implies -help or similiar
exit(-1)
def button_func(obj, eventtype, buttonid, axisids, axisvals):
if eventtype == pysurvive.SURVIVE_INPUT_EVENT_BUTTON_DOWN:
eventstring = "DOWN"
elif eventtype == pysurvive.SURVIVE_INPUT_E... | 24.888889 | 109 | 0.71131 |
794281432fe4d2d4aaee82c41c08b488a6933e16 | 15,849 | py | Python | projectq/libs/math/_gates.py | ionq/ProjectQ | 0cf7322cde910f79c6d4515fed36beaad2ae2f40 | [
"Apache-2.0"
] | 4 | 2021-07-09T04:14:36.000Z | 2022-01-31T01:39:56.000Z | projectq/libs/math/_gates.py | ionq/ProjectQ | 0cf7322cde910f79c6d4515fed36beaad2ae2f40 | [
"Apache-2.0"
] | 14 | 2021-06-21T12:19:09.000Z | 2022-03-17T16:06:06.000Z | projectq/libs/math/_gates.py | ionq/ProjectQ | 0cf7322cde910f79c6d4515fed36beaad2ae2f40 | [
"Apache-2.0"
] | 1 | 2021-07-09T15:04:49.000Z | 2021-07-09T15:04:49.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... | 28.051327 | 100 | 0.604202 |
794281c62f53bff2c4a1c95ad1e4d4b5326c55c2 | 3,323 | py | Python | retools/lock.py | dolead/retools | 28847168d768e3ff8f6e296627175085a205790c | [
"MIT"
] | null | null | null | retools/lock.py | dolead/retools | 28847168d768e3ff8f6e296627175085a205790c | [
"MIT"
] | null | null | null | retools/lock.py | dolead/retools | 28847168d768e3ff8f6e296627175085a205790c | [
"MIT"
] | null | null | null | """A Redis backed distributed global lock
This lock based mostly on this excellent example:
http://chris-lamb.co.uk/2010/06/07/distributing-locking-python-and-redis/
This code add's one change as suggested by the Redis documentation regarding
using locks in Redis, which is to only delete the Redis lock if we actually... | 36.119565 | 77 | 0.604574 |
794281cafa4f98f84b36cb43101f03491c1d0352 | 1,272 | py | Python | tests/api_resources/test_application_fee_refund.py | bhch/async-stripe | 75d934a8bb242f664e7be30812c12335cf885287 | [
"MIT",
"BSD-3-Clause"
] | 8 | 2021-05-29T08:57:58.000Z | 2022-02-19T07:09:25.000Z | tests/api_resources/test_application_fee_refund.py | bhch/async-stripe | 75d934a8bb242f664e7be30812c12335cf885287 | [
"MIT",
"BSD-3-Clause"
] | 5 | 2021-05-31T10:18:36.000Z | 2022-01-25T11:39:03.000Z | tests/api_resources/test_application_fee_refund.py | bhch/async-stripe | 75d934a8bb242f664e7be30812c12335cf885287 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-05-29T13:27:10.000Z | 2021-05-29T13:27:10.000Z | from __future__ import absolute_import, division, print_function
import pytest
import stripe
import pytest
pytestmark = pytest.mark.asyncio
TEST_RESOURCE_ID = "fr_123"
TEST_APPFEE_ID = "fee_123"
class TestApplicationFeeRefund(object):
async def test_is_saveable(self, request_mock):
appfee = await st... | 30.285714 | 72 | 0.68239 |
794281f7a10014ae0e3b2dd30805e3c8c303b6d3 | 163 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_BestCycle_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_BestCycle_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_BestCycle_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['MovingAverage'] , ['BestCycle'] , ['SVR'] ); | 40.75 | 85 | 0.754601 |
79428338800187a14771fd7603482689d78daa6d | 307 | py | Python | example_app/set_sys_path.py | soofaloofa/gutter-appengine | 279073e18939e8070421210ca4d65f2f16d7ee5c | [
"MIT"
] | 1 | 2015-06-01T19:31:33.000Z | 2015-06-01T19:31:33.000Z | example_app/set_sys_path.py | soofaloofa/gutter-appengine | 279073e18939e8070421210ca4d65f2f16d7ee5c | [
"MIT"
] | null | null | null | example_app/set_sys_path.py | soofaloofa/gutter-appengine | 279073e18939e8070421210ca4d65f2f16d7ee5c | [
"MIT"
] | null | null | null | import os
import sys
CURRENT_PATH = os.path.abspath(os.path.dirname(__file__))
def set_sys_path():
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/dist.zip, loaded using zipimport.
sys.path[0:0] = [
os.path.join(CURRENT_PATH, 'lib'),
]
| 23.615385 | 71 | 0.687296 |
79428345c64dce00c672e545483a4f00f47ea31f | 2,159 | py | Python | front/models.py | llazzaro/django-front | 8a04a88d42b37f4882ab43415e5f20bedae9d257 | [
"MIT"
] | 135 | 2015-01-12T22:21:41.000Z | 2021-12-12T03:52:04.000Z | front/models.py | P-Designs/django-front | 2f7daaa70d6b2210f4a4ad0c251b0893f15bd711 | [
"MIT"
] | 12 | 2015-04-10T12:45:04.000Z | 2020-03-22T17:32:32.000Z | front/models.py | P-Designs/django-front | 2f7daaa70d6b2210f4a4ad0c251b0893f15bd711 | [
"MIT"
] | 24 | 2015-01-24T01:22:18.000Z | 2022-03-15T13:06:47.000Z | from django.db import models
from django.core.cache import cache
from django.dispatch import receiver
from django.db.models.signals import post_save
import hashlib
import six
class Placeholder(models.Model):
key = models.CharField(max_length=40, primary_key=True, db_index=True)
value = models.TextField(blank=... | 34.822581 | 134 | 0.696619 |
794283e09f59053c4936189314f3f0b0fe85e5d0 | 4,313 | py | Python | homeassistant/components/hue/__init__.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/hue/__init__.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/hue/__init__.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for the Philips Hue system."""
from aiohue.util import normalize_bridge_id
from homeassistant import config_entries, core
from homeassistant.components import persistent_notification
from homeassistant.helpers import device_registry as dr
from .bridge import HueBridge
from .const import DOMAIN, SERVICE_HU... | 37.504348 | 97 | 0.656156 |
7942854af2003faf969bef9948d51919aecb34db | 7,178 | py | Python | gitrevise/tui.py | krobelus/git-revise | 55bfb71bd4e9232b3b0befe171bc72d412856ae2 | [
"MIT"
] | null | null | null | gitrevise/tui.py | krobelus/git-revise | 55bfb71bd4e9232b3b0befe171bc72d412856ae2 | [
"MIT"
] | null | null | null | gitrevise/tui.py | krobelus/git-revise | 55bfb71bd4e9232b3b0befe171bc72d412856ae2 | [
"MIT"
] | null | null | null | from typing import Optional, List
from argparse import ArgumentParser, Namespace
from subprocess import CalledProcessError
import sys
from .odb import Repository, Commit, Reference
from .utils import (
EditorError,
commit_range,
edit_commit_message,
update_head,
cut_commit,
local_commits,
)
fro... | 29.908333 | 88 | 0.642101 |
794285aa5e0a2f8571e77d0c0d8a68fff49f2cb1 | 613 | py | Python | stocal/examples/events.py | MrLiono21/stocal | 7f7110c5b6401e7332d5d35c843b6fedafd464c2 | [
"MIT"
] | null | null | null | stocal/examples/events.py | MrLiono21/stocal | 7f7110c5b6401e7332d5d35c843b6fedafd464c2 | [
"MIT"
] | null | null | null | stocal/examples/events.py | MrLiono21/stocal | 7f7110c5b6401e7332d5d35c843b6fedafd464c2 | [
"MIT"
] | null | null | null | """Event example
stocal.Event's can be added to a processes definition just like
Reactions. Process.trajectory returns an TrajectorySampler that
can cope with deterministic transitions (e.g. FirstReactionMethod).
Sampler selection and usage is entirely transparent to the user.
"""
import stocal
process = stocal.Proc... | 27.863636 | 67 | 0.668842 |
7942869f91600f5ced12b5178a647eb9df42255f | 22,751 | py | Python | venv/Lib/site-packages/pandas/core/groupby/grouper.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/core/groupby/grouper.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/core/groupby/grouper.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | """
Provide user facing operators for doing the split part of the
split-apply-combine paradigm.
"""
from typing import Dict, Hashable, List, Optional, Tuple
import numpy as np
from pandas._typing import FrameOrSeries
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common impor... | 34.52352 | 100 | 0.563536 |
794286b61eaa817b6021909de4b856b5eccd4ee7 | 1,345 | py | Python | lib/main.py | twstrike/tor_guardsim | 743c01b06e28e87ca5ce9e7d7ca3ca9271781cd5 | [
"CC0-1.0"
] | null | null | null | lib/main.py | twstrike/tor_guardsim | 743c01b06e28e87ca5ce9e7d7ca3ca9271781cd5 | [
"CC0-1.0"
] | 1 | 2016-02-22T14:00:01.000Z | 2016-02-24T18:35:05.000Z | lib/main.py | twstrike/tor_guardsim | 743c01b06e28e87ca5ce9e7d7ca3ca9271781cd5 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python
from __future__ import print_function
from py3hax import *
import tornet
import simtime
import client
def trivialSimulation():
net = tornet.Network(100)
# Decorate the network.
# Uncomment one or two of these at a time, kthx!
#net = tornet.FascistNetwork(net)
#net = tornet.Fla... | 24.907407 | 75 | 0.559108 |
794286cc1e71f95c262abaf26a24c9e8389ee28a | 6,057 | py | Python | app/decorators/validator.py | Poketnans/capstone-q3 | 38d550a54ff41387534241df85eb8aa8c9b6ba7e | [
"MIT"
] | null | null | null | app/decorators/validator.py | Poketnans/capstone-q3 | 38d550a54ff41387534241df85eb8aa8c9b6ba7e | [
"MIT"
] | 4 | 2022-03-03T12:47:02.000Z | 2022-03-08T18:10:34.000Z | app/decorators/validator.py | Poketnans/capstone-q3 | 38d550a54ff41387534241df85eb8aa8c9b6ba7e | [
"MIT"
] | 1 | 2022-03-17T14:21:30.000Z | 2022-03-17T14:21:30.000Z | from http import HTTPStatus
from re import match
from functools import wraps
from flask import request
import datetime
from app.errors.json_not_found import JSONNotFound
from app.services import get_data
from datetime import datetime, timedelta, timezone
def validator(
user_name: str = None,
date: str = None,... | 45.541353 | 197 | 0.513621 |
794286f6a6888364ae595fe5a13901a45af18a8b | 2,480 | py | Python | n3ml/connection.py | chatterboy/n3ml | 28b4e25a277e55e734e6054e8239237a5ff7d1f1 | [
"MIT"
] | 11 | 2019-03-15T17:20:54.000Z | 2022-03-01T08:25:36.000Z | n3ml/connection.py | chatterboy/n3ml | 28b4e25a277e55e734e6054e8239237a5ff7d1f1 | [
"MIT"
] | 7 | 2019-03-15T16:02:51.000Z | 2021-12-03T08:17:06.000Z | n3ml/connection.py | chatterboy/n3ml | 28b4e25a277e55e734e6054e8239237a5ff7d1f1 | [
"MIT"
] | 9 | 2019-10-14T12:38:19.000Z | 2021-12-02T04:49:28.000Z | from typing import Type
import torch
import torch.nn
import torch.distributions.distribution
import n3ml.population
import n3ml.learning
class Synapse(torch.nn.Module):
def __init__(self,
source: n3ml.population.Population,
target: n3ml.population.Population,
w... | 32.207792 | 92 | 0.57621 |
7942885807c74ba498878ae9ca62678293db9dbf | 981 | py | Python | working_copy_indeed copy.py | jenjhayden/Scrapy | 16bbe7fd30badf242dea95dc8cddfd06b2a911b6 | [
"MIT"
] | null | null | null | working_copy_indeed copy.py | jenjhayden/Scrapy | 16bbe7fd30badf242dea95dc8cddfd06b2a911b6 | [
"MIT"
] | null | null | null | working_copy_indeed copy.py | jenjhayden/Scrapy | 16bbe7fd30badf242dea95dc8cddfd06b2a911b6 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
source = requests.get('https://www.indeed.com/jobs?q=python+developer&l=').text
soup = BeautifulSoup(source,'html5lib')
for jobs in soup.find_all (class_='result'):
try:
title = jobs.h2.text.strip()
except Exception as e:
title = None
print(... | 22.813953 | 79 | 0.598369 |
794288e8dad2043a4160e75b7813c4dfa4e423ac | 12,322 | py | Python | test/functional/feature_fee_estimation.py | beirut-boop/syscoin | fb9a2e1cba0489f4a46e41dbd8ba5265e1351c2b | [
"MIT"
] | null | null | null | test/functional/feature_fee_estimation.py | beirut-boop/syscoin | fb9a2e1cba0489f4a46e41dbd8ba5265e1351c2b | [
"MIT"
] | null | null | null | test/functional/feature_fee_estimation.py | beirut-boop/syscoin | fb9a2e1cba0489f4a46e41dbd8ba5265e1351c2b | [
"MIT"
] | 1 | 2021-12-01T07:18:04.000Z | 2021-12-01T07:18:04.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test fee estimation code."""
from decimal import Decimal
import random
from test_framework.messages im... | 45.806691 | 110 | 0.651355 |
79428966945bf502e08c62405af8bfab9b1d69dc | 2,625 | py | Python | tests/unittests/socket_chat.py | FI18-Trainees/FISocketChat | a3c9f9ec502e1b7961716ac4f8ccb14e145e4f86 | [
"MIT"
] | 4 | 2019-09-19T12:46:52.000Z | 2019-12-02T13:51:13.000Z | tests/unittests/socket_chat.py | FI18-Trainees/FISocketChat | a3c9f9ec502e1b7961716ac4f8ccb14e145e4f86 | [
"MIT"
] | 102 | 2019-09-20T06:56:15.000Z | 2021-12-19T23:33:06.000Z | tests/unittests/socket_chat.py | FI18-Trainees/FISocketChat | a3c9f9ec502e1b7961716ac4f8ccb14e145e4f86 | [
"MIT"
] | null | null | null | import unittest
from test_objs import SocketIOConnection
class TestBasicChat(unittest.TestCase):
def test_start(self):
print("Establishing connection")
sockets = SocketIOConnection()
print("Testing connection")
self.assertTrue(sockets.online_status)
self.assertEqual(socket... | 44.491525 | 85 | 0.540952 |
794289cb595d8f314d6a3cc7f9e2e0f4767588a5 | 277 | py | Python | python-syntax-exercise/python-syntax/any7.py | ryankrdh/Springboard-Assignments | 9c9b132a814fc818810978dce1f33c4052028353 | [
"MIT"
] | null | null | null | python-syntax-exercise/python-syntax/any7.py | ryankrdh/Springboard-Assignments | 9c9b132a814fc818810978dce1f33c4052028353 | [
"MIT"
] | null | null | null | python-syntax-exercise/python-syntax/any7.py | ryankrdh/Springboard-Assignments | 9c9b132a814fc818810978dce1f33c4052028353 | [
"MIT"
] | null | null | null | def any7(nums):
"""Are any of these numbers a 7? (True/False)"""
# YOUR CODE HERE
for num in nums:
if num == 7:
return True
return False
print("should be true", any7([1, 2, 7, 4, 5]))
print("should be false", any7([1, 2, 4, 5]))
| 19.785714 | 52 | 0.523466 |
794289cbc830838a332413add8a84ec36dfff7cd | 30 | py | Python | python/testData/intentions/convertTripleQuotedStringInParenthesized_after.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/intentions/convertTripleQuotedStringInParenthesized_after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/intentions/convertTripleQuotedStringInParenthesized_after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | t = ("string\n"
"some\n") | 15 | 15 | 0.433333 |
79428a905380d3e3a47f4f0cb29e37a70de0a3de | 300 | py | Python | 10DaysofStatistics/Day0-Weighted-Mean.py | KunyuHe/Hacker-Rank-Practice | b6ffae26fd5b11e7826b7c8aa4f197399ed3c93e | [
"Apache-2.0"
] | null | null | null | 10DaysofStatistics/Day0-Weighted-Mean.py | KunyuHe/Hacker-Rank-Practice | b6ffae26fd5b11e7826b7c8aa4f197399ed3c93e | [
"Apache-2.0"
] | null | null | null | 10DaysofStatistics/Day0-Weighted-Mean.py | KunyuHe/Hacker-Rank-Practice | b6ffae26fd5b11e7826b7c8aa4f197399ed3c93e | [
"Apache-2.0"
] | null | null | null | # Enter your code here. Read input from STDIN. Print output to STDOUT
size = int(input())
nums = list(map(int, input().split()))
weights = list(map(int, input().split()))
weighted_sum = 0
for i in range(size):
weighted_sum += nums[i] * weights[i]
print(round(weighted_sum / sum(weights), 1))
| 23.076923 | 69 | 0.676667 |
79428ab16b59ff7420ebf1d4c4689fa667ac1c18 | 19,692 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.985075 | 204 | 0.673268 |
79428c007cb5f673c35aad775e047d5ad9cc87ed | 2,139 | py | Python | quickstartup/qs_accounts/admin.py | shahabaz/quickstartup | e351138580d3b332aa309d5d98d562a1ebef5c2c | [
"MIT"
] | 13 | 2015-06-10T03:29:15.000Z | 2021-10-01T22:06:48.000Z | quickstartup/qs_accounts/admin.py | shahabaz/quickstartup | e351138580d3b332aa309d5d98d562a1ebef5c2c | [
"MIT"
] | 47 | 2015-06-10T03:26:18.000Z | 2021-09-22T17:35:24.000Z | quickstartup/qs_accounts/admin.py | shahabaz/quickstartup | e351138580d3b332aa309d5d98d562a1ebef5c2c | [
"MIT"
] | 3 | 2015-07-07T23:55:39.000Z | 2020-04-18T10:34:53.000Z | from django import forms
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import gettext_lazy as _
from .models import User
class UserAdminCreationForm(forms.ModelForm):
password1 = forms.... | 31.925373 | 89 | 0.656381 |
79428c50f6fd8b19b4cdb1c3cf6a38997060de68 | 1,589 | py | Python | plugins/file/select_file.py | manuelprogramming/OSA | 3a57ea944eef3e8680055a35e8cebd36b93dac51 | [
"MIT",
"Unlicense"
] | 1 | 2022-01-06T21:00:01.000Z | 2022-01-06T21:00:01.000Z | plugins/file/select_file.py | manuelprogramming/OSA | 3a57ea944eef3e8680055a35e8cebd36b93dac51 | [
"MIT",
"Unlicense"
] | null | null | null | plugins/file/select_file.py | manuelprogramming/OSA | 3a57ea944eef3e8680055a35e8cebd36b93dac51 | [
"MIT",
"Unlicense"
] | null | null | null | from dataclasses import dataclass
from typing import Tuple
from tkinter.filedialog import askopenfilename
from tkinter import Tk
from osa import factory
from handlers.result import BaseResult
from handlers.file import get_saving_path, set_setting
@dataclass
class SelectFile:
"""
Opens a File Dialog for sele... | 29.425926 | 101 | 0.614852 |
79428d1b5c59c73e3b9c0c3137f1bdd1cd326fee | 2,433 | py | Python | leetcode/040_combination_sum_II.py | aiden0z/snippets | c3534ad718599a64f3c7ccdbfe51058e01244c60 | [
"MIT"
] | null | null | null | leetcode/040_combination_sum_II.py | aiden0z/snippets | c3534ad718599a64f3c7ccdbfe51058e01244c60 | [
"MIT"
] | null | null | null | leetcode/040_combination_sum_II.py | aiden0z/snippets | c3534ad718599a64f3c7ccdbfe51058e01244c60 | [
"MIT"
] | null | null | null | """Combination Sum II
Given a collection of candidate numbers (candidates) and a target number (target), find all
unique combinations in candidates where the candidate numbers sums to target.
Each number in candidates may only be used once in the combination.
Note:
* All numbers (including target) will be posit... | 25.882979 | 99 | 0.568023 |
79428e70b85cfc59363a7ad6e80599bd46f985b5 | 11,809 | py | Python | utils/image.py | cresposito/BirdCLEF-Baseline | bb95a749d21b62031aa208fe7a12e991eba076ac | [
"MIT"
] | 47 | 2018-04-11T01:15:18.000Z | 2022-01-27T15:30:45.000Z | utils/image.py | cresposito/BirdCLEF-Baseline | bb95a749d21b62031aa208fe7a12e991eba076ac | [
"MIT"
] | null | null | null | utils/image.py | cresposito/BirdCLEF-Baseline | bb95a749d21b62031aa208fe7a12e991eba076ac | [
"MIT"
] | 17 | 2018-04-17T00:26:33.000Z | 2021-12-30T10:02:24.000Z | # This file includes basic functionality for image processing
# including i/o handling, image augmentation and model input pre-processing
# Author: Stefan Kahl, 2018, Chemnitz University of Technology
import sys
sys.path.append("..")
import copy
import numpy as np
import cv2
######################## CONFIG ########... | 27.209677 | 149 | 0.556017 |
79428eb260a0f9cba3e4dc17273e462a9e4b039a | 467 | py | Python | trump.py | ant3h/knife_scraper | 1f5bffce2c6bb5dfdde9f49845d916acd1a92a90 | [
"MIT"
] | null | null | null | trump.py | ant3h/knife_scraper | 1f5bffce2c6bb5dfdde9f49845d916acd1a92a90 | [
"MIT"
] | null | null | null | trump.py | ant3h/knife_scraper | 1f5bffce2c6bb5dfdde9f49845d916acd1a92a90 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# bhq_query.py - module for sopel to query blade head quarters site for knife data
#
# Copyright (c) 2017 Casey Bartlett <caseytb@bu.edu>
#
# See LICENSE for terms of usage, modification and redistribution.
#
from sopel import *
import random
from itertools import repeat
@module.rule('.*bigly... | 23.35 | 82 | 0.713062 |
79429031691626d1a079f253421e5e3bf0ff3e4f | 952 | py | Python | kubernetes_asyncio/test/test_v1_scale_status.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_scale_status.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_scale_status.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 23.8 | 124 | 0.721639 |
79429055861649ca489737ee388e742ecf57b8f6 | 974 | py | Python | web/cascade/bomstrip.py | epmoyer/cascade | 79b877d5b19567be2d08c00f5cdc31c8968db4c7 | [
"MIT"
] | null | null | null | web/cascade/bomstrip.py | epmoyer/cascade | 79b877d5b19567be2d08c00f5cdc31c8968db4c7 | [
"MIT"
] | null | null | null | web/cascade/bomstrip.py | epmoyer/cascade | 79b877d5b19567be2d08c00f5cdc31c8968db4c7 | [
"MIT"
] | null | null | null | """ Strip the UTF-8 Byte Order Mark (BOM) from a file (if it exists)
"""
import codecs
BOMLEN = len(codecs.BOM_UTF8)
def copy_and_strip_bom(infilename, outfilename):
"""Copy file into a new file, excluding the BOM (if it exists)
"""
buffer_size = 4096
with open(infilename, "r+b") as infile... | 30.4375 | 94 | 0.602669 |
7942906c909f7ae6cc73ebb728c2336ac0c6587e | 2,687 | py | Python | mailpile/plugins/keylookup/dnspka.py | JocelynDelalande/Mailpile | 3e53a54195a0dd8ca48e7cb3be44dd7b3acabd74 | [
"Apache-2.0"
] | null | null | null | mailpile/plugins/keylookup/dnspka.py | JocelynDelalande/Mailpile | 3e53a54195a0dd8ca48e7cb3be44dd7b3acabd74 | [
"Apache-2.0"
] | null | null | null | mailpile/plugins/keylookup/dnspka.py | JocelynDelalande/Mailpile | 3e53a54195a0dd8ca48e7cb3be44dd7b3acabd74 | [
"Apache-2.0"
] | null | null | null | try:
import DNS
except:
DNS = None
import urllib2
from mailpile.i18n import gettext
from mailpile.plugins.keylookup import LookupHandler
from mailpile.plugins.keylookup import register_crypto_key_lookup_handler
_ = lambda t: t
#
# Support for DNS PKA (_pka) entries.
# See http://www.gushi.org/make-dns-cer... | 28.284211 | 88 | 0.536658 |
794290a36bfa6db484892c7c5b77536988afd901 | 227 | py | Python | xbee/__init__.py | AndreRenaud/python-xbee | 803b5267395b66540cc0b12f501932c55b168010 | [
"MIT"
] | 65 | 2015-12-06T02:38:28.000Z | 2017-09-05T16:46:07.000Z | xbee/__init__.py | AndreRenaud/python-xbee | 803b5267395b66540cc0b12f501932c55b168010 | [
"MIT"
] | 44 | 2015-10-23T15:33:54.000Z | 2017-09-01T06:39:50.000Z | xbee/__init__.py | AndreRenaud/python-xbee | 803b5267395b66540cc0b12f501932c55b168010 | [
"MIT"
] | 43 | 2015-12-15T02:52:21.000Z | 2017-06-24T17:14:53.000Z | """
XBee package initalization file
info@n.io
"""
__title__ = 'xbee'
__version__ = '2.3.2'
__author__ = 'n.io'
__license__ = 'MIT'
from xbee.thread import XBee
from xbee.thread import ZigBee
from xbee.thread import DigiMesh
| 15.133333 | 32 | 0.735683 |
7942914816b8c578099f42eb3fc1e0d955b918ba | 6,121 | py | Python | hw_07/hypers_optim.py | coinflip112/ml_101 | 9e56ffdb99ac241ed396e25d7f7818a58ee5c4de | [
"MIT"
] | null | null | null | hw_07/hypers_optim.py | coinflip112/ml_101 | 9e56ffdb99ac241ed396e25d7f7818a58ee5c4de | [
"MIT"
] | null | null | null | hw_07/hypers_optim.py | coinflip112/ml_101 | 9e56ffdb99ac241ed396e25d7f7818a58ee5c4de | [
"MIT"
] | null | null | null | import argparse
import json
import lzma
import os
import pickle
import sys
import urllib.request
import numpy as np
import pandas as pd
from sklearn.compose import ColumnTransformer
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier
from sklearn.svm import SVC
from sklearn.linear_model import SG... | 28.207373 | 85 | 0.632576 |
7942917e48e03deb411ce9c358ece7f9a5277cd6 | 8,435 | py | Python | backend/config/settings/production.py | kwkelly/chuckwagon | f6d3ee564b9d895195df223025ac05ef56f78e52 | [
"MIT"
] | null | null | null | backend/config/settings/production.py | kwkelly/chuckwagon | f6d3ee564b9d895195df223025ac05ef56f78e52 | [
"MIT"
] | null | null | null | backend/config/settings/production.py | kwkelly/chuckwagon | f6d3ee564b9d895195df223025ac05ef56f78e52 | [
"MIT"
] | null | null | null | import logging
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY')
# https://docs.djangoproject.com/en/dev/ref/settings/#allow... | 38.870968 | 106 | 0.597747 |
7942919c8e4b89d5a2cb6de509985098011e3375 | 4,968 | py | Python | bsp/stm32/stm32l433-st-nucleo/rtconfig.py | BreederBai/rt-thread | 53ed0314982556dfa9c5db75d4f3e02485d16ab5 | [
"Apache-2.0"
] | null | null | null | bsp/stm32/stm32l433-st-nucleo/rtconfig.py | BreederBai/rt-thread | 53ed0314982556dfa9c5db75d4f3e02485d16ab5 | [
"Apache-2.0"
] | null | null | null | bsp/stm32/stm32l433-st-nucleo/rtconfig.py | BreederBai/rt-thread | 53ed0314982556dfa9c5db75d4f3e02485d16ab5 | [
"Apache-2.0"
] | null | null | null | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | 27.910112 | 152 | 0.574074 |
794291e89ca343cafca6b7589f59ee13d9af00eb | 2,606 | py | Python | test/convert_test_format.py | TysonAndre/igbinary-hhvm | 0608c54e996ee91fc3b16337654ce7ea5ece7814 | [
"PHP-3.01"
] | null | null | null | test/convert_test_format.py | TysonAndre/igbinary-hhvm | 0608c54e996ee91fc3b16337654ce7ea5ece7814 | [
"PHP-3.01"
] | 2 | 2017-10-20T05:57:58.000Z | 2017-10-20T06:10:01.000Z | test/convert_test_format.py | TysonAndre/igbinary-hhvm | 0608c54e996ee91fc3b16337654ce7ea5ece7814 | [
"PHP-3.01"
] | null | null | null | #!/usr/bin/env python3
import os
import re
import sys
TEST_COMMENT = re.compile(r"--TEST--\r?\n([^\n\r]+)\r?\n--", re.MULTILINE)
FILE_CONTENTS = re.compile(r"--FILE--\r?\n<\?php\s*\r?\n?\s*(.*)(\r?\n?(\?>)?)?\r?\n--EXPECT(F|REGEX)?--", re.MULTILINE | re.DOTALL)
EXPECT_CONTENTS = re.compile(r"--(EXPECT(F|REGEX)?)-... | 42.721311 | 134 | 0.633922 |
794292985726332c2834f5c787f816ae27f5658a | 621 | py | Python | location.py | burkee75/flask-weather-app | 6c7eecfad83727fc73e4122cfcc926ff607870cd | [
"MIT"
] | 1 | 2020-05-01T22:03:19.000Z | 2020-05-01T22:03:19.000Z | location.py | burkee75/flask-weather-app | 6c7eecfad83727fc73e4122cfcc926ff607870cd | [
"MIT"
] | 1 | 2020-05-04T06:54:28.000Z | 2020-05-04T06:54:28.000Z | location.py | burkee75/flask-weather-app | 6c7eecfad83727fc73e4122cfcc926ff607870cd | [
"MIT"
] | 2 | 2020-05-01T22:03:24.000Z | 2020-05-03T18:56:33.000Z | from mapbox import Geocoder
class MapboxLocation:
def __init__(self, api_key):
self.api_key = api_key
self.geocoder = Geocoder(access_token=self.api_key)
def latitude_longitude(self, zipcode):
self.zipcode = zipcode
response = self.geocoder.forward(self.zipcode, country=['us'... | 32.684211 | 97 | 0.669887 |
7942935c7b79fbb5a7609e45b8ed9d213fe63b12 | 27,425 | py | Python | appdirs.py | eukreign/appdirs | e0176a71a71b16dc5f16dd32268323e4263dcf1d | [
"MIT"
] | null | null | null | appdirs.py | eukreign/appdirs | e0176a71a71b16dc5f16dd32268323e4263dcf1d | [
"MIT"
] | null | null | null | appdirs.py | eukreign/appdirs | e0176a71a71b16dc5f16dd32268323e4263dcf1d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <https://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# http://support.micr... | 39.919942 | 122 | 0.628441 |
7942936918bd00b5774f3070c8ae3a62cf6fe71a | 796 | py | Python | benchmarks/flask_simple/app.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | benchmarks/flask_simple/app.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | benchmarks/flask_simple/app.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | import random
from flask import Flask
from flask import render_template_string
app = Flask(__name__)
@app.route("/")
def index():
rand_numbers = [random.random() for _ in range(20)]
return render_template_string(
"""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewpor... | 18.511628 | 72 | 0.557789 |
79429389032e033e271c1e5fb364ef614bc89fc3 | 3,397 | py | Python | yandex_maps/tests.py | 66ru/yandex-maps | aadacb751bf4b491a8caf00e35f11faeb4a516d3 | [
"MIT"
] | 8 | 2015-02-22T22:32:30.000Z | 2021-02-16T16:50:44.000Z | yandex_maps/tests.py | 66ru/yandex-maps | aadacb751bf4b491a8caf00e35f11faeb4a516d3 | [
"MIT"
] | 4 | 2015-06-24T10:25:54.000Z | 2019-08-20T11:30:05.000Z | yandex_maps/tests.py | 66ru/yandex-maps | aadacb751bf4b491a8caf00e35f11faeb4a516d3 | [
"MIT"
] | 12 | 2015-01-26T09:40:18.000Z | 2019-09-01T14:10:17.000Z | #coding: utf-8
from unittest import TestCase
from yandex_maps.api import _get_coords, get_map_url
RESPONSE = u"""<?xml version="1.0" encoding="utf-8"?>
<ymaps xmlns="http://maps.yandex.ru/ymaps/1.x" xmlns:x="http://www.yandex.ru/xscript">
<GeoObjectCollection>
<metaDataProperty xmlns="http://www.opengis.net/gml"... | 39.045977 | 128 | 0.622019 |
794293c225d66e35c2075b2bd913d52736e2f3b9 | 551 | py | Python | conftest.py | daltonik666/python_training | 99e243c346aeeeb1698e31be04e1742cce6029d9 | [
"Apache-2.0"
] | null | null | null | conftest.py | daltonik666/python_training | 99e243c346aeeeb1698e31be04e1742cce6029d9 | [
"Apache-2.0"
] | null | null | null | conftest.py | daltonik666/python_training | 99e243c346aeeeb1698e31be04e1742cce6029d9 | [
"Apache-2.0"
] | null | null | null |
import pytest
from fixture.application import Application
fixture = None
@pytest.fixture
def app(request):
global fixture
if fixture is None:
fixture = Application()
else:
if not fixture.is_valid():
fixture = Application()
fixture.session.ensure_login(username="admin", pas... | 22.958333 | 69 | 0.678766 |
794293edb49bc42e36dbffc69a3542ae8935d69c | 587 | py | Python | class/cls07.py | LBarros77/Python | 283b383d9d14c8d7b907b80f03f7cdc5dbd1e8af | [
"MIT"
] | null | null | null | class/cls07.py | LBarros77/Python | 283b383d9d14c8d7b907b80f03f7cdc5dbd1e8af | [
"MIT"
] | null | null | null | class/cls07.py | LBarros77/Python | 283b383d9d14c8d7b907b80f03f7cdc5dbd1e8af | [
"MIT"
] | null | null | null | class Date:
def __init__(self, day = 0, month = 0, year = 0):
self.day = day
self.month = month
self.year = year
@classmethod
def date_str(cls, string):
day, month, year = map(int, string.split("-"))
date1 = cls(day, month, year)
return date1
@st... | 26.681818 | 57 | 0.577513 |
7942946759adb77f7029389e9da300939708dc59 | 15,023 | py | Python | tests/cloudformation/runner/test_runner.py | BenjaDiaz/checkov | c53e32f1654e4ee771abf2001b3cb7df16752f6e | [
"Apache-2.0"
] | null | null | null | tests/cloudformation/runner/test_runner.py | BenjaDiaz/checkov | c53e32f1654e4ee771abf2001b3cb7df16752f6e | [
"Apache-2.0"
] | 3 | 2022-03-07T20:37:31.000Z | 2022-03-21T20:20:14.000Z | tests/cloudformation/runner/test_runner.py | BenjaDiaz/checkov | c53e32f1654e4ee771abf2001b3cb7df16752f6e | [
"Apache-2.0"
] | null | null | null | import dis
import inspect
import os
import unittest
from pathlib import Path
from typing import Dict, Any
import pytest
from checkov.cloudformation import cfn_utils
from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck
from checkov.cloudformation.parser import parse
from checkov.com... | 48.618123 | 1,579 | 0.623111 |
79429587d1c9cec880050745d1c6809ddbb4c38e | 8,433 | py | Python | models/official/detection/inference.py | Joxis/tpu | 6b1a71c3ba8c882cc26e15a54b5f2c302eb34620 | [
"Apache-2.0"
] | null | null | null | models/official/detection/inference.py | Joxis/tpu | 6b1a71c3ba8c882cc26e15a54b5f2c302eb34620 | [
"Apache-2.0"
] | null | null | null | models/official/detection/inference.py | Joxis/tpu | 6b1a71c3ba8c882cc26e15a54b5f2c302eb34620 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.582278 | 82 | 0.670106 |
79429652637da9b9db83beddfed720442abd0280 | 4,541 | py | Python | lib/prairie.py | JLSirvent/bws-calibration-analysis | b2f129e31974c16d7498e105a075b43bfece92c9 | [
"MIT"
] | null | null | null | lib/prairie.py | JLSirvent/bws-calibration-analysis | b2f129e31974c16d7498e105a075b43bfece92c9 | [
"MIT"
] | null | null | null | lib/prairie.py | JLSirvent/bws-calibration-analysis | b2f129e31974c16d7498e105a075b43bfece92c9 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
# Copyright (c) <2017> <Lionel Garcia>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrictio... | 35.755906 | 136 | 0.603612 |
7942970e843c3187e12d01d474256865bf1ada95 | 6,445 | py | Python | recuprm1.2.py | chichocoria/recuprm | 310997d8cf4bf8ea66bf9e63745bf9c98d8768fa | [
"Xnet",
"X11"
] | null | null | null | recuprm1.2.py | chichocoria/recuprm | 310997d8cf4bf8ea66bf9e63745bf9c98d8768fa | [
"Xnet",
"X11"
] | null | null | null | recuprm1.2.py | chichocoria/recuprm | 310997d8cf4bf8ea66bf9e63745bf9c98d8768fa | [
"Xnet",
"X11"
] | 2 | 2021-03-29T23:05:22.000Z | 2021-04-07T19:50:17.000Z |
import os.path
import os
import shutil
import glob
import winreg
import sched, time
import logging
#Busca en el registro de Windows el directorio de Puleo de Sitel Cliente.
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "SOFTWARE\\VB and VBA Program Settings\\Sitel32\\Puleo") as key:
value = winre... | 50.748031 | 172 | 0.586191 |
7942975ddf6e8f589e97a3abfaf9779652403b7b | 15,403 | py | Python | ryu/app/experiments/ECMP/fattree.py | Helloworld1995/Ryu_SDN_Controller | 2680f967debca361adc6ff14ddadcbbcde0c7082 | [
"Apache-2.0"
] | 1 | 2021-03-11T01:47:35.000Z | 2021-03-11T01:47:35.000Z | ryu/app/experiments/ECMP/fattree.py | Helloworld1995/Ryu_SDN_Controller | 2680f967debca361adc6ff14ddadcbbcde0c7082 | [
"Apache-2.0"
] | null | null | null | ryu/app/experiments/ECMP/fattree.py | Helloworld1995/Ryu_SDN_Controller | 2680f967debca361adc6ff14ddadcbbcde0c7082 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 Huang MaChi at Chongqing University
# of Posts and Telecommunications, China.
# Copyright (C) 2016 Li Cheng at Beijing University of Posts
# and Telecommunications. www.muzixing.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... | 37.205314 | 156 | 0.595728 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.