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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f759483641c878bdd62416d129be72f1380ae67b | 4,028 | py | Python | python/example/print_quadruped_3d.py | brokencuph/diff_pd | 2c30ecfa39762c5fc78dea9c7a226000e9fc5c15 | [
"MIT"
] | 4 | 2022-02-10T02:28:42.000Z | 2022-02-10T07:28:35.000Z | python/example/print_quadruped_3d.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | python/example/print_quadruped_3d.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | 2 | 2022-03-11T20:13:24.000Z | 2022-03-12T03:38:46.000Z | import sys
sys.path.append('../')
from pathlib import Path
import pickle
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from matplotlib.gridspec import GridSpec
import numpy as np
from py_diff_pd.common.common import print_info, print_error
def format_axes(fig):
for i, ax in enumer... | 42.851064 | 161 | 0.596822 | import sys
sys.path.append('../')
from pathlib import Path
import pickle
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from matplotlib.gridspec import GridSpec
import numpy as np
from py_diff_pd.common.common import print_info, print_error
def format_axes(fig):
for i, ax in enumer... | true | true |
f759484386424ba696fe4961ac9a21cc5be05e64 | 889 | py | Python | shelvery_lambda/lambda_handler.py | virajs/shelvery-aws-backups | d09f7b6a0694366f549cd130cd29e2fa59b84d5f | [
"MIT"
] | 1 | 2019-06-27T11:56:00.000Z | 2019-06-27T11:56:00.000Z | shelvery_lambda/lambda_handler.py | virajs/shelvery-aws-backups | d09f7b6a0694366f549cd130cd29e2fa59b84d5f | [
"MIT"
] | null | null | null | shelvery_lambda/lambda_handler.py | virajs/shelvery-aws-backups | d09f7b6a0694366f549cd130cd29e2fa59b84d5f | [
"MIT"
] | null | null | null | import logging
import json
from shelvery.factory import ShelveryFactory
def lambda_handler(event, context):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.info(f"Received event\n{json.dumps(event,indent=2)}")
if 'backup_type' not in event:
raise Exception("Expectin... | 26.939394 | 88 | 0.690664 | import logging
import json
from shelvery.factory import ShelveryFactory
def lambda_handler(event, context):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.info(f"Received event\n{json.dumps(event,indent=2)}")
if 'backup_type' not in event:
raise Exception("Expectin... | true | true |
f7594afedd3cb9c38215659d9561fec23d2294e9 | 1,859 | py | Python | UnitaryTest/test_tools.py | dayvr/udacity-practices-intro | 4189ed7377fb142f0b9d8152a1340c1c6889a5ba | [
"MIT"
] | 1 | 2018-08-19T15:43:31.000Z | 2018-08-19T15:43:31.000Z | UnitaryTest/test_tools.py | dayvr/udacity-practices-intro | 4189ed7377fb142f0b9d8152a1340c1c6889a5ba | [
"MIT"
] | null | null | null | UnitaryTest/test_tools.py | dayvr/udacity-practices-intro | 4189ed7377fb142f0b9d8152a1340c1c6889a5ba | [
"MIT"
] | null | null | null | # Test utils
class TestTools():
DIVIDER_LENGTH = 60
def __init__(self):
self.total_run_tests = 0
self.num_success = 0
self.test_msg = ''
self.test_result = ''
self.show_obtained = False
def __del__(self):
print('\n' + self.show_result_division())
... | 28.166667 | 94 | 0.56482 |
class TestTools():
DIVIDER_LENGTH = 60
def __init__(self):
self.total_run_tests = 0
self.num_success = 0
self.test_msg = ''
self.test_result = ''
self.show_obtained = False
def __del__(self):
print('\n' + self.show_result_division())
print(self.... | true | true |
f7594d274b7843a4ef13363092b38d66f2750fa4 | 11,745 | py | Python | python_modules/libraries/dagster-celery-docker/dagster_celery_docker/executor.py | abkfenris/dagster | 7f35164535200cf904a4fdb18af207ccad09ad68 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-celery-docker/dagster_celery_docker/executor.py | abkfenris/dagster | 7f35164535200cf904a4fdb18af207ccad09ad68 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-celery-docker/dagster_celery_docker/executor.py | abkfenris/dagster | 7f35164535200cf904a4fdb18af207ccad09ad68 | [
"Apache-2.0"
] | null | null | null | import json
import os
import docker.client
from dagster_celery.config import DEFAULT_CONFIG, dict_wrapper
from dagster_celery.core_execution_loop import DELEGATE_MARKER, core_celery_execution_loop
from dagster_celery.defaults import broker_url, result_backend
from dagster_celery.executor import CELERY_CONFIG
from dag... | 37.887097 | 135 | 0.635334 | import json
import os
import docker.client
from dagster_celery.config import DEFAULT_CONFIG, dict_wrapper
from dagster_celery.core_execution_loop import DELEGATE_MARKER, core_celery_execution_loop
from dagster_celery.defaults import broker_url, result_backend
from dagster_celery.executor import CELERY_CONFIG
from dag... | true | true |
f7594de68bf56d70faf8bacb66ec45eaf77a2fb0 | 246 | py | Python | UVa 10019 funny encrypytion method/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2020-11-24T03:17:21.000Z | 2020-11-24T03:17:21.000Z | UVa 10019 funny encrypytion method/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | null | null | null | UVa 10019 funny encrypytion method/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2021-04-11T16:22:31.000Z | 2021-04-11T16:22:31.000Z | import sys
from collections import Counter
sys.stdin = open('input.txt')
numTest = int(input())
for x in range(numTest):
n = raw_input().strip()
b1 = Counter(bin(int(n)))['1']
b2 = Counter(bin(int(n, base=16)))['1']
print b1, b2
| 22.363636 | 43 | 0.626016 | import sys
from collections import Counter
sys.stdin = open('input.txt')
numTest = int(input())
for x in range(numTest):
n = raw_input().strip()
b1 = Counter(bin(int(n)))['1']
b2 = Counter(bin(int(n, base=16)))['1']
print b1, b2
| false | true |
f759516b98146e1293d46617c3509c2599d8a9a1 | 1,545 | py | Python | Section03/Dictionary.py | fosterleejoe/Developing-NLP-Applications-Using-NLTK-in-Python | f2cac32c02d0632fb89f32446388ef15d9926bbc | [
"MIT"
] | 67 | 2017-11-23T18:48:47.000Z | 2022-03-29T08:03:25.000Z | Section03/Dictionary.py | fosterleejoe/Developing-NLP-Applications-Using-NLTK-in-Python | f2cac32c02d0632fb89f32446388ef15d9926bbc | [
"MIT"
] | null | null | null | Section03/Dictionary.py | fosterleejoe/Developing-NLP-Applications-Using-NLTK-in-Python | f2cac32c02d0632fb89f32446388ef15d9926bbc | [
"MIT"
] | 49 | 2017-12-06T16:10:14.000Z | 2021-11-25T09:02:49.000Z | import nltk
class LearningDictionary():
def __init__(self, sentence):
self.words = nltk.word_tokenize(sentence)
self.tagged = nltk.pos_tag(self.words)
self.buildDictionary()
self.buildReverseDictionary()
def buildDictionary(self):
self.dictionary = {}
for (word,... | 33.586957 | 82 | 0.634951 | import nltk
class LearningDictionary():
def __init__(self, sentence):
self.words = nltk.word_tokenize(sentence)
self.tagged = nltk.pos_tag(self.words)
self.buildDictionary()
self.buildReverseDictionary()
def buildDictionary(self):
self.dictionary = {}
for (word,... | true | true |
f75951ccfed46e2ae72df66a9e79b3712dc5e44f | 3,218 | py | Python | inconsistency_graph_construction.py | weihs/hashtag_co-occurrence_network | b6aaa664d4cd42fd7dfd2d2dc2350568e0c6b08e | [
"MIT"
] | null | null | null | inconsistency_graph_construction.py | weihs/hashtag_co-occurrence_network | b6aaa664d4cd42fd7dfd2d2dc2350568e0c6b08e | [
"MIT"
] | null | null | null | inconsistency_graph_construction.py | weihs/hashtag_co-occurrence_network | b6aaa664d4cd42fd7dfd2d2dc2350568e0c6b08e | [
"MIT"
] | null | null | null | import json
import copy
import yaml
import sys
import numpy as np
import networkx as nx
from scipy import linalg
def merge_cooccurrence_matrix(number_of_days, origin_directory,result_directory,origin_prefix,result_filename):
postfix='.npy'
for i in range(1,1+number_of_days):#build combine co_occurrence matrix... | 37.858824 | 120 | 0.717526 | import json
import copy
import yaml
import sys
import numpy as np
import networkx as nx
from scipy import linalg
def merge_cooccurrence_matrix(number_of_days, origin_directory,result_directory,origin_prefix,result_filename):
postfix='.npy'
for i in range(1,1+number_of_days): filename=origin_directory+o... | true | true |
f75952778e05e3621ea57acae68fee5769c5923e | 6,553 | py | Python | tests/test_client.py | aditim1359/mltrace | 626d50d91fef8f691759a5056eb6c3910f76f266 | [
"Apache-2.0"
] | null | null | null | tests/test_client.py | aditim1359/mltrace | 626d50d91fef8f691759a5056eb6c3910f76f266 | [
"Apache-2.0"
] | null | null | null | tests/test_client.py | aditim1359/mltrace | 626d50d91fef8f691759a5056eb6c3910f76f266 | [
"Apache-2.0"
] | null | null | null | import copy
import unittest
import warnings
from datetime import datetime
from mltrace import (
set_db_uri,
create_component,
log_component_run,
register,
get_history,
get_recent_run_ids,
load,
save,
)
from mltrace.entities import ComponentRun, IOPointer
class TestClient(unittest.Test... | 28.867841 | 72 | 0.567374 | import copy
import unittest
import warnings
from datetime import datetime
from mltrace import (
set_db_uri,
create_component,
log_component_run,
register,
get_history,
get_recent_run_ids,
load,
save,
)
from mltrace.entities import ComponentRun, IOPointer
class TestClient(unittest.Test... | true | true |
f7595301635f6bdfd3c135028b2e16059b993d53 | 21,451 | py | Python | label_studio/utils/models.py | KUASWoodyLIN/label-studio | 625b5881de59b0921954a66d88810b0898833c19 | [
"Apache-2.0"
] | 1 | 2020-06-14T02:48:09.000Z | 2020-06-14T02:48:09.000Z | label_studio/utils/models.py | KUASWoodyLIN/label-studio | 625b5881de59b0921954a66d88810b0898833c19 | [
"Apache-2.0"
] | 7 | 2021-03-01T21:13:19.000Z | 2022-03-12T00:31:54.000Z | label_studio/utils/models.py | KUASWoodyLIN/label-studio | 625b5881de59b0921954a66d88810b0898833c19 | [
"Apache-2.0"
] | null | null | null | import io
import os
import re
import attr
import urllib
import logging
import xmljson
import requests
import jsonschema
try:
import ujson as json
except:
import json
from lxml import etree
from datetime import datetime
from requests.adapters import HTTPAdapter
from .io import get_data_dir
from .exceptions impo... | 36.173693 | 121 | 0.609342 | import io
import os
import re
import attr
import urllib
import logging
import xmljson
import requests
import jsonschema
try:
import ujson as json
except:
import json
from lxml import etree
from datetime import datetime
from requests.adapters import HTTPAdapter
from .io import get_data_dir
from .exceptions impo... | true | true |
f759535981ec91122ae78419a705db183247e4d8 | 6,292 | py | Python | scripts_a2c/script5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | 1 | 2020-06-14T13:50:28.000Z | 2020-06-14T13:50:28.000Z | scripts_a2c/script5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | scripts_a2c/script5.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | # Similar to script 1 but with discrete-value actions.
# It uses CompleteEnvironmentA2C2
from sys_simulator import general as gen
from sys_simulator.q_learning.environments.completeEnvironmentA2C2 \
import CompleteEnvironmentA2C2
from sys_simulator.q_learning.rewards import dis_reward_tensor
from sys_simulator.par... | 41.124183 | 78 | 0.655118 |
from sys_simulator import general as gen
from sys_simulator.q_learning.environments.completeEnvironmentA2C2 \
import CompleteEnvironmentA2C2
from sys_simulator.q_learning.rewards import dis_reward_tensor
from sys_simulator.parameters.parameters import EnvironmentParameters
from sys_simulator.a2c.agent import Agent... | true | true |
f759558c126418fdc345d35cf425ec0e6da3b8fa | 5,543 | py | Python | yt/frontends/athena/fields.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/athena/fields.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | 8 | 2020-04-02T16:51:49.000Z | 2022-01-11T14:12:44.000Z | yt/frontends/athena/fields.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | 2 | 2020-08-12T15:46:11.000Z | 2021-02-09T13:09:17.000Z | from yt.fields.field_info_container import FieldInfoContainer
from yt.utilities.physical_constants import kboltz, mh
b_units = "code_magnetic"
pres_units = "code_pressure"
erg_units = "code_mass * (code_length/code_time)**2"
rho_units = "code_mass / code_length**3"
def velocity_field(comp):
def _velocity(field, ... | 35.532051 | 82 | 0.52228 | from yt.fields.field_info_container import FieldInfoContainer
from yt.utilities.physical_constants import kboltz, mh
b_units = "code_magnetic"
pres_units = "code_pressure"
erg_units = "code_mass * (code_length/code_time)**2"
rho_units = "code_mass / code_length**3"
def velocity_field(comp):
def _velocity(field, ... | true | true |
f75955ab086d9ea3258d1da4b477432200b2d3bf | 234 | py | Python | discord/activity/rawactivityassets.py | AA1999/Disthon | fcf4e550750938b87a1fb48ff3006bdeeecd73e3 | [
"MIT"
] | 14 | 2021-09-20T10:50:03.000Z | 2022-03-01T16:01:08.000Z | discord/activity/rawactivityassets.py | Rashaad1268/Disthon | 50c191fc2750bcb28280006e1f9bbd1fa65bac33 | [
"MIT"
] | 25 | 2021-12-12T15:52:19.000Z | 2022-03-31T19:45:46.000Z | discord/activity/rawactivityassets.py | Rashaad1268/Disthon | 50c191fc2750bcb28280006e1f9bbd1fa65bac33 | [
"MIT"
] | 12 | 2021-09-22T10:40:50.000Z | 2021-11-25T15:47:42.000Z | from __future__ import annotations
from typing import TypedDict
from ..types.snowflake import Snowflake
class RawActivityAssets(TypedDict):
largeimage: Snowflake
largetext: str
smallimage: Snowflake
smalltext: str
| 18 | 39 | 0.777778 | from __future__ import annotations
from typing import TypedDict
from ..types.snowflake import Snowflake
class RawActivityAssets(TypedDict):
largeimage: Snowflake
largetext: str
smallimage: Snowflake
smalltext: str
| true | true |
f75957357f77965d8d69ad919c3ada97f9f0981e | 18,847 | py | Python | src/transformers/configuration_utils.py | jinoobaek-qz/transformers-1 | e8db8b845a971b0cf63a0896b9deb5b316028a8b | [
"Apache-2.0"
] | 1 | 2020-06-09T22:41:09.000Z | 2020-06-09T22:41:09.000Z | src/transformers/configuration_utils.py | jinoobaek-qz/transformers-1 | e8db8b845a971b0cf63a0896b9deb5b316028a8b | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_utils.py | jinoobaek-qz/transformers-1 | e8db8b845a971b0cf63a0896b9deb5b316028a8b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 46.193627 | 193 | 0.642861 |
import copy
import json
import logging
import os
from typing import Dict, Tuple
from .file_utils import CONFIG_NAME, cached_path, hf_bucket_url, is_remote_url
logger = logging.getLogger(__name__)
class PretrainedConfig(object):
model_type: str = ""
def __init__(self, **kwargs):
self.outp... | true | true |
f75957e4f6c11befb8a924de462f305ef98b03ee | 124 | py | Python | cases/pert.py | lacknc/Andes | 3664ff69406ac01381b675393d6ac96fcf080b25 | [
"Apache-2.0"
] | 1 | 2018-01-11T22:58:17.000Z | 2018-01-11T22:58:17.000Z | cases/pert.py | rwl/Andes | 6818dcc86bd7e1a5028b5be1deee3d6b4171c540 | [
"Apache-2.0"
] | null | null | null | cases/pert.py | rwl/Andes | 6818dcc86bd7e1a5028b5be1deee3d6b4171c540 | [
"Apache-2.0"
] | null | null | null | """Sample perturbation file. It trips the 9th generator at t=2"""
def pert(t, system):
if 2.0 <= t <=2.2:
pass | 20.666667 | 65 | 0.58871 |
def pert(t, system):
if 2.0 <= t <=2.2:
pass | true | true |
f75958ccd1c59ca0eaf6ebe2b575a84fc8f929c7 | 488 | py | Python | conduit/domain/user/schema.py | utilmeta/utilmeta-py-realworld-example-app- | cf6d9e83e72323a830b2fcdb5c5eae3ebd800103 | [
"MIT"
] | null | null | null | conduit/domain/user/schema.py | utilmeta/utilmeta-py-realworld-example-app- | cf6d9e83e72323a830b2fcdb5c5eae3ebd800103 | [
"MIT"
] | null | null | null | conduit/domain/user/schema.py | utilmeta/utilmeta-py-realworld-example-app- | cf6d9e83e72323a830b2fcdb5c5eae3ebd800103 | [
"MIT"
] | null | null | null | from utilmeta.utils import *
class UserBase(Schema):
username: str
bio: str
image: str
class UserLogin(Schema):
email: str
password: str
class UserRegister(UserLogin):
username: str
class UserSchema(UserBase):
email: str
password: str = Field(writeonly=True)
token: str = Fiel... | 18.074074 | 117 | 0.702869 | from utilmeta.utils import *
class UserBase(Schema):
username: str
bio: str
image: str
class UserLogin(Schema):
email: str
password: str
class UserRegister(UserLogin):
username: str
class UserSchema(UserBase):
email: str
password: str = Field(writeonly=True)
token: str = Fiel... | true | true |
f75959281204618a3c5d796af4716af4a3a9ca83 | 2,865 | py | Python | update/templates/update_mongodb.py | xudan16/dovetail-webportal | a3f41a3a2c2ef871b0e314ec14bbfff532f533f6 | [
"Apache-2.0"
] | 2 | 2018-09-05T15:00:25.000Z | 2019-02-25T14:11:47.000Z | update/templates/update_mongodb.py | xudan16/dovetail-webportal | a3f41a3a2c2ef871b0e314ec14bbfff532f533f6 | [
"Apache-2.0"
] | 5 | 2020-10-27T21:16:33.000Z | 2022-01-13T01:08:02.000Z | update/templates/update_mongodb.py | xudan16/dovetail-webportal | a3f41a3a2c2ef871b0e314ec14bbfff532f533f6 | [
"Apache-2.0"
] | 8 | 2018-07-27T03:09:34.000Z | 2019-11-07T06:57:17.000Z | ##############################################################################
# Copyright (c) 2016 ZTE Corporation
# feng.xiaowei@zte.com.cn
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 31.483516 | 78 | 0.626178 | import argparse
from pymongo import MongoClient
from changes_in_mongodb import collections_old2New, \
fields_old2New, docs_old2New
from utils import main, parse_mongodb_url
parser = argparse.ArgumentParser(description='Update MongoDBs')
parser.add_argument('-u', '--url',
type=str,
... | true | true |
f7595b75dd09c99f6a7615e2029618acee72f282 | 897 | py | Python | app/api/v1/models/votequestion.py | NjuiNjeri/Questionerapi | d93e77abc4de624d48926516b6366500b378b737 | [
"MIT"
] | null | null | null | app/api/v1/models/votequestion.py | NjuiNjeri/Questionerapi | d93e77abc4de624d48926516b6366500b378b737 | [
"MIT"
] | null | null | null | app/api/v1/models/votequestion.py | NjuiNjeri/Questionerapi | d93e77abc4de624d48926516b6366500b378b737 | [
"MIT"
] | null | null | null | from flask import json, django
class Vote_Question(self.):
userUpVotes = self.votequestion('User', blank=True, related_name='questionUpVotes')
userDownVotes = self.votequestion('User', blank=True, related_name='questionDownVotes')
def vote(request):
question_id = int(request.POST.get('id'))
... | 32.035714 | 91 | 0.598662 | from flask import json, django
class Vote_Question(self.):
userUpVotes = self.votequestion('User', blank=True, related_name='questionUpVotes')
userDownVotes = self.votequestion('User', blank=True, related_name='questionDownVotes')
def vote(request):
question_id = int(request.POST.get('id'))
... | false | true |
f7595b8e5a3ea318eb3b8833520f9cf253529b19 | 2,011 | py | Python | test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_auto_rest_swagger_bat_array_service.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_auto_rest_swagger_bat_array_service.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_auto_rest_swagger_bat_array_service.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | # 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 may ... | 37.240741 | 94 | 0.664346 |
from typing import Any, Optional
from azure.core import AsyncPipelineClient
from msrest import Deserializer, Serializer
from ._configuration import AutoRestSwaggerBATArrayServiceConfiguration
from .operations import ArrayOperations
from .. import models
class AutoRestSwaggerBATArrayService(object):
def __init... | true | true |
f7595c7be39e8e7a3cc64df4cfbe5fb8699fab3f | 300 | py | Python | setup.py | sipolac/trending | 8155bcea5758a1b1cd7aa0c585658e754fe4c034 | [
"Apache-2.0"
] | null | null | null | setup.py | sipolac/trending | 8155bcea5758a1b1cd7aa0c585658e754fe4c034 | [
"Apache-2.0"
] | null | null | null | setup.py | sipolac/trending | 8155bcea5758a1b1cd7aa0c585658e754fe4c034 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='trending',
packages=find_packages(),
version='0.0.1',
description='Methods for determining trending-ness',
author='Chris Sipola',
license='Apache License 2.0',
install_requires=[],
include_package_data=True,
)
| 23.076923 | 56 | 0.696667 | from setuptools import find_packages, setup
setup(
name='trending',
packages=find_packages(),
version='0.0.1',
description='Methods for determining trending-ness',
author='Chris Sipola',
license='Apache License 2.0',
install_requires=[],
include_package_data=True,
)
| true | true |
f7595e00645d3938e634559c77d31e736515113c | 254 | py | Python | way/python/exercises/various/py_spec/logging/try_logging.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | way/python/exercises/various/py_spec/logging/try_logging.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | way/python/exercises/various/py_spec/logging/try_logging.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | # Logging hello world
import logging
logging.basicConfig(level=logging.INFO, filename='mylog.log')
logging.info('Starting program')
logging.info('Trying to divide 1 by 0')
print(1/0)
logging.info('The division succeeded')
logging.info('Ending program')
| 25.4 | 61 | 0.775591 | import logging
logging.basicConfig(level=logging.INFO, filename='mylog.log')
logging.info('Starting program')
logging.info('Trying to divide 1 by 0')
print(1/0)
logging.info('The division succeeded')
logging.info('Ending program')
| true | true |
f7595e283208a3c72d22c1fb4ad67499563ddad1 | 481 | py | Python | orderbook_veinte/orderbook/serializers/user_serializer.py | morwen1/hyperion | f0d77a6cce6a366555e9f0ca0080f3da134862bf | [
"MIT"
] | null | null | null | orderbook_veinte/orderbook/serializers/user_serializer.py | morwen1/hyperion | f0d77a6cce6a366555e9f0ca0080f3da134862bf | [
"MIT"
] | null | null | null | orderbook_veinte/orderbook/serializers/user_serializer.py | morwen1/hyperion | f0d77a6cce6a366555e9f0ca0080f3da134862bf | [
"MIT"
] | null | null | null |
#RESTFRAMEWORK
from rest_framework import serializers
#MODELS
from orderbook_veinte.orderbook.models import Orders , OrderStatus
class OrdersStatusSerializer(serializers.ModelSerializer):
class Meta:
model = OrderStatus
fields = ('status' ,)
class UserOrderSerializer(serializers.ModelSerializer... | 28.294118 | 67 | 0.717256 |
from rest_framework import serializers
from orderbook_veinte.orderbook.models import Orders , OrderStatus
class OrdersStatusSerializer(serializers.ModelSerializer):
class Meta:
model = OrderStatus
fields = ('status' ,)
class UserOrderSerializer(serializers.ModelSerializer):
status = OrdersS... | true | true |
f7595ee229ce8ee1171ddfe47615d9d1367e34c0 | 478 | py | Python | lib/models/v1/UserModel.py | cppxaxa/full_team_uno | dfd2418e736d04dd57a6a141a25fcd72392d7602 | [
"Apache-2.0"
] | null | null | null | lib/models/v1/UserModel.py | cppxaxa/full_team_uno | dfd2418e736d04dd57a6a141a25fcd72392d7602 | [
"Apache-2.0"
] | null | null | null | lib/models/v1/UserModel.py | cppxaxa/full_team_uno | dfd2418e736d04dd57a6a141a25fcd72392d7602 | [
"Apache-2.0"
] | null | null | null |
from pydantic import BaseModel
from typing import Optional
class UserModel(BaseModel):
username: Optional[str] = ""
passcode: Optional[str] = ""
def is_valid(self):
error = []
if len(self.username) == 0:
error.append("Username cannot be blank")
if len(self.passcode) =... | 23.9 | 52 | 0.573222 |
from pydantic import BaseModel
from typing import Optional
class UserModel(BaseModel):
username: Optional[str] = ""
passcode: Optional[str] = ""
def is_valid(self):
error = []
if len(self.username) == 0:
error.append("Username cannot be blank")
if len(self.passcode) =... | true | true |
f7595f52bcd7376ed4f59c22875b05f4f2d03d93 | 24,599 | py | Python | tests/unit/test_download.py | plocharz-9livesdata/pip | 75b504976343e6d7128cd8a5e8d8a40132012b80 | [
"MIT"
] | null | null | null | tests/unit/test_download.py | plocharz-9livesdata/pip | 75b504976343e6d7128cd8a5e8d8a40132012b80 | [
"MIT"
] | null | null | null | tests/unit/test_download.py | plocharz-9livesdata/pip | 75b504976343e6d7128cd8a5e8d8a40132012b80 | [
"MIT"
] | null | null | null | import functools
import hashlib
import os
import sys
from io import BytesIO
from shutil import copy, rmtree
from tempfile import mkdtemp
import pytest
from mock import Mock, patch
import pip
from pip._internal.download import (
CI_ENVIRONMENT_VARIABLES,
MultiDomainBasicAuth,
PipSession,
SafeFileCache,... | 32.667995 | 79 | 0.642546 | import functools
import hashlib
import os
import sys
from io import BytesIO
from shutil import copy, rmtree
from tempfile import mkdtemp
import pytest
from mock import Mock, patch
import pip
from pip._internal.download import (
CI_ENVIRONMENT_VARIABLES,
MultiDomainBasicAuth,
PipSession,
SafeFileCache,... | true | true |
f7595fd7c93aba216ac557f8ff3886f03736bd11 | 4,744 | py | Python | sisyphus/mdp/_dp.py | ndawlab/seqanx | de44aa1baeb10646d538c185f0428d53b00db4b5 | [
"MIT"
] | 14 | 2019-04-12T21:09:16.000Z | 2021-12-29T14:45:44.000Z | sisyphus/mdp/_dp.py | ndawlab/seqanx | de44aa1baeb10646d538c185f0428d53b00db4b5 | [
"MIT"
] | 1 | 2021-12-26T10:07:08.000Z | 2021-12-26T16:23:34.000Z | sisyphus/mdp/_dp.py | ndawlab/seqanx | de44aa1baeb10646d538c185f0428d53b00db4b5 | [
"MIT"
] | 1 | 2019-08-06T21:29:52.000Z | 2019-08-06T21:29:52.000Z | """Dynamic programming module"""
import numpy as np
from copy import deepcopy
from ._misc import check_params, softmax, pessimism
from warnings import warn
class ValueIteration(object):
"""Q-value iteration algorithm.
Parameters
----------
policy : max | min | softmax | pessimism (default = pessi... | 31.210526 | 104 | 0.517074 |
import numpy as np
from copy import deepcopy
from ._misc import check_params, softmax, pessimism
from warnings import warn
class ValueIteration(object):
def __init__(self, policy='pessimism', gamma=0.9, beta=10.0, w=1.0, tol=0.0001, max_iter=100):
self.policy = policy
if policy == 'm... | true | true |
f75960490c793ff9184817054080515739849018 | 136,840 | py | Python | airflow/www/views.py | haard/airflow | 5741ae177f3c2b14998596ef23bdbdf763c2ce06 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-10T03:37:28.000Z | 2021-03-10T03:37:28.000Z | airflow/www/views.py | haard/airflow | 5741ae177f3c2b14998596ef23bdbdf763c2ce06 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-02-21T15:12:02.000Z | 2021-02-21T15:12:02.000Z | airflow/www/views.py | yohei1126/airflow | b718495e4caecb753742c3eb22919411a715f24a | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 35.887752 | 110 | 0.602148 | import copy
import itertools
import json
import logging
import math
import socket
import sys
import traceback
from collections import defaultdict
from datetime import datetime, timedelta
from json import JSONDecodeError
from operator import itemgetter
from typing import Dict, List, Optional, Tuple
from urllib.parse imp... | true | true |
f7596055905d6fce15259812515796861be44ca7 | 849 | py | Python | court_scraper/platforms/oscn/pages/search.py | DiPierro/court-scraper | eb289e1559d317c04f1d92dacc96a49b9480e552 | [
"ISC"
] | null | null | null | court_scraper/platforms/oscn/pages/search.py | DiPierro/court-scraper | eb289e1559d317c04f1d92dacc96a49b9480e552 | [
"ISC"
] | null | null | null | court_scraper/platforms/oscn/pages/search.py | DiPierro/court-scraper | eb289e1559d317c04f1d92dacc96a49b9480e552 | [
"ISC"
] | null | null | null | import requests
from lxml import html
from fake_useragent import UserAgent
from io import StringIO, BytesIO
from court_scraper.base.last_date import LastDate
from court_scraper.base.requests_base_page import RequestsBasePage
from court_scraper.base.search_page_mixin import SearchPageMixIn
from .url import OklahomaURLs... | 35.375 | 116 | 0.678445 | import requests
from lxml import html
from fake_useragent import UserAgent
from io import StringIO, BytesIO
from court_scraper.base.last_date import LastDate
from court_scraper.base.requests_base_page import RequestsBasePage
from court_scraper.base.search_page_mixin import SearchPageMixIn
from .url import OklahomaURLs... | true | true |
f75960af512d213b94c2ed9d7f4324d0db902242 | 101,805 | py | Python | mindspore/python/mindspore/ops/operations/_grad_ops.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/ops/operations/_grad_ops.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/ops/operations/_grad_ops.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 44.052358 | 120 | 0.65155 |
import math
from functools import partial
from mindspore._checkparam import _check_3d_int_or_tuple
from .. import signature as sig
from ..primitive import Primitive, PrimitiveWithInfer, prim_attr_register
from ..._checkparam import Validator as validator, Rel
from .._utils import get_concat_offset
from ...common impor... | true | true |
f759611c7eb664804fadacab5b6ecb74ed334565 | 1,350 | py | Python | indico_toolkit/ocr/standard_object.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | 6 | 2021-05-20T16:48:27.000Z | 2022-03-15T15:43:40.000Z | indico_toolkit/ocr/standard_object.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | 25 | 2021-06-25T13:37:21.000Z | 2022-01-03T15:54:26.000Z | indico_toolkit/ocr/standard_object.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | null | null | null | from typing import List
class StandardOcr:
"""
StandardOcr is a helper class for the raw "standard" preset config OCR result. Enables easy extraction
of common datapoints into usable objects.
"""
def __init__(self, standardocr: dict):
"""
standardocr dict: standard result object f... | 26.470588 | 106 | 0.605926 | from typing import List
class StandardOcr:
def __init__(self, standardocr: dict):
self.standardocr = standardocr
@property
def full_text(self) -> str:
return self.standardocr["text"]
@property
def page_texts(self) -> List[str]:
return [page["text"] for page in self.stand... | true | true |
f75962fcaa2f37b823907a038ee87d94ba2afada | 702 | py | Python | Tree/Easy/530. Minimum Absolute Difference in BST/solution.py | tintindas/leetcode-solutions | eb97254dafddffccbce048ef04aea1e934277282 | [
"MIT"
] | 1 | 2021-03-10T02:48:39.000Z | 2021-03-10T02:48:39.000Z | Tree/Easy/530. Minimum Absolute Difference in BST/solution.py | tintindas/leetcode-solutions | eb97254dafddffccbce048ef04aea1e934277282 | [
"MIT"
] | null | null | null | Tree/Easy/530. Minimum Absolute Difference in BST/solution.py | tintindas/leetcode-solutions | eb97254dafddffccbce048ef04aea1e934277282 | [
"MIT"
] | 1 | 2021-03-18T08:22:29.000Z | 2021-03-18T08:22:29.000Z | # Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def inorder(self, node: TreeNode) -> None:
if not node:
return
self.inorder(node.left)
... | 21.9375 | 58 | 0.555556 | class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def inorder(self, node: TreeNode) -> None:
if not node:
return
self.inorder(node.left)
if self.prev != None:
... | true | true |
f75963c5f26c93041f8c5a62a6f00bb269a279da | 4,405 | py | Python | src/pfb/importers/tsv.py | gaurav/pypfb | 443bf607f499946525edbd41afa1edb81848a0f5 | [
"Apache-2.0"
] | 7 | 2019-10-08T16:22:24.000Z | 2022-03-01T20:44:17.000Z | src/pfb/importers/tsv.py | gaurav/pypfb | 443bf607f499946525edbd41afa1edb81848a0f5 | [
"Apache-2.0"
] | 10 | 2019-07-05T16:49:26.000Z | 2020-12-21T21:24:35.000Z | src/pfb/importers/tsv.py | gaurav/pypfb | 443bf607f499946525edbd41afa1edb81848a0f5 | [
"Apache-2.0"
] | 5 | 2019-12-23T17:02:50.000Z | 2022-01-04T17:45:10.000Z | from __future__ import absolute_import
import glob
import os
import csv
import click
from ..base import avro_record
from ..cli import from_command
from ..reader import PFBReader
@from_command.command("tsv", short_help="Convert TSV files into a PFB file.")
@click.argument("path", default=".", type=click.Path(exists... | 29.965986 | 88 | 0.572304 | from __future__ import absolute_import
import glob
import os
import csv
import click
from ..base import avro_record
from ..cli import from_command
from ..reader import PFBReader
@from_command.command("tsv", short_help="Convert TSV files into a PFB file.")
@click.argument("path", default=".", type=click.Path(exists... | true | true |
f7596415fd236efd9f25efe6dedd5f0c7f4a3556 | 6,438 | py | Python | condor_analyze_job_log.py | JoshKarpel/condor-analyze-job-log | 3c3cb4be9651aee61b233daa614f93e84bad172e | [
"Apache-2.0"
] | null | null | null | condor_analyze_job_log.py | JoshKarpel/condor-analyze-job-log | 3c3cb4be9651aee61b233daa614f93e84bad172e | [
"Apache-2.0"
] | null | null | null | condor_analyze_job_log.py | JoshKarpel/condor-analyze-job-log | 3c3cb4be9651aee61b233daa614f93e84bad172e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import itertools
import math
from pathlib import Path
import sys
import collections
import datetime
import enum
import shutil
import htcondor
import click
def get_events(event_log_path):
yield from htcondor.JobEventLog(Path(event_log_path).as_posix()).events(0)
class JobStatus(enum.IntEn... | 29.263636 | 147 | 0.650047 | import itertools
import math
from pathlib import Path
import sys
import collections
import datetime
import enum
import shutil
import htcondor
import click
def get_events(event_log_path):
yield from htcondor.JobEventLog(Path(event_log_path).as_posix()).events(0)
class JobStatus(enum.IntEnum):
UNKNOWN = 0
... | true | true |
f7596489e719ab0e73bd69cf4e5e632c3d236eec | 3,075 | py | Python | ucsmsdk/mometa/storage/StorageScsiLunRef.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/storage/StorageScsiLunRef.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/storage/StorageScsiLunRef.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for StorageScsiLunRef ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class StorageScsiLunRefConsts:
ID_UNSPECIFIED = "unspecified"
class StorageScsiLunRef(ManagedObject):
... | 53.017241 | 248 | 0.638699 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class StorageScsiLunRefConsts:
ID_UNSPECIFIED = "unspecified"
class StorageScsiLunRef(ManagedObject):
consts = StorageScsiLunRefConsts()
naming_props = set([u'id'])
mo_meta = Mo... | true | true |
f7596570d2b4f33751eac22da3e3c2520d00492b | 690 | py | Python | praktiplot.py | phenomax/praktipy | 58d1f74e6d128b0d22bfa0fcaf754c9b8b9e8c23 | [
"MIT"
] | null | null | null | praktiplot.py | phenomax/praktipy | 58d1f74e6d128b0d22bfa0fcaf754c9b8b9e8c23 | [
"MIT"
] | null | null | null | praktiplot.py | phenomax/praktipy | 58d1f74e6d128b0d22bfa0fcaf754c9b8b9e8c23 | [
"MIT"
] | null | null | null | # Setting matplotlib layout to match tex settings
import matplotlib
matplotlib.use('pgf')
import matplotlib.pyplot as plt
from os.path import dirname, abspath
import locale
matplotlib.rcParams.update({
'font.family': 'serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
... | 32.857143 | 110 | 0.708696 |
import matplotlib
matplotlib.use('pgf')
import matplotlib.pyplot as plt
from os.path import dirname, abspath
import locale
matplotlib.rcParams.update({
'font.family': 'serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
'pgf.preamble': r'\input{'+dirname(abspath(__file__... | true | true |
f75965ade8d9f301559fb6239ab458b22daa2b2d | 1,022 | py | Python | h2o-py/tests/testdir_algos/glm/pyunit_mojo_reproducibility_info_glm.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_algos/glm/pyunit_mojo_reproducibility_info_glm.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_algos/glm/pyunit_mojo_reproducibility_info_glm.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | import sys
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
import tempfile
def glm_mojo_reproducibility_info():
params = {'family':"fractionalbinomial", 'alpha':[0], 'lambda_':[0],
'standardize':False, "compute_p_values":True}
train = h2o.import_file(pyunit_utils.locate... | 39.307692 | 128 | 0.731898 | import sys
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
import tempfile
def glm_mojo_reproducibility_info():
params = {'family':"fractionalbinomial", 'alpha':[0], 'lambda_':[0],
'standardize':False, "compute_p_values":True}
train = h2o.import_file(pyunit_utils.locate... | true | true |
f75965c57a95d13e112a54f79ffd97fb1f84d829 | 4,138 | py | Python | coursework_project_dec_2021/covid_data_handler.py | reubensgithub/covid-19-dashboard | f0d8de85a989597fe38ea771439a70fc9e0bd21f | [
"MIT"
] | null | null | null | coursework_project_dec_2021/covid_data_handler.py | reubensgithub/covid-19-dashboard | f0d8de85a989597fe38ea771439a70fc9e0bd21f | [
"MIT"
] | null | null | null | coursework_project_dec_2021/covid_data_handler.py | reubensgithub/covid-19-dashboard | f0d8de85a989597fe38ea771439a70fc9e0bd21f | [
"MIT"
] | null | null | null | """This module has various functions inside it that will allow
the processing and handling of covid data, whether from a
CSV file or returned from an API"""
import sched
import time
import logging
import pandas as pd
from typing import List
from uk_covid19 import Cov19API
logging.basicConfig(filename... | 39.788462 | 101 | 0.693088 | import sched
import time
import logging
import pandas as pd
from typing import List
from uk_covid19 import Cov19API
logging.basicConfig(filename='covid_log.log', level=logging.DEBUG,
format='%(levelname)s: %(asctime)s %(message)s')
data_list_exeter = []
data_list_england = []
def p... | true | true |
f759663b69cab4c301c6e32771db73c9020783c7 | 5,063 | py | Python | aiokubernetes/models/v1beta1_ingress_rule.py | tantioch/aiokubernetes | 2f332498598ece14d22f8e59ecb02665db6db68d | [
"Apache-2.0"
] | 24 | 2018-07-07T15:12:19.000Z | 2021-09-01T07:33:11.000Z | aiokubernetes/models/v1beta1_ingress_rule.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 5 | 2018-07-11T00:09:17.000Z | 2018-10-22T16:41:54.000Z | aiokubernetes/models/v1beta1_ingress_rule.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 3 | 2018-07-10T10:16:57.000Z | 2018-10-20T19:32:05.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
from aio... | 35.65493 | 676 | 0.620581 |
import pprint
import re
from aiokubernetes.models.v1beta1_http_ingress_rule_value import V1beta1HTTPIngressRuleValue
class V1beta1IngressRule(object):
swagger_types = {
'host': 'str',
'http': 'V1beta1HTTPIngressRuleValue'
}
attribute_map = {
'host': 'host',
'http':... | true | true |
f759665887c9f3ff070bed663bb3c71f8a611a07 | 20,641 | py | Python | pymc3/distributions/discrete.py | vpolisky/pymc3 | 87cdd712c86321121c2ed3150764f3d847f5083c | [
"Apache-2.0"
] | null | null | null | pymc3/distributions/discrete.py | vpolisky/pymc3 | 87cdd712c86321121c2ed3150764f3d847f5083c | [
"Apache-2.0"
] | null | null | null | pymc3/distributions/discrete.py | vpolisky/pymc3 | 87cdd712c86321121c2ed3150764f3d847f5083c | [
"Apache-2.0"
] | 1 | 2021-04-13T10:31:26.000Z | 2021-04-13T10:31:26.000Z | from functools import partial
import numpy as np
import theano
import theano.tensor as tt
from scipy import stats
from .dist_math import bound, factln, binomln, betaln, logpow
from .distribution import Discrete, draw_values, generate_samples, reshape_sampled
__all__ = ['Binomial', 'BetaBinomial', 'Bernoulli', 'Di... | 33.727124 | 174 | 0.519016 | from functools import partial
import numpy as np
import theano
import theano.tensor as tt
from scipy import stats
from .dist_math import bound, factln, binomln, betaln, logpow
from .distribution import Discrete, draw_values, generate_samples, reshape_sampled
__all__ = ['Binomial', 'BetaBinomial', 'Bernoulli', 'Di... | true | true |
f75966831befe213be0e6082f1fd78c2b908ae1b | 53,615 | py | Python | release/scripts/addons_contrib/np_station/np_point_copy.py | simileV/blenderStereo29 | 09b993449aaca671a9eb2a6a22327246936eb3db | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-07-20T15:41:58.000Z | 2020-07-20T15:41:58.000Z | release/scripts/addons_contrib/np_station/np_point_copy.py | ringsce/Rings3D | 8059d1e2460fc8d6f101eff8e695f68a99f6671d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons_contrib/np_station/np_point_copy.py | ringsce/Rings3D | 8059d1e2460fc8d6f101eff8e695f68a99f6671d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distr... | 41.305855 | 1,168 | 0.606024 |
bl_info = {
'name':'NP 020 Point Copy',
'author':'Okavango & the Blenderartists community',
'version': (0, 2, 0),
'blender': (2, 75, 0),
'location': 'View3D',
'warning': '',
'description': 'Duplicates selected objects using "take" and "place" snap points',
'doc_url': '',
'categor... | true | true |
f75967b0b19dc869b0565f3b3261306a5e9c9f91 | 1,529 | py | Python | pxr/usd/usd/testenv/testUsdBug119633.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 3,680 | 2016-07-26T18:28:11.000Z | 2022-03-31T09:55:05.000Z | pxr/usd/usd/testenv/testUsdBug119633.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 1,759 | 2016-07-26T19:19:59.000Z | 2022-03-31T21:24:00.000Z | pxr/usd/usd/testenv/testUsdBug119633.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 904 | 2016-07-26T18:33:40.000Z | 2022-03-31T09:55:16.000Z | #!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 34.75 | 74 | 0.732505 |
from __future__ import print_function
from pxr import Sdf, Tf, Usd
def TestBug119633():
layerFile = 'root.usda'
try:
stage = Usd.Stage.Open(layerFile)
assert stage, 'failed to create stage for %s' % layerFile
prim = stage.GetPrimAtPath('/SardineGroup_OceanA')
assert prim, 'fa... | true | true |
f75967fc905f9fa4c61167038dcef74f9cde1f7e | 9,411 | py | Python | Preference2/src/main/java/voidblue/preference/demo/Preference/MergeAnsemble.py | voidblue/PreferenceWebPage | 7b36a6b0df09b84aa46fb63f9b191c84b46509d6 | [
"Apache-2.0"
] | null | null | null | Preference2/src/main/java/voidblue/preference/demo/Preference/MergeAnsemble.py | voidblue/PreferenceWebPage | 7b36a6b0df09b84aa46fb63f9b191c84b46509d6 | [
"Apache-2.0"
] | null | null | null | Preference2/src/main/java/voidblue/preference/demo/Preference/MergeAnsemble.py | voidblue/PreferenceWebPage | 7b36a6b0df09b84aa46fb63f9b191c84b46509d6 | [
"Apache-2.0"
] | null | null | null | import openpyxl
import preprocess
from DBGetter import DBGetter
from LoadData import LoadData
from Preference import Pref
place = {1:"한라산@@@자연-숲", 2:"오름@@@자연-숲", 3: "성산일출봉@@@자연-숲", 4 : "섬(우도/마라도 등)@@@자연명소",
5:"올레길@@@기타", 6: "폭포(정방폭포 등)@@@자연명소", 7: "동굴(만장굴 등)@@@자연명소", 8: "해수욕장@@@자연명소",
9:"비자림@@@자연-숲"... | 32.790941 | 120 | 0.532568 | import openpyxl
import preprocess
from DBGetter import DBGetter
from LoadData import LoadData
from Preference import Pref
place = {1:"한라산@@@자연-숲", 2:"오름@@@자연-숲", 3: "성산일출봉@@@자연-숲", 4 : "섬(우도/마라도 등)@@@자연명소",
5:"올레길@@@기타", 6: "폭포(정방폭포 등)@@@자연명소", 7: "동굴(만장굴 등)@@@자연명소", 8: "해수욕장@@@자연명소",
9:"비자림@@@자연-숲"... | true | true |
f759680100a459bb4b9ab1b2acf08b879d73b036 | 924 | py | Python | simple_demo.py | zwx8981/DBCNN-Pytorch | 16c3156054a30a3eabb45dffcf538f42452a14f3 | [
"MIT"
] | 150 | 2019-01-24T10:32:49.000Z | 2022-03-10T10:08:23.000Z | simple_demo.py | lllllllllllll-llll/DBCNN-PyTorch | fa29f0307aa4533c4025c688ba5301cfddf9812f | [
"MIT"
] | 29 | 2019-03-06T06:54:53.000Z | 2022-03-29T12:00:41.000Z | simple_demo.py | lllllllllllll-llll/DBCNN-PyTorch | fa29f0307aa4533c4025c688ba5301cfddf9812f | [
"MIT"
] | 31 | 2019-03-10T08:29:30.000Z | 2022-03-05T06:58:25.000Z | import torch
import torch.nn as nn
from torchvision import transforms
from DBCNN import DBCNN
from PIL import Image
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
test_transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=(0.485, 0.456, 0.406),
... | 21.488372 | 73 | 0.690476 | import torch
import torch.nn as nn
from torchvision import transforms
from DBCNN import DBCNN
from PIL import Image
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
test_transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=(0.485, 0.456, 0.406),
... | true | true |
f75968317e392c13ae034cbf31f9db18911c4778 | 1,035 | py | Python | tests/test_controls/test_valloxcontrol.py | jussike/kuappi | 985040dc813c023dc1577f31ca7f6744d42c91de | [
"MIT"
] | null | null | null | tests/test_controls/test_valloxcontrol.py | jussike/kuappi | 985040dc813c023dc1577f31ca7f6744d42c91de | [
"MIT"
] | null | null | null | tests/test_controls/test_valloxcontrol.py | jussike/kuappi | 985040dc813c023dc1577f31ca7f6744d42c91de | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
with patch('serial.Serial'):
from controls.valloxcontrol import ValloxControl
from valloxserial import vallox_serial
class TestValloxControl(TestCase):
@patch('serial.Serial')
def setUp(self, _):
self.vc = ValloxControl()
@patch.o... | 29.571429 | 66 | 0.66087 | from unittest import TestCase
from unittest.mock import patch
with patch('serial.Serial'):
from controls.valloxcontrol import ValloxControl
from valloxserial import vallox_serial
class TestValloxControl(TestCase):
@patch('serial.Serial')
def setUp(self, _):
self.vc = ValloxControl()
@patch.o... | true | true |
f75968bd86296466d947e2ad0a811abf6895a0cc | 2,376 | py | Python | api/preprint_providers/serializers.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | api/preprint_providers/serializers.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | api/preprint_providers/serializers.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | from rest_framework import serializers as ser
from api.base.utils import absolute_reverse
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class PreprintProviderSerializer(JSONAPISerializer):
filterable_fields = frozenset([
'name',
'description',
'id'
... | 35.462687 | 82 | 0.708754 | from rest_framework import serializers as ser
from api.base.utils import absolute_reverse
from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField
class PreprintProviderSerializer(JSONAPISerializer):
filterable_fields = frozenset([
'name',
'description',
'id'
... | true | true |
f759697e36c0f99e080de0acff82491eb0f1e209 | 978 | py | Python | models/loss/dice_loss.py | JennyVanessa/PANet-Paddle | 82e037faf4d52e374bd4f42c78396924c23c02f9 | [
"Apache-2.0"
] | 4 | 2021-05-13T15:24:53.000Z | 2022-03-04T06:05:20.000Z | models/loss/dice_loss.py | JosephBless/Paddle-PANet | 946e247af42ba68760d37cd9644b543fe5096288 | [
"Apache-2.0"
] | 1 | 2021-12-27T11:42:19.000Z | 2021-12-27T11:42:19.000Z | models/loss/dice_loss.py | JosephBless/Paddle-PANet | 946e247af42ba68760d37cd9644b543fe5096288 | [
"Apache-2.0"
] | null | null | null | import paddle
import paddle.nn as nn
class DiceLoss(nn.Layer):
def __init__(self, loss_weight=1.0):
super(DiceLoss, self).__init__()
self.loss_weight = loss_weight
def forward(self, input, target, mask, reduce=True):
batch_size = input.shape[0]
input = nn.functional.sigmoid(in... | 25.076923 | 57 | 0.572597 | import paddle
import paddle.nn as nn
class DiceLoss(nn.Layer):
def __init__(self, loss_weight=1.0):
super(DiceLoss, self).__init__()
self.loss_weight = loss_weight
def forward(self, input, target, mask, reduce=True):
batch_size = input.shape[0]
input = nn.functional.sigmoid(in... | true | true |
f75969874e1c906a940e5dceb288bf1301d124bf | 1,358 | py | Python | baseline.py | CVxTz/keras_model_aws_ec2 | 92a19f1c065ba7b19c0cd4e75b30f2935a7efacb | [
"MIT"
] | 1 | 2019-11-26T13:42:27.000Z | 2019-11-26T13:42:27.000Z | baseline.py | CVxTz/keras_model_aws_ec2 | 92a19f1c065ba7b19c0cd4e75b30f2935a7efacb | [
"MIT"
] | 8 | 2020-09-25T20:38:03.000Z | 2022-03-12T00:06:00.000Z | baseline.py | CVxTz/keras_model_aws_ec2 | 92a19f1c065ba7b19c0cd4e75b30f2935a7efacb | [
"MIT"
] | null | null | null | from glob import glob
import pandas as pd
import numpy as np # linear algebra
from tensorflow.keras.applications.imagenet_utils import preprocess_input
from tensorflow.keras.callbacks import ModelCheckpoint
from sklearn.model_selection import train_test_split
from models import get_model_classif_nasnet
from utils im... | 29.521739 | 100 | 0.75405 | from glob import glob
import pandas as pd
import numpy as np from tensorflow.keras.applications.imagenet_utils import preprocess_input
from tensorflow.keras.callbacks import ModelCheckpoint
from sklearn.model_selection import train_test_split
from models import get_model_classif_nasnet
from utils import data_gen, ch... | true | true |
f7596ada545c821b37069fbdb022f5df997cc80b | 9,104 | py | Python | tripleo_ansible/ansible_plugins/modules/tripleo_get_dpdk_nics_numa_info.py | openstack/tripleo-ansible | f6630e94326a494ed051b0ca1eca49625fa542d9 | [
"Apache-2.0"
] | 22 | 2018-08-29T12:33:15.000Z | 2022-03-30T00:17:25.000Z | tripleo_ansible/ansible_plugins/modules/tripleo_get_dpdk_nics_numa_info.py | openstack/tripleo-ansible | f6630e94326a494ed051b0ca1eca49625fa542d9 | [
"Apache-2.0"
] | 1 | 2020-02-07T20:54:34.000Z | 2020-02-07T20:54:34.000Z | tripleo_ansible/ansible_plugins/modules/tripleo_get_dpdk_nics_numa_info.py | openstack/tripleo-ansible | f6630e94326a494ed051b0ca1eca49625fa542d9 | [
"Apache-2.0"
] | 19 | 2019-07-16T04:42:00.000Z | 2022-03-30T00:17:29.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2020 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | 32.398577 | 107 | 0.630931 | __metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils import tripleo_common_utils as tc
except ImportError:
from tripleo_ansible.ansible_plugins.module_utils import tripleo_common_utils as tc
from ansible_collections.openstack.cloud.plugins.module_utils.openst... | true | true |
f7596b16f8764c2d2a0905bee2a446941293945e | 1,900 | py | Python | torch_points_kernels/chamfer_dist.py | hzxie/torch-points-kernels | a52ea03bdd62e890320c592282ebd89de659534f | [
"MIT"
] | 1 | 2021-01-09T14:04:29.000Z | 2021-01-09T14:04:29.000Z | torch_points_kernels/chamfer_dist.py | hzxie/torch-points-kernels | a52ea03bdd62e890320c592282ebd89de659534f | [
"MIT"
] | null | null | null | torch_points_kernels/chamfer_dist.py | hzxie/torch-points-kernels | a52ea03bdd62e890320c592282ebd89de659534f | [
"MIT"
] | null | null | null | import torch
if torch.cuda.is_available():
import torch_points_kernels.points_cuda as tpcuda
class ChamferFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, xyz1, xyz2):
if not torch.cuda.is_available():
raise NotImplementedError(
"CPU version is not ava... | 31.666667 | 94 | 0.637895 | import torch
if torch.cuda.is_available():
import torch_points_kernels.points_cuda as tpcuda
class ChamferFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, xyz1, xyz2):
if not torch.cuda.is_available():
raise NotImplementedError(
"CPU version is not ava... | true | true |
f7596cd8f91fd35f2d62df4c4f888750b37429b3 | 6,511 | py | Python | data/external/repositories/115375/hail-seizure-master/python/rfe_chain.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/115375/hail-seizure-master/python/rfe_chain.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2015-12-10T16:46:02.000Z | 2018-05-21T23:01:55.000Z | python/rfe_chain.py | Neuroglycerin/hail-seizure | 5f66bffd87849270457054b897201f11e8c7ab70 | [
"Apache-2.0"
] | 1 | 2018-04-11T15:20:02.000Z | 2018-04-11T15:20:02.000Z |
import json
import train
import random
import os
from generatebatchsettings import *
import numpy as np
import copy
import hashlib
import glob
import sys
import optparse
import utils
def main(run_dir="rfe_chain", start=None, start_auc=None,
verbose=None, logfile=None):
"""
Main function to run the ... | 33.389744 | 90 | 0.521272 |
import json
import train
import random
import os
from generatebatchsettings import *
import numpy as np
import copy
import hashlib
import glob
import sys
import optparse
import utils
def main(run_dir="rfe_chain", start=None, start_auc=None,
verbose=None, logfile=None):
if logfile is not None:
s... | true | true |
f7596d66f744d9f411fd4324c435b1e2f921b049 | 25,638 | py | Python | tests/unittests/test_operations_submit.py | pyoseo/oseoserver | 8c97ee5a7d698cc989e1c8cab8cfe0db78491307 | [
"Apache-2.0"
] | null | null | null | tests/unittests/test_operations_submit.py | pyoseo/oseoserver | 8c97ee5a7d698cc989e1c8cab8cfe0db78491307 | [
"Apache-2.0"
] | 10 | 2015-02-10T17:10:33.000Z | 2018-04-05T10:05:01.000Z | tests/unittests/test_operations_submit.py | pyoseo/oseoserver | 8c97ee5a7d698cc989e1c8cab8cfe0db78491307 | [
"Apache-2.0"
] | null | null | null | """Unit tests for oseoserver.operations.submit"""
from lxml import etree
import mock
import pytest
from pyxb import BIND
from pyxb.bundles.opengis import oseo_1_0 as oseo
from oseoserver import errors
from oseoserver.operations import submit
from oseoserver import models
from oseoserver.models import Order
from oseos... | 37.537335 | 79 | 0.667603 |
from lxml import etree
import mock
import pytest
from pyxb import BIND
from pyxb.bundles.opengis import oseo_1_0 as oseo
from oseoserver import errors
from oseoserver.operations import submit
from oseoserver import models
from oseoserver.models import Order
from oseoserver.models import CustomizableItem
from oseoserv... | true | true |
f7596def9308a50255f1e0880592426d621bf7d5 | 929 | py | Python | setup.py | lizeqing/requests_httpsproxy | 7edf20df7853003d24d66a5b45a307106187fc76 | [
"MIT"
] | null | null | null | setup.py | lizeqing/requests_httpsproxy | 7edf20df7853003d24d66a5b45a307106187fc76 | [
"MIT"
] | null | null | null | setup.py | lizeqing/requests_httpsproxy | 7edf20df7853003d24d66a5b45a307106187fc76 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='requests_httpsproxy',
version='1.0.6',
description='allow http/https requests through https proxy',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 4 - Beta',
'License ::... | 28.151515 | 64 | 0.615716 |
from setuptools import setup, find_packages
setup(
name='requests_httpsproxy',
version='1.0.6',
description='allow http/https requests through https proxy',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT L... | true | true |
f7596ee23c68f7c668b47f5d744f194bd20a9976 | 2,205 | py | Python | backend/fitlive_31937/urls.py | crowdbotics-apps/fitlive-31937 | 8c614d6a1a7f176a2d98f5bb79b1156e83044d6d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/fitlive_31937/urls.py | crowdbotics-apps/fitlive-31937 | 8c614d6a1a7f176a2d98f5bb79b1156e83044d6d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/fitlive_31937/urls.py | crowdbotics-apps/fitlive-31937 | 8c614d6a1a7f176a2d98f5bb79b1156e83044d6d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """fitlive_31937 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 35 | 87 | 0.711565 |
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from allauth.account.views import confirm_email
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
urlpatterns = [
path("",... | true | true |
f7596f00f2f965c994e2663ec34855f878595bc1 | 3,490 | py | Python | services/models.py | squirrelmaker/explorer | e7acc7012c341728c1b6894f6b0a077105f6feec | [
"Apache-2.0"
] | 917 | 2015-01-08T03:37:42.000Z | 2022-03-31T13:42:56.000Z | services/models.py | vechitech/explorer | 6eedc672738126d066c6f8d73a380d3af364eeb9 | [
"Apache-2.0"
] | 268 | 2015-01-08T07:40:12.000Z | 2022-01-13T11:12:20.000Z | services/models.py | vechitech/explorer | 6eedc672738126d066c6f8d73a380d3af364eeb9 | [
"Apache-2.0"
] | 662 | 2015-01-15T00:43:24.000Z | 2022-03-24T06:40:18.000Z | from django.db import models
from blockexplorer.raven import client
from jsonfield import JSONField
from utils import get_client_ip, uri_to_url, is_good_status_code, get_user_agent
import json
import requests
class APICall(models.Model):
"""
To keep track of all our external API calls and aid in debugging... | 37.934783 | 126 | 0.690831 | from django.db import models
from blockexplorer.raven import client
from jsonfield import JSONField
from utils import get_client_ip, uri_to_url, is_good_status_code, get_user_agent
import json
import requests
class APICall(models.Model):
API_NAME_CHOICES = ()
created_at = models.DateTimeField(auto_n... | true | true |
f7596f75f431c85d100fed54c64e77e8ef120b68 | 34,044 | py | Python | tests/gcp/operators/test_cloud_storage_transfer_service.py | robobario/airflow | 702005fe35dc5b996a5c5b8d349ed36036472f00 | [
"Apache-2.0"
] | 1 | 2021-09-16T17:20:00.000Z | 2021-09-16T17:20:00.000Z | tests/gcp/operators/test_cloud_storage_transfer_service.py | robobario/airflow | 702005fe35dc5b996a5c5b8d349ed36036472f00 | [
"Apache-2.0"
] | 20 | 2017-04-18T19:47:46.000Z | 2020-01-13T04:19:24.000Z | tests/gcp/operators/test_cloud_storage_transfer_service.py | robobario/airflow | 702005fe35dc5b996a5c5b8d349ed36036472f00 | [
"Apache-2.0"
] | 2 | 2018-09-15T07:13:01.000Z | 2021-03-26T07:27:38.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 45.574297 | 110 | 0.716778 | import itertools
import unittest
from copy import deepcopy
from datetime import date, time
from typing import Dict
from botocore.credentials import Credentials
from freezegun import freeze_time
from parameterized import parameterized
from airflow import AirflowException
from airflow.gcp.hooks.cloud_storage_transfer_s... | true | true |
f7597050528d172aef0c4901b7ccca34175864f1 | 4,865 | py | Python | mys/pygments/pygments/formatters/terminal.py | eerimoq/sython | 90937bf44b798b9c1ae0d18e31e11e95967b46c6 | [
"MIT"
] | 83 | 2020-08-18T18:48:46.000Z | 2021-01-01T17:00:45.000Z | mys/pygments/pygments/formatters/terminal.py | eerimoq/sython | 90937bf44b798b9c1ae0d18e31e11e95967b46c6 | [
"MIT"
] | 31 | 2021-01-05T00:32:36.000Z | 2022-02-23T13:34:33.000Z | mys/pygments/pygments/formatters/terminal.py | eerimoq/sython | 90937bf44b798b9c1ae0d18e31e11e95967b46c6 | [
"MIT"
] | 7 | 2021-01-03T11:53:03.000Z | 2022-02-22T17:49:42.000Z | """
pygments.formatters.terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for terminal output with ANSI sequences.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.console import ansiformat
from pygments.formatt... | 35.510949 | 84 | 0.580267 |
import sys
from pygments.console import ansiformat
from pygments.formatter import Formatter
from pygments.token import Comment
from pygments.token import Error
from pygments.token import Generic
from pygments.token import Keyword
from pygments.token import Name
from pygments.token import Number
from pygments.token im... | true | true |
f75970d5f8a6a45e3797219e5bf4746e46623d84 | 48,692 | py | Python | text2speech/modules/__init__.py | HelloChatterbox/text2speech | 809cdc02730ef6433fa42c460ff9b2fd43d0d7fd | [
"Apache-2.0"
] | 2 | 2020-09-17T21:33:57.000Z | 2021-01-02T20:42:31.000Z | text2speech/modules/__init__.py | HelloChatterbox/text2speech | 809cdc02730ef6433fa42c460ff9b2fd43d0d7fd | [
"Apache-2.0"
] | 2 | 2021-01-11T18:50:11.000Z | 2021-06-08T20:19:14.000Z | text2speech/modules/__init__.py | HelloChatterbox/text2speech | 809cdc02730ef6433fa42c460ff9b2fd43d0d7fd | [
"Apache-2.0"
] | 5 | 2020-08-11T17:11:53.000Z | 2021-08-28T19:00:34.000Z | import subprocess
from os.path import isfile
import hashlib
import os
import random
import re
from tempfile import gettempdir
import os.path
from requests_futures.sessions import FuturesSession
from os.path import dirname, exists, isdir, join
from text2speech.util import get_cache_directory, remove_last_slash
from ovos... | 37.658159 | 462 | 0.59174 | import subprocess
from os.path import isfile
import hashlib
import os
import random
import re
from tempfile import gettempdir
import os.path
from requests_futures.sessions import FuturesSession
from os.path import dirname, exists, isdir, join
from text2speech.util import get_cache_directory, remove_last_slash
from ovos... | true | true |
f75971a39efd1bef3d8f504b1a8a0396d9bba5f3 | 673 | py | Python | test/storage_service_test.py | zaman-lab/brexitmeter-py | a1ea66d7d747276679f8f4acdb2c2963517a0f04 | [
"MIT"
] | 1 | 2019-10-03T19:47:31.000Z | 2019-10-03T19:47:31.000Z | test/storage_service_test.py | zaman-lab/trumpmeter-py | f4e28971d65224bd0dd93171aa9288f743714738 | [
"MIT"
] | 5 | 2019-10-22T16:08:10.000Z | 2019-11-22T23:00:13.000Z | test/storage_service_test.py | zaman-lab/brexitmeter-py | a1ea66d7d747276679f8f4acdb2c2963517a0f04 | [
"MIT"
] | 3 | 2019-10-15T05:08:10.000Z | 2019-11-05T01:04:45.000Z |
import os
import tensorflow as tf
from app.storage_service import weights_filepath, dictionaries_dirpath
def test_local_storage():
local_filepaths = [
weights_filepath("local"),
os.path.join(dictionaries_dirpath("local"), "dic.txt"),
os.path.join(dictionaries_dirpath("local"), "dic_s.txt"),
]
for file... | 28.041667 | 70 | 0.729569 |
import os
import tensorflow as tf
from app.storage_service import weights_filepath, dictionaries_dirpath
def test_local_storage():
local_filepaths = [
weights_filepath("local"),
os.path.join(dictionaries_dirpath("local"), "dic.txt"),
os.path.join(dictionaries_dirpath("local"), "dic_s.txt"),
]
for file... | true | true |
f75975fe74da00ddb8be75304cc087653377ccf4 | 589 | py | Python | tests/test_base.py | revsys/nodels | a5450da66002bc055732e0ac708c3598e99b0610 | [
"BSD-3-Clause"
] | null | null | null | tests/test_base.py | revsys/nodels | a5450da66002bc055732e0ac708c3598e99b0610 | [
"BSD-3-Clause"
] | 1 | 2019-05-31T20:58:23.000Z | 2019-05-31T20:58:23.000Z | tests/test_base.py | revsys/nodels | a5450da66002bc055732e0ac708c3598e99b0610 | [
"BSD-3-Clause"
] | 1 | 2020-11-24T10:11:10.000Z | 2020-11-24T10:11:10.000Z | import pytest
from nodels.base import BaseGather
def test_to_dict():
b = BaseGather()
assert b.to_dict() == {}
b2 = BaseGather(data={"foo": "bar"})
assert b2.to_dict() == {"foo": "bar"}
def test_json():
b = BaseGather()
assert b.json() == "{}"
b2 = BaseGather(data={"foo": "bar"})
... | 18.40625 | 44 | 0.594228 | import pytest
from nodels.base import BaseGather
def test_to_dict():
b = BaseGather()
assert b.to_dict() == {}
b2 = BaseGather(data={"foo": "bar"})
assert b2.to_dict() == {"foo": "bar"}
def test_json():
b = BaseGather()
assert b.json() == "{}"
b2 = BaseGather(data={"foo": "bar"})
... | true | true |
f75976453d081d779c98b2ca55ebd376fdd719c4 | 733 | py | Python | api/meme_generator/image_watermark.py | InFact-coop/create-refresh | 0ef01de93fa325c9146e3f407e902ef359cac488 | [
"MIT"
] | null | null | null | api/meme_generator/image_watermark.py | InFact-coop/create-refresh | 0ef01de93fa325c9146e3f407e902ef359cac488 | [
"MIT"
] | 84 | 2018-12-14T11:20:57.000Z | 2022-03-11T23:36:31.000Z | api/meme_generator/image_watermark.py | InFact-coop/create-refresh | 0ef01de93fa325c9146e3f407e902ef359cac488 | [
"MIT"
] | null | null | null | from PIL import Image
from pathlib import Path
def add_watermark(input_path, watermark_path, output_path):
"""Add EU-compliant meme watermark to a supplied image"""
try:
original_image = Image.open(input_path)
_w, h = original_image.size
size = int(round(h * 0.4))
watermark_ima... | 33.318182 | 74 | 0.653479 | from PIL import Image
from pathlib import Path
def add_watermark(input_path, watermark_path, output_path):
try:
original_image = Image.open(input_path)
_w, h = original_image.size
size = int(round(h * 0.4))
watermark_image = Image.open(watermark_path)
watermark_image.thumbn... | true | true |
f759773bff22215f99aeb7cd4c02e4f0c313be51 | 3,446 | py | Python | var/spack/repos/builtin/packages/podman/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/podman/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/podman/package.py | flatironinstitute/spack | 71a7b1b5fadbe16bcdb36fb679aa828cd7d83b02 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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 Podman(Package):
"""An optionally rootless and daemonless container engine: alias docker=p... | 42.02439 | 95 | 0.624782 |
from spack import *
class Podman(Package):
homepage = 'https://podman.io'
url = 'https://github.com/containers/podman/archive/v3.4.2.tar.gz'
maintainers = ['bernhardkaindl']
version('3.4.2', sha256='b0c4f9a11eb500b1d440d5e51a6c0c632aa4ac458e2dc0362f50f999eb7fbf31')
depends_on('go', ... | true | true |
f75977dda975fc98a7076b3e01d961e0af829e96 | 2,694 | py | Python | screens/models.py | mrommel/SmartVision | 5ddd36b111678a63de42161b67d6f4362e928a94 | [
"MIT"
] | null | null | null | screens/models.py | mrommel/SmartVision | 5ddd36b111678a63de42161b67d6f4362e928a94 | [
"MIT"
] | null | null | null | screens/models.py | mrommel/SmartVision | 5ddd36b111678a63de42161b67d6f4362e928a94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from colorfield.fields import ColorField
class Project(models.Model):
name = models.CharField(max_length=50)
image = models.FileField(upload_to='projects/', null=True, blank=True)
def layouts(self):
return Layout.obje... | 25.17757 | 86 | 0.724944 | from __future__ import unicode_literals
from django.db import models
from colorfield.fields import ColorField
class Project(models.Model):
name = models.CharField(max_length=50)
image = models.FileField(upload_to='projects/', null=True, blank=True)
def layouts(self):
return Layout.objects.filter(project=self)... | true | true |
f7597803f037aa4234309e0a904dada711ba59a5 | 5,452 | py | Python | helper_db/databaseMysql/setupDatabase.py | singhst/web-scraping-tv-movie | 1942cad5f631424dccc4a0c89fc346497ce9854d | [
"MIT"
] | null | null | null | helper_db/databaseMysql/setupDatabase.py | singhst/web-scraping-tv-movie | 1942cad5f631424dccc4a0c89fc346497ce9854d | [
"MIT"
] | 1 | 2021-06-26T17:57:02.000Z | 2021-08-15T09:58:00.000Z | helper_db/databaseMysql/setupDatabase.py | singhst/web-scraping-tv-movie | 1942cad5f631424dccc4a0c89fc346497ce9854d | [
"MIT"
] | null | null | null | """
Make connection to MySQL server and gets all config parameters.
######################
Error code handling example,
=> https://dev.mysql.com/doc/connector-python/en/connector-python-api-errors-error.html
MySQL error code,
=> https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html
"""
impor... | 25.124424 | 98 | 0.567498 |
import mysql.connector
from mysql.connector import Error as mysqlError
from mysql.connector import errorcode, errors
from configparser import Error as configError
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(currentdir)
from readConfig import readConfig
from checkCreateDat... | true | true |
f75978147ba8329c9c327e0bebf1b2e06585a2f9 | 1,594 | py | Python | nni/tools/package_utils/common.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | nni/tools/package_utils/common.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | nni/tools/package_utils/common.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
__all__ = ['AlgoMeta']
from typing import Dict, NamedTuple, Optional
class AlgoMeta(NamedTuple):
name: str
class_name: Optional[str]
accept_class_args: bool
class_args: Optional[dict]
validator_class_name: Optional[str]
... | 33.914894 | 72 | 0.61857 |
__all__ = ['AlgoMeta']
from typing import Dict, NamedTuple, Optional
class AlgoMeta(NamedTuple):
name: str
class_name: Optional[str]
accept_class_args: bool
class_args: Optional[dict]
validator_class_name: Optional[str]
algo_type: str is_builtin: bool
nni_version: Optional[str]
... | true | true |
f7597864d1bf82ce4e7ff5f69d879496bace4c20 | 24,133 | py | Python | pygeoapi/provider/elasticsearch_.py | RousseauLambertLP/pygeoapi | e28d0cbd477add9358330bdf6671d09f8c2915db | [
"MIT"
] | 1 | 2021-09-14T11:42:32.000Z | 2021-09-14T11:42:32.000Z | pygeoapi/provider/elasticsearch_.py | MetServiceDev/pygeoapi | 5d072f4efa69562bf1ef6b6e80827231c3338926 | [
"MIT"
] | 1 | 2021-12-13T15:04:22.000Z | 2022-01-25T09:31:47.000Z | pygeoapi/provider/elasticsearch_.py | MetServiceDev/pygeoapi | 5d072f4efa69562bf1ef6b6e80827231c3338926 | [
"MIT"
] | null | null | null | # =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2021 Tom Kralidis
# Copyright (c) 2021 Francesco Bartoli
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentatio... | 34.525036 | 88 | 0.510753 |
from typing import Dict
from collections import OrderedDict
import json
import logging
from urllib.parse import urlparse
from elasticsearch import Elasticsearch, exceptions, helpers
from elasticsearch.client.indices import IndicesClient
from elasticsearch_dsl import Search, Q
from pygeoapi.provider.base import (Base... | true | true |
f7597962f9c9d1b8171f9bd689b0cf8718c19a27 | 7,202 | py | Python | test/functional/signrawtransactions.py | PERSHYANCOIN/PERSHYANCOIN | bbadf90495732ecdbf5ab9a27e84e1dbdaff117d | [
"MIT"
] | 1 | 2018-02-21T07:10:01.000Z | 2018-02-21T07:10:01.000Z | test/functional/signrawtransactions.py | pershyancoin/pershyancoin | bbadf90495732ecdbf5ab9a27e84e1dbdaff117d | [
"MIT"
] | 2 | 2018-02-12T22:00:38.000Z | 2018-02-12T22:01:03.000Z | test/functional/signrawtransactions.py | PERSHYANCOIN/PERSHYANCOIN | bbadf90495732ecdbf5ab9a27e84e1dbdaff117d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Pershyancoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction signing using the signrawtransaction RPC."""
from test_framework.test_framework ... | 50.013889 | 712 | 0.714246 |
from test_framework.test_framework import PershyancoinTestFramework
from test_framework.util import *
class SignRawTransactionsTest(PershyancoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def successful_signing_test(self):
privKeys = ['... | true | true |
f7597ab3e85a8e8c749d8f68125bfef88eb21f19 | 834 | py | Python | naviclass/basecmd.py | malexer/SublimeClassNavigator | f1beaf07a85aea7bdfc8447c0fcc967108cc6aca | [
"MIT"
] | 2 | 2017-05-24T18:40:16.000Z | 2022-02-03T11:08:37.000Z | naviclass/basecmd.py | malexer/SublimeClassNavigator | f1beaf07a85aea7bdfc8447c0fcc967108cc6aca | [
"MIT"
] | null | null | null | naviclass/basecmd.py | malexer/SublimeClassNavigator | f1beaf07a85aea7bdfc8447c0fcc967108cc6aca | [
"MIT"
] | null | null | null | import sublime_plugin
from .statusbar import StatusMessage
class ClassNavigatorBaseCmd(sublime_plugin.TextCommand):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.status = StatusMessage(sublime_view=self.view)
def save_start_position(self):
self.start_po... | 26.0625 | 69 | 0.635492 | import sublime_plugin
from .statusbar import StatusMessage
class ClassNavigatorBaseCmd(sublime_plugin.TextCommand):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.status = StatusMessage(sublime_view=self.view)
def save_start_position(self):
self.start_po... | true | true |
f7597ad6057f9b3ada226ec2454783f20ce47f99 | 237 | py | Python | erpnext/hr/doctype/employee_incentive/test_employee_incentive.py | nagendrarawat/erpnext_custom | 1b94ecc3e66eae402347c302cd1663b690fb1ade | [
"MIT"
] | 2 | 2019-10-01T13:07:39.000Z | 2019-10-03T03:52:19.000Z | erpnext/hr/doctype/employee_incentive/test_employee_incentive.py | nagendrarawat/erpnext_custom | 1b94ecc3e66eae402347c302cd1663b690fb1ade | [
"MIT"
] | null | null | null | erpnext/hr/doctype/employee_incentive/test_employee_incentive.py | nagendrarawat/erpnext_custom | 1b94ecc3e66eae402347c302cd1663b690fb1ade | [
"MIT"
] | 3 | 2019-09-30T19:17:44.000Z | 2019-10-23T18:59:12.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeIncentive(unittest.TestCase):
pass
| 21.545455 | 68 | 0.776371 | from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeIncentive(unittest.TestCase):
pass
| true | true |
f7597c4d43be41f95955f72e19e0f41baa34d29f | 5,599 | py | Python | adept_envs/simulation/dm_renderer.py | isabella232/DBAP-simulation | bdba0b58c4a01e0742e97299ce3bd1587ad2aa25 | [
"Apache-2.0"
] | 2 | 2021-08-09T23:45:17.000Z | 2021-11-05T15:28:41.000Z | adept_envs/simulation/dm_renderer.py | google-research/DBAP-simulation | bdba0b58c4a01e0742e97299ce3bd1587ad2aa25 | [
"Apache-2.0"
] | 1 | 2022-01-16T14:03:20.000Z | 2022-01-16T14:03:20.000Z | adept_envs/simulation/dm_renderer.py | isabella232/DBAP-simulation | bdba0b58c4a01e0742e97299ce3bd1587ad2aa25 | [
"Apache-2.0"
] | 2 | 2021-11-05T15:28:31.000Z | 2022-01-16T12:00:17.000Z | """
Copyright 2021 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, software
d... | 33.130178 | 101 | 0.647973 |
import sys
import numpy as np
import dm_control.mujoco as dm_mujoco
import dm_control.viewer as dm_viewer
import dm_control._render as dm_render
from adept_envs.simulation.renderer import Renderer, RenderMode
DEFAULT_WINDOW_WIDTH = 640
DEFAULT_WINDOW_HEIGHT = 480
DEFAULT_WINDOW_TITLE = 'MuJoCo Viewer'
_MAX_RENDE... | true | true |
f7597e6cb02f07cfdb359a1038027ed0ce3ae970 | 2,498 | py | Python | schedule_tasks.py | Toffooo/aituio | a4382f2d857cf8a5dd3b44bbc5fa93203c2eec28 | [
"MIT"
] | null | null | null | schedule_tasks.py | Toffooo/aituio | a4382f2d857cf8a5dd3b44bbc5fa93203c2eec28 | [
"MIT"
] | null | null | null | schedule_tasks.py | Toffooo/aituio | a4382f2d857cf8a5dd3b44bbc5fa93203c2eec28 | [
"MIT"
] | null | null | null | import time
from agbot.services.db_conn import engine, session
from agbot.services.orm import ENTResult, AETResult, BaseModel, Schedule, base
from aitu_data_extractors.site import (
get_aet_streams_links,
get_important_dates,
)
def create_ent_results():
print("ENT REULTS IS RUNNING")
ENTResult.trunca... | 22.709091 | 78 | 0.589271 | import time
from agbot.services.db_conn import engine, session
from agbot.services.orm import ENTResult, AETResult, BaseModel, Schedule, base
from aitu_data_extractors.site import (
get_aet_streams_links,
get_important_dates,
)
def create_ent_results():
print("ENT REULTS IS RUNNING")
ENTResult.trunca... | true | true |
f7597ef5cf4b44ba9ec082bb2bfff5760d77e49d | 755 | py | Python | rest_framework_jwk/utils.py | Maronato/django-rest-framework-jwk | b2acf9c88fb14695ca20655e5395df7e71abea17 | [
"0BSD"
] | 1 | 2022-02-03T06:42:10.000Z | 2022-02-03T06:42:10.000Z | rest_framework_jwk/utils.py | Maronato/django-rest-framework-jwk | b2acf9c88fb14695ca20655e5395df7e71abea17 | [
"0BSD"
] | null | null | null | rest_framework_jwk/utils.py | Maronato/django-rest-framework-jwk | b2acf9c88fb14695ca20655e5395df7e71abea17 | [
"0BSD"
] | null | null | null | """Utilities
Some functions were taken from
https://github.com/SimpleJWT/django-rest-framework-simplejwt/blob/master/rest_framework_simplejwt/utils.py
"""
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils.timezone import is_naive, make_aware, utc
from django... | 20.972222 | 106 | 0.764238 |
from calendar import timegm
from datetime import datetime
from django.conf import settings
from django.utils.timezone import is_naive, make_aware, utc
from django.core.cache import caches, BaseCache
def make_utc(dt):
if settings.USE_TZ and is_naive(dt):
return make_aware(dt, timezone=utc)
return dt... | true | true |
f7597f3a30201cabbf450a4d611972713feeb388 | 393 | py | Python | localsys/wsgi.py | FrankGalanDev/ownsys | e5c77fc12b40f1788378b3c859392116ffb7d317 | [
"MIT"
] | null | null | null | localsys/wsgi.py | FrankGalanDev/ownsys | e5c77fc12b40f1788378b3c859392116ffb7d317 | [
"MIT"
] | null | null | null | localsys/wsgi.py | FrankGalanDev/ownsys | e5c77fc12b40f1788378b3c859392116ffb7d317 | [
"MIT"
] | null | null | null | """
WSGI config for localsys project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'localsys.settings')
application = get_wsgi_application()
| true | true |
f75980121a1770ea5d3ea5af3ad94305fa6e6591 | 1,154 | py | Python | Alignment/CommonAlignmentProducer/python/ALCARECOMuAlZMuMu_Output_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Alignment/CommonAlignmentProducer/python/ALCARECOMuAlZMuMu_Output_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Alignment/CommonAlignmentProducer/python/ALCARECOMuAlZMuMu_Output_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
# AlCaReco for muon based alignment using ZMuMu events
OutALCARECOMuAlZMuMu_noDrop = cms.PSet(
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('pathALCARECOMuAlZMuMu')
),
outputCommands = cms.untracked.vstring(
'keep *_ALCARECOMuAlZMuMu... | 36.0625 | 78 | 0.666378 | import FWCore.ParameterSet.Config as cms
OutALCARECOMuAlZMuMu_noDrop = cms.PSet(
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('pathALCARECOMuAlZMuMu')
),
outputCommands = cms.untracked.vstring(
'keep *_ALCARECOMuAlZMuMu_*_*', 'keep *_ALCARECOMuAlZMuMuGeneralTracks_*... | true | true |
f759802f10792c32894e49bc1a270e6d30867ecd | 3,070 | py | Python | src/send_slack_notification.py | prateek-1708/pg-cfn-notifications | f159a8bf827f114e9560828bac75683ddb134019 | [
"MIT"
] | 1 | 2018-10-11T12:11:43.000Z | 2018-10-11T12:11:43.000Z | src/send_slack_notification.py | prateeknayak/pg-cfn-notifications | f159a8bf827f114e9560828bac75683ddb134019 | [
"MIT"
] | null | null | null | src/send_slack_notification.py | prateeknayak/pg-cfn-notifications | f159a8bf827f114e9560828bac75683ddb134019 | [
"MIT"
] | null | null | null | import json
import shlex
import urllib2
import logging
import os
# Mapping CloudFormation status codes to colors for Slack message attachments
# Status codes from http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html
STATUS_COLORS = {
'CREATE_COMPLETE': 'good',
'CREATE_... | 31.649485 | 114 | 0.699674 | import json
import shlex
import urllib2
import logging
import os
STATUS_COLORS = {
'CREATE_COMPLETE': 'good',
'CREATE_IN_PROGRESS': 'good',
'CREATE_FAILED': 'danger',
'DELETE_COMPLETE': 'good',
'DELETE_FAILED': 'danger',
'DELETE_IN_PROGRESS': 'good',
'ROLLBACK_COMPLETE': 'warning',
'ROL... | true | true |
f759806809baf14d2610fbff9363646b7c38e996 | 23,340 | py | Python | colab_gdrive/colab_gdrive.py | drdavidrace/ColabGdrive | 439fbfe9b74c2b18e68b5652fe8ad5adb46ffefd | [
"Apache-2.0"
] | null | null | null | colab_gdrive/colab_gdrive.py | drdavidrace/ColabGdrive | 439fbfe9b74c2b18e68b5652fe8ad5adb46ffefd | [
"Apache-2.0"
] | null | null | null | colab_gdrive/colab_gdrive.py | drdavidrace/ColabGdrive | 439fbfe9b74c2b18e68b5652fe8ad5adb46ffefd | [
"Apache-2.0"
] | null | null | null | '''
Module definition for colab_gdrive
'''
import os
import sys
import logging
from pprint import pformat, pprint
import inspect
#import traceback
#PyDrive
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
#google
from google.colab import auth
#oauth2client
from oauth2client.client import Google... | 35.150602 | 161 | 0.674593 | import os
import sys
import logging
from pprint import pformat, pprint
import inspect
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
class ColabGDrive(GoogleDrive):
def __init__(self, logging_level=logging.ERR... | true | true |
f759809600e7f85a1a1e08c1f78060a7ca756c5f | 592 | py | Python | usexif/date.py | zironycho/usexif | 56b144a46b0481ecbb75caef78a81d853dc5f10e | [
"MIT"
] | 3 | 2017-02-26T07:36:56.000Z | 2017-02-27T14:59:27.000Z | usexif/date.py | zironycho/usexif | 56b144a46b0481ecbb75caef78a81d853dc5f10e | [
"MIT"
] | null | null | null | usexif/date.py | zironycho/usexif | 56b144a46b0481ecbb75caef78a81d853dc5f10e | [
"MIT"
] | null | null | null | from datetime import datetime
__author__ = 'zirony'
def takendate(tags):
if ('EXIF DateTimeOriginal' in tags) and (0 < len(tags['EXIF DateTimeOriginal'].values)):
taken = tags['EXIF DateTimeOriginal'].values
elif ('EXIF DateTimeDigitized' in tags) and (0 < len(tags['EXIF DateTimeDigitized'].values)):... | 34.823529 | 97 | 0.662162 | from datetime import datetime
__author__ = 'zirony'
def takendate(tags):
if ('EXIF DateTimeOriginal' in tags) and (0 < len(tags['EXIF DateTimeOriginal'].values)):
taken = tags['EXIF DateTimeOriginal'].values
elif ('EXIF DateTimeDigitized' in tags) and (0 < len(tags['EXIF DateTimeDigitized'].values)):... | true | true |
f75980df515d8eb608ab418a1adbfe9dec7954f1 | 3,094 | py | Python | labs/lab-06/misc/plot_words.py | sak6lab/oss-repo-template | b4984339da4fd8a3060c58300d2c51bc8e6b4b38 | [
"MIT"
] | null | null | null | labs/lab-06/misc/plot_words.py | sak6lab/oss-repo-template | b4984339da4fd8a3060c58300d2c51bc8e6b4b38 | [
"MIT"
] | null | null | null | labs/lab-06/misc/plot_words.py | sak6lab/oss-repo-template | b4984339da4fd8a3060c58300d2c51bc8e6b4b38 | [
"MIT"
] | null | null | null | """
=====
Words
=====
Words/Ladder Graph
------------------
Generate an undirected graph over the 5757 5-letter words in the
datafile `words_dat.txt.gz`. Two words are connected by an edge
if they differ in one letter, resulting in 14,135 edges. This example
is described in Section 1.1 in Knuth's book (see [1]_ and [... | 32.914894 | 76 | 0.555915 |
import gzip
from string import ascii_lowercase as lowercase
from itertools import permutations
import networkx as nx
def generate_graph(words):
G = nx.Graph(name="words")
lookup = dict((c, lowercase.index(c)) for c in lowercase)
def edit_distance_one(word):
for i in range(len(word)):
... | true | true |
f759810b5e0ce6ff1019e469b93354818defe4a1 | 22,925 | py | Python | python-function-test/alibabacloud_credentials_test.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | null | null | null | python-function-test/alibabacloud_credentials_test.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | null | null | null | python-function-test/alibabacloud_credentials_test.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Alibaba Cloud Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 50.274123 | 102 | 0.687939 |
import os
import mock
from alibabacloud import get_client
from alibabacloud.client import AlibabaCloudClient
from alibabacloud.client import ClientConfig
from alibabacloud.credentials import AccessKeyCredentials
from alibabacloud.credentials.provider import RamRoleCredentialsProvider, \
DefaultChainedCredentials... | true | true |
f75981280a750f263b8e77aa13fcfdad32a08971 | 198 | py | Python | train.py | hesther/ehreact | 3cd1582b608a83b32e175299dcf1027289f8bb55 | [
"BSD-3-Clause"
] | 2 | 2021-05-27T17:36:36.000Z | 2021-12-02T06:14:33.000Z | train.py | hesther/ehreact | 3cd1582b608a83b32e175299dcf1027289f8bb55 | [
"BSD-3-Clause"
] | 1 | 2022-02-10T15:52:55.000Z | 2022-02-14T07:37:37.000Z | train.py | hesther/ehreact | 3cd1582b608a83b32e175299dcf1027289f8bb55 | [
"BSD-3-Clause"
] | null | null | null | """Generates template trees on a dataset."""
from ehreact.arguments import TrainArgs
from ehreact.train import train
if __name__ == '__main__':
args = TrainArgs().parse_args()
train(args)
| 22 | 44 | 0.727273 |
from ehreact.arguments import TrainArgs
from ehreact.train import train
if __name__ == '__main__':
args = TrainArgs().parse_args()
train(args)
| true | true |
f759814f3195086846e68bf8277e17b1d5a9e33c | 8,186 | py | Python | litex_boards/targets/alchitry_mojo.py | mdejw/litex-boards | 8a33c2aa312dddc66297f7cd6e39107fda5a2efb | [
"BSD-2-Clause"
] | 1 | 2022-01-11T22:25:51.000Z | 2022-01-11T22:25:51.000Z | litex_boards/targets/alchitry_mojo.py | mdejw/litex-boards | 8a33c2aa312dddc66297f7cd6e39107fda5a2efb | [
"BSD-2-Clause"
] | null | null | null | litex_boards/targets/alchitry_mojo.py | mdejw/litex-boards | 8a33c2aa312dddc66297f7cd6e39107fda5a2efb | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 Nathaniel Lewis <github@nrlewis.dev>
# SPDX-License-Identifier: BSD-2-Clause
# Testing build for HDMI
# - The main trouble with HDMI demos are that they require many SLICEMs, which are a very limited
# resource on the XC6SLX9. Many... | 44.248649 | 126 | 0.598827 |
import os
import argparse
import sys
from migen import *
from litex.build.io import DDROutput
from litex_boards.platforms import alchitry_mojo
from litex.soc.interconnect.csr import *
from litex.soc.integration.soc_core import *
from litex.soc.integration.builder import *
from litex.soc.cores.clock import *
from... | true | true |
f75981cb131b568f38dc8e2951e2c5cca019c7b5 | 7,745 | py | Python | web/views_html.py | 0x24bin/oh-my-rss | cae5b228fd3577eff178919a0305702dc3e97665 | [
"MIT"
] | 2 | 2020-10-02T07:38:43.000Z | 2021-06-29T07:32:15.000Z | web/views_html.py | 0x24bin/oh-my-rss | cae5b228fd3577eff178919a0305702dc3e97665 | [
"MIT"
] | null | null | null | web/views_html.py | 0x24bin/oh-my-rss | cae5b228fd3577eff178919a0305702dc3e97665 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.core.paginator import Paginator
from django.http import HttpResponseNotFound
from .models import *
from .utils import get_page_uv, get_subscribe_sites, get_login_user, get_user_sub_feeds, set_user_read_article, \
get_similar_article
from .verify import verify_request
... | 27.960289 | 113 | 0.654487 | from django.shortcuts import render
from django.core.paginator import Paginator
from django.http import HttpResponseNotFound
from .models import *
from .utils import get_page_uv, get_subscribe_sites, get_login_user, get_user_sub_feeds, set_user_read_article, \
get_similar_article
from .verify import verify_request
... | true | true |
f7598242407a3c667823282e0479e2696e6d7e15 | 1,174 | py | Python | webapp/endpoints/config_endpoints.py | bmwant/chemister | fbefcc9f548acc69966b6fbe19c4486f471fb390 | [
"MIT"
] | null | null | null | webapp/endpoints/config_endpoints.py | bmwant/chemister | fbefcc9f548acc69966b6fbe19c4486f471fb390 | [
"MIT"
] | 1 | 2020-04-29T23:35:21.000Z | 2020-04-29T23:35:21.000Z | webapp/endpoints/config_endpoints.py | bmwant/chemister | fbefcc9f548acc69966b6fbe19c4486f471fb390 | [
"MIT"
] | null | null | null | from aiohttp import web
from crawler.forms.config import config_trafaret
from crawler.models.configs import insert_new_config, remove_config
from webapp.helpers import login_required, flash
@login_required
async def save_config(request):
app = request.app
router = app.router
logger = app['logger']
en... | 29.35 | 72 | 0.703578 | from aiohttp import web
from crawler.forms.config import config_trafaret
from crawler.models.configs import insert_new_config, remove_config
from webapp.helpers import login_required, flash
@login_required
async def save_config(request):
app = request.app
router = app.router
logger = app['logger']
en... | true | true |
f759827958e56d2132d3fc663e5e5e4c9be2a6ed | 27,773 | py | Python | panel_segmentation/panel_detection.py | NREL/Panel-Segmentation | 2270157fe87dc211f87d79b9ca38a4fbae967a1a | [
"MIT"
] | 13 | 2021-01-08T14:53:14.000Z | 2022-02-11T18:37:00.000Z | panel_segmentation/panel_detection.py | NREL/Panel-Segmentation | 2270157fe87dc211f87d79b9ca38a4fbae967a1a | [
"MIT"
] | 13 | 2020-12-01T17:16:36.000Z | 2021-07-14T22:19:48.000Z | panel_segmentation/panel_detection.py | NREL/Panel-Segmentation | 2270157fe87dc211f87d79b9ca38a4fbae967a1a | [
"MIT"
] | 2 | 2020-11-30T23:58:31.000Z | 2022-02-21T13:57:27.000Z | """
Panel detection class
"""
import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras.preprocessing import image
from tensorflow.keras.models import load_model
import cv2
import matplotlib.pyplot as plt
from skimage.transform import hough_line, hough_line_peaks
from matplotlib import cm
impo... | 45.15935 | 166 | 0.565621 |
import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras.preprocessing import image
from tensorflow.keras.models import load_model
import cv2
import matplotlib.pyplot as plt
from skimage.transform import hough_line, hough_line_peaks
from matplotlib import cm
import requests
from PIL import Im... | true | true |
f759830e4bcb7357e6849657d19d5c253389a8bc | 22,105 | py | Python | mars/web/session.py | deka108/mars | 2cd39847c188bb690dd5e2d612a5cbe9f7b21eca | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/web/session.py | deka108/mars | 2cd39847c188bb690dd5e2d612a5cbe9f7b21eca | [
"Apache-2.0"
] | null | null | null | mars/web/session.py | deka108/mars | 2cd39847c188bb690dd5e2d612a5cbe9f7b21eca | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 43.599606 | 109 | 0.637412 |
import base64
import json
import time
import logging
import pickle
import sys
import uuid
from io import BytesIO
from numbers import Integral
import numpy as np
from ..config import options
from ..core.operand import Fetch
from ..errors import ResponseMalformed, ExecutionInterrupted, ExecutionFailed, \
Execution... | true | true |
f75984683c30422d5523fd446980cf97f130084c | 2,436 | py | Python | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/blob.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/blob.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/blob.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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,... | 31.636364 | 74 | 0.655583 |
from boto.compat import six
class Blob(object):
def __init__(self, value=None, file=None, id=None):
self._file = file
self.id = id
self.value = value
@property
def file(self):
from StringIO import StringIO
if self._file:
f = self._file
else:
... | true | true |
f75984ae97d23f4ebdbb6ddbbdb2c970bf0b0f57 | 119 | py | Python | 11050/main.py | yeonghoey/boj | a3f7c0aa901ad0e2ca6a863f1867fc574feb8c8e | [
"MIT"
] | 1 | 2019-03-07T15:43:17.000Z | 2019-03-07T15:43:17.000Z | 11050/main.py | yeonghoey/baekjoon | a3f7c0aa901ad0e2ca6a863f1867fc574feb8c8e | [
"MIT"
] | null | null | null | 11050/main.py | yeonghoey/baekjoon | a3f7c0aa901ad0e2ca6a863f1867fc574feb8c8e | [
"MIT"
] | null | null | null | N, K = (int(s) for s in input().split())
x, y = 1, 1
for k in range(1, K+1):
x *= (N-k+1)
y *= k
print(x // y)
| 17 | 40 | 0.445378 | N, K = (int(s) for s in input().split())
x, y = 1, 1
for k in range(1, K+1):
x *= (N-k+1)
y *= k
print(x // y)
| true | true |
f7598579b55e37f35230c61cde24568c279da680 | 3,639 | py | Python | stopwatch.py | krzyyychu/stopwatch | 31e3becd6b2020e4230e152615ed4d849b87bd65 | [
"MIT"
] | null | null | null | stopwatch.py | krzyyychu/stopwatch | 31e3becd6b2020e4230e152615ed4d849b87bd65 | [
"MIT"
] | null | null | null | stopwatch.py | krzyyychu/stopwatch | 31e3becd6b2020e4230e152615ed4d849b87bd65 | [
"MIT"
] | null | null | null | import tkinter
import time
class StopWatch(tkinter.Frame):
"""Simple stopwatch widget"""
def __init__(self, parent=None, **kw):
tkinter.Frame.__init__(self, parent, kw)
self._start = 0.0
self._elapsedtime = 0.0
self._running = 0
self.timestr = tkinter.StringVar... | 30.579832 | 115 | 0.642759 | import tkinter
import time
class StopWatch(tkinter.Frame):
def __init__(self, parent=None, **kw):
tkinter.Frame.__init__(self, parent, kw)
self._start = 0.0
self._elapsedtime = 0.0
self._running = 0
self.timestr = tkinter.StringVar()
taskName = tkinter.Ent... | true | true |
f75985a1f6680dde747f40929a3aca60b3ada29f | 12,693 | py | Python | continual_learning/scenarios/classification/new_classes/nc_scenarios.py | jaryP/ContinualAI | 7d9b7614066d219ebd72049692da23ad6ec132b0 | [
"MIT"
] | null | null | null | continual_learning/scenarios/classification/new_classes/nc_scenarios.py | jaryP/ContinualAI | 7d9b7614066d219ebd72049692da23ad6ec132b0 | [
"MIT"
] | null | null | null | continual_learning/scenarios/classification/new_classes/nc_scenarios.py | jaryP/ContinualAI | 7d9b7614066d219ebd72049692da23ad6ec132b0 | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Union, List, Any, Callable, Dict
import numpy as np
from continual_learning.datasets.base import AbstractDataset, DatasetSplitsContainer
from continual_learning.scenarios.base import TasksGenerator
from continual_learning.scenarios.classification.new_classes imp... | 41.07767 | 84 | 0.541401 | from collections import defaultdict
from typing import Union, List, Any, Callable, Dict
import numpy as np
from continual_learning.datasets.base import AbstractDataset, DatasetSplitsContainer
from continual_learning.scenarios.base import TasksGenerator
from continual_learning.scenarios.classification.new_classes imp... | true | true |
f75985a4bccad8094ed3e6e7569555edf50900da | 391 | py | Python | backend/api_app/api_app/wsgi.py | plaunezkiy/posts-app-fullstack | 7385a341dadf522b90f3d54027012048a724aae5 | [
"MIT"
] | null | null | null | backend/api_app/api_app/wsgi.py | plaunezkiy/posts-app-fullstack | 7385a341dadf522b90f3d54027012048a724aae5 | [
"MIT"
] | null | null | null | backend/api_app/api_app/wsgi.py | plaunezkiy/posts-app-fullstack | 7385a341dadf522b90f3d54027012048a724aae5 | [
"MIT"
] | null | null | null | """
WSGI config for api_app project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_app.settings')
application = get_wsgi_application()
| true | true |
f75985e77b8f01bc81a59cbd5ce910f70325d434 | 3,544 | py | Python | avalanche/benchmarks/datasets/cub200/cub200.py | subutai/avalanche | 981ef041903155aa3454de13f6fbe5d323d881c9 | [
"MIT"
] | null | null | null | avalanche/benchmarks/datasets/cub200/cub200.py | subutai/avalanche | 981ef041903155aa3454de13f6fbe5d323d881c9 | [
"MIT"
] | null | null | null | avalanche/benchmarks/datasets/cub200/cub200.py | subutai/avalanche | 981ef041903155aa3454de13f6fbe5d323d881c9 | [
"MIT"
] | 1 | 2021-04-09T08:10:27.000Z | 2021-04-09T08:10:27.000Z | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | 33.121495 | 80 | 0.514108 |
import os
import logging
from torchvision.datasets.folder import default_loader
from torchvision.datasets.utils import check_integrity, \
extract_archive
from torch.utils.data.dataset import Dataset
class CUB200(Dataset):
filename = 'images.tgz'
metadata = "lists.tgz"
basefolder = "images"
tgz_... | true | true |
f7598648a7e90d2df280c095f30b12c4b59c1ea5 | 3,753 | py | Python | dl_training/main.py | Duplums/SMLvsDL | b285717bd8d8e832b4bc9e2b42d18bd96b628def | [
"MIT"
] | null | null | null | dl_training/main.py | Duplums/SMLvsDL | b285717bd8d8e832b4bc9e2b42d18bd96b628def | [
"MIT"
] | null | null | null | dl_training/main.py | Duplums/SMLvsDL | b285717bd8d8e832b4bc9e2b42d18bd96b628def | [
"MIT"
] | null | null | null | import argparse
from dl_training.training import BaseTrainer
from dl_training.testing import OpenBHBTester
import torch
import logging
if __name__=="__main__":
logger = logging.getLogger("SMLvsDL")
parser = argparse.ArgumentParser()
# Data location + saving paths
parser.add_argument("--root", type=s... | 41.241758 | 124 | 0.659472 | import argparse
from dl_training.training import BaseTrainer
from dl_training.testing import OpenBHBTester
import torch
import logging
if __name__=="__main__":
logger = logging.getLogger("SMLvsDL")
parser = argparse.ArgumentParser()
parser.add_argument("--root", type=str, required=True, help="Path t... | true | true |
f75986e670a7014478bd6b2e978339c75f2c4deb | 5,946 | py | Python | airflow/providers/google/cloud/transfers/sheets_to_gcs.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2021-06-26T13:37:35.000Z | 2022-01-11T15:49:44.000Z | airflow/providers/google/cloud/transfers/sheets_to_gcs.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 33 | 2021-07-25T10:29:30.000Z | 2022-03-30T04:39:06.000Z | airflow/providers/google/cloud/transfers/sheets_to_gcs.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.44898 | 103 | 0.687353 |
import csv
from tempfile import NamedTemporaryFile
from typing import TYPE_CHECKING, Any, List, Optional, Sequence, Union
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.providers.google.suite.hooks.sheets import GSheetsHook
if TYPE_CHECKING:
from... | true | true |
f75986fa8a66de5006e01d33b9d65b7710685c6f | 128 | py | Python | demo/mpi-ref-v1/ex-3.12.py | gmdzy2010/mpi4py | 7f7a94760194e11ba72f8af2f49b7d1b37bd9343 | [
"BSD-2-Clause"
] | 533 | 2015-03-02T05:16:27.000Z | 2022-03-28T09:44:37.000Z | demo/mpi-ref-v1/ex-3.12.py | gmdzy2010/mpi4py | 7f7a94760194e11ba72f8af2f49b7d1b37bd9343 | [
"BSD-2-Clause"
] | 105 | 2017-09-17T07:50:33.000Z | 2022-03-29T17:27:43.000Z | demo/mpi-ref-v1/ex-3.12.py | gmdzy2010/mpi4py | 7f7a94760194e11ba72f8af2f49b7d1b37bd9343 | [
"BSD-2-Clause"
] | 98 | 2015-02-03T03:17:52.000Z | 2022-03-23T02:03:11.000Z | execfile('ex-3.02.py')
B = (3, 1)
D = (4 * dtype.extent, 0)
newtype = dtype.Create_hindexed(B, D)
dtype.Free()
newtype.Free()
| 14.222222 | 37 | 0.632813 | execfile('ex-3.02.py')
B = (3, 1)
D = (4 * dtype.extent, 0)
newtype = dtype.Create_hindexed(B, D)
dtype.Free()
newtype.Free()
| true | true |
f7598737c235983238de9430abcf72ea7e413d7d | 525 | py | Python | rssant_api/admin.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 1,176 | 2019-12-24T01:51:22.000Z | 2022-03-29T06:00:25.000Z | rssant_api/admin.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 33 | 2020-03-06T03:29:46.000Z | 2022-03-11T06:24:26.000Z | rssant_api/admin.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 110 | 2019-12-29T05:49:24.000Z | 2022-03-28T06:44:21.000Z | from django.contrib import admin
from . import models
def _register(model):
if not hasattr(model, 'Admin'):
return admin.site.register(m)
class RssantModelAdmin(admin.ModelAdmin):
if hasattr(model.Admin, 'display_fields'):
list_display = tuple(['id'] + model.Admin.display_fields)... | 25 | 69 | 0.68381 | from django.contrib import admin
from . import models
def _register(model):
if not hasattr(model, 'Admin'):
return admin.site.register(m)
class RssantModelAdmin(admin.ModelAdmin):
if hasattr(model.Admin, 'display_fields'):
list_display = tuple(['id'] + model.Admin.display_fields)... | true | true |
f75988427266368b8f6c87c42911ff7b82e01e9c | 1,710 | py | Python | src/backend/model.py | inacioMattos/DeepLearning-Cachorros-e-Gatos | a1eb42308f820809b7239cca6e81c4e880f5f540 | [
"MIT"
] | null | null | null | src/backend/model.py | inacioMattos/DeepLearning-Cachorros-e-Gatos | a1eb42308f820809b7239cca6e81c4e880f5f540 | [
"MIT"
] | null | null | null | src/backend/model.py | inacioMattos/DeepLearning-Cachorros-e-Gatos | a1eb42308f820809b7239cca6e81c4e880f5f540 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D
from tensorflow.keras.callbacks import TensorBoard
import pickle, os, time
DATADIR="data/"
NAME="cachorros-gatos-cnn-128-128-128-{}".format(int(time.time... | 23.424658 | 97 | 0.721637 | import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D
from tensorflow.keras.callbacks import TensorBoard
import pickle, os, time
DATADIR="data/"
NAME="cachorros-gatos-cnn-128-128-128-{}".format(int(time.time... | true | true |
f75988c38cfd5f486e90d1a8ec3b3ab4302dd9d9 | 590 | py | Python | models/models_code/Acronyms/Clean.py | tpsatish95/SocialTextFilter | 055da15b06584ab6e806d70ca04d80429d7dc073 | [
"Apache-2.0"
] | null | null | null | models/models_code/Acronyms/Clean.py | tpsatish95/SocialTextFilter | 055da15b06584ab6e806d70ca04d80429d7dc073 | [
"Apache-2.0"
] | null | null | null | models/models_code/Acronyms/Clean.py | tpsatish95/SocialTextFilter | 055da15b06584ab6e806d70ca04d80429d7dc073 | [
"Apache-2.0"
] | null | null | null | import pickle
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(obj, f, protocol=2)
def load_obj(name ):
with open( name + '.pkl', 'rb') as f:
return pickle.load(f)
acro = load_obj("acronymsDict")
# Spit out
# for a in acro.keys():
# print(a + " : " + acro[a])
ac... | 19.666667 | 49 | 0.618644 | import pickle
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(obj, f, protocol=2)
def load_obj(name ):
with open( name + '.pkl', 'rb') as f:
return pickle.load(f)
acro = load_obj("acronymsDict")
acroLines = open("acroClean.txt","r").readlines()
acronymsDict = d... | true | true |
f75989ee1ce988b545a6e67ca404a3a7cc5c10a0 | 13,542 | py | Python | PlayingCards/klonedike.py | taKana671/PlayingCards | dcd8fadf705ed37beaa2b46bcbb4a777b031d254 | [
"MIT"
] | 5 | 2020-12-19T13:21:52.000Z | 2022-02-06T04:20:57.000Z | PlayingCards/klonedike.py | taKana671/PlayingCards | dcd8fadf705ed37beaa2b46bcbb4a777b031d254 | [
"MIT"
] | null | null | null | PlayingCards/klonedike.py | taKana671/PlayingCards | dcd8fadf705ed37beaa2b46bcbb4a777b031d254 | [
"MIT"
] | null | null | null | import tkinter as tk
from base import BaseBoard, BaseCard, CardFace, Deck
from Globals import BOARD_WIDTH, BOARD_HEIGHT, CARD_ROOT, MOVE_SPEED
CARD_X = 100
CARD_Y = 100
CARD_OFFSET_X = 90
CARD_OFFSET_Y = 30
SPACE_X = 90
SPACE_Y = 140
STOCK_X = BOARD_WIDTH - 100
STOCK_Y = CARD_Y + 50
ACEHOLDER_X = BOARD_WIDTH - 200
A... | 39.138728 | 113 | 0.572515 | import tkinter as tk
from base import BaseBoard, BaseCard, CardFace, Deck
from Globals import BOARD_WIDTH, BOARD_HEIGHT, CARD_ROOT, MOVE_SPEED
CARD_X = 100
CARD_Y = 100
CARD_OFFSET_X = 90
CARD_OFFSET_Y = 30
SPACE_X = 90
SPACE_Y = 140
STOCK_X = BOARD_WIDTH - 100
STOCK_Y = CARD_Y + 50
ACEHOLDER_X = BOARD_WIDTH - 200
A... | true | true |
f7598a5d1a6e36e5448035e851b7de50238bb8d8 | 43,363 | py | Python | af/analysis/analysis/analysis.py | vivivibo/pipeline | 2a24660ca4b53b51bde3daedde80d8489bdeb37c | [
"BSD-3-Clause"
] | 16 | 2018-08-23T11:45:00.000Z | 2022-01-21T18:41:58.000Z | af/analysis/analysis/analysis.py | vivivibo/pipeline | 2a24660ca4b53b51bde3daedde80d8489bdeb37c | [
"BSD-3-Clause"
] | 241 | 2018-07-14T13:04:51.000Z | 2022-03-24T14:33:40.000Z | af/analysis/analysis/analysis.py | vivivibo/pipeline | 2a24660ca4b53b51bde3daedde80d8489bdeb37c | [
"BSD-3-Clause"
] | 7 | 2019-02-15T14:58:26.000Z | 2021-12-31T17:47:56.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ooni-pipeline: * -> Analysis
Configured with /etc/analysis.conf
Runs as a system daemon but can also be used from command line in devel mode
Creates and updates unlogged tables.
Shows confirmed correlated by country, ASN, input URL over time.
Inputs: Database table... | 31.44525 | 116 | 0.620229 |
from argparse import ArgumentParser, Namespace
from configparser import ConfigParser
from contextlib import contextmanager
from datetime import datetime, timedelta
from pathlib import Path
from urllib.parse import urlencode
import os
import time
import logging
import sys
from analysis import backup_to_s3
try:
... | true | true |
f7598abff997ac9e5a2bc8b47591a2c22fced502 | 4,679 | py | Python | Week4/test.py | mcv-m6-video/mcv-m6-2018-team8 | 7474522b38f9da1552889b8aef1be0603c8942dc | [
"MIT"
] | 2 | 2021-03-26T10:41:06.000Z | 2022-03-09T06:09:01.000Z | Week4/test.py | mcv-m6-video/mcv-m6-2018-team8 | 7474522b38f9da1552889b8aef1be0603c8942dc | [
"MIT"
] | null | null | null | Week4/test.py | mcv-m6-video/mcv-m6-2018-team8 | 7474522b38f9da1552889b8aef1be0603c8942dc | [
"MIT"
] | 3 | 2018-04-12T10:48:10.000Z | 2022-03-09T06:09:03.000Z | import sys
sys.path.append('../.')
from common.config import *
from methods.BlockMatchingOF import *
from common.Database import *
from methods.GaussianMethods import *
from common.extractPerformance import *
from common.metrics import *
from time import time
from methods.Farneback import *
from methods.LucasKanade im... | 41.40708 | 127 | 0.575978 | import sys
sys.path.append('../.')
from common.config import *
from methods.BlockMatchingOF import *
from common.Database import *
from methods.GaussianMethods import *
from common.extractPerformance import *
from common.metrics import *
from time import time
from methods.Farneback import *
from methods.LucasKanade im... | true | true |
f7598affb3aec062a01039e43e75ae25d530530f | 797 | py | Python | schema/hash.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 93 | 2021-05-13T00:13:19.000Z | 2022-03-30T03:55:09.000Z | schema/hash.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 17 | 2021-05-16T14:49:24.000Z | 2021-10-18T23:29:48.000Z | schema/hash.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 22 | 2021-05-13T08:32:59.000Z | 2022-02-23T13:07:05.000Z | #!/usr/bin/python3
from passlib.context import CryptContext
pwd_ctx = CryptContext(schemes=["bcrypt"], deprecated="auto")
class Hash:
@staticmethod
def bcrypt(password: str):
"""
Generate a bcrypt hashed password
Args:
password (str): The password to hash
Return... | 23.441176 | 63 | 0.608532 |
from passlib.context import CryptContext
pwd_ctx = CryptContext(schemes=["bcrypt"], deprecated="auto")
class Hash:
@staticmethod
def bcrypt(password: str):
return pwd_ctx.hash(password)
def verify(hashed_password, plain_password):
return pwd_ctx.verify(plain_password, hashed_password)
| true | true |
f7598b2991513734f1f31681c6e040d694e03c69 | 4,049 | py | Python | habranalyzer/core.py | mas-student/web-python-2018-04-ht02 | 339d016967ea6e8b4873fbcb1781cf5f092593c3 | [
"MIT"
] | null | null | null | habranalyzer/core.py | mas-student/web-python-2018-04-ht02 | 339d016967ea6e8b4873fbcb1781cf5f092593c3 | [
"MIT"
] | null | null | null | habranalyzer/core.py | mas-student/web-python-2018-04-ht02 | 339d016967ea6e8b4873fbcb1781cf5f092593c3 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from pymorphy2 import MorphAnalyzer
from collections import Counter
from re import split
from operator import itemgetter, attrgetter
from datetime import timedelta
import datetime
morph = MorphAnalyzer()
def isnoun(word):
return 'NOUN' in word.tag.grammemes
def pag... | 27.358108 | 115 | 0.599654 | import requests
from bs4 import BeautifulSoup
from pymorphy2 import MorphAnalyzer
from collections import Counter
from re import split
from operator import itemgetter, attrgetter
from datetime import timedelta
import datetime
morph = MorphAnalyzer()
def isnoun(word):
return 'NOUN' in word.tag.grammemes
def pag... | true | true |
f7598b435c205288fc786c0fd027465aa74821a8 | 7,032 | py | Python | evaluation.py | AnonymityCode/FastLFnet | cc4c1d9620fef5e75798f40084729d8d7fdd5a9a | [
"MIT"
] | 8 | 2021-10-13T01:31:25.000Z | 2022-03-18T03:13:15.000Z | evaluation.py | zcong17huang/FastLFnet | d86e9b333f6acb62e0b4d30ed14519fe39ef2963 | [
"MIT"
] | 5 | 2021-12-13T07:19:14.000Z | 2022-03-26T13:00:37.000Z | evaluation.py | AnonymityCode/FastLFnet | cc4c1d9620fef5e75798f40084729d8d7fdd5a9a | [
"MIT"
] | 2 | 2021-11-04T04:04:41.000Z | 2021-11-06T07:56:25.000Z | # -*- coding: UTF-8 -*-
import argparse
import os
import numpy as np
import time
import sys
import cv2
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
import torchvision
import torch.nn.functional as F
from utils.logger import setup_logger1 ... | 45.662338 | 156 | 0.617605 | import argparse
import os
import numpy as np
import time
import sys
import cv2
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
import torchvision
import torch.nn.functional as F
from utils.logger import setup_logger1 as logger
import utils.r... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.