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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f686757e2608308a3d64bcdc26b3792623b150 | 8,236 | py | Python | tests/safety/test_tesla.py | mmmorks/panda | d020b099fdf1a8e5ecd4d8b5289644e74264b9d7 | [
"MIT"
] | 1 | 2021-11-30T22:40:53.000Z | 2021-11-30T22:40:53.000Z | tests/safety/test_tesla.py | mmmorks/panda | d020b099fdf1a8e5ecd4d8b5289644e74264b9d7 | [
"MIT"
] | null | null | null | tests/safety/test_tesla.py | mmmorks/panda | d020b099fdf1a8e5ecd4d8b5289644e74264b9d7 | [
"MIT"
] | 3 | 2021-11-30T22:40:55.000Z | 2021-12-18T00:58:59.000Z | #!/usr/bin/env python3
import unittest
import numpy as np
from panda import Panda
import panda.tests.safety.common as common
from panda.tests.safety import libpandasafety_py
from panda.tests.safety.common import CANPackerPanda
ANGLE_DELTA_BP = [0., 5., 15.]
ANGLE_DELTA_V = [5., .8, .15] # windup limit
ANGLE_DELTA_... | 35.5 | 118 | 0.697547 | import unittest
import numpy as np
from panda import Panda
import panda.tests.safety.common as common
from panda.tests.safety import libpandasafety_py
from panda.tests.safety.common import CANPackerPanda
ANGLE_DELTA_BP = [0., 5., 15.]
ANGLE_DELTA_V = [5., .8, .15] ANGLE_DELTA_VU = [5., 3.5, 0.4]
MAX_ACCEL = 2.0... | true | true |
08f686a000551475bf28c80e8eaa4188af1855e4 | 4,320 | py | Python | lte/gateway/python/magma/monitord/cpe_monitoring.py | khansiddiquekc/magma | 891718acbe3b9cb3973ae0376d9bcadb31503905 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/monitord/cpe_monitoring.py | khansiddiquekc/magma | 891718acbe3b9cb3973ae0376d9bcadb31503905 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/monitord/cpe_monitoring.py | khansiddiquekc/magma | 891718acbe3b9cb3973ae0376d9bcadb31503905 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 34.015748 | 79 | 0.659954 | import ipaddress
import logging
from collections import defaultdict
from time import time
from typing import Dict, List, NamedTuple, Optional
import grpc
from lte.protos.mobilityd_pb2 import IPAddress
from lte.protos.mobilityd_pb2_grpc import MobilityServiceStub
from magma.common.rpc_utils import (
grpc_async_wrap... | true | true |
08f686b26acd478294ceb0b5076762879053c6b5 | 384 | py | Python | aps/wsgi.py | tiennguyen1510/Android-Pentest-Suite | 33b34476da33e3528d573a8ca102e2b91aabc3f8 | [
"MIT"
] | 11 | 2019-10-07T08:08:53.000Z | 2022-01-27T05:13:55.000Z | aps/aps/wsgi.py | kunalvohra94/parkinglotproblem-python | 9e133deb3aa948e0902d278f54dd92277a5bf441 | [
"MIT"
] | null | null | null | aps/aps/wsgi.py | kunalvohra94/parkinglotproblem-python | 9e133deb3aa948e0902d278f54dd92277a5bf441 | [
"MIT"
] | 9 | 2019-10-02T03:28:47.000Z | 2021-02-07T13:37:18.000Z | """
WSGI config for aps project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | 22.588235 | 78 | 0.78125 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "aps.settings")
application = get_wsgi_application()
| true | true |
08f68708123f708c6a537bea8880f09640dfd418 | 1,162 | py | Python | instance_segmentation.py | Dotmole/ar-video-calls | 1023b9c9950c4ba17c8e74c2033a16bde912192a | [
"Apache-2.0"
] | 1 | 2020-04-10T12:09:07.000Z | 2020-04-10T12:09:07.000Z | instance_segmentation.py | Dotmole/ar-video-calls | 1023b9c9950c4ba17c8e74c2033a16bde912192a | [
"Apache-2.0"
] | null | null | null | instance_segmentation.py | Dotmole/ar-video-calls | 1023b9c9950c4ba17c8e74c2033a16bde912192a | [
"Apache-2.0"
] | null | null | null | import os
import time
import cv2
# Initializing paths
dataPath = 'mask-rcnn-coco'
labelsPath = os.path.sep.join([dataPath, "object_detection_classes_coco.txt"])
configPath = os.path.sep.join([dataPath, "mask_rcnn_inception_v2_coco_2018_01_28.pbtxt"])
weightsPath = os.path.sep.join([dataPath, "frozen_inference_graph.p... | 24.723404 | 89 | 0.728055 | import os
import time
import cv2
dataPath = 'mask-rcnn-coco'
labelsPath = os.path.sep.join([dataPath, "object_detection_classes_coco.txt"])
configPath = os.path.sep.join([dataPath, "mask_rcnn_inception_v2_coco_2018_01_28.pbtxt"])
weightsPath = os.path.sep.join([dataPath, "frozen_inference_graph.pb"])
LABELS = open(l... | true | true |
08f687248c9de882a1e168b24341b5896893a618 | 7,401 | py | Python | clearml/debugging/log.py | arielleoren/clearml | 01f0be9895272c483129bab784a43cbd002022a7 | [
"Apache-2.0"
] | 2 | 2021-07-07T03:32:24.000Z | 2021-07-07T04:30:06.000Z | clearml/debugging/log.py | arielleoren/clearml | 01f0be9895272c483129bab784a43cbd002022a7 | [
"Apache-2.0"
] | null | null | null | clearml/debugging/log.py | arielleoren/clearml | 01f0be9895272c483129bab784a43cbd002022a7 | [
"Apache-2.0"
] | null | null | null | """ Logging convenience functions and wrappers """
import inspect
import logging
import logging.handlers
import os
import sys
from platform import system
from pathlib2 import Path
from six import BytesIO
default_level = logging.INFO
class _LevelRangeFilter(logging.Filter):
def __init__(self, min_level, max_lev... | 36.458128 | 118 | 0.651939 | import inspect
import logging
import logging.handlers
import os
import sys
from platform import system
from pathlib2 import Path
from six import BytesIO
default_level = logging.INFO
class _LevelRangeFilter(logging.Filter):
def __init__(self, min_level, max_level, name=''):
super(_LevelRangeFilter, self... | true | true |
08f687e971fdcf904b77d498e8fdc0478898a760 | 1,630 | py | Python | frameRunner/GreetingPanel.py | AndersSun/pygame-puyo | beafef4549f62981bbf76b5e9a60b97d61e56bb8 | [
"Apache-2.0"
] | 2 | 2022-02-07T05:51:20.000Z | 2022-02-10T01:31:49.000Z | frameRunner/GreetingPanel.py | AndersSun/pygame-puyo | beafef4549f62981bbf76b5e9a60b97d61e56bb8 | [
"Apache-2.0"
] | null | null | null | frameRunner/GreetingPanel.py | AndersSun/pygame-puyo | beafef4549f62981bbf76b5e9a60b97d61e56bb8 | [
"Apache-2.0"
] | null | null | null |
import time
from FrameRunner import FrameRunner
import pygame as pg
class GreetingPanel(pg.sprite.Sprite):
""" """
def __init__(self):
pg.sprite.Sprite.__init__(self) # call Sprite initializer
self.fr = fr = FrameRunner()
self.image = pg.Surface((700, 200))
self.image.fill... | 31.346154 | 72 | 0.574233 |
import time
from FrameRunner import FrameRunner
import pygame as pg
class GreetingPanel(pg.sprite.Sprite):
def __init__(self):
pg.sprite.Sprite.__init__(self)
self.fr = fr = FrameRunner()
self.image = pg.Surface((700, 200))
self.image.fill((0, 0, 0))
self.image = self.... | true | true |
08f68819f0ed20bd762f8d4aa45ef631fdbd0b49 | 29,269 | py | Python | kgx/source/rdf_source.py | kshefchek/kgx | 1d54bd926f687829f44cee3e38b75616329b8d97 | [
"BSD-3-Clause"
] | null | null | null | kgx/source/rdf_source.py | kshefchek/kgx | 1d54bd926f687829f44cee3e38b75616329b8d97 | [
"BSD-3-Clause"
] | null | null | null | kgx/source/rdf_source.py | kshefchek/kgx | 1d54bd926f687829f44cee3e38b75616329b8d97 | [
"BSD-3-Clause"
] | null | null | null | import gzip
from typing import Set, Dict, Union, Optional, Any, Tuple, List, Generator
import rdflib
from linkml_runtime.linkml_model.meta import SlotDefinition, ClassDefinition, Element
from rdflib import URIRef, RDF, Namespace
from kgx.prefix_manager import PrefixManager
from kgx.config import get_logger
from kgx.p... | 37.049367 | 183 | 0.538829 | import gzip
from typing import Set, Dict, Union, Optional, Any, Tuple, List, Generator
import rdflib
from linkml_runtime.linkml_model.meta import SlotDefinition, ClassDefinition, Element
from rdflib import URIRef, RDF, Namespace
from kgx.prefix_manager import PrefixManager
from kgx.config import get_logger
from kgx.p... | true | true |
08f6896501956b742ee4ff1b365f051604aa8cd5 | 209,205 | py | Python | salt/states/file.py | ari/salt | 05de98e237719b4f0cc68f08871ffaa532eddec5 | [
"Apache-2.0"
] | null | null | null | salt/states/file.py | ari/salt | 05de98e237719b4f0cc68f08871ffaa532eddec5 | [
"Apache-2.0"
] | null | null | null | salt/states/file.py | ari/salt | 05de98e237719b4f0cc68f08871ffaa532eddec5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Operations on regular files, special files, directories, and symlinks
=====================================================================
Salt States can aggressively manipulate files on a system. There are a number
of ways in which files can be managed.
Regular files can be enforced wit... | 35.030978 | 117 | 0.557214 |
from __future__ import absolute_import
import difflib
import itertools
import logging
import os
import re
import shutil
import sys
import traceback
from collections import Iterable, Mapping, defaultdict
from datetime import datetime
import salt.loader
import salt.payload
import salt.utils
import salt.utils.dictupda... | true | true |
08f68a0e7b4420f398ce5a36346a1366ea9deb90 | 7,091 | py | Python | bitfeeds/broker/kraken.py | bopo/bitfeeds | bc525386418061aa4cac11852b1cf28d3b29dea3 | [
"Apache-2.0"
] | 1 | 2018-02-25T04:27:07.000Z | 2018-02-25T04:27:07.000Z | bitfeeds/broker/kraken.py | bopo/bitfeeds | bc525386418061aa4cac11852b1cf28d3b29dea3 | [
"Apache-2.0"
] | null | null | null | bitfeeds/broker/kraken.py | bopo/bitfeeds | bc525386418061aa4cac11852b1cf28d3b29dea3 | [
"Apache-2.0"
] | null | null | null | from bitfeeds.socket.restful import RESTfulApiSocket
from bitfeeds.exchange import ExchangeGateway
from bitfeeds.market import L2Depth, Trade
from bitfeeds.instrument import Instrument
from bitfeeds.util import Logger
import time
import threading
from functools import partial
from datetime import datetime
class Krake... | 32.828704 | 124 | 0.549429 | from bitfeeds.socket.restful import RESTfulApiSocket
from bitfeeds.exchange import ExchangeGateway
from bitfeeds.market import L2Depth, Trade
from bitfeeds.instrument import Instrument
from bitfeeds.util import Logger
import time
import threading
from functools import partial
from datetime import datetime
class Krake... | true | true |
08f68b32364a69c56393c38835f0872a885ea64e | 5,260 | py | Python | nycrecords_flask/commands.py | joelbcastillo/nycrecords_flask | 0ee139a632db9a7e1b35875d0dbd05a7dd11f4fa | [
"MIT"
] | null | null | null | nycrecords_flask/commands.py | joelbcastillo/nycrecords_flask | 0ee139a632db9a7e1b35875d0dbd05a7dd11f4fa | [
"MIT"
] | 2 | 2019-04-13T00:09:11.000Z | 2019-04-13T00:09:13.000Z | nycrecords_flask/commands.py | joelbcastillo/nycrecords_flask | 0ee139a632db9a7e1b35875d0dbd05a7dd11f4fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Click commands."""
import os
from glob import glob
from subprocess import call
import click
from flask import current_app
from flask.cli import with_appcontext
from werkzeug.exceptions import MethodNotAllowed, NotFound
COV = None
if os.environ.get("FLASK_COVERAGE"):
import coverage
... | 34.155844 | 113 | 0.644677 | import os
from glob import glob
from subprocess import call
import click
from flask import current_app
from flask.cli import with_appcontext
from werkzeug.exceptions import MethodNotAllowed, NotFound
COV = None
if os.environ.get("FLASK_COVERAGE"):
import coverage
COV = coverage.coverage()
COV.start()
... | true | true |
08f68b442f55ee29d3205589c19205083d6b994b | 86,656 | py | Python | lib/googlecloudsdk/third_party/apis/datamigration/v1/datamigration_v1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/third_party/apis/datamigration/v1/datamigration_v1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/datamigration/v1/datamigration_v1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | """Generated message classes for datamigration version v1.
Manage Cloud Database Migration Service resources on Google Cloud Platform.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from apit... | 41.741811 | 99 | 0.741322 |
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
from apitools.base.py import extra_types
package = 'datamigration'
class AuditConfig(_messages.Message):
auditLogConfigs = _messages.MessageField('AuditLogConfig', 1, repeat... | true | true |
08f68b519723f44bce6a75780ba7767e2a9689d7 | 3,754 | py | Python | clip/ViT-B-32-cpu/code/__torch__/torch/nn/modules/activation/___torch_mangle_9414.py | shawwn/CLIP | ba33b4eb956e6f507b4b39468b3b7336ac2260a1 | [
"MIT"
] | 6 | 2021-01-09T14:34:17.000Z | 2021-06-13T06:46:43.000Z | clip/ViT-B-32-cpu/code/__torch__/torch/nn/modules/activation/___torch_mangle_9414.py | shawwn/CLIP | ba33b4eb956e6f507b4b39468b3b7336ac2260a1 | [
"MIT"
] | null | null | null | clip/ViT-B-32-cpu/code/__torch__/torch/nn/modules/activation/___torch_mangle_9414.py | shawwn/CLIP | ba33b4eb956e6f507b4b39468b3b7336ac2260a1 | [
"MIT"
] | 2 | 2021-01-09T10:30:04.000Z | 2021-01-09T18:43:29.000Z | class MultiheadAttention(Module):
__parameters__ = ["in_proj_weight", "in_proj_bias", ]
__buffers__ = []
in_proj_weight : Tensor
in_proj_bias : Tensor
training : bool
out_proj : __torch__.torch.nn.modules.linear.___torch_mangle_9413._LinearWithBias
def forward(self: __torch__.torch.nn.modules.activation._... | 44.690476 | 99 | 0.677944 | class MultiheadAttention(Module):
__parameters__ = ["in_proj_weight", "in_proj_bias", ]
__buffers__ = []
in_proj_weight : Tensor
in_proj_bias : Tensor
training : bool
out_proj : __torch__.torch.nn.modules.linear.___torch_mangle_9413._LinearWithBias
def forward(self: __torch__.torch.nn.modules.activation._... | true | true |
08f68bdec8ac2dacb750318f7f5bc07863478208 | 2,664 | py | Python | Data_Structures/stack_ll.py | alvinctk/google-tech-dev-guide | 9d7759bea1f44673c2de4f25a94b27368928a59f | [
"Apache-2.0"
] | 26 | 2019-06-07T05:29:47.000Z | 2022-03-19T15:32:27.000Z | Data_Structures/stack_ll.py | alvinctk/google-tech-dev-guide | 9d7759bea1f44673c2de4f25a94b27368928a59f | [
"Apache-2.0"
] | null | null | null | Data_Structures/stack_ll.py | alvinctk/google-tech-dev-guide | 9d7759bea1f44673c2de4f25a94b27368928a59f | [
"Apache-2.0"
] | 6 | 2019-10-10T06:39:28.000Z | 2020-05-12T19:50:55.000Z | """
Linked list implementation of a stack
Space used must be linear in the number of items in a stack
Stack() -> creates a new Stack object
.is_empty()
len() -> number of elements in stack
.push(item) -> push item into Stack
.pop() -> Remove and return the most recent item in the stack
"""
class Node:
"""
Nod... | 24.218182 | 76 | 0.538664 | class Node:
def __init__(self, item, next_item):
self.item = item
self.next_item = next_item
def __str__(self):
return str(self.item)
class Stack:
def __init__(self):
self.top = None
self.length = 0
def __len__(self):
return self.length
def __str__... | true | true |
08f68c44a4c3fcde442f1257484daae6a5edf827 | 420 | py | Python | tests/__init__.py | manz/influxpy | 196bdf09ae9a20eaf4db509f3cca077397457969 | [
"MIT"
] | null | null | null | tests/__init__.py | manz/influxpy | 196bdf09ae9a20eaf4db509f3cca077397457969 | [
"MIT"
] | null | null | null | tests/__init__.py | manz/influxpy | 196bdf09ae9a20eaf4db509f3cca077397457969 | [
"MIT"
] | null | null | null | from unittest.case import TestCase
from influxpy.client import client_wrapper
class InfluxTestCase(TestCase):
@classmethod
def setUpClass(cls):
client_wrapper.setup_test_database()
@classmethod
def tearDownClass(cls):
client_wrapper.restore_test_database()
def setUp(self):
... | 21 | 46 | 0.721429 | from unittest.case import TestCase
from influxpy.client import client_wrapper
class InfluxTestCase(TestCase):
@classmethod
def setUpClass(cls):
client_wrapper.setup_test_database()
@classmethod
def tearDownClass(cls):
client_wrapper.restore_test_database()
def setUp(self):
... | true | true |
08f68cb4ee1324f3e7e6d714d9683f6c299ca985 | 2,748 | py | Python | src/main.py | kabrezi/bstrip | 9386c79434c892d0dbef1263b9f7f1adb598bb5f | [
"Apache-2.0"
] | null | null | null | src/main.py | kabrezi/bstrip | 9386c79434c892d0dbef1263b9f7f1adb598bb5f | [
"Apache-2.0"
] | null | null | null | src/main.py | kabrezi/bstrip | 9386c79434c892d0dbef1263b9f7f1adb598bb5f | [
"Apache-2.0"
] | null | null | null | #/home/pi/Segnix/test.py
import serial, string
import re, struct
from array import *
# s = '\x1f\x01\q\x01\x00\x00\x00'
# result = map(ord,s)
# print (list(result))
# t = map(ord, s)
# struct.unpack('7S', s)
# print (t)
output =" "
r = 255
r1 = 101
r2 = 102
r3 = 113
r4 = 0
BL = []
Page_Num = []
Obj_Num = []
Quantit... | 23.487179 | 113 | 0.481805 |
import serial, string
import re, struct
from array import *
output =" "
r = 255
r1 = 101
r2 = 102
r3 = 113
r4 = 0
BL = []
Page_Num = []
Obj_Num = []
Quantity = []
Wire_Ga = []
Strip_A = []
Strip_B = []
OAL = []
Build_List = []
Custom_cut_list = []
ser = serial.Serial ("/dev/ttyUSB0",9600, 8, 'N', 1, timeout=... | false | true |
08f68f6cd53d3ee8e129a4ff4a7155e0d6fc92ed | 593 | pyw | Python | books/techno/python/programming_python_4_ed_m_lutz/code/chapter_7/29_standalone_container_classes_1/main.pyw | ordinary-developer/lin_education | 13d65b20cdbc3e5467b2383e5c09c73bbcdcb227 | [
"MIT"
] | 1 | 2017-05-04T08:23:46.000Z | 2017-05-04T08:23:46.000Z | books/techno/python/programming_python_4_ed_m_lutz/code/chapter_7/29_standalone_container_classes_1/main.pyw | ordinary-developer/lin_education | 13d65b20cdbc3e5467b2383e5c09c73bbcdcb227 | [
"MIT"
] | null | null | null | books/techno/python/programming_python_4_ed_m_lutz/code/chapter_7/29_standalone_container_classes_1/main.pyw | ordinary-developer/lin_education | 13d65b20cdbc3e5467b2383e5c09c73bbcdcb227 | [
"MIT"
] | null | null | null | from tkinter import *
class HelloPackage:
def __init__(self, parent = None):
self.top = Frame(parent)
self.top.pack()
self.data = 0
self.make_widgets()
def make_widgets(self):
Button(self.top, text = 'Bye', command = self.top.quit).pack(
s... | 23.72 | 70 | 0.541315 | from tkinter import *
class HelloPackage:
def __init__(self, parent = None):
self.top = Frame(parent)
self.top.pack()
self.data = 0
self.make_widgets()
def make_widgets(self):
Button(self.top, text = 'Bye', command = self.top.quit).pack(
s... | true | true |
08f690052f573f061c0be431b3c274542f9b3393 | 7,773 | py | Python | tests/test_zset.py | walletech/tidis | f3153030a4a6dc83b8afb43c02ea395bb6722e57 | [
"MIT"
] | 1,362 | 2018-04-17T09:12:48.000Z | 2022-03-31T12:52:46.000Z | tests/test_zset.py | walletech/tidis | f3153030a4a6dc83b8afb43c02ea395bb6722e57 | [
"MIT"
] | 81 | 2018-04-21T22:48:43.000Z | 2022-02-17T02:17:19.000Z | tests/test_zset.py | walletech/tidis | f3153030a4a6dc83b8afb43c02ea395bb6722e57 | [
"MIT"
] | 145 | 2018-04-17T09:12:49.000Z | 2022-03-30T16:48:05.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 yongman <yming0221@gmail.com>
#
# Distributed under terms of the MIT license.
"""
unit test for set type
"""
import unittest
import time
import string
import random
from rediswrap import RedisWrapper
class ZsetTest(unittest.TestCase... | 42.944751 | 130 | 0.604657 |
"""
unit test for set type
"""
import unittest
import time
import string
import random
from rediswrap import RedisWrapper
class ZsetTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
print 'connect to 127.0.0.1:5379\n'
cls.r = RedisWrapper('127.0.0.1', 5379).get_instance()
cls... | false | true |
08f69051f65e75426cccc6000af1165cb6df45c2 | 2,691 | py | Python | local/scripts/school/rofi-current-course.py | SingularisArt/Singularis | 9b2c1ad18f63955323e291764fdfd8de65aecf24 | [
"Unlicense"
] | 62 | 2021-07-26T01:03:13.000Z | 2022-03-28T08:24:55.000Z | local/scripts/school/rofi-current-course.py | SingularisArt/Singularis | 9b2c1ad18f63955323e291764fdfd8de65aecf24 | [
"Unlicense"
] | 2 | 2022-01-13T17:24:07.000Z | 2022-03-28T02:09:47.000Z | local/scripts/school/rofi-current-course.py | SingularisArt/Singularis | 9b2c1ad18f63955323e291764fdfd8de65aecf24 | [
"Unlicense"
] | 5 | 2021-09-26T09:24:26.000Z | 2022-03-23T14:58:09.000Z | #!/usr/bin/env python3
import os
import yaml
import subprocess
from pathlib import Path
"""
All of the dirs are stored in different variables located in my ~/.config/zsh/.zshrc
ROOT
NOTES_DIR
CURRENT_COURSE
"""
EDITOR = 'nvim'
TERMINAL = 'xfce4-terminal'
NOTES_DIR = Path('~/Documents/notes').expanduser()
ROOT = '{}/... | 29.571429 | 160 | 0.635452 |
import os
import yaml
import subprocess
from pathlib import Path
EDITOR = 'nvim'
TERMINAL = 'xfce4-terminal'
NOTES_DIR = Path('~/Documents/notes').expanduser()
ROOT = '{}/Grade-10/semester-1'.format(NOTES_DIR)
CURRENT_COURSE = '{}/current-course'.format(NOTES_DIR)
classes = [os.path.join(ROOT, o) for o in os.listdi... | true | true |
08f69118ebf98d1a8b54a5cd08d8c666814e4f03 | 62,438 | py | Python | unicorn.py | qashqao/unicorn | a97464f7ff793491f06fcc2d8da6438ad5a02a7f | [
"Unlicense"
] | null | null | null | unicorn.py | qashqao/unicorn | a97464f7ff793491f06fcc2d8da6438ad5a02a7f | [
"Unlicense"
] | null | null | null | unicorn.py | qashqao/unicorn | a97464f7ff793491f06fcc2d8da6438ad5a02a7f | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
#
# Magic Unicorn - PowerShell downgrade attack and exploitation tool
#
# Written by: Dave Kennedy (@HackingDave)
# Company: TrustedSec (@TrustedSec) https://www.trustedsec.com
#
# Real quick down and dirty for native x86 powershell on any platform
#
# Usage: python unicorn.py payload reverse_ipaddr p... | 47.301515 | 1,127 | 0.595198 | import base64
import re
import subprocess
import sys
import os
import shutil
import random
import string
import binascii
from functools import reduce
def generate_random_string(low, high):
length = random.randint(low, high)
letters = string.ascii_letters return ''.join([random.choice(letters) for _ in ra... | true | true |
08f69172646a37a94bcfb5c28ad5839c523878c6 | 15,891 | py | Python | edivorce/apps/core/utils/derived.py | rloisell/eDivorce | c9152bfaebf9b97f90b34c7abf8eacd9227b7c97 | [
"Apache-2.0"
] | null | null | null | edivorce/apps/core/utils/derived.py | rloisell/eDivorce | c9152bfaebf9b97f90b34c7abf8eacd9227b7c97 | [
"Apache-2.0"
] | null | null | null | edivorce/apps/core/utils/derived.py | rloisell/eDivorce | c9152bfaebf9b97f90b34c7abf8eacd9227b7c97 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=W0613,C0103
"""Values derived from a user's responses.
This module provides functions to take a set of responses from a user and create
a set of derived values that are consistent with the user's responses. This is
done, in part, to centralize the logic for getting such derived values (such as
wheth... | 28.735986 | 85 | 0.683406 |
import json
DERIVED_DATA = [
'orders_wanted',
'children',
'has_children_of_marriage',
'wants_divorce_order',
'wants_spousal_support',
'wants_property_division',
'wants_child_support',
'wants_other_orders',
'show_fact_sheet_a',
'show_fact_sheet_b',
'show_fact_sheet_c',
'... | true | true |
08f692318a725046aec60c514bbe34feed9b90ba | 667 | py | Python | bb2_pkg/scripts/src2/test_camera_2.py | leeeju/R.O.S- | 66910c0ec7265bbfe147aad9f1cc87cd2515eabf | [
"Python-2.0",
"OLDAP-2.7"
] | 2 | 2021-07-25T23:12:45.000Z | 2021-07-25T23:12:46.000Z | bb2_pkg/scripts/src2/test_camera_2.py | leeeju/R.O.S- | 66910c0ec7265bbfe147aad9f1cc87cd2515eabf | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | bb2_pkg/scripts/src2/test_camera_2.py | leeeju/R.O.S- | 66910c0ec7265bbfe147aad9f1cc87cd2515eabf | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import rospy, sys
from std_msgs.msg import Empty
from geometry_msgs.msg import Twist
from bebop_msgs.msg import Ardrone3PilotingStateAttitudeChanged, \
Ardrone3PilotingStatePositionChanged, \
Ardrone3PilotingStateAltitud... | 30.318182 | 72 | 0.67916 |
import rospy, sys
from std_msgs.msg import Empty
from geometry_msgs.msg import Twist
from bebop_msgs.msg import Ardrone3PilotingStateAttitudeChanged, \
Ardrone3PilotingStatePositionChanged, \
Ardrone3PilotingStateAltitudeChanged, \
Ardron... | true | true |
08f693db82911a3c60c8bfb0156803e2e794be75 | 20,024 | py | Python | tests/unit/test_check_wav_length.py | KaltakhchyanD/python_telegram_tts_bot | 7cf483b58654481da9245383affb965f0d1ac8bf | [
"MIT"
] | 6 | 2019-07-14T08:24:14.000Z | 2021-08-13T10:15:36.000Z | tests/unit/test_check_wav_length.py | ConnectionMaster/python_telegram_tts_bot | 7cf483b58654481da9245383affb965f0d1ac8bf | [
"MIT"
] | 1 | 2021-06-02T03:44:50.000Z | 2021-06-02T03:44:50.000Z | tests/unit/test_check_wav_length.py | ConnectionMaster/python_telegram_tts_bot | 7cf483b58654481da9245383affb965f0d1ac8bf | [
"MIT"
] | 5 | 2019-10-23T03:30:28.000Z | 2021-11-12T17:16:37.000Z | import os
from pathlib import Path
import unittest
import wave
from src.check_wav_length import (
_get_audio_file_duration,
_get_size_in_kb,
convert_from_ogg_to_wav,
_find_non_empty_wav_files,
_split_wav_by_silence,
_create_and_return_new_file_name,
_delete_old_files,
_add_first_audio_... | 29.931241 | 86 | 0.603975 | import os
from pathlib import Path
import unittest
import wave
from src.check_wav_length import (
_get_audio_file_duration,
_get_size_in_kb,
convert_from_ogg_to_wav,
_find_non_empty_wav_files,
_split_wav_by_silence,
_create_and_return_new_file_name,
_delete_old_files,
_add_first_audio_... | true | true |
08f6949f6f0e8f5a4287ab4574be85033220556e | 30,461 | py | Python | src/datasets/search.py | zidingz/datasets | 02edd9ebc79f715adb1c718d1439fda83dc356f1 | [
"Apache-2.0"
] | 2 | 2021-08-28T06:48:02.000Z | 2021-08-28T23:18:34.000Z | src/datasets/search.py | zidingz/datasets | 02edd9ebc79f715adb1c718d1439fda83dc356f1 | [
"Apache-2.0"
] | 8 | 2021-10-01T12:00:18.000Z | 2021-10-08T18:50:05.000Z | src/datasets/search.py | zidingz/datasets | 02edd9ebc79f715adb1c718d1439fda83dc356f1 | [
"Apache-2.0"
] | 2 | 2021-12-01T16:25:34.000Z | 2021-12-01T16:25:42.000Z | import importlib.util
import os
import tempfile
from pathlib import PurePath
from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Union
import numpy as np
from . import utils
from .utils import logging
if TYPE_CHECKING:
from .arrow_dataset import Dataset # noqa: F401
try:
from elast... | 44.927729 | 178 | 0.617642 | import importlib.util
import os
import tempfile
from pathlib import PurePath
from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Union
import numpy as np
from . import utils
from .utils import logging
if TYPE_CHECKING:
from .arrow_dataset import Dataset
try:
from elasticsearch impo... | true | true |
08f694a4c3f2192b8df47be7e0667fbb446ed87e | 2,131 | py | Python | openstack_dashboard/dashboards/project/containers/urls.py | ameoba/horizon | ff9e367c98a8bb79f10914abffaaa04b0a461819 | [
"Apache-2.0"
] | 2 | 2019-12-29T09:20:13.000Z | 2020-01-01T13:12:34.000Z | openstack_dashboard/dashboards/project/containers/urls.py | yongquanf/horizon | 9aad7fd6f66588fed7c27b720642e47a4a12854b | [
"Apache-2.0"
] | 1 | 2015-03-12T01:03:44.000Z | 2015-03-12T01:03:44.000Z | openstack_dashboard/dashboards/project/containers/urls.py | yongquanf/horizon | 9aad7fd6f66588fed7c27b720642e47a4a12854b | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | 34.934426 | 78 | 0.661661 |
from django.conf.urls.defaults import patterns from django.conf.urls.defaults import url
from openstack_dashboard.dashboards.project.containers import views
VIEW_MOD = 'openstack_dashboard.dashboards.project.containers.views'
urlpatterns = patterns(VIEW_MOD,
url(r'^((?P<container_name>.+?)/)?(?P<subfolder_p... | true | true |
08f694a98e8e2a42783c8b9659327ef67c552941 | 3,599 | py | Python | src/aleph/web/controllers/storage.py | Okeso/pyaleph | 5c1006c08aae1e9fcde981c2ef347eb0eb9322d2 | [
"MIT"
] | null | null | null | src/aleph/web/controllers/storage.py | Okeso/pyaleph | 5c1006c08aae1e9fcde981c2ef347eb0eb9322d2 | [
"MIT"
] | null | null | null | src/aleph/web/controllers/storage.py | Okeso/pyaleph | 5c1006c08aae1e9fcde981c2ef347eb0eb9322d2 | [
"MIT"
] | null | null | null | from aleph.storage import add_json, get_hash_content, add_file
from aleph.web import app
from aleph.services.ipfs.pubsub import pub
from aiohttp import web
import base64
import asyncio
async def add_ipfs_json_controller(request):
""" Forward the json content to IPFS server and return an hash
"""
data = aw... | 31.849558 | 78 | 0.59072 | from aleph.storage import add_json, get_hash_content, add_file
from aleph.web import app
from aleph.services.ipfs.pubsub import pub
from aiohttp import web
import base64
import asyncio
async def add_ipfs_json_controller(request):
data = await request.json()
output = {
'status': 'success',
'ha... | true | true |
08f695a6b2031d12587b80487ad29374167a9d32 | 8,363 | py | Python | python/aesmix/manager.py | mosaicrown/aesmix | e3c48ebe29980659baddf7581892803a074e2b56 | [
"MIT"
] | 1 | 2020-05-21T18:28:28.000Z | 2020-05-21T18:28:28.000Z | python/aesmix/manager.py | mosaicrown/aesmix | e3c48ebe29980659baddf7581892803a074e2b56 | [
"MIT"
] | null | null | null | python/aesmix/manager.py | mosaicrown/aesmix | e3c48ebe29980659baddf7581892803a074e2b56 | [
"MIT"
] | null | null | null | from Crypto.PublicKey import RSA as _RSA
from Crypto.Cipher import AES as _AES
from Crypto.Util import Counter as _Counter
from six.moves import xrange as _xrange
from ._aesmix import lib as _lib
from .keyreg import KeyRegRSA as _KeyRegRSA
from .padder import Padder as _Padder
from .wrapper import mix_and_slice as _mi... | 38.013636 | 78 | 0.624776 | from Crypto.PublicKey import RSA as _RSA
from Crypto.Cipher import AES as _AES
from Crypto.Util import Counter as _Counter
from six.moves import xrange as _xrange
from ._aesmix import lib as _lib
from .keyreg import KeyRegRSA as _KeyRegRSA
from .padder import Padder as _Padder
from .wrapper import mix_and_slice as _mi... | true | true |
08f6961eba740c8e895785daa404ace6ed53bb66 | 7,324 | py | Python | code/utils.py | xandaschofield/bptf | de8ac77a89fadb01aceb26d14b4366c8afab2b87 | [
"MIT"
] | null | null | null | code/utils.py | xandaschofield/bptf | de8ac77a89fadb01aceb26d14b4366c8afab2b87 | [
"MIT"
] | null | null | null | code/utils.py | xandaschofield/bptf | de8ac77a89fadb01aceb26d14b4366c8afab2b87 | [
"MIT"
] | null | null | null | import numpy as np
import numpy.random as rn
import sktensor as skt
import pickle
from pathlib import Path as path
from time import sleep
def is_binary(X):
"""Checks whether input is a binary integer tensor."""
if np.issubdtype(X.dtype, int):
if isinstance(X, skt.sptensor):
return (X.vals... | 30.264463 | 76 | 0.579055 | import numpy as np
import numpy.random as rn
import sktensor as skt
import pickle
from pathlib import Path as path
from time import sleep
def is_binary(X):
if np.issubdtype(X.dtype, int):
if isinstance(X, skt.sptensor):
return (X.vals == 1).all()
else:
return (X <= 1).all(... | true | true |
08f69634d8751d1fd73984dba061aeafcbefadea | 6,156 | py | Python | tfx/components/trainer/executor.py | saifrahmed/tfx-local | 3b0374706dc5189d712e5120218f66ab44bea821 | [
"Apache-2.0"
] | null | null | null | tfx/components/trainer/executor.py | saifrahmed/tfx-local | 3b0374706dc5189d712e5120218f66ab44bea821 | [
"Apache-2.0"
] | 15 | 2020-01-28T22:50:12.000Z | 2022-02-10T00:18:10.000Z | tfx/components/trainer/executor.py | saifrahmed/tfx-local | 3b0374706dc5189d712e5120218f66ab44bea821 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.461538 | 80 | 0.702079 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import tensorflow_model_analysis as tfma
from typing import Any
from typing import Dict
from typing import List
from typing import Text
from tensorflow_metadata.proto.v0 impo... | true | true |
08f696a85253e086a9439be25a796a7712678408 | 4,516 | py | Python | textProcessing.py | pmineev/DiagnosticBot | 7e4ca3c6a187de1dc85e29dfe2db8337f5c9e113 | [
"MIT"
] | null | null | null | textProcessing.py | pmineev/DiagnosticBot | 7e4ca3c6a187de1dc85e29dfe2db8337f5c9e113 | [
"MIT"
] | null | null | null | textProcessing.py | pmineev/DiagnosticBot | 7e4ca3c6a187de1dc85e29dfe2db8337f5c9e113 | [
"MIT"
] | 1 | 2019-05-06T21:19:46.000Z | 2019-05-06T21:19:46.000Z | import itertools
import string
import pymorphy2
from nltk.corpus import wordnet
from pyswip import Prolog
class BaseDate:
symptoms_base_dict = {'жажда' : 'thirst_changes',
'чихать' : 'sneezing', 'кровь_в_моче' : 'blood_in_urine', 'недомогание' : 'malaise',
'сухость_в_глазах' : 'itchy_eyes', 'размытое_зре... | 42.603774 | 104 | 0.632197 | import itertools
import string
import pymorphy2
from nltk.corpus import wordnet
from pyswip import Prolog
class BaseDate:
symptoms_base_dict = {'жажда' : 'thirst_changes',
'чихать' : 'sneezing', 'кровь_в_моче' : 'blood_in_urine', 'недомогание' : 'malaise',
'сухость_в_глазах' : 'itchy_eyes', 'размытое_зре... | true | true |
08f697c51324b9e6a4c7f2d2b7c3366b7f3e215c | 5,798 | py | Python | remove_excluded/remove_excluded.py | FalveyLibraryTechnology/deselection-toolkit | 1c15b7643f9867c7b22b1cf94a8fc05f7eec625b | [
"MIT"
] | 1 | 2018-02-02T16:26:00.000Z | 2018-02-02T16:26:00.000Z | remove_excluded/remove_excluded.py | FalveyLibraryTechnology/deselection-toolkit | 1c15b7643f9867c7b22b1cf94a8fc05f7eec625b | [
"MIT"
] | 3 | 2018-02-12T20:58:10.000Z | 2018-05-30T19:47:26.000Z | remove_excluded/remove_excluded.py | FalveyLibraryTechnology/deselection-toolkit | 1c15b7643f9867c7b22b1cf94a8fc05f7eec625b | [
"MIT"
] | null | null | null | import os
import sqlite3
import time
import win32com.client as win32
from shutil import copy
from xlrd import open_workbook # Excel files
import sys
sys.path.append("..")
from src.posted_files import parse_source_file
if not os.path.exists("../database.sqlite"):
print("WTF")
exit(0)
conn = sqlite3.connect(... | 44.945736 | 163 | 0.606071 | import os
import sqlite3
import time
import win32com.client as win32
from shutil import copy
from xlrd import open_workbook
import sys
sys.path.append("..")
from src.posted_files import parse_source_file
if not os.path.exists("../database.sqlite"):
print("WTF")
exit(0)
conn = sqlite3.connect("../database.s... | true | true |
08f6982d1001fa7c9ff873e4315f11a74e866c3a | 127 | py | Python | day24/part2.py | jonasmue/adventofcode20 | 437eb9ff82045ce825b68f1dcb3b79265723bba4 | [
"Apache-2.0"
] | null | null | null | day24/part2.py | jonasmue/adventofcode20 | 437eb9ff82045ce825b68f1dcb3b79265723bba4 | [
"Apache-2.0"
] | null | null | null | day24/part2.py | jonasmue/adventofcode20 | 437eb9ff82045ce825b68f1dcb3b79265723bba4 | [
"Apache-2.0"
] | 1 | 2020-12-10T10:02:54.000Z | 2020-12-10T10:02:54.000Z | from common import TileFloor
if __name__ == "__main__":
floor = TileFloor()
floor.run()
print(floor.black_tiles)
| 15.875 | 28 | 0.677165 | from common import TileFloor
if __name__ == "__main__":
floor = TileFloor()
floor.run()
print(floor.black_tiles)
| true | true |
08f698bbe36d414eca19d0760a5acc3a714c404e | 52,504 | py | Python | nova/tests/unit/api/openstack/compute/test_server_actions.py | Samaneh1986/nova | 0576830b9dec79735bc840cad1c60e7d38c6502d | [
"Apache-2.0"
] | 1 | 2020-01-06T10:10:30.000Z | 2020-01-06T10:10:30.000Z | nova/tests/unit/api/openstack/compute/test_server_actions.py | Samaneh1986/nova | 0576830b9dec79735bc840cad1c60e7d38c6502d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_server_actions.py | Samaneh1986/nova | 0576830b9dec79735bc840cad1c60e7d38c6502d | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 40.543629 | 79 | 0.575594 |
import ddt
import fixtures
import mock
from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils import uuidutils
import webob
from nova.api.openstack.compute import servers as servers_v21
from nova.compute import api as compute_api
from nova.compute import task_states
from nova.compute import vm_states
im... | true | true |
08f698fcf071f32c175d7eba45aaed950bff2e84 | 3,135 | py | Python | pyjfuzz/core/errors/__init__.py | zyLiu6707/PyJFuzz | 296d8129d36516fa4db94e6e681c890bce60a7e7 | [
"MIT"
] | null | null | null | pyjfuzz/core/errors/__init__.py | zyLiu6707/PyJFuzz | 296d8129d36516fa4db94e6e681c890bce60a7e7 | [
"MIT"
] | null | null | null | pyjfuzz/core/errors/__init__.py | zyLiu6707/PyJFuzz | 296d8129d36516fa4db94e6e681c890bce60a7e7 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation th... | 26.344538 | 112 | 0.708134 | import sys
class PJFBaseException(Exception):
err_type = "ERROR"
def __str__(self):
if not hasattr(self, "message"):
self.message = self.args[0]
self.__class__.__module__ = "[\033[91m%s\033[0m]: %s" % (self.err_type, self.message)
self.__class__.__name__ = ""
retur... | true | true |
08f699eea8acf18a31f705dc2e0acfdd57e7f280 | 1,608 | py | Python | environ/challenges/views.py | CassandraTalbot32/Python-Django-CSS-HTML-JavaScript-webiste | de81b971026991c6689a133e68582b04431ae265 | [
"MIT"
] | null | null | null | environ/challenges/views.py | CassandraTalbot32/Python-Django-CSS-HTML-JavaScript-webiste | de81b971026991c6689a133e68582b04431ae265 | [
"MIT"
] | null | null | null | environ/challenges/views.py | CassandraTalbot32/Python-Django-CSS-HTML-JavaScript-webiste | de81b971026991c6689a133e68582b04431ae265 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.urls import reverse
# Create your views here.
from django.views.generic import (
CreateView,
DetailView,
ListView,
UpdateView,
ListView,
DeleteView
)
from .forms import ChallengesModelForm
from .models import Challenges
class ChallengesCreateVie... | 24.738462 | 54 | 0.774254 | from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.views.generic import (
CreateView,
DetailView,
ListView,
UpdateView,
ListView,
DeleteView
)
from .forms import ChallengesModelForm
from .models import Challenges
class ChallengesCreateView(CreateView):
template_n... | true | true |
08f69b0f5cf1160ccdc56883deee99d085ceee83 | 2,196 | py | Python | src/accounts/forms.py | MAE776569/project-manager | 986a1a8b84950da81e98125d70ae3ef380e96e54 | [
"Apache-2.0"
] | null | null | null | src/accounts/forms.py | MAE776569/project-manager | 986a1a8b84950da81e98125d70ae3ef380e96e54 | [
"Apache-2.0"
] | 7 | 2020-03-24T17:08:34.000Z | 2022-02-10T09:50:00.000Z | src/accounts/forms.py | MAE776569/project-manager | 986a1a8b84950da81e98125d70ae3ef380e96e54 | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib.auth.forms import PasswordChangeForm
from authentication.forms import get_password_help_text
from django.core.validators import RegexValidator
from django.contrib.auth import get_user_model
from io import BytesIO
from PIL import Image
from os.path import splitext
class User... | 34.3125 | 88 | 0.645264 | from django import forms
from django.contrib.auth.forms import PasswordChangeForm
from authentication.forms import get_password_help_text
from django.core.validators import RegexValidator
from django.contrib.auth import get_user_model
from io import BytesIO
from PIL import Image
from os.path import splitext
class User... | true | true |
08f69cbdfb093d69ff30763208eb396a5086a3b3 | 11,075 | py | Python | ansible/modules/network/f5/bigip_gtm_datacenter.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/f5/bigip_gtm_datacenter.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/f5/bigip_gtm_datacenter.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | 29.612299 | 82 | 0.599819 |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: bigip_gtm_datacenter
short_description: Manage Datacenter configuration in BIG-IP
description:
- Manage BIG-IP data center configuration. A data... | true | true |
08f69cea3a5764820d6710e6fa73522ed24a73c5 | 1,753 | py | Python | code/cnn_ecg/lib/grid_graph.py | TheShadow29/btp-cv | e468a1baf36364096fb7cb4ff854a745298cec12 | [
"MIT"
] | 7 | 2018-08-31T02:41:10.000Z | 2019-03-12T12:57:49.000Z | code/cnn_ecg/lib/grid_graph.py | TheShadow29/btp-cv | e468a1baf36364096fb7cb4ff854a745298cec12 | [
"MIT"
] | null | null | null | code/cnn_ecg/lib/grid_graph.py | TheShadow29/btp-cv | e468a1baf36364096fb7cb4ff854a745298cec12 | [
"MIT"
] | null | null | null | import sklearn
import sklearn.metrics
import scipy.sparse, scipy.sparse.linalg # scipy.spatial.distance
import numpy as np
def grid_graph(grid_side,number_edges,metric):
"""Generate graph of a grid"""
z = grid(grid_side)
dist, idx = distance_sklearn_metrics(z, k=number_edges, metric=metric)
A = adjac... | 26.164179 | 81 | 0.614946 | import sklearn
import sklearn.metrics
import scipy.sparse, scipy.sparse.linalg import numpy as np
def grid_graph(grid_side,number_edges,metric):
z = grid(grid_side)
dist, idx = distance_sklearn_metrics(z, k=number_edges, metric=metric)
A = adjacency(dist, idx)
print("nb edges: ",A.nnz)
return A
... | true | true |
08f69dea9b0b21f547323a1b3052668a21ccdad7 | 10,084 | py | Python | torch/nn/modules/upsampling.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 206 | 2020-11-28T22:56:38.000Z | 2022-03-27T02:33:04.000Z | torch/nn/modules/upsampling.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19 | 2020-12-09T23:13:14.000Z | 2022-01-24T23:24:08.000Z | torch/nn/modules/upsampling.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 28 | 2020-11-29T15:25:12.000Z | 2022-01-20T02:16:27.000Z | from .module import Module
from .. import functional as F
from torch import Tensor
from typing import Optional
from ..common_types import _size_2_t, _ratio_2_t, _size_any_t, _ratio_any_t
class Upsample(Module):
r"""Upsamples a given multi-channel 1D (temporal), 2D (spatial) or 3D (volumetric) data.
The inpu... | 41.842324 | 113 | 0.554542 | from .module import Module
from .. import functional as F
from torch import Tensor
from typing import Optional
from ..common_types import _size_2_t, _ratio_2_t, _size_any_t, _ratio_any_t
class Upsample(Module):
__constants__ = ['size', 'scale_factor', 'mode', 'align_corners', 'name']
name: str
size: Opti... | true | true |
08f69e2a8bd6093a50b09b3845b6352b80f80408 | 3,665 | py | Python | src/sentry/templatetags/sentry_plugins.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 4 | 2016-03-16T07:21:36.000Z | 2017-09-04T07:29:56.000Z | src/sentry/templatetags/sentry_plugins.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | 8 | 2019-12-28T23:49:55.000Z | 2022-03-02T04:34:18.000Z | src/sentry/templatetags/sentry_plugins.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | 1 | 2017-04-08T04:09:18.000Z | 2017-04-08T04:09:18.000Z | """
sentry.templatetags.sentry_plugins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django import template
from sentry.plugins import Annotation, plugins
from... | 26.948529 | 104 | 0.650477 | from __future__ import absolute_import
from django import template
from sentry.plugins import Annotation, plugins
from sentry.utils.safe import safe_execute
register = template.Library()
@register.filter
def get_actions(group, request):
project = group.project
action_list = []
for plugin in plugins.fo... | true | true |
08f69ef734aae3e5f9ffd0544075ddac9386fa1f | 1,631 | py | Python | cogs/events.py | eunwoo1104/cork | bb6fb4cef8b5291e1b1f4c63e40a7d30cecc598c | [
"MIT"
] | null | null | null | cogs/events.py | eunwoo1104/cork | bb6fb4cef8b5291e1b1f4c63e40a7d30cecc598c | [
"MIT"
] | 1 | 2021-02-13T13:05:26.000Z | 2021-04-03T16:24:17.000Z | cogs/events.py | eunwoo1104/cork | bb6fb4cef8b5291e1b1f4c63e40a7d30cecc598c | [
"MIT"
] | 1 | 2021-01-09T06:31:01.000Z | 2021-01-09T06:31:01.000Z | import traceback
import discord
from discord.ext import commands
from discord_slash import SlashContext
from discord_slash.error import RequestFailure
from modules.client import CorkClient
class Events(commands.Cog):
def __init__(self, bot: CorkClient):
self.bot = bot
@commands.Cog.listener()
asy... | 37.068182 | 103 | 0.619865 | import traceback
import discord
from discord.ext import commands
from discord_slash import SlashContext
from discord_slash.error import RequestFailure
from modules.client import CorkClient
class Events(commands.Cog):
def __init__(self, bot: CorkClient):
self.bot = bot
@commands.Cog.listener()
asy... | true | true |
08f6a02e4bc7f740451b0fc65722bf8c42029846 | 19,954 | py | Python | python/abess/bess_base.py | zaza0209/abess | 42e5b7180383c450a3355219f3dd8cc8567d4a00 | [
"Intel"
] | 10 | 2021-08-02T02:37:34.000Z | 2022-01-23T13:02:20.000Z | python/abess/bess_base.py | zaza0209/abess | 42e5b7180383c450a3355219f3dd8cc8567d4a00 | [
"Intel"
] | 1 | 2022-01-27T11:12:26.000Z | 2022-01-27T11:12:26.000Z | python/abess/bess_base.py | zaza0209/abess | 42e5b7180383c450a3355219f3dd8cc8567d4a00 | [
"Intel"
] | null | null | null | import numbers
import numpy as np
from scipy.sparse import coo_matrix
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.base import BaseEstimator
from .cabess import *
class bess_base(BaseEstimator):
"""
Parameters
----------
max_iter : int, optional
Max... | 40.722449 | 205 | 0.544352 | import numbers
import numpy as np
from scipy.sparse import coo_matrix
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.base import BaseEstimator
from .cabess import *
class bess_base(BaseEstimator):
def __init__(self, algorithm_type, model_type, normalize_type, path_type,... | true | true |
08f6a165068a937c145b5a5a8831c2c0fe624a7d | 4,224 | py | Python | init2winit/model_lib/max_pooling_cnn.py | google/init2winit | 62ec9fd31bd7b38bb7c220f15d4187bf0706506d | [
"Apache-2.0"
] | 32 | 2021-05-15T01:03:44.000Z | 2022-03-31T10:54:48.000Z | init2winit/model_lib/max_pooling_cnn.py | google/init2winit | 62ec9fd31bd7b38bb7c220f15d4187bf0706506d | [
"Apache-2.0"
] | 31 | 2021-05-20T08:03:40.000Z | 2022-03-31T10:27:42.000Z | init2winit/model_lib/max_pooling_cnn.py | google/init2winit | 62ec9fd31bd7b38bb7c220f15d4187bf0706506d | [
"Apache-2.0"
] | 6 | 2021-05-20T06:10:04.000Z | 2022-03-31T18:55:04.000Z | # coding=utf-8
# Copyright 2021 The init2winit 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 la... | 33 | 98 | 0.703125 |
from typing import Any, Sequence
from flax import linen as nn
from init2winit.model_lib import base_model
from init2winit.model_lib import model_utils
from jax.nn import initializers
import jax.numpy as jnp
from ml_collections.config_dict import config_dict
DEFAULT_HPARAMS = config_dict.ConfigDict(dict(
num_fi... | true | true |
08f6a2735ea174a09bd8f37be7ea894b095db504 | 3,256 | py | Python | qiskit_ibm/jupyter/dashboard/watcher_monitor.py | Rcuz8/qiskit-ibm | 3de21f2a2594b51ab0a47214cd7f601f3821cec9 | [
"Apache-2.0"
] | null | null | null | qiskit_ibm/jupyter/dashboard/watcher_monitor.py | Rcuz8/qiskit-ibm | 3de21f2a2594b51ab0a47214cd7f601f3821cec9 | [
"Apache-2.0"
] | null | null | null | qiskit_ibm/jupyter/dashboard/watcher_monitor.py | Rcuz8/qiskit-ibm | 3de21f2a2594b51ab0a47214cd7f601f3821cec9 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 33.916667 | 87 | 0.578317 |
import sys
import time
import threading
from qiskit.providers.jobstatus import JobStatus
from qiskit_ibm.job.ibmqjob import IBMQJob
from ...utils.converters import duration_difference
def _job_monitor(job: IBMQJob, status: JobStatus, watcher: 'IQXDashboard') -> None:
thread = threading.Thread(target=_job_chec... | true | true |
08f6a28b912bb01f537de65d51747874bb5996b2 | 9,297 | py | Python | litex_things/deps/litescope/litescope/core.py | bjonnh/fomu-playground | 9f95ed7b28d15ce219d09c16c2c8d6b5594adceb | [
"0BSD"
] | null | null | null | litex_things/deps/litescope/litescope/core.py | bjonnh/fomu-playground | 9f95ed7b28d15ce219d09c16c2c8d6b5594adceb | [
"0BSD"
] | null | null | null | litex_things/deps/litescope/litescope/core.py | bjonnh/fomu-playground | 9f95ed7b28d15ce219d09c16c2c8d6b5594adceb | [
"0BSD"
] | null | null | null | from migen import *
from migen.genlib.misc import WaitTimer
from migen.genlib.cdc import MultiReg, PulseSynchronizer
from litex.build.tools import write_to_file
from litex.soc.interconnect.csr import *
from litex.soc.cores.gpio import GPIOInOut
from litex.soc.interconnect import stream
class LiteScopeIO(Module, Aut... | 30.99 | 101 | 0.556954 | from migen import *
from migen.genlib.misc import WaitTimer
from migen.genlib.cdc import MultiReg, PulseSynchronizer
from litex.build.tools import write_to_file
from litex.soc.interconnect.csr import *
from litex.soc.cores.gpio import GPIOInOut
from litex.soc.interconnect import stream
class LiteScopeIO(Module, Aut... | true | true |
08f6a3b01371b598c40d977d0a76420a1eb29b1c | 88,738 | py | Python | mne/filter.py | mehdikuchi/mne-python | 864426c4839bab05fd0d142ee20938c336c0b78e | [
"BSD-3-Clause"
] | null | null | null | mne/filter.py | mehdikuchi/mne-python | 864426c4839bab05fd0d142ee20938c336c0b78e | [
"BSD-3-Clause"
] | null | null | null | mne/filter.py | mehdikuchi/mne-python | 864426c4839bab05fd0d142ee20938c336c0b78e | [
"BSD-3-Clause"
] | null | null | null | """IIR and FIR filtering and resampling functions."""
from collections import Counter
from copy import deepcopy
from functools import partial
import numpy as np
from .annotations import _annotations_starts_stops
from .io.pick import _picks_to_idx
from .cuda import (_setup_cuda_fft_multiply_repeated, _fft_multiply_re... | 38.183305 | 126 | 0.570736 |
from collections import Counter
from copy import deepcopy
from functools import partial
import numpy as np
from .annotations import _annotations_starts_stops
from .io.pick import _picks_to_idx
from .cuda import (_setup_cuda_fft_multiply_repeated, _fft_multiply_repeated,
_setup_cuda_fft_resample, _... | true | true |
08f6a43eaae2306d7bc73831842737572dcf2d1e | 397 | py | Python | prob13.py | davidkartchner/project_euler | 1f24bf115c460e00319da5f80777cd054d003165 | [
"MIT"
] | null | null | null | prob13.py | davidkartchner/project_euler | 1f24bf115c460e00319da5f80777cd054d003165 | [
"MIT"
] | null | null | null | prob13.py | davidkartchner/project_euler | 1f24bf115c460e00319da5f80777cd054d003165 | [
"MIT"
] | null | null | null | import numpy as np
A = []
f = open('p13_nums.txt','r')
for line in f:
A.append([int(i)for i in line.strip()])
A = np.array(A)
digits = []
temp = 0
for i in xrange(49,-1,-1):
col_sum = np.sum(A[:,i])+temp
digits.insert(0,col_sum%10)
temp = col_sum//10
if i==0:
digits.insert(0, (col_sum//10)%10)
if col_sum//1... | 19.85 | 40 | 0.624685 | import numpy as np
A = []
f = open('p13_nums.txt','r')
for line in f:
A.append([int(i)for i in line.strip()])
A = np.array(A)
digits = []
temp = 0
for i in xrange(49,-1,-1):
col_sum = np.sum(A[:,i])+temp
digits.insert(0,col_sum%10)
temp = col_sum//10
if i==0:
digits.insert(0, (col_sum//10)%10)
if col_sum//1... | false | true |
08f6a60847f19fab0d1b893ddf4ff37916da12b4 | 1,878 | py | Python | announcement/serializers.py | AngleMAXIN/nomooc | 0c06b8af405b8254c242b34e85b7cba99c8f5737 | [
"MIT"
] | 1 | 2019-12-04T03:20:16.000Z | 2019-12-04T03:20:16.000Z | announcement/serializers.py | AngleMAXIN/NoMooc | 0c06b8af405b8254c242b34e85b7cba99c8f5737 | [
"MIT"
] | null | null | null | announcement/serializers.py | AngleMAXIN/NoMooc | 0c06b8af405b8254c242b34e85b7cba99c8f5737 | [
"MIT"
] | null | null | null | from utils.api import serializers
from .models import Message, Announcements
class AnnouncementOneSerializer(serializers.Serializer):
title = serializers.CharField(max_length=50)
content = serializers.CharField(max_length=1024 * 1024 * 8)
created_by = serializers.CharField(max_length=12)
create_time ... | 32.947368 | 79 | 0.755059 | from utils.api import serializers
from .models import Message, Announcements
class AnnouncementOneSerializer(serializers.Serializer):
title = serializers.CharField(max_length=50)
content = serializers.CharField(max_length=1024 * 1024 * 8)
created_by = serializers.CharField(max_length=12)
create_time ... | true | true |
08f6a6e76ede812dc71575cd78337e919bf29fe1 | 1,588 | py | Python | pypinyin/unicode_tool.py | smallqiao/pypinyin | b3aff4a303227a8981bec1143ece1797170178e7 | [
"Apache-2.0"
] | 6 | 2015-06-18T12:33:09.000Z | 2018-08-28T09:41:32.000Z | pypinyin/unicode_tool.py | rainforest32/pypinyin | b3aff4a303227a8981bec1143ece1797170178e7 | [
"Apache-2.0"
] | 1 | 2016-07-15T16:50:21.000Z | 2016-07-15T16:50:21.000Z | pypinyin/unicode_tool.py | smallqiao/pypinyin | b3aff4a303227a8981bec1143ece1797170178e7 | [
"Apache-2.0"
] | 2 | 2015-05-01T05:07:00.000Z | 2017-11-12T08:37:26.000Z | #/usr/bin/env python3
def is_chinese(uchar):
"""判断一个unicode是否是汉字"""
if uchar >= '\u4e00' and uchar <= '\u9fa5':
return True
else:
return False
def is_number(uchar):
"""判断一个unicode是否是数字"""
if uchar >= '\u0030' and uchar <= '\u0039':
return True
else:
... | 25.206349 | 74 | 0.574307 |
def is_chinese(uchar):
if uchar >= '\u4e00' and uchar <= '\u9fa5':
return True
else:
return False
def is_number(uchar):
if uchar >= '\u0030' and uchar <= '\u0039':
return True
else:
return False
def is_alphabet(uchar):
if (uchar >= '\u0041' and ucha... | true | true |
08f6a7222247fe6ae53797a763d8efd1f0dbfbd6 | 436 | py | Python | tests/test_first_run.py | fahadishaq1/Automated_Testing_Example | 2e79607464f3b5b7a33d7cc6e4ad70da440b3091 | [
"MIT"
] | null | null | null | tests/test_first_run.py | fahadishaq1/Automated_Testing_Example | 2e79607464f3b5b7a33d7cc6e4ad70da440b3091 | [
"MIT"
] | null | null | null | tests/test_first_run.py | fahadishaq1/Automated_Testing_Example | 2e79607464f3b5b7a33d7cc6e4ad70da440b3091 | [
"MIT"
] | null | null | null | import pytest
from src.first_run.example_code import capitalize_name, uppercase_name, foo
def test_capitalize_name():
assert capitalize_name('david') == 'David'
assert capitalize_name('fahad') == 'Fahad'
def test_uppercase_name():
assert uppercase_name('david') == 'DAVID'
assert uppercase_name('faha... | 24.222222 | 75 | 0.711009 | import pytest
from src.first_run.example_code import capitalize_name, uppercase_name, foo
def test_capitalize_name():
assert capitalize_name('david') == 'David'
assert capitalize_name('fahad') == 'Fahad'
def test_uppercase_name():
assert uppercase_name('david') == 'DAVID'
assert uppercase_name('faha... | true | true |
08f6a81535534c832ed3bf2ca5e7ef48295342f2 | 9,199 | py | Python | Chapter09/utils.py | poshan0126/TensorFlow-Machine-Learning-Projects | 5b8d7988b86e39ffdd8babec2b8e3c791b5e853e | [
"MIT"
] | 74 | 2019-01-19T23:37:26.000Z | 2022-03-30T12:59:34.000Z | Chapter09/utils.py | poshan0126/TensorFlow-Machine-Learning-Projects | 5b8d7988b86e39ffdd8babec2b8e3c791b5e853e | [
"MIT"
] | 46 | 2019-01-23T05:02:43.000Z | 2022-03-12T01:04:37.000Z | Chapter09/utils.py | poshan0126/TensorFlow-Machine-Learning-Projects | 5b8d7988b86e39ffdd8babec2b8e3c791b5e853e | [
"MIT"
] | 54 | 2018-08-07T00:56:48.000Z | 2022-03-22T18:06:37.000Z | '''
This file consists of the helper functions for processing
'''
## Package Imports
from PIL import Image
import os
from parameters import *
import tensorflow as tf
import numpy as np
import glob
try:
import wget
except:
print ("Can't import wget as you are probably on windows laptop")
def extract_files(data... | 57.136646 | 132 | 0.614632 |
from PIL import Image
import os
from parameters import *
import tensorflow as tf
import numpy as np
import glob
try:
import wget
except:
print ("Can't import wget as you are probably on windows laptop")
def extract_files(data_dir,type = 'bags'):
input_file_dir = os.path.join(os.getcwd(),data_dir, "train")... | true | true |
08f6a8dfadaee3db4dc3906c7bf1b23b929dad90 | 7,807 | py | Python | sandbox/rocky/tf/algos/batch_polopt.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | sandbox/rocky/tf/algos/batch_polopt.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | sandbox/rocky/tf/algos/batch_polopt.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | import time
from rllab.algos.base import RLAlgorithm
import rllab.misc.logger as logger
import rllab.plotter as plotter
from sandbox.rocky.tf.policies.base import Policy
import tensorflow as tf
from sandbox.rocky.tf.samplers.batch_sampler import BatchSampler
from sandbox.rocky.tf.samplers.vectorized_sampler import Vect... | 39.231156 | 111 | 0.570898 | import time
from rllab.algos.base import RLAlgorithm
import rllab.misc.logger as logger
import rllab.plotter as plotter
from sandbox.rocky.tf.policies.base import Policy
import tensorflow as tf
from sandbox.rocky.tf.samplers.batch_sampler import BatchSampler
from sandbox.rocky.tf.samplers.vectorized_sampler import Vect... | true | true |
08f6aa1b2bbee1fc7caab0b7944e4bb35cce6687 | 17,882 | py | Python | libcst/codemod/visitors/tests/test_apply_type_annotations.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | libcst/codemod/visitors/tests/test_apply_type_annotations.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | libcst/codemod/visitors/tests/test_apply_type_annotations.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import textwrap
from typing import Type
from libcst import parse_module
from libcst.codemod import Codemod, CodemodContext, CodemodTest
from libc... | 27.42638 | 89 | 0.291858 |
import textwrap
from typing import Type
from libcst import parse_module
from libcst.codemod import Codemod, CodemodContext, CodemodTest
from libcst.codemod.visitors._apply_type_annotations import ApplyTypeAnnotationsVisitor
from libcst.testing.utils import data_provider
class TestApplyAnnotationsVisitor(CodemodTest... | true | true |
08f6aaaf6e7ec859baca29d08ed0bbd035dc4263 | 678 | py | Python | tracker/migrations/0002_auto_20210618_1535.py | enoch-prince/LocationTracker | 8e20a3cdd24da828b459d3a14bc609faa3ccb12c | [
"MIT"
] | null | null | null | tracker/migrations/0002_auto_20210618_1535.py | enoch-prince/LocationTracker | 8e20a3cdd24da828b459d3a14bc609faa3ccb12c | [
"MIT"
] | null | null | null | tracker/migrations/0002_auto_20210618_1535.py | enoch-prince/LocationTracker | 8e20a3cdd24da828b459d3a14bc609faa3ccb12c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-18 12:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tracker', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='location',
name='latitude',
... | 28.25 | 121 | 0.619469 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tracker', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='location',
name='latitude',
field=models.DecimalField(blank=True, decimal... | true | true |
08f6ac9c86ba3683a0f7cc87f4fd7b08d760b9d6 | 613 | py | Python | core/models.py | aruntakkar/restembed | 5a2da64ab6a0386e1a6a37cdbfe2191241cf866d | [
"BSD-3-Clause"
] | null | null | null | core/models.py | aruntakkar/restembed | 5a2da64ab6a0386e1a6a37cdbfe2191241cf866d | [
"BSD-3-Clause"
] | null | null | null | core/models.py | aruntakkar/restembed | 5a2da64ab6a0386e1a6a37cdbfe2191241cf866d | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
# Create your models here.
class SavedEmbeds(models.Model):
type = models.CharField(max_length=15)
provider_url = models.URLField()
provider_name = models.CharField(max_length=100)
title = models.CharField(max_length=100)
description = models.TextField()
width = m... | 32.263158 | 65 | 0.737357 | from django.db import models
class SavedEmbeds(models.Model):
type = models.CharField(max_length=15)
provider_url = models.URLField()
provider_name = models.CharField(max_length=100)
title = models.CharField(max_length=100)
description = models.TextField()
width = models.TextField()
heigh... | true | true |
08f6ada93aa1444a6e835d40128047b7ae407c2b | 6,435 | py | Python | semantic_aware_models/models/classification/brnn_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | null | null | null | semantic_aware_models/models/classification/brnn_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | null | null | null | semantic_aware_models/models/classification/brnn_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | 1 | 2020-03-19T12:41:54.000Z | 2020-03-19T12:41:54.000Z | import torch
import torch.nn as nn
import torch.nn.parallel
from semantic_aware_models.utils.gpu import GPU
gpu = GPU()
class BiRNN(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, num_classes):
super(BiRNN, self).__init__()
self.hidden_size = hidden_size
self.num_layer... | 46.294964 | 131 | 0.680808 | import torch
import torch.nn as nn
import torch.nn.parallel
from semantic_aware_models.utils.gpu import GPU
gpu = GPU()
class BiRNN(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, num_classes):
super(BiRNN, self).__init__()
self.hidden_size = hidden_size
self.num_layer... | true | true |
08f6adacd18d51c285fdb1cbae0fe5076454ba29 | 31,232 | py | Python | src/sage/crypto/lwe.py | velasjk3/SageMath | 7fb1c29714fb7c9b93e640e658586a664f939791 | [
"BSL-1.0"
] | null | null | null | src/sage/crypto/lwe.py | velasjk3/SageMath | 7fb1c29714fb7c9b93e640e658586a664f939791 | [
"BSL-1.0"
] | null | null | null | src/sage/crypto/lwe.py | velasjk3/SageMath | 7fb1c29714fb7c9b93e640e658586a664f939791 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
(Ring-)LWE oracle generators
The Learning with Errors problem (LWE) is solving linear systems of equations
where the right hand side has been disturbed 'slightly' where 'slightly' is made
precise by a noise distribution - typically a discrete Gaussian
distribution. See [Reg09]_ for details.... | 37.583634 | 181 | 0.588755 |
from sage.functions.log import log
from sage.functions.other import sqrt, floor, ceil
from sage.misc.functional import cyclotomic_polynomial, round
from sage.misc.randstate import set_random_seed
from sage.misc.prandom import randint
from sage.modules.free_module import FreeModule
from sage.modules.free_module_element... | true | true |
08f6adcc81987c4f514d6bb5f86a72dc9d033c56 | 2,072 | py | Python | github/commands/open_issue.py | timfjord/GitSavvy | c0a627c30da79cb10a5a33f30d92d177f78da0ab | [
"MIT"
] | 2,058 | 2015-02-27T19:06:31.000Z | 2019-10-17T13:42:11.000Z | github/commands/open_issue.py | timfjord/GitSavvy | c0a627c30da79cb10a5a33f30d92d177f78da0ab | [
"MIT"
] | 1,057 | 2015-02-11T23:14:56.000Z | 2019-10-17T20:17:23.000Z | github/commands/open_issue.py | divmain/GitGadget | 6452528d22a13c6f3169ad20619471d261e576bf | [
"MIT"
] | 180 | 2015-03-06T14:26:05.000Z | 2019-10-12T06:28:21.000Z | from webbrowser import open as open_in_browser
import sublime
from sublime_plugin import EventListener, TextCommand
from GitSavvy.core.utils import flash
from GitSavvy.core.git_command import GitCommand
from .. import github, git_mixins
__all__ = (
"gs_github_open_issue_at_cursor",
"gs_github_hover_on_issue... | 31.393939 | 93 | 0.639479 | from webbrowser import open as open_in_browser
import sublime
from sublime_plugin import EventListener, TextCommand
from GitSavvy.core.utils import flash
from GitSavvy.core.git_command import GitCommand
from .. import github, git_mixins
__all__ = (
"gs_github_open_issue_at_cursor",
"gs_github_hover_on_issue... | true | true |
08f6ae34ef4680745d9a2ea79a88d29dc07e93ba | 962 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/network/v2017_03_01/models/virtual_network_paged.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure/mgmt/network/v2017_03_01/models/virtual_network_paged.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 34.357143 | 137 | 0.585239 |
from msrest.paging import Paged
class VirtualNetworkPaged(Paged):
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[VirtualNetwork]'}
}
def __init__(self, *args, **kwargs):
super(VirtualNetworkPaged, self).__init__(*a... | true | true |
08f6ae5a4a07adb35ff0a0776f60719d8e86ae17 | 1,372 | py | Python | py/cli/hwid_extractor.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/cli/hwid_extractor.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/cli/hwid_extractor.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | #!/usr/bin/env python3
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to quickly extract HWID and serial no. from DUT."""
import argparse
from http import server as http_server
import logging... | 31.181818 | 72 | 0.693878 |
import argparse
from http import server as http_server
import logging
import sys
from cros.factory.hwid_extractor import request_handler
def ParseArguments(raw_args):
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--port', type=int, default=8000,
help='Port to run the http s... | true | true |
08f6aeb7a4b3cd259ba490a0ec4d13b53697b073 | 3,733 | py | Python | chives/consensus/constants.py | WaitWha/chives-blockchain | 8ca4a87d26aaf2558950c77b8a42b1a76441b809 | [
"Apache-2.0"
] | null | null | null | chives/consensus/constants.py | WaitWha/chives-blockchain | 8ca4a87d26aaf2558950c77b8a42b1a76441b809 | [
"Apache-2.0"
] | null | null | null | chives/consensus/constants.py | WaitWha/chives-blockchain | 8ca4a87d26aaf2558950c77b8a42b1a76441b809 | [
"Apache-2.0"
] | null | null | null | import dataclasses
from chives.types.blockchain_format.sized_bytes import bytes32
from chives.util.byte_types import hexstr_to_bytes
from chives.util.ints import uint8, uint32, uint64, uint128
@dataclasses.dataclass(frozen=True)
class ConsensusConstants:
SLOT_BLOCKS_TARGET: uint32 # How many blocks to target pe... | 51.136986 | 118 | 0.750871 | import dataclasses
from chives.types.blockchain_format.sized_bytes import bytes32
from chives.util.byte_types import hexstr_to_bytes
from chives.util.ints import uint8, uint32, uint64, uint128
@dataclasses.dataclass(frozen=True)
class ConsensusConstants:
SLOT_BLOCKS_TARGET: uint32 MIN_BLOCKS_PER_CHALLENGE_B... | true | true |
08f6afac20737eac2aed1fce9e70726890ef55a2 | 3,238 | py | Python | detect_and_verify.py | Debapriya-Tula/Face-Verification | 939bc1adc171f67be375d4b98b0ef3520a82afbf | [
"MIT"
] | 6 | 2020-03-31T06:27:17.000Z | 2021-04-09T16:20:28.000Z | detect_and_verify.py | Debapriya-Tula/Face-Verification | 939bc1adc171f67be375d4b98b0ef3520a82afbf | [
"MIT"
] | 2 | 2020-04-06T09:48:35.000Z | 2020-04-11T17:17:33.000Z | detect_and_verify.py | Debapriya-Tula/Face-Verification | 939bc1adc171f67be375d4b98b0ef3520a82afbf | [
"MIT"
] | 2 | 2020-02-07T10:19:18.000Z | 2020-04-07T03:29:50.000Z | import os
from os.path import join as j
import numpy as np
import matplotlib.pyplot as plt
def detect_face(img):
# The file containing the pretrained classifier
haar_file = 'haarcascade_frontalface_default.xml'
# Image to be resized to this shape
(width, height) = (224, 224)
# Make ... | 31.745098 | 102 | 0.644225 | import os
from os.path import join as j
import numpy as np
import matplotlib.pyplot as plt
def detect_face(img):
haar_file = 'haarcascade_frontalface_default.xml'
(width, height) = (224, 224)
face_cascade = cv2.CascadeClassifier(haar_file)
gray = cv2.cvtColor(img... | true | true |
08f6b073123ea4898faf007c846fa479c731e9d1 | 796 | py | Python | manage.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | manage.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | manage.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mvj.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | 36.181818 | 77 | 0.649497 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mvj.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django except ImportError:
... | true | true |
08f6b104be037cd1b07fe9f43814c933041bd509 | 350 | py | Python | MyMovies/user/views.py | ArsalanShahid116/Django-MoviesApp | 4c9294767a70a9b2487030601ba4aa8c277bc030 | [
"MIT"
] | null | null | null | MyMovies/user/views.py | ArsalanShahid116/Django-MoviesApp | 4c9294767a70a9b2487030601ba4aa8c277bc030 | [
"MIT"
] | 7 | 2020-02-12T00:17:59.000Z | 2022-02-10T11:38:59.000Z | MyMovies/user/views.py | ArsalanShahid116/Django-MovieStore | 4c9294767a70a9b2487030601ba4aa8c277bc030 | [
"MIT"
] | null | null | null | from django.contrib.auth.forms import (
UserCreationForm,
)
from django.urls import (
reverse_lazy,
)
from django.views.generic import (
CreateView,
)
class RegisterView(CreateView):
template_name = 'user/register.html'
form_class = UserCreationForm
success_url = reverse_lazy(
... | 21.875 | 40 | 0.688571 | from django.contrib.auth.forms import (
UserCreationForm,
)
from django.urls import (
reverse_lazy,
)
from django.views.generic import (
CreateView,
)
class RegisterView(CreateView):
template_name = 'user/register.html'
form_class = UserCreationForm
success_url = reverse_lazy(
... | true | true |
08f6b251789466431b62a4077329c1139f77849a | 30,022 | py | Python | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/hgweb/webcommands.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/hgweb/webcommands.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/hgweb/webcommands.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:03:18.000Z | 2020-07-25T21:03:18.000Z | #
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, mimetypes, re, cgi, copy
import webutil
from mercurial... | 34.949942 | 80 | 0.527546 |
import os, mimetypes, re, cgi, copy
import webutil
from mercurial import error, encoding, archival, templater, templatefilters
from mercurial.node import short, hex
from mercurial.util import binary
from common import paritygen, staticfile, get_contact, ErrorResponse
from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NO... | false | true |
08f6b266387570f80f8062c8999585ee58c404a2 | 1,961 | py | Python | app/worksheets/forms.py | PhysicsUofRAUI/lifeLongLearning | 36e098d4319d3500509861454fa3e27a67416802 | [
"MIT"
] | null | null | null | app/worksheets/forms.py | PhysicsUofRAUI/lifeLongLearning | 36e098d4319d3500509861454fa3e27a67416802 | [
"MIT"
] | 38 | 2020-06-09T00:07:09.000Z | 2021-02-06T17:18:20.000Z | app/worksheets/forms.py | PhysicsUofRAUI/lifeLongLearning | 36e098d4319d3500509861454fa3e27a67416802 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
from wtforms.validators import DataRequired
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from flask_wtf.file import FileField, FileRequired
from ..models import Author, WorksheetCategory
#
# This function is desig... | 29.712121 | 104 | 0.734319 | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
from wtforms.validators import DataRequired
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from flask_wtf.file import FileField, FileRequired
from ..models import Author, WorksheetCategory
def category_choices() :
... | true | true |
08f6b2ef87035ef03123bebe8173cf6087941b10 | 76 | py | Python | polarcoordinates.py | Vicfred/hackerrankpython | c1f12ba006af67fede23885eda384f7d4f70eaf4 | [
"BSD-3-Clause"
] | 1 | 2019-10-09T06:35:56.000Z | 2019-10-09T06:35:56.000Z | polarcoordinates.py | Vicfred/hackerrankpython | c1f12ba006af67fede23885eda384f7d4f70eaf4 | [
"BSD-3-Clause"
] | null | null | null | polarcoordinates.py | Vicfred/hackerrankpython | c1f12ba006af67fede23885eda384f7d4f70eaf4 | [
"BSD-3-Clause"
] | null | null | null | from cmath import phase
z = complex(input())
print(abs(z))
print(phase(z))
| 12.666667 | 23 | 0.697368 | from cmath import phase
z = complex(input())
print(abs(z))
print(phase(z))
| true | true |
08f6b35c63979aa61390eedc35752493654a0023 | 194 | py | Python | blog/urls.py | ksigei/schools22 | f21cf1258aa808bbb9823948ece48e9318c7cf92 | [
"MIT"
] | null | null | null | blog/urls.py | ksigei/schools22 | f21cf1258aa808bbb9823948ece48e9318c7cf92 | [
"MIT"
] | 2 | 2022-02-10T05:49:02.000Z | 2022-03-31T05:42:28.000Z | blog/urls.py | ksigei/schools22 | f21cf1258aa808bbb9823948ece48e9318c7cf92 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'blog'
urlpatterns=[
path('',views.post_list,name="post_list"),
path('<slug:post>/',views.post_detail,name="post_detail"),
] | 21.555556 | 62 | 0.701031 | from django.urls import path
from . import views
app_name = 'blog'
urlpatterns=[
path('',views.post_list,name="post_list"),
path('<slug:post>/',views.post_detail,name="post_detail"),
] | true | true |
08f6b56ecff296ceb2868033d6f6b2c46e835315 | 1,034 | py | Python | cpp_api_binding/generator/generate_ctp.py | vnpy/vnpy_lab | 370ec82d65584eac28a00ec34b839ad790bee414 | [
"MIT"
] | 12 | 2019-02-16T20:03:23.000Z | 2022-01-28T02:37:56.000Z | cpp_api_binding/generator/generate_ctp.py | vnpy/vnpy_lab | 370ec82d65584eac28a00ec34b839ad790bee414 | [
"MIT"
] | 1 | 2019-03-08T04:57:11.000Z | 2019-03-12T01:21:56.000Z | cpp_api_binding/generator/generate_ctp.py | vnpy/vnpy_lab | 370ec82d65584eac28a00ec34b839ad790bee414 | [
"MIT"
] | 9 | 2019-02-24T03:35:05.000Z | 2021-12-21T08:55:59.000Z | import logging
import os
from adaptor.ctpadaptor import CtpAdaptor
from autocxxpy.generator import GeneratorOptions, Generator
logger = logging.getLogger(__file__)
def clear_dir(path: str):
for file in os.listdir(path):
os.unlink(os.path.join(path, file))
def main():
options: GeneratorOptions = Ct... | 25.219512 | 59 | 0.683752 | import logging
import os
from adaptor.ctpadaptor import CtpAdaptor
from autocxxpy.generator import GeneratorOptions, Generator
logger = logging.getLogger(__file__)
def clear_dir(path: str):
for file in os.listdir(path):
os.unlink(os.path.join(path, file))
def main():
options: GeneratorOptions = Ct... | true | true |
08f6b6c34d700e8d0260afb88532f2f895e4a1c9 | 342 | py | Python | python/OpenCalc/Lib/Code/Functions/OpenCalc.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | 3 | 2015-11-24T17:06:58.000Z | 2018-05-01T14:03:57.000Z | python/OpenCalc/Lib/Code/Functions/OpenCalc.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | python/OpenCalc/Lib/Code/Functions/OpenCalc.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | '''
Description Of Module
@Author = Joseph Lewis<joehms22@gmail.com>
@Date = 2010-2-24
@License = GPL
==Changelog==
2010-2-24 - First version made by Joseph Lewis
'''
#Import Statements
#Define Constants
#Define Functions
def isNum(var):
if(type(var).__name__ == 'int' or type(var).__name__ == 'float'):
return True... | 19 | 66 | 0.707602 |
def isNum(var):
if(type(var).__name__ == 'int' or type(var).__name__ == 'float'):
return True
else:
return False | true | true |
08f6b82c3b9d8c046b23c21ed6f133a9bd2ade6b | 9,603 | py | Python | electrum/gui/qt/channels_list.py | torusJKL/electrum | e7c02f19351c9b3946b9697d895a017c1daace64 | [
"MIT"
] | null | null | null | electrum/gui/qt/channels_list.py | torusJKL/electrum | e7c02f19351c9b3946b9697d895a017c1daace64 | [
"MIT"
] | null | null | null | electrum/gui/qt/channels_list.py | torusJKL/electrum | e7c02f19351c9b3946b9697d895a017c1daace64 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import traceback
from enum import IntEnum
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMenu, QHBoxLayout, QLabel, QVBoxLayout, QGridLayout, QLineEdit
from electrum.util import bh2u, NotEnoughFunds, NoDynamicFeeEstimates
from electrum.i18n import _
fr... | 41.571429 | 155 | 0.642299 | import traceback
from enum import IntEnum
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMenu, QHBoxLayout, QLabel, QVBoxLayout, QGridLayout, QLineEdit
from electrum.util import bh2u, NotEnoughFunds, NoDynamicFeeEstimates
from electrum.i18n import _
from electrum.lnchannel im... | true | true |
08f6b896235647f3d59160fce7dbcd9d3ce618c1 | 318 | py | Python | src/tasks/aws_organizations_task.py | jezd-axyl/platsec-aws-scanner | bc2b064c87ac2f77fab49c1e1eb3782d6de685b2 | [
"Apache-2.0"
] | null | null | null | src/tasks/aws_organizations_task.py | jezd-axyl/platsec-aws-scanner | bc2b064c87ac2f77fab49c1e1eb3782d6de685b2 | [
"Apache-2.0"
] | 4 | 2021-05-06T12:36:46.000Z | 2022-02-11T09:47:57.000Z | src/tasks/aws_organizations_task.py | jezd-axyl/platsec-aws-scanner | bc2b064c87ac2f77fab49c1e1eb3782d6de685b2 | [
"Apache-2.0"
] | 2 | 2021-04-21T04:48:47.000Z | 2022-01-14T04:29:17.000Z | from typing import Any, Dict
from src.tasks.aws_task import AwsTask
from src.clients.aws_organizations_client import AwsOrganizationsClient
class AwsOrganizationsTask(AwsTask):
def _run_task(self, client: AwsOrganizationsClient) -> Dict[Any, Any]:
raise NotImplementedError("this is an abstract class")
| 31.8 | 74 | 0.795597 | from typing import Any, Dict
from src.tasks.aws_task import AwsTask
from src.clients.aws_organizations_client import AwsOrganizationsClient
class AwsOrganizationsTask(AwsTask):
def _run_task(self, client: AwsOrganizationsClient) -> Dict[Any, Any]:
raise NotImplementedError("this is an abstract class")
| true | true |
08f6babb10015dcf7d721eae101be03c8c989227 | 1,234 | py | Python | Chapter03/SVG_tangent_line.py | allen-zqh/plotly | bcaf0930901e77db07245b63bff049eb75893416 | [
"MIT"
] | null | null | null | Chapter03/SVG_tangent_line.py | allen-zqh/plotly | bcaf0930901e77db07245b63bff049eb75893416 | [
"MIT"
] | null | null | null | Chapter03/SVG_tangent_line.py | allen-zqh/plotly | bcaf0930901e77db07245b63bff049eb75893416 | [
"MIT"
] | 1 | 2021-02-04T06:56:18.000Z | 2021-02-04T06:56:18.000Z |
import plotly as py
import plotly.graph_objs as go
import numpy as np
# ----------pre def
pyplt = py.offline.plot
x0 = np.linspace(1, 3, 200)
y0 = x0 * np.sin(np.power(x0, 2)) + 1
trace0 = go.Scatter(
x=x0,
y=y0,
)
data = [trace0]
layout = {
'title': "f(x)=sin(x^2)+1",
'shapes': [
{
... | 19.903226 | 44 | 0.333874 |
import plotly as py
import plotly.graph_objs as go
import numpy as np
pyplt = py.offline.plot
x0 = np.linspace(1, 3, 200)
y0 = x0 * np.sin(np.power(x0, 2)) + 1
trace0 = go.Scatter(
x=x0,
y=y0,
)
data = [trace0]
layout = {
'title': "f(x)=sin(x^2)+1",
'shapes': [
{
'type': 'line',
... | true | true |
08f6bb13110381934ebee98651f43a9b5601500f | 1,410 | py | Python | bpy_lambda/2.78/scripts/addons_contrib/data_overrides/__init__.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | null | null | null | bpy_lambda/2.78/scripts/addons_contrib/data_overrides/__init__.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | null | null | null | bpy_lambda/2.78/scripts/addons_contrib/data_overrides/__init__.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | 1 | 2019-11-24T18:43:42.000Z | 2019-11-24T18:43:42.000Z | ### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | 30 | 79 | 0.684397 |
bl_info = {
"name": "Data Overrides",
"author": "Lukas Toenne",
"version": (0, 1),
"blender": (2, 7, 3),
"location": "Scene Properties",
"description": "Override settings and caching for linked objects",
"warning": "",
"wiki_url": "",
"tracker_url": "https://developer.blender.org/m... | true | true |
08f6bc6d578c9049589290473963ceb4e31153d3 | 21 | py | Python | covid_api/core/__init__.py | NASA-IMPACT/covid-api | 62fa23918861438090367a85c1dca5300871b9c7 | [
"MIT"
] | 14 | 2020-05-27T14:22:37.000Z | 2022-03-31T04:44:25.000Z | covid_api/core/__init__.py | NASA-IMPACT/covid-api | 62fa23918861438090367a85c1dca5300871b9c7 | [
"MIT"
] | 47 | 2020-05-27T02:43:08.000Z | 2021-11-30T17:50:45.000Z | covid_api/core/__init__.py | NASA-IMPACT/covid-api | 62fa23918861438090367a85c1dca5300871b9c7 | [
"MIT"
] | 3 | 2021-05-29T14:15:28.000Z | 2021-07-01T01:20:09.000Z | """covid_api.core"""
| 10.5 | 20 | 0.619048 | true | true | |
08f6bcacdb6960a0ba62038c36120e0ae1d8e5e0 | 15,522 | py | Python | torchrec/distributed/tests/test_model.py | s4ayub/torchrec | eaa0915c9c1563d47df3a4a075c2e51b3b7ca27f | [
"BSD-3-Clause"
] | 1 | 2022-02-18T20:49:09.000Z | 2022-02-18T20:49:09.000Z | torchrec/distributed/tests/test_model.py | s4ayub/torchrec | eaa0915c9c1563d47df3a4a075c2e51b3b7ca27f | [
"BSD-3-Clause"
] | null | null | null | torchrec/distributed/tests/test_model.py | s4ayub/torchrec | eaa0915c9c1563d47df3a4a075c2e51b3b7ca27f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass
from typing import List, cast, Optional, Tuple, Any, Dic... | 32.40501 | 88 | 0.607718 |
from dataclasses import dataclass
from typing import List, cast, Optional, Tuple, Any, Dict, Union
import torch
import torch.nn as nn
from torchrec.distributed.embedding_types import EmbeddingTableConfig
from torchrec.distributed.embeddingbag import (
EmbeddingBagSharder,
EmbeddingBagCollectionSharder,
)
from... | true | true |
08f6bd0a9b65387015097f2f916a9b2ed515348c | 4,414 | py | Python | tests/test_dp.py | eashsaxena/algorithms-2 | 2344a22f97d35c8e00723e0dbc74d004634da1fd | [
"MIT"
] | 3 | 2019-05-01T12:37:45.000Z | 2019-06-01T19:02:58.000Z | tests/test_dp.py | eashsaxena/algorithms-2 | 2344a22f97d35c8e00723e0dbc74d004634da1fd | [
"MIT"
] | 1 | 2019-09-13T23:05:19.000Z | 2019-09-13T23:05:19.000Z | tests/test_dp.py | eashsaxena/algorithms-2 | 2344a22f97d35c8e00723e0dbc74d004634da1fd | [
"MIT"
] | 2 | 2019-10-10T09:15:22.000Z | 2019-10-10T09:23:34.000Z | from algorithms.dp import (
max_profit_naive, max_profit_optimized,
climb_stairs, climb_stairs_optimized,
count,
combination_sum_topdown, combination_sum_bottom_up,
edit_distance,
egg_drop,
fib_recursive, fib_list, fib_iter,
hosoya_testing,
house_robber,
Job, schedule,
Item, ... | 31.755396 | 87 | 0.597191 | from algorithms.dp import (
max_profit_naive, max_profit_optimized,
climb_stairs, climb_stairs_optimized,
count,
combination_sum_topdown, combination_sum_bottom_up,
edit_distance,
egg_drop,
fib_recursive, fib_list, fib_iter,
hosoya_testing,
house_robber,
Job, schedule,
Item, ... | true | true |
08f6bd63718274513117cbafcd9ff8a651806ecf | 841 | py | Python | .idea/VirtualEnvironment/lib/python3.8/site-packages/tests/outcomes/wrong_answer/wrong_answer_in_test_1/test.py | TataSatyaPratheek/Tic-Tac-Toe | fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd | [
"MIT"
] | null | null | null | .idea/VirtualEnvironment/lib/python3.8/site-packages/tests/outcomes/wrong_answer/wrong_answer_in_test_1/test.py | TataSatyaPratheek/Tic-Tac-Toe | fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd | [
"MIT"
] | null | null | null | .idea/VirtualEnvironment/lib/python3.8/site-packages/tests/outcomes/wrong_answer/wrong_answer_in_test_1/test.py | TataSatyaPratheek/Tic-Tac-Toe | fa3da80f9ec9ffa3c8c9aaa34a5bb1e88553fecd | [
"MIT"
] | null | null | null | import unittest
import os
from inspect import cleandoc
from typing import Any, List
from hstest.check_result import CheckResult
from hstest.stage_test import StageTest
from hstest.test_case import TestCase
class WrongAnswerInTest1(StageTest):
def generate(self) -> List[TestCase]:
return [
Te... | 26.28125 | 75 | 0.663496 | import unittest
import os
from inspect import cleandoc
from typing import Any, List
from hstest.check_result import CheckResult
from hstest.stage_test import StageTest
from hstest.test_case import TestCase
class WrongAnswerInTest1(StageTest):
def generate(self) -> List[TestCase]:
return [
Te... | true | true |
08f6bed0f8911124a0e94b8239a59a49411450c0 | 3,578 | py | Python | telethon/_misc/enums.py | Hunter-XD/Telethon | cbe18fd4c66623e6dbe543b4656a030023bd4651 | [
"MIT"
] | null | null | null | telethon/_misc/enums.py | Hunter-XD/Telethon | cbe18fd4c66623e6dbe543b4656a030023bd4651 | [
"MIT"
] | null | null | null | telethon/_misc/enums.py | Hunter-XD/Telethon | cbe18fd4c66623e6dbe543b4656a030023bd4651 | [
"MIT"
] | null | null | null | from enum import Enum
def _impl_op(which):
def op(self, other):
if not isinstance(other, type(self)):
return NotImplemented
return getattr(self._val(), which)(other._val())
return op
class ConnectionMode(Enum):
FULL = "full"
INTERMEDIATE = "intermediate"
ABRIDGED = ... | 26.902256 | 84 | 0.561487 | from enum import Enum
def _impl_op(which):
def op(self, other):
if not isinstance(other, type(self)):
return NotImplemented
return getattr(self._val(), which)(other._val())
return op
class ConnectionMode(Enum):
FULL = "full"
INTERMEDIATE = "intermediate"
ABRIDGED = ... | true | true |
08f6bf247f4a6419d3f9363fc4cfae2d0a7edc9c | 13,934 | py | Python | homeassistant/components/google/__init__.py | bbordelon/core | 1a78e18eeb1ebd40fe678dcfef3ab34495db49cb | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/google/__init__.py | bbordelon/core | 1a78e18eeb1ebd40fe678dcfef3ab34495db49cb | [
"Apache-2.0"
] | 2 | 2022-03-03T06:26:44.000Z | 2022-03-31T06:32:50.000Z | homeassistant/components/google/__init__.py | AjayShanker-geek/core | 2242b023d383c5e8debfa813abe0871de4d30b06 | [
"Apache-2.0"
] | 1 | 2022-01-10T21:11:28.000Z | 2022-01-10T21:11:28.000Z | """Support for Google - Calendar Event Devices."""
from __future__ import annotations
from collections.abc import Mapping
from datetime import datetime, timedelta, timezone
from enum import Enum
import logging
from typing import Any
from oauth2client.client import (
FlowExchangeError,
OAuth2DeviceCodeError,
... | 32.105991 | 127 | 0.6454 | from __future__ import annotations
from collections.abc import Mapping
from datetime import datetime, timedelta, timezone
from enum import Enum
import logging
from typing import Any
from oauth2client.client import (
FlowExchangeError,
OAuth2DeviceCodeError,
OAuth2WebServerFlow,
)
from oauth2client.file im... | true | true |
08f6c00e4e3d2de12c27441d55c7078a25545eff | 5,766 | py | Python | metpy/io/tests/test_nexrad.py | shofer16450/MetPy | 82fcb11ead3f777047d2d2a25decb11949b81b4b | [
"BSD-3-Clause"
] | null | null | null | metpy/io/tests/test_nexrad.py | shofer16450/MetPy | 82fcb11ead3f777047d2d2a25decb11949b81b4b | [
"BSD-3-Clause"
] | null | null | null | metpy/io/tests/test_nexrad.py | shofer16450/MetPy | 82fcb11ead3f777047d2d2a25decb11949b81b4b | [
"BSD-3-Clause"
] | 1 | 2019-10-04T02:30:01.000Z | 2019-10-04T02:30:01.000Z | # Copyright (c) 2015,2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `nexrad` module."""
from datetime import datetime
import glob
from io import BytesIO
import logging
import os.path
import numpy as np
import pytest
from metp... | 34.118343 | 95 | 0.670135 |
from datetime import datetime
import glob
from io import BytesIO
import logging
import os.path
import numpy as np
import pytest
from metpy.cbook import get_test_data
from metpy.io import is_precip_mode, Level2File, Level3File
logging.getLogger('metpy.io.nexrad').setLevel(logging.CRITICAL)
level2_files = [('KTLX20... | true | true |
08f6c06f1b19a886b888f14f59bd91322d7d769c | 13,185 | py | Python | montage/juror_endpoints.py | baturin/montage | 9d1bb640d0d4f78359000d18de2206be84c12be0 | [
"BSD-3-Clause"
] | null | null | null | montage/juror_endpoints.py | baturin/montage | 9d1bb640d0d4f78359000d18de2206be84c12be0 | [
"BSD-3-Clause"
] | null | null | null | montage/juror_endpoints.py | baturin/montage | 9d1bb640d0d4f78359000d18de2206be84c12be0 | [
"BSD-3-Clause"
] | null | null | null |
from itertools import groupby
from clastic import GET, POST
from clastic.errors import Forbidden
from boltons.strutils import slugify
from rdb import JurorDAO
from utils import format_date, PermissionDenied, InvalidAction
MAX_RATINGS_SUBMIT = 100
VALID_RATINGS = (0.0, 0.25, 0.5, 0.75, 1.0)
VALID_YESNO = (0.0, 1.0)
... | 35.539084 | 87 | 0.62154 |
from itertools import groupby
from clastic import GET, POST
from clastic.errors import Forbidden
from boltons.strutils import slugify
from rdb import JurorDAO
from utils import format_date, PermissionDenied, InvalidAction
MAX_RATINGS_SUBMIT = 100
VALID_RATINGS = (0.0, 0.25, 0.5, 0.75, 1.0)
VALID_YESNO = (0.0, 1.0)
... | true | true |
08f6c12b7d584fe5b81a40fa3553140d3ddfc91c | 4,690 | py | Python | Tabs.py | mrozekma/Sprint | 0bf531d2f16a7bc5b56dbc8c6eae5dc9e251b2f1 | [
"MIT"
] | 2 | 2015-03-18T13:58:46.000Z | 2020-04-10T14:54:56.000Z | Tabs.py | mrozekma/Sprint | 0bf531d2f16a7bc5b56dbc8c6eae5dc9e251b2f1 | [
"MIT"
] | 20 | 2015-01-16T18:46:53.000Z | 2016-02-18T22:01:00.000Z | Tabs.py | mrozekma/Sprint | 0bf531d2f16a7bc5b56dbc8c6eae5dc9e251b2f1 | [
"MIT"
] | 2 | 2015-08-24T15:39:20.000Z | 2016-01-03T06:03:13.000Z | from collections import OrderedDict
import sys
import traceback
from utils import *
from rorn.HTTPHandler import handlers
from rorn.ResponseWriter import ResponseWriter
class Tab:
def __init__(self, base, name, path = None, displayName = None, num = None):
self.base = base
self.name = name
self.displayName = ... | 27.426901 | 110 | 0.654584 | from collections import OrderedDict
import sys
import traceback
from utils import *
from rorn.HTTPHandler import handlers
from rorn.ResponseWriter import ResponseWriter
class Tab:
def __init__(self, base, name, path = None, displayName = None, num = None):
self.base = base
self.name = name
self.displayName = ... | false | true |
08f6c28a26365226b915e6d18b46e78348c886fb | 1,120 | py | Python | tempest/api_schema/request/compute/v2/flavors.py | Mirantis/tempest | ae7e033fef80f2a4728a13bba18123f6fe32839a | [
"Apache-2.0"
] | 3 | 2015-03-03T15:43:06.000Z | 2016-10-24T06:12:40.000Z | tempest/api_schema/request/compute/v2/flavors.py | Mirantis/tempest | ae7e033fef80f2a4728a13bba18123f6fe32839a | [
"Apache-2.0"
] | null | null | null | tempest/api_schema/request/compute/v2/flavors.py | Mirantis/tempest | ae7e033fef80f2a4728a13bba18123f6fe32839a | [
"Apache-2.0"
] | null | null | null | # (c) 2014 Deutsche Telekom AG
# 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 ... | 29.473684 | 77 | 0.649107 |
import copy
from tempest.api_schema.request.compute import flavors
flavors_details = copy.deepcopy(flavors.common_flavor_details)
flavor_list = copy.deepcopy(flavors.common_flavor_list)
flavor_list["json-schema"]["properties"] = {
"minRam": {
"type": "integer",
"results": {
"gen_non... | true | true |
08f6c2bffc52e047f563772925dec33228da30b8 | 742 | py | Python | tests/Unit/Domain/Creators/Python/Test_Cylinder.py | nilsvu/spectre | 1455b9a8d7e92db8ad600c66f54795c29c3052ee | [
"MIT"
] | 117 | 2017-04-08T22:52:48.000Z | 2022-03-25T07:23:36.000Z | tests/Unit/Domain/Creators/Python/Test_Cylinder.py | GitHimanshuc/spectre | 4de4033ba36547113293fe4dbdd77591485a4aee | [
"MIT"
] | 3,177 | 2017-04-07T21:10:18.000Z | 2022-03-31T23:55:59.000Z | tests/Unit/Domain/Creators/Python/Test_Cylinder.py | geoffrey4444/spectre | 9350d61830b360e2d5b273fdd176dcc841dbefb0 | [
"MIT"
] | 85 | 2017-04-07T19:36:13.000Z | 2022-03-01T10:21:00.000Z | # Distributed under the MIT License.
# See LICENSE.txt for details.
from spectre.Domain.Creators import Cylinder, DomainCreator3D
import unittest
class TestCylinder(unittest.TestCase):
def test_construction(self):
cylinder = Cylinder(inner_radius=1.,
outer_radius=2.,
... | 32.26087 | 68 | 0.568733 |
from spectre.Domain.Creators import Cylinder, DomainCreator3D
import unittest
class TestCylinder(unittest.TestCase):
def test_construction(self):
cylinder = Cylinder(inner_radius=1.,
outer_radius=2.,
lower_bound=0.,
upper... | true | true |
08f6c3438da39bcc231e152fae84b7142f79fd2c | 34,292 | py | Python | CRF/crf_xrh.py | Xinrihui/Statistical-Learning-Method | 2e1c107bed8a21307596fbe0f8f1daed638657c5 | [
"Apache-2.0"
] | 2 | 2021-06-25T06:42:14.000Z | 2021-11-07T13:44:29.000Z | CRF/crf_xrh.py | Xinrihui/Statistical-Learning-Method | 2e1c107bed8a21307596fbe0f8f1daed638657c5 | [
"Apache-2.0"
] | null | null | null | CRF/crf_xrh.py | Xinrihui/Statistical-Learning-Method | 2e1c107bed8a21307596fbe0f8f1daed638657c5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import time
import pickle
import codecs
import numpy as np
from scipy import optimize
# 将 warnings 也当做错误抛出
# import warnings
# warnings.filterwarnings('error')
# 定义负无穷大
infinite = float('-inf')
class LinearCRF(object):
"""
线性链条件随机场
1. 适用于中文分词任务, 参考 CRF++, 设计如... | 27.302548 | 156 | 0.517001 |
import time
import pickle
import codecs
import numpy as np
from scipy import optimize
infinite = float('-inf')
class LinearCRF(object):
def __init__(self):
self.ntags = 4
self.index_tag = {0:'B', 1:'I', 2:'E', 3:'S'} self.tag_index = {'B':0, 'I':1, 'E':2, 'S':3}
self.tag_sets ... | true | true |
08f6c3e50afc2a54478e61b11e495971b7dfd2e4 | 6,267 | py | Python | gradientflow/_backprop.py | mariogeiger/gradientflow | 16749d538ca1caf3052ca50bfbdbabb61bd8e3a1 | [
"MIT"
] | 1 | 2020-12-08T02:07:30.000Z | 2020-12-08T02:07:30.000Z | gradientflow/_backprop.py | mariogeiger/gradientflow | 16749d538ca1caf3052ca50bfbdbabb61bd8e3a1 | [
"MIT"
] | 1 | 2021-08-30T14:50:01.000Z | 2021-08-31T12:07:46.000Z | gradientflow/_backprop.py | mariogeiger/gradientflow | 16749d538ca1caf3052ca50bfbdbabb61bd8e3a1 | [
"MIT"
] | null | null | null | # pylint: disable=no-member, invalid-name, line-too-long
"""
Gradient flow for any model using pytorch backprop
"""
import copy
import math
import torch
from ._flow import flow
from ._gradient import gradient
class _ContinuousMomentum(torch.optim.Optimizer):
r"""Implements a continuous version of momentum.
... | 28.486364 | 132 | 0.513802 | import copy
import math
import torch
from ._flow import flow
from ._gradient import gradient
class _ContinuousMomentum(torch.optim.Optimizer):
def __init__(self, params, dt, tau):
defaults = dict(dt=dt, tau=tau)
super().__init__(params, defaults)
def step(self, closure=None):
loss ... | true | true |
08f6c3faab21303b2a4b4a6f38459957fca2ad59 | 736 | py | Python | src/rdbms-connect/azext_rdbms_connect/vendored_sdks/mariadb/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | src/rdbms-connect/azext_rdbms_connect/vendored_sdks/mariadb/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | src/rdbms-connect/azext_rdbms_connect/vendored_sdks/mariadb/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-05-09T17:47:09.000Z | 2020-10-01T19:52:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.8 | 77 | 0.644022 |
from ._configuration import MariaDBManagementClientConfiguration
from ._maria_db_management_client import MariaDBManagementClient
__all__ = ['MariaDBManagementClient', 'MariaDBManagementClientConfiguration']
from .version import VERSION
__version__ = VERSION
| true | true |
08f6c40d66f4ca92a1f54857addec6e2e9f7c074 | 58,856 | py | Python | app/BWT.py | rmzelle/rgi | b08bf5a12758a6e7cc828563606b01646c38d407 | [
"FTL"
] | null | null | null | app/BWT.py | rmzelle/rgi | b08bf5a12758a6e7cc828563606b01646c38d407 | [
"FTL"
] | null | null | null | app/BWT.py | rmzelle/rgi | b08bf5a12758a6e7cc828563606b01646c38d407 | [
"FTL"
] | null | null | null | from app.settings import *
import csv, glob
from multiprocessing import Pool
import time
import statistics
class BWT(object):
"""
Class to align metagenomic reads to CARD and wildCARD reference using bwa or bowtie2 and
provide reports (gene, allele report and read level reports).
"""
def __init__(self, aligner, ... | 36.854101 | 206 | 0.672217 | from app.settings import *
import csv, glob
from multiprocessing import Pool
import time
import statistics
class BWT(object):
def __init__(self, aligner, include_wildcard, include_baits, read_one, read_two, threads, output_file, debug, clean, local_database, mapq, mapped, coverage):
self.aligner = aligner
self.re... | true | true |
08f6c42aebc12494c65c5cf3d1f4680a0e4422d2 | 873 | py | Python | xlsxwriter/test/comparison/test_optimize02.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-01-09T19:43:43.000Z | 2019-01-09T19:43:43.000Z | xlsxwriter/test/comparison/test_optimize02.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_optimize02.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 24.25 | 93 | 0.603666 |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
def setUp(self):
self.set_filename('optimize02.xlsx')
def test_create_file(self):
workbook = Workbook(self.got_filename, {'constant_memory': True, 'in_... | true | true |
08f6c4fa881d11ce685be64d41df9033fc567d94 | 699 | py | Python | redes_complejas/analisis_red_social.py | binary-hideout/sistemas-adaptativos | b0d57c3b98a6f8c3da9ee33fd063b19b4af71b82 | [
"Unlicense"
] | null | null | null | redes_complejas/analisis_red_social.py | binary-hideout/sistemas-adaptativos | b0d57c3b98a6f8c3da9ee33fd063b19b4af71b82 | [
"Unlicense"
] | 2 | 2019-08-17T00:02:15.000Z | 2019-09-02T23:26:15.000Z | redes_complejas/analisis_red_social.py | binary-hideout/sistemas-adaptativos | b0d57c3b98a6f8c3da9ee33fd063b19b4af71b82 | [
"Unlicense"
] | null | null | null | from sys import argv
def calcular(lineas):
n = len(lineas)
m = 0
grados = list()
for linea in lineas:
linea = linea.strip()
celdas = linea.split()
grado = 0
for celda in celdas:
m += int(celda)
grado += int(celda)
grados.append(grado)
m /= 2
densidad = (2 * m) / (n * (n - 1))
print('n (cantid... | 21.181818 | 73 | 0.636624 | from sys import argv
def calcular(lineas):
n = len(lineas)
m = 0
grados = list()
for linea in lineas:
linea = linea.strip()
celdas = linea.split()
grado = 0
for celda in celdas:
m += int(celda)
grado += int(celda)
grados.append(grado)
m /= 2
densidad = (2 * m) / (n * (n - 1))
print('n (cantid... | true | true |
08f6c50a4888546bc6c07fdd2a74c48d120048e2 | 654 | py | Python | Longest Intersection.py | Lyubomir-Dakov/Python-Advanced | 3b3b7181cc2bafc6f60329d6e42873d0f78b972f | [
"MIT"
] | null | null | null | Longest Intersection.py | Lyubomir-Dakov/Python-Advanced | 3b3b7181cc2bafc6f60329d6e42873d0f78b972f | [
"MIT"
] | null | null | null | Longest Intersection.py | Lyubomir-Dakov/Python-Advanced | 3b3b7181cc2bafc6f60329d6e42873d0f78b972f | [
"MIT"
] | null | null | null | def create_list_of_numbers(start: int, end: int):
my_set = {x for x in range(start, end + 1)}
return my_set
num = int(input())
last_result = ''
for _ in range(num):
range_1, range_2 = input().split('-')
start_1, end_1 = [int(x) for x in range_1.split(',')]
set_1 = create_list_of_numb... | 28.434783 | 85 | 0.642202 | def create_list_of_numbers(start: int, end: int):
my_set = {x for x in range(start, end + 1)}
return my_set
num = int(input())
last_result = ''
for _ in range(num):
range_1, range_2 = input().split('-')
start_1, end_1 = [int(x) for x in range_1.split(',')]
set_1 = create_list_of_numb... | true | true |
08f6c55aa07d10e8587e3b35964547bc480f65ae | 1,757 | py | Python | oscar/lib/python2.7/site-packages/django/conf/locale/pt/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/pt/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/pt/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FO... | 41.833333 | 91 | 0.542402 | from __future__ import unicode_literals
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y à\s H:i'
YEAR_MONTH_FORMAT = r'F \d\e Y'
MONTH_DAY_FORMAT = r'j \d\e F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 0
DATE_INPUT_FORMATS =... | true | true |
08f6c5b24bb41e54f827c9f18373d77097bac99f | 589 | py | Python | modules/signatures/android/application_using_the_camera.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 24 | 2021-06-21T07:35:37.000Z | 2022-03-22T03:33:59.000Z | modules/signatures/android/application_using_the_camera.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 3 | 2021-07-01T08:09:05.000Z | 2022-01-28T03:38:36.000Z | modules/signatures/android/application_using_the_camera.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 6 | 2021-06-22T05:32:57.000Z | 2022-02-11T02:05:45.000Z | # Copyright (C) Check Point Software Technologies LTD.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class AndroidCamera(Signature):
name = "application_using_the_camera"
description ... | 32.722222 | 68 | 0.706282 |
from lib.cuckoo.common.abstracts import Signature
class AndroidCamera(Signature):
name = "application_using_the_camera"
description = "Application Using The Camera (Dynamic)"
severity = 2
categories = ["android"]
authors = ["Check Point Software Technologies LTD"]
minimum = "2.0"
def on_c... | true | true |
08f6c5e6fc43ea5137b8a6085949fb3f6df1adf1 | 1,000 | py | Python | src/nono_generator/img_to_nono.py | m-c-frank/Nonogram-Toolkit | a6aa8975d8f39c5fa20d0f6342df584a396da205 | [
"MIT"
] | null | null | null | src/nono_generator/img_to_nono.py | m-c-frank/Nonogram-Toolkit | a6aa8975d8f39c5fa20d0f6342df584a396da205 | [
"MIT"
] | null | null | null | src/nono_generator/img_to_nono.py | m-c-frank/Nonogram-Toolkit | a6aa8975d8f39c5fa20d0f6342df584a396da205 | [
"MIT"
] | null | null | null | """
Takes a path to an img and generates the corresponding nonogram
"""
import cv2
import numpy as np
from nono_generator.generate_labels import get_labels
def pixelate(img, pixels_per_row=10, pixels_per_col=10):
"""
turns a gray scaled image to a pixelated binary image
1. convert to grayscale
2. nor... | 27.777778 | 78 | 0.671 | import cv2
import numpy as np
from nono_generator.generate_labels import get_labels
def pixelate(img, pixels_per_row=10, pixels_per_col=10):
if np.any(img > 1):
img = img / 255
threshold = np.mean(img) * 1 + ((0.5 - np.random.rand()) * 0.10)
_, img = cv2.threshold(img, threshold, 1, cv2.TH... | true | true |
08f6c6cc183cfe904a4ca2204f44952e8c37e2ec | 947 | py | Python | transaction/models.py | jobic10/e-banking-django | f10dbb0b29a097ba3a2e9ea9b2000e4341ce71d2 | [
"MIT"
] | 4 | 2021-01-21T15:29:02.000Z | 2022-02-28T07:58:55.000Z | transaction/models.py | jobic10/e-banking-django | f10dbb0b29a097ba3a2e9ea9b2000e4341ce71d2 | [
"MIT"
] | null | null | null | transaction/models.py | jobic10/e-banking-django | f10dbb0b29a097ba3a2e9ea9b2000e4341ce71d2 | [
"MIT"
] | null | null | null | from django.db import models
from account.models import User
from django.core.validators import MinValueValidator
# Create your models here.
class Transaction(models.Model):
sender = models.ForeignKey(
User, on_delete=models.CASCADE, related_name="sender")
receiver = models.ForeignKey(
User, ... | 39.458333 | 91 | 0.694826 | from django.db import models
from account.models import User
from django.core.validators import MinValueValidator
class Transaction(models.Model):
sender = models.ForeignKey(
User, on_delete=models.CASCADE, related_name="sender")
receiver = models.ForeignKey(
User, on_delete=models.CASCADE, r... | true | true |
08f6c7656ab2e1d46c9132b26f153271bcf79849 | 6,021 | py | Python | tensorflow_asr/models/ctc.py | tund/TensorFlowASR | a9b085095b2335ebbdaa2e78601b57073224f804 | [
"Apache-2.0"
] | null | null | null | tensorflow_asr/models/ctc.py | tund/TensorFlowASR | a9b085095b2335ebbdaa2e78601b57073224f804 | [
"Apache-2.0"
] | null | null | null | tensorflow_asr/models/ctc.py | tund/TensorFlowASR | a9b085095b2335ebbdaa2e78601b57073224f804 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huy Le Nguyen (@usimarit)
#
# 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 t... | 39.874172 | 132 | 0.650058 |
import numpy as np
import tensorflow as tf
from . import Model
from ..featurizers.speech_featurizers import TFSpeechFeaturizer
from ..featurizers.text_featurizers import TextFeaturizer
from ..utils.utils import shape_list
class CtcModel(Model):
def __init__(self, **kwargs):
super(CtcModel, self).__init_... | true | true |
08f6c7b79a5b9a2ec0d3ff7ef3b02d4ede1f9b51 | 1,405 | py | Python | Tutorials/6_MoveIt/arm_move_panda.py | WendyDang/RobotArm | 2b8e2ec26092a831f51b07f9f1eebf6763e80c39 | [
"MIT"
] | 3 | 2021-12-30T21:56:58.000Z | 2022-02-20T11:19:12.000Z | Tutorials/6_MoveIt/arm_move_panda.py | WendyDang/RobotArm | 2b8e2ec26092a831f51b07f9f1eebf6763e80c39 | [
"MIT"
] | 10 | 2021-11-13T21:18:33.000Z | 2022-03-11T23:11:23.000Z | Tutorials/6_MoveIt/arm_move_panda.py | WendyDang/RobotArm | 2b8e2ec26092a831f51b07f9f1eebf6763e80c39 | [
"MIT"
] | 3 | 2020-11-11T10:10:13.000Z | 2021-02-18T10:04:16.000Z | #!/usr/bin/env python
import sys
import rospy
import time
from math import pi
import moveit_commander
from moveit_msgs.msg import DisplayTrajectory
from geometry_msgs.msg import Pose
# Setup ros node and commander
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('moving_arm_livecode', anonymous=True)
... | 24.224138 | 117 | 0.797865 |
import sys
import rospy
import time
from math import pi
import moveit_commander
from moveit_msgs.msg import DisplayTrajectory
from geometry_msgs.msg import Pose
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('moving_arm_livecode', anonymous=True)
robot = moveit_commander.RobotCommander()
scene = mov... | true | true |
08f6c818659edb7dd9b5a6c788cca4dcda2a87ac | 19,627 | py | Python | lightautoml/dataset/np_pd_dataset.py | Zhurik/LightAutoML | 506d0602f40eca79ed0e5d58e7d4f71aeb1d8059 | [
"Apache-2.0"
] | null | null | null | lightautoml/dataset/np_pd_dataset.py | Zhurik/LightAutoML | 506d0602f40eca79ed0e5d58e7d4f71aeb1d8059 | [
"Apache-2.0"
] | null | null | null | lightautoml/dataset/np_pd_dataset.py | Zhurik/LightAutoML | 506d0602f40eca79ed0e5d58e7d4f71aeb1d8059 | [
"Apache-2.0"
] | 1 | 2021-12-08T13:52:45.000Z | 2021-12-08T13:52:45.000Z | """Internal representation of dataset in numpy, pandas and csr formats."""
from copy import copy # , deepcopy
from typing import Union, Sequence, List, Tuple, Any, Optional, TypeVar
import numpy as np
import pandas as pd
from log_calls import record_history
from pandas import Series, DataFrame
from scipy import spar... | 29.69289 | 124 | 0.574311 |
from copy import copy from typing import Union, Sequence, List, Tuple, Any, Optional, TypeVar
import numpy as np
import pandas as pd
from log_calls import record_history
from pandas import Series, DataFrame
from scipy import sparse
from .base import LAMLDataset, RolesDict, IntIdx, valid_array_attributes, array_attr... | true | true |
08f6c88f75bf21ca93b3540b337e4631fcedadf1 | 625 | py | Python | PycharmProjects/untitled/Faculdade/Aula/testeProf.py | zmixtv1/cev-Python | edce04f86d943d9af070bf3c5e89575ff796ec9e | [
"MIT"
] | null | null | null | PycharmProjects/untitled/Faculdade/Aula/testeProf.py | zmixtv1/cev-Python | edce04f86d943d9af070bf3c5e89575ff796ec9e | [
"MIT"
] | null | null | null | PycharmProjects/untitled/Faculdade/Aula/testeProf.py | zmixtv1/cev-Python | edce04f86d943d9af070bf3c5e89575ff796ec9e | [
"MIT"
] | null | null | null | #mostrando o mês
# Solicita a mês
mes = float(input('Qual o mês atual? '))
# Verifica se é Verão
verao = 1 <= mes <= 3
# Verifica se é Outono
outono = 4 <= mes <= 6
# Verifica se é Inverno
inverno = 7 <= mes <= 9
# Verifica se é Primavera
primavera = 10 <= mes <= 12
# Mostra qual a estação atual
print(f'Verão: {v... | 22.321429 | 88 | 0.6544 |
mes = float(input('Qual o mês atual? '))
verao = 1 <= mes <= 3
outono = 4 <= mes <= 6
inverno = 7 <= mes <= 9
primavera = 10 <= mes <= 12
print(f'Verão: {verao}\nOutono: {outono}\nInverno: {inverno}\nPrimavera: {primavera}\n')
n1 = int(input("Informe o primeiro número:"))
n2 = int(input("Informe o segundo númer... | true | true |
08f6c8f23ef0067f8f994941f5f0c84f4106e2cf | 14,323 | py | Python | nodeconductor/jira/backend.py | p-p-m/nodeconductor | bc702302ef65c89793452f0fd6ca9a6bec79782f | [
"Apache-2.0"
] | null | null | null | nodeconductor/jira/backend.py | p-p-m/nodeconductor | bc702302ef65c89793452f0fd6ca9a6bec79782f | [
"Apache-2.0"
] | null | null | null | nodeconductor/jira/backend.py | p-p-m/nodeconductor | bc702302ef65c89793452f0fd6ca9a6bec79782f | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import re
import random
import logging
import datetime
import threading
from jira import JIRA, JIRAError
from django.utils import six
from nodeconductor.structure import ServiceBackend, ServiceBackendError
now = lambda: datetime.datetime.now() - datetime.timedelta(minutes=r... | 35.540943 | 120 | 0.531732 | from __future__ import unicode_literals
import re
import random
import logging
import datetime
import threading
from jira import JIRA, JIRAError
from django.utils import six
from nodeconductor.structure import ServiceBackend, ServiceBackendError
now = lambda: datetime.datetime.now() - datetime.timedelta(minutes=r... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.