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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7625e371c8678dbc7145ea0d46abab22aaf8b64 | 1,042 | py | Python | scripts/addons/animation_nodes/operators/choose_id_key.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 2 | 2020-04-16T22:12:40.000Z | 2022-01-22T17:18:45.000Z | scripts/addons/animation_nodes/operators/choose_id_key.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | null | null | null | scripts/addons/animation_nodes/operators/choose_id_key.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 2 | 2019-05-16T04:01:09.000Z | 2020-08-25T11:42:26.000Z | import bpy
from bpy.props import *
from .. id_keys import getAllIDKeys
from .. utils.unicode import toValidString, fromValidString
class IDKeySearch(bpy.types.Operator):
bl_idname = "an.choose_id_key"
bl_label = "ID Key Search"
bl_options = {"REGISTER"}
bl_property = "item"
def getSearchItems(self... | 31.575758 | 72 | 0.647793 | import bpy
from bpy.props import *
from .. id_keys import getAllIDKeys
from .. utils.unicode import toValidString, fromValidString
class IDKeySearch(bpy.types.Operator):
bl_idname = "an.choose_id_key"
bl_label = "ID Key Search"
bl_options = {"REGISTER"}
bl_property = "item"
def getSearchItems(self... | true | true |
f7625e564f657a3dd5d6c72381520416a775e884 | 2,645 | py | Python | portfolio-theory/updating_stock_prices.py | artjoms-formulevics/portfolio-builder | d9aa593d52594b795691f7893bd86740ff0eec84 | [
"MIT"
] | 2 | 2021-04-07T19:05:16.000Z | 2021-06-01T11:36:01.000Z | portfolio-theory/updating_stock_prices.py | artjoms-formulevics/portfolio-builder | d9aa593d52594b795691f7893bd86740ff0eec84 | [
"MIT"
] | 4 | 2021-06-02T04:24:09.000Z | 2022-01-13T03:43:21.000Z | portfolio-theory/updating_stock_prices.py | artjoms-formulevics/portfolio-builder | d9aa593d52594b795691f7893bd86740ff0eec84 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 1 10:35:28 2020
@author: afo
"""
from os import listdir
from os.path import isfile, join, abspath
import os
from inspect import getsourcefile
import pandas as pd
from datetime import datetime, timedelta
import pandas_datareader as pdr
# Function ... | 31.86747 | 105 | 0.603403 |
from os import listdir
from os.path import isfile, join, abspath
import os
from inspect import getsourcefile
import pandas as pd
from datetime import datetime, timedelta
import pandas_datareader as pdr
def update_prices():
p = abspath(getsourcefile(lambda:0))
p = p.rsplit('/', 1)[0]
os.chdir(p)
p... | true | true |
f7625f01c25bebd97845e97558d4d0abf110f6da | 366 | py | Python | hello.py | Feitumtum/Personal_Projects | 2563cf27f1068239dab379a7d301a21e3a7fec8e | [
"MIT"
] | null | null | null | hello.py | Feitumtum/Personal_Projects | 2563cf27f1068239dab379a7d301a21e3a7fec8e | [
"MIT"
] | null | null | null | hello.py | Feitumtum/Personal_Projects | 2563cf27f1068239dab379a7d301a21e3a7fec8e | [
"MIT"
] | null | null | null | # This program says hello and asks for my name.
print('Hello, world!')
print('What is your name?') # ask for their name
myName = input()
print('It is good to meet you, ' + myName)
print('The length of your name is:')
print(len(myName))
print('What is your age?') # ask for their age
myAge = input()
print('You wil... | 30.5 | 59 | 0.653005 |
print('Hello, world!')
print('What is your name?') myName = input()
print('It is good to meet you, ' + myName)
print('The length of your name is:')
print(len(myName))
print('What is your age?') myAge = input()
print('You will be ' + str(int(myAge) + 1) + ' in a year.')
| true | true |
f7625f45b03a82448a1661f06a22ea62a31cbd27 | 46,375 | py | Python | google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 40.361184 | 176 | 0.607569 | from collections import OrderedDict
import functools
import re
from typing import (
Dict,
Mapping,
Optional,
AsyncIterable,
Awaitable,
Sequence,
Tuple,
Type,
Union,
)
import pkg_resources
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions... | true | true |
f762606aad64e81e85b22a162e9a630d4da788cf | 1,527 | py | Python | src/newton_zero/play_game/gui.py | harvzhang/newton-zero | 4ce11360cca299010c440b0f205b8e4b2da1be0d | [
"MIT"
] | null | null | null | src/newton_zero/play_game/gui.py | harvzhang/newton-zero | 4ce11360cca299010c440b0f205b8e4b2da1be0d | [
"MIT"
] | null | null | null | src/newton_zero/play_game/gui.py | harvzhang/newton-zero | 4ce11360cca299010c440b0f205b8e4b2da1be0d | [
"MIT"
] | null | null | null | from logging import getLogger
from newton_zero.config import Config, PlayWithHumanConfig
from newton_zero.play_game.game_model import PlayWithHuman
from newton_zero.env.newton_env import NewtonEnv, Player, Winner
from random import random
logger = getLogger(__name__)
def start(config: Config):
PlayWithHumanCon... | 32.489362 | 64 | 0.567125 | from logging import getLogger
from newton_zero.config import Config, PlayWithHumanConfig
from newton_zero.play_game.game_model import PlayWithHuman
from newton_zero.env.newton_env import NewtonEnv, Player, Winner
from random import random
logger = getLogger(__name__)
def start(config: Config):
PlayWithHumanCon... | true | true |
f7626274c8054658bc8f6f829a035e625c2bcbc1 | 4,668 | py | Python | gnocchi/cli.py | NeCTAR-RC/gnocchi | aa2e5d1ce03291d492808b60c674537733d3f1a9 | [
"Apache-2.0"
] | null | null | null | gnocchi/cli.py | NeCTAR-RC/gnocchi | aa2e5d1ce03291d492808b60c674537733d3f1a9 | [
"Apache-2.0"
] | null | null | null | gnocchi/cli.py | NeCTAR-RC/gnocchi | aa2e5d1ce03291d492808b60c674537733d3f1a9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Mirantis Inc.
# Copyright (c) 2015 Red Hat
#
# 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 applic... | 29.923077 | 77 | 0.645673 | import logging
import multiprocessing
import signal
import sys
import time
from oslo_config import cfg
from oslo_utils import timeutils
import retrying
from gnocchi import indexer
from gnocchi.rest import app
from gnocchi import service
from gnocchi import statsd as statsd_service
from gnocchi import storage
LOG = ... | true | true |
f762630a42a96475b41d886344206e88ac683746 | 3,966 | py | Python | tests/scripts/test_auth.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-21T18:09:09.000Z | 2022-01-17T08:06:03.000Z | tests/scripts/test_auth.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | tests/scripts/test_auth.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Test the auth script to manage local users."""
from unittest.mock import Mock, patch
import pytest
from homeassistant.scripts import auth as script_auth
from homeassistant.auth.providers import homeassistant as hass_auth
from tests.common import register_auth_provider
@pytest.fixture
def provider(hass):
"""... | 30.984375 | 82 | 0.684569 | from unittest.mock import Mock, patch
import pytest
from homeassistant.scripts import auth as script_auth
from homeassistant.auth.providers import homeassistant as hass_auth
from tests.common import register_auth_provider
@pytest.fixture
def provider(hass):
provider = hass.loop.run_until_complete(
regi... | true | true |
f76263da095003b729fc5dd6002a028b9ff4348c | 15 | py | Python | test1.py | wdougmiller/pyneta | 954ecf6aee1e397d069bfc9ff93a4db18339d947 | [
"Apache-2.0"
] | null | null | null | test1.py | wdougmiller/pyneta | 954ecf6aee1e397d069bfc9ff93a4db18339d947 | [
"Apache-2.0"
] | null | null | null | test1.py | wdougmiller/pyneta | 954ecf6aee1e397d069bfc9ff93a4db18339d947 | [
"Apache-2.0"
] | null | null | null | print("test1")
| 7.5 | 14 | 0.666667 | print("test1")
| true | true |
f762646a15b3d74450b62377ac7b4d623eacbbf9 | 1,030 | py | Python | makeDBs.py | rammk1999/roomate-app | fbfbd56244327bfd866feab3e6dfc32449815d75 | [
"CC-BY-3.0"
] | null | null | null | makeDBs.py | rammk1999/roomate-app | fbfbd56244327bfd866feab3e6dfc32449815d75 | [
"CC-BY-3.0"
] | null | null | null | makeDBs.py | rammk1999/roomate-app | fbfbd56244327bfd866feab3e6dfc32449815d75 | [
"CC-BY-3.0"
] | null | null | null | import sqlite3
with sqlite3.connect("accounts.db") as connection:
c = connection.cursor()
c.execute('CREATE TABLE accounts(firstName TEXT, lastName TEXT, email TEXT, groupName TEXT)')
c.execute('INSERT INTO accounts VALUES("Ram", "Muthukumaran", "rammk1999@gmail.com", "group")')
c.execute('INSERT INTO... | 49.047619 | 191 | 0.716505 | import sqlite3
with sqlite3.connect("accounts.db") as connection:
c = connection.cursor()
c.execute('CREATE TABLE accounts(firstName TEXT, lastName TEXT, email TEXT, groupName TEXT)')
c.execute('INSERT INTO accounts VALUES("Ram", "Muthukumaran", "rammk1999@gmail.com", "group")')
c.execute('INSERT INTO... | true | true |
f76264897fe7655f4ec3ed16b43d6a5f37cfec0c | 1,880 | py | Python | aliyun-python-sdk-cms/aliyunsdkcms/request/v20180308/QueryCustomMetricListRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-cms/aliyunsdkcms/request/v20180308/QueryCustomMetricListRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cms/aliyunsdkcms/request/v20180308/QueryCustomMetricListRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.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... | 31.333333 | 80 | 0.746809 |
from aliyunsdkcore.request import RpcRequest
class QueryCustomMetricListRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Cms', '2018-03-08', 'QueryCustomMetricList','cms')
def get_Size(self):
return self.get_query_params().get('Size')
def set_Size(self,Size):
self.add_query_param('... | true | true |
f76264c55437fc9d25a1790ecf8accd82d9a88d3 | 1,644 | py | Python | syntax_analysis/code/process_fimo_output.py | minjunp/scATAC-seq | 31bc80caaa06a650a0205686b3ee7ee7b2030417 | [
"MIT"
] | null | null | null | syntax_analysis/code/process_fimo_output.py | minjunp/scATAC-seq | 31bc80caaa06a650a0205686b3ee7ee7b2030417 | [
"MIT"
] | null | null | null | syntax_analysis/code/process_fimo_output.py | minjunp/scATAC-seq | 31bc80caaa06a650a0205686b3ee7ee7b2030417 | [
"MIT"
] | null | null | null |
import sys
def does_exist(cur_list, start_loc, end_loc):
for s, e, _ in cur_list:
if (s >= start_loc and s <= end_loc) or (start_loc >= s and start_loc <= e):
return True
return False
def read_fimo(fimo_input):
fimo_dict = {}
with open(fimo_input, "r") as f:
for line in f:
line = line.strip()
if lin... | 26.95082 | 104 | 0.647202 |
import sys
def does_exist(cur_list, start_loc, end_loc):
for s, e, _ in cur_list:
if (s >= start_loc and s <= end_loc) or (start_loc >= s and start_loc <= e):
return True
return False
def read_fimo(fimo_input):
fimo_dict = {}
with open(fimo_input, "r") as f:
for line in f:
line = line.strip()
if lin... | true | true |
f76265cdd5735f5db0e08300fb03b62c5e01bce9 | 1,906 | py | Python | App/exts/face_sdk/api_usage/face_feature.py | mundanePeo/faceRecognition | f3340343a8448372e1031b16ba3c8928419bb9e6 | [
"MIT"
] | 14 | 2021-05-10T07:57:25.000Z | 2022-03-10T07:32:43.000Z | App/exts/face_sdk/api_usage/face_feature.py | mundanePeo/faceRecognition | f3340343a8448372e1031b16ba3c8928419bb9e6 | [
"MIT"
] | 1 | 2021-06-22T13:43:32.000Z | 2021-06-23T12:47:16.000Z | App/exts/face_sdk/api_usage/face_feature.py | mundanePeo/faceRecognition | f3340343a8448372e1031b16ba3c8928419bb9e6 | [
"MIT"
] | null | null | null | """
@author: mjs
@based: JiXuan Xu, Jun Wang
"""
import yaml
import cv2
import numpy as np
from .logFile import logger
from ..core.model_loader.face_recognition.FaceRecModelLoader import FaceRecModelLoader
from ..core.model_handler.face_recognition.FaceRecModelHandler import FaceRecModelHandler
with ope... | 31.245902 | 90 | 0.668416 |
import yaml
import cv2
import numpy as np
from .logFile import logger
from ..core.model_loader.face_recognition.FaceRecModelLoader import FaceRecModelLoader
from ..core.model_handler.face_recognition.FaceRecModelHandler import FaceRecModelHandler
with open('config/model_conf.yaml') as f:
model_conf = y... | true | true |
f762668cc221ccc97b0a2bc9a68481b04c0077f0 | 1,032 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/encodings/iso2022_jp_3.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/encodings/iso2022_jp_3.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/encodings/iso2022_jp_3.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: iso2022_jp_3.py
import _codecs_iso2022
import codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(code... | 31.272727 | 226 | 0.78876 | import _codecs_iso2022
import codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder):
codec = codec
class Incrementa... | true | true |
f76268007b9bcd6d0e0c1a12e044649e7cec81b3 | 1,033 | py | Python | sdb/patchbits.py | evil-e/python-sdb | 047207b7b7931abbd03ccf15910c94868a9671a7 | [
"Apache-2.0"
] | 91 | 2015-07-10T01:58:26.000Z | 2022-03-29T21:13:07.000Z | sdb/patchbits.py | josealvara/python-sdb | a0e60232d0dc8430a312afca5836a9ffb6a46432 | [
"Apache-2.0"
] | 2 | 2015-07-10T15:01:38.000Z | 2017-11-10T18:54:49.000Z | sdb/patchbits.py | josealvara/python-sdb | a0e60232d0dc8430a312afca5836a9ffb6a46432 | [
"Apache-2.0"
] | 25 | 2015-07-09T17:46:56.000Z | 2022-01-02T08:55:50.000Z | from vstruct import VStruct
from vstruct.primitives import v_bytes
from vstruct.primitives import v_uint32
from vstruct.primitives import v_wstr
from vstruct.primitives import v_enum
PATCH_ACTIONS = v_enum()
PATCH_ACTIONS.PATCH_REPLACE = 0x2
PATCH_ACTIONS.PATCH_MATCH = 0x4
MAX_MODULE = 32
# from: https://github.co... | 31.30303 | 65 | 0.698935 | from vstruct import VStruct
from vstruct.primitives import v_bytes
from vstruct.primitives import v_uint32
from vstruct.primitives import v_wstr
from vstruct.primitives import v_enum
PATCH_ACTIONS = v_enum()
PATCH_ACTIONS.PATCH_REPLACE = 0x2
PATCH_ACTIONS.PATCH_MATCH = 0x4
MAX_MODULE = 32
class PATCHBITS(VStruct):... | true | true |
f7626843f2df21b5eea3c69cc630dd9f277190ee | 1,331 | py | Python | core/controllers/custom_landing_pages.py | netajik/oppia | d3780352d615db7438e010c5aa5eb60588bb7de6 | [
"Apache-2.0"
] | null | null | null | core/controllers/custom_landing_pages.py | netajik/oppia | d3780352d615db7438e010c5aa5eb60588bb7de6 | [
"Apache-2.0"
] | 1 | 2020-01-26T14:02:43.000Z | 2020-01-26T14:02:43.000Z | core/controllers/custom_landing_pages.py | netajik/oppia | d3780352d615db7438e010c5aa5eb60588bb7de6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Copyright 2015 The Oppia 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 requir... | 34.128205 | 78 | 0.71976 |
from core.controllers import base
from core.domain import acl_decorators
class FractionLandingPage(base.BaseHandler):
@acl_decorators.open_access
def get(self):
viewer_type = self.request.get('viewerType')
if not viewer_type:
viewer_type = 'teacher'
self.redirect('... | true | true |
f762685cf2fa12be0ee7b132329c7f76c387a326 | 737 | py | Python | {{cookiecutter.project_slug}}/backend/app/app/backend_pre_start.py | abnerjacobsen/full-stack | f9c08f65a8c8ef68127c671f12c43d29656dcf16 | [
"MIT"
] | 516 | 2018-03-06T19:20:47.000Z | 2022-03-30T22:22:11.000Z | {{cookiecutter.project_slug}}/backend/app/app/backend_pre_start.py | abnerjacobsen/full-stack | f9c08f65a8c8ef68127c671f12c43d29656dcf16 | [
"MIT"
] | 23 | 2018-03-21T19:38:40.000Z | 2020-12-27T23:08:09.000Z | {{cookiecutter.project_slug}}/backend/app/app/backend_pre_start.py | abnerjacobsen/full-stack | f9c08f65a8c8ef68127c671f12c43d29656dcf16 | [
"MIT"
] | 85 | 2018-03-29T16:46:40.000Z | 2022-01-27T18:47:39.000Z | import logging
from tenacity import retry, stop_after_attempt, wait_fixed, before_log, after_log
from app.db.external_session import db_session
from app.db.init_db import init_db
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
max_tries = 60 * 5 # 5 minutes
wait_seconds = 1
@retry(
... | 21.676471 | 81 | 0.735414 | import logging
from tenacity import retry, stop_after_attempt, wait_fixed, before_log, after_log
from app.db.external_session import db_session
from app.db.init_db import init_db
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
max_tries = 60 * 5 wait_seconds = 1
@retry(
stop=stop... | true | true |
f762690557f5e05db285f582d9ec43067fd54654 | 53,994 | py | Python | tests/testLearningMM.py | JackBenny39/mmabm | e79d91232016167bff914495ee63e18063a1697b | [
"BSD-3-Clause"
] | 2 | 2019-04-23T17:16:54.000Z | 2019-05-30T17:15:48.000Z | tests/testLearningMM.py | JackBenny39/mmabm | e79d91232016167bff914495ee63e18063a1697b | [
"BSD-3-Clause"
] | null | null | null | tests/testLearningMM.py | JackBenny39/mmabm | e79d91232016167bff914495ee63e18063a1697b | [
"BSD-3-Clause"
] | null | null | null | import random
import unittest
import numpy as np
from mmabm.shared import Side, OType
from mmabm.learner import MarketMakerL
class TestTrader(unittest.TestCase):
def setUp(self):
self.l1 = self._makeMML(3001, 1)
self.q1 = {'order_id': 1, 'timestamp': 1, 'type': OTyp... | 52.625731 | 162 | 0.601067 | import random
import unittest
import numpy as np
from mmabm.shared import Side, OType
from mmabm.learner import MarketMakerL
class TestTrader(unittest.TestCase):
def setUp(self):
self.l1 = self._makeMML(3001, 1)
self.q1 = {'order_id': 1, 'timestamp': 1, 'type': OTyp... | true | true |
f7626963366070a48a26c591516a2aef94d0fff4 | 632 | py | Python | Code/5.py | tritoke/adventOfCode | 182952111977ffa01daff2156fad10bfd2d0963d | [
"Unlicense"
] | null | null | null | Code/5.py | tritoke/adventOfCode | 182952111977ffa01daff2156fad10bfd2d0963d | [
"Unlicense"
] | null | null | null | Code/5.py | tritoke/adventOfCode | 182952111977ffa01daff2156fad10bfd2d0963d | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3.7
from time import time
from string import ascii_lowercase as letters
polymer = open("inputs/5.txt").read().strip()
def reactPolymer(x):
stack = []
for i in x:
if stack and stack[-1].swapcase() == i:
stack.pop()
else:
stack.append(i)
return stack
... | 28.727273 | 159 | 0.629747 | from time import time
from string import ascii_lowercase as letters
polymer = open("inputs/5.txt").read().strip()
def reactPolymer(x):
stack = []
for i in x:
if stack and stack[-1].swapcase() == i:
stack.pop()
else:
stack.append(i)
return stack
t0 = time()
reacted =... | true | true |
f76269ac46c953ad0d05566afa9744a3c910c093 | 795 | py | Python | pylite/pylite.py | ironbars/python-pylite | 9b7b3e4f7a1fb28ce9cce18b830663c6eb5b63e6 | [
"MIT"
] | null | null | null | pylite/pylite.py | ironbars/python-pylite | 9b7b3e4f7a1fb28ce9cce18b830663c6eb5b63e6 | [
"MIT"
] | null | null | null | pylite/pylite.py | ironbars/python-pylite | 9b7b3e4f7a1fb28ce9cce18b830663c6eb5b63e6 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import sqlite3
from .session import PylitePromptSession
from .commands import handle_dot_command
def main(database):
session = PylitePromptSession(connection=sqlite3.connect(database))
while True:
try:
text = session.prompt()
if text.startswith(... | 24.090909 | 71 | 0.594969 |
import sys
import sqlite3
from .session import PylitePromptSession
from .commands import handle_dot_command
def main(database):
session = PylitePromptSession(connection=sqlite3.connect(database))
while True:
try:
text = session.prompt()
if text.startswith("."):
... | true | true |
f7626ad04dc4572b0a67b0b18bf7c51a5f2bd3b5 | 8,904 | py | Python | BackEnd/MLServices.py | nventurino/athena | 2f352dec5e7bb04cfe7e16de7fbb9f22eaed98fd | [
"MIT"
] | null | null | null | BackEnd/MLServices.py | nventurino/athena | 2f352dec5e7bb04cfe7e16de7fbb9f22eaed98fd | [
"MIT"
] | 2 | 2021-02-20T00:29:30.000Z | 2021-02-20T04:07:50.000Z | BackEnd/MLServices.py | nventurino/athena | 2f352dec5e7bb04cfe7e16de7fbb9f22eaed98fd | [
"MIT"
] | 1 | 2021-02-18T22:19:22.000Z | 2021-02-18T22:19:22.000Z | from shutil import rmtree
import json
from flask import Flask, request, Response, render_template, jsonify, make_response
from flask_cors import CORS
import boto3
import json
import time
from helpers import get_bucketed_utterances, score_emotion_utterances
from flag_sentences import detect_nuggets
from botocore.config ... | 38.37931 | 139 | 0.603886 | from shutil import rmtree
import json
from flask import Flask, request, Response, render_template, jsonify, make_response
from flask_cors import CORS
import boto3
import json
import time
from helpers import get_bucketed_utterances, score_emotion_utterances
from flag_sentences import detect_nuggets
from botocore.config ... | true | true |
f7626c4c2c3b8c20e29458f1ea52c2e62e979c8a | 346 | py | Python | tribune/news/admin.py | carolwanjohi/the-moringa-tribune | 51d887acfa61f275f2f5fdcd09a39e4563395310 | [
"MIT"
] | null | null | null | tribune/news/admin.py | carolwanjohi/the-moringa-tribune | 51d887acfa61f275f2f5fdcd09a39e4563395310 | [
"MIT"
] | null | null | null | tribune/news/admin.py | carolwanjohi/the-moringa-tribune | 51d887acfa61f275f2f5fdcd09a39e4563395310 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Article,tags
# from .models import Editor
# Register your models here.
class ArticleAdmin(admin.ModelAdmin):
'''
Customise model in admin page
'''
filter_horizontal = ('tags',)
# admin.site.register(Editor)
admin.site.register(Article,ArticleAdmin)
... | 23.066667 | 41 | 0.742775 | from django.contrib import admin
from .models import Article,tags
class ArticleAdmin(admin.ModelAdmin):
filter_horizontal = ('tags',)
admin.site.register(Article,ArticleAdmin)
admin.site.register(tags)
| true | true |
f7626c79cc2fcb1218cda8808b4f3e6b4ae23cf3 | 12,206 | py | Python | scripts/4_sam_data/200221_NTI_CPN_comparison.py | Mateo-Lopez-Espejo/context_probe_analysis | 55461057fd01f00124aa46682b335313af9cc0f8 | [
"RSA-MD"
] | null | null | null | scripts/4_sam_data/200221_NTI_CPN_comparison.py | Mateo-Lopez-Espejo/context_probe_analysis | 55461057fd01f00124aa46682b335313af9cc0f8 | [
"RSA-MD"
] | null | null | null | scripts/4_sam_data/200221_NTI_CPN_comparison.py | Mateo-Lopez-Espejo/context_probe_analysis | 55461057fd01f00124aa46682b335313af9cc0f8 | [
"RSA-MD"
] | null | null | null | import itertools as itt
import pathlib as pl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.io import loadmat
import src.data.rasters
from src.data import dPCA as cdPCA
from src.metrics import dprime as cDP
from src.data.load import load, get_site_ids
from src.data.cache... | 40.959732 | 122 | 0.657791 | import itertools as itt
import pathlib as pl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.io import loadmat
import src.data.rasters
from src.data import dPCA as cdPCA
from src.metrics import dprime as cDP
from src.data.load import load, get_site_ids
from src.data.cache... | true | true |
f7626cca7dddb1a425cc22ea9632767c58da685e | 7,924 | py | Python | python/check_mongodb.bak.py | bopopescu/Heimdallr | 793b5b0242788e7212a7b10e9e6a5bdaef7a73b2 | [
"Apache-2.0"
] | null | null | null | python/check_mongodb.bak.py | bopopescu/Heimdallr | 793b5b0242788e7212a7b10e9e6a5bdaef7a73b2 | [
"Apache-2.0"
] | null | null | null | python/check_mongodb.bak.py | bopopescu/Heimdallr | 793b5b0242788e7212a7b10e9e6a5bdaef7a73b2 | [
"Apache-2.0"
] | 1 | 2020-07-22T08:57:53.000Z | 2020-07-22T08:57:53.000Z | #!/usr/bin/env python
#coding:utf-8
import os
import sys
import string
import time
import datetime
import MySQLdb
import pymongo
import bson
import logging
import logging.config
logging.config.fileConfig("etc/logger.ini")
logger = logging.getLogger("wlblazers")
path='./include'
sys.path.insert(0,path)
import functions ... | 52.826667 | 991 | 0.695103 | import os
import sys
import string
import time
import datetime
import MySQLdb
import pymongo
import bson
import logging
import logging.config
logging.config.fileConfig("etc/logger.ini")
logger = logging.getLogger("wlblazers")
path='./include'
sys.path.insert(0,path)
import functions as func
from multiprocessing import ... | false | true |
f7627027e3a94cefaf28494ed88552b5d2e6ca5b | 2,630 | py | Python | ppcommon.py | wiehan-a/pp-features | 1dbeae2e58a43ef01a00d306148329c76c033bde | [
"BSD-3-Clause"
] | 1 | 2018-12-02T04:10:59.000Z | 2018-12-02T04:10:59.000Z | ppcommon.py | wiehan-a/pp-features | 1dbeae2e58a43ef01a00d306148329c76c033bde | [
"BSD-3-Clause"
] | null | null | null | ppcommon.py | wiehan-a/pp-features | 1dbeae2e58a43ef01a00d306148329c76c033bde | [
"BSD-3-Clause"
] | 2 | 2016-09-16T13:00:52.000Z | 2018-12-02T04:10:59.000Z | # Parallel Python Software: http://www.parallelpython.com
# Copyright (c) 2005-2012, Vitalii Vanovschi
# 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 reta... | 41.09375 | 83 | 0.745247 |
import threading
copyright = "Copyright (c) 2005-2012 Vitalii Vanovschi. All rights reserved"
version = "1.6.4"
def start_thread(name, target, args=(), kwargs={}, daemon=True):
thread = threading.Thread(name=name, target=target, args=args, kwargs=kwargs)
thread.daemon = daemon
thread.start()
re... | true | true |
f7627082439b93cbf840238c9d2769fe979e57a1 | 1,059 | py | Python | main.py | phanirithvij/google-drive-takeout | 11f68d9791aa4011876dc4474af5bc2a95f1e8e7 | [
"MIT"
] | 1 | 2020-09-14T16:27:52.000Z | 2020-09-14T16:27:52.000Z | main.py | phanirithvij/google-drive-takeout | 11f68d9791aa4011876dc4474af5bc2a95f1e8e7 | [
"MIT"
] | null | null | null | main.py | phanirithvij/google-drive-takeout | 11f68d9791aa4011876dc4474af5bc2a95f1e8e7 | [
"MIT"
] | null | null | null | """
The code was written by a me, Phani Rithvij
"""
import zipfile
from tqdm import tqdm
def extract(filename: str):
with zipfile.ZipFile(filename) as zf:
member = zipfile.ZipInfo()
for member in tqdm(zf.infolist(), desc='Extracting '):
try:
zf.extract(membe... | 31.147059 | 66 | 0.578848 | import zipfile
from tqdm import tqdm
def extract(filename: str):
with zipfile.ZipFile(filename) as zf:
member = zipfile.ZipInfo()
for member in tqdm(zf.infolist(), desc='Extracting '):
try:
zf.extract(member, "data")
except FileNotFoundError as f:
... | true | true |
f76270c657c2fd10f9995f348f4a870f112e2b69 | 20,395 | py | Python | cpp_coveralls/coverage.py | CrowCpp/cpp-coveralls | 8b427c04a691867bb29a0acfc2d948a690476d79 | [
"Apache-2.0"
] | 1 | 2021-09-28T23:11:35.000Z | 2021-09-28T23:11:35.000Z | cpp_coveralls/coverage.py | CrowCpp/cpp-coveralls | 8b427c04a691867bb29a0acfc2d948a690476d79 | [
"Apache-2.0"
] | null | null | null | cpp_coveralls/coverage.py | CrowCpp/cpp-coveralls | 8b427c04a691867bb29a0acfc2d948a690476d79 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
#
# Copyright 2015 (c) Lei Xu <eddyxu@gmail.com>
from __future__ import absolute_import
from builtins import str
import argparse
import hashlib
import io
import os
import re
import subprocess
import sys
from . import gitrepo
_CPP_EXTENSIONS = ['.h', '.hh', '.hp... | 42.489583 | 127 | 0.555479 |
from __future__ import absolute_import
from builtins import str
import argparse
import hashlib
import io
import os
import re
import subprocess
import sys
from . import gitrepo
_CPP_EXTENSIONS = ['.h', '.hh', '.hpp', '.hxx', '.c', '.cc', '.cpp', '.cxx', '.m', '.mm']
_SKIP_DIRS = set(['.git', '.hg', '.svn', 'deps'])... | true | true |
f76271b289020f0e6cbaae21c2da2bd743aaf68f | 852 | py | Python | blacksheep/testing/messages.py | myusko/BlackSheep | c60be8c92edcae49a0cfa1487cb250de96a575fa | [
"MIT"
] | 482 | 2018-12-20T09:30:23.000Z | 2021-02-08T18:34:16.000Z | blacksheep/testing/messages.py | myusko/BlackSheep | c60be8c92edcae49a0cfa1487cb250de96a575fa | [
"MIT"
] | 59 | 2018-11-28T08:00:28.000Z | 2021-02-07T15:31:25.000Z | blacksheep/testing/messages.py | myusko/BlackSheep | c60be8c92edcae49a0cfa1487cb250de96a575fa | [
"MIT"
] | 20 | 2019-02-19T20:11:33.000Z | 2021-01-22T08:51:07.000Z | import asyncio
class MockMessage:
def __init__(self, value):
self.value = value
class MockReceive:
def __init__(self, messages=None):
self.messages = messages or []
self.index = 0
async def __call__(self):
try:
message = self.messages[self.index]
exce... | 22.421053 | 64 | 0.555164 | import asyncio
class MockMessage:
def __init__(self, value):
self.value = value
class MockReceive:
def __init__(self, messages=None):
self.messages = messages or []
self.index = 0
async def __call__(self):
try:
message = self.messages[self.index]
exce... | true | true |
f76272c9062f86f29303476ae779cad36cd5ac79 | 8,329 | py | Python | configs/gcnet/x101/fixbn/cascade_mask_rcnn_dconv_r4_gcb_c3-c5_x101_64x4d_fpn_1x.py | trisct/DNL-Object-Detection | 136619a555932ebd2051a3de222fe2ac006e6034 | [
"Apache-2.0"
] | 84 | 2020-09-08T12:55:48.000Z | 2022-03-07T06:19:09.000Z | configs/gcnet/x101/fixbn/cascade_mask_rcnn_dconv_r4_gcb_c3-c5_x101_64x4d_fpn_1x.py | trisct/DNL-Object-Detection | 136619a555932ebd2051a3de222fe2ac006e6034 | [
"Apache-2.0"
] | 15 | 2020-09-15T06:38:36.000Z | 2022-01-13T07:51:10.000Z | configs/gcnet/x101/fixbn/cascade_mask_rcnn_dconv_r4_gcb_c3-c5_x101_64x4d_fpn_1x.py | trisct/DNL-Object-Detection | 136619a555932ebd2051a3de222fe2ac006e6034 | [
"Apache-2.0"
] | 13 | 2020-09-18T08:43:24.000Z | 2022-03-28T13:25:55.000Z | # model settings
model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='... | 31.549242 | 79 | 0.550246 | model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch',
... | true | true |
f76272cd7ab0730c2c035acce23cc2e4fea056b9 | 1,538 | py | Python | enaml/scintilla/themes/monokai.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 1,080 | 2015-01-04T14:29:34.000Z | 2022-03-29T05:44:51.000Z | enaml/scintilla/themes/monokai.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 308 | 2015-01-05T22:44:13.000Z | 2022-03-30T21:19:18.000Z | enaml/scintilla/themes/monokai.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 123 | 2015-01-25T16:33:48.000Z | 2022-02-25T19:57:10.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#-----------------------------------------------------... | 25.213115 | 79 | 0.395969 |
MONOKAI_THEME = {
"python": {
"comment": {
"color": "#75715e"
},
"single_quoted_string": {
"color": "#e6db74"
},
"class_name": {
"color": "#a6e22e"
},
"function_method_name": {
"color": "#a6e22e"
},
... | true | true |
f762733c2e0043a8d52e777aaf8622a0669f74b7 | 8,496 | py | Python | cubed_tube/frontend/render.py | stevarino/cubed-tube | 52cfc36153f5abcf3490c1e6694437904750ff36 | [
"MIT"
] | 1 | 2021-09-03T15:38:21.000Z | 2021-09-03T15:38:21.000Z | cubed_tube/frontend/render.py | stevarino/cubed-tube | 52cfc36153f5abcf3490c1e6694437904750ff36 | [
"MIT"
] | null | null | null | cubed_tube/frontend/render.py | stevarino/cubed-tube | 52cfc36153f5abcf3490c1e6694437904750ff36 | [
"MIT"
] | null | null | null | """
Reads from the database and produces html/js files.
"""
from cubed_tube.lib.common import filter_video
from cubed_tube.lib.models import Video, Channel, Series, init_database
from cubed_tube.lib import schema
from cubed_tube.lib.util import sha1, load_config, load_credentials
from cubed_tube.frontend import templa... | 35.107438 | 78 | 0.594397 |
from cubed_tube.lib.common import filter_video
from cubed_tube.lib.models import Video, Channel, Series, init_database
from cubed_tube.lib import schema
from cubed_tube.lib.util import sha1, load_config, load_credentials
from cubed_tube.frontend import template_context
import argparse
from glob import glob
import gzi... | true | true |
f76273ac905981d47ed0ff2ec1473d1b0db43ac6 | 1,198 | py | Python | salt/modules/crawler.py | techhat/salt-crawler | 804b3565c2603075b125d470ee77455d03db12e5 | [
"Apache-2.0"
] | 2 | 2018-01-22T00:30:19.000Z | 2018-03-10T15:09:04.000Z | salt/modules/crawler.py | techhat/salt-crawler | 804b3565c2603075b125d470ee77455d03db12e5 | [
"Apache-2.0"
] | null | null | null | salt/modules/crawler.py | techhat/salt-crawler | 804b3565c2603075b125d470ee77455d03db12e5 | [
"Apache-2.0"
] | null | null | null | '''
Salt-Based Web Crawler
'''
# Import python libs
import logging
import urllib2
import random
import time
log = logging.getLogger(__name__)
def __virtual__():
'''
Basic Python libs are all that are needed
'''
return 'crawler'
def fetch(urls=None, wait=0, random_wait=False):
'''
Fetch a U... | 19.015873 | 74 | 0.584307 |
import logging
import urllib2
import random
import time
log = logging.getLogger(__name__)
def __virtual__():
return 'crawler'
def fetch(urls=None, wait=0, random_wait=False):
log.debug(urls)
ret = {}
if type(urls) is str:
ret[urls] = _query(urls)
elif type(urls) is list:
for ur... | true | true |
f762745be0d42e199a54a2b7db21bf93d026a27f | 32,528 | py | Python | test/modules/http2/load_test.py | daum3ns/mod_h2 | f1d55bc377ac7dd29ea333421c6a105ff2e38c02 | [
"Apache-2.0"
] | null | null | null | test/modules/http2/load_test.py | daum3ns/mod_h2 | f1d55bc377ac7dd29ea333421c6a105ff2e38c02 | [
"Apache-2.0"
] | null | null | null | test/modules/http2/load_test.py | daum3ns/mod_h2 | f1d55bc377ac7dd29ea333421c6a105ff2e38c02 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
import re
import statistics
import sys
import time
from datetime import timedelta, datetime
from threading import Thread
from typing import Dict, Tuple, Optional, List, Iterable
from tqdm import tqdm
from .env import H2TestEnv, H2Conf
from pyhttpd.result import ExecResult
log... | 38.909091 | 109 | 0.491884 | import argparse
import logging
import os
import re
import statistics
import sys
import time
from datetime import timedelta, datetime
from threading import Thread
from typing import Dict, Tuple, Optional, List, Iterable
from tqdm import tqdm
from .env import H2TestEnv, H2Conf
from pyhttpd.result import ExecResult
log... | true | true |
f7627496dbf1af68492d52793688474cebf61c42 | 514 | py | Python | examples/providers/factory_aggregate/games.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | examples/providers/factory_aggregate/games.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | examples/providers/factory_aggregate/games.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | """Example games module."""
class Game(object):
"""Base game class."""
def __init__(self, player1, player2):
"""Initializer."""
self.player1 = player1
self.player2 = player2
def play(self):
"""Play game."""
print('{0} and {1} are playing {2}'.format(
s... | 18.357143 | 73 | 0.562257 |
class Game(object):
def __init__(self, player1, player2):
self.player1 = player1
self.player2 = player2
def play(self):
print('{0} and {1} are playing {2}'.format(
self.player1, self.player2, self.__class__.__name__.lower()))
class Chess(Game):
class Checkers(Game):
... | true | true |
f762749bfe857a35c527b356fc9ee57d2d1c32f2 | 2,058 | py | Python | azurectl/utils/output.py | SUSE/azurectl | 207bd2541e5ba6888f05e1095df42b2e62a93790 | [
"Apache-2.0"
] | 9 | 2015-06-01T17:16:56.000Z | 2018-07-10T06:15:59.000Z | azurectl/utils/output.py | SUSE/azurectl | 207bd2541e5ba6888f05e1095df42b2e62a93790 | [
"Apache-2.0"
] | 175 | 2015-05-18T14:40:02.000Z | 2018-03-06T10:27:49.000Z | azurectl/utils/output.py | SUSE/azurectl | 207bd2541e5ba6888f05e1095df42b2e62a93790 | [
"Apache-2.0"
] | 4 | 2015-07-16T06:26:14.000Z | 2017-01-18T17:19:57.000Z | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 32.15625 | 77 | 0.637512 | import json
import os
from tempfile import NamedTemporaryFile
from azurectl.logger import log
class DataOutput(object):
def __init__(self, data_collector, data_format='json', style='standard'):
self.data = data_collector.get()
self.data_format = data_format
self.style = style
self... | true | true |
f7627562bd9d8a62a1da2770b7a5e95236c46f71 | 519 | py | Python | nist-nsrl/nist_nsrl/__init__.py | GuillaumeCouchard/snake-scales | 1b4c84130295dd3ba2c47b884db73dc9c68bfec5 | [
"BSD-3-Clause"
] | 5 | 2018-03-15T21:02:19.000Z | 2021-07-25T11:34:22.000Z | nist-nsrl/nist_nsrl/__init__.py | GuillaumeCouchard/snake-scales | 1b4c84130295dd3ba2c47b884db73dc9c68bfec5 | [
"BSD-3-Clause"
] | 7 | 2019-05-08T09:33:27.000Z | 2021-02-24T02:10:40.000Z | nist-nsrl/nist_nsrl/__init__.py | GuillaumeCouchard/snake-scales | 1b4c84130295dd3ba2c47b884db73dc9c68bfec5 | [
"BSD-3-Clause"
] | 8 | 2018-04-21T17:55:34.000Z | 2021-09-02T12:54:51.000Z | from snake.scale import FileType, scale
NAME = "nist_nsrl"
VERSION = "1.0"
AUTHOR = "Matt Watkins"
AUTHOR_EMAIL = "matthew.watkins@countercept.com"
DESCRIPTION = "a module to search files within the Nation Software Reference Library"
LICENSE = "https://github.com/countercept/snake-scales/blob/master/LICENSE"
URL ... | 19.961538 | 85 | 0.714836 | from snake.scale import FileType, scale
NAME = "nist_nsrl"
VERSION = "1.0"
AUTHOR = "Matt Watkins"
AUTHOR_EMAIL = "matthew.watkins@countercept.com"
DESCRIPTION = "a module to search files within the Nation Software Reference Library"
LICENSE = "https://github.com/countercept/snake-scales/blob/master/LICENSE"
URL ... | true | true |
f76275c63df65a1273c7e40241b7bb9ad8014ef7 | 512 | py | Python | login/migrations/0002_auto_20180925_0411.py | BeeZed/BucketList-Travels | 10445137df3a7b3394394d8c70a1b3e006011ae9 | [
"MIT"
] | null | null | null | login/migrations/0002_auto_20180925_0411.py | BeeZed/BucketList-Travels | 10445137df3a7b3394394d8c70a1b3e006011ae9 | [
"MIT"
] | null | null | null | login/migrations/0002_auto_20180925_0411.py | BeeZed/BucketList-Travels | 10445137df3a7b3394394d8c70a1b3e006011ae9 | [
"MIT"
] | 1 | 2019-08-13T20:04:09.000Z | 2019-08-13T20:04:09.000Z | # Generated by Django 2.1 on 2018-09-24 22:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('login', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 24.380952 | 125 | 0.658203 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('login', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userinfo',
name='user... | true | true |
f76276568eb007af5da4695c5974d040c82c0004 | 1,050 | py | Python | Python_ch2/Ch2_8_Concat.py | ninhnguyen01/Python_Book | e5e372f1895b06e908cd0dd07dc68a260c34d7ad | [
"Apache-2.0"
] | null | null | null | Python_ch2/Ch2_8_Concat.py | ninhnguyen01/Python_Book | e5e372f1895b06e908cd0dd07dc68a260c34d7ad | [
"Apache-2.0"
] | null | null | null | Python_ch2/Ch2_8_Concat.py | ninhnguyen01/Python_Book | e5e372f1895b06e908cd0dd07dc68a260c34d7ad | [
"Apache-2.0"
] | null | null | null | # String Concatenation (Title)
# Reading
message = 'Hello' + 'World'
print(message)
# This program demonstrates string concatenation.
first_name = input('Enter your first name: ')
last_name = input('Enter your last name: ')
# Combine the names with a space between them.
full_name = first_name + ' ' + last_name
# D... | 21.428571 | 75 | 0.673333 |
message = 'Hello' + 'World'
print(message)
first_name = input('Enter your first name: ')
last_name = input('Enter your last name: ')
full_name = first_name + ' ' + last_name
print('Your full name is' , full_name)
print('Enter the amount of' +
'sales for each day and ' +
'press Enter. ')
# Implicit S... | true | true |
f76276d4283fb411a094294cea048d1519f211a0 | 3,319 | py | Python | ass_parser/observable_object_mixin.py | bubblesub/ass_parser | a47d8dde7102368cf80f1a622fec5adfa96ed97a | [
"MIT"
] | null | null | null | ass_parser/observable_object_mixin.py | bubblesub/ass_parser | a47d8dde7102368cf80f1a622fec5adfa96ed97a | [
"MIT"
] | null | null | null | ass_parser/observable_object_mixin.py | bubblesub/ass_parser | a47d8dde7102368cf80f1a622fec5adfa96ed97a | [
"MIT"
] | 1 | 2022-02-21T07:02:02.000Z | 2022-02-21T07:02:02.000Z | """ObservableObjectMixin definition."""
from dataclasses import dataclass
from typing import Any, Callable, TypeVar
from ass_parser.observable import Event, Observable
TItem = TypeVar("TItem")
@dataclass
class ObservableObjectChangeEvent(Event):
"""Observable object property change event."""
class ObservableO... | 32.861386 | 79 | 0.645074 | from dataclasses import dataclass
from typing import Any, Callable, TypeVar
from ass_parser.observable import Event, Observable
TItem = TypeVar("TItem")
@dataclass
class ObservableObjectChangeEvent(Event):
class ObservableObjectMixin:
changed = Observable[ObservableObjectChangeEvent]()
def __setattr__(s... | true | true |
f762787a87b720da759cc66fc64b1c0702fda007 | 4,116 | py | Python | examples/analyzing_experimental_results/n170_analysis_only.py | varman-m/eeg_notebooks_doc | 12230719637c8087b020e8d5feeb20520a4da74d | [
"Apache-2.0"
] | 1 | 2020-11-05T21:30:07.000Z | 2020-11-05T21:30:07.000Z | examples/analyzing_experimental_results/n170_analysis_only.py | varman-m/eeg_notebooks_doc | 12230719637c8087b020e8d5feeb20520a4da74d | [
"Apache-2.0"
] | null | null | null | examples/analyzing_experimental_results/n170_analysis_only.py | varman-m/eeg_notebooks_doc | 12230719637c8087b020e8d5feeb20520a4da74d | [
"Apache-2.0"
] | null | null | null | """
N170 Analysis Only
===============================
This notebook runs only the data analysis part of N170 notebook.
Look at the notes to see how this can be run on the web with binder or google collab.
All of the additional notes are removed; only the code cells are kept.
"""
##################################... | 30.264706 | 143 | 0.442906 |
from muselsl import stream, list_muses, view, record
from multiprocessing import Process
from mne import Epochs, find_events
from time import time, strftime, gmtime
import os
from eegnb.analysis import utils
from collections import OrderedDict
import warnings
warnings.filterwarnings('ignore')
subject = 1
sess... | true | true |
f7627952c7a14c407f3ab44a3cabde7e220fcd30 | 1,131 | py | Python | migrations/versions/1bd480e682e0_users_table.py | koksalkapucuoglu/MicroBlogwFlask | fe9904d4a350c1a3e808c65122f6f9d4b11380c1 | [
"Apache-2.0"
] | null | null | null | migrations/versions/1bd480e682e0_users_table.py | koksalkapucuoglu/MicroBlogwFlask | fe9904d4a350c1a3e808c65122f6f9d4b11380c1 | [
"Apache-2.0"
] | null | null | null | migrations/versions/1bd480e682e0_users_table.py | koksalkapucuoglu/MicroBlogwFlask | fe9904d4a350c1a3e808c65122f6f9d4b11380c1 | [
"Apache-2.0"
] | null | null | null | """users table
Revision ID: 1bd480e682e0
Revises:
Create Date: 2020-12-29 22:37:15.050661
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1bd480e682e0'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto genera... | 29 | 80 | 0.678161 | from alembic import op
import sqlalchemy as sa
revision = '1bd480e682e0'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=64), nullable=True),
sa.Column('email'... | true | true |
f7627a468d986fe0ee76bed37c452e4b655f112b | 2,953 | py | Python | pipenv/patched/notpip/_vendor/pygments/formatter.py | sthagen/pipenv | 0924f75fd1004c848ea67d4272315eda4210b352 | [
"MIT"
] | 23 | 2017-01-20T01:18:31.000Z | 2017-01-20T17:25:11.000Z | pipenv/patched/notpip/_vendor/pygments/formatter.py | sthagen/pipenv | 0924f75fd1004c848ea67d4272315eda4210b352 | [
"MIT"
] | 1 | 2017-01-20T05:13:58.000Z | 2017-01-20T05:13:58.000Z | pipenv/patched/notpip/_vendor/pygments/formatter.py | sthagen/pipenv | 0924f75fd1004c848ea67d4272315eda4210b352 | [
"MIT"
] | null | null | null | """
pygments.formatter
~~~~~~~~~~~~~~~~~~
Base formatter class.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import codecs
from pipenv.patched.notpip._vendor.pygments.util import get_bool_opt
from pipenv.patched.notpip._vendor.pyg... | 31.084211 | 75 | 0.627836 |
import codecs
from pipenv.patched.notpip._vendor.pygments.util import get_bool_opt
from pipenv.patched.notpip._vendor.pygments.styles import get_style_by_name
__all__ = ['Formatter']
def _lookup_style(style):
if isinstance(style, str):
return get_style_by_name(style)
return style
class Formatter:... | true | true |
f7627a6674fd980cc909636fc3f312b9f5698145 | 669 | py | Python | etlx/script/script.py | isteven-xu/etlx | 4d1437c70f41a42a3f0fb2fc8757dd9d1314c969 | [
"Apache-2.0"
] | null | null | null | etlx/script/script.py | isteven-xu/etlx | 4d1437c70f41a42a3f0fb2fc8757dd9d1314c969 | [
"Apache-2.0"
] | null | null | null | etlx/script/script.py | isteven-xu/etlx | 4d1437c70f41a42a3f0fb2fc8757dd9d1314c969 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
@author: 长风
@contact: xugang_it@126.com
@license: Apache Licence
@file: script.py
@time: 2021/4/29 5:05 下午
"""
import os
from loguru import logger
def run(job):
file_name = job.env.HDFS_NFS_PREFIX + job.script_path
args = job.script_args
cmd = ''
if file_name != '' and file_name.en... | 22.3 | 61 | 0.602392 | import os
from loguru import logger
def run(job):
file_name = job.env.HDFS_NFS_PREFIX + job.script_path
args = job.script_args
cmd = ''
if file_name != '' and file_name.endswith(".py"):
cmd = job.env.ANACONDA_INSTALL_PATH + " " + file_name
if file_name != '' and file_name.endswith(".sh"):... | true | true |
f7627a673297fc78b5191096956c3fed936d3ceb | 1,442 | py | Python | doc/source/cookbook/time_series.py | kastalpes/yt | b1e197ca84433fbd61eaf44b28ff5cdb37981d4c | [
"BSD-3-Clause-Clear"
] | 2 | 2021-03-02T18:59:49.000Z | 2021-03-02T18:59:50.000Z | doc/source/cookbook/time_series.py | kastalpes/yt | b1e197ca84433fbd61eaf44b28ff5cdb37981d4c | [
"BSD-3-Clause-Clear"
] | 4 | 2018-04-13T23:03:42.000Z | 2018-05-08T17:50:43.000Z | doc/source/cookbook/time_series.py | kastalpes/yt | b1e197ca84433fbd61eaf44b28ff5cdb37981d4c | [
"BSD-3-Clause-Clear"
] | 2 | 2020-05-16T15:29:37.000Z | 2020-06-22T10:17:08.000Z | import yt
import matplotlib.pyplot as plt
import numpy as np
# Enable parallelism in the script (assuming it was called with
# `mpirun -np <n_procs>` )
yt.enable_parallelism()
# By using wildcards such as ? and * with the load command, we can load up a
# Time Series containing all of these datasets simultaneously.
ts... | 35.170732 | 76 | 0.725381 | import yt
import matplotlib.pyplot as plt
import numpy as np
yt.enable_parallelism()
ts = yt.load('GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0*')
storage = {}
for store, ds in ts.piter(storage=storage):
sphere = ds.sphere("c", (100., "kpc"))
entr = sphere["entropy"].sum()
store.... | true | true |
f7627ac979e2275f6b2f7e3336a150a88ca5d83a | 17,325 | py | Python | caffe2/python/pipeline.py | KevinKecc/caffe2 | a2b6c6e2f0686358a84277df65e9489fb7d9ddb2 | [
"Apache-2.0"
] | 585 | 2015-08-10T02:48:52.000Z | 2021-12-01T08:46:59.000Z | caffe2/python/pipeline.py | KevinKecc/caffe2 | a2b6c6e2f0686358a84277df65e9489fb7d9ddb2 | [
"Apache-2.0"
] | 27 | 2018-04-14T06:44:22.000Z | 2018-08-01T18:02:39.000Z | caffe2/python/pipeline.py | KevinKecc/caffe2 | a2b6c6e2f0686358a84277df65e9489fb7d9ddb2 | [
"Apache-2.0"
] | 183 | 2015-08-10T02:49:04.000Z | 2021-12-01T08:47:13.000Z | # Copyright (c) 2016-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 38.671875 | 82 | 0.615123 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, queue_util
from caffe2.python.dataio import Reader, Writer
from caffe2.python.net_builder import NetBuilder, ops
from caffe2.python.schem... | true | true |
f7627b893bcf3711beb652df9effcf9f1d458a75 | 3,793 | py | Python | respy/config.py | mo2561057/respy_fixed | c68c265ec1e849aa5fcf3413ee32449a2a076916 | [
"MIT"
] | null | null | null | respy/config.py | mo2561057/respy_fixed | c68c265ec1e849aa5fcf3413ee32449a2a076916 | [
"MIT"
] | null | null | null | respy/config.py | mo2561057/respy_fixed | c68c265ec1e849aa5fcf3413ee32449a2a076916 | [
"MIT"
] | null | null | null | """General configuration for respy."""
from pathlib import Path
# Obtain the root directory of the package. Do not import respy which creates a circular
# import.
ROOT_DIR = Path(__file__).parent
# Directory with additional resources for the testing harness
TEST_RESOURCES_DIR = ROOT_DIR / "tests" / "resources"
HUGE_... | 35.448598 | 88 | 0.691273 | from pathlib import Path
ROOT_DIR = Path(__file__).parent
TEST_RESOURCES_DIR = ROOT_DIR / "tests" / "resources"
HUGE_FLOAT = 1e20
TINY_FLOAT = 1e-8
PRINT_FLOAT = 1e10
DECIMALS = 6
TOL = 10 ** -DECIMALS
INADMISSIBILITY_PENALTY = -400000
IS_DEBUG = False
BASE_COVARIATES = {
"not_exp_a_lagged": "exp_a > 0 and l... | true | true |
f7627c78d4ffe84ff624bbe17addf815eb5b8b5a | 3,014 | py | Python | bot/slack_bot.py | TheJake123/pipey-slackbot | 34a1e3c16d6224387c44b4a75ac96bd282bd756a | [
"MIT"
] | null | null | null | bot/slack_bot.py | TheJake123/pipey-slackbot | 34a1e3c16d6224387c44b4a75ac96bd282bd756a | [
"MIT"
] | null | null | null | bot/slack_bot.py | TheJake123/pipey-slackbot | 34a1e3c16d6224387c44b4a75ac96bd282bd756a | [
"MIT"
] | null | null | null | import time
import logging
import traceback
from slack_clients import SlackClients
from messenger import Messenger
from event_handler import RtmEventHandler
logger = logging.getLogger(__name__)
def spawn_bot():
return SlackBot()
class SlackBot(object):
def __init__(self, pipedrive_api_key, db_api_url, tok... | 36.313253 | 118 | 0.614466 | import time
import logging
import traceback
from slack_clients import SlackClients
from messenger import Messenger
from event_handler import RtmEventHandler
logger = logging.getLogger(__name__)
def spawn_bot():
return SlackBot()
class SlackBot(object):
def __init__(self, pipedrive_api_key, db_api_url, tok... | true | true |
f7627cd2a8e2aa64817571689f50b40e80f73a0f | 1,997 | py | Python | google/ads/googleads/v8/common/types/final_app_url.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 285 | 2018-10-05T16:47:58.000Z | 2022-03-31T00:58:39.000Z | google/ads/googleads/v8/common/types/final_app_url.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 425 | 2018-09-10T13:32:41.000Z | 2022-03-31T14:50:05.000Z | google/ads/googleads/v8/common/types/final_app_url.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 369 | 2018-11-28T07:01:00.000Z | 2022-03-28T09:53:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.660714 | 110 | 0.698548 | import proto
from google.ads.googleads.v8.enums.types import app_url_operating_system_type
__protobuf__ = proto.module(
package="google.ads.googleads.v8.common",
marshal="google.ads.googleads.v8",
manifest={"FinalAppUrl",},
)
class FinalAppUrl(proto.Message):
os_type = proto.Field(
proto.... | true | true |
f7627ce966a58bb6ec6ab78dd86b8c1dd6adabda | 2,018 | py | Python | sdk/python/pulumi_kubernetes/core/v1/PodTemplateList.py | kulado/kulado-kubernetes | ecb72f9b25f6dbbae41f00c82388b1ca32329cc7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/core/v1/PodTemplateList.py | kulado/kulado-kubernetes | ecb72f9b25f6dbbae41f00c82388b1ca32329cc7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/core/v1/PodTemplateList.py | kulado/kulado-kubernetes | ecb72f9b25f6dbbae41f00c82388b1ca32329cc7 | [
"Apache-2.0"
] | 1 | 2019-08-20T22:51:57.000Z | 2019-08-20T22:51:57.000Z | # *** WARNING: this file was generated by the Kulado Kubernetes codegen tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import kulado
import kulado.runtime
import warnings
from ... import tables, version
class PodTemplateList(kulado.CustomResource):
"""
PodTemplate... | 37.37037 | 107 | 0.655104 |
import kulado
import kulado.runtime
import warnings
from ... import tables, version
class PodTemplateList(kulado.CustomResource):
def __init__(self, resource_name, opts=None, items=None, metadata=None, __name__=None, __opts__=None):
if __name__ is not None:
warnings.warn("explicit use of __n... | true | true |
f7627d27dbe601c756846413b920ae85f1de75c8 | 2,119 | py | Python | chef/cookbooks/tempest/files/default/tests2skip.py | guglo/crowbar-openstack | 3fc6ef5e83336a171cc98ad0c69e1a38e71b66b7 | [
"Apache-2.0"
] | 29 | 2015-11-13T09:59:41.000Z | 2021-08-10T13:56:02.000Z | chef/cookbooks/tempest/files/default/tests2skip.py | jgrassler/crowbar-openstack | 91f267e96a20a40a8283d9c4c79d06df16ac46fc | [
"Apache-2.0"
] | 1,685 | 2015-08-19T07:16:41.000Z | 2021-08-23T20:41:59.000Z | chef/cookbooks/tempest/files/default/tests2skip.py | jgrassler/crowbar-openstack | 91f267e96a20a40a8283d9c4c79d06df16ac46fc | [
"Apache-2.0"
] | 121 | 2015-08-17T13:21:21.000Z | 2021-03-11T16:00:13.000Z | #!/usr/bin/env python
#
# Copyright 2013 Red Hat
# 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... | 29.84507 | 75 | 0.698915 |
import sys
whitelist = []
blacklist = []
with open(sys.argv[1]) as fp:
for line in fp:
line = line.strip()
if not line or line[0] == '#':
continue
if line.startswith("+"):
whitelist.append(line[1:])
elif line.startswith("-"):
blacklist.append(l... | true | true |
f7627f09716119f534e90d0d9ad2989acb9cd95f | 7,821 | py | Python | ivy/std_api.py | ArchAssault-Project/ivy-python | be81ccff3176ef426908eabdd1a7368a4f7fa511 | [
"BSD-3-Clause"
] | 1 | 2020-03-25T05:14:39.000Z | 2020-03-25T05:14:39.000Z | ivy/std_api.py | ArchAssault-Project/ivy-python | be81ccff3176ef426908eabdd1a7368a4f7fa511 | [
"BSD-3-Clause"
] | null | null | null | ivy/std_api.py | ArchAssault-Project/ivy-python | be81ccff3176ef426908eabdd1a7368a4f7fa511 | [
"BSD-3-Clause"
] | 2 | 2016-06-02T08:13:36.000Z | 2020-03-25T05:14:40.000Z | """
Implements the standard Ivy API.
You can refer to the example code ``pyhello.py`` for an example of use.
All methods in this module are frontends to a `ivy.IvyServer` instance, stored
in the module's attributes `_IvyServer`.
:group Connecting to/disconnecting from the Ivy bus:
IvyInit, IvyStart,IvyMainLoop, Iv... | 27.538732 | 82 | 0.69339 |
_IvyServer = None
from ivy import void_function
from ivy import IvyServer
from ivy import IvyTimer
def IvyInit(agent_name, ready_msg=None,
main_loop_type_ignored=0,
on_cnx_fct=void_function,
on_die_fct=void_function):
global _IvyServer
assert _IvyServer is None
_IvyS... | true | true |
f7627f5aa5b92523315bc2307ed024315c006ba0 | 2,286 | py | Python | stack/longest_abs_path.py | javyxu/algorithms-python | 2076d0f22c2d6b2dd53a5e1d2a9a3000ef2c9d38 | [
"MIT"
] | 8 | 2017-07-02T15:17:25.000Z | 2017-09-18T15:37:51.000Z | stack/longest_abs_path.py | javyxu/algorithms-python | 2076d0f22c2d6b2dd53a5e1d2a9a3000ef2c9d38 | [
"MIT"
] | null | null | null | stack/longest_abs_path.py | javyxu/algorithms-python | 2076d0f22c2d6b2dd53a5e1d2a9a3000ef2c9d38 | [
"MIT"
] | 5 | 2018-02-23T22:08:28.000Z | 2020-08-19T08:31:47.000Z | # def lengthLongestPath(input):
# maxlen = 0
# pathlen = {0: 0}
# for line in input.splitlines():
# print("---------------")
# print("line:", line)
# name = line.strip('\t')
# print("name:", name)
# depth = len(line) - len(name)
# print("depth:", depth)
... | 34.636364 | 101 | 0.51881 |
def length_longest_path(input):
currlen, maxlen = 0, 0 stack = [] for s ... | true | true |
f7627f7cc6b363142d3cc3363689839767cab5bb | 1,349 | py | Python | test/fx2trt/converters/acc_op/test_batchnorm.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | 1 | 2022-01-31T14:15:35.000Z | 2022-01-31T14:15:35.000Z | test/fx2trt/converters/acc_op/test_batchnorm.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | 1 | 2021-12-03T06:48:35.000Z | 2021-12-03T07:04:19.000Z | test/fx2trt/converters/acc_op/test_batchnorm.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | null | null | null | # Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
from torch.testing._internal.common_utils import run_tests
class TestBatchNormConverter(AccTestCase):
def test_batchnorm(self):
... | 29.977778 | 78 | 0.578947 |
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
from torch.testing._internal.common_utils import run_tests
class TestBatchNormConverter(AccTestCase):
def test_batchnorm(self):
class TestModule(torch.nn.Modu... | true | true |
f7628087778033643ae67069077c9b580a2dff71 | 1,075 | py | Python | examples/basic_usage.py | J-M0/yaspin | f219c15b5784e140c6eb958d4a36b6c56810fc8a | [
"MIT"
] | 549 | 2017-11-13T08:40:01.000Z | 2022-03-29T06:13:56.000Z | examples/basic_usage.py | marshall-brown/yaspin | 43661b9b475158311a0149685d975658d87a5f72 | [
"MIT"
] | 165 | 2017-11-10T15:56:48.000Z | 2022-03-14T19:15:28.000Z | examples/basic_usage.py | marshall-brown/yaspin | 43661b9b475158311a0149685d975658d87a5f72 | [
"MIT"
] | 34 | 2018-02-20T15:44:02.000Z | 2022-01-28T09:15:15.000Z | """
examples.basic_usage
~~~~~~~~~~~~~~~~~~~~
Common usage patterns for the yaspin spinner.
"""
import signal
import time
from yaspin import Spinner, yaspin
from yaspin.signal_handlers import fancy_handler
from yaspin.spinners import Spinners
def context_manager_default():
with yaspin(text="Braille"):
... | 18.220339 | 48 | 0.631628 |
import signal
import time
from yaspin import Spinner, yaspin
from yaspin.signal_handlers import fancy_handler
from yaspin.spinners import Spinners
def context_manager_default():
with yaspin(text="Braille"):
time.sleep(3)
def context_manager_line():
line_spinner = Spinner("-\\|/", 150)
with yas... | true | true |
f762814db5bb6a148542222679eb2957e9121b5f | 20,391 | py | Python | generate.py | hieultp/stylegan2-ada-pytorch | d09653fc1c4a8eefe64f29b3e33a2afb3bdd3d22 | [
"BSD-Source-Code"
] | null | null | null | generate.py | hieultp/stylegan2-ada-pytorch | d09653fc1c4a8eefe64f29b3e33a2afb3bdd3d22 | [
"BSD-Source-Code"
] | null | null | null | generate.py | hieultp/stylegan2-ada-pytorch | d09653fc1c4a8eefe64f29b3e33a2afb3bdd3d22 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... | 41.193939 | 181 | 0.611691 |
import os
import subprocess
import re
from typing import List, Optional
import click
import dnnlib
import numpy as np
from numpy import linalg
import PIL.Image
import torch
import legacy
from opensimplex import OpenSimplex
class OSN():
min = -1
max = 1
def __init__(self, seed, diameter):
sel... | true | true |
f76281d070ebf06df9ae75e3a667c877288c0eb8 | 2,015 | py | Python | ooobuild/lo/awt/x_file_dialog.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/awt/x_file_dialog.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/awt/x_file_dialog.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 29.202899 | 124 | 0.663027 | import typing
from abc import abstractmethod
from ..uno.x_interface import XInterface as XInterface_8f010a43
class XFileDialog(XInterface_8f010a43):
__ooo_ns__: str = 'com.sun.star.awt'
__ooo_full_ns__: str = 'com.sun.star.awt.XFileDialog'
__ooo_type_name__: str = 'interface'
__pyunointerface__: str = ... | true | true |
f76282726da773ecf93f0b9376e1eac6d8ca9593 | 10,265 | py | Python | sdk/python/pulumi_azure_nextgen/consumption/v20190501/budget.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/consumption/v20190501/budget.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/consumption/v20190501/budget.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 51.325 | 947 | 0.668388 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['Budget']
class Budget(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
f76282dce0b8cce66f9e5623f3d100d2497f0023 | 4,880 | py | Python | objects/modules/output.py | kerven88/k8s-cluster-checker | 99f4175086bc42793da6bca6c4ef25a9f8252c16 | [
"Apache-2.0"
] | 10 | 2020-08-06T11:40:46.000Z | 2021-10-18T12:41:15.000Z | objects/modules/output.py | kerven88/k8s-cluster-checker | 99f4175086bc42793da6bca6c4ef25a9f8252c16 | [
"Apache-2.0"
] | 1 | 2021-01-29T02:42:16.000Z | 2021-05-22T08:51:13.000Z | objects/modules/output.py | kerven88/k8s-cluster-checker | 99f4175086bc42793da6bca6c4ef25a9f8252c16 | [
"Apache-2.0"
] | 6 | 2020-09-10T05:51:06.000Z | 2022-01-25T03:01:39.000Z | from columnar import columnar
from click import style
from packaging import version
import os, re, time, requests, json, csv
class Output:
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
CYAN = '\033[36m'
RESET = '\033[0m'
BOLD = '\033[1;30m'
# u'\u2717' means values is None or not ... | 35.882353 | 85 | 0.548361 | from columnar import columnar
from click import style
from packaging import version
import os, re, time, requests, json, csv
class Output:
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
CYAN = '\033[36m'
RESET = '\033[0m'
BOLD = '\033[1;30m'
global patterns
patterns = ... | true | true |
f76284a7145d4ae4a14306848f4de7342a193554 | 71 | py | Python | dagfactory/__version__.py | scierainc/dag-factory | 0bd1cd630d4cd8018dcb5bbb4d468cea0388a6e4 | [
"MIT"
] | 1 | 2021-06-27T19:00:58.000Z | 2021-06-27T19:00:58.000Z | dagfactory/__version__.py | roothsmz/dag-factory | 1a9497001449a8507902af0aa8148e0ac404ab6e | [
"MIT"
] | null | null | null | dagfactory/__version__.py | roothsmz/dag-factory | 1a9497001449a8507902af0aa8148e0ac404ab6e | [
"MIT"
] | null | null | null | """Module contains the version of dag-factory"""
__version__ = "0.7.2"
| 23.666667 | 48 | 0.704225 | __version__ = "0.7.2"
| true | true |
f76285a294a42646bbded3a1fd4528a884f24f0c | 3,942 | py | Python | alipay/aop/api/request/AlipayPassInstanceUpdateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayPassInstanceUpdateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayPassInstanceUpdateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayPassInstanceUpdateModel import AlipayPassInstanceUpdateModel
class AlipayPassInstanceUpdateRequest(object):
def __init__(... | 27.186207 | 148 | 0.642314 | import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayPassInstanceUpdateModel import AlipayPassInstanceUpdateModel
class AlipayPassInstanceUpdateRequest(object):
def __init__(self, biz_model=None):
self._biz_model... | true | true |
f7628a6d1a935019a7cbf4e6800f94c7272bca4d | 1,203 | py | Python | saldo/cli/fetch.py | dr-duplo/python-saldo | 4391296f8999b08303edd08bc93b961aed5b69f1 | [
"MIT"
] | 1 | 2019-06-11T23:45:20.000Z | 2019-06-11T23:45:20.000Z | saldo/cli/fetch.py | dr-duplo/python-saldo | 4391296f8999b08303edd08bc93b961aed5b69f1 | [
"MIT"
] | null | null | null | saldo/cli/fetch.py | dr-duplo/python-saldo | 4391296f8999b08303edd08bc93b961aed5b69f1 | [
"MIT"
] | null | null | null | import click
from colorama import Fore
from .transactions import print_transaction
class ClickProgressBarUpdater:
def __init__(self, bar):
self.bar = bar
self.progress = 0
def __call__(self, progress):
self.bar.update(progress - self.progress)
self.progress = progress
@clic... | 30.075 | 91 | 0.656692 | import click
from colorama import Fore
from .transactions import print_transaction
class ClickProgressBarUpdater:
def __init__(self, bar):
self.bar = bar
self.progress = 0
def __call__(self, progress):
self.bar.update(progress - self.progress)
self.progress = progress
@clic... | true | true |
f7628ac7420f3bd3eb3f9aca6f4be321a87e2866 | 2,741 | py | Python | tests/test_parser.py | mysiar/fixed-width-text-parser | 6220fe2955cda10ac7353658baddc7530bd658da | [
"MIT"
] | null | null | null | tests/test_parser.py | mysiar/fixed-width-text-parser | 6220fe2955cda10ac7353658baddc7530bd658da | [
"MIT"
] | null | null | null | tests/test_parser.py | mysiar/fixed-width-text-parser | 6220fe2955cda10ac7353658baddc7530bd658da | [
"MIT"
] | 1 | 2020-12-26T13:08:38.000Z | 2020-12-26T13:08:38.000Z | import unittest
from FixedWidthTextParser.Parser import Parser
definition = {
'FIELD_1': [0, 1, 'string'],
'FIELD_2': [1, 10, 'float'],
'FIELD_3': [11, 10, 'float'],
'FIELD_4': [23, 1, 'integer'],
'FIELD_5': [24, 2, 'string'],
'FIELD_6': [26, 4, 'integer', 0],
'FIELD_7': [30, 4, 'integer', ... | 33.024096 | 117 | 0.598687 | import unittest
from FixedWidthTextParser.Parser import Parser
definition = {
'FIELD_1': [0, 1, 'string'],
'FIELD_2': [1, 10, 'float'],
'FIELD_3': [11, 10, 'float'],
'FIELD_4': [23, 1, 'integer'],
'FIELD_5': [24, 2, 'string'],
'FIELD_6': [26, 4, 'integer', 0],
'FIELD_7': [30, 4, 'integer', ... | true | true |
f7628cc5aec9076f1831b0065845c187ed53c913 | 5,354 | py | Python | var/spack/repos/builtin/packages/arpack-ng/package.py | slabasan/spack | f2d91f7e3c826011e1e6a47a598cda4acca8c8a6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/arpack-ng/package.py | slabasan/spack | f2d91f7e3c826011e1e6a47a598cda4acca8c8a6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/arpack-ng/package.py | slabasan/spack | f2d91f7e3c826011e1e6a47a598cda4acca8c8a6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class ArpackNg(Package):
"""ARPACK-NG is a collection of Fortran77 subroutines designed to solve... | 36.924138 | 95 | 0.650355 |
from spack import *
class ArpackNg(Package):
homepage = 'https://github.com/opencollab/arpack-ng'
url = 'https://github.com/opencollab/arpack-ng/archive/3.3.0.tar.gz'
git = 'https://github.com/opencollab/arpack-ng.git'
version('develop', branch='master')
version('3.7.0', sha256='972e3... | true | true |
f7628ebf413c8bc27c773868f24359a0b97c10b7 | 1,897 | py | Python | azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 34.490909 | 88 | 0.579863 |
from .proxy_resource_py3 import ProxyResource
class Application(ProxyResource):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'typ... | true | true |
f7628fc8c1169bc6d03da786a2fac1047e42b609 | 5,118 | py | Python | tests/test_get_input.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 26 | 2016-02-25T19:27:55.000Z | 2022-01-22T09:54:59.000Z | tests/test_get_input.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 28 | 2018-11-22T19:51:06.000Z | 2022-03-20T23:02:13.000Z | tests/test_get_input.py | Sung-Huan/ANNOgesic | af3de26f6c5ff9d2218f18a84bbc863a1bb95550 | [
"0BSD"
] | 18 | 2016-06-01T11:53:45.000Z | 2021-12-27T03:41:03.000Z | #!/usr/bin/python
import unittest
import os
import sys
import shutil
sys.path.append(".")
from io import StringIO
import annogesiclib.get_input as get_input
class Mock_func(object):
def mock_wget(self, ftp, input_folder, file_type, log):
pass
def modify_header(self):
pass
class TestGetFile... | 42.297521 | 464 | 0.69871 |
import unittest
import os
import sys
import shutil
sys.path.append(".")
from io import StringIO
import annogesiclib.get_input as get_input
class Mock_func(object):
def mock_wget(self, ftp, input_folder, file_type, log):
pass
def modify_header(self):
pass
class TestGetFile(unittest.TestCase... | true | true |
f7628ff1968a8dc425ffbbb88fd08ad74244a9da | 4,717 | py | Python | src/compound_jsonapi/fields.py | scmmmh/compound-jsonapi | 527b212479a355370c8d0e99b70ae17712a9654d | [
"MIT"
] | null | null | null | src/compound_jsonapi/fields.py | scmmmh/compound-jsonapi | 527b212479a355370c8d0e99b70ae17712a9654d | [
"MIT"
] | null | null | null | src/compound_jsonapi/fields.py | scmmmh/compound-jsonapi | 527b212479a355370c8d0e99b70ae17712a9654d | [
"MIT"
] | null | null | null | """
:mod:`compound_jsonapi.fields`
==============================
Provides the :class:`~compound_jsonapi.fields.Relationship` custom field for
defining relationships between :class:`~compound_jsonapi.schema.Schema`\ s.
.. moduleauthor:: Mark Hall <mark.hall@work.room3b.eu>
"""
import marshmallow as ma
_RECURSIVE_NES... | 48.132653 | 114 | 0.60229 | import marshmallow as ma
_RECURSIVE_NESTED = 'self'
class Relationship(ma.fields.Field):
def __init__(self, schema, many=False, **kwargs):
super(Relationship, self).__init__(**kwargs)
self.many = many
self.__schema = schema
@property
def schema(self):
if isinstance(self.... | true | true |
f76290051b81c36de91a0d47cbd294c2b8162e28 | 720 | py | Python | leetcode/problems/3_longest_substring_without_repeating_characters_sol2.py | JamesCao2048/CodingQuestions | d25a14574f3a05cc59f0e7d0a3b7307084106d95 | [
"MIT"
] | 1 | 2019-07-21T11:03:34.000Z | 2019-07-21T11:03:34.000Z | leetcode/problems/3_longest_substring_without_repeating_characters_sol2.py | JamesCao2048/CodingQuestions | d25a14574f3a05cc59f0e7d0a3b7307084106d95 | [
"MIT"
] | null | null | null | leetcode/problems/3_longest_substring_without_repeating_characters_sol2.py | JamesCao2048/CodingQuestions | d25a14574f3a05cc59f0e7d0a3b7307084106d95 | [
"MIT"
] | null | null | null | # Longest Substring Without Repeating Characters
# Medium
class Solution(object):
def lengthOfLongestSubstring(self, s):
"""
:type s: str
:rtype: int
"""
# DP Solution based on record_start. str.index比str.find快很多
if not s:
return 0
cou... | 31.304348 | 72 | 0.490278 |
class Solution(object):
def lengthOfLongestSubstring(self, s):
if not s:
return 0
counts = [0] * len(s)
counts[0] = 1
cur_start = 0
for i in range(1, len(s)):
if not s[i] in s[cur_start:i]:
counts[i] = counts[i-1] + 1... | true | true |
f76292adcf0d25dbeabe0c66881d8d064c877680 | 889 | py | Python | Pdn-CE/generate_config_iso/generate_config_iso_3.py | VlachosGroup/Pdn-CO-Stability | 4f7f1af7091f9ee49d4d3ac213b2f1ee8fce65c4 | [
"MIT"
] | 6 | 2020-10-17T03:14:41.000Z | 2022-02-09T12:06:09.000Z | Pdn-CE/generate_config_iso/generate_config_iso_3.py | VlachosGroup/Pdn-CO-Stability | 4f7f1af7091f9ee49d4d3ac213b2f1ee8fce65c4 | [
"MIT"
] | null | null | null | Pdn-CE/generate_config_iso/generate_config_iso_3.py | VlachosGroup/Pdn-CO-Stability | 4f7f1af7091f9ee49d4d3ac213b2f1ee8fce65c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Save json files of isomophric configurations
'''
from set_ce_lattice import mother, dz
from set_config_constants import config, Ec
import lattice_functions as lf
#%%
'''
Create Configurations in graphs
'''
batch_i = 3
# Initialize the cluster object and isomorphs object
Clusters = lf.in... | 23.394737 | 74 | 0.740157 |
from set_ce_lattice import mother, dz
from set_config_constants import config, Ec
import lattice_functions as lf
batch_i = 3
Clusters = lf.initialize_Clusters_object(mother, dz)
iso = lf.isomorphs(mother, dz)
iso.generate_all_iso(config[batch_i], Ec[batch_i], file_index = batch_i)
| true | true |
f76292b14cab1ef21c4478686133b722b4d7a01c | 5,184 | py | Python | bcol-api/src/bcol_api/services/bcol_payment.py | saravanpa-aot/sbc-pay | fb9f61b99e506e43280bc69531ee107cc12cd92d | [
"Apache-2.0"
] | null | null | null | bcol-api/src/bcol_api/services/bcol_payment.py | saravanpa-aot/sbc-pay | fb9f61b99e506e43280bc69531ee107cc12cd92d | [
"Apache-2.0"
] | null | null | null | bcol-api/src/bcol_api/services/bcol_payment.py | saravanpa-aot/sbc-pay | fb9f61b99e506e43280bc69531ee107cc12cd92d | [
"Apache-2.0"
] | 5 | 2019-03-01T01:12:12.000Z | 2019-07-08T16:33:47.000Z | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 46.285714 | 110 | 0.637539 |
from typing import Dict
import zeep
from flask import current_app
from bcol_api.exceptions import BusinessException, PaymentException
from bcol_api.services.bcol_soap import BcolSoap
from bcol_api.utils.errors import Error
class BcolPayment:
def create_payment(self, pay_request: Dict, is_apply_charge: bool):... | true | true |
f76293b30492e8c57476e6c303407fe9fc0af5ba | 518 | py | Python | dronekit_and_unused/ringroadtest.py | uci-uav-forge/ugv | bbec55c45fa2fb4952786ebd6835146d6a8e2a21 | [
"MIT"
] | null | null | null | dronekit_and_unused/ringroadtest.py | uci-uav-forge/ugv | bbec55c45fa2fb4952786ebd6835146d6a8e2a21 | [
"MIT"
] | null | null | null | dronekit_and_unused/ringroadtest.py | uci-uav-forge/ugv | bbec55c45fa2fb4952786ebd6835146d6a8e2a21 | [
"MIT"
] | null | null | null | import csv
from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException
import time
import socket
import exceptions
import math
import argparse
from pymavlink import mavutil
import ugv_functions as ugv
vehicle = ugv.connectMyCopter()
ugv.paramSetup(vehicle)
ugv.arm(vehicle)
with open('ringroadcoords.... | 27.263158 | 104 | 0.772201 | import csv
from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException
import time
import socket
import exceptions
import math
import argparse
from pymavlink import mavutil
import ugv_functions as ugv
vehicle = ugv.connectMyCopter()
ugv.paramSetup(vehicle)
ugv.arm(vehicle)
with open('ringroadcoords.... | true | true |
f76293f7cf7a8e881c640a84378b82e308a196e4 | 639 | py | Python | nitransforms/tests/test_affines.py | mgxd/nitransforms | a922f3cb8ee1df5b484f617c34e1816a726e54e0 | [
"MIT"
] | null | null | null | nitransforms/tests/test_affines.py | mgxd/nitransforms | a922f3cb8ee1df5b484f617c34e1816a726e54e0 | [
"MIT"
] | null | null | null | nitransforms/tests/test_affines.py | mgxd/nitransforms | a922f3cb8ee1df5b484f617c34e1816a726e54e0 | [
"MIT"
] | null | null | null | import numpy as np
from nibabel.affines import from_matvec
from nibabel.eulerangles import euler2mat
from ..patched import obliquity
def test_obliquity():
"""Check the calculation of inclination of an affine axes."""
from math import pi
aligned = np.diag([2.0, 2.0, 2.3, 1.0])
aligned[:-1, -1] = [-10, -... | 39.9375 | 73 | 0.640063 | import numpy as np
from nibabel.affines import from_matvec
from nibabel.eulerangles import euler2mat
from ..patched import obliquity
def test_obliquity():
from math import pi
aligned = np.diag([2.0, 2.0, 2.3, 1.0])
aligned[:-1, -1] = [-10, -10, -7]
R = from_matvec(euler2mat(x=0.09, y=0.001, z=0.001), [... | true | true |
f762950bf5a8ee40b650bad7d6d79d6d12b79153 | 1,613 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py | chanjarster/openapi-generator | f92f8f1e58c59a429295509d8c5df32b100cde22 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py | chanjarster/openapi-generator | f92f8f1e58c59a429295509d8c5df32b100cde22 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py | chanjarster/openapi-generator | f92f8f1e58c59a429295509d8c5df32b100cde22 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 19.91358 | 174 | 0.67142 |
import re import sys import typing
from frozendict import frozendict
import decimal from datetime import date, datetime from frozendict import frozendict
from petstore_api.schemas import ( AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
... | true | true |
f762952bd515185b4b69c1fcb9ac2647fcd7c1df | 1,580 | py | Python | setup.py | jaimeambrus/barril | 2897a93c660a9064f954912cc44f000d8e06a085 | [
"MIT"
] | null | null | null | setup.py | jaimeambrus/barril | 2897a93c660a9064f954912cc44f000d8e06a085 | [
"MIT"
] | null | null | null | setup.py | jaimeambrus/barril | 2897a93c660a9064f954912cc44f000d8e06a085 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import io
from setuptools import find_packages, setup
with io.open("README.rst", encoding="UTF-8") as readme_file:
readme = readme_file.read()
with io.open("CHANGELOG.rst", encoding="UTF-8") as changelog_file:
history = changelog_file.rea... | 32.244898 | 87 | 0.627848 |
import io
from setuptools import find_packages, setup
with io.open("README.rst", encoding="UTF-8") as readme_file:
readme = readme_file.read()
with io.open("CHANGELOG.rst", encoding="UTF-8") as changelog_file:
history = changelog_file.read()
requirements = ["attrs>=18.1.0", "numpy>=1.11.0"]
extras_require ... | true | true |
f762952fc2da3bbe7a8b8845b8ccb32063c150bc | 2,717 | py | Python | main/views.py | zachrasr/stu-do-list | 5ace902199d20532dc01fd39d5cd7e4101d26d93 | [
"Unlicense"
] | 2 | 2021-12-02T07:15:24.000Z | 2021-12-15T06:27:53.000Z | main/views.py | zachrasr/stu-do-list | 5ace902199d20532dc01fd39d5cd7e4101d26d93 | [
"Unlicense"
] | 1 | 2021-11-05T12:42:12.000Z | 2021-11-05T12:42:12.000Z | main/views.py | zachrasr/stu-do-list | 5ace902199d20532dc01fd39d5cd7e4101d26d93 | [
"Unlicense"
] | 6 | 2021-10-30T13:44:16.000Z | 2021-12-29T09:14:18.000Z | from django.shortcuts import render, redirect
from .forms import NewUserForm
from django.contrib.auth import login as auth_login, login, authenticate, logout
from django.contrib import messages
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.decorators import login_required
from djan... | 37.219178 | 108 | 0.664704 | from django.shortcuts import render, redirect
from .forms import NewUserForm
from django.contrib.auth import login as auth_login, login, authenticate, logout
from django.contrib import messages
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.decorators import login_required
from djan... | true | true |
f762956d8fbda0840629c7fbae72d1f6898f2ae5 | 867 | py | Python | atcoder/fenwicktree.py | zeppeki/ac-library-python | df461f48eac7fc3167f00b106cef32062b9ef0ec | [
"CC0-1.0"
] | null | null | null | atcoder/fenwicktree.py | zeppeki/ac-library-python | df461f48eac7fc3167f00b106cef32062b9ef0ec | [
"CC0-1.0"
] | null | null | null | atcoder/fenwicktree.py | zeppeki/ac-library-python | df461f48eac7fc3167f00b106cef32062b9ef0ec | [
"CC0-1.0"
] | null | null | null | # Python3 TLE
# PyPy3 AC
class fenwick_tree:
def __init__(self, n):
self.data = [0 for _ in range(n+1)]
self.n = n
def add(self, p, x):
p += 1
while p <= self.n:
self.data[p-1] += x
p += p & -p
def sum(self, l, r):
return self._sum(r) - ... | 21.146341 | 49 | 0.417532 |
class fenwick_tree:
def __init__(self, n):
self.data = [0 for _ in range(n+1)]
self.n = n
def add(self, p, x):
p += 1
while p <= self.n:
self.data[p-1] += x
p += p & -p
def sum(self, l, r):
return self._sum(r) - self._sum(l)
def _su... | true | true |
f762959d84f9da9c81a33ac8d7af6d75c64077ee | 21,617 | py | Python | hecl/blender/hecl/frme.py | RetroView/RetroCommon | a413a010b50a53ebc6b0c726203181fc179d3370 | [
"MIT"
] | 267 | 2016-03-10T21:59:16.000Z | 2021-03-28T18:21:03.000Z | hecl/blender/hecl/frme.py | cobalt2727/metaforce | 3bb05c0ee5dd9b1b8eaa861fc49713aef62c844a | [
"MIT"
] | 129 | 2016-03-12T10:17:32.000Z | 2021-04-05T20:45:19.000Z | hecl/blender/hecl/frme.py | cobalt2727/metaforce | 3bb05c0ee5dd9b1b8eaa861fc49713aef62c844a | [
"MIT"
] | 31 | 2016-03-20T00:20:11.000Z | 2021-03-10T21:14:11.000Z | import bpy, struct, math
from mathutils import Quaternion
def draw(layout, context):
if bpy.context.active_object:
obj = bpy.context.active_object
layout.label(text="Widget Settings:", icon='OBJECT_DATA')
layout.prop_menu_enum(obj, 'retro_widget_type', text='Widget Type')
#layout.pr... | 54.450882 | 169 | 0.615118 | import bpy, struct, math
from mathutils import Quaternion
def draw(layout, context):
if bpy.context.active_object:
obj = bpy.context.active_object
layout.label(text="Widget Settings:", icon='OBJECT_DATA')
layout.prop_menu_enum(obj, 'retro_widget_type', text='Widget Type')
ro... | true | true |
f76295a99abb010ce281806892965a4d84409a0d | 17,370 | py | Python | salt/cli/salt.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 5 | 2018-05-01T20:51:14.000Z | 2021-11-09T05:43:00.000Z | salt/cli/salt.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/cli/salt.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import sys
sys.modules['pkg_resources'] = None
import os
# Import Salt libs
import salt.defaults.exitcodes
import salt.utils.job
import salt.utils.parsers
import salt.utils.stringutils
import salt.log... | 39.121622 | 118 | 0.547841 |
from __future__ import absolute_import, print_function, unicode_literals
import sys
sys.modules['pkg_resources'] = None
import os
import salt.defaults.exitcodes
import salt.utils.job
import salt.utils.parsers
import salt.utils.stringutils
import salt.log
from salt.utils.args import yamlify_arg
from salt.utils.verify ... | true | true |
f76295bacefb0285a8a2a8bc9deae18c9d1f4ceb | 10,207 | py | Python | basicsr/data/reds_dataset.py | lizhihao6/HINet | 8c3fb71dc3331be32a9af3e1efe5106a0b26cefe | [
"MIT"
] | null | null | null | basicsr/data/reds_dataset.py | lizhihao6/HINet | 8c3fb71dc3331be32a9af3e1efe5106a0b26cefe | [
"MIT"
] | null | null | null | basicsr/data/reds_dataset.py | lizhihao6/HINet | 8c3fb71dc3331be32a9af3e1efe5106a0b26cefe | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from BasicSR (https://github.com/xinntao/BasicSR)
# Copyright 2018-2020 BasicSR Authors
# -------------... | 41.661224 | 82 | 0.552268 | import random
from pathlib import Path
import numpy as np
import torch
from torch.utils import data as data
from basicsr.data.transforms import augment, paired_random_crop
from basicsr.utils import FileClient, get_root_logger, imfrombytes, img2tensor
from basicsr.utils.flow_util import dequantize_flow
class REDSDat... | true | true |
f7629660edd0f64a1619fb1b7e2c6252c9836c49 | 46,240 | py | Python | lib/commands.py | ngoctrantl/Electron-Cash | dcf85282338a78dad29818ea7dbe634e65e0677f | [
"MIT"
] | null | null | null | lib/commands.py | ngoctrantl/Electron-Cash | dcf85282338a78dad29818ea7dbe634e65e0677f | [
"MIT"
] | null | null | null | lib/commands.py | ngoctrantl/Electron-Cash | dcf85282338a78dad29818ea7dbe634e65e0677f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 with... | 44.461538 | 356 | 0.628482 |
import argparse
import ast
import base64
import datetime
import json
import queue
import sys
import time
from decimal import Decimal as PyDecimal from functools import wraps
from . import bitcoin
from . import util
from .address import Address, AddressError
from .bitcoin import hash_160, COIN, TYPE_ADDRESS
from .i1... | true | true |
f7629707b41706bf06514ffdec0a9c54a845d59c | 1,424 | py | Python | test/lmp/model/_lstm_1997/test_pred.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/model/_lstm_1997/test_pred.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/model/_lstm_1997/test_pred.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | """Test prediction.
Test target:
- :py:meth:`lmp.model._lstm_1997.LSTM1997.pred`.
"""
import torch
from lmp.model._lstm_1997 import LSTM1997
def test_prediction_result(lstm_1997: LSTM1997, batch_cur_tkids: torch.Tensor) -> None:
"""Return float tensor with correct shape and range."""
lstm_1997 = lstm_1997.eval... | 33.904762 | 114 | 0.728933 |
import torch
from lmp.model._lstm_1997 import LSTM1997
def test_prediction_result(lstm_1997: LSTM1997, batch_cur_tkids: torch.Tensor) -> None:
lstm_1997 = lstm_1997.eval()
seq_len = batch_cur_tkids.size(1)
batch_prev_states = None
for i in range(seq_len):
batch_next_tkids_pd, batch_prev_states = lstm_1... | true | true |
f762974a25bc6ed350d3b52420eab0af30c56648 | 561 | py | Python | test/test_palindrome.py | sungheeyun/PythonLectures | 3a748672bf5b39568b2f42e813a0b9402711ad8e | [
"Unlicense"
] | null | null | null | test/test_palindrome.py | sungheeyun/PythonLectures | 3a748672bf5b39568b2f42e813a0b9402711ad8e | [
"Unlicense"
] | null | null | null | test/test_palindrome.py | sungheeyun/PythonLectures | 3a748672bf5b39568b2f42e813a0b9402711ad8e | [
"Unlicense"
] | null | null | null | import unittest
from list.palindrome import is_palindrome_1, is_palindrome_2
class TestIsPalindrome(unittest.TestCase):
def test_is_palindrome_1(self):
self.assertTrue(is_palindrome_1('abcdcba'))
self.assertTrue(is_palindrome_1('abcddcba'))
self.assertFalse(is_palindrome_1('acddcba'))
... | 28.05 | 60 | 0.729055 | import unittest
from list.palindrome import is_palindrome_1, is_palindrome_2
class TestIsPalindrome(unittest.TestCase):
def test_is_palindrome_1(self):
self.assertTrue(is_palindrome_1('abcdcba'))
self.assertTrue(is_palindrome_1('abcddcba'))
self.assertFalse(is_palindrome_1('acddcba'))
... | true | true |
f76297810fe6d3de1d64d1d1c5665a32bdcd0794 | 1,025 | py | Python | non_linear_model.py | prteek/sagemaker-boilerplate | 372ff5722e5f4b5e2d84008e7186762b5bade2ad | [
"Apache-2.0"
] | null | null | null | non_linear_model.py | prteek/sagemaker-boilerplate | 372ff5722e5f4b5e2d84008e7186762b5bade2ad | [
"Apache-2.0"
] | null | null | null | non_linear_model.py | prteek/sagemaker-boilerplate | 372ff5722e5f4b5e2d84008e7186762b5bade2ad | [
"Apache-2.0"
] | null | null | null | #! /opt/conda/envs/env/bin/python
import argparse
import os
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
import joblib
from sklearn.metrics import accuracy_score
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--model-dir", default="/opt/... | 26.973684 | 100 | 0.665366 | import argparse
import os
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
import joblib
from sklearn.metrics import accuracy_score
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--model-dir", default="/opt/ml/model/")
parser.add_argumen... | true | true |
f76297ebf31fdc43cff4fcafed28e88fcd555b70 | 6,344 | py | Python | pages/process.py | noreallyimfine/gdp-growth-dash-app | a85ad6ad27880f31016460d04cbacfb3d55e1d8c | [
"MIT"
] | 1 | 2019-12-17T16:06:37.000Z | 2019-12-17T16:06:37.000Z | pages/process.py | noreallyimfine/gdp-growth-dash-app | a85ad6ad27880f31016460d04cbacfb3d55e1d8c | [
"MIT"
] | 4 | 2020-03-24T17:35:45.000Z | 2021-08-23T20:28:39.000Z | pages/process.py | noreallyimfine/gdp-growth-dash-app | a85ad6ad27880f31016460d04cbacfb3d55e1d8c | [
"MIT"
] | null | null | null | import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
header = dbc.Col(
dcc.Markdown(
'# Process',
className='mb-5',
style=... | 49.5625 | 212 | 0.624685 | import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
header = dbc.Col(
dcc.Markdown(
'# Process',
className='mb-5',
style=... | true | true |
f762982b2a99c7546a39d9facad25aa69fbd22e5 | 2,223 | py | Python | data/merge_manifests.py | gruly/DSA | 08dde4513e34df0e212fbb593698fa7ec4bce631 | [
"MIT"
] | 2 | 2020-01-09T07:22:19.000Z | 2020-12-10T09:34:22.000Z | src/speech_recognition/data/merge_manifests.py | synxlin/chinese_chat_bot | 3bc9f7b228f1216ffa8639201e54224e36329b3b | [
"MIT"
] | 4 | 2018-10-22T03:01:33.000Z | 2018-10-23T02:43:31.000Z | src/speech_recognition/data/merge_manifests.py | synxlin/chinese_chat_bot | 3bc9f7b228f1216ffa8639201e54224e36329b3b | [
"MIT"
] | 5 | 2018-10-27T08:09:41.000Z | 2021-01-08T05:44:19.000Z | from __future__ import print_function
import argparse
import io
import os
import subprocess
from tqdm import trange
parser = argparse.ArgumentParser(description='Merges all manifest CSV files in specified folder.')
parser.add_argument('--merge_dir', default='manifests/', help='Path to all manifest files you want to ... | 31.309859 | 119 | 0.663068 | from __future__ import print_function
import argparse
import io
import os
import subprocess
from tqdm import trange
parser = argparse.ArgumentParser(description='Merges all manifest CSV files in specified folder.')
parser.add_argument('--merge_dir', default='manifests/', help='Path to all manifest files you want to ... | true | true |
f76298ecf36b177ddf562f486d0cbda3c9291f2b | 1,902 | py | Python | tfx/components/example_validator/component_test.py | Anon-Artist/tfx | 2692c9ab437d76b5d9517996bfe2596862e0791d | [
"Apache-2.0"
] | 2 | 2021-05-10T21:39:48.000Z | 2021-11-17T11:24:29.000Z | tfx/components/example_validator/component_test.py | Anon-Artist/tfx | 2692c9ab437d76b5d9517996bfe2596862e0791d | [
"Apache-2.0"
] | 1 | 2021-01-28T13:44:51.000Z | 2021-04-28T16:15:47.000Z | tfx/components/example_validator/component_test.py | Anon-Artist/tfx | 2692c9ab437d76b5d9517996bfe2596862e0791d | [
"Apache-2.0"
] | 1 | 2021-01-28T13:41:51.000Z | 2021-01-28T13:41:51.000Z | # Lint as: python2, python3
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 38.04 | 79 | 0.780231 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tfx.components.example_validator import component
from tfx.types import artifact_utils
from tfx.types import channel_utils
from tfx.types import standard_artifacts
from tfx.types.s... | true | true |
f7629991ed5b0bb9393c09a59cfb28a170c694b1 | 1,791 | py | Python | app.py | zilehuda/transtreaming-europa | 7e6731a0758b5cff6cabceafb1a83bcca6377e9a | [
"MIT"
] | 2 | 2020-10-17T20:01:13.000Z | 2021-06-16T14:09:39.000Z | app.py | zilehuda/transtreaming-europa | 7e6731a0758b5cff6cabceafb1a83bcca6377e9a | [
"MIT"
] | null | null | null | app.py | zilehuda/transtreaming-europa | 7e6731a0758b5cff6cabceafb1a83bcca6377e9a | [
"MIT"
] | 2 | 2020-08-26T16:22:54.000Z | 2020-10-21T09:38:10.000Z | from flask import Flask, request, flash, redirect
from rest.v1.user import app as user_api_v1
from rest.v1.transcripe_and_translate import app as tat_api_v1
from flask_socketio import SocketIO, emit
import json
from helpers import converter as converter_helper, user as user_helper
from flask_cors import CORS, cross_ori... | 25.585714 | 100 | 0.681184 | from flask import Flask, request, flash, redirect
from rest.v1.user import app as user_api_v1
from rest.v1.transcripe_and_translate import app as tat_api_v1
from flask_socketio import SocketIO, emit
import json
from helpers import converter as converter_helper, user as user_helper
from flask_cors import CORS, cross_ori... | true | true |
f76299d37a4b3f02fbe343407fc6c187e70712fc | 6,740 | py | Python | src/supervised_class/dt.py | JouniVatanen/NLP-and-Deep-Learning | 2fddcc2c39787713d33d17e80565de4ed073ca60 | [
"MIT"
] | null | null | null | src/supervised_class/dt.py | JouniVatanen/NLP-and-Deep-Learning | 2fddcc2c39787713d33d17e80565de4ed073ca60 | [
"MIT"
] | null | null | null | src/supervised_class/dt.py | JouniVatanen/NLP-and-Deep-Learning | 2fddcc2c39787713d33d17e80565de4ed073ca60 | [
"MIT"
] | 1 | 2020-03-16T13:11:14.000Z | 2020-03-16T13:11:14.000Z | # https://deeplearningcourses.com/c/data-science-supervised-machine-learning-in-python
# https://www.udemy.com/data-science-supervised-machine-learning-in-python
# Decision Tree for continuous-vector input, binary output
from __future__ import print_function, division
from future.utils import iteritems
from builtins im... | 31.643192 | 86 | 0.515282 | from __future__ import print_function, division
from future.utils import iteritems
from builtins import range, input
import numpy as np
from util import get_data, get_xor, get_donut
from datetime import datetime
def entropy(y):
N = len(y)
s1 = (y == 1).sum()
if 0 == s1 or N == s1:
return 0
... | true | true |
f76299f12fce2c158cca7527450a61daa1328b2e | 1,756 | py | Python | src/model.py | mulinlab/LoopAnchor | cee625ccddaef12c4df2a9e41ce582c3b3e1d33d | [
"BSD-3-Clause"
] | 2 | 2019-06-03T04:46:22.000Z | 2021-10-02T02:43:50.000Z | src/model.py | mulinlab/LoopAnchor | cee625ccddaef12c4df2a9e41ce582c3b3e1d33d | [
"BSD-3-Clause"
] | null | null | null | src/model.py | mulinlab/LoopAnchor | cee625ccddaef12c4df2a9e41ce582c3b3e1d33d | [
"BSD-3-Clause"
] | 1 | 2022-02-14T02:35:17.000Z | 2022-02-14T02:35:17.000Z | import pandas as pd
from math import exp
def LoopAnchor(df_peak_motif, df_loop):
# constants
w_ori = 3
w_ctcf = 8.5
lambda_ = 3000000
#### load peak file
n = len(df_peak_motif)
ctcf = df_peak_motif[['h', 'anchor']].apply(lambda s: s[0] * s[1], axis=1).mean()
peak_dict = ... | 27.015385 | 85 | 0.566059 | import pandas as pd
from math import exp
def LoopAnchor(df_peak_motif, df_loop):
w_ori = 3
w_ctcf = 8.5
lambda_ = 3000000
n = len(df_peak_motif)
ctcf = df_peak_motif[['h', 'anchor']].apply(lambda s: s[0] * s[1], axis=1).mean()
peak_dict = {}
for index, row in df_peak... | true | true |
f7629a8bc25b77d0f96e31114d33fc6e039b61c6 | 1,606 | py | Python | otcextensions/tests/functional/sdk/nat/v2/test_snat.py | spielkind/python-otcextensions | 47ba917df2d85db6cb347f2038fd7f79a8a806b7 | [
"Apache-2.0"
] | null | null | null | otcextensions/tests/functional/sdk/nat/v2/test_snat.py | spielkind/python-otcextensions | 47ba917df2d85db6cb347f2038fd7f79a8a806b7 | [
"Apache-2.0"
] | null | null | null | otcextensions/tests/functional/sdk/nat/v2/test_snat.py | spielkind/python-otcextensions | 47ba917df2d85db6cb347f2038fd7f79a8a806b7 | [
"Apache-2.0"
] | null | null | null | # 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
# distributed under t... | 34.170213 | 75 | 0.638854 | import openstack
from otcextensions.tests.functional import base
from datetime import datetime
_logger = openstack._log.setup_logging('openstack')
class TestSnat(base.BaseFunctionalTest):
CURR_TIME = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")
def setUp(self):
super(TestSnat, self).setUp()
... | true | true |
f7629bcdd9ac8d67acbb5c14223522aea6dacb4f | 4,459 | py | Python | python/dataproc_templates/hive/hive_to_gcs.py | samkenxstream/dataproc-templates | f864cd97ca96f5e3da99931f323d7c9a52035094 | [
"Apache-2.0"
] | 15 | 2021-11-04T23:48:05.000Z | 2022-03-31T10:29:01.000Z | python/dataproc_templates/hive/hive_to_gcs.py | samkenxstream/dataproc-templates | f864cd97ca96f5e3da99931f323d7c9a52035094 | [
"Apache-2.0"
] | 64 | 2021-11-05T18:29:02.000Z | 2022-03-31T18:41:47.000Z | python/dataproc_templates/hive/hive_to_gcs.py | samkenxstream/dataproc-templates | f864cd97ca96f5e3da99931f323d7c9a52035094 | [
"Apache-2.0"
] | 14 | 2021-11-05T16:56:54.000Z | 2022-03-31T18:02:13.000Z | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 34.3 | 75 | 0.624355 |
from typing import Dict, Sequence, Optional, Any
from logging import Logger
import argparse
import pprint
from pyspark.sql import SparkSession, DataFrameWriter
from dataproc_templates import BaseTemplate
import dataproc_templates.util.template_constants as constants
__all__ = ['HiveToGCSTemplate']
class HiveToGCS... | true | true |
f7629c0bdd9ab0e609b409fefda40164edb6cec6 | 5,279 | py | Python | python/elm_license_finder/main.py | wolfadex/elm-license-finder | 44a9b6b255bca9c8a39e1d6e3d70eee0ec56a6f9 | [
"MIT"
] | 12 | 2019-12-27T07:01:59.000Z | 2020-04-01T17:03:06.000Z | python/elm_license_finder/main.py | wolfadex/elm-license-finder | 44a9b6b255bca9c8a39e1d6e3d70eee0ec56a6f9 | [
"MIT"
] | 3 | 2020-01-02T08:25:28.000Z | 2020-01-09T22:56:56.000Z | python/elm_license_finder/main.py | wolfadex/elm-license-finder | 44a9b6b255bca9c8a39e1d6e3d70eee0ec56a6f9 | [
"MIT"
] | 3 | 2019-12-27T12:43:09.000Z | 2020-01-04T03:27:48.000Z | import os
import sys
import re
import json
import platform
try:
from pathlib import Path
from colorclass import Color
from terminaltables import SingleTable
import semver
except ImportError:
print("ERROR: Need to install required modules.")
print("python3 -m pip install colorclass terminaltable... | 31.422619 | 78 | 0.599735 | import os
import sys
import re
import json
import platform
try:
from pathlib import Path
from colorclass import Color
from terminaltables import SingleTable
import semver
except ImportError:
print("ERROR: Need to install required modules.")
print("python3 -m pip install colorclass terminaltable... | true | true |
f7629e642e536f311c3bbda1b475ca827bf0627a | 4,121 | py | Python | lib/net/pcn_coarse.py | liuhuaijjin/rpn_rois_proposals_layers | c5f9f09b3ae8c52e4b6fa3fda391f993cb7d42c1 | [
"MIT"
] | 1 | 2022-01-21T09:07:08.000Z | 2022-01-21T09:07:08.000Z | lib/net/pcn_coarse.py | liuhuaijjin/rpn_rois_proposals_layers | c5f9f09b3ae8c52e4b6fa3fda391f993cb7d42c1 | [
"MIT"
] | null | null | null | lib/net/pcn_coarse.py | liuhuaijjin/rpn_rois_proposals_layers | c5f9f09b3ae8c52e4b6fa3fda391f993cb7d42c1 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self):
super(Encoder, self).__init__()
# first shared mlp
self.conv1 = nn.Conv1d(3, 128, 1)
self.conv2 = nn.Conv1d(128, 256, 1)
self.bn1 = nn.BatchN... | 32.968 | 117 | 0.523417 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self):
super(Encoder, self).__init__()
self.conv1 = nn.Conv1d(3, 128, 1)
self.conv2 = nn.Conv1d(128, 256, 1)
self.bn1 = nn.BatchNorm1d(128)
... | true | true |
f7629f352cb12f2af4627e77d919e364a6ecf49d | 2,776 | py | Python | download_longitudinal.py | uwmadison-chm/redcap-examples | 376d62cf18a7e76265fc251425d2bfae3a2c6521 | [
"MIT"
] | 1 | 2020-10-29T15:37:12.000Z | 2020-10-29T15:37:12.000Z | download_longitudinal.py | uwmadison-chm/redcap-examples | 376d62cf18a7e76265fc251425d2bfae3a2c6521 | [
"MIT"
] | null | null | null | download_longitudinal.py | uwmadison-chm/redcap-examples | 376d62cf18a7e76265fc251425d2bfae3a2c6521 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Downloads the data for a longitudinal REDCap project, with each event as
a separate file. Also allows filtering by standard REDCap logic, so you can,
for example, exclude non-enrolled participants from your data.
Requires an instrument_download_list_file, which is a CSV file containing
the ... | 32.27907 | 78 | 0.716138 |
import sys
import os
import redcap
import pandas as pd
from pathlib import Path
import logging
logging.basicConfig(format='%(message)s')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
API_URL = os.environ['REDCAP_API_URL']
API_TOK = os.environ['REDCAP_API_TOKEN']
FILTER = os.environ.get('RED... | true | true |
f762a03398f84227c520e28513602bafa09f6d74 | 819 | py | Python | app/__init__.py | Garlinsk/News-App | a2a5e4b8e74254a174c0527c9e26921b6cd7079a | [
"MIT"
] | null | null | null | app/__init__.py | Garlinsk/News-App | a2a5e4b8e74254a174c0527c9e26921b6cd7079a | [
"MIT"
] | null | null | null | app/__init__.py | Garlinsk/News-App | a2a5e4b8e74254a174c0527c9e26921b6cd7079a | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
# from app import views
# from app import error
# def create_app(config_name):
# app=Flask(__name__)
# bootstrap=Bootstrap(app)
# app.config.from_object(config_options[config_name])
# from .main import mai... | 24.088235 | 57 | 0.747253 | from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config_options[config_name])
bootstrap = Bootstrap(app)
from .main import main as main_blueprint
app.register... | true | true |
f762a0a565c5bc3e8c3d6ec83ed96f0897b93a9e | 5,781 | py | Python | airflow/contrib/hooks/gcloud/gcs_hook.py | ekhtiar/airflow | 9410715c81a2a16dcd04e7cce56d75747bb19ff6 | [
"Apache-2.0"
] | 1 | 2021-04-05T11:25:36.000Z | 2021-04-05T11:25:36.000Z | airflow/contrib/hooks/gcloud/gcs_hook.py | fvlankvelt/airflow | 6cbe4a475f773bf32e1d7743718f7ae1a7dd9c91 | [
"Apache-2.0"
] | null | null | null | airflow/contrib/hooks/gcloud/gcs_hook.py | fvlankvelt/airflow | 6cbe4a475f773bf32e1d7743718f7ae1a7dd9c91 | [
"Apache-2.0"
] | 1 | 2019-12-12T06:44:14.000Z | 2019-12-12T06:44:14.000Z | # -*- coding: utf-8 -*-
#
# 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
... | 31.248649 | 78 | 0.594534 |
from future.standard_library import install_aliases
install_aliases()
from airflow.contrib.hooks.gcloud.base_hook import GCPBaseHook
from urllib.parse import urlparse
from airflow.utils import AirflowException
import gcloud.storage
def parse_gcs_url(gsurl):
parsed_url = urlparse(gsurl)
if not parsed_url.ne... | true | true |
f762a0ac394e6e2223bf11a6ba66102c6bed68a9 | 5,083 | py | Python | apps/task/views.py | hgpestana/chronos | 5fa7b783c818070feaf5f7b8d0c4726a6649ef05 | [
"MIT"
] | null | null | null | apps/task/views.py | hgpestana/chronos | 5fa7b783c818070feaf5f7b8d0c4726a6649ef05 | [
"MIT"
] | 2 | 2017-08-10T12:05:34.000Z | 2017-08-10T16:31:01.000Z | apps/task/views.py | hgpestana/chronos | 5fa7b783c818070feaf5f7b8d0c4726a6649ef05 | [
"MIT"
] | null | null | null | from datetime import datetime
from math import floor
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic.detail import DetailView
from django.views.generic.e... | 29.212644 | 91 | 0.731261 | from datetime import datetime
from math import floor
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic.detail import DetailView
from django.views.generic.e... | true | true |
f762a2b69153e6b257361f3e2a42946ee39e3261 | 1,029 | py | Python | week07/myproject/myapp/views.py | wasit7/dsi202_2021 | 678c0cf4b6d888b29a9b5d7b62ef171a5a399eac | [
"MIT"
] | null | null | null | week07/myproject/myapp/views.py | wasit7/dsi202_2021 | 678c0cf4b6d888b29a9b5d7b62ef171a5a399eac | [
"MIT"
] | null | null | null | week07/myproject/myapp/views.py | wasit7/dsi202_2021 | 678c0cf4b6d888b29a9b5d7b62ef171a5a399eac | [
"MIT"
] | null | null | null | from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView
from django.views.generic.edit import UpdateView
from django.views.generic import ListView
from django.urls import reverse
from myapp.models import Bike
class BikeDetailView(DetailView):
model = Bike
template_n... | 31.181818 | 61 | 0.714286 | from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView
from django.views.generic.edit import UpdateView
from django.views.generic import ListView
from django.urls import reverse
from myapp.models import Bike
class BikeDetailView(DetailView):
model = Bike
template_n... | true | true |
f762a2f9ff0fbf03222f717fc392dac6ac1843c1 | 376 | py | Python | users/urls.py | work-development/hw04_tests | e9688f1ca92fca99e8c8cbdaa8535913ea1d614e | [
"BSD-3-Clause"
] | null | null | null | users/urls.py | work-development/hw04_tests | e9688f1ca92fca99e8c8cbdaa8535913ea1d614e | [
"BSD-3-Clause"
] | 3 | 2021-09-08T03:27:47.000Z | 2022-03-12T00:58:58.000Z | users/urls.py | work-development/hw05_final | 19dc4eca7cf708866c9eb8c3f5b94d52a3ca1ab4 | [
"BSD-3-Clause"
] | null | null | null |
from django.urls import path
from . import views
urlpatterns = [
# path() для страницы регистрации нового пользователя
# её полный адрес будет auth/signup/, но префикс auth/ обрабатывется в головном urls.py
path("signup/", views.SignUp.as_view(), name="signup"),
#login разде... | 26.857143 | 95 | 0.656915 |
from django.urls import path
from . import views
urlpatterns = [
path("signup/", views.SignUp.as_view(), name="signup"),
] | true | true |
f762a4e66768581d19b132bc06249ddab54c96a9 | 2,115 | py | Python | pytai/view/widgets.py | angea/pytai | 2db2518be9c4324aed182f36208c0e0ccf53a96c | [
"Apache-2.0"
] | 30 | 2021-08-12T12:50:18.000Z | 2022-02-18T03:49:20.000Z | pytai/view/widgets.py | angea/pytai | 2db2518be9c4324aed182f36208c0e0ccf53a96c | [
"Apache-2.0"
] | 3 | 2021-10-31T17:28:39.000Z | 2021-11-12T13:19:14.000Z | pytai/view/widgets.py | angea/pytai | 2db2518be9c4324aed182f36208c0e0ccf53a96c | [
"Apache-2.0"
] | 5 | 2021-10-31T15:55:19.000Z | 2022-02-24T06:31:18.000Z | """Various widgets.
License:
MIT License
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, mod... | 37.767857 | 95 | 0.673286 |
import tkinter as tk
class EntryWithPlaceholder(tk.Entry):
def __init__(self, master=None, placeholder="PLACEHOLDER", color='grey', *args, **kwargs):
super().__init__(master, *args, **kwargs)
self.placeholder = placeholder
self.placeholder_color = color
self.default_fg_... | true | true |
f762a4e6ed92b00556164d00e57b09ff106dd1ad | 3,929 | py | Python | pv.py | mayank42/Earthquake-Signal-Analysis-using-Deep-CNN | fdeca035277acd1b37759c546c90bcdd63168412 | [
"MIT"
] | 5 | 2018-08-25T07:46:49.000Z | 2021-12-11T16:49:17.000Z | pv.py | mayank42/Earthquake-Signal-Analysis-using-Deep-CNN | fdeca035277acd1b37759c546c90bcdd63168412 | [
"MIT"
] | null | null | null | pv.py | mayank42/Earthquake-Signal-Analysis-using-Deep-CNN | fdeca035277acd1b37759c546c90bcdd63168412 | [
"MIT"
] | 5 | 2018-01-23T06:12:35.000Z | 2021-09-03T02:23:22.000Z | """
pv.py
Phase Vocoder implementation in Python
The MIT License (MIT)
Copyright (c) 2015 multivac61
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 limit... | 27.475524 | 82 | 0.654365 |
import sys
import numpy as np
from math import floor
epsilon = sys.float_info.epsilon
class PhaseVocoder(object):
def __init__(self, N=2**12, M=2**12, Rs=(2**12/8), w=np.hanning(2**12), alpha=1):
super(PhaseVocoder, self).__init__()
self.N = N self.M = M self.Rs = Rs self.alpha = alpha se... | true | true |
f762a5e12671e2192b048ad212451bdf20700d6b | 10,636 | py | Python | src/ebay_rest/api/commerce_notification/models/error.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/commerce_notification/models/error.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/commerce_notification/models/error.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | # coding: utf-8
"""
Notification API
The eBay Notification API enables management of the entire end-to-end eBay notification experience by allowing users to:<ul><li>Browse for supported notification topics and retrieve topic details</li><li>Create, configure, and manage notification destination endpionts</li>... | 31.560831 | 442 | 0.604739 |
import pprint
import re
import six
class Error(object):
swagger_types = {
'category': 'str',
'domain': 'str',
'error_id': 'int',
'input_ref_ids': 'list[str]',
'long_message': 'str',
'message': 'str',
'output_ref_ids': 'list[str]',
'parameters': 'l... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.