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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c404b4e8623172045b89333c0e18f6f6df29823 | 7,991 | py | Python | tests/attributes/test_datetime.py | yaal-coop/sheraf | 774e3781bc6ff2e16c6cc39f268d475b5e64fcea | [
"MIT"
] | 1 | 2020-03-18T09:54:52.000Z | 2020-03-18T09:54:52.000Z | tests/attributes/test_datetime.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | null | null | null | tests/attributes/test_datetime.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | null | null | null | import datetime
import libfaketime
import pytest
import pytz
import sheraf
import tests
def test_datetime_timestamp(sheraf_connection):
class Model(tests.UUIDAutoModel):
date = sheraf.DateTimeAttribute()
m = Model.create()
assert m.date is None
m = Model.read(m.id)
test_date = datetime.... | 30.268939 | 117 | 0.636341 | import datetime
import libfaketime
import pytest
import pytz
import sheraf
import tests
def test_datetime_timestamp(sheraf_connection):
class Model(tests.UUIDAutoModel):
date = sheraf.DateTimeAttribute()
m = Model.create()
assert m.date is None
m = Model.read(m.id)
test_date = datetime.... | true | true |
1c404bbb89804ba8726d68feddaa3e1754470abe | 12,814 | py | Python | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_householder.py | chrism0dwk/probability | ab260f15cae94c6802c2f2769fb448ad213b79cd | [
"Apache-2.0"
] | 2 | 2020-02-21T06:30:00.000Z | 2021-08-08T19:29:15.000Z | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_householder.py | chrism0dwk/probability | ab260f15cae94c6802c2f2769fb448ad213b79cd | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_householder.py | chrism0dwk/probability | ab260f15cae94c6802c2f2769fb448ad213b79cd | [
"Apache-2.0"
] | 1 | 2020-05-31T13:08:33.000Z | 2020-05-31T13:08:33.000Z | # Copyright 2020 The TensorFlow Probability Authors. All Rights Reserved.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# THIS FILE IS AUTO-GENERATED BY `gen_linear_operators.py`.
# DO NOT MODIFY DIRECTLY.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... | 41.603896 | 99 | 0.699938 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_probability.python.internal.backend.numpy import errors
from tensorflow_probability.python.internal.backend.numpy import ops
from tensorflow_probability.python.... | true | true |
1c404c22e8d3ea4700a7f2e9200aa33937f5295d | 479 | py | Python | compsocsite/polls/migrations/0057_item_item_description.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | 8 | 2017-03-07T19:46:51.000Z | 2021-06-01T01:41:37.000Z | compsocsite/polls/migrations/0057_item_item_description.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | null | null | null | compsocsite/polls/migrations/0057_item_item_description.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | 9 | 2016-06-09T03:36:20.000Z | 2019-09-11T20:56:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-25 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0056_auto_20160722_1606'),
]
operations = [
migrations.AddField(
... | 22.809524 | 75 | 0.626305 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0056_auto_20160722_1606'),
]
operations = [
migrations.AddField(
model_name='item',
name='item_description',
... | true | true |
1c404c92f557fecce42c589d4825172437f2ff78 | 3,228 | py | Python | lib/setupDeployment.py | cmusatyalab/PyEdgeSim | edc13488d66ec9582543e5f116c6611ef7b65d9d | [
"Apache-2.0"
] | null | null | null | lib/setupDeployment.py | cmusatyalab/PyEdgeSim | edc13488d66ec9582543e5f116c6611ef7b65d9d | [
"Apache-2.0"
] | null | null | null | lib/setupDeployment.py | cmusatyalab/PyEdgeSim | edc13488d66ec9582543e5f116c6611ef7b65d9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import pprint
import json
import shutil
sys.path.append("./lib")
from pyutils import *
from config import *
from simlogging import mconsole,configureLogging
from advantedgeapilib import *
from setupBuildEnv import setMEEPPATH
cnf = initConfig()
api = AdvantEDGEApi()
def ma... | 35.472527 | 131 | 0.625465 |
import sys
import os
import pprint
import json
import shutil
sys.path.append("./lib")
from pyutils import *
from config import *
from simlogging import mconsole,configureLogging
from advantedgeapilib import *
from setupBuildEnv import setMEEPPATH
cnf = initConfig()
api = AdvantEDGEApi()
def main():
configureLo... | true | true |
1c404e29b56c9d3befa180e62b8cbeb33576e541 | 23,687 | py | Python | certbot/reverter.py | cybersimon/certbot | 174e59486338b8f3e17300ef9937a3182e733ac7 | [
"Apache-2.0"
] | null | null | null | certbot/reverter.py | cybersimon/certbot | 174e59486338b8f3e17300ef9937a3182e733ac7 | [
"Apache-2.0"
] | null | null | null | certbot/reverter.py | cybersimon/certbot | 174e59486338b8f3e17300ef9937a3182e733ac7 | [
"Apache-2.0"
] | null | null | null | """Reverter class saves configuration checkpoints and allows for recovery."""
import csv
import glob
import logging
import os
import shutil
import time
import traceback
import zope.component
from certbot import constants
from certbot import errors
from certbot import interfaces
from certbot import util
from certbot... | 40.352641 | 97 | 0.615612 | import csv
import glob
import logging
import os
import shutil
import time
import traceback
import zope.component
from certbot import constants
from certbot import errors
from certbot import interfaces
from certbot import util
from certbot.display import util as display_util
logger = logging.getLogger(__name__)
... | true | true |
1c404edecd0b785e89bb58d20b2579dc0a826c04 | 5,675 | py | Python | airflow/providers/apache/hive/transfers/mssql_to_hive.py | khilawar4/airflow | 5f3f65b82517f615f31f0c8a7f8ac0facb325235 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-01-29T20:33:56.000Z | 2021-08-06T17:35:16.000Z | airflow/providers/apache/hive/transfers/mssql_to_hive.py | khilawar4/airflow | 5f3f65b82517f615f31f0c8a7f8ac0facb325235 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | airflow/providers/apache/hive/transfers/mssql_to_hive.py | khilawar4/airflow | 5f3f65b82517f615f31f0c8a7f8ac0facb325235 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-04-14T11:15:17.000Z | 2021-12-15T16:58:24.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.964789 | 106 | 0.656916 |
from collections import OrderedDict
from tempfile import NamedTemporaryFile
from typing import Dict, Optional
import pymssql
import unicodecsv as csv
from airflow.models import BaseOperator
from airflow.providers.apache.hive.hooks.hive import HiveCliHook
from airflow.providers.microsoft.mssql.hooks... | true | true |
1c404ef125034a509e7cc02ad5734de3ad8881d4 | 596 | py | Python | nnaps/tests/test_mesa_compress.py | vosjo/nnaps | bc4aac715b511c5df897ef24fb953ad7265927ea | [
"MIT"
] | 4 | 2020-09-24T12:55:58.000Z | 2021-05-19T14:46:10.000Z | nnaps/tests/test_mesa_compress.py | vosjo/nnaps | bc4aac715b511c5df897ef24fb953ad7265927ea | [
"MIT"
] | 4 | 2021-06-02T09:28:35.000Z | 2021-06-04T08:32:24.000Z | nnaps/tests/test_mesa_compress.py | vosjo/nnaps | bc4aac715b511c5df897ef24fb953ad7265927ea | [
"MIT"
] | 3 | 2020-10-05T13:18:27.000Z | 2021-06-02T09:29:11.000Z | import pytest
import numpy as np
from nnaps.mesa.compress_mesa import read_mesa_output
from pathlib import Path
base_path = Path(__file__).parent
class TestReadMesaOutput:
def test_read_mesa_output_new_format(self):
filename = base_path / 'test_data/history_mesa_v15140.data'
model = read_mesa... | 28.380952 | 69 | 0.704698 | import pytest
import numpy as np
from nnaps.mesa.compress_mesa import read_mesa_output
from pathlib import Path
base_path = Path(__file__).parent
class TestReadMesaOutput:
def test_read_mesa_output_new_format(self):
filename = base_path / 'test_data/history_mesa_v15140.data'
model = read_mesa... | true | true |
1c404f65d738535acb8ea84bc81dd3184b2d119e | 5,991 | py | Python | spider_scripts_20201122/download_picture.py | uvioresistant/python_tool_scripts | 4f61aaaf7955a18401091e3bd04321e588344de3 | [
"Apache-2.0"
] | null | null | null | spider_scripts_20201122/download_picture.py | uvioresistant/python_tool_scripts | 4f61aaaf7955a18401091e3bd04321e588344de3 | [
"Apache-2.0"
] | null | null | null | spider_scripts_20201122/download_picture.py | uvioresistant/python_tool_scripts | 4f61aaaf7955a18401091e3bd04321e588344de3 | [
"Apache-2.0"
] | null | null | null | import os
import requests
from time import time, sleep
from multiprocessing.pool import ThreadPool
# 发请求,写入jpg到本地
def url_response(url):
path, url = url
r = requests.get(url, stream=True)
with open(path, 'wb') as f:
for ch in r:
f.write(ch)
start = time()
if __name__ == '__main__':
... | 157.657895 | 5,246 | 0.780003 | import os
import requests
from time import time, sleep
from multiprocessing.pool import ThreadPool
def url_response(url):
path, url = url
r = requests.get(url, stream=True)
with open(path, 'wb') as f:
for ch in r:
f.write(ch)
start = time()
if __name__ == '__main__':
path = []
... | true | true |
1c404fa40746e8ead0655123648395b5752349ff | 4,363 | py | Python | examples/faster-rcnn/generate_anchors.py | rohitbhio/neon | 4fb5ff6a4b622facfb07b28da94b992159aac8cc | [
"Apache-2.0"
] | 1 | 2020-12-30T10:13:41.000Z | 2020-12-30T10:13:41.000Z | examples/faster-rcnn/generate_anchors.py | rohitbhio/neon | 4fb5ff6a4b622facfb07b28da94b992159aac8cc | [
"Apache-2.0"
] | null | null | null | examples/faster-rcnn/generate_anchors.py | rohitbhio/neon | 4fb5ff6a4b622facfb07b28da94b992159aac8cc | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
from __future__ import division
from __future__ import p... | 30.089655 | 91 | 0.556727 |
from __future__ import division
from __future__ import print_function
from builtins import range
import numpy as np
#
# >> load output/rpn_cachedir/faster_rcnn_VOC2007_ZF_stage1_rpn/anchors.mat
# >> anchors
#
# anchors =
#
# -83 -39 100 56
# -175 -87 192 104
# -359 -183 ... | true | true |
1c4050cf536e965eec609a12a6ad864299e1cdae | 597 | py | Python | datacube/index/__init__.py | agdc-research-trial/gdf | 82ed29c263eaf65f5c1fbb4e9207c99e9700b85c | [
"Apache-2.0"
] | 1 | 2015-06-01T01:31:44.000Z | 2015-06-01T01:31:44.000Z | datacube/index/__init__.py | agdc-research-trial/gdf | 82ed29c263eaf65f5c1fbb4e9207c99e9700b85c | [
"Apache-2.0"
] | null | null | null | datacube/index/__init__.py | agdc-research-trial/gdf | 82ed29c263eaf65f5c1fbb4e9207c99e9700b85c | [
"Apache-2.0"
] | null | null | null | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
"""
Modules for interfacing with the index/database.
"""
from ._api import index_connect
from .fields import UnknownFieldError
from .exceptions... | 25.956522 | 92 | 0.760469 |
from ._api import index_connect
from .fields import UnknownFieldError
from .exceptions import DuplicateRecordError, MissingRecordError, IndexSetupError
from datacube.index.abstract import AbstractIndex as Index
__all__ = [
'index_connect',
'Index',
'DuplicateRecordError',
'IndexSetupError',
'... | true | true |
1c405150879a0f0714a98304287b9c17bdd4928d | 3,872 | py | Python | Python/design-circular-queue.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | 9 | 2019-06-30T07:15:18.000Z | 2022-02-10T20:13:40.000Z | Python/design-circular-queue.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | null | null | null | Python/design-circular-queue.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | 9 | 2019-01-16T22:16:49.000Z | 2022-02-06T17:33:41.000Z | # Time: O(1)
# Space: O(k)
# Design your implementation of the circular queue.
# The circular queue is a linear data structure in which
# the operations are performed based on FIFO (First In First Out)
# principle and the last position is connected back to
# the first position to make a circle. It is also called ‘Rin... | 34.571429 | 105 | 0.647211 |
class MyCircularQueue(object):
def __init__(self, k):
self.__start = 0
self.__size = 0
self.__buffer = [0] * k
def enQueue(self, value):
if self.isFull():
return False
self.__buffer[(self.__start+self.__size) % len(sel... | true | true |
1c40516d6c979e49fd898f56797b8adbeeec9eb8 | 31 | py | Python | models/main.py | feamster/internet_video | 53a88778155e50dfdfe581d4041c64bd411a0701 | [
"MIT"
] | null | null | null | models/main.py | feamster/internet_video | 53a88778155e50dfdfe581d4041c64bd411a0701 | [
"MIT"
] | null | null | null | models/main.py | feamster/internet_video | 53a88778155e50dfdfe581d4041c64bd411a0701 | [
"MIT"
] | 1 | 2022-03-08T10:04:02.000Z | 2022-03-08T10:04:02.000Z | import os
import pandas as pd
| 7.75 | 19 | 0.774194 | import os
import pandas as pd
| true | true |
1c40523fc1f2c8fbb02985f67c895b5f8b7c6506 | 7,397 | py | Python | ci_scripts/chinese_samplecode_processor.py | zhangting2020/FluidDoc | 1a08e8aedce1e44829ae652f6c588adf61f2c2f6 | [
"Apache-2.0"
] | null | null | null | ci_scripts/chinese_samplecode_processor.py | zhangting2020/FluidDoc | 1a08e8aedce1e44829ae652f6c588adf61f2c2f6 | [
"Apache-2.0"
] | null | null | null | ci_scripts/chinese_samplecode_processor.py | zhangting2020/FluidDoc | 1a08e8aedce1e44829ae652f6c588adf61f2c2f6 | [
"Apache-2.0"
] | 1 | 2020-11-25T11:42:24.000Z | 2020-11-25T11:42:24.000Z | import math
import os
import pickle
import shutil
import subprocess
import multiprocessing
import sys
def remove_desc_code(srcls, filename):
if filename == 'fluid_cn/one_hot_cn.rst':
srcls.pop(13)
srcls.pop(28)
srcls.pop(44)
if filename == 'layers_cn/one_hot_cn.rst':
srcls.pop(... | 31.476596 | 75 | 0.55536 | import math
import os
import pickle
import shutil
import subprocess
import multiprocessing
import sys
def remove_desc_code(srcls, filename):
if filename == 'fluid_cn/one_hot_cn.rst':
srcls.pop(13)
srcls.pop(28)
srcls.pop(44)
if filename == 'layers_cn/one_hot_cn.rst':
srcls.pop(... | true | true |
1c405262bdb1dd0e3eeb6b00bc43174e6c73608a | 4,358 | py | Python | photologue/templatetags/photologue_tags.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 364 | 2015-01-03T00:06:55.000Z | 2019-03-10T20:00:11.000Z | photologue/templatetags/photologue_tags.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 79 | 2015-01-03T03:35:36.000Z | 2019-03-13T20:05:55.000Z | photologue/templatetags/photologue_tags.py | erdnaxe/django-photologue | 97768fef566cb19eb3c8454d58d9abf2e7b9f2b6 | [
"BSD-3-Clause"
] | 135 | 2015-01-09T01:36:11.000Z | 2019-03-12T02:54:59.000Z | import random
from django import template
from ..models import Gallery, Photo
register = template.Library()
@register.inclusion_tag('photologue/tags/next_in_gallery.html')
def next_in_gallery(photo, gallery):
return {'photo': photo.get_next_in_gallery(gallery)}
@register.inclusion_tag('photologue/tags/prev_i... | 33.015152 | 119 | 0.61129 | import random
from django import template
from ..models import Gallery, Photo
register = template.Library()
@register.inclusion_tag('photologue/tags/next_in_gallery.html')
def next_in_gallery(photo, gallery):
return {'photo': photo.get_next_in_gallery(gallery)}
@register.inclusion_tag('photologue/tags/prev_i... | true | true |
1c40528b610cb5e8d43e5244e7310c3a82c04fe2 | 6,169 | py | Python | examples/lm1b/unit_test/sampled_softmax_utest.py | yangkevin2/count-sketch | 164f1aaef662935043cb628421c6185b5ea6c654 | [
"Apache-2.0"
] | 109 | 2017-12-14T10:52:19.000Z | 2022-03-26T21:22:10.000Z | lm/unit_test/sampled_softmax_utest.py | JoPfeiff/PyTorch_GBW_LM | 74f180ff1cecd54f6810d139d9b816aa97abd84a | [
"Apache-2.0"
] | 15 | 2017-12-10T16:14:10.000Z | 2021-12-30T07:20:48.000Z | lm/unit_test/sampled_softmax_utest.py | JoPfeiff/PyTorch_GBW_LM | 74f180ff1cecd54f6810d139d9b816aa97abd84a | [
"Apache-2.0"
] | 19 | 2018-01-05T05:09:51.000Z | 2021-07-21T03:44:16.000Z | import unittest
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
import model
from log_uniform import LogUniformSampler
def EXPECT_NEAR(x, y, epsilon):
return np.all(abs(x - y) <= epsilon)
class ComputeSampledLogitsTest(unittest.TestCase):
def _GenerateTestData(self, num... | 41.126667 | 121 | 0.702869 | import unittest
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
import model
from log_uniform import LogUniformSampler
def EXPECT_NEAR(x, y, epsilon):
return np.all(abs(x - y) <= epsilon)
class ComputeSampledLogitsTest(unittest.TestCase):
def _GenerateTestData(self, num... | true | true |
1c405311e59e59e3362a45d3645408633424900f | 5,077 | py | Python | ipython_odoo/tracer.py | voronind/ipython-odoo | 48fcc7232beb9f7459ec1f0d7e0cf9cc41f85475 | [
"MIT"
] | null | null | null | ipython_odoo/tracer.py | voronind/ipython-odoo | 48fcc7232beb9f7459ec1f0d7e0cf9cc41f85475 | [
"MIT"
] | null | null | null | ipython_odoo/tracer.py | voronind/ipython-odoo | 48fcc7232beb9f7459ec1f0d7e0cf9cc41f85475 | [
"MIT"
] | null | null | null | import inspect
import logging
import re
import sys
from contextlib import contextmanager
from functools import wraps
from odoo.models import BaseModel
from .hierarchy import recordset_models
from functools import reduce
INTEREST_METHODS = {
'sale.order': {
'_prepare',
'search',
},
'all':... | 23.835681 | 103 | 0.572385 | import inspect
import logging
import re
import sys
from contextlib import contextmanager
from functools import wraps
from odoo.models import BaseModel
from .hierarchy import recordset_models
from functools import reduce
INTEREST_METHODS = {
'sale.order': {
'_prepare',
'search',
},
'all':... | true | true |
1c4054afc1bb7fe4eaab14ed54d92e4a4cfc8153 | 412 | py | Python | Model/Opportunity.py | AIESECMX/Vtiger_Automatization | 9edf486af70ff5e353c1ad19ffceba03ef44006c | [
"MIT"
] | null | null | null | Model/Opportunity.py | AIESECMX/Vtiger_Automatization | 9edf486af70ff5e353c1ad19ffceba03ef44006c | [
"MIT"
] | null | null | null | Model/Opportunity.py | AIESECMX/Vtiger_Automatization | 9edf486af70ff5e353c1ad19ffceba03ef44006c | [
"MIT"
] | null | null | null |
class Opportunity:
def __init__(self,expaid,title,url,programme,start_date,end_date,appsClosed,created,updated,status,lc,enabler):
self.id = expaid
self.title = title
self.url = url
self.programme = programme
self.start_date=start_date
self.end_date=end_date
self.appsClosed=appsClosed
self.created=... | 20.6 | 113 | 0.764563 |
class Opportunity:
def __init__(self,expaid,title,url,programme,start_date,end_date,appsClosed,created,updated,status,lc,enabler):
self.id = expaid
self.title = title
self.url = url
self.programme = programme
self.start_date=start_date
self.end_date=end_date
self.appsClosed=appsClosed
self.created=... | true | true |
1c4054c3a375c8595621946893894ac18fada8eb | 6,327 | py | Python | model/vaccination_preference_diagrams/model_phasediagram_numax_I0_1.py | lubo93/vaccination | 4ddaf44455e72e9fc80cee03a6021f3ee754adfe | [
"MIT"
] | null | null | null | model/vaccination_preference_diagrams/model_phasediagram_numax_I0_1.py | lubo93/vaccination | 4ddaf44455e72e9fc80cee03a6021f3ee754adfe | [
"MIT"
] | null | null | null | model/vaccination_preference_diagrams/model_phasediagram_numax_I0_1.py | lubo93/vaccination | 4ddaf44455e72e9fc80cee03a6021f3ee754adfe | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from lib.simulation import epidemic_model
from matplotlib import rcParams, colors
from matplotlib.colors import LinearSegmentedColormap
# customized settings
params = { # 'backend': 'ps',
'font.family': 'serif',
'font... | 33.654255 | 92 | 0.607871 | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from lib.simulation import epidemic_model
from matplotlib import rcParams, colors
from matplotlib.colors import LinearSegmentedColormap
params = {
'font.family': 'serif',
'font.serif': 'Latin Modern Roman',
'fon... | true | true |
1c40556aaae46f312fe9acfff59f8c7132fd844b | 8,588 | py | Python | edx_rest_framework_extensions/auth/jwt/authentication.py | openedx/edx-drf-extensions | f923f48da8a639f8037d917264057e456785a0e7 | [
"Apache-2.0"
] | null | null | null | edx_rest_framework_extensions/auth/jwt/authentication.py | openedx/edx-drf-extensions | f923f48da8a639f8037d917264057e456785a0e7 | [
"Apache-2.0"
] | 1 | 2022-02-11T14:47:15.000Z | 2022-02-11T14:47:15.000Z | edx_rest_framework_extensions/auth/jwt/authentication.py | openedx/edx-drf-extensions | f923f48da8a639f8037d917264057e456785a0e7 | [
"Apache-2.0"
] | null | null | null | """ JWT Authentication class. """
import logging
import jwt
from django.contrib.auth import get_user_model
from django.middleware.csrf import CsrfViewMiddleware
from edx_django_utils.monitoring import set_custom_attribute
from rest_framework import exceptions
from rest_framework_jwt.authentication import JSONWebToken... | 43.593909 | 175 | 0.62599 |
import logging
import jwt
from django.contrib.auth import get_user_model
from django.middleware.csrf import CsrfViewMiddleware
from edx_django_utils.monitoring import set_custom_attribute
from rest_framework import exceptions
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from edx_rest_fram... | true | true |
1c40578685ce22c8ce85a3699e7def9a9fb0953a | 2,733 | py | Python | adwords_python3_examples_10.1.0/v201802/campaign_management/graduate_trial.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201802/campaign_management/graduate_trial.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201802/campaign_management/graduate_trial.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 34.1625 | 81 | 0.72704 |
import uuid
from googleads import adwords
TRIAL_ID = 'INSERT_TRIAL_ID_HERE'
def main(client, trial_id):
trial_service = client.GetService('TrialService', version='v201802')
budget_service = client.GetService('BudgetService', version='v201802')
budget = {
'name': 'Budget... | true | true |
1c4059486f0d38f447f040822c0a5cba9f9c481d | 1,884 | py | Python | mmtbx/command_line/refine_anomalous_substructure.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/refine_anomalous_substructure.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/refine_anomalous_substructure.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null |
from __future__ import division
from libtbx.utils import Sorry
import sys
def run(args, out=sys.stdout):
from mmtbx.refinement import anomalous_scatterer_groups
import mmtbx.command_line
master_phil = mmtbx.command_line.generate_master_phil_with_inputs(
phil_string="""
map_type = *anom_residual llg
.type ... | 29.904762 | 77 | 0.771762 |
from __future__ import division
from libtbx.utils import Sorry
import sys
def run(args, out=sys.stdout):
from mmtbx.refinement import anomalous_scatterer_groups
import mmtbx.command_line
master_phil = mmtbx.command_line.generate_master_phil_with_inputs(
phil_string="""
map_type = *anom_residual llg
.type ... | true | true |
1c405a2a11e8a5b9f6437e88edb582ea0632bc95 | 9,623 | py | Python | yapf/yapflib/file_resources.py | spaceone/yapf | 633744e62187b296e2f53b97defec4ac2eb9d5a6 | [
"Apache-2.0"
] | 13,769 | 2015-03-19T20:58:55.000Z | 2022-03-31T15:03:38.000Z | yapf/yapflib/file_resources.py | spaceone/yapf | 633744e62187b296e2f53b97defec4ac2eb9d5a6 | [
"Apache-2.0"
] | 973 | 2015-03-24T22:25:15.000Z | 2022-03-23T15:40:15.000Z | yapf/yapflib/file_resources.py | spaceone/yapf | 633744e62187b296e2f53b97defec4ac2eb9d5a6 | [
"Apache-2.0"
] | 1,141 | 2015-03-25T03:05:22.000Z | 2022-03-29T11:06:37.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.731293 | 87 | 0.67401 |
import fnmatch
import os
import re
from lib2to3.pgen2 import tokenize
from yapf.yapflib import errors
from yapf.yapflib import py3compat
from yapf.yapflib import style
CR = '\r'
LF = '\n'
CRLF = '\r\n'
def _GetExcludePatternsFromYapfIgnore(filename):
ignore_patterns = []
if os.path.isfile(filenam... | true | true |
1c405a837b1eef2fd63d9d70b2f5f4c28f1ff4c1 | 417 | py | Python | django_and_bootstrap/wsgi.py | hosseinkianmehr/solar-site | 6e7995e70442efded3e7bde7cd776fa74dd74372 | [
"MIT"
] | 3 | 2021-01-19T20:12:09.000Z | 2021-11-18T10:06:45.000Z | django_and_bootstrap/wsgi.py | hosseinkianmehr/solar-site | 6e7995e70442efded3e7bde7cd776fa74dd74372 | [
"MIT"
] | null | null | null | django_and_bootstrap/wsgi.py | hosseinkianmehr/solar-site | 6e7995e70442efded3e7bde7cd776fa74dd74372 | [
"MIT"
] | null | null | null | """
WSGI config for django_and_bootstrap 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_and_bootstrap.settings')
application = get_wsgi_application()
| true | true |
1c405ac6d1316e911344504e1aea921c0e05b929 | 31,666 | py | Python | dashboard/internet_nl_dashboard/scanners/scan_internet_nl_per_account.py | platforminternetstandaarden/dashboard-internet.nl | 8b8129c67703a8ae51b441046ff5a90cf72bf537 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/scanners/scan_internet_nl_per_account.py | platforminternetstandaarden/dashboard-internet.nl | 8b8129c67703a8ae51b441046ff5a90cf72bf537 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/scanners/scan_internet_nl_per_account.py | platforminternetstandaarden/dashboard-internet.nl | 8b8129c67703a8ae51b441046ff5a90cf72bf537 | [
"Apache-2.0"
] | 1 | 2019-03-18T16:24:12.000Z | 2019-03-18T16:24:12.000Z | # SPDX-License-Identifier: Apache-2.0
import logging
from copy import copy
from datetime import datetime, timedelta
from typing import Dict, List, Union
import pytz
from actstream import action
from celery import Task, chain, group
from constance import config
from django.db import transaction
from django.db.models im... | 43.141689 | 120 | 0.703752 |
import logging
from copy import copy
from datetime import datetime, timedelta
from typing import Dict, List, Union
import pytz
from actstream import action
from celery import Task, chain, group
from constance import config
from django.db import transaction
from django.db.models import Q
from django.utils import timez... | true | true |
1c405b033cae8c0cc0e16b1317fb1fa4ee564a69 | 689 | py | Python | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="e2e_dialog",
version="0.0.1",
author="Yam",
author_email="haoshaochun@gmail.com",
description="Humanly Deeplearning NLP.",
long_description=long_description,
long_description_conte... | 25.518519 | 57 | 0.642961 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="e2e_dialog",
version="0.0.1",
author="Yam",
author_email="haoshaochun@gmail.com",
description="Humanly Deeplearning NLP.",
long_description=long_description,
long_description_conte... | true | true |
1c405c4d284bb882ab972c77fa28c815d4f98c5e | 7,476 | py | Python | lib/surface/container/images/delete.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/container/images/delete.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/container/images/delete.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 35.942308 | 80 | 0.687935 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from containerregistry.client import docker_name
from containerregistry.client.v2_2 import docker_session
from googlecloudsdk.api_lib.container.images import util
from googlecloudsdk.calliope im... | true | true |
1c405cd20bb551e5550c516adf161146b5589e2a | 2,439 | py | Python | day05_solve_puzzle1.py | olsgaard/adventofcode2019 | 1e14fd38f472cde894cbbbd7eebdd6545cd4c4ee | [
"MIT"
] | 1 | 2019-12-05T20:08:07.000Z | 2019-12-05T20:08:07.000Z | day05_solve_puzzle1.py | olsgaard/adventofcode2019 | 1e14fd38f472cde894cbbbd7eebdd6545cd4c4ee | [
"MIT"
] | null | null | null | day05_solve_puzzle1.py | olsgaard/adventofcode2019 | 1e14fd38f472cde894cbbbd7eebdd6545cd4c4ee | [
"MIT"
] | null | null | null | """
The TEST diagnostic program will run on your existing Intcode computer after a few modifications:
First, you'll need to add two new instructions:
Opcode 3 takes a single integer as input and saves it to the position given by its only parameter. For example, the instruction 3,50 would take an input value and store... | 29.743902 | 186 | 0.684297 |
def parse_opcode(opcode: int):
opcode = str(opcode).rjust(5, "0")
A,B,C = [int(i) for i in opcode[:-2]]
opcode = int(opcode[-2:])
return A,B,C, opcode
def parse_parameter(intcode, idx, mode=0):
if mode == 0:
return intcode[intcode[idx]]
elif mode == 1:
return intcode[idx]
def execute_intcode(intcode: list... | true | true |
1c405d02adb8a1818347e2c4406ab9da198e1886 | 3,666 | py | Python | actrneuro/iccm2012_preofficial_ACT-R_7/evaluate.py | Sn0wfir3/cogmods | b7a5867e2daa160148872f97a855baab1f645d39 | [
"MIT"
] | null | null | null | actrneuro/iccm2012_preofficial_ACT-R_7/evaluate.py | Sn0wfir3/cogmods | b7a5867e2daa160148872f97a855baab1f645d39 | [
"MIT"
] | 11 | 2020-05-04T09:05:29.000Z | 2021-04-08T13:22:34.000Z | actrneuro/iccm2012_preofficial_ACT-R_7/evaluate.py | Sn0wfir3/cogmods | b7a5867e2daa160148872f97a855baab1f645d39 | [
"MIT"
] | 12 | 2020-05-02T09:36:14.000Z | 2021-06-22T08:10:45.000Z | import numpy as np
import os
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib
def evaluate( output_path="./plots", filename="actr7"):
bold_table = np.zeros([13, 60])
bold_table_divider = np.zeros([13, 60])
boldfiles = [x[0] for x in os.walk("./log/bolds")]
inslen = 0
... | 21.438596 | 134 | 0.525914 | import numpy as np
import os
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib
def evaluate( output_path="./plots", filename="actr7"):
bold_table = np.zeros([13, 60])
bold_table_divider = np.zeros([13, 60])
boldfiles = [x[0] for x in os.walk("./log/bolds")]
inslen = 0
... | true | true |
1c405d6fd314843ead1df39e26c6ac5d095fc3b8 | 3,966 | py | Python | app/recipe/tests/test_tags_api.py | Ilyazv/recipe-app-api | da20425abaecb9581e78ae797bb6ce48c507c2c0 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Ilyazv/recipe-app-api | da20425abaecb9581e78ae797bb6ce48c507c2c0 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Ilyazv/recipe-app-api | da20425abaecb9581e78ae797bb6ce48c507c2c0 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class ... | 31.228346 | 71 | 0.630106 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class ... | true | true |
1c405fe0d996c7638acfe501be963e40135d26c4 | 23,498 | py | Python | MainWindow.py | Ling-fengZhang/lab_gui | 5d79298a9099bfa5f879568d40bcf68ef4604f3d | [
"MIT"
] | 1 | 2021-08-16T19:39:18.000Z | 2021-08-16T19:39:18.000Z | MainWindow.py | Ling-fengZhang/lab_gui | 5d79298a9099bfa5f879568d40bcf68ef4604f3d | [
"MIT"
] | null | null | null | MainWindow.py | Ling-fengZhang/lab_gui | 5d79298a9099bfa5f879568d40bcf68ef4604f3d | [
"MIT"
] | null | null | null | from Model.Instruments.Camera.Chameleon import Chameleon
from Utilities.Helper import settings, Helper
from Utilities.IO import IOHelper
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Widget.CoreWidget.PlotMainWindowWidget import PlotMainWindow
from Widget.CoreWidget.ImgQueueWi... | 44.503788 | 136 | 0.658013 | from Model.Instruments.Camera.Chameleon import Chameleon
from Utilities.Helper import settings, Helper
from Utilities.IO import IOHelper
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Widget.CoreWidget.PlotMainWindowWidget import PlotMainWindow
from Widget.CoreWidget.ImgQueueWi... | true | true |
1c4060f0a6d704828e53c904008845a0871b50ac | 6,079 | py | Python | tutorials/mnist_dpsgd_tutorial_eager.py | amad-person/privacy | aaf4c252a0bbfa41670ddefd3798bdf2066c0e21 | [
"Apache-2.0"
] | 2,327 | 2020-03-01T09:47:34.000Z | 2021-11-25T12:38:42.000Z | tutorials/mnist_dpsgd_tutorial_eager.py | amad-person/privacy | aaf4c252a0bbfa41670ddefd3798bdf2066c0e21 | [
"Apache-2.0"
] | 209 | 2020-03-01T17:14:12.000Z | 2021-11-08T20:35:42.000Z | tutorials/mnist_dpsgd_tutorial_eager.py | amad-person/privacy | aaf4c252a0bbfa41670ddefd3798bdf2066c0e21 | [
"Apache-2.0"
] | 686 | 2020-03-03T17:24:51.000Z | 2021-11-25T23:39:12.000Z | # Copyright 2019, The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 40.798658 | 115 | 0.696661 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp
from tensorflow_privacy... | true | true |
1c40610ba9273b3df0d4a1f6df9941104ff0555d | 6,780 | py | Python | src/python/pants/backend/python/tasks/python_binary_create.py | jakubbujny/pants | e7fe73eaa3bc196d6d976e9f362bf60b69da17b3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/python_binary_create.py | jakubbujny/pants | e7fe73eaa3bc196d6d976e9f362bf60b69da17b3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/python_binary_create.py | jakubbujny/pants | e7fe73eaa3bc196d6d976e9f362bf60b69da17b3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from pex.interpreter import PythonInterpreter
from pex.pex_builder import PEXB... | 44.900662 | 101 | 0.720944 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from pex.interpreter import PythonInterpreter
from pex.pex_builder import PEXBuilder
from pex.pex_info import PexInfo
from pants.backend.python.subsystems.python_native_code import PythonNativeCode
from pants.backend.pyt... | true | true |
1c406220f0981138b791aac6bfbd92089b0d15aa | 76 | py | Python | mtsg/__init__.py | stjude/mutspec | 59a4ccc0fcda9b041637e27d7e9f6a2135581e31 | [
"MIT"
] | 1 | 2020-12-24T19:51:35.000Z | 2020-12-24T19:51:35.000Z | mtsg/__init__.py | stjude/mtsg | 59a4ccc0fcda9b041637e27d7e9f6a2135581e31 | [
"MIT"
] | null | null | null | mtsg/__init__.py | stjude/mtsg | 59a4ccc0fcda9b041637e27d7e9f6a2135581e31 | [
"MIT"
] | 1 | 2021-02-08T14:28:24.000Z | 2021-02-08T14:28:24.000Z | from .genome_build import GenomeBuild as GenomeBuild
__version__ = "3.1.0"
| 19 | 52 | 0.789474 | from .genome_build import GenomeBuild as GenomeBuild
__version__ = "3.1.0"
| true | true |
1c40623005bf0cd4c86b7de7ff9c9b56aaf1cbb6 | 5,001 | py | Python | core/src/autogluon/core/searcher/bayesopt/datatypes/config_ext.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 4,462 | 2019-12-09T17:41:07.000Z | 2022-03-31T22:00:41.000Z | core/src/autogluon/core/searcher/bayesopt/datatypes/config_ext.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 1,408 | 2019-12-09T17:48:59.000Z | 2022-03-31T20:24:12.000Z | core/src/autogluon/core/searcher/bayesopt/datatypes/config_ext.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 623 | 2019-12-10T02:04:18.000Z | 2022-03-20T17:11:01.000Z | from typing import Tuple, Union
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
import copy
from .hp_ranges_cs import HyperparameterRanges_CS
RESOURCE_ATTR_PREFIX = 'RESOURCE_ATTR_'
class ExtendedConfiguration(object):
"""
This class facilitates handling extended configs, which consist of... | 39.070313 | 81 | 0.672665 | from typing import Tuple, Union
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
import copy
from .hp_ranges_cs import HyperparameterRanges_CS
RESOURCE_ATTR_PREFIX = 'RESOURCE_ATTR_'
class ExtendedConfiguration(object):
def __init__(
self, hp_ranges: HyperparameterRanges_CS, resour... | true | true |
1c4062b42c83812279f930cff97ab9f5922f6af2 | 809 | py | Python | poky-dunfell/scripts/pybootchartgui/pybootchartgui.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 14 | 2021-11-04T07:47:37.000Z | 2022-03-21T10:10:30.000Z | poky-dunfell/scripts/pybootchartgui/pybootchartgui.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | poky-dunfell/scripts/pybootchartgui/pybootchartgui.py | lacie-life/YoctoPi | 3412e78468a9b84da50bb1aadb12b459001a3712 | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #!/usr/bin/env python3
#
# This file is part of pybootchartgui.
# pybootchartgui is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | 33.708333 | 73 | 0.755253 |
import sys
from pybootchartgui.main import main
if __name__ == '__main__':
sys.exit(main())
| true | true |
1c4063669d8d3250519bf6dd530e291c32f9f070 | 993 | py | Python | vframe_faceless/settings/faceless_cfg.py | vframeio/vframe_faceless_plugin | 12ee7e136ac48c40df6a66db3712c497f5061d1d | [
"MIT"
] | null | null | null | vframe_faceless/settings/faceless_cfg.py | vframeio/vframe_faceless_plugin | 12ee7e136ac48c40df6a66db3712c497f5061d1d | [
"MIT"
] | null | null | null | vframe_faceless/settings/faceless_cfg.py | vframeio/vframe_faceless_plugin | 12ee7e136ac48c40df6a66db3712c497f5061d1d | [
"MIT"
] | null | null | null | #############################################################################
#
# VFRAME
# MIT License
# Copyright (c) 2020 Adam Harvey and VFRAME
# https://vframe.io
#
#############################################################################
import os
from os.path import join
from pathlib import Path
import log... | 26.131579 | 79 | 0.387714 | true | true | |
1c40636e6ad40fbe551ddf88c53868ca689268cd | 4,982 | py | Python | python-package/mlbox/model/supervised/regression/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | python-package/mlbox/model/supervised/regression/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | python-package/mlbox/model/supervised/regression/feature_selector.py | maheshkarriisb/MLBox | 2e5e8eb488531b4cdbbe202dd6f70bba0ae3bebd | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Author: Axel ARONIO DE ROMBLAY <axelderomblay@gmail.com>
# License: BSD 3 clause
import numpy as np
import pandas as pd
from sklearn.linear_model import Lasso
from sklearn.ensemble import RandomForestRegressor
import warnings
class Reg_feature_selector():
"""
Selects useful features.
S... | 30.378049 | 81 | 0.578081 |
import numpy as np
import pandas as pd
from sklearn.linear_model import Lasso
from sklearn.ensemble import RandomForestRegressor
import warnings
class Reg_feature_selector():
def __init__(self, strategy='l1', threshold=0.3):
self.strategy = strategy
self.threshold = threshold
self.__... | true | true |
1c40638402afd5e56d358484d132ec6b575a38de | 17,502 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/idlelib/MultiCall.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/idlelib/MultiCall.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/idlelib/MultiCall.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall r... | 41.671429 | 81 | 0.589361 |
import sys
import re
import tkinter
MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3;
MC_ACTIVATE=4; MC_CIRCULATE=5; MC_COLORMAP=6; MC_CONFIGURE=7;
MC_DEACTIVATE=8; MC_DESTROY=9; MC_ENTER=10; MC_EXPOSE=11; MC_FOCUSIN=12;
MC_FOCUSOUT=13; MC_GRAVITY=14; MC_LEAVE=15; MC_MAP=16; MC_MOTION=17;
MC_MOUS... | true | true |
1c4063d3b13a98ff09dc44014e9e75c826ea8dc7 | 10,871 | py | Python | tests/v1/client/test.py | Motmom/komtet-kassa-python-sdk | 56bc49f1148aaae4702abf7e978250ab98b57f47 | [
"MIT"
] | null | null | null | tests/v1/client/test.py | Motmom/komtet-kassa-python-sdk | 56bc49f1148aaae4702abf7e978250ab98b57f47 | [
"MIT"
] | null | null | null | tests/v1/client/test.py | Motmom/komtet-kassa-python-sdk | 56bc49f1148aaae4702abf7e978250ab98b57f47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from decimal import Decimal
from unittest import TestCase
from komtet_kassa_sdk.v1 import (Client, EmployeeType, Task, TaskInfo)
from ...helpers.mock import ResponseMock, ResponseListMock
from mock import patch
class TestClient(TestCase):
def setUp(self):
self.client = Client('sho... | 40.262963 | 92 | 0.458835 |
from decimal import Decimal
from unittest import TestCase
from komtet_kassa_sdk.v1 import (Client, EmployeeType, Task, TaskInfo)
from ...helpers.mock import ResponseMock, ResponseListMock
from mock import patch
class TestClient(TestCase):
def setUp(self):
self.client = Client('shop-id', 'secret-key')
... | true | true |
1c406589588a96bfb0f30855c900c12a8e8768ae | 860 | py | Python | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | # Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Author(s): Amir Safdarian <a... | 66.153846 | 108 | 0.711628 |
from domain_messages.ControlState.ControlState_Power_Setpoint import ControlStatePowerSetpointMessage | true | true |
1c4066b9c3a023a45235f50ef54de81eefaf6e3c | 288 | py | Python | apps.py | audacious-software/Passive-Data-Kit-Codebook | 84533014f6f3aaa6b7cdb1bcf095633c65c94d01 | [
"Apache-2.0"
] | null | null | null | apps.py | audacious-software/Passive-Data-Kit-Codebook | 84533014f6f3aaa6b7cdb1bcf095633c65c94d01 | [
"Apache-2.0"
] | null | null | null | apps.py | audacious-software/Passive-Data-Kit-Codebook | 84533014f6f3aaa6b7cdb1bcf095633c65c94d01 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class PassiveDataKitCodebookConfig(AppConfig):
name = 'passive_data_kit_codebook'
verbose_name = 'Passive Data Kit: Codebook'
default_auto_field = 'django.db.models.AutoField'
| 28.8 | 53 | 0.767361 |
from __future__ import unicode_literals
from django.apps import AppConfig
class PassiveDataKitCodebookConfig(AppConfig):
name = 'passive_data_kit_codebook'
verbose_name = 'Passive Data Kit: Codebook'
default_auto_field = 'django.db.models.AutoField'
| true | true |
1c4068bf10d2d520e30f6471fcec8d75bacda1dc | 2,900 | py | Python | persistent_settings.py | ryanvolz/discord_bot_utils | 4895fa351f6495bda3dd9aab7561984874b8a3d3 | [
"BSD-3-Clause"
] | null | null | null | persistent_settings.py | ryanvolz/discord_bot_utils | 4895fa351f6495bda3dd9aab7561984874b8a3d3 | [
"BSD-3-Clause"
] | null | null | null | persistent_settings.py | ryanvolz/discord_bot_utils | 4895fa351f6495bda3dd9aab7561984874b8a3d3 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2020 Ryan Volz
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
#
# The full license is in the LICENSE file, distributed with this software.
#
# SPDX-License-Identifier: BSD-3-Clause
# -----... | 31.868132 | 82 | 0.594828 |
import os
import pathlib
import ruamel.yaml
__all__ = ("yaml", "DiscordIDSettings")
yaml = ruamel.yaml.YAML(typ="safe")
yaml.default_flow_style = False
def load_persistent_settings(path):
settings = {}
if path.exists():
with open(path, "r") as f:
persistent = yaml.load(f)
... | true | true |
1c406957c4699002c219b6c7a34acd93600c681c | 28,082 | py | Python | bridgedb/strings.py | isislovecruft/bridgedb | 5ca53926d4bf32fe2cdd2ae3f2dba9e7a6f91b4e | [
"BSD-3-Clause-Clear"
] | 4 | 2016-04-18T06:30:54.000Z | 2019-07-17T14:02:45.000Z | bridgedb/strings.py | isislovecruft/bridgedb | 5ca53926d4bf32fe2cdd2ae3f2dba9e7a6f91b4e | [
"BSD-3-Clause-Clear"
] | null | null | null | bridgedb/strings.py | isislovecruft/bridgedb | 5ca53926d4bf32fe2cdd2ae3f2dba9e7a6f91b4e | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 ; test-case-name: bridgedb.test.test_strings ; -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# :copyright: (c) 2007-2017, The Tor Project, Inc.
# (c) 2013-2017, Isis Lovecruft
# (... | 49.614841 | 90 | 0.817143 |
from __future__ import unicode_literals
# 1) We don't use Python2.6, and
# honestly, all of Python2) should die.
from collections import OrderedDict
def _(text):
return text
# TRANSLATORS: Please do not translate the word "TYPE".
EMAIL_MISC_TEXT = {
0: _("""\
[This is an automated m... | true | true |
1c40697e10a1872eee7320fa943aea76e01aa80d | 7,643 | py | Python | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
try:
from pygame.transform import flip, rotate
import pygame
except ImportError:
logger.error('cannot import pygame (is it installed?)')
raise
... | 29.855469 | 80 | 0.593223 | import logging
logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
try:
from pygame.transform import flip, rotate
import pygame
except ImportError:
logger.error('cannot import pygame (is it installed?)')
raise
... | true | true |
1c406a7714bf55168d96649919c5b080acdc4ae3 | 831 | py | Python | kubernetes/test/test_batch_api.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/test/test_batch_api.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_batch_api.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 18.466667 | 105 | 0.683514 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.apis.batch_api import BatchApi
class TestBatchApi(unittest.TestCase):
def setUp(self):
self.api = kubernetes.client.apis.batch_... | true | true |
1c406c26c41e6e23b2dd752576e0d4831ac43142 | 3,211 | py | Python | mysite/settings.py | ItisMamun/pyshop | 6b101b26ab4ccec558076951c094c96bc29a5f48 | [
"Apache-2.0"
] | null | null | null | mysite/settings.py | ItisMamun/pyshop | 6b101b26ab4ccec558076951c094c96bc29a5f48 | [
"Apache-2.0"
] | null | null | null | mysite/settings.py | ItisMamun/pyshop | 6b101b26ab4ccec558076951c094c96bc29a5f48 | [
"Apache-2.0"
] | null | null | null | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 3.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# ... | 25.688 | 91 | 0.696979 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'b#s*_o(3t3ai_k(c5po@h7a=nj5#vjkd3u7ckhnx@)mi=8fn67'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c406c5b1a022519d85a101436d9324921b83015 | 985 | py | Python | users/views.py | Kowies/ToDo-web-app | 30c0555fbe73464f36fc88c5d9a1d16ac309f327 | [
"MIT"
] | null | null | null | users/views.py | Kowies/ToDo-web-app | 30c0555fbe73464f36fc88c5d9a1d16ac309f327 | [
"MIT"
] | 4 | 2021-03-19T01:07:13.000Z | 2022-02-10T13:23:35.000Z | users/views.py | Kowies/ToDo-web-app | 30c0555fbe73464f36fc88c5d9a1d16ac309f327 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.forms import UserCreationForm
def index(request):
return HttpResponseRedirect(reverse('users:login'))
def logout_... | 29.848485 | 73 | 0.698477 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.forms import UserCreationForm
def index(request):
return HttpResponseRedirect(reverse('users:login'))
def logout_... | true | true |
1c406cd8fdb1878cf53168c030b0169aa8a44417 | 117,677 | py | Python | tk_ui/admin_program.py | SuperH-0630/HGSSystem | 4bd0b18cec810df4915fea9473adbea6faea4fe2 | [
"MIT"
] | null | null | null | tk_ui/admin_program.py | SuperH-0630/HGSSystem | 4bd0b18cec810df4915fea9473adbea6faea4fe2 | [
"MIT"
] | null | null | null | tk_ui/admin_program.py | SuperH-0630/HGSSystem | 4bd0b18cec810df4915fea9473adbea6faea4fe2 | [
"MIT"
] | null | null | null | import abc
import datetime
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfilename
from math import ceil
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.axes import Axes
import numpy as np
from ... | 38.318789 | 120 | 0.591483 | import abc
import datetime
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfilename
from math import ceil
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.axes import Axes
import numpy as np
from ... | true | true |
1c406cf931317f3609f36abd4dfd161f4fc847ba | 639 | py | Python | skimage/_shared/tests/test_utils.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:36.000Z | 2020-04-03T17:29:07.000Z | skimage/_shared/tests/test_utils.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | skimage/_shared/tests/test_utils.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 3 | 2019-12-31T23:21:40.000Z | 2020-04-03T17:29:08.000Z | from skimage._shared.utils import (copy_func, assert_nD)
import numpy.testing as npt
import numpy as np
from skimage._shared import testing
def test_assert_nD():
z = np.random.random(200**2).reshape((200, 200))
x = z[10:30, 30:10]
with testing.raises(ValueError):
assert_nD(x, 2)
def test_copyfun... | 20.612903 | 56 | 0.666667 | from skimage._shared.utils import (copy_func, assert_nD)
import numpy.testing as npt
import numpy as np
from skimage._shared import testing
def test_assert_nD():
z = np.random.random(200**2).reshape((200, 200))
x = z[10:30, 30:10]
with testing.raises(ValueError):
assert_nD(x, 2)
def test_copyfun... | true | true |
1c406d0a96895fcda9da1357f0051cc734c05025 | 333 | py | Python | users/forms.py | dragonrathony/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | 1 | 2020-06-17T13:45:54.000Z | 2020-06-17T13:45:54.000Z | users/forms.py | Honey4251996/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | 11 | 2021-03-19T07:55:39.000Z | 2022-03-12T00:34:55.000Z | users/forms.py | Honey4251996/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | null | null | null | from django import forms
class ProfileForm(forms.Form):
email = forms.CharField(max_length=100)
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100)
profile_image = forms.ImageField()
user_name = forms.CharField(max_length=100)
zip_code = forms.CharField(max... | 30.272727 | 48 | 0.750751 | from django import forms
class ProfileForm(forms.Form):
email = forms.CharField(max_length=100)
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100)
profile_image = forms.ImageField()
user_name = forms.CharField(max_length=100)
zip_code = forms.CharField(max... | true | true |
1c406d4a1cdf5e6d65955028d98693bacd126ff5 | 873 | py | Python | tools/validate-yaml.py | larsks/wh-test-repo | 8c6d38db4229073d64de7536fe0edb005f053647 | [
"Apache-2.0"
] | 44 | 2015-01-03T10:07:39.000Z | 2021-07-22T05:35:04.000Z | tools/validate-yaml.py | larsks/wh-test-repo | 8c6d38db4229073d64de7536fe0edb005f053647 | [
"Apache-2.0"
] | 10 | 2015-02-10T04:55:44.000Z | 2016-04-28T15:08:16.000Z | tools/validate-yaml.py | larsks/wh-test-repo | 8c6d38db4229073d64de7536fe0edb005f053647 | [
"Apache-2.0"
] | 31 | 2015-01-05T05:38:58.000Z | 2019-11-08T16:05:02.000Z | #!/usr/bin/python
import sys
import argparse
import yaml
import logging
def parse_args():
p = argparse.ArgumentParser()
p.add_argument('--verbose', '-v',
action='store_const',
const='INFO',
dest='loglevel')
p.add_argument('input', nargs='*')
p.... | 22.384615 | 52 | 0.532646 |
import sys
import argparse
import yaml
import logging
def parse_args():
p = argparse.ArgumentParser()
p.add_argument('--verbose', '-v',
action='store_const',
const='INFO',
dest='loglevel')
p.add_argument('input', nargs='*')
p.set_defaults(logl... | true | true |
1c406dcbf96d4f7d8fec9c9c3fac3b11057f2d2c | 552 | py | Python | dashboard/internet_nl_dashboard/logic/account.py | bslavin/Internet.nl-dashboard | 5fd6d8fe8edb5f181727ddd1729697d9fc586c29 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/logic/account.py | bslavin/Internet.nl-dashboard | 5fd6d8fe8edb5f181727ddd1729697d9fc586c29 | [
"Apache-2.0"
] | null | null | null | dashboard/internet_nl_dashboard/logic/account.py | bslavin/Internet.nl-dashboard | 5fd6d8fe8edb5f181727ddd1729697d9fc586c29 | [
"Apache-2.0"
] | null | null | null | import logging
from dashboard.internet_nl_dashboard.logic import operation_response
log = logging.getLogger(__package__)
def save_report_settings(account, report_settings):
account.report_settings = report_settings.get('filters', {})
account.save()
return operation_response(success=True, message="setti... | 26.285714 | 71 | 0.762681 | import logging
from dashboard.internet_nl_dashboard.logic import operation_response
log = logging.getLogger(__package__)
def save_report_settings(account, report_settings):
account.report_settings = report_settings.get('filters', {})
account.save()
return operation_response(success=True, message="setti... | true | true |
1c406e877ea7a560462b026bd111e0a32e55ae7f | 683 | py | Python | model/process_selfie_data.py | imdeepmind/AgeGenderNetwork | 845a8b8f15aa9ce1ae6ff55f8f3ca9213d490323 | [
"MIT"
] | 1 | 2019-10-14T15:18:05.000Z | 2019-10-14T15:18:05.000Z | model/process_selfie_data.py | imdeepmind/AgeGenderNetwork | 845a8b8f15aa9ce1ae6ff55f8f3ca9213d490323 | [
"MIT"
] | null | null | null | model/process_selfie_data.py | imdeepmind/AgeGenderNetwork | 845a8b8f15aa9ce1ae6ff55f8f3ca9213d490323 | [
"MIT"
] | null | null | null | ## IMPORTING THE DEPENDENCIES
import pandas as pd
import numpy as np
selfie_data = './dataset/unprocessed/Selfie-dataset/selfie_dataset.txt'
file = open(selfie_data, 'r')
selfie_file = file.read()
selfie_file_lines = selfie_file.split('\n')
un_selfie_data = []
for selfie in selfie_file_lines:
temp = selfie.split... | 27.32 | 117 | 0.708638 | numpy as np
selfie_data = './dataset/unprocessed/Selfie-dataset/selfie_dataset.txt'
file = open(selfie_data, 'r')
selfie_file = file.read()
selfie_file_lines = selfie_file.split('\n')
un_selfie_data = []
for selfie in selfie_file_lines:
temp = selfie.split(' ')
if len(temp) > 3:
un_selfie_data.append... | true | true |
1c406ead37561eefa4f97040eed189818c389e87 | 12,958 | py | Python | pymodbus/register_read_message.py | CS536-Modbus-QUIC/pymodbus | 337d090f04922c9440913927593f26cd9388b141 | [
"BSD-3-Clause"
] | 1,125 | 2017-05-11T06:11:36.000Z | 2022-03-31T02:59:45.000Z | pymodbus/register_read_message.py | Fannxy/pymodbus | c5772b35ae3f29d1947f3ab453d8d00df846459f | [
"BSD-3-Clause"
] | 575 | 2017-05-12T02:46:55.000Z | 2022-03-31T16:00:33.000Z | pymodbus/register_read_message.py | Fannxy/pymodbus | c5772b35ae3f29d1947f3ab453d8d00df846459f | [
"BSD-3-Clause"
] | 516 | 2017-05-19T14:06:06.000Z | 2022-03-31T06:10:13.000Z | '''
Register Reading Request/Response
---------------------------------
'''
import struct
from pymodbus.pdu import ModbusRequest
from pymodbus.pdu import ModbusResponse
from pymodbus.pdu import ModbusExceptions as merror
from pymodbus.compat import int2byte, byte2int
class ReadRegistersRequestBase(ModbusRequest):
... | 35.994444 | 81 | 0.643927 | import struct
from pymodbus.pdu import ModbusRequest
from pymodbus.pdu import ModbusResponse
from pymodbus.pdu import ModbusExceptions as merror
from pymodbus.compat import int2byte, byte2int
class ReadRegistersRequestBase(ModbusRequest):
_rtu_frame_size = 8
def __init__(self, address, count, **kwargs):
... | true | true |
1c406f0f0c0ad9459cb2bf63128af200f42bf7f9 | 3,480 | py | Python | vilbert/datasets/__init__.py | ThierryDeruyttere/vilbert-Talk2car | 6476b16970cfd0d88e09beb9a57cc5c39b7acb3f | [
"MIT"
] | null | null | null | vilbert/datasets/__init__.py | ThierryDeruyttere/vilbert-Talk2car | 6476b16970cfd0d88e09beb9a57cc5c39b7acb3f | [
"MIT"
] | null | null | null | vilbert/datasets/__init__.py | ThierryDeruyttere/vilbert-Talk2car | 6476b16970cfd0d88e09beb9a57cc5c39b7acb3f | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .concept_cap_dataset import (
ConceptCapLoaderTrain,
ConceptCapLoaderVal,
ConceptCapLoaderRetrieval,
)
from .foil_dataset impo... | 35.510204 | 94 | 0.786207 |
from .concept_cap_dataset import (
ConceptCapLoaderTrain,
ConceptCapLoaderVal,
ConceptCapLoaderRetrieval,
)
from .foil_dataset import FoilClassificationDataset
from .vqa_dataset import VQAClassificationDataset
from .vqa_mc_dataset import VQAMultipleChoiceDataset
from .nlvr2_dataset import NLVR2Dataset
... | true | true |
1c406f6be4a4ca2aa5169e352c87433ba660e116 | 676 | py | Python | zksync/config/logger_config.py | zksync-sdk/schnorr-musig-sdk-python | e853b1fc54fcff1c896a6aaac44b0c72dd393a01 | [
"MIT"
] | 1 | 2021-05-19T10:05:37.000Z | 2021-05-19T10:05:37.000Z | zksync/config/logger_config.py | zksync-sdk/schnorr-musig-sdk-python | e853b1fc54fcff1c896a6aaac44b0c72dd393a01 | [
"MIT"
] | 2 | 2021-03-10T12:38:40.000Z | 2021-05-21T10:28:11.000Z | zksync/config/logger_config.py | zksync-sdk/schnorr-musig-sdk-python | e853b1fc54fcff1c896a6aaac44b0c72dd393a01 | [
"MIT"
] | 1 | 2021-05-19T10:05:38.000Z | 2021-05-19T10:05:38.000Z | import yaml
import importlib.resources as pkg_resources
class LoggerConfig:
@staticmethod
def console(verbosity: int = 0) -> dict:
stream = pkg_resources.open_binary('zksync.config', 'console.yaml')
config = yaml.load(stream, Loader=yaml.FullLoader)
config['loggers']['zksync']['level'] = LoggerConfig.... | 33.8 | 74 | 0.692308 | import yaml
import importlib.resources as pkg_resources
class LoggerConfig:
@staticmethod
def console(verbosity: int = 0) -> dict:
stream = pkg_resources.open_binary('zksync.config', 'console.yaml')
config = yaml.load(stream, Loader=yaml.FullLoader)
config['loggers']['zksync']['level'] = LoggerConfig.... | true | true |
1c4070163b75d709b4de010864facb377cc8db96 | 875 | py | Python | app/my_blueprint/models.py | katherinejackson/embedded-time-series-study | 353ee2c6743d45df15951ddf13f87257948b9400 | [
"MIT"
] | null | null | null | app/my_blueprint/models.py | katherinejackson/embedded-time-series-study | 353ee2c6743d45df15951ddf13f87257948b9400 | [
"MIT"
] | null | null | null | app/my_blueprint/models.py | katherinejackson/embedded-time-series-study | 353ee2c6743d45df15951ddf13f87257948b9400 | [
"MIT"
] | null | null | null | def create(db):
class timemap(db.Model):
__tablename__ = "timemapV01"
ID = db.Column(db.Integer, primary_key=True, autoincrement=True)
participantID = db.Column(db.Integer, db.ForeignKey('participant.participantID'))
answeredOn = db.Column(db.DateTime, nullable=False, default=db.func... | 41.666667 | 89 | 0.64 | def create(db):
class timemap(db.Model):
__tablename__ = "timemapV01"
ID = db.Column(db.Integer, primary_key=True, autoincrement=True)
participantID = db.Column(db.Integer, db.ForeignKey('participant.participantID'))
answeredOn = db.Column(db.DateTime, nullable=False, default=db.func... | true | true |
1c40708cbda6e90df51ff794b98e99f4ef7798d5 | 4,583 | py | Python | gui/qt/contact_list.py | handsomegui/electrum | 5e8c710c71318c9a7c275e0d9444322313ad36b2 | [
"MIT"
] | 2 | 2018-08-14T17:34:23.000Z | 2018-08-28T06:47:33.000Z | gui/qt/contact_list.py | handsomegui/electrum | 5e8c710c71318c9a7c275e0d9444322313ad36b2 | [
"MIT"
] | null | null | null | gui/qt/contact_list.py | handsomegui/electrum | 5e8c710c71318c9a7c275e0d9444322313ad36b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 43.647619 | 119 | 0.676631 |
import webbrowser
from electroncash.i18n import _
import electroncash.web as web
from electroncash.address import Address
from electroncash.plugins import run_hook
from electroncash.util import FileImportFailed
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import (
... | true | true |
1c407144dc5b30a3c147d792ef3b1d5e7cb38638 | 8,415 | py | Python | docs/examples/Metrics.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | docs/examples/Metrics.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | docs/examples/Metrics.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
Metrics Example
===============
This example is going to look at metrics, and how they can be used to assess algorithm performance.
"""
# %%
# Building a Simple Simulation and Tracker
# ----------------------------------------
# For simplicity, we are going to quickly build a... | 38.424658 | 99 | 0.746643 |
import datetime
import numpy as np
import matplotlib.pyplot as plt
from stonesoup.dataassociator.neighbour import GNNWith2DAssignment
from stonesoup.deleter.error import CovarianceBasedDeleter
from stonesoup.hypothesiser.distance import DistanceHypothesiser
from stonesoup.initiator.simple import MultiMeasur... | true | true |
1c40714fabd2d717595b36f1580b9b068d5c55e6 | 947 | py | Python | adapters/heiman/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | adapters/heiman/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | adapters/heiman/__init__.py | cocooma/domoticz-zigbee2mqtt-plugin | 97b025beaff6b68f4f92dd434c6dda63f53efdd8 | [
"MIT"
] | null | null | null | from adapters.contact_adapter import ContactAdapter
from adapters.generic.smoke_sensor import SmokeSensorAdapter
from adapters.generic.water_leak_sensor import WaterLeakSensorAdapter
from adapters.heiman.HS1CAE import HS1CAE
from adapters.heiman.HS1WLE import HS1WLE
from adapters.heiman.HS2SK import HS2SK
heiman_adap... | 47.35 | 90 | 0.691658 | from adapters.contact_adapter import ContactAdapter
from adapters.generic.smoke_sensor import SmokeSensorAdapter
from adapters.generic.water_leak_sensor import WaterLeakSensorAdapter
from adapters.heiman.HS1CAE import HS1CAE
from adapters.heiman.HS1WLE import HS1WLE
from adapters.heiman.HS2SK import HS2SK
heiman_adap... | true | true |
1c4072ac7511fa7966efacb5742ad5215651220c | 601 | py | Python | mathgenerator/funcs/compareFractionsFunc.py | anshitabaid/mathgenerator | d95dd5e29c76561b35d5d18ab249d237d7a927e2 | [
"MIT"
] | null | null | null | mathgenerator/funcs/compareFractionsFunc.py | anshitabaid/mathgenerator | d95dd5e29c76561b35d5d18ab249d237d7a927e2 | [
"MIT"
] | null | null | null | mathgenerator/funcs/compareFractionsFunc.py | anshitabaid/mathgenerator | d95dd5e29c76561b35d5d18ab249d237d7a927e2 | [
"MIT"
] | null | null | null | from .__init__ import *
def compareFractionsFunc(maxVal=10):
a = random.randint(1, maxVal)
b = random.randint(1, maxVal)
c = random.randint(1, maxVal)
d = random.randint(1, maxVal)
while (a == b):
b = random.randint(1, maxVal)
while (c == d):
d = random.randint(1, maxVal)
... | 22.259259 | 84 | 0.560732 | from .__init__ import *
def compareFractionsFunc(maxVal=10):
a = random.randint(1, maxVal)
b = random.randint(1, maxVal)
c = random.randint(1, maxVal)
d = random.randint(1, maxVal)
while (a == b):
b = random.randint(1, maxVal)
while (c == d):
d = random.randint(1, maxVal)
... | true | true |
1c407324ce288a1acf26a863eb26d2ce2206c673 | 25,089 | py | Python | lib/sqlalchemy/util/_collections.py | vishvananda/sqlalchemy | 762f41502384f8fcdc07b4c492738e32d4071160 | [
"MIT"
] | 8 | 2017-07-18T18:35:10.000Z | 2022-02-01T19:52:57.000Z | lib/sqlalchemy/util/_collections.py | RetailArchitects/sqlalchemy | 399a5c96b2fd0e0f2f0cdda7766b31e37454eb2e | [
"MIT"
] | null | null | null | lib/sqlalchemy/util/_collections.py | RetailArchitects/sqlalchemy | 399a5c96b2fd0e0f2f0cdda7766b31e37454eb2e | [
"MIT"
] | 6 | 2017-07-26T08:51:10.000Z | 2021-03-04T10:16:37.000Z | # util/_collections.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Collection classes and helpers."""
import sys
import itertools
import weakref... | 27.692053 | 97 | 0.599466 |
import sys
import itertools
import weakref
import operator
from langhelpers import symbol
from compat import time_func, threading
EMPTY_SET = frozenset()
class NamedTuple(tuple):
def __new__(cls, vals, labels=None):
t = tuple.__new__(cls, vals)
if labels:
t.__dict__.update(zip... | true | true |
1c40732d6dfeb4b553373661f07fac7e1d87c994 | 681 | py | Python | report/bombing.py | Yagg/gran | 37cf8abab765224427fb06535c5211d824ade711 | [
"MIT"
] | null | null | null | report/bombing.py | Yagg/gran | 37cf8abab765224427fb06535c5211d824ade711 | [
"MIT"
] | null | null | null | report/bombing.py | Yagg/gran | 37cf8abab765224427fb06535c5211d824ade711 | [
"MIT"
] | null | null | null | # -*- coding: utf_8 -*-
__author__ = 'Yagg'
class Bombing:
def __init__(self, attackerName, defenderName, planetNum, planetName, population, industry, production, capitals,
materials, colonists, attackStrength, status):
self.attackerName = attackerName
self.defenderName = defenderN... | 34.05 | 117 | 0.662261 |
__author__ = 'Yagg'
class Bombing:
def __init__(self, attackerName, defenderName, planetNum, planetName, population, industry, production, capitals,
materials, colonists, attackStrength, status):
self.attackerName = attackerName
self.defenderName = defenderName
self.planet... | true | true |
1c407462bbdaa26d432e1590a93ca57d9afdd86b | 1,938 | py | Python | libs/functional.py | fan84sunny/2021-training-courses | b1327d572563b3928e740d92d2cf202315096093 | [
"MIT"
] | null | null | null | libs/functional.py | fan84sunny/2021-training-courses | b1327d572563b3928e740d92d2cf202315096093 | [
"MIT"
] | null | null | null | libs/functional.py | fan84sunny/2021-training-courses | b1327d572563b3928e740d92d2cf202315096093 | [
"MIT"
] | null | null | null | from typing import List, Union, Tuple
import numpy as np
class Variable:
def __init__(self, value=None):
self.value = value
self.grad = None
class Polynomial:
def __init__(self, a: List = None):
self.a = np.array(a)
def __call__(self, x: Union[float, int]) -> Variable:
... | 28.925373 | 114 | 0.567595 | from typing import List, Union, Tuple
import numpy as np
class Variable:
def __init__(self, value=None):
self.value = value
self.grad = None
class Polynomial:
def __init__(self, a: List = None):
self.a = np.array(a)
def __call__(self, x: Union[float, int]) -> Variable:
... | true | true |
1c4075292667381a58b69acdd7965c603d6dc88e | 6,850 | py | Python | src/python3/request/calendar_groups_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | 7 | 2019-07-17T06:59:53.000Z | 2021-05-13T15:23:37.000Z | src/python3/request/calendar_groups_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | null | null | null | src/python3/request/calendar_groups_collection.py | microsoftarchive/msgraph-sdk-python | 1320ba9116be0d00a1d7fce3484ea979e24ee82d | [
"MIT"
] | 2 | 2020-06-30T13:06:59.000Z | 2021-06-03T09:47:35.000Z | # -*- coding: utf-8 -*-
"""
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
"""
from __future__ import unicode_literals
from ..collection_base impo... | 41.26506 | 151 | 0.676204 |
from __future__ import unicode_literals
from ..collection_base import CollectionRequestBase, CollectionResponseBase, CollectionPageBase
from ..request_builder_base import RequestBuilderBase
from ..request import calendar_group_request_builder
from ..model.calendar_group import CalendarGroup
import json
import asynci... | true | true |
1c4076133d2531bdb57097d627ff8fbc5b0dfd03 | 5,555 | py | Python | anyway/widgets/suburban_widgets/motorcycle_accidents_vs_all_accidents_widget.py | shaysw/anyway | 35dec531fd4ac79c99d09e684027df017e989ddc | [
"MIT"
] | null | null | null | anyway/widgets/suburban_widgets/motorcycle_accidents_vs_all_accidents_widget.py | shaysw/anyway | 35dec531fd4ac79c99d09e684027df017e989ddc | [
"MIT"
] | null | null | null | anyway/widgets/suburban_widgets/motorcycle_accidents_vs_all_accidents_widget.py | shaysw/anyway | 35dec531fd4ac79c99d09e684027df017e989ddc | [
"MIT"
] | null | null | null | import datetime
from typing import List
import pandas as pd
from sqlalchemy import case, literal_column, func, distinct, desc
from anyway.request_params import RequestParams
from anyway.backend_constants import BE_CONST, AccidentSeverity
from anyway.widgets.widget_utils import get_query
from anyway.models im... | 39.678571 | 156 | 0.59586 | import datetime
from typing import List
import pandas as pd
from sqlalchemy import case, literal_column, func, distinct, desc
from anyway.request_params import RequestParams
from anyway.backend_constants import BE_CONST, AccidentSeverity
from anyway.widgets.widget_utils import get_query
from anyway.models im... | true | true |
1c40763425a3dd4fa423267ce2489d4f3864d171 | 10,271 | py | Python | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
"""Recipe for training a classifier using the
mobvoihotwords Dataset.
To run this recipe, use the following command:
> python train.py {hyperparameter_file}
Using your own hyperparameter file or one of the following:
hyperparams/xvect.yaml (xvector system)
"""
import os
import sys
import torch... | 33.565359 | 80 | 0.634115 |
import os
import sys
import torch
import torchaudio
import speechbrain as sb
from hyperpyyaml import load_hyperpyyaml
from speechbrain.utils.distributed import run_on_main
from sklearn.metrics import confusion_matrix
import numpy as np
label_list = []
output_list = []
global output_array
global label_array
output_ar... | true | true |
1c407682bc1aa17b328c6916ee6337b8b41d7e77 | 40,315 | py | Python | tests/test_date_parser.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_date_parser.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_date_parser.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import unittest
from datetime import datetime, timedelta
from functools import wraps
from operator import attrgetter
import six
from mock import patch, Mock
from nose_parameterized import parameterized, param
import dateparser.timezone_parser
from dateparser.da... | 51.685897 | 126 | 0.627781 |
from __future__ import unicode_literals
import unittest
from datetime import datetime, timedelta
from functools import wraps
from operator import attrgetter
import six
from mock import patch, Mock
from nose_parameterized import parameterized, param
import dateparser.timezone_parser
from dateparser.date import DateD... | true | true |
1c4076c85e14c5bd3849ea13543d080b510e08e1 | 12,264 | py | Python | mars/services/task/tests/test_service.py | qinxuye/mars | 3b10fd4b40fbaf1526c179709fdbcc3a1f899ab7 | [
"Apache-2.0"
] | null | null | null | mars/services/task/tests/test_service.py | qinxuye/mars | 3b10fd4b40fbaf1526c179709fdbcc3a1f899ab7 | [
"Apache-2.0"
] | null | null | null | mars/services/task/tests/test_service.py | qinxuye/mars | 3b10fd4b40fbaf1526c179709fdbcc3a1f899ab7 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 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... | 32.020888 | 103 | 0.679713 |
import asyncio
import time
import numpy as np
import pytest
import mars.oscar as mo
import mars.remote as mr
from mars.core import TileableGraph, TileableGraphBuilder
from mars.core.context import get_context
from mars.services import start_services, NodeRole
from mars.services.session import SessionAPI... | true | true |
1c4076e540d68a9547420103d4ad6383ba1ec3cc | 2,384 | py | Python | server/workers/base/src/base.py | dasch124/Headstart | 9eb37ce458a24fd42b22f2aa15c53ac46a69f9bf | [
"MIT"
] | 111 | 2016-12-10T17:27:46.000Z | 2022-03-29T02:57:19.000Z | server/workers/base/src/base.py | dasch124/Headstart | 9eb37ce458a24fd42b22f2aa15c53ac46a69f9bf | [
"MIT"
] | 338 | 2016-12-04T17:43:28.000Z | 2022-03-04T15:50:33.000Z | server/workers/base/src/base.py | dasch124/Headstart | 9eb37ce458a24fd42b22f2aa15c53ac46a69f9bf | [
"MIT"
] | 32 | 2016-12-19T12:48:00.000Z | 2022-02-12T17:47:47.000Z | import json
import subprocess
import pandas as pd
import logging
from common.r_wrapper import RWrapper
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
class BaseClient(RWrapper):
def next_item(self):
queue, msg = se... | 36.676923 | 111 | 0.518876 | import json
import subprocess
import pandas as pd
import logging
from common.r_wrapper import RWrapper
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
class BaseClient(RWrapper):
def next_item(self):
queue, msg = se... | true | true |
1c4076e641e754b295b1a76ea44a40f0f9c23f5f | 10,843 | py | Python | google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.55082 | 101 | 0.647883 |
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import pkg_resources
import google.auth
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_... | true | true |
1c4076f88b85fdfb5685a007425e937b013824ff | 2,019 | py | Python | api/src/rapidapi/nutritionix.py | carlotacb/foodlord | 3e2379e47ea31474f4a18c2e5904980a34165ae6 | [
"MIT"
] | 8 | 2019-02-23T18:48:33.000Z | 2020-01-14T11:48:33.000Z | api/src/rapidapi/nutritionix.py | andreugallofre/foodlord | 3e2379e47ea31474f4a18c2e5904980a34165ae6 | [
"MIT"
] | null | null | null | api/src/rapidapi/nutritionix.py | andreugallofre/foodlord | 3e2379e47ea31474f4a18c2e5904980a34165ae6 | [
"MIT"
] | 3 | 2019-02-24T20:27:42.000Z | 2019-02-27T11:36:28.000Z | import requests
import os
from src import *
from src.util import log
def __api_request(ingredient):
data = {
'appId': 'cd730bdb',
'appKey': '0555561b71a1ebfa3479c8fd1d966b8c',
'prhase': ingredient,
'fields': ['item_name', 'brand_name', 'nf_calories'],
'filters': {
... | 26.565789 | 82 | 0.607727 | import requests
import os
from src import *
from src.util import log
def __api_request(ingredient):
data = {
'appId': 'cd730bdb',
'appKey': '0555561b71a1ebfa3479c8fd1d966b8c',
'prhase': ingredient,
'fields': ['item_name', 'brand_name', 'nf_calories'],
'filters': {
... | true | true |
1c40787ba009b629beac95a38d431fdc2146936a | 3,040 | py | Python | test/unit/test_azure_blob_remove_public_access.py | kshrutik/secure-state-remediation-jobs | dc0a5acc3a74dd70d0b18e448124761a8481990d | [
"Apache-2.0"
] | 13 | 2020-08-07T17:48:19.000Z | 2022-02-17T17:17:04.000Z | test/unit/test_azure_blob_remove_public_access.py | kshrutik/secure-state-remediation-jobs | dc0a5acc3a74dd70d0b18e448124761a8481990d | [
"Apache-2.0"
] | 27 | 2020-08-19T18:42:44.000Z | 2021-10-04T05:35:05.000Z | test/unit/test_azure_blob_remove_public_access.py | kshrutik/secure-state-remediation-jobs | dc0a5acc3a74dd70d0b18e448124761a8481990d | [
"Apache-2.0"
] | 23 | 2020-08-12T13:09:08.000Z | 2021-09-16T11:59:17.000Z | # Copyright (c) 2020 VMware Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 44.057971 | 654 | 0.684539 |
import pytest
from mock import Mock
from remediation_worker.jobs.azure_blob_remove_public_access.azure_blob_remove_public_access import (
StorageBlobRemovePublicAccess,
)
@pytest.fixture
def valid_payload():
return """
{
"notificationInfo": {
"RuleId": "5c6cc5e103dcc90f363146cd",
... | true | true |
1c4078f5eb934c119808576ac595981540e733de | 4,134 | py | Python | test_project/test_app/views.py | mblayman/django-test-plus | 691ce7bcb2e4c31cb0958a53548f49277d9305c2 | [
"BSD-3-Clause"
] | 530 | 2015-05-23T18:25:39.000Z | 2022-03-20T14:30:10.000Z | test_project/test_app/views.py | mblayman/django-test-plus | 691ce7bcb2e4c31cb0958a53548f49277d9305c2 | [
"BSD-3-Clause"
] | 144 | 2015-05-27T04:09:15.000Z | 2021-11-24T15:32:08.000Z | test_project/test_app/views.py | mblayman/django-test-plus | 691ce7bcb2e4c31cb0958a53548f49277d9305c2 | [
"BSD-3-Clause"
] | 62 | 2015-05-27T02:47:19.000Z | 2022-02-11T21:01:36.000Z | import json
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseGone
from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views import generic
from .forms import DataForm, NameForm
from .models import Dat... | 21.989362 | 112 | 0.688195 | import json
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseGone
from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views import generic
from .forms import DataForm, NameForm
from .models import Dat... | true | true |
1c407a36b89b5ec80b8a9ce3e8a4466d21e5f77d | 5,390 | py | Python | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_igw_info.py | ginigangadharan/ansible-real-life | 897c2fc0d05babbb540768b336b6ad399dad5bfa | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_igw_info.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | null | null | null | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_igw_info.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 32.666667 | 130 | 0.62987 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: ec2_vpc_igw_info
short_description: Gather information ... | true | true |
1c407a6298b4da99045109389a17c51b109e624a | 38,694 | py | Python | test/functional/test_framework/messages.py | AtomicLemon/bitcoinflex | fe02bd48be01e08a047ef8d5821eb247a0681306 | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | AtomicLemon/bitcoinflex | fe02bd48be01e08a047ef8d5821eb247a0681306 | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | AtomicLemon/bitcoinflex | fe02bd48be01e08a047ef8d5821eb247a0681306 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 29.447489 | 262 | 0.596527 |
from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70914
MY_SUBVERSION = b"... | true | true |
1c407a8836fca2986284f537934f9013606eda28 | 5,204 | py | Python | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | null | null | null | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | null | null | null | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | 1 | 2021-02-23T21:13:47.000Z | 2021-02-23T21:13:47.000Z | import os
import codecs
import re
import logging
lg = logging.getLogger('schemaparser')
LANG_NAME="Python"
MODULE_TEMPLATE = """
{license}
from pymei import MeiElement
{classes}
"""
MODULE_CLASS_TEMPLATE = """
class {className}_(MeiElement):
def __init__(self):
MeiElement.__init__(self, "{className}")
... | 32.525 | 101 | 0.637779 | import os
import codecs
import re
import logging
lg = logging.getLogger('schemaparser')
LANG_NAME="Python"
MODULE_TEMPLATE = """
{license}
from pymei import MeiElement
{classes}
"""
MODULE_CLASS_TEMPLATE = """
class {className}_(MeiElement):
def __init__(self):
MeiElement.__init__(self, "{className}")
... | true | true |
1c407a8ac254ac8c2d539df2d33986b39bdb8715 | 1,712 | py | Python | Testing_ProjectBudgetTracker/budget/tests/test_models.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | null | null | null | Testing_ProjectBudgetTracker/budget/tests/test_models.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | 40 | 2020-06-05T22:10:58.000Z | 2022-03-11T23:56:09.000Z | Testing_ProjectBudgetTracker/budget/tests/test_models.py | muhammad-mamdouh/Django_Projects | 1f31e12aefb36b33474256db40a2c551882f445e | [
"MIT"
] | 1 | 2021-03-31T10:30:03.000Z | 2021-03-31T10:30:03.000Z | from django.test import TestCase
from budget.models import Project, Category, Expense
class TestModels(TestCase):
def setUp(self):
self.project1 = Project.objects.create(
name='Project 1',
budget=10000
)
def test_project... | 28.533333 | 62 | 0.525701 | from django.test import TestCase
from budget.models import Project, Category, Expense
class TestModels(TestCase):
def setUp(self):
self.project1 = Project.objects.create(
name='Project 1',
budget=10000
)
def test_project... | true | true |
1c407aeb8ee9b73aa7dbc86d2f813d0c87ff8533 | 14,005 | py | Python | deepstate.py | simonkamronn/deepstate | 74878840c609dd92fd5410e1db111c834b68f357 | [
"MIT"
] | 4 | 2019-01-24T02:54:14.000Z | 2020-08-10T07:46:38.000Z | deepstate.py | simonkamronn/deepstate | 74878840c609dd92fd5410e1db111c834b68f357 | [
"MIT"
] | null | null | null | deepstate.py | simonkamronn/deepstate | 74878840c609dd92fd5410e1db111c834b68f357 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.contrib.eager.python import tfe
import tensorflow_probability as tfp
from tensorflow.keras import layers
import numpy as np
import argparse
import sys
from collections import namedtuple
parameter_class = namedtuple('parameters', ['A', 'C', 'Q', 'R', 'mu', 'sigma'])
class Deep... | 40.830904 | 113 | 0.605212 | import tensorflow as tf
from tensorflow.contrib.eager.python import tfe
import tensorflow_probability as tfp
from tensorflow.keras import layers
import numpy as np
import argparse
import sys
from collections import namedtuple
parameter_class = namedtuple('parameters', ['A', 'C', 'Q', 'R', 'mu', 'sigma'])
class Deep... | true | true |
1c407bbd2f4997e15c6bca7ec590bb3cc0644317 | 715 | py | Python | config.py | obewas/NewsAPI | 3fe0e6fbeafaa8c0529615a522b045c9bc37eb11 | [
"MIT"
] | null | null | null | config.py | obewas/NewsAPI | 3fe0e6fbeafaa8c0529615a522b045c9bc37eb11 | [
"MIT"
] | null | null | null | config.py | obewas/NewsAPI | 3fe0e6fbeafaa8c0529615a522b045c9bc37eb11 | [
"MIT"
] | null | null | null | import os
class Config:
'''
General configuration parent class
'''
NEWS_API_BASE_URL = 'https://newsapi.org/v2/{}?country=us&apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
class ProdConfig(Config):
'''
Production configuration child... | 21.029412 | 82 | 0.671329 | import os
class Config:
NEWS_API_BASE_URL = 'https://newsapi.org/v2/{}?country=us&apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
class ProdConfig(Config):
pass
class DevConfig(Config):
DEBUG = True
config_options = {
'development': DevCon... | true | true |
1c407c0f6a7b1df4c6df422c3b722b8f4efddb0d | 4,336 | py | Python | Peasy+Box2dshapes2Phaser.py | kobitoko/peasy2phaser | 41202a0b7b7949fa1237b1a0e2ef536bff9bc576 | [
"Unlicense"
] | null | null | null | Peasy+Box2dshapes2Phaser.py | kobitoko/peasy2phaser | 41202a0b7b7949fa1237b1a0e2ef536bff9bc576 | [
"Unlicense"
] | null | null | null | Peasy+Box2dshapes2Phaser.py | kobitoko/peasy2phaser | 41202a0b7b7949fa1237b1a0e2ef536bff9bc576 | [
"Unlicense"
] | null | null | null | import sys
import json
hasPillow = False
try:
from PIL import Image
hasPillow = True
except ImportError:
print("pillow library not found. \nCan ignore this if you want to convert a Peasy file.")
class Converter():
def __init__(self, json):
self._json = json
if not "rigidBodies" in self.... | 38.371681 | 153 | 0.513838 | import sys
import json
hasPillow = False
try:
from PIL import Image
hasPillow = True
except ImportError:
print("pillow library not found. \nCan ignore this if you want to convert a Peasy file.")
class Converter():
def __init__(self, json):
self._json = json
if not "rigidBodies" in self.... | true | true |
1c407c5bbb37f740c6338168cc73d9c43c64c49f | 1,716 | py | Python | cmsplugin_blog_categories/views.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | cmsplugin_blog_categories/views.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | 3 | 2020-02-11T22:01:45.000Z | 2021-06-10T17:38:13.000Z | cmsplugin_blog_categories/views.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | """Views of the ``cmsplugin_blog_categories`` app."""
from django.db.models import Q
from django.views.generic import ListView
from cmsplugin_blog.models import Entry
from .models import Category
class CategoryListView(ListView):
template_name = 'cmsplugin_blog_categories/entry_archive_category.html'
contex... | 32.377358 | 75 | 0.649767 | from django.db.models import Q
from django.views.generic import ListView
from cmsplugin_blog.models import Entry
from .models import Category
class CategoryListView(ListView):
template_name = 'cmsplugin_blog_categories/entry_archive_category.html'
context_object_name = 'entries'
def dispatch(self, requ... | true | true |
1c407ce22b0188d626bd19f8a9dfb9016f55a632 | 652 | py | Python | samples/iris/iris/evaluation/evaluation_result.py | katyamust/ml-expr-fw | 5ede3ff1f777430cf25e8731e4798fc37387fb9d | [
"MIT"
] | 1 | 2022-03-06T21:52:01.000Z | 2022-03-06T21:52:01.000Z | samples/iris/iris/evaluation/evaluation_result.py | omri374/FabricML | a545f1ee907b1b89ca9766a873c5944ec88e54e9 | [
"MIT"
] | null | null | null | samples/iris/iris/evaluation/evaluation_result.py | omri374/FabricML | a545f1ee907b1b89ca9766a873c5944ec88e54e9 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import Dict
from iris import LoggableObject
class EvaluationResult(LoggableObject):
"""
Class which holds the evaluation output for one model run.
For example, precision or recall, MSE, accuracy etc.
"""
@abstractmethod
def get_metrics(self) -> Dict... | 27.166667 | 101 | 0.684049 | from abc import abstractmethod
from typing import Dict
from iris import LoggableObject
class EvaluationResult(LoggableObject):
@abstractmethod
def get_metrics(self) -> Dict:
pass
def get_params(self):
return None
| true | true |
1c407d59c8ef52303c20adc45386f2e632b7af91 | 10,932 | py | Python | nncf/compression_method_api.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | nncf/compression_method_api.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | nncf/compression_method_api.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | 1 | 2021-04-05T09:33:51.000Z | 2021-04-05T09:33:51.000Z | #
# Copyright (c) 2019-2020 Intel Corporation
# 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... | 40.043956 | 117 | 0.676454 |
import functools
from copy import copy
from enum import Enum
from functools import partial
import torch
from torch import nn
from nncf.config import NNCFConfig
from nncf.dynamic_graph.graph_builder import create_mock_tensor
from nncf.initialization import DataLoaderBNAdaptationRunner
from nncf.nncf_logge... | true | true |
1c407ee6c340fe5d42a2e3383839c117a000ebd8 | 25,169 | py | Python | test/moduletests/check_growth/test_check_growth.py | vespian/check-growth | 83322e40f51759bb0fba5dba214357e1fc3fdaea | [
"Apache-2.0"
] | 2 | 2015-01-27T14:39:22.000Z | 2016-03-10T07:50:41.000Z | test/moduletests/check_growth/test_check_growth.py | brainly/check-growth | 83322e40f51759bb0fba5dba214357e1fc3fdaea | [
"Apache-2.0"
] | null | null | null | test/moduletests/check_growth/test_check_growth.py | brainly/check-growth | 83322e40f51759bb0fba5dba214357e1fc3fdaea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015 Pawel Rozlach
# Copyright (c) 2014 Pawel Rozlach
# Copyright (c) 2014 Brainly.com sp. z o.o.
# Copyright (c) 2013 Spotify AB
#
# 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... | 44.31162 | 103 | 0.596329 |
import ddt
import mock
import os
import subprocess
import sys
import unittest
from ddt import ddt, data
pwd = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.abspath(pwd + '/../../modules/'))
import file_paths as paths
import check_growth
DF_COMMAND = '/bin/df'
class Tes... | true | true |
1c407f90884301b776b97d1fded0cfdf77b2360e | 5,153 | py | Python | edge/server.py | akirato0223/test | d530ee17ca839fcf863f9e08f9615e3856e02e3d | [
"Apache-2.0"
] | null | null | null | edge/server.py | akirato0223/test | d530ee17ca839fcf863f9e08f9615e3856e02e3d | [
"Apache-2.0"
] | null | null | null | edge/server.py | akirato0223/test | d530ee17ca839fcf863f9e08f9615e3856e02e3d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 28.787709 | 90 | 0.6732 |
import argparse
from collections import OrderedDict
from typing import Callable, Dict, Optional, Tuple
import flwr as fl
import numpy as np
import torch
import torchvision
from flwr.common.logger import log
from logging import INFO
import utils
DEVICE = torch.device("cuda:0" if torch.cuda.is_avai... | true | true |
1c408005c7eeb0a5dd713dacd7c45c871c4a05c6 | 4,406 | bzl | Python | tools/build_rules/module_rules.bzl | xmfan/buck | 1e755494263bfa4b68e62fd61d86a711b9febc3a | [
"Apache-2.0"
] | null | null | null | tools/build_rules/module_rules.bzl | xmfan/buck | 1e755494263bfa4b68e62fd61d86a711b9febc3a | [
"Apache-2.0"
] | null | null | null | tools/build_rules/module_rules.bzl | xmfan/buck | 1e755494263bfa4b68e62fd61d86a711b9febc3a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-present Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.471429 | 104 | 0.611666 |
load("@bazel_skylib//lib:collections.bzl", "collections")
load("//tools/build_rules:java_rules.bzl", "java_library_with_plugins")
load("//tools/build_rules:module_rules_for_tests.bzl", "convert_module_deps_to_test")
def buck_module(
name,
module_deps = [],
module_resources = [],
... | true | true |
1c40806bbf5b0f4e55a8e494da731a672586c90e | 2,478 | py | Python | jobfunnel/config/validate.py | Arax1/JobFunnel | 461aca3fd8d5c07fc4a57bf82d8bdc08a775e82b | [
"MIT"
] | 1 | 2019-07-13T14:41:26.000Z | 2019-07-13T14:41:26.000Z | jobfunnel/config/validate.py | studentbrad/JobFunnel | f7913304f7cd11799b975fc8afc1c60521184e68 | [
"MIT"
] | 1 | 2021-05-05T01:39:59.000Z | 2021-05-05T01:39:59.000Z | jobfunnel/config/validate.py | studentbrad/JobFunnel | f7913304f7cd11799b975fc8afc1c60521184e68 | [
"MIT"
] | null | null | null | import re
from .valid_options import DOMAINS, PROVIDERS, DELAY_FUN
from .parser import ConfigError
def validate_region(region):
""" Check if the region settings are valid.
"""
# only allow supported domains
if region['domain'] not in DOMAINS:
raise ConfigError('domain')
# search term st... | 33.486486 | 82 | 0.669088 | import re
from .valid_options import DOMAINS, PROVIDERS, DELAY_FUN
from .parser import ConfigError
def validate_region(region):
if region['domain'] not in DOMAINS:
raise ConfigError('domain')
if 'state' in region:
if (region['state'] is not None) and (region['province'] is Non... | true | true |
1c408180acd684d7e97183a6ca88a6e68ac5ae37 | 908 | py | Python | processor_box/start.py | monobot/micro_orchestra | 04fbcf202d9bda332890d4478569a911650d6540 | [
"MIT"
] | null | null | null | processor_box/start.py | monobot/micro_orchestra | 04fbcf202d9bda332890d4478569a911650d6540 | [
"MIT"
] | null | null | null | processor_box/start.py | monobot/micro_orchestra | 04fbcf202d9bda332890d4478569a911650d6540 | [
"MIT"
] | null | null | null | import os
import uuid
from redis_connector import RedisConnector
HOST = 'redis_cache'
PORT = 6379
QUEUENAME = 'microservices'
QUEUES = [QUEUENAME, ]
MICRO_SERVICE_NAME = 'processor'
redis_connector_processor = RedisConnector(HOST, PORT, QUEUES, MICRO_SERVICE_NAME)
multiplier = int(os.environ.get('MULTIPLIER', '1'))... | 23.894737 | 82 | 0.634361 | import os
import uuid
from redis_connector import RedisConnector
HOST = 'redis_cache'
PORT = 6379
QUEUENAME = 'microservices'
QUEUES = [QUEUENAME, ]
MICRO_SERVICE_NAME = 'processor'
redis_connector_processor = RedisConnector(HOST, PORT, QUEUES, MICRO_SERVICE_NAME)
multiplier = int(os.environ.get('MULTIPLIER', '1'))... | true | true |
1c4081cba058811be59db669e6489eeab5314d3c | 3,437 | py | Python | venv/lib/python3.8/site-packages/astroid/transforms.py | DiegoSilvaHoffmann/Small-Ecommerce | c6f9d75cc6dd558aa1ba9abe0186a27fe15b32d2 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | venv/lib/python3.8/site-packages/astroid/transforms.py | DiegoSilvaHoffmann/Small-Ecommerce | c6f9d75cc6dd558aa1ba9abe0186a27fe15b32d2 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | env/lib/python3.9/site-packages/astroid/transforms.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | # Copyright (c) 2015-2016, 2018 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2018 Nick Drozd <nicholasdrozd@gmail.com>
# Copyright (c) 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl... | 37.358696 | 85 | 0.644166 |
import collections
from functools import lru_cache
class TransformVisitor:
TRANSFORM_MAX_CACHE_SIZE = 10000
def __init__(self):
self.transforms = collections.defaultdict(list)
@lru_cache(maxsize=TRANSFORM_MAX_CACHE_SIZE)
def _transform(self, node):
cls = node.__class__
... | true | true |
1c40824a9bddbf7eaaaeea4f7ce6abb11a34fb46 | 108,170 | py | Python | curator/actions.py | andytumelty/curator | ecc57679b4098aa55d1015b8cb406b4c5875e3c0 | [
"Apache-2.0"
] | null | null | null | curator/actions.py | andytumelty/curator | ecc57679b4098aa55d1015b8cb406b4c5875e3c0 | [
"Apache-2.0"
] | null | null | null | curator/actions.py | andytumelty/curator | ecc57679b4098aa55d1015b8cb406b4c5875e3c0 | [
"Apache-2.0"
] | null | null | null | """Curator Actions"""
import logging
import re
import time
from copy import deepcopy
from datetime import datetime
from elasticsearch.exceptions import ConflictError, RequestError
from curator import exceptions, utils
class Alias(object):
"""Alias Action Class"""
def __init__(self, name=None, extra_settings={}... | 43.233413 | 138 | 0.572996 | import logging
import re
import time
from copy import deepcopy
from datetime import datetime
from elasticsearch.exceptions import ConflictError, RequestError
from curator import exceptions, utils
class Alias(object):
def __init__(self, name=None, extra_settings={}, **kwargs):
if not name:
raise... | true | true |
1c40828729b44afb6e27bd02134bed827f46fba8 | 3,317 | py | Python | tests/df/test_memory.py | sanketsaurav/dffml | acf3a20cd6a4c3c15aa872f3a1f898924af05a0e | [
"MIT"
] | null | null | null | tests/df/test_memory.py | sanketsaurav/dffml | acf3a20cd6a4c3c15aa872f3a1f898924af05a0e | [
"MIT"
] | null | null | null | tests/df/test_memory.py | sanketsaurav/dffml | acf3a20cd6a4c3c15aa872f3a1f898924af05a0e | [
"MIT"
] | null | null | null | from functools import wraps
from unittest.mock import patch
from typing import NamedTuple
from dffml.util.data import traverse_config_set
from dffml.util.cli.arg import Arg, parse_unknown
from dffml.util.entrypoint import entry_point
from dffml.df.base import BaseKeyValueStore, BaseRedundancyCheckerConfig
from dffml.d... | 34.915789 | 79 | 0.493217 | from functools import wraps
from unittest.mock import patch
from typing import NamedTuple
from dffml.util.data import traverse_config_set
from dffml.util.cli.arg import Arg, parse_unknown
from dffml.util.entrypoint import entry_point
from dffml.df.base import BaseKeyValueStore, BaseRedundancyCheckerConfig
from dffml.d... | true | true |
1c40829241242b10163a3380f70cebf2109dad8d | 108 | py | Python | month03.2/django/day05/mysitel3/music/urls.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month03.2/django/day05/mysitel3/music/urls.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month03.2/django/day05/mysitel3/music/urls.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from music import views
urlpatterns = [
path('index',views.music_view),
] | 15.428571 | 35 | 0.731481 | from django.urls import path
from music import views
urlpatterns = [
path('index',views.music_view),
] | true | true |
1c40835f9bd35870bae0825ad82318769270950d | 2,847 | py | Python | Examples/calibrate/calibrate.py | mustafacc/SiEPIC_Photonics_Package | 50dec87c9af4f3d883134ca121e1cbbf8cf73c24 | [
"MIT"
] | 16 | 2018-09-17T08:36:58.000Z | 2022-03-27T12:30:50.000Z | Examples/calibrate/calibrate.py | ltianying/SiEPIC_Photonics_Package | 8492cac275bfd2dc0f57ae9d01b3e71321a50caf | [
"MIT"
] | null | null | null | Examples/calibrate/calibrate.py | ltianying/SiEPIC_Photonics_Package | 8492cac275bfd2dc0f57ae9d01b3e71321a50caf | [
"MIT"
] | 7 | 2020-03-31T16:10:42.000Z | 2022-03-16T16:48:38.000Z | """
SiEPIC Photonics Package
Author: Mustafa Hammood
Mustafa@ece.ubc.ca
Example: Application of SiEPIC_PP calibration function
"""
#%% import package and installed dependent packages
import sys, os
# go up two directories
#dir_path = os.path.dirname(os.path.abspath(__file__))
#sys.path.append(os.... | 42.492537 | 126 | 0.773797 |
import sys, os
import SiEPIC_Photonics_Package as SiEPIC_PP
from SiEPIC_Photonics_Package.setup import *
file_name_in = 'MZI_data2'
file_extension = '.mat'
url = 'https://github.com/SiEPIC-Kits/SiEPIC_Photonics_Package/blob/master/Examples/'+file_name_in+file_extension+'?raw=true'
PORT = 1
input_response= SiEP... | true | true |
1c4083fd4d6b1dde4ea9b1f21d7bd6b84a73e3f6 | 2,802 | py | Python | SOP/t4/q1.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | SOP/t4/q1.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | SOP/t4/q1.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | def dist(a, b):
return abs(a - b)
def find_min(diff):
index = -1
mini = float("inf")
for i in range(len(diff)):
if not diff[i][1] and mini > diff[i][0]:
mini = diff[i][0]
index = i
return index
def ssf_sorting(requests):
head = requests[0]
l = len(request... | 26.685714 | 113 | 0.586724 | def dist(a, b):
return abs(a - b)
def find_min(diff):
index = -1
mini = float("inf")
for i in range(len(diff)):
if not diff[i][1] and mini > diff[i][0]:
mini = diff[i][0]
index = i
return index
def ssf_sorting(requests):
head = requests[0]
l = len(request... | true | true |
1c40842edff0a2d5d733140b134db08b5063c859 | 5,581 | py | Python | examples/two_sample_vs_voka.py | icecube/voka | 29a5d4439cf13d35e29b9308dcbf54c799be3b83 | [
"MIT"
] | null | null | null | examples/two_sample_vs_voka.py | icecube/voka | 29a5d4439cf13d35e29b9308dcbf54c799be3b83 | [
"MIT"
] | null | null | null | examples/two_sample_vs_voka.py | icecube/voka | 29a5d4439cf13d35e29b9308dcbf54c799be3b83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
This example exercises the two sample statistical tests
available from scipy:
* scipy.stats.ttest_ind
* scipy.stats.ks_2samp
* scipy.stats.anderson_ksamp
* scipy.stats.epps_singleton_2samp
* scipy.stats.mannwhitneyu
* scipy.stats.ranksums
* scipy.stats.wilcoxon
* scipy.stats.kruskal
* scipy.... | 30.664835 | 111 | 0.623903 |
import os
import pickle
import numpy
import pylab
import scipy.stats
import pylab
import voka.tools.samples
import voka.model
import voka.tools.render
def voka_2sample(sample1, sample2):
le2])
result['AndersonDarling'] = {
'statistic': r.statistic,
'significance_level': r.... | true | true |
1c40843db190369bf1adfa7d13266259cfc09243 | 489 | py | Python | games/migrations/0031_auto_20171103_1744.py | munisisazade/diplom_isi | 767531ef3a4b090d1bc0963e687b5215d6f92f53 | [
"MIT"
] | 1 | 2019-04-07T15:58:00.000Z | 2019-04-07T15:58:00.000Z | games/migrations/0031_auto_20171103_1744.py | munisisazade/diplom_isi | 767531ef3a4b090d1bc0963e687b5215d6f92f53 | [
"MIT"
] | 12 | 2020-06-05T18:15:45.000Z | 2022-03-11T23:20:26.000Z | games/migrations/0031_auto_20171103_1744.py | munisisazade/diplom_isi | 767531ef3a4b090d1bc0963e687b5215d6f92f53 | [
"MIT"
] | 1 | 2019-04-07T15:58:08.000Z | 2019-04-07T15:58:08.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-03 13:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('games', '0030_auto_20171009_1415'),
]
operations = [
migrations.AlterModelOptions(
... | 24.45 | 116 | 0.633947 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('games', '0030_auto_20171009_1415'),
]
operations = [
migrations.AlterModelOptions(
name='monthlyresults',
options={'ordering': ('i... | true | true |
1c4086111b3f7f8f648d6d8f43ddc9fcf8fb7656 | 3,118 | py | Python | google/ads/google_ads/v1/proto/services/campaign_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/campaign_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/campaign_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v1.proto.resources import campaign_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_campaign__pb2
from google.ads.google_ads.v1.proto.services import campaign_service_pb2 as google_dot_ads_do... | 47.969231 | 158 | 0.809173 |
import grpc
from google.ads.google_ads.v1.proto.resources import campaign_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_campaign__pb2
from google.ads.google_ads.v1.proto.services import campaign_service_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_campaign__service__pb2
c... | true | true |
1c40861846f6275944c4cd057c757a7fd928f481 | 495 | py | Python | plotly/validators/layout/scene/zaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/scene/zaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/layout/scene/zaxis/titlefont/_color.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='color',
parent_name='layout.scene.zaxis.titlefont',
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_... | 26.052632 | 66 | 0.606061 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='color',
parent_name='layout.scene.zaxis.titlefont',
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_... | true | true |
1c40867ddad76e4deac86592b2c5229745f1c42d | 143 | py | Python | auth/twilio_auth.py | busyuqboy/gateio-crypto-trading-bot-binance-announcements-new-coins | e60e78ddf21bd0e272d9ddce6a86d250119a9425 | [
"MIT"
] | null | null | null | auth/twilio_auth.py | busyuqboy/gateio-crypto-trading-bot-binance-announcements-new-coins | e60e78ddf21bd0e272d9ddce6a86d250119a9425 | [
"MIT"
] | null | null | null | auth/twilio_auth.py | busyuqboy/gateio-crypto-trading-bot-binance-announcements-new-coins | e60e78ddf21bd0e272d9ddce6a86d250119a9425 | [
"MIT"
] | null | null | null | import yaml
def load_twilio_creds(file):
with open(file) as file:
auth = yaml.load(file, Loader=yaml.FullLoader)
return auth
| 17.875 | 54 | 0.685315 | import yaml
def load_twilio_creds(file):
with open(file) as file:
auth = yaml.load(file, Loader=yaml.FullLoader)
return auth
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.