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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fde8a9a71dd0db68b6431a8d686989c4b8e40f | 259 | py | Python | sstcam_simulation/event/photoelectrons.py | sstcam/sstcam-simulation | 3fb67ba64329c201d3995971e5f377c5ec71b18e | [
"BSD-3-Clause"
] | 1 | 2019-12-23T23:26:36.000Z | 2019-12-23T23:26:36.000Z | sstcam_simulation/event/photoelectrons.py | cta-chec/sstCASSIM | 75bb863675991f1a36b7d430f9253ae09416f33e | [
"BSD-3-Clause"
] | 6 | 2020-09-18T10:59:41.000Z | 2022-03-15T11:01:49.000Z | sstcam_simulation/event/photoelectrons.py | cta-chec/sstCASSIM | 75bb863675991f1a36b7d430f9253ae09416f33e | [
"BSD-3-Clause"
] | 2 | 2020-04-14T08:01:01.000Z | 2021-11-30T12:11:17.000Z | from sstcam_simulation.photoelectrons import Photoelectrons
import warnings
warnings.filterwarnings('default', module='sstcam_simulation')
msg = "Photoelectrons class has been moved to sstcam_simulation.photoelectrons"
warnings.warn(msg, DeprecationWarning)
| 37 | 79 | 0.853282 | from sstcam_simulation.photoelectrons import Photoelectrons
import warnings
warnings.filterwarnings('default', module='sstcam_simulation')
msg = "Photoelectrons class has been moved to sstcam_simulation.photoelectrons"
warnings.warn(msg, DeprecationWarning)
| true | true |
08fde9f0690ee4d59c71fc1f25ecdb1163bf053c | 13,139 | py | Python | waitress/channel.py | j4mie/waitress | 53fe0182ae5250916d2e7a17d29e12597a5ff1cb | [
"ZPL-2.1"
] | null | null | null | waitress/channel.py | j4mie/waitress | 53fe0182ae5250916d2e7a17d29e12597a5ff1cb | [
"ZPL-2.1"
] | null | null | null | waitress/channel.py | j4mie/waitress | 53fe0182ae5250916d2e7a17d29e12597a5ff1cb | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# 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.
# TH... | 35.415094 | 79 | 0.545628 | import asyncore
import socket
import time
import traceback
from waitress.buffers import (
OverflowableBuffer,
ReadOnlyFileBasedBuffer,
)
from waitress.parser import HTTPRequestParser
from waitress.compat import thread
from waitress.task import (
ErrorTask,
WSGITask,
)
from waitress.utilities import... | true | true |
08fdea50eedcefc1bbd61c68d0e5d8bc33853860 | 3,031 | py | Python | reclass/settings.py | PerfectMemory/reclass | c2f623634fd26d940ab54ce4af9e3bdbb77a242a | [
"Artistic-2.0"
] | 54 | 2017-09-18T12:38:11.000Z | 2022-03-06T03:53:52.000Z | reclass/settings.py | PerfectMemory/reclass | c2f623634fd26d940ab54ce4af9e3bdbb77a242a | [
"Artistic-2.0"
] | 47 | 2017-09-13T07:45:46.000Z | 2020-12-03T10:00:25.000Z | reclass/settings.py | PerfectMemory/reclass | c2f623634fd26d940ab54ce4af9e3bdbb77a242a | [
"Artistic-2.0"
] | 24 | 2017-08-17T10:11:34.000Z | 2021-06-28T09:57:45.000Z | # -*- coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import reclass.defaults as defaults
from six import string_types, iteritems
class Settings(object):
known_opts = {
'allow_scalar_over... | 40.959459 | 72 | 0.711976 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import reclass.defaults as defaults
from six import string_types, iteritems
class Settings(object):
known_opts = {
'allow_scalar_over_dict': defaults.OPT... | true | true |
08fdeaea1ae9d500aaa4d804613cf97e2d3d36ce | 2,436 | py | Python | tests/test_publish_heroku.py | tmcw/datasette | 5e8fbf7f6fbc0b63d0479da3806dd9ccd6aaa945 | [
"Apache-2.0"
] | null | null | null | tests/test_publish_heroku.py | tmcw/datasette | 5e8fbf7f6fbc0b63d0479da3806dd9ccd6aaa945 | [
"Apache-2.0"
] | null | null | null | tests/test_publish_heroku.py | tmcw/datasette | 5e8fbf7f6fbc0b63d0479da3806dd9ccd6aaa945 | [
"Apache-2.0"
] | null | null | null | from click.testing import CliRunner
from datasette import cli
from unittest import mock
@mock.patch("shutil.which")
def test_publish_heroku_requires_heroku(mock_which):
mock_which.return_value = False
runner = CliRunner()
with runner.isolated_filesystem():
open("test.db", "w").write("data")
... | 38.666667 | 88 | 0.659278 | from click.testing import CliRunner
from datasette import cli
from unittest import mock
@mock.patch("shutil.which")
def test_publish_heroku_requires_heroku(mock_which):
mock_which.return_value = False
runner = CliRunner()
with runner.isolated_filesystem():
open("test.db", "w").write("data")
... | true | true |
08fdeb6c7f1e4aebe77d261dc9ff50fee6d1748d | 9,346 | py | Python | androidtv/androidtv/androidtv_async.py | tungmeister/python-androidtv | 7d496ced19ffe630962c4b210113db4b6b567fcc | [
"MIT"
] | 10 | 2022-01-17T14:46:04.000Z | 2022-03-19T16:19:06.000Z | androidtv/androidtv/androidtv_async.py | tungmeister/python-androidtv | 7d496ced19ffe630962c4b210113db4b6b567fcc | [
"MIT"
] | 5 | 2022-01-18T20:33:18.000Z | 2022-03-30T15:57:24.000Z | androidtv/androidtv/androidtv_async.py | tungmeister/python-androidtv | 7d496ced19ffe630962c4b210113db4b6b567fcc | [
"MIT"
] | 7 | 2022-01-25T01:26:47.000Z | 2022-03-13T05:54:53.000Z | """Communicate with an Android TV device via ADB over a network.
ADB Debugging must be enabled.
"""
import logging
from .base_androidtv import BaseAndroidTV
from ..basetv.basetv_async import BaseTVAsync
_LOGGER = logging.getLogger(__name__)
class AndroidTVAsync(BaseTVAsync, BaseAndroidTV):
"""Representation ... | 36.795276 | 162 | 0.555318 |
import logging
from .base_androidtv import BaseAndroidTV
from ..basetv.basetv_async import BaseTVAsync
_LOGGER = logging.getLogger(__name__)
class AndroidTVAsync(BaseTVAsync, BaseAndroidTV):
def __init__(
self,
host,
port=5555,
adbkey="",
adb_server_ip="",
adb_... | true | true |
08fdecf364d16a5ba1f55adcc3df552e74d086e4 | 1,879 | py | Python | homeassistant/components/mobile_app/config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/mobile_app/config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 57 | 2020-10-15T06:47:00.000Z | 2022-03-31T06:11:18.000Z | homeassistant/components/mobile_app/config_flow.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Config flow for Mobile App."""
import uuid
from homeassistant import config_entries
from homeassistant.components import person
from homeassistant.helpers import entity_registry
from .const import ATTR_APP_ID, ATTR_DEVICE_ID, ATTR_DEVICE_NAME, CONF_USER_ID, DOMAIN
@config_entries.HANDLERS.register(DOMAIN)
class ... | 35.45283 | 86 | 0.677488 | import uuid
from homeassistant import config_entries
from homeassistant.components import person
from homeassistant.helpers import entity_registry
from .const import ATTR_APP_ID, ATTR_DEVICE_ID, ATTR_DEVICE_NAME, CONF_USER_ID, DOMAIN
@config_entries.HANDLERS.register(DOMAIN)
class MobileAppFlowHandler(config_entrie... | true | true |
08fdee0cacb1034bf6d36fd73557cf4b438693b7 | 304 | py | Python | 0x11-python-network_1/3-error_code.py | calypsobronte/holbertonschool-higher_level_programming | c39c060d8473976fa475d22fffba5cb4329c9965 | [
"MIT"
] | null | null | null | 0x11-python-network_1/3-error_code.py | calypsobronte/holbertonschool-higher_level_programming | c39c060d8473976fa475d22fffba5cb4329c9965 | [
"MIT"
] | null | null | null | 0x11-python-network_1/3-error_code.py | calypsobronte/holbertonschool-higher_level_programming | c39c060d8473976fa475d22fffba5cb4329c9965 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import urllib.request
from sys import argv
if __name__ == "__main__":
try:
with urllib.request.urlopen(argv[1]) as response:
print(response.read().decode('utf-8'))
except urllib.error.HTTPError as error:
print("Error code: {}".format(error.code))
| 25.333333 | 57 | 0.651316 | import urllib.request
from sys import argv
if __name__ == "__main__":
try:
with urllib.request.urlopen(argv[1]) as response:
print(response.read().decode('utf-8'))
except urllib.error.HTTPError as error:
print("Error code: {}".format(error.code))
| true | true |
08fdee4de44c0adf2d7c20a0f529580e05cee54d | 18,245 | py | Python | nova/virt/xenapi/agent.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | nova/virt/xenapi/agent.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | nova/virt/xenapi/agent.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010-2012 OpenStack Foundation
#
# 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
#
# ... | 40.010965 | 79 | 0.609646 |
import base64
import binascii
from distutils import version
import os
import sys
import time
import uuid
from oslo.config import cfg
from nova.api.metadata import password
from nova.compute import utils as compute_utils
from nova import conductor
from nova import context
from nova import crypto
from nova import exc... | true | true |
08fdf032c6cea611d7cad36c2255aa6d6eb8a406 | 14,628 | py | Python | rodan/views/workflowrun.py | carrieeex/Rodan | 458e72990c2571fa727a0d026fb235faf30bffec | [
"MIT"
] | 31 | 2015-01-06T17:23:45.000Z | 2022-03-30T02:46:16.000Z | rodan/views/workflowrun.py | carrieeex/Rodan | 458e72990c2571fa727a0d026fb235faf30bffec | [
"MIT"
] | 258 | 2015-01-02T19:34:57.000Z | 2022-01-19T16:34:21.000Z | rodan/views/workflowrun.py | carrieeex/Rodan | 458e72990c2571fa727a0d026fb235faf30bffec | [
"MIT"
] | 8 | 2015-08-19T16:09:31.000Z | 2021-10-03T23:46:46.000Z | # import urlparse
# from operator import itemgetter
# import os
# import shutil
from celery import (
registry,
# chain
)
# from celery.task.control import revoke
# from django.core.urlresolvers import resolve
# from django.db.models import Q
from rest_framework import generics
from rest_framework import permis... | 37.896373 | 104 | 0.528302 |
from celery import (
registry,
)
from rest_framework import generics
from rest_framework import permissions
from rest_framework import status
from rest_framework.exceptions import ValidationError
from rest_framework.relations import HyperlinkedIdentityField
from rodan.models import (
WorkflowR... | true | true |
08fdf06e2ab0e3ba96bf7af1abe4b617382cc6fe | 285 | py | Python | tests/compat.py | jab3z/factory_boy | fb634a9fd4641356b964d98c481c2b0f829655b9 | [
"MIT"
] | null | null | null | tests/compat.py | jab3z/factory_boy | fb634a9fd4641356b964d98c481c2b0f829655b9 | [
"MIT"
] | null | null | null | tests/compat.py | jab3z/factory_boy | fb634a9fd4641356b964d98c481c2b0f829655b9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: See the LICENSE file.
"""Compatibility tools for tests"""
import sys
is_python2 = (sys.version_info[0] == 2)
if is_python2:
import StringIO as io
import mock
else:
import io # noqa: F401
from unittest import mock # noqa: F401
| 17.8125 | 43 | 0.659649 |
import sys
is_python2 = (sys.version_info[0] == 2)
if is_python2:
import StringIO as io
import mock
else:
import io from unittest import mock | true | true |
08fdf06f8f45e8c35f1a766ab81aef3757e859fc | 7,504 | py | Python | SingleAgentProfiling/TD3.py | Johannes0Horn/Cooperative-Deep-RL-Multi-Agents | fd30246d33a91ae488c3c093a0de55825a43f8b9 | [
"MIT"
] | null | null | null | SingleAgentProfiling/TD3.py | Johannes0Horn/Cooperative-Deep-RL-Multi-Agents | fd30246d33a91ae488c3c093a0de55825a43f8b9 | [
"MIT"
] | null | null | null | SingleAgentProfiling/TD3.py | Johannes0Horn/Cooperative-Deep-RL-Multi-Agents | fd30246d33a91ae488c3c093a0de55825a43f8b9 | [
"MIT"
] | null | null | null | # Library Imports
import numpy as np
import tensorflow as tf
class ReplayBuffer:
"""Defines the Buffer dataset from which the agent learns"""
def __init__(self, max_size, input_shape, dim_actions):
self.mem_size = max_size
self.mem_cntr = 0
self.state_memory = np.zeros((self.mem_size, i... | 44.934132 | 108 | 0.662846 | import numpy as np
import tensorflow as tf
class ReplayBuffer:
def __init__(self, max_size, input_shape, dim_actions):
self.mem_size = max_size
self.mem_cntr = 0
self.state_memory = np.zeros((self.mem_size, input_shape), dtype=np.float32)
self.new_state_memory = np.zeros((self.mem_s... | true | true |
08fdf0e574d9c15a4c1f373867894d5459f6c826 | 2,375 | py | Python | Helper/HelpersIO.py | dhufe/python | e1f3de7826bcc391ee968f2d6ea9af1c24f3da17 | [
"MIT"
] | null | null | null | Helper/HelpersIO.py | dhufe/python | e1f3de7826bcc391ee968f2d6ea9af1c24f3da17 | [
"MIT"
] | null | null | null | Helper/HelpersIO.py | dhufe/python | e1f3de7826bcc391ee968f2d6ea9af1c24f3da17 | [
"MIT"
] | null | null | null |
class ASCReader:
def __init__ (self, fileName):
self.FileName = fileName
self.Options = self.parse_config ( )
self.Time, self.Amplitude = self.parse_data();
def getParameterByName (self, Name ):
return self.Options[Name]
def getTime ( self, us=False ):
if us:
... | 32.986111 | 78 | 0.479579 |
class ASCReader:
def __init__ (self, fileName):
self.FileName = fileName
self.Options = self.parse_config ( )
self.Time, self.Amplitude = self.parse_data();
def getParameterByName (self, Name ):
return self.Options[Name]
def getTime ( self, us=False ):
if us:
... | true | true |
08fdf21709c8c896b463a383ffcb12979bcbc57e | 12,611 | py | Python | drawbot/cubic_101.py | rsheeter/warp | b4679c18b9d2a3795b7b0e6990d9748aa9a47145 | [
"Apache-2.0"
] | null | null | null | drawbot/cubic_101.py | rsheeter/warp | b4679c18b9d2a3795b7b0e6990d9748aa9a47145 | [
"Apache-2.0"
] | 14 | 2021-02-25T13:44:25.000Z | 2022-01-20T04:10:35.000Z | drawbot/cubic_101.py | rsheeter/warp | b4679c18b9d2a3795b7b0e6990d9748aa9a47145 | [
"Apache-2.0"
] | null | null | null | from typing import NamedTuple
from fontTools.misc.bezierTools import splitCubic, splitCubicAtT
size(275, 200)
fontSize(6)
class Point(NamedTuple):
x: float
y: float
def magnitude(self):
return sqrt(self.x * self.x + self.y * self.y)
def add(self, other):
return Point(self.x + other.... | 24.298651 | 88 | 0.580684 | from typing import NamedTuple
from fontTools.misc.bezierTools import splitCubic, splitCubicAtT
size(275, 200)
fontSize(6)
class Point(NamedTuple):
x: float
y: float
def magnitude(self):
return sqrt(self.x * self.x + self.y * self.y)
def add(self, other):
return Point(self.x + other.... | true | true |
08fdf2d30ea597216e2f81ad5fcc914419c5ad43 | 4,200 | py | Python | facerecognition/facerecognition.py | czielinski/facerecognition | 2ddd9b74a96e3e7eef3dbab52e5eaf7669d33dc4 | [
"MIT"
] | 3 | 2015-08-05T08:05:10.000Z | 2016-11-01T10:38:07.000Z | facerecognition/facerecognition.py | czielinski/facerecognition | 2ddd9b74a96e3e7eef3dbab52e5eaf7669d33dc4 | [
"MIT"
] | null | null | null | facerecognition/facerecognition.py | czielinski/facerecognition | 2ddd9b74a96e3e7eef3dbab52e5eaf7669d33dc4 | [
"MIT"
] | 2 | 2017-06-19T10:57:13.000Z | 2019-11-23T06:18:01.000Z | #!/usr/bin/python
# The MIT License (MIT)
#
# Copyright (c) 2015 Christian Zielinski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | 33.870968 | 103 | 0.646667 |
from __future__ import print_function
import numpy as np
import cv2
import os
import sys
import datetime
import config
def main():
print(config.splash_screen)
video_capture = cv2.VideoCapture(0)
if not video_capture.isOpened():
print("ERROR: Could not open video capture device")
... | true | true |
08fdf34bab7db300842c220704ab541446bb105e | 7,475 | py | Python | lib/datasets/dataset_catalog.py | BernieZhu/Detectron.pytorch_CrowdPose | 3f068b3867d85621200ba0128e96d46b01ed9bb3 | [
"MIT"
] | null | null | null | lib/datasets/dataset_catalog.py | BernieZhu/Detectron.pytorch_CrowdPose | 3f068b3867d85621200ba0128e96d46b01ed9bb3 | [
"MIT"
] | null | null | null | lib/datasets/dataset_catalog.py | BernieZhu/Detectron.pytorch_CrowdPose | 3f068b3867d85621200ba0128e96d46b01ed9bb3 | [
"MIT"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 31.276151 | 89 | 0.594247 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
from core.config import cfg
_DATA_DIR = cfg.DATA_DIR
IM_DIR = 'image_directory'
ANN_FN = 'annotation_file'
IM_PREFIX = 'image_prefix'
DEVKIT_DIR = 'devkit... | true | true |
08fdf3509bb2ed0237aa3876a1a0f1ab3dfcfe05 | 469 | py | Python | tastetoursjapan_project/blog/migrations/0004_auto_20180311_1751.py | AoiToShiro/django-tastetours | 5577742bd97f1eafc23ebf75317afa4015ee48fc | [
"Apache-2.0"
] | null | null | null | tastetoursjapan_project/blog/migrations/0004_auto_20180311_1751.py | AoiToShiro/django-tastetours | 5577742bd97f1eafc23ebf75317afa4015ee48fc | [
"Apache-2.0"
] | 7 | 2020-06-05T18:14:30.000Z | 2022-03-11T23:20:16.000Z | tastetoursjapan_project/blog/migrations/0004_auto_20180311_1751.py | AoiToShiro/django-tastetour | 5577742bd97f1eafc23ebf75317afa4015ee48fc | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-11 17:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20180311_1739'),
]
operations = [
migrations.AlterField(
model_name='post',
name='illustration',
... | 24.684211 | 132 | 0.614072 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20180311_1739'),
]
operations = [
migrations.AlterField(
model_name='post',
name='illustration',
field=models.ImageField(blank=True, d... | true | true |
08fdf405cc4e917f9719d3794bfacf845bd4552f | 7,309 | py | Python | appengine/findit/handlers/flake/detection/test/show_flake_test.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | appengine/findit/handlers/flake/detection/test/show_flake_test.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/findit/handlers/flake/detection/test/show_flake_test.py | NDevTK/chromium-infra | d38e088e158d81f7f2065a38aa1ea1894f735ec4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 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.
from datetime import datetime
import json
import mock
import webapp2
from handlers.flake.detection import show_flake
from libs import time_util
from model.f... | 32.775785 | 80 | 0.55288 |
from datetime import datetime
import json
import mock
import webapp2
from handlers.flake.detection import show_flake
from libs import time_util
from model.flake.detection.flake_occurrence import FlakeOccurrence
from model.flake.flake import Flake
from model.flake.flake_issue import FlakeIssue
from model.flake.flake_t... | true | true |
08fdf4795406466b6ec79823acd3620b8c0191e0 | 10,393 | py | Python | tests/func/grammar/test_grammar.py | SupraSummus/parglare | da9c4992ac6f7f6bb05f657733cb4221da88782a | [
"MIT"
] | null | null | null | tests/func/grammar/test_grammar.py | SupraSummus/parglare | da9c4992ac6f7f6bb05f657733cb4221da88782a | [
"MIT"
] | 1 | 2019-09-22T18:01:34.000Z | 2019-09-22T18:01:34.000Z | tests/func/grammar/test_grammar.py | SupraSummus/parglare-slim | da9c4992ac6f7f6bb05f657733cb4221da88782a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from parglare import Parser, Grammar
from parglare.grammar import ASSOC_LEFT, ASSOC_RIGHT, DEFAULT_PRIORITY
from parglare.exceptions import GrammarError, ParseError
def test_single_terminal():
"""
Test that grammar may be just a sin... | 20.662028 | 79 | 0.581834 | from __future__ import unicode_literals
import pytest
from parglare import Parser, Grammar
from parglare.grammar import ASSOC_LEFT, ASSOC_RIGHT, DEFAULT_PRIORITY
from parglare.exceptions import GrammarError, ParseError
def test_single_terminal():
grammar = r"""
S: A;
terminals
A: "a";
"""
g = ... | true | true |
08fdf553ff6580345de6c38b3191581b5751c834 | 94,263 | py | Python | pynetdicom/service_class.py | WoonchanCho/pynetdicom | 137284817df3a605a677af5ee4294e961a7cc6d7 | [
"MIT"
] | null | null | null | pynetdicom/service_class.py | WoonchanCho/pynetdicom | 137284817df3a605a677af5ee4294e961a7cc6d7 | [
"MIT"
] | null | null | null | pynetdicom/service_class.py | WoonchanCho/pynetdicom | 137284817df3a605a677af5ee4294e961a7cc6d7 | [
"MIT"
] | null | null | null | """Implements the supported Service Classes."""
from io import BytesIO
import logging
import os
import sys
import traceback
from pydicom.dataset import Dataset
from pynetdicom import evt, _config
from pynetdicom.dsutils import decode, encode, pretty_dataset
from pynetdicom.dimse_primitives import (
C_STORE, C_EC... | 37.450536 | 83 | 0.551065 |
from io import BytesIO
import logging
import os
import sys
import traceback
from pydicom.dataset import Dataset
from pynetdicom import evt, _config
from pynetdicom.dsutils import decode, encode, pretty_dataset
from pynetdicom.dimse_primitives import (
C_STORE, C_ECHO, C_MOVE, C_GET, C_FIND,
N_ACTION, N_CREAT... | true | true |
08fdf5c28375297ddaaa7d8d673640aa7191e21c | 62,907 | py | Python | clone_competition_simulation/general_sim_class.py | michaelhall28/clone-competition-simulation | deaa68ce020fa3c1b8fa499c91c829bad4f0def6 | [
"MIT"
] | 1 | 2021-03-02T13:44:04.000Z | 2021-03-02T13:44:04.000Z | clone_competition_simulation/general_sim_class.py | michaelhall28/clone-competition-simulation | deaa68ce020fa3c1b8fa499c91c829bad4f0def6 | [
"MIT"
] | null | null | null | clone_competition_simulation/general_sim_class.py | michaelhall28/clone-competition-simulation | deaa68ce020fa3c1b8fa499c91c829bad4f0def6 | [
"MIT"
] | null | null | null | import numpy as np
import math
# import matplotlib as mpl
# mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import itertools
import bisect
from collections import Counter
import pickle
from clone_competition_simulation.useful_functions import mean_clone_size, mean_clone_size_fit, surviving_clo... | 49.886598 | 158 | 0.636368 | import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import itertools
import bisect
from collections import Counter
import pickle
from clone_competition_simulation.useful_functions import mean_clone_size, mean_clone_size_fit, surviving_clones_fit, \
incomplete_moment, add_incom_... | true | true |
08fdf5e16e21413460c4341072929165cc76705a | 2,006 | py | Python | aldryn_tabnav/migrations/0001_initial.py | what-digital/aldryn-tabnav | 07d57612aafa252bde3116d1549d5f9e6ba3d24a | [
"BSD-3-Clause"
] | null | null | null | aldryn_tabnav/migrations/0001_initial.py | what-digital/aldryn-tabnav | 07d57612aafa252bde3116d1549d5f9e6ba3d24a | [
"BSD-3-Clause"
] | null | null | null | aldryn_tabnav/migrations/0001_initial.py | what-digital/aldryn-tabnav | 07d57612aafa252bde3116d1549d5f9e6ba3d24a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0003_auto_20140926_2347'),
]
operations = [
migrations.CreateModel(
name='TabDropDownPlugin',
... | 40.12 | 209 | 0.581256 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0003_auto_20140926_2347'),
]
operations = [
migrations.CreateModel(
name='TabDropDownPlugin',
fields=[
... | true | true |
08fdf61dbfc1e25b097faddd4d498b4f4cd85edf | 3,724 | py | Python | tests/distances_tests.py | samyoo78/NearPy | 1b534b864d320d875508e95cd2b76b6d8c07a90b | [
"MIT"
] | 624 | 2015-01-02T21:45:28.000Z | 2022-03-02T11:04:27.000Z | tests/distances_tests.py | samyoo78/NearPy | 1b534b864d320d875508e95cd2b76b6d8c07a90b | [
"MIT"
] | 65 | 2015-02-06T09:47:46.000Z | 2021-09-26T01:45:26.000Z | tests/distances_tests.py | samyoo78/NearPy | 1b534b864d320d875508e95cd2b76b6d8c07a90b | [
"MIT"
] | 136 | 2015-01-07T04:45:41.000Z | 2021-11-25T17:46:07.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 33.25 | 90 | 0.674006 |
import numpy
import scipy
import unittest
from nearpy.distances import EuclideanDistance, CosineDistance, ManhattanDistance
def check_distance_symmetry(test_obj, distance):
for k in range(100):
x = numpy.random.randn(10)
y = numpy.random.randn(10)
d_xy = distance.distance(x, y)
... | true | true |
08fdf68995784138b6060f03601254566ec1aed1 | 5,265 | py | Python | OpenAI Gym/openAI_planarCraneContinuous_episodeDataProcessing.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | 12 | 2015-03-03T18:32:03.000Z | 2021-03-13T18:50:37.000Z | OpenAI Gym/openAI_planarCraneContinuous_episodeDataProcessing.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | null | null | null | OpenAI Gym/openAI_planarCraneContinuous_episodeDataProcessing.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | 7 | 2017-01-20T20:31:54.000Z | 2021-12-28T16:52:48.000Z | #! /usr/bin/env python
###############################################################################
# openAI_planarCrane_episodeDataProcessing.py
#
# script to process the episode data saved in the CRAWLAB planar_crane
# OpenAI gym environment
#
# NOTE: Any plotting is set up for output, not viewing on screen.
# ... | 30.970588 | 104 | 0.678253 |
import numpy as np
import matplotlib.pyplot as plt
FILENAME = 'example_data/EpisodeData_2017-07-15_110856.csv'
CABLE_LENGTH = 2.0
t, theta, theta_dot, x, x_dot, x_ddot, reward = np.loadtxt(FILENAME, delimiter=',', unpack=True)
# ---- Plot the payload angle -------------------------------------------------
# Set t... | true | true |
08fdf702695276c0ae59508ad65ecc5f400626ae | 9,265 | py | Python | textbox/module/Generator/SeqGANGenerator.py | LucasTsui0725/TextBox | 5918dfd29e0c57f983b81f0da5080b2613387bce | [
"MIT"
] | 1 | 2021-03-25T15:13:02.000Z | 2021-03-25T15:13:02.000Z | textbox/module/Generator/SeqGANGenerator.py | Timothy023/TextBox | bb96e16bcfa63a7f84461b5678f7718566385a8d | [
"MIT"
] | null | null | null | textbox/module/Generator/SeqGANGenerator.py | Timothy023/TextBox | bb96e16bcfa63a7f84461b5678f7718566385a8d | [
"MIT"
] | null | null | null | # @Time : 2020/11/15
# @Author : Tianyi Tang
# @Email : steventang@ruc.edu.cn
r"""
SeqGAN Generator
#####################
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from textbox.model.abstract_generator import UnconditionalGenerator
class SeqGANGenerator(UnconditionalGener... | 44.119048 | 129 | 0.58435 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from textbox.model.abstract_generator import UnconditionalGenerator
class SeqGANGenerator(UnconditionalGenerator):
def __init__(self, config, dataset):
super(SeqGANGenerator, self).__init__(config, dataset)
self.hid... | true | true |
08fdf80eec6ad3301e47e6d8aea9fad29aa81c0d | 100 | py | Python | applications/module1/apps.py | SergKrasnikov/AsteriskARI_wss | 6808eec34d01e8a97d013d73f62a00eb01f0c181 | [
"MIT"
] | null | null | null | applications/module1/apps.py | SergKrasnikov/AsteriskARI_wss | 6808eec34d01e8a97d013d73f62a00eb01f0c181 | [
"MIT"
] | null | null | null | applications/module1/apps.py | SergKrasnikov/AsteriskARI_wss | 6808eec34d01e8a97d013d73f62a00eb01f0c181 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ProjsConfig(AppConfig):
name = 'applications.module1'
| 16.666667 | 33 | 0.77 | from django.apps import AppConfig
class ProjsConfig(AppConfig):
name = 'applications.module1'
| true | true |
08fdf8665744d25d9f15852337ed0037a90f31fb | 30,828 | py | Python | tensorflow_federated/python/aggregators/primitives.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/aggregators/primitives.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/aggregators/primitives.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, The TensorFlow Federated 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 o... | 42.346154 | 80 | 0.728364 |
import collections
import attr
import tensorflow as tf
from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.common_libs import structure
from tensorflow_federated.python.core.api import computations
from tensorflow_federated.python.core.impl.federated_context import intri... | true | true |
08fdf8738fb6f233309c85f04b3d3ca3b5d09f32 | 2,257 | py | Python | curvetime/db/couch.py | Dasudian/curvetime | 9d3211aa1d2c7a24a3379152a95033586573c4d8 | [
"Apache-2.0"
] | 5 | 2021-05-16T12:52:57.000Z | 2022-02-25T10:12:31.000Z | curvetime/db/couch.py | Dasudian/curvetime | 9d3211aa1d2c7a24a3379152a95033586573c4d8 | [
"Apache-2.0"
] | null | null | null | curvetime/db/couch.py | Dasudian/curvetime | 9d3211aa1d2c7a24a3379152a95033586573c4d8 | [
"Apache-2.0"
] | 1 | 2022-03-30T16:31:50.000Z | 2022-03-30T16:31:50.000Z | import requests
import json
from app.settings import COUCH_SERVER_URL, COUCH_DATABASE
def init_db(db_name=COUCH_DATABASE):
res = requests.put(COUCH_SERVER_URL + db_name)
if res.status_code == 201 or res.status_code == 200:
return True
else:
return False
def put(key, value, db=COUCH_DATAB... | 25.077778 | 69 | 0.596367 | import requests
import json
from app.settings import COUCH_SERVER_URL, COUCH_DATABASE
def init_db(db_name=COUCH_DATABASE):
res = requests.put(COUCH_SERVER_URL + db_name)
if res.status_code == 201 or res.status_code == 200:
return True
else:
return False
def put(key, value, db=COUCH_DATAB... | true | true |
08fdf903fb2c48de3d6ea2635ed8b78d096b7d46 | 4,987 | py | Python | src/core/tests/widgets/test_progressbar.py | luizoti/toga | 3c49e685f325f1aba2ce048b253402d7e4519f97 | [
"BSD-3-Clause"
] | 1,261 | 2019-03-31T16:28:47.000Z | 2022-03-31T09:01:23.000Z | src/core/tests/widgets/test_progressbar.py | luizoti/toga | 3c49e685f325f1aba2ce048b253402d7e4519f97 | [
"BSD-3-Clause"
] | 597 | 2019-04-02T20:02:42.000Z | 2022-03-30T10:28:47.000Z | src/core/tests/widgets/test_progressbar.py | luizoti/toga | 3c49e685f325f1aba2ce048b253402d7e4519f97 | [
"BSD-3-Clause"
] | 318 | 2019-03-31T18:32:00.000Z | 2022-03-30T18:07:13.000Z | import toga
import toga_dummy
from toga_dummy.utils import TestCase
# ### ProgressBar truth table
#
# | max | running | Behavior |
# |---------|-----------|-------------------------|
# | None | False | disabled |
# | None | True | indeterminate anim. |
# | number ... | 38.361538 | 97 | 0.673551 | import toga
import toga_dummy
from toga_dummy.utils import TestCase
class ProgressBarTests(TestCase):
def setUp(self):
super().setUp()
self.progress_bar = toga.ProgressBar(factory=toga_dummy.factory)
def test_widget_created(self):
self.assertEqual(self.progress_bar._impl.interface, ... | true | true |
08fdf914afd9c75776b07ac2e8c7d458487f58ab | 20,395 | py | Python | fairseq/models/fairseq_model.py | Csinclair0/fairseq | 6d9cf6a850c31d12a3ac63e89b005756b09cebeb | [
"MIT"
] | null | null | null | fairseq/models/fairseq_model.py | Csinclair0/fairseq | 6d9cf6a850c31d12a3ac63e89b005756b09cebeb | [
"MIT"
] | null | null | null | fairseq/models/fairseq_model.py | Csinclair0/fairseq | 6d9cf6a850c31d12a3ac63e89b005756b09cebeb | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Base classes for various fairseq models.
"""
import logging
from argparse import Namespace
from typing import Dict, List, Optional, Tuple
... | 35.780702 | 102 | 0.630498 |
import logging
from argparse import Namespace
from typing import Dict, List, Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import utils
from fairseq.data import Dictionary
from fairseq.dataclass.utils import (
convert_namespace_to_omegaconf,
gen_parser_from_da... | true | true |
08fdf98dc5304df89e903861d4477c324ca37341 | 1,513 | py | Python | machine_learning/sklearn-polynomial.py | willcanniford/python-notes | 1c2a33ab976e589fc6f801de2b6bd740d3aca2d7 | [
"MIT"
] | null | null | null | machine_learning/sklearn-polynomial.py | willcanniford/python-notes | 1c2a33ab976e589fc6f801de2b6bd740d3aca2d7 | [
"MIT"
] | null | null | null | machine_learning/sklearn-polynomial.py | willcanniford/python-notes | 1c2a33ab976e589fc6f801de2b6bd740d3aca2d7 | [
"MIT"
] | null | null | null | # Import the libraries and functions that we are going to need
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
# Load in some fake data for comparison
data = pd.read_csv('./data/polynomial.csv'... | 39.815789 | 80 | 0.752148 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
data = pd.read_csv('./data/polynomial.csv')
X = data[['Var_X']].values.reshape(-1, 1)
y = data[['Var_Y']].values
poly_feat = PolynomialFeatures... | true | true |
08fdf9e87fc86a4e90e8be3c4fe32f21c07635be | 11,981 | py | Python | pocketsmith/model/provider_provider_notices.py | theY4Kman/python-pocketsmith | 4acb39269354d4bc376d6459756c9debc1d97d1d | [
"MIT"
] | 2 | 2020-10-12T08:54:39.000Z | 2021-06-23T11:05:33.000Z | pocketsmith/model/provider_provider_notices.py | theY4Kman/python-pocketsmith | 4acb39269354d4bc376d6459756c9debc1d97d1d | [
"MIT"
] | 5 | 2020-10-09T21:58:04.000Z | 2021-07-11T00:59:05.000Z | pocketsmith/model/provider_provider_notices.py | theY4Kman/python-pocketsmith | 4acb39269354d4bc376d6459756c9debc1d97d1d | [
"MIT"
] | 1 | 2021-07-03T07:35:05.000Z | 2021-07-03T07:35:05.000Z | """
PocketSmith
The public PocketSmith API # noqa: E501
The version of the OpenAPI document: 2.0+0.3.3
Contact: api@pocketsmith.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from pocketsmith.model_utils import ( # noqa: F401
ApiTypeE... | 43.886447 | 121 | 0.568567 |
import re import sys
from pocketsmith.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
from ..mo... | true | true |
08fdfb569b3a0bb72cb6e945af9b445c3eaed661 | 1,267 | py | Python | apps/clientes/managers.py | Kingarturs/mercedez-crm | 882c0bb4c011a41e82c203ebd1e0b36dc075dfd7 | [
"Apache-2.0"
] | null | null | null | apps/clientes/managers.py | Kingarturs/mercedez-crm | 882c0bb4c011a41e82c203ebd1e0b36dc075dfd7 | [
"Apache-2.0"
] | null | null | null | apps/clientes/managers.py | Kingarturs/mercedez-crm | 882c0bb4c011a41e82c203ebd1e0b36dc075dfd7 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.base_user import BaseUserManager
class EmpleadoManager(BaseUserManager):
"""
Custom user model manager where email is the unique identifiers
for authentication instead of usernames.
"""
def create_user(self, username, password, **extra_fields):
"""
Create an... | 40.870968 | 76 | 0.66614 | from django.contrib.auth.base_user import BaseUserManager
class EmpleadoManager(BaseUserManager):
def create_user(self, username, password, **extra_fields):
if not username:
raise ValueError(_('Es necesario definir un nombre de usuario'))
user = self.model(username=username, **extra_fie... | true | true |
08fdfcb551c3d733cd0847f17e1f2353909ca1c5 | 3,050 | py | Python | pysecuritas/api/alarm.py | Cebeerre/VerisureAPIClient | 4b7fa04fc1e6ea76ca17e674c2141b84e956b95e | [
"MIT"
] | 13 | 2019-09-30T16:04:27.000Z | 2020-11-30T18:19:41.000Z | pysecuritas/api/alarm.py | Cebeerre/VerisureAPIClient | 4b7fa04fc1e6ea76ca17e674c2141b84e956b95e | [
"MIT"
] | 6 | 2019-12-02T00:38:04.000Z | 2020-12-02T16:29:38.000Z | pysecuritas/api/alarm.py | Cebeerre/pysecuritas | 4b7fa04fc1e6ea76ca17e674c2141b84e956b95e | [
"MIT"
] | 3 | 2020-12-02T17:23:13.000Z | 2021-11-14T17:47:35.000Z | # -*- coding: utf-8 -*-
"""
:copyright: © pysecuritas, All Rights Reserved
"""
from pysecuritas.api.installation import Installation, DEFAULT_TIMEOUT
def get_available_commands():
"""
Returns all available commands
"""
return {
"ARM": "arm all sensors (inside)",
"ARMDAY": "arm in... | 24.206349 | 103 | 0.587541 |
from pysecuritas.api.installation import Installation, DEFAULT_TIMEOUT
def get_available_commands():
return {
"ARM": "arm all sensors (inside)",
"ARMDAY": "arm in day mode (inside)",
"ARMNIGHT": "arm in night mode (inside)",
"PERI": "arm (only) the perimeter sensors",
"DA... | true | true |
08fdfe54def66dd762de103e2b6ea4ff092cd5e9 | 465 | py | Python | vexbi/client.py | vexbiexchange/python-api-client | ad5b22c466edf628aaa8f91e425977ebe6776134 | [
"MIT"
] | null | null | null | vexbi/client.py | vexbiexchange/python-api-client | ad5b22c466edf628aaa8f91e425977ebe6776134 | [
"MIT"
] | null | null | null | vexbi/client.py | vexbiexchange/python-api-client | ad5b22c466edf628aaa8f91e425977ebe6776134 | [
"MIT"
] | null | null | null | from .api_auth import RequestsApiAuth
from .config import PRODUCTION_URL, SANDBOX_URL
class Client:
def __init__(self, app_id, secret_key):
self.sandbox = False
self.auth = RequestsApiAuth(app_id, secret_key)
self.base_url = PRODUCTION_URL
def use_sandbox(self):
self.sandbox = True
self.base_u... | 24.473684 | 51 | 0.724731 | from .api_auth import RequestsApiAuth
from .config import PRODUCTION_URL, SANDBOX_URL
class Client:
def __init__(self, app_id, secret_key):
self.sandbox = False
self.auth = RequestsApiAuth(app_id, secret_key)
self.base_url = PRODUCTION_URL
def use_sandbox(self):
self.sandbox = True
self.base_u... | true | true |
08fdfe81790c44e193ce58de4e3b34c1d6ad3590 | 5,131 | py | Python | main.py | BlinkCreator/Machinelearning_MINIST | 02ccefa92c9fd794d7fc1cbc0e2b7767c931c563 | [
"MIT"
] | 2 | 2020-10-21T02:15:15.000Z | 2022-01-08T04:40:16.000Z | main.py | BlinkCreator/Machinelearning_MINIST | 02ccefa92c9fd794d7fc1cbc0e2b7767c931c563 | [
"MIT"
] | null | null | null | main.py | BlinkCreator/Machinelearning_MINIST | 02ccefa92c9fd794d7fc1cbc0e2b7767c931c563 | [
"MIT"
] | null | null | null | from __future__ import print_function
import torch
import torch.optim as optim
import torchvision
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from models.conv import Net
from models.rnn_conv import ImageRNN
import torch.nn.functional as F
import matplotlib.pyplot as plt
impo... | 35.386207 | 97 | 0.606704 | from __future__ import print_function
import torch
import torch.optim as optim
import torchvision
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from models.conv import Net
from models.rnn_conv import ImageRNN
import torch.nn.functional as F
import matplotlib.pyplot as plt
impo... | true | true |
08fdfe915bb97bf2aace04455f329b1ee050286c | 2,655 | py | Python | IronManFly/storage/db/tests/tests-mysql.py | leepand/IronManFly | ea29bf1415a51b23a0fbc95f2bae82013a0887a4 | [
"MIT"
] | 599 | 2015-01-01T09:01:25.000Z | 2022-03-14T00:46:20.000Z | db/tests/tests-mysql.py | m00zh33/db.py | df2dbb8ef947c2d4253d31f29eb58c4084daffc5 | [
"BSD-2-Clause"
] | 36 | 2015-01-05T15:14:17.000Z | 2022-03-16T03:41:19.000Z | db/tests/tests-mysql.py | m00zh33/db.py | df2dbb8ef947c2d4253d31f29eb58c4084daffc5 | [
"BSD-2-Clause"
] | 104 | 2015-01-05T16:30:27.000Z | 2022-02-22T01:06:20.000Z | import pandas as pd
from db import DB, list_profiles, remove_profile
import unittest
class PandaSQLTest(unittest.TestCase):
def setUp(self):
self.db = DB(username='root', dbname='Chinook', dbtype='mysql')
def test_query_rowsum(self):
df = self.db.query("select * from Artist;")
self.a... | 31.987952 | 71 | 0.651224 | import pandas as pd
from db import DB, list_profiles, remove_profile
import unittest
class PandaSQLTest(unittest.TestCase):
def setUp(self):
self.db = DB(username='root', dbname='Chinook', dbtype='mysql')
def test_query_rowsum(self):
df = self.db.query("select * from Artist;")
self.a... | true | true |
08fdfef8cd2da92eca110d6593d6a995b54062da | 721 | py | Python | algorithms/sorting/selection_sort.py | jmcguire/learning | acdb5e420d60dc4dd816e124c59f99c17310002b | [
"MIT"
] | null | null | null | algorithms/sorting/selection_sort.py | jmcguire/learning | acdb5e420d60dc4dd816e124c59f99c17310002b | [
"MIT"
] | null | null | null | algorithms/sorting/selection_sort.py | jmcguire/learning | acdb5e420d60dc4dd816e124c59f99c17310002b | [
"MIT"
] | null | null | null | # selection sort
#
# type: transposition
# best time: O(n²)
# average time: O(n²)
# worst time: O(n²)
#
# find the highest element, and swap it with the last element
# repeat for length - 1, length - 2, etc
def selection_sort(A):
# starting at the last element down to 0, see if there's an higher element, and sw... | 26.703704 | 89 | 0.628294 |
def selection_sort(A):
for i in xrange(len(A)-1, 0, -1):
# first, find the maximum element
max_element = i
for j in xrange (0, i+1):
if A[j] > A[max_element]:
max_element = j
#print "starting at %d: %s" % (i, A[i])
#print "our maximum element is %d: %s" % (max_element, A[max_ele... | true | true |
08fdffffc881ba09ba5ff8ef5413224a833bab9d | 611 | py | Python | app.py | akagaeng/flask-download-file-from-browser | d3298c950fd9199506d3f31700e14ead99b7f9c3 | [
"Apache-2.0"
] | 1 | 2020-12-02T07:34:58.000Z | 2020-12-02T07:34:58.000Z | app.py | akagaeng/flask-download-file-from-browser | d3298c950fd9199506d3f31700e14ead99b7f9c3 | [
"Apache-2.0"
] | null | null | null | app.py | akagaeng/flask-download-file-from-browser | d3298c950fd9199506d3f31700e14ead99b7f9c3 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, render_template, send_file
app = Flask(__name__)
out_file = 'output.txt'
def write_file(filename, text):
with open(filename, "w") as f:
f.write(text)
return True
@app.route('/', methods=['GET'])
def root():
return render_template('index.html')
@app.route('/tex... | 22.62963 | 60 | 0.674304 | from flask import Flask, request, render_template, send_file
app = Flask(__name__)
out_file = 'output.txt'
def write_file(filename, text):
with open(filename, "w") as f:
f.write(text)
return True
@app.route('/', methods=['GET'])
def root():
return render_template('index.html')
@app.route('/tex... | true | true |
08fe0061eb36b783c27449c29aa88408176447ac | 3,677 | py | Python | scrapy/spiders/sitemap.py | atharwa-24/scrapy | 96b22046e1f68243ca380ece7daa0d65aa501697 | [
"BSD-3-Clause"
] | null | null | null | scrapy/spiders/sitemap.py | atharwa-24/scrapy | 96b22046e1f68243ca380ece7daa0d65aa501697 | [
"BSD-3-Clause"
] | null | null | null | scrapy/spiders/sitemap.py | atharwa-24/scrapy | 96b22046e1f68243ca380ece7daa0d65aa501697 | [
"BSD-3-Clause"
] | null | null | null | import logging
import re
from scrapy.http import Request
from scrapy.http import XmlResponse
from scrapy.spiders import Spider
from scrapy.utils.gz import gunzip
from scrapy.utils.gz import gzip_magic_number
from scrapy.utils.sitemap import Sitemap
from scrapy.utils.sitemap import sitemap_urls_from_robots
logger = lo... | 34.688679 | 79 | 0.586076 | import logging
import re
from scrapy.http import Request
from scrapy.http import XmlResponse
from scrapy.spiders import Spider
from scrapy.utils.gz import gunzip
from scrapy.utils.gz import gzip_magic_number
from scrapy.utils.sitemap import Sitemap
from scrapy.utils.sitemap import sitemap_urls_from_robots
logger = lo... | true | true |
08fe006f29be8d1f635d9fb06fc86e40f2221e4a | 5,499 | py | Python | cons3rt/models/aws_client_configuration_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | cons3rt/models/aws_client_configuration_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | cons3rt/models/aws_client_configuration_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | """
Copyright 2020 Jackpine Technologies 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 ... | 32.538462 | 122 | 0.635388 |
import pprint
import re
import six
from cons3rt.configuration import Configuration
__author__ = 'Jackpine Technologies Corporation'
__copyright__ = 'Copyright 2020, Jackpine Technologies Corporation'
__license__ = 'Apache 2.0',
__version__ = '1.0.0'
__maintainer__ = 'API Support'
__email__ = 'support@cons3rt.com... | true | true |
08fe008f92a18b023abc41db6987904ce463fc22 | 3,099 | py | Python | selfdrive/car/saicmotor/interface.py | leecqchn/openpilot | c0b4afeb7c00902f97c37b2c577261a642dd48d6 | [
"MIT"
] | 2 | 2021-08-08T15:06:56.000Z | 2022-03-08T02:47:08.000Z | selfdrive/car/saicmotor/interface.py | leecqchn/openpilot | c0b4afeb7c00902f97c37b2c577261a642dd48d6 | [
"MIT"
] | null | null | null | selfdrive/car/saicmotor/interface.py | leecqchn/openpilot | c0b4afeb7c00902f97c37b2c577261a642dd48d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from cereal import car
from selfdrive.car.saicmotor.values import CAR
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint,get_safety_config
from selfdrive.car.interfaces import CarInterfaceBase
class CarInterface(CarInterfaceBase):
@staticmet... | 36.892857 | 120 | 0.711197 | from cereal import car
from selfdrive.car.saicmotor.values import CAR
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint,get_safety_config
from selfdrive.car.interfaces import CarInterfaceBase
class CarInterface(CarInterfaceBase):
@staticmethod
def get_params(ca... | true | true |
08fe01ba9389d9e0f6ee3d854149eded54e23fcd | 6,559 | py | Python | sdk/python/pulumi_azure_nextgen/web/v20190801/web_app_slot_configuration_names.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/web/v20190801/web_app_slot_configuration_names.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/web/v20190801/web_app_slot_configuration_names.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 44.619048 | 530 | 0.664583 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['WebAppSlotConfigurationNames']
class WebAppSlotConfigurationNames(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
08fe01d435ca9edb8b4d2e4e9cfdab1f6e9c4dfa | 2,275 | py | Python | webservices/resources/dates.py | dwillis/openFEC | dae84b0e526eac4a917e80697a7999956f9c96cb | [
"CC0-1.0"
] | 2 | 2020-04-09T15:29:43.000Z | 2021-01-13T12:08:22.000Z | webservices/resources/dates.py | dwillis/openFEC | dae84b0e526eac4a917e80697a7999956f9c96cb | [
"CC0-1.0"
] | null | null | null | webservices/resources/dates.py | dwillis/openFEC | dae84b0e526eac4a917e80697a7999956f9c96cb | [
"CC0-1.0"
] | null | null | null | from datetime import date
from flask.ext.restful import Resource
from webservices import args
from webservices import spec
from webservices import utils
from webservices import schemas
from webservices.common import models
from webservices.common.util import filter_query
def filter_upcoming(query, column, kwargs):
... | 25.561798 | 75 | 0.663297 | from datetime import date
from flask.ext.restful import Resource
from webservices import args
from webservices import spec
from webservices import utils
from webservices import schemas
from webservices.common import models
from webservices.common.util import filter_query
def filter_upcoming(query, column, kwargs):
... | true | true |
08fe0284195a3bcca45d3e38a99471dd90fb127c | 994 | py | Python | esmvalcore/cmor/_fixes/cmip5/noresm1_me.py | markelg/ESMValCore | b2f7ffc3232f174dd5ebc50ad20b4a02d3517c2c | [
"Apache-2.0"
] | 26 | 2019-06-07T07:50:07.000Z | 2022-03-22T21:04:01.000Z | esmvalcore/cmor/_fixes/cmip5/noresm1_me.py | markelg/ESMValCore | b2f7ffc3232f174dd5ebc50ad20b4a02d3517c2c | [
"Apache-2.0"
] | 1,370 | 2019-06-06T09:03:07.000Z | 2022-03-31T04:37:20.000Z | esmvalcore/cmor/_fixes/cmip5/noresm1_me.py | zklaus/ESMValCore | 5656fb8b546eeb4d750a424de7ed56a237edfabb | [
"Apache-2.0"
] | 26 | 2019-07-03T13:08:48.000Z | 2022-03-02T16:08:47.000Z | """Fixes for NorESM1-ME model."""
from ..fix import Fix
from ..shared import round_coordinates
class Pr(Fix):
"""Fix errors for pr."""
def fix_metadata(self, cubes):
"""Fix metadata.
Fixes latitude coordinate inaccuracies
Data is fixed in-place, as well as returned
Paramete... | 20.708333 | 78 | 0.575453 | from ..fix import Fix
from ..shared import round_coordinates
class Pr(Fix):
def fix_metadata(self, cubes):
return round_coordinates(cubes, 12, coord_names=['latitude'])
class Tas(Fix):
def fix_metadata(self, cubes):
return round_coordinates(cubes, 12)
| true | true |
08fe02afb4ef2414572bbd7363fe986eff1f176e | 1,621 | py | Python | threatminer/komand_threatminer/actions/email_domain/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | threatminer/komand_threatminer/actions/email_domain/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | threatminer/komand_threatminer/actions/email_domain/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
EMAIL = "email"
class Output:
RESPONSE = "response"
class EmailDomainInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"email": {
"type": "stri... | 19.297619 | 76 | 0.489204 | import komand
import json
class Input:
EMAIL = "email"
class Output:
RESPONSE = "response"
class EmailDomainInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"email": {
"type": "string",
"title": "Email",
"desc... | true | true |
08fe039a2b3f9185d62b8e5533a6c7d4fb6ff3fc | 38,998 | py | Python | audiomentations/augmentations/transforms.py | alumae/audiomentations | 275347fcfcf14ea395d228c192efa57496addf8f | [
"MIT"
] | null | null | null | audiomentations/augmentations/transforms.py | alumae/audiomentations | 275347fcfcf14ea395d228c192efa57496addf8f | [
"MIT"
] | null | null | null | audiomentations/augmentations/transforms.py | alumae/audiomentations | 275347fcfcf14ea395d228c192efa57496addf8f | [
"MIT"
] | null | null | null | import functools
import os
import random
import sys
import tempfile
import uuid
import warnings
import librosa
import numpy as np
from scipy.signal import butter, sosfilt, convolve
from audiomentations.core.audio_loading_utils import load_sound_file
from audiomentations.core.transforms_interface import BaseWaveformTr... | 40.080164 | 101 | 0.636186 | import functools
import os
import random
import sys
import tempfile
import uuid
import warnings
import librosa
import numpy as np
from scipy.signal import butter, sosfilt, convolve
from audiomentations.core.audio_loading_utils import load_sound_file
from audiomentations.core.transforms_interface import BaseWaveformTr... | true | true |
08fe04b9066725259987e8fc9fcd9550528fe742 | 1,914 | py | Python | xpark/settings.py | xaviermathew/Xpark | 13f4c2e2f1c323a6baf772b81d5deefb9e3a9ebc | [
"MIT"
] | 1 | 2020-10-30T09:15:49.000Z | 2020-10-30T09:15:49.000Z | xpark/settings.py | xaviermathew/Xpark | 13f4c2e2f1c323a6baf772b81d5deefb9e3a9ebc | [
"MIT"
] | 4 | 2021-06-08T22:54:18.000Z | 2022-03-12T00:52:29.000Z | xpark/settings.py | xaviermathew/Xpark | 13f4c2e2f1c323a6baf772b81d5deefb9e3a9ebc | [
"MIT"
] | null | null | null | import importlib
import logging
import multiprocessing
import warnings
def get_object_from_python_path(python_path):
parts = python_path.split('.')
class_name = parts.pop(-1)
mod_path = '.'.join(parts)
mod = importlib.import_module(mod_path)
return getattr(mod, class_name)
FILE_INSPECT_SAMPLE_SI... | 29.90625 | 91 | 0.757576 | import importlib
import logging
import multiprocessing
import warnings
def get_object_from_python_path(python_path):
parts = python_path.split('.')
class_name = parts.pop(-1)
mod_path = '.'.join(parts)
mod = importlib.import_module(mod_path)
return getattr(mod, class_name)
FILE_INSPECT_SAMPLE_SI... | true | true |
08fe0739760f134b2f9fc43055a1232eddda9bd1 | 88,323 | py | Python | xarray/tests/test_variable.py | ashwinvis/xarray | 333e8dba55f0165ccadf18f2aaaee9257a4d716b | [
"Apache-2.0"
] | null | null | null | xarray/tests/test_variable.py | ashwinvis/xarray | 333e8dba55f0165ccadf18f2aaaee9257a4d716b | [
"Apache-2.0"
] | null | null | null | xarray/tests/test_variable.py | ashwinvis/xarray | 333e8dba55f0165ccadf18f2aaaee9257a4d716b | [
"Apache-2.0"
] | null | null | null | import warnings
from copy import copy, deepcopy
from datetime import datetime, timedelta
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
import pytz
from xarray import Coordinate, Dataset, IndexVariable, Variable, set_options
from xarray.core import dtypes, duck_array_ops, indexing
fr... | 37.110504 | 88 | 0.55057 | import warnings
from copy import copy, deepcopy
from datetime import datetime, timedelta
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
import pytz
from xarray import Coordinate, Dataset, IndexVariable, Variable, set_options
from xarray.core import dtypes, duck_array_ops, indexing
fr... | true | true |
08fe080eb6757966038e1f6a6bf2da0be8e5341a | 27,319 | py | Python | sympy/polys/domains/tests/test_domains.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | sympy/polys/domains/tests/test_domains.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 7 | 2017-05-01T14:15:32.000Z | 2017-09-06T20:44:24.000Z | sympy/polys/domains/tests/test_domains.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 1 | 2018-09-03T03:02:06.000Z | 2018-09-03T03:02:06.000Z | """Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... """
from sympy import S, sqrt, sin, oo, Poly, Float
from sympy.abc import x, y, z
from sympy.polys.domains import ZZ, QQ, RR, CC, FF, GF, EX
from sympy.polys.domains.realfield import RealField
from sympy.polys.rings import ring
from s... | 35.341527 | 122 | 0.604415 |
from sympy import S, sqrt, sin, oo, Poly, Float
from sympy.abc import x, y, z
from sympy.polys.domains import ZZ, QQ, RR, CC, FF, GF, EX
from sympy.polys.domains.realfield import RealField
from sympy.polys.rings import ring
from sympy.polys.fields import field
from sympy.polys.polyerrors import (
UnificationFai... | true | true |
08fe094ac8278955f6b1b6a9a6e23c405533181b | 421 | py | Python | get_common_pattern.py | IanWE/DevSec | 0af9fe12608c7d5cedc344750cc5e43365f527b1 | [
"MIT"
] | 1 | 2022-01-03T12:15:23.000Z | 2022-01-03T12:15:23.000Z | get_common_pattern.py | IanWE/DevSec | 0af9fe12608c7d5cedc344750cc5e43365f527b1 | [
"MIT"
] | null | null | null | get_common_pattern.py | IanWE/DevSec | 0af9fe12608c7d5cedc344750cc5e43365f527b1 | [
"MIT"
] | 1 | 2021-03-04T09:16:25.000Z | 2021-03-04T09:16:25.000Z | import os
l=os.popen("cat pattern_analysis3.txt").read().split("=============================================")
l0 = l[0]
l1 = l[1]
l0 = l0.split("\n")
l0 = filter(lambda x:"***" in x,l0)
l0 = list(l0)
ll0 = list(map(lambda x:x.split(" Pattern ")[1],l0))
ll0 = list(filter(lambda x:x in l1,ll0))
ll0 = list(map(lambda ... | 21.05 | 101 | 0.508314 | import os
l=os.popen("cat pattern_analysis3.txt").read().split("=============================================")
l0 = l[0]
l1 = l[1]
l0 = l0.split("\n")
l0 = filter(lambda x:"***" in x,l0)
l0 = list(l0)
ll0 = list(map(lambda x:x.split(" Pattern ")[1],l0))
ll0 = list(filter(lambda x:x in l1,ll0))
ll0 = list(map(lambda ... | true | true |
08fe0950e7c1cd6d2a4703322e542f7c8d9c4f9b | 76,033 | py | Python | test/unit/test_case_management_v1.py | nathan-hekman/platform-services-python-sdk | 498c56c33bff040a77f073448563aeed550a2074 | [
"Apache-2.0"
] | 10 | 2020-04-02T15:48:33.000Z | 2021-06-23T05:12:49.000Z | test/unit/test_case_management_v1.py | nathan-hekman/platform-services-python-sdk | 498c56c33bff040a77f073448563aeed550a2074 | [
"Apache-2.0"
] | 151 | 2020-03-30T20:24:39.000Z | 2022-03-30T16:51:22.000Z | test/unit/test_case_management_v1.py | nathan-hekman/platform-services-python-sdk | 498c56c33bff040a77f073448563aeed550a2074 | [
"Apache-2.0"
] | 25 | 2020-04-16T21:03:19.000Z | 2021-12-13T19:37:39.000Z | # -*- coding: utf-8 -*-
# (C) Copyright IBM Corp. 2021.
#
# 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 l... | 41.707625 | 1,284 | 0.622979 |
from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator
import inspect
import io
import json
import pytest
import re
import requests
import responses
import tempfile
import urllib
from ibm_platform_services.case_management_v1 import *
service = CaseManagementV1(
authenticator=NoA... | true | true |
08fe0adeeb630723679b87ef934d6eba43ecc670 | 2,156 | py | Python | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[es_US-2015] 1.py | ghlecl/holidata | 1db24d4aecab7ec7a007720987d84ffb0988b6db | [
"MIT"
] | null | null | null | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[es_US-2015] 1.py | ghlecl/holidata | 1db24d4aecab7ec7a007720987d84ffb0988b6db | [
"MIT"
] | null | null | null | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[es_US-2015] 1.py | ghlecl/holidata | 1db24d4aecab7ec7a007720987d84ffb0988b6db | [
"MIT"
] | null | null | null | [
{
'date': '2015-01-01',
'description': 'Año Neuvo',
'locale': 'es-US',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2015-01-19',
'description': 'Cumpleaños de Martin Luther King, Jr.',
'locale': 'es-US',
'notes': '',
... | 22 | 63 | 0.366883 | [
{
'date': '2015-01-01',
'description': 'Año Neuvo',
'locale': 'es-US',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2015-01-19',
'description': 'Cumpleaños de Martin Luther King, Jr.',
'locale': 'es-US',
'notes': '',
... | true | true |
08fe0c0a964c4db9fc97c02a1a696511285647c2 | 3,547 | py | Python | ingestion/src/metadata/ingestion/ometa/mixins/lineageMixin.py | tomtor/OpenMetadata | c925168f6503c6db74742b87caf1a4011b89beea | [
"Apache-2.0"
] | null | null | null | ingestion/src/metadata/ingestion/ometa/mixins/lineageMixin.py | tomtor/OpenMetadata | c925168f6503c6db74742b87caf1a4011b89beea | [
"Apache-2.0"
] | null | null | null | ingestion/src/metadata/ingestion/ometa/mixins/lineageMixin.py | tomtor/OpenMetadata | c925168f6503c6db74742b87caf1a4011b89beea | [
"Apache-2.0"
] | null | null | null | """
Mixin class containing Lineage specific methods
To be used by OpenMetadata class
"""
import logging
from typing import Any, Dict, Generic, Optional, Type, TypeVar, Union
from pydantic import BaseModel
from metadata.generated.schema.api.lineage.addLineage import AddLineage
from metadata.ingestion.ometa.client imp... | 30.843478 | 106 | 0.593177 | import logging
from typing import Any, Dict, Generic, Optional, Type, TypeVar, Union
from pydantic import BaseModel
from metadata.generated.schema.api.lineage.addLineage import AddLineage
from metadata.ingestion.ometa.client import REST, APIError
logger = logging.getLogger(__name__)
T = TypeVar("T", bound=BaseModel... | true | true |
08fe0d07b713fa7506d91a62cab6e43e7a033a9b | 10,381 | py | Python | PP4E/Examples/PP4E/Internet/Web/dev/PyMailCGI_2.1/cgi-bin/commonhtml.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | PP4E/Examples/PP4E/Internet/Web/dev/PyMailCGI_2.1/cgi-bin/commonhtml.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | PP4E/Examples/PP4E/Internet/Web/dev/PyMailCGI_2.1/cgi-bin/commonhtml.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | #!/usr/bin/python
##############################################################################
# generate standard page header, list, and footer HTML; isolates html
# generation-related details in this file; text printed here goes over a
# socket to the client, to create parts of a new web page in the web brows... | 44.553648 | 81 | 0.586071 | ##############################################################################
import cgi, urllib, sys, os
sys.stderr = sys.stdout # show error messages in browser
from externs import mailconfig # from a package somewhere on server
# my cgi address root
#urlroot = 'http://starship.python... | false | true |
08fe0d121caaa9d0a7aae9db76f686be98e98c94 | 4,351 | py | Python | contrib/seeds/generate-seeds.py | asuka431/litecoin-1 | 53497759a4888994c788c58abca7ae3686c7a559 | [
"MIT"
] | 1 | 2021-03-21T05:22:18.000Z | 2021-03-21T05:22:18.000Z | contrib/seeds/generate-seeds.py | asuka431/litecoin-1 | 53497759a4888994c788c58abca7ae3686c7a559 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | asuka431/litecoin-1 | 53497759a4888994c788c58abca7ae3686c7a559 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.302158 | 98 | 0.580326 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:-6], T... | true | true |
08fe0dcc6d7b727eef9c791e49eda8552325d553 | 1,601 | py | Python | venv/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312prober.py | realxwx/leetcode-solve | 3a7d7d8e92a5fd5fecc347d141a1c532b92e763e | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312prober.py | realxwx/leetcode-solve | 3a7d7d8e92a5fd5fecc347d141a1c532b92e763e | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/pip/_vendor/chardet/gb2312prober.py | realxwx/leetcode-solve | 3a7d7d8e92a5fd5fecc347d141a1c532b92e763e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020
# Author: xiaoweixiang
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
#
# Contributor(s):
# Mark Pilgrim - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU L... | 34.804348 | 69 | 0.70456 |
from .mbcharsetprober import MultiByteCharSetProber
from .codingstatemachine import CodingStateMachine
from .chardistribution import GB2312DistributionAnalysis
from .mbcssm import GB2312_SM_MODEL
class GB2312Prober(MultiByteCharSetProber):
def __init__(self):
super(GB2312Prober, self).__init__()
... | true | true |
08fe0dccccf4ad89cff3669ff12bfcbf27fba734 | 7,492 | py | Python | setup.py | BowenBao/fairseq | a9f5741f58c05c581686b73465d7e3f9df5528f3 | [
"MIT"
] | 24 | 2021-10-18T04:17:07.000Z | 2022-03-24T08:13:37.000Z | setup.py | BowenBao/fairseq | a9f5741f58c05c581686b73465d7e3f9df5528f3 | [
"MIT"
] | 10 | 2021-11-14T12:28:48.000Z | 2022-02-28T14:13:40.000Z | setup.py | BowenBao/fairseq | a9f5741f58c05c581686b73465d7e3f9df5528f3 | [
"MIT"
] | 5 | 2021-11-10T08:55:33.000Z | 2022-03-14T14:57:48.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import subprocess
import sys
from setuptools import setup, find_packages, Extension
from setuptools import E... | 28.815385 | 92 | 0.56914 |
import os
import subprocess
import sys
from setuptools import setup, find_packages, Extension
from setuptools import Extension, find_packages, setup
if sys.version_info < (3, 6):
sys.exit("Sorry, Python >= 3.6 is required for fairseq.")
def write_version_py():
with open(os.path.join("fairseq", "version.tx... | true | true |
08fe0df082e0cd2a743a60348492c8ea28440225 | 9,887 | py | Python | art/attacks/virtual_adversarial.py | ziqizh/adversarial-robustness-toolbox | 801d714e3f5a4651dfce587ce01674724b7fc318 | [
"MIT"
] | 2 | 2019-11-05T17:23:37.000Z | 2021-07-26T15:09:44.000Z | art/attacks/virtual_adversarial.py | liuye6666/adversarial-robustness-toolbox | 548febd02770bf06d9e0bb34974b3d98ec889865 | [
"MIT"
] | null | null | null | art/attacks/virtual_adversarial.py | liuye6666/adversarial-robustness-toolbox | 548febd02770bf06d9e0bb34974b3d98ec889865 | [
"MIT"
] | 1 | 2019-12-22T22:18:15.000Z | 2019-12-22T22:18:15.000Z | # MIT License
#
# Copyright (C) IBM Corporation 2018
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | 48.229268 | 120 | 0.636391 | from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
from art import NUMPY_DTYPE
from art.classifiers.classifier import ClassifierNeuralNetwork, ClassifierGradients
from art.attacks.attack import Attack
logger = logging.getLogger(__name__)
class Virt... | true | true |
08fe0e4f0e6064a899df09d2e2605991d6884f80 | 1,878 | py | Python | apps/analyzer/tfidf.py | starsep/NewsBlur | 6c59416ca82377ca1bbc7d044890bdead3eba904 | [
"MIT"
] | 3,073 | 2015-01-01T07:20:18.000Z | 2022-03-31T20:33:41.000Z | apps/analyzer/tfidf.py | starsep/NewsBlur | 6c59416ca82377ca1bbc7d044890bdead3eba904 | [
"MIT"
] | 1,054 | 2015-01-02T13:32:35.000Z | 2022-03-30T04:21:21.000Z | apps/analyzer/tfidf.py | starsep/NewsBlur | 6c59416ca82377ca1bbc7d044890bdead3eba904 | [
"MIT"
] | 676 | 2015-01-03T16:40:29.000Z | 2022-03-30T14:00:40.000Z | #!/usr/bin/env python
"""
The simplest TF-IDF library imaginable.
Add your documents as two-element lists `[docname, [list_of_words_in_the_document]]` with `addDocument(docname, list_of_words)`. Get a list of all the `[docname, similarity_score]` pairs relative to a document by calling `similarities([list_of_words])`.... | 33.535714 | 253 | 0.607561 |
import sys
import os
class tfidf:
def __init__(self):
self.weighted = False
self.documents = []
self.corpus_dict = {}
def addDocument(self, doc_name, list_of_words):
doc_dict = {}
for w in list_of_words:
doc_dict[w] = doc_dict.get(w, 0.) + 1.0
... | true | true |
08fe1018e2eaea7f6fbadd6867ee23b567f99607 | 1,483 | py | Python | rift/fib_route.py | kennethhuang123/rift-python | f4c208fe39cb14535573708637fa2345c919666b | [
"Apache-2.0"
] | 43 | 2018-07-19T17:41:35.000Z | 2022-03-16T04:04:09.000Z | rift/fib_route.py | kennethhuang123/rift-python | f4c208fe39cb14535573708637fa2345c919666b | [
"Apache-2.0"
] | 96 | 2018-07-19T11:06:08.000Z | 2021-07-27T10:52:09.000Z | rift/fib_route.py | kennethhuang123/rift-python | f4c208fe39cb14535573708637fa2345c919666b | [
"Apache-2.0"
] | 29 | 2018-07-24T22:01:20.000Z | 2022-02-13T21:28:18.000Z | import packet_common
class FibRoute:
"""
A route in the routing information base (RIB), also known as forwarding table.
"""
def __init__(self, prefix, next_hops):
self.prefix = prefix
self.next_hops = next_hops
def __repr__(self):
next_hops_str = ", ".join([str(next_hop) ... | 32.23913 | 89 | 0.554956 | import packet_common
class FibRoute:
def __init__(self, prefix, next_hops):
self.prefix = prefix
self.next_hops = next_hops
def __repr__(self):
next_hops_str = ", ".join([str(next_hop) for next_hop in sorted(self.next_hops)])
return "%s -> %s" % (packet_common.ip_prefix_str(s... | true | true |
08fe1048319186761fb6cf7983fb8848b3a49b5a | 1,516 | py | Python | tests/test_bot_filter.py | pierfani/instabot | 2eb724e2f7e7e14df67098c71a871f036574e33c | [
"Apache-2.0"
] | 4 | 2019-08-17T01:20:52.000Z | 2020-01-08T11:59:43.000Z | tests/test_bot_filter.py | pierfani/instabot | 2eb724e2f7e7e14df67098c71a871f036574e33c | [
"Apache-2.0"
] | 4 | 2019-02-25T08:48:07.000Z | 2019-03-07T17:06:15.000Z | tests/test_bot_filter.py | pierfani/instabot | 2eb724e2f7e7e14df67098c71a871f036574e33c | [
"Apache-2.0"
] | 5 | 2019-04-10T04:53:14.000Z | 2020-05-17T09:10:06.000Z | import pytest
import responses
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from instabot.api.config import API_URL
from .test_bot import TestBot
from .test_variables import TEST_USERNAME_INFO_ITEM
class TestBotFilter(TestBot):
@pytest.mark.parametrize('filter_users,f... | 32.255319 | 126 | 0.67942 | import pytest
import responses
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from instabot.api.config import API_URL
from .test_bot import TestBot
from .test_variables import TEST_USERNAME_INFO_ITEM
class TestBotFilter(TestBot):
@pytest.mark.parametrize('filter_users,f... | true | true |
08fe107e623ea42fe8df75bd9caad355ed5819a6 | 3,319 | py | Python | RFEM/LoadCasesAndCombinations/loadCombination.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 16 | 2021-10-13T21:00:11.000Z | 2022-03-21T11:12:09.000Z | RFEM/LoadCasesAndCombinations/loadCombination.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 49 | 2021-10-19T13:18:51.000Z | 2022-03-30T08:20:17.000Z | RFEM/LoadCasesAndCombinations/loadCombination.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 7 | 2021-10-13T06:06:24.000Z | 2022-03-29T17:48:39.000Z | from RFEM.initModel import Model, clearAtributes
from RFEM.enums import AnalysisType
class LoadCombination():
def __init__(self,
no: int = 1,
analysis_type = AnalysisType.ANALYSIS_TYPE_STATIC,
design_situation: int = 1,
user_defined_name = [False]... | 33.525253 | 91 | 0.602892 | from RFEM.initModel import Model, clearAtributes
from RFEM.enums import AnalysisType
class LoadCombination():
def __init__(self,
no: int = 1,
analysis_type = AnalysisType.ANALYSIS_TYPE_STATIC,
design_situation: int = 1,
user_defined_name = [False]... | true | true |
08fe11ccb58fa1161f0a12192476746856da6f6d | 12,392 | py | Python | arlie/arlie/envs/lunar_lander/python_protos/Lunar_pb2.py | PlainConcepts/ARLIE | 10b8992b0820e08fb649805e8bc12ff0509d78d9 | [
"MIT"
] | 9 | 2019-11-28T09:48:29.000Z | 2020-06-07T18:30:41.000Z | arlie/arlie/envs/lunar_lander/python_protos/Lunar_pb2.py | PlainConcepts/ARLIE | 10b8992b0820e08fb649805e8bc12ff0509d78d9 | [
"MIT"
] | null | null | null | arlie/arlie/envs/lunar_lander/python_protos/Lunar_pb2.py | PlainConcepts/ARLIE | 10b8992b0820e08fb649805e8bc12ff0509d78d9 | [
"MIT"
] | 3 | 2019-12-14T04:11:17.000Z | 2019-12-14T21:34:29.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Lunar.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.protobuf import reflection as _reflect... | 32.957447 | 1,177 | 0.737492 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
08fe1226c19a446449a2ff60f63232cdd7d3d3aa | 19,856 | py | Python | tacker/api/v1/attributes.py | Shinewisely/tackerservicemonitoring | 5af0594d69394e644096a8f47296af6c3c8a2e88 | [
"Apache-2.0"
] | 1 | 2020-10-13T05:20:38.000Z | 2020-10-13T05:20:38.000Z | tacker/api/v1/attributes.py | Shinewisely/tackerservicemonitoring | 5af0594d69394e644096a8f47296af6c3c8a2e88 | [
"Apache-2.0"
] | null | null | null | tacker/api/v1/attributes.py | Shinewisely/tackerservicemonitoring | 5af0594d69394e644096a8f47296af6c3c8a2e88 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 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... | 32.338762 | 79 | 0.621223 |
import re
import netaddr
from oslo_log import log as logging
from oslo_utils import uuidutils
import six
from tacker.common import exceptions as n_exc
LOG = logging.getLogger(__name__)
ATTRIBUTES_TO_UPDATE = 'attributes_to_update'
ATTR_NOT_SPECIFIED = object()
SHARED = 'shared'
UNLIMITED = None
def _verify_dic... | true | true |
08fe123c021362abb580e82aad9e72524b8233e5 | 14,604 | py | Python | tests/test_newick.py | benjeffery/tsconvert | a7d68389fedf269d45387ecc44842f6ffe24b2cc | [
"MIT"
] | null | null | null | tests/test_newick.py | benjeffery/tsconvert | a7d68389fedf269d45387ecc44842f6ffe24b2cc | [
"MIT"
] | null | null | null | tests/test_newick.py | benjeffery/tsconvert | a7d68389fedf269d45387ecc44842f6ffe24b2cc | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2019 Tskit Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... | 36.693467 | 91 | 0.619967 |
import unittest
import msprime
import numpy as np
import tskit
import itertools
import dendropy
import tsconvert
def kc_distance(tree1, tree2):
samples = tree1.tree_sequence.samples()
if not np.array_equal(samples, tree2.tree_sequence.samples()):
raise ValueError("Trees must have the same samples")... | true | true |
08fe1345ca6a56c70884b1aac71ba6990d3dfa25 | 9,363 | py | Python | build/PureCloudPlatformClientV2/models/locations_search_response.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/locations_search_response.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/locations_search_response.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 27.619469 | 80 | 0.586991 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class LocationsSearchResponse(object):
def __init__(self):
self.swagger_types = {
'total': 'int',
'page_count': 'int',
'page_size': 'int',
... | true | true |
08fe13d50ec512c32000cc595d35268b9c175be1 | 927 | py | Python | RSC_Baseline/unet/unet_model.py | wangbingo/mmsegmentation | a327b97d3ee0350a004864d1c3ce3aff37cc83e9 | [
"Apache-2.0"
] | null | null | null | RSC_Baseline/unet/unet_model.py | wangbingo/mmsegmentation | a327b97d3ee0350a004864d1c3ce3aff37cc83e9 | [
"Apache-2.0"
] | null | null | null | RSC_Baseline/unet/unet_model.py | wangbingo/mmsegmentation | a327b97d3ee0350a004864d1c3ce3aff37cc83e9 | [
"Apache-2.0"
] | null | null | null | import torch.nn.functional as F
from .unet_parts import *
class UNet(nn.Module):
def __init__(self, n_channels, n_classes):
super(UNet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.inc = DoubleConv(n_channels, 64)
self.down1 = Down(64, 128)... | 28.090909 | 46 | 0.541532 | import torch.nn.functional as F
from .unet_parts import *
class UNet(nn.Module):
def __init__(self, n_channels, n_classes):
super(UNet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.inc = DoubleConv(n_channels, 64)
self.down1 = Down(64, 128)... | true | true |
08fe13dc5d0329d9f58327ff0fef8bf72f1d62f5 | 86,361 | py | Python | moto/iam/responses.py | reilings/moto | 19a0d381e279cadae76c725987600730060c9c43 | [
"Apache-2.0"
] | 3 | 2020-08-04T20:29:41.000Z | 2020-11-09T09:28:19.000Z | moto/iam/responses.py | reilings/moto | 19a0d381e279cadae76c725987600730060c9c43 | [
"Apache-2.0"
] | null | null | null | moto/iam/responses.py | reilings/moto | 19a0d381e279cadae76c725987600730060c9c43 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import iam_backend, User
class IamResponse(BaseResponse):
def attach_role_policy(self):
policy_arn = self._get_param("PolicyArn")
role_name = self._get_param("RoleName")
iam_backend.attach_r... | 38.246678 | 138 | 0.683735 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import iam_backend, User
class IamResponse(BaseResponse):
def attach_role_policy(self):
policy_arn = self._get_param("PolicyArn")
role_name = self._get_param("RoleName")
iam_backend.attach_r... | true | true |
08fe1441bb8a96e5bf14088458e8e7ee858aa62e | 1,983 | py | Python | backend/chat/api/v1/viewsets.py | crowdbotics-apps/darksite-29277 | f9380c619a103fc2dc5ee1596c59e8749a0692f2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/chat/api/v1/viewsets.py | crowdbotics-apps/darksite-29277 | f9380c619a103fc2dc5ee1596c59e8749a0692f2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/chat/api/v1/viewsets.py | crowdbotics-apps/darksite-29277 | f9380c619a103fc2dc5ee1596c59e8749a0692f2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from rest_framework import authentication
from chat.models import (
ForwardedMessage,
Message,
ThreadMember,
MessageAction,
Thread,
ThreadAction,
)
from .serializers import (
ForwardedMessageSerializer,
MessageSerializer,
ThreadMemberSerializer,
MessageActionSerializer,
Threa... | 27.164384 | 53 | 0.754917 | from rest_framework import authentication
from chat.models import (
ForwardedMessage,
Message,
ThreadMember,
MessageAction,
Thread,
ThreadAction,
)
from .serializers import (
ForwardedMessageSerializer,
MessageSerializer,
ThreadMemberSerializer,
MessageActionSerializer,
Threa... | true | true |
08fe14db6a1c5a2d9b9dcb08b6bfca97ba4b9542 | 3,307 | py | Python | basic/list1.py | EHeneman/google-python-exercises | e3b764e0fb8f5be5576b770b3428e093bca314db | [
"Apache-2.0"
] | null | null | null | basic/list1.py | EHeneman/google-python-exercises | e3b764e0fb8f5be5576b770b3428e093bca314db | [
"Apache-2.0"
] | null | null | null | basic/list1.py | EHeneman/google-python-exercises | e3b764e0fb8f5be5576b770b3428e093bca314db | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the code for the functions below. main() is already set ... | 34.092784 | 79 | 0.604778 |
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the code for the functions below. main() is already set up
# to call the functions with a few different inputs,
# printing 'OK' when each function is correct.
# The starter code for each function includes a 'return'
# which i... | true | true |
08fe160c98ec84de0dc20fa293f5bd5f56206cbd | 5,925 | py | Python | synapse/api/auth_blocking.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | synapse/api/auth_blocking.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | synapse/api/auth_blocking.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2020 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 42.934783 | 88 | 0.637806 |
import logging
from typing import TYPE_CHECKING, Optional
from synapse.api.constants import LimitBlockingTypes, UserTypes
from synapse.api.errors import Codes, ResourceLimitError
from synapse.config.server import is_threepid_reserved
from synapse.types import Requester
if TYPE_CHECKING:
from synapse.server impor... | true | true |
08fe182f32593de3dee9b814dc05d8de121fbb6a | 10,872 | py | Python | django_gamification/models.py | hhenrichsen/django-gamification | 6c7ab214bb110e465135e0e37407f89b70b61514 | [
"BSD-2-Clause"
] | null | null | null | django_gamification/models.py | hhenrichsen/django-gamification | 6c7ab214bb110e465135e0e37407f89b70b61514 | [
"BSD-2-Clause"
] | null | null | null | django_gamification/models.py | hhenrichsen/django-gamification | 6c7ab214bb110e465135e0e37407f89b70b61514 | [
"BSD-2-Clause"
] | null | null | null | from django.db import models
from django.db.models import Sum
class GamificationInterface(models.Model):
"""
A user should have a foreign key to a GamificationInterface to keep track
of all gamification related objects.
game_tracking = ForeignKey(GamificationInterface)
"""
@property
def ... | 32.746988 | 93 | 0.619021 | from django.db import models
from django.db.models import Sum
class GamificationInterface(models.Model):
@property
def points(self):
return PointChange.objects.filter(interface=self).aggregate(
Sum('amount'))['amount__sum'] or 0
def reset(self):
... | true | true |
08fe184e34d0aa0b747612712ac64432a629788a | 478 | py | Python | dcodex_lectionary/migrations/0028_auto_20200813_2236.py | rbturnbull/dcodex_lectionary | 9a4787eb353d09fef023cd82af8859a7ee041aee | [
"Apache-2.0"
] | null | null | null | dcodex_lectionary/migrations/0028_auto_20200813_2236.py | rbturnbull/dcodex_lectionary | 9a4787eb353d09fef023cd82af8859a7ee041aee | [
"Apache-2.0"
] | 2 | 2021-08-09T01:11:59.000Z | 2021-08-09T01:12:49.000Z | dcodex_lectionary/migrations/0028_auto_20200813_2236.py | rbturnbull/dcodex_lectionary | 9a4787eb353d09fef023cd82af8859a7ee041aee | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.6 on 2020-08-13 12:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dcodex_lectionary', '0027_affiliationlectionarysystem'),
]
operations = [
migrations.AlterModelOptions(
name='affiliationlectionarysyste... | 21.727273 | 66 | 0.60251 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dcodex_lectionary', '0027_affiliationlectionarysystem'),
]
operations = [
migrations.AlterModelOptions(
name='affiliationlectionarysystem',
options={},
),
m... | true | true |
08fe18882962e9756dfc5acbda174ed9ad2d2e22 | 784 | py | Python | configs/reco/deeplabv3plus-no-pretrain_2x8_8k_sar_building_rs2_hoekman.py | yoyoyoohh/SAR_build_extract_v2 | 7e2d21ead8e65b263d18d1059e5ce8ff2df4fbe6 | [
"Apache-2.0"
] | null | null | null | configs/reco/deeplabv3plus-no-pretrain_2x8_8k_sar_building_rs2_hoekman.py | yoyoyoohh/SAR_build_extract_v2 | 7e2d21ead8e65b263d18d1059e5ce8ff2df4fbe6 | [
"Apache-2.0"
] | null | null | null | configs/reco/deeplabv3plus-no-pretrain_2x8_8k_sar_building_rs2_hoekman.py | yoyoyoohh/SAR_build_extract_v2 | 7e2d21ead8e65b263d18d1059e5ce8ff2df4fbe6 | [
"Apache-2.0"
] | null | null | null | '''
Author: Shuailin Chen
Created Date: 2021-09-04
Last Modified: 2021-12-29
content:
'''
_base_=[
'../_base_/models/deeplabv3plus_r50-d8.py',
'../_base_/datasets/sar_building_rs2_hoekman.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_20k.py'
]
model = dict(
pretrained=None,
... | 25.290323 | 72 | 0.690051 |
_base_=[
'../_base_/models/deeplabv3plus_r50-d8.py',
'../_base_/datasets/sar_building_rs2_hoekman.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_20k.py'
]
model = dict(
pretrained=None,
backbone=dict(
in_channels = 9,
)
)
runner = dict(type='IterB... | true | true |
08fe18ceeaea3d739a31942a2794555709644801 | 936 | py | Python | GOOGLE_FOOBAR/the grandest staircase of them all.py | WarlonZeng/Big4-Hackerrank | 90791d2df5fffea648dbef1dff56c1bc7062203e | [
"MIT"
] | 1 | 2017-02-17T01:17:58.000Z | 2017-02-17T01:17:58.000Z | GOOGLE_FOOBAR/the grandest staircase of them all.py | WarlonZeng/Big4-Hackerrank | 90791d2df5fffea648dbef1dff56c1bc7062203e | [
"MIT"
] | null | null | null | GOOGLE_FOOBAR/the grandest staircase of them all.py | WarlonZeng/Big4-Hackerrank | 90791d2df5fffea648dbef1dff56c1bc7062203e | [
"MIT"
] | null | null | null | from math import *
def countPart(remainder, prev, memo):
if (remainder == 0 or prev == 1): # last block
return 0;
if (memo[remainder][prev] != -1): # not empty space
return memo[remainder][prev];
count = 0;
if (prev > remainder):
count += 1;
for i in ra... | 20.8 | 56 | 0.503205 | from math import *
def countPart(remainder, prev, memo):
if (remainder == 0 or prev == 1): return 0;
if (memo[remainder][prev] != -1): return memo[remainder][prev];
count = 0;
if (prev > remainder):
count += 1;
for i in range(int(sqrt(remainder * 2)), r... | true | true |
08fe1ab9a07c3de0d617967d181f0ac9696a7a4a | 21,137 | py | Python | tests/test_wycheproof.py | matheusd/trezor-crypto | a7463bcb852f1b553a941e8dd753b87ca9a88d57 | [
"MIT"
] | 3 | 2019-01-24T12:21:28.000Z | 2019-05-22T13:12:13.000Z | tests/test_wycheproof.py | matheusd/trezor-crypto | a7463bcb852f1b553a941e8dd753b87ca9a88d57 | [
"MIT"
] | 1 | 2022-03-15T11:52:46.000Z | 2022-03-15T11:52:46.000Z | tests/test_wycheproof.py | matheusd/trezor-crypto | a7463bcb852f1b553a941e8dd753b87ca9a88d57 | [
"MIT"
] | 3 | 2018-12-18T06:59:13.000Z | 2020-06-04T23:32:00.000Z | #!/usr/bin/python
import ctypes
import json
import os
from binascii import hexlify, unhexlify
import pytest
from pyasn1.codec.ber.decoder import decode as ber_decode
from pyasn1.codec.der.decoder import decode as der_decode
from pyasn1.codec.der.encoder import encode as der_encode
from pyasn1.type import namedtype, un... | 29.275623 | 87 | 0.617306 | import ctypes
import json
import os
from binascii import hexlify, unhexlify
import pytest
from pyasn1.codec.ber.decoder import decode as ber_decode
from pyasn1.codec.der.decoder import decode as der_decode
from pyasn1.codec.der.encoder import encode as der_encode
from pyasn1.type import namedtype, univ
class EcSigna... | true | true |
08fe1b0c77185031520e0a4bdb2b7909727f2f88 | 228 | py | Python | spirit/comment/bookmark/apps.py | Ke-xueting/Spirit | 346d9a0db125ee8995ba5d0ab0fd8b43aa8c5dc7 | [
"MIT"
] | 974 | 2015-01-02T12:56:00.000Z | 2022-03-24T00:01:54.000Z | spirit/comment/bookmark/apps.py | Ke-xueting/Spirit | 346d9a0db125ee8995ba5d0ab0fd8b43aa8c5dc7 | [
"MIT"
] | 247 | 2015-01-07T02:59:26.000Z | 2022-02-23T08:27:57.000Z | spirit/comment/bookmark/apps.py | BinaryTree0/fer3 | 85c3bbf2f328e69ad4d7c01b6e2c8d4ef1d9e0a3 | [
"MIT"
] | 366 | 2015-01-08T10:22:25.000Z | 2022-02-21T12:58:31.000Z | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class SpiritCommentBookmarkConfig(AppConfig):
name = 'spirit.comment.bookmark'
verbose_name = "Spirit Comment Bookmark"
label = 'spirit_comment_bookmark'
| 20.727273 | 45 | 0.72807 |
from django.apps import AppConfig
class SpiritCommentBookmarkConfig(AppConfig):
name = 'spirit.comment.bookmark'
verbose_name = "Spirit Comment Bookmark"
label = 'spirit_comment_bookmark'
| true | true |
08fe1b1c9da851146c1300c706295e37a4ca338e | 710 | py | Python | pygsp/filters/gabor.py | naspert/pygsp | 361f0258a210193f482c6197ea879765a9041e91 | [
"BSD-3-Clause"
] | null | null | null | pygsp/filters/gabor.py | naspert/pygsp | 361f0258a210193f482c6197ea879765a9041e91 | [
"BSD-3-Clause"
] | 1 | 2018-03-29T09:39:45.000Z | 2018-03-29T09:39:45.000Z | pygsp/filters/gabor.py | naspert/pygsp | 361f0258a210193f482c6197ea879765a9041e91 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from pygsp import utils
from . import Filter # prevent circular import in Python < 3.5
_logger = utils.build_logger(__name__)
class Gabor(Filter):
r"""Design a Gabor filter bank.
Design a filter bank where the kernel *k* is placed at each graph
frequency.
Parameters
-... | 18.684211 | 69 | 0.532394 |
from pygsp import utils
from . import Filter
_logger = utils.build_logger(__name__)
class Gabor(Filter):
def __init__(self, G, k):
Nf = G.e.shape[0]
g = []
for i in range(Nf):
g.append(lambda x, ii=i: k(x - G.e[ii]))
super(Gabor, self).__init__(G, g)
| true | true |
08fe1c958df19236a740eb0b32985115392f782d | 1,996 | py | Python | archive.py | guliverza/AdditionalPylons | 37336dcd1678c6cdfa22d881c2178ba65cb1fd61 | [
"MIT"
] | null | null | null | archive.py | guliverza/AdditionalPylons | 37336dcd1678c6cdfa22d881c2178ba65cb1fd61 | [
"MIT"
] | null | null | null | archive.py | guliverza/AdditionalPylons | 37336dcd1678c6cdfa22d881c2178ba65cb1fd61 | [
"MIT"
] | null | null | null | import sc2
from sc2.ids.ability_id import AbilityId
from sc2.constants import *
_debug = False
class Archive:
def __init__(self, unit):
self.tag = unit.tag
self.unit = unit
self.label = 'Idle'
#research flags.
self._psionic_storm_researched = False
self._psionic_storm_started = False
se... | 24.341463 | 122 | 0.697395 | import sc2
from sc2.ids.ability_id import AbilityId
from sc2.constants import *
_debug = False
class Archive:
def __init__(self, unit):
self.tag = unit.tag
self.unit = unit
self.label = 'Idle'
self._psionic_storm_researched = False
self._psionic_storm_started = False
self.current_researc... | true | true |
08fe1e3defdd25fbc0bb9513665ad606625cbdde | 4,133 | py | Python | openmdao/code_review/test_lint_peps.py | naylor-b/blue | d7d7e8d63212c047a7a9b0625da98aa29ddc39b4 | [
"Apache-2.0"
] | null | null | null | openmdao/code_review/test_lint_peps.py | naylor-b/blue | d7d7e8d63212c047a7a9b0625da98aa29ddc39b4 | [
"Apache-2.0"
] | null | null | null | openmdao/code_review/test_lint_peps.py | naylor-b/blue | d7d7e8d63212c047a7a9b0625da98aa29ddc39b4 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import unittest
import os
from fnmatch import fnmatch, filter as fnfilter
try:
import pycodestyle
except ImportError:
pycodestyle = None
try:
import pydocstyle
except ImportError:
pydocstyle = None
import re
# fill in patterns to exclude directories here
dir_ex... | 32.543307 | 97 | 0.579482 | from __future__ import print_function
import unittest
import os
from fnmatch import fnmatch, filter as fnfilter
try:
import pycodestyle
except ImportError:
pycodestyle = None
try:
import pydocstyle
except ImportError:
pydocstyle = None
import re
dir_excludes = [
'docs',
'_*',
'tests',
... | true | true |
08fe1e8fd559b124dde041434c4ccba7e69e9ac9 | 3,475 | py | Python | tests/test_utils.py | rafmudaf/dash-slicer | e959f1ea94f3bb1d061acd3f18727227a08144ed | [
"MIT"
] | 18 | 2020-12-16T09:49:00.000Z | 2022-03-18T11:38:32.000Z | tests/test_utils.py | rafmudaf/dash-slicer | e959f1ea94f3bb1d061acd3f18727227a08144ed | [
"MIT"
] | 43 | 2020-11-05T13:54:34.000Z | 2022-01-14T08:45:54.000Z | tests/test_utils.py | rafmudaf/dash-slicer | e959f1ea94f3bb1d061acd3f18727227a08144ed | [
"MIT"
] | 3 | 2020-12-15T21:20:36.000Z | 2021-07-26T17:40:02.000Z | from dash_slicer.utils import (
img_as_ubyte,
img_array_to_uri,
get_thumbnail_size,
shape3d_to_size2d,
mask_to_coloured_slices,
)
import numpy as np
from pytest import raises
def test_img_as_ubyte():
im = np.zeros((100, 100), np.float32)
im[0, 0] = 100
# Anything but uint8 is stretc... | 30.482456 | 86 | 0.647482 | from dash_slicer.utils import (
img_as_ubyte,
img_array_to_uri,
get_thumbnail_size,
shape3d_to_size2d,
mask_to_coloured_slices,
)
import numpy as np
from pytest import raises
def test_img_as_ubyte():
im = np.zeros((100, 100), np.float32)
im[0, 0] = 100
im2 = img_as_ubyte(im)
... | true | true |
08fe1f47d6fa697084dfba187ac5ae0c8add190b | 4,247 | py | Python | alshamelah_api/apps/chatrooms/models.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | alshamelah_api/apps/chatrooms/models.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | alshamelah_api/apps/chatrooms/models.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | import os
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
from .managers import SeminarManager, DiscussionManager, DiscussionRegistrationManager, SeminarRegistrationManager
from ..core.models import BaseModel
class RoomType(BaseModel):
name = ... | 28.313333 | 115 | 0.65717 | import os
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
from .managers import SeminarManager, DiscussionManager, DiscussionRegistrationManager, SeminarRegistrationManager
from ..core.models import BaseModel
class RoomType(BaseModel):
name = ... | true | true |
08fe1fc48f805e55503220d9f165d5bcabb74fe3 | 581 | py | Python | pipenv/vendor/distlib/__init__.py | illgitthat/pipenv | 02fc63964052720a6804165d68f6075841627e09 | [
"MIT"
] | 3 | 2020-02-16T07:04:50.000Z | 2020-02-21T12:45:30.000Z | pipenv/vendor/distlib/__init__.py | whisperbb/pipenv | bfbe1304f63372a0eb7c1531590b51195db453ea | [
"MIT"
] | 23 | 2020-06-12T08:20:51.000Z | 2021-06-25T15:38:50.000Z | pipenv/vendor/distlib/__init__.py | whisperbb/pipenv | bfbe1304f63372a0eb7c1531590b51195db453ea | [
"MIT"
] | 1 | 2020-12-04T17:49:26.000Z | 2020-12-04T17:49:26.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import logging
__version__ = '0.2.9'
class DistlibException(Exception):
pass
try:
from logging import NullHandler
except Impor... | 24.208333 | 75 | 0.712565 | import logging
__version__ = '0.2.9'
class DistlibException(Exception):
pass
try:
from logging import NullHandler
except ImportError: class NullHandler(logging.Handler):
def handle(self, record): pass
def emit(self, record): pass
def createLock(self): self.lock = None
logger = lo... | true | true |
08fe2081cd7fca959d41bbc3691636b82dba1d3f | 7,223 | py | Python | spyder/plugins/explorer/widgets/tests/test_fileassociations.py | suokunlong/spyder | 2d5d450fdcef232fb7f38e7fefc27f0e7f704c9a | [
"MIT"
] | 1 | 2018-05-03T02:14:15.000Z | 2018-05-03T02:14:15.000Z | spyder/plugins/explorer/widgets/tests/test_fileassociations.py | jastema/spyder | 0ef48ea227c53f57556cd8002087dc404b0108b0 | [
"MIT"
] | null | null | null | spyder/plugins/explorer/widgets/tests/test_fileassociations.py | jastema/spyder | 0ef48ea227c53f57556cd8002087dc404b0108b0 | [
"MIT"
] | 1 | 2020-03-05T03:09:11.000Z | 2020-03-05T03:09:11.000Z | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# ----------------------------------------------------------------------------
"""
Tests for explorer plugin utilities.
"""
#... | 30.476793 | 78 | 0.669113 |
import os
import os.path as osp
import sys
from qtpy.QtCore import Qt, QTimer
import pytest
from spyder.plugins.explorer.widgets.fileassociations import (
ApplicationsDialog, FileAssociationsWidget, InputTextDialog)
def test_input_text_dialog(qtbot):
widget = InputTextDialog()
qtbot.addWidget(widget)
... | true | true |
08fe20823eb3e1467447592a613d2c47cebb6caa | 6,062 | py | Python | tests/test_docs.py | Naveenaidu/moban | 5a4d41546a99f66b39e7deb3e216c9238fa3b07b | [
"MIT"
] | null | null | null | tests/test_docs.py | Naveenaidu/moban | 5a4d41546a99f66b39e7deb3e216c9238fa3b07b | [
"MIT"
] | null | null | null | tests/test_docs.py | Naveenaidu/moban | 5a4d41546a99f66b39e7deb3e216c9238fa3b07b | [
"MIT"
] | null | null | null | import os
import sys
from textwrap import dedent
from mock import patch
from nose.tools import eq_
from moban.main import main
def custom_dedent(long_texts):
refined = dedent(long_texts)
if refined.startswith("\n"):
refined = refined[1:]
return refined
class TestTutorial:
def setUp(self):
... | 25.578059 | 72 | 0.527714 | import os
import sys
from textwrap import dedent
from mock import patch
from nose.tools import eq_
from moban.main import main
def custom_dedent(long_texts):
refined = dedent(long_texts)
if refined.startswith("\n"):
refined = refined[1:]
return refined
class TestTutorial:
def setUp(self):
... | true | true |
08fe219bec4de06f09f024390b9ac10d89191802 | 8,430 | py | Python | greykite/tests/sklearn/estimator/test_one_by_one_estimator.py | kenzie-q/greykite | 9fb670b5325dd252759a490b31aa4d9494fdd68b | [
"BSD-2-Clause"
] | 1,503 | 2021-05-13T02:43:42.000Z | 2022-03-28T22:48:34.000Z | greykite/tests/sklearn/estimator/test_one_by_one_estimator.py | kenzie-q/greykite | 9fb670b5325dd252759a490b31aa4d9494fdd68b | [
"BSD-2-Clause"
] | 59 | 2021-05-15T07:23:18.000Z | 2022-03-31T18:52:00.000Z | greykite/tests/sklearn/estimator/test_one_by_one_estimator.py | kenzie-q/greykite | 9fb670b5325dd252759a490b31aa4d9494fdd68b | [
"BSD-2-Clause"
] | 67 | 2021-05-13T02:44:04.000Z | 2022-03-25T04:08:12.000Z | import datetime
import sys
import pandas as pd
import pytest
from sklearn.metrics import mean_squared_error
import greykite.common.constants as cst
from greykite.common.testing_utils import generate_df_for_tests
from greykite.sklearn.estimator.one_by_one_estimator import OneByOneEstimator
from greykite.sklearn.estima... | 32.053232 | 101 | 0.654211 | import datetime
import sys
import pandas as pd
import pytest
from sklearn.metrics import mean_squared_error
import greykite.common.constants as cst
from greykite.common.testing_utils import generate_df_for_tests
from greykite.sklearn.estimator.one_by_one_estimator import OneByOneEstimator
from greykite.sklearn.estima... | true | true |
08fe22ae703be06405983b3ccf34619c0a052758 | 8,801 | py | Python | python/raspberryPi/DFRobot_DS1307.py | DFRobot/DFRobot_CanBusHAT | 80eceb02dd511741c4f8749603fa77dff01b4404 | [
"MIT"
] | null | null | null | python/raspberryPi/DFRobot_DS1307.py | DFRobot/DFRobot_CanBusHAT | 80eceb02dd511741c4f8749603fa77dff01b4404 | [
"MIT"
] | null | null | null | python/raspberryPi/DFRobot_DS1307.py | DFRobot/DFRobot_CanBusHAT | 80eceb02dd511741c4f8749603fa77dff01b4404 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
'''!
@file DFRobot_DS1307.py
@brief Define infrastructure of DFRobot_DS1307 class
@details The clock/calendar provides seconds, minutes, hours,
@n day, date, month, and year information.
@copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
@license The MIT Lice... | 32.356618 | 128 | 0.674469 | import sys
import time
import smbus
import logging
from ctypes import *
logger = logging.getLogger()
logger.setLevel(logging.FATAL) ph = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s - [%(filename)s %(funcName)s]:%(lineno)d - %(levelname)s: %(message)s")
ph.setFormatter(formatter)
logger.add... | true | true |
08fe22c3e84c135c31eeb9870c3a2f711b4b6626 | 52,813 | py | Python | tests/test_sources.py | pji/pjinoise | 3967d69fa57be1136cdeb8f4a5d187ee455fa783 | [
"MIT"
] | 1 | 2021-04-07T06:20:55.000Z | 2021-04-07T06:20:55.000Z | tests/test_sources.py | pji/pjinoise | 3967d69fa57be1136cdeb8f4a5d187ee455fa783 | [
"MIT"
] | null | null | null | tests/test_sources.py | pji/pjinoise | 3967d69fa57be1136cdeb8f4a5d187ee455fa783 | [
"MIT"
] | null | null | null | """
test_sources
~~~~~~~~~~~~
Unit tests for the pjinoise.generator module.
"""
from copy import deepcopy
import unittest as ut
from unittest.mock import call, patch
import numpy as np
from pjinoise import sources as s
from pjinoise.common import grayscale_to_ints_list, print_array
from pjinoise.constants import P
... | 36.173288 | 77 | 0.471342 | from copy import deepcopy
import unittest as ut
from unittest.mock import call, patch
import numpy as np
from pjinoise import sources as s
from pjinoise.common import grayscale_to_ints_list, print_array
from pjinoise.constants import P
def source_fill_test(test, exp, src_cls, src_kwargs, size, loc=(0, 0, 0)):
s... | true | true |
08fe24561e37c3cb2fd9b494d84e33d0e61f778e | 209 | py | Python | junitparser/__init__.py | jianziqin/junitparser | 4ab38f9eb556b55cb16a6cae4b6be3526f634de5 | [
"Apache-2.0"
] | null | null | null | junitparser/__init__.py | jianziqin/junitparser | 4ab38f9eb556b55cb16a6cae4b6be3526f634de5 | [
"Apache-2.0"
] | null | null | null | junitparser/__init__.py | jianziqin/junitparser | 4ab38f9eb556b55cb16a6cae4b6be3526f634de5 | [
"Apache-2.0"
] | null | null | null | from .junitparser import (
JUnitXmlError,
Attr,
Element,
JUnitXml,
TestSuite,
Property,
Skipped,
Failure,
Error,
TestCase,
Properties,
IntAttr,
FloatAttr,
)
| 13.0625 | 26 | 0.588517 | from .junitparser import (
JUnitXmlError,
Attr,
Element,
JUnitXml,
TestSuite,
Property,
Skipped,
Failure,
Error,
TestCase,
Properties,
IntAttr,
FloatAttr,
)
| true | true |
08fe2499ffa6b9b099f7f7a722eafcdf9902eb24 | 1,602 | py | Python | apps/core/checkers.py | EvilFlowersCatalog/EvilFlowersCatalog | 30ac54eabe548cdb4ffd2d4aa1180de91eb25964 | [
"MIT"
] | 3 | 2022-02-10T09:19:58.000Z | 2022-03-25T22:42:08.000Z | apps/core/checkers.py | EvilFlowersCatalog/EvilFlowersCatalog | 30ac54eabe548cdb4ffd2d4aa1180de91eb25964 | [
"MIT"
] | 9 | 2022-01-21T14:01:14.000Z | 2022-02-23T18:59:42.000Z | apps/core/checkers.py | EvilFlowersCatalog/EvilFlowersCatalog | 30ac54eabe548cdb4ffd2d4aa1180de91eb25964 | [
"MIT"
] | null | null | null | from object_checker.base_object_checker import AbacChecker
from apps.core.models import User, Catalog, UserCatalog, Entry
class CatalogChecker(AbacChecker):
@staticmethod
def check_catalog_manage(user: User, obj: Catalog) -> bool:
if user.is_superuser:
return True
if not user.is_... | 27.62069 | 119 | 0.658552 | from object_checker.base_object_checker import AbacChecker
from apps.core.models import User, Catalog, UserCatalog, Entry
class CatalogChecker(AbacChecker):
@staticmethod
def check_catalog_manage(user: User, obj: Catalog) -> bool:
if user.is_superuser:
return True
if not user.is_... | true | true |
08fe2617f86c3e84ff84684acbfa77b100c971f0 | 4,141 | py | Python | list2.py | khastings232/se-q3-list1-list2 | 1ab0b1e38aa020654debdc77e802cc1bcedffeaa | [
"MIT"
] | null | null | null | list2.py | khastings232/se-q3-list1-list2 | 1ab0b1e38aa020654debdc77e802cc1bcedffeaa | [
"MIT"
] | null | null | null | list2.py | khastings232/se-q3-list1-list2 | 1ab0b1e38aa020654debdc77e802cc1bcedffeaa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Kenzie assignment: List2
"""
# Your name, plus anyone who helped you with this assignment.
# Give credit where credit is due.
__author__ = "Kyle Hastings"
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LIC... | 29.791367 | 77 | 0.617967 | __author__ = "Kyle Hastings"
def remove_adjacent(nums):
newNums= []
# for x in range(0, len(nums)):
# if x == 0:
# if nums[x] == nums[x + 1]
# else:
return
# E. zip_merge
# Given two lists, combine the values from their corresponding
# indices in... | true | true |
08fe264ab6c0a4071dd0636c496fe5065c30ca29 | 67 | py | Python | library/__init__.py | spectraldani/DeepMahalanobisGP | bf2d788ac8b56d25f544b6cb9c0325820f4b7e64 | [
"Apache-2.0"
] | null | null | null | library/__init__.py | spectraldani/DeepMahalanobisGP | bf2d788ac8b56d25f544b6cb9c0325820f4b7e64 | [
"Apache-2.0"
] | null | null | null | library/__init__.py | spectraldani/DeepMahalanobisGP | bf2d788ac8b56d25f544b6cb9c0325820f4b7e64 | [
"Apache-2.0"
] | null | null | null | from . import helper
from . import transforms
from . import models
| 16.75 | 24 | 0.776119 | from . import helper
from . import transforms
from . import models
| true | true |
08fe26c9515de63ac535c4f5200bf146f32fc708 | 32,832 | py | Python | qsiprep/interfaces/reports.py | richford/qsiprep | 7499a1479691394775eeab571f36a86c1dac4b54 | [
"BSD-3-Clause"
] | null | null | null | qsiprep/interfaces/reports.py | richford/qsiprep | 7499a1479691394775eeab571f36a86c1dac4b54 | [
"BSD-3-Clause"
] | null | null | null | qsiprep/interfaces/reports.py | richford/qsiprep | 7499a1479691394775eeab571f36a86c1dac4b54 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Interfaces to generate reportlets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import os
import os.path as op
import time
import json
import re
from collections... | 40.988764 | 98 | 0.630787 |
import os
import os.path as op
import time
import json
import re
from collections import defaultdict
from mpl_toolkits.mplot3d import Axes3D import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import animation
from scipy.io.matlab import loadmat
import pandas as pd
import numpy as ... | true | true |
08fe26e251e3d64b58846e946932bbcbdc93f0e3 | 9,312 | py | Python | doc/web_front/conf.py | cannsudemir/amanzi | c6cd3287bdc2c6cf26c6f8b79e34799751385f9e | [
"RSA-MD"
] | 1 | 2021-02-23T18:34:47.000Z | 2021-02-23T18:34:47.000Z | doc/web_front/conf.py | cannsudemir/amanzi | c6cd3287bdc2c6cf26c6f8b79e34799751385f9e | [
"RSA-MD"
] | null | null | null | doc/web_front/conf.py | cannsudemir/amanzi | c6cd3287bdc2c6cf26c6f8b79e34799751385f9e | [
"RSA-MD"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Amanzi documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 9 13:53:35 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 33.861818 | 110 | 0.710266 |
import sys, os, subprocess
assert sys.version_info.major >= 3, 'Python 3.x is required to build documentation'
extensions = ['sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
... | true | true |
08fe273525a5a7552e381a6ab151645f87dadc67 | 216 | py | Python | PythonExercicios/des011.py | leuosilveira/Exercicios-Python_Curso-em-Video | 17793a5dde868dd6c9a34604ade4b68582db4563 | [
"MIT"
] | null | null | null | PythonExercicios/des011.py | leuosilveira/Exercicios-Python_Curso-em-Video | 17793a5dde868dd6c9a34604ade4b68582db4563 | [
"MIT"
] | null | null | null | PythonExercicios/des011.py | leuosilveira/Exercicios-Python_Curso-em-Video | 17793a5dde868dd6c9a34604ade4b68582db4563 | [
"MIT"
] | null | null | null | h = float(input('Qual a altura da parede? '))
l = float(input('Qual a largura da parede? '))
a = l * h
l = a / 2
print('Para uma parede que mede {:.2f}m² de área, precisaremos de {:.2f} litros de tinta'.format(a,l))
| 36 | 102 | 0.643519 | h = float(input('Qual a altura da parede? '))
l = float(input('Qual a largura da parede? '))
a = l * h
l = a / 2
print('Para uma parede que mede {:.2f}m² de área, precisaremos de {:.2f} litros de tinta'.format(a,l))
| true | true |
08fe278558171ec4d60ac4e2b67d93b4f4da20b4 | 3,112 | py | Python | CTFd/api/v1/flags.py | itsmingjie/CTFd | 80df88f25d095ea7f7fc9cf8c8d0bf9cc7c2bf1f | [
"Apache-2.0"
] | 9 | 2020-05-07T01:39:06.000Z | 2022-01-21T09:32:03.000Z | CTFd/api/v1/flags.py | itsmingjie/CTFd | 80df88f25d095ea7f7fc9cf8c8d0bf9cc7c2bf1f | [
"Apache-2.0"
] | 3 | 2021-03-11T00:50:06.000Z | 2022-02-10T23:13:17.000Z | CTFd/api/v1/flags.py | erseco/CTFd | a6a4906ab058b79bca7af48038fa7badc1744340 | [
"Apache-2.0"
] | 7 | 2020-06-16T20:42:00.000Z | 2022-01-13T08:06:14.000Z | from flask import request
from flask_restx import Namespace, Resource
from CTFd.models import Flags, db
from CTFd.plugins.flags import FLAG_CLASSES, get_flag_class
from CTFd.schemas.flags import FlagSchema
from CTFd.utils.decorators import admins_only
flags_namespace = Namespace("flags", description="Endpoint to retr... | 29.923077 | 84 | 0.621465 | from flask import request
from flask_restx import Namespace, Resource
from CTFd.models import Flags, db
from CTFd.plugins.flags import FLAG_CLASSES, get_flag_class
from CTFd.schemas.flags import FlagSchema
from CTFd.utils.decorators import admins_only
flags_namespace = Namespace("flags", description="Endpoint to retr... | true | true |
08fe28d3c2189dce7dd764fed457ebb5b6782afa | 5,730 | py | Python | Clustering_approach/Convert_Interpolated_Data.py | QAMCAS/Clustering_Vehicle_data | e4fc977d6c31608e3dad7e945d49b5ccc8433701 | [
"MIT"
] | null | null | null | Clustering_approach/Convert_Interpolated_Data.py | QAMCAS/Clustering_Vehicle_data | e4fc977d6c31608e3dad7e945d49b5ccc8433701 | [
"MIT"
] | null | null | null | Clustering_approach/Convert_Interpolated_Data.py | QAMCAS/Clustering_Vehicle_data | e4fc977d6c31608e3dad7e945d49b5ccc8433701 | [
"MIT"
] | null | null | null | import arff
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
The available locations are "Gaimersheim", "Munich" and "Ingolstadt"
"""
location = 'Gaimersheim'
openfile = 'Interpolated_data/data_' + location + '.json'
df = pd.read_json(openfile)
# Extracting all sensors values
acc_x = np.a... | 39.517241 | 119 | 0.691274 | import arff
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
location = 'Gaimersheim'
openfile = 'Interpolated_data/data_' + location + '.json'
df = pd.read_json(openfile)
acc_x = np.array(df["acceleration_x"]["values"])
acc_y = np.array(df["acceleration_y"]["values"])
acc_z = np.array(df["acce... | true | true |
08fe2a1d0318480ab3cd010d228c93f21c1d5074 | 11,851 | py | Python | drqa/pipeline/drqa.py | olzhaskabdolov/bot | ea4bd182affe9e607ddb06cf1d7001d6474f10aa | [
"BSD-3-Clause"
] | 40 | 2018-01-25T09:38:24.000Z | 2022-03-08T12:26:58.000Z | drqa/pipeline/drqa.py | olzhaskabdolov/bot | ea4bd182affe9e607ddb06cf1d7001d6474f10aa | [
"BSD-3-Clause"
] | 9 | 2021-10-01T11:06:27.000Z | 2021-12-23T02:10:52.000Z | drqa/pipeline/drqa.py | olzhaskabdolov/bot | ea4bd182affe9e607ddb06cf1d7001d6474f10aa | [
"BSD-3-Clause"
] | 9 | 2018-07-19T01:59:18.000Z | 2021-06-13T04:36:47.000Z | #!/usr/bin/env python3
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Full DrQA pipeline."""
import torch
import regex
import heapq
import math
import time
import logging
from ... | 38.602606 | 80 | 0.564425 |
import torch
import regex
import heapq
import math
import time
import logging
from multiprocessing import Pool as ProcessPool
from multiprocessing.util import Finalize
from ..reader.vector import batchify
from ..reader.data import ReaderDataset, SortedBatchSampler
from .. import reader
from .. import tokenizers
from... | true | true |
08fe2a30de8ae111c16598805146e0f53bb1c89d | 12,154 | py | Python | sdk/python/pulumi_azure_native/network/v20190201/route_filter_rule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190201/route_filter_rule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190201/route_filter_rule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 67.899441 | 4,469 | 0.70627 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = ['RouteFilterRule']
class RouteFilterRule(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
08fe2bb6f6c22e0fcfc23e4947f587a37ae9886c | 4,444 | py | Python | microcosm_flask/tests/swagger/test_schema.py | KensoDev/microcosm-flask | 3618333f4a0f45e673a33986877157208c9eac5f | [
"Apache-2.0"
] | null | null | null | microcosm_flask/tests/swagger/test_schema.py | KensoDev/microcosm-flask | 3618333f4a0f45e673a33986877157208c9eac5f | [
"Apache-2.0"
] | null | null | null | microcosm_flask/tests/swagger/test_schema.py | KensoDev/microcosm-flask | 3618333f4a0f45e673a33986877157208c9eac5f | [
"Apache-2.0"
] | null | null | null | """
Test JSON Schema generation.
"""
from hamcrest import (
assert_that,
equal_to,
is_,
)
from enum import Enum, IntEnum, unique
from marshmallow import Schema, fields
from microcosm_flask.fields import (
EnumField,
TimestampField,
)
from microcosm_flask.swagger.schema import (
build_schema,
... | 23.389474 | 70 | 0.617237 | from hamcrest import (
assert_that,
equal_to,
is_,
)
from enum import Enum, IntEnum, unique
from marshmallow import Schema, fields
from microcosm_flask.fields import (
EnumField,
TimestampField,
)
from microcosm_flask.swagger.schema import (
build_schema,
build_parameter,
swagger_field... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.