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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1792bc27a3745d3de669fe696a59aba2257255 | 48 | py | Python | descriptastorus/stores/__init__.py | sharmavaruns/descriptastorus | 7a3e457bc64e480e44f0ce624052da68d2a27bad | [
"BSD-3-Clause"
] | 118 | 2019-01-15T23:04:29.000Z | 2022-03-25T01:31:06.000Z | descriptastorus/stores/__init__.py | sharmavaruns/descriptastorus | 7a3e457bc64e480e44f0ce624052da68d2a27bad | [
"BSD-3-Clause"
] | 14 | 2019-02-15T17:15:46.000Z | 2022-03-10T14:18:56.000Z | descriptastorus/stores/__init__.py | sharmavaruns/descriptastorus | 7a3e457bc64e480e44f0ce624052da68d2a27bad | [
"BSD-3-Clause"
] | 40 | 2018-12-18T11:39:38.000Z | 2022-03-23T09:45:45.000Z | from . import kyotostore
from . import dbmstore
| 16 | 24 | 0.791667 | from . import kyotostore
from . import dbmstore
| true | true |
1c1793ce5c4a444cdaa6ed99b29b7cbfd48501de | 1,210 | py | Python | pytchat/exceptions.py | pedrohbtp/pytchat | 5b18536972a4cdfbe68aa0beb023c136d41fca16 | [
"MIT"
] | null | null | null | pytchat/exceptions.py | pedrohbtp/pytchat | 5b18536972a4cdfbe68aa0beb023c136d41fca16 | [
"MIT"
] | null | null | null | pytchat/exceptions.py | pedrohbtp/pytchat | 5b18536972a4cdfbe68aa0beb023c136d41fca16 | [
"MIT"
] | null | null | null | class ChatParseException(Exception):
'''
Base exception thrown by the parser
'''
pass
class ResponseContextError(ChatParseException):
'''
Thrown when chat data is invalid.
'''
pass
class NoContents(ChatParseException):
'''
Thrown when ContinuationContents is missing in JSON.
... | 17.042254 | 64 | 0.690083 | class ChatParseException(Exception):
pass
class ResponseContextError(ChatParseException):
pass
class NoContents(ChatParseException):
pass
class NoContinuation(ChatParseException):
pass
class IllegalFunctionCall(Exception):
pass
class InvalidVideoIdException(Exception):
pass
class Unk... | true | true |
1c179408a39c28521b1bc9cd80b34218e6a553e9 | 147 | py | Python | app/app/constants.py | pbvarga1/docker_opportunity | d2d1bfeed148dded0f85b4ed5085f5186f9b6056 | [
"MIT"
] | 1 | 2021-04-21T11:04:46.000Z | 2021-04-21T11:04:46.000Z | app/app/constants.py | pbvarga1/docker_opportunity | d2d1bfeed148dded0f85b4ed5085f5186f9b6056 | [
"MIT"
] | 21 | 2019-02-24T16:42:50.000Z | 2019-02-26T21:21:49.000Z | app/app/constants.py | pbvarga1/opportunity | d2d1bfeed148dded0f85b4ed5085f5186f9b6056 | [
"MIT"
] | null | null | null | import os
DOCKER_HOST = os.environ.get('DOCKER_IP', '192.168.99.100')
DSN = f'http://5ea6adf6dc9c428e8e4e33474c5d2fb6@{DOCKER_HOST}:9000/3'
| 24.5 | 70 | 0.727891 | import os
DOCKER_HOST = os.environ.get('DOCKER_IP', '192.168.99.100')
DSN = f'http://5ea6adf6dc9c428e8e4e33474c5d2fb6@{DOCKER_HOST}:9000/3'
| true | true |
1c1794bb6260c256ed5201be8d0b196c39aa375b | 204 | py | Python | docs_old/conf.py | synqs/labscript-qc | 156da2e0b478d1f3e6bae0864c738e0e7690e393 | [
"Unlicense"
] | 1 | 2022-01-30T04:33:52.000Z | 2022-01-30T04:33:52.000Z | docs_old/conf.py | synqs/labscript-qc | 156da2e0b478d1f3e6bae0864c738e0e7690e393 | [
"Unlicense"
] | null | null | null | docs_old/conf.py | synqs/labscript-qc | 156da2e0b478d1f3e6bae0864c738e0e7690e393 | [
"Unlicense"
] | 1 | 2021-03-01T08:41:05.000Z | 2021-03-01T08:41:05.000Z | from recommonmark.parser import CommonMarkParser
extensions = ['myst_parser']
source_parsers = {
'.md': CommonMarkParser,
}
source_suffix = ['.rst', '.md']
master_doc = 'index'
project = u'labscript-qc'
| 20.4 | 48 | 0.730392 | from recommonmark.parser import CommonMarkParser
extensions = ['myst_parser']
source_parsers = {
'.md': CommonMarkParser,
}
source_suffix = ['.rst', '.md']
master_doc = 'index'
project = u'labscript-qc'
| true | true |
1c17953348d942b2c0939705322fc189d9df02b7 | 756 | py | Python | common/jython_common/jython_file_io.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | 3 | 2015-05-12T16:44:27.000Z | 2021-02-09T00:39:24.000Z | common/jython_common/jython_file_io.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | common/jython_common/jython_file_io.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
#
# jython_common/jython_file_io.py
#
# May/27/2015
#
#
import sys
import string
#
# --------------------------------------------------------------------
def file_to_str_proc (file_in):
lines = []
try:
fp_in = open (file_in)
lines = fp_in.readlines ()
fp_in.close ()
except Exception... | 21 | 70 | 0.468254 | import sys
import string
def file_to_str_proc (file_in):
lines = []
try:
fp_in = open (file_in)
lines = fp_in.readlines ()
fp_in.close ()
except Exception as ee:
sys.stderr.write ("*** error *** file_to_str_proc ***\n")
sys.stderr.write (str (ee))
str_out = ""
for line in lines:
str_out += line
return... | true | true |
1c17955b11167ecbb867e02c7049875de94d6e1e | 23,045 | py | Python | test/functional/test_framework/mininode.py | blockchaintrainer/Gath3r | ae48e710f97a63a9f5bc0d57ad80fdeea38fcbd1 | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | blockchaintrainer/Gath3r | ae48e710f97a63a9f5bc0d57ad80fdeea38fcbd1 | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | blockchaintrainer/Gath3r | ae48e710f97a63a9f5bc0d57ad80fdeea38fcbd1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2019 The Gthpcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Gthpcoin P2... | 39.258944 | 182 | 0.645216 | import asyncio
from collections import defaultdict
from io import BytesIO
import logging
import struct
import sys
import threading
from test_framework.messages import (
CBlockHeader,
MIN_VERSION_SUPPORTED,
msg_addr,
msg_block,
MSG_BLOCK,
msg_blocktxn,
msg_cmpctblock,
msg_feefilter,
... | true | true |
1c17956e812c7900438df70e5b3753bf8f683842 | 3,652 | py | Python | pria_lifechem/analysis/prospective_screening_metric_names.py | chao1224/pria_lifechem | 1fd892505a45695c6197f8d711a8a37589cd7097 | [
"MIT"
] | 5 | 2018-05-14T10:15:13.000Z | 2021-03-15T17:18:10.000Z | pria_lifechem/analysis/prospective_screening_metric_names.py | chao1224/pria_lifechem | 1fd892505a45695c6197f8d711a8a37589cd7097 | [
"MIT"
] | 5 | 2018-05-05T21:04:11.000Z | 2019-06-24T22:05:35.000Z | pria_lifechem/analysis/prospective_screening_metric_names.py | chao1224/pria_lifechem | 1fd892505a45695c6197f8d711a8a37589cd7097 | [
"MIT"
] | 2 | 2019-10-18T23:42:27.000Z | 2020-07-08T19:46:14.000Z | from pria_lifechem.evaluation import *
from collections import OrderedDict
import matplotlib.pyplot as plt
metric_name_mapping = OrderedDict()
metric_name_mapping['roc_auc'] = {'function': roc_auc_single, 'argument': {}}
metric_name_mapping['bed_roc_auc'] = {'function': bedroc_auc_single, 'argument': {}}
metric_name_... | 44 | 117 | 0.634995 | from pria_lifechem.evaluation import *
from collections import OrderedDict
import matplotlib.pyplot as plt
metric_name_mapping = OrderedDict()
metric_name_mapping['roc_auc'] = {'function': roc_auc_single, 'argument': {}}
metric_name_mapping['bed_roc_auc'] = {'function': bedroc_auc_single, 'argument': {}}
metric_name_... | false | true |
1c179652c46e5a2601967afc89932fc51330822e | 3,874 | py | Python | src/pykml/parser.py | spark706/pykml | 5a4b8cf8f26b73dbb942dc052feda6fd6be511e8 | [
"BSD-3-Clause"
] | 3 | 2015-07-22T11:11:42.000Z | 2019-03-15T19:13:27.000Z | src/pykml/parser.py | spark706/pykml | 5a4b8cf8f26b73dbb942dc052feda6fd6be511e8 | [
"BSD-3-Clause"
] | 6 | 2015-05-02T07:50:55.000Z | 2021-03-07T22:33:38.000Z | src/pykml/parser.py | spark706/pykml | 5a4b8cf8f26b73dbb942dc052feda6fd6be511e8 | [
"BSD-3-Clause"
] | 17 | 2015-06-13T20:21:25.000Z | 2020-11-04T01:44:26.000Z | '''pyKML Parser Module
The pykml.parser module provides functions that can be used to parse KML
from a file or remote URL.
'''
import sys
import os
import urllib2
from lxml import etree, objectify
OGCKML_SCHEMA = 'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd'
class Schema():
"A class representing an XML Sc... | 30.746032 | 94 | 0.641972 | import sys
import os
import urllib2
from lxml import etree, objectify
OGCKML_SCHEMA = 'http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd'
class Schema():
def __init__(self, schema):
try:
module_dir = os.path.split(__file__)[0] schema_file = os.path.join(module_dir, "schemas", sch... | true | true |
1c1796d633b2e8cb44ea7e79cd8f347880648d41 | 1,671 | py | Python | oscarapi/views/admin/order.py | laevilgenius/django-oscar-api | 57f796130c0cae9841c2d6e19ff82108f462c76d | [
"BSD-3-Clause"
] | 3 | 2020-03-30T13:11:57.000Z | 2020-04-22T13:55:31.000Z | oscarapi/views/admin/order.py | laevilgenius/django-oscar-api | 57f796130c0cae9841c2d6e19ff82108f462c76d | [
"BSD-3-Clause"
] | 9 | 2020-10-29T08:03:28.000Z | 2021-09-08T01:21:10.000Z | venv/lib/python3.6/site-packages/oscarapi/views/admin/order.py | WahajJaved/Hamzar | 3dfec7c3ceca5b60ff46f8ad25ac417ba6463b86 | [
"Apache-2.0"
] | 2 | 2021-01-06T19:25:07.000Z | 2021-05-14T02:00:19.000Z | # pylint: disable=unbalanced-tuple-unpacking
from rest_framework import generics
from oscar.core.loading import get_model
from oscarapi.utils.loading import get_api_classes, get_api_class
APIAdminPermission = get_api_class("permissions", "APIAdminPermission")
Order = get_model("order", "Order")
OrderLine = get_model... | 32.764706 | 108 | 0.79234 | from rest_framework import generics
from oscar.core.loading import get_model
from oscarapi.utils.loading import get_api_classes, get_api_class
APIAdminPermission = get_api_class("permissions", "APIAdminPermission")
Order = get_model("order", "Order")
OrderLine = get_model("order", "Line")
OrderLineAttribute = get_mo... | true | true |
1c179753d0b4d09787bc238d75a5af5ba6cb440f | 337 | py | Python | molly/apps/weather/__init__.py | mollyproject/mollyproject | 3247c6bac3f39ce8d275d19aa410b30c6284b8a7 | [
"Apache-2.0"
] | 7 | 2015-05-16T13:27:21.000Z | 2019-08-06T11:09:24.000Z | molly/apps/weather/__init__.py | mollyproject/mollyproject | 3247c6bac3f39ce8d275d19aa410b30c6284b8a7 | [
"Apache-2.0"
] | null | null | null | molly/apps/weather/__init__.py | mollyproject/mollyproject | 3247c6bac3f39ce8d275d19aa410b30c6284b8a7 | [
"Apache-2.0"
] | 4 | 2015-11-27T13:36:36.000Z | 2021-03-09T17:55:53.000Z | """
Weather application
* Grabs weather from defined providers
* Stores a single (latest) observation
* Stores historical forecast data (not well defined)
* Can only handle ONE provider at once.
The application could do with being reengineered. Especially for more
real time data sources. The current object model is a ... | 30.636364 | 69 | 0.783383 | true | true | |
1c17979eab8fc3cd8f7a118a2512ec4f2ee33acd | 37,852 | py | Python | tests/integration/datadict/submission/test_upload.py | plooploops/sheepdog | 803f4ad22f266df360fed582520d3b607cad605a | [
"Apache-2.0"
] | null | null | null | tests/integration/datadict/submission/test_upload.py | plooploops/sheepdog | 803f4ad22f266df360fed582520d3b607cad605a | [
"Apache-2.0"
] | null | null | null | tests/integration/datadict/submission/test_upload.py | plooploops/sheepdog | 803f4ad22f266df360fed582520d3b607cad605a | [
"Apache-2.0"
] | null | null | null | """
Test upload entities (mostly data file handling and communication with
index service).
"""
import csv
import json
import copy
import os
import random
from .test_endpoints import put_cgci_blgsp
from .utils import assert_positive_response
from .utils import assert_negative_response
from .utils import assert_single_... | 31.595993 | 92 | 0.723634 | import csv
import json
import copy
import os
import random
from .test_endpoints import put_cgci_blgsp
from .utils import assert_positive_response
from .utils import assert_negative_response
from .utils import assert_single_entity_from_response
try:
from unittest.mock import MagicMock
from unittest.mock impor... | true | true |
1c1797aa8f45c1267302cd7d1355309c7cf5ea0b | 3,612 | py | Python | python/Day7/test.py | Mr-Hunter/Linux | dc222abe4e961a65282d7bc8ac6a301657386ddc | [
"Apache-2.0"
] | 2 | 2018-10-30T08:06:57.000Z | 2019-12-12T03:05:58.000Z | python/Day7/test.py | Mr-Hunter/Linux | dc222abe4e961a65282d7bc8ac6a301657386ddc | [
"Apache-2.0"
] | null | null | null | python/Day7/test.py | Mr-Hunter/Linux | dc222abe4e961a65282d7bc8ac6a301657386ddc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#coding:utf-8
'''
面向对象编程
'''
'''
面向过程就是编年史:按照时间先后顺序,一条一条的记录发生的事情
面向对象就是记传史:按照每个王侯将相的维度,记录这个人是谁,有哪些特点,做过哪些事情
所以史记就是中国古代非常成功的一个 应用oop思想的著作
oop思想就是指解决一类问题时,使用一定的方法手段,一套组合拳,
'''
#这套拳的招式:
#抽象:
'''
抽象就是对现实世界问题和实体的本质行为,表现,特征进行建模
抽象的反义词就是具体
抽象的本质就是抓住重点关注的实体,忽略一些不需要关心的细节
写程序也四一样,我们不可能吧一个现实事物所有的信息都用程序表现出来,而只... | 17.282297 | 87 | 0.66722 |
'''
面向对象编程
'''
'''
面向过程就是编年史:按照时间先后顺序,一条一条的记录发生的事情
面向对象就是记传史:按照每个王侯将相的维度,记录这个人是谁,有哪些特点,做过哪些事情
所以史记就是中国古代非常成功的一个 应用oop思想的著作
oop思想就是指解决一类问题时,使用一定的方法手段,一套组合拳,
'''
'''
抽象就是对现实世界问题和实体的本质行为,表现,特征进行建模
抽象的反义词就是具体
抽象的本质就是抓住重点关注的实体,忽略一些不需要关心的细节
写程序也四一样,我们不可能吧一个现实事物所有的信息都用程序表现出来,而只是表示我们需要用到的一些信息
'''
'''
类就是施工图纸,里面有房子重要的信心(户型,... | false | true |
1c17980749ac790b001f87112dc2cca1aad64bbe | 1,421 | py | Python | c7n/config.py | kaskrish/cloud-custodian | 97fd1048d866657c0e85816eaeff55018c336fe8 | [
"Apache-2.0"
] | 1 | 2018-06-27T14:51:12.000Z | 2018-06-27T14:51:12.000Z | c7n/config.py | kaskrish/cloud-custodian | 97fd1048d866657c0e85816eaeff55018c336fe8 | [
"Apache-2.0"
] | 2 | 2018-05-08T23:39:01.000Z | 2018-05-14T16:53:43.000Z | c7n/config.py | kaskrish/cloud-custodian | 97fd1048d866657c0e85816eaeff55018c336fe8 | [
"Apache-2.0"
] | 2 | 2019-11-22T14:54:28.000Z | 2021-06-18T13:49:15.000Z | # Copyright 2015-2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 29 | 82 | 0.630542 | from __future__ import absolute_import, division, print_function, unicode_literals
import os
import logging
log = logging.getLogger('custodian.config')
class Bag(dict):
def __getattr__(self, k):
try:
return self[k]
except KeyError:
raise AttributeError(k)
class Config(B... | true | true |
1c1798921fb99d643343991fb37222e189c1ad97 | 6,217 | py | Python | train.py | loveprolife/srcnn-tensorflow2 | 163c90b33af22b460173376d27a1714025056de7 | [
"Apache-2.0"
] | null | null | null | train.py | loveprolife/srcnn-tensorflow2 | 163c90b33af22b460173376d27a1714025056de7 | [
"Apache-2.0"
] | null | null | null | train.py | loveprolife/srcnn-tensorflow2 | 163c90b33af22b460173376d27a1714025056de7 | [
"Apache-2.0"
] | null | null | null |
from utils import (
read_data,
input_setup,
imsave,
merge,
get_last_weights
)
import numpy as np
import datetime
import tensorflow as tf
import time
import pprint
import os
import argparse
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint
import matplotlib.pyplot as plt
... | 46.051852 | 195 | 0.66479 |
from utils import (
read_data,
input_setup,
imsave,
merge,
get_last_weights
)
import numpy as np
import datetime
import tensorflow as tf
import time
import pprint
import os
import argparse
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint
import matplotlib.pyplot as plt
... | true | true |
1c1799af09f40c7e528d35ae4be7f8e5c8a69632 | 3,981 | py | Python | rpi-camera-udp-stream-client.py | robot-uprising-hq/artificial-invaders-ai-video-streamer | 7b4fcdd48c39e9e0bcea0466c4ca95bc920773e6 | [
"MIT"
] | 1 | 2021-06-24T04:57:01.000Z | 2021-06-24T04:57:01.000Z | rpi-camera-udp-stream-client.py | robot-uprising-hq/artificial-invaders-ai-video-streamer | 7b4fcdd48c39e9e0bcea0466c4ca95bc920773e6 | [
"MIT"
] | null | null | null | rpi-camera-udp-stream-client.py | robot-uprising-hq/artificial-invaders-ai-video-streamer | 7b4fcdd48c39e9e0bcea0466c4ca95bc920773e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import cv2
import gi
import numpy as np
gi.require_version('Gst', '1.0')
from gi.repository import Gst
# Original source https://gist.github.com/patrickelectric/443645bb0fd6e71b34c504d20d475d5a
class Video():
"""BlueRov video capture class constructor
Attributes:
port (int): Vid... | 28.640288 | 103 | 0.558402 |
import cv2
import gi
import numpy as np
gi.require_version('Gst', '1.0')
from gi.repository import Gst
class Video():
def __init__(self, port=5200):
Gst.init(None)
self.port = port
self._frame = None
self.video_source = 'udpsrc port={}'.format(self.port)
self.video_cod... | true | true |
1c1799f00a6922dad380dbe4d491f94b46eda97b | 1,430 | py | Python | app/main.py | biancarosa/todo-list | 9602c14b1f5d60b6010921b4918131d495b9ba69 | [
"MIT"
] | 1 | 2022-02-21T14:17:21.000Z | 2022-02-21T14:17:21.000Z | app/main.py | biancarosa/todo-list | 9602c14b1f5d60b6010921b4918131d495b9ba69 | [
"MIT"
] | 1 | 2022-02-21T13:34:49.000Z | 2022-02-21T13:34:49.000Z | app/main.py | biancarosa/todo-list | 9602c14b1f5d60b6010921b4918131d495b9ba69 | [
"MIT"
] | null | null | null | """app.main
Module that starts the Flask application
"""
import os
import logging
import newrelic.agent
from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
from app.logger import init_logger
def populate_db():
from app.tasks import models, repository
tasks_repository = repository.TaskRe... | 25.535714 | 91 | 0.770629 | import os
import logging
import newrelic.agent
from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
from app.logger import init_logger
def populate_db():
from app.tasks import models, repository
tasks_repository = repository.TaskRepository()
for i in range(0,15000):
task = mod... | true | true |
1c179a3bb717c6668b4b2e4c5593b4763a6f378a | 1,991 | py | Python | bcentral/client.py | buenavistacapital/bcentral | 2df44d64ab4c37b7974a59f9169620cd52e13e2f | [
"MIT"
] | null | null | null | bcentral/client.py | buenavistacapital/bcentral | 2df44d64ab4c37b7974a59f9169620cd52e13e2f | [
"MIT"
] | null | null | null | bcentral/client.py | buenavistacapital/bcentral | 2df44d64ab4c37b7974a59f9169620cd52e13e2f | [
"MIT"
] | null | null | null | import logging
from datetime import datetime, date
from typing import Dict
import requests
logger = logging.getLogger(__name__)
class BancoCentralSeries:
def __init__(self, response):
data = response.json()
if data['Codigo'] != 0:
logger.warning(f'API returned an error code: {data["... | 36.2 | 90 | 0.595681 | import logging
from datetime import datetime, date
from typing import Dict
import requests
logger = logging.getLogger(__name__)
class BancoCentralSeries:
def __init__(self, response):
data = response.json()
if data['Codigo'] != 0:
logger.warning(f'API returned an error code: {data["... | true | true |
1c179c09d3001af58cd101ce5aff852951ab1050 | 9,836 | py | Python | src/compas/utilities/itertools.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | 2 | 2021-03-17T18:14:22.000Z | 2021-09-19T13:50:02.000Z | src/compas/utilities/itertools.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | src/compas/utilities/itertools.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | # recipes with itertools
# see: https://docs.python.org/3.6/library/itertools.html
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from itertools import islice
from itertools import chain
from itertools import repeat
from itertools import tee
try:
from ... | 25.481865 | 111 | 0.575844 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from itertools import islice
from itertools import chain
from itertools import repeat
from itertools import tee
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_lon... | true | true |
1c179c8707656cbb4977cba3f7087547de64c7b0 | 2,595 | py | Python | mini-led-sign.py | arobodude/rpi_led_sign | 338e3a67797e658865d19fe53c6303fa96f89443 | [
"MIT"
] | 2 | 2021-06-20T23:16:30.000Z | 2021-11-19T16:58:21.000Z | mini-led-sign.py | arobodude/rpi_led_sign | 338e3a67797e658865d19fe53c6303fa96f89443 | [
"MIT"
] | null | null | null | mini-led-sign.py | arobodude/rpi_led_sign | 338e3a67797e658865d19fe53c6303fa96f89443 | [
"MIT"
] | 1 | 2021-11-19T16:58:28.000Z | 2021-11-19T16:58:28.000Z | # Code for Alpha Protocol-based LED Signs
# http://www.alpha-american.com/alpha-manuals/M-Protocol.pdf
# Assuming Python is installed run:
# sudo apt-get install python-serial
# sudo apt-get install python-pycurl
# To set up cron so it runs the script at startup:
# http://www.instructables.com/id/Raspberry-Pi-Launch-... | 38.731343 | 121 | 0.689017 |
import serial, pycurl, time, json
ser = serial.Serial('/dev/ttyUSB0', 9600, bytesize=7, parity='E', stopbits=1, timeout=1)
def led_init_hex():
ser.write(chr(0x00)+chr(0x00)+chr(0x00)+chr(0x00)+chr(0x00)+chr(0x01)+chr(0x5A)+chr(0x30)+chr(0x30)+chr(0x02))
def led_escape_hex():
ser.write(chr(0x04))
... | true | true |
1c179d117d4261b86dc294cf38a217ff38ba99c8 | 511 | py | Python | carpenpi/urls.py | weecology/web-free-data-science | bcb2500f3d745dd20f8d3bc1ee2c5d851c01153c | [
"MIT"
] | 4 | 2020-10-21T07:13:14.000Z | 2021-05-26T22:06:46.000Z | carpenpi/urls.py | CarpenPi/web-free-data-science | bcb2500f3d745dd20f8d3bc1ee2c5d851c01153c | [
"MIT"
] | 11 | 2021-06-09T13:36:01.000Z | 2021-12-04T17:41:55.000Z | carpenpi/urls.py | weecology/web-free-data-science | bcb2500f3d745dd20f8d3bc1ee2c5d851c01153c | [
"MIT"
] | 1 | 2021-05-25T15:05:19.000Z | 2021-05-25T15:05:19.000Z | #URLs
url = 'https://cran.r-project.org/bin/windows/base/R-4.1.1-win.exe'
urlgen='https://cran.r-project.org/bin/windows/base/release.html'
url2 = 'https://cran.r-project.org/bin/macosx/base/R-4.1.1.pkg'
url3 = 'https://download1.rstudio.org/desktop/windows/RStudio-1.4.1106.exe'
url4 = 'https://download1.rstudio.org/de... | 51.1 | 75 | 0.733855 | url = 'https://cran.r-project.org/bin/windows/base/R-4.1.1-win.exe'
urlgen='https://cran.r-project.org/bin/windows/base/release.html'
url2 = 'https://cran.r-project.org/bin/macosx/base/R-4.1.1.pkg'
url3 = 'https://download1.rstudio.org/desktop/windows/RStudio-1.4.1106.exe'
url4 = 'https://download1.rstudio.org/desktop/... | true | true |
1c179e832af47ac73c031de8bf3d49c66d87c635 | 8,043 | py | Python | Files/fanning_counter.py | obrienam/BeeFanningDetector | 51a8d7d036d58398d997dcebb7fb495040a0539d | [
"MIT"
] | 3 | 2020-01-01T17:42:24.000Z | 2020-05-28T15:30:33.000Z | Files/fanning_counter.py | obrienam/BeeFanningDetector | 51a8d7d036d58398d997dcebb7fb495040a0539d | [
"MIT"
] | 2 | 2020-01-21T06:18:10.000Z | 2020-04-20T22:51:15.000Z | Files/fanning_counter.py | obrienam/BeeFanningDetector | 51a8d7d036d58398d997dcebb7fb495040a0539d | [
"MIT"
] | 1 | 2020-01-20T05:57:40.000Z | 2020-01-20T05:57:40.000Z | import cv2
import numpy as np
from collections import defaultdict
'''
Variables that are important for
this program.
'''
times=0
numfan=0
#Video stream used for processing
vs=cv2.VideoCapture("/Users/aidanobrien/Documents/GitHub.nosync/BeeFanningDetector/Assets/test_img&videos/test_vid4.mp4")
#Background image used f... | 36.067265 | 214 | 0.554395 | import cv2
import numpy as np
from collections import defaultdict
times=0
numfan=0
vs=cv2.VideoCapture("/Users/aidanobrien/Documents/GitHub.nosync/BeeFanningDetector/Assets/test_img&videos/test_vid4.mp4")
bk=cv2.imread('/Users/aidanobrien/Documents/GitHub.nosync/BeeFanningDetector/Assets/test_img&videos/testbkgrd1.jp... | true | true |
1c179eb741a3028b593dddbd149901f66d983c0d | 14,466 | py | Python | tests/test_session.py | DoubleCai/django-redis | 925cfcd3f7ed2ba491b3474023794d9426c69cbc | [
"BSD-3-Clause"
] | 727 | 2020-02-22T16:27:23.000Z | 2022-03-31T13:30:20.000Z | tests/test_session.py | DoubleCai/django-redis | 925cfcd3f7ed2ba491b3474023794d9426c69cbc | [
"BSD-3-Clause"
] | 172 | 2020-02-22T10:41:48.000Z | 2022-03-30T15:13:53.000Z | tests/test_session.py | DoubleCai/django-redis | 925cfcd3f7ed2ba491b3474023794d9426c69cbc | [
"BSD-3-Clause"
] | 104 | 2020-02-26T15:33:55.000Z | 2022-03-06T05:01:33.000Z | import base64
import unittest
from datetime import timedelta
from typing import Optional, Type
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.core.cache import DEFAULT_CACHE_ALIAS... | 38.679144 | 87 | 0.663694 | import base64
import unittest
from datetime import timedelta
from typing import Optional, Type
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.core.cache import DEFAULT_CACHE_ALIAS... | true | true |
1c179ed55b9c3c9137aa93efa0494ec56b0fdf9f | 210 | py | Python | qleader/models/optimizers.py | blakaut/WebMark2 | 50f29b46a7813ae9ac6baad6531163b65fc3377e | [
"MIT"
] | null | null | null | qleader/models/optimizers.py | blakaut/WebMark2 | 50f29b46a7813ae9ac6baad6531163b65fc3377e | [
"MIT"
] | null | null | null | qleader/models/optimizers.py | blakaut/WebMark2 | 50f29b46a7813ae9ac6baad6531163b65fc3377e | [
"MIT"
] | 1 | 2021-07-27T05:41:34.000Z | 2021-07-27T05:41:34.000Z | scipy_optimizers = ["NELDER-MEAD", "BFGS", "L-BFGS-B", "COBYLA"]
gradient_optimizers = [
"ADAM", "ADAGRAD", "ADAMAX", "NADAM", "SGD", "MOMENTUM",
"NESTEROV", "RMSPROP", "RMSPROP-NESTEROV", "SPSA"
]
| 35 | 64 | 0.609524 | scipy_optimizers = ["NELDER-MEAD", "BFGS", "L-BFGS-B", "COBYLA"]
gradient_optimizers = [
"ADAM", "ADAGRAD", "ADAMAX", "NADAM", "SGD", "MOMENTUM",
"NESTEROV", "RMSPROP", "RMSPROP-NESTEROV", "SPSA"
]
| true | true |
1c179ef55571334825b548471862b64779508260 | 2,820 | py | Python | test/color/test_normalize.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | 1 | 2019-11-21T13:18:56.000Z | 2019-11-21T13:18:56.000Z | test/color/test_normalize.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | null | null | null | test/color/test_normalize.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | null | null | null | import pytest
import kornia
import kornia.testing as utils # test utils
from test.common import device_type
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
class TestNormalize:
def test_smoke(self):
mean = [0.5]
std = [0.1]
repr = "Normalize(m... | 27.647059 | 97 | 0.575177 | import pytest
import kornia
import kornia.testing as utils from test.common import device_type
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
class TestNormalize:
def test_smoke(self):
mean = [0.5]
std = [0.1]
repr = "Normalize(mean=[0.5], st... | true | true |
1c179fe690192465d741d5c0507a4e331d1fe247 | 1,047 | py | Python | part_1_Basics/04_error_handling/main.py | felixdittrich92/fastapi_parts | cce39b619a217bb5cad675bbde73942f9ec30a27 | [
"Apache-2.0"
] | 2 | 2021-05-19T06:36:34.000Z | 2022-03-02T07:16:40.000Z | part_1_Basics/04_error_handling/main.py | felixdittrich92/fastapi_parts | cce39b619a217bb5cad675bbde73942f9ec30a27 | [
"Apache-2.0"
] | null | null | null | part_1_Basics/04_error_handling/main.py | felixdittrich92/fastapi_parts | cce39b619a217bb5cad675bbde73942f9ec30a27 | [
"Apache-2.0"
] | null | null | null | import json
from pathlib import Path
import fastapi
import uvicorn
from starlette.staticfiles import StaticFiles
from api import weather_api
from services import openweather_service
from views import home
api = fastapi.FastAPI()
def configure():
configure_routing()
configure_api_keys()
def configure_api_... | 24.928571 | 111 | 0.723018 | import json
from pathlib import Path
import fastapi
import uvicorn
from starlette.staticfiles import StaticFiles
from api import weather_api
from services import openweather_service
from views import home
api = fastapi.FastAPI()
def configure():
configure_routing()
configure_api_keys()
def configure_api_... | true | true |
1c17a0cf11f7dc16e9b8d3b1c6a45d432664356c | 1,277 | py | Python | storm_kit/mpc/rollout/__init__.py | maxspahn/storm | cf056514659cab9c5c7ac9d850eae7c56a660726 | [
"MIT"
] | 68 | 2021-04-27T21:10:11.000Z | 2022-03-23T23:13:45.000Z | storm_kit/mpc/rollout/__init__.py | Lin0611/storm | cf056514659cab9c5c7ac9d850eae7c56a660726 | [
"MIT"
] | 3 | 2021-07-06T11:04:32.000Z | 2022-01-13T07:57:43.000Z | storm_kit/mpc/rollout/__init__.py | Lin0611/storm | cf056514659cab9c5c7ac9d850eae7c56a660726 | [
"MIT"
] | 16 | 2021-04-28T02:50:45.000Z | 2022-01-13T13:35:43.000Z | #
# MIT License
#
# Copyright (c) 2020-2021 NVIDIA CORPORATION.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 49.115385 | 145 | 0.777604 | true | true | |
1c17a10d685d1154337daeeaf918711642334c55 | 5,638 | py | Python | py_wake/rotor_avg_models/rotor_avg_model.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | 30 | 2019-03-18T14:10:27.000Z | 2022-03-13T17:39:04.000Z | py_wake/rotor_avg_models/rotor_avg_model.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | 1 | 2020-11-12T06:13:00.000Z | 2020-11-12T06:43:26.000Z | py_wake/rotor_avg_models/rotor_avg_model.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | 20 | 2019-01-11T14:45:13.000Z | 2021-12-13T19:55:29.000Z | import numpy as np
from numpy import newaxis as na
class RotorAvgModel():
"""Wrap a DeficitModel.
The RotorAvgModel
- add an extra dimension (one or more points covering the downstream rotors)
- Call the wrapped DeficitModel to calculate the deficit at all points
- Compute a (weighted) mean of the... | 39.985816 | 111 | 0.569351 | import numpy as np
from numpy import newaxis as na
class RotorAvgModel():
args4rotor_avg_deficit = ['hcw_ijlk', 'dh_ijlk', 'D_dst_ijl']
def __init__(self):
pass
def calc_deficit_convection(self, deficitModel, D_dst_ijl, **kwargs):
self.deficitModel = deficitModel
return self.defi... | true | true |
1c17a1909222ff7988a8e78bbe25bff422be4284 | 2,523 | py | Python | restaurant.py | ronituohino/tsoha-ravintolasovellus | dfbfd91ec0ec379c8ae80495f4167b54505a6e6f | [
"MIT"
] | null | null | null | restaurant.py | ronituohino/tsoha-ravintolasovellus | dfbfd91ec0ec379c8ae80495f4167b54505a6e6f | [
"MIT"
] | 1 | 2022-03-16T13:28:42.000Z | 2022-03-16T15:15:22.000Z | restaurant.py | ronituohino/tsoha-ravintolasovellus | dfbfd91ec0ec379c8ae80495f4167b54505a6e6f | [
"MIT"
] | null | null | null | from db import db # type: ignore
from const import months
def get_restaurant_by_id(id):
sql = """SELECT id, name, description, address, phone, average_rating
FROM restaurants WHERE id=:id"""
result = db.session.execute(sql, {"id": id})
restaurant = result.fetchone()
return restaurant
d... | 33.64 | 148 | 0.644867 | from db import db from const import months
def get_restaurant_by_id(id):
sql = """SELECT id, name, description, address, phone, average_rating
FROM restaurants WHERE id=:id"""
result = db.session.execute(sql, {"id": id})
restaurant = result.fetchone()
return restaurant
def get_restaura... | true | true |
1c17a1b2bf3de78048781198feb576e388c4c3ae | 9,058 | py | Python | orangecontrib/wanys/widgets/source/OpticalElementSourceGaussianWidget.py | srio/wanys | f62b8a36ee534770810cd63a9b84719dcdd617ea | [
"MIT"
] | null | null | null | orangecontrib/wanys/widgets/source/OpticalElementSourceGaussianWidget.py | srio/wanys | f62b8a36ee534770810cd63a9b84719dcdd617ea | [
"MIT"
] | 2 | 2016-11-04T15:10:30.000Z | 2016-11-04T15:15:59.000Z | orangecontrib/wanys/widgets/source/OpticalElementSourceGaussianWidget.py | srio/wanys | f62b8a36ee534770810cd63a9b84719dcdd617ea | [
"MIT"
] | null | null | null | """
<name>Gaussian source</name>
<description>A Gaussian source</description>
<icon>icons/gaussian.svg</icon>
<priority>100</priority>
"""
import sys
from PyQt4.Qt import *
from orangewidget import gui
from orangewidget.settings import Setting
from oasys.widgets import widget
from orangecontrib.wanys.util.OpticalEle... | 40.257778 | 97 | 0.503422 | import sys
from PyQt4.Qt import *
from orangewidget import gui
from orangewidget.settings import Setting
from oasys.widgets import widget
from orangecontrib.wanys.util.OpticalElement import OpticalElement
from orangecontrib.wanys.util.OpticalBeam import OpticalBeam
from orangecontrib.wanys.util.Polarization import P... | true | true |
1c17a1dac9160b1fdba55fc90b5a5c0bc7e96004 | 79 | py | Python | apps/patrimonio/apps/combustivel/apps/km/apps.py | mequetrefe-do-subtroco/web_constel | 57b5626fb17b4fefc740cbe1ac95fd4ab90147bc | [
"MIT"
] | 1 | 2020-06-18T09:03:53.000Z | 2020-06-18T09:03:53.000Z | apps/patrimonio/apps/combustivel/apps/km/apps.py | gabrielhjs/web_constel | 57b5626fb17b4fefc740cbe1ac95fd4ab90147bc | [
"MIT"
] | 33 | 2020-06-16T18:59:33.000Z | 2021-08-12T21:33:17.000Z | apps/patrimonio/apps/combustivel/apps/km/apps.py | gabrielhjs/web_constel | 57b5626fb17b4fefc740cbe1ac95fd4ab90147bc | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class KmConfig(AppConfig):
name = 'km'
| 13.166667 | 33 | 0.721519 | from django.apps import AppConfig
class KmConfig(AppConfig):
name = 'km'
| true | true |
1c17a288ee42144ff967cd9cce7cf0978bec27fd | 154 | py | Python | Lesson4/ActivityA/sum.py | cedrickadi/Beginning-Jenkins | f4c4d23031ac82d729e4773e51c83dd69b0dd0d4 | [
"MIT"
] | 9 | 2019-04-30T18:08:55.000Z | 2022-01-24T22:43:03.000Z | Lesson4/ActivityA/sum.py | cedrickadi/Beginning-Jenkins | f4c4d23031ac82d729e4773e51c83dd69b0dd0d4 | [
"MIT"
] | 1 | 2021-03-20T05:48:31.000Z | 2021-03-20T05:48:31.000Z | Lesson4/ActivityA/sum.py | cedrickadi/Beginning-Jenkins | f4c4d23031ac82d729e4773e51c83dd69b0dd0d4 | [
"MIT"
] | 148 | 2018-10-07T20:00:42.000Z | 2022-03-14T08:09:45.000Z | def add_numbers(number1, number2):
return number1 + number2
def add_three_numbers(number1, number2, number3):
return number1 + number2 + number3
| 25.666667 | 49 | 0.753247 | def add_numbers(number1, number2):
return number1 + number2
def add_three_numbers(number1, number2, number3):
return number1 + number2 + number3
| true | true |
1c17a2d616508a7d3db86dd6c33454899ae576e2 | 145 | py | Python | ui_automation_core/helpers/actions/__init__.py | Harshavardhanchowdary/python-ui-testing-automation | a624c6b945276c05722be2919d95aa9e5539d0d0 | [
"MIT"
] | null | null | null | ui_automation_core/helpers/actions/__init__.py | Harshavardhanchowdary/python-ui-testing-automation | a624c6b945276c05722be2919d95aa9e5539d0d0 | [
"MIT"
] | null | null | null | ui_automation_core/helpers/actions/__init__.py | Harshavardhanchowdary/python-ui-testing-automation | a624c6b945276c05722be2919d95aa9e5539d0d0 | [
"MIT"
] | null | null | null |
# Name : __init__.py.py
# Author : Write your own name
# Contect : Email address
# Time : 06/12/2020 6:46 pm
# Desc: Write short description
| 20.714286 | 31 | 0.682759 | true | true | |
1c17a4ee3b9e47412e57b14418a9fdca799cf5e6 | 1,361 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/test/test_nis.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/test/test_nis.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/test/test_nis.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | from test import support
import unittest
import nis
raise support.TestSkipped("test_nis hangs on Solaris")
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error as msg:
# NIS is probably not active, so this test isn't useful
... | 29.586957 | 88 | 0.512123 | from test import support
import unittest
import nis
raise support.TestSkipped("test_nis hangs on Solaris")
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error as msg:
if support.verbose:
print("Test Ski... | true | true |
1c17a61da184e70f863fccbcf89d9117d75516ac | 3,021 | py | Python | beanie/models/journal_item_input.py | altoyield/python-beanieclient | 448b8dd328054eaf32dd7d0bdff700e603b5c27d | [
"Apache-2.0"
] | null | null | null | beanie/models/journal_item_input.py | altoyield/python-beanieclient | 448b8dd328054eaf32dd7d0bdff700e603b5c27d | [
"Apache-2.0"
] | null | null | null | beanie/models/journal_item_input.py | altoyield/python-beanieclient | 448b8dd328054eaf32dd7d0bdff700e603b5c27d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Beanie ERP API
An API specification for interacting with the Beanie ERP system # noqa: E501
OpenAPI spec version: 0.8
Contact: dev@bean.ie
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from beanie.mod... | 26.043103 | 88 | 0.550811 |
import pprint
import re
import six
from beanie.models.journal_item import JournalItem
class JournalItemInput(object):
swagger_types = {
'id': 'int'
}
attribute_map = {
'id': 'id'
}
def __init__(self, id=None):
self._id = None
self.discriminator = None
... | true | true |
1c17a631cf49111df760d38b681f873d94258c76 | 12,078 | py | Python | Source/JavaScriptCore/inspector/scripts/codegen/generator.py | ijsf/DeniseEmbeddableWebKit | 57dfc6783d60f8f59b7129874e60f84d8c8556c9 | [
"BSD-3-Clause"
] | null | null | null | Source/JavaScriptCore/inspector/scripts/codegen/generator.py | ijsf/DeniseEmbeddableWebKit | 57dfc6783d60f8f59b7129874e60f84d8c8556c9 | [
"BSD-3-Clause"
] | 9 | 2020-04-18T18:47:18.000Z | 2020-04-18T18:52:41.000Z | Source/JavaScriptCore/inspector/scripts/codegen/generator.py | ijsf/DeniseEmbeddableWebKit | 57dfc6783d60f8f59b7129874e60f84d8c8556c9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2014 Apple Inc. All rights reserved.
# Copyright (c) 2014 University of Washington. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of ... | 42.083624 | 145 | 0.703345 |
import logging
import os.path
import re
from string import Template
from generator_templates import GeneratorTemplates as Templates
from models import PrimitiveType, ObjectType, ArrayType, EnumType, AliasedType, Frameworks, Platforms
log = logging.getLogger('global')
def ucfirst(str):
return str[:1].upper() + ... | true | true |
1c17a67b20987df92607475f522ca65d107acc10 | 5,771 | py | Python | URL_DATA.py | willwearing/web-scraper | 8203fd8393f35142d65f81120586dfac8852c07c | [
"MIT"
] | null | null | null | URL_DATA.py | willwearing/web-scraper | 8203fd8393f35142d65f81120586dfac8852c07c | [
"MIT"
] | null | null | null | URL_DATA.py | willwearing/web-scraper | 8203fd8393f35142d65f81120586dfac8852c07c | [
"MIT"
] | null | null | null | urls=["https://enjoy.com",
"https://trunkrs.nl",
"https://nationex.com",
"https://joeyco.com",
"https://sayweee.com",
"https://concise.io",
"https://aegea.com.br",
"https://homecityice.com",
"https://1stchoicedelivery.com",
"https://tradedepot.co",
"https://sherpa.net.au",
"https://roundtrip.ai",
"https://jul.co.il",
"... | 26.472477 | 39 | 0.690175 | urls=["https://enjoy.com",
"https://trunkrs.nl",
"https://nationex.com",
"https://joeyco.com",
"https://sayweee.com",
"https://concise.io",
"https://aegea.com.br",
"https://homecityice.com",
"https://1stchoicedelivery.com",
"https://tradedepot.co",
"https://sherpa.net.au",
"https://roundtrip.ai",
"https://jul.co.il",
"... | true | true |
1c17a701408340a5d08121a5dd02033626900f84 | 9,173 | py | Python | webapps/fruitynutters/cart/models.py | brew/fruitynutters | cfdd1fb41655e291419a4c566f9ed9fe425c260a | [
"MIT"
] | 1 | 2020-07-24T20:14:03.000Z | 2020-07-24T20:14:03.000Z | webapps/fruitynutters/cart/models.py | brew/fruitynutters | cfdd1fb41655e291419a4c566f9ed9fe425c260a | [
"MIT"
] | 3 | 2020-02-11T23:47:28.000Z | 2020-10-31T16:36:59.000Z | webapps/fruitynutters/cart/models.py | brew/fruitynutters | cfdd1fb41655e291419a4c566f9ed9fe425c260a | [
"MIT"
] | null | null | null | from django.db import models
from decimal import Decimal
import datetime
import fruitynutters
"""
These models are loosely based on models in the Shop app used by
http://www.satchmoproject.com/ [BSD]
"""
class Cart(models.Model):
"""Store items currently in a cart."""
date_created = models.DateField(auto_... | 34.355805 | 78 | 0.604709 | from django.db import models
from decimal import Decimal
import datetime
import fruitynutters
class Cart(models.Model):
date_created = models.DateField(auto_now_add=True)
date_updated = models.DateField(auto_now=True)
cart_comment = models.TextField(null=True, blank=True, default='')
cart_usernam... | true | true |
1c17a705905829fa732181f2fdcceb7f382af48c | 1,411 | py | Python | Term 3/8/main.py | theseana/apondaone | 7cbf3572a86c73220329804fee1f3d03842ae902 | [
"MIT"
] | null | null | null | Term 3/8/main.py | theseana/apondaone | 7cbf3572a86c73220329804fee1f3d03842ae902 | [
"MIT"
] | null | null | null | Term 3/8/main.py | theseana/apondaone | 7cbf3572a86c73220329804fee1f3d03842ae902 | [
"MIT"
] | null | null | null | import tkinter as tk
def translate():
text_new = text.get().upper()
text_translated = ""
for character in text_new:
text_translated += MORSE[character] + ' '
text_box.delete('1.0', tk.END)
text_box.insert(tk.END, text_translated)
MORSE = {'A': '.-', 'B': '-...', 'C': '-.-.',
... | 37.131579 | 94 | 0.399717 | import tkinter as tk
def translate():
text_new = text.get().upper()
text_translated = ""
for character in text_new:
text_translated += MORSE[character] + ' '
text_box.delete('1.0', tk.END)
text_box.insert(tk.END, text_translated)
MORSE = {'A': '.-', 'B': '-...', 'C': '-.-.',
... | true | true |
1c17a73ddc247931cc35607b9840e4392871d2fa | 558 | py | Python | setup.py | lexibank/mitterhoferbena | 3a4914795a6a431d54cea2bde910dfa1c93e7562 | [
"CC-BY-4.0"
] | null | null | null | setup.py | lexibank/mitterhoferbena | 3a4914795a6a431d54cea2bde910dfa1c93e7562 | [
"CC-BY-4.0"
] | 6 | 2019-04-09T10:30:00.000Z | 2021-04-26T08:20:42.000Z | setup.py | lexibank/mitterhoferbena | 3a4914795a6a431d54cea2bde910dfa1c93e7562 | [
"CC-BY-4.0"
] | 2 | 2019-07-25T14:10:47.000Z | 2020-11-17T19:15:53.000Z | from setuptools import setup
import json
with open("metadata.json", encoding="utf-8") as fp:
metadata = json.load(fp)
setup(
name="lexibank_mitterhoferbena",
description=metadata["title"],
license=metadata.get("license", ""),
url=metadata.get("url", ""),
py_modules=["lexibank_mitterhoferbena... | 26.571429 | 92 | 0.695341 | from setuptools import setup
import json
with open("metadata.json", encoding="utf-8") as fp:
metadata = json.load(fp)
setup(
name="lexibank_mitterhoferbena",
description=metadata["title"],
license=metadata.get("license", ""),
url=metadata.get("url", ""),
py_modules=["lexibank_mitterhoferbena... | true | true |
1c17a81cf19029f7b7cb732997b8f7fc507b6d6f | 8,337 | py | Python | main2.py | neko-kira/PKUAutoSubmit | f1c41c23442ccadf457fd835f55a31a9d14f2d60 | [
"Apache-2.0"
] | null | null | null | main2.py | neko-kira/PKUAutoSubmit | f1c41c23442ccadf457fd835f55a31a9d14f2d60 | [
"Apache-2.0"
] | null | null | null | main2.py | neko-kira/PKUAutoSubmit | f1c41c23442ccadf457fd835f55a31a9d14f2d60 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver import Firefox, Chrome, PhantomJS
... | 31.820611 | 92 | 0.675783 | from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver import Firefox, Chrome, PhantomJS
... | true | true |
1c17aa631dedac5020710675d55dd122d504733a | 246 | py | Python | demo/webcam.py | jiayiliu/gradio | 6fa11437c09845322df3b47f732a924338d17862 | [
"Apache-2.0"
] | null | null | null | demo/webcam.py | jiayiliu/gradio | 6fa11437c09845322df3b47f732a924338d17862 | [
"Apache-2.0"
] | null | null | null | demo/webcam.py | jiayiliu/gradio | 6fa11437c09845322df3b47f732a924338d17862 | [
"Apache-2.0"
] | null | null | null | # Demo: (Image) -> (Image)
import gradio as gr
import numpy as np
def snap(image):
return np.flipud(image)
io = gr.Interface(snap, gr.inputs.Image(shape=(100,100), image_mode="L", source="webcam"), "image")
io.test_launch()
io.launch()
| 16.4 | 99 | 0.674797 |
import gradio as gr
import numpy as np
def snap(image):
return np.flipud(image)
io = gr.Interface(snap, gr.inputs.Image(shape=(100,100), image_mode="L", source="webcam"), "image")
io.test_launch()
io.launch()
| true | true |
1c17ab7fcf875b11fd07dea79de4112e5034acc6 | 5,455 | py | Python | tools/template2mak.py | gzliudan/libpqxx | fc843ed0206f3cf7f1846e503da85de8482bb737 | [
"BSD-3-Clause"
] | null | null | null | tools/template2mak.py | gzliudan/libpqxx | fc843ed0206f3cf7f1846e503da85de8482bb737 | [
"BSD-3-Clause"
] | null | null | null | tools/template2mak.py | gzliudan/libpqxx | fc843ed0206f3cf7f1846e503da85de8482bb737 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
"""Minimal macro processor. Used for generating VC++ makefiles.
The available template commands are:
Expand a template section for each file in a list of file patterns::
###MAKTEMPLATE:FOREACH my/path*/*.cxx,other*.cxx
...
###MAKTEMPLATE:ENDFOREACH
In the temp... | 27.690355 | 78 | 0.654262 |
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
from argparse import (
ArgumentError,
ArgumentParser,
RawDescriptionHelpFormatter,
)
from contextlib import contextmanager
from glob import glob
import os
from sys import (
argv,
exit,
stdin,
... | true | true |
1c17abe80278d020b9997b5fd58e8e3311ed599d | 3,400 | py | Python | scripts/visualize_pr.py | nicktheway/Pagerank | ff57072deabca020548cd7fcc9f3c5a857f438ed | [
"MIT"
] | null | null | null | scripts/visualize_pr.py | nicktheway/Pagerank | ff57072deabca020548cd7fcc9f3c5a857f438ed | [
"MIT"
] | null | null | null | scripts/visualize_pr.py | nicktheway/Pagerank | ff57072deabca020548cd7fcc9f3c5a857f438ed | [
"MIT"
] | null | null | null | import numpy as np
import os
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
#import helper functions
import helpers as hp
dataset = "web-Google-diades"
pagerankFilePath = "./results/pageranks/" + dataset + ".data"
serialPagerankFilePath = "./results/serial/pageranks/" + dataset ... | 33.333333 | 226 | 0.742353 | import numpy as np
import os
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import helpers as hp
dataset = "web-Google-diades"
pagerankFilePath = "./results/pageranks/" + dataset + ".data"
serialPagerankFilePath = "./results/serial/pageranks/" + dataset + ".data"
logFilePath = "... | true | true |
1c17abf6dc4da1456b1e4197cef980c16613e725 | 14,786 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/customstep_2a6f0cec52fe41c2c67188afbd8bdcdc.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/customstep_2a6f0cec52fe41c2c67188afbd8bdcdc.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/customstep_2a6f0cec52fe41c2c67188afbd8bdcdc.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 38.910526 | 184 | 0.643041 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class CustomStep(Base):
__slots__ = ()
_SDM_NAME = 'customStep'
_SDM_ATT_MAP = {
'ForceApplyQTConfig': 'forceApplyQTConfig',
'InputParameters': 'inputParameters',
'Mode': 'mode',
'N... | true | true |
1c17ac4283e224706cc597fd71f5ecabcd2a4156 | 7,521 | py | Python | law/contrib/htcondor/workflow.py | HerrHorizontal/law | c31091d3bf39a25e79b3796ed5742346ddff8b77 | [
"BSD-3-Clause"
] | null | null | null | law/contrib/htcondor/workflow.py | HerrHorizontal/law | c31091d3bf39a25e79b3796ed5742346ddff8b77 | [
"BSD-3-Clause"
] | null | null | null | law/contrib/htcondor/workflow.py | HerrHorizontal/law | c31091d3bf39a25e79b3796ed5742346ddff8b77 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
HTCondor workflow implementation. See https://research.cs.wisc.edu/htcondor.
"""
__all__ = ["HTCondorWorkflow"]
import os
import logging
from abc import abstractmethod
from collections import OrderedDict
import luigi
from law.workflow.remote import BaseRemoteWorkflow, BaseRemoteWorkflowProxy
f... | 35.814286 | 98 | 0.686212 |
__all__ = ["HTCondorWorkflow"]
import os
import logging
from abc import abstractmethod
from collections import OrderedDict
import luigi
from law.workflow.remote import BaseRemoteWorkflow, BaseRemoteWorkflowProxy
from law.job.base import JobArguments
from law.task.proxy import ProxyCommand
from law.target.file imp... | true | true |
1c17add70bfb63dba343cbaa95b76a51159874ad | 1,005 | py | Python | storyhub/sdk/service/Argument.py | wilzbach/hub-sdk-python | 3dd2a3112276068080751198cb1fcc29975c0136 | [
"Apache-2.0"
] | null | null | null | storyhub/sdk/service/Argument.py | wilzbach/hub-sdk-python | 3dd2a3112276068080751198cb1fcc29975c0136 | [
"Apache-2.0"
] | null | null | null | storyhub/sdk/service/Argument.py | wilzbach/hub-sdk-python | 3dd2a3112276068080751198cb1fcc29975c0136 | [
"Apache-2.0"
] | null | null | null | from storyhub.sdk.service.ServiceObject import ServiceObject
from storyhub.sdk.service.output.OutputUtils import OutputUtils
class Argument(ServiceObject):
"""
Represents an argument, for an event or other service object.
"""
def __init__(self, name, help_, type_, required, data):
super().__i... | 23.928571 | 65 | 0.606965 | from storyhub.sdk.service.ServiceObject import ServiceObject
from storyhub.sdk.service.output.OutputUtils import OutputUtils
class Argument(ServiceObject):
def __init__(self, name, help_, type_, required, data):
super().__init__(data=data)
self._name = name
self._help = help_
sel... | true | true |
1c17ae418702cae1a9e8af24d96c22db9ce5bef9 | 178 | py | Python | settings.py | Trymzet/send_schedule | 0c0bc858fc0570c873236deed1c7ef707b112a9f | [
"MIT"
] | null | null | null | settings.py | Trymzet/send_schedule | 0c0bc858fc0570c873236deed1c7ef707b112a9f | [
"MIT"
] | null | null | null | settings.py | Trymzet/send_schedule | 0c0bc858fc0570c873236deed1c7ef707b112a9f | [
"MIT"
] | null | null | null | from datetime import date
TO = "m@xy.com"
TODAY_STAMP = date.today()
TODAY = TODAY_STAMP.strftime("%d.%m") # e.g. 25.11
WDEM_FILE_FORMAT = "xlsx"
CRC_FILE_FORMAT = "csv"
| 22.25 | 51 | 0.674157 | from datetime import date
TO = "m@xy.com"
TODAY_STAMP = date.today()
TODAY = TODAY_STAMP.strftime("%d.%m") WDEM_FILE_FORMAT = "xlsx"
CRC_FILE_FORMAT = "csv"
| true | true |
1c17ae495bf9a5e05c1daee7f48361267422fa08 | 1,207 | py | Python | transformer/add_sos_eos.py | salesforce/DAPC | df2b8bffdb78d21de9bb8c2d17c5cdb2590de54a | [
"BSD-3-Clause"
] | 1 | 2021-03-04T22:07:32.000Z | 2021-03-04T22:07:32.000Z | transformer/add_sos_eos.py | salesforce/DAPC | df2b8bffdb78d21de9bb8c2d17c5cdb2590de54a | [
"BSD-3-Clause"
] | null | null | null | transformer/add_sos_eos.py | salesforce/DAPC | df2b8bffdb78d21de9bb8c2d17c5cdb2590de54a | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Shigeki Karita
# Apache 2.0 (http:/... | 33.527778 | 110 | 0.672742 |
import torch
def add_sos_eos(ys_pad, sos, eos, ignore_id, max_len=None):
from espnet.nets.pytorch_backend.nets_utils import pad_list
_sos = ys_pad.new([sos])
_eos = ys_pad.new([eos])
ys = [y[y != ignore_id] for y in ys_pad] ys_in = [torch.cat([_sos, y], dim=0) for y in ys]
ys_out = [torch... | true | true |
1c17ae6b1ac9ecbd97ef74b6aab51e32d4d0a5e5 | 2,509 | py | Python | applications/incompressible_fluid_application/python_scripts/edgebased_incompressible_solver.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 2 | 2020-04-30T19:13:08.000Z | 2021-04-14T19:40:47.000Z | applications/incompressible_fluid_application/python_scripts/edgebased_incompressible_solver.py | Jacklwln/Kratos | 12ffe332622d7e8ea3e4a10bc061beb9d8e6e8de | [
"BSD-4-Clause"
] | 1 | 2020-04-30T19:19:09.000Z | 2020-05-02T14:22:36.000Z | applications/incompressible_fluid_application/python_scripts/edgebased_incompressible_solver.py | Jacklwln/Kratos | 12ffe332622d7e8ea3e4a10bc061beb9d8e6e8de | [
"BSD-4-Clause"
] | 1 | 2020-06-12T08:51:24.000Z | 2020-06-12T08:51:24.000Z | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
from KratosMultiphysics import *
from KratosMultiphysics.IncompressibleFluidApplication import *
from KratosMultiphysics.MeshingApplication import *
CheckForPreviousImport()
def AddVa... | 32.166667 | 134 | 0.750897 | from __future__ import print_function, absolute_import, division from KratosMultiphysics import *
from KratosMultiphysics.IncompressibleFluidApplication import *
from KratosMultiphysics.MeshingApplication import *
CheckForPreviousImport()
def AddVariables(model_part):
model_part.AddNodalSolutionStepVariable(VELOC... | false | true |
1c17aeaa288e53c999f36433d35a8279cbe1cea3 | 1,992 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/nonLocalScopes_20210710230651.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/nonLocalScopes_20210710230651.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/nonLocalScopes_20210710230651.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ NonLocal Scopes
Inner Functions
We can define functions from inside another function:
"""
def outer_func():
# some code
# this is an example of a nested function
def inner_func():
# some code
inner_func()
outer_func()
"""
Both functions have access to the global a... | 18.971429 | 101 | 0.685743 | """ NonLocal Scopes
Inner Functions
We can define functions from inside another function:
"""
def outer_func():
def inner_func():
inner_func()
outer_func()
"""
Both functions have access to the global and built-in scopes as well as their respective local scopes
But th... | false | true |
1c17b30be45a8dab9982066daaa4afef61ab22b5 | 518 | py | Python | Experimental/CTypesTests/CTypesStructs_Linux.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | 9 | 2017-10-05T23:36:23.000Z | 2021-08-09T15:40:03.000Z | Experimental/CTypesTests/CTypesStructs_Linux.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | 21 | 2018-01-02T09:33:03.000Z | 2018-08-27T11:09:52.000Z | Experimental/CTypesTests/CTypesStructs_Linux.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | 4 | 2018-06-23T09:05:45.000Z | 2021-01-22T15:36:50.000Z | import ctypes
import ctypes_scanner
from ctypes_scanner import POINTER_T
class struct_iobuf(ctypes.Structure):
_pack_ = True # source:False
_fields_ = [
('_ptr', POINTER_T(ctypes.c_char)),
('_cnt', ctypes.c_int32),
('_base', POINTER_T(ctypes.c_char)),
('_flag', ctypes.c_int32),
('_file',... | 24.666667 | 42 | 0.679537 | import ctypes
import ctypes_scanner
from ctypes_scanner import POINTER_T
class struct_iobuf(ctypes.Structure):
_pack_ = True _fields_ = [
('_ptr', POINTER_T(ctypes.c_char)),
('_cnt', ctypes.c_int32),
('_base', POINTER_T(ctypes.c_char)),
('_flag', ctypes.c_int32),
('_file', ctypes.c_i... | true | true |
1c17b47d0f4ad094e250ad89a8c044dcae173752 | 1,643 | py | Python | lnbits/extensions/lnurlp/models.py | claytantor/lnbits-legend | 129409296a235c9b0cdf9d591ab165d6709fb46f | [
"MIT"
] | null | null | null | lnbits/extensions/lnurlp/models.py | claytantor/lnbits-legend | 129409296a235c9b0cdf9d591ab165d6709fb46f | [
"MIT"
] | null | null | null | lnbits/extensions/lnurlp/models.py | claytantor/lnbits-legend | 129409296a235c9b0cdf9d591ab165d6709fb46f | [
"MIT"
] | null | null | null | import json
from urllib.parse import urlparse, urlunparse, parse_qs, urlencode, ParseResult
from quart import url_for
from typing import NamedTuple, Optional, Dict
from sqlite3 import Row
from lnbits.lnurl import encode as lnurl_encode # type: ignore
from lnurl.types import LnurlPayMetadata # type: ignore
class Pay... | 28.824561 | 83 | 0.608643 | import json
from urllib.parse import urlparse, urlunparse, parse_qs, urlencode, ParseResult
from quart import url_for
from typing import NamedTuple, Optional, Dict
from sqlite3 import Row
from lnbits.lnurl import encode as lnurl_encode from lnurl.types import LnurlPayMetadata
class PayLink(NamedTuple):
id: int
... | true | true |
1c17b4d03d08fd07989ca34e4a885b14ebaf6636 | 2,364 | py | Python | sdk/python/pulumi_azure_native/kusto/v20190907/list_cluster_follower_databases.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/kusto/v20190907/list_cluster_follower_databases.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/kusto/v20190907/list_cluster_follower_databases.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 35.283582 | 163 | 0.7022 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'ListClusterFollowerDatabasesResult',
'AwaitableListClusterFollowerDatabasesResult',
'list_cluster_follower_databases',
]
@... | true | true |
1c17b4d956218dc5426e7fd32bf4562b57146d7f | 537 | py | Python | backend/app/schemas/user.py | zelaznymarek/shopping-list | 9267c59436953b56b227a3fdb482fb5a7fe542d6 | [
"MIT"
] | null | null | null | backend/app/schemas/user.py | zelaznymarek/shopping-list | 9267c59436953b56b227a3fdb482fb5a7fe542d6 | [
"MIT"
] | 1 | 2021-07-29T14:19:52.000Z | 2021-07-29T14:19:52.000Z | backend/app/schemas/user.py | zelaznymarek/shopping-list | 9267c59436953b56b227a3fdb482fb5a7fe542d6 | [
"MIT"
] | null | null | null | from typing import Optional, List
from pydantic import BaseModel, EmailStr
from app.schemas.shopping_list import ShoppingList
class UserBase(BaseModel):
email: Optional[EmailStr] = None
username: Optional[str] = None
is_admin: Optional[bool] = None
class UserCreate(UserBase):
email: EmailStr
p... | 16.272727 | 50 | 0.705773 | from typing import Optional, List
from pydantic import BaseModel, EmailStr
from app.schemas.shopping_list import ShoppingList
class UserBase(BaseModel):
email: Optional[EmailStr] = None
username: Optional[str] = None
is_admin: Optional[bool] = None
class UserCreate(UserBase):
email: EmailStr
p... | true | true |
1c17b50b4780fec6c71db19f53dc8b14360215a8 | 501 | py | Python | mnist/get_mnist.py | privateos/xigmoid | 3d01c65a7f82ce0d851a42d7e38f084eae2b1622 | [
"MIT"
] | null | null | null | mnist/get_mnist.py | privateos/xigmoid | 3d01c65a7f82ce0d851a42d7e38f084eae2b1622 | [
"MIT"
] | null | null | null | mnist/get_mnist.py | privateos/xigmoid | 3d01c65a7f82ce0d851a42d7e38f084eae2b1622 | [
"MIT"
] | null | null | null | import os
import numpy as np
def get():
current_file_name = os.path.realpath(__file__)
current_file_path = os.path.split(current_file_name)[0]
mnist_file_name = os.path.join(current_file_path, 'mnist.npz')
mnist_npz = np.load(mnist_file_name)
x = mnist_npz['x']
y = mnist_npz['y']
#x = np.r... | 27.833333 | 66 | 0.622754 | import os
import numpy as np
def get():
current_file_name = os.path.realpath(__file__)
current_file_path = os.path.split(current_file_name)[0]
mnist_file_name = os.path.join(current_file_path, 'mnist.npz')
mnist_npz = np.load(mnist_file_name)
x = mnist_npz['x']
y = mnist_npz['y']
x = n... | true | true |
1c17b61bf4ad81df9f15a390a683d7d5eb14bae7 | 3,676 | py | Python | fonts/m32_8x8.py | ccccmagicboy/st7735_mpy | b15f1bde69fbe6e0eb4931c57e71c136d8e7f024 | [
"MIT"
] | 6 | 2020-07-11T16:59:19.000Z | 2021-07-16T19:32:49.000Z | ports/esp32/user_modules/st7735_mpy/fonts/m32_8x8.py | d4niele/micropython | a1f7b37d392bf46b28045ce215ae899fda8d8c38 | [
"MIT"
] | 1 | 2020-04-14T03:14:45.000Z | 2020-04-14T03:14:45.000Z | fonts/m32_8x8.py | ccccmagicboy/st7735_mpy | b15f1bde69fbe6e0eb4931c57e71c136d8e7f024 | [
"MIT"
] | null | null | null | """converted from ..\fonts\M32_8x8.bin """
WIDTH = 8
HEIGHT = 8
FIRST = 0x20
LAST = 0x7f
_FONT =\
b'\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\
b'\x6c\x6c\x6c\x00\x00\x00\x00\x00'\
b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\
b'\x18\x7e\xc0\x7c\x06\xfc\x18\x00'\
b'\x00\xc6\x0c\x18\x30\x60\xc6\x00'\
... | 35.009524 | 42 | 0.67519 | WIDTH = 8
HEIGHT = 8
FIRST = 0x20
LAST = 0x7f
_FONT =\
b'\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x18\x3c\x3c\x18\x18\x00\x18\x00'\
b'\x6c\x6c\x6c\x00\x00\x00\x00\x00'\
b'\x6c\x6c\xfe\x6c\xfe\x6c\x6c\x00'\
b'\x18\x7e\xc0\x7c\x06\xfc\x18\x00'\
b'\x00\xc6\x0c\x18\x30\x60\xc6\x00'\
b'\x38\x6c\x38\x76\xcc\xcc\x76\x00'\
b'\x18... | true | true |
1c17b688bf38a46f60717dbe92606e6f9cbc2c45 | 1,744 | py | Python | locations/shop.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 13 | 2020-09-13T16:50:28.000Z | 2022-03-22T20:49:54.000Z | locations/shop.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 10 | 2020-06-27T12:34:38.000Z | 2022-01-03T12:15:42.000Z | locations/shop.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 18 | 2020-05-29T17:48:04.000Z | 2022-02-08T03:36:08.000Z | from .itemInfo import ItemInfo
from .constants import *
from utils import formatText
from assembler import ASM
class ShopItem(ItemInfo):
OPTIONS = [SWORD, POWER_BRACELET, SHIELD, BOW, HOOKSHOT, MAGIC_ROD, PEGASUS_BOOTS,
OCARINA, FEATHER, SHOVEL, BOOMERANG,
FLIPPERS... | 41.52381 | 102 | 0.58945 | from .itemInfo import ItemInfo
from .constants import *
from utils import formatText
from assembler import ASM
class ShopItem(ItemInfo):
OPTIONS = [SWORD, POWER_BRACELET, SHIELD, BOW, HOOKSHOT, MAGIC_ROD, PEGASUS_BOOTS,
OCARINA, FEATHER, SHOVEL, BOOMERANG,
FLIPPERS... | true | true |
1c17b798a3a5044e3cefb1adc796df81e2c7927a | 162 | py | Python | Section_4/code/user.py | bonch223/Flask-Restful-API | 09de8d6d25df634ca1e483bd43599a230fee2af5 | [
"MIT"
] | null | null | null | Section_4/code/user.py | bonch223/Flask-Restful-API | 09de8d6d25df634ca1e483bd43599a230fee2af5 | [
"MIT"
] | null | null | null | Section_4/code/user.py | bonch223/Flask-Restful-API | 09de8d6d25df634ca1e483bd43599a230fee2af5 | [
"MIT"
] | null | null | null | class User:
def __init__(self, _id, username, password):
self.id = _id
self.username = username
self.password = password
| 27 | 49 | 0.567901 | class User:
def __init__(self, _id, username, password):
self.id = _id
self.username = username
self.password = password
| true | true |
1c17b833b9af521d5c18f72276444dff3b2b5246 | 1,987 | py | Python | elephant/utils.py | PTRRupprecht/Spikefinder-Elephant | be2330a4cc523bc415ba14ef45c20e078eda1cc6 | [
"MIT"
] | 12 | 2017-06-09T05:36:09.000Z | 2022-03-17T20:38:30.000Z | elephant/utils.py | PTRRupprecht/Spikefinder-Elephant | be2330a4cc523bc415ba14ef45c20e078eda1cc6 | [
"MIT"
] | 3 | 2017-10-03T20:55:42.000Z | 2018-05-17T20:32:03.000Z | elephant/utils.py | PTRRupprecht/Spikefinder-Elephant | be2330a4cc523bc415ba14ef45c20e078eda1cc6 | [
"MIT"
] | 13 | 2017-05-15T14:05:26.000Z | 2022-03-17T20:38:22.000Z |
import numpy as np
def norm(x):
return (x - np.mean(x)) / (np.std(x) + 1e-7)
def smooth(x,window_len=11,window='hanning'):
"""smooth the data using a window with requested size.
This method is based on the convolution of a scaled window with the signal.
The signal is prepared by introducing ref... | 30.569231 | 121 | 0.638148 |
import numpy as np
def norm(x):
return (x - np.mean(x)) / (np.std(x) + 1e-7)
def smooth(x,window_len=11,window='hanning'):
if x.ndim != 1:
raise ValueError("smooth only accepts 1 dimension arrays.")
if x.size < window_len:
raise ValueError("Input vector needs to be bigger than window s... | true | true |
1c17b8e020b42ee92cc84473648d7fe3d4439f30 | 220 | py | Python | petstagram/common/forms.py | Damyanmd/softuni-project | 97783c7085a20597fe93cb08fa39d08196a9369f | [
"MIT"
] | null | null | null | petstagram/common/forms.py | Damyanmd/softuni-project | 97783c7085a20597fe93cb08fa39d08196a9369f | [
"MIT"
] | null | null | null | petstagram/common/forms.py | Damyanmd/softuni-project | 97783c7085a20597fe93cb08fa39d08196a9369f | [
"MIT"
] | null | null | null | from django import forms
class CommentForm(forms.Form):
text = forms.CharField(
widget=forms.Textarea(
attrs={
'class': 'form-control rounded-2',
},
),
) | 18.333333 | 50 | 0.509091 | from django import forms
class CommentForm(forms.Form):
text = forms.CharField(
widget=forms.Textarea(
attrs={
'class': 'form-control rounded-2',
},
),
) | true | true |
1c17b930aaeaa095505f786407505b396b7da76e | 5,750 | py | Python | whoville/cloudbreak/models/tags.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | whoville/cloudbreak/models/tags.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | whoville/cloudbreak/models/tags.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | 31.593407 | 984 | 0.615826 |
from pprint import pformat
from six import iteritems
import re
class Tags(object):
swagger_types = {
'application_tags': 'dict(str, str)',
'user_defined_tags': 'dict(str, str)',
'default_tags': 'dict(str, str)'
}
attribute_map = {
'application_tags': 'applicationTags'... | true | true |
1c17b95a7dc8031640a94c69fc3b6a3a12400a52 | 7,050 | py | Python | util/ufits-process_illumina.py | zhongmicai/ITS_clustering | 0177f3fba2570fa18b2aecdfb9737fb18f222ebf | [
"BSD-2-Clause"
] | 1 | 2020-05-28T06:47:07.000Z | 2020-05-28T06:47:07.000Z | util/ufits-process_illumina.py | zhongmicai/ITS_clustering | 0177f3fba2570fa18b2aecdfb9737fb18f222ebf | [
"BSD-2-Clause"
] | null | null | null | util/ufits-process_illumina.py | zhongmicai/ITS_clustering | 0177f3fba2570fa18b2aecdfb9737fb18f222ebf | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import sys, os, argparse, shutil, logging, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import lib.fasta as fasta
import lib.fastq as fastq
import lib.primer as primer
import li... | 34.90099 | 252 | 0.651631 |
import sys, os, argparse, shutil, logging, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import lib.fasta as fasta
import lib.fastq as fastq
import lib.primer as primer
import lib.revcomp_lib as revco... | false | true |
1c17b98ccbc48700a714df356dd94f05069c7b8e | 2,701 | py | Python | product/models.py | harshit212705/ShopHere | ee571703f6be63f475cbe608a2fb8f5c2720013f | [
"MIT"
] | null | null | null | product/models.py | harshit212705/ShopHere | ee571703f6be63f475cbe608a2fb8f5c2720013f | [
"MIT"
] | 8 | 2020-09-07T21:12:04.000Z | 2022-02-18T18:08:27.000Z | product/models.py | harshit212705/ShopHere | ee571703f6be63f475cbe608a2fb8f5c2720013f | [
"MIT"
] | null | null | null | from django.db import models
from tinymce.models import HTMLField
from users.models import User
from tinymce import models as tinymce_models
from PIL import Image
SUPERCATEGORY_CHOICES = (
(1, 'Electronics'),
(2, 'Clothing'),
(3, 'Home & Kitchen'),
(4, 'Footwear'),
(5, 'More')
... | 35.077922 | 167 | 0.694187 | from django.db import models
from tinymce.models import HTMLField
from users.models import User
from tinymce import models as tinymce_models
from PIL import Image
SUPERCATEGORY_CHOICES = (
(1, 'Electronics'),
(2, 'Clothing'),
(3, 'Home & Kitchen'),
(4, 'Footwear'),
(5, 'More')
... | true | true |
1c17babf6aeb0cc7afc32d7e42cee033c5d10a11 | 4,636 | py | Python | 3 experiments_correctness/batch/e2 (experiment and chance scores) (ack).py | nmningmei/metacognition | 734082e247cc7fc9d277563e2676e10692617a3f | [
"MIT"
] | 3 | 2019-07-09T15:37:46.000Z | 2019-07-17T16:28:02.000Z | 3 experiments_correctness/batch/e2 (experiment and chance scores) (ack).py | nmningmei/metacognition | 734082e247cc7fc9d277563e2676e10692617a3f | [
"MIT"
] | null | null | null | 3 experiments_correctness/batch/e2 (experiment and chance scores) (ack).py | nmningmei/metacognition | 734082e247cc7fc9d277563e2676e10692617a3f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 12 16:07:58 2018
@author: nmei
in exp2 (e2) there were 3 possible awareness ratings ( (e.g. 1- no experience, 2 brief glimpse 3 almost clear or clear perception)
BUT if can make a binary classification by focussing on 1 and 2 which are the majority... | 31.972414 | 159 | 0.408973 | if __name__ == '__main__':
import os
import pandas as pd
import numpy as np
import utils
dir_saving = 'results_e2'
if not os.path.exists(dir_saving):
os.mkdir(dir_saving)
try: df1 = pd.read_csv('e2.csv').iloc[:,1:]
except: df1 = pd.rea... | true | true |
1c17bbe04cceb038e0e740d3f259532d4e43d35d | 4,134 | py | Python | log_parser.py | NakraniN/python-log-parser | 2fce573febc4d2d9a44915646f4d39e069fe56d6 | [
"Apache-2.0"
] | null | null | null | log_parser.py | NakraniN/python-log-parser | 2fce573febc4d2d9a44915646f4d39e069fe56d6 | [
"Apache-2.0"
] | null | null | null | log_parser.py | NakraniN/python-log-parser | 2fce573febc4d2d9a44915646f4d39e069fe56d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-----------------------------------------------------------------------------------------------------------------------
# INFO:
#-----------------------------------------------------------------------------------------------------------------------
"""
Author: Niraj Nakrani
License: Apache 2.0
... | 30.622222 | 198 | 0.603774 |
"""
Author: Niraj Nakrani
License: Apache 2.0
Description: Log processor testing command-line utility.
"""
import re
import sqlite3
import os
if os.path.exists('mydb.db'):
os.remove('mydb.db')
con = sqlite3.connect('mydb.db')
c = con.cursor()
c.execute("CREATE TABLE Events(date TEXT, time TEXT, severity TEX... | false | true |
1c17bcabcc5af788a57e98cc063712d43458703c | 33,966 | py | Python | pygsp/graphs/graph.py | jafluri/pygsp | ff8c0023c25df4cbcfd88a7ef63c6223f3030a51 | [
"BSD-3-Clause"
] | null | null | null | pygsp/graphs/graph.py | jafluri/pygsp | ff8c0023c25df4cbcfd88a7ef63c6223f3030a51 | [
"BSD-3-Clause"
] | null | null | null | pygsp/graphs/graph.py | jafluri/pygsp | ff8c0023c25df4cbcfd88a7ef63c6223f3030a51 | [
"BSD-3-Clause"
] | 1 | 2021-06-04T08:29:19.000Z | 2021-06-04T08:29:19.000Z | # -*- coding: utf-8 -*-
from __future__ import division
import os
from collections import Counter
import numpy as np
from scipy import sparse
from pygsp import utils
from .fourier import FourierMixIn
from .difference import DifferenceMixIn
from ._io import IOMixIn
from ._layout import LayoutMixIn
class Graph(Four... | 32.691049 | 79 | 0.520903 |
from __future__ import division
import os
from collections import Counter
import numpy as np
from scipy import sparse
from pygsp import utils
from .fourier import FourierMixIn
from .difference import DifferenceMixIn
from ._io import IOMixIn
from ._layout import LayoutMixIn
class Graph(FourierMixIn, DifferenceMixI... | true | true |
1c17bd546e029e349cfd7ee7a2fdcfb3f44db230 | 10,386 | py | Python | benchmarks/f3_wrong_hints/scaling_nonlinear_software/17-19_12.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_nonlinear_software/17-19_12.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_nonlinear_software/17-19_12.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 34.504983 | 81 | 0.551127 | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
1c17bd98d78b71475724ebf19e17aa5c0f4cdb35 | 2,972 | py | Python | tasks/tasks.py | housepig7/ops | ed1dc6f6e160e2a4a414c1eeeee78ded02597013 | [
"Apache-2.0"
] | 394 | 2017-09-08T04:19:06.000Z | 2022-03-25T16:43:22.000Z | tasks/tasks.py | kevin4shey/autoops | 5e717a2d86dd37cd2cfaf6db3d9613a0c41c49ae | [
"Apache-2.0"
] | 9 | 2017-10-11T02:20:55.000Z | 2022-03-25T09:43:08.000Z | tasks/tasks.py | kevin4shey/autoops | 5e717a2d86dd37cd2cfaf6db3d9613a0c41c49ae | [
"Apache-2.0"
] | 218 | 2017-09-10T08:10:55.000Z | 2022-03-16T08:54:27.000Z | from celery import Celery, platforms
from asset.models import asset,performance
from tasks.views import ssh
import threading,time,datetime
from names.password_crypt import decrypt_p
platforms.C_FORCE_ROOT = True
app = Celery('my_task')
app.config_from_object('django.conf:settings',)
app.autodiscover_tasks(lambda: se... | 27.018182 | 136 | 0.653769 | from celery import Celery, platforms
from asset.models import asset,performance
from tasks.views import ssh
import threading,time,datetime
from names.password_crypt import decrypt_p
platforms.C_FORCE_ROOT = True
app = Celery('my_task')
app.config_from_object('django.conf:settings',)
app.autodiscover_tasks(lambda: se... | true | true |
1c17bde9db53e074ff68fd1f46ecbba9522464b6 | 38,935 | py | Python | zipline/algorithm.py | npezolano/zipline | 71effa5e98bd0425ac1863e1861c9b51fbc77242 | [
"Apache-2.0"
] | null | null | null | zipline/algorithm.py | npezolano/zipline | 71effa5e98bd0425ac1863e1861c9b51fbc77242 | [
"Apache-2.0"
] | null | null | null | zipline/algorithm.py | npezolano/zipline | 71effa5e98bd0425ac1863e1861c9b51fbc77242 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 35.720183 | 108 | 0.597329 | from copy import copy
import warnings
import pytz
import pandas as pd
import numpy as np
from datetime import datetime
from itertools import groupby, chain
from six.moves import filter
from six import (
exec_,
iteritems,
string_types,
)
from operator import attrgetter
from zipline.errors import (
Or... | true | true |
1c17be8bad2a5f2a2f2391e4b0358982cb74718d | 19,910 | py | Python | playground_metrics/map_metric.py | ClementMaliet/playground-metrics | 7a0607c14a830818f9450d2febd8ae5e1709f8cf | [
"MIT"
] | 2 | 2020-11-25T13:33:19.000Z | 2021-04-16T08:14:16.000Z | playground_metrics/map_metric.py | ClementMaliet/playground-metrics | 7a0607c14a830818f9450d2febd8ae5e1709f8cf | [
"MIT"
] | 1 | 2021-03-01T13:35:16.000Z | 2021-03-01T15:38:04.000Z | playground_metrics/map_metric.py | ClementMaliet/playground-metrics | 7a0607c14a830818f9450d2febd8ae5e1709f8cf | [
"MIT"
] | 4 | 2021-01-14T13:00:49.000Z | 2022-03-09T04:00:55.000Z | """Implement the public interface to compute mAP from a set of detections and ground truths.
For more in formation on how the metric is computed, see: :doc:`../content/map_metric`.
If one wants to integrate the module into a framework to use it as a validation metric, the
:class:`~MeanAveragePrecisionMetric` class de... | 55.45961 | 120 | 0.660271 | import warnings
from collections import defaultdict
import numpy as np
from .utils import to_builtin, to_list
from .match_detections import MatchEngineIoU
from .utils.conversion import get_type_and_convert
class MeanAveragePrecisionMetric:
def __init__(self, threshold=None, match_algorithm=None, label_mean_are... | true | true |
1c17c1509435824c730c1ef288d9aade16e60128 | 725 | py | Python | setup.py | aniljha91t/SaidBySolow | 642676b3c8d8d6af87769471855aa3c4ef067920 | [
"MIT"
] | 8 | 2020-12-22T09:57:58.000Z | 2022-02-28T10:44:55.000Z | setup.py | aniljha91t/SaidBySolow | 642676b3c8d8d6af87769471855aa3c4ef067920 | [
"MIT"
] | 4 | 2020-12-15T03:02:41.000Z | 2021-03-29T07:59:47.000Z | setup.py | aniljha91t/SaidBySolow | 642676b3c8d8d6af87769471855aa3c4ef067920 | [
"MIT"
] | 1 | 2021-03-29T03:53:53.000Z | 2021-03-29T03:53:53.000Z | import setuptools
setuptools.setup(
name="spacexpy",
version="2.0.1",
license="MIT",
author="Ryu ju heon",
author_email="SaidBySolo@gmail.com",
description="SpaceX REST API wrapping with aiohttp",
long_description=open("README.md", "rt", encoding="UTF8").read(),
long_description_content... | 30.208333 | 69 | 0.64 | import setuptools
setuptools.setup(
name="spacexpy",
version="2.0.1",
license="MIT",
author="Ryu ju heon",
author_email="SaidBySolo@gmail.com",
description="SpaceX REST API wrapping with aiohttp",
long_description=open("README.md", "rt", encoding="UTF8").read(),
long_description_content... | true | true |
1c17c24e54927db69cc2f2fecf5e04132608fd35 | 1,614 | py | Python | tests/unet_2d_test.py | alanpeixinho/NiftyNet | 9a17022a71985974f9e5ca992c765d55860fdd7d | [
"Apache-2.0"
] | null | null | null | tests/unet_2d_test.py | alanpeixinho/NiftyNet | 9a17022a71985974f9e5ca992c765d55860fdd7d | [
"Apache-2.0"
] | null | null | null | tests/unet_2d_test.py | alanpeixinho/NiftyNet | 9a17022a71985974f9e5ca992c765d55860fdd7d | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, print_function
import os
import unittest
import tensorflow as tf
from tensorflow.keras import regularizers
from niftynet.network.unet_2d import UNet2D
from tests.niftynet_testcase import NiftyNetTestCase
@unittest.skipIf(os.environ.get('QUICKTEST', "").lower() == "true",
... | 32.938776 | 67 | 0.63259 | from __future__ import absolute_import, print_function
import os
import unittest
import tensorflow as tf
from tensorflow.keras import regularizers
from niftynet.network.unet_2d import UNet2D
from tests.niftynet_testcase import NiftyNetTestCase
@unittest.skipIf(os.environ.get('QUICKTEST', "").lower() == "true",
... | true | true |
1c17c25e4be8f545a81ba9de9b156251370143dd | 4,564 | py | Python | solutions/intcomputer.py | claudiobierig/adventofcode19 | 40dabd7c780ab1cd8bad4292550cd9dd1d178365 | [
"MIT"
] | null | null | null | solutions/intcomputer.py | claudiobierig/adventofcode19 | 40dabd7c780ab1cd8bad4292550cd9dd1d178365 | [
"MIT"
] | null | null | null | solutions/intcomputer.py | claudiobierig/adventofcode19 | 40dabd7c780ab1cd8bad4292550cd9dd1d178365 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
def get_mode(operation, i):
"""
>>> get_mode(101, 0)
1
>>> get_mode(1, 0)
0
>>> get_mode(1101, 0)
1
>>> get_mode(1001, 0)
0
>>> get_mode(1101, 1)
1
>>> get_mode(1001, 1)
1
"""
if len(str(operation)) > i + 2:
mode = int(str(o... | 33.072464 | 73 | 0.503287 |
def get_mode(operation, i):
if len(str(operation)) > i + 2:
mode = int(str(operation)[-i-3])
else:
mode = 0
return mode
class Intcomputer:
def __init__(self, memory):
self._memory = memory.copy()
self._index = 0
self._finished = False
self._relative_bas... | true | true |
1c17c2a696f16aeb6d9b100510f39120861345ed | 2,228 | py | Python | venv/Lib/site-packages/phonenumbers/data/region_IR.py | Lv11223311/RTSM | 4d28bc49380e89f3f7f928ae7965cf9ec1518bc5 | [
"MIT"
] | 1 | 2021-03-21T14:24:08.000Z | 2021-03-21T14:24:08.000Z | venv/Lib/site-packages/phonenumbers/data/region_IR.py | Lv11223311/RTSM | 4d28bc49380e89f3f7f928ae7965cf9ec1518bc5 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/phonenumbers/data/region_IR.py | Lv11223311/RTSM | 4d28bc49380e89f3f7f928ae7965cf9ec1518bc5 | [
"MIT"
] | null | null | null | """Auto-generated file, do not edit by hand. IR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IR = PhoneMetadata(id='IR', country_code=98, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}', p... | 123.777778 | 355 | 0.648115 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IR = PhoneMetadata(id='IR', country_code=98, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}', possible_length=(4, 5, 6, 7, 10), possible_length_local_only=... | true | true |
1c17c2ce1e3a37769f1389e8b6447d736e7592bb | 2,990 | py | Python | web2py-appliances-master/LibraryServices/controllers/default.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/LibraryServices/controllers/default.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/LibraryServices/controllers/default.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#########################################################################
## This is a samples controller
## - index is the default action of any application
## - user is required for authentication and authorization
## - download is for downloading files uploaded in the db (does streaming)
##... | 36.463415 | 102 | 0.626087 |
def index():
form=FORM(INPUT(_name='keywords',requires=IS_NOT_EMPTY()),_method='GET')
if form.accepts(request):
keywords = form.vars.keywords.split()
query1 = reduce(lambda a,b:a|b,[db.book.authors.like('%'+key+'%') for key in keywords])
query2 = reduce(lambda a,b:a|b,[db.book.title.li... | true | true |
1c17c30b5c917a74950cf7de6a4a7e5698310c13 | 8,701 | py | Python | sdk/python/pulumi_azure_nextgen/logic/v20150801preview/integration_account_schema.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/logic/v20150801preview/integration_account_schema.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/logic/v20150801preview/integration_account_schema.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.730594 | 437 | 0.630502 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
__all__ = ['IntegrationAccountSchema']
class IntegrationAccountSchema(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
1c17c3967e3ec8357d7aa1f6d6a05aa1027c8e0b | 2,176 | py | Python | test/test_with_latest_from.py | tr11/aioreactive | 6219f9a0761f69fa1765129b990762affdf661c8 | [
"MIT"
] | null | null | null | test/test_with_latest_from.py | tr11/aioreactive | 6219f9a0761f69fa1765129b990762affdf661c8 | [
"MIT"
] | null | null | null | test/test_with_latest_from.py | tr11/aioreactive | 6219f9a0761f69fa1765129b990762affdf661c8 | [
"MIT"
] | null | null | null | import logging
import pytest
import asyncio
from aioreactive.testing import VirtualTimeEventLoop
from aioreactive.core import AsyncStream, run, AsyncAnonymousObserver, subscribe
from aioreactive.operators.from_iterable import from_iterable
from aioreactive.operators.with_latest_from import with_latest_from
from aiorea... | 23.652174 | 80 | 0.680607 | import logging
import pytest
import asyncio
from aioreactive.testing import VirtualTimeEventLoop
from aioreactive.core import AsyncStream, run, AsyncAnonymousObserver, subscribe
from aioreactive.operators.from_iterable import from_iterable
from aioreactive.operators.with_latest_from import with_latest_from
from aiorea... | true | true |
1c17c3abd1f2fb41e6461a24b0e68e64c897cea0 | 124 | py | Python | aula10/ex03.py | FelipeMachad0/python | 20b4e4264beca6914815c5c4c11ec7805d99e8d2 | [
"MIT"
] | 1 | 2021-12-10T21:48:12.000Z | 2021-12-10T21:48:12.000Z | aula10/ex03.py | FelipeMachad0/python | 20b4e4264beca6914815c5c4c11ec7805d99e8d2 | [
"MIT"
] | null | null | null | aula10/ex03.py | FelipeMachad0/python | 20b4e4264beca6914815c5c4c11ec7805d99e8d2 | [
"MIT"
] | null | null | null | n = int(input('Digite um número: '))
if n % 2 == 0:
print('Esse número é par!')
else:
print('Esse número é impar!')
| 20.666667 | 36 | 0.580645 | n = int(input('Digite um número: '))
if n % 2 == 0:
print('Esse número é par!')
else:
print('Esse número é impar!')
| true | true |
1c17c420d10e447b8397e3f87663ae0de8123bb5 | 1,491 | py | Python | 2016/day8/day8.py | e-jameson/aoc | f26196d5564a9ac8027532c276af00aaf3718c6e | [
"MIT"
] | null | null | null | 2016/day8/day8.py | e-jameson/aoc | f26196d5564a9ac8027532c276af00aaf3718c6e | [
"MIT"
] | null | null | null | 2016/day8/day8.py | e-jameson/aoc | f26196d5564a9ac8027532c276af00aaf3718c6e | [
"MIT"
] | null | null | null | from helpers import as_list
lines = as_list('2016/day8/input.txt')
# lines = as_list('2016/day8/example-input.txt')
coords = {}
max_row = 6
max_col = 50
def do_command(line):
if line.startswith('rect'):
line = line.split()[1]
i, j = line.split('x')
for x in range(int(j)):
f... | 26.625 | 54 | 0.503689 | from helpers import as_list
lines = as_list('2016/day8/input.txt')
coords = {}
max_row = 6
max_col = 50
def do_command(line):
if line.startswith('rect'):
line = line.split()[1]
i, j = line.split('x')
for x in range(int(j)):
for y in range(int(i)):
coords[(x,... | true | true |
1c17c5429bc419021ed97894320f5b4f6b22c96d | 1,934 | py | Python | bundle-workflow/src/ci_workflow/ci_args.py | qreshi/opensearch-build | ed0f26a7f80562d16793ee899fae761a23ce6361 | [
"Apache-2.0"
] | null | null | null | bundle-workflow/src/ci_workflow/ci_args.py | qreshi/opensearch-build | ed0f26a7f80562d16793ee899fae761a23ce6361 | [
"Apache-2.0"
] | null | null | null | bundle-workflow/src/ci_workflow/ci_args.py | qreshi/opensearch-build | ed0f26a7f80562d16793ee899fae761a23ce6361 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import argparse
import logging
import sys
class CiArgs:
manifest: str
snapshot: bool
def __init__(self):
... | 28.441176 | 77 | 0.52637 |
import argparse
import logging
import sys
class CiArgs:
manifest: str
snapshot: bool
def __init__(self):
parser = argparse.ArgumentParser(
description="Sanity test the OpenSearch Bundle"
)
parser.add_argument(
"manifest", type=argparse.FileType("r"), help=... | true | true |
1c17c67dfd0d6cf343459e73c45bd31e621bdcd3 | 4,009 | py | Python | endpoints/bookstore-grpc/bookstore_server.py | carsonwyuen/Vision-Assingment | 80bdcdcc146e885f5c4a15490671f427dc23c98b | [
"Apache-2.0"
] | null | null | null | endpoints/bookstore-grpc/bookstore_server.py | carsonwyuen/Vision-Assingment | 80bdcdcc146e885f5c4a15490671f427dc23c98b | [
"Apache-2.0"
] | null | null | null | endpoints/bookstore-grpc/bookstore_server.py | carsonwyuen/Vision-Assingment | 80bdcdcc146e885f5c4a15490671f427dc23c98b | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.566929 | 74 | 0.690197 |
import argparse
import time
from google.protobuf import struct_pb2
from generated_pb2 import bookstore_pb2
import bookstore
import status
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
class BookstoreServicer(bookstore_pb2.BetaBookstoreServicer):
def __init__(self, store):
self._store = store
def ListShelve... | true | true |
1c17c6ccb04038acfe49347276c51d188abc4e67 | 4,474 | py | Python | qtensor/OpFactory.py | marwahaha/QTensor | 936d078825a6418f9d32d2c176332422d8a4c137 | [
"BSD-3-Clause"
] | 20 | 2020-09-08T20:32:44.000Z | 2022-03-18T11:27:57.000Z | qtensor/OpFactory.py | marwahaha/QTensor | 936d078825a6418f9d32d2c176332422d8a4c137 | [
"BSD-3-Clause"
] | 21 | 2020-10-09T04:44:48.000Z | 2021-10-05T03:32:35.000Z | qtensor/OpFactory.py | marwahaha/QTensor | 936d078825a6418f9d32d2c176332422d8a4c137 | [
"BSD-3-Clause"
] | 4 | 2020-12-18T01:37:10.000Z | 2021-07-26T21:24:20.000Z | import cirq
import qtree
# Qiskit >=0.19
#import qiskit.circuit.library as qiskit_lib
#qiskit_lib = qtensor.tools.LasyModule('qiskit.extensions.standard')
from qtensor.tools.lazy_import import qiskit
from qtensor.tools.lazy_import import qiskit_lib
import numpy as np
class OpFactory:
pass
class CirqFactory:
... | 24.855556 | 130 | 0.644837 | import cirq
import qtree
from qtensor.tools.lazy_import import qiskit
from qtensor.tools.lazy_import import qiskit_lib
import numpy as np
class OpFactory:
pass
class CirqFactory:
H=cirq.H
cX=cirq.CX
Z=cirq.Z
X=cirq.X
@staticmethod
def ZPhase(x, alpha):
return cirq.ZPowGate(expone... | true | true |
1c17c82e42b0c22f7e5a49b764e912cce592f1be | 2,094 | py | Python | users/user.py | kaybarenz/RikiTikiTavi | c86568bbdd1216ffe3ecb349638f36142a8a7e7f | [
"BSD-3-Clause"
] | null | null | null | users/user.py | kaybarenz/RikiTikiTavi | c86568bbdd1216ffe3ecb349638f36142a8a7e7f | [
"BSD-3-Clause"
] | null | null | null | users/user.py | kaybarenz/RikiTikiTavi | c86568bbdd1216ffe3ecb349638f36142a8a7e7f | [
"BSD-3-Clause"
] | null | null | null | import binascii
import hashlib
import os
class User(object):
def __init__(self, manager, user_id, data):
self.manager = manager
self.id = user_id
self.data = data
def get(self, option):
return self.data.get(option)
def set(self, option, value):
self.data[option] =... | 29.083333 | 76 | 0.643744 | import binascii
import hashlib
import os
class User(object):
def __init__(self, manager, user_id, data):
self.manager = manager
self.id = user_id
self.data = data
def get(self, option):
return self.data.get(option)
def set(self, option, value):
self.data[option] =... | true | true |
1c17c97defa5415d60bf026acf3b93f9fc4f8c0d | 1,355 | py | Python | examples/expe_eigvals/expe_rayleigh.py | idc9/andersoncd | af2123b241e5f82f7c51b2bbf5196fb02723b582 | [
"BSD-3-Clause"
] | null | null | null | examples/expe_eigvals/expe_rayleigh.py | idc9/andersoncd | af2123b241e5f82f7c51b2bbf5196fb02723b582 | [
"BSD-3-Clause"
] | null | null | null | examples/expe_eigvals/expe_rayleigh.py | idc9/andersoncd | af2123b241e5f82f7c51b2bbf5196fb02723b582 | [
"BSD-3-Clause"
] | null | null | null | import pandas
import matplotlib.pyplot as plt
from andersoncd.plot_utils import configure_plt
configure_plt()
datasets = [
"gina_agnostic", "rcv1.binary", "real-sim", "news20.binary"]
dataset_title = {}
dataset_title["leukemia"] = "leukemia"
dataset_title["gina_agnostic"] = "gina agnostic"
dataset_title["hiva... | 28.829787 | 79 | 0.658303 | import pandas
import matplotlib.pyplot as plt
from andersoncd.plot_utils import configure_plt
configure_plt()
datasets = [
"gina_agnostic", "rcv1.binary", "real-sim", "news20.binary"]
dataset_title = {}
dataset_title["leukemia"] = "leukemia"
dataset_title["gina_agnostic"] = "gina agnostic"
dataset_title["hiva... | true | true |
1c17ca9e39138083f33828243481e5992cc9f6af | 3,589 | py | Python | imcsdk/mometa/bios/BiosVfOutOfBandMgmtPort.py | ecoen66/imcsdk | b10eaa926a5ee57cea7182ae0adc8dd1c818b0ab | [
"Apache-2.0"
] | 31 | 2016-06-14T07:23:59.000Z | 2021-09-12T17:17:26.000Z | imcsdk/mometa/bios/BiosVfOutOfBandMgmtPort.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 109 | 2016-05-25T03:56:56.000Z | 2021-10-18T02:58:12.000Z | imcsdk/mometa/bios/BiosVfOutOfBandMgmtPort.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 67 | 2016-05-17T05:53:56.000Z | 2022-03-24T15:52:53.000Z | """This module contains the general information for BiosVfOutOfBandMgmtPort ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfOutOfBandMgmtPortConsts:
VP_OUT_OF_BAND_MGMT_PORT_DISABLED = "Disabled"
VP_OUT_OF_B... | 48.5 | 265 | 0.649485 |
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfOutOfBandMgmtPortConsts:
VP_OUT_OF_BAND_MGMT_PORT_DISABLED = "Disabled"
VP_OUT_OF_BAND_MGMT_PORT_ENABLED = "Enabled"
_VP_OUT_OF_BAND_MGMT_PORT_DISABLED = "disabled"
_VP_... | true | true |
1c17cabb9206f79de0a423cfbbffe7ac7a046dbf | 82 | py | Python | hbot_strategy_dsl/__init__.py | klpanagi/hbot-strategy-dsl | ff16271e4ec521830891a1a9752e5f1c523068dc | [
"MIT"
] | null | null | null | hbot_strategy_dsl/__init__.py | klpanagi/hbot-strategy-dsl | ff16271e4ec521830891a1a9752e5f1c523068dc | [
"MIT"
] | null | null | null | hbot_strategy_dsl/__init__.py | klpanagi/hbot-strategy-dsl | ff16271e4ec521830891a1a9752e5f1c523068dc | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
from .language import _language as language, get_metamodel
| 20.5 | 58 | 0.780488 | __version__ = "0.1.0"
from .language import _language as language, get_metamodel
| true | true |
1c17cafcb464e68c8ccd15f1ae977851a4ab69ac | 30,288 | py | Python | thingsboard_gateway/connectors/can/can_connector.py | oliver225/thingsboard-gateway | 767a40b249176e3d9a9245499e76af067bdd9278 | [
"Apache-2.0"
] | 1 | 2020-05-10T15:46:23.000Z | 2020-05-10T15:46:23.000Z | thingsboard_gateway/connectors/can/can_connector.py | oliver225/thingsboard-gateway | 767a40b249176e3d9a9245499e76af067bdd9278 | [
"Apache-2.0"
] | null | null | null | thingsboard_gateway/connectors/can/can_connector.py | oliver225/thingsboard-gateway | 767a40b249176e3d9a9245499e76af067bdd9278 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020. ThingsBoard
#
# 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 ... | 49.089141 | 121 | 0.542987 |
import re
import sched
import time
from threading import Thread
from copy import copy
from random import choice
from string import ascii_lowercase
from thingsboard_gateway.tb_utility.tb_utility import TBUtility
try:
from can import Notifier, BufferedReader, Message, CanError, ThreadSafeBus
except ImportError:
... | true | true |
1c17cb835bd6f723ac82ece5153ce00551c405b2 | 6,409 | py | Python | tests/helpers/__init__.py | spartanbits/gitflow | 1732fe1c344019e54447ad0d38eb0ef5517e30d5 | [
"BSD-3-Clause"
] | null | null | null | tests/helpers/__init__.py | spartanbits/gitflow | 1732fe1c344019e54447ad0d38eb0ef5517e30d5 | [
"BSD-3-Clause"
] | 1 | 2017-11-07T13:04:04.000Z | 2017-11-07T13:04:04.000Z | tests/helpers/__init__.py | spartanbits/gitflow | 1732fe1c344019e54447ad0d38eb0ef5517e30d5 | [
"BSD-3-Clause"
] | null | null | null | #
# This file is part of `gitflow`.
# Copyright (c) 2010-2011 Vincent Driessen
# Copyright (c) 2012 Hartmut Goebel
# Distributed under a BSD-like license. For full terms see the file LICENSE.txt
#
import os
import shutil
import tempfile
from functools import wraps
from unittest2 import TestCase
from git import Repo
... | 32.866667 | 80 | 0.633952 |
import os
import shutil
import tempfile
from functools import wraps
from unittest2 import TestCase
from git import Repo
__copyright__ = "2010-2011 Vincent Driessen; 2012 Hartmut Goebel"
__license__ = "BSD"
def sandboxed(f):
@wraps(f)
def _inner(self, *args, **kwargs):
assert isinstance(self, TestCas... | true | true |
1c17cb9fc2dfdefddd13d84650d8bf114a3e5d46 | 408 | py | Python | Python/B2031.py | Epoch1017/LintCode-Shared-Solutions | d1559ef96917c4255e1ce2cf25ef17edec596ac3 | [
"CC0-1.0"
] | null | null | null | Python/B2031.py | Epoch1017/LintCode-Shared-Solutions | d1559ef96917c4255e1ce2cf25ef17edec596ac3 | [
"CC0-1.0"
] | null | null | null | Python/B2031.py | Epoch1017/LintCode-Shared-Solutions | d1559ef96917c4255e1ce2cf25ef17edec596ac3 | [
"CC0-1.0"
] | null | null | null | # B2031-计算三角形面积
# 已知三边,利用海伦公式求解面积
list = input().split()
x1 = float(list[0])
y1 = float(list[1])
x2 = float(list[2])
y2 = float(list[3])
x3 = float(list[4])
y3 = float(list[5])
a = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
b = ((x1 - x3) ** 2 + (y1 - y3) ** 2) ** 0.5
c = ((x2 - x3) ** 2 + (y2 - y3) ** 2) ** 0... | 27.2 | 45 | 0.426471 | list = input().split()
x1 = float(list[0])
y1 = float(list[1])
x2 = float(list[2])
y2 = float(list[3])
x3 = float(list[4])
y3 = float(list[5])
a = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
b = ((x1 - x3) ** 2 + (y1 - y3) ** 2) ** 0.5
c = ((x2 - x3) ** 2 + (y2 - y3) ** 2) ** 0.5
p = (a + b + c) / 2
s = (p * (p... | true | true |
1c17ccbc555fee754cbd79a5fead745de3554a88 | 3,778 | py | Python | src/apps/games/managers/rating_game_pandas_manager.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | null | null | null | src/apps/games/managers/rating_game_pandas_manager.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | null | null | null | src/apps/games/managers/rating_game_pandas_manager.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | null | null | null | import logging
import pandas
from django.db.models import Manager
from django_pandas.io import read_frame
from datetime import datetime, timedelta
from django.utils import timezone
from src.apps.games.managers.rating_game_pandas_queryset import RatingGamePandasQuerySet
from src.apps.runs.models import Run
logger = lo... | 44.447059 | 104 | 0.573055 | import logging
import pandas
from django.db.models import Manager
from django_pandas.io import read_frame
from datetime import datetime, timedelta
from django.utils import timezone
from src.apps.games.managers.rating_game_pandas_queryset import RatingGamePandasQuerySet
from src.apps.runs.models import Run
logger = lo... | true | true |
1c17ce2eb5ef175a1c74946a7277b99333372f3e | 6,298 | py | Python | test/functional/rpc_txoutproof.py | devcoin/devcoin | a5a65936e31a63041434f3fce31270c518d44ebc | [
"MIT"
] | null | null | null | test/functional/rpc_txoutproof.py | devcoin/devcoin | a5a65936e31a63041434f3fce31270c518d44ebc | [
"MIT"
] | null | null | null | test/functional/rpc_txoutproof.py | devcoin/devcoin | a5a65936e31a63041434f3fce31270c518d44ebc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core and Devcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test gettxoutproof and verifytxoutproof RPCs."""
from test_framework.blocktools impor... | 54.293103 | 259 | 0.711496 |
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.messages import (
CMerkleBlock,
from_hex,
)
from test_framework.test_framework import DevcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
from test_framework.wallet import MiniWallet
... | true | true |
1c17cf81aeb5bd5b0be167961e67489da6069a9e | 3,899 | py | Python | DeepLearningEnginesCode/Python/Ch02_LinearNetwork/main.py | PlanetG3/ArtificialIntelligenceEngines | 77667d499ffd57a745e8eb58877c557d807c95c3 | [
"MIT"
] | 49 | 2019-04-08T06:31:11.000Z | 2022-03-11T15:01:25.000Z | DeepLearningEnginesCode/Python/Ch02_LinearNetwork/main.py | PlanetG3/ArtificialIntelligenceEngines | 77667d499ffd57a745e8eb58877c557d807c95c3 | [
"MIT"
] | 1 | 2019-12-08T11:31:06.000Z | 2019-12-08T11:31:06.000Z | DeepLearningEnginesCode/Python/Ch02_LinearNetwork/main.py | PlanetG3/ArtificialIntelligenceEngines | 77667d499ffd57a745e8eb58877c557d807c95c3 | [
"MIT"
] | 11 | 2019-05-07T15:49:15.000Z | 2020-08-21T05:13:30.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Linear associative net.
"""
import numpy as np
# use pylab for ploting.
import pylab as pl
########## Define class MLP ##########
class LinearNetwork():
########## Define Methods for LinearNetwork class ##########
# Initialize network topology
def __... | 28.253623 | 86 | 0.589895 |
import numpy as np
import pylab as pl
class LinearNetwork():
def __init__(self,nInput,nOutput):
self.nInput = nInput
self.nOutput = nOutput
self.W = np.random.rand(self.nOutput,self.nInput+1)
self.dw = ... | true | true |
1c17d00f4b9ae4599d7f67306287a54577369afd | 193 | py | Python | treys/util/io.py | CDRPico/treys | b452565c9b386ad35c8eb108b62a9020834dc3b9 | [
"MIT"
] | 3 | 2019-10-04T14:36:51.000Z | 2022-02-12T00:21:26.000Z | treys/util/io.py | CDRPico/treys | b452565c9b386ad35c8eb108b62a9020834dc3b9 | [
"MIT"
] | null | null | null | treys/util/io.py | CDRPico/treys | b452565c9b386ad35c8eb108b62a9020834dc3b9 | [
"MIT"
] | 6 | 2018-11-11T09:19:13.000Z | 2021-05-31T18:12:08.000Z |
def write_table(table, filepath):
"""Writes a lookup table to a file."""
with open(filepath, 'wt') as f:
for k,v in table.items():
f.write(str(k)+","+str(v)+'\n')
| 24.125 | 43 | 0.544041 |
def write_table(table, filepath):
with open(filepath, 'wt') as f:
for k,v in table.items():
f.write(str(k)+","+str(v)+'\n')
| true | true |
1c17d097ed98f2ba69412b36665e654438cd824a | 69,284 | py | Python | adam/language_specific/chinese/chinese_language_generator.py | Tubbz-alt/adam | 91f392f2529a98cd50c095a18769ae4b55ce4292 | [
"MIT"
] | 1 | 2021-04-26T23:59:57.000Z | 2021-04-26T23:59:57.000Z | adam/language_specific/chinese/chinese_language_generator.py | Tubbz-alt/adam | 91f392f2529a98cd50c095a18769ae4b55ce4292 | [
"MIT"
] | null | null | null | adam/language_specific/chinese/chinese_language_generator.py | Tubbz-alt/adam | 91f392f2529a98cd50c095a18769ae4b55ce4292 | [
"MIT"
] | null | null | null | import collections
from itertools import chain
from typing import Iterable, List, Mapping, MutableMapping, Optional, Tuple, Union, cast
from attr import Factory, attrib, attrs
from attr.validators import instance_of
from immutablecollections import ImmutableSet, immutableset, immutablesetmultidict
from more_itertools i... | 47.914246 | 183 | 0.548669 | import collections
from itertools import chain
from typing import Iterable, List, Mapping, MutableMapping, Optional, Tuple, Union, cast
from attr import Factory, attrib, attrs
from attr.validators import instance_of
from immutablecollections import ImmutableSet, immutableset, immutablesetmultidict
from more_itertools i... | true | true |
1c17d17dcecc392effc6afcdc3bb5ef438777b55 | 7,190 | py | Python | concrete/cfg/scales/cm_rcnn_10164_s1.py | forestriveral/mmdetection-for-concrete | 9e6573947b3541003e796190bad207f6d9f002de | [
"Apache-2.0"
] | null | null | null | concrete/cfg/scales/cm_rcnn_10164_s1.py | forestriveral/mmdetection-for-concrete | 9e6573947b3541003e796190bad207f6d9f002de | [
"Apache-2.0"
] | null | null | null | concrete/cfg/scales/cm_rcnn_10164_s1.py | forestriveral/mmdetection-for-concrete | 9e6573947b3541003e796190bad207f6d9f002de | [
"Apache-2.0"
] | 1 | 2021-08-10T09:07:01.000Z | 2021-08-10T09:07:01.000Z | # model settings
model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='... | 30.083682 | 95 | 0.542281 | model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
ne... | true | true |
1c17d1a795ad8df50e9817d4e3cd96d147ea8e45 | 6,313 | py | Python | homeassistant/components/notify/__init__.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 4 | 2019-05-14T20:33:43.000Z | 2021-09-25T14:56:08.000Z | homeassistant/components/notify/__init__.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/notify/__init__.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | """
Provides functionality to notify people.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/notify/
"""
import asyncio
import logging
import os
from functools import partial
import voluptuous as vol
from homeassistant.setup import async_prepare_setup_... | 31.723618 | 78 | 0.656423 | import asyncio
import logging
import os
from functools import partial
import voluptuous as vol
from homeassistant.setup import async_prepare_setup_platform
from homeassistant.exceptions import HomeAssistantError
from homeassistant.loader import bind_hass
import homeassistant.helpers.config_validation as cv
from homea... | true | true |
1c17d2c73a14cbc31cffdff7cc0488b04ecc32a0 | 11,973 | py | Python | tests/integration/test_non_user_endpoints.py | Masrepus/spotipy | 68b974f62f1d8a1d885519251f8b58f76bf78bc0 | [
"MIT"
] | null | null | null | tests/integration/test_non_user_endpoints.py | Masrepus/spotipy | 68b974f62f1d8a1d885519251f8b58f76bf78bc0 | [
"MIT"
] | null | null | null | tests/integration/test_non_user_endpoints.py | Masrepus/spotipy | 68b974f62f1d8a1d885519251f8b58f76bf78bc0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from spotipy import (
Spotify,
SpotifyClientCredentials,
SpotifyException
)
import spotipy
import unittest
import requests
class AuthTestSpotipy(unittest.TestCase):
"""
These tests require client authentication - provide client credentials
using the following environme... | 38.873377 | 93 | 0.653637 |
from spotipy import (
Spotify,
SpotifyClientCredentials,
SpotifyException
)
import spotipy
import unittest
import requests
class AuthTestSpotipy(unittest.TestCase):
playlist = "spotify:user:plamere:playlist:2oCEWyyAPbZp9xhVSxZavx"
four_tracks = ["spotify:track:6RtPijgfPKROxEzTHNRiDp",
... | true | true |
1c17d2e58447651e5e5c191d87e644e227970333 | 11,295 | py | Python | ee/clickhouse/queries/experiments/funnel_experiment_result.py | msnitish/posthog | cb86113f568e72eedcb64b5fd00c313d21e72f90 | [
"MIT"
] | null | null | null | ee/clickhouse/queries/experiments/funnel_experiment_result.py | msnitish/posthog | cb86113f568e72eedcb64b5fd00c313d21e72f90 | [
"MIT"
] | null | null | null | ee/clickhouse/queries/experiments/funnel_experiment_result.py | msnitish/posthog | cb86113f568e72eedcb64b5fd00c313d21e72f90 | [
"MIT"
] | null | null | null | from dataclasses import asdict, dataclass
from datetime import datetime
from typing import List, Optional, Tuple, Type
from numpy.random import default_rng
from rest_framework.exceptions import ValidationError
from ee.clickhouse.queries.experiments import (
CONTROL_VARIANT_KEY,
FF_DISTRIBUTION_THRESHOLD,
... | 40.629496 | 144 | 0.695883 | from dataclasses import asdict, dataclass
from datetime import datetime
from typing import List, Optional, Tuple, Type
from numpy.random import default_rng
from rest_framework.exceptions import ValidationError
from ee.clickhouse.queries.experiments import (
CONTROL_VARIANT_KEY,
FF_DISTRIBUTION_THRESHOLD,
... | true | true |
1c17d31dbab36186439cf5f9ea72c2ef89a71e52 | 5,938 | py | Python | examples/demo/gloo/galaxy.py | 3DAlgoLab/vispy | 91972307cf336674aad58198fb26b9e46f8f9ca1 | [
"BSD-3-Clause"
] | 2,617 | 2015-01-02T07:52:18.000Z | 2022-03-29T19:31:15.000Z | examples/demo/gloo/galaxy.py | 3DAlgoLab/vispy | 91972307cf336674aad58198fb26b9e46f8f9ca1 | [
"BSD-3-Clause"
] | 1,674 | 2015-01-01T00:36:08.000Z | 2022-03-31T19:35:56.000Z | examples/demo/gloo/galaxy.py | 3DAlgoLab/vispy | 91972307cf336674aad58198fb26b9e46f8f9ca1 | [
"BSD-3-Clause"
] | 719 | 2015-01-10T14:25:00.000Z | 2022-03-02T13:24:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 30
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Just a very fake galaxy.
Astronomers and cosmologists will kill me !
"""
import numpy as np
from vispy import gl... | 30.295918 | 77 | 0.520209 |
import numpy as np
from vispy import gloo
from vispy import app
from vispy.util.transforms import perspective, translate, rotate
def make_arm(n, angle):
R = np.linspace(10, 450 + 50 * np.random.uniform(.5, 1.), n)
R += 40 * np.random.normal(0, 2., n) * np.linspace(1, .1, n)
T = angle + np.linspace(0, ... | true | true |
1c17d360cc01df4979e121541260be121e6e9f57 | 2,824 | py | Python | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_storage/v2018_07_01/models/immutability_policy_py3.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_storage/v2018_07_01/models/immutability_policy_py3.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_storage/v2018_07_01/models/immutability_policy_py3.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2021-07-28T14:50:54.000Z | 2021-07-28T14:50:54.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 ... | 42.149254 | 139 | 0.656161 |
from .azure_entity_resource_py3 import AzureEntityResource
class ImmutabilityPolicy(AzureEntityResource):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
'immutability_period_since_creation_in_d... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.