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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f32d5ce725f809569d96c84f441dd672a18ce1 | 757 | py | Python | config.py | sunshine0904/alimama_crawler | 51c4ef0cf65cc182ea2beee8d8279b32c3423170 | [
"MIT"
] | 7 | 2018-11-27T14:12:21.000Z | 2019-10-29T02:29:05.000Z | config.py | sunshine0904/alimama_crawler | 51c4ef0cf65cc182ea2beee8d8279b32c3423170 | [
"MIT"
] | 1 | 2019-04-03T03:32:15.000Z | 2019-04-03T03:32:15.000Z | config.py | sunshine0904/alimama_crawler | 51c4ef0cf65cc182ea2beee8d8279b32c3423170 | [
"MIT"
] | 5 | 2018-11-27T14:12:22.000Z | 2021-04-17T03:42:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by Em on 2017/12/13
_DEBUG = False
_VERSION = 'v0.8.0'
_USERNAME = u'金世豪'
_PASSWORD = u'jin_592714633'
def usage():
"""
The output configuration file contents.
Usage: run.py [-d|--debug] [-h|--help] [-v|--version] [output, =[argument]]
... | 16.456522 | 79 | 0.577279 |
_DEBUG = False
_VERSION = 'v0.8.0'
_USERNAME = u'金世豪'
_PASSWORD = u'jin_592714633'
def usage():
def get_username():
return _USERNAME
def get_password():
return _PASSWORD
def get_version():
return _VERSION
def get_debug():
return _DEBUG
def set_debug(debug):
global _DEBUG
_DEBUG = debug
... | true | true |
08f32e147d7226c6d368c94d943cb3202b800fd1 | 4,349 | py | Python | src/model_opt.py | pmclSF/DeepCompress | 6fc51aa0e9b34fb89f97877ad56da6345f93b929 | [
"MIT"
] | 8 | 2021-03-11T10:56:35.000Z | 2022-02-24T12:44:33.000Z | src/model_opt.py | pmclSF/DeepCompress | 6fc51aa0e9b34fb89f97877ad56da6345f93b929 | [
"MIT"
] | null | null | null | src/model_opt.py | pmclSF/DeepCompress | 6fc51aa0e9b34fb89f97877ad56da6345f93b929 | [
"MIT"
] | null | null | null | import numpy as np
import logging
from scipy.spatial.ckdtree import cKDTree
from utils.pc_metric import validate_opt_metrics, compute_metrics
logger = logging.getLogger(__name__)
def build_points_threshold(x_hat, thresholds, len_block, max_delta=np.inf):
pa_list = []
for i, t in enumerate(thresholds):
... | 51.77381 | 200 | 0.644746 | import numpy as np
import logging
from scipy.spatial.ckdtree import cKDTree
from utils.pc_metric import validate_opt_metrics, compute_metrics
logger = logging.getLogger(__name__)
def build_points_threshold(x_hat, thresholds, len_block, max_delta=np.inf):
pa_list = []
for i, t in enumerate(thresholds):
... | true | true |
08f32e5e74e079b528c153eded228f3e2ffe0e8b | 4,704 | py | Python | ragoo_utilities/utilities.py | mschatz/RaGOO | 5a274b30604cb4ef54cd6befb2fe7f0bde614fe6 | [
"MIT"
] | 1 | 2019-01-30T21:05:34.000Z | 2019-01-30T21:05:34.000Z | ragoo_utilities/utilities.py | mschatz/RaGOO | 5a274b30604cb4ef54cd6befb2fe7f0bde614fe6 | [
"MIT"
] | null | null | null | ragoo_utilities/utilities.py | mschatz/RaGOO | 5a274b30604cb4ef54cd6befb2fe7f0bde614fe6 | [
"MIT"
] | null | null | null | import time
import subprocess
import operator
from ragoo_utilities.SeqReader import SeqReader
""" A collection of various helper functions"""
complements = str.maketrans("ACGTNURYSWKMBVDH", "TGCANAYRSWMKVBHD")
def reverse_complement(seq):
"""
Reverse complement a nucleotide sequence.
:param seq: Sequen... | 32.666667 | 110 | 0.66943 | import time
import subprocess
import operator
from ragoo_utilities.SeqReader import SeqReader
complements = str.maketrans("ACGTNURYSWKMBVDH", "TGCANAYRSWMKVBHD")
def reverse_complement(seq):
return seq.translate(complements)[::-1]
def run(cmnd):
log('-- Running : %s' % cmnd)
if subprocess.call(cmnd, ... | true | true |
08f32e6410f953301c5ea6ee94c1a906a2cf082c | 3,841 | py | Python | river/tree/splitter/nominal_splitter_classif.py | fox-ds/river | 9ce947ebfc012ec7059de0a09c765b2da7fc1d25 | [
"BSD-3-Clause"
] | 2,184 | 2020-11-11T12:31:12.000Z | 2022-03-31T16:45:41.000Z | river/tree/splitter/nominal_splitter_classif.py | raphaelsty/river | 2e0b25a2ef2d2ba9ec080cf86a491f7465433b18 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/tree/splitter/nominal_splitter_classif.py | raphaelsty/river | 2e0b25a2ef2d2ba9ec080cf86a491f7465433b18 | [
"BSD-3-Clause"
] | 240 | 2020-11-11T14:25:03.000Z | 2022-03-31T08:25:50.000Z | import collections
import functools
from ..utils import BranchFactory
from .base import Splitter
class NominalSplitterClassif(Splitter):
"""Splitter utilized to monitor nominal features in classification tasks.
As the monitored feature is nominal, it already has well-defined partitions. Hence,
this spli... | 36.235849 | 93 | 0.611039 | import collections
import functools
from ..utils import BranchFactory
from .base import Splitter
class NominalSplitterClassif(Splitter):
def __init__(self):
super().__init__()
self._total_weight_observed = 0.0
self._missing_weight_observed = 0.0
self._att_dist_per_class = collect... | true | true |
08f32ed6a85b49f54965819f8957ccf7fe2f776d | 16,768 | py | Python | signalfx/ingest.py | Starz-Github/signalfx-python | 2d07b0f0ffb91ccba7071eafab306673c3d71cb7 | [
"Apache-2.0"
] | 41 | 2015-06-17T16:44:25.000Z | 2021-08-16T15:12:44.000Z | signalfx/ingest.py | Starz-Github/signalfx-python | 2d07b0f0ffb91ccba7071eafab306673c3d71cb7 | [
"Apache-2.0"
] | 74 | 2015-05-07T19:36:34.000Z | 2021-12-29T15:29:33.000Z | signalfx/ingest.py | Starz-Github/signalfx-python | 2d07b0f0ffb91ccba7071eafab306673c3d71cb7 | [
"Apache-2.0"
] | 46 | 2015-05-07T23:23:07.000Z | 2022-02-28T20:55:14.000Z | # Copyright (C) 2015-2019 SignalFx, Inc. All rights reserved.
# Copyright (C) 2020 Splunk, Inc. All rights reserved.
import collections
import json
import logging
import pprint
import requests
from requests.exceptions import ConnectionError
import six
from six.moves import queue
import threading
import zlib
from .con... | 38.725173 | 79 | 0.615041 |
import collections
import json
import logging
import pprint
import requests
from requests.exceptions import ConnectionError
import six
from six.moves import queue
import threading
import zlib
from .constants import DEFAULT_INGEST_ENDPOINT, DEFAULT_TIMEOUT, \
DEFAULT_BATCH_SIZE, SUPPORTED_EVENT_CATEGORIES, INTEGER... | true | true |
08f32f657e1d57ffd2a0317d63553a6e85486800 | 1,559 | py | Python | backend/hqlib/domain/software_development/environment.py | ICTU/quality-report | f6234e112228ee7cfe6476c2d709fe244579bcfe | [
"Apache-2.0"
] | 25 | 2016-11-25T10:41:24.000Z | 2021-07-03T14:02:49.000Z | backend/hqlib/domain/software_development/environment.py | ICTU/quality-report | f6234e112228ee7cfe6476c2d709fe244579bcfe | [
"Apache-2.0"
] | 783 | 2016-09-19T12:10:21.000Z | 2021-01-04T20:39:15.000Z | backend/hqlib/domain/software_development/environment.py | ICTU/quality-report | f6234e112228ee7cfe6476c2d709fe244579bcfe | [
"Apache-2.0"
] | 15 | 2015-03-25T13:52:49.000Z | 2021-03-08T17:17:56.000Z | """
Copyright 2012-2019 Ministerie van Sociale Zaken en Werkgelegenheid
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... | 41.026316 | 102 | 0.768441 |
from typing import Sequence, Type
from .requirement import RequirementSubject, Requirement
from ..measurement.measurable import MeasurableObject
class Environment(RequirementSubject, MeasurableObject):
default_name = "Development environment"
default_short_name = "DE"
@staticmethod
def default_requ... | true | true |
08f32fbdf84b9deb8ab58934158b2110f3f69cf4 | 767 | py | Python | positions/examples/store/models.py | Elec/django-positions | 1ee904ccfc82679d630cbab4358c5d6cc763f6df | [
"BSD-3-Clause"
] | null | null | null | positions/examples/store/models.py | Elec/django-positions | 1ee904ccfc82679d630cbab4358c5d6cc763f6df | [
"BSD-3-Clause"
] | 1 | 2020-09-03T06:06:23.000Z | 2020-09-03T06:06:23.000Z | positions/examples/store/models.py | elec/django-positions | 1ee904ccfc82679d630cbab4358c5d6cc763f6df | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from positions.fields import PositionField
class Product(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length=50)
products = models.ManyToManyField(Produc... | 23.96875 | 100 | 0.709257 | from django.db import models
from positions.fields import PositionField
class Product(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length=50)
products = models.ManyToManyField(Produc... | true | true |
08f33014a0365d097a5e5acb775ec27310561c97 | 5,196 | py | Python | Class Work/Forms & Templates/test_app.py | Pondorasti/WEB-1.1 | 1b086a676a2ba154cf447150440a93de316852f6 | [
"MIT"
] | null | null | null | Class Work/Forms & Templates/test_app.py | Pondorasti/WEB-1.1 | 1b086a676a2ba154cf447150440a93de316852f6 | [
"MIT"
] | null | null | null | Class Work/Forms & Templates/test_app.py | Pondorasti/WEB-1.1 | 1b086a676a2ba154cf447150440a93de316852f6 | [
"MIT"
] | null | null | null | ################################################################################
## IMPORTANT: DO NOT EDIT THIS CODE (unless you know what you're doing).
##
## To run the tests, first make sure you have pytest installed:
##
## $ pip3 install unittest
##
## Then, open up a terminal to the homework folder and run the fol... | 39.067669 | 116 | 0.672633 | ##
## To run the tests, first make sure you have pytest installed:
##
## $ pip3 install unittest
##
## Then, open up a terminal to the homework folder and run the following:
##
## $ python3 test_app.py
##
## If you want to run only a single test, you can run the following:
##
## $ python3 test_app.py TestApp.test_froyo... | true | true |
08f3302ad2d3f6a3d0f615fd2edee878a4b43551 | 3,583 | py | Python | DeepSpeech/bin/import_primewords.py | adimaini/WEAT-WEFAT | a32cc63ec8c715947b06aabb33704b884139f09c | [
"MIT"
] | 1 | 2021-04-22T12:00:38.000Z | 2021-04-22T12:00:38.000Z | DeepSpeech/bin/import_primewords.py | adimaini/WEAT-WEFAT | a32cc63ec8c715947b06aabb33704b884139f09c | [
"MIT"
] | null | null | null | DeepSpeech/bin/import_primewords.py | adimaini/WEAT-WEFAT | a32cc63ec8c715947b06aabb33704b884139f09c | [
"MIT"
] | 1 | 2021-08-17T21:31:21.000Z | 2021-08-17T21:31:21.000Z | #!/usr/bin/env python
import glob
import json
import os
import tarfile
import numpy as np
import pandas
from deepspeech_training.util.importers import get_importers_parser
COLUMN_NAMES = ["wav_filename", "wav_filesize", "transcript"]
def extract(archive_path, target_dir):
print("Extracting {} into {}...".forma... | 34.451923 | 124 | 0.676807 | import glob
import json
import os
import tarfile
import numpy as np
import pandas
from deepspeech_training.util.importers import get_importers_parser
COLUMN_NAMES = ["wav_filename", "wav_filesize", "transcript"]
def extract(archive_path, target_dir):
print("Extracting {} into {}...".format(archive_path, target... | true | true |
08f330af20c62022f9ec0bfc55cedc9bedda22dd | 29,981 | py | Python | examples/einstein_five_houses_riddle.py | avikor/Constraint_Satisfaction_Problems | fa545ab3df37599192963b99e9e86b7160a93dba | [
"MIT"
] | 12 | 2019-12-04T13:42:09.000Z | 2021-12-15T13:14:44.000Z | examples/einstein_five_houses_riddle.py | avikor/Constraint_Satisfaction_Problems | fa545ab3df37599192963b99e9e86b7160a93dba | [
"MIT"
] | null | null | null | examples/einstein_five_houses_riddle.py | avikor/Constraint_Satisfaction_Problems | fa545ab3df37599192963b99e9e86b7160a93dba | [
"MIT"
] | 2 | 2020-02-10T13:37:15.000Z | 2020-12-12T09:57:40.000Z | import time
import copy
import csp
from examples.performance_testing import measure_performance
# ////////////////////////////////////////// einstein's five house riddle //////////////////////////////////////////
# ///// The situation: /////
# 1. There are 5 houses in five different colors.
# 2. In each house lives a... | 54.117329 | 147 | 0.607618 | import time
import copy
import csp
from examples.performance_testing import measure_performance
# ///// The situation: /////
# 1. There are 5 houses in five different colors.
# 2. In each house lives a person with a different nationality.
# 3. These five owners drink a certain type of beverage, smoke a certain brand ... | true | true |
08f330c9a4a1d3e72eb476b1373149e874c9d434 | 1,670 | py | Python | API/scripts/create_db/create_db.py | axellink/serverless_bank_manager | ead6850d8c7830bacc3bb96f5fa422be7d65351b | [
"MIT"
] | null | null | null | API/scripts/create_db/create_db.py | axellink/serverless_bank_manager | ead6850d8c7830bacc3bb96f5fa422be7d65351b | [
"MIT"
] | 1 | 2022-02-17T19:18:23.000Z | 2022-02-17T19:18:23.000Z | API/scripts/create_db/create_db.py | axellink/serverless_bank_manager | ead6850d8c7830bacc3bb96f5fa422be7d65351b | [
"MIT"
] | 1 | 2022-02-17T19:06:02.000Z | 2022-02-17T19:06:02.000Z | from db_helper.db import DbConn
creation_sql="""
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE account (
uuid UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
name VARCHAR(50) NOT NULL,
description TEXT,
owner_uuid UUID NOT NULL,
last_balance NUMERIC(14, 2) NOT NULL
);
CREATE TABLE transa... | 27.833333 | 125 | 0.688024 | from db_helper.db import DbConn
creation_sql="""
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE account (
uuid UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
name VARCHAR(50) NOT NULL,
description TEXT,
owner_uuid UUID NOT NULL,
last_balance NUMERIC(14, 2) NOT NULL
);
CREATE TABLE transa... | true | true |
08f33168f682a58fd1f0f3e1d8dee1ded515dde6 | 1,040 | py | Python | tests/test_syntaxhighlighters.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 7 | 2019-05-01T01:34:36.000Z | 2022-03-08T02:24:14.000Z | tests/test_syntaxhighlighters.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 141 | 2019-04-16T11:22:01.000Z | 2021-04-14T15:12:36.000Z | tests/test_syntaxhighlighters.py | phil65/PrettyQt | 26327670c46caa039c9bd15cb17a35ef5ad72e6c | [
"MIT"
] | 5 | 2019-04-17T11:48:19.000Z | 2021-11-21T10:30:19.000Z | """Tests for `prettyqt` package."""
import re
from prettyqt import syntaxhighlighters
def test_jsonhighlighter():
highlighter = syntaxhighlighters.JsonHighlighter()
highlighter.highlightBlock('{"a": "b"}')
def test_pythonhighlighter():
highlighter = syntaxhighlighters.PythonHighlighter()
highlight... | 26 | 60 | 0.7375 |
import re
from prettyqt import syntaxhighlighters
def test_jsonhighlighter():
highlighter = syntaxhighlighters.JsonHighlighter()
highlighter.highlightBlock('{"a": "b"}')
def test_pythonhighlighter():
highlighter = syntaxhighlighters.PythonHighlighter()
highlighter.highlightBlock("def test(): pass"... | true | true |
08f33346f014e3326af6bb0d6b438bca8b50f0ec | 1,313 | py | Python | frappe/integrations/doctype/slack_webhook_url/slack_webhook_url.py | ektai/erp2Dodock | 5ad64b01cba9b07437f9a27751101258679379e8 | [
"MIT"
] | null | null | null | frappe/integrations/doctype/slack_webhook_url/slack_webhook_url.py | ektai/erp2Dodock | 5ad64b01cba9b07437f9a27751101258679379e8 | [
"MIT"
] | null | null | null | frappe/integrations/doctype/slack_webhook_url/slack_webhook_url.py | ektai/erp2Dodock | 5ad64b01cba9b07437f9a27751101258679379e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import get_url_to_form
from frappe import _
import requests
import json... | 25.745098 | 81 | 0.711348 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import get_url_to_form
from frappe import _
import requests
import json
error_messages = {
400: "400: Invalid Payload or User not found",
403: "403: Action Prohibited",
404: "404: Channel not found",
... | true | true |
08f333b24576a8048fb542d100175b339cd8540c | 2,520 | py | Python | nova/objects/dns_domain.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/objects/dns_domain.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/objects/dns_domain.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 4 | 2017-06-23T07:37:43.000Z | 2020-12-28T09:57:22.000Z | # Copyright (C) 2014, Red Hat, 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... | 33.157895 | 78 | 0.681349 |
from nova import db
from nova import objects
from nova.objects import base
from nova.objects import fields
class DNSDomain(base.NovaPersistentObject, base.NovaObject,
base.NovaObjectDictCompat):
VERSION = '1.0'
fields = {
'domain': fields.StringField(),
'scope': fields.St... | true | true |
08f334941a8a72a946a878d0e178404553f7d03f | 1,057 | py | Python | community_calendar/tasks.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 10 | 2016-05-03T20:41:25.000Z | 2021-09-17T18:42:01.000Z | community_calendar/tasks.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 655 | 2016-05-04T19:00:35.000Z | 2022-03-28T13:09:20.000Z | community_calendar/tasks.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 8 | 2016-05-06T10:24:27.000Z | 2020-10-21T00:56:59.000Z | from celery import shared_task
from django.conf import settings
from django.contrib.auth.models import User
from django.core.mail import EmailMultiAlternatives
from studygroups.utils import html_body_to_text
from studygroups.utils import render_to_string_ctx
import logging
logger = logging.getLogger(__name__)
@s... | 27.815789 | 99 | 0.742668 | from celery import shared_task
from django.conf import settings
from django.contrib.auth.models import User
from django.core.mail import EmailMultiAlternatives
from studygroups.utils import html_body_to_text
from studygroups.utils import render_to_string_ctx
import logging
logger = logging.getLogger(__name__)
@s... | true | true |
08f3349b7e0bec023c14cc2bfebd8d0a7169a261 | 9,016 | py | Python | venv/lib/python2.7/site-packages/whitenoise/responders.py | Juliet-jay/Awards | d0a2d0a065c7ad3c8992602ded1eb7202525012f | [
"Unlicense"
] | 4 | 2019-11-14T15:28:20.000Z | 2021-03-26T04:43:43.000Z | venv/lib/python2.7/site-packages/whitenoise/responders.py | Juliet-jay/Awards | d0a2d0a065c7ad3c8992602ded1eb7202525012f | [
"Unlicense"
] | 12 | 2020-06-05T23:59:38.000Z | 2022-03-12T00:02:08.000Z | virtual/lib/python3.6/site-packages/whitenoise/responders.py | francismuk/neighbourhood | 393c6ae91242b010ef2aca4a845a0cb144c2189c | [
"MIT"
] | 7 | 2019-09-25T05:42:05.000Z | 2020-07-14T17:45:01.000Z | from collections import namedtuple
from email.utils import formatdate, parsedate
import errno
try:
from http import HTTPStatus
except ImportError:
from .httpstatus_backport import HTTPStatus
import os
import re
import stat
from time import mktime
try:
from urllib.parse import quote
except ImportError:
f... | 36.502024 | 83 | 0.618567 | from collections import namedtuple
from email.utils import formatdate, parsedate
import errno
try:
from http import HTTPStatus
except ImportError:
from .httpstatus_backport import HTTPStatus
import os
import re
import stat
from time import mktime
try:
from urllib.parse import quote
except ImportError:
f... | true | true |
08f33635d32f43108a193f7512bf119b46a7f57c | 6,457 | py | Python | docs/source/conf.py | L1NT/django-yubico-authentication-backend | 16af325ea468e599c437bc7564e65954e23d2bdf | [
"BSD-3-Clause"
] | 1 | 2021-10-21T16:30:46.000Z | 2021-10-21T16:30:46.000Z | docs/source/conf.py | L1NT/django-yubico-authentication-backend | 16af325ea468e599c437bc7564e65954e23d2bdf | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | L1NT/django-yubico-authentication-backend | 16af325ea468e599c437bc7564e65954e23d2bdf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Yubico Django Authentication Backend documentation build configuration file, created by
# sphinx-quickstart on Fri May 7 13:31:27 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
... | 32.943878 | 107 | 0.726653 |
import sys, os
extensions = []
templates_path = ['.templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Yubico Django Authentication Backend'
copyright = u'2010, Tomaž Muraus'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y versio... | true | true |
08f336575102e60213391131b909124a8718180a | 4,670 | py | Python | tensorflow/python/util/all_util.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 65 | 2016-09-26T01:30:40.000Z | 2021-08-11T17:00:41.000Z | tensorflow/python/util/all_util.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 7 | 2017-07-13T09:40:59.000Z | 2019-04-08T22:46:51.000Z | tensorflow/python/util/all_util.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 38 | 2017-04-28T04:15:48.000Z | 2019-09-28T05:11:46.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.916667 | 80 | 0.716274 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect as _inspect
import re as _re
import sys as _sys
_reference_pattern = _re.compile(r'^@@(\w+)$', flags=_re.MULTILINE)
def make_all(module_name, doc_string_modules=None):
if doc_string_modules... | true | true |
08f3369e5ab580a9dafaa348f67dcc9c2f81668a | 5,428 | py | Python | attendance_comparison.py | datacloudgui/Spreadsheet-Comparision-Report | ad9b296e92a4a722a143b29740dc58732e5ffb21 | [
"MIT"
] | null | null | null | attendance_comparison.py | datacloudgui/Spreadsheet-Comparision-Report | ad9b296e92a4a722a143b29740dc58732e5ffb21 | [
"MIT"
] | null | null | null | attendance_comparison.py | datacloudgui/Spreadsheet-Comparision-Report | ad9b296e92a4a722a143b29740dc58732e5ffb21 | [
"MIT"
] | null | null | null | import openpyxl
from openpyxl import Workbook
def open_excel_sheet(filename, sheet_name):
wb = openpyxl.load_workbook(filename)
sheet = wb.get_sheet_by_name(sheet_name)
return sheet
def find_word_in_row(sheet, column_name, word):
for row in range(1, sheet.max_row +1):
if(sheet[column_name + st... | 44.491803 | 106 | 0.681282 | import openpyxl
from openpyxl import Workbook
def open_excel_sheet(filename, sheet_name):
wb = openpyxl.load_workbook(filename)
sheet = wb.get_sheet_by_name(sheet_name)
return sheet
def find_word_in_row(sheet, column_name, word):
for row in range(1, sheet.max_row +1):
if(sheet[column_name + st... | true | true |
08f33abce4823fad8b5123d5e13b824e1e5c6cdf | 6,017 | py | Python | kluctl/cli/utils.py | codablock/kluctl | a7069bf22bfe78c5529fe403c3b3c877f026d3c3 | [
"Apache-2.0"
] | 26 | 2021-08-18T11:18:46.000Z | 2022-03-16T09:28:43.000Z | kluctl/cli/utils.py | codablock/kluctl | a7069bf22bfe78c5529fe403c3b3c877f026d3c3 | [
"Apache-2.0"
] | 4 | 2021-09-07T09:55:29.000Z | 2022-03-03T09:05:01.000Z | kluctl/cli/utils.py | codablock/kluctl | a7069bf22bfe78c5529fe403c3b3c877f026d3c3 | [
"Apache-2.0"
] | 4 | 2021-09-04T11:52:33.000Z | 2022-03-16T09:18:20.000Z | import contextlib
import dataclasses
import os
import tempfile
from typing import ContextManager
from kluctl.kluctl_project.kluctl_project import load_kluctl_project_from_args, KluctlProject
from kluctl.utils.dict_utils import merge_dict, get_dict_value
from kluctl.utils.exceptions import CommandError
from kluctl.depl... | 35.815476 | 117 | 0.688383 | import contextlib
import dataclasses
import os
import tempfile
from typing import ContextManager
from kluctl.kluctl_project.kluctl_project import load_kluctl_project_from_args, KluctlProject
from kluctl.utils.dict_utils import merge_dict, get_dict_value
from kluctl.utils.exceptions import CommandError
from kluctl.depl... | true | true |
08f33c4623d91ea4cf335cebe4891daa62b9cc88 | 146 | py | Python | Ago-Dic-2019/Ricardo_Romero_Medina/PrimerParcial/Ejercicio1/vehiculo.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2019/Ricardo_Romero_Medina/PrimerParcial/Ejercicio1/vehiculo.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2019/Ricardo_Romero_Medina/PrimerParcial/Ejercicio1/vehiculo.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | from abc import ABCMeta,abstractmethod
class Vehiculo(metaclass=ABCMeta):
def trsalado(self,tipo,marca,color,modelo,pasajeros):
pass | 24.333333 | 57 | 0.760274 | from abc import ABCMeta,abstractmethod
class Vehiculo(metaclass=ABCMeta):
def trsalado(self,tipo,marca,color,modelo,pasajeros):
pass | true | true |
08f33ca815156408ac48e26077d175c09a4455b5 | 1,995 | py | Python | fuzzbench/run_experiment.py | LevyForchh/fuzzbench | a15f21d01210dffe07dfeb7756cc20957b343fbf | [
"Apache-2.0"
] | null | null | null | fuzzbench/run_experiment.py | LevyForchh/fuzzbench | a15f21d01210dffe07dfeb7756cc20957b343fbf | [
"Apache-2.0"
] | 4 | 2020-07-28T19:00:26.000Z | 2020-11-10T01:09:38.000Z | fuzzbench/run_experiment.py | LevyForchh/fuzzbench | a15f21d01210dffe07dfeb7756cc20957b343fbf | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.227273 | 78 | 0.603008 |
import time
import redis
import rq
from fuzzbench import jobs
def run_experiment():
print('Initializing the job queue.')
queue = rq.Queue()
jobs_list = []
jobs_list.append(
queue.enqueue(jobs.build_image,
'base-image',
job_timeout=600,
... | true | true |
08f33d574671d6153d1db4bd14c3f4192cf5bf91 | 146 | py | Python | e4.py | astaffes/lab8 | 224538d81bb408cd809e09c236a0d044cdbb20a3 | [
"MIT"
] | null | null | null | e4.py | astaffes/lab8 | 224538d81bb408cd809e09c236a0d044cdbb20a3 | [
"MIT"
] | null | null | null | e4.py | astaffes/lab8 | 224538d81bb408cd809e09c236a0d044cdbb20a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
a = (1, 2, 3, 4, 5)
print(a[0])
print(a[1:3])
a[1] = 3
| 16.222222 | 26 | 0.465753 |
if __name__ == '__main__':
a = (1, 2, 3, 4, 5)
print(a[0])
print(a[1:3])
a[1] = 3
| true | true |
08f33da4feab317d35008b5db9e9a77856edb0b2 | 13,137 | py | Python | tutorial/cytoscape/callbacks_chapter.py | marwahaha/dash-docs | 5df7611bf16357419e630a16e4be1bc016a08507 | [
"MIT"
] | null | null | null | tutorial/cytoscape/callbacks_chapter.py | marwahaha/dash-docs | 5df7611bf16357419e630a16e4be1bc016a08507 | [
"MIT"
] | null | null | null | tutorial/cytoscape/callbacks_chapter.py | marwahaha/dash-docs | 5df7611bf16357419e630a16e4be1bc016a08507 | [
"MIT"
] | null | null | null | from textwrap import dedent
import dash_cytoscape as cyto
import dash_core_components as dcc
import dash_html_components as html
from .utils import CreateDisplay, PythonSnippet
from tutorial import tools, styles
examples = {
example: tools.load_example(
'tutorial/examples/cytoscape/{}'.format(example)
... | 30.622378 | 116 | 0.570222 | from textwrap import dedent
import dash_cytoscape as cyto
import dash_core_components as dcc
import dash_html_components as html
from .utils import CreateDisplay, PythonSnippet
from tutorial import tools, styles
examples = {
example: tools.load_example(
'tutorial/examples/cytoscape/{}'.format(example)
... | true | true |
08f33e6436a167d57b32c999544fdf4607f22dc0 | 100 | py | Python | 8_sep/translation.py | cortizbon/code_forces | f984e41e3172210fa25d78217cd2f9a1af81dca0 | [
"MIT"
] | null | null | null | 8_sep/translation.py | cortizbon/code_forces | f984e41e3172210fa25d78217cd2f9a1af81dca0 | [
"MIT"
] | null | null | null | 8_sep/translation.py | cortizbon/code_forces | f984e41e3172210fa25d78217cd2f9a1af81dca0 | [
"MIT"
] | null | null | null | s = input('Palabra: ')
t = input('Traducción: ')
if s[::-1] == t:
print('YES')
else:
print('NO')
| 12.5 | 25 | 0.53 | s = input('Palabra: ')
t = input('Traducción: ')
if s[::-1] == t:
print('YES')
else:
print('NO')
| true | true |
08f33f8fe693d82cc2873de49be4c14eb07f1856 | 1,172 | py | Python | airflow/contrib/sensors/pubsub_sensor.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/contrib/sensors/pubsub_sensor.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/contrib/sensors/pubsub_sensor.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.066667 | 97 | 0.769625 |
import warnings
from airflow.providers.google.cloud.sensors.pubsub import PubSubPullSensor
warnings.warn(
"This module is deprecated. Please use `airflow.providers.google.cloud.sensors.pubsub`.",
DeprecationWarning,
stacklevel=2,
)
| true | true |
08f33fa7d367195da5508bc497ac9fd5aff79ab6 | 5,093 | py | Python | lib/python3.9/site-packages/django/utils/deprecation.py | HumbleSmarts/University-Management-System | 5da07c4cf0e9c1d30ab76e4428f010757ffe876a | [
"MIT"
] | 169 | 2022-01-04T06:46:48.000Z | 2022-03-31T07:17:59.000Z | lib/python3.9/site-packages/django/utils/deprecation.py | HumbleSmarts/University-Management-System | 5da07c4cf0e9c1d30ab76e4428f010757ffe876a | [
"MIT"
] | 212 | 2022-01-04T09:46:05.000Z | 2022-03-31T23:18:08.000Z | django/utils/deprecation.py | mustafa0x/django | d7394cfa13a4d1a02356e3a83e10ec100fbb9948 | [
"BSD-3-Clause",
"0BSD"
] | 86 | 2022-01-04T06:32:30.000Z | 2022-03-30T13:05:51.000Z | import asyncio
import inspect
import warnings
from asgiref.sync import sync_to_async
class RemovedInDjango41Warning(DeprecationWarning):
pass
class RemovedInDjango50Warning(PendingDeprecationWarning):
pass
RemovedInNextVersionWarning = RemovedInDjango41Warning
class warn_about_renamed_method:
def _... | 34.181208 | 90 | 0.619478 | import asyncio
import inspect
import warnings
from asgiref.sync import sync_to_async
class RemovedInDjango41Warning(DeprecationWarning):
pass
class RemovedInDjango50Warning(PendingDeprecationWarning):
pass
RemovedInNextVersionWarning = RemovedInDjango41Warning
class warn_about_renamed_method:
def _... | true | true |
08f34248fe457b48569bdf67cdcda3c16b66b5f2 | 7,773 | py | Python | docs/conf.py | shivamordanny/mlops_main | 7c7130ac72f83581c05aa98500f4f931f3721521 | [
"MIT"
] | null | null | null | docs/conf.py | shivamordanny/mlops_main | 7c7130ac72f83581c05aa98500f4f931f3721521 | [
"MIT"
] | null | null | null | docs/conf.py | shivamordanny/mlops_main | 7c7130ac72f83581c05aa98500f4f931f3721521 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# ds-proj-1 documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have... | 31.726531 | 80 | 0.705905 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'ds-proj-1'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha... | true | true |
08f34250ba6bfc40982ed214cbfb006fb3a46028 | 705 | py | Python | python/randmoodplot.py | Floozutter/silly | 8273b4a33e2001c0a530e859c12dbc30b9590a94 | [
"Unlicense"
] | null | null | null | python/randmoodplot.py | Floozutter/silly | 8273b4a33e2001c0a530e859c12dbc30b9590a94 | [
"Unlicense"
] | null | null | null | python/randmoodplot.py | Floozutter/silly | 8273b4a33e2001c0a530e859c12dbc30b9590a94 | [
"Unlicense"
] | null | null | null | """
A plotting companion to randmood.py.
"""
import matplotlib.pyplot as plt
from itertools import islice
from typing import Callable, Iterator
def plot_generator(
title: str,
genf: Callable[[float], Iterator[float]],
n: int,
p: float
) -> None:
plot(
title,
range(n+1),
list(islice(genf(p), n+1))
)
def ... | 16.785714 | 42 | 0.643972 |
import matplotlib.pyplot as plt
from itertools import islice
from typing import Callable, Iterator
def plot_generator(
title: str,
genf: Callable[[float], Iterator[float]],
n: int,
p: float
) -> None:
plot(
title,
range(n+1),
list(islice(genf(p), n+1))
)
def plot_solution(
title: str,
f: Callable[[int... | true | true |
08f342ee454eaf68ada5b2aa85d49dd836ab8f1b | 425 | py | Python | 01-DesenvolvimentoDeSistemas/02-LinguagensDeProgramacao/01-Python/01-ListaDeExercicios/01-Gabarito/112.py | moacirsouza/nadas | ad98d73b4281d1581fd2b2a9d29001acb426ee56 | [
"MIT"
] | 1 | 2020-07-03T13:54:18.000Z | 2020-07-03T13:54:18.000Z | 01-DesenvolvimentoDeSistemas/02-LinguagensDeProgramacao/01-Python/01-ListaDeExercicios/01-Gabarito/112.py | moacirsouza/nadas | ad98d73b4281d1581fd2b2a9d29001acb426ee56 | [
"MIT"
] | null | null | null | 01-DesenvolvimentoDeSistemas/02-LinguagensDeProgramacao/01-Python/01-ListaDeExercicios/01-Gabarito/112.py | moacirsouza/nadas | ad98d73b4281d1581fd2b2a9d29001acb426ee56 | [
"MIT"
] | null | null | null | print("""
112) Dentro do pacote utilidadesCeV que criamos no desafio 111, temos um
módulo chamado dado. Crie uma função chamada leiaDinheiro() que seja capaz
de funcionar como a função input(), mas com uma validação de dados para
aceitar apenas valores que sejam monetários.
""")
from utilidadesCeV import moeda
from ut... | 32.692308 | 74 | 0.774118 | print("""
112) Dentro do pacote utilidadesCeV que criamos no desafio 111, temos um
módulo chamado dado. Crie uma função chamada leiaDinheiro() que seja capaz
de funcionar como a função input(), mas com uma validação de dados para
aceitar apenas valores que sejam monetários.
""")
from utilidadesCeV import moeda
from ut... | true | true |
08f344487fd854b4baa43e72b8248dc7edc9b69d | 14,177 | py | Python | detr_tf/networks/transformer.py | nisarahamedk/detr-tensorflow | aa6f283a6b79796804eaef10f3fb1e417fafd2b3 | [
"MIT"
] | 112 | 2020-12-22T10:31:19.000Z | 2022-03-25T18:40:22.000Z | detr_tf/networks/transformer.py | nisarahamedk/detr-tensorflow | aa6f283a6b79796804eaef10f3fb1e417fafd2b3 | [
"MIT"
] | 34 | 2020-12-29T18:09:35.000Z | 2022-02-11T13:11:27.000Z | detr_tf/networks/transformer.py | nisarahamedk/detr-tensorflow | aa6f283a6b79796804eaef10f3fb1e417fafd2b3 | [
"MIT"
] | 40 | 2020-12-22T16:03:40.000Z | 2022-03-25T03:28:10.000Z | import tensorflow as tf
from tensorflow.keras.layers import Dropout, Activation, LayerNormalization
from .custom_layers import Linear
class Transformer(tf.keras.Model):
def __init__(self, model_dim=256, num_heads=8, num_encoder_layers=6,
num_decoder_layers=6, dim_feedforward=2048, dropout=0.1,
... | 39.711485 | 98 | 0.603654 | import tensorflow as tf
from tensorflow.keras.layers import Dropout, Activation, LayerNormalization
from .custom_layers import Linear
class Transformer(tf.keras.Model):
def __init__(self, model_dim=256, num_heads=8, num_encoder_layers=6,
num_decoder_layers=6, dim_feedforward=2048, dropout=0.1,
... | true | true |
08f3456bbe7c289ad3bb735492b9383584dd71cf | 15,330 | py | Python | scipy/spatial/tests/test_kdtree.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-10-07T00:37:32.000Z | 2022-01-21T17:02:33.000Z | scipy/spatial/tests/test_kdtree.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | null | null | null | scipy/spatial/tests/test_kdtree.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-05-09T14:23:57.000Z | 2018-11-15T05:56:00.000Z | # Copyright Anne M. Archibald 2008
# Released under the scipy license
from numpy.testing import assert_equal, assert_array_equal, assert_almost_equal, \
assert_, run_module_suite
import numpy as np
from scipy.spatial import KDTree, Rectangle, distance_matrix, cKDTree
from scipy.spatial import minkowski_distan... | 32.205882 | 95 | 0.573973 |
from numpy.testing import assert_equal, assert_array_equal, assert_almost_equal, \
assert_, run_module_suite
import numpy as np
from scipy.spatial import KDTree, Rectangle, distance_matrix, cKDTree
from scipy.spatial import minkowski_distance as distance
class ConsistencyTests:
def test_nearest(self):
... | true | true |
08f3456f58d0b4fa8867263a8447903bbff9e923 | 151 | py | Python | kitsune/gallery/apps.py | theresnotime/kitsune | 0757b267b0d332264167d31ce84e342263e1c635 | [
"BSD-3-Clause"
] | null | null | null | kitsune/gallery/apps.py | theresnotime/kitsune | 0757b267b0d332264167d31ce84e342263e1c635 | [
"BSD-3-Clause"
] | null | null | null | kitsune/gallery/apps.py | theresnotime/kitsune | 0757b267b0d332264167d31ce84e342263e1c635 | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class GalleryConfig(AppConfig):
name = "kitsune.gallery"
default_auto_field = "django.db.models.AutoField"
| 21.571429 | 53 | 0.761589 | from django.apps import AppConfig
class GalleryConfig(AppConfig):
name = "kitsune.gallery"
default_auto_field = "django.db.models.AutoField"
| true | true |
08f345b3da6906377fcfd9c459371994a4ad906f | 1,718 | py | Python | lab03/book_registry/test_script.py | Boris-Barboris/rsoi | 30b03f50549f7977d5ecb7788b8e22b789f8859f | [
"MIT"
] | null | null | null | lab03/book_registry/test_script.py | Boris-Barboris/rsoi | 30b03f50549f7977d5ecb7788b8e22b789f8859f | [
"MIT"
] | null | null | null | lab03/book_registry/test_script.py | Boris-Barboris/rsoi | 30b03f50549f7977d5ecb7788b8e22b789f8859f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from app_book_registry.oauthclient import *
from app_book_registry.book_registry_client import *
from app_book_registry.rsoi_common import AlreadyExists
import json
import requests
import logging
import http.client
http.client.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger()... | 28.163934 | 91 | 0.680442 |
from app_book_registry.oauthclient import *
from app_book_registry.book_registry_client import *
from app_book_registry.rsoi_common import AlreadyExists
import json
import requests
import logging
import http.client
http.client.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.D... | true | true |
08f346017a69fc65f4c68c1aee2b62f3c65772e2 | 3,214 | py | Python | pystego.py | cstyan/pyStego | 76f2119430e455347d8c54241b6c5c65bfcd2bf9 | [
"MIT"
] | null | null | null | pystego.py | cstyan/pyStego | 76f2119430e455347d8c54241b6c5c65bfcd2bf9 | [
"MIT"
] | null | null | null | pystego.py | cstyan/pyStego | 76f2119430e455347d8c54241b6c5c65bfcd2bf9 | [
"MIT"
] | null | null | null | import argparse
import os
from PIL import Image
import imageFunctions
import stegoFunctions
# Funcion: checkSizes
# Author: Callum Styan
#
# This funcion is used to check if the cover image has enough space to store the
# header + secret file, this is done by comparing the number of pixels in the
# cover image * 3 to ... | 42.289474 | 152 | 0.660859 | import argparse
import os
from PIL import Image
import imageFunctions
import stegoFunctions
def checkSizes():
coverImage = Image.open(args.coverImagePath)
numBits = coverImage.size[0] * coverImage.size[1] * 3
if os.path.getsize(args.secretFilePath) > numBits / 8:
return 1
parser = argparse.ArgumentParse... | false | true |
08f3463d0709860164e70ec7d656594cac526b34 | 2,548 | py | Python | setup.py | imraviagrawal/sonnet | 3a305e16af9e274b89db2834e3b7cea9cea6806f | [
"Apache-2.0"
] | 2 | 2017-04-28T19:15:38.000Z | 2017-06-22T09:53:35.000Z | setup.py | schaul/sonnet | 3a305e16af9e274b89db2834e3b7cea9cea6806f | [
"Apache-2.0"
] | null | null | null | setup.py | schaul/sonnet | 3a305e16af9e274b89db2834e3b7cea9cea6806f | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 34.90411 | 79 | 0.671115 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install as InstallCommandBase
_VERSION = '1.0'
project_name = 'sonnet'
REQUIRED_PACKAGES = [
'ten... | true | true |
08f347a1b61dbdc6ff619e50420fc85dd5d2b861 | 13,873 | py | Python | examples/grain_bound/bayesOptimization/interactive/bo_mao_interactive.py | zhangkunliang/BayesOptimization | 6d78c9e9f96239b0dbb85650a0d878e9410158ec | [
"MIT"
] | null | null | null | examples/grain_bound/bayesOptimization/interactive/bo_mao_interactive.py | zhangkunliang/BayesOptimization | 6d78c9e9f96239b0dbb85650a0d878e9410158ec | [
"MIT"
] | null | null | null | examples/grain_bound/bayesOptimization/interactive/bo_mao_interactive.py | zhangkunliang/BayesOptimization | 6d78c9e9f96239b0dbb85650a0d878e9410158ec | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
import numpy as np
import pickle as pickle
import scipy
import combo
import os
import urllib
import matplotlib.pyplot as plt
num = 0
def load_data():
A = np.loadtxt('descriptor.dat')
print(A.shape)
X = A
print(X.shape[0])
... | 45.785479 | 115 | 0.704029 | from __future__ import print_function
import numpy as np
import pickle as pickle
import scipy
import combo
import os
import urllib
import matplotlib.pyplot as plt
num = 0
def load_data():
A = np.loadtxt('descriptor.dat')
print(A.shape)
X = A
print(X.shape[0])
return X
log = open('../bo_log', '... | true | true |
08f3485047ab436f596c20fb9e0e6c368509d041 | 20,500 | py | Python | tensorflow/tensorboard/backend/application_test.py | xzy256/tensorflow-mips | f45787d2f30e8109a67f7fa5a586167a71489d21 | [
"Apache-2.0"
] | 4 | 2019-04-14T13:33:17.000Z | 2021-09-22T02:33:29.000Z | tensorflow/tensorboard/backend/application_test.py | xzy256/tensorflow-mips | f45787d2f30e8109a67f7fa5a586167a71489d21 | [
"Apache-2.0"
] | null | null | null | tensorflow/tensorboard/backend/application_test.py | xzy256/tensorflow-mips | f45787d2f30e8109a67f7fa5a586167a71489d21 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.923339 | 80 | 0.677659 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import json
import numbers
import os
import shutil
import socket
import tempfile
import threading
from six import BytesIO
from six.moves import http_client
import tensorflow as tf
from werkzeug i... | true | true |
08f34892fa6592251fc185e8fc49bc0b56c34956 | 7,959 | py | Python | Baseline/train.py | iabhibits/QANet_SQUAD_2.0 | 760f1147038411beb205401ae902d6ec3ac4468d | [
"MIT"
] | 5 | 2019-08-21T13:42:50.000Z | 2021-03-18T06:49:12.000Z | Baseline/train.py | iabhibits/QANet_SQUAD_2.0 | 760f1147038411beb205401ae902d6ec3ac4468d | [
"MIT"
] | null | null | null | Baseline/train.py | iabhibits/QANet_SQUAD_2.0 | 760f1147038411beb205401ae902d6ec3ac4468d | [
"MIT"
] | 3 | 2019-08-08T10:45:04.000Z | 2021-02-25T23:17:43.000Z | """Train a model on SQuAD.
Author:
Chris Chute (chute@stanford.edu)
"""
import numpy as np
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as sched
import torch.utils.data as data
import util
from args import get_train_a... | 37.9 | 80 | 0.534615 |
import numpy as np
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as sched
import torch.utils.data as data
import util
from args import get_train_args
from collections import OrderedDict
from json import dumps
from models im... | true | true |
08f348ce7cda470e3202e7ab52d5395eca2b3b37 | 4,117 | py | Python | bcs-ui/backend/tests/dashboard/workloads/test_pod.py | masanqi/bk-bcs | 70d97b674fbd5beacde21d6ca8be914d7eb56865 | [
"Apache-2.0"
] | 599 | 2019-06-25T03:20:46.000Z | 2022-03-31T12:14:33.000Z | bcs-ui/backend/tests/dashboard/workloads/test_pod.py | masanqi/bk-bcs | 70d97b674fbd5beacde21d6ca8be914d7eb56865 | [
"Apache-2.0"
] | 537 | 2019-06-27T06:03:44.000Z | 2022-03-31T12:10:01.000Z | bcs-ui/backend/tests/dashboard/workloads/test_pod.py | masanqi/bk-bcs | 70d97b674fbd5beacde21d6ca8be914d7eb56865 | [
"Apache-2.0"
] | 214 | 2019-06-25T03:26:05.000Z | 2022-03-31T07:52:03.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 42.010204 | 115 | 0.679864 | import time
import mock
import pytest
from backend.dashboard.examples.utils import load_demo_manifest
from backend.tests.conftest import TEST_NAMESPACE
from backend.tests.dashboard.conftest import DASHBOARD_API_URL_COMMON_PREFIX as DAU_PREFIX
from backend.utils.basic import getitems
pytestmark = pytest.mark.django_d... | true | true |
08f348ee2cbe0a978dfabc6fc3ea97c38bde84a8 | 15,055 | py | Python | blocky-client.py | apache/infrastructure-blocky-client | 58bca0c4470c8d28538f51da54911c70d85cf38b | [
"Apache-2.0"
] | 1 | 2021-11-08T13:18:57.000Z | 2021-11-08T13:18:57.000Z | blocky-client.py | apache/infrastructure-blocky-client | 58bca0c4470c8d28538f51da54911c70d85cf38b | [
"Apache-2.0"
] | 1 | 2021-05-06T07:15:21.000Z | 2021-05-06T16:21:13.000Z | blocky-client.py | apache/infrastructure-blocky-client | 58bca0c4470c8d28538f51da54911c70d85cf38b | [
"Apache-2.0"
] | 1 | 2021-11-08T13:18:51.000Z | 2021-11-08T13:18:51.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, ... | 35.591017 | 117 | 0.513052 | import os
import subprocess
import re
import requests
import netaddr
import socket
import time
import sys
import asyncio
import websockets
import yaml
import threading
import copy
import asfpy.syslog
print = asfpy.syslog.Printer(stdout=True, identity='blocky')
# Set some globals
DEBUG = False
CONFIG = None
MAX_IPTABL... | true | true |
08f3498989c1c88af257d9e805ae542e6f616449 | 286 | py | Python | skbonus/linear_model/__init__.py | Garve/scikit-bonus | 46c985c6f2c0b371b031977592b23cf0e28c46e3 | [
"BSD-3-Clause"
] | 8 | 2021-02-04T13:54:43.000Z | 2021-12-26T16:50:31.000Z | skbonus/linear_model/__init__.py | Garve/scikit-bonus | 46c985c6f2c0b371b031977592b23cf0e28c46e3 | [
"BSD-3-Clause"
] | 3 | 2021-03-01T15:27:21.000Z | 2021-07-31T16:14:27.000Z | skbonus/linear_model/__init__.py | Garve/scikit-bonus | 46c985c6f2c0b371b031977592b23cf0e28c46e3 | [
"BSD-3-Clause"
] | 2 | 2021-02-13T20:16:48.000Z | 2021-04-07T07:29:06.000Z | """Special linear regressors."""
from ._scipy_regressors import (
ImbalancedLinearRegression,
LADRegression,
QuantileRegression,
LinearRegression,
)
__all__ = [
"LADRegression",
"ImbalancedLinearRegression",
"QuantileRegression",
"LinearRegression",
]
| 17.875 | 33 | 0.70979 |
from ._scipy_regressors import (
ImbalancedLinearRegression,
LADRegression,
QuantileRegression,
LinearRegression,
)
__all__ = [
"LADRegression",
"ImbalancedLinearRegression",
"QuantileRegression",
"LinearRegression",
]
| true | true |
08f34a4546a2b069c4c74a29e18eb9e9cf37ed89 | 1,996 | py | Python | tests/tests_tests.py | PArangSae/pywikibot | caf1401e71a81d11e681a6d6adfdea907aa33b94 | [
"MIT"
] | null | null | null | tests/tests_tests.py | PArangSae/pywikibot | caf1401e71a81d11e681a6d6adfdea907aa33b94 | [
"MIT"
] | null | null | null | tests/tests_tests.py | PArangSae/pywikibot | caf1401e71a81d11e681a6d6adfdea907aa33b94 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the tests package."""
#
# (C) Pywikibot team, 2014-2020
#
# Distributed under the terms of the MIT license.
from contextlib import suppress
from tests.aspects import unittest, TestCase
class HttpServerProblemTestCase(TestCase):
"""Test HTTP status 502 cause... | 26.263158 | 75 | 0.640782 | from contextlib import suppress
from tests.aspects import unittest, TestCase
class HttpServerProblemTestCase(TestCase):
sites = {
'502': {
'hostname': 'http://httpbin.org/status/502',
}
}
def test_502(self):
self.fail('The test framework should skip this test.')
c... | true | true |
08f34af6978f01322f0afc624eafe22614362fd6 | 3,504 | py | Python | src/oci/vulnerability_scanning/models/host_scan_agent_configuration.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/vulnerability_scanning/models/host_scan_agent_configuration.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/vulnerability_scanning/models/host_scan_agent_configuration.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 35.04 | 245 | 0.671233 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class HostScanAgentConfiguration(object):
VENDOR_OCI = "OCI"
def __init__(self, **kwargs):
self.swagger_types ... | true | true |
08f34b1638a49525c6014ae396d00af66e2d77a0 | 316 | py | Python | logic/Sentence.py | niklasschmitz/summy | 0001b1adcf85aa37c34eca6d6ecb861cf7f75ed1 | [
"MIT"
] | 1 | 2018-03-07T23:19:38.000Z | 2018-03-07T23:19:38.000Z | logic/Sentence.py | niklasschmitz/summy | 0001b1adcf85aa37c34eca6d6ecb861cf7f75ed1 | [
"MIT"
] | null | null | null | logic/Sentence.py | niklasschmitz/summy | 0001b1adcf85aa37c34eca6d6ecb861cf7f75ed1 | [
"MIT"
] | null | null | null | class Sentence(object):
"""docstring for Sentence"""
def __init__(self, content=[], score=0):
super(Sentence, self).__init__()
self.content = content
self.score = score
self.kw = []
def __cmp__(self, other):
return self.score.__cmp__(other.score)
def getScore(self):
return self.score
| 22.571429 | 42 | 0.667722 | class Sentence(object):
def __init__(self, content=[], score=0):
super(Sentence, self).__init__()
self.content = content
self.score = score
self.kw = []
def __cmp__(self, other):
return self.score.__cmp__(other.score)
def getScore(self):
return self.score
| true | true |
08f34b16b3150015a5d7bf81010d58d829f29a98 | 569 | py | Python | jsonclasses/modifiers/linkedthru_modifier.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | null | null | null | jsonclasses/modifiers/linkedthru_modifier.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | null | null | null | jsonclasses/modifiers/linkedthru_modifier.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | null | null | null | """module for linkedthru modifier."""
from ..fdef import DeleteRule, Fdef, FStore
from .modifier import Modifier
class LinkedThruModifier(Modifier):
"""Linked by modifier marks a field linked with a joinning table."""
def __init__(self, foreign_key: str) -> None:
self.foreign_key = foreign_key
d... | 31.611111 | 72 | 0.688928 | from ..fdef import DeleteRule, Fdef, FStore
from .modifier import Modifier
class LinkedThruModifier(Modifier):
def __init__(self, foreign_key: str) -> None:
self.foreign_key = foreign_key
def define(self, fdef: Fdef) -> None:
fdef._fstore = FStore.FOREIGN_KEY
fdef._foreign_key = self... | true | true |
08f34b5cb546eca4da74463b672e5e1248d48951 | 2,041 | py | Python | src/cmfsapy/dimension/fsa.py | phrenico/cmfsapy | 9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931 | [
"MIT"
] | null | null | null | src/cmfsapy/dimension/fsa.py | phrenico/cmfsapy | 9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931 | [
"MIT"
] | null | null | null | src/cmfsapy/dimension/fsa.py | phrenico/cmfsapy | 9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.spatial import cKDTree
from multiprocessing import cpu_count
from scipy.stats import hmean
def get_dists_inds_ck(X, k, boxsize):
"""computes the kNN distances and indices
:param numpy.ndarray X: 2D array with data shape: (ndata, n_vars)
:param int k: neighborhood size
:... | 34.59322 | 117 | 0.691818 | import numpy as np
from scipy.spatial import cKDTree
from multiprocessing import cpu_count
from scipy.stats import hmean
def get_dists_inds_ck(X, k, boxsize):
tree = cKDTree(X, boxsize=boxsize)
dists, inds = tree.query(X, k + 1, n_jobs=cpu_count())
return dists, inds
def szepesvari_dimensionality(dists):... | true | true |
08f34d338973ada7986f4f7ca3bba25108902a2e | 5,663 | py | Python | nnet/py_factory.py | sanderisbestok/ExtremeNet | 02c0126581bfdf95885ba55aa12f23de4cf2c12e | [
"BSD-3-Clause"
] | 1 | 2021-05-13T13:37:48.000Z | 2021-05-13T13:37:48.000Z | nnet/py_factory.py | sanderisbestok/ExtremeNet | 02c0126581bfdf95885ba55aa12f23de4cf2c12e | [
"BSD-3-Clause"
] | null | null | null | nnet/py_factory.py | sanderisbestok/ExtremeNet | 02c0126581bfdf95885ba55aa12f23de4cf2c12e | [
"BSD-3-Clause"
] | null | null | null | import os
import torch
import importlib
import torch.nn as nn
import json
from config import system_configs
from models.py_utils.data_parallel import DataParallel
from db.datasets import datasets
torch.manual_seed(317)
class Network(nn.Module):
def __init__(self, model, loss):
super(Network, self).__ini... | 32.734104 | 89 | 0.600918 | import os
import torch
import importlib
import torch.nn as nn
import json
from config import system_configs
from models.py_utils.data_parallel import DataParallel
from db.datasets import datasets
torch.manual_seed(317)
class Network(nn.Module):
def __init__(self, model, loss):
super(Network, self).__ini... | true | true |
08f34f5eed419c5318f0494eede86bbc9f748e72 | 4,525 | py | Python | examples/nlp/training/trainer.py | ORG-MARS/zenml | 8ee9a9264397d4e24a34c906e34a443782b189d3 | [
"Apache-2.0"
] | 1 | 2021-08-13T03:07:53.000Z | 2021-08-13T03:07:53.000Z | examples/nlp/training/trainer.py | ORG-MARS/zenml | 8ee9a9264397d4e24a34c906e34a443782b189d3 | [
"Apache-2.0"
] | null | null | null | examples/nlp/training/trainer.py | ORG-MARS/zenml | 8ee9a9264397d4e24a34c906e34a443782b189d3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) maiot GmbH 2021. 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 applic... | 35.077519 | 78 | 0.609061 |
import os
from typing import List, Text
import tensorflow as tf
from transformers import TFDistilBertForSequenceClassification
from zenml.steps.trainer import TFBaseTrainerStep
from zenml.steps.trainer import utils
class UrduTrainer(TFBaseTrainerStep):
def __init__(self,
model_name: Text,
... | false | true |
08f34faa8202245ba94f34b43441302db71a13bf | 104 | py | Python | hls4ml/model/flow/__init__.py | jaemyungkim/hls4ml | c739c0e05885a7908cbe65cd5cfc62eb6b33fdd0 | [
"Apache-2.0"
] | 380 | 2018-03-12T19:54:35.000Z | 2020-11-09T11:34:18.000Z | hls4ml/model/flow/__init__.py | jaemyungkim/hls4ml | c739c0e05885a7908cbe65cd5cfc62eb6b33fdd0 | [
"Apache-2.0"
] | 174 | 2018-02-16T18:53:21.000Z | 2020-11-06T22:29:22.000Z | hls4ml/model/flow/__init__.py | jaemyungkim/hls4ml | c739c0e05885a7908cbe65cd5cfc62eb6b33fdd0 | [
"Apache-2.0"
] | 138 | 2018-02-24T00:44:00.000Z | 2020-11-04T17:33:57.000Z | from hls4ml.model.flow.flow import get_available_flows, get_flow, get_backend_flows, register_flow, Flow | 104 | 104 | 0.865385 | from hls4ml.model.flow.flow import get_available_flows, get_flow, get_backend_flows, register_flow, Flow | true | true |
08f35090830e654a83413a8baa7b402b1ba2f893 | 4,580 | py | Python | plugins/danbooru.py | SilentVOEZ/haato-bot | 3d4615563d1bc0d491c81bbad050d775545f94b7 | [
"MIT"
] | 4 | 2021-05-13T23:23:25.000Z | 2022-02-17T16:55:18.000Z | plugins/danbooru.py | SilentVOEZ/haato-bot | 3d4615563d1bc0d491c81bbad050d775545f94b7 | [
"MIT"
] | null | null | null | plugins/danbooru.py | SilentVOEZ/haato-bot | 3d4615563d1bc0d491c81bbad050d775545f94b7 | [
"MIT"
] | 1 | 2022-02-17T16:55:10.000Z | 2022-02-17T16:55:10.000Z | import discord
import datetime
import sys
import requests
import json
import random
import asyncio
from discord.ext import commands
class Danbooru(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.cooldown(1, 5, commands.BucketType.channel)
... | 44.466019 | 219 | 0.504803 | import discord
import datetime
import sys
import requests
import json
import random
import asyncio
from discord.ext import commands
class Danbooru(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.cooldown(1, 5, commands.BucketType.channel)
... | true | true |
08f350a266221b742fcfd490266875155af15e5c | 463 | py | Python | dnnae/__init__.py | myinxd/dnnae-gmm | e1c59e2e93772a36797812169cae119ac00184c5 | [
"MIT"
] | 4 | 2018-03-29T12:00:22.000Z | 2020-03-06T17:30:46.000Z | dnnae/__init__.py | myinxd/dnnae-gmm | e1c59e2e93772a36797812169cae119ac00184c5 | [
"MIT"
] | null | null | null | dnnae/__init__.py | myinxd/dnnae-gmm | e1c59e2e93772a36797812169cae119ac00184c5 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Zhixian MA <zx@mazhixian.me>
# Arguments for setup()
__pkgname__ = "dnnae"
__version__ = "0.1.0"
__author__ = "Zhixian MA"
__author_email__ = "zx@mazhiixan.me"
__license__ = "MIT"
__keywords__ = "DNNAE-GMM: a morphology simulator and generator"
__copyright = "Copyright (C) 2018 Zhixian MA"
__url__... | 35.615385 | 101 | 0.75378 |
__pkgname__ = "dnnae"
__version__ = "0.1.0"
__author__ = "Zhixian MA"
__author_email__ = "zx@mazhiixan.me"
__license__ = "MIT"
__keywords__ = "DNNAE-GMM: a morphology simulator and generator"
__copyright = "Copyright (C) 2018 Zhixian MA"
__url__ = "https://github.com/myinxd/dnnae-gmm"
__description__ = ("A toolbox for... | true | true |
08f352dd9e11b459541d760acf23047bd2ef81a2 | 22,667 | py | Python | planning/scenario_planning/common/motion_velocity_optimizer/scripts/trajectory_visualizer.py | KevinXie86/AutowareArchitectureProposal.iv | 28c8c367652bcc5c2548abdab732e0fea7302653 | [
"Apache-2.0"
] | 88 | 2021-01-16T20:05:40.000Z | 2022-03-21T05:40:35.000Z | planning/scenario_planning/common/motion_velocity_optimizer/scripts/trajectory_visualizer.py | KevinXie86/AutowareArchitectureProposal.iv | 28c8c367652bcc5c2548abdab732e0fea7302653 | [
"Apache-2.0"
] | 271 | 2021-01-13T16:54:09.000Z | 2022-02-25T16:26:07.000Z | planning/scenario_planning/common/motion_velocity_optimizer/scripts/trajectory_visualizer.py | KevinXie86/AutowareArchitectureProposal.iv | 28c8c367652bcc5c2548abdab732e0fea7302653 | [
"Apache-2.0"
] | 68 | 2021-01-14T09:16:40.000Z | 2022-03-29T02:15:36.000Z | #!/usr/bin/env python3
# Copyright 2020 Tier IV, 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... | 36.383628 | 96 | 0.601006 |
import argparse
from autoware_planning_msgs.msg import Path
from autoware_planning_msgs.msg import PathWithLaneId
from autoware_planning_msgs.msg import Trajectory
from geometry_msgs.msg import Pose
from geometry_msgs.msg import Twist
from geometry_msgs.msg import TwistStamped
from matplotlib import animation
import... | true | true |
08f353100ce8d5bc1d1de82fa6b3dc8b51706b3c | 6,358 | py | Python | pytrek/engine/Computer.py | hasii2011/PyArcadeStarTrek | 370edbb62f15f69322aa7f109d6d36ebf20cbe4a | [
"MIT"
] | 1 | 2021-06-13T00:56:24.000Z | 2021-06-13T00:56:24.000Z | pytrek/engine/Computer.py | hasii2011/PyArcadeStarTrek | 370edbb62f15f69322aa7f109d6d36ebf20cbe4a | [
"MIT"
] | 94 | 2021-04-16T20:34:10.000Z | 2022-01-13T19:58:20.000Z | pytrek/engine/Computer.py | hasii2011/PyArcadeStarTrek | 370edbb62f15f69322aa7f109d6d36ebf20cbe4a | [
"MIT"
] | null | null | null |
from logging import Logger
from logging import getLogger
from math import atan2
from math import degrees
from math import floor
from math import sqrt
from pytrek.Constants import CONSOLE_HEIGHT
from pytrek.Constants import HALF_QUADRANT_PIXEL_HEIGHT
from pytrek.Constants import HALF_QUADRANT_PIXEL_WIDTH
from pytr... | 30.714976 | 123 | 0.645958 |
from logging import Logger
from logging import getLogger
from math import atan2
from math import degrees
from math import floor
from math import sqrt
from pytrek.Constants import CONSOLE_HEIGHT
from pytrek.Constants import HALF_QUADRANT_PIXEL_HEIGHT
from pytrek.Constants import HALF_QUADRANT_PIXEL_WIDTH
from pytr... | true | true |
08f3533e58b80d09ead597aad71ef23db390798c | 623 | py | Python | lighthouse/config/schemas.py | BenTopping/lighthouse | 649b442ca89f7deb7c01411faa883c1894b72986 | [
"MIT"
] | null | null | null | lighthouse/config/schemas.py | BenTopping/lighthouse | 649b442ca89f7deb7c01411faa883c1894b72986 | [
"MIT"
] | null | null | null | lighthouse/config/schemas.py | BenTopping/lighthouse | 649b442ca89f7deb7c01411faa883c1894b72986 | [
"MIT"
] | null | null | null | PRIORITY_SAMPLES_SCHEMA = {
"sample_id": {
"type": "objectid",
"required": True,
"unique": True,
"check_with": "required_bools", # validator defined in lighthouse.validators.priority_samples.py
},
"must_sequence": {
"type": "boolean",
"required": False,
}... | 27.086957 | 105 | 0.550562 | PRIORITY_SAMPLES_SCHEMA = {
"sample_id": {
"type": "objectid",
"required": True,
"unique": True,
"check_with": "required_bools", },
"must_sequence": {
"type": "boolean",
"required": False,
},
"preferentially_sequence": {
"type": "boolean",
... | true | true |
08f354eb320a426d3c291bf1cd820f2884dc5a16 | 11,948 | py | Python | PyRAI2MD/Machine_Learning/pyNNsMD/nn_pes_src/training/training_mlp_g2.py | lopez-lab/PyRAI2MD | 43e27fbc9bc5b6ab6a8f170791951f316fcd0964 | [
"MIT"
] | 12 | 2021-10-20T23:41:34.000Z | 2022-03-29T23:29:21.000Z | PyRAI2MD/Machine_Learning/pyNNsMD/nn_pes_src/training/training_mlp_g2.py | lopez-lab/PyRAI2MD | 43e27fbc9bc5b6ab6a8f170791951f316fcd0964 | [
"MIT"
] | null | null | null | PyRAI2MD/Machine_Learning/pyNNsMD/nn_pes_src/training/training_mlp_g2.py | lopez-lab/PyRAI2MD | 43e27fbc9bc5b6ab6a8f170791951f316fcd0964 | [
"MIT"
] | 4 | 2021-02-06T04:27:01.000Z | 2022-03-29T23:29:28.000Z | """
The main training script for energy gradient model. Called with ArgumentParse.
"""
# from sklearn.utils import shuffle
# import time
import matplotlib as mpl
import numpy as np
import tensorflow as tf
mpl.use('Agg')
import os
import json
import pickle
import sys
sys.path.append('%s/PyRAI2MD/Machine_Learning' % os.... | 39.826667 | 120 | 0.653415 | import matplotlib as mpl
import numpy as np
import tensorflow as tf
mpl.use('Agg')
import os
import json
import pickle
import sys
sys.path.append('%s/PyRAI2MD/Machine_Learning' % os.environ['PYRAI2MD'])
import argparse
parser = argparse.ArgumentParser(description='Train a energy-gradient model from data, parameters g... | true | true |
08f354fc77ac5a02582e28d8da47fcf1bba7caa4 | 7,893 | py | Python | scripts/cnocr_train.py | E1223even12011/OCR-Project | 14a53c43147f237a112c0e3f3f649dd8a27454eb | [
"Apache-2.0"
] | 5 | 2020-05-06T14:33:54.000Z | 2021-12-19T12:59:46.000Z | scripts/cnocr_train.py | SagaFav/cnocr | 47580e3a21b9815372b31ab4d8e0e2c8812ab838 | [
"Apache-2.0"
] | 4 | 2021-03-19T11:41:58.000Z | 2022-03-12T00:20:56.000Z | scripts/cnocr_train.py | SagaFav/cnocr | 47580e3a21b9815372b31ab4d8e0e2c8812ab838 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"... | 43.85 | 147 | 0.676676 | from __future__ import print_function
import argparse
import logging
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from cnocr.__version__ import __version__
from cnocr.utils import data_dir
from cnocr.hyperparams.cn_hyperparams import CnHyperparams as Hyperparams... | true | true |
08f355c2ca975af5adb9a40fb4983ec6f89cfe58 | 159,436 | py | Python | emcc.py | matanui159/emscripten | a02663f87eb1291aab1308daee3063660c4098b6 | [
"MIT"
] | null | null | null | emcc.py | matanui159/emscripten | a02663f87eb1291aab1308daee3063660c4098b6 | [
"MIT"
] | null | null | null | emcc.py | matanui159/emscripten | a02663f87eb1291aab1308daee3063660c4098b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2011 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""emcc - compiler helper script
=============... | 40.538012 | 372 | 0.703643 |
from tools.toolchain_profiler import ToolchainProfiler
import base64
import json
import logging
import os
import re
import shlex
import shutil
import stat
import sys
import time
from enum import Enum, unique, auto
from subprocess import PIPE
from urllib.parse import quote
import emscripten
from tools import shared... | true | true |
08f35642d4a1cc2bce20047332098f1af29d6069 | 11,065 | py | Python | src/gluonts/torch/model/deepar/estimator.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | src/gluonts/torch/model/deepar/estimator.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | src/gluonts/torch/model/deepar/estimator.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 34.256966 | 79 | 0.610935 |
from typing import List, Optional, Iterable, Dict, Any
import torch
from torch.utils.data import DataLoader
from gluonts.core.component import validated
from gluonts.dataset.common import Dataset
from gluonts.dataset.field_names import FieldName
from gluonts.itertools import Cyclic, PseudoShuffled, IterableSlice
fro... | true | true |
08f357799195191d6c3c694fcee876aa4976f827 | 27,075 | py | Python | neutron_lib/exceptions/__init__.py | rolaya/neutron-lib | 41a2226dfb93a0e6138de260f5126fa7c954178c | [
"Apache-2.0"
] | null | null | null | neutron_lib/exceptions/__init__.py | rolaya/neutron-lib | 41a2226dfb93a0e6138de260f5126fa7c954178c | [
"Apache-2.0"
] | null | null | null | neutron_lib/exceptions/__init__.py | rolaya/neutron-lib | 41a2226dfb93a0e6138de260f5126fa7c954178c | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 VMware, Inc, 2015 A10 Networks, 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
#
#... | 33.058608 | 79 | 0.693666 |
from oslo_utils import excutils
import six
from neutron_lib._i18n import _
class NeutronException(Exception):
message = _("An unknown exception occurred.")
def __init__(self, **kwargs):
try:
super(NeutronException, self).__init__(self.message % kwargs)
self.msg = self.messa... | true | true |
08f3591bc9d54a1705d7cd912e1478187797236a | 34,828 | py | Python | conference.py | jasonthomas/udacity-fullstack-project4 | f0d8f4acaf612a6cddc642bc0b8f25725331da3c | [
"Apache-2.0"
] | null | null | null | conference.py | jasonthomas/udacity-fullstack-project4 | f0d8f4acaf612a6cddc642bc0b8f25725331da3c | [
"Apache-2.0"
] | null | null | null | conference.py | jasonthomas/udacity-fullstack-project4 | f0d8f4acaf612a6cddc642bc0b8f25725331da3c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | 38.188596 | 113 | 0.612668 |
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
from google.appengine.api import memcache
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
fr... | true | true |
08f35bf8daf6279a4a67d3e9296651d7124007a6 | 10,354 | py | Python | test/unit/TestPluribus.py | bodhwani/pypluribus | 53353c2e715b2b3992e3c75785e315025ddafae2 | [
"Apache-2.0"
] | 2 | 2016-06-18T23:52:32.000Z | 2019-03-01T15:49:52.000Z | test/unit/TestPluribus.py | bodhwani/pypluribus | 53353c2e715b2b3992e3c75785e315025ddafae2 | [
"Apache-2.0"
] | 7 | 2016-03-10T18:25:01.000Z | 2018-01-14T11:07:45.000Z | test/unit/TestPluribus.py | bodhwani/pypluribus | 53353c2e715b2b3992e3c75785e315025ddafae2 | [
"Apache-2.0"
] | 3 | 2017-10-19T12:04:20.000Z | 2017-10-19T13:41:49.000Z | # -*- coding: utf-8 -*-
"""
TestPluribus.py: this is a tester for the pyPluribus library. Will try to open & close connection to the device,
test basic getters such as CLI and execute_show and will test an end-to-end scenario of a configuration change history.
"""
# stdlib
from __future__ import absolute_import
impor... | 47.935185 | 120 | 0.663995 |
from __future__ import absolute_import
import unittest
import pyPluribus.exceptions
from pyPluribus import PluribusDevice
__author__ = "Mircea Ulinic"
__copyright__ = 'Copyright 2016, CloudFlare, Inc.'
__license__ = "Apache"
__maintainer__ = "Mircea Ulinic"
__contact__ = "mircea@cloudflare.com"
__status__ = "Protot... | true | true |
08f35c614e72797b01d244731b3a27ff44bd2c78 | 97 | py | Python | test/end-to-end/Enums/Python/direction.py | HighSchoolHacking/GLS-Draft | 9e418b6290e7c8e3f2da87668784bdba1cde5a76 | [
"MIT"
] | 30 | 2019-10-29T12:47:50.000Z | 2022-02-12T06:41:39.000Z | test/end-to-end/Enums/Python/direction.py | HighSchoolHacking/GLS-Draft | 9e418b6290e7c8e3f2da87668784bdba1cde5a76 | [
"MIT"
] | 247 | 2017-09-21T17:11:18.000Z | 2019-10-08T12:59:07.000Z | test/end-to-end/Enums/Python/direction.py | HighSchoolHacking/GLS-Draft | 9e418b6290e7c8e3f2da87668784bdba1cde5a76 | [
"MIT"
] | 17 | 2017-10-01T16:53:20.000Z | 2018-11-28T07:20:35.000Z | from enum import Enum
class Direction(Enum):
Unknown = 0
Horizontal = 1
Vertical = 2
| 16.166667 | 22 | 0.659794 | from enum import Enum
class Direction(Enum):
Unknown = 0
Horizontal = 1
Vertical = 2
| true | true |
08f35ccf097a819970c9ba0440ab839935cb5c68 | 391 | py | Python | Prueba1/Prueba1/asgi.py | Felipinza/TallerMecanico | abdb23285e09b42dfee69644d8b2ae761e42aa15 | [
"Unlicense"
] | null | null | null | Prueba1/Prueba1/asgi.py | Felipinza/TallerMecanico | abdb23285e09b42dfee69644d8b2ae761e42aa15 | [
"Unlicense"
] | null | null | null | Prueba1/Prueba1/asgi.py | Felipinza/TallerMecanico | abdb23285e09b42dfee69644d8b2ae761e42aa15 | [
"Unlicense"
] | null | null | null | """
ASGI config for Prueba1 project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Prueba1.settings')
application = get_asgi_application()
| true | true |
08f35efb4f8c3a9c0888032f6839f112a6f01e9b | 2,816 | py | Python | project/models.py | lucrae/brisland | 6260223a45581168229a3cde9cd034d83d726a90 | [
"MIT"
] | 1 | 2021-06-30T14:38:46.000Z | 2021-06-30T14:38:46.000Z | project/models.py | lucrae/brisland | 6260223a45581168229a3cde9cd034d83d726a90 | [
"MIT"
] | null | null | null | project/models.py | lucrae/brisland | 6260223a45581168229a3cde9cd034d83d726a90 | [
"MIT"
] | null | null | null | import secrets
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin
db = SQLAlchemy()
login_manager = LoginManager()
@login_manager.user_loader
def load_user(user_id):
return ... | 37.052632 | 94 | 0.657315 | import secrets
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin
db = SQLAlchemy()
login_manager = LoginManager()
@login_manager.user_loader
def load_user(user_id):
return ... | true | true |
08f35f051f896b990c10ef44a8c6c162f2ce6987 | 6,622 | py | Python | src/VariantBoosting/RVBoostLikeR/RVBoostLikeR_wrapper_separate.py | brianjohnhaas/ctat-mutations | 724c2dfbd56cb83b021ad16889998a1ed0e11b70 | [
"BSD-3-Clause"
] | null | null | null | src/VariantBoosting/RVBoostLikeR/RVBoostLikeR_wrapper_separate.py | brianjohnhaas/ctat-mutations | 724c2dfbd56cb83b021ad16889998a1ed0e11b70 | [
"BSD-3-Clause"
] | null | null | null | src/VariantBoosting/RVBoostLikeR/RVBoostLikeR_wrapper_separate.py | brianjohnhaas/ctat-mutations | 724c2dfbd56cb83b021ad16889998a1ed0e11b70 | [
"BSD-3-Clause"
] | 1 | 2021-03-11T17:16:59.000Z | 2021-03-11T17:16:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, re
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
import datetime
import subprocess
import argparse
import logging
FORMAT = "%(asctime)-15s: %(levelname)s %(module)s.%(name)s.%(funcName)s %(message)s"
logger = logging... | 36.384615 | 143 | 0.610239 |
import os, sys, re
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
import datetime
import subprocess
import argparse
import logging
FORMAT = "%(asctime)-15s: %(levelname)s %(module)s.%(name)s.%(funcName)s %(message)s"
logger = logging.getLogger('ctat_mutations')
logging.basicConf... | true | true |
08f35f3dffde038a2a0542ce55bda890e63e845e | 10,709 | py | Python | 1-grid-world/2-value-iteration/environment.py | ljh4697/reinforcement-learning-kr-v2 | f7c4ae038796db252b172136f0ca895dc6183cb8 | [
"MIT"
] | null | null | null | 1-grid-world/2-value-iteration/environment.py | ljh4697/reinforcement-learning-kr-v2 | f7c4ae038796db252b172136f0ca895dc6183cb8 | [
"MIT"
] | null | null | null | 1-grid-world/2-value-iteration/environment.py | ljh4697/reinforcement-learning-kr-v2 | f7c4ae038796db252b172136f0ca895dc6183cb8 | [
"MIT"
] | null | null | null | import tkinter as tk
import time
import numpy as np
import random
from PIL import ImageTk, Image
PhotoImage = ImageTk.PhotoImage
UNIT = 100 # 픽셀 수
HEIGHT = 5 # 그리드월드 세로
WIDTH = 5 # 그리드월드 가로
TRANSITION_PROB = 1
POSSIBLE_ACTIONS = [0, 1, 2, 3] # 상, 하, 좌, 우
ACTIONS = [(-1, 0), (1, 0), (0, -1), (0, 1)] # 좌표로 나타낸 행동
R... | 41.030651 | 150 | 0.567653 | import tkinter as tk
import time
import numpy as np
import random
from PIL import ImageTk, Image
PhotoImage = ImageTk.PhotoImage
UNIT = 100 HEIGHT = 5 WIDTH = 5 TRANSITION_PROB = 1
POSSIBLE_ACTIONS = [0, 1, 2, 3] ACTIONS = [(-1, 0), (1, 0), (0, -1), (0, 1)] REWARDS = []
class GraphicDisplay(tk.Tk):
def __in... | true | true |
08f360e54a6c756d2796c0483a77c21796c67d45 | 4,453 | py | Python | pythonProject1/venv/Lib/site-packages/pyquickhelper/ipythonhelper/magic_class_crypt.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/pyquickhelper/ipythonhelper/magic_class_crypt.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/pyquickhelper/ipythonhelper/magic_class_crypt.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@file
@brief Magic command to handle files
"""
import os
from IPython.core.magic import magics_class, line_magic
from .magic_class import MagicClassWithHelpers
from .magic_parser import MagicCommandParser
from ..filehelper import encrypt_stream, decrypt_stream
@magics_class
class MagicCry... | 30.923611 | 92 | 0.564339 | import os
from IPython.core.magic import magics_class, line_magic
from .magic_class import MagicClassWithHelpers
from .magic_parser import MagicCommandParser
from ..filehelper import encrypt_stream, decrypt_stream
@magics_class
class MagicCrypt(MagicClassWithHelpers):
@staticmethod
def endecrypt_file_parse... | true | true |
08f36134d5435d68c993dfe1a9d96d84c4663352 | 3,156 | py | Python | nova/tests/unit/policies/test_floating_ip_pools.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,874 | 2015-01-04T05:18:34.000Z | 2022-03-31T03:30:28.000Z | nova/tests/unit/policies/test_floating_ip_pools.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 40 | 2015-04-13T02:32:42.000Z | 2022-02-16T02:28:06.000Z | nova/tests/unit/policies/test_floating_ip_pools.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,996 | 2015-01-04T15:11:51.000Z | 2022-03-31T11:03:13.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 42.08 | 78 | 0.718631 |
import mock
from nova.api.openstack.compute import floating_ip_pools
from nova.tests.unit.api.openstack import fakes
from nova.tests.unit.policies import base
class FloatingIPPoolsPolicyTest(base.BasePolicyTest):
def setUp(self):
super(FloatingIPPoolsPolicyTest, self).setUp()
self.controller = ... | true | true |
08f36223f66f36b66171e53ad179e70874d79247 | 29,536 | py | Python | pytiled_parser/xml_parser.py | AberDerBart/pytiled_parser | fae609deb651013eeab7dd914e79489471a46dfb | [
"MIT"
] | null | null | null | pytiled_parser/xml_parser.py | AberDerBart/pytiled_parser | fae609deb651013eeab7dd914e79489471a46dfb | [
"MIT"
] | null | null | null | pytiled_parser/xml_parser.py | AberDerBart/pytiled_parser | fae609deb651013eeab7dd914e79489471a46dfb | [
"MIT"
] | null | null | null | """Handle XML parsing for TMX files"""
import base64
import functools
import gzip
import re
import xml.etree.ElementTree as etree
import zlib
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Union
import pytiled_parser.objects as objects
from pytiled_parser.utilities import parse_col... | 30.927749 | 112 | 0.614132 |
import base64
import functools
import gzip
import re
import xml.etree.ElementTree as etree
import zlib
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Union
import pytiled_parser.objects as objects
from pytiled_parser.utilities import parse_color
def _decode_base64_data(
data_t... | true | true |
08f363c0cef7f3ff74443beb8073fc9f16b03076 | 1,015 | py | Python | deps/libgraphqlparser/ast/c_visitor_impl.py | dosten/libgraphqlparser-php | 9c9c87266e199524edec8f9a48c0dcb2769418e3 | [
"MIT"
] | 32 | 2016-10-28T23:16:37.000Z | 2021-11-13T18:58:06.000Z | deps/libgraphqlparser/ast/c_visitor_impl.py | dosten/libgraphqlparser-php | 9c9c87266e199524edec8f9a48c0dcb2769418e3 | [
"MIT"
] | 3 | 2016-10-24T13:22:11.000Z | 2018-04-04T10:49:44.000Z | deps/libgraphqlparser/ast/c_visitor_impl.py | dosten/libgraphqlparser-php | 9c9c87266e199524edec8f9a48c0dcb2769418e3 | [
"MIT"
] | 3 | 2017-02-11T23:08:45.000Z | 2020-12-22T16:43:39.000Z | # Copyright (c) 2015, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from casing import snake
from li... | 24.166667 | 85 | 0.689655 |
from casing import snake
from license import C_LICENSE_COMMENT
class Printer(object):
'''Printer for a simple list of types to be visited by the C visitor.
'''
def __init__(self):
self._types = []
def start_file(self):
print C_LICENSE_COMMENT + '/** @generated */'
print '#define FOR_EACH_CONCRET... | false | true |
08f364531b9eca0bc2f8d79c2d0303829f772923 | 2,159 | py | Python | geocoder/cli.py | star-is-here/geocoder | 31b5ccdf54f199d7640995a787c84909687ee03c | [
"MIT"
] | 1 | 2021-02-08T13:30:00.000Z | 2021-02-08T13:30:00.000Z | geocoder/cli.py | star-is-here/geocoder | 31b5ccdf54f199d7640995a787c84909687ee03c | [
"MIT"
] | null | null | null | geocoder/cli.py | star-is-here/geocoder | 31b5ccdf54f199d7640995a787c84909687ee03c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
import click
import json
import geocoder
import os
import fileinput
from geocoder.api import options
providers = sorted(options.keys())
methods = ['geocode', 'reverse', 'elevation', 'timezone', 'places']
outputs = ['json', 'osm', 'geojson', 'wkt... | 29.575342 | 78 | 0.629921 |
from __future__ import absolute_import
import click
import json
import geocoder
import os
import fileinput
from geocoder.api import options
providers = sorted(options.keys())
methods = ['geocode', 'reverse', 'elevation', 'timezone', 'places']
outputs = ['json', 'osm', 'geojson', 'wkt']
units = ['kilometers', 'miles'... | true | true |
08f364e253d08b254b51d2aa80c184d8ad41cb5c | 4,299 | py | Python | perma_web/perma/settings/deployments/settings_testing.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | 317 | 2015-02-12T16:53:34.000Z | 2022-03-14T23:38:04.000Z | perma_web/perma/settings/deployments/settings_testing.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | 2,069 | 2015-01-06T20:09:24.000Z | 2022-03-31T15:44:36.000Z | perma_web/perma/settings/deployments/settings_testing.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | 69 | 2015-01-12T18:56:07.000Z | 2022-02-22T19:57:10.000Z | import os
from .settings_dev import *
#########
# Setup #
#########
FIXTURE_DIRS = (
PROJECT_ROOT,
)
#############
# Overrides #
#############
RUN_TASKS_ASYNC = False # avoid sending celery tasks to queue -- just run inline
SUBDOMAIN_URLCONFS = {}
DEBUG = False
TESTING = True
ADMINS = (
("Admin's Name... | 26.537037 | 104 | 0.611305 | import os
from .settings_dev import *
FIXTURE_DIRS = (
PROJECT_ROOT,
)
RUN_TASKS_ASYNC = False
SUBDOMAIN_URLCONFS = {}
DEBUG = False
TESTING = True
ADMINS = (
("Admin's Name", 'admin@example.com'),
)
###############
# Speed Hacks #
###############
# Reference:
# - https://docs.djangoproject.com/en/1... | true | true |
08f365a3e880ced6b31f7f83ef0063f084efcc99 | 263 | py | Python | kibom/sort.py | gbmhunter/KiBoM | d47196eaee99041371c9e6217b7bfefba85a71a2 | [
"MIT"
] | 274 | 2016-05-17T07:57:33.000Z | 2022-03-30T15:58:52.000Z | kibom/sort.py | gbmhunter/KiBoM | d47196eaee99041371c9e6217b7bfefba85a71a2 | [
"MIT"
] | 141 | 2016-08-01T19:04:40.000Z | 2022-03-31T14:29:00.000Z | kibom/sort.py | gbmhunter/KiBoM | d47196eaee99041371c9e6217b7bfefba85a71a2 | [
"MIT"
] | 91 | 2016-05-15T11:26:26.000Z | 2022-02-23T16:02:35.000Z | # -*- coding: utf-8 -*-
import re
def natural_sort(string):
"""
Natural sorting function which sorts by numerical value of a string,
rather than raw ASCII value.
"""
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string)]
| 21.916667 | 77 | 0.627376 |
import re
def natural_sort(string):
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string)]
| true | true |
08f365d61804b0e22f0ce43f5d229693349c0b29 | 988 | py | Python | python/ServerClientJS/ServerWebSocket.py | YushchenkoAndrew/template | 35c6bcd2121647015308f0cc110da71aa148d5fb | [
"MIT"
] | 5 | 2020-08-25T11:35:04.000Z | 2021-12-25T18:57:58.000Z | python/ServerClientJS/ServerWebSocket.py | YushchenkoAndrew/template | 35c6bcd2121647015308f0cc110da71aa148d5fb | [
"MIT"
] | null | null | null | python/ServerClientJS/ServerWebSocket.py | YushchenkoAndrew/template | 35c6bcd2121647015308f0cc110da71aa148d5fb | [
"MIT"
] | 3 | 2020-10-08T07:51:33.000Z | 2021-12-29T10:19:24.000Z | import logging
from websocket_server import WebsocketServer
import base64
import sane
from PIL import Image
HOST = '192.168.0.103'
PORT = 13327
FILE_NAME = "Test.bmp"
def scanDoc():
var = sane.init()
devices = var.get_devices()
print("Devices: " + devices)
# Open first device
dev = sane.open(devices[0][0])
... | 19.76 | 60 | 0.72166 | import logging
from websocket_server import WebsocketServer
import base64
import sane
from PIL import Image
HOST = '192.168.0.103'
PORT = 13327
FILE_NAME = "Test.bmp"
def scanDoc():
var = sane.init()
devices = var.get_devices()
print("Devices: " + devices)
dev = sane.open(devices[0][0])
dev.start()
im = d... | true | true |
08f365d70c6bd58068bbea6c05846a399bc3ad48 | 7,158 | py | Python | dateinfer/ruleproc.py | radaisystems/dateinfer | 77014e59d6e664242edd91f74007dc92c24cd5d3 | [
"Apache-2.0"
] | 4 | 2017-07-23T05:53:29.000Z | 2019-08-06T19:28:22.000Z | dateinfer/ruleproc.py | radaisystems/dateinfer | 77014e59d6e664242edd91f74007dc92c24cd5d3 | [
"Apache-2.0"
] | 1 | 2017-06-29T17:02:07.000Z | 2017-06-29T17:14:37.000Z | dateinfer/ruleproc.py | radaisystems/dateinfer | 77014e59d6e664242edd91f74007dc92c24cd5d3 | [
"Apache-2.0"
] | 2 | 2019-05-22T11:07:15.000Z | 2020-10-11T22:02:55.000Z | from dateinfer.date_elements import Filler
class If(object):
"""
Top-level rule
"""
def __init__(self, condition, action):
"""
Initialize the rule with a condition clause and an action clause that will be executed
if condition clause is true.
"""
self.condition ... | 29.216327 | 188 | 0.592763 | from dateinfer.date_elements import Filler
class If(object):
def __init__(self, condition, action):
self.condition = condition
self.action = action
def execute(self, elem_list):
if self.condition.is_true(elem_list):
return self.action.act(elem_list)
else:
... | true | true |
08f366a10c38eb6789cee48dc98047a1590a7e81 | 6,171 | py | Python | src/runner/predictors/dsb15_misr_predictor.py | cmlab-mira/Efficient-and-Phase-aware-Video-Super-resolution-for-Cardiac-MRI | ec01b783f8acd41a7056431bad615896b8495f95 | [
"MIT"
] | 11 | 2020-08-09T08:08:56.000Z | 2022-01-18T14:25:22.000Z | src/runner/predictors/dsb15_misr_predictor.py | cmlab-mira/Efficient-and-Phase-aware-Video-Super-resolution-for-Cardiac-MRI | ec01b783f8acd41a7056431bad615896b8495f95 | [
"MIT"
] | 2 | 2021-09-13T09:48:41.000Z | 2021-11-08T14:20:58.000Z | src/runner/predictors/dsb15_misr_predictor.py | cmlab-mira/Efficient-and-Phase-aware-Video-Super-resolution-for-Cardiac-MRI | ec01b783f8acd41a7056431bad615896b8495f95 | [
"MIT"
] | 4 | 2020-08-30T14:13:35.000Z | 2021-09-14T09:26:55.000Z | import csv
import torch
import logging
import imageio
import numpy as np
import functools
from scipy.misc import imsave
from tqdm import tqdm
from pathlib import Path
from src.runner.predictors.base_predictor import BasePredictor
from src.utils import denormalize
class Dsb15MISRPredictor(BasePredictor):
"""The D... | 38.811321 | 107 | 0.557284 | import csv
import torch
import logging
import imageio
import numpy as np
import functools
from scipy.misc import imsave
from tqdm import tqdm
from pathlib import Path
from src.runner.predictors.base_predictor import BasePredictor
from src.utils import denormalize
class Dsb15MISRPredictor(BasePredictor):
def __in... | true | true |
08f366c273224e96a8c3281648742e5f5f4d506d | 1,204 | py | Python | ciphey/basemods/Decoders/tap_code.py | AlexandruValeanu/Ciphey | 58323db4443b0d29d7797dadab88955a02da8812 | [
"MIT"
] | 9,908 | 2020-06-06T01:06:50.000Z | 2022-03-31T21:22:57.000Z | ciphey/basemods/Decoders/tap_code.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 423 | 2020-05-30T11:44:37.000Z | 2022-03-18T03:15:30.000Z | ciphey/basemods/Decoders/tap_code.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 714 | 2020-06-09T20:24:41.000Z | 2022-03-29T15:28:53.000Z | # by https://github.com/RustyDucky and https://github.com/lukasgabriel
from typing import Dict, Optional
from ciphey.iface import Config, Decoder, ParamSpec, T, Translation, U, registry
@registry.register
class Tap_code(Decoder[str]):
def decode(self, ctext: T) -> Optional[U]:
"""
Performs Tap c... | 27.363636 | 82 | 0.577243 |
from typing import Dict, Optional
from ciphey.iface import Config, Decoder, ParamSpec, T, Translation, U, registry
@registry.register
class Tap_code(Decoder[str]):
def decode(self, ctext: T) -> Optional[U]:
try:
result = ""
combinations = ctext.split(" ")
for fragment... | true | true |
08f367951c04591ebe2fc06e8a14cf784e33f457 | 7,241 | py | Python | api/src/opentrons/commands/commands.py | ferlzc/opentrons | 29fac8ae6e456439f87fce60e8c935c2a2aaa582 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/commands/commands.py | ferlzc/opentrons | 29fac8ae6e456439f87fce60e8c935c2a2aaa582 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/commands/commands.py | ferlzc/opentrons | 29fac8ae6e456439f87fce60e8c935c2a2aaa582 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING, List, Union, overload
from .helpers import stringify_location, listify
from . import types as command_types
from opentrons.types import Location
from opentrons.protocols.api_support.util import FlowRates
if TYPE_CHECKING:
from opentrons.protoc... | 28.065891 | 79 | 0.597984 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Union, overload
from .helpers import stringify_location, listify
from . import types as command_types
from opentrons.types import Location
from opentrons.protocols.api_support.util import FlowRates
if TYPE_CHECKING:
from opentrons.protoc... | true | true |
08f367a61b944f36d110589b5eb11ba8d8c77d8b | 1,339 | py | Python | data_loader.py | cpuimage/segan | 69fbe98209c6b429ecda64ceaf978cfbd479f2b1 | [
"MIT"
] | 3 | 2020-08-29T08:29:42.000Z | 2020-10-13T13:32:35.000Z | data_loader.py | cpuimage/segan | 69fbe98209c6b429ecda64ceaf978cfbd479f2b1 | [
"MIT"
] | 2 | 2020-01-28T22:15:19.000Z | 2020-06-17T21:54:16.000Z | data_loader.py | rickyHong/SEGAN-Tensorflow-1.4-repl | f4db80ef50de0490aea8f3526073a2a45ddc6d9d | [
"MIT"
] | 2 | 2020-10-13T13:31:30.000Z | 2021-12-25T08:58:40.000Z | from __future__ import print_function
import tensorflow as tf
from ops import *
import numpy as np
def pre_emph(x, coeff=0.95):
x0 = tf.reshape(x[0], [1,])
diff = x[1:] - coeff * x[:-1]
concat = tf.concat([x0, diff], 0)
return concat
def de_emph(y, coeff=0.95):
if coeff <= 0:
return y
... | 31.139535 | 67 | 0.604182 | from __future__ import print_function
import tensorflow as tf
from ops import *
import numpy as np
def pre_emph(x, coeff=0.95):
x0 = tf.reshape(x[0], [1,])
diff = x[1:] - coeff * x[:-1]
concat = tf.concat([x0, diff], 0)
return concat
def de_emph(y, coeff=0.95):
if coeff <= 0:
return y
... | true | true |
08f367dda03739d86e8f69fa1dc0bd04d47122c2 | 1,082 | py | Python | cinder/db/sqlalchemy/migrate_repo/versions/102_add_replication_status_to_groups_table.py | alexisries/openstack-cinder | 7cc6e45c5ddb8bf771bdb01b867628e41761ae11 | [
"Apache-2.0"
] | 2 | 2019-05-24T14:13:50.000Z | 2019-05-24T14:21:13.000Z | cinder/db/sqlalchemy/migrate_repo/versions/102_add_replication_status_to_groups_table.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | cinder/db/sqlalchemy/migrate_repo/versions/102_add_replication_status_to_groups_table.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright (C) 2017 Dell Inc. or its subsidiaries.
# 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
#
# ... | 37.310345 | 78 | 0.725508 |
from sqlalchemy import Column
from sqlalchemy import MetaData, String, Table
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
table = Table('groups', meta, autoload=True)
if not hasattr(table.c, 'replication_status'):
new_column = Column('replication_status', Str... | true | true |
08f36805a4e85718dece362edc1accc710017f39 | 2,538 | py | Python | karp/infrastructure/jwt/jwt_auth_service.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | 1 | 2021-12-08T15:33:42.000Z | 2021-12-08T15:33:42.000Z | karp/infrastructure/jwt/jwt_auth_service.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | null | null | null | karp/infrastructure/jwt/jwt_auth_service.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | null | null | null | """Module for jwt-based authentication."""
from karp.services import context
from pathlib import Path
import time
from typing import List
import jwt
import jwt.exceptions as jwte # pyre-ignore
from karp.domain import errors, value_objects
from karp.domain.models.user import User
from karp.domain.errors import AuthEr... | 32.961039 | 81 | 0.657998 | from karp.services import context
from pathlib import Path
import time
from typing import List
import jwt
import jwt.exceptions as jwte
from karp.domain import errors, value_objects
from karp.domain.models.user import User
from karp.domain.errors import AuthError
from karp.services import auth_service, context, unit... | true | true |
08f369241df4535b3220e7e11dfae4b79ef7d98a | 1,717 | py | Python | meiduo_mall/apps/areas/models.py | love20ai/shangchengxiangmu | 55ab7f5d2daa59a068255037d2c97d6846115542 | [
"MIT"
] | 1 | 2019-11-04T03:52:08.000Z | 2019-11-04T03:52:08.000Z | meiduo_mall/apps/areas/models.py | love20ai/shangchengxiangmu | 55ab7f5d2daa59a068255037d2c97d6846115542 | [
"MIT"
] | null | null | null | meiduo_mall/apps/areas/models.py | love20ai/shangchengxiangmu | 55ab7f5d2daa59a068255037d2c97d6846115542 | [
"MIT"
] | null | null | null | from django.db import models
from utils.models import BaseModel
class Area(models.Model):
"""省市区"""
name = models.CharField(max_length=20, verbose_name='名称')
# related_name='subs' == area_set
parent = models.ForeignKey('self', on_delete=models.SET_NULL, related_name='subs', null=True, blank=True, v... | 42.925 | 132 | 0.70763 | from django.db import models
from utils.models import BaseModel
class Area(models.Model):
name = models.CharField(max_length=20, verbose_name='名称')
parent = models.ForeignKey('self', on_delete=models.SET_NULL, related_name='subs', null=True, blank=True, verbose_name='上级行政区划')
class Meta:
db... | true | true |
08f36a32fea93b05d6f5c0d6c76a183709be998a | 944 | py | Python | distributed/deploy/utils_test.py | edyounis/distributed | bb091d5ec7d3ce4eb4a58e0957cba9cdf3da1d6a | [
"BSD-3-Clause"
] | null | null | null | distributed/deploy/utils_test.py | edyounis/distributed | bb091d5ec7d3ce4eb4a58e0957cba9cdf3da1d6a | [
"BSD-3-Clause"
] | 1 | 2022-02-28T22:02:10.000Z | 2022-02-28T22:02:10.000Z | distributed/deploy/utils_test.py | graingert/distributed | 5feb17151cdf660a3443abf8596444a9f51dc575 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from typing import Any
import pytest
from distributed.client import Client
class ClusterTest:
Cluster = None
kwargs: dict[str, Any] = {}
def setUp(self):
self.cluster = self.Cluster(2, scheduler_port=0, **self.kwargs)
self.client = Client(self.cluster... | 24.205128 | 71 | 0.627119 | from __future__ import annotations
from typing import Any
import pytest
from distributed.client import Client
class ClusterTest:
Cluster = None
kwargs: dict[str, Any] = {}
def setUp(self):
self.cluster = self.Cluster(2, scheduler_port=0, **self.kwargs)
self.client = Client(self.cluster... | true | true |
08f36a5560583131dd7240dcd73d5bb8736d104f | 23,555 | py | Python | catbAbI/trainers/catbAbI_trainer.py | ischlag/Fast-Weight-Memory-public | 64c077f02ec320ec535cb66db3600453e1ef445f | [
"MIT"
] | 17 | 2021-01-17T02:13:15.000Z | 2021-12-12T13:55:33.000Z | catbAbI/trainers/catbAbI_trainer.py | ischlag/Fast-Weight-Memory-public | 64c077f02ec320ec535cb66db3600453e1ef445f | [
"MIT"
] | null | null | null | catbAbI/trainers/catbAbI_trainer.py | ischlag/Fast-Weight-Memory-public | 64c077f02ec320ec535cb66db3600453e1ef445f | [
"MIT"
] | 5 | 2021-03-08T16:10:38.000Z | 2022-01-04T14:42:16.000Z | """
Implements the trainer class that keeps track of the training state with some features:
- saves best and last model after every evaluation
- uses the log function to log terminal/text file
- can restore the state of a training run and continue seamlessly
- early stopping
- saves last model whenever it logs (remove ... | 34.948071 | 104 | 0.642963 |
import os
import numpy as np
import torch
import copy
from tensorboardX import SummaryWriter
from munch import Munch, munchify
from utils.lib import *
BEST_MODEL_FILE_NAME = "best_eval_state.pt"
LAST_MODEL_FILE_NAME = "last_eval_state.pt"
TF_TRAIN_FOLDER_NAME = "train"
TF_EVAL_FOLDER_NAME = "valid"
CSV_FILE_NAME = "... | true | true |
08f36aed07b1f89571cb4230d206dd0132fd34d3 | 3,763 | py | Python | fabio/test/testnumpyimage.py | CPrescher/fabio | 9f3e8ec347d75d27dd5e11087555810a01864fae | [
"Apache-2.0"
] | null | null | null | fabio/test/testnumpyimage.py | CPrescher/fabio | 9f3e8ec347d75d27dd5e11087555810a01864fae | [
"Apache-2.0"
] | null | null | null | fabio/test/testnumpyimage.py | CPrescher/fabio | 9f3e8ec347d75d27dd5e11087555810a01864fae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fable Input Output
# https://github.com/silx-kit/fabio
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software: you... | 34.522936 | 89 | 0.634069 | __author__ = "Jérôme Kieffer"
__date__ = "16/06/2016"
import os
import sys
import unittest
if __name__ == '__main__':
import pkgutil
__path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
from .utilstest import UtilsTest
import numpy
logger = UtilsTest.get_logger(__file__)
fabio = sys.modules... | true | true |
08f36b6044dfa94b8820036b5eee7c15f690884a | 8,990 | py | Python | discord/ext/commands/cooldowns.py | jen140/discord.py | 1ee23a235eecfe88e45218c6df931530970dc562 | [
"MIT"
] | 2 | 2020-06-13T19:59:45.000Z | 2020-06-18T08:32:08.000Z | discord/ext/commands/cooldowns.py | jen140/discord.py | 1ee23a235eecfe88e45218c6df931530970dc562 | [
"MIT"
] | 3 | 2020-07-28T23:16:47.000Z | 2020-08-04T10:40:32.000Z | discord/ext/commands/cooldowns.py | jen140/discord.py | 1ee23a235eecfe88e45218c6df931530970dc562 | [
"MIT"
] | 2 | 2020-07-22T07:54:49.000Z | 2020-07-27T20:02:15.000Z | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 31.65493 | 108 | 0.625806 |
from discord.enums import Enum
import time
import asyncio
from collections import deque
from ...abc import PrivateChannel
from .errors import MaxConcurrencyReached
__all__ = (
'BucketType',
'Cooldown',
'CooldownMapping',
'MaxConcurrency',
)
class BucketType(Enum):
default = 0
user = 1
... | true | true |
08f36b8197d8e5d10f69316cbd2df49c4ab14f77 | 1,834 | py | Python | quadpy/tetrahedron/_yu.py | dariusarnold/quadpy | 9dc7c1ebff99d15ae57ed9195cde94d97a599be8 | [
"MIT"
] | null | null | null | quadpy/tetrahedron/_yu.py | dariusarnold/quadpy | 9dc7c1ebff99d15ae57ed9195cde94d97a599be8 | [
"MIT"
] | null | null | null | quadpy/tetrahedron/_yu.py | dariusarnold/quadpy | 9dc7c1ebff99d15ae57ed9195cde94d97a599be8 | [
"MIT"
] | null | null | null | from sympy import Rational as frac
from sympy import sqrt
from ..helpers import article
from ._helpers import TetrahedronScheme, concat, s4, s31, s211
citation = article(
authors=["Yu Jinyun"],
title="Symmetyric Gaussian quadrature formulae for tetrahedronal regions",
journal="Computer Methods in Applied ... | 30.566667 | 81 | 0.660851 | from sympy import Rational as frac
from sympy import sqrt
from ..helpers import article
from ._helpers import TetrahedronScheme, concat, s4, s31, s211
citation = article(
authors=["Yu Jinyun"],
title="Symmetyric Gaussian quadrature formulae for tetrahedronal regions",
journal="Computer Methods in Applied ... | true | true |
08f36bb15bb9a2656abde43218f74f2cfdd6cced | 73,231 | py | Python | release/scripts/startup/bl_ui/space_userpref.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_ui/space_userpref.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/startup/bl_ui/space_userpref.py | vlobanov/blender | 5c58740a08ef369435b48093b91fa7075fef8383 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 33.918944 | 124 | 0.637339 |
import bpy
from bpy.types import (
Header,
Menu,
Panel,
)
from bpy.app.translations import pgettext_iface as iface_
from bpy.app.translations import contexts as i18n_contexts
class USERPREF_HT_header(Header):
bl_space_type = 'PREFERENCES'
@staticmethod
def draw_buttons(layout, context):
... | true | true |
08f36bbe534206b8a24a5649b419c626e0d358ba | 902 | py | Python | cvsutils/commands/show_project.py | zpahuja/cvsutils | a4acfe49355e2eea55ba62687e4f1219d142a694 | [
"MIT"
] | 1 | 2020-09-10T00:15:46.000Z | 2020-09-10T00:15:46.000Z | cvsutils/commands/show_project.py | zpahuja/cvsutils | a4acfe49355e2eea55ba62687e4f1219d142a694 | [
"MIT"
] | null | null | null | cvsutils/commands/show_project.py | zpahuja/cvsutils | a4acfe49355e2eea55ba62687e4f1219d142a694 | [
"MIT"
] | 1 | 2021-08-11T00:20:24.000Z | 2021-08-11T00:20:24.000Z | import argparse
import uuid
from ..common import Environment
from ..training_api import TrainingApi
def show_project(env, project_id):
training_api = TrainingApi(env)
project = training_api.get_project(project_id)
num_images = training_api.get_num_images(project_id)
print(f"Name: {project['name']}")... | 25.055556 | 56 | 0.685144 | import argparse
import uuid
from ..common import Environment
from ..training_api import TrainingApi
def show_project(env, project_id):
training_api = TrainingApi(env)
project = training_api.get_project(project_id)
num_images = training_api.get_num_images(project_id)
print(f"Name: {project['name']}")... | true | true |
08f36bc52121ac70613256816bb38df7009af241 | 3,734 | py | Python | ethereumetl/jobs/export_contracts_job.py | credmark/ethereum-etl | c135afc4bccb14436f401862f98e23198ff087f2 | [
"MIT"
] | 1,482 | 2018-09-13T10:40:55.000Z | 2022-03-31T12:22:29.000Z | ethereumetl/jobs/export_contracts_job.py | credmark/ethereum-etl | c135afc4bccb14436f401862f98e23198ff087f2 | [
"MIT"
] | 186 | 2018-09-13T12:39:04.000Z | 2022-03-30T15:32:42.000Z | ethereumetl/jobs/export_contracts_job.py | adidonato/ethereum-etl | 12c5092c76b7fc319ff373e1302be8b0e39960d7 | [
"MIT"
] | 391 | 2018-09-16T18:54:44.000Z | 2022-03-27T10:47:48.000Z | # MIT License
#
# Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | 41.488889 | 100 | 0.753883 |
import json
from ethereumetl.executors.batch_work_executor import BatchWorkExecutor
from blockchainetl.jobs.base_job import BaseJob
from ethereumetl.json_rpc_requests import generate_get_code_json_rpc
from ethereumetl.mappers.contract_mapper import EthContractMapper
from ethereumetl.service.eth_contract_service imp... | true | true |
08f36bda942818d3a6e6b5c63b64b6a193f6f615 | 7,117 | py | Python | broadlink/__init__.py | kisaragychihaya/python-broadlink | c5a424036cffda5120574d166d29f5a015333083 | [
"MIT"
] | null | null | null | broadlink/__init__.py | kisaragychihaya/python-broadlink | c5a424036cffda5120574d166d29f5a015333083 | [
"MIT"
] | null | null | null | broadlink/__init__.py | kisaragychihaya/python-broadlink | c5a424036cffda5120574d166d29f5a015333083 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""The python-broadlink library."""
import socket
from typing import Generator, List, Union, Tuple
from .alarm import S1C
from .climate import hysen
from .cover import dooya
from .device import device, scan
from .exceptions import exception
from .light import lb1
from .remote import rm, rm4
from... | 34.887255 | 90 | 0.603625 | import socket
from typing import Generator, List, Union, Tuple
from .alarm import S1C
from .climate import hysen
from .cover import dooya
from .device import device, scan
from .exceptions import exception
from .light import lb1
from .remote import rm, rm4
from .sensor import a1
from .switch import bg1, mp1, sp1, sp2, ... | true | true |
08f36c0dce1e056f77550929b09f924e87ed8cba | 1,383 | py | Python | photon_stream_production/sim/produce_full_simulation_pass.py | fact-project/photon_stream_production | ca2f946976c9a9717cfcd9364f2361ef385b45aa | [
"MIT"
] | null | null | null | photon_stream_production/sim/produce_full_simulation_pass.py | fact-project/photon_stream_production | ca2f946976c9a9717cfcd9364f2361ef385b45aa | [
"MIT"
] | 2 | 2019-01-17T12:11:27.000Z | 2019-02-27T14:51:05.000Z | photon_stream_production/sim/produce_full_simulation_pass.py | fact-project/photon_stream_production | ca2f946976c9a9717cfcd9364f2361ef385b45aa | [
"MIT"
] | null | null | null | import os
from glob import glob
from os.path import join
import shutil
from ..isdc import qsub
from shutil import which
from multiprocessing import Pool
from .produce_single_simulation_run import produce_single_simulation_run
RUN_NUMBER_DIGITS = 5
def produce_full_simulation_pass(
ceres_dir,
corsika_dir,
... | 25.611111 | 73 | 0.632683 | import os
from glob import glob
from os.path import join
import shutil
from ..isdc import qsub
from shutil import which
from multiprocessing import Pool
from .produce_single_simulation_run import produce_single_simulation_run
RUN_NUMBER_DIGITS = 5
def produce_full_simulation_pass(
ceres_dir,
corsika_dir,
... | true | true |
08f36c7363895feffd8a8af9b83edb5b68e3adca | 87 | py | Python | marbles/core/example_packages/no_tests_package/setup.py | wyegelwel/marbles | f87eac5e849ce284c654f8fe52585bca47f70cc5 | [
"MIT"
] | 109 | 2018-05-20T05:14:13.000Z | 2022-02-08T03:54:56.000Z | marbles/core/example_packages/no_tests_package/setup.py | hudson-and-thames/marbles | 3d37bcf4d848d5477a11bf5e596897b2e65d86b2 | [
"MIT"
] | 65 | 2018-05-20T01:36:45.000Z | 2021-10-15T10:55:34.000Z | marbles/core/example_packages/no_tests_package/setup.py | hudson-and-thames/marbles | 3d37bcf4d848d5477a11bf5e596897b2e65d86b2 | [
"MIT"
] | 16 | 2018-05-26T04:08:27.000Z | 2021-05-01T10:53:16.000Z | from setuptools import setup
setup(
name='no_tests',
test_suite='tests'
)
| 12.428571 | 28 | 0.655172 | from setuptools import setup
setup(
name='no_tests',
test_suite='tests'
)
| true | true |
08f36d01361d09a2b6e9df7d86fd2076af5010c9 | 1,787 | py | Python | apps/marks/admin.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 32 | 2017-02-22T13:38:38.000Z | 2022-03-31T23:29:54.000Z | apps/marks/admin.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 694 | 2017-02-15T23:09:52.000Z | 2022-03-31T23:16:07.000Z | apps/marks/admin.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 35 | 2017-09-02T21:13:09.000Z | 2022-02-21T11:30:30.000Z | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import gettext as _
from reversion.admin import VersionAdmin
from apps.marks.models import Mark, MarkRuleSet, MarkUser, Suspension
class MarkUserInline(admin.TabularInline):
model = MarkUser
extra = 1
verbose_name = _... | 31.910714 | 87 | 0.61108 |
from django.contrib import admin
from django.utils.translation import gettext as _
from reversion.admin import VersionAdmin
from apps.marks.models import Mark, MarkRuleSet, MarkUser, Suspension
class MarkUserInline(admin.TabularInline):
model = MarkUser
extra = 1
verbose_name = _("mottaker")
verbose... | true | true |
08f36d0863a2c1ae8594fb9d066f4d76d6f10a7c | 4,499 | py | Python | src/django_iseries/compositeKey.py | onlysumitg/django-pyodbc-iseries | 5830c9c3afd962c62d880d075dcdb0fcd40a3524 | [
"Apache-2.0"
] | null | null | null | src/django_iseries/compositeKey.py | onlysumitg/django-pyodbc-iseries | 5830c9c3afd962c62d880d075dcdb0fcd40a3524 | [
"Apache-2.0"
] | null | null | null | src/django_iseries/compositeKey.py | onlysumitg/django-pyodbc-iseries | 5830c9c3afd962c62d880d075dcdb0fcd40a3524 | [
"Apache-2.0"
] | null | null | null | """
This code was copied from django viewflow
Looks like new version does not contain this class
So, this can be used as backup
"""
import datetime
import decimal
import json
import uuid
from typing import List
from django.db import DEFAULT_DB_ALIAS, models, router
from django.db.models import signals
from django.db.... | 30.815068 | 91 | 0.60369 |
import datetime
import decimal
import json
import uuid
from typing import List
from django.db import DEFAULT_DB_ALIAS, models, router
from django.db.models import signals
from django.db.models.sql.where import WhereNode, AND
from django.utils.duration import duration_iso_string
from django.utils.functional import Prom... | true | true |
08f36df0617782cc7bae35caab3ecf076f3018d5 | 29,580 | py | Python | sympy/series/sequences.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | sympy/series/sequences.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | sympy/series/sequences.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2018-10-22T09:17:11.000Z | 2018-10-22T09:17:11.000Z | from __future__ import print_function, division
from sympy.core.basic import Basic
from sympy.core.mul import Mul
from sympy.core.singleton import S, Singleton
from sympy.core.symbol import Dummy, Symbol
from sympy.core.compatibility import (range, integer_types, with_metaclass,
i... | 29 | 108 | 0.534449 | from __future__ import print_function, division
from sympy.core.basic import Basic
from sympy.core.mul import Mul
from sympy.core.singleton import S, Singleton
from sympy.core.symbol import Dummy, Symbol
from sympy.core.compatibility import (range, integer_types, with_metaclass,
i... | true | true |
08f36eab9fea7351cc40cad54bc9ca6ee209d555 | 1,659 | py | Python | tests/python/test_static.py | Jack12xl/taichi | 80eba2ee9f0a471f86f1786625ebda04bf3c7236 | [
"MIT"
] | 2 | 2021-06-25T12:18:54.000Z | 2021-12-07T14:54:45.000Z | tests/python/test_static.py | Jack12xl/taichi | 80eba2ee9f0a471f86f1786625ebda04bf3c7236 | [
"MIT"
] | 1 | 2020-02-08T02:11:58.000Z | 2020-02-08T02:11:58.000Z | tests/python/test_static.py | Jack12xl/taichi | 80eba2ee9f0a471f86f1786625ebda04bf3c7236 | [
"MIT"
] | 1 | 2021-08-09T15:47:24.000Z | 2021-08-09T15:47:24.000Z | import numpy as np
import pytest
import taichi as ti
@pytest.mark.parametrize('val', [0, 1])
@ti.test(ti.cpu)
def test_static_if(val):
x = ti.field(ti.i32)
ti.root.dense(ti.i, 1).place(x)
@ti.kernel
def static():
if ti.static(val > 0.5):
x[0] = 1
else:
x[0] =... | 18.640449 | 75 | 0.496685 | import numpy as np
import pytest
import taichi as ti
@pytest.mark.parametrize('val', [0, 1])
@ti.test(ti.cpu)
def test_static_if(val):
x = ti.field(ti.i32)
ti.root.dense(ti.i, 1).place(x)
@ti.kernel
def static():
if ti.static(val > 0.5):
x[0] = 1
else:
x[0] =... | true | true |
08f3700d4142b979669a66c90952d94482843fbe | 487 | py | Python | data/scripts/templates/object/tangible/ship/components/weapon_capacitor/shared_cap_koensayr_mk4.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/ship/components/weapon_capacitor/shared_cap_koensayr_mk4.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/ship/components/weapon_capacitor/shared_cap_koensayr_mk4.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/weapon_capacitor/shared_cap_koensayr_mk4.iff"
resul... | 28.647059 | 97 | 0.74538 |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/weapon_capacitor/shared_cap_koensayr_mk4.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","cap_koensayr_mk4_n")
return result | true | true |
08f37028c79b5902227de117cc8a4e82d91c82c4 | 944 | py | Python | .circleci/copy_artifact_s3.py | teleological/signalfx-java-tracing | 5621cb2b0f3a92a5485fa5a6143fde28b7d3cdc9 | [
"Apache-2.0"
] | 10 | 2019-07-25T14:02:58.000Z | 2022-03-22T12:35:25.000Z | .circleci/copy_artifact_s3.py | teleological/signalfx-java-tracing | 5621cb2b0f3a92a5485fa5a6143fde28b7d3cdc9 | [
"Apache-2.0"
] | 36 | 2019-02-27T18:14:58.000Z | 2022-03-29T20:23:45.000Z | .circleci/copy_artifact_s3.py | teleological/signalfx-java-tracing | 5621cb2b0f3a92a5485fa5a6143fde28b7d3cdc9 | [
"Apache-2.0"
] | 15 | 2019-03-22T22:30:37.000Z | 2021-10-11T10:36:16.000Z | import boto3
import re
import os
import tempfile
LIBS_PATH = './workspace/dd-java-agent/build/libs'
p = re.compile(r"dd-java-agent.*jar$")
S3_BUCKET_NAME = 'datadog-reliability-env'
client = boto3.client('s3', aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY'))
t... | 39.333333 | 134 | 0.697034 | import boto3
import re
import os
import tempfile
LIBS_PATH = './workspace/dd-java-agent/build/libs'
p = re.compile(r"dd-java-agent.*jar$")
S3_BUCKET_NAME = 'datadog-reliability-env'
client = boto3.client('s3', aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY'))
t... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.