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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c191b7aee06798a04d766bb8f6cde4668aeab91 | 1,072 | py | Python | Packs/CommonScripts/Scripts/RegexExtractAll/RegexExtractAll.py | SergeBakharev/content | d66cc274f5bf6f9f0e9ed7e4df1af7b6f305aacf | [
"MIT"
] | 2 | 2020-07-27T10:35:41.000Z | 2020-12-14T15:44:18.000Z | Packs/CommonScripts/Scripts/RegexExtractAll/RegexExtractAll.py | SergeBakharev/content | d66cc274f5bf6f9f0e9ed7e4df1af7b6f305aacf | [
"MIT"
] | 48 | 2022-03-08T13:45:00.000Z | 2022-03-31T14:32:05.000Z | Packs/CommonScripts/Scripts/RegexExtractAll/RegexExtractAll.py | SergeBakharev/content | d66cc274f5bf6f9f0e9ed7e4df1af7b6f305aacf | [
"MIT"
] | 2 | 2020-07-15T06:41:52.000Z | 2020-07-19T18:45:23.000Z | import demistomock as demisto
from CommonServerPython import *
import regex
def main():
match_target = demisto.args()['value']
re_flags = regex.V1
error_if_no_match = False
try:
if demisto.args()['multi_line'].lower() == 'true':
re_flags |= regex.MULTILINE
if demisto.ar... | 23.822222 | 88 | 0.608209 | import demistomock as demisto
from CommonServerPython import *
import regex
def main():
match_target = demisto.args()['value']
re_flags = regex.V1
error_if_no_match = False
try:
if demisto.args()['multi_line'].lower() == 'true':
re_flags |= regex.MULTILINE
if demisto.ar... | true | true |
1c191cc5717eb9f298a8046b8800bc07081ebd74 | 2,769 | py | Python | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyStorageSetAttributeRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyStorageSetAttributeRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyStorageSetAttributeRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.050633 | 83 | 0.776454 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkecs.endpoint import endpoint_data
class ModifyStorageSetAttributeRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Ecs', '2014-05-26', 'ModifyStorageSetAttribute','ecs')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map"... | true | true |
1c191d75a34d7022503f78a1a2194408604f319f | 4,674 | py | Python | server/opendp_project/urls.py | opendp/opendp-ux | e9f591f1722f8aece022c790506381f13a728305 | [
"MIT"
] | 6 | 2021-05-25T18:50:58.000Z | 2022-03-23T19:52:15.000Z | server/opendp_project/urls.py | opendp/dpcreator | 6ba3c58ecdcd81ca1f4533a14ce7604eccf6a646 | [
"MIT"
] | 298 | 2021-05-19T17:34:09.000Z | 2022-03-29T18:45:22.000Z | server/opendp_project/urls.py | opendp/dpcreator | 6ba3c58ecdcd81ca1f4533a14ce7604eccf6a646 | [
"MIT"
] | null | null | null | """opendp_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 46.74 | 104 | 0.774069 | from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import path, include
from django.views.generic import TemplateView, RedirectView
from rest_framework import routers, serializers
from o... | true | true |
1c191e709cb8443f54020d3c20059303a6697d3d | 1,555 | py | Python | servo/data/ryu_p0_loc.py | mmind/servo-hdctools | c7d50190837497dafc45f6efe18bf01d6e70cfd2 | [
"BSD-3-Clause"
] | 2 | 2019-09-25T22:44:39.000Z | 2020-07-26T22:29:20.000Z | servo/data/ryu_p0_loc.py | mmind/servo-hdctools | c7d50190837497dafc45f6efe18bf01d6e70cfd2 | [
"BSD-3-Clause"
] | null | null | null | servo/data/ryu_p0_loc.py | mmind/servo-hdctools | c7d50190837497dafc45f6efe18bf01d6e70cfd2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for use with servo INA adapter board. If measuring via servo V1 this can just
# be ignored. clobber_ok added if user wishes to include servo_loc.xml
#... | 40.921053 | 80 | 0.587781 |
inline = """
<map>
<name>adc_mux</name>
<doc>valid mux values for DUT's two banks of INA219 off PCA9540
ADCs</doc>
<params clobber_ok="" none="0" bank0="4" bank1="5"></params>
</map>
<control>
<name>adc_mux</name>
<doc>4 to 1 mux to steer remote i2c i2c_mux:rem to two sets of
16 INA21... | true | true |
1c191ed61070a0714029bcc5f16cebf1ad93771d | 1,863 | py | Python | fastflix/encoders/gif/command_builder.py | benedicteb/FastFlix | 45208b7c74a21758cb528c949422effcd0c01f44 | [
"MIT"
] | null | null | null | fastflix/encoders/gif/command_builder.py | benedicteb/FastFlix | 45208b7c74a21758cb528c949422effcd0c01f44 | [
"MIT"
] | null | null | null | fastflix/encoders/gif/command_builder.py | benedicteb/FastFlix | 45208b7c74a21758cb528c949422effcd0c01f44 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import secrets
from dataclasses import asdict
from fastflix.encoders.common.helpers import Command, generate_filters
from fastflix.models.encode import GIFSettings
from fastflix.models.fastflix import FastFlix
def build(fastflix: FastFlix):
settings: GIFSettings = fastflix.current_video.v... | 40.5 | 131 | 0.696189 | import secrets
from dataclasses import asdict
from fastflix.encoders.common.helpers import Command, generate_filters
from fastflix.models.encode import GIFSettings
from fastflix.models.fastflix import FastFlix
def build(fastflix: FastFlix):
settings: GIFSettings = fastflix.current_video.video_settings.video_enco... | true | true |
1c191f9101773bb9a80619b4fc46179d344fdf11 | 3,540 | py | Python | src/main.py | MarShin/pymarl2 | b6598cbd3ca044564270b6cdb1bb495173af7f4c | [
"Apache-2.0"
] | 1 | 2021-06-19T23:58:03.000Z | 2021-06-19T23:58:03.000Z | src/main.py | MarShin/pymarl2 | b6598cbd3ca044564270b6cdb1bb495173af7f4c | [
"Apache-2.0"
] | null | null | null | src/main.py | MarShin/pymarl2 | b6598cbd3ca044564270b6cdb1bb495173af7f4c | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
import collections
from os.path import dirname, abspath, join
from copy import deepcopy
from sacred import Experiment, SETTINGS
from sacred.observers import FileStorageObserver
from sacred.utils import apply_backspaces_and_linefeeds
import sys
import torch as th
from utils.logging import ge... | 31.327434 | 121 | 0.662147 | import numpy as np
import os
import collections
from os.path import dirname, abspath, join
from copy import deepcopy
from sacred import Experiment, SETTINGS
from sacred.observers import FileStorageObserver
from sacred.utils import apply_backspaces_and_linefeeds
import sys
import torch as th
from utils.logging import ge... | true | true |
1c191fff6e84d006377ff367fa05254615a8b53b | 1,420 | py | Python | proc_TED_1_MAY20171_original.py | riceissa/total-economy-database | c0ecf87cbbb4fb4c352606c9a2841b6fea4245bf | [
"CC0-1.0"
] | null | null | null | proc_TED_1_MAY20171_original.py | riceissa/total-economy-database | c0ecf87cbbb4fb4c352606c9a2841b6fea4245bf | [
"CC0-1.0"
] | null | null | null | proc_TED_1_MAY20171_original.py | riceissa/total-economy-database | c0ecf87cbbb4fb4c352606c9a2841b6fea4245bf | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
import csv
import sys
import re
from devec_sql_common import *
insert_line = "insert into data(region, odate, database_url, data_retrieval_method, metric, units, value, notes) values"
count = 0
first = True
with open("../total-economy-database-data/TED_1_MAY20171_original.csv", newline='') a... | 34.634146 | 143 | 0.511268 |
import csv
import sys
import re
from devec_sql_common import *
insert_line = "insert into data(region, odate, database_url, data_retrieval_method, metric, units, value, notes) values"
count = 0
first = True
with open("../total-economy-database-data/TED_1_MAY20171_original.csv", newline='') as f:
reader = csv.D... | true | true |
1c192072bf3d1521972afeac7f45d38e94f4477e | 11,573 | py | Python | st2api/st2api/controllers/v1/packs.py | ekhavana/st2 | 2b47b0e317a2dfd7d92d63ec6dcf706493148890 | [
"Apache-2.0"
] | null | null | null | st2api/st2api/controllers/v1/packs.py | ekhavana/st2 | 2b47b0e317a2dfd7d92d63ec6dcf706493148890 | [
"Apache-2.0"
] | null | null | null | st2api/st2api/controllers/v1/packs.py | ekhavana/st2 | 2b47b0e317a2dfd7d92d63ec6dcf706493148890 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 38.194719 | 99 | 0.636827 |
import re
from collections import defaultdict
from collections import OrderedDict
import six
import st2common
from st2common import log as logging
from st2common.bootstrap.triggersregistrar import TriggersRegistrar
from st2common.bootstrap.sensorsregistrar import SensorsRegistrar
from st2common.bootstrap.actionsreg... | true | true |
1c192116a8a1a788542823542407d827330a0cbb | 539 | py | Python | section03/lecture015.py | JorijnInEemland/MyPythonProjects | 9c440c2ddc133f9b5930291414ecd903bbc1be1c | [
"Unlicense"
] | null | null | null | section03/lecture015.py | JorijnInEemland/MyPythonProjects | 9c440c2ddc133f9b5930291414ecd903bbc1be1c | [
"Unlicense"
] | null | null | null | section03/lecture015.py | JorijnInEemland/MyPythonProjects | 9c440c2ddc133f9b5930291414ecd903bbc1be1c | [
"Unlicense"
] | 1 | 2020-02-28T17:06:07.000Z | 2020-02-28T17:06:07.000Z | my_string = "Hello World"
print(my_string[0])
print(my_string[8])
print(my_string[-3]) # with negative indexing, -1 is the last character
alphabet = "abcdef"
print(alphabet[3:]) # the first element is 0, so the fourth element is 3
print(alphabet[:3]) # remember slicing is up to but not including the stop index
print(a... | 44.916667 | 82 | 0.736549 | my_string = "Hello World"
print(my_string[0])
print(my_string[8])
print(my_string[-3])
alphabet = "abcdef"
print(alphabet[3:]) print(alphabet[:3]) print(alphabet[2:4]) print(alphabet[::2]) print(alphabet[::-1]) | true | true |
1c1922094e18d1a1b11b2e1d31854eadee3eb883 | 3,842 | py | Python | scripts/up_down_sampling.py | Nico-Curti/PhDthesis | 234b38234eb15870056f71c4f33946d8aed05aae | [
"MIT"
] | 3 | 2020-03-17T14:01:31.000Z | 2021-10-04T10:21:41.000Z | scripts/up_down_sampling.py | Nico-Curti/PhDthesis | 234b38234eb15870056f71c4f33946d8aed05aae | [
"MIT"
] | null | null | null | scripts/up_down_sampling.py | Nico-Curti/PhDthesis | 234b38234eb15870056f71c4f33946d8aed05aae | [
"MIT"
] | 4 | 2020-05-09T13:17:47.000Z | 2022-03-09T15:16:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import cv2
import pylab as plt
from matplotlib import gridspec
__author__ = ['Nico Curti']
__email__ = ['nico.curti2@unibo.it']
__package__ = 'Upsampling/Downsampling example'
... | 30.015625 | 98 | 0.582249 |
from __future__ import division
from __future__ import print_function
import os
import cv2
import pylab as plt
from matplotlib import gridspec
__author__ = ['Nico Curti']
__email__ = ['nico.curti2@unibo.it']
__package__ = 'Upsampling/Downsampling example'
if __name__ == '__main__':
filename = ... | true | true |
1c1922bf5687929cecc6e2702b87e08e3af3fc20 | 1,897 | py | Python | CSCI3180/Assignment 3/python_skeleton/advanced_version/AdvancedFighter.py | Arie123777/cuhkCourseWork | 355f1e560ef513f3ba9bec2e9eb35caa1f6f7107 | [
"FSFAP"
] | null | null | null | CSCI3180/Assignment 3/python_skeleton/advanced_version/AdvancedFighter.py | Arie123777/cuhkCourseWork | 355f1e560ef513f3ba9bec2e9eb35caa1f6f7107 | [
"FSFAP"
] | null | null | null | CSCI3180/Assignment 3/python_skeleton/advanced_version/AdvancedFighter.py | Arie123777/cuhkCourseWork | 355f1e560ef513f3ba9bec2e9eb35caa1f6f7107 | [
"FSFAP"
] | null | null | null | #
# CSCI3180 Principles of Programming Languages
#
# --- Declaration ---
#
# I declare that the assignment here submitted is original except for source
# material explicitly acknowledged. I also acknowledge that I am aware of
# University policy and regulations on honesty in academic work, and of the
# discipli... | 33.875 | 148 | 0.610965 |
from base_version.Fighter import Fighter
coins_to_obtain = 20
delta_attack = -1
delta_defense = -1
delta_speed = -1
class AdvancedFighter(Fighter):
def __init__(self, NO, HP, attack, defense, speed):
super(AdvancedFighter, self).__init__(NO, HP, attack, defense, speed)
self.coins = 0... | true | true |
1c19235551d2f3ae82fa360b1f14da87d6dc228c | 2,120 | py | Python | tests/req.py | ThomasDoukas/NTUA_DS | 6046734943ac714074d763caa5bc5e8c7ddece97 | [
"MIT"
] | null | null | null | tests/req.py | ThomasDoukas/NTUA_DS | 6046734943ac714074d763caa5bc5e8c7ddece97 | [
"MIT"
] | null | null | null | tests/req.py | ThomasDoukas/NTUA_DS | 6046734943ac714074d763caa5bc5e8c7ddece97 | [
"MIT"
] | 1 | 2022-03-10T19:03:15.000Z | 2022-03-10T19:03:15.000Z | import os
import requests
import pickle
import random
from argparse import ArgumentParser
from time import time
NODES = {
'1': '127.0.0.1:5000',
'2': '127.0.0.1:5001',
'3': '127.0.0.1:5002',
'4': '127.0.0.1:5003',
'5': '127.0.0.1:5004',
'6': '127.0.0.1:5005',
'7': '127.0.0.1:5006',
'8':... | 29.041096 | 124 | 0.559434 | import os
import requests
import pickle
import random
from argparse import ArgumentParser
from time import time
NODES = {
'1': '127.0.0.1:5000',
'2': '127.0.0.1:5001',
'3': '127.0.0.1:5002',
'4': '127.0.0.1:5003',
'5': '127.0.0.1:5004',
'6': '127.0.0.1:5005',
'7': '127.0.0.1:5006',
'8':... | true | true |
1c192370792ca1a25b9f06fbb2bf9680f1342f70 | 9,022 | py | Python | test/completion/classes.py | rosslannen/jedi | b8d2757cdbe8ece6778031d0536a759b3273d15e | [
"MIT"
] | 2 | 2018-04-16T03:08:42.000Z | 2021-01-06T10:21:49.000Z | test/completion/classes.py | rosslannen/jedi | b8d2757cdbe8ece6778031d0536a759b3273d15e | [
"MIT"
] | null | null | null | test/completion/classes.py | rosslannen/jedi | b8d2757cdbe8ece6778031d0536a759b3273d15e | [
"MIT"
] | 1 | 2019-06-09T23:31:29.000Z | 2019-06-09T23:31:29.000Z | def find_class():
""" This scope is special, because its in front of TestClass """
#? ['ret']
TestClass.ret
if 1:
#? ['ret']
TestClass.ret
class FindClass():
#? []
TestClass.ret
if a:
#? []
TestClass.ret
def find_class(self):
#? ['ret']
T... | 15.582038 | 79 | 0.523609 | def find_class():
""" This scope is special, because its in front of TestClass """
TestClass.ret
if 1:
TestClass.ret
class FindClass():
TestClass.ret
if a:
TestClass.ret
def find_class(self):
TestClass.ret
if 1:
... | false | true |
1c19253d453e76175c8eb5cb90559d7d239374cc | 90 | py | Python | vnpy/api/ksgold/__init__.py | funrunskypalace/vnpy | 2d87aede685fa46278d8d3392432cc127b797926 | [
"MIT"
] | 19,529 | 2015-03-02T12:17:35.000Z | 2022-03-31T17:18:27.000Z | vnpy/api/ksgold/__init__.py | funrunskypalace/vnpy | 2d87aede685fa46278d8d3392432cc127b797926 | [
"MIT"
] | 2,186 | 2015-03-04T23:16:33.000Z | 2022-03-31T03:44:01.000Z | vnpy/api/ksgold/__init__.py | funrunskypalace/vnpy | 2d87aede685fa46278d8d3392432cc127b797926 | [
"MIT"
] | 8,276 | 2015-03-02T05:21:04.000Z | 2022-03-31T13:13:13.000Z | from .vnksgoldmd import MdApi
from .vnksgoldtd import TdApi
from .ksgold_constant import * | 30 | 30 | 0.833333 | from .vnksgoldmd import MdApi
from .vnksgoldtd import TdApi
from .ksgold_constant import * | true | true |
1c192652847b82c847977050650f6dd9bf312075 | 7,587 | py | Python | research/object_detection/core/freezable_batch_norm_test.py | baranshad/models | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | [
"Apache-2.0"
] | 3 | 2019-12-15T18:05:04.000Z | 2021-04-30T16:26:04.000Z | research/object_detection/core/freezable_batch_norm_test.py | baranshad/models | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | [
"Apache-2.0"
] | 10 | 2020-01-28T23:15:47.000Z | 2022-03-12T00:11:34.000Z | research/object_detection/core/freezable_batch_norm_test.py | baranshad/models | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | [
"Apache-2.0"
] | 5 | 2020-06-02T09:14:45.000Z | 2022-02-05T17:32:44.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.010811 | 80 | 0.63991 |
import numpy as np
import tensorflow as tf
from object_detection.core import freezable_batch_norm
class FreezableBatchNormTest(tf.test.TestCase):
def _build_model(self, training=None):
model = tf.keras.models.Sequential()
norm = freezable_batch_norm.FreezableBatchNorm(training=training,
... | true | true |
1c1926701909a78d3f1212b1cf2557d55d875cad | 2,890 | py | Python | pandera/__init__.py | pandera-dev/pandera-legacy | f36cc9befc1f83a22cf08a725285cf388e3a04fb | [
"MIT"
] | null | null | null | pandera/__init__.py | pandera-dev/pandera-legacy | f36cc9befc1f83a22cf08a725285cf388e3a04fb | [
"MIT"
] | null | null | null | pandera/__init__.py | pandera-dev/pandera-legacy | f36cc9befc1f83a22cf08a725285cf388e3a04fb | [
"MIT"
] | null | null | null | """A flexible and expressive pandas validation library."""
import platform
from pandera import external_config
from pandera.dtypes import (
Bool,
Category,
Complex,
Complex64,
Complex128,
DataType,
DateTime,
Float,
Float16,
Float32,
Float64,
Int,
Int8,
Int16,
... | 17.950311 | 72 | 0.641869 | import platform
from pandera import external_config
from pandera.dtypes import (
Bool,
Category,
Complex,
Complex64,
Complex128,
DataType,
DateTime,
Float,
Float16,
Float32,
Float64,
Int,
Int8,
Int16,
Int32,
Int64,
String,
Timedelta,
Timestamp... | true | true |
1c1926c74b00fcecd4e49a48d80cd7798c928466 | 1,644 | py | Python | _0_PipPackage/tests.py | teyrana/py_opt_talk | 7be0e5946a59d2d0af3534e94395a46fcc5afbed | [
"BSD-2-Clause"
] | null | null | null | _0_PipPackage/tests.py | teyrana/py_opt_talk | 7be0e5946a59d2d0af3534e94395a46fcc5afbed | [
"BSD-2-Clause"
] | null | null | null | _0_PipPackage/tests.py | teyrana/py_opt_talk | 7be0e5946a59d2d0af3534e94395a46fcc5afbed | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import binarytree
import unittest
class TestBinaryTree(unittest.TestCase):
def test_creation(self):
# this creates a fully-populated binary-search-tree of depth 4, on the numbers [0, 30]
root = binarytree.bst(height=4, is_perfect=True)
# DEBUG
# print(roo... | 34.978723 | 94 | 0.43674 |
import binarytree
import unittest
class TestBinaryTree(unittest.TestCase):
def test_creation(self):
root = binarytree.bst(height=4, is_perfect=True)
self.assertEqual(root.height, 4)... | true | true |
1c1927c61bf6a7d69f916ec821aeebf6db85f4f2 | 17,906 | py | Python | tests/rest_tests/test_search.py | Revfluence/clarifai-python | e235cb6282097b2a9ca3ce8876e730b2ab68c83f | [
"Apache-2.0"
] | null | null | null | tests/rest_tests/test_search.py | Revfluence/clarifai-python | e235cb6282097b2a9ca3ce8876e730b2ab68c83f | [
"Apache-2.0"
] | null | null | null | tests/rest_tests/test_search.py | Revfluence/clarifai-python | e235cb6282097b2a9ca3ce8876e730b2ab68c83f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import logging
import unittest
import uuid
import base64
import requests
import tempfile
from clarifai.rest import ClarifaiApp
from clarifai.rest import Geo, GeoPoint, GeoBox, GeoLimit
import clarifai.rest
urls = [
"https://samples.clarifai.com/metro-north.jpg",
"https://samples.... | 35.740519 | 96 | 0.671507 |
import os
import logging
import unittest
import uuid
import base64
import requests
import tempfile
from clarifai.rest import ClarifaiApp
from clarifai.rest import Geo, GeoPoint, GeoBox, GeoLimit
import clarifai.rest
urls = [
"https://samples.clarifai.com/metro-north.jpg",
"https://samples.clarifai.com/wedding.jpg... | true | true |
1c1929b21827eb06996dc584699cf00446deca1e | 13,126 | py | Python | frappe/auth.py | ebymathew5225/frappe | 880d824b77d2a6392a5d8ae9ea7db22199513c91 | [
"MIT"
] | 1 | 2019-05-21T04:55:01.000Z | 2019-05-21T04:55:01.000Z | frappe/auth.py | ebymathew5225/frappe | 880d824b77d2a6392a5d8ae9ea7db22199513c91 | [
"MIT"
] | 7 | 2020-03-24T18:15:04.000Z | 2022-02-10T20:52:45.000Z | frappe/auth.py | ebymathew5225/frappe | 880d824b77d2a6392a5d8ae9ea7db22199513c91 | [
"MIT"
] | 3 | 2019-01-11T21:34:52.000Z | 2020-03-18T07:53:09.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import datetime
from frappe import _
import frappe
import frappe.database
import frappe.utils
from frappe.utils import cint, flt, get_datetime, datetime
import frappe.utils.user
... | 33.146465 | 123 | 0.743943 |
from __future__ import unicode_literals
import datetime
from frappe import _
import frappe
import frappe.database
import frappe.utils
from frappe.utils import cint, flt, get_datetime, datetime
import frappe.utils.user
from frappe import conf
from frappe.sessions import Session, clear_sessions, delete_session
from fra... | true | true |
1c1929fbc21046809a1e05f8cd2f8cb7e7831888 | 482 | py | Python | script/run.py | noranhe/vnpy_sopt | cd6bc450b03f933fa97ca4a94bfeb8e94e0571e6 | [
"MIT"
] | 3 | 2021-06-29T03:31:21.000Z | 2022-02-14T02:44:34.000Z | script/run.py | noranhe/vnpy_sopt | cd6bc450b03f933fa97ca4a94bfeb8e94e0571e6 | [
"MIT"
] | null | null | null | script/run.py | noranhe/vnpy_sopt | cd6bc450b03f933fa97ca4a94bfeb8e94e0571e6 | [
"MIT"
] | 6 | 2021-06-30T09:03:07.000Z | 2022-03-23T09:44:21.000Z | from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy_sopt import SoptGateway
def main():
"""主入口函数"""
qapp = create_qapp()
event_engine = EventEngine()
main_engine = MainEngine(event_engine)
main_engine.add_gatew... | 20.083333 | 55 | 0.732365 | from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy_sopt import SoptGateway
def main():
qapp = create_qapp()
event_engine = EventEngine()
main_engine = MainEngine(event_engine)
main_engine.add_gateway(SoptGateway)
... | true | true |
1c192a0e2b9755f463a670b0d0c14394f7549cbc | 3,050 | py | Python | profiles_api/views.py | taylanakbas/profiles-rest-api | 31f066a6d49506b1c0799cb462deec8a8913f02d | [
"MIT"
] | null | null | null | profiles_api/views.py | taylanakbas/profiles-rest-api | 31f066a6d49506b1c0799cb462deec8a8913f02d | [
"MIT"
] | 4 | 2021-04-08T21:04:21.000Z | 2021-09-22T19:14:17.000Z | profiles_api/views.py | taylanakbas/profiles-rest-api | 31f066a6d49506b1c0799cb462deec8a8913f02d | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from profiles_api import serializers
class HelloApiView(APIView):
"""Test API View"""
serializer_class = serializers.HelloSerializer
def get(self, re... | 35.057471 | 77 | 0.609836 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from profiles_api import serializers
class HelloApiView(APIView):
serializer_class = serializers.HelloSerializer
def get(self, request, format=None):
... | true | true |
1c192b3a9144c0d664b585915b4674a8ef91d4f7 | 683 | py | Python | pyshell.py | SZLSP/reid2020NAIC | d0eaee768e0be606417a27ce5ea2b3071b5a9bc2 | [
"Apache-2.0"
] | 2 | 2021-05-12T13:36:46.000Z | 2021-08-15T10:35:08.000Z | pyshell.py | SZLSP/reid2020NAIC | d0eaee768e0be606417a27ce5ea2b3071b5a9bc2 | [
"Apache-2.0"
] | 1 | 2021-12-28T12:49:49.000Z | 2021-12-28T12:49:49.000Z | pyshell.py | SZLSP/reid2020NAIC | d0eaee768e0be606417a27ce5ea2b3071b5a9bc2 | [
"Apache-2.0"
] | null | null | null | import os
cmdtext = """
python ./tools/submit.py --config-file ./configs/NAIC/R101-ibn-arcF-cj-st-amp-gem-all-ranger2.yml --gpu-id 0 --test-iter 225599 --test-permutation
python ./tools/submit.py --config-file ./configs/NAIC/R101-ibn-arcF-cj-st-amp-gem-all-ranger2-ntl.yml --gpu-id 0 --test-iter 115199,119999,110399 -... | 48.785714 | 164 | 0.70571 | import os
cmdtext = """
python ./tools/submit.py --config-file ./configs/NAIC/R101-ibn-arcF-cj-st-amp-gem-all-ranger2.yml --gpu-id 0 --test-iter 225599 --test-permutation
python ./tools/submit.py --config-file ./configs/NAIC/R101-ibn-arcF-cj-st-amp-gem-all-ranger2-ntl.yml --gpu-id 0 --test-iter 115199,119999,110399 -... | true | true |
1c192caf8ba5f1784ad702d1756b2bd53cc82295 | 5,937 | py | Python | sdk/python/pulumi_azure_native/apimanagement/v20180101/get_api_version_set.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20180101/get_api_version_set.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20180101/get_api_version_set.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
__... | 37.10625 | 170 | 0.661277 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = [
'GetApiVersionSetResult',
'AwaitableGetApiVersionSetResult',
'get_api_version_set',
]
@pulumi.output_type
class GetApiVersionSetResult:
def _... | true | true |
1c192cf2539b791e6d7d35d1bed8f05590951ed7 | 2,450 | py | Python | .github/workflows/download_openssl.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 4,492 | 2015-01-02T23:02:52.000Z | 2022-03-31T12:59:57.000Z | .github/workflows/download_openssl.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 3,692 | 2015-01-01T03:16:56.000Z | 2022-03-31T19:20:25.000Z | .github/workflows/download_openssl.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1,155 | 2015-01-09T00:48:05.000Z | 2022-03-31T23:46:43.000Z | import io
import os
import sys
import time
import zipfile
import requests
from urllib3.util.retry import Retry
def get_response(session, url, token):
# Retry on non-502s
for i in range(5):
try:
response = session.get(
url, headers={"Authorization": "token " + token}
... | 30.625 | 76 | 0.587347 | import io
import os
import sys
import time
import zipfile
import requests
from urllib3.util.retry import Retry
def get_response(session, url, token):
for i in range(5):
try:
response = session.get(
url, headers={"Authorization": "token " + token}
)
exc... | true | true |
1c192f05a4539a24b3aa8fc4c674bbbd521926d8 | 1,090 | py | Python | test/system/auto/simple/bulkFile.py | 24601/accumulo | b32dd4906a83c065cdbd54df2c600a9e92f584af | [
"BSD-3-Clause"
] | null | null | null | test/system/auto/simple/bulkFile.py | 24601/accumulo | b32dd4906a83c065cdbd54df2c600a9e92f584af | [
"BSD-3-Clause"
] | null | null | null | test/system/auto/simple/bulkFile.py | 24601/accumulo | b32dd4906a83c065cdbd54df2c600a9e92f584af | [
"BSD-3-Clause"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 35.16129 | 74 | 0.76422 |
from JavaTest import JavaTest
import unittest
class BulkFileTest(JavaTest):
order = 21
testClass="org.apache.accumulo.test.functional.BulkFileTest"
def suite():
result = unittest.TestSuite()
result.addTest(BulkFileTest())
return result
| true | true |
1c192f214b746ba6e2a6f06e9cc146864ba5f8ce | 444 | py | Python | app/core/migrations/0006_recipe_image.py | CrownKira/recipe-app-api | b948a66f09a5aa420483f6df806ea57315f966da | [
"MIT"
] | null | null | null | app/core/migrations/0006_recipe_image.py | CrownKira/recipe-app-api | b948a66f09a5aa420483f6df806ea57315f966da | [
"MIT"
] | null | null | null | app/core/migrations/0006_recipe_image.py | CrownKira/recipe-app-api | b948a66f09a5aa420483f6df806ea57315f966da | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-05-08 10:28
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_recipe_time_minutes'),
]
operations = [
migrations.AddField(
model_name='recipe',
n... | 22.2 | 93 | 0.632883 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_recipe_time_minutes'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(... | true | true |
1c192f57b406dbadddf9f6d6ada37780188e2109 | 2,435 | py | Python | polyaxon/query/managers/experiment_group.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/query/managers/experiment_group.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/query/managers/experiment_group.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | from django.db.models import Q
from query.builder import (
ArrayCondition,
CallbackCondition,
ComparisonCondition,
DateTimeCondition,
ValueCondition
)
from query.managers.base import BaseQueryManager
from query.parser import parse_datetime_operation, parse_scalar_operation, parse_value_operation
fr... | 28.313953 | 96 | 0.634497 | from django.db.models import Q
from query.builder import (
ArrayCondition,
CallbackCondition,
ComparisonCondition,
DateTimeCondition,
ValueCondition
)
from query.managers.base import BaseQueryManager
from query.parser import parse_datetime_operation, parse_scalar_operation, parse_value_operation
fr... | true | true |
1c19304dc1c21ceeb5b6e33c14458c8870f29f98 | 2,485 | py | Python | auglichem/utils/_splitting.py | BaratiLab/AugLiChem | 37258b5ce2c653436b3e819b58d2659052d6edcc | [
"MIT"
] | 16 | 2021-12-01T06:32:41.000Z | 2022-03-26T18:11:49.000Z | auglichem/utils/_splitting.py | BaratiLab/AugLiChem | 37258b5ce2c653436b3e819b58d2659052d6edcc | [
"MIT"
] | 1 | 2022-02-14T20:59:45.000Z | 2022-02-14T20:59:45.000Z | auglichem/utils/_splitting.py | BaratiLab/AugLiChem | 37258b5ce2c653436b3e819b58d2659052d6edcc | [
"MIT"
] | null | null | null | from rdkit import Chem
from rdkit.Chem.Scaffolds.MurckoScaffold import MurckoScaffoldSmiles
import random
def random_split(dataset, valid_size, test_size, seed=None):
# Set seed
if(seed is not None):
random.seed(seed)
# Get indices
total_size = len(dataset)
indices = list(range(total_size... | 32.697368 | 84 | 0.676056 | from rdkit import Chem
from rdkit.Chem.Scaffolds.MurckoScaffold import MurckoScaffoldSmiles
import random
def random_split(dataset, valid_size, test_size, seed=None):
if(seed is not None):
random.seed(seed)
total_size = len(dataset)
indices = list(range(total_size))
random.shuffle(ind... | true | true |
1c1930c582a6512a76c5815a33bc4d77a901c237 | 543 | py | Python | manage.py | kulshreshtha19/Current-Feed | 4ec4c5030359f9ac3089dda0b16f3eb977413f71 | [
"MIT"
] | 2 | 2018-11-02T15:17:00.000Z | 2018-11-03T14:11:14.000Z | manage.py | kulshreshtha19/Current-Feed | 4ec4c5030359f9ac3089dda0b16f3eb977413f71 | [
"MIT"
] | null | null | null | manage.py | kulshreshtha19/Current-Feed | 4ec4c5030359f9ac3089dda0b16f3eb977413f71 | [
"MIT"
] | 1 | 2018-11-03T14:11:07.000Z | 2018-11-03T14:11:07.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'currentfeed.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. ... | 33.9375 | 75 | 0.688766 | import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'currentfeed.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's inst... | true | true |
1c1932616bcb466f233eea2e40d13576af553b43 | 2,416 | py | Python | test/TestModuleTemplate/test_moduletemplate.py | lverdier1/CEASIOMpy | 178d44b26ba1d9249928823c3896f7ad85d19de8 | [
"Apache-2.0"
] | null | null | null | test/TestModuleTemplate/test_moduletemplate.py | lverdier1/CEASIOMpy | 178d44b26ba1d9249928823c3896f7ad85d19de8 | [
"Apache-2.0"
] | null | null | null | test/TestModuleTemplate/test_moduletemplate.py | lverdier1/CEASIOMpy | 178d44b26ba1d9249928823c3896f7ad85d19de8 | [
"Apache-2.0"
] | null | null | null | """
CEASIOMpy: Conceptual Aircraft Design Software
Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland
Test functions for 'lib/ModuleTemplate/moduletemplate.py'
Python version: >=3.6
| Author : Aidan Jungo
| Creation: 2019-08-14
| Last modifiction: 2019-09-27
"""
#=============================================... | 27.146067 | 94 | 0.524421 |
import os
import sys
import pytest
from pytest import approx
from ceasiompy.utils.ceasiomlogger import get_logger
from ceasiompy.utils.cpacsfunctions import open_tixi, open_tigl, close_tixi, get_value
from ceasiompy.ModuleTemplate.moduletemplate import MyClass, sum_funcion, get_fuselage_scaling
log = get_logger(__... | true | true |
1c193351b312239afe58a2f11e48750fc482064d | 30,935 | py | Python | python/test/mwclient/mwclient/client.py | semplea/characters-meta | bf5a066b203648fec8658a76b79ddb3e5159b1ae | [
"MIT"
] | null | null | null | python/test/mwclient/mwclient/client.py | semplea/characters-meta | bf5a066b203648fec8658a76b79ddb3e5159b1ae | [
"MIT"
] | null | null | null | python/test/mwclient/mwclient/client.py | semplea/characters-meta | bf5a066b203648fec8658a76b79ddb3e5159b1ae | [
"MIT"
] | null | null | null | import warnings
import time
import random
import sys
import weakref
import logging
from six import text_type
import six
try:
# Python 2.7+
from collections import OrderedDict
except ImportError:
# Python 2.6
from ordereddict import OrderedDict
try:
import json
except ImportError:
import simple... | 41.412316 | 134 | 0.558203 | import warnings
import time
import random
import sys
import weakref
import logging
from six import text_type
import six
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
try:
import json
except ImportError:
import simplejson as json
import request... | true | true |
1c19348264f21b6c026b9724936af77874d8d674 | 515 | py | Python | cargo/forms/__init__.py | dalou/django-cargo | 633d051ca8647623adbab746c9da9153f46e1e8f | [
"BSD-3-Clause"
] | null | null | null | cargo/forms/__init__.py | dalou/django-cargo | 633d051ca8647623adbab746c9da9153f46e1e8f | [
"BSD-3-Clause"
] | null | null | null | cargo/forms/__init__.py | dalou/django-cargo | 633d051ca8647623adbab746c9da9153f46e1e8f | [
"BSD-3-Clause"
] | null | null | null | from .color import ColorField, ColorInput, RGBColorField
from .icon import IconField, IconInput
from .price import PriceField, PriceInput
from .image import ImageInput, CroppedImageField, CroppedImageInput
from .date import DateField, DateTimeField, DateTimeInput, DateInput
from .media import MediaInput, MediaField
# f... | 46.818182 | 68 | 0.84466 | from .color import ColorField, ColorInput, RGBColorField
from .icon import IconField, IconInput
from .price import PriceField, PriceInput
from .image import ImageInput, CroppedImageField, CroppedImageInput
from .date import DateField, DateTimeField, DateTimeInput, DateInput
from .media import MediaInput, MediaField
fro... | true | true |
1c1937063725994db974e2e407cd50b9092a8afd | 12,090 | gyp | Python | binding.gyp | caoko/edge-js | a3a46ca07e4a7f2ae40fa87479a49de583bc6ed6 | [
"Apache-2.0"
] | null | null | null | binding.gyp | caoko/edge-js | a3a46ca07e4a7f2ae40fa87479a49de583bc6ed6 | [
"Apache-2.0"
] | null | null | null | binding.gyp | caoko/edge-js | a3a46ca07e4a7f2ae40fa87479a49de583bc6ed6 | [
"Apache-2.0"
] | null | null | null | ##
# Portions Copyright (c) Microsoft Corporation. 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
#
# THIS CODE IS PROVIDED... | 33.960674 | 220 | 0.456658 | {
'targets': [
{
'target_name': 'edge_coreclr',
'win_delay_load_hook': 'false',
'include_dirs': [
"<!(node -e \"require('nan')\")"
],
'cflags+': [
'-DHAVE_CORECLR -D_NO_ASYNCRTIMP -std=c++14 -Wno-reorder -Wno-sign-compare -Wno-mismatched-tags -Wno-missing-braces -Wno-... | true | true |
1c1937b0a4cdd84b3ebd63f8480af772662cccdc | 502 | py | Python | zerver/migrations/0172_auto_20180912_1108.py | ty-xy/zg13 | 4e929b6f1d90a6f49ef776bd22c87e6d1239e643 | [
"Apache-2.0"
] | null | null | null | zerver/migrations/0172_auto_20180912_1108.py | ty-xy/zg13 | 4e929b6f1d90a6f49ef776bd22c87e6d1239e643 | [
"Apache-2.0"
] | 6 | 2020-09-05T21:07:41.000Z | 2021-12-02T17:56:37.000Z | zerver/migrations/0172_auto_20180912_1108.py | ty-xy/zg13 | 4e929b6f1d90a6f49ef776bd22c87e6d1239e643 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-09-12 03:08
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0171_zgdepartment'),
]
operations = [
... | 22.818182 | 70 | 0.643426 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0171_zgdepartment'),
]
operations = [
migrations.AlterField(
model_name='zgdepartment',
... | true | true |
1c193ab6b2d8a0a6fd0a1e45a388d27314c111f0 | 11,338 | py | Python | dp/cloud/python/magma/configuration_controller/response_processor/strategies/response_processing.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T13:01:54.000Z | 2021-06-02T13:01:54.000Z | dp/cloud/python/magma/configuration_controller/response_processor/strategies/response_processing.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 55 | 2021-08-12T14:02:48.000Z | 2022-03-29T11:27:35.000Z | dp/cloud/python/magma/configuration_controller/response_processor/strategies/response_processing.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 2 | 2020-12-25T08:14:12.000Z | 2022-03-14T13:58:56.000Z | """
Copyright 2021 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 34.993827 | 112 | 0.713883 |
import logging
from datetime import datetime
from typing import Dict, Optional
from magma.configuration_controller.response_processor.response_db_processor import (
ResponseDBProcessor,
)
from magma.db_service.models import (
DBCbsd,
DBCbsdState,
DBChannel,
DBGrant,
DBResponse,
)
from magma.db... | true | true |
1c193ad133d9134a39b39446d9aa742c6642aa2b | 4,406 | py | Python | nvcc/nvcc.py | lesc-ufv/cad4u | 7aaeb780183e249722440078a6dcd0af859d91a5 | [
"Apache-2.0"
] | 3 | 2021-05-03T12:34:25.000Z | 2022-03-15T22:17:00.000Z | nvcc/nvcc.py | lesc-ufv/cad4u | 7aaeb780183e249722440078a6dcd0af859d91a5 | [
"Apache-2.0"
] | null | null | null | nvcc/nvcc.py | lesc-ufv/cad4u | 7aaeb780183e249722440078a6dcd0af859d91a5 | [
"Apache-2.0"
] | 2 | 2021-05-14T23:38:13.000Z | 2022-01-23T23:19:34.000Z | import os
import subprocess
import tempfile
import uuid
from IPython.core.magic import Magics, cell_magic, magics_class
from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring
from common import helper
compiler = '/usr/local/cuda/bin/nvcc'
ext = '.cu'
@magics_class
class NVCCPlugin(Magic... | 31.471429 | 112 | 0.585792 | import os
import subprocess
import tempfile
import uuid
from IPython.core.magic import Magics, cell_magic, magics_class
from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring
from common import helper
compiler = '/usr/local/cuda/bin/nvcc'
ext = '.cu'
@magics_class
class NVCCPlugin(Magic... | true | true |
1c193b108c41560dc47c9cb9f15e533837a43502 | 19,362 | py | Python | tests/test_scripts.py | nikoladze/pyhf | 03b227373b3f893eb501178c3613e0919d5198d8 | [
"Apache-2.0"
] | null | null | null | tests/test_scripts.py | nikoladze/pyhf | 03b227373b3f893eb501178c3613e0919d5198d8 | [
"Apache-2.0"
] | null | null | null | tests/test_scripts.py | nikoladze/pyhf | 03b227373b3f893eb501178c3613e0919d5198d8 | [
"Apache-2.0"
] | null | null | null | import json
import shlex
import pyhf
import time
import pytest
def test_version(script_runner):
command = 'pyhf --version'
start = time.time()
ret = script_runner.run(*shlex.split(command))
end = time.time()
elapsed = end - start
assert ret.success
assert pyhf.__version__ in ret.stdout
... | 35.789279 | 166 | 0.673484 | import json
import shlex
import pyhf
import time
import pytest
def test_version(script_runner):
command = 'pyhf --version'
start = time.time()
ret = script_runner.run(*shlex.split(command))
end = time.time()
elapsed = end - start
assert ret.success
assert pyhf.__version__ in ret.stdout
... | true | true |
1c193ba58b09cc14d051f1e8a22755f255956720 | 1,793 | py | Python | tasksapi/tests/models_tests/queue_whitelist_tests.py | mwiens91/saltant | 9e72175a896f5859ada304ad3ae4d84dfc3834db | [
"MIT"
] | 3 | 2018-12-08T01:18:29.000Z | 2018-12-14T23:18:42.000Z | tasksapi/tests/models_tests/queue_whitelist_tests.py | saltant-org/saltant | db498a1186fc74221f8214ad1819dd03bf4b08ac | [
"MIT"
] | 3 | 2019-05-23T07:43:13.000Z | 2021-06-10T20:46:53.000Z | tasksapi/tests/models_tests/queue_whitelist_tests.py | saltant-org/saltant | db498a1186fc74221f8214ad1819dd03bf4b08ac | [
"MIT"
] | 2 | 2019-03-13T22:31:09.000Z | 2019-05-03T00:18:30.000Z | """Contains tests for queue whitelists."""
from django.core.exceptions import ValidationError
from django.test import TestCase
from tasksapi.models import (
ContainerTaskInstance,
ContainerTaskType,
ExecutableTaskInstance,
ExecutableTaskType,
TaskQueue,
User,
)
# Put info about our fixtures d... | 31.45614 | 67 | 0.674847 |
from django.core.exceptions import ValidationError
from django.test import TestCase
from tasksapi.models import (
ContainerTaskInstance,
ContainerTaskType,
ExecutableTaskInstance,
ExecutableTaskType,
TaskQueue,
User,
)
QUEUE_PK = 1
USER_PK = 1
NON_WHITELISTED_CONTAINER_TASK_TYPE_PK = 3
NON_WH... | true | true |
1c193beed8d8286b55cc5d214cc9c912c4fbc0e4 | 3,451 | py | Python | bindings/python/ensmallen/datasets/string/ruegeriamarina.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/ruegeriamarina.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/ruegeriamarina.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Ruegeria marina.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein associ... | 32.866667 | 223 | 0.675746 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def RuegeriaMarina(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string",
... | true | true |
1c193c3ac10215e03a4914f68c536cb137bf80a1 | 94 | py | Python | python/src/algorithm/coding/math/polarcoordinates.py | kakaba2009/MachineLearning | 26b389f8ffb5f3af939dfc9ebfdf2c6b2fc2ae33 | [
"Apache-2.0"
] | null | null | null | python/src/algorithm/coding/math/polarcoordinates.py | kakaba2009/MachineLearning | 26b389f8ffb5f3af939dfc9ebfdf2c6b2fc2ae33 | [
"Apache-2.0"
] | null | null | null | python/src/algorithm/coding/math/polarcoordinates.py | kakaba2009/MachineLearning | 26b389f8ffb5f3af939dfc9ebfdf2c6b2fc2ae33 | [
"Apache-2.0"
] | null | null | null | import cmath
cn = input().strip()
num = complex(cn)
print(abs(num))
print(cmath.phase(num))
| 11.75 | 23 | 0.680851 | import cmath
cn = input().strip()
num = complex(cn)
print(abs(num))
print(cmath.phase(num))
| true | true |
1c193c418a2d1253e52211cbc17c6a37e29758d5 | 8,517 | py | Python | sorter/tests.py | cclauss/django-sorter | f0e08a1f6b97f2d21016dbedef8432e84062f375 | [
"BSD-3-Clause"
] | null | null | null | sorter/tests.py | cclauss/django-sorter | f0e08a1f6b97f2d21016dbedef8432e84062f375 | [
"BSD-3-Clause"
] | null | null | null | sorter/tests.py | cclauss/django-sorter | f0e08a1f6b97f2d21016dbedef8432e84062f375 | [
"BSD-3-Clause"
] | null | null | null | from django import template
from django.contrib.auth.models import User
from django.contrib.admin.models import LogEntry
from django.http import HttpResponse
from django.template import Library, Template, Context, TemplateSyntaxError
from django.test import TestCase
from django.test.client import RequestFactory
from m... | 40.174528 | 163 | 0.616884 | from django import template
from django.contrib.auth.models import User
from django.contrib.admin.models import LogEntry
from django.http import HttpResponse
from django.template import Library, Template, Context, TemplateSyntaxError
from django.test import TestCase
from django.test.client import RequestFactory
from m... | true | true |
1c193caf266357a64d6b48eb0a31cd7e920746b8 | 3,209 | py | Python | scoreboard.py | Arnav190709/AlienInvasion | 99a8c2e0e1da8c15f847f14844313912b76260f7 | [
"Apache-2.0"
] | null | null | null | scoreboard.py | Arnav190709/AlienInvasion | 99a8c2e0e1da8c15f847f14844313912b76260f7 | [
"Apache-2.0"
] | null | null | null | scoreboard.py | Arnav190709/AlienInvasion | 99a8c2e0e1da8c15f847f14844313912b76260f7 | [
"Apache-2.0"
] | null | null | null | import pygame.font
from pygame.sprite import Group
from ship import Ship
class Scoreboard:
"""A class to report scoring information."""
def __init__(self, ai_game):
"""Initialize scorekeeping attributes."""
self.ai_game = ai_game
self.screen = ai_game.screen
self.... | 39.134146 | 71 | 0.615768 | import pygame.font
from pygame.sprite import Group
from ship import Ship
class Scoreboard:
def __init__(self, ai_game):
self.ai_game = ai_game
self.screen = ai_game.screen
self.screen_rect = self.screen.get_rect()
self.settings = ai_game.settings
self.stats = ... | true | true |
1c193cd94231b035ba93d845028fb7ed2025c270 | 692 | py | Python | utils/browseUML.py | albanobattistella/gaphor | 5fc6b0ff39ba6dbbb73cb9b111f32d1eda790e14 | [
"Apache-2.0"
] | 1 | 2020-11-27T12:39:15.000Z | 2020-11-27T12:39:15.000Z | utils/browseUML.py | albanobattistella/gaphor | 5fc6b0ff39ba6dbbb73cb9b111f32d1eda790e14 | [
"Apache-2.0"
] | null | null | null | utils/browseUML.py | albanobattistella/gaphor | 5fc6b0ff39ba6dbbb73cb9b111f32d1eda790e14 | [
"Apache-2.0"
] | 3 | 2020-01-23T14:13:59.000Z | 2020-02-18T18:21:47.000Z | #!/usr/bin/env python
#
# Print all attributes of a specific class.
#
# Usage: browseUML.py <Classname>
# E.g. browseUML.py Class
#
# Arjan Molenaar.
import ast
import sys
from gaphor.UML import *
sys.path.append("..")
done = [object]
def print_vars(cls):
global done
done.append(cls)
print(cls.__name... | 16.878049 | 56 | 0.606936 |
import ast
import sys
from gaphor.UML import *
sys.path.append("..")
done = [object]
def print_vars(cls):
global done
done.append(cls)
print(cls.__name__ + ":")
dict = cls.__dict__
for key in list(dict.keys()):
print("\t" + key + ":", str(dict[key]))
for base in cls.__bases__:
... | true | true |
1c193cf33b2d171049eb01d7c4564eb1d0a03cb5 | 2,580 | py | Python | bin/simulate_stream.py | marcol480/fink-broker | ade4680a955c866d4ba4c6e32ec4d321bf7783d8 | [
"Apache-2.0"
] | null | null | null | bin/simulate_stream.py | marcol480/fink-broker | ade4680a955c866d4ba4c6e32ec4d321bf7783d8 | [
"Apache-2.0"
] | null | null | null | bin/simulate_stream.py | marcol480/fink-broker | ade4680a955c866d4ba4c6e32ec4d321bf7783d8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 AstroLab Software
# Author: Julien Peloton
#
# 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... | 28.988764 | 74 | 0.633333 | import argparse
import os
import glob
import time
import asyncio
from fink_broker import alertProducer
from fink_broker import avroUtils
from fink_broker.parser import getargs
def main():
parser = argparse.ArgumentParser(description=__doc__)
args = getargs(parser)
conf = {'bootstrap.servers': args.se... | true | true |
1c193cff5f79ccbe419d4e360b6a3929b294a041 | 755 | py | Python | jitenshop/__init__.py | Oslandia/jitenshea-workshop | 011a5bae0c69a12f8136386444cd5ff29238700b | [
"MIT"
] | null | null | null | jitenshop/__init__.py | Oslandia/jitenshea-workshop | 011a5bae0c69a12f8136386444cd5ff29238700b | [
"MIT"
] | 3 | 2019-08-20T15:59:09.000Z | 2019-08-26T16:46:11.000Z | jitenshop/__init__.py | Oslandia/workshop-jitenshea | 011a5bae0c69a12f8136386444cd5ff29238700b | [
"MIT"
] | null | null | null | __version__ = 0.1
import os
import logging
import configparser
import daiquiri
import daiquiri.formatter
_ROOT = os.path.dirname(os.path.abspath(__file__))
_CONFIG = os.path.join(_ROOT, 'config.ini')
FORMAT = (
"%(asctime)s :: %(color)s%(levelname)s :: %(name)s :: %(funcName)s :"
"%(message)s%(color_stop)... | 22.878788 | 73 | 0.69404 | __version__ = 0.1
import os
import logging
import configparser
import daiquiri
import daiquiri.formatter
_ROOT = os.path.dirname(os.path.abspath(__file__))
_CONFIG = os.path.join(_ROOT, 'config.ini')
FORMAT = (
"%(asctime)s :: %(color)s%(levelname)s :: %(name)s :: %(funcName)s :"
"%(message)s%(color_stop)... | true | true |
1c193e8a55cdcd0fcd007107ed75a2d767107dd6 | 792 | py | Python | app/book/sitemap.py | valeriansaliou/waaave-web | 8a0cde773563865a905af38f5a0b723a43b17341 | [
"RSA-MD"
] | 1 | 2020-04-06T10:04:43.000Z | 2020-04-06T10:04:43.000Z | app/book/sitemap.py | valeriansaliou/waaave-web | 8a0cde773563865a905af38f5a0b723a43b17341 | [
"RSA-MD"
] | null | null | null | app/book/sitemap.py | valeriansaliou/waaave-web | 8a0cde773563865a905af38f5a0b723a43b17341 | [
"RSA-MD"
] | null | null | null | from django.core.urlresolvers import reverse
from django.contrib.sitemaps import Sitemap
from .helpers import *
from .models import *
class BookSitemap(Sitemap):
"""
Build the book sitemap
"""
changefreq = 'monthly'
priority = 0.5
def items(self):
results = []
for book in Bo... | 21.405405 | 50 | 0.546717 | from django.core.urlresolvers import reverse
from django.contrib.sitemaps import Sitemap
from .helpers import *
from .models import *
class BookSitemap(Sitemap):
changefreq = 'monthly'
priority = 0.5
def items(self):
results = []
for book in BookHelper.list():
book_url = Boo... | true | true |
1c193f0b999ecf67edb869f42ab7600f89d65a21 | 4,612 | py | Python | chromium/tools/telemetry/telemetry/internal/backends/chrome/ios_browser_backend.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 925 | 2015-11-06T03:04:46.000Z | 2017-09-16T19:08:43.000Z | chromium/tools/telemetry/telemetry/internal/backends/chrome/ios_browser_backend.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 29 | 2015-11-09T17:37:28.000Z | 2017-08-16T17:50:11.000Z | chromium/tools/telemetry/telemetry/internal/backends/chrome/ios_browser_backend.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 51 | 2015-11-08T07:06:38.000Z | 2017-08-21T07:27:19.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import json
import logging
import re
import urllib2
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.i... | 31.37415 | 79 | 0.681483 |
import contextlib
import json
import logging
import re
import urllib2
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.internal.backends.chrome import chrome_browser_backend
from telemetry.internal.backends.chrome import system_info_backend
class IosBrowserBackend(chrome_browser_... | true | true |
1c193f7b46511beefed22dbf9f0cc292d02f5278 | 23,521 | py | Python | src/comparedatasets17.py | IBMPredictiveAnalytics/SPSSINC_COMPARE_DATASETS | 518fb07a11d31b9cf209a029de92417c69a5dfc1 | [
"Apache-2.0"
] | 1 | 2017-09-08T13:18:04.000Z | 2017-09-08T13:18:04.000Z | src/comparedatasets17.py | IBMPredictiveAnalytics/SPSSINC_COMPARE_DATASETS | 518fb07a11d31b9cf209a029de92417c69a5dfc1 | [
"Apache-2.0"
] | null | null | null | src/comparedatasets17.py | IBMPredictiveAnalytics/SPSSINC_COMPARE_DATASETS | 518fb07a11d31b9cf209a029de92417c69a5dfc1 | [
"Apache-2.0"
] | 1 | 2021-10-08T02:39:43.000Z | 2021-10-08T02:39:43.000Z | #/***********************************************************************
# * Licensed Materials - Property of IBM
# *
# * IBM SPSS Products: Statistics Common
# *
# * (C) Copyright IBM Corp. 1989, 2020
# *
# * US Government Users Restricted Rights - Use, duplication or disclosure
# * restricted by GSA ADP Schedule Co... | 45.232692 | 155 | 0.573913 |
__version__ = "2.1.2"
__author__ = "SPSS, JKP"
import random, inspect, codecs, sys, textwrap, os, locale
import spss, spssaux
from spss import CellText
if spssaux.getSpssMajorVersion() < 17:
raise ImportError("This module requires at least SPSS Statistics 17")
if spss.PyInvokeSpss.IsUTF8mode():
unistr ... | true | true |
1c194163103bc68c559dd808f1f7eaa4cd6dbc92 | 403 | py | Python | insta_project/asgi.py | Stephenremmi/insta-clone | 88af361dca160f7840842ebebc306a02f97920ca | [
"MIT"
] | null | null | null | insta_project/asgi.py | Stephenremmi/insta-clone | 88af361dca160f7840842ebebc306a02f97920ca | [
"MIT"
] | 3 | 2021-03-30T13:54:34.000Z | 2021-09-08T02:17:46.000Z | insta_project/asgi.py | Stephenremmi/insta-clone | 88af361dca160f7840842ebebc306a02f97920ca | [
"MIT"
] | null | null | null | """
ASGI config for insta_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'insta_project.settings')
application = get_asgi_application()
| true | true |
1c194269fe077ee985f5c349562d1228b67fc977 | 1,808 | py | Python | tests/zoomus/components/webinar/test_end.py | dltj/zoomus | 34c363b92f8970d28c97706c08191f717f60554e | [
"Apache-2.0"
] | null | null | null | tests/zoomus/components/webinar/test_end.py | dltj/zoomus | 34c363b92f8970d28c97706c08191f717f60554e | [
"Apache-2.0"
] | null | null | null | tests/zoomus/components/webinar/test_end.py | dltj/zoomus | 34c363b92f8970d28c97706c08191f717f60554e | [
"Apache-2.0"
] | null | null | null | import unittest
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from zoomus import components
def suite():
"""Define all the tests of the module."""
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(EndV1TestCase))
return suite
class EndV1TestCas... | 29.16129 | 88 | 0.654314 | import unittest
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from zoomus import components
def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(EndV1TestCase))
return suite
class EndV1TestCase(unittest.TestCase):
def setUp(self):
... | true | true |
1c19427eb610ad6ab9eb44a233a007f422b50bf8 | 9,838 | py | Python | lib/tool_shed/test/functional/test_0550_metadata_updated_dependencies.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 1,085 | 2015-02-18T16:14:38.000Z | 2022-03-30T23:52:07.000Z | lib/tool_shed/test/functional/test_0550_metadata_updated_dependencies.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 11,253 | 2015-02-18T17:47:32.000Z | 2022-03-31T21:47:03.000Z | lib/tool_shed/test/functional/test_0550_metadata_updated_dependencies.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 1,000 | 2015-02-18T16:18:10.000Z | 2022-03-29T08:22:56.000Z | import logging
from ..base.twilltestcase import common, ShedTwillTestCase
log = logging.getLogger(__name__)
repositories = dict(freebayes=dict(name='package_freebayes_0550',
description='Description for package_freebayes_0550',
long_description='L... | 62.265823 | 132 | 0.590567 | import logging
from ..base.twilltestcase import common, ShedTwillTestCase
log = logging.getLogger(__name__)
repositories = dict(freebayes=dict(name='package_freebayes_0550',
description='Description for package_freebayes_0550',
long_description='L... | true | true |
1c194285c5612a1bc65b0e4c313c5b680cb3db5f | 9,270 | py | Python | airflow/providers/amazon/aws/transfers/google_api_to_s3.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/providers/amazon/aws/transfers/google_api_to_s3.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/providers/amazon/aws/transfers/google_api_to_s3.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 48.031088 | 105 | 0.739374 | import json
import sys
from typing import Optional, Sequence, Union
from airflow.models import BaseOperator, TaskInstance
from airflow.models.xcom import MAX_XCOM_SIZE, XCOM_RETURN_KEY
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.providers.google.common.hooks.discovery_api import GoogleDiscove... | true | true |
1c19432c31c5726b346b9656a2fe4b0401924e1f | 1,930 | py | Python | tensor2tensor/data_generators/audio_test.py | vohoaiviet/tensor2tensor | c2bd023ab7fc8ca0f4c4138e955845537d10ca55 | [
"Apache-2.0"
] | 6 | 2017-10-10T13:36:39.000Z | 2021-02-18T07:50:00.000Z | tensor2tensor/data_generators/audio_test.py | vohoaiviet/tensor2tensor | c2bd023ab7fc8ca0f4c4138e955845537d10ca55 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/audio_test.py | vohoaiviet/tensor2tensor | c2bd023ab7fc8ca0f4c4138e955845537d10ca55 | [
"Apache-2.0"
] | 9 | 2017-07-25T11:29:06.000Z | 2021-06-20T14:01:58.000Z | # Copyright 2017 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 30.634921 | 75 | 0.710363 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import os
from tensor2tensor.data_generators import audio
import tensorflow as tf
class AudioTest(tf.test.TestCase):
def testDataCollection(self):
tmp_dir = self.get_temp_dir()
t... | true | true |
1c1943705fcdd10ed7d3131f71380568243b3dc8 | 1,173 | gyp | Python | gyp/bench.gyp | PDi-Communication-Systems-Inc/lollipop_external_skia | 3156960b0bf3564e38e2b6c05a15dc492a95a60c | [
"BSD-3-Clause"
] | 1 | 2015-07-13T01:58:07.000Z | 2015-07-13T01:58:07.000Z | gyp/bench.gyp | PDi-Communication-Systems-Inc/lollipop_external_skia | 3156960b0bf3564e38e2b6c05a15dc492a95a60c | [
"BSD-3-Clause"
] | null | null | null | gyp/bench.gyp | PDi-Communication-Systems-Inc/lollipop_external_skia | 3156960b0bf3564e38e2b6c05a15dc492a95a60c | [
"BSD-3-Clause"
] | 1 | 2017-02-02T05:41:11.000Z | 2017-02-02T05:41:11.000Z | # GYP file to build performance testbench.
#
{
'includes': [
'apptype_console.gypi',
],
'targets': [
{
'target_name': 'bench',
'type': 'executable',
'dependencies': [
'etc1.gyp:libetc1',
'flags.gyp:flags',
'jsoncpp.gyp:jsoncpp',
'skia_lib.gyp:skia_lib',
... | 21.327273 | 42 | 0.416027 | {
'includes': [
'apptype_console.gypi',
],
'targets': [
{
'target_name': 'bench',
'type': 'executable',
'dependencies': [
'etc1.gyp:libetc1',
'flags.gyp:flags',
'jsoncpp.gyp:jsoncpp',
'skia_lib.gyp:skia_lib',
'tools.gyp:crash_handler',
'too... | true | true |
1c1943bcd72a6adc8d73e2c4975638497fe2b921 | 3,557 | py | Python | item.py | tipa16384/YouAreTheAmulet | 17e5740f2c25443349175680a91349bde4a38ae7 | [
"MIT"
] | null | null | null | item.py | tipa16384/YouAreTheAmulet | 17e5740f2c25443349175680a91349bde4a38ae7 | [
"MIT"
] | null | null | null | item.py | tipa16384/YouAreTheAmulet | 17e5740f2c25443349175680a91349bde4a38ae7 | [
"MIT"
] | null | null | null | from enum import Enum
from random import randint
class ItemType(Enum):
WAND = 1
SWORD = 2
SHIELD = 3
POTION = 4
RING = 5
BOOTS = 6
HELMET = 7
ARMOR = 8
AMULET = 9
BOW = 10
POLEARM = 11
STAFF = 12
FOOD = 13
NECKLACE = 14
UNARMED = 15
class Item:
def __init... | 28.456 | 140 | 0.571268 | from enum import Enum
from random import randint
class ItemType(Enum):
WAND = 1
SWORD = 2
SHIELD = 3
POTION = 4
RING = 5
BOOTS = 6
HELMET = 7
ARMOR = 8
AMULET = 9
BOW = 10
POLEARM = 11
STAFF = 12
FOOD = 13
NECKLACE = 14
UNARMED = 15
class Item:
def __init... | true | true |
1c1943df1d30763aaead7a6368705513854a4866 | 85 | py | Python | test/soak/endSoak.py | 2535Rover/RoverSystem | 300dd4d754bac2e4caff25ed1da244c109d289be | [
"Apache-2.0"
] | 1 | 2018-10-16T02:32:49.000Z | 2018-10-16T02:32:49.000Z | test/soak/endSoak.py | 2535Rover/RoverSystem | 300dd4d754bac2e4caff25ed1da244c109d289be | [
"Apache-2.0"
] | 13 | 2018-10-23T20:35:10.000Z | 2018-11-23T22:44:32.000Z | test/soak/endSoak.py | 2535Rover/RoverSystem | 300dd4d754bac2e4caff25ed1da244c109d289be | [
"Apache-2.0"
] | 1 | 2018-10-16T03:11:39.000Z | 2018-10-16T03:11:39.000Z | import subprocess as s
s.call(["sudo","tc","qdisc","del","dev","lo","root","netem"])
| 28.333333 | 61 | 0.611765 | import subprocess as s
s.call(["sudo","tc","qdisc","del","dev","lo","root","netem"])
| true | true |
1c1944f97c651bcd31ea5877f5d8f998a1e9c38f | 20,357 | py | Python | kubespawner/objects.py | yoavtzelnick/kubespawner | 04dcae1f65edede6c8d302351fe4f2ae364a1a6e | [
"BSD-3-Clause"
] | null | null | null | kubespawner/objects.py | yoavtzelnick/kubespawner | 04dcae1f65edede6c8d302351fe4f2ae364a1a6e | [
"BSD-3-Clause"
] | null | null | null | kubespawner/objects.py | yoavtzelnick/kubespawner | 04dcae1f65edede6c8d302351fe4f2ae364a1a6e | [
"BSD-3-Clause"
] | null | null | null | """
Helper methods for generating k8s API objects.
"""
import json
from urllib.parse import urlparse
import escapism
import re
import string
from kubespawner.utils import get_k8s_model, update_k8s_model
from kubernetes.client.models import (
V1Pod, V1PodSpec, V1PodSecurityContext,
V1ObjectMeta,
V1LocalObje... | 38.265038 | 128 | 0.679864 | import json
from urllib.parse import urlparse
import escapism
import re
import string
from kubespawner.utils import get_k8s_model, update_k8s_model
from kubernetes.client.models import (
V1Pod, V1PodSpec, V1PodSecurityContext,
V1ObjectMeta,
V1LocalObjectReference,
V1Volume, V1VolumeMount,
V1Contain... | true | true |
1c19455566494ef845df39661e88285891eeb2d2 | 460 | py | Python | Alien Invasion 2/venv/Scripts/easy_install-script.py | EnriqueGambra/Alien-Invasion | 7d22ac213e0fc9143f6c80184b7972e14b601983 | [
"MIT"
] | null | null | null | Alien Invasion 2/venv/Scripts/easy_install-script.py | EnriqueGambra/Alien-Invasion | 7d22ac213e0fc9143f6c80184b7972e14b601983 | [
"MIT"
] | null | null | null | Alien Invasion 2/venv/Scripts/easy_install-script.py | EnriqueGambra/Alien-Invasion | 7d22ac213e0fc9143f6c80184b7972e14b601983 | [
"MIT"
] | null | null | null | #!"C:\Users\Owner\PycharmProject\Alien Invasion 2\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install'
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-scrip... | 35.384615 | 83 | 0.695652 | __requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==39.1.0', 'console_scripts', 'easy_install')()
)
| true | true |
1c194558bfa0529e7704b96872a21ab2b20aa54f | 6,145 | py | Python | neutron/agent/firewall.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 1 | 2017-09-10T09:57:35.000Z | 2017-09-10T09:57:35.000Z | neutron/agent/firewall.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-27T00:48:55.000Z | 2015-04-21T05:29:37.000Z | neutron/agent/firewall.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-26T00:55:17.000Z | 2020-03-01T17:05:40.000Z | # Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | 31.192893 | 79 | 0.682181 |
import abc
import contextlib
import six
from neutron_lib import constants as n_const
import neutron.common.constants as const
from neutron.common import utils
from neutron.extensions import portsecurity as psec
INGRESS_DIRECTION = const.INGRESS_DIRECTION
EGRESS_DIRECTION = const.EGRESS_DIRECTION
DIRECTION_IP_PREF... | true | true |
1c19464359213e2b1151dbcdd741f87c89b9f85a | 280 | py | Python | contrib/asciidata/setup.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 62 | 2018-03-30T15:46:56.000Z | 2021-12-08T23:30:24.000Z | contrib/asciidata/setup.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 114 | 2018-03-21T01:12:43.000Z | 2021-07-05T12:29:54.000Z | contrib/asciidata/setup.py | CDAT/uvcdat | 5133560c0c049b5c93ee321ba0af494253b44f91 | [
"BSD-3-Clause"
] | 14 | 2018-06-06T02:42:47.000Z | 2021-11-26T03:27:00.000Z | from distutils.core import setup
import time
setup (name = "asciidata",
version=time.asctime(time.gmtime(time.time())),
description = "ascii separated values data file reader",
packages = ['asciidata'],
package_dir = {'asciidata': 'Lib'},
)
| 28 | 63 | 0.632143 | from distutils.core import setup
import time
setup (name = "asciidata",
version=time.asctime(time.gmtime(time.time())),
description = "ascii separated values data file reader",
packages = ['asciidata'],
package_dir = {'asciidata': 'Lib'},
)
| true | true |
1c194695858662cd6a966cc23d26e8c580dca26d | 12,449 | py | Python | CMSIS/DSP/Testing/addToRegDB.py | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 2,293 | 2016-02-25T06:47:33.000Z | 2022-03-29T16:44:02.000Z | CMSIS/DSP/Testing/addToRegDB.py | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 1,125 | 2016-02-27T09:56:01.000Z | 2022-03-31T13:57:05.000Z | CMSIS/DSP/Testing/addToRegDB.py | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 1,160 | 2016-02-27T09:06:10.000Z | 2022-03-31T19:06:24.000Z | # Process the test results
# Test status (like passed, or failed with error code)
import argparse
import re
import TestScripts.NewParser as parse
import TestScripts.CodeGen
from collections import deque
import os.path
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api a... | 35.772989 | 162 | 0.587196 |
import argparse
import re
import TestScripts.NewParser as parse
import TestScripts.CodeGen
from collections import deque
import os.path
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
import csv
import TestScripts.Deprecate as d
import sqlite3
import datetime,... | true | true |
1c1946a946b6230339b12ac9485fd4353f16629c | 9,777 | py | Python | rl_threat_hunting/adapter/threat_hunting.py | ivukovicRL/threat_hunting_library | 16fcd3b6f10dff6d0dc2952f7ac2b9b99af13375 | [
"MIT"
] | 2 | 2021-11-18T19:22:42.000Z | 2022-03-31T14:56:56.000Z | rl_threat_hunting/adapter/threat_hunting.py | ivukovicRL/threat_hunting_library | 16fcd3b6f10dff6d0dc2952f7ac2b9b99af13375 | [
"MIT"
] | null | null | null | rl_threat_hunting/adapter/threat_hunting.py | ivukovicRL/threat_hunting_library | 16fcd3b6f10dff6d0dc2952f7ac2b9b99af13375 | [
"MIT"
] | 3 | 2021-11-18T19:22:46.000Z | 2022-02-25T08:54:48.000Z |
from collections import defaultdict
from collections import OrderedDict
from rl_threat_hunting import result_evaluation
from rl_threat_hunting.utils import is_valid_tc_factor
from rl_threat_hunting.utils import safely_traverse_dict
from rl_threat_hunting.adapter.search_suggestions import generate_search_queries
from ... | 36.755639 | 124 | 0.681497 |
from collections import defaultdict
from collections import OrderedDict
from rl_threat_hunting import result_evaluation
from rl_threat_hunting.utils import is_valid_tc_factor
from rl_threat_hunting.utils import safely_traverse_dict
from rl_threat_hunting.adapter.search_suggestions import generate_search_queries
from ... | true | true |
1c19481ffaec6f933bb941a084b7e60607c8e36a | 2,588 | py | Python | temporal_sqlalchemy/util.py | CloverHealth/temporal-sqlalchemy | 94b07527d43bbceae688a0d215493f8cc93a2245 | [
"BSD-3-Clause"
] | 45 | 2016-09-29T23:38:45.000Z | 2021-12-27T11:27:14.000Z | temporal_sqlalchemy/util.py | CloverHealth/temporal-sqlalchemy | 94b07527d43bbceae688a0d215493f8cc93a2245 | [
"BSD-3-Clause"
] | 28 | 2016-09-30T06:15:15.000Z | 2018-11-05T05:44:46.000Z | temporal_sqlalchemy/util.py | CloverHealth/temporal-sqlalchemy | 94b07527d43bbceae688a0d215493f8cc93a2245 | [
"BSD-3-Clause"
] | 3 | 2017-09-09T17:11:47.000Z | 2019-12-13T12:18:39.000Z | """ utility functions """
import datetime as dt
import typing
import psycopg2.extras as psql_extras
import sqlalchemy as sa
import sqlalchemy.dialects.postgresql as sap
import sqlalchemy.orm as orm
import sqlalchemy.orm.attributes as attributes
import sqlalchemy.util as sa_util
from temporal_sqlalchemy import bases
... | 35.452055 | 99 | 0.711747 | import datetime as dt
import typing
import psycopg2.extras as psql_extras
import sqlalchemy as sa
import sqlalchemy.dialects.postgresql as sap
import sqlalchemy.orm as orm
import sqlalchemy.orm.attributes as attributes
import sqlalchemy.util as sa_util
from temporal_sqlalchemy import bases
def foreign_key_to(table:... | true | true |
1c1948bb575829ea6a27b25d1f96c43b6f8e4bd8 | 8,328 | py | Python | src/falconpy/__init__.py | rayheffer/falconpy | 72abcd07b18f193a1491a4d41a71ce2f1c1e73e6 | [
"Unlicense"
] | null | null | null | src/falconpy/__init__.py | rayheffer/falconpy | 72abcd07b18f193a1491a4d41a71ce2f1c1e73e6 | [
"Unlicense"
] | null | null | null | src/falconpy/__init__.py | rayheffer/falconpy | 72abcd07b18f193a1491a4d41a71ce2f1c1e73e6 | [
"Unlicense"
] | null | null | null | """The CrowdStrike Falcon OAuth2 API SDK.
@@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@@@@@ @@@ @@@ @@@ @@@@@@@@
@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@ @@@ @@@ @@@@@@@@ @@@@@@@ @@@@@@@ @@@@@@@@ @@@ @@@ @@@ @@@@@@@@
!@@ @@! @@@ @@! @@@ @@! @@! @@! @@! @@@ !@@ ... | 53.044586 | 107 | 0.508165 | from ._version import _VERSION, _MAINTAINER, _AUTHOR, _AUTHOR_EMAIL
from ._version import _CREDITS, _DESCRIPTION, _TITLE, _PROJECT_URL
from ._version import _DOCS_URL, _KEYWORDS
from ._service_class import ServiceClass
from ._util import confirm_base_region, confirm_base_url
from ._base_url import BaseURL
from .api_com... | true | true |
1c1949b4c72a7466bdb4057d8ebfcb97e49cde7a | 1,520 | py | Python | behaviorAnalysis/magnification/run_magnification/compute_magnification_flow.py | aiporre/uBAM | 547b842b8dbaa221a2dcb93bf040f5decaacb517 | [
"Apache-2.0"
] | 7 | 2020-12-04T10:48:02.000Z | 2022-03-20T23:09:19.000Z | behaviorAnalysis/magnification/run_magnification/compute_magnification_flow.py | aiporre/uBAM | 547b842b8dbaa221a2dcb93bf040f5decaacb517 | [
"Apache-2.0"
] | null | null | null | behaviorAnalysis/magnification/run_magnification/compute_magnification_flow.py | aiporre/uBAM | 547b842b8dbaa221a2dcb93bf040f5decaacb517 | [
"Apache-2.0"
] | 1 | 2021-04-26T14:12:32.000Z | 2021-04-26T14:12:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python 2.7
@author: Biagio Brattoli
biagio.brattoli@iwr.uni-heidelberg.de
Last Update: 23.8.2018
Use Generative Model for posture extrapolation
"""
from datetime import datetime
import os, sys, numpy as np, argparse
from time import time
from tqdm import tqdm, trange... | 32.340426 | 74 | 0.717105 |
from datetime import datetime
import os, sys, numpy as np, argparse
from time import time
from tqdm import tqdm, trange
import matplotlib.pyplot as plt
from skimage.transform import resize
from scipy.misc import imread, imsave
import config_pytorch_human as cfg
import cv2
optical_flow = cv2.createOptFlow_DualTVL1()... | true | true |
1c194a54ce993b9ffb0cabaf8b00bd936ac8d075 | 235 | py | Python | tools/leetcode.058.Length of Last Word/leetcode.058.Length of Last Word.submission1.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | 4 | 2015-10-10T00:30:55.000Z | 2020-07-27T19:45:54.000Z | tools/leetcode.058.Length of Last Word/leetcode.058.Length of Last Word.submission1.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | tools/leetcode.058.Length of Last Word/leetcode.058.Length of Last Word.submission1.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | class Solution:
# @param {string} s
# @return {integer}
def lengthOfLastWord(self, s):
temp = [w for w in s.split() if w]
if temp:
return len(temp[-1])
else:
return 0 | 235 | 235 | 0.480851 | class Solution:
| true | true |
1c194ba3bb56f4ce9caac9f64b6b874fde8bffac | 35,545 | py | Python | builder/frameworks/pylink/six.py | Wiz-IO/wizio-cc | f0d7cc9b0ce60a9de50c0f807c99d6824a706913 | [
"Apache-2.0"
] | 13 | 2021-08-10T10:55:31.000Z | 2022-03-29T16:30:27.000Z | builder/frameworks/pylink/six.py | Wiz-IO/wizio-cc | f0d7cc9b0ce60a9de50c0f807c99d6824a706913 | [
"Apache-2.0"
] | null | null | null | builder/frameworks/pylink/six.py | Wiz-IO/wizio-cc | f0d7cc9b0ce60a9de50c0f807c99d6824a706913 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2020 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | 35.616232 | 119 | 0.63632 |
from __future__ import absolute_import
import functools
import itertools
import operator
import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
__version__ = "1.16.0"
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
PY34 = sys.version_info[0:2] >= (3, 4)
if ... | true | true |
1c194ba7a3c406f6e3e2a7d1c30e846f0d14b37a | 450 | py | Python | abstractMusicPlayer.py | SL-RU/RaspiBluePlayer | bf17323f44eeb0583ed9db0cd6804a24b3df75b5 | [
"MIT"
] | null | null | null | abstractMusicPlayer.py | SL-RU/RaspiBluePlayer | bf17323f44eeb0583ed9db0cd6804a24b3df75b5 | [
"MIT"
] | null | null | null | abstractMusicPlayer.py | SL-RU/RaspiBluePlayer | bf17323f44eeb0583ed9db0cd6804a24b3df75b5 | [
"MIT"
] | null | null | null | class SmthPlayer(object):
def set_aplayer(self, apl):
pass
def get_aplayer(self):
pass
def play(self):
pass
def pause(self):
pass
def play_forw(self):
pass
def play_back(self):
pass
def load(self):
pass
def save(self):
... | 12.5 | 31 | 0.5 | class SmthPlayer(object):
def set_aplayer(self, apl):
pass
def get_aplayer(self):
pass
def play(self):
pass
def pause(self):
pass
def play_forw(self):
pass
def play_back(self):
pass
def load(self):
pass
def save(self):
... | true | true |
1c194bf6f1717f40a44817f6794179a48695675a | 11,234 | py | Python | Thesis@3.9.1/Lib/site-packages/mypy/reachability.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/mypy/reachability.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/mypy/reachability.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """Utilities related to determining the reachability of code (in semantic analysis)."""
from typing import Tuple, TypeVar, Union, Optional
from typing_extensions import Final
from mypy.nodes import (
Expression,
IfStmt,
Block,
AssertStmt,
NameExpr,
UnaryExpr,
MemberExpr,
OpExpr,
Co... | 34.996885 | 87 | 0.62293 |
from typing import Tuple, TypeVar, Union, Optional
from typing_extensions import Final
from mypy.nodes import (
Expression,
IfStmt,
Block,
AssertStmt,
NameExpr,
UnaryExpr,
MemberExpr,
OpExpr,
ComparisonExpr,
StrExpr,
UnicodeExpr,
CallExpr,
IntExpr,
TupleExpr,
... | true | true |
1c194cdeedde6fac4cfe2280cf2b217b9e422262 | 3,885 | py | Python | geoutils.py | martinchristen/pyconhk-2020 | ff4ad82809fb8ce0c1ea4ae69dc32be81728e93c | [
"MIT"
] | 2 | 2020-05-09T18:45:22.000Z | 2020-06-06T20:48:51.000Z | geoutils.py | martinchristen/pyconhk-2020 | ff4ad82809fb8ce0c1ea4ae69dc32be81728e93c | [
"MIT"
] | null | null | null | geoutils.py | martinchristen/pyconhk-2020 | ff4ad82809fb8ce0c1ea4ae69dc32be81728e93c | [
"MIT"
] | null | null | null | ###############################################################################
#### Collection of useful functions
####
#### Licensed under MIT License
###############################################################################
#
# Copyright (c) 2020 Martin Christen, martin.christen@gmail.com
#
# Permission is her... | 40.051546 | 150 | 0.541313 |
from urllib.request import urlopen
import os
import sys
geodata = {"natural-earth": "http://naciscdn.org/naturalearth/packages/natural_earth_vector.gpkg.zip",
"natural-earth-raster-shaded": "https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/raster/NE1_HR_LC_SR_W_DR.zip",
... | true | true |
1c194d97ab81d5aa439fe51278c58a829084909d | 1,126 | py | Python | tornado/__init__.py | decimalbell/tornado | cfe10ee21c24cd262adbfe459cba9c91c92a45fe | [
"Apache-2.0"
] | 1 | 2021-03-31T04:44:30.000Z | 2021-03-31T04:44:30.000Z | tornado/__init__.py | decimalbell/tornado | cfe10ee21c24cd262adbfe459cba9c91c92a45fe | [
"Apache-2.0"
] | null | null | null | tornado/__init__.py | decimalbell/tornado | cfe10ee21c24cd262adbfe459cba9c91c92a45fe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | 37.533333 | 80 | 0.763766 |
from __future__ import absolute_import, division, print_function, with_statement
version = "3.2b2"
version_info = (3, 2, 0, -97)
| true | true |
1c194df4c82b34477b6d887bb3bdb1455c4e76b5 | 2,033 | py | Python | setup.py | kaikun213/fonduer | 79434aaed22c730ea043fe0909e88e0e39a4b8e5 | [
"MIT"
] | 1 | 2018-11-02T06:02:13.000Z | 2018-11-02T06:02:13.000Z | setup.py | kaikun213/fonduer | 79434aaed22c730ea043fe0909e88e0e39a4b8e5 | [
"MIT"
] | null | null | null | setup.py | kaikun213/fonduer | 79434aaed22c730ea043fe0909e88e0e39a4b8e5 | [
"MIT"
] | 1 | 2018-09-24T03:27:04.000Z | 2018-09-24T03:27:04.000Z | """For pip."""
from glob import glob
from os.path import basename, splitext
from setuptools import find_packages, setup
exec(open("src/fonduer/_version.py").read())
setup(
name="fonduer",
version=__version__,
description="Knowledge base construction system for richly formatted data.",
long_description... | 35.051724 | 81 | 0.578947 | from glob import glob
from os.path import basename, splitext
from setuptools import find_packages, setup
exec(open("src/fonduer/_version.py").read())
setup(
name="fonduer",
version=__version__,
description="Knowledge base construction system for richly formatted data.",
long_description=open("README.r... | true | true |
1c194f90b69bd8b19543fea83344c5e19ecd15d2 | 1,165 | py | Python | space_invaders/main.py | lasse-herzog/pi-game-console | 8ea2fce91905ec3cafb8081615f82dd4dcc79ab3 | [
"MIT"
] | null | null | null | space_invaders/main.py | lasse-herzog/pi-game-console | 8ea2fce91905ec3cafb8081615f82dd4dcc79ab3 | [
"MIT"
] | 3 | 2022-03-03T10:10:17.000Z | 2022-03-28T20:43:15.000Z | space_invaders/main.py | lasse-herzog/pyco | 8ea2fce91905ec3cafb8081615f82dd4dcc79ab3 | [
"MIT"
] | 2 | 2022-01-12T14:56:11.000Z | 2022-01-12T15:07:26.000Z | import os
import pygame
import space_invaders.GameController as GameController
WIDTH, HEIGHT = 1024, 600
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
FPS = 60
BLACK = (0, 0, 0)
def load_asset(asset):
return os.path.join('space_invaders', 'assets', asset)
def draw_window():
pygame.display.update()
d... | 22.403846 | 65 | 0.640343 | import os
import pygame
import space_invaders.GameController as GameController
WIDTH, HEIGHT = 1024, 600
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
FPS = 60
BLACK = (0, 0, 0)
def load_asset(asset):
return os.path.join('space_invaders', 'assets', asset)
def draw_window():
pygame.display.update()
d... | true | true |
1c195043e59155411ef1a8b57146798be367e397 | 249 | py | Python | gastarme/authentications/urls.py | rafaeltardivo/gastarme | 7e97e611118ab61885f5088a0df7ab1792b71e6e | [
"MIT"
] | null | null | null | gastarme/authentications/urls.py | rafaeltardivo/gastarme | 7e97e611118ab61885f5088a0df7ab1792b71e6e | [
"MIT"
] | null | null | null | gastarme/authentications/urls.py | rafaeltardivo/gastarme | 7e97e611118ab61885f5088a0df7ab1792b71e6e | [
"MIT"
] | null | null | null | from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
urlpatterns = [
path('jwt/obtain/', obtain_jwt_token, name='obtain_jwt'),
path('jwt/refresh/', refresh_jwt_token, name='refresh_jwt'),
]
| 27.666667 | 72 | 0.763052 | from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
urlpatterns = [
path('jwt/obtain/', obtain_jwt_token, name='obtain_jwt'),
path('jwt/refresh/', refresh_jwt_token, name='refresh_jwt'),
]
| true | true |
1c195074ecf1862b6c058e58637acf6180300fc7 | 328 | py | Python | easyreg/reproduce_paper_results.py | ebrahimebrahim/easyreg | f767e68af8c2f230f45ef8a5219db9d8ff2b17f0 | [
"Apache-2.0"
] | 107 | 2019-10-29T23:52:54.000Z | 2022-03-30T10:19:20.000Z | easyreg/reproduce_paper_results.py | ebrahimebrahim/easyreg | f767e68af8c2f230f45ef8a5219db9d8ff2b17f0 | [
"Apache-2.0"
] | 8 | 2020-03-03T17:51:38.000Z | 2022-02-28T10:54:37.000Z | easyreg/reproduce_paper_results.py | ebrahimebrahim/easyreg | f767e68af8c2f230f45ef8a5219db9d8ff2b17f0 | [
"Apache-2.0"
] | 10 | 2020-07-15T04:10:33.000Z | 2022-03-30T10:19:23.000Z | reproduce_paper_result=False
# We fix coordinate definition in the identity map, which only affect the learning method in easyreg.
# From learning perspective, this fix should not affect the network convergence.
# We add this flag here to ensure the paper results to be reproducible
# We suggest to set it false in other... | 54.666667 | 101 | 0.804878 | reproduce_paper_result=False
| true | true |
1c1950c5c241cba41a6a1250a53ab0c06e28676b | 3,942 | py | Python | test/functional/feature_minchainwork.py | nhoussay/groom | 87e69a80c1e15e4683ef64c55ac65547910b1c97 | [
"MIT"
] | null | null | null | test/functional/feature_minchainwork.py | nhoussay/groom | 87e69a80c1e15e4683ef64c55ac65547910b1c97 | [
"MIT"
] | null | null | null | test/functional/feature_minchainwork.py | nhoussay/groom | 87e69a80c1e15e4683ef64c55ac65547910b1c97 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test logic for setting nMinimumChainWork on command line.
Nodes don't consider themselves out of "initial b... | 43.8 | 108 | 0.701674 |
import time
from test_framework.test_framework import groomTestFramework
from test_framework.util import connect_nodes, assert_equal
REGTEST_WORK_PER_BLOCK = 2
class MinimumChainWorkTest(groomTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
sel... | true | true |
1c1951ded1d1ad2cf6519f463087509a6beba759 | 2,431 | py | Python | tkapi/util/document.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 9 | 2017-11-16T12:39:11.000Z | 2021-10-16T19:30:52.000Z | tkapi/util/document.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 1 | 2017-11-16T14:20:20.000Z | 2017-11-20T18:49:14.000Z | tkapi/util/document.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 3 | 2018-09-10T18:57:39.000Z | 2020-06-09T14:13:10.000Z | import requests
from tkapi.document import Document
from tkapi.document import DocumentSoort
def get_overheidnl_id(document: Document) -> str or None:
if document.soort == DocumentSoort.SCHRIFTELIJKE_VRAGEN:
return get_kamervraag_overheidnl_id(document)
if document.soort in [DocumentSoort.ANTWOORD_SC... | 42.649123 | 117 | 0.735088 | import requests
from tkapi.document import Document
from tkapi.document import DocumentSoort
def get_overheidnl_id(document: Document) -> str or None:
if document.soort == DocumentSoort.SCHRIFTELIJKE_VRAGEN:
return get_kamervraag_overheidnl_id(document)
if document.soort in [DocumentSoort.ANTWOORD_SC... | true | true |
1c19539e1c6e266cf7b6f75f6720e1727b96f969 | 2,394 | py | Python | gaussian_mask.py | PURE-melo/GRS-Det | fcc16a48ba628e7bca83795120108ae8a4fa3027 | [
"Apache-2.0"
] | 3 | 2021-07-13T11:52:21.000Z | 2022-03-03T03:25:17.000Z | gaussian_mask.py | PURE-melo/GRS-Det | fcc16a48ba628e7bca83795120108ae8a4fa3027 | [
"Apache-2.0"
] | null | null | null | gaussian_mask.py | PURE-melo/GRS-Det | fcc16a48ba628e7bca83795120108ae8a4fa3027 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2
import matplotlib.pyplot as plt
def gaussian(kernel, w):
sigma = ((kernel-1) * 0.5 - 1) * 0.3 + 0.8
s = 2*(sigma**2)
dx = np.exp(-1*w*np.square(np.arange(kernel) - int(kernel / 2)) / s)
return np.reshape(dx,(-1,1))
def gaussian_mask(bbox,imgshape):
segmap... | 36.272727 | 272 | 0.511696 | import numpy as np
import cv2
import matplotlib.pyplot as plt
def gaussian(kernel, w):
sigma = ((kernel-1) * 0.5 - 1) * 0.3 + 0.8
s = 2*(sigma**2)
dx = np.exp(-1*w*np.square(np.arange(kernel) - int(kernel / 2)) / s)
return np.reshape(dx,(-1,1))
def gaussian_mask(bbox,imgshape):
segmap... | true | true |
1c1953e32c5dca2154b081b9282b7fb4ca2fcdee | 1,605 | py | Python | main.py | Slawomir-Kwiatkowski/xml2pandas-sax | ae6b9f122888af6f9d1b90e578b426ff3bb385b6 | [
"MIT"
] | null | null | null | main.py | Slawomir-Kwiatkowski/xml2pandas-sax | ae6b9f122888af6f9d1b90e578b426ff3bb385b6 | [
"MIT"
] | null | null | null | main.py | Slawomir-Kwiatkowski/xml2pandas-sax | ae6b9f122888af6f9d1b90e578b426ff3bb385b6 | [
"MIT"
] | null | null | null | '''
:description: This program reads data from xml file and creates pandas DataFrame object
:author: Sławomir Kwiatkowski
:date: 2020-12-22
'''
import xml.sax
from collections import defaultdict
import pandas as pd
class PersonsHandler(xml.sax.ContentHandler):
def __init__(self):
self.persons = defaultdi... | 37.325581 | 88 | 0.656698 | import xml.sax
from collections import defaultdict
import pandas as pd
class PersonsHandler(xml.sax.ContentHandler):
def __init__(self):
self.persons = defaultdict(list)
def startElement(self, tag, attr):
self.tag = tag
if tag == 'person':
self.persons['id'].append(attr['id'... | true | true |
1c195435729bd80ebfcb07495713d0b8ae843861 | 3,260 | py | Python | python/mxnet/contrib/onnx/onnx2mx/import_model.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 228 | 2018-12-06T09:34:01.000Z | 2022-03-08T17:02:02.000Z | python/mxnet/contrib/onnx/onnx2mx/import_model.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 82 | 2016-03-29T02:40:02.000Z | 2021-02-06T22:20:40.000Z | python/mxnet/contrib/onnx/onnx2mx/import_model.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 58 | 2016-10-27T07:37:08.000Z | 2021-07-03T16:50:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.680851 | 100 | 0.692945 |
from .import_onnx import GraphProto
def import_model(model_file):
graph = GraphProto()
try:
import onnx
except ImportError:
raise ImportError("Onnx and protobuf need to be installed. "
+ "Instructions to install - https://github.com/onnx/onnx")
model_pro... | true | true |
1c195492dcfa94d401a3b5ba1c4ecb8a1123b7fd | 1,626 | py | Python | callback_plugins/stateful.py | agaffney/ansible-stateful-callback | 4e322651ffe09b79207aefd4c2eeea1fadc69907 | [
"MIT"
] | 1 | 2018-02-15T18:08:56.000Z | 2018-02-15T18:08:56.000Z | callback_plugins/stateful.py | agaffney/ansible-stateful-callback | 4e322651ffe09b79207aefd4c2eeea1fadc69907 | [
"MIT"
] | null | null | null | callback_plugins/stateful.py | agaffney/ansible-stateful-callback | 4e322651ffe09b79207aefd4c2eeea1fadc69907 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
# This is meaningless, but it feels right
CALLBACK_TYPE = 'magic'
CALLBACK_NAME = 'stateful'
# Star... | 42.789474 | 135 | 0.589176 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'magic'
CALLBACK_NAME = 'stateful'
CALLBACK_NEEDS_WHITELIST = False
def v... | true | true |
1c1954a6c38e0d6a3feac225a8559c88511d10af | 2,009 | py | Python | scripts/nithya00_constrained_opt_benchmark.py | varunagrawal/GTDynamics | 1f48112a5ffd273c74c5ce2ddda4166e2fae7dff | [
"BSD-2-Clause"
] | 6 | 2021-08-09T23:43:52.000Z | 2021-11-11T16:16:37.000Z | scripts/nithya00_constrained_opt_benchmark.py | varunagrawal/GTDynamics | 1f48112a5ffd273c74c5ce2ddda4166e2fae7dff | [
"BSD-2-Clause"
] | 104 | 2021-08-03T14:15:28.000Z | 2022-03-26T08:18:09.000Z | scripts/nithya00_constrained_opt_benchmark.py | varunagrawal/GTDynamics | 1f48112a5ffd273c74c5ce2ddda4166e2fae7dff | [
"BSD-2-Clause"
] | 4 | 2021-08-02T17:42:28.000Z | 2021-12-24T00:43:17.000Z | """
* GTDynamics Copyright 2020, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* See LICENSE for the license information
*
* @file nithya_yetong00_constrainedopt_benchmark.py
* @brief Plot intermediate results for penalty method optimizer vs augmented lagrangian optimize... | 33.483333 | 99 | 0.690891 |
import math
import numpy as np
import matplotlib.pyplot as plt
def load_data(filename):
data = []
with open(filename) as data_file:
lines = data_file.readlines()
for line in lines:
line = line.split()
line = [float(data) for data in line]
data.append(line)
... | true | true |
1c1955eea2b4de4ab70deb1c87748f28b290383d | 16,973 | py | Python | mlflowrate/mlflowrate/backend/subclasses/integrate.py | kev-fung/mlflowrate | 5fc811fca2dfcfb0df91b3db827b35332bbc5d85 | [
"MIT"
] | null | null | null | mlflowrate/mlflowrate/backend/subclasses/integrate.py | kev-fung/mlflowrate | 5fc811fca2dfcfb0df91b3db827b35332bbc5d85 | [
"MIT"
] | null | null | null | mlflowrate/mlflowrate/backend/subclasses/integrate.py | kev-fung/mlflowrate | 5fc811fca2dfcfb0df91b3db827b35332bbc5d85 | [
"MIT"
] | null | null | null | """Kevin Fung - Github Alias: kkf18
Stage 1: nested class to integrate and clean data.
This module contains the integration and cleaning features for messy oil well data.
Imported csv data must be in one of two formats:
Format1: |datetime|tagname|value|
Format2: |datetime|feature1|feature2|feature3|
Todo:
... | 43.409207 | 117 | 0.576563 |
from pyspark.sql.types import DoubleType
from pyspark.sql import functions as F
from mlflowrate.backend.base import Base
import re
class Integrate(Base):
def __init__(self, dfs):
super().__init__(dfs=dfs)
self._track_org = {}
self._formats = ['date_tag_val_col', 'mult_col', 'dict_col']
... | true | true |
1c19562e76050865a1be7fe49a6383a03b2ea2a5 | 1,868 | py | Python | logzio/handler.py | johnraz/logzio-python-handler | f246ae3431c8b22fbf4efba6b3a15778412cf4a4 | [
"Apache-2.0"
] | null | null | null | logzio/handler.py | johnraz/logzio-python-handler | f246ae3431c8b22fbf4efba6b3a15778412cf4a4 | [
"Apache-2.0"
] | null | null | null | logzio/handler.py | johnraz/logzio-python-handler | f246ae3431c8b22fbf4efba6b3a15778412cf4a4 | [
"Apache-2.0"
] | null | null | null | import datetime
import json
import logging
import logging.handlers
import traceback
from .sender import LogzioSender
class LogzioHandler(logging.Handler):
def __init__(self, token, logzio_type="python", logs_drain_timeout=3,
url="https://listener.logz.io:8071", debug=False):
if token is... | 31.661017 | 115 | 0.625268 | import datetime
import json
import logging
import logging.handlers
import traceback
from .sender import LogzioSender
class LogzioHandler(logging.Handler):
def __init__(self, token, logzio_type="python", logs_drain_timeout=3,
url="https://listener.logz.io:8071", debug=False):
if token is... | true | true |
1c195775c8408ccf49e6967850e0322d9f7a6554 | 2,278 | py | Python | my_classes/.history/Tuples/modifying_extending_named_tuples_20210723171701.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/Tuples/modifying_extending_named_tuples_20210723171701.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/Tuples/modifying_extending_named_tuples_20210723171701.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | ''' Modifying and extending Named Tuples
Named tuples are immutable
How we can change values inside the tuple
Just like with strings, we have to create a new tuple, with the modified values
Point2D = namedtuple('Point2D', 'x y')
pt = Point2D(0, 0) # will not work
Suppose we need to change t... | 27.780488 | 104 | 0.721247 | true | true | |
1c195790313061c2b6b1cf183884f53bc6264218 | 7,607 | py | Python | plugins/Protector/plugin.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 476 | 2015-01-04T17:42:59.000Z | 2021-08-13T07:40:54.000Z | plugins/Protector/plugin.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 491 | 2015-01-01T04:12:23.000Z | 2021-08-12T19:24:47.000Z | plugins/Protector/plugin.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 203 | 2015-01-02T18:29:43.000Z | 2021-08-15T12:52:22.000Z | ###
# Copyright (c) 2004, Jeremiah Fincher
# Copyright (c) 2010-2021, The Limnoria Contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain t... | 46.384146 | 81 | 0.618904 |
import supybot.utils as utils
import supybot.ircdb as ircdb
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Protector')
class Protector(callbacks.P... | true | true |
1c19580713f27f6ceb6552e63f13ee91775b8708 | 3,547 | py | Python | src/pydoc_markdown/contrib/processors/sphinx.py | tbm/pydoc-markdown | 23acd246a327b6ea48e94a6a1101091a7b510f78 | [
"MIT"
] | null | null | null | src/pydoc_markdown/contrib/processors/sphinx.py | tbm/pydoc-markdown | 23acd246a327b6ea48e94a6a1101091a7b510f78 | [
"MIT"
] | null | null | null | src/pydoc_markdown/contrib/processors/sphinx.py | tbm/pydoc-markdown | 23acd246a327b6ea48e94a6a1101091a7b510f78 | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
# Copyright (c) 2019 Niklas Rosenstein
#
# 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, mo... | 32.245455 | 93 | 0.655202 |
from nr.databind.core import Struct
from nr.interface import implements, override
from pydoc_markdown.interfaces import Processor
import re
def generate_sections_markdown(lines, sections):
for key, section in sections.items():
if lines and lines[-1]:
lines.append('')
lines.extend(['**{}**:'.format(... | true | true |
1c195a9dae1da7dc05e25a6f0f8f1f9fb55a7872 | 85 | py | Python | Django/django_project_lsc_02/Auser/apps.py | MarioKarting/Django_basic | 437556628f72ccf8fdfd63c46191dcee39602b00 | [
"MIT"
] | 2 | 2019-05-16T09:32:49.000Z | 2019-05-16T09:32:52.000Z | Django/django_project_lsc_02/Auser/apps.py | MarioKarting/Django_basic | 437556628f72ccf8fdfd63c46191dcee39602b00 | [
"MIT"
] | null | null | null | Django/django_project_lsc_02/Auser/apps.py | MarioKarting/Django_basic | 437556628f72ccf8fdfd63c46191dcee39602b00 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AuserConfig(AppConfig):
name = 'Auser'
| 14.166667 | 33 | 0.741176 | from django.apps import AppConfig
class AuserConfig(AppConfig):
name = 'Auser'
| true | true |
1c195b1c5ac2d26bbda2d0c3a3d26cf9872d9afb | 444 | py | Python | fdk_client/platform/models/MetaDataListingFilterResponse.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/MetaDataListingFilterResponse.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/MetaDataListingFilterResponse.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
from .MetaDataListingFilterMetaResponse import MetaDataListingFilterMetaResponse
class MetaDataListingFilterResponse(BaseSchema):
# Catalog swagge... | 24.666667 | 104 | 0.79955 |
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
from .MetaDataListingFilterMetaResponse import MetaDataListingFilterMetaResponse
class MetaDataListingFilterResponse(BaseSchema):
data = fields.List(fields.Nes... | true | true |
1c195c58128ad5ec854d2f6a5b0f81869c1eef25 | 13,749 | py | Python | src/predict_ball_pos/src/kalman_utils/utils.py | diddytpq/Predict-Tennisball-LandingPoint | 0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a | [
"MIT"
] | null | null | null | src/predict_ball_pos/src/kalman_utils/utils.py | diddytpq/Predict-Tennisball-LandingPoint | 0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a | [
"MIT"
] | null | null | null | src/predict_ball_pos/src/kalman_utils/utils.py | diddytpq/Predict-Tennisball-LandingPoint | 0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a | [
"MIT"
] | 1 | 2021-09-28T05:12:58.000Z | 2021-09-28T05:12:58.000Z | import cv2
import numpy as np
import os
import math
from scipy.spatial import distance as dist
from collections import OrderedDict
lower_green = np.array([89, 250, 250])
upper_green = np.array([90, 255, 255])
lower_rgb = np.array([10,180,120])
upper_rgb = np.array([40,255,250])
class Bouncing_point():
def __in... | 29.067653 | 134 | 0.561495 | import cv2
import numpy as np
import os
import math
from scipy.spatial import distance as dist
from collections import OrderedDict
lower_green = np.array([89, 250, 250])
upper_green = np.array([90, 255, 255])
lower_rgb = np.array([10,180,120])
upper_rgb = np.array([40,255,250])
class Bouncing_point():
def __in... | true | true |
1c195c9113b6e898b4375d3ed5519cf8ae7e0aca | 25,309 | py | Python | typed_python/compiler/tests/compiler_typed_python_comparison_test.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 105 | 2019-12-02T01:44:46.000Z | 2022-03-28T20:27:38.000Z | typed_python/compiler/tests/compiler_typed_python_comparison_test.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 173 | 2019-10-08T19:37:06.000Z | 2022-01-24T18:43:42.000Z | typed_python/compiler/tests/compiler_typed_python_comparison_test.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 1 | 2020-01-23T00:06:42.000Z | 2020-01-23T00:06:42.000Z | # Copyright 2017-2019 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.795226 | 129 | 0.629974 |
import pytest
import typed_python
import numpy
import unittest
import traceback
from typed_python import TupleOf, Float32, Int32, ListOf, Function
class Operation:
def __init__(self):
self._compiledFunctionCache = {}
def arity(self):
raise NotImplementedError(self)
def name(self):
... | true | true |
1c195d158c6e0fd3afe0b120a293cb7d32b7833e | 3,379 | py | Python | pipert/contrib/database/handler.py | Elon-Abulafia/PipeRT | fba46d67a6dd546a9d70c3d854c3b7d3910f82ba | [
"MIT"
] | 10 | 2020-01-20T16:00:55.000Z | 2020-05-13T12:48:40.000Z | pipert/contrib/database/handler.py | Elon-Abulafia/PipeRT | fba46d67a6dd546a9d70c3d854c3b7d3910f82ba | [
"MIT"
] | 97 | 2020-01-11T22:05:50.000Z | 2020-06-25T13:43:13.000Z | pipert/contrib/database/handler.py | Elon-Abulafia/PipeRT | fba46d67a6dd546a9d70c3d854c3b7d3910f82ba | [
"MIT"
] | 8 | 2020-01-14T20:54:19.000Z | 2020-04-07T22:59:17.000Z | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import exc as sql_exc
from abc import ABCMeta, abstractmethod
import re
class PSQLDBHandler(metaclass=ABCMeta):
def __init__(self, db_conf: dict, logger) -> None:
"""
Initializes the database handler, establishes a connection and def... | 28.158333 | 94 | 0.70879 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import exc as sql_exc
from abc import ABCMeta, abstractmethod
import re
class PSQLDBHandler(metaclass=ABCMeta):
def __init__(self, db_conf: dict, logger) -> None:
self.logger = logger
self.tables = dict()
self.app = Flask(__name... | true | true |
1c195e588916b739a40f49d7bcf57b2499398c94 | 4,777 | py | Python | docs/conf.py | sylwekczmil/sevq | 374346c01fb7206df24a61fb40173c4ab13c87a1 | [
"MIT"
] | 1 | 2021-11-29T18:52:15.000Z | 2021-11-29T18:52:15.000Z | docs/conf.py | sylwekczmil/sevq | 374346c01fb7206df24a61fb40173c4ab13c87a1 | [
"MIT"
] | 1 | 2021-11-24T19:26:41.000Z | 2021-11-24T19:28:25.000Z | docs/conf.py | sylwekczmil/sevq | 374346c01fb7206df24a61fb40173c4ab13c87a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# sevq documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | 29.128049 | 77 | 0.682855 |
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
import sevq
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'sevq'
copyright = "2021, Sylwester Czmil"
html_show_copyright = False
author = "Sylwester... | true | true |
1c195f1dcd051b223f1de0550da9ef7cb675dd05 | 22,947 | py | Python | sdk/python/pulumi_azure_native/compute/v20181001/virtual_machine_scale_set_extension.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/compute/v20181001/virtual_machine_scale_set_extension.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/compute/v20181001/virtual_machine_scale_set_extension.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 53.614486 | 2,369 | 0.694296 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['VirtualMachineScaleSetExtensionInitArgs', 'VirtualMachineScaleSetExtension']
@pulumi.input_type
class VirtualMachineScaleSetExtensionInitArgs:
def __init... | true | true |
1c195fa9a1580d09dea1f4c372f34c15a8b44601 | 8,383 | py | Python | sdk/lusid_asyncio/models/resource_list_of_instrument_id_type_descriptor.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/resource_list_of_instrument_id_type_descriptor.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/resource_list_of_instrument_id_type_descriptor.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3923
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 31.397004 | 140 | 0.618394 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re import six
from lusid_asyncio.configuration import Configuration
class ResourceListOfInstrumentIdTypeDescriptor(object):
openapi_types = {
'values': 'list[Inst... | true | true |
1c19602993d04ba4d7b317724394c800b5f22bc3 | 876 | py | Python | aidet/evaluator/__init__.py | zcl912/AIdetection | 54fa6fea92fd63540ca372ccdc70bc201aac8b52 | [
"Apache-2.0"
] | null | null | null | aidet/evaluator/__init__.py | zcl912/AIdetection | 54fa6fea92fd63540ca372ccdc70bc201aac8b52 | [
"Apache-2.0"
] | null | null | null | aidet/evaluator/__init__.py | zcl912/AIdetection | 54fa6fea92fd63540ca372ccdc70bc201aac8b52 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 zcl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 33.692308 | 74 | 0.752283 |
import copy
from .coco_detection import CocoDetectionEvaluator
def build_evaluator(cfg, dataset):
evaluator_cfg = copy.deepcopy(cfg)
name = evaluator_cfg.pop("name")
if name == "CocoDetectionEvaluator":
return CocoDetectionEvaluator(dataset)
else:
raise NotImplementedError | true | true |
1c19625e0eef62422f95cf80fb63458c22e90795 | 2,012 | py | Python | main10.py | Soulzippey/E01a-Control-Structues | 946571eca27919dde48029db9036874fe8e17bfc | [
"MIT"
] | null | null | null | main10.py | Soulzippey/E01a-Control-Structues | 946571eca27919dde48029db9036874fe8e17bfc | [
"MIT"
] | null | null | null | main10.py | Soulzippey/E01a-Control-Structues | 946571eca27919dde48029db9036874fe8e17bfc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys, utils, random # import the modules we will need
utils.check_version((3,7)) # make sure we are running at least Python 3.7
utils.clear() # clear the screen
print('Greetings!') # writes out Greetings!
colors = ['red','orange','yellow','green... | 67.066667 | 206 | 0.675944 |
import sys, utils, random
utils.check_version((3,7)) utils.clear()
print('Greetings!') colors = ['red','orange','yellow','green','blue','violet','purple'] play_again = '' best_count = sys.maxsize while (play_again != 'n' and play_again != 'no'): match_color =... | true | true |
1c19627d94f14f23ba6658d1bb92e364dac27f6e | 1,894 | py | Python | download-all-repos/main.py | abstraction/github-utilities | 51839de26b8c094a97cc4837af6b9650c0304921 | [
"MIT"
] | null | null | null | download-all-repos/main.py | abstraction/github-utilities | 51839de26b8c094a97cc4837af6b9650c0304921 | [
"MIT"
] | null | null | null | download-all-repos/main.py | abstraction/github-utilities | 51839de26b8c094a97cc4837af6b9650c0304921 | [
"MIT"
] | null | null | null | """
Download and delete all Github repositories
- Replace credentials in .env
- Replace credentials below
- Run
"""
import csv
import requests
from dotenv import dotenv_values
from git import Repo
TOTAL = 500 # Number of repositories
CSV_PATH = '/Users/<user>/Desktop' # P.S. No trailing /
# Don't change anything ... | 37.88 | 116 | 0.595565 |
import csv
import requests
from dotenv import dotenv_values
from git import Repo
TOTAL = 500 CSV_PATH = '/Users/<user>/Desktop'
config = dotenv_values(".env")
PAGES = round(TOTAL / 100)
i = 0
headers = {
'Accept': 'application/vnd.github.v3+json',
'Authorization': f'token {config["API_TOKEN"]}',
}
if _... | true | true |
1c196329dbccc6ee17b919ab4ff48c4f4420233a | 4,112 | py | Python | nebula_meta/nebula_meta/model/sequence_variable_meta.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 2 | 2019-03-17T04:03:08.000Z | 2019-05-01T09:42:23.000Z | nebula_meta/nebula_meta/model/sequence_variable_meta.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | null | null | null | nebula_meta/nebula_meta/model/sequence_variable_meta.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 4 | 2019-06-24T05:47:24.000Z | 2020-09-29T05:00:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from ..property import Property
from ..variable_meta import VariableMeta
from ..util import text
__author__ = "nebula"
class SequenceValueVariableMeta(VariableMeta):
TYPE = "sequencevalue"
def __init__(self, *args, **kwargs):
kwargs["type"] ... | 29.582734 | 102 | 0.653696 | import json
from ..property import Property
from ..variable_meta import VariableMeta
from ..util import text
__author__ = "nebula"
class SequenceValueVariableMeta(VariableMeta):
TYPE = "sequencevalue"
def __init__(self, *args, **kwargs):
kwargs["type"] = SequenceValueVariableMeta.TYPE
Varia... | true | true |
1c1963dbc8f8ba79644592bd04b5ba967f65180f | 128,942 | py | Python | Keras_tensorflow_nightly/source2.7/keras/engine/topology.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2021-09-04T01:56:47.000Z | 2021-09-04T01:56:47.000Z | Keras_tensorflow_nightly/source2.7/keras/engine/topology.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Keras_tensorflow_nightly/source2.7/keras/engine/topology.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 2 | 2018-07-23T06:57:42.000Z | 2021-03-31T03:15:38.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import json
import yaml
import warnings
import copy
import os
import re
from six.moves import zip
from .. import backend as K
from .. import initializers
from ..utils... | 41.433805 | 121 | 0.549262 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import json
import yaml
import warnings
import copy
import os
import re
from six.moves import zip
from .. import backend as K
from .. import initializers
from ..utils.io_utils import ask_to_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.